[build] 0.5.16

This commit is contained in:
rex-zsd 2019-07-15 14:27:10 +08:00
parent a3516bfb5e
commit f99f121ba8
18 changed files with 80 additions and 36 deletions

View File

@ -1 +1 @@
@import '../common/index.wxss';.van-field__body{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center}.van-field__body--textarea{min-height:24px}.van-field__input{position:relative;display:block;width:100%;height:24px;min-height:24px;padding:0;margin:0;line-height:inherit;color:#333;text-align:left;background-color:initial;border:0;box-sizing:border-box;resize:none}.van-field__input--disabled{color:#999;background-color:initial;opacity:1}.van-field__input--center{text-align:center}.van-field__input--right{text-align:right}.van-field__placeholder{position:absolute;top:0;left:0;color:#999;pointer-events:none}.van-field__placeholder--error{color:#f44}.van-field__icon-root{display:-webkit-flex;display:flex;min-height:24px;-webkit-align-items:center;align-items:center}.van-field__clear-root,.van-field__icon-container{padding:0 10px;margin-right:-10px;line-height:inherit;vertical-align:middle}.van-field__button,.van-field__clear-root,.van-field__icon-container{-webkit-flex-shrink:0;flex-shrink:0}.van-field__clear-root{color:#c9c9c9}.van-field__icon-container{color:#999}.van-field__icon-container:empty{display:none}.van-field__button{padding-left:10px}.van-field__button:empty{display:none}.van-field__error-message{font-size:12px;color:#f44;text-align:left}.van-field__error-message--center{text-align:center}.van-field__error-message--right{text-align:right} @import '../common/index.wxss';.van-field__body{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center}.van-field__body--textarea{min-height:24px}.van-field__input{position:relative;display:block;width:100%;height:24px;min-height:24px;padding:0;margin:0;line-height:inherit;color:#333;text-align:left;background-color:initial;border:0;box-sizing:border-box;resize:none}.van-field__input--disabled{color:#999;background-color:initial;opacity:1}.van-field__input--center{text-align:center}.van-field__input--right{text-align:right}.van-field__placeholder{position:absolute;top:0;right:0;left:0;color:#999;pointer-events:none}.van-field__placeholder--error{color:#f44}.van-field__icon-root{display:-webkit-flex;display:flex;min-height:24px;-webkit-align-items:center;align-items:center}.van-field__clear-root,.van-field__icon-container{padding:0 10px;margin-right:-10px;line-height:inherit;vertical-align:middle}.van-field__button,.van-field__clear-root,.van-field__icon-container{-webkit-flex-shrink:0;flex-shrink:0}.van-field__clear-root{color:#c9c9c9}.van-field__icon-container{color:#999}.van-field__icon-container:empty{display:none}.van-field__button{padding-left:10px}.van-field__button:empty{display:none}.van-field__error-message{font-size:12px;color:#f44;text-align:left}.van-field__error-message--center{text-align:center}.van-field__error-message--right{text-align:right}

File diff suppressed because one or more lines are too long

View File

@ -22,15 +22,13 @@ export const transition = function (showDefaultValue) {
}, },
name: { name: {
type: String, type: String,
value: 'fade', value: 'fade'
observer: 'updateClasses'
} }
}, },
data: { data: {
type: '', type: '',
inited: false, inited: false,
display: false, display: false
classNames: getClassNames('fade')
}, },
attached() { attached() {
if (this.data.show) { if (this.data.show) {
@ -46,13 +44,9 @@ export const transition = function (showDefaultValue) {
this.leave(); this.leave();
} }
}, },
updateClasses(name) {
this.set({
classNames: getClassNames(name)
});
},
enter() { enter() {
const { classNames, duration } = this.data; const { duration, name } = this.data;
const classNames = getClassNames(name);
const currentDuration = isObj(duration) ? duration.leave : duration; const currentDuration = isObj(duration) ? duration.leave : duration;
this.status = 'enter'; this.status = 'enter';
Promise.resolve() Promise.resolve()
@ -76,7 +70,8 @@ export const transition = function (showDefaultValue) {
.catch(() => { }); .catch(() => { });
}, },
leave() { leave() {
const { classNames, duration } = this.data; const { duration, name } = this.data;
const classNames = getClassNames(name);
const currentDuration = isObj(duration) ? duration.leave : duration; const currentDuration = isObj(duration) ? duration.leave : duration;
this.status = 'leave'; this.status = 'leave';
Promise.resolve() Promise.resolve()

7
dist/popup/index.js vendored
View File

@ -48,10 +48,13 @@ VantComponent({
}, },
observeClass() { observeClass() {
const { transition, position } = this.data; const { transition, position } = this.data;
this.updateClasses(transition || position); const updateData = {
name: transition || position
};
if (transition === 'none') { if (transition === 'none') {
this.set({ duration: 0 }); updateData.duration = 0;
} }
this.set(updateData);
} }
} }
}); });

5
dist/radio/index.js vendored
View File

@ -17,7 +17,10 @@ VantComponent({
disabled: Boolean, disabled: Boolean,
useIconSlot: Boolean, useIconSlot: Boolean,
checkedColor: String, checkedColor: String,
labelPosition: String, labelPosition: {
type: String,
value: 'right'
},
labelDisabled: Boolean, labelDisabled: Boolean,
shape: { shape: {
type: String, type: String,

13
dist/radio/index.wxml vendored
View File

@ -1,6 +1,13 @@
<wxs src="../wxs/utils.wxs" module="utils" /> <wxs src="../wxs/utils.wxs" module="utils" />
<view class="van-radio custom-class"> <view class="van-radio custom-class">
<view
wx:if="{{ labelPosition === 'left' }}"
class="label-class {{ utils.bem('radio__label', [labelPosition, { disabled }]) }}"
bindtap="onClickLabel"
>
<slot />
</view>
<view class="van-radio__icon-wrap" bindtap="onChange"> <view class="van-radio__icon-wrap" bindtap="onChange">
<slot wx:if="{{ useIconSlot }}" name="icon" /> <slot wx:if="{{ useIconSlot }}" name="icon" />
<van-icon <van-icon
@ -12,7 +19,11 @@
custom-style="line-height: 20px;" custom-style="line-height: 20px;"
/> />
</view> </view>
<view class="label-class {{ utils.bem('radio__label', [labelPosition, { disabled }]) }}" bindtap="onClickLabel"> <view
wx:if="{{ labelPosition === 'right' }}"
class="label-class {{ utils.bem('radio__label', [labelPosition, { disabled }]) }}"
bindtap="onClickLabel"
>
<slot /> <slot />
</view> </view>
</view> </view>

View File

@ -16,7 +16,7 @@ VantComponent({
}, },
mixins: [touch], mixins: [touch],
data: { data: {
catchMove: true catchMove: false
}, },
created() { created() {
this.offset = 0; this.offset = 0;
@ -57,6 +57,7 @@ VantComponent({
else { else {
this.swipeMove(0); this.swipeMove(0);
} }
this.set({ catchMove: false });
}, },
startDrag(event) { startDrag(event) {
if (this.data.disabled) { if (this.data.disabled) {

View File

@ -3,13 +3,16 @@ VantComponent({
field: true, field: true,
props: { props: {
value: null, value: null,
icon: String,
title: String, title: String,
label: String,
border: Boolean, border: Boolean,
checked: Boolean, checked: Boolean,
loading: Boolean, loading: Boolean,
disabled: Boolean, disabled: Boolean,
activeColor: String, activeColor: String,
inactiveColor: String, inactiveColor: String,
useLabelSlot: Boolean,
size: { size: {
type: String, type: String,
value: '24px' value: '24px'

View File

@ -1,9 +1,15 @@
<van-cell <van-cell
center center
title="{{ title }}" title="{{ title }}"
label="{{ label }}"
border="{{ border }}" border="{{ border }}"
icon="{{ icon }}"
custom-class="van-switch-cell" custom-class="van-switch-cell"
use-label-slot="{{ useLabelSlot }}"
> >
<slot slot="icon" name="icon" />
<slot slot="title" name="title" />
<slot slot="label" name="label" />
<van-switch <van-switch
size="{{ size }}" size="{{ size }}"
checked="{{ checked }}" checked="{{ checked }}"

View File

@ -1 +1 @@
@import '../common/index.wxss';.van-field__body{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center}.van-field__body--textarea{min-height:24px}.van-field__input{position:relative;display:block;width:100%;height:24px;min-height:24px;padding:0;margin:0;line-height:inherit;color:#333;text-align:left;background-color:initial;border:0;box-sizing:border-box;resize:none}.van-field__input--disabled{color:#999;background-color:initial;opacity:1}.van-field__input--center{text-align:center}.van-field__input--right{text-align:right}.van-field__placeholder{position:absolute;top:0;left:0;color:#999;pointer-events:none}.van-field__placeholder--error{color:#f44}.van-field__icon-root{display:-webkit-flex;display:flex;min-height:24px;-webkit-align-items:center;align-items:center}.van-field__clear-root,.van-field__icon-container{padding:0 10px;margin-right:-10px;line-height:inherit;vertical-align:middle}.van-field__button,.van-field__clear-root,.van-field__icon-container{-webkit-flex-shrink:0;flex-shrink:0}.van-field__clear-root{color:#c9c9c9}.van-field__icon-container{color:#999}.van-field__icon-container:empty{display:none}.van-field__button{padding-left:10px}.van-field__button:empty{display:none}.van-field__error-message{font-size:12px;color:#f44;text-align:left}.van-field__error-message--center{text-align:center}.van-field__error-message--right{text-align:right} @import '../common/index.wxss';.van-field__body{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center}.van-field__body--textarea{min-height:24px}.van-field__input{position:relative;display:block;width:100%;height:24px;min-height:24px;padding:0;margin:0;line-height:inherit;color:#333;text-align:left;background-color:initial;border:0;box-sizing:border-box;resize:none}.van-field__input--disabled{color:#999;background-color:initial;opacity:1}.van-field__input--center{text-align:center}.van-field__input--right{text-align:right}.van-field__placeholder{position:absolute;top:0;right:0;left:0;color:#999;pointer-events:none}.van-field__placeholder--error{color:#f44}.van-field__icon-root{display:-webkit-flex;display:flex;min-height:24px;-webkit-align-items:center;align-items:center}.van-field__clear-root,.van-field__icon-container{padding:0 10px;margin-right:-10px;line-height:inherit;vertical-align:middle}.van-field__button,.van-field__clear-root,.van-field__icon-container{-webkit-flex-shrink:0;flex-shrink:0}.van-field__clear-root{color:#c9c9c9}.van-field__icon-container{color:#999}.van-field__icon-container:empty{display:none}.van-field__button{padding-left:10px}.van-field__button:empty{display:none}.van-field__error-message{font-size:12px;color:#f44;text-align:left}.van-field__error-message--center{text-align:center}.van-field__error-message--right{text-align:right}

File diff suppressed because one or more lines are too long

View File

@ -24,15 +24,13 @@ exports.transition = function (showDefaultValue) {
}, },
name: { name: {
type: String, type: String,
value: 'fade', value: 'fade'
observer: 'updateClasses'
} }
}, },
data: { data: {
type: '', type: '',
inited: false, inited: false,
display: false, display: false
classNames: getClassNames('fade')
}, },
attached: function () { attached: function () {
if (this.data.show) { if (this.data.show) {
@ -48,14 +46,10 @@ exports.transition = function (showDefaultValue) {
this.leave(); this.leave();
} }
}, },
updateClasses: function (name) {
this.set({
classNames: getClassNames(name)
});
},
enter: function () { enter: function () {
var _this = this; var _this = this;
var _a = this.data, classNames = _a.classNames, duration = _a.duration; var _a = this.data, duration = _a.duration, name = _a.name;
var classNames = getClassNames(name);
var currentDuration = utils_1.isObj(duration) ? duration.leave : duration; var currentDuration = utils_1.isObj(duration) ? duration.leave : duration;
this.status = 'enter'; this.status = 'enter';
Promise.resolve() Promise.resolve()
@ -80,7 +74,8 @@ exports.transition = function (showDefaultValue) {
}, },
leave: function () { leave: function () {
var _this = this; var _this = this;
var _a = this.data, classNames = _a.classNames, duration = _a.duration; var _a = this.data, duration = _a.duration, name = _a.name;
var classNames = getClassNames(name);
var currentDuration = utils_1.isObj(duration) ? duration.leave : duration; var currentDuration = utils_1.isObj(duration) ? duration.leave : duration;
this.status = 'leave'; this.status = 'leave';
Promise.resolve() Promise.resolve()

View File

@ -50,10 +50,13 @@ component_1.VantComponent({
}, },
observeClass: function () { observeClass: function () {
var _a = this.data, transition = _a.transition, position = _a.position; var _a = this.data, transition = _a.transition, position = _a.position;
this.updateClasses(transition || position); var updateData = {
name: transition || position
};
if (transition === 'none') { if (transition === 'none') {
this.set({ duration: 0 }); updateData.duration = 0;
} }
this.set(updateData);
} }
} }
}); });

View File

@ -19,7 +19,10 @@ component_1.VantComponent({
disabled: Boolean, disabled: Boolean,
useIconSlot: Boolean, useIconSlot: Boolean,
checkedColor: String, checkedColor: String,
labelPosition: String, labelPosition: {
type: String,
value: 'right'
},
labelDisabled: Boolean, labelDisabled: Boolean,
shape: { shape: {
type: String, type: String,

View File

@ -1,6 +1,13 @@
<wxs src="../wxs/utils.wxs" module="utils" /> <wxs src="../wxs/utils.wxs" module="utils" />
<view class="van-radio custom-class"> <view class="van-radio custom-class">
<view
wx:if="{{ labelPosition === 'left' }}"
class="label-class {{ utils.bem('radio__label', [labelPosition, { disabled }]) }}"
bindtap="onClickLabel"
>
<slot />
</view>
<view class="van-radio__icon-wrap" bindtap="onChange"> <view class="van-radio__icon-wrap" bindtap="onChange">
<slot wx:if="{{ useIconSlot }}" name="icon" /> <slot wx:if="{{ useIconSlot }}" name="icon" />
<van-icon <van-icon
@ -12,7 +19,11 @@
custom-style="line-height: 20px;" custom-style="line-height: 20px;"
/> />
</view> </view>
<view class="label-class {{ utils.bem('radio__label', [labelPosition, { disabled }]) }}" bindtap="onClickLabel"> <view
wx:if="{{ labelPosition === 'right' }}"
class="label-class {{ utils.bem('radio__label', [labelPosition, { disabled }]) }}"
bindtap="onClickLabel"
>
<slot /> <slot />
</view> </view>
</view> </view>

View File

@ -18,7 +18,7 @@ component_1.VantComponent({
}, },
mixins: [touch_1.touch], mixins: [touch_1.touch],
data: { data: {
catchMove: true catchMove: false
}, },
created: function () { created: function () {
this.offset = 0; this.offset = 0;
@ -55,6 +55,7 @@ component_1.VantComponent({
else { else {
this.swipeMove(0); this.swipeMove(0);
} }
this.set({ catchMove: false });
}, },
startDrag: function (event) { startDrag: function (event) {
if (this.data.disabled) { if (this.data.disabled) {

View File

@ -5,13 +5,16 @@ component_1.VantComponent({
field: true, field: true,
props: { props: {
value: null, value: null,
icon: String,
title: String, title: String,
label: String,
border: Boolean, border: Boolean,
checked: Boolean, checked: Boolean,
loading: Boolean, loading: Boolean,
disabled: Boolean, disabled: Boolean,
activeColor: String, activeColor: String,
inactiveColor: String, inactiveColor: String,
useLabelSlot: Boolean,
size: { size: {
type: String, type: String,
value: '24px' value: '24px'

View File

@ -1,9 +1,15 @@
<van-cell <van-cell
center center
title="{{ title }}" title="{{ title }}"
label="{{ label }}"
border="{{ border }}" border="{{ border }}"
icon="{{ icon }}"
custom-class="van-switch-cell" custom-class="van-switch-cell"
use-label-slot="{{ useLabelSlot }}"
> >
<slot slot="icon" name="icon" />
<slot slot="title" name="title" />
<slot slot="label" name="label" />
<van-switch <van-switch
size="{{ size }}" size="{{ size }}"
checked="{{ checked }}" checked="{{ checked }}"