[build] 0.5.12

This commit is contained in:
陈嘉涵 2019-05-05 20:38:58 +08:00
parent 9a87e64e98
commit 807b5c5035
27 changed files with 63 additions and 28 deletions

View File

@ -9,6 +9,7 @@ declare type DialogOptions = {
overlay?: boolean; overlay?: boolean;
selector?: string; selector?: string;
ariaLabel?: string; ariaLabel?: string;
className?: string;
transition?: string; transition?: string;
asyncClose?: boolean; asyncClose?: boolean;
businessId?: number; businessId?: number;

View File

@ -24,6 +24,7 @@ Dialog.defaultOptions = {
message: '', message: '',
zIndex: 100, zIndex: 100,
overlay: true, overlay: true,
className: '',
asyncClose: false, asyncClose: false,
messageAlign: '', messageAlign: '',
transition: 'scale', transition: 'scale',

View File

@ -8,6 +8,7 @@ VantComponent({
title: String, title: String,
message: String, message: String,
useSlot: Boolean, useSlot: Boolean,
className: String,
asyncClose: Boolean, asyncClose: Boolean,
messageAlign: String, messageAlign: String,
showCancelButton: Boolean, showCancelButton: Boolean,
@ -85,7 +86,7 @@ VantComponent({
this.close(); this.close();
} }
this.$emit('close', action); this.$emit('close', action);
//把 dialog 实例传递出去,可以通过 stopLoading() 在外部关闭按钮的 loading // 把 dialog 实例传递出去,可以通过 stopLoading() 在外部关闭按钮的 loading
this.$emit(action, { dialog: this }); this.$emit(action, { dialog: this });
const callback = this.data[action === 'confirm' ? 'onConfirm' : 'onCancel']; const callback = this.data[action === 'confirm' ? 'onConfirm' : 'onCancel'];
if (callback) { if (callback) {

View File

@ -2,7 +2,7 @@
show="{{ show }}" show="{{ show }}"
z-index="{{ zIndex }}" z-index="{{ zIndex }}"
overlay="{{ overlay }}" overlay="{{ overlay }}"
custom-class="van-dialog" custom-class="van-dialog {{ className }}"
transition="{{ transition }}" transition="{{ transition }}"
close-on-click-overlay="{{ closeOnClickOverlay }}" close-on-click-overlay="{{ closeOnClickOverlay }}"
bind:close="onClickOverlay" bind:close="onClickOverlay"

7
dist/field/index.js vendored
View File

@ -17,21 +17,22 @@ VantComponent({
autosize: Boolean, autosize: Boolean,
readonly: Boolean, readonly: Boolean,
required: Boolean, required: Boolean,
password: Boolean,
iconClass: String, iconClass: String,
clearable: Boolean, clearable: Boolean,
inputAlign: String, inputAlign: String,
errorMessageAlign: String,
customClass: String, customClass: String,
customStyle: String,
confirmType: String, confirmType: String,
confirmHold: Boolean, confirmHold: Boolean,
errorMessage: String, errorMessage: String,
placeholder: String, placeholder: String,
customStyle: String, placeholderStyle: String,
errorMessageAlign: String,
showConfirmBar: { showConfirmBar: {
type: Boolean, type: Boolean,
value: true value: true
}, },
placeholderStyle: String,
adjustPosition: { adjustPosition: {
type: Boolean, type: Boolean,
value: true value: true

View File

@ -51,6 +51,7 @@
confirm-hold="{{ confirmHold }}" confirm-hold="{{ confirmHold }}"
cursor-spacing="{{ cursorSpacing }}" cursor-spacing="{{ cursorSpacing }}"
adjust-position="{{ adjustPosition }}" adjust-position="{{ adjustPosition }}"
password="{{ password || type === 'password' }}"
bindinput="onInput" bindinput="onInput"
bind:blur="onBlur" bind:blur="onBlur"
bind:focus="onFocus" bind:focus="onFocus"

File diff suppressed because one or more lines are too long

View File

@ -4,9 +4,11 @@
style="color: {{ color }}; background-color: {{ backgroundColor }};" style="color: {{ color }}; background-color: {{ backgroundColor }};"
bind:tap="onClick" bind:tap="onClick"
> >
<view wx:if="{{ leftIcon }}" class="van-notice-bar__left-icon"> <image
<image src="{{ leftIcon }}" /> wx:if="{{ leftIcon }}"
</view> src="{{ leftIcon }}"
class="van-notice-bar__left-icon"
/>
<view class="van-notice-bar__content-wrap"> <view class="van-notice-bar__content-wrap">
<view class="van-notice-bar__content {{ scrollable ? '' : 'van-ellipsis' }}" animation="{{ animationData }}"> <view class="van-notice-bar__content {{ scrollable ? '' : 'van-ellipsis' }}" animation="{{ animationData }}">
{{ text }} {{ text }}

View File

@ -1 +1 @@
@import '../common/index.wxss';.van-notice-bar{display:-webkit-flex;display:flex;height:40px;padding:0 15px;font-size:14px;line-height:24px;-webkit-align-items:center;align-items:center}.van-notice-bar--within-icon{position:relative;padding-right:40px}.van-notice-bar__left-icon{height:18px;min-width:20px;box-sizing:border-box}.van-notice-bar__left-icon>image{width:16px;height:16px}.van-notice-bar__right-icon{position:absolute;top:10px;right:15px;font-size:16px}.van-notice-bar__content-wrap{position:relative;height:24px;overflow:hidden;-webkit-flex:1;flex:1}.van-notice-bar__content{position:absolute;white-space:nowrap}.van-notice-bar__content.van-ellipsis{max-width:100%} @import '../common/index.wxss';.van-notice-bar{display:-webkit-flex;display:flex;height:40px;padding:0 15px;font-size:14px;line-height:24px;-webkit-align-items:center;align-items:center}.van-notice-bar--within-icon{position:relative;padding-right:40px}.van-notice-bar__left-icon{width:16px;height:16px;margin-right:4px}.van-notice-bar__right-icon{position:absolute;top:10px;right:15px;font-size:16px}.van-notice-bar__content-wrap{position:relative;height:24px;overflow:hidden;-webkit-flex:1;flex:1}.van-notice-bar__content{position:absolute;white-space:nowrap}.van-notice-bar__content.van-ellipsis{max-width:100%}

View File

@ -1 +1 @@
@import '../common/index.wxss';.van-search{padding:10px 16px;-webkit-align-items:center;align-items:center;box-sizing:border-box}.van-search,.van-search__content{display:-webkit-flex;display:flex}.van-search__content{padding-left:10px;background-color:#f7f8fa;border-radius:2px;-webkit-flex:1;flex:1}.van-search__content--round{border-radius:17px}.van-search__label{padding:0 5px;font-size:14px;line-height:34px;color:#333}.van-search__field{-webkit-flex:1;flex:1}.van-search__field__left-icon{color:#999}.van-search--withaction{padding-right:0}.van-search input::-webkit-search-cancel-button,.van-search input::-webkit-search-decoration,.van-search input::-webkit-search-results-button,.van-search input::-webkit-search-results-decoration{display:none}.van-search__action{padding:0 10px;font-size:14px;line-height:34px;color:#333}.van-search__action--hover{background-color:#f2f3f5} @import '../common/index.wxss';.van-search{padding:10px 16px;-webkit-align-items:center;align-items:center;box-sizing:border-box}.van-search,.van-search__content{display:-webkit-flex;display:flex}.van-search__content{padding-left:10px;background-color:#f7f8fa;border-radius:2px;-webkit-flex:1;flex:1}.van-search__content--round{border-radius:17px}.van-search__label{padding:0 5px;font-size:14px;line-height:34px;color:#333}.van-search__field{-webkit-flex:1;flex:1}.van-search__field__left-icon{color:#999}.van-search--withaction{padding-right:0}.van-search__action{padding:0 10px;font-size:14px;line-height:34px;color:#333}.van-search__action--hover{background-color:#f2f3f5}

View File

@ -40,7 +40,7 @@ VantComponent({
return; return;
} }
const newValue = this.range(value); const newValue = this.range(value);
if (typeof newValue === 'number' && value !== newValue) { if (typeof newValue === 'number' && +this.data.value !== newValue) {
this.set({ value: newValue }); this.set({ value: newValue });
} }
} }
@ -64,6 +64,7 @@ VantComponent({
}, },
// limit value range // limit value range
range(value) { range(value) {
value = String(value).replace(/[^0-9.-]/g, '');
return Math.max(Math.min(this.data.max, value), this.data.min); return Math.max(Math.min(this.data.max, value), this.data.min);
}, },
onInput(event) { onInput(event) {

View File

@ -9,6 +9,7 @@ VantComponent({
], ],
props: { props: {
tip: null, tip: null,
tipIcon: String,
type: Number, type: Number,
price: null, price: null,
label: String, label: String,

View File

@ -4,7 +4,16 @@
<slot name="top" /> <slot name="top" />
<view wx:if="{{ tip }}" class="van-submit-bar__tip"> <view wx:if="{{ tip }}" class="van-submit-bar__tip">
{{ tipStr }}<slot name="tip" /> <van-icon
wx:if="{{ tipIcon }}"
size="12px"
name="{{ tipIcon }}"
custom-class="van-submit-bar__tip-icon"
/>
<view wx:if="{{ tipStr }}" class="van-submit-bar__tip-text">
{{ tipStr }}
</view>
<slot name="tip" />
</view> </view>
<view class="bar-class {{ utils.bem('submit-bar__bar', { safe: safeAreaInsetBottom && isIPhoneX }) }}"> <view class="bar-class {{ utils.bem('submit-bar__bar', { safe: safeAreaInsetBottom && isIPhoneX }) }}">

View File

@ -1 +1 @@
@import '../common/index.wxss';.van-submit-bar{z-index:100;position:fixed;bottom:0;left:0;width:100%;-webkit-user-select:none;user-select:none}.van-submit-bar__tip{padding:10px;color:#f56723;font-size:12px;line-height:18px;background-color:#fff7cc}.van-submit-bar__bar{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;height:50px;background-color:#fff;font-size:14px}.van-submit-bar__bar--safe{padding-bottom:34px}.van-submit-bar__text{-webkit-flex:1;flex:1;color:#333;font-weight:500;text-align:right}.van-submit-bar__price{color:#f44;font-size:18px;padding-right:12px}.van-submit-bar__currency{font-size:14px}.van-submit-bar__button button{width:110px} @import '../common/index.wxss';.van-submit-bar{z-index:100;position:fixed;bottom:0;left:0;width:100%;-webkit-user-select:none;user-select:none}.van-submit-bar__tip{padding:10px;color:#f56723;font-size:12px;line-height:18px;background-color:#fff7cc}.van-submit-bar__tip-icon{width:12px;height:12px;margin-right:4px;vertical-align:middle}.van-submit-bar__tip-text{display:inline;vertical-align:middle}.van-submit-bar__bar{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;height:50px;background-color:#fff;font-size:14px}.van-submit-bar__bar--safe{padding-bottom:34px}.van-submit-bar__text{-webkit-flex:1;flex:1;color:#333;font-weight:500;text-align:right}.van-submit-bar__price{color:#f44;font-size:18px;padding-right:12px}.van-submit-bar__currency{font-size:14px}.van-submit-bar__button{width:110px}

View File

@ -37,6 +37,7 @@ Dialog.defaultOptions = {
message: '', message: '',
zIndex: 100, zIndex: 100,
overlay: true, overlay: true,
className: '',
asyncClose: false, asyncClose: false,
messageAlign: '', messageAlign: '',
transition: 'scale', transition: 'scale',

View File

@ -10,6 +10,7 @@ component_1.VantComponent({
title: String, title: String,
message: String, message: String,
useSlot: Boolean, useSlot: Boolean,
className: String,
asyncClose: Boolean, asyncClose: Boolean,
messageAlign: String, messageAlign: String,
showCancelButton: Boolean, showCancelButton: Boolean,
@ -88,7 +89,7 @@ component_1.VantComponent({
this.close(); this.close();
} }
this.$emit('close', action); this.$emit('close', action);
//把 dialog 实例传递出去,可以通过 stopLoading() 在外部关闭按钮的 loading // 把 dialog 实例传递出去,可以通过 stopLoading() 在外部关闭按钮的 loading
this.$emit(action, { dialog: this }); this.$emit(action, { dialog: this });
var callback = this.data[action === 'confirm' ? 'onConfirm' : 'onCancel']; var callback = this.data[action === 'confirm' ? 'onConfirm' : 'onCancel'];
if (callback) { if (callback) {

View File

@ -2,7 +2,7 @@
show="{{ show }}" show="{{ show }}"
z-index="{{ zIndex }}" z-index="{{ zIndex }}"
overlay="{{ overlay }}" overlay="{{ overlay }}"
custom-class="van-dialog" custom-class="van-dialog {{ className }}"
transition="{{ transition }}" transition="{{ transition }}"
close-on-click-overlay="{{ closeOnClickOverlay }}" close-on-click-overlay="{{ closeOnClickOverlay }}"
bind:close="onClickOverlay" bind:close="onClickOverlay"

View File

@ -19,21 +19,22 @@ component_1.VantComponent({
autosize: Boolean, autosize: Boolean,
readonly: Boolean, readonly: Boolean,
required: Boolean, required: Boolean,
password: Boolean,
iconClass: String, iconClass: String,
clearable: Boolean, clearable: Boolean,
inputAlign: String, inputAlign: String,
errorMessageAlign: String,
customClass: String, customClass: String,
customStyle: String,
confirmType: String, confirmType: String,
confirmHold: Boolean, confirmHold: Boolean,
errorMessage: String, errorMessage: String,
placeholder: String, placeholder: String,
customStyle: String, placeholderStyle: String,
errorMessageAlign: String,
showConfirmBar: { showConfirmBar: {
type: Boolean, type: Boolean,
value: true value: true
}, },
placeholderStyle: String,
adjustPosition: { adjustPosition: {
type: Boolean, type: Boolean,
value: true value: true

View File

@ -51,6 +51,7 @@
confirm-hold="{{ confirmHold }}" confirm-hold="{{ confirmHold }}"
cursor-spacing="{{ cursorSpacing }}" cursor-spacing="{{ cursorSpacing }}"
adjust-position="{{ adjustPosition }}" adjust-position="{{ adjustPosition }}"
password="{{ password || type === 'password' }}"
bindinput="onInput" bindinput="onInput"
bind:blur="onBlur" bind:blur="onBlur"
bind:focus="onFocus" bind:focus="onFocus"

File diff suppressed because one or more lines are too long

View File

@ -4,9 +4,11 @@
style="color: {{ color }}; background-color: {{ backgroundColor }};" style="color: {{ color }}; background-color: {{ backgroundColor }};"
bind:tap="onClick" bind:tap="onClick"
> >
<view wx:if="{{ leftIcon }}" class="van-notice-bar__left-icon"> <image
<image src="{{ leftIcon }}" /> wx:if="{{ leftIcon }}"
</view> src="{{ leftIcon }}"
class="van-notice-bar__left-icon"
/>
<view class="van-notice-bar__content-wrap"> <view class="van-notice-bar__content-wrap">
<view class="van-notice-bar__content {{ scrollable ? '' : 'van-ellipsis' }}" animation="{{ animationData }}"> <view class="van-notice-bar__content {{ scrollable ? '' : 'van-ellipsis' }}" animation="{{ animationData }}">
{{ text }} {{ text }}

View File

@ -1 +1 @@
@import '../common/index.wxss';.van-notice-bar{display:-webkit-flex;display:flex;height:40px;padding:0 15px;font-size:14px;line-height:24px;-webkit-align-items:center;align-items:center}.van-notice-bar--within-icon{position:relative;padding-right:40px}.van-notice-bar__left-icon{height:18px;min-width:20px;box-sizing:border-box}.van-notice-bar__left-icon>image{width:16px;height:16px}.van-notice-bar__right-icon{position:absolute;top:10px;right:15px;font-size:16px}.van-notice-bar__content-wrap{position:relative;height:24px;overflow:hidden;-webkit-flex:1;flex:1}.van-notice-bar__content{position:absolute;white-space:nowrap}.van-notice-bar__content.van-ellipsis{max-width:100%} @import '../common/index.wxss';.van-notice-bar{display:-webkit-flex;display:flex;height:40px;padding:0 15px;font-size:14px;line-height:24px;-webkit-align-items:center;align-items:center}.van-notice-bar--within-icon{position:relative;padding-right:40px}.van-notice-bar__left-icon{width:16px;height:16px;margin-right:4px}.van-notice-bar__right-icon{position:absolute;top:10px;right:15px;font-size:16px}.van-notice-bar__content-wrap{position:relative;height:24px;overflow:hidden;-webkit-flex:1;flex:1}.van-notice-bar__content{position:absolute;white-space:nowrap}.van-notice-bar__content.van-ellipsis{max-width:100%}

View File

@ -1 +1 @@
@import '../common/index.wxss';.van-search{padding:10px 16px;-webkit-align-items:center;align-items:center;box-sizing:border-box}.van-search,.van-search__content{display:-webkit-flex;display:flex}.van-search__content{padding-left:10px;background-color:#f7f8fa;border-radius:2px;-webkit-flex:1;flex:1}.van-search__content--round{border-radius:17px}.van-search__label{padding:0 5px;font-size:14px;line-height:34px;color:#333}.van-search__field{-webkit-flex:1;flex:1}.van-search__field__left-icon{color:#999}.van-search--withaction{padding-right:0}.van-search input::-webkit-search-cancel-button,.van-search input::-webkit-search-decoration,.van-search input::-webkit-search-results-button,.van-search input::-webkit-search-results-decoration{display:none}.van-search__action{padding:0 10px;font-size:14px;line-height:34px;color:#333}.van-search__action--hover{background-color:#f2f3f5} @import '../common/index.wxss';.van-search{padding:10px 16px;-webkit-align-items:center;align-items:center;box-sizing:border-box}.van-search,.van-search__content{display:-webkit-flex;display:flex}.van-search__content{padding-left:10px;background-color:#f7f8fa;border-radius:2px;-webkit-flex:1;flex:1}.van-search__content--round{border-radius:17px}.van-search__label{padding:0 5px;font-size:14px;line-height:34px;color:#333}.van-search__field{-webkit-flex:1;flex:1}.van-search__field__left-icon{color:#999}.van-search--withaction{padding-right:0}.van-search__action{padding:0 10px;font-size:14px;line-height:34px;color:#333}.van-search__action--hover{background-color:#f2f3f5}

View File

@ -42,7 +42,7 @@ component_1.VantComponent({
return; return;
} }
var newValue = this.range(value); var newValue = this.range(value);
if (typeof newValue === 'number' && value !== newValue) { if (typeof newValue === 'number' && +this.data.value !== newValue) {
this.set({ value: newValue }); this.set({ value: newValue });
} }
} }
@ -66,6 +66,7 @@ component_1.VantComponent({
}, },
// limit value range // limit value range
range: function (value) { range: function (value) {
value = String(value).replace(/[^0-9.-]/g, '');
return Math.max(Math.min(this.data.max, value), this.data.min); return Math.max(Math.min(this.data.max, value), this.data.min);
}, },
onInput: function (event) { onInput: function (event) {

View File

@ -11,6 +11,7 @@ component_1.VantComponent({
], ],
props: { props: {
tip: null, tip: null,
tipIcon: String,
type: Number, type: Number,
price: null, price: null,
label: String, label: String,

View File

@ -4,7 +4,16 @@
<slot name="top" /> <slot name="top" />
<view wx:if="{{ tip }}" class="van-submit-bar__tip"> <view wx:if="{{ tip }}" class="van-submit-bar__tip">
{{ tipStr }}<slot name="tip" /> <van-icon
wx:if="{{ tipIcon }}"
size="12px"
name="{{ tipIcon }}"
custom-class="van-submit-bar__tip-icon"
/>
<view wx:if="{{ tipStr }}" class="van-submit-bar__tip-text">
{{ tipStr }}
</view>
<slot name="tip" />
</view> </view>
<view class="bar-class {{ utils.bem('submit-bar__bar', { safe: safeAreaInsetBottom && isIPhoneX }) }}"> <view class="bar-class {{ utils.bem('submit-bar__bar', { safe: safeAreaInsetBottom && isIPhoneX }) }}">

View File

@ -1 +1 @@
@import '../common/index.wxss';.van-submit-bar{z-index:100;position:fixed;bottom:0;left:0;width:100%;-webkit-user-select:none;user-select:none}.van-submit-bar__tip{padding:10px;color:#f56723;font-size:12px;line-height:18px;background-color:#fff7cc}.van-submit-bar__bar{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;height:50px;background-color:#fff;font-size:14px}.van-submit-bar__bar--safe{padding-bottom:34px}.van-submit-bar__text{-webkit-flex:1;flex:1;color:#333;font-weight:500;text-align:right}.van-submit-bar__price{color:#f44;font-size:18px;padding-right:12px}.van-submit-bar__currency{font-size:14px}.van-submit-bar__button button{width:110px} @import '../common/index.wxss';.van-submit-bar{z-index:100;position:fixed;bottom:0;left:0;width:100%;-webkit-user-select:none;user-select:none}.van-submit-bar__tip{padding:10px;color:#f56723;font-size:12px;line-height:18px;background-color:#fff7cc}.van-submit-bar__tip-icon{width:12px;height:12px;margin-right:4px;vertical-align:middle}.van-submit-bar__tip-text{display:inline;vertical-align:middle}.van-submit-bar__bar{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;height:50px;background-color:#fff;font-size:14px}.van-submit-bar__bar--safe{padding-bottom:34px}.van-submit-bar__text{-webkit-flex:1;flex:1;color:#333;font-weight:500;text-align:right}.van-submit-bar__price{color:#f44;font-size:18px;padding-right:12px}.van-submit-bar__currency{font-size:14px}.van-submit-bar__button{width:110px}