From 6faaf2b48a23b93a37c1658a2da2df66ec6ddf4b Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Sun, 24 May 2020 20:00:00 +0800 Subject: [PATCH] build: compile 1.3.1 --- dist/button/index.js | 4 + dist/button/index.wxml | 6 +- dist/collapse/index.js | 6 ++ dist/common/index.wxss | 2 +- dist/common/style/normalize.wxss | 1 - dist/field/index.wxss | 2 +- dist/goods-action-button/index.js | 6 +- dist/goods-action/index.js | 18 +++++ dist/nav-bar/index.js | 6 ++ dist/nav-bar/index.wxml | 2 +- lib/button/index.js | 4 + lib/button/index.wxml | 6 +- lib/calendar/utils.js | 119 +++++++++++++++--------------- lib/collapse/index.js | 6 ++ lib/common/color.js | 5 +- lib/common/component.js | 1 + lib/common/index.wxss | 2 +- lib/common/style/normalize.wxss | 1 - lib/common/utils.js | 39 +++++----- lib/common/version.js | 1 + lib/count-down/utils.js | 1 + lib/field/index.wxss | 2 +- lib/field/props.js | 1 + lib/goods-action-button/index.js | 6 +- lib/goods-action/index.js | 19 +++++ lib/mixins/basic.js | 1 + lib/mixins/button.js | 1 + lib/mixins/link.js | 1 + lib/mixins/open-type.js | 1 + lib/mixins/page-scroll.js | 1 + lib/mixins/touch.js | 1 + lib/mixins/transition.js | 1 + lib/nav-bar/index.js | 9 +++ lib/nav-bar/index.wxml | 2 +- lib/picker/shared.js | 1 + lib/uploader/shared.js | 1 + lib/uploader/utils.js | 1 + 37 files changed, 185 insertions(+), 102 deletions(-) delete mode 100644 dist/common/style/normalize.wxss delete mode 100644 lib/common/style/normalize.wxss diff --git a/dist/button/index.js b/dist/button/index.js index 1a40f2b3..9571e6b9 100644 --- a/dist/button/index.js +++ b/dist/button/index.js @@ -9,6 +9,10 @@ VantComponent({ }, props: { icon: String, + classPrefix: { + type: String, + value: 'van-icon', + }, plain: Boolean, block: Boolean, round: Boolean, diff --git a/dist/button/index.wxml b/dist/button/index.wxml index 65a5c3e3..30abac96 100644 --- a/dist/button/index.wxml +++ b/dist/button/index.wxml @@ -31,10 +31,7 @@ type="{{ loadingType }}" color="{{ loadingColor(type,color,plain) }}" /> - + {{ loadingText }} @@ -43,6 +40,7 @@ wx:if="{{ icon }}" size="1.2em" name="{{ icon }}" + class-prefix="{{ classPrefix }}" class="van-button__icon" custom-style="line-height: inherit;" /> diff --git a/dist/collapse/index.js b/dist/collapse/index.js index 804e5a26..33dae31e 100644 --- a/dist/collapse/index.js +++ b/dist/collapse/index.js @@ -27,6 +27,7 @@ VantComponent({ }, switch(name, expanded) { const { accordion, value } = this.data; + const changeItem = name; if (!accordion) { name = expanded ? (value || []).concat(name) @@ -34,6 +35,11 @@ VantComponent({ } else { name = expanded ? name : ''; } + if (expanded) { + this.$emit('open', changeItem); + } else { + this.$emit('close', changeItem); + } this.$emit('change', name); this.$emit('input', name); }, diff --git a/dist/common/index.wxss b/dist/common/index.wxss index 5007bd00..6e6891ff 100644 --- a/dist/common/index.wxss +++ b/dist/common/index.wxss @@ -1 +1 @@ -page{font-family:-apple-system,BlinkMacSystemFont,Helvetica Neue,Helvetica,Segoe UI,Arial,Roboto,PingFang SC,Hiragino Sans GB,Microsoft Yahei,sans-serif}.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{-webkit-line-clamp:3}.van-clearfix:after{display:table;clear:both;content:""}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{position:absolute;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #eee;-webkit-transform:scale(.5);transform:scale(.5)}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px} \ No newline at end of file +.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{-webkit-line-clamp:3}.van-clearfix:after{display:table;clear:both;content:""}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{position:absolute;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #eee;-webkit-transform:scale(.5);transform:scale(.5)}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px} \ No newline at end of file diff --git a/dist/common/style/normalize.wxss b/dist/common/style/normalize.wxss deleted file mode 100644 index 09fc72ba..00000000 --- a/dist/common/style/normalize.wxss +++ /dev/null @@ -1 +0,0 @@ -page{font-family:-apple-system,BlinkMacSystemFont,Helvetica Neue,Helvetica,Segoe UI,Arial,Roboto,PingFang SC,Hiragino Sans GB,Microsoft Yahei,sans-serif} \ No newline at end of file diff --git a/dist/field/index.wxss b/dist/field/index.wxss index 782b802d..00a62a3a 100644 --- a/dist/field/index.wxss +++ b/dist/field/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-field{--cell-icon-size:16px;--cell-icon-size:var(--field-icon-size,16px)}.van-field__body{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center}.van-field__body--textarea{line-height:1.2em}.van-field__body--textarea,.van-field__input{min-height:24px;min-height:var(--cell-line-height,24px)}.van-field__input{position:relative;display:block;box-sizing:border-box;width:100%;margin:0;padding:0;line-height:inherit;text-align:left;background-color:initial;border:0;resize:none;color:#323233;color:var(--field-input-text-color,#323233);height:24px;height:var(--cell-line-height,24px)}.van-field__input--textarea{height:18px;height:var(--field-text-area-min-height,18px);min-height:18px;min-height:var(--field-text-area-min-height,18px)}.van-field__input--error{color:#ee0a24;color:var(--field-input-error-text-color,#ee0a24)}.van-field__input--disabled{background-color:initial;opacity:1;color:#969799;color:var(--field-input-disabled-text-color,#969799)}.van-field__input--center{text-align:center}.van-field__input--right{text-align:right}.van-field__placeholder{position:absolute;top:0;right:0;left:0;pointer-events:none;color:#969799;color:var(--field-placeholder-text-color,#969799)}.van-field__placeholder--error{color:#ee0a24;color:var(--field-error-message-color,#ee0a24)}.van-field__icon-root{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;min-height:24px;min-height:var(--cell-line-height,24px)}.van-field__clear-root,.van-field__icon-container{line-height:inherit;vertical-align:middle;padding:0 8px;padding:0 var(--padding-xs,8px);margin-right:-8px;margin-right:-var(--padding-xs,8px)}.van-field__button,.van-field__clear-root,.van-field__icon-container{-webkit-flex-shrink:0;flex-shrink:0}.van-field__clear-root{font-size:16px;font-size:var(--field-clear-icon-size,16px);color:#c8c9cc;color:var(--field-clear-icon-color,#c8c9cc)}.van-field__icon-container{font-size:16px;font-size:var(--field-icon-size,16px);color:#969799;color:var(--field-icon-container-color,#969799)}.van-field__icon-container:empty{display:none}.van-field__button{padding-left:8px;padding-left:var(--padding-xs,8px)}.van-field__button:empty{display:none}.van-field__error-message{text-align:left;font-size:12px;font-size:var(--field-error-message-text-font-size,12px);color:#ee0a24;color:var(--field-error-message-color,#ee0a24)}.van-field__error-message--center{text-align:center}.van-field__error-message--right{text-align:right}.van-field__word-limit{text-align:right;margin-top:4px;margin-top:var(--padding-base,4px);color:#646566;color:var(--field-word-limit-color,#646566);font-size:12px;font-size:var(--field-word-limit-font-size,12px);line-height:16px;line-height:var(--field-word-limit-line-height,16px)}.van-field__word-num{display:inline}.van-field__word-num--full{color:#ee0a24;color:var(--field-word-num-full-color,#ee0a24)} \ No newline at end of file +@import '../common/index.wxss';.van-field{--cell-icon-size:16px;--cell-icon-size:var(--field-icon-size,16px)}.van-field__body{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center}.van-field__body--textarea{line-height:1.2em}.van-field__body--textarea,.van-field__input{min-height:24px;min-height:var(--cell-line-height,24px)}.van-field__input{position:relative;display:block;box-sizing:border-box;width:100%;margin:0;padding:0;line-height:inherit;text-align:left;background-color:initial;border:0;resize:none;color:#323233;color:var(--field-input-text-color,#323233);height:24px;height:var(--cell-line-height,24px)}.van-field__input--textarea{height:18px;height:var(--field-text-area-min-height,18px);min-height:18px;min-height:var(--field-text-area-min-height,18px)}.van-field__input--error{color:#ee0a24;color:var(--field-input-error-text-color,#ee0a24)}.van-field__input--disabled{background-color:initial;opacity:1;color:#969799;color:var(--field-input-disabled-text-color,#969799)}.van-field__input--center{text-align:center}.van-field__input--right{text-align:right}.van-field__placeholder{position:absolute;top:0;right:0;left:0;pointer-events:none;color:#c8c9cc;color:var(--field-placeholder-text-color,#c8c9cc)}.van-field__placeholder--error{color:#ee0a24;color:var(--field-error-message-color,#ee0a24)}.van-field__icon-root{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;min-height:24px;min-height:var(--cell-line-height,24px)}.van-field__clear-root,.van-field__icon-container{line-height:inherit;vertical-align:middle;padding:0 8px;padding:0 var(--padding-xs,8px);margin-right:-8px;margin-right:-var(--padding-xs,8px)}.van-field__button,.van-field__clear-root,.van-field__icon-container{-webkit-flex-shrink:0;flex-shrink:0}.van-field__clear-root{font-size:16px;font-size:var(--field-clear-icon-size,16px);color:#c8c9cc;color:var(--field-clear-icon-color,#c8c9cc)}.van-field__icon-container{font-size:16px;font-size:var(--field-icon-size,16px);color:#969799;color:var(--field-icon-container-color,#969799)}.van-field__icon-container:empty{display:none}.van-field__button{padding-left:8px;padding-left:var(--padding-xs,8px)}.van-field__button:empty{display:none}.van-field__error-message{text-align:left;font-size:12px;font-size:var(--field-error-message-text-font-size,12px);color:#ee0a24;color:var(--field-error-message-color,#ee0a24)}.van-field__error-message--center{text-align:center}.van-field__error-message--right{text-align:right}.van-field__word-limit{text-align:right;margin-top:4px;margin-top:var(--padding-base,4px);color:#646566;color:var(--field-word-limit-color,#646566);font-size:12px;font-size:var(--field-word-limit-font-size,12px);line-height:16px;line-height:var(--field-word-limit-line-height,16px)}.van-field__word-num{display:inline}.van-field__word-num--full{color:#ee0a24;color:var(--field-word-num-full-color,#ee0a24)} \ No newline at end of file diff --git a/dist/goods-action-button/index.js b/dist/goods-action-button/index.js index d948bc7f..61d3bb3b 100644 --- a/dist/goods-action-button/index.js +++ b/dist/goods-action-button/index.js @@ -20,15 +20,15 @@ VantComponent({ value: 'danger', }, }, - mounted() { - this.updateStyle(); - }, methods: { onClick(event) { this.$emit('click', event.detail); this.jumpLink(); }, updateStyle() { + if (this.parent == null) { + return; + } const { children = [] } = this.parent; const { length } = children; const index = children.indexOf(this); diff --git a/dist/goods-action/index.js b/dist/goods-action/index.js index a4d67c9f..f572326d 100644 --- a/dist/goods-action/index.js +++ b/dist/goods-action/index.js @@ -4,6 +4,15 @@ VantComponent({ type: 'descendant', name: 'goods-action-button', current: 'goods-action', + linked() { + this.updateStyle(); + }, + unlinked() { + this.updateStyle(); + }, + linkChanged() { + this.updateStyle(); + }, }, props: { safeAreaInsetBottom: { @@ -11,4 +20,13 @@ VantComponent({ value: true, }, }, + methods: { + updateStyle() { + wx.nextTick(() => { + this.children.forEach((child) => { + child.updateStyle(); + }); + }); + }, + }, }); diff --git a/dist/nav-bar/index.js b/dist/nav-bar/index.js index 50ebdfa7..afed24e7 100644 --- a/dist/nav-bar/index.js +++ b/dist/nav-bar/index.js @@ -13,6 +13,7 @@ VantComponent({ }, leftText: String, rightText: String, + customStyle: String, leftArrow: Boolean, border: { type: Boolean, @@ -30,12 +31,17 @@ VantComponent({ data: { statusBarHeight: 0, height: 44, + baseStyle: '', }, created() { const { statusBarHeight } = wx.getSystemInfoSync(); + const { safeAreaInsetTop, zIndex } = this.data; + const paddingTop = safeAreaInsetTop ? statusBarHeight : 0; + const baseStyle = `z-index: ${zIndex};padding-top: ${paddingTop}px;`; this.setData({ statusBarHeight, height: 44 + statusBarHeight, + baseStyle, }); }, mounted() { diff --git a/dist/nav-bar/index.wxml b/dist/nav-bar/index.wxml index 9bc58bcb..941bf563 100644 --- a/dist/nav-bar/index.wxml +++ b/dist/nav-bar/index.wxml @@ -4,7 +4,7 @@ diff --git a/lib/button/index.js b/lib/button/index.js index cf0feac2..665c47c5 100644 --- a/lib/button/index.js +++ b/lib/button/index.js @@ -11,6 +11,10 @@ component_1.VantComponent({ }, props: { icon: String, + classPrefix: { + type: String, + value: 'van-icon', + }, plain: Boolean, block: Boolean, round: Boolean, diff --git a/lib/button/index.wxml b/lib/button/index.wxml index 65a5c3e3..30abac96 100644 --- a/lib/button/index.wxml +++ b/lib/button/index.wxml @@ -31,10 +31,7 @@ type="{{ loadingType }}" color="{{ loadingColor(type,color,plain) }}" /> - + {{ loadingText }} @@ -43,6 +40,7 @@ wx:if="{{ icon }}" size="1.2em" name="{{ icon }}" + class-prefix="{{ classPrefix }}" class="van-button__icon" custom-style="line-height: inherit;" /> diff --git a/lib/calendar/utils.js b/lib/calendar/utils.js index 99660b09..cdd1a0cb 100644 --- a/lib/calendar/utils.js +++ b/lib/calendar/utils.js @@ -1,90 +1,91 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +exports.getMonths = exports.getMonthEndDay = exports.copyDates = exports.calcDateNum = exports.getNextDay = exports.getPrevDay = exports.getDayByOffset = exports.compareDay = exports.compareMonth = exports.formatMonthTitle = exports.ROW_HEIGHT = void 0; exports.ROW_HEIGHT = 64; function formatMonthTitle(date) { - if (!(date instanceof Date)) { - date = new Date(date); - } - return date.getFullYear() + "\u5E74" + (date.getMonth() + 1) + "\u6708"; + if (!(date instanceof Date)) { + date = new Date(date); + } + return date.getFullYear() + '\u5E74' + (date.getMonth() + 1) + '\u6708'; } exports.formatMonthTitle = formatMonthTitle; function compareMonth(date1, date2) { - if (!(date1 instanceof Date)) { - date1 = new Date(date1); - } - if (!(date2 instanceof Date)) { - date2 = new Date(date2); - } - var year1 = date1.getFullYear(); - var year2 = date2.getFullYear(); - var month1 = date1.getMonth(); - var month2 = date2.getMonth(); - if (year1 === year2) { - return month1 === month2 ? 0 : month1 > month2 ? 1 : -1; - } - return year1 > year2 ? 1 : -1; + if (!(date1 instanceof Date)) { + date1 = new Date(date1); + } + if (!(date2 instanceof Date)) { + date2 = new Date(date2); + } + var year1 = date1.getFullYear(); + var year2 = date2.getFullYear(); + var month1 = date1.getMonth(); + var month2 = date2.getMonth(); + if (year1 === year2) { + return month1 === month2 ? 0 : month1 > month2 ? 1 : -1; + } + return year1 > year2 ? 1 : -1; } exports.compareMonth = compareMonth; function compareDay(day1, day2) { - if (!(day1 instanceof Date)) { - day1 = new Date(day1); - } - if (!(day2 instanceof Date)) { - day2 = new Date(day2); - } - var compareMonthResult = compareMonth(day1, day2); - if (compareMonthResult === 0) { - var date1 = day1.getDate(); - var date2 = day2.getDate(); - return date1 === date2 ? 0 : date1 > date2 ? 1 : -1; - } - return compareMonthResult; + if (!(day1 instanceof Date)) { + day1 = new Date(day1); + } + if (!(day2 instanceof Date)) { + day2 = new Date(day2); + } + var compareMonthResult = compareMonth(day1, day2); + if (compareMonthResult === 0) { + var date1 = day1.getDate(); + var date2 = day2.getDate(); + return date1 === date2 ? 0 : date1 > date2 ? 1 : -1; + } + return compareMonthResult; } exports.compareDay = compareDay; function getDayByOffset(date, offset) { - date = new Date(date); - date.setDate(date.getDate() + offset); - return date; + date = new Date(date); + date.setDate(date.getDate() + offset); + return date; } exports.getDayByOffset = getDayByOffset; function getPrevDay(date) { - return getDayByOffset(date, -1); + return getDayByOffset(date, -1); } exports.getPrevDay = getPrevDay; function getNextDay(date) { - return getDayByOffset(date, 1); + return getDayByOffset(date, 1); } exports.getNextDay = getNextDay; function calcDateNum(date) { - var day1 = new Date(date[0]).getTime(); - var day2 = new Date(date[1]).getTime(); - return (day2 - day1) / (1000 * 60 * 60 * 24) + 1; + var day1 = new Date(date[0]).getTime(); + var day2 = new Date(date[1]).getTime(); + return (day2 - day1) / (1000 * 60 * 60 * 24) + 1; } exports.calcDateNum = calcDateNum; function copyDates(dates) { - if (Array.isArray(dates)) { - return dates.map(function (date) { - if (date === null) { - return date; - } - return new Date(date); - }); - } - return new Date(dates); + if (Array.isArray(dates)) { + return dates.map(function (date) { + if (date === null) { + return date; + } + return new Date(date); + }); + } + return new Date(dates); } exports.copyDates = copyDates; function getMonthEndDay(year, month) { - return 32 - new Date(year, month - 1, 32).getDate(); + return 32 - new Date(year, month - 1, 32).getDate(); } exports.getMonthEndDay = getMonthEndDay; function getMonths(minDate, maxDate) { - var months = []; - var cursor = new Date(minDate); - cursor.setDate(1); - do { - months.push(cursor.getTime()); - cursor.setMonth(cursor.getMonth() + 1); - } while (compareMonth(cursor, maxDate) !== 1); - return months; + var months = []; + var cursor = new Date(minDate); + cursor.setDate(1); + do { + months.push(cursor.getTime()); + cursor.setMonth(cursor.getMonth() + 1); + } while (compareMonth(cursor, maxDate) !== 1); + return months; } exports.getMonths = getMonths; diff --git a/lib/collapse/index.js b/lib/collapse/index.js index 636ed032..ab68400c 100644 --- a/lib/collapse/index.js +++ b/lib/collapse/index.js @@ -31,6 +31,7 @@ component_1.VantComponent({ var _a = this.data, accordion = _a.accordion, value = _a.value; + var changeItem = name; if (!accordion) { name = expanded ? (value || []).concat(name) @@ -40,6 +41,11 @@ component_1.VantComponent({ } else { name = expanded ? name : ''; } + if (expanded) { + this.$emit('open', changeItem); + } else { + this.$emit('close', changeItem); + } this.$emit('change', name); this.$emit('input', name); }, diff --git a/lib/common/color.js b/lib/common/color.js index 06f54ba1..885acaa7 100644 --- a/lib/common/color.js +++ b/lib/common/color.js @@ -1,5 +1,6 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +exports.GRAY_DARK = exports.GRAY = exports.ORANGE = exports.GREEN = exports.WHITE = exports.BLUE = exports.RED = void 0; exports.RED = '#ee0a24'; exports.BLUE = '#1989fa'; exports.WHITE = '#fff'; diff --git a/lib/common/component.js b/lib/common/component.js index 2126525d..e43a2775 100644 --- a/lib/common/component.js +++ b/lib/common/component.js @@ -1,5 +1,6 @@ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); +exports.VantComponent = void 0; var basic_1 = require('../mixins/basic'); var relationFunctions = { ancestor: { diff --git a/lib/common/index.wxss b/lib/common/index.wxss index 5007bd00..6e6891ff 100644 --- a/lib/common/index.wxss +++ b/lib/common/index.wxss @@ -1 +1 @@ -page{font-family:-apple-system,BlinkMacSystemFont,Helvetica Neue,Helvetica,Segoe UI,Arial,Roboto,PingFang SC,Hiragino Sans GB,Microsoft Yahei,sans-serif}.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{-webkit-line-clamp:3}.van-clearfix:after{display:table;clear:both;content:""}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{position:absolute;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #eee;-webkit-transform:scale(.5);transform:scale(.5)}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px} \ No newline at end of file +.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{-webkit-line-clamp:3}.van-clearfix:after{display:table;clear:both;content:""}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{position:absolute;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #eee;-webkit-transform:scale(.5);transform:scale(.5)}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px} \ No newline at end of file diff --git a/lib/common/style/normalize.wxss b/lib/common/style/normalize.wxss deleted file mode 100644 index 09fc72ba..00000000 --- a/lib/common/style/normalize.wxss +++ /dev/null @@ -1 +0,0 @@ -page{font-family:-apple-system,BlinkMacSystemFont,Helvetica Neue,Helvetica,Segoe UI,Arial,Roboto,PingFang SC,Hiragino Sans GB,Microsoft Yahei,sans-serif} \ No newline at end of file diff --git a/lib/common/utils.js b/lib/common/utils.js index 9a913a82..f8f07e8c 100644 --- a/lib/common/utils.js +++ b/lib/common/utils.js @@ -1,41 +1,42 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +exports.addUnit = exports.getSystemInfoSync = exports.nextTick = exports.range = exports.isNumber = exports.isObj = exports.isDef = void 0; function isDef(value) { - return value !== undefined && value !== null; + return value !== undefined && value !== null; } exports.isDef = isDef; function isObj(x) { - var type = typeof x; - return x !== null && (type === 'object' || type === 'function'); + var type = typeof x; + return x !== null && (type === 'object' || type === 'function'); } exports.isObj = isObj; function isNumber(value) { - return /^\d+(\.\d+)?$/.test(value); + return /^\d+(\.\d+)?$/.test(value); } exports.isNumber = isNumber; function range(num, min, max) { - return Math.min(Math.max(num, min), max); + return Math.min(Math.max(num, min), max); } exports.range = range; function nextTick(fn) { - setTimeout(function () { - fn(); - }, 1000 / 30); + setTimeout(function () { + fn(); + }, 1000 / 30); } exports.nextTick = nextTick; var systemInfo = null; function getSystemInfoSync() { - if (systemInfo == null) { - systemInfo = wx.getSystemInfoSync(); - } - return systemInfo; + if (systemInfo == null) { + systemInfo = wx.getSystemInfoSync(); + } + return systemInfo; } exports.getSystemInfoSync = getSystemInfoSync; function addUnit(value) { - if (!isDef(value)) { - return undefined; - } - value = String(value); - return isNumber(value) ? value + "px" : value; + if (!isDef(value)) { + return undefined; + } + value = String(value); + return isNumber(value) ? value + 'px' : value; } exports.addUnit = addUnit; diff --git a/lib/common/version.js b/lib/common/version.js index e468648b..e0570922 100644 --- a/lib/common/version.js +++ b/lib/common/version.js @@ -1,5 +1,6 @@ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); +exports.canIUseModel = void 0; var utils_1 = require('./utils'); function compareVersion(v1, v2) { v1 = v1.split('.'); diff --git a/lib/count-down/utils.js b/lib/count-down/utils.js index a608df11..10864a21 100644 --- a/lib/count-down/utils.js +++ b/lib/count-down/utils.js @@ -1,5 +1,6 @@ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); +exports.isSameSecond = exports.parseFormat = exports.parseTimeData = void 0; function padZero(num, targetLength) { if (targetLength === void 0) { targetLength = 2; diff --git a/lib/field/index.wxss b/lib/field/index.wxss index 782b802d..00a62a3a 100644 --- a/lib/field/index.wxss +++ b/lib/field/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-field{--cell-icon-size:16px;--cell-icon-size:var(--field-icon-size,16px)}.van-field__body{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center}.van-field__body--textarea{line-height:1.2em}.van-field__body--textarea,.van-field__input{min-height:24px;min-height:var(--cell-line-height,24px)}.van-field__input{position:relative;display:block;box-sizing:border-box;width:100%;margin:0;padding:0;line-height:inherit;text-align:left;background-color:initial;border:0;resize:none;color:#323233;color:var(--field-input-text-color,#323233);height:24px;height:var(--cell-line-height,24px)}.van-field__input--textarea{height:18px;height:var(--field-text-area-min-height,18px);min-height:18px;min-height:var(--field-text-area-min-height,18px)}.van-field__input--error{color:#ee0a24;color:var(--field-input-error-text-color,#ee0a24)}.van-field__input--disabled{background-color:initial;opacity:1;color:#969799;color:var(--field-input-disabled-text-color,#969799)}.van-field__input--center{text-align:center}.van-field__input--right{text-align:right}.van-field__placeholder{position:absolute;top:0;right:0;left:0;pointer-events:none;color:#969799;color:var(--field-placeholder-text-color,#969799)}.van-field__placeholder--error{color:#ee0a24;color:var(--field-error-message-color,#ee0a24)}.van-field__icon-root{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;min-height:24px;min-height:var(--cell-line-height,24px)}.van-field__clear-root,.van-field__icon-container{line-height:inherit;vertical-align:middle;padding:0 8px;padding:0 var(--padding-xs,8px);margin-right:-8px;margin-right:-var(--padding-xs,8px)}.van-field__button,.van-field__clear-root,.van-field__icon-container{-webkit-flex-shrink:0;flex-shrink:0}.van-field__clear-root{font-size:16px;font-size:var(--field-clear-icon-size,16px);color:#c8c9cc;color:var(--field-clear-icon-color,#c8c9cc)}.van-field__icon-container{font-size:16px;font-size:var(--field-icon-size,16px);color:#969799;color:var(--field-icon-container-color,#969799)}.van-field__icon-container:empty{display:none}.van-field__button{padding-left:8px;padding-left:var(--padding-xs,8px)}.van-field__button:empty{display:none}.van-field__error-message{text-align:left;font-size:12px;font-size:var(--field-error-message-text-font-size,12px);color:#ee0a24;color:var(--field-error-message-color,#ee0a24)}.van-field__error-message--center{text-align:center}.van-field__error-message--right{text-align:right}.van-field__word-limit{text-align:right;margin-top:4px;margin-top:var(--padding-base,4px);color:#646566;color:var(--field-word-limit-color,#646566);font-size:12px;font-size:var(--field-word-limit-font-size,12px);line-height:16px;line-height:var(--field-word-limit-line-height,16px)}.van-field__word-num{display:inline}.van-field__word-num--full{color:#ee0a24;color:var(--field-word-num-full-color,#ee0a24)} \ No newline at end of file +@import '../common/index.wxss';.van-field{--cell-icon-size:16px;--cell-icon-size:var(--field-icon-size,16px)}.van-field__body{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center}.van-field__body--textarea{line-height:1.2em}.van-field__body--textarea,.van-field__input{min-height:24px;min-height:var(--cell-line-height,24px)}.van-field__input{position:relative;display:block;box-sizing:border-box;width:100%;margin:0;padding:0;line-height:inherit;text-align:left;background-color:initial;border:0;resize:none;color:#323233;color:var(--field-input-text-color,#323233);height:24px;height:var(--cell-line-height,24px)}.van-field__input--textarea{height:18px;height:var(--field-text-area-min-height,18px);min-height:18px;min-height:var(--field-text-area-min-height,18px)}.van-field__input--error{color:#ee0a24;color:var(--field-input-error-text-color,#ee0a24)}.van-field__input--disabled{background-color:initial;opacity:1;color:#969799;color:var(--field-input-disabled-text-color,#969799)}.van-field__input--center{text-align:center}.van-field__input--right{text-align:right}.van-field__placeholder{position:absolute;top:0;right:0;left:0;pointer-events:none;color:#c8c9cc;color:var(--field-placeholder-text-color,#c8c9cc)}.van-field__placeholder--error{color:#ee0a24;color:var(--field-error-message-color,#ee0a24)}.van-field__icon-root{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;min-height:24px;min-height:var(--cell-line-height,24px)}.van-field__clear-root,.van-field__icon-container{line-height:inherit;vertical-align:middle;padding:0 8px;padding:0 var(--padding-xs,8px);margin-right:-8px;margin-right:-var(--padding-xs,8px)}.van-field__button,.van-field__clear-root,.van-field__icon-container{-webkit-flex-shrink:0;flex-shrink:0}.van-field__clear-root{font-size:16px;font-size:var(--field-clear-icon-size,16px);color:#c8c9cc;color:var(--field-clear-icon-color,#c8c9cc)}.van-field__icon-container{font-size:16px;font-size:var(--field-icon-size,16px);color:#969799;color:var(--field-icon-container-color,#969799)}.van-field__icon-container:empty{display:none}.van-field__button{padding-left:8px;padding-left:var(--padding-xs,8px)}.van-field__button:empty{display:none}.van-field__error-message{text-align:left;font-size:12px;font-size:var(--field-error-message-text-font-size,12px);color:#ee0a24;color:var(--field-error-message-color,#ee0a24)}.van-field__error-message--center{text-align:center}.van-field__error-message--right{text-align:right}.van-field__word-limit{text-align:right;margin-top:4px;margin-top:var(--padding-base,4px);color:#646566;color:var(--field-word-limit-color,#646566);font-size:12px;font-size:var(--field-word-limit-font-size,12px);line-height:16px;line-height:var(--field-word-limit-line-height,16px)}.van-field__word-num{display:inline}.van-field__word-num--full{color:#ee0a24;color:var(--field-word-num-full-color,#ee0a24)} \ No newline at end of file diff --git a/lib/field/props.js b/lib/field/props.js index b8e6cc9f..6ce703be 100644 --- a/lib/field/props.js +++ b/lib/field/props.js @@ -1,5 +1,6 @@ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); +exports.textareaProps = exports.inputProps = exports.commonProps = void 0; exports.commonProps = { value: { type: String, diff --git a/lib/goods-action-button/index.js b/lib/goods-action-button/index.js index 9c1d370c..65e9dba6 100644 --- a/lib/goods-action-button/index.js +++ b/lib/goods-action-button/index.js @@ -22,15 +22,15 @@ component_1.VantComponent({ value: 'danger', }, }, - mounted: function () { - this.updateStyle(); - }, methods: { onClick: function (event) { this.$emit('click', event.detail); this.jumpLink(); }, updateStyle: function () { + if (this.parent == null) { + return; + } var _a = this.parent.children, children = _a === void 0 ? [] : _a; var length = children.length; diff --git a/lib/goods-action/index.js b/lib/goods-action/index.js index 3c7f1d5d..43921473 100644 --- a/lib/goods-action/index.js +++ b/lib/goods-action/index.js @@ -6,6 +6,15 @@ component_1.VantComponent({ type: 'descendant', name: 'goods-action-button', current: 'goods-action', + linked: function () { + this.updateStyle(); + }, + unlinked: function () { + this.updateStyle(); + }, + linkChanged: function () { + this.updateStyle(); + }, }, props: { safeAreaInsetBottom: { @@ -13,4 +22,14 @@ component_1.VantComponent({ value: true, }, }, + methods: { + updateStyle: function () { + var _this = this; + wx.nextTick(function () { + _this.children.forEach(function (child) { + child.updateStyle(); + }); + }); + }, + }, }); diff --git a/lib/mixins/basic.js b/lib/mixins/basic.js index 457e1e7d..2058c0b6 100644 --- a/lib/mixins/basic.js +++ b/lib/mixins/basic.js @@ -1,5 +1,6 @@ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); +exports.basic = void 0; exports.basic = Behavior({ methods: { $emit: function () { diff --git a/lib/mixins/button.js b/lib/mixins/button.js index 166e19df..8de45e9d 100644 --- a/lib/mixins/button.js +++ b/lib/mixins/button.js @@ -1,5 +1,6 @@ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); +exports.button = void 0; exports.button = Behavior({ externalClasses: ['hover-class'], properties: { diff --git a/lib/mixins/link.js b/lib/mixins/link.js index 17dd2d9f..cbd2745e 100644 --- a/lib/mixins/link.js +++ b/lib/mixins/link.js @@ -1,5 +1,6 @@ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); +exports.link = void 0; exports.link = Behavior({ properties: { url: String, diff --git a/lib/mixins/open-type.js b/lib/mixins/open-type.js index 28d98d89..a7edf77d 100644 --- a/lib/mixins/open-type.js +++ b/lib/mixins/open-type.js @@ -1,5 +1,6 @@ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); +exports.openType = void 0; exports.openType = Behavior({ properties: { openType: String, diff --git a/lib/mixins/page-scroll.js b/lib/mixins/page-scroll.js index 5d35fdac..6c2a58b4 100644 --- a/lib/mixins/page-scroll.js +++ b/lib/mixins/page-scroll.js @@ -1,5 +1,6 @@ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); +exports.pageScrollMixin = void 0; function getCurrentPage() { var pages = getCurrentPages(); return pages[pages.length - 1] || {}; diff --git a/lib/mixins/touch.js b/lib/mixins/touch.js index 19ba1d34..8c3a1459 100644 --- a/lib/mixins/touch.js +++ b/lib/mixins/touch.js @@ -1,5 +1,6 @@ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); +exports.touch = void 0; var MIN_DISTANCE = 10; function getDirection(x, y) { if (x > y && x > MIN_DISTANCE) { diff --git a/lib/mixins/transition.js b/lib/mixins/transition.js index 78949143..548a62ce 100644 --- a/lib/mixins/transition.js +++ b/lib/mixins/transition.js @@ -1,5 +1,6 @@ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); +exports.transition = void 0; var utils_1 = require('../common/utils'); var getClassNames = function (name) { return { diff --git a/lib/nav-bar/index.js b/lib/nav-bar/index.js index 95072de5..2894d294 100644 --- a/lib/nav-bar/index.js +++ b/lib/nav-bar/index.js @@ -15,6 +15,7 @@ component_1.VantComponent({ }, leftText: String, rightText: String, + customStyle: String, leftArrow: Boolean, border: { type: Boolean, @@ -32,12 +33,20 @@ component_1.VantComponent({ data: { statusBarHeight: 0, height: 44, + baseStyle: '', }, created: function () { var statusBarHeight = wx.getSystemInfoSync().statusBarHeight; + var _a = this.data, + safeAreaInsetTop = _a.safeAreaInsetTop, + zIndex = _a.zIndex; + var paddingTop = safeAreaInsetTop ? statusBarHeight : 0; + var baseStyle = + 'z-index: ' + zIndex + ';padding-top: ' + paddingTop + 'px;'; this.setData({ statusBarHeight: statusBarHeight, height: 44 + statusBarHeight, + baseStyle: baseStyle, }); }, mounted: function () { diff --git a/lib/nav-bar/index.wxml b/lib/nav-bar/index.wxml index 9bc58bcb..941bf563 100644 --- a/lib/nav-bar/index.wxml +++ b/lib/nav-bar/index.wxml @@ -4,7 +4,7 @@ diff --git a/lib/picker/shared.js b/lib/picker/shared.js index 64c4aba2..4081f546 100644 --- a/lib/picker/shared.js +++ b/lib/picker/shared.js @@ -1,5 +1,6 @@ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); +exports.pickerProps = void 0; exports.pickerProps = { title: String, loading: Boolean, diff --git a/lib/uploader/shared.js b/lib/uploader/shared.js index 9fe56d2f..94186186 100644 --- a/lib/uploader/shared.js +++ b/lib/uploader/shared.js @@ -1,5 +1,6 @@ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); +exports.chooseVideoProps = exports.chooseImageProps = void 0; // props for choose image exports.chooseImageProps = { sizeType: { diff --git a/lib/uploader/utils.js b/lib/uploader/utils.js index e88f9980..082374e3 100644 --- a/lib/uploader/utils.js +++ b/lib/uploader/utils.js @@ -1,5 +1,6 @@ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); +exports.isPromise = exports.isObject = exports.isFunction = exports.chooseFile = exports.isVideo = exports.isImageFile = void 0; var IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i; function isImageUrl(url) { return IMAGE_REGEXP.test(url);