@varlet/ui 2.20.1 → 2.20.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 (608) hide show
  1. package/es/action-sheet/ActionSheet.mjs +146 -0
  2. package/es/action-sheet/ActionSheetSfc.css +0 -0
  3. package/es/action-sheet/actionSheet.css +1 -0
  4. package/es/action-sheet/index.mjs +86 -0
  5. package/es/action-sheet/props.mjs +50 -0
  6. package/es/action-sheet/style/index.mjs +6 -0
  7. package/es/app-bar/AppBar.mjs +158 -0
  8. package/es/app-bar/AppBarSfc.css +0 -0
  9. package/es/app-bar/appBar.css +1 -0
  10. package/es/app-bar/index.mjs +12 -0
  11. package/es/app-bar/props.mjs +20 -0
  12. package/es/app-bar/style/index.mjs +4 -0
  13. package/es/avatar/Avatar.mjs +142 -0
  14. package/es/avatar/AvatarSfc.css +0 -0
  15. package/es/avatar/avatar.css +1 -0
  16. package/es/avatar/index.mjs +12 -0
  17. package/es/avatar/props.mjs +30 -0
  18. package/es/avatar/style/index.mjs +3 -0
  19. package/es/avatar-group/AvatarGroup.mjs +45 -0
  20. package/es/avatar-group/AvatarGroupSfc.css +0 -0
  21. package/es/avatar-group/avatarGroup.css +1 -0
  22. package/es/avatar-group/index.mjs +12 -0
  23. package/es/avatar-group/props.mjs +7 -0
  24. package/es/avatar-group/style/index.mjs +3 -0
  25. package/es/back-top/BackTop.mjs +108 -0
  26. package/es/back-top/BackTopSfc.css +0 -0
  27. package/es/back-top/backTop.css +1 -0
  28. package/es/back-top/index.mjs +12 -0
  29. package/es/back-top/props.mjs +22 -0
  30. package/es/back-top/style/index.mjs +5 -0
  31. package/es/badge/Badge.mjs +111 -0
  32. package/es/badge/BadgeSfc.css +0 -0
  33. package/es/badge/badge.css +1 -0
  34. package/es/badge/index.mjs +12 -0
  35. package/es/badge/props.mjs +33 -0
  36. package/es/badge/style/index.mjs +4 -0
  37. package/es/bottom-navigation/BottomNavigation.mjs +188 -0
  38. package/es/bottom-navigation/BottomNavigationSfc.css +0 -0
  39. package/es/bottom-navigation/bottomNavigation.css +1 -0
  40. package/es/bottom-navigation/index.mjs +12 -0
  41. package/es/bottom-navigation/props.mjs +24 -0
  42. package/es/bottom-navigation/provide.mjs +18 -0
  43. package/es/bottom-navigation/style/index.mjs +7 -0
  44. package/es/bottom-navigation-item/BottomNavigationItem.mjs +125 -0
  45. package/es/bottom-navigation-item/BottomNavigationItemSfc.css +0 -0
  46. package/es/bottom-navigation-item/bottomNavigationItem.css +1 -0
  47. package/es/bottom-navigation-item/index.mjs +12 -0
  48. package/es/bottom-navigation-item/props.mjs +16 -0
  49. package/es/bottom-navigation-item/provide.mjs +21 -0
  50. package/es/bottom-navigation-item/style/index.mjs +6 -0
  51. package/es/breadcrumb/Breadcrumb.mjs +73 -0
  52. package/es/breadcrumb/BreadcrumbSfc.css +0 -0
  53. package/es/breadcrumb/breadcrumb.css +1 -0
  54. package/es/breadcrumb/index.mjs +12 -0
  55. package/es/breadcrumb/props.mjs +8 -0
  56. package/es/breadcrumb/provide.mjs +19 -0
  57. package/es/breadcrumb/style/index.mjs +3 -0
  58. package/es/breadcrumbs/Breadcrumbs.mjs +38 -0
  59. package/es/breadcrumbs/BreadcrumbsSfc.css +0 -0
  60. package/es/breadcrumbs/breadcrumbs.css +1 -0
  61. package/es/breadcrumbs/index.mjs +12 -0
  62. package/es/breadcrumbs/props.mjs +9 -0
  63. package/es/breadcrumbs/provide.mjs +16 -0
  64. package/es/breadcrumbs/style/index.mjs +3 -0
  65. package/es/button/Button.mjs +147 -0
  66. package/es/button/ButtonSfc.css +0 -0
  67. package/es/button/button.css +1 -0
  68. package/es/button/index.mjs +12 -0
  69. package/es/button/props.mjs +57 -0
  70. package/es/button/provide.mjs +13 -0
  71. package/es/button/style/index.mjs +7 -0
  72. package/es/button-group/ButtonGroup.mjs +53 -0
  73. package/es/button-group/ButtonGroupSfc.css +0 -0
  74. package/es/button-group/buttonGroup.css +1 -0
  75. package/es/button-group/index.mjs +12 -0
  76. package/es/button-group/props.mjs +24 -0
  77. package/es/button-group/provide.mjs +14 -0
  78. package/es/button-group/style/index.mjs +4 -0
  79. package/es/card/Card.mjs +351 -0
  80. package/es/card/CardSfc.css +0 -0
  81. package/es/card/card.css +1 -0
  82. package/es/card/index.mjs +12 -0
  83. package/es/card/props.mjs +34 -0
  84. package/es/card/style/index.mjs +7 -0
  85. package/es/cell/Cell.mjs +122 -0
  86. package/es/cell/CellSfc.css +0 -0
  87. package/es/cell/cell.css +1 -0
  88. package/es/cell/index.mjs +12 -0
  89. package/es/cell/props.mjs +19 -0
  90. package/es/cell/style/index.mjs +4 -0
  91. package/es/checkbox/Checkbox.mjs +221 -0
  92. package/es/checkbox/CheckboxSfc.css +0 -0
  93. package/es/checkbox/checkbox.css +1 -0
  94. package/es/checkbox/index.mjs +12 -0
  95. package/es/checkbox/props.mjs +37 -0
  96. package/es/checkbox/provide.mjs +15 -0
  97. package/es/checkbox/style/index.mjs +7 -0
  98. package/es/checkbox-group/CheckboxGroup.mjs +133 -0
  99. package/es/checkbox-group/CheckboxGroupSfc.css +0 -0
  100. package/es/checkbox-group/checkboxGroup.css +1 -0
  101. package/es/checkbox-group/index.mjs +12 -0
  102. package/es/checkbox-group/props.mjs +22 -0
  103. package/es/checkbox-group/provide.mjs +16 -0
  104. package/es/checkbox-group/style/index.mjs +4 -0
  105. package/es/chip/Chip.mjs +103 -0
  106. package/es/chip/ChipSfc.css +0 -0
  107. package/es/chip/chip.css +1 -0
  108. package/es/chip/index.mjs +12 -0
  109. package/es/chip/props.mjs +29 -0
  110. package/es/chip/style/index.mjs +4 -0
  111. package/es/col/Col.mjs +96 -0
  112. package/es/col/ColSfc.css +0 -0
  113. package/es/col/col.css +1 -0
  114. package/es/col/index.mjs +12 -0
  115. package/es/col/props.mjs +26 -0
  116. package/es/col/provide.mjs +13 -0
  117. package/es/col/style/index.mjs +3 -0
  118. package/es/collapse/Collapse.mjs +116 -0
  119. package/es/collapse/CollapseSfc.css +1 -0
  120. package/es/collapse/index.mjs +12 -0
  121. package/es/collapse/props.mjs +22 -0
  122. package/es/collapse/provide.mjs +16 -0
  123. package/es/collapse/style/index.mjs +3 -0
  124. package/es/collapse-item/CollapseItem.mjs +231 -0
  125. package/es/collapse-item/CollapseItemSfc.css +0 -0
  126. package/es/collapse-item/collapseItem.css +1 -0
  127. package/es/collapse-item/index.mjs +12 -0
  128. package/es/collapse-item/props.mjs +12 -0
  129. package/es/collapse-item/provide.mjs +19 -0
  130. package/es/collapse-item/style/index.mjs +4 -0
  131. package/es/context/index.mjs +12 -0
  132. package/es/context/lock.mjs +74 -0
  133. package/es/context/style/index.mjs +0 -0
  134. package/es/context/zIndex.mjs +19 -0
  135. package/es/countdown/Countdown.mjs +168 -0
  136. package/es/countdown/CountdownSfc.css +0 -0
  137. package/es/countdown/countdown.css +1 -0
  138. package/es/countdown/index.mjs +12 -0
  139. package/es/countdown/props.mjs +20 -0
  140. package/es/countdown/style/index.mjs +3 -0
  141. package/es/counter/Counter.mjs +333 -0
  142. package/es/counter/CounterSfc.css +0 -0
  143. package/es/counter/counter.css +1 -0
  144. package/es/counter/index.mjs +12 -0
  145. package/es/counter/props.mjs +57 -0
  146. package/es/counter/provide.ts +3 -0
  147. package/es/counter/style/index.mjs +9 -0
  148. package/es/date-picker/DatePicker.mjs +685 -0
  149. package/es/date-picker/DatePickerSfc.css +0 -0
  150. package/es/date-picker/date-picker.css +1 -0
  151. package/es/date-picker/index.mjs +12 -0
  152. package/es/date-picker/props.mjs +49 -0
  153. package/es/date-picker/src/day-picker-panel.mjs +366 -0
  154. package/es/date-picker/src/month-picker-panel.mjs +282 -0
  155. package/es/date-picker/src/panel-header.mjs +135 -0
  156. package/es/date-picker/src/year-picker-panel.mjs +303 -0
  157. package/es/date-picker/style/index.mjs +8 -0
  158. package/es/dialog/Dialog.mjs +235 -0
  159. package/es/dialog/DialogSfc.css +0 -0
  160. package/es/dialog/dialog.css +1 -0
  161. package/es/dialog/index.mjs +97 -0
  162. package/es/dialog/props.mjs +65 -0
  163. package/es/dialog/style/index.mjs +5 -0
  164. package/es/divider/Divider.mjs +85 -0
  165. package/es/divider/DividerSfc.css +0 -0
  166. package/es/divider/divider.css +1 -0
  167. package/es/divider/index.mjs +12 -0
  168. package/es/divider/props.mjs +14 -0
  169. package/es/divider/style/index.mjs +3 -0
  170. package/es/drag/Drag.mjs +261 -0
  171. package/es/drag/DragSfc.css +0 -0
  172. package/es/drag/drag.css +1 -0
  173. package/es/drag/index.mjs +12 -0
  174. package/es/drag/props.mjs +30 -0
  175. package/es/drag/style/index.mjs +3 -0
  176. package/es/ellipsis/Ellipsis.mjs +110 -0
  177. package/es/ellipsis/EllipsisSfc.css +0 -0
  178. package/es/ellipsis/ellipsis.css +1 -0
  179. package/es/ellipsis/index.mjs +12 -0
  180. package/es/ellipsis/props.mjs +14 -0
  181. package/es/ellipsis/style/index.mjs +4 -0
  182. package/es/fab/Fab.mjs +149 -0
  183. package/es/fab/fab.css +1 -0
  184. package/es/fab/index.mjs +12 -0
  185. package/es/fab/props.mjs +73 -0
  186. package/es/fab/style/index.mjs +8 -0
  187. package/es/field-decorator/FieldDecorator.mjs +252 -0
  188. package/es/field-decorator/FieldDecoratorSfc.css +0 -0
  189. package/es/field-decorator/fieldDecorator.css +1 -0
  190. package/es/field-decorator/index.mjs +12 -0
  191. package/es/field-decorator/props.mjs +43 -0
  192. package/es/field-decorator/style/index.mjs +4 -0
  193. package/es/floating-panel/FloatingPanel.mjs +184 -0
  194. package/es/floating-panel/FloatingPanelSfc.css +0 -0
  195. package/es/floating-panel/floatingPanel.css +1 -0
  196. package/es/floating-panel/index.mjs +11 -0
  197. package/es/floating-panel/props.mjs +27 -0
  198. package/es/floating-panel/style/index.mjs +4 -0
  199. package/es/form/Form.mjs +116 -0
  200. package/es/form/FormSfc.css +0 -0
  201. package/es/form/index.mjs +15 -0
  202. package/es/form/props.mjs +15 -0
  203. package/es/form/provide.mjs +47 -0
  204. package/es/form/style/index.mjs +2 -0
  205. package/es/form-details/FormDetails.mjs +91 -0
  206. package/es/form-details/FormDetailsSfc.css +0 -0
  207. package/es/form-details/formDetails.css +1 -0
  208. package/es/form-details/index.mjs +12 -0
  209. package/es/form-details/props.mjs +13 -0
  210. package/es/form-details/style/index.mjs +3 -0
  211. package/es/hover/index.mjs +125 -0
  212. package/es/hover/style/index.mjs +0 -0
  213. package/es/hover-overlay/HoverOverlay.mjs +29 -0
  214. package/es/hover-overlay/HoverOverlaySfc.css +0 -0
  215. package/es/hover-overlay/hoverOverlay.css +1 -0
  216. package/es/hover-overlay/index.mjs +24 -0
  217. package/es/hover-overlay/props.mjs +9 -0
  218. package/es/hover-overlay/style/index.mjs +2 -0
  219. package/es/icon/Icon.mjs +89 -0
  220. package/es/icon/IconSfc.css +0 -0
  221. package/es/icon/icon.css +1 -0
  222. package/es/icon/index.mjs +12 -0
  223. package/es/icon/props.mjs +19 -0
  224. package/es/icon/style/index.mjs +3 -0
  225. package/es/image/Image.mjs +111 -0
  226. package/es/image/ImageSfc.css +0 -0
  227. package/es/image/image.css +1 -0
  228. package/es/image/index.mjs +12 -0
  229. package/es/image/props.mjs +30 -0
  230. package/es/image/style/index.mjs +4 -0
  231. package/es/image-preview/ImagePreview.mjs +348 -0
  232. package/es/image-preview/ImagePreviewSfc.css +0 -0
  233. package/es/image-preview/imagePreview.css +1 -0
  234. package/es/image-preview/index.mjs +87 -0
  235. package/es/image-preview/props.mjs +52 -0
  236. package/es/image-preview/style/index.mjs +7 -0
  237. package/es/index-anchor/IndexAnchor.mjs +87 -0
  238. package/es/index-anchor/IndexAnchorSfc.css +1 -0
  239. package/es/index-anchor/index.mjs +12 -0
  240. package/es/index-anchor/props.mjs +6 -0
  241. package/es/index-anchor/provide.mjs +19 -0
  242. package/es/index-anchor/style/index.mjs +3 -0
  243. package/es/index-bar/IndexBar.mjs +222 -0
  244. package/es/index-bar/IndexBarSfc.css +0 -0
  245. package/es/index-bar/index.mjs +12 -0
  246. package/es/index-bar/indexBar.css +1 -0
  247. package/es/index-bar/props.mjs +29 -0
  248. package/es/index-bar/provide.mjs +16 -0
  249. package/es/index-bar/style/index.mjs +3 -0
  250. package/es/index.bundle.mjs +533 -0
  251. package/es/index.d.ts +1 -0
  252. package/es/index.mjs +173 -173
  253. package/es/input/Input.mjs +375 -0
  254. package/es/input/InputSfc.css +0 -0
  255. package/es/input/index.mjs +12 -0
  256. package/es/input/input.css +1 -0
  257. package/es/input/props.mjs +65 -0
  258. package/es/input/provide.ts +3 -0
  259. package/es/input/style/index.mjs +6 -0
  260. package/es/lazy/index.mjs +213 -0
  261. package/es/lazy/style/index.mjs +0 -0
  262. package/es/link/Link.mjs +81 -0
  263. package/es/link/LinkSfc.css +0 -0
  264. package/es/link/index.mjs +12 -0
  265. package/es/link/link.css +1 -0
  266. package/es/link/props.mjs +23 -0
  267. package/es/link/style/index.mjs +3 -0
  268. package/es/list/List.mjs +185 -0
  269. package/es/list/ListSfc.css +0 -0
  270. package/es/list/index.mjs +12 -0
  271. package/es/list/list.css +1 -0
  272. package/es/list/props.mjs +23 -0
  273. package/es/list/provide.mjs +13 -0
  274. package/es/list/style/index.mjs +5 -0
  275. package/es/loading/Loading.mjs +190 -0
  276. package/es/loading/LoadingSfc.css +0 -0
  277. package/es/loading/index.mjs +12 -0
  278. package/es/loading/loading.css +1 -0
  279. package/es/loading/props.mjs +17 -0
  280. package/es/loading/style/index.mjs +3 -0
  281. package/es/loading-bar/LoadingBar.mjs +33 -0
  282. package/es/loading-bar/index.mjs +102 -0
  283. package/es/loading-bar/loadingBar.css +1 -0
  284. package/es/loading-bar/props.mjs +18 -0
  285. package/es/loading-bar/style/index.mjs +2 -0
  286. package/es/locale/en-US.d.ts +5 -0
  287. package/es/locale/en-US.mjs +108 -0
  288. package/es/locale/index.mjs +79 -0
  289. package/es/locale/style/index.mjs +0 -0
  290. package/es/locale/zh-CN.d.ts +5 -0
  291. package/es/locale/zh-CN.mjs +108 -0
  292. package/es/locale/zh-HK.d.ts +5 -0
  293. package/es/locale/zh-HK.mjs +5 -0
  294. package/es/locale/zh-TW.d.ts +5 -0
  295. package/es/locale/zh-TW.mjs +105 -0
  296. package/es/menu/Menu.mjs +124 -0
  297. package/es/menu/MenuSfc.css +0 -0
  298. package/es/menu/index.mjs +12 -0
  299. package/es/menu/menu.css +1 -0
  300. package/es/menu/props.mjs +50 -0
  301. package/es/menu/style/index.mjs +4 -0
  302. package/es/menu/usePopover.mjs +333 -0
  303. package/es/menu-option/MenuOption.mjs +122 -0
  304. package/es/menu-option/MenuOptionSfc.css +0 -0
  305. package/es/menu-option/index.mjs +12 -0
  306. package/es/menu-option/menuOption.css +1 -0
  307. package/es/menu-option/props.mjs +8 -0
  308. package/es/menu-option/provide.mjs +19 -0
  309. package/es/menu-option/style/index.mjs +5 -0
  310. package/es/menu-select/MenuSelect.mjs +113 -0
  311. package/es/menu-select/MenuSelectSfc.css +0 -0
  312. package/es/menu-select/index.mjs +12 -0
  313. package/es/menu-select/menuSelect.css +1 -0
  314. package/es/menu-select/props.mjs +57 -0
  315. package/es/menu-select/provide.mjs +16 -0
  316. package/es/menu-select/style/index.mjs +5 -0
  317. package/es/option/Option.mjs +127 -0
  318. package/es/option/OptionSfc.css +0 -0
  319. package/es/option/index.mjs +12 -0
  320. package/es/option/option.css +1 -0
  321. package/es/option/props.mjs +8 -0
  322. package/es/option/provide.mjs +17 -0
  323. package/es/option/style/index.mjs +6 -0
  324. package/es/overlay/Overlay.mjs +68 -0
  325. package/es/overlay/index.mjs +12 -0
  326. package/es/overlay/overlay.css +1 -0
  327. package/es/overlay/props.mjs +14 -0
  328. package/es/overlay/style/index.mjs +2 -0
  329. package/es/pagination/Pagination.mjs +428 -0
  330. package/es/pagination/PaginationSfc.css +0 -0
  331. package/es/pagination/index.mjs +12 -0
  332. package/es/pagination/pagination.css +1 -0
  333. package/es/pagination/props.mjs +41 -0
  334. package/es/pagination/style/index.mjs +10 -0
  335. package/es/paper/Paper.mjs +61 -0
  336. package/es/paper/PaperSfc.css +0 -0
  337. package/es/paper/index.mjs +12 -0
  338. package/es/paper/paper.css +1 -0
  339. package/es/paper/props.mjs +17 -0
  340. package/es/paper/style/index.mjs +4 -0
  341. package/es/picker/Picker.mjs +486 -0
  342. package/es/picker/PickerSfc.css +0 -0
  343. package/es/picker/index.mjs +84 -0
  344. package/es/picker/picker.css +1 -0
  345. package/es/picker/props.mjs +79 -0
  346. package/es/picker/style/index.mjs +5 -0
  347. package/es/popup/Popup.mjs +127 -0
  348. package/es/popup/index.mjs +12 -0
  349. package/es/popup/popup.css +1 -0
  350. package/es/popup/props.mjs +44 -0
  351. package/es/popup/provide.mjs +23 -0
  352. package/es/popup/style/index.mjs +2 -0
  353. package/es/progress/Progress.mjs +257 -0
  354. package/es/progress/ProgressSfc.css +0 -0
  355. package/es/progress/index.mjs +12 -0
  356. package/es/progress/progress.css +1 -0
  357. package/es/progress/props.mjs +39 -0
  358. package/es/progress/style/index.mjs +3 -0
  359. package/es/pull-refresh/PullRefresh.mjs +217 -0
  360. package/es/pull-refresh/PullRefreshSfc.css +0 -0
  361. package/es/pull-refresh/index.mjs +12 -0
  362. package/es/pull-refresh/props.mjs +23 -0
  363. package/es/pull-refresh/pullRefresh.css +1 -0
  364. package/es/pull-refresh/style/index.mjs +5 -0
  365. package/es/radio/Radio.mjs +202 -0
  366. package/es/radio/RadioSfc.css +0 -0
  367. package/es/radio/index.mjs +12 -0
  368. package/es/radio/props.mjs +35 -0
  369. package/es/radio/provide.mjs +13 -0
  370. package/es/radio/radio.css +1 -0
  371. package/es/radio/style/index.mjs +7 -0
  372. package/es/radio-group/RadioGroup.mjs +96 -0
  373. package/es/radio-group/RadioGroupSfc.css +0 -0
  374. package/es/radio-group/index.mjs +12 -0
  375. package/es/radio-group/props.mjs +21 -0
  376. package/es/radio-group/provide.mjs +16 -0
  377. package/es/radio-group/radioGroup.css +1 -0
  378. package/es/radio-group/style/index.mjs +4 -0
  379. package/es/rate/Rate.mjs +204 -0
  380. package/es/rate/RateSfc.css +0 -0
  381. package/es/rate/index.mjs +12 -0
  382. package/es/rate/props.mjs +46 -0
  383. package/es/rate/provide.ts +3 -0
  384. package/es/rate/rate.css +1 -0
  385. package/es/rate/style/index.mjs +7 -0
  386. package/es/result/Empty.mjs +26 -0
  387. package/es/result/Error.mjs +26 -0
  388. package/es/result/Info.mjs +26 -0
  389. package/es/result/Question.mjs +26 -0
  390. package/es/result/Result.mjs +129 -0
  391. package/es/result/ResultSfc.css +0 -0
  392. package/es/result/Success.mjs +104 -0
  393. package/es/result/Warning.mjs +26 -0
  394. package/es/result/index.mjs +12 -0
  395. package/es/result/props.mjs +16 -0
  396. package/es/result/result.css +1 -0
  397. package/es/result/style/index.mjs +3 -0
  398. package/es/ripple/index.mjs +150 -0
  399. package/es/ripple/ripple.css +1 -0
  400. package/es/ripple/style/index.mjs +2 -0
  401. package/es/row/Row.mjs +62 -0
  402. package/es/row/RowSfc.css +0 -0
  403. package/es/row/index.mjs +12 -0
  404. package/es/row/props.mjs +19 -0
  405. package/es/row/provide.mjs +14 -0
  406. package/es/row/row.css +1 -0
  407. package/es/row/style/index.mjs +3 -0
  408. package/es/select/Select.mjs +417 -0
  409. package/es/select/SelectSfc.css +0 -0
  410. package/es/select/index.mjs +12 -0
  411. package/es/select/props.mjs +64 -0
  412. package/es/select/provide.mjs +14 -0
  413. package/es/select/select.css +1 -0
  414. package/es/select/style/index.mjs +9 -0
  415. package/es/select/useSelectController.mjs +67 -0
  416. package/es/skeleton/Skeleton.mjs +195 -0
  417. package/es/skeleton/SkeletonSfc.css +0 -0
  418. package/es/skeleton/index.mjs +12 -0
  419. package/es/skeleton/props.mjs +28 -0
  420. package/es/skeleton/skeleton.css +1 -0
  421. package/es/skeleton/style/index.mjs +3 -0
  422. package/es/slider/Slider.mjs +488 -0
  423. package/es/slider/SliderSfc.css +0 -0
  424. package/es/slider/index.mjs +12 -0
  425. package/es/slider/props.mjs +51 -0
  426. package/es/slider/provide.ts +3 -0
  427. package/es/slider/slider.css +1 -0
  428. package/es/slider/style/index.mjs +5 -0
  429. package/es/snackbar/Snackbar.mjs +62 -0
  430. package/es/snackbar/SnackbarSfc.css +0 -0
  431. package/es/snackbar/core.mjs +170 -0
  432. package/es/snackbar/coreSfc.css +0 -0
  433. package/es/snackbar/index.mjs +229 -0
  434. package/es/snackbar/props.mjs +59 -0
  435. package/es/snackbar/snackbar.css +1 -0
  436. package/es/snackbar/style/index.mjs +8 -0
  437. package/es/space/Space.mjs +67 -0
  438. package/es/space/index.mjs +12 -0
  439. package/es/space/margin.mjs +34 -0
  440. package/es/space/props.mjs +23 -0
  441. package/es/space/space.css +1 -0
  442. package/es/space/style/index.mjs +2 -0
  443. package/es/step/Step.mjs +123 -0
  444. package/es/step/StepSfc.css +0 -0
  445. package/es/step/index.mjs +12 -0
  446. package/es/step/props.mjs +16 -0
  447. package/es/step/provide.mjs +17 -0
  448. package/es/step/step.css +1 -0
  449. package/es/step/style/index.mjs +4 -0
  450. package/es/steps/Steps.mjs +49 -0
  451. package/es/steps/StepsSfc.css +1 -0
  452. package/es/steps/index.mjs +12 -0
  453. package/es/steps/props.mjs +17 -0
  454. package/es/steps/provide.mjs +13 -0
  455. package/es/steps/style/index.mjs +2 -0
  456. package/es/sticky/Sticky.mjs +176 -0
  457. package/es/sticky/StickySfc.css +0 -0
  458. package/es/sticky/index.mjs +12 -0
  459. package/es/sticky/props.mjs +17 -0
  460. package/es/sticky/sticky.css +1 -0
  461. package/es/sticky/style/index.mjs +3 -0
  462. package/es/style-provider/StyleProvider.mjs +24 -0
  463. package/es/style-provider/StyleProviderSfc.css +0 -0
  464. package/es/style-provider/index.mjs +25 -0
  465. package/es/style-provider/props.mjs +13 -0
  466. package/es/style-provider/style/index.mjs +2 -0
  467. package/es/style.mjs +86 -0
  468. package/es/styles/common.css +1 -0
  469. package/es/styles/elevation.css +1 -0
  470. package/es/styles/style/index.mjs +0 -0
  471. package/es/swipe/Swipe.mjs +512 -0
  472. package/es/swipe/SwipeSfc.css +0 -0
  473. package/es/swipe/index.mjs +12 -0
  474. package/es/swipe/props.mjs +34 -0
  475. package/es/swipe/provide.mjs +16 -0
  476. package/es/swipe/style/index.mjs +8 -0
  477. package/es/swipe/swipe.css +1 -0
  478. package/es/swipe-item/SwipeItem.mjs +50 -0
  479. package/es/swipe-item/SwipeItemSfc.css +0 -0
  480. package/es/swipe-item/index.mjs +9 -0
  481. package/es/swipe-item/provide.mjs +17 -0
  482. package/es/swipe-item/style/index.mjs +3 -0
  483. package/es/swipe-item/swipeItem.css +1 -0
  484. package/es/switch/Switch.mjs +225 -0
  485. package/es/switch/SwitchSfc.css +0 -0
  486. package/es/switch/index.mjs +12 -0
  487. package/es/switch/props.mjs +30 -0
  488. package/es/switch/provide.ts +3 -0
  489. package/es/switch/style/index.mjs +8 -0
  490. package/es/switch/switch.css +1 -0
  491. package/es/tab/Tab.mjs +87 -0
  492. package/es/tab/TabSfc.css +0 -0
  493. package/es/tab/index.mjs +12 -0
  494. package/es/tab/props.mjs +13 -0
  495. package/es/tab/provide.mjs +17 -0
  496. package/es/tab/style/index.mjs +4 -0
  497. package/es/tab/tab.css +1 -0
  498. package/es/tab-item/TabItem.mjs +52 -0
  499. package/es/tab-item/TabItemSfc.css +0 -0
  500. package/es/tab-item/index.mjs +12 -0
  501. package/es/tab-item/props.mjs +6 -0
  502. package/es/tab-item/provide.mjs +30 -0
  503. package/es/tab-item/style/index.mjs +4 -0
  504. package/es/tab-item/tabItem.css +1 -0
  505. package/es/table/Table.mjs +67 -0
  506. package/es/table/TableSfc.css +0 -0
  507. package/es/table/index.mjs +12 -0
  508. package/es/table/props.mjs +13 -0
  509. package/es/table/style/index.mjs +4 -0
  510. package/es/table/table.css +1 -0
  511. package/es/tabs/Tabs.mjs +246 -0
  512. package/es/tabs/TabsSfc.css +0 -0
  513. package/es/tabs/index.mjs +12 -0
  514. package/es/tabs/props.mjs +46 -0
  515. package/es/tabs/provide.mjs +14 -0
  516. package/es/tabs/style/index.mjs +5 -0
  517. package/es/tabs/tabs.css +1 -0
  518. package/es/tabs-items/TabsItems.mjs +102 -0
  519. package/es/tabs-items/TabsItemsSfc.css +0 -0
  520. package/es/tabs-items/index.mjs +12 -0
  521. package/es/tabs-items/props.mjs +16 -0
  522. package/es/tabs-items/provide.mjs +16 -0
  523. package/es/tabs-items/style/index.mjs +3 -0
  524. package/es/themes/dark/actionSheet.mjs +8 -0
  525. package/es/themes/dark/appBar.mjs +6 -0
  526. package/es/themes/dark/avatar.mjs +7 -0
  527. package/es/themes/dark/badge.mjs +6 -0
  528. package/es/themes/dark/bottomNavigation.mjs +7 -0
  529. package/es/themes/dark/bottomNavigationItem.mjs +6 -0
  530. package/es/themes/dark/breadcrumb.mjs +6 -0
  531. package/es/themes/dark/button.mjs +7 -0
  532. package/es/themes/dark/card.mjs +10 -0
  533. package/es/themes/dark/cell.mjs +7 -0
  534. package/es/themes/dark/checkbox.mjs +7 -0
  535. package/es/themes/dark/chip.mjs +7 -0
  536. package/es/themes/dark/collapse.mjs +8 -0
  537. package/es/themes/dark/countdown.mjs +6 -0
  538. package/es/themes/dark/datePicker.mjs +10 -0
  539. package/es/themes/dark/dialog.mjs +8 -0
  540. package/es/themes/dark/divider.mjs +7 -0
  541. package/es/themes/dark/fieldDecorator.mjs +7 -0
  542. package/es/themes/dark/floatingPanel.mjs +6 -0
  543. package/es/themes/dark/index.d.ts +5 -0
  544. package/es/themes/dark/index.mjs +73 -0
  545. package/es/themes/dark/link.mjs +6 -0
  546. package/es/themes/dark/menu.mjs +6 -0
  547. package/es/themes/dark/menuOption.mjs +6 -0
  548. package/es/themes/dark/menuSelect.mjs +6 -0
  549. package/es/themes/dark/option.mjs +6 -0
  550. package/es/themes/dark/pagination.mjs +11 -0
  551. package/es/themes/dark/paper.mjs +6 -0
  552. package/es/themes/dark/picker.mjs +11 -0
  553. package/es/themes/dark/popup.mjs +6 -0
  554. package/es/themes/dark/progress.mjs +6 -0
  555. package/es/themes/dark/pullRefresh.mjs +6 -0
  556. package/es/themes/dark/radio.mjs +7 -0
  557. package/es/themes/dark/result.mjs +12 -0
  558. package/es/themes/dark/select.mjs +6 -0
  559. package/es/themes/dark/skeleton.mjs +11 -0
  560. package/es/themes/dark/steps.mjs +8 -0
  561. package/es/themes/dark/switch.mjs +7 -0
  562. package/es/themes/dark/tab.mjs +6 -0
  563. package/es/themes/dark/table.mjs +12 -0
  564. package/es/themes/dark/tabs.mjs +6 -0
  565. package/es/themes/dark/timePicker.mjs +9 -0
  566. package/es/themes/dark/uploader.mjs +10 -0
  567. package/es/themes/dark/watermark.mjs +6 -0
  568. package/es/themes/index.mjs +8 -0
  569. package/es/themes/style/index.mjs +0 -0
  570. package/es/time-picker/TimePicker.mjs +438 -0
  571. package/es/time-picker/TimePickerSfc.css +0 -0
  572. package/es/time-picker/clock.mjs +335 -0
  573. package/es/time-picker/index.mjs +12 -0
  574. package/es/time-picker/props.mjs +33 -0
  575. package/es/time-picker/style/index.mjs +4 -0
  576. package/es/time-picker/timePicker.css +1 -0
  577. package/es/time-picker/utils.mjs +76 -0
  578. package/es/tooltip/Tooltip.mjs +129 -0
  579. package/es/tooltip/TooltipSfc.css +0 -0
  580. package/es/tooltip/index.mjs +12 -0
  581. package/es/tooltip/props.mjs +47 -0
  582. package/es/tooltip/style/index.mjs +3 -0
  583. package/es/tooltip/tooltip.css +1 -0
  584. package/es/uploader/Uploader.mjs +485 -0
  585. package/es/uploader/UploaderSfc.css +0 -0
  586. package/es/uploader/index.mjs +12 -0
  587. package/es/uploader/props.mjs +59 -0
  588. package/es/uploader/provide.ts +3 -0
  589. package/es/uploader/style/index.mjs +9 -0
  590. package/es/uploader/uploader.css +1 -0
  591. package/es/utils/components.mjs +200 -0
  592. package/es/utils/elements.mjs +190 -0
  593. package/es/utils/logger.mjs +10 -0
  594. package/es/utils/shared.mjs +54 -0
  595. package/es/utils/style/index.mjs +0 -0
  596. package/es/utils/test.mjs +281 -0
  597. package/es/varlet.esm.js +1 -1
  598. package/es/watermark/Watermark.mjs +248 -0
  599. package/es/watermark/WatermarkSfc.css +0 -0
  600. package/es/watermark/index.mjs +12 -0
  601. package/es/watermark/props.mjs +53 -0
  602. package/es/watermark/style/index.mjs +3 -0
  603. package/es/watermark/watermark.css +1 -0
  604. package/highlight/web-types.en-US.json +1 -1
  605. package/highlight/web-types.zh-CN.json +1 -1
  606. package/lib/varlet.cjs.js +2 -2
  607. package/package.json +7 -7
  608. package/umd/varlet.js +1 -1
@@ -0,0 +1,486 @@
1
+ import VarButton from "../button/index.mjs";
2
+ import VarPopup from "../popup/index.mjs";
3
+ import { defineComponent, watch, ref, computed, Transition } from "vue";
4
+ import { props } from "./props.mjs";
5
+ import { useTouch, useVModel } from "@varlet/use";
6
+ import { clamp, clampArrayRange, call } from "@varlet/shared";
7
+ import { toPxNum, getTranslateY } from "../utils/elements.mjs";
8
+ import { pack } from "../locale/index.mjs";
9
+ import { createNamespace } from "../utils/components.mjs";
10
+ const { name, n, classes } = createNamespace("picker");
11
+ const MOMENTUM_RECORD_TIME = 300;
12
+ const MOMENTUM_ALLOW_DISTANCE = 15;
13
+ const TRANSITION_DURATION = 200;
14
+ const MOMENTUM_TRANSITION_DURATION = 1e3;
15
+ let sid = 0;
16
+ import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, normalizeClass as _normalizeClass, withCtx as _withCtx, createVNode as _createVNode, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, renderList as _renderList, Fragment as _Fragment, normalizeStyle as _normalizeStyle, withModifiers as _withModifiers, mergeProps as _mergeProps, resolveDynamicComponent as _resolveDynamicComponent, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
17
+ const _withScopeId = (n2) => (_pushScopeId(""), n2 = n2(), _popScopeId(), n2);
18
+ const _hoisted_1 = ["onTouchstartPassive", "onTouchmove", "onTouchend"];
19
+ const _hoisted_2 = ["onTransitionend"];
20
+ const _hoisted_3 = ["onClick"];
21
+ function __render__(_ctx, _cache) {
22
+ const _component_var_button = _resolveComponent("var-button");
23
+ return _openBlock(), _createBlock(
24
+ _resolveDynamicComponent(_ctx.dynamic ? _ctx.n("$-popup") : _ctx.Transition),
25
+ _mergeProps(
26
+ _ctx.dynamic ? {
27
+ onOpen: _ctx.onOpen,
28
+ onOpened: _ctx.onOpened,
29
+ onClose: _ctx.onClose,
30
+ onClosed: _ctx.onClosed,
31
+ onClickOverlay: _ctx.onClickOverlay,
32
+ onRouteChange: _ctx.onRouteChange,
33
+ closeOnClickOverlay: _ctx.closeOnClickOverlay,
34
+ teleport: _ctx.teleport,
35
+ show: _ctx.show,
36
+ safeArea: _ctx.safeArea,
37
+ "onUpdate:show": _ctx.handlePopupUpdateShow,
38
+ position: "bottom",
39
+ class: _ctx.n("popup")
40
+ } : null,
41
+ { "var-picker-cover": "" }
42
+ ),
43
+ {
44
+ default: _withCtx(() => [
45
+ _createElementVNode(
46
+ "div",
47
+ _mergeProps({
48
+ class: _ctx.n()
49
+ }, _ctx.$attrs),
50
+ [
51
+ _ctx.toolbar ? (_openBlock(), _createElementBlock(
52
+ "div",
53
+ {
54
+ key: 0,
55
+ class: _normalizeClass(_ctx.n("toolbar"))
56
+ },
57
+ [
58
+ _renderSlot(_ctx.$slots, "cancel", {}, () => [
59
+ _createVNode(_component_var_button, {
60
+ class: _normalizeClass(_ctx.n("cancel-button")),
61
+ "var-picker-cover": "",
62
+ text: "",
63
+ "text-color": _ctx.cancelButtonTextColor,
64
+ onClick: _ctx.cancel
65
+ }, {
66
+ default: _withCtx(() => {
67
+ var _a;
68
+ return [
69
+ _createTextVNode(
70
+ _toDisplayString((_a = _ctx.cancelButtonText) != null ? _a : _ctx.pack.pickerCancelButtonText),
71
+ 1
72
+ /* TEXT */
73
+ )
74
+ ];
75
+ }),
76
+ _: 1
77
+ /* STABLE */
78
+ }, 8, ["class", "text-color", "onClick"])
79
+ ]),
80
+ _renderSlot(_ctx.$slots, "title", {}, () => {
81
+ var _a;
82
+ return [
83
+ _createElementVNode(
84
+ "div",
85
+ {
86
+ class: _normalizeClass(_ctx.n("title"))
87
+ },
88
+ _toDisplayString((_a = _ctx.title) != null ? _a : _ctx.pack.pickerTitle),
89
+ 3
90
+ /* TEXT, CLASS */
91
+ )
92
+ ];
93
+ }),
94
+ _renderSlot(_ctx.$slots, "confirm", {}, () => [
95
+ _createVNode(_component_var_button, {
96
+ class: _normalizeClass(_ctx.n("confirm-button")),
97
+ text: "",
98
+ "var-picker-cover": "",
99
+ "text-color": _ctx.confirmButtonTextColor,
100
+ onClick: _ctx.confirm
101
+ }, {
102
+ default: _withCtx(() => {
103
+ var _a;
104
+ return [
105
+ _createTextVNode(
106
+ _toDisplayString((_a = _ctx.confirmButtonText) != null ? _a : _ctx.pack.pickerConfirmButtonText),
107
+ 1
108
+ /* TEXT */
109
+ )
110
+ ];
111
+ }),
112
+ _: 1
113
+ /* STABLE */
114
+ }, 8, ["class", "text-color", "onClick"])
115
+ ])
116
+ ],
117
+ 2
118
+ /* CLASS */
119
+ )) : _createCommentVNode("v-if", true),
120
+ _createElementVNode(
121
+ "div",
122
+ {
123
+ class: _normalizeClass(_ctx.n("columns")),
124
+ style: _normalizeStyle({ height: `${_ctx.columnHeight}px` })
125
+ },
126
+ [
127
+ (_openBlock(true), _createElementBlock(
128
+ _Fragment,
129
+ null,
130
+ _renderList(_ctx.scrollColumns, (c) => {
131
+ return _openBlock(), _createElementBlock("div", {
132
+ class: _normalizeClass(_ctx.n("column")),
133
+ key: c.id,
134
+ onTouchstartPassive: ($event) => _ctx.handleTouchstart($event, c),
135
+ onTouchmove: _withModifiers(($event) => _ctx.handleTouchmove($event, c), ["prevent"]),
136
+ onTouchend: ($event) => _ctx.handleTouchend(c)
137
+ }, [
138
+ _createElementVNode("div", {
139
+ class: _normalizeClass(_ctx.n("scroller")),
140
+ ref_for: true,
141
+ ref: (el) => _ctx.setScrollEl(el, c),
142
+ style: _normalizeStyle({
143
+ transform: `translateY(${c.translate}px)`,
144
+ transitionDuration: `${c.duration}ms`,
145
+ transitionProperty: c.duration ? "transform" : "none"
146
+ }),
147
+ onTransitionend: ($event) => _ctx.handleTransitionend(c)
148
+ }, [
149
+ (_openBlock(true), _createElementBlock(
150
+ _Fragment,
151
+ null,
152
+ _renderList(c.column, (option, index) => {
153
+ return _openBlock(), _createElementBlock("div", {
154
+ key: _ctx.getValue(option),
155
+ class: _normalizeClass(_ctx.classes(_ctx.n("option"), option.className)),
156
+ style: _normalizeStyle({ height: `${_ctx.optionHeight}px` }),
157
+ onClick: ($event) => _ctx.handleClick(c, index)
158
+ }, [
159
+ _createElementVNode(
160
+ "div",
161
+ {
162
+ class: _normalizeClass(_ctx.classes(_ctx.n("text"), option.textClassName))
163
+ },
164
+ _toDisplayString(option[_ctx.getOptionKey("text")]),
165
+ 3
166
+ /* TEXT, CLASS */
167
+ )
168
+ ], 14, _hoisted_3);
169
+ }),
170
+ 128
171
+ /* KEYED_FRAGMENT */
172
+ ))
173
+ ], 46, _hoisted_2)
174
+ ], 42, _hoisted_1);
175
+ }),
176
+ 128
177
+ /* KEYED_FRAGMENT */
178
+ )),
179
+ _createElementVNode(
180
+ "div",
181
+ {
182
+ class: _normalizeClass(_ctx.n("picked")),
183
+ style: _normalizeStyle({
184
+ top: `${_ctx.center}px`,
185
+ height: `${_ctx.optionHeight}px`
186
+ })
187
+ },
188
+ null,
189
+ 6
190
+ /* CLASS, STYLE */
191
+ ),
192
+ _createElementVNode(
193
+ "div",
194
+ {
195
+ class: _normalizeClass(_ctx.n("mask")),
196
+ style: _normalizeStyle({ backgroundSize: `100% ${(_ctx.columnHeight - _ctx.optionHeight) / 2}px` })
197
+ },
198
+ null,
199
+ 6
200
+ /* CLASS, STYLE */
201
+ )
202
+ ],
203
+ 6
204
+ /* CLASS, STYLE */
205
+ )
206
+ ],
207
+ 16
208
+ /* FULL_PROPS */
209
+ )
210
+ ]),
211
+ _: 3
212
+ /* FORWARDED */
213
+ },
214
+ 16
215
+ /* FULL_PROPS */
216
+ );
217
+ }
218
+ const __sfc__ = defineComponent({
219
+ name,
220
+ components: {
221
+ VarButton,
222
+ VarPopup
223
+ },
224
+ inheritAttrs: false,
225
+ props,
226
+ setup(props2) {
227
+ const modelValue = useVModel(props2, "modelValue");
228
+ const scrollColumns = ref([]);
229
+ const optionHeight = computed(() => toPxNum(props2.optionHeight));
230
+ const optionCount = computed(() => toPxNum(props2.optionCount));
231
+ const center = computed(() => optionCount.value * optionHeight.value / 2 - optionHeight.value / 2);
232
+ const columnHeight = computed(() => optionCount.value * optionHeight.value);
233
+ const { prevY, moveY, dragging, startTouch, moveTouch, endTouch } = useTouch();
234
+ let prevIndexes = [];
235
+ buildScrollColumns();
236
+ watch(() => props2.columns, buildScrollColumns, { deep: true });
237
+ watch(() => modelValue.value, updateScrollColumnsIndex);
238
+ function getOptionKey(key) {
239
+ const keyMap = {
240
+ text: props2.textKey,
241
+ value: props2.valueKey,
242
+ children: props2.childrenKey
243
+ };
244
+ return keyMap[key];
245
+ }
246
+ function getValue(option) {
247
+ var _a;
248
+ return (_a = option[getOptionKey("value")]) != null ? _a : option[getOptionKey("text")];
249
+ }
250
+ function setPrevIndexes(indexes) {
251
+ prevIndexes = [...indexes];
252
+ }
253
+ function normalizeNormalMode(columns) {
254
+ return columns.map((column) => {
255
+ const scrollColumn = {
256
+ id: sid++,
257
+ prevY: 0,
258
+ momentumPrevY: 0,
259
+ touching: false,
260
+ translate: center.value,
261
+ index: 0,
262
+ duration: 0,
263
+ momentumTime: 0,
264
+ column,
265
+ scrollEl: null,
266
+ scrolling: false
267
+ };
268
+ scrollTo(scrollColumn);
269
+ return scrollColumn;
270
+ });
271
+ }
272
+ function normalizeCascadeMode(column) {
273
+ const scrollColumns2 = [];
274
+ createChildren(scrollColumns2, column);
275
+ return scrollColumns2;
276
+ }
277
+ function createChildren(scrollColumns2, children) {
278
+ var _a;
279
+ if (children.length) {
280
+ const scrollColumn = {
281
+ id: sid++,
282
+ prevY: 0,
283
+ momentumPrevY: 0,
284
+ touching: false,
285
+ translate: center.value,
286
+ index: 0,
287
+ duration: 0,
288
+ momentumTime: 0,
289
+ column: children,
290
+ scrollEl: null,
291
+ scrolling: false
292
+ };
293
+ scrollColumns2.push(scrollColumn);
294
+ scrollTo(scrollColumn);
295
+ createChildren(scrollColumns2, (_a = scrollColumn.column[scrollColumn.index][getOptionKey("children")]) != null ? _a : []);
296
+ }
297
+ }
298
+ function rebuildChildren(scrollColumn) {
299
+ var _a;
300
+ scrollColumns.value.splice(scrollColumns.value.indexOf(scrollColumn) + 1);
301
+ createChildren(scrollColumns.value, (_a = scrollColumn.column[scrollColumn.index][getOptionKey("children")]) != null ? _a : []);
302
+ }
303
+ function buildScrollColumns() {
304
+ scrollColumns.value = props2.cascade ? normalizeCascadeMode(props2.columns) : normalizeNormalMode(props2.columns);
305
+ updateScrollColumnsIndex();
306
+ }
307
+ function updateScrollColumnsIndex() {
308
+ scrollColumns.value.forEach((scrollColumn, idx) => {
309
+ const index = scrollColumn.column.findIndex((option) => modelValue.value[idx] === getValue(option));
310
+ scrollColumn.index = index === -1 ? 0 : index;
311
+ scrollTo(scrollColumn);
312
+ });
313
+ const { indexes } = getPicked();
314
+ setPrevIndexes(indexes);
315
+ }
316
+ function setScrollEl(el, scrollColumn) {
317
+ scrollColumn.scrollEl = el;
318
+ }
319
+ function handlePopupUpdateShow(value) {
320
+ call(props2["onUpdate:show"], value);
321
+ }
322
+ function clampTranslate(scrollColumn) {
323
+ const minTranslate = center.value - scrollColumn.column.length * optionHeight.value;
324
+ const maxTranslate = optionHeight.value + center.value;
325
+ scrollColumn.translate = clamp(scrollColumn.translate, minTranslate, maxTranslate);
326
+ }
327
+ function getTargetIndex(scrollColumn, viewTranslate) {
328
+ const index = Math.round((center.value - viewTranslate) / optionHeight.value);
329
+ return clampArrayRange(index, scrollColumn.column);
330
+ }
331
+ function updateTranslate(scrollColumn) {
332
+ scrollColumn.translate = center.value - scrollColumn.index * optionHeight.value;
333
+ return scrollColumn.translate;
334
+ }
335
+ function getPicked() {
336
+ const values = [];
337
+ const indexes = [];
338
+ const options = [];
339
+ scrollColumns.value.forEach(({ column, index }) => {
340
+ const option = column[index];
341
+ values.push(getValue(option));
342
+ indexes.push(index);
343
+ options.push(option);
344
+ });
345
+ return {
346
+ values,
347
+ indexes,
348
+ options
349
+ };
350
+ }
351
+ function scrollTo(scrollColumn, duration = 0) {
352
+ updateTranslate(scrollColumn);
353
+ scrollColumn.duration = duration;
354
+ }
355
+ function momentum(scrollColumn, distance, duration) {
356
+ scrollColumn.translate += Math.abs(distance / duration) / 3e-3 * (distance < 0 ? -1 : 1);
357
+ }
358
+ function handleClick(scrollColumn, index) {
359
+ if (dragging.value) {
360
+ return;
361
+ }
362
+ scrollColumn.index = index;
363
+ scrollTo(scrollColumn, TRANSITION_DURATION);
364
+ }
365
+ function handleTouchstart(event, scrollColumn) {
366
+ scrollColumn.touching = true;
367
+ scrollColumn.translate = getTranslateY(scrollColumn.scrollEl);
368
+ startTouch(event);
369
+ }
370
+ function handleTouchmove(event, scrollColumn) {
371
+ if (!scrollColumn.touching) {
372
+ return;
373
+ }
374
+ moveTouch(event);
375
+ scrollColumn.scrolling = false;
376
+ scrollColumn.duration = 0;
377
+ scrollColumn.prevY = prevY.value;
378
+ scrollColumn.translate += moveY.value;
379
+ clampTranslate(scrollColumn);
380
+ const now = performance.now();
381
+ if (now - scrollColumn.momentumTime > MOMENTUM_RECORD_TIME) {
382
+ scrollColumn.momentumTime = now;
383
+ scrollColumn.momentumPrevY = scrollColumn.translate;
384
+ }
385
+ }
386
+ function handleTouchend(scrollColumn) {
387
+ endTouch();
388
+ scrollColumn.touching = false;
389
+ scrollColumn.prevY = 0;
390
+ const distance = scrollColumn.translate - scrollColumn.momentumPrevY;
391
+ const duration = performance.now() - scrollColumn.momentumTime;
392
+ const shouldMomentum = Math.abs(distance) >= MOMENTUM_ALLOW_DISTANCE && duration <= MOMENTUM_RECORD_TIME;
393
+ const oldTranslate = scrollColumn.translate;
394
+ if (shouldMomentum) {
395
+ momentum(scrollColumn, distance, duration);
396
+ }
397
+ scrollColumn.index = getTargetIndex(scrollColumn, scrollColumn.translate);
398
+ scrollTo(scrollColumn, shouldMomentum ? MOMENTUM_TRANSITION_DURATION : TRANSITION_DURATION);
399
+ scrollColumn.scrolling = scrollColumn.translate !== oldTranslate;
400
+ if (!scrollColumn.scrolling) {
401
+ change(scrollColumn);
402
+ }
403
+ }
404
+ function handleTransitionend(scrollColumn) {
405
+ scrollColumn.scrolling = false;
406
+ change(scrollColumn);
407
+ }
408
+ function isSamePicked() {
409
+ const { indexes } = getPicked();
410
+ return indexes.every((index, idx) => index === prevIndexes[idx]);
411
+ }
412
+ function change(scrollColumn) {
413
+ const { cascade, onChange } = props2;
414
+ if (isSamePicked()) {
415
+ return;
416
+ }
417
+ if (cascade) {
418
+ rebuildChildren(scrollColumn);
419
+ }
420
+ const hasScrolling = scrollColumns.value.some((scrollColumn2) => scrollColumn2.scrolling);
421
+ const hasTouching = scrollColumns.value.some((scrollColumn2) => scrollColumn2.touching);
422
+ if (hasScrolling || hasTouching) {
423
+ return;
424
+ }
425
+ const { values, indexes, options } = getPicked();
426
+ setPrevIndexes(indexes);
427
+ call(onChange, values, indexes, options);
428
+ modelValue.value = values;
429
+ }
430
+ function stopScroll() {
431
+ if (props2.cascade) {
432
+ const currentScrollColumn = scrollColumns.value.find((scrollColumn) => scrollColumn.scrolling);
433
+ if (currentScrollColumn) {
434
+ currentScrollColumn.index = getTargetIndex(currentScrollColumn, getTranslateY(currentScrollColumn.scrollEl));
435
+ currentScrollColumn.scrolling = false;
436
+ scrollTo(currentScrollColumn);
437
+ rebuildChildren(currentScrollColumn);
438
+ }
439
+ } else {
440
+ scrollColumns.value.forEach((scrollColumn) => {
441
+ scrollColumn.index = getTargetIndex(scrollColumn, getTranslateY(scrollColumn.scrollEl));
442
+ scrollTo(scrollColumn);
443
+ });
444
+ }
445
+ }
446
+ function confirm() {
447
+ stopScroll();
448
+ const { values, indexes, options } = getPicked();
449
+ setPrevIndexes(indexes);
450
+ call(props2.onConfirm, values, indexes, options);
451
+ }
452
+ function cancel() {
453
+ stopScroll();
454
+ const { values, indexes, options } = getPicked();
455
+ setPrevIndexes(indexes);
456
+ call(props2.onCancel, values, indexes, options);
457
+ }
458
+ return {
459
+ pack,
460
+ optionHeight,
461
+ optionCount,
462
+ scrollColumns,
463
+ columnHeight,
464
+ center,
465
+ Transition,
466
+ n,
467
+ classes,
468
+ setScrollEl,
469
+ getOptionKey,
470
+ getValue,
471
+ handlePopupUpdateShow,
472
+ handleTouchstart,
473
+ handleTouchmove,
474
+ handleTouchend,
475
+ handleTransitionend,
476
+ confirm,
477
+ cancel,
478
+ handleClick
479
+ };
480
+ }
481
+ });
482
+ __sfc__.render = __render__;
483
+ var stdin_default = __sfc__;
484
+ export {
485
+ stdin_default as default
486
+ };
File without changes
@@ -0,0 +1,84 @@
1
+ import VarPicker from "./Picker.mjs";
2
+ import { nextTick, reactive } from "vue";
3
+ import { isArray, call } from "@varlet/shared";
4
+ import { mountInstance, withInstall, withPropsDefaultsSetter } from "../utils/components.mjs";
5
+ import { props as pickerProps } from "./props.mjs";
6
+ let singletonOptions;
7
+ function Picker(options) {
8
+ return new Promise((resolve) => {
9
+ Picker.close();
10
+ const pickerOptions = isArray(options) ? { columns: options } : options;
11
+ const reactivePickerOptions = reactive(pickerOptions);
12
+ reactivePickerOptions.dynamic = true;
13
+ reactivePickerOptions.teleport = "body";
14
+ singletonOptions = reactivePickerOptions;
15
+ function resetSingletonOptions() {
16
+ singletonOptions === reactivePickerOptions && (singletonOptions = null);
17
+ }
18
+ const { unmountInstance } = mountInstance(VarPicker, reactivePickerOptions, {
19
+ onConfirm: (values, indexes, options2) => {
20
+ call(reactivePickerOptions.onConfirm, values, indexes, options2);
21
+ resolve({
22
+ state: "confirm",
23
+ values,
24
+ indexes,
25
+ options: options2
26
+ });
27
+ reactivePickerOptions.show = false;
28
+ resetSingletonOptions();
29
+ },
30
+ onCancel: (values, indexes, options2) => {
31
+ call(reactivePickerOptions.onCancel, values, indexes, options2);
32
+ resolve({
33
+ state: "cancel",
34
+ values,
35
+ indexes,
36
+ options: options2
37
+ });
38
+ reactivePickerOptions.show = false;
39
+ resetSingletonOptions();
40
+ },
41
+ onClose: () => {
42
+ call(reactivePickerOptions.onClose);
43
+ resolve({
44
+ state: "close"
45
+ });
46
+ resetSingletonOptions();
47
+ },
48
+ onClosed: () => {
49
+ call(reactivePickerOptions.onClosed);
50
+ unmountInstance();
51
+ resetSingletonOptions();
52
+ },
53
+ onRouteChange: () => {
54
+ unmountInstance();
55
+ resetSingletonOptions();
56
+ },
57
+ "onUpdate:show": (value) => {
58
+ reactivePickerOptions.show = value;
59
+ }
60
+ });
61
+ reactivePickerOptions.show = true;
62
+ });
63
+ }
64
+ Picker.close = function() {
65
+ if (singletonOptions == null) {
66
+ return;
67
+ }
68
+ const prevSingletonOptions = singletonOptions;
69
+ singletonOptions = null;
70
+ nextTick().then(() => {
71
+ prevSingletonOptions.show = false;
72
+ });
73
+ };
74
+ Picker.Component = VarPicker;
75
+ withInstall(VarPicker);
76
+ withInstall(VarPicker, Picker);
77
+ withPropsDefaultsSetter(Picker, pickerProps);
78
+ const _PickerComponent = VarPicker;
79
+ var stdin_default = Picker;
80
+ export {
81
+ _PickerComponent,
82
+ stdin_default as default,
83
+ pickerProps
84
+ };
@@ -0,0 +1 @@
1
+ :root { --picker-background: #fff; --picker-toolbar-height: 44px; --picker-confirm-button-text-color: var(--color-primary); --picker-cancel-button-text-color: #888; --picker-picked-border: 1px solid rgba(0, 0, 0, 0.12); --picker-title-font-size: var(--font-size-lg); --picker-title-text-color: #555; --picker-option-font-size: var(--font-size-lg); --picker-option-text-color: #555; --picker-toolbar-padding: 0 4px; --picker-mask-background-image: linear-gradient(180deg, hsla(0, 0%, 100%, 0.9), hsla(0, 0%, 100%, 0.4)), linear-gradient(0deg, hsla(0, 0%, 100%, 0.9), hsla(0, 0%, 100%, 0.4));}.var-picker { width: 100%; background: var(--picker-background); user-select: none; transition: 0.25s background-color;}.var-picker__popup[var-picker-cover] { width: 100%;}.var-picker__columns { position: relative; display: flex; width: 100%; cursor: grab;}.var-picker__column { flex: 1; overflow: hidden;}.var-picker__option { display: flex; justify-content: center; align-items: center; width: 100%; padding: 0 4px;}.var-picker__text { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--picker-option-text-color); font-size: var(--picker-option-font-size);}.var-picker__scroller { width: 100%; transition-timing-function: cubic-bezier(0.23, 1, 0.68, 1);}.var-picker__picked { position: absolute; z-index: 2; pointer-events: none; width: 100%; left: 0; border-top: var(--picker-picked-border); border-bottom: var(--picker-picked-border); transition: 0.25s border;}.var-picker__mask { position: absolute; pointer-events: none; top: 0; left: 0; width: 100%; height: 100%; background-image: var(--picker-mask-background-image); background-repeat: no-repeat; background-position: top, bottom;}.var-picker__toolbar { display: flex; justify-content: space-between; align-items: center; width: 100%; height: var(--picker-toolbar-height); padding: var(--picker-toolbar-padding);}.var-picker__confirm-button[var-picker-cover] { color: var(--picker-confirm-button-text-color);}.var-picker__cancel-button[var-picker-cover] { color: var(--picker-cancel-button-text-color);}.var-picker__title { color: var(--picker-title-text-color); font-size: var(--picker-title-font-size);}
@@ -0,0 +1,79 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
17
+ import { defineListenerProp, pickProps } from "../utils/components.mjs";
18
+ import { popupProps } from "../popup/index.mjs";
19
+ const props = __spreadValues({
20
+ modelValue: {
21
+ type: Array,
22
+ default: () => []
23
+ },
24
+ columns: {
25
+ type: Array,
26
+ default: () => []
27
+ },
28
+ title: String,
29
+ textKey: {
30
+ type: String,
31
+ default: "text"
32
+ },
33
+ valueKey: {
34
+ type: String,
35
+ default: "value"
36
+ },
37
+ childrenKey: {
38
+ type: String,
39
+ default: "children"
40
+ },
41
+ toolbar: {
42
+ type: Boolean,
43
+ default: true
44
+ },
45
+ cascade: Boolean,
46
+ optionHeight: {
47
+ type: [Number, String],
48
+ default: 44
49
+ },
50
+ optionCount: {
51
+ type: [Number, String],
52
+ default: 6
53
+ },
54
+ confirmButtonText: String,
55
+ cancelButtonText: String,
56
+ confirmButtonTextColor: String,
57
+ cancelButtonTextColor: String,
58
+ // dynamic internal
59
+ dynamic: Boolean,
60
+ onChange: defineListenerProp(),
61
+ onConfirm: defineListenerProp(),
62
+ onCancel: defineListenerProp(),
63
+ "onUpdate:modelValue": defineListenerProp()
64
+ }, pickProps(popupProps, [
65
+ "show",
66
+ "onUpdate:show",
67
+ "closeOnClickOverlay",
68
+ "teleport",
69
+ "safeArea",
70
+ "onOpen",
71
+ "onClose",
72
+ "onOpened",
73
+ "onClosed",
74
+ "onClickOverlay",
75
+ "onRouteChange"
76
+ ]));
77
+ export {
78
+ props
79
+ };
@@ -0,0 +1,5 @@
1
+ import '../../styles/common.css'
2
+ import '../../button/button.css'
3
+ import '../../popup/popup.css'
4
+ import '../picker.css'
5
+ import '../PickerSfc.css'