[build] 0.5.0-beta

This commit is contained in:
陈嘉涵 2018-12-25 13:14:36 +08:00
parent 4e6cb6d036
commit 3a157faec5
22 changed files with 92 additions and 33 deletions

View File

@ -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}
@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}

View File

@ -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'
});
}
}
}
});

View File

@ -29,7 +29,9 @@
</van-cell>
<view
class="van-collapse-item__wrapper"
style="max-height: {{ contentHeight }};"
style="height: {{ contentHeight }};"
animation="{{ animationData }}"
bind:transitionend="onTransitionEnd"
>
<view
class="van-collapse-item__content content-class"

View File

@ -1 +1 @@
@import '../common/index.wxss';.van-collapse-item__title .van-cell__right-icon{-webkit-transform:rotate(90deg);transform:rotate(90deg);transition:.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:#c9c9c9!important}.van-collapse-item__title--disabled .van-cell:active{background-color:#fff!important}.van-collapse-item__wrapper{overflow:hidden;will-change:max-height;transition:max-height .3s ease-in-out}.van-collapse-item__content{color:#999;padding:15px;font-size:13px;line-height:1.5;background-color:#fff}
@import '../common/index.wxss';.van-collapse-item__title .van-cell__right-icon{-webkit-transform:rotate(90deg);transform:rotate(90deg);transition:.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:#c9c9c9!important}.van-collapse-item__title--disabled .van-cell:active{background-color:#fff!important}.van-collapse-item__wrapper{overflow:hidden}.van-collapse-item__content{color:#999;padding:15px;font-size:13px;line-height:1.5;background-color:#fff}

View File

@ -25,7 +25,7 @@
auto-height="{{ autosize }}"
placeholder="{{ placeholder }}"
placeholder-style="{{ placeholderStyle }}"
placeholder-class="{{ error ? 'van-field__input--error' : '' }}"
placeholder-class="{{ error ? 'van-field__input--error' : 'van-field__placeholder' }}"
cursor-spacing="{{ cursorSpacing }}"
adjust-position="{{ adjustPosition }}"
show-confirm-bar="{{ showConfirmBar }}"
@ -44,7 +44,7 @@
maxlength="{{ maxlength }}"
placeholder="{{ placeholder }}"
placeholder-style="{{ placeholderStyle }}"
placeholder-class="{{ error ? 'van-field__input--error' : '' }}"
placeholder-class="{{ error ? 'van-field__input--error' : 'van-field__placeholder' }}"
confirm-type="{{ confirmType }}"
confirm-hold="{{ confirmHold }}"
cursor-spacing="{{ cursorSpacing }}"

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{border:0;margin:0;padding:0;width:100%;height:24px;resize:none;display:block;text-align:left;min-height:24px;line-height:inherit;box-sizing:border-box;background-color:transparent}.van-field__input--disabled{opacity:1;color:#7d7e80;background-color:transparent}.van-field__input--center{text-align:center}.van-field__input--right{text-align:right}.van-field__input--error{color:#f44}.van-field__clear-root{height:24px}.van-field__button,.van-field__clear,.van-field__icon-container{-webkit-flex-shrink:0;flex-shrink:0}.van-field__clear,.van-field__icon-container{padding:0 10px;line-height:inherit;margin-right:-10px;vertical-align:middle}.van-field__clear{color:#c9c9c9}.van-field__icon-container{color:#999}.van-field__icon{display:block!important}.van-field__button{padding-left:10px}.van-field__error-message{color:#f44;font-size:12px;text-align:left}
@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{border:0;margin:0;padding:0;width:100%;height:24px;resize:none;display:block;text-align:left;min-height:24px;color:#333;line-height:inherit;box-sizing:border-box;background-color:transparent}.van-field__input--disabled{opacity:1;color:#999;background-color:transparent}.van-field__input--center{text-align:center}.van-field__input--right{text-align:right}.van-field__input--error{color:#f44}.van-field__placeholder{color:#999}.van-field__clear-root{height:24px}.van-field__button,.van-field__clear,.van-field__icon-container{-webkit-flex-shrink:0;flex-shrink:0}.van-field__clear,.van-field__icon-container{padding:0 10px;line-height:inherit;margin-right:-10px;vertical-align:middle}.van-field__clear{color:#c9c9c9}.van-field__icon-container{color:#999}.van-field__icon{display:block!important}.van-field__button{padding-left:10px}.van-field__error-message{color:#f44;font-size:12px;text-align:left}

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@
<view
wx:if="{{ type === 'spinner' }}"
wx:for="item in 12"
wx:key="{{ index }}"
wx:key="index"
class="van-loading__dot"
/>
</view>

View File

@ -17,7 +17,7 @@
<van-icon
wx:if="{{ mode === 'closeable' }}"
class="van-notice-bar__right-icon"
name="close"
name="cross"
bind:tap="onClickIcon"
/>
<navigator

View File

@ -14,7 +14,7 @@
class="{{ utils.bem('radio__icon', { disabled, checked: !disabled && name === value, check: !disabled && name !== value }) }}"
custom-class="icon-class"
color="{{ value === name ? checkedColor : '' }}"
name="{{ value === name ? 'checked' : 'check' }}"
name="{{ value === name ? 'checked' : 'circle' }}"
/>
</view>
<view class="van-radio__label van-radio__label--{{ labelPosition }} label-class" bindtap="onClickLabel">

View File

@ -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);

View File

@ -1,11 +1,27 @@
<view class="custom-class van-slider {{ disabled ? 'van-slider--disabled' : '' }}" bind:tap="onClick">
<view class="van-slider__bar" style="{{ barStyle }}">
<view
class="custom-class van-slider {{ disabled ? 'van-slider--disabled' : '' }}"
style="{{ inactiveColor ? 'background:' + inactiveColor : '' }}"
bind:tap="onClick"
>
<view
class="van-slider__bar"
style="{{ barStyle }}; {{ activeColor ? 'background:' + activeColor : '' }}"
>
<view
class="van-slider__button"
class="van-slider__button-wrapper"
bind:touchstart="onTouchStart"
catch:touchmove="onTouchMove"
bind:touchend="onTouchEnd"
bind:touchcancel="onTouchEnd"
/>
>
<slot
wx:if="{{ useButtonSlot }}"
name="button"
/>
<view
wx:else
class="van-slider__button"
/>
</view>
</view>
</view>

View File

@ -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}
@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}

View File

@ -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);
}

2
dist/tab/index.wxml vendored
View File

@ -1,6 +1,6 @@
<view
wx:if="{{ animated || inited }}"
class="custom-class van-tab__pane {{ animated ? 'van-tab__pane--float' : '' }}"
class="custom-class van-tab__pane {{ active ? 'van-tab__pane--active' : 'van-tab__pane--inactive' }}"
style="{{ animated || active ? '' : 'display: none;' }} {{ width ? 'width:' + width + 'px;' : '' }}"
>
<slot />

2
dist/tab/index.wxss vendored
View File

@ -1 +1 @@
@import '../common/index.wxss';.van-tab__pane{box-sizing:border-box}.van-tab__pane--float{float:left}
@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}

View File

@ -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
});
}
}

View File

@ -1,5 +1,6 @@
<view
class="van-tabbar-item {{ active ? 'van-tabbar-item--active' : '' }}"
style="{{ active && color ? 'color: ' + color : '' }}"
bind:tap="onClick"
>
<view class="van-tabbar-item__icon {{ dot ? 'van-tabbar-item__icon--dot' : '' }}">

View File

@ -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) {

2
dist/tabs/index.js vendored
View File

@ -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({

View File

@ -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}
@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}

2
dist/wxs/utils.wxs vendored
View File

@ -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 = {