mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-05 19:41:45 +08:00
build: compile 1.4.0
This commit is contained in:
parent
85fd5e68e8
commit
16cd540578
5
dist/calendar/index.js
vendored
5
dist/calendar/index.js
vendored
@ -41,10 +41,7 @@ VantComponent({
|
||||
},
|
||||
},
|
||||
allowSameDay: Boolean,
|
||||
confirmDisabledText: {
|
||||
type: String,
|
||||
value: '确定',
|
||||
},
|
||||
confirmDisabledText: String,
|
||||
type: {
|
||||
type: String,
|
||||
value: 'single',
|
||||
|
59
dist/collapse-item/index.js
vendored
59
dist/collapse-item/index.js
vendored
@ -1,5 +1,4 @@
|
||||
import { VantComponent } from '../common/component';
|
||||
const nextTick = () => new Promise((resolve) => setTimeout(resolve, 20));
|
||||
VantComponent({
|
||||
classes: ['title-class', 'content-class'],
|
||||
relation: {
|
||||
@ -25,20 +24,17 @@ VantComponent({
|
||||
},
|
||||
},
|
||||
data: {
|
||||
contentHeight: 0,
|
||||
expanded: false,
|
||||
transition: false,
|
||||
},
|
||||
created() {
|
||||
this.animation = wx.createAnimation({
|
||||
duration: 0,
|
||||
timingFunction: 'ease-in-out',
|
||||
});
|
||||
},
|
||||
mounted() {
|
||||
this.updateExpanded()
|
||||
.then(nextTick)
|
||||
.then(() => {
|
||||
const data = { transition: true };
|
||||
if (this.data.expanded) {
|
||||
data.contentHeight = 'auto';
|
||||
}
|
||||
this.setData(data);
|
||||
});
|
||||
this.updateExpanded();
|
||||
this.inited = true;
|
||||
},
|
||||
methods: {
|
||||
updateExpanded() {
|
||||
@ -53,25 +49,37 @@ VantComponent({
|
||||
const expanded = accordion
|
||||
? value === currentName
|
||||
: (value || []).some((name) => name === currentName);
|
||||
const stack = [];
|
||||
if (expanded !== this.data.expanded) {
|
||||
stack.push(this.updateStyle(expanded));
|
||||
this.updateStyle(expanded);
|
||||
}
|
||||
stack.push(this.set({ index, expanded }));
|
||||
return Promise.all(stack);
|
||||
this.setData({ index, expanded });
|
||||
},
|
||||
updateStyle(expanded) {
|
||||
return this.getRect('.van-collapse-item__content')
|
||||
const { inited } = this;
|
||||
this.getRect('.van-collapse-item__content')
|
||||
.then((rect) => rect.height)
|
||||
.then((height) => {
|
||||
const { animation } = this;
|
||||
if (expanded) {
|
||||
return this.set({
|
||||
contentHeight: height ? `${height}px` : 'auto',
|
||||
animation
|
||||
.height(height)
|
||||
.top(1)
|
||||
.step({
|
||||
duration: inited ? 300 : 1,
|
||||
})
|
||||
.height('auto')
|
||||
.step();
|
||||
this.setData({
|
||||
animation: animation.export(),
|
||||
});
|
||||
return;
|
||||
}
|
||||
return this.set({ contentHeight: `${height}px` })
|
||||
.then(nextTick)
|
||||
.then(() => this.set({ contentHeight: 0 }));
|
||||
animation.height(height).top(0).step({ duration: 1 }).height(0).step({
|
||||
duration: 300,
|
||||
});
|
||||
this.setData({
|
||||
animation: animation.export(),
|
||||
});
|
||||
});
|
||||
},
|
||||
onClick() {
|
||||
@ -83,12 +91,5 @@ VantComponent({
|
||||
const currentName = name == null ? index : name;
|
||||
this.parent.switch(currentName, !expanded);
|
||||
},
|
||||
onTransitionEnd() {
|
||||
if (this.data.expanded) {
|
||||
this.setData({
|
||||
contentHeight: 'auto',
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
6
dist/collapse-item/index.wxml
vendored
6
dist/collapse-item/index.wxml
vendored
@ -31,9 +31,9 @@
|
||||
/>
|
||||
</van-cell>
|
||||
<view
|
||||
class="{{ utils.bem('collapse-item__wrapper', { transition }) }}"
|
||||
style="height: {{ contentHeight }};"
|
||||
bind:transitionend="onTransitionEnd"
|
||||
class="{{ utils.bem('collapse-item__wrapper') }}"
|
||||
style="height: 0;"
|
||||
animation="{{ animation }}"
|
||||
>
|
||||
<view
|
||||
class="van-collapse-item__content content-class"
|
||||
|
2
dist/collapse-item/index.wxss
vendored
2
dist/collapse-item/index.wxss
vendored
@ -1 +1 @@
|
||||
@import '../common/index.wxss';.van-collapse-item__title .van-cell__right-icon{-webkit-transform:rotate(90deg);transform:rotate(90deg);transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;transition:-webkit-transform var(--collapse-item-transition-duration,.3s);transition:transform var(--collapse-item-transition-duration,.3s);transition:transform var(--collapse-item-transition-duration,.3s),-webkit-transform var(--collapse-item-transition-duration,.3s)}.van-collapse-item__title--expanded .van-cell__right-icon{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.van-collapse-item__title--disabled .van-cell,.van-collapse-item__title--disabled .van-cell__right-icon{color:#c8c9cc!important;color:var(--collapse-item-title-disabled-color,#c8c9cc)!important}.van-collapse-item__title--disabled .van-cell--hover{background-color:#fff!important;background-color:var(--white,#fff)!important}.van-collapse-item__wrapper{overflow:hidden}.van-collapse-item__wrapper--transition{transition:height .3s ease-in-out}.van-collapse-item__content{padding:15px;padding:var(--collapse-item-content-padding,15px);color:#969799;color:var(--collapse-item-content-text-color,#969799);font-size:13px;font-size:var(--collapse-item-content-font-size,13px);line-height:1.5;line-height:var(--collapse-item-content-line-height,1.5);background-color:#fff;background-color:var(--collapse-item-content-background-color,#fff)}
|
||||
@import '../common/index.wxss';.van-collapse-item__title .van-cell__right-icon{-webkit-transform:rotate(90deg);transform:rotate(90deg);transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;transition:-webkit-transform var(--collapse-item-transition-duration,.3s);transition:transform var(--collapse-item-transition-duration,.3s);transition:transform var(--collapse-item-transition-duration,.3s),-webkit-transform var(--collapse-item-transition-duration,.3s)}.van-collapse-item__title--expanded .van-cell__right-icon{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.van-collapse-item__title--disabled .van-cell,.van-collapse-item__title--disabled .van-cell__right-icon{color:#c8c9cc!important;color:var(--collapse-item-title-disabled-color,#c8c9cc)!important}.van-collapse-item__title--disabled .van-cell--hover{background-color:#fff!important;background-color:var(--white,#fff)!important}.van-collapse-item__wrapper{overflow:hidden}.van-collapse-item__content{padding:15px;padding:var(--collapse-item-content-padding,15px);color:#969799;color:var(--collapse-item-content-text-color,#969799);font-size:13px;font-size:var(--collapse-item-content-font-size,13px);line-height:1.5;line-height:var(--collapse-item-content-line-height,1.5);background-color:#fff;background-color:var(--collapse-item-content-background-color,#fff)}
|
4
dist/datetime-picker/index.js
vendored
4
dist/datetime-picker/index.js
vendored
@ -203,8 +203,8 @@ VantComponent({
|
||||
return `${hour}:${minute}`;
|
||||
}
|
||||
// date type
|
||||
value = Math.max(new Date(value).getTime(), data.minDate);
|
||||
value = Math.min(new Date(value).getTime(), data.maxDate);
|
||||
value = Math.max(value, data.minDate);
|
||||
value = Math.min(value, data.maxDate);
|
||||
return value;
|
||||
},
|
||||
getBoundary(type, innerValue) {
|
||||
|
@ -1,11 +1,6 @@
|
||||
'use strict';
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
var component_1 = require('../common/component');
|
||||
var nextTick = function () {
|
||||
return new Promise(function (resolve) {
|
||||
return setTimeout(resolve, 20);
|
||||
});
|
||||
};
|
||||
component_1.VantComponent({
|
||||
classes: ['title-class', 'content-class'],
|
||||
relation: {
|
||||
@ -31,21 +26,17 @@ component_1.VantComponent({
|
||||
},
|
||||
},
|
||||
data: {
|
||||
contentHeight: 0,
|
||||
expanded: false,
|
||||
transition: false,
|
||||
},
|
||||
created: function () {
|
||||
this.animation = wx.createAnimation({
|
||||
duration: 0,
|
||||
timingFunction: 'ease-in-out',
|
||||
});
|
||||
},
|
||||
mounted: function () {
|
||||
var _this = this;
|
||||
this.updateExpanded()
|
||||
.then(nextTick)
|
||||
.then(function () {
|
||||
var data = { transition: true };
|
||||
if (_this.data.expanded) {
|
||||
data.contentHeight = 'auto';
|
||||
}
|
||||
_this.setData(data);
|
||||
});
|
||||
this.updateExpanded();
|
||||
this.inited = true;
|
||||
},
|
||||
methods: {
|
||||
updateExpanded: function () {
|
||||
@ -65,31 +56,40 @@ component_1.VantComponent({
|
||||
: (value || []).some(function (name) {
|
||||
return name === currentName;
|
||||
});
|
||||
var stack = [];
|
||||
if (expanded !== this.data.expanded) {
|
||||
stack.push(this.updateStyle(expanded));
|
||||
this.updateStyle(expanded);
|
||||
}
|
||||
stack.push(this.set({ index: index, expanded: expanded }));
|
||||
return Promise.all(stack);
|
||||
this.setData({ index: index, expanded: expanded });
|
||||
},
|
||||
updateStyle: function (expanded) {
|
||||
var _this = this;
|
||||
return this.getRect('.van-collapse-item__content')
|
||||
var inited = this.inited;
|
||||
this.getRect('.van-collapse-item__content')
|
||||
.then(function (rect) {
|
||||
return rect.height;
|
||||
})
|
||||
.then(function (height) {
|
||||
var animation = _this.animation;
|
||||
if (expanded) {
|
||||
return _this.set({
|
||||
contentHeight: height ? height + 'px' : 'auto',
|
||||
animation
|
||||
.height(height)
|
||||
.top(1)
|
||||
.step({
|
||||
duration: inited ? 300 : 1,
|
||||
})
|
||||
.height('auto')
|
||||
.step();
|
||||
_this.setData({
|
||||
animation: animation.export(),
|
||||
});
|
||||
return;
|
||||
}
|
||||
return _this
|
||||
.set({ contentHeight: height + 'px' })
|
||||
.then(nextTick)
|
||||
.then(function () {
|
||||
return _this.set({ contentHeight: 0 });
|
||||
});
|
||||
animation.height(height).top(0).step({ duration: 1 }).height(0).step({
|
||||
duration: 300,
|
||||
});
|
||||
_this.setData({
|
||||
animation: animation.export(),
|
||||
});
|
||||
});
|
||||
},
|
||||
onClick: function () {
|
||||
@ -103,12 +103,5 @@ component_1.VantComponent({
|
||||
var currentName = name == null ? index : name;
|
||||
this.parent.switch(currentName, !expanded);
|
||||
},
|
||||
onTransitionEnd: function () {
|
||||
if (this.data.expanded) {
|
||||
this.setData({
|
||||
contentHeight: 'auto',
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
@ -31,9 +31,9 @@
|
||||
/>
|
||||
</van-cell>
|
||||
<view
|
||||
class="{{ utils.bem('collapse-item__wrapper', { transition }) }}"
|
||||
style="height: {{ contentHeight }};"
|
||||
bind:transitionend="onTransitionEnd"
|
||||
class="{{ utils.bem('collapse-item__wrapper') }}"
|
||||
style="height: 0;"
|
||||
animation="{{ animation }}"
|
||||
>
|
||||
<view
|
||||
class="van-collapse-item__content content-class"
|
||||
|
@ -1 +1 @@
|
||||
@import '../common/index.wxss';.van-collapse-item__title .van-cell__right-icon{-webkit-transform:rotate(90deg);transform:rotate(90deg);transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;transition:-webkit-transform var(--collapse-item-transition-duration,.3s);transition:transform var(--collapse-item-transition-duration,.3s);transition:transform var(--collapse-item-transition-duration,.3s),-webkit-transform var(--collapse-item-transition-duration,.3s)}.van-collapse-item__title--expanded .van-cell__right-icon{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.van-collapse-item__title--disabled .van-cell,.van-collapse-item__title--disabled .van-cell__right-icon{color:#c8c9cc!important;color:var(--collapse-item-title-disabled-color,#c8c9cc)!important}.van-collapse-item__title--disabled .van-cell--hover{background-color:#fff!important;background-color:var(--white,#fff)!important}.van-collapse-item__wrapper{overflow:hidden}.van-collapse-item__wrapper--transition{transition:height .3s ease-in-out}.van-collapse-item__content{padding:15px;padding:var(--collapse-item-content-padding,15px);color:#969799;color:var(--collapse-item-content-text-color,#969799);font-size:13px;font-size:var(--collapse-item-content-font-size,13px);line-height:1.5;line-height:var(--collapse-item-content-line-height,1.5);background-color:#fff;background-color:var(--collapse-item-content-background-color,#fff)}
|
||||
@import '../common/index.wxss';.van-collapse-item__title .van-cell__right-icon{-webkit-transform:rotate(90deg);transform:rotate(90deg);transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;transition:-webkit-transform var(--collapse-item-transition-duration,.3s);transition:transform var(--collapse-item-transition-duration,.3s);transition:transform var(--collapse-item-transition-duration,.3s),-webkit-transform var(--collapse-item-transition-duration,.3s)}.van-collapse-item__title--expanded .van-cell__right-icon{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.van-collapse-item__title--disabled .van-cell,.van-collapse-item__title--disabled .van-cell__right-icon{color:#c8c9cc!important;color:var(--collapse-item-title-disabled-color,#c8c9cc)!important}.van-collapse-item__title--disabled .van-cell--hover{background-color:#fff!important;background-color:var(--white,#fff)!important}.van-collapse-item__wrapper{overflow:hidden}.van-collapse-item__content{padding:15px;padding:var(--collapse-item-content-padding,15px);color:#969799;color:var(--collapse-item-content-text-color,#969799);font-size:13px;font-size:var(--collapse-item-content-font-size,13px);line-height:1.5;line-height:var(--collapse-item-content-line-height,1.5);background-color:#fff;background-color:var(--collapse-item-content-background-color,#fff)}
|
Loading…
x
Reference in New Issue
Block a user