@ioca/react 1.4.77 → 1.4.79

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 (402) hide show
  1. package/lib/cjs/_virtual/_rolldown/runtime.cjs +23 -0
  2. package/lib/cjs/components/affix/affix.cjs +66 -0
  3. package/lib/cjs/components/affix/affix.cjs.map +1 -0
  4. package/lib/cjs/components/affix/index.cjs +6 -0
  5. package/lib/cjs/components/affix/index.cjs.map +1 -0
  6. package/lib/cjs/components/affix/totop.cjs +25 -0
  7. package/lib/cjs/components/affix/totop.cjs.map +1 -0
  8. package/lib/cjs/components/badge/badge.cjs +24 -0
  9. package/lib/cjs/components/badge/badge.cjs.map +1 -0
  10. package/lib/cjs/components/badge/index.cjs +6 -0
  11. package/lib/cjs/components/badge/index.cjs.map +1 -0
  12. package/lib/cjs/components/button/button.cjs +64 -0
  13. package/lib/cjs/components/button/button.cjs.map +1 -0
  14. package/lib/cjs/components/button/confirm.cjs +60 -0
  15. package/lib/cjs/components/button/confirm.cjs.map +1 -0
  16. package/lib/cjs/components/button/group.cjs +26 -0
  17. package/lib/cjs/components/button/group.cjs.map +1 -0
  18. package/lib/cjs/components/button/index.cjs +6 -0
  19. package/lib/cjs/components/button/index.cjs.map +1 -0
  20. package/lib/cjs/components/button/toggle.cjs +46 -0
  21. package/lib/cjs/components/button/toggle.cjs.map +1 -0
  22. package/lib/cjs/components/card/card.cjs +33 -0
  23. package/lib/cjs/components/card/card.cjs.map +1 -0
  24. package/lib/cjs/components/card/index.cjs +6 -0
  25. package/lib/cjs/components/card/index.cjs.map +1 -0
  26. package/lib/cjs/components/checkbox/checkbox.cjs +66 -0
  27. package/lib/cjs/components/checkbox/checkbox.cjs.map +1 -0
  28. package/lib/cjs/components/checkbox/index.cjs +6 -0
  29. package/lib/cjs/components/checkbox/index.cjs.map +1 -0
  30. package/lib/cjs/components/checkbox/item.cjs +59 -0
  31. package/lib/cjs/components/checkbox/item.cjs.map +1 -0
  32. package/lib/cjs/components/collapse/collapse.cjs +84 -0
  33. package/lib/cjs/components/collapse/collapse.cjs.map +1 -0
  34. package/lib/cjs/components/collapse/index.cjs +6 -0
  35. package/lib/cjs/components/collapse/index.cjs.map +1 -0
  36. package/lib/cjs/components/collapse/item.cjs +10 -0
  37. package/lib/cjs/components/collapse/item.cjs.map +1 -0
  38. package/lib/cjs/components/datagrid/cell.cjs +39 -0
  39. package/lib/cjs/components/datagrid/cell.cjs.map +1 -0
  40. package/lib/cjs/components/datagrid/datagrid.cjs +140 -0
  41. package/lib/cjs/components/datagrid/datagrid.cjs.map +1 -0
  42. package/lib/cjs/components/datagrid/index.cjs +6 -0
  43. package/lib/cjs/components/datagrid/index.cjs.map +1 -0
  44. package/lib/cjs/components/datagrid/resize.cjs +42 -0
  45. package/lib/cjs/components/datagrid/resize.cjs.map +1 -0
  46. package/lib/cjs/components/datagrid/row.cjs +68 -0
  47. package/lib/cjs/components/datagrid/row.cjs.map +1 -0
  48. package/lib/cjs/components/datagrid/sorter.cjs +28 -0
  49. package/lib/cjs/components/datagrid/sorter.cjs.map +1 -0
  50. package/lib/cjs/components/description/description.cjs +43 -0
  51. package/lib/cjs/components/description/description.cjs.map +1 -0
  52. package/lib/cjs/components/description/index.cjs +6 -0
  53. package/lib/cjs/components/description/index.cjs.map +1 -0
  54. package/lib/cjs/components/drawer/drawer.cjs +84 -0
  55. package/lib/cjs/components/drawer/drawer.cjs.map +1 -0
  56. package/lib/cjs/components/drawer/index.cjs +6 -0
  57. package/lib/cjs/components/drawer/index.cjs.map +1 -0
  58. package/lib/cjs/components/dropdown/dropdown.cjs +38 -0
  59. package/lib/cjs/components/dropdown/dropdown.cjs.map +1 -0
  60. package/lib/cjs/components/dropdown/index.cjs +6 -0
  61. package/lib/cjs/components/dropdown/index.cjs.map +1 -0
  62. package/lib/cjs/components/dropdown/item.cjs +36 -0
  63. package/lib/cjs/components/dropdown/item.cjs.map +1 -0
  64. package/lib/cjs/components/editor/controls.cjs +89 -0
  65. package/lib/cjs/components/editor/controls.cjs.map +1 -0
  66. package/lib/cjs/components/editor/editor.cjs +91 -0
  67. package/lib/cjs/components/editor/editor.cjs.map +1 -0
  68. package/lib/cjs/components/editor/index.cjs +6 -0
  69. package/lib/cjs/components/editor/index.cjs.map +1 -0
  70. package/lib/cjs/components/flex/flex.cjs +31 -0
  71. package/lib/cjs/components/flex/flex.cjs.map +1 -0
  72. package/lib/cjs/components/flex/index.cjs +6 -0
  73. package/lib/cjs/components/flex/index.cjs.map +1 -0
  74. package/lib/cjs/components/form/context.cjs +7 -0
  75. package/lib/cjs/components/form/context.cjs.map +1 -0
  76. package/lib/cjs/components/form/field.cjs +71 -0
  77. package/lib/cjs/components/form/field.cjs.map +1 -0
  78. package/lib/cjs/components/form/form.cjs +64 -0
  79. package/lib/cjs/components/form/form.cjs.map +1 -0
  80. package/lib/cjs/components/form/index.cjs +6 -0
  81. package/lib/cjs/components/form/index.cjs.map +1 -0
  82. package/lib/cjs/components/form/useConfig.cjs +45 -0
  83. package/lib/cjs/components/form/useConfig.cjs.map +1 -0
  84. package/lib/cjs/components/form/useForm.cjs +123 -0
  85. package/lib/cjs/components/form/useForm.cjs.map +1 -0
  86. package/lib/cjs/components/icon/icon.cjs +24 -0
  87. package/lib/cjs/components/icon/icon.cjs.map +1 -0
  88. package/lib/cjs/components/icon/index.cjs +6 -0
  89. package/lib/cjs/components/icon/index.cjs.map +1 -0
  90. package/lib/cjs/components/image/image.cjs +86 -0
  91. package/lib/cjs/components/image/image.cjs.map +1 -0
  92. package/lib/cjs/components/image/index.cjs +6 -0
  93. package/lib/cjs/components/image/index.cjs.map +1 -0
  94. package/lib/cjs/components/image/list.cjs +49 -0
  95. package/lib/cjs/components/image/list.cjs.map +1 -0
  96. package/lib/cjs/components/input/container.cjs +30 -0
  97. package/lib/cjs/components/input/container.cjs.map +1 -0
  98. package/lib/cjs/components/input/index.cjs +6 -0
  99. package/lib/cjs/components/input/index.cjs.map +1 -0
  100. package/lib/cjs/components/input/input.cjs +113 -0
  101. package/lib/cjs/components/input/input.cjs.map +1 -0
  102. package/lib/cjs/components/input/number.cjs +138 -0
  103. package/lib/cjs/components/input/number.cjs.map +1 -0
  104. package/lib/cjs/components/input/range.cjs +134 -0
  105. package/lib/cjs/components/input/range.cjs.map +1 -0
  106. package/lib/cjs/components/input/textarea.cjs +61 -0
  107. package/lib/cjs/components/input/textarea.cjs.map +1 -0
  108. package/lib/cjs/components/list/index.cjs +6 -0
  109. package/lib/cjs/components/list/index.cjs.map +1 -0
  110. package/lib/cjs/components/list/item.cjs +30 -0
  111. package/lib/cjs/components/list/item.cjs.map +1 -0
  112. package/lib/cjs/components/list/list.cjs +30 -0
  113. package/lib/cjs/components/list/list.cjs.map +1 -0
  114. package/lib/cjs/components/loading/index.cjs +6 -0
  115. package/lib/cjs/components/loading/index.cjs.map +1 -0
  116. package/lib/cjs/components/loading/loading.cjs +39 -0
  117. package/lib/cjs/components/loading/loading.cjs.map +1 -0
  118. package/lib/cjs/components/message/index.cjs +6 -0
  119. package/lib/cjs/components/message/index.cjs.map +1 -0
  120. package/lib/cjs/components/message/message.cjs +197 -0
  121. package/lib/cjs/components/message/message.cjs.map +1 -0
  122. package/lib/cjs/components/modal/content.cjs +57 -0
  123. package/lib/cjs/components/modal/content.cjs.map +1 -0
  124. package/lib/cjs/components/modal/context.cjs +7 -0
  125. package/lib/cjs/components/modal/context.cjs.map +1 -0
  126. package/lib/cjs/components/modal/hookModal.cjs +28 -0
  127. package/lib/cjs/components/modal/hookModal.cjs.map +1 -0
  128. package/lib/cjs/components/modal/index.cjs +6 -0
  129. package/lib/cjs/components/modal/index.cjs.map +1 -0
  130. package/lib/cjs/components/modal/modal.cjs +117 -0
  131. package/lib/cjs/components/modal/modal.cjs.map +1 -0
  132. package/lib/cjs/components/modal/useModal.cjs +39 -0
  133. package/lib/cjs/components/modal/useModal.cjs.map +1 -0
  134. package/lib/cjs/components/pagination/index.cjs +6 -0
  135. package/lib/cjs/components/pagination/index.cjs.map +1 -0
  136. package/lib/cjs/components/pagination/page.cjs +31 -0
  137. package/lib/cjs/components/pagination/page.cjs.map +1 -0
  138. package/lib/cjs/components/pagination/pagination.cjs +86 -0
  139. package/lib/cjs/components/pagination/pagination.cjs.map +1 -0
  140. package/lib/cjs/components/picker/colors/footer.cjs +64 -0
  141. package/lib/cjs/components/picker/colors/footer.cjs.map +1 -0
  142. package/lib/cjs/components/picker/colors/handle.cjs +25 -0
  143. package/lib/cjs/components/picker/colors/handle.cjs.map +1 -0
  144. package/lib/cjs/components/picker/colors/index.cjs +81 -0
  145. package/lib/cjs/components/picker/colors/index.cjs.map +1 -0
  146. package/lib/cjs/components/picker/dates/dates.cjs +68 -0
  147. package/lib/cjs/components/picker/dates/dates.cjs.map +1 -0
  148. package/lib/cjs/components/picker/dates/index.cjs +97 -0
  149. package/lib/cjs/components/picker/dates/index.cjs.map +1 -0
  150. package/lib/cjs/components/picker/dates/panel.cjs +151 -0
  151. package/lib/cjs/components/picker/dates/panel.cjs.map +1 -0
  152. package/lib/cjs/components/picker/time/index.cjs +73 -0
  153. package/lib/cjs/components/picker/time/index.cjs.map +1 -0
  154. package/lib/cjs/components/picker/time/item.cjs +20 -0
  155. package/lib/cjs/components/picker/time/item.cjs.map +1 -0
  156. package/lib/cjs/components/picker/time/panel.cjs +144 -0
  157. package/lib/cjs/components/picker/time/panel.cjs.map +1 -0
  158. package/lib/cjs/components/popconfirm/index.cjs +6 -0
  159. package/lib/cjs/components/popconfirm/index.cjs.map +1 -0
  160. package/lib/cjs/components/popconfirm/popconfirm.cjs +86 -0
  161. package/lib/cjs/components/popconfirm/popconfirm.cjs.map +1 -0
  162. package/lib/cjs/components/popup/content.cjs +56 -0
  163. package/lib/cjs/components/popup/content.cjs.map +1 -0
  164. package/lib/cjs/components/popup/index.cjs +6 -0
  165. package/lib/cjs/components/popup/index.cjs.map +1 -0
  166. package/lib/cjs/components/popup/popup.cjs +425 -0
  167. package/lib/cjs/components/popup/popup.cjs.map +1 -0
  168. package/lib/cjs/components/progress/circle.cjs +45 -0
  169. package/lib/cjs/components/progress/circle.cjs.map +1 -0
  170. package/lib/cjs/components/progress/index.cjs +6 -0
  171. package/lib/cjs/components/progress/index.cjs.map +1 -0
  172. package/lib/cjs/components/progress/line.cjs +27 -0
  173. package/lib/cjs/components/progress/line.cjs.map +1 -0
  174. package/lib/cjs/components/progress/progress.cjs +100 -0
  175. package/lib/cjs/components/progress/progress.cjs.map +1 -0
  176. package/lib/cjs/components/radio/index.cjs +6 -0
  177. package/lib/cjs/components/radio/index.cjs.map +1 -0
  178. package/lib/cjs/components/radio/item.cjs +34 -0
  179. package/lib/cjs/components/radio/item.cjs.map +1 -0
  180. package/lib/cjs/components/radio/radio.cjs +62 -0
  181. package/lib/cjs/components/radio/radio.cjs.map +1 -0
  182. package/lib/cjs/components/resizable/index.cjs +6 -0
  183. package/lib/cjs/components/resizable/index.cjs.map +1 -0
  184. package/lib/cjs/components/resizable/resizable.cjs +81 -0
  185. package/lib/cjs/components/resizable/resizable.cjs.map +1 -0
  186. package/lib/cjs/components/river/index.cjs +6 -0
  187. package/lib/cjs/components/river/index.cjs.map +1 -0
  188. package/lib/cjs/components/river/river.cjs +116 -0
  189. package/lib/cjs/components/river/river.cjs.map +1 -0
  190. package/lib/cjs/components/select/index.cjs +6 -0
  191. package/lib/cjs/components/select/index.cjs.map +1 -0
  192. package/lib/cjs/components/select/options.cjs +76 -0
  193. package/lib/cjs/components/select/options.cjs.map +1 -0
  194. package/lib/cjs/components/select/select.cjs +155 -0
  195. package/lib/cjs/components/select/select.cjs.map +1 -0
  196. package/lib/cjs/components/step/divider.cjs +10 -0
  197. package/lib/cjs/components/step/divider.cjs.map +1 -0
  198. package/lib/cjs/components/step/index.cjs +6 -0
  199. package/lib/cjs/components/step/index.cjs.map +1 -0
  200. package/lib/cjs/components/step/item.cjs +60 -0
  201. package/lib/cjs/components/step/item.cjs.map +1 -0
  202. package/lib/cjs/components/step/step.cjs +42 -0
  203. package/lib/cjs/components/step/step.cjs.map +1 -0
  204. package/lib/cjs/components/swiper/index.cjs +6 -0
  205. package/lib/cjs/components/swiper/index.cjs.map +1 -0
  206. package/lib/cjs/components/swiper/item.cjs +39 -0
  207. package/lib/cjs/components/swiper/item.cjs.map +1 -0
  208. package/lib/cjs/components/swiper/swiper.cjs +262 -0
  209. package/lib/cjs/components/swiper/swiper.cjs.map +1 -0
  210. package/lib/cjs/components/tabs/index.cjs +6 -0
  211. package/lib/cjs/components/tabs/index.cjs.map +1 -0
  212. package/lib/cjs/components/tabs/item.cjs +10 -0
  213. package/lib/cjs/components/tabs/item.cjs.map +1 -0
  214. package/lib/cjs/components/tabs/tabs.cjs +272 -0
  215. package/lib/cjs/components/tabs/tabs.cjs.map +1 -0
  216. package/lib/cjs/components/tag/index.cjs +6 -0
  217. package/lib/cjs/components/tag/index.cjs.map +1 -0
  218. package/lib/cjs/components/tag/tag.cjs +32 -0
  219. package/lib/cjs/components/tag/tag.cjs.map +1 -0
  220. package/lib/cjs/components/text/highlight.cjs +35 -0
  221. package/lib/cjs/components/text/highlight.cjs.map +1 -0
  222. package/lib/cjs/components/text/index.cjs +6 -0
  223. package/lib/cjs/components/text/index.cjs.map +1 -0
  224. package/lib/cjs/components/text/number.cjs +32 -0
  225. package/lib/cjs/components/text/number.cjs.map +1 -0
  226. package/lib/cjs/components/text/text.cjs +39 -0
  227. package/lib/cjs/components/text/text.cjs.map +1 -0
  228. package/lib/cjs/components/text/time.cjs +24 -0
  229. package/lib/cjs/components/text/time.cjs.map +1 -0
  230. package/lib/cjs/components/tree/index.cjs +6 -0
  231. package/lib/cjs/components/tree/index.cjs.map +1 -0
  232. package/lib/cjs/components/tree/item.cjs +136 -0
  233. package/lib/cjs/components/tree/item.cjs.map +1 -0
  234. package/lib/cjs/components/tree/tree.cjs +127 -0
  235. package/lib/cjs/components/tree/tree.cjs.map +1 -0
  236. package/lib/cjs/components/upload/index.cjs +6 -0
  237. package/lib/cjs/components/upload/index.cjs.map +1 -0
  238. package/lib/cjs/components/upload/renderFile.cjs +99 -0
  239. package/lib/cjs/components/upload/renderFile.cjs.map +1 -0
  240. package/lib/cjs/components/upload/upload.cjs +165 -0
  241. package/lib/cjs/components/upload/upload.cjs.map +1 -0
  242. package/lib/cjs/components/utils/empty/index.cjs +17 -0
  243. package/lib/cjs/components/utils/empty/index.cjs.map +1 -0
  244. package/lib/cjs/components/utils/helpericon/helpericon.cjs +24 -0
  245. package/lib/cjs/components/utils/helpericon/helpericon.cjs.map +1 -0
  246. package/lib/cjs/components/utils/helpericon/index.cjs +6 -0
  247. package/lib/cjs/components/utils/helpericon/index.cjs.map +1 -0
  248. package/lib/cjs/components/video/index.cjs +6 -0
  249. package/lib/cjs/components/video/index.cjs.map +1 -0
  250. package/lib/cjs/components/video/video.cjs +237 -0
  251. package/lib/cjs/components/video/video.cjs.map +1 -0
  252. package/lib/cjs/index.cjs +83 -0
  253. package/lib/cjs/js/hooks.cjs +259 -0
  254. package/lib/cjs/js/hooks.cjs.map +1 -0
  255. package/lib/cjs/js/usePreview/content.cjs +197 -0
  256. package/lib/cjs/js/usePreview/content.cjs.map +1 -0
  257. package/lib/cjs/js/usePreview/index.cjs +39 -0
  258. package/lib/cjs/js/usePreview/index.cjs.map +1 -0
  259. package/lib/cjs/js/usePreview/renderFile.cjs +28 -0
  260. package/lib/cjs/js/usePreview/renderFile.cjs.map +1 -0
  261. package/lib/cjs/js/usePreview/type.cjs +15 -0
  262. package/lib/cjs/js/usePreview/type.cjs.map +1 -0
  263. package/lib/cjs/js/useRipple/index.cjs +45 -0
  264. package/lib/cjs/js/useRipple/index.cjs.map +1 -0
  265. package/lib/cjs/js/useTheme/index.cjs +30 -0
  266. package/lib/cjs/js/useTheme/index.cjs.map +1 -0
  267. package/lib/cjs/js/utils.cjs +284 -0
  268. package/lib/cjs/js/utils.cjs.map +1 -0
  269. package/lib/es/components/affix/affix.js.map +1 -1
  270. package/lib/es/components/affix/totop.js +1 -1
  271. package/lib/es/components/badge/badge.js.map +1 -1
  272. package/lib/es/components/button/button.js.map +1 -1
  273. package/lib/es/components/card/card.js.map +1 -1
  274. package/lib/es/components/checkbox/checkbox.js.map +1 -1
  275. package/lib/es/components/collapse/collapse.js +1 -1
  276. package/lib/es/components/collapse/collapse.js.map +1 -1
  277. package/lib/es/components/datagrid/datagrid.js.map +1 -1
  278. package/lib/es/components/description/description.js.map +1 -1
  279. package/lib/es/components/drawer/drawer.js.map +1 -1
  280. package/lib/es/components/dropdown/dropdown.js.map +1 -1
  281. package/lib/es/components/editor/controls.js +1 -1
  282. package/lib/es/components/editor/editor.js.map +1 -1
  283. package/lib/es/components/flex/flex.js.map +1 -1
  284. package/lib/es/components/form/form.js.map +1 -1
  285. package/lib/es/components/icon/icon.js.map +1 -1
  286. package/lib/es/components/image/image.js.map +1 -1
  287. package/lib/es/components/input/input.js +1 -1
  288. package/lib/es/components/input/input.js.map +1 -1
  289. package/lib/es/components/input/number.js +1 -1
  290. package/lib/es/components/input/number.js.map +1 -1
  291. package/lib/es/components/input/range.js +1 -1
  292. package/lib/es/components/input/range.js.map +1 -1
  293. package/lib/es/components/input/textarea.js.map +1 -1
  294. package/lib/es/components/list/list.js.map +1 -1
  295. package/lib/es/components/loading/loading.js.map +1 -1
  296. package/lib/es/components/message/message.js.map +1 -1
  297. package/lib/es/components/modal/content.js.map +1 -1
  298. package/lib/es/components/modal/modal.js.map +1 -1
  299. package/lib/es/components/pagination/pagination.js +1 -1
  300. package/lib/es/components/pagination/pagination.js.map +1 -1
  301. package/lib/es/components/picker/colors/footer.js +1 -1
  302. package/lib/es/components/picker/colors/index.js.map +1 -1
  303. package/lib/es/components/picker/dates/index.js +1 -1
  304. package/lib/es/components/picker/dates/index.js.map +1 -1
  305. package/lib/es/components/picker/dates/panel.js +1 -1
  306. package/lib/es/components/picker/time/index.js +1 -1
  307. package/lib/es/components/picker/time/panel.js.map +1 -1
  308. package/lib/es/components/popconfirm/popconfirm.js +1 -1
  309. package/lib/es/components/popconfirm/popconfirm.js.map +1 -1
  310. package/lib/es/components/popup/popup.js.map +1 -1
  311. package/lib/es/components/progress/progress.js.map +1 -1
  312. package/lib/es/components/radio/radio.js.map +1 -1
  313. package/lib/es/components/resizable/resizable.js.map +1 -1
  314. package/lib/es/components/river/river.js.map +1 -1
  315. package/lib/es/components/select/options.js +1 -1
  316. package/lib/es/components/select/select.js +1 -1
  317. package/lib/es/components/select/select.js.map +1 -1
  318. package/lib/es/components/step/divider.js.map +1 -1
  319. package/lib/es/components/step/item.js +1 -1
  320. package/lib/es/components/step/step.js.map +1 -1
  321. package/lib/es/components/swiper/swiper.js +1 -1
  322. package/lib/es/components/swiper/swiper.js.map +1 -1
  323. package/lib/es/components/tabs/tabs.js +1 -1
  324. package/lib/es/components/tabs/tabs.js.map +1 -1
  325. package/lib/es/components/tag/tag.js.map +1 -1
  326. package/lib/es/components/text/text.js.map +1 -1
  327. package/lib/es/components/tree/item.js +1 -1
  328. package/lib/es/components/tree/tree.js.map +1 -1
  329. package/lib/es/components/upload/renderFile.js +1 -1
  330. package/lib/es/components/upload/upload.js +1 -1
  331. package/lib/es/components/upload/upload.js.map +1 -1
  332. package/lib/es/components/utils/empty/index.js +1 -1
  333. package/lib/es/components/utils/empty/index.js.map +1 -1
  334. package/lib/es/components/utils/helpericon/helpericon.js +1 -1
  335. package/lib/es/components/utils/helpericon/helpericon.js.map +1 -1
  336. package/lib/es/components/video/video.js +1 -1
  337. package/lib/es/components/video/video.js.map +1 -1
  338. package/lib/es/js/usePreview/content.js +1 -1
  339. package/lib/es/js/usePreview/index.js.map +1 -1
  340. package/lib/es/js/usePreview/renderFile.js +1 -1
  341. package/lib/es/js/useRipple/index.js.map +1 -1
  342. package/lib/types/components/affix/affix.js +0 -1
  343. package/lib/types/components/affix/totop.js +1 -1
  344. package/lib/types/components/badge/badge.js +0 -1
  345. package/lib/types/components/button/button.js +0 -1
  346. package/lib/types/components/card/card.js +0 -1
  347. package/lib/types/components/checkbox/checkbox.js +0 -2
  348. package/lib/types/components/collapse/collapse.js +1 -2
  349. package/lib/types/components/datagrid/datagrid.js +0 -1
  350. package/lib/types/components/description/description.js +0 -1
  351. package/lib/types/components/drawer/drawer.js +0 -1
  352. package/lib/types/components/dropdown/dropdown.js +0 -1
  353. package/lib/types/components/editor/controls.js +1 -1
  354. package/lib/types/components/editor/editor.js +0 -1
  355. package/lib/types/components/flex/flex.js +0 -1
  356. package/lib/types/components/form/form.js +0 -1
  357. package/lib/types/components/icon/icon.js +0 -1
  358. package/lib/types/components/image/image.js +0 -1
  359. package/lib/types/components/input/input.js +1 -2
  360. package/lib/types/components/input/number.js +1 -2
  361. package/lib/types/components/input/range.js +1 -2
  362. package/lib/types/components/input/textarea.js +0 -1
  363. package/lib/types/components/list/list.js +0 -1
  364. package/lib/types/components/loading/loading.js +0 -1
  365. package/lib/types/components/message/message.js +0 -1
  366. package/lib/types/components/modal/content.js +0 -1
  367. package/lib/types/components/modal/modal.js +0 -1
  368. package/lib/types/components/pagination/pagination.js +1 -2
  369. package/lib/types/components/picker/colors/footer.js +1 -1
  370. package/lib/types/components/picker/colors/index.js +0 -1
  371. package/lib/types/components/picker/dates/index.js +1 -2
  372. package/lib/types/components/picker/dates/panel.js +1 -1
  373. package/lib/types/components/picker/time/index.js +1 -1
  374. package/lib/types/components/picker/time/panel.js +0 -1
  375. package/lib/types/components/popconfirm/popconfirm.js +1 -2
  376. package/lib/types/components/popup/popup.js +0 -1
  377. package/lib/types/components/progress/progress.js +0 -2
  378. package/lib/types/components/radio/radio.js +0 -2
  379. package/lib/types/components/resizable/resizable.js +0 -1
  380. package/lib/types/components/river/river.js +0 -1
  381. package/lib/types/components/select/options.js +1 -1
  382. package/lib/types/components/select/select.js +1 -3
  383. package/lib/types/components/step/divider.js +0 -1
  384. package/lib/types/components/step/item.js +1 -1
  385. package/lib/types/components/step/step.js +0 -1
  386. package/lib/types/components/swiper/swiper.js +1 -2
  387. package/lib/types/components/tabs/tabs.js +1 -2
  388. package/lib/types/components/tag/tag.js +0 -1
  389. package/lib/types/components/text/text.js +0 -1
  390. package/lib/types/components/tree/item.js +1 -1
  391. package/lib/types/components/tree/tree.js +0 -1
  392. package/lib/types/components/upload/renderFile.js +1 -1
  393. package/lib/types/components/upload/upload.js +1 -2
  394. package/lib/types/components/utils/empty/index.js +1 -2
  395. package/lib/types/components/utils/helpericon/helpericon.js +1 -2
  396. package/lib/types/components/video/video.js +1 -2
  397. package/lib/types/index.js +0 -1
  398. package/lib/types/js/usePreview/content.js +1 -1
  399. package/lib/types/js/usePreview/index.js +0 -1
  400. package/lib/types/js/usePreview/renderFile.js +1 -1
  401. package/lib/types/js/useRipple/index.js +0 -1
  402. package/package.json +6 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress.cjs","names":[],"sources":["../../../../packages/components/progress/progress.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport { useEffect, useRef } from \"react\";\nimport \"../../css/input.css\";\nimport { useMouseMove, useMouseUp, useReactive } from \"../../js/hooks\";\nimport Circle from \"./circle\";\nimport \"./index.css\";\nimport Line from \"./line\";\nimport { IProgress } from \"./type\";\n\nconst Progress = (props: IProgress) => {\n\tconst {\n\t\tvalue = 0,\n\t\tlineWidth = 8,\n\t\tcircleSize = 40,\n\t\tprecision = 0,\n\t\tstyle,\n\t\tdraggable = true,\n\t\ttype = \"line\",\n\t\tbarClass,\n\t\tvertical,\n\t\tlabel,\n\t\tlabelInline,\n\t\tclassName,\n\t\trenderCursor,\n\t\tonChange,\n\t\tonDraggingChange,\n\t} = props;\n\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst state = useReactive({\n\t\tvalue,\n\t\tdragging: false,\n\t\tsize: 0,\n\t\tstart: 0,\n\t});\n\n\tconst pageXY = vertical ? \"pageY\" : \"pageX\";\n\tconst rectTL = vertical ? \"top\" : \"left\";\n\tconst rectWH = vertical ? \"height\" : \"width\";\n\n\tconst getFixedValue = () => {\n\t\tlet value = +state.value.toFixed(precision);\n\t\tvalue = Math.min(100, value);\n\t\tvalue = Math.max(0, value);\n\n\t\treturn value;\n\t};\n\n\tconst handleMouseDown = (e) => {\n\t\tif (!ref.current || !draggable) return;\n\n\t\tif (e.touches) {\n\t\t\te = e.touches[0];\n\t\t}\n\n\t\tconst rect = ref.current.getBoundingClientRect();\n\t\tconst value = ((e[pageXY] - rect[rectTL]) * 100) / rect[rectWH];\n\n\t\tObject.assign(state, {\n\t\t\tvalue: vertical ? 100 - value : value,\n\t\t\tsize: rect[rectWH],\n\t\t\tstart: rect[rectTL],\n\t\t\tdragging: true,\n\t\t});\n\t\tonDraggingChange?.(true);\n\t};\n\n\tconst handleMouseMove = (e) => {\n\t\tif (!state.dragging || !draggable) return;\n\t\te.preventDefault();\n\n\t\tif (e.touches) {\n\t\t\te = e.touches[0];\n\t\t}\n\n\t\tconst { start, size } = state;\n\t\tconst offset = e[pageXY] - start;\n\n\t\tif (offset < 0 || offset > size) return;\n\n\t\tconst value = ((e[pageXY] - start) * 100) / size;\n\t\tstate.value = vertical ? 100 - value : value;\n\t};\n\n\tconst handleMouseUp = () => {\n\t\tif (!state.dragging || !draggable) return;\n\n\t\tonChange?.(getFixedValue());\n\t\tstate.dragging = false;\n\t\tonDraggingChange?.(false);\n\t};\n\n\tuseMouseMove(handleMouseMove);\n\tuseMouseUp(handleMouseUp);\n\n\tuseEffect(() => {\n\t\tif (value > 100) {\n\t\t\tstate.value = 100;\n\t\t\treturn;\n\t\t}\n\n\t\tif (value < 0) {\n\t\t\tstate.value = 0;\n\t\t\treturn;\n\t\t}\n\n\t\tstate.value = value;\n\t}, [value]);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(\"i-input-label\", className, {\n\t\t\t\t\"i-input-inline\": labelInline,\n\t\t\t})}\n\t\t\tstyle={style}\n\t\t>\n\t\t\t{label && <span className='i-input-label-text'>{label}</span>}\n\n\t\t\t{type === \"line\" && (\n\t\t\t\t<Line\n\t\t\t\t\tref={ref}\n\t\t\t\t\tvertical={vertical}\n\t\t\t\t\tlineWidth={lineWidth}\n\t\t\t\t\tbarClass={barClass}\n\t\t\t\t\tdragging={state.dragging}\n\t\t\t\t\tvalue={state.value}\n\t\t\t\t\trenderCursor={renderCursor}\n\t\t\t\t\tonMouseDown={handleMouseDown}\n\t\t\t\t\tonTouchStart={handleMouseDown}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{type === \"circle\" && (\n\t\t\t\t<Circle\n\t\t\t\t\tvalue={state.value}\n\t\t\t\t\tcircleSize={circleSize}\n\t\t\t\t\tlineWidth={lineWidth}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nexport default Progress;\n"],"mappings":";;;;;;;;;AAOA,MAAM,YAAY,UAAgB;SAElC,QAAM,GACL,YAAM,GACL,aAAS,IACT,YAAY,GACZ,OACA,YAAY,MACZ,OAAK,QACL,UACA,UACA,OACA,aACA,WACA,cACA,UACA,qBACA;CAED,MAAI,OAAA,GAAA,MAAA,QAAK,KAAA;;EAET;EACA,UAAW;EACV,MAAK;EACL,OAAA;EACA,CAAA;CAED,MAAE,SAAA,WAAA,UAAA;;CAEF,MAAM,SAAS,WAAW,WAAW;CAErC,MAAM,sBAAqB;;AAE3B,UAAM,KAAA,IAAA,KAAiB,MAAK;AAC3B,UAAI,KAAS,IAAA,GAAM,MAAM;AAEzB,SAAO;;CAGR,MAAC,mBAAA,MAAA;;AAGA,MAAI,EAAC,QAAA,KAAA,EAAA,QAAA;EAIL,MAAA,OAAA,IAAA,QAAA,uBAAA;;AAGA,SAAM,OAAQ,OAAI;;GAElB,MAAO,KAAA;GACN,OAAO,KAAA;GACP,UAAU;GACV,CAAA;AACD,qBAAe,KAAA;;CAGhB,MAAC,mBAAA,MAAA;;AAED,IAAA,gBAAM;AAEL,MAAE,EAAA,QAAA,KAAA,EAAA,QAAA;EAIF,MAAA,EAAA,OAAA,SAAA;;AAGA,MAAA,SAAa,KAAI,SAAU,KAAK;EAEhC,MAAI,SAAY,EAAE,UAAS,SAAM,MAAM;;;CAIxC,MAAC,sBAAA;;AAGA,aAAW,eAAa,CAAA;;AAExB,qBAAW,MAAc;;AAG1B,eAAA,aAAC,gBAAA;;AAGD,EAAA,GAAA,MAAA,iBAAW;;AAEX,SAAA,QAAgB;AACf;;AAGA,MAAA,QAAA,GAAA;;AAEA;;AAGA,QAAA,QAAA;;AAGD,QAAA,iBAAA,GAAA,kBAAA,MAAA,OAAA;EAEA,YAAA,GAAA,WAAA,SAAO,iBAAA,WAAA,EACL,kBAAA,aACA,CAAA;EACI;;GAEJ,SAAO,iBAAA,GAAA,kBAAA,KAAA,QAAA;IAAK,WAAA;cAAA;IAAA,CAAA;GAEX,SAAS,UAAA,iBAAA,GAAA,kBAAA,KAAA,aAAA,SAAA;IAEH;IACL;IACQ;IACE;IACV,UAAU,MAAC;IACX,OAAA,MAAU;IACA;IACV,aAAa;IACb,cAAc;IACd,CAAA;GAGD,SAAA,YAAA,iBAAA,GAAA,kBAAA,KAAA,eAAA,SAAA;IAEA,OAAQ,MAAE;IACT;IACO;IACP,CAAA;GAEA"}
@@ -0,0 +1,6 @@
1
+ //#region packages/components/radio/index.tsx
2
+ var radio_default = require("./radio.cjs").default;
3
+ //#endregion
4
+ exports.default = radio_default;
5
+
6
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","names":["Radio"],"sources":["../../../../packages/components/radio/index.tsx"],"sourcesContent":["import Radio from \"./radio\";\n\nexport default Radio;\n"],"mappings":";AAEA,IAAA,uCAAeA"}
@@ -0,0 +1,34 @@
1
+ const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
+ let classnames = require("classnames");
3
+ classnames = require_runtime.__toESM(classnames);
4
+ let react_jsx_runtime = require("react/jsx-runtime");
5
+ //#region packages/components/radio/item.tsx
6
+ function RadioItem(props) {
7
+ const { type = "default", name, value, checked, disabled, children, onChange } = props;
8
+ const isChildrenFn = typeof children === "function";
9
+ const handleChange = (e) => {
10
+ onChange?.(value, e);
11
+ };
12
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
13
+ className: (0, classnames.default)("i-radio-item", {
14
+ disabled,
15
+ "i-radio-item-custom": isChildrenFn
16
+ }),
17
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
18
+ type: "radio",
19
+ name,
20
+ checked,
21
+ className: (0, classnames.default)("i-radio-input", `i-radio-${type}`),
22
+ disabled,
23
+ hidden: isChildrenFn,
24
+ onChange: handleChange
25
+ }), isChildrenFn ? children(!!checked, value) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
26
+ className: "i-radio-text",
27
+ children
28
+ })]
29
+ });
30
+ }
31
+ //#endregion
32
+ exports.default = RadioItem;
33
+
34
+ //# sourceMappingURL=item.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"item.cjs","names":[],"sources":["../../../../packages/components/radio/item.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport { ChangeEvent } from \"react\";\nimport { IRadioItem } from \"./type\";\n\nexport default function RadioItem(props: IRadioItem) {\n\tconst {\n\t\ttype = \"default\",\n\t\tname,\n\t\tvalue,\n\t\tchecked,\n\t\tdisabled,\n\t\tchildren,\n\t\tonChange,\n\t} = props;\n\tconst isChildrenFn = typeof children === \"function\";\n\n\tconst handleChange = (e: ChangeEvent) => {\n\t\tonChange?.(value, e);\n\t};\n\n\treturn (\n\t\t<label\n\t\t\tclassName={classNames(\"i-radio-item\", {\n\t\t\t\tdisabled,\n\t\t\t\t\"i-radio-item-custom\": isChildrenFn,\n\t\t\t})}\n\t\t>\n\t\t\t<input\n\t\t\t\ttype='radio'\n\t\t\t\tname={name}\n\t\t\t\tchecked={checked}\n\t\t\t\tclassName={classNames(\"i-radio-input\", `i-radio-${type}`)}\n\t\t\t\tdisabled={disabled}\n\t\t\t\thidden={isChildrenFn}\n\t\t\t\tonChange={handleChange}\n\t\t\t/>\n\n\t\t\t{isChildrenFn ? (\n\t\t\t\tchildren(!!checked, value)\n\t\t\t) : (\n\t\t\t\t<span className='i-radio-text'>{children}</span>\n\t\t\t)}\n\t\t</label>\n\t);\n}\n"],"mappings":";;;;;AAIA,SAAwB,UAAU,OAAmB;CACpD,MAAM,EACL,OAAO,WACP,MACA,OACA,SACA,UACA,UACA,aACG;CACJ,MAAM,eAAe,OAAO,aAAa;CAEzC,MAAM,gBAAgB,MAAmB;AACxC,aAAW,OAAO,EAAE;;AAGrB,QACC,iBAAA,GAAA,kBAAA,MAAC,SAAD;EACC,YAAA,GAAA,WAAA,SAAsB,gBAAgB;GACrC;GACA,uBAAuB;GACvB,CAAC;YAJH,CAMC,iBAAA,GAAA,kBAAA,KAAC,SAAD;GACC,MAAK;GACC;GACG;GACT,YAAA,GAAA,WAAA,SAAsB,iBAAiB,WAAW,OAAO;GAC/C;GACV,QAAQ;GACR,UAAU;GACT,CAAA,EAED,eACA,SAAS,CAAC,CAAC,SAAS,MAAM,GAE1B,iBAAA,GAAA,kBAAA,KAAC,QAAD;GAAM,WAAU;GAAgB;GAAgB,CAAA,CAE1C"}
@@ -0,0 +1,62 @@
1
+ const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
+ const require_utils = require("../../js/utils.cjs");
3
+ const require_item = require("./item.cjs");
4
+ let classnames = require("classnames");
5
+ classnames = require_runtime.__toESM(classnames);
6
+ let react = require("react");
7
+ let react_jsx_runtime = require("react/jsx-runtime");
8
+ //#region packages/components/radio/radio.tsx
9
+ function Radio(props) {
10
+ const { label, name, options, value, type = "default", status = "normal", message, optionInline = true, labelInline, disabled, required, className, renderItem, onChange } = props;
11
+ const [selectedValue, setSelectedValue] = (0, react.useState)(value);
12
+ const formattedOptions = (0, react.useMemo)(() => require_utils.formatOption(options), [options]);
13
+ const handleChange = (value, e) => {
14
+ setSelectedValue(value);
15
+ onChange?.(value, e);
16
+ };
17
+ (0, react.useEffect)(() => {
18
+ setSelectedValue(value);
19
+ }, [value]);
20
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
21
+ className: (0, classnames.default)("i-radio i-input-label", {
22
+ [`i-radio-${status}`]: status !== "normal",
23
+ "i-input-inline": labelInline
24
+ }, className),
25
+ children: [label && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
26
+ className: "i-input-label-text",
27
+ children: [
28
+ required && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
29
+ className: "error",
30
+ children: "*"
31
+ }),
32
+ label,
33
+ message && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
34
+ className: "i-radio-message",
35
+ children: message
36
+ })
37
+ ]
38
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
39
+ className: (0, classnames.default)("i-radio-options", {
40
+ "i-options-block": !optionInline,
41
+ "i-radio-options-button": type === "button"
42
+ }),
43
+ children: formattedOptions.map((option) => {
44
+ const checked = selectedValue === option.value;
45
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_item.default, {
46
+ name,
47
+ value: option.value,
48
+ checked,
49
+ type,
50
+ disabled: disabled || option.disabled,
51
+ onChange: handleChange,
52
+ children: renderItem ?? option.label
53
+ }, option.value);
54
+ })
55
+ })]
56
+ });
57
+ }
58
+ Radio.Item = require_item.default;
59
+ //#endregion
60
+ exports.default = Radio;
61
+
62
+ //# sourceMappingURL=radio.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radio.cjs","names":[],"sources":["../../../../packages/components/radio/radio.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport \"../../css/input.css\";\nimport { formatOption } from \"../../js/utils\";\nimport \"./index.css\";\nimport RadioItem from \"./item\";\nimport { IRadio } from \"./type\";\n\nfunction Radio(props: IRadio) {\n\tconst {\n\t\tlabel,\n\t\tname,\n\t\toptions,\n\t\tvalue,\n\t\ttype = \"default\",\n\t\tstatus = \"normal\",\n\t\tmessage,\n\t\toptionInline = true,\n\t\tlabelInline,\n\t\tdisabled,\n\t\trequired,\n\t\tclassName,\n\t\trenderItem,\n\t\tonChange,\n\t} = props;\n\n\tconst [selectedValue, setSelectedValue] = useState(value);\n\n\tconst formattedOptions = useMemo(() => formatOption(options), [options]);\n\n\tconst handleChange = (value, e) => {\n\t\tsetSelectedValue(value);\n\t\tonChange?.(value, e);\n\t};\n\n\tuseEffect(() => {\n\t\tsetSelectedValue(value);\n\t}, [value]);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(\n\t\t\t\t\"i-radio i-input-label\",\n\t\t\t\t{\n\t\t\t\t\t[`i-radio-${status}`]: status !== \"normal\",\n\t\t\t\t\t\"i-input-inline\": labelInline,\n\t\t\t\t},\n\t\t\t\tclassName\n\t\t\t)}\n\t\t>\n\t\t\t{label && (\n\t\t\t\t<span className='i-input-label-text'>\n\t\t\t\t\t{required && <span className='error'>*</span>}\n\t\t\t\t\t{label}\n\n\t\t\t\t\t{message && <p className='i-radio-message'>{message}</p>}\n\t\t\t\t</span>\n\t\t\t)}\n\n\t\t\t<div\n\t\t\t\tclassName={classNames(\"i-radio-options\", {\n\t\t\t\t\t\"i-options-block\": !optionInline,\n\t\t\t\t\t\"i-radio-options-button\": type === \"button\",\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{formattedOptions.map((option) => {\n\t\t\t\t\tconst checked = selectedValue === option.value;\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<RadioItem\n\t\t\t\t\t\t\tkey={option.value as string}\n\t\t\t\t\t\t\tname={name}\n\t\t\t\t\t\t\tvalue={option.value}\n\t\t\t\t\t\t\tchecked={checked}\n\t\t\t\t\t\t\ttype={type}\n\t\t\t\t\t\t\tdisabled={disabled || option.disabled}\n\t\t\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{renderItem ?? option.label}\n\t\t\t\t\t\t</RadioItem>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nRadio.Item = RadioItem;\n\nexport default Radio;\n"],"mappings":";;;;;;;;AAMA,SAAS,MAAM,OAAe;SAE9B,OACC,MACC,SACA,OACA,OAAO,WACP,SAAK,UACL,SACA,eAAU,MACV,aACA,UACA,UACA,WACA,YACA,aACA;CAED,MAAI,CAAA,eAAK,qBAAA,GAAA,MAAA,UAAA,MAAA;CAET,MAAM,oBAAA,GAAA,MAAA,eAAiC,cAAA,aAAY,QAAM,EAAA,CAAA,QAAA,CAAA;CAEzD,MAAM,gBAAgB,OAAG,MAAU;;AAEnC,aAAM,OAAa,EAAE;;AAGrB,EAAA,GAAA,MAAA,iBAAC;;IAED,CAAA,MAAU,CAAC;AAEX,QAAA,iBAAA,GAAA,kBAAA,MAAA,OAAA;EAEA,YAAA,GAAA,WAAA,SACE,yBACA;IACG,WAAS,WAAY,WAAA;GACvB,kBAAA;GACC,EACD,UACA;aAEA,SACF,iBAAA,GAAA,kBAAA,MAAA,QAAA;GAAA,WAAA;aAAA;IACE,YAAS,iBAAA,GAAA,kBAAA,KAAA,QAAA;KAAA,WAAA;eAAA;KAAA,CAAA;IACR;IAEC,WAAK,iBAAA,GAAA,kBAAA,KAAA,KAAA;KAAA,WAAA;eAAA;KAAA,CAAA;;MAIR,iBAAA,GAAA,kBAAA,KAAC,OAAD;;IAEC,mBAAA,CAAA;IACA,0BAAyB,SAAM;IAC9B,CAAC;aAED,iBAAC,KAAA,WAAA;IACH,MAAA,UAAA,kBAAA,OAAA;AAEE,WAAA,iBAAA,GAAA,kBAAA,KAAA,aAAA,SAAA;KAGE;KACA,OAAK,OAAO;KACN;KACA;KACN,UAAS,YAAO,OAAA;KAChB,UAAU;eAEV,cAAU,OAAY;KACvB,EATM,OAAA,MASN;KAEA;GACA,CAAA,CACA;;;AAIN,MAAA,OAAA,aAAA"}
@@ -0,0 +1,6 @@
1
+ //#region packages/components/resizable/index.tsx
2
+ var resizable_default = require("./resizable.cjs").default;
3
+ //#endregion
4
+ exports.default = resizable_default;
5
+
6
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","names":["Resizable"],"sources":["../../../../packages/components/resizable/index.tsx"],"sourcesContent":["import Resizable from \"./resizable\";\n\nexport default Resizable;\n"],"mappings":";AAEA,IAAA,+CAAeA"}
@@ -0,0 +1,81 @@
1
+ const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
+ const require_hooks = require("../../js/hooks.cjs");
3
+ let classnames = require("classnames");
4
+ classnames = require_runtime.__toESM(classnames);
5
+ let react = require("react");
6
+ let react_jsx_runtime = require("react/jsx-runtime");
7
+ //#region packages/components/resizable/resizable.tsx
8
+ const Resizable = (props) => {
9
+ const { other, children, vertical, height, size = "auto", minSize = 0, maxSize = "100%", style, line, className, asPercent, onResize, onResizeComplete } = props;
10
+ const state = require_hooks.useReactive({
11
+ size,
12
+ resizing: false,
13
+ start: 0,
14
+ total: 0
15
+ });
16
+ const ref = (0, react.useRef)(null);
17
+ const handleMouseDown = () => {
18
+ const rect = ref.current?.getBoundingClientRect();
19
+ if (!rect) return;
20
+ state.resizing = true;
21
+ if (vertical) {
22
+ state.total = rect.height;
23
+ state.start = rect.top;
24
+ return;
25
+ }
26
+ state.total = rect.width;
27
+ state.start = rect.left;
28
+ };
29
+ const handleMouseMove = (e) => {
30
+ if (!state.resizing) return;
31
+ e.preventDefault();
32
+ if (e.touches) e = e.touches[0];
33
+ const offset = e[vertical ? "pageY" : "pageX"] - state.start;
34
+ state.size = asPercent ? `${offset / state.total * 100}%` : offset;
35
+ onResize?.(state.size);
36
+ };
37
+ const handleMouseUp = () => {
38
+ if (!state.resizing) return;
39
+ state.resizing = false;
40
+ onResizeComplete?.(state.size);
41
+ };
42
+ require_hooks.useMouseUp(handleMouseUp);
43
+ require_hooks.useMouseMove(handleMouseMove);
44
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
45
+ ref,
46
+ className: (0, classnames.default)("i-resizable", className, { [`i-resizable-vertical`]: vertical }),
47
+ style: {
48
+ ...style,
49
+ height
50
+ },
51
+ children: [
52
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
53
+ className: "i-resizable-a",
54
+ style: {
55
+ [vertical ? "height" : "width"]: state.size,
56
+ [vertical ? "minHeight" : "minWidth"]: minSize,
57
+ [vertical ? "maxHeight" : "maxWidth"]: maxSize
58
+ },
59
+ children: other
60
+ }),
61
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
62
+ className: (0, classnames.default)("i-resizable-line", { [`i-resizable-resizing`]: state.resizing }),
63
+ onMouseDown: handleMouseDown,
64
+ onTouchStart: handleMouseDown,
65
+ onContextMenu: (e) => e.preventDefault(),
66
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
67
+ className: "i-resizable-line-node",
68
+ children: line
69
+ })
70
+ }),
71
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
72
+ className: "i-resizable-b",
73
+ children
74
+ })
75
+ ]
76
+ });
77
+ };
78
+ //#endregion
79
+ exports.default = Resizable;
80
+
81
+ //# sourceMappingURL=resizable.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resizable.cjs","names":[],"sources":["../../../../packages/components/resizable/resizable.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport { useRef } from \"react\";\nimport { useMouseMove, useMouseUp, useReactive } from \"../../js/hooks\";\nimport \"./index.css\";\nimport { IResizable } from \"./type\";\n\nconst Resizable = (props: IResizable) => {\n\tconst {\n\t\tother,\n\t\tchildren,\n\t\tvertical,\n\t\theight,\n\t\tsize = \"auto\",\n\t\tminSize = 0,\n\t\tmaxSize = \"100%\",\n\t\tstyle,\n\t\tline,\n\t\tclassName,\n\t\tasPercent,\n\t\tonResize,\n\t\tonResizeComplete,\n\t} = props;\n\n\tconst state = useReactive({\n\t\tsize,\n\t\tresizing: false,\n\t\tstart: 0,\n\t\ttotal: 0,\n\t});\n\n\tconst ref = useRef<HTMLDivElement>(null);\n\n\tconst handleMouseDown = () => {\n\t\tconst rect = ref.current?.getBoundingClientRect();\n\t\tif (!rect) return;\n\n\t\tstate.resizing = true;\n\n\t\tif (vertical) {\n\t\t\tstate.total = rect.height;\n\t\t\tstate.start = rect.top;\n\t\t\treturn;\n\t\t}\n\n\t\tstate.total = rect.width;\n\t\tstate.start = rect.left;\n\t};\n\n\tconst handleMouseMove = (e) => {\n\t\tif (!state.resizing) return;\n\n\t\te.preventDefault();\n\n\t\tif (e.touches) {\n\t\t\te = e.touches[0];\n\t\t}\n\n\t\tconst d = e[vertical ? \"pageY\" : \"pageX\"];\n\t\tconst offset = d - state.start;\n\n\t\tstate.size = asPercent ? `${(offset / state.total) * 100}%` : offset;\n\t\tonResize?.(state.size);\n\t};\n\n\tconst handleMouseUp = () => {\n\t\tif (!state.resizing) return;\n\n\t\tstate.resizing = false;\n\t\tonResizeComplete?.(state.size);\n\t};\n\n\tuseMouseUp(handleMouseUp);\n\tuseMouseMove(handleMouseMove);\n\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tclassName={classNames(\"i-resizable\", className, {\n\t\t\t\t[`i-resizable-vertical`]: vertical,\n\t\t\t})}\n\t\t\tstyle={{ ...style, height }}\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName='i-resizable-a'\n\t\t\t\tstyle={{\n\t\t\t\t\t[vertical ? \"height\" : \"width\"]: state.size,\n\t\t\t\t\t[vertical ? \"minHeight\" : \"minWidth\"]: minSize,\n\t\t\t\t\t[vertical ? \"maxHeight\" : \"maxWidth\"]: maxSize,\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{other}\n\t\t\t</div>\n\n\t\t\t<div\n\t\t\t\tclassName={classNames(\"i-resizable-line\", {\n\t\t\t\t\t[`i-resizable-resizing`]: state.resizing,\n\t\t\t\t})}\n\t\t\t\tonMouseDown={handleMouseDown}\n\t\t\t\tonTouchStart={handleMouseDown}\n\t\t\t\tonContextMenu={(e) => e.preventDefault()}\n\t\t\t>\n\t\t\t\t<div className='i-resizable-line-node'>{line}</div>\n\t\t\t</div>\n\n\t\t\t<div className='i-resizable-b'>{children}</div>\n\t\t</div>\n\t);\n};\n\nexport default Resizable;\n"],"mappings":";;;;;;;;CAMA,MAAM,EACL,OACC,UACA,UACA,QACA,OAAM,QACN,UAAQ,GACR,UAAU,QACV,OACA,MACA,WACA,WACA,UACA,qBACA;;EAGD;EACC,UAAI;EACJ,OAAA;EACA,OAAO;EACP,CAAA;;;EAKD,MAAM,OAAA,IAAA,SAAqB,uBAAG;AAC7B,MAAA,CAAK,KAAM;;;AAKX,SAAI,QAAU,KAAA;AACb,SAAM,QAAQ,KAAK;AACnB;;;AAID,QAAM,QAAQ,KAAK;;;AAIpB,MAAK,CAAC,MAAA,SAAgB;;gBAKrB,KAAK,EAAC,QAAS;EAIf,MAAM,SAAA,EAAA,WAAA,UAAA,WAAM,MAAY;;AAGxB,aAAW,MAAE,KAAS;;;AAIvB,MAAK,CAAC,MAAA,SAAgB;;AAGrB,qBAAiB,MAAK,KAAA;;;AAIvB,eAAA,aAAW,gBAAc;QAGzB,iBAAA,GAAA,kBAAA,MAAA,OAAA;EACE;EACA,YAAA,GAAA,WAAA,SAAQ,eAAA,WAAA,GACR,yBAAyB,UACxB,CAAC;EACF,OAAE;GAAA,GAAA;GAAA;GAAA;YALJ;GAOC,iBAAA,GAAA,kBAAA,KAAA,OAAA;IACE,WAAA;IACA,OAAA;MACA,WAAO,WAAA,UAAA,MAAA;MACL,WAAW,cAAY,aAAe;MACtC,WAAW,cAAc,aAAa;KACvC;cAEF;IACE,CAAA;;IAGD,YAAA,GAAA,WAAA,SAAA,oBAAA,GACA,yBAAyB,MAAA,UACxB,CAAC;IACF,aAAE;IACF,cAAa;IACb,gBAAc,MAAA,EAAA,gBAAe;cAE9B,iBAAA,GAAA,kBAAA,KAAA,OAAA;KAAA,WAAA;eAAA;KAAA,CAAA;IACM,CAAA;;;;;GAGD"}
@@ -0,0 +1,6 @@
1
+ //#region packages/components/river/index.tsx
2
+ var river_default = require("./river.cjs").default;
3
+ //#endregion
4
+ exports.default = river_default;
5
+
6
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","names":["River"],"sources":["../../../../packages/components/river/index.tsx"],"sourcesContent":["import River from \"./river\";\n\nexport default River;\n"],"mappings":";AAEA,IAAA,uCAAeA"}
@@ -0,0 +1,116 @@
1
+ const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
+ const require_hooks = require("../../js/hooks.cjs");
3
+ let classnames = require("classnames");
4
+ classnames = require_runtime.__toESM(classnames);
5
+ let react = require("react");
6
+ let react_jsx_runtime = require("react/jsx-runtime");
7
+ //#region packages/components/river/river.tsx
8
+ const River = (props) => {
9
+ const { children, className, speed = 1, pauseOnHover, ...restProps } = props;
10
+ const trackRef = (0, react.useRef)(null);
11
+ const state = require_hooks.useReactive({
12
+ initialized: false,
13
+ offset: 0,
14
+ queue: [],
15
+ paddingLeft: 0,
16
+ pause: false
17
+ });
18
+ const rafRef = (0, react.useRef)(null);
19
+ const sizeRef = (0, react.useRef)([]);
20
+ const [items, length] = (0, react.useMemo)(() => {
21
+ const nodes = react.Children.toArray(children);
22
+ return [nodes, nodes.length];
23
+ }, [children]);
24
+ const animate = () => {
25
+ if (!trackRef.current) return;
26
+ let next = state.offset - speed;
27
+ const d = Math.abs(next);
28
+ const [head, ...restQueue] = state.queue;
29
+ const size = sizeRef.current.at(head % length) ?? 0;
30
+ if (d > size) {
31
+ const tail = state.queue.at(-1);
32
+ state.queue = [...restQueue, tail + 1];
33
+ next += size;
34
+ }
35
+ state.offset = next;
36
+ if (!state.pause) rafRef.current = requestAnimationFrame(animate);
37
+ };
38
+ const cancelRaf = () => {
39
+ if (!rafRef.current) return;
40
+ cancelAnimationFrame(rafRef.current);
41
+ rafRef.current = null;
42
+ };
43
+ const handleMouseOver = () => {
44
+ if (!pauseOnHover) return;
45
+ state.pause = true;
46
+ cancelRaf();
47
+ };
48
+ const handleMouseLeave = () => {
49
+ if (!pauseOnHover) return;
50
+ state.pause = false;
51
+ rafRef.current = requestAnimationFrame(animate);
52
+ };
53
+ (0, react.useLayoutEffect)(() => {
54
+ if (!trackRef.current) return;
55
+ const parentWidth = trackRef.current.offsetParent.offsetWidth;
56
+ const nodes = Array.from(trackRef.current.childNodes);
57
+ const length = nodes.length;
58
+ if (length < 2) return;
59
+ let contentWidth = trackRef.current.scrollWidth;
60
+ let count = 0;
61
+ const tails = [];
62
+ const sizes = nodes.map((node) => {
63
+ return node.offsetWidth;
64
+ });
65
+ sizeRef.current = sizes;
66
+ while (contentWidth < parentWidth) {
67
+ const w = sizes.at(count % length) ?? 0;
68
+ tails.push(length + count);
69
+ contentWidth += w;
70
+ count += 1;
71
+ }
72
+ state.offset = -1 * sizes.at(-1);
73
+ state.queue = [
74
+ -1,
75
+ ...sizes.map((_, i) => i),
76
+ ...tails
77
+ ];
78
+ animate();
79
+ state.initialized = true;
80
+ return () => {
81
+ state.queue = [];
82
+ state.initialized = false;
83
+ state.offset = 0;
84
+ cancelRaf();
85
+ };
86
+ }, [children]);
87
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
88
+ ...restProps,
89
+ className: (0, classnames.default)("i-river", { "i-river-initialized": state.initialized }, className),
90
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
91
+ ref: trackRef,
92
+ className: "i-river-track",
93
+ style: {
94
+ transform: `translate3d(${state.offset}px, 0, 0)`,
95
+ paddingLeft: state.paddingLeft
96
+ },
97
+ onMouseOver: handleMouseOver,
98
+ onMouseLeave: handleMouseLeave,
99
+ children: [!state.initialized && react.Children.map(children, (item, i) => {
100
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
101
+ className: "i-river-item",
102
+ children: item
103
+ }, i);
104
+ }), state.initialized && state.queue.map((index) => {
105
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
106
+ className: "i-river-item",
107
+ children: items.at(index % items.length)
108
+ }, index);
109
+ })]
110
+ })
111
+ });
112
+ };
113
+ //#endregion
114
+ exports.default = River;
115
+
116
+ //# sourceMappingURL=river.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"river.cjs","names":[],"sources":["../../../../packages/components/river/river.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport { Children, useLayoutEffect, useMemo, useRef } from \"react\";\nimport { useReactive } from \"../../js/hooks\";\nimport \"./index.css\";\nimport { IRiver } from \"./type\";\n\nconst River = (props: IRiver) => {\n\tconst {\n\t\tchildren,\n\t\tclassName,\n\t\tspeed = 1,\n\t\tpauseOnHover,\n\t\t...restProps\n\t} = props;\n\tconst trackRef = useRef<HTMLDivElement>(null);\n\tconst state = useReactive<any>({\n\t\tinitialized: false,\n\t\toffset: 0,\n\t\tqueue: [],\n\t\tpaddingLeft: 0,\n\t\tpause: false,\n\t});\n\tconst rafRef = useRef<any>(null);\n\tconst sizeRef = useRef<number[]>([]);\n\tconst [items, length] = useMemo(() => {\n\t\tconst nodes = Children.toArray(children);\n\n\t\treturn [nodes, nodes.length];\n\t}, [children]);\n\n\tconst animate = () => {\n\t\tif (!trackRef.current) return;\n\n\t\tlet next = state.offset - speed;\n\t\tconst d = Math.abs(next);\n\t\tconst [head, ...restQueue] = state.queue;\n\t\tconst size = sizeRef.current.at(head % length) ?? 0;\n\n\t\tif (d > size) {\n\t\t\tconst tail = state.queue.at(-1);\n\t\t\tconst newQueue = [...restQueue, tail + 1];\n\n\t\t\tstate.queue = newQueue;\n\t\t\tnext += size;\n\t\t}\n\n\t\tstate.offset = next;\n\n\t\tif (!state.pause) {\n\t\t\trafRef.current = requestAnimationFrame(animate);\n\t\t}\n\t};\n\n\tconst cancelRaf = () => {\n\t\tif (!rafRef.current) return;\n\n\t\tcancelAnimationFrame(rafRef.current);\n\t\trafRef.current = null;\n\t};\n\n\tconst handleMouseOver = () => {\n\t\tif (!pauseOnHover) return;\n\n\t\tstate.pause = true;\n\t\tcancelRaf();\n\t};\n\n\tconst handleMouseLeave = () => {\n\t\tif (!pauseOnHover) return;\n\n\t\tstate.pause = false;\n\t\trafRef.current = requestAnimationFrame(animate);\n\t};\n\n\tuseLayoutEffect(() => {\n\t\tif (!trackRef.current) return;\n\n\t\tconst pa = trackRef.current.offsetParent as HTMLDivElement;\n\t\tconst parentWidth = pa.offsetWidth;\n\t\tconst nodes = Array.from(trackRef.current.childNodes);\n\t\tconst length = nodes.length;\n\n\t\tif (length < 2) return;\n\n\t\tlet contentWidth = trackRef.current.scrollWidth;\n\t\tlet count = 0;\n\t\tconst tails: number[] = [];\n\n\t\tconst sizes = nodes.map((node: any) => {\n\t\t\treturn node.offsetWidth;\n\t\t});\n\t\tsizeRef.current = sizes;\n\n\t\twhile (contentWidth < parentWidth) {\n\t\t\tconst w = sizes.at(count % length) ?? 0;\n\t\t\ttails.push(length + count);\n\t\t\tcontentWidth += w;\n\t\t\tcount += 1;\n\t\t}\n\n\t\tstate.offset = -1 * sizes.at(-1);\n\t\tstate.queue = [-1, ...sizes.map((_, i) => i), ...tails];\n\n\t\tanimate();\n\t\tstate.initialized = true;\n\n\t\treturn () => {\n\t\t\tstate.queue = [];\n\t\t\tstate.initialized = false;\n\t\t\tstate.offset = 0;\n\n\t\t\tcancelRaf();\n\t\t};\n\t}, [children]);\n\n\treturn (\n\t\t<div\n\t\t\t{...restProps}\n\t\t\tclassName={classNames(\n\t\t\t\t\"i-river\",\n\t\t\t\t{\n\t\t\t\t\t\"i-river-initialized\": state.initialized,\n\t\t\t\t},\n\t\t\t\tclassName\n\t\t\t)}\n\t\t>\n\t\t\t<div\n\t\t\t\tref={trackRef}\n\t\t\t\tclassName='i-river-track'\n\t\t\t\tstyle={{\n\t\t\t\t\ttransform: `translate3d(${state.offset}px, 0, 0)`,\n\t\t\t\t\tpaddingLeft: state.paddingLeft,\n\t\t\t\t}}\n\t\t\t\tonMouseOver={handleMouseOver}\n\t\t\t\tonMouseLeave={handleMouseLeave}\n\t\t\t>\n\t\t\t\t{!state.initialized &&\n\t\t\t\t\tChildren.map(children, (item, i) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<div className='i-river-item' key={i}>\n\t\t\t\t\t\t\t\t{item}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\n\t\t\t\t{state.initialized &&\n\t\t\t\t\tstate.queue.map((index) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<div className='i-river-item' key={index}>\n\t\t\t\t\t\t\t\t{items.at(index % items.length)}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default River;\n"],"mappings":";;;;;;;;CAMA,MAAM,EACL,UACC,WACA,QAAA,GACA,cACA,GAAA,cACG;CACJ,MAAI,YAAA,GAAA,MAAA,QAAK,KAAA;CACT,MAAM,QAAQ,cAAA,YAAU;EACxB,aAAc;EACb,QAAA;EACA,OAAO,EAAE;EACT,aAAS;EACT,OAAA;EACA,CAAA;CACD,MAAE,UAAA,GAAA,MAAA,QAAA,KAAA;CACF,MAAM,WAAA,GAAA,MAAA,QAA0B,EAAA,CAAA;CAChC,MAAM,CAAA,OAAQ,WAAA,GAAA,MAAA,eAAsB;EACpC,MAAO,QAAO,MAAA,SAAU,QAAQ,SAAM;;IAGrC,CAAA,SAAQ,CAAK;;AAGd,MAAK,CAAC,SAAS,QAAO;;EAGrB,MAAI,IAAM,KAAC,IAAM,KAAO;EACxB,MAAM,CAAC,MAAG,GAAK,aAAS,MAAA;EACxB,MAAM,OAAO,QAAG,QAAa,GAAA,OAAM,OAAK,IAAA;;GAGxC,MAAO,OAAO,MAAA,MAAA,GAAA,GAAA;iBACA,CAAK,GAAC,WAAY,OAAA,EAAA;AAG/B,WAAM;;;mBAMP,QAAK,UAAa,sBAAA,QAAA;;;AAKnB,MAAK,CAAC,OAAA,QAAgB;;AAGrB,SAAA,UAAA;;;AAID,MAAK,CAAC,aAAA;;AAGL,aAAW;;;AAIZ,MAAK,CAAC,aAAA;;AAGL,SAAM,UAAQ,sBAAK,QAAA;;;AAIpB,MAAA,CAAA,SAAe,QAAO;EAGrB,MAAM,cAAA,SAAA,QAAA,aAAc;EACpB,MAAM,QAAA,MAAc,KAAG,SAAW,QAAA,WAAA;EAClC,MAAM,SAAQ,MAAM;;;EAKpB,IAAI,QAAA;EACJ,MAAI,QAAS,EAAA;;AAGb,UAAM,KAAO;IACZ;AACD,UAAE,UAAA;;GAGF,MAAO,IAAA,MAAA,GAAa,QAAE,OAAa,IAAA;AAClC,SAAM,KAAI,SAAS,MAAO;AAC1B,mBAAW;AACX,YAAA;;;AAID,QAAM,QAAQ;GAAC;GAAI,GAAC,MAAQ,KAAI,GAAA,MAAA,EAAA;GAAA,GAAA;GAAA;;AAGhC,QAAA,cAAS;;AAGT,SAAO,QAAM,EAAA;AACZ,SAAM,cAAU;AAChB,SAAM,SAAA;;;IAIN,CAAA,SAAA,CAAA;QAGF,iBAAA,GAAA,kBAAA,KAAA,OAAA;EACE,GAAA;EACA,YAAA,GAAA,WAAA,SACA,WACC,EACA,uBAAA,MAAA,aACC,EACD,UACA;YAEF,iBAAA,GAAA,kBAAA,MAAA,OAAA;GACE,KAAA;GACA,WAAK;GACL,OAAA;IACA,WAAO,eAAA,MAAA,OAAA;IACN,aAAY,MAAA;IACZ;GACD,aAAC;GACD,cAAa;aARf,CAUC,CAAA,MAAA,eACE,MAAA,SAAO,IAAA,WAAa,MAAA,MAAA;AACpB,WACC,iBAAA,GAAA,kBAAA,KAAA,OAAA;KAAM,WAAC;eACL;KACK,EAFA,EAEA;KAEN,EAAA,MAAA,eAGF,MAAM,MAAA,KAAW,UAAE;AACnB,WACC,iBAAA,GAAA,kBAAA,KAAA,OAAA;KAAM,WAAC;eACL,MAAI,GAAA,QAAa,MAAM,OAAM;KAC5B,EAFI,MAEJ;KAEF,CACA;;EACC,CAAA"}
@@ -0,0 +1,6 @@
1
+ //#region packages/components/select/index.tsx
2
+ var select_default = require("./select.cjs").default;
3
+ //#endregion
4
+ exports.default = select_default;
5
+
6
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","names":["Select"],"sources":["../../../../packages/components/select/index.tsx"],"sourcesContent":["import Select from \"./select\";\n\nexport default Select;\n"],"mappings":";AAEA,IAAA,yCAAeA"}
@@ -0,0 +1,76 @@
1
+ const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
+ const require_index = require("../icon/index.cjs");
3
+ const require_index$1 = require("../utils/empty/index.cjs");
4
+ const require_index$2 = require("../list/index.cjs");
5
+ const require_index$3 = require("../tag/index.cjs");
6
+ let classnames = require("classnames");
7
+ classnames = require_runtime.__toESM(classnames);
8
+ let _ricons_material = require("@ricons/material");
9
+ let react_jsx_runtime = require("react/jsx-runtime");
10
+ //#region packages/components/select/options.tsx
11
+ const Options = (props) => {
12
+ const { value: val, options, filter, filterPlaceholder, multiple, empty = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index$1.default, {}), onSelect, onFilter } = props;
13
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
14
+ className: (0, classnames.default)("i-select-options", { "i-select-options-multiple": multiple }),
15
+ children: [
16
+ filter && multiple && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
17
+ className: "i-select-filter",
18
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.default, {
19
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ricons_material.SearchRound, {}),
20
+ className: "color-8 ml-8 my-auto",
21
+ size: "1.2em"
22
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
23
+ type: "text",
24
+ className: "i-input",
25
+ placeholder: filterPlaceholder,
26
+ onChange: onFilter
27
+ })]
28
+ }),
29
+ options.length === 0 && empty,
30
+ options.map((option, i) => {
31
+ const { label, value, disabled } = option;
32
+ const isActive = multiple ? val?.includes(value) : val === value;
33
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_index$2.default.Item, {
34
+ active: isActive,
35
+ type: "option",
36
+ onClick: () => onSelect?.(value, option),
37
+ disabled,
38
+ children: [multiple && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.default, {
39
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ricons_material.CheckRound, {}),
40
+ className: "i-select-option-check",
41
+ size: "1em"
42
+ }), label]
43
+ }, value || i);
44
+ })
45
+ ]
46
+ });
47
+ };
48
+ const activeOptions = (options = [], value = [], max = 3) => {
49
+ const total = options.flatMap((opt) => value.includes(opt.value) ? [opt] : []);
50
+ if (max >= total.length) return total;
51
+ const rest = total.length - max;
52
+ const after = total.slice(0, max);
53
+ after.push(rest);
54
+ return after;
55
+ };
56
+ const displayValue = (config) => {
57
+ const { options, value, maxDisplay, multiple, onSelect } = config;
58
+ if (multiple) return activeOptions(options, value, maxDisplay).map((opt, i) => {
59
+ if (typeof opt === "number") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_index$3.default, { children: ["+", opt] }, i);
60
+ const { label, value } = opt;
61
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index$3.default, {
62
+ hoverShowClose: true,
63
+ onClose: (e) => {
64
+ e?.stopPropagation();
65
+ onSelect?.(value, opt);
66
+ },
67
+ children: label
68
+ }, value);
69
+ });
70
+ return options.find((opt) => opt.value === value)?.label;
71
+ };
72
+ //#endregion
73
+ exports.Options = Options;
74
+ exports.displayValue = displayValue;
75
+
76
+ //# sourceMappingURL=options.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.cjs","names":["Empty","Icon","SearchRound","List","CheckRound","Tag"],"sources":["../../../../packages/components/select/options.tsx"],"sourcesContent":["import { CheckRound, SearchRound } from \"@ricons/material\";\nimport classNames from \"classnames\";\nimport { TOption } from \"../../type\";\nimport Icon from \"../icon\";\nimport List from \"../list\";\nimport Tag from \"../tag\";\nimport Empty from \"../utils/empty\";\nimport { ISelectOptions } from \"./type\";\nexport const Options = (props: ISelectOptions) => {\n\tconst {\n\t\tvalue: val,\n\t\toptions,\n\t\tfilter,\n\t\tfilterPlaceholder,\n\t\tmultiple,\n\t\tempty = <Empty />,\n\t\tonSelect,\n\t\tonFilter,\n\t} = props;\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(\"i-select-options\", {\n\t\t\t\t\"i-select-options-multiple\": multiple,\n\t\t\t})}\n\t\t>\n\t\t\t{filter && multiple && (\n\t\t\t\t<div className='i-select-filter'>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={<SearchRound />}\n\t\t\t\t\t\tclassName='color-8 ml-8 my-auto'\n\t\t\t\t\t\tsize='1.2em'\n\t\t\t\t\t/>\n\t\t\t\t\t<input\n\t\t\t\t\t\ttype='text'\n\t\t\t\t\t\tclassName='i-input'\n\t\t\t\t\t\tplaceholder={filterPlaceholder}\n\t\t\t\t\t\tonChange={onFilter}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t{options.length === 0 && empty}\n\n\t\t\t{options.map((option, i) => {\n\t\t\t\tconst { label, value, disabled } = option;\n\t\t\t\tconst isActive = multiple\n\t\t\t\t\t? val?.includes(value)\n\t\t\t\t\t: val === value;\n\n\t\t\t\treturn (\n\t\t\t\t\t<List.Item\n\t\t\t\t\t\tkey={(value as string) || i}\n\t\t\t\t\t\tactive={isActive}\n\t\t\t\t\t\ttype='option'\n\t\t\t\t\t\tonClick={() => onSelect?.(value, option)}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t>\n\t\t\t\t\t\t{multiple && (\n\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\ticon={<CheckRound />}\n\t\t\t\t\t\t\t\tclassName='i-select-option-check'\n\t\t\t\t\t\t\t\tsize='1em'\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{label}\n\t\t\t\t\t</List.Item>\n\t\t\t\t);\n\t\t\t})}\n\t\t</div>\n\t);\n};\n\nexport const activeOptions = (\n\toptions: TOption[] = [],\n\tvalue: any[] = [],\n\tmax = 3\n) => {\n\tconst total = options.flatMap((opt) =>\n\t\tvalue.includes(opt.value) ? [opt] : []\n\t);\n\n\tif (max >= total.length) return total;\n\n\tconst rest = total.length - max;\n\tconst after = total.slice(0, max);\n\tafter.push(rest as any);\n\n\treturn after;\n};\n\nexport const displayValue = (config) => {\n\tconst { options, value, maxDisplay, multiple, onSelect } = config;\n\n\tif (multiple) {\n\t\treturn activeOptions(options, value, maxDisplay).map((opt, i) => {\n\t\t\tif (typeof opt === \"number\") return <Tag key={i}>+{opt}</Tag>;\n\n\t\t\tconst { label, value } = opt;\n\n\t\t\treturn (\n\t\t\t\t<Tag\n\t\t\t\t\tkey={value as string}\n\t\t\t\t\thoverShowClose\n\t\t\t\t\tonClose={(e) => {\n\t\t\t\t\t\te?.stopPropagation();\n\t\t\t\t\t\tonSelect?.(value, opt);\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{label}\n\t\t\t\t</Tag>\n\t\t\t);\n\t\t});\n\t}\n\n\treturn options.find((opt: TOption) => opt.value === value)?.label;\n};\n"],"mappings":";;;;;;;;;;AAQA,MAAa,WAAW,UAA0B;CACjD,MAAM,EACL,OAAO,KACP,SACA,QACA,mBACA,UACA,QAAQ,iBAAA,GAAA,kBAAA,KAACA,gBAAAA,SAAD,EAAS,CAAA,EACjB,UACA,aACG;AAEJ,QACC,iBAAA,GAAA,kBAAA,MAAC,OAAD;EACC,YAAA,GAAA,WAAA,SAAsB,oBAAoB,EACzC,6BAA6B,UAC7B,CAAC;YAHH;GAKE,UAAU,YACV,iBAAA,GAAA,kBAAA,MAAC,OAAD;IAAK,WAAU;cAAf,CACC,iBAAA,GAAA,kBAAA,KAACC,cAAAA,SAAD;KACC,MAAM,iBAAA,GAAA,kBAAA,KAACC,iBAAAA,aAAD,EAAe,CAAA;KACrB,WAAU;KACV,MAAK;KACJ,CAAA,EACF,iBAAA,GAAA,kBAAA,KAAC,SAAD;KACC,MAAK;KACL,WAAU;KACV,aAAa;KACb,UAAU;KACT,CAAA,CACG;;GAGN,QAAQ,WAAW,KAAK;GAExB,QAAQ,KAAK,QAAQ,MAAM;IAC3B,MAAM,EAAE,OAAO,OAAO,aAAa;IACnC,MAAM,WAAW,WACd,KAAK,SAAS,MAAM,GACpB,QAAQ;AAEX,WACC,iBAAA,GAAA,kBAAA,MAACC,gBAAAA,QAAK,MAAN;KAEC,QAAQ;KACR,MAAK;KACL,eAAe,WAAW,OAAO,OAAO;KAC9B;eALX,CAOE,YACA,iBAAA,GAAA,kBAAA,KAACF,cAAAA,SAAD;MACC,MAAM,iBAAA,GAAA,kBAAA,KAACG,iBAAAA,YAAD,EAAc,CAAA;MACpB,WAAU;MACV,MAAK;MACJ,CAAA,EAEF,MACU;OAdL,SAAoB,EAcf;KAEZ;GACG;;;AAIR,MAAa,iBACZ,UAAqB,EAAE,EACvB,QAAe,EAAE,EACjB,MAAM,MACF;CACJ,MAAM,QAAQ,QAAQ,SAAS,QAC9B,MAAM,SAAS,IAAI,MAAM,GAAG,CAAC,IAAI,GAAG,EAAE,CACtC;AAED,KAAI,OAAO,MAAM,OAAQ,QAAO;CAEhC,MAAM,OAAO,MAAM,SAAS;CAC5B,MAAM,QAAQ,MAAM,MAAM,GAAG,IAAI;AACjC,OAAM,KAAK,KAAY;AAEvB,QAAO;;AAGR,MAAa,gBAAgB,WAAW;CACvC,MAAM,EAAE,SAAS,OAAO,YAAY,UAAU,aAAa;AAE3D,KAAI,SACH,QAAO,cAAc,SAAS,OAAO,WAAW,CAAC,KAAK,KAAK,MAAM;AAChE,MAAI,OAAO,QAAQ,SAAU,QAAO,iBAAA,GAAA,kBAAA,MAACC,gBAAAA,SAAD,EAAA,UAAA,CAAa,KAAE,IAAU,EAAA,EAAf,EAAe;EAE7D,MAAM,EAAE,OAAO,UAAU;AAEzB,SACC,iBAAA,GAAA,kBAAA,KAACA,gBAAAA,SAAD;GAEC,gBAAA;GACA,UAAU,MAAM;AACf,OAAG,iBAAiB;AACpB,eAAW,OAAO,IAAI;;aAGtB;GACI,EARA,MAQA;GAEN;AAGH,QAAO,QAAQ,MAAM,QAAiB,IAAI,UAAU,MAAM,EAAE"}
@@ -0,0 +1,155 @@
1
+ const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
+ const require_utils = require("../../js/utils.cjs");
3
+ const require_index = require("../utils/helpericon/index.cjs");
4
+ const require_index$1 = require("../popup/index.cjs");
5
+ const require_options = require("./options.cjs");
6
+ let classnames = require("classnames");
7
+ classnames = require_runtime.__toESM(classnames);
8
+ 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");
9
+ let react = require("react");
10
+ let _ricons_material = require("@ricons/material");
11
+ let react_jsx_runtime = require("react/jsx-runtime");
12
+ //#region packages/components/select/select.tsx
13
+ const Select = (props) => {
14
+ const { ref, type = "text", name, label, value = "", placeholder, options = [], multiple, prepend, append, labelInline, style, className, message, status = "normal", hideClear, hideArrow, maxDisplay, border, filter, tip, filterPlaceholder = "...", popupProps, onSelect, onChange, ...restProps } = props;
15
+ const [filterValue, setFilterValue] = (0, react.useState)("");
16
+ const [selectedValue, setSelectedValue] = (0, react.useState)(value);
17
+ const [active, setActive] = (0, react.useState)(false);
18
+ const formattedOptions = (0, react.useMemo)(() => require_utils.formatOption(options), [options]);
19
+ const filterOptions = (0, react.useMemo)(() => {
20
+ const fv = filterValue;
21
+ if (!fv || !filter) return formattedOptions;
22
+ const filterFn = typeof filter === "function" ? filter : (opt) => opt.value.includes(fv) || opt.label.includes(fv);
23
+ return formattedOptions.filter(filterFn);
24
+ }, [
25
+ formattedOptions,
26
+ filter,
27
+ filterValue
28
+ ]);
29
+ const changeValue = (v) => {
30
+ setSelectedValue(v);
31
+ onChange?.(v);
32
+ };
33
+ const displayLabel = (0, react.useMemo)(() => {
34
+ if (multiple) return "";
35
+ const option = formattedOptions.find((opt) => opt.value === selectedValue);
36
+ return option ? option.label : selectedValue;
37
+ }, [selectedValue, formattedOptions]);
38
+ const handleSelect = (value, option) => {
39
+ onSelect?.(value, option);
40
+ if (multiple) {
41
+ const values = [...selectedValue];
42
+ const i = values.findIndex((v) => v === value);
43
+ i > -1 ? values.splice(i, 1) : values.push(value);
44
+ changeValue(values);
45
+ return;
46
+ }
47
+ setActive(false);
48
+ changeValue(value);
49
+ };
50
+ const handleVisibleChange = (visible) => {
51
+ setActive(visible);
52
+ if (!filter) return;
53
+ setFilterValue("");
54
+ };
55
+ const handleHelperClick = (e) => {
56
+ e.stopPropagation();
57
+ setActive(true);
58
+ if (!active) return;
59
+ changeValue(multiple ? [] : "");
60
+ };
61
+ const handleFilterChange = (0, _Users_iann_codes_ioca_react_node_modules__pnpm_radash_12_1_1_node_modules_radash_dist_esm_index_mjs.debounce)({ delay: 400 }, (e) => {
62
+ const v = e.target.value;
63
+ setFilterValue(v);
64
+ });
65
+ const handleInputChange = (e) => {
66
+ setFilterValue(e.target.value);
67
+ };
68
+ (0, react.useEffect)(() => {
69
+ setSelectedValue(value);
70
+ }, [value]);
71
+ const hasValue = multiple ? selectedValue.length > 0 : !!selectedValue;
72
+ const clearable = !hideClear && active && hasValue;
73
+ const text = message ?? tip;
74
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
75
+ className: (0, classnames.default)("i-input-label", className, { "i-input-inline": labelInline }),
76
+ style,
77
+ children: [
78
+ label && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
79
+ className: "i-input-label-text",
80
+ children: label
81
+ }),
82
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index$1.default, {
83
+ position: "bottom",
84
+ arrow: false,
85
+ fitSize: true,
86
+ offset: 0,
87
+ ...popupProps,
88
+ visible: active,
89
+ trigger: "none",
90
+ onVisibleChange: handleVisibleChange,
91
+ content: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_options.Options, {
92
+ options: filterOptions,
93
+ value: selectedValue,
94
+ multiple,
95
+ filter: !!filter,
96
+ filterPlaceholder,
97
+ onSelect: handleSelect,
98
+ onFilter: handleFilterChange
99
+ }),
100
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
101
+ className: (0, classnames.default)("i-input-item", {
102
+ [`i-input-${status}`]: status !== "normal",
103
+ "i-input-borderless": !border,
104
+ "i-input-focus": active
105
+ }),
106
+ onClick: () => setActive(true),
107
+ children: [
108
+ prepend,
109
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
110
+ ref,
111
+ type: "hidden",
112
+ value: selectedValue,
113
+ ...restProps
114
+ }),
115
+ multiple ? hasValue ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
116
+ className: (0, classnames.default)("i-input i-select", { "i-select-multiple": multiple }),
117
+ children: require_options.displayValue({
118
+ options: formattedOptions,
119
+ value: selectedValue,
120
+ multiple,
121
+ maxDisplay,
122
+ onSelect: handleSelect
123
+ })
124
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
125
+ className: "i-input i-select",
126
+ placeholder,
127
+ readOnly: true
128
+ }) : null,
129
+ !multiple && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
130
+ value: active ? filterValue : displayLabel,
131
+ className: "i-input i-select",
132
+ placeholder: displayLabel || placeholder,
133
+ onChange: handleInputChange,
134
+ readOnly: !filter
135
+ }),
136
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.default, {
137
+ active: !hideArrow,
138
+ icon: clearable ? void 0 : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ricons_material.UnfoldMoreRound, {}),
139
+ onClick: handleHelperClick
140
+ }),
141
+ append
142
+ ]
143
+ })
144
+ }),
145
+ text && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
146
+ className: "i-input-message",
147
+ children: text
148
+ })
149
+ ]
150
+ });
151
+ };
152
+ //#endregion
153
+ exports.default = Select;
154
+
155
+ //# sourceMappingURL=select.cjs.map