@ioca/react 1.5.19 → 1.5.21

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 (605) hide show
  1. package/lib/css/index.css +1 -2
  2. package/lib/es/components/affix/affix.js +1 -1
  3. package/lib/es/components/affix/index.js +0 -1
  4. package/lib/es/components/affix/totop.js +0 -1
  5. package/lib/es/components/badge/badge.js +1 -1
  6. package/lib/es/components/badge/index.js +0 -1
  7. package/lib/es/components/button/button.js +1 -1
  8. package/lib/es/components/button/confirm.js +0 -1
  9. package/lib/es/components/button/group.js +0 -1
  10. package/lib/es/components/button/index.js +0 -1
  11. package/lib/es/components/button/toggle.js +0 -1
  12. package/lib/es/components/card/card.js +1 -1
  13. package/lib/es/components/card/index.js +0 -1
  14. package/lib/es/components/checkbox/checkbox.js +2 -1
  15. package/lib/es/components/checkbox/index.js +0 -1
  16. package/lib/es/components/checkbox/item.js +0 -1
  17. package/lib/es/components/collapse/collapse.js +1 -1
  18. package/lib/es/components/collapse/index.js +0 -1
  19. package/lib/es/components/collapse/item.js +0 -1
  20. package/lib/es/components/datagrid/cell.js +0 -1
  21. package/lib/es/components/datagrid/datagrid.js +1 -1
  22. package/lib/es/components/datagrid/helper.js +0 -1
  23. package/lib/es/components/datagrid/index.js +0 -1
  24. package/lib/es/components/datagrid/resize.js +0 -1
  25. package/lib/es/components/datagrid/row.js +0 -1
  26. package/lib/es/components/datagrid/sorter.js +0 -1
  27. package/lib/es/components/datagrid/virtual.js +130 -104
  28. package/lib/es/components/description/description.js +1 -1
  29. package/lib/es/components/description/index.js +0 -1
  30. package/lib/es/components/drawer/drawer.js +1 -1
  31. package/lib/es/components/drawer/index.js +0 -1
  32. package/lib/es/components/dropdown/dropdown.js +1 -1
  33. package/lib/es/components/dropdown/index.js +0 -1
  34. package/lib/es/components/dropdown/item.js +0 -1
  35. package/lib/es/components/editor/controls.js +0 -1
  36. package/lib/es/components/editor/editor.js +1 -1
  37. package/lib/es/components/editor/index.js +0 -1
  38. package/lib/es/components/editor/memtion.js +0 -1
  39. package/lib/es/components/flex/flex.js +1 -1
  40. package/lib/es/components/flex/index.js +0 -1
  41. package/lib/es/components/form/context.js +0 -1
  42. package/lib/es/components/form/field.js +0 -1
  43. package/lib/es/components/form/form.js +1 -1
  44. package/lib/es/components/form/index.js +0 -1
  45. package/lib/es/components/form/useConfig.js +0 -1
  46. package/lib/es/components/form/useForm.js +1 -2
  47. package/lib/es/components/form/utils.js +0 -1
  48. package/lib/es/components/icon/icon.js +1 -1
  49. package/lib/es/components/icon/index.js +0 -1
  50. package/lib/es/components/image/image.js +1 -1
  51. package/lib/es/components/image/index.js +0 -1
  52. package/lib/es/components/image/list.js +0 -1
  53. package/lib/es/components/input/container.js +0 -1
  54. package/lib/es/components/input/index.js +0 -1
  55. package/lib/es/components/input/input.js +1 -1
  56. package/lib/es/components/input/number.js +1 -1
  57. package/lib/es/components/input/range.js +1 -1
  58. package/lib/es/components/input/textarea.js +1 -1
  59. package/lib/es/components/list/index.js +0 -1
  60. package/lib/es/components/list/item.js +0 -1
  61. package/lib/es/components/list/list.js +1 -1
  62. package/lib/es/components/loading/index.js +0 -1
  63. package/lib/es/components/loading/loading.js +1 -1
  64. package/lib/es/components/message/index.js +0 -1
  65. package/lib/es/components/message/message.js +1 -1
  66. package/lib/es/components/modal/content.js +1 -1
  67. package/lib/es/components/modal/context.js +0 -1
  68. package/lib/es/components/modal/hookModal.js +0 -1
  69. package/lib/es/components/modal/index.js +0 -1
  70. package/lib/es/components/modal/modal.js +1 -1
  71. package/lib/es/components/modal/modalManager.js +0 -1
  72. package/lib/es/components/modal/useModal.js +0 -1
  73. package/lib/es/components/pagination/index.js +0 -1
  74. package/lib/es/components/pagination/page.js +0 -1
  75. package/lib/es/components/pagination/pagination.js +1 -1
  76. package/lib/es/components/picker/colors/footer.js +0 -1
  77. package/lib/es/components/picker/colors/handle.js +0 -1
  78. package/lib/es/components/picker/colors/index.js +1 -1
  79. package/lib/es/components/picker/daterange/daterange.js +2 -1
  80. package/lib/es/components/picker/daterange/index.js +0 -1
  81. package/lib/es/components/picker/daterange/panel.js +0 -1
  82. package/lib/es/components/picker/dates/dates.js +0 -1
  83. package/lib/es/components/picker/dates/index.js +1 -1
  84. package/lib/es/components/picker/dates/panel.js +0 -1
  85. package/lib/es/components/picker/time/index.js +0 -1
  86. package/lib/es/components/picker/time/item.js +0 -1
  87. package/lib/es/components/picker/time/panel.js +1 -1
  88. package/lib/es/components/popconfirm/index.js +0 -1
  89. package/lib/es/components/popconfirm/popconfirm.js +1 -1
  90. package/lib/es/components/popup/content.js +0 -1
  91. package/lib/es/components/popup/index.js +0 -1
  92. package/lib/es/components/popup/popup.js +1 -1
  93. package/lib/es/components/progress/circle.js +0 -1
  94. package/lib/es/components/progress/index.js +0 -1
  95. package/lib/es/components/progress/line.js +0 -1
  96. package/lib/es/components/progress/progress.js +2 -1
  97. package/lib/es/components/radio/index.js +0 -1
  98. package/lib/es/components/radio/item.js +0 -1
  99. package/lib/es/components/radio/radio.js +2 -1
  100. package/lib/es/components/resizable/index.js +0 -1
  101. package/lib/es/components/resizable/resizable.js +1 -1
  102. package/lib/es/components/river/index.js +0 -1
  103. package/lib/es/components/river/river.js +1 -1
  104. package/lib/es/components/scroll/index.js +0 -1
  105. package/lib/es/components/scroll/scroll.js +1 -1
  106. package/lib/es/components/select/index.js +0 -1
  107. package/lib/es/components/select/options.js +0 -1
  108. package/lib/es/components/select/select.js +2 -1
  109. package/lib/es/components/step/divider.js +1 -1
  110. package/lib/es/components/step/index.js +0 -1
  111. package/lib/es/components/step/item.js +0 -1
  112. package/lib/es/components/step/step.js +1 -1
  113. package/lib/es/components/swiper/index.js +0 -1
  114. package/lib/es/components/swiper/item.js +0 -1
  115. package/lib/es/components/swiper/swiper.js +1 -1
  116. package/lib/es/components/tabs/contents.js +0 -1
  117. package/lib/es/components/tabs/helper.js +0 -1
  118. package/lib/es/components/tabs/index.js +0 -1
  119. package/lib/es/components/tabs/item.js +0 -1
  120. package/lib/es/components/tabs/navs.js +0 -1
  121. package/lib/es/components/tabs/tabs.js +9 -18
  122. package/lib/es/components/tag/index.js +0 -1
  123. package/lib/es/components/tag/tag.js +1 -1
  124. package/lib/es/components/text/highlight.js +0 -1
  125. package/lib/es/components/text/index.js +0 -1
  126. package/lib/es/components/text/number.js +0 -1
  127. package/lib/es/components/text/text.js +1 -1
  128. package/lib/es/components/text/time.js +0 -1
  129. package/lib/es/components/tree/index.js +0 -1
  130. package/lib/es/components/tree/item.js +44 -58
  131. package/lib/es/components/tree/tree.js +123 -20
  132. package/lib/es/components/tree/virtual.js +43 -0
  133. package/lib/es/components/upload/dropbox.js +0 -1
  134. package/lib/es/components/upload/index.js +0 -1
  135. package/lib/es/components/upload/renderFile.js +0 -1
  136. package/lib/es/components/upload/upload.js +1 -1
  137. package/lib/es/components/utils/empty/index.js +1 -1
  138. package/lib/es/components/utils/helpericon/helpericon.js +1 -1
  139. package/lib/es/components/utils/helpericon/index.js +0 -1
  140. package/lib/es/components/video/index.js +0 -1
  141. package/lib/es/components/video/video.js +1 -1
  142. package/lib/es/index.js +1 -1
  143. package/lib/es/js/hooks.js +0 -1
  144. package/lib/es/js/usePreview/content.js +3 -4
  145. package/lib/es/js/usePreview/index.js +1 -1
  146. package/lib/es/js/usePreview/renderFile.js +0 -1
  147. package/lib/es/js/usePreview/type.js +0 -1
  148. package/lib/es/js/useRipple/index.js +2 -1
  149. package/lib/es/js/useTheme/index.js +0 -1
  150. package/lib/es/js/utils.js +0 -1
  151. package/lib/index.js +338 -197
  152. package/lib/types/components/tabs/type.d.ts +1 -1
  153. package/lib/types/components/tree/type.d.ts +8 -5
  154. package/lib/types/js/usePreview/type.d.ts +1 -1
  155. package/package.json +8 -11
  156. package/lib/cjs/components/affix/affix.js +0 -80
  157. package/lib/cjs/components/affix/affix.js.map +0 -1
  158. package/lib/cjs/components/affix/index.js +0 -10
  159. package/lib/cjs/components/affix/index.js.map +0 -1
  160. package/lib/cjs/components/affix/totop.js +0 -21
  161. package/lib/cjs/components/affix/totop.js.map +0 -1
  162. package/lib/cjs/components/badge/badge.js +0 -21
  163. package/lib/cjs/components/badge/badge.js.map +0 -1
  164. package/lib/cjs/components/badge/index.js +0 -10
  165. package/lib/cjs/components/badge/index.js.map +0 -1
  166. package/lib/cjs/components/button/button.js +0 -72
  167. package/lib/cjs/components/button/button.js.map +0 -1
  168. package/lib/cjs/components/button/confirm.js +0 -58
  169. package/lib/cjs/components/button/confirm.js.map +0 -1
  170. package/lib/cjs/components/button/group.js +0 -29
  171. package/lib/cjs/components/button/group.js.map +0 -1
  172. package/lib/cjs/components/button/index.js +0 -10
  173. package/lib/cjs/components/button/index.js.map +0 -1
  174. package/lib/cjs/components/button/toggle.js +0 -47
  175. package/lib/cjs/components/button/toggle.js.map +0 -1
  176. package/lib/cjs/components/card/card.js +0 -21
  177. package/lib/cjs/components/card/card.js.map +0 -1
  178. package/lib/cjs/components/card/index.js +0 -10
  179. package/lib/cjs/components/card/index.js.map +0 -1
  180. package/lib/cjs/components/checkbox/checkbox.js +0 -47
  181. package/lib/cjs/components/checkbox/checkbox.js.map +0 -1
  182. package/lib/cjs/components/checkbox/index.js +0 -10
  183. package/lib/cjs/components/checkbox/index.js.map +0 -1
  184. package/lib/cjs/components/checkbox/item.js +0 -43
  185. package/lib/cjs/components/checkbox/item.js.map +0 -1
  186. package/lib/cjs/components/collapse/collapse.js +0 -80
  187. package/lib/cjs/components/collapse/collapse.js.map +0 -1
  188. package/lib/cjs/components/collapse/index.js +0 -10
  189. package/lib/cjs/components/collapse/index.js.map +0 -1
  190. package/lib/cjs/components/collapse/item.js +0 -12
  191. package/lib/cjs/components/collapse/item.js.map +0 -1
  192. package/lib/cjs/components/datagrid/cell.js +0 -34
  193. package/lib/cjs/components/datagrid/cell.js.map +0 -1
  194. package/lib/cjs/components/datagrid/datagrid.js +0 -219
  195. package/lib/cjs/components/datagrid/datagrid.js.map +0 -1
  196. package/lib/cjs/components/datagrid/helper.js +0 -83
  197. package/lib/cjs/components/datagrid/helper.js.map +0 -1
  198. package/lib/cjs/components/datagrid/index.js +0 -10
  199. package/lib/cjs/components/datagrid/index.js.map +0 -1
  200. package/lib/cjs/components/datagrid/resize.js +0 -72
  201. package/lib/cjs/components/datagrid/resize.js.map +0 -1
  202. package/lib/cjs/components/datagrid/row.js +0 -55
  203. package/lib/cjs/components/datagrid/row.js.map +0 -1
  204. package/lib/cjs/components/datagrid/sorter.js +0 -21
  205. package/lib/cjs/components/datagrid/sorter.js.map +0 -1
  206. package/lib/cjs/components/datagrid/virtual.js +0 -283
  207. package/lib/cjs/components/datagrid/virtual.js.map +0 -1
  208. package/lib/cjs/components/description/description.js +0 -36
  209. package/lib/cjs/components/description/description.js.map +0 -1
  210. package/lib/cjs/components/description/index.js +0 -10
  211. package/lib/cjs/components/description/index.js.map +0 -1
  212. package/lib/cjs/components/drawer/drawer.js +0 -77
  213. package/lib/cjs/components/drawer/drawer.js.map +0 -1
  214. package/lib/cjs/components/drawer/index.js +0 -10
  215. package/lib/cjs/components/drawer/index.js.map +0 -1
  216. package/lib/cjs/components/dropdown/dropdown.js +0 -36
  217. package/lib/cjs/components/dropdown/dropdown.js.map +0 -1
  218. package/lib/cjs/components/dropdown/index.js +0 -10
  219. package/lib/cjs/components/dropdown/index.js.map +0 -1
  220. package/lib/cjs/components/dropdown/item.js +0 -38
  221. package/lib/cjs/components/dropdown/item.js.map +0 -1
  222. package/lib/cjs/components/editor/controls.js +0 -64
  223. package/lib/cjs/components/editor/controls.js.map +0 -1
  224. package/lib/cjs/components/editor/editor.js +0 -287
  225. package/lib/cjs/components/editor/editor.js.map +0 -1
  226. package/lib/cjs/components/editor/index.js +0 -10
  227. package/lib/cjs/components/editor/index.js.map +0 -1
  228. package/lib/cjs/components/editor/memtion.js +0 -302
  229. package/lib/cjs/components/editor/memtion.js.map +0 -1
  230. package/lib/cjs/components/flex/flex.js +0 -36
  231. package/lib/cjs/components/flex/flex.js.map +0 -1
  232. package/lib/cjs/components/flex/index.js +0 -10
  233. package/lib/cjs/components/flex/index.js.map +0 -1
  234. package/lib/cjs/components/form/context.js +0 -10
  235. package/lib/cjs/components/form/context.js.map +0 -1
  236. package/lib/cjs/components/form/field.js +0 -81
  237. package/lib/cjs/components/form/field.js.map +0 -1
  238. package/lib/cjs/components/form/form.js +0 -76
  239. package/lib/cjs/components/form/form.js.map +0 -1
  240. package/lib/cjs/components/form/index.js +0 -10
  241. package/lib/cjs/components/form/index.js.map +0 -1
  242. package/lib/cjs/components/form/useConfig.js +0 -38
  243. package/lib/cjs/components/form/useConfig.js.map +0 -1
  244. package/lib/cjs/components/form/useForm.js +0 -127
  245. package/lib/cjs/components/form/useForm.js.map +0 -1
  246. package/lib/cjs/components/form/utils.js +0 -33
  247. package/lib/cjs/components/form/utils.js.map +0 -1
  248. package/lib/cjs/components/icon/icon.js +0 -31
  249. package/lib/cjs/components/icon/icon.js.map +0 -1
  250. package/lib/cjs/components/icon/index.js +0 -10
  251. package/lib/cjs/components/icon/index.js.map +0 -1
  252. package/lib/cjs/components/image/image.js +0 -103
  253. package/lib/cjs/components/image/image.js.map +0 -1
  254. package/lib/cjs/components/image/index.js +0 -10
  255. package/lib/cjs/components/image/index.js.map +0 -1
  256. package/lib/cjs/components/image/list.js +0 -47
  257. package/lib/cjs/components/image/list.js.map +0 -1
  258. package/lib/cjs/components/input/container.js +0 -22
  259. package/lib/cjs/components/input/container.js.map +0 -1
  260. package/lib/cjs/components/input/index.js +0 -10
  261. package/lib/cjs/components/input/index.js.map +0 -1
  262. package/lib/cjs/components/input/input.js +0 -85
  263. package/lib/cjs/components/input/input.js.map +0 -1
  264. package/lib/cjs/components/input/number.js +0 -118
  265. package/lib/cjs/components/input/number.js.map +0 -1
  266. package/lib/cjs/components/input/range.js +0 -82
  267. package/lib/cjs/components/input/range.js.map +0 -1
  268. package/lib/cjs/components/input/textarea.js +0 -64
  269. package/lib/cjs/components/input/textarea.js.map +0 -1
  270. package/lib/cjs/components/list/index.js +0 -10
  271. package/lib/cjs/components/list/index.js.map +0 -1
  272. package/lib/cjs/components/list/item.js +0 -23
  273. package/lib/cjs/components/list/item.js.map +0 -1
  274. package/lib/cjs/components/list/list.js +0 -33
  275. package/lib/cjs/components/list/list.js.map +0 -1
  276. package/lib/cjs/components/loading/index.js +0 -10
  277. package/lib/cjs/components/loading/index.js.map +0 -1
  278. package/lib/cjs/components/loading/loading.js +0 -26
  279. package/lib/cjs/components/loading/loading.js.map +0 -1
  280. package/lib/cjs/components/message/index.js +0 -11
  281. package/lib/cjs/components/message/index.js.map +0 -1
  282. package/lib/cjs/components/message/message.js +0 -239
  283. package/lib/cjs/components/message/message.js.map +0 -1
  284. package/lib/cjs/components/modal/content.js +0 -45
  285. package/lib/cjs/components/modal/content.js.map +0 -1
  286. package/lib/cjs/components/modal/context.js +0 -10
  287. package/lib/cjs/components/modal/context.js.map +0 -1
  288. package/lib/cjs/components/modal/hookModal.js +0 -31
  289. package/lib/cjs/components/modal/hookModal.js.map +0 -1
  290. package/lib/cjs/components/modal/index.js +0 -10
  291. package/lib/cjs/components/modal/index.js.map +0 -1
  292. package/lib/cjs/components/modal/modal.js +0 -140
  293. package/lib/cjs/components/modal/modal.js.map +0 -1
  294. package/lib/cjs/components/modal/modalManager.js +0 -83
  295. package/lib/cjs/components/modal/modalManager.js.map +0 -1
  296. package/lib/cjs/components/modal/useModal.js +0 -38
  297. package/lib/cjs/components/modal/useModal.js.map +0 -1
  298. package/lib/cjs/components/pagination/index.js +0 -10
  299. package/lib/cjs/components/pagination/index.js.map +0 -1
  300. package/lib/cjs/components/pagination/page.js +0 -32
  301. package/lib/cjs/components/pagination/page.js.map +0 -1
  302. package/lib/cjs/components/pagination/pagination.js +0 -52
  303. package/lib/cjs/components/pagination/pagination.js.map +0 -1
  304. package/lib/cjs/components/picker/colors/footer.js +0 -39
  305. package/lib/cjs/components/picker/colors/footer.js.map +0 -1
  306. package/lib/cjs/components/picker/colors/handle.js +0 -18
  307. package/lib/cjs/components/picker/colors/handle.js.map +0 -1
  308. package/lib/cjs/components/picker/colors/index.js +0 -72
  309. package/lib/cjs/components/picker/colors/index.js.map +0 -1
  310. package/lib/cjs/components/picker/daterange/daterange.js +0 -60
  311. package/lib/cjs/components/picker/daterange/daterange.js.map +0 -1
  312. package/lib/cjs/components/picker/daterange/index.js +0 -11
  313. package/lib/cjs/components/picker/daterange/index.js.map +0 -1
  314. package/lib/cjs/components/picker/daterange/panel.js +0 -55
  315. package/lib/cjs/components/picker/daterange/panel.js.map +0 -1
  316. package/lib/cjs/components/picker/dates/dates.js +0 -63
  317. package/lib/cjs/components/picker/dates/dates.js.map +0 -1
  318. package/lib/cjs/components/picker/dates/index.js +0 -73
  319. package/lib/cjs/components/picker/dates/index.js.map +0 -1
  320. package/lib/cjs/components/picker/dates/panel.js +0 -93
  321. package/lib/cjs/components/picker/dates/panel.js.map +0 -1
  322. package/lib/cjs/components/picker/time/index.js +0 -55
  323. package/lib/cjs/components/picker/time/index.js.map +0 -1
  324. package/lib/cjs/components/picker/time/item.js +0 -23
  325. package/lib/cjs/components/picker/time/item.js.map +0 -1
  326. package/lib/cjs/components/picker/time/panel.js +0 -104
  327. package/lib/cjs/components/picker/time/panel.js.map +0 -1
  328. package/lib/cjs/components/popconfirm/index.js +0 -10
  329. package/lib/cjs/components/popconfirm/index.js.map +0 -1
  330. package/lib/cjs/components/popconfirm/popconfirm.js +0 -55
  331. package/lib/cjs/components/popconfirm/popconfirm.js.map +0 -1
  332. package/lib/cjs/components/popup/content.js +0 -51
  333. package/lib/cjs/components/popup/content.js.map +0 -1
  334. package/lib/cjs/components/popup/index.js +0 -10
  335. package/lib/cjs/components/popup/index.js.map +0 -1
  336. package/lib/cjs/components/popup/popup.js +0 -495
  337. package/lib/cjs/components/popup/popup.js.map +0 -1
  338. package/lib/cjs/components/progress/circle.js +0 -16
  339. package/lib/cjs/components/progress/circle.js.map +0 -1
  340. package/lib/cjs/components/progress/index.js +0 -10
  341. package/lib/cjs/components/progress/index.js.map +0 -1
  342. package/lib/cjs/components/progress/line.js +0 -22
  343. package/lib/cjs/components/progress/line.js.map +0 -1
  344. package/lib/cjs/components/progress/progress.js +0 -90
  345. package/lib/cjs/components/progress/progress.js.map +0 -1
  346. package/lib/cjs/components/radio/index.js +0 -10
  347. package/lib/cjs/components/radio/index.js.map +0 -1
  348. package/lib/cjs/components/radio/item.js +0 -25
  349. package/lib/cjs/components/radio/item.js.map +0 -1
  350. package/lib/cjs/components/radio/radio.js +0 -40
  351. package/lib/cjs/components/radio/radio.js.map +0 -1
  352. package/lib/cjs/components/resizable/index.js +0 -10
  353. package/lib/cjs/components/resizable/index.js.map +0 -1
  354. package/lib/cjs/components/resizable/resizable.js +0 -68
  355. package/lib/cjs/components/resizable/resizable.js.map +0 -1
  356. package/lib/cjs/components/river/index.js +0 -10
  357. package/lib/cjs/components/river/index.js.map +0 -1
  358. package/lib/cjs/components/river/river.js +0 -114
  359. package/lib/cjs/components/river/river.js.map +0 -1
  360. package/lib/cjs/components/scroll/index.js +0 -10
  361. package/lib/cjs/components/scroll/index.js.map +0 -1
  362. package/lib/cjs/components/scroll/scroll.js +0 -78
  363. package/lib/cjs/components/scroll/scroll.js.map +0 -1
  364. package/lib/cjs/components/select/index.js +0 -10
  365. package/lib/cjs/components/select/index.js.map +0 -1
  366. package/lib/cjs/components/select/options.js +0 -55
  367. package/lib/cjs/components/select/options.js.map +0 -1
  368. package/lib/cjs/components/select/select.js +0 -103
  369. package/lib/cjs/components/select/select.js.map +0 -1
  370. package/lib/cjs/components/step/divider.js +0 -12
  371. package/lib/cjs/components/step/divider.js.map +0 -1
  372. package/lib/cjs/components/step/index.js +0 -10
  373. package/lib/cjs/components/step/index.js.map +0 -1
  374. package/lib/cjs/components/step/item.js +0 -30
  375. package/lib/cjs/components/step/item.js.map +0 -1
  376. package/lib/cjs/components/step/step.js +0 -44
  377. package/lib/cjs/components/step/step.js.map +0 -1
  378. package/lib/cjs/components/swiper/index.js +0 -10
  379. package/lib/cjs/components/swiper/index.js.map +0 -1
  380. package/lib/cjs/components/swiper/item.js +0 -33
  381. package/lib/cjs/components/swiper/item.js.map +0 -1
  382. package/lib/cjs/components/swiper/swiper.js +0 -241
  383. package/lib/cjs/components/swiper/swiper.js.map +0 -1
  384. package/lib/cjs/components/tabs/contents.js +0 -28
  385. package/lib/cjs/components/tabs/contents.js.map +0 -1
  386. package/lib/cjs/components/tabs/helper.js +0 -68
  387. package/lib/cjs/components/tabs/helper.js.map +0 -1
  388. package/lib/cjs/components/tabs/index.js +0 -10
  389. package/lib/cjs/components/tabs/index.js.map +0 -1
  390. package/lib/cjs/components/tabs/item.js +0 -12
  391. package/lib/cjs/components/tabs/item.js.map +0 -1
  392. package/lib/cjs/components/tabs/navs.js +0 -38
  393. package/lib/cjs/components/tabs/navs.js.map +0 -1
  394. package/lib/cjs/components/tabs/tabs.js +0 -264
  395. package/lib/cjs/components/tabs/tabs.js.map +0 -1
  396. package/lib/cjs/components/tag/index.js +0 -10
  397. package/lib/cjs/components/tag/index.js.map +0 -1
  398. package/lib/cjs/components/tag/tag.js +0 -26
  399. package/lib/cjs/components/tag/tag.js.map +0 -1
  400. package/lib/cjs/components/text/highlight.js +0 -32
  401. package/lib/cjs/components/text/highlight.js.map +0 -1
  402. package/lib/cjs/components/text/index.js +0 -10
  403. package/lib/cjs/components/text/index.js.map +0 -1
  404. package/lib/cjs/components/text/number.js +0 -31
  405. package/lib/cjs/components/text/number.js.map +0 -1
  406. package/lib/cjs/components/text/text.js +0 -42
  407. package/lib/cjs/components/text/text.js.map +0 -1
  408. package/lib/cjs/components/text/time.js +0 -24
  409. package/lib/cjs/components/text/time.js.map +0 -1
  410. package/lib/cjs/components/tree/index.js +0 -10
  411. package/lib/cjs/components/tree/index.js.map +0 -1
  412. package/lib/cjs/components/tree/item.js +0 -80
  413. package/lib/cjs/components/tree/item.js.map +0 -1
  414. package/lib/cjs/components/tree/tree.js +0 -134
  415. package/lib/cjs/components/tree/tree.js.map +0 -1
  416. package/lib/cjs/components/upload/dropbox.js +0 -54
  417. package/lib/cjs/components/upload/dropbox.js.map +0 -1
  418. package/lib/cjs/components/upload/index.js +0 -10
  419. package/lib/cjs/components/upload/index.js.map +0 -1
  420. package/lib/cjs/components/upload/renderFile.js +0 -66
  421. package/lib/cjs/components/upload/renderFile.js.map +0 -1
  422. package/lib/cjs/components/upload/upload.js +0 -163
  423. package/lib/cjs/components/upload/upload.js.map +0 -1
  424. package/lib/cjs/components/utils/empty/index.js +0 -19
  425. package/lib/cjs/components/utils/empty/index.js.map +0 -1
  426. package/lib/cjs/components/utils/helpericon/helpericon.js +0 -32
  427. package/lib/cjs/components/utils/helpericon/helpericon.js.map +0 -1
  428. package/lib/cjs/components/utils/helpericon/index.js +0 -10
  429. package/lib/cjs/components/utils/helpericon/index.js.map +0 -1
  430. package/lib/cjs/components/video/index.js +0 -10
  431. package/lib/cjs/components/video/index.js.map +0 -1
  432. package/lib/cjs/components/video/video.js +0 -181
  433. package/lib/cjs/components/video/video.js.map +0 -1
  434. package/lib/cjs/index.js +0 -92
  435. package/lib/cjs/index.js.map +0 -1
  436. package/lib/cjs/js/hooks.js +0 -272
  437. package/lib/cjs/js/hooks.js.map +0 -1
  438. package/lib/cjs/js/usePreview/content.js +0 -164
  439. package/lib/cjs/js/usePreview/content.js.map +0 -1
  440. package/lib/cjs/js/usePreview/index.js +0 -27
  441. package/lib/cjs/js/usePreview/index.js.map +0 -1
  442. package/lib/cjs/js/usePreview/renderFile.js +0 -24
  443. package/lib/cjs/js/usePreview/renderFile.js.map +0 -1
  444. package/lib/cjs/js/usePreview/type.js +0 -13
  445. package/lib/cjs/js/usePreview/type.js.map +0 -1
  446. package/lib/cjs/js/useRipple/index.js +0 -51
  447. package/lib/cjs/js/useRipple/index.js.map +0 -1
  448. package/lib/cjs/js/useTheme/index.js +0 -155
  449. package/lib/cjs/js/useTheme/index.js.map +0 -1
  450. package/lib/cjs/js/utils.js +0 -302
  451. package/lib/cjs/js/utils.js.map +0 -1
  452. package/lib/css/colors.css +0 -792
  453. package/lib/css/index.css.map +0 -1
  454. package/lib/css/input.css +0 -214
  455. package/lib/css/reset.css +0 -140
  456. package/lib/css/tokens.css +0 -13
  457. package/lib/css/utilities.css +0 -1973
  458. package/lib/es/components/affix/affix.js.map +0 -1
  459. package/lib/es/components/affix/index.js.map +0 -1
  460. package/lib/es/components/affix/totop.js.map +0 -1
  461. package/lib/es/components/badge/badge.js.map +0 -1
  462. package/lib/es/components/badge/index.js.map +0 -1
  463. package/lib/es/components/button/button.js.map +0 -1
  464. package/lib/es/components/button/confirm.js.map +0 -1
  465. package/lib/es/components/button/group.js.map +0 -1
  466. package/lib/es/components/button/index.js.map +0 -1
  467. package/lib/es/components/button/toggle.js.map +0 -1
  468. package/lib/es/components/card/card.js.map +0 -1
  469. package/lib/es/components/card/index.js.map +0 -1
  470. package/lib/es/components/checkbox/checkbox.js.map +0 -1
  471. package/lib/es/components/checkbox/index.js.map +0 -1
  472. package/lib/es/components/checkbox/item.js.map +0 -1
  473. package/lib/es/components/collapse/collapse.js.map +0 -1
  474. package/lib/es/components/collapse/index.js.map +0 -1
  475. package/lib/es/components/collapse/item.js.map +0 -1
  476. package/lib/es/components/datagrid/cell.js.map +0 -1
  477. package/lib/es/components/datagrid/datagrid.js.map +0 -1
  478. package/lib/es/components/datagrid/helper.js.map +0 -1
  479. package/lib/es/components/datagrid/index.js.map +0 -1
  480. package/lib/es/components/datagrid/resize.js.map +0 -1
  481. package/lib/es/components/datagrid/row.js.map +0 -1
  482. package/lib/es/components/datagrid/sorter.js.map +0 -1
  483. package/lib/es/components/datagrid/virtual.js.map +0 -1
  484. package/lib/es/components/description/description.js.map +0 -1
  485. package/lib/es/components/description/index.js.map +0 -1
  486. package/lib/es/components/drawer/drawer.js.map +0 -1
  487. package/lib/es/components/drawer/index.js.map +0 -1
  488. package/lib/es/components/dropdown/dropdown.js.map +0 -1
  489. package/lib/es/components/dropdown/index.js.map +0 -1
  490. package/lib/es/components/dropdown/item.js.map +0 -1
  491. package/lib/es/components/editor/controls.js.map +0 -1
  492. package/lib/es/components/editor/editor.js.map +0 -1
  493. package/lib/es/components/editor/index.js.map +0 -1
  494. package/lib/es/components/editor/memtion.js.map +0 -1
  495. package/lib/es/components/flex/flex.js.map +0 -1
  496. package/lib/es/components/flex/index.js.map +0 -1
  497. package/lib/es/components/form/context.js.map +0 -1
  498. package/lib/es/components/form/field.js.map +0 -1
  499. package/lib/es/components/form/form.js.map +0 -1
  500. package/lib/es/components/form/index.js.map +0 -1
  501. package/lib/es/components/form/useConfig.js.map +0 -1
  502. package/lib/es/components/form/useForm.js.map +0 -1
  503. package/lib/es/components/form/utils.js.map +0 -1
  504. package/lib/es/components/icon/icon.js.map +0 -1
  505. package/lib/es/components/icon/index.js.map +0 -1
  506. package/lib/es/components/image/image.js.map +0 -1
  507. package/lib/es/components/image/index.js.map +0 -1
  508. package/lib/es/components/image/list.js.map +0 -1
  509. package/lib/es/components/input/container.js.map +0 -1
  510. package/lib/es/components/input/index.js.map +0 -1
  511. package/lib/es/components/input/input.js.map +0 -1
  512. package/lib/es/components/input/number.js.map +0 -1
  513. package/lib/es/components/input/range.js.map +0 -1
  514. package/lib/es/components/input/textarea.js.map +0 -1
  515. package/lib/es/components/list/index.js.map +0 -1
  516. package/lib/es/components/list/item.js.map +0 -1
  517. package/lib/es/components/list/list.js.map +0 -1
  518. package/lib/es/components/loading/index.js.map +0 -1
  519. package/lib/es/components/loading/loading.js.map +0 -1
  520. package/lib/es/components/message/index.js.map +0 -1
  521. package/lib/es/components/message/message.js.map +0 -1
  522. package/lib/es/components/modal/content.js.map +0 -1
  523. package/lib/es/components/modal/context.js.map +0 -1
  524. package/lib/es/components/modal/hookModal.js.map +0 -1
  525. package/lib/es/components/modal/index.js.map +0 -1
  526. package/lib/es/components/modal/modal.js.map +0 -1
  527. package/lib/es/components/modal/modalManager.js.map +0 -1
  528. package/lib/es/components/modal/useModal.js.map +0 -1
  529. package/lib/es/components/pagination/index.js.map +0 -1
  530. package/lib/es/components/pagination/page.js.map +0 -1
  531. package/lib/es/components/pagination/pagination.js.map +0 -1
  532. package/lib/es/components/picker/colors/footer.js.map +0 -1
  533. package/lib/es/components/picker/colors/handle.js.map +0 -1
  534. package/lib/es/components/picker/colors/index.js.map +0 -1
  535. package/lib/es/components/picker/daterange/daterange.js.map +0 -1
  536. package/lib/es/components/picker/daterange/index.js.map +0 -1
  537. package/lib/es/components/picker/daterange/panel.js.map +0 -1
  538. package/lib/es/components/picker/dates/dates.js.map +0 -1
  539. package/lib/es/components/picker/dates/index.js.map +0 -1
  540. package/lib/es/components/picker/dates/panel.js.map +0 -1
  541. package/lib/es/components/picker/time/index.js.map +0 -1
  542. package/lib/es/components/picker/time/item.js.map +0 -1
  543. package/lib/es/components/picker/time/panel.js.map +0 -1
  544. package/lib/es/components/popconfirm/index.js.map +0 -1
  545. package/lib/es/components/popconfirm/popconfirm.js.map +0 -1
  546. package/lib/es/components/popup/content.js.map +0 -1
  547. package/lib/es/components/popup/index.js.map +0 -1
  548. package/lib/es/components/popup/popup.js.map +0 -1
  549. package/lib/es/components/progress/circle.js.map +0 -1
  550. package/lib/es/components/progress/index.js.map +0 -1
  551. package/lib/es/components/progress/line.js.map +0 -1
  552. package/lib/es/components/progress/progress.js.map +0 -1
  553. package/lib/es/components/radio/index.js.map +0 -1
  554. package/lib/es/components/radio/item.js.map +0 -1
  555. package/lib/es/components/radio/radio.js.map +0 -1
  556. package/lib/es/components/resizable/index.js.map +0 -1
  557. package/lib/es/components/resizable/resizable.js.map +0 -1
  558. package/lib/es/components/river/index.js.map +0 -1
  559. package/lib/es/components/river/river.js.map +0 -1
  560. package/lib/es/components/scroll/index.js.map +0 -1
  561. package/lib/es/components/scroll/scroll.js.map +0 -1
  562. package/lib/es/components/select/index.js.map +0 -1
  563. package/lib/es/components/select/options.js.map +0 -1
  564. package/lib/es/components/select/select.js.map +0 -1
  565. package/lib/es/components/step/divider.js.map +0 -1
  566. package/lib/es/components/step/index.js.map +0 -1
  567. package/lib/es/components/step/item.js.map +0 -1
  568. package/lib/es/components/step/step.js.map +0 -1
  569. package/lib/es/components/swiper/index.js.map +0 -1
  570. package/lib/es/components/swiper/item.js.map +0 -1
  571. package/lib/es/components/swiper/swiper.js.map +0 -1
  572. package/lib/es/components/tabs/contents.js.map +0 -1
  573. package/lib/es/components/tabs/helper.js.map +0 -1
  574. package/lib/es/components/tabs/index.js.map +0 -1
  575. package/lib/es/components/tabs/item.js.map +0 -1
  576. package/lib/es/components/tabs/navs.js.map +0 -1
  577. package/lib/es/components/tabs/tabs.js.map +0 -1
  578. package/lib/es/components/tag/index.js.map +0 -1
  579. package/lib/es/components/tag/tag.js.map +0 -1
  580. package/lib/es/components/text/highlight.js.map +0 -1
  581. package/lib/es/components/text/index.js.map +0 -1
  582. package/lib/es/components/text/number.js.map +0 -1
  583. package/lib/es/components/text/text.js.map +0 -1
  584. package/lib/es/components/text/time.js.map +0 -1
  585. package/lib/es/components/tree/index.js.map +0 -1
  586. package/lib/es/components/tree/item.js.map +0 -1
  587. package/lib/es/components/tree/tree.js.map +0 -1
  588. package/lib/es/components/upload/dropbox.js.map +0 -1
  589. package/lib/es/components/upload/index.js.map +0 -1
  590. package/lib/es/components/upload/renderFile.js.map +0 -1
  591. package/lib/es/components/upload/upload.js.map +0 -1
  592. package/lib/es/components/utils/empty/index.js.map +0 -1
  593. package/lib/es/components/utils/helpericon/helpericon.js.map +0 -1
  594. package/lib/es/components/utils/helpericon/index.js.map +0 -1
  595. package/lib/es/components/video/index.js.map +0 -1
  596. package/lib/es/components/video/video.js.map +0 -1
  597. package/lib/es/index.js.map +0 -1
  598. package/lib/es/js/hooks.js.map +0 -1
  599. package/lib/es/js/usePreview/content.js.map +0 -1
  600. package/lib/es/js/usePreview/index.js.map +0 -1
  601. package/lib/es/js/usePreview/renderFile.js.map +0 -1
  602. package/lib/es/js/usePreview/type.js.map +0 -1
  603. package/lib/es/js/useRipple/index.js.map +0 -1
  604. package/lib/es/js/useTheme/index.js.map +0 -1
  605. package/lib/es/js/utils.js.map +0 -1
@@ -1,31 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var jsxRuntime = require('react/jsx-runtime');
6
- var react = require('react');
7
- var utils = require('../../js/utils.js');
8
- var text = require('./text.js');
9
-
10
- function Number(props) {
11
- const { count, to, decimal, thousand = ",", duration = 2400, easing, ...restProps } = props;
12
- const [n, setN] = react.useState(count);
13
- const number = react.useMemo(() => {
14
- if (n === undefined)
15
- return;
16
- const z = n.toFixed(decimal);
17
- if (!thousand)
18
- return z;
19
- return utils.formatNumber(n, { precision: decimal, thousand });
20
- }, [n, thousand]);
21
- react.useEffect(() => {
22
- if (count === undefined || to === undefined)
23
- return;
24
- utils.animate(count, to, duration, (v) => setN(count + v), easing);
25
- }, [to]);
26
- react.useEffect(() => setN(count), [count]);
27
- return jsxRuntime.jsx(text.default, { ...restProps, children: number });
28
- }
29
-
30
- exports.default = Number;
31
- //# sourceMappingURL=number.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"number.js","sources":["../../../../packages/components/text/number.tsx"],"sourcesContent":["import { useEffect, useMemo, useState } from \"react\";\nimport { animate, formatNumber } from \"../../js/utils\";\nimport Text from \"./text\";\nimport { ITextNumber } from \"./type\";\n\nexport default function Number(props: ITextNumber) {\n\tconst {\n\t\tcount,\n\t\tto,\n\t\tdecimal,\n\t\tthousand = \",\",\n\t\tduration = 2400,\n\t\teasing,\n\t\t...restProps\n\t} = props;\n\tconst [n, setN] = useState(count);\n\n\tconst number = useMemo(() => {\n\t\tif (n === undefined) return;\n\n\t\tconst z = n.toFixed(decimal);\n\n\t\tif (!thousand) return z;\n\n\t\treturn formatNumber(n, { precision: decimal, thousand });\n\t}, [n, thousand]);\n\n\tuseEffect(() => {\n\t\tif (count === undefined || to === undefined) return;\n\n\t\tanimate(count, to, duration, (v) => setN(count + v), easing);\n\t}, [to]);\n\n\tuseEffect(() => setN(count), [count]);\n\n\treturn <Text {...restProps}>{number}</Text>;\n}\n"],"names":["useState","useMemo","formatNumber","useEffect","animate","_jsx","Text"],"mappings":";;;;;;;;;AAKc,SAAU,MAAM,CAAC,KAAkB,EAAA;IAChD,MAAM,EACL,KAAK,EACL,EAAE,EACF,OAAO,EACP,QAAQ,GAAG,GAAG,EACd,QAAQ,GAAG,IAAI,EACf,MAAM,EACN,GAAG,SAAS,EACZ,GAAG,KAAK;IACT,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,GAAGA,cAAQ,CAAC,KAAK,CAAC;AAEjC,IAAA,MAAM,MAAM,GAAGC,aAAO,CAAC,MAAK;QAC3B,IAAI,CAAC,KAAK,SAAS;YAAE;QAErB,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;AAE5B,QAAA,IAAI,CAAC,QAAQ;AAAE,YAAA,OAAO,CAAC;AAEvB,QAAA,OAAOC,kBAAY,CAAC,CAAC,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;AACzD,IAAA,CAAC,EAAE,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;IAEjBC,eAAS,CAAC,MAAK;AACd,QAAA,IAAI,KAAK,KAAK,SAAS,IAAI,EAAE,KAAK,SAAS;YAAE;QAE7CC,aAAO,CAAC,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC;AAC7D,IAAA,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAER,IAAAD,eAAS,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;AAErC,IAAA,OAAOE,eAACC,YAAI,EAAA,EAAA,GAAK,SAAS,EAAA,QAAA,EAAG,MAAM,GAAQ;AAC5C;;;;"}
@@ -1,42 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var jsxRuntime = require('react/jsx-runtime');
6
- var classNames = require('classnames');
7
- var react = require('react');
8
- var highlight = require('./highlight.js');
9
- var number = require('./number.js');
10
- var time = require('./time.js');
11
-
12
- function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
13
-
14
- var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
15
-
16
- const Text = (props) => {
17
- const { as: Tag = "span", size, weight, decoration, gradient, wave, style, className, children, } = props;
18
- const gradients = react.useMemo(() => {
19
- if (!gradient || !Array.isArray(gradient))
20
- return {};
21
- return {
22
- backgroundImage: `-webkit-linear-gradient(${gradient.join(",")})`,
23
- backgroundClip: "text",
24
- };
25
- }, [gradient]);
26
- return (jsxRuntime.jsx(Tag, { style: {
27
- fontSize: size,
28
- fontWeight: weight,
29
- textDecoration: decoration,
30
- ...gradients,
31
- ...style,
32
- }, className: classNames__default(className, {
33
- "i-text-gradient": gradient,
34
- "i-text-gradient-wave": wave,
35
- }), children: children }));
36
- };
37
- Text.Number = number.default;
38
- Text.Time = time.default;
39
- Text.HighLight = highlight.default;
40
-
41
- exports.default = Text;
42
- //# sourceMappingURL=text.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"text.js","sources":["../../../../packages/components/text/text.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport { useMemo } from \"react\";\nimport HighLight from \"./highlight\";\nimport \"./index.css\";\nimport Number from \"./number\";\nimport Time from \"./time\";\nimport { CompositionText, IText } from \"./type\";\n\nconst Text = (props: IText) => {\n\tconst {\n\t\tas: Tag = \"span\",\n\t\tsize,\n\t\tweight,\n\t\tdecoration,\n\t\tgradient,\n\t\twave,\n\t\tstyle,\n\t\tclassName,\n\t\tchildren,\n\t} = props;\n\n\tconst gradients = useMemo(() => {\n\t\tif (!gradient || !Array.isArray(gradient)) return {};\n\n\t\treturn {\n\t\t\tbackgroundImage: `-webkit-linear-gradient(${gradient.join(\",\")})`,\n\t\t\tbackgroundClip: \"text\",\n\t\t};\n\t}, [gradient]);\n\n\treturn (\n\t\t<Tag\n\t\t\tstyle={{\n\t\t\t\tfontSize: size,\n\t\t\t\tfontWeight: weight,\n\t\t\t\ttextDecoration: decoration,\n\t\t\t\t...gradients,\n\t\t\t\t...style,\n\t\t\t}}\n\t\t\tclassName={classNames(className, {\n\t\t\t\t\"i-text-gradient\": gradient,\n\t\t\t\t\"i-text-gradient-wave\": wave,\n\t\t\t})}\n\t\t>\n\t\t\t{children}\n\t\t</Tag>\n\t);\n};\n\nText.Number = Number;\nText.Time = Time;\nText.HighLight = HighLight;\n\nexport default Text as CompositionText;\n"],"names":["useMemo","_jsx","classNames","Number","Time","HighLight"],"mappings":";;;;;;;;;;;;;;;AAQA,MAAM,IAAI,GAAG,CAAC,KAAY,KAAI;IAC7B,MAAM,EACL,EAAE,EAAE,GAAG,GAAG,MAAM,EAChB,IAAI,EACJ,MAAM,EACN,UAAU,EACV,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,SAAS,EACT,QAAQ,GACR,GAAG,KAAK;AAET,IAAA,MAAM,SAAS,GAAGA,aAAO,CAAC,MAAK;QAC9B,IAAI,CAAC,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;AAAE,YAAA,OAAO,EAAE;QAEpD,OAAO;YACN,eAAe,EAAE,2BAA2B,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA,CAAA,CAAG;AACjE,YAAA,cAAc,EAAE,MAAM;SACtB;AACF,IAAA,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;AAEd,IAAA,QACCC,cAAA,CAAC,GAAG,EAAA,EACH,KAAK,EAAE;AACN,YAAA,QAAQ,EAAE,IAAI;AACd,YAAA,UAAU,EAAE,MAAM;AAClB,YAAA,cAAc,EAAE,UAAU;AAC1B,YAAA,GAAG,SAAS;AACZ,YAAA,GAAG,KAAK;AACR,SAAA,EACD,SAAS,EAAEC,mBAAU,CAAC,SAAS,EAAE;AAChC,YAAA,iBAAiB,EAAE,QAAQ;AAC3B,YAAA,sBAAsB,EAAE,IAAI;AAC5B,SAAA,CAAC,EAAA,QAAA,EAED,QAAQ,EAAA,CACJ;AAER;AAEA,IAAI,CAAC,MAAM,GAAGC,cAAM;AACpB,IAAI,CAAC,IAAI,GAAGC,YAAI;AAChB,IAAI,CAAC,SAAS,GAAGC,iBAAS;;;;"}
@@ -1,24 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var jsxRuntime = require('react/jsx-runtime');
6
- var react = require('react');
7
- var utils = require('../../js/utils.js');
8
- var text = require('./text.js');
9
-
10
- function Number(props) {
11
- const { seconds, zero, units, ...restProps } = props;
12
- const text$1 = react.useMemo(() => {
13
- if (seconds === undefined)
14
- return "";
15
- return utils.formatTime(seconds, {
16
- zero,
17
- units,
18
- });
19
- }, [seconds]);
20
- return jsxRuntime.jsx(text.default, { ...restProps, children: text$1 });
21
- }
22
-
23
- exports.default = Number;
24
- //# sourceMappingURL=time.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"time.js","sources":["../../../../packages/components/text/time.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { formatTime } from \"../../js/utils\";\nimport Text from \"./text\";\nimport { ITextTime } from \"./type\";\n\nexport default function Number(props: ITextTime) {\n\tconst { seconds, zero, units, ...restProps } = props;\n\n\tconst text = useMemo(() => {\n\t\tif (seconds === undefined) return \"\";\n\n\t\treturn formatTime(seconds, {\n\t\t\tzero,\n\t\t\tunits,\n\t\t});\n\t}, [seconds]);\n\n\treturn <Text {...restProps}>{text}</Text>;\n}\n"],"names":["text","useMemo","formatTime","_jsx","Text"],"mappings":";;;;;;;;;AAKc,SAAU,MAAM,CAAC,KAAgB,EAAA;AAC9C,IAAA,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK;AAEpD,IAAA,MAAMA,MAAI,GAAGC,aAAO,CAAC,MAAK;QACzB,IAAI,OAAO,KAAK,SAAS;AAAE,YAAA,OAAO,EAAE;QAEpC,OAAOC,gBAAU,CAAC,OAAO,EAAE;YAC1B,IAAI;YACJ,KAAK;AACL,SAAA,CAAC;AACH,IAAA,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;AAEb,IAAA,OAAOC,eAACC,YAAI,EAAA,EAAA,GAAK,SAAS,EAAA,QAAA,EAAGJ,MAAI,GAAQ;AAC1C;;;;"}
@@ -1,10 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var tree = require('./tree.js');
6
-
7
-
8
-
9
- exports.default = tree.default;
10
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -1,80 +0,0 @@
1
- 'use strict';
2
-
3
- var jsxRuntime = require('react/jsx-runtime');
4
- var material = require('@ricons/material');
5
- var classNames = require('classnames');
6
- var react = require('react');
7
- var checkbox = require('../checkbox/checkbox.js');
8
- var icon = require('../icon/icon.js');
9
-
10
- function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
11
-
12
- var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
13
-
14
- function TreeList(props) {
15
- const { data = [], depth = 0, round, style, className, parent, nodeProps, ...restProps } = props;
16
- const contents = data.map((item, i) => {
17
- const { type } = item;
18
- const title = item[nodeProps.title];
19
- const itemKey = item[nodeProps.key] ||
20
- (parent?.key !== undefined ? `${parent.key}-${i}` : `${i}`);
21
- item.key = itemKey;
22
- item.parent = parent;
23
- if (type === "title") {
24
- return (jsxRuntime.jsx("div", { className: 'i-tree-group-title', children: title }, i));
25
- }
26
- if (type && type !== "item") {
27
- return (jsxRuntime.jsx("div", { className: `i-tree-type-${type}`, children: title }, i));
28
- }
29
- return (jsxRuntime.jsx(TreeItem, { index: i, item: item, depth: depth, nodeProps: nodeProps, ...restProps }, itemKey));
30
- });
31
- if (depth > 0)
32
- return jsxRuntime.jsx(jsxRuntime.Fragment, { children: contents });
33
- return (jsxRuntime.jsx("div", { className: classNames__default("i-tree", className, {
34
- "i-tree-round": round,
35
- }), style: style, children: contents }));
36
- }
37
- const Header = (props) => {
38
- const { as: Tag = "a", href, selected, children, ...restProps } = props;
39
- const className = classNames__default("i-tree-item-header", {
40
- "i-tree-item-selected": selected,
41
- });
42
- if (typeof Tag === "string") {
43
- return (jsxRuntime.jsx(Tag, { href: href, className: className, ...restProps, children: children }));
44
- }
45
- return (jsxRuntime.jsx(Tag, { to: href || "", className: className, ...restProps, children: children }));
46
- };
47
- const TreeItem = (props) => {
48
- const { item, depth = 0, index, selected, checked = [], partofs = {}, checkable, nodeProps, renderExtra, onItemClick, onItemSelect, onItemCheck, ...restProps } = props;
49
- const { as, key = "", href, icon: icon$1, title, expanded, disabled } = item;
50
- const children = item[nodeProps.children];
51
- const [expand, setExpand] = react.useState(expanded);
52
- const handleExpand = (e, fromToggle) => {
53
- if (fromToggle) {
54
- e.preventDefault();
55
- e.stopPropagation();
56
- }
57
- if (disabled || !children?.length)
58
- return;
59
- setExpand((v) => !v);
60
- };
61
- const handleItemClick = (e) => {
62
- if (disabled) {
63
- e.preventDefault();
64
- e.stopPropagation();
65
- return;
66
- }
67
- handleExpand(e);
68
- onItemClick?.(item, e);
69
- onItemSelect?.(key, item);
70
- };
71
- const handleItemCheck = (checked) => onItemCheck?.(item, checked, []);
72
- const itemChecked = checked.includes(key);
73
- return (jsxRuntime.jsxs("div", { className: classNames__default("i-tree-item", {
74
- "i-tree-expand": expand,
75
- }), children: [jsxRuntime.jsxs(Header, { as: as, href: href, style: { paddingLeft: `${depth * 1.5 + 0.5}em` }, selected: selected === key, onClick: handleItemClick, children: [checkable && (jsxRuntime.jsx(checkbox.default.Item, { value: itemChecked, partof: !itemChecked && partofs[key], className: 'i-tree-checkbox', onChange: handleItemCheck, onClick: (e) => e.stopPropagation() })), icon$1 && jsxRuntime.jsx("span", { className: 'i-tree-item-icon', children: icon$1 }), jsxRuntime.jsx("span", { className: 'i-tree-item-title', children: title }), renderExtra?.(item), children && (jsxRuntime.jsx(icon.default, { icon: jsxRuntime.jsx(material.KeyboardArrowDownRound, {}), className: 'i-tree-toggle', onClick: (e) => handleExpand(e, true) }))] }), children?.length && (jsxRuntime.jsx("div", { className: 'i-tree-item-content', children: jsxRuntime.jsx(TreeList, { data: children, depth: depth + 1, selected: selected, checkable: checkable, parent: item, partofs: partofs, checked: checked, nodeProps: nodeProps, renderExtra: renderExtra, onItemClick: onItemClick, onItemSelect: onItemSelect, onItemCheck: onItemCheck, ...restProps }) }))] }));
76
- };
77
-
78
- exports.TreeItem = TreeItem;
79
- exports.TreeList = TreeList;
80
- //# sourceMappingURL=item.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"item.js","sources":["../../../../packages/components/tree/item.tsx"],"sourcesContent":["import { KeyboardArrowDownRound } from \"@ricons/material\";\nimport classNames from \"classnames\";\nimport { MouseEvent, useState } from \"react\";\nimport Checkbox from \"../checkbox\";\nimport Icon from \"../icon\";\nimport { ITree, ITreeHeader, PropsTreeItem } from \"./type\";\n\ninterface ITreeList extends Omit<ITree, \"nodeProps\"> {\n\tnodeProps: {\n\t\tkey: string;\n\t\ttitle: string;\n\t\tchildren: string;\n\t};\n}\n\nexport function TreeList(props: ITreeList) {\n\tconst {\n\t\tdata = [],\n\t\tdepth = 0,\n\t\tround,\n\t\tstyle,\n\t\tclassName,\n\t\tparent,\n\t\tnodeProps,\n\t\t...restProps\n\t} = props;\n\n\tconst contents = data.map((item, i) => {\n\t\tconst { type } = item;\n\t\tconst title = item[nodeProps.title];\n\t\tconst itemKey =\n\t\t\titem[nodeProps.key] ||\n\t\t\t(parent?.key !== undefined ? `${parent.key}-${i}` : `${i}`);\n\n\t\titem.key = itemKey;\n\t\titem.parent = parent;\n\n\t\tif (type === \"title\") {\n\t\t\treturn (\n\t\t\t\t<div key={i} className='i-tree-group-title'>\n\t\t\t\t\t{title}\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\tif (type && type !== \"item\") {\n\t\t\treturn (\n\t\t\t\t<div key={i} className={`i-tree-type-${type}`}>\n\t\t\t\t\t{title}\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<TreeItem\n\t\t\t\tkey={itemKey}\n\t\t\t\tindex={i}\n\t\t\t\titem={item}\n\t\t\t\tdepth={depth}\n\t\t\t\tnodeProps={nodeProps}\n\t\t\t\t{...restProps}\n\t\t\t/>\n\t\t);\n\t});\n\n\tif (depth > 0) return <>{contents}</>;\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(\"i-tree\", className, {\n\t\t\t\t\"i-tree-round\": round,\n\t\t\t})}\n\t\t\tstyle={style}\n\t\t>\n\t\t\t{contents}\n\t\t</div>\n\t);\n}\n\nconst Header = (props: ITreeHeader) => {\n\tconst { as: Tag = \"a\", href, selected, children, ...restProps } = props;\n\n\tconst className = classNames(\"i-tree-item-header\", {\n\t\t\"i-tree-item-selected\": selected,\n\t});\n\n\tif (typeof Tag === \"string\") {\n\t\treturn (\n\t\t\t<Tag href={href} className={className} {...restProps}>\n\t\t\t\t{children}\n\t\t\t</Tag>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Tag to={href || \"\"} className={className} {...restProps}>\n\t\t\t{children}\n\t\t</Tag>\n\t);\n};\n\nexport const TreeItem = (props: PropsTreeItem) => {\n\tconst {\n\t\titem,\n\t\tdepth = 0,\n\t\tindex,\n\t\tselected,\n\t\tchecked = [],\n\t\tpartofs = {},\n\t\tcheckable,\n\t\tnodeProps,\n\t\trenderExtra,\n\t\tonItemClick,\n\t\tonItemSelect,\n\t\tonItemCheck,\n\t\t...restProps\n\t} = props;\n\n\tconst { as, key = \"\", href, icon, title, expanded, disabled } = item;\n\tconst children = item[nodeProps.children];\n\n\tconst [expand, setExpand] = useState(expanded);\n\n\tconst handleExpand = (e: MouseEvent<HTMLElement>, fromToggle?: boolean) => {\n\t\tif (fromToggle) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t}\n\n\t\tif (disabled || !children?.length) return;\n\n\t\tsetExpand((v) => !v);\n\t};\n\n\tconst handleItemClick = (e: MouseEvent<HTMLElement>) => {\n\t\tif (disabled) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\treturn;\n\t\t}\n\n\t\thandleExpand(e);\n\t\tonItemClick?.(item, e);\n\t\tonItemSelect?.(key, item);\n\t};\n\n\tconst handleItemCheck = (checked) => onItemCheck?.(item, checked, []);\n\tconst itemChecked = checked.includes(key);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(\"i-tree-item\", {\n\t\t\t\t\"i-tree-expand\": expand,\n\t\t\t})}\n\t\t>\n\t\t\t<Header\n\t\t\t\tas={as}\n\t\t\t\thref={href}\n\t\t\t\tstyle={{ paddingLeft: `${depth * 1.5 + 0.5}em` }}\n\t\t\t\tselected={selected === key}\n\t\t\t\tonClick={handleItemClick}\n\t\t\t>\n\t\t\t\t{checkable && (\n\t\t\t\t\t<Checkbox.Item\n\t\t\t\t\t\tvalue={itemChecked}\n\t\t\t\t\t\tpartof={!itemChecked && partofs[key]}\n\t\t\t\t\t\tclassName='i-tree-checkbox'\n\t\t\t\t\t\tonChange={handleItemCheck}\n\t\t\t\t\t\tonClick={(e) => e.stopPropagation()}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t{icon && <span className='i-tree-item-icon'>{icon}</span>}\n\n\t\t\t\t<span className='i-tree-item-title'>{title}</span>\n\n\t\t\t\t{renderExtra?.(item)}\n\n\t\t\t\t{children && (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={<KeyboardArrowDownRound />}\n\t\t\t\t\t\tclassName='i-tree-toggle'\n\t\t\t\t\t\tonClick={(e) => handleExpand(e, true)}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</Header>\n\n\t\t\t{children?.length && (\n\t\t\t\t<div className='i-tree-item-content'>\n\t\t\t\t\t<TreeList\n\t\t\t\t\t\tdata={children}\n\t\t\t\t\t\tdepth={depth + 1}\n\t\t\t\t\t\tselected={selected}\n\t\t\t\t\t\tcheckable={checkable}\n\t\t\t\t\t\tparent={item}\n\t\t\t\t\t\tpartofs={partofs}\n\t\t\t\t\t\tchecked={checked}\n\t\t\t\t\t\tnodeProps={nodeProps}\n\t\t\t\t\t\trenderExtra={renderExtra}\n\t\t\t\t\t\tonItemClick={onItemClick}\n\t\t\t\t\t\tonItemSelect={onItemSelect}\n\t\t\t\t\t\tonItemCheck={onItemCheck}\n\t\t\t\t\t\t{...restProps}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n"],"names":["_jsx","_Fragment","classNames","icon","useState","_jsxs","Checkbox","Icon","KeyboardArrowDownRound"],"mappings":";;;;;;;;;;;;;AAeM,SAAU,QAAQ,CAAC,KAAgB,EAAA;IACxC,MAAM,EACL,IAAI,GAAG,EAAE,EACT,KAAK,GAAG,CAAC,EACT,KAAK,EACL,KAAK,EACL,SAAS,EACT,MAAM,EACN,SAAS,EACT,GAAG,SAAS,EACZ,GAAG,KAAK;IAET,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,KAAI;AACrC,QAAA,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI;QACrB,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;AACnC,QAAA,MAAM,OAAO,GACZ,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC;aAClB,MAAM,EAAE,GAAG,KAAK,SAAS,GAAG,CAAA,EAAG,MAAM,CAAC,GAAG,CAAA,CAAA,EAAI,CAAC,EAAE,GAAG,CAAA,EAAG,CAAC,CAAA,CAAE,CAAC;AAE5D,QAAA,IAAI,CAAC,GAAG,GAAG,OAAO;AAClB,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;AAEpB,QAAA,IA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AC,eAAe,EACzB,OAAO,EAAE,CAAC,CAAC,KAAK,YAAY,CAAC,CAAC,EAAE,IAAI,CAAC,EAAA,CACpC,CACF,IACO,EAER,QAAQ,EAAE,MAAM,KAChBR,wBAAK,SAAS,EAAC,qBAAqB,EAAA,QAAA,EACnCA,cAAA,CAAC,QAAQ,EAAA,EACR,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,KAAK,GAAG,CAAC,EAChB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,IAAI,EACZ,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,WAAW,EAAA,GACpB,SAAS,GACZ,EAAA,CACG,CACN,CAAA,EAAA,CACI;AAER;;;;;"}
@@ -1,134 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var jsxRuntime = require('react/jsx-runtime');
6
- var react = require('react');
7
- var item = require('./item.js');
8
-
9
- const defaultNodeProps = {
10
- key: "key",
11
- title: "title",
12
- children: "children",
13
- };
14
- const Tree = (props) => {
15
- const { data = [], ref, selected, checked = [], disabledRelated, nodeProps, onItemSelect, onItemCheck, ...restProps } = props;
16
- const [selectedKey, setSelectedKey] = react.useState(selected);
17
- const [checkedKeys, setCheckedKeys] = react.useState(checked);
18
- const [partofs, setPartofs] = react.useState({});
19
- const nodeMapsRef = react.useRef(new Map());
20
- const oNodeProps = Object.assign({}, defaultNodeProps, nodeProps);
21
- const isChecked = (key) => checkedKeys.includes(key || "");
22
- const checkItem = (item, checked, direction) => {
23
- const { key = "", parent, children } = item;
24
- const shouldChanged = { [key]: checked };
25
- const partofs = { [key]: false };
26
- if (disabledRelated)
27
- return [shouldChanged];
28
- if (checked) {
29
- if (parent && direction !== "leaf") {
30
- const hasUnchecked = parent.children?.some((o) => o.key !== key && !isChecked(o.key));
31
- const [changes, parts] = checkItem(parent, true, "root");
32
- if (!hasUnchecked) {
33
- Object.assign(shouldChanged, changes);
34
- }
35
- Object.assign(partofs, hasUnchecked ? parts : {}, {
36
- [parent.key]: true,
37
- });
38
- }
39
- if (children?.length && direction !== "root") {
40
- children.map((o) => {
41
- if (isChecked(o.key))
42
- return;
43
- const [changes] = checkItem(o, true, "leaf");
44
- Object.assign(shouldChanged, changes);
45
- partofs[o.key] = false;
46
- });
47
- }
48
- return [shouldChanged, partofs];
49
- }
50
- if (parent && direction !== "leaf") {
51
- const [changes, parts] = checkItem(parent, false, "root");
52
- Object.assign(shouldChanged, changes);
53
- const hasChecked = parent.children?.some((o) => isChecked(o.key) && o.key !== key);
54
- Object.assign(partofs, hasChecked ? {} : parts, {
55
- [parent.key]: hasChecked,
56
- [key]: false,
57
- });
58
- }
59
- if (children?.length && direction !== "root") {
60
- children.map((o) => {
61
- const [changes] = checkItem(o, false, "leaf");
62
- if (!isChecked(o.key))
63
- return;
64
- Object.assign(shouldChanged, changes);
65
- partofs[o.key] = false;
66
- });
67
- }
68
- return [shouldChanged, partofs];
69
- };
70
- const handleCheck = (item, checked) => {
71
- const [shouldChanged, partofs] = checkItem(item, checked);
72
- const changedKeys = Object.keys(shouldChanged);
73
- const nextChecked = checked
74
- ? Array.from(new Set([...checkedKeys, ...changedKeys]))
75
- : checkedKeys.filter((k) => !changedKeys.includes(k));
76
- setCheckedKeys(nextChecked);
77
- setPartofs((p) => ({ ...p, ...partofs }));
78
- onItemCheck?.(item, checked, nextChecked);
79
- };
80
- const handleSelect = (key, item) => {
81
- if (!props.selectable)
82
- return;
83
- setSelectedKey(key);
84
- onItemSelect?.(key, item);
85
- };
86
- react.useEffect(() => {
87
- if (selected === undefined)
88
- return;
89
- setSelectedKey(selected);
90
- }, [selected]);
91
- react.useEffect(() => {
92
- nodeMapsRef.current.clear();
93
- const { key, children } = oNodeProps;
94
- const recursive = (nodes) => {
95
- nodes.map((o) => {
96
- nodeMapsRef.current.set(o[key], o);
97
- o[children]?.length > 0 && recursive(o[children]);
98
- });
99
- };
100
- recursive(data);
101
- }, [data]);
102
- react.useImperativeHandle(ref, () => {
103
- return {
104
- getChecked: () => {
105
- const items = [];
106
- checkedKeys.map((k) => {
107
- const item = nodeMapsRef.current.get(k);
108
- items.push(item);
109
- });
110
- return [checkedKeys, items];
111
- },
112
- getSelected: () => {
113
- const item = nodeMapsRef.current.get(selectedKey);
114
- return [selectedKey, item];
115
- },
116
- getPartofs: () => {
117
- const items = [];
118
- const keys = Object.keys(partofs).filter((k) => {
119
- const indeterminate = partofs[k];
120
- if (indeterminate) {
121
- const item = nodeMapsRef.current.get(k);
122
- items.push(item);
123
- }
124
- return indeterminate;
125
- });
126
- return [keys, items];
127
- },
128
- };
129
- });
130
- return (jsxRuntime.jsx(item.TreeList, { data: data, selected: selectedKey, checked: checkedKeys, partofs: partofs, nodeProps: oNodeProps, onItemCheck: handleCheck, onItemSelect: handleSelect, ...restProps }));
131
- };
132
-
133
- exports.default = Tree;
134
- //# sourceMappingURL=tree.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tree.js","sources":["../../../../packages/components/tree/tree.tsx"],"sourcesContent":["import { useEffect, useImperativeHandle, useRef, useState } from \"react\";\nimport \"./index.css\";\nimport { TreeList } from \"./item\";\nimport { ITree, ITreeItem } from \"./type\";\n\nconst defaultNodeProps = {\n\tkey: \"key\",\n\ttitle: \"title\",\n\tchildren: \"children\",\n};\n\nconst Tree = (props: ITree) => {\n\tconst {\n\t\tdata = [],\n\t\tref,\n\t\tselected,\n\t\tchecked = [],\n\t\tdisabledRelated,\n\t\tnodeProps,\n\t\tonItemSelect,\n\t\tonItemCheck,\n\t\t...restProps\n\t} = props;\n\tconst [selectedKey, setSelectedKey] = useState(selected);\n\tconst [checkedKeys, setCheckedKeys] = useState(checked);\n\tconst [partofs, setPartofs] = useState<Record<string, boolean>>({});\n\tconst nodeMapsRef = useRef<Map<any, any>>(new Map());\n\tconst oNodeProps = Object.assign({}, defaultNodeProps, nodeProps);\n\n\tconst isChecked = (key?: string) => checkedKeys.includes(key || \"\");\n\n\tconst checkItem = (\n\t\titem: ITreeItem,\n\t\tchecked: boolean,\n\t\tdirection?: \"root\" | \"leaf\"\n\t) => {\n\t\tconst { key = \"\", parent, children } = item;\n\t\tconst shouldChanged = { [key]: checked };\n\t\tconst partofs = { [key]: false };\n\n\t\tif (disabledRelated) return [shouldChanged];\n\n\t\tif (checked) {\n\t\t\tif (parent && direction !== \"leaf\") {\n\t\t\t\tconst hasUnchecked = parent.children?.some(\n\t\t\t\t\t(o) => o.key !== key && !isChecked(o.key)\n\t\t\t\t);\n\n\t\t\t\tconst [changes, parts] = checkItem(parent, true, \"root\");\n\n\t\t\t\tif (!hasUnchecked) {\n\t\t\t\t\tObject.assign(shouldChanged, changes);\n\t\t\t\t}\n\n\t\t\t\tObject.assign(partofs, hasUnchecked ? parts : {}, {\n\t\t\t\t\t[parent.key as string]: true,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (children?.length && direction !== \"root\") {\n\t\t\t\tchildren.map((o) => {\n\t\t\t\t\tif (isChecked(o.key)) return;\n\n\t\t\t\t\tconst [changes] = checkItem(o, true, \"leaf\");\n\n\t\t\t\t\tObject.assign(shouldChanged, changes);\n\t\t\t\t\tpartofs[o.key as string] = false;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn [shouldChanged, partofs];\n\t\t}\n\n\t\tif (parent && direction !== \"leaf\") {\n\t\t\tconst [changes, parts] = checkItem(parent, false, \"root\");\n\n\t\t\tObject.assign(shouldChanged, changes);\n\n\t\t\tconst hasChecked = parent.children?.some(\n\t\t\t\t(o) => isChecked(o.key) && o.key !== key\n\t\t\t);\n\n\t\t\tObject.assign(partofs, hasChecked ? {} : parts, {\n\t\t\t\t[parent.key as string]: hasChecked,\n\t\t\t\t[key]: false,\n\t\t\t});\n\t\t}\n\t\tif (children?.length && direction !== \"root\") {\n\t\t\tchildren.map((o) => {\n\t\t\t\tconst [changes] = checkItem(o, false, \"leaf\");\n\n\t\t\t\tif (!isChecked(o.key)) return;\n\n\t\t\t\tObject.assign(shouldChanged, changes);\n\t\t\t\tpartofs[o.key as string] = false;\n\t\t\t});\n\t\t}\n\n\t\treturn [shouldChanged, partofs];\n\t};\n\n\tconst handleCheck = (item: ITreeItem, checked: boolean) => {\n\t\tconst [shouldChanged, partofs] = checkItem(item, checked);\n\t\tconst changedKeys = Object.keys(shouldChanged);\n\n\t\tconst nextChecked = checked\n\t\t\t? Array.from(new Set([...checkedKeys, ...changedKeys]))\n\t\t\t: checkedKeys.filter((k) => !changedKeys.includes(k));\n\n\t\tsetCheckedKeys(nextChecked);\n\t\tsetPartofs((p) => ({ ...p, ...partofs }));\n\t\tonItemCheck?.(item, checked, nextChecked);\n\t};\n\n\tconst handleSelect = (key: string, item: ITreeItem) => {\n\t\tif (!props.selectable) return;\n\n\t\tsetSelectedKey(key);\n\t\tonItemSelect?.(key, item);\n\t};\n\n\tuseEffect(() => {\n\t\tif (selected === undefined) return;\n\n\t\tsetSelectedKey(selected);\n\t}, [selected]);\n\n\tuseEffect(() => {\n\t\tnodeMapsRef.current.clear();\n\n\t\tconst { key, children } = oNodeProps;\n\t\tconst recursive = (nodes) => {\n\t\t\tnodes.map((o) => {\n\t\t\t\tnodeMapsRef.current.set(o[key], o);\n\n\t\t\t\to[children]?.length > 0 && recursive(o[children]);\n\t\t\t});\n\t\t};\n\n\t\trecursive(data);\n\t}, [data]);\n\n\tuseImperativeHandle(ref, () => {\n\t\treturn {\n\t\t\tgetChecked: () => {\n\t\t\t\tconst items: ITreeItem[] = [];\n\t\t\t\tcheckedKeys.map((k) => {\n\t\t\t\t\tconst item = nodeMapsRef.current.get(k);\n\t\t\t\t\titems.push(item);\n\t\t\t\t});\n\t\t\t\treturn [checkedKeys, items];\n\t\t\t},\n\t\t\tgetSelected: () => {\n\t\t\t\tconst item = nodeMapsRef.current.get(selectedKey);\n\t\t\t\treturn [selectedKey, item];\n\t\t\t},\n\t\t\tgetPartofs: () => {\n\t\t\t\tconst items: ITreeItem[] = [];\n\t\t\t\tconst keys = Object.keys(partofs).filter((k) => {\n\t\t\t\t\tconst indeterminate = partofs[k];\n\n\t\t\t\t\tif (indeterminate) {\n\t\t\t\t\t\tconst item = nodeMapsRef.current.get(k);\n\t\t\t\t\t\titems.push(item);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn indeterminate;\n\t\t\t\t});\n\n\t\t\t\treturn [keys, items];\n\t\t\t},\n\t\t};\n\t});\n\n\treturn (\n\t\t<TreeList\n\t\t\tdata={data}\n\t\t\tselected={selectedKey}\n\t\t\tchecked={checkedKeys}\n\t\t\tpartofs={partofs}\n\t\t\tnodeProps={oNodeProps}\n\t\t\tonItemCheck={handleCheck}\n\t\t\tonItemSelect={handleSelect}\n\t\t\t{...restProps}\n\t\t/>\n\t);\n};\n\nexport default Tree;\n"],"names":["useState","useRef","useEffect","useImperativeHandle","_jsx","TreeList"],"mappings":";;;;;;;;AAKA,MAAM,gBAAgB,GAAG;AACxB,IAAA,GAAG,EAAE,KAAK;AACV,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,QAAQ,EAAE,UAAU;CACpB;AAED,MAAM,IAAI,GAAG,CAAC,KAAY,KAAI;IAC7B,MAAM,EACL,IAAI,GAAG,EAAE,EACT,GAAG,EACH,QAAQ,EACR,OAAO,GAAG,EAAE,EACZ,eAAe,EACf,SAAS,EACT,YAAY,EACZ,WAAW,EACX,GAAG,SAAS,EACZ,GAAG,KAAK;IACT,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAGA,cAAQ,CAAC,QAAQ,CAAC;IACxD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAGA,cAAQ,CAAC,OAAO,CAAC;IACvD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAGA,cAAQ,CAA0B,EAAE,CAAC;IACnE,MAAM,WAAW,GAAGC,YAAM,CAAgB,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AI;AAC9C,oBAAA,MAAM,aAAa,GAAG,OAAO,CAAC,CAAC,CAAC;oBAEhC,IAAI,aAAa,EAAE;wBAClB,MAAM,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;AACvC,wBAAA,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;oBACjB;AAEA,oBAAA,OAAO,aAAa;AACrB,gBAAA,CAAC,CAAC;AAEF,gBAAA,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;YACrB,CAAC;SACD;AACF,IAAA,CAAC,CAAC;AAEF,IAAA,QACCC,cAAA,CAACC,aAAQ,EAAA,EACR,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,WAAW,EACrB,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,UAAU,EACrB,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAAA,GACtB,SAAS,EAAA,CACZ;AAEJ;;;;"}
@@ -1,54 +0,0 @@
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
-
11
- function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
12
-
13
- var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
14
-
15
- const Dropbox = (props) => {
16
- const { multiple, accept, disabled, children, onChange, onDropFiles } = props;
17
- const [dragging, setDragging] = react.useState(false);
18
- const inputRef = react.useRef(null);
19
- const handleDragOver = (e) => {
20
- e.preventDefault();
21
- e.stopPropagation();
22
- };
23
- const handleDragEnter = (e) => {
24
- e.preventDefault();
25
- e.stopPropagation();
26
- if (!disabled)
27
- setDragging(true);
28
- };
29
- const handleDragLeave = (e) => {
30
- e.preventDefault();
31
- e.stopPropagation();
32
- setDragging(false);
33
- };
34
- const handleDrop = (e) => {
35
- e.preventDefault();
36
- e.stopPropagation();
37
- setDragging(false);
38
- if (disabled)
39
- return;
40
- const files = Array.from(e.dataTransfer.files);
41
- if (files.length)
42
- onDropFiles(files);
43
- };
44
- const handleClick = () => {
45
- if (!disabled)
46
- inputRef.current?.click();
47
- };
48
- return (jsxRuntime.jsxs("div", { className: classNames__default("i-upload-dropbox", dragging && "i-upload-dropbox-active"), onDragOver: handleDragOver, onDragEnter: handleDragEnter, onDragLeave: handleDragLeave, onDrop: handleDrop, onClick: handleClick, children: [jsxRuntime.jsx("input", { ref: inputRef, type: "file", className: "i-input-file-hidden", multiple: multiple, accept: accept, disabled: disabled, onChange: onChange }), typeof children === "function"
49
- ? children(dragging)
50
- : children || (jsxRuntime.jsx(icon.default, { icon: dragging ? (jsxRuntime.jsx(material.MoveToInboxTwotone, {})) : (jsxRuntime.jsx(material.OutboxTwotone, {})), size: "2em" }))] }));
51
- };
52
-
53
- exports.default = Dropbox;
54
- //# sourceMappingURL=dropbox.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dropbox.js","sources":["../../../../packages/components/upload/dropbox.tsx"],"sourcesContent":["import { MoveToInboxTwotone, OutboxTwotone } from \"@ricons/material\";\nimport classNames from \"classnames\";\nimport { DragEvent, useRef, useState } from \"react\";\nimport Icon from \"../icon\";\nimport { IDropboxProps } from \"./type\";\n\nconst Dropbox = (props: IDropboxProps) => {\n const { multiple, accept, disabled, children, onChange, onDropFiles } =\n props;\n const [dragging, setDragging] = useState(false);\n const inputRef = useRef<HTMLInputElement>(null);\n\n const handleDragOver = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n };\n\n const handleDragEnter = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n if (!disabled) setDragging(true);\n };\n\n const handleDragLeave = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n setDragging(false);\n };\n\n const handleDrop = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n setDragging(false);\n if (disabled) return;\n const files = Array.from(e.dataTransfer.files);\n if (files.length) onDropFiles(files);\n };\n\n const handleClick = () => {\n if (!disabled) inputRef.current?.click();\n };\n\n return (\n <div\n className={classNames(\n \"i-upload-dropbox\",\n dragging && \"i-upload-dropbox-active\",\n )}\n onDragOver={handleDragOver}\n onDragEnter={handleDragEnter}\n onDragLeave={handleDragLeave}\n onDrop={handleDrop}\n onClick={handleClick}\n >\n <input\n ref={inputRef}\n type=\"file\"\n className=\"i-input-file-hidden\"\n multiple={multiple}\n accept={accept}\n disabled={disabled}\n onChange={onChange}\n />\n {typeof children === \"function\"\n ? children(dragging)\n : children || (\n <Icon\n icon={\n dragging ? (\n <MoveToInboxTwotone />\n ) : (\n <OutboxTwotone />\n )\n }\n size=\"2em\"\n />\n )}\n </div>\n );\n};\n\nexport default Dropbox;\n"],"names":["useState","useRef","_jsxs","classNames","_jsx","Icon","MoveToInboxTwotone","OutboxTwotone"],"mappings":";;;;;;;;;;;;;;AAMA,MAAM,OAAO,GAAG,CAAC,KAAoB,KAAI;AACrC,IAAA,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,GACjE,KAAK;IACT,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAGA,cAAQ,CAAC,KAAK,CAAC;AAC/C,IAAA,MAAM,QAAQ,GAAGC,YAAM,CAAmB,IAAI,CAAC;AAE/C,IAAA,MAAM,cAAc,GAAG,CAAC,CAAY,KAAI;QACpC,CAAC,CAAC,cAAc,EAAE;QAClB,CAAC,CAAC,eAAe,EAAE;AACvB,IAAA,CAAC;AAED,IAAA,MAAM,eAAe,GAAG,CAAC,CAAY,KAAI;QACrC,CAAC,CAAC,cAAc,EAAE;QAClB,CAAC,CAAC,eAAe,EAAE;AACnB,QAAA,IAAI,CAAC,QAAQ;YAAE,WAAW,CAAC,IAAI,CAAC;AACpC,IAAA,CAAC;AAED,IAAA,MAAM,eAAe,GAAG,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AEtBF,cAAA,CAACG,sBAAa,EAAA,EAAA,CAAG,CACpB,EAEL,IAAI,EAAC,KAAK,EAAA,CACZ,CACL,CAAA,EAAA,CACL;AAEd;;;;"}
@@ -1,10 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var upload = require('./upload.js');
6
-
7
-
8
-
9
- exports.default = upload.default;
10
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -1,66 +0,0 @@
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 react = require('react');
8
- var SortableContainer = require('react-easy-sort');
9
- var type = require('../../js/usePreview/type.js');
10
- var utils = require('../../js/utils.js');
11
- var icon = require('../icon/icon.js');
12
- var image = require('../image/image.js');
13
- var helpericon = require('../utils/helpericon/helpericon.js');
14
-
15
- function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
16
-
17
- var SortableContainer__default = /*#__PURE__*/_interopDefaultCompat(SortableContainer);
18
-
19
- const ListContainer = react.memo((props) => {
20
- const { sortable, onSortEnd, children, ...restProps } = props;
21
- if (!sortable) {
22
- return (jsxRuntime.jsx("div", { className: "i-upload-list", onClick: (e) => {
23
- e.stopPropagation();
24
- e.preventDefault();
25
- }, ...restProps, children: children }));
26
- }
27
- return (jsxRuntime.jsx(SortableContainer__default, { draggedItemClassName: "i-upload-item-dragged", onSortEnd: onSortEnd, className: "i-upload-list", ...restProps, children: children }));
28
- });
29
- const CloseBtn = react.memo(({ index, onRemove }) => (jsxRuntime.jsx(helpericon.default, { active: true, className: "i-upload-delete", onClick: (e) => {
30
- e.stopPropagation();
31
- e.preventDefault();
32
- onRemove(index);
33
- } })));
34
- const FileListItem = react.memo((props) => {
35
- const { ref, mode, index, file, renderItem, onRemove, onPreview } = props;
36
- if (!file)
37
- return null;
38
- const { name, size, url, src } = file;
39
- const type$1 = utils.getFileType(name, file.type);
40
- const handleClick = react.useCallback(() => {
41
- onPreview?.(index);
42
- }, [onPreview, index]);
43
- if (renderItem) {
44
- return renderItem(file, index);
45
- }
46
- const node = react.useMemo(() => {
47
- switch (type$1) {
48
- case type.TFileType.IMAGE:
49
- return (jsxRuntime.jsx(image.default, { lazyload: true, src: url || src, fit: "cover", onMouseDown: (e) => e.preventDefault() }));
50
- case type.TFileType.VIDEO:
51
- return jsxRuntime.jsx("video", { src: url || src, preload: "none" });
52
- default:
53
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(icon.default, { icon: jsxRuntime.jsx(material.FilePresentOutlined, {}), size: "1.5em" }), jsxRuntime.jsx("span", { className: "i-upload-file-name", children: name })] }));
54
- }
55
- }, [type$1, url, src, name]);
56
- switch (mode) {
57
- case "card":
58
- return (jsxRuntime.jsxs("div", { ref: ref, className: "i-upload-item-card", onClick: handleClick, children: [node, jsxRuntime.jsx(CloseBtn, { index: index, onRemove: onRemove }), name && (jsxRuntime.jsx("span", { className: "px-12 py-8 i-upload-tip", children: name }))] }));
59
- default:
60
- return (jsxRuntime.jsxs("div", { ref: ref, className: "i-upload-item", onClick: handleClick, children: [jsxRuntime.jsx("span", { children: name }), jsxRuntime.jsx("i", { className: "i-upload-size", children: utils.formatBytes(size ?? 0) }), jsxRuntime.jsx(CloseBtn, { index: index, onRemove: onRemove })] }));
61
- }
62
- });
63
-
64
- exports.ListContainer = ListContainer;
65
- exports.default = FileListItem;
66
- //# sourceMappingURL=renderFile.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"renderFile.js","sources":["../../../../packages/components/upload/renderFile.tsx"],"sourcesContent":["import { FilePresentOutlined } from \"@ricons/material\";\nimport { memo, MouseEvent, RefObject, useCallback, useMemo } from \"react\";\nimport SortableContainer from \"react-easy-sort\";\nimport { TFileType } from \"../../js/usePreview/type\";\nimport { formatBytes, getFileType } from \"../../js/utils\";\nimport Icon from \"../icon\";\nimport Image from \"../image\";\nimport Helpericon from \"../utils/helpericon\";\nimport { IUploadItem } from \"./type\";\n\ninterface ListContainerProps {\n sortable?: boolean;\n onSortEnd: (oldIndex: number, newIndex: number) => void;\n [key: string]: any;\n}\n\nexport const ListContainer = memo((props: ListContainerProps) => {\n const { sortable, onSortEnd, children, ...restProps } = props;\n\n if (!sortable) {\n return (\n <div\n className=\"i-upload-list\"\n onClick={(e) => {\n e.stopPropagation();\n e.preventDefault();\n }}\n {...restProps}\n >\n {children}\n </div>\n );\n }\n return (\n <SortableContainer\n draggedItemClassName=\"i-upload-item-dragged\"\n onSortEnd={onSortEnd}\n className=\"i-upload-list\"\n {...restProps}\n >\n {children}\n </SortableContainer>\n );\n});\n\nconst CloseBtn = memo(\n ({ index, onRemove }: { index: number; onRemove: (i: number) => void }) => (\n <Helpericon\n active\n className=\"i-upload-delete\"\n onClick={(e: MouseEvent<HTMLElement>) => {\n e.stopPropagation();\n e.preventDefault();\n onRemove(index);\n }}\n />\n ),\n);\n\nconst FileListItem = memo(\n (props: IUploadItem & { ref?: RefObject<HTMLDivElement | null> }) => {\n const { ref, mode, index, file, renderItem, onRemove, onPreview } =\n props;\n\n if (!file) return null;\n\n const { name, size, url, src } = file;\n const type = getFileType(name, file.type);\n\n const handleClick = useCallback(() => {\n onPreview?.(index);\n }, [onPreview, index]);\n\n if (renderItem) {\n return renderItem(file, index);\n }\n\n const node = useMemo(() => {\n switch (type) {\n case TFileType.IMAGE:\n return (\n <Image\n lazyload\n src={url || src}\n fit=\"cover\"\n onMouseDown={(e: MouseEvent<HTMLImageElement>) =>\n e.preventDefault()\n }\n />\n );\n case TFileType.VIDEO:\n return <video src={url || src} preload=\"none\" />;\n default:\n return (\n <>\n <Icon icon={<FilePresentOutlined />} size=\"1.5em\" />\n <span className=\"i-upload-file-name\">{name}</span>\n </>\n );\n }\n }, [type, url, src, name]);\n\n switch (mode) {\n case \"card\":\n return (\n <div\n ref={ref}\n className=\"i-upload-item-card\"\n onClick={handleClick}\n >\n {node}\n <CloseBtn index={index} onRemove={onRemove} />\n {name && (\n <span className=\"px-12 py-8 i-upload-tip\">\n {name}\n </span>\n )}\n </div>\n );\n default:\n return (\n <div\n ref={ref}\n className=\"i-upload-item\"\n onClick={handleClick}\n >\n <span>{name}</span>\n <i className=\"i-upload-size\">\n {formatBytes(size ?? 0)}\n </i>\n <CloseBtn index={index} onRemove={onRemove} />\n </div>\n );\n }\n },\n);\n\nexport default FileListItem;\n"],"names":["memo","_jsx","SortableContainer","Helpericon","type","getFileType","useCallback","useMemo","TFileType","Image","_jsxs","_Fragment","Icon","FilePresentOutlined","formatBytes"],"mappings":";;;;;;;;;;;;;;;;;;MAgBa,aAAa,GAAGA,UAAI,CAAC,CAAC,KAAyB,KAAI;AAC5D,IAAA,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK;IAE7D,IAAI,CAAC,QAAQ,EAAE;QACX,QACIC,cAAA,CAAA,KAAA,EAAA,EACI,SAAS,EAAC,eAAe,EACzB,OAAO,EAAE,CAAC,CAAC,KAAI;gBACX,CAAC,CAAC,eAAe,EAAE;gBACnB,CAAC,CAAC,cAAc,EAAE;AACtB,YAAA,CAAC,KACG,SAAS,EAAA,QAAA,EAEZ,QAAQ,EAAA,CACP;IAEd;IACA,QACIA,eAACC,0BAAiB,EAAA,EACd,oBAAoB,EAAC,uBAAuB,EAC5C,SAAS,EAAE,SAAS,EACpB,SAAS,EAAC,eAAe,EAAA,GACrB,SAAS,EAAA,QAAA,EAEZ,QAAQ,EAAA,CACO;AAE5B,CAAC;AAED,MAAM,QAAQ,GAAGF,UAAI,CACjB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAoD,MAClEC,cAAA,CAACE,kBAAU,EAAA,EACP,MAAM,EAAA,IAAA,EACN,SAAS,EAAC,iBAAiB,EAC3B,OAAO,EAAE,C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