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.
Files changed (194) hide show
  1. package/LICENSE +10 -0
  2. package/README.md +13 -13
  3. package/changelog.generated.md +67 -0
  4. package/es/action-bar/ActionBar.d.ts +4 -0
  5. package/es/action-bar/ActionBar.mjs +13 -2
  6. package/es/action-bar/index.d.ts +3 -0
  7. package/es/button/index.less +1 -1
  8. package/es/calendar/Calendar.mjs +6 -1
  9. package/es/calendar/types.d.ts +1 -0
  10. package/es/cell/Cell.d.ts +1 -1
  11. package/es/cell/index.d.ts +1 -1
  12. package/es/collapse/Collapse.d.ts +8 -1
  13. package/es/collapse/Collapse.mjs +28 -1
  14. package/es/collapse/index.d.ts +1 -1
  15. package/es/collapse-item/CollapseItem.d.ts +1 -1
  16. package/es/collapse-item/CollapseItem.mjs +3 -1
  17. package/es/collapse-item/index.d.ts +1 -1
  18. package/es/collapse-item/index.less +1 -1
  19. package/es/composables/use-height.d.ts +1 -1
  20. package/es/composables/use-height.mjs +6 -2
  21. package/es/composables/use-placeholder.mjs +1 -1
  22. package/es/dialog/Dialog.d.ts +1 -1
  23. package/es/field/Field.d.ts +4 -2
  24. package/es/field/Field.mjs +7 -1
  25. package/es/field/index.d.ts +4 -2
  26. package/es/field/index.less +1 -1
  27. package/es/grid-item/index.less +1 -1
  28. package/es/index.d.ts +1 -1
  29. package/es/index.mjs +1 -1
  30. package/es/locale/index.d.ts +1 -1
  31. package/es/popover/Popover.mjs +17 -18
  32. package/es/popup/Popup.mjs +1 -1
  33. package/es/pull-refresh/PullRefresh.d.ts +2 -1
  34. package/es/pull-refresh/PullRefresh.mjs +5 -1
  35. package/es/pull-refresh/index.d.ts +2 -1
  36. package/es/sidebar-item/index.less +1 -1
  37. package/es/submit-bar/SubmitBar.d.ts +4 -0
  38. package/es/submit-bar/SubmitBar.mjs +13 -2
  39. package/es/submit-bar/index.d.ts +3 -0
  40. package/es/swipe/index.less +1 -1
  41. package/es/switch/index.less +1 -1
  42. package/es/toast/function-call.d.ts +5 -6
  43. package/es/toast/index.less +1 -1
  44. package/es/toast/types.d.ts +10 -1
  45. package/es/uploader/Uploader.d.ts +3 -3
  46. package/es/uploader/Uploader.mjs +1 -1
  47. package/es/uploader/index.d.ts +2 -2
  48. package/es/utils/basic.d.ts +3 -3
  49. package/es/utils/create.d.ts +1 -1
  50. package/lib/.DS_Store +0 -0
  51. package/lib/action-bar/.DS_Store +0 -0
  52. package/lib/action-bar/ActionBar.d.ts +4 -0
  53. package/lib/action-bar/ActionBar.js +12 -1
  54. package/lib/action-bar/index.d.ts +3 -0
  55. package/lib/action-bar-button/.DS_Store +0 -0
  56. package/lib/action-bar-icon/.DS_Store +0 -0
  57. package/lib/action-sheet/.DS_Store +0 -0
  58. package/lib/address-edit/.DS_Store +0 -0
  59. package/lib/address-list/.DS_Store +0 -0
  60. package/lib/area/.DS_Store +0 -0
  61. package/lib/badge/.DS_Store +0 -0
  62. package/lib/button/.DS_Store +0 -0
  63. package/lib/button/index.less +1 -1
  64. package/lib/calendar/.DS_Store +0 -0
  65. package/lib/calendar/Calendar.js +6 -1
  66. package/lib/calendar/types.d.ts +1 -0
  67. package/lib/card/.DS_Store +0 -0
  68. package/lib/cascader/.DS_Store +0 -0
  69. package/lib/cell/.DS_Store +0 -0
  70. package/lib/cell/Cell.d.ts +1 -1
  71. package/lib/cell/index.d.ts +1 -1
  72. package/lib/cell-group/.DS_Store +0 -0
  73. package/lib/checkbox/.DS_Store +0 -0
  74. package/lib/checkbox-group/.DS_Store +0 -0
  75. package/lib/circle/.DS_Store +0 -0
  76. package/lib/col/.DS_Store +0 -0
  77. package/lib/collapse/.DS_Store +0 -0
  78. package/lib/collapse/Collapse.d.ts +8 -1
  79. package/lib/collapse/Collapse.js +28 -1
  80. package/lib/collapse/index.d.ts +1 -1
  81. package/lib/collapse-item/.DS_Store +0 -0
  82. package/lib/collapse-item/CollapseItem.d.ts +1 -1
  83. package/lib/collapse-item/CollapseItem.js +3 -1
  84. package/lib/collapse-item/index.d.ts +1 -1
  85. package/lib/collapse-item/index.less +1 -1
  86. package/lib/composables/use-height.d.ts +1 -1
  87. package/lib/composables/use-height.js +6 -2
  88. package/lib/composables/use-placeholder.js +1 -1
  89. package/lib/config-provider/.DS_Store +0 -0
  90. package/lib/contact-card/.DS_Store +0 -0
  91. package/lib/contact-edit/.DS_Store +0 -0
  92. package/lib/contact-list/.DS_Store +0 -0
  93. package/lib/count-down/.DS_Store +0 -0
  94. package/lib/coupon/.DS_Store +0 -0
  95. package/lib/coupon-cell/.DS_Store +0 -0
  96. package/lib/coupon-list/.DS_Store +0 -0
  97. package/lib/datetime-picker/.DS_Store +0 -0
  98. package/lib/dialog/.DS_Store +0 -0
  99. package/lib/dialog/Dialog.d.ts +1 -1
  100. package/lib/divider/.DS_Store +0 -0
  101. package/lib/dropdown-item/.DS_Store +0 -0
  102. package/lib/dropdown-menu/.DS_Store +0 -0
  103. package/lib/empty/.DS_Store +0 -0
  104. package/lib/field/.DS_Store +0 -0
  105. package/lib/field/Field.d.ts +4 -2
  106. package/lib/field/Field.js +7 -1
  107. package/lib/field/index.d.ts +4 -2
  108. package/lib/field/index.less +1 -1
  109. package/lib/form/.DS_Store +0 -0
  110. package/lib/grid/.DS_Store +0 -0
  111. package/lib/grid-item/.DS_Store +0 -0
  112. package/lib/grid-item/index.less +1 -1
  113. package/lib/icon/.DS_Store +0 -0
  114. package/lib/image/.DS_Store +0 -0
  115. package/lib/image-preview/.DS_Store +0 -0
  116. package/lib/index-anchor/.DS_Store +0 -0
  117. package/lib/index-bar/.DS_Store +0 -0
  118. package/lib/index.d.ts +1 -1
  119. package/lib/index.js +1 -1
  120. package/lib/lazyload/.DS_Store +0 -0
  121. package/lib/list/.DS_Store +0 -0
  122. package/lib/loading/.DS_Store +0 -0
  123. package/lib/locale/.DS_Store +0 -0
  124. package/lib/locale/index.d.ts +1 -1
  125. package/lib/nav-bar/.DS_Store +0 -0
  126. package/lib/notice-bar/.DS_Store +0 -0
  127. package/lib/notify/.DS_Store +0 -0
  128. package/lib/number-keyboard/.DS_Store +0 -0
  129. package/lib/overlay/.DS_Store +0 -0
  130. package/lib/pagination/.DS_Store +0 -0
  131. package/lib/password-input/.DS_Store +0 -0
  132. package/lib/picker/.DS_Store +0 -0
  133. package/lib/popover/.DS_Store +0 -0
  134. package/lib/popover/Popover.js +17 -18
  135. package/lib/popup/.DS_Store +0 -0
  136. package/lib/popup/Popup.js +1 -1
  137. package/lib/progress/.DS_Store +0 -0
  138. package/lib/pull-refresh/.DS_Store +0 -0
  139. package/lib/pull-refresh/PullRefresh.d.ts +2 -1
  140. package/lib/pull-refresh/PullRefresh.js +5 -1
  141. package/lib/pull-refresh/index.d.ts +2 -1
  142. package/lib/radio/.DS_Store +0 -0
  143. package/lib/radio-group/.DS_Store +0 -0
  144. package/lib/rate/.DS_Store +0 -0
  145. package/lib/row/.DS_Store +0 -0
  146. package/lib/search/.DS_Store +0 -0
  147. package/lib/share-sheet/.DS_Store +0 -0
  148. package/lib/sidebar/.DS_Store +0 -0
  149. package/lib/sidebar-item/.DS_Store +0 -0
  150. package/lib/sidebar-item/index.less +1 -1
  151. package/lib/skeleton/.DS_Store +0 -0
  152. package/lib/slider/.DS_Store +0 -0
  153. package/lib/step/.DS_Store +0 -0
  154. package/lib/stepper/.DS_Store +0 -0
  155. package/lib/steps/.DS_Store +0 -0
  156. package/lib/sticky/.DS_Store +0 -0
  157. package/lib/submit-bar/.DS_Store +0 -0
  158. package/lib/submit-bar/SubmitBar.d.ts +4 -0
  159. package/lib/submit-bar/SubmitBar.js +12 -1
  160. package/lib/submit-bar/index.d.ts +3 -0
  161. package/lib/swipe/.DS_Store +0 -0
  162. package/lib/swipe/index.less +1 -1
  163. package/lib/swipe-cell/.DS_Store +0 -0
  164. package/lib/swipe-item/.DS_Store +0 -0
  165. package/lib/switch/.DS_Store +0 -0
  166. package/lib/switch/index.less +1 -1
  167. package/lib/tab/.DS_Store +0 -0
  168. package/lib/tabbar/.DS_Store +0 -0
  169. package/lib/tabbar-item/.DS_Store +0 -0
  170. package/lib/tabs/.DS_Store +0 -0
  171. package/lib/tag/.DS_Store +0 -0
  172. package/lib/toast/.DS_Store +0 -0
  173. package/lib/toast/function-call.d.ts +5 -6
  174. package/lib/toast/index.less +1 -1
  175. package/lib/toast/types.d.ts +10 -1
  176. package/lib/tree-select/.DS_Store +0 -0
  177. package/lib/uploader/.DS_Store +0 -0
  178. package/lib/uploader/Uploader.d.ts +3 -3
  179. package/lib/uploader/Uploader.js +1 -1
  180. package/lib/uploader/index.d.ts +2 -2
  181. package/lib/utils/basic.d.ts +3 -3
  182. package/lib/utils/create.d.ts +1 -1
  183. package/lib/vant.cjs.js +191 -52
  184. package/lib/vant.es.js +280 -51
  185. package/lib/vant.js +189 -50
  186. package/lib/vant.min.js +1 -1
  187. package/{vetur → lib}/web-types.json +1652 -1609
  188. package/package.json +9 -14
  189. package/lib/ssr.js +0 -7
  190. package/lib/ssr.mjs +0 -1
  191. package/lib/vant.cjs.min.js +0 -1
  192. package/lib/vant.es.min.js +0 -14660
  193. package/vetur/attributes.json +0 -3474
  194. package/vetur/tags.json +0 -1202
package/lib/vant.cjs.js CHANGED
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- var use = require("@vant/use");
4
- var vue = require("vue");
5
- var popperjs = require("@vant/popperjs");
3
+ const use = require("@vant/use");
4
+ const vue = require("vue");
5
+ const popperjs = require("@vant/popperjs");
6
6
  function noop() {
7
7
  }
8
8
  const extend = Object.assign;
@@ -395,9 +395,34 @@ function withInstall(options) {
395
395
  };
396
396
  return options;
397
397
  }
398
+ const useHeight = (element, withSafeArea) => {
399
+ const height = vue.ref();
400
+ const setHeight = () => {
401
+ height.value = use.useRect(element).height;
402
+ };
403
+ vue.onMounted(() => {
404
+ vue.nextTick(setHeight);
405
+ if (withSafeArea) {
406
+ for (let i = 1; i <= 3; i++) {
407
+ setTimeout(setHeight, 100 * i);
408
+ }
409
+ }
410
+ });
411
+ return height;
412
+ };
413
+ function usePlaceholder(contentRef, bem2) {
414
+ const height = useHeight(contentRef, true);
415
+ return (renderContent) => vue.createVNode("div", {
416
+ "class": bem2("placeholder"),
417
+ "style": {
418
+ height: height.value ? `${height.value}px` : void 0
419
+ }
420
+ }, [renderContent()]);
421
+ }
398
422
  const [name$1u, bem$1q] = createNamespace("action-bar");
399
423
  const ACTION_BAR_KEY = Symbol(name$1u);
400
424
  const actionBarProps = {
425
+ placeholder: Boolean,
401
426
  safeAreaInsetBottom: truthProp
402
427
  };
403
428
  var stdin_default$1B = vue.defineComponent({
@@ -406,18 +431,27 @@ var stdin_default$1B = vue.defineComponent({
406
431
  setup(props, {
407
432
  slots
408
433
  }) {
434
+ const root = vue.ref();
435
+ const renderPlaceholder = usePlaceholder(root, bem$1q);
409
436
  const {
410
437
  linkChildren
411
438
  } = use.useChildren(ACTION_BAR_KEY);
412
439
  linkChildren();
413
- return () => {
440
+ const renderActionBar = () => {
414
441
  var _a;
415
442
  return vue.createVNode("div", {
443
+ "ref": root,
416
444
  "class": [bem$1q(), {
417
445
  "van-safe-area-bottom": props.safeAreaInsetBottom
418
446
  }]
419
447
  }, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
420
448
  };
449
+ return () => {
450
+ if (props.placeholder) {
451
+ return renderPlaceholder(renderActionBar);
452
+ }
453
+ return renderActionBar();
454
+ };
421
455
  }
422
456
  });
423
457
  const ActionBar = withInstall(stdin_default$1B);
@@ -1301,7 +1335,7 @@ var stdin_default$1s = vue.defineComponent({
1301
1335
  }
1302
1336
  });
1303
1337
  vue.onDeactivated(() => {
1304
- if (props.show) {
1338
+ if (props.show && props.teleport) {
1305
1339
  close();
1306
1340
  shouldReopen = true;
1307
1341
  }
@@ -1715,6 +1749,14 @@ var stdin_default$1p = vue.defineComponent({
1715
1749
  emit,
1716
1750
  slots
1717
1751
  }) {
1752
+ if (process.env.NODE_ENV !== "production") {
1753
+ if (slots.default) {
1754
+ console.warn('[Vant] Picker: "default" slot is deprecated, please use "toolbar" slot instead.');
1755
+ }
1756
+ if (props.valueKey) {
1757
+ console.warn('[Vant] Picker: "valueKey" prop is deprecated, please use "columnsFieldNames" prop instead.');
1758
+ }
1759
+ }
1718
1760
  const hasOptions = vue.ref(false);
1719
1761
  const formattedColumns = vue.ref([]);
1720
1762
  const columnsFieldNames = vue.computed(() => {
@@ -2565,6 +2607,9 @@ let current = 0;
2565
2607
  function useId$1() {
2566
2608
  const vm = vue.getCurrentInstance();
2567
2609
  const { name: name2 = "unknown" } = (vm == null ? void 0 : vm.type) || {};
2610
+ if (process.env.NODE_ENV === "test") {
2611
+ return name2;
2612
+ }
2568
2613
  return `${name2}-${++current}`;
2569
2614
  }
2570
2615
  const [name$1e, bem$1a] = createNamespace("field");
@@ -2617,7 +2662,7 @@ const fieldProps = extend({}, cellSharedProps, fieldSharedProps, {
2617
2662
  var stdin_default$1l = vue.defineComponent({
2618
2663
  name: name$1e,
2619
2664
  props: fieldProps,
2620
- emits: ["blur", "focus", "clear", "keypress", "click-input", "click-left-icon", "click-right-icon", "update:modelValue"],
2665
+ emits: ["blur", "focus", "clear", "keypress", "click-input", "end-validate", "start-validate", "click-left-icon", "click-right-icon", "update:modelValue"],
2621
2666
  setup(props, {
2622
2667
  emit,
2623
2668
  slots
@@ -2691,18 +2736,24 @@ var stdin_default$1l = vue.defineComponent({
2691
2736
  state.status = "unvalidated";
2692
2737
  state.validateMessage = "";
2693
2738
  };
2739
+ const endValidate = () => emit("end-validate", {
2740
+ status: state.status
2741
+ });
2694
2742
  const validate = (rules = props.rules) => new Promise((resolve) => {
2695
2743
  resetValidation();
2696
2744
  if (rules) {
2745
+ emit("start-validate");
2697
2746
  runRules(rules).then(() => {
2698
2747
  if (state.status === "failed") {
2699
2748
  resolve({
2700
2749
  name: props.name,
2701
2750
  message: state.validateMessage
2702
2751
  });
2752
+ endValidate();
2703
2753
  } else {
2704
2754
  state.status = "passed";
2705
2755
  resolve();
2756
+ endValidate();
2706
2757
  }
2707
2758
  });
2708
2759
  } else {
@@ -4247,17 +4298,6 @@ const proxyPickerMethods = (picker, callback) => {
4247
4298
  }
4248
4299
  });
4249
4300
  };
4250
- const useHeight = (element) => {
4251
- const height = vue.ref();
4252
- const setHeight = () => {
4253
- height.value = use.useRect(element).height;
4254
- };
4255
- vue.onMounted(() => {
4256
- vue.nextTick(setHeight);
4257
- setTimeout(setHeight, 100);
4258
- });
4259
- return height;
4260
- };
4261
4301
  const [name$13] = createNamespace("calendar-day");
4262
4302
  var stdin_default$1a = vue.defineComponent({
4263
4303
  name: name$13,
@@ -4729,6 +4769,9 @@ var stdin_default$17 = vue.defineComponent({
4729
4769
  const months = vue.computed(() => {
4730
4770
  const months2 = [];
4731
4771
  const cursor = new Date(props.minDate);
4772
+ if (props.lazyRender && !props.show && props.poppable) {
4773
+ return months2;
4774
+ }
4732
4775
  cursor.setDate(1);
4733
4776
  do {
4734
4777
  months2.push(new Date(cursor));
@@ -4747,6 +4790,7 @@ var stdin_default$17 = vue.defineComponent({
4747
4790
  }
4748
4791
  return !currentDate.value;
4749
4792
  });
4793
+ const getSelectedDate = () => currentDate.value;
4750
4794
  const onScroll = () => {
4751
4795
  const top = getScrollTop(bodyRef.value);
4752
4796
  const bottom = top + bodyHeight;
@@ -4989,7 +5033,8 @@ var stdin_default$17 = vue.defineComponent({
4989
5033
  });
4990
5034
  useExpose({
4991
5035
  reset,
4992
- scrollToDate
5036
+ scrollToDate,
5037
+ getSelectedDate
4993
5038
  });
4994
5039
  use.onMountedOrActivated(init);
4995
5040
  return () => {
@@ -5955,6 +6000,16 @@ var stdin_default$10 = vue.defineComponent({
5955
6000
  emit,
5956
6001
  slots
5957
6002
  }) {
6003
+ var _a, _b;
6004
+ if (process.env.NODE_ENV !== "production") {
6005
+ const props2 = (_b = (_a = vue.getCurrentInstance()) == null ? void 0 : _a.vnode) == null ? void 0 : _b.props;
6006
+ if (props2 && "onClick" in props2) {
6007
+ console.warn('[Vant] Tabs: "click" event is deprecated, using "click-tab" instead.');
6008
+ }
6009
+ if (props2 && "onDisabled" in props2) {
6010
+ console.warn('[Vant] Tabs: "disabled" event is deprecated, using "click-tab" instead.');
6011
+ }
6012
+ }
5958
6013
  let tabHeight;
5959
6014
  let lockScroll;
5960
6015
  let stickyFixed;
@@ -6280,6 +6335,9 @@ var stdin_default$$ = vue.defineComponent({
6280
6335
  index
6281
6336
  } = use.useParent(SWIPE_KEY);
6282
6337
  if (!parent) {
6338
+ if (process.env.NODE_ENV !== "production") {
6339
+ console.error("[Vant] <SwipeItem> must be a child component of <Swipe>.");
6340
+ }
6283
6341
  return;
6284
6342
  }
6285
6343
  const style = vue.computed(() => {
@@ -6358,6 +6416,9 @@ var stdin_default$_ = vue.defineComponent({
6358
6416
  index
6359
6417
  } = use.useParent(TABS_KEY);
6360
6418
  if (!parent) {
6419
+ if (process.env.NODE_ENV !== "production") {
6420
+ console.error("[Vant] <Tab> must be a child component of <Tabs>.");
6421
+ }
6361
6422
  return;
6362
6423
  }
6363
6424
  const getName = () => {
@@ -7120,6 +7181,17 @@ const collapseProps = {
7120
7181
  default: ""
7121
7182
  }
7122
7183
  };
7184
+ function validateModelValue(modelValue, accordion) {
7185
+ if (accordion && Array.isArray(modelValue)) {
7186
+ console.error('[Vant] Collapse: "v-model" should not be Array in accordion mode');
7187
+ return false;
7188
+ }
7189
+ if (!accordion && !Array.isArray(modelValue)) {
7190
+ console.error('[Vant] Collapse: "v-model" should be Array in non-accordion mode');
7191
+ return false;
7192
+ }
7193
+ return true;
7194
+ }
7123
7195
  var stdin_default$S = vue.defineComponent({
7124
7196
  name: name$M,
7125
7197
  props: collapseProps,
@@ -7129,7 +7201,8 @@ var stdin_default$S = vue.defineComponent({
7129
7201
  slots
7130
7202
  }) {
7131
7203
  const {
7132
- linkChildren
7204
+ linkChildren,
7205
+ children
7133
7206
  } = use.useChildren(COLLAPSE_KEY);
7134
7207
  const updateName = (name2) => {
7135
7208
  emit("change", name2);
@@ -7148,13 +7221,41 @@ var stdin_default$S = vue.defineComponent({
7148
7221
  updateName(modelValue.filter((activeName) => activeName !== name2));
7149
7222
  }
7150
7223
  };
7224
+ const toggleAll = (options = {}) => {
7225
+ if (props.accordion) {
7226
+ return;
7227
+ }
7228
+ if (typeof options === "boolean") {
7229
+ options = {
7230
+ expanded: options
7231
+ };
7232
+ }
7233
+ const {
7234
+ expanded,
7235
+ skipDisabled
7236
+ } = options;
7237
+ const expandedChildren = children.filter((item) => {
7238
+ if (item.disabled && skipDisabled) {
7239
+ return item.expanded.value;
7240
+ }
7241
+ return expanded != null ? expanded : !item.expanded.value;
7242
+ });
7243
+ const names = expandedChildren.map((item) => item.itemName.value);
7244
+ updateName(names);
7245
+ };
7151
7246
  const isExpanded = (name2) => {
7152
7247
  const {
7153
7248
  accordion,
7154
7249
  modelValue
7155
7250
  } = props;
7251
+ if (process.env.NODE_ENV !== "production" && !validateModelValue(modelValue, accordion)) {
7252
+ return false;
7253
+ }
7156
7254
  return accordion ? modelValue === name2 : modelValue.includes(name2);
7157
7255
  };
7256
+ useExpose({
7257
+ toggleAll
7258
+ });
7158
7259
  linkChildren({
7159
7260
  toggle,
7160
7261
  isExpanded
@@ -7192,6 +7293,9 @@ var stdin_default$R = vue.defineComponent({
7192
7293
  index
7193
7294
  } = use.useParent(COLLAPSE_KEY);
7194
7295
  if (!parent) {
7296
+ if (process.env.NODE_ENV !== "production") {
7297
+ console.error("[Vant] <CollapseItem> must be a child component of <Collapse>.");
7298
+ }
7195
7299
  return;
7196
7300
  }
7197
7301
  const name2 = vue.computed(() => {
@@ -7280,7 +7384,9 @@ var stdin_default$R = vue.defineComponent({
7280
7384
  }, [(_a = slots.default) == null ? void 0 : _a.call(slots)])]), [[vue.vShow, show.value]]);
7281
7385
  });
7282
7386
  useExpose({
7283
- toggle
7387
+ toggle,
7388
+ expanded,
7389
+ itemName: name2
7284
7390
  });
7285
7391
  return () => vue.createVNode("div", {
7286
7392
  "class": [bem$K({
@@ -9057,6 +9163,9 @@ var stdin_default$C = vue.defineComponent({
9057
9163
  index
9058
9164
  } = use.useParent(DROPDOWN_KEY);
9059
9165
  if (!parent) {
9166
+ if (process.env.NODE_ENV !== "production") {
9167
+ console.error("[Vant] <DropdownItem> must be a child component of <DropdownMenu>.");
9168
+ }
9060
9169
  return;
9061
9170
  }
9062
9171
  const getEmitter = (name2) => () => emit(name2);
@@ -9257,6 +9366,9 @@ var stdin_default$A = vue.defineComponent({
9257
9366
  } = use.useParent(GRID_KEY);
9258
9367
  const route2 = useRoute();
9259
9368
  if (!parent) {
9369
+ if (process.env.NODE_ENV !== "production") {
9370
+ console.error("[Vant] <GridItem> must be a child component of <Grid>.");
9371
+ }
9260
9372
  return;
9261
9373
  }
9262
9374
  const rootStyle = vue.computed(() => {
@@ -10051,6 +10163,9 @@ var stdin_default$w = vue.defineComponent({
10051
10163
  parent
10052
10164
  } = use.useParent(INDEX_BAR_KEY);
10053
10165
  if (!parent) {
10166
+ if (process.env.NODE_ENV !== "production") {
10167
+ console.error("[Vant] <IndexAnchor> must be a child component of <IndexBar>.");
10168
+ }
10054
10169
  return;
10055
10170
  }
10056
10171
  const isSticky = () => state.active && parent.props.sticky;
@@ -10231,15 +10346,6 @@ var stdin_default$v = vue.defineComponent({
10231
10346
  }
10232
10347
  });
10233
10348
  const List = withInstall(stdin_default$v);
10234
- function usePlaceholder(contentRef, bem2) {
10235
- const height = useHeight(contentRef);
10236
- return (renderContent) => vue.createVNode("div", {
10237
- "class": bem2("placeholder"),
10238
- "style": {
10239
- height: height.value ? `${height.value}px` : void 0
10240
- }
10241
- }, [renderContent()]);
10242
- }
10243
10349
  const [name$p, bem$p] = createNamespace("nav-bar");
10244
10350
  const navBarProps = {
10245
10351
  title: String,
@@ -11138,22 +11244,23 @@ var stdin_default$n = vue.defineComponent({
11138
11244
  let popper;
11139
11245
  const wrapperRef = vue.ref();
11140
11246
  const popoverRef = vue.ref();
11247
+ const getPopoverOptions = () => ({
11248
+ placement: props.placement,
11249
+ modifiers: [{
11250
+ name: "computeStyles",
11251
+ options: {
11252
+ adaptive: false,
11253
+ gpuAcceleration: false
11254
+ }
11255
+ }, extend({}, popperjs.offsetModifier, {
11256
+ options: {
11257
+ offset: props.offset
11258
+ }
11259
+ })]
11260
+ });
11141
11261
  const createPopperInstance = () => {
11142
11262
  if (wrapperRef.value && popoverRef.value) {
11143
- return popperjs.createPopper(wrapperRef.value, popoverRef.value.popupRef.value, {
11144
- placement: props.placement,
11145
- modifiers: [{
11146
- name: "computeStyles",
11147
- options: {
11148
- adaptive: false,
11149
- gpuAcceleration: false
11150
- }
11151
- }, extend({}, popperjs.offsetModifier, {
11152
- options: {
11153
- offset: props.offset
11154
- }
11155
- })]
11156
- });
11263
+ return popperjs.createPopper(wrapperRef.value, popoverRef.value.popupRef.value, getPopoverOptions());
11157
11264
  }
11158
11265
  return null;
11159
11266
  };
@@ -11165,9 +11272,7 @@ var stdin_default$n = vue.defineComponent({
11165
11272
  if (!popper) {
11166
11273
  popper = createPopperInstance();
11167
11274
  } else {
11168
- popper.setOptions({
11169
- placement: props.placement
11170
- });
11275
+ popper.setOptions(getPopoverOptions());
11171
11276
  }
11172
11277
  });
11173
11278
  };
@@ -11238,7 +11343,7 @@ var stdin_default$n = vue.defineComponent({
11238
11343
  popper = null;
11239
11344
  }
11240
11345
  });
11241
- vue.watch(() => [props.show, props.placement], updateLocation);
11346
+ vue.watch(() => [props.show, props.offset, props.placement], updateLocation);
11242
11347
  use.useClickAway(wrapperRef, onClickAway, {
11243
11348
  eventName: "touchstart"
11244
11349
  });
@@ -11357,7 +11462,7 @@ const pullRefreshProps = {
11357
11462
  var stdin_default$l = vue.defineComponent({
11358
11463
  name: name$g,
11359
11464
  props: pullRefreshProps,
11360
- emits: ["refresh", "update:modelValue"],
11465
+ emits: ["change", "refresh", "update:modelValue"],
11361
11466
  setup(props, {
11362
11467
  emit,
11363
11468
  slots
@@ -11402,6 +11507,10 @@ var stdin_default$l = vue.defineComponent({
11402
11507
  } else {
11403
11508
  state.status = "loosing";
11404
11509
  }
11510
+ emit("change", {
11511
+ status: state.status,
11512
+ distance
11513
+ });
11405
11514
  };
11406
11515
  const getStatusText = () => {
11407
11516
  const {
@@ -12007,6 +12116,9 @@ var stdin_default$g = vue.defineComponent({
12007
12116
  index
12008
12117
  } = use.useParent(SIDEBAR_KEY);
12009
12118
  if (!parent) {
12119
+ if (process.env.NODE_ENV !== "production") {
12120
+ console.error("[Vant] <SidebarItem> must be a child component of <Sidebar>.");
12121
+ }
12010
12122
  return;
12011
12123
  }
12012
12124
  const onClick = () => {
@@ -12434,6 +12546,9 @@ var stdin_default$c = vue.defineComponent({
12434
12546
  index
12435
12547
  } = use.useParent(STEPS_KEY);
12436
12548
  if (!parent) {
12549
+ if (process.env.NODE_ENV !== "production") {
12550
+ console.error("[Vant] <Step> must be a child component of <Steps>.");
12551
+ }
12437
12552
  return;
12438
12553
  }
12439
12554
  const parentProps = parent.props;
@@ -12786,6 +12901,7 @@ const submitBarProps = {
12786
12901
  buttonType: makeStringProp("danger"),
12787
12902
  buttonColor: String,
12788
12903
  suffixLabel: String,
12904
+ placeholder: Boolean,
12789
12905
  decimalLength: makeNumericProp(2),
12790
12906
  safeAreaInsetBottom: truthProp
12791
12907
  };
@@ -12797,6 +12913,8 @@ var stdin_default$a = vue.defineComponent({
12797
12913
  emit,
12798
12914
  slots
12799
12915
  }) {
12916
+ const root = vue.ref();
12917
+ const renderPlaceholder = usePlaceholder(root, bem$5);
12800
12918
  const renderText = () => {
12801
12919
  const {
12802
12920
  price,
@@ -12856,9 +12974,10 @@ var stdin_default$a = vue.defineComponent({
12856
12974
  "onClick": onClickButton
12857
12975
  }, null);
12858
12976
  };
12859
- return () => {
12977
+ const renderSubmitBar = () => {
12860
12978
  var _a, _b;
12861
12979
  return vue.createVNode("div", {
12980
+ "ref": root,
12862
12981
  "class": [bem$5(), {
12863
12982
  "van-safe-area-bottom": props.safeAreaInsetBottom
12864
12983
  }]
@@ -12866,6 +12985,12 @@ var stdin_default$a = vue.defineComponent({
12866
12985
  "class": bem$5("bar")
12867
12986
  }, [(_b = slots.default) == null ? void 0 : _b.call(slots), renderText(), renderButton()])]);
12868
12987
  };
12988
+ return () => {
12989
+ if (props.placeholder) {
12990
+ return renderPlaceholder(renderSubmitBar);
12991
+ }
12992
+ return renderSubmitBar();
12993
+ };
12869
12994
  }
12870
12995
  });
12871
12996
  const SubmitBar = withInstall(stdin_default$a);
@@ -13121,6 +13246,9 @@ var stdin_default$7 = vue.defineComponent({
13121
13246
  index
13122
13247
  } = use.useParent(TABBAR_KEY);
13123
13248
  if (!parent) {
13249
+ if (process.env.NODE_ENV !== "production") {
13250
+ console.error("[Vant] <TabbarItem> must be a child component of <Tabbar>.");
13251
+ }
13124
13252
  return;
13125
13253
  }
13126
13254
  const active = vue.computed(() => {
@@ -13614,7 +13742,7 @@ var stdin_default$4 = vue.defineComponent({
13614
13742
  if (props.previewFullImage) {
13615
13743
  const imageFiles = props.modelValue.filter(isImageFile);
13616
13744
  const images = imageFiles.map((item2) => {
13617
- if (item2.file && !item2.url) {
13745
+ if (item2.file && !item2.url && item2.status !== "failed") {
13618
13746
  item2.url = URL.createObjectURL(item2.file);
13619
13747
  urls.push(item2.url);
13620
13748
  }
@@ -13942,10 +14070,15 @@ class ReactiveListener {
13942
14070
  }, () => {
13943
14071
  cb();
13944
14072
  this.state.loading = false;
14073
+ if (process.env.NODE_ENV !== "production" && !this.options.silent)
14074
+ console.warn(`[@vant/lazyload] load failed with loading image(${this.loading})`);
13945
14075
  });
13946
14076
  }
13947
14077
  load(onFinish = noop) {
13948
14078
  if (this.attempt > this.options.attempt - 1 && this.state.error) {
14079
+ if (process.env.NODE_ENV !== "production" && !this.options.silent) {
14080
+ console.log(`[@vant/lazyload] ${this.src} tried too more than ${this.options.attempt} times`);
14081
+ }
13949
14082
  onFinish();
13950
14083
  return;
13951
14084
  }
@@ -14332,6 +14465,9 @@ function stdin_default$3() {
14332
14465
  let src = value;
14333
14466
  let { loading, error } = this.options;
14334
14467
  if (isObject(value)) {
14468
+ if (process.env.NODE_ENV !== "production" && !value.src && !this.options.silent) {
14469
+ console.error("[@vant/lazyload] miss src with " + value);
14470
+ }
14335
14471
  ({ src } = value);
14336
14472
  loading = value.loading || this.options.loading;
14337
14473
  error = value.error || this.options.error;
@@ -14519,6 +14655,9 @@ var stdin_default$1 = (lazyManager) => ({
14519
14655
  },
14520
14656
  load(onFinish = noop) {
14521
14657
  if (this.state.attempt > this.options.attempt - 1 && this.state.error) {
14658
+ if (process.env.NODE_ENV !== "production" && !lazyManager.options.silent) {
14659
+ console.log(`[@vant/lazyload] ${this.options.src} tried too more than ${this.options.attempt} times`);
14660
+ }
14522
14661
  onFinish();
14523
14662
  return;
14524
14663
  }
@@ -14558,7 +14697,7 @@ const Lazyload = {
14558
14697
  });
14559
14698
  }
14560
14699
  };
14561
- const version = "3.5.0";
14700
+ const version = "3.5.3";
14562
14701
  function install(app) {
14563
14702
  const components = [
14564
14703
  ActionBar,
@@ -14745,6 +14884,6 @@ exports.Tag = Tag;
14745
14884
  exports.Toast = Toast;
14746
14885
  exports.TreeSelect = TreeSelect;
14747
14886
  exports.Uploader = Uploader;
14748
- exports["default"] = stdin_default;
14887
+ exports.default = stdin_default;
14749
14888
  exports.install = install;
14750
14889
  exports.version = version;