From 3a157faec55ea6df6416d2144cd26424cad31019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=98=89=E6=B6=B5?= Date: Tue, 25 Dec 2018 13:14:36 +0800 Subject: [PATCH] [build] 0.5.0-beta --- dist/cell/index.wxss | 2 +- dist/collapse-item/index.js | 43 +++++++++++++++++++++++++++-------- dist/collapse-item/index.wxml | 4 +++- dist/collapse-item/index.wxss | 2 +- dist/field/index.wxml | 4 ++-- dist/field/index.wxss | 2 +- dist/icon/index.wxss | 2 +- dist/loading/index.wxml | 2 +- dist/notice-bar/index.wxml | 2 +- dist/radio/index.wxml | 2 +- dist/slider/index.js | 6 +++++ dist/slider/index.wxml | 24 +++++++++++++++---- dist/slider/index.wxss | 2 +- dist/stepper/index.js | 3 ++- dist/tab/index.wxml | 2 +- dist/tab/index.wxss | 2 +- dist/tabbar-item/index.js | 8 +++++-- dist/tabbar-item/index.wxml | 1 + dist/tabbar/index.js | 6 ++++- dist/tabs/index.js | 2 +- dist/tabs/index.wxss | 2 +- dist/wxs/utils.wxs | 2 +- 22 files changed, 92 insertions(+), 33 deletions(-) diff --git a/dist/cell/index.wxss b/dist/cell/index.wxss index c7edbbd3..0b565598 100644 --- a/dist/cell/index.wxss +++ b/dist/cell/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-cell{width:100%;display:-webkit-flex;display:flex;padding:10px 15px;box-sizing:border-box;line-height:24px;position:relative;background-color:#fff;color:#333;font-size:14px}.van-cell::after{content:' ';position:absolute;pointer-events:none;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;top:auto;left:15px;right:0;bottom:0;-webkit-transform:scaleY(.5);transform:scaleY(.5);border-bottom:1px solid #eee}.van-cell--borderless::after{display:none}.van-cell-group{background-color:#fff}.van-cell__label{font-size:12px;line-height:18px;color:#7d7e80}.van-cell__title,.van-cell__value{-webkit-flex:1;flex:1}.van-cell__title:empty,.van-cell__value:empty{display:none}.van-cell__value{overflow:hidden;text-align:right;vertical-align:middle}.van-cell__left-icon-wrap,.van-cell__right-icon-wrap{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;height:24px;font-size:16px}.van-cell__left-icon-wrap{margin-right:5px}.van-cell__right-icon-wrap{margin-left:5px;color:#999}.van-cell__left-icon{line-height:24px;vertical-align:middle}.van-cell__right-icon{line-height:24px}.van-cell--clickable:active{background-color:#e8e8e8}.van-cell--required{overflow:visible}.van-cell--required::before{content:'*';position:absolute;left:7px;font-size:14px;color:#f44}.van-cell--center{-webkit-align-items:center;align-items:center}.van-cell--large{padding-top:12px;padding-bottom:12px}.van-cell--large .van-cell__title{font-size:16px} \ No newline at end of file +@import '../common/index.wxss';.van-cell{width:100%;display:-webkit-flex;display:flex;padding:10px 15px;box-sizing:border-box;line-height:24px;position:relative;background-color:#fff;color:#333;font-size:14px}.van-cell::after{content:' ';position:absolute;pointer-events:none;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;top:auto;left:15px;right:0;bottom:0;-webkit-transform:scaleY(.5);transform:scaleY(.5);border-bottom:1px solid #eee}.van-cell--borderless::after{display:none}.van-cell-group{background-color:#fff}.van-cell__label{color:#999;font-size:12px;margin-top:3px;line-height:18px}.van-cell__title,.van-cell__value{-webkit-flex:1;flex:1}.van-cell__title:empty,.van-cell__value:empty{display:none}.van-cell__value{color:#999;overflow:hidden;text-align:right;vertical-align:middle}.van-cell__left-icon-wrap,.van-cell__right-icon-wrap{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;height:24px;font-size:16px}.van-cell__left-icon-wrap{margin-right:5px}.van-cell__right-icon-wrap{margin-left:5px;color:#999}.van-cell__left-icon{line-height:24px;vertical-align:middle}.van-cell__right-icon{line-height:24px}.van-cell--clickable:active{background-color:#e8e8e8}.van-cell--required{overflow:visible}.van-cell--required::before{content:'*';position:absolute;left:7px;font-size:14px;color:#f44}.van-cell--center{-webkit-align-items:center;align-items:center}.van-cell--large{padding-top:12px;padding-bottom:12px}.van-cell--large .van-cell__title{font-size:16px}.van-cell--large .van-cell__label{font-size:14px} \ No newline at end of file diff --git a/dist/collapse-item/index.js b/dist/collapse-item/index.js index a218e377..afe1fc35 100644 --- a/dist/collapse-item/index.js +++ b/dist/collapse-item/index.js @@ -28,6 +28,12 @@ VantComponent({ contentHeight: 0, expanded: false }, + beforeCreate: function beforeCreate() { + this.animation = wx.createAnimation({ + duration: 300, + timingFunction: 'ease-in-out' + }); + }, methods: { updateExpanded: function updateExpanded() { if (!this.parent) { @@ -54,15 +60,27 @@ VantComponent({ }); }, updateStyle: function updateStyle(expanded) { - if (expanded) { - this.set({ - contentHeight: 'auto' - }); - } else { - this.set({ - contentHeight: 0 - }); - } + var _this = this; + + this.getRect('.van-collapse-item__content').then(function (res) { + var animationData = _this.animation.height(expanded ? res.height : 0).step().export(); + + if (expanded) { + _this.set({ + animationData: animationData + }); + } else { + _this.set({ + contentHeight: res.height + 'px' + }, function () { + setTimeout(function () { + _this.set({ + animationData: animationData + }); + }, 20); + }); + } + }); }, onClick: function onClick() { if (this.data.disabled) { @@ -75,6 +93,13 @@ VantComponent({ var index = this.parent.data.items.indexOf(this); var currentName = name == null ? index : name; this.parent.switch(currentName, !expanded); + }, + onTransitionEnd: function onTransitionEnd() { + if (this.data.expanded) { + this.set({ + contentHeight: 'auto' + }); + } } } }); \ No newline at end of file diff --git a/dist/collapse-item/index.wxml b/dist/collapse-item/index.wxml index 4f51da13..b6ffedd9 100644 --- a/dist/collapse-item/index.wxml +++ b/dist/collapse-item/index.wxml @@ -29,7 +29,9 @@ diff --git a/dist/notice-bar/index.wxml b/dist/notice-bar/index.wxml index a4ed4b31..67428222 100644 --- a/dist/notice-bar/index.wxml +++ b/dist/notice-bar/index.wxml @@ -17,7 +17,7 @@ diff --git a/dist/slider/index.js b/dist/slider/index.js index 1cc858b3..3509d4c0 100644 --- a/dist/slider/index.js +++ b/dist/slider/index.js @@ -4,6 +4,9 @@ VantComponent({ mixins: [touch], props: { disabled: Boolean, + useButtonSlot: Boolean, + activeColor: String, + inactiveColor: String, max: { type: Number, value: 100 @@ -70,6 +73,9 @@ VantComponent({ value: value, barStyle: "width: " + value + "%; height: " + this.data.barHeight + ";" }); + this.$emit('drag', { + value: value + }); if (end) { this.$emit('change', value); diff --git a/dist/slider/index.wxml b/dist/slider/index.wxml index 24b073bd..e57d1e9c 100644 --- a/dist/slider/index.wxml +++ b/dist/slider/index.wxml @@ -1,11 +1,27 @@ - - + + + > + + + diff --git a/dist/slider/index.wxss b/dist/slider/index.wxss index 7fa33328..41bffa66 100644 --- a/dist/slider/index.wxss +++ b/dist/slider/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-slider{position:relative;border-radius:999px;background-color:#e5e5e5}.van-slider__bar{position:relative;border-radius:inherit;background-color:#1989fa}.van-slider__button{position:absolute;top:50%;right:0;width:20px;height:20px;border-radius:50%;background-color:#fff;-webkit-transform:translate3d(50%,-50%,0);transform:translate3d(50%,-50%,0);box-shadow:0 1px 2px rgba(0,0,0,.5)}.van-slider__button::after{content:'';position:absolute;width:200%;height:200%;top:-50%;left:-50%}.van-slider--disabled{opacity:.3} \ No newline at end of file +@import '../common/index.wxss';.van-slider{position:relative;border-radius:999px;background-color:#e5e5e5}.van-slider__bar{position:relative;border-radius:inherit;background-color:#1989fa}.van-slider__button{width:20px;height:20px;border-radius:50%;background-color:#fff;box-shadow:0 1px 2px rgba(0,0,0,.5)}.van-slider__button-wrapper{position:absolute;top:50%;right:0;-webkit-transform:translate3d(50%,-50%,0);transform:translate3d(50%,-50%,0)}.van-slider__button-wrapper::after{content:'';position:absolute;width:200%;height:200%;top:-50%;left:-50%}.van-slider--disabled{opacity:.3} \ No newline at end of file diff --git a/dist/stepper/index.js b/dist/stepper/index.js index 56a366f9..aca51de6 100644 --- a/dist/stepper/index.js +++ b/dist/stepper/index.js @@ -9,6 +9,7 @@ VantComponent({ value: Number, integer: Boolean, disabled: Boolean, + asyncChange: Boolean, disableInput: Boolean, min: { type: null, @@ -87,7 +88,7 @@ VantComponent({ }, triggerInput: function triggerInput(value) { this.set({ - value: value + value: this.data.asyncChange ? this.data.value : value }); this.$emit('change', value); } diff --git a/dist/tab/index.wxml b/dist/tab/index.wxml index cb6c494e..7a926640 100644 --- a/dist/tab/index.wxml +++ b/dist/tab/index.wxml @@ -1,6 +1,6 @@ diff --git a/dist/tab/index.wxss b/dist/tab/index.wxss index 9d7a1a58..e2e67a98 100644 --- a/dist/tab/index.wxss +++ b/dist/tab/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-tab__pane{box-sizing:border-box}.van-tab__pane--float{float:left} \ No newline at end of file +@import '../common/index.wxss';.van-tab__pane{box-sizing:border-box;overflow-y:auto}.van-tab__pane--active{height:auto}.van-tab__pane--inactive{height:0;overflow:visible} \ No newline at end of file diff --git a/dist/tabbar-item/index.js b/dist/tabbar-item/index.js index 7e6a375d..2a833320 100644 --- a/dist/tabbar-item/index.js +++ b/dist/tabbar-item/index.js @@ -22,10 +22,14 @@ VantComponent({ this.$emit('click'); }, - setActive: function setActive(active) { + setActive: function setActive(_ref) { + var active = _ref.active, + color = _ref.color; + if (this.data.active !== active) { this.set({ - active: active + active: active, + color: color }); } } diff --git a/dist/tabbar-item/index.wxml b/dist/tabbar-item/index.wxml index 6f7251f1..cae5dcda 100644 --- a/dist/tabbar-item/index.wxml +++ b/dist/tabbar-item/index.wxml @@ -1,5 +1,6 @@ diff --git a/dist/tabbar/index.js b/dist/tabbar/index.js index b14afdd6..441625e6 100644 --- a/dist/tabbar/index.js +++ b/dist/tabbar/index.js @@ -26,6 +26,7 @@ VantComponent({ }, props: { active: Number, + activeColor: String, fixed: { type: Boolean, value: true @@ -57,7 +58,10 @@ VantComponent({ var _this3 = this; this.data.items.forEach(function (item, index) { - item.setActive(index === _this3.data.currentActive); + item.setActive({ + active: index === _this3.data.currentActive, + color: _this3.data.activeColor + }); }); }, onChange: function onChange(child) { diff --git a/dist/tabs/index.js b/dist/tabs/index.js index 8a41f2bc..3827ceda 100644 --- a/dist/tabs/index.js +++ b/dist/tabs/index.js @@ -160,7 +160,7 @@ VantComponent({ var width = rect.width; _this2.set({ - trackStyle: "\n width: " + width * _this2.child.length + "px;\n transform: translateX(" + -1 * active * width + "px);\n transition-duration: " + duration + "s;\n " + trackStyle: "\n width: " + width * _this2.child.length + "px;\n left: " + -1 * active * width + "px;\n transition: left " + duration + "s;\n display: flex;\n " }); _this2.setTabsProps({ diff --git a/dist/tabs/index.wxss b/dist/tabs/index.wxss index b9d28a0d..ad46a5cc 100644 --- a/dist/tabs/index.wxss +++ b/dist/tabs/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-tabs{position:relative;-webkit-tap-highlight-color:transparent}.van-tabs__wrap{top:0;left:0;right:0;position:absolute}.van-tabs__wrap--page-top{position:fixed}.van-tabs__wrap--content-bottom{top:auto;bottom:0}.van-tabs__wrap--scrollable .van-tab{-webkit-flex:0 0 22%;flex:0 0 22%}.van-tabs__scroll--card{border:1px solid #f44;border-radius:2px}.van-tabs__nav{display:-webkit-flex;display:flex;-webkit-user-select:none;user-select:none;position:relative;background-color:#fff}.van-tabs__nav--line{height:100%}.van-tabs__nav--card{height:30px}.van-tabs__nav--card .van-tab{color:#f44;border-right:1px solid #f44;line-height:30px}.van-tabs__nav--card .van-tab:last-child{border-right:none}.van-tabs__nav--card .van-tab.van-tab--active{color:#fff;background-color:#f44}.van-tabs__line{z-index:1;left:0;bottom:0;height:2px;position:absolute;background-color:#f44;border-radius:2px}.van-tabs--line{padding-top:44px}.van-tabs--line .van-tabs__wrap{height:44px}.van-tabs--card{padding-top:30px;margin:0 15px}.van-tabs--card .van-tabs__wrap{height:30px}.van-tabs__content{overflow:hidden}.van-tab{-webkit-flex:1;flex:1;cursor:pointer;padding:0 5px;font-size:14px;position:relative;color:#7d7e80;line-height:44px;text-align:center;box-sizing:border-box;background-color:#fff;min-width:0}.van-tab span{display:block}.van-tab--active{font-weight:500;color:#333}.van-tab--disabled{color:#c9c9c9} \ No newline at end of file +@import '../common/index.wxss';.van-tabs{position:relative;-webkit-tap-highlight-color:transparent}.van-tabs__wrap{top:0;left:0;right:0;position:absolute}.van-tabs__wrap--page-top{position:fixed}.van-tabs__wrap--content-bottom{top:auto;bottom:0}.van-tabs__wrap--scrollable .van-tab{-webkit-flex:0 0 22%;flex:0 0 22%}.van-tabs__scroll--card{border:1px solid #f44;border-radius:2px}.van-tabs__nav{display:-webkit-flex;display:flex;-webkit-user-select:none;user-select:none;position:relative;background-color:#fff}.van-tabs__nav--line{height:100%}.van-tabs__nav--card{height:30px}.van-tabs__nav--card .van-tab{color:#f44;border-right:1px solid #f44;line-height:30px}.van-tabs__nav--card .van-tab:last-child{border-right:none}.van-tabs__nav--card .van-tab.van-tab--active{color:#fff;background-color:#f44}.van-tabs__line{z-index:1;left:0;bottom:0;height:2px;position:absolute;background-color:#f44;border-radius:2px}.van-tabs--line{padding-top:44px}.van-tabs--line .van-tabs__wrap{height:44px}.van-tabs--card{padding-top:30px;margin:0 15px}.van-tabs--card .van-tabs__wrap{height:30px}.van-tabs__content{overflow:hidden}.van-tabs__track{position:relative}.van-tab{-webkit-flex:1;flex:1;cursor:pointer;padding:0 5px;font-size:14px;position:relative;color:#7d7e80;line-height:44px;text-align:center;box-sizing:border-box;background-color:#fff;min-width:0}.van-tab--active{font-weight:500;color:#333}.van-tab--disabled{color:#c9c9c9} \ No newline at end of file diff --git a/dist/wxs/utils.wxs b/dist/wxs/utils.wxs index 5deffee0..8cced70f 100644 --- a/dist/wxs/utils.wxs +++ b/dist/wxs/utils.wxs @@ -2,7 +2,7 @@ var bem = require('./bem.wxs').bem; var memoize = require('./memoize.wxs').memoize; function isSrc(url) { - return url.indexOf('http') === 0 || url.indexOf('data:image') === 0; + return url.indexOf('http') === 0 || url.indexOf('data:image') === 0 || url.indexOf('//') === 0; } module.exports = {