vant 3.5.0 → 3.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +10 -0
- package/README.md +13 -13
- package/changelog.generated.md +67 -0
- package/es/action-bar/ActionBar.d.ts +4 -0
- package/es/action-bar/ActionBar.mjs +13 -2
- package/es/action-bar/index.d.ts +3 -0
- package/es/button/index.less +1 -1
- package/es/calendar/Calendar.mjs +6 -1
- package/es/calendar/types.d.ts +1 -0
- package/es/cell/Cell.d.ts +1 -1
- package/es/cell/index.d.ts +1 -1
- package/es/collapse/Collapse.d.ts +8 -1
- package/es/collapse/Collapse.mjs +28 -1
- package/es/collapse/index.d.ts +1 -1
- package/es/collapse-item/CollapseItem.d.ts +1 -1
- package/es/collapse-item/CollapseItem.mjs +3 -1
- package/es/collapse-item/index.d.ts +1 -1
- package/es/collapse-item/index.less +1 -1
- package/es/composables/use-height.d.ts +1 -1
- package/es/composables/use-height.mjs +6 -2
- package/es/composables/use-placeholder.mjs +1 -1
- package/es/dialog/Dialog.d.ts +1 -1
- package/es/field/Field.d.ts +4 -2
- package/es/field/Field.mjs +7 -1
- package/es/field/index.d.ts +4 -2
- package/es/field/index.less +1 -1
- package/es/grid-item/index.less +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/locale/index.d.ts +1 -1
- package/es/popover/Popover.mjs +17 -18
- package/es/popup/Popup.mjs +1 -1
- package/es/pull-refresh/PullRefresh.d.ts +2 -1
- package/es/pull-refresh/PullRefresh.mjs +5 -1
- package/es/pull-refresh/index.d.ts +2 -1
- package/es/sidebar-item/index.less +1 -1
- package/es/submit-bar/SubmitBar.d.ts +4 -0
- package/es/submit-bar/SubmitBar.mjs +13 -2
- package/es/submit-bar/index.d.ts +3 -0
- package/es/swipe/index.less +1 -1
- package/es/switch/index.less +1 -1
- package/es/toast/function-call.d.ts +5 -6
- package/es/toast/index.less +1 -1
- package/es/toast/types.d.ts +10 -1
- package/es/uploader/Uploader.d.ts +3 -3
- package/es/uploader/Uploader.mjs +1 -1
- package/es/uploader/index.d.ts +2 -2
- package/es/utils/basic.d.ts +3 -3
- package/es/utils/create.d.ts +1 -1
- package/lib/.DS_Store +0 -0
- package/lib/action-bar/.DS_Store +0 -0
- package/lib/action-bar/ActionBar.d.ts +4 -0
- package/lib/action-bar/ActionBar.js +12 -1
- package/lib/action-bar/index.d.ts +3 -0
- package/lib/action-bar-button/.DS_Store +0 -0
- package/lib/action-bar-icon/.DS_Store +0 -0
- package/lib/action-sheet/.DS_Store +0 -0
- package/lib/address-edit/.DS_Store +0 -0
- package/lib/address-list/.DS_Store +0 -0
- package/lib/area/.DS_Store +0 -0
- package/lib/badge/.DS_Store +0 -0
- package/lib/button/.DS_Store +0 -0
- package/lib/button/index.less +1 -1
- package/lib/calendar/.DS_Store +0 -0
- package/lib/calendar/Calendar.js +6 -1
- package/lib/calendar/types.d.ts +1 -0
- package/lib/card/.DS_Store +0 -0
- package/lib/cascader/.DS_Store +0 -0
- package/lib/cell/.DS_Store +0 -0
- package/lib/cell/Cell.d.ts +1 -1
- package/lib/cell/index.d.ts +1 -1
- package/lib/cell-group/.DS_Store +0 -0
- package/lib/checkbox/.DS_Store +0 -0
- package/lib/checkbox-group/.DS_Store +0 -0
- package/lib/circle/.DS_Store +0 -0
- package/lib/col/.DS_Store +0 -0
- package/lib/collapse/.DS_Store +0 -0
- package/lib/collapse/Collapse.d.ts +8 -1
- package/lib/collapse/Collapse.js +28 -1
- package/lib/collapse/index.d.ts +1 -1
- package/lib/collapse-item/.DS_Store +0 -0
- package/lib/collapse-item/CollapseItem.d.ts +1 -1
- package/lib/collapse-item/CollapseItem.js +3 -1
- package/lib/collapse-item/index.d.ts +1 -1
- package/lib/collapse-item/index.less +1 -1
- package/lib/composables/use-height.d.ts +1 -1
- package/lib/composables/use-height.js +6 -2
- package/lib/composables/use-placeholder.js +1 -1
- package/lib/config-provider/.DS_Store +0 -0
- package/lib/contact-card/.DS_Store +0 -0
- package/lib/contact-edit/.DS_Store +0 -0
- package/lib/contact-list/.DS_Store +0 -0
- package/lib/count-down/.DS_Store +0 -0
- package/lib/coupon/.DS_Store +0 -0
- package/lib/coupon-cell/.DS_Store +0 -0
- package/lib/coupon-list/.DS_Store +0 -0
- package/lib/datetime-picker/.DS_Store +0 -0
- package/lib/dialog/.DS_Store +0 -0
- package/lib/dialog/Dialog.d.ts +1 -1
- package/lib/divider/.DS_Store +0 -0
- package/lib/dropdown-item/.DS_Store +0 -0
- package/lib/dropdown-menu/.DS_Store +0 -0
- package/lib/empty/.DS_Store +0 -0
- package/lib/field/.DS_Store +0 -0
- package/lib/field/Field.d.ts +4 -2
- package/lib/field/Field.js +7 -1
- package/lib/field/index.d.ts +4 -2
- package/lib/field/index.less +1 -1
- package/lib/form/.DS_Store +0 -0
- package/lib/grid/.DS_Store +0 -0
- package/lib/grid-item/.DS_Store +0 -0
- package/lib/grid-item/index.less +1 -1
- package/lib/icon/.DS_Store +0 -0
- package/lib/image/.DS_Store +0 -0
- package/lib/image-preview/.DS_Store +0 -0
- package/lib/index-anchor/.DS_Store +0 -0
- package/lib/index-bar/.DS_Store +0 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/lazyload/.DS_Store +0 -0
- package/lib/list/.DS_Store +0 -0
- package/lib/loading/.DS_Store +0 -0
- package/lib/locale/.DS_Store +0 -0
- package/lib/locale/index.d.ts +1 -1
- package/lib/nav-bar/.DS_Store +0 -0
- package/lib/notice-bar/.DS_Store +0 -0
- package/lib/notify/.DS_Store +0 -0
- package/lib/number-keyboard/.DS_Store +0 -0
- package/lib/overlay/.DS_Store +0 -0
- package/lib/pagination/.DS_Store +0 -0
- package/lib/password-input/.DS_Store +0 -0
- package/lib/picker/.DS_Store +0 -0
- package/lib/popover/.DS_Store +0 -0
- package/lib/popover/Popover.js +17 -18
- package/lib/popup/.DS_Store +0 -0
- package/lib/popup/Popup.js +1 -1
- package/lib/progress/.DS_Store +0 -0
- package/lib/pull-refresh/.DS_Store +0 -0
- package/lib/pull-refresh/PullRefresh.d.ts +2 -1
- package/lib/pull-refresh/PullRefresh.js +5 -1
- package/lib/pull-refresh/index.d.ts +2 -1
- package/lib/radio/.DS_Store +0 -0
- package/lib/radio-group/.DS_Store +0 -0
- package/lib/rate/.DS_Store +0 -0
- package/lib/row/.DS_Store +0 -0
- package/lib/search/.DS_Store +0 -0
- package/lib/share-sheet/.DS_Store +0 -0
- package/lib/sidebar/.DS_Store +0 -0
- package/lib/sidebar-item/.DS_Store +0 -0
- package/lib/sidebar-item/index.less +1 -1
- package/lib/skeleton/.DS_Store +0 -0
- package/lib/slider/.DS_Store +0 -0
- package/lib/step/.DS_Store +0 -0
- package/lib/stepper/.DS_Store +0 -0
- package/lib/steps/.DS_Store +0 -0
- package/lib/sticky/.DS_Store +0 -0
- package/lib/submit-bar/.DS_Store +0 -0
- package/lib/submit-bar/SubmitBar.d.ts +4 -0
- package/lib/submit-bar/SubmitBar.js +12 -1
- package/lib/submit-bar/index.d.ts +3 -0
- package/lib/swipe/.DS_Store +0 -0
- package/lib/swipe/index.less +1 -1
- package/lib/swipe-cell/.DS_Store +0 -0
- package/lib/swipe-item/.DS_Store +0 -0
- package/lib/switch/.DS_Store +0 -0
- package/lib/switch/index.less +1 -1
- package/lib/tab/.DS_Store +0 -0
- package/lib/tabbar/.DS_Store +0 -0
- package/lib/tabbar-item/.DS_Store +0 -0
- package/lib/tabs/.DS_Store +0 -0
- package/lib/tag/.DS_Store +0 -0
- package/lib/toast/.DS_Store +0 -0
- package/lib/toast/function-call.d.ts +5 -6
- package/lib/toast/index.less +1 -1
- package/lib/toast/types.d.ts +10 -1
- package/lib/tree-select/.DS_Store +0 -0
- package/lib/uploader/.DS_Store +0 -0
- package/lib/uploader/Uploader.d.ts +3 -3
- package/lib/uploader/Uploader.js +1 -1
- package/lib/uploader/index.d.ts +2 -2
- package/lib/utils/basic.d.ts +3 -3
- package/lib/utils/create.d.ts +1 -1
- package/lib/vant.cjs.js +191 -52
- package/lib/vant.es.js +280 -51
- package/lib/vant.js +189 -50
- package/lib/vant.min.js +1 -1
- package/{vetur → lib}/web-types.json +1652 -1609
- package/package.json +9 -14
- package/lib/ssr.js +0 -7
- package/lib/ssr.mjs +0 -1
- package/lib/vant.cjs.min.js +0 -1
- package/lib/vant.es.min.js +0 -14660
- package/vetur/attributes.json +0 -3474
- package/vetur/tags.json +0 -1202
package/lib/vant.js
CHANGED
@@ -352,7 +352,7 @@
|
|
352
352
|
}
|
353
353
|
return { width, height };
|
354
354
|
}
|
355
|
-
var overflowScrollReg = /scroll|auto/i;
|
355
|
+
var overflowScrollReg = /scroll|auto|overlay/i;
|
356
356
|
var defaultRoot = inBrowser ? window : void 0;
|
357
357
|
function isElement$1(node) {
|
358
358
|
const ELEMENT_NODE_TYPE = 1;
|
@@ -747,9 +747,34 @@
|
|
747
747
|
};
|
748
748
|
return options;
|
749
749
|
}
|
750
|
+
const useHeight = (element, withSafeArea) => {
|
751
|
+
const height2 = vue.ref();
|
752
|
+
const setHeight = () => {
|
753
|
+
height2.value = useRect(element).height;
|
754
|
+
};
|
755
|
+
vue.onMounted(() => {
|
756
|
+
vue.nextTick(setHeight);
|
757
|
+
if (withSafeArea) {
|
758
|
+
for (let i = 1; i <= 3; i++) {
|
759
|
+
setTimeout(setHeight, 100 * i);
|
760
|
+
}
|
761
|
+
}
|
762
|
+
});
|
763
|
+
return height2;
|
764
|
+
};
|
765
|
+
function usePlaceholder(contentRef, bem2) {
|
766
|
+
const height2 = useHeight(contentRef, true);
|
767
|
+
return (renderContent) => vue.createVNode("div", {
|
768
|
+
"class": bem2("placeholder"),
|
769
|
+
"style": {
|
770
|
+
height: height2.value ? `${height2.value}px` : void 0
|
771
|
+
}
|
772
|
+
}, [renderContent()]);
|
773
|
+
}
|
750
774
|
const [name$1u, bem$1q] = createNamespace("action-bar");
|
751
775
|
const ACTION_BAR_KEY = Symbol(name$1u);
|
752
776
|
const actionBarProps = {
|
777
|
+
placeholder: Boolean,
|
753
778
|
safeAreaInsetBottom: truthProp
|
754
779
|
};
|
755
780
|
var stdin_default$1B = vue.defineComponent({
|
@@ -758,18 +783,27 @@
|
|
758
783
|
setup(props, {
|
759
784
|
slots
|
760
785
|
}) {
|
786
|
+
const root = vue.ref();
|
787
|
+
const renderPlaceholder = usePlaceholder(root, bem$1q);
|
761
788
|
const {
|
762
789
|
linkChildren
|
763
790
|
} = useChildren(ACTION_BAR_KEY);
|
764
791
|
linkChildren();
|
765
|
-
|
792
|
+
const renderActionBar = () => {
|
766
793
|
var _a;
|
767
794
|
return vue.createVNode("div", {
|
795
|
+
"ref": root,
|
768
796
|
"class": [bem$1q(), {
|
769
797
|
"van-safe-area-bottom": props.safeAreaInsetBottom
|
770
798
|
}]
|
771
799
|
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
772
800
|
};
|
801
|
+
return () => {
|
802
|
+
if (props.placeholder) {
|
803
|
+
return renderPlaceholder(renderActionBar);
|
804
|
+
}
|
805
|
+
return renderActionBar();
|
806
|
+
};
|
773
807
|
}
|
774
808
|
});
|
775
809
|
const ActionBar = withInstall(stdin_default$1B);
|
@@ -1653,7 +1687,7 @@
|
|
1653
1687
|
}
|
1654
1688
|
});
|
1655
1689
|
vue.onDeactivated(() => {
|
1656
|
-
if (props.show) {
|
1690
|
+
if (props.show && props.teleport) {
|
1657
1691
|
close();
|
1658
1692
|
shouldReopen = true;
|
1659
1693
|
}
|
@@ -2067,6 +2101,14 @@
|
|
2067
2101
|
emit,
|
2068
2102
|
slots
|
2069
2103
|
}) {
|
2104
|
+
if (process.env.NODE_ENV !== "production") {
|
2105
|
+
if (slots.default) {
|
2106
|
+
console.warn('[Vant] Picker: "default" slot is deprecated, please use "toolbar" slot instead.');
|
2107
|
+
}
|
2108
|
+
if (props.valueKey) {
|
2109
|
+
console.warn('[Vant] Picker: "valueKey" prop is deprecated, please use "columnsFieldNames" prop instead.');
|
2110
|
+
}
|
2111
|
+
}
|
2070
2112
|
const hasOptions = vue.ref(false);
|
2071
2113
|
const formattedColumns = vue.ref([]);
|
2072
2114
|
const columnsFieldNames = vue.computed(() => {
|
@@ -2917,6 +2959,9 @@
|
|
2917
2959
|
function useId$1() {
|
2918
2960
|
const vm = vue.getCurrentInstance();
|
2919
2961
|
const { name: name2 = "unknown" } = (vm == null ? void 0 : vm.type) || {};
|
2962
|
+
if (process.env.NODE_ENV === "test") {
|
2963
|
+
return name2;
|
2964
|
+
}
|
2920
2965
|
return `${name2}-${++current}`;
|
2921
2966
|
}
|
2922
2967
|
const [name$1e, bem$1a] = createNamespace("field");
|
@@ -2969,7 +3014,7 @@
|
|
2969
3014
|
var stdin_default$1l = vue.defineComponent({
|
2970
3015
|
name: name$1e,
|
2971
3016
|
props: fieldProps,
|
2972
|
-
emits: ["blur", "focus", "clear", "keypress", "click-input", "click-left-icon", "click-right-icon", "update:modelValue"],
|
3017
|
+
emits: ["blur", "focus", "clear", "keypress", "click-input", "end-validate", "start-validate", "click-left-icon", "click-right-icon", "update:modelValue"],
|
2973
3018
|
setup(props, {
|
2974
3019
|
emit,
|
2975
3020
|
slots
|
@@ -3043,18 +3088,24 @@
|
|
3043
3088
|
state.status = "unvalidated";
|
3044
3089
|
state.validateMessage = "";
|
3045
3090
|
};
|
3091
|
+
const endValidate = () => emit("end-validate", {
|
3092
|
+
status: state.status
|
3093
|
+
});
|
3046
3094
|
const validate = (rules = props.rules) => new Promise((resolve) => {
|
3047
3095
|
resetValidation();
|
3048
3096
|
if (rules) {
|
3097
|
+
emit("start-validate");
|
3049
3098
|
runRules(rules).then(() => {
|
3050
3099
|
if (state.status === "failed") {
|
3051
3100
|
resolve({
|
3052
3101
|
name: props.name,
|
3053
3102
|
message: state.validateMessage
|
3054
3103
|
});
|
3104
|
+
endValidate();
|
3055
3105
|
} else {
|
3056
3106
|
state.status = "passed";
|
3057
3107
|
resolve();
|
3108
|
+
endValidate();
|
3058
3109
|
}
|
3059
3110
|
});
|
3060
3111
|
} else {
|
@@ -4599,17 +4650,6 @@
|
|
4599
4650
|
}
|
4600
4651
|
});
|
4601
4652
|
};
|
4602
|
-
const useHeight = (element) => {
|
4603
|
-
const height2 = vue.ref();
|
4604
|
-
const setHeight = () => {
|
4605
|
-
height2.value = useRect(element).height;
|
4606
|
-
};
|
4607
|
-
vue.onMounted(() => {
|
4608
|
-
vue.nextTick(setHeight);
|
4609
|
-
setTimeout(setHeight, 100);
|
4610
|
-
});
|
4611
|
-
return height2;
|
4612
|
-
};
|
4613
4653
|
const [name$13] = createNamespace("calendar-day");
|
4614
4654
|
var stdin_default$1a = vue.defineComponent({
|
4615
4655
|
name: name$13,
|
@@ -5081,6 +5121,9 @@
|
|
5081
5121
|
const months = vue.computed(() => {
|
5082
5122
|
const months2 = [];
|
5083
5123
|
const cursor = new Date(props.minDate);
|
5124
|
+
if (props.lazyRender && !props.show && props.poppable) {
|
5125
|
+
return months2;
|
5126
|
+
}
|
5084
5127
|
cursor.setDate(1);
|
5085
5128
|
do {
|
5086
5129
|
months2.push(new Date(cursor));
|
@@ -5099,6 +5142,7 @@
|
|
5099
5142
|
}
|
5100
5143
|
return !currentDate.value;
|
5101
5144
|
});
|
5145
|
+
const getSelectedDate = () => currentDate.value;
|
5102
5146
|
const onScroll = () => {
|
5103
5147
|
const top2 = getScrollTop(bodyRef.value);
|
5104
5148
|
const bottom2 = top2 + bodyHeight;
|
@@ -5341,7 +5385,8 @@
|
|
5341
5385
|
});
|
5342
5386
|
useExpose({
|
5343
5387
|
reset,
|
5344
|
-
scrollToDate
|
5388
|
+
scrollToDate,
|
5389
|
+
getSelectedDate
|
5345
5390
|
});
|
5346
5391
|
onMountedOrActivated(init);
|
5347
5392
|
return () => {
|
@@ -6307,6 +6352,16 @@
|
|
6307
6352
|
emit,
|
6308
6353
|
slots
|
6309
6354
|
}) {
|
6355
|
+
var _a, _b;
|
6356
|
+
if (process.env.NODE_ENV !== "production") {
|
6357
|
+
const props2 = (_b = (_a = vue.getCurrentInstance()) == null ? void 0 : _a.vnode) == null ? void 0 : _b.props;
|
6358
|
+
if (props2 && "onClick" in props2) {
|
6359
|
+
console.warn('[Vant] Tabs: "click" event is deprecated, using "click-tab" instead.');
|
6360
|
+
}
|
6361
|
+
if (props2 && "onDisabled" in props2) {
|
6362
|
+
console.warn('[Vant] Tabs: "disabled" event is deprecated, using "click-tab" instead.');
|
6363
|
+
}
|
6364
|
+
}
|
6310
6365
|
let tabHeight;
|
6311
6366
|
let lockScroll;
|
6312
6367
|
let stickyFixed;
|
@@ -6632,6 +6687,9 @@
|
|
6632
6687
|
index
|
6633
6688
|
} = useParent(SWIPE_KEY);
|
6634
6689
|
if (!parent) {
|
6690
|
+
if (process.env.NODE_ENV !== "production") {
|
6691
|
+
console.error("[Vant] <SwipeItem> must be a child component of <Swipe>.");
|
6692
|
+
}
|
6635
6693
|
return;
|
6636
6694
|
}
|
6637
6695
|
const style = vue.computed(() => {
|
@@ -6710,6 +6768,9 @@
|
|
6710
6768
|
index
|
6711
6769
|
} = useParent(TABS_KEY);
|
6712
6770
|
if (!parent) {
|
6771
|
+
if (process.env.NODE_ENV !== "production") {
|
6772
|
+
console.error("[Vant] <Tab> must be a child component of <Tabs>.");
|
6773
|
+
}
|
6713
6774
|
return;
|
6714
6775
|
}
|
6715
6776
|
const getName = () => {
|
@@ -7472,6 +7533,17 @@
|
|
7472
7533
|
default: ""
|
7473
7534
|
}
|
7474
7535
|
};
|
7536
|
+
function validateModelValue(modelValue, accordion) {
|
7537
|
+
if (accordion && Array.isArray(modelValue)) {
|
7538
|
+
console.error('[Vant] Collapse: "v-model" should not be Array in accordion mode');
|
7539
|
+
return false;
|
7540
|
+
}
|
7541
|
+
if (!accordion && !Array.isArray(modelValue)) {
|
7542
|
+
console.error('[Vant] Collapse: "v-model" should be Array in non-accordion mode');
|
7543
|
+
return false;
|
7544
|
+
}
|
7545
|
+
return true;
|
7546
|
+
}
|
7475
7547
|
var stdin_default$S = vue.defineComponent({
|
7476
7548
|
name: name$M,
|
7477
7549
|
props: collapseProps,
|
@@ -7481,7 +7553,8 @@
|
|
7481
7553
|
slots
|
7482
7554
|
}) {
|
7483
7555
|
const {
|
7484
|
-
linkChildren
|
7556
|
+
linkChildren,
|
7557
|
+
children
|
7485
7558
|
} = useChildren(COLLAPSE_KEY);
|
7486
7559
|
const updateName = (name2) => {
|
7487
7560
|
emit("change", name2);
|
@@ -7500,13 +7573,41 @@
|
|
7500
7573
|
updateName(modelValue.filter((activeName) => activeName !== name2));
|
7501
7574
|
}
|
7502
7575
|
};
|
7576
|
+
const toggleAll = (options = {}) => {
|
7577
|
+
if (props.accordion) {
|
7578
|
+
return;
|
7579
|
+
}
|
7580
|
+
if (typeof options === "boolean") {
|
7581
|
+
options = {
|
7582
|
+
expanded: options
|
7583
|
+
};
|
7584
|
+
}
|
7585
|
+
const {
|
7586
|
+
expanded,
|
7587
|
+
skipDisabled
|
7588
|
+
} = options;
|
7589
|
+
const expandedChildren = children.filter((item) => {
|
7590
|
+
if (item.disabled && skipDisabled) {
|
7591
|
+
return item.expanded.value;
|
7592
|
+
}
|
7593
|
+
return expanded != null ? expanded : !item.expanded.value;
|
7594
|
+
});
|
7595
|
+
const names = expandedChildren.map((item) => item.itemName.value);
|
7596
|
+
updateName(names);
|
7597
|
+
};
|
7503
7598
|
const isExpanded = (name2) => {
|
7504
7599
|
const {
|
7505
7600
|
accordion,
|
7506
7601
|
modelValue
|
7507
7602
|
} = props;
|
7603
|
+
if (process.env.NODE_ENV !== "production" && !validateModelValue(modelValue, accordion)) {
|
7604
|
+
return false;
|
7605
|
+
}
|
7508
7606
|
return accordion ? modelValue === name2 : modelValue.includes(name2);
|
7509
7607
|
};
|
7608
|
+
useExpose({
|
7609
|
+
toggleAll
|
7610
|
+
});
|
7510
7611
|
linkChildren({
|
7511
7612
|
toggle,
|
7512
7613
|
isExpanded
|
@@ -7544,6 +7645,9 @@
|
|
7544
7645
|
index
|
7545
7646
|
} = useParent(COLLAPSE_KEY);
|
7546
7647
|
if (!parent) {
|
7648
|
+
if (process.env.NODE_ENV !== "production") {
|
7649
|
+
console.error("[Vant] <CollapseItem> must be a child component of <Collapse>.");
|
7650
|
+
}
|
7547
7651
|
return;
|
7548
7652
|
}
|
7549
7653
|
const name2 = vue.computed(() => {
|
@@ -7632,7 +7736,9 @@
|
|
7632
7736
|
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)])]), [[vue.vShow, show.value]]);
|
7633
7737
|
});
|
7634
7738
|
useExpose({
|
7635
|
-
toggle
|
7739
|
+
toggle,
|
7740
|
+
expanded,
|
7741
|
+
itemName: name2
|
7636
7742
|
});
|
7637
7743
|
return () => vue.createVNode("div", {
|
7638
7744
|
"class": [bem$K({
|
@@ -9409,6 +9515,9 @@
|
|
9409
9515
|
index
|
9410
9516
|
} = useParent(DROPDOWN_KEY);
|
9411
9517
|
if (!parent) {
|
9518
|
+
if (process.env.NODE_ENV !== "production") {
|
9519
|
+
console.error("[Vant] <DropdownItem> must be a child component of <DropdownMenu>.");
|
9520
|
+
}
|
9412
9521
|
return;
|
9413
9522
|
}
|
9414
9523
|
const getEmitter = (name2) => () => emit(name2);
|
@@ -9609,6 +9718,9 @@
|
|
9609
9718
|
} = useParent(GRID_KEY);
|
9610
9719
|
const route2 = useRoute();
|
9611
9720
|
if (!parent) {
|
9721
|
+
if (process.env.NODE_ENV !== "production") {
|
9722
|
+
console.error("[Vant] <GridItem> must be a child component of <Grid>.");
|
9723
|
+
}
|
9612
9724
|
return;
|
9613
9725
|
}
|
9614
9726
|
const rootStyle = vue.computed(() => {
|
@@ -10403,6 +10515,9 @@
|
|
10403
10515
|
parent
|
10404
10516
|
} = useParent(INDEX_BAR_KEY);
|
10405
10517
|
if (!parent) {
|
10518
|
+
if (process.env.NODE_ENV !== "production") {
|
10519
|
+
console.error("[Vant] <IndexAnchor> must be a child component of <IndexBar>.");
|
10520
|
+
}
|
10406
10521
|
return;
|
10407
10522
|
}
|
10408
10523
|
const isSticky = () => state.active && parent.props.sticky;
|
@@ -10583,15 +10698,6 @@
|
|
10583
10698
|
}
|
10584
10699
|
});
|
10585
10700
|
const List = withInstall(stdin_default$v);
|
10586
|
-
function usePlaceholder(contentRef, bem2) {
|
10587
|
-
const height2 = useHeight(contentRef);
|
10588
|
-
return (renderContent) => vue.createVNode("div", {
|
10589
|
-
"class": bem2("placeholder"),
|
10590
|
-
"style": {
|
10591
|
-
height: height2.value ? `${height2.value}px` : void 0
|
10592
|
-
}
|
10593
|
-
}, [renderContent()]);
|
10594
|
-
}
|
10595
10701
|
const [name$p, bem$p] = createNamespace("nav-bar");
|
10596
10702
|
const navBarProps = {
|
10597
10703
|
title: String,
|
@@ -12384,22 +12490,23 @@
|
|
12384
12490
|
let popper;
|
12385
12491
|
const wrapperRef = vue.ref();
|
12386
12492
|
const popoverRef = vue.ref();
|
12493
|
+
const getPopoverOptions = () => ({
|
12494
|
+
placement: props.placement,
|
12495
|
+
modifiers: [{
|
12496
|
+
name: "computeStyles",
|
12497
|
+
options: {
|
12498
|
+
adaptive: false,
|
12499
|
+
gpuAcceleration: false
|
12500
|
+
}
|
12501
|
+
}, extend({}, offset_default, {
|
12502
|
+
options: {
|
12503
|
+
offset: props.offset
|
12504
|
+
}
|
12505
|
+
})]
|
12506
|
+
});
|
12387
12507
|
const createPopperInstance = () => {
|
12388
12508
|
if (wrapperRef.value && popoverRef.value) {
|
12389
|
-
return createPopper(wrapperRef.value, popoverRef.value.popupRef.value,
|
12390
|
-
placement: props.placement,
|
12391
|
-
modifiers: [{
|
12392
|
-
name: "computeStyles",
|
12393
|
-
options: {
|
12394
|
-
adaptive: false,
|
12395
|
-
gpuAcceleration: false
|
12396
|
-
}
|
12397
|
-
}, extend({}, offset_default, {
|
12398
|
-
options: {
|
12399
|
-
offset: props.offset
|
12400
|
-
}
|
12401
|
-
})]
|
12402
|
-
});
|
12509
|
+
return createPopper(wrapperRef.value, popoverRef.value.popupRef.value, getPopoverOptions());
|
12403
12510
|
}
|
12404
12511
|
return null;
|
12405
12512
|
};
|
@@ -12411,9 +12518,7 @@
|
|
12411
12518
|
if (!popper) {
|
12412
12519
|
popper = createPopperInstance();
|
12413
12520
|
} else {
|
12414
|
-
popper.setOptions(
|
12415
|
-
placement: props.placement
|
12416
|
-
});
|
12521
|
+
popper.setOptions(getPopoverOptions());
|
12417
12522
|
}
|
12418
12523
|
});
|
12419
12524
|
};
|
@@ -12484,7 +12589,7 @@
|
|
12484
12589
|
popper = null;
|
12485
12590
|
}
|
12486
12591
|
});
|
12487
|
-
vue.watch(() => [props.show, props.placement], updateLocation);
|
12592
|
+
vue.watch(() => [props.show, props.offset, props.placement], updateLocation);
|
12488
12593
|
useClickAway(wrapperRef, onClickAway, {
|
12489
12594
|
eventName: "touchstart"
|
12490
12595
|
});
|
@@ -12603,7 +12708,7 @@
|
|
12603
12708
|
var stdin_default$l = vue.defineComponent({
|
12604
12709
|
name: name$g,
|
12605
12710
|
props: pullRefreshProps,
|
12606
|
-
emits: ["refresh", "update:modelValue"],
|
12711
|
+
emits: ["change", "refresh", "update:modelValue"],
|
12607
12712
|
setup(props, {
|
12608
12713
|
emit,
|
12609
12714
|
slots
|
@@ -12648,6 +12753,10 @@
|
|
12648
12753
|
} else {
|
12649
12754
|
state.status = "loosing";
|
12650
12755
|
}
|
12756
|
+
emit("change", {
|
12757
|
+
status: state.status,
|
12758
|
+
distance
|
12759
|
+
});
|
12651
12760
|
};
|
12652
12761
|
const getStatusText = () => {
|
12653
12762
|
const {
|
@@ -13253,6 +13362,9 @@
|
|
13253
13362
|
index
|
13254
13363
|
} = useParent(SIDEBAR_KEY);
|
13255
13364
|
if (!parent) {
|
13365
|
+
if (process.env.NODE_ENV !== "production") {
|
13366
|
+
console.error("[Vant] <SidebarItem> must be a child component of <Sidebar>.");
|
13367
|
+
}
|
13256
13368
|
return;
|
13257
13369
|
}
|
13258
13370
|
const onClick = () => {
|
@@ -13680,6 +13792,9 @@
|
|
13680
13792
|
index
|
13681
13793
|
} = useParent(STEPS_KEY);
|
13682
13794
|
if (!parent) {
|
13795
|
+
if (process.env.NODE_ENV !== "production") {
|
13796
|
+
console.error("[Vant] <Step> must be a child component of <Steps>.");
|
13797
|
+
}
|
13683
13798
|
return;
|
13684
13799
|
}
|
13685
13800
|
const parentProps = parent.props;
|
@@ -14032,6 +14147,7 @@
|
|
14032
14147
|
buttonType: makeStringProp("danger"),
|
14033
14148
|
buttonColor: String,
|
14034
14149
|
suffixLabel: String,
|
14150
|
+
placeholder: Boolean,
|
14035
14151
|
decimalLength: makeNumericProp(2),
|
14036
14152
|
safeAreaInsetBottom: truthProp
|
14037
14153
|
};
|
@@ -14043,6 +14159,8 @@
|
|
14043
14159
|
emit,
|
14044
14160
|
slots
|
14045
14161
|
}) {
|
14162
|
+
const root = vue.ref();
|
14163
|
+
const renderPlaceholder = usePlaceholder(root, bem$5);
|
14046
14164
|
const renderText = () => {
|
14047
14165
|
const {
|
14048
14166
|
price,
|
@@ -14102,9 +14220,10 @@
|
|
14102
14220
|
"onClick": onClickButton
|
14103
14221
|
}, null);
|
14104
14222
|
};
|
14105
|
-
|
14223
|
+
const renderSubmitBar = () => {
|
14106
14224
|
var _a, _b;
|
14107
14225
|
return vue.createVNode("div", {
|
14226
|
+
"ref": root,
|
14108
14227
|
"class": [bem$5(), {
|
14109
14228
|
"van-safe-area-bottom": props.safeAreaInsetBottom
|
14110
14229
|
}]
|
@@ -14112,6 +14231,12 @@
|
|
14112
14231
|
"class": bem$5("bar")
|
14113
14232
|
}, [(_b = slots.default) == null ? void 0 : _b.call(slots), renderText(), renderButton()])]);
|
14114
14233
|
};
|
14234
|
+
return () => {
|
14235
|
+
if (props.placeholder) {
|
14236
|
+
return renderPlaceholder(renderSubmitBar);
|
14237
|
+
}
|
14238
|
+
return renderSubmitBar();
|
14239
|
+
};
|
14115
14240
|
}
|
14116
14241
|
});
|
14117
14242
|
const SubmitBar = withInstall(stdin_default$a);
|
@@ -14367,6 +14492,9 @@
|
|
14367
14492
|
index
|
14368
14493
|
} = useParent(TABBAR_KEY);
|
14369
14494
|
if (!parent) {
|
14495
|
+
if (process.env.NODE_ENV !== "production") {
|
14496
|
+
console.error("[Vant] <TabbarItem> must be a child component of <Tabbar>.");
|
14497
|
+
}
|
14370
14498
|
return;
|
14371
14499
|
}
|
14372
14500
|
const active = vue.computed(() => {
|
@@ -14860,7 +14988,7 @@
|
|
14860
14988
|
if (props.previewFullImage) {
|
14861
14989
|
const imageFiles = props.modelValue.filter(isImageFile);
|
14862
14990
|
const images = imageFiles.map((item2) => {
|
14863
|
-
if (item2.file && !item2.url) {
|
14991
|
+
if (item2.file && !item2.url && item2.status !== "failed") {
|
14864
14992
|
item2.url = URL.createObjectURL(item2.file);
|
14865
14993
|
urls.push(item2.url);
|
14866
14994
|
}
|
@@ -15188,10 +15316,15 @@
|
|
15188
15316
|
}, () => {
|
15189
15317
|
cb();
|
15190
15318
|
this.state.loading = false;
|
15319
|
+
if (process.env.NODE_ENV !== "production" && !this.options.silent)
|
15320
|
+
console.warn(`[@vant/lazyload] load failed with loading image(${this.loading})`);
|
15191
15321
|
});
|
15192
15322
|
}
|
15193
15323
|
load(onFinish = noop) {
|
15194
15324
|
if (this.attempt > this.options.attempt - 1 && this.state.error) {
|
15325
|
+
if (process.env.NODE_ENV !== "production" && !this.options.silent) {
|
15326
|
+
console.log(`[@vant/lazyload] ${this.src} tried too more than ${this.options.attempt} times`);
|
15327
|
+
}
|
15195
15328
|
onFinish();
|
15196
15329
|
return;
|
15197
15330
|
}
|
@@ -15578,6 +15711,9 @@
|
|
15578
15711
|
let src = value;
|
15579
15712
|
let { loading, error } = this.options;
|
15580
15713
|
if (isObject(value)) {
|
15714
|
+
if (process.env.NODE_ENV !== "production" && !value.src && !this.options.silent) {
|
15715
|
+
console.error("[@vant/lazyload] miss src with " + value);
|
15716
|
+
}
|
15581
15717
|
({ src } = value);
|
15582
15718
|
loading = value.loading || this.options.loading;
|
15583
15719
|
error = value.error || this.options.error;
|
@@ -15765,6 +15901,9 @@
|
|
15765
15901
|
},
|
15766
15902
|
load(onFinish = noop) {
|
15767
15903
|
if (this.state.attempt > this.options.attempt - 1 && this.state.error) {
|
15904
|
+
if (process.env.NODE_ENV !== "production" && !lazyManager.options.silent) {
|
15905
|
+
console.log(`[@vant/lazyload] ${this.options.src} tried too more than ${this.options.attempt} times`);
|
15906
|
+
}
|
15768
15907
|
onFinish();
|
15769
15908
|
return;
|
15770
15909
|
}
|
@@ -15804,7 +15943,7 @@
|
|
15804
15943
|
});
|
15805
15944
|
}
|
15806
15945
|
};
|
15807
|
-
const version = "3.5.
|
15946
|
+
const version = "3.5.3";
|
15808
15947
|
function install(app) {
|
15809
15948
|
const components = [
|
15810
15949
|
ActionBar,
|
@@ -15991,7 +16130,7 @@
|
|
15991
16130
|
exports2.Toast = Toast;
|
15992
16131
|
exports2.TreeSelect = TreeSelect;
|
15993
16132
|
exports2.Uploader = Uploader;
|
15994
|
-
exports2
|
16133
|
+
exports2.default = stdin_default;
|
15995
16134
|
exports2.install = install;
|
15996
16135
|
exports2.version = version;
|
15997
16136
|
Object.defineProperties(exports2, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|