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.cjs.js CHANGED
@@ -332,9 +332,15 @@ function genBem(name2, mods) {
332
332
  return ` ${name2}--${mods}`;
333
333
  }
334
334
  if (Array.isArray(mods)) {
335
- return mods.reduce((ret, item) => ret + genBem(name2, item), "");
336
- }
337
- return Object.keys(mods).reduce((ret, key) => ret + (mods[key] ? genBem(name2, key) : ""), "");
335
+ return mods.reduce(
336
+ (ret, item) => ret + genBem(name2, item),
337
+ ""
338
+ );
339
+ }
340
+ return Object.keys(mods).reduce(
341
+ (ret, key) => ret + (mods[key] ? genBem(name2, key) : ""),
342
+ ""
343
+ );
338
344
  }
339
345
  function createBEM(name2) {
340
346
  return (el, mods) => {
@@ -390,8 +396,10 @@ function callInterceptor(interceptor, {
390
396
  function withInstall(options) {
391
397
  options.install = (app) => {
392
398
  const { name: name2 } = options;
393
- app.component(name2, options);
394
- app.component(camelize(`-${name2}`), options);
399
+ if (name2) {
400
+ app.component(name2, options);
401
+ app.component(camelize(`-${name2}`), options);
402
+ }
395
403
  };
396
404
  return options;
397
405
  }
@@ -1020,7 +1028,9 @@ const popupSharedProps = {
1020
1028
  transitionAppear: Boolean,
1021
1029
  closeOnClickOverlay: truthProp
1022
1030
  };
1023
- const popupSharedPropKeys = Object.keys(popupSharedProps);
1031
+ const popupSharedPropKeys = Object.keys(
1032
+ popupSharedProps
1033
+ );
1024
1034
  function getDirection(x, y) {
1025
1035
  if (x > y) {
1026
1036
  return "horizontal";
@@ -1087,7 +1097,10 @@ function useLockScroll(rootRef, shouldLock) {
1087
1097
  const onTouchMove = (event) => {
1088
1098
  touch.move(event);
1089
1099
  const direction = touch.deltaY.value > 0 ? DIRECTION_DOWN : DIRECTION_UP;
1090
- const el = use.getScrollParent(event.target, rootRef.value);
1100
+ const el = use.getScrollParent(
1101
+ event.target,
1102
+ rootRef.value
1103
+ );
1091
1104
  const { scrollHeight, offsetHeight, scrollTop } = el;
1092
1105
  let status = "11";
1093
1106
  if (scrollTop === 0) {
@@ -1128,11 +1141,15 @@ function useLockScroll(rootRef, shouldLock) {
1128
1141
  }
1129
1142
  function useLazyRender(show) {
1130
1143
  const inited = vue.ref(false);
1131
- vue.watch(show, (value) => {
1132
- if (value) {
1133
- inited.value = value;
1134
- }
1135
- }, { immediate: true });
1144
+ vue.watch(
1145
+ show,
1146
+ (value) => {
1147
+ if (value) {
1148
+ inited.value = value;
1149
+ }
1150
+ },
1151
+ { immediate: true }
1152
+ );
1136
1153
  return (render) => () => inited.value ? render() : null;
1137
1154
  }
1138
1155
  const [name$1n, bem$1j] = createNamespace("overlay");
@@ -1151,9 +1168,12 @@ var stdin_default$1u = vue.defineComponent({
1151
1168
  setup(props, {
1152
1169
  slots
1153
1170
  }) {
1171
+ const root = vue.ref();
1154
1172
  const lazyRender = useLazyRender(() => props.show || !props.lazyRender);
1155
- const preventTouchMove = (event) => {
1156
- preventDefault(event, true);
1173
+ const onTouchMove = (event) => {
1174
+ if (props.lockScroll) {
1175
+ preventDefault(event, true);
1176
+ }
1157
1177
  };
1158
1178
  const renderOverlay = lazyRender(() => {
1159
1179
  var _a;
@@ -1162,11 +1182,14 @@ var stdin_default$1u = vue.defineComponent({
1162
1182
  style.animationDuration = `${props.duration}s`;
1163
1183
  }
1164
1184
  return vue.withDirectives(vue.createVNode("div", {
1185
+ "ref": root,
1165
1186
  "style": style,
1166
- "class": [bem$1j(), props.className],
1167
- "onTouchmove": props.lockScroll ? preventTouchMove : noop
1187
+ "class": [bem$1j(), props.className]
1168
1188
  }, [(_a = slots.default) == null ? void 0 : _a.call(slots)]), [[vue.vShow, props.show]]);
1169
1189
  });
1190
+ use.useEventListener("touchmove", onTouchMove, {
1191
+ target: root
1192
+ });
1170
1193
  return () => vue.createVNode(vue.Transition, {
1171
1194
  "name": "van-fade",
1172
1195
  "appear": true
@@ -1542,6 +1565,7 @@ var stdin_default$1r = vue.defineComponent({
1542
1565
  let touchStartTime;
1543
1566
  let momentumOffset;
1544
1567
  let transitionEndTrigger;
1568
+ const root = vue.ref();
1545
1569
  const wrapper = vue.ref();
1546
1570
  const state = vue.reactive({
1547
1571
  index: props.defaultIndex,
@@ -1717,10 +1741,13 @@ var stdin_default$1r = vue.defineComponent({
1717
1741
  });
1718
1742
  vue.watch(() => props.initialOptions, setOptions);
1719
1743
  vue.watch(() => props.defaultIndex, (value) => setIndex(value));
1744
+ use.useEventListener("touchmove", onTouchMove, {
1745
+ target: root
1746
+ });
1720
1747
  return () => vue.createVNode("div", {
1748
+ "ref": root,
1721
1749
  "class": [bem$1g(), props.className],
1722
1750
  "onTouchstartPassive": onTouchStart,
1723
- "onTouchmove": onTouchMove,
1724
1751
  "onTouchend": onTouchEnd,
1725
1752
  "onTouchcancel": onTouchEnd
1726
1753
  }, [vue.createVNode("ul", {
@@ -1772,6 +1799,7 @@ var stdin_default$1q = vue.defineComponent({
1772
1799
  }
1773
1800
  }
1774
1801
  const hasOptions = vue.ref(false);
1802
+ const columnsRef = vue.ref();
1775
1803
  const formattedColumns = vue.ref([]);
1776
1804
  const columnsFieldNames = vue.computed(() => {
1777
1805
  const {
@@ -2008,14 +2036,17 @@ var stdin_default$1q = vue.defineComponent({
2008
2036
  height: `${wrapHeight}px`
2009
2037
  };
2010
2038
  return vue.createVNode("div", {
2039
+ "ref": columnsRef,
2011
2040
  "class": bem$1f("columns"),
2012
- "style": columnsStyle,
2013
- "onTouchmove": preventDefault
2041
+ "style": columnsStyle
2014
2042
  }, [renderColumnItems(), renderMask(wrapHeight)]);
2015
2043
  };
2016
2044
  vue.watch(() => props.columns, format2, {
2017
2045
  immediate: true
2018
2046
  });
2047
+ use.useEventListener("touchmove", preventDefault, {
2048
+ target: columnsRef
2049
+ });
2019
2050
  useExpose({
2020
2051
  confirm,
2021
2052
  getValues,
@@ -2693,6 +2724,7 @@ var stdin_default$1m = vue.defineComponent({
2693
2724
  validateMessage: ""
2694
2725
  });
2695
2726
  const inputRef = vue.ref();
2727
+ const clearIconRef = vue.ref();
2696
2728
  const customValue = vue.ref();
2697
2729
  const {
2698
2730
  parent: form
@@ -3008,9 +3040,9 @@ var stdin_default$1m = vue.defineComponent({
3008
3040
  const renderFieldBody = () => [vue.createVNode("div", {
3009
3041
  "class": bem$1b("body")
3010
3042
  }, [renderInput(), showClear.value && vue.createVNode(Icon, {
3043
+ "ref": clearIconRef,
3011
3044
  "name": props.clearIcon,
3012
- "class": bem$1b("clear"),
3013
- "onTouchstart": onClear
3045
+ "class": bem$1b("clear")
3014
3046
  }, null), renderRightIcon(), slots.button && vue.createVNode("div", {
3015
3047
  "class": bem$1b("button")
3016
3048
  }, [slots.button()])]), renderWordLimit(), renderMessage()];
@@ -3037,6 +3069,12 @@ var stdin_default$1m = vue.defineComponent({
3037
3069
  updateValue(getModelValue(), props.formatTrigger);
3038
3070
  vue.nextTick(adjustTextareaSize);
3039
3071
  });
3072
+ use.useEventListener("touchstart", onClear, {
3073
+ target: vue.computed(() => {
3074
+ var _a;
3075
+ return (_a = clearIconRef.value) == null ? void 0 : _a.$el;
3076
+ })
3077
+ });
3040
3078
  return () => {
3041
3079
  const disabled = getProp("disabled");
3042
3080
  const labelAlign = getProp("labelAlign");
@@ -4757,7 +4795,8 @@ var stdin_default$18 = vue.defineComponent({
4757
4795
  const {
4758
4796
  type,
4759
4797
  minDate,
4760
- maxDate
4798
+ maxDate,
4799
+ allowSameDay
4761
4800
  } = props;
4762
4801
  if (defaultDate === null) {
4763
4802
  return defaultDate;
@@ -4767,8 +4806,8 @@ var stdin_default$18 = vue.defineComponent({
4767
4806
  if (!Array.isArray(defaultDate)) {
4768
4807
  defaultDate = [];
4769
4808
  }
4770
- const start = limitDateRange(defaultDate[0] || now, minDate, getPrevDay(maxDate));
4771
- const end = limitDateRange(defaultDate[1] || now, getNextDay(minDate));
4809
+ const start = limitDateRange(defaultDate[0] || now, minDate, allowSameDay ? maxDate : getPrevDay(maxDate));
4810
+ const end = limitDateRange(defaultDate[1] || now, allowSameDay ? minDate : getNextDay(minDate));
4772
4811
  return [start, end];
4773
4812
  }
4774
4813
  if (type === "multiple") {
@@ -5377,9 +5416,12 @@ function useVisibilityChange(target, onChange) {
5377
5416
  if (!inBrowser || !window.IntersectionObserver) {
5378
5417
  return;
5379
5418
  }
5380
- const observer = new IntersectionObserver((entries) => {
5381
- onChange(entries[0].intersectionRatio > 0);
5382
- }, { root: document.body });
5419
+ const observer = new IntersectionObserver(
5420
+ (entries) => {
5421
+ onChange(entries[0].intersectionRatio > 0);
5422
+ },
5423
+ { root: document.body }
5424
+ );
5383
5425
  const observe = () => {
5384
5426
  if (target.value) {
5385
5427
  observer.observe(target.value);
@@ -5615,6 +5657,7 @@ var stdin_default$13 = vue.defineComponent({
5615
5657
  slots
5616
5658
  }) {
5617
5659
  const root = vue.ref();
5660
+ const track = vue.ref();
5618
5661
  const state = vue.reactive({
5619
5662
  rect: null,
5620
5663
  width: 0,
@@ -5801,10 +5844,13 @@ var stdin_default$13 = vue.defineComponent({
5801
5844
  if (props.touchable && state.swiping) {
5802
5845
  touch.move(event);
5803
5846
  if (isCorrectDirection.value) {
5804
- preventDefault(event, props.stopPropagation);
5805
- move({
5806
- offset: delta.value
5807
- });
5847
+ const isEdgeTouch = !props.loop && (state.active === 0 && delta.value > 0 || state.active === count.value - 1 && delta.value < 0);
5848
+ if (!isEdgeTouch) {
5849
+ preventDefault(event, props.stopPropagation);
5850
+ move({
5851
+ offset: delta.value
5852
+ });
5853
+ }
5808
5854
  }
5809
5855
  }
5810
5856
  };
@@ -5914,18 +5960,21 @@ var stdin_default$13 = vue.defineComponent({
5914
5960
  onPopupReopen(() => initialize(state.active));
5915
5961
  vue.onDeactivated(stopAutoplay);
5916
5962
  vue.onBeforeUnmount(stopAutoplay);
5963
+ use.useEventListener("touchmove", onTouchMove, {
5964
+ target: track
5965
+ });
5917
5966
  return () => {
5918
5967
  var _a;
5919
5968
  return vue.createVNode("div", {
5920
5969
  "ref": root,
5921
5970
  "class": bem$Y()
5922
5971
  }, [vue.createVNode("div", {
5972
+ "ref": track,
5923
5973
  "style": trackStyle.value,
5924
5974
  "class": bem$Y("track", {
5925
5975
  vertical: props.vertical
5926
5976
  }),
5927
5977
  "onTouchstartPassive": onTouchStart,
5928
- "onTouchmove": onTouchMove,
5929
5978
  "onTouchend": onTouchEnd,
5930
5979
  "onTouchcancel": onTouchEnd
5931
5980
  }, [(_a = slots.default) == null ? void 0 : _a.call(slots)]), renderIndicator()]);
@@ -7738,7 +7787,9 @@ var stdin_default$O = vue.defineComponent({
7738
7787
  const CountDown = withInstall(stdin_default$O);
7739
7788
  function getDate(timeStamp) {
7740
7789
  const date = new Date(timeStamp * 1e3);
7741
- return `${date.getFullYear()}.${padZero(date.getMonth() + 1)}.${padZero(date.getDate())}`;
7790
+ return `${date.getFullYear()}.${padZero(date.getMonth() + 1)}.${padZero(
7791
+ date.getDate()
7792
+ )}`;
7742
7793
  }
7743
7794
  const formatDiscount = (discount) => (discount / 10).toFixed(discount % 10 === 0 ? 0 : 1);
7744
7795
  const formatAmount = (amount) => (amount / 100).toFixed(amount % 100 === 0 ? 0 : amount % 10 === 0 ? 1 : 2);
@@ -9543,6 +9594,7 @@ var stdin_default$A = vue.defineComponent({
9543
9594
  displayHeight: 0
9544
9595
  });
9545
9596
  const touch = useTouch();
9597
+ const swipeItem = vue.ref();
9546
9598
  const vertical = vue.computed(() => {
9547
9599
  const {
9548
9600
  rootWidth,
@@ -9728,6 +9780,12 @@ var stdin_default$A = vue.defineComponent({
9728
9780
  resetScale();
9729
9781
  }
9730
9782
  });
9783
+ use.useEventListener("touchmove", onTouchMove, {
9784
+ target: vue.computed(() => {
9785
+ var _a;
9786
+ return (_a = swipeItem.value) == null ? void 0 : _a.$el;
9787
+ })
9788
+ });
9731
9789
  return () => {
9732
9790
  const imageSlots = {
9733
9791
  loading: () => vue.createVNode(Loading, {
@@ -9735,9 +9793,9 @@ var stdin_default$A = vue.defineComponent({
9735
9793
  }, null)
9736
9794
  };
9737
9795
  return vue.createVNode(SwipeItem, {
9796
+ "ref": swipeItem,
9738
9797
  "class": bem$v("swipe-item"),
9739
9798
  "onTouchstartPassive": onTouchStart,
9740
- "onTouchmove": onTouchMove,
9741
9799
  "onTouchend": onTouchEnd,
9742
9800
  "onTouchcancel": onTouchEnd
9743
9801
  }, {
@@ -9991,6 +10049,7 @@ var stdin_default$y = vue.defineComponent({
9991
10049
  slots
9992
10050
  }) {
9993
10051
  const root = vue.ref();
10052
+ const sidebar = vue.ref();
9994
10053
  const activeAnchor = vue.ref("");
9995
10054
  const touch = useTouch();
9996
10055
  const scrollParent = use.useScrollParent(root);
@@ -10110,11 +10169,11 @@ var stdin_default$y = vue.defineComponent({
10110
10169
  const {
10111
10170
  offsetHeight
10112
10171
  } = document.documentElement;
10172
+ match.$el.scrollIntoView();
10113
10173
  if (scrollTop === offsetHeight - scrollParentRect.height) {
10114
10174
  onScroll();
10115
10175
  return;
10116
10176
  }
10117
- match.$el.scrollIntoView();
10118
10177
  if (props.sticky && props.stickyOffsetTop) {
10119
10178
  setRootScrollTop(getRootScrollTop() - props.stickyOffsetTop);
10120
10179
  }
@@ -10154,15 +10213,18 @@ var stdin_default$y = vue.defineComponent({
10154
10213
  }
10155
10214
  };
10156
10215
  const renderSidebar = () => vue.createVNode("div", {
10216
+ "ref": sidebar,
10157
10217
  "class": bem$t("sidebar"),
10158
10218
  "style": sidebarStyle.value,
10159
10219
  "onClick": onClickSidebar,
10160
- "onTouchstartPassive": touch.start,
10161
- "onTouchmove": onTouchMove
10220
+ "onTouchstartPassive": touch.start
10162
10221
  }, [renderIndexes()]);
10163
10222
  useExpose({
10164
10223
  scrollTo
10165
10224
  });
10225
+ use.useEventListener("touchmove", onTouchMove, {
10226
+ target: sidebar
10227
+ });
10166
10228
  return () => {
10167
10229
  var _a;
10168
10230
  return vue.createVNode("div", {
@@ -11861,6 +11923,9 @@ var stdin_default$l = vue.defineComponent({
11861
11923
  }, null)]);
11862
11924
  };
11863
11925
  use.useCustomFieldValue(() => props.modelValue);
11926
+ use.useEventListener("touchmove", onTouchMove, {
11927
+ target: groupRef
11928
+ });
11864
11929
  return () => vue.createVNode("div", {
11865
11930
  "ref": groupRef,
11866
11931
  "role": "radiogroup",
@@ -11871,8 +11936,7 @@ var stdin_default$l = vue.defineComponent({
11871
11936
  "tabindex": props.disabled ? void 0 : 0,
11872
11937
  "aria-disabled": props.disabled,
11873
11938
  "aria-readonly": props.readonly,
11874
- "onTouchstartPassive": onTouchStart,
11875
- "onTouchmove": onTouchMove
11939
+ "onTouchstartPassive": onTouchStart
11876
11940
  }, [list.value.map(renderStar)]);
11877
11941
  }
11878
11942
  });
@@ -12311,6 +12375,7 @@ var stdin_default$f = vue.defineComponent({
12311
12375
  let current2;
12312
12376
  let startValue;
12313
12377
  const root = vue.ref();
12378
+ const slider = vue.ref();
12314
12379
  const dragStatus = vue.ref();
12315
12380
  const touch = useTouch();
12316
12381
  const scope = vue.computed(() => Number(props.max) - Number(props.min));
@@ -12503,6 +12568,7 @@ var stdin_default$f = vue.defineComponent({
12503
12568
  const renderButton = (index) => {
12504
12569
  const current22 = typeof index === "number" ? props.modelValue[index] : props.modelValue;
12505
12570
  return vue.createVNode("div", {
12571
+ "ref": slider,
12506
12572
  "role": "slider",
12507
12573
  "class": getButtonClassName(index),
12508
12574
  "tabindex": props.disabled ? void 0 : 0,
@@ -12518,7 +12584,6 @@ var stdin_default$f = vue.defineComponent({
12518
12584
  }
12519
12585
  onTouchStart(event);
12520
12586
  },
12521
- "onTouchmove": onTouchMove,
12522
12587
  "onTouchend": onTouchEnd,
12523
12588
  "onTouchcancel": onTouchEnd,
12524
12589
  "onClick": stopPropagation
@@ -12526,6 +12591,9 @@ var stdin_default$f = vue.defineComponent({
12526
12591
  };
12527
12592
  updateValue(props.modelValue);
12528
12593
  use.useCustomFieldValue(() => props.modelValue);
12594
+ use.useEventListener("touchmove", onTouchMove, {
12595
+ target: slider
12596
+ });
12529
12597
  return () => vue.createVNode("div", {
12530
12598
  "ref": root,
12531
12599
  "style": wrapperStyle.value,
@@ -13250,6 +13318,9 @@ var stdin_default$9 = vue.defineComponent({
13250
13318
  use.useClickAway(root, () => onClick("outside"), {
13251
13319
  eventName: "touchstart"
13252
13320
  });
13321
+ use.useEventListener("touchmove", onTouchMove, {
13322
+ target: root
13323
+ });
13253
13324
  return () => {
13254
13325
  var _a;
13255
13326
  const wrapperStyle = {
@@ -13261,7 +13332,6 @@ var stdin_default$9 = vue.defineComponent({
13261
13332
  "class": bem$4(),
13262
13333
  "onClick": getClickHandler("cell", lockClick2),
13263
13334
  "onTouchstartPassive": onTouchStart,
13264
- "onTouchmove": onTouchMove,
13265
13335
  "onTouchend": onTouchEnd,
13266
13336
  "onTouchcancel": onTouchEnd
13267
13337
  }, [vue.createVNode("div", {
@@ -13995,7 +14065,10 @@ function getBestSelectionFromSrcset(el, scale) {
13995
14065
  tmpWidth = 999998;
13996
14066
  } else {
13997
14067
  tmpSrc = item.substr(0, spaceIndex);
13998
- tmpWidth = parseInt(item.substr(spaceIndex + 1, item.length - spaceIndex - 2), 10);
14068
+ tmpWidth = parseInt(
14069
+ item.substr(spaceIndex + 1, item.length - spaceIndex - 2),
14070
+ 10
14071
+ );
13999
14072
  }
14000
14073
  return [tmpWidth, tmpSrc];
14001
14074
  });
@@ -14186,24 +14259,32 @@ class ReactiveListener {
14186
14259
  }
14187
14260
  renderLoading(cb) {
14188
14261
  this.state.loading = true;
14189
- loadImageAsync({
14190
- src: this.loading,
14191
- cors: this.cors
14192
- }, () => {
14193
- this.render("loading", false);
14194
- this.state.loading = false;
14195
- cb();
14196
- }, () => {
14197
- cb();
14198
- this.state.loading = false;
14199
- if (process.env.NODE_ENV !== "production" && !this.options.silent)
14200
- console.warn(`[@vant/lazyload] load failed with loading image(${this.loading})`);
14201
- });
14262
+ loadImageAsync(
14263
+ {
14264
+ src: this.loading,
14265
+ cors: this.cors
14266
+ },
14267
+ () => {
14268
+ this.render("loading", false);
14269
+ this.state.loading = false;
14270
+ cb();
14271
+ },
14272
+ () => {
14273
+ cb();
14274
+ this.state.loading = false;
14275
+ if (process.env.NODE_ENV !== "production" && !this.options.silent)
14276
+ console.warn(
14277
+ `[@vant/lazyload] load failed with loading image(${this.loading})`
14278
+ );
14279
+ }
14280
+ );
14202
14281
  }
14203
14282
  load(onFinish = noop) {
14204
14283
  if (this.attempt > this.options.attempt - 1 && this.state.error) {
14205
14284
  if (process.env.NODE_ENV !== "production" && !this.options.silent) {
14206
- console.log(`[@vant/lazyload] ${this.src} tried too more than ${this.options.attempt} times`);
14285
+ console.log(
14286
+ `[@vant/lazyload] ${this.src} tried too more than ${this.options.attempt} times`
14287
+ );
14207
14288
  }
14208
14289
  onFinish();
14209
14290
  return;
@@ -14221,25 +14302,29 @@ class ReactiveListener {
14221
14302
  this.attempt++;
14222
14303
  (_b = (_a = this.options.adapter).beforeLoad) == null ? void 0 : _b.call(_a, this, this.options);
14223
14304
  this.record("loadStart");
14224
- loadImageAsync({
14225
- src: this.src,
14226
- cors: this.cors
14227
- }, (data) => {
14228
- this.naturalHeight = data.naturalHeight;
14229
- this.naturalWidth = data.naturalWidth;
14230
- this.state.loaded = true;
14231
- this.state.error = false;
14232
- this.record("loadEnd");
14233
- this.render("loaded", false);
14234
- this.state.rendered = true;
14235
- this.imageCache.add(this.src);
14236
- onFinish();
14237
- }, (err) => {
14238
- !this.options.silent && console.error(err);
14239
- this.state.error = true;
14240
- this.state.loaded = false;
14241
- this.render("error", false);
14242
- });
14305
+ loadImageAsync(
14306
+ {
14307
+ src: this.src,
14308
+ cors: this.cors
14309
+ },
14310
+ (data) => {
14311
+ this.naturalHeight = data.naturalHeight;
14312
+ this.naturalWidth = data.naturalWidth;
14313
+ this.state.loaded = true;
14314
+ this.state.error = false;
14315
+ this.record("loadEnd");
14316
+ this.render("loaded", false);
14317
+ this.state.rendered = true;
14318
+ this.imageCache.add(this.src);
14319
+ onFinish();
14320
+ },
14321
+ (err) => {
14322
+ !this.options.silent && console.error(err);
14323
+ this.state.error = true;
14324
+ this.state.loaded = false;
14325
+ this.render("error", false);
14326
+ }
14327
+ );
14243
14328
  });
14244
14329
  }
14245
14330
  render(state, cache) {
@@ -14324,7 +14409,10 @@ function stdin_default$3() {
14324
14409
  };
14325
14410
  this.initEvent();
14326
14411
  this.imageCache = new ImageCache({ max: 200 });
14327
- this.lazyLoadHandler = throttle(this.lazyLoadHandler.bind(this), this.options.throttleWait);
14412
+ this.lazyLoadHandler = throttle(
14413
+ this.lazyLoadHandler.bind(this),
14414
+ this.options.throttleWait
14415
+ );
14328
14416
  this.setMode(this.options.observer ? modeType.observer : modeType.event);
14329
14417
  }
14330
14418
  config(options = {}) {
@@ -14479,7 +14567,9 @@ function stdin_default$3() {
14479
14567
  });
14480
14568
  }
14481
14569
  initListen(el, start) {
14482
- this.options.ListenEvents.forEach((evt) => (start ? on : off)(el, evt, this.lazyLoadHandler));
14570
+ this.options.ListenEvents.forEach(
14571
+ (evt) => (start ? on : off)(el, evt, this.lazyLoadHandler)
14572
+ );
14483
14573
  }
14484
14574
  initEvent() {
14485
14575
  this.Event = {
@@ -14536,7 +14626,10 @@ function stdin_default$3() {
14536
14626
  if (!hasIntersectionObserver) {
14537
14627
  return;
14538
14628
  }
14539
- this.observer = new IntersectionObserver(this.observerHandler.bind(this), this.options.observerOptions);
14629
+ this.observer = new IntersectionObserver(
14630
+ this.observerHandler.bind(this),
14631
+ this.options.observerOptions
14632
+ );
14540
14633
  if (this.listeners.length) {
14541
14634
  this.listeners.forEach((listener) => {
14542
14635
  this.observer.observe(listener.el);
@@ -14615,7 +14708,10 @@ var stdin_default$2 = (lazy) => ({
14615
14708
  },
14616
14709
  emits: ["show"],
14617
14710
  render() {
14618
- return vue.h(this.tag, this.show && this.$slots.default ? this.$slots.default() : null);
14711
+ return vue.h(
14712
+ this.tag,
14713
+ this.show && this.$slots.default ? this.$slots.default() : null
14714
+ );
14619
14715
  },
14620
14716
  data() {
14621
14717
  return {
@@ -14667,13 +14763,17 @@ class LazyContainer {
14667
14763
  this.options = Object.assign({}, defaultOptions, binding.value);
14668
14764
  const imgs = this.getImgs();
14669
14765
  imgs.forEach((el2) => {
14670
- this.lazy.add(el2, Object.assign({}, this.binding, {
14671
- value: {
14672
- src: "dataset" in el2 ? el2.dataset.src : el2.getAttribute("data-src"),
14673
- error: ("dataset" in el2 ? el2.dataset.error : el2.getAttribute("data-error")) || this.options.error,
14674
- loading: ("dataset" in el2 ? el2.dataset.loading : el2.getAttribute("data-loading")) || this.options.loading
14675
- }
14676
- }), this.vnode);
14766
+ this.lazy.add(
14767
+ el2,
14768
+ Object.assign({}, this.binding, {
14769
+ value: {
14770
+ src: "dataset" in el2 ? el2.dataset.src : el2.getAttribute("data-src"),
14771
+ error: ("dataset" in el2 ? el2.dataset.error : el2.getAttribute("data-error")) || this.options.error,
14772
+ loading: ("dataset" in el2 ? el2.dataset.loading : el2.getAttribute("data-loading")) || this.options.loading
14773
+ }
14774
+ }),
14775
+ this.vnode
14776
+ );
14677
14777
  });
14678
14778
  }
14679
14779
  getImgs() {
@@ -14724,11 +14824,15 @@ var stdin_default$1 = (lazyManager) => ({
14724
14824
  }
14725
14825
  },
14726
14826
  render(h) {
14727
- return h(this.tag, {
14728
- attrs: {
14729
- src: this.renderSrc
14730
- }
14731
- }, this.$slots.default);
14827
+ return h(
14828
+ this.tag,
14829
+ {
14830
+ attrs: {
14831
+ src: this.renderSrc
14832
+ }
14833
+ },
14834
+ this.$slots.default
14835
+ );
14732
14836
  },
14733
14837
  data() {
14734
14838
  return {
@@ -14782,20 +14886,26 @@ var stdin_default$1 = (lazyManager) => ({
14782
14886
  load(onFinish = noop) {
14783
14887
  if (this.state.attempt > this.options.attempt - 1 && this.state.error) {
14784
14888
  if (process.env.NODE_ENV !== "production" && !lazyManager.options.silent) {
14785
- console.log(`[@vant/lazyload] ${this.options.src} tried too more than ${this.options.attempt} times`);
14889
+ console.log(
14890
+ `[@vant/lazyload] ${this.options.src} tried too more than ${this.options.attempt} times`
14891
+ );
14786
14892
  }
14787
14893
  onFinish();
14788
14894
  return;
14789
14895
  }
14790
14896
  const { src } = this.options;
14791
- loadImageAsync({ src }, ({ src: src2 }) => {
14792
- this.renderSrc = src2;
14793
- this.state.loaded = true;
14794
- }, () => {
14795
- this.state.attempt++;
14796
- this.renderSrc = this.options.error;
14797
- this.state.error = true;
14798
- });
14897
+ loadImageAsync(
14898
+ { src },
14899
+ ({ src: src2 }) => {
14900
+ this.renderSrc = src2;
14901
+ this.state.loaded = true;
14902
+ },
14903
+ () => {
14904
+ this.state.attempt++;
14905
+ this.renderSrc = this.options.error;
14906
+ this.state.error = true;
14907
+ }
14908
+ );
14799
14909
  }
14800
14910
  }
14801
14911
  });
@@ -14823,7 +14933,7 @@ const Lazyload = {
14823
14933
  });
14824
14934
  }
14825
14935
  };
14826
- const version = "3.6.1";
14936
+ const version = "3.6.2";
14827
14937
  function install(app) {
14828
14938
  const components = [
14829
14939
  ActionBar,