@j2-health/design-system 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (310) hide show
  1. package/dist/index.cjs +96 -3614
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +48 -3551
  4. package/dist/index.js.map +1 -1
  5. package/dist/src/AppConfigProvider.cjs +13 -0
  6. package/dist/src/AppConfigProvider.cjs.map +1 -0
  7. package/dist/src/AppConfigProvider.js +13 -0
  8. package/dist/src/AppConfigProvider.js.map +1 -0
  9. package/dist/src/appTheme.cjs +268 -0
  10. package/dist/src/appTheme.cjs.map +1 -0
  11. package/dist/src/appTheme.js +268 -0
  12. package/dist/src/appTheme.js.map +1 -0
  13. package/dist/src/components/alert/Alert.cjs +95 -0
  14. package/dist/src/components/alert/Alert.cjs.map +1 -0
  15. package/dist/src/components/alert/Alert.js +78 -0
  16. package/dist/src/components/alert/Alert.js.map +1 -0
  17. package/dist/src/components/alert/Alert.module.css.cjs +9 -0
  18. package/dist/src/components/alert/Alert.module.css.cjs.map +1 -0
  19. package/dist/src/components/alert/Alert.module.css.js +9 -0
  20. package/dist/src/components/alert/Alert.module.css.js.map +1 -0
  21. package/dist/src/components/barchart/BarChart.cjs +148 -0
  22. package/dist/src/components/barchart/BarChart.cjs.map +1 -0
  23. package/dist/src/components/barchart/BarChart.js +148 -0
  24. package/dist/src/components/barchart/BarChart.js.map +1 -0
  25. package/dist/src/components/barchart/chart.module.css.cjs +9 -0
  26. package/dist/src/components/barchart/chart.module.css.cjs.map +1 -0
  27. package/dist/src/components/barchart/chart.module.css.js +9 -0
  28. package/dist/src/components/barchart/chart.module.css.js.map +1 -0
  29. package/dist/src/components/breadcrumb/Breadcrumb.cjs +38 -0
  30. package/dist/src/components/breadcrumb/Breadcrumb.cjs.map +1 -0
  31. package/dist/src/components/breadcrumb/Breadcrumb.js +21 -0
  32. package/dist/src/components/breadcrumb/Breadcrumb.js.map +1 -0
  33. package/dist/src/components/bulkActionBar/BulkActionBar.cjs +81 -0
  34. package/dist/src/components/bulkActionBar/BulkActionBar.cjs.map +1 -0
  35. package/dist/src/components/bulkActionBar/BulkActionBar.js +81 -0
  36. package/dist/src/components/bulkActionBar/BulkActionBar.js.map +1 -0
  37. package/dist/src/components/button/Button.cjs +21 -0
  38. package/dist/src/components/button/Button.cjs.map +1 -0
  39. package/dist/src/components/button/Button.js +21 -0
  40. package/dist/src/components/button/Button.js.map +1 -0
  41. package/dist/src/components/card/Card.cjs +36 -0
  42. package/dist/src/components/card/Card.cjs.map +1 -0
  43. package/dist/src/components/card/Card.js +36 -0
  44. package/dist/src/components/card/Card.js.map +1 -0
  45. package/dist/src/components/checkbox/Checkbox.cjs +10 -0
  46. package/dist/src/components/checkbox/Checkbox.cjs.map +1 -0
  47. package/dist/src/components/checkbox/Checkbox.js +10 -0
  48. package/dist/src/components/checkbox/Checkbox.js.map +1 -0
  49. package/dist/src/components/checkboxTree/CheckboxTree.cjs +140 -0
  50. package/dist/src/components/checkboxTree/CheckboxTree.cjs.map +1 -0
  51. package/dist/src/components/checkboxTree/CheckboxTree.js +140 -0
  52. package/dist/src/components/checkboxTree/CheckboxTree.js.map +1 -0
  53. package/dist/src/components/checkboxTree/TreeNode.cjs +92 -0
  54. package/dist/src/components/checkboxTree/TreeNode.cjs.map +1 -0
  55. package/dist/src/components/checkboxTree/TreeNode.js +92 -0
  56. package/dist/src/components/checkboxTree/TreeNode.js.map +1 -0
  57. package/dist/src/components/checkboxTree/utils.cjs +59 -0
  58. package/dist/src/components/checkboxTree/utils.cjs.map +1 -0
  59. package/dist/src/components/checkboxTree/utils.js +59 -0
  60. package/dist/src/components/checkboxTree/utils.js.map +1 -0
  61. package/dist/src/components/collapse/Collapse.cjs +81 -0
  62. package/dist/src/components/collapse/Collapse.cjs.map +1 -0
  63. package/dist/src/components/collapse/Collapse.js +64 -0
  64. package/dist/src/components/collapse/Collapse.js.map +1 -0
  65. package/dist/src/components/collapse/Collapse.module.css.cjs +13 -0
  66. package/dist/src/components/collapse/Collapse.module.css.cjs.map +1 -0
  67. package/dist/src/components/collapse/Collapse.module.css.js +13 -0
  68. package/dist/src/components/collapse/Collapse.module.css.js.map +1 -0
  69. package/dist/src/components/drawer/Drawer.cjs +39 -0
  70. package/dist/src/components/drawer/Drawer.cjs.map +1 -0
  71. package/dist/src/components/drawer/Drawer.js +39 -0
  72. package/dist/src/components/drawer/Drawer.js.map +1 -0
  73. package/dist/src/components/dropdown/Dropdown.cjs +58 -0
  74. package/dist/src/components/dropdown/Dropdown.cjs.map +1 -0
  75. package/dist/src/components/dropdown/Dropdown.js +58 -0
  76. package/dist/src/components/dropdown/Dropdown.js.map +1 -0
  77. package/dist/src/components/filterform/FilterGroup.cjs +64 -0
  78. package/dist/src/components/filterform/FilterGroup.cjs.map +1 -0
  79. package/dist/src/components/filterform/FilterGroup.js +64 -0
  80. package/dist/src/components/filterform/FilterGroup.js.map +1 -0
  81. package/dist/src/components/filterform/FilterInput.cjs +175 -0
  82. package/dist/src/components/filterform/FilterInput.cjs.map +1 -0
  83. package/dist/src/components/filterform/FilterInput.js +158 -0
  84. package/dist/src/components/filterform/FilterInput.js.map +1 -0
  85. package/dist/src/components/filterform/FiltersForm.cjs +168 -0
  86. package/dist/src/components/filterform/FiltersForm.cjs.map +1 -0
  87. package/dist/src/components/filterform/FiltersForm.js +168 -0
  88. package/dist/src/components/filterform/FiltersForm.js.map +1 -0
  89. package/dist/src/components/filterform/FiltersForm.module.css.cjs +21 -0
  90. package/dist/src/components/filterform/FiltersForm.module.css.cjs.map +1 -0
  91. package/dist/src/components/filterform/FiltersForm.module.css.js +21 -0
  92. package/dist/src/components/filterform/FiltersForm.module.css.js.map +1 -0
  93. package/dist/src/components/filterform/filterHelpers.cjs +48 -0
  94. package/dist/src/components/filterform/filterHelpers.cjs.map +1 -0
  95. package/dist/src/components/filterform/filterHelpers.js +48 -0
  96. package/dist/src/components/filterform/filterHelpers.js.map +1 -0
  97. package/dist/src/components/filterform/useFilterField.cjs +210 -0
  98. package/dist/src/components/filterform/useFilterField.cjs.map +1 -0
  99. package/dist/src/components/filterform/useFilterField.js +193 -0
  100. package/dist/src/components/filterform/useFilterField.js.map +1 -0
  101. package/dist/src/components/filterform/useFiltersForm.cjs +160 -0
  102. package/dist/src/components/filterform/useFiltersForm.cjs.map +1 -0
  103. package/dist/src/components/filterform/useFiltersForm.js +160 -0
  104. package/dist/src/components/filterform/useFiltersForm.js.map +1 -0
  105. package/dist/src/components/form/Form.cjs +11 -0
  106. package/dist/src/components/form/Form.cjs.map +1 -0
  107. package/dist/src/components/form/Form.js +11 -0
  108. package/dist/src/components/form/Form.js.map +1 -0
  109. package/dist/src/components/icons/index.cjs +27 -0
  110. package/dist/src/components/icons/index.cjs.map +1 -0
  111. package/dist/src/components/icons/index.js +3 -0
  112. package/dist/src/components/icons/index.js.map +1 -0
  113. package/dist/src/components/input/AntdInput.cjs +13 -0
  114. package/dist/src/components/input/AntdInput.cjs.map +1 -0
  115. package/dist/src/components/input/AntdInput.js +13 -0
  116. package/dist/src/components/input/AntdInput.js.map +1 -0
  117. package/dist/src/components/input/AntdSearchInput.cjs +13 -0
  118. package/dist/src/components/input/AntdSearchInput.cjs.map +1 -0
  119. package/dist/src/components/input/AntdSearchInput.js +13 -0
  120. package/dist/src/components/input/AntdSearchInput.js.map +1 -0
  121. package/dist/src/components/input/Input.cjs +9 -0
  122. package/dist/src/components/input/Input.cjs.map +1 -0
  123. package/dist/src/components/input/Input.js +9 -0
  124. package/dist/src/components/input/Input.js.map +1 -0
  125. package/dist/src/components/inputnumber/InputNumber.cjs +32 -0
  126. package/dist/src/components/inputnumber/InputNumber.cjs.map +1 -0
  127. package/dist/src/components/inputnumber/InputNumber.js +32 -0
  128. package/dist/src/components/inputnumber/InputNumber.js.map +1 -0
  129. package/dist/src/components/inputnumber/InputNumber.module.css.cjs +9 -0
  130. package/dist/src/components/inputnumber/InputNumber.module.css.cjs.map +1 -0
  131. package/dist/src/components/inputnumber/InputNumber.module.css.js +9 -0
  132. package/dist/src/components/inputnumber/InputNumber.module.css.js.map +1 -0
  133. package/dist/src/components/legacyNavMenu/LegacyNavMenu.cjs +52 -0
  134. package/dist/src/components/legacyNavMenu/LegacyNavMenu.cjs.map +1 -0
  135. package/dist/src/components/legacyNavMenu/LegacyNavMenu.js +52 -0
  136. package/dist/src/components/legacyNavMenu/LegacyNavMenu.js.map +1 -0
  137. package/dist/src/components/legacyNavMenu/LegacyNavMenu.module.css.cjs +48 -0
  138. package/dist/src/components/legacyNavMenu/LegacyNavMenu.module.css.cjs.map +1 -0
  139. package/dist/src/components/legacyNavMenu/LegacyNavMenu.module.css.js +48 -0
  140. package/dist/src/components/legacyNavMenu/LegacyNavMenu.module.css.js.map +1 -0
  141. package/dist/src/components/legacyNavMenu/UserProfile.cjs +78 -0
  142. package/dist/src/components/legacyNavMenu/UserProfile.cjs.map +1 -0
  143. package/dist/src/components/legacyNavMenu/UserProfile.js +78 -0
  144. package/dist/src/components/legacyNavMenu/UserProfile.js.map +1 -0
  145. package/dist/src/components/legacyNavMenu/UserProfile.module.css.cjs +42 -0
  146. package/dist/src/components/legacyNavMenu/UserProfile.module.css.cjs.map +1 -0
  147. package/dist/src/components/legacyNavMenu/UserProfile.module.css.js +42 -0
  148. package/dist/src/components/legacyNavMenu/UserProfile.module.css.js.map +1 -0
  149. package/dist/src/components/listpopover/ListPopover.cjs +125 -0
  150. package/dist/src/components/listpopover/ListPopover.cjs.map +1 -0
  151. package/dist/src/components/listpopover/ListPopover.js +125 -0
  152. package/dist/src/components/listpopover/ListPopover.js.map +1 -0
  153. package/dist/src/components/listpopover/ListPopover.module.css.cjs +9 -0
  154. package/dist/src/components/listpopover/ListPopover.module.css.cjs.map +1 -0
  155. package/dist/src/components/listpopover/ListPopover.module.css.js +9 -0
  156. package/dist/src/components/listpopover/ListPopover.module.css.js.map +1 -0
  157. package/dist/src/components/menu/Menu.cjs +18 -0
  158. package/dist/src/components/menu/Menu.cjs.map +1 -0
  159. package/dist/src/components/menu/Menu.js +18 -0
  160. package/dist/src/components/menu/Menu.js.map +1 -0
  161. package/dist/src/components/menu/Menu.module.css.cjs +12 -0
  162. package/dist/src/components/menu/Menu.module.css.cjs.map +1 -0
  163. package/dist/src/components/menu/Menu.module.css.js +12 -0
  164. package/dist/src/components/menu/Menu.module.css.js.map +1 -0
  165. package/dist/src/components/message/Message.module.css.cjs +9 -0
  166. package/dist/src/components/message/Message.module.css.cjs.map +1 -0
  167. package/dist/src/components/message/Message.module.css.js +9 -0
  168. package/dist/src/components/message/Message.module.css.js.map +1 -0
  169. package/dist/src/components/message/useMessage.cjs +55 -0
  170. package/dist/src/components/message/useMessage.cjs.map +1 -0
  171. package/dist/src/components/message/useMessage.js +55 -0
  172. package/dist/src/components/message/useMessage.js.map +1 -0
  173. package/dist/src/components/modal/Modal.cjs +32 -0
  174. package/dist/src/components/modal/Modal.cjs.map +1 -0
  175. package/dist/src/components/modal/Modal.js +32 -0
  176. package/dist/src/components/modal/Modal.js.map +1 -0
  177. package/dist/src/components/navMenu/NavMenu.cjs +132 -0
  178. package/dist/src/components/navMenu/NavMenu.cjs.map +1 -0
  179. package/dist/src/components/navMenu/NavMenu.js +115 -0
  180. package/dist/src/components/navMenu/NavMenu.js.map +1 -0
  181. package/dist/src/components/navMenu/NavMenu.module.css.cjs +18 -0
  182. package/dist/src/components/navMenu/NavMenu.module.css.cjs.map +1 -0
  183. package/dist/src/components/navMenu/NavMenu.module.css.js +18 -0
  184. package/dist/src/components/navMenu/NavMenu.module.css.js.map +1 -0
  185. package/dist/src/components/notification/Notification.module.css.cjs +9 -0
  186. package/dist/src/components/notification/Notification.module.css.cjs.map +1 -0
  187. package/dist/src/components/notification/Notification.module.css.js +9 -0
  188. package/dist/src/components/notification/Notification.module.css.js.map +1 -0
  189. package/dist/src/components/notification/useNotification.cjs +52 -0
  190. package/dist/src/components/notification/useNotification.cjs.map +1 -0
  191. package/dist/src/components/notification/useNotification.js +52 -0
  192. package/dist/src/components/notification/useNotification.js.map +1 -0
  193. package/dist/src/components/notificationModal/NotifcationModal.module.css.cjs +21 -0
  194. package/dist/src/components/notificationModal/NotifcationModal.module.css.cjs.map +1 -0
  195. package/dist/src/components/notificationModal/NotifcationModal.module.css.js +21 -0
  196. package/dist/src/components/notificationModal/NotifcationModal.module.css.js.map +1 -0
  197. package/dist/src/components/notificationModal/NotificationModal.cjs +57 -0
  198. package/dist/src/components/notificationModal/NotificationModal.cjs.map +1 -0
  199. package/dist/src/components/notificationModal/NotificationModal.js +57 -0
  200. package/dist/src/components/notificationModal/NotificationModal.js.map +1 -0
  201. package/dist/src/components/pagination/Pagination.cjs +65 -0
  202. package/dist/src/components/pagination/Pagination.cjs.map +1 -0
  203. package/dist/src/components/pagination/Pagination.js +65 -0
  204. package/dist/src/components/pagination/Pagination.js.map +1 -0
  205. package/dist/src/components/pagination/Pagination.module.css.cjs +6 -0
  206. package/dist/src/components/pagination/Pagination.module.css.cjs.map +1 -0
  207. package/dist/src/components/pagination/Pagination.module.css.js +7 -0
  208. package/dist/src/components/pagination/Pagination.module.css.js.map +1 -0
  209. package/dist/src/components/popover/Popover.cjs +41 -0
  210. package/dist/src/components/popover/Popover.cjs.map +1 -0
  211. package/dist/src/components/popover/Popover.js +41 -0
  212. package/dist/src/components/popover/Popover.js.map +1 -0
  213. package/dist/src/components/popover/Popover.module.css.cjs +33 -0
  214. package/dist/src/components/popover/Popover.module.css.cjs.map +1 -0
  215. package/dist/src/components/popover/Popover.module.css.js +33 -0
  216. package/dist/src/components/popover/Popover.module.css.js.map +1 -0
  217. package/dist/src/components/progress/Progress.cjs +9 -0
  218. package/dist/src/components/progress/Progress.cjs.map +1 -0
  219. package/dist/src/components/progress/Progress.js +9 -0
  220. package/dist/src/components/progress/Progress.js.map +1 -0
  221. package/dist/src/components/radio/Radio.cjs +24 -0
  222. package/dist/src/components/radio/Radio.cjs.map +1 -0
  223. package/dist/src/components/radio/Radio.js +24 -0
  224. package/dist/src/components/radio/Radio.js.map +1 -0
  225. package/dist/src/components/rate/Rate.cjs +22 -0
  226. package/dist/src/components/rate/Rate.cjs.map +1 -0
  227. package/dist/src/components/rate/Rate.js +22 -0
  228. package/dist/src/components/rate/Rate.js.map +1 -0
  229. package/dist/src/components/select/AntdSelect.cjs +76 -0
  230. package/dist/src/components/select/AntdSelect.cjs.map +1 -0
  231. package/dist/src/components/select/AntdSelect.js +60 -0
  232. package/dist/src/components/select/AntdSelect.js.map +1 -0
  233. package/dist/src/components/select/Select.cjs +107 -0
  234. package/dist/src/components/select/Select.cjs.map +1 -0
  235. package/dist/src/components/select/Select.js +107 -0
  236. package/dist/src/components/select/Select.js.map +1 -0
  237. package/dist/src/components/select/SummarizedSelect.cjs +455 -0
  238. package/dist/src/components/select/SummarizedSelect.cjs.map +1 -0
  239. package/dist/src/components/select/SummarizedSelect.js +455 -0
  240. package/dist/src/components/select/SummarizedSelect.js.map +1 -0
  241. package/dist/src/components/select/SummarizedSelect.module.css.cjs +30 -0
  242. package/dist/src/components/select/SummarizedSelect.module.css.cjs.map +1 -0
  243. package/dist/src/components/select/SummarizedSelect.module.css.js +30 -0
  244. package/dist/src/components/select/SummarizedSelect.module.css.js.map +1 -0
  245. package/dist/src/components/skeleton/Skeleton.cjs +14 -0
  246. package/dist/src/components/skeleton/Skeleton.cjs.map +1 -0
  247. package/dist/src/components/skeleton/Skeleton.js +14 -0
  248. package/dist/src/components/skeleton/Skeleton.js.map +1 -0
  249. package/dist/src/components/spinner/Spinner.cjs +20 -0
  250. package/dist/src/components/spinner/Spinner.cjs.map +1 -0
  251. package/dist/src/components/spinner/Spinner.js +20 -0
  252. package/dist/src/components/spinner/Spinner.js.map +1 -0
  253. package/dist/src/components/steps/Steps.cjs +50 -0
  254. package/dist/src/components/steps/Steps.cjs.map +1 -0
  255. package/dist/src/components/steps/Steps.js +50 -0
  256. package/dist/src/components/steps/Steps.js.map +1 -0
  257. package/dist/src/components/steps/useSteps.cjs +56 -0
  258. package/dist/src/components/steps/useSteps.cjs.map +1 -0
  259. package/dist/src/components/steps/useSteps.js +56 -0
  260. package/dist/src/components/steps/useSteps.js.map +1 -0
  261. package/dist/src/components/switch/Switch.cjs +28 -0
  262. package/dist/src/components/switch/Switch.cjs.map +1 -0
  263. package/dist/src/components/switch/Switch.js +28 -0
  264. package/dist/src/components/switch/Switch.js.map +1 -0
  265. package/dist/src/components/table/Table.cjs +117 -0
  266. package/dist/src/components/table/Table.cjs.map +1 -0
  267. package/dist/src/components/table/Table.js +117 -0
  268. package/dist/src/components/table/Table.js.map +1 -0
  269. package/dist/src/components/table/Table.module.css.cjs +12 -0
  270. package/dist/src/components/table/Table.module.css.cjs.map +1 -0
  271. package/dist/src/components/table/Table.module.css.js +12 -0
  272. package/dist/src/components/table/Table.module.css.js.map +1 -0
  273. package/dist/src/components/tabs/Tabs.cjs +10 -0
  274. package/dist/src/components/tabs/Tabs.cjs.map +1 -0
  275. package/dist/src/components/tabs/Tabs.js +10 -0
  276. package/dist/src/components/tabs/Tabs.js.map +1 -0
  277. package/dist/src/components/tag/Tag.cjs +74 -0
  278. package/dist/src/components/tag/Tag.cjs.map +1 -0
  279. package/dist/src/components/tag/Tag.js +57 -0
  280. package/dist/src/components/tag/Tag.js.map +1 -0
  281. package/dist/src/components/tooltip/Tooltip.cjs +14 -0
  282. package/dist/src/components/tooltip/Tooltip.cjs.map +1 -0
  283. package/dist/src/components/tooltip/Tooltip.js +14 -0
  284. package/dist/src/components/tooltip/Tooltip.js.map +1 -0
  285. package/dist/src/components/vennDiagram/VennDiagram.cjs +47 -0
  286. package/dist/src/components/vennDiagram/VennDiagram.cjs.map +1 -0
  287. package/dist/src/components/vennDiagram/VennDiagram.js +47 -0
  288. package/dist/src/components/vennDiagram/VennDiagram.js.map +1 -0
  289. package/dist/src/svgs/ProgressCircle.svg.cjs +22 -0
  290. package/dist/src/svgs/ProgressCircle.svg.cjs.map +1 -0
  291. package/dist/src/svgs/ProgressCircle.svg.js +6 -0
  292. package/dist/src/svgs/ProgressCircle.svg.js.map +1 -0
  293. package/dist/src/svgs/j2-logo-menu-collapse.svg.cjs +22 -0
  294. package/dist/src/svgs/j2-logo-menu-collapse.svg.cjs.map +1 -0
  295. package/dist/src/svgs/j2-logo-menu-collapse.svg.js +6 -0
  296. package/dist/src/svgs/j2-logo-menu-collapse.svg.js.map +1 -0
  297. package/dist/src/svgs/j2-logo-menu.svg.cjs +22 -0
  298. package/dist/src/svgs/j2-logo-menu.svg.cjs.map +1 -0
  299. package/dist/src/svgs/j2-logo-menu.svg.js +6 -0
  300. package/dist/src/svgs/j2-logo-menu.svg.js.map +1 -0
  301. package/dist/src/svgs/menu-sidebar-collapse.svg.cjs +22 -0
  302. package/dist/src/svgs/menu-sidebar-collapse.svg.cjs.map +1 -0
  303. package/dist/src/svgs/menu-sidebar-collapse.svg.js +6 -0
  304. package/dist/src/svgs/menu-sidebar-collapse.svg.js.map +1 -0
  305. package/dist/src/svgs/menu-sidebar-expand.svg.cjs +22 -0
  306. package/dist/src/svgs/menu-sidebar-expand.svg.cjs.map +1 -0
  307. package/dist/src/svgs/menu-sidebar-expand.svg.js +6 -0
  308. package/dist/src/svgs/menu-sidebar-expand.svg.js.map +1 -0
  309. package/dist/style.css +646 -646
  310. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -1,3624 +1,106 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxRuntime = require("react/jsx-runtime");
4
- const React = require("react");
5
- const antd = require("antd");
6
- const react$1 = require("@phosphor-icons/react");
7
- const Icon = require("@ant-design/icons");
3
+ const Alert = require("./src/components/alert/Alert.cjs");
4
+ const AntdInput = require("./src/components/input/AntdInput.cjs");
5
+ const AntdSearchInput = require("./src/components/input/AntdSearchInput.cjs");
6
+ const AntdSelect = require("./src/components/select/AntdSelect.cjs");
7
+ const AppConfigProvider = require("./src/AppConfigProvider.cjs");
8
+ const BarChart = require("./src/components/barchart/BarChart.cjs");
9
+ const Breadcrumb = require("./src/components/breadcrumb/Breadcrumb.cjs");
10
+ const BulkActionBar = require("./src/components/bulkActionBar/BulkActionBar.cjs");
11
+ const Button = require("./src/components/button/Button.cjs");
12
+ const Card = require("./src/components/card/Card.cjs");
13
+ const Checkbox = require("./src/components/checkbox/Checkbox.cjs");
14
+ const CheckboxTree = require("./src/components/checkboxTree/CheckboxTree.cjs");
15
+ const Collapse = require("./src/components/collapse/Collapse.cjs");
16
+ const Drawer = require("./src/components/drawer/Drawer.cjs");
17
+ const Dropdown = require("./src/components/dropdown/Dropdown.cjs");
18
+ const FiltersForm = require("./src/components/filterform/FiltersForm.cjs");
19
+ const Form = require("./src/components/form/Form.cjs");
8
20
  const react = require("@highcharts/react");
9
- require("@highcharts/react/options/Accessibility.js");
10
- require("@highcharts/react/options/Exporting.js");
11
- const server = require("react-dom/server");
12
- const cx = require("classnames");
13
- const cloneDeep = require("lodash/cloneDeep.js");
14
- const formikAntd = require("formik-antd");
15
- const formik = require("formik");
16
- require("@highcharts/react/series/Venn.js");
21
+ const Input = require("./src/components/input/Input.cjs");
22
+ const InputNumber = require("./src/components/inputnumber/InputNumber.cjs");
23
+ const LegacyNavMenu = require("./src/components/legacyNavMenu/LegacyNavMenu.cjs");
24
+ const ListPopover = require("./src/components/listpopover/ListPopover.cjs");
25
+ const Menu = require("./src/components/menu/Menu.cjs");
26
+ const Modal = require("./src/components/modal/Modal.cjs");
27
+ const NavMenu = require("./src/components/navMenu/NavMenu.cjs");
28
+ const NotificationModal = require("./src/components/notificationModal/NotificationModal.cjs");
29
+ const Pagination = require("./src/components/pagination/Pagination.cjs");
30
+ const Popover = require("./src/components/popover/Popover.cjs");
31
+ const Progress = require("./src/components/progress/Progress.cjs");
32
+ const Radio = require("./src/components/radio/Radio.cjs");
33
+ const Rate = require("./src/components/rate/Rate.cjs");
34
+ const Select = require("./src/components/select/Select.cjs");
35
+ const Skeleton = require("./src/components/skeleton/Skeleton.cjs");
36
+ const Spinner = require("./src/components/spinner/Spinner.cjs");
37
+ const Steps = require("./src/components/steps/Steps.cjs");
38
+ const SummarizedSelect = require("./src/components/select/SummarizedSelect.cjs");
39
+ const Switch = require("./src/components/switch/Switch.cjs");
40
+ const Table = require("./src/components/table/Table.cjs");
41
+ const Tabs = require("./src/components/tabs/Tabs.cjs");
42
+ const Tag = require("./src/components/tag/Tag.cjs");
43
+ const Tooltip = require("./src/components/tooltip/Tooltip.cjs");
44
+ const UserProfile = require("./src/components/legacyNavMenu/UserProfile.cjs");
45
+ const VennDiagram = require("./src/components/vennDiagram/VennDiagram.cjs");
46
+ const appTheme = require("./src/appTheme.cjs");
47
+ const index = require("./src/components/icons/index.cjs");
17
48
  const tailwind = require("./tailwind.cjs");
18
- function _interopNamespaceDefault(e) {
19
- const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
20
- if (e) {
21
- for (const k in e) {
22
- if (k !== "default") {
23
- const d = Object.getOwnPropertyDescriptor(e, k);
24
- Object.defineProperty(n, k, d.get ? d : {
25
- enumerable: true,
26
- get: () => e[k]
27
- });
28
- }
29
- }
30
- }
31
- n.default = e;
32
- return Object.freeze(n);
33
- }
34
- function _mergeNamespaces(n, m) {
35
- for (var i = 0; i < m.length; i++) {
36
- const e = m[i];
37
- if (typeof e !== "string" && !Array.isArray(e)) {
38
- for (const k in e) {
39
- if (k !== "default" && !(k in n)) {
40
- const d = Object.getOwnPropertyDescriptor(e, k);
41
- if (d) {
42
- Object.defineProperty(n, k, d.get ? d : {
43
- enumerable: true,
44
- get: () => e[k]
45
- });
46
- }
47
- }
48
- }
49
- }
50
- }
51
- return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { value: "Module" }));
52
- }
53
- const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
54
- const react__namespace = /* @__PURE__ */ _interopNamespaceDefault(react$1);
55
- const appTheme = {
56
- token: {
57
- // Colors
58
- colorText: "var(--j2-color-text)",
59
- colorTextSecondary: "var(--j2-color-text-secondary)",
60
- colorTextTertiary: "var(--j2-color-text-tertiary)",
61
- colorTextQuaternary: "var(--j2-color-text-quaternary)",
62
- colorTextHeading: "var(--j2-color-text-heading)",
63
- colorTextLabel: "var(--j2-color-text-label)",
64
- colorTextDescription: "var(--j2-color-text-description)",
65
- colorTextDisabled: "var(--j2-color-text-disabled)",
66
- colorTextPlaceholder: "var(--j2-color-text-placeholder)",
67
- colorIcon: "var(--j2-color-icon)",
68
- colorIconHover: "var(--j2-color-icon-hover)",
69
- colorBgLayout: "var(--j2-color-bg-layout)",
70
- colorBorder: "var(--j2-color-border)",
71
- colorBorderSecondary: "var(--j2-color-border-secondary)",
72
- colorPrimary: "#253761",
73
- // var(--j2-blue-9)
74
- colorSuccess: "#57a45e",
75
- // var(--j2-green-9)
76
- colorWarning: "#9e6e00",
77
- // var(--j2-gold-11)
78
- colorInfo: "#253761",
79
- // var(--j2-blue-9)
80
- colorLink: "#253761",
81
- // var(--j2-blue-9)
82
- colorError: "#bf6c6f",
83
- // var(--j2-red-9)
84
- colorErrorBg: "var(--j2-color-error-bg)",
85
- colorErrorBgHover: "var(--j2-color-error-bg-hover)",
86
- colorErrorBorder: "var(--j2-color-error-border)",
87
- colorErrorBorderHover: "var(--j2-color-error-border-hover)",
88
- colorErrorHover: "var(--j2-color-error-hover)",
89
- colorErrorActive: "var(--j2-color-error-active)",
90
- colorErrorTextHover: "var(--j2-color-error-text-hover)",
91
- colorErrorText: "var(--j2-color-error-text)",
92
- colorErrorTextActive: "var(--j2-color-error-text-active)",
93
- colorLinkHover: "var(--j2-color-link-hover)",
94
- colorInfoBg: "var(--j2-color-info-bg)",
95
- colorInfoBgHover: "var(--j2-color-info-bg-hover)",
96
- colorInfoBorder: "var(--j2-color-info-border)",
97
- colorInfoBorderHover: "var(--j2-color-info-border-hover)",
98
- colorInfoHover: "var(--j2-color-info-hover)",
99
- colorInfoActive: "var(--j2-color-info-active)",
100
- colorInfoTextHover: "var(--j2-color-info-text-hover)",
101
- colorInfoText: "var(--j2-color-info-text)",
102
- colorInfoTextActive: "var(--j2-color-info-text-active)",
103
- colorLinkActive: "var(--j2-color-link-active)",
104
- colorPrimaryBg: "var(--j2-color-primary-bg)",
105
- colorPrimaryBgHover: "var(--j2-color-primary-bg-hover)",
106
- colorPrimaryBorder: "var(--j2-color-primary-border)",
107
- colorPrimaryBorderHover: "var(--j2-color-primary-border-hover)",
108
- colorPrimaryHover: "var(--j2-color-primary-hover)",
109
- colorPrimaryActive: "var(--j2-color-primary-active)",
110
- colorPrimaryTextHover: "var(--j2-color-primary-text-hover)",
111
- colorPrimaryText: "var(--j2-color-primary-text)",
112
- colorPrimaryTextActive: "var(--j2-color-primary-text-active)",
113
- colorSuccessBg: "var(--j2-color-success-bg)",
114
- colorSuccessBgHover: "var(--j2-color-success-bg-hover)",
115
- colorSuccessBorder: "var(--j2-color-success-border)",
116
- colorSuccessBorderHover: "var(--j2-color-success-border-hover)",
117
- colorSuccessHover: "var(--j2-color-success-hover)",
118
- colorSuccessActive: "var(--j2-color-success-active)",
119
- colorSuccessTextHover: "var(--j2-color-success-text-hover)",
120
- colorSuccessText: "var(--j2-color-success-text)",
121
- colorSuccessTextActive: "var(--j2-color-success-text-active)",
122
- colorWarningBg: "var(--j2-color-warning-bg)",
123
- colorWarningBgHover: "var(--j2-color-warning-bg-hover)",
124
- colorWarningBorder: "var(--j2-color-warning-border)",
125
- colorWarningBorderHover: "var(--j2-color-warning-border-hover)",
126
- colorWarningHover: "var(--j2-color-warning-hover)",
127
- colorWarningActive: "var(--j2-color-warning-active)",
128
- colorWarningTextHover: "var(--j2-color-warning-text-hover)",
129
- colorWarningText: "var(--j2-color-warning-text)",
130
- colorWarningTextActive: "var(--j2-color-warning-text-active)",
131
- controlItemBgActive: "var(--j2-control-item-bg-active)",
132
- controlItemBgActiveHover: "var(--j2-control-item-bg-active-hover)",
133
- colorFill: "var(--j2-color-fill)",
134
- colorFillSecondary: "var(--j2-color-fill-secondary)",
135
- colorFillTertiary: "var(--j2-color-fill-tertiary)",
136
- colorFillQuaternary: "var(--j2-color-fill-quaternary)",
137
- colorFillContent: "var(--j2-color-fill-content)",
138
- colorFillContentHover: "var(--j2-color-fill-content-hover)",
139
- colorBgMask: "var(--j2-color-bg-mask)",
140
- colorBgSpotlight: "var(--j2-color-bg-spotlight)",
141
- colorBgContainerDisabled: "var(--j2-color-bg-container-disabled)",
142
- colorBgTextActive: "var(--j2-color-bg-text-active)",
143
- colorBgTextHover: "var(--j2-color-bg-text-hover)",
144
- colorFillAlter: "var(--j2-color-fill-alter)",
145
- colorSplit: "var(--j2-color-split)",
146
- colorErrorOutline: "var(--j2-color-error-outline)",
147
- colorWarningOutline: "var(--j2-color-warning-outline)",
148
- controlItemBgActiveDisabled: "var(--j2-control-item-bg-active-disabled)",
149
- controlItemBgHover: "var(--j2-control-item-bg-hover)",
150
- controlOutline: "var(--j2-control-outline)",
151
- controlTmpOutline: "var(--j2-control-tmp-outline)",
152
- // Typography
153
- fontFamily: "Rubik, sans-serif",
154
- fontFamilyCode: "Rubik, sans-serif",
155
- fontSize: 14,
156
- fontSizeLG: 16,
157
- fontSizeSM: 12,
158
- fontSizeXL: 20,
159
- fontSizeHeading1: 38,
160
- fontSizeHeading2: 30,
161
- fontSizeHeading3: 24,
162
- fontSizeHeading4: 20,
163
- fontSizeHeading5: 16,
164
- lineHeight: 1.5714285714285714,
165
- lineHeightHeading1: 1.2105263157894737,
166
- lineHeightHeading2: 1.2666666666666666,
167
- lineHeightHeading3: 1.3333333333333333,
168
- lineHeightHeading4: 1.4,
169
- lineHeightHeading5: 1.5,
170
- lineHeightLG: 1.5,
171
- lineHeightSM: 1.6666666666666667,
172
- fontSizeIcon: 12,
173
- fontWeightStrong: 600,
174
- // Border
175
- borderRadius: 8,
176
- borderRadiusLG: 10,
177
- borderRadiusSM: 6,
178
- borderRadiusXS: 2,
179
- // Spacing and sizing
180
- sizeStep: 4,
181
- sizeUnit: 4,
182
- controlInteractiveSize: 16,
183
- size: 16,
184
- sizeLG: 24,
185
- sizeMD: 20,
186
- sizeMS: 16,
187
- sizeSM: 12,
188
- sizeXL: 32,
189
- sizeXS: 8,
190
- sizeXXL: 48,
191
- controlHeight: 32,
192
- sizeXXS: 4,
193
- controlHeightLG: 40,
194
- controlHeightSM: 24,
195
- controlHeightXS: 16,
196
- lineWidth: 1,
197
- lineWidthBold: 2,
198
- lineWidthFocus: 4,
199
- controlOutlineWidth: 2,
200
- screenLG: 992,
201
- screenLGMax: 1199,
202
- screenLGMin: 992,
203
- screenMD: 768,
204
- screenMDMax: 991,
205
- screenMDMin: 768,
206
- screenSM: 576,
207
- screenSMMax: 767,
208
- screenSMMin: 576,
209
- screenXL: 1200,
210
- screenXLMax: 1599,
211
- screenXLMin: 1200,
212
- screenXS: 480,
213
- screenXSMax: 575,
214
- screenXSMin: 480,
215
- screenXXL: 1600,
216
- screenXXLMin: 1600,
217
- sizePopupArrow: 16,
218
- margin: 16,
219
- marginLG: 24,
220
- marginMD: 20,
221
- marginSM: 12,
222
- marginXL: 32,
223
- marginXS: 8,
224
- marginXXL: 48,
225
- marginXXS: 4,
226
- padding: 16,
227
- paddingLG: 24,
228
- paddingMD: 20,
229
- paddingSM: 12,
230
- paddingXL: 32,
231
- paddingXS: 8,
232
- paddingXXS: 4,
233
- paddingContentHorizontal: 16,
234
- paddingContentHorizontalLG: 24,
235
- paddingContentHorizontalSM: 16,
236
- paddingContentVertical: 12,
237
- paddingContentVerticalLG: 16,
238
- paddingContentVerticalSM: 8,
239
- controlPaddingHorizontal: 12,
240
- controlPaddingHorizontalSM: 8
241
- },
242
- components: {
243
- Alert: {
244
- paddingContentHorizontalLG: 16
245
- // Use standard padding instead of paddingLG when description is present
246
- },
247
- Breadcrumb: {
248
- itemColor: "var(--j2-color-text-label)",
249
- lastItemColor: "var(--j2-color-primary)",
250
- linkColor: "inherit",
251
- linkHoverColor: "var(--j2-color-link-hover)",
252
- colorBgTextHover: "var(--j2-color-primary-bg-hover)"
253
- },
254
- Button: {
255
- defaultColor: "var(--j2-color-primary-text)",
256
- defaultBorderColor: "var(--j2-color-border)",
257
- defaultHoverBorderColor: "var(--j2-color-primary-active)",
258
- defaultActiveBorderColor: "var(--j2-color-primary-active)",
259
- ghostBg: "#fff",
260
- defaultGhostBorderColor: "var(--j2-color-primary)",
261
- defaultGhostColor: "var(--j2-color-primary-text)",
262
- textTextColor: "var(--j2-color-primary-text)",
263
- textHoverBg: "var(--j2-gray-2)",
264
- textTextHoverColor: "var(--j2-color-primary-text-hover)",
265
- textTextActiveColor: "var(--j2-color-primary-text-active)"
266
- },
267
- Form: {
268
- itemMarginBottom: 0,
269
- labelHeight: "100%"
270
- },
271
- Input: {
272
- activeBorderColor: "var(--j2-color-primary-active)"
273
- },
274
- InputNumber: {
275
- handleVisible: true,
276
- handleHoverColor: "var(--j2-color-primary-text)",
277
- handleBorderColor: "var(--j2-color-border)",
278
- handleBg: "var(--j2-color-bg-container-disabled)"
279
- },
280
- Menu: {
281
- itemColor: "var(--j2-color-primary-text)",
282
- itemSelectedBg: "var(--j2-color-primary)",
283
- itemSelectedColor: "#fff",
284
- itemMarginInline: 12
285
- },
286
- Progress: {
287
- defaultColor: "var(--j2-color-primary)"
288
- },
289
- Rate: {
290
- marginXS: 0
291
- },
292
- Radio: {
293
- // Unselected outlined radio-button labels default to colorText (near-black);
294
- // align them with the selected label's primary blue so the control reads as
295
- // a single cohesive outlined-blue selector.
296
- buttonColor: "var(--j2-color-primary)"
297
- },
298
- Select: {
299
- multipleItemBg: "var(--j2-gray-2)",
300
- multipleItemBorderColor: "var(--j2-gray-4)",
301
- colorText: "var(--j2-color-primary-text)"
302
- },
303
- Tooltip: {
304
- colorBgSpotlight: "var(--j2-color-primary-active)"
305
- },
306
- Table: {
307
- headerBg: "var(--j2-color-bg-layout)",
308
- rowHoverBg: "var(--j2-color-bg-layout)",
309
- bodySortBg: "var(--j2-gray-2)",
310
- headerSortHoverBg: "var(--j2-gray-3)",
311
- headerSortActiveBg: "var(--j2-gray-3)",
312
- fixedHeaderSortActiveBg: "var(--j2-gray-3)"
313
- },
314
- Tag: {
315
- defaultBg: "var(--j2-color-fill-secondary)"
316
- }
317
- }
318
- };
319
- const AppConfigProvider = ({
320
- children
321
- }) => {
322
- return /* @__PURE__ */ jsxRuntime.jsx(antd.ConfigProvider, { theme: appTheme, children: /* @__PURE__ */ jsxRuntime.jsx(react$1.IconContext.Provider, { value: { weight: "duotone", size: 16 }, children }) });
323
- };
324
- const alert = "_alert_1yhxg_2";
325
- const styles$b = {
326
- alert
327
- };
328
- const Alert = ({
329
- description,
330
- type,
331
- closable = false,
332
- showIcon = true,
333
- banner = false,
334
- ...props
335
- }) => {
336
- const { token } = antd.theme.useToken();
337
- const icon = React__namespace.useMemo(() => {
338
- const size = description ? token.sizeLG : token.size;
339
- const iconStyle = !description ? { display: "flex", alignItems: "center" } : void 0;
340
- const iconElement = (() => {
341
- switch (type) {
342
- case "success":
343
- return /* @__PURE__ */ jsxRuntime.jsx(react$1.CheckCircleIcon, { fill: "var(--j2-color-success-text)", size });
344
- case "error":
345
- return /* @__PURE__ */ jsxRuntime.jsx(react$1.XCircleIcon, { fill: "var(--j2-color-error-text)", size });
346
- case "info":
347
- return /* @__PURE__ */ jsxRuntime.jsx(react$1.InfoIcon, { fill: "var(--j2-color-info-text)", size });
348
- case "warning":
349
- return /* @__PURE__ */ jsxRuntime.jsx(
350
- react$1.WarningCircleIcon,
351
- {
352
- fill: "var(--j2-color-warning-text)",
353
- size
354
- }
355
- );
356
- case "loading":
357
- return /* @__PURE__ */ jsxRuntime.jsx(
358
- react$1.CircleNotchIcon,
359
- {
360
- fill: "var(--j2-color-info-text)",
361
- size,
362
- weight: "regular",
363
- style: {
364
- animation: "spin 1s linear infinite"
365
- }
366
- }
367
- );
368
- default:
369
- return null;
370
- }
371
- })();
372
- return iconStyle ? /* @__PURE__ */ jsxRuntime.jsx("span", { style: iconStyle, children: iconElement }) : iconElement;
373
- }, [type, description, token.size, token.sizeLG]);
374
- const antDType = React__namespace.useMemo(() => {
375
- switch (type) {
376
- case "loading":
377
- return "info";
378
- default:
379
- return type;
380
- }
381
- }, [type]);
382
- return /* @__PURE__ */ jsxRuntime.jsx(
383
- antd.Alert,
384
- {
385
- className: styles$b.alert,
386
- icon,
387
- closable,
388
- showIcon,
389
- type: antDType,
390
- banner,
391
- description,
392
- closeIcon: /* @__PURE__ */ jsxRuntime.jsx(react$1.XIcon, { size: token.size, weight: "regular" }),
393
- ...props
394
- }
395
- );
396
- };
397
- const tooltip = "_tooltip_1g39l_1";
398
- const styles$a = {
399
- tooltip
400
- };
401
- const BarChart = ({
402
- categories,
403
- series,
404
- min,
405
- max,
406
- tickInterval,
407
- tickFormat,
408
- xAxisTitle,
409
- yAxisTitle,
410
- gridLineColor,
411
- gridLineDashStyle,
412
- xAxisLabelMaxLines,
413
- tooltip: tooltip2,
414
- exporting,
415
- chartRef,
416
- height,
417
- width,
418
- maxBars = 50,
419
- barsWidth = void 0
420
- }) => {
421
- var _a, _b, _c, _d, _e;
422
- const limitedCategories = categories.slice(0, maxBars);
423
- const limitedSeries = series.map((s2) => ({
424
- ...s2,
425
- data: s2.data.slice(0, maxBars)
426
- }));
427
- const { token } = antd.theme.useToken();
428
- const baseFont = {
429
- fontSize: `${token.fontSize}px`,
430
- fontFamily: token.fontFamily,
431
- color: token.colorText
432
- };
433
- const options = {
434
- credits: {
435
- enabled: false
436
- },
437
- chart: {
438
- type: "column",
439
- ...height ? { height } : {},
440
- ...width ? { width } : {}
441
- },
442
- plotOptions: {
443
- column: {
444
- borderRadius: series[0].data.length > 5 ? "20%" : "15%",
445
- ...barsWidth !== void 0 ? { pointWidth: barsWidth } : {}
446
- }
447
- },
448
- exporting: {
449
- ...exporting,
450
- enabled: false,
451
- chartOptions: {
452
- ...exporting == null ? void 0 : exporting.chartOptions,
453
- title: {
454
- align: "left",
455
- text: (_b = (_a = exporting == null ? void 0 : exporting.chartOptions) == null ? void 0 : _a.title) == null ? void 0 : _b.text,
456
- style: {
457
- fontSize: `${token.fontSize}px`,
458
- fontFamily: "sans-serif",
459
- color: token.colorText,
460
- ...(_d = (_c = exporting == null ? void 0 : exporting.chartOptions) == null ? void 0 : _c.title) == null ? void 0 : _d.style
461
- }
462
- },
463
- series: limitedSeries.map((s2) => ({
464
- type: "column",
465
- color: s2.color ? s2.color : "#253761"
466
- // --j2-blue-9
467
- })),
468
- legend: ((_e = exporting == null ? void 0 : exporting.chartOptions) == null ? void 0 : _e.legend) || { enabled: false }
469
- }
470
- },
471
- title: {
472
- text: ""
473
- },
474
- xAxis: {
475
- categories: limitedCategories,
476
- title: xAxisTitle ? {
477
- text: xAxisTitle,
478
- style: { ...baseFont, color: token.colorTextDescription }
479
- } : void 0,
480
- labels: {
481
- y: 30,
482
- style: baseFont,
483
- ...xAxisLabelMaxLines ? {
484
- useHTML: true,
485
- formatter: function() {
486
- return `<div style="overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: ${xAxisLabelMaxLines}; -webkit-box-orient: vertical; text-align: center;">${this.value}</div>`;
487
- }
488
- } : {}
489
- }
490
- },
491
- yAxis: {
492
- min,
493
- max,
494
- endOnTick: true,
495
- gridLineDashStyle: gridLineDashStyle || "Dot",
496
- gridLineColor: gridLineColor || "white",
497
- title: yAxisTitle ? {
498
- text: yAxisTitle,
499
- style: { ...baseFont, color: token.colorTextDescription },
500
- x: -10
501
- } : void 0,
502
- tickInterval,
503
- labels: {
504
- formatter: tickFormat ? ({ value }) => tickFormat(value) : void 0,
505
- style: baseFont
506
- }
507
- },
508
- legend: {
509
- enabled: false
510
- },
511
- series: limitedSeries.map((s2) => ({
512
- data: s2.data,
513
- name: s2.name,
514
- type: "column",
515
- color: s2.color || "var(--j2-blue-11)",
516
- states: {
517
- hover: {
518
- color: s2.hoverColor || token.colorPrimaryTextHover
519
- }
520
- }
521
- })),
522
- tooltip: {
523
- useHTML: true,
524
- outside: true,
525
- backgroundColor: "transparent",
526
- shadow: false,
527
- padding: 0,
528
- style: { zIndex: 9999 },
529
- formatter: function() {
530
- return server.renderToString(
531
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$a.tooltip, children: tooltip2(this.key, this.y, this.series.name) })
532
- );
533
- }
534
- }
535
- };
536
- return /* @__PURE__ */ jsxRuntime.jsx(react.Chart, { ref: chartRef, options });
537
- };
538
- const Breadcrumb = ({ items, ...props }) => {
539
- const antDItems = React__namespace.useMemo(
540
- () => items.map((item) => ({
541
- href: item.href,
542
- onClick: item.onClick,
543
- title: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1", children: [
544
- item.icon && /* @__PURE__ */ jsxRuntime.jsx(item.icon, { size: 14 }),
545
- item.title
546
- ] })
547
- })),
548
- [items]
549
- );
550
- return /* @__PURE__ */ jsxRuntime.jsx(antd.Breadcrumb, { ...props, items: antDItems });
551
- };
552
- const Button = ({ type, size, ghost, danger, shape, ...props }) => {
553
- return /* @__PURE__ */ jsxRuntime.jsx(
554
- antd.Button,
555
- {
556
- ...props,
557
- type,
558
- size,
559
- ghost,
560
- danger,
561
- shape,
562
- children: props.children
563
- }
564
- );
565
- };
566
- const BulkActionBar = ({
567
- count,
568
- action,
569
- secondaryActions,
570
- onCancel,
571
- cancelLabel = "Cancel"
572
- }) => {
573
- const visible = count > 0;
574
- const label = `${count} selected`;
575
- return /* @__PURE__ */ jsxRuntime.jsx(
576
- "div",
577
- {
578
- role: "region",
579
- "aria-label": "Bulk actions",
580
- "aria-hidden": !visible,
581
- className: cx(
582
- "pointer-events-none fixed bottom-6 left-1/2 z-50",
583
- "-translate-x-1/2 transition duration-200 ease-out",
584
- visible ? "translate-y-0 opacity-100" : "pointer-events-none translate-y-4 opacity-0"
585
- ),
586
- children: /* @__PURE__ */ jsxRuntime.jsxs(
587
- "div",
588
- {
589
- className: cx(
590
- "pointer-events-auto flex items-center gap-3 rounded-full",
591
- "bg-j2-primary-active py-2 pl-4 pr-2 text-white shadow-lg"
592
- ),
593
- children: [
594
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium", children: label }),
595
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-5 w-px bg-white/20" }),
596
- /* @__PURE__ */ jsxRuntime.jsx(
597
- Button,
598
- {
599
- type: "text",
600
- shape: "round",
601
- size: "small",
602
- icon: action.icon,
603
- loading: action.loading,
604
- onClick: action.onClick,
605
- className: "!text-white hover:!bg-white/10 hover:!text-white",
606
- children: action.label
607
- }
608
- ),
609
- secondaryActions == null ? void 0 : secondaryActions.map((sec) => /* @__PURE__ */ jsxRuntime.jsx(
610
- Button,
611
- {
612
- type: "text",
613
- shape: "round",
614
- size: "small",
615
- icon: sec.icon,
616
- loading: sec.loading,
617
- onClick: sec.onClick,
618
- className: "!text-white hover:!bg-white/10 hover:!text-white",
619
- children: sec.label
620
- },
621
- sec.label
622
- )),
623
- /* @__PURE__ */ jsxRuntime.jsx(
624
- Button,
625
- {
626
- type: "text",
627
- shape: "round",
628
- size: "small",
629
- onClick: onCancel,
630
- className: "!text-white hover:!bg-white/10 hover:!text-white",
631
- children: cancelLabel
632
- }
633
- )
634
- ]
635
- }
636
- )
637
- }
638
- );
639
- };
640
- const Card = ({
641
- title,
642
- children,
643
- loading,
644
- size = "default",
645
- innerVariant = "default",
646
- className,
647
- ...props
648
- }) => {
649
- const isInner = props.type === "inner";
650
- const isInnerBasic = isInner && innerVariant === "basic";
651
- return /* @__PURE__ */ jsxRuntime.jsx(
652
- antd.Card,
653
- {
654
- className: cx(
655
- "j2-card",
656
- `j2-card-${size}`,
657
- isInnerBasic && "inner-basic",
658
- className
659
- ),
660
- ...props,
661
- size: size === "large" || size === "compact" ? "default" : size,
662
- title,
663
- loading,
664
- children
665
- }
666
- );
667
- };
668
- const Checkbox = (props) => {
669
- return /* @__PURE__ */ jsxRuntime.jsx(antd.Checkbox, { ...props });
670
- };
671
- Checkbox.Group = antd.Checkbox.Group;
672
- const getLeafKeys = (node) => {
673
- const keys = [];
674
- const traverse = (currentNode) => {
675
- if (!currentNode.children || currentNode.children.length === 0) {
676
- keys.push(currentNode.key);
677
- } else {
678
- currentNode.children.forEach((child) => traverse(child));
679
- }
680
- };
681
- traverse(node);
682
- return keys;
683
- };
684
- const getAllLeafKeys = (nodes) => {
685
- const keys = [];
686
- nodes.forEach((node) => {
687
- keys.push(...getLeafKeys(node));
688
- });
689
- return keys;
690
- };
691
- const getNodeCheckState = (node, leafNodeStates) => {
692
- let hasChecked = false;
693
- let hasUnchecked = false;
694
- const visit = (current) => {
695
- if (!current.children || current.children.length === 0) {
696
- if (leafNodeStates[current.key] === true) {
697
- hasChecked = true;
698
- } else {
699
- hasUnchecked = true;
700
- }
701
- return hasChecked && hasUnchecked;
702
- }
703
- return current.children.some(visit);
704
- };
705
- visit(node);
706
- return {
707
- checked: hasChecked && !hasUnchecked,
708
- indeterminate: hasChecked && hasUnchecked
709
- };
710
- };
711
- const getAllParentKeys = (nodes) => {
712
- const keys = [];
713
- const traverse = (currentNodes) => {
714
- currentNodes.forEach((node) => {
715
- if (node.children && node.children.length > 0) {
716
- keys.push(node.key);
717
- traverse(node.children);
718
- }
719
- });
720
- };
721
- traverse(nodes);
722
- return keys;
723
- };
724
- const TreeNode = ({
725
- node,
726
- level,
727
- leafNodeValues,
728
- onCheck,
729
- disabled,
730
- expandedKeys,
731
- onToggleExpand,
732
- lazyChildren
733
- }) => {
734
- const { checked: isChecked, indeterminate } = getNodeCheckState(
735
- node,
736
- leafNodeValues
737
- );
738
- const isIndeterminate = lazyChildren && indeterminate;
739
- const isDisabled = disabled || node.disabled;
740
- const hasChildren = node.children && node.children.length > 0;
741
- const isExpanded = expandedKeys.has(node.key);
742
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
743
- /* @__PURE__ */ jsxRuntime.jsxs(
744
- "div",
745
- {
746
- className: "flex items-center min-h-6 mb-1",
747
- style: { paddingLeft: level * 20 },
748
- children: [
749
- /* @__PURE__ */ jsxRuntime.jsx(
750
- Checkbox,
751
- {
752
- checked: isChecked,
753
- indeterminate: isIndeterminate,
754
- disabled: isDisabled,
755
- onChange: (e) => onCheck(node.key, e.target.checked, node),
756
- children: node.title
757
- }
758
- ),
759
- hasChildren && !isDisabled && /* @__PURE__ */ jsxRuntime.jsx(
760
- "button",
761
- {
762
- type: "button",
763
- onClick: () => onToggleExpand(node.key),
764
- className: "flex items-center justify-center ml-auto cursor-pointer bg-transparent border-none p-0",
765
- "aria-expanded": isExpanded,
766
- "aria-label": `${isExpanded ? "Collapse" : "Expand"}${typeof node.title === "string" ? ` ${node.title}` : ""}`,
767
- children: /* @__PURE__ */ jsxRuntime.jsx(
768
- react$1.CaretDownIcon,
769
- {
770
- size: 14,
771
- style: {
772
- transform: `rotate(${isExpanded ? 0 : -90}deg)`,
773
- transition: "transform 150ms ease"
774
- }
775
- }
776
- )
777
- }
778
- )
779
- ]
780
- }
781
- ),
782
- hasChildren && /* @__PURE__ */ jsxRuntime.jsx(
783
- "div",
784
- {
785
- style: {
786
- display: "grid",
787
- gridTemplateRows: isExpanded ? "1fr" : "0fr",
788
- transition: "grid-template-rows 150ms ease"
789
- },
790
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { overflow: "hidden" }, children: (!lazyChildren || isExpanded) && node.children.map((childNode) => /* @__PURE__ */ jsxRuntime.jsx(
791
- TreeNode,
792
- {
793
- node: childNode,
794
- level: level + 1,
795
- leafNodeValues,
796
- onCheck,
797
- disabled,
798
- expandedKeys,
799
- onToggleExpand,
800
- lazyChildren
801
- },
802
- childNode.key
803
- )) })
804
- }
805
- )
806
- ] });
807
- };
808
- const CheckboxTree = ({
809
- treeData,
810
- defaultCheckedKeys = [],
811
- checkedKeys: controlledCheckedKeys,
812
- onCheck,
813
- disabled = false,
814
- defaultExpandAll = true,
815
- defaultExpandedKeys,
816
- expandedKeys: controlledExpandedKeys,
817
- onExpand,
818
- className,
819
- style,
820
- lazyChildren = false
821
- }) => {
822
- const allLeafKeys = React.useMemo(() => getAllLeafKeys(treeData), [treeData]);
823
- const leafKeySet = React.useMemo(() => new Set(allLeafKeys), [allLeafKeys]);
824
- const [internalLeafNodeValues, setInternalLeafNodeValues] = React.useState(() => {
825
- const defaultLeafKeySet = new Set(
826
- defaultCheckedKeys.filter((key) => leafKeySet.has(key))
827
- );
828
- const values = {};
829
- for (const key of allLeafKeys) {
830
- values[key] = defaultLeafKeySet.has(key);
831
- }
832
- return values;
833
- });
834
- const [internalExpandedKeys, setInternalExpandedKeys] = React.useState(() => {
835
- if (defaultExpandedKeys) return defaultExpandedKeys;
836
- if (defaultExpandAll) return getAllParentKeys(treeData);
837
- return [];
838
- });
839
- React.useEffect(() => {
840
- if (controlledExpandedKeys || !defaultExpandAll || defaultExpandedKeys)
841
- return;
842
- const allParentKeys = getAllParentKeys(treeData);
843
- setInternalExpandedKeys((prev) => {
844
- const prevSet = new Set(prev);
845
- const newKeys = allParentKeys.filter((key) => !prevSet.has(key));
846
- if (newKeys.length === 0) return prev;
847
- return [...prev, ...newKeys];
848
- });
849
- }, [treeData, defaultExpandAll, controlledExpandedKeys, defaultExpandedKeys]);
850
- const expandedKeysSet = React.useMemo(() => {
851
- const keys = controlledExpandedKeys ?? internalExpandedKeys;
852
- return new Set(keys);
853
- }, [controlledExpandedKeys, internalExpandedKeys]);
854
- const handleToggleExpand = React.useCallback(
855
- (key) => {
856
- const currentKeys = controlledExpandedKeys ?? internalExpandedKeys;
857
- const newKeys = currentKeys.includes(key) ? currentKeys.filter((k) => k !== key) : [...currentKeys, key];
858
- if (!controlledExpandedKeys) {
859
- setInternalExpandedKeys(newKeys);
860
- }
861
- onExpand == null ? void 0 : onExpand(newKeys);
862
- },
863
- [controlledExpandedKeys, internalExpandedKeys, onExpand]
864
- );
865
- const leafNodeValues = React.useMemo(() => {
866
- if (!controlledCheckedKeys) {
867
- return internalLeafNodeValues;
868
- }
869
- const controlledLeafKeySet = new Set(
870
- controlledCheckedKeys.filter((key) => leafKeySet.has(key))
871
- );
872
- const values = {};
873
- for (const key of allLeafKeys) {
874
- values[key] = controlledLeafKeySet.has(key);
875
- }
876
- return values;
877
- }, [allLeafKeys, leafKeySet, controlledCheckedKeys, internalLeafNodeValues]);
878
- const handleCheck = React.useCallback(
879
- (_key, checked, node) => {
880
- const newLeafNodeValues = { ...leafNodeValues };
881
- if (checked) {
882
- const leafKeys = getLeafKeys(node);
883
- leafKeys.forEach((leafKey) => newLeafNodeValues[leafKey] = true);
884
- } else {
885
- const leafKeys = getLeafKeys(node);
886
- leafKeys.forEach((leafKey) => newLeafNodeValues[leafKey] = false);
887
- }
888
- if (!controlledCheckedKeys) {
889
- setInternalLeafNodeValues(newLeafNodeValues);
890
- }
891
- if (onCheck) {
892
- const checkedLeafNodes = {};
893
- const allCheckedNodes = [];
894
- const collectChecked = (current) => {
895
- let isChecked;
896
- if (!current.children || current.children.length === 0) {
897
- isChecked = newLeafNodeValues[current.key] === true;
898
- if (isChecked) {
899
- checkedLeafNodes[current.key] = current;
900
- }
901
- } else {
902
- isChecked = true;
903
- for (const child of current.children) {
904
- if (!collectChecked(child)) {
905
- isChecked = false;
906
- }
907
- }
908
- }
909
- if (isChecked) {
910
- allCheckedNodes.push(current);
911
- }
912
- return isChecked;
913
- };
914
- treeData.forEach(collectChecked);
915
- onCheck(newLeafNodeValues, {
916
- checked,
917
- checkedLeafNodes,
918
- allCheckedNodes,
919
- node
920
- });
921
- }
922
- },
923
- [controlledCheckedKeys, onCheck, treeData, leafNodeValues]
924
- );
925
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className, style, children: treeData.map((node) => /* @__PURE__ */ jsxRuntime.jsx(
926
- TreeNode,
927
- {
928
- node,
929
- level: 0,
930
- leafNodeValues,
931
- onCheck: handleCheck,
932
- disabled,
933
- expandedKeys: expandedKeysSet,
934
- onToggleExpand: handleToggleExpand,
935
- lazyChildren
936
- },
937
- node.key
938
- )) });
939
- };
940
- const warning = "_warning_yukjt_2";
941
- const error = "_error_yukjt_3";
942
- const styles$9 = {
943
- "default": "_default_yukjt_1",
944
- warning,
945
- error
946
- };
947
- const stateConfig = {
948
- default: {
949
- className: styles$9.default,
950
- Icon: react$1.InfoIcon,
951
- color: "var(--j2-color-text)"
952
- },
953
- warning: {
954
- className: styles$9.warning,
955
- Icon: react$1.WarningCircleIcon,
956
- color: "var(--j2-color-warning-text)"
957
- },
958
- error: {
959
- className: styles$9.error,
960
- Icon: react$1.XCircleIcon,
961
- color: "var(--j2-color-error-text)"
962
- }
963
- };
964
- const Collapse = ({
965
- state = "default",
966
- showIcon = false,
967
- className,
968
- items,
969
- ...props
970
- }) => {
971
- const { className: stateClass, Icon: Icon2, color } = stateConfig[state];
972
- const icon = React__namespace.useMemo(() => {
973
- if (!showIcon) return null;
974
- return /* @__PURE__ */ jsxRuntime.jsx(Icon2, { size: 14, fill: color, style: { flexShrink: 0 } });
975
- }, [state, showIcon]);
976
- const itemsWithIcon = React__namespace.useMemo(() => {
977
- if (!icon || !items) return items;
978
- return items.map((item) => ({
979
- ...item,
980
- label: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
981
- icon,
982
- item.label
983
- ] })
984
- }));
985
- }, [items, icon]);
986
- return /* @__PURE__ */ jsxRuntime.jsx(
987
- antd.Collapse,
988
- {
989
- ...props,
990
- items: itemsWithIcon,
991
- className: [stateClass, className].filter(Boolean).join(" "),
992
- expandIcon: ({ isActive: isActive2 }) => /* @__PURE__ */ jsxRuntime.jsx(
993
- react$1.CaretDownIcon,
994
- {
995
- size: 14,
996
- style: { transform: `rotate(${isActive2 ? 0 : -90}deg)` }
997
- }
998
- )
999
- }
1000
- );
1001
- };
1002
- const Drawer = ({
1003
- fillPage = false,
1004
- footer,
1005
- extraContent,
1006
- ...props
1007
- }) => {
1008
- return /* @__PURE__ */ jsxRuntime.jsx(
1009
- antd.Drawer,
1010
- {
1011
- ...props,
1012
- closable: false,
1013
- ...fillPage && { height: "100vh", width: "100vw" },
1014
- ...footer && { footer },
1015
- extra: /* @__PURE__ */ jsxRuntime.jsxs(antd.Space, { children: [
1016
- extraContent,
1017
- /* @__PURE__ */ jsxRuntime.jsx(
1018
- Button,
1019
- {
1020
- className: "p-0",
1021
- type: "link",
1022
- onClick: props.onClose,
1023
- "aria-label": "Close",
1024
- children: /* @__PURE__ */ jsxRuntime.jsx(react$1.XIcon, { size: 22, weight: "regular" })
1025
- }
1026
- )
1027
- ] }),
1028
- className: "j2-drawer"
1029
- }
1030
- );
1031
- };
1032
- const { Link } = antd.Typography;
1033
- const LabelWithCaret = ({ label }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
1034
- label,
1035
- /* @__PURE__ */ jsxRuntime.jsx(react$1.CaretDownIcon, { weight: "regular" })
1036
- ] });
1037
- const Target = ({ label, type, disabled, icon, className }) => {
1038
- if (type === "basic-inline") {
1039
- return /* @__PURE__ */ jsxRuntime.jsx(Link, { disabled, className: cx("flex gap-1", className), children: icon ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1040
- icon,
1041
- label
1042
- ] }) : /* @__PURE__ */ jsxRuntime.jsx(LabelWithCaret, { label }) });
1043
- }
1044
- return /* @__PURE__ */ jsxRuntime.jsx(Button, { disabled, icon, className, children: icon ? label : /* @__PURE__ */ jsxRuntime.jsx(LabelWithCaret, { label }) });
1045
- };
1046
- const Dropdown = ({
1047
- label,
1048
- type,
1049
- icon,
1050
- menu,
1051
- menuType = "default",
1052
- targetClassName,
1053
- ...props
1054
- }) => {
1055
- let menuProp = menu;
1056
- if (menuType === "slim" && typeof menu === "object") {
1057
- menuProp = {
1058
- ...menu,
1059
- className: cx(menu.className, "j2-dropdown-slim-menu")
1060
- };
1061
- }
1062
- if (type === "twofold") {
1063
- return /* @__PURE__ */ jsxRuntime.jsx(antd.Dropdown.Button, { ...props, menu: menuProp, children: icon ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1064
- icon,
1065
- " ",
1066
- label
1067
- ] }) : label });
1068
- }
1069
- return /* @__PURE__ */ jsxRuntime.jsx(antd.Dropdown, { ...props, menu: menuProp, children: /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(
1070
- Target,
1071
- {
1072
- label,
1073
- type,
1074
- disabled: props.disabled,
1075
- icon,
1076
- className: targetClassName
1077
- }
1078
- ) }) });
1079
- };
1080
- const j2FilterForm = "_j2FilterForm_rdja9_1";
1081
- const filterFormTitle = "_filterFormTitle_rdja9_2";
1082
- const filterFormConjunction = "_filterFormConjunction_rdja9_6";
1083
- const filterFormFieldsContainer = "_filterFormFieldsContainer_rdja9_10";
1084
- const filterFormGroupContainer = "_filterFormGroupContainer_rdja9_15";
1085
- const s$4 = {
1086
- j2FilterForm,
1087
- filterFormTitle,
1088
- filterFormConjunction,
1089
- filterFormFieldsContainer,
1090
- filterFormGroupContainer
1091
- };
1092
- const isEmptyFilter = (filter) => {
1093
- if (filter.operator === "blank" || filter.operator === "notBlank") {
1094
- return false;
1095
- }
1096
- if (filter.values && filter.values.length > 0 && filter.values.every(
1097
- (value) => value !== "" && value !== void 0 && value !== null
1098
- )) {
1099
- return false;
1100
- }
1101
- return true;
1102
- };
1103
- const isEmptyFormFilter = (filter) => {
1104
- if (filter.operator === "blank" || filter.operator === "notBlank") {
1105
- return false;
1106
- }
1107
- if (filter.values && filter.values.length > 0 && filter.values.every(
1108
- (value) => value !== "" && value !== void 0 && value !== null
1109
- )) {
1110
- return false;
1111
- }
1112
- return true;
1113
- };
1114
- const validateFormFilter = (filter) => {
1115
- const errors = [];
1116
- if (!filter.operator) {
1117
- errors.push("Operator is required");
1118
- return errors;
1119
- }
1120
- if (isEmptyFormFilter(filter)) {
1121
- errors.push("Value is required");
1122
- }
1123
- if (filter.type === "number" && filter.operator === "inRange") {
1124
- if (filter.values && filter.values.length !== 2) {
1125
- errors.push("Value is required");
1126
- }
1127
- }
1128
- return errors;
1129
- };
1130
- const isFilter = (filter) => {
1131
- return filter.operator !== void 0 && filter.field !== void 0 && filter.type !== void 0;
1132
- };
1133
- const TypeToOperatorOptions = {
1134
- select: [
1135
- { label: "is any of", value: "equals" },
1136
- { label: "is not any of", value: "notEqual" },
1137
- { label: "has no value", value: "blank" },
1138
- { label: "has any value", value: "notBlank" }
1139
- ],
1140
- number: [
1141
- { label: "is", value: "equals" },
1142
- { label: "is not", value: "notEqual" },
1143
- { label: "is greater than", value: "greaterThan" },
1144
- { label: "is greater than or equal to", value: "greaterThanOrEqual" },
1145
- { label: "is less than", value: "lessThan" },
1146
- { label: "is less than or equal to", value: "lessThanOrEqual" },
1147
- { label: "has no value", value: "blank" },
1148
- { label: "has any value", value: "notBlank" },
1149
- { label: "is between", value: "inRange" }
1150
- ],
1151
- text: [
1152
- { label: "contains", value: "contains" },
1153
- { label: "does not contain", value: "notContains" },
1154
- { label: "starts with", value: "startsWith" },
1155
- { label: "ends with", value: "endsWith" },
1156
- { label: "has no value", value: "blank" },
1157
- { label: "has any value", value: "notBlank" }
1158
- ]
1159
- };
1160
- const buildValueInputConfig = (config, operator) => {
1161
- if (config.type === "select") {
1162
- if (operator === "blank" || operator === "notBlank") return;
1163
- return {
1164
- type: "select",
1165
- valueOptions: config.options || []
1166
- };
1167
- }
1168
- if (config.type === "number") {
1169
- if (operator === "blank" || operator === "notBlank") return;
1170
- return {
1171
- type: "number",
1172
- inputCount: operator === "inRange" ? 2 : 1,
1173
- numberOptions: config.options
1174
- };
1175
- }
1176
- if (config.type === "text") {
1177
- if (operator === "blank" || operator === "notBlank") return;
1178
- return {
1179
- type: "text"
1180
- };
1181
- }
1182
- };
1183
- const filterFieldReducer = (state, action) => {
1184
- var _a, _b, _c;
1185
- switch (action.type) {
1186
- case "setField": {
1187
- const config = state.filterConfigs.find(
1188
- (config2) => config2.field === action.payload
1189
- );
1190
- if (!config) return state;
1191
- const operatorOptions = config ? TypeToOperatorOptions[config.type] : [];
1192
- const newFilter = {
1193
- ...state.filter,
1194
- type: config.type,
1195
- field: action.payload,
1196
- operator: operatorOptions[0].value,
1197
- values: []
1198
- };
1199
- const pendingFilter = {
1200
- ...newFilter,
1201
- errors: validateFormFilter(newFilter)
1202
- };
1203
- return {
1204
- ...state,
1205
- filter: pendingFilter,
1206
- config,
1207
- operatorOptions,
1208
- valueInputConfig: operatorOptions.length > 0 ? buildValueInputConfig(config, operatorOptions[0].value) : void 0
1209
- };
1210
- }
1211
- case "setOperator": {
1212
- if (!state.config) return state;
1213
- if (!action.payload) return state;
1214
- const pendingFilter = {
1215
- ...state.filter,
1216
- operator: action.payload,
1217
- values: []
1218
- };
1219
- return {
1220
- ...state,
1221
- filter: {
1222
- ...pendingFilter,
1223
- errors: validateFormFilter(pendingFilter)
1224
- },
1225
- valueInputConfig: buildValueInputConfig(state.config, action.payload)
1226
- };
1227
- }
1228
- case "setValues": {
1229
- if (!state.filter) return state;
1230
- const values = state.filter.type === "number" ? action.payload.map((value) => Number(value)) : action.payload.filter(
1231
- (value) => value !== null && value !== void 0
1232
- );
1233
- const pendingFilter = {
1234
- ...state.filter,
1235
- values
1236
- };
1237
- pendingFilter.errors = validateFormFilter(pendingFilter);
1238
- return {
1239
- ...state,
1240
- filter: pendingFilter
1241
- };
1242
- }
1243
- case "initialize": {
1244
- const field = ((_a = state.filter) == null ? void 0 : _a.field) || ((_b = state.filterConfigs.find((config2) => !config2.disabled)) == null ? void 0 : _b.field);
1245
- const config = state.filterConfigs.find(
1246
- (config2) => config2.field === field
1247
- );
1248
- if (!config) return state;
1249
- const operatorOptions = config ? TypeToOperatorOptions[config.type] : [];
1250
- const operator = ((_c = state.filter) == null ? void 0 : _c.operator) || operatorOptions[0].value;
1251
- const filter = state.filter ?? {
1252
- field,
1253
- type: config.type,
1254
- operator,
1255
- values: []
1256
- };
1257
- const errors = validateFormFilter(filter);
1258
- filter.errors = errors;
1259
- return {
1260
- ...state,
1261
- config,
1262
- filter,
1263
- operatorOptions,
1264
- valueInputConfig: operatorOptions.length > 0 ? buildValueInputConfig(config, operator) : void 0
1265
- };
1266
- }
1267
- default:
1268
- return state;
1269
- }
1270
- };
1271
- const useFilterField = ({
1272
- filterConfigs,
1273
- filter: initialFilter
1274
- }) => {
1275
- const [{ filter, config, operatorOptions, valueInputConfig }, dispatch] = React__namespace.useReducer(
1276
- filterFieldReducer,
1277
- {
1278
- filter: initialFilter,
1279
- filterConfigs,
1280
- config: void 0,
1281
- operatorOptions: [],
1282
- valueInputConfig: void 0
1283
- },
1284
- (state) => {
1285
- return filterFieldReducer(state, {
1286
- type: "initialize",
1287
- payload: void 0
1288
- });
1289
- }
1290
- );
1291
- const handleFieldChange = (value) => {
1292
- dispatch({
1293
- type: "setField",
1294
- payload: value
1295
- });
1296
- };
1297
- const handleOperatorChange = (value) => {
1298
- dispatch({
1299
- type: "setOperator",
1300
- payload: value
1301
- });
1302
- };
1303
- const handleValuesChange = (value) => {
1304
- dispatch({
1305
- type: "setValues",
1306
- payload: value
1307
- });
1308
- };
1309
- return {
1310
- filter,
1311
- config,
1312
- operatorOptions,
1313
- valueInputConfig,
1314
- handleFieldChange,
1315
- handleOperatorChange,
1316
- handleValuesChange
1317
- };
1318
- };
1319
- const FilterInput = ({
1320
- value,
1321
- filterConfigs,
1322
- onChange,
1323
- onBlur,
1324
- className,
1325
- size = "middle"
1326
- }) => {
1327
- const {
1328
- filter,
1329
- operatorOptions,
1330
- valueInputConfig,
1331
- handleFieldChange,
1332
- handleOperatorChange,
1333
- handleValuesChange
1334
- } = useFilterField({
1335
- filterConfigs,
1336
- filter: value
1337
- });
1338
- const fieldOptions = filterConfigs.map((config) => ({
1339
- label: config.label,
1340
- value: config.field,
1341
- disabled: config.disabled
1342
- }));
1343
- const handleBlur = () => {
1344
- if (filter) {
1345
- onBlur == null ? void 0 : onBlur(filter);
1346
- }
1347
- };
1348
- const isInitialMount = React__namespace.useRef(true);
1349
- const prevFilterRef = React__namespace.useRef(filter);
1350
- React__namespace.useEffect(() => {
1351
- if (isInitialMount.current) {
1352
- isInitialMount.current = false;
1353
- prevFilterRef.current = filter;
1354
- return;
1355
- }
1356
- if (filter && filter !== prevFilterRef.current) {
1357
- prevFilterRef.current = filter;
1358
- onChange == null ? void 0 : onChange(filter);
1359
- }
1360
- }, [filter, onChange]);
1361
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx("grid grid-cols-3 gap-2", className), children: [
1362
- /* @__PURE__ */ jsxRuntime.jsx(
1363
- antd.Select,
1364
- {
1365
- options: fieldOptions,
1366
- value: filter == null ? void 0 : filter.field,
1367
- showSearch: true,
1368
- optionFilterProp: "label",
1369
- onChange: handleFieldChange,
1370
- size
1371
- }
1372
- ),
1373
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-2 flex gap-2", children: [
1374
- /* @__PURE__ */ jsxRuntime.jsx(
1375
- antd.Select,
1376
- {
1377
- options: operatorOptions,
1378
- value: filter == null ? void 0 : filter.operator,
1379
- onChange: handleOperatorChange,
1380
- onBlur: handleBlur,
1381
- size,
1382
- popupMatchSelectWidth: false
1383
- }
1384
- ),
1385
- valueInputConfig && /* @__PURE__ */ jsxRuntime.jsx(
1386
- ValueInput,
1387
- {
1388
- valueInputConfig,
1389
- values: filter == null ? void 0 : filter.values,
1390
- onChange: handleValuesChange,
1391
- onBlur: handleBlur,
1392
- size
1393
- }
1394
- )
1395
- ] })
1396
- ] });
1397
- };
1398
- const ValueInput = ({
1399
- valueInputConfig,
1400
- values,
1401
- onChange,
1402
- onBlur,
1403
- size
1404
- }) => {
1405
- const handleChange = (value) => {
1406
- if (value === null) {
1407
- onChange([]);
1408
- } else {
1409
- onChange([value]);
1410
- }
1411
- };
1412
- const handleNumberChange = (value, index2) => {
1413
- const newValues = [
1414
- ...values ?? []
1415
- ];
1416
- newValues[index2] = value;
1417
- onChange(newValues);
1418
- };
1419
- switch (valueInputConfig.type) {
1420
- case "select":
1421
- return /* @__PURE__ */ jsxRuntime.jsx(
1422
- antd.Select,
1423
- {
1424
- options: valueInputConfig.valueOptions,
1425
- onChange,
1426
- showSearch: true,
1427
- allowClear: true,
1428
- mode: "multiple",
1429
- onBlur,
1430
- value: values,
1431
- className: "w-full truncate",
1432
- size,
1433
- optionFilterProp: "label"
1434
- }
1435
- );
1436
- case "number":
1437
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-2 grow", children: Array.from({ length: valueInputConfig.inputCount }).map(
1438
- (_, index2) => /* @__PURE__ */ jsxRuntime.jsxs(React__namespace.Fragment, { children: [
1439
- index2 !== 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "my-auto", children: "and" }),
1440
- /* @__PURE__ */ jsxRuntime.jsx(
1441
- antd.InputNumber,
1442
- {
1443
- onChange: (value) => handleNumberChange(value, index2),
1444
- onBlur,
1445
- value: values == null ? void 0 : values[index2],
1446
- className: "basis-1/2",
1447
- size,
1448
- ...valueInputConfig.numberOptions ?? {}
1449
- }
1450
- )
1451
- ] }, `number-input-${index2}`)
1452
- ) });
1453
- case "text":
1454
- return /* @__PURE__ */ jsxRuntime.jsx(
1455
- antd.Input,
1456
- {
1457
- onBlur,
1458
- value: (values == null ? void 0 : values[0]) ?? void 0,
1459
- onChange: (e) => handleChange(e.target.value),
1460
- className: "w-full",
1461
- size
1462
- }
1463
- );
1464
- default:
1465
- return null;
1466
- }
1467
- };
1468
- const copyFilterGroups = (filterGroups) => {
1469
- return cloneDeep(filterGroups);
1470
- };
1471
- const addFilter = (filter, filterGroups) => {
1472
- const copy = copyFilterGroups(filterGroups);
1473
- const filterGroupIndex = copy.findIndex(
1474
- (filterGroup) => filterGroup.field === filter.field
1475
- );
1476
- if (filterGroupIndex === -1) {
1477
- copy.push({ field: filter.field, filters: [filter] });
1478
- } else {
1479
- copy[filterGroupIndex].filters.push(filter);
1480
- }
1481
- return copy;
1482
- };
1483
- const removeFilter = (groupIndex, filterIndex, filterGroups) => {
1484
- const copy = copyFilterGroups(filterGroups);
1485
- copy[groupIndex].filters.splice(filterIndex, 1);
1486
- return copy.filter((group) => group.filters.length > 0);
1487
- };
1488
- const filterFormReducer = (state, action) => {
1489
- var _a;
1490
- switch (action.type) {
1491
- case "initialize": {
1492
- const filterGroups = (_a = action.payload) == null ? void 0 : _a.filters.reduce(
1493
- (acc, filter) => {
1494
- return addFilter(filter, acc);
1495
- },
1496
- [...state.filterGroups]
1497
- );
1498
- return {
1499
- ...state,
1500
- filterGroups: filterGroups ?? [],
1501
- isNewFilterInputOpen: !(filterGroups == null ? void 0 : filterGroups.length)
1502
- };
1503
- }
1504
- case "openNewFilterInput": {
1505
- return {
1506
- ...state,
1507
- isNewFilterInputOpen: true
1508
- };
1509
- }
1510
- case "addNewFilter": {
1511
- if (action.payload.errors && action.payload.errors.length > 0) {
1512
- return state;
1513
- }
1514
- const filterGroups = addFilter(action.payload, state.filterGroups);
1515
- return {
1516
- ...state,
1517
- filterGroups,
1518
- newFilter: void 0,
1519
- isNewFilterInputOpen: false
1520
- };
1521
- }
1522
- case "changeNewFilter": {
1523
- return {
1524
- ...state,
1525
- newFilter: action.payload
1526
- };
1527
- }
1528
- case "removeNewFilter": {
1529
- const allFiltersRemoved = state.filterGroups.every(
1530
- (group) => group.filters.length === 0
1531
- );
1532
- return {
1533
- ...state,
1534
- newFilter: void 0,
1535
- isNewFilterInputOpen: allFiltersRemoved
1536
- };
1537
- }
1538
- case "updateFilter": {
1539
- const { groupIndex, filterIndex, filter } = action.payload;
1540
- let filterGroups = copyFilterGroups(state.filterGroups);
1541
- const groupField = filterGroups[groupIndex].field;
1542
- if (groupField === filter.field) {
1543
- filterGroups[groupIndex].filters[filterIndex] = filter;
1544
- } else {
1545
- filterGroups = removeFilter(groupIndex, filterIndex, filterGroups);
1546
- filterGroups = addFilter(filter, filterGroups);
1547
- }
1548
- return {
1549
- ...state,
1550
- filterGroups
1551
- };
1552
- }
1553
- case "changeFilter": {
1554
- const { groupIndex, filterIndex, filter } = action.payload;
1555
- const filterGroups = copyFilterGroups(state.filterGroups);
1556
- const group = filterGroups[groupIndex];
1557
- if (group) {
1558
- group.filters[filterIndex] = filter;
1559
- }
1560
- return {
1561
- ...state,
1562
- filterGroups
1563
- };
1564
- }
1565
- case "removeFilter": {
1566
- const { groupIndex, filterIndex } = action.payload;
1567
- const filterGroups = removeFilter(
1568
- groupIndex,
1569
- filterIndex,
1570
- state.filterGroups
1571
- );
1572
- return {
1573
- ...state,
1574
- filterGroups,
1575
- isNewFilterInputOpen: state.isNewFilterInputOpen || filterGroups.length === 0
1576
- };
1577
- }
1578
- case "clearAllFilters": {
1579
- return {
1580
- ...state,
1581
- filterGroups: [],
1582
- isNewFilterInputOpen: true
1583
- };
1584
- }
1585
- default:
1586
- return state;
1587
- }
1588
- };
1589
- const useFiltersForm = ({
1590
- initialValues
1591
- }) => {
1592
- const [{ filterGroups, newFilter, isNewFilterInputOpen }, dispatch] = React.useReducer(
1593
- filterFormReducer,
1594
- {
1595
- filterGroups: [],
1596
- newFilter: void 0,
1597
- isNewFilterInputOpen: true
1598
- },
1599
- (state) => {
1600
- return filterFormReducer(state, {
1601
- type: "initialize",
1602
- payload: initialValues
1603
- });
1604
- }
1605
- );
1606
- const isValid = (filterGroups.length === 0 || filterGroups.every(
1607
- (group) => group.filters.every(
1608
- (filter) => filter.errors && filter.errors.length === 0
1609
- )
1610
- )) && ((newFilter == null ? void 0 : newFilter.errors) ? newFilter.errors.length === 0 : true);
1611
- const isEmpty = filterGroups.length === 0 && (newFilter ? isEmptyFormFilter(newFilter) : true);
1612
- return {
1613
- dispatch,
1614
- filterGroups,
1615
- newFilter,
1616
- isNewFilterInputOpen,
1617
- isValid,
1618
- isEmpty
1619
- };
1620
- };
1621
- const FilterGroup = ({
1622
- filterGroup,
1623
- groupIndex,
1624
- filterConfigs,
1625
- className,
1626
- onRemove,
1627
- onChange,
1628
- onDone
1629
- }) => {
1630
- return /* @__PURE__ */ jsxRuntime.jsx(
1631
- "div",
1632
- {
1633
- className: cx(
1634
- "flex flex-col gap-4",
1635
- {
1636
- [s$4.filterFormGroupContainer]: filterGroup.filters.length > 1,
1637
- "p-3": filterGroup.filters.length > 1,
1638
- "pr-3": filterGroup.filters.length === 1
1639
- },
1640
- className
1641
- ),
1642
- children: filterGroup.filters.map((filter, filterIndex) => /* @__PURE__ */ jsxRuntime.jsxs(
1643
- "div",
1644
- {
1645
- className: "flex items-center justify-between",
1646
- children: [
1647
- filterIndex >= 1 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx(s$4.filterFormConjunction, "mr-3"), children: "and" }),
1648
- /* @__PURE__ */ jsxRuntime.jsx(
1649
- FilterInput,
1650
- {
1651
- value: filter,
1652
- filterConfigs,
1653
- className: "flex-1",
1654
- onChange: (filter2) => onChange(filter2, filterIndex),
1655
- onBlur: (filter2) => onDone(filter2, filterIndex)
1656
- },
1657
- `${groupIndex}:${filterIndex}`
1658
- ),
1659
- /* @__PURE__ */ jsxRuntime.jsx(
1660
- Button,
1661
- {
1662
- type: "text",
1663
- icon: /* @__PURE__ */ jsxRuntime.jsx(react$1.TrashIcon, {}),
1664
- onClick: () => onRemove(filterIndex)
1665
- }
1666
- )
1667
- ]
1668
- },
1669
- `${groupIndex}:${filterIndex}-input-container`
1670
- ))
1671
- },
1672
- filterGroup.field
1673
- );
1674
- };
1675
- const FiltersForm = ({
1676
- title,
1677
- filterConfigs,
1678
- onSubmit,
1679
- initialValues,
1680
- maxFiltersPerField = 5
1681
- }) => {
1682
- const { dispatch, filterGroups, isNewFilterInputOpen, isValid, isEmpty } = useFiltersForm({
1683
- initialValues
1684
- });
1685
- const handleSubmit = () => {
1686
- onSubmit({
1687
- filters: filterGroups.flatMap((group) => group.filters).filter((filter) => isFilter(filter)).filter((filter) => !isEmptyFilter(filter))
1688
- });
1689
- };
1690
- const availableFilterConfigs = React.useMemo(() => {
1691
- const filterFieldCounts = filterGroups.reduce(
1692
- (acc, filterGroup) => {
1693
- acc[filterGroup.field] = filterGroup.filters.length;
1694
- return acc;
1695
- },
1696
- {}
1697
- );
1698
- return filterConfigs.map((config) => ({
1699
- ...config,
1700
- disabled: (filterFieldCounts[config.field] || 0) >= maxFiltersPerField
1701
- }));
1702
- }, [
1703
- filterConfigs,
1704
- filterGroups.map((g) => `${g.field}-${g.filters.length}`).join(","),
1705
- maxFiltersPerField
1706
- ]);
1707
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx(s$4.j2FilterForm), children: [
1708
- /* @__PURE__ */ jsxRuntime.jsxs(
1709
- "div",
1710
- {
1711
- className: cx(
1712
- s$4.filterFormFieldsContainer,
1713
- "flex flex-col gap-4",
1714
- "p-4 mb-6"
1715
- ),
1716
- children: [
1717
- title && /* @__PURE__ */ jsxRuntime.jsx("span", { className: s$4.filterFormTitle, children: title }),
1718
- filterGroups.map((filterGroup, groupIndex) => /* @__PURE__ */ jsxRuntime.jsxs(
1719
- "div",
1720
- {
1721
- className: cx("flex gap-3", {
1722
- "items-center": filterGroup.filters.length === 1
1723
- }),
1724
- children: [
1725
- groupIndex > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
1726
- "span",
1727
- {
1728
- className: cx(s$4.filterFormConjunction, {
1729
- "pt-4": filterGroup.filters.length > 1
1730
- }),
1731
- children: "and"
1732
- }
1733
- ) : null,
1734
- /* @__PURE__ */ jsxRuntime.jsx(
1735
- FilterGroup,
1736
- {
1737
- filterGroup,
1738
- groupIndex,
1739
- filterConfigs: availableFilterConfigs,
1740
- className: "grow",
1741
- onChange: (filter, filterIndex) => {
1742
- dispatch({
1743
- type: "changeFilter",
1744
- payload: { groupIndex, filterIndex, filter }
1745
- });
1746
- },
1747
- onDone: (filter, filterIndex) => {
1748
- dispatch({
1749
- type: "updateFilter",
1750
- payload: { groupIndex, filterIndex, filter }
1751
- });
1752
- },
1753
- onRemove: (filterIndex) => {
1754
- dispatch({
1755
- type: "removeFilter",
1756
- payload: { groupIndex, filterIndex }
1757
- });
1758
- }
1759
- }
1760
- )
1761
- ]
1762
- },
1763
- `filter-group-${filterGroup.field}-${filterGroup.filters.length}`
1764
- )),
1765
- isNewFilterInputOpen && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx("flex gap-3 items-center"), children: [
1766
- filterGroups.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx(s$4.filterFormConjunction), children: "and" }) : null,
1767
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx("flex items-center justify-between", "grow"), children: [
1768
- /* @__PURE__ */ jsxRuntime.jsx(
1769
- FilterInput,
1770
- {
1771
- filterConfigs: availableFilterConfigs,
1772
- className: "flex-1",
1773
- onChange: (filter) => {
1774
- dispatch({ type: "changeNewFilter", payload: filter });
1775
- },
1776
- onBlur: (filter) => {
1777
- dispatch({ type: "addNewFilter", payload: filter });
1778
- }
1779
- },
1780
- JSON.stringify(filterGroups)
1781
- ),
1782
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mr-3", children: filterGroups.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
1783
- Button,
1784
- {
1785
- type: "text",
1786
- icon: /* @__PURE__ */ jsxRuntime.jsx(react$1.TrashIcon, {}),
1787
- onClick: () => dispatch({ type: "removeNewFilter" })
1788
- }
1789
- ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-8" }) })
1790
- ] })
1791
- ] }),
1792
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center", children: [
1793
- /* @__PURE__ */ jsxRuntime.jsx(
1794
- Button,
1795
- {
1796
- icon: /* @__PURE__ */ jsxRuntime.jsx(react$1.PlusCircleIcon, {}),
1797
- onClick: () => dispatch({ type: "openNewFilterInput" }),
1798
- disabled: !isValid,
1799
- children: "Add Rule"
1800
- }
1801
- ),
1802
- /* @__PURE__ */ jsxRuntime.jsx(
1803
- Button,
1804
- {
1805
- type: "text",
1806
- onClick: () => {
1807
- dispatch({
1808
- type: "clearAllFilters"
1809
- });
1810
- },
1811
- children: "Clear All Rules"
1812
- }
1813
- )
1814
- ] })
1815
- ]
1816
- }
1817
- ),
1818
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxRuntime.jsx(
1819
- Button,
1820
- {
1821
- onClick: handleSubmit,
1822
- type: "primary",
1823
- disabled: isEmpty ? false : !isValid,
1824
- children: "Apply Filters"
1825
- }
1826
- ) })
1827
- ] });
1828
- };
1829
- const Form = ({ children, ...props }) => {
1830
- return /* @__PURE__ */ jsxRuntime.jsx(formikAntd.Form, { ...props, children });
1831
- };
1832
- Form.Item = formikAntd.FormItem;
1833
- const Input = ({ size = "large", ...props }) => {
1834
- return /* @__PURE__ */ jsxRuntime.jsx(formikAntd.Input, { size, ...props });
1835
- };
1836
- const AntdInput = React.forwardRef(
1837
- ({ size = "large", ...props }, ref) => {
1838
- return /* @__PURE__ */ jsxRuntime.jsx(antd.Input, { ref, size, ...props });
1839
- }
1840
- );
1841
- AntdInput.displayName = "AntdInput";
1842
- const AntdSearchInput = React.forwardRef(
1843
- ({ size = "large", ...props }, ref) => {
1844
- return /* @__PURE__ */ jsxRuntime.jsx(antd.Input.Search, { ref, size, ...props });
1845
- }
1846
- );
1847
- AntdSearchInput.displayName = "AntdSearchInput";
1848
- const j2InputNumber = "_j2InputNumber_1jmfn_1";
1849
- const styles$8 = {
1850
- j2InputNumber
1851
- };
1852
- const InputNumber = ({
1853
- size = "large",
1854
- step = 1,
1855
- name,
1856
- max,
1857
- min,
1858
- ...props
1859
- }) => {
1860
- return /* @__PURE__ */ jsxRuntime.jsx(
1861
- formikAntd.InputNumber,
1862
- {
1863
- name,
1864
- max,
1865
- min,
1866
- step,
1867
- className: cx(styles$8.j2InputNumber, props.className),
1868
- upHandler: /* @__PURE__ */ jsxRuntime.jsx(react$1.CaretUpIcon, { weight: "bold", size: 12 }),
1869
- downHandler: /* @__PURE__ */ jsxRuntime.jsx(react$1.CaretDownIcon, { weight: "bold", size: 12 }),
1870
- size,
1871
- ...props
1872
- }
1873
- );
1874
- };
1875
- const j2Popover = "_j2Popover_1egkj_1";
1876
- const smallPadding = "_smallPadding_1egkj_6";
1877
- const smPadding = "_smPadding_1egkj_7";
1878
- const xxsPadding = "_xxsPadding_1egkj_11";
1879
- const xsPadding = "_xsPadding_1egkj_15";
1880
- const mdPadding = "_mdPadding_1egkj_19";
1881
- const xlPadding = "_xlPadding_1egkj_23";
1882
- const popoverHeader = "_popoverHeader_1egkj_34";
1883
- const scrollable = "_scrollable_1egkj_40";
1884
- const styles$7 = {
1885
- j2Popover,
1886
- smallPadding,
1887
- smPadding,
1888
- xxsPadding,
1889
- xsPadding,
1890
- mdPadding,
1891
- xlPadding,
1892
- popoverHeader,
1893
- scrollable
1894
- };
1895
- const Popover = ({
1896
- children,
1897
- placement = "top",
1898
- scrollable: scrollable2 = false,
1899
- contentPadding = true,
1900
- content,
1901
- smallPadding: smallPadding2 = false,
1902
- paddingSize,
1903
- arrow = false,
1904
- ...props
1905
- }) => {
1906
- return /* @__PURE__ */ jsxRuntime.jsx(
1907
- antd.Popover,
1908
- {
1909
- overlayClassName: cx(
1910
- styles$7.j2Popover,
1911
- scrollable2 && styles$7.scrollable,
1912
- smallPadding2 && styles$7.smallPadding,
1913
- paddingSize && styles$7[`${paddingSize}Padding`]
1914
- ),
1915
- ...props,
1916
- placement,
1917
- arrow,
1918
- content: () => {
1919
- if (!contentPadding) {
1920
- return /* @__PURE__ */ jsxRuntime.jsx("div", { children: typeof content == "function" ? content() : content });
1921
- }
1922
- return typeof content == "function" ? content() : content;
1923
- },
1924
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { children })
1925
- }
1926
- );
1927
- };
1928
- const Tooltip = ({
1929
- children,
1930
- placement = "top",
1931
- arrow = false,
1932
- ...props
1933
- }) => {
1934
- return /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { ...props, placement, arrow, children: /* @__PURE__ */ jsxRuntime.jsx("div", { children }) });
1935
- };
1936
- const categoryName = "_categoryName_jejns_1";
1937
- const s$3 = {
1938
- categoryName
1939
- };
1940
- const CopyButton = ({
1941
- openMessage,
1942
- textToCopy
1943
- }) => /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { title: "Copy to Clipboard", className: "ml-2", arrow: false, children: /* @__PURE__ */ jsxRuntime.jsx(
1944
- Button,
1945
- {
1946
- type: "text",
1947
- icon: /* @__PURE__ */ jsxRuntime.jsx(
1948
- react$1.CopyIcon,
1949
- {
1950
- onClick: () => {
1951
- navigator.clipboard.writeText(textToCopy);
1952
- openMessage("success", "Copied to Clipboard");
1953
- }
1954
- }
1955
- )
1956
- }
1957
- ) });
1958
- const StringListItem = ({
1959
- item,
1960
- openMessage,
1961
- renderItem
1962
- }) => {
1963
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx("flex items-center"), children: [
1964
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx("overflow-hidden text-nowrap text-ellipsis"), children: renderItem ? renderItem(item) : item }),
1965
- /* @__PURE__ */ jsxRuntime.jsx(CopyButton, { openMessage, textToCopy: item })
1966
- ] }, item);
1967
- };
1968
- const ObjectListItem = ({
1969
- item,
1970
- openMessage,
1971
- index: index2,
1972
- renderItem
1973
- }) => {
1974
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx({ "mt-2": index2 != 0 }), children: [
1975
- /* @__PURE__ */ jsxRuntime.jsx(
1976
- "p",
1977
- {
1978
- className: cx(
1979
- "overflow-hidden text-nowrap text-ellipsis",
1980
- s$3.categoryName
1981
- ),
1982
- title: item.categoryName,
1983
- children: item.categoryName
1984
- }
1985
- ),
1986
- item.items.map((subItem, index22) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx("flex items-center"), children: [
1987
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx("overflow-hidden text-nowrap text-ellipsis"), children: renderItem ? renderItem(subItem) : subItem }),
1988
- /* @__PURE__ */ jsxRuntime.jsx(CopyButton, { openMessage, textToCopy: subItem })
1989
- ] }, `${subItem}:${index22}`))
1990
- ] });
1991
- };
1992
- const PopoverContent = ({
1993
- items,
1994
- openMessage,
1995
- renderItem
1996
- }) => {
1997
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx("max-w-[400px] max-h-[198px]"), children: items.map(
1998
- (item, i) => typeof item === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
1999
- StringListItem,
2000
- {
2001
- item,
2002
- openMessage,
2003
- renderItem
2004
- },
2005
- item
2006
- ) : /* @__PURE__ */ jsxRuntime.jsx(
2007
- ObjectListItem,
2008
- {
2009
- index: i,
2010
- item,
2011
- openMessage,
2012
- renderItem
2013
- },
2014
- item.categoryName
2015
- )
2016
- ) });
2017
- };
2018
- const ListPopover = ({
2019
- children,
2020
- items,
2021
- column,
2022
- openMessage,
2023
- renderItem
2024
- }) => {
2025
- return /* @__PURE__ */ jsxRuntime.jsx(
2026
- Popover,
2027
- {
2028
- title: `${column} (${items.length})`,
2029
- content: /* @__PURE__ */ jsxRuntime.jsx(
2030
- PopoverContent,
2031
- {
2032
- items,
2033
- openMessage,
2034
- renderItem
2035
- }
2036
- ),
2037
- trigger: "click",
2038
- scrollable: true,
2039
- arrow: false,
2040
- contentPadding: false,
2041
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
2042
- Button,
2043
- {
2044
- className: cx(
2045
- "p-0 h-auto w-full overflow-hidden text-left justify-start"
2046
- ),
2047
- type: items.length > 0 ? "link" : "text",
2048
- children
2049
- }
2050
- ) })
2051
- }
2052
- );
2053
- };
2054
- const j2Menu = "_j2Menu_11mko_1";
2055
- const compact = "_compact_11mko_15";
2056
- const styles$6 = {
2057
- j2Menu,
2058
- compact
2059
- };
2060
- const Menu = ({ compact: compact2 = false, ...props }) => {
2061
- return /* @__PURE__ */ jsxRuntime.jsx(
2062
- antd.Menu,
2063
- {
2064
- className: cx(styles$6.j2Menu, compact2 && styles$6.compact),
2065
- ...props,
2066
- inlineCollapsed: compact2
2067
- }
2068
- );
2069
- };
2070
- const messageIcon = "_messageIcon_1k9xp_1";
2071
- const styles$5 = {
2072
- messageIcon
2073
- };
2074
- const getIcon$1 = (type) => {
2075
- switch (type) {
2076
- case "success":
2077
- return /* @__PURE__ */ jsxRuntime.jsx(
2078
- react$1.CheckCircleIcon,
2079
- {
2080
- weight: "fill",
2081
- color: "var(--j2-color-success)",
2082
- size: 16,
2083
- className: cx(styles$5.messageIcon)
2084
- }
2085
- );
2086
- case "warning":
2087
- return /* @__PURE__ */ jsxRuntime.jsx(
2088
- react$1.WarningCircleIcon,
2089
- {
2090
- weight: "fill",
2091
- color: "var(--j2-color-warning)",
2092
- size: 16,
2093
- className: cx(styles$5.messageIcon)
2094
- }
2095
- );
2096
- case "error":
2097
- return /* @__PURE__ */ jsxRuntime.jsx(
2098
- react$1.XCircleIcon,
2099
- {
2100
- weight: "fill",
2101
- color: "var(--j2-color-error)",
2102
- size: 16,
2103
- className: cx(styles$5.messageIcon)
2104
- }
2105
- );
2106
- }
2107
- };
2108
- const useMessage = () => {
2109
- const [messageApi, contextHolder] = antd.message.useMessage();
2110
- const openMessage = (type, messageContent) => {
2111
- messageApi.open({
2112
- type,
2113
- icon: getIcon$1(type),
2114
- content: messageContent,
2115
- className: cx({ styles: styles$5 })
2116
- });
2117
- };
2118
- return { openMessage, contextHolder };
2119
- };
2120
- const Modal = ({
2121
- open,
2122
- title,
2123
- children,
2124
- onCancel,
2125
- withContentPadding: withPadding = true,
2126
- ...props
2127
- }) => {
2128
- return /* @__PURE__ */ jsxRuntime.jsx(
2129
- antd.Modal,
2130
- {
2131
- title,
2132
- className: cx("j2-modal"),
2133
- maskClosable: true,
2134
- centered: true,
2135
- closeIcon: /* @__PURE__ */ jsxRuntime.jsx(react$1.XIcon, { size: 22, weight: "regular" }),
2136
- onCancel,
2137
- open,
2138
- ...props,
2139
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx(withPadding ? "px-6 py-3" : "px-0 py-0"), children })
2140
- }
2141
- );
2142
- };
2143
- const SvgJ2LogoMenuCollapse = (props) => /* @__PURE__ */ React__namespace.createElement("svg", { width: 32, height: 32, viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React__namespace.createElement("path", { d: "M30.3968 25.6H27.392C26.9664 25.6 26.56 25.7696 26.2592 26.0672L26.064 26.2624C25.7632 26.5632 25.5968 26.9696 25.5968 27.3952V30.4C25.5968 31.2832 24.88 32 23.9968 32H20.7968C19.9136 32 19.1968 31.2832 19.1968 30.4V27.3952C19.1968 26.9696 19.0272 26.5632 18.7296 26.2624L18.5344 26.0672C18.2336 25.7664 17.8272 25.6 17.4016 25.6H14.3968C13.5136 25.6 12.7968 24.8832 12.7968 24V20.8C12.7968 19.9168 13.5136 19.2 14.3968 19.2H17.5968C18.48 19.2 19.1968 19.9168 19.1968 20.8V23.8048C19.1968 24.2304 19.3664 24.6368 19.664 24.9376L19.8592 25.1328C20.16 25.4336 20.5664 25.6 20.992 25.6H23.8048C24.2304 25.6 24.6368 25.4304 24.9376 25.1328L25.1328 24.9376C25.4336 24.6368 25.6 24.2304 25.6 23.8048V8.00002C25.6 7.11682 26.3168 6.40002 27.2 6.40002H30.4C31.2832 6.40002 32 7.11682 32 8.00002V24C32 24.8832 31.2832 25.6 30.4 25.6H30.3968Z", fill: "#253761" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M8.192 6.39999H11.0048C11.4304 6.39999 11.8368 6.56959 12.1376 6.86719L12.3328 7.06239C12.6336 7.36319 12.8 7.76959 12.8 8.19519V11.2C12.8 12.0832 13.5168 12.8 14.4 12.8H17.6C18.4832 12.8 19.2 12.0832 19.2 11.2V7.99999C19.2 7.11679 18.4832 6.39999 17.6 6.39999H14.5952C14.1696 6.39999 13.7632 6.23039 13.4624 5.93279L13.2672 5.73759C12.9664 5.43679 12.8 5.03039 12.8 4.60479V1.6C12.8 0.716799 12.0832 0 11.2 0H8C7.1168 0 6.4 0.716799 6.4 1.6V4.60479C6.4 5.03039 6.2304 5.43679 5.9328 5.73759L5.7376 5.93279C5.4368 6.23359 5.0304 6.39999 4.6048 6.39999H1.6C0.7168 6.39999 0 7.11679 0 7.99999V24C0 24.8832 0.7168 25.6 1.6 25.6H4.8C5.6832 25.6 6.4 24.8832 6.4 24V8.19519C6.4 7.76959 6.5696 7.36319 6.8672 7.06239L7.0624 6.86719C7.3632 6.56639 7.7696 6.39999 8.1952 6.39999H8.192Z", fill: "#253761" }));
2144
- const SvgJ2LogoMenu = (props) => /* @__PURE__ */ React__namespace.createElement("svg", { width: 152, height: 32, viewBox: "0 0 152 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React__namespace.createElement("path", { d: "M44.9576 22.7691C46.6563 22.7691 47.6449 21.8637 47.6449 19.5891V6.39841H50.8536V20.4113C50.8536 23.8121 48.7966 25.8149 45.8629 25.8149C45.4502 25.8149 44.8488 25.8149 44.3561 25.7061V22.7723H44.9608L44.9576 22.7691Z", fill: "#383842" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M53.3582 23.2619L60.0476 16.6522C62.0215 14.7038 62.9812 13.5809 62.9812 12.074C62.9812 10.4296 61.6376 9.24902 59.8557 9.24902C57.6898 9.24902 56.3462 10.7303 56.4294 13.0882H53.195C53.0575 8.8939 55.9367 6.12332 59.9132 6.12332C63.5891 6.12332 66.2763 8.56438 66.2763 11.9908C66.2763 14.3775 64.7152 16.4346 62.3286 18.6805L58.544 22.4653H66.4139V25.591H53.3614V23.2587L53.3582 23.2619Z", fill: "#383842" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M89.7255 6.39844V25.5941H86.5168V17.1768H77.2201V25.5941H74.0114V6.39844H77.2201V14.1055H86.5168V6.39844H89.7255Z", fill: "#383842" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M91.5684 18.847C91.5684 14.9247 94.614 11.9078 98.4786 11.9078C102.097 11.9078 105.005 14.7327 105.005 18.4631C105.005 18.7382 104.976 19.3141 104.95 19.6149H94.4476C94.7228 21.8096 96.284 23.262 98.5074 23.262C100.235 23.262 101.55 22.4398 101.825 21.1793H104.842C104.375 24.0299 101.796 25.8695 98.5362 25.8695C94.614 25.8695 91.5716 22.8237 91.5716 18.8502L91.5684 18.847ZM101.77 17.3945C101.607 15.7213 100.181 14.4864 98.3442 14.4864C96.5079 14.4864 95.1099 15.5294 94.614 17.3945H101.77Z", fill: "#383842" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M120.773 25.5944H117.702V23.1821C116.743 24.8809 115.098 25.8695 112.932 25.8695C109.34 25.8695 106.515 22.7438 106.515 18.8759C106.515 15.0079 109.34 11.911 112.932 11.911C115.098 11.911 116.743 12.8996 117.702 14.5984V12.1862H120.773V25.5944ZM113.591 22.9614C115.924 22.9614 117.677 21.2082 117.677 18.8759C117.677 16.5436 115.92 14.816 113.591 14.816C111.262 14.816 109.532 16.6268 109.532 18.8759C109.532 21.125 111.314 22.9614 113.591 22.9614Z", fill: "#383842" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M126.708 25.5942H123.666V6.39847H126.708V25.5942Z", fill: "#383842" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M130.688 20.549V15.091H128.138V12.1828H130.688V8.59003H133.759V12.1828H137.268V15.091H133.759V20.4946C133.759 22.1934 134.802 22.8812 136.283 22.8812C136.612 22.8812 136.968 22.8524 137.271 22.7725V25.5974C136.804 25.7062 136.12 25.7606 135.627 25.7606C132.665 25.7606 130.691 23.9498 130.691 20.549H130.688Z", fill: "#383842" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M142.403 6.39847V14.2975C143.254 12.7906 144.652 11.9108 146.434 11.9108C149.889 11.9108 152 14.2143 152 17.9447V25.5942H148.954V18.3286C148.954 16.2171 147.665 14.8446 145.691 14.8446C143.717 14.8446 142.399 16.2171 142.399 18.3286V25.5942H139.357V6.39847H142.399H142.403Z", fill: "#383842" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M30.3971 25.6H27.3926C26.967 25.6 26.5607 25.7696 26.2599 26.0672L26.0647 26.2624C25.7639 26.5632 25.5976 26.9696 25.5976 27.3952V30.4C25.5976 31.2832 24.8808 32 23.9977 32H20.798C19.9149 32 19.1982 31.2832 19.1982 30.4V27.3952C19.1982 26.9696 19.0286 26.5632 18.731 26.2624L18.5359 26.0672C18.2351 25.7664 17.8287 25.6 17.4032 25.6H14.3987C13.5156 25.6 12.7988 24.8832 12.7988 24V20.8C12.7988 19.9168 13.5156 19.2 14.3987 19.2H17.5984C18.4815 19.2 19.1982 19.9168 19.1982 20.8V23.8048C19.1982 24.2304 19.3678 24.6368 19.6654 24.9376L19.8605 25.1328C20.1613 25.4336 20.5677 25.6 20.9932 25.6H23.8057C24.2313 25.6 24.6377 25.4304 24.9384 25.1328L25.1336 24.9376C25.4344 24.6368 25.6008 24.2304 25.6008 23.8048V8C25.6008 7.1168 26.3175 6.4 27.2006 6.4H30.4003C31.2834 6.4 32.0001 7.1168 32.0001 8V24C32.0001 24.8832 31.2834 25.6 30.4003 25.6H30.3971ZM8.1945 6.4H11.007C11.4326 6.4 11.8389 6.5696 12.1397 6.8672L12.3349 7.0624C12.6357 7.3632 12.802 7.7696 12.802 8.1952V11.2C12.802 12.0832 13.5188 12.8 14.4019 12.8H17.6016C18.4847 12.8 19.2014 12.0832 19.2014 11.2V8C19.2014 7.1168 18.4847 6.4 17.6016 6.4H14.5971C14.1715 6.4 13.7651 6.2304 13.4644 5.9328L13.2692 5.7376C12.9684 5.4368 12.802 5.0304 12.802 4.6048V1.6C12.802 0.7168 12.0853 0 11.2022 0H8.00252C7.11941 0 6.40268 0.7168 6.40268 1.6V4.6048C6.40268 5.0304 6.2331 5.4368 5.93553 5.7376L5.74035 5.9328C5.43958 6.2336 5.03322 6.4 4.60766 6.4H1.59996C0.71685 6.4 0.00012207 7.1168 0.00012207 8V24C0.00012207 24.8832 0.71685 25.6 1.59996 25.6H4.79964C5.68275 25.6 6.39948 24.8832 6.39948 24V8.1952C6.39948 7.7696 6.56906 7.3632 6.86663 7.0624L7.06182 6.8672C7.36259 6.5664 7.76894 6.4 8.1945 6.4Z", fill: "#253761" }));
2145
- const SvgMenuSidebarExpand = (props) => /* @__PURE__ */ React__namespace.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React__namespace.createElement("path", { opacity: 0.2, d: "M3.75049 19.5C3.55158 19.5 3.36081 19.421 3.22016 19.2803C3.07951 19.1397 3.00049 18.9489 3.00049 18.75V5.25C3.00049 5.05109 3.07951 4.86032 3.22016 4.71967C3.36081 4.57902 3.55158 4.5 3.75049 4.5H8.25049V19.5H3.75049Z", fill: "#364975" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M8.25049 4.5V19.5", stroke: "#364975", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M20.2505 4.5H3.75049C3.33627 4.5 3.00049 4.83579 3.00049 5.25V18.75C3.00049 19.1642 3.33627 19.5 3.75049 19.5H20.2505C20.6647 19.5 21.0005 19.1642 21.0005 18.75V5.25C21.0005 4.83579 20.6647 4.5 20.2505 4.5Z", stroke: "#364975", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M3.00049 7.5H5.25049", stroke: "#364975", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M3.00049 10.5H5.25049", stroke: "#364975", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M3.00049 13.5H5.25049", stroke: "#364975", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React__namespace.createElement("path", { opacity: 0.2, d: "M15.0002 14.7002L17.7002 12.0002L15.0002 9.3002V14.7002Z", fill: "#364975" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M11.1 12.0002H15", stroke: "#364975", strokeWidth: 0.6, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M15.0002 14.7002L17.7002 12.0002L15.0002 9.3002V14.7002Z", stroke: "#364975", strokeWidth: 0.6, strokeLinecap: "round", strokeLinejoin: "round" }));
2146
- const SvgMenuSidebarCollapse = (props) => /* @__PURE__ */ React__namespace.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React__namespace.createElement("path", { opacity: 0.2, d: "M3.75049 19.5C3.55158 19.5 3.36081 19.421 3.22016 19.2803C3.07951 19.1397 3.00049 18.9489 3.00049 18.75V5.25C3.00049 5.05109 3.07951 4.86032 3.22016 4.71967C3.36081 4.57902 3.55158 4.5 3.75049 4.5H8.25049V19.5H3.75049Z", fill: "#253761" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M8.25049 4.5V19.5", stroke: "#253761", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M20.2505 4.5H3.75049C3.33627 4.5 3.00049 4.83579 3.00049 5.25V18.75C3.00049 19.1642 3.33627 19.5 3.75049 19.5H20.2505C20.6647 19.5 21.0005 19.1642 21.0005 18.75V5.25C21.0005 4.83579 20.6647 4.5 20.2505 4.5Z", stroke: "#253761", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M3.00049 7.5H5.25049", stroke: "#253761", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M3.00049 10.5H5.25049", stroke: "#253761", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M3.00049 13.5H5.25049", stroke: "#253761", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React__namespace.createElement("path", { opacity: 0.2, d: "M13.8001 9.30029L11.1001 12.0003L13.8001 14.7003V9.30029Z", fill: "#253761" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M17.7005 12.0002H13.8005", stroke: "#253761", strokeWidth: 0.6, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M13.8001 9.30029L11.1001 12.0003L13.8001 14.7003V9.30029Z", stroke: "#253761", strokeWidth: 0.6, strokeLinecap: "round", strokeLinejoin: "round" }));
2147
- const navMenuContainer = "_navMenuContainer_1ul3o_1";
2148
- const collapsed = "_collapsed_1ul3o_5";
2149
- const headerContainer = "_headerContainer_1ul3o_8";
2150
- const logo$1 = "_logo_1ul3o_9";
2151
- const styles$4 = {
2152
- navMenuContainer,
2153
- collapsed,
2154
- headerContainer,
2155
- logo: logo$1
2156
- };
2157
- const NavMenu = ({
2158
- href = "/",
2159
- items,
2160
- headerSlot,
2161
- defaultOpenKeys,
2162
- defaultSelectedKeys,
2163
- footerItems,
2164
- className,
2165
- onCollapse
2166
- }) => {
2167
- const [isCollapsed, setIsCollapsed] = React__namespace.useState(false);
2168
- const [isToggleTooltipOpen, setToggleTooltipOpen] = React__namespace.useState(false);
2169
- const toggleCollapse = React__namespace.useCallback(() => {
2170
- setIsCollapsed(!isCollapsed);
2171
- setToggleTooltipOpen(false);
2172
- onCollapse == null ? void 0 : onCollapse(!isCollapsed);
2173
- }, [isCollapsed]);
2174
- return /* @__PURE__ */ jsxRuntime.jsx(
2175
- "div",
2176
- {
2177
- className: cx(
2178
- styles$4.navMenuContainer,
2179
- isCollapsed && styles$4.collapsed,
2180
- "bg-white",
2181
- className
2182
- ),
2183
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx("flex", "flex-col", "h-full"), children: [
2184
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "py-5 px-3", children: [
2185
- /* @__PURE__ */ jsxRuntime.jsxs(
2186
- "div",
2187
- {
2188
- className: cx(
2189
- "flex",
2190
- "items-center",
2191
- isCollapsed ? "justify-center" : "justify-between",
2192
- styles$4.headerContainer,
2193
- "min-h-9"
2194
- ),
2195
- children: [
2196
- /* @__PURE__ */ jsxRuntime.jsx(
2197
- "a",
2198
- {
2199
- href,
2200
- className: cx("flex", "items-center", "gap-2", styles$4.logo),
2201
- children: isCollapsed ? /* @__PURE__ */ jsxRuntime.jsx(SvgJ2LogoMenuCollapse, {}) : /* @__PURE__ */ jsxRuntime.jsx(SvgJ2LogoMenu, {})
2202
- }
2203
- ),
2204
- /* @__PURE__ */ jsxRuntime.jsx(
2205
- Tooltip,
2206
- {
2207
- title: isCollapsed ? "Expand Menu" : "Collapse Menu",
2208
- placement: "right",
2209
- arrow: false,
2210
- onOpenChange: (shouldBeOpen) => {
2211
- setToggleTooltipOpen(shouldBeOpen);
2212
- },
2213
- open: isToggleTooltipOpen,
2214
- children: /* @__PURE__ */ jsxRuntime.jsx(
2215
- Button,
2216
- {
2217
- type: "text",
2218
- icon: isCollapsed ? /* @__PURE__ */ jsxRuntime.jsx(SvgMenuSidebarExpand, {}) : /* @__PURE__ */ jsxRuntime.jsx(SvgMenuSidebarCollapse, {}),
2219
- onClick: toggleCollapse,
2220
- className: cx("toggle-button")
2221
- }
2222
- )
2223
- }
2224
- )
2225
- ]
2226
- }
2227
- ),
2228
- headerSlot && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx("mt-5"), children: headerSlot })
2229
- ] }),
2230
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx("flex", "flex-col", "justify-between", "flex-1"), children: [
2231
- /* @__PURE__ */ jsxRuntime.jsx(
2232
- Menu,
2233
- {
2234
- mode: "inline",
2235
- compact: isCollapsed,
2236
- items,
2237
- defaultOpenKeys: isCollapsed ? void 0 : defaultOpenKeys,
2238
- defaultSelectedKeys
2239
- },
2240
- `nav-menu-main-${isCollapsed}`
2241
- ),
2242
- /* @__PURE__ */ jsxRuntime.jsx(
2243
- Menu,
2244
- {
2245
- mode: "inline",
2246
- compact: isCollapsed,
2247
- selectable: false,
2248
- items: footerItems
2249
- },
2250
- `nav-menu-footer-${isCollapsed}`
2251
- )
2252
- ] })
2253
- ] })
2254
- }
2255
- );
2256
- };
2257
- const messageOnly = "_messageOnly_1pxqk_14";
2258
- const s$2 = {
2259
- messageOnly
2260
- };
2261
- const getIcon = (type) => {
2262
- switch (type) {
2263
- case "error":
2264
- return /* @__PURE__ */ jsxRuntime.jsx(react$1.XCircleIcon, { color: "var(--j2-color-error)", weight: "duotone", size: 24 });
2265
- case "success":
2266
- return /* @__PURE__ */ jsxRuntime.jsx(
2267
- react$1.CheckCircleIcon,
2268
- {
2269
- color: "var(--j2-color-success)",
2270
- weight: "duotone",
2271
- size: 24
2272
- }
2273
- );
2274
- case "info":
2275
- return /* @__PURE__ */ jsxRuntime.jsx(react$1.InfoIcon, { color: "var(--j2-color-info)", weight: "duotone", size: 24 });
2276
- case "warning":
2277
- return /* @__PURE__ */ jsxRuntime.jsx(
2278
- react$1.WarningCircleIcon,
2279
- {
2280
- color: "var(--j2-color-warning)",
2281
- weight: "duotone",
2282
- size: 24
2283
- }
2284
- );
2285
- }
2286
- };
2287
- const useNotification = () => {
2288
- const [api, contextHolder] = antd.notification.useNotification();
2289
- const openNotification = (type, config) => {
2290
- api[type]({
2291
- icon: getIcon(type),
2292
- ...config,
2293
- closeIcon: /* @__PURE__ */ jsxRuntime.jsx(react$1.XIcon, { color: "var(--j2-color-icon)", size: 22, weight: "regular" }),
2294
- className: cx({
2295
- [s$2.messageOnly]: config.message && !config.description
2296
- })
2297
- });
2298
- };
2299
- const closeNotification = (key) => {
2300
- api.destroy(key);
2301
- };
2302
- return { openNotification, closeNotification, contextHolder };
2303
- };
2304
- const modalTitleWithIcon = "_modalTitleWithIcon_5g0kf_1";
2305
- const modalIcon = "_modalIcon_5g0kf_7";
2306
- const modalTitleContent = "_modalTitleContent_5g0kf_16";
2307
- const modalTitleText = "_modalTitleText_5g0kf_21";
2308
- const modalContentWithIcon = "_modalContentWithIcon_5g0kf_30";
2309
- const styles$3 = {
2310
- modalTitleWithIcon,
2311
- modalIcon,
2312
- modalTitleContent,
2313
- modalTitleText,
2314
- modalContentWithIcon
2315
- };
2316
- const getNotificationIcon = (type) => {
2317
- switch (type) {
2318
- case "error":
2319
- return /* @__PURE__ */ jsxRuntime.jsx(react$1.XCircleIcon, { color: "var(--j2-color-error)", weight: "fill", size: 24 });
2320
- case "success":
2321
- return /* @__PURE__ */ jsxRuntime.jsx(
2322
- react$1.CheckCircleIcon,
2323
- {
2324
- color: "var(--j2-color-success)",
2325
- weight: "fill",
2326
- size: 24
2327
- }
2328
- );
2329
- case "info":
2330
- return /* @__PURE__ */ jsxRuntime.jsx(react$1.InfoIcon, { color: "var(--j2-color-info)", weight: "fill", size: 24 });
2331
- case "warning":
2332
- return /* @__PURE__ */ jsxRuntime.jsx(
2333
- react$1.WarningCircleIcon,
2334
- {
2335
- color: "var(--j2-color-warning)",
2336
- weight: "fill",
2337
- size: 24
2338
- }
2339
- );
2340
- }
2341
- };
2342
- const NotificationModal = ({
2343
- type,
2344
- title,
2345
- children,
2346
- withContentPadding = true,
2347
- ...props
2348
- }) => {
2349
- const icon = React.useMemo(() => getNotificationIcon(type), [type]);
2350
- const titleWithIcon = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles$3.modalTitleWithIcon, children: [
2351
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$3.modalIcon, children: icon }),
2352
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$3.modalTitleContent, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$3.modalTitleText, children: title }) })
2353
- ] });
2354
- return /* @__PURE__ */ jsxRuntime.jsx(
2355
- Modal,
2356
- {
2357
- title: titleWithIcon,
2358
- withContentPadding,
2359
- ...props,
2360
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$3.modalContentWithIcon, children })
2361
- }
2362
- );
2363
- };
2364
- const s$1 = {
2365
- "jump-button": "_jump-button_bwjnt_41"
2366
- };
2367
- const renderIconButton = (icon, isSmall, customClassName) => /* @__PURE__ */ jsxRuntime.jsx(
2368
- antd.Button,
2369
- {
2370
- type: "link",
2371
- size: isSmall ? "small" : "middle",
2372
- className: cx(customClassName, isSmall ? "!w-6" : "!w-8"),
2373
- children: icon
2374
- }
2375
- );
2376
- const renderJumpItem = (icon, doubleIcon, isSmall) => /* @__PURE__ */ jsxRuntime.jsx("a", { className: "ant-pagination-item-link", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ant-pagination-item-container", children: [
2377
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ant-pagination-item-ellipsis", children: renderIconButton(icon, isSmall, s$1["jump-button"]) }),
2378
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ant-pagination-item-link-icon", children: renderIconButton(doubleIcon, isSmall, s$1["jump-button"]) })
2379
- ] }) });
2380
- const buildItemRender = ({ paginationTextLabels, isSmall }) => (_page, type, element) => {
2381
- if (type === "prev") {
2382
- return /* @__PURE__ */ jsxRuntime.jsx("a", { children: paginationTextLabels ? "Previous" : renderIconButton(/* @__PURE__ */ jsxRuntime.jsx(react$1.CaretLeftIcon, {}), isSmall) });
2383
- }
2384
- if (type === "next") {
2385
- return /* @__PURE__ */ jsxRuntime.jsx("a", { children: paginationTextLabels ? "Next" : renderIconButton(/* @__PURE__ */ jsxRuntime.jsx(react$1.CaretRightIcon, {}), isSmall) });
2386
- }
2387
- if (type === "jump-prev") {
2388
- return renderJumpItem(/* @__PURE__ */ jsxRuntime.jsx(react$1.DotsThreeIcon, {}), /* @__PURE__ */ jsxRuntime.jsx(react$1.CaretDoubleLeftIcon, {}), isSmall);
2389
- }
2390
- if (type === "jump-next") {
2391
- return renderJumpItem(
2392
- /* @__PURE__ */ jsxRuntime.jsx(react$1.DotsThreeIcon, {}),
2393
- /* @__PURE__ */ jsxRuntime.jsx(react$1.CaretDoubleRightIcon, {}),
2394
- isSmall
2395
- );
2396
- }
2397
- return element;
2398
- };
2399
- const paginationSelectComponentClass = (selectProps) => /* @__PURE__ */ jsxRuntime.jsx(antd.Select, { ...selectProps, suffixIcon: /* @__PURE__ */ jsxRuntime.jsx(react$1.CaretDownIcon, {}) });
2400
- const getPaginationLocale = (isSmall) => ({
2401
- jump_to: `Go to ${isSmall ? ":   " : ""}`,
2402
- page: isSmall ? "" : "page"
2403
- });
2404
- const withDesignSystemPaginationOverrides = (pagination, { paginationTextLabels = false, isSmall } = {}) => {
2405
- const small = isSmall ?? pagination.size === "small";
2406
- return {
2407
- ...pagination,
2408
- locale: { ...getPaginationLocale(small), ...pagination.locale },
2409
- selectComponentClass: paginationSelectComponentClass,
2410
- itemRender: buildItemRender({
2411
- paginationTextLabels,
2412
- isSmall: small
2413
- })
2414
- };
2415
- };
2416
- const Pagination = ({ paginationTextLabels = false, ...props }) => {
2417
- const enriched = withDesignSystemPaginationOverrides(props, {
2418
- paginationTextLabels
2419
- });
2420
- return /* @__PURE__ */ jsxRuntime.jsx(antd.Pagination, { ...enriched });
2421
- };
2422
- const Progress = ({ ...props }) => {
2423
- return /* @__PURE__ */ jsxRuntime.jsx(antd.Progress, { ...props });
2424
- };
2425
- const Radio = (props) => {
2426
- return /* @__PURE__ */ jsxRuntime.jsx(antd.Radio, { ...props });
2427
- };
2428
- const RadioGroup = ({
2429
- buttonStyle = "solid",
2430
- optionType = "button",
2431
- ...props
2432
- }) => {
2433
- return /* @__PURE__ */ jsxRuntime.jsx(
2434
- antd.Radio.Group,
2435
- {
2436
- ...props,
2437
- buttonStyle,
2438
- optionType
2439
- }
2440
- );
2441
- };
2442
- const Rate = ({ count = 5, ...props }) => {
2443
- return /* @__PURE__ */ jsxRuntime.jsx(
2444
- antd.Rate,
2445
- {
2446
- ...props,
2447
- className: "j2-rate",
2448
- count,
2449
- disabled: true,
2450
- allowHalf: true,
2451
- allowClear: true,
2452
- character: /* @__PURE__ */ jsxRuntime.jsx(react$1.StarIcon, { weight: "fill" })
2453
- }
2454
- );
2455
- };
2456
- const isGroupOption$1 = (opt) => "options" in opt && Array.isArray(opt.options);
2457
- const flattenOptions = (opts) => {
2458
- if (!opts) return [];
2459
- return opts.flatMap(
2460
- (o) => isGroupOption$1(o) ? flattenOptions(o.options) : [o]
2461
- );
2462
- };
2463
- const Select = (props) => {
2464
- var _a;
2465
- const [isFocused, setIsFocused] = React.useState(false);
2466
- const [isSearching, setIsSearching] = React.useState(false);
2467
- const [field, , helpers] = formik.useField(props.name);
2468
- const isMultiple = props.mode === "multiple";
2469
- const hasOptions = (((_a = props.options) == null ? void 0 : _a.length) ?? 0) > 0;
2470
- const currentValue = Array.isArray(field.value) ? field.value : [];
2471
- const showSelectAllFooter = isMultiple && !props.loading && !props.disabled && hasOptions && !isSearching;
2472
- const handleSearch = (value) => {
2473
- setIsSearching(value.length > 0);
2474
- if (props.onSearch) {
2475
- props.onSearch(value);
2476
- }
2477
- };
2478
- const handleToggleAll = () => {
2479
- var _a2, _b;
2480
- if (props.disabled) return;
2481
- if (currentValue.length === 0) {
2482
- const flat = flattenOptions(
2483
- props.options
2484
- );
2485
- const allOptions = flat.filter(
2486
- (opt) => opt.value !== void 0 && opt.value !== null && !opt.disabled
2487
- );
2488
- const payload = props.labelInValue ? allOptions.map((opt) => ({ value: opt.value, label: opt.label })) : allOptions.map((opt) => opt.value);
2489
- void helpers.setValue(payload);
2490
- (_a2 = props.onChange) == null ? void 0 : _a2.call(props, payload, allOptions);
2491
- } else {
2492
- void helpers.setValue([]);
2493
- (_b = props.onChange) == null ? void 0 : _b.call(props, [], []);
2494
- }
2495
- };
2496
- const dropdownRender = (menu) => {
2497
- if (props.loading) {
2498
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-3 py-1", children: [
2499
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Loading..." }),
2500
- /* @__PURE__ */ jsxRuntime.jsx(antd.Spin, { indicator: /* @__PURE__ */ jsxRuntime.jsx(Icon.LoadingOutlined, { spin: true }), size: "small" })
2501
- ] });
2502
- }
2503
- if (!props.options || props.options && props.options.length === 0) {
2504
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-1", children: "No options" });
2505
- }
2506
- if (!showSelectAllFooter) return menu;
2507
- const label = currentValue.length === 0 ? "Select all" : "Clear all";
2508
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2509
- menu,
2510
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1 pt-1 border-t border-j2-border-secondary", children: /* @__PURE__ */ jsxRuntime.jsx(
2511
- "button",
2512
- {
2513
- type: "button",
2514
- "aria-label": label,
2515
- title: label,
2516
- onMouseDown: (e) => e.preventDefault(),
2517
- onClick: handleToggleAll,
2518
- className: "w-full text-center font-semibold text-sm py-1.5 rounded cursor-pointer text-j2-primary hover:bg-j2-primary-bg-hover bg-transparent border-0",
2519
- children: label
2520
- }
2521
- ) })
2522
- ] });
2523
- };
2524
- return /* @__PURE__ */ jsxRuntime.jsx(
2525
- formikAntd.Select,
2526
- {
2527
- suffixIcon: props.loading ? /* @__PURE__ */ jsxRuntime.jsx(
2528
- antd.Spin,
2529
- {
2530
- indicator: /* @__PURE__ */ jsxRuntime.jsx(Icon.LoadingOutlined, { spin: true }),
2531
- size: "small",
2532
- "data-testid": "loading-spinner"
2533
- }
2534
- ) : props.showSearch && isFocused ? /* @__PURE__ */ jsxRuntime.jsx(react$1.MagnifyingGlassIcon, { size: 14, "data-testid": "magnifying-glass" }) : /* @__PURE__ */ jsxRuntime.jsx(react$1.CaretDownIcon, { size: 14, "data-testid": "caret-down" }),
2535
- ...props,
2536
- popupRender: dropdownRender,
2537
- removeIcon: /* @__PURE__ */ jsxRuntime.jsx(react$1.XCircleIcon, { size: 12 }),
2538
- allowClear: props.allowClear ? { clearIcon: /* @__PURE__ */ jsxRuntime.jsx(react$1.XCircleIcon, { size: 14 }) } : false,
2539
- showSearch: props.showSearch,
2540
- onSearch: handleSearch,
2541
- onFocus: () => {
2542
- setIsFocused(true);
2543
- },
2544
- onBlur: () => {
2545
- setIsFocused(false);
2546
- setIsSearching(false);
2547
- },
2548
- size: props.size || "large"
2549
- }
2550
- );
2551
- };
2552
- const AntdSelect = (props) => {
2553
- var _a;
2554
- const [isFocused, setIsFocused] = React.useState(false);
2555
- const handleSearch = (value) => {
2556
- if (props.onSearch) {
2557
- props.onSearch(value);
2558
- }
2559
- };
2560
- const dropdownRender = React__namespace.useCallback(
2561
- (menu) => {
2562
- if (props.loading) {
2563
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-3 py-1", children: [
2564
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Loading..." }),
2565
- /* @__PURE__ */ jsxRuntime.jsx(antd.Spin, { indicator: /* @__PURE__ */ jsxRuntime.jsx(Icon.LoadingOutlined, { spin: true }), size: "small" })
2566
- ] });
2567
- }
2568
- if (!props.options || props.options && props.options.length === 0) {
2569
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-1", children: "No options" });
2570
- }
2571
- return menu;
2572
- },
2573
- [props.loading, (_a = props.options) == null ? void 0 : _a.length]
2574
- );
2575
- return /* @__PURE__ */ jsxRuntime.jsx(
2576
- antd.Select,
2577
- {
2578
- suffixIcon: props.loading ? /* @__PURE__ */ jsxRuntime.jsx(
2579
- antd.Spin,
2580
- {
2581
- indicator: /* @__PURE__ */ jsxRuntime.jsx(Icon.LoadingOutlined, { spin: true }),
2582
- size: "small",
2583
- "data-testid": "loading-spinner"
2584
- }
2585
- ) : props.showSearch && isFocused ? /* @__PURE__ */ jsxRuntime.jsx(react$1.MagnifyingGlassIcon, { size: 14, "data-testid": "magnifying-glass" }) : /* @__PURE__ */ jsxRuntime.jsx(react$1.CaretDownIcon, { size: 14, "data-testid": "caret-down" }),
2586
- ...props,
2587
- popupRender: dropdownRender,
2588
- removeIcon: /* @__PURE__ */ jsxRuntime.jsx(react$1.XCircleIcon, { size: 12 }),
2589
- allowClear: props.allowClear ? { clearIcon: /* @__PURE__ */ jsxRuntime.jsx(react$1.XCircleIcon, { size: 14 }) } : false,
2590
- showSearch: props.showSearch,
2591
- onSearch: props.onSearch ? handleSearch : void 0,
2592
- onFocus: () => {
2593
- setIsFocused(true);
2594
- },
2595
- onBlur: () => {
2596
- setIsFocused(false);
2597
- },
2598
- size: props.size || "large"
2599
- }
2600
- );
2601
- };
2602
- const index = /* @__PURE__ */ _mergeNamespaces({
2603
- __proto__: null
2604
- }, [react__namespace]);
2605
- const colorToIcon = {
2606
- error: react$1.XCircleIcon,
2607
- success: react$1.CheckCircleIcon,
2608
- warning: react$1.WarningCircleIcon,
2609
- processing: react$1.ArrowsClockwiseIcon,
2610
- default: react$1.GearIcon
2611
- };
2612
- const statusToColor = {
2613
- error: "var(--j2-color-error-text)",
2614
- success: "var(--j2-color-success)",
2615
- warning: "var(--j2-color-warning-text)",
2616
- processing: "var(--j2-color-primary)",
2617
- default: "var(--j2-color-text)"
2618
- };
2619
- const Tag = ({
2620
- status,
2621
- showIcon = false,
2622
- icon,
2623
- size = "default",
2624
- ...props
2625
- }) => {
2626
- const iconComponent = React__namespace.useMemo(() => {
2627
- if (!showIcon || size === "small") return null;
2628
- const baseProps = {
2629
- size: 12
2630
- };
2631
- const iconName = icon ?? colorToIcon[status];
2632
- const color = statusToColor[status];
2633
- return /* @__PURE__ */ jsxRuntime.jsx("span", { role: "img", className: "anticon", "aria-label": `${status} icon`, children: React__namespace.createElement(iconName, { color, ...baseProps }) });
2634
- }, [status, showIcon, icon]);
2635
- const statusToClassName = {
2636
- default: "bg-[var(--j2-color-fill-quaternary)]"
2637
- };
2638
- return /* @__PURE__ */ jsxRuntime.jsx(
2639
- antd.Tag,
2640
- {
2641
- ...props,
2642
- color: status,
2643
- icon: iconComponent,
2644
- className: cx(
2645
- props.className,
2646
- statusToClassName[status],
2647
- size === "small" && "!px-1 !py-0 !h-auto !text-j2-xs !rounded-j2-sm"
2648
- )
2649
- }
2650
- );
2651
- };
2652
- const hemisphericSelect = "_hemisphericSelect_2ivoh_1";
2653
- const summarizedSelect = "_summarizedSelect_2ivoh_11";
2654
- const isActive = "_isActive_2ivoh_22";
2655
- const menuContainer = "_menuContainer_2ivoh_36";
2656
- const menuContainerMultiple = "_menuContainerMultiple_2ivoh_46";
2657
- const headlinedSelect = "_headlinedSelect_2ivoh_61";
2658
- const headlinedMenuContainer = "_headlinedMenuContainer_2ivoh_105";
2659
- const clearAllButton = "_clearAllButton_2ivoh_116";
2660
- const styles$2 = {
2661
- hemisphericSelect,
2662
- summarizedSelect,
2663
- isActive,
2664
- menuContainer,
2665
- menuContainerMultiple,
2666
- headlinedSelect,
2667
- headlinedMenuContainer,
2668
- clearAllButton
2669
- };
2670
- const isGroupOption = (option) => {
2671
- return "options" in option;
2672
- };
2673
- const getAllOptions = (options) => {
2674
- if (!options) return [];
2675
- return options.flatMap(
2676
- (option) => isGroupOption(option) ? option.options : [option]
2677
- );
2678
- };
2679
- const filterOptions = (options, searchValue) => {
2680
- if (!options) return [];
2681
- if (!searchValue) return options;
2682
- return options.map((option) => {
2683
- var _a;
2684
- if (isGroupOption(option)) {
2685
- const filteredSubOptions = option.options.filter(
2686
- (subOption) => {
2687
- var _a2;
2688
- return (_a2 = subOption.label) == null ? void 0 : _a2.toString().toLowerCase().includes(searchValue.toLowerCase());
2689
- }
2690
- );
2691
- return filteredSubOptions.length > 0 ? { ...option, options: filteredSubOptions } : null;
2692
- } else {
2693
- return ((_a = option.label) == null ? void 0 : _a.toString().toLowerCase().includes(searchValue.toLowerCase())) ? option : null;
2694
- }
2695
- }).filter((option) => option !== null);
2696
- };
2697
- function SummarizedSelect({
2698
- searchPlaceholder,
2699
- formControlPlaceholder,
2700
- loading,
2701
- multiple,
2702
- value,
2703
- onChange,
2704
- options,
2705
- renderLabel,
2706
- rootClassName,
2707
- popupClassName,
2708
- variant,
2709
- trigger = "select",
2710
- defaultOpen = false,
2711
- ...props
2712
- }) {
2713
- const isHeadline = variant === "headlined";
2714
- const antVariant = isHeadline ? "borderless" : variant;
2715
- const [searchValue, setSearchValue] = React.useState("");
2716
- const [focusTrigger, setFocusTrigger] = React.useState(defaultOpen ? 1 : 0);
2717
- const [isOpen, setIsOpen] = React.useState(defaultOpen);
2718
- const inputRef = React.useRef(null);
2719
- const measureSpanRef = React.useRef(null);
2720
- const [measuredWidth, setMeasuredWidth] = React.useState();
2721
- const displayText = React.useMemo(() => {
2722
- if (multiple && value.length > 0) {
2723
- return renderLabel(value.length);
2724
- }
2725
- if (!multiple && value) {
2726
- const option = getAllOptions(options).find((opt) => opt.value === value);
2727
- return option ? String(option.label) : String(value);
2728
- }
2729
- return formControlPlaceholder ?? "";
2730
- }, [multiple, value, options, renderLabel, formControlPlaceholder]);
2731
- React.useEffect(() => {
2732
- if (!measureSpanRef.current) return;
2733
- setMeasuredWidth(Math.ceil(measureSpanRef.current.offsetWidth) + 46);
2734
- }, [displayText]);
2735
- React.useEffect(() => {
2736
- if (focusTrigger > 0) {
2737
- requestAnimationFrame(() => {
2738
- requestAnimationFrame(() => {
2739
- setTimeout(() => {
2740
- var _a;
2741
- (_a = inputRef.current) == null ? void 0 : _a.focus({ cursor: "end" });
2742
- }, 100);
2743
- });
2744
- });
2745
- }
2746
- }, [focusTrigger]);
2747
- const filteredOptions = React.useMemo(() => {
2748
- return filterOptions(options, searchValue);
2749
- }, [searchValue, options]);
2750
- const flatFilteredOptions = React.useMemo(() => {
2751
- return getAllOptions(filteredOptions);
2752
- }, [filteredOptions]);
2753
- const allFlatOptions = React.useMemo(() => {
2754
- return getAllOptions(options);
2755
- }, [options]);
2756
- const handleTagClose = (removedValue) => {
2757
- if (!multiple) return;
2758
- onChange(value.filter((x) => x !== removedValue));
2759
- };
2760
- const handleToggleAll = () => {
2761
- if (!multiple) return;
2762
- const allFilteredValues = getAllOptions(filteredOptions).map(
2763
- (opt) => opt.value
2764
- );
2765
- const someSelected = allFilteredValues.some((val) => value.includes(val));
2766
- if (someSelected) {
2767
- onChange(value.filter((val) => !allFilteredValues.includes(val)));
2768
- }
2769
- };
2770
- const handleSelectFirstOption = () => {
2771
- if (flatFilteredOptions.length === 0) return;
2772
- const firstOption = flatFilteredOptions[0];
2773
- if (!firstOption) return;
2774
- const optionValue = firstOption.value;
2775
- if (multiple) {
2776
- if (value.includes(optionValue)) {
2777
- onChange(value.filter((v) => v !== optionValue));
2778
- } else {
2779
- onChange([...value, optionValue]);
2780
- }
2781
- } else {
2782
- onChange(optionValue);
2783
- setIsOpen(false);
2784
- }
2785
- };
2786
- const handleOptionClick = (optionValue) => {
2787
- if (multiple) {
2788
- if (value.includes(optionValue)) {
2789
- onChange(value.filter((v) => v !== optionValue));
2790
- } else {
2791
- onChange([...value, optionValue]);
2792
- }
2793
- } else {
2794
- onChange(optionValue);
2795
- setIsOpen(false);
2796
- }
2797
- };
2798
- const handleKeyDown = (e) => {
2799
- const navigationKeys = ["ArrowUp", "ArrowDown"];
2800
- if (e.key === "Enter") {
2801
- e.preventDefault();
2802
- e.stopPropagation();
2803
- handleSelectFirstOption();
2804
- return;
2805
- }
2806
- if (e.key === "Escape") {
2807
- e.preventDefault();
2808
- e.stopPropagation();
2809
- setIsOpen(false);
2810
- return;
2811
- }
2812
- if (navigationKeys.includes(e.key)) {
2813
- e.preventDefault();
2814
- return;
2815
- }
2816
- e.stopPropagation();
2817
- };
2818
- const optionRender = (option) => {
2819
- if ("logo" in option.data && option.data.logo) {
2820
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
2821
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-4 shrink-0", children: option.data.logo }),
2822
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "overflow-ellipsis overflow-hidden", children: option.label })
2823
- ] });
2824
- }
2825
- return /* @__PURE__ */ jsxRuntime.jsx("div", { children: option.label });
2826
- };
2827
- const popupRender = (menu) => {
2828
- const valueToLabel = (val) => {
2829
- const option = allFlatOptions.find((opt) => opt.value === val);
2830
- return option ? option.label : val;
2831
- };
2832
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2833
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-2 px-2 pb-2 border-b -mx-1 mt-1", children: /* @__PURE__ */ jsxRuntime.jsx(
2834
- antd.Input,
2835
- {
2836
- ref: inputRef,
2837
- autoFocus: true,
2838
- placeholder: searchPlaceholder || "Search...",
2839
- value: searchValue,
2840
- onChange: (e) => {
2841
- setSearchValue(e.target.value);
2842
- e.stopPropagation();
2843
- e.preventDefault();
2844
- },
2845
- onKeyDown: handleKeyDown,
2846
- onClick: (e) => e.stopPropagation(),
2847
- prefix: /* @__PURE__ */ jsxRuntime.jsx(
2848
- react$1.MagnifyingGlassIcon,
2849
- {
2850
- size: 16,
2851
- className: "text-j2-text-placeholder"
2852
- }
2853
- ),
2854
- allowClear: true
2855
- },
2856
- focusTrigger
2857
- ) }),
2858
- multiple && value.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-2 pb-2", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-y-1", children: value.map((value2) => /* @__PURE__ */ jsxRuntime.jsx(
2859
- Tag,
2860
- {
2861
- className: "opacity-100 z-10 flex max-w-full",
2862
- status: "default",
2863
- closable: true,
2864
- onClose: () => handleTagClose(value2),
2865
- children: /* @__PURE__ */ jsxRuntime.jsx(
2866
- "span",
2867
- {
2868
- className: "overflow-ellipsis overflow-hidden",
2869
- title: valueToLabel(value2),
2870
- children: valueToLabel(value2)
2871
- }
2872
- )
2873
- },
2874
- value2
2875
- )) }) }) : null,
2876
- /* @__PURE__ */ jsxRuntime.jsx(
2877
- "div",
2878
- {
2879
- className: cx(styles$2.menuContainer, "rounded-lg", {
2880
- [styles$2.headlinedMenuContainer]: isHeadline,
2881
- [styles$2.menuContainerMultiple]: multiple
2882
- }),
2883
- children: menu
2884
- }
2885
- ),
2886
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-between items-center", children: multiple && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full mt-1 pt-1 border-t border-j2-border-secondary", children: /* @__PURE__ */ jsxRuntime.jsx(
2887
- "div",
2888
- {
2889
- "aria-selected": "false",
2890
- className: cx(
2891
- "ant-select-item ant-select-item-option w-full",
2892
- styles$2.clearAllButton
2893
- ),
2894
- title: "Clear all",
2895
- onClick: handleToggleAll,
2896
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ant-select-item-option-content text-center font-semibold", children: "Clear all" })
2897
- }
2898
- ) }) })
2899
- ] });
2900
- };
2901
- const handleOpenChange = (open) => {
2902
- setIsOpen(open);
2903
- if (open) {
2904
- setFocusTrigger((prev) => prev + 1);
2905
- } else {
2906
- setSearchValue("");
2907
- }
2908
- };
2909
- const renderDropdownOptionRow = (option) => {
2910
- const optionValue = option.value;
2911
- const isSelected = multiple ? value.includes(optionValue) : value === optionValue;
2912
- const hasLogo = "logo" in option && option.logo;
2913
- return /* @__PURE__ */ jsxRuntime.jsx(
2914
- "div",
2915
- {
2916
- role: "option",
2917
- "aria-selected": isSelected,
2918
- onClick: () => handleOptionClick(optionValue),
2919
- className: cx(
2920
- "px-3 py-1.5 rounded cursor-pointer text-sm",
2921
- isSelected ? "bg-[var(--j2-color-primary)] text-white hover:bg-[var(--j2-color-primary)]" : "hover:bg-[var(--j2-color-bg-hover)]"
2922
- ),
2923
- children: hasLogo ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
2924
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-4 shrink-0", children: option.logo }),
2925
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "overflow-hidden overflow-ellipsis", children: option.label })
2926
- ] }) : option.label
2927
- },
2928
- optionValue
2929
- );
2930
- };
2931
- const dropdownPopupRender = () => {
2932
- const valueToLabel = (val) => {
2933
- const option = allFlatOptions.find((opt) => opt.value === val);
2934
- return option ? option.label : val;
2935
- };
2936
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-lg shadow-md p-2 min-w-[240px]", children: [
2937
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pb-2 border-b border-j2-border-secondary", children: /* @__PURE__ */ jsxRuntime.jsx(
2938
- antd.Input,
2939
- {
2940
- ref: inputRef,
2941
- autoFocus: true,
2942
- placeholder: searchPlaceholder || "Search...",
2943
- value: searchValue,
2944
- onChange: (e) => {
2945
- setSearchValue(e.target.value);
2946
- e.stopPropagation();
2947
- },
2948
- onKeyDown: handleKeyDown,
2949
- onClick: (e) => e.stopPropagation(),
2950
- prefix: /* @__PURE__ */ jsxRuntime.jsx(
2951
- react$1.MagnifyingGlassIcon,
2952
- {
2953
- size: 16,
2954
- className: "text-j2-text-placeholder"
2955
- }
2956
- ),
2957
- allowClear: true
2958
- },
2959
- focusTrigger
2960
- ) }),
2961
- multiple && value.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-1 pt-2", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-y-1", children: value.map((v) => /* @__PURE__ */ jsxRuntime.jsx(
2962
- Tag,
2963
- {
2964
- className: "opacity-100 z-10 flex max-w-full",
2965
- status: "default",
2966
- closable: true,
2967
- onClose: () => handleTagClose(v),
2968
- children: /* @__PURE__ */ jsxRuntime.jsx(
2969
- "span",
2970
- {
2971
- className: "overflow-ellipsis overflow-hidden",
2972
- title: valueToLabel(v),
2973
- children: valueToLabel(v)
2974
- }
2975
- )
2976
- },
2977
- v
2978
- )) }) }),
2979
- /* @__PURE__ */ jsxRuntime.jsx(
2980
- "div",
2981
- {
2982
- className: "max-h-72 overflow-y-auto py-1",
2983
- role: "listbox",
2984
- "aria-multiselectable": multiple || void 0,
2985
- children: filteredOptions.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-2 text-sm text-[var(--j2-color-text-secondary)]", children: "No options found" }) : filteredOptions.map((opt) => {
2986
- if (isGroupOption(opt)) {
2987
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2988
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 pt-2 pb-1 text-xs font-semibold uppercase tracking-wide text-[var(--j2-color-text-tertiary)]", children: opt.label }),
2989
- opt.options.map(renderDropdownOptionRow)
2990
- ] }, `group-${opt.label}`);
2991
- }
2992
- return renderDropdownOptionRow(opt);
2993
- })
2994
- }
2995
- ),
2996
- multiple && value.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1 pt-1 border-t border-j2-border-secondary", children: /* @__PURE__ */ jsxRuntime.jsx(
2997
- "div",
2998
- {
2999
- role: "button",
3000
- "aria-label": "Clear all",
3001
- title: "Clear all",
3002
- onClick: handleToggleAll,
3003
- className: cx(
3004
- "text-center font-semibold text-sm py-1.5 rounded cursor-pointer",
3005
- styles$2.clearAllButton
3006
- ),
3007
- children: "Clear all"
3008
- }
3009
- ) })
3010
- ] });
3011
- };
3012
- if (trigger === "dropdown") {
3013
- const hasSelection = multiple ? value.length > 0 : Boolean(value);
3014
- const triggerContent = /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-1", children: [
3015
- hasSelection ? displayText : formControlPlaceholder ?? "Select",
3016
- loading ? /* @__PURE__ */ jsxRuntime.jsx(
3017
- antd.Spin,
3018
- {
3019
- indicator: /* @__PURE__ */ jsxRuntime.jsx(Icon.LoadingOutlined, { spin: true }),
3020
- size: "small",
3021
- "data-testid": "loading-spinner"
3022
- }
3023
- ) : /* @__PURE__ */ jsxRuntime.jsx(react$1.CaretDownIcon, { weight: "regular", "data-testid": "caret-down" })
3024
- ] });
3025
- return /* @__PURE__ */ jsxRuntime.jsx(
3026
- antd.Dropdown,
3027
- {
3028
- open: isOpen,
3029
- onOpenChange: handleOpenChange,
3030
- trigger: ["click"],
3031
- disabled: props.disabled,
3032
- popupRender: dropdownPopupRender,
3033
- children: /* @__PURE__ */ jsxRuntime.jsx(
3034
- antd.Typography.Link,
3035
- {
3036
- disabled: props.disabled,
3037
- className: cx("inline-flex", rootClassName),
3038
- children: triggerContent
3039
- }
3040
- )
3041
- }
3042
- );
3043
- }
3044
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3045
- /* @__PURE__ */ jsxRuntime.jsx(
3046
- "span",
3047
- {
3048
- ref: measureSpanRef,
3049
- "aria-hidden": true,
3050
- style: {
3051
- position: "absolute",
3052
- visibility: "hidden",
3053
- whiteSpace: "nowrap",
3054
- fontSize: "inherit"
3055
- },
3056
- children: displayText
3057
- }
3058
- ),
3059
- /* @__PURE__ */ jsxRuntime.jsx(
3060
- antd.Select,
3061
- {
3062
- open: isOpen,
3063
- showSearch: false,
3064
- style: { width: measuredWidth },
3065
- suffixIcon: loading ? /* @__PURE__ */ jsxRuntime.jsx(
3066
- antd.Spin,
3067
- {
3068
- indicator: /* @__PURE__ */ jsxRuntime.jsx(Icon.LoadingOutlined, { spin: true }),
3069
- size: "small",
3070
- "data-testid": "loading-spinner"
3071
- }
3072
- ) : /* @__PURE__ */ jsxRuntime.jsx(react$1.CaretDownIcon, { size: 14, "data-testid": "caret-down" }),
3073
- placeholder: formControlPlaceholder,
3074
- mode: multiple ? "multiple" : void 0,
3075
- value,
3076
- maxTagCount: 0,
3077
- maxTagPlaceholder: multiple ? () => renderLabel(value.length) : value,
3078
- options: filteredOptions,
3079
- onChange: (val) => {
3080
- if (multiple) {
3081
- if (Array.isArray(val)) {
3082
- onChange(val);
3083
- } else {
3084
- throw new Error("Value should be an array in multiple mode");
3085
- }
3086
- } else {
3087
- if (typeof val === "string") {
3088
- onChange(val);
3089
- } else {
3090
- throw new Error(
3091
- "Value should be a string in single selection mode"
3092
- );
3093
- }
3094
- }
3095
- },
3096
- popupRender,
3097
- optionRender,
3098
- onOpenChange: handleOpenChange,
3099
- classNames: {
3100
- root: cx(rootClassName, styles$2.summarizedSelect, {
3101
- [styles$2.hemisphericSelect]: variant !== "underlined" && variant !== "headlined",
3102
- [styles$2.isActive]: multiple && value.length > 0 && variant !== "underlined" && variant !== "headlined",
3103
- [styles$2.headlinedSelect]: isHeadline
3104
- }),
3105
- popup: { root: popupClassName }
3106
- },
3107
- variant: antVariant,
3108
- ...props
3109
- }
3110
- )
3111
- ] });
3112
- }
3113
- const Skeleton = (props) => {
3114
- return /* @__PURE__ */ jsxRuntime.jsx(antd.Skeleton, { ...props });
3115
- };
3116
- Skeleton.Node = antd.Skeleton.Node;
3117
- Skeleton.Avatar = antd.Skeleton.Avatar;
3118
- Skeleton.Input = antd.Skeleton.Input;
3119
- Skeleton.Image = antd.Skeleton.Image;
3120
- Skeleton.Button = antd.Skeleton.Button;
3121
- const SvgProgressCircle = (props) => /* @__PURE__ */ React__namespace.createElement("svg", { viewBox: "0 0 80 80", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React__namespace.createElement("g", { clipPath: "url(#clip0_552_202130)" }, /* @__PURE__ */ React__namespace.createElement("circle", { cx: 40, cy: 40, r: 38, stroke: "black", strokeOpacity: 0.06, strokeWidth: 4 }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M40 2C48.0248 2 55.8436 4.54049 62.3358 9.25736", stroke: "#253761", strokeWidth: 4, strokeLinecap: "round" })), /* @__PURE__ */ React__namespace.createElement("defs", null, /* @__PURE__ */ React__namespace.createElement("clipPath", { id: "clip0_552_202130" }, /* @__PURE__ */ React__namespace.createElement("rect", { width: 80, height: 80, fill: "white" }))));
3122
- const SpinIcon = ({ height, width }) => {
3123
- return /* @__PURE__ */ jsxRuntime.jsx(Icon, { spin: true, component: () => /* @__PURE__ */ jsxRuntime.jsx(SvgProgressCircle, {}), style: { height, width } });
3124
- };
3125
- const Spinner = ({ size = 80, className }) => {
3126
- return /* @__PURE__ */ jsxRuntime.jsx(
3127
- antd.Spin,
3128
- {
3129
- className,
3130
- indicator: /* @__PURE__ */ jsxRuntime.jsx(SpinIcon, { height: size, width: size })
3131
- }
3132
- );
3133
- };
3134
- const useSteps = ({
3135
- current,
3136
- setCurrent,
3137
- totalSteps,
3138
- initialStep = 0
3139
- }) => {
3140
- const [internalCurrent, setInternalCurrent] = React.useState(initialStep);
3141
- const isControlled = current !== void 0 && setCurrent !== void 0;
3142
- const currentStep = isControlled ? current : internalCurrent;
3143
- const handleSetCurrent = React.useCallback(
3144
- (newCurrent) => {
3145
- if (isControlled) {
3146
- setCurrent(newCurrent);
3147
- } else {
3148
- setInternalCurrent(newCurrent);
3149
- }
3150
- },
3151
- [isControlled, setCurrent]
3152
- );
3153
- const next = React.useCallback(() => {
3154
- if (currentStep < totalSteps - 1) {
3155
- handleSetCurrent(currentStep + 1);
3156
- }
3157
- }, [currentStep, totalSteps, handleSetCurrent]);
3158
- const previous = React.useCallback(() => {
3159
- if (currentStep > 0) {
3160
- handleSetCurrent(currentStep - 1);
3161
- }
3162
- }, [currentStep, handleSetCurrent]);
3163
- const goToStep = React.useCallback(
3164
- (step) => {
3165
- if (step >= 0 && step < totalSteps) {
3166
- handleSetCurrent(step);
3167
- }
3168
- },
3169
- [totalSteps, handleSetCurrent]
3170
- );
3171
- const cancel = React.useCallback(() => {
3172
- handleSetCurrent(initialStep);
3173
- }, [handleSetCurrent, initialStep]);
3174
- return {
3175
- next,
3176
- previous,
3177
- goToStep,
3178
- cancel,
3179
- current: currentStep,
3180
- setCurrent: handleSetCurrent,
3181
- canGoNext: currentStep < totalSteps - 1,
3182
- canGoPrevious: currentStep > 0
3183
- };
3184
- };
3185
- const Steps = ({
3186
- items,
3187
- current,
3188
- setCurrent,
3189
- dot = false,
3190
- ...props
3191
- }) => {
3192
- const isVertical = props.direction === "vertical";
3193
- const totalSteps = (items == null ? void 0 : items.length) || 0;
3194
- const { current: currentStep, setCurrent: setCurrentStep } = useSteps({
3195
- current,
3196
- setCurrent,
3197
- totalSteps
3198
- });
3199
- return /* @__PURE__ */ jsxRuntime.jsx(
3200
- antd.Steps,
3201
- {
3202
- className: "j2Steps",
3203
- ...props,
3204
- current: currentStep,
3205
- onChange: (curr) => setCurrentStep(curr),
3206
- ...dot && { progressDot: true },
3207
- items: items == null ? void 0 : items.map((item, index2) => {
3208
- return {
3209
- ...item,
3210
- icon: !dot && currentStep > index2 ? /* @__PURE__ */ jsxRuntime.jsx(
3211
- "div",
3212
- {
3213
- className: cx(
3214
- `check-${props.size}`,
3215
- isVertical ? `vertical-check-icon` : `check-icon`
3216
- ),
3217
- children: /* @__PURE__ */ jsxRuntime.jsx(react$1.CheckIcon, { size: 16 })
3218
- }
3219
- ) : item.icon
3220
- };
3221
- })
3222
- }
3223
- );
3224
- };
3225
- const Switch = ({
3226
- small,
3227
- loading = false,
3228
- disabled = false,
3229
- checked,
3230
- onChange,
3231
- ...props
3232
- }) => {
3233
- return /* @__PURE__ */ jsxRuntime.jsx(
3234
- antd.Switch,
3235
- {
3236
- ...props,
3237
- size: small ? "small" : "default",
3238
- loading,
3239
- disabled,
3240
- checked,
3241
- onChange,
3242
- className: "j2-switch"
3243
- }
3244
- );
3245
- };
3246
- const bordered = "_bordered_1vc5s_1";
3247
- const alternatingRows = "_alternatingRows_1vc5s_49";
3248
- const s = {
3249
- bordered,
3250
- alternatingRows
3251
- };
3252
- const defaultSortIcon = ({
3253
- sortOrder
3254
- }) => {
3255
- if (sortOrder == "ascend") return /* @__PURE__ */ jsxRuntime.jsx(react$1.CaretUpIcon, {});
3256
- if (sortOrder == "descend") return /* @__PURE__ */ jsxRuntime.jsx(react$1.CaretDownIcon, {});
3257
- return /* @__PURE__ */ jsxRuntime.jsx(react$1.CaretUpDownIcon, {});
3258
- };
3259
- const Table = ({
3260
- verticalBorders,
3261
- alternatingRows: alternatingRows2,
3262
- paginationTextLabels = false,
3263
- ...props
3264
- }) => {
3265
- var _a, _b;
3266
- const defaultLoadingProps = {
3267
- indicator: /* @__PURE__ */ jsxRuntime.jsx(Spinner, { className: "!w-fit !h-fit !mx-0 translate-x-[-50%]" }),
3268
- tip: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-20", children: [
3269
- /* @__PURE__ */ jsxRuntime.jsx("h4", { children: "Loading this chart" }),
3270
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-lg", children: "Please wait a moment" })
3271
- ] })
3272
- };
3273
- const loading = typeof props.loading == "object" ? { ...props.loading, ...defaultLoadingProps } : props.loading && defaultLoadingProps;
3274
- const isSimpleValue = (value) => {
3275
- return typeof value === "string" || typeof value === "number" || typeof value === "boolean";
3276
- };
3277
- const extractTextContent = (node) => {
3278
- if (isSimpleValue(node)) {
3279
- return String(node);
3280
- }
3281
- if (node && typeof node === "object" && "props" in node && node.props && typeof node.props === "object" && "children" in node.props) {
3282
- const children = node.props.children;
3283
- if (isSimpleValue(children)) {
3284
- return String(children);
3285
- }
3286
- }
3287
- return null;
3288
- };
3289
- const columns = (_a = props.columns) == null ? void 0 : _a.map((column) => {
3290
- const hasEllipsis = column.ellipsis === true || typeof column.ellipsis === "object" && column.ellipsis;
3291
- const originalRender = column.render;
3292
- return {
3293
- ...column,
3294
- sortIcon: column.sortIcon ?? defaultSortIcon,
3295
- ellipsis: hasEllipsis ? {
3296
- showTitle: false
3297
- // Disable default browser tooltip
3298
- } : column.ellipsis,
3299
- render: (value, record, index2) => {
3300
- const renderedContent = originalRender ? originalRender(value, record, index2) : value;
3301
- if (renderedContent == null) {
3302
- return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-j2-text-secondary", children: "--" });
3303
- }
3304
- const tooltipText = extractTextContent(renderedContent);
3305
- if (tooltipText) {
3306
- if (isSimpleValue(renderedContent)) {
3307
- return /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: tooltipText, arrow: false, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: hasEllipsis ? "block truncate" : void 0, children: renderedContent }) });
3308
- }
3309
- return /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: tooltipText, arrow: false, children: /* @__PURE__ */ jsxRuntime.jsx("div", { children: renderedContent }) });
3310
- }
3311
- return renderedContent;
3312
- }
3313
- };
3314
- });
3315
- const paginationConfig = props.pagination ? withDesignSystemPaginationOverrides(
3316
- typeof props.pagination === "object" ? props.pagination : {},
3317
- {
3318
- paginationTextLabels,
3319
- isSmall: typeof props.pagination === "object" && props.pagination.size === "small" || props.size === "small"
3320
- }
3321
- ) : false;
3322
- return /* @__PURE__ */ jsxRuntime.jsx(
3323
- "div",
3324
- {
3325
- className: cx(props.className, {
3326
- [s.bordered]: props.bordered && !verticalBorders,
3327
- [s.alternatingRows]: alternatingRows2
3328
- }),
3329
- children: /* @__PURE__ */ jsxRuntime.jsx(
3330
- antd.Table,
3331
- {
3332
- showSorterTooltip: { target: "sorter-icon" },
3333
- ...props,
3334
- loading,
3335
- columns,
3336
- pagination: paginationConfig,
3337
- rowKey: (record) => JSON.stringify(record),
3338
- locale: {
3339
- emptyText: /* @__PURE__ */ jsxRuntime.jsx(
3340
- "div",
3341
- {
3342
- style: { height: ((_b = props.scroll) == null ? void 0 : _b.y) || 400, width: "content-fit" }
3343
- }
3344
- )
3345
- }
3346
- }
3347
- )
3348
- }
3349
- );
3350
- };
3351
- const TableColumn = (props) => {
3352
- return /* @__PURE__ */ jsxRuntime.jsx(antd.Table.Column, { ...props, sortIcon: defaultSortIcon });
3353
- };
3354
- TableColumn.displayName = "Table.Column";
3355
- Table.Column = TableColumn;
3356
- Table.Summary = antd.Table.Summary;
3357
- const Tabs = (props) => {
3358
- const destroyOnHidden = props.destroyOnHidden ?? true;
3359
- return /* @__PURE__ */ jsxRuntime.jsx(antd.Tabs, { ...props, destroyOnHidden });
3360
- };
3361
- const VennDiagram = ({ data, title, tooltip: tooltip2, onClick }) => {
3362
- const { token } = antd.theme.useToken();
3363
- const baseFont = {
3364
- fontSize: `${token.fontSize}px`,
3365
- fontFamily: token.fontFamily,
3366
- color: token.colorText,
3367
- textOutline: "none",
3368
- opacity: 1
3369
- };
3370
- const options = {
3371
- title: {
3372
- text: title
3373
- },
3374
- ...tooltip2 ? { tooltip: tooltip2 } : {},
3375
- chart: {
3376
- spacing: [36, 36, 36, 36]
3377
- },
3378
- series: [
3379
- {
3380
- type: "venn",
3381
- data,
3382
- events: {
3383
- click: onClick
3384
- },
3385
- cursor: onClick ? "pointer" : void 0,
3386
- dataLabels: {
3387
- style: baseFont
3388
- },
3389
- states: {
3390
- inactive: {
3391
- opacity: 0.3
3392
- }
3393
- }
3394
- }
3395
- ]
3396
- };
3397
- return /* @__PURE__ */ jsxRuntime.jsx(react.Chart, { options });
3398
- };
3399
- const navContainer = "_navContainer_1eoor_2";
3400
- const logoSection = "_logoSection_1eoor_14";
3401
- const logoContainer = "_logoContainer_1eoor_18";
3402
- const logoLink = "_logoLink_1eoor_25";
3403
- const logo = "_logo_1eoor_14";
3404
- const navContent = "_navContent_1eoor_46";
3405
- const navSection = "_navSection_1eoor_54";
3406
- const sectionHeader = "_sectionHeader_1eoor_59";
3407
- const sectionTitle = "_sectionTitle_1eoor_63";
3408
- const sectionItems = "_sectionItems_1eoor_73";
3409
- const navItem = "_navItem_1eoor_79";
3410
- const active = "_active_1eoor_96";
3411
- const navItemIcon = "_navItemIcon_1eoor_100";
3412
- const navItemLabel = "_navItemLabel_1eoor_115";
3413
- const styles$1 = {
3414
- navContainer,
3415
- logoSection,
3416
- logoContainer,
3417
- logoLink,
3418
- logo,
3419
- navContent,
3420
- navSection,
3421
- sectionHeader,
3422
- sectionTitle,
3423
- sectionItems,
3424
- navItem,
3425
- active,
3426
- navItemIcon,
3427
- navItemLabel
3428
- };
3429
- const userSection = "_userSection_r06sp_2";
3430
- const userProfile = "_userProfile_r06sp_7";
3431
- const userAvatar = "_userAvatar_r06sp_24";
3432
- const avatarImage = "_avatarImage_r06sp_38";
3433
- const userName = "_userName_r06sp_44";
3434
- const popover = "_popover_r06sp_55";
3435
- const popoverUserInfo = "_popoverUserInfo_r06sp_78";
3436
- const popoverAvatar = "_popoverAvatar_r06sp_86";
3437
- const popoverUserName = "_popoverUserName_r06sp_105";
3438
- const popoverActions = "_popoverActions_r06sp_113";
3439
- const logOutButton = "_logOutButton_r06sp_138";
3440
- const changeClientButton = "_changeClientButton_r06sp_143";
3441
- const styles = {
3442
- userSection,
3443
- userProfile,
3444
- userAvatar,
3445
- avatarImage,
3446
- userName,
3447
- popover,
3448
- popoverUserInfo,
3449
- popoverAvatar,
3450
- popoverUserName,
3451
- popoverActions,
3452
- logOutButton,
3453
- changeClientButton
3454
- };
3455
- const UserProfile = ({
3456
- firstName,
3457
- lastName,
3458
- avatarUrl,
3459
- onLogOut,
3460
- onChangeClient
3461
- }) => {
3462
- const [isPopoverOpen, setIsPopoverOpen] = React.useState(false);
3463
- const popoverRef = React.useRef(null);
3464
- const buttonRef = React.useRef(null);
3465
- const displayName = lastName ? `${firstName} ${lastName}` : firstName;
3466
- const avatarDisplay = avatarUrl ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: avatarUrl, alt: displayName, className: styles.avatarImage }) : firstName.charAt(0).toUpperCase();
3467
- const togglePopover = () => {
3468
- setIsPopoverOpen(!isPopoverOpen);
3469
- };
3470
- React.useEffect(() => {
3471
- const handleClickOutside = (event) => {
3472
- if (popoverRef.current && !popoverRef.current.contains(event.target) && buttonRef.current && !buttonRef.current.contains(event.target)) {
3473
- setIsPopoverOpen(false);
3474
- }
3475
- };
3476
- document.addEventListener("mousedown", handleClickOutside);
3477
- return () => {
3478
- document.removeEventListener("mousedown", handleClickOutside);
3479
- };
3480
- }, []);
3481
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.userSection, children: [
3482
- /* @__PURE__ */ jsxRuntime.jsxs(
3483
- "button",
3484
- {
3485
- ref: buttonRef,
3486
- className: styles.userProfile,
3487
- onClick: togglePopover,
3488
- children: [
3489
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.userAvatar, children: avatarDisplay }),
3490
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles.userName, children: displayName })
3491
- ]
3492
- }
3493
- ),
3494
- isPopoverOpen && /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: popoverRef, className: styles.popover, children: [
3495
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.popoverUserInfo, children: [
3496
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.popoverAvatar, children: avatarDisplay }),
3497
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles.popoverUserName, children: displayName })
3498
- ] }),
3499
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.popoverActions, children: [
3500
- /* @__PURE__ */ jsxRuntime.jsx(
3501
- "button",
3502
- {
3503
- className: styles.logOutButton,
3504
- onClick: () => {
3505
- onLogOut == null ? void 0 : onLogOut();
3506
- setIsPopoverOpen(false);
3507
- },
3508
- children: "LOG OUT"
3509
- }
3510
- ),
3511
- onChangeClient && /* @__PURE__ */ jsxRuntime.jsx(
3512
- "button",
3513
- {
3514
- className: styles.changeClientButton,
3515
- onClick: () => {
3516
- onChangeClient == null ? void 0 : onChangeClient();
3517
- setIsPopoverOpen(false);
3518
- },
3519
- children: "CHANGE CLIENT"
3520
- }
3521
- )
3522
- ] })
3523
- ] })
3524
- ] });
3525
- };
3526
- const LegacyNavMenu = ({
3527
- sections,
3528
- user,
3529
- onItemClick,
3530
- logoUrl = "/",
3531
- onLogOut,
3532
- onChangeClient,
3533
- headerSlot,
3534
- footerSlot
3535
- }) => {
3536
- const handleItemClick = (itemId) => {
3537
- onItemClick == null ? void 0 : onItemClick(itemId);
3538
- };
3539
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles$1.navContainer, children: [
3540
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$1.logoSection, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$1.logoContainer, children: /* @__PURE__ */ jsxRuntime.jsx("a", { href: logoUrl, className: styles$1.logoLink, children: /* @__PURE__ */ jsxRuntime.jsx(SvgJ2LogoMenuCollapse, { className: styles$1.logo }) }) }) }),
3541
- headerSlot && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-4", children: headerSlot }),
3542
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$1.navContent, children: sections.map((section) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles$1.navSection, children: [
3543
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$1.sectionHeader, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles$1.sectionTitle, children: section.title }) }),
3544
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$1.sectionItems, children: section.items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
3545
- "button",
3546
- {
3547
- className: `${styles$1.navItem} ${item.isActive ? styles$1.active : ""}`,
3548
- onClick: () => handleItemClick(item.id),
3549
- children: [
3550
- item.icon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$1.navItemIcon, children: item.icon }),
3551
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles$1.navItemLabel, children: item.label })
3552
- ]
3553
- },
3554
- item.id
3555
- )) })
3556
- ] }, section.title)) }),
3557
- footerSlot && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-4", children: footerSlot }),
3558
- /* @__PURE__ */ jsxRuntime.jsx(
3559
- UserProfile,
3560
- {
3561
- firstName: user.firstName,
3562
- lastName: user.lastName,
3563
- avatarUrl: user.avatarUrl,
3564
- onLogOut,
3565
- onChangeClient
3566
- }
3567
- )
3568
- ] });
3569
- };
49
+ const useMessage = require("./src/components/message/useMessage.cjs");
50
+ const useNotification = require("./src/components/notification/useNotification.cjs");
51
+ const useSteps = require("./src/components/steps/useSteps.cjs");
52
+ exports.Alert = Alert.Alert;
53
+ exports.AntdInput = AntdInput.AntdInput;
54
+ exports.AntdSearchInput = AntdSearchInput.AntdSearchInput;
55
+ exports.AntdSelect = AntdSelect.AntdSelect;
56
+ exports.AppConfigProvider = AppConfigProvider.AppConfigProvider;
57
+ exports.BarChart = BarChart.BarChart;
58
+ exports.Breadcrumb = Breadcrumb.Breadcrumb;
59
+ exports.BulkActionBar = BulkActionBar.BulkActionBar;
60
+ exports.Button = Button.Button;
61
+ exports.Card = Card.Card;
62
+ exports.Checkbox = Checkbox.Checkbox;
63
+ exports.CheckboxTree = CheckboxTree.CheckboxTree;
64
+ exports.Collapse = Collapse.Collapse;
65
+ exports.Drawer = Drawer.Drawer;
66
+ exports.Dropdown = Dropdown.Dropdown;
67
+ exports.FiltersForm = FiltersForm.FiltersForm;
68
+ exports.Form = Form.Form;
3570
69
  Object.defineProperty(exports, "HighchartsReact", {
3571
70
  enumerable: true,
3572
71
  get: () => react.Chart
3573
72
  });
3574
- exports.tailwindPreset = tailwind.tailwindPreset;
3575
- exports.Alert = Alert;
3576
- exports.AntdInput = AntdInput;
3577
- exports.AntdSearchInput = AntdSearchInput;
3578
- exports.AntdSelect = AntdSelect;
3579
- exports.AppConfigProvider = AppConfigProvider;
3580
- exports.BarChart = BarChart;
3581
- exports.Breadcrumb = Breadcrumb;
3582
- exports.BulkActionBar = BulkActionBar;
3583
- exports.Button = Button;
3584
- exports.Card = Card;
3585
- exports.Checkbox = Checkbox;
3586
- exports.CheckboxTree = CheckboxTree;
3587
- exports.Collapse = Collapse;
3588
- exports.Drawer = Drawer;
3589
- exports.Dropdown = Dropdown;
3590
- exports.FiltersForm = FiltersForm;
3591
- exports.Form = Form;
3592
- exports.Input = Input;
3593
- exports.InputNumber = InputNumber;
3594
- exports.LegacyNavMenu = LegacyNavMenu;
3595
- exports.ListPopover = ListPopover;
3596
- exports.Menu = Menu;
3597
- exports.Modal = Modal;
3598
- exports.NavMenu = NavMenu;
3599
- exports.NotificationModal = NotificationModal;
3600
- exports.Pagination = Pagination;
3601
- exports.Popover = Popover;
3602
- exports.Progress = Progress;
3603
- exports.Radio = Radio;
3604
- exports.RadioGroup = RadioGroup;
3605
- exports.Rate = Rate;
3606
- exports.Select = Select;
3607
- exports.Skeleton = Skeleton;
3608
- exports.Spinner = Spinner;
3609
- exports.Steps = Steps;
3610
- exports.SummarizedSelect = SummarizedSelect;
3611
- exports.Switch = Switch;
3612
- exports.Table = Table;
3613
- exports.Tabs = Tabs;
3614
- exports.Tag = Tag;
3615
- exports.Tooltip = Tooltip;
3616
- exports.UserProfile = UserProfile;
3617
- exports.VennDiagram = VennDiagram;
3618
- exports.appTheme = appTheme;
73
+ exports.Input = Input.Input;
74
+ exports.InputNumber = InputNumber.InputNumber;
75
+ exports.LegacyNavMenu = LegacyNavMenu.LegacyNavMenu;
76
+ exports.ListPopover = ListPopover.ListPopover;
77
+ exports.Menu = Menu.Menu;
78
+ exports.Modal = Modal.Modal;
79
+ exports.NavMenu = NavMenu.NavMenu;
80
+ exports.NotificationModal = NotificationModal.NotificationModal;
81
+ exports.Pagination = Pagination.Pagination;
82
+ exports.withDesignSystemPaginationOverrides = Pagination.withDesignSystemPaginationOverrides;
83
+ exports.Popover = Popover.Popover;
84
+ exports.Progress = Progress.Progress;
85
+ exports.Radio = Radio.Radio;
86
+ exports.RadioGroup = Radio.RadioGroup;
87
+ exports.Rate = Rate.Rate;
88
+ exports.Select = Select.Select;
89
+ exports.Skeleton = Skeleton.Skeleton;
90
+ exports.Spinner = Spinner.Spinner;
91
+ exports.Steps = Steps.Steps;
92
+ exports.SummarizedSelect = SummarizedSelect.SummarizedSelect;
93
+ exports.Switch = Switch.Switch;
94
+ exports.Table = Table.Table;
95
+ exports.Tabs = Tabs.Tabs;
96
+ exports.Tag = Tag.Tag;
97
+ exports.Tooltip = Tooltip.Tooltip;
98
+ exports.UserProfile = UserProfile.UserProfile;
99
+ exports.VennDiagram = VennDiagram.VennDiagram;
100
+ exports.appTheme = appTheme.appTheme;
3619
101
  exports.icons = index;
3620
- exports.useMessage = useMessage;
3621
- exports.useNotification = useNotification;
3622
- exports.useSteps = useSteps;
3623
- exports.withDesignSystemPaginationOverrides = withDesignSystemPaginationOverrides;
102
+ exports.tailwindPreset = tailwind.tailwindPreset;
103
+ exports.useMessage = useMessage.useMessage;
104
+ exports.useNotification = useNotification.useNotification;
105
+ exports.useSteps = useSteps.useSteps;
3624
106
  //# sourceMappingURL=index.cjs.map