@coveord/plasma-mantine 47.0.1-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (450) hide show
  1. package/.eslintrc.js +27 -0
  2. package/.turbo/turbo-build.log +8 -0
  3. package/.turbo/turbo-test.log +30 -0
  4. package/LICENSE +15 -0
  5. package/dist/.tsbuildinfo +1 -0
  6. package/dist/cjs/__tests__/GlobalSetup.js +17 -0
  7. package/dist/cjs/__tests__/GlobalSetup.js.map +1 -0
  8. package/dist/cjs/__tests__/Setup.js +6 -0
  9. package/dist/cjs/__tests__/Setup.js.map +1 -0
  10. package/dist/cjs/__tests__/SetupAfterEnv.js +19 -0
  11. package/dist/cjs/__tests__/SetupAfterEnv.js.map +1 -0
  12. package/dist/cjs/__tests__/Utils.js +38 -0
  13. package/dist/cjs/__tests__/Utils.js.map +1 -0
  14. package/dist/cjs/components/blank-slate/BlankSlate.js +26 -0
  15. package/dist/cjs/components/blank-slate/BlankSlate.js.map +1 -0
  16. package/dist/cjs/components/blank-slate/index.js +8 -0
  17. package/dist/cjs/components/blank-slate/index.js.map +1 -0
  18. package/dist/cjs/components/code-editor/CodeEditor.example.js +41 -0
  19. package/dist/cjs/components/code-editor/CodeEditor.example.js.map +1 -0
  20. package/dist/cjs/components/code-editor/CodeEditor.js +214 -0
  21. package/dist/cjs/components/code-editor/CodeEditor.js.map +1 -0
  22. package/dist/cjs/components/code-editor/__mocks__/@monaco-editor/react.js +30 -0
  23. package/dist/cjs/components/code-editor/__mocks__/@monaco-editor/react.js.map +1 -0
  24. package/dist/cjs/components/code-editor/__mocks__/monaco-editor.js +24 -0
  25. package/dist/cjs/components/code-editor/__mocks__/monaco-editor.js.map +1 -0
  26. package/dist/cjs/components/code-editor/index.js +8 -0
  27. package/dist/cjs/components/code-editor/index.js.map +1 -0
  28. package/dist/cjs/components/collection/Collection.example.js +64 -0
  29. package/dist/cjs/components/collection/Collection.example.js.map +1 -0
  30. package/dist/cjs/components/collection/Collection.js +129 -0
  31. package/dist/cjs/components/collection/Collection.js.map +1 -0
  32. package/dist/cjs/components/collection/CollectionItem.js +109 -0
  33. package/dist/cjs/components/collection/CollectionItem.js.map +1 -0
  34. package/dist/cjs/components/collection/Colllection.styles.js +25 -0
  35. package/dist/cjs/components/collection/Colllection.styles.js.map +1 -0
  36. package/dist/cjs/components/collection/index.js +8 -0
  37. package/dist/cjs/components/collection/index.js.map +1 -0
  38. package/dist/cjs/components/date-range-picker/DateRangePickerInlineCalendar.js +102 -0
  39. package/dist/cjs/components/date-range-picker/DateRangePickerInlineCalendar.js.map +1 -0
  40. package/dist/cjs/components/date-range-picker/DateRangePickerPopoverCalendar.js +93 -0
  41. package/dist/cjs/components/date-range-picker/DateRangePickerPopoverCalendar.js.map +1 -0
  42. package/dist/cjs/components/date-range-picker/DateRangePickerPresetSelect.js +64 -0
  43. package/dist/cjs/components/date-range-picker/DateRangePickerPresetSelect.js.map +1 -0
  44. package/dist/cjs/components/date-range-picker/EditableDateRangePicker.js +66 -0
  45. package/dist/cjs/components/date-range-picker/EditableDateRangePicker.js.map +1 -0
  46. package/dist/cjs/components/date-range-picker/index.js +9 -0
  47. package/dist/cjs/components/date-range-picker/index.js.map +1 -0
  48. package/dist/cjs/components/header/Header.js +78 -0
  49. package/dist/cjs/components/header/Header.js.map +1 -0
  50. package/dist/cjs/components/header/index.js +8 -0
  51. package/dist/cjs/components/header/index.js.map +1 -0
  52. package/dist/cjs/components/index.js +17 -0
  53. package/dist/cjs/components/index.js.map +1 -0
  54. package/dist/cjs/components/inline-confirm/InlineConfirm.js +39 -0
  55. package/dist/cjs/components/inline-confirm/InlineConfirm.js.map +1 -0
  56. package/dist/cjs/components/inline-confirm/InlineConfirmButton.js +28 -0
  57. package/dist/cjs/components/inline-confirm/InlineConfirmButton.js.map +1 -0
  58. package/dist/cjs/components/inline-confirm/InlineConfirmContext.js +14 -0
  59. package/dist/cjs/components/inline-confirm/InlineConfirmContext.js.map +1 -0
  60. package/dist/cjs/components/inline-confirm/InlineConfirmPrompt.js +48 -0
  61. package/dist/cjs/components/inline-confirm/InlineConfirmPrompt.js.map +1 -0
  62. package/dist/cjs/components/inline-confirm/index.js +10 -0
  63. package/dist/cjs/components/inline-confirm/index.js.map +1 -0
  64. package/dist/cjs/components/inline-confirm/useInlineConfirm.js +21 -0
  65. package/dist/cjs/components/inline-confirm/useInlineConfirm.js.map +1 -0
  66. package/dist/cjs/components/modal-wizard/ModalWizard.js +132 -0
  67. package/dist/cjs/components/modal-wizard/ModalWizard.js.map +1 -0
  68. package/dist/cjs/components/modal-wizard/ModalWizardStep.js +23 -0
  69. package/dist/cjs/components/modal-wizard/ModalWizardStep.js.map +1 -0
  70. package/dist/cjs/components/modal-wizard/index.js +8 -0
  71. package/dist/cjs/components/modal-wizard/index.js.map +1 -0
  72. package/dist/cjs/components/prompt/Prompt.js +100 -0
  73. package/dist/cjs/components/prompt/Prompt.js.map +1 -0
  74. package/dist/cjs/components/prompt/PromptFooter.js +25 -0
  75. package/dist/cjs/components/prompt/PromptFooter.js.map +1 -0
  76. package/dist/cjs/components/prompt/index.js +8 -0
  77. package/dist/cjs/components/prompt/index.js.map +1 -0
  78. package/dist/cjs/components/sticky-footer/StickyFooter.js +50 -0
  79. package/dist/cjs/components/sticky-footer/StickyFooter.js.map +1 -0
  80. package/dist/cjs/components/sticky-footer/index.js +8 -0
  81. package/dist/cjs/components/sticky-footer/index.js.map +1 -0
  82. package/dist/cjs/components/table/Table.js +259 -0
  83. package/dist/cjs/components/table/Table.js.map +1 -0
  84. package/dist/cjs/components/table/TableActions.js +25 -0
  85. package/dist/cjs/components/table/TableActions.js.map +1 -0
  86. package/dist/cjs/components/table/TableCollapsibleColumn.js +33 -0
  87. package/dist/cjs/components/table/TableCollapsibleColumn.js.map +1 -0
  88. package/dist/cjs/components/table/TableContext.js +14 -0
  89. package/dist/cjs/components/table/TableContext.js.map +1 -0
  90. package/dist/cjs/components/table/TableDateRangePicker.js +72 -0
  91. package/dist/cjs/components/table/TableDateRangePicker.js.map +1 -0
  92. package/dist/cjs/components/table/TableFilter.js +53 -0
  93. package/dist/cjs/components/table/TableFilter.js.map +1 -0
  94. package/dist/cjs/components/table/TableFooter.js +23 -0
  95. package/dist/cjs/components/table/TableFooter.js.map +1 -0
  96. package/dist/cjs/components/table/TableHeader.js +37 -0
  97. package/dist/cjs/components/table/TableHeader.js.map +1 -0
  98. package/dist/cjs/components/table/TablePagination.js +47 -0
  99. package/dist/cjs/components/table/TablePagination.js.map +1 -0
  100. package/dist/cjs/components/table/TablePerPage.js +52 -0
  101. package/dist/cjs/components/table/TablePerPage.js.map +1 -0
  102. package/dist/cjs/components/table/TablePredicate.js +45 -0
  103. package/dist/cjs/components/table/TablePredicate.js.map +1 -0
  104. package/dist/cjs/components/table/Th.js +107 -0
  105. package/dist/cjs/components/table/Th.js.map +1 -0
  106. package/dist/cjs/components/table/index.js +9 -0
  107. package/dist/cjs/components/table/index.js.map +1 -0
  108. package/dist/cjs/components/table/useTable.js +21 -0
  109. package/dist/cjs/components/table/useTable.js.map +1 -0
  110. package/dist/cjs/hooks/index.js +9 -0
  111. package/dist/cjs/hooks/index.js.map +1 -0
  112. package/dist/cjs/hooks/useControlledList.js +52 -0
  113. package/dist/cjs/hooks/useControlledList.js.map +1 -0
  114. package/dist/cjs/hooks/useParentHeight.js +36 -0
  115. package/dist/cjs/hooks/useParentHeight.js.map +1 -0
  116. package/dist/cjs/index.js +31 -0
  117. package/dist/cjs/index.js.map +1 -0
  118. package/dist/cjs/theme/PlasmaColors.js +54 -0
  119. package/dist/cjs/theme/PlasmaColors.js.map +1 -0
  120. package/dist/cjs/theme/Plasmantine.js +24 -0
  121. package/dist/cjs/theme/Plasmantine.js.map +1 -0
  122. package/dist/cjs/theme/Theme.js +223 -0
  123. package/dist/cjs/theme/Theme.js.map +1 -0
  124. package/dist/cjs/theme/index.js +8 -0
  125. package/dist/cjs/theme/index.js.map +1 -0
  126. package/dist/definitions/__tests__/GlobalSetup.d.ts +3 -0
  127. package/dist/definitions/__tests__/GlobalSetup.d.ts.map +1 -0
  128. package/dist/definitions/__tests__/Setup.d.ts +5 -0
  129. package/dist/definitions/__tests__/Setup.d.ts.map +1 -0
  130. package/dist/definitions/__tests__/SetupAfterEnv.d.ts +7 -0
  131. package/dist/definitions/__tests__/SetupAfterEnv.d.ts.map +1 -0
  132. package/dist/definitions/__tests__/Utils.d.ts +8 -0
  133. package/dist/definitions/__tests__/Utils.d.ts.map +1 -0
  134. package/dist/definitions/components/blank-slate/BlankSlate.d.ts +12 -0
  135. package/dist/definitions/components/blank-slate/BlankSlate.d.ts.map +1 -0
  136. package/dist/definitions/components/blank-slate/index.d.ts +2 -0
  137. package/dist/definitions/components/blank-slate/index.d.ts.map +1 -0
  138. package/dist/definitions/components/code-editor/CodeEditor.d.ts +50 -0
  139. package/dist/definitions/components/code-editor/CodeEditor.d.ts.map +1 -0
  140. package/dist/definitions/components/code-editor/CodeEditor.example.d.ts +4 -0
  141. package/dist/definitions/components/code-editor/CodeEditor.example.d.ts.map +1 -0
  142. package/dist/definitions/components/code-editor/__mocks__/@monaco-editor/react.d.ts +9 -0
  143. package/dist/definitions/components/code-editor/__mocks__/@monaco-editor/react.d.ts.map +1 -0
  144. package/dist/definitions/components/code-editor/__mocks__/monaco-editor.d.ts +8 -0
  145. package/dist/definitions/components/code-editor/__mocks__/monaco-editor.d.ts.map +1 -0
  146. package/dist/definitions/components/code-editor/index.d.ts +2 -0
  147. package/dist/definitions/components/code-editor/index.d.ts.map +1 -0
  148. package/dist/definitions/components/collection/Collection.d.ts +21 -0
  149. package/dist/definitions/components/collection/Collection.d.ts.map +1 -0
  150. package/dist/definitions/components/collection/Collection.example.d.ts +4 -0
  151. package/dist/definitions/components/collection/Collection.example.d.ts.map +1 -0
  152. package/dist/definitions/components/collection/CollectionItem.d.ts +15 -0
  153. package/dist/definitions/components/collection/CollectionItem.d.ts.map +1 -0
  154. package/dist/definitions/components/collection/Colllection.styles.d.ts +9 -0
  155. package/dist/definitions/components/collection/Colllection.styles.d.ts.map +1 -0
  156. package/dist/definitions/components/collection/index.d.ts +2 -0
  157. package/dist/definitions/components/collection/index.d.ts.map +1 -0
  158. package/dist/definitions/components/date-range-picker/DateRangePickerInlineCalendar.d.ts +37 -0
  159. package/dist/definitions/components/date-range-picker/DateRangePickerInlineCalendar.d.ts.map +1 -0
  160. package/dist/definitions/components/date-range-picker/DateRangePickerPopoverCalendar.d.ts +30 -0
  161. package/dist/definitions/components/date-range-picker/DateRangePickerPopoverCalendar.d.ts.map +1 -0
  162. package/dist/definitions/components/date-range-picker/DateRangePickerPresetSelect.d.ts +16 -0
  163. package/dist/definitions/components/date-range-picker/DateRangePickerPresetSelect.d.ts.map +1 -0
  164. package/dist/definitions/components/date-range-picker/EditableDateRangePicker.d.ts +18 -0
  165. package/dist/definitions/components/date-range-picker/EditableDateRangePicker.d.ts.map +1 -0
  166. package/dist/definitions/components/date-range-picker/index.d.ts +3 -0
  167. package/dist/definitions/components/date-range-picker/index.d.ts.map +1 -0
  168. package/dist/definitions/components/header/Header.d.ts +12 -0
  169. package/dist/definitions/components/header/Header.d.ts.map +1 -0
  170. package/dist/definitions/components/header/index.d.ts +2 -0
  171. package/dist/definitions/components/header/index.d.ts.map +1 -0
  172. package/dist/definitions/components/index.d.ts +11 -0
  173. package/dist/definitions/components/index.d.ts.map +1 -0
  174. package/dist/definitions/components/inline-confirm/InlineConfirm.d.ts +10 -0
  175. package/dist/definitions/components/inline-confirm/InlineConfirm.d.ts.map +1 -0
  176. package/dist/definitions/components/inline-confirm/InlineConfirmButton.d.ts +8 -0
  177. package/dist/definitions/components/inline-confirm/InlineConfirmButton.d.ts.map +1 -0
  178. package/dist/definitions/components/inline-confirm/InlineConfirmContext.d.ts +9 -0
  179. package/dist/definitions/components/inline-confirm/InlineConfirmContext.d.ts.map +1 -0
  180. package/dist/definitions/components/inline-confirm/InlineConfirmPrompt.d.ts +11 -0
  181. package/dist/definitions/components/inline-confirm/InlineConfirmPrompt.d.ts.map +1 -0
  182. package/dist/definitions/components/inline-confirm/index.d.ts +4 -0
  183. package/dist/definitions/components/inline-confirm/index.d.ts.map +1 -0
  184. package/dist/definitions/components/inline-confirm/useInlineConfirm.d.ts +6 -0
  185. package/dist/definitions/components/inline-confirm/useInlineConfirm.d.ts.map +1 -0
  186. package/dist/definitions/components/modal-wizard/ModalWizard.d.ts +73 -0
  187. package/dist/definitions/components/modal-wizard/ModalWizard.d.ts.map +1 -0
  188. package/dist/definitions/components/modal-wizard/ModalWizardStep.d.ts +42 -0
  189. package/dist/definitions/components/modal-wizard/ModalWizardStep.d.ts.map +1 -0
  190. package/dist/definitions/components/modal-wizard/index.d.ts +3 -0
  191. package/dist/definitions/components/modal-wizard/index.d.ts.map +1 -0
  192. package/dist/definitions/components/prompt/Prompt.d.ts +14 -0
  193. package/dist/definitions/components/prompt/Prompt.d.ts.map +1 -0
  194. package/dist/definitions/components/prompt/PromptFooter.d.ts +6 -0
  195. package/dist/definitions/components/prompt/PromptFooter.d.ts.map +1 -0
  196. package/dist/definitions/components/prompt/index.d.ts +2 -0
  197. package/dist/definitions/components/prompt/index.d.ts.map +1 -0
  198. package/dist/definitions/components/sticky-footer/StickyFooter.d.ts +10 -0
  199. package/dist/definitions/components/sticky-footer/StickyFooter.d.ts.map +1 -0
  200. package/dist/definitions/components/sticky-footer/index.d.ts +2 -0
  201. package/dist/definitions/components/sticky-footer/index.d.ts.map +1 -0
  202. package/dist/definitions/components/table/Table.d.ts +84 -0
  203. package/dist/definitions/components/table/Table.d.ts.map +1 -0
  204. package/dist/definitions/components/table/TableActions.d.ts +26 -0
  205. package/dist/definitions/components/table/TableActions.d.ts.map +1 -0
  206. package/dist/definitions/components/table/TableCollapsibleColumn.d.ts +6 -0
  207. package/dist/definitions/components/table/TableCollapsibleColumn.d.ts.map +1 -0
  208. package/dist/definitions/components/table/TableContext.d.ts +54 -0
  209. package/dist/definitions/components/table/TableContext.d.ts.map +1 -0
  210. package/dist/definitions/components/table/TableDateRangePicker.d.ts +20 -0
  211. package/dist/definitions/components/table/TableDateRangePicker.d.ts.map +1 -0
  212. package/dist/definitions/components/table/TableFilter.d.ts +12 -0
  213. package/dist/definitions/components/table/TableFilter.d.ts.map +1 -0
  214. package/dist/definitions/components/table/TableFooter.d.ts +3 -0
  215. package/dist/definitions/components/table/TableFooter.d.ts.map +1 -0
  216. package/dist/definitions/components/table/TableHeader.d.ts +3 -0
  217. package/dist/definitions/components/table/TableHeader.d.ts.map +1 -0
  218. package/dist/definitions/components/table/TablePagination.d.ts +10 -0
  219. package/dist/definitions/components/table/TablePagination.d.ts.map +1 -0
  220. package/dist/definitions/components/table/TablePerPage.d.ts +20 -0
  221. package/dist/definitions/components/table/TablePerPage.d.ts.map +1 -0
  222. package/dist/definitions/components/table/TablePredicate.d.ts +21 -0
  223. package/dist/definitions/components/table/TablePredicate.d.ts.map +1 -0
  224. package/dist/definitions/components/table/Th.d.ts +8 -0
  225. package/dist/definitions/components/table/Th.d.ts.map +1 -0
  226. package/dist/definitions/components/table/index.d.ts +4 -0
  227. package/dist/definitions/components/table/index.d.ts.map +1 -0
  228. package/dist/definitions/components/table/useTable.d.ts +11 -0
  229. package/dist/definitions/components/table/useTable.d.ts.map +1 -0
  230. package/dist/definitions/hooks/index.d.ts +3 -0
  231. package/dist/definitions/hooks/index.d.ts.map +1 -0
  232. package/dist/definitions/hooks/useControlledList.d.ts +25 -0
  233. package/dist/definitions/hooks/useControlledList.d.ts.map +1 -0
  234. package/dist/definitions/hooks/useParentHeight.d.ts +5 -0
  235. package/dist/definitions/hooks/useParentHeight.d.ts.map +1 -0
  236. package/dist/definitions/index.d.ts +17 -0
  237. package/dist/definitions/index.d.ts.map +1 -0
  238. package/dist/definitions/theme/PlasmaColors.d.ts +14 -0
  239. package/dist/definitions/theme/PlasmaColors.d.ts.map +1 -0
  240. package/dist/definitions/theme/Plasmantine.d.ts +3 -0
  241. package/dist/definitions/theme/Plasmantine.d.ts.map +1 -0
  242. package/dist/definitions/theme/Theme.d.ts +3 -0
  243. package/dist/definitions/theme/Theme.d.ts.map +1 -0
  244. package/dist/definitions/theme/index.d.ts +2 -0
  245. package/dist/definitions/theme/index.d.ts.map +1 -0
  246. package/dist/esm/__tests__/GlobalSetup.js +7 -0
  247. package/dist/esm/__tests__/GlobalSetup.js.map +1 -0
  248. package/dist/esm/__tests__/Setup.js +5 -0
  249. package/dist/esm/__tests__/Setup.js.map +1 -0
  250. package/dist/esm/__tests__/SetupAfterEnv.js +15 -0
  251. package/dist/esm/__tests__/SetupAfterEnv.js.map +1 -0
  252. package/dist/esm/__tests__/Utils.js +21 -0
  253. package/dist/esm/__tests__/Utils.js.map +1 -0
  254. package/dist/esm/components/blank-slate/BlankSlate.js +16 -0
  255. package/dist/esm/components/blank-slate/BlankSlate.js.map +1 -0
  256. package/dist/esm/components/blank-slate/index.js +3 -0
  257. package/dist/esm/components/blank-slate/index.js.map +1 -0
  258. package/dist/esm/components/code-editor/CodeEditor.example.js +31 -0
  259. package/dist/esm/components/code-editor/CodeEditor.example.js.map +1 -0
  260. package/dist/esm/components/code-editor/CodeEditor.js +201 -0
  261. package/dist/esm/components/code-editor/CodeEditor.js.map +1 -0
  262. package/dist/esm/components/code-editor/__mocks__/@monaco-editor/react.js +12 -0
  263. package/dist/esm/components/code-editor/__mocks__/@monaco-editor/react.js.map +1 -0
  264. package/dist/esm/components/code-editor/__mocks__/monaco-editor.js +14 -0
  265. package/dist/esm/components/code-editor/__mocks__/monaco-editor.js.map +1 -0
  266. package/dist/esm/components/code-editor/index.js +3 -0
  267. package/dist/esm/components/code-editor/index.js.map +1 -0
  268. package/dist/esm/components/collection/Collection.example.js +54 -0
  269. package/dist/esm/components/collection/Collection.example.js.map +1 -0
  270. package/dist/esm/components/collection/Collection.js +118 -0
  271. package/dist/esm/components/collection/Collection.js.map +1 -0
  272. package/dist/esm/components/collection/CollectionItem.js +98 -0
  273. package/dist/esm/components/collection/CollectionItem.js.map +1 -0
  274. package/dist/esm/components/collection/Colllection.styles.js +15 -0
  275. package/dist/esm/components/collection/Colllection.styles.js.map +1 -0
  276. package/dist/esm/components/collection/index.js +3 -0
  277. package/dist/esm/components/collection/index.js.map +1 -0
  278. package/dist/esm/components/date-range-picker/DateRangePickerInlineCalendar.js +92 -0
  279. package/dist/esm/components/date-range-picker/DateRangePickerInlineCalendar.js.map +1 -0
  280. package/dist/esm/components/date-range-picker/DateRangePickerPopoverCalendar.js +83 -0
  281. package/dist/esm/components/date-range-picker/DateRangePickerPopoverCalendar.js.map +1 -0
  282. package/dist/esm/components/date-range-picker/DateRangePickerPresetSelect.js +53 -0
  283. package/dist/esm/components/date-range-picker/DateRangePickerPresetSelect.js.map +1 -0
  284. package/dist/esm/components/date-range-picker/EditableDateRangePicker.js +55 -0
  285. package/dist/esm/components/date-range-picker/EditableDateRangePicker.js.map +1 -0
  286. package/dist/esm/components/date-range-picker/index.js +4 -0
  287. package/dist/esm/components/date-range-picker/index.js.map +1 -0
  288. package/dist/esm/components/header/Header.js +68 -0
  289. package/dist/esm/components/header/Header.js.map +1 -0
  290. package/dist/esm/components/header/index.js +3 -0
  291. package/dist/esm/components/header/index.js.map +1 -0
  292. package/dist/esm/components/index.js +12 -0
  293. package/dist/esm/components/index.js.map +1 -0
  294. package/dist/esm/components/inline-confirm/InlineConfirm.js +29 -0
  295. package/dist/esm/components/inline-confirm/InlineConfirm.js.map +1 -0
  296. package/dist/esm/components/inline-confirm/InlineConfirmButton.js +18 -0
  297. package/dist/esm/components/inline-confirm/InlineConfirmButton.js.map +1 -0
  298. package/dist/esm/components/inline-confirm/InlineConfirmContext.js +4 -0
  299. package/dist/esm/components/inline-confirm/InlineConfirmContext.js.map +1 -0
  300. package/dist/esm/components/inline-confirm/InlineConfirmPrompt.js +38 -0
  301. package/dist/esm/components/inline-confirm/InlineConfirmPrompt.js.map +1 -0
  302. package/dist/esm/components/inline-confirm/index.js +5 -0
  303. package/dist/esm/components/inline-confirm/index.js.map +1 -0
  304. package/dist/esm/components/inline-confirm/useInlineConfirm.js +11 -0
  305. package/dist/esm/components/inline-confirm/useInlineConfirm.js.map +1 -0
  306. package/dist/esm/components/modal-wizard/ModalWizard.js +122 -0
  307. package/dist/esm/components/modal-wizard/ModalWizard.js.map +1 -0
  308. package/dist/esm/components/modal-wizard/ModalWizardStep.js +14 -0
  309. package/dist/esm/components/modal-wizard/ModalWizardStep.js.map +1 -0
  310. package/dist/esm/components/modal-wizard/index.js +3 -0
  311. package/dist/esm/components/modal-wizard/index.js.map +1 -0
  312. package/dist/esm/components/prompt/Prompt.js +90 -0
  313. package/dist/esm/components/prompt/Prompt.js.map +1 -0
  314. package/dist/esm/components/prompt/PromptFooter.js +15 -0
  315. package/dist/esm/components/prompt/PromptFooter.js.map +1 -0
  316. package/dist/esm/components/prompt/index.js +3 -0
  317. package/dist/esm/components/prompt/index.js.map +1 -0
  318. package/dist/esm/components/sticky-footer/StickyFooter.js +40 -0
  319. package/dist/esm/components/sticky-footer/StickyFooter.js.map +1 -0
  320. package/dist/esm/components/sticky-footer/index.js +3 -0
  321. package/dist/esm/components/sticky-footer/index.js.map +1 -0
  322. package/dist/esm/components/table/Table.js +248 -0
  323. package/dist/esm/components/table/Table.js.map +1 -0
  324. package/dist/esm/components/table/TableActions.js +15 -0
  325. package/dist/esm/components/table/TableActions.js.map +1 -0
  326. package/dist/esm/components/table/TableCollapsibleColumn.js +25 -0
  327. package/dist/esm/components/table/TableCollapsibleColumn.js.map +1 -0
  328. package/dist/esm/components/table/TableContext.js +4 -0
  329. package/dist/esm/components/table/TableContext.js.map +1 -0
  330. package/dist/esm/components/table/TableDateRangePicker.js +61 -0
  331. package/dist/esm/components/table/TableDateRangePicker.js.map +1 -0
  332. package/dist/esm/components/table/TableFilter.js +43 -0
  333. package/dist/esm/components/table/TableFilter.js.map +1 -0
  334. package/dist/esm/components/table/TableFooter.js +13 -0
  335. package/dist/esm/components/table/TableFooter.js.map +1 -0
  336. package/dist/esm/components/table/TableHeader.js +27 -0
  337. package/dist/esm/components/table/TableHeader.js.map +1 -0
  338. package/dist/esm/components/table/TablePagination.js +37 -0
  339. package/dist/esm/components/table/TablePagination.js.map +1 -0
  340. package/dist/esm/components/table/TablePerPage.js +42 -0
  341. package/dist/esm/components/table/TablePerPage.js.map +1 -0
  342. package/dist/esm/components/table/TablePredicate.js +35 -0
  343. package/dist/esm/components/table/TablePredicate.js.map +1 -0
  344. package/dist/esm/components/table/Th.js +97 -0
  345. package/dist/esm/components/table/Th.js.map +1 -0
  346. package/dist/esm/components/table/index.js +4 -0
  347. package/dist/esm/components/table/index.js.map +1 -0
  348. package/dist/esm/components/table/useTable.js +11 -0
  349. package/dist/esm/components/table/useTable.js.map +1 -0
  350. package/dist/esm/hooks/index.js +4 -0
  351. package/dist/esm/hooks/index.js.map +1 -0
  352. package/dist/esm/hooks/useControlledList.js +44 -0
  353. package/dist/esm/hooks/useControlledList.js.map +1 -0
  354. package/dist/esm/hooks/useParentHeight.js +28 -0
  355. package/dist/esm/hooks/useParentHeight.js.map +1 -0
  356. package/dist/esm/index.js +11 -0
  357. package/dist/esm/index.js.map +1 -0
  358. package/dist/esm/theme/PlasmaColors.js +44 -0
  359. package/dist/esm/theme/PlasmaColors.js.map +1 -0
  360. package/dist/esm/theme/Plasmantine.js +14 -0
  361. package/dist/esm/theme/Plasmantine.js.map +1 -0
  362. package/dist/esm/theme/Theme.js +213 -0
  363. package/dist/esm/theme/Theme.js.map +1 -0
  364. package/dist/esm/theme/index.js +3 -0
  365. package/dist/esm/theme/index.js.map +1 -0
  366. package/jest.config.js +25 -0
  367. package/package.json +88 -0
  368. package/src/__tests__/GlobalSetup.ts +5 -0
  369. package/src/__tests__/Setup.ts +4 -0
  370. package/src/__tests__/SetupAfterEnv.ts +16 -0
  371. package/src/__tests__/Utils.tsx +15 -0
  372. package/src/components/blank-slate/BlankSlate.tsx +17 -0
  373. package/src/components/blank-slate/__tests__/BlankSlate.spec.tsx +11 -0
  374. package/src/components/blank-slate/index.ts +1 -0
  375. package/src/components/code-editor/CodeEditor.example.tsx +32 -0
  376. package/src/components/code-editor/CodeEditor.tsx +214 -0
  377. package/src/components/code-editor/__mocks__/@monaco-editor/react.tsx +10 -0
  378. package/src/components/code-editor/__mocks__/monaco-editor.ts +9 -0
  379. package/src/components/code-editor/__tests__/CodeEditor.spec.tsx +56 -0
  380. package/src/components/code-editor/index.ts +1 -0
  381. package/src/components/collection/Collection.example.tsx +37 -0
  382. package/src/components/collection/Collection.tsx +129 -0
  383. package/src/components/collection/CollectionItem.tsx +92 -0
  384. package/src/components/collection/Colllection.styles.ts +14 -0
  385. package/src/components/collection/__tests__/Collection.spec.tsx +247 -0
  386. package/src/components/collection/index.ts +1 -0
  387. package/src/components/date-range-picker/DateRangePickerInlineCalendar.tsx +111 -0
  388. package/src/components/date-range-picker/DateRangePickerPopoverCalendar.tsx +94 -0
  389. package/src/components/date-range-picker/DateRangePickerPresetSelect.tsx +62 -0
  390. package/src/components/date-range-picker/EditableDateRangePicker.tsx +60 -0
  391. package/src/components/date-range-picker/__tests__/DateRangePickerInlineCalendar.spec.tsx +95 -0
  392. package/src/components/date-range-picker/__tests__/DateRangePickerPopoverCalendar.spec.tsx +101 -0
  393. package/src/components/date-range-picker/__tests__/DateRangePickerPresetSelect.spec.tsx +53 -0
  394. package/src/components/date-range-picker/__tests__/EditableDateRangePicker.spec.tsx +47 -0
  395. package/src/components/date-range-picker/index.tsx +2 -0
  396. package/src/components/header/Header.tsx +43 -0
  397. package/src/components/header/__tests__/Header.spec.tsx +79 -0
  398. package/src/components/header/index.ts +1 -0
  399. package/src/components/index.ts +10 -0
  400. package/src/components/inline-confirm/InlineConfirm.tsx +29 -0
  401. package/src/components/inline-confirm/InlineConfirmButton.tsx +17 -0
  402. package/src/components/inline-confirm/InlineConfirmContext.ts +9 -0
  403. package/src/components/inline-confirm/InlineConfirmPrompt.tsx +48 -0
  404. package/src/components/inline-confirm/__tests__/InlineConfirm.spec.tsx +94 -0
  405. package/src/components/inline-confirm/index.ts +3 -0
  406. package/src/components/inline-confirm/useInlineConfirm.ts +12 -0
  407. package/src/components/modal-wizard/ModalWizard.tsx +211 -0
  408. package/src/components/modal-wizard/ModalWizardStep.tsx +55 -0
  409. package/src/components/modal-wizard/__tests__/ModalWizard.spec.tsx +345 -0
  410. package/src/components/modal-wizard/index.ts +2 -0
  411. package/src/components/prompt/Prompt.tsx +66 -0
  412. package/src/components/prompt/PromptFooter.tsx +8 -0
  413. package/src/components/prompt/__tests__/Prompt.spec.tsx +29 -0
  414. package/src/components/prompt/index.ts +1 -0
  415. package/src/components/sticky-footer/StickyFooter.tsx +35 -0
  416. package/src/components/sticky-footer/__tests__/StickyFooter.spec.tsx +20 -0
  417. package/src/components/sticky-footer/index.ts +1 -0
  418. package/src/components/table/Table.tsx +293 -0
  419. package/src/components/table/TableActions.tsx +36 -0
  420. package/src/components/table/TableCollapsibleColumn.tsx +26 -0
  421. package/src/components/table/TableContext.tsx +56 -0
  422. package/src/components/table/TableDateRangePicker.tsx +65 -0
  423. package/src/components/table/TableFilter.tsx +44 -0
  424. package/src/components/table/TableFooter.tsx +8 -0
  425. package/src/components/table/TableHeader.tsx +21 -0
  426. package/src/components/table/TablePagination.tsx +41 -0
  427. package/src/components/table/TablePerPage.tsx +49 -0
  428. package/src/components/table/TablePredicate.tsx +43 -0
  429. package/src/components/table/Th.tsx +84 -0
  430. package/src/components/table/__tests__/Table.spec.tsx +128 -0
  431. package/src/components/table/__tests__/TableActions.spec.tsx +36 -0
  432. package/src/components/table/__tests__/TableDateRangePicker.spec.tsx +87 -0
  433. package/src/components/table/__tests__/TableFilter.spec.tsx +39 -0
  434. package/src/components/table/__tests__/TablePagination.spec.tsx +50 -0
  435. package/src/components/table/__tests__/TablePerPage.spec.tsx +81 -0
  436. package/src/components/table/__tests__/TablePredicate.spec.tsx +120 -0
  437. package/src/components/table/__tests__/Th.spec.tsx +63 -0
  438. package/src/components/table/index.ts +3 -0
  439. package/src/components/table/useTable.tsx +11 -0
  440. package/src/hooks/__tests__/useControlledList.spec.tsx +41 -0
  441. package/src/hooks/index.ts +2 -0
  442. package/src/hooks/useControlledList.ts +53 -0
  443. package/src/hooks/useParentHeight.ts +25 -0
  444. package/src/index.ts +21 -0
  445. package/src/theme/PlasmaColors.ts +44 -0
  446. package/src/theme/Plasmantine.tsx +10 -0
  447. package/src/theme/Theme.tsx +161 -0
  448. package/src/theme/index.ts +1 -0
  449. package/tsconfig.build.json +4 -0
  450. package/tsconfig.json +14 -0
@@ -0,0 +1,122 @@
1
+ import _object_spread from "@swc/helpers/src/_object_spread.mjs";
2
+ import _object_spread_props from "@swc/helpers/src/_object_spread_props.mjs";
3
+ import _sliced_to_array from "@swc/helpers/src/_sliced_to_array.mjs";
4
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
+ import { Button, createStyles, Modal, Progress } from "@mantine/core";
6
+ import { Children, useMemo, useState } from "react";
7
+ import { StickyFooter } from "../sticky-footer";
8
+ import { ModalWizardStep } from "./ModalWizardStep";
9
+ import { Header } from "../header";
10
+ var useStyles = createStyles(function() {
11
+ return {
12
+ modal: {
13
+ height: "70%",
14
+ display: "flex",
15
+ flexDirection: "column"
16
+ }
17
+ };
18
+ });
19
+ export var ModalWizard = function(param) {
20
+ var _cancelButtonLabel = param.cancelButtonLabel, cancelButtonLabel = _cancelButtonLabel === void 0 ? "Cancel" : _cancelButtonLabel, _nextButtonLabel = param.nextButtonLabel, nextButtonLabel = _nextButtonLabel === void 0 ? "Next" : _nextButtonLabel, _previousButtonLabel = param.previousButtonLabel, previousButtonLabel = _previousButtonLabel === void 0 ? "Previous" : _previousButtonLabel, _finishButtonLabel = param.finishButtonLabel, finishButtonLabel = _finishButtonLabel === void 0 ? "Finish" : _finishButtonLabel, onNext = param.onNext, onPrevious = param.onPrevious, onClose = param.onClose, onFinish = param.onFinish, isDirty = param.isDirty, modalProps = param.modalProps, handleDirtyState = param.handleDirtyState, closeButtonLabel = param.closeButtonLabel, children = param.children;
21
+ var ref, ref1;
22
+ var ref2 = _sliced_to_array(useState(0), 2), currentStepIndex = ref2[0], setCurrentStepIndex = ref2[1];
23
+ var modalSteps = Children.toArray(children).filter(function(child) {
24
+ return child.type === ModalWizardStep;
25
+ });
26
+ var numberOfSteps = modalSteps.length;
27
+ var numberOfStepsCountAsProgress = modalSteps.filter(function(step) {
28
+ return step.props.countsAsProgress;
29
+ }).length;
30
+ var isFirstStep = currentStepIndex === 0;
31
+ var isLastStep = currentStepIndex === numberOfSteps - 1;
32
+ var currentStep = modalSteps.filter(function(step, index) {
33
+ return index === currentStepIndex;
34
+ })[0];
35
+ var ref3;
36
+ var isValid = ((ref3 = currentStep === null || currentStep === void 0 ? void 0 : (ref = currentStep.props) === null || ref === void 0 ? void 0 : (ref1 = ref.validateStep) === null || ref1 === void 0 ? void 0 : ref1.call(ref, currentStepIndex, numberOfSteps)) !== null && ref3 !== void 0 ? ref3 : {
37
+ isValid: true
38
+ }).isValid;
39
+ var isModalDirty = isDirty && isDirty();
40
+ var classes = useStyles().classes;
41
+ var closeModalWizard = function() {
42
+ if (isModalDirty && handleDirtyState) {
43
+ handleDirtyState() && (onClose === null || onClose === void 0 ? void 0 : onClose());
44
+ } else {
45
+ onClose === null || onClose === void 0 ? void 0 : onClose();
46
+ }
47
+ };
48
+ var getProgress = function(currStepIndex) {
49
+ var validSteps = modalSteps.filter(function(step, index) {
50
+ return step.props.countsAsProgress && index <= currStepIndex;
51
+ }).length;
52
+ return validSteps / numberOfStepsCountAsProgress * 100;
53
+ };
54
+ var getProgressMemo = useMemo(function() {
55
+ return getProgress(currentStepIndex);
56
+ }, [
57
+ currentStepIndex
58
+ ]);
59
+ return /*#__PURE__*/ _jsxs(Modal, _object_spread_props(_object_spread({
60
+ opened: true,
61
+ classNames: {
62
+ modal: classes.modal
63
+ },
64
+ centered: true,
65
+ closeButtonLabel: closeButtonLabel,
66
+ padding: "xl",
67
+ title: /*#__PURE__*/ _jsx(Header, {
68
+ docLink: currentStep.props.docLin,
69
+ description: typeof currentStep.props.description === "function" ? currentStep.props.description(currentStepIndex + 1, numberOfSteps) : currentStep.props.description,
70
+ py: null,
71
+ px: null,
72
+ children: typeof currentStep.props.title === "function" ? currentStep.props.title(currentStepIndex + 1, numberOfSteps) : currentStep.props.title
73
+ }),
74
+ onClose: closeModalWizard
75
+ }, modalProps), {
76
+ children: [
77
+ currentStep.props.showProgressBar && /*#__PURE__*/ _jsx(Progress, {
78
+ value: getProgressMemo
79
+ }),
80
+ currentStep,
81
+ /*#__PURE__*/ _jsxs(StickyFooter, {
82
+ borderTop: true,
83
+ py: null,
84
+ px: null,
85
+ pt: "md",
86
+ children: [
87
+ /*#__PURE__*/ _jsx(Button, {
88
+ name: isFirstStep ? cancelButtonLabel : previousButtonLabel,
89
+ disabled: false,
90
+ size: "md",
91
+ variant: "outline",
92
+ onClick: function() {
93
+ if (isFirstStep) {
94
+ closeModalWizard();
95
+ } else {
96
+ onPrevious === null || onPrevious === void 0 ? void 0 : onPrevious();
97
+ setCurrentStepIndex(currentStepIndex - 1);
98
+ }
99
+ },
100
+ children: isFirstStep ? cancelButtonLabel : previousButtonLabel
101
+ }),
102
+ /*#__PURE__*/ _jsx(Button, {
103
+ disabled: !isValid,
104
+ size: "md",
105
+ onClick: function() {
106
+ if (isLastStep) {
107
+ onFinish ? onFinish() : onClose();
108
+ } else {
109
+ onNext === null || onNext === void 0 ? void 0 : onNext();
110
+ setCurrentStepIndex(currentStepIndex + 1);
111
+ }
112
+ },
113
+ children: isLastStep ? finishButtonLabel : nextButtonLabel
114
+ })
115
+ ]
116
+ })
117
+ ]
118
+ }));
119
+ };
120
+ ModalWizard.Step = ModalWizardStep;
121
+
122
+ //# sourceMappingURL=ModalWizard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/modal-wizard/ModalWizard.tsx"],"sourcesContent":["import {Button, createStyles, Modal, Progress} from '@mantine/core';\nimport {Children, ReactElement, useMemo, useState} from 'react';\nimport {StickyFooter} from '../sticky-footer';\nimport {ModalWizardStep} from './ModalWizardStep';\nimport {Header} from '../header';\n\ninterface ModalWizardProps {\n /**\n * The label of the cancel button\n *\n * @default \"Cancel\"\n */\n cancelButtonLabel?: string;\n\n /**\n * The label of the next button\n *\n * @default \"Next\"\n */\n\n nextButtonLabel?: string;\n /**\n * The label of the previous button\n *\n * @default \"Previous\"\n */\n previousButtonLabel?: string;\n /**\n * The label of the finish button\n *\n * @default \"Finish\"\n */\n\n finishButtonLabel?: string;\n\n /**\n * A callback function that is executed when the user clicks on the next button\n */\n onNext?: () => unknown;\n\n /**\n * A callback function that is executed when the user clicks on the previous button\n */\n onPrevious?: () => unknown;\n\n /**\n * A callback function that is executed when the user clicks on the cancel button\n */\n\n onClose?: () => unknown;\n\n /**\n * A function that is executed when user completes all the steps.\n *\n * @param close A function that closes the modal when called.\n */\n onFinish?: () => unknown;\n\n /**\n * Determine if user interacted with any steps in the modal wizard\n */\n\n isDirty?: () => boolean;\n\n /**\n * A function to confirm close if the state is dirty before closing\n */\n handleDirtyState?: () => boolean;\n\n /**\n * Props to pass to each modal\n */\n modalProps?: any;\n\n /**\n * Label for close button\n */\n closeButtonLabel?: string;\n\n /**\n * Children to display in modal wizard\n * */\n children?: Array<ReturnType<typeof ModalWizardStep>>;\n}\n\nconst useStyles = createStyles(() => ({\n modal: {\n height: '70%',\n display: 'flex',\n flexDirection: 'column',\n },\n}));\n\ninterface ModalWizardType {\n <T>(props: ModalWizardProps): ReactElement;\n\n Step: typeof ModalWizardStep;\n}\n\nexport const ModalWizard: ModalWizardType = ({\n cancelButtonLabel = 'Cancel',\n nextButtonLabel = 'Next',\n previousButtonLabel = 'Previous',\n finishButtonLabel = 'Finish',\n onNext,\n onPrevious,\n onClose,\n onFinish,\n isDirty,\n modalProps,\n handleDirtyState,\n closeButtonLabel,\n children,\n}) => {\n const [currentStepIndex, setCurrentStepIndex] = useState(0);\n const modalSteps = (Children.toArray(children) as ReactElement[]).filter((child) => child.type === ModalWizardStep);\n\n const numberOfSteps = modalSteps.length;\n const numberOfStepsCountAsProgress = modalSteps.filter((step) => step.props.countsAsProgress).length;\n const isFirstStep = currentStepIndex === 0;\n const isLastStep = currentStepIndex === numberOfSteps - 1;\n const currentStep = modalSteps.filter((step: ReactElement, index: number) => index === currentStepIndex)[0];\n\n const {isValid} = currentStep?.props?.validateStep?.(currentStepIndex, numberOfSteps) ?? {isValid: true};\n const isModalDirty = isDirty && isDirty();\n\n const {classes} = useStyles();\n\n const closeModalWizard = () => {\n if (isModalDirty && handleDirtyState) {\n handleDirtyState() && onClose?.();\n } else {\n onClose?.();\n }\n };\n\n const getProgress = (currStepIndex: number) => {\n const validSteps = modalSteps.filter(\n (step, index) => step.props.countsAsProgress && index <= currStepIndex\n ).length;\n return (validSteps / numberOfStepsCountAsProgress) * 100;\n };\n\n const getProgressMemo = useMemo(() => getProgress(currentStepIndex), [currentStepIndex]);\n\n return (\n <Modal\n opened\n classNames={{modal: classes.modal}}\n centered\n closeButtonLabel={closeButtonLabel}\n padding=\"xl\"\n title={\n <Header\n docLink={currentStep.props.docLin}\n description={\n typeof currentStep.props.description === 'function'\n ? currentStep.props.description(currentStepIndex + 1, numberOfSteps)\n : currentStep.props.description\n }\n py={null}\n px={null}\n >\n {typeof currentStep.props.title === 'function'\n ? currentStep.props.title(currentStepIndex + 1, numberOfSteps)\n : currentStep.props.title}\n </Header>\n }\n onClose={closeModalWizard}\n {...modalProps}\n >\n {currentStep.props.showProgressBar && <Progress value={getProgressMemo} />}\n {currentStep}\n <StickyFooter borderTop py={null} px={null} pt=\"md\">\n <Button\n name={isFirstStep ? cancelButtonLabel : previousButtonLabel}\n disabled={false}\n size=\"md\"\n variant=\"outline\"\n onClick={() => {\n if (isFirstStep) {\n closeModalWizard();\n } else {\n onPrevious?.();\n setCurrentStepIndex(currentStepIndex - 1);\n }\n }}\n >\n {isFirstStep ? cancelButtonLabel : previousButtonLabel}\n </Button>\n\n <Button\n disabled={!isValid}\n size=\"md\"\n onClick={() => {\n if (isLastStep) {\n onFinish ? onFinish() : onClose();\n } else {\n onNext?.();\n setCurrentStepIndex(currentStepIndex + 1);\n }\n }}\n >\n {isLastStep ? finishButtonLabel : nextButtonLabel}\n </Button>\n </StickyFooter>\n </Modal>\n );\n};\n\nModalWizard.Step = ModalWizardStep;\n"],"names":["Button","createStyles","Modal","Progress","Children","useMemo","useState","StickyFooter","ModalWizardStep","Header","useStyles","modal","height","display","flexDirection","ModalWizard","cancelButtonLabel","nextButtonLabel","previousButtonLabel","finishButtonLabel","onNext","onPrevious","onClose","onFinish","isDirty","modalProps","handleDirtyState","closeButtonLabel","children","currentStep","currentStepIndex","setCurrentStepIndex","modalSteps","toArray","filter","child","type","numberOfSteps","length","numberOfStepsCountAsProgress","step","props","countsAsProgress","isFirstStep","isLastStep","index","isValid","validateStep","isModalDirty","classes","closeModalWizard","getProgress","currStepIndex","validSteps","getProgressMemo","opened","classNames","centered","padding","title","docLink","docLin","description","py","px","showProgressBar","value","borderTop","pt","name","disabled","size","variant","onClick","Step"],"mappings":"AAAA;;;;AAAA,SAAQA,MAAM,EAAEC,YAAY,EAAEC,KAAK,EAAEC,QAAQ,QAAO,eAAe,CAAC;AACpE,SAAQC,QAAQ,EAAgBC,OAAO,EAAEC,QAAQ,QAAO,OAAO,CAAC;AAChE,SAAQC,YAAY,QAAO,kBAAkB,CAAC;AAC9C,SAAQC,eAAe,QAAO,mBAAmB,CAAC;AAClD,SAAQC,MAAM,QAAO,WAAW,CAAC;AAiFjC,IAAMC,SAAS,GAAGT,YAAY,CAAC;WAAO;QAClCU,KAAK,EAAE;YACHC,MAAM,EAAE,KAAK;YACbC,OAAO,EAAE,MAAM;YACfC,aAAa,EAAE,QAAQ;SAC1B;KACJ;CAAC,CAAC,AAAC;AAQJ,OAAO,IAAMC,WAAW,GAAoB,gBActC;mCAbFC,iBAAiB,EAAjBA,iBAAiB,mCAAG,QAAQ,qBAAA,2BAC5BC,eAAe,EAAfA,eAAe,iCAAG,MAAM,mBAAA,+BACxBC,mBAAmB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AAU,WAAI,GAAdA,KAAAA,CAAc,GAAdA,UAAU,EAAI,CAAC;gCACfU,mBAAmB,CAACD,gBAAgB,GAAG,CAAC,CAAC,CAAC;4BAC9C,CAAC;wBACL,CAAC;kCAEAa,WAAW,GAAG3B,iBAAiB,GAAGE,mBAAmB;sBACjD;kCAET,KAAClB,MAAM;wBACHsE,QAAQ,EAAE,CAACxB,OAAO;wBAClByB,IAAI,EAAC,IAAI;wBACTE,OAAO,EAAE,WAAM;4BACX,IAAI7B,UAAU,EAAE;gCACZrB,QAAQ,GAAGA,QAAQ,EAAE,GAAGD,OAAO,EAAE,CAAC;4BACtC,OAAO;gCACHF,MAAM,aAANA,MAAM,WAAI,GAAVA,KAAAA,CAAU,GAAVA,MAAM,EAAI,CAAC;gCACXW,mBAAmB,CAACD,gBAAgB,GAAG,CAAC,CAAC,CAAC;4BAC9C,CAAC;wBACL,CAAC;kCAEAc,UAAU,GAAGzB,iBAAiB,GAAGF,eAAe;sBAC5C;;cACE;;OACX,CACV;AACN,CAAC,CAAC;AAEFF,WAAW,CAAC2D,IAAI,GAAGlE,eAAe,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ var ModalWizardStep = function(param) {
3
+ var children = param.children;
4
+ return /*#__PURE__*/ _jsx("div", {
5
+ children: children
6
+ });
7
+ };
8
+ ModalWizardStep.defaultProps = {
9
+ showProgressBar: true,
10
+ countsAsProgress: true
11
+ };
12
+ export { ModalWizardStep };
13
+
14
+ //# sourceMappingURL=ModalWizardStep.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/modal-wizard/ModalWizardStep.tsx"],"sourcesContent":["import {FunctionComponent, PropsWithChildren, ReactElement} from 'react';\n\ntype DependsOnStep<T> = (currentStep: number, numberOfSteps: number) => T;\n\nexport interface ModalWizardStepProps {\n /**\n * The title of the current step. The title can be dependent on the current step if needed\n */\n title?: string | ReactElement | DependsOnStep<string | ReactElement>;\n\n /**\n * The description of the current step. The description can be dependent on the current step if needed\n */\n description?: string | ReactElement | DependsOnStep<string | ReactElement>;\n\n /**\n * A link to the documentation for the current step\n */\n docLink: string;\n\n /**\n * A tooltip label for the docLink\n */\n docLinkTooltipLabel?: string | ReactElement | DependsOnStep<string | ReactElement>;\n\n /**\n * A function to validate the current step, it determines if the next step should be enabled or not.\n */\n validateStep: (currentStep: any, numberOfSteps: any) => {isValid: boolean; messsage?: unknown};\n\n /**\n * Show progress bar at this step\n *\n * @default true\n */\n showProgressBar?: boolean;\n\n /**\n * Does completion of current step count moves the progress bar\n *\n * @default true\n */\n countsAsProgress?: boolean;\n}\n\nconst ModalWizardStep: FunctionComponent<PropsWithChildren<ModalWizardStepProps>> = ({children}) => (\n <div>{children}</div>\n);\n\nModalWizardStep.defaultProps = {\n showProgressBar: true,\n countsAsProgress: true,\n};\n\nexport {ModalWizardStep};\n"],"names":["ModalWizardStep","children","div","defaultProps","showProgressBar","countsAsProgress"],"mappings":"AAAA;AA6CA,IAAMA,eAAe,GAA+D;QAAEC,QAAQ,SAARA,QAAQ;yBAC1F,KAACC,KAAG;kBAAED,QAAQ;MAAO;CACxB,AAAC;AAEFD,eAAe,CAACG,YAAY,GAAG;IAC3BC,eAAe,EAAE,IAAI;IACrBC,gBAAgB,EAAE,IAAI;CACzB,CAAC;AAEF,SAAQL,eAAe,GAAE"}
@@ -0,0 +1,3 @@
1
+ export * from "./ModalWizard";
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/modal-wizard/index.ts"],"sourcesContent":["export * from './ModalWizard';\nexport {type ModalWizardStepProps} from './ModalWizardStep';\n"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
@@ -0,0 +1,90 @@
1
+ import _object_spread from "@swc/helpers/src/_object_spread.mjs";
2
+ import _object_spread_props from "@swc/helpers/src/_object_spread_props.mjs";
3
+ import _object_without_properties from "@swc/helpers/src/_object_without_properties.mjs";
4
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
+ import { createStyles, Modal } from "@mantine/core";
6
+ import { Children } from "react";
7
+ import { PromptFooter } from "./PromptFooter";
8
+ var useStyles = createStyles(function(theme) {
9
+ var white = "#fff";
10
+ return {
11
+ body: {
12
+ padding: 0
13
+ },
14
+ modalType: {
15
+ overflow: "hidden",
16
+ width: 550
17
+ },
18
+ innerBody: {
19
+ padding: "".concat(theme.spacing.md, "px ").concat(theme.spacing.xl, "px ").concat(theme.spacing.lg, "px")
20
+ },
21
+ header: {
22
+ padding: "".concat(theme.spacing.md, "px ").concat(theme.spacing.xl, "px"),
23
+ width: "100%",
24
+ borderBottom: "1px solid ".concat(theme.colors.gray[3]),
25
+ fontSize: theme.headings.sizes.h4.fontSize,
26
+ lineHeight: theme.headings.sizes.h4.fontSize
27
+ },
28
+ default: {},
29
+ success: {
30
+ backgroundColor: theme.colors.lime[6],
31
+ color: white
32
+ },
33
+ warning: {
34
+ backgroundColor: theme.colors.yellow[5],
35
+ color: white
36
+ },
37
+ critical: {
38
+ backgroundColor: theme.colors.red[6],
39
+ color: white
40
+ },
41
+ info: {
42
+ backgroundColor: theme.colors.navy[5],
43
+ color: white
44
+ },
45
+ whiteClose: {
46
+ color: white,
47
+ "&:hover": {
48
+ backgroundColor: "transparent"
49
+ }
50
+ }
51
+ };
52
+ });
53
+ export var Prompt = function(_param) {
54
+ var children = _param.children, variant = _param.variant, size = _param.size, otherProps = _object_without_properties(_param, [
55
+ "children",
56
+ "variant",
57
+ "size"
58
+ ]);
59
+ var ref = useStyles(), classes = ref.classes, cx = ref.cx;
60
+ var defaultVariant = variant === "default";
61
+ var convertedChildren = Children.toArray(children);
62
+ var otherChildren = convertedChildren.filter(function(child) {
63
+ return child.type !== PromptFooter;
64
+ });
65
+ var footer = convertedChildren.find(function(child) {
66
+ return child.type === PromptFooter;
67
+ });
68
+ var classNames = {
69
+ header: cx(classes.header, classes[variant]),
70
+ close: !defaultVariant && classes.whiteClose,
71
+ body: classes.body,
72
+ modal: !defaultVariant && classes.modalType
73
+ };
74
+ return /*#__PURE__*/ _jsxs(Modal, _object_spread_props(_object_spread({
75
+ padding: 0,
76
+ classNames: classNames,
77
+ size: defaultVariant ? size : "sm"
78
+ }, otherProps), {
79
+ children: [
80
+ /*#__PURE__*/ _jsx("div", {
81
+ className: classes.innerBody,
82
+ children: otherChildren
83
+ }),
84
+ footer
85
+ ]
86
+ }));
87
+ };
88
+ Prompt.Footer = PromptFooter;
89
+
90
+ //# sourceMappingURL=Prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/prompt/Prompt.tsx"],"sourcesContent":["import {createStyles, Modal, ModalProps} from '@mantine/core';\nimport {Children, ReactElement, ReactNode} from 'react';\nimport {PromptFooter} from './PromptFooter';\n\nconst useStyles = createStyles((theme) => {\n const white = '#fff';\n return {\n body: {\n padding: 0,\n },\n modalType: {overflow: 'hidden', width: 550},\n innerBody: {\n padding: `${theme.spacing.md}px ${theme.spacing.xl}px ${theme.spacing.lg}px`,\n },\n header: {\n padding: `${theme.spacing.md}px ${theme.spacing.xl}px`,\n width: '100%',\n borderBottom: `1px solid ${theme.colors.gray[3]}`,\n fontSize: theme.headings.sizes.h4.fontSize,\n lineHeight: theme.headings.sizes.h4.fontSize,\n },\n default: {},\n success: {backgroundColor: theme.colors.lime[6], color: white},\n warning: {backgroundColor: theme.colors.yellow[5], color: white},\n critical: {\n backgroundColor: theme.colors.red[6],\n color: white,\n },\n info: {backgroundColor: theme.colors.navy[5], color: white},\n whiteClose: {color: white, '&:hover': {backgroundColor: 'transparent'}},\n };\n});\n\nexport interface PromptProps extends ModalProps {\n variant: 'default' | 'success' | 'warning' | 'critical' | 'info';\n children: ReactNode;\n}\ninterface PromptType {\n (props: PromptProps): ReactElement;\n Footer: typeof PromptFooter;\n}\n\nexport const Prompt: PromptType = ({children, variant, size, ...otherProps}) => {\n const {classes, cx} = useStyles();\n const defaultVariant = variant === 'default';\n const convertedChildren = Children.toArray(children) as ReactElement[];\n\n const otherChildren = convertedChildren.filter((child) => child.type !== PromptFooter);\n const footer = convertedChildren.find((child) => child.type === PromptFooter);\n\n const classNames = {\n header: cx(classes.header, classes[variant]),\n close: !defaultVariant && classes.whiteClose,\n body: classes.body,\n modal: !defaultVariant && classes.modalType,\n };\n\n return (\n <Modal padding={0} classNames={classNames} size={defaultVariant ? size : 'sm'} {...otherProps}>\n <div className={classes.innerBody}>{otherChildren}</div>\n {footer}\n </Modal>\n );\n};\n\nPrompt.Footer = PromptFooter;\n"],"names":["createStyles","Modal","Children","PromptFooter","useStyles","theme","white","body","padding","modalType","overflow","width","innerBody","spacing","md","xl","lg","header","borderBottom","colors","gray","fontSize","headings","sizes","h4","lineHeight","default","success","backgroundColor","lime","color","warning","yellow","critical","red","info","navy","whiteClose","Prompt","children","variant","size","otherProps","classes","cx","defaultVariant","convertedChildren","toArray","otherChildren","filter","child","type","footer","find","classNames","close","modal","div","className","Footer"],"mappings":"AAAA;;;;AAAA,SAAQA,YAAY,EAAEC,KAAK,QAAmB,eAAe,CAAC;AAC9D,SAAQC,QAAQ,QAAgC,OAAO,CAAC;AACxD,SAAQC,YAAY,QAAO,gBAAgB,CAAC;AAE5C,IAAMC,SAAS,GAAGJ,YAAY,CAAC,SAACK,KAAK,EAAK;IACtC,IAAMC,KAAK,GAAG,MAAM,AAAC;IACrB,OAAO;QACHC,IAAI,EAAE;YACFC,OAAO,EAAE,CAAC;SACb;QACDC,SAAS,EAAE;YAACC,QAAQ,EAAE,QAAQ;YAAEC,KAAK,EAAE,GAAG;SAAC;QAC3CC,SAAS,EAAE;YACPJ,OAAO,EAAE,AAAC,EAAA,CAAwBH,MAAgB,CAAtCA,KAAK,CAACQ,OAAO,CAACC,EAAE,EAAC,KAAG,CAAmB,CAAKT,MAAgB,CAAtCA,KAAK,CAACQ,OAAO,CAACE,EAAE,EAAC,KAAG,CAAmB,CAAA,MAAE,CAAnBV,KAAK,CAACQ,OAAO,CAACG,EAAE,E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Y,CAAC"}
@@ -0,0 +1,15 @@
1
+ import _object_spread from "@swc/helpers/src/_object_spread.mjs";
2
+ import _object_spread_props from "@swc/helpers/src/_object_spread_props.mjs";
3
+ import _object_without_properties from "@swc/helpers/src/_object_without_properties.mjs";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ import { StickyFooter } from "../sticky-footer";
6
+ export var PromptFooter = function(_param) /*#__PURE__*/ {
7
+ var children = _param.children, otherProps = _object_without_properties(_param, [
8
+ "children"
9
+ ]);
10
+ return _jsx(StickyFooter, _object_spread_props(_object_spread({}, otherProps), {
11
+ children: children
12
+ }));
13
+ };
14
+
15
+ //# sourceMappingURL=PromptFooter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/prompt/PromptFooter.tsx"],"sourcesContent":["import {FunctionComponent, PropsWithChildren} from 'react';\nimport {StickyFooter, StickyFooterProps} from '../sticky-footer';\n\nexport interface PromptFooterProps extends StickyFooterProps {}\n\nexport const PromptFooter: FunctionComponent<PropsWithChildren<PromptFooterProps>> = ({children, ...otherProps}) => (\n <StickyFooter {...otherProps}>{children}</StickyFooter>\n);\n"],"names":["StickyFooter","PromptFooter","children","otherProps"],"mappings":"AAAA;;;;AACA,SAAQA,YAAY,QAA0B,kBAAkB,CAAC;AAIjE,OAAO,IAAMC,YAAY,GAA4D,+BACjF;QADmFC,QAAQ,UAARA,QAAQ,EAAKC,UAAU;QAAvBD,UAAQ;;WAC3F,KAACF,YAAY,0CAAKG,UAAU;kBAAGD,QAAQ;OAAgB;AAAD,CACzD,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./Prompt";
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/prompt/index.ts"],"sourcesContent":["export * from './Prompt';\n"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
@@ -0,0 +1,40 @@
1
+ import _object_spread from "@swc/helpers/src/_object_spread.mjs";
2
+ import _object_spread_props from "@swc/helpers/src/_object_spread_props.mjs";
3
+ import _object_without_properties from "@swc/helpers/src/_object_without_properties.mjs";
4
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
+ import { createStyles, Divider, Group, Paper } from "@mantine/core";
6
+ var useStyles = createStyles(function() {
7
+ return {
8
+ footer: {
9
+ position: "sticky",
10
+ bottom: 0,
11
+ zIndex: 1,
12
+ maxHeight: "80px"
13
+ }
14
+ };
15
+ });
16
+ export var StickyFooter = function(_param) {
17
+ var borderTop = _param.borderTop, children = _param.children, others = _object_without_properties(_param, [
18
+ "borderTop",
19
+ "children"
20
+ ]);
21
+ var classes = useStyles().classes;
22
+ return /*#__PURE__*/ _jsxs(Paper, {
23
+ className: classes.footer,
24
+ children: [
25
+ borderTop ? /*#__PURE__*/ _jsx(Divider, {
26
+ size: "xs"
27
+ }) : null,
28
+ /*#__PURE__*/ _jsx(Group, _object_spread_props(_object_spread({
29
+ position: "right",
30
+ spacing: "xs",
31
+ py: "md",
32
+ px: "xl"
33
+ }, others), {
34
+ children: children
35
+ }))
36
+ ]
37
+ });
38
+ };
39
+
40
+ //# sourceMappingURL=StickyFooter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/sticky-footer/StickyFooter.tsx"],"sourcesContent":["import {createStyles, DefaultProps, Divider, Group, Paper} from '@mantine/core';\nimport {FunctionComponent, PropsWithChildren} from 'react';\n\nexport interface StickyFooterProps extends DefaultProps {\n /**\n * Whether a border is render on top of the footer\n */\n borderTop?: boolean;\n}\n\nconst useStyles = createStyles(() => ({\n footer: {\n position: 'sticky',\n bottom: 0,\n zIndex: 1,\n maxHeight: '80px',\n },\n}));\n\nexport const StickyFooter: FunctionComponent<PropsWithChildren<StickyFooterProps>> = ({\n borderTop,\n children,\n ...others\n}) => {\n const {classes} = useStyles();\n\n return (\n <Paper className={classes.footer}>\n {borderTop ? <Divider size=\"xs\" /> : null}\n <Group position=\"right\" spacing=\"xs\" py=\"md\" px=\"xl\" {...others}>\n {children}\n </Group>\n </Paper>\n );\n};\n"],"names":["createStyles","Divider","Group","Paper","useStyles","footer","position","bottom","zIndex","maxHeight","StickyFooter","borderTop","children","others","classes","className","size","spacing","py","px"],"mappings":"AAAA;;;;AAAA,SAAQA,YAAY,EAAgBC,OAAO,EAAEC,KAAK,EAAEC,KAAK,QAAO,eAAe,CAAC;AAUhF,IAAMC,SAAS,GAAGJ,YAAY,CAAC;WAAO;QAClCK,MAAM,EAAE;YACJC,QAAQ,EAAE,QAAQ;YAClBC,MAAM,EAAE,CAAC;YACTC,MAAM,EAAE,CAAC;YACTC,SAAS,EAAE,MAAM;SACpB;KACJ;CAAC,CAAC,AAAC;AAEJ,OAAO,IAAMC,YAAY,GAA4D,iBAI/E;QAHFC,SAAS,UAATA,SAAS,EACTC,QAAQ,UAARA,QAAQ,EACLC,MAAM;QAFTF,WAAS;QACTC,UAAQ;;IAGR,IAAM,AAACE,OAAO,GAAIV,SAAS,EAAE,CAAtBU,OAAO,AAAe,AAAC;IAE9B,qBACI,MAACX,KAAK;QAACY,SAAS,EAAED,OAAO,CAACT,MAAM;;YAC3BM,SAAS,iBAAG,KAACV,OAAO;gBAACe,IAAI,EAAC,IAAI;cAAG,GAAG,IAAI;0BACzC,KAACd,KAAK;gBAACI,QAAQ,EAAC,OAAO;gBAACW,OAAO,EAAC,IAAI;gBAACC,EAAE,EAAC,IAAI;gBAACC,EAAE,EAAC,IAAI;eAAKN,MAAM;0BAC1DD,QAAQ;eACL;;MACJ,CACV;AACN,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./StickyFooter";
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/sticky-footer/index.ts"],"sourcesContent":["export * from './StickyFooter';\n"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,248 @@
1
+ import _define_property from "@swc/helpers/src/_define_property.mjs";
2
+ import _object_spread from "@swc/helpers/src/_object_spread.mjs";
3
+ import _object_spread_props from "@swc/helpers/src/_object_spread_props.mjs";
4
+ import _object_without_properties from "@swc/helpers/src/_object_without_properties.mjs";
5
+ import _sliced_to_array from "@swc/helpers/src/_sliced_to_array.mjs";
6
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
+ import { Center, Collapse, createStyles, Loader, Skeleton, Table as MantineTable } from "@mantine/core";
8
+ import { useForm } from "@mantine/form";
9
+ import { useDidUpdate } from "@mantine/hooks";
10
+ import { defaultColumnSizing, flexRender, getCoreRowModel, useReactTable } from "@tanstack/react-table";
11
+ import defaultsDeep from "lodash.defaultsdeep";
12
+ import { Children, Fragment, useCallback, useEffect, useState } from "react";
13
+ import { TableActions } from "./TableActions";
14
+ import { TableCollapsibleColumn } from "./TableCollapsibleColumn";
15
+ import { TableContext } from "./TableContext";
16
+ import { TableDateRangePicker } from "./TableDateRangePicker";
17
+ import { TableFilter } from "./TableFilter";
18
+ import { TableFooter } from "./TableFooter";
19
+ import { TableHeader } from "./TableHeader";
20
+ import { TablePagination } from "./TablePagination";
21
+ import { TablePerPage } from "./TablePerPage";
22
+ import { TablePredicate } from "./TablePredicate";
23
+ import { Th } from "./Th";
24
+ var useStyles = createStyles(function(theme, param, getRef) {
25
+ var hasHeader = param.hasHeader;
26
+ return {
27
+ table: {
28
+ width: "100%"
29
+ },
30
+ header: {
31
+ position: "sticky",
32
+ top: hasHeader ? 69 : 0,
33
+ backgroundColor: theme.colorScheme === "dark" ? theme.black : theme.white,
34
+ transition: "box-shadow 150ms ease",
35
+ zIndex: 12,
36
+ "&::after": {
37
+ content: '""',
38
+ position: "absolute",
39
+ left: 0,
40
+ right: 0,
41
+ bottom: 0,
42
+ borderBottom: "1px solid ".concat(theme.colors.gray[2])
43
+ }
44
+ },
45
+ rowSelected: {
46
+ ref: getRef("rowSelected")
47
+ },
48
+ row: _define_property({}, "&:hover, &.".concat(getRef("rowSelected")), {
49
+ backgroundColor: theme.colorScheme === "dark" ? theme.fn.rgba(theme.colors[theme.primaryColor][7], 0.2) : theme.colors[theme.primaryColor][0]
50
+ })
51
+ };
52
+ });
53
+ export var Table = function(param) {
54
+ var data = param.data, noDataChildren = param.noDataChildren, getExpandChildren = param.getExpandChildren, _initialState = param.initialState, initialState = _initialState === void 0 ? {} : _initialState, columns = param.columns, onMount = param.onMount, onChange = param.onChange, children = param.children, _loading = param.loading, loading = _loading === void 0 ? false : _loading;
55
+ var convertedChildren = Children.toArray(children);
56
+ var header = convertedChildren.find(function(child) {
57
+ return child.type === TableHeader;
58
+ });
59
+ var footer = convertedChildren.find(function(child) {
60
+ return child.type === TableFooter;
61
+ });
62
+ var predicates = initialState.predicates, dateRange = initialState.dateRange, initialStateWithoutForm = _object_without_properties(initialState, [
63
+ "predicates",
64
+ "dateRange"
65
+ ]);
66
+ var ref, ref1;
67
+ var form = useForm({
68
+ initialValues: {
69
+ predicates: (ref = initialState === null || initialState === void 0 ? void 0 : initialState.predicates) !== null && ref !== void 0 ? ref : {},
70
+ dateRange: (ref1 = initialState === null || initialState === void 0 ? void 0 : initialState.dateRange) !== null && ref1 !== void 0 ? ref1 : [
71
+ null,
72
+ null
73
+ ]
74
+ }
75
+ });
76
+ var ref2 = useStyles({
77
+ hasHeader: !!header
78
+ }), cx = ref2.cx, classes = ref2.classes;
79
+ var ref3;
80
+ var table = useReactTable({
81
+ initialState: defaultsDeep(initialStateWithoutForm, {
82
+ pagination: {
83
+ pageSize: TablePerPage.DEFAULT_SIZE
84
+ }
85
+ }),
86
+ data: data,
87
+ columns: columns,
88
+ getCoreRowModel: getCoreRowModel(),
89
+ manualPagination: true,
90
+ getRowCanExpand: function(row) {
91
+ return (ref3 = !!(getExpandChildren === null || getExpandChildren === void 0 ? void 0 : getExpandChildren(row.original))) !== null && ref3 !== void 0 ? ref3 : false;
92
+ }
93
+ });
94
+ var ref4 = _sliced_to_array(useState(table.initialState), 2), state = ref4[0], setState = ref4[1];
95
+ table.setOptions(function(prev) {
96
+ return _object_spread_props(_object_spread({}, prev), {
97
+ state: state,
98
+ onStateChange: setState
99
+ });
100
+ });
101
+ var triggerChange = function() {
102
+ return onChange === null || onChange === void 0 ? void 0 : onChange(_object_spread({}, state, form.values));
103
+ };
104
+ useEffect(function() {
105
+ onMount === null || onMount === void 0 ? void 0 : onMount(_object_spread({}, state, form.values));
106
+ }, []);
107
+ useDidUpdate(function() {
108
+ triggerChange();
109
+ clearSelection();
110
+ }, [
111
+ state.globalFilter,
112
+ state.sorting,
113
+ state.pagination,
114
+ form.values
115
+ ]);
116
+ var clearFilters = useCallback(function() {
117
+ form.setFieldValue("predicates", {});
118
+ setState(function(prevState) {
119
+ return _object_spread_props(_object_spread({}, prevState), {
120
+ globalFilter: ""
121
+ });
122
+ });
123
+ }, []);
124
+ var clearSelection = function() {
125
+ setState(function(prevState) {
126
+ return _object_spread_props(_object_spread({}, prevState), {
127
+ rowSelection: {}
128
+ });
129
+ });
130
+ };
131
+ var ref5;
132
+ var getSelectedRow = useCallback(function() {
133
+ var ref, ref1;
134
+ return (ref5 = (ref = table.getSelectedRowModel().flatRows) === null || ref === void 0 ? void 0 : (ref1 = ref[0]) === null || ref1 === void 0 ? void 0 : ref1.original) !== null && ref5 !== void 0 ? ref5 : null;
135
+ }, [
136
+ state.rowSelection
137
+ ]);
138
+ if (!data) {
139
+ return /*#__PURE__*/ _jsx(Center, {
140
+ sx: {
141
+ flexGrow: 1
142
+ },
143
+ children: /*#__PURE__*/ _jsx(Loader, {})
144
+ });
145
+ }
146
+ var toggleRowSelection = function(row) {
147
+ table.setRowSelection(function() {
148
+ return _define_property({}, row.id, !row.getIsSelected());
149
+ });
150
+ };
151
+ var rows = table.getRowModel().rows.map(function(row) {
152
+ var ref;
153
+ var rowChildren = (ref = getExpandChildren === null || getExpandChildren === void 0 ? void 0 : getExpandChildren(row.original)) !== null && ref !== void 0 ? ref : null;
154
+ return /*#__PURE__*/ _jsxs(Fragment, {
155
+ children: [
156
+ /*#__PURE__*/ _jsx("tr", {
157
+ onClick: function() {
158
+ return toggleRowSelection(row);
159
+ },
160
+ className: cx(classes.row, _define_property({}, classes.rowSelected, row.getIsSelected())),
161
+ children: row.getVisibleCells().map(function(cell) {
162
+ var size = cell.column.getSize();
163
+ var width = size !== defaultColumnSizing.size ? size : undefined;
164
+ return /*#__PURE__*/ _jsx("td", {
165
+ style: {
166
+ width: width
167
+ },
168
+ children: /*#__PURE__*/ _jsx(Skeleton, {
169
+ visible: loading,
170
+ children: flexRender(cell.column.columnDef.cell, cell.getContext())
171
+ })
172
+ }, cell.id);
173
+ })
174
+ }),
175
+ rowChildren ? /*#__PURE__*/ _jsx("tr", {
176
+ children: /*#__PURE__*/ _jsx("td", {
177
+ colSpan: columns.length + 1,
178
+ style: {
179
+ padding: 0,
180
+ borderBottomColor: row.getIsExpanded() ? undefined : "transparent"
181
+ },
182
+ children: /*#__PURE__*/ _jsx(Collapse, {
183
+ in: row.getIsExpanded(),
184
+ px: "sm",
185
+ py: "xs",
186
+ children: rowChildren
187
+ })
188
+ })
189
+ }) : null
190
+ ]
191
+ }, row.id);
192
+ });
193
+ return /*#__PURE__*/ _jsxs(TableContext.Provider, {
194
+ value: {
195
+ onChange: triggerChange,
196
+ state: state,
197
+ setState: setState,
198
+ clearFilters: clearFilters,
199
+ getSelectedRow: getSelectedRow,
200
+ clearSelection: clearSelection,
201
+ form: form
202
+ },
203
+ children: [
204
+ header,
205
+ /*#__PURE__*/ _jsxs(MantineTable, {
206
+ className: classes.table,
207
+ horizontalSpacing: "sm",
208
+ verticalSpacing: "xs",
209
+ pb: "sm",
210
+ children: [
211
+ /*#__PURE__*/ _jsx("thead", {
212
+ className: classes.header,
213
+ children: table.getHeaderGroups().map(function(headerGroup) {
214
+ return /*#__PURE__*/ _jsx("tr", {
215
+ children: headerGroup.headers.map(function(columnHeader) {
216
+ return /*#__PURE__*/ _jsx(Th, {
217
+ header: columnHeader
218
+ }, columnHeader.id);
219
+ })
220
+ }, headerGroup.id);
221
+ })
222
+ }),
223
+ /*#__PURE__*/ _jsx("tbody", {
224
+ children: rows.length ? rows : /*#__PURE__*/ _jsx("tr", {
225
+ children: /*#__PURE__*/ _jsx("td", {
226
+ colSpan: columns.length,
227
+ children: noDataChildren
228
+ })
229
+ })
230
+ })
231
+ ]
232
+ }),
233
+ footer
234
+ ]
235
+ });
236
+ };
237
+ Table.Actions = TableActions;
238
+ Table.Filter = TableFilter;
239
+ Table.Footer = TableFooter;
240
+ Table.Header = TableHeader;
241
+ Table.Pagination = TablePagination;
242
+ Table.Predicate = TablePredicate;
243
+ Table.PerPage = TablePerPage;
244
+ Table.Predicate = TablePredicate;
245
+ Table.CollapsibleColumn = TableCollapsibleColumn;
246
+ Table.DateRangePicker = TableDateRangePicker;
247
+
248
+ //# sourceMappingURL=Table.js.map