vant 3.4.8 → 4.0.0-alpha.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 (914) hide show
  1. package/changelog.generated.md +154 -39
  2. package/es/action-bar/index.css +1 -1
  3. package/es/action-bar/index.less +4 -6
  4. package/es/action-bar-button/index.css +1 -1
  5. package/es/action-bar-button/index.less +9 -11
  6. package/es/action-bar-icon/index.css +1 -1
  7. package/es/action-bar-icon/index.less +10 -12
  8. package/es/action-sheet/index.css +1 -1
  9. package/es/action-sheet/index.less +23 -24
  10. package/es/address-edit/AddressEdit.d.ts +6 -23
  11. package/es/address-edit/AddressEdit.js +32 -57
  12. package/es/address-edit/AddressEditDetail.d.ts +2 -2
  13. package/es/address-edit/AddressEditDetail.js +5 -14
  14. package/es/address-edit/index.css +1 -1
  15. package/es/address-edit/index.d.ts +6 -18
  16. package/es/address-edit/index.less +8 -15
  17. package/es/address-edit/types.d.ts +2 -5
  18. package/es/address-list/AddressList.d.ts +4 -4
  19. package/es/address-list/AddressList.js +5 -5
  20. package/es/address-list/AddressListItem.js +3 -3
  21. package/es/address-list/index.css +1 -1
  22. package/es/address-list/index.d.ts +4 -4
  23. package/es/address-list/index.less +20 -22
  24. package/es/area/Area.d.ts +13 -25
  25. package/es/area/Area.js +43 -208
  26. package/es/area/index.d.ts +11 -19
  27. package/es/area/types.d.ts +2 -17
  28. package/es/area/utils.d.ts +6 -0
  29. package/es/area/utils.js +85 -0
  30. package/es/badge/index.css +1 -1
  31. package/es/badge/index.less +15 -17
  32. package/es/button/index.css +1 -1
  33. package/es/button/index.less +55 -52
  34. package/es/calendar/Calendar.d.ts +6 -6
  35. package/es/calendar/Calendar.js +5 -5
  36. package/es/calendar/CalendarHeader.d.ts +2 -2
  37. package/es/calendar/CalendarHeader.js +2 -2
  38. package/es/calendar/CalendarMonth.d.ts +1 -2
  39. package/es/calendar/CalendarMonth.js +2 -2
  40. package/es/calendar/index.css +1 -1
  41. package/es/calendar/index.d.ts +6 -6
  42. package/es/calendar/index.less +42 -38
  43. package/es/card/Card.d.ts +2 -2
  44. package/es/card/Card.js +3 -3
  45. package/es/card/index.css +1 -1
  46. package/es/card/index.d.ts +2 -2
  47. package/es/card/index.less +23 -25
  48. package/es/cascader/Cascader.d.ts +2 -2
  49. package/es/cascader/Cascader.js +3 -3
  50. package/es/cascader/index.css +1 -1
  51. package/es/cascader/index.d.ts +2 -2
  52. package/es/cascader/index.less +17 -19
  53. package/es/cell/Cell.js +1 -4
  54. package/es/cell/index.css +1 -1
  55. package/es/cell/index.less +21 -27
  56. package/es/cell-group/index.css +1 -1
  57. package/es/cell-group/index.less +12 -13
  58. package/es/checkbox/index.css +1 -1
  59. package/es/checkbox/index.less +12 -14
  60. package/es/circle/index.css +1 -1
  61. package/es/circle/index.less +8 -10
  62. package/es/collapse-item/index.css +1 -1
  63. package/es/collapse-item/index.less +12 -12
  64. package/es/config-provider/ConfigProvider.d.ts +14 -0
  65. package/es/config-provider/ConfigProvider.js +11 -2
  66. package/es/config-provider/index.d.ts +10 -1
  67. package/es/contact-card/ContactCard.js +2 -2
  68. package/es/contact-card/index.css +1 -1
  69. package/es/contact-card/index.less +7 -9
  70. package/es/contact-edit/ContactEdit.d.ts +2 -2
  71. package/es/contact-edit/ContactEdit.js +3 -4
  72. package/es/contact-edit/index.css +1 -1
  73. package/es/contact-edit/index.d.ts +2 -2
  74. package/es/contact-edit/index.less +7 -9
  75. package/es/contact-list/ContactList.js +4 -4
  76. package/es/contact-list/index.css +1 -1
  77. package/es/contact-list/index.less +9 -11
  78. package/es/count-down/index.css +1 -1
  79. package/es/count-down/index.less +4 -6
  80. package/es/coupon/index.css +1 -1
  81. package/es/coupon/index.less +28 -31
  82. package/es/coupon-cell/index.css +1 -1
  83. package/es/coupon-cell/index.less +2 -4
  84. package/es/coupon-list/CouponList.js +2 -2
  85. package/es/coupon-list/index.css +1 -1
  86. package/es/coupon-list/index.less +14 -16
  87. package/es/date-picker/DatePicker.d.ts +168 -0
  88. package/es/date-picker/DatePicker.js +111 -0
  89. package/es/{datetime-picker/DatePicker.d.ts → date-picker/index.d.ts} +40 -28
  90. package/es/date-picker/index.js +8 -0
  91. package/es/{datetime-picker → date-picker}/style/index.d.ts +0 -0
  92. package/es/{datetime-picker → date-picker}/style/index.js +0 -0
  93. package/es/{datetime-picker → date-picker}/style/less.d.ts +0 -0
  94. package/es/{datetime-picker → date-picker}/style/less.js +0 -0
  95. package/es/{datetime-picker → date-picker}/utils.d.ts +15 -11
  96. package/es/date-picker/utils.js +40 -0
  97. package/es/dialog/index.css +1 -1
  98. package/es/dialog/index.less +24 -24
  99. package/es/divider/index.css +1 -1
  100. package/es/divider/index.less +10 -12
  101. package/es/dropdown-item/index.css +1 -1
  102. package/es/dropdown-item/index.less +2 -5
  103. package/es/dropdown-menu/index.css +1 -1
  104. package/es/dropdown-menu/index.less +14 -17
  105. package/es/empty/index.css +1 -1
  106. package/es/empty/index.less +9 -11
  107. package/es/field/Field.d.ts +4 -4
  108. package/es/field/Field.js +4 -4
  109. package/es/field/index.css +1 -1
  110. package/es/field/index.d.ts +4 -4
  111. package/es/field/index.less +20 -23
  112. package/es/grid-item/index.css +1 -1
  113. package/es/grid-item/index.less +10 -13
  114. package/es/image/index.css +1 -1
  115. package/es/image/index.less +10 -12
  116. package/es/image-preview/index.css +1 -1
  117. package/es/image-preview/index.less +11 -13
  118. package/es/index-anchor/index.css +1 -1
  119. package/es/index-anchor/index.less +12 -14
  120. package/es/index-bar/index.css +1 -1
  121. package/es/index-bar/index.less +7 -8
  122. package/es/index.d.ts +3 -2
  123. package/es/index.js +7 -4
  124. package/es/list/index.css +1 -1
  125. package/es/list/index.less +5 -7
  126. package/es/loading/index.css +1 -1
  127. package/es/loading/index.less +7 -10
  128. package/es/locale/lang/bn-BD.d.ts +0 -2
  129. package/es/locale/lang/bn-BD.js +0 -2
  130. package/es/locale/lang/de-DE-formal.d.ts +0 -2
  131. package/es/locale/lang/de-DE-formal.js +0 -2
  132. package/es/locale/lang/de-DE.d.ts +0 -2
  133. package/es/locale/lang/de-DE.js +0 -2
  134. package/es/locale/lang/en-US.d.ts +0 -2
  135. package/es/locale/lang/en-US.js +0 -2
  136. package/es/locale/lang/es-ES.d.ts +0 -2
  137. package/es/locale/lang/es-ES.js +0 -2
  138. package/es/locale/lang/fr-FR.d.ts +0 -2
  139. package/es/locale/lang/fr-FR.js +0 -2
  140. package/es/locale/lang/hi-IN.d.ts +0 -2
  141. package/es/locale/lang/hi-IN.js +0 -2
  142. package/es/locale/lang/id-ID.d.ts +0 -2
  143. package/es/locale/lang/id-ID.js +0 -2
  144. package/es/locale/lang/is-IS.d.ts +0 -2
  145. package/es/locale/lang/is-IS.js +0 -2
  146. package/es/locale/lang/it-IT.d.ts +0 -2
  147. package/es/locale/lang/it-IT.js +0 -2
  148. package/es/locale/lang/ja-JP.d.ts +0 -2
  149. package/es/locale/lang/ja-JP.js +0 -2
  150. package/es/locale/lang/ko-KR.d.ts +0 -2
  151. package/es/locale/lang/ko-KR.js +0 -2
  152. package/es/locale/lang/la-LA.d.ts +0 -2
  153. package/es/locale/lang/la-LA.js +0 -2
  154. package/es/locale/lang/nb-NO.d.ts +0 -2
  155. package/es/locale/lang/nb-NO.js +0 -2
  156. package/es/locale/lang/pt-BR.d.ts +0 -2
  157. package/es/locale/lang/pt-BR.js +0 -2
  158. package/es/locale/lang/ro-RO.d.ts +0 -2
  159. package/es/locale/lang/ro-RO.js +0 -2
  160. package/es/locale/lang/ru-RU.d.ts +0 -2
  161. package/es/locale/lang/ru-RU.js +0 -2
  162. package/es/locale/lang/sv-SE.d.ts +0 -2
  163. package/es/locale/lang/sv-SE.js +0 -2
  164. package/es/locale/lang/th-TH.d.ts +0 -2
  165. package/es/locale/lang/th-TH.js +0 -2
  166. package/es/locale/lang/tr-TR.d.ts +0 -2
  167. package/es/locale/lang/tr-TR.js +0 -2
  168. package/es/locale/lang/uk-UA.d.ts +0 -2
  169. package/es/locale/lang/uk-UA.js +0 -2
  170. package/es/locale/lang/vi-VN.d.ts +0 -2
  171. package/es/locale/lang/vi-VN.js +0 -2
  172. package/es/locale/lang/zh-CN.d.ts +0 -2
  173. package/es/locale/lang/zh-CN.js +0 -2
  174. package/es/locale/lang/zh-HK.d.ts +0 -2
  175. package/es/locale/lang/zh-HK.js +0 -2
  176. package/es/locale/lang/zh-TW.d.ts +0 -2
  177. package/es/locale/lang/zh-TW.js +0 -2
  178. package/es/nav-bar/NavBar.d.ts +3 -3
  179. package/es/nav-bar/NavBar.js +3 -3
  180. package/es/nav-bar/index.css +1 -1
  181. package/es/nav-bar/index.d.ts +3 -3
  182. package/es/nav-bar/index.less +11 -13
  183. package/es/notice-bar/index.css +1 -1
  184. package/es/notice-bar/index.less +11 -13
  185. package/es/notify/index.css +1 -1
  186. package/es/notify/index.less +13 -15
  187. package/es/number-keyboard/NumberKeyboard.d.ts +1 -1
  188. package/es/number-keyboard/index.css +1 -1
  189. package/es/number-keyboard/index.d.ts +1 -1
  190. package/es/number-keyboard/index.less +26 -22
  191. package/es/overlay/index.css +1 -1
  192. package/es/overlay/index.less +4 -6
  193. package/es/pagination/index.css +1 -1
  194. package/es/pagination/index.less +13 -15
  195. package/es/password-input/index.css +1 -1
  196. package/es/password-input/index.less +20 -22
  197. package/es/picker/Picker.d.ts +27 -28
  198. package/es/picker/Picker.js +91 -196
  199. package/es/picker/PickerColumn.d.ts +21 -30
  200. package/es/picker/PickerColumn.js +61 -111
  201. package/es/picker/index.css +1 -1
  202. package/es/picker/index.d.ts +19 -20
  203. package/es/picker/index.less +32 -19
  204. package/es/picker/types.d.ts +13 -19
  205. package/es/picker/utils.d.ts +11 -0
  206. package/es/picker/utils.js +73 -0
  207. package/es/popover/Popover.d.ts +1 -1
  208. package/es/popover/index.css +1 -1
  209. package/es/popover/index.d.ts +1 -1
  210. package/es/popover/index.less +21 -23
  211. package/es/popup/Popup.d.ts +3 -3
  212. package/es/popup/Popup.js +3 -3
  213. package/es/popup/index.css +1 -1
  214. package/es/popup/index.d.ts +3 -3
  215. package/es/popup/index.less +20 -22
  216. package/es/progress/index.css +1 -1
  217. package/es/progress/index.less +14 -18
  218. package/es/pull-refresh/index.css +1 -1
  219. package/es/pull-refresh/index.less +5 -7
  220. package/es/radio/index.css +1 -1
  221. package/es/radio/index.less +12 -14
  222. package/es/rate/index.css +1 -1
  223. package/es/rate/index.less +6 -8
  224. package/es/search/Search.d.ts +4 -4
  225. package/es/search/Search.js +7 -7
  226. package/es/search/index.css +1 -1
  227. package/es/search/index.d.ts +4 -4
  228. package/es/search/index.less +16 -18
  229. package/es/share-sheet/index.css +1 -1
  230. package/es/share-sheet/index.less +17 -18
  231. package/es/sidebar/index.css +1 -1
  232. package/es/sidebar/index.less +2 -4
  233. package/es/sidebar-item/index.css +1 -1
  234. package/es/sidebar-item/index.less +17 -19
  235. package/es/skeleton/index.css +1 -1
  236. package/es/skeleton/index.less +14 -16
  237. package/es/slider/Slider.d.ts +4 -4
  238. package/es/slider/Slider.js +4 -5
  239. package/es/slider/index.css +1 -1
  240. package/es/slider/index.d.ts +4 -4
  241. package/es/slider/index.less +20 -18
  242. package/es/step/index.css +1 -1
  243. package/es/step/index.less +15 -17
  244. package/es/stepper/Stepper.d.ts +1 -1
  245. package/es/stepper/index.css +1 -1
  246. package/es/stepper/index.d.ts +1 -1
  247. package/es/stepper/index.less +20 -24
  248. package/es/steps/Steps.d.ts +2 -2
  249. package/es/steps/Steps.js +2 -2
  250. package/es/steps/index.css +1 -1
  251. package/es/steps/index.d.ts +2 -2
  252. package/es/steps/index.less +3 -5
  253. package/es/sticky/index.css +1 -1
  254. package/es/sticky/index.less +2 -4
  255. package/es/style/animation.css +1 -1
  256. package/es/style/animation.less +18 -22
  257. package/es/style/base.css +1 -1
  258. package/es/style/base.less +6 -7
  259. package/es/style/css-variables.css +1 -1
  260. package/es/style/css-variables.less +76 -61
  261. package/es/style/mixins/hairline.less +0 -2
  262. package/es/style/normalize.css +1 -1
  263. package/es/style/normalize.less +1 -3
  264. package/es/submit-bar/index.css +1 -1
  265. package/es/submit-bar/index.less +26 -28
  266. package/es/swipe/index.css +1 -1
  267. package/es/swipe/index.less +11 -13
  268. package/es/switch/index.css +1 -1
  269. package/es/switch/index.less +24 -24
  270. package/es/tabbar/index.css +1 -1
  271. package/es/tabbar/index.less +5 -7
  272. package/es/tabbar-item/index.css +1 -1
  273. package/es/tabbar-item/index.less +9 -11
  274. package/es/tabs/Tabs.d.ts +2 -4
  275. package/es/tabs/Tabs.js +14 -27
  276. package/es/tabs/index.css +1 -1
  277. package/es/tabs/index.d.ts +2 -4
  278. package/es/tabs/index.less +17 -20
  279. package/es/tag/index.css +1 -1
  280. package/es/tag/index.less +22 -25
  281. package/es/time-picker/TimePicker.d.ts +214 -0
  282. package/es/time-picker/TimePicker.js +71 -0
  283. package/{lib/datetime-picker/TimePicker.d.ts → es/time-picker/index.d.ts} +60 -20
  284. package/es/time-picker/index.js +8 -0
  285. package/{lib/datetime-picker → es/time-picker}/style/index.d.ts +0 -0
  286. package/es/time-picker/style/index.js +3 -0
  287. package/{lib/datetime-picker → es/time-picker}/style/less.d.ts +0 -0
  288. package/es/time-picker/style/less.js +3 -0
  289. package/es/toast/index.css +1 -1
  290. package/es/toast/index.less +19 -21
  291. package/es/tree-select/TreeSelect.d.ts +3 -3
  292. package/es/tree-select/TreeSelect.js +3 -3
  293. package/es/tree-select/index.css +1 -1
  294. package/es/tree-select/index.d.ts +3 -3
  295. package/es/tree-select/index.less +12 -14
  296. package/es/uploader/Uploader.d.ts +4 -4
  297. package/es/uploader/Uploader.js +4 -4
  298. package/es/uploader/index.css +1 -1
  299. package/es/uploader/index.d.ts +4 -4
  300. package/es/uploader/index.less +31 -33
  301. package/es/utils/basic.d.ts +1 -0
  302. package/es/utils/basic.js +2 -0
  303. package/lib/action-bar/index.css +1 -1
  304. package/lib/action-bar/index.less +4 -6
  305. package/lib/action-bar-button/index.css +1 -1
  306. package/lib/action-bar-button/index.less +9 -11
  307. package/lib/action-bar-icon/index.css +1 -1
  308. package/lib/action-bar-icon/index.less +10 -12
  309. package/lib/action-sheet/index.css +1 -1
  310. package/lib/action-sheet/index.less +23 -24
  311. package/lib/address-edit/AddressEdit.d.ts +6 -23
  312. package/lib/address-edit/AddressEdit.js +32 -57
  313. package/lib/address-edit/AddressEditDetail.d.ts +2 -2
  314. package/lib/address-edit/AddressEditDetail.js +5 -14
  315. package/lib/address-edit/index.css +1 -1
  316. package/lib/address-edit/index.d.ts +6 -18
  317. package/lib/address-edit/index.less +8 -15
  318. package/lib/address-edit/types.d.ts +2 -5
  319. package/lib/address-list/AddressList.d.ts +4 -4
  320. package/lib/address-list/AddressList.js +5 -5
  321. package/lib/address-list/AddressListItem.js +3 -3
  322. package/lib/address-list/index.css +1 -1
  323. package/lib/address-list/index.d.ts +4 -4
  324. package/lib/address-list/index.less +20 -22
  325. package/lib/area/Area.d.ts +13 -25
  326. package/lib/area/Area.js +42 -207
  327. package/lib/area/index.d.ts +11 -19
  328. package/lib/area/types.d.ts +2 -17
  329. package/lib/area/utils.d.ts +6 -0
  330. package/lib/area/utils.js +104 -0
  331. package/lib/badge/index.css +1 -1
  332. package/lib/badge/index.less +15 -17
  333. package/lib/button/index.css +1 -1
  334. package/lib/button/index.less +55 -52
  335. package/lib/calendar/Calendar.d.ts +6 -6
  336. package/lib/calendar/Calendar.js +5 -5
  337. package/lib/calendar/CalendarHeader.d.ts +2 -2
  338. package/lib/calendar/CalendarHeader.js +2 -2
  339. package/lib/calendar/CalendarMonth.d.ts +1 -2
  340. package/lib/calendar/CalendarMonth.js +2 -2
  341. package/lib/calendar/index.css +1 -1
  342. package/lib/calendar/index.d.ts +6 -6
  343. package/lib/calendar/index.less +42 -38
  344. package/lib/card/Card.d.ts +2 -2
  345. package/lib/card/Card.js +3 -3
  346. package/lib/card/index.css +1 -1
  347. package/lib/card/index.d.ts +2 -2
  348. package/lib/card/index.less +23 -25
  349. package/lib/cascader/Cascader.d.ts +2 -2
  350. package/lib/cascader/Cascader.js +3 -3
  351. package/lib/cascader/index.css +1 -1
  352. package/lib/cascader/index.d.ts +2 -2
  353. package/lib/cascader/index.less +17 -19
  354. package/lib/cell/Cell.js +1 -4
  355. package/lib/cell/index.css +1 -1
  356. package/lib/cell/index.less +21 -27
  357. package/lib/cell-group/index.css +1 -1
  358. package/lib/cell-group/index.less +12 -13
  359. package/lib/checkbox/index.css +1 -1
  360. package/lib/checkbox/index.less +12 -14
  361. package/lib/circle/index.css +1 -1
  362. package/lib/circle/index.less +8 -10
  363. package/lib/collapse-item/index.css +1 -1
  364. package/lib/collapse-item/index.less +12 -12
  365. package/lib/config-provider/ConfigProvider.d.ts +14 -0
  366. package/lib/config-provider/ConfigProvider.js +9 -0
  367. package/lib/config-provider/index.d.ts +10 -1
  368. package/lib/contact-card/ContactCard.js +2 -2
  369. package/lib/contact-card/index.css +1 -1
  370. package/lib/contact-card/index.less +7 -9
  371. package/lib/contact-edit/ContactEdit.d.ts +2 -2
  372. package/lib/contact-edit/ContactEdit.js +3 -4
  373. package/lib/contact-edit/index.css +1 -1
  374. package/lib/contact-edit/index.d.ts +2 -2
  375. package/lib/contact-edit/index.less +7 -9
  376. package/lib/contact-list/ContactList.js +4 -4
  377. package/lib/contact-list/index.css +1 -1
  378. package/lib/contact-list/index.less +9 -11
  379. package/lib/count-down/index.css +1 -1
  380. package/lib/count-down/index.less +4 -6
  381. package/lib/coupon/index.css +1 -1
  382. package/lib/coupon/index.less +28 -31
  383. package/lib/coupon-cell/index.css +1 -1
  384. package/lib/coupon-cell/index.less +2 -4
  385. package/lib/coupon-list/CouponList.js +2 -2
  386. package/lib/coupon-list/index.css +1 -1
  387. package/lib/coupon-list/index.less +14 -16
  388. package/lib/date-picker/DatePicker.d.ts +168 -0
  389. package/lib/date-picker/DatePicker.js +130 -0
  390. package/lib/{datetime-picker/DatePicker.d.ts → date-picker/index.d.ts} +40 -28
  391. package/lib/{datetime-picker → date-picker}/index.js +4 -4
  392. package/lib/date-picker/style/index.d.ts +1 -0
  393. package/lib/{datetime-picker → date-picker}/style/index.js +0 -0
  394. package/lib/date-picker/style/less.d.ts +1 -0
  395. package/lib/{datetime-picker → date-picker}/style/less.js +0 -0
  396. package/lib/{datetime-picker → date-picker}/utils.d.ts +15 -11
  397. package/lib/{datetime-picker → date-picker}/utils.js +11 -34
  398. package/lib/dialog/index.css +1 -1
  399. package/lib/dialog/index.less +24 -24
  400. package/lib/divider/index.css +1 -1
  401. package/lib/divider/index.less +10 -12
  402. package/lib/dropdown-item/index.css +1 -1
  403. package/lib/dropdown-item/index.less +2 -5
  404. package/lib/dropdown-menu/index.css +1 -1
  405. package/lib/dropdown-menu/index.less +14 -17
  406. package/lib/empty/index.css +1 -1
  407. package/lib/empty/index.less +9 -11
  408. package/lib/field/Field.d.ts +4 -4
  409. package/lib/field/Field.js +4 -4
  410. package/lib/field/index.css +1 -1
  411. package/lib/field/index.d.ts +4 -4
  412. package/lib/field/index.less +20 -23
  413. package/lib/grid-item/index.css +1 -1
  414. package/lib/grid-item/index.less +10 -13
  415. package/lib/image/index.css +1 -1
  416. package/lib/image/index.less +10 -12
  417. package/lib/image-preview/index.css +1 -1
  418. package/lib/image-preview/index.less +11 -13
  419. package/lib/index-anchor/index.css +1 -1
  420. package/lib/index-anchor/index.less +12 -14
  421. package/lib/index-bar/index.css +1 -1
  422. package/lib/index-bar/index.less +7 -8
  423. package/lib/index.css +1 -1
  424. package/lib/index.d.ts +3 -2
  425. package/lib/index.js +7 -4
  426. package/lib/list/index.css +1 -1
  427. package/lib/list/index.less +5 -7
  428. package/lib/loading/index.css +1 -1
  429. package/lib/loading/index.less +7 -10
  430. package/lib/locale/lang/bn-BD.d.ts +0 -2
  431. package/lib/locale/lang/bn-BD.js +0 -2
  432. package/lib/locale/lang/de-DE-formal.d.ts +0 -2
  433. package/lib/locale/lang/de-DE-formal.js +0 -2
  434. package/lib/locale/lang/de-DE.d.ts +0 -2
  435. package/lib/locale/lang/de-DE.js +0 -2
  436. package/lib/locale/lang/en-US.d.ts +0 -2
  437. package/lib/locale/lang/en-US.js +0 -2
  438. package/lib/locale/lang/es-ES.d.ts +0 -2
  439. package/lib/locale/lang/es-ES.js +0 -2
  440. package/lib/locale/lang/fr-FR.d.ts +0 -2
  441. package/lib/locale/lang/fr-FR.js +0 -2
  442. package/lib/locale/lang/hi-IN.d.ts +0 -2
  443. package/lib/locale/lang/hi-IN.js +0 -2
  444. package/lib/locale/lang/id-ID.d.ts +0 -2
  445. package/lib/locale/lang/id-ID.js +0 -2
  446. package/lib/locale/lang/is-IS.d.ts +0 -2
  447. package/lib/locale/lang/is-IS.js +0 -2
  448. package/lib/locale/lang/it-IT.d.ts +0 -2
  449. package/lib/locale/lang/it-IT.js +0 -2
  450. package/lib/locale/lang/ja-JP.d.ts +0 -2
  451. package/lib/locale/lang/ja-JP.js +0 -2
  452. package/lib/locale/lang/ko-KR.d.ts +0 -2
  453. package/lib/locale/lang/ko-KR.js +0 -2
  454. package/lib/locale/lang/la-LA.d.ts +0 -2
  455. package/lib/locale/lang/la-LA.js +0 -2
  456. package/lib/locale/lang/nb-NO.d.ts +0 -2
  457. package/lib/locale/lang/nb-NO.js +0 -2
  458. package/lib/locale/lang/pt-BR.d.ts +0 -2
  459. package/lib/locale/lang/pt-BR.js +0 -2
  460. package/lib/locale/lang/ro-RO.d.ts +0 -2
  461. package/lib/locale/lang/ro-RO.js +0 -2
  462. package/lib/locale/lang/ru-RU.d.ts +0 -2
  463. package/lib/locale/lang/ru-RU.js +0 -2
  464. package/lib/locale/lang/sv-SE.d.ts +0 -2
  465. package/lib/locale/lang/sv-SE.js +0 -2
  466. package/lib/locale/lang/th-TH.d.ts +0 -2
  467. package/lib/locale/lang/th-TH.js +0 -2
  468. package/lib/locale/lang/tr-TR.d.ts +0 -2
  469. package/lib/locale/lang/tr-TR.js +0 -2
  470. package/lib/locale/lang/uk-UA.d.ts +0 -2
  471. package/lib/locale/lang/uk-UA.js +0 -2
  472. package/lib/locale/lang/vi-VN.d.ts +0 -2
  473. package/lib/locale/lang/vi-VN.js +0 -2
  474. package/lib/locale/lang/zh-CN.d.ts +0 -2
  475. package/lib/locale/lang/zh-CN.js +0 -2
  476. package/lib/locale/lang/zh-HK.d.ts +0 -2
  477. package/lib/locale/lang/zh-HK.js +0 -2
  478. package/lib/locale/lang/zh-TW.d.ts +0 -2
  479. package/lib/locale/lang/zh-TW.js +0 -2
  480. package/lib/nav-bar/NavBar.d.ts +3 -3
  481. package/lib/nav-bar/NavBar.js +3 -3
  482. package/lib/nav-bar/index.css +1 -1
  483. package/lib/nav-bar/index.d.ts +3 -3
  484. package/lib/nav-bar/index.less +11 -13
  485. package/lib/notice-bar/index.css +1 -1
  486. package/lib/notice-bar/index.less +11 -13
  487. package/lib/notify/index.css +1 -1
  488. package/lib/notify/index.less +13 -15
  489. package/lib/number-keyboard/NumberKeyboard.d.ts +1 -1
  490. package/lib/number-keyboard/index.css +1 -1
  491. package/lib/number-keyboard/index.d.ts +1 -1
  492. package/lib/number-keyboard/index.less +26 -22
  493. package/lib/overlay/index.css +1 -1
  494. package/lib/overlay/index.less +4 -6
  495. package/lib/pagination/index.css +1 -1
  496. package/lib/pagination/index.less +13 -15
  497. package/lib/password-input/index.css +1 -1
  498. package/lib/password-input/index.less +20 -22
  499. package/lib/picker/Picker.d.ts +27 -28
  500. package/lib/picker/Picker.js +90 -195
  501. package/lib/picker/PickerColumn.d.ts +21 -30
  502. package/lib/picker/PickerColumn.js +60 -110
  503. package/lib/picker/index.css +1 -1
  504. package/lib/picker/index.d.ts +19 -20
  505. package/lib/picker/index.less +32 -19
  506. package/lib/picker/types.d.ts +13 -19
  507. package/lib/picker/utils.d.ts +11 -0
  508. package/lib/picker/utils.js +92 -0
  509. package/lib/popover/Popover.d.ts +1 -1
  510. package/lib/popover/index.css +1 -1
  511. package/lib/popover/index.d.ts +1 -1
  512. package/lib/popover/index.less +21 -23
  513. package/lib/popup/Popup.d.ts +3 -3
  514. package/lib/popup/Popup.js +3 -3
  515. package/lib/popup/index.css +1 -1
  516. package/lib/popup/index.d.ts +3 -3
  517. package/lib/popup/index.less +20 -22
  518. package/lib/progress/index.css +1 -1
  519. package/lib/progress/index.less +14 -18
  520. package/lib/pull-refresh/index.css +1 -1
  521. package/lib/pull-refresh/index.less +5 -7
  522. package/lib/radio/index.css +1 -1
  523. package/lib/radio/index.less +12 -14
  524. package/lib/rate/index.css +1 -1
  525. package/lib/rate/index.less +6 -8
  526. package/lib/search/Search.d.ts +4 -4
  527. package/lib/search/Search.js +7 -7
  528. package/lib/search/index.css +1 -1
  529. package/lib/search/index.d.ts +4 -4
  530. package/lib/search/index.less +16 -18
  531. package/lib/share-sheet/index.css +1 -1
  532. package/lib/share-sheet/index.less +17 -18
  533. package/lib/sidebar/index.css +1 -1
  534. package/lib/sidebar/index.less +2 -4
  535. package/lib/sidebar-item/index.css +1 -1
  536. package/lib/sidebar-item/index.less +17 -19
  537. package/lib/skeleton/index.css +1 -1
  538. package/lib/skeleton/index.less +14 -16
  539. package/lib/slider/Slider.d.ts +4 -4
  540. package/lib/slider/Slider.js +5 -6
  541. package/lib/slider/index.css +1 -1
  542. package/lib/slider/index.d.ts +4 -4
  543. package/lib/slider/index.less +20 -18
  544. package/lib/step/index.css +1 -1
  545. package/lib/step/index.less +15 -17
  546. package/lib/stepper/Stepper.d.ts +1 -1
  547. package/lib/stepper/index.css +1 -1
  548. package/lib/stepper/index.d.ts +1 -1
  549. package/lib/stepper/index.less +20 -24
  550. package/lib/steps/Steps.d.ts +2 -2
  551. package/lib/steps/Steps.js +2 -2
  552. package/lib/steps/index.css +1 -1
  553. package/lib/steps/index.d.ts +2 -2
  554. package/lib/steps/index.less +3 -5
  555. package/lib/sticky/index.css +1 -1
  556. package/lib/sticky/index.less +2 -4
  557. package/lib/style/animation.css +1 -1
  558. package/lib/style/animation.less +18 -22
  559. package/lib/style/base.css +1 -1
  560. package/lib/style/base.less +6 -7
  561. package/lib/style/css-variables.css +1 -1
  562. package/lib/style/css-variables.less +76 -61
  563. package/lib/style/mixins/hairline.less +0 -2
  564. package/lib/style/normalize.css +1 -1
  565. package/lib/style/normalize.less +1 -3
  566. package/lib/submit-bar/index.css +1 -1
  567. package/lib/submit-bar/index.less +26 -28
  568. package/lib/swipe/index.css +1 -1
  569. package/lib/swipe/index.less +11 -13
  570. package/lib/switch/index.css +1 -1
  571. package/lib/switch/index.less +24 -24
  572. package/lib/tabbar/index.css +1 -1
  573. package/lib/tabbar/index.less +5 -7
  574. package/lib/tabbar-item/index.css +1 -1
  575. package/lib/tabbar-item/index.less +9 -11
  576. package/lib/tabs/Tabs.d.ts +2 -4
  577. package/lib/tabs/Tabs.js +13 -26
  578. package/lib/tabs/index.css +1 -1
  579. package/lib/tabs/index.d.ts +2 -4
  580. package/lib/tabs/index.less +17 -20
  581. package/lib/tag/index.css +1 -1
  582. package/lib/tag/index.less +22 -25
  583. package/lib/time-picker/TimePicker.d.ts +214 -0
  584. package/lib/time-picker/TimePicker.js +90 -0
  585. package/{es/datetime-picker/TimePicker.d.ts → lib/time-picker/index.d.ts} +60 -20
  586. package/lib/time-picker/index.js +30 -0
  587. package/lib/time-picker/style/index.d.ts +1 -0
  588. package/lib/time-picker/style/index.js +3 -0
  589. package/lib/time-picker/style/less.d.ts +1 -0
  590. package/lib/time-picker/style/less.js +3 -0
  591. package/lib/toast/index.css +1 -1
  592. package/lib/toast/index.less +19 -21
  593. package/lib/tree-select/TreeSelect.d.ts +3 -3
  594. package/lib/tree-select/TreeSelect.js +3 -3
  595. package/lib/tree-select/index.css +1 -1
  596. package/lib/tree-select/index.d.ts +3 -3
  597. package/lib/tree-select/index.less +12 -14
  598. package/lib/uploader/Uploader.d.ts +4 -4
  599. package/lib/uploader/Uploader.js +4 -4
  600. package/lib/uploader/index.css +1 -1
  601. package/lib/uploader/index.d.ts +4 -4
  602. package/lib/uploader/index.less +31 -33
  603. package/lib/utils/basic.d.ts +1 -0
  604. package/lib/utils/basic.js +2 -0
  605. package/lib/vant.cjs.js +1203 -1659
  606. package/lib/vant.cjs.min.js +1 -1
  607. package/lib/vant.es.js +1203 -1660
  608. package/lib/vant.es.min.js +1203 -1660
  609. package/lib/vant.js +1202 -1658
  610. package/lib/vant.min.js +1 -1
  611. package/package.json +4 -1
  612. package/vetur/attributes.json +516 -468
  613. package/vetur/tags.json +176 -168
  614. package/vetur/web-types.json +1855 -1700
  615. package/es/action-bar/var.css +0 -0
  616. package/es/action-bar/var.less +0 -4
  617. package/es/action-bar-button/var.css +0 -0
  618. package/es/action-bar-button/var.less +0 -5
  619. package/es/action-bar-icon/var.css +0 -0
  620. package/es/action-bar-icon/var.less +0 -10
  621. package/es/action-sheet/var.css +0 -0
  622. package/es/action-sheet/var.less +0 -23
  623. package/es/address-edit/var.css +0 -0
  624. package/es/address-edit/var.less +0 -6
  625. package/es/address-list/var.css +0 -0
  626. package/es/address-list/var.less +0 -16
  627. package/es/badge/var.css +0 -0
  628. package/es/badge/var.less +0 -12
  629. package/es/button/var.css +0 -0
  630. package/es/button/var.less +0 -36
  631. package/es/calendar/var.css +0 -0
  632. package/es/calendar/var.less +0 -28
  633. package/es/card/var.css +0 -0
  634. package/es/card/var.less +0 -18
  635. package/es/cascader/var.css +0 -0
  636. package/es/cascader/var.less +0 -15
  637. package/es/cell/var.css +0 -0
  638. package/es/cell/var.less +0 -21
  639. package/es/cell-group/var.css +0 -0
  640. package/es/cell-group/var.less +0 -12
  641. package/es/checkbox/var.css +0 -0
  642. package/es/checkbox/var.less +0 -11
  643. package/es/circle/var.css +0 -0
  644. package/es/circle/var.less +0 -9
  645. package/es/collapse-item/var.css +0 -0
  646. package/es/collapse-item/var.less +0 -9
  647. package/es/contact-card/var.css +0 -0
  648. package/es/contact-card/var.less +0 -6
  649. package/es/contact-edit/var.css +0 -0
  650. package/es/contact-edit/var.less +0 -8
  651. package/es/contact-list/var.css +0 -0
  652. package/es/contact-list/var.less +0 -6
  653. package/es/count-down/var.css +0 -0
  654. package/es/count-down/var.less +0 -5
  655. package/es/coupon/var.css +0 -0
  656. package/es/coupon/var.less +0 -19
  657. package/es/coupon-cell/var.css +0 -0
  658. package/es/coupon-cell/var.less +0 -3
  659. package/es/coupon-list/var.css +0 -0
  660. package/es/coupon-list/var.less +0 -9
  661. package/es/datetime-picker/DatePicker.js +0 -250
  662. package/es/datetime-picker/DatetimePicker.d.ts +0 -7
  663. package/es/datetime-picker/DatetimePicker.js +0 -40
  664. package/es/datetime-picker/TimePicker.js +0 -117
  665. package/es/datetime-picker/index.d.ts +0 -12
  666. package/es/datetime-picker/index.js +0 -8
  667. package/es/datetime-picker/types.d.ts +0 -9
  668. package/es/datetime-picker/types.js +0 -0
  669. package/es/datetime-picker/utils.js +0 -63
  670. package/es/dialog/var.css +0 -0
  671. package/es/dialog/var.less +0 -21
  672. package/es/divider/var.css +0 -0
  673. package/es/divider/var.less +0 -10
  674. package/es/dropdown-item/var.css +0 -0
  675. package/es/dropdown-item/var.less +0 -3
  676. package/es/dropdown-menu/var.css +0 -0
  677. package/es/dropdown-menu/var.less +0 -13
  678. package/es/empty/var.css +0 -0
  679. package/es/empty/var.less +0 -10
  680. package/es/field/var.css +0 -0
  681. package/es/field/var.less +0 -21
  682. package/es/grid-item/var.css +0 -0
  683. package/es/grid-item/var.less +0 -8
  684. package/es/image/var.css +0 -0
  685. package/es/image/var.less +0 -9
  686. package/es/image-preview/var.css +0 -0
  687. package/es/image-preview/var.less +0 -11
  688. package/es/index-anchor/var.css +0 -0
  689. package/es/index-anchor/var.less +0 -11
  690. package/es/index-bar/var.css +0 -0
  691. package/es/index-bar/var.less +0 -6
  692. package/es/list/var.css +0 -0
  693. package/es/list/var.less +0 -6
  694. package/es/loading/var.css +0 -0
  695. package/es/loading/var.less +0 -7
  696. package/es/nav-bar/var.css +0 -0
  697. package/es/nav-bar/var.less +0 -10
  698. package/es/notice-bar/var.css +0 -0
  699. package/es/notice-bar/var.less +0 -11
  700. package/es/notify/var.css +0 -0
  701. package/es/notify/var.less +0 -10
  702. package/es/number-keyboard/var.css +0 -0
  703. package/es/number-keyboard/var.less +0 -17
  704. package/es/overlay/var.css +0 -0
  705. package/es/overlay/var.less +0 -4
  706. package/es/pagination/var.css +0 -0
  707. package/es/pagination/var.less +0 -11
  708. package/es/password-input/var.css +0 -0
  709. package/es/password-input/var.less +0 -17
  710. package/es/picker/var.css +0 -0
  711. package/es/picker/var.less +0 -22
  712. package/es/popover/var.css +0 -0
  713. package/es/popover/var.less +0 -15
  714. package/es/popup/var.css +0 -0
  715. package/es/popup/var.less +0 -9
  716. package/es/progress/var.css +0 -0
  717. package/es/progress/var.less +0 -11
  718. package/es/pull-refresh/var.css +0 -0
  719. package/es/pull-refresh/var.less +0 -6
  720. package/es/radio/var.css +0 -0
  721. package/es/radio/var.less +0 -11
  722. package/es/rate/var.css +0 -0
  723. package/es/rate/var.less +0 -7
  724. package/es/search/var.css +0 -0
  725. package/es/search/var.less +0 -13
  726. package/es/share-sheet/var.css +0 -0
  727. package/es/share-sheet/var.less +0 -18
  728. package/es/sidebar/var.css +0 -0
  729. package/es/sidebar/var.less +0 -3
  730. package/es/sidebar-item/var.css +0 -0
  731. package/es/sidebar-item/var.less +0 -15
  732. package/es/skeleton/var.css +0 -0
  733. package/es/skeleton/var.less +0 -9
  734. package/es/slider/var.css +0 -0
  735. package/es/slider/var.less +0 -11
  736. package/es/step/var.css +0 -0
  737. package/es/step/var.less +0 -13
  738. package/es/stepper/var.css +0 -0
  739. package/es/stepper/var.less +0 -15
  740. package/es/steps/var.css +0 -0
  741. package/es/steps/var.less +0 -3
  742. package/es/sticky/var.css +0 -0
  743. package/es/sticky/var.less +0 -3
  744. package/es/style/var.css +0 -0
  745. package/es/style/var.less +0 -74
  746. package/es/submit-bar/var.css +0 -0
  747. package/es/submit-bar/var.less +0 -22
  748. package/es/swipe/var.css +0 -0
  749. package/es/swipe/var.less +0 -8
  750. package/es/switch/var.css +0 -0
  751. package/es/switch/var.less +0 -14
  752. package/es/tabbar/var.css +0 -0
  753. package/es/tabbar/var.less +0 -5
  754. package/es/tabbar-item/var.css +0 -0
  755. package/es/tabbar-item/var.less +0 -9
  756. package/es/tabs/var.css +0 -0
  757. package/es/tabs/var.less +0 -14
  758. package/es/tag/var.css +0 -0
  759. package/es/tag/var.less +0 -18
  760. package/es/toast/var.css +0 -0
  761. package/es/toast/var.less +0 -17
  762. package/es/tree-select/var.css +0 -0
  763. package/es/tree-select/var.less +0 -10
  764. package/es/uploader/var.css +0 -0
  765. package/es/uploader/var.less +0 -27
  766. package/lib/action-bar/var.css +0 -0
  767. package/lib/action-bar/var.less +0 -4
  768. package/lib/action-bar-button/var.css +0 -0
  769. package/lib/action-bar-button/var.less +0 -5
  770. package/lib/action-bar-icon/var.css +0 -0
  771. package/lib/action-bar-icon/var.less +0 -10
  772. package/lib/action-sheet/var.css +0 -0
  773. package/lib/action-sheet/var.less +0 -23
  774. package/lib/address-edit/var.css +0 -0
  775. package/lib/address-edit/var.less +0 -6
  776. package/lib/address-list/var.css +0 -0
  777. package/lib/address-list/var.less +0 -16
  778. package/lib/badge/var.css +0 -0
  779. package/lib/badge/var.less +0 -12
  780. package/lib/button/var.css +0 -0
  781. package/lib/button/var.less +0 -36
  782. package/lib/calendar/var.css +0 -0
  783. package/lib/calendar/var.less +0 -28
  784. package/lib/card/var.css +0 -0
  785. package/lib/card/var.less +0 -18
  786. package/lib/cascader/var.css +0 -0
  787. package/lib/cascader/var.less +0 -15
  788. package/lib/cell/var.css +0 -0
  789. package/lib/cell/var.less +0 -21
  790. package/lib/cell-group/var.css +0 -0
  791. package/lib/cell-group/var.less +0 -12
  792. package/lib/checkbox/var.css +0 -0
  793. package/lib/checkbox/var.less +0 -11
  794. package/lib/circle/var.css +0 -0
  795. package/lib/circle/var.less +0 -9
  796. package/lib/collapse-item/var.css +0 -0
  797. package/lib/collapse-item/var.less +0 -9
  798. package/lib/contact-card/var.css +0 -0
  799. package/lib/contact-card/var.less +0 -6
  800. package/lib/contact-edit/var.css +0 -0
  801. package/lib/contact-edit/var.less +0 -8
  802. package/lib/contact-list/var.css +0 -0
  803. package/lib/contact-list/var.less +0 -6
  804. package/lib/count-down/var.css +0 -0
  805. package/lib/count-down/var.less +0 -5
  806. package/lib/coupon/var.css +0 -0
  807. package/lib/coupon/var.less +0 -19
  808. package/lib/coupon-cell/var.css +0 -0
  809. package/lib/coupon-cell/var.less +0 -3
  810. package/lib/coupon-list/var.css +0 -0
  811. package/lib/coupon-list/var.less +0 -9
  812. package/lib/datetime-picker/DatePicker.js +0 -269
  813. package/lib/datetime-picker/DatetimePicker.d.ts +0 -7
  814. package/lib/datetime-picker/DatetimePicker.js +0 -62
  815. package/lib/datetime-picker/TimePicker.js +0 -136
  816. package/lib/datetime-picker/index.d.ts +0 -12
  817. package/lib/datetime-picker/types.d.ts +0 -9
  818. package/lib/datetime-picker/types.js +0 -15
  819. package/lib/dialog/var.css +0 -0
  820. package/lib/dialog/var.less +0 -21
  821. package/lib/divider/var.css +0 -0
  822. package/lib/divider/var.less +0 -10
  823. package/lib/dropdown-item/var.css +0 -0
  824. package/lib/dropdown-item/var.less +0 -3
  825. package/lib/dropdown-menu/var.css +0 -0
  826. package/lib/dropdown-menu/var.less +0 -13
  827. package/lib/empty/var.css +0 -0
  828. package/lib/empty/var.less +0 -10
  829. package/lib/field/var.css +0 -0
  830. package/lib/field/var.less +0 -21
  831. package/lib/grid-item/var.css +0 -0
  832. package/lib/grid-item/var.less +0 -8
  833. package/lib/image/var.css +0 -0
  834. package/lib/image/var.less +0 -9
  835. package/lib/image-preview/var.css +0 -0
  836. package/lib/image-preview/var.less +0 -11
  837. package/lib/index-anchor/var.css +0 -0
  838. package/lib/index-anchor/var.less +0 -11
  839. package/lib/index-bar/var.css +0 -0
  840. package/lib/index-bar/var.less +0 -6
  841. package/lib/list/var.css +0 -0
  842. package/lib/list/var.less +0 -6
  843. package/lib/loading/var.css +0 -0
  844. package/lib/loading/var.less +0 -7
  845. package/lib/nav-bar/var.css +0 -0
  846. package/lib/nav-bar/var.less +0 -10
  847. package/lib/notice-bar/var.css +0 -0
  848. package/lib/notice-bar/var.less +0 -11
  849. package/lib/notify/var.css +0 -0
  850. package/lib/notify/var.less +0 -10
  851. package/lib/number-keyboard/var.css +0 -0
  852. package/lib/number-keyboard/var.less +0 -17
  853. package/lib/overlay/var.css +0 -0
  854. package/lib/overlay/var.less +0 -4
  855. package/lib/pagination/var.css +0 -0
  856. package/lib/pagination/var.less +0 -11
  857. package/lib/password-input/var.css +0 -0
  858. package/lib/password-input/var.less +0 -17
  859. package/lib/picker/var.css +0 -0
  860. package/lib/picker/var.less +0 -22
  861. package/lib/popover/var.css +0 -0
  862. package/lib/popover/var.less +0 -15
  863. package/lib/popup/var.css +0 -0
  864. package/lib/popup/var.less +0 -9
  865. package/lib/progress/var.css +0 -0
  866. package/lib/progress/var.less +0 -11
  867. package/lib/pull-refresh/var.css +0 -0
  868. package/lib/pull-refresh/var.less +0 -6
  869. package/lib/radio/var.css +0 -0
  870. package/lib/radio/var.less +0 -11
  871. package/lib/rate/var.css +0 -0
  872. package/lib/rate/var.less +0 -7
  873. package/lib/search/var.css +0 -0
  874. package/lib/search/var.less +0 -13
  875. package/lib/share-sheet/var.css +0 -0
  876. package/lib/share-sheet/var.less +0 -18
  877. package/lib/sidebar/var.css +0 -0
  878. package/lib/sidebar/var.less +0 -3
  879. package/lib/sidebar-item/var.css +0 -0
  880. package/lib/sidebar-item/var.less +0 -15
  881. package/lib/skeleton/var.css +0 -0
  882. package/lib/skeleton/var.less +0 -9
  883. package/lib/slider/var.css +0 -0
  884. package/lib/slider/var.less +0 -11
  885. package/lib/step/var.css +0 -0
  886. package/lib/step/var.less +0 -13
  887. package/lib/stepper/var.css +0 -0
  888. package/lib/stepper/var.less +0 -15
  889. package/lib/steps/var.css +0 -0
  890. package/lib/steps/var.less +0 -3
  891. package/lib/sticky/var.css +0 -0
  892. package/lib/sticky/var.less +0 -3
  893. package/lib/style/var.css +0 -0
  894. package/lib/style/var.less +0 -74
  895. package/lib/submit-bar/var.css +0 -0
  896. package/lib/submit-bar/var.less +0 -22
  897. package/lib/swipe/var.css +0 -0
  898. package/lib/swipe/var.less +0 -8
  899. package/lib/switch/var.css +0 -0
  900. package/lib/switch/var.less +0 -14
  901. package/lib/tabbar/var.css +0 -0
  902. package/lib/tabbar/var.less +0 -5
  903. package/lib/tabbar-item/var.css +0 -0
  904. package/lib/tabbar-item/var.less +0 -9
  905. package/lib/tabs/var.css +0 -0
  906. package/lib/tabs/var.less +0 -14
  907. package/lib/tag/var.css +0 -0
  908. package/lib/tag/var.less +0 -18
  909. package/lib/toast/var.css +0 -0
  910. package/lib/toast/var.less +0 -17
  911. package/lib/tree-select/var.css +0 -0
  912. package/lib/tree-select/var.less +0 -10
  913. package/lib/uploader/var.css +0 -0
  914. package/lib/uploader/var.less +0 -27
@@ -23,36 +23,27 @@ __export(stdin_exports, {
23
23
  module.exports = __toCommonJS(stdin_exports);
24
24
  var import_vue = require("vue");
25
25
  var import_vue2 = require("vue");
26
- var import_deep_clone = require("../utils/deep-clone");
27
26
  var import_utils = require("../utils");
27
+ var import_utils2 = require("./utils");
28
28
  var import_use = require("@vant/use");
29
29
  var import_use_touch = require("../composables/use-touch");
30
30
  var import_use_expose = require("../composables/use-expose");
31
31
  const DEFAULT_DURATION = 200;
32
- const MOMENTUM_LIMIT_TIME = 300;
33
- const MOMENTUM_LIMIT_DISTANCE = 15;
32
+ const MOMENTUM_TIME = 300;
33
+ const MOMENTUM_DISTANCE = 15;
34
34
  const [name, bem] = (0, import_utils.createNamespace)("picker-column");
35
- function getElementTranslateY(element) {
36
- const {
37
- transform
38
- } = window.getComputedStyle(element);
39
- const translateY = transform.slice(7, transform.length - 1).split(", ")[5];
40
- return Number(translateY);
41
- }
42
35
  const PICKER_KEY = Symbol(name);
43
- const isOptionDisabled = (option) => (0, import_utils.isObject)(option) && option.disabled;
44
36
  var stdin_default = (0, import_vue2.defineComponent)({
45
37
  name,
46
38
  props: {
47
- textKey: (0, import_utils.makeRequiredProp)(String),
39
+ value: import_utils.numericProp,
40
+ fields: (0, import_utils.makeRequiredProp)(Object),
41
+ options: (0, import_utils.makeArrayProp)(),
48
42
  readonly: Boolean,
49
43
  allowHtml: Boolean,
50
- className: import_utils.unknownProp,
51
- itemHeight: (0, import_utils.makeRequiredProp)(Number),
52
- defaultIndex: (0, import_utils.makeNumberProp)(0),
44
+ optionHeight: (0, import_utils.makeRequiredProp)(Number),
53
45
  swipeDuration: (0, import_utils.makeRequiredProp)(import_utils.numericProp),
54
- initialOptions: (0, import_utils.makeArrayProp)(),
55
- visibleItemCount: (0, import_utils.makeRequiredProp)(import_utils.numericProp)
46
+ visibleOptionNum: (0, import_utils.makeRequiredProp)(import_utils.numericProp)
56
47
  },
57
48
  emits: ["change"],
58
49
  setup(props, {
@@ -65,75 +56,46 @@ var stdin_default = (0, import_vue2.defineComponent)({
65
56
  let momentumOffset;
66
57
  let transitionEndTrigger;
67
58
  const wrapper = (0, import_vue2.ref)();
68
- const state = (0, import_vue2.reactive)({
69
- index: props.defaultIndex,
70
- offset: 0,
71
- duration: 0,
72
- options: (0, import_deep_clone.deepClone)(props.initialOptions)
73
- });
59
+ const currentOffset = (0, import_vue2.ref)(0);
60
+ const currentDuration = (0, import_vue2.ref)(0);
74
61
  const touch = (0, import_use_touch.useTouch)();
75
- const count = () => state.options.length;
76
- const baseOffset = () => props.itemHeight * (+props.visibleItemCount - 1) / 2;
77
- const adjustIndex = (index) => {
78
- index = (0, import_utils.clamp)(index, 0, count());
79
- for (let i = index; i < count(); i++) {
80
- if (!isOptionDisabled(state.options[i]))
81
- return i;
82
- }
83
- for (let i = index - 1; i >= 0; i--) {
84
- if (!isOptionDisabled(state.options[i]))
85
- return i;
86
- }
87
- };
88
- const setIndex = (index, emitChange) => {
89
- index = adjustIndex(index) || 0;
90
- const offset = -index * props.itemHeight;
62
+ const count = () => props.options.length;
63
+ const baseOffset = () => props.optionHeight * (+props.visibleOptionNum - 1) / 2;
64
+ const updateValueByIndex = (index) => {
65
+ const enabledIndex = (0, import_utils2.findIndexOfEnabledOption)(props.options, index);
66
+ const offset = -enabledIndex * props.optionHeight;
91
67
  const trigger = () => {
92
- if (index !== state.index) {
93
- state.index = index;
94
- if (emitChange) {
95
- emit("change", index);
96
- }
68
+ const value = props.options[enabledIndex][props.fields.value];
69
+ if (value !== props.value) {
70
+ emit("change", value);
97
71
  }
98
72
  };
99
- if (moving && offset !== state.offset) {
73
+ if (moving && offset !== currentOffset.value) {
100
74
  transitionEndTrigger = trigger;
101
75
  } else {
102
76
  trigger();
103
77
  }
104
- state.offset = offset;
105
- };
106
- const setOptions = (options) => {
107
- if (JSON.stringify(options) !== JSON.stringify(state.options)) {
108
- state.options = (0, import_deep_clone.deepClone)(options);
109
- setIndex(props.defaultIndex);
110
- }
78
+ currentOffset.value = offset;
111
79
  };
112
80
  const onClickItem = (index) => {
113
81
  if (moving || props.readonly) {
114
82
  return;
115
83
  }
116
84
  transitionEndTrigger = null;
117
- state.duration = DEFAULT_DURATION;
118
- setIndex(index, true);
85
+ currentDuration.value = DEFAULT_DURATION;
86
+ updateValueByIndex(index);
119
87
  };
120
- const getOptionText = (option) => {
121
- if ((0, import_utils.isObject)(option) && props.textKey in option) {
122
- return option[props.textKey];
123
- }
124
- return option;
125
- };
126
- const getIndexByOffset = (offset) => (0, import_utils.clamp)(Math.round(-offset / props.itemHeight), 0, count() - 1);
88
+ const getIndexByOffset = (offset) => (0, import_utils.clamp)(Math.round(-offset / props.optionHeight), 0, count() - 1);
127
89
  const momentum = (distance, duration) => {
128
90
  const speed = Math.abs(distance / duration);
129
- distance = state.offset + speed / 3e-3 * (distance < 0 ? -1 : 1);
91
+ distance = currentOffset.value + speed / 3e-3 * (distance < 0 ? -1 : 1);
130
92
  const index = getIndexByOffset(distance);
131
- state.duration = +props.swipeDuration;
132
- setIndex(index, true);
93
+ currentDuration.value = +props.swipeDuration;
94
+ updateValueByIndex(index);
133
95
  };
134
96
  const stopMomentum = () => {
135
97
  moving = false;
136
- state.duration = 0;
98
+ currentDuration.value = 0;
137
99
  if (transitionEndTrigger) {
138
100
  transitionEndTrigger();
139
101
  transitionEndTrigger = null;
@@ -145,13 +107,11 @@ var stdin_default = (0, import_vue2.defineComponent)({
145
107
  }
146
108
  touch.start(event);
147
109
  if (moving) {
148
- const translateY = getElementTranslateY(wrapper.value);
149
- state.offset = Math.min(0, translateY - baseOffset());
150
- startOffset = state.offset;
151
- } else {
152
- startOffset = state.offset;
110
+ const translateY = (0, import_utils2.getElementTranslateY)(wrapper.value);
111
+ currentOffset.value = Math.min(0, translateY - baseOffset());
153
112
  }
154
- state.duration = 0;
113
+ currentDuration.value = 0;
114
+ startOffset = currentOffset.value;
155
115
  touchStartTime = Date.now();
156
116
  momentumOffset = startOffset;
157
117
  transitionEndTrigger = null;
@@ -165,46 +125,49 @@ var stdin_default = (0, import_vue2.defineComponent)({
165
125
  moving = true;
166
126
  (0, import_utils.preventDefault)(event, true);
167
127
  }
168
- state.offset = (0, import_utils.clamp)(startOffset + touch.deltaY.value, -(count() * props.itemHeight), props.itemHeight);
128
+ currentOffset.value = (0, import_utils.clamp)(startOffset + touch.deltaY.value, -(count() * props.optionHeight), props.optionHeight);
169
129
  const now = Date.now();
170
- if (now - touchStartTime > MOMENTUM_LIMIT_TIME) {
130
+ if (now - touchStartTime > MOMENTUM_TIME) {
171
131
  touchStartTime = now;
172
- momentumOffset = state.offset;
132
+ momentumOffset = currentOffset.value;
173
133
  }
174
134
  };
175
135
  const onTouchEnd = () => {
176
136
  if (props.readonly) {
177
137
  return;
178
138
  }
179
- const distance = state.offset - momentumOffset;
139
+ const distance = currentOffset.value - momentumOffset;
180
140
  const duration = Date.now() - touchStartTime;
181
- const allowMomentum = duration < MOMENTUM_LIMIT_TIME && Math.abs(distance) > MOMENTUM_LIMIT_DISTANCE;
182
- if (allowMomentum) {
141
+ const startMomentum = duration < MOMENTUM_TIME && Math.abs(distance) > MOMENTUM_DISTANCE;
142
+ if (startMomentum) {
183
143
  momentum(distance, duration);
184
144
  return;
185
145
  }
186
- const index = getIndexByOffset(state.offset);
187
- state.duration = DEFAULT_DURATION;
188
- setIndex(index, true);
146
+ const index = getIndexByOffset(currentOffset.value);
147
+ currentDuration.value = DEFAULT_DURATION;
148
+ updateValueByIndex(index);
189
149
  setTimeout(() => {
190
150
  moving = false;
191
151
  }, 0);
192
152
  };
193
153
  const renderOptions = () => {
194
154
  const optionStyle = {
195
- height: `${props.itemHeight}px`
155
+ height: `${props.optionHeight}px`
196
156
  };
197
- return state.options.map((option, index) => {
198
- const text = getOptionText(option);
199
- const disabled = isOptionDisabled(option);
157
+ return props.options.map((option, index) => {
158
+ const text = option[props.fields.text];
159
+ const {
160
+ disabled
161
+ } = option;
162
+ const value = option[props.fields.value];
200
163
  const data = {
201
164
  role: "button",
202
165
  style: optionStyle,
203
166
  tabindex: disabled ? -1 : 0,
204
- class: bem("item", {
167
+ class: [bem("item", {
205
168
  disabled,
206
- selected: index === state.index
207
- }),
169
+ selected: value === props.value
170
+ }), option.className],
208
171
  onClick: () => onClickItem(index)
209
172
  };
210
173
  const childData = {
@@ -214,31 +177,18 @@ var stdin_default = (0, import_vue2.defineComponent)({
214
177
  return (0, import_vue.createVNode)("li", data, [slots.option ? slots.option(option) : (0, import_vue.createVNode)("div", childData, null)]);
215
178
  });
216
179
  };
217
- const setValue = (value) => {
218
- const {
219
- options
220
- } = state;
221
- for (let i = 0; i < options.length; i++) {
222
- if (getOptionText(options[i]) === value) {
223
- return setIndex(i);
224
- }
225
- }
226
- };
227
- const getValue = () => state.options[state.index];
228
- setIndex(state.index);
229
180
  (0, import_use.useParent)(PICKER_KEY);
230
181
  (0, import_use_expose.useExpose)({
231
- state,
232
- setIndex,
233
- getValue,
234
- setValue,
235
- setOptions,
236
182
  stopMomentum
237
183
  });
238
- (0, import_vue2.watch)(() => props.initialOptions, setOptions);
239
- (0, import_vue2.watch)(() => props.defaultIndex, (value) => setIndex(value));
184
+ (0, import_vue2.watchEffect)(() => {
185
+ const index = props.options.findIndex((option) => option[props.fields.value] === props.value);
186
+ const enabledIndex = (0, import_utils2.findIndexOfEnabledOption)(props.options, index);
187
+ const offset = -enabledIndex * props.optionHeight;
188
+ currentOffset.value = offset;
189
+ });
240
190
  return () => (0, import_vue.createVNode)("div", {
241
- "class": [bem(), props.className],
191
+ "class": bem(),
242
192
  "onTouchstart": onTouchStart,
243
193
  "onTouchmove": onTouchMove,
244
194
  "onTouchend": onTouchEnd,
@@ -246,9 +196,9 @@ var stdin_default = (0, import_vue2.defineComponent)({
246
196
  }, [(0, import_vue.createVNode)("ul", {
247
197
  "ref": wrapper,
248
198
  "style": {
249
- transform: `translate3d(0, ${state.offset + baseOffset()}px, 0)`,
250
- transitionDuration: `${state.duration}ms`,
251
- transitionProperty: state.duration ? "all" : "none"
199
+ transform: `translate3d(0, ${currentOffset.value + baseOffset()}px, 0)`,
200
+ transitionDuration: `${currentDuration.value}ms`,
201
+ transitionProperty: currentDuration.value ? "all" : "none"
252
202
  },
253
203
  "class": bem("wrapper"),
254
204
  "onTransitionend": stopMomentum
@@ -1 +1 @@
1
- :root{--van-picker-background-color: var(--van-background-color-light);--van-picker-toolbar-height: 44px;--van-picker-title-font-size: var(--van-font-size-lg);--van-picker-title-line-height: var(--van-line-height-md);--van-picker-action-padding: 0 var(--van-padding-md);--van-picker-action-font-size: var(--van-font-size-md);--van-picker-confirm-action-color: var(--van-text-link-color);--van-picker-cancel-action-color: var(--van-text-color-2);--van-picker-option-font-size: var(--van-font-size-lg);--van-picker-option-padding: 0 var(--van-padding-base);--van-picker-option-text-color: var(--van-text-color);--van-picker-option-disabled-opacity: .3;--van-picker-loading-icon-color: var(--van-primary-color);--van-picker-loading-mask-color: rgba(255, 255, 255, .9);--van-picker-mask-color: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .4)), linear-gradient(0deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .4))}.van-picker{position:relative;background:var(--van-picker-background-color);-webkit-user-select:none;user-select:none}.van-picker__toolbar{display:flex;align-items:center;justify-content:space-between;height:var(--van-picker-toolbar-height)}.van-picker__cancel,.van-picker__confirm{height:100%;padding:var(--van-picker-action-padding);font-size:var(--van-picker-action-font-size);background-color:transparent;border:none}.van-picker__confirm{color:var(--van-picker-confirm-action-color)}.van-picker__cancel{color:var(--van-picker-cancel-action-color)}.van-picker__title{max-width:50%;font-weight:var(--van-font-weight-bold);font-size:var(--van-picker-title-font-size);line-height:var(--van-picker-title-line-height);text-align:center}.van-picker__columns{position:relative;display:flex;cursor:-webkit-grab;cursor:grab}.van-picker__loading{position:absolute;top:0;right:0;bottom:0;left:0;z-index:3;display:flex;align-items:center;justify-content:center;color:var(--van-picker-loading-icon-color);background:var(--van-picker-loading-mask-color)}.van-picker__frame{position:absolute;top:50%;right:var(--van-padding-md);left:var(--van-padding-md);z-index:2;transform:translateY(-50%);pointer-events:none}.van-picker__mask{position:absolute;top:0;left:0;z-index:1;width:100%;height:100%;background-image:var(--van-picker-mask-color);background-repeat:no-repeat;background-position:top,bottom;transform:translateZ(0);pointer-events:none}.van-picker-column{flex:1;overflow:hidden;font-size:var(--van-picker-option-font-size)}.van-picker-column__wrapper{transition-timing-function:cubic-bezier(.23,1,.68,1)}.van-picker-column__item{display:flex;align-items:center;justify-content:center;padding:var(--van-picker-option-padding);color:var(--van-picker-option-text-color)}.van-picker-column__item--disabled{cursor:not-allowed;opacity:var(--van-picker-option-disabled-opacity)}
1
+ body{--van-picker-background: var(--van-background-2);--van-picker-toolbar-height: 44px;--van-picker-title-font-size: var(--van-font-size-lg);--van-picker-title-line-height: var(--van-line-height-md);--van-picker-action-padding: 0 var(--van-padding-md);--van-picker-action-font-size: var(--van-font-size-md);--van-picker-confirm-action-color: var(--van-link-color);--van-picker-cancel-action-color: var(--van-text-color-2);--van-picker-option-font-size: var(--van-font-size-lg);--van-picker-option-padding: 0 var(--van-padding-base);--van-picker-option-text-color: var(--van-text-color);--van-picker-option-disabled-opacity: .3;--van-picker-loading-icon-color: var(--van-primary-color);--van-picker-loading-mask-color: rgba(255, 255, 255, .9);--van-picker-mask-color: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .4)), linear-gradient(0deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .4))}.van-theme-dark{--van-picker-mask-color: linear-gradient(180deg, rgba(0, 0, 0, .6), rgba(0, 0, 0, .1)), linear-gradient(0deg, rgba(0, 0, 0, .6), rgba(0, 0, 0, .1))}.van-picker{position:relative;background:var(--van-picker-background);-webkit-user-select:none;user-select:none}.van-picker__toolbar{display:flex;align-items:center;justify-content:space-between;height:var(--van-picker-toolbar-height)}.van-picker__cancel,.van-picker__confirm{height:100%;padding:var(--van-picker-action-padding);font-size:var(--van-picker-action-font-size);background-color:transparent;border:none}.van-picker__confirm{color:var(--van-picker-confirm-action-color)}.van-picker__cancel{color:var(--van-picker-cancel-action-color)}.van-picker__title{color:var(--van-text-color);max-width:50%;font-weight:var(--van-font-bold);font-size:var(--van-picker-title-font-size);line-height:var(--van-picker-title-line-height);text-align:center}.van-picker__columns{position:relative;display:flex;cursor:-webkit-grab;cursor:grab}.van-picker__loading{position:absolute;top:0;right:0;bottom:0;left:0;z-index:3;display:flex;align-items:center;justify-content:center;color:var(--van-picker-loading-icon-color);background:var(--van-picker-loading-mask-color)}.van-picker__frame{position:absolute;top:50%;right:var(--van-padding-md);left:var(--van-padding-md);z-index:2;transform:translateY(-50%);pointer-events:none}.van-picker__mask{position:absolute;top:0;left:0;z-index:1;width:100%;height:100%;background-image:var(--van-picker-mask-color);background-repeat:no-repeat;background-position:top,bottom;transform:translateZ(0);pointer-events:none}.van-picker-column{flex:1;overflow:hidden;font-size:var(--van-picker-option-font-size)}.van-picker-column__wrapper{transition-timing-function:cubic-bezier(.23,1,.68,1)}.van-picker-column__item{display:flex;align-items:center;justify-content:center;padding:var(--van-picker-option-padding);color:var(--van-picker-option-text-color)}.van-picker-column__item--disabled{cursor:not-allowed;opacity:var(--van-picker-option-disabled-opacity)}
@@ -4,7 +4,7 @@ export declare const Picker: import("../utils").WithInstall<import("vue").Define
4
4
  loading: BooleanConstructor;
5
5
  readonly: BooleanConstructor;
6
6
  allowHtml: BooleanConstructor;
7
- itemHeight: {
7
+ optionHeight: {
8
8
  type: (NumberConstructor | StringConstructor)[];
9
9
  default: number;
10
10
  };
@@ -16,7 +16,7 @@ export declare const Picker: import("../utils").WithInstall<import("vue").Define
16
16
  type: (NumberConstructor | StringConstructor)[];
17
17
  default: number;
18
18
  };
19
- visibleItemCount: {
19
+ visibleOptionNum: {
20
20
  type: (NumberConstructor | StringConstructor)[];
21
21
  default: number;
22
22
  };
@@ -24,25 +24,24 @@ export declare const Picker: import("../utils").WithInstall<import("vue").Define
24
24
  confirmButtonText: StringConstructor;
25
25
  } & {
26
26
  columns: {
27
- type: import("vue").PropType<(import("./types").PickerOption | import("./types").PickerColumn)[]>;
27
+ type: import("vue").PropType<(import("./types").PickerColumn | import("./types").PickerOption)[]>;
28
28
  default: () => never[];
29
29
  };
30
- valueKey: StringConstructor;
31
- defaultIndex: {
32
- type: (NumberConstructor | StringConstructor)[];
33
- default: number;
30
+ modelValue: {
31
+ type: import("vue").PropType<import("../utils").Numeric[]>;
32
+ default: () => never[];
34
33
  };
35
34
  toolbarPosition: {
36
35
  type: import("vue").PropType<import("./types").PickerToolbarPosition>;
37
36
  default: import("./types").PickerToolbarPosition;
38
37
  };
39
38
  columnsFieldNames: import("vue").PropType<import("./types").PickerFieldNames>;
40
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "cancel" | "confirm")[], "change" | "cancel" | "confirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
39
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "cancel" | "confirm")[], "update:modelValue" | "change" | "cancel" | "confirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
41
40
  title: StringConstructor;
42
41
  loading: BooleanConstructor;
43
42
  readonly: BooleanConstructor;
44
43
  allowHtml: BooleanConstructor;
45
- itemHeight: {
44
+ optionHeight: {
46
45
  type: (NumberConstructor | StringConstructor)[];
47
46
  default: number;
48
47
  };
@@ -54,7 +53,7 @@ export declare const Picker: import("../utils").WithInstall<import("vue").Define
54
53
  type: (NumberConstructor | StringConstructor)[];
55
54
  default: number;
56
55
  };
57
- visibleItemCount: {
56
+ visibleOptionNum: {
58
57
  type: (NumberConstructor | StringConstructor)[];
59
58
  default: number;
60
59
  };
@@ -62,13 +61,12 @@ export declare const Picker: import("../utils").WithInstall<import("vue").Define
62
61
  confirmButtonText: StringConstructor;
63
62
  } & {
64
63
  columns: {
65
- type: import("vue").PropType<(import("./types").PickerOption | import("./types").PickerColumn)[]>;
64
+ type: import("vue").PropType<(import("./types").PickerColumn | import("./types").PickerOption)[]>;
66
65
  default: () => never[];
67
66
  };
68
- valueKey: StringConstructor;
69
- defaultIndex: {
70
- type: (NumberConstructor | StringConstructor)[];
71
- default: number;
67
+ modelValue: {
68
+ type: import("vue").PropType<import("../utils").Numeric[]>;
69
+ default: () => never[];
72
70
  };
73
71
  toolbarPosition: {
74
72
  type: import("vue").PropType<import("./types").PickerToolbarPosition>;
@@ -77,23 +75,24 @@ export declare const Picker: import("../utils").WithInstall<import("vue").Define
77
75
  columnsFieldNames: import("vue").PropType<import("./types").PickerFieldNames>;
78
76
  }>> & {
79
77
  onChange?: ((...args: any[]) => any) | undefined;
78
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
80
79
  onCancel?: ((...args: any[]) => any) | undefined;
81
80
  onConfirm?: ((...args: any[]) => any) | undefined;
82
81
  }, {
82
+ modelValue: import("../utils").Numeric[];
83
83
  readonly: boolean;
84
84
  loading: boolean;
85
- defaultIndex: string | number;
86
85
  allowHtml: boolean;
87
- itemHeight: string | number;
86
+ optionHeight: string | number;
88
87
  showToolbar: boolean;
89
88
  swipeDuration: string | number;
90
- visibleItemCount: string | number;
91
- columns: (import("./types").PickerOption | import("./types").PickerColumn)[];
89
+ visibleOptionNum: string | number;
90
+ columns: (import("./types").PickerColumn | import("./types").PickerOption)[];
92
91
  toolbarPosition: import("./types").PickerToolbarPosition;
93
92
  }>>;
94
93
  export default Picker;
95
94
  export type { PickerProps };
96
- export type { PickerColumn, PickerOption, PickerInstance, PickerFieldNames, PickerObjectColumn, PickerObjectOption, PickerToolbarPosition, } from './types';
95
+ export type { PickerColumn, PickerOption, PickerInstance, PickerFieldNames, PickerToolbarPosition, PickerCancelEventParams, PickerChangeEventParams, PickerConfirmEventParams, } from './types';
97
96
  declare module 'vue' {
98
97
  interface GlobalComponents {
99
98
  VanPicker: typeof Picker;
@@ -1,26 +1,38 @@
1
- @import './var.less';
1
+ body {
2
+ --van-picker-background: var(--van-background-2);
3
+ --van-picker-toolbar-height: 44px;
4
+ --van-picker-title-font-size: var(--van-font-size-lg);
5
+ --van-picker-title-line-height: var(--van-line-height-md);
6
+ --van-picker-action-padding: 0 var(--van-padding-md);
7
+ --van-picker-action-font-size: var(--van-font-size-md);
8
+ --van-picker-confirm-action-color: var(--van-link-color);
9
+ --van-picker-cancel-action-color: var(--van-text-color-2);
10
+ --van-picker-option-font-size: var(--van-font-size-lg);
11
+ --van-picker-option-padding: 0 var(--van-padding-base);
12
+ --van-picker-option-text-color: var(--van-text-color);
13
+ --van-picker-option-disabled-opacity: 0.3;
14
+ --van-picker-loading-icon-color: var(--van-primary-color);
15
+ --van-picker-loading-mask-color: rgba(255, 255, 255, 0.9);
16
+ --van-picker-mask-color: linear-gradient(
17
+ 180deg,
18
+ rgba(255, 255, 255, 0.9),
19
+ rgba(255, 255, 255, 0.4)
20
+ ),
21
+ linear-gradient(0deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.4));
22
+ }
2
23
 
3
- :root {
4
- --van-picker-background-color: @picker-background-color;
5
- --van-picker-toolbar-height: @picker-toolbar-height;
6
- --van-picker-title-font-size: @picker-title-font-size;
7
- --van-picker-title-line-height: @picker-title-line-height;
8
- --van-picker-action-padding: @picker-action-padding;
9
- --van-picker-action-font-size: @picker-action-font-size;
10
- --van-picker-confirm-action-color: @picker-confirm-action-color;
11
- --van-picker-cancel-action-color: @picker-cancel-action-color;
12
- --van-picker-option-font-size: @picker-option-font-size;
13
- --van-picker-option-padding: @picker-option-padding;
14
- --van-picker-option-text-color: @picker-option-text-color;
15
- --van-picker-option-disabled-opacity: @picker-option-disabled-opacity;
16
- --van-picker-loading-icon-color: @picker-loading-icon-color;
17
- --van-picker-loading-mask-color: @picker-loading-mask-color;
18
- --van-picker-mask-color: @picker-mask-color;
24
+ .van-theme-dark {
25
+ --van-picker-mask-color: linear-gradient(
26
+ 180deg,
27
+ rgba(0, 0, 0, 0.6),
28
+ rgba(0, 0, 0, 0.1)
29
+ ),
30
+ linear-gradient(0deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.1));
19
31
  }
20
32
 
21
33
  .van-picker {
22
34
  position: relative;
23
- background: var(--van-picker-background-color);
35
+ background: var(--van-picker-background);
24
36
  user-select: none;
25
37
 
26
38
  &__toolbar {
@@ -48,8 +60,9 @@
48
60
  }
49
61
 
50
62
  &__title {
63
+ color: var(--van-text-color);
51
64
  max-width: 50%;
52
- font-weight: var(--van-font-weight-bold);
65
+ font-weight: var(--van-font-bold);
53
66
  font-size: var(--van-picker-title-font-size);
54
67
  line-height: var(--van-picker-title-line-height);
55
68
  text-align: center;
@@ -4,35 +4,21 @@ import type { PickerProps } from './Picker';
4
4
  export declare type PickerToolbarPosition = 'top' | 'bottom';
5
5
  export declare type PickerFieldNames = {
6
6
  text?: string;
7
- values?: string;
7
+ value?: string;
8
8
  children?: string;
9
9
  };
10
- export declare type PickerObjectOption = {
10
+ export declare type PickerOption = {
11
11
  text?: Numeric;
12
+ value?: Numeric;
12
13
  disabled?: boolean;
13
- [key: PropertyKey]: any;
14
- };
15
- export declare type PickerOption = Numeric | PickerObjectOption;
16
- export declare type PickerObjectColumn = {
17
- values?: PickerOption[];
18
14
  children?: PickerColumn;
19
15
  className?: unknown;
20
- defaultIndex?: number;
21
16
  [key: PropertyKey]: any;
22
17
  };
23
- export declare type PickerColumn = PickerOption[] | PickerObjectColumn;
18
+ export declare type PickerColumn = PickerOption[];
24
19
  export declare type PickerExpose = {
25
20
  confirm: () => void;
26
- getValues: <T = PickerOption>() => T[];
27
- setValues: (values: string[]) => void;
28
- getIndexes: () => number[];
29
- setIndexes: (indexes: number[]) => void;
30
- getColumnIndex: (index: number) => number;
31
- setColumnIndex: (columnIndex: number, optionIndex: number) => void;
32
- getColumnValue: <T = PickerOption>(index: number) => T;
33
- setColumnValue: (index: number, value: string) => void;
34
- getColumnValues: <T = PickerOption>(index: number) => T[];
35
- setColumnValues: (index: number, options: PickerOption[]) => void;
21
+ getSelectedOptions: () => Array<PickerOption | undefined>;
36
22
  };
37
23
  export declare type PickerColumnProvide = {
38
24
  state: {
@@ -48,3 +34,11 @@ export declare type PickerColumnProvide = {
48
34
  stopMomentum: () => void;
49
35
  };
50
36
  export declare type PickerInstance = ComponentPublicInstance<PickerProps, PickerExpose>;
37
+ export declare type PickerConfirmEventParams = {
38
+ selectedValues: Numeric[];
39
+ selectedOptions: Array<PickerOption | undefined>;
40
+ };
41
+ export declare type PickerCancelEventParams = PickerConfirmEventParams;
42
+ export declare type PickerChangeEventParams = PickerConfirmEventParams & {
43
+ columnIndex: number;
44
+ };
@@ -0,0 +1,11 @@
1
+ import { type Numeric } from '../utils';
2
+ import type { Ref } from 'vue';
3
+ import type { PickerOption, PickerColumn, PickerFieldNames } from './types';
4
+ export declare const getFirstEnabledOption: (options: PickerOption[]) => PickerOption | undefined;
5
+ export declare function getColumnsType(columns: PickerColumn | PickerColumn[], fields: Required<PickerFieldNames>): "default" | "multiple" | "cascade";
6
+ export declare function findIndexOfEnabledOption(options: PickerOption[], index: number): number;
7
+ export declare const isOptionExist: (options: PickerOption[], value: Numeric | undefined, fields: Required<PickerFieldNames>) => boolean;
8
+ export declare function findOptionByValue(options: PickerOption[], value: Numeric, fields: Required<PickerFieldNames>): PickerOption | undefined;
9
+ export declare function formatCascadeColumns(columns: PickerColumn | PickerColumn[], fields: Required<PickerFieldNames>, selectedValues: Ref<Numeric[]>): PickerColumn[];
10
+ export declare function getElementTranslateY(element: Element): number;
11
+ export declare function assignDefaultFields(fields: PickerFieldNames | undefined): Required<PickerFieldNames>;
@@ -0,0 +1,92 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var stdin_exports = {};
19
+ __export(stdin_exports, {
20
+ assignDefaultFields: () => assignDefaultFields,
21
+ findIndexOfEnabledOption: () => findIndexOfEnabledOption,
22
+ findOptionByValue: () => findOptionByValue,
23
+ formatCascadeColumns: () => formatCascadeColumns,
24
+ getColumnsType: () => getColumnsType,
25
+ getElementTranslateY: () => getElementTranslateY,
26
+ getFirstEnabledOption: () => getFirstEnabledOption,
27
+ isOptionExist: () => isOptionExist
28
+ });
29
+ module.exports = __toCommonJS(stdin_exports);
30
+ var import_utils = require("../utils");
31
+ const getFirstEnabledOption = (options) => options.find((option) => !option.disabled) || options[0];
32
+ function getColumnsType(columns, fields) {
33
+ const firstColumn = columns[0];
34
+ if (firstColumn) {
35
+ if (Array.isArray(firstColumn)) {
36
+ return "multiple";
37
+ }
38
+ if (fields.children in firstColumn) {
39
+ return "cascade";
40
+ }
41
+ }
42
+ return "default";
43
+ }
44
+ function findIndexOfEnabledOption(options, index) {
45
+ index = (0, import_utils.clamp)(index, 0, options.length);
46
+ for (let i = index; i < options.length; i++) {
47
+ if (!options[i].disabled)
48
+ return i;
49
+ }
50
+ for (let i = index - 1; i >= 0; i--) {
51
+ if (!options[i].disabled)
52
+ return i;
53
+ }
54
+ return 0;
55
+ }
56
+ const isOptionExist = (options, value, fields) => value !== void 0 && !!options.find((option) => option[fields.value] === value);
57
+ function findOptionByValue(options, value, fields) {
58
+ const index = options.findIndex((option) => option[fields.value] === value);
59
+ const enabledIndex = findIndexOfEnabledOption(options, index);
60
+ return options[enabledIndex];
61
+ }
62
+ function formatCascadeColumns(columns, fields, selectedValues) {
63
+ const formatted = [];
64
+ let cursor = {
65
+ [fields.children]: columns
66
+ };
67
+ let columnIndex = 0;
68
+ while (cursor && cursor[fields.children]) {
69
+ const options = cursor[fields.children];
70
+ const value = selectedValues.value[columnIndex];
71
+ cursor = (0, import_utils.isDef)(value) ? findOptionByValue(options, value, fields) : void 0;
72
+ if (!cursor && options.length) {
73
+ const firstValue = getFirstEnabledOption(options)[fields.value];
74
+ cursor = findOptionByValue(options, firstValue, fields);
75
+ }
76
+ columnIndex++;
77
+ formatted.push(options);
78
+ }
79
+ return formatted;
80
+ }
81
+ function getElementTranslateY(element) {
82
+ const { transform } = window.getComputedStyle(element);
83
+ const translateY = transform.slice(7, transform.length - 1).split(", ")[5];
84
+ return Number(translateY);
85
+ }
86
+ function assignDefaultFields(fields) {
87
+ return (0, import_utils.extend)({
88
+ text: "text",
89
+ value: "value",
90
+ children: "children"
91
+ }, fields);
92
+ }
@@ -149,13 +149,13 @@ declare const _default: import("vue").DefineComponent<{
149
149
  "onUpdate:show"?: ((...args: any[]) => any) | undefined;
150
150
  }, {
151
151
  offset: [number, number];
152
+ theme: PopoverTheme;
152
153
  overlay: boolean;
153
154
  show: boolean;
154
155
  teleport: string | import("vue").RendererElement | null | undefined;
155
156
  closeOnClickOverlay: boolean;
156
157
  actions: PopoverAction[];
157
158
  closeOnClickAction: boolean;
158
- theme: PopoverTheme;
159
159
  closeOnClickOutside: boolean;
160
160
  trigger: PopoverTrigger;
161
161
  showArrow: boolean;