vant 3.4.5 → 4.0.0-alpha.0

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 (812) hide show
  1. package/es/action-bar/index.css +1 -1
  2. package/es/action-bar/index.less +4 -6
  3. package/es/action-bar-button/index.css +1 -1
  4. package/es/action-bar-button/index.less +9 -11
  5. package/es/action-bar-icon/index.css +1 -1
  6. package/es/action-bar-icon/index.less +10 -12
  7. package/es/action-sheet/index.css +1 -1
  8. package/es/action-sheet/index.less +23 -24
  9. package/es/address-edit/AddressEdit.d.ts +6 -6
  10. package/es/address-edit/AddressEdit.js +29 -33
  11. package/es/address-edit/AddressEditDetail.d.ts +2 -2
  12. package/es/address-edit/AddressEditDetail.js +5 -14
  13. package/es/address-edit/index.css +1 -1
  14. package/es/address-edit/index.d.ts +6 -6
  15. package/es/address-edit/index.less +8 -15
  16. package/es/address-edit/types.d.ts +2 -4
  17. package/es/address-list/AddressList.d.ts +4 -4
  18. package/es/address-list/AddressList.js +5 -5
  19. package/es/address-list/AddressListItem.js +3 -3
  20. package/es/address-list/index.css +1 -1
  21. package/es/address-list/index.d.ts +4 -4
  22. package/es/address-list/index.less +20 -22
  23. package/es/area/Area.d.ts +13 -25
  24. package/es/area/Area.js +43 -208
  25. package/es/area/index.d.ts +11 -19
  26. package/es/area/types.d.ts +2 -17
  27. package/es/area/utils.d.ts +6 -0
  28. package/es/area/utils.js +85 -0
  29. package/es/badge/index.css +1 -1
  30. package/es/badge/index.less +15 -17
  31. package/es/button/index.css +1 -1
  32. package/es/button/index.less +55 -52
  33. package/es/calendar/Calendar.d.ts +6 -6
  34. package/es/calendar/Calendar.js +5 -5
  35. package/es/calendar/CalendarHeader.d.ts +2 -2
  36. package/es/calendar/CalendarHeader.js +2 -2
  37. package/es/calendar/CalendarMonth.d.ts +1 -2
  38. package/es/calendar/CalendarMonth.js +2 -2
  39. package/es/calendar/index.css +1 -1
  40. package/es/calendar/index.d.ts +6 -6
  41. package/es/calendar/index.less +40 -37
  42. package/es/card/Card.d.ts +2 -2
  43. package/es/card/Card.js +3 -3
  44. package/es/card/index.css +1 -1
  45. package/es/card/index.d.ts +2 -2
  46. package/es/card/index.less +23 -25
  47. package/es/cascader/Cascader.d.ts +2 -2
  48. package/es/cascader/Cascader.js +3 -3
  49. package/es/cascader/index.css +1 -1
  50. package/es/cascader/index.d.ts +2 -2
  51. package/es/cascader/index.less +17 -19
  52. package/es/cell/Cell.js +1 -4
  53. package/es/cell/index.css +1 -1
  54. package/es/cell/index.less +21 -27
  55. package/es/cell-group/index.css +1 -1
  56. package/es/cell-group/index.less +12 -13
  57. package/es/checkbox/index.css +1 -1
  58. package/es/checkbox/index.less +12 -14
  59. package/es/circle/index.css +1 -1
  60. package/es/circle/index.less +8 -10
  61. package/es/collapse-item/index.css +1 -1
  62. package/es/collapse-item/index.less +12 -12
  63. package/es/config-provider/ConfigProvider.d.ts +14 -0
  64. package/es/config-provider/ConfigProvider.js +9 -2
  65. package/es/config-provider/index.d.ts +10 -1
  66. package/es/contact-card/ContactCard.js +2 -2
  67. package/es/contact-card/index.css +1 -1
  68. package/es/contact-card/index.less +7 -9
  69. package/es/contact-edit/ContactEdit.d.ts +2 -2
  70. package/es/contact-edit/ContactEdit.js +3 -4
  71. package/es/contact-edit/index.css +1 -1
  72. package/es/contact-edit/index.d.ts +2 -2
  73. package/es/contact-edit/index.less +7 -9
  74. package/es/contact-list/ContactList.js +4 -4
  75. package/es/contact-list/index.css +1 -1
  76. package/es/contact-list/index.less +9 -11
  77. package/es/count-down/index.css +1 -1
  78. package/es/count-down/index.less +4 -6
  79. package/es/coupon/index.css +1 -1
  80. package/es/coupon/index.less +28 -31
  81. package/es/coupon-cell/index.css +1 -1
  82. package/es/coupon-cell/index.less +2 -4
  83. package/es/coupon-list/CouponList.js +2 -2
  84. package/es/coupon-list/index.css +1 -1
  85. package/es/coupon-list/index.less +15 -17
  86. package/es/date-picker/DatePicker.d.ts +168 -0
  87. package/es/date-picker/DatePicker.js +111 -0
  88. package/es/{datetime-picker/DatePicker.d.ts → date-picker/index.d.ts} +40 -28
  89. package/es/date-picker/index.js +8 -0
  90. package/es/{datetime-picker → date-picker}/style/index.d.ts +0 -0
  91. package/es/{datetime-picker → date-picker}/style/index.js +0 -0
  92. package/es/{datetime-picker → date-picker}/style/less.d.ts +0 -0
  93. package/es/{datetime-picker → date-picker}/style/less.js +0 -0
  94. package/es/{datetime-picker → date-picker}/utils.d.ts +15 -11
  95. package/es/date-picker/utils.js +40 -0
  96. package/es/dialog/index.css +1 -1
  97. package/es/dialog/index.less +22 -24
  98. package/es/divider/index.css +1 -1
  99. package/es/divider/index.less +10 -12
  100. package/es/dropdown-item/index.css +1 -1
  101. package/es/dropdown-item/index.less +2 -5
  102. package/es/dropdown-menu/index.css +1 -1
  103. package/es/dropdown-menu/index.less +14 -17
  104. package/es/empty/index.css +1 -1
  105. package/es/empty/index.less +9 -11
  106. package/es/field/Field.d.ts +4 -4
  107. package/es/field/Field.js +4 -4
  108. package/es/field/index.css +1 -1
  109. package/es/field/index.d.ts +4 -4
  110. package/es/field/index.less +20 -23
  111. package/es/grid-item/index.css +1 -1
  112. package/es/grid-item/index.less +10 -13
  113. package/es/image/index.css +1 -1
  114. package/es/image/index.less +10 -12
  115. package/es/image-preview/index.css +1 -1
  116. package/es/image-preview/index.less +11 -13
  117. package/es/index-anchor/index.css +1 -1
  118. package/es/index-anchor/index.less +12 -14
  119. package/es/index-bar/index.css +1 -1
  120. package/es/index-bar/index.less +7 -8
  121. package/es/index.d.ts +3 -2
  122. package/es/index.js +7 -4
  123. package/es/list/index.css +1 -1
  124. package/es/list/index.less +5 -7
  125. package/es/loading/index.css +1 -1
  126. package/es/loading/index.less +7 -10
  127. package/es/nav-bar/NavBar.d.ts +3 -3
  128. package/es/nav-bar/NavBar.js +3 -3
  129. package/es/nav-bar/index.css +1 -1
  130. package/es/nav-bar/index.d.ts +3 -3
  131. package/es/nav-bar/index.less +11 -13
  132. package/es/notice-bar/index.css +1 -1
  133. package/es/notice-bar/index.less +11 -13
  134. package/es/notify/index.css +1 -1
  135. package/es/notify/index.less +13 -15
  136. package/es/number-keyboard/NumberKeyboard.d.ts +1 -1
  137. package/es/number-keyboard/index.css +1 -1
  138. package/es/number-keyboard/index.d.ts +1 -1
  139. package/es/number-keyboard/index.less +26 -22
  140. package/es/overlay/index.css +1 -1
  141. package/es/overlay/index.less +4 -6
  142. package/es/pagination/index.css +1 -1
  143. package/es/pagination/index.less +13 -15
  144. package/es/password-input/index.css +1 -1
  145. package/es/password-input/index.less +20 -22
  146. package/es/picker/Picker.d.ts +26 -28
  147. package/es/picker/Picker.js +91 -196
  148. package/es/picker/PickerColumn.d.ts +21 -30
  149. package/es/picker/PickerColumn.js +61 -111
  150. package/es/picker/index.css +1 -1
  151. package/es/picker/index.d.ts +19 -20
  152. package/es/picker/index.less +31 -19
  153. package/es/picker/types.d.ts +13 -19
  154. package/es/picker/utils.d.ts +10 -0
  155. package/es/picker/utils.js +73 -0
  156. package/es/popover/Popover.d.ts +1 -1
  157. package/es/popover/index.css +1 -1
  158. package/es/popover/index.d.ts +1 -1
  159. package/es/popover/index.less +21 -23
  160. package/es/popup/Popup.d.ts +3 -3
  161. package/es/popup/Popup.js +3 -3
  162. package/es/popup/index.css +1 -1
  163. package/es/popup/index.d.ts +3 -3
  164. package/es/popup/index.less +20 -22
  165. package/es/progress/index.css +1 -1
  166. package/es/progress/index.less +14 -18
  167. package/es/pull-refresh/index.css +1 -1
  168. package/es/pull-refresh/index.less +5 -7
  169. package/es/radio/index.css +1 -1
  170. package/es/radio/index.less +12 -14
  171. package/es/rate/index.css +1 -1
  172. package/es/rate/index.less +6 -8
  173. package/es/search/Search.d.ts +4 -4
  174. package/es/search/Search.js +7 -7
  175. package/es/search/index.css +1 -1
  176. package/es/search/index.d.ts +4 -4
  177. package/es/search/index.less +16 -18
  178. package/es/share-sheet/index.css +1 -1
  179. package/es/share-sheet/index.less +17 -18
  180. package/es/sidebar/index.css +1 -1
  181. package/es/sidebar/index.less +2 -4
  182. package/es/sidebar-item/index.css +1 -1
  183. package/es/sidebar-item/index.less +17 -19
  184. package/es/skeleton/index.css +1 -1
  185. package/es/skeleton/index.less +14 -16
  186. package/es/slider/Slider.d.ts +4 -4
  187. package/es/slider/Slider.js +4 -5
  188. package/es/slider/index.css +1 -1
  189. package/es/slider/index.d.ts +4 -4
  190. package/es/slider/index.less +20 -18
  191. package/es/step/index.css +1 -1
  192. package/es/step/index.less +15 -17
  193. package/es/stepper/Stepper.d.ts +1 -1
  194. package/es/stepper/index.css +1 -1
  195. package/es/stepper/index.d.ts +1 -1
  196. package/es/stepper/index.less +20 -24
  197. package/es/steps/Steps.d.ts +2 -2
  198. package/es/steps/Steps.js +2 -2
  199. package/es/steps/index.css +1 -1
  200. package/es/steps/index.d.ts +2 -2
  201. package/es/steps/index.less +3 -5
  202. package/es/sticky/index.css +1 -1
  203. package/es/sticky/index.less +2 -4
  204. package/es/style/animation.css +1 -1
  205. package/es/style/animation.less +18 -22
  206. package/es/style/base.css +1 -1
  207. package/es/style/base.less +6 -7
  208. package/es/style/css-variables.css +1 -1
  209. package/es/style/css-variables.less +76 -61
  210. package/es/style/mixins/hairline.less +0 -2
  211. package/es/style/normalize.css +1 -1
  212. package/es/style/normalize.less +1 -3
  213. package/es/submit-bar/index.css +1 -1
  214. package/es/submit-bar/index.less +26 -28
  215. package/es/swipe/index.css +1 -1
  216. package/es/swipe/index.less +11 -13
  217. package/es/switch/index.css +1 -1
  218. package/es/switch/index.less +24 -24
  219. package/es/tabbar/index.css +1 -1
  220. package/es/tabbar/index.less +5 -7
  221. package/es/tabbar-item/index.css +1 -1
  222. package/es/tabbar-item/index.less +9 -11
  223. package/es/tabs/Tabs.d.ts +2 -4
  224. package/es/tabs/Tabs.js +14 -27
  225. package/es/tabs/index.css +1 -1
  226. package/es/tabs/index.d.ts +2 -4
  227. package/es/tabs/index.less +17 -20
  228. package/es/tag/index.css +1 -1
  229. package/es/tag/index.less +22 -25
  230. package/es/time-picker/TimePicker.d.ts +214 -0
  231. package/es/time-picker/TimePicker.js +71 -0
  232. package/{lib/datetime-picker/TimePicker.d.ts → es/time-picker/index.d.ts} +60 -20
  233. package/es/time-picker/index.js +8 -0
  234. package/{lib/datetime-picker → es/time-picker}/style/index.d.ts +0 -0
  235. package/es/time-picker/style/index.js +3 -0
  236. package/{lib/datetime-picker → es/time-picker}/style/less.d.ts +0 -0
  237. package/es/time-picker/style/less.js +3 -0
  238. package/es/toast/index.css +1 -1
  239. package/es/toast/index.less +19 -21
  240. package/es/tree-select/TreeSelect.d.ts +3 -3
  241. package/es/tree-select/TreeSelect.js +3 -3
  242. package/es/tree-select/index.css +1 -1
  243. package/es/tree-select/index.d.ts +3 -3
  244. package/es/tree-select/index.less +12 -14
  245. package/es/uploader/Uploader.d.ts +4 -4
  246. package/es/uploader/Uploader.js +4 -4
  247. package/es/uploader/index.css +1 -1
  248. package/es/uploader/index.d.ts +4 -4
  249. package/es/uploader/index.less +31 -33
  250. package/es/utils/basic.d.ts +1 -0
  251. package/es/utils/basic.js +2 -0
  252. package/lib/action-bar/index.css +1 -1
  253. package/lib/action-bar/index.less +4 -6
  254. package/lib/action-bar-button/index.css +1 -1
  255. package/lib/action-bar-button/index.less +9 -11
  256. package/lib/action-bar-icon/index.css +1 -1
  257. package/lib/action-bar-icon/index.less +10 -12
  258. package/lib/action-sheet/index.css +1 -1
  259. package/lib/action-sheet/index.less +23 -24
  260. package/lib/address-edit/AddressEdit.d.ts +6 -6
  261. package/lib/address-edit/AddressEdit.js +29 -33
  262. package/lib/address-edit/AddressEditDetail.d.ts +2 -2
  263. package/lib/address-edit/AddressEditDetail.js +5 -14
  264. package/lib/address-edit/index.css +1 -1
  265. package/lib/address-edit/index.d.ts +6 -6
  266. package/lib/address-edit/index.less +8 -15
  267. package/lib/address-edit/types.d.ts +2 -4
  268. package/lib/address-list/AddressList.d.ts +4 -4
  269. package/lib/address-list/AddressList.js +5 -5
  270. package/lib/address-list/AddressListItem.js +3 -3
  271. package/lib/address-list/index.css +1 -1
  272. package/lib/address-list/index.d.ts +4 -4
  273. package/lib/address-list/index.less +20 -22
  274. package/lib/area/Area.d.ts +13 -25
  275. package/lib/area/Area.js +42 -207
  276. package/lib/area/index.d.ts +11 -19
  277. package/lib/area/types.d.ts +2 -17
  278. package/lib/area/utils.d.ts +6 -0
  279. package/lib/area/utils.js +109 -0
  280. package/lib/badge/index.css +1 -1
  281. package/lib/badge/index.less +15 -17
  282. package/lib/button/index.css +1 -1
  283. package/lib/button/index.less +55 -52
  284. package/lib/calendar/Calendar.d.ts +6 -6
  285. package/lib/calendar/Calendar.js +5 -5
  286. package/lib/calendar/CalendarHeader.d.ts +2 -2
  287. package/lib/calendar/CalendarHeader.js +2 -2
  288. package/lib/calendar/CalendarMonth.d.ts +1 -2
  289. package/lib/calendar/CalendarMonth.js +2 -2
  290. package/lib/calendar/index.css +1 -1
  291. package/lib/calendar/index.d.ts +6 -6
  292. package/lib/calendar/index.less +40 -37
  293. package/lib/card/Card.d.ts +2 -2
  294. package/lib/card/Card.js +3 -3
  295. package/lib/card/index.css +1 -1
  296. package/lib/card/index.d.ts +2 -2
  297. package/lib/card/index.less +23 -25
  298. package/lib/cascader/Cascader.d.ts +2 -2
  299. package/lib/cascader/Cascader.js +3 -3
  300. package/lib/cascader/index.css +1 -1
  301. package/lib/cascader/index.d.ts +2 -2
  302. package/lib/cascader/index.less +17 -19
  303. package/lib/cell/Cell.js +1 -4
  304. package/lib/cell/index.css +1 -1
  305. package/lib/cell/index.less +21 -27
  306. package/lib/cell-group/index.css +1 -1
  307. package/lib/cell-group/index.less +12 -13
  308. package/lib/checkbox/index.css +1 -1
  309. package/lib/checkbox/index.less +12 -14
  310. package/lib/circle/index.css +1 -1
  311. package/lib/circle/index.less +8 -10
  312. package/lib/collapse-item/index.css +1 -1
  313. package/lib/collapse-item/index.less +12 -12
  314. package/lib/config-provider/ConfigProvider.d.ts +14 -0
  315. package/lib/config-provider/ConfigProvider.js +7 -0
  316. package/lib/config-provider/index.d.ts +10 -1
  317. package/lib/contact-card/ContactCard.js +2 -2
  318. package/lib/contact-card/index.css +1 -1
  319. package/lib/contact-card/index.less +7 -9
  320. package/lib/contact-edit/ContactEdit.d.ts +2 -2
  321. package/lib/contact-edit/ContactEdit.js +3 -4
  322. package/lib/contact-edit/index.css +1 -1
  323. package/lib/contact-edit/index.d.ts +2 -2
  324. package/lib/contact-edit/index.less +7 -9
  325. package/lib/contact-list/ContactList.js +4 -4
  326. package/lib/contact-list/index.css +1 -1
  327. package/lib/contact-list/index.less +9 -11
  328. package/lib/count-down/index.css +1 -1
  329. package/lib/count-down/index.less +4 -6
  330. package/lib/coupon/index.css +1 -1
  331. package/lib/coupon/index.less +28 -31
  332. package/lib/coupon-cell/index.css +1 -1
  333. package/lib/coupon-cell/index.less +2 -4
  334. package/lib/coupon-list/CouponList.js +2 -2
  335. package/lib/coupon-list/index.css +1 -1
  336. package/lib/coupon-list/index.less +15 -17
  337. package/lib/date-picker/DatePicker.d.ts +168 -0
  338. package/lib/date-picker/DatePicker.js +135 -0
  339. package/lib/{datetime-picker/DatePicker.d.ts → date-picker/index.d.ts} +40 -28
  340. package/lib/{datetime-picker → date-picker}/index.js +4 -4
  341. package/lib/date-picker/style/index.d.ts +1 -0
  342. package/lib/{datetime-picker → date-picker}/style/index.js +0 -0
  343. package/lib/date-picker/style/less.d.ts +1 -0
  344. package/lib/{datetime-picker → date-picker}/style/less.js +0 -0
  345. package/lib/{datetime-picker → date-picker}/utils.d.ts +15 -11
  346. package/lib/{datetime-picker → date-picker}/utils.js +11 -34
  347. package/lib/dialog/index.css +1 -1
  348. package/lib/dialog/index.less +22 -24
  349. package/lib/divider/index.css +1 -1
  350. package/lib/divider/index.less +10 -12
  351. package/lib/dropdown-item/index.css +1 -1
  352. package/lib/dropdown-item/index.less +2 -5
  353. package/lib/dropdown-menu/index.css +1 -1
  354. package/lib/dropdown-menu/index.less +14 -17
  355. package/lib/empty/index.css +1 -1
  356. package/lib/empty/index.less +9 -11
  357. package/lib/field/Field.d.ts +4 -4
  358. package/lib/field/Field.js +4 -4
  359. package/lib/field/index.css +1 -1
  360. package/lib/field/index.d.ts +4 -4
  361. package/lib/field/index.less +20 -23
  362. package/lib/grid-item/index.css +1 -1
  363. package/lib/grid-item/index.less +10 -13
  364. package/lib/image/index.css +1 -1
  365. package/lib/image/index.less +10 -12
  366. package/lib/image-preview/index.css +1 -1
  367. package/lib/image-preview/index.less +11 -13
  368. package/lib/index-anchor/index.css +1 -1
  369. package/lib/index-anchor/index.less +12 -14
  370. package/lib/index-bar/index.css +1 -1
  371. package/lib/index-bar/index.less +7 -8
  372. package/lib/index.css +1 -1
  373. package/lib/index.d.ts +3 -2
  374. package/lib/index.js +7 -4
  375. package/lib/list/index.css +1 -1
  376. package/lib/list/index.less +5 -7
  377. package/lib/loading/index.css +1 -1
  378. package/lib/loading/index.less +7 -10
  379. package/lib/nav-bar/NavBar.d.ts +3 -3
  380. package/lib/nav-bar/NavBar.js +3 -3
  381. package/lib/nav-bar/index.css +1 -1
  382. package/lib/nav-bar/index.d.ts +3 -3
  383. package/lib/nav-bar/index.less +11 -13
  384. package/lib/notice-bar/index.css +1 -1
  385. package/lib/notice-bar/index.less +11 -13
  386. package/lib/notify/index.css +1 -1
  387. package/lib/notify/index.less +13 -15
  388. package/lib/number-keyboard/NumberKeyboard.d.ts +1 -1
  389. package/lib/number-keyboard/index.css +1 -1
  390. package/lib/number-keyboard/index.d.ts +1 -1
  391. package/lib/number-keyboard/index.less +26 -22
  392. package/lib/overlay/index.css +1 -1
  393. package/lib/overlay/index.less +4 -6
  394. package/lib/pagination/index.css +1 -1
  395. package/lib/pagination/index.less +13 -15
  396. package/lib/password-input/index.css +1 -1
  397. package/lib/password-input/index.less +20 -22
  398. package/lib/picker/Picker.d.ts +26 -28
  399. package/lib/picker/Picker.js +90 -195
  400. package/lib/picker/PickerColumn.d.ts +21 -30
  401. package/lib/picker/PickerColumn.js +60 -110
  402. package/lib/picker/index.css +1 -1
  403. package/lib/picker/index.d.ts +19 -20
  404. package/lib/picker/index.less +31 -19
  405. package/lib/picker/types.d.ts +13 -19
  406. package/lib/picker/utils.d.ts +10 -0
  407. package/lib/picker/utils.js +97 -0
  408. package/lib/popover/Popover.d.ts +1 -1
  409. package/lib/popover/index.css +1 -1
  410. package/lib/popover/index.d.ts +1 -1
  411. package/lib/popover/index.less +21 -23
  412. package/lib/popup/Popup.d.ts +3 -3
  413. package/lib/popup/Popup.js +3 -3
  414. package/lib/popup/index.css +1 -1
  415. package/lib/popup/index.d.ts +3 -3
  416. package/lib/popup/index.less +20 -22
  417. package/lib/progress/index.css +1 -1
  418. package/lib/progress/index.less +14 -18
  419. package/lib/pull-refresh/index.css +1 -1
  420. package/lib/pull-refresh/index.less +5 -7
  421. package/lib/radio/index.css +1 -1
  422. package/lib/radio/index.less +12 -14
  423. package/lib/rate/index.css +1 -1
  424. package/lib/rate/index.less +6 -8
  425. package/lib/search/Search.d.ts +4 -4
  426. package/lib/search/Search.js +7 -7
  427. package/lib/search/index.css +1 -1
  428. package/lib/search/index.d.ts +4 -4
  429. package/lib/search/index.less +16 -18
  430. package/lib/share-sheet/index.css +1 -1
  431. package/lib/share-sheet/index.less +17 -18
  432. package/lib/sidebar/index.css +1 -1
  433. package/lib/sidebar/index.less +2 -4
  434. package/lib/sidebar-item/index.css +1 -1
  435. package/lib/sidebar-item/index.less +17 -19
  436. package/lib/skeleton/index.css +1 -1
  437. package/lib/skeleton/index.less +14 -16
  438. package/lib/slider/Slider.d.ts +4 -4
  439. package/lib/slider/Slider.js +5 -6
  440. package/lib/slider/index.css +1 -1
  441. package/lib/slider/index.d.ts +4 -4
  442. package/lib/slider/index.less +20 -18
  443. package/lib/step/index.css +1 -1
  444. package/lib/step/index.less +15 -17
  445. package/lib/stepper/Stepper.d.ts +1 -1
  446. package/lib/stepper/index.css +1 -1
  447. package/lib/stepper/index.d.ts +1 -1
  448. package/lib/stepper/index.less +20 -24
  449. package/lib/steps/Steps.d.ts +2 -2
  450. package/lib/steps/Steps.js +2 -2
  451. package/lib/steps/index.css +1 -1
  452. package/lib/steps/index.d.ts +2 -2
  453. package/lib/steps/index.less +3 -5
  454. package/lib/sticky/index.css +1 -1
  455. package/lib/sticky/index.less +2 -4
  456. package/lib/style/animation.css +1 -1
  457. package/lib/style/animation.less +18 -22
  458. package/lib/style/base.css +1 -1
  459. package/lib/style/base.less +6 -7
  460. package/lib/style/css-variables.css +1 -1
  461. package/lib/style/css-variables.less +76 -61
  462. package/lib/style/mixins/hairline.less +0 -2
  463. package/lib/style/normalize.css +1 -1
  464. package/lib/style/normalize.less +1 -3
  465. package/lib/submit-bar/index.css +1 -1
  466. package/lib/submit-bar/index.less +26 -28
  467. package/lib/swipe/index.css +1 -1
  468. package/lib/swipe/index.less +11 -13
  469. package/lib/switch/index.css +1 -1
  470. package/lib/switch/index.less +24 -24
  471. package/lib/tabbar/index.css +1 -1
  472. package/lib/tabbar/index.less +5 -7
  473. package/lib/tabbar-item/index.css +1 -1
  474. package/lib/tabbar-item/index.less +9 -11
  475. package/lib/tabs/Tabs.d.ts +2 -4
  476. package/lib/tabs/Tabs.js +13 -26
  477. package/lib/tabs/index.css +1 -1
  478. package/lib/tabs/index.d.ts +2 -4
  479. package/lib/tabs/index.less +17 -20
  480. package/lib/tag/index.css +1 -1
  481. package/lib/tag/index.less +22 -25
  482. package/lib/time-picker/TimePicker.d.ts +214 -0
  483. package/lib/time-picker/TimePicker.js +95 -0
  484. package/{es/datetime-picker/TimePicker.d.ts → lib/time-picker/index.d.ts} +60 -20
  485. package/lib/{datetime-picker/types.js → time-picker/index.js} +17 -0
  486. package/lib/time-picker/style/index.d.ts +1 -0
  487. package/lib/time-picker/style/index.js +3 -0
  488. package/lib/time-picker/style/less.d.ts +1 -0
  489. package/lib/time-picker/style/less.js +3 -0
  490. package/lib/toast/index.css +1 -1
  491. package/lib/toast/index.less +19 -21
  492. package/lib/tree-select/TreeSelect.d.ts +3 -3
  493. package/lib/tree-select/TreeSelect.js +3 -3
  494. package/lib/tree-select/index.css +1 -1
  495. package/lib/tree-select/index.d.ts +3 -3
  496. package/lib/tree-select/index.less +12 -14
  497. package/lib/uploader/Uploader.d.ts +4 -4
  498. package/lib/uploader/Uploader.js +4 -4
  499. package/lib/uploader/index.css +1 -1
  500. package/lib/uploader/index.d.ts +4 -4
  501. package/lib/uploader/index.less +31 -33
  502. package/lib/utils/basic.d.ts +1 -0
  503. package/lib/utils/basic.js +2 -0
  504. package/lib/vant.cjs.js +1194 -1629
  505. package/lib/vant.cjs.min.js +1 -1
  506. package/lib/vant.es.js +1194 -1630
  507. package/lib/vant.es.min.js +1194 -1630
  508. package/lib/vant.js +1193 -1628
  509. package/lib/vant.min.js +1 -1
  510. package/package.json +4 -1
  511. package/vetur/attributes.json +242 -186
  512. package/vetur/tags.json +82 -72
  513. package/vetur/web-types.json +826 -651
  514. package/es/action-bar/var.css +0 -0
  515. package/es/action-bar/var.less +0 -4
  516. package/es/action-bar-button/var.css +0 -0
  517. package/es/action-bar-button/var.less +0 -5
  518. package/es/action-bar-icon/var.css +0 -0
  519. package/es/action-bar-icon/var.less +0 -10
  520. package/es/action-sheet/var.css +0 -0
  521. package/es/action-sheet/var.less +0 -23
  522. package/es/address-edit/var.css +0 -0
  523. package/es/address-edit/var.less +0 -6
  524. package/es/address-list/var.css +0 -0
  525. package/es/address-list/var.less +0 -16
  526. package/es/badge/var.css +0 -0
  527. package/es/badge/var.less +0 -12
  528. package/es/button/var.css +0 -0
  529. package/es/button/var.less +0 -36
  530. package/es/calendar/var.css +0 -0
  531. package/es/calendar/var.less +0 -27
  532. package/es/card/var.css +0 -0
  533. package/es/card/var.less +0 -18
  534. package/es/cascader/var.css +0 -0
  535. package/es/cascader/var.less +0 -15
  536. package/es/cell/var.css +0 -0
  537. package/es/cell/var.less +0 -21
  538. package/es/cell-group/var.css +0 -0
  539. package/es/cell-group/var.less +0 -12
  540. package/es/checkbox/var.css +0 -0
  541. package/es/checkbox/var.less +0 -11
  542. package/es/circle/var.css +0 -0
  543. package/es/circle/var.less +0 -9
  544. package/es/collapse-item/var.css +0 -0
  545. package/es/collapse-item/var.less +0 -9
  546. package/es/contact-card/var.css +0 -0
  547. package/es/contact-card/var.less +0 -6
  548. package/es/contact-edit/var.css +0 -0
  549. package/es/contact-edit/var.less +0 -8
  550. package/es/contact-list/var.css +0 -0
  551. package/es/contact-list/var.less +0 -6
  552. package/es/count-down/var.css +0 -0
  553. package/es/count-down/var.less +0 -5
  554. package/es/coupon/var.css +0 -0
  555. package/es/coupon/var.less +0 -19
  556. package/es/coupon-cell/var.css +0 -0
  557. package/es/coupon-cell/var.less +0 -3
  558. package/es/coupon-list/var.css +0 -0
  559. package/es/coupon-list/var.less +0 -10
  560. package/es/datetime-picker/DatePicker.js +0 -250
  561. package/es/datetime-picker/DatetimePicker.d.ts +0 -7
  562. package/es/datetime-picker/DatetimePicker.js +0 -40
  563. package/es/datetime-picker/TimePicker.js +0 -117
  564. package/es/datetime-picker/index.d.ts +0 -12
  565. package/es/datetime-picker/index.js +0 -8
  566. package/es/datetime-picker/types.d.ts +0 -9
  567. package/es/datetime-picker/types.js +0 -0
  568. package/es/datetime-picker/utils.js +0 -63
  569. package/es/dialog/var.css +0 -0
  570. package/es/dialog/var.less +0 -21
  571. package/es/divider/var.css +0 -0
  572. package/es/divider/var.less +0 -10
  573. package/es/dropdown-item/var.css +0 -0
  574. package/es/dropdown-item/var.less +0 -3
  575. package/es/dropdown-menu/var.css +0 -0
  576. package/es/dropdown-menu/var.less +0 -13
  577. package/es/empty/var.css +0 -0
  578. package/es/empty/var.less +0 -10
  579. package/es/field/var.css +0 -0
  580. package/es/field/var.less +0 -21
  581. package/es/grid-item/var.css +0 -0
  582. package/es/grid-item/var.less +0 -8
  583. package/es/image/var.css +0 -0
  584. package/es/image/var.less +0 -9
  585. package/es/image-preview/var.css +0 -0
  586. package/es/image-preview/var.less +0 -11
  587. package/es/index-anchor/var.css +0 -0
  588. package/es/index-anchor/var.less +0 -11
  589. package/es/index-bar/var.css +0 -0
  590. package/es/index-bar/var.less +0 -6
  591. package/es/list/var.css +0 -0
  592. package/es/list/var.less +0 -6
  593. package/es/loading/var.css +0 -0
  594. package/es/loading/var.less +0 -7
  595. package/es/nav-bar/var.css +0 -0
  596. package/es/nav-bar/var.less +0 -10
  597. package/es/notice-bar/var.css +0 -0
  598. package/es/notice-bar/var.less +0 -11
  599. package/es/notify/var.css +0 -0
  600. package/es/notify/var.less +0 -10
  601. package/es/number-keyboard/var.css +0 -0
  602. package/es/number-keyboard/var.less +0 -17
  603. package/es/overlay/var.css +0 -0
  604. package/es/overlay/var.less +0 -4
  605. package/es/pagination/var.css +0 -0
  606. package/es/pagination/var.less +0 -11
  607. package/es/password-input/var.css +0 -0
  608. package/es/password-input/var.less +0 -17
  609. package/es/picker/var.css +0 -0
  610. package/es/picker/var.less +0 -22
  611. package/es/popover/var.css +0 -0
  612. package/es/popover/var.less +0 -15
  613. package/es/popup/var.css +0 -0
  614. package/es/popup/var.less +0 -9
  615. package/es/progress/var.css +0 -0
  616. package/es/progress/var.less +0 -11
  617. package/es/pull-refresh/var.css +0 -0
  618. package/es/pull-refresh/var.less +0 -6
  619. package/es/radio/var.css +0 -0
  620. package/es/radio/var.less +0 -11
  621. package/es/rate/var.css +0 -0
  622. package/es/rate/var.less +0 -7
  623. package/es/search/var.css +0 -0
  624. package/es/search/var.less +0 -13
  625. package/es/share-sheet/var.css +0 -0
  626. package/es/share-sheet/var.less +0 -18
  627. package/es/sidebar/var.css +0 -0
  628. package/es/sidebar/var.less +0 -3
  629. package/es/sidebar-item/var.css +0 -0
  630. package/es/sidebar-item/var.less +0 -15
  631. package/es/skeleton/var.css +0 -0
  632. package/es/skeleton/var.less +0 -9
  633. package/es/slider/var.css +0 -0
  634. package/es/slider/var.less +0 -11
  635. package/es/step/var.css +0 -0
  636. package/es/step/var.less +0 -13
  637. package/es/stepper/var.css +0 -0
  638. package/es/stepper/var.less +0 -15
  639. package/es/steps/var.css +0 -0
  640. package/es/steps/var.less +0 -3
  641. package/es/sticky/var.css +0 -0
  642. package/es/sticky/var.less +0 -3
  643. package/es/style/var.css +0 -0
  644. package/es/style/var.less +0 -74
  645. package/es/submit-bar/var.css +0 -0
  646. package/es/submit-bar/var.less +0 -22
  647. package/es/swipe/var.css +0 -0
  648. package/es/swipe/var.less +0 -8
  649. package/es/switch/var.css +0 -0
  650. package/es/switch/var.less +0 -14
  651. package/es/tabbar/var.css +0 -0
  652. package/es/tabbar/var.less +0 -5
  653. package/es/tabbar-item/var.css +0 -0
  654. package/es/tabbar-item/var.less +0 -9
  655. package/es/tabs/var.css +0 -0
  656. package/es/tabs/var.less +0 -14
  657. package/es/tag/var.css +0 -0
  658. package/es/tag/var.less +0 -18
  659. package/es/toast/var.css +0 -0
  660. package/es/toast/var.less +0 -17
  661. package/es/tree-select/var.css +0 -0
  662. package/es/tree-select/var.less +0 -10
  663. package/es/uploader/var.css +0 -0
  664. package/es/uploader/var.less +0 -27
  665. package/lib/action-bar/var.css +0 -0
  666. package/lib/action-bar/var.less +0 -4
  667. package/lib/action-bar-button/var.css +0 -0
  668. package/lib/action-bar-button/var.less +0 -5
  669. package/lib/action-bar-icon/var.css +0 -0
  670. package/lib/action-bar-icon/var.less +0 -10
  671. package/lib/action-sheet/var.css +0 -0
  672. package/lib/action-sheet/var.less +0 -23
  673. package/lib/address-edit/var.css +0 -0
  674. package/lib/address-edit/var.less +0 -6
  675. package/lib/address-list/var.css +0 -0
  676. package/lib/address-list/var.less +0 -16
  677. package/lib/badge/var.css +0 -0
  678. package/lib/badge/var.less +0 -12
  679. package/lib/button/var.css +0 -0
  680. package/lib/button/var.less +0 -36
  681. package/lib/calendar/var.css +0 -0
  682. package/lib/calendar/var.less +0 -27
  683. package/lib/card/var.css +0 -0
  684. package/lib/card/var.less +0 -18
  685. package/lib/cascader/var.css +0 -0
  686. package/lib/cascader/var.less +0 -15
  687. package/lib/cell/var.css +0 -0
  688. package/lib/cell/var.less +0 -21
  689. package/lib/cell-group/var.css +0 -0
  690. package/lib/cell-group/var.less +0 -12
  691. package/lib/checkbox/var.css +0 -0
  692. package/lib/checkbox/var.less +0 -11
  693. package/lib/circle/var.css +0 -0
  694. package/lib/circle/var.less +0 -9
  695. package/lib/collapse-item/var.css +0 -0
  696. package/lib/collapse-item/var.less +0 -9
  697. package/lib/contact-card/var.css +0 -0
  698. package/lib/contact-card/var.less +0 -6
  699. package/lib/contact-edit/var.css +0 -0
  700. package/lib/contact-edit/var.less +0 -8
  701. package/lib/contact-list/var.css +0 -0
  702. package/lib/contact-list/var.less +0 -6
  703. package/lib/count-down/var.css +0 -0
  704. package/lib/count-down/var.less +0 -5
  705. package/lib/coupon/var.css +0 -0
  706. package/lib/coupon/var.less +0 -19
  707. package/lib/coupon-cell/var.css +0 -0
  708. package/lib/coupon-cell/var.less +0 -3
  709. package/lib/coupon-list/var.css +0 -0
  710. package/lib/coupon-list/var.less +0 -10
  711. package/lib/datetime-picker/DatePicker.js +0 -274
  712. package/lib/datetime-picker/DatetimePicker.d.ts +0 -7
  713. package/lib/datetime-picker/DatetimePicker.js +0 -69
  714. package/lib/datetime-picker/TimePicker.js +0 -141
  715. package/lib/datetime-picker/index.d.ts +0 -12
  716. package/lib/datetime-picker/types.d.ts +0 -9
  717. package/lib/dialog/var.css +0 -0
  718. package/lib/dialog/var.less +0 -21
  719. package/lib/divider/var.css +0 -0
  720. package/lib/divider/var.less +0 -10
  721. package/lib/dropdown-item/var.css +0 -0
  722. package/lib/dropdown-item/var.less +0 -3
  723. package/lib/dropdown-menu/var.css +0 -0
  724. package/lib/dropdown-menu/var.less +0 -13
  725. package/lib/empty/var.css +0 -0
  726. package/lib/empty/var.less +0 -10
  727. package/lib/field/var.css +0 -0
  728. package/lib/field/var.less +0 -21
  729. package/lib/grid-item/var.css +0 -0
  730. package/lib/grid-item/var.less +0 -8
  731. package/lib/image/var.css +0 -0
  732. package/lib/image/var.less +0 -9
  733. package/lib/image-preview/var.css +0 -0
  734. package/lib/image-preview/var.less +0 -11
  735. package/lib/index-anchor/var.css +0 -0
  736. package/lib/index-anchor/var.less +0 -11
  737. package/lib/index-bar/var.css +0 -0
  738. package/lib/index-bar/var.less +0 -6
  739. package/lib/list/var.css +0 -0
  740. package/lib/list/var.less +0 -6
  741. package/lib/loading/var.css +0 -0
  742. package/lib/loading/var.less +0 -7
  743. package/lib/nav-bar/var.css +0 -0
  744. package/lib/nav-bar/var.less +0 -10
  745. package/lib/notice-bar/var.css +0 -0
  746. package/lib/notice-bar/var.less +0 -11
  747. package/lib/notify/var.css +0 -0
  748. package/lib/notify/var.less +0 -10
  749. package/lib/number-keyboard/var.css +0 -0
  750. package/lib/number-keyboard/var.less +0 -17
  751. package/lib/overlay/var.css +0 -0
  752. package/lib/overlay/var.less +0 -4
  753. package/lib/pagination/var.css +0 -0
  754. package/lib/pagination/var.less +0 -11
  755. package/lib/password-input/var.css +0 -0
  756. package/lib/password-input/var.less +0 -17
  757. package/lib/picker/var.css +0 -0
  758. package/lib/picker/var.less +0 -22
  759. package/lib/popover/var.css +0 -0
  760. package/lib/popover/var.less +0 -15
  761. package/lib/popup/var.css +0 -0
  762. package/lib/popup/var.less +0 -9
  763. package/lib/progress/var.css +0 -0
  764. package/lib/progress/var.less +0 -11
  765. package/lib/pull-refresh/var.css +0 -0
  766. package/lib/pull-refresh/var.less +0 -6
  767. package/lib/radio/var.css +0 -0
  768. package/lib/radio/var.less +0 -11
  769. package/lib/rate/var.css +0 -0
  770. package/lib/rate/var.less +0 -7
  771. package/lib/search/var.css +0 -0
  772. package/lib/search/var.less +0 -13
  773. package/lib/share-sheet/var.css +0 -0
  774. package/lib/share-sheet/var.less +0 -18
  775. package/lib/sidebar/var.css +0 -0
  776. package/lib/sidebar/var.less +0 -3
  777. package/lib/sidebar-item/var.css +0 -0
  778. package/lib/sidebar-item/var.less +0 -15
  779. package/lib/skeleton/var.css +0 -0
  780. package/lib/skeleton/var.less +0 -9
  781. package/lib/slider/var.css +0 -0
  782. package/lib/slider/var.less +0 -11
  783. package/lib/step/var.css +0 -0
  784. package/lib/step/var.less +0 -13
  785. package/lib/stepper/var.css +0 -0
  786. package/lib/stepper/var.less +0 -15
  787. package/lib/steps/var.css +0 -0
  788. package/lib/steps/var.less +0 -3
  789. package/lib/sticky/var.css +0 -0
  790. package/lib/sticky/var.less +0 -3
  791. package/lib/style/var.css +0 -0
  792. package/lib/style/var.less +0 -74
  793. package/lib/submit-bar/var.css +0 -0
  794. package/lib/submit-bar/var.less +0 -22
  795. package/lib/swipe/var.css +0 -0
  796. package/lib/swipe/var.less +0 -8
  797. package/lib/switch/var.css +0 -0
  798. package/lib/switch/var.less +0 -14
  799. package/lib/tabbar/var.css +0 -0
  800. package/lib/tabbar/var.less +0 -5
  801. package/lib/tabbar-item/var.css +0 -0
  802. package/lib/tabbar-item/var.less +0 -9
  803. package/lib/tabs/var.css +0 -0
  804. package/lib/tabs/var.less +0 -14
  805. package/lib/tag/var.css +0 -0
  806. package/lib/tag/var.less +0 -18
  807. package/lib/toast/var.css +0 -0
  808. package/lib/toast/var.less +0 -17
  809. package/lib/tree-select/var.css +0 -0
  810. package/lib/tree-select/var.less +0 -10
  811. package/lib/uploader/var.css +0 -0
  812. package/lib/uploader/var.less +0 -27
@@ -15,7 +15,7 @@ export declare const AddressList: import("../utils").WithInstall<import("vue").D
15
15
  };
16
16
  addButtonText: StringConstructor;
17
17
  defaultTagText: StringConstructor;
18
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "update:modelValue" | "add" | "edit" | "click-item" | "edit-disabled" | "select-disabled")[], "select" | "update:modelValue" | "add" | "edit" | "click-item" | "edit-disabled" | "select-disabled", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
18
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "update:modelValue" | "add" | "edit" | "clickItem" | "editDisabled" | "selectDisabled")[], "select" | "update:modelValue" | "add" | "edit" | "clickItem" | "editDisabled" | "selectDisabled", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
19
19
  list: {
20
20
  type: import("vue").PropType<import("./AddressListItem").AddressListAddress[]>;
21
21
  default: () => never[];
@@ -37,9 +37,9 @@ export declare const AddressList: import("../utils").WithInstall<import("vue").D
37
37
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
38
38
  onEdit?: ((...args: any[]) => any) | undefined;
39
39
  onAdd?: ((...args: any[]) => any) | undefined;
40
- "onClick-item"?: ((...args: any[]) => any) | undefined;
41
- "onEdit-disabled"?: ((...args: any[]) => any) | undefined;
42
- "onSelect-disabled"?: ((...args: any[]) => any) | undefined;
40
+ onClickItem?: ((...args: any[]) => any) | undefined;
41
+ onEditDisabled?: ((...args: any[]) => any) | undefined;
42
+ onSelectDisabled?: ((...args: any[]) => any) | undefined;
43
43
  }, {
44
44
  switchable: boolean;
45
45
  list: import("./AddressListItem").AddressListAddress[];
@@ -1,19 +1,17 @@
1
- @import './var.less';
2
-
3
- :root {
4
- --van-address-list-padding: @address-list-padding;
5
- --van-address-list-disabled-text-color: @address-list-disabled-text-color;
6
- --van-address-list-disabled-text-padding: @address-list-disabled-text-padding;
7
- --van-address-list-disabled-text-font-size: @address-list-disabled-text-font-size;
8
- --van-address-list-disabled-text-line-height: @address-list-disabled-text-line-height;
9
- --van-address-list-add-button-z-index: @address-list-add-button-z-index;
10
- --van-address-list-item-padding: @address-list-item-padding;
11
- --van-address-list-item-text-color: @address-list-item-text-color;
12
- --van-address-list-item-disabled-text-color: @address-list-item-disabled-text-color;
13
- --van-address-list-item-font-size: @address-list-item-font-size;
14
- --van-address-list-item-line-height: @address-list-item-line-height;
15
- --van-address-list-item-radio-icon-color: @address-list-item-radio-icon-color;
16
- --van-address-list-edit-icon-size: @address-list-edit-icon-size;
1
+ body {
2
+ --van-address-list-padding: var(--van-padding-sm) var(--van-padding-sm) 80px;
3
+ --van-address-list-disabled-text-color: var(--van-text-color-2);
4
+ --van-address-list-disabled-text-padding: calc(var(--van-padding-base) * 5) 0;
5
+ --van-address-list-disabled-text-font-size: var(--van-font-size-md);
6
+ --van-address-list-disabled-text-line-height: var(--van-line-height-md);
7
+ --van-address-list-add-button-z-index: 999;
8
+ --van-address-list-item-padding: var(--van-padding-sm);
9
+ --van-address-list-item-text-color: var(--van-text-color);
10
+ --van-address-list-item-disabled-text-color: var(--van-text-color-3);
11
+ --van-address-list-item-font-size: 13px;
12
+ --van-address-list-item-line-height: var(--van-line-height-sm);
13
+ --van-address-list-radio-color: var(--van-primary-color);
14
+ --van-address-list-edit-icon-size: 20px;
17
15
  }
18
16
 
19
17
  .van-address-list {
@@ -30,7 +28,7 @@
30
28
  width: 100%;
31
29
  padding-left: var(--van-padding-md);
32
30
  padding-right: var(--van-padding-md);
33
- background-color: var(--van-background-color-light);
31
+ background-color: var(--van-background-2);
34
32
  }
35
33
 
36
34
  &__add {
@@ -48,14 +46,14 @@
48
46
 
49
47
  .van-address-item {
50
48
  padding: var(--van-address-list-item-padding);
51
- background-color: var(--van-background-color-light);
52
- border-radius: var(--van-border-radius-lg);
49
+ background-color: var(--van-background-2);
50
+ border-radius: var(--van-radius-lg);
53
51
 
54
52
  &:not(:last-child) {
55
53
  margin-bottom: var(--van-padding-sm);
56
54
  }
57
55
 
58
- &__value {
56
+ &__title {
59
57
  padding-right: 44px;
60
58
  }
61
59
 
@@ -106,7 +104,7 @@
106
104
  }
107
105
 
108
106
  .van-radio__icon--checked .van-icon {
109
- background-color: var(--van-address-list-item-radio-icon-color);
110
- border-color: var(--van-address-list-item-radio-icon-color);
107
+ background-color: var(--van-address-list-radio-color);
108
+ border-color: var(--van-address-list-radio-color);
111
109
  }
112
110
  }
package/es/area/Area.d.ts CHANGED
@@ -5,7 +5,7 @@ declare const areaProps: {
5
5
  loading: BooleanConstructor;
6
6
  readonly: BooleanConstructor;
7
7
  allowHtml: BooleanConstructor;
8
- itemHeight: {
8
+ optionHeight: {
9
9
  type: (NumberConstructor | StringConstructor)[];
10
10
  default: number;
11
11
  };
@@ -17,14 +17,14 @@ declare const areaProps: {
17
17
  type: (NumberConstructor | StringConstructor)[];
18
18
  default: number;
19
19
  };
20
- visibleItemCount: {
20
+ visibleOptionNum: {
21
21
  type: (NumberConstructor | StringConstructor)[];
22
22
  default: number;
23
23
  };
24
24
  cancelButtonText: StringConstructor;
25
25
  confirmButtonText: StringConstructor;
26
26
  } & {
27
- value: StringConstructor;
27
+ modelValue: StringConstructor;
28
28
  columnsNum: {
29
29
  type: (NumberConstructor | StringConstructor)[];
30
30
  default: number;
@@ -37,10 +37,6 @@ declare const areaProps: {
37
37
  type: PropType<AreaList>;
38
38
  default: () => {};
39
39
  };
40
- isOverseaCode: {
41
- type: PropType<(code: string) => boolean>;
42
- default: (code: string) => boolean;
43
- };
44
40
  };
45
41
  export declare type AreaProps = ExtractPropTypes<typeof areaProps>;
46
42
  declare const _default: import("vue").DefineComponent<{
@@ -48,7 +44,7 @@ declare const _default: import("vue").DefineComponent<{
48
44
  loading: BooleanConstructor;
49
45
  readonly: BooleanConstructor;
50
46
  allowHtml: BooleanConstructor;
51
- itemHeight: {
47
+ optionHeight: {
52
48
  type: (NumberConstructor | StringConstructor)[];
53
49
  default: number;
54
50
  };
@@ -60,14 +56,14 @@ declare const _default: import("vue").DefineComponent<{
60
56
  type: (NumberConstructor | StringConstructor)[];
61
57
  default: number;
62
58
  };
63
- visibleItemCount: {
59
+ visibleOptionNum: {
64
60
  type: (NumberConstructor | StringConstructor)[];
65
61
  default: number;
66
62
  };
67
63
  cancelButtonText: StringConstructor;
68
64
  confirmButtonText: StringConstructor;
69
65
  } & {
70
- value: StringConstructor;
66
+ modelValue: StringConstructor;
71
67
  columnsNum: {
72
68
  type: (NumberConstructor | StringConstructor)[];
73
69
  default: number;
@@ -80,16 +76,12 @@ declare const _default: import("vue").DefineComponent<{
80
76
  type: PropType<AreaList>;
81
77
  default: () => {};
82
78
  };
83
- isOverseaCode: {
84
- type: PropType<(code: string) => boolean>;
85
- default: (code: string) => boolean;
86
- };
87
- }, () => 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<ExtractPropTypes<{
79
+ }, () => 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<ExtractPropTypes<{
88
80
  title: StringConstructor;
89
81
  loading: BooleanConstructor;
90
82
  readonly: BooleanConstructor;
91
83
  allowHtml: BooleanConstructor;
92
- itemHeight: {
84
+ optionHeight: {
93
85
  type: (NumberConstructor | StringConstructor)[];
94
86
  default: number;
95
87
  };
@@ -101,14 +93,14 @@ declare const _default: import("vue").DefineComponent<{
101
93
  type: (NumberConstructor | StringConstructor)[];
102
94
  default: number;
103
95
  };
104
- visibleItemCount: {
96
+ visibleOptionNum: {
105
97
  type: (NumberConstructor | StringConstructor)[];
106
98
  default: number;
107
99
  };
108
100
  cancelButtonText: StringConstructor;
109
101
  confirmButtonText: StringConstructor;
110
102
  } & {
111
- value: StringConstructor;
103
+ modelValue: StringConstructor;
112
104
  columnsNum: {
113
105
  type: (NumberConstructor | StringConstructor)[];
114
106
  default: number;
@@ -121,25 +113,21 @@ declare const _default: import("vue").DefineComponent<{
121
113
  type: PropType<AreaList>;
122
114
  default: () => {};
123
115
  };
124
- isOverseaCode: {
125
- type: PropType<(code: string) => boolean>;
126
- default: (code: string) => boolean;
127
- };
128
116
  }>> & {
129
117
  onChange?: ((...args: any[]) => any) | undefined;
118
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
130
119
  onCancel?: ((...args: any[]) => any) | undefined;
131
120
  onConfirm?: ((...args: any[]) => any) | undefined;
132
121
  }, {
133
122
  readonly: boolean;
134
123
  loading: boolean;
135
124
  allowHtml: boolean;
136
- itemHeight: string | number;
125
+ optionHeight: string | number;
137
126
  showToolbar: boolean;
138
127
  swipeDuration: string | number;
139
- visibleItemCount: string | number;
128
+ visibleOptionNum: string | number;
140
129
  columnsNum: string | number;
141
130
  columnsPlaceholder: string[];
142
131
  areaList: AreaList;
143
- isOverseaCode: (code: string) => boolean;
144
132
  }>;
145
133
  export default _default;
package/es/area/Area.js CHANGED
@@ -1,239 +1,74 @@
1
1
  import { createVNode as _createVNode, mergeProps as _mergeProps } from "vue";
2
- import { ref, watch, computed, reactive, nextTick, onMounted, defineComponent } from "vue";
3
- import { deepClone } from "../utils/deep-clone";
2
+ import { ref, watch, computed, defineComponent } from "vue";
4
3
  import { pick, extend, makeArrayProp, makeNumericProp, createNamespace } from "../utils";
5
4
  import { pickerSharedProps } from "../picker/Picker";
5
+ import { INHERIT_PROPS, INHERIT_SLOTS, formatDataForCascade } from "./utils";
6
6
  import { useExpose } from "../composables/use-expose";
7
7
  import { Picker } from "../picker";
8
8
  const [name, bem] = createNamespace("area");
9
- const EMPTY_CODE = "000000";
10
- const INHERIT_SLOTS = ["title", "cancel", "confirm", "toolbar", "columns-top", "columns-bottom"];
11
- const INHERIT_PROPS = ["title", "loading", "readonly", "itemHeight", "swipeDuration", "visibleItemCount", "cancelButtonText", "confirmButtonText"];
12
- const isOverseaCode = (code) => code[0] === "9";
13
9
  const areaProps = extend({}, pickerSharedProps, {
14
- value: String,
10
+ modelValue: String,
15
11
  columnsNum: makeNumericProp(3),
16
12
  columnsPlaceholder: makeArrayProp(),
17
13
  areaList: {
18
14
  type: Object,
19
15
  default: () => ({})
20
- },
21
- isOverseaCode: {
22
- type: Function,
23
- default: isOverseaCode
24
16
  }
25
17
  });
26
18
  var stdin_default = defineComponent({
27
19
  name,
28
20
  props: areaProps,
29
- emits: ["change", "confirm", "cancel"],
21
+ emits: ["change", "confirm", "cancel", "update:modelValue"],
30
22
  setup(props, {
31
23
  emit,
32
24
  slots
33
25
  }) {
34
- const pickerRef = ref();
35
- const state = reactive({
36
- code: props.value,
37
- columns: [{
38
- values: []
39
- }, {
40
- values: []
41
- }, {
42
- values: []
43
- }]
44
- });
45
- const areaList = computed(() => {
46
- const {
47
- areaList: areaList2
48
- } = props;
49
- return {
50
- province: areaList2.province_list || {},
51
- city: areaList2.city_list || {},
52
- county: areaList2.county_list || {}
53
- };
54
- });
55
- const placeholderMap = computed(() => {
56
- const {
57
- columnsPlaceholder
58
- } = props;
59
- return {
60
- province: columnsPlaceholder[0] || "",
61
- city: columnsPlaceholder[1] || "",
62
- county: columnsPlaceholder[2] || ""
63
- };
64
- });
65
- const getDefaultCode = () => {
66
- if (props.columnsPlaceholder.length) {
67
- return EMPTY_CODE;
68
- }
69
- const {
70
- county,
71
- city
72
- } = areaList.value;
73
- const countyCodes = Object.keys(county);
74
- if (countyCodes[0]) {
75
- return countyCodes[0];
76
- }
77
- const cityCodes = Object.keys(city);
78
- if (cityCodes[0]) {
79
- return cityCodes[0];
80
- }
81
- return "";
82
- };
83
- const getColumnValues = (type, code) => {
84
- let column = [];
85
- if (type !== "province" && !code) {
86
- return column;
87
- }
88
- const list = areaList.value[type];
89
- column = Object.keys(list).map((listCode) => ({
90
- code: listCode,
91
- name: list[listCode]
92
- }));
93
- if (code) {
94
- if (type === "city" && props.isOverseaCode(code)) {
95
- code = "9";
96
- }
97
- column = column.filter((item) => item.code.indexOf(code) === 0);
98
- }
99
- if (placeholderMap.value[type] && column.length) {
100
- let codeFill = "";
101
- if (type === "city") {
102
- codeFill = EMPTY_CODE.slice(2, 4);
103
- } else if (type === "county") {
104
- codeFill = EMPTY_CODE.slice(4, 6);
105
- }
106
- column.unshift({
107
- code: code + codeFill,
108
- name: placeholderMap.value[type]
109
- });
110
- }
111
- return column;
112
- };
113
- const getIndex = (type, code) => {
114
- let compareNum = code.length;
115
- if (type === "province") {
116
- compareNum = props.isOverseaCode(code) ? 1 : 2;
117
- }
118
- if (type === "city") {
119
- compareNum = 4;
120
- }
121
- code = code.slice(0, compareNum);
122
- const list = getColumnValues(type, compareNum > 2 ? code.slice(0, compareNum - 2) : "");
123
- for (let i = 0; i < list.length; i++) {
124
- if (list[i].code.slice(0, compareNum) === code) {
125
- return i;
126
- }
127
- }
128
- return 0;
129
- };
130
- const setValues = () => {
131
- const picker = pickerRef.value;
132
- if (!picker) {
133
- return;
134
- }
135
- let code = state.code || getDefaultCode();
136
- const province = getColumnValues("province");
137
- const city = getColumnValues("city", code.slice(0, 2));
138
- picker.setColumnValues(0, province);
139
- picker.setColumnValues(1, city);
140
- if (city.length && code.slice(2, 4) === "00" && !props.isOverseaCode(code)) {
141
- [{
142
- code
143
- }] = city;
144
- }
145
- picker.setColumnValues(2, getColumnValues("county", code.slice(0, 4)));
146
- picker.setIndexes([getIndex("province", code), getIndex("city", code), getIndex("county", code)]);
147
- };
148
- const parseValues = (values) => values.map((value, index) => {
149
- if (value) {
150
- value = deepClone(value);
151
- if (!value.code || value.name === props.columnsPlaceholder[index]) {
152
- value.code = "";
153
- value.name = "";
154
- }
26
+ const codes = ref([]);
27
+ const picker = ref();
28
+ const columns = computed(() => formatDataForCascade(props));
29
+ const onChange = (...args) => emit("change", ...args);
30
+ const onCancel = (...args) => emit("cancel", ...args);
31
+ const onConfirm = (...args) => emit("confirm", ...args);
32
+ watch(codes, (newCodes) => {
33
+ const lastCode = newCodes.length ? newCodes[newCodes.length - 1] : "";
34
+ if (lastCode && lastCode !== props.modelValue) {
35
+ emit("update:modelValue", lastCode);
155
36
  }
156
- return value;
37
+ }, {
38
+ deep: true
157
39
  });
158
- const getValues = () => {
159
- if (pickerRef.value) {
160
- const values = pickerRef.value.getValues().filter(Boolean);
161
- return parseValues(values);
162
- }
163
- return [];
164
- };
165
- const getArea = () => {
166
- const values = getValues();
167
- const area = {
168
- code: "",
169
- country: "",
170
- province: "",
171
- city: "",
172
- county: ""
173
- };
174
- if (!values.length) {
175
- return area;
176
- }
177
- const names = values.map((item) => item.name);
178
- const validValues = values.filter((value) => value.code);
179
- area.code = validValues.length ? validValues[validValues.length - 1].code : "";
180
- if (props.isOverseaCode(area.code)) {
181
- area.country = names[1] || "";
182
- area.province = names[2] || "";
40
+ watch(() => props.modelValue, (newCode) => {
41
+ if (newCode) {
42
+ const lastCode = codes.value.length ? codes.value[codes.value.length - 1] : "";
43
+ if (newCode !== lastCode) {
44
+ codes.value = [`${newCode.slice(0, 2)}0000`, `${newCode.slice(0, 4)}00`, newCode].slice(0, +props.columnsNum);
45
+ }
183
46
  } else {
184
- area.province = names[0] || "";
185
- area.city = names[1] || "";
186
- area.county = names[2] || "";
187
- }
188
- return area;
189
- };
190
- const reset = (newCode = "") => {
191
- state.code = newCode;
192
- setValues();
193
- };
194
- const onChange = (values, index) => {
195
- state.code = values[index].code;
196
- setValues();
197
- if (pickerRef.value) {
198
- const parsedValues = parseValues(pickerRef.value.getValues());
199
- emit("change", parsedValues, index);
47
+ codes.value = [];
200
48
  }
201
- };
202
- const onConfirm = (values, index) => {
203
- setValues();
204
- emit("confirm", parseValues(values), index);
205
- };
206
- const onCancel = (...args) => emit("cancel", ...args);
207
- onMounted(setValues);
208
- watch(() => props.value, (value) => {
209
- state.code = value;
210
- setValues();
211
- });
212
- watch(() => props.areaList, setValues, {
213
- deep: true
214
- });
215
- watch(() => props.columnsNum, () => {
216
- nextTick(setValues);
49
+ }, {
50
+ immediate: true
217
51
  });
218
52
  useExpose({
219
- reset,
220
- getArea,
221
- getValues
53
+ confirm: () => {
54
+ var _a;
55
+ return (_a = picker.value) == null ? void 0 : _a.confirm();
56
+ },
57
+ getSelectedOptions: () => {
58
+ var _a;
59
+ return ((_a = picker.value) == null ? void 0 : _a.getSelectedOptions()) || [];
60
+ }
222
61
  });
223
- return () => {
224
- const columns = state.columns.slice(0, +props.columnsNum);
225
- return _createVNode(Picker, _mergeProps({
226
- "ref": pickerRef,
227
- "class": bem(),
228
- "columns": columns,
229
- "columnsFieldNames": {
230
- text: "name"
231
- },
232
- "onChange": onChange,
233
- "onCancel": onCancel,
234
- "onConfirm": onConfirm
235
- }, pick(props, INHERIT_PROPS)), pick(slots, INHERIT_SLOTS));
236
- };
62
+ return () => _createVNode(Picker, _mergeProps({
63
+ "ref": picker,
64
+ "modelValue": codes.value,
65
+ "onUpdate:modelValue": ($event) => codes.value = $event,
66
+ "class": bem(),
67
+ "columns": columns.value,
68
+ "onChange": onChange,
69
+ "onCancel": onCancel,
70
+ "onConfirm": onConfirm
71
+ }, pick(props, INHERIT_PROPS)), pick(slots, INHERIT_SLOTS));
237
72
  }
238
73
  });
239
74
  export {
@@ -3,7 +3,7 @@ export declare const Area: import("../utils").WithInstall<import("vue").DefineCo
3
3
  loading: BooleanConstructor;
4
4
  readonly: BooleanConstructor;
5
5
  allowHtml: BooleanConstructor;
6
- itemHeight: {
6
+ optionHeight: {
7
7
  type: (NumberConstructor | StringConstructor)[];
8
8
  default: number;
9
9
  };
@@ -15,14 +15,14 @@ export declare const Area: import("../utils").WithInstall<import("vue").DefineCo
15
15
  type: (NumberConstructor | StringConstructor)[];
16
16
  default: number;
17
17
  };
18
- visibleItemCount: {
18
+ visibleOptionNum: {
19
19
  type: (NumberConstructor | StringConstructor)[];
20
20
  default: number;
21
21
  };
22
22
  cancelButtonText: StringConstructor;
23
23
  confirmButtonText: StringConstructor;
24
24
  } & {
25
- value: StringConstructor;
25
+ modelValue: StringConstructor;
26
26
  columnsNum: {
27
27
  type: (NumberConstructor | StringConstructor)[];
28
28
  default: number;
@@ -35,16 +35,12 @@ export declare const Area: import("../utils").WithInstall<import("vue").DefineCo
35
35
  type: import("vue").PropType<import("./types").AreaList>;
36
36
  default: () => {};
37
37
  };
38
- isOverseaCode: {
39
- type: import("vue").PropType<(code: string) => boolean>;
40
- default: (code: string) => boolean;
41
- };
42
- }, () => 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<{
38
+ }, () => 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<{
43
39
  title: StringConstructor;
44
40
  loading: BooleanConstructor;
45
41
  readonly: BooleanConstructor;
46
42
  allowHtml: BooleanConstructor;
47
- itemHeight: {
43
+ optionHeight: {
48
44
  type: (NumberConstructor | StringConstructor)[];
49
45
  default: number;
50
46
  };
@@ -56,14 +52,14 @@ export declare const Area: import("../utils").WithInstall<import("vue").DefineCo
56
52
  type: (NumberConstructor | StringConstructor)[];
57
53
  default: number;
58
54
  };
59
- visibleItemCount: {
55
+ visibleOptionNum: {
60
56
  type: (NumberConstructor | StringConstructor)[];
61
57
  default: number;
62
58
  };
63
59
  cancelButtonText: StringConstructor;
64
60
  confirmButtonText: StringConstructor;
65
61
  } & {
66
- value: StringConstructor;
62
+ modelValue: StringConstructor;
67
63
  columnsNum: {
68
64
  type: (NumberConstructor | StringConstructor)[];
69
65
  default: number;
@@ -76,30 +72,26 @@ export declare const Area: import("../utils").WithInstall<import("vue").DefineCo
76
72
  type: import("vue").PropType<import("./types").AreaList>;
77
73
  default: () => {};
78
74
  };
79
- isOverseaCode: {
80
- type: import("vue").PropType<(code: string) => boolean>;
81
- default: (code: string) => boolean;
82
- };
83
75
  }>> & {
84
76
  onChange?: ((...args: any[]) => any) | undefined;
77
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
85
78
  onCancel?: ((...args: any[]) => any) | undefined;
86
79
  onConfirm?: ((...args: any[]) => any) | undefined;
87
80
  }, {
88
81
  readonly: boolean;
89
82
  loading: boolean;
90
83
  allowHtml: boolean;
91
- itemHeight: string | number;
84
+ optionHeight: string | number;
92
85
  showToolbar: boolean;
93
86
  swipeDuration: string | number;
94
- visibleItemCount: string | number;
87
+ visibleOptionNum: string | number;
95
88
  columnsNum: string | number;
96
89
  columnsPlaceholder: string[];
97
90
  areaList: import("./types").AreaList;
98
- isOverseaCode: (code: string) => boolean;
99
91
  }>>;
100
92
  export default Area;
101
93
  export type { AreaProps } from './Area';
102
- export type { AreaList, AreaInstance, AreaColumnOption } from './types';
94
+ export type { AreaList, AreaInstance } from './types';
103
95
  declare module 'vue' {
104
96
  interface GlobalComponents {
105
97
  VanArea: typeof Area;
@@ -1,24 +1,9 @@
1
1
  import type { ComponentPublicInstance } from 'vue';
2
+ import { PickerExpose } from '../picker/types';
2
3
  import type { AreaProps } from './Area';
3
4
  export declare type AreaList = {
4
5
  city_list: Record<string, string>;
5
6
  county_list: Record<string, string>;
6
7
  province_list: Record<string, string>;
7
8
  };
8
- export declare type AreaColumnOption = {
9
- name: string;
10
- code: string;
11
- };
12
- export declare type AreaColumnType = 'province' | 'county' | 'city';
13
- export declare type AreaExpose = {
14
- reset: (newCode?: string) => void;
15
- getArea: () => {
16
- code: string;
17
- country: string;
18
- province: string;
19
- city: string;
20
- county: string;
21
- };
22
- getValues: () => AreaColumnOption[];
23
- };
24
- export declare type AreaInstance = ComponentPublicInstance<AreaProps, AreaExpose>;
9
+ export declare type AreaInstance = ComponentPublicInstance<AreaProps, PickerExpose>;
@@ -0,0 +1,6 @@
1
+ import type { AreaProps } from '.';
2
+ import type { PickerOption } from '../picker';
3
+ export declare const AREA_EMPTY_CODE = "000000";
4
+ export declare const INHERIT_SLOTS: readonly ["title", "cancel", "confirm", "toolbar", "columns-top", "columns-bottom"];
5
+ export declare const INHERIT_PROPS: readonly ["title", "loading", "readonly", "optionHeight", "swipeDuration", "visibleOptionNum", "cancelButtonText", "confirmButtonText"];
6
+ export declare function formatDataForCascade({ areaList, columnsNum, columnsPlaceholder: placeholder, }: AreaProps): PickerOption[];