vant 3.4.4 → 3.4.5

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/es/collapse-item/CollapseItem.d.ts +13 -0
  2. package/es/collapse-item/CollapseItem.js +3 -2
  3. package/es/collapse-item/index.d.ts +9 -0
  4. package/es/dialog/Dialog.d.ts +2 -1
  5. package/es/dialog/Dialog.js +19 -3
  6. package/es/dialog/function-call.d.ts +2 -1
  7. package/es/index-bar/IndexBar.d.ts +4 -4
  8. package/es/index-bar/index.d.ts +3 -3
  9. package/es/index.d.ts +1 -1
  10. package/es/index.js +1 -1
  11. package/es/locale/lang/bn-BD.d.ts +64 -0
  12. package/es/locale/lang/bn-BD.js +74 -0
  13. package/es/locale/lang/de-DE-formal.js +1 -1
  14. package/es/locale/lang/de-DE.js +1 -1
  15. package/es/locale/lang/en-US.js +1 -1
  16. package/es/locale/lang/es-ES.js +1 -1
  17. package/es/locale/lang/fr-FR.js +1 -1
  18. package/es/locale/lang/hi-IN.js +1 -1
  19. package/es/locale/lang/id-ID.d.ts +64 -0
  20. package/es/locale/lang/id-ID.js +66 -0
  21. package/es/locale/lang/it-IT.d.ts +64 -0
  22. package/es/locale/lang/it-IT.js +74 -0
  23. package/es/locale/lang/ja-JP.js +1 -1
  24. package/es/locale/lang/ko-KR.js +1 -1
  25. package/es/locale/lang/nb-NO.js +1 -1
  26. package/es/locale/lang/pt-BR.js +1 -1
  27. package/es/locale/lang/ro-RO.js +1 -1
  28. package/es/locale/lang/ru-RU.js +1 -1
  29. package/es/locale/lang/th-TH.js +1 -1
  30. package/es/locale/lang/uk-UA.d.ts +64 -0
  31. package/es/locale/lang/uk-UA.js +74 -0
  32. package/es/locale/lang/vi-VN.d.ts +64 -0
  33. package/es/locale/lang/vi-VN.js +74 -0
  34. package/es/locale/lang/zh-CN.js +1 -1
  35. package/es/locale/lang/zh-HK.js +1 -1
  36. package/es/locale/lang/zh-TW.js +1 -1
  37. package/es/popup/Popup.d.ts +2 -1
  38. package/es/popup/Popup.js +11 -3
  39. package/es/popup/index.d.ts +2 -1
  40. package/es/popup/types.d.ts +5 -2
  41. package/es/submit-bar/index.css +1 -1
  42. package/es/submit-bar/index.less +1 -0
  43. package/es/toast/Toast.d.ts +3 -0
  44. package/es/toast/Toast.js +2 -1
  45. package/es/uploader/types.d.ts +1 -3
  46. package/es/utils/interceptor.d.ts +1 -1
  47. package/lib/action-bar/ActionBar.js +14 -13
  48. package/lib/action-bar/index.js +14 -8
  49. package/lib/action-bar-button/ActionBarButton.js +18 -17
  50. package/lib/action-bar-button/index.js +14 -8
  51. package/lib/action-bar-icon/ActionBarIcon.js +18 -17
  52. package/lib/action-bar-icon/index.js +14 -8
  53. package/lib/action-sheet/ActionSheet.js +17 -16
  54. package/lib/action-sheet/index.js +14 -8
  55. package/lib/address-edit/AddressEdit.js +25 -19
  56. package/lib/address-edit/AddressEditDetail.js +15 -14
  57. package/lib/address-edit/index.js +14 -8
  58. package/lib/address-edit/types.js +18 -1
  59. package/lib/address-list/AddressList.js +18 -12
  60. package/lib/address-list/AddressListItem.js +17 -16
  61. package/lib/address-list/index.js +14 -8
  62. package/lib/area/Area.js +17 -16
  63. package/lib/area/index.js +14 -8
  64. package/lib/area/types.js +18 -1
  65. package/lib/badge/Badge.js +13 -12
  66. package/lib/badge/index.js +14 -8
  67. package/lib/button/Button.js +16 -15
  68. package/lib/button/index.js +14 -8
  69. package/lib/button/types.js +18 -1
  70. package/lib/calendar/Calendar.js +24 -18
  71. package/lib/calendar/CalendarDay.js +14 -13
  72. package/lib/calendar/CalendarHeader.js +14 -13
  73. package/lib/calendar/CalendarMonth.js +21 -15
  74. package/lib/calendar/index.js +14 -8
  75. package/lib/calendar/types.js +18 -1
  76. package/lib/calendar/utils.js +11 -10
  77. package/lib/card/Card.js +15 -14
  78. package/lib/card/index.js +14 -8
  79. package/lib/cascader/Cascader.js +16 -15
  80. package/lib/cascader/index.js +14 -8
  81. package/lib/cascader/types.js +18 -1
  82. package/lib/cell/Cell.js +15 -14
  83. package/lib/cell/index.js +14 -8
  84. package/lib/cell-group/CellGroup.js +13 -12
  85. package/lib/cell-group/index.js +14 -8
  86. package/lib/checkbox/Checkbox.js +19 -13
  87. package/lib/checkbox/Checker.js +14 -13
  88. package/lib/checkbox/index.js +14 -8
  89. package/lib/checkbox/types.js +18 -1
  90. package/lib/checkbox-group/CheckboxGroup.js +15 -14
  91. package/lib/checkbox-group/index.js +14 -8
  92. package/lib/checkbox-group/types.js +18 -1
  93. package/lib/circle/Circle.js +14 -13
  94. package/lib/circle/index.js +14 -8
  95. package/lib/col/Col.js +15 -14
  96. package/lib/col/index.js +14 -8
  97. package/lib/collapse/Collapse.js +14 -13
  98. package/lib/collapse/index.js +14 -8
  99. package/lib/collapse-item/CollapseItem.d.ts +13 -0
  100. package/lib/collapse-item/CollapseItem.js +22 -20
  101. package/lib/collapse-item/index.d.ts +9 -0
  102. package/lib/collapse-item/index.js +14 -8
  103. package/lib/collapse-item/types.js +18 -1
  104. package/lib/composables/on-popup-reopen.js +11 -10
  105. package/lib/composables/use-expose.js +12 -11
  106. package/lib/composables/use-height.js +12 -11
  107. package/lib/composables/use-id.js +11 -10
  108. package/lib/composables/use-lazy-render.js +11 -10
  109. package/lib/composables/use-lock-scroll.js +14 -13
  110. package/lib/composables/use-placeholder.js +12 -11
  111. package/lib/composables/use-refs.js +11 -10
  112. package/lib/composables/use-route.js +11 -10
  113. package/lib/composables/use-tab-status.js +11 -10
  114. package/lib/composables/use-touch.js +11 -10
  115. package/lib/composables/use-visibility-change.js +13 -12
  116. package/lib/config-provider/ConfigProvider.js +13 -12
  117. package/lib/config-provider/index.js +14 -8
  118. package/lib/contact-card/ContactCard.js +14 -13
  119. package/lib/contact-card/index.js +14 -8
  120. package/lib/contact-edit/ContactEdit.js +18 -17
  121. package/lib/contact-edit/index.js +14 -8
  122. package/lib/contact-list/ContactList.js +19 -18
  123. package/lib/contact-list/index.js +14 -8
  124. package/lib/count-down/CountDown.js +16 -15
  125. package/lib/count-down/index.js +14 -8
  126. package/lib/count-down/types.js +18 -1
  127. package/lib/count-down/utils.js +11 -10
  128. package/lib/coupon/Coupon.js +15 -14
  129. package/lib/coupon/index.js +14 -8
  130. package/lib/coupon/utils.js +11 -10
  131. package/lib/coupon-cell/CouponCell.js +14 -13
  132. package/lib/coupon-cell/index.js +14 -8
  133. package/lib/coupon-list/CouponList.js +20 -19
  134. package/lib/coupon-list/index.js +14 -8
  135. package/lib/datetime-picker/DatePicker.js +16 -15
  136. package/lib/datetime-picker/DatetimePicker.js +18 -12
  137. package/lib/datetime-picker/TimePicker.js +16 -15
  138. package/lib/datetime-picker/index.js +14 -8
  139. package/lib/datetime-picker/types.js +18 -1
  140. package/lib/datetime-picker/utils.js +12 -11
  141. package/lib/dialog/Dialog.d.ts +2 -1
  142. package/lib/dialog/Dialog.js +35 -18
  143. package/lib/dialog/function-call.d.ts +2 -1
  144. package/lib/dialog/function-call.js +16 -10
  145. package/lib/dialog/index.js +11 -10
  146. package/lib/dialog/types.js +18 -1
  147. package/lib/divider/Divider.js +13 -12
  148. package/lib/divider/index.js +14 -8
  149. package/lib/dropdown-item/DropdownItem.js +19 -18
  150. package/lib/dropdown-item/index.js +14 -8
  151. package/lib/dropdown-item/types.js +18 -1
  152. package/lib/dropdown-menu/DropdownMenu.js +15 -14
  153. package/lib/dropdown-menu/index.js +14 -8
  154. package/lib/dropdown-menu/types.js +18 -1
  155. package/lib/empty/Empty.js +14 -13
  156. package/lib/empty/Network.js +11 -10
  157. package/lib/empty/index.js +14 -8
  158. package/lib/field/Field.js +20 -19
  159. package/lib/field/index.js +14 -8
  160. package/lib/field/types.js +18 -1
  161. package/lib/field/utils.js +11 -10
  162. package/lib/form/Form.js +15 -14
  163. package/lib/form/index.js +14 -8
  164. package/lib/form/types.js +18 -1
  165. package/lib/grid/Grid.js +15 -14
  166. package/lib/grid/index.js +14 -8
  167. package/lib/grid-item/GridItem.js +18 -17
  168. package/lib/grid-item/index.js +14 -8
  169. package/lib/icon/Icon.js +15 -14
  170. package/lib/icon/index.js +14 -8
  171. package/lib/image/Image.js +14 -13
  172. package/lib/image/index.js +14 -8
  173. package/lib/image-preview/ImagePreview.js +21 -15
  174. package/lib/image-preview/ImagePreviewItem.js +17 -16
  175. package/lib/image-preview/function-call.js +16 -10
  176. package/lib/image-preview/index.js +11 -10
  177. package/lib/image-preview/types.js +18 -1
  178. package/lib/index-anchor/IndexAnchor.js +17 -16
  179. package/lib/index-anchor/index.js +14 -8
  180. package/lib/index-bar/IndexBar.d.ts +4 -4
  181. package/lib/index-bar/IndexBar.js +16 -15
  182. package/lib/index-bar/index.d.ts +3 -3
  183. package/lib/index-bar/index.js +14 -8
  184. package/lib/index-bar/types.js +18 -1
  185. package/lib/index.css +1 -1
  186. package/lib/index.d.ts +1 -1
  187. package/lib/index.js +182 -181
  188. package/lib/lazyload/index.js +11 -10
  189. package/lib/lazyload/vue-lazyload/index.js +16 -10
  190. package/lib/lazyload/vue-lazyload/lazy-component.js +12 -11
  191. package/lib/lazyload/vue-lazyload/lazy-container.js +11 -10
  192. package/lib/lazyload/vue-lazyload/lazy-image.js +13 -12
  193. package/lib/lazyload/vue-lazyload/lazy.js +17 -11
  194. package/lib/lazyload/vue-lazyload/listener.js +13 -12
  195. package/lib/lazyload/vue-lazyload/util.js +11 -10
  196. package/lib/list/List.js +17 -16
  197. package/lib/list/index.js +14 -8
  198. package/lib/list/types.js +18 -1
  199. package/lib/loading/Loading.js +13 -12
  200. package/lib/loading/index.js +14 -8
  201. package/lib/locale/index.js +15 -9
  202. package/lib/locale/lang/bn-BD.d.ts +64 -0
  203. package/lib/locale/lang/bn-BD.js +98 -0
  204. package/lib/locale/lang/de-DE-formal.js +20 -3
  205. package/lib/locale/lang/de-DE.js +20 -3
  206. package/lib/locale/lang/en-US.js +20 -3
  207. package/lib/locale/lang/es-ES.js +20 -3
  208. package/lib/locale/lang/fr-FR.js +20 -3
  209. package/lib/locale/lang/hi-IN.js +20 -3
  210. package/lib/locale/lang/id-ID.d.ts +64 -0
  211. package/lib/locale/lang/id-ID.js +90 -0
  212. package/lib/locale/lang/it-IT.d.ts +64 -0
  213. package/lib/locale/lang/it-IT.js +98 -0
  214. package/lib/locale/lang/ja-JP.js +20 -3
  215. package/lib/locale/lang/ko-KR.js +20 -3
  216. package/lib/locale/lang/nb-NO.js +20 -3
  217. package/lib/locale/lang/pt-BR.js +20 -3
  218. package/lib/locale/lang/ro-RO.js +20 -3
  219. package/lib/locale/lang/ru-RU.js +20 -3
  220. package/lib/locale/lang/th-TH.js +20 -3
  221. package/lib/locale/lang/tr-TR.js +19 -2
  222. package/lib/locale/lang/uk-UA.d.ts +64 -0
  223. package/lib/locale/lang/uk-UA.js +98 -0
  224. package/lib/locale/lang/vi-VN.d.ts +64 -0
  225. package/lib/locale/lang/vi-VN.js +98 -0
  226. package/lib/locale/lang/zh-CN.js +20 -3
  227. package/lib/locale/lang/zh-HK.js +20 -3
  228. package/lib/locale/lang/zh-TW.js +20 -3
  229. package/lib/nav-bar/NavBar.js +15 -14
  230. package/lib/nav-bar/index.js +14 -8
  231. package/lib/notice-bar/NoticeBar.js +17 -16
  232. package/lib/notice-bar/index.js +14 -8
  233. package/lib/notice-bar/types.js +18 -1
  234. package/lib/notify/Notify.js +15 -14
  235. package/lib/notify/function-call.js +16 -10
  236. package/lib/notify/index.js +11 -10
  237. package/lib/notify/types.js +18 -1
  238. package/lib/number-keyboard/NumberKeyboard.js +17 -11
  239. package/lib/number-keyboard/NumberKeyboardKey.js +15 -14
  240. package/lib/number-keyboard/index.js +14 -8
  241. package/lib/overlay/Overlay.js +14 -13
  242. package/lib/overlay/index.js +14 -8
  243. package/lib/pagination/Pagination.js +13 -12
  244. package/lib/pagination/index.js +14 -8
  245. package/lib/password-input/PasswordInput.js +13 -12
  246. package/lib/password-input/index.js +14 -8
  247. package/lib/picker/Picker.js +19 -13
  248. package/lib/picker/PickerColumn.js +17 -16
  249. package/lib/picker/index.js +14 -8
  250. package/lib/picker/types.js +18 -1
  251. package/lib/popover/Popover.js +17 -16
  252. package/lib/popover/index.js +14 -8
  253. package/lib/popover/types.js +18 -1
  254. package/lib/popup/Popup.d.ts +2 -1
  255. package/lib/popup/Popup.js +31 -22
  256. package/lib/popup/index.d.ts +2 -1
  257. package/lib/popup/index.js +14 -8
  258. package/lib/popup/shared.js +11 -10
  259. package/lib/popup/types.d.ts +5 -2
  260. package/lib/popup/types.js +18 -1
  261. package/lib/progress/Progress.js +13 -12
  262. package/lib/progress/index.js +14 -8
  263. package/lib/progress/types.js +18 -1
  264. package/lib/pull-refresh/PullRefresh.js +16 -15
  265. package/lib/pull-refresh/index.js +14 -8
  266. package/lib/radio/Radio.js +18 -12
  267. package/lib/radio/index.js +14 -8
  268. package/lib/radio-group/RadioGroup.js +14 -13
  269. package/lib/radio-group/index.js +14 -8
  270. package/lib/rate/Rate.js +17 -16
  271. package/lib/rate/index.js +14 -8
  272. package/lib/row/Row.js +14 -13
  273. package/lib/row/index.js +14 -8
  274. package/lib/search/Search.js +17 -16
  275. package/lib/search/index.js +14 -8
  276. package/lib/search/types.js +18 -1
  277. package/lib/share-sheet/ShareSheet.js +15 -14
  278. package/lib/share-sheet/index.js +14 -8
  279. package/lib/sidebar/Sidebar.js +14 -13
  280. package/lib/sidebar/index.js +14 -8
  281. package/lib/sidebar-item/SidebarItem.js +17 -16
  282. package/lib/sidebar-item/index.js +14 -8
  283. package/lib/skeleton/Skeleton.js +13 -12
  284. package/lib/skeleton/index.js +14 -8
  285. package/lib/slider/Slider.js +15 -14
  286. package/lib/slider/index.js +14 -8
  287. package/lib/step/Step.js +16 -15
  288. package/lib/step/index.js +14 -8
  289. package/lib/stepper/Stepper.js +14 -13
  290. package/lib/stepper/index.js +14 -8
  291. package/lib/steps/Steps.js +14 -13
  292. package/lib/steps/index.js +14 -8
  293. package/lib/sticky/Sticky.js +15 -14
  294. package/lib/sticky/index.js +14 -8
  295. package/lib/submit-bar/SubmitBar.js +15 -14
  296. package/lib/submit-bar/index.css +1 -1
  297. package/lib/submit-bar/index.js +14 -8
  298. package/lib/submit-bar/index.less +1 -0
  299. package/lib/swipe/Swipe.js +17 -16
  300. package/lib/swipe/index.js +14 -8
  301. package/lib/swipe/types.js +18 -1
  302. package/lib/swipe-cell/SwipeCell.js +16 -15
  303. package/lib/swipe-cell/index.js +14 -8
  304. package/lib/swipe-cell/types.js +18 -1
  305. package/lib/swipe-item/SwipeItem.js +16 -15
  306. package/lib/swipe-item/index.js +14 -8
  307. package/lib/switch/Switch.js +15 -14
  308. package/lib/switch/index.js +14 -8
  309. package/lib/tab/Tab.js +20 -19
  310. package/lib/tab/index.js +14 -8
  311. package/lib/tabbar/Tabbar.js +15 -14
  312. package/lib/tabbar/index.js +14 -8
  313. package/lib/tabbar-item/TabbarItem.js +18 -17
  314. package/lib/tabbar-item/index.js +14 -8
  315. package/lib/tabs/Tabs.js +25 -19
  316. package/lib/tabs/TabsContent.js +14 -13
  317. package/lib/tabs/TabsTitle.js +14 -13
  318. package/lib/tabs/index.js +14 -8
  319. package/lib/tabs/types.js +18 -1
  320. package/lib/tabs/utils.js +12 -11
  321. package/lib/tag/Tag.js +14 -13
  322. package/lib/tag/index.js +14 -8
  323. package/lib/toast/Toast.d.ts +3 -0
  324. package/lib/toast/Toast.js +19 -17
  325. package/lib/toast/function-call.js +17 -11
  326. package/lib/toast/index.js +11 -10
  327. package/lib/toast/lock-click.js +19 -2
  328. package/lib/toast/types.js +18 -1
  329. package/lib/tree-select/TreeSelect.js +16 -15
  330. package/lib/tree-select/index.js +14 -8
  331. package/lib/uploader/Uploader.js +21 -15
  332. package/lib/uploader/UploaderPreviewItem.js +17 -16
  333. package/lib/uploader/index.js +14 -8
  334. package/lib/uploader/types.d.ts +1 -3
  335. package/lib/uploader/types.js +18 -1
  336. package/lib/uploader/utils.js +11 -10
  337. package/lib/utils/basic.js +19 -2
  338. package/lib/utils/constant.js +19 -2
  339. package/lib/utils/create.js +16 -10
  340. package/lib/utils/deep-assign.js +11 -10
  341. package/lib/utils/deep-clone.js +11 -10
  342. package/lib/utils/dom.js +13 -12
  343. package/lib/utils/format.js +13 -12
  344. package/lib/utils/index.js +18 -17
  345. package/lib/utils/interceptor.d.ts +1 -1
  346. package/lib/utils/interceptor.js +12 -11
  347. package/lib/utils/mount-component.js +13 -12
  348. package/lib/utils/props.js +19 -2
  349. package/lib/utils/validate.js +11 -10
  350. package/lib/utils/with-install.js +11 -10
  351. package/lib/vant.cjs.js +34 -8
  352. package/lib/vant.cjs.min.js +1 -1
  353. package/lib/vant.es.js +35 -9
  354. package/lib/vant.es.min.js +35 -9
  355. package/lib/vant.js +37 -11
  356. package/lib/vant.min.js +1 -1
  357. package/package.json +1 -1
  358. package/vetur/attributes.json +183 -179
  359. package/vetur/tags.json +61 -60
  360. package/vetur/web-types.json +1070 -1060
package/lib/vant.es.js CHANGED
@@ -1,5 +1,5 @@
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
- import { unref, ref, reactive, defineComponent, createVNode, getCurrentInstance, computed, provide, inject, mergeProps, onDeactivated, onBeforeUnmount, watch, Transition, withDirectives, vShow, onMounted, onActivated, Teleport, Fragment, nextTick, createTextVNode, createApp, onUnmounted, onBeforeUpdate, resolveDirective, onUpdated, watchEffect, h } from "vue";
2
+ import { unref, ref, reactive, defineComponent, createVNode, getCurrentInstance, computed, provide, inject, mergeProps, onDeactivated, onBeforeUnmount, watch, Transition, withDirectives, vShow, nextTick, onMounted, onActivated, Teleport, Fragment, createTextVNode, createApp, onUnmounted, onBeforeUpdate, resolveDirective, withKeys, onUpdated, watchEffect, h } from "vue";
3
3
  import { createPopper, offsetModifier } from "@vant/popperjs";
4
4
  function noop() {
5
5
  }
@@ -259,7 +259,7 @@ var stdin_default$1D = {
259
259
  loosing: "\u91CA\u653E\u5373\u53EF\u5237\u65B0..."
260
260
  },
261
261
  vanSubmitBar: {
262
- label: "\u5408\u8BA1\uFF1A"
262
+ label: "\u5408\u8BA1:"
263
263
  },
264
264
  vanCoupon: {
265
265
  unlimited: "\u65E0\u95E8\u69DB",
@@ -1134,7 +1134,7 @@ var stdin_default$1s = defineComponent({
1134
1134
  name: name$1l,
1135
1135
  inheritAttrs: false,
1136
1136
  props: popupProps$2,
1137
- emits: ["open", "close", "opened", "closed", "update:show", "click-overlay", "click-close-icon"],
1137
+ emits: ["open", "close", "opened", "closed", "keydown", "update:show", "click-overlay", "click-close-icon"],
1138
1138
  setup(props, {
1139
1139
  emit,
1140
1140
  attrs,
@@ -1214,6 +1214,7 @@ var stdin_default$1s = defineComponent({
1214
1214
  };
1215
1215
  const onOpened = () => emit("opened");
1216
1216
  const onClosed = () => emit("closed");
1217
+ const onKeydown = (event) => emit("keydown", event);
1217
1218
  const renderPopup = lazyRender(() => {
1218
1219
  var _a;
1219
1220
  const {
@@ -1229,7 +1230,8 @@ var stdin_default$1s = defineComponent({
1229
1230
  [position]: position
1230
1231
  }), {
1231
1232
  "van-safe-area-bottom": safeAreaInsetBottom
1232
- }]
1233
+ }],
1234
+ "onKeydown": onKeydown
1233
1235
  }, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots), renderCloseIcon()]), [[vShow, props.show]]);
1234
1236
  });
1235
1237
  const renderTransition = () => {
@@ -1251,6 +1253,12 @@ var stdin_default$1s = defineComponent({
1251
1253
  watch(() => props.show, (show) => {
1252
1254
  if (show && !opened) {
1253
1255
  open();
1256
+ if (attrs.tabindex === 0) {
1257
+ nextTick(() => {
1258
+ var _a;
1259
+ (_a = popupRef.value) == null ? void 0 : _a.focus();
1260
+ });
1261
+ }
1254
1262
  }
1255
1263
  if (!show && opened) {
1256
1264
  opened = false;
@@ -3005,7 +3013,7 @@ function lockClick(lock) {
3005
3013
  }
3006
3014
  }
3007
3015
  const [name$1d, bem$19] = createNamespace("toast");
3008
- const popupInheritProps = ["show", "overlay", "transition", "overlayClass", "overlayStyle", "closeOnClickOverlay"];
3016
+ const popupInheritProps = ["show", "overlay", "teleport", "transition", "overlayClass", "overlayStyle", "closeOnClickOverlay"];
3009
3017
  const toastProps = {
3010
3018
  icon: String,
3011
3019
  show: Boolean,
@@ -3015,6 +3023,7 @@ const toastProps = {
3015
3023
  iconSize: numericProp,
3016
3024
  duration: makeNumberProp(2e3),
3017
3025
  position: makeStringProp("middle"),
3026
+ teleport: [String, Object],
3018
3027
  className: unknownProp,
3019
3028
  iconPrefix: String,
3020
3029
  transition: makeStringProp("van-fade"),
@@ -7123,7 +7132,8 @@ const collapseItemProps = extend({}, cellSharedProps, {
7123
7132
  name: numericProp,
7124
7133
  isLink: truthProp,
7125
7134
  disabled: Boolean,
7126
- readonly: Boolean
7135
+ readonly: Boolean,
7136
+ lazyRender: truthProp
7127
7137
  });
7128
7138
  var stdin_default$R = defineComponent({
7129
7139
  name: name$L,
@@ -7146,7 +7156,7 @@ var stdin_default$R = defineComponent({
7146
7156
  });
7147
7157
  const expanded = computed(() => parent.isExpanded(name2.value));
7148
7158
  const show = ref(expanded.value);
7149
- const lazyRender = useLazyRender(show);
7159
+ const lazyRender = useLazyRender(() => show.value || !props.lazyRender);
7150
7160
  const onTransitionEnd = () => {
7151
7161
  if (!expanded.value) {
7152
7162
  show.value = false;
@@ -8245,11 +8255,12 @@ const popupInheritKeys$1 = [...popupSharedPropKeys, "transition", "closeOnPopsta
8245
8255
  var stdin_default$G = defineComponent({
8246
8256
  name: name$A,
8247
8257
  props: dialogProps,
8248
- emits: ["confirm", "cancel", "update:show"],
8258
+ emits: ["confirm", "cancel", "keydown", "update:show"],
8249
8259
  setup(props, {
8250
8260
  emit,
8251
8261
  slots
8252
8262
  }) {
8263
+ const root = ref();
8253
8264
  const loading = reactive({
8254
8265
  confirm: false,
8255
8266
  cancel: false
@@ -8283,6 +8294,18 @@ var stdin_default$G = defineComponent({
8283
8294
  };
8284
8295
  const onCancel = getActionHandler("cancel");
8285
8296
  const onConfirm = getActionHandler("confirm");
8297
+ const onKeydown = withKeys((event) => {
8298
+ var _a, _b;
8299
+ if (event.target !== ((_b = (_a = root.value) == null ? void 0 : _a.popupRef) == null ? void 0 : _b.value)) {
8300
+ return;
8301
+ }
8302
+ const onEventType = {
8303
+ Enter: props.showConfirmButton ? onConfirm : noop,
8304
+ Escape: props.showCancelButton ? onCancel : noop
8305
+ };
8306
+ onEventType[event.key]();
8307
+ emit("keydown", event);
8308
+ }, ["enter", "esc"]);
8286
8309
  const renderTitle = () => {
8287
8310
  const title = slots.title ? slots.title() : props.title;
8288
8311
  if (title) {
@@ -8392,12 +8415,15 @@ var stdin_default$G = defineComponent({
8392
8415
  className
8393
8416
  } = props;
8394
8417
  return createVNode(Popup, mergeProps({
8418
+ "ref": root,
8395
8419
  "role": "dialog",
8396
8420
  "class": [bem$B([theme]), className],
8397
8421
  "style": {
8398
8422
  width: addUnit(width)
8399
8423
  },
8424
+ "tabindex": 0,
8400
8425
  "aria-labelledby": title || message,
8426
+ "onKeydown": onKeydown,
8401
8427
  "onUpdate:show": updateShow
8402
8428
  }, pick(props, popupInheritKeys$1)), {
8403
8429
  default: () => [renderTitle(), renderContent(), renderFooter()]
@@ -14233,7 +14259,7 @@ const Lazyload = {
14233
14259
  });
14234
14260
  }
14235
14261
  };
14236
- const version = "3.4.4";
14262
+ const version = "3.4.5";
14237
14263
  function install(app) {
14238
14264
  const components = [
14239
14265
  ActionBar,
@@ -1,5 +1,5 @@
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
- import { unref, ref, reactive, defineComponent, createVNode, getCurrentInstance, computed, provide, inject, mergeProps, onDeactivated, onBeforeUnmount, watch, Transition, withDirectives, vShow, onMounted, onActivated, Teleport, Fragment, nextTick, createTextVNode, createApp, onUnmounted, onBeforeUpdate, resolveDirective, onUpdated, watchEffect, h } from "vue";
2
+ import { unref, ref, reactive, defineComponent, createVNode, getCurrentInstance, computed, provide, inject, mergeProps, onDeactivated, onBeforeUnmount, watch, Transition, withDirectives, vShow, nextTick, onMounted, onActivated, Teleport, Fragment, createTextVNode, createApp, onUnmounted, onBeforeUpdate, resolveDirective, withKeys, onUpdated, watchEffect, h } from "vue";
3
3
  import { createPopper, offsetModifier } from "@vant/popperjs";
4
4
  function noop() {
5
5
  }
@@ -259,7 +259,7 @@ var stdin_default$1D = {
259
259
  loosing: "\u91CA\u653E\u5373\u53EF\u5237\u65B0..."
260
260
  },
261
261
  vanSubmitBar: {
262
- label: "\u5408\u8BA1\uFF1A"
262
+ label: "\u5408\u8BA1:"
263
263
  },
264
264
  vanCoupon: {
265
265
  unlimited: "\u65E0\u95E8\u69DB",
@@ -1134,7 +1134,7 @@ var stdin_default$1s = defineComponent({
1134
1134
  name: name$1l,
1135
1135
  inheritAttrs: false,
1136
1136
  props: popupProps$2,
1137
- emits: ["open", "close", "opened", "closed", "update:show", "click-overlay", "click-close-icon"],
1137
+ emits: ["open", "close", "opened", "closed", "keydown", "update:show", "click-overlay", "click-close-icon"],
1138
1138
  setup(props, {
1139
1139
  emit,
1140
1140
  attrs,
@@ -1214,6 +1214,7 @@ var stdin_default$1s = defineComponent({
1214
1214
  };
1215
1215
  const onOpened = () => emit("opened");
1216
1216
  const onClosed = () => emit("closed");
1217
+ const onKeydown = (event) => emit("keydown", event);
1217
1218
  const renderPopup = lazyRender(() => {
1218
1219
  var _a;
1219
1220
  const {
@@ -1229,7 +1230,8 @@ var stdin_default$1s = defineComponent({
1229
1230
  [position]: position
1230
1231
  }), {
1231
1232
  "van-safe-area-bottom": safeAreaInsetBottom
1232
- }]
1233
+ }],
1234
+ "onKeydown": onKeydown
1233
1235
  }, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots), renderCloseIcon()]), [[vShow, props.show]]);
1234
1236
  });
1235
1237
  const renderTransition = () => {
@@ -1251,6 +1253,12 @@ var stdin_default$1s = defineComponent({
1251
1253
  watch(() => props.show, (show) => {
1252
1254
  if (show && !opened) {
1253
1255
  open();
1256
+ if (attrs.tabindex === 0) {
1257
+ nextTick(() => {
1258
+ var _a;
1259
+ (_a = popupRef.value) == null ? void 0 : _a.focus();
1260
+ });
1261
+ }
1254
1262
  }
1255
1263
  if (!show && opened) {
1256
1264
  opened = false;
@@ -3005,7 +3013,7 @@ function lockClick(lock) {
3005
3013
  }
3006
3014
  }
3007
3015
  const [name$1d, bem$19] = createNamespace("toast");
3008
- const popupInheritProps = ["show", "overlay", "transition", "overlayClass", "overlayStyle", "closeOnClickOverlay"];
3016
+ const popupInheritProps = ["show", "overlay", "teleport", "transition", "overlayClass", "overlayStyle", "closeOnClickOverlay"];
3009
3017
  const toastProps = {
3010
3018
  icon: String,
3011
3019
  show: Boolean,
@@ -3015,6 +3023,7 @@ const toastProps = {
3015
3023
  iconSize: numericProp,
3016
3024
  duration: makeNumberProp(2e3),
3017
3025
  position: makeStringProp("middle"),
3026
+ teleport: [String, Object],
3018
3027
  className: unknownProp,
3019
3028
  iconPrefix: String,
3020
3029
  transition: makeStringProp("van-fade"),
@@ -7123,7 +7132,8 @@ const collapseItemProps = extend({}, cellSharedProps, {
7123
7132
  name: numericProp,
7124
7133
  isLink: truthProp,
7125
7134
  disabled: Boolean,
7126
- readonly: Boolean
7135
+ readonly: Boolean,
7136
+ lazyRender: truthProp
7127
7137
  });
7128
7138
  var stdin_default$R = defineComponent({
7129
7139
  name: name$L,
@@ -7146,7 +7156,7 @@ var stdin_default$R = defineComponent({
7146
7156
  });
7147
7157
  const expanded = computed(() => parent.isExpanded(name2.value));
7148
7158
  const show = ref(expanded.value);
7149
- const lazyRender = useLazyRender(show);
7159
+ const lazyRender = useLazyRender(() => show.value || !props.lazyRender);
7150
7160
  const onTransitionEnd = () => {
7151
7161
  if (!expanded.value) {
7152
7162
  show.value = false;
@@ -8245,11 +8255,12 @@ const popupInheritKeys$1 = [...popupSharedPropKeys, "transition", "closeOnPopsta
8245
8255
  var stdin_default$G = defineComponent({
8246
8256
  name: name$A,
8247
8257
  props: dialogProps,
8248
- emits: ["confirm", "cancel", "update:show"],
8258
+ emits: ["confirm", "cancel", "keydown", "update:show"],
8249
8259
  setup(props, {
8250
8260
  emit,
8251
8261
  slots
8252
8262
  }) {
8263
+ const root = ref();
8253
8264
  const loading = reactive({
8254
8265
  confirm: false,
8255
8266
  cancel: false
@@ -8283,6 +8294,18 @@ var stdin_default$G = defineComponent({
8283
8294
  };
8284
8295
  const onCancel = getActionHandler("cancel");
8285
8296
  const onConfirm = getActionHandler("confirm");
8297
+ const onKeydown = withKeys((event) => {
8298
+ var _a, _b;
8299
+ if (event.target !== ((_b = (_a = root.value) == null ? void 0 : _a.popupRef) == null ? void 0 : _b.value)) {
8300
+ return;
8301
+ }
8302
+ const onEventType = {
8303
+ Enter: props.showConfirmButton ? onConfirm : noop,
8304
+ Escape: props.showCancelButton ? onCancel : noop
8305
+ };
8306
+ onEventType[event.key]();
8307
+ emit("keydown", event);
8308
+ }, ["enter", "esc"]);
8286
8309
  const renderTitle = () => {
8287
8310
  const title = slots.title ? slots.title() : props.title;
8288
8311
  if (title) {
@@ -8392,12 +8415,15 @@ var stdin_default$G = defineComponent({
8392
8415
  className
8393
8416
  } = props;
8394
8417
  return createVNode(Popup, mergeProps({
8418
+ "ref": root,
8395
8419
  "role": "dialog",
8396
8420
  "class": [bem$B([theme]), className],
8397
8421
  "style": {
8398
8422
  width: addUnit(width)
8399
8423
  },
8424
+ "tabindex": 0,
8400
8425
  "aria-labelledby": title || message,
8426
+ "onKeydown": onKeydown,
8401
8427
  "onUpdate:show": updateShow
8402
8428
  }, pick(props, popupInheritKeys$1)), {
8403
8429
  default: () => [renderTitle(), renderContent(), renderFooter()]
@@ -14233,7 +14259,7 @@ const Lazyload = {
14233
14259
  });
14234
14260
  }
14235
14261
  };
14236
- const version = "3.4.4";
14262
+ const version = "3.4.5";
14237
14263
  function install(app) {
14238
14264
  const components = [
14239
14265
  ActionBar,
package/lib/vant.js CHANGED
@@ -613,7 +613,7 @@
613
613
  loosing: "\u91CA\u653E\u5373\u53EF\u5237\u65B0..."
614
614
  },
615
615
  vanSubmitBar: {
616
- label: "\u5408\u8BA1\uFF1A"
616
+ label: "\u5408\u8BA1:"
617
617
  },
618
618
  vanCoupon: {
619
619
  unlimited: "\u65E0\u95E8\u69DB",
@@ -1488,7 +1488,7 @@
1488
1488
  name: name$1l,
1489
1489
  inheritAttrs: false,
1490
1490
  props: popupProps$2,
1491
- emits: ["open", "close", "opened", "closed", "update:show", "click-overlay", "click-close-icon"],
1491
+ emits: ["open", "close", "opened", "closed", "keydown", "update:show", "click-overlay", "click-close-icon"],
1492
1492
  setup(props, {
1493
1493
  emit,
1494
1494
  attrs,
@@ -1568,6 +1568,7 @@
1568
1568
  };
1569
1569
  const onOpened = () => emit("opened");
1570
1570
  const onClosed = () => emit("closed");
1571
+ const onKeydown = (event) => emit("keydown", event);
1571
1572
  const renderPopup = lazyRender(() => {
1572
1573
  var _a;
1573
1574
  const {
@@ -1583,7 +1584,8 @@
1583
1584
  [position]: position
1584
1585
  }), {
1585
1586
  "van-safe-area-bottom": safeAreaInsetBottom
1586
- }]
1587
+ }],
1588
+ "onKeydown": onKeydown
1587
1589
  }, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots), renderCloseIcon()]), [[vue.vShow, props.show]]);
1588
1590
  });
1589
1591
  const renderTransition = () => {
@@ -1605,6 +1607,12 @@
1605
1607
  vue.watch(() => props.show, (show) => {
1606
1608
  if (show && !opened) {
1607
1609
  open();
1610
+ if (attrs.tabindex === 0) {
1611
+ vue.nextTick(() => {
1612
+ var _a;
1613
+ (_a = popupRef.value) == null ? void 0 : _a.focus();
1614
+ });
1615
+ }
1608
1616
  }
1609
1617
  if (!show && opened) {
1610
1618
  opened = false;
@@ -3359,7 +3367,7 @@
3359
3367
  }
3360
3368
  }
3361
3369
  const [name$1d, bem$19] = createNamespace("toast");
3362
- const popupInheritProps = ["show", "overlay", "transition", "overlayClass", "overlayStyle", "closeOnClickOverlay"];
3370
+ const popupInheritProps = ["show", "overlay", "teleport", "transition", "overlayClass", "overlayStyle", "closeOnClickOverlay"];
3363
3371
  const toastProps = {
3364
3372
  icon: String,
3365
3373
  show: Boolean,
@@ -3369,6 +3377,7 @@
3369
3377
  iconSize: numericProp,
3370
3378
  duration: makeNumberProp(2e3),
3371
3379
  position: makeStringProp("middle"),
3380
+ teleport: [String, Object],
3372
3381
  className: unknownProp,
3373
3382
  iconPrefix: String,
3374
3383
  transition: makeStringProp("van-fade"),
@@ -7477,7 +7486,8 @@
7477
7486
  name: numericProp,
7478
7487
  isLink: truthProp,
7479
7488
  disabled: Boolean,
7480
- readonly: Boolean
7489
+ readonly: Boolean,
7490
+ lazyRender: truthProp
7481
7491
  });
7482
7492
  var stdin_default$R = vue.defineComponent({
7483
7493
  name: name$L,
@@ -7500,7 +7510,7 @@
7500
7510
  });
7501
7511
  const expanded = vue.computed(() => parent.isExpanded(name2.value));
7502
7512
  const show = vue.ref(expanded.value);
7503
- const lazyRender = useLazyRender(show);
7513
+ const lazyRender = useLazyRender(() => show.value || !props.lazyRender);
7504
7514
  const onTransitionEnd = () => {
7505
7515
  if (!expanded.value) {
7506
7516
  show.value = false;
@@ -8599,11 +8609,12 @@
8599
8609
  var stdin_default$G = vue.defineComponent({
8600
8610
  name: name$A,
8601
8611
  props: dialogProps,
8602
- emits: ["confirm", "cancel", "update:show"],
8612
+ emits: ["confirm", "cancel", "keydown", "update:show"],
8603
8613
  setup(props, {
8604
8614
  emit,
8605
8615
  slots
8606
8616
  }) {
8617
+ const root = vue.ref();
8607
8618
  const loading = vue.reactive({
8608
8619
  confirm: false,
8609
8620
  cancel: false
@@ -8637,6 +8648,18 @@
8637
8648
  };
8638
8649
  const onCancel = getActionHandler("cancel");
8639
8650
  const onConfirm = getActionHandler("confirm");
8651
+ const onKeydown = vue.withKeys((event) => {
8652
+ var _a, _b;
8653
+ if (event.target !== ((_b = (_a = root.value) == null ? void 0 : _a.popupRef) == null ? void 0 : _b.value)) {
8654
+ return;
8655
+ }
8656
+ const onEventType = {
8657
+ Enter: props.showConfirmButton ? onConfirm : noop,
8658
+ Escape: props.showCancelButton ? onCancel : noop
8659
+ };
8660
+ onEventType[event.key]();
8661
+ emit("keydown", event);
8662
+ }, ["enter", "esc"]);
8640
8663
  const renderTitle = () => {
8641
8664
  const title = slots.title ? slots.title() : props.title;
8642
8665
  if (title) {
@@ -8746,12 +8769,15 @@
8746
8769
  className
8747
8770
  } = props;
8748
8771
  return vue.createVNode(Popup, vue.mergeProps({
8772
+ "ref": root,
8749
8773
  "role": "dialog",
8750
8774
  "class": [bem$B([theme]), className],
8751
8775
  "style": {
8752
8776
  width: addUnit(width2)
8753
8777
  },
8778
+ "tabindex": 0,
8754
8779
  "aria-labelledby": title || message,
8780
+ "onKeydown": onKeydown,
8755
8781
  "onUpdate:show": updateShow
8756
8782
  }, pick(props, popupInheritKeys$1)), {
8757
8783
  default: () => [renderTitle(), renderContent(), renderFooter()]
@@ -11394,8 +11420,8 @@
11394
11420
  var afterWrite = "afterWrite";
11395
11421
  var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
11396
11422
  function order(modifiers) {
11397
- var map = new Map();
11398
- var visited = new Set();
11423
+ var map = /* @__PURE__ */ new Map();
11424
+ var visited = /* @__PURE__ */ new Set();
11399
11425
  var result = [];
11400
11426
  modifiers.forEach(function(modifier) {
11401
11427
  map.set(modifier.name, modifier);
@@ -11513,7 +11539,7 @@
11513
11539
  });
11514
11540
  }
11515
11541
  function uniqueBy(arr, fn2) {
11516
- var identifiers = new Set();
11542
+ var identifiers = /* @__PURE__ */ new Set();
11517
11543
  return arr.filter(function(item) {
11518
11544
  var identifier = fn2(item);
11519
11545
  if (!identifiers.has(identifier)) {
@@ -15444,7 +15470,7 @@
15444
15470
  });
15445
15471
  }
15446
15472
  };
15447
- const version = "3.4.4";
15473
+ const version = "3.4.5";
15448
15474
  function install(app) {
15449
15475
  const components = [
15450
15476
  ActionBar,