diff --git a/dist/action-sheet/index.js b/dist/action-sheet/index.js index 8065c833..30444810 100644 --- a/dist/action-sheet/index.js +++ b/dist/action-sheet/index.js @@ -1,5 +1,8 @@ import { VantComponent } from '../common/component'; +import { button } from '../mixins/button'; +import { openType } from '../mixins/open-type'; VantComponent({ + mixins: [button, openType], props: { show: Boolean, title: String, diff --git a/dist/action-sheet/index.wxml b/dist/action-sheet/index.wxml index bed9b06b..7ed28196 100644 --- a/dist/action-sheet/index.wxml +++ b/dist/action-sheet/index.wxml @@ -33,6 +33,19 @@ hover-class="van-action-sheet__item--hover" data-index="{{ index }}" bind:tap="onSelect" + bindgetuserinfo="bindGetUserInfo" + bindcontact="bindContact" + bindgetphonenumber="bindGetPhoneNumber" + binderror="bindError" + bindlaunchapp="bindLaunchApp" + bindopensetting="bindOpenSetting" + lang="{{ lang }}" + session-from="{{ sessionFrom }}" + send-message-title="{{ sendMessageTitle }}" + send-message-path="{{ sendMessagePath }}" + send-message-img="{{ sendMessageImg }}" + show-message-card="{{ showMessageCard }}" + app-parameter="{{ appParameter }}" > {{ item.name }} diff --git a/dist/circle/index.js b/dist/circle/index.js index 08c7eb4d..ccd5dc7b 100644 --- a/dist/circle/index.js +++ b/dist/circle/index.js @@ -26,7 +26,6 @@ VantComponent({ size: { type: Number, value: 100, - observer: 'setStyle' }, fill: String, layerColor: { @@ -48,7 +47,6 @@ VantComponent({ } }, data: { - style: 'width: 100px; height: 100px;', hoverColor: BLUE }, methods: { @@ -71,11 +69,6 @@ VantComponent({ } this.setData({ hoverColor }); }, - setStyle() { - const { size } = this.data; - const style = `width: ${size}px; height: ${size}px;`; - this.setData({ style }); - }, presetCanvas(context, strokeStyle, beginAngle, endAngle, fill) { const { strokeWidth, lineCap, clockwise, size } = this.data; const position = size / 2; diff --git a/dist/circle/index.wxml b/dist/circle/index.wxml index 215122ff..607fc9d5 100644 --- a/dist/circle/index.wxml +++ b/dist/circle/index.wxml @@ -1,5 +1,7 @@ + + - + diff --git a/dist/radio/index.js b/dist/radio/index.js index 8d374aba..983cde0f 100644 --- a/dist/radio/index.js +++ b/dist/radio/index.js @@ -37,9 +37,10 @@ VantComponent({ instance.$emit('input', value); instance.$emit('change', value); }, - onChange(event) { - console.log(event); - this.emitChange(this.data.name); + onChange() { + if (!this.data.disabled) { + this.emitChange(this.data.name); + } }, onClickLabel() { const { disabled, labelDisabled, name } = this.data; diff --git a/dist/tabs/index.js b/dist/tabs/index.js index 8ba4002e..c927edd6 100644 --- a/dist/tabs/index.js +++ b/dist/tabs/index.js @@ -31,8 +31,7 @@ VantComponent({ animated: { type: Boolean, observer() { - this.setTrack(); - this.children.forEach((child) => child.updateRender()); + this.children.forEach((child, index) => child.updateRender(index === this.data.currentIndex, this)); } }, swipeable: Boolean, @@ -93,7 +92,7 @@ VantComponent({ lazyRender: { type: Boolean, value: true - }, + } }, data: { tabs: [], @@ -112,7 +111,6 @@ VantComponent({ container: () => this.createSelectorQuery().select('.van-tabs') }); this.setLine(true); - this.setTrack(); this.scrollIntoView(); }, methods: { @@ -177,7 +175,6 @@ VantComponent({ this.setData({ currentIndex }); wx.nextTick(() => { this.setLine(); - this.setTrack(); this.scrollIntoView(); this.trigger('input'); if (shouldEmitChange) { @@ -224,19 +221,6 @@ VantComponent({ }); }); }, - setTrack() { - const { animated, duration, currentIndex } = this.data; - if (!animated) { - return; - } - this.setData({ - trackStyle: ` - transform: translate3d(${-100 * currentIndex}%, 0, 0); - -webkit-transition-duration: ${duration}s; - transition-duration: ${duration}s; - ` - }); - }, // scroll active tab into view scrollIntoView() { const { currentIndex, scrollable } = this.data; diff --git a/dist/tabs/index.wxml b/dist/tabs/index.wxml index ed8f0d9c..9e8ca1ac 100644 --- a/dist/tabs/index.wxml +++ b/dist/tabs/index.wxml @@ -53,7 +53,10 @@ bind:touchend="onTouchEnd" bind:touchcancel="onTouchEnd" > - + diff --git a/dist/tabs/index.wxs b/dist/tabs/index.wxs index aa117ce7..2b3c5144 100644 --- a/dist/tabs/index.wxs +++ b/dist/tabs/index.wxs @@ -51,5 +51,18 @@ function tabStyle( return styles.join(';'); } +function trackStyle(data) { + if (!data.animated) { + return ''; + } + + return [ + 'transform: translate3d(' + -100 * data.currentIndex + '%, 0, 0)', + '-webkit-transition-duration: ' + data.duration + 's', + 'transition-duration: ' + data.duration + 's' + ].join(';'); +} + module.exports.tabClass = tabClass; module.exports.tabStyle = tabStyle; +module.exports.trackStyle = trackStyle; diff --git a/dist/uploader/index.wxml b/dist/uploader/index.wxml index 81223fd1..ce0f260c 100644 --- a/dist/uploader/index.wxml +++ b/dist/uploader/index.wxml @@ -44,7 +44,7 @@ diff --git a/dist/uploader/index.wxss b/dist/uploader/index.wxss index a1508ab5..6e89898c 100644 --- a/dist/uploader/index.wxss +++ b/dist/uploader/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-uploader{position:relative;display:inline-block}.van-uploader__wrapper{display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap}.van-uploader__slot:empty{display:none}.van-uploader__slot:not(:empty)+.van-uploader__upload{display:none!important}.van-uploader__upload{position:relative;display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;width:80px;height:80px;margin:0 8px 8px 0;background-color:#fff;border:1px dashed #ebedf0;border-radius:4px}.van-uploader__upload-icon{display:inline-block;width:24px;height:24px;color:#969799;font-size:24px}.van-uploader__upload-text{margin-top:8px;color:#969799;font-size:12px}.van-uploader__preview{position:relative;margin:0 8px 8px 0}.van-uploader__preview-image{display:block;width:80px;height:80px;border-radius:4px}.van-uploader__preview-delete{position:absolute;top:-8px;right:-8px;color:#969799;font-size:18px;background-color:#fff;border-radius:100%}.van-uploader__file{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;width:80px;height:80px;background-color:#f7f8fa;border-radius:4px}.van-uploader__file-icon{display:inline-block;width:20px;height:20px;color:#646566;font-size:20px}.van-uploader__file-name{box-sizing:border-box;width:100%;margin-top:8px;padding:0 5px;color:#646566;font-size:12px;text-align:center} \ No newline at end of file +@import '../common/index.wxss';.van-uploader{position:relative;display:inline-block}.van-uploader__wrapper{display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap}.van-uploader__slot:empty{display:none}.van-uploader__slot:not(:empty)+.van-uploader__upload{display:none!important}.van-uploader__upload{position:relative;display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;width:80px;height:80px;margin:0 8px 8px 0;background-color:#fff;border:1px dashed #ebedf0;border-radius:4px}.van-uploader__upload-icon{display:inline-block;width:24px;height:24px;color:#969799;font-size:24px}.van-uploader__upload-text{margin-top:8px;color:#969799;font-size:12px}.van-uploader__upload--disabled{opacity:.5;opacity:var(--uploader-disabled-opacity,.5)}.van-uploader__preview{position:relative;margin:0 8px 8px 0}.van-uploader__preview-image{display:block;width:80px;height:80px;border-radius:4px}.van-uploader__preview-delete{position:absolute;top:-8px;right:-8px;color:#969799;font-size:18px;background-color:#fff;border-radius:100%}.van-uploader__file{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;width:80px;height:80px;background-color:#f7f8fa;border-radius:4px}.van-uploader__file-icon{display:inline-block;width:20px;height:20px;color:#646566;font-size:20px}.van-uploader__file-name{box-sizing:border-box;width:100%;margin-top:8px;padding:0 5px;color:#646566;font-size:12px;text-align:center} \ No newline at end of file diff --git a/lib/action-sheet/index.js b/lib/action-sheet/index.js index c59eb893..b96ec5c5 100644 --- a/lib/action-sheet/index.js +++ b/lib/action-sheet/index.js @@ -1,7 +1,10 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var component_1 = require("../common/component"); +var button_1 = require("../mixins/button"); +var open_type_1 = require("../mixins/open-type"); component_1.VantComponent({ + mixins: [button_1.button, open_type_1.openType], props: { show: Boolean, title: String, diff --git a/lib/action-sheet/index.wxml b/lib/action-sheet/index.wxml index bed9b06b..7ed28196 100644 --- a/lib/action-sheet/index.wxml +++ b/lib/action-sheet/index.wxml @@ -33,6 +33,19 @@ hover-class="van-action-sheet__item--hover" data-index="{{ index }}" bind:tap="onSelect" + bindgetuserinfo="bindGetUserInfo" + bindcontact="bindContact" + bindgetphonenumber="bindGetPhoneNumber" + binderror="bindError" + bindlaunchapp="bindLaunchApp" + bindopensetting="bindOpenSetting" + lang="{{ lang }}" + session-from="{{ sessionFrom }}" + send-message-title="{{ sendMessageTitle }}" + send-message-path="{{ sendMessagePath }}" + send-message-img="{{ sendMessageImg }}" + show-message-card="{{ showMessageCard }}" + app-parameter="{{ appParameter }}" > {{ item.name }} diff --git a/lib/circle/index.js b/lib/circle/index.js index f1bd362d..77feb1e9 100644 --- a/lib/circle/index.js +++ b/lib/circle/index.js @@ -28,7 +28,6 @@ component_1.VantComponent({ size: { type: Number, value: 100, - observer: 'setStyle' }, fill: String, layerColor: { @@ -50,7 +49,6 @@ component_1.VantComponent({ } }, data: { - style: 'width: 100px; height: 100px;', hoverColor: color_1.BLUE }, methods: { @@ -73,11 +71,6 @@ component_1.VantComponent({ } this.setData({ hoverColor: hoverColor }); }, - setStyle: function () { - var size = this.data.size; - var style = "width: " + size + "px; height: " + size + "px;"; - this.setData({ style: style }); - }, presetCanvas: function (context, strokeStyle, beginAngle, endAngle, fill) { var _a = this.data, strokeWidth = _a.strokeWidth, lineCap = _a.lineCap, clockwise = _a.clockwise, size = _a.size; var position = size / 2; diff --git a/lib/circle/index.wxml b/lib/circle/index.wxml index 215122ff..607fc9d5 100644 --- a/lib/circle/index.wxml +++ b/lib/circle/index.wxml @@ -1,5 +1,7 @@ + + - + diff --git a/lib/radio/index.js b/lib/radio/index.js index 33fcd84e..9371b95d 100644 --- a/lib/radio/index.js +++ b/lib/radio/index.js @@ -39,9 +39,10 @@ component_1.VantComponent({ instance.$emit('input', value); instance.$emit('change', value); }, - onChange: function (event) { - console.log(event); - this.emitChange(this.data.name); + onChange: function () { + if (!this.data.disabled) { + this.emitChange(this.data.name); + } }, onClickLabel: function () { var _a = this.data, disabled = _a.disabled, labelDisabled = _a.labelDisabled, name = _a.name; diff --git a/lib/tabs/index.js b/lib/tabs/index.js index c50204e5..e2096d5c 100644 --- a/lib/tabs/index.js +++ b/lib/tabs/index.js @@ -33,8 +33,10 @@ component_1.VantComponent({ animated: { type: Boolean, observer: function () { - this.setTrack(); - this.children.forEach(function (child) { return child.updateRender(); }); + var _this = this; + this.children.forEach(function (child, index) { + return child.updateRender(index === _this.data.currentIndex, _this); + }); } }, swipeable: Boolean, @@ -95,7 +97,7 @@ component_1.VantComponent({ lazyRender: { type: Boolean, value: true - }, + } }, data: { tabs: [], @@ -115,7 +117,6 @@ component_1.VantComponent({ container: function () { return _this.createSelectorQuery().select('.van-tabs'); } }); this.setLine(true); - this.setTrack(); this.scrollIntoView(); }, methods: { @@ -182,7 +183,6 @@ component_1.VantComponent({ this.setData({ currentIndex: currentIndex }); wx.nextTick(function () { _this.setLine(); - _this.setTrack(); _this.scrollIntoView(); _this.trigger('input'); if (shouldEmitChange) { @@ -224,15 +224,6 @@ component_1.VantComponent({ }); }); }, - setTrack: function () { - var _a = this.data, animated = _a.animated, duration = _a.duration, currentIndex = _a.currentIndex; - if (!animated) { - return; - } - this.setData({ - trackStyle: "\n transform: translate3d(" + -100 * currentIndex + "%, 0, 0);\n -webkit-transition-duration: " + duration + "s;\n transition-duration: " + duration + "s;\n " - }); - }, // scroll active tab into view scrollIntoView: function () { var _this = this; diff --git a/lib/tabs/index.wxml b/lib/tabs/index.wxml index ed8f0d9c..9e8ca1ac 100644 --- a/lib/tabs/index.wxml +++ b/lib/tabs/index.wxml @@ -53,7 +53,10 @@ bind:touchend="onTouchEnd" bind:touchcancel="onTouchEnd" > - + diff --git a/lib/tabs/index.wxs b/lib/tabs/index.wxs index aa117ce7..2b3c5144 100644 --- a/lib/tabs/index.wxs +++ b/lib/tabs/index.wxs @@ -51,5 +51,18 @@ function tabStyle( return styles.join(';'); } +function trackStyle(data) { + if (!data.animated) { + return ''; + } + + return [ + 'transform: translate3d(' + -100 * data.currentIndex + '%, 0, 0)', + '-webkit-transition-duration: ' + data.duration + 's', + 'transition-duration: ' + data.duration + 's' + ].join(';'); +} + module.exports.tabClass = tabClass; module.exports.tabStyle = tabStyle; +module.exports.trackStyle = trackStyle; diff --git a/lib/uploader/index.wxml b/lib/uploader/index.wxml index 81223fd1..ce0f260c 100644 --- a/lib/uploader/index.wxml +++ b/lib/uploader/index.wxml @@ -44,7 +44,7 @@ diff --git a/lib/uploader/index.wxss b/lib/uploader/index.wxss index a1508ab5..6e89898c 100644 --- a/lib/uploader/index.wxss +++ b/lib/uploader/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-uploader{position:relative;display:inline-block}.van-uploader__wrapper{display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap}.van-uploader__slot:empty{display:none}.van-uploader__slot:not(:empty)+.van-uploader__upload{display:none!important}.van-uploader__upload{position:relative;display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;width:80px;height:80px;margin:0 8px 8px 0;background-color:#fff;border:1px dashed #ebedf0;border-radius:4px}.van-uploader__upload-icon{display:inline-block;width:24px;height:24px;color:#969799;font-size:24px}.van-uploader__upload-text{margin-top:8px;color:#969799;font-size:12px}.van-uploader__preview{position:relative;margin:0 8px 8px 0}.van-uploader__preview-image{display:block;width:80px;height:80px;border-radius:4px}.van-uploader__preview-delete{position:absolute;top:-8px;right:-8px;color:#969799;font-size:18px;background-color:#fff;border-radius:100%}.van-uploader__file{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;width:80px;height:80px;background-color:#f7f8fa;border-radius:4px}.van-uploader__file-icon{display:inline-block;width:20px;height:20px;color:#646566;font-size:20px}.van-uploader__file-name{box-sizing:border-box;width:100%;margin-top:8px;padding:0 5px;color:#646566;font-size:12px;text-align:center} \ No newline at end of file +@import '../common/index.wxss';.van-uploader{position:relative;display:inline-block}.van-uploader__wrapper{display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap}.van-uploader__slot:empty{display:none}.van-uploader__slot:not(:empty)+.van-uploader__upload{display:none!important}.van-uploader__upload{position:relative;display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;width:80px;height:80px;margin:0 8px 8px 0;background-color:#fff;border:1px dashed #ebedf0;border-radius:4px}.van-uploader__upload-icon{display:inline-block;width:24px;height:24px;color:#969799;font-size:24px}.van-uploader__upload-text{margin-top:8px;color:#969799;font-size:12px}.van-uploader__upload--disabled{opacity:.5;opacity:var(--uploader-disabled-opacity,.5)}.van-uploader__preview{position:relative;margin:0 8px 8px 0}.van-uploader__preview-image{display:block;width:80px;height:80px;border-radius:4px}.van-uploader__preview-delete{position:absolute;top:-8px;right:-8px;color:#969799;font-size:18px;background-color:#fff;border-radius:100%}.van-uploader__file{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;width:80px;height:80px;background-color:#f7f8fa;border-radius:4px}.van-uploader__file-icon{display:inline-block;width:20px;height:20px;color:#646566;font-size:20px}.van-uploader__file-name{box-sizing:border-box;width:100%;margin-top:8px;padding:0 5px;color:#646566;font-size:12px;text-align:center} \ No newline at end of file