vant 3.6.1 → 3.6.2

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 (292) hide show
  1. package/changelog.generated.md +30 -43
  2. package/es/action-bar/ActionBar.d.ts +1 -1
  3. package/es/action-bar/index.d.ts +1 -1
  4. package/es/action-bar-button/ActionBarButton.d.ts +1 -1
  5. package/es/action-bar-button/index.d.ts +1 -1
  6. package/es/action-bar-icon/ActionBarIcon.d.ts +1 -1
  7. package/es/action-bar-icon/index.d.ts +1 -1
  8. package/es/badge/Badge.d.ts +1 -1
  9. package/es/badge/index.d.ts +1 -1
  10. package/es/calendar/Calendar.mjs +4 -3
  11. package/es/cell/Cell.d.ts +1 -1
  12. package/es/cell/index.d.ts +1 -1
  13. package/es/cell-group/CellGroup.d.ts +1 -1
  14. package/es/cell-group/index.d.ts +1 -1
  15. package/es/col/Col.d.ts +1 -1
  16. package/es/col/index.d.ts +1 -1
  17. package/es/collapse-item/CollapseItem.d.ts +1 -1
  18. package/es/collapse-item/index.d.ts +1 -1
  19. package/es/composables/use-lazy-render.mjs +9 -5
  20. package/es/composables/use-lock-scroll.mjs +4 -1
  21. package/es/composables/use-visibility-change.mjs +6 -3
  22. package/es/config-provider/ConfigProvider.d.ts +1 -1
  23. package/es/config-provider/index.d.ts +1 -1
  24. package/es/coupon/Coupon.d.ts +1 -1
  25. package/es/coupon/index.d.ts +1 -1
  26. package/es/coupon/utils.mjs +3 -1
  27. package/es/coupon-cell/CouponCell.d.ts +1 -1
  28. package/es/coupon-cell/index.d.ts +1 -1
  29. package/es/datetime-picker/DatetimePicker.d.ts +1 -1
  30. package/es/datetime-picker/index.d.ts +1 -1
  31. package/es/divider/Divider.d.ts +1 -1
  32. package/es/divider/index.d.ts +1 -1
  33. package/es/dropdown-item/DropdownItem.d.ts +2 -2
  34. package/es/dropdown-item/index.d.ts +2 -2
  35. package/es/dropdown-menu/DropdownMenu.d.ts +1 -1
  36. package/es/dropdown-menu/index.d.ts +1 -1
  37. package/es/empty/Empty.d.ts +1 -1
  38. package/es/empty/index.d.ts +1 -1
  39. package/es/field/Field.mjs +10 -3
  40. package/es/grid/Grid.d.ts +1 -1
  41. package/es/grid/index.d.ts +1 -1
  42. package/es/grid-item/GridItem.d.ts +1 -1
  43. package/es/grid-item/index.d.ts +1 -1
  44. package/es/icon/Icon.d.ts +1 -1
  45. package/es/icon/index.d.ts +1 -1
  46. package/es/image-preview/ImagePreviewItem.mjs +10 -2
  47. package/es/index-anchor/IndexAnchor.d.ts +1 -1
  48. package/es/index-anchor/index.d.ts +1 -1
  49. package/es/index-bar/IndexBar.mjs +7 -3
  50. package/es/index.d.ts +1 -1
  51. package/es/index.mjs +1 -1
  52. package/es/lazyload/vue-lazyload/lazy-component.mjs +4 -1
  53. package/es/lazyload/vue-lazyload/lazy-container.mjs +11 -7
  54. package/es/lazyload/vue-lazyload/lazy-image.mjs +24 -14
  55. package/es/lazyload/vue-lazyload/lazy.mjs +11 -3
  56. package/es/lazyload/vue-lazyload/listener.mjs +45 -33
  57. package/es/lazyload/vue-lazyload/util.mjs +4 -1
  58. package/es/loading/Loading.d.ts +1 -1
  59. package/es/loading/index.d.ts +1 -1
  60. package/es/number-keyboard/NumberKeyboard.d.ts +1 -1
  61. package/es/number-keyboard/index.d.ts +1 -1
  62. package/es/overlay/Overlay.d.ts +1 -1
  63. package/es/overlay/Overlay.mjs +13 -6
  64. package/es/overlay/index.d.ts +1 -1
  65. package/es/picker/Picker.mjs +7 -3
  66. package/es/picker/PickerColumn.mjs +6 -2
  67. package/es/popup/Popup.d.ts +2 -2
  68. package/es/popup/index.d.ts +2 -2
  69. package/es/popup/shared.mjs +3 -1
  70. package/es/progress/Progress.d.ts +1 -1
  71. package/es/progress/index.d.ts +1 -1
  72. package/es/rate/Rate.mjs +5 -3
  73. package/es/row/Row.d.ts +1 -1
  74. package/es/row/index.d.ts +1 -1
  75. package/es/skeleton/Skeleton.d.ts +1 -1
  76. package/es/skeleton/index.d.ts +1 -1
  77. package/es/slider/Slider.mjs +6 -2
  78. package/es/space/Space.d.ts +1 -1
  79. package/es/space/index.d.ts +1 -1
  80. package/es/step/Step.d.ts +1 -1
  81. package/es/step/index.d.ts +1 -1
  82. package/es/swipe/Swipe.mjs +13 -6
  83. package/es/swipe-cell/SwipeCell.d.ts +2 -2
  84. package/es/swipe-cell/SwipeCell.mjs +4 -2
  85. package/es/swipe-cell/index.d.ts +2 -2
  86. package/es/swipe-item/SwipeItem.d.ts +1 -1
  87. package/es/swipe-item/index.d.ts +1 -1
  88. package/es/tab/Tab.d.ts +1 -1
  89. package/es/tab/index.d.ts +1 -1
  90. package/es/tabs/Tabs.d.ts +1 -1
  91. package/es/tabs/TabsTitle.d.ts +1 -1
  92. package/es/tabs/index.d.ts +1 -1
  93. package/es/utils/create.mjs +8 -2
  94. package/es/utils/with-install.d.ts +2 -2
  95. package/es/utils/with-install.mjs +4 -2
  96. package/lib/action-bar/ActionBar.d.ts +1 -1
  97. package/lib/action-bar/index.d.ts +1 -1
  98. package/lib/action-bar/index.js +4 -1
  99. package/lib/action-bar-button/ActionBarButton.d.ts +1 -1
  100. package/lib/action-bar-button/index.d.ts +1 -1
  101. package/lib/action-bar-button/index.js +4 -1
  102. package/lib/action-bar-icon/ActionBarIcon.d.ts +1 -1
  103. package/lib/action-bar-icon/index.d.ts +1 -1
  104. package/lib/action-bar-icon/index.js +4 -1
  105. package/lib/action-sheet/index.js +4 -1
  106. package/lib/address-edit/AddressEdit.js +4 -1
  107. package/lib/address-edit/index.js +4 -1
  108. package/lib/address-list/AddressList.js +4 -1
  109. package/lib/address-list/index.js +4 -1
  110. package/lib/area/index.js +4 -1
  111. package/lib/badge/Badge.d.ts +1 -1
  112. package/lib/badge/index.d.ts +1 -1
  113. package/lib/badge/index.js +4 -1
  114. package/lib/button/index.js +4 -1
  115. package/lib/calendar/Calendar.js +8 -4
  116. package/lib/calendar/CalendarMonth.js +4 -1
  117. package/lib/calendar/index.js +4 -1
  118. package/lib/card/index.js +4 -1
  119. package/lib/cascader/index.js +4 -1
  120. package/lib/cell/Cell.d.ts +1 -1
  121. package/lib/cell/index.d.ts +1 -1
  122. package/lib/cell/index.js +4 -1
  123. package/lib/cell-group/CellGroup.d.ts +1 -1
  124. package/lib/cell-group/index.d.ts +1 -1
  125. package/lib/cell-group/index.js +4 -1
  126. package/lib/checkbox/Checkbox.js +4 -1
  127. package/lib/checkbox/index.js +4 -1
  128. package/lib/checkbox-group/index.js +4 -1
  129. package/lib/circle/index.js +4 -1
  130. package/lib/col/Col.d.ts +1 -1
  131. package/lib/col/index.d.ts +1 -1
  132. package/lib/col/index.js +4 -1
  133. package/lib/collapse/index.js +4 -1
  134. package/lib/collapse-item/CollapseItem.d.ts +1 -1
  135. package/lib/collapse-item/index.d.ts +1 -1
  136. package/lib/collapse-item/index.js +4 -1
  137. package/lib/composables/use-lazy-render.js +9 -5
  138. package/lib/composables/use-lock-scroll.js +4 -1
  139. package/lib/composables/use-visibility-change.js +6 -3
  140. package/lib/config-provider/ConfigProvider.d.ts +1 -1
  141. package/lib/config-provider/index.d.ts +1 -1
  142. package/lib/config-provider/index.js +4 -1
  143. package/lib/contact-card/index.js +4 -1
  144. package/lib/contact-edit/index.js +4 -1
  145. package/lib/contact-list/index.js +4 -1
  146. package/lib/count-down/index.js +4 -1
  147. package/lib/coupon/Coupon.d.ts +1 -1
  148. package/lib/coupon/index.d.ts +1 -1
  149. package/lib/coupon/index.js +4 -1
  150. package/lib/coupon/utils.js +3 -1
  151. package/lib/coupon-cell/CouponCell.d.ts +1 -1
  152. package/lib/coupon-cell/index.d.ts +1 -1
  153. package/lib/coupon-cell/index.js +4 -1
  154. package/lib/coupon-list/index.js +4 -1
  155. package/lib/datetime-picker/DatetimePicker.d.ts +1 -1
  156. package/lib/datetime-picker/DatetimePicker.js +4 -1
  157. package/lib/datetime-picker/index.d.ts +1 -1
  158. package/lib/datetime-picker/index.js +4 -1
  159. package/lib/dialog/function-call.js +4 -1
  160. package/lib/divider/Divider.d.ts +1 -1
  161. package/lib/divider/index.d.ts +1 -1
  162. package/lib/divider/index.js +4 -1
  163. package/lib/dropdown-item/DropdownItem.d.ts +2 -2
  164. package/lib/dropdown-item/index.d.ts +2 -2
  165. package/lib/dropdown-item/index.js +4 -1
  166. package/lib/dropdown-menu/DropdownMenu.d.ts +1 -1
  167. package/lib/dropdown-menu/index.d.ts +1 -1
  168. package/lib/dropdown-menu/index.js +4 -1
  169. package/lib/empty/Empty.d.ts +1 -1
  170. package/lib/empty/index.d.ts +1 -1
  171. package/lib/empty/index.js +4 -1
  172. package/lib/field/Field.js +9 -2
  173. package/lib/field/index.js +4 -1
  174. package/lib/form/index.js +4 -1
  175. package/lib/grid/Grid.d.ts +1 -1
  176. package/lib/grid/index.d.ts +1 -1
  177. package/lib/grid/index.js +4 -1
  178. package/lib/grid-item/GridItem.d.ts +1 -1
  179. package/lib/grid-item/index.d.ts +1 -1
  180. package/lib/grid-item/index.js +4 -1
  181. package/lib/icon/Icon.d.ts +1 -1
  182. package/lib/icon/index.d.ts +1 -1
  183. package/lib/icon/index.js +4 -1
  184. package/lib/image/index.js +4 -1
  185. package/lib/image-preview/ImagePreview.js +4 -1
  186. package/lib/image-preview/ImagePreviewItem.js +9 -1
  187. package/lib/image-preview/function-call.js +4 -1
  188. package/lib/index-anchor/IndexAnchor.d.ts +1 -1
  189. package/lib/index-anchor/index.d.ts +1 -1
  190. package/lib/index-anchor/index.js +4 -1
  191. package/lib/index-bar/IndexBar.js +7 -3
  192. package/lib/index-bar/index.js +4 -1
  193. package/lib/index.d.ts +1 -1
  194. package/lib/index.js +1 -1
  195. package/lib/lazyload/vue-lazyload/index.js +4 -1
  196. package/lib/lazyload/vue-lazyload/lazy-component.js +4 -1
  197. package/lib/lazyload/vue-lazyload/lazy-container.js +11 -7
  198. package/lib/lazyload/vue-lazyload/lazy-image.js +24 -14
  199. package/lib/lazyload/vue-lazyload/lazy.js +15 -4
  200. package/lib/lazyload/vue-lazyload/listener.js +45 -33
  201. package/lib/lazyload/vue-lazyload/util.js +4 -1
  202. package/lib/list/index.js +4 -1
  203. package/lib/loading/Loading.d.ts +1 -1
  204. package/lib/loading/index.d.ts +1 -1
  205. package/lib/loading/index.js +4 -1
  206. package/lib/locale/index.js +4 -1
  207. package/lib/nav-bar/index.js +4 -1
  208. package/lib/notice-bar/index.js +4 -1
  209. package/lib/notify/function-call.js +4 -1
  210. package/lib/number-keyboard/NumberKeyboard.d.ts +1 -1
  211. package/lib/number-keyboard/NumberKeyboard.js +4 -1
  212. package/lib/number-keyboard/index.d.ts +1 -1
  213. package/lib/number-keyboard/index.js +4 -1
  214. package/lib/overlay/Overlay.d.ts +1 -1
  215. package/lib/overlay/Overlay.js +11 -4
  216. package/lib/overlay/index.d.ts +1 -1
  217. package/lib/overlay/index.js +4 -1
  218. package/lib/pagination/index.js +4 -1
  219. package/lib/password-input/index.js +4 -1
  220. package/lib/picker/Picker.js +10 -3
  221. package/lib/picker/PickerColumn.js +5 -1
  222. package/lib/picker/index.js +4 -1
  223. package/lib/popover/index.js +4 -1
  224. package/lib/popup/Popup.d.ts +2 -2
  225. package/lib/popup/index.d.ts +2 -2
  226. package/lib/popup/index.js +4 -1
  227. package/lib/popup/shared.js +3 -1
  228. package/lib/progress/Progress.d.ts +1 -1
  229. package/lib/progress/index.d.ts +1 -1
  230. package/lib/progress/index.js +4 -1
  231. package/lib/pull-refresh/index.js +4 -1
  232. package/lib/radio/Radio.js +4 -1
  233. package/lib/radio/index.js +4 -1
  234. package/lib/radio-group/index.js +4 -1
  235. package/lib/rate/Rate.js +4 -2
  236. package/lib/rate/index.js +4 -1
  237. package/lib/row/Row.d.ts +1 -1
  238. package/lib/row/index.d.ts +1 -1
  239. package/lib/row/index.js +4 -1
  240. package/lib/search/index.js +4 -1
  241. package/lib/share-sheet/index.js +4 -1
  242. package/lib/sidebar/index.js +4 -1
  243. package/lib/sidebar-item/index.js +4 -1
  244. package/lib/skeleton/Skeleton.d.ts +1 -1
  245. package/lib/skeleton/index.d.ts +1 -1
  246. package/lib/skeleton/index.js +4 -1
  247. package/lib/slider/Slider.js +5 -1
  248. package/lib/slider/index.js +4 -1
  249. package/lib/space/Space.d.ts +1 -1
  250. package/lib/space/index.d.ts +1 -1
  251. package/lib/space/index.js +4 -1
  252. package/lib/step/Step.d.ts +1 -1
  253. package/lib/step/index.d.ts +1 -1
  254. package/lib/step/index.js +4 -1
  255. package/lib/stepper/index.js +4 -1
  256. package/lib/steps/index.js +4 -1
  257. package/lib/sticky/index.js +4 -1
  258. package/lib/submit-bar/index.js +4 -1
  259. package/lib/swipe/Swipe.js +12 -5
  260. package/lib/swipe/index.js +4 -1
  261. package/lib/swipe-cell/SwipeCell.d.ts +2 -2
  262. package/lib/swipe-cell/SwipeCell.js +3 -1
  263. package/lib/swipe-cell/index.d.ts +2 -2
  264. package/lib/swipe-cell/index.js +4 -1
  265. package/lib/swipe-item/SwipeItem.d.ts +1 -1
  266. package/lib/swipe-item/index.d.ts +1 -1
  267. package/lib/swipe-item/index.js +4 -1
  268. package/lib/switch/index.js +4 -1
  269. package/lib/tab/Tab.d.ts +1 -1
  270. package/lib/tab/index.d.ts +1 -1
  271. package/lib/tab/index.js +4 -1
  272. package/lib/tabbar/index.js +4 -1
  273. package/lib/tabbar-item/index.js +4 -1
  274. package/lib/tabs/Tabs.d.ts +1 -1
  275. package/lib/tabs/Tabs.js +4 -1
  276. package/lib/tabs/TabsTitle.d.ts +1 -1
  277. package/lib/tabs/index.d.ts +1 -1
  278. package/lib/tabs/index.js +4 -1
  279. package/lib/tag/index.js +4 -1
  280. package/lib/toast/function-call.js +4 -1
  281. package/lib/tree-select/index.js +4 -1
  282. package/lib/uploader/Uploader.js +4 -1
  283. package/lib/uploader/index.js +4 -1
  284. package/lib/utils/create.js +12 -3
  285. package/lib/utils/with-install.d.ts +2 -2
  286. package/lib/utils/with-install.js +4 -2
  287. package/lib/vant.cjs.js +211 -101
  288. package/lib/vant.es.js +211 -101
  289. package/lib/vant.js +253 -126
  290. package/lib/vant.min.js +1 -1
  291. package/lib/web-types.json +1132 -1132
  292. package/package.json +7 -7
package/lib/vant.es.js CHANGED
@@ -330,9 +330,15 @@ function genBem(name2, mods) {
330
330
  return ` ${name2}--${mods}`;
331
331
  }
332
332
  if (Array.isArray(mods)) {
333
- return mods.reduce((ret, item) => ret + genBem(name2, item), "");
334
- }
335
- return Object.keys(mods).reduce((ret, key) => ret + (mods[key] ? genBem(name2, key) : ""), "");
333
+ return mods.reduce(
334
+ (ret, item) => ret + genBem(name2, item),
335
+ ""
336
+ );
337
+ }
338
+ return Object.keys(mods).reduce(
339
+ (ret, key) => ret + (mods[key] ? genBem(name2, key) : ""),
340
+ ""
341
+ );
336
342
  }
337
343
  function createBEM(name2) {
338
344
  return (el, mods) => {
@@ -388,8 +394,10 @@ function callInterceptor(interceptor, {
388
394
  function withInstall(options) {
389
395
  options.install = (app) => {
390
396
  const { name: name2 } = options;
391
- app.component(name2, options);
392
- app.component(camelize(`-${name2}`), options);
397
+ if (name2) {
398
+ app.component(name2, options);
399
+ app.component(camelize(`-${name2}`), options);
400
+ }
393
401
  };
394
402
  return options;
395
403
  }
@@ -1018,7 +1026,9 @@ const popupSharedProps = {
1018
1026
  transitionAppear: Boolean,
1019
1027
  closeOnClickOverlay: truthProp
1020
1028
  };
1021
- const popupSharedPropKeys = Object.keys(popupSharedProps);
1029
+ const popupSharedPropKeys = Object.keys(
1030
+ popupSharedProps
1031
+ );
1022
1032
  function getDirection(x, y) {
1023
1033
  if (x > y) {
1024
1034
  return "horizontal";
@@ -1085,7 +1095,10 @@ function useLockScroll(rootRef, shouldLock) {
1085
1095
  const onTouchMove = (event) => {
1086
1096
  touch.move(event);
1087
1097
  const direction = touch.deltaY.value > 0 ? DIRECTION_DOWN : DIRECTION_UP;
1088
- const el = getScrollParent(event.target, rootRef.value);
1098
+ const el = getScrollParent(
1099
+ event.target,
1100
+ rootRef.value
1101
+ );
1089
1102
  const { scrollHeight, offsetHeight, scrollTop } = el;
1090
1103
  let status = "11";
1091
1104
  if (scrollTop === 0) {
@@ -1126,11 +1139,15 @@ function useLockScroll(rootRef, shouldLock) {
1126
1139
  }
1127
1140
  function useLazyRender(show) {
1128
1141
  const inited = ref(false);
1129
- watch(show, (value) => {
1130
- if (value) {
1131
- inited.value = value;
1132
- }
1133
- }, { immediate: true });
1142
+ watch(
1143
+ show,
1144
+ (value) => {
1145
+ if (value) {
1146
+ inited.value = value;
1147
+ }
1148
+ },
1149
+ { immediate: true }
1150
+ );
1134
1151
  return (render) => () => inited.value ? render() : null;
1135
1152
  }
1136
1153
  const [name$1n, bem$1j] = createNamespace("overlay");
@@ -1149,9 +1166,12 @@ var stdin_default$1u = defineComponent({
1149
1166
  setup(props, {
1150
1167
  slots
1151
1168
  }) {
1169
+ const root = ref();
1152
1170
  const lazyRender = useLazyRender(() => props.show || !props.lazyRender);
1153
- const preventTouchMove = (event) => {
1154
- preventDefault(event, true);
1171
+ const onTouchMove = (event) => {
1172
+ if (props.lockScroll) {
1173
+ preventDefault(event, true);
1174
+ }
1155
1175
  };
1156
1176
  const renderOverlay = lazyRender(() => {
1157
1177
  var _a;
@@ -1160,11 +1180,14 @@ var stdin_default$1u = defineComponent({
1160
1180
  style.animationDuration = `${props.duration}s`;
1161
1181
  }
1162
1182
  return withDirectives(createVNode("div", {
1183
+ "ref": root,
1163
1184
  "style": style,
1164
- "class": [bem$1j(), props.className],
1165
- "onTouchmove": props.lockScroll ? preventTouchMove : noop
1185
+ "class": [bem$1j(), props.className]
1166
1186
  }, [(_a = slots.default) == null ? void 0 : _a.call(slots)]), [[vShow, props.show]]);
1167
1187
  });
1188
+ useEventListener("touchmove", onTouchMove, {
1189
+ target: root
1190
+ });
1168
1191
  return () => createVNode(Transition, {
1169
1192
  "name": "van-fade",
1170
1193
  "appear": true
@@ -1540,6 +1563,7 @@ var stdin_default$1r = defineComponent({
1540
1563
  let touchStartTime;
1541
1564
  let momentumOffset;
1542
1565
  let transitionEndTrigger;
1566
+ const root = ref();
1543
1567
  const wrapper = ref();
1544
1568
  const state = reactive({
1545
1569
  index: props.defaultIndex,
@@ -1715,10 +1739,13 @@ var stdin_default$1r = defineComponent({
1715
1739
  });
1716
1740
  watch(() => props.initialOptions, setOptions);
1717
1741
  watch(() => props.defaultIndex, (value) => setIndex(value));
1742
+ useEventListener("touchmove", onTouchMove, {
1743
+ target: root
1744
+ });
1718
1745
  return () => createVNode("div", {
1746
+ "ref": root,
1719
1747
  "class": [bem$1g(), props.className],
1720
1748
  "onTouchstartPassive": onTouchStart,
1721
- "onTouchmove": onTouchMove,
1722
1749
  "onTouchend": onTouchEnd,
1723
1750
  "onTouchcancel": onTouchEnd
1724
1751
  }, [createVNode("ul", {
@@ -1770,6 +1797,7 @@ var stdin_default$1q = defineComponent({
1770
1797
  }
1771
1798
  }
1772
1799
  const hasOptions = ref(false);
1800
+ const columnsRef = ref();
1773
1801
  const formattedColumns = ref([]);
1774
1802
  const columnsFieldNames = computed(() => {
1775
1803
  const {
@@ -2006,14 +2034,17 @@ var stdin_default$1q = defineComponent({
2006
2034
  height: `${wrapHeight}px`
2007
2035
  };
2008
2036
  return createVNode("div", {
2037
+ "ref": columnsRef,
2009
2038
  "class": bem$1f("columns"),
2010
- "style": columnsStyle,
2011
- "onTouchmove": preventDefault
2039
+ "style": columnsStyle
2012
2040
  }, [renderColumnItems(), renderMask(wrapHeight)]);
2013
2041
  };
2014
2042
  watch(() => props.columns, format2, {
2015
2043
  immediate: true
2016
2044
  });
2045
+ useEventListener("touchmove", preventDefault, {
2046
+ target: columnsRef
2047
+ });
2017
2048
  useExpose({
2018
2049
  confirm,
2019
2050
  getValues,
@@ -2691,6 +2722,7 @@ var stdin_default$1m = defineComponent({
2691
2722
  validateMessage: ""
2692
2723
  });
2693
2724
  const inputRef = ref();
2725
+ const clearIconRef = ref();
2694
2726
  const customValue = ref();
2695
2727
  const {
2696
2728
  parent: form
@@ -3006,9 +3038,9 @@ var stdin_default$1m = defineComponent({
3006
3038
  const renderFieldBody = () => [createVNode("div", {
3007
3039
  "class": bem$1b("body")
3008
3040
  }, [renderInput(), showClear.value && createVNode(Icon, {
3041
+ "ref": clearIconRef,
3009
3042
  "name": props.clearIcon,
3010
- "class": bem$1b("clear"),
3011
- "onTouchstart": onClear
3043
+ "class": bem$1b("clear")
3012
3044
  }, null), renderRightIcon(), slots.button && createVNode("div", {
3013
3045
  "class": bem$1b("button")
3014
3046
  }, [slots.button()])]), renderWordLimit(), renderMessage()];
@@ -3035,6 +3067,12 @@ var stdin_default$1m = defineComponent({
3035
3067
  updateValue(getModelValue(), props.formatTrigger);
3036
3068
  nextTick(adjustTextareaSize);
3037
3069
  });
3070
+ useEventListener("touchstart", onClear, {
3071
+ target: computed(() => {
3072
+ var _a;
3073
+ return (_a = clearIconRef.value) == null ? void 0 : _a.$el;
3074
+ })
3075
+ });
3038
3076
  return () => {
3039
3077
  const disabled = getProp("disabled");
3040
3078
  const labelAlign = getProp("labelAlign");
@@ -4755,7 +4793,8 @@ var stdin_default$18 = defineComponent({
4755
4793
  const {
4756
4794
  type,
4757
4795
  minDate,
4758
- maxDate
4796
+ maxDate,
4797
+ allowSameDay
4759
4798
  } = props;
4760
4799
  if (defaultDate === null) {
4761
4800
  return defaultDate;
@@ -4765,8 +4804,8 @@ var stdin_default$18 = defineComponent({
4765
4804
  if (!Array.isArray(defaultDate)) {
4766
4805
  defaultDate = [];
4767
4806
  }
4768
- const start = limitDateRange(defaultDate[0] || now, minDate, getPrevDay(maxDate));
4769
- const end = limitDateRange(defaultDate[1] || now, getNextDay(minDate));
4807
+ const start = limitDateRange(defaultDate[0] || now, minDate, allowSameDay ? maxDate : getPrevDay(maxDate));
4808
+ const end = limitDateRange(defaultDate[1] || now, allowSameDay ? minDate : getNextDay(minDate));
4770
4809
  return [start, end];
4771
4810
  }
4772
4811
  if (type === "multiple") {
@@ -5375,9 +5414,12 @@ function useVisibilityChange(target, onChange) {
5375
5414
  if (!inBrowser || !window.IntersectionObserver) {
5376
5415
  return;
5377
5416
  }
5378
- const observer = new IntersectionObserver((entries) => {
5379
- onChange(entries[0].intersectionRatio > 0);
5380
- }, { root: document.body });
5417
+ const observer = new IntersectionObserver(
5418
+ (entries) => {
5419
+ onChange(entries[0].intersectionRatio > 0);
5420
+ },
5421
+ { root: document.body }
5422
+ );
5381
5423
  const observe = () => {
5382
5424
  if (target.value) {
5383
5425
  observer.observe(target.value);
@@ -5613,6 +5655,7 @@ var stdin_default$13 = defineComponent({
5613
5655
  slots
5614
5656
  }) {
5615
5657
  const root = ref();
5658
+ const track = ref();
5616
5659
  const state = reactive({
5617
5660
  rect: null,
5618
5661
  width: 0,
@@ -5799,10 +5842,13 @@ var stdin_default$13 = defineComponent({
5799
5842
  if (props.touchable && state.swiping) {
5800
5843
  touch.move(event);
5801
5844
  if (isCorrectDirection.value) {
5802
- preventDefault(event, props.stopPropagation);
5803
- move({
5804
- offset: delta.value
5805
- });
5845
+ const isEdgeTouch = !props.loop && (state.active === 0 && delta.value > 0 || state.active === count.value - 1 && delta.value < 0);
5846
+ if (!isEdgeTouch) {
5847
+ preventDefault(event, props.stopPropagation);
5848
+ move({
5849
+ offset: delta.value
5850
+ });
5851
+ }
5806
5852
  }
5807
5853
  }
5808
5854
  };
@@ -5912,18 +5958,21 @@ var stdin_default$13 = defineComponent({
5912
5958
  onPopupReopen(() => initialize(state.active));
5913
5959
  onDeactivated(stopAutoplay);
5914
5960
  onBeforeUnmount(stopAutoplay);
5961
+ useEventListener("touchmove", onTouchMove, {
5962
+ target: track
5963
+ });
5915
5964
  return () => {
5916
5965
  var _a;
5917
5966
  return createVNode("div", {
5918
5967
  "ref": root,
5919
5968
  "class": bem$Y()
5920
5969
  }, [createVNode("div", {
5970
+ "ref": track,
5921
5971
  "style": trackStyle.value,
5922
5972
  "class": bem$Y("track", {
5923
5973
  vertical: props.vertical
5924
5974
  }),
5925
5975
  "onTouchstartPassive": onTouchStart,
5926
- "onTouchmove": onTouchMove,
5927
5976
  "onTouchend": onTouchEnd,
5928
5977
  "onTouchcancel": onTouchEnd
5929
5978
  }, [(_a = slots.default) == null ? void 0 : _a.call(slots)]), renderIndicator()]);
@@ -7736,7 +7785,9 @@ var stdin_default$O = defineComponent({
7736
7785
  const CountDown = withInstall(stdin_default$O);
7737
7786
  function getDate(timeStamp) {
7738
7787
  const date = new Date(timeStamp * 1e3);
7739
- return `${date.getFullYear()}.${padZero(date.getMonth() + 1)}.${padZero(date.getDate())}`;
7788
+ return `${date.getFullYear()}.${padZero(date.getMonth() + 1)}.${padZero(
7789
+ date.getDate()
7790
+ )}`;
7740
7791
  }
7741
7792
  const formatDiscount = (discount) => (discount / 10).toFixed(discount % 10 === 0 ? 0 : 1);
7742
7793
  const formatAmount = (amount) => (amount / 100).toFixed(amount % 100 === 0 ? 0 : amount % 10 === 0 ? 1 : 2);
@@ -9541,6 +9592,7 @@ var stdin_default$A = defineComponent({
9541
9592
  displayHeight: 0
9542
9593
  });
9543
9594
  const touch = useTouch();
9595
+ const swipeItem = ref();
9544
9596
  const vertical = computed(() => {
9545
9597
  const {
9546
9598
  rootWidth,
@@ -9726,6 +9778,12 @@ var stdin_default$A = defineComponent({
9726
9778
  resetScale();
9727
9779
  }
9728
9780
  });
9781
+ useEventListener("touchmove", onTouchMove, {
9782
+ target: computed(() => {
9783
+ var _a;
9784
+ return (_a = swipeItem.value) == null ? void 0 : _a.$el;
9785
+ })
9786
+ });
9729
9787
  return () => {
9730
9788
  const imageSlots = {
9731
9789
  loading: () => createVNode(Loading, {
@@ -9733,9 +9791,9 @@ var stdin_default$A = defineComponent({
9733
9791
  }, null)
9734
9792
  };
9735
9793
  return createVNode(SwipeItem, {
9794
+ "ref": swipeItem,
9736
9795
  "class": bem$v("swipe-item"),
9737
9796
  "onTouchstartPassive": onTouchStart,
9738
- "onTouchmove": onTouchMove,
9739
9797
  "onTouchend": onTouchEnd,
9740
9798
  "onTouchcancel": onTouchEnd
9741
9799
  }, {
@@ -9989,6 +10047,7 @@ var stdin_default$y = defineComponent({
9989
10047
  slots
9990
10048
  }) {
9991
10049
  const root = ref();
10050
+ const sidebar = ref();
9992
10051
  const activeAnchor = ref("");
9993
10052
  const touch = useTouch();
9994
10053
  const scrollParent = useScrollParent(root);
@@ -10108,11 +10167,11 @@ var stdin_default$y = defineComponent({
10108
10167
  const {
10109
10168
  offsetHeight
10110
10169
  } = document.documentElement;
10170
+ match.$el.scrollIntoView();
10111
10171
  if (scrollTop === offsetHeight - scrollParentRect.height) {
10112
10172
  onScroll();
10113
10173
  return;
10114
10174
  }
10115
- match.$el.scrollIntoView();
10116
10175
  if (props.sticky && props.stickyOffsetTop) {
10117
10176
  setRootScrollTop(getRootScrollTop() - props.stickyOffsetTop);
10118
10177
  }
@@ -10152,15 +10211,18 @@ var stdin_default$y = defineComponent({
10152
10211
  }
10153
10212
  };
10154
10213
  const renderSidebar = () => createVNode("div", {
10214
+ "ref": sidebar,
10155
10215
  "class": bem$t("sidebar"),
10156
10216
  "style": sidebarStyle.value,
10157
10217
  "onClick": onClickSidebar,
10158
- "onTouchstartPassive": touch.start,
10159
- "onTouchmove": onTouchMove
10218
+ "onTouchstartPassive": touch.start
10160
10219
  }, [renderIndexes()]);
10161
10220
  useExpose({
10162
10221
  scrollTo
10163
10222
  });
10223
+ useEventListener("touchmove", onTouchMove, {
10224
+ target: sidebar
10225
+ });
10164
10226
  return () => {
10165
10227
  var _a;
10166
10228
  return createVNode("div", {
@@ -11859,6 +11921,9 @@ var stdin_default$l = defineComponent({
11859
11921
  }, null)]);
11860
11922
  };
11861
11923
  useCustomFieldValue(() => props.modelValue);
11924
+ useEventListener("touchmove", onTouchMove, {
11925
+ target: groupRef
11926
+ });
11862
11927
  return () => createVNode("div", {
11863
11928
  "ref": groupRef,
11864
11929
  "role": "radiogroup",
@@ -11869,8 +11934,7 @@ var stdin_default$l = defineComponent({
11869
11934
  "tabindex": props.disabled ? void 0 : 0,
11870
11935
  "aria-disabled": props.disabled,
11871
11936
  "aria-readonly": props.readonly,
11872
- "onTouchstartPassive": onTouchStart,
11873
- "onTouchmove": onTouchMove
11937
+ "onTouchstartPassive": onTouchStart
11874
11938
  }, [list.value.map(renderStar)]);
11875
11939
  }
11876
11940
  });
@@ -12309,6 +12373,7 @@ var stdin_default$f = defineComponent({
12309
12373
  let current2;
12310
12374
  let startValue;
12311
12375
  const root = ref();
12376
+ const slider = ref();
12312
12377
  const dragStatus = ref();
12313
12378
  const touch = useTouch();
12314
12379
  const scope = computed(() => Number(props.max) - Number(props.min));
@@ -12501,6 +12566,7 @@ var stdin_default$f = defineComponent({
12501
12566
  const renderButton = (index) => {
12502
12567
  const current22 = typeof index === "number" ? props.modelValue[index] : props.modelValue;
12503
12568
  return createVNode("div", {
12569
+ "ref": slider,
12504
12570
  "role": "slider",
12505
12571
  "class": getButtonClassName(index),
12506
12572
  "tabindex": props.disabled ? void 0 : 0,
@@ -12516,7 +12582,6 @@ var stdin_default$f = defineComponent({
12516
12582
  }
12517
12583
  onTouchStart(event);
12518
12584
  },
12519
- "onTouchmove": onTouchMove,
12520
12585
  "onTouchend": onTouchEnd,
12521
12586
  "onTouchcancel": onTouchEnd,
12522
12587
  "onClick": stopPropagation
@@ -12524,6 +12589,9 @@ var stdin_default$f = defineComponent({
12524
12589
  };
12525
12590
  updateValue(props.modelValue);
12526
12591
  useCustomFieldValue(() => props.modelValue);
12592
+ useEventListener("touchmove", onTouchMove, {
12593
+ target: slider
12594
+ });
12527
12595
  return () => createVNode("div", {
12528
12596
  "ref": root,
12529
12597
  "style": wrapperStyle.value,
@@ -13248,6 +13316,9 @@ var stdin_default$9 = defineComponent({
13248
13316
  useClickAway(root, () => onClick("outside"), {
13249
13317
  eventName: "touchstart"
13250
13318
  });
13319
+ useEventListener("touchmove", onTouchMove, {
13320
+ target: root
13321
+ });
13251
13322
  return () => {
13252
13323
  var _a;
13253
13324
  const wrapperStyle = {
@@ -13259,7 +13330,6 @@ var stdin_default$9 = defineComponent({
13259
13330
  "class": bem$4(),
13260
13331
  "onClick": getClickHandler("cell", lockClick2),
13261
13332
  "onTouchstartPassive": onTouchStart,
13262
- "onTouchmove": onTouchMove,
13263
13333
  "onTouchend": onTouchEnd,
13264
13334
  "onTouchcancel": onTouchEnd
13265
13335
  }, [createVNode("div", {
@@ -13993,7 +14063,10 @@ function getBestSelectionFromSrcset(el, scale) {
13993
14063
  tmpWidth = 999998;
13994
14064
  } else {
13995
14065
  tmpSrc = item.substr(0, spaceIndex);
13996
- tmpWidth = parseInt(item.substr(spaceIndex + 1, item.length - spaceIndex - 2), 10);
14066
+ tmpWidth = parseInt(
14067
+ item.substr(spaceIndex + 1, item.length - spaceIndex - 2),
14068
+ 10
14069
+ );
13997
14070
  }
13998
14071
  return [tmpWidth, tmpSrc];
13999
14072
  });
@@ -14184,24 +14257,32 @@ class ReactiveListener {
14184
14257
  }
14185
14258
  renderLoading(cb) {
14186
14259
  this.state.loading = true;
14187
- loadImageAsync({
14188
- src: this.loading,
14189
- cors: this.cors
14190
- }, () => {
14191
- this.render("loading", false);
14192
- this.state.loading = false;
14193
- cb();
14194
- }, () => {
14195
- cb();
14196
- this.state.loading = false;
14197
- if (process.env.NODE_ENV !== "production" && !this.options.silent)
14198
- console.warn(`[@vant/lazyload] load failed with loading image(${this.loading})`);
14199
- });
14260
+ loadImageAsync(
14261
+ {
14262
+ src: this.loading,
14263
+ cors: this.cors
14264
+ },
14265
+ () => {
14266
+ this.render("loading", false);
14267
+ this.state.loading = false;
14268
+ cb();
14269
+ },
14270
+ () => {
14271
+ cb();
14272
+ this.state.loading = false;
14273
+ if (process.env.NODE_ENV !== "production" && !this.options.silent)
14274
+ console.warn(
14275
+ `[@vant/lazyload] load failed with loading image(${this.loading})`
14276
+ );
14277
+ }
14278
+ );
14200
14279
  }
14201
14280
  load(onFinish = noop) {
14202
14281
  if (this.attempt > this.options.attempt - 1 && this.state.error) {
14203
14282
  if (process.env.NODE_ENV !== "production" && !this.options.silent) {
14204
- console.log(`[@vant/lazyload] ${this.src} tried too more than ${this.options.attempt} times`);
14283
+ console.log(
14284
+ `[@vant/lazyload] ${this.src} tried too more than ${this.options.attempt} times`
14285
+ );
14205
14286
  }
14206
14287
  onFinish();
14207
14288
  return;
@@ -14219,25 +14300,29 @@ class ReactiveListener {
14219
14300
  this.attempt++;
14220
14301
  (_b = (_a = this.options.adapter).beforeLoad) == null ? void 0 : _b.call(_a, this, this.options);
14221
14302
  this.record("loadStart");
14222
- loadImageAsync({
14223
- src: this.src,
14224
- cors: this.cors
14225
- }, (data) => {
14226
- this.naturalHeight = data.naturalHeight;
14227
- this.naturalWidth = data.naturalWidth;
14228
- this.state.loaded = true;
14229
- this.state.error = false;
14230
- this.record("loadEnd");
14231
- this.render("loaded", false);
14232
- this.state.rendered = true;
14233
- this.imageCache.add(this.src);
14234
- onFinish();
14235
- }, (err) => {
14236
- !this.options.silent && console.error(err);
14237
- this.state.error = true;
14238
- this.state.loaded = false;
14239
- this.render("error", false);
14240
- });
14303
+ loadImageAsync(
14304
+ {
14305
+ src: this.src,
14306
+ cors: this.cors
14307
+ },
14308
+ (data) => {
14309
+ this.naturalHeight = data.naturalHeight;
14310
+ this.naturalWidth = data.naturalWidth;
14311
+ this.state.loaded = true;
14312
+ this.state.error = false;
14313
+ this.record("loadEnd");
14314
+ this.render("loaded", false);
14315
+ this.state.rendered = true;
14316
+ this.imageCache.add(this.src);
14317
+ onFinish();
14318
+ },
14319
+ (err) => {
14320
+ !this.options.silent && console.error(err);
14321
+ this.state.error = true;
14322
+ this.state.loaded = false;
14323
+ this.render("error", false);
14324
+ }
14325
+ );
14241
14326
  });
14242
14327
  }
14243
14328
  render(state, cache) {
@@ -14322,7 +14407,10 @@ function stdin_default$3() {
14322
14407
  };
14323
14408
  this.initEvent();
14324
14409
  this.imageCache = new ImageCache({ max: 200 });
14325
- this.lazyLoadHandler = throttle(this.lazyLoadHandler.bind(this), this.options.throttleWait);
14410
+ this.lazyLoadHandler = throttle(
14411
+ this.lazyLoadHandler.bind(this),
14412
+ this.options.throttleWait
14413
+ );
14326
14414
  this.setMode(this.options.observer ? modeType.observer : modeType.event);
14327
14415
  }
14328
14416
  config(options = {}) {
@@ -14477,7 +14565,9 @@ function stdin_default$3() {
14477
14565
  });
14478
14566
  }
14479
14567
  initListen(el, start) {
14480
- this.options.ListenEvents.forEach((evt) => (start ? on : off)(el, evt, this.lazyLoadHandler));
14568
+ this.options.ListenEvents.forEach(
14569
+ (evt) => (start ? on : off)(el, evt, this.lazyLoadHandler)
14570
+ );
14481
14571
  }
14482
14572
  initEvent() {
14483
14573
  this.Event = {
@@ -14534,7 +14624,10 @@ function stdin_default$3() {
14534
14624
  if (!hasIntersectionObserver) {
14535
14625
  return;
14536
14626
  }
14537
- this.observer = new IntersectionObserver(this.observerHandler.bind(this), this.options.observerOptions);
14627
+ this.observer = new IntersectionObserver(
14628
+ this.observerHandler.bind(this),
14629
+ this.options.observerOptions
14630
+ );
14538
14631
  if (this.listeners.length) {
14539
14632
  this.listeners.forEach((listener) => {
14540
14633
  this.observer.observe(listener.el);
@@ -14613,7 +14706,10 @@ var stdin_default$2 = (lazy) => ({
14613
14706
  },
14614
14707
  emits: ["show"],
14615
14708
  render() {
14616
- return h(this.tag, this.show && this.$slots.default ? this.$slots.default() : null);
14709
+ return h(
14710
+ this.tag,
14711
+ this.show && this.$slots.default ? this.$slots.default() : null
14712
+ );
14617
14713
  },
14618
14714
  data() {
14619
14715
  return {
@@ -14665,13 +14761,17 @@ class LazyContainer {
14665
14761
  this.options = Object.assign({}, defaultOptions, binding.value);
14666
14762
  const imgs = this.getImgs();
14667
14763
  imgs.forEach((el2) => {
14668
- this.lazy.add(el2, Object.assign({}, this.binding, {
14669
- value: {
14670
- src: "dataset" in el2 ? el2.dataset.src : el2.getAttribute("data-src"),
14671
- error: ("dataset" in el2 ? el2.dataset.error : el2.getAttribute("data-error")) || this.options.error,
14672
- loading: ("dataset" in el2 ? el2.dataset.loading : el2.getAttribute("data-loading")) || this.options.loading
14673
- }
14674
- }), this.vnode);
14764
+ this.lazy.add(
14765
+ el2,
14766
+ Object.assign({}, this.binding, {
14767
+ value: {
14768
+ src: "dataset" in el2 ? el2.dataset.src : el2.getAttribute("data-src"),
14769
+ error: ("dataset" in el2 ? el2.dataset.error : el2.getAttribute("data-error")) || this.options.error,
14770
+ loading: ("dataset" in el2 ? el2.dataset.loading : el2.getAttribute("data-loading")) || this.options.loading
14771
+ }
14772
+ }),
14773
+ this.vnode
14774
+ );
14675
14775
  });
14676
14776
  }
14677
14777
  getImgs() {
@@ -14722,11 +14822,15 @@ var stdin_default$1 = (lazyManager) => ({
14722
14822
  }
14723
14823
  },
14724
14824
  render(h2) {
14725
- return h2(this.tag, {
14726
- attrs: {
14727
- src: this.renderSrc
14728
- }
14729
- }, this.$slots.default);
14825
+ return h2(
14826
+ this.tag,
14827
+ {
14828
+ attrs: {
14829
+ src: this.renderSrc
14830
+ }
14831
+ },
14832
+ this.$slots.default
14833
+ );
14730
14834
  },
14731
14835
  data() {
14732
14836
  return {
@@ -14780,20 +14884,26 @@ var stdin_default$1 = (lazyManager) => ({
14780
14884
  load(onFinish = noop) {
14781
14885
  if (this.state.attempt > this.options.attempt - 1 && this.state.error) {
14782
14886
  if (process.env.NODE_ENV !== "production" && !lazyManager.options.silent) {
14783
- console.log(`[@vant/lazyload] ${this.options.src} tried too more than ${this.options.attempt} times`);
14887
+ console.log(
14888
+ `[@vant/lazyload] ${this.options.src} tried too more than ${this.options.attempt} times`
14889
+ );
14784
14890
  }
14785
14891
  onFinish();
14786
14892
  return;
14787
14893
  }
14788
14894
  const { src } = this.options;
14789
- loadImageAsync({ src }, ({ src: src2 }) => {
14790
- this.renderSrc = src2;
14791
- this.state.loaded = true;
14792
- }, () => {
14793
- this.state.attempt++;
14794
- this.renderSrc = this.options.error;
14795
- this.state.error = true;
14796
- });
14895
+ loadImageAsync(
14896
+ { src },
14897
+ ({ src: src2 }) => {
14898
+ this.renderSrc = src2;
14899
+ this.state.loaded = true;
14900
+ },
14901
+ () => {
14902
+ this.state.attempt++;
14903
+ this.renderSrc = this.options.error;
14904
+ this.state.error = true;
14905
+ }
14906
+ );
14797
14907
  }
14798
14908
  }
14799
14909
  });
@@ -14821,7 +14931,7 @@ const Lazyload = {
14821
14931
  });
14822
14932
  }
14823
14933
  };
14824
- const version = "3.6.1";
14934
+ const version = "3.6.2";
14825
14935
  function install(app) {
14826
14936
  const components = [
14827
14937
  ActionBar,