@tsed/react-formio 3.0.0-alpha.8 → 3.0.0-rc.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 (447) hide show
  1. package/dist/all.d.ts +0 -0
  2. package/dist/all.js +38 -0
  3. package/dist/all.js.map +1 -0
  4. package/dist/atoms/icon/Icon.d.ts +4 -3
  5. package/dist/atoms/icon/Icon.js +9 -8
  6. package/dist/atoms/icon/Icon.js.map +1 -1
  7. package/dist/chunks/_commonjsHelpers.js +30 -3
  8. package/dist/chunks/_commonjsHelpers.js.map +1 -1
  9. package/dist/chunks/index.js +33 -30
  10. package/dist/chunks/index.js.map +1 -1
  11. package/dist/chunks/index.module.js +16 -16
  12. package/dist/chunks/index.module.js.map +1 -1
  13. package/dist/chunks/index2.js +56953 -0
  14. package/dist/chunks/index2.js.map +1 -0
  15. package/dist/chunks/react-select-animated.esm.js +3616 -0
  16. package/dist/chunks/react-select-animated.esm.js.map +1 -0
  17. package/dist/contexts/FormioContext.d.ts +19 -0
  18. package/dist/contexts/FormioContext.js +35 -0
  19. package/dist/contexts/FormioContext.js.map +1 -0
  20. package/dist/hooks/keyboard.constants.d.ts +38 -0
  21. package/dist/hooks/keyboard.constants.js +7 -0
  22. package/dist/hooks/keyboard.constants.js.map +1 -0
  23. package/dist/hooks/useFormioContext.d.ts +10 -0
  24. package/dist/hooks/useFormioContext.js +12 -0
  25. package/dist/hooks/useFormioContext.js.map +1 -0
  26. package/dist/hooks/useI18n.d.ts +4 -0
  27. package/dist/hooks/useI18n.js +9 -0
  28. package/dist/hooks/useI18n.js.map +1 -0
  29. package/dist/hooks/useKeyboardControls.d.ts +12 -0
  30. package/dist/hooks/useKeyboardControls.js +35 -0
  31. package/dist/hooks/useKeyboardControls.js.map +1 -0
  32. package/dist/hooks/useTooltip.js.map +1 -1
  33. package/dist/index.d.ts +1 -6
  34. package/dist/index.js +18 -13
  35. package/dist/index.js.map +1 -1
  36. package/dist/interfaces/ComponentType.d.ts +6 -2
  37. package/dist/interfaces/FormBuilderOptions.d.ts +7 -0
  38. package/dist/interfaces/FormBuilderOptions.js +2 -0
  39. package/dist/interfaces/FormBuilderOptions.js.map +1 -0
  40. package/dist/interfaces/FormOptions.d.ts +6 -13
  41. package/dist/interfaces/FormType.d.ts +4 -11
  42. package/dist/interfaces/Operation.d.ts +13 -4
  43. package/dist/interfaces/SubmissionType.d.ts +5 -10
  44. package/dist/interfaces/index.d.ts +1 -0
  45. package/dist/molecules/alert/Alert.js.map +1 -1
  46. package/dist/molecules/button/Button.d.ts +18 -5
  47. package/dist/molecules/button/Button.js +24 -28
  48. package/dist/molecules/button/Button.js.map +1 -1
  49. package/dist/molecules/card/Card.js +9 -7
  50. package/dist/molecules/card/Card.js.map +1 -1
  51. package/dist/molecules/forms/form-control/FormControl.d.ts +14 -12
  52. package/dist/molecules/forms/form-control/FormControl.js +46 -22
  53. package/dist/molecules/forms/form-control/FormControl.js.map +1 -1
  54. package/dist/molecules/forms/input-tags/InputTags.d.ts +2 -8
  55. package/dist/molecules/forms/input-tags/InputTags.interface.d.ts +7 -0
  56. package/dist/molecules/forms/input-tags/InputTags.interface.js +2 -0
  57. package/dist/molecules/forms/input-tags/InputTags.interface.js.map +1 -0
  58. package/dist/molecules/forms/input-tags/InputTags.js +21 -27
  59. package/dist/molecules/forms/input-tags/InputTags.js.map +1 -1
  60. package/dist/molecules/forms/input-tags/all.d.ts +2 -0
  61. package/dist/molecules/forms/input-tags/all.js +9 -0
  62. package/dist/molecules/forms/input-tags/all.js.map +1 -0
  63. package/dist/molecules/forms/input-tags/components/ChoicesTags.d.ts +307 -0
  64. package/dist/molecules/forms/input-tags/components/ChoicesTags.js +51 -0
  65. package/dist/molecules/forms/input-tags/components/ChoicesTags.js.map +1 -0
  66. package/dist/molecules/forms/input-tags/components/ReactTags.d.ts +2 -0
  67. package/dist/molecules/forms/input-tags/components/ReactTags.js +1926 -0
  68. package/dist/molecules/forms/input-tags/components/ReactTags.js.map +1 -0
  69. package/dist/molecules/forms/input-text/InputText.d.ts +2 -14
  70. package/dist/molecules/forms/input-text/InputText.interface.d.ts +4 -0
  71. package/dist/molecules/forms/input-text/InputText.interface.js +2 -0
  72. package/dist/molecules/forms/input-text/InputText.interface.js.map +1 -0
  73. package/dist/molecules/forms/input-text/InputText.js +46 -56
  74. package/dist/molecules/forms/input-text/InputText.js.map +1 -1
  75. package/dist/molecules/forms/select/Select.d.ts +1 -1
  76. package/dist/molecules/forms/select/{Select.interfaces.d.ts → Select.interface.d.ts} +8 -10
  77. package/dist/molecules/forms/select/Select.interface.js +2 -0
  78. package/dist/molecules/forms/select/Select.interface.js.map +1 -0
  79. package/dist/molecules/forms/select/Select.js +9 -10
  80. package/dist/molecules/forms/select/Select.js.map +1 -1
  81. package/dist/molecules/forms/select/all.d.ts +1 -1
  82. package/dist/molecules/forms/select/all.js +1 -0
  83. package/dist/molecules/forms/select/all.js.map +1 -1
  84. package/dist/molecules/forms/select/components/ChoicesSelect.d.ts +1 -1
  85. package/dist/molecules/forms/select/components/ChoicesSelect.js +72 -83
  86. package/dist/molecules/forms/select/components/ChoicesSelect.js.map +1 -1
  87. package/dist/molecules/forms/select/components/HtmlSelect.d.ts +1 -1
  88. package/dist/molecules/forms/select/components/HtmlSelect.js +17 -16
  89. package/dist/molecules/forms/select/components/HtmlSelect.js.map +1 -1
  90. package/dist/molecules/forms/select/components/ReactSelect.d.ts +1 -1
  91. package/dist/molecules/forms/select/components/ReactSelect.js +28 -3034
  92. package/dist/molecules/forms/select/components/ReactSelect.js.map +1 -1
  93. package/dist/molecules/forms/select/components/choices.template.js +2340 -2257
  94. package/dist/molecules/forms/select/components/choices.template.js.map +1 -1
  95. package/dist/molecules/forms/select/hooks/useOptions.d.ts +3 -3
  96. package/dist/molecules/forms/select/hooks/useOptions.js +15 -15
  97. package/dist/molecules/forms/select/hooks/useOptions.js.map +1 -1
  98. package/dist/molecules/loader/Loader.d.ts +4 -4
  99. package/dist/molecules/loader/Loader.js +16 -8
  100. package/dist/molecules/loader/Loader.js.map +1 -1
  101. package/dist/molecules/modal/Modal.js +23 -24
  102. package/dist/molecules/modal/Modal.js.map +1 -1
  103. package/dist/molecules/pagination/Pagination.d.ts +7 -6
  104. package/dist/molecules/pagination/Pagination.js +48 -57
  105. package/dist/molecules/pagination/Pagination.js.map +1 -1
  106. package/dist/molecules/pagination/PaginationButton.js +10 -10
  107. package/dist/molecules/pagination/PaginationButton.js.map +1 -1
  108. package/dist/molecules/pagination/all.js +5 -4
  109. package/dist/molecules/pagination/all.js.map +1 -1
  110. package/dist/molecules/pagination/utils/getPageNumbers.js.map +1 -0
  111. package/dist/molecules/table/Table.d.ts +16 -2
  112. package/dist/molecules/table/Table.js +53 -77
  113. package/dist/molecules/table/Table.js.map +1 -1
  114. package/dist/molecules/table/all.d.ts +0 -0
  115. package/dist/molecules/table/all.js +19 -0
  116. package/dist/molecules/table/all.js.map +1 -0
  117. package/dist/molecules/table/components/DefaultArrowSort.d.ts +5 -1
  118. package/dist/molecules/table/components/DefaultArrowSort.js +17 -5
  119. package/dist/molecules/table/components/DefaultArrowSort.js.map +1 -1
  120. package/dist/molecules/table/components/DefaultCell.d.ts +5 -1
  121. package/dist/molecules/table/components/DefaultCell.js +8 -6
  122. package/dist/molecules/table/components/DefaultCell.js.map +1 -1
  123. package/dist/molecules/table/components/DefaultCellFooter.d.ts +6 -0
  124. package/dist/molecules/table/components/DefaultCellFooter.js +12 -0
  125. package/dist/molecules/table/components/DefaultCellFooter.js.map +1 -0
  126. package/dist/molecules/table/components/DefaultCellHeader.d.ts +5 -8
  127. package/dist/molecules/table/components/DefaultCellHeader.js +25 -9
  128. package/dist/molecules/table/components/DefaultCellHeader.js.map +1 -1
  129. package/dist/molecules/table/components/DefaultCellOperations.d.ts +16 -10
  130. package/dist/molecules/table/components/DefaultCellOperations.js +23 -14
  131. package/dist/molecules/table/components/DefaultCellOperations.js.map +1 -1
  132. package/dist/molecules/table/components/DefaultFilter.d.ts +11 -0
  133. package/dist/molecules/table/components/DefaultFilter.js +15 -0
  134. package/dist/molecules/table/components/DefaultFilter.js.map +1 -0
  135. package/dist/molecules/table/components/DefaultOperationButton.d.ts +16 -12
  136. package/dist/molecules/table/components/DefaultOperationButton.js +16 -31
  137. package/dist/molecules/table/components/DefaultOperationButton.js.map +1 -1
  138. package/dist/molecules/table/filters/Filters.d.js +2 -0
  139. package/dist/molecules/table/filters/Filters.d.js.map +1 -0
  140. package/dist/molecules/table/filters/RangeFilter.d.ts +3 -0
  141. package/dist/molecules/table/filters/RangeFilter.js +41 -0
  142. package/dist/molecules/table/filters/RangeFilter.js.map +1 -0
  143. package/dist/molecules/table/filters/SelectFilter.d.ts +3 -0
  144. package/dist/molecules/table/filters/SelectFilter.js +33 -0
  145. package/dist/molecules/table/filters/SelectFilter.js.map +1 -0
  146. package/dist/molecules/table/filters/TextFieldFilter.d.ts +3 -0
  147. package/dist/molecules/table/filters/TextFieldFilter.js +27 -0
  148. package/dist/molecules/table/filters/TextFieldFilter.js.map +1 -0
  149. package/dist/molecules/table/hooks/useTable.d.ts +23 -0
  150. package/dist/molecules/table/hooks/useTable.js +35 -0
  151. package/dist/molecules/table/hooks/useTable.js.map +1 -0
  152. package/dist/molecules/table/hooks/useUniqValues.d.ts +5 -0
  153. package/dist/molecules/table/hooks/useUniqValues.js +11 -0
  154. package/dist/molecules/table/hooks/useUniqValues.js.map +1 -0
  155. package/dist/molecules/table/interfaces/extends.d.ts +14 -0
  156. package/dist/molecules/table/interfaces/extends.js +2 -0
  157. package/dist/molecules/table/interfaces/extends.js.map +1 -0
  158. package/dist/molecules/table/utils/mapFormToColumns.d.ts +2 -2
  159. package/dist/molecules/table/utils/mapFormToColumns.js +34 -18
  160. package/dist/molecules/table/utils/mapFormToColumns.js.map +1 -1
  161. package/dist/molecules/tabs/Tab.d.ts +13 -0
  162. package/dist/molecules/tabs/Tab.js +66 -0
  163. package/dist/molecules/tabs/Tab.js.map +1 -0
  164. package/dist/molecules/tabs/TabList.d.ts +2 -0
  165. package/dist/molecules/tabs/TabList.js +23 -0
  166. package/dist/molecules/tabs/TabList.js.map +1 -0
  167. package/dist/molecules/tabs/TabPanel.d.ts +9 -0
  168. package/dist/molecules/tabs/TabPanel.js +27 -0
  169. package/dist/molecules/tabs/TabPanel.js.map +1 -0
  170. package/dist/molecules/tabs/Tabs.d.ts +4 -16
  171. package/dist/molecules/tabs/Tabs.js +7 -67
  172. package/dist/molecules/tabs/Tabs.js.map +1 -1
  173. package/dist/molecules/tabs/TabsBody.d.ts +1 -0
  174. package/dist/molecules/tabs/TabsBody.js +10 -0
  175. package/dist/molecules/tabs/TabsBody.js.map +1 -0
  176. package/dist/molecules/tabs/TabsLegacy.d.ts +18 -0
  177. package/dist/molecules/tabs/TabsLegacy.js +49 -0
  178. package/dist/molecules/tabs/TabsLegacy.js.map +1 -0
  179. package/dist/molecules/tabs/all.d.ts +5 -0
  180. package/dist/molecules/tabs/all.js +13 -0
  181. package/dist/molecules/tabs/all.js.map +1 -0
  182. package/dist/molecules/tabs/context/TabControl.d.ts +52 -0
  183. package/dist/molecules/tabs/context/TabControl.js +85 -0
  184. package/dist/molecules/tabs/context/TabControl.js.map +1 -0
  185. package/dist/molecules/tabs/hooks/tabControl.d.ts +44 -0
  186. package/dist/molecules/tabs/hooks/tabControl.js +34 -0
  187. package/dist/molecules/tabs/hooks/tabControl.js.map +1 -0
  188. package/dist/organisms/form/Form.js.map +1 -1
  189. package/dist/organisms/form/access/FormAccess.js +41 -41
  190. package/dist/organisms/form/access/FormAccess.js.map +1 -1
  191. package/dist/organisms/form/access/FormAccess.schema.js +1 -0
  192. package/dist/organisms/form/access/FormAccess.schema.js.map +1 -1
  193. package/dist/organisms/form/access/FormAccess.utils.js +2 -2
  194. package/dist/organisms/form/access/FormAccess.utils.js.map +1 -1
  195. package/dist/organisms/form/actions/FormAction.js +34 -0
  196. package/dist/organisms/form/actions/FormAction.js.map +1 -0
  197. package/dist/organisms/form/builder/FormBuilder.js.map +1 -1
  198. package/dist/organisms/form/builder/FormEdit.d.ts +7 -3
  199. package/dist/organisms/form/builder/FormEdit.js +46 -42
  200. package/dist/organisms/form/builder/FormEdit.js.map +1 -1
  201. package/dist/organisms/form/builder/FormEdit.reducer.js.map +1 -1
  202. package/dist/organisms/form/builder/FormEditCtas.d.ts +2 -2
  203. package/dist/organisms/form/builder/FormEditCtas.js +36 -35
  204. package/dist/organisms/form/builder/FormEditCtas.js.map +1 -1
  205. package/dist/organisms/form/builder/FormParameters.d.ts +3 -2
  206. package/dist/organisms/form/builder/FormParameters.js +19 -18
  207. package/dist/organisms/form/builder/FormParameters.js.map +1 -1
  208. package/dist/organisms/form/builder/all.js +17 -13
  209. package/dist/organisms/form/builder/all.js.map +1 -1
  210. package/dist/organisms/form/builder/useFormBuilder.d.ts +4 -4
  211. package/dist/organisms/form/builder/useFormBuilder.js +36 -33
  212. package/dist/organisms/form/builder/useFormBuilder.js.map +1 -1
  213. package/dist/organisms/form/builder/useFormEdit.d.ts +2 -2
  214. package/dist/organisms/form/builder/useFormEdit.js +1 -1
  215. package/dist/organisms/form/builder/useFormEdit.js.map +1 -1
  216. package/dist/organisms/form/exports/FormExport.d.ts +6 -0
  217. package/dist/organisms/form/exports/FormExport.js +56 -0
  218. package/dist/organisms/form/exports/FormExport.js.map +1 -0
  219. package/dist/organisms/form/preview/FormPreview.d.ts +6 -0
  220. package/dist/organisms/form/preview/FormPreview.js +12 -0
  221. package/dist/organisms/form/preview/FormPreview.js.map +1 -0
  222. package/dist/organisms/form/settings/FormSettings.js +28 -28
  223. package/dist/organisms/form/settings/FormSettings.js.map +1 -1
  224. package/dist/organisms/form/settings/FormSettings.schema.js.map +1 -1
  225. package/dist/organisms/form/settings/FormSettings.utils.js.map +1 -1
  226. package/dist/organisms/form/useForm.d.ts +2 -1
  227. package/dist/organisms/form/useForm.js +664 -661
  228. package/dist/organisms/form/useForm.js.map +1 -1
  229. package/dist/organisms/modal/RemoveModal.js +16 -17
  230. package/dist/organisms/modal/RemoveModal.js.map +1 -1
  231. package/dist/organisms/table/actions/ActionsTable.d.ts +4 -3
  232. package/dist/organisms/table/actions/ActionsTable.js +21 -33
  233. package/dist/organisms/table/actions/ActionsTable.js.map +1 -1
  234. package/dist/organisms/table/forms/FormsTable.d.ts +2 -3
  235. package/dist/organisms/table/forms/FormsTable.js +48 -27
  236. package/dist/organisms/table/forms/FormsTable.js.map +1 -1
  237. package/dist/organisms/table/forms/components/FormsCell.d.ts +5 -0
  238. package/dist/organisms/table/forms/components/FormsCell.js +50 -0
  239. package/dist/organisms/table/forms/components/FormsCell.js.map +1 -0
  240. package/dist/organisms/table/submissions/SubmissionsTable.d.ts +12 -4
  241. package/dist/organisms/table/submissions/SubmissionsTable.js +10 -17
  242. package/dist/organisms/table/submissions/SubmissionsTable.js.map +1 -1
  243. package/dist/organisms/views/FormViews.d.ts +24 -0
  244. package/dist/organisms/views/FormViews.js +97 -0
  245. package/dist/organisms/views/FormViews.js.map +1 -0
  246. package/dist/registries/components.js +12 -11
  247. package/dist/registries/components.js.map +1 -1
  248. package/dist/utils/getEventValue.js.map +1 -1
  249. package/dist/utils/iconClass.js +4 -5
  250. package/dist/utils/iconClass.js.map +1 -1
  251. package/dist/utils/mapPagination.js.map +1 -1
  252. package/dist/utils/stopPropagationWrapper.js.map +1 -1
  253. package/package.json +10 -8
  254. package/readme.md +7 -8
  255. package/src/all.ts +34 -0
  256. package/src/atoms/icon/Icon.stories.tsx +71 -22
  257. package/src/atoms/icon/Icon.tsx +14 -4
  258. package/src/contexts/FormioContext.tsx +89 -0
  259. package/src/hooks/keyboard.constants.ts +40 -0
  260. package/src/hooks/useFormioContext.ts +13 -0
  261. package/src/hooks/useI18n.ts +9 -0
  262. package/src/hooks/useKeyboardControls.spec.tsx +208 -0
  263. package/src/hooks/useKeyboardControls.ts +84 -0
  264. package/src/index.ts +17 -13
  265. package/src/interfaces/ComponentType.ts +2 -2
  266. package/src/interfaces/FormBuilderOptions.ts +9 -0
  267. package/src/interfaces/FormOptions.ts +7 -13
  268. package/src/interfaces/FormType.ts +5 -11
  269. package/src/interfaces/Operation.ts +10 -4
  270. package/src/interfaces/SubmissionType.ts +9 -8
  271. package/src/interfaces/index.ts +1 -0
  272. package/src/molecules/__fixtures__/build.js +28 -0
  273. package/src/molecules/__fixtures__/form-schema.json +76 -195
  274. package/src/molecules/__fixtures__/form-submissions.json +11846 -46
  275. package/src/molecules/__fixtures__/products.json +81539 -0
  276. package/src/molecules/button/Button.stories.tsx +1 -1
  277. package/src/molecules/button/Button.tsx +43 -24
  278. package/src/molecules/card/Card.tsx +4 -0
  279. package/src/molecules/forms/form-control/FormControl.spec.tsx +7 -4
  280. package/src/molecules/forms/form-control/FormControl.stories.tsx +4 -4
  281. package/src/molecules/forms/form-control/FormControl.tsx +46 -20
  282. package/src/molecules/forms/input-tags/InputTags.interface.ts +9 -0
  283. package/src/molecules/forms/input-tags/InputTags.tsx +20 -42
  284. package/src/molecules/forms/input-tags/all.ts +6 -0
  285. package/src/molecules/forms/input-tags/components/ChoicesTags.stories.tsx +110 -0
  286. package/src/molecules/forms/input-tags/components/ChoicesTags.tsx +72 -0
  287. package/src/molecules/forms/input-tags/components/ReactTags.stories.tsx +140 -0
  288. package/src/molecules/forms/input-tags/components/ReactTags.tsx +38 -0
  289. package/src/molecules/forms/input-text/InputText.interface.ts +5 -0
  290. package/src/molecules/forms/input-text/InputText.spec.tsx +1 -1
  291. package/src/molecules/forms/input-text/InputText.stories.tsx +4 -4
  292. package/src/molecules/forms/input-text/InputText.tsx +38 -53
  293. package/src/molecules/forms/select/{Select.interfaces.ts → Select.interface.ts} +8 -10
  294. package/src/molecules/forms/select/Select.tsx +5 -3
  295. package/src/molecules/forms/select/all.ts +2 -1
  296. package/src/molecules/forms/select/components/ChoicesSelect.stories.tsx +8 -7
  297. package/src/molecules/forms/select/components/ChoicesSelect.tsx +9 -18
  298. package/src/molecules/forms/select/components/HtmlSelect.stories.tsx +7 -7
  299. package/src/molecules/forms/select/components/HtmlSelect.tsx +3 -2
  300. package/src/molecules/forms/select/components/ReactSelect.stories.tsx +10 -8
  301. package/src/molecules/forms/select/components/ReactSelect.tsx +1 -1
  302. package/src/molecules/forms/select/hooks/useOptions.ts +6 -2
  303. package/src/molecules/loader/Loader.spec.tsx +2 -2
  304. package/src/molecules/loader/Loader.stories.tsx +7 -4
  305. package/src/molecules/loader/Loader.tsx +16 -6
  306. package/src/molecules/modal/Modal.stories.tsx +1 -1
  307. package/src/molecules/pagination/Pagination.spec.tsx +11 -11
  308. package/src/molecules/pagination/Pagination.stories.tsx +32 -10
  309. package/src/molecules/pagination/Pagination.tsx +29 -26
  310. package/src/molecules/table/Table.stories.tsx +284 -101
  311. package/src/molecules/table/Table.tsx +91 -86
  312. package/src/molecules/table/all.ts +16 -0
  313. package/src/molecules/table/components/DefaultArrowSort.tsx +20 -4
  314. package/src/molecules/table/components/DefaultCell.tsx +10 -1
  315. package/src/molecules/table/components/DefaultCellFooter.tsx +16 -0
  316. package/src/molecules/table/components/DefaultCellHeader.tsx +33 -13
  317. package/src/molecules/table/components/DefaultCellOperations.tsx +31 -20
  318. package/src/molecules/table/components/DefaultFilter.tsx +42 -0
  319. package/src/molecules/table/components/DefaultOperationButton.tsx +19 -34
  320. package/src/molecules/table/filters/Filters.d.ts +31 -0
  321. package/src/molecules/table/filters/RangeFilter.tsx +43 -0
  322. package/src/molecules/table/filters/SelectFilter.tsx +47 -0
  323. package/src/molecules/table/filters/TextFieldFilter.tsx +36 -0
  324. package/src/molecules/table/hooks/useTable.tsx +76 -0
  325. package/src/molecules/table/hooks/useUniqValues.tsx +10 -0
  326. package/src/molecules/table/interfaces/extends.ts +18 -0
  327. package/src/molecules/table/utils/mapFormToColumns.tsx +69 -26
  328. package/src/molecules/tabs/Tab.tsx +106 -0
  329. package/src/molecules/tabs/TabList.tsx +37 -0
  330. package/src/molecules/tabs/TabPanel.tsx +37 -0
  331. package/src/molecules/tabs/Tabs.spec.tsx +126 -73
  332. package/src/molecules/tabs/Tabs.stories.tsx +298 -65
  333. package/src/molecules/tabs/Tabs.tsx +10 -81
  334. package/src/molecules/tabs/TabsBody.tsx +11 -0
  335. package/src/molecules/tabs/TabsLegacy.stories.tsx +103 -0
  336. package/src/molecules/tabs/TabsLegacy.tsx +86 -0
  337. package/src/molecules/tabs/all.ts +5 -0
  338. package/src/molecules/tabs/context/TabControl.tsx +166 -0
  339. package/src/molecules/tabs/hooks/tabControl.spec.tsx +388 -0
  340. package/src/molecules/tabs/hooks/tabControl.ts +52 -0
  341. package/src/organisms/__fixtures__/form-firstname.fixture.json +1 -0
  342. package/src/organisms/__fixtures__/form.fixture.json +1 -0
  343. package/src/organisms/form/Form.stories.tsx +104 -124
  344. package/src/organisms/form/access/FormAccess.schema.ts +1 -0
  345. package/src/organisms/form/access/FormAccess.stories.tsx +6 -4
  346. package/src/organisms/form/actions/FormAction.stories.tsx +426 -0
  347. package/src/organisms/form/{action → actions}/FormAction.tsx +2 -2
  348. package/src/organisms/form/builder/FormBuilder.stories.tsx +7 -4
  349. package/src/organisms/form/builder/FormEdit.reducer.spec.ts +136 -0
  350. package/src/organisms/form/builder/FormEdit.stories.tsx +16 -13
  351. package/src/organisms/form/builder/FormEdit.tsx +15 -7
  352. package/src/organisms/form/builder/FormEditCtas.tsx +10 -10
  353. package/src/organisms/form/builder/FormParameters.tsx +8 -4
  354. package/src/organisms/form/builder/all.ts +4 -0
  355. package/src/organisms/form/builder/useFormBuilder.ts +12 -7
  356. package/src/organisms/form/builder/useFormEdit.ts +3 -3
  357. package/src/organisms/form/exports/FormExport.stories.tsx +68 -0
  358. package/src/organisms/form/exports/FormExport.tsx +61 -0
  359. package/src/organisms/form/preview/FormPreview.stories.tsx +58 -0
  360. package/src/organisms/form/preview/FormPreview.tsx +23 -0
  361. package/src/organisms/form/settings/FormSettings.component.spec.tsx +3 -1
  362. package/src/organisms/form/settings/FormSettings.stories.tsx +2 -2
  363. package/src/organisms/form/settings/FormSettings.tsx +6 -6
  364. package/src/organisms/form/useForm.ts +2 -3
  365. package/src/organisms/modal/RemoveModal.stories.tsx +1 -1
  366. package/src/organisms/table/actions/ActionsTable.spec.tsx +7 -5
  367. package/src/organisms/table/actions/ActionsTable.stories.tsx +48 -45
  368. package/src/organisms/table/actions/ActionsTable.tsx +14 -18
  369. package/src/organisms/table/forms/FormsTable.stories.tsx +2 -0
  370. package/src/organisms/table/forms/FormsTable.tsx +53 -23
  371. package/src/organisms/table/forms/components/FormsCell.tsx +53 -0
  372. package/src/organisms/table/submissions/SubmissionsTable.stories.tsx +101 -57
  373. package/src/organisms/table/submissions/SubmissionsTable.tsx +12 -5
  374. package/src/organisms/views/FormViews.stories.tsx +221 -0
  375. package/src/organisms/views/FormViews.tsx +148 -0
  376. package/src/registries/components.ts +7 -1
  377. package/src/utils/iconClass.ts +1 -3
  378. package/vite.config.mts +2 -2
  379. package/dist/molecules/forms/select/Select.interfaces.js +0 -2
  380. package/dist/molecules/forms/select/Select.interfaces.js.map +0 -1
  381. package/dist/molecules/table/components/DefaultCells.d.ts +0 -4
  382. package/dist/molecules/table/components/DefaultCells.js +0 -23
  383. package/dist/molecules/table/components/DefaultCells.js.map +0 -1
  384. package/dist/molecules/table/components/DefaultRow.d.ts +0 -12
  385. package/dist/molecules/table/components/DefaultRow.js +0 -26
  386. package/dist/molecules/table/components/DefaultRow.js.map +0 -1
  387. package/dist/molecules/table/components/DragNDropContainer.d.ts +0 -4
  388. package/dist/molecules/table/components/DragNDropContainer.js +0 -10
  389. package/dist/molecules/table/components/DragNDropContainer.js.map +0 -1
  390. package/dist/molecules/table/filters/DefaultColumnFilter.d.ts +0 -10
  391. package/dist/molecules/table/filters/DefaultColumnFilter.js +0 -29
  392. package/dist/molecules/table/filters/DefaultColumnFilter.js.map +0 -1
  393. package/dist/molecules/table/filters/SelectColumnFilter.d.ts +0 -10
  394. package/dist/molecules/table/filters/SelectColumnFilter.js +0 -34
  395. package/dist/molecules/table/filters/SelectColumnFilter.js.map +0 -1
  396. package/dist/molecules/table/filters/SliderColumnFilter.d.ts +0 -9
  397. package/dist/molecules/table/filters/SliderColumnFilter.js +0 -27
  398. package/dist/molecules/table/filters/SliderColumnFilter.js.map +0 -1
  399. package/dist/molecules/table/hooks/useCustomTable.d.ts +0 -128
  400. package/dist/molecules/table/hooks/useCustomTable.js +0 -130
  401. package/dist/molecules/table/hooks/useCustomTable.js.map +0 -1
  402. package/dist/molecules/table/hooks/useDragnDropRow.d.ts +0 -272
  403. package/dist/molecules/table/hooks/useDragnDropRow.js +0 -40
  404. package/dist/molecules/table/hooks/useDragnDropRow.js.map +0 -1
  405. package/dist/molecules/table/hooks/useOperations.d.ts +0 -11
  406. package/dist/molecules/table/hooks/useOperations.js +0 -25
  407. package/dist/molecules/table/hooks/useOperations.js.map +0 -1
  408. package/dist/molecules/table/index.d.ts +0 -15
  409. package/dist/molecules/table/index.js +0 -35
  410. package/dist/molecules/table/index.js.map +0 -1
  411. package/dist/molecules/table/utils/getPageNumbers.js.map +0 -1
  412. package/dist/molecules/table/utils/swapElements.d.ts +0 -1
  413. package/dist/molecules/table/utils/swapElements.js +0 -5
  414. package/dist/molecules/table/utils/swapElements.js.map +0 -1
  415. package/dist/organisms/form/action/FormAction.js +0 -32
  416. package/dist/organisms/form/action/FormAction.js.map +0 -1
  417. package/dist/organisms/table/forms/components/FormCell.d.ts +0 -6
  418. package/dist/organisms/table/forms/components/FormCell.js +0 -50
  419. package/dist/organisms/table/forms/components/FormCell.js.map +0 -1
  420. package/dist/typings.d.js +0 -2
  421. package/dist/typings.d.js.map +0 -1
  422. package/src/molecules/forms/input-tags/InputTags.stories.tsx +0 -81
  423. package/src/molecules/table/components/DefaultCells.tsx +0 -30
  424. package/src/molecules/table/components/DefaultRow.tsx +0 -52
  425. package/src/molecules/table/components/DragNDropContainer.tsx +0 -7
  426. package/src/molecules/table/filters/DefaultColumnFilter.spec.tsx +0 -33
  427. package/src/molecules/table/filters/DefaultColumnFilter.tsx +0 -38
  428. package/src/molecules/table/filters/SelectColumnFilter.spec.tsx +0 -68
  429. package/src/molecules/table/filters/SelectColumnFilter.tsx +0 -51
  430. package/src/molecules/table/filters/SliderColumnFilter.tsx +0 -28
  431. package/src/molecules/table/hooks/useCustomTable.tsx +0 -268
  432. package/src/molecules/table/hooks/useDragnDropRow.ts +0 -80
  433. package/src/molecules/table/hooks/useOperations.tsx +0 -39
  434. package/src/molecules/table/index.ts +0 -15
  435. package/src/molecules/table/utils/swapElements.spec.ts +0 -7
  436. package/src/molecules/table/utils/swapElements.ts +0 -7
  437. package/src/organisms/form/action/FormAction.stories.tsx +0 -364
  438. package/src/organisms/table/forms/components/FormCell.tsx +0 -47
  439. package/src/typings.d.ts +0 -3
  440. package/tsconfig.app.json +0 -11
  441. package/tsconfig.json +0 -21
  442. package/tsconfig.node.json +0 -13
  443. package/tsconfig.spec.json +0 -14
  444. /package/dist/molecules/{table → pagination}/utils/getPageNumbers.d.ts +0 -0
  445. /package/dist/molecules/{table → pagination}/utils/getPageNumbers.js +0 -0
  446. /package/dist/organisms/form/{action → actions}/FormAction.d.ts +0 -0
  447. /package/src/molecules/{table → pagination}/utils/getPageNumbers.ts +0 -0
@@ -1,81 +1,57 @@
1
- import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
- import { createElement as d } from "react";
3
- import { c as z } from "../../chunks/index.js";
4
- import { DrapNDropContainer as H } from "./components/DragNDropContainer.js";
5
- import { useCustomTable as L } from "./hooks/useCustomTable.js";
6
- function R(p) {
7
- const {
8
- className: c,
9
- tableInstance: a,
10
- CellHeader: m,
11
- isLoading: l,
12
- onClick: h,
13
- Loader: g,
14
- EmptyData: b,
15
- Row: u,
16
- data: o,
17
- disablePagination: N,
18
- Pagination: f,
19
- pageIndex: D,
20
- pageSize: P,
21
- pageSizes: v,
22
- setPageSize: x,
23
- totalLength: y,
24
- i18n: I,
25
- enableDragNDrop: r,
26
- children: C,
27
- onDrag: T,
28
- onDrop: k
29
- } = L(p);
30
- return /* @__PURE__ */ e(H, { enableDragNDrop: r, children: /* @__PURE__ */ i("div", { className: z("table-group table-responsive", c), children: [
31
- /* @__PURE__ */ i(
32
- "table",
33
- {
34
- className: "table table-striped table-hover",
35
- ...a.getTableProps(),
36
- children: [
37
- /* @__PURE__ */ e("thead", { children: a.headerGroups.map((t, n) => /* @__PURE__ */ d("tr", { ...t.getHeaderGroupProps(), key: `tableInstance.headerGroups${n}` }, r ? /* @__PURE__ */ e("th", { role: "columnheader", className: "text-center", children: /* @__PURE__ */ e("div", { className: "table-cell-header" }) }) : null, t.headers.map((s) => /* @__PURE__ */ d(
38
- "th",
39
- {
40
- ...s.getHeaderProps(),
41
- key: `tableInstance.headers.column.${s.id}`
42
- },
43
- /* @__PURE__ */ e(m, { column: s })
44
- )))) }),
45
- l ? null : /* @__PURE__ */ e("tbody", { ...a.getTableBodyProps(), children: a.page.map((t, n) => (a.prepareRow(t), /* @__PURE__ */ e(
46
- u,
47
- {
48
- index: n,
49
- enableDragNDrop: r,
50
- onClick: h,
51
- row: t,
52
- onDrag: T,
53
- onDrop: k
54
- },
55
- `tableInstance.page.${t.id}`
56
- ))) })
57
- ]
58
- }
59
- ),
60
- l ? /* @__PURE__ */ e(g, {}) : null,
61
- o.length ? null : /* @__PURE__ */ e(b, {}),
62
- !l && o.length && !N ? /* @__PURE__ */ e("div", { className: "overflow-hidden", children: /* @__PURE__ */ e(
63
- f,
64
- {
65
- ...a,
66
- totalLength: y,
67
- className: "text-sm",
68
- pageIndex: D,
69
- pageSize: P,
70
- pageSizes: v,
71
- setPageSize: x,
72
- i18n: I
73
- }
74
- ) }) : null,
75
- C
76
- ] }) });
1
+ import { jsxs as l, jsx as n } from "react/jsx-runtime";
2
+ import { createElement as h } from "react";
3
+ import { flexRender as x } from "@tanstack/react-table";
4
+ import { c as C } from "../../chunks/index.js";
5
+ import { getComponent as r } from "../../registries/components.js";
6
+ import { useTable as f } from "./hooks/useTable.js";
7
+ function w({
8
+ className: c,
9
+ enableFooter: g,
10
+ children: m,
11
+ ...i
12
+ }) {
13
+ const { tableInstance: a, i18n: d } = f(i), u = r("CellHeader"), P = r("CellFooter"), p = r("Pagination"), { pagination: o } = a.getState();
14
+ return /* @__PURE__ */ l("div", { className: C("table-group table-responsive", c), children: [
15
+ /* @__PURE__ */ l("table", { className: "table table-striped table-hover", children: [
16
+ /* @__PURE__ */ n("thead", { children: a.getHeaderGroups().map((t) => /* @__PURE__ */ n("tr", { children: t.headers.map((e) => {
17
+ const s = e.column.getIsSorted();
18
+ return /* @__PURE__ */ n(
19
+ "th",
20
+ {
21
+ "data-testid": `head-cell-${e.id}`,
22
+ "aria-sort": s ? s === "asc" ? "ascending" : "descending" : "none",
23
+ children: e.isPlaceholder ? null : /* @__PURE__ */ n(u, { header: e, i18n: d })
24
+ },
25
+ e.id
26
+ );
27
+ }) }, t.id)) }),
28
+ /* @__PURE__ */ n("tbody", { children: a.getRowModel().rows.map((t) => /* @__PURE__ */ n("tr", { "data-testid": `body-row-${t.id}`, children: t.getVisibleCells().filter((e) => !e.column.columnDef.meta?.hidden).map((e) => /* @__PURE__ */ h("td", { ...e.column.columnDef?.meta?.cellProps, key: e.id, "data-testid": `body-cell-${e.id}` }, x(e.column.columnDef.cell, e.getContext()))) }, t.id)) }),
29
+ g && /* @__PURE__ */ n("tfoot", { children: a.getFooterGroups().map((t) => /* @__PURE__ */ n("tr", { children: t.headers.map((e) => /* @__PURE__ */ n("th", { children: e.isPlaceholder ? null : /* @__PURE__ */ n(P, { header: e, i18n: d }) }, e.id)) }, t.id)) })
30
+ ] }),
31
+ /* @__PURE__ */ l("div", { className: "overflow-hidden flex flex-wrap", children: [
32
+ i.data.length && o ? /* @__PURE__ */ n(
33
+ p,
34
+ {
35
+ className: "flex-1",
36
+ canNextPage: a.getCanNextPage(),
37
+ canPreviousPage: a.getCanPreviousPage(),
38
+ pageIndex: o.pageIndex,
39
+ pageSize: o.pageSize,
40
+ pageSizes: i.pageSizes,
41
+ i18n: i.i18n,
42
+ pageCount: a.getPageCount(),
43
+ rowCount: i.rowCount,
44
+ onPageIndexChange: (t) => a.setPageIndex(t),
45
+ onClickPreviousPage: () => a.previousPage(),
46
+ onClickNextPage: () => a.nextPage(),
47
+ onPageSizeChange: (t) => a.setPageSize(t)
48
+ }
49
+ ) : null,
50
+ /* @__PURE__ */ n("div", { children: m })
51
+ ] })
52
+ ] });
77
53
  }
78
54
  export {
79
- R as Table
55
+ w as Table
80
56
  };
81
57
  //# sourceMappingURL=Table.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Table.js","sources":["../../../src/molecules/table/Table.tsx"],"sourcesContent":["import classnames from \"classnames\";\nimport { PropsWithChildren } from \"react\";\n\nimport { PaginationProps } from \"../../molecules/pagination/Pagination\";\nimport { DrapNDropContainer } from \"./components/DragNDropContainer\";\nimport { TableProps, useCustomTable } from \"./hooks/useCustomTable\";\n\nexport function Table<Data extends object = any>(props: PropsWithChildren<TableProps<Data>>) {\n const {\n className,\n tableInstance,\n CellHeader,\n isLoading,\n onClick,\n Loader,\n EmptyData,\n Row,\n data,\n disablePagination,\n Pagination,\n pageIndex,\n pageSize,\n pageSizes,\n setPageSize,\n totalLength,\n i18n,\n enableDragNDrop,\n children,\n onDrag,\n onDrop\n } = useCustomTable(props);\n\n // Render the UI for your table\n return (\n <DrapNDropContainer enableDragNDrop={enableDragNDrop}>\n <div className={classnames(\"table-group table-responsive\", className)}>\n <table\n className={\"table table-striped table-hover\"}\n {...tableInstance.getTableProps()}\n /* style={{ marginBottom: disablePagination ? \"-1px\" : \"0px\" }} */\n >\n <thead>\n {tableInstance.headerGroups.map((headerGroup, i) => (\n <tr {...headerGroup.getHeaderGroupProps()} key={`tableInstance.headerGroups${i}`}>\n {enableDragNDrop ? (\n <th role='columnheader' className='text-center'>\n <div className='table-cell-header'></div>\n </th>\n ) : null}\n {headerGroup.headers.map((column) => (\n <th\n /* className='text-left py-2 align-top' */\n {...column.getHeaderProps()}\n key={`tableInstance.headers.column.${column.id}`}\n >\n <CellHeader column={column} />\n </th>\n ))}\n </tr>\n ))}\n </thead>\n {!isLoading ? (\n <tbody {...tableInstance.getTableBodyProps()}>\n {(tableInstance as unknown as { page: any[] }).page.map((row: any, index: number) => {\n tableInstance.prepareRow(row);\n return (\n <Row<Data>\n index={index}\n enableDragNDrop={enableDragNDrop}\n onClick={onClick}\n row={row}\n key={`tableInstance.page.${row.id}`}\n onDrag={onDrag}\n onDrop={onDrop}\n />\n );\n })}\n </tbody>\n ) : null}\n </table>\n {isLoading ? <Loader /> : null}\n {!data.length ? <EmptyData /> : null}\n {!isLoading && data.length && !disablePagination ? (\n <div className={\"overflow-hidden\"}>\n <Pagination\n {...(tableInstance as unknown as PaginationProps)}\n totalLength={totalLength}\n className={\"text-sm\"}\n pageIndex={pageIndex}\n pageSize={pageSize}\n pageSizes={pageSizes}\n setPageSize={setPageSize}\n i18n={i18n}\n />\n </div>\n ) : null}\n {children}\n </div>\n </DrapNDropContainer>\n );\n}\n"],"names":["Table","props","className","tableInstance","CellHeader","isLoading","onClick","Loader","EmptyData","Row","data","disablePagination","Pagination","pageIndex","pageSize","pageSizes","setPageSize","totalLength","i18n","enableDragNDrop","children","onDrag","onDrop","useCustomTable","jsx","DrapNDropContainer","jsxs","classnames","headerGroup","i","createElement","column","row","index"],"mappings":";;;;;AAOO,SAASA,EAAiCC,GAA4C;AACrF,QAAA;AAAA,IACJ,WAAAC;AAAA,IACA,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,QAAAC;AAAA,IACA,WAAAC;AAAA,IACA,KAAAC;AAAA,IACA,MAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,aAAAC;AAAA,IACA,aAAAC;AAAA,IACA,MAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,QAAAC;AAAA,IACA,QAAAC;AAAA,EAAA,IACEC,EAAetB,CAAK;AAItB,SAAA,gBAAAuB,EAACC,KAAmB,iBAAAN,GAClB,UAAA,gBAAAO,EAAC,SAAI,WAAWC,EAAW,gCAAgCzB,CAAS,GAClE,UAAA;AAAA,IAAA,gBAAAwB;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAW;AAAA,QACV,GAAGvB,EAAc,cAAc;AAAA,QAGhC,UAAA;AAAA,UAAA,gBAAAqB,EAAC,SACE,EAAA,UAAArB,EAAc,aAAa,IAAI,CAACyB,GAAaC,MAC3C,gBAAAC,EAAA,MAAA,EAAI,GAAGF,EAAY,oBAAuB,GAAA,KAAK,6BAA6BC,CAAC,MAC3EV,IACC,gBAAAK,EAAC,QAAG,MAAK,gBAAe,WAAU,eAChC,4BAAC,OAAI,EAAA,WAAU,oBAAoB,CAAA,EACrC,CAAA,IACE,MACHI,EAAY,QAAQ,IAAI,CAACG,MACxB,gBAAAD;AAAA,YAAC;AAAA,YAAA;AAAA,cAEE,GAAGC,EAAO,eAAe;AAAA,cAC1B,KAAK,gCAAgCA,EAAO,EAAE;AAAA,YAAA;AAAA,YAE9C,gBAAAP,EAACpB,KAAW,QAAA2B,EAAgB,CAAA;AAAA,UAAA,CAE/B,CACH,CACD,EACH,CAAA;AAAA,UACE1B,IAiBE,OAhBD,gBAAAmB,EAAA,SAAA,EAAO,GAAGrB,EAAc,kBAAkB,GACvC,UAA6CA,EAAA,KAAK,IAAI,CAAC6B,GAAUC,OACjE9B,EAAc,WAAW6B,CAAG,GAE1B,gBAAAR;AAAA,YAACf;AAAA,YAAA;AAAA,cACC,OAAAwB;AAAA,cACA,iBAAAd;AAAA,cACA,SAAAb;AAAA,cACA,KAAA0B;AAAA,cAEA,QAAAX;AAAA,cACA,QAAAC;AAAA,YAAA;AAAA,YAFK,sBAAsBU,EAAI,EAAE;AAAA,UAGnC,EAEH,EACH,CAAA;AAAA,QACE;AAAA,MAAA;AAAA,IACN;AAAA,IACC3B,IAAa,gBAAAmB,EAAAjB,GAAA,CAAA,CAAO,IAAK;AAAA,IACxBG,EAAK,SAAyB,OAAhB,gBAAAc,EAAChB,KAAU;AAAA,IAC1B,CAACH,KAAaK,EAAK,UAAU,CAACC,IAC7B,gBAAAa,EAAC,OAAI,EAAA,WAAW,mBACd,UAAA,gBAAAA;AAAA,MAACZ;AAAA,MAAA;AAAA,QACE,GAAIT;AAAA,QACL,aAAAc;AAAA,QACA,WAAW;AAAA,QACX,WAAAJ;AAAA,QACA,UAAAC;AAAA,QACA,WAAAC;AAAA,QACA,aAAAC;AAAA,QACA,MAAAE;AAAA,MAAA;AAAA,OAEJ,IACE;AAAA,IACHE;AAAA,EAAA,EAAA,CACH,EACF,CAAA;AAEJ;"}
1
+ {"version":3,"file":"Table.js","sources":["../../../src/molecules/table/Table.tsx"],"sourcesContent":["import { flexRender } from \"@tanstack/react-table\";\nimport cx from \"classnames\";\nimport { PropsWithChildren } from \"react\";\n\nimport type { JSON } from \"../../interfaces/index.js\";\nimport { getComponent } from \"../../registries/components\";\nimport type { Pagination as DefaultPagination } from \"../pagination/Pagination\";\nimport type { DefaultCellFooter } from \"./components/DefaultCellFooter\";\nimport type { DefaultCellHeader } from \"./components/DefaultCellHeader\";\nimport { useTable, UseTableProps } from \"./hooks/useTable\";\n\nexport interface TableProps<Data extends { [key: string]: JSON } = { [key: string]: JSON }> extends UseTableProps<Data> {\n className?: string;\n\n enableFooter?: boolean;\n\n pageSizes?: number[];\n}\n\nexport function Table<Data extends { [key: string]: JSON } = { [key: string]: JSON }>({\n className,\n enableFooter,\n children,\n ...props\n}: PropsWithChildren<TableProps<Data>>) {\n const { tableInstance, i18n } = useTable<Data>(props);\n const CellHeader = getComponent<typeof DefaultCellHeader>(\"CellHeader\");\n const CellFooter = getComponent<typeof DefaultCellFooter>(\"CellFooter\");\n const Pagination = getComponent<typeof DefaultPagination>(\"Pagination\");\n\n const { pagination } = tableInstance.getState();\n\n return (\n <div className={cx(\"table-group table-responsive\", className)}>\n <table className='table table-striped table-hover'>\n <thead>\n {tableInstance.getHeaderGroups().map((headerGroup) => (\n <tr key={headerGroup.id}>\n {headerGroup.headers.map((header) => {\n const sort = header.column.getIsSorted();\n return (\n <th\n data-testid={`head-cell-${header.id}`}\n key={header.id}\n aria-sort={sort ? (sort === \"asc\" ? \"ascending\" : \"descending\") : \"none\"}\n >\n {header.isPlaceholder ? null : <CellHeader header={header} i18n={i18n} />}\n </th>\n );\n })}\n </tr>\n ))}\n </thead>\n <tbody>\n {tableInstance.getRowModel().rows.map((row) => {\n return (\n <tr key={row.id} data-testid={`body-row-${row.id}`}>\n {row\n .getVisibleCells()\n .filter((cell) => !cell.column.columnDef.meta?.hidden)\n .map((cell) => {\n return (\n <td {...cell.column.columnDef?.meta?.cellProps} key={cell.id} data-testid={`body-cell-${cell.id}`}>\n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n </td>\n );\n })}\n </tr>\n );\n })}\n </tbody>\n {enableFooter && (\n <tfoot>\n {tableInstance.getFooterGroups().map((footerGroup) => (\n <tr key={footerGroup.id}>\n {footerGroup.headers.map((header) => (\n <th key={header.id}>{header.isPlaceholder ? null : <CellFooter header={header} i18n={i18n} />}</th>\n ))}\n </tr>\n ))}\n </tfoot>\n )}\n </table>\n <div className={\"overflow-hidden flex flex-wrap\"}>\n {props.data.length && pagination ? (\n <Pagination\n className={\"flex-1\"}\n canNextPage={tableInstance.getCanNextPage()}\n canPreviousPage={tableInstance.getCanPreviousPage()}\n pageIndex={pagination.pageIndex}\n pageSize={pagination.pageSize}\n pageSizes={props.pageSizes}\n i18n={props.i18n}\n pageCount={tableInstance.getPageCount()}\n rowCount={props.rowCount}\n onPageIndexChange={(page) => tableInstance.setPageIndex(page)}\n onClickPreviousPage={() => tableInstance.previousPage()}\n onClickNextPage={() => tableInstance.nextPage()}\n onPageSizeChange={(pageSize) => tableInstance.setPageSize(pageSize)}\n />\n ) : null}\n <div>{children}</div>\n </div>\n </div>\n );\n}\n"],"names":["Table","className","enableFooter","children","props","tableInstance","i18n","useTable","CellHeader","getComponent","CellFooter","Pagination","pagination","cx","jsxs","jsx","headerGroup","header","sort","row","cell","createElement","flexRender","footerGroup","page","pageSize"],"mappings":";;;;;;AAmBO,SAASA,EAAsE;AAAA,EACpF,WAAAC;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,GAAwC;AACtC,QAAM,EAAE,eAAAC,GAAe,MAAAC,MAASC,EAAeH,CAAK,GAC9CI,IAAaC,EAAuC,YAAY,GAChEC,IAAaD,EAAuC,YAAY,GAChEE,IAAaF,EAAuC,YAAY,GAEhE,EAAE,YAAAG,EAAA,IAAeP,EAAc,SAAA;AAErC,2BACG,OAAA,EAAI,WAAWQ,EAAG,gCAAgCZ,CAAS,GAC1D,UAAA;AAAA,IAAA,gBAAAa,EAAC,SAAA,EAAM,WAAU,mCACf,UAAA;AAAA,MAAA,gBAAAC,EAAC,SAAA,EACE,UAAAV,EAAc,gBAAA,EAAkB,IAAI,CAACW,MACpC,gBAAAD,EAAC,MAAA,EACE,UAAAC,EAAY,QAAQ,IAAI,CAACC,MAAW;AACnC,cAAMC,IAAOD,EAAO,OAAO,YAAA;AAC3B,eACE,gBAAAF;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,eAAa,aAAaE,EAAO,EAAE;AAAA,YAEnC,aAAWC,IAAQA,MAAS,QAAQ,cAAc,eAAgB;AAAA,YAEjE,YAAO,gBAAgB,OAAO,gBAAAH,EAACP,GAAA,EAAW,QAAAS,GAAgB,MAAAX,EAAA,CAAY;AAAA,UAAA;AAAA,UAHlEW,EAAO;AAAA,QAAA;AAAA,MAMlB,CAAC,EAAA,GAZMD,EAAY,EAarB,CACD,EAAA,CACH;AAAA,MACA,gBAAAD,EAAC,WACE,UAAAV,EAAc,YAAA,EAAc,KAAK,IAAI,CAACc,MAEnC,gBAAAJ,EAAC,QAAgB,eAAa,YAAYI,EAAI,EAAE,IAC7C,UAAAA,EACE,kBACA,OAAO,CAACC,MAAS,CAACA,EAAK,OAAO,UAAU,MAAM,MAAM,EACpD,IAAI,CAACA,MAEF,gBAAAC,EAAC,MAAA,EAAI,GAAGD,EAAK,OAAO,WAAW,MAAM,WAAW,KAAKA,EAAK,IAAI,eAAa,aAAaA,EAAK,EAAE,GAAA,GAC5FE,EAAWF,EAAK,OAAO,UAAU,MAAMA,EAAK,WAAA,CAAY,CAC3D,CAEH,EAAA,GAVID,EAAI,EAWb,CAEH,EAAA,CACH;AAAA,MACCjB,KACC,gBAAAa,EAAC,SAAA,EACE,UAAAV,EAAc,kBAAkB,IAAI,CAACkB,MACpC,gBAAAR,EAAC,MAAA,EACE,UAAAQ,EAAY,QAAQ,IAAI,CAACN,MACxB,gBAAAF,EAAC,MAAA,EAAoB,UAAAE,EAAO,gBAAgB,OAAO,gBAAAF,EAACL,KAAW,QAAAO,GAAgB,MAAAX,EAAA,CAAY,EAAA,GAAlFW,EAAO,EAA8E,CAC/F,EAAA,GAHMM,EAAY,EAIrB,CACD,EAAA,CACH;AAAA,IAAA,GAEJ;AAAA,IACA,gBAAAT,EAAC,OAAA,EAAI,WAAW,kCACb,UAAA;AAAA,MAAAV,EAAM,KAAK,UAAUQ,IACpB,gBAAAG;AAAA,QAACJ;AAAA,QAAA;AAAA,UACC,WAAW;AAAA,UACX,aAAaN,EAAc,eAAA;AAAA,UAC3B,iBAAiBA,EAAc,mBAAA;AAAA,UAC/B,WAAWO,EAAW;AAAA,UACtB,UAAUA,EAAW;AAAA,UACrB,WAAWR,EAAM;AAAA,UACjB,MAAMA,EAAM;AAAA,UACZ,WAAWC,EAAc,aAAA;AAAA,UACzB,UAAUD,EAAM;AAAA,UAChB,mBAAmB,CAACoB,MAASnB,EAAc,aAAamB,CAAI;AAAA,UAC5D,qBAAqB,MAAMnB,EAAc,aAAA;AAAA,UACzC,iBAAiB,MAAMA,EAAc,SAAA;AAAA,UACrC,kBAAkB,CAACoB,MAAapB,EAAc,YAAYoB,CAAQ;AAAA,QAAA;AAAA,MAAA,IAElE;AAAA,MACJ,gBAAAV,EAAC,SAAK,UAAAZ,EAAA,CAAS;AAAA,IAAA,EAAA,CACjB;AAAA,EAAA,GACF;AAEJ;"}
File without changes
@@ -0,0 +1,19 @@
1
+ import "./components/DefaultFilter.js";
2
+ import "./components/DefaultArrowSort.js";
3
+ import "./components/DefaultCell.js";
4
+ import "./components/DefaultCellOperations.js";
5
+ import "./components/DefaultOperationButton.js";
6
+ import "./components/DefaultCellHeader.js";
7
+ import "./components/DefaultCellFooter.js";
8
+ import "../forms/input-text/InputText.js";
9
+ import "../forms/form-control/FormControl.js";
10
+ import "../forms/select/components/ReactSelect.js";
11
+ import "../forms/select/components/HtmlSelect.js";
12
+ import "../forms/select/components/ChoicesSelect.js";
13
+ import "../forms/select/Select.js";
14
+ import "./filters/TextFieldFilter.js";
15
+ import "./filters/SelectFilter.js";
16
+ import "./filters/RangeFilter.js";
17
+ import "../pagination/Pagination.js";
18
+ import "../pagination/PaginationButton.js";
19
+ //# sourceMappingURL=all.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"all.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
@@ -1 +1,5 @@
1
- export declare function DefaultArrowSort({ column }: any): import("react/jsx-runtime").JSX.Element;
1
+ import { Header } from '@tanstack/react-table';
2
+ export interface DefaultArrowSortProps<Data = any> {
3
+ header: Header<Data, unknown>;
4
+ }
5
+ export declare function DefaultArrowSort<Data>({ header }: DefaultArrowSortProps<Data>): import("react/jsx-runtime").JSX.Element;
@@ -1,10 +1,22 @@
1
- import { jsx as o } from "react/jsx-runtime";
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { registerComponent as s } from "../../../registries/components.js";
2
3
  import { iconClass as e } from "../../../utils/iconClass.js";
3
- function n({ column: r }) {
4
- const { isSorted: s, isSortedDesc: t } = r;
5
- return /* @__PURE__ */ o("span", { className: "table-arrow-sort", children: s ? /* @__PURE__ */ o("i", { className: e(void 0, t ? "sort-up" : "sort-down") }) : "" });
4
+ function a({ header: r }) {
5
+ const o = r.column.getIsSorted();
6
+ return /* @__PURE__ */ t(
7
+ "span",
8
+ {
9
+ "data-testid": `head-sort-${r.column.id}`,
10
+ role: "button",
11
+ "aria-label": `Sort by ${r.column.columnDef.header}`,
12
+ "aria-pressed": o ? o === "desc" : void 0,
13
+ className: "table-arrow-sort",
14
+ children: o ? /* @__PURE__ */ t("i", { className: e(void 0, o === "asc" ? "sort-up" : "sort-down") }) : null
15
+ }
16
+ );
6
17
  }
18
+ s("ArrowSort", a);
7
19
  export {
8
- n as DefaultArrowSort
20
+ a as DefaultArrowSort
9
21
  };
10
22
  //# sourceMappingURL=DefaultArrowSort.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultArrowSort.js","sources":["../../../../src/molecules/table/components/DefaultArrowSort.tsx"],"sourcesContent":["import { iconClass } from \"../../../utils/iconClass\";\n\nexport function DefaultArrowSort({ column }: any) {\n const { isSorted, isSortedDesc } = column;\n return (\n <span className={\"table-arrow-sort\"}>\n {isSorted ? <i className={iconClass(undefined, isSortedDesc ? \"sort-up\" : \"sort-down\")} /> : \"\"}\n </span>\n );\n}\n"],"names":["DefaultArrowSort","column","isSorted","isSortedDesc","jsx","iconClass"],"mappings":";;AAEgB,SAAAA,EAAiB,EAAE,QAAAC,KAAe;AAC1C,QAAA,EAAE,UAAAC,GAAU,cAAAC,EAAA,IAAiBF;AACnC,SACG,gBAAAG,EAAA,QAAA,EAAK,WAAW,oBACd,cAAY,gBAAAA,EAAA,KAAA,EAAE,WAAWC,EAAU,QAAWF,IAAe,YAAY,WAAW,EAAA,CAAG,IAAK,IAC/F;AAEJ;"}
1
+ {"version":3,"file":"DefaultArrowSort.js","sources":["../../../../src/molecules/table/components/DefaultArrowSort.tsx"],"sourcesContent":["import type { Header } from \"@tanstack/react-table\";\n\nimport { registerComponent } from \"../../../registries/components\";\nimport { iconClass } from \"../../../utils/iconClass\";\n\nexport interface DefaultArrowSortProps<Data = any> {\n header: Header<Data, unknown>;\n}\n\nexport function DefaultArrowSort<Data>({ header }: DefaultArrowSortProps<Data>) {\n const sort = header.column.getIsSorted();\n\n return (\n <span\n data-testid={`head-sort-${header.column.id}`}\n role='button'\n aria-label={`Sort by ${header.column.columnDef.header}`}\n aria-pressed={sort ? sort === \"desc\" : undefined}\n className='table-arrow-sort'\n >\n {sort ? <i className={iconClass(undefined, sort === \"asc\" ? \"sort-up\" : \"sort-down\")} /> : null}\n </span>\n );\n}\n\nregisterComponent(\"ArrowSort\", DefaultArrowSort);\n"],"names":["DefaultArrowSort","header","sort","jsx","iconClass","registerComponent"],"mappings":";;;AASO,SAASA,EAAuB,EAAE,QAAAC,KAAuC;AAC9E,QAAMC,IAAOD,EAAO,OAAO,YAAA;AAE3B,SACE,gBAAAE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,eAAa,aAAaF,EAAO,OAAO,EAAE;AAAA,MAC1C,MAAK;AAAA,MACL,cAAY,WAAWA,EAAO,OAAO,UAAU,MAAM;AAAA,MACrD,gBAAcC,IAAOA,MAAS,SAAS;AAAA,MACvC,WAAU;AAAA,MAET,UAAAA,IAAO,gBAAAC,EAAC,KAAA,EAAE,WAAWC,EAAU,QAAWF,MAAS,QAAQ,YAAY,WAAW,EAAA,CAAG,IAAK;AAAA,IAAA;AAAA,EAAA;AAGjG;AAEAG,EAAkB,aAAaL,CAAgB;"}
@@ -1 +1,5 @@
1
- export declare function DefaultCell({ value, render }: any): JSX.Element;
1
+ export interface DefaultCellProps<Data = any> {
2
+ value: Data;
3
+ render?: (value: Data) => any;
4
+ }
5
+ export declare function DefaultCell<Data = any>({ value, render }: DefaultCellProps<Data>): JSX.Element;
@@ -1,11 +1,13 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- function o({ value: r, render: e = (n) => n }) {
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { registerComponent as o } from "../../../registries/components.js";
3
+ function i({ value: r, render: t = (n) => n }) {
3
4
  if (r === void 0)
4
- return /* @__PURE__ */ t("span", {});
5
- const n = e(r);
6
- return r !== n ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: n } }) : /* @__PURE__ */ t("span", { children: String(r) });
5
+ return /* @__PURE__ */ e("span", {});
6
+ const n = t(r);
7
+ return r !== n ? /* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: n } }) : /* @__PURE__ */ e("span", { children: String(r) });
7
8
  }
9
+ o("Cell", i);
8
10
  export {
9
- o as DefaultCell
11
+ i as DefaultCell
10
12
  };
11
13
  //# sourceMappingURL=DefaultCell.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultCell.js","sources":["../../../../src/molecules/table/components/DefaultCell.tsx"],"sourcesContent":["export function DefaultCell({ value, render = (f: any) => f }: any): JSX.Element {\n if (value === undefined) {\n return <span></span>;\n }\n\n const rendered = render(value);\n\n if (value !== rendered) {\n return <div dangerouslySetInnerHTML={{ __html: rendered }} />;\n }\n\n return <span>{String(value)}</span>;\n}\n"],"names":["DefaultCell","value","render","f","rendered","jsx"],"mappings":";AAAO,SAASA,EAAY,EAAE,OAAAC,GAAO,QAAAC,IAAS,CAACC,MAAWA,KAAuB;AAC/E,MAAIF,MAAU;AACZ,6BAAQ,QAAK,EAAA;AAGT,QAAAG,IAAWF,EAAOD,CAAK;AAE7B,SAAIA,MAAUG,sBACJ,OAAI,EAAA,yBAAyB,EAAE,QAAQA,KAAY,IAGrD,gBAAAC,EAAA,QAAA,EAAM,UAAO,OAAAJ,CAAK,GAAE;AAC9B;"}
1
+ {"version":3,"file":"DefaultCell.js","sources":["../../../../src/molecules/table/components/DefaultCell.tsx"],"sourcesContent":["import { registerComponent } from \"../../../registries/components\";\n\nexport interface DefaultCellProps<Data = any> {\n value: Data;\n render?: (value: Data) => any;\n}\n\nexport function DefaultCell<Data = any>({ value, render = (f: any) => f }: DefaultCellProps<Data>): JSX.Element {\n if (value === undefined) {\n return <span></span>;\n }\n\n const rendered = render(value);\n\n if (value !== rendered) {\n return <div dangerouslySetInnerHTML={{ __html: rendered }} />;\n }\n\n return <span>{String(value)}</span>;\n}\n\nregisterComponent(\"Cell\", DefaultCell);\n"],"names":["DefaultCell","value","render","f","rendered","jsx","registerComponent"],"mappings":";;AAOO,SAASA,EAAwB,EAAE,OAAAC,GAAO,QAAAC,IAAS,CAACC,MAAWA,KAA0C;AAC9G,MAAIF,MAAU;AACZ,6BAAQ,QAAA,EAAK;AAGf,QAAMG,IAAWF,EAAOD,CAAK;AAE7B,SAAIA,MAAUG,sBACJ,OAAA,EAAI,yBAAyB,EAAE,QAAQA,KAAY,IAGtD,gBAAAC,EAAC,QAAA,EAAM,UAAA,OAAOJ,CAAK,GAAE;AAC9B;AAEAK,EAAkB,QAAQN,CAAW;"}
@@ -0,0 +1,6 @@
1
+ import { Header } from '@tanstack/react-table';
2
+ export interface DefaultCellHeaderProps<Data = any> {
3
+ header: Header<Data, unknown>;
4
+ i18n?: (f: string) => string;
5
+ }
6
+ export declare function DefaultCellFooter<Data = any>(props: DefaultCellHeaderProps<Data>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { jsx as r, Fragment as t } from "react/jsx-runtime";
2
+ import { flexRender as n } from "@tanstack/react-table";
3
+ import { registerComponent as m } from "../../../registries/components.js";
4
+ function l(o) {
5
+ const { header: e } = o;
6
+ return /* @__PURE__ */ r(t, { children: n(e.column.columnDef.footer, e.getContext()) });
7
+ }
8
+ m("CellFooter", l);
9
+ export {
10
+ l as DefaultCellFooter
11
+ };
12
+ //# sourceMappingURL=DefaultCellFooter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultCellFooter.js","sources":["../../../../src/molecules/table/components/DefaultCellFooter.tsx"],"sourcesContent":["import { flexRender, type Header } from \"@tanstack/react-table\";\n\nimport { registerComponent } from \"../../../registries/components\";\n\nexport interface DefaultCellHeaderProps<Data = any> {\n header: Header<Data, unknown>;\n i18n?: (f: string) => string;\n}\n\nexport function DefaultCellFooter<Data = any>(props: DefaultCellHeaderProps<Data>) {\n const { header } = props;\n\n return <>{flexRender(header.column.columnDef.footer, header.getContext())}</>;\n}\n\nregisterComponent(\"CellFooter\", DefaultCellFooter);\n"],"names":["DefaultCellFooter","props","header","jsx","Fragment","registerComponent"],"mappings":";;;AASO,SAASA,EAA8BC,GAAqC;AACjF,QAAM,EAAE,QAAAC,MAAWD;AAEnB,SAAO,gBAAAE,EAAAC,GAAA,EAAG,YAAWF,EAAO,OAAO,UAAU,QAAQA,EAAO,WAAA,CAAY,EAAA,CAAE;AAC5E;AAEAG,EAAkB,cAAcL,CAAiB;"}
@@ -1,9 +1,6 @@
1
- import { HeaderGroup } from 'react-table';
2
- export interface DefaultCellHeaderProps<Data extends object = any> extends Record<string, unknown> {
3
- column: HeaderGroup<Data> & {
4
- getSortByToggleProps: () => Record<string, unknown>;
5
- canFilter: boolean;
6
- render: (key: string) => any;
7
- };
1
+ import { Header } from '@tanstack/react-table';
2
+ export interface DefaultCellHeaderProps<Data = any> {
3
+ header: Header<Data, unknown>;
4
+ i18n?: (f: string) => string;
8
5
  }
9
- export declare function DefaultCellHeader<Data extends Record<string, unknown> = {}>({ column }: DefaultCellHeaderProps<Data>): import("react/jsx-runtime").JSX.Element;
6
+ export declare function DefaultCellHeader<Data = any>(props: DefaultCellHeaderProps<Data>): import("react/jsx-runtime").JSX.Element;
@@ -1,14 +1,30 @@
1
- import { jsxs as r, jsx as l } from "react/jsx-runtime";
2
- function d({ column: e }) {
3
- return /* @__PURE__ */ r("div", { className: "table-cell-header", children: [
4
- /* @__PURE__ */ r("div", { className: "table-cell-header__label", ...e.getSortByToggleProps(), children: [
5
- /* @__PURE__ */ l("span", { children: e.render("Header") }),
6
- e.render("ArrowSort")
7
- ] }),
8
- e.canFilter ? /* @__PURE__ */ l("div", { className: "table-cell-header__filter", children: e.render("Filter") }) : null
1
+ import { jsxs as o, jsx as r } from "react/jsx-runtime";
2
+ import { flexRender as d } from "@tanstack/react-table";
3
+ import { c as t } from "../../../chunks/index.js";
4
+ import { registerComponent as g, getComponent as n } from "../../../registries/components.js";
5
+ function u(l) {
6
+ const { header: e, i18n: c } = l, a = n("ArrowSort"), i = n("Filter"), m = e.column.getCanSort(), s = e.column.getCanFilter();
7
+ return /* @__PURE__ */ o("div", { className: t("table-cell-header", {}), children: [
8
+ /* @__PURE__ */ o(
9
+ "div",
10
+ {
11
+ className: t("table-cell-header__label", {
12
+ "cursor-pointer select-none": e.column.getCanSort()
13
+ }),
14
+ ...m ? {
15
+ onClick: e.column.getToggleSortingHandler()
16
+ } : {},
17
+ children: [
18
+ /* @__PURE__ */ r("span", { children: d(e.column.columnDef.header, e.getContext()) }),
19
+ /* @__PURE__ */ r(a, { header: e })
20
+ ]
21
+ }
22
+ ),
23
+ s && /* @__PURE__ */ r(i, { header: e, i18n: c })
9
24
  ] });
10
25
  }
26
+ g("CellHeader", u);
11
27
  export {
12
- d as DefaultCellHeader
28
+ u as DefaultCellHeader
13
29
  };
14
30
  //# sourceMappingURL=DefaultCellHeader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultCellHeader.js","sources":["../../../../src/molecules/table/components/DefaultCellHeader.tsx"],"sourcesContent":["import { HeaderGroup } from \"react-table\";\n\nexport interface DefaultCellHeaderProps<Data extends object = any> extends Record<string, unknown> {\n column: HeaderGroup<Data> & {\n getSortByToggleProps: () => Record<string, unknown>;\n canFilter: boolean;\n render: (key: string) => any;\n };\n}\n\nexport function DefaultCellHeader<Data extends Record<string, unknown> = {}>({ column }: DefaultCellHeaderProps<Data>) {\n return (\n <div className={\"table-cell-header\"}>\n <div className='table-cell-header__label' {...column.getSortByToggleProps()}>\n <span>{column.render(\"Header\") as any}</span>\n\n {column.render(\"ArrowSort\") as any}\n </div>\n {column.canFilter ? <div className='table-cell-header__filter'>{column.render(\"Filter\") as any}</div> : null}\n </div>\n );\n}\n"],"names":["DefaultCellHeader","column","jsxs","jsx"],"mappings":";AAUgB,SAAAA,EAA6D,EAAE,QAAAC,KAAwC;AAEnH,SAAA,gBAAAC,EAAC,OAAI,EAAA,WAAW,qBACd,UAAA;AAAA,IAAA,gBAAAA,EAAC,SAAI,WAAU,4BAA4B,GAAGD,EAAO,qBACnD,GAAA,UAAA;AAAA,MAAA,gBAAAE,EAAC,QAAM,EAAA,UAAAF,EAAO,OAAO,QAAQ,GAAS;AAAA,MAErCA,EAAO,OAAO,WAAW;AAAA,IAAA,GAC5B;AAAA,IACCA,EAAO,YAAY,gBAAAE,EAAC,OAAI,EAAA,WAAU,6BAA6B,UAAOF,EAAA,OAAO,QAAQ,EAAS,CAAA,IAAS;AAAA,EAAA,GAC1G;AAEJ;"}
1
+ {"version":3,"file":"DefaultCellHeader.js","sources":["../../../../src/molecules/table/components/DefaultCellHeader.tsx"],"sourcesContent":["import { flexRender, type Header } from \"@tanstack/react-table\";\nimport cx from \"classnames\";\n\nimport { getComponent, registerComponent } from \"../../../registries/components\";\nimport type { DefaultArrowSort } from \"./DefaultArrowSort\";\nimport type { DefaultFilter } from \"./DefaultFilter\";\n\nexport interface DefaultCellHeaderProps<Data = any> {\n header: Header<Data, unknown>;\n i18n?: (f: string) => string;\n}\n\nexport function DefaultCellHeader<Data = any>(props: DefaultCellHeaderProps<Data>) {\n const { header, i18n } = props;\n\n const ArrowSort = getComponent<typeof DefaultArrowSort>(\"ArrowSort\");\n const Filter = getComponent<typeof DefaultFilter>(\"Filter\");\n const canSort = header.column.getCanSort();\n const canFilter = header.column.getCanFilter();\n\n return (\n <div className={cx(\"table-cell-header\", {})}>\n <div\n className={cx(\"table-cell-header__label\", {\n \"cursor-pointer select-none\": header.column.getCanSort()\n })}\n {...(canSort\n ? {\n onClick: header.column.getToggleSortingHandler()\n }\n : {})}\n >\n <span>{flexRender(header.column.columnDef.header, header.getContext())}</span>\n\n <ArrowSort header={header} />\n </div>\n {canFilter && <Filter header={header} i18n={i18n} />}\n </div>\n );\n}\n\nregisterComponent(\"CellHeader\", DefaultCellHeader);\n"],"names":["DefaultCellHeader","props","header","i18n","ArrowSort","getComponent","Filter","canSort","canFilter","cx","jsxs","jsx","registerComponent"],"mappings":";;;;AAYO,SAASA,EAA8BC,GAAqC;AACjF,QAAM,EAAE,QAAAC,GAAQ,MAAAC,EAAA,IAASF,GAEnBG,IAAYC,EAAsC,WAAW,GAC7DC,IAASD,EAAmC,QAAQ,GACpDE,IAAUL,EAAO,OAAO,WAAA,GACxBM,IAAYN,EAAO,OAAO,aAAA;AAEhC,2BACG,OAAA,EAAI,WAAWO,EAAG,qBAAqB,CAAA,CAAE,GACxC,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWD,EAAG,4BAA4B;AAAA,UACxC,8BAA8BP,EAAO,OAAO,WAAA;AAAA,QAAW,CACxD;AAAA,QACA,GAAIK,IACD;AAAA,UACE,SAASL,EAAO,OAAO,wBAAA;AAAA,QAAwB,IAEjD,CAAA;AAAA,QAEJ,UAAA;AAAA,UAAA,gBAAAS,EAAC,QAAA,EAAM,YAAWT,EAAO,OAAO,UAAU,QAAQA,EAAO,WAAA,CAAY,EAAA,CAAE;AAAA,UAEvE,gBAAAS,EAACP,KAAU,QAAAF,EAAA,CAAgB;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,IAE5BM,KAAa,gBAAAG,EAACL,GAAA,EAAO,QAAAJ,GAAgB,MAAAC,EAAA,CAAY;AAAA,EAAA,GACpD;AAEJ;AAEAS,EAAkB,cAAcZ,CAAiB;"}
@@ -1,12 +1,18 @@
1
- import { DefaultOperationButton, OperationButtonProps } from './DefaultOperationButton';
2
- export interface DefaultCellOperationsProps {
3
- operations: (OperationButtonProps & {
4
- OperationButton: typeof DefaultOperationButton;
5
- permissionsResolver?(data: unknown, ctx: any): boolean;
6
- })[];
7
- row: any;
8
- onClick: (data: any, action: string) => void;
9
- ctx: any;
1
+ import { CellContext } from '@tanstack/react-table';
2
+ import { CellMetadata, JSON, Operation } from '../../../interfaces';
3
+ export interface DefaultCellOperationsProps<Data extends {
4
+ [key: string]: JSON;
5
+ } = {
6
+ [key: string]: JSON;
7
+ }> {
8
+ info: CellContext<Data, unknown>;
9
+ operations: Operation<Data>[];
10
+ metadata?: CellMetadata;
10
11
  i18n: (i18n: string) => string;
12
+ onClick?: (data: any, operation: Operation<Data>) => void;
11
13
  }
12
- export declare function DefaultCellOperations({ operations, row, onClick, ctx, i18n }: DefaultCellOperationsProps): import("react/jsx-runtime").JSX.Element;
14
+ export declare function DefaultCellOperations<Data extends {
15
+ [key: string]: JSON;
16
+ } = {
17
+ [key: string]: JSON;
18
+ }>({ info, metadata, operations, i18n, onClick }: DefaultCellOperationsProps<Data>): import("react/jsx-runtime").JSX.Element;
@@ -1,21 +1,30 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { DefaultOperationButton as d } from "./DefaultOperationButton.js";
3
- function g({ operations: o, row: e, onClick: l, ctx: r, i18n: u }) {
4
- const a = e.original;
5
- return /* @__PURE__ */ i("div", { className: "btn-group", children: o.filter(({ permissionsResolver: t }) => !t || t(a, r)).map(({ OperationButton: t = d, ...n }, c) => /* @__PURE__ */ i(
6
- t,
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { registerComponent as c, getComponent as p } from "../../../registries/components.js";
3
+ function m({
4
+ info: r,
5
+ metadata: n,
6
+ operations: e,
7
+ i18n: i,
8
+ onClick: l
9
+ }) {
10
+ const a = p("OperationButton");
11
+ return /* @__PURE__ */ o("div", { className: "btn-group", children: e.filter(({ permissionsResolver: t, ...u }) => !t || t(r.row.original, n || {}, u)).map((t) => /* @__PURE__ */ o(
12
+ a,
7
13
  {
8
- ...n,
9
- "data-testid": `operation-${c}-${n.action}`,
10
- onClick: (f) => l(a, f),
11
- data: a,
12
- i18n: u,
13
- ctx: r
14
+ "data-testid": `operation-${r.row.id}-${t.action}`,
15
+ operation: t,
16
+ metadata: n,
17
+ info: r,
18
+ i18n: i,
19
+ onClick: () => {
20
+ l?.(r.row.original, t);
21
+ }
14
22
  },
15
- n.action
23
+ t.action
16
24
  )) });
17
25
  }
26
+ c("CellOperations", m);
18
27
  export {
19
- g as DefaultCellOperations
28
+ m as DefaultCellOperations
20
29
  };
21
30
  //# sourceMappingURL=DefaultCellOperations.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultCellOperations.js","sources":["../../../../src/molecules/table/components/DefaultCellOperations.tsx"],"sourcesContent":["import { DefaultOperationButton, OperationButtonProps } from \"./DefaultOperationButton\";\n\nexport interface DefaultCellOperationsProps {\n operations: (OperationButtonProps & {\n OperationButton: typeof DefaultOperationButton;\n permissionsResolver?(data: unknown, ctx: any): boolean;\n })[];\n row: any;\n\n onClick: (data: any, action: string) => void;\n ctx: any;\n i18n: (i18n: string) => string;\n}\n\nexport function DefaultCellOperations({ operations, row, onClick, ctx, i18n }: DefaultCellOperationsProps) {\n const data = row.original;\n\n return (\n <div className='btn-group'>\n {operations\n .filter(({ permissionsResolver }) => !permissionsResolver || permissionsResolver(data, ctx))\n .map(({ OperationButton = DefaultOperationButton, ...operation }, index: number) => {\n return (\n <OperationButton\n key={operation.action}\n {...operation}\n data-testid={`operation-${index}-${operation.action}`}\n onClick={(action: string) => onClick(data, action)}\n data={data}\n i18n={i18n}\n ctx={ctx}\n />\n );\n })}\n </div>\n );\n}\n"],"names":["DefaultCellOperations","operations","row","onClick","ctx","i18n","data","jsx","permissionsResolver","OperationButton","DefaultOperationButton","operation","index","action"],"mappings":";;AAcO,SAASA,EAAsB,EAAE,YAAAC,GAAY,KAAAC,GAAK,SAAAC,GAAS,KAAAC,GAAK,MAAAC,KAAoC;AACzG,QAAMC,IAAOJ,EAAI;AAGf,SAAA,gBAAAK,EAAC,OAAI,EAAA,WAAU,aACZ,UAAAN,EACE,OAAO,CAAC,EAAE,qBAAAO,QAA0B,CAACA,KAAuBA,EAAoBF,GAAMF,CAAG,CAAC,EAC1F,IAAI,CAAC,EAAE,iBAAAK,IAAkBC,GAAwB,GAAGC,EAAU,GAAGC,MAE9D,gBAAAL;AAAA,IAACE;AAAA,IAAA;AAAA,MAEE,GAAGE;AAAA,MACJ,eAAa,aAAaC,CAAK,IAAID,EAAU,MAAM;AAAA,MACnD,SAAS,CAACE,MAAmBV,EAAQG,GAAMO,CAAM;AAAA,MACjD,MAAAP;AAAA,MACA,MAAAD;AAAA,MACA,KAAAD;AAAA,IAAA;AAAA,IANKO,EAAU;AAAA,EAOjB,CAEH,GACL;AAEJ;"}
1
+ {"version":3,"file":"DefaultCellOperations.js","sources":["../../../../src/molecules/table/components/DefaultCellOperations.tsx"],"sourcesContent":["import type { CellContext } from \"@tanstack/react-table\";\n\nimport type { CellMetadata, JSON, Operation } from \"../../../interfaces\";\nimport { getComponent, registerComponent } from \"../../../registries/components\";\nimport type { DefaultOperationButton } from \"./DefaultOperationButton\";\n\nexport interface DefaultCellOperationsProps<Data extends { [key: string]: JSON } = { [key: string]: JSON }> {\n info: CellContext<Data, unknown>;\n operations: Operation<Data>[];\n metadata?: CellMetadata;\n i18n: (i18n: string) => string;\n onClick?: (data: any, operation: Operation<Data>) => void;\n}\n\nexport function DefaultCellOperations<Data extends { [key: string]: JSON } = { [key: string]: JSON }>({\n info,\n metadata,\n operations,\n i18n,\n onClick\n}: DefaultCellOperationsProps<Data>) {\n const Button = getComponent<typeof DefaultOperationButton<Data>>(\"OperationButton\");\n return (\n <div className='btn-group'>\n {operations\n .filter(({ permissionsResolver, ...operation }) => {\n return !permissionsResolver || permissionsResolver(info.row.original, metadata || {}, operation);\n })\n .map((operation) => {\n return (\n <Button\n data-testid={`operation-${info.row.id}-${operation.action}`}\n key={operation.action}\n operation={operation}\n metadata={metadata}\n info={info}\n i18n={i18n}\n onClick={() => {\n onClick?.(info.row.original, operation);\n }}\n />\n );\n })}\n </div>\n );\n}\n\nregisterComponent(\"CellOperations\", DefaultCellOperations);\n"],"names":["DefaultCellOperations","info","metadata","operations","i18n","onClick","Button","getComponent","jsx","permissionsResolver","operation","registerComponent"],"mappings":";;AAcO,SAASA,EAAsF;AAAA,EACpG,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,MAAAC;AAAA,EACA,SAAAC;AACF,GAAqC;AACnC,QAAMC,IAASC,EAAkD,iBAAiB;AAClF,SACE,gBAAAC,EAAC,OAAA,EAAI,WAAU,aACZ,UAAAL,EACE,OAAO,CAAC,EAAE,qBAAAM,GAAqB,GAAGC,EAAA,MAC1B,CAACD,KAAuBA,EAAoBR,EAAK,IAAI,UAAUC,KAAY,CAAA,GAAIQ,CAAS,CAChG,EACA,IAAI,CAACA,MAEF,gBAAAF;AAAA,IAACF;AAAA,IAAA;AAAA,MACC,eAAa,aAAaL,EAAK,IAAI,EAAE,IAAIS,EAAU,MAAM;AAAA,MAEzD,WAAAA;AAAA,MACA,UAAAR;AAAA,MACA,MAAAD;AAAA,MACA,MAAAG;AAAA,MACA,SAAS,MAAM;AACb,QAAAC,IAAUJ,EAAK,IAAI,UAAUS,CAAS;AAAA,MACxC;AAAA,IAAA;AAAA,IAPKA,EAAU;AAAA,EAAA,CAUpB,EAAA,CACL;AAEJ;AAEAC,EAAkB,kBAAkBX,CAAqB;"}
@@ -0,0 +1,11 @@
1
+ import { Header } from '@tanstack/react-table';
2
+ export interface DefaultFilterProps<Data = any> {
3
+ header: Header<Data, unknown>;
4
+ i18n?: (f: string) => string;
5
+ }
6
+ export interface FilterProps<Data = any, Opts = Record<string, unknown>> {
7
+ header: Header<Data, unknown>;
8
+ options: Opts;
9
+ i18n?: (f: string) => string;
10
+ }
11
+ export declare function DefaultFilter<Data = any>({ header, i18n }: DefaultFilterProps<Data>): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,15 @@
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { registerComponent as o, getComponent as c } from "../../../registries/components.js";
3
+ function m({ header: t, i18n: n }) {
4
+ const {
5
+ filter: r = {
6
+ variant: "text"
7
+ }
8
+ } = t.column.columnDef.meta || {}, { variant: i } = r, e = c([`Filter.${t.column.id}`, `Filter.${i}`, "Filter.text"]);
9
+ return e ? /* @__PURE__ */ l("div", { className: "table-cell-header__filter", children: /* @__PURE__ */ l(e, { header: t, options: r, i18n: n }) }) : (console.warn("Missing filter for `Filter." + t.column.id + "` or `Filter." + i + "`"), null);
10
+ }
11
+ o("Filter", m);
12
+ export {
13
+ m as DefaultFilter
14
+ };
15
+ //# sourceMappingURL=DefaultFilter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultFilter.js","sources":["../../../../src/molecules/table/components/DefaultFilter.tsx"],"sourcesContent":["import \"../interfaces/extends\";\n\nimport { Header } from \"@tanstack/react-table\";\nimport type { ComponentType } from \"react\";\n\nimport { getComponent, registerComponent } from \"../../../registries/components\";\n\nexport interface DefaultFilterProps<Data = any> {\n header: Header<Data, unknown>;\n i18n?: (f: string) => string;\n}\n\nexport interface FilterProps<Data = any, Opts = Record<string, unknown>> {\n header: Header<Data, unknown>;\n options: Opts;\n i18n?: (f: string) => string;\n}\n\nexport function DefaultFilter<Data = any>({ header, i18n }: DefaultFilterProps<Data>) {\n const {\n filter = {\n variant: \"text\"\n }\n } = header.column.columnDef.meta || {};\n\n const { variant: filterVariant } = filter;\n const Filter = getComponent<ComponentType<FilterProps>>([`Filter.${header.column.id}`, `Filter.${filterVariant}`, \"Filter.text\"]);\n\n if (!Filter) {\n console.warn(\"Missing filter for `Filter.\" + header.column.id + \"` or `Filter.\" + filterVariant + \"`\");\n\n return null;\n }\n\n return (\n <div className='table-cell-header__filter'>\n <Filter header={header} options={filter} i18n={i18n} />\n </div>\n );\n}\n\nregisterComponent(\"Filter\", DefaultFilter);\n"],"names":["DefaultFilter","header","i18n","filter","filterVariant","Filter","getComponent","jsx","registerComponent"],"mappings":";;AAkBO,SAASA,EAA0B,EAAE,QAAAC,GAAQ,MAAAC,KAAkC;AACpF,QAAM;AAAA,IACJ,QAAAC,IAAS;AAAA,MACP,SAAS;AAAA,IAAA;AAAA,EACX,IACEF,EAAO,OAAO,UAAU,QAAQ,CAAA,GAE9B,EAAE,SAASG,EAAA,IAAkBD,GAC7BE,IAASC,EAAyC,CAAC,UAAUL,EAAO,OAAO,EAAE,IAAI,UAAUG,CAAa,IAAI,aAAa,CAAC;AAEhI,SAAKC,IAOH,gBAAAE,EAAC,OAAA,EAAI,WAAU,6BACb,UAAA,gBAAAA,EAACF,KAAO,QAAAJ,GAAgB,SAASE,GAAQ,MAAAD,EAAA,CAAY,EAAA,CACvD,KARA,QAAQ,KAAK,gCAAgCD,EAAO,OAAO,KAAK,kBAAkBG,IAAgB,GAAG,GAE9F;AAQX;AAEAI,EAAkB,UAAUR,CAAa;"}
@@ -1,15 +1,19 @@
1
+ import { CellContext } from '@tanstack/react-table';
1
2
  import { HTMLAttributes } from 'react';
2
- export interface OperationButtonProps extends Omit<HTMLAttributes<HTMLButtonElement>, "onClick"> {
3
- buttonType?: string;
4
- buttonSize?: string;
5
- buttonOutline?: boolean;
6
- data: any[];
7
- onClick: (action: string) => void;
8
- action: string;
9
- icon?: string;
10
- title?: string;
3
+ import { CellMetadata, JSON, Operation } from '../../../interfaces';
4
+ export interface OperationButtonProps<Data extends {
5
+ [key: string]: JSON;
6
+ } = {
7
+ [key: string]: JSON;
8
+ }> extends Omit<HTMLAttributes<HTMLButtonElement>, "onClick"> {
9
+ operation: Operation<Data>;
10
+ info: CellContext<Data, unknown>;
11
+ metadata?: CellMetadata;
12
+ onClick: () => void;
11
13
  i18n?: (i18n: string) => string;
12
- ctx?: any;
13
- permissionsResolver?: (ctx: any) => boolean;
14
14
  }
15
- export declare function DefaultOperationButton(props: OperationButtonProps): import("react/jsx-runtime").JSX.Element;
15
+ export declare function DefaultOperationButton<Data extends {
16
+ [key: string]: JSON;
17
+ } = {
18
+ [key: string]: JSON;
19
+ }>(props: OperationButtonProps<Data>): import("react/jsx-runtime").JSX.Element;