@tsed/react-formio 2.3.1 → 3.0.0-alpha.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 (339) hide show
  1. package/dist/chunks/index.js +45 -0
  2. package/dist/chunks/index.js.map +1 -0
  3. package/dist/components/actions-table/actionsTable.component.d.ts +10 -11
  4. package/dist/components/actions-table/actionsTable.component.js +53 -0
  5. package/dist/components/actions-table/actionsTable.component.js.map +1 -0
  6. package/dist/components/alert/alert.component.d.ts +5 -6
  7. package/dist/components/alert/alert.component.js +24 -0
  8. package/dist/components/alert/alert.component.js.map +1 -0
  9. package/dist/components/card/card.component.d.ts +6 -7
  10. package/dist/components/card/card.component.js +12 -0
  11. package/dist/components/card/card.component.js.map +1 -0
  12. package/dist/components/form/form.component.d.ts +62 -63
  13. package/dist/components/form/form.component.js +64 -0
  14. package/dist/components/form/form.component.js.map +1 -0
  15. package/dist/components/form/useForm.hook.d.ts +59 -60
  16. package/dist/components/form/useForm.hook.js +64 -0
  17. package/dist/components/form/useForm.hook.js.map +1 -0
  18. package/dist/components/form-access/formAccess.component.d.ts +9 -20
  19. package/dist/components/form-access/formAccess.component.js +95 -0
  20. package/dist/components/form-access/formAccess.component.js.map +1 -0
  21. package/dist/components/form-access/formAccess.schema.d.ts +5 -5
  22. package/dist/components/form-access/formAccess.schema.js +164 -0
  23. package/dist/components/form-access/formAccess.schema.js.map +1 -0
  24. package/dist/components/form-access/formAccess.utils.d.ts +24 -24
  25. package/dist/components/form-access/formAccess.utils.js +68 -0
  26. package/dist/components/form-access/formAccess.utils.js.map +1 -0
  27. package/dist/components/form-action/formAction.component.d.ts +9 -9
  28. package/dist/components/form-action/formAction.component.js +32 -0
  29. package/dist/components/form-action/formAction.component.js.map +1 -0
  30. package/dist/components/form-builder/formBuilder.component.d.ts +53 -53
  31. package/dist/components/form-builder/formBuilder.component.js +142 -0
  32. package/dist/components/form-builder/formBuilder.component.js.map +1 -0
  33. package/dist/components/form-control/formControl.component.d.ts +14 -22
  34. package/dist/components/form-control/formControl.component.js +26 -0
  35. package/dist/components/form-control/formControl.component.js.map +1 -0
  36. package/dist/components/form-edit/formCtas.component.d.ts +28 -28
  37. package/dist/components/form-edit/formCtas.component.js +70 -0
  38. package/dist/components/form-edit/formCtas.component.js.map +1 -0
  39. package/dist/components/form-edit/formEdit.component.d.ts +18 -19
  40. package/dist/components/form-edit/formEdit.component.js +57 -0
  41. package/dist/components/form-edit/formEdit.component.js.map +1 -0
  42. package/dist/components/form-edit/formEdit.reducer.d.ts +10 -10
  43. package/dist/components/form-edit/formEdit.reducer.js +65 -0
  44. package/dist/components/form-edit/formEdit.reducer.js.map +1 -0
  45. package/dist/components/form-edit/formParameters.component.d.ts +34 -34
  46. package/dist/components/form-edit/formParameters.component.js +92 -0
  47. package/dist/components/form-edit/formParameters.component.js.map +1 -0
  48. package/dist/components/form-edit/useFormEdit.hook.d.ts +29 -29
  49. package/dist/components/form-edit/useFormEdit.hook.js +36 -0
  50. package/dist/components/form-edit/useFormEdit.hook.js.map +1 -0
  51. package/dist/components/form-settings/formSettings.component.d.ts +7 -8
  52. package/dist/components/form-settings/formSettings.component.js +38 -0
  53. package/dist/components/form-settings/formSettings.component.js.map +1 -0
  54. package/dist/components/form-settings/formSettings.schema.d.ts +2 -2
  55. package/dist/components/form-settings/formSettings.schema.js +60 -0
  56. package/dist/components/form-settings/formSettings.schema.js.map +1 -0
  57. package/dist/components/form-settings/formSettings.utils.d.ts +8 -8
  58. package/dist/components/form-settings/formSettings.utils.js +23 -0
  59. package/dist/components/form-settings/formSettings.utils.js.map +1 -0
  60. package/dist/components/forms-table/components/formCell.component.d.ts +6 -7
  61. package/dist/components/forms-table/components/formCell.component.js +50 -0
  62. package/dist/components/forms-table/components/formCell.component.js.map +1 -0
  63. package/dist/components/forms-table/formsTable.component.d.ts +10 -11
  64. package/dist/components/forms-table/formsTable.component.js +29 -0
  65. package/dist/components/forms-table/formsTable.component.js.map +1 -0
  66. package/dist/components/index.d.ts +25 -26
  67. package/dist/components/index.js +86 -0
  68. package/dist/components/index.js.map +1 -0
  69. package/dist/components/input-tags/inputTags.component.d.ts +18 -19
  70. package/dist/components/input-tags/inputTags.component.js +37 -0
  71. package/dist/components/input-tags/inputTags.component.js.map +1 -0
  72. package/dist/components/input-text/inputText.component.d.ts +27 -28
  73. package/dist/components/input-text/inputText.component.js +70 -0
  74. package/dist/components/input-text/inputText.component.js.map +1 -0
  75. package/dist/components/loader/loader.component.d.ts +17 -17
  76. package/dist/components/loader/loader.component.js +26 -0
  77. package/dist/components/loader/loader.component.js.map +1 -0
  78. package/dist/components/modal/modal.component.d.ts +15 -15
  79. package/dist/components/modal/modal.component.js +62 -0
  80. package/dist/components/modal/modal.component.js.map +1 -0
  81. package/dist/components/modal/removeModal.component.d.ts +9 -9
  82. package/dist/components/modal/removeModal.component.js +71 -0
  83. package/dist/components/modal/removeModal.component.js.map +1 -0
  84. package/dist/components/pagination/pagination.component.d.ts +17 -18
  85. package/dist/components/pagination/pagination.component.js +87 -0
  86. package/dist/components/pagination/pagination.component.js.map +1 -0
  87. package/dist/components/select/select.component.d.ts +14 -27
  88. package/dist/components/select/select.component.js +60 -0
  89. package/dist/components/select/select.component.js.map +1 -0
  90. package/dist/components/submissions-table/submissionsTable.component.d.ts +6 -7
  91. package/dist/components/submissions-table/submissionsTable.component.js +11 -0
  92. package/dist/components/submissions-table/submissionsTable.component.js.map +1 -0
  93. package/dist/components/table/components/defaultArrowSort.component.d.ts +1 -2
  94. package/dist/components/table/components/defaultArrowSort.component.js +10 -0
  95. package/dist/components/table/components/defaultArrowSort.component.js.map +1 -0
  96. package/dist/components/table/components/defaultCell.component.d.ts +1 -2
  97. package/dist/components/table/components/defaultCell.component.js +11 -0
  98. package/dist/components/table/components/defaultCell.component.js.map +1 -0
  99. package/dist/components/table/components/defaultCellHeader.component.d.ts +5 -6
  100. package/dist/components/table/components/defaultCellHeader.component.js +14 -0
  101. package/dist/components/table/components/defaultCellHeader.component.js.map +1 -0
  102. package/dist/components/table/components/defaultCellOperations.component.d.ts +12 -2
  103. package/dist/components/table/components/defaultCellOperations.component.js +21 -0
  104. package/dist/components/table/components/defaultCellOperations.component.js.map +1 -0
  105. package/dist/components/table/components/defaultCells.component.d.ts +4 -5
  106. package/dist/components/table/components/defaultCells.component.js +23 -0
  107. package/dist/components/table/components/defaultCells.component.js.map +1 -0
  108. package/dist/components/table/components/defaultOperationButton.component.d.ts +15 -14
  109. package/dist/components/table/components/defaultOperationButton.component.js +45 -0
  110. package/dist/components/table/components/defaultOperationButton.component.js.map +1 -0
  111. package/dist/components/table/components/defaultRow.component.d.ts +12 -12
  112. package/dist/components/table/components/defaultRow.component.js +25 -0
  113. package/dist/components/table/components/defaultRow.component.js.map +1 -0
  114. package/dist/components/table/components/dragNDropContainer.d.ts +4 -4
  115. package/dist/components/table/components/dragNDropContainer.js +10 -0
  116. package/dist/components/table/components/dragNDropContainer.js.map +1 -0
  117. package/dist/components/table/filters/defaultColumnFilter.component.d.ts +5 -6
  118. package/dist/components/table/filters/defaultColumnFilter.component.js +32 -0
  119. package/dist/components/table/filters/defaultColumnFilter.component.js.map +1 -0
  120. package/dist/components/table/filters/selectColumnFilter.component.d.ts +10 -11
  121. package/dist/components/table/filters/selectColumnFilter.component.js +34 -0
  122. package/dist/components/table/filters/selectColumnFilter.component.js.map +1 -0
  123. package/dist/components/table/filters/sliderColumnFilter.component.d.ts +2 -3
  124. package/dist/components/table/filters/sliderColumnFilter.component.js +27 -0
  125. package/dist/components/table/filters/sliderColumnFilter.component.js.map +1 -0
  126. package/dist/components/table/hooks/useCustomTable.hook.d.ts +128 -128
  127. package/dist/components/table/hooks/useCustomTable.hook.js +130 -0
  128. package/dist/components/table/hooks/useCustomTable.hook.js.map +1 -0
  129. package/dist/components/table/hooks/useDragnDropRow.hook.d.ts +272 -274
  130. package/dist/components/table/hooks/useDragnDropRow.hook.js +40 -0
  131. package/dist/components/table/hooks/useDragnDropRow.hook.js.map +1 -0
  132. package/dist/components/table/hooks/useOperations.hook.d.ts +11 -11
  133. package/dist/components/table/hooks/useOperations.hook.js +25 -0
  134. package/dist/components/table/hooks/useOperations.hook.js.map +1 -0
  135. package/dist/components/table/index.d.ts +15 -15
  136. package/dist/components/table/index.js +35 -0
  137. package/dist/components/table/index.js.map +1 -0
  138. package/dist/components/table/table.component.d.ts +3 -3
  139. package/dist/components/table/table.component.js +81 -0
  140. package/dist/components/table/table.component.js.map +1 -0
  141. package/dist/components/table/utils/getPageNumbers.d.ts +3 -3
  142. package/dist/components/table/utils/getPageNumbers.js +25 -0
  143. package/dist/components/table/utils/getPageNumbers.js.map +1 -0
  144. package/dist/components/table/utils/mapFormToColumns.d.ts +3 -3
  145. package/dist/components/table/utils/mapFormToColumns.js +23 -0
  146. package/dist/components/table/utils/mapFormToColumns.js.map +1 -0
  147. package/dist/components/table/utils/swapElements.d.ts +1 -1
  148. package/dist/components/table/utils/swapElements.js +5 -0
  149. package/dist/components/table/utils/swapElements.js.map +1 -0
  150. package/dist/components/tabs/tabs.component.d.ts +19 -19
  151. package/dist/components/tabs/tabs.component.js +72 -0
  152. package/dist/components/tabs/tabs.component.js.map +1 -0
  153. package/dist/hooks/useTooltip.d.ts +2 -3
  154. package/dist/hooks/useTooltip.js +12 -0
  155. package/dist/hooks/useTooltip.js.map +1 -0
  156. package/dist/index.d.ts +13 -13
  157. package/dist/index.js +107 -7803
  158. package/dist/index.js.map +1 -1
  159. package/dist/interfaces/ActionSchema.d.ts +23 -23
  160. package/dist/interfaces/ActionSchema.js +2 -0
  161. package/dist/interfaces/ActionSchema.js.map +1 -0
  162. package/dist/interfaces/ColumnIdentifier.d.ts +14 -14
  163. package/dist/interfaces/ColumnIdentifier.js +2 -0
  164. package/dist/interfaces/ColumnIdentifier.js.map +1 -0
  165. package/dist/interfaces/FormOptions.d.ts +10 -10
  166. package/dist/interfaces/FormOptions.js +2 -0
  167. package/dist/interfaces/FormOptions.js.map +1 -0
  168. package/dist/interfaces/FormSchema.d.ts +12 -12
  169. package/dist/interfaces/FormSchema.js +2 -0
  170. package/dist/interfaces/FormSchema.js.map +1 -0
  171. package/dist/interfaces/Operation.d.ts +29 -29
  172. package/dist/interfaces/Operation.js +2 -0
  173. package/dist/interfaces/Operation.js.map +1 -0
  174. package/dist/interfaces/QueryOptions.d.ts +23 -23
  175. package/dist/interfaces/QueryOptions.js +2 -0
  176. package/dist/interfaces/QueryOptions.js.map +1 -0
  177. package/dist/interfaces/RoleSchema.d.ts +6 -6
  178. package/dist/interfaces/RoleSchema.js +2 -0
  179. package/dist/interfaces/RoleSchema.js.map +1 -0
  180. package/dist/interfaces/Submission.d.ts +5 -5
  181. package/dist/interfaces/Submission.js +2 -0
  182. package/dist/interfaces/Submission.js.map +1 -0
  183. package/dist/interfaces/index.d.ts +8 -8
  184. package/dist/interfaces/index.js +2 -0
  185. package/dist/interfaces/index.js.map +1 -0
  186. package/dist/react-app-env.d.js +2 -0
  187. package/dist/react-app-env.d.js.map +1 -0
  188. package/dist/react-table.d.js +2 -0
  189. package/dist/react-table.d.js.map +1 -0
  190. package/dist/typings.d.js +2 -0
  191. package/dist/typings.d.js.map +1 -0
  192. package/dist/utils/callLast.d.ts +1 -1
  193. package/dist/utils/callLast.js +10 -0
  194. package/dist/utils/callLast.js.map +1 -0
  195. package/dist/utils/getEventValue.d.ts +1 -1
  196. package/dist/utils/getEventValue.js +8 -0
  197. package/dist/utils/getEventValue.js.map +1 -0
  198. package/dist/utils/iconClass.d.ts +1 -1
  199. package/dist/utils/iconClass.js +9 -0
  200. package/dist/utils/iconClass.js.map +1 -0
  201. package/dist/utils/mapPagination.d.ts +1 -1
  202. package/dist/utils/mapPagination.js +11 -0
  203. package/dist/utils/mapPagination.js.map +1 -0
  204. package/dist/utils/stopPropagationWrapper.d.ts +1 -1
  205. package/dist/utils/stopPropagationWrapper.js +7 -0
  206. package/dist/utils/stopPropagationWrapper.js.map +1 -0
  207. package/package.json +28 -15
  208. package/src/components/__fixtures__/form-actions.json +240 -0
  209. package/src/components/actions-table/__fixtures__/data.json +12 -0
  210. package/src/components/actions-table/actionsTable.component.spec.tsx +47 -17
  211. package/src/components/actions-table/actionsTable.component.tsx +3 -2
  212. package/src/components/actions-table/actionsTable.stories.tsx +71 -289
  213. package/src/components/alert/alert.component.spec.tsx +0 -1
  214. package/src/components/alert/alert.component.tsx +0 -2
  215. package/src/components/alert/alert.stories.tsx +0 -2
  216. package/src/components/card/card.component.spec.tsx +0 -1
  217. package/src/components/card/card.component.tsx +1 -2
  218. package/src/components/card/card.stories.tsx +0 -2
  219. package/src/components/form/form.component.spec.tsx +1 -1
  220. package/src/components/form/form.component.tsx +0 -1
  221. package/src/components/form/form.stories.tsx +2 -3
  222. package/src/components/form-access/formAccess.component.tsx +2 -13
  223. package/src/components/form-access/formAccess.stories.tsx +55 -49
  224. package/src/components/form-action/formAction.component.tsx +2 -1
  225. package/src/components/form-action/formAction.stories.tsx +0 -2
  226. package/src/components/form-builder/formBuilder.component.tsx +4 -4
  227. package/src/components/form-builder/formBuilder.stories.tsx +0 -2
  228. package/src/components/form-control/formControl.component.spec.tsx +0 -1
  229. package/src/components/form-control/formControl.component.tsx +8 -15
  230. package/src/components/form-control/formControl.stories.tsx +0 -2
  231. package/src/components/form-edit/formCtas.component.tsx +1 -1
  232. package/src/components/form-edit/formEdit.component.tsx +0 -1
  233. package/src/components/form-edit/formEdit.reducer.ts +0 -1
  234. package/src/components/form-edit/formEdit.stories.tsx +0 -2
  235. package/src/components/form-edit/formParameters.component.tsx +1 -1
  236. package/src/components/form-settings/formSettings.component.spec.tsx +5 -6
  237. package/src/components/form-settings/formSettings.component.tsx +1 -1
  238. package/src/components/form-settings/formSettings.stories.tsx +0 -2
  239. package/src/components/forms-table/components/formCell.component.tsx +0 -1
  240. package/src/components/forms-table/formsTable.component.tsx +0 -2
  241. package/src/components/forms-table/formsTable.stories.tsx +0 -1
  242. package/src/components/index.ts +0 -1
  243. package/src/components/input-tags/inputTags.component.tsx +1 -1
  244. package/src/components/input-tags/inputTags.stories.tsx +1 -1
  245. package/src/components/input-text/inputText.component.spec.tsx +0 -1
  246. package/src/components/input-text/inputText.component.tsx +1 -1
  247. package/src/components/input-text/inputText.stories.tsx +1 -1
  248. package/src/components/loader/loader.component.spec.tsx +1 -1
  249. package/src/components/loader/loader.component.tsx +1 -1
  250. package/src/components/loader/loader.stories.tsx +0 -2
  251. package/src/components/modal/modal.component.spec.tsx +2 -5
  252. package/src/components/modal/modal.component.tsx +1 -1
  253. package/src/components/modal/modal.stories.tsx +0 -2
  254. package/src/components/modal/removeModal.component.tsx +1 -1
  255. package/src/components/pagination/pagination.component.spec.tsx +7 -10
  256. package/src/components/pagination/pagination.component.tsx +1 -1
  257. package/src/components/pagination/pagination.stories.tsx +1 -1
  258. package/src/components/select/select.component.spec.tsx +1 -2
  259. package/src/components/select/select.component.tsx +10 -23
  260. package/src/components/select/select.stories.tsx +1 -1
  261. package/src/components/submissions-table/submissionsTable.component.tsx +0 -2
  262. package/src/components/submissions-table/submissionsTable.stories.tsx +4 -4
  263. package/src/components/table/components/defaultArrowSort.component.tsx +0 -2
  264. package/src/components/table/components/defaultCell.component.tsx +0 -2
  265. package/src/components/table/components/defaultCellHeader.component.tsx +0 -1
  266. package/src/components/table/components/defaultCellOperations.component.tsx +16 -5
  267. package/src/components/table/components/defaultCells.component.tsx +0 -1
  268. package/src/components/table/components/defaultOperationButton.component.tsx +14 -4
  269. package/src/components/table/components/defaultRow.component.tsx +2 -1
  270. package/src/components/table/components/dragNDropContainer.tsx +1 -1
  271. package/src/components/table/filters/defaultColumnFilter.component.spec.tsx +2 -5
  272. package/src/components/table/filters/defaultColumnFilter.component.tsx +2 -1
  273. package/src/components/table/filters/selectColumnFilter.component.spec.tsx +3 -6
  274. package/src/components/table/filters/selectColumnFilter.component.tsx +0 -1
  275. package/src/components/table/filters/sliderColumnFilter.component.tsx +7 -10
  276. package/src/components/table/hooks/useCustomTable.hook.tsx +16 -20
  277. package/src/components/table/hooks/useOperations.hook.tsx +3 -3
  278. package/src/components/table/table.component.tsx +1 -1
  279. package/src/components/table/table.stories.tsx +8 -8
  280. package/src/components/table/utils/mapFormToColumns.tsx +0 -1
  281. package/src/components/tabs/tabs.component.spec.tsx +2 -2
  282. package/src/components/tabs/tabs.component.stories.tsx +1 -1
  283. package/src/components/tabs/tabs.component.tsx +1 -1
  284. package/src/react-table.d.ts +2 -0
  285. package/src/utils/iconClass.ts +3 -1
  286. package/tsconfig.app.json +11 -0
  287. package/tsconfig.json +8 -6
  288. package/tsconfig.spec.json +14 -0
  289. package/vite.config.mts +69 -0
  290. package/vitest.config.mts +21 -0
  291. package/.eslintignore +0 -13
  292. package/.eslintrc.js +0 -7
  293. package/coverage.json +0 -6
  294. package/dist/components/actions-table/actionsTable.component.spec.d.ts +0 -1
  295. package/dist/components/actions-table/actionsTable.stories.d.ts +0 -85
  296. package/dist/components/alert/alert.component.spec.d.ts +0 -1
  297. package/dist/components/alert/alert.stories.d.ts +0 -15
  298. package/dist/components/card/card.component.spec.d.ts +0 -1
  299. package/dist/components/card/card.stories.d.ts +0 -16
  300. package/dist/components/form/form.component.spec.d.ts +0 -1
  301. package/dist/components/form/form.stories.d.ts +0 -6445
  302. package/dist/components/form-access/formAccess.stories.d.ts +0 -62
  303. package/dist/components/form-access/formAccess.utils.spec.d.ts +0 -1
  304. package/dist/components/form-action/formAction.stories.d.ts +0 -409
  305. package/dist/components/form-builder/formBuilder.stories.d.ts +0 -5989
  306. package/dist/components/form-control/formControl.component.spec.d.ts +0 -1
  307. package/dist/components/form-control/formControl.stories.d.ts +0 -58
  308. package/dist/components/form-edit/formEdit.stories.d.ts +0 -396
  309. package/dist/components/form-settings/formSettings.component.spec.d.ts +0 -1
  310. package/dist/components/form-settings/formSettings.stories.d.ts +0 -58
  311. package/dist/components/form-settings/formSettings.utils.spec.d.ts +0 -1
  312. package/dist/components/forms-table/formsTable.stories.d.ts +0 -117
  313. package/dist/components/input-tags/inputTags.stories.d.ts +0 -76
  314. package/dist/components/input-text/inputText.component.spec.d.ts +0 -1
  315. package/dist/components/input-text/inputText.stories.d.ts +0 -101
  316. package/dist/components/loader/loader.component.spec.d.ts +0 -1
  317. package/dist/components/loader/loader.stories.d.ts +0 -15
  318. package/dist/components/modal/modal.component.spec.d.ts +0 -1
  319. package/dist/components/modal/modal.stories.d.ts +0 -44
  320. package/dist/components/pagination/pagination.component.spec.d.ts +0 -1
  321. package/dist/components/pagination/pagination.stories.d.ts +0 -16
  322. package/dist/components/react-component/reactComponent.component.d.ts +0 -90
  323. package/dist/components/select/select.component.spec.d.ts +0 -1
  324. package/dist/components/select/select.stories.d.ts +0 -164
  325. package/dist/components/submissions-table/submissionsTable.stories.d.ts +0 -649
  326. package/dist/components/table/filters/defaultColumnFilter.component.spec.d.ts +0 -1
  327. package/dist/components/table/filters/selectColumnFilter.component.spec.d.ts +0 -1
  328. package/dist/components/table/table.stories.d.ts +0 -71
  329. package/dist/components/table/utils/swapElements.spec.d.ts +0 -1
  330. package/dist/components/tabs/tabs.component.spec.d.ts +0 -1
  331. package/dist/components/tabs/tabs.component.stories.d.ts +0 -47
  332. package/dist/index.modern.js +0 -7453
  333. package/dist/index.modern.js.map +0 -1
  334. package/dist/package.json +0 -3
  335. package/dist/setupTests.d.ts +0 -1
  336. package/jest.config.js +0 -6
  337. package/src/components/react-component/reactComponent.component.tsx +0 -197
  338. package/src/setupTests.tsx +0 -5
  339. package/tsconfig.node.json +0 -8
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultOperationButton.component.js","sources":["../../../../src/components/table/components/defaultOperationButton.component.tsx"],"sourcesContent":["import classnames from \"classnames\";\nimport { HTMLAttributes } from \"react\";\n\nimport { iconClass } from \"../../../utils/iconClass\";\nimport { stopPropagationWrapper } from \"../../../utils/stopPropagationWrapper\";\n\nexport interface OperationButtonProps extends Omit<HTMLAttributes<HTMLButtonElement>, \"onClick\"> {\n buttonType?: string;\n buttonSize?: string;\n buttonOutline?: boolean;\n data: any[];\n onClick: (action: string) => void;\n action: string;\n icon?: string;\n title?: string;\n i18n?: (i18n: string) => string;\n ctx?: any;\n permissionsResolver?: (ctx: any) => boolean;\n}\n\nexport function DefaultOperationButton(props: OperationButtonProps) {\n const {\n className = \"btn\",\n buttonSize = \"xs\",\n buttonType = \"primary\",\n buttonOutline,\n onClick,\n action,\n icon = \"\",\n title = \"\",\n i18n = (f: string) => f,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n data,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n ctx,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n permissionsResolver,\n ...otherProps\n } = props;\n\n return (\n <button\n {...otherProps}\n aria-label={\"Operation button: \" + (title || action)}\n className={classnames(className, [\"btn\", buttonOutline && \"outline\", buttonType].filter(Boolean).join(\"-\"), `btn-${buttonSize}`)}\n onClick={stopPropagationWrapper(() => onClick(action))}\n >\n {icon ? (\n <>\n <i className={iconClass(undefined, icon)} /> {title && \" \"}\n </>\n ) : null}\n {title && <span className={icon && title ? \"ml-1\" : \"\"}>{i18n(title)}</span>}\n </button>\n );\n}\n"],"names":["DefaultOperationButton","props","className","buttonSize","buttonType","buttonOutline","onClick","action","icon","title","i18n","f","data","ctx","permissionsResolver","otherProps","jsxs","classnames","stopPropagationWrapper","Fragment","jsx","iconClass"],"mappings":";;;;AAoBO,SAASA,EAAuBC,GAA6B;AAC5D,QAAA;AAAA,IACJ,WAAAC,IAAY;AAAA,IACZ,YAAAC,IAAa;AAAA,IACb,YAAAC,IAAa;AAAA,IACb,eAAAC;AAAA,IACA,SAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,OAAAC,IAAQ;AAAA,IACR,MAAAC,IAAO,CAACC,MAAcA;AAAA;AAAA,IAEtB,MAAAC;AAAA;AAAA,IAEA,KAAAC;AAAA;AAAA,IAEA,qBAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDd;AAGF,SAAA,gBAAAe;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGD;AAAA,MACJ,cAAY,wBAAwBN,KAASF;AAAA,MAC7C,WAAWU,EAAWf,GAAW,CAAC,OAAOG,KAAiB,WAAWD,CAAU,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,GAAG,OAAOD,CAAU,EAAE;AAAA,MAC/H,SAASe,EAAuB,MAAMZ,EAAQC,CAAM,CAAC;AAAA,MAEpD,UAAA;AAAA,QAAAC,IAEG,gBAAAQ,EAAAG,GAAA,EAAA,UAAA;AAAA,UAAA,gBAAAC,EAAC,KAAE,EAAA,WAAWC,EAAU,QAAWb,CAAI,GAAG;AAAA,UAAE;AAAA,UAAEC,KAAS;AAAA,QAAA,EAAA,CACzD,IACE;AAAA,QACHA,KAAU,gBAAAW,EAAA,QAAA,EAAK,WAAWZ,KAAQC,IAAQ,SAAS,IAAK,UAAKC,EAAAD,CAAK,EAAE,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACvE;AAEJ;"}
@@ -1,12 +1,12 @@
1
- import React, { DetailedHTMLProps, HTMLAttributes } from "react";
2
- import { Row } from "react-table";
3
- export interface DefaultRowProps<Data extends object = {}> extends Omit<DetailedHTMLProps<HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, "onClick" | "onDrag" | "onDrop"> {
4
- onClick: (data: any, action: string) => void;
5
- row: Row<Data>;
6
- index: number;
7
- onDrop: (item: Data) => void;
8
- onDrag: (index: number, hoverIndex: number) => void;
9
- enableDragNDrop?: boolean;
10
- }
11
- export declare function DefaultDndRow<Data extends object = {}>(props: DefaultRowProps<Data>): React.JSX.Element;
12
- export declare function DefaultRow<Data extends object = {}>({ onClick, row, enableDragNDrop, onDrop, onDrag, ...props }: DefaultRowProps<Data>): React.JSX.Element;
1
+ import { DetailedHTMLProps, HTMLAttributes } from 'react';
2
+ import { Row } from 'react-table';
3
+ export interface DefaultRowProps<Data extends object = {}> extends Omit<DetailedHTMLProps<HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, "onClick" | "onDrag" | "onDrop"> {
4
+ onClick: (data: any, action: string) => void;
5
+ row: Row<Data>;
6
+ index: number;
7
+ onDrop: (item: Data) => void;
8
+ onDrag: (index: number, hoverIndex: number) => void;
9
+ enableDragNDrop?: boolean;
10
+ }
11
+ export declare function DefaultDndRow<Data extends object = {}>(props: DefaultRowProps<Data>): import("react/jsx-runtime").JSX.Element;
12
+ export declare function DefaultRow<Data extends object = {}>({ onClick, row, enableDragNDrop, onDrop, onDrag, ...props }: DefaultRowProps<Data>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,25 @@
1
+ import { jsxs as c, jsx as r } from "react/jsx-runtime";
2
+ import { c as f } from "../../../chunks/index.js";
3
+ import { iconClass as d } from "../../../utils/iconClass.js";
4
+ import { useDndRow as m } from "../hooks/useDragnDropRow.hook.js";
5
+ import { DefaultCells as n } from "./defaultCells.component.js";
6
+ function u(t) {
7
+ const { isDragging: e, dragRef: i, dropRef: o, opacity: s } = m(t);
8
+ return /* @__PURE__ */ c("tr", { ref: o, style: { opacity: s }, children: [
9
+ /* @__PURE__ */ r("td", { ref: i, role: "cell", style: { cursor: e ? "grabbing" : "grab" }, className: "align-middle", children: /* @__PURE__ */ r("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ r("i", { className: f(d(void 0, "dots-vertical-rounded")) }) }) }),
10
+ /* @__PURE__ */ r(n, { ...t })
11
+ ] });
12
+ }
13
+ function x({ onClick: t, row: e, enableDragNDrop: i, onDrop: o, onDrag: s, ...a }) {
14
+ const l = {
15
+ ...a,
16
+ onClick: () => t(e.original, "row"),
17
+ ...e.getRowProps()
18
+ };
19
+ return i ? /* @__PURE__ */ r(u, { ...l, row: e, onDrag: s, onDrop: o }) : /* @__PURE__ */ r("tr", { ...l, children: /* @__PURE__ */ r(n, { row: e }) });
20
+ }
21
+ export {
22
+ u as DefaultDndRow,
23
+ x as DefaultRow
24
+ };
25
+ //# sourceMappingURL=defaultRow.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultRow.component.js","sources":["../../../../src/components/table/components/defaultRow.component.tsx"],"sourcesContent":["import classnames from \"classnames\";\nimport { DetailedHTMLProps, HTMLAttributes } from \"react\";\nimport { Row } from \"react-table\";\n\nimport { iconClass } from \"../../../utils/iconClass\";\nimport { useDndRow } from \"../hooks/useDragnDropRow.hook\";\nimport { DefaultCells } from \"./defaultCells.component\";\n\nexport interface DefaultRowProps<Data extends object = {}>\n extends Omit<DetailedHTMLProps<HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, \"onClick\" | \"onDrag\" | \"onDrop\"> {\n onClick: (data: any, action: string) => void;\n row: Row<Data>;\n index: number;\n onDrop: (item: Data) => void;\n onDrag: (index: number, hoverIndex: number) => void;\n enableDragNDrop?: boolean;\n}\n\nexport function DefaultDndRow<Data extends object = {}>(props: DefaultRowProps<Data>) {\n const { isDragging, dragRef, dropRef, opacity } = useDndRow(props);\n\n return (\n <tr ref={dropRef} style={{ opacity }}>\n {/* eslint-disable-next-line jsx-a11y/no-interactive-element-to-noninteractive-role */}\n <td ref={dragRef} role='cell' style={{ cursor: isDragging ? \"grabbing\" : \"grab\" }} className='align-middle'>\n <div className='flex items-center justify-center'>\n <i className={classnames(iconClass(undefined, \"dots-vertical-rounded\"))} />\n </div>\n </td>\n <DefaultCells<Data> {...props} />\n </tr>\n );\n}\n\nexport function DefaultRow<Data extends object = {}>({ onClick, row, enableDragNDrop, onDrop, onDrag, ...props }: DefaultRowProps<Data>) {\n const opts = {\n ...props,\n onClick: () => onClick(row.original, \"row\"),\n ...row.getRowProps()\n };\n\n if (enableDragNDrop) {\n return <DefaultDndRow<Data> {...opts} row={row} onDrag={onDrag} onDrop={onDrop} />;\n }\n\n return (\n <tr {...opts}>\n <DefaultCells<Data> row={row} />\n </tr>\n );\n}\n"],"names":["DefaultDndRow","props","isDragging","dragRef","dropRef","opacity","useDndRow","jsx","classnames","iconClass","DefaultCells","DefaultRow","onClick","row","enableDragNDrop","onDrop","onDrag","opts"],"mappings":";;;;;AAkBO,SAASA,EAAwCC,GAA8B;AACpF,QAAM,EAAE,YAAAC,GAAY,SAAAC,GAAS,SAAAC,GAAS,SAAAC,EAAQ,IAAIC,EAAUL,CAAK;AAEjE,2BACG,MAAG,EAAA,KAAKG,GAAS,OAAO,EAAE,SAAAC,EAEzB,GAAA,UAAA;AAAA,IAAA,gBAAAE,EAAC,MAAG,EAAA,KAAKJ,GAAS,MAAK,QAAO,OAAO,EAAE,QAAQD,IAAa,aAAa,OAAO,GAAG,WAAU,gBAC3F,UAAC,gBAAAK,EAAA,OAAA,EAAI,WAAU,oCACb,UAAC,gBAAAA,EAAA,KAAA,EAAE,WAAWC,EAAWC,EAAU,QAAW,uBAAuB,CAAC,EAAG,CAAA,EAC3E,CAAA,GACF;AAAA,IACA,gBAAAF,EAACG,GAAoB,EAAA,GAAGT,EAAO,CAAA;AAAA,EAAA,GACjC;AAEJ;AAEgB,SAAAU,EAAqC,EAAE,SAAAC,GAAS,KAAAC,GAAK,iBAAAC,GAAiB,QAAAC,GAAQ,QAAAC,GAAQ,GAAGf,KAAgC;AACvI,QAAMgB,IAAO;AAAA,IACX,GAAGhB;AAAA,IACH,SAAS,MAAMW,EAAQC,EAAI,UAAU,KAAK;AAAA,IAC1C,GAAGA,EAAI,YAAY;AAAA,EACrB;AAEA,SAAIC,sBACMd,GAAqB,EAAA,GAAGiB,GAAM,KAAAJ,GAAU,QAAAG,GAAgB,QAAAD,GAAgB,sBAI/E,MAAI,EAAA,GAAGE,GACN,UAAC,gBAAAV,EAAAG,GAAA,EAAmB,KAAAG,EAAU,CAAA,GAChC;AAEJ;"}
@@ -1,4 +1,4 @@
1
- import React, { PropsWithChildren } from "react";
2
- export declare function DrapNDropContainer({ enableDragNDrop, children }: PropsWithChildren<{
3
- enableDragNDrop?: boolean;
4
- }>): React.JSX.Element;
1
+ import { PropsWithChildren } from 'react';
2
+ export declare function DrapNDropContainer({ enableDragNDrop, children }: PropsWithChildren<{
3
+ enableDragNDrop?: boolean;
4
+ }>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { jsx as o, Fragment as t } from "react/jsx-runtime";
2
+ import { DndProvider as m } from "react-dnd";
3
+ import { HTML5Backend as e } from "react-dnd-html5-backend";
4
+ function f({ enableDragNDrop: n, children: r }) {
5
+ return n ? /* @__PURE__ */ o(m, { backend: e, children: r }) : /* @__PURE__ */ o(t, { children: r });
6
+ }
7
+ export {
8
+ f as DrapNDropContainer
9
+ };
10
+ //# sourceMappingURL=dragNDropContainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dragNDropContainer.js","sources":["../../../../src/components/table/components/dragNDropContainer.tsx"],"sourcesContent":["import { PropsWithChildren } from \"react\";\nimport { DndProvider } from \"react-dnd\";\nimport { HTML5Backend } from \"react-dnd-html5-backend\";\n\nexport function DrapNDropContainer({ enableDragNDrop, children }: PropsWithChildren<{ enableDragNDrop?: boolean }>) {\n return enableDragNDrop ? <DndProvider backend={HTML5Backend}>{children}</DndProvider> : <>{children}</>;\n}\n"],"names":["DrapNDropContainer","enableDragNDrop","children","DndProvider","HTML5Backend"],"mappings":";;;AAIO,SAASA,EAAmB,EAAE,iBAAAC,GAAiB,UAAAC,KAA8D;AAC3G,SAAAD,sBAAmBE,GAAY,EAAA,SAASC,GAAe,UAAAF,EAAS,CAAA,2BAAoB,UAAAA,EAAS,CAAA;AACtG;"}
@@ -1,6 +1,5 @@
1
- import React from "react";
2
- import { FilterProps } from "react-table";
3
- export declare function DefaultColumnFilter<D extends Record<string, unknown> = {}>(props: FilterProps<D> & {
4
- filterId: string;
5
- setFilterId: any;
6
- }): React.JSX.Element;
1
+ import { FilterProps } from 'react-table';
2
+ export declare function DefaultColumnFilter<D extends Record<string, unknown> = {}>(props: FilterProps<D> & {
3
+ filterId: string;
4
+ setFilterId: any;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,32 @@
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { useState as c, useCallback as f } from "react";
3
+ import { InputText as d } from "../../input-text/inputText.component.js";
4
+ function C(n) {
5
+ const {
6
+ filterId: s,
7
+ setFilterId: t,
8
+ column: { id: e, filterValue: a, setFilter: o }
9
+ } = n, [i, r] = c(a || ""), u = f(
10
+ (p, l) => {
11
+ r(l), t(e), o(l || void 0);
12
+ },
13
+ [e, r, t, o]
14
+ );
15
+ return /* @__PURE__ */ m(
16
+ d,
17
+ {
18
+ size: "sm",
19
+ id: e,
20
+ name: e,
21
+ autoFocus: e === s,
22
+ value: i,
23
+ onChange: u,
24
+ placeholder: "Search records..."
25
+ },
26
+ e
27
+ );
28
+ }
29
+ export {
30
+ C as DefaultColumnFilter
31
+ };
32
+ //# sourceMappingURL=defaultColumnFilter.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultColumnFilter.component.js","sources":["../../../../src/components/table/filters/defaultColumnFilter.component.tsx"],"sourcesContent":["import { useCallback, useState } from \"react\";\nimport { FilterProps } from \"react-table\";\n\nimport { InputText } from \"../../input-text/inputText.component\";\n\nexport function DefaultColumnFilter<D extends Record<string, unknown> = {}>(\n props: FilterProps<D> & { filterId: string; setFilterId: any }\n) {\n const {\n filterId,\n setFilterId,\n column: { id, filterValue, setFilter }\n } = props;\n\n const [value, setValue] = useState(filterValue || \"\");\n\n const onChange = useCallback(\n (name: string, value: any) => {\n setValue(value);\n setFilterId(id);\n setFilter(value || undefined);\n },\n [id, setValue, setFilterId, setFilter]\n );\n\n /* eslint-disable jsx-a11y/no-autofocus */\n return (\n <InputText\n size={\"sm\"}\n id={id}\n name={id}\n key={id}\n autoFocus={id === filterId}\n value={value}\n onChange={onChange}\n placeholder={\"Search records...\"}\n />\n );\n}\n"],"names":["DefaultColumnFilter","props","filterId","setFilterId","id","filterValue","setFilter","value","setValue","useState","onChange","useCallback","name","jsx","InputText"],"mappings":";;;AAKO,SAASA,EACdC,GACA;AACM,QAAA;AAAA,IACJ,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,QAAQ,EAAE,IAAAC,GAAI,aAAAC,GAAa,WAAAC,EAAU;AAAA,EAAA,IACnCL,GAEE,CAACM,GAAOC,CAAQ,IAAIC,EAASJ,KAAe,EAAE,GAE9CK,IAAWC;AAAA,IACf,CAACC,GAAcL,MAAe;AAC5B,MAAAC,EAASD,CAAK,GACdJ,EAAYC,CAAE,GACdE,EAAUC,KAAS,MAAS;AAAA,IAC9B;AAAA,IACA,CAACH,GAAII,GAAUL,GAAaG,CAAS;AAAA,EACvC;AAIE,SAAA,gBAAAO;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAM;AAAA,MACN,IAAAV;AAAA,MACA,MAAMA;AAAA,MAEN,WAAWA,MAAOF;AAAA,MAClB,OAAAK;AAAA,MACA,UAAAG;AAAA,MACA,aAAa;AAAA,IAAA;AAAA,IAJRN;AAAA,EAKP;AAEJ;"}
@@ -1,11 +1,10 @@
1
- import React from "react";
2
- import { FilterProps } from "react-table";
3
- export declare function useSelectColumnFilter<D extends Record<string, unknown> = {}>(props: FilterProps<D>): {
4
- value: any;
5
- onChange: (_: string, value: any) => void;
6
- choices: {
7
- value: string;
8
- label: string;
9
- }[];
10
- };
11
- export declare function SelectColumnFilter<D extends Record<string, unknown> = {}>(props: FilterProps<D>): React.JSX.Element;
1
+ import { FilterProps } from 'react-table';
2
+ export declare function useSelectColumnFilter<D extends Record<string, unknown> = {}>(props: FilterProps<D>): {
3
+ value: any;
4
+ onChange: (_: string, value: any) => void;
5
+ choices: {
6
+ value: string;
7
+ label: string;
8
+ }[];
9
+ };
10
+ export declare function SelectColumnFilter<D extends Record<string, unknown> = {}>(props: FilterProps<D>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,34 @@
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { Select as a } from "../../select/select.component.js";
3
+ function f(t) {
4
+ const { column: n } = t, { id: c, preFilteredRows: l } = n, { choices: o } = n, { filterValue: i, setFilter: r } = n, u = o ? typeof o == "function" ? o(t) : o : [...new Set(l.map((e) => e.values[c]))].filter((e) => e).map((e) => ({
5
+ label: e,
6
+ value: e
7
+ }));
8
+ return {
9
+ value: i,
10
+ onChange: (e, s) => {
11
+ r(s || void 0);
12
+ },
13
+ choices: [{ value: "", label: "All" }].concat(u)
14
+ };
15
+ }
16
+ function v(t) {
17
+ const { value: n, choices: c, onChange: l } = f(t);
18
+ return /* @__PURE__ */ m(
19
+ a,
20
+ {
21
+ name: `filter-${t.column.id}`,
22
+ size: "sm",
23
+ value: n,
24
+ choices: c,
25
+ onChange: l
26
+ },
27
+ `filter-${t.column.id}`
28
+ );
29
+ }
30
+ export {
31
+ v as SelectColumnFilter,
32
+ f as useSelectColumnFilter
33
+ };
34
+ //# sourceMappingURL=selectColumnFilter.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selectColumnFilter.component.js","sources":["../../../../src/components/table/filters/selectColumnFilter.component.tsx"],"sourcesContent":["import { FilterProps } from \"react-table\";\n\nimport { Select } from \"../../select/select.component\";\n\nexport function useSelectColumnFilter<D extends Record<string, unknown> = {}>(props: FilterProps<D>) {\n const { column } = props;\n const { id, preFilteredRows } = column;\n const { choices: customChoices } = column as any;\n const { filterValue, setFilter } = column;\n\n const choices = (() => {\n if (customChoices) {\n if (typeof customChoices === \"function\") {\n return customChoices(props);\n }\n return customChoices;\n }\n\n return [...new Set(preFilteredRows.map((row) => row.values[id]))]\n .filter((value) => value)\n .map((value) => ({\n label: value,\n value\n }));\n })();\n\n const onChange = (_: string, value: any) => {\n setFilter(value || undefined);\n };\n\n return {\n value: filterValue,\n onChange,\n choices: [{ value: \"\", label: \"All\" }].concat(choices)\n };\n}\n\nexport function SelectColumnFilter<D extends Record<string, unknown> = {}>(props: FilterProps<D>) {\n const { value, choices, onChange } = useSelectColumnFilter(props);\n\n return (\n <Select\n key={`filter-${props.column.id}`}\n name={`filter-${props.column.id}`}\n size={\"sm\"}\n value={value}\n choices={choices}\n onChange={onChange}\n />\n );\n}\n"],"names":["useSelectColumnFilter","props","column","id","preFilteredRows","customChoices","filterValue","setFilter","choices","row","value","_","SelectColumnFilter","onChange","jsx","Select"],"mappings":";;AAIO,SAASA,EAA8DC,GAAuB;AAC7F,QAAA,EAAE,QAAAC,MAAWD,GACb,EAAE,IAAAE,GAAI,iBAAAC,EAAA,IAAoBF,GAC1B,EAAE,SAASG,EAAA,IAAkBH,GAC7B,EAAE,aAAAI,GAAa,WAAAC,EAAA,IAAcL,GAE7BM,IACAH,IACE,OAAOA,KAAkB,aACpBA,EAAcJ,CAAK,IAErBI,IAGF,CAAC,GAAG,IAAI,IAAID,EAAgB,IAAI,CAACK,MAAQA,EAAI,OAAON,CAAE,CAAC,CAAC,CAAC,EAC7D,OAAO,CAACO,MAAUA,CAAK,EACvB,IAAI,CAACA,OAAW;AAAA,IACf,OAAOA;AAAA,IACP,OAAAA;AAAA,EAAA,EACA;AAOC,SAAA;AAAA,IACL,OAAOJ;AAAA,IACP,UANe,CAACK,GAAWD,MAAe;AAC1C,MAAAH,EAAUG,KAAS,MAAS;AAAA,IAC9B;AAAA,IAKE,SAAS,CAAC,EAAE,OAAO,IAAI,OAAO,MAAO,CAAA,EAAE,OAAOF,CAAO;AAAA,EACvD;AACF;AAEO,SAASI,EAA2DX,GAAuB;AAChG,QAAM,EAAE,OAAAS,GAAO,SAAAF,GAAS,UAAAK,EAAS,IAAIb,EAAsBC,CAAK;AAG9D,SAAA,gBAAAa;AAAA,IAACC;AAAA,IAAA;AAAA,MAEC,MAAM,UAAUd,EAAM,OAAO,EAAE;AAAA,MAC/B,MAAM;AAAA,MACN,OAAAS;AAAA,MACA,SAAAF;AAAA,MACA,UAAAK;AAAA,IAAA;AAAA,IALK,UAAUZ,EAAM,OAAO,EAAE;AAAA,EAMhC;AAEJ;"}
@@ -1,3 +1,2 @@
1
- import React from "react";
2
- import { FilterProps } from "react-table";
3
- export declare function SliderColumnFilter<D extends Record<string, unknown> = {}>({ column: { filterValue, setFilter, preFilteredRows, id } }: FilterProps<D>): React.JSX.Element;
1
+ import { FilterProps } from 'react-table';
2
+ export declare function SliderColumnFilter<D extends Record<string, unknown> = {}>({ column: { filterValue, setFilter, preFilteredRows, id } }: FilterProps<D>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,27 @@
1
+ import { jsxs as v, Fragment as c, jsx as e } from "react/jsx-runtime";
2
+ function f({
3
+ column: { filterValue: h, setFilter: m, preFilteredRows: a, id: t }
4
+ }) {
5
+ let l = a.length ? a[0].values[t] : 0, u = a.length ? a[0].values[t] : 0;
6
+ return a.forEach((n) => {
7
+ l = Math.min(n == null ? void 0 : n.values[t], l), u = Math.max(n == null ? void 0 : n.values[t], u);
8
+ }), /* @__PURE__ */ v(c, { children: [
9
+ /* @__PURE__ */ e(
10
+ "input",
11
+ {
12
+ type: "range",
13
+ min: l,
14
+ max: u,
15
+ value: h || l,
16
+ onChange: (n) => {
17
+ m(parseInt(n.target.value, 10));
18
+ }
19
+ }
20
+ ),
21
+ /* @__PURE__ */ e("button", { onClick: () => m(void 0), children: "Off" })
22
+ ] });
23
+ }
24
+ export {
25
+ f as SliderColumnFilter
26
+ };
27
+ //# sourceMappingURL=sliderColumnFilter.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sliderColumnFilter.component.js","sources":["../../../../src/components/table/filters/sliderColumnFilter.component.tsx"],"sourcesContent":["import { FilterProps } from \"react-table\";\n\nexport function SliderColumnFilter<D extends Record<string, unknown> = {}>({\n column: { filterValue, setFilter, preFilteredRows, id }\n}: FilterProps<D>) {\n let min = preFilteredRows.length ? preFilteredRows[0].values[id] : 0;\n let max = preFilteredRows.length ? preFilteredRows[0].values[id] : 0;\n\n preFilteredRows.forEach((row) => {\n min = Math.min(row?.values[id], min);\n max = Math.max(row?.values[id], max);\n });\n\n return (\n <>\n <input\n type='range'\n min={min}\n max={max}\n value={filterValue || min}\n onChange={(e) => {\n setFilter(parseInt(e.target.value, 10));\n }}\n />\n <button onClick={() => setFilter(undefined)}>Off</button>\n </>\n );\n}\n"],"names":["SliderColumnFilter","filterValue","setFilter","preFilteredRows","id","min","max","row","jsxs","Fragment","jsx","e"],"mappings":";AAEO,SAASA,EAA2D;AAAA,EACzE,QAAQ,EAAE,aAAAC,GAAa,WAAAC,GAAW,iBAAAC,GAAiB,IAAAC,EAAG;AACxD,GAAmB;AACb,MAAAC,IAAMF,EAAgB,SAASA,EAAgB,CAAC,EAAE,OAAOC,CAAE,IAAI,GAC/DE,IAAMH,EAAgB,SAASA,EAAgB,CAAC,EAAE,OAAOC,CAAE,IAAI;AAEnD,SAAAD,EAAA,QAAQ,CAACI,MAAQ;AAC/B,IAAAF,IAAM,KAAK,IAAIE,KAAA,gBAAAA,EAAK,OAAOH,IAAKC,CAAG,GACnCC,IAAM,KAAK,IAAIC,KAAA,gBAAAA,EAAK,OAAOH,IAAKE,CAAG;AAAA,EAAA,CACpC,GAIG,gBAAAE,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,KAAAL;AAAA,QACA,KAAAC;AAAA,QACA,OAAOL,KAAeI;AAAA,QACtB,UAAU,CAACM,MAAM;AACf,UAAAT,EAAU,SAASS,EAAE,OAAO,OAAO,EAAE,CAAC;AAAA,QAAA;AAAA,MACxC;AAAA,IACF;AAAA,sBACC,UAAO,EAAA,SAAS,MAAMT,EAAU,MAAS,GAAG,UAAG,MAAA,CAAA;AAAA,EAAA,GAClD;AAEJ;"}
@@ -1,128 +1,128 @@
1
- import React, { PropsWithChildren } from "react";
2
- import { Cell, CellProps, Column, FilterProps, Renderer, TableOptions } from "react-table";
3
- import { OnClickOperation, Operation, QueryOptions } from "../../../interfaces";
4
- import { Pagination as DefaultPagination } from "../../pagination/pagination.component";
5
- import { DefaultCellHeaderProps } from "../components/defaultCellHeader.component";
6
- import { DefaultRow, DefaultRowProps } from "../components/defaultRow.component";
7
- export interface ExtraColumnProps {
8
- colspan?: number;
9
- hidden?: boolean;
10
- className?: string;
11
- style?: React.CSSProperties;
12
- }
13
- export type ExtendedColumn<Data extends object = any> = Column<Data> & ExtraColumnProps;
14
- export type ExtendedCell<Data extends object = any> = Cell<Data, any> & {
15
- column: ExtraColumnProps;
16
- };
17
- export interface TableProps<Data extends object = any> extends TableOptions<Data>, Partial<QueryOptions> {
18
- /**
19
- * extended columns interface
20
- */
21
- columns: ReadonlyArray<ExtendedColumn<Data>>;
22
- className?: string;
23
- /**
24
- * Call the listener when a filter / pagination / sort change.
25
- */
26
- onChange?: (query: QueryOptions) => void;
27
- /**
28
- * Call the listener when a line is clicked.
29
- */
30
- onClick?: OnClickOperation<Data>;
31
- /**
32
- * Pagination steps list
33
- */
34
- pageSizes?: number[];
35
- /**
36
- * Total length of the data
37
- */
38
- totalLength?: number;
39
- /**
40
- *
41
- */
42
- isLoading?: boolean;
43
- /**
44
- * Custom EmptyData displayed when there is no data
45
- */
46
- EmptyData?: React.ComponentType;
47
- /**
48
- * Custom ArrowSort
49
- */
50
- ArrowSort?: React.ComponentType;
51
- /**
52
- * Custom default ColumnFilter
53
- */
54
- ColumnFilter?: Renderer<FilterProps<Data>>;
55
- /**
56
- * Custom cell
57
- */
58
- Cell?: React.ComponentType<CellProps<Data>>;
59
- /**
60
- * Custom Row
61
- */
62
- Row?: React.ComponentType<DefaultRowProps<Data>>;
63
- /**
64
- *
65
- */
66
- CellHeader?: React.ComponentType<DefaultCellHeaderProps<Data>>;
67
- /**
68
- *
69
- */
70
- CellOperations?: React.ComponentType;
71
- /**
72
- * Custom Loader
73
- */
74
- Loader?: React.ComponentType;
75
- /**
76
- * Custom Loader
77
- */
78
- Pagination?: React.ComponentType;
79
- /**
80
- * Disable filters
81
- */
82
- disableFilters?: boolean;
83
- /**
84
- * Disable pagination
85
- */
86
- disablePagination?: boolean;
87
- manualPagination?: boolean;
88
- manualSortBy?: boolean;
89
- manualFilters?: boolean;
90
- /**
91
- * Configuration operation for each line.
92
- */
93
- operations?: Operation[];
94
- i18n?: (f: string) => string;
95
- /**
96
- * Enable drag and drop rows
97
- */
98
- enableDragNDrop?: boolean;
99
- onDrag?: (data: Data[]) => void;
100
- onDrop?: (item: Data) => void;
101
- }
102
- export declare function getOperationCallback(operations: Operation[], onClick: OnClickOperation): (data: any, action: string) => void;
103
- declare function DefaultLoader(): React.JSX.Element;
104
- declare function DefaultEmptyData(): React.JSX.Element;
105
- export declare function useCustomTable<Data extends object = {}>(props: PropsWithChildren<TableProps<Data>>): {
106
- className: string;
107
- tableInstance: import("react-table").TableInstance<Data>;
108
- CellHeader: any;
109
- isLoading: boolean | undefined;
110
- Loader: React.ComponentType<{}> | typeof DefaultLoader;
111
- EmptyData: React.ComponentType<{}> | typeof DefaultEmptyData;
112
- Row: React.ComponentType<DefaultRowProps<Data>> | typeof DefaultRow;
113
- data: readonly Data[];
114
- disablePagination: boolean | undefined;
115
- Pagination: React.ComponentType<{}> | typeof DefaultPagination;
116
- pageIndex: number;
117
- pageSize: number;
118
- pageSizes: number[];
119
- totalLength: number | undefined;
120
- setPageSize: (pageSize: number) => void;
121
- i18n: (f: string) => string;
122
- children: React.ReactNode;
123
- onClick: any;
124
- onDrag: (dragIndex: number, hoverIndex: number) => void;
125
- onDrop: (...args: any[]) => void;
126
- enableDragNDrop: boolean | undefined;
127
- };
128
- export {};
1
+ import { ComponentType, CSSProperties, PropsWithChildren } from 'react';
2
+ import { Cell, CellProps, Column, FilterProps, Renderer, TableOptions } from 'react-table';
3
+ import { OnClickOperation, Operation, QueryOptions } from '../../../interfaces';
4
+ import { Pagination as DefaultPagination } from '../../pagination/pagination.component';
5
+ import { DefaultCellHeaderProps } from '../components/defaultCellHeader.component';
6
+ import { DefaultRow, DefaultRowProps } from '../components/defaultRow.component';
7
+ export interface ExtraColumnProps {
8
+ colspan?: number;
9
+ hidden?: boolean;
10
+ className?: string;
11
+ style?: CSSProperties;
12
+ }
13
+ export type ExtendedColumn<Data extends object = any> = Column<Data> & ExtraColumnProps;
14
+ export type ExtendedCell<Data extends object = any> = Cell<Data, any> & {
15
+ column: ExtraColumnProps;
16
+ };
17
+ export interface TableProps<Data extends object = any> extends TableOptions<Data>, Partial<QueryOptions> {
18
+ /**
19
+ * extended columns interface
20
+ */
21
+ columns: ReadonlyArray<ExtendedColumn<Data>>;
22
+ className?: string;
23
+ /**
24
+ * Call the listener when a filter / pagination / sort change.
25
+ */
26
+ onChange?: (query: QueryOptions) => void;
27
+ /**
28
+ * Call the listener when a line is clicked.
29
+ */
30
+ onClick?: OnClickOperation<Data>;
31
+ /**
32
+ * Pagination steps list
33
+ */
34
+ pageSizes?: number[];
35
+ /**
36
+ * Total length of the data
37
+ */
38
+ totalLength?: number;
39
+ /**
40
+ *
41
+ */
42
+ isLoading?: boolean;
43
+ /**
44
+ * Custom EmptyData displayed when there is no data
45
+ */
46
+ EmptyData?: ComponentType;
47
+ /**
48
+ * Custom ArrowSort
49
+ */
50
+ ArrowSort?: ComponentType;
51
+ /**
52
+ * Custom default ColumnFilter
53
+ */
54
+ ColumnFilter?: Renderer<FilterProps<Data>>;
55
+ /**
56
+ * Custom cell
57
+ */
58
+ Cell?: ComponentType<CellProps<Data>>;
59
+ /**
60
+ * Custom Row
61
+ */
62
+ Row?: ComponentType<DefaultRowProps<Data>>;
63
+ /**
64
+ *
65
+ */
66
+ CellHeader?: ComponentType<DefaultCellHeaderProps<Data>>;
67
+ /**
68
+ *
69
+ */
70
+ CellOperations?: ComponentType;
71
+ /**
72
+ * Custom Loader
73
+ */
74
+ Loader?: ComponentType;
75
+ /**
76
+ * Custom Loader
77
+ */
78
+ Pagination?: ComponentType;
79
+ /**
80
+ * Disable filters
81
+ */
82
+ disableFilters?: boolean;
83
+ /**
84
+ * Disable pagination
85
+ */
86
+ disablePagination?: boolean;
87
+ manualPagination?: boolean;
88
+ manualSortBy?: boolean;
89
+ manualFilters?: boolean;
90
+ /**
91
+ * Configuration operation for each line.
92
+ */
93
+ operations?: Operation[];
94
+ i18n?: (f: string) => string;
95
+ /**
96
+ * Enable drag and drop rows
97
+ */
98
+ enableDragNDrop?: boolean;
99
+ onDrag?: (data: Data[]) => void;
100
+ onDrop?: (item: Data) => void;
101
+ }
102
+ export declare function getOperationCallback(operations: Operation[], onClick: OnClickOperation): (data: any, action: string) => void;
103
+ declare function DefaultLoader(): import("react/jsx-runtime").JSX.Element;
104
+ declare function DefaultEmptyData(): import("react/jsx-runtime").JSX.Element;
105
+ export declare function useCustomTable<Data extends object = {}>(props: PropsWithChildren<TableProps<Data>>): {
106
+ className: string;
107
+ tableInstance: import('react-table').TableInstance<Data>;
108
+ CellHeader: any;
109
+ isLoading: boolean | undefined;
110
+ Loader: ComponentType | typeof DefaultLoader;
111
+ EmptyData: ComponentType | typeof DefaultEmptyData;
112
+ Row: ComponentType<DefaultRowProps<Data>> | typeof DefaultRow;
113
+ data: readonly Data[];
114
+ disablePagination: boolean | undefined;
115
+ Pagination: ComponentType | typeof DefaultPagination;
116
+ pageIndex: number;
117
+ pageSize: number;
118
+ pageSizes: number[];
119
+ totalLength: number | undefined;
120
+ setPageSize: (pageSize: number) => void;
121
+ i18n: (f: string) => string;
122
+ children: import('react').ReactNode;
123
+ onClick: any;
124
+ onDrag: (dragIndex: number, hoverIndex: number) => void;
125
+ onDrop: (...args: any[]) => void;
126
+ enableDragNDrop: boolean | undefined;
127
+ };
128
+ export {};
@@ -0,0 +1,130 @@
1
+ import { jsx as y } from "react/jsx-runtime";
2
+ import n from "lodash/noop";
3
+ import { useState as b, useEffect as F } from "react";
4
+ import { useTable as W, useFilters as X, useGroupBy as Y, useSortBy as Z, usePagination as tt } from "react-table";
5
+ import { Pagination as et } from "../../pagination/pagination.component.js";
6
+ import { DefaultArrowSort as ot } from "../components/defaultArrowSort.component.js";
7
+ import { DefaultCellHeader as at } from "../components/defaultCellHeader.component.js";
8
+ import { DefaultRow as nt } from "../components/defaultRow.component.js";
9
+ import { DefaultColumnFilter as it } from "../filters/defaultColumnFilter.component.js";
10
+ import { swapElements as rt } from "../utils/swapElements.js";
11
+ import { useOperations as lt } from "./useOperations.hook.js";
12
+ function st(t, i) {
13
+ return (r, a) => {
14
+ const e = t.find((o) => o.action === a || o.alias === a);
15
+ e && i(r, e);
16
+ };
17
+ }
18
+ function ut() {
19
+ return /* @__PURE__ */ y("div", { className: "text-center p-2 pb-4 font-bold", children: "Loading in progress" });
20
+ }
21
+ function mt() {
22
+ return /* @__PURE__ */ y("div", { className: "text-center p-2 pb-4 font-bold", children: "No data found" });
23
+ }
24
+ const ct = [X, Y, Z, tt];
25
+ function xt(t) {
26
+ const {
27
+ children: i,
28
+ className: r = "",
29
+ columns: a,
30
+ data: e,
31
+ onChange: o = n,
32
+ onClick: x = n,
33
+ onDrag: I = n,
34
+ onDrop: B = n,
35
+ operations: c = [],
36
+ pageSizes: h = [10, 25, 50, 100],
37
+ filters: k,
38
+ filterId: w,
39
+ pageSize: z,
40
+ pageIndex: N,
41
+ totalLength: v,
42
+ sortBy: L,
43
+ isLoading: E,
44
+ disableFilters: R,
45
+ disablePagination: O,
46
+ ArrowSort: A = ot,
47
+ ColumnFilter: H = it,
48
+ EmptyData: T = mt,
49
+ Loader: _ = ut,
50
+ Pagination: j = et,
51
+ Row: G = nt,
52
+ CellHeader: $ = at,
53
+ CellOperations: q,
54
+ i18n: d = (m) => m,
55
+ ...f
56
+ } = t, g = st(c, x), J = {
57
+ Filter: H,
58
+ ArrowSort: A
59
+ }, [l, K] = b(w), [M, p] = b(e);
60
+ F(() => {
61
+ p(e);
62
+ }, [e]);
63
+ const Q = (m, V) => {
64
+ const P = rt([...M], m, V);
65
+ p(P), I(P);
66
+ }, D = W(
67
+ {
68
+ ...t,
69
+ columns: a,
70
+ data: e,
71
+ ctx: f,
72
+ defaultColumn: J,
73
+ // getRowId,
74
+ initialState: {
75
+ ...t.initialState || {},
76
+ filters: k || [],
77
+ pageIndex: N || 0,
78
+ pageSize: z || 10,
79
+ sortBy: L || []
80
+ },
81
+ manualPagination: t.manualPagination === void 0 ? !0 : t.manualPagination,
82
+ manualSortBy: t.manualSortBy === void 0 ? !0 : t.manualPagination,
83
+ manualFilters: t.manualFilters === void 0 ? !0 : t.manualFilters,
84
+ disableFilters: R,
85
+ filterId: l,
86
+ setFilterId: K
87
+ },
88
+ ...ct,
89
+ lt({ operations: c, CellOperations: q, onClick: g, ctx: f, i18n: d })
90
+ ), {
91
+ setPageSize: U,
92
+ state: { pageIndex: s, pageSize: u, sortBy: S, filters: C }
93
+ } = D;
94
+ return F(() => {
95
+ o({
96
+ pageIndex: s,
97
+ pageSize: u,
98
+ sortBy: S,
99
+ filters: C,
100
+ filterId: l
101
+ });
102
+ }, [o, s, u, S, C, l]), {
103
+ className: r,
104
+ tableInstance: D,
105
+ CellHeader: $,
106
+ isLoading: E,
107
+ Loader: _,
108
+ EmptyData: T,
109
+ Row: G,
110
+ data: e,
111
+ disablePagination: O,
112
+ Pagination: j,
113
+ pageIndex: s,
114
+ pageSize: u,
115
+ pageSizes: h,
116
+ totalLength: v,
117
+ setPageSize: U,
118
+ i18n: d,
119
+ children: i,
120
+ onClick: g,
121
+ onDrag: Q,
122
+ onDrop: B,
123
+ enableDragNDrop: t.enableDragNDrop
124
+ };
125
+ }
126
+ export {
127
+ st as getOperationCallback,
128
+ xt as useCustomTable
129
+ };
130
+ //# sourceMappingURL=useCustomTable.hook.js.map