vant 3.6.1 → 3.6.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 (315) hide show
  1. package/README.md +4 -5
  2. package/changelog.generated.md +33 -43
  3. package/es/action-bar/ActionBar.d.ts +1 -1
  4. package/es/action-bar/index.d.ts +1 -1
  5. package/es/action-bar-button/ActionBarButton.d.ts +1 -1
  6. package/es/action-bar-button/index.d.ts +1 -1
  7. package/es/action-bar-icon/ActionBarIcon.d.ts +1 -1
  8. package/es/action-bar-icon/index.d.ts +1 -1
  9. package/es/badge/Badge.d.ts +1 -1
  10. package/es/badge/index.d.ts +1 -1
  11. package/es/calendar/Calendar.mjs +4 -3
  12. package/es/cell/Cell.d.ts +1 -1
  13. package/es/cell/index.d.ts +1 -1
  14. package/es/cell-group/CellGroup.d.ts +1 -1
  15. package/es/cell-group/index.d.ts +1 -1
  16. package/es/col/Col.d.ts +1 -1
  17. package/es/col/index.d.ts +1 -1
  18. package/es/collapse-item/CollapseItem.d.ts +1 -1
  19. package/es/collapse-item/index.d.ts +1 -1
  20. package/es/composables/use-lazy-render.mjs +9 -5
  21. package/es/composables/use-lock-scroll.mjs +4 -1
  22. package/es/composables/use-visibility-change.mjs +6 -3
  23. package/es/config-provider/ConfigProvider.d.ts +1 -1
  24. package/es/config-provider/index.d.ts +1 -1
  25. package/es/coupon/Coupon.d.ts +1 -1
  26. package/es/coupon/index.d.ts +1 -1
  27. package/es/coupon/utils.mjs +3 -1
  28. package/es/coupon-cell/CouponCell.d.ts +1 -1
  29. package/es/coupon-cell/index.d.ts +1 -1
  30. package/es/datetime-picker/DatetimePicker.d.ts +1 -1
  31. package/es/datetime-picker/index.d.ts +1 -1
  32. package/es/dialog/index.css +1 -1
  33. package/es/dialog/index.less +4 -0
  34. package/es/dialog/types.d.ts +1 -1
  35. package/es/divider/Divider.d.ts +1 -1
  36. package/es/divider/index.d.ts +1 -1
  37. package/es/dropdown-item/DropdownItem.d.ts +2 -2
  38. package/es/dropdown-item/index.d.ts +2 -2
  39. package/es/dropdown-menu/DropdownMenu.d.ts +1 -1
  40. package/es/dropdown-menu/index.d.ts +1 -1
  41. package/es/empty/Empty.d.ts +1 -1
  42. package/es/empty/index.d.ts +1 -1
  43. package/es/field/Field.mjs +10 -3
  44. package/es/grid/Grid.d.ts +1 -1
  45. package/es/grid/index.d.ts +1 -1
  46. package/es/grid-item/GridItem.d.ts +1 -1
  47. package/es/grid-item/index.d.ts +1 -1
  48. package/es/icon/Icon.d.ts +1 -1
  49. package/es/icon/index.d.ts +1 -1
  50. package/es/image/Image.d.ts +4 -0
  51. package/es/image/Image.mjs +3 -1
  52. package/es/image/index.css +1 -1
  53. package/es/image/index.d.ts +3 -0
  54. package/es/image/index.less +4 -0
  55. package/es/image-preview/ImagePreviewItem.mjs +10 -2
  56. package/es/index-anchor/IndexAnchor.d.ts +1 -1
  57. package/es/index-anchor/index.d.ts +1 -1
  58. package/es/index-bar/IndexBar.mjs +7 -3
  59. package/es/index.d.ts +1 -1
  60. package/es/index.mjs +1 -1
  61. package/es/lazyload/vue-lazyload/lazy-component.mjs +4 -1
  62. package/es/lazyload/vue-lazyload/lazy-container.mjs +11 -7
  63. package/es/lazyload/vue-lazyload/lazy-image.mjs +24 -14
  64. package/es/lazyload/vue-lazyload/lazy.mjs +11 -3
  65. package/es/lazyload/vue-lazyload/listener.mjs +45 -33
  66. package/es/lazyload/vue-lazyload/util.mjs +4 -1
  67. package/es/loading/Loading.d.ts +1 -1
  68. package/es/loading/index.d.ts +1 -1
  69. package/es/number-keyboard/NumberKeyboard.d.ts +1 -1
  70. package/es/number-keyboard/index.d.ts +1 -1
  71. package/es/overlay/Overlay.d.ts +1 -1
  72. package/es/overlay/Overlay.mjs +13 -6
  73. package/es/overlay/index.d.ts +1 -1
  74. package/es/picker/Picker.mjs +7 -3
  75. package/es/picker/PickerColumn.mjs +6 -2
  76. package/es/popup/Popup.d.ts +2 -2
  77. package/es/popup/index.d.ts +2 -2
  78. package/es/popup/shared.mjs +3 -1
  79. package/es/progress/Progress.d.ts +1 -1
  80. package/es/progress/index.d.ts +1 -1
  81. package/es/rate/Rate.mjs +5 -3
  82. package/es/row/Row.d.ts +1 -1
  83. package/es/row/index.d.ts +1 -1
  84. package/es/skeleton/Skeleton.d.ts +1 -1
  85. package/es/skeleton/index.d.ts +1 -1
  86. package/es/slider/Slider.mjs +6 -2
  87. package/es/space/Space.d.ts +1 -1
  88. package/es/space/index.d.ts +1 -1
  89. package/es/step/Step.d.ts +1 -1
  90. package/es/step/index.d.ts +1 -1
  91. package/es/swipe/Swipe.mjs +13 -6
  92. package/es/swipe-cell/SwipeCell.d.ts +2 -2
  93. package/es/swipe-cell/SwipeCell.mjs +4 -2
  94. package/es/swipe-cell/index.d.ts +2 -2
  95. package/es/swipe-item/SwipeItem.d.ts +1 -1
  96. package/es/swipe-item/index.d.ts +1 -1
  97. package/es/tab/Tab.d.ts +1 -1
  98. package/es/tab/Tab.mjs +12 -2
  99. package/es/tab/index.d.ts +1 -1
  100. package/es/tabs/Tabs.d.ts +1 -1
  101. package/es/tabs/Tabs.mjs +11 -11
  102. package/es/tabs/TabsTitle.d.ts +1 -1
  103. package/es/tabs/index.d.ts +1 -1
  104. package/es/utils/basic.mjs +2 -1
  105. package/es/utils/create.mjs +8 -2
  106. package/es/utils/with-install.d.ts +2 -2
  107. package/es/utils/with-install.mjs +4 -2
  108. package/lib/action-bar/ActionBar.d.ts +1 -1
  109. package/lib/action-bar/index.d.ts +1 -1
  110. package/lib/action-bar/index.js +4 -1
  111. package/lib/action-bar-button/ActionBarButton.d.ts +1 -1
  112. package/lib/action-bar-button/index.d.ts +1 -1
  113. package/lib/action-bar-button/index.js +4 -1
  114. package/lib/action-bar-icon/ActionBarIcon.d.ts +1 -1
  115. package/lib/action-bar-icon/index.d.ts +1 -1
  116. package/lib/action-bar-icon/index.js +4 -1
  117. package/lib/action-sheet/index.js +4 -1
  118. package/lib/address-edit/AddressEdit.js +4 -1
  119. package/lib/address-edit/index.js +4 -1
  120. package/lib/address-list/AddressList.js +4 -1
  121. package/lib/address-list/index.js +4 -1
  122. package/lib/area/index.js +4 -1
  123. package/lib/badge/Badge.d.ts +1 -1
  124. package/lib/badge/index.d.ts +1 -1
  125. package/lib/badge/index.js +4 -1
  126. package/lib/button/index.js +4 -1
  127. package/lib/calendar/Calendar.js +8 -4
  128. package/lib/calendar/CalendarMonth.js +4 -1
  129. package/lib/calendar/index.js +4 -1
  130. package/lib/card/index.js +4 -1
  131. package/lib/cascader/index.js +4 -1
  132. package/lib/cell/Cell.d.ts +1 -1
  133. package/lib/cell/index.d.ts +1 -1
  134. package/lib/cell/index.js +4 -1
  135. package/lib/cell-group/CellGroup.d.ts +1 -1
  136. package/lib/cell-group/index.d.ts +1 -1
  137. package/lib/cell-group/index.js +4 -1
  138. package/lib/checkbox/Checkbox.js +4 -1
  139. package/lib/checkbox/index.js +4 -1
  140. package/lib/checkbox-group/index.js +4 -1
  141. package/lib/circle/index.js +4 -1
  142. package/lib/col/Col.d.ts +1 -1
  143. package/lib/col/index.d.ts +1 -1
  144. package/lib/col/index.js +4 -1
  145. package/lib/collapse/index.js +4 -1
  146. package/lib/collapse-item/CollapseItem.d.ts +1 -1
  147. package/lib/collapse-item/index.d.ts +1 -1
  148. package/lib/collapse-item/index.js +4 -1
  149. package/lib/composables/use-lazy-render.js +9 -5
  150. package/lib/composables/use-lock-scroll.js +4 -1
  151. package/lib/composables/use-visibility-change.js +6 -3
  152. package/lib/config-provider/ConfigProvider.d.ts +1 -1
  153. package/lib/config-provider/index.d.ts +1 -1
  154. package/lib/config-provider/index.js +4 -1
  155. package/lib/contact-card/index.js +4 -1
  156. package/lib/contact-edit/index.js +4 -1
  157. package/lib/contact-list/index.js +4 -1
  158. package/lib/count-down/index.js +4 -1
  159. package/lib/coupon/Coupon.d.ts +1 -1
  160. package/lib/coupon/index.d.ts +1 -1
  161. package/lib/coupon/index.js +4 -1
  162. package/lib/coupon/utils.js +3 -1
  163. package/lib/coupon-cell/CouponCell.d.ts +1 -1
  164. package/lib/coupon-cell/index.d.ts +1 -1
  165. package/lib/coupon-cell/index.js +4 -1
  166. package/lib/coupon-list/index.js +4 -1
  167. package/lib/datetime-picker/DatetimePicker.d.ts +1 -1
  168. package/lib/datetime-picker/DatetimePicker.js +4 -1
  169. package/lib/datetime-picker/index.d.ts +1 -1
  170. package/lib/datetime-picker/index.js +4 -1
  171. package/lib/dialog/function-call.js +4 -1
  172. package/lib/dialog/index.css +1 -1
  173. package/lib/dialog/index.less +4 -0
  174. package/lib/dialog/types.d.ts +1 -1
  175. package/lib/divider/Divider.d.ts +1 -1
  176. package/lib/divider/index.d.ts +1 -1
  177. package/lib/divider/index.js +4 -1
  178. package/lib/dropdown-item/DropdownItem.d.ts +2 -2
  179. package/lib/dropdown-item/index.d.ts +2 -2
  180. package/lib/dropdown-item/index.js +4 -1
  181. package/lib/dropdown-menu/DropdownMenu.d.ts +1 -1
  182. package/lib/dropdown-menu/index.d.ts +1 -1
  183. package/lib/dropdown-menu/index.js +4 -1
  184. package/lib/empty/Empty.d.ts +1 -1
  185. package/lib/empty/index.d.ts +1 -1
  186. package/lib/empty/index.js +4 -1
  187. package/lib/field/Field.js +9 -2
  188. package/lib/field/index.js +4 -1
  189. package/lib/form/index.js +4 -1
  190. package/lib/grid/Grid.d.ts +1 -1
  191. package/lib/grid/index.d.ts +1 -1
  192. package/lib/grid/index.js +4 -1
  193. package/lib/grid-item/GridItem.d.ts +1 -1
  194. package/lib/grid-item/index.d.ts +1 -1
  195. package/lib/grid-item/index.js +4 -1
  196. package/lib/icon/Icon.d.ts +1 -1
  197. package/lib/icon/index.d.ts +1 -1
  198. package/lib/icon/index.js +4 -1
  199. package/lib/image/Image.d.ts +4 -0
  200. package/lib/image/Image.js +3 -1
  201. package/lib/image/index.css +1 -1
  202. package/lib/image/index.d.ts +3 -0
  203. package/lib/image/index.js +4 -1
  204. package/lib/image/index.less +4 -0
  205. package/lib/image-preview/ImagePreview.js +4 -1
  206. package/lib/image-preview/ImagePreviewItem.js +9 -1
  207. package/lib/image-preview/function-call.js +4 -1
  208. package/lib/index-anchor/IndexAnchor.d.ts +1 -1
  209. package/lib/index-anchor/index.d.ts +1 -1
  210. package/lib/index-anchor/index.js +4 -1
  211. package/lib/index-bar/IndexBar.js +7 -3
  212. package/lib/index-bar/index.js +4 -1
  213. package/lib/index.css +1 -1
  214. package/lib/index.d.ts +1 -1
  215. package/lib/index.js +1 -1
  216. package/lib/lazyload/vue-lazyload/index.js +4 -1
  217. package/lib/lazyload/vue-lazyload/lazy-component.js +4 -1
  218. package/lib/lazyload/vue-lazyload/lazy-container.js +11 -7
  219. package/lib/lazyload/vue-lazyload/lazy-image.js +24 -14
  220. package/lib/lazyload/vue-lazyload/lazy.js +15 -4
  221. package/lib/lazyload/vue-lazyload/listener.js +45 -33
  222. package/lib/lazyload/vue-lazyload/util.js +4 -1
  223. package/lib/list/index.js +4 -1
  224. package/lib/loading/Loading.d.ts +1 -1
  225. package/lib/loading/index.d.ts +1 -1
  226. package/lib/loading/index.js +4 -1
  227. package/lib/locale/index.js +4 -1
  228. package/lib/nav-bar/index.js +4 -1
  229. package/lib/notice-bar/index.js +4 -1
  230. package/lib/notify/function-call.js +4 -1
  231. package/lib/number-keyboard/NumberKeyboard.d.ts +1 -1
  232. package/lib/number-keyboard/NumberKeyboard.js +4 -1
  233. package/lib/number-keyboard/index.d.ts +1 -1
  234. package/lib/number-keyboard/index.js +4 -1
  235. package/lib/overlay/Overlay.d.ts +1 -1
  236. package/lib/overlay/Overlay.js +11 -4
  237. package/lib/overlay/index.d.ts +1 -1
  238. package/lib/overlay/index.js +4 -1
  239. package/lib/pagination/index.js +4 -1
  240. package/lib/password-input/index.js +4 -1
  241. package/lib/picker/Picker.js +10 -3
  242. package/lib/picker/PickerColumn.js +5 -1
  243. package/lib/picker/index.js +4 -1
  244. package/lib/popover/index.js +4 -1
  245. package/lib/popup/Popup.d.ts +2 -2
  246. package/lib/popup/index.d.ts +2 -2
  247. package/lib/popup/index.js +4 -1
  248. package/lib/popup/shared.js +3 -1
  249. package/lib/progress/Progress.d.ts +1 -1
  250. package/lib/progress/index.d.ts +1 -1
  251. package/lib/progress/index.js +4 -1
  252. package/lib/pull-refresh/index.js +4 -1
  253. package/lib/radio/Radio.js +4 -1
  254. package/lib/radio/index.js +4 -1
  255. package/lib/radio-group/index.js +4 -1
  256. package/lib/rate/Rate.js +4 -2
  257. package/lib/rate/index.js +4 -1
  258. package/lib/row/Row.d.ts +1 -1
  259. package/lib/row/index.d.ts +1 -1
  260. package/lib/row/index.js +4 -1
  261. package/lib/search/index.js +4 -1
  262. package/lib/share-sheet/index.js +4 -1
  263. package/lib/sidebar/index.js +4 -1
  264. package/lib/sidebar-item/index.js +4 -1
  265. package/lib/skeleton/Skeleton.d.ts +1 -1
  266. package/lib/skeleton/index.d.ts +1 -1
  267. package/lib/skeleton/index.js +4 -1
  268. package/lib/slider/Slider.js +5 -1
  269. package/lib/slider/index.js +4 -1
  270. package/lib/space/Space.d.ts +1 -1
  271. package/lib/space/index.d.ts +1 -1
  272. package/lib/space/index.js +4 -1
  273. package/lib/step/Step.d.ts +1 -1
  274. package/lib/step/index.d.ts +1 -1
  275. package/lib/step/index.js +4 -1
  276. package/lib/stepper/index.js +4 -1
  277. package/lib/steps/index.js +4 -1
  278. package/lib/sticky/index.js +4 -1
  279. package/lib/submit-bar/index.js +4 -1
  280. package/lib/swipe/Swipe.js +12 -5
  281. package/lib/swipe/index.js +4 -1
  282. package/lib/swipe-cell/SwipeCell.d.ts +2 -2
  283. package/lib/swipe-cell/SwipeCell.js +3 -1
  284. package/lib/swipe-cell/index.d.ts +2 -2
  285. package/lib/swipe-cell/index.js +4 -1
  286. package/lib/swipe-item/SwipeItem.d.ts +1 -1
  287. package/lib/swipe-item/index.d.ts +1 -1
  288. package/lib/swipe-item/index.js +4 -1
  289. package/lib/switch/index.js +4 -1
  290. package/lib/tab/Tab.d.ts +1 -1
  291. package/lib/tab/Tab.js +11 -1
  292. package/lib/tab/index.d.ts +1 -1
  293. package/lib/tab/index.js +4 -1
  294. package/lib/tabbar/index.js +4 -1
  295. package/lib/tabbar-item/index.js +4 -1
  296. package/lib/tabs/Tabs.d.ts +1 -1
  297. package/lib/tabs/Tabs.js +15 -12
  298. package/lib/tabs/TabsTitle.d.ts +1 -1
  299. package/lib/tabs/index.d.ts +1 -1
  300. package/lib/tabs/index.js +4 -1
  301. package/lib/tag/index.js +4 -1
  302. package/lib/toast/function-call.js +4 -1
  303. package/lib/tree-select/index.js +4 -1
  304. package/lib/uploader/Uploader.js +4 -1
  305. package/lib/uploader/index.js +4 -1
  306. package/lib/utils/basic.js +2 -1
  307. package/lib/utils/create.js +12 -3
  308. package/lib/utils/with-install.d.ts +2 -2
  309. package/lib/utils/with-install.js +4 -2
  310. package/lib/vant.cjs.js +248 -126
  311. package/lib/vant.es.js +248 -126
  312. package/lib/vant.js +290 -151
  313. package/lib/vant.min.js +1 -1
  314. package/lib/web-types.json +1389 -1379
  315. package/package.json +8 -7
package/lib/vant.es.js CHANGED
@@ -1,6 +1,17 @@
1
1
  import { useWindowSize, useRect, useChildren, useParent, onMountedOrActivated, getScrollParent, useEventListener, CUSTOM_FIELD_INJECTION_KEY, useCustomFieldValue, useToggle, raf, useScrollParent, usePageVisibility, doubleRaf, cancelRaf, useCountDown, useClickAway, inBrowser as inBrowser$1 } from "@vant/use";
2
2
  import { unref, ref, reactive, inject, watch, onMounted, nextTick, createVNode, defineComponent, getCurrentInstance, computed, provide, watchEffect, mergeProps, onDeactivated, onBeforeUnmount, Transition, withDirectives, vShow, onActivated, Teleport, Fragment, createTextVNode, createApp, onUnmounted, onBeforeUpdate, resolveDirective, withKeys, onUpdated, h } from "vue";
3
3
  import { offsetModifier, createPopper } from "@vant/popperjs";
4
+ const isDef = (val) => val !== void 0 && val !== null;
5
+ const isFunction = (val) => typeof val === "function";
6
+ const isObject = (val) => val !== null && typeof val === "object";
7
+ const isPromise = (val) => isObject(val) && isFunction(val.then) && isFunction(val.catch);
8
+ const isDate = (val) => Object.prototype.toString.call(val) === "[object Date]" && !Number.isNaN(val.getTime());
9
+ function isMobile(value) {
10
+ value = value.replace(/[^-|\d]/g, "");
11
+ return /^((\+86)|(86))?(1)\d{10}$/.test(value) || /^0[0-9-]{10,13}$/.test(value);
12
+ }
13
+ const isNumeric = (val) => typeof val === "number" || /^\d+(\.\d+)?$/.test(val);
14
+ const isIOS$1 = () => inBrowser ? /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()) : false;
4
15
  function noop() {
5
16
  }
6
17
  const extend = Object.assign;
@@ -10,7 +21,7 @@ function get(object, path) {
10
21
  let result = object;
11
22
  keys.forEach((key) => {
12
23
  var _a;
13
- result = (_a = result[key]) != null ? _a : "";
24
+ result = isObject(result) ? (_a = result[key]) != null ? _a : "" : "";
14
25
  });
15
26
  return result;
16
27
  }
@@ -49,17 +60,6 @@ const makeStringProp = (defaultVal) => ({
49
60
  type: String,
50
61
  default: defaultVal
51
62
  });
52
- const isDef = (val) => val !== void 0 && val !== null;
53
- const isFunction = (val) => typeof val === "function";
54
- const isObject = (val) => val !== null && typeof val === "object";
55
- const isPromise = (val) => isObject(val) && isFunction(val.then) && isFunction(val.catch);
56
- const isDate = (val) => Object.prototype.toString.call(val) === "[object Date]" && !Number.isNaN(val.getTime());
57
- function isMobile(value) {
58
- value = value.replace(/[^-|\d]/g, "");
59
- return /^((\+86)|(86))?(1)\d{10}$/.test(value) || /^0[0-9-]{10,13}$/.test(value);
60
- }
61
- const isNumeric = (val) => typeof val === "number" || /^\d+(\.\d+)?$/.test(val);
62
- const isIOS$1 = () => inBrowser ? /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()) : false;
63
63
  function getScrollTop(el) {
64
64
  const top = "scrollTop" in el ? el.scrollTop : el.pageYOffset;
65
65
  return Math.max(top, 0);
@@ -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") {
@@ -5085,6 +5124,7 @@ const imageProps = {
5085
5124
  fit: String,
5086
5125
  position: String,
5087
5126
  round: Boolean,
5127
+ block: Boolean,
5088
5128
  width: numericProp,
5089
5129
  height: numericProp,
5090
5130
  radius: numericProp,
@@ -5213,7 +5253,8 @@ var stdin_default$17 = defineComponent({
5213
5253
  var _a;
5214
5254
  return createVNode("div", {
5215
5255
  "class": bem$10({
5216
- round: props.round
5256
+ round: props.round,
5257
+ block: props.block
5217
5258
  }),
5218
5259
  "style": style.value
5219
5260
  }, [renderImage(), renderPlaceholder(), (_a = slots.default) == null ? void 0 : _a.call(slots)]);
@@ -5375,9 +5416,12 @@ function useVisibilityChange(target, onChange) {
5375
5416
  if (!inBrowser || !window.IntersectionObserver) {
5376
5417
  return;
5377
5418
  }
5378
- const observer = new IntersectionObserver((entries) => {
5379
- onChange(entries[0].intersectionRatio > 0);
5380
- }, { root: document.body });
5419
+ const observer = new IntersectionObserver(
5420
+ (entries) => {
5421
+ onChange(entries[0].intersectionRatio > 0);
5422
+ },
5423
+ { root: document.body }
5424
+ );
5381
5425
  const observe = () => {
5382
5426
  if (target.value) {
5383
5427
  observer.observe(target.value);
@@ -5613,6 +5657,7 @@ var stdin_default$13 = defineComponent({
5613
5657
  slots
5614
5658
  }) {
5615
5659
  const root = ref();
5660
+ const track = ref();
5616
5661
  const state = reactive({
5617
5662
  rect: null,
5618
5663
  width: 0,
@@ -5799,10 +5844,13 @@ var stdin_default$13 = defineComponent({
5799
5844
  if (props.touchable && state.swiping) {
5800
5845
  touch.move(event);
5801
5846
  if (isCorrectDirection.value) {
5802
- preventDefault(event, props.stopPropagation);
5803
- move({
5804
- offset: delta.value
5805
- });
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
+ }
5806
5854
  }
5807
5855
  }
5808
5856
  };
@@ -5912,18 +5960,21 @@ var stdin_default$13 = defineComponent({
5912
5960
  onPopupReopen(() => initialize(state.active));
5913
5961
  onDeactivated(stopAutoplay);
5914
5962
  onBeforeUnmount(stopAutoplay);
5963
+ useEventListener("touchmove", onTouchMove, {
5964
+ target: track
5965
+ });
5915
5966
  return () => {
5916
5967
  var _a;
5917
5968
  return createVNode("div", {
5918
5969
  "ref": root,
5919
5970
  "class": bem$Y()
5920
5971
  }, [createVNode("div", {
5972
+ "ref": track,
5921
5973
  "style": trackStyle.value,
5922
5974
  "class": bem$Y("track", {
5923
5975
  vertical: props.vertical
5924
5976
  }),
5925
5977
  "onTouchstartPassive": onTouchStart,
5926
- "onTouchmove": onTouchMove,
5927
5978
  "onTouchend": onTouchEnd,
5928
5979
  "onTouchcancel": onTouchEnd
5929
5980
  }, [(_a = slots.default) == null ? void 0 : _a.call(slots)]), renderIndicator()]);
@@ -6123,7 +6174,7 @@ var stdin_default$11 = defineComponent({
6123
6174
  index += diff;
6124
6175
  }
6125
6176
  };
6126
- const setCurrentIndex = (currentIndex) => {
6177
+ const setCurrentIndex = (currentIndex, skipScrollIntoView) => {
6127
6178
  const newIndex = findAvailableTab(currentIndex);
6128
6179
  if (!isDef(newIndex)) {
6129
6180
  return;
@@ -6138,11 +6189,18 @@ var stdin_default$11 = defineComponent({
6138
6189
  emit("change", newName, newTab.title);
6139
6190
  }
6140
6191
  }
6192
+ if (!skipScrollIntoView) {
6193
+ scrollIntoView();
6194
+ }
6195
+ setLine();
6196
+ if (stickyFixed && !props.scrollspy) {
6197
+ setRootScrollTop(Math.ceil(getElementTop(root.value) - offsetTopPx.value));
6198
+ }
6141
6199
  };
6142
- const setCurrentIndexByName = (name2) => {
6200
+ const setCurrentIndexByName = (name2, skipScrollIntoView) => {
6143
6201
  const matched = children.find((tab, index2) => getTabName(tab, index2) === name2);
6144
6202
  const index = matched ? children.indexOf(matched) : 0;
6145
- setCurrentIndex(index);
6203
+ setCurrentIndex(index, skipScrollIntoView);
6146
6204
  };
6147
6205
  const scrollToCurrentContent = (immediate = false) => {
6148
6206
  if (props.scrollspy) {
@@ -6272,15 +6330,8 @@ var stdin_default$11 = defineComponent({
6272
6330
  });
6273
6331
  }
6274
6332
  });
6275
- watch(() => state.currentIndex, () => {
6276
- scrollIntoView();
6277
- setLine();
6278
- if (stickyFixed && !props.scrollspy) {
6279
- setRootScrollTop(Math.ceil(getElementTop(root.value) - offsetTopPx.value));
6280
- }
6281
- });
6282
6333
  const init = () => {
6283
- setCurrentIndexByName(props.active);
6334
+ setCurrentIndexByName(props.active, true);
6284
6335
  nextTick(() => {
6285
6336
  state.inited = true;
6286
6337
  if (wrapRef.value) {
@@ -6473,6 +6524,16 @@ var stdin_default$$ = defineComponent({
6473
6524
  }
6474
6525
  return isActive;
6475
6526
  });
6527
+ const hasInactiveClass = ref(!active.value);
6528
+ watch(active, (val) => {
6529
+ if (val) {
6530
+ hasInactiveClass.value = false;
6531
+ } else {
6532
+ doubleRaf(() => {
6533
+ hasInactiveClass.value = true;
6534
+ });
6535
+ }
6536
+ });
6476
6537
  watch(() => props.title, () => {
6477
6538
  parent.setLine();
6478
6539
  parent.scrollIntoView();
@@ -6496,7 +6557,7 @@ var stdin_default$$ = defineComponent({
6496
6557
  "id": id,
6497
6558
  "role": "tabpanel",
6498
6559
  "class": bem$U("panel-wrapper", {
6499
- inactive: !active.value
6560
+ inactive: hasInactiveClass.value
6500
6561
  }),
6501
6562
  "tabindex": active.value ? 0 : -1,
6502
6563
  "aria-hidden": !active.value,
@@ -7736,7 +7797,9 @@ var stdin_default$O = defineComponent({
7736
7797
  const CountDown = withInstall(stdin_default$O);
7737
7798
  function getDate(timeStamp) {
7738
7799
  const date = new Date(timeStamp * 1e3);
7739
- return `${date.getFullYear()}.${padZero(date.getMonth() + 1)}.${padZero(date.getDate())}`;
7800
+ return `${date.getFullYear()}.${padZero(date.getMonth() + 1)}.${padZero(
7801
+ date.getDate()
7802
+ )}`;
7740
7803
  }
7741
7804
  const formatDiscount = (discount) => (discount / 10).toFixed(discount % 10 === 0 ? 0 : 1);
7742
7805
  const formatAmount = (amount) => (amount / 100).toFixed(amount % 100 === 0 ? 0 : amount % 10 === 0 ? 1 : 2);
@@ -9541,6 +9604,7 @@ var stdin_default$A = defineComponent({
9541
9604
  displayHeight: 0
9542
9605
  });
9543
9606
  const touch = useTouch();
9607
+ const swipeItem = ref();
9544
9608
  const vertical = computed(() => {
9545
9609
  const {
9546
9610
  rootWidth,
@@ -9726,6 +9790,12 @@ var stdin_default$A = defineComponent({
9726
9790
  resetScale();
9727
9791
  }
9728
9792
  });
9793
+ useEventListener("touchmove", onTouchMove, {
9794
+ target: computed(() => {
9795
+ var _a;
9796
+ return (_a = swipeItem.value) == null ? void 0 : _a.$el;
9797
+ })
9798
+ });
9729
9799
  return () => {
9730
9800
  const imageSlots = {
9731
9801
  loading: () => createVNode(Loading, {
@@ -9733,9 +9803,9 @@ var stdin_default$A = defineComponent({
9733
9803
  }, null)
9734
9804
  };
9735
9805
  return createVNode(SwipeItem, {
9806
+ "ref": swipeItem,
9736
9807
  "class": bem$v("swipe-item"),
9737
9808
  "onTouchstartPassive": onTouchStart,
9738
- "onTouchmove": onTouchMove,
9739
9809
  "onTouchend": onTouchEnd,
9740
9810
  "onTouchcancel": onTouchEnd
9741
9811
  }, {
@@ -9989,6 +10059,7 @@ var stdin_default$y = defineComponent({
9989
10059
  slots
9990
10060
  }) {
9991
10061
  const root = ref();
10062
+ const sidebar = ref();
9992
10063
  const activeAnchor = ref("");
9993
10064
  const touch = useTouch();
9994
10065
  const scrollParent = useScrollParent(root);
@@ -10108,11 +10179,11 @@ var stdin_default$y = defineComponent({
10108
10179
  const {
10109
10180
  offsetHeight
10110
10181
  } = document.documentElement;
10182
+ match.$el.scrollIntoView();
10111
10183
  if (scrollTop === offsetHeight - scrollParentRect.height) {
10112
10184
  onScroll();
10113
10185
  return;
10114
10186
  }
10115
- match.$el.scrollIntoView();
10116
10187
  if (props.sticky && props.stickyOffsetTop) {
10117
10188
  setRootScrollTop(getRootScrollTop() - props.stickyOffsetTop);
10118
10189
  }
@@ -10152,15 +10223,18 @@ var stdin_default$y = defineComponent({
10152
10223
  }
10153
10224
  };
10154
10225
  const renderSidebar = () => createVNode("div", {
10226
+ "ref": sidebar,
10155
10227
  "class": bem$t("sidebar"),
10156
10228
  "style": sidebarStyle.value,
10157
10229
  "onClick": onClickSidebar,
10158
- "onTouchstartPassive": touch.start,
10159
- "onTouchmove": onTouchMove
10230
+ "onTouchstartPassive": touch.start
10160
10231
  }, [renderIndexes()]);
10161
10232
  useExpose({
10162
10233
  scrollTo
10163
10234
  });
10235
+ useEventListener("touchmove", onTouchMove, {
10236
+ target: sidebar
10237
+ });
10164
10238
  return () => {
10165
10239
  var _a;
10166
10240
  return createVNode("div", {
@@ -11859,6 +11933,9 @@ var stdin_default$l = defineComponent({
11859
11933
  }, null)]);
11860
11934
  };
11861
11935
  useCustomFieldValue(() => props.modelValue);
11936
+ useEventListener("touchmove", onTouchMove, {
11937
+ target: groupRef
11938
+ });
11862
11939
  return () => createVNode("div", {
11863
11940
  "ref": groupRef,
11864
11941
  "role": "radiogroup",
@@ -11869,8 +11946,7 @@ var stdin_default$l = defineComponent({
11869
11946
  "tabindex": props.disabled ? void 0 : 0,
11870
11947
  "aria-disabled": props.disabled,
11871
11948
  "aria-readonly": props.readonly,
11872
- "onTouchstartPassive": onTouchStart,
11873
- "onTouchmove": onTouchMove
11949
+ "onTouchstartPassive": onTouchStart
11874
11950
  }, [list.value.map(renderStar)]);
11875
11951
  }
11876
11952
  });
@@ -12309,6 +12385,7 @@ var stdin_default$f = defineComponent({
12309
12385
  let current2;
12310
12386
  let startValue;
12311
12387
  const root = ref();
12388
+ const slider = ref();
12312
12389
  const dragStatus = ref();
12313
12390
  const touch = useTouch();
12314
12391
  const scope = computed(() => Number(props.max) - Number(props.min));
@@ -12501,6 +12578,7 @@ var stdin_default$f = defineComponent({
12501
12578
  const renderButton = (index) => {
12502
12579
  const current22 = typeof index === "number" ? props.modelValue[index] : props.modelValue;
12503
12580
  return createVNode("div", {
12581
+ "ref": slider,
12504
12582
  "role": "slider",
12505
12583
  "class": getButtonClassName(index),
12506
12584
  "tabindex": props.disabled ? void 0 : 0,
@@ -12516,7 +12594,6 @@ var stdin_default$f = defineComponent({
12516
12594
  }
12517
12595
  onTouchStart(event);
12518
12596
  },
12519
- "onTouchmove": onTouchMove,
12520
12597
  "onTouchend": onTouchEnd,
12521
12598
  "onTouchcancel": onTouchEnd,
12522
12599
  "onClick": stopPropagation
@@ -12524,6 +12601,9 @@ var stdin_default$f = defineComponent({
12524
12601
  };
12525
12602
  updateValue(props.modelValue);
12526
12603
  useCustomFieldValue(() => props.modelValue);
12604
+ useEventListener("touchmove", onTouchMove, {
12605
+ target: slider
12606
+ });
12527
12607
  return () => createVNode("div", {
12528
12608
  "ref": root,
12529
12609
  "style": wrapperStyle.value,
@@ -13248,6 +13328,9 @@ var stdin_default$9 = defineComponent({
13248
13328
  useClickAway(root, () => onClick("outside"), {
13249
13329
  eventName: "touchstart"
13250
13330
  });
13331
+ useEventListener("touchmove", onTouchMove, {
13332
+ target: root
13333
+ });
13251
13334
  return () => {
13252
13335
  var _a;
13253
13336
  const wrapperStyle = {
@@ -13259,7 +13342,6 @@ var stdin_default$9 = defineComponent({
13259
13342
  "class": bem$4(),
13260
13343
  "onClick": getClickHandler("cell", lockClick2),
13261
13344
  "onTouchstartPassive": onTouchStart,
13262
- "onTouchmove": onTouchMove,
13263
13345
  "onTouchend": onTouchEnd,
13264
13346
  "onTouchcancel": onTouchEnd
13265
13347
  }, [createVNode("div", {
@@ -13993,7 +14075,10 @@ function getBestSelectionFromSrcset(el, scale) {
13993
14075
  tmpWidth = 999998;
13994
14076
  } else {
13995
14077
  tmpSrc = item.substr(0, spaceIndex);
13996
- tmpWidth = parseInt(item.substr(spaceIndex + 1, item.length - spaceIndex - 2), 10);
14078
+ tmpWidth = parseInt(
14079
+ item.substr(spaceIndex + 1, item.length - spaceIndex - 2),
14080
+ 10
14081
+ );
13997
14082
  }
13998
14083
  return [tmpWidth, tmpSrc];
13999
14084
  });
@@ -14184,24 +14269,32 @@ class ReactiveListener {
14184
14269
  }
14185
14270
  renderLoading(cb) {
14186
14271
  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
- });
14272
+ loadImageAsync(
14273
+ {
14274
+ src: this.loading,
14275
+ cors: this.cors
14276
+ },
14277
+ () => {
14278
+ this.render("loading", false);
14279
+ this.state.loading = false;
14280
+ cb();
14281
+ },
14282
+ () => {
14283
+ cb();
14284
+ this.state.loading = false;
14285
+ if (process.env.NODE_ENV !== "production" && !this.options.silent)
14286
+ console.warn(
14287
+ `[@vant/lazyload] load failed with loading image(${this.loading})`
14288
+ );
14289
+ }
14290
+ );
14200
14291
  }
14201
14292
  load(onFinish = noop) {
14202
14293
  if (this.attempt > this.options.attempt - 1 && this.state.error) {
14203
14294
  if (process.env.NODE_ENV !== "production" && !this.options.silent) {
14204
- console.log(`[@vant/lazyload] ${this.src} tried too more than ${this.options.attempt} times`);
14295
+ console.log(
14296
+ `[@vant/lazyload] ${this.src} tried too more than ${this.options.attempt} times`
14297
+ );
14205
14298
  }
14206
14299
  onFinish();
14207
14300
  return;
@@ -14219,25 +14312,29 @@ class ReactiveListener {
14219
14312
  this.attempt++;
14220
14313
  (_b = (_a = this.options.adapter).beforeLoad) == null ? void 0 : _b.call(_a, this, this.options);
14221
14314
  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
- });
14315
+ loadImageAsync(
14316
+ {
14317
+ src: this.src,
14318
+ cors: this.cors
14319
+ },
14320
+ (data) => {
14321
+ this.naturalHeight = data.naturalHeight;
14322
+ this.naturalWidth = data.naturalWidth;
14323
+ this.state.loaded = true;
14324
+ this.state.error = false;
14325
+ this.record("loadEnd");
14326
+ this.render("loaded", false);
14327
+ this.state.rendered = true;
14328
+ this.imageCache.add(this.src);
14329
+ onFinish();
14330
+ },
14331
+ (err) => {
14332
+ !this.options.silent && console.error(err);
14333
+ this.state.error = true;
14334
+ this.state.loaded = false;
14335
+ this.render("error", false);
14336
+ }
14337
+ );
14241
14338
  });
14242
14339
  }
14243
14340
  render(state, cache) {
@@ -14322,7 +14419,10 @@ function stdin_default$3() {
14322
14419
  };
14323
14420
  this.initEvent();
14324
14421
  this.imageCache = new ImageCache({ max: 200 });
14325
- this.lazyLoadHandler = throttle(this.lazyLoadHandler.bind(this), this.options.throttleWait);
14422
+ this.lazyLoadHandler = throttle(
14423
+ this.lazyLoadHandler.bind(this),
14424
+ this.options.throttleWait
14425
+ );
14326
14426
  this.setMode(this.options.observer ? modeType.observer : modeType.event);
14327
14427
  }
14328
14428
  config(options = {}) {
@@ -14477,7 +14577,9 @@ function stdin_default$3() {
14477
14577
  });
14478
14578
  }
14479
14579
  initListen(el, start) {
14480
- this.options.ListenEvents.forEach((evt) => (start ? on : off)(el, evt, this.lazyLoadHandler));
14580
+ this.options.ListenEvents.forEach(
14581
+ (evt) => (start ? on : off)(el, evt, this.lazyLoadHandler)
14582
+ );
14481
14583
  }
14482
14584
  initEvent() {
14483
14585
  this.Event = {
@@ -14534,7 +14636,10 @@ function stdin_default$3() {
14534
14636
  if (!hasIntersectionObserver) {
14535
14637
  return;
14536
14638
  }
14537
- this.observer = new IntersectionObserver(this.observerHandler.bind(this), this.options.observerOptions);
14639
+ this.observer = new IntersectionObserver(
14640
+ this.observerHandler.bind(this),
14641
+ this.options.observerOptions
14642
+ );
14538
14643
  if (this.listeners.length) {
14539
14644
  this.listeners.forEach((listener) => {
14540
14645
  this.observer.observe(listener.el);
@@ -14613,7 +14718,10 @@ var stdin_default$2 = (lazy) => ({
14613
14718
  },
14614
14719
  emits: ["show"],
14615
14720
  render() {
14616
- return h(this.tag, this.show && this.$slots.default ? this.$slots.default() : null);
14721
+ return h(
14722
+ this.tag,
14723
+ this.show && this.$slots.default ? this.$slots.default() : null
14724
+ );
14617
14725
  },
14618
14726
  data() {
14619
14727
  return {
@@ -14665,13 +14773,17 @@ class LazyContainer {
14665
14773
  this.options = Object.assign({}, defaultOptions, binding.value);
14666
14774
  const imgs = this.getImgs();
14667
14775
  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);
14776
+ this.lazy.add(
14777
+ el2,
14778
+ Object.assign({}, this.binding, {
14779
+ value: {
14780
+ src: "dataset" in el2 ? el2.dataset.src : el2.getAttribute("data-src"),
14781
+ error: ("dataset" in el2 ? el2.dataset.error : el2.getAttribute("data-error")) || this.options.error,
14782
+ loading: ("dataset" in el2 ? el2.dataset.loading : el2.getAttribute("data-loading")) || this.options.loading
14783
+ }
14784
+ }),
14785
+ this.vnode
14786
+ );
14675
14787
  });
14676
14788
  }
14677
14789
  getImgs() {
@@ -14722,11 +14834,15 @@ var stdin_default$1 = (lazyManager) => ({
14722
14834
  }
14723
14835
  },
14724
14836
  render(h2) {
14725
- return h2(this.tag, {
14726
- attrs: {
14727
- src: this.renderSrc
14728
- }
14729
- }, this.$slots.default);
14837
+ return h2(
14838
+ this.tag,
14839
+ {
14840
+ attrs: {
14841
+ src: this.renderSrc
14842
+ }
14843
+ },
14844
+ this.$slots.default
14845
+ );
14730
14846
  },
14731
14847
  data() {
14732
14848
  return {
@@ -14780,20 +14896,26 @@ var stdin_default$1 = (lazyManager) => ({
14780
14896
  load(onFinish = noop) {
14781
14897
  if (this.state.attempt > this.options.attempt - 1 && this.state.error) {
14782
14898
  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`);
14899
+ console.log(
14900
+ `[@vant/lazyload] ${this.options.src} tried too more than ${this.options.attempt} times`
14901
+ );
14784
14902
  }
14785
14903
  onFinish();
14786
14904
  return;
14787
14905
  }
14788
14906
  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
- });
14907
+ loadImageAsync(
14908
+ { src },
14909
+ ({ src: src2 }) => {
14910
+ this.renderSrc = src2;
14911
+ this.state.loaded = true;
14912
+ },
14913
+ () => {
14914
+ this.state.attempt++;
14915
+ this.renderSrc = this.options.error;
14916
+ this.state.error = true;
14917
+ }
14918
+ );
14797
14919
  }
14798
14920
  }
14799
14921
  });
@@ -14821,7 +14943,7 @@ const Lazyload = {
14821
14943
  });
14822
14944
  }
14823
14945
  };
14824
- const version = "3.6.1";
14946
+ const version = "3.6.3";
14825
14947
  function install(app) {
14826
14948
  const components = [
14827
14949
  ActionBar,