vant 4.9.21 → 4.9.22

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 (94) hide show
  1. package/README.md +2 -2
  2. package/es/action-bar-button/index.css +1 -1
  3. package/es/action-sheet/ActionSheet.d.ts +1 -1
  4. package/es/action-sheet/index.d.ts +1 -1
  5. package/es/address-list/AddressListItem.d.ts +1 -1
  6. package/es/area/Area.d.ts +1 -1
  7. package/es/area/index.d.ts +1 -1
  8. package/es/calendar/index.css +1 -1
  9. package/es/composables/on-popup-reopen.mjs +1 -1
  10. package/es/composables/use-tab-status.mjs +2 -2
  11. package/es/composables/use-touch.mjs +4 -4
  12. package/es/date-picker/DatePicker.d.ts +1 -1
  13. package/es/date-picker/index.d.ts +1 -1
  14. package/es/dialog/Dialog.d.ts +1 -1
  15. package/es/dialog/index.css +1 -1
  16. package/es/dialog/index.d.ts +1 -1
  17. package/es/field/Field.d.ts +5 -5
  18. package/es/field/Field.mjs +3 -3
  19. package/es/field/index.d.ts +3 -3
  20. package/es/field/types.d.ts +1 -0
  21. package/es/floating-panel/FloatingPanel.d.ts +13 -0
  22. package/es/floating-panel/FloatingPanel.mjs +14 -2
  23. package/es/floating-panel/index.d.ts +9 -0
  24. package/es/grid/Grid.d.ts +1 -1
  25. package/es/grid/index.d.ts +1 -1
  26. package/es/index.d.ts +1 -1
  27. package/es/index.mjs +1 -1
  28. package/es/list/List.d.ts +13 -3
  29. package/es/list/List.mjs +5 -2
  30. package/es/list/index.d.ts +9 -2
  31. package/es/picker/Picker.d.ts +1 -1
  32. package/es/picker/index.d.ts +1 -1
  33. package/es/search/Search.d.ts +4 -4
  34. package/es/search/Search.mjs +1 -0
  35. package/es/search/index.d.ts +3 -3
  36. package/es/share-sheet/ShareSheet.d.ts +1 -1
  37. package/es/share-sheet/index.d.ts +1 -1
  38. package/es/stepper/Stepper.mjs +3 -0
  39. package/es/tabs/Tabs.d.ts +1 -1
  40. package/es/tabs/index.d.ts +1 -1
  41. package/es/time-picker/TimePicker.d.ts +1 -1
  42. package/es/time-picker/TimePicker.mjs +1 -1
  43. package/es/time-picker/index.d.ts +1 -1
  44. package/es/utils/constant.mjs +1 -1
  45. package/lib/action-bar-button/index.css +1 -1
  46. package/lib/action-sheet/ActionSheet.d.ts +1 -1
  47. package/lib/action-sheet/index.d.ts +1 -1
  48. package/lib/address-list/AddressListItem.d.ts +1 -1
  49. package/lib/area/Area.d.ts +1 -1
  50. package/lib/area/index.d.ts +1 -1
  51. package/lib/calendar/index.css +1 -1
  52. package/lib/composables/on-popup-reopen.js +1 -1
  53. package/lib/composables/use-tab-status.js +2 -2
  54. package/lib/composables/use-touch.js +4 -4
  55. package/lib/date-picker/DatePicker.d.ts +1 -1
  56. package/lib/date-picker/index.d.ts +1 -1
  57. package/lib/dialog/Dialog.d.ts +1 -1
  58. package/lib/dialog/index.css +1 -1
  59. package/lib/dialog/index.d.ts +1 -1
  60. package/lib/field/Field.d.ts +5 -5
  61. package/lib/field/Field.js +3 -3
  62. package/lib/field/index.d.ts +3 -3
  63. package/lib/field/types.d.ts +1 -0
  64. package/lib/floating-panel/FloatingPanel.d.ts +13 -0
  65. package/lib/floating-panel/FloatingPanel.js +14 -2
  66. package/lib/floating-panel/index.d.ts +9 -0
  67. package/lib/grid/Grid.d.ts +1 -1
  68. package/lib/grid/index.d.ts +1 -1
  69. package/lib/index.css +1 -1
  70. package/lib/index.d.ts +1 -1
  71. package/lib/index.js +1 -1
  72. package/lib/list/List.d.ts +13 -3
  73. package/lib/list/List.js +5 -2
  74. package/lib/list/index.d.ts +9 -2
  75. package/lib/picker/Picker.d.ts +1 -1
  76. package/lib/picker/index.d.ts +1 -1
  77. package/lib/search/Search.d.ts +4 -4
  78. package/lib/search/Search.js +1 -0
  79. package/lib/search/index.d.ts +3 -3
  80. package/lib/share-sheet/ShareSheet.d.ts +1 -1
  81. package/lib/share-sheet/index.d.ts +1 -1
  82. package/lib/stepper/Stepper.js +3 -0
  83. package/lib/tabs/Tabs.d.ts +1 -1
  84. package/lib/tabs/index.d.ts +1 -1
  85. package/lib/time-picker/TimePicker.d.ts +1 -1
  86. package/lib/time-picker/TimePicker.js +1 -1
  87. package/lib/time-picker/index.d.ts +1 -1
  88. package/lib/utils/constant.js +1 -1
  89. package/lib/vant.cjs.js +32 -13
  90. package/lib/vant.es.js +32 -13
  91. package/lib/vant.js +40 -21
  92. package/lib/vant.min.js +3 -3
  93. package/lib/web-types.json +1 -1
  94. package/package.json +14 -14
package/lib/vant.js CHANGED
@@ -745,7 +745,7 @@
745
745
  const BORDER_TOP_BOTTOM = `${BORDER}--top-bottom`;
746
746
  const BORDER_UNSET_TOP_BOTTOM = `${BORDER}-unset--top-bottom`;
747
747
  const HAPTICS_FEEDBACK = "van-haptics-feedback";
748
- const FORM_KEY = Symbol("van-form");
748
+ const FORM_KEY = /* @__PURE__ */ Symbol("van-form");
749
749
  const LONG_PRESS_START_TIME = 500;
750
750
  const TAP_OFFSET = 5;
751
751
  function callInterceptor(interceptor, {
@@ -788,7 +788,7 @@
788
788
  (pre, cur) => Math.abs(pre - target) < Math.abs(cur - target) ? pre : cur
789
789
  );
790
790
  }
791
- const POPUP_TOGGLE_KEY = Symbol();
791
+ const POPUP_TOGGLE_KEY = /* @__PURE__ */ Symbol();
792
792
  function onPopupReopen(callback) {
793
793
  const popupToggleStatus = vue.inject(POPUP_TOGGLE_KEY, null);
794
794
  if (popupToggleStatus) {
@@ -2353,7 +2353,7 @@
2353
2353
  return propRef;
2354
2354
  };
2355
2355
  /**
2356
- * @vue/shared v3.5.17
2356
+ * @vue/shared v3.5.25
2357
2357
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
2358
2358
  * @license MIT
2359
2359
  **/
@@ -3418,8 +3418,8 @@
3418
3418
  })]);
3419
3419
  }
3420
3420
  });
3421
- const TAB_STATUS_KEY = Symbol();
3422
- const ALL_TAB_STATUS_KEY = Symbol();
3421
+ const TAB_STATUS_KEY = /* @__PURE__ */ Symbol();
3422
+ const ALL_TAB_STATUS_KEY = /* @__PURE__ */ Symbol();
3423
3423
  const useTabStatus = () => vue.inject(TAB_STATUS_KEY, null);
3424
3424
  const useAllTabStatus = () => vue.inject(ALL_TAB_STATUS_KEY, null);
3425
3425
  const useProvideTabStatus = (status) => {
@@ -4733,7 +4733,7 @@
4733
4733
  var _a, _b;
4734
4734
  const originalValue = value;
4735
4735
  value = limitValueLength(value);
4736
- const limitDiffLen = getStringLength(originalValue) - getStringLength(value);
4736
+ const limitDiffLen = originalValue.length - value.length;
4737
4737
  if (props2.type === "number" || props2.type === "digit") {
4738
4738
  const isNumber = props2.type === "number";
4739
4739
  value = formatNumber(value, isNumber, isNumber);
@@ -4759,7 +4759,7 @@
4759
4759
  selectionEnd
4760
4760
  } = inputRef.value;
4761
4761
  const bcoVal = cutString(originalValue, selectionEnd);
4762
- formatterDiffLen = getStringLength(formatter(bcoVal)) - getStringLength(bcoVal);
4762
+ formatterDiffLen = formatter(bcoVal).length - bcoVal.length;
4763
4763
  }
4764
4764
  }
4765
4765
  if (inputRef.value && inputRef.value.value !== value) {
@@ -4770,7 +4770,7 @@
4770
4770
  } = inputRef.value;
4771
4771
  inputRef.value.value = value;
4772
4772
  if (isDef(selectionStart) && isDef(selectionEnd)) {
4773
- const valueLen = getStringLength(value);
4773
+ const valueLen = value.length;
4774
4774
  if (limitDiffLen) {
4775
4775
  selectionStart -= limitDiffLen;
4776
4776
  selectionEnd -= limitDiffLen;
@@ -10743,6 +10743,7 @@
10743
10743
  height: makeNumericProp(0),
10744
10744
  anchors: makeArrayProp(),
10745
10745
  duration: makeNumericProp(0.3),
10746
+ magnetic: truthProp,
10746
10747
  contentDraggable: truthProp,
10747
10748
  lockScroll: Boolean,
10748
10749
  safeAreaInsetBottom: truthProp
@@ -10819,7 +10820,15 @@
10819
10820
  const onTouchend = () => {
10820
10821
  maxScroll = -1;
10821
10822
  dragging.value = false;
10822
- height.value = closest(anchors.value, height.value);
10823
+ if (props2.magnetic) {
10824
+ height.value = closest(anchors.value, height.value);
10825
+ } else {
10826
+ const {
10827
+ min,
10828
+ max
10829
+ } = boundary.value;
10830
+ height.value = Math.max(min, Math.min(max, height.value));
10831
+ }
10823
10832
  if (height.value !== -startY) {
10824
10833
  emit("heightChange", {
10825
10834
  height: height.value
@@ -10858,7 +10867,10 @@
10858
10867
  "onTouchcancel": onTouchend
10859
10868
  }, [renderHeader(), vue.createVNode("div", {
10860
10869
  "class": bem$I("content"),
10861
- "ref": contentRef
10870
+ "ref": contentRef,
10871
+ "style": {
10872
+ paddingBottom: addUnit(boundary.value.max - height.value)
10873
+ }
10862
10874
  }, [(_a = slots.default) == null ? void 0 : _a.call(slots)])]);
10863
10875
  };
10864
10876
  }
@@ -12040,7 +12052,10 @@
12040
12052
  scroller: Object,
12041
12053
  errorText: String,
12042
12054
  direction: makeStringProp("down"),
12043
- loadingText: String,
12055
+ loadingText: {
12056
+ type: String,
12057
+ default: ""
12058
+ },
12044
12059
  finishedText: String,
12045
12060
  immediateCheck: truthProp
12046
12061
  };
@@ -12117,7 +12132,7 @@
12117
12132
  if (loading.value && !props2.finished && !props2.disabled) {
12118
12133
  return vue.createVNode("div", {
12119
12134
  "class": bem$A("loading")
12120
- }, [slots.loading ? slots.loading() : vue.createVNode(Loading, {
12135
+ }, [slots.loading ? slots.loading() : props2.loadingText != null && vue.createVNode(Loading, {
12121
12136
  "class": bem$A("loading-icon")
12122
12137
  }, {
12123
12138
  default: () => [props2.loadingText || t$7("loading")]
@@ -13560,7 +13575,7 @@
13560
13575
  }
13561
13576
  return offsets;
13562
13577
  }
13563
- function popperOffsets_popperOffsets(_ref) {
13578
+ function popperOffsets(_ref) {
13564
13579
  var state = _ref.state, name2 = _ref.name;
13565
13580
  state.modifiersData[name2] = computeOffsets({
13566
13581
  reference: state.rects.reference,
@@ -13568,11 +13583,11 @@
13568
13583
  placement: state.placement
13569
13584
  });
13570
13585
  }
13571
- const popperOffsets = {
13586
+ const modifiers_popperOffsets = {
13572
13587
  name: "popperOffsets",
13573
13588
  enabled: true,
13574
13589
  phase: "read",
13575
- fn: popperOffsets_popperOffsets,
13590
+ fn: popperOffsets,
13576
13591
  data: {}
13577
13592
  };
13578
13593
  var unsetSides = {
@@ -13649,7 +13664,7 @@
13649
13664
  }
13650
13665
  return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : "", _Object$assign2[sideX] = hasX ? x + "px" : "", _Object$assign2.transform = "", _Object$assign2));
13651
13666
  }
13652
- function computeStyles_computeStyles(_ref5) {
13667
+ function computeStyles(_ref5) {
13653
13668
  var state = _ref5.state, options = _ref5.options;
13654
13669
  var _options$gpuAccelerat = options.gpuAcceleration, gpuAcceleration = void 0 === _options$gpuAccelerat ? true : _options$gpuAccelerat, _options$adaptive = options.adaptive, adaptive = void 0 === _options$adaptive ? true : _options$adaptive, _options$roundOffsets = options.roundOffsets, roundOffsets = void 0 === _options$roundOffsets ? true : _options$roundOffsets;
13655
13670
  var commonStyles = {
@@ -13676,11 +13691,11 @@
13676
13691
  "data-popper-placement": state.placement
13677
13692
  });
13678
13693
  }
13679
- const computeStyles = {
13694
+ const modifiers_computeStyles = {
13680
13695
  name: "computeStyles",
13681
13696
  enabled: true,
13682
13697
  phase: "beforeWrite",
13683
- fn: computeStyles_computeStyles,
13698
+ fn: computeStyles,
13684
13699
  data: {}
13685
13700
  };
13686
13701
  function applyStyles(_ref) {
@@ -13744,8 +13759,8 @@
13744
13759
  };
13745
13760
  var popper_lite_defaultModifiers = [
13746
13761
  eventListeners,
13747
- popperOffsets,
13748
- computeStyles,
13762
+ modifiers_popperOffsets,
13763
+ modifiers_computeStyles,
13749
13764
  modifiers_applyStyles
13750
13765
  ];
13751
13766
  var popper_lite_createPopper = /* @__PURE__ */ popperGenerator({
@@ -14668,6 +14683,7 @@
14668
14683
  "with-message": fieldAttrs.errorMessage
14669
14684
  }),
14670
14685
  "border": false,
14686
+ "labelAlign": "left",
14671
14687
  "onBlur": onBlur,
14672
14688
  "onFocus": onFocus,
14673
14689
  "onClear": onClear,
@@ -15777,6 +15793,9 @@
15777
15793
  if (allowEmpty && value === "") {
15778
15794
  return value;
15779
15795
  }
15796
+ if (typeof value === "number" && String(value).includes("e")) {
15797
+ value = value.toFixed(decimalLength ? +decimalLength : 17);
15798
+ }
15780
15799
  value = formatNumber(String(value), !props2.integer);
15781
15800
  value = value === "" ? 0 : +value;
15782
15801
  value = Number.isNaN(value) ? +min : value;
@@ -18227,7 +18246,7 @@
18227
18246
  });
18228
18247
  }
18229
18248
  };
18230
- const version = "4.9.21";
18249
+ const version = "4.9.22";
18231
18250
  function install(app) {
18232
18251
  const components = [
18233
18252
  ActionBar,