@duskmoon-dev/components 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (482) hide show
  1. package/README.md +38 -0
  2. package/dist/chunk-r9wkv7xd.js +29 -0
  3. package/dist/classes/affix.d.ts +6 -0
  4. package/dist/classes/alert.d.ts +9 -0
  5. package/dist/classes/anchor.d.ts +19 -0
  6. package/dist/classes/app.d.ts +9 -0
  7. package/dist/classes/auto-complete.d.ts +34 -0
  8. package/dist/classes/avatar.d.ts +9 -0
  9. package/dist/classes/back-top.d.ts +6 -0
  10. package/dist/classes/badge.d.ts +11 -0
  11. package/dist/classes/breadcrumb.d.ts +23 -0
  12. package/dist/classes/button.d.ts +17 -0
  13. package/dist/classes/calendar.d.ts +25 -0
  14. package/dist/classes/card.d.ts +9 -0
  15. package/dist/classes/carousel.d.ts +25 -0
  16. package/dist/classes/cascader.d.ts +42 -0
  17. package/dist/classes/checkbox.d.ts +23 -0
  18. package/dist/classes/col.d.ts +4 -0
  19. package/dist/classes/collapse.d.ts +23 -0
  20. package/dist/classes/color-picker.d.ts +21 -0
  21. package/dist/classes/config-provider.d.ts +7 -0
  22. package/dist/classes/date-picker.d.ts +27 -0
  23. package/dist/classes/descriptions.d.ts +18 -0
  24. package/dist/classes/divider.d.ts +15 -0
  25. package/dist/classes/dm-auxiliary.d.ts +11 -0
  26. package/dist/classes/dm-breadcrumb.d.ts +9 -0
  27. package/dist/classes/dm-date-picker.d.ts +4 -0
  28. package/dist/classes/dm-drawer.d.ts +9 -0
  29. package/dist/classes/dm-infinite-scroll.d.ts +9 -0
  30. package/dist/classes/dm-layout.d.ts +11 -0
  31. package/dist/classes/dm-menu.d.ts +13 -0
  32. package/dist/classes/dm-message.d.ts +6 -0
  33. package/dist/classes/dm-page-header.d.ts +15 -0
  34. package/dist/classes/dm-pagination.d.ts +17 -0
  35. package/dist/classes/dm-pro-table-inner.d.ts +1 -0
  36. package/dist/classes/dm-pro-table.d.ts +8 -0
  37. package/dist/classes/dm-provider.d.ts +4 -0
  38. package/dist/classes/dm-query.d.ts +1 -0
  39. package/dist/classes/dm-search.d.ts +12 -0
  40. package/dist/classes/dm-splitter.d.ts +11 -0
  41. package/dist/classes/dm-status.d.ts +10 -0
  42. package/dist/classes/dm-table.d.ts +13 -0
  43. package/dist/classes/dm-tabs.d.ts +17 -0
  44. package/dist/classes/dm-toolbar.d.ts +12 -0
  45. package/dist/classes/dm-tree.d.ts +27 -0
  46. package/dist/classes/dm-truncate.d.ts +14 -0
  47. package/dist/classes/drawer.d.ts +16 -0
  48. package/dist/classes/dropdown.d.ts +14 -0
  49. package/dist/classes/empty.d.ts +7 -0
  50. package/dist/classes/flex.d.ts +8 -0
  51. package/dist/classes/float-button.d.ts +27 -0
  52. package/dist/classes/form.d.ts +20 -0
  53. package/dist/classes/grid.d.ts +9 -0
  54. package/dist/classes/image.d.ts +16 -0
  55. package/dist/classes/index.d.ts +93 -0
  56. package/dist/classes/index.js +3556 -0
  57. package/dist/classes/input-number.d.ts +14 -0
  58. package/dist/classes/input.d.ts +51 -0
  59. package/dist/classes/layout.d.ts +16 -0
  60. package/dist/classes/list.d.ts +22 -0
  61. package/dist/classes/mentions.d.ts +27 -0
  62. package/dist/classes/menu.d.ts +33 -0
  63. package/dist/classes/message.d.ts +16 -0
  64. package/dist/classes/modal.d.ts +17 -0
  65. package/dist/classes/notification.d.ts +22 -0
  66. package/dist/classes/pagination.d.ts +23 -0
  67. package/dist/classes/popconfirm.d.ts +19 -0
  68. package/dist/classes/popover.d.ts +13 -0
  69. package/dist/classes/progress.d.ts +11 -0
  70. package/dist/classes/qr-code.d.ts +19 -0
  71. package/dist/classes/radio.d.ts +23 -0
  72. package/dist/classes/rate.d.ts +23 -0
  73. package/dist/classes/result.d.ts +15 -0
  74. package/dist/classes/row.d.ts +11 -0
  75. package/dist/classes/segmented.d.ts +19 -0
  76. package/dist/classes/select.d.ts +39 -0
  77. package/dist/classes/skeleton.d.ts +16 -0
  78. package/dist/classes/slider.d.ts +30 -0
  79. package/dist/classes/space.d.ts +18 -0
  80. package/dist/classes/spin.d.ts +16 -0
  81. package/dist/classes/splitter.d.ts +19 -0
  82. package/dist/classes/statistic.d.ts +9 -0
  83. package/dist/classes/steps.d.ts +36 -0
  84. package/dist/classes/switch.d.ts +16 -0
  85. package/dist/classes/table.d.ts +36 -0
  86. package/dist/classes/tabs.d.ts +42 -0
  87. package/dist/classes/tag.d.ts +20 -0
  88. package/dist/classes/time-picker.d.ts +24 -0
  89. package/dist/classes/timeline.d.ts +20 -0
  90. package/dist/classes/tooltip.d.ts +15 -0
  91. package/dist/classes/tour.d.ts +34 -0
  92. package/dist/classes/transfer.d.ts +30 -0
  93. package/dist/classes/tree-select.d.ts +39 -0
  94. package/dist/classes/tree.d.ts +34 -0
  95. package/dist/classes/typography.d.ts +48 -0
  96. package/dist/classes/upload.d.ts +31 -0
  97. package/dist/classes/watermark.d.ts +5 -0
  98. package/dist/components/affix/Affix.d.ts +3 -0
  99. package/dist/components/affix/Affix.types.d.ts +8 -0
  100. package/dist/components/affix/index.d.ts +2 -0
  101. package/dist/components/affix/index.js +103 -0
  102. package/dist/components/alert/Alert.d.ts +3 -0
  103. package/dist/components/alert/Alert.types.d.ts +7 -0
  104. package/dist/components/alert/index.d.ts +2 -0
  105. package/dist/components/alert/index.js +65 -0
  106. package/dist/components/anchor/Anchor.d.ts +4 -0
  107. package/dist/components/anchor/Anchor.types.d.ts +34 -0
  108. package/dist/components/anchor/index.d.ts +2 -0
  109. package/dist/components/anchor/index.js +240 -0
  110. package/dist/components/app/App.d.ts +5 -0
  111. package/dist/components/app/App.types.d.ts +27 -0
  112. package/dist/components/app/index.d.ts +2 -0
  113. package/dist/components/app/index.js +890 -0
  114. package/dist/components/auto-complete/AutoComplete.d.ts +2 -0
  115. package/dist/components/auto-complete/AutoComplete.types.d.ts +34 -0
  116. package/dist/components/auto-complete/index.d.ts +2 -0
  117. package/dist/components/auto-complete/index.js +339 -0
  118. package/dist/components/avatar/Avatar.d.ts +3 -0
  119. package/dist/components/avatar/Avatar.types.d.ts +10 -0
  120. package/dist/components/avatar/index.d.ts +2 -0
  121. package/dist/components/avatar/index.js +81 -0
  122. package/dist/components/back-top/BackTop.d.ts +3 -0
  123. package/dist/components/back-top/BackTop.types.d.ts +6 -0
  124. package/dist/components/back-top/index.d.ts +2 -0
  125. package/dist/components/back-top/index.js +108 -0
  126. package/dist/components/badge/Badge.d.ts +3 -0
  127. package/dist/components/badge/Badge.types.d.ts +9 -0
  128. package/dist/components/badge/index.d.ts +2 -0
  129. package/dist/components/badge/index.js +84 -0
  130. package/dist/components/breadcrumb/Breadcrumb.d.ts +2 -0
  131. package/dist/components/breadcrumb/Breadcrumb.types.d.ts +53 -0
  132. package/dist/components/breadcrumb/index.d.ts +2 -0
  133. package/dist/components/breadcrumb/index.js +313 -0
  134. package/dist/components/button/Button.d.ts +3 -0
  135. package/dist/components/button/Button.types.d.ts +15 -0
  136. package/dist/components/button/index.d.ts +2 -0
  137. package/dist/components/button/index.js +125 -0
  138. package/dist/components/calendar/Calendar.d.ts +2 -0
  139. package/dist/components/calendar/Calendar.types.d.ts +39 -0
  140. package/dist/components/calendar/index.d.ts +2 -0
  141. package/dist/components/calendar/index.js +352 -0
  142. package/dist/components/card/Card.d.ts +3 -0
  143. package/dist/components/card/Card.types.d.ts +7 -0
  144. package/dist/components/card/index.d.ts +2 -0
  145. package/dist/components/card/index.js +73 -0
  146. package/dist/components/carousel/Carousel.d.ts +2 -0
  147. package/dist/components/carousel/Carousel.types.d.ts +26 -0
  148. package/dist/components/carousel/index.d.ts +2 -0
  149. package/dist/components/carousel/index.js +193 -0
  150. package/dist/components/cascader/Cascader.d.ts +2 -0
  151. package/dist/components/cascader/Cascader.types.d.ts +63 -0
  152. package/dist/components/cascader/index.d.ts +2 -0
  153. package/dist/components/cascader/index.js +509 -0
  154. package/dist/components/checkbox/Checkbox.d.ts +3 -0
  155. package/dist/components/checkbox/Checkbox.types.d.ts +15 -0
  156. package/dist/components/checkbox/index.d.ts +2 -0
  157. package/dist/components/checkbox/index.js +134 -0
  158. package/dist/components/col/Col.d.ts +3 -0
  159. package/dist/components/col/Col.types.d.ts +24 -0
  160. package/dist/components/col/index.d.ts +2 -0
  161. package/dist/components/col/index.js +100 -0
  162. package/dist/components/collapse/Collapse.d.ts +3 -0
  163. package/dist/components/collapse/Collapse.types.d.ts +21 -0
  164. package/dist/components/collapse/index.d.ts +2 -0
  165. package/dist/components/collapse/index.js +148 -0
  166. package/dist/components/color-picker/ColorPicker.d.ts +2 -0
  167. package/dist/components/color-picker/ColorPicker.types.d.ts +39 -0
  168. package/dist/components/color-picker/index.d.ts +2 -0
  169. package/dist/components/color-picker/index.js +282 -0
  170. package/dist/components/config-provider/ConfigProvider.d.ts +4 -0
  171. package/dist/components/config-provider/ConfigProvider.types.d.ts +39 -0
  172. package/dist/components/config-provider/index.d.ts +2 -0
  173. package/dist/components/config-provider/index.js +127 -0
  174. package/dist/components/date-picker/DatePicker.d.ts +2 -0
  175. package/dist/components/date-picker/DatePicker.types.d.ts +46 -0
  176. package/dist/components/date-picker/index.d.ts +2 -0
  177. package/dist/components/date-picker/index.js +319 -0
  178. package/dist/components/descriptions/Descriptions.d.ts +2 -0
  179. package/dist/components/descriptions/Descriptions.types.d.ts +39 -0
  180. package/dist/components/descriptions/index.d.ts +2 -0
  181. package/dist/components/descriptions/index.js +196 -0
  182. package/dist/components/divider/Divider.d.ts +3 -0
  183. package/dist/components/divider/Divider.types.d.ts +14 -0
  184. package/dist/components/divider/index.d.ts +2 -0
  185. package/dist/components/divider/index.js +108 -0
  186. package/dist/components/dm-auxiliary/DmAuxiliary.d.ts +4 -0
  187. package/dist/components/dm-auxiliary/DmAuxiliary.types.d.ts +15 -0
  188. package/dist/components/dm-auxiliary/index.d.ts +2 -0
  189. package/dist/components/dm-auxiliary/index.js +127 -0
  190. package/dist/components/dm-breadcrumb/DmBreadcrumb.d.ts +3 -0
  191. package/dist/components/dm-breadcrumb/DmBreadcrumb.types.d.ts +25 -0
  192. package/dist/components/dm-breadcrumb/index.d.ts +2 -0
  193. package/dist/components/dm-breadcrumb/index.js +460 -0
  194. package/dist/components/dm-date-picker/DmDatePicker.d.ts +4 -0
  195. package/dist/components/dm-date-picker/DmDatePicker.types.d.ts +11 -0
  196. package/dist/components/dm-date-picker/index.d.ts +2 -0
  197. package/dist/components/dm-date-picker/index.js +460 -0
  198. package/dist/components/dm-drawer/DmDrawer.d.ts +3 -0
  199. package/dist/components/dm-drawer/DmDrawer.types.d.ts +16 -0
  200. package/dist/components/dm-drawer/index.d.ts +2 -0
  201. package/dist/components/dm-drawer/index.js +309 -0
  202. package/dist/components/dm-infinite-scroll/DmInfiniteScroll.d.ts +3 -0
  203. package/dist/components/dm-infinite-scroll/DmInfiniteScroll.types.d.ts +18 -0
  204. package/dist/components/dm-infinite-scroll/index.d.ts +2 -0
  205. package/dist/components/dm-infinite-scroll/index.js +153 -0
  206. package/dist/components/dm-layout/DmLayout.d.ts +4 -0
  207. package/dist/components/dm-layout/DmLayout.types.d.ts +31 -0
  208. package/dist/components/dm-layout/index.d.ts +2 -0
  209. package/dist/components/dm-layout/index.js +1186 -0
  210. package/dist/components/dm-menu/DmMenu.d.ts +5 -0
  211. package/dist/components/dm-menu/DmMenu.types.d.ts +44 -0
  212. package/dist/components/dm-menu/index.d.ts +2 -0
  213. package/dist/components/dm-menu/index.js +444 -0
  214. package/dist/components/dm-message/DmMessage.d.ts +16 -0
  215. package/dist/components/dm-message/DmMessage.types.d.ts +24 -0
  216. package/dist/components/dm-message/index.d.ts +2 -0
  217. package/dist/components/dm-message/index.js +280 -0
  218. package/dist/components/dm-page-header/DmPageHeader.d.ts +6 -0
  219. package/dist/components/dm-page-header/DmPageHeader.types.d.ts +19 -0
  220. package/dist/components/dm-page-header/index.d.ts +2 -0
  221. package/dist/components/dm-page-header/index.js +925 -0
  222. package/dist/components/dm-pagination/DmPagination.d.ts +3 -0
  223. package/dist/components/dm-pagination/DmPagination.types.d.ts +22 -0
  224. package/dist/components/dm-pagination/index.d.ts +2 -0
  225. package/dist/components/dm-pagination/index.js +469 -0
  226. package/dist/components/dm-pro-table/DmProTable.d.ts +7 -0
  227. package/dist/components/dm-pro-table/DmProTable.types.d.ts +15 -0
  228. package/dist/components/dm-pro-table/index.d.ts +2 -0
  229. package/dist/components/dm-pro-table/index.js +3076 -0
  230. package/dist/components/dm-pro-table-inner/DmProTableInner.d.ts +7 -0
  231. package/dist/components/dm-pro-table-inner/DmProTableInner.types.d.ts +5 -0
  232. package/dist/components/dm-pro-table-inner/index.d.ts +2 -0
  233. package/dist/components/dm-pro-table-inner/index.js +2620 -0
  234. package/dist/components/dm-provider/DmProvider.d.ts +3 -0
  235. package/dist/components/dm-provider/DmProvider.types.d.ts +11 -0
  236. package/dist/components/dm-provider/index.d.ts +2 -0
  237. package/dist/components/dm-provider/index.js +255 -0
  238. package/dist/components/dm-query/DmQuery.d.ts +3 -0
  239. package/dist/components/dm-query/DmQuery.types.d.ts +20 -0
  240. package/dist/components/dm-query/index.d.ts +2 -0
  241. package/dist/components/dm-query/index.js +1319 -0
  242. package/dist/components/dm-search/DmSearch.d.ts +3 -0
  243. package/dist/components/dm-search/DmSearch.types.d.ts +38 -0
  244. package/dist/components/dm-search/index.d.ts +2 -0
  245. package/dist/components/dm-search/index.js +1264 -0
  246. package/dist/components/dm-splitter/DmSplitter.d.ts +3 -0
  247. package/dist/components/dm-splitter/DmSplitter.types.d.ts +32 -0
  248. package/dist/components/dm-splitter/index.d.ts +2 -0
  249. package/dist/components/dm-splitter/index.js +406 -0
  250. package/dist/components/dm-status/DmStatus.d.ts +4 -0
  251. package/dist/components/dm-status/DmStatus.types.d.ts +12 -0
  252. package/dist/components/dm-status/index.d.ts +2 -0
  253. package/dist/components/dm-status/index.js +369 -0
  254. package/dist/components/dm-table/DmTable.d.ts +8 -0
  255. package/dist/components/dm-table/DmTable.types.d.ts +28 -0
  256. package/dist/components/dm-table/index.d.ts +2 -0
  257. package/dist/components/dm-table/index.js +2607 -0
  258. package/dist/components/dm-tabs/DmTabs.d.ts +3 -0
  259. package/dist/components/dm-tabs/DmTabs.types.d.ts +10 -0
  260. package/dist/components/dm-tabs/index.d.ts +2 -0
  261. package/dist/components/dm-tabs/index.js +415 -0
  262. package/dist/components/dm-toolbar/DmToolbar.d.ts +6 -0
  263. package/dist/components/dm-toolbar/DmToolbar.types.d.ts +18 -0
  264. package/dist/components/dm-toolbar/index.d.ts +2 -0
  265. package/dist/components/dm-toolbar/index.js +520 -0
  266. package/dist/components/dm-tree/DmTree.d.ts +3 -0
  267. package/dist/components/dm-tree/DmTree.types.d.ts +70 -0
  268. package/dist/components/dm-tree/index.d.ts +2 -0
  269. package/dist/components/dm-tree/index.js +1852 -0
  270. package/dist/components/dm-truncate/DmTruncate.d.ts +3 -0
  271. package/dist/components/dm-truncate/DmTruncate.types.d.ts +17 -0
  272. package/dist/components/dm-truncate/index.d.ts +2 -0
  273. package/dist/components/dm-truncate/index.js +375 -0
  274. package/dist/components/drawer/Drawer.d.ts +3 -0
  275. package/dist/components/drawer/Drawer.types.d.ts +18 -0
  276. package/dist/components/drawer/index.d.ts +2 -0
  277. package/dist/components/drawer/index.js +132 -0
  278. package/dist/components/dropdown/Dropdown.d.ts +2 -0
  279. package/dist/components/dropdown/Dropdown.types.d.ts +44 -0
  280. package/dist/components/dropdown/index.d.ts +2 -0
  281. package/dist/components/dropdown/index.js +411 -0
  282. package/dist/components/empty/Empty.d.ts +2 -0
  283. package/dist/components/empty/Empty.types.d.ts +11 -0
  284. package/dist/components/empty/index.d.ts +2 -0
  285. package/dist/components/empty/index.js +116 -0
  286. package/dist/components/flex/Flex.d.ts +3 -0
  287. package/dist/components/flex/Flex.types.d.ts +13 -0
  288. package/dist/components/flex/index.d.ts +2 -0
  289. package/dist/components/flex/index.js +107 -0
  290. package/dist/components/float-button/FloatButton.d.ts +2 -0
  291. package/dist/components/float-button/FloatButton.types.d.ts +44 -0
  292. package/dist/components/float-button/index.d.ts +2 -0
  293. package/dist/components/float-button/index.js +308 -0
  294. package/dist/components/form/Form.d.ts +4 -0
  295. package/dist/components/form/Form.types.d.ts +107 -0
  296. package/dist/components/form/index.d.ts +2 -0
  297. package/dist/components/form/index.js +449 -0
  298. package/dist/components/grid/Grid.d.ts +8 -0
  299. package/dist/components/grid/Grid.types.d.ts +5 -0
  300. package/dist/components/grid/index.d.ts +2 -0
  301. package/dist/components/grid/index.js +104 -0
  302. package/dist/components/image/Image.d.ts +2 -0
  303. package/dist/components/image/Image.types.d.ts +25 -0
  304. package/dist/components/image/index.d.ts +2 -0
  305. package/dist/components/image/index.js +171 -0
  306. package/dist/components/input/Input.d.ts +8 -0
  307. package/dist/components/input/Input.types.d.ts +46 -0
  308. package/dist/components/input/index.d.ts +2 -0
  309. package/dist/components/input/index.js +352 -0
  310. package/dist/components/input-number/InputNumber.d.ts +3 -0
  311. package/dist/components/input-number/InputNumber.types.d.ts +23 -0
  312. package/dist/components/input-number/index.d.ts +2 -0
  313. package/dist/components/input-number/index.js +175 -0
  314. package/dist/components/layout/Layout.d.ts +2 -0
  315. package/dist/components/layout/Layout.types.d.ts +23 -0
  316. package/dist/components/layout/index.d.ts +2 -0
  317. package/dist/components/layout/index.js +142 -0
  318. package/dist/components/list/List.d.ts +2 -0
  319. package/dist/components/list/List.types.d.ts +27 -0
  320. package/dist/components/list/index.d.ts +2 -0
  321. package/dist/components/list/index.js +175 -0
  322. package/dist/components/mentions/Mentions.d.ts +2 -0
  323. package/dist/components/mentions/Mentions.types.d.ts +30 -0
  324. package/dist/components/mentions/index.d.ts +2 -0
  325. package/dist/components/mentions/index.js +321 -0
  326. package/dist/components/menu/Menu.d.ts +2 -0
  327. package/dist/components/menu/Menu.types.d.ts +58 -0
  328. package/dist/components/menu/index.d.ts +2 -0
  329. package/dist/components/menu/index.js +317 -0
  330. package/dist/components/message/Message.d.ts +6 -0
  331. package/dist/components/message/Message.types.d.ts +45 -0
  332. package/dist/components/message/index.d.ts +2 -0
  333. package/dist/components/message/index.js +205 -0
  334. package/dist/components/modal/Modal.d.ts +2 -0
  335. package/dist/components/modal/Modal.types.d.ts +43 -0
  336. package/dist/components/modal/index.d.ts +2 -0
  337. package/dist/components/modal/index.js +214 -0
  338. package/dist/components/notification/Notification.d.ts +4 -0
  339. package/dist/components/notification/Notification.types.d.ts +43 -0
  340. package/dist/components/notification/index.d.ts +2 -0
  341. package/dist/components/notification/index.js +420 -0
  342. package/dist/components/pagination/Pagination.d.ts +3 -0
  343. package/dist/components/pagination/Pagination.types.d.ts +17 -0
  344. package/dist/components/pagination/index.d.ts +2 -0
  345. package/dist/components/pagination/index.js +281 -0
  346. package/dist/components/popconfirm/Popconfirm.d.ts +3 -0
  347. package/dist/components/popconfirm/Popconfirm.types.d.ts +26 -0
  348. package/dist/components/popconfirm/index.d.ts +2 -0
  349. package/dist/components/popconfirm/index.js +364 -0
  350. package/dist/components/popover/Popover.d.ts +3 -0
  351. package/dist/components/popover/Popover.types.d.ts +15 -0
  352. package/dist/components/popover/index.d.ts +2 -0
  353. package/dist/components/popover/index.js +219 -0
  354. package/dist/components/progress/Progress.d.ts +3 -0
  355. package/dist/components/progress/Progress.types.d.ts +11 -0
  356. package/dist/components/progress/index.d.ts +2 -0
  357. package/dist/components/progress/index.js +106 -0
  358. package/dist/components/qr-code/QRCode.d.ts +3 -0
  359. package/dist/components/qr-code/QRCode.types.d.ts +17 -0
  360. package/dist/components/qr-code/index.d.ts +2 -0
  361. package/dist/components/qr-code/index.js +224 -0
  362. package/dist/components/radio/Radio.d.ts +3 -0
  363. package/dist/components/radio/Radio.types.d.ts +14 -0
  364. package/dist/components/radio/index.d.ts +2 -0
  365. package/dist/components/radio/index.js +118 -0
  366. package/dist/components/rate/Rate.d.ts +3 -0
  367. package/dist/components/rate/Rate.types.d.ts +23 -0
  368. package/dist/components/rate/index.d.ts +2 -0
  369. package/dist/components/rate/index.js +202 -0
  370. package/dist/components/result/Result.d.ts +3 -0
  371. package/dist/components/result/Result.types.d.ts +10 -0
  372. package/dist/components/result/index.d.ts +2 -0
  373. package/dist/components/result/index.js +205 -0
  374. package/dist/components/row/Row.d.ts +3 -0
  375. package/dist/components/row/Row.types.d.ts +11 -0
  376. package/dist/components/row/index.d.ts +2 -0
  377. package/dist/components/row/index.js +109 -0
  378. package/dist/components/segmented/Segmented.d.ts +3 -0
  379. package/dist/components/segmented/Segmented.types.d.ts +20 -0
  380. package/dist/components/segmented/index.d.ts +2 -0
  381. package/dist/components/segmented/index.js +130 -0
  382. package/dist/components/select/Select.d.ts +2 -0
  383. package/dist/components/select/Select.types.d.ts +47 -0
  384. package/dist/components/select/index.d.ts +2 -0
  385. package/dist/components/select/index.js +361 -0
  386. package/dist/components/skeleton/Skeleton.d.ts +15 -0
  387. package/dist/components/skeleton/Skeleton.types.d.ts +35 -0
  388. package/dist/components/skeleton/index.d.ts +2 -0
  389. package/dist/components/skeleton/index.js +238 -0
  390. package/dist/components/slider/Slider.d.ts +3 -0
  391. package/dist/components/slider/Slider.types.d.ts +38 -0
  392. package/dist/components/slider/index.d.ts +2 -0
  393. package/dist/components/slider/index.js +425 -0
  394. package/dist/components/space/Space.d.ts +2 -0
  395. package/dist/components/space/Space.types.d.ts +19 -0
  396. package/dist/components/space/index.d.ts +2 -0
  397. package/dist/components/space/index.js +144 -0
  398. package/dist/components/spin/Spin.d.ts +2 -0
  399. package/dist/components/spin/Spin.types.d.ts +15 -0
  400. package/dist/components/spin/index.d.ts +2 -0
  401. package/dist/components/spin/index.js +138 -0
  402. package/dist/components/splitter/Splitter.d.ts +2 -0
  403. package/dist/components/splitter/Splitter.types.d.ts +29 -0
  404. package/dist/components/splitter/index.d.ts +2 -0
  405. package/dist/components/splitter/index.js +227 -0
  406. package/dist/components/statistic/Statistic.d.ts +2 -0
  407. package/dist/components/statistic/Statistic.types.d.ts +22 -0
  408. package/dist/components/statistic/index.d.ts +2 -0
  409. package/dist/components/statistic/index.js +150 -0
  410. package/dist/components/steps/Steps.d.ts +4 -0
  411. package/dist/components/steps/Steps.types.d.ts +49 -0
  412. package/dist/components/steps/index.d.ts +2 -0
  413. package/dist/components/steps/index.js +311 -0
  414. package/dist/components/switch/Switch.d.ts +2 -0
  415. package/dist/components/switch/Switch.types.d.ts +16 -0
  416. package/dist/components/switch/index.d.ts +2 -0
  417. package/dist/components/switch/index.js +120 -0
  418. package/dist/components/table/Table.d.ts +2 -0
  419. package/dist/components/table/Table.types.d.ts +142 -0
  420. package/dist/components/table/index.d.ts +2 -0
  421. package/dist/components/table/index.js +721 -0
  422. package/dist/components/tabs/Tabs.d.ts +10 -0
  423. package/dist/components/tabs/Tabs.types.d.ts +48 -0
  424. package/dist/components/tabs/index.d.ts +2 -0
  425. package/dist/components/tabs/index.js +359 -0
  426. package/dist/components/tag/Tag.d.ts +5 -0
  427. package/dist/components/tag/Tag.types.d.ts +20 -0
  428. package/dist/components/tag/index.d.ts +2 -0
  429. package/dist/components/tag/index.js +151 -0
  430. package/dist/components/time-picker/TimePicker.d.ts +2 -0
  431. package/dist/components/time-picker/TimePicker.types.d.ts +43 -0
  432. package/dist/components/time-picker/index.d.ts +2 -0
  433. package/dist/components/time-picker/index.js +323 -0
  434. package/dist/components/timeline/Timeline.d.ts +3 -0
  435. package/dist/components/timeline/Timeline.types.d.ts +20 -0
  436. package/dist/components/timeline/index.d.ts +2 -0
  437. package/dist/components/timeline/index.js +130 -0
  438. package/dist/components/tooltip/Tooltip.d.ts +3 -0
  439. package/dist/components/tooltip/Tooltip.types.d.ts +12 -0
  440. package/dist/components/tooltip/index.d.ts +2 -0
  441. package/dist/components/tooltip/index.js +133 -0
  442. package/dist/components/tour/Tour.d.ts +3 -0
  443. package/dist/components/tour/Tour.types.d.ts +50 -0
  444. package/dist/components/tour/index.d.ts +2 -0
  445. package/dist/components/tour/index.js +507 -0
  446. package/dist/components/transfer/Transfer.d.ts +5 -0
  447. package/dist/components/transfer/Transfer.types.d.ts +88 -0
  448. package/dist/components/transfer/index.d.ts +2 -0
  449. package/dist/components/transfer/index.js +456 -0
  450. package/dist/components/tree/Tree.d.ts +2 -0
  451. package/dist/components/tree/Tree.types.d.ts +92 -0
  452. package/dist/components/tree/index.d.ts +2 -0
  453. package/dist/components/tree/index.js +439 -0
  454. package/dist/components/tree-select/TreeSelect.d.ts +2 -0
  455. package/dist/components/tree-select/TreeSelect.types.d.ts +70 -0
  456. package/dist/components/tree-select/index.d.ts +2 -0
  457. package/dist/components/tree-select/index.js +488 -0
  458. package/dist/components/typography/Typography.d.ts +8 -0
  459. package/dist/components/typography/Typography.types.d.ts +81 -0
  460. package/dist/components/typography/index.d.ts +2 -0
  461. package/dist/components/typography/index.js +689 -0
  462. package/dist/components/upload/Upload.d.ts +2 -0
  463. package/dist/components/upload/Upload.types.d.ts +55 -0
  464. package/dist/components/upload/index.d.ts +2 -0
  465. package/dist/components/upload/index.js +388 -0
  466. package/dist/components/watermark/Watermark.d.ts +3 -0
  467. package/dist/components/watermark/Watermark.types.d.ts +20 -0
  468. package/dist/components/watermark/index.d.ts +2 -0
  469. package/dist/components/watermark/index.js +109 -0
  470. package/dist/index.d.ts +100 -0
  471. package/dist/index.js +18027 -0
  472. package/dist/infrastructure.d.ts +124 -0
  473. package/dist/infrastructure.js +141 -0
  474. package/dist/styles.css +19312 -0
  475. package/dist/theme/ThemeProvider.d.ts +16 -0
  476. package/dist/theme/index.d.ts +2 -0
  477. package/dist/theme/index.js +83 -0
  478. package/dist/theme/theme-script.d.ts +8 -0
  479. package/dist/utils/cn.d.ts +13 -0
  480. package/dist/utils/index.d.ts +1 -0
  481. package/dist/utils/index.js +8 -0
  482. package/package.json +444 -0
@@ -0,0 +1,1319 @@
1
+ "use client";
2
+
3
+ // ../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
4
+ function r(e) {
5
+ var t, f, n = "";
6
+ if (typeof e == "string" || typeof e == "number")
7
+ n += e;
8
+ else if (typeof e == "object")
9
+ if (Array.isArray(e)) {
10
+ var o = e.length;
11
+ for (t = 0;t < o; t++)
12
+ e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
13
+ } else
14
+ for (f in e)
15
+ e[f] && (n && (n += " "), n += f);
16
+ return n;
17
+ }
18
+ function clsx() {
19
+ for (var e, t, f = 0, n = "", o = arguments.length;f < o; f++)
20
+ (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
21
+ return n;
22
+ }
23
+
24
+ // src/utils/cn.ts
25
+ function cn(...inputs) {
26
+ return clsx(inputs);
27
+ }
28
+ // src/classes/button.ts
29
+ var buttonBaseClass = "btn";
30
+ var buttonColorClasses = {
31
+ primary: "btn-primary",
32
+ secondary: "btn-secondary",
33
+ tertiary: "btn-tertiary",
34
+ info: "btn-info",
35
+ success: "btn-success",
36
+ warning: "btn-warning",
37
+ error: "btn-error"
38
+ };
39
+ var buttonAppearanceClasses = {
40
+ filled: "",
41
+ outline: "btn-outline",
42
+ tonal: "btn-tonal",
43
+ ghost: "btn-ghost",
44
+ text: "btn-text"
45
+ };
46
+ var buttonShapeClasses = {
47
+ rect: "",
48
+ circle: "btn-circle",
49
+ square: "btn-square"
50
+ };
51
+ var buttonSizeClasses = {
52
+ xs: "btn-xs",
53
+ sm: "btn-sm",
54
+ md: "btn-md",
55
+ lg: "btn-lg"
56
+ };
57
+ var buttonBlockClass = "btn-block";
58
+ var buttonIsLoadingClass = "btn-loading";
59
+ function getButtonClasses({
60
+ color = "primary",
61
+ appearance = "filled",
62
+ shape = "rect",
63
+ size = "md",
64
+ block,
65
+ isLoading,
66
+ className
67
+ }) {
68
+ return cn(buttonBaseClass, buttonColorClasses[color], buttonAppearanceClasses[appearance], buttonShapeClasses[shape], buttonSizeClasses[size], block && buttonBlockClass, isLoading && buttonIsLoadingClass, className);
69
+ }
70
+
71
+ // src/components/button/Button.tsx
72
+ import { jsx, jsxs } from "react/jsx-runtime";
73
+ function Button({
74
+ color = "primary",
75
+ appearance = "filled",
76
+ shape = "rect",
77
+ size = "md",
78
+ block,
79
+ isLoading,
80
+ leftIcon,
81
+ rightIcon,
82
+ className,
83
+ children,
84
+ disabled,
85
+ ref,
86
+ ...props
87
+ }) {
88
+ const classes = getButtonClasses({
89
+ color,
90
+ appearance,
91
+ shape,
92
+ size,
93
+ block,
94
+ isLoading,
95
+ className
96
+ });
97
+ return /* @__PURE__ */ jsxs("button", {
98
+ ref,
99
+ className: classes,
100
+ disabled: disabled || isLoading,
101
+ "aria-busy": isLoading,
102
+ "aria-disabled": disabled || isLoading,
103
+ ...props,
104
+ children: [
105
+ isLoading && /* @__PURE__ */ jsx("span", {
106
+ className: "btn-spinner"
107
+ }),
108
+ !isLoading && leftIcon && /* @__PURE__ */ jsx("span", {
109
+ className: "btn-icon-left",
110
+ children: leftIcon
111
+ }),
112
+ /* @__PURE__ */ jsx("span", {
113
+ className: "btn-content",
114
+ children
115
+ }),
116
+ !isLoading && rightIcon && /* @__PURE__ */ jsx("span", {
117
+ className: "btn-icon-right",
118
+ children: rightIcon
119
+ })
120
+ ]
121
+ });
122
+ }
123
+ // src/components/date-picker/DatePicker.tsx
124
+ import { forwardRef, useMemo, useState } from "react";
125
+
126
+ // src/classes/date-picker.ts
127
+ var datePickerBaseClass = "datepicker";
128
+ var datePickerInputClass = "datepicker-input";
129
+ var datePickerIconClass = "datepicker-icon";
130
+ var datePickerDropdownClass = "datepicker-dropdown";
131
+ var datePickerDropdownOpenClass = "datepicker-dropdown-open";
132
+ var datePickerFooterClass = "datepicker-footer";
133
+ var datePickerPresetClass = "datepicker-preset";
134
+ var datePickerRangeClass = "datepicker-range";
135
+ var datePickerSeparatorClass = "datepicker-range-separator";
136
+ var datePickerClearClass = "datepicker-clear";
137
+ var datePickerSizeClasses = {
138
+ sm: "datepicker-sm",
139
+ md: "",
140
+ lg: "datepicker-lg"
141
+ };
142
+ var datePickerStatusClasses = {
143
+ error: "datepicker-error",
144
+ success: "datepicker-success"
145
+ };
146
+ var datePickerPickerClasses = {
147
+ date: "",
148
+ week: "datepicker-week",
149
+ month: "datepicker-month-picker",
150
+ quarter: "datepicker-quarter-picker",
151
+ year: "datepicker-year-picker",
152
+ time: "datepicker-time-picker"
153
+ };
154
+ function getDatePickerClasses({
155
+ size = "md",
156
+ status,
157
+ picker = "date",
158
+ open,
159
+ disabled,
160
+ range,
161
+ className
162
+ }) {
163
+ return cn(datePickerBaseClass, datePickerSizeClasses[size], status && datePickerStatusClasses[status], datePickerPickerClasses[picker], open && "datepicker-open", disabled && "datepicker-disabled", range && datePickerRangeClass, className);
164
+ }
165
+ function getDatePickerDropdownClasses({
166
+ open,
167
+ className
168
+ }) {
169
+ return cn(datePickerDropdownClass, open && datePickerDropdownOpenClass, className);
170
+ }
171
+
172
+ // src/components/date-picker/DatePicker.tsx
173
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
174
+ function todayValue(picker) {
175
+ const today = new Date;
176
+ const year = today.getFullYear();
177
+ const month = String(today.getMonth() + 1).padStart(2, "0");
178
+ const day = String(today.getDate()).padStart(2, "0");
179
+ if (picker === "month")
180
+ return `${year}-${month}`;
181
+ if (picker === "year")
182
+ return String(year);
183
+ if (picker === "time")
184
+ return "00:00";
185
+ return `${year}-${month}-${day}`;
186
+ }
187
+ function inputTypeForPicker(picker) {
188
+ if (picker === "month")
189
+ return "month";
190
+ if (picker === "week")
191
+ return "week";
192
+ if (picker === "time")
193
+ return "time";
194
+ return picker === "year" || picker === "quarter" ? "text" : "date";
195
+ }
196
+ function placeholderForPicker(picker) {
197
+ if (picker === "month")
198
+ return "Select month";
199
+ if (picker === "week")
200
+ return "Select week";
201
+ if (picker === "quarter")
202
+ return "Select quarter";
203
+ if (picker === "year")
204
+ return "Select year";
205
+ if (picker === "time")
206
+ return "Select time";
207
+ return "Select date";
208
+ }
209
+ function normalizeDateValue(value) {
210
+ return typeof value === "string" && value.length > 0 ? value : undefined;
211
+ }
212
+ var DatePickerRoot = forwardRef(({
213
+ allowClear,
214
+ className,
215
+ defaultOpen,
216
+ defaultValue,
217
+ disabled,
218
+ disabledDate,
219
+ onBlur,
220
+ onChange,
221
+ onFocus,
222
+ onOpenChange,
223
+ open,
224
+ picker = "date",
225
+ placeholder,
226
+ presets,
227
+ showNow,
228
+ size = "md",
229
+ status,
230
+ value,
231
+ ...props
232
+ }, ref) => {
233
+ const isValueControlled = value !== undefined;
234
+ const isOpenControlled = open !== undefined;
235
+ const [innerValue, setInnerValue] = useState(() => normalizeDateValue(defaultValue));
236
+ const [innerOpen, setInnerOpen] = useState(Boolean(defaultOpen));
237
+ const currentValue = isValueControlled ? normalizeDateValue(value) : innerValue;
238
+ const visible = isOpenControlled ? Boolean(open) : innerOpen;
239
+ const inputType = inputTypeForPicker(picker);
240
+ function setVisible(nextOpen) {
241
+ if (!isOpenControlled) {
242
+ setInnerOpen(nextOpen);
243
+ }
244
+ onOpenChange?.(nextOpen);
245
+ }
246
+ function emitChange(nextValue) {
247
+ if (nextValue && disabledDate?.(nextValue)) {
248
+ return;
249
+ }
250
+ if (!isValueControlled) {
251
+ setInnerValue(nextValue);
252
+ }
253
+ onChange?.(nextValue, nextValue ?? "");
254
+ }
255
+ const presetItems = useMemo(() => presets ?? [], [presets]);
256
+ return /* @__PURE__ */ jsxs2("div", {
257
+ ...props,
258
+ ref,
259
+ className: getDatePickerClasses({
260
+ size,
261
+ status,
262
+ picker,
263
+ open: visible,
264
+ disabled,
265
+ className
266
+ }),
267
+ children: [
268
+ /* @__PURE__ */ jsx2("input", {
269
+ className: datePickerInputClass,
270
+ disabled,
271
+ type: inputType,
272
+ value: currentValue ?? "",
273
+ placeholder: placeholder ?? placeholderForPicker(picker),
274
+ onFocus: (event) => {
275
+ onFocus?.(event);
276
+ setVisible(true);
277
+ },
278
+ onBlur: (event) => {
279
+ onBlur?.(event);
280
+ setVisible(false);
281
+ },
282
+ onChange: (event) => emitChange(event.currentTarget.value || undefined)
283
+ }),
284
+ allowClear && currentValue && !disabled ? /* @__PURE__ */ jsx2("button", {
285
+ type: "button",
286
+ className: datePickerClearClass,
287
+ "aria-label": "Clear date",
288
+ onMouseDown: (event) => event.preventDefault(),
289
+ onClick: () => emitChange(undefined),
290
+ children: "x"
291
+ }) : null,
292
+ /* @__PURE__ */ jsx2("span", {
293
+ className: datePickerIconClass,
294
+ "aria-hidden": "true",
295
+ children: "calendar"
296
+ }),
297
+ (presetItems.length > 0 || showNow) && visible ? /* @__PURE__ */ jsxs2("div", {
298
+ className: getDatePickerDropdownClasses({ open: visible }),
299
+ children: [
300
+ presetItems.map((preset, index) => /* @__PURE__ */ jsx2("button", {
301
+ type: "button",
302
+ className: datePickerPresetClass,
303
+ onMouseDown: (event) => event.preventDefault(),
304
+ onClick: () => emitChange(preset.value),
305
+ children: preset.label
306
+ }, index)),
307
+ showNow ? /* @__PURE__ */ jsx2("div", {
308
+ className: datePickerFooterClass,
309
+ children: /* @__PURE__ */ jsx2("button", {
310
+ type: "button",
311
+ onMouseDown: (event) => event.preventDefault(),
312
+ onClick: () => emitChange(todayValue(picker)),
313
+ children: "Now"
314
+ })
315
+ }) : null
316
+ ]
317
+ }) : null
318
+ ]
319
+ });
320
+ });
321
+ DatePickerRoot.displayName = "DatePicker";
322
+ var RangePicker = forwardRef(({
323
+ allowClear,
324
+ className,
325
+ defaultValue,
326
+ disabled,
327
+ disabledDate,
328
+ onChange,
329
+ picker = "date",
330
+ placeholder,
331
+ separator = "-",
332
+ size = "md",
333
+ status,
334
+ value,
335
+ ...props
336
+ }, ref) => {
337
+ const isControlled = value !== undefined;
338
+ const [innerValue, setInnerValue] = useState(defaultValue ?? [undefined, undefined]);
339
+ const currentValue = isControlled ? value : innerValue;
340
+ const inputType = inputTypeForPicker(picker);
341
+ function emitChange(nextValue) {
342
+ if (nextValue.some((item) => item !== undefined && Boolean(disabledDate?.(item)))) {
343
+ return;
344
+ }
345
+ if (!isControlled) {
346
+ setInnerValue(nextValue);
347
+ }
348
+ onChange?.(nextValue, [nextValue[0] ?? "", nextValue[1] ?? ""]);
349
+ }
350
+ function updateIndex(index, nextItem) {
351
+ emitChange(index === 0 ? [nextItem, currentValue?.[1]] : [currentValue?.[0], nextItem]);
352
+ }
353
+ return /* @__PURE__ */ jsxs2("div", {
354
+ ...props,
355
+ ref,
356
+ className: getDatePickerClasses({
357
+ size,
358
+ status,
359
+ picker,
360
+ disabled,
361
+ range: true,
362
+ className
363
+ }),
364
+ children: [
365
+ /* @__PURE__ */ jsx2("input", {
366
+ className: datePickerInputClass,
367
+ disabled,
368
+ type: inputType,
369
+ value: currentValue?.[0] ?? "",
370
+ placeholder: Array.isArray(placeholder) ? placeholder[0] : "Start date",
371
+ onChange: (event) => updateIndex(0, event.currentTarget.value || undefined)
372
+ }),
373
+ /* @__PURE__ */ jsx2("span", {
374
+ className: datePickerSeparatorClass,
375
+ children: separator
376
+ }),
377
+ /* @__PURE__ */ jsx2("input", {
378
+ className: datePickerInputClass,
379
+ disabled,
380
+ type: inputType,
381
+ value: currentValue?.[1] ?? "",
382
+ placeholder: Array.isArray(placeholder) ? placeholder[1] : "End date",
383
+ onChange: (event) => updateIndex(1, event.currentTarget.value || undefined)
384
+ }),
385
+ allowClear && (currentValue?.[0] || currentValue?.[1]) && !disabled ? /* @__PURE__ */ jsx2("button", {
386
+ type: "button",
387
+ className: datePickerClearClass,
388
+ "aria-label": "Clear date range",
389
+ onClick: () => emitChange([undefined, undefined]),
390
+ children: "x"
391
+ }) : null
392
+ ]
393
+ });
394
+ });
395
+ RangePicker.displayName = "DatePicker.RangePicker";
396
+ function withPicker(picker, displayName) {
397
+ const Picker = forwardRef((props, ref) => /* @__PURE__ */ jsx2(DatePickerRoot, {
398
+ ...props,
399
+ ref,
400
+ picker
401
+ }));
402
+ Picker.displayName = displayName;
403
+ return Picker;
404
+ }
405
+ var DatePicker = Object.assign(DatePickerRoot, {
406
+ RangePicker,
407
+ WeekPicker: withPicker("week", "DatePicker.WeekPicker"),
408
+ MonthPicker: withPicker("month", "DatePicker.MonthPicker"),
409
+ QuarterPicker: withPicker("quarter", "DatePicker.QuarterPicker"),
410
+ YearPicker: withPicker("year", "DatePicker.YearPicker")
411
+ });
412
+ // src/components/input/Input.tsx
413
+ import {
414
+ forwardRef as forwardRef2,
415
+ useImperativeHandle,
416
+ useRef,
417
+ useState as useState2
418
+ } from "react";
419
+
420
+ // src/classes/input.ts
421
+ var inputBaseClass = "input";
422
+ var inputWrapperClass = "input-wrapper";
423
+ var inputAffixWrapperClass = "input-affix-wrapper";
424
+ var inputPrefixClass = "input-prefix";
425
+ var inputSuffixClass = "input-suffix";
426
+ var inputClearClass = "input-clear";
427
+ var inputSearchClass = "input-search";
428
+ var inputSearchButtonClass = "input-search-button";
429
+ var inputPasswordClass = "input-password";
430
+ var inputPasswordToggleClass = "input-password-toggle";
431
+ var inputGroupClass = "input-group";
432
+ var textAreaBaseClass = "textarea";
433
+ var textAreaWrapperClass = "textarea-wrapper";
434
+ var textAreaCountClass = "textarea-counter";
435
+ var textAreaCountExceededClass = "textarea-counter-exceeded";
436
+ var textAreaAutoSizeClass = "textarea-auto-resize";
437
+ var inputVariantClasses = {
438
+ filled: "input-filled",
439
+ outlined: "input-outlined"
440
+ };
441
+ var inputSizeClasses = {
442
+ sm: "input-sm",
443
+ md: "input-md",
444
+ lg: "input-lg"
445
+ };
446
+ var inputStatusClasses = {
447
+ error: "input-error",
448
+ success: "input-success"
449
+ };
450
+ var textAreaVariantClasses = {
451
+ filled: "textarea-filled",
452
+ outlined: "textarea-outlined"
453
+ };
454
+ var textAreaSizeClasses = {
455
+ sm: "textarea-sm",
456
+ md: "",
457
+ lg: "textarea-lg"
458
+ };
459
+ var textAreaStatusClasses = {
460
+ error: "textarea-error",
461
+ success: "textarea-success"
462
+ };
463
+ var textAreaResizeClasses = {
464
+ none: "textarea-resize-none",
465
+ both: "textarea-resize-both",
466
+ horizontal: "textarea-resize-horizontal",
467
+ vertical: "textarea-resize-vertical"
468
+ };
469
+ function getInputClasses({
470
+ size = "md",
471
+ status,
472
+ variant = "outlined",
473
+ className
474
+ }) {
475
+ return cn(inputBaseClass, inputVariantClasses[variant], inputSizeClasses[size], status && inputStatusClasses[status], className);
476
+ }
477
+ function getInputWrapperClasses({
478
+ affixed,
479
+ className
480
+ }) {
481
+ return cn(inputWrapperClass, affixed && inputAffixWrapperClass, className);
482
+ }
483
+ function getSearchWrapperClasses({ className }) {
484
+ return cn(inputSearchClass, className);
485
+ }
486
+ function getPasswordWrapperClasses({
487
+ className
488
+ }) {
489
+ return cn(inputPasswordClass, className);
490
+ }
491
+ function getTextAreaClasses({
492
+ size = "md",
493
+ status,
494
+ variant = "outlined",
495
+ resize = "vertical",
496
+ autoSize,
497
+ className
498
+ }) {
499
+ return cn(textAreaBaseClass, textAreaVariantClasses[variant], textAreaSizeClasses[size], status && textAreaStatusClasses[status], textAreaResizeClasses[resize], autoSize && textAreaAutoSizeClass, className);
500
+ }
501
+ function getTextAreaCountClasses({ exceeded }) {
502
+ return cn(textAreaCountClass, exceeded && textAreaCountExceededClass);
503
+ }
504
+
505
+ // src/components/input/Input.tsx
506
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
507
+ function toTextValue(value) {
508
+ if (Array.isArray(value)) {
509
+ return value.join(",");
510
+ }
511
+ return value == null ? "" : String(value);
512
+ }
513
+ var InputRoot = forwardRef2(({
514
+ allowClear,
515
+ className,
516
+ defaultValue,
517
+ disabled,
518
+ onChange,
519
+ prefix,
520
+ size = "md",
521
+ status,
522
+ suffix,
523
+ type = "text",
524
+ value,
525
+ variant = "outlined",
526
+ ...props
527
+ }, ref) => {
528
+ const inputRef = useRef(null);
529
+ const [internalValue, setInternalValue] = useState2(() => toTextValue(defaultValue));
530
+ const isControlled = value !== undefined;
531
+ const currentValue = isControlled ? toTextValue(value) : internalValue;
532
+ const hasAffix = prefix != null || suffix != null || allowClear;
533
+ useImperativeHandle(ref, () => inputRef.current);
534
+ function handleChange(event) {
535
+ if (!isControlled) {
536
+ setInternalValue(event.currentTarget.value);
537
+ }
538
+ onChange?.(event);
539
+ }
540
+ function handleClear() {
541
+ const input = inputRef.current;
542
+ if (!input || disabled) {
543
+ return;
544
+ }
545
+ input.value = "";
546
+ if (!isControlled) {
547
+ setInternalValue("");
548
+ }
549
+ onChange?.({
550
+ currentTarget: input,
551
+ target: input,
552
+ type: "change"
553
+ });
554
+ input.focus();
555
+ }
556
+ const control = /* @__PURE__ */ jsx3("input", {
557
+ ...props,
558
+ ref: inputRef,
559
+ type,
560
+ className: getInputClasses({ size, status, variant, className }),
561
+ disabled,
562
+ value: currentValue,
563
+ onChange: handleChange
564
+ });
565
+ if (!hasAffix) {
566
+ return control;
567
+ }
568
+ const showClear = allowClear && !disabled && currentValue.length > 0;
569
+ return /* @__PURE__ */ jsxs3("span", {
570
+ className: getInputWrapperClasses({ affixed: hasAffix }),
571
+ children: [
572
+ prefix != null ? /* @__PURE__ */ jsx3("span", {
573
+ className: inputPrefixClass,
574
+ children: prefix
575
+ }) : null,
576
+ control,
577
+ showClear ? /* @__PURE__ */ jsx3("button", {
578
+ type: "button",
579
+ className: inputClearClass,
580
+ "aria-label": "Clear input",
581
+ onClick: handleClear,
582
+ children: "x"
583
+ }) : null,
584
+ suffix != null ? /* @__PURE__ */ jsx3("span", {
585
+ className: inputSuffixClass,
586
+ children: suffix
587
+ }) : null
588
+ ]
589
+ });
590
+ });
591
+ InputRoot.displayName = "Input";
592
+ var Search = forwardRef2(({
593
+ className,
594
+ disabled,
595
+ enterButton,
596
+ loading,
597
+ onKeyDown,
598
+ onSearch,
599
+ ...props
600
+ }, ref) => {
601
+ const inputRef = useRef(null);
602
+ useImperativeHandle(ref, () => inputRef.current);
603
+ function emitSearch(event) {
604
+ onSearch?.(inputRef.current?.value ?? "", event);
605
+ }
606
+ function handleKeyDown(event) {
607
+ onKeyDown?.(event);
608
+ if (!event.defaultPrevented && event.key === "Enter") {
609
+ emitSearch(event);
610
+ }
611
+ }
612
+ const buttonContent = enterButton === true ? "Search" : enterButton ?? "Search";
613
+ return /* @__PURE__ */ jsxs3("span", {
614
+ className: getSearchWrapperClasses({ className }),
615
+ children: [
616
+ /* @__PURE__ */ jsx3(InputRoot, {
617
+ ...props,
618
+ ref: inputRef,
619
+ disabled,
620
+ onKeyDown: handleKeyDown
621
+ }),
622
+ enterButton || loading ? /* @__PURE__ */ jsx3("button", {
623
+ type: "button",
624
+ className: inputSearchButtonClass,
625
+ disabled: disabled || loading,
626
+ "aria-busy": loading || undefined,
627
+ onClick: emitSearch,
628
+ children: loading ? "Loading" : buttonContent
629
+ }) : null
630
+ ]
631
+ });
632
+ });
633
+ Search.displayName = "Input.Search";
634
+ var Password = forwardRef2(({ className, disabled, visibilityToggle = true, ...props }, ref) => {
635
+ const [visible, setVisible] = useState2(false);
636
+ const type = visible ? "text" : "password";
637
+ const toggle = visibilityToggle ? /* @__PURE__ */ jsx3("button", {
638
+ type: "button",
639
+ className: inputPasswordToggleClass,
640
+ disabled,
641
+ "aria-label": visible ? "Hide password" : "Show password",
642
+ onClick: () => {
643
+ setVisible((current) => !current);
644
+ },
645
+ children: visible ? "Hide" : "Show"
646
+ }) : undefined;
647
+ return /* @__PURE__ */ jsx3("span", {
648
+ className: getPasswordWrapperClasses({ className }),
649
+ children: /* @__PURE__ */ jsx3(InputRoot, {
650
+ ...props,
651
+ ref,
652
+ disabled,
653
+ type,
654
+ suffix: toggle
655
+ })
656
+ });
657
+ });
658
+ Password.displayName = "Input.Password";
659
+ var TextArea = forwardRef2(({
660
+ autoSize,
661
+ className,
662
+ defaultValue,
663
+ maxLength,
664
+ onChange,
665
+ resize = "vertical",
666
+ showCount,
667
+ size = "md",
668
+ status,
669
+ value,
670
+ variant = "outlined",
671
+ ...props
672
+ }, ref) => {
673
+ const [internalValue, setInternalValue] = useState2(() => toTextValue(defaultValue));
674
+ const isControlled = value !== undefined;
675
+ const currentValue = isControlled ? toTextValue(value) : internalValue;
676
+ const count = currentValue.length;
677
+ const exceeded = maxLength !== undefined && count > maxLength;
678
+ function handleChange(event) {
679
+ if (!isControlled) {
680
+ setInternalValue(event.currentTarget.value);
681
+ }
682
+ onChange?.(event);
683
+ }
684
+ const control = /* @__PURE__ */ jsx3("textarea", {
685
+ ...props,
686
+ ref,
687
+ className: getTextAreaClasses({
688
+ size,
689
+ status,
690
+ variant,
691
+ resize,
692
+ autoSize: Boolean(autoSize),
693
+ className
694
+ }),
695
+ maxLength,
696
+ value: currentValue,
697
+ onChange: handleChange
698
+ });
699
+ if (!showCount) {
700
+ return control;
701
+ }
702
+ return /* @__PURE__ */ jsxs3("span", {
703
+ className: textAreaWrapperClass,
704
+ children: [
705
+ control,
706
+ /* @__PURE__ */ jsxs3("span", {
707
+ className: getTextAreaCountClasses({ exceeded }),
708
+ children: [
709
+ count,
710
+ maxLength !== undefined ? ` / ${maxLength}` : null
711
+ ]
712
+ })
713
+ ]
714
+ });
715
+ });
716
+ TextArea.displayName = "Input.TextArea";
717
+ var Group = forwardRef2(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx3("div", {
718
+ ...props,
719
+ ref,
720
+ className: cn(inputGroupClass, className),
721
+ children
722
+ }));
723
+ Group.displayName = "Input.Group";
724
+ var Input = Object.assign(InputRoot, {
725
+ Search,
726
+ Password,
727
+ TextArea,
728
+ Group
729
+ });
730
+ // src/components/select/Select.tsx
731
+ import React3, { forwardRef as forwardRef3, useMemo as useMemo2, useState as useState3 } from "react";
732
+
733
+ // src/classes/select.ts
734
+ var selectContainerClass = "select-container";
735
+ var selectBaseClass = "select";
736
+ var selectIconClass = "select-icon";
737
+ var selectOpenClass = "select-open";
738
+ var selectLoadingClass = "select-loading";
739
+ var selectFullClass = "select-full";
740
+ var selectOptionClass = "select-option";
741
+ var selectOptionSelectedClass = "select-option-selected";
742
+ var selectOptionDisabledClass = "select-option-disabled";
743
+ var selectDropdownClass = "select-dropdown";
744
+ var selectSearchClass = "select-search";
745
+ var selectSelectionClass = "select-selection";
746
+ var selectTagClass = "select-tag";
747
+ var selectClearClass = "select-clear";
748
+ var selectPlaceholderClass = "select-placeholder";
749
+ var selectEmptyClass = "select-empty";
750
+ var selectGroupClass = "select-group";
751
+ var selectGroupLabelClass = "select-group-label";
752
+ var selectSizeClasses = {
753
+ sm: "select-sm",
754
+ md: "",
755
+ lg: "select-lg"
756
+ };
757
+ var selectStatusClasses = {
758
+ error: "select-error",
759
+ success: "select-success"
760
+ };
761
+ function getSelectContainerClasses({
762
+ open,
763
+ loading,
764
+ disabled,
765
+ full,
766
+ className
767
+ }) {
768
+ return cn(selectContainerClass, open && selectOpenClass, loading && selectLoadingClass, disabled && "select-disabled", full && selectFullClass, className);
769
+ }
770
+ function getSelectClasses({
771
+ size = "md",
772
+ status,
773
+ disabled,
774
+ className
775
+ }) {
776
+ return cn(selectBaseClass, selectSizeClasses[size], status && selectStatusClasses[status], disabled && "select-disabled", className);
777
+ }
778
+ function getSelectOptionClasses({
779
+ selected,
780
+ disabled,
781
+ className
782
+ }) {
783
+ return cn(selectOptionClass, selected && selectOptionSelectedClass, disabled && selectOptionDisabledClass, className);
784
+ }
785
+
786
+ // src/components/select/Select.tsx
787
+ import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
788
+ function isGroup(option) {
789
+ return "options" in option;
790
+ }
791
+ function optionLabel(option) {
792
+ return option.label ?? option.value;
793
+ }
794
+ function valueKey(value) {
795
+ return String(value);
796
+ }
797
+ function normalizeSingleValue(value) {
798
+ if (Array.isArray(value)) {
799
+ return value[0];
800
+ }
801
+ return typeof value === "string" || typeof value === "number" ? value : undefined;
802
+ }
803
+ function normalizeMultiValue(value) {
804
+ if (Array.isArray(value)) {
805
+ return value.filter((item) => typeof item === "string" || typeof item === "number");
806
+ }
807
+ const single = normalizeSingleValue(value);
808
+ return single === undefined ? [] : [single];
809
+ }
810
+ function optionsFromChildren(children) {
811
+ const result = [];
812
+ React3.Children.forEach(children, (child) => {
813
+ if (!React3.isValidElement(child)) {
814
+ return;
815
+ }
816
+ if (child.type === Option) {
817
+ const props = child.props;
818
+ result.push({
819
+ value: props.value,
820
+ label: props.children,
821
+ disabled: props.disabled,
822
+ className: props.className
823
+ });
824
+ return;
825
+ }
826
+ if (child.type === OptGroup) {
827
+ const props = child.props;
828
+ result.push({
829
+ label: props.label,
830
+ className: props.className,
831
+ options: optionsFromChildren(props.children).filter((option) => !isGroup(option))
832
+ });
833
+ }
834
+ });
835
+ return result;
836
+ }
837
+ function flattenOptions(options) {
838
+ return options.flatMap((option) => isGroup(option) ? option.options : option);
839
+ }
840
+ function matchesOption(option, searchValue, filterOption) {
841
+ if (!searchValue || filterOption === false) {
842
+ return true;
843
+ }
844
+ if (typeof filterOption === "function") {
845
+ return filterOption(searchValue, option);
846
+ }
847
+ const label = optionLabel(option);
848
+ const text = typeof label === "string" || typeof label === "number" ? String(label) : String(option.value);
849
+ return text.toLowerCase().includes(searchValue.toLowerCase());
850
+ }
851
+ function filterOptions(options, searchValue, filterOption) {
852
+ return options.map((option) => {
853
+ if (!isGroup(option)) {
854
+ return matchesOption(option, searchValue, filterOption) ? option : null;
855
+ }
856
+ const groupOptions = option.options.filter((child) => matchesOption(child, searchValue, filterOption));
857
+ return groupOptions.length > 0 ? { ...option, options: groupOptions } : null;
858
+ }).filter((option) => option !== null);
859
+ }
860
+ function renderValue(option) {
861
+ return option ? optionLabel(option) : null;
862
+ }
863
+ var Option = forwardRef3(({ children, ...props }, ref) => /* @__PURE__ */ jsx4("div", {
864
+ ...props,
865
+ ref,
866
+ children
867
+ }));
868
+ Option.displayName = "Select.Option";
869
+ var OptGroup = forwardRef3(({ children, ...props }, ref) => /* @__PURE__ */ jsx4("div", {
870
+ ...props,
871
+ ref,
872
+ children
873
+ }));
874
+ OptGroup.displayName = "Select.OptGroup";
875
+ var SelectRoot = forwardRef3(({
876
+ allowClear,
877
+ children,
878
+ className,
879
+ defaultValue,
880
+ disabled,
881
+ filterOption,
882
+ loading,
883
+ mode,
884
+ onChange,
885
+ options,
886
+ placeholder,
887
+ showSearch,
888
+ size = "md",
889
+ status,
890
+ value,
891
+ ...props
892
+ }, ref) => {
893
+ const multiple = mode === "multiple" || mode === "tags";
894
+ const sourceOptions = useMemo2(() => options ?? optionsFromChildren(children), [children, options]);
895
+ const flatOptions = useMemo2(() => flattenOptions(sourceOptions), [sourceOptions]);
896
+ const [open, setOpen] = useState3(false);
897
+ const [searchValue, setSearchValue] = useState3("");
898
+ const [internalValue, setInternalValue] = useState3(multiple ? normalizeMultiValue(defaultValue) : normalizeSingleValue(defaultValue));
899
+ const controlled = value !== undefined;
900
+ const currentValue = controlled ? value : internalValue;
901
+ const selectedValues = multiple ? normalizeMultiValue(currentValue) : normalizeSingleValue(currentValue) === undefined ? [] : [normalizeSingleValue(currentValue)];
902
+ const selectedKeys = new Set(selectedValues.map(valueKey));
903
+ const selectedOptions = selectedValues.map((selectedValue) => flatOptions.find((option) => option.value === selectedValue) ?? {
904
+ value: selectedValue,
905
+ label: selectedValue
906
+ });
907
+ const visibleOptions = filterOptions(sourceOptions, searchValue, filterOption);
908
+ const hasValue = selectedValues.length > 0;
909
+ const searchable = showSearch || mode === "tags";
910
+ function emitChange(nextValue) {
911
+ if (!controlled) {
912
+ setInternalValue(nextValue);
913
+ }
914
+ const nextValues = Array.isArray(nextValue) ? nextValue : nextValue === undefined ? [] : [nextValue];
915
+ const nextOptions = nextValues.map((next) => flatOptions.find((option) => option.value === next) ?? {
916
+ value: next,
917
+ label: next
918
+ });
919
+ onChange?.(nextValue, multiple ? nextOptions : nextOptions[0]);
920
+ }
921
+ function selectOption(option) {
922
+ if (disabled || loading || option.disabled) {
923
+ return;
924
+ }
925
+ if (multiple) {
926
+ const optionKey = valueKey(option.value);
927
+ const nextValues = selectedKeys.has(optionKey) ? selectedValues.filter((item) => valueKey(item) !== optionKey) : [...selectedValues, option.value];
928
+ emitChange(nextValues);
929
+ } else {
930
+ emitChange(option.value);
931
+ setOpen(false);
932
+ }
933
+ setSearchValue("");
934
+ }
935
+ function clearValue(event) {
936
+ event.stopPropagation();
937
+ if (disabled || loading) {
938
+ return;
939
+ }
940
+ emitChange(multiple ? [] : undefined);
941
+ setSearchValue("");
942
+ }
943
+ function addTag() {
944
+ const tag = searchValue.trim();
945
+ if (mode !== "tags" || tag.length === 0) {
946
+ return;
947
+ }
948
+ if (!selectedKeys.has(tag)) {
949
+ emitChange([...selectedValues, tag]);
950
+ }
951
+ setSearchValue("");
952
+ }
953
+ function renderOption(option) {
954
+ const selected = selectedKeys.has(valueKey(option.value));
955
+ return /* @__PURE__ */ jsx4("button", {
956
+ type: "button",
957
+ role: "option",
958
+ "aria-selected": selected,
959
+ disabled: disabled || option.disabled,
960
+ className: getSelectOptionClasses({
961
+ selected,
962
+ disabled: disabled || option.disabled,
963
+ className: option.className
964
+ }),
965
+ onClick: () => selectOption(option),
966
+ children: optionLabel(option)
967
+ }, valueKey(option.value));
968
+ }
969
+ function renderOptions(optionItems) {
970
+ return optionItems.map((option, index) => {
971
+ if (!isGroup(option)) {
972
+ return renderOption(option);
973
+ }
974
+ return /* @__PURE__ */ jsxs4("div", {
975
+ className: cn(selectGroupClass, option.className),
976
+ role: "group",
977
+ children: [
978
+ /* @__PURE__ */ jsx4("div", {
979
+ className: selectGroupLabelClass,
980
+ children: option.label
981
+ }),
982
+ option.options.map(renderOption)
983
+ ]
984
+ }, `group-${index}`);
985
+ });
986
+ }
987
+ const selection = multiple ? selectedOptions.map((option) => /* @__PURE__ */ jsx4("span", {
988
+ className: selectTagClass,
989
+ children: renderValue(option)
990
+ }, valueKey(option.value))) : renderValue(selectedOptions[0]);
991
+ return /* @__PURE__ */ jsxs4("div", {
992
+ ...props,
993
+ ref,
994
+ className: getSelectContainerClasses({
995
+ open,
996
+ loading,
997
+ disabled,
998
+ full: true,
999
+ className
1000
+ }),
1001
+ children: [
1002
+ /* @__PURE__ */ jsxs4("button", {
1003
+ type: "button",
1004
+ className: getSelectClasses({ size, status, disabled }),
1005
+ disabled: disabled || loading,
1006
+ "aria-haspopup": "listbox",
1007
+ "aria-expanded": open,
1008
+ onClick: () => setOpen((current) => !current),
1009
+ children: [
1010
+ /* @__PURE__ */ jsx4("span", {
1011
+ className: selectSelectionClass,
1012
+ children: hasValue ? selection : /* @__PURE__ */ jsx4("span", {
1013
+ className: selectPlaceholderClass,
1014
+ children: placeholder
1015
+ })
1016
+ }),
1017
+ /* @__PURE__ */ jsx4("span", {
1018
+ className: selectIconClass,
1019
+ "aria-hidden": "true",
1020
+ children: "v"
1021
+ })
1022
+ ]
1023
+ }),
1024
+ allowClear && hasValue && !disabled && !loading ? /* @__PURE__ */ jsx4("button", {
1025
+ type: "button",
1026
+ className: selectClearClass,
1027
+ "aria-label": "Clear selection",
1028
+ onClick: clearValue,
1029
+ children: "x"
1030
+ }) : null,
1031
+ open ? /* @__PURE__ */ jsxs4("div", {
1032
+ className: selectDropdownClass,
1033
+ role: "listbox",
1034
+ "aria-multiselectable": multiple || undefined,
1035
+ children: [
1036
+ searchable ? /* @__PURE__ */ jsx4("input", {
1037
+ className: selectSearchClass,
1038
+ value: searchValue,
1039
+ placeholder: typeof placeholder === "string" ? placeholder : undefined,
1040
+ onChange: (event) => setSearchValue(event.currentTarget.value),
1041
+ onKeyDown: (event) => {
1042
+ if (event.key === "Enter") {
1043
+ event.preventDefault();
1044
+ addTag();
1045
+ }
1046
+ }
1047
+ }) : null,
1048
+ visibleOptions.length > 0 ? renderOptions(visibleOptions) : /* @__PURE__ */ jsx4("div", {
1049
+ className: selectEmptyClass,
1050
+ children: "No data"
1051
+ })
1052
+ ]
1053
+ }) : null
1054
+ ]
1055
+ });
1056
+ });
1057
+ SelectRoot.displayName = "Select";
1058
+ var Select = SelectRoot;
1059
+ Select.Option = Option;
1060
+ Select.OptGroup = OptGroup;
1061
+ // src/components/dm-search/DmSearch.tsx
1062
+ import {
1063
+ forwardRef as forwardRef4,
1064
+ useEffect,
1065
+ useImperativeHandle as useImperativeHandle2,
1066
+ useMemo as useMemo3,
1067
+ useState as useState4
1068
+ } from "react";
1069
+
1070
+ // src/classes/dm-search.ts
1071
+ var dmSearchBaseClass = "dm-search";
1072
+ var dmSearchCompactClass = "dm-search-compact";
1073
+ var dmSearchCollapsedClass = "dm-search-collapsed";
1074
+ var dmSearchFieldsClass = "dm-search-fields";
1075
+ var dmSearchFieldClass = "dm-search-field";
1076
+ var dmSearchActionsClass = "dm-search-actions";
1077
+ var dmSearchFastFilterClass = "dm-search-fast-filter";
1078
+ function getDmSearchClasses({
1079
+ compact,
1080
+ collapsed,
1081
+ className
1082
+ }) {
1083
+ return cn(dmSearchBaseClass, compact && dmSearchCompactClass, collapsed && dmSearchCollapsedClass, className);
1084
+ }
1085
+
1086
+ // src/components/dm-search/DmSearch.tsx
1087
+ import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
1088
+ function initialValues(items, searchParams, useSearchParams = true) {
1089
+ return items.reduce((acc, item) => {
1090
+ const defaultValue = item.search.extraProps?.value ?? item.search.formProps?.initialValue;
1091
+ acc[item.dataIndex] = useSearchParams && searchParams && item.dataIndex in searchParams ? searchParams[item.dataIndex] : defaultValue;
1092
+ return acc;
1093
+ }, {});
1094
+ }
1095
+ function optionList(extraProps) {
1096
+ return Array.isArray(extraProps?.options) ? extraProps.options : [];
1097
+ }
1098
+ function renderField({
1099
+ item,
1100
+ value,
1101
+ setValue,
1102
+ loading,
1103
+ enableDefaultPlaceHolder
1104
+ }) {
1105
+ const extraProps = item.search.extraProps ?? {};
1106
+ const placeholder = extraProps.placeholder ?? (enableDefaultPlaceHolder ? item.search.type === "select" ? "Please select" : "Please enter" : undefined);
1107
+ if (item.search.type === "custom") {
1108
+ return item.search.render?.(value, setValue, item) ?? null;
1109
+ }
1110
+ if (item.search.type === "select") {
1111
+ return /* @__PURE__ */ jsx5(Select, {
1112
+ ...extraProps,
1113
+ disabled: Boolean(loading || extraProps.disabled),
1114
+ value,
1115
+ placeholder,
1116
+ onChange: (nextValue) => setValue(nextValue)
1117
+ });
1118
+ }
1119
+ if (item.search.type === "dateRange") {
1120
+ return /* @__PURE__ */ jsx5(DatePicker.RangePicker, {
1121
+ ...extraProps,
1122
+ value,
1123
+ onChange: (nextValue) => setValue(nextValue)
1124
+ });
1125
+ }
1126
+ if (item.search.type === "date") {
1127
+ return /* @__PURE__ */ jsx5(DatePicker, {
1128
+ ...extraProps,
1129
+ value,
1130
+ onChange: (nextValue) => setValue(nextValue)
1131
+ });
1132
+ }
1133
+ if (item.search.type === "radio" || item.search.type === "checkbox") {
1134
+ return /* @__PURE__ */ jsx5("div", {
1135
+ role: item.search.type === "radio" ? "radiogroup" : "group",
1136
+ children: optionList(extraProps).map((option) => /* @__PURE__ */ jsxs5("label", {
1137
+ children: [
1138
+ /* @__PURE__ */ jsx5("input", {
1139
+ type: item.search.type,
1140
+ disabled: loading,
1141
+ checked: item.search.type === "checkbox" ? Array.isArray(value) && value.includes(option.value) : value === option.value,
1142
+ onChange: (event) => {
1143
+ if (item.search.type === "radio") {
1144
+ setValue(option.value);
1145
+ return;
1146
+ }
1147
+ const current = Array.isArray(value) ? value : [];
1148
+ setValue(event.currentTarget.checked ? [...current, option.value] : current.filter((entry) => entry !== option.value));
1149
+ }
1150
+ }),
1151
+ option.label ?? option.value
1152
+ ]
1153
+ }, String(option.value)))
1154
+ });
1155
+ }
1156
+ return /* @__PURE__ */ jsx5(Input, {
1157
+ ...extraProps,
1158
+ type: item.search.type === "input-number" ? "number" : "text",
1159
+ disabled: Boolean(loading || extraProps.disabled),
1160
+ placeholder,
1161
+ value: value == null ? "" : String(value),
1162
+ onChange: (event) => setValue(event.currentTarget.value),
1163
+ onKeyDown: (event) => {
1164
+ if (event.key === "Enter") {
1165
+ event.currentTarget.form?.requestSubmit();
1166
+ }
1167
+ }
1168
+ });
1169
+ }
1170
+ var DmSearch = forwardRef4(({
1171
+ items = [],
1172
+ onSearch,
1173
+ extra,
1174
+ fastFilterItem,
1175
+ defaultCollapsed = true,
1176
+ hideCollapseBtn = false,
1177
+ compact = false,
1178
+ searchParams,
1179
+ loading = false,
1180
+ enableDefaultPlaceHolder = false,
1181
+ className
1182
+ }, ref) => {
1183
+ const allItems = useMemo3(() => fastFilterItem ? [fastFilterItem, ...items] : items, [fastFilterItem, items]);
1184
+ const [collapsed, setCollapsed] = useState4(defaultCollapsed);
1185
+ const [values, setValues] = useState4(() => initialValues(allItems, searchParams));
1186
+ const visibleItems = collapsed ? allItems.slice(0, 1) : allItems;
1187
+ useEffect(() => {
1188
+ setValues(initialValues(allItems, searchParams));
1189
+ }, [allItems, searchParams]);
1190
+ function reset(useSearchParams = false) {
1191
+ const nextValues = initialValues(allItems, searchParams, useSearchParams);
1192
+ setValues(nextValues);
1193
+ return nextValues;
1194
+ }
1195
+ useImperativeHandle2(ref, () => ({
1196
+ onReset: () => {
1197
+ reset(false);
1198
+ }
1199
+ }));
1200
+ return /* @__PURE__ */ jsxs5("form", {
1201
+ id: "searchForm",
1202
+ className: getDmSearchClasses({ compact, collapsed, className }),
1203
+ onSubmit: (event) => {
1204
+ event.preventDefault();
1205
+ onSearch?.(values);
1206
+ },
1207
+ children: [
1208
+ fastFilterItem ? /* @__PURE__ */ jsx5("div", {
1209
+ className: dmSearchFastFilterClass,
1210
+ children: fastFilterItem.title
1211
+ }) : null,
1212
+ /* @__PURE__ */ jsx5("div", {
1213
+ className: dmSearchFieldsClass,
1214
+ children: visibleItems.map((item) => /* @__PURE__ */ jsxs5("label", {
1215
+ className: dmSearchFieldClass,
1216
+ children: [
1217
+ compact ? null : /* @__PURE__ */ jsx5("span", {
1218
+ children: item.title
1219
+ }),
1220
+ renderField({
1221
+ item,
1222
+ value: values[item.dataIndex],
1223
+ loading,
1224
+ enableDefaultPlaceHolder,
1225
+ setValue: (value) => setValues((current) => ({ ...current, [item.dataIndex]: value }))
1226
+ })
1227
+ ]
1228
+ }, item.key))
1229
+ }),
1230
+ /* @__PURE__ */ jsxs5("div", {
1231
+ className: dmSearchActionsClass,
1232
+ children: [
1233
+ /* @__PURE__ */ jsx5(Button, {
1234
+ type: "submit",
1235
+ isLoading: loading,
1236
+ children: "Search"
1237
+ }),
1238
+ /* @__PURE__ */ jsx5(Button, {
1239
+ type: "button",
1240
+ color: "secondary",
1241
+ appearance: "outline",
1242
+ onClick: () => onSearch?.(reset(false)),
1243
+ children: "Reset"
1244
+ }),
1245
+ !hideCollapseBtn && allItems.length > 1 ? /* @__PURE__ */ jsx5(Button, {
1246
+ type: "button",
1247
+ color: "secondary",
1248
+ appearance: "text",
1249
+ onClick: () => {
1250
+ setCollapsed((current) => !current);
1251
+ setValues(initialValues(allItems, searchParams));
1252
+ },
1253
+ children: collapsed ? "Expand" : "Collapse"
1254
+ }) : null,
1255
+ extra
1256
+ ]
1257
+ })
1258
+ ]
1259
+ });
1260
+ });
1261
+ DmSearch.displayName = "DmSearch";
1262
+ // src/components/dm-query/DmQuery.tsx
1263
+ import { forwardRef as forwardRef5, useImperativeHandle as useImperativeHandle3, useRef as useRef2, useState as useState5 } from "react";
1264
+ import { jsx as jsx6, jsxs as jsxs6, Fragment } from "react/jsx-runtime";
1265
+ function toSearchItem(item) {
1266
+ return {
1267
+ key: item.key,
1268
+ title: item.label,
1269
+ dataIndex: item.name,
1270
+ search: {
1271
+ type: item.type,
1272
+ extraProps: item.extraProps,
1273
+ formProps: item.customProps
1274
+ }
1275
+ };
1276
+ }
1277
+ var DmQuery = forwardRef5(({
1278
+ queryItem,
1279
+ fastFilterItem,
1280
+ collapsed = false,
1281
+ onReset,
1282
+ onSearch,
1283
+ ...props
1284
+ }, ref) => {
1285
+ const searchRef = useRef2(null);
1286
+ const [selectedItem, setSelectedItem] = useState5(queryItem[0]);
1287
+ const items = selectedItem ? [toSearchItem(selectedItem)] : queryItem.map(toSearchItem);
1288
+ useImperativeHandle3(ref, () => ({
1289
+ onReset: () => searchRef.current?.onReset(),
1290
+ retractChange: (value, data = queryItem) => {
1291
+ setSelectedItem(data.find((item) => item.name === value || item.key === value));
1292
+ }
1293
+ }));
1294
+ return /* @__PURE__ */ jsx6(DmSearch, {
1295
+ ...props,
1296
+ ref: searchRef,
1297
+ defaultCollapsed: collapsed,
1298
+ items: collapsed ? queryItem.map(toSearchItem) : items,
1299
+ fastFilterItem: fastFilterItem ? toSearchItem(fastFilterItem) : undefined,
1300
+ onSearch,
1301
+ extra: /* @__PURE__ */ jsxs6(Fragment, {
1302
+ children: [
1303
+ props.extra,
1304
+ /* @__PURE__ */ jsx6("button", {
1305
+ type: "button",
1306
+ hidden: true,
1307
+ onClick: () => {
1308
+ searchRef.current?.onReset();
1309
+ onReset?.();
1310
+ }
1311
+ })
1312
+ ]
1313
+ })
1314
+ });
1315
+ });
1316
+ DmQuery.displayName = "DmQuery";
1317
+ export {
1318
+ DmQuery
1319
+ };