@tsed/react-formio 2.3.2 → 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 (334) 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 -9
  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 -14
  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 -14
  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 -13
  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 -7651
  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 +23 -13
  208. package/src/components/actions-table/actionsTable.component.spec.tsx +5 -6
  209. package/src/components/actions-table/actionsTable.component.tsx +1 -1
  210. package/src/components/alert/alert.component.spec.tsx +0 -1
  211. package/src/components/alert/alert.component.tsx +0 -2
  212. package/src/components/alert/alert.stories.tsx +0 -2
  213. package/src/components/card/card.component.spec.tsx +0 -1
  214. package/src/components/card/card.component.tsx +1 -2
  215. package/src/components/card/card.stories.tsx +0 -2
  216. package/src/components/form/form.component.spec.tsx +1 -1
  217. package/src/components/form/form.component.tsx +0 -1
  218. package/src/components/form/form.stories.tsx +2 -3
  219. package/src/components/form-access/formAccess.component.tsx +1 -2
  220. package/src/components/form-action/formAction.component.tsx +2 -1
  221. package/src/components/form-action/formAction.stories.tsx +0 -2
  222. package/src/components/form-builder/formBuilder.component.tsx +4 -4
  223. package/src/components/form-builder/formBuilder.stories.tsx +0 -2
  224. package/src/components/form-control/formControl.component.spec.tsx +0 -1
  225. package/src/components/form-control/formControl.component.tsx +5 -5
  226. package/src/components/form-control/formControl.stories.tsx +0 -2
  227. package/src/components/form-edit/formCtas.component.tsx +1 -1
  228. package/src/components/form-edit/formEdit.component.tsx +0 -1
  229. package/src/components/form-edit/formEdit.reducer.ts +0 -1
  230. package/src/components/form-edit/formEdit.stories.tsx +0 -2
  231. package/src/components/form-edit/formParameters.component.tsx +1 -1
  232. package/src/components/form-settings/formSettings.component.spec.tsx +5 -6
  233. package/src/components/form-settings/formSettings.component.tsx +1 -1
  234. package/src/components/form-settings/formSettings.stories.tsx +0 -2
  235. package/src/components/forms-table/components/formCell.component.tsx +0 -1
  236. package/src/components/forms-table/formsTable.component.tsx +0 -2
  237. package/src/components/forms-table/formsTable.stories.tsx +0 -1
  238. package/src/components/index.ts +0 -1
  239. package/src/components/input-tags/inputTags.component.tsx +1 -1
  240. package/src/components/input-tags/inputTags.stories.tsx +1 -1
  241. package/src/components/input-text/inputText.component.spec.tsx +0 -1
  242. package/src/components/input-text/inputText.component.tsx +1 -1
  243. package/src/components/input-text/inputText.stories.tsx +1 -1
  244. package/src/components/loader/loader.component.spec.tsx +1 -1
  245. package/src/components/loader/loader.component.tsx +1 -1
  246. package/src/components/loader/loader.stories.tsx +0 -2
  247. package/src/components/modal/modal.component.spec.tsx +2 -5
  248. package/src/components/modal/modal.component.tsx +1 -1
  249. package/src/components/modal/modal.stories.tsx +0 -2
  250. package/src/components/modal/removeModal.component.tsx +1 -1
  251. package/src/components/pagination/pagination.component.spec.tsx +7 -10
  252. package/src/components/pagination/pagination.component.tsx +1 -1
  253. package/src/components/pagination/pagination.stories.tsx +1 -1
  254. package/src/components/select/select.component.spec.tsx +1 -2
  255. package/src/components/select/select.component.tsx +2 -2
  256. package/src/components/select/select.stories.tsx +1 -1
  257. package/src/components/submissions-table/submissionsTable.component.tsx +0 -2
  258. package/src/components/submissions-table/submissionsTable.stories.tsx +4 -4
  259. package/src/components/table/components/defaultArrowSort.component.tsx +0 -2
  260. package/src/components/table/components/defaultCell.component.tsx +0 -2
  261. package/src/components/table/components/defaultCellHeader.component.tsx +0 -1
  262. package/src/components/table/components/defaultCellOperations.component.tsx +0 -2
  263. package/src/components/table/components/defaultCells.component.tsx +0 -1
  264. package/src/components/table/components/defaultOperationButton.component.tsx +5 -0
  265. package/src/components/table/components/defaultRow.component.tsx +2 -1
  266. package/src/components/table/components/dragNDropContainer.tsx +1 -1
  267. package/src/components/table/filters/defaultColumnFilter.component.spec.tsx +2 -5
  268. package/src/components/table/filters/defaultColumnFilter.component.tsx +2 -1
  269. package/src/components/table/filters/selectColumnFilter.component.spec.tsx +3 -6
  270. package/src/components/table/filters/selectColumnFilter.component.tsx +0 -1
  271. package/src/components/table/filters/sliderColumnFilter.component.tsx +7 -10
  272. package/src/components/table/hooks/useCustomTable.hook.tsx +16 -20
  273. package/src/components/table/hooks/useOperations.hook.tsx +1 -1
  274. package/src/components/table/table.component.tsx +1 -1
  275. package/src/components/table/table.stories.tsx +8 -8
  276. package/src/components/table/utils/mapFormToColumns.tsx +0 -1
  277. package/src/components/tabs/tabs.component.spec.tsx +2 -2
  278. package/src/components/tabs/tabs.component.stories.tsx +1 -1
  279. package/src/components/tabs/tabs.component.tsx +1 -1
  280. package/src/react-table.d.ts +2 -0
  281. package/src/utils/iconClass.ts +3 -1
  282. package/tsconfig.app.json +11 -0
  283. package/tsconfig.json +8 -6
  284. package/tsconfig.spec.json +14 -0
  285. package/vite.config.mts +69 -0
  286. package/vitest.config.mts +21 -0
  287. package/.eslintignore +0 -13
  288. package/.eslintrc.js +0 -7
  289. package/coverage.json +0 -6
  290. package/dist/components/actions-table/actionsTable.component.spec.d.ts +0 -1
  291. package/dist/components/actions-table/actionsTable.stories.d.ts +0 -40
  292. package/dist/components/alert/alert.component.spec.d.ts +0 -1
  293. package/dist/components/alert/alert.stories.d.ts +0 -15
  294. package/dist/components/card/card.component.spec.d.ts +0 -1
  295. package/dist/components/card/card.stories.d.ts +0 -16
  296. package/dist/components/form/form.component.spec.d.ts +0 -1
  297. package/dist/components/form/form.stories.d.ts +0 -6445
  298. package/dist/components/form-access/formAccess.stories.d.ts +0 -21
  299. package/dist/components/form-access/formAccess.utils.spec.d.ts +0 -1
  300. package/dist/components/form-action/formAction.stories.d.ts +0 -409
  301. package/dist/components/form-builder/formBuilder.stories.d.ts +0 -5989
  302. package/dist/components/form-control/formControl.component.spec.d.ts +0 -1
  303. package/dist/components/form-control/formControl.stories.d.ts +0 -58
  304. package/dist/components/form-edit/formEdit.stories.d.ts +0 -396
  305. package/dist/components/form-settings/formSettings.component.spec.d.ts +0 -1
  306. package/dist/components/form-settings/formSettings.stories.d.ts +0 -58
  307. package/dist/components/form-settings/formSettings.utils.spec.d.ts +0 -1
  308. package/dist/components/forms-table/formsTable.stories.d.ts +0 -117
  309. package/dist/components/input-tags/inputTags.stories.d.ts +0 -76
  310. package/dist/components/input-text/inputText.component.spec.d.ts +0 -1
  311. package/dist/components/input-text/inputText.stories.d.ts +0 -101
  312. package/dist/components/loader/loader.component.spec.d.ts +0 -1
  313. package/dist/components/loader/loader.stories.d.ts +0 -15
  314. package/dist/components/modal/modal.component.spec.d.ts +0 -1
  315. package/dist/components/modal/modal.stories.d.ts +0 -44
  316. package/dist/components/pagination/pagination.component.spec.d.ts +0 -1
  317. package/dist/components/pagination/pagination.stories.d.ts +0 -16
  318. package/dist/components/react-component/reactComponent.component.d.ts +0 -90
  319. package/dist/components/select/select.component.spec.d.ts +0 -1
  320. package/dist/components/select/select.stories.d.ts +0 -164
  321. package/dist/components/submissions-table/submissionsTable.stories.d.ts +0 -649
  322. package/dist/components/table/filters/defaultColumnFilter.component.spec.d.ts +0 -1
  323. package/dist/components/table/filters/selectColumnFilter.component.spec.d.ts +0 -1
  324. package/dist/components/table/table.stories.d.ts +0 -71
  325. package/dist/components/table/utils/swapElements.spec.d.ts +0 -1
  326. package/dist/components/tabs/tabs.component.spec.d.ts +0 -1
  327. package/dist/components/tabs/tabs.component.stories.d.ts +0 -47
  328. package/dist/index.modern.js +0 -7435
  329. package/dist/index.modern.js.map +0 -1
  330. package/dist/setupTests.d.ts +0 -1
  331. package/jest.config.js +0 -6
  332. package/src/components/react-component/reactComponent.component.tsx +0 -197
  333. package/src/setupTests.tsx +0 -5
  334. package/tsconfig.node.json +0 -8
@@ -1,5 +1,3 @@
1
- import React from "react";
2
-
3
1
  import { Card } from "./card.component";
4
2
 
5
3
  export default {
@@ -4,7 +4,7 @@ import { render } from "@testing-library/react";
4
4
  import { Form } from "./form.component";
5
5
 
6
6
  async function createFixture(props: any = {}) {
7
- const onSubmit = jest.fn();
7
+ const onSubmit = vi.fn();
8
8
  const form = {
9
9
  type: "form",
10
10
  display: "form",
@@ -1,7 +1,6 @@
1
1
  import { Components } from "formiojs";
2
2
  import AllComponents from "formiojs/components";
3
3
  import PropTypes from "prop-types";
4
- import React from "react";
5
4
 
6
5
  import { useForm, UseFormHookProps } from "./useForm.hook";
7
6
 
@@ -1,6 +1,5 @@
1
- import React, { useState } from "react";
1
+ import { useState } from "react";
2
2
 
3
- import { Submission } from "../../interfaces";
4
3
  import form from "../__fixtures__/form.fixture.json";
5
4
  import { Form } from "./form.component";
6
5
 
@@ -123,7 +122,7 @@ export const Sandbox = {
123
122
 
124
123
  export const TriggerError = {
125
124
  render: (args: any) => {
126
- const onAsyncSubmit = (submission: Submission) => {
125
+ const onAsyncSubmit = () => {
127
126
  return new Promise((resolve, reject) => {
128
127
  setTimeout(() => {
129
128
  reject(new Error("server error"));
@@ -1,4 +1,4 @@
1
- import React, { PropsWithChildren, useCallback, useEffect, useMemo, useState } from "react";
1
+ import { PropsWithChildren, useCallback, useEffect, useMemo, useState } from "react";
2
2
 
3
3
  import type { FormOptions, FormSchema, Submission } from "../../interfaces";
4
4
  import { Card } from "../card/card.component";
@@ -23,7 +23,6 @@ export interface FormAccessProps {
23
23
  }
24
24
 
25
25
  function useFormAccess({ form: formDefinition, roles, onSubmit, options }: FormAccessProps) {
26
- // eslint-disable-next-line no-undef
27
26
  const form = useMemo(() => getFormAccess(roles), [roles]);
28
27
 
29
28
  const [submissions, setSubmissions] = useState(() => dataAccessToSubmissions(formDefinition, form));
@@ -1,5 +1,5 @@
1
1
  import FormioUtils from "formiojs/utils";
2
- import React, { PropsWithChildren, ReactElement } from "react";
2
+ import { PropsWithChildren, ReactElement } from "react";
3
3
 
4
4
  import { ActionDefaultsSchema, ActionSchema, FormOptions, Submission } from "../../interfaces";
5
5
  import { Form } from "../form/form.component";
@@ -11,6 +11,7 @@ function mapData(options: any, defaults: ActionDefaultsSchema): any {
11
11
  };
12
12
  }
13
13
 
14
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
14
15
  function mapSettingsForm({ action, ...settingsForm }: any): any {
15
16
  FormioUtils.eachComponent(settingsForm.components, (component: any) => {
16
17
  const resourceExclude = "";
@@ -1,5 +1,3 @@
1
- import React from "react";
2
-
3
1
  import { FormAction } from "./formAction.component";
4
2
 
5
3
  export default {
@@ -1,5 +1,3 @@
1
- /* eslint-disable jsx-a11y/no-static-element-interactions */
2
- /* eslint-disable jsx-a11y/click-events-have-key-events */
3
1
  import { ComponentSchema } from "formiojs";
4
2
  import AllComponents from "formiojs/components";
5
3
  import Components from "formiojs/components/Components";
@@ -7,7 +5,7 @@ import FormioFormBuilder from "formiojs/FormBuilder";
7
5
  import cloneDeep from "lodash/cloneDeep";
8
6
  import noop from "lodash/noop";
9
7
  import PropTypes from "prop-types";
10
- import React from "react";
8
+ import { Component } from "react";
11
9
 
12
10
  import { callLast } from "../../utils/callLast";
13
11
 
@@ -73,7 +71,7 @@ export interface FormBuilderProps {
73
71
  onPasteComponent?: Function;
74
72
  }
75
73
 
76
- export class FormBuilder extends React.Component<FormBuilderProps, any> {
74
+ export class FormBuilder extends Component<FormBuilderProps, any> {
77
75
  static defaultProps = {
78
76
  options: {},
79
77
  onChange: noop,
@@ -180,6 +178,8 @@ export class FormBuilder extends React.Component<FormBuilderProps, any> {
180
178
  });
181
179
  }
182
180
 
181
+ /* eslint-disable jsx-a11y/no-static-element-interactions */
182
+ /* eslint-disable jsx-a11y/click-events-have-key-events */
183
183
  render() {
184
184
  return (
185
185
  <div
@@ -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,5 +1,5 @@
1
1
  import classnames from "classnames";
2
- import React, { HTMLAttributes } from "react";
2
+ import type { PropsWithChildren, ReactNode } from "react";
3
3
 
4
4
  export interface FormControlProps<Data = any> {
5
5
  name: string;
@@ -8,9 +8,9 @@ export interface FormControlProps<Data = any> {
8
8
  label?: string;
9
9
  className?: string;
10
10
  onChange?: (name: string, value: any) => void;
11
- description?: string | React.ComponentType | any;
12
- prefix?: JSX.Element | React.ComponentType | any;
13
- suffix?: JSX.Element | React.ComponentType | any;
11
+ description?: string | ReactNode;
12
+ prefix?: ReactNode | string;
13
+ suffix?: ReactNode | string;
14
14
  shadow?: boolean;
15
15
  }
16
16
 
@@ -23,7 +23,7 @@ export function FormControl({
23
23
  description,
24
24
  label,
25
25
  className
26
- }: React.PropsWithChildren<FormControlProps>) {
26
+ }: PropsWithChildren<FormControlProps>) {
27
27
  return (
28
28
  <div data-testid={name && `form-group-${name}`} id={`form-group-${name || ""}`} className={classnames("form-group", className)}>
29
29
  {label && (
@@ -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,6 +1,6 @@
1
1
  import Choices from "@formio/choices.js";
2
2
  import classnames from "classnames";
3
- import React, { HTMLAttributes, ReactElement, useEffect, useRef } from "react";
3
+ import { HTMLAttributes, ReactElement, useEffect, useRef } from "react";
4
4
 
5
5
  import { getEventValue } from "../../utils/getEventValue";
6
6
  import { FormControl, FormControlProps } from "../form-control/formControl.component";
@@ -60,7 +60,7 @@ export function Select<Data = any>({
60
60
 
61
61
  return (
62
62
  <FormControl name={name} label={label} required={required} description={description} prefix={prefix} suffix={suffix} shadow={false}>
63
- {/* eslint-disable-next-line jsx-a11y/no-onchange */}
63
+ {}
64
64
  <select
65
65
  ref={ref}
66
66
  data-testid={`select_${name}`}
@@ -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,5 +1,3 @@
1
- import React from "react";
2
-
3
1
  import { DefaultOperationButton, OperationButtonProps } from "./defaultOperationButton.component";
4
2
 
5
3
  export interface DefaultCellOperationsProps {
@@ -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";
@@ -15,6 +15,7 @@ export interface OperationButtonProps extends Omit<HTMLAttributes<HTMLButtonElem
15
15
  title?: string;
16
16
  i18n?: (i18n: string) => string;
17
17
  ctx?: any;
18
+ permissionsResolver?: (ctx: any) => boolean;
18
19
  }
19
20
 
20
21
  export function DefaultOperationButton(props: OperationButtonProps) {
@@ -28,8 +29,12 @@ export function DefaultOperationButton(props: OperationButtonProps) {
28
29
  icon = "",
29
30
  title = "",
30
31
  i18n = (f: string) => f,
32
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
31
33
  data,
34
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
32
35
  ctx,
36
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
37
+ permissionsResolver,
33
38
  ...otherProps
34
39
  } = props;
35
40