[build] 0.4.2

This commit is contained in:
陈嘉涵 2018-10-19 19:29:03 +08:00
parent f0bcb99021
commit 4d2722d0b2
12 changed files with 87 additions and 13 deletions

50
dist/area/index.js vendored
View File

@ -45,13 +45,15 @@ VantComponent({
onCancel: function onCancel() { onCancel: function onCancel() {
this.$emit('cancel', { this.$emit('cancel', {
values: this.getValues(), values: this.getValues(),
indexs: this.getIndexs() indexs: this.getIndexs(),
detail: this.getDetail()
}); });
}, },
onConfirm: function onConfirm() { onConfirm: function onConfirm() {
this.$emit('confirm', { this.$emit('confirm', {
values: this.getValues(), values: this.getValues(),
indexs: this.getIndexs() indexs: this.getIndexs(),
detail: this.getDetail()
}); });
}, },
onChange: function onChange(event) { onChange: function onChange(event) {
@ -92,6 +94,11 @@ VantComponent({
}); });
if (code) { if (code) {
// oversea code
if (code[0] === '9' && type === 'city') {
code = '9';
}
result = result.filter(function (item) { result = result.filter(function (item) {
return item.code.indexOf(code) === 0; return item.code.indexOf(code) === 0;
}); });
@ -101,7 +108,12 @@ VantComponent({
}, },
getIndex: function getIndex(type, code) { getIndex: function getIndex(type, code) {
var compareNum = type === 'province' ? 2 : type === 'city' ? 4 : 6; var compareNum = type === 'province' ? 2 : type === 'city' ? 4 : 6;
var list = this.getList(type, code.slice(0, compareNum - 2)); var list = this.getList(type, code.slice(0, compareNum - 2)); // oversea code
if (code[0] === '9' && type === 'province') {
compareNum = 1;
}
code = code.slice(0, compareNum); code = code.slice(0, compareNum);
for (var i = 0; i < list.length; i++) { for (var i = 0; i < list.length; i++) {
@ -138,6 +150,8 @@ VantComponent({
pickerValue = _this$data3$pickerVal === void 0 ? [] : _this$data3$pickerVal; pickerValue = _this$data3$pickerVal === void 0 ? [] : _this$data3$pickerVal;
return displayColumns.map(function (option, index) { return displayColumns.map(function (option, index) {
return option[pickerValue[index]]; return option[pickerValue[index]];
}).filter(function (value) {
return !!value;
}); });
}, },
getIndexs: function getIndexs() { getIndexs: function getIndexs() {
@ -146,6 +160,36 @@ VantComponent({
columnsNum = _this$data4.columnsNum; columnsNum = _this$data4.columnsNum;
return pickerValue.slice(0, columnsNum); return pickerValue.slice(0, columnsNum);
}, },
getDetail: function getDetail() {
var values = this.getValues();
var area = {
code: '',
country: '',
province: '',
city: '',
county: ''
};
if (!values.length) {
return area;
}
var names = values.map(function (item) {
return item.name;
});
area.code = values[values.length - 1].code;
if (area.code[0] === '9') {
area.country = names[1] || '';
area.province = names[2] || '';
} else {
area.province = names[0] || '';
area.city = names[1] || '';
area.county = names[2] || '';
}
return area;
},
reset: function reset() { reset: function reset() {
this.code = ''; this.code = '';
this.setValues(); this.setValues();

2
dist/field/index.js vendored
View File

@ -56,7 +56,7 @@ VantComponent({
'van-field--error': data.error, 'van-field--error': data.error,
'van-field__textarea': data.type === 'textarea', 'van-field__textarea': data.type === 'textarea',
'van-field__input--disabled': data.disabled, 'van-field__input--disabled': data.disabled,
["van-field--" + data.inputAlign]: data.inputAlign ["van-field__input--" + data.inputAlign]: data.inputAlign
}); });
} }
}, },

View File

@ -20,7 +20,7 @@
maxlength="{{ maxlength }}" maxlength="{{ maxlength }}"
auto-height="{{ autosize }}" auto-height="{{ autosize }}"
placeholder="{{ placeholder }}" placeholder="{{ placeholder }}"
placeholder-style="{{ placeholderStyle }} " placeholder-style="{{ placeholderStyle }}"
placeholder-class="{{ error ? 'van-field--error' : '' }}" placeholder-class="{{ error ? 'van-field--error' : '' }}"
cursor-spacing="{{ cursorSpacing }}" cursor-spacing="{{ cursorSpacing }}"
bindinput="onInput" bindinput="onInput"
@ -37,7 +37,7 @@
disabled="{{ disabled || readonly }}" disabled="{{ disabled || readonly }}"
maxlength="{{ maxlength }}" maxlength="{{ maxlength }}"
placeholder="{{ placeholder }}" placeholder="{{ placeholder }}"
placeholder-style="{{ placeholderStyle }} " placeholder-style="{{ placeholderStyle }}"
placeholder-class="{{ error ? 'van-field--error' : '' }}" placeholder-class="{{ error ? 'van-field--error' : '' }}"
confirm-type="{{ confirmType }}" confirm-type="{{ confirmType }}"
cursor-spacing="{{ cursorSpacing }}" cursor-spacing="{{ cursorSpacing }}"

View File

@ -4,6 +4,8 @@ VantComponent({
mixins: [link], mixins: [link],
props: { props: {
text: String, text: String,
loading: Boolean,
disabled: Boolean,
type: { type: {
type: String, type: String,
value: 'danger' value: 'danger'

View File

@ -2,6 +2,8 @@
square square
size="large" size="large"
type="{{ type }}" type="{{ type }}"
loading="{{ loading }}"
disabled="{{ disabled }}"
bind:click="onClick" bind:click="onClick"
> >
{{ text }} {{ text }}

View File

@ -1 +1 @@
@import '../common/index.wxss';@font-face{font-style:normal;font-weight:400;font-family:vant-icon;src:url(https://img.yzcdn.cn/vant/vant-icon-76f274.ttf) format('truetype')}.van-icon{position:relative;display:inline-block;font:normal normal normal 14px/1 vant-icon;font-size:inherit;text-rendering:auto}.van-icon__info{color:#fff;left:100%;top:-.5em;font-size:.6em;padding:0 .25em;text-align:center;min-width:1.4em;line-height:1.4;position:absolute;border-radius:.6em;box-sizing:border-box;background-color:#f44;-webkit-transform:translateX(-50%);transform:translateX(-50%);font-family:PingFang SC,Helvetica Neue,Arial,sans-serif}.van-icon::before{display:inline-block}.van-icon-add-o::before{content:"\F000"}.van-icon-add::before{content:"\F001"}.van-icon-add2::before{content:"\F002"}.van-icon-after-sale::before{content:"\F003"}.van-icon-aim::before{content:"\F004"}.van-icon-alipay::before{content:"\F005"}.van-icon-arrow-left::before{content:"\F006"}.van-icon-arrow::before{content:"\F007"}.van-icon-balance-pay::before{content:"\F008"}.van-icon-browsing-history::before{content:"\F009"}.van-icon-card::before{content:"\F00A"}.van-icon-cart::before{content:"\F00B"}.van-icon-cash-back-record::before{content:"\F00C"}.van-icon-cash-on-deliver::before{content:"\F00D"}.van-icon-certificate::before{content:"\F00E"}.van-icon-chat::before{content:"\F00F"}.van-icon-check::before{content:"\F010"}.van-icon-checked::before{content:"\F011"}.van-icon-clear::before{content:"\F012"}.van-icon-clock::before{content:"\F013"}.van-icon-close::before{content:"\F014"}.van-icon-completed::before{content:"\F015"}.van-icon-contact::before{content:"\F016"}.van-icon-coupon::before{content:"\F017"}.van-icon-credit-pay::before{content:"\F018"}.van-icon-debit-pay::before{content:"\F019"}.van-icon-delete::before{content:"\F01A"}.van-icon-description::before{content:"\F01B"}.van-icon-discount::before{content:"\F01C"}.van-icon-ecard-pay::before{content:"\F01D"}.van-icon-edit-data::before{content:"\F01E"}.van-icon-edit::before{content:"\F01F"}.van-icon-exchange-record::before{content:"\F020"}.van-icon-exchange::before{content:"\F021"}.van-icon-fail::before{content:"\F022"}.van-icon-free-postage::before{content:"\F023"}.van-icon-gift-card-pay::before{content:"\F024"}.van-icon-gift-card::before{content:"\F025"}.van-icon-gift::before{content:"\F026"}.van-icon-gold-coin::before{content:"\F027"}.van-icon-goods-collect::before{content:"\F028"}.van-icon-home::before{content:"\F029"}.van-icon-hot-sale::before{content:"\F02A"}.van-icon-hot::before{content:"\F02B"}.van-icon-idcard::before{content:"\F02C"}.van-icon-info-o::before{content:"\F02D"}.van-icon-like-o::before{content:"\F02E"}.van-icon-like::before{content:"\F02F"}.van-icon-location::before{content:"\F030"}.van-icon-logistics::before{content:"\F031"}.van-icon-more-o::before{content:"\F032"}.van-icon-more::before{content:"\F033"}.van-icon-new-arrival::before{content:"\F034"}.van-icon-new::before{content:"\F035"}.van-icon-other-pay::before{content:"\F036"}.van-icon-passed::before{content:"\F037"}.van-icon-password-not-view::before{content:"\F038"}.van-icon-password-view::before{content:"\F039"}.van-icon-pause::before{content:"\F03A"}.van-icon-peer-pay::before{content:"\F03B"}.van-icon-pending-deliver::before{content:"\F03C"}.van-icon-pending-evaluate::before{content:"\F03D"}.van-icon-pending-orders::before{content:"\F03E"}.van-icon-pending-payment::before{content:"\F03F"}.van-icon-phone::before{content:"\F040"}.van-icon-photo::before{content:"\F041"}.van-icon-photograph::before{content:"\F042"}.van-icon-play::before{content:"\F043"}.van-icon-point-gift::before{content:"\F044"}.van-icon-points-mall::before{content:"\F045"}.van-icon-points::before{content:"\F046"}.van-icon-qr-invalid::before{content:"\F047"}.van-icon-qr::before{content:"\F048"}.van-icon-question::before{content:"\F049"}.van-icon-receive-gift::before{content:"\F04A"}.van-icon-records::before{content:"\F04B"}.van-icon-search::before{content:"\F04C"}.van-icon-send-gift::before{content:"\F04D"}.van-icon-setting::before{content:"\F04E"}.van-icon-share::before{content:"\F04F"}.van-icon-shop-collect::before{content:"\F050"}.van-icon-shop::before{content:"\F051"}.van-icon-shopping-cart::before{content:"\F052"}.van-icon-sign::before{content:"\F053"}.van-icon-stop::before{content:"\F054"}.van-icon-success::before{content:"\F055"}.van-icon-tosend::before{content:"\F056"}.van-icon-underway::before{content:"\F057"}.van-icon-upgrade::before{content:"\F058"}.van-icon-value-card::before{content:"\F059"}.van-icon-wap-home::before{content:"\F05A"}.van-icon-wap-nav::before{content:"\F05B"}.van-icon-warn::before{content:"\F05C"}.van-icon-wechat::before{content:"\F05D"} @import '../common/index.wxss';@font-face{font-style:normal;font-weight:400;font-family:vant-icon;src:url(https://img.yzcdn.cn/vant/vant-icon-82b481.ttf) format('truetype')}.van-icon{position:relative;display:inline-block;font:normal normal normal 14px/1 vant-icon;font-size:inherit;text-rendering:auto}.van-icon__info{color:#fff;left:100%;top:-.5em;font-size:.6em;padding:0 .25em;text-align:center;min-width:1.4em;line-height:1.4;position:absolute;border-radius:.6em;box-sizing:border-box;background-color:#f44;-webkit-transform:translateX(-50%);transform:translateX(-50%);font-family:PingFang SC,Helvetica Neue,Arial,sans-serif}.van-icon::before{display:inline-block}.van-icon-add-o::before{content:"\F000"}.van-icon-add::before{content:"\F001"}.van-icon-add2::before{content:"\F002"}.van-icon-after-sale::before{content:"\F003"}.van-icon-aim::before{content:"\F004"}.van-icon-alipay::before{content:"\F005"}.van-icon-arrow-left::before{content:"\F006"}.van-icon-arrow::before{content:"\F007"}.van-icon-balance-pay::before{content:"\F008"}.van-icon-browsing-history::before{content:"\F009"}.van-icon-card::before{content:"\F00A"}.van-icon-cart-o::before{content:"\F00B"}.van-icon-cart::before{content:"\F00C"}.van-icon-cash-back-record::before{content:"\F00D"}.van-icon-cash-on-deliver::before{content:"\F00E"}.van-icon-certificate::before{content:"\F00F"}.van-icon-chat::before{content:"\F010"}.van-icon-check::before{content:"\F011"}.van-icon-checked::before{content:"\F012"}.van-icon-clear::before{content:"\F013"}.van-icon-clock::before{content:"\F014"}.van-icon-close::before{content:"\F015"}.van-icon-completed::before{content:"\F016"}.van-icon-contact::before{content:"\F017"}.van-icon-coupon::before{content:"\F018"}.van-icon-credit-pay::before{content:"\F019"}.van-icon-debit-pay::before{content:"\F01A"}.van-icon-delete::before{content:"\F01B"}.van-icon-description::before{content:"\F01C"}.van-icon-discount::before{content:"\F01D"}.van-icon-ecard-pay::before{content:"\F01E"}.van-icon-edit-data::before{content:"\F01F"}.van-icon-edit::before{content:"\F020"}.van-icon-exchange-record::before{content:"\F021"}.van-icon-exchange::before{content:"\F022"}.van-icon-fail::before{content:"\F023"}.van-icon-free-postage::before{content:"\F024"}.van-icon-gift-card-pay::before{content:"\F025"}.van-icon-gift-card::before{content:"\F026"}.van-icon-gift::before{content:"\F027"}.van-icon-gold-coin::before{content:"\F028"}.van-icon-goods-collect::before{content:"\F029"}.van-icon-home::before{content:"\F02A"}.van-icon-hot-sale::before{content:"\F02B"}.van-icon-hot::before{content:"\F02C"}.van-icon-idcard::before{content:"\F02D"}.van-icon-info-o::before{content:"\F02E"}.van-icon-like-o::before{content:"\F02F"}.van-icon-like::before{content:"\F030"}.van-icon-location::before{content:"\F031"}.van-icon-logistics::before{content:"\F032"}.van-icon-more-o::before{content:"\F033"}.van-icon-more::before{content:"\F034"}.van-icon-new-arrival::before{content:"\F035"}.van-icon-new::before{content:"\F036"}.van-icon-other-pay::before{content:"\F037"}.van-icon-passed::before{content:"\F038"}.van-icon-password-not-view::before{content:"\F039"}.van-icon-password-view::before{content:"\F03A"}.van-icon-pause::before{content:"\F03B"}.van-icon-peer-pay::before{content:"\F03C"}.van-icon-pending-deliver::before{content:"\F03D"}.van-icon-pending-evaluate::before{content:"\F03E"}.van-icon-pending-orders::before{content:"\F03F"}.van-icon-pending-payment::before{content:"\F040"}.van-icon-phone::before{content:"\F041"}.van-icon-photo::before{content:"\F042"}.van-icon-photograph::before{content:"\F043"}.van-icon-play::before{content:"\F044"}.van-icon-point-gift::before{content:"\F045"}.van-icon-points-mall::before{content:"\F046"}.van-icon-points::before{content:"\F047"}.van-icon-qr-invalid::before{content:"\F048"}.van-icon-qr::before{content:"\F049"}.van-icon-question::before{content:"\F04A"}.van-icon-receive-gift::before{content:"\F04B"}.van-icon-records::before{content:"\F04C"}.van-icon-search::before{content:"\F04D"}.van-icon-send-gift::before{content:"\F04E"}.van-icon-setting::before{content:"\F04F"}.van-icon-share::before{content:"\F050"}.van-icon-shop-collect::before{content:"\F051"}.van-icon-shop::before{content:"\F052"}.van-icon-shopping-cart::before{content:"\F053"}.van-icon-sign::before{content:"\F054"}.van-icon-stop::before{content:"\F055"}.van-icon-success::before{content:"\F056"}.van-icon-tosend::before{content:"\F057"}.van-icon-underway::before{content:"\F058"}.van-icon-upgrade::before{content:"\F059"}.van-icon-value-card::before{content:"\F05A"}.van-icon-wap-home::before{content:"\F05B"}.van-icon-wap-nav::before{content:"\F05C"}.van-icon-warn::before{content:"\F05D"}.van-icon-wechat::before{content:"\F05E"}

View File

@ -2,7 +2,7 @@
name="slide-down" name="slide-down"
show="{{ show }}" show="{{ show }}"
custom-class="van-notify" custom-class="van-notify"
custom-style="background-color:{{ backgroundColor }}" custom-style="background-color:{{ backgroundColor }}; color: {{ color }}"
> >
{{ text }} {{ text }}
</van-transition> </van-transition>

View File

@ -9,6 +9,7 @@ VantComponent({
showAction: Boolean, showAction: Boolean,
useActionSlot: Boolean, useActionSlot: Boolean,
placeholder: String, placeholder: String,
placeholderStyle: String,
background: { background: {
type: String, type: String,
value: '#f2f2f2' value: '#f2f2f2'

View File

@ -15,6 +15,7 @@
readonly="{{ readony }}" readonly="{{ readony }}"
maxlength="{{ maxlength }}" maxlength="{{ maxlength }}"
placeholder="{{ placeholder }}" placeholder="{{ placeholder }}"
placeholder-style="{{ placeholderStyle }}"
custom-style="padding: 3px 10px" custom-style="padding: 3px 10px"
bind:blur="onBlur" bind:blur="onBlur"
bind:focus="onFocus" bind:focus="onFocus"

28
dist/tag/index.js vendored
View File

@ -1,8 +1,34 @@
import { VantComponent } from '../common/component'; import { VantComponent } from '../common/component';
var DEFAULT_COLOR = '#999';
var COLOR_MAP = {
danger: '#f44',
primary: '#38f',
success: '#06bf04'
};
VantComponent({ VantComponent({
props: { props: {
size: String,
type: String, type: String,
mark: Boolean, mark: Boolean,
plain: Boolean color: String,
plain: Boolean,
round: Boolean
},
computed: {
classes: function classes() {
var data = this.data;
return this.classNames('van-tag', 'custom-class', {
'van-tag--mark': data.mark,
'van-tag--plain': data.plain,
'van-tag--round': data.round,
["van-tag--" + data.size]: data.size,
'van-hairline--surround': data.plain
});
},
style: function style() {
var color = this.data.color || COLOR_MAP[this.data.type] || DEFAULT_COLOR;
var key = this.data.plain ? 'color' : 'background-color';
return key + ": " + color;
}
} }
}); });

4
dist/tag/index.wxml vendored
View File

@ -1,5 +1,3 @@
<view <view class="{{ classes }}" style="{{ style }}">
class="van-tag custom-class {{ mark ? 'van-tag--mark' : '' }} {{ plain ? 'van-tag--plain van-hairline--surround' : '' }} {{ type ? 'van-tag--' + type : '' }}"
>
<slot /> <slot />
</view> </view>

2
dist/tag/index.wxss vendored
View File

@ -1 +1 @@
@import '../common/index.wxss';.van-tag{display:inline-block;padding:2px 5px;line-height:normal;border-radius:3px;font-size:10px;background:#c9c9c9;color:#fff}.van-tag::after{border-color:currentColor;border-radius:4px}.van-tag--mark{padding-right:7px;border-radius:0 8px 8px 0}.van-tag--mark::after{border-radius:0 16px 16px 0}.van-tag--success{background:#06bf04}.van-tag--success.van-tag--plain{color:#06bf04}.van-tag--danger{background:#f44}.van-tag--danger.van-tag--plain{color:#f44}.van-tag--primary{background:#38f}.van-tag--primary.van-tag--plain{color:#38f}.van-tag--plain{background:#fff;color:#c9c9c9} @import '../common/index.wxss';.van-tag{color:#fff;font-size:10px;padding:.2em .5em;line-height:normal;border-radius:.2em;display:inline-block}.van-tag::after{border-color:currentColor;border-radius:.4em}.van-tag--mark{padding-right:.6em;border-radius:0 .8em .8em 0}.van-tag--mark::after{border-radius:0 1.6em 1.6em 0}.van-tag--round{border-radius:.8em}.van-tag--round::after{border-radius:1.6em}.van-tag--medium{font-size:12px}.van-tag--large{font-size:14px}