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.cjs.js CHANGED
@@ -3,6 +3,17 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
3
3
  const use = require("@vant/use");
4
4
  const vue = require("vue");
5
5
  const popperjs = require("@vant/popperjs");
6
+ const isDef = (val) => val !== void 0 && val !== null;
7
+ const isFunction = (val) => typeof val === "function";
8
+ const isObject = (val) => val !== null && typeof val === "object";
9
+ const isPromise = (val) => isObject(val) && isFunction(val.then) && isFunction(val.catch);
10
+ const isDate = (val) => Object.prototype.toString.call(val) === "[object Date]" && !Number.isNaN(val.getTime());
11
+ function isMobile(value) {
12
+ value = value.replace(/[^-|\d]/g, "");
13
+ return /^((\+86)|(86))?(1)\d{10}$/.test(value) || /^0[0-9-]{10,13}$/.test(value);
14
+ }
15
+ const isNumeric = (val) => typeof val === "number" || /^\d+(\.\d+)?$/.test(val);
16
+ const isIOS$1 = () => inBrowser ? /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()) : false;
6
17
  function noop() {
7
18
  }
8
19
  const extend = Object.assign;
@@ -12,7 +23,7 @@ function get(object, path) {
12
23
  let result = object;
13
24
  keys.forEach((key) => {
14
25
  var _a;
15
- result = (_a = result[key]) != null ? _a : "";
26
+ result = isObject(result) ? (_a = result[key]) != null ? _a : "" : "";
16
27
  });
17
28
  return result;
18
29
  }
@@ -51,17 +62,6 @@ const makeStringProp = (defaultVal) => ({
51
62
  type: String,
52
63
  default: defaultVal
53
64
  });
54
- const isDef = (val) => val !== void 0 && val !== null;
55
- const isFunction = (val) => typeof val === "function";
56
- const isObject = (val) => val !== null && typeof val === "object";
57
- const isPromise = (val) => isObject(val) && isFunction(val.then) && isFunction(val.catch);
58
- const isDate = (val) => Object.prototype.toString.call(val) === "[object Date]" && !Number.isNaN(val.getTime());
59
- function isMobile(value) {
60
- value = value.replace(/[^-|\d]/g, "");
61
- return /^((\+86)|(86))?(1)\d{10}$/.test(value) || /^0[0-9-]{10,13}$/.test(value);
62
- }
63
- const isNumeric = (val) => typeof val === "number" || /^\d+(\.\d+)?$/.test(val);
64
- const isIOS$1 = () => inBrowser ? /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()) : false;
65
65
  function getScrollTop(el) {
66
66
  const top = "scrollTop" in el ? el.scrollTop : el.pageYOffset;
67
67
  return Math.max(top, 0);
@@ -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") {
@@ -5087,6 +5126,7 @@ const imageProps = {
5087
5126
  fit: String,
5088
5127
  position: String,
5089
5128
  round: Boolean,
5129
+ block: Boolean,
5090
5130
  width: numericProp,
5091
5131
  height: numericProp,
5092
5132
  radius: numericProp,
@@ -5215,7 +5255,8 @@ var stdin_default$17 = vue.defineComponent({
5215
5255
  var _a;
5216
5256
  return vue.createVNode("div", {
5217
5257
  "class": bem$10({
5218
- round: props.round
5258
+ round: props.round,
5259
+ block: props.block
5219
5260
  }),
5220
5261
  "style": style.value
5221
5262
  }, [renderImage(), renderPlaceholder(), (_a = slots.default) == null ? void 0 : _a.call(slots)]);
@@ -5377,9 +5418,12 @@ function useVisibilityChange(target, onChange) {
5377
5418
  if (!inBrowser || !window.IntersectionObserver) {
5378
5419
  return;
5379
5420
  }
5380
- const observer = new IntersectionObserver((entries) => {
5381
- onChange(entries[0].intersectionRatio > 0);
5382
- }, { root: document.body });
5421
+ const observer = new IntersectionObserver(
5422
+ (entries) => {
5423
+ onChange(entries[0].intersectionRatio > 0);
5424
+ },
5425
+ { root: document.body }
5426
+ );
5383
5427
  const observe = () => {
5384
5428
  if (target.value) {
5385
5429
  observer.observe(target.value);
@@ -5615,6 +5659,7 @@ var stdin_default$13 = vue.defineComponent({
5615
5659
  slots
5616
5660
  }) {
5617
5661
  const root = vue.ref();
5662
+ const track = vue.ref();
5618
5663
  const state = vue.reactive({
5619
5664
  rect: null,
5620
5665
  width: 0,
@@ -5801,10 +5846,13 @@ var stdin_default$13 = vue.defineComponent({
5801
5846
  if (props.touchable && state.swiping) {
5802
5847
  touch.move(event);
5803
5848
  if (isCorrectDirection.value) {
5804
- preventDefault(event, props.stopPropagation);
5805
- move({
5806
- offset: delta.value
5807
- });
5849
+ const isEdgeTouch = !props.loop && (state.active === 0 && delta.value > 0 || state.active === count.value - 1 && delta.value < 0);
5850
+ if (!isEdgeTouch) {
5851
+ preventDefault(event, props.stopPropagation);
5852
+ move({
5853
+ offset: delta.value
5854
+ });
5855
+ }
5808
5856
  }
5809
5857
  }
5810
5858
  };
@@ -5914,18 +5962,21 @@ var stdin_default$13 = vue.defineComponent({
5914
5962
  onPopupReopen(() => initialize(state.active));
5915
5963
  vue.onDeactivated(stopAutoplay);
5916
5964
  vue.onBeforeUnmount(stopAutoplay);
5965
+ use.useEventListener("touchmove", onTouchMove, {
5966
+ target: track
5967
+ });
5917
5968
  return () => {
5918
5969
  var _a;
5919
5970
  return vue.createVNode("div", {
5920
5971
  "ref": root,
5921
5972
  "class": bem$Y()
5922
5973
  }, [vue.createVNode("div", {
5974
+ "ref": track,
5923
5975
  "style": trackStyle.value,
5924
5976
  "class": bem$Y("track", {
5925
5977
  vertical: props.vertical
5926
5978
  }),
5927
5979
  "onTouchstartPassive": onTouchStart,
5928
- "onTouchmove": onTouchMove,
5929
5980
  "onTouchend": onTouchEnd,
5930
5981
  "onTouchcancel": onTouchEnd
5931
5982
  }, [(_a = slots.default) == null ? void 0 : _a.call(slots)]), renderIndicator()]);
@@ -6125,7 +6176,7 @@ var stdin_default$11 = vue.defineComponent({
6125
6176
  index += diff;
6126
6177
  }
6127
6178
  };
6128
- const setCurrentIndex = (currentIndex) => {
6179
+ const setCurrentIndex = (currentIndex, skipScrollIntoView) => {
6129
6180
  const newIndex = findAvailableTab(currentIndex);
6130
6181
  if (!isDef(newIndex)) {
6131
6182
  return;
@@ -6140,11 +6191,18 @@ var stdin_default$11 = vue.defineComponent({
6140
6191
  emit("change", newName, newTab.title);
6141
6192
  }
6142
6193
  }
6194
+ if (!skipScrollIntoView) {
6195
+ scrollIntoView();
6196
+ }
6197
+ setLine();
6198
+ if (stickyFixed && !props.scrollspy) {
6199
+ setRootScrollTop(Math.ceil(getElementTop(root.value) - offsetTopPx.value));
6200
+ }
6143
6201
  };
6144
- const setCurrentIndexByName = (name2) => {
6202
+ const setCurrentIndexByName = (name2, skipScrollIntoView) => {
6145
6203
  const matched = children.find((tab, index2) => getTabName(tab, index2) === name2);
6146
6204
  const index = matched ? children.indexOf(matched) : 0;
6147
- setCurrentIndex(index);
6205
+ setCurrentIndex(index, skipScrollIntoView);
6148
6206
  };
6149
6207
  const scrollToCurrentContent = (immediate = false) => {
6150
6208
  if (props.scrollspy) {
@@ -6274,15 +6332,8 @@ var stdin_default$11 = vue.defineComponent({
6274
6332
  });
6275
6333
  }
6276
6334
  });
6277
- vue.watch(() => state.currentIndex, () => {
6278
- scrollIntoView();
6279
- setLine();
6280
- if (stickyFixed && !props.scrollspy) {
6281
- setRootScrollTop(Math.ceil(getElementTop(root.value) - offsetTopPx.value));
6282
- }
6283
- });
6284
6335
  const init = () => {
6285
- setCurrentIndexByName(props.active);
6336
+ setCurrentIndexByName(props.active, true);
6286
6337
  vue.nextTick(() => {
6287
6338
  state.inited = true;
6288
6339
  if (wrapRef.value) {
@@ -6475,6 +6526,16 @@ var stdin_default$$ = vue.defineComponent({
6475
6526
  }
6476
6527
  return isActive;
6477
6528
  });
6529
+ const hasInactiveClass = vue.ref(!active.value);
6530
+ vue.watch(active, (val) => {
6531
+ if (val) {
6532
+ hasInactiveClass.value = false;
6533
+ } else {
6534
+ use.doubleRaf(() => {
6535
+ hasInactiveClass.value = true;
6536
+ });
6537
+ }
6538
+ });
6478
6539
  vue.watch(() => props.title, () => {
6479
6540
  parent.setLine();
6480
6541
  parent.scrollIntoView();
@@ -6498,7 +6559,7 @@ var stdin_default$$ = vue.defineComponent({
6498
6559
  "id": id,
6499
6560
  "role": "tabpanel",
6500
6561
  "class": bem$U("panel-wrapper", {
6501
- inactive: !active.value
6562
+ inactive: hasInactiveClass.value
6502
6563
  }),
6503
6564
  "tabindex": active.value ? 0 : -1,
6504
6565
  "aria-hidden": !active.value,
@@ -7738,7 +7799,9 @@ var stdin_default$O = vue.defineComponent({
7738
7799
  const CountDown = withInstall(stdin_default$O);
7739
7800
  function getDate(timeStamp) {
7740
7801
  const date = new Date(timeStamp * 1e3);
7741
- return `${date.getFullYear()}.${padZero(date.getMonth() + 1)}.${padZero(date.getDate())}`;
7802
+ return `${date.getFullYear()}.${padZero(date.getMonth() + 1)}.${padZero(
7803
+ date.getDate()
7804
+ )}`;
7742
7805
  }
7743
7806
  const formatDiscount = (discount) => (discount / 10).toFixed(discount % 10 === 0 ? 0 : 1);
7744
7807
  const formatAmount = (amount) => (amount / 100).toFixed(amount % 100 === 0 ? 0 : amount % 10 === 0 ? 1 : 2);
@@ -9543,6 +9606,7 @@ var stdin_default$A = vue.defineComponent({
9543
9606
  displayHeight: 0
9544
9607
  });
9545
9608
  const touch = useTouch();
9609
+ const swipeItem = vue.ref();
9546
9610
  const vertical = vue.computed(() => {
9547
9611
  const {
9548
9612
  rootWidth,
@@ -9728,6 +9792,12 @@ var stdin_default$A = vue.defineComponent({
9728
9792
  resetScale();
9729
9793
  }
9730
9794
  });
9795
+ use.useEventListener("touchmove", onTouchMove, {
9796
+ target: vue.computed(() => {
9797
+ var _a;
9798
+ return (_a = swipeItem.value) == null ? void 0 : _a.$el;
9799
+ })
9800
+ });
9731
9801
  return () => {
9732
9802
  const imageSlots = {
9733
9803
  loading: () => vue.createVNode(Loading, {
@@ -9735,9 +9805,9 @@ var stdin_default$A = vue.defineComponent({
9735
9805
  }, null)
9736
9806
  };
9737
9807
  return vue.createVNode(SwipeItem, {
9808
+ "ref": swipeItem,
9738
9809
  "class": bem$v("swipe-item"),
9739
9810
  "onTouchstartPassive": onTouchStart,
9740
- "onTouchmove": onTouchMove,
9741
9811
  "onTouchend": onTouchEnd,
9742
9812
  "onTouchcancel": onTouchEnd
9743
9813
  }, {
@@ -9991,6 +10061,7 @@ var stdin_default$y = vue.defineComponent({
9991
10061
  slots
9992
10062
  }) {
9993
10063
  const root = vue.ref();
10064
+ const sidebar = vue.ref();
9994
10065
  const activeAnchor = vue.ref("");
9995
10066
  const touch = useTouch();
9996
10067
  const scrollParent = use.useScrollParent(root);
@@ -10110,11 +10181,11 @@ var stdin_default$y = vue.defineComponent({
10110
10181
  const {
10111
10182
  offsetHeight
10112
10183
  } = document.documentElement;
10184
+ match.$el.scrollIntoView();
10113
10185
  if (scrollTop === offsetHeight - scrollParentRect.height) {
10114
10186
  onScroll();
10115
10187
  return;
10116
10188
  }
10117
- match.$el.scrollIntoView();
10118
10189
  if (props.sticky && props.stickyOffsetTop) {
10119
10190
  setRootScrollTop(getRootScrollTop() - props.stickyOffsetTop);
10120
10191
  }
@@ -10154,15 +10225,18 @@ var stdin_default$y = vue.defineComponent({
10154
10225
  }
10155
10226
  };
10156
10227
  const renderSidebar = () => vue.createVNode("div", {
10228
+ "ref": sidebar,
10157
10229
  "class": bem$t("sidebar"),
10158
10230
  "style": sidebarStyle.value,
10159
10231
  "onClick": onClickSidebar,
10160
- "onTouchstartPassive": touch.start,
10161
- "onTouchmove": onTouchMove
10232
+ "onTouchstartPassive": touch.start
10162
10233
  }, [renderIndexes()]);
10163
10234
  useExpose({
10164
10235
  scrollTo
10165
10236
  });
10237
+ use.useEventListener("touchmove", onTouchMove, {
10238
+ target: sidebar
10239
+ });
10166
10240
  return () => {
10167
10241
  var _a;
10168
10242
  return vue.createVNode("div", {
@@ -11861,6 +11935,9 @@ var stdin_default$l = vue.defineComponent({
11861
11935
  }, null)]);
11862
11936
  };
11863
11937
  use.useCustomFieldValue(() => props.modelValue);
11938
+ use.useEventListener("touchmove", onTouchMove, {
11939
+ target: groupRef
11940
+ });
11864
11941
  return () => vue.createVNode("div", {
11865
11942
  "ref": groupRef,
11866
11943
  "role": "radiogroup",
@@ -11871,8 +11948,7 @@ var stdin_default$l = vue.defineComponent({
11871
11948
  "tabindex": props.disabled ? void 0 : 0,
11872
11949
  "aria-disabled": props.disabled,
11873
11950
  "aria-readonly": props.readonly,
11874
- "onTouchstartPassive": onTouchStart,
11875
- "onTouchmove": onTouchMove
11951
+ "onTouchstartPassive": onTouchStart
11876
11952
  }, [list.value.map(renderStar)]);
11877
11953
  }
11878
11954
  });
@@ -12311,6 +12387,7 @@ var stdin_default$f = vue.defineComponent({
12311
12387
  let current2;
12312
12388
  let startValue;
12313
12389
  const root = vue.ref();
12390
+ const slider = vue.ref();
12314
12391
  const dragStatus = vue.ref();
12315
12392
  const touch = useTouch();
12316
12393
  const scope = vue.computed(() => Number(props.max) - Number(props.min));
@@ -12503,6 +12580,7 @@ var stdin_default$f = vue.defineComponent({
12503
12580
  const renderButton = (index) => {
12504
12581
  const current22 = typeof index === "number" ? props.modelValue[index] : props.modelValue;
12505
12582
  return vue.createVNode("div", {
12583
+ "ref": slider,
12506
12584
  "role": "slider",
12507
12585
  "class": getButtonClassName(index),
12508
12586
  "tabindex": props.disabled ? void 0 : 0,
@@ -12518,7 +12596,6 @@ var stdin_default$f = vue.defineComponent({
12518
12596
  }
12519
12597
  onTouchStart(event);
12520
12598
  },
12521
- "onTouchmove": onTouchMove,
12522
12599
  "onTouchend": onTouchEnd,
12523
12600
  "onTouchcancel": onTouchEnd,
12524
12601
  "onClick": stopPropagation
@@ -12526,6 +12603,9 @@ var stdin_default$f = vue.defineComponent({
12526
12603
  };
12527
12604
  updateValue(props.modelValue);
12528
12605
  use.useCustomFieldValue(() => props.modelValue);
12606
+ use.useEventListener("touchmove", onTouchMove, {
12607
+ target: slider
12608
+ });
12529
12609
  return () => vue.createVNode("div", {
12530
12610
  "ref": root,
12531
12611
  "style": wrapperStyle.value,
@@ -13250,6 +13330,9 @@ var stdin_default$9 = vue.defineComponent({
13250
13330
  use.useClickAway(root, () => onClick("outside"), {
13251
13331
  eventName: "touchstart"
13252
13332
  });
13333
+ use.useEventListener("touchmove", onTouchMove, {
13334
+ target: root
13335
+ });
13253
13336
  return () => {
13254
13337
  var _a;
13255
13338
  const wrapperStyle = {
@@ -13261,7 +13344,6 @@ var stdin_default$9 = vue.defineComponent({
13261
13344
  "class": bem$4(),
13262
13345
  "onClick": getClickHandler("cell", lockClick2),
13263
13346
  "onTouchstartPassive": onTouchStart,
13264
- "onTouchmove": onTouchMove,
13265
13347
  "onTouchend": onTouchEnd,
13266
13348
  "onTouchcancel": onTouchEnd
13267
13349
  }, [vue.createVNode("div", {
@@ -13995,7 +14077,10 @@ function getBestSelectionFromSrcset(el, scale) {
13995
14077
  tmpWidth = 999998;
13996
14078
  } else {
13997
14079
  tmpSrc = item.substr(0, spaceIndex);
13998
- tmpWidth = parseInt(item.substr(spaceIndex + 1, item.length - spaceIndex - 2), 10);
14080
+ tmpWidth = parseInt(
14081
+ item.substr(spaceIndex + 1, item.length - spaceIndex - 2),
14082
+ 10
14083
+ );
13999
14084
  }
14000
14085
  return [tmpWidth, tmpSrc];
14001
14086
  });
@@ -14186,24 +14271,32 @@ class ReactiveListener {
14186
14271
  }
14187
14272
  renderLoading(cb) {
14188
14273
  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
- });
14274
+ loadImageAsync(
14275
+ {
14276
+ src: this.loading,
14277
+ cors: this.cors
14278
+ },
14279
+ () => {
14280
+ this.render("loading", false);
14281
+ this.state.loading = false;
14282
+ cb();
14283
+ },
14284
+ () => {
14285
+ cb();
14286
+ this.state.loading = false;
14287
+ if (process.env.NODE_ENV !== "production" && !this.options.silent)
14288
+ console.warn(
14289
+ `[@vant/lazyload] load failed with loading image(${this.loading})`
14290
+ );
14291
+ }
14292
+ );
14202
14293
  }
14203
14294
  load(onFinish = noop) {
14204
14295
  if (this.attempt > this.options.attempt - 1 && this.state.error) {
14205
14296
  if (process.env.NODE_ENV !== "production" && !this.options.silent) {
14206
- console.log(`[@vant/lazyload] ${this.src} tried too more than ${this.options.attempt} times`);
14297
+ console.log(
14298
+ `[@vant/lazyload] ${this.src} tried too more than ${this.options.attempt} times`
14299
+ );
14207
14300
  }
14208
14301
  onFinish();
14209
14302
  return;
@@ -14221,25 +14314,29 @@ class ReactiveListener {
14221
14314
  this.attempt++;
14222
14315
  (_b = (_a = this.options.adapter).beforeLoad) == null ? void 0 : _b.call(_a, this, this.options);
14223
14316
  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
- });
14317
+ loadImageAsync(
14318
+ {
14319
+ src: this.src,
14320
+ cors: this.cors
14321
+ },
14322
+ (data) => {
14323
+ this.naturalHeight = data.naturalHeight;
14324
+ this.naturalWidth = data.naturalWidth;
14325
+ this.state.loaded = true;
14326
+ this.state.error = false;
14327
+ this.record("loadEnd");
14328
+ this.render("loaded", false);
14329
+ this.state.rendered = true;
14330
+ this.imageCache.add(this.src);
14331
+ onFinish();
14332
+ },
14333
+ (err) => {
14334
+ !this.options.silent && console.error(err);
14335
+ this.state.error = true;
14336
+ this.state.loaded = false;
14337
+ this.render("error", false);
14338
+ }
14339
+ );
14243
14340
  });
14244
14341
  }
14245
14342
  render(state, cache) {
@@ -14324,7 +14421,10 @@ function stdin_default$3() {
14324
14421
  };
14325
14422
  this.initEvent();
14326
14423
  this.imageCache = new ImageCache({ max: 200 });
14327
- this.lazyLoadHandler = throttle(this.lazyLoadHandler.bind(this), this.options.throttleWait);
14424
+ this.lazyLoadHandler = throttle(
14425
+ this.lazyLoadHandler.bind(this),
14426
+ this.options.throttleWait
14427
+ );
14328
14428
  this.setMode(this.options.observer ? modeType.observer : modeType.event);
14329
14429
  }
14330
14430
  config(options = {}) {
@@ -14479,7 +14579,9 @@ function stdin_default$3() {
14479
14579
  });
14480
14580
  }
14481
14581
  initListen(el, start) {
14482
- this.options.ListenEvents.forEach((evt) => (start ? on : off)(el, evt, this.lazyLoadHandler));
14582
+ this.options.ListenEvents.forEach(
14583
+ (evt) => (start ? on : off)(el, evt, this.lazyLoadHandler)
14584
+ );
14483
14585
  }
14484
14586
  initEvent() {
14485
14587
  this.Event = {
@@ -14536,7 +14638,10 @@ function stdin_default$3() {
14536
14638
  if (!hasIntersectionObserver) {
14537
14639
  return;
14538
14640
  }
14539
- this.observer = new IntersectionObserver(this.observerHandler.bind(this), this.options.observerOptions);
14641
+ this.observer = new IntersectionObserver(
14642
+ this.observerHandler.bind(this),
14643
+ this.options.observerOptions
14644
+ );
14540
14645
  if (this.listeners.length) {
14541
14646
  this.listeners.forEach((listener) => {
14542
14647
  this.observer.observe(listener.el);
@@ -14615,7 +14720,10 @@ var stdin_default$2 = (lazy) => ({
14615
14720
  },
14616
14721
  emits: ["show"],
14617
14722
  render() {
14618
- return vue.h(this.tag, this.show && this.$slots.default ? this.$slots.default() : null);
14723
+ return vue.h(
14724
+ this.tag,
14725
+ this.show && this.$slots.default ? this.$slots.default() : null
14726
+ );
14619
14727
  },
14620
14728
  data() {
14621
14729
  return {
@@ -14667,13 +14775,17 @@ class LazyContainer {
14667
14775
  this.options = Object.assign({}, defaultOptions, binding.value);
14668
14776
  const imgs = this.getImgs();
14669
14777
  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);
14778
+ this.lazy.add(
14779
+ el2,
14780
+ Object.assign({}, this.binding, {
14781
+ value: {
14782
+ src: "dataset" in el2 ? el2.dataset.src : el2.getAttribute("data-src"),
14783
+ error: ("dataset" in el2 ? el2.dataset.error : el2.getAttribute("data-error")) || this.options.error,
14784
+ loading: ("dataset" in el2 ? el2.dataset.loading : el2.getAttribute("data-loading")) || this.options.loading
14785
+ }
14786
+ }),
14787
+ this.vnode
14788
+ );
14677
14789
  });
14678
14790
  }
14679
14791
  getImgs() {
@@ -14724,11 +14836,15 @@ var stdin_default$1 = (lazyManager) => ({
14724
14836
  }
14725
14837
  },
14726
14838
  render(h) {
14727
- return h(this.tag, {
14728
- attrs: {
14729
- src: this.renderSrc
14730
- }
14731
- }, this.$slots.default);
14839
+ return h(
14840
+ this.tag,
14841
+ {
14842
+ attrs: {
14843
+ src: this.renderSrc
14844
+ }
14845
+ },
14846
+ this.$slots.default
14847
+ );
14732
14848
  },
14733
14849
  data() {
14734
14850
  return {
@@ -14782,20 +14898,26 @@ var stdin_default$1 = (lazyManager) => ({
14782
14898
  load(onFinish = noop) {
14783
14899
  if (this.state.attempt > this.options.attempt - 1 && this.state.error) {
14784
14900
  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`);
14901
+ console.log(
14902
+ `[@vant/lazyload] ${this.options.src} tried too more than ${this.options.attempt} times`
14903
+ );
14786
14904
  }
14787
14905
  onFinish();
14788
14906
  return;
14789
14907
  }
14790
14908
  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
- });
14909
+ loadImageAsync(
14910
+ { src },
14911
+ ({ src: src2 }) => {
14912
+ this.renderSrc = src2;
14913
+ this.state.loaded = true;
14914
+ },
14915
+ () => {
14916
+ this.state.attempt++;
14917
+ this.renderSrc = this.options.error;
14918
+ this.state.error = true;
14919
+ }
14920
+ );
14799
14921
  }
14800
14922
  }
14801
14923
  });
@@ -14823,7 +14945,7 @@ const Lazyload = {
14823
14945
  });
14824
14946
  }
14825
14947
  };
14826
- const version = "3.6.1";
14948
+ const version = "3.6.3";
14827
14949
  function install(app) {
14828
14950
  const components = [
14829
14951
  ActionBar,