build: compile 1.6.7

This commit is contained in:
zhongnan 2021-01-27 15:58:41 +08:00
parent 5cd219ba1d
commit 4beb4a63c7
14 changed files with 61 additions and 32 deletions

File diff suppressed because one or more lines are too long

View File

@ -33,6 +33,11 @@ export function transition(showDefaultValue) {
inited: false,
display: false,
},
ready() {
if (this.data.show === true) {
this.observeShow(true, false);
}
},
methods: {
observeShow(value, old) {
if (value === old) {
@ -47,7 +52,9 @@ export function transition(showDefaultValue) {
this.status = 'enter';
this.$emit('before-enter');
requestAnimationFrame(() => {
this.checkStatus('enter');
if (this.status !== 'enter') {
return;
}
this.$emit('enter');
this.setData({
inited: true,
@ -56,7 +63,9 @@ export function transition(showDefaultValue) {
currentDuration,
});
requestAnimationFrame(() => {
this.checkStatus('enter');
if (this.status !== 'enter') {
return;
}
this.transitionEnded = false;
this.setData({ classes: classNames['enter-to'] });
});
@ -72,25 +81,24 @@ export function transition(showDefaultValue) {
this.status = 'leave';
this.$emit('before-leave');
requestAnimationFrame(() => {
this.checkStatus('leave');
if (this.status !== 'leave') {
return;
}
this.$emit('leave');
this.setData({
classes: classNames.leave,
currentDuration,
});
requestAnimationFrame(() => {
this.checkStatus('leave');
if (this.status !== 'leave') {
return;
}
this.transitionEnded = false;
setTimeout(() => this.onTransitionEnd(), currentDuration);
this.setData({ classes: classNames['leave-to'] });
});
});
},
checkStatus(status) {
if (status !== this.status) {
throw new Error(`incongruent status: ${status}`);
}
},
onTransitionEnd() {
if (this.transitionEnded) {
return;

View File

@ -10,6 +10,7 @@ VantComponent({
type: null,
observer: 'updateChildren',
},
direction: String,
disabled: {
type: Boolean,
observer: 'updateChildren',
@ -17,12 +18,13 @@ VantComponent({
},
methods: {
updateChildren() {
(this.children || []).forEach((child) => this.updateChild(child));
this.children.forEach((child) => this.updateChild(child));
},
updateChild(child) {
const { value, disabled } = this.data;
const { value, disabled, direction } = this.data;
child.setData({
value,
direction,
disabled: disabled || child.data.disabled,
});
},

View File

@ -1 +1,5 @@
<slot />
<wxs src="../wxs/utils.wxs" module="utils" />
<view class="{{ utils.bem('radio-group', [direction]) }}">
<slot></slot>
</view>

View File

@ -1 +1 @@
@import '../common/index.wxss';
@import '../common/index.wxss';.van-radio-group--horizontal{display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap}

View File

@ -1,6 +1,6 @@
<wxs src="../wxs/utils.wxs" module="utils" />
<view class="van-radio custom-class">
<view class="{{ utils.bem('radio', [direction]) }} custom-class">
<view
wx:if="{{ labelPosition === 'left' }}"
class="label-class {{ utils.bem('radio__label', [labelPosition, { disabled }]) }}"

View File

@ -1 +1 @@
@import '../common/index.wxss';.van-radio{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;overflow:hidden;-webkit-user-select:none;user-select:none}.van-radio__icon-wrap{-webkit-flex:none;flex:none}.van-radio__icon{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;width:1em;height:1em;color:transparent;text-align:center;transition-property:color,border-color,background-color;border:1px solid #c8c9cc;border:1px solid var(--radio-border-color,#c8c9cc);font-size:20px;font-size:var(--radio-size,20px);transition-duration:.2s;transition-duration:var(--radio-transition-duration,.2s)}.van-radio__icon--round{border-radius:100%}.van-radio__icon--checked{color:#fff;color:var(--white,#fff);background-color:#1989fa;background-color:var(--radio-checked-icon-color,#1989fa);border-color:#1989fa;border-color:var(--radio-checked-icon-color,#1989fa)}.van-radio__icon--disabled{background-color:#ebedf0;background-color:var(--radio-disabled-background-color,#ebedf0);border-color:#c8c9cc;border-color:var(--radio-disabled-icon-color,#c8c9cc)}.van-radio__icon--disabled.van-radio__icon--checked{color:#c8c9cc;color:var(--radio-disabled-icon-color,#c8c9cc)}.van-radio__label{word-wrap:break-word;margin-left:10px;margin-left:var(--radio-label-margin,10px);color:#323233;color:var(--radio-label-color,#323233);line-height:20px;line-height:var(--radio-size,20px)}.van-radio__label--left{float:left;margin:0 10px 0 0;margin:0 var(--radio-label-margin,10px) 0 0}.van-radio__label--disabled{color:#c8c9cc;color:var(--radio-disabled-label-color,#c8c9cc)}.van-radio__label:empty{margin:0}
@import '../common/index.wxss';.van-radio{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;overflow:hidden;-webkit-user-select:none;user-select:none}.van-radio__icon-wrap{-webkit-flex:none;flex:none}.van-radio--horizontal{margin-right:12px;margin-right:var(--padding-sm,12px)}.van-radio__icon{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;width:1em;height:1em;color:transparent;text-align:center;transition-property:color,border-color,background-color;border:1px solid #c8c9cc;border:1px solid var(--radio-border-color,#c8c9cc);font-size:20px;font-size:var(--radio-size,20px);transition-duration:.2s;transition-duration:var(--radio-transition-duration,.2s)}.van-radio__icon--round{border-radius:100%}.van-radio__icon--checked{color:#fff;color:var(--white,#fff);background-color:#1989fa;background-color:var(--radio-checked-icon-color,#1989fa);border-color:#1989fa;border-color:var(--radio-checked-icon-color,#1989fa)}.van-radio__icon--disabled{background-color:#ebedf0;background-color:var(--radio-disabled-background-color,#ebedf0);border-color:#c8c9cc;border-color:var(--radio-disabled-icon-color,#c8c9cc)}.van-radio__icon--disabled.van-radio__icon--checked{color:#c8c9cc;color:var(--radio-disabled-icon-color,#c8c9cc)}.van-radio__label{word-wrap:break-word;margin-left:10px;margin-left:var(--radio-label-margin,10px);color:#323233;color:var(--radio-label-color,#323233);line-height:20px;line-height:var(--radio-size,20px)}.van-radio__label--left{float:left;margin:0 10px 0 0;margin:0 var(--radio-label-margin,10px) 0 0}.van-radio__label--disabled{color:#c8c9cc;color:var(--radio-disabled-label-color,#c8c9cc)}.van-radio__label:empty{margin:0}

File diff suppressed because one or more lines are too long

View File

@ -58,6 +58,11 @@ function transition(showDefaultValue) {
inited: false,
display: false,
},
ready: function () {
if (this.data.show === true) {
this.observeShow(true, false);
}
},
methods: {
observeShow: function (value, old) {
if (value === old) {
@ -77,7 +82,9 @@ function transition(showDefaultValue) {
this.status = 'enter';
this.$emit('before-enter');
utils_1.requestAnimationFrame(function () {
_this.checkStatus('enter');
if (_this.status !== 'enter') {
return;
}
_this.$emit('enter');
_this.setData({
inited: true,
@ -86,7 +93,9 @@ function transition(showDefaultValue) {
currentDuration: currentDuration,
});
utils_1.requestAnimationFrame(function () {
_this.checkStatus('enter');
if (_this.status !== 'enter') {
return;
}
_this.transitionEnded = false;
_this.setData({ classes: classNames['enter-to'] });
});
@ -107,14 +116,18 @@ function transition(showDefaultValue) {
this.status = 'leave';
this.$emit('before-leave');
utils_1.requestAnimationFrame(function () {
_this.checkStatus('leave');
if (_this.status !== 'leave') {
return;
}
_this.$emit('leave');
_this.setData({
classes: classNames.leave,
currentDuration: currentDuration,
});
utils_1.requestAnimationFrame(function () {
_this.checkStatus('leave');
if (_this.status !== 'leave') {
return;
}
_this.transitionEnded = false;
setTimeout(function () {
return _this.onTransitionEnd();
@ -123,11 +136,6 @@ function transition(showDefaultValue) {
});
});
},
checkStatus: function (status) {
if (status !== this.status) {
throw new Error('incongruent status: ' + status);
}
},
onTransitionEnd: function () {
if (this.transitionEnded) {
return;

View File

@ -12,6 +12,7 @@ component_1.VantComponent({
type: null,
observer: 'updateChildren',
},
direction: String,
disabled: {
type: Boolean,
observer: 'updateChildren',
@ -20,16 +21,18 @@ component_1.VantComponent({
methods: {
updateChildren: function () {
var _this = this;
(this.children || []).forEach(function (child) {
this.children.forEach(function (child) {
return _this.updateChild(child);
});
},
updateChild: function (child) {
var _a = this.data,
value = _a.value,
disabled = _a.disabled;
disabled = _a.disabled,
direction = _a.direction;
child.setData({
value: value,
direction: direction,
disabled: disabled || child.data.disabled,
});
},

View File

@ -1 +1,5 @@
<slot />
<wxs src="../wxs/utils.wxs" module="utils" />
<view class="{{ utils.bem('radio-group', [direction]) }}">
<slot></slot>
</view>

View File

@ -1 +1 @@
@import '../common/index.wxss';
@import '../common/index.wxss';.van-radio-group--horizontal{display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap}

View File

@ -1,6 +1,6 @@
<wxs src="../wxs/utils.wxs" module="utils" />
<view class="van-radio custom-class">
<view class="{{ utils.bem('radio', [direction]) }} custom-class">
<view
wx:if="{{ labelPosition === 'left' }}"
class="label-class {{ utils.bem('radio__label', [labelPosition, { disabled }]) }}"

View File

@ -1 +1 @@
@import '../common/index.wxss';.van-radio{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;overflow:hidden;-webkit-user-select:none;user-select:none}.van-radio__icon-wrap{-webkit-flex:none;flex:none}.van-radio__icon{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;width:1em;height:1em;color:transparent;text-align:center;transition-property:color,border-color,background-color;border:1px solid #c8c9cc;border:1px solid var(--radio-border-color,#c8c9cc);font-size:20px;font-size:var(--radio-size,20px);transition-duration:.2s;transition-duration:var(--radio-transition-duration,.2s)}.van-radio__icon--round{border-radius:100%}.van-radio__icon--checked{color:#fff;color:var(--white,#fff);background-color:#1989fa;background-color:var(--radio-checked-icon-color,#1989fa);border-color:#1989fa;border-color:var(--radio-checked-icon-color,#1989fa)}.van-radio__icon--disabled{background-color:#ebedf0;background-color:var(--radio-disabled-background-color,#ebedf0);border-color:#c8c9cc;border-color:var(--radio-disabled-icon-color,#c8c9cc)}.van-radio__icon--disabled.van-radio__icon--checked{color:#c8c9cc;color:var(--radio-disabled-icon-color,#c8c9cc)}.van-radio__label{word-wrap:break-word;margin-left:10px;margin-left:var(--radio-label-margin,10px);color:#323233;color:var(--radio-label-color,#323233);line-height:20px;line-height:var(--radio-size,20px)}.van-radio__label--left{float:left;margin:0 10px 0 0;margin:0 var(--radio-label-margin,10px) 0 0}.van-radio__label--disabled{color:#c8c9cc;color:var(--radio-disabled-label-color,#c8c9cc)}.van-radio__label:empty{margin:0}
@import '../common/index.wxss';.van-radio{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;overflow:hidden;-webkit-user-select:none;user-select:none}.van-radio__icon-wrap{-webkit-flex:none;flex:none}.van-radio--horizontal{margin-right:12px;margin-right:var(--padding-sm,12px)}.van-radio__icon{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;width:1em;height:1em;color:transparent;text-align:center;transition-property:color,border-color,background-color;border:1px solid #c8c9cc;border:1px solid var(--radio-border-color,#c8c9cc);font-size:20px;font-size:var(--radio-size,20px);transition-duration:.2s;transition-duration:var(--radio-transition-duration,.2s)}.van-radio__icon--round{border-radius:100%}.van-radio__icon--checked{color:#fff;color:var(--white,#fff);background-color:#1989fa;background-color:var(--radio-checked-icon-color,#1989fa);border-color:#1989fa;border-color:var(--radio-checked-icon-color,#1989fa)}.van-radio__icon--disabled{background-color:#ebedf0;background-color:var(--radio-disabled-background-color,#ebedf0);border-color:#c8c9cc;border-color:var(--radio-disabled-icon-color,#c8c9cc)}.van-radio__icon--disabled.van-radio__icon--checked{color:#c8c9cc;color:var(--radio-disabled-icon-color,#c8c9cc)}.van-radio__label{word-wrap:break-word;margin-left:10px;margin-left:var(--radio-label-margin,10px);color:#323233;color:var(--radio-label-color,#323233);line-height:20px;line-height:var(--radio-size,20px)}.van-radio__label--left{float:left;margin:0 10px 0 0;margin:0 var(--radio-label-margin,10px) 0 0}.van-radio__label--disabled{color:#c8c9cc;color:var(--radio-disabled-label-color,#c8c9cc)}.van-radio__label:empty{margin:0}