@ioca/react 1.4.80 → 1.5.1

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 (821) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +31 -31
  3. package/lib/cjs/components/affix/affix.js +68 -63
  4. package/lib/cjs/components/affix/affix.js.map +1 -1
  5. package/lib/cjs/components/affix/index.js +9 -5
  6. package/lib/cjs/components/affix/index.js.map +1 -1
  7. package/lib/cjs/components/affix/totop.js +18 -22
  8. package/lib/cjs/components/affix/totop.js.map +1 -1
  9. package/lib/cjs/components/badge/badge.js +18 -21
  10. package/lib/cjs/components/badge/badge.js.map +1 -1
  11. package/lib/cjs/components/badge/index.js +9 -5
  12. package/lib/cjs/components/badge/index.js.map +1 -1
  13. package/lib/cjs/components/button/button.js +68 -60
  14. package/lib/cjs/components/button/button.js.map +1 -1
  15. package/lib/cjs/components/button/confirm.js +51 -53
  16. package/lib/cjs/components/button/confirm.js.map +1 -1
  17. package/lib/cjs/components/button/group.js +26 -23
  18. package/lib/cjs/components/button/group.js.map +1 -1
  19. package/lib/cjs/components/button/index.js +9 -5
  20. package/lib/cjs/components/button/index.js.map +1 -1
  21. package/lib/cjs/components/button/toggle.js +44 -43
  22. package/lib/cjs/components/button/toggle.js.map +1 -1
  23. package/lib/cjs/components/card/card.js +18 -30
  24. package/lib/cjs/components/card/card.js.map +1 -1
  25. package/lib/cjs/components/card/index.js +9 -5
  26. package/lib/cjs/components/card/index.js.map +1 -1
  27. package/lib/cjs/components/checkbox/checkbox.js +44 -63
  28. package/lib/cjs/components/checkbox/checkbox.js.map +1 -1
  29. package/lib/cjs/components/checkbox/index.js +9 -5
  30. package/lib/cjs/components/checkbox/index.js.map +1 -1
  31. package/lib/cjs/components/checkbox/item.js +40 -56
  32. package/lib/cjs/components/checkbox/item.js.map +1 -1
  33. package/lib/cjs/components/collapse/collapse.js +77 -81
  34. package/lib/cjs/components/collapse/collapse.js.map +1 -1
  35. package/lib/cjs/components/collapse/index.js +9 -5
  36. package/lib/cjs/components/collapse/index.js.map +1 -1
  37. package/lib/cjs/components/collapse/item.js +9 -7
  38. package/lib/cjs/components/collapse/item.js.map +1 -1
  39. package/lib/cjs/components/datagrid/cell.js +26 -34
  40. package/lib/cjs/components/datagrid/cell.js.map +1 -1
  41. package/lib/cjs/components/datagrid/datagrid.js +118 -137
  42. package/lib/cjs/components/datagrid/datagrid.js.map +1 -1
  43. package/lib/cjs/components/datagrid/index.js +9 -5
  44. package/lib/cjs/components/datagrid/index.js.map +1 -1
  45. package/lib/cjs/components/datagrid/resize.js +41 -39
  46. package/lib/cjs/components/datagrid/resize.js.map +1 -1
  47. package/lib/cjs/components/datagrid/row.js +35 -62
  48. package/lib/cjs/components/datagrid/row.js.map +1 -1
  49. package/lib/cjs/components/datagrid/sorter.js +18 -25
  50. package/lib/cjs/components/datagrid/sorter.js.map +1 -1
  51. package/lib/cjs/components/description/description.js +33 -40
  52. package/lib/cjs/components/description/description.js.map +1 -1
  53. package/lib/cjs/components/description/index.js +9 -5
  54. package/lib/cjs/components/description/index.js.map +1 -1
  55. package/lib/cjs/components/drawer/drawer.js +71 -81
  56. package/lib/cjs/components/drawer/drawer.js.map +1 -1
  57. package/lib/cjs/components/drawer/index.js +9 -5
  58. package/lib/cjs/components/drawer/index.js.map +1 -1
  59. package/lib/cjs/components/dropdown/dropdown.js +30 -35
  60. package/lib/cjs/components/dropdown/dropdown.js.map +1 -1
  61. package/lib/cjs/components/dropdown/index.js +9 -5
  62. package/lib/cjs/components/dropdown/index.js.map +1 -1
  63. package/lib/cjs/components/dropdown/item.js +19 -33
  64. package/lib/cjs/components/dropdown/item.js.map +1 -1
  65. package/lib/cjs/components/editor/controls.js +84 -78
  66. package/lib/cjs/components/editor/controls.js.map +1 -1
  67. package/lib/cjs/components/editor/editor.js +86 -88
  68. package/lib/cjs/components/editor/editor.js.map +1 -1
  69. package/lib/cjs/components/editor/index.js +9 -5
  70. package/lib/cjs/components/editor/index.js.map +1 -1
  71. package/lib/cjs/components/flex/flex.js +33 -28
  72. package/lib/cjs/components/flex/flex.js.map +1 -1
  73. package/lib/cjs/components/flex/index.js +9 -5
  74. package/lib/cjs/components/flex/index.js.map +1 -1
  75. package/lib/cjs/components/form/context.js +9 -6
  76. package/lib/cjs/components/form/context.js.map +1 -1
  77. package/lib/cjs/components/form/field.js +74 -68
  78. package/lib/cjs/components/form/field.js.map +1 -1
  79. package/lib/cjs/components/form/form.js +65 -61
  80. package/lib/cjs/components/form/form.js.map +1 -1
  81. package/lib/cjs/components/form/index.js +9 -5
  82. package/lib/cjs/components/form/index.js.map +1 -1
  83. package/lib/cjs/components/form/useConfig.js +35 -42
  84. package/lib/cjs/components/form/useConfig.js.map +1 -1
  85. package/lib/cjs/components/form/useForm.js +139 -120
  86. package/lib/cjs/components/form/useForm.js.map +1 -1
  87. package/lib/cjs/components/icon/icon.js +28 -21
  88. package/lib/cjs/components/icon/icon.js.map +1 -1
  89. package/lib/cjs/components/icon/index.js +9 -5
  90. package/lib/cjs/components/icon/index.js.map +1 -1
  91. package/lib/cjs/components/image/image.js +84 -83
  92. package/lib/cjs/components/image/image.js.map +1 -1
  93. package/lib/cjs/components/image/index.js +9 -5
  94. package/lib/cjs/components/image/index.js.map +1 -1
  95. package/lib/cjs/components/image/list.js +44 -46
  96. package/lib/cjs/components/image/list.js.map +1 -1
  97. package/lib/cjs/components/input/container.js +19 -27
  98. package/lib/cjs/components/input/container.js.map +1 -1
  99. package/lib/cjs/components/input/index.js +9 -5
  100. package/lib/cjs/components/input/index.js.map +1 -1
  101. package/lib/cjs/components/input/input.js +80 -110
  102. package/lib/cjs/components/input/input.js.map +1 -1
  103. package/lib/cjs/components/input/number.js +115 -135
  104. package/lib/cjs/components/input/number.js.map +1 -1
  105. package/lib/cjs/components/input/range.js +79 -131
  106. package/lib/cjs/components/input/range.js.map +1 -1
  107. package/lib/cjs/components/input/textarea.js +54 -58
  108. package/lib/cjs/components/input/textarea.js.map +1 -1
  109. package/lib/cjs/components/list/index.js +9 -5
  110. package/lib/cjs/components/list/index.js.map +1 -1
  111. package/lib/cjs/components/list/item.js +20 -27
  112. package/lib/cjs/components/list/item.js.map +1 -1
  113. package/lib/cjs/components/list/list.js +30 -27
  114. package/lib/cjs/components/list/list.js.map +1 -1
  115. package/lib/cjs/components/loading/index.js +9 -5
  116. package/lib/cjs/components/loading/index.js.map +1 -1
  117. package/lib/cjs/components/loading/loading.js +22 -36
  118. package/lib/cjs/components/loading/loading.js.map +1 -1
  119. package/lib/cjs/components/message/index.js +9 -5
  120. package/lib/cjs/components/message/index.js.map +1 -1
  121. package/lib/cjs/components/message/message.js +162 -163
  122. package/lib/cjs/components/message/message.js.map +1 -1
  123. package/lib/cjs/components/modal/content.js +34 -54
  124. package/lib/cjs/components/modal/content.js.map +1 -1
  125. package/lib/cjs/components/modal/context.js +9 -6
  126. package/lib/cjs/components/modal/context.js.map +1 -1
  127. package/lib/cjs/components/modal/hookModal.js +28 -25
  128. package/lib/cjs/components/modal/hookModal.js.map +1 -1
  129. package/lib/cjs/components/modal/index.js +9 -5
  130. package/lib/cjs/components/modal/index.js.map +1 -1
  131. package/lib/cjs/components/modal/modal.js +96 -114
  132. package/lib/cjs/components/modal/modal.js.map +1 -1
  133. package/lib/cjs/components/modal/useModal.js +35 -36
  134. package/lib/cjs/components/modal/useModal.js.map +1 -1
  135. package/lib/cjs/components/pagination/index.js +9 -5
  136. package/lib/cjs/components/pagination/index.js.map +1 -1
  137. package/lib/cjs/components/pagination/page.js +29 -28
  138. package/lib/cjs/components/pagination/page.js.map +1 -1
  139. package/lib/cjs/components/pagination/pagination.js +49 -83
  140. package/lib/cjs/components/pagination/pagination.js.map +1 -1
  141. package/lib/cjs/components/picker/colors/footer.js +33 -58
  142. package/lib/cjs/components/picker/colors/footer.js.map +1 -1
  143. package/lib/cjs/components/picker/colors/handle.js +15 -22
  144. package/lib/cjs/components/picker/colors/handle.js.map +1 -1
  145. package/lib/cjs/components/picker/colors/index.js +64 -78
  146. package/lib/cjs/components/picker/colors/index.js.map +1 -1
  147. package/lib/cjs/components/picker/dates/dates.js +52 -65
  148. package/lib/cjs/components/picker/dates/dates.js.map +1 -1
  149. package/lib/cjs/components/picker/dates/index.js +65 -93
  150. package/lib/cjs/components/picker/dates/index.js.map +1 -1
  151. package/lib/cjs/components/picker/dates/panel.js +75 -146
  152. package/lib/cjs/components/picker/dates/panel.js.map +1 -1
  153. package/lib/cjs/components/picker/time/index.js +46 -69
  154. package/lib/cjs/components/picker/time/index.js.map +1 -1
  155. package/lib/cjs/components/picker/time/item.js +20 -17
  156. package/lib/cjs/components/picker/time/item.js.map +1 -1
  157. package/lib/cjs/components/picker/time/panel.js +99 -139
  158. package/lib/cjs/components/picker/time/panel.js.map +1 -1
  159. package/lib/cjs/components/popconfirm/index.js +9 -5
  160. package/lib/cjs/components/popconfirm/index.js.map +1 -1
  161. package/lib/cjs/components/popconfirm/popconfirm.js +52 -81
  162. package/lib/cjs/components/popconfirm/popconfirm.js.map +1 -1
  163. package/lib/cjs/components/popup/content.js +49 -54
  164. package/lib/cjs/components/popup/content.js.map +1 -1
  165. package/lib/cjs/components/popup/index.js +9 -5
  166. package/lib/cjs/components/popup/index.js.map +1 -1
  167. package/lib/cjs/components/popup/popup.js +502 -422
  168. package/lib/cjs/components/popup/popup.js.map +1 -1
  169. package/lib/cjs/components/progress/circle.js +13 -42
  170. package/lib/cjs/components/progress/circle.js.map +1 -1
  171. package/lib/cjs/components/progress/index.js +9 -5
  172. package/lib/cjs/components/progress/index.js.map +1 -1
  173. package/lib/cjs/components/progress/line.js +19 -24
  174. package/lib/cjs/components/progress/line.js.map +1 -1
  175. package/lib/cjs/components/progress/progress.js +87 -97
  176. package/lib/cjs/components/progress/progress.js.map +1 -1
  177. package/lib/cjs/components/radio/index.js +9 -5
  178. package/lib/cjs/components/radio/index.js.map +1 -1
  179. package/lib/cjs/components/radio/item.js +22 -31
  180. package/lib/cjs/components/radio/item.js.map +1 -1
  181. package/lib/cjs/components/radio/radio.js +37 -59
  182. package/lib/cjs/components/radio/radio.js.map +1 -1
  183. package/lib/cjs/components/resizable/index.js +9 -5
  184. package/lib/cjs/components/resizable/index.js.map +1 -1
  185. package/lib/cjs/components/resizable/resizable.js +65 -78
  186. package/lib/cjs/components/resizable/resizable.js.map +1 -1
  187. package/lib/cjs/components/river/index.js +9 -5
  188. package/lib/cjs/components/river/index.js.map +1 -1
  189. package/lib/cjs/components/river/river.js +111 -113
  190. package/lib/cjs/components/river/river.js.map +1 -1
  191. package/lib/cjs/components/select/index.js +9 -5
  192. package/lib/cjs/components/select/index.js.map +1 -1
  193. package/lib/cjs/components/select/options.js +47 -68
  194. package/lib/cjs/components/select/options.js.map +1 -1
  195. package/lib/cjs/components/select/select.js +100 -152
  196. package/lib/cjs/components/select/select.js.map +1 -1
  197. package/lib/cjs/components/step/divider.js +9 -7
  198. package/lib/cjs/components/step/divider.js.map +1 -1
  199. package/lib/cjs/components/step/index.js +9 -5
  200. package/lib/cjs/components/step/index.js.map +1 -1
  201. package/lib/cjs/components/step/item.js +25 -55
  202. package/lib/cjs/components/step/item.js.map +1 -1
  203. package/lib/cjs/components/step/step.js +41 -39
  204. package/lib/cjs/components/step/step.js.map +1 -1
  205. package/lib/cjs/components/swiper/index.js +9 -5
  206. package/lib/cjs/components/swiper/index.js.map +1 -1
  207. package/lib/cjs/components/swiper/item.js +30 -36
  208. package/lib/cjs/components/swiper/item.js.map +1 -1
  209. package/lib/cjs/components/swiper/swiper.js +238 -259
  210. package/lib/cjs/components/swiper/swiper.js.map +1 -1
  211. package/lib/cjs/components/tabs/index.js +9 -5
  212. package/lib/cjs/components/tabs/index.js.map +1 -1
  213. package/lib/cjs/components/tabs/item.js +9 -7
  214. package/lib/cjs/components/tabs/item.js.map +1 -1
  215. package/lib/cjs/components/tabs/tabs.js +225 -269
  216. package/lib/cjs/components/tabs/tabs.js.map +1 -1
  217. package/lib/cjs/components/tag/index.js +9 -5
  218. package/lib/cjs/components/tag/index.js.map +1 -1
  219. package/lib/cjs/components/tag/tag.js +23 -29
  220. package/lib/cjs/components/tag/tag.js.map +1 -1
  221. package/lib/cjs/components/text/highlight.js +29 -32
  222. package/lib/cjs/components/text/highlight.js.map +1 -1
  223. package/lib/cjs/components/text/index.js +9 -5
  224. package/lib/cjs/components/text/index.js.map +1 -1
  225. package/lib/cjs/components/text/number.js +28 -29
  226. package/lib/cjs/components/text/number.js.map +1 -1
  227. package/lib/cjs/components/text/text.js +39 -36
  228. package/lib/cjs/components/text/text.js.map +1 -1
  229. package/lib/cjs/components/text/time.js +21 -21
  230. package/lib/cjs/components/text/time.js.map +1 -1
  231. package/lib/cjs/components/tree/index.js +9 -5
  232. package/lib/cjs/components/tree/index.js.map +1 -1
  233. package/lib/cjs/components/tree/item.js +73 -129
  234. package/lib/cjs/components/tree/item.js.map +1 -1
  235. package/lib/cjs/components/tree/tree.js +129 -122
  236. package/lib/cjs/components/tree/tree.js.map +1 -1
  237. package/lib/cjs/components/upload/index.js +9 -5
  238. package/lib/cjs/components/upload/index.js.map +1 -1
  239. package/lib/cjs/components/upload/renderFile.js +63 -93
  240. package/lib/cjs/components/upload/renderFile.js.map +1 -1
  241. package/lib/cjs/components/upload/upload.js +123 -162
  242. package/lib/cjs/components/upload/upload.js.map +1 -1
  243. package/lib/cjs/components/utils/empty/index.js +16 -14
  244. package/lib/cjs/components/utils/empty/index.js.map +1 -1
  245. package/lib/cjs/components/utils/helpericon/helpericon.js +29 -21
  246. package/lib/cjs/components/utils/helpericon/helpericon.js.map +1 -1
  247. package/lib/cjs/components/utils/helpericon/index.js +9 -5
  248. package/lib/cjs/components/utils/helpericon/index.js.map +1 -1
  249. package/lib/cjs/components/video/index.js +9 -5
  250. package/lib/cjs/components/video/index.js.map +1 -1
  251. package/lib/cjs/components/video/video.js +178 -234
  252. package/lib/cjs/components/video/video.js.map +1 -1
  253. package/lib/cjs/index.js +88 -83
  254. package/lib/cjs/index.js.map +1 -0
  255. package/lib/cjs/js/hooks.js +212 -231
  256. package/lib/cjs/js/hooks.js.map +1 -1
  257. package/lib/cjs/js/usePreview/content.js +161 -194
  258. package/lib/cjs/js/usePreview/content.js.map +1 -1
  259. package/lib/cjs/js/usePreview/index.js +24 -36
  260. package/lib/cjs/js/usePreview/index.js.map +1 -1
  261. package/lib/cjs/js/usePreview/renderFile.js +21 -25
  262. package/lib/cjs/js/usePreview/renderFile.js.map +1 -1
  263. package/lib/cjs/js/usePreview/type.js +12 -14
  264. package/lib/cjs/js/usePreview/type.js.map +1 -1
  265. package/lib/cjs/js/useRipple/index.js +40 -34
  266. package/lib/cjs/js/useRipple/index.js.map +1 -1
  267. package/lib/cjs/js/useTheme/index.js +152 -27
  268. package/lib/cjs/js/useTheme/index.js.map +1 -1
  269. package/lib/cjs/js/utils.js +257 -239
  270. package/lib/cjs/js/utils.js.map +1 -1
  271. package/lib/css/colors.css +781 -0
  272. package/lib/css/index.css +3 -0
  273. package/lib/css/index.css.map +1 -0
  274. package/lib/css/input.css +192 -0
  275. package/lib/css/reset.css +153 -0
  276. package/lib/css/tokens.css +12 -0
  277. package/lib/css/utilities.css +1974 -0
  278. package/lib/es/components/affix/affix.js +59 -60
  279. package/lib/es/components/affix/affix.js.map +1 -1
  280. package/lib/es/components/affix/index.js +5 -6
  281. package/lib/es/components/affix/index.js.map +1 -1
  282. package/lib/es/components/affix/totop.js +10 -20
  283. package/lib/es/components/affix/totop.js.map +1 -1
  284. package/lib/es/components/badge/badge.js +10 -19
  285. package/lib/es/components/badge/badge.js.map +1 -1
  286. package/lib/es/components/badge/index.js +5 -6
  287. package/lib/es/components/badge/index.js.map +1 -1
  288. package/lib/es/components/button/button.js +57 -55
  289. package/lib/es/components/button/button.js.map +1 -1
  290. package/lib/es/components/button/confirm.js +47 -52
  291. package/lib/es/components/button/confirm.js.map +1 -1
  292. package/lib/es/components/button/group.js +18 -21
  293. package/lib/es/components/button/group.js.map +1 -1
  294. package/lib/es/components/button/index.js +5 -6
  295. package/lib/es/components/button/index.js.map +1 -1
  296. package/lib/es/components/button/toggle.js +36 -41
  297. package/lib/es/components/button/toggle.js.map +1 -1
  298. package/lib/es/components/card/card.js +10 -28
  299. package/lib/es/components/card/card.js.map +1 -1
  300. package/lib/es/components/card/index.js +5 -6
  301. package/lib/es/components/card/index.js.map +1 -1
  302. package/lib/es/components/checkbox/checkbox.js +35 -60
  303. package/lib/es/components/checkbox/checkbox.js.map +1 -1
  304. package/lib/es/components/checkbox/index.js +5 -6
  305. package/lib/es/components/checkbox/index.js.map +1 -1
  306. package/lib/es/components/checkbox/item.js +32 -54
  307. package/lib/es/components/checkbox/item.js.map +1 -1
  308. package/lib/es/components/collapse/collapse.js +68 -78
  309. package/lib/es/components/collapse/collapse.js.map +1 -1
  310. package/lib/es/components/collapse/index.js +5 -6
  311. package/lib/es/components/collapse/index.js.map +1 -1
  312. package/lib/es/components/collapse/item.js +5 -6
  313. package/lib/es/components/collapse/item.js.map +1 -1
  314. package/lib/es/components/datagrid/cell.js +20 -32
  315. package/lib/es/components/datagrid/cell.js.map +1 -1
  316. package/lib/es/components/datagrid/datagrid.js +110 -135
  317. package/lib/es/components/datagrid/datagrid.js.map +1 -1
  318. package/lib/es/components/datagrid/index.js +5 -6
  319. package/lib/es/components/datagrid/index.js.map +1 -1
  320. package/lib/es/components/datagrid/resize.js +37 -38
  321. package/lib/es/components/datagrid/resize.js.map +1 -1
  322. package/lib/es/components/datagrid/row.js +27 -60
  323. package/lib/es/components/datagrid/row.js.map +1 -1
  324. package/lib/es/components/datagrid/sorter.js +10 -23
  325. package/lib/es/components/datagrid/sorter.js.map +1 -1
  326. package/lib/es/components/description/description.js +25 -38
  327. package/lib/es/components/description/description.js.map +1 -1
  328. package/lib/es/components/description/index.js +5 -6
  329. package/lib/es/components/description/index.js.map +1 -1
  330. package/lib/es/components/drawer/drawer.js +63 -79
  331. package/lib/es/components/drawer/drawer.js.map +1 -1
  332. package/lib/es/components/drawer/index.js +5 -6
  333. package/lib/es/components/drawer/index.js.map +1 -1
  334. package/lib/es/components/dropdown/dropdown.js +25 -33
  335. package/lib/es/components/dropdown/dropdown.js.map +1 -1
  336. package/lib/es/components/dropdown/index.js +5 -6
  337. package/lib/es/components/dropdown/index.js.map +1 -1
  338. package/lib/es/components/dropdown/item.js +15 -32
  339. package/lib/es/components/dropdown/item.js.map +1 -1
  340. package/lib/es/components/editor/controls.js +75 -75
  341. package/lib/es/components/editor/controls.js.map +1 -1
  342. package/lib/es/components/editor/editor.js +77 -85
  343. package/lib/es/components/editor/editor.js.map +1 -1
  344. package/lib/es/components/editor/index.js +5 -6
  345. package/lib/es/components/editor/index.js.map +1 -1
  346. package/lib/es/components/flex/flex.js +25 -26
  347. package/lib/es/components/flex/flex.js.map +1 -1
  348. package/lib/es/components/flex/index.js +5 -6
  349. package/lib/es/components/flex/index.js.map +1 -1
  350. package/lib/es/components/form/context.js +4 -5
  351. package/lib/es/components/form/context.js.map +1 -1
  352. package/lib/es/components/form/field.js +66 -66
  353. package/lib/es/components/form/field.js.map +1 -1
  354. package/lib/es/components/form/form.js +53 -55
  355. package/lib/es/components/form/form.js.map +1 -1
  356. package/lib/es/components/form/index.js +5 -6
  357. package/lib/es/components/form/index.js.map +1 -1
  358. package/lib/es/components/form/useConfig.js +31 -41
  359. package/lib/es/components/form/useConfig.js.map +1 -1
  360. package/lib/es/components/form/useForm.js +130 -118
  361. package/lib/es/components/form/useForm.js.map +1 -1
  362. package/lib/es/components/icon/icon.js +20 -19
  363. package/lib/es/components/icon/icon.js.map +1 -1
  364. package/lib/es/components/icon/index.js +5 -6
  365. package/lib/es/components/icon/index.js.map +1 -1
  366. package/lib/es/components/image/image.js +75 -80
  367. package/lib/es/components/image/image.js.map +1 -1
  368. package/lib/es/components/image/index.js +5 -6
  369. package/lib/es/components/image/index.js.map +1 -1
  370. package/lib/es/components/image/list.js +40 -45
  371. package/lib/es/components/image/list.js.map +1 -1
  372. package/lib/es/components/input/container.js +11 -25
  373. package/lib/es/components/input/container.js.map +1 -1
  374. package/lib/es/components/input/index.js +5 -6
  375. package/lib/es/components/input/index.js.map +1 -1
  376. package/lib/es/components/input/input.js +69 -105
  377. package/lib/es/components/input/input.js.map +1 -1
  378. package/lib/es/components/input/number.js +107 -133
  379. package/lib/es/components/input/number.js.map +1 -1
  380. package/lib/es/components/input/range.js +71 -129
  381. package/lib/es/components/input/range.js.map +1 -1
  382. package/lib/es/components/input/textarea.js +46 -56
  383. package/lib/es/components/input/textarea.js.map +1 -1
  384. package/lib/es/components/list/index.js +5 -6
  385. package/lib/es/components/list/index.js.map +1 -1
  386. package/lib/es/components/list/item.js +12 -25
  387. package/lib/es/components/list/item.js.map +1 -1
  388. package/lib/es/components/list/list.js +21 -24
  389. package/lib/es/components/list/list.js.map +1 -1
  390. package/lib/es/components/loading/index.js +5 -6
  391. package/lib/es/components/loading/index.js.map +1 -1
  392. package/lib/es/components/loading/loading.js +14 -34
  393. package/lib/es/components/loading/loading.js.map +1 -1
  394. package/lib/es/components/message/index.js +5 -6
  395. package/lib/es/components/message/index.js.map +1 -1
  396. package/lib/es/components/message/message.js +154 -161
  397. package/lib/es/components/message/message.js.map +1 -1
  398. package/lib/es/components/modal/content.js +30 -53
  399. package/lib/es/components/modal/content.js.map +1 -1
  400. package/lib/es/components/modal/context.js +4 -5
  401. package/lib/es/components/modal/context.js.map +1 -1
  402. package/lib/es/components/modal/hookModal.js +24 -24
  403. package/lib/es/components/modal/hookModal.js.map +1 -1
  404. package/lib/es/components/modal/index.js +5 -6
  405. package/lib/es/components/modal/index.js.map +1 -1
  406. package/lib/es/components/modal/modal.js +87 -111
  407. package/lib/es/components/modal/modal.js.map +1 -1
  408. package/lib/es/components/modal/useModal.js +31 -35
  409. package/lib/es/components/modal/useModal.js.map +1 -1
  410. package/lib/es/components/pagination/index.js +5 -6
  411. package/lib/es/components/pagination/index.js.map +1 -1
  412. package/lib/es/components/pagination/page.js +21 -26
  413. package/lib/es/components/pagination/page.js.map +1 -1
  414. package/lib/es/components/pagination/pagination.js +41 -81
  415. package/lib/es/components/pagination/pagination.js.map +1 -1
  416. package/lib/es/components/picker/colors/footer.js +29 -57
  417. package/lib/es/components/picker/colors/footer.js.map +1 -1
  418. package/lib/es/components/picker/colors/handle.js +7 -20
  419. package/lib/es/components/picker/colors/handle.js.map +1 -1
  420. package/lib/es/components/picker/colors/index.js +56 -76
  421. package/lib/es/components/picker/colors/index.js.map +1 -1
  422. package/lib/es/components/picker/dates/dates.js +43 -62
  423. package/lib/es/components/picker/dates/dates.js.map +1 -1
  424. package/lib/es/components/picker/dates/index.js +54 -88
  425. package/lib/es/components/picker/dates/index.js.map +1 -1
  426. package/lib/es/components/picker/dates/panel.js +66 -143
  427. package/lib/es/components/picker/dates/panel.js.map +1 -1
  428. package/lib/es/components/picker/time/index.js +38 -67
  429. package/lib/es/components/picker/time/index.js.map +1 -1
  430. package/lib/es/components/picker/time/item.js +12 -15
  431. package/lib/es/components/picker/time/item.js.map +1 -1
  432. package/lib/es/components/picker/time/panel.js +95 -138
  433. package/lib/es/components/picker/time/panel.js.map +1 -1
  434. package/lib/es/components/popconfirm/index.js +5 -6
  435. package/lib/es/components/popconfirm/index.js.map +1 -1
  436. package/lib/es/components/popconfirm/popconfirm.js +48 -80
  437. package/lib/es/components/popconfirm/popconfirm.js.map +1 -1
  438. package/lib/es/components/popup/content.js +40 -51
  439. package/lib/es/components/popup/content.js.map +1 -1
  440. package/lib/es/components/popup/index.js +5 -6
  441. package/lib/es/components/popup/index.js.map +1 -1
  442. package/lib/es/components/popup/popup.js +498 -421
  443. package/lib/es/components/popup/popup.js.map +1 -1
  444. package/lib/es/components/progress/circle.js +9 -41
  445. package/lib/es/components/progress/circle.js.map +1 -1
  446. package/lib/es/components/progress/index.js +5 -6
  447. package/lib/es/components/progress/index.js.map +1 -1
  448. package/lib/es/components/progress/line.js +11 -22
  449. package/lib/es/components/progress/line.js.map +1 -1
  450. package/lib/es/components/progress/progress.js +79 -95
  451. package/lib/es/components/progress/progress.js.map +1 -1
  452. package/lib/es/components/radio/index.js +5 -6
  453. package/lib/es/components/radio/index.js.map +1 -1
  454. package/lib/es/components/radio/item.js +14 -29
  455. package/lib/es/components/radio/item.js.map +1 -1
  456. package/lib/es/components/radio/radio.js +28 -56
  457. package/lib/es/components/radio/radio.js.map +1 -1
  458. package/lib/es/components/resizable/index.js +5 -6
  459. package/lib/es/components/resizable/index.js.map +1 -1
  460. package/lib/es/components/resizable/resizable.js +57 -76
  461. package/lib/es/components/resizable/resizable.js.map +1 -1
  462. package/lib/es/components/river/index.js +5 -6
  463. package/lib/es/components/river/index.js.map +1 -1
  464. package/lib/es/components/river/river.js +103 -111
  465. package/lib/es/components/river/river.js.map +1 -1
  466. package/lib/es/components/select/index.js +5 -6
  467. package/lib/es/components/select/index.js.map +1 -1
  468. package/lib/es/components/select/options.js +40 -66
  469. package/lib/es/components/select/options.js.map +1 -1
  470. package/lib/es/components/select/select.js +92 -150
  471. package/lib/es/components/select/select.js.map +1 -1
  472. package/lib/es/components/step/divider.js +5 -6
  473. package/lib/es/components/step/divider.js.map +1 -1
  474. package/lib/es/components/step/index.js +5 -6
  475. package/lib/es/components/step/index.js.map +1 -1
  476. package/lib/es/components/step/item.js +17 -53
  477. package/lib/es/components/step/item.js.map +1 -1
  478. package/lib/es/components/step/step.js +32 -36
  479. package/lib/es/components/step/step.js.map +1 -1
  480. package/lib/es/components/swiper/index.js +5 -6
  481. package/lib/es/components/swiper/index.js.map +1 -1
  482. package/lib/es/components/swiper/item.js +22 -34
  483. package/lib/es/components/swiper/item.js.map +1 -1
  484. package/lib/es/components/swiper/swiper.js +229 -256
  485. package/lib/es/components/swiper/swiper.js.map +1 -1
  486. package/lib/es/components/tabs/index.js +5 -6
  487. package/lib/es/components/tabs/index.js.map +1 -1
  488. package/lib/es/components/tabs/item.js +5 -6
  489. package/lib/es/components/tabs/item.js.map +1 -1
  490. package/lib/es/components/tabs/tabs.js +216 -266
  491. package/lib/es/components/tabs/tabs.js.map +1 -1
  492. package/lib/es/components/tag/index.js +5 -6
  493. package/lib/es/components/tag/index.js.map +1 -1
  494. package/lib/es/components/tag/tag.js +15 -27
  495. package/lib/es/components/tag/tag.js.map +1 -1
  496. package/lib/es/components/text/highlight.js +25 -31
  497. package/lib/es/components/text/highlight.js.map +1 -1
  498. package/lib/es/components/text/index.js +5 -6
  499. package/lib/es/components/text/index.js.map +1 -1
  500. package/lib/es/components/text/number.js +24 -28
  501. package/lib/es/components/text/number.js.map +1 -1
  502. package/lib/es/components/text/text.js +28 -31
  503. package/lib/es/components/text/text.js.map +1 -1
  504. package/lib/es/components/text/time.js +17 -20
  505. package/lib/es/components/text/time.js.map +1 -1
  506. package/lib/es/components/tree/index.js +5 -6
  507. package/lib/es/components/tree/index.js.map +1 -1
  508. package/lib/es/components/tree/item.js +66 -127
  509. package/lib/es/components/tree/item.js.map +1 -1
  510. package/lib/es/components/tree/tree.js +125 -121
  511. package/lib/es/components/tree/tree.js.map +1 -1
  512. package/lib/es/components/upload/index.js +5 -6
  513. package/lib/es/components/upload/index.js.map +1 -1
  514. package/lib/es/components/upload/renderFile.js +55 -91
  515. package/lib/es/components/upload/renderFile.js.map +1 -1
  516. package/lib/es/components/upload/upload.js +115 -160
  517. package/lib/es/components/upload/upload.js.map +1 -1
  518. package/lib/es/components/utils/empty/index.js +8 -12
  519. package/lib/es/components/utils/empty/index.js.map +1 -1
  520. package/lib/es/components/utils/helpericon/helpericon.js +21 -19
  521. package/lib/es/components/utils/helpericon/helpericon.js.map +1 -1
  522. package/lib/es/components/utils/helpericon/index.js +5 -6
  523. package/lib/es/components/utils/helpericon/index.js.map +1 -1
  524. package/lib/es/components/video/index.js +5 -6
  525. package/lib/es/components/video/index.js.map +1 -1
  526. package/lib/es/components/video/video.js +170 -232
  527. package/lib/es/components/video/video.js.map +1 -1
  528. package/lib/es/index.js +42 -42
  529. package/lib/es/index.js.map +1 -0
  530. package/lib/es/js/hooks.js +210 -229
  531. package/lib/es/js/hooks.js.map +1 -1
  532. package/lib/es/js/usePreview/content.js +153 -192
  533. package/lib/es/js/usePreview/content.js.map +1 -1
  534. package/lib/es/js/usePreview/index.js +20 -35
  535. package/lib/es/js/usePreview/index.js.map +1 -1
  536. package/lib/es/js/usePreview/renderFile.js +17 -24
  537. package/lib/es/js/usePreview/renderFile.js.map +1 -1
  538. package/lib/es/js/usePreview/type.js +12 -14
  539. package/lib/es/js/usePreview/type.js.map +1 -1
  540. package/lib/es/js/useRipple/index.js +36 -34
  541. package/lib/es/js/useRipple/index.js.map +1 -1
  542. package/lib/es/js/useTheme/index.js +148 -26
  543. package/lib/es/js/useTheme/index.js.map +1 -1
  544. package/lib/es/js/utils.js +255 -238
  545. package/lib/es/js/utils.js.map +1 -1
  546. package/lib/index.js +5244 -0
  547. package/lib/types/components/affix/affix.d.ts +10 -0
  548. package/lib/types/components/affix/index.d.ts +5 -0
  549. package/lib/types/components/affix/totop.d.ts +6 -0
  550. package/lib/types/components/affix/type.d.ts +13 -0
  551. package/lib/types/components/badge/badge.d.ts +6 -0
  552. package/lib/types/components/badge/index.d.ts +5 -0
  553. package/lib/types/components/badge/type.d.ts +15 -0
  554. package/lib/types/components/button/button.d.ts +5 -0
  555. package/lib/types/components/button/confirm.d.ts +6 -0
  556. package/lib/types/components/button/group.d.ts +6 -0
  557. package/lib/types/components/button/index.d.ts +5 -0
  558. package/lib/types/components/button/toggle.d.ts +6 -0
  559. package/lib/types/components/button/type.d.ts +53 -0
  560. package/lib/types/components/card/card.d.ts +6 -0
  561. package/lib/types/components/card/index.d.ts +5 -0
  562. package/lib/types/components/card/type.d.ts +13 -0
  563. package/lib/types/components/checkbox/checkbox.d.ts +10 -0
  564. package/lib/types/components/checkbox/index.d.ts +5 -0
  565. package/lib/types/components/checkbox/item.d.ts +6 -0
  566. package/lib/types/components/checkbox/type.d.ts +24 -0
  567. package/lib/types/components/collapse/collapse.d.ts +10 -0
  568. package/lib/types/components/collapse/index.d.ts +5 -0
  569. package/lib/types/components/collapse/item.d.ts +6 -0
  570. package/lib/types/components/collapse/type.d.ts +23 -0
  571. package/lib/types/components/datagrid/datagrid.d.ts +6 -0
  572. package/lib/types/components/datagrid/index.d.ts +5 -0
  573. package/lib/types/components/datagrid/type.d.ts +40 -0
  574. package/lib/types/components/description/description.d.ts +6 -0
  575. package/lib/types/components/description/index.d.ts +5 -0
  576. package/lib/types/components/description/type.d.ts +25 -0
  577. package/lib/types/components/drawer/drawer.d.ts +6 -0
  578. package/lib/types/components/drawer/index.d.ts +5 -0
  579. package/lib/types/components/drawer/type.d.ts +16 -0
  580. package/lib/types/components/dropdown/dropdown.d.ts +10 -0
  581. package/lib/types/components/dropdown/index.d.ts +5 -0
  582. package/lib/types/components/dropdown/type.d.ts +14 -0
  583. package/lib/types/components/editor/editor.d.ts +6 -0
  584. package/lib/types/components/editor/index.d.ts +5 -0
  585. package/lib/types/components/editor/type.d.ts +20 -0
  586. package/lib/types/components/flex/flex.d.ts +5 -0
  587. package/lib/types/components/flex/index.d.ts +5 -0
  588. package/lib/types/components/flex/type.d.ts +13 -0
  589. package/lib/types/components/form/field.d.ts +6 -0
  590. package/lib/types/components/form/form.d.ts +14 -0
  591. package/lib/types/components/form/index.d.ts +5 -0
  592. package/lib/types/components/form/type.d.ts +43 -0
  593. package/lib/types/components/form/useConfig.d.ts +10 -0
  594. package/lib/types/components/form/useForm.d.ts +17 -0
  595. package/lib/types/components/icon/icon.d.ts +6 -0
  596. package/lib/types/components/icon/index.d.ts +5 -0
  597. package/lib/types/components/icon/type.d.ts +12 -0
  598. package/lib/types/components/image/image.d.ts +5 -0
  599. package/lib/types/components/image/index.d.ts +5 -0
  600. package/lib/types/components/image/list.d.ts +6 -0
  601. package/lib/types/components/image/type.d.ts +33 -0
  602. package/lib/types/components/input/index.d.ts +5 -0
  603. package/lib/types/components/input/input.d.ts +5 -0
  604. package/lib/types/components/input/number.d.ts +6 -0
  605. package/lib/types/components/input/range.d.ts +6 -0
  606. package/lib/types/components/input/textarea.d.ts +6 -0
  607. package/lib/types/components/input/type.d.ts +53 -0
  608. package/lib/types/components/list/index.d.ts +5 -0
  609. package/lib/types/components/list/list.d.ts +9 -0
  610. package/lib/types/components/list/type.d.ts +16 -0
  611. package/lib/types/components/loading/index.d.ts +5 -0
  612. package/lib/types/components/loading/loading.d.ts +6 -0
  613. package/lib/types/components/loading/type.d.ts +10 -0
  614. package/lib/types/components/message/index.d.ts +5 -0
  615. package/lib/types/components/message/message.d.ts +28 -0
  616. package/lib/types/components/message/type.d.ts +21 -0
  617. package/lib/types/components/modal/index.d.ts +5 -0
  618. package/lib/types/components/modal/modal.d.ts +5 -0
  619. package/lib/types/components/modal/type.d.ts +31 -0
  620. package/lib/types/components/modal/useModal.d.ts +9 -0
  621. package/lib/types/components/pagination/index.d.ts +5 -0
  622. package/lib/types/components/pagination/pagination.d.ts +6 -0
  623. package/lib/types/components/pagination/type.d.ts +18 -0
  624. package/lib/types/components/picker/colors/index.d.ts +6 -0
  625. package/lib/types/components/picker/dates/index.d.ts +6 -0
  626. package/lib/types/components/picker/time/index.d.ts +6 -0
  627. package/lib/types/components/picker/type.d.ts +41 -0
  628. package/lib/types/components/popconfirm/index.d.ts +5 -0
  629. package/lib/types/components/popconfirm/popconfirm.d.ts +6 -0
  630. package/lib/types/components/popconfirm/type.d.ts +14 -0
  631. package/lib/types/components/popup/index.d.ts +5 -0
  632. package/lib/types/components/popup/popup.d.ts +6 -0
  633. package/lib/types/components/popup/type.d.ts +24 -0
  634. package/lib/types/components/progress/index.d.ts +5 -0
  635. package/lib/types/components/progress/progress.d.ts +6 -0
  636. package/lib/types/components/progress/type.d.ts +23 -0
  637. package/lib/types/components/radio/index.d.ts +5 -0
  638. package/lib/types/components/radio/item.d.ts +6 -0
  639. package/lib/types/components/radio/radio.d.ts +10 -0
  640. package/lib/types/components/radio/type.d.ts +20 -0
  641. package/lib/types/components/resizable/index.d.ts +5 -0
  642. package/lib/types/components/resizable/resizable.d.ts +6 -0
  643. package/lib/types/components/resizable/type.d.ts +19 -0
  644. package/lib/types/components/river/index.d.ts +5 -0
  645. package/lib/types/components/river/river.d.ts +6 -0
  646. package/lib/types/components/river/type.d.ts +8 -0
  647. package/lib/types/components/select/index.d.ts +5 -0
  648. package/lib/types/components/select/select.d.ts +6 -0
  649. package/lib/types/components/select/type.d.ts +22 -0
  650. package/lib/types/components/step/index.d.ts +5 -0
  651. package/lib/types/components/step/item.d.ts +6 -0
  652. package/lib/types/components/step/step.d.ts +10 -0
  653. package/lib/types/components/step/type.d.ts +19 -0
  654. package/lib/types/components/swiper/index.d.ts +5 -0
  655. package/lib/types/components/swiper/item.d.ts +6 -0
  656. package/lib/types/components/swiper/swiper.d.ts +5 -0
  657. package/lib/types/components/swiper/type.d.ts +52 -0
  658. package/lib/types/components/tabs/index.d.ts +5 -0
  659. package/lib/types/components/tabs/item.d.ts +6 -0
  660. package/lib/types/components/tabs/tabs.d.ts +5 -0
  661. package/lib/types/components/tabs/type.d.ts +43 -0
  662. package/lib/types/components/tag/index.d.ts +5 -0
  663. package/lib/types/components/tag/tag.d.ts +6 -0
  664. package/lib/types/components/tag/type.d.ts +14 -0
  665. package/lib/types/components/text/highlight.d.ts +6 -0
  666. package/lib/types/components/text/index.d.ts +5 -0
  667. package/lib/types/components/text/number.d.ts +6 -0
  668. package/lib/types/components/text/text.d.ts +5 -0
  669. package/lib/types/components/text/time.d.ts +6 -0
  670. package/lib/types/components/text/type.d.ts +43 -0
  671. package/lib/types/components/tree/index.d.ts +5 -0
  672. package/lib/types/components/tree/tree.d.ts +6 -0
  673. package/lib/types/components/tree/type.d.ts +48 -0
  674. package/lib/types/components/upload/index.d.ts +5 -0
  675. package/lib/types/components/upload/type.d.ts +37 -0
  676. package/lib/types/components/upload/upload.d.ts +6 -0
  677. package/lib/types/components/video/index.d.ts +5 -0
  678. package/lib/types/components/video/type.d.ts +27 -0
  679. package/lib/types/components/video/video.d.ts +6 -0
  680. package/lib/types/index.d.ts +41 -0
  681. package/lib/types/js/usePreview/index.d.ts +5 -0
  682. package/lib/types/js/usePreview/type.d.ts +30 -0
  683. package/lib/types/js/useTheme/index.d.ts +9 -0
  684. package/lib/types/js/useTheme/type.d.ts +7 -0
  685. package/lib/types/type/index.d.ts +28 -0
  686. package/package.json +98 -95
  687. package/lib/cjs/_virtual/_rolldown/runtime.js +0 -23
  688. package/lib/types/components/affix/affix.js +0 -62
  689. package/lib/types/components/affix/index.js +0 -5
  690. package/lib/types/components/affix/totop.js +0 -21
  691. package/lib/types/components/badge/badge.js +0 -20
  692. package/lib/types/components/badge/index.js +0 -5
  693. package/lib/types/components/button/button.js +0 -60
  694. package/lib/types/components/button/confirm.js +0 -57
  695. package/lib/types/components/button/group.js +0 -22
  696. package/lib/types/components/button/index.js +0 -5
  697. package/lib/types/components/button/toggle.js +0 -42
  698. package/lib/types/components/card/card.js +0 -29
  699. package/lib/types/components/card/index.js +0 -5
  700. package/lib/types/components/checkbox/checkbox.js +0 -62
  701. package/lib/types/components/checkbox/index.js +0 -5
  702. package/lib/types/components/checkbox/item.js +0 -55
  703. package/lib/types/components/collapse/collapse.js +0 -80
  704. package/lib/types/components/collapse/index.js +0 -5
  705. package/lib/types/components/collapse/item.js +0 -7
  706. package/lib/types/components/datagrid/cell.js +0 -34
  707. package/lib/types/components/datagrid/datagrid.js +0 -136
  708. package/lib/types/components/datagrid/index.js +0 -5
  709. package/lib/types/components/datagrid/resize.js +0 -39
  710. package/lib/types/components/datagrid/row.js +0 -63
  711. package/lib/types/components/datagrid/sorter.js +0 -24
  712. package/lib/types/components/description/description.js +0 -39
  713. package/lib/types/components/description/index.js +0 -5
  714. package/lib/types/components/drawer/drawer.js +0 -80
  715. package/lib/types/components/drawer/index.js +0 -5
  716. package/lib/types/components/dropdown/dropdown.js +0 -35
  717. package/lib/types/components/dropdown/index.js +0 -5
  718. package/lib/types/components/dropdown/item.js +0 -33
  719. package/lib/types/components/editor/controls.js +0 -83
  720. package/lib/types/components/editor/editor.js +0 -86
  721. package/lib/types/components/editor/index.js +0 -5
  722. package/lib/types/components/flex/flex.js +0 -27
  723. package/lib/types/components/flex/index.js +0 -5
  724. package/lib/types/components/form/context.js +0 -5
  725. package/lib/types/components/form/field.js +0 -67
  726. package/lib/types/components/form/form.js +0 -59
  727. package/lib/types/components/form/index.js +0 -5
  728. package/lib/types/components/form/useConfig.js +0 -42
  729. package/lib/types/components/form/useForm.js +0 -119
  730. package/lib/types/components/icon/icon.js +0 -20
  731. package/lib/types/components/icon/index.js +0 -5
  732. package/lib/types/components/image/image.js +0 -82
  733. package/lib/types/components/image/index.js +0 -5
  734. package/lib/types/components/image/list.js +0 -46
  735. package/lib/types/components/input/container.js +0 -26
  736. package/lib/types/components/input/index.js +0 -5
  737. package/lib/types/components/input/input.js +0 -109
  738. package/lib/types/components/input/number.js +0 -134
  739. package/lib/types/components/input/range.js +0 -130
  740. package/lib/types/components/input/textarea.js +0 -57
  741. package/lib/types/components/list/index.js +0 -5
  742. package/lib/types/components/list/item.js +0 -26
  743. package/lib/types/components/list/list.js +0 -26
  744. package/lib/types/components/loading/index.js +0 -5
  745. package/lib/types/components/loading/loading.js +0 -35
  746. package/lib/types/components/message/index.js +0 -5
  747. package/lib/types/components/message/message.js +0 -193
  748. package/lib/types/components/modal/content.js +0 -54
  749. package/lib/types/components/modal/context.js +0 -5
  750. package/lib/types/components/modal/hookModal.js +0 -25
  751. package/lib/types/components/modal/index.js +0 -5
  752. package/lib/types/components/modal/modal.js +0 -113
  753. package/lib/types/components/modal/useModal.js +0 -36
  754. package/lib/types/components/pagination/index.js +0 -5
  755. package/lib/types/components/pagination/page.js +0 -27
  756. package/lib/types/components/pagination/pagination.js +0 -82
  757. package/lib/types/components/picker/colors/footer.js +0 -60
  758. package/lib/types/components/picker/colors/handle.js +0 -21
  759. package/lib/types/components/picker/colors/index.js +0 -77
  760. package/lib/types/components/picker/dates/dates.js +0 -63
  761. package/lib/types/components/picker/dates/index.js +0 -91
  762. package/lib/types/components/picker/dates/panel.js +0 -146
  763. package/lib/types/components/picker/time/index.js +0 -69
  764. package/lib/types/components/picker/time/item.js +0 -16
  765. package/lib/types/components/picker/time/panel.js +0 -141
  766. package/lib/types/components/popconfirm/index.js +0 -5
  767. package/lib/types/components/popconfirm/popconfirm.js +0 -83
  768. package/lib/types/components/popup/content.js +0 -52
  769. package/lib/types/components/popup/index.js +0 -5
  770. package/lib/types/components/popup/popup.js +0 -422
  771. package/lib/types/components/progress/circle.js +0 -42
  772. package/lib/types/components/progress/index.js +0 -5
  773. package/lib/types/components/progress/line.js +0 -23
  774. package/lib/types/components/progress/progress.js +0 -96
  775. package/lib/types/components/radio/index.js +0 -5
  776. package/lib/types/components/radio/item.js +0 -30
  777. package/lib/types/components/radio/radio.js +0 -58
  778. package/lib/types/components/resizable/index.js +0 -5
  779. package/lib/types/components/resizable/resizable.js +0 -77
  780. package/lib/types/components/river/index.js +0 -5
  781. package/lib/types/components/river/river.js +0 -112
  782. package/lib/types/components/select/index.js +0 -5
  783. package/lib/types/components/select/options.js +0 -71
  784. package/lib/types/components/select/select.js +0 -151
  785. package/lib/types/components/step/divider.js +0 -7
  786. package/lib/types/components/step/index.js +0 -5
  787. package/lib/types/components/step/item.js +0 -56
  788. package/lib/types/components/step/step.js +0 -38
  789. package/lib/types/components/swiper/index.js +0 -5
  790. package/lib/types/components/swiper/item.js +0 -35
  791. package/lib/types/components/swiper/swiper.js +0 -258
  792. package/lib/types/components/tabs/index.js +0 -5
  793. package/lib/types/components/tabs/item.js +0 -7
  794. package/lib/types/components/tabs/tabs.js +0 -268
  795. package/lib/types/components/tag/index.js +0 -5
  796. package/lib/types/components/tag/tag.js +0 -28
  797. package/lib/types/components/text/highlight.js +0 -32
  798. package/lib/types/components/text/index.js +0 -5
  799. package/lib/types/components/text/number.js +0 -29
  800. package/lib/types/components/text/text.js +0 -35
  801. package/lib/types/components/text/time.js +0 -21
  802. package/lib/types/components/tree/index.js +0 -5
  803. package/lib/types/components/tree/item.js +0 -132
  804. package/lib/types/components/tree/tree.js +0 -124
  805. package/lib/types/components/upload/index.js +0 -5
  806. package/lib/types/components/upload/renderFile.js +0 -94
  807. package/lib/types/components/upload/upload.js +0 -161
  808. package/lib/types/components/utils/empty/index.js +0 -13
  809. package/lib/types/components/utils/helpericon/helpericon.js +0 -20
  810. package/lib/types/components/utils/helpericon/index.js +0 -5
  811. package/lib/types/components/video/index.js +0 -5
  812. package/lib/types/components/video/video.js +0 -233
  813. package/lib/types/index.js +0 -42
  814. package/lib/types/js/hooks.js +0 -249
  815. package/lib/types/js/usePreview/content.js +0 -193
  816. package/lib/types/js/usePreview/index.js +0 -36
  817. package/lib/types/js/usePreview/renderFile.js +0 -25
  818. package/lib/types/js/usePreview/type.js +0 -13
  819. package/lib/types/js/useRipple/index.js +0 -43
  820. package/lib/types/js/useTheme/index.js +0 -27
  821. package/lib/types/js/utils.js +0 -267
@@ -1,97 +1,69 @@
1
- const require_runtime = require("../../../_virtual/_rolldown/runtime.js");
2
- const require_index = require("../../icon/index.js");
3
- const require_index$1 = require("../../popup/index.js");
4
- const require_index$2 = require("../../input/index.js");
5
- const require_panel = require("./panel.js");
6
- let classnames = require("classnames");
7
- classnames = require_runtime.__toESM(classnames);
8
- let react = require("react");
9
- let _ricons_material = require("@ricons/material");
10
- let react_jsx_runtime = require("react/jsx-runtime");
11
- let dayjs = require("dayjs");
12
- dayjs = require_runtime.__toESM(dayjs);
13
- let _Users_iann_codes_ioca_react_node_modules__pnpm_dayjs_1_11_20_node_modules_dayjs_plugin_customParseFormat_js = require("/Users/iann/codes/ioca-react/node_modules/.pnpm/dayjs@1.11.20/node_modules/dayjs/plugin/customParseFormat.js");
14
- _Users_iann_codes_ioca_react_node_modules__pnpm_dayjs_1_11_20_node_modules_dayjs_plugin_customParseFormat_js = require_runtime.__toESM(_Users_iann_codes_ioca_react_node_modules__pnpm_dayjs_1_11_20_node_modules_dayjs_plugin_customParseFormat_js);
15
- //#region packages/components/picker/dates/index.tsx
16
- dayjs.default.extend(_Users_iann_codes_ioca_react_node_modules__pnpm_dayjs_1_11_20_node_modules_dayjs_plugin_customParseFormat_js.default);
17
- const FORMATTYPES = [
18
- "YYYY-MM-DD",
19
- "YYYY-M-D",
20
- "YYYY/MM/DD",
21
- "YYYY/M/D"
22
- ];
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+ var material = require('@ricons/material');
7
+ var classNames = require('classnames');
8
+ var dayjs = require('dayjs');
9
+ var customParseFormat = require('dayjs/plugin/customParseFormat.js');
10
+ var react = require('react');
11
+ var icon = require('../../icon/icon.js');
12
+ var input = require('../../input/input.js');
13
+ var popup = require('../../popup/popup.js');
14
+ var panel = require('./panel.js');
15
+
16
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
17
+
18
+ var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
19
+ var dayjs__default = /*#__PURE__*/_interopDefaultCompat(dayjs);
20
+ var customParseFormat__default = /*#__PURE__*/_interopDefaultCompat(customParseFormat);
21
+
22
+ dayjs__default.extend(customParseFormat__default);
23
+ const FORMATTYPES = ["YYYY-MM-DD", "YYYY-M-D", "YYYY/MM/DD", "YYYY/M/D"];
23
24
  const FORMAT = "YYYY-MM-DD";
24
25
  const Datepicker = (props) => {
25
- const { name, value, weeks, format = FORMAT, placeholder = props.format ?? FORMAT, className, renderDate, renderMonth, renderYear, popupProps, disabledDate, onDateClick, onChange, onBlur, ...restProps } = props;
26
- const [inputValue, setInputValue] = (0, react.useState)(value);
27
- const [active, setActive] = (0, react.useState)(false);
28
- const dayJsValue = (0, react.useMemo)(() => {
29
- if (!inputValue) return null;
30
- const date = (0, dayjs.default)(inputValue, format, true);
31
- if (date.isValid()) return date;
32
- return null;
33
- }, [inputValue, format]);
34
- const handleDateClick = (date) => {
35
- handleChange(date.format(format));
36
- };
37
- const handleChange = (v) => {
38
- setInputValue(v);
39
- onChange?.(v);
40
- };
41
- const handleSetDate = () => {
42
- if (!inputValue) return;
43
- const date = (0, dayjs.default)(inputValue, FORMATTYPES, true);
44
- if (date.isValid()) {
45
- handleChange(date.format(format));
46
- return;
47
- }
48
- handleChange("");
49
- };
50
- const handleBlur = (e) => {
51
- onBlur?.(e);
52
- handleSetDate();
53
- };
54
- const handleVisibleChange = (v) => {
55
- popupProps?.onVisibleChange?.(v);
56
- setActive(v);
57
- };
58
- (0, react.useEffect)(() => {
59
- setInputValue(value);
60
- }, [value]);
61
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index$1.default, {
62
- visible: active,
63
- trigger: "click",
64
- position: "bottom",
65
- arrow: false,
66
- align: "start",
67
- onVisibleChange: handleVisibleChange,
68
- content: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_panel.default, {
69
- value: dayJsValue,
70
- weeks,
71
- renderDate,
72
- renderMonth,
73
- renderYear,
74
- disabledDate,
75
- onDateClick: handleDateClick
76
- }),
77
- ...popupProps,
78
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index$2.default, {
79
- value: inputValue,
80
- append: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.default, {
81
- icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ricons_material.CalendarMonthTwotone, {}),
82
- className: "i-datepicker-icon",
83
- size: "1em"
84
- }),
85
- placeholder,
86
- onChange: handleChange,
87
- onBlur: handleBlur,
88
- onEnter: handleSetDate,
89
- className: (0, classnames.default)("i-datepicker-label", className),
90
- ...restProps
91
- })
92
- });
26
+ const { name, value, weeks, format = FORMAT, placeholder = props.format ?? FORMAT, className, renderDate, renderMonth, renderYear, popupProps, disabledDate, onDateClick, onChange, onBlur, ...restProps } = props;
27
+ const [inputValue, setInputValue] = react.useState(value);
28
+ const [active, setActive] = react.useState(false);
29
+ const dayJsValue = react.useMemo(() => {
30
+ if (!inputValue)
31
+ return null;
32
+ const date = dayjs__default(inputValue, format, true);
33
+ if (date.isValid())
34
+ return date;
35
+ return null;
36
+ }, [inputValue, format]);
37
+ const handleDateClick = (date) => {
38
+ handleChange(date.format(format));
39
+ };
40
+ const handleChange = (v) => {
41
+ setInputValue(v);
42
+ onChange?.(v);
43
+ };
44
+ const handleSetDate = () => {
45
+ if (!inputValue)
46
+ return;
47
+ const date = dayjs__default(inputValue, FORMATTYPES, true);
48
+ if (date.isValid()) {
49
+ handleChange(date.format(format));
50
+ return;
51
+ }
52
+ handleChange("");
53
+ };
54
+ const handleBlur = (e) => {
55
+ onBlur?.(e);
56
+ handleSetDate();
57
+ };
58
+ const handleVisibleChange = (v) => {
59
+ popupProps?.onVisibleChange?.(v);
60
+ setActive(v);
61
+ };
62
+ react.useEffect(() => {
63
+ setInputValue(value);
64
+ }, [value]);
65
+ return (jsxRuntime.jsx(popup.default, { visible: active, trigger: 'click', position: 'bottom', arrow: false, align: 'start', onVisibleChange: handleVisibleChange, content: jsxRuntime.jsx(panel.default, { value: dayJsValue, weeks: weeks, renderDate: renderDate, renderMonth: renderMonth, renderYear: renderYear, disabledDate: disabledDate, onDateClick: handleDateClick }), ...popupProps, children: jsxRuntime.jsx(input.default, { value: inputValue, append: jsxRuntime.jsx(icon.default, { icon: jsxRuntime.jsx(material.CalendarMonthTwotone, {}), className: 'i-datepicker-icon', size: '1em' }), placeholder: placeholder, onChange: handleChange, onBlur: handleBlur, onEnter: handleSetDate, className: classNames__default("i-datepicker-label", className), ...restProps }) }));
93
66
  };
94
- //#endregion
95
- exports.default = Datepicker;
96
67
 
97
- //# sourceMappingURL=index.js.map
68
+ exports.default = Datepicker;
69
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../packages/components/picker/dates/index.tsx"],"sourcesContent":["import { CalendarMonthTwotone } from \"@ricons/material\";\nimport classNames from \"classnames\";\nimport dayjs, { Dayjs } from \"dayjs\";\nimport customParseFormat from \"dayjs/plugin/customParseFormat.js\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport Icon from \"../../icon\";\nimport Input from \"../../input\";\nimport Popup from \"../../popup\";\nimport { IDatePicker } from \"../type\";\nimport \"./index.css\";\nimport Panel from \"./panel\";\n\ndayjs.extend(customParseFormat);\n\nconst FORMATTYPES = [\"YYYY-MM-DD\", \"YYYY-M-D\", \"YYYY/MM/DD\", \"YYYY/M/D\"];\nconst FORMAT = \"YYYY-MM-DD\";\n\nconst Datepicker = (props: IDatePicker) => {\n\tconst {\n\t\tname,\n\t\tvalue,\n\t\tweeks,\n\t\tformat = FORMAT,\n\t\tplaceholder = props.format ?? FORMAT,\n\t\tclassName,\n\t\trenderDate,\n\t\trenderMonth,\n\t\trenderYear,\n\t\tpopupProps,\n\t\tdisabledDate,\n\t\tonDateClick,\n\t\tonChange,\n\t\tonBlur,\n\t\t...restProps\n\t} = props;\n\n\tconst [inputValue, setInputValue] = useState(value);\n\n\tconst [active, setActive] = useState<boolean>(false);\n\n\tconst dayJsValue = useMemo(() => {\n\t\tif (!inputValue) return null;\n\n\t\tconst date = dayjs(inputValue as string, format, true);\n\n\t\tif (date.isValid()) return date;\n\n\t\treturn null;\n\t}, [inputValue, format]);\n\n\tconst handleDateClick = (date: Dayjs) => {\n\t\thandleChange(date.format(format));\n\t};\n\n\tconst handleChange = (v) => {\n\t\tsetInputValue(v);\n\t\tonChange?.(v);\n\t};\n\n\tconst handleSetDate = () => {\n\t\tif (!inputValue) return;\n\n\t\tconst date = dayjs(inputValue as string, FORMATTYPES, true);\n\n\t\tif (date.isValid()) {\n\t\t\thandleChange(date.format(format));\n\t\t\treturn;\n\t\t}\n\n\t\thandleChange(\"\");\n\t};\n\n\tconst handleBlur = (e) => {\n\t\tonBlur?.(e);\n\t\thandleSetDate();\n\t};\n\n\tconst handleVisibleChange = (v) => {\n\t\tpopupProps?.onVisibleChange?.(v);\n\t\tsetActive(v);\n\t};\n\n\tuseEffect(() => {\n\t\tsetInputValue(value);\n\t}, [value]);\n\n\treturn (\n\t\t<Popup\n\t\t\tvisible={active}\n\t\t\ttrigger='click'\n\t\t\tposition='bottom'\n\t\t\tarrow={false}\n\t\t\talign='start'\n\t\t\tonVisibleChange={handleVisibleChange}\n\t\t\tcontent={\n\t\t\t\t<Panel\n\t\t\t\t\tvalue={dayJsValue}\n\t\t\t\t\tweeks={weeks}\n\t\t\t\t\trenderDate={renderDate}\n\t\t\t\t\trenderMonth={renderMonth}\n\t\t\t\t\trenderYear={renderYear}\n\t\t\t\t\tdisabledDate={disabledDate}\n\t\t\t\t\tonDateClick={handleDateClick}\n\t\t\t\t/>\n\t\t\t}\n\t\t\t{...popupProps}\n\t\t>\n\t\t\t<Input\n\t\t\t\tvalue={inputValue}\n\t\t\t\tappend={\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={<CalendarMonthTwotone />}\n\t\t\t\t\t\tclassName='i-datepicker-icon'\n\t\t\t\t\t\tsize='1em'\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tplaceholder={placeholder}\n\t\t\t\tonChange={handleChange}\n\t\t\t\tonBlur={handleBlur}\n\t\t\t\tonEnter={handleSetDate}\n\t\t\t\tclassName={classNames(\"i-datepicker-label\", className)}\n\t\t\t\t{...restProps}\n\t\t\t/>\n\t\t</Popup>\n\t);\n};\n\nexport default Datepicker;\n"],"mappings":""}
1
+ {"version":3,"file":"index.js","sources":["../../../../../packages/components/picker/dates/index.tsx"],"sourcesContent":["import { CalendarMonthTwotone } from \"@ricons/material\";\r\nimport classNames from \"classnames\";\r\nimport dayjs, { Dayjs } from \"dayjs\";\r\nimport customParseFormat from \"dayjs/plugin/customParseFormat.js\";\r\nimport { useEffect, useMemo, useState } from \"react\";\r\nimport Icon from \"../../icon\";\r\nimport Input from \"../../input\";\r\nimport Popup from \"../../popup\";\r\nimport { IDatePicker } from \"../type\";\r\nimport \"./index.css\";\r\nimport Panel from \"./panel\";\r\n\r\ndayjs.extend(customParseFormat);\r\n\r\nconst FORMATTYPES = [\"YYYY-MM-DD\", \"YYYY-M-D\", \"YYYY/MM/DD\", \"YYYY/M/D\"];\r\nconst FORMAT = \"YYYY-MM-DD\";\r\n\r\nconst Datepicker = (props: IDatePicker) => {\r\n\tconst {\r\n\t\tname,\r\n\t\tvalue,\r\n\t\tweeks,\r\n\t\tformat = FORMAT,\r\n\t\tplaceholder = props.format ?? FORMAT,\r\n\t\tclassName,\r\n\t\trenderDate,\r\n\t\trenderMonth,\r\n\t\trenderYear,\r\n\t\tpopupProps,\r\n\t\tdisabledDate,\r\n\t\tonDateClick,\r\n\t\tonChange,\r\n\t\tonBlur,\r\n\t\t...restProps\r\n\t} = props;\r\n\r\n\tconst [inputValue, setInputValue] = useState(value);\r\n\r\n\tconst [active, setActive] = useState<boolean>(false);\r\n\r\n\tconst dayJsValue = useMemo(() => {\r\n\t\tif (!inputValue) return null;\r\n\r\n\t\tconst date = dayjs(inputValue as string, format, true);\r\n\r\n\t\tif (date.isValid()) return date;\r\n\r\n\t\treturn null;\r\n\t}, [inputValue, format]);\r\n\r\n\tconst handleDateClick = (date: Dayjs) => {\r\n\t\thandleChange(date.format(format));\r\n\t};\r\n\r\n\tconst handleChange = (v) => {\r\n\t\tsetInputValue(v);\r\n\t\tonChange?.(v);\r\n\t};\r\n\r\n\tconst handleSetDate = () => {\r\n\t\tif (!inputValue) return;\r\n\r\n\t\tconst date = dayjs(inputValue as string, FORMATTYPES, true);\r\n\r\n\t\tif (date.isValid()) {\r\n\t\t\thandleChange(date.format(format));\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\thandleChange(\"\");\r\n\t};\r\n\r\n\tconst handleBlur = (e) => {\r\n\t\tonBlur?.(e);\r\n\t\thandleSetDate();\r\n\t};\r\n\r\n\tconst handleVisibleChange = (v) => {\r\n\t\tpopupProps?.onVisibleChange?.(v);\r\n\t\tsetActive(v);\r\n\t};\r\n\r\n\tuseEffect(() => {\r\n\t\tsetInputValue(value);\r\n\t}, [value]);\r\n\r\n\treturn (\r\n\t\t<Popup\r\n\t\t\tvisible={active}\r\n\t\t\ttrigger='click'\r\n\t\t\tposition='bottom'\r\n\t\t\tarrow={false}\r\n\t\t\talign='start'\r\n\t\t\tonVisibleChange={handleVisibleChange}\r\n\t\t\tcontent={\r\n\t\t\t\t<Panel\r\n\t\t\t\t\tvalue={dayJsValue}\r\n\t\t\t\t\tweeks={weeks}\r\n\t\t\t\t\trenderDate={renderDate}\r\n\t\t\t\t\trenderMonth={renderMonth}\r\n\t\t\t\t\trenderYear={renderYear}\r\n\t\t\t\t\tdisabledDate={disabledDate}\r\n\t\t\t\t\tonDateClick={handleDateClick}\r\n\t\t\t\t/>\r\n\t\t\t}\r\n\t\t\t{...popupProps}\r\n\t\t>\r\n\t\t\t<Input\r\n\t\t\t\tvalue={inputValue}\r\n\t\t\t\tappend={\r\n\t\t\t\t\t<Icon\r\n\t\t\t\t\t\ticon={<CalendarMonthTwotone />}\r\n\t\t\t\t\t\tclassName='i-datepicker-icon'\r\n\t\t\t\t\t\tsize='1em'\r\n\t\t\t\t\t/>\r\n\t\t\t\t}\r\n\t\t\t\tplaceholder={placeholder}\r\n\t\t\t\tonChange={handleChange}\r\n\t\t\t\tonBlur={handleBlur}\r\n\t\t\t\tonEnter={handleSetDate}\r\n\t\t\t\tclassName={classNames(\"i-datepicker-label\", className)}\r\n\t\t\t\t{...restProps}\r\n\t\t\t/>\r\n\t\t</Popup>\r\n\t);\r\n};\r\n\r\nexport default Datepicker;\r\n"],"names":["dayjs","customParseFormat","useState","useMemo","useEffect","_jsx","Popup","Panel","Input","Icon","CalendarMonthTwotone","classNames"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAYAA,cAAK,CAAC,MAAM,CAACC,0BAAiB,CAAC;AAE/B,MAAM,WAAW,GAAG,CAAC,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,CAAC;AACxE,MAAM,MAAM,GAAG,YAAY;AAE3B,MAAM,UAAU,GAAG,CAAC,KAAkB,KAAI;AACzC,IAAA,MAAM,EACL,IAAI,EACJ,KAAK,EACL,KAAK,EACL,MAAM,GAAG,MAAM,EACf,WAAW,GAAG,KAAK,CAAC,MAAM,IAAI,MAA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time.js");
2
- const require_index = require("../../icon/index.js");
3
- const require_index$1 = require("../../utils/helpericon/index.js");
4
- const require_dates = require("./dates.js");
5
- let classnames = require("classnames");
6
- classnames = require_runtime.__toESM(classnames);
7
- let _Users_iann_codes_ioca_react_node_modules__pnpm_radash_12_1_1_node_modules_radash_dist_esm_index_mjs = require("/Users/iann/codes/ioca-react/node_modules/.pnpm/radash@12.1.1/node_modules/radash/dist/esm/index.mjs");
8
- let react = require("react");
9
- let _ricons_material = require("@ricons/material");
10
- let react_jsx_runtime = require("react/jsx-runtime");
11
- let dayjs = require("dayjs");
12
- dayjs = require_runtime.__toESM(dayjs);
13
- //#region packages/components/picker/dates/panel.tsx
14
- const MONTHS = [
15
- 1,
16
- 2,
17
- 3,
18
- 4,
19
- 5,
20
- 6,
21
- 7,
22
- 8,
23
- 9,
24
- 10,
25
- 11,
26
- 12
27
- ];
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+ var material = require('@ricons/material');
7
+ var classNames = require('classnames');
8
+ var dayjs = require('dayjs');
9
+ var radash = require('radash');
10
+ var react = require('react');
11
+ var icon = require('../../icon/icon.js');
12
+ var helpericon = require('../../utils/helpericon/helpericon.js');
13
+ var dates = require('./dates.js');
14
+
15
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
16
+
17
+ var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
18
+ var dayjs__default = /*#__PURE__*/_interopDefaultCompat(dayjs);
19
+
20
+ const MONTHS = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
28
21
  const YearMonth = (props) => {
29
- const { value, unitMonth = "月", unitYear = "年", renderYear, renderMonth, onClick } = props;
30
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("a", {
31
- className: "i-datepicker-action",
32
- "data-ripple": true,
33
- onClick,
34
- children: [
35
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: renderYear?.(value.year()) }),
36
- unitYear,
37
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: renderMonth?.(value.month() + 1) }),
38
- unitMonth
39
- ]
40
- });
22
+ const { value, unitMonth = "月", unitYear = "年", renderYear, renderMonth, onClick, } = props;
23
+ return (jsxRuntime.jsxs("a", { className: 'i-datepicker-action', "data-ripple": true, onClick: onClick, children: [jsxRuntime.jsx("span", { children: renderYear?.(value.year()) }), unitYear, jsxRuntime.jsx("span", { children: renderMonth?.(value.month() + 1) }), unitMonth] }));
41
24
  };
42
25
  const Panel = (props) => {
43
- const { value, unitYear, unitMonth, renderDate, renderMonth = (m) => m, renderYear = (y) => y, disabledDate, onDateClick } = props;
44
- const [today, setToday] = (0, react.useState)(value);
45
- const [month, setMonth] = (0, react.useState)(value || (0, dayjs.default)());
46
- const [selectedYear, setSelectedYear] = (0, react.useState)((0, dayjs.default)());
47
- const [years, setYears] = (0, react.useState)([]);
48
- const [selectable, setSelectable] = (0, react.useState)(false);
49
- const $years = (0, react.useRef)(null);
50
- const handleOperateMonth = (next) => {
51
- setMonth((m) => m[next ? "add" : "subtract"](1, "month"));
52
- };
53
- const handleChangeDate = (date) => {
54
- if (date.isSame(today, "day")) return;
55
- if (!date.isSame(month, "month")) setMonth(date);
56
- setToday(date);
57
- onDateClick?.(date);
58
- };
59
- const handleChangeMonth = (month) => {
60
- setMonth((m) => m.year(selectedYear.year()).month(month - 1));
61
- setSelectable(false);
62
- };
63
- const getMoreYears = (0, _Users_iann_codes_ioca_react_node_modules__pnpm_radash_12_1_1_node_modules_radash_dist_esm_index_mjs.throttle)({ interval: 100 }, (e) => {
64
- const isUp = e.deltaY < 0;
65
- setYears((ys) => ys.map((y) => y + (isUp ? -1 : 1)));
66
- });
67
- (0, react.useEffect)(() => {
68
- if (!selectable) return;
69
- setSelectedYear(month);
70
- const y = month.year();
71
- setYears([...Array.from({ length: 7 }).map((_, i) => y - 3 + i)]);
72
- }, [selectable, month]);
73
- (0, react.useEffect)(() => {
74
- setToday(value);
75
- setMonth(value || (0, dayjs.default)());
76
- }, [value]);
77
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
78
- className: "i-datepicker",
79
- children: [
80
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
81
- className: "i-datepicker-units",
82
- children: [
83
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(YearMonth, {
84
- value: month,
85
- unitYear,
86
- unitMonth,
87
- renderMonth,
88
- renderYear,
89
- onClick: () => setSelectable(true)
90
- }),
91
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
92
- className: "ml-auto i-datepicker-action",
93
- "data-ripple": true,
94
- onClick: () => handleOperateMonth(false),
95
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.default, { icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ricons_material.KeyboardArrowLeftRound, {}) })
96
- }),
97
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
98
- className: "i-datepicker-action",
99
- "data-ripple": true,
100
- onClick: () => handleOperateMonth(true),
101
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.default, { icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ricons_material.KeyboardArrowRightRound, {}) })
102
- })
103
- ]
104
- }),
105
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
106
- className: (0, classnames.default)("i-datepicker-ym", { "i-datepicker-active": selectable }),
107
- children: [
108
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index$1.default, {
109
- active: true,
110
- className: "i-datepicker-close",
111
- onClick: (e) => {
112
- e.stopPropagation();
113
- setSelectable(false);
114
- }
115
- }),
116
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
117
- ref: $years,
118
- className: "i-datepicker-years",
119
- onWheel: getMoreYears,
120
- children: years.map((y) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
121
- className: (0, classnames.default)("i-datepicker-year", { "i-datepicker-active": y === selectedYear.year() }),
122
- onClick: () => setSelectedYear((sy) => sy.year(y)),
123
- children: renderYear(y)
124
- }, y))
125
- }),
126
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
127
- className: "i-datepicker-months",
128
- children: MONTHS.map((m) => {
129
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
130
- className: (0, classnames.default)("i-datepicker-month", { "i-datepicker-active": m === month.month() + 1 }),
131
- onClick: () => handleChangeMonth(m),
132
- children: renderMonth(m)
133
- }, m);
134
- })
135
- })
136
- ]
137
- }),
138
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_dates.default, {
139
- value: today,
140
- month,
141
- disabledDate,
142
- onDateClick: handleChangeDate,
143
- renderDate
144
- })
145
- ]
146
- });
26
+ const { value, unitYear, unitMonth, renderDate, renderMonth = (m) => m, renderYear = (y) => y, disabledDate, onDateClick, } = props;
27
+ const [today, setToday] = react.useState(value);
28
+ const [month, setMonth] = react.useState(value || dayjs__default());
29
+ const [selectedYear, setSelectedYear] = react.useState(dayjs__default());
30
+ const [years, setYears] = react.useState([]);
31
+ const [selectable, setSelectable] = react.useState(false);
32
+ const $years = react.useRef(null);
33
+ const handleOperateMonth = (next) => {
34
+ setMonth((m) => m[next ? "add" : "subtract"](1, "month"));
35
+ };
36
+ const handleChangeDate = (date) => {
37
+ if (date.isSame(today, "day"))
38
+ return;
39
+ if (!date.isSame(month, "month")) {
40
+ setMonth(date);
41
+ }
42
+ setToday(date);
43
+ onDateClick?.(date);
44
+ };
45
+ const handleChangeMonth = (month) => {
46
+ setMonth((m) => m.year(selectedYear.year()).month(month - 1));
47
+ setSelectable(false);
48
+ };
49
+ const getMoreYears = radash.throttle({ interval: 100 }, (e) => {
50
+ const isUp = e.deltaY < 0;
51
+ setYears((ys) => ys.map((y) => y + (isUp ? -1 : 1)));
52
+ });
53
+ react.useEffect(() => {
54
+ if (!selectable)
55
+ return;
56
+ setSelectedYear(month);
57
+ const y = month.year();
58
+ const nextYears = Array.from({ length: 7 }).map((_, i) => y - 3 + i);
59
+ setYears([...nextYears]);
60
+ }, [selectable, month]);
61
+ react.useEffect(() => {
62
+ setToday(value);
63
+ setMonth(value || dayjs__default());
64
+ }, [value]);
65
+ return (jsxRuntime.jsxs("div", { className: 'i-datepicker', children: [jsxRuntime.jsxs("div", { className: 'i-datepicker-units', children: [jsxRuntime.jsx(YearMonth, { value: month, unitYear: unitYear, unitMonth: unitMonth, renderMonth: renderMonth, renderYear: renderYear, onClick: () => setSelectable(true) }), jsxRuntime.jsx("a", { className: 'ml-auto i-datepicker-action', "data-ripple": true, onClick: () => handleOperateMonth(false), children: jsxRuntime.jsx(icon.default, { icon: jsxRuntime.jsx(material.KeyboardArrowLeftRound, {}) }) }), jsxRuntime.jsx("a", { className: 'i-datepicker-action', "data-ripple": true, onClick: () => handleOperateMonth(true), children: jsxRuntime.jsx(icon.default, { icon: jsxRuntime.jsx(material.KeyboardArrowRightRound, {}) }) })] }), jsxRuntime.jsxs("div", { className: classNames__default("i-datepicker-ym", {
66
+ "i-datepicker-active": selectable,
67
+ }), children: [jsxRuntime.jsx(helpericon.default, { active: true, className: 'i-datepicker-close', onClick: (e) => {
68
+ e.stopPropagation();
69
+ setSelectable(false);
70
+ } }), jsxRuntime.jsx("div", { ref: $years, className: 'i-datepicker-years', onWheel: getMoreYears, children: years.map((y) => (jsxRuntime.jsx("a", { className: classNames__default("i-datepicker-year", {
71
+ "i-datepicker-active": y === selectedYear.year(),
72
+ }), onClick: () => setSelectedYear((sy) => sy.year(y)), children: renderYear(y) }, y))) }), jsxRuntime.jsx("div", { className: 'i-datepicker-months', children: MONTHS.map((m) => {
73
+ return (jsxRuntime.jsx("a", { className: classNames__default("i-datepicker-month", {
74
+ "i-datepicker-active": m === month.month() + 1,
75
+ }), onClick: () => handleChangeMonth(m), children: renderMonth(m) }, m));
76
+ }) })] }), jsxRuntime.jsx(dates.default, { value: today, month: month, disabledDate: disabledDate, onDateClick: handleChangeDate, renderDate: renderDate })] }));
147
77
  };
148
- //#endregion
149
- exports.default = Panel;
150
78
 
151
- //# sourceMappingURL=panel.js.map
79
+ exports.default = Panel;
80
+ //# sourceMappingURL=panel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"panel.js","names":["Icon","KeyboardArrowLeftRound","KeyboardArrowRightRound","Helpericon","Dates"],"sources":["../../../../../packages/components/picker/dates/panel.tsx"],"sourcesContent":["import {\n\tKeyboardArrowLeftRound,\n\tKeyboardArrowRightRound,\n} from \"@ricons/material\";\nimport classNames from \"classnames\";\nimport dayjs, { Dayjs } from \"dayjs\";\nimport { throttle } from \"radash\";\nimport { ReactNode, useEffect, useRef, useState } from \"react\";\nimport Icon from \"../../icon\";\nimport Helpericon from \"../../utils/helpericon\";\nimport { IBaseDates } from \"../type\";\nimport Dates from \"./dates\";\n\nconst MONTHS = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];\n\nconst YearMonth = (\n\tprops: IBaseDates & {\n\t\tonClick?: () => void;\n\t}\n) => {\n\tconst {\n\t\tvalue,\n\t\tunitMonth = \"月\",\n\t\tunitYear = \"年\",\n\t\trenderYear,\n\t\trenderMonth,\n\t\tonClick,\n\t} = props;\n\n\treturn (\n\t\t<a className='i-datepicker-action' data-ripple onClick={onClick}>\n\t\t\t<span>{renderYear?.(value.year())}</span>\n\t\t\t{unitYear}\n\t\t\t<span>{renderMonth?.(value.month() + 1)}</span>\n\t\t\t{unitMonth}\n\t\t</a>\n\t);\n};\n\nconst Panel = (props: IBaseDates) => {\n\tconst {\n\t\tvalue,\n\t\tunitYear,\n\t\tunitMonth,\n\t\trenderDate,\n\t\trenderMonth = (m: ReactNode) => m,\n\t\trenderYear = (y: ReactNode) => y,\n\t\tdisabledDate,\n\t\tonDateClick,\n\t} = props;\n\n\tconst [today, setToday] = useState(value);\n\tconst [month, setMonth] = useState(value || dayjs());\n\tconst [selectedYear, setSelectedYear] = useState(dayjs());\n\tconst [years, setYears] = useState<number[]>([]);\n\tconst [selectable, setSelectable] = useState(false);\n\n\tconst $years = useRef<HTMLDivElement>(null);\n\n\tconst handleOperateMonth = (next: boolean) => {\n\t\tsetMonth((m) => m[next ? \"add\" : \"subtract\"](1, \"month\"));\n\t};\n\n\tconst handleChangeDate = (date: Dayjs) => {\n\t\tif (date.isSame(today, \"day\")) return;\n\n\t\tif (!date.isSame(month, \"month\")) {\n\t\t\tsetMonth(date);\n\t\t}\n\n\t\tsetToday(date);\n\t\tonDateClick?.(date);\n\t};\n\n\tconst handleChangeMonth = (month: number) => {\n\t\tsetMonth((m) => m.year(selectedYear.year()).month(month - 1));\n\t\tsetSelectable(false);\n\t};\n\n\tconst getMoreYears = throttle({ interval: 100 }, (e) => {\n\t\tconst isUp = e.deltaY < 0;\n\n\t\tsetYears((ys) => ys.map((y) => y + (isUp ? -1 : 1)));\n\t});\n\n\tuseEffect(() => {\n\t\tif (!selectable) return;\n\n\t\tsetSelectedYear(month);\n\t\tconst y = month.year();\n\t\tconst nextYears = Array.from({ length: 7 }).map((_, i) => y - 3 + i);\n\n\t\tsetYears([...nextYears]);\n\t}, [selectable, month]);\n\n\tuseEffect(() => {\n\t\tsetToday(value);\n\t\tsetMonth(value || dayjs());\n\t}, [value]);\n\n\treturn (\n\t\t<div className='i-datepicker'>\n\t\t\t<div className='i-datepicker-units'>\n\t\t\t\t<YearMonth\n\t\t\t\t\tvalue={month}\n\t\t\t\t\tunitYear={unitYear}\n\t\t\t\t\tunitMonth={unitMonth}\n\t\t\t\t\trenderMonth={renderMonth}\n\t\t\t\t\trenderYear={renderYear}\n\t\t\t\t\tonClick={() => setSelectable(true)}\n\t\t\t\t/>\n\t\t\t\t<a\n\t\t\t\t\tclassName='ml-auto i-datepicker-action'\n\t\t\t\t\tdata-ripple\n\t\t\t\t\tonClick={() => handleOperateMonth(false)}\n\t\t\t\t>\n\t\t\t\t\t<Icon icon={<KeyboardArrowLeftRound />} />\n\t\t\t\t</a>\n\t\t\t\t<a\n\t\t\t\t\tclassName='i-datepicker-action'\n\t\t\t\t\tdata-ripple\n\t\t\t\t\tonClick={() => handleOperateMonth(true)}\n\t\t\t\t>\n\t\t\t\t\t<Icon icon={<KeyboardArrowRightRound />} />\n\t\t\t\t</a>\n\t\t\t</div>\n\n\t\t\t<div\n\t\t\t\tclassName={classNames(\"i-datepicker-ym\", {\n\t\t\t\t\t\"i-datepicker-active\": selectable,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t<Helpericon\n\t\t\t\t\tactive\n\t\t\t\t\tclassName='i-datepicker-close'\n\t\t\t\t\tonClick={(e) => {\n\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\tsetSelectable(false);\n\t\t\t\t\t}}\n\t\t\t\t/>\n\n\t\t\t\t<div\n\t\t\t\t\tref={$years}\n\t\t\t\t\tclassName='i-datepicker-years'\n\t\t\t\t\tonWheel={getMoreYears}\n\t\t\t\t>\n\t\t\t\t\t{years.map((y) => (\n\t\t\t\t\t\t<a\n\t\t\t\t\t\t\tkey={y}\n\t\t\t\t\t\t\tclassName={classNames(\"i-datepicker-year\", {\n\t\t\t\t\t\t\t\t\"i-datepicker-active\":\n\t\t\t\t\t\t\t\t\ty === selectedYear.year(),\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\tonClick={() => setSelectedYear((sy) => sy.year(y))}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{renderYear(y)}\n\t\t\t\t\t\t</a>\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\n\t\t\t\t<div className='i-datepicker-months'>\n\t\t\t\t\t{MONTHS.map((m) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\tkey={m}\n\t\t\t\t\t\t\t\tclassName={classNames(\"i-datepicker-month\", {\n\t\t\t\t\t\t\t\t\t\"i-datepicker-active\":\n\t\t\t\t\t\t\t\t\t\tm === month.month() + 1,\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\tonClick={() => handleChangeMonth(m)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{renderMonth(m)}\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<Dates\n\t\t\t\tvalue={today}\n\t\t\t\tmonth={month}\n\t\t\t\tdisabledDate={disabledDate}\n\t\t\t\tonDateClick={handleChangeDate}\n\t\t\t\trenderDate={renderDate}\n\t\t\t/>\n\t\t</div>\n\t);\n};\n\nexport default Panel;\n"],"mappings":";;;;;;;;;;;;;AAaA,MAAM,SAAS;CAAC;CAAG;CAAG;CAAG;CAAG;CAAG;CAAG;CAAG;CAAG;CAAG;CAAI;CAAI;CAAG;AAEtD,MAAM,aACL,UAGI;CACJ,MAAM,EACL,OACA,YAAY,KACZ,WAAW,KACX,YACA,aACA,YACG;AAEJ,QACC,iBAAA,GAAA,kBAAA,MAAC,KAAD;EAAG,WAAU;EAAsB,eAAA;EAAqB;YAAxD;GACC,iBAAA,GAAA,kBAAA,KAAC,QAAD,EAAA,UAAO,aAAa,MAAM,MAAM,CAAC,EAAQ,CAAA;GACxC;GACD,iBAAA,GAAA,kBAAA,KAAC,QAAD,EAAA,UAAO,cAAc,MAAM,OAAO,GAAG,EAAE,EAAQ,CAAA;GAC9C;GACE;;;AAIN,MAAM,SAAS,UAAsB;CACpC,MAAM,EACL,OACA,UACA,WACA,YACA,eAAe,MAAiB,GAChC,cAAc,MAAiB,GAC/B,cACA,gBACG;CAEJ,MAAM,CAAC,OAAO,aAAA,GAAA,MAAA,UAAqB,MAAM;CACzC,MAAM,CAAC,OAAO,aAAA,GAAA,MAAA,UAAqB,UAAA,GAAA,MAAA,UAAgB,CAAC;CACpD,MAAM,CAAC,cAAc,oBAAA,GAAA,MAAA,WAAA,GAAA,MAAA,UAAmC,CAAC;CACzD,MAAM,CAAC,OAAO,aAAA,GAAA,MAAA,UAA+B,EAAE,CAAC;CAChD,MAAM,CAAC,YA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QACF,eAAe,kBAAkB,EAAE;kBAElC,YAAY,EAAE;QACZ,EARE,EAQF;QAEJ;MACG,CAAA;KACD;;GAEN,iBAAA,GAAA,kBAAA,KAACC,cAAAA,SAAD;IACC,OAAO;IACA;IACO;IACd,aAAa;IACD;IACX,CAAA;GACG"}
1
+ {"version":3,"file":"panel.js","sources":["../../../../../packages/components/picker/dates/panel.tsx"],"sourcesContent":["import {\r\n\tKeyboardArrowLeftRound,\r\n\tKeyboardArrowRightRound,\r\n} from \"@ricons/material\";\r\nimport classNames from \"classnames\";\r\nimport dayjs, { Dayjs } from \"dayjs\";\r\nimport { throttle } from \"radash\";\r\nimport { ReactNode, useEffect, useRef, useState } from \"react\";\r\nimport Icon from \"../../icon\";\r\nimport Helpericon from \"../../utils/helpericon\";\r\nimport { IBaseDates } from \"../type\";\r\nimport Dates from \"./dates\";\r\n\r\nconst MONTHS = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];\r\n\r\nconst YearMonth = (\r\n\tprops: IBaseDates & {\r\n\t\tonClick?: () => void;\r\n\t}\r\n) => {\r\n\tconst {\r\n\t\tvalue,\r\n\t\tunitMonth = \"月\",\r\n\t\tunitYear = \"年\",\r\n\t\trenderYear,\r\n\t\trenderMonth,\r\n\t\tonClick,\r\n\t} = props;\r\n\r\n\treturn (\r\n\t\t<a className='i-datepicker-action' data-ripple onClick={onClick}>\r\n\t\t\t<span>{renderYear?.(value.year())}</span>\r\n\t\t\t{unitYear}\r\n\t\t\t<span>{renderMonth?.(value.month() + 1)}</span>\r\n\t\t\t{unitMonth}\r\n\t\t</a>\r\n\t);\r\n};\r\n\r\nconst Panel = (props: IBaseDates) => {\r\n\tconst {\r\n\t\tvalue,\r\n\t\tunitYear,\r\n\t\tunitMonth,\r\n\t\trenderDate,\r\n\t\trenderMonth = (m: ReactNode) => m,\r\n\t\trenderYear = (y: ReactNode) => y,\r\n\t\tdisabledDate,\r\n\t\tonDateClick,\r\n\t} = props;\r\n\r\n\tconst [today, setToday] = useState(value);\r\n\tconst [month, setMonth] = useState(value || dayjs());\r\n\tconst [selectedYear, setSelectedYear] = useState(dayjs());\r\n\tconst [years, setYears] = useState<number[]>([]);\r\n\tconst [selectable, setSelectable] = useState(false);\r\n\r\n\tconst $years = useRef<HTMLDivElement>(null);\r\n\r\n\tconst handleOperateMonth = (next: boolean) => {\r\n\t\tsetMonth((m) => m[next ? \"add\" : \"subtract\"](1, \"month\"));\r\n\t};\r\n\r\n\tconst handleChangeDate = (date: Dayjs) => {\r\n\t\tif (date.isSame(today, \"day\")) return;\r\n\r\n\t\tif (!date.isSame(month, \"month\")) {\r\n\t\t\tsetMonth(date);\r\n\t\t}\r\n\r\n\t\tsetToday(date);\r\n\t\tonDateClick?.(date);\r\n\t};\r\n\r\n\tconst handleChangeMonth = (month: number) => {\r\n\t\tsetMonth((m) => m.year(selectedYear.year()).month(month - 1));\r\n\t\tsetSelectable(false);\r\n\t};\r\n\r\n\tconst getMoreYears = throttle({ interval: 100 }, (e) => {\r\n\t\tconst isUp = e.deltaY < 0;\r\n\r\n\t\tsetYears((ys) => ys.map((y) => y + (isUp ? -1 : 1)));\r\n\t});\r\n\r\n\tuseEffect(() => {\r\n\t\tif (!selectable) return;\r\n\r\n\t\tsetSelectedYear(month);\r\n\t\tconst y = month.year();\r\n\t\tconst nextYears = Array.from({ length: 7 }).map((_, i) => y - 3 + i);\r\n\r\n\t\tsetYears([...nextYears]);\r\n\t}, [selectable, month]);\r\n\r\n\tuseEffect(() => {\r\n\t\tsetToday(value);\r\n\t\tsetMonth(value || dayjs());\r\n\t}, [value]);\r\n\r\n\treturn (\r\n\t\t<div className='i-datepicker'>\r\n\t\t\t<div className='i-datepicker-units'>\r\n\t\t\t\t<YearMonth\r\n\t\t\t\t\tvalue={month}\r\n\t\t\t\t\tunitYear={unitYear}\r\n\t\t\t\t\tunitMonth={unitMonth}\r\n\t\t\t\t\trenderMonth={renderMonth}\r\n\t\t\t\t\trenderYear={renderYear}\r\n\t\t\t\t\tonClick={() => setSelectable(true)}\r\n\t\t\t\t/>\r\n\t\t\t\t<a\r\n\t\t\t\t\tclassName='ml-auto i-datepicker-action'\r\n\t\t\t\t\tdata-ripple\r\n\t\t\t\t\tonClick={() => handleOperateMonth(false)}\r\n\t\t\t\t>\r\n\t\t\t\t\t<Icon icon={<KeyboardArrowLeftRound />} />\r\n\t\t\t\t</a>\r\n\t\t\t\t<a\r\n\t\t\t\t\tclassName='i-datepicker-action'\r\n\t\t\t\t\tdata-ripple\r\n\t\t\t\t\tonClick={() => handleOperateMonth(true)}\r\n\t\t\t\t>\r\n\t\t\t\t\t<Icon icon={<KeyboardArrowRightRound />} />\r\n\t\t\t\t</a>\r\n\t\t\t</div>\r\n\r\n\t\t\t<div\r\n\t\t\t\tclassName={classNames(\"i-datepicker-ym\", {\r\n\t\t\t\t\t\"i-datepicker-active\": selectable,\r\n\t\t\t\t})}\r\n\t\t\t>\r\n\t\t\t\t<Helpericon\r\n\t\t\t\t\tactive\r\n\t\t\t\t\tclassName='i-datepicker-close'\r\n\t\t\t\t\tonClick={(e) => {\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\tsetSelectable(false);\r\n\t\t\t\t\t}}\r\n\t\t\t\t/>\r\n\r\n\t\t\t\t<div\r\n\t\t\t\t\tref={$years}\r\n\t\t\t\t\tclassName='i-datepicker-years'\r\n\t\t\t\t\tonWheel={getMoreYears}\r\n\t\t\t\t>\r\n\t\t\t\t\t{years.map((y) => (\r\n\t\t\t\t\t\t<a\r\n\t\t\t\t\t\t\tkey={y}\r\n\t\t\t\t\t\t\tclassName={classNames(\"i-datepicker-year\", {\r\n\t\t\t\t\t\t\t\t\"i-datepicker-active\":\r\n\t\t\t\t\t\t\t\t\ty === selectedYear.year(),\r\n\t\t\t\t\t\t\t})}\r\n\t\t\t\t\t\t\tonClick={() => setSelectedYear((sy) => sy.year(y))}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{renderYear(y)}\r\n\t\t\t\t\t\t</a>\r\n\t\t\t\t\t))}\r\n\t\t\t\t</div>\r\n\r\n\t\t\t\t<div className='i-datepicker-months'>\r\n\t\t\t\t\t{MONTHS.map((m) => {\r\n\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t<a\r\n\t\t\t\t\t\t\t\tkey={m}\r\n\t\t\t\t\t\t\t\tclassName={classNames(\"i-datepicker-month\", {\r\n\t\t\t\t\t\t\t\t\t\"i-datepicker-active\":\r\n\t\t\t\t\t\t\t\t\t\tm === month.month() + 1,\r\n\t\t\t\t\t\t\t\t})}\r\n\t\t\t\t\t\t\t\tonClick={() => handleChangeMonth(m)}\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t{renderMonth(m)}\r\n\t\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t})}\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\r\n\t\t\t<Dates\r\n\t\t\t\tvalue={today}\r\n\t\t\t\tmonth={month}\r\n\t\t\t\tdisabledDate={disabledDate}\r\n\t\t\t\tonDateClick={handleChangeDate}\r\n\t\t\t\trenderDate={renderDate}\r\n\t\t\t/>\r\n\t\t</div>\r\n\t);\r\n};\r\n\r\nexport default Panel;\r\n"],"names":["_jsxs","_jsx","useState","dayjs","useRef","throttle","useEffect","Icon","KeyboardArrowLeftRound","KeyboardArrowRightRound","classNames","Helpericon","Dates"],"mappings":";;;;;;;;;;;;;;;;;;;AAaA,MAAM,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;AAEtD,MAAM,SAAS,GAAG,CACjB,KAEC,KACE;AACH,IAAA,MAAM,EACL,KAAK,EACL,SAAS,GAAG,GAAG,EACf,QAAQ,GAAG,GAAG,EACd,UAAU,EACV,WAAW,EACX,OAAO,GACP,GA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,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,gBAAgB,EAC7B,UAAU,EAAE,UAAU,EAAA,CACrB,CAAA,EAAA,CACG;AAER;;;;"}
@@ -1,73 +1,50 @@
1
- const require_runtime = require("../../../_virtual/_rolldown/runtime.js");
2
- const require_index = require("../../icon/index.js");
3
- const require_index$1 = require("../../popup/index.js");
4
- const require_index$2 = require("../../input/index.js");
5
- const require_panel = require("./panel.js");
6
- let classnames = require("classnames");
7
- classnames = require_runtime.__toESM(classnames);
8
- let react = require("react");
9
- let _ricons_material = require("@ricons/material");
10
- let react_jsx_runtime = require("react/jsx-runtime");
11
- //#region packages/components/picker/time/index.tsx
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+ var material = require('@ricons/material');
7
+ var classNames = require('classnames');
8
+ var react = require('react');
9
+ var icon = require('../../icon/icon.js');
10
+ var input = require('../../input/input.js');
11
+ var popup = require('../../popup/popup.js');
12
+ var panel = require('./panel.js');
13
+
14
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
15
+
16
+ var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
17
+
12
18
  const FORMAT = "hh:mm:ss";
13
19
  function TimePicker(props) {
14
- const { name, value, format = FORMAT, periods, placeholder = props.format ?? FORMAT, className, renderItem, onChange, onBlur, popupProps, ...restProps } = props;
15
- const [timeValue, setTimeValue] = (0, react.useState)(value);
16
- const [safeValue, setSafeValue] = (0, react.useState)(void 0);
17
- const [active, setActive] = (0, react.useState)(false);
18
- const handleChange = (v) => {
19
- setTimeValue(v);
20
- };
21
- const handleFallback = (v) => {
22
- setSafeValue(v);
23
- };
24
- const handleValidTime = () => {
25
- if (!timeValue) return;
26
- setTimeValue(safeValue);
27
- };
28
- const handleBlur = (e) => {
29
- onBlur?.(e);
30
- handleValidTime();
31
- };
32
- const handleVisibleChange = (v) => {
33
- popupProps?.onVisibleChange?.(v);
34
- setActive(v);
35
- };
36
- (0, react.useEffect)(() => {
37
- setTimeValue(value);
38
- }, [value]);
39
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index$1.default, {
40
- visible: active,
41
- trigger: "click",
42
- position: "bottom",
43
- arrow: false,
44
- align: "start",
45
- ...popupProps,
46
- onVisibleChange: handleVisibleChange,
47
- content: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_panel.default, {
48
- value: timeValue,
49
- format,
50
- periods,
51
- renderItem,
52
- onChange: handleChange,
53
- onFallback: handleFallback
54
- }),
55
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index$2.default, {
56
- value: timeValue,
57
- placeholder,
58
- append: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.default, {
59
- icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ricons_material.AccessTimeRound, {}),
60
- className: "i-timepicker-icon",
61
- size: "1em"
62
- }),
63
- onChange: handleChange,
64
- onBlur: handleBlur,
65
- className: (0, classnames.default)("i-timepicker-label", className),
66
- ...restProps
67
- })
68
- });
20
+ const { name, value, format = FORMAT, periods, placeholder = props.format ?? FORMAT, className, renderItem, onChange, onBlur, popupProps, ...restProps } = props;
21
+ const [timeValue, setTimeValue] = react.useState(value);
22
+ const [safeValue, setSafeValue] = react.useState(undefined);
23
+ const [active, setActive] = react.useState(false);
24
+ const handleChange = (v) => {
25
+ setTimeValue(v);
26
+ };
27
+ const handleFallback = (v) => {
28
+ setSafeValue(v);
29
+ };
30
+ const handleValidTime = () => {
31
+ if (!timeValue)
32
+ return;
33
+ setTimeValue(safeValue);
34
+ };
35
+ const handleBlur = (e) => {
36
+ onBlur?.(e);
37
+ handleValidTime();
38
+ };
39
+ const handleVisibleChange = (v) => {
40
+ popupProps?.onVisibleChange?.(v);
41
+ setActive(v);
42
+ };
43
+ react.useEffect(() => {
44
+ setTimeValue(value);
45
+ }, [value]);
46
+ return (jsxRuntime.jsx(popup.default, { visible: active, trigger: 'click', position: 'bottom', arrow: false, align: 'start', ...popupProps, onVisibleChange: handleVisibleChange, content: jsxRuntime.jsx(panel.default, { value: timeValue, format: format, periods: periods, renderItem: renderItem, onChange: handleChange, onFallback: handleFallback }), children: jsxRuntime.jsx(input.default, { value: timeValue, placeholder: placeholder, append: jsxRuntime.jsx(icon.default, { icon: jsxRuntime.jsx(material.AccessTimeRound, {}), className: 'i-timepicker-icon', size: '1em' }), onChange: handleChange, onBlur: handleBlur, className: classNames__default("i-timepicker-label", className), ...restProps }) }));
69
47
  }
70
- //#endregion
71
- exports.default = TimePicker;
72
48
 
73
- //# sourceMappingURL=index.js.map
49
+ exports.default = TimePicker;
50
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Popup","Panel","Input","Icon","AccessTimeRound"],"sources":["../../../../../packages/components/picker/time/index.tsx"],"sourcesContent":["import { AccessTimeRound } from \"@ricons/material\";\nimport classNames from \"classnames\";\nimport { useEffect, useState } from \"react\";\nimport Icon from \"../../icon\";\nimport Input from \"../../input\";\nimport Popup from \"../../popup\";\nimport { ITimePicker } from \"../type\";\nimport Panel from \"./panel\";\n\nconst FORMAT = \"hh:mm:ss\";\n\nexport default function TimePicker(props: ITimePicker) {\n\tconst {\n\t\tname,\n\t\tvalue,\n\t\tformat = FORMAT,\n\t\tperiods,\n\t\tplaceholder = props.format ?? FORMAT,\n\t\tclassName,\n\t\trenderItem,\n\t\tonChange,\n\t\tonBlur,\n\t\tpopupProps,\n\t\t...restProps\n\t} = props;\n\tconst [timeValue, setTimeValue] = useState(value);\n\tconst [safeValue, setSafeValue] = useState(undefined);\n\tconst [active, setActive] = useState<boolean>(false);\n\n\tconst handleChange = (v) => {\n\t\tsetTimeValue(v);\n\t};\n\n\tconst handleFallback = (v) => {\n\t\tsetSafeValue(v);\n\t};\n\n\tconst handleValidTime = () => {\n\t\tif (!timeValue) return;\n\n\t\tsetTimeValue(safeValue);\n\t};\n\n\tconst handleBlur = (e) => {\n\t\tonBlur?.(e);\n\t\thandleValidTime();\n\t};\n\n\tconst handleVisibleChange = (v) => {\n\t\tpopupProps?.onVisibleChange?.(v);\n\t\tsetActive(v);\n\t};\n\n\tuseEffect(() => {\n\t\tsetTimeValue(value);\n\t}, [value]);\n\n\treturn (\n\t\t<Popup\n\t\t\tvisible={active}\n\t\t\ttrigger='click'\n\t\t\tposition='bottom'\n\t\t\tarrow={false}\n\t\t\talign='start'\n\t\t\t{...popupProps}\n\t\t\tonVisibleChange={handleVisibleChange}\n\t\t\tcontent={\n\t\t\t\t<Panel\n\t\t\t\t\tvalue={timeValue}\n\t\t\t\t\tformat={format}\n\t\t\t\t\tperiods={periods}\n\t\t\t\t\trenderItem={renderItem}\n\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\tonFallback={handleFallback}\n\t\t\t\t/>\n\t\t\t}\n\t\t>\n\t\t\t<Input\n\t\t\t\tvalue={timeValue}\n\t\t\t\tplaceholder={placeholder}\n\t\t\t\tappend={\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={<AccessTimeRound />}\n\t\t\t\t\t\tclassName='i-timepicker-icon'\n\t\t\t\t\t\tsize='1em'\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tonChange={handleChange}\n\t\t\t\tonBlur={handleBlur}\n\t\t\t\tclassName={classNames(\"i-timepicker-label\", className)}\n\t\t\t\t{...restProps}\n\t\t\t/>\n\t\t</Popup>\n\t);\n}\n"],"mappings":";;;;;;;;;;;AASA,MAAM,SAAS;AAEf,SAAwB,WAAW,OAAoB;CACtD,MAAM,EACL,MACA,OACA,SAAS,QACT,SACA,cAAc,MAAM,UAAU,QAC9B,WACA,YACA,UACA,QACA,YACA,GAAG,cACA;CACJ,MAAM,CAAC,WAAW,iBAAA,GAAA,MAAA,UAAyB,MAAM;CACjD,MAAM,CAAC,WAAW,iBAAA,GAAA,MAAA,UAAyB,KAAA,EAAU;CACrD,MAAM,CAAC,QAAQ,cAAA,GAAA,MAAA,UAA+B,MAAM;CAEpD,MAAM,gBAAgB,MAAM;AAC3B,eAAa,EAAE;;CAGhB,MAAM,kBAAkB,MAAM;AAC7B,eAAa,EAAE;;CAGhB,MAAM,wBAAwB;AAC7B,MAAI,CAAC,UAAW;AAEhB,eAAa,UAAU;;CAGxB,MAAM,cAAc,MAAM;AACzB,WAAS,EAAE;AACX,mBAAiB;;CAGlB,MAAM,uBAAuB,MAAM;AAClC,cAAY,kBAAkB,EAAE;AAChC,YAAU,EAAE;;AAGb,EAAA,GAAA,MAAA,iBAAgB;AACf,eAAa,MAAM;IACjB,CAAC,MAAM,CAAC;AAEX,QACC,iBAAA,GAAA,kBAAA,KAACA,gBAAAA,SAAD;EACC,SAAS;EACT,SAAQ;EACR,UAAS;EACT,OAAO;EACP,OAAM;EACN,GAAI;EACJ,iBAAiB;EACjB,SACC,iBAAA,GAAA,kBAAA,KAACC,cAAAA,SAAD;GACC,OAAO;GACC;GACC;GACG;GACZ,UAAU;GACV,YAAY;GACX,CAAA;YAGH,iBAAA,GAAA,kBAAA,KAACC,gBAAAA,SAAD;GACC,OAAO;GACM;GACb,QACC,iBAAA,GAAA,kBAAA,KAACC,cAAAA,SAAD;IACC,MAAM,iBAAA,GAAA,kBAAA,KAACC,iBAAAA,iBAAD,EAAmB,CAAA;IACzB,WAAU;IACV,MAAK;IACJ,CAAA;GAEH,UAAU;GACV,QAAQ;GACR,YAAA,GAAA,WAAA,SAAsB,sBAAsB,UAAU;GACtD,GAAI;GACH,CAAA;EACK,CAAA"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../packages/components/picker/time/index.tsx"],"sourcesContent":["import { AccessTimeRound } from \"@ricons/material\";\r\nimport classNames from \"classnames\";\r\nimport { useEffect, useState } from \"react\";\r\nimport Icon from \"../../icon\";\r\nimport Input from \"../../input\";\r\nimport Popup from \"../../popup\";\r\nimport { ITimePicker } from \"../type\";\r\nimport Panel from \"./panel\";\r\n\r\nconst FORMAT = \"hh:mm:ss\";\r\n\r\nexport default function TimePicker(props: ITimePicker) {\r\n\tconst {\r\n\t\tname,\r\n\t\tvalue,\r\n\t\tformat = FORMAT,\r\n\t\tperiods,\r\n\t\tplaceholder = props.format ?? FORMAT,\r\n\t\tclassName,\r\n\t\trenderItem,\r\n\t\tonChange,\r\n\t\tonBlur,\r\n\t\tpopupProps,\r\n\t\t...restProps\r\n\t} = props;\r\n\tconst [timeValue, setTimeValue] = useState(value);\r\n\tconst [safeValue, setSafeValue] = useState(undefined);\r\n\tconst [active, setActive] = useState<boolean>(false);\r\n\r\n\tconst handleChange = (v) => {\r\n\t\tsetTimeValue(v);\r\n\t};\r\n\r\n\tconst handleFallback = (v) => {\r\n\t\tsetSafeValue(v);\r\n\t};\r\n\r\n\tconst handleValidTime = () => {\r\n\t\tif (!timeValue) return;\r\n\r\n\t\tsetTimeValue(safeValue);\r\n\t};\r\n\r\n\tconst handleBlur = (e) => {\r\n\t\tonBlur?.(e);\r\n\t\thandleValidTime();\r\n\t};\r\n\r\n\tconst handleVisibleChange = (v) => {\r\n\t\tpopupProps?.onVisibleChange?.(v);\r\n\t\tsetActive(v);\r\n\t};\r\n\r\n\tuseEffect(() => {\r\n\t\tsetTimeValue(value);\r\n\t}, [value]);\r\n\r\n\treturn (\r\n\t\t<Popup\r\n\t\t\tvisible={active}\r\n\t\t\ttrigger='click'\r\n\t\t\tposition='bottom'\r\n\t\t\tarrow={false}\r\n\t\t\talign='start'\r\n\t\t\t{...popupProps}\r\n\t\t\tonVisibleChange={handleVisibleChange}\r\n\t\t\tcontent={\r\n\t\t\t\t<Panel\r\n\t\t\t\t\tvalue={timeValue}\r\n\t\t\t\t\tformat={format}\r\n\t\t\t\t\tperiods={periods}\r\n\t\t\t\t\trenderItem={renderItem}\r\n\t\t\t\t\tonChange={handleChange}\r\n\t\t\t\t\tonFallback={handleFallback}\r\n\t\t\t\t/>\r\n\t\t\t}\r\n\t\t>\r\n\t\t\t<Input\r\n\t\t\t\tvalue={timeValue}\r\n\t\t\t\tplaceholder={placeholder}\r\n\t\t\t\tappend={\r\n\t\t\t\t\t<Icon\r\n\t\t\t\t\t\ticon={<AccessTimeRound />}\r\n\t\t\t\t\t\tclassName='i-timepicker-icon'\r\n\t\t\t\t\t\tsize='1em'\r\n\t\t\t\t\t/>\r\n\t\t\t\t}\r\n\t\t\t\tonChange={handleChange}\r\n\t\t\t\tonBlur={handleBlur}\r\n\t\t\t\tclassName={classNames(\"i-timepicker-label\", className)}\r\n\t\t\t\t{...restProps}\r\n\t\t\t/>\r\n\t\t</Popup>\r\n\t);\r\n}\r\n"],"names":["useState","useEffect","_jsx","Popup","Panel","Input","Icon","AccessTimeRound","classNames"],"mappings":";;;;;;;;;;;;;;;;;AASA,MAAM,MAAM,GAAG,UAAU;AAEX,SAAU,UAAU,CAAC,KAAkB,EAAA;AACpD,IAAA,MAAM,EACL,IAAI,EACJ,KAAK,EACL,MAAM,GAAG,MAAM,EACf,OAAO,EACP,WAAW,GAAG,KAAK,CAAC,MAAM,IAAI,MAAM,EACpC,SAAS,EACT,UAAU,EACV,QAAQ,EACR,MAAM,EACN,UAAU,EACV,GAAG,SAAS,EACZ,GAAG,KAAK;IACT,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAGA,cAAQ,CAAC,KAAK,CAAC;IACjD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAGA,cAAQ,CAAC,SAAS,CAAC;IACrD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAGA,cAAQ,CAAU,KAAK,CAAC;AAEpD,IAAA,MAAM,YAAY,GAAG,CAAC,CAAC,KAAI;QAC1B,YAAY,CAAC,CAAC,CAAC;AAChB,IAAA,CAAC;AAED,IAAA,MAAM,cAAc,GAAG,CAAC,CAAC,KAAI;QAC5B,YAAY,CAAC,CAAC,CAAC;AAChB,IAAA,CAAC;IAED,MAAM,eAAe,GAAG,MAAK;AAC5B,QAAA,IAAI,CAAC,SAAS;YAAE;QAEhB,YAAY,CAAC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