@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
@@ -1,5 +1,5 @@
1
1
  import classnames from "classnames";
2
- import React, { DetailedHTMLProps, HTMLAttributes } from "react";
2
+ import { DetailedHTMLProps, HTMLAttributes } from "react";
3
3
  import { Row } from "react-table";
4
4
 
5
5
  import { iconClass } from "../../../utils/iconClass";
@@ -21,6 +21,7 @@ export function DefaultDndRow<Data extends object = {}>(props: DefaultRowProps<D
21
21
 
22
22
  return (
23
23
  <tr ref={dropRef} style={{ opacity }}>
24
+ {/* eslint-disable-next-line jsx-a11y/no-interactive-element-to-noninteractive-role */}
24
25
  <td ref={dragRef} role='cell' style={{ cursor: isDragging ? "grabbing" : "grab" }} className='align-middle'>
25
26
  <div className='flex items-center justify-center'>
26
27
  <i className={classnames(iconClass(undefined, "dots-vertical-rounded"))} />
@@ -1,4 +1,4 @@
1
- import React, { PropsWithChildren } from "react";
1
+ import { PropsWithChildren } from "react";
2
2
  import { DndProvider } from "react-dnd";
3
3
  import { HTML5Backend } from "react-dnd-html5-backend";
4
4
 
@@ -1,7 +1,4 @@
1
- import "@testing-library/jest-dom/extend-expect";
2
-
3
1
  import { act, fireEvent, render, screen } from "@testing-library/react";
4
- import React from "react";
5
2
 
6
3
  import { DefaultColumnFilter } from "./defaultColumnFilter.component";
7
4
 
@@ -9,9 +6,9 @@ describe("DefaultColumnFilter", () => {
9
6
  it("should display text-field and handle change", async () => {
10
7
  const props = {
11
8
  filterId: "data.id",
12
- setFilterId: jest.fn(),
9
+ setFilterId: vi.fn(),
13
10
  name: "data.id",
14
- column: { id: "id", filterValue: "", setFilter: jest.fn() }
11
+ column: { id: "id", filterValue: "", setFilter: vi.fn() }
15
12
  };
16
13
 
17
14
  render(
@@ -1,4 +1,4 @@
1
- import React, { useCallback, useState } from "react";
1
+ import { useCallback, useState } from "react";
2
2
  import { FilterProps } from "react-table";
3
3
 
4
4
  import { InputText } from "../../input-text/inputText.component";
@@ -23,6 +23,7 @@ export function DefaultColumnFilter<D extends Record<string, unknown> = {}>(
23
23
  [id, setValue, setFilterId, setFilter]
24
24
  );
25
25
 
26
+ /* eslint-disable jsx-a11y/no-autofocus */
26
27
  return (
27
28
  <InputText
28
29
  size={"sm"}
@@ -1,13 +1,10 @@
1
- import "@testing-library/jest-dom/extend-expect";
2
-
3
1
  import { render, screen } from "@testing-library/react";
4
- import React from "react";
5
2
 
6
3
  import { SelectColumnFilter } from "./selectColumnFilter.component";
7
4
 
8
5
  describe("SelectColumnFilter", () => {
9
6
  it("should display select with choices", async () => {
10
- const mockSetFilter = jest.fn();
7
+ const mockSetFilter = vi.fn();
11
8
  const props = {
12
9
  name: "data.id",
13
10
  setFilter: mockSetFilter,
@@ -26,7 +23,7 @@ describe("SelectColumnFilter", () => {
26
23
  expect(screen.getByText("select-choice-2")).toBeDefined();
27
24
  });
28
25
  it("should display select with custom choices", async () => {
29
- const mockSetFilter = jest.fn();
26
+ const mockSetFilter = vi.fn();
30
27
  const props = {
31
28
  name: "data.id",
32
29
  setFilter: mockSetFilter,
@@ -47,7 +44,7 @@ describe("SelectColumnFilter", () => {
47
44
  });
48
45
 
49
46
  it("should display select with custom choices (function)", async () => {
50
- const mockSetFilter = jest.fn();
47
+ const mockSetFilter = vi.fn();
51
48
  const props = {
52
49
  name: "data.id",
53
50
  setFilter: mockSetFilter,
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { FilterProps } from "react-table";
3
2
 
4
3
  import { Select } from "../../select/select.component";
@@ -1,18 +1,15 @@
1
- import React from "react";
2
1
  import { FilterProps } from "react-table";
3
2
 
4
3
  export function SliderColumnFilter<D extends Record<string, unknown> = {}>({
5
4
  column: { filterValue, setFilter, preFilteredRows, id }
6
5
  }: FilterProps<D>) {
7
- const [min, max] = React.useMemo(() => {
8
- let min = preFilteredRows.length ? preFilteredRows[0].values[id] : 0;
9
- let max = preFilteredRows.length ? preFilteredRows[0].values[id] : 0;
10
- preFilteredRows.forEach((row) => {
11
- min = Math.min(row?.values[id], min);
12
- max = Math.max(row?.values[id], max);
13
- });
14
- return [min, max];
15
- }, [id, preFilteredRows]);
6
+ let min = preFilteredRows.length ? preFilteredRows[0].values[id] : 0;
7
+ let max = preFilteredRows.length ? preFilteredRows[0].values[id] : 0;
8
+
9
+ preFilteredRows.forEach((row) => {
10
+ min = Math.min(row?.values[id], min);
11
+ max = Math.max(row?.values[id], max);
12
+ });
16
13
 
17
14
  return (
18
15
  <>
@@ -1,5 +1,5 @@
1
1
  import noop from "lodash/noop";
2
- import React, { PropsWithChildren, useEffect, useState } from "react";
2
+ import { ComponentType, CSSProperties, PropsWithChildren, useEffect, useState } from "react";
3
3
  import {
4
4
  Cell,
5
5
  CellProps,
@@ -27,7 +27,7 @@ export interface ExtraColumnProps {
27
27
  colspan?: number;
28
28
  hidden?: boolean;
29
29
  className?: string;
30
- style?: React.CSSProperties;
30
+ style?: CSSProperties;
31
31
  }
32
32
 
33
33
  export type ExtendedColumn<Data extends object = any> = Column<Data> & ExtraColumnProps;
@@ -66,11 +66,11 @@ export interface TableProps<Data extends object = any> extends TableOptions<Data
66
66
  /**
67
67
  * Custom EmptyData displayed when there is no data
68
68
  */
69
- EmptyData?: React.ComponentType;
69
+ EmptyData?: ComponentType;
70
70
  /**
71
71
  * Custom ArrowSort
72
72
  */
73
- ArrowSort?: React.ComponentType;
73
+ ArrowSort?: ComponentType;
74
74
  /**
75
75
  * Custom default ColumnFilter
76
76
  */
@@ -78,27 +78,27 @@ export interface TableProps<Data extends object = any> extends TableOptions<Data
78
78
  /**
79
79
  * Custom cell
80
80
  */
81
- Cell?: React.ComponentType<CellProps<Data>>;
81
+ Cell?: ComponentType<CellProps<Data>>;
82
82
  /**
83
83
  * Custom Row
84
84
  */
85
- Row?: React.ComponentType<DefaultRowProps<Data>>;
85
+ Row?: ComponentType<DefaultRowProps<Data>>;
86
86
  /**
87
87
  *
88
88
  */
89
- CellHeader?: React.ComponentType<DefaultCellHeaderProps<Data>>;
89
+ CellHeader?: ComponentType<DefaultCellHeaderProps<Data>>;
90
90
  /**
91
91
  *
92
92
  */
93
- CellOperations?: React.ComponentType;
93
+ CellOperations?: ComponentType;
94
94
  /**
95
95
  * Custom Loader
96
96
  */
97
- Loader?: React.ComponentType;
97
+ Loader?: ComponentType;
98
98
  /**
99
99
  * Custom Loader
100
100
  */
101
- Pagination?: React.ComponentType;
101
+ Pagination?: ComponentType;
102
102
  /**
103
103
  * Disable filters
104
104
  */
@@ -179,16 +179,12 @@ export function useCustomTable<Data extends object = {}>(props: PropsWithChildre
179
179
 
180
180
  const _onClick = getOperationCallback(operations, onClick);
181
181
 
182
- const defaultColumn = React.useMemo(
183
- () => ({
184
- // Let's set up our default Filter UI
185
- Filter: ColumnFilter,
186
- ArrowSort
187
- }),
188
- [ColumnFilter, ArrowSort]
189
- ) as any;
182
+ const defaultColumn = {
183
+ Filter: ColumnFilter,
184
+ ArrowSort
185
+ };
190
186
 
191
- const [filterId, setFilterId] = React.useState(controlledFilterId);
187
+ const [filterId, setFilterId] = useState(controlledFilterId);
192
188
 
193
189
  // DND
194
190
  const [records, setRecords] = useState<readonly Data[]>(data);
@@ -236,7 +232,7 @@ export function useCustomTable<Data extends object = {}>(props: PropsWithChildre
236
232
  state: { pageIndex, pageSize, sortBy, filters }
237
233
  } = tableInstance;
238
234
 
239
- React.useEffect(() => {
235
+ useEffect(() => {
240
236
  onChange({
241
237
  pageIndex,
242
238
  pageSize,
@@ -1,11 +1,11 @@
1
- import React from "react";
1
+ import { type ComponentType, type FunctionComponent } from "react";
2
2
  import { Hooks } from "react-table";
3
3
 
4
4
  import { Operation } from "../../../interfaces";
5
5
  import { DefaultCellOperations } from "../components/defaultCellOperations.component";
6
6
 
7
7
  export type UseOperationsHookProps = {
8
- CellOperations?: React.ComponentType;
8
+ CellOperations?: FunctionComponent | ComponentType<{}>;
9
9
  operations: Operation[];
10
10
  onClick?: (data: any, event: string) => void;
11
11
  i18n?: (f: string) => string;
@@ -14,7 +14,7 @@ export type UseOperationsHookProps = {
14
14
 
15
15
  export function useOperations<D extends object = {}>({
16
16
  operations,
17
- CellOperations = DefaultCellOperations,
17
+ CellOperations = DefaultCellOperations as FunctionComponent,
18
18
  onClick,
19
19
  i18n = (f: string) => f,
20
20
  ctx
@@ -1,5 +1,5 @@
1
1
  import classnames from "classnames";
2
- import React, { PropsWithChildren } from "react";
2
+ import { PropsWithChildren } from "react";
3
3
 
4
4
  import { DrapNDropContainer } from "./components/dragNDropContainer";
5
5
  import { TableProps, useCustomTable } from "./hooks/useCustomTable.hook";
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import { useState } from "react";
2
2
 
3
3
  import { mapPagination } from "../../utils/mapPagination";
4
4
  import formSchema from "../__fixtures__/form-schema.json";
@@ -14,9 +14,9 @@ export default {
14
14
  };
15
15
 
16
16
  export const Sandbox = (args: any) => {
17
- const [skip, setSkip] = React.useState(0);
18
- const [limit, setLimit] = React.useState(10);
19
- const [serverCount] = React.useState(87);
17
+ const [skip, setSkip] = useState(0);
18
+ const [limit, setLimit] = useState(10);
19
+ const [serverCount] = useState(87);
20
20
 
21
21
  const onChange = (obj: any) => {
22
22
  setLimit(obj.pageSize);
@@ -64,10 +64,10 @@ Sandbox.args = {
64
64
  };
65
65
 
66
66
  export const TableWithDragNDrop = (args: any) => {
67
- const [skip, setSkip] = React.useState(0);
68
- const [limit, setLimit] = React.useState(10);
69
- const [serverCount] = React.useState(87);
70
- const [data, setData] = React.useState(() => formSubmissions);
67
+ const [skip, setSkip] = useState(0);
68
+ const [limit, setLimit] = useState(10);
69
+ const [serverCount] = useState(87);
70
+ const [data, setData] = useState(() => formSubmissions);
71
71
 
72
72
  const onChange = (obj: any) => {
73
73
  setLimit(obj.pageSize);
@@ -1,6 +1,5 @@
1
1
  import { Components, ExtendedComponentSchema } from "formiojs";
2
2
  import FormioUtils from "formiojs/utils";
3
- import React from "react";
4
3
 
5
4
  import { FormSchema } from "../../../interfaces";
6
5
  import { DefaultCell } from "../components/defaultCell.component";
@@ -1,5 +1,5 @@
1
1
  import { fireEvent, render, screen } from "@testing-library/react";
2
- import * as React from "react";
2
+ import { expect, vi } from "vitest";
3
3
 
4
4
  import { Tabs } from "./tabs.component";
5
5
  import { Sandbox } from "./tabs.component.stories";
@@ -66,7 +66,7 @@ describe("tabs", () => {
66
66
  label: "Edit"
67
67
  }
68
68
  ];
69
- const onClick = jest.fn();
69
+ const onClick = vi.fn();
70
70
 
71
71
  render(<Tabs items={items} onClick={onClick} />);
72
72
 
@@ -1,4 +1,4 @@
1
- import React, { useState } from "react";
1
+ import { useState } from "react";
2
2
 
3
3
  import { Tabs } from "./tabs.component";
4
4
 
@@ -1,5 +1,5 @@
1
1
  import classnames from "classnames";
2
- import React, { PropsWithChildren } from "react";
2
+ import { PropsWithChildren } from "react";
3
3
 
4
4
  import { iconClass } from "../../utils/iconClass";
5
5
 
@@ -45,10 +45,12 @@ import {
45
45
  } from "react-table";
46
46
 
47
47
  declare module "react-table" {
48
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
48
49
  export interface UseFlexLayoutInstanceProps<D extends Record<string, unknown>> {
49
50
  totalColumnsMinWidth: number;
50
51
  }
51
52
 
53
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
52
54
  export interface UseFlexLayoutColumnProps<D extends Record<string, unknown>> {
53
55
  totalMinWidth: number;
54
56
  }
@@ -1,4 +1,6 @@
1
- import { Templates } from "formiojs";
1
+ import * as formio from "formiojs";
2
+
3
+ const { Templates } = formio;
2
4
 
3
5
  export function iconClass(iconset: string | undefined, name: string, spinning?: boolean): string {
4
6
  return Templates.current.iconClass(iconset || Templates.current.defaultIconset, name, spinning);
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": "@tsed/typescript/tsconfig.web.json",
3
+ "compilerOptions": {
4
+ "baseUrl": ".",
5
+ "noEmit": true,
6
+ "declaration": false,
7
+ "composite": false
8
+ },
9
+ "include": ["src/**/*.ts", "src/**/*.tsx", "vite.config.mts"],
10
+ "exclude": ["node_modules", "dist", "src/**/*.spec.ts", "src/**/*.spec.tsx"]
11
+ }
package/tsconfig.json CHANGED
@@ -1,16 +1,18 @@
1
1
  {
2
- "extends": "@tsed/config/tsconfig.web.json",
2
+ "extends": "@tsed/typescript/tsconfig.web.json",
3
3
  "compilerOptions": {
4
- "rootDir": "src",
5
- "moduleResolution": "node"
4
+ "baseUrl": ".",
5
+ "composite": true,
6
+ "noEmit": true
6
7
  },
7
- "include": ["src"],
8
+ "include": [],
9
+ "exclude": [],
8
10
  "references": [
9
11
  {
10
- "path": "./tsconfig.node.json"
12
+ "path": "./tsconfig.app.json"
11
13
  },
12
14
  {
13
- "path": "../redux-utils/tsconfig.json"
15
+ "path": "./tsconfig.spec.json"
14
16
  }
15
17
  ]
16
18
  }
@@ -0,0 +1,14 @@
1
+ {
2
+ "extends": "@tsed/typescript/tsconfig.web.json",
3
+ "compilerOptions": {
4
+ "baseUrl": ".",
5
+ "rootDir": ".",
6
+ "declaration": false,
7
+ "composite": false,
8
+ "noEmit": true,
9
+ "paths": {},
10
+ "types": ["vite/client", "vitest/globals", "@testing-library/jest-dom"]
11
+ },
12
+ "include": ["src/**/*.spec.tsx", "src/**/*.spec.ts", "vitest.config.mts"],
13
+ "exclude": ["node_modules", "dist", "coverage"]
14
+ }
@@ -0,0 +1,69 @@
1
+ import {fileURLToPath} from "node:url";
2
+
3
+ import react from "@vitejs/plugin-react";
4
+ import {globbySync} from "globby";
5
+ import {extname, relative} from "path";
6
+ import preserveDirectives from "rollup-preserve-directives";
7
+ import {defineConfig} from "vite";
8
+ import dts from "vite-plugin-dts";
9
+ import {resolve} from "node:path";
10
+
11
+ import pkg from "./package.json" with {type: "json"};
12
+
13
+ // https://vitejs.dev/config/
14
+ export default defineConfig({
15
+ plugins: [
16
+ react(),
17
+ dts({
18
+ tsconfigPath: "./tsconfig.app.json",
19
+ aliasesExclude: [],
20
+ include: ["src/**/*.{ts,tsx}"],
21
+ exclude: ["**/*.spec.{ts,tsx}", "**/*.stories.{ts,tsx}", "**/__*__/**"]
22
+ })
23
+ ],
24
+ resolve: {
25
+ alias: {}
26
+ },
27
+ build: {
28
+ sourcemap: true,
29
+ lib: {
30
+ entry: resolve(import.meta.dirname, "src/index.ts"),
31
+ formats: ["es"]
32
+ },
33
+ copyPublicDir: false,
34
+ rollupOptions: {
35
+ external: [
36
+ ...Object.keys(pkg.peerDependencies || {}),
37
+ "react",
38
+ "react-dom",
39
+ "react/jsx-runtime",
40
+ /lodash\/.*/,
41
+ /formiojs\/.*/,
42
+ /@tsed\/.*/
43
+ ],
44
+ plugins: [preserveDirectives() as any],
45
+ input: Object.fromEntries(
46
+ globbySync("src/**/*.{ts,tsx}", {
47
+ ignore: ["**/*.spec.{ts,tsx}", "**/*.stories.{ts,tsx}", "**/__*__/**"]
48
+ }).map((file) => {
49
+ return [
50
+ // The name of the entry point
51
+ // src/nested/foo.ts becomes nested/foo
52
+ relative("src", file.slice(0, file.length - extname(file).length)),
53
+ // The absolute path to the entry file
54
+ // src/nested/foo.ts becomes /project/src/nested/foo.ts
55
+ fileURLToPath(new URL(file, import.meta.url))
56
+ ];
57
+ })
58
+ ),
59
+ output: {
60
+ assetFileNames: "assets/[name][extname]",
61
+ chunkFileNames: "chunks/[name].js",
62
+ entryFileNames: "[name].js",
63
+ globals: {
64
+ react: "React"
65
+ }
66
+ }
67
+ }
68
+ }
69
+ });
@@ -0,0 +1,21 @@
1
+ // @ts-ignore
2
+ import {presets} from "@tsed/vitest/presets";
3
+ import {defineConfig} from "vitest/config";
4
+
5
+ export default defineConfig(
6
+ {
7
+ ...presets,
8
+ test: {
9
+ ...presets.test,
10
+ coverage: {
11
+ ...presets.test.coverage,
12
+ thresholds: {
13
+ statements: 0,
14
+ branches: 0,
15
+ functions: 0,
16
+ lines: 0
17
+ }
18
+ }
19
+ }
20
+ }
21
+ );
package/.eslintignore DELETED
@@ -1,13 +0,0 @@
1
- **/node_modules
2
- docs
3
- docs-references
4
- **/lib
5
- **/build
6
- **/dist
7
- **/coverage
8
- **/.nyc_output
9
- **/node_modules
10
- *-lock.json
11
- *.lock
12
- benchmarks.*
13
- **/generated
package/.eslintrc.js DELETED
@@ -1,7 +0,0 @@
1
- module.exports = {
2
- extends: [require.resolve("@tsed/config/eslint/web")],
3
- rules: {
4
- "import/no-anonymous-default-export": 0,
5
- "jsx-a11y/no-autofocus": 1
6
- }
7
- };
package/coverage.json DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "statements": 56.02,
3
- "branches": 46.56,
4
- "functions": 48.33,
5
- "lines": 56.04
6
- }
@@ -1,85 +0,0 @@
1
- import React from "react";
2
- import { ActionsTable } from "./actionsTable.component";
3
- declare const _default: {
4
- title: string;
5
- component: typeof ActionsTable;
6
- argTypes: {
7
- data: {
8
- control: {
9
- type: string;
10
- };
11
- };
12
- operations: {
13
- control: {
14
- type: string;
15
- };
16
- };
17
- isLoading: {
18
- control: {
19
- type: string;
20
- };
21
- };
22
- isEmpty: {
23
- control: {
24
- type: string;
25
- };
26
- };
27
- disableFilters: {
28
- control: {
29
- type: string;
30
- };
31
- };
32
- disablePagination: {
33
- control: {
34
- type: string;
35
- };
36
- };
37
- tags: {
38
- control: {
39
- type: string;
40
- };
41
- };
42
- onAddAction: {
43
- action: string;
44
- };
45
- };
46
- parameters: {};
47
- };
48
- export default _default;
49
- export declare const Sandbox: {
50
- (args: any): React.JSX.Element;
51
- args: {
52
- icon: string;
53
- availableActions: {
54
- label: string;
55
- value: string;
56
- }[];
57
- data: {
58
- _id: string;
59
- handler: string[];
60
- method: string[];
61
- priority: number;
62
- name: string;
63
- title: string;
64
- form: string;
65
- machineName: string;
66
- }[];
67
- operations: ({
68
- title: string;
69
- action: string;
70
- alias: string;
71
- path: string;
72
- icon: string;
73
- permissionsResolver(): boolean;
74
- buttonType?: undefined;
75
- } | {
76
- action: string;
77
- path: string;
78
- icon: string;
79
- buttonType: string;
80
- permissionsResolver(): boolean;
81
- title?: undefined;
82
- alias?: undefined;
83
- })[];
84
- };
85
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,15 +0,0 @@
1
- import React from "react";
2
- import { Alert } from "./alert.component";
3
- declare const _default: {
4
- title: string;
5
- component: typeof Alert;
6
- argTypes: {};
7
- parameters: {};
8
- };
9
- export default _default;
10
- export declare const Sandbox: {
11
- (args: any): React.JSX.Element;
12
- args: {
13
- error: string;
14
- };
15
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,16 +0,0 @@
1
- import React from "react";
2
- import { Card } from "./card.component";
3
- declare const _default: {
4
- title: string;
5
- component: typeof Card;
6
- argTypes: {};
7
- parameters: {};
8
- };
9
- export default _default;
10
- export declare const Sandbox: {
11
- (args: any): React.JSX.Element;
12
- args: {
13
- label: string;
14
- children: string;
15
- };
16
- };
@@ -1 +0,0 @@
1
- export {};