@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,3 @@
1
- import React from "react";
2
-
3
1
  import { FormBuilder } from "../../index";
4
2
 
5
3
  export default {
@@ -1,5 +1,4 @@
1
1
  import { render, screen } from "@testing-library/react";
2
- import React from "react";
3
2
 
4
3
  import { iconClass } from "../../utils/iconClass";
5
4
  import { Sandbox, WithDescription, WithPrefix, WithSuffix } from "./formControl.stories";
@@ -1,15 +1,16 @@
1
1
  import classnames from "classnames";
2
- import PropTypes from "prop-types";
3
- import React from "react";
2
+ import type { PropsWithChildren, ReactNode } from "react";
4
3
 
5
- export interface FormControlProps {
4
+ export interface FormControlProps<Data = any> {
6
5
  name: string;
6
+ value?: Data;
7
7
  required?: boolean;
8
8
  label?: string;
9
9
  className?: string;
10
- description?: string | React.ComponentType | any;
11
- prefix?: JSX.Element | React.ComponentType | any;
12
- suffix?: JSX.Element | React.ComponentType | any;
10
+ onChange?: (name: string, value: any) => void;
11
+ description?: string | ReactNode;
12
+ prefix?: ReactNode | string;
13
+ suffix?: ReactNode | string;
13
14
  shadow?: boolean;
14
15
  }
15
16
 
@@ -22,7 +23,7 @@ export function FormControl({
22
23
  description,
23
24
  label,
24
25
  className
25
- }: React.PropsWithChildren<FormControlProps>) {
26
+ }: PropsWithChildren<FormControlProps>) {
26
27
  return (
27
28
  <div data-testid={name && `form-group-${name}`} id={`form-group-${name || ""}`} className={classnames("form-group", className)}>
28
29
  {label && (
@@ -55,11 +56,3 @@ export function FormControl({
55
56
  </div>
56
57
  );
57
58
  }
58
-
59
- FormControl.propTypes = {
60
- label: PropTypes.string,
61
- name: PropTypes.string.isRequired,
62
- children: PropTypes.any,
63
- required: PropTypes.bool,
64
- description: PropTypes.any
65
- };
@@ -1,5 +1,3 @@
1
- import React from "react";
2
-
3
1
  import { iconClass } from "../../utils/iconClass";
4
2
  import { FormControl } from "./formControl.component";
5
3
 
@@ -1,5 +1,5 @@
1
1
  import PropTypes from "prop-types";
2
- import React, { ReactElement } from "react";
2
+ import { ReactElement } from "react";
3
3
 
4
4
  import { useTooltip } from "../../hooks/useTooltip";
5
5
  import { FormOptions } from "../../interfaces";
@@ -1,5 +1,4 @@
1
1
  import PropTypes from "prop-types";
2
- import React from "react";
3
2
 
4
3
  import { FormOptions } from "../../interfaces/FormOptions";
5
4
  import { FormBuilder } from "../form-builder/formBuilder.component";
@@ -71,7 +71,6 @@ export const reducer = (state: FormEditState, { type, value }: any): FormEditSta
71
71
  return update(cloneDeep(state.original));
72
72
 
73
73
  case "formChange":
74
- // eslint-disable-next-line no-case-declarations
75
74
  const newValue = { ...state.current, ...value };
76
75
 
77
76
  if (hasChanged(state.current, newValue)) {
@@ -1,5 +1,3 @@
1
- import React from "react";
2
-
3
1
  import { FormEdit } from "./formEdit.component";
4
2
  import { defaultDisplayChoices } from "./formParameters.component";
5
3
 
@@ -1,5 +1,5 @@
1
1
  import PropTypes from "prop-types";
2
- import React, { ReactElement } from "react";
2
+ import { ReactElement } from "react";
3
3
 
4
4
  import { FormSchema } from "../../interfaces/FormSchema";
5
5
  import { InputTags } from "../input-tags/inputTags.component";
@@ -1,12 +1,11 @@
1
1
  import { fireEvent, render, screen } from "@testing-library/react";
2
- import React from "react";
3
2
 
4
3
  import { FormSettings } from "./formSettings.component";
5
4
  import { Sandbox } from "./formSettings.stories";
6
5
 
7
6
  describe("FormSettings", () => {
8
- it("should render form settings", async () => {
9
- const onSubmit = jest.fn();
7
+ it("should render form settings", () => {
8
+ const onSubmit = vi.fn();
10
9
 
11
10
  // @ts-ignore
12
11
  Sandbox.args.form.action = "https://test";
@@ -23,7 +22,7 @@ describe("FormSettings", () => {
23
22
 
24
23
  const btn = screen.getByTestId("submit");
25
24
 
26
- await fireEvent.click(btn);
25
+ fireEvent.click(btn);
27
26
 
28
27
  expect(btn).toHaveTextContent("Save settings");
29
28
  expect(onSubmit).toHaveBeenCalledWith({
@@ -47,7 +46,7 @@ describe("FormSettings", () => {
47
46
  type: "form"
48
47
  });
49
48
  });
50
- it("should render form settings with i18n options", async () => {
49
+ it("should render form settings with i18n options", () => {
51
50
  render(
52
51
  <FormSettings
53
52
  {...Sandbox.args}
@@ -59,7 +58,7 @@ describe("FormSettings", () => {
59
58
 
60
59
  const btn = screen.getByTestId("submit");
61
60
 
62
- await fireEvent.click(btn);
61
+ fireEvent.click(btn);
63
62
 
64
63
  expect(btn).toHaveTextContent("Save settings i18N");
65
64
  });
@@ -1,6 +1,6 @@
1
1
  import isEqual from "lodash/isEqual";
2
2
  import noop from "lodash/noop";
3
- import React, { useEffect, useState } from "react";
3
+ import { useEffect, useState } from "react";
4
4
 
5
5
  import { FormOptions, FormSchema } from "../../interfaces";
6
6
  import { Form } from "../form/form.component";
@@ -1,5 +1,3 @@
1
- import React from "react";
2
-
3
1
  import { FormSettings } from "./formSettings.component";
4
2
 
5
3
  export default {
@@ -1,6 +1,5 @@
1
1
  import classnames from "classnames";
2
2
  import moment from "moment";
3
- import React from "react";
4
3
  import { CellProps } from "react-table";
5
4
 
6
5
  import { FormSchema } from "../../../interfaces";
@@ -1,5 +1,3 @@
1
- import React from "react";
2
-
3
1
  import { FormSchema } from "../../interfaces";
4
2
  import { DefaultColumnFilter } from "../table/filters/defaultColumnFilter.component";
5
3
  import { SelectColumnFilter } from "../table/filters/selectColumnFilter.component";
@@ -1,5 +1,4 @@
1
1
  import tailwind from "@tsed/tailwind-formio";
2
- import React from "react";
3
2
 
4
3
  import { FormsTable } from "./formsTable.component";
5
4
 
@@ -19,7 +19,6 @@ export * from "./loader/loader.component";
19
19
  export * from "./modal/modal.component";
20
20
  export * from "./modal/removeModal.component";
21
21
  export * from "./pagination/pagination.component";
22
- export * from "./react-component/reactComponent.component";
23
22
  export * from "./select/select.component";
24
23
  export * from "./submissions-table/submissionsTable.component";
25
24
  export * from "./table";
@@ -1,7 +1,7 @@
1
1
  import Choices from "@formio/choices.js";
2
2
  import uniq from "lodash/uniq";
3
3
  import PropTypes from "prop-types";
4
- import React, { useEffect, useRef } from "react";
4
+ import { useEffect, useRef } from "react";
5
5
 
6
6
  import { FormControl, FormControlProps } from "../form-control/formControl.component";
7
7
 
@@ -1,4 +1,4 @@
1
- import React, { useState } from "react";
1
+ import { useState } from "react";
2
2
 
3
3
  import { iconClass } from "../../utils/iconClass";
4
4
  import { InputTags } from "./inputTags.component";
@@ -1,5 +1,4 @@
1
1
  import { fireEvent, render, screen } from "@testing-library/react";
2
- import React from "react";
3
2
 
4
3
  import { Sandbox } from "./inputText.stories";
5
4
 
@@ -1,6 +1,6 @@
1
1
  import classnames from "classnames";
2
2
  import PropTypes from "prop-types";
3
- import React, { useEffect, useMemo, useState } from "react";
3
+ import { useEffect, useMemo, useState } from "react";
4
4
 
5
5
  import { callLast } from "../../utils/callLast";
6
6
  import { getEventValue } from "../../utils/getEventValue";
@@ -1,4 +1,4 @@
1
- import React, { useState } from "react";
1
+ import { useState } from "react";
2
2
 
3
3
  import { iconClass } from "../../utils/iconClass";
4
4
  import { InputText } from "./inputText.component";
@@ -1,7 +1,7 @@
1
1
  import { render, screen } from "@testing-library/react";
2
- import React from "react";
3
2
 
4
3
  import { Sandbox } from "./loader.stories";
4
+
5
5
  describe("Loader", () => {
6
6
  it("should render a component (when isActive = true)", () => {
7
7
  render(<Sandbox isActive={true} />);
@@ -1,6 +1,6 @@
1
1
  import classnames from "classnames";
2
2
  import PropTypes from "prop-types";
3
- import React, { PropsWithChildren } from "react";
3
+ import { PropsWithChildren } from "react";
4
4
 
5
5
  import { iconClass } from "../../utils/iconClass";
6
6
 
@@ -1,5 +1,3 @@
1
- import React from "react";
2
-
3
1
  import { Loader } from "./loader.component";
4
2
 
5
3
  export default {
@@ -1,14 +1,11 @@
1
- import "@testing-library/jest-dom/extend-expect";
2
-
3
1
  import { fireEvent, render, screen } from "@testing-library/react";
4
- import React from "react";
5
2
 
6
3
  import { WithFooter, WithTitle } from "./modal.stories";
7
4
 
8
5
  describe("Modal", () => {
9
6
  describe("WithTitle", () => {
10
7
  it("should display the modal when we click on the button", async () => {
11
- const onClose = jest.fn();
8
+ const onClose = vi.fn();
12
9
 
13
10
  render(<WithTitle {...WithTitle.args} onClose={onClose} />);
14
11
 
@@ -60,7 +57,7 @@ describe("Modal", () => {
60
57
  expect(screen.queryByTestId("modalFooter")).toBeFalsy();
61
58
  });
62
59
  it("should call the onSubmit listener", async () => {
63
- const onSubmit = jest.fn();
60
+ const onSubmit = vi.fn();
64
61
 
65
62
  render(<WithFooter {...WithFooter.args} onSubmit={onSubmit} />);
66
63
 
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable jsx-a11y/no-static-element-interactions */
2
2
  /* eslint-disable jsx-a11y/click-events-have-key-events */
3
3
  import noop from "lodash";
4
- import React, { PropsWithChildren, useEffect, useRef, useState } from "react";
4
+ import { PropsWithChildren, useEffect, useRef, useState } from "react";
5
5
 
6
6
  export function useModal() {
7
7
  const [show, setShowModal] = useState(false);
@@ -1,5 +1,3 @@
1
- import React from "react";
2
-
3
1
  import { Modal, ModalProps, useModal } from "./modal.component";
4
2
  import { RemoveModal, RemoveModalProps } from "./removeModal.component";
5
3
 
@@ -1,5 +1,5 @@
1
1
  import classnames from "classnames";
2
- import React, { PropsWithChildren, useState } from "react";
2
+ import { PropsWithChildren, useState } from "react";
3
3
 
4
4
  import { iconClass } from "../../utils/iconClass";
5
5
  import { InputText } from "../input-text/inputText.component";
@@ -1,5 +1,4 @@
1
1
  import { fireEvent, render, screen } from "@testing-library/react";
2
- import React from "react";
3
2
 
4
3
  import { Sandbox } from "./pagination.stories";
5
4
 
@@ -18,7 +17,7 @@ describe("Pagination", () => {
18
17
  });
19
18
 
20
19
  it("should call previousPage() callback", () => {
21
- const previousPageSpy = jest.fn();
20
+ const previousPageSpy = vi.fn();
22
21
  render(<Sandbox previousPage={previousPageSpy} canPreviousPage={true} />);
23
22
  const paginationBtn = screen.queryAllByTestId("pagination-button");
24
23
  const btnPreviousPage = paginationBtn.find((btn) => btn.textContent === "Previous");
@@ -29,7 +28,7 @@ describe("Pagination", () => {
29
28
  });
30
29
 
31
30
  it("should call nextPage() callback", () => {
32
- const nextPageSpy = jest.fn();
31
+ const nextPageSpy = vi.fn();
33
32
  render(<Sandbox nextPage={nextPageSpy} canNextPage={true} />);
34
33
 
35
34
  fireEvent.click(screen.getByText(/Next/i));
@@ -38,7 +37,7 @@ describe("Pagination", () => {
38
37
  });
39
38
 
40
39
  it("should call gotoPage() callback when cliking on a button page", () => {
41
- const gotoPageSpy = jest.fn();
40
+ const gotoPageSpy = vi.fn();
42
41
  let page: number;
43
42
 
44
43
  render(<Sandbox {...Sandbox.args} gotoPage={gotoPageSpy} />);
@@ -50,16 +49,14 @@ describe("Pagination", () => {
50
49
  if (btn.textContent !== "...") {
51
50
  page = +btn.textContent!;
52
51
  fireEvent.click(btn);
53
- // eslint-disable-next-line jest/no-conditional-expect
54
52
  expect(gotoPageSpy).toHaveBeenCalled();
55
- // eslint-disable-next-line jest/no-conditional-expect
56
53
  expect(gotoPageSpy).toHaveBeenCalledWith(page - 1);
57
54
  }
58
55
  });
59
56
  });
60
57
 
61
58
  it("should have Previous button disabled and not clickable", () => {
62
- const previousPageSpy = jest.fn();
59
+ const previousPageSpy = vi.fn();
63
60
  render(<Sandbox canPreviousPage={false} previousPage={previousPageSpy} {...Sandbox.args} />);
64
61
 
65
62
  const previousButton = screen.getByText("Previous");
@@ -70,7 +67,7 @@ describe("Pagination", () => {
70
67
  });
71
68
 
72
69
  it("should have Previous button NOT disabled and clickable", () => {
73
- const previousPageSpy = jest.fn();
70
+ const previousPageSpy = vi.fn();
74
71
  render(<Sandbox {...Sandbox.args} canPreviousPage={true} previousPage={previousPageSpy} />);
75
72
 
76
73
  const previousButton = screen.getByText("Previous");
@@ -81,7 +78,7 @@ describe("Pagination", () => {
81
78
  });
82
79
 
83
80
  it("should have Next button disabled and not clickable", () => {
84
- const nextPageSpy = jest.fn();
81
+ const nextPageSpy = vi.fn();
85
82
  render(<Sandbox canNextPage={false} nextPage={nextPageSpy} {...Sandbox.args} />);
86
83
 
87
84
  const nextButton = screen.getByText("Next");
@@ -91,7 +88,7 @@ describe("Pagination", () => {
91
88
  });
92
89
 
93
90
  it("should have Next button NOT disabled and clickable", () => {
94
- const nextPageSpy = jest.fn();
91
+ const nextPageSpy = vi.fn();
95
92
  render(<Sandbox canNextPage={true} nextPage={nextPageSpy} {...Sandbox.args} />);
96
93
  const nextButton = screen.getByText("Next");
97
94
  expect(nextButton).not.toHaveAttribute("disabled");
@@ -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 { Select } from "../select/select.component";
5
5
  import { getPageNumbers, LEFT_PAGE, RIGHT_PAGE } from "../table/utils/getPageNumbers";
@@ -1,4 +1,4 @@
1
- import React, { useEffect, useState } from "react";
1
+ import { useEffect, useState } from "react";
2
2
 
3
3
  import { Pagination } from "./pagination.component";
4
4
 
@@ -1,5 +1,4 @@
1
1
  import { fireEvent, render, screen } from "@testing-library/react";
2
- import React from "react";
3
2
 
4
3
  import { Choicesjs, Sandbox } from "./select.stories";
5
4
 
@@ -52,7 +51,7 @@ describe("Select", () => {
52
51
  { label: "test2", value: "value2" }
53
52
  ];
54
53
  const placeHolderTest = "Placeholder test";
55
- const onChange = jest.fn();
54
+ const onChange = vi.fn();
56
55
 
57
56
  render(<Sandbox {...Sandbox.args} placeholder={placeHolderTest} choices={choices} name={"test-sandbox"} onChange={onChange} />);
58
57
 
@@ -1,24 +1,20 @@
1
1
  import Choices from "@formio/choices.js";
2
2
  import classnames from "classnames";
3
- import PropTypes from "prop-types";
4
- import React, { ReactElement, useEffect, useRef } from "react";
3
+ import { HTMLAttributes, ReactElement, useEffect, useRef } from "react";
5
4
 
6
5
  import { getEventValue } from "../../utils/getEventValue";
7
6
  import { FormControl, FormControlProps } from "../form-control/formControl.component";
8
7
 
9
- export interface SelectProps<T = any> extends FormControlProps {
10
- value?: any;
8
+ export interface SelectProps<Data = any> extends FormControlProps, Omit<HTMLAttributes<HTMLSelectElement>, "onChange" | "prefix"> {
11
9
  size?: string;
12
- onChange?: (name: string, value: any) => void;
13
10
  placeholder?: string;
14
- choices: { label: string; value: T }[];
11
+ choices: { label: string; value: Data }[];
15
12
  layout?: "html5" | "choicesjs";
13
+ disabled?: boolean;
16
14
  multiple?: boolean;
17
-
18
- [key: string]: any;
19
15
  }
20
16
 
21
- export function Select<T = any>({
17
+ export function Select<Data = any>({
22
18
  name,
23
19
  label,
24
20
  size,
@@ -33,14 +29,14 @@ export function Select<T = any>({
33
29
  multiple,
34
30
  layout,
35
31
  ...props
36
- }: SelectProps<T>): ReactElement {
37
- const ref = useRef<any>();
32
+ }: SelectProps<Data>): ReactElement {
33
+ const ref = useRef<HTMLSelectElement>(null);
38
34
 
39
35
  useEffect(() => {
40
36
  let instance: any;
41
37
 
42
38
  if (layout === "choicesjs") {
43
- instance = new Choices(ref.current, {
39
+ instance = new Choices(ref.current as unknown as HTMLInputElement, {
44
40
  removeItemButton: true,
45
41
  placeholderValue: placeholder
46
42
  });
@@ -64,11 +60,11 @@ export function Select<T = any>({
64
60
 
65
61
  return (
66
62
  <FormControl name={name} label={label} required={required} description={description} prefix={prefix} suffix={suffix} shadow={false}>
67
- {/* eslint-disable-next-line jsx-a11y/no-onchange */}
63
+ {}
68
64
  <select
69
65
  ref={ref}
70
- {...props}
71
66
  data-testid={`select_${name}`}
67
+ {...props}
72
68
  className={classnames("form-control", size && `form-control-${size}`)}
73
69
  name={name}
74
70
  id={name}
@@ -90,12 +86,3 @@ export function Select<T = any>({
90
86
  </FormControl>
91
87
  );
92
88
  }
93
-
94
- Select.propTypes = {
95
- label: PropTypes.string,
96
- name: PropTypes.string.isRequired,
97
- value: PropTypes.any,
98
- required: PropTypes.bool,
99
- onChange: PropTypes.func,
100
- choices: PropTypes.array.isRequired
101
- };
@@ -1,4 +1,4 @@
1
- import React, { useState } from "react";
1
+ import { useState } from "react";
2
2
 
3
3
  import { iconClass } from "../../utils/iconClass";
4
4
  import { Select } from "./select.component";
@@ -1,5 +1,3 @@
1
- import React from "react";
2
-
3
1
  import { FormSchema, Submission } from "../../interfaces";
4
2
  import { TableProps } from "../table/hooks/useCustomTable.hook";
5
3
  import { Table } from "../table/table.component";
@@ -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";
@@ -49,9 +49,9 @@ export default {
49
49
  };
50
50
 
51
51
  export const Sandbox = (args: any) => {
52
- const [skip, setSkip] = React.useState(0);
53
- const [limit, setLimit] = React.useState(10);
54
- const [serverCount] = React.useState(87);
52
+ const [skip, setSkip] = useState(0);
53
+ const [limit, setLimit] = useState(10);
54
+ const [serverCount] = useState(87);
55
55
 
56
56
  const onChange = (obj: any) => {
57
57
  setLimit(obj.pageSize);
@@ -1,5 +1,3 @@
1
- import React from "react";
2
-
3
1
  import { iconClass } from "../../../utils/iconClass";
4
2
 
5
3
  export function DefaultArrowSort({ column }: any) {
@@ -1,5 +1,3 @@
1
- import React from "react";
2
-
3
1
  export function DefaultCell({ value, render = (f: any) => f }: any): JSX.Element {
4
2
  if (value === undefined) {
5
3
  return <span></span>;
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { HeaderGroup } from "react-table";
3
2
 
4
3
  export interface DefaultCellHeaderProps<Data extends object = any> extends Record<string, unknown> {
@@ -1,19 +1,30 @@
1
- import React from "react";
1
+ import { DefaultOperationButton, OperationButtonProps } from "./defaultOperationButton.component";
2
2
 
3
- import { DefaultOperationButton } from "./defaultOperationButton.component";
3
+ export interface DefaultCellOperationsProps {
4
+ operations: (OperationButtonProps & {
5
+ OperationButton: typeof DefaultOperationButton;
6
+ permissionsResolver?(data: unknown, ctx: any): boolean;
7
+ })[];
8
+ row: any;
4
9
 
5
- export function DefaultCellOperations({ operations, row, onClick, ctx, i18n }: any) {
10
+ onClick: (data: any, action: string) => void;
11
+ ctx: any;
12
+ i18n: (i18n: string) => string;
13
+ }
14
+
15
+ export function DefaultCellOperations({ operations, row, onClick, ctx, i18n }: DefaultCellOperationsProps) {
6
16
  const data = row.original;
7
17
 
8
18
  return (
9
19
  <div className='btn-group'>
10
20
  {operations
11
- .filter(({ permissionsResolver }: any) => !permissionsResolver || permissionsResolver(data, ctx))
12
- .map(({ OperationButton = DefaultOperationButton, ...operation }: any) => {
21
+ .filter(({ permissionsResolver }) => !permissionsResolver || permissionsResolver(data, ctx))
22
+ .map(({ OperationButton = DefaultOperationButton, ...operation }, index: number) => {
13
23
  return (
14
24
  <OperationButton
15
25
  key={operation.action}
16
26
  {...operation}
27
+ data-testid={`operation-${index}-${operation.action}`}
17
28
  onClick={(action: string) => onClick(data, action)}
18
29
  data={data}
19
30
  i18n={i18n}
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { Row } from "react-table";
3
2
 
4
3
  import type { ExtendedCell } from "../hooks/useCustomTable.hook";
@@ -1,11 +1,10 @@
1
1
  import classnames from "classnames";
2
- import React from "react";
2
+ import { HTMLAttributes } from "react";
3
3
 
4
4
  import { iconClass } from "../../../utils/iconClass";
5
5
  import { stopPropagationWrapper } from "../../../utils/stopPropagationWrapper";
6
6
 
7
- export interface OperationButtonProps {
8
- className?: string;
7
+ export interface OperationButtonProps extends Omit<HTMLAttributes<HTMLButtonElement>, "onClick"> {
9
8
  buttonType?: string;
10
9
  buttonSize?: string;
11
10
  buttonOutline?: boolean;
@@ -15,6 +14,8 @@ export interface OperationButtonProps {
15
14
  icon?: string;
16
15
  title?: string;
17
16
  i18n?: (i18n: string) => string;
17
+ ctx?: any;
18
+ permissionsResolver?: (ctx: any) => boolean;
18
19
  }
19
20
 
20
21
  export function DefaultOperationButton(props: OperationButtonProps) {
@@ -27,11 +28,20 @@ export function DefaultOperationButton(props: OperationButtonProps) {
27
28
  action,
28
29
  icon = "",
29
30
  title = "",
30
- i18n = (f: string) => f
31
+ i18n = (f: string) => f,
32
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
33
+ data,
34
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
35
+ ctx,
36
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
37
+ permissionsResolver,
38
+ ...otherProps
31
39
  } = props;
32
40
 
33
41
  return (
34
42
  <button
43
+ {...otherProps}
44
+ aria-label={"Operation button: " + (title || action)}
35
45
  className={classnames(className, ["btn", buttonOutline && "outline", buttonType].filter(Boolean).join("-"), `btn-${buttonSize}`)}
36
46
  onClick={stopPropagationWrapper(() => onClick(action))}
37
47
  >