vant 3.5.4 → 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 (360) hide show
  1. package/README.md +4 -0
  2. package/changelog.generated.md +30 -33
  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/Badge.mjs +1 -1
  11. package/es/badge/index.d.ts +1 -1
  12. package/es/calendar/Calendar.mjs +7 -7
  13. package/es/cell/Cell.d.ts +1 -1
  14. package/es/cell/index.d.ts +1 -1
  15. package/es/cell-group/CellGroup.d.ts +1 -1
  16. package/es/cell-group/index.d.ts +1 -1
  17. package/es/col/Col.d.ts +1 -1
  18. package/es/col/index.d.ts +1 -1
  19. package/es/collapse-item/CollapseItem.d.ts +1 -1
  20. package/es/collapse-item/index.d.ts +1 -1
  21. package/es/composables/use-global-z-index.d.ts +4 -0
  22. package/es/composables/use-global-z-index.mjs +9 -0
  23. package/es/composables/use-height.mjs +2 -0
  24. package/es/composables/use-lazy-render.mjs +9 -5
  25. package/es/composables/use-lock-scroll.mjs +7 -2
  26. package/es/composables/use-visibility-change.mjs +6 -3
  27. package/es/config-provider/ConfigProvider.d.ts +4 -1
  28. package/es/config-provider/ConfigProvider.mjs +8 -1
  29. package/es/config-provider/index.d.ts +3 -1
  30. package/es/coupon/Coupon.d.ts +1 -1
  31. package/es/coupon/index.d.ts +1 -1
  32. package/es/coupon/utils.mjs +3 -1
  33. package/es/coupon-cell/CouponCell.d.ts +1 -1
  34. package/es/coupon-cell/index.d.ts +1 -1
  35. package/es/datetime-picker/DatetimePicker.d.ts +1 -1
  36. package/es/datetime-picker/index.d.ts +1 -1
  37. package/es/divider/Divider.d.ts +1 -1
  38. package/es/divider/index.d.ts +1 -1
  39. package/es/dropdown-item/DropdownItem.d.ts +2 -2
  40. package/es/dropdown-item/index.d.ts +2 -2
  41. package/es/dropdown-menu/DropdownMenu.d.ts +1 -1
  42. package/es/dropdown-menu/DropdownMenu.mjs +2 -1
  43. package/es/dropdown-menu/index.d.ts +1 -1
  44. package/es/empty/Empty.d.ts +2 -2
  45. package/es/empty/Empty.mjs +281 -16
  46. package/es/empty/index.d.ts +1 -1
  47. package/es/field/Field.mjs +14 -4
  48. package/es/field/types.d.ts +1 -0
  49. package/es/field/utils.d.ts +1 -0
  50. package/es/field/utils.mjs +8 -2
  51. package/es/grid/Grid.d.ts +1 -1
  52. package/es/grid/index.d.ts +1 -1
  53. package/es/grid-item/GridItem.d.ts +1 -1
  54. package/es/grid-item/index.d.ts +1 -1
  55. package/es/icon/Icon.d.ts +1 -1
  56. package/es/icon/index.d.ts +1 -1
  57. package/es/image-preview/ImagePreviewItem.mjs +11 -3
  58. package/es/index-anchor/IndexAnchor.d.ts +1 -1
  59. package/es/index-anchor/index.d.ts +1 -1
  60. package/es/index-bar/IndexBar.mjs +9 -4
  61. package/es/index.d.ts +2 -1
  62. package/es/index.mjs +4 -1
  63. package/es/lazyload/vue-lazyload/lazy-component.mjs +4 -1
  64. package/es/lazyload/vue-lazyload/lazy-container.mjs +11 -7
  65. package/es/lazyload/vue-lazyload/lazy-image.mjs +24 -14
  66. package/es/lazyload/vue-lazyload/lazy.mjs +11 -3
  67. package/es/lazyload/vue-lazyload/listener.mjs +45 -33
  68. package/es/lazyload/vue-lazyload/util.mjs +4 -1
  69. package/es/list/List.mjs +2 -1
  70. package/es/loading/Loading.d.ts +1 -1
  71. package/es/loading/index.d.ts +1 -1
  72. package/es/number-keyboard/NumberKeyboard.d.ts +1 -1
  73. package/es/number-keyboard/NumberKeyboard.mjs +1 -2
  74. package/es/number-keyboard/NumberKeyboardKey.mjs +2 -2
  75. package/es/number-keyboard/index.d.ts +1 -1
  76. package/es/overlay/Overlay.d.ts +1 -1
  77. package/es/overlay/Overlay.mjs +13 -6
  78. package/es/overlay/index.d.ts +1 -1
  79. package/es/password-input/PasswordInput.mjs +1 -1
  80. package/es/picker/Picker.mjs +7 -3
  81. package/es/picker/PickerColumn.mjs +7 -3
  82. package/es/popover/Popover.mjs +11 -9
  83. package/es/popup/Popup.d.ts +2 -2
  84. package/es/popup/Popup.mjs +6 -5
  85. package/es/popup/index.d.ts +2 -2
  86. package/es/popup/shared.mjs +3 -1
  87. package/es/progress/Progress.d.ts +1 -1
  88. package/es/progress/index.d.ts +1 -1
  89. package/es/pull-refresh/PullRefresh.mjs +7 -3
  90. package/es/rate/Rate.mjs +5 -3
  91. package/es/row/Row.d.ts +1 -1
  92. package/es/row/index.d.ts +1 -1
  93. package/es/search/index.css +1 -1
  94. package/es/search/index.less +3 -1
  95. package/es/skeleton/Skeleton.d.ts +1 -1
  96. package/es/skeleton/index.d.ts +1 -1
  97. package/es/slider/Slider.mjs +7 -3
  98. package/es/space/Space.d.ts +48 -0
  99. package/es/space/Space.mjs +87 -0
  100. package/es/space/index.css +1 -0
  101. package/es/space/index.d.ts +37 -0
  102. package/es/space/index.less +38 -0
  103. package/es/space/index.mjs +8 -0
  104. package/es/space/style/index.d.ts +1 -0
  105. package/es/space/style/index.mjs +2 -0
  106. package/es/space/style/less.d.ts +1 -0
  107. package/es/space/style/less.mjs +2 -0
  108. package/es/step/Step.d.ts +1 -1
  109. package/es/step/index.d.ts +1 -1
  110. package/es/stepper/Stepper.mjs +1 -1
  111. package/es/sticky/Sticky.mjs +2 -1
  112. package/es/swipe/Swipe.mjs +14 -7
  113. package/es/swipe-cell/SwipeCell.d.ts +2 -2
  114. package/es/swipe-cell/SwipeCell.mjs +5 -3
  115. package/es/swipe-cell/index.d.ts +2 -2
  116. package/es/swipe-item/SwipeItem.d.ts +1 -1
  117. package/es/swipe-item/index.d.ts +1 -1
  118. package/es/tab/Tab.d.ts +1 -1
  119. package/es/tab/index.d.ts +1 -1
  120. package/es/tabs/Tabs.d.ts +1 -1
  121. package/es/tabs/Tabs.mjs +12 -2
  122. package/es/tabs/TabsContent.mjs +4 -0
  123. package/es/tabs/TabsTitle.d.ts +1 -1
  124. package/es/tabs/index.d.ts +1 -1
  125. package/es/utils/create.mjs +8 -2
  126. package/es/utils/with-install.d.ts +2 -2
  127. package/es/utils/with-install.mjs +4 -2
  128. package/es/vue-tsx-shim.d.ts +7 -0
  129. package/lib/action-bar/ActionBar.d.ts +1 -1
  130. package/lib/action-bar/index.d.ts +1 -1
  131. package/lib/action-bar/index.js +4 -1
  132. package/lib/action-bar-button/ActionBarButton.d.ts +1 -1
  133. package/lib/action-bar-button/index.d.ts +1 -1
  134. package/lib/action-bar-button/index.js +4 -1
  135. package/lib/action-bar-icon/ActionBarIcon.d.ts +1 -1
  136. package/lib/action-bar-icon/index.d.ts +1 -1
  137. package/lib/action-bar-icon/index.js +4 -1
  138. package/lib/action-sheet/index.js +4 -1
  139. package/lib/address-edit/AddressEdit.js +4 -1
  140. package/lib/address-edit/index.js +4 -1
  141. package/lib/address-list/AddressList.js +4 -1
  142. package/lib/address-list/index.js +4 -1
  143. package/lib/area/index.js +4 -1
  144. package/lib/badge/Badge.d.ts +1 -1
  145. package/lib/badge/Badge.js +1 -1
  146. package/lib/badge/index.d.ts +1 -1
  147. package/lib/badge/index.js +4 -1
  148. package/lib/button/index.js +4 -1
  149. package/lib/calendar/Calendar.js +11 -8
  150. package/lib/calendar/CalendarMonth.js +4 -1
  151. package/lib/calendar/index.js +4 -1
  152. package/lib/card/index.js +4 -1
  153. package/lib/cascader/index.js +4 -1
  154. package/lib/cell/Cell.d.ts +1 -1
  155. package/lib/cell/index.d.ts +1 -1
  156. package/lib/cell/index.js +4 -1
  157. package/lib/cell-group/CellGroup.d.ts +1 -1
  158. package/lib/cell-group/index.d.ts +1 -1
  159. package/lib/cell-group/index.js +4 -1
  160. package/lib/checkbox/Checkbox.js +4 -1
  161. package/lib/checkbox/index.js +4 -1
  162. package/lib/checkbox-group/index.js +4 -1
  163. package/lib/circle/index.js +4 -1
  164. package/lib/col/Col.d.ts +1 -1
  165. package/lib/col/index.d.ts +1 -1
  166. package/lib/col/index.js +4 -1
  167. package/lib/collapse/index.js +4 -1
  168. package/lib/collapse-item/CollapseItem.d.ts +1 -1
  169. package/lib/collapse-item/index.d.ts +1 -1
  170. package/lib/collapse-item/index.js +4 -1
  171. package/lib/composables/use-global-z-index.d.ts +4 -0
  172. package/lib/composables/use-global-z-index.js +28 -0
  173. package/lib/composables/use-height.js +2 -0
  174. package/lib/composables/use-lazy-render.js +9 -5
  175. package/lib/composables/use-lock-scroll.js +7 -2
  176. package/lib/composables/use-visibility-change.js +6 -3
  177. package/lib/config-provider/ConfigProvider.d.ts +4 -1
  178. package/lib/config-provider/ConfigProvider.js +7 -0
  179. package/lib/config-provider/index.d.ts +3 -1
  180. package/lib/config-provider/index.js +4 -1
  181. package/lib/contact-card/index.js +4 -1
  182. package/lib/contact-edit/index.js +4 -1
  183. package/lib/contact-list/index.js +4 -1
  184. package/lib/count-down/index.js +4 -1
  185. package/lib/coupon/Coupon.d.ts +1 -1
  186. package/lib/coupon/index.d.ts +1 -1
  187. package/lib/coupon/index.js +4 -1
  188. package/lib/coupon/utils.js +3 -1
  189. package/lib/coupon-cell/CouponCell.d.ts +1 -1
  190. package/lib/coupon-cell/index.d.ts +1 -1
  191. package/lib/coupon-cell/index.js +4 -1
  192. package/lib/coupon-list/index.js +4 -1
  193. package/lib/datetime-picker/DatetimePicker.d.ts +1 -1
  194. package/lib/datetime-picker/DatetimePicker.js +4 -1
  195. package/lib/datetime-picker/index.d.ts +1 -1
  196. package/lib/datetime-picker/index.js +4 -1
  197. package/lib/dialog/function-call.js +4 -1
  198. package/lib/divider/Divider.d.ts +1 -1
  199. package/lib/divider/index.d.ts +1 -1
  200. package/lib/divider/index.js +4 -1
  201. package/lib/dropdown-item/DropdownItem.d.ts +2 -2
  202. package/lib/dropdown-item/index.d.ts +2 -2
  203. package/lib/dropdown-item/index.js +4 -1
  204. package/lib/dropdown-menu/DropdownMenu.d.ts +1 -1
  205. package/lib/dropdown-menu/DropdownMenu.js +2 -1
  206. package/lib/dropdown-menu/index.d.ts +1 -1
  207. package/lib/dropdown-menu/index.js +4 -1
  208. package/lib/empty/Empty.d.ts +2 -2
  209. package/lib/empty/Empty.js +281 -16
  210. package/lib/empty/index.d.ts +1 -1
  211. package/lib/empty/index.js +4 -1
  212. package/lib/field/Field.js +12 -2
  213. package/lib/field/index.js +4 -1
  214. package/lib/field/types.d.ts +1 -0
  215. package/lib/field/utils.d.ts +1 -0
  216. package/lib/field/utils.js +8 -2
  217. package/lib/form/index.js +4 -1
  218. package/lib/grid/Grid.d.ts +1 -1
  219. package/lib/grid/index.d.ts +1 -1
  220. package/lib/grid/index.js +4 -1
  221. package/lib/grid-item/GridItem.d.ts +1 -1
  222. package/lib/grid-item/index.d.ts +1 -1
  223. package/lib/grid-item/index.js +4 -1
  224. package/lib/icon/Icon.d.ts +1 -1
  225. package/lib/icon/index.d.ts +1 -1
  226. package/lib/icon/index.js +4 -1
  227. package/lib/image/index.js +4 -1
  228. package/lib/image-preview/ImagePreview.js +4 -1
  229. package/lib/image-preview/ImagePreviewItem.js +10 -2
  230. package/lib/image-preview/function-call.js +4 -1
  231. package/lib/index-anchor/IndexAnchor.d.ts +1 -1
  232. package/lib/index-anchor/index.d.ts +1 -1
  233. package/lib/index-anchor/index.js +4 -1
  234. package/lib/index-bar/IndexBar.js +9 -4
  235. package/lib/index-bar/index.js +4 -1
  236. package/lib/index.css +1 -1
  237. package/lib/index.d.ts +2 -1
  238. package/lib/index.js +4 -1
  239. package/lib/index.less +1 -0
  240. package/lib/lazyload/vue-lazyload/index.js +4 -1
  241. package/lib/lazyload/vue-lazyload/lazy-component.js +4 -1
  242. package/lib/lazyload/vue-lazyload/lazy-container.js +11 -7
  243. package/lib/lazyload/vue-lazyload/lazy-image.js +24 -14
  244. package/lib/lazyload/vue-lazyload/lazy.js +15 -4
  245. package/lib/lazyload/vue-lazyload/listener.js +45 -33
  246. package/lib/lazyload/vue-lazyload/util.js +4 -1
  247. package/lib/list/List.js +2 -1
  248. package/lib/list/index.js +4 -1
  249. package/lib/loading/Loading.d.ts +1 -1
  250. package/lib/loading/index.d.ts +1 -1
  251. package/lib/loading/index.js +4 -1
  252. package/lib/locale/index.js +4 -1
  253. package/lib/nav-bar/index.js +4 -1
  254. package/lib/notice-bar/index.js +4 -1
  255. package/lib/notify/function-call.js +4 -1
  256. package/lib/number-keyboard/NumberKeyboard.d.ts +1 -1
  257. package/lib/number-keyboard/NumberKeyboard.js +5 -3
  258. package/lib/number-keyboard/NumberKeyboardKey.js +2 -2
  259. package/lib/number-keyboard/index.d.ts +1 -1
  260. package/lib/number-keyboard/index.js +4 -1
  261. package/lib/overlay/Overlay.d.ts +1 -1
  262. package/lib/overlay/Overlay.js +11 -4
  263. package/lib/overlay/index.d.ts +1 -1
  264. package/lib/overlay/index.js +4 -1
  265. package/lib/pagination/index.js +4 -1
  266. package/lib/password-input/PasswordInput.js +1 -1
  267. package/lib/password-input/index.js +4 -1
  268. package/lib/picker/Picker.js +10 -3
  269. package/lib/picker/PickerColumn.js +6 -2
  270. package/lib/picker/index.js +4 -1
  271. package/lib/popover/Popover.js +10 -8
  272. package/lib/popover/index.js +4 -1
  273. package/lib/popup/Popup.d.ts +2 -2
  274. package/lib/popup/Popup.js +6 -5
  275. package/lib/popup/index.d.ts +2 -2
  276. package/lib/popup/index.js +4 -1
  277. package/lib/popup/shared.js +3 -1
  278. package/lib/progress/Progress.d.ts +1 -1
  279. package/lib/progress/index.d.ts +1 -1
  280. package/lib/progress/index.js +4 -1
  281. package/lib/pull-refresh/PullRefresh.js +6 -2
  282. package/lib/pull-refresh/index.js +4 -1
  283. package/lib/radio/Radio.js +4 -1
  284. package/lib/radio/index.js +4 -1
  285. package/lib/radio-group/index.js +4 -1
  286. package/lib/rate/Rate.js +4 -2
  287. package/lib/rate/index.js +4 -1
  288. package/lib/row/Row.d.ts +1 -1
  289. package/lib/row/index.d.ts +1 -1
  290. package/lib/row/index.js +4 -1
  291. package/lib/search/index.css +1 -1
  292. package/lib/search/index.js +4 -1
  293. package/lib/search/index.less +3 -1
  294. package/lib/share-sheet/index.js +4 -1
  295. package/lib/sidebar/index.js +4 -1
  296. package/lib/sidebar-item/index.js +4 -1
  297. package/lib/skeleton/Skeleton.d.ts +1 -1
  298. package/lib/skeleton/index.d.ts +1 -1
  299. package/lib/skeleton/index.js +4 -1
  300. package/lib/slider/Slider.js +6 -2
  301. package/lib/slider/index.js +4 -1
  302. package/lib/space/Space.d.ts +48 -0
  303. package/lib/space/Space.js +106 -0
  304. package/lib/space/index.css +1 -0
  305. package/lib/space/index.d.ts +37 -0
  306. package/lib/space/index.js +33 -0
  307. package/lib/space/index.less +38 -0
  308. package/lib/space/style/index.d.ts +1 -0
  309. package/lib/space/style/index.js +2 -0
  310. package/lib/space/style/less.d.ts +1 -0
  311. package/lib/space/style/less.js +2 -0
  312. package/lib/step/Step.d.ts +1 -1
  313. package/lib/step/index.d.ts +1 -1
  314. package/lib/step/index.js +4 -1
  315. package/lib/stepper/Stepper.js +1 -1
  316. package/lib/stepper/index.js +4 -1
  317. package/lib/steps/index.js +4 -1
  318. package/lib/sticky/Sticky.js +2 -1
  319. package/lib/sticky/index.js +4 -1
  320. package/lib/submit-bar/index.js +4 -1
  321. package/lib/swipe/Swipe.js +13 -6
  322. package/lib/swipe/index.js +4 -1
  323. package/lib/swipe-cell/SwipeCell.d.ts +2 -2
  324. package/lib/swipe-cell/SwipeCell.js +4 -2
  325. package/lib/swipe-cell/index.d.ts +2 -2
  326. package/lib/swipe-cell/index.js +4 -1
  327. package/lib/swipe-item/SwipeItem.d.ts +1 -1
  328. package/lib/swipe-item/index.d.ts +1 -1
  329. package/lib/swipe-item/index.js +4 -1
  330. package/lib/switch/index.js +4 -1
  331. package/lib/tab/Tab.d.ts +1 -1
  332. package/lib/tab/index.d.ts +1 -1
  333. package/lib/tab/index.js +4 -1
  334. package/lib/tabbar/index.js +4 -1
  335. package/lib/tabbar-item/index.js +4 -1
  336. package/lib/tabs/Tabs.d.ts +1 -1
  337. package/lib/tabs/Tabs.js +16 -3
  338. package/lib/tabs/TabsContent.js +4 -0
  339. package/lib/tabs/TabsTitle.d.ts +1 -1
  340. package/lib/tabs/index.d.ts +1 -1
  341. package/lib/tabs/index.js +4 -1
  342. package/lib/tag/index.js +4 -1
  343. package/lib/toast/function-call.js +4 -1
  344. package/lib/tree-select/index.js +4 -1
  345. package/lib/uploader/Uploader.js +4 -1
  346. package/lib/uploader/index.js +4 -1
  347. package/lib/utils/create.js +12 -3
  348. package/lib/utils/with-install.d.ts +2 -2
  349. package/lib/utils/with-install.js +4 -2
  350. package/lib/vant.cjs.js +1408 -1170
  351. package/lib/vant.es.js +1409 -1171
  352. package/lib/vant.js +1460 -1198
  353. package/lib/vant.min.js +1 -1
  354. package/lib/vue-tsx-shim.d.ts +7 -0
  355. package/lib/web-types.json +1822 -1750
  356. package/package.json +8 -8
  357. package/es/empty/Images.d.ts +0 -4
  358. package/es/empty/Images.mjs +0 -271
  359. package/lib/empty/Images.d.ts +0 -4
  360. package/lib/empty/Images.js +0 -290
@@ -31,6 +31,7 @@ var stdin_default = defineComponent({
31
31
  slots
32
32
  }) {
33
33
  const root = ref();
34
+ const sidebar = ref();
34
35
  const activeAnchor = ref("");
35
36
  const touch = useTouch();
36
37
  const scrollParent = useScrollParent(root);
@@ -121,7 +122,8 @@ var stdin_default = defineComponent({
121
122
  nextTick(onScroll);
122
123
  };
123
124
  useEventListener("scroll", onScroll, {
124
- target: scrollParent
125
+ target: scrollParent,
126
+ passive: true
125
127
  });
126
128
  onMounted(init);
127
129
  watch(() => props.indexList, init);
@@ -149,11 +151,11 @@ var stdin_default = defineComponent({
149
151
  const {
150
152
  offsetHeight
151
153
  } = document.documentElement;
154
+ match.$el.scrollIntoView();
152
155
  if (scrollTop === offsetHeight - scrollParentRect.height) {
153
156
  onScroll();
154
157
  return;
155
158
  }
156
- match.$el.scrollIntoView();
157
159
  if (props.sticky && props.stickyOffsetTop) {
158
160
  setRootScrollTop(getRootScrollTop() - props.stickyOffsetTop);
159
161
  }
@@ -193,15 +195,18 @@ var stdin_default = defineComponent({
193
195
  }
194
196
  };
195
197
  const renderSidebar = () => _createVNode("div", {
198
+ "ref": sidebar,
196
199
  "class": bem("sidebar"),
197
200
  "style": sidebarStyle.value,
198
201
  "onClick": onClickSidebar,
199
- "onTouchstart": touch.start,
200
- "onTouchmove": onTouchMove
202
+ "onTouchstartPassive": touch.start
201
203
  }, [renderIndexes()]);
202
204
  useExpose({
203
205
  scrollTo
204
206
  });
207
+ useEventListener("touchmove", onTouchMove, {
208
+ target: sidebar
209
+ });
205
210
  return () => {
206
211
  var _a;
207
212
  return _createVNode("div", {
package/es/index.d.ts CHANGED
@@ -67,6 +67,7 @@ export * from "./sidebar";
67
67
  export * from "./sidebar-item";
68
68
  export * from "./skeleton";
69
69
  export * from "./slider";
70
+ export * from "./space";
70
71
  export * from "./step";
71
72
  export * from "./stepper";
72
73
  export * from "./steps";
@@ -90,4 +91,4 @@ declare namespace _default {
90
91
  }
91
92
  export default _default;
92
93
  export function install(app: any): void;
93
- export const version: "3.5.4";
94
+ export const version: "3.6.2";
package/es/index.mjs CHANGED
@@ -66,6 +66,7 @@ import { Sidebar } from "./sidebar/index.mjs";
66
66
  import { SidebarItem } from "./sidebar-item/index.mjs";
67
67
  import { Skeleton } from "./skeleton/index.mjs";
68
68
  import { Slider } from "./slider/index.mjs";
69
+ import { Space } from "./space/index.mjs";
69
70
  import { Step } from "./step/index.mjs";
70
71
  import { Stepper } from "./stepper/index.mjs";
71
72
  import { Steps } from "./steps/index.mjs";
@@ -83,7 +84,7 @@ import { Tag } from "./tag/index.mjs";
83
84
  import { Toast } from "./toast/index.mjs";
84
85
  import { TreeSelect } from "./tree-select/index.mjs";
85
86
  import { Uploader } from "./uploader/index.mjs";
86
- const version = "3.5.4";
87
+ const version = "3.6.2";
87
88
  function install(app) {
88
89
  const components = [
89
90
  ActionBar,
@@ -154,6 +155,7 @@ function install(app) {
154
155
  SidebarItem,
155
156
  Skeleton,
156
157
  Slider,
158
+ Space,
157
159
  Step,
158
160
  Stepper,
159
161
  Steps,
@@ -249,6 +251,7 @@ export * from "./sidebar/index.mjs";
249
251
  export * from "./sidebar-item/index.mjs";
250
252
  export * from "./skeleton/index.mjs";
251
253
  export * from "./slider/index.mjs";
254
+ export * from "./space/index.mjs";
252
255
  export * from "./step/index.mjs";
253
256
  export * from "./stepper/index.mjs";
254
257
  export * from "./steps/index.mjs";
@@ -9,7 +9,10 @@ var stdin_default = (lazy) => ({
9
9
  },
10
10
  emits: ["show"],
11
11
  render() {
12
- return h(this.tag, this.show && this.$slots.default ? this.$slots.default() : null);
12
+ return h(
13
+ this.tag,
14
+ this.show && this.$slots.default ? this.$slots.default() : null
15
+ );
13
16
  },
14
17
  data() {
15
18
  return {
@@ -17,13 +17,17 @@ class LazyContainer {
17
17
  this.options = Object.assign({}, defaultOptions, binding.value);
18
18
  const imgs = this.getImgs();
19
19
  imgs.forEach((el2) => {
20
- this.lazy.add(el2, Object.assign({}, this.binding, {
21
- value: {
22
- src: "dataset" in el2 ? el2.dataset.src : el2.getAttribute("data-src"),
23
- error: ("dataset" in el2 ? el2.dataset.error : el2.getAttribute("data-error")) || this.options.error,
24
- loading: ("dataset" in el2 ? el2.dataset.loading : el2.getAttribute("data-loading")) || this.options.loading
25
- }
26
- }), this.vnode);
20
+ this.lazy.add(
21
+ el2,
22
+ Object.assign({}, this.binding, {
23
+ value: {
24
+ src: "dataset" in el2 ? el2.dataset.src : el2.getAttribute("data-src"),
25
+ error: ("dataset" in el2 ? el2.dataset.error : el2.getAttribute("data-error")) || this.options.error,
26
+ loading: ("dataset" in el2 ? el2.dataset.loading : el2.getAttribute("data-loading")) || this.options.loading
27
+ }
28
+ }),
29
+ this.vnode
30
+ );
27
31
  });
28
32
  }
29
33
  getImgs() {
@@ -10,11 +10,15 @@ var stdin_default = (lazyManager) => ({
10
10
  }
11
11
  },
12
12
  render(h) {
13
- return h(this.tag, {
14
- attrs: {
15
- src: this.renderSrc
16
- }
17
- }, this.$slots.default);
13
+ return h(
14
+ this.tag,
15
+ {
16
+ attrs: {
17
+ src: this.renderSrc
18
+ }
19
+ },
20
+ this.$slots.default
21
+ );
18
22
  },
19
23
  data() {
20
24
  return {
@@ -68,20 +72,26 @@ var stdin_default = (lazyManager) => ({
68
72
  load(onFinish = noop) {
69
73
  if (this.state.attempt > this.options.attempt - 1 && this.state.error) {
70
74
  if (process.env.NODE_ENV !== "production" && !lazyManager.options.silent) {
71
- console.log(`[@vant/lazyload] ${this.options.src} tried too more than ${this.options.attempt} times`);
75
+ console.log(
76
+ `[@vant/lazyload] ${this.options.src} tried too more than ${this.options.attempt} times`
77
+ );
72
78
  }
73
79
  onFinish();
74
80
  return;
75
81
  }
76
82
  const { src } = this.options;
77
- loadImageAsync({ src }, ({ src: src2 }) => {
78
- this.renderSrc = src2;
79
- this.state.loaded = true;
80
- }, () => {
81
- this.state.attempt++;
82
- this.renderSrc = this.options.error;
83
- this.state.error = true;
84
- });
83
+ loadImageAsync(
84
+ { src },
85
+ ({ src: src2 }) => {
86
+ this.renderSrc = src2;
87
+ this.state.loaded = true;
88
+ },
89
+ () => {
90
+ this.state.attempt++;
91
+ this.renderSrc = this.options.error;
92
+ this.state.error = true;
93
+ }
94
+ );
85
95
  }
86
96
  }
87
97
  });
@@ -69,7 +69,10 @@ function stdin_default() {
69
69
  };
70
70
  this.initEvent();
71
71
  this.imageCache = new ImageCache({ max: 200 });
72
- this.lazyLoadHandler = throttle(this.lazyLoadHandler.bind(this), this.options.throttleWait);
72
+ this.lazyLoadHandler = throttle(
73
+ this.lazyLoadHandler.bind(this),
74
+ this.options.throttleWait
75
+ );
73
76
  this.setMode(this.options.observer ? modeType.observer : modeType.event);
74
77
  }
75
78
  config(options = {}) {
@@ -224,7 +227,9 @@ function stdin_default() {
224
227
  });
225
228
  }
226
229
  initListen(el, start) {
227
- this.options.ListenEvents.forEach((evt) => (start ? on : off)(el, evt, this.lazyLoadHandler));
230
+ this.options.ListenEvents.forEach(
231
+ (evt) => (start ? on : off)(el, evt, this.lazyLoadHandler)
232
+ );
228
233
  }
229
234
  initEvent() {
230
235
  this.Event = {
@@ -281,7 +286,10 @@ function stdin_default() {
281
286
  if (!hasIntersectionObserver) {
282
287
  return;
283
288
  }
284
- this.observer = new IntersectionObserver(this.observerHandler.bind(this), this.options.observerOptions);
289
+ this.observer = new IntersectionObserver(
290
+ this.observerHandler.bind(this),
291
+ this.options.observerOptions
292
+ );
285
293
  if (this.listeners.length) {
286
294
  this.listeners.forEach((listener) => {
287
295
  this.observer.observe(listener.el);
@@ -73,24 +73,32 @@ class ReactiveListener {
73
73
  }
74
74
  renderLoading(cb) {
75
75
  this.state.loading = true;
76
- loadImageAsync({
77
- src: this.loading,
78
- cors: this.cors
79
- }, () => {
80
- this.render("loading", false);
81
- this.state.loading = false;
82
- cb();
83
- }, () => {
84
- cb();
85
- this.state.loading = false;
86
- if (process.env.NODE_ENV !== "production" && !this.options.silent)
87
- console.warn(`[@vant/lazyload] load failed with loading image(${this.loading})`);
88
- });
76
+ loadImageAsync(
77
+ {
78
+ src: this.loading,
79
+ cors: this.cors
80
+ },
81
+ () => {
82
+ this.render("loading", false);
83
+ this.state.loading = false;
84
+ cb();
85
+ },
86
+ () => {
87
+ cb();
88
+ this.state.loading = false;
89
+ if (process.env.NODE_ENV !== "production" && !this.options.silent)
90
+ console.warn(
91
+ `[@vant/lazyload] load failed with loading image(${this.loading})`
92
+ );
93
+ }
94
+ );
89
95
  }
90
96
  load(onFinish = noop) {
91
97
  if (this.attempt > this.options.attempt - 1 && this.state.error) {
92
98
  if (process.env.NODE_ENV !== "production" && !this.options.silent) {
93
- console.log(`[@vant/lazyload] ${this.src} tried too more than ${this.options.attempt} times`);
99
+ console.log(
100
+ `[@vant/lazyload] ${this.src} tried too more than ${this.options.attempt} times`
101
+ );
94
102
  }
95
103
  onFinish();
96
104
  return;
@@ -108,25 +116,29 @@ class ReactiveListener {
108
116
  this.attempt++;
109
117
  (_b = (_a = this.options.adapter).beforeLoad) == null ? void 0 : _b.call(_a, this, this.options);
110
118
  this.record("loadStart");
111
- loadImageAsync({
112
- src: this.src,
113
- cors: this.cors
114
- }, (data) => {
115
- this.naturalHeight = data.naturalHeight;
116
- this.naturalWidth = data.naturalWidth;
117
- this.state.loaded = true;
118
- this.state.error = false;
119
- this.record("loadEnd");
120
- this.render("loaded", false);
121
- this.state.rendered = true;
122
- this.imageCache.add(this.src);
123
- onFinish();
124
- }, (err) => {
125
- !this.options.silent && console.error(err);
126
- this.state.error = true;
127
- this.state.loaded = false;
128
- this.render("error", false);
129
- });
119
+ loadImageAsync(
120
+ {
121
+ src: this.src,
122
+ cors: this.cors
123
+ },
124
+ (data) => {
125
+ this.naturalHeight = data.naturalHeight;
126
+ this.naturalWidth = data.naturalWidth;
127
+ this.state.loaded = true;
128
+ this.state.error = false;
129
+ this.record("loadEnd");
130
+ this.render("loaded", false);
131
+ this.state.rendered = true;
132
+ this.imageCache.add(this.src);
133
+ onFinish();
134
+ },
135
+ (err) => {
136
+ !this.options.silent && console.error(err);
137
+ this.state.error = true;
138
+ this.state.loaded = false;
139
+ this.render("error", false);
140
+ }
141
+ );
130
142
  });
131
143
  }
132
144
  render(state, cache) {
@@ -29,7 +29,10 @@ function getBestSelectionFromSrcset(el, scale) {
29
29
  tmpWidth = 999998;
30
30
  } else {
31
31
  tmpSrc = item.substr(0, spaceIndex);
32
- tmpWidth = parseInt(item.substr(spaceIndex + 1, item.length - spaceIndex - 2), 10);
32
+ tmpWidth = parseInt(
33
+ item.substr(spaceIndex + 1, item.length - spaceIndex - 2),
34
+ 10
35
+ );
33
36
  }
34
37
  return [tmpWidth, tmpSrc];
35
38
  });
package/es/list/List.mjs CHANGED
@@ -115,7 +115,8 @@ var stdin_default = defineComponent({
115
115
  check
116
116
  });
117
117
  useEventListener("scroll", check, {
118
- target: scrollParent
118
+ target: scrollParent,
119
+ passive: true
119
120
  });
120
121
  return () => {
121
122
  var _a;
@@ -22,7 +22,7 @@ declare const _default: import("vue").DefineComponent<{
22
22
  vertical: BooleanConstructor;
23
23
  textSize: (NumberConstructor | StringConstructor)[];
24
24
  textColor: StringConstructor;
25
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
25
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
26
26
  size: (NumberConstructor | StringConstructor)[];
27
27
  type: {
28
28
  type: import("vue").PropType<LoadingType>;
@@ -8,7 +8,7 @@ export declare const Loading: import("../utils").WithInstall<import("vue").Defin
8
8
  vertical: BooleanConstructor;
9
9
  textSize: (NumberConstructor | StringConstructor)[];
10
10
  textColor: StringConstructor;
11
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
11
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
12
12
  size: (NumberConstructor | StringConstructor)[];
13
13
  type: {
14
14
  type: import("vue").PropType<import("./Loading").LoadingType>;
@@ -92,7 +92,7 @@ declare const _default: import("vue").DefineComponent<{
92
92
  type: PropType<string | string[]>;
93
93
  default: string;
94
94
  };
95
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("input" | "blur" | "update:modelValue" | "hide" | "show" | "close" | "delete")[], "input" | "blur" | "update:modelValue" | "hide" | "show" | "close" | "delete", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
95
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("input" | "blur" | "update:modelValue" | "close" | "hide" | "show" | "delete")[], "input" | "blur" | "update:modelValue" | "close" | "hide" | "show" | "delete", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
96
96
  show: BooleanConstructor;
97
97
  title: StringConstructor;
98
98
  theme: {
@@ -204,9 +204,8 @@ var stdin_default = defineComponent({
204
204
  unfit: !props.safeAreaInsetBottom,
205
205
  "with-title": !!Title
206
206
  }),
207
- "onTouchstart": stopPropagation,
208
207
  "onAnimationend": onAnimationEnd,
209
- "onWebkitAnimationEnd": onAnimationEnd
208
+ "onTouchstartPassive": stopPropagation
210
209
  }, [Title, _createVNode("div", {
211
210
  "class": bem("body")
212
211
  }, [_createVNode("div", {
@@ -74,8 +74,8 @@ var stdin_default = defineComponent({
74
74
  "class": bem("wrapper", {
75
75
  wider: props.wider
76
76
  }),
77
- "onTouchstart": onTouchStart,
78
- "onTouchmove": onTouchMove,
77
+ "onTouchstartPassive": onTouchStart,
78
+ "onTouchmovePassive": onTouchMove,
79
79
  "onTouchend": onTouchEnd,
80
80
  "onTouchcancel": onTouchEnd
81
81
  }, [_createVNode("div", {
@@ -43,7 +43,7 @@ export declare const NumberKeyboard: import("../utils").WithInstall<import("vue"
43
43
  type: import("vue").PropType<string | string[]>;
44
44
  default: string;
45
45
  };
46
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("input" | "blur" | "update:modelValue" | "hide" | "show" | "close" | "delete")[], "input" | "blur" | "update:modelValue" | "hide" | "show" | "close" | "delete", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
46
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("input" | "blur" | "update:modelValue" | "close" | "hide" | "show" | "delete")[], "input" | "blur" | "update:modelValue" | "close" | "hide" | "show" | "delete", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
47
47
  show: BooleanConstructor;
48
48
  title: StringConstructor;
49
49
  theme: {
@@ -29,7 +29,7 @@ declare const _default: import("vue").DefineComponent<{
29
29
  default: true;
30
30
  };
31
31
  customStyle: PropType<CSSProperties>;
32
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
32
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
33
33
  show: BooleanConstructor;
34
34
  zIndex: (NumberConstructor | StringConstructor)[];
35
35
  duration: (NumberConstructor | StringConstructor)[];
@@ -1,6 +1,7 @@
1
1
  import { withDirectives as _withDirectives, createVNode as _createVNode, vShow as _vShow } from "vue";
2
- import { Transition, defineComponent } from "vue";
3
- import { noop, isDef, extend, truthProp, numericProp, unknownProp, preventDefault, createNamespace, getZIndexStyle } from "../utils/index.mjs";
2
+ import { ref, Transition, defineComponent } from "vue";
3
+ import { isDef, extend, truthProp, numericProp, unknownProp, preventDefault, createNamespace, getZIndexStyle } from "../utils/index.mjs";
4
+ import { useEventListener } from "@vant/use";
4
5
  import { useLazyRender } from "../composables/use-lazy-render.mjs";
5
6
  const [name, bem] = createNamespace("overlay");
6
7
  const overlayProps = {
@@ -18,9 +19,12 @@ var stdin_default = defineComponent({
18
19
  setup(props, {
19
20
  slots
20
21
  }) {
22
+ const root = ref();
21
23
  const lazyRender = useLazyRender(() => props.show || !props.lazyRender);
22
- const preventTouchMove = (event) => {
23
- preventDefault(event, true);
24
+ const onTouchMove = (event) => {
25
+ if (props.lockScroll) {
26
+ preventDefault(event, true);
27
+ }
24
28
  };
25
29
  const renderOverlay = lazyRender(() => {
26
30
  var _a;
@@ -29,11 +33,14 @@ var stdin_default = defineComponent({
29
33
  style.animationDuration = `${props.duration}s`;
30
34
  }
31
35
  return _withDirectives(_createVNode("div", {
36
+ "ref": root,
32
37
  "style": style,
33
- "class": [bem(), props.className],
34
- "onTouchmove": props.lockScroll ? preventTouchMove : noop
38
+ "class": [bem(), props.className]
35
39
  }, [(_a = slots.default) == null ? void 0 : _a.call(slots)]), [[_vShow, props.show]]);
36
40
  });
41
+ useEventListener("touchmove", onTouchMove, {
42
+ target: root
43
+ });
37
44
  return () => _createVNode(Transition, {
38
45
  "name": "van-fade",
39
46
  "appear": true
@@ -12,7 +12,7 @@ export declare const Overlay: import("../utils").WithInstall<import("vue").Defin
12
12
  default: true;
13
13
  };
14
14
  customStyle: import("vue").PropType<import("vue").CSSProperties>;
15
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
15
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
16
16
  show: BooleanConstructor;
17
17
  zIndex: (NumberConstructor | StringConstructor)[];
18
18
  duration: (NumberConstructor | StringConstructor)[];
@@ -66,7 +66,7 @@ var stdin_default = defineComponent({
66
66
  "class": [bem("security"), {
67
67
  [BORDER_SURROUND]: !props.gutter
68
68
  }],
69
- "onTouchstart": onTouchStart
69
+ "onTouchstartPassive": onTouchStart
70
70
  }, [renderPoints()]), info && _createVNode("div", {
71
71
  "class": bem(props.errorInfo ? "error-info" : "info")
72
72
  }, [info])]);
@@ -1,7 +1,7 @@
1
1
  import { createVNode as _createVNode } from "vue";
2
2
  import { ref, watch, computed, defineComponent } from "vue";
3
3
  import { extend, unitToPx, truthProp, makeArrayProp, preventDefault, makeStringProp, makeNumericProp, createNamespace, HAPTICS_FEEDBACK, BORDER_UNSET_TOP_BOTTOM } from "../utils/index.mjs";
4
- import { useChildren } from "@vant/use";
4
+ import { useChildren, useEventListener } from "@vant/use";
5
5
  import { useExpose } from "../composables/use-expose.mjs";
6
6
  import { Loading } from "../loading/index.mjs";
7
7
  import Column, { PICKER_KEY } from "./PickerColumn.mjs";
@@ -42,6 +42,7 @@ var stdin_default = defineComponent({
42
42
  }
43
43
  }
44
44
  const hasOptions = ref(false);
45
+ const columnsRef = ref();
45
46
  const formattedColumns = ref([]);
46
47
  const columnsFieldNames = computed(() => {
47
48
  const {
@@ -278,14 +279,17 @@ var stdin_default = defineComponent({
278
279
  height: `${wrapHeight}px`
279
280
  };
280
281
  return _createVNode("div", {
282
+ "ref": columnsRef,
281
283
  "class": bem("columns"),
282
- "style": columnsStyle,
283
- "onTouchmove": preventDefault
284
+ "style": columnsStyle
284
285
  }, [renderColumnItems(), renderMask(wrapHeight)]);
285
286
  };
286
287
  watch(() => props.columns, format, {
287
288
  immediate: true
288
289
  });
290
+ useEventListener("touchmove", preventDefault, {
291
+ target: columnsRef
292
+ });
289
293
  useExpose({
290
294
  confirm,
291
295
  getValues,
@@ -2,7 +2,7 @@ import { createVNode as _createVNode } from "vue";
2
2
  import { ref, watch, reactive, defineComponent } from "vue";
3
3
  import { deepClone } from "../utils/deep-clone.mjs";
4
4
  import { clamp, isObject, unknownProp, numericProp, makeArrayProp, makeNumberProp, preventDefault, createNamespace, makeRequiredProp } from "../utils/index.mjs";
5
- import { useParent } from "@vant/use";
5
+ import { useEventListener, useParent } from "@vant/use";
6
6
  import { useTouch } from "../composables/use-touch.mjs";
7
7
  import { useExpose } from "../composables/use-expose.mjs";
8
8
  const DEFAULT_DURATION = 200;
@@ -41,6 +41,7 @@ var stdin_default = defineComponent({
41
41
  let touchStartTime;
42
42
  let momentumOffset;
43
43
  let transitionEndTrigger;
44
+ const root = ref();
44
45
  const wrapper = ref();
45
46
  const state = reactive({
46
47
  index: props.defaultIndex,
@@ -216,10 +217,13 @@ var stdin_default = defineComponent({
216
217
  });
217
218
  watch(() => props.initialOptions, setOptions);
218
219
  watch(() => props.defaultIndex, (value) => setIndex(value));
220
+ useEventListener("touchmove", onTouchMove, {
221
+ target: root
222
+ });
219
223
  return () => _createVNode("div", {
224
+ "ref": root,
220
225
  "class": [bem(), props.className],
221
- "onTouchstart": onTouchStart,
222
- "onTouchmove": onTouchMove,
226
+ "onTouchstartPassive": onTouchStart,
223
227
  "onTouchend": onTouchEnd,
224
228
  "onTouchcancel": onTouchEnd
225
229
  }, [_createVNode("ul", {
@@ -1,5 +1,5 @@
1
1
  import { mergeProps as _mergeProps, Fragment as _Fragment, createVNode as _createVNode } from "vue";
2
- import { ref, watch, nextTick, onMounted, onBeforeUnmount, defineComponent } from "vue";
2
+ import { ref, watch, nextTick, onMounted, watchEffect, onBeforeUnmount, defineComponent } from "vue";
3
3
  import { createPopper, offsetModifier } from "@vant/popperjs";
4
4
  import { pick, extend, truthProp, numericProp, unknownProp, BORDER_BOTTOM, makeArrayProp, makeStringProp, createNamespace } from "../utils/index.mjs";
5
5
  import { useClickAway } from "@vant/use";
@@ -41,6 +41,7 @@ var stdin_default = defineComponent({
41
41
  attrs
42
42
  }) {
43
43
  let popper;
44
+ const popupRef = ref();
44
45
  const wrapperRef = ref();
45
46
  const popoverRef = ref();
46
47
  const getPopoverOptions = () => ({
@@ -81,10 +82,6 @@ var stdin_default = defineComponent({
81
82
  updateShow(!props.show);
82
83
  }
83
84
  };
84
- const onTouchstart = (event) => {
85
- event.stopPropagation();
86
- emit("touchstart", event);
87
- };
88
85
  const onClickAction = (action, index) => {
89
86
  if (action.disabled) {
90
87
  return;
@@ -95,7 +92,7 @@ var stdin_default = defineComponent({
95
92
  }
96
93
  };
97
94
  const onClickAway = () => {
98
- if (props.closeOnClickOutside && (!props.overlay || props.closeOnClickOverlay)) {
95
+ if (props.show && props.closeOnClickOutside && (!props.overlay || props.closeOnClickOverlay)) {
99
96
  updateShow(false);
100
97
  }
101
98
  };
@@ -135,7 +132,13 @@ var stdin_default = defineComponent({
135
132
  "onClick": () => onClickAction(action, index)
136
133
  }, [renderActionContent(action, index)]);
137
134
  };
138
- onMounted(updateLocation);
135
+ onMounted(() => {
136
+ updateLocation();
137
+ watchEffect(() => {
138
+ var _a;
139
+ popupRef.value = (_a = popoverRef.value) == null ? void 0 : _a.popupRef.value;
140
+ });
141
+ });
139
142
  onBeforeUnmount(() => {
140
143
  if (popper) {
141
144
  popper.destroy();
@@ -143,7 +146,7 @@ var stdin_default = defineComponent({
143
146
  }
144
147
  });
145
148
  watch(() => [props.show, props.offset, props.placement], updateLocation);
146
- useClickAway(wrapperRef, onClickAway, {
149
+ useClickAway([wrapperRef, popupRef], onClickAway, {
147
150
  eventName: "touchstart"
148
151
  });
149
152
  return () => {
@@ -158,7 +161,6 @@ var stdin_default = defineComponent({
158
161
  "position": "",
159
162
  "transition": "van-popover-zoom",
160
163
  "lockScroll": false,
161
- "onTouchstart": onTouchstart,
162
164
  "onUpdate:show": updateShow
163
165
  }, attrs, pick(props, popupProps)), {
164
166
  default: () => [props.showArrow && _createVNode("div", {
@@ -92,7 +92,7 @@ declare const _default: import("vue").DefineComponent<{
92
92
  };
93
93
  safeAreaInsetTop: BooleanConstructor;
94
94
  safeAreaInsetBottom: BooleanConstructor;
95
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("open" | "close" | "keydown" | "opened" | "closed" | "update:show" | "click-overlay" | "click-close-icon")[], "open" | "close" | "keydown" | "opened" | "closed" | "update:show" | "click-overlay" | "click-close-icon", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
95
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "keydown" | "open" | "opened" | "closed" | "update:show" | "click-overlay" | "click-close-icon")[], "open" | "close" | "keydown" | "opened" | "closed" | "update:show" | "click-overlay" | "click-close-icon", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
96
96
  show: BooleanConstructor;
97
97
  zIndex: (NumberConstructor | StringConstructor)[];
98
98
  overlay: {
@@ -139,8 +139,8 @@ declare const _default: import("vue").DefineComponent<{
139
139
  safeAreaInsetBottom: BooleanConstructor;
140
140
  }>> & {
141
141
  onKeydown?: ((...args: any[]) => any) | undefined;
142
- onOpen?: ((...args: any[]) => any) | undefined;
143
142
  onClose?: ((...args: any[]) => any) | undefined;
143
+ onOpen?: ((...args: any[]) => any) | undefined;
144
144
  onOpened?: ((...args: any[]) => any) | undefined;
145
145
  onClosed?: ((...args: any[]) => any) | undefined;
146
146
  "onUpdate:show"?: ((...args: any[]) => any) | undefined;