@tsed/react-formio 2.3.6 → 3.0.0-alpha.10

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 (554) hide show
  1. package/dist/atoms/icon/Icon.d.ts +6 -0
  2. package/dist/atoms/icon/Icon.js +12 -0
  3. package/dist/atoms/icon/Icon.js.map +1 -0
  4. package/dist/chunks/_commonjsHelpers.js +7 -0
  5. package/dist/chunks/_commonjsHelpers.js.map +1 -0
  6. package/dist/chunks/index.js +43 -0
  7. package/dist/chunks/index.js.map +1 -0
  8. package/dist/chunks/index.module.js +56 -0
  9. package/dist/chunks/index.module.js.map +1 -0
  10. package/dist/chunks/react-select-animated.esm.js +3513 -0
  11. package/dist/chunks/react-select-animated.esm.js.map +1 -0
  12. package/dist/hooks/useTooltip.d.ts +2 -3
  13. package/dist/hooks/useTooltip.js +12 -0
  14. package/dist/hooks/useTooltip.js.map +1 -0
  15. package/dist/index.d.ts +7 -13
  16. package/dist/index.js +14 -7653
  17. package/dist/index.js.map +1 -1
  18. package/dist/interfaces/ActionType.d.ts +23 -0
  19. package/dist/interfaces/ActionType.js +2 -0
  20. package/dist/interfaces/ActionType.js.map +1 -0
  21. package/dist/interfaces/ColumnIdentifier.d.ts +14 -14
  22. package/dist/interfaces/ColumnIdentifier.js +2 -0
  23. package/dist/interfaces/ColumnIdentifier.js.map +1 -0
  24. package/dist/interfaces/ComponentType.d.ts +2 -0
  25. package/dist/interfaces/ComponentType.js +2 -0
  26. package/dist/interfaces/ComponentType.js.map +1 -0
  27. package/dist/interfaces/FormOptions.d.ts +13 -10
  28. package/dist/interfaces/FormOptions.js +2 -0
  29. package/dist/interfaces/FormOptions.js.map +1 -0
  30. package/dist/interfaces/{FormSchema.d.ts → FormType.d.ts} +12 -12
  31. package/dist/interfaces/FormType.js +2 -0
  32. package/dist/interfaces/FormType.js.map +1 -0
  33. package/dist/interfaces/Operation.d.ts +28 -29
  34. package/dist/interfaces/Operation.js +2 -0
  35. package/dist/interfaces/Operation.js.map +1 -0
  36. package/dist/interfaces/QueryOptions.d.ts +23 -23
  37. package/dist/interfaces/QueryOptions.js +2 -0
  38. package/dist/interfaces/QueryOptions.js.map +1 -0
  39. package/dist/interfaces/{RoleSchema.d.ts → RoleType.d.ts} +6 -6
  40. package/dist/interfaces/RoleType.js +2 -0
  41. package/dist/interfaces/RoleType.js.map +1 -0
  42. package/dist/interfaces/SubmissionType.d.ts +29 -0
  43. package/dist/interfaces/SubmissionType.js +2 -0
  44. package/dist/interfaces/SubmissionType.js.map +1 -0
  45. package/dist/interfaces/index.d.ts +9 -8
  46. package/dist/interfaces/index.js +2 -0
  47. package/dist/interfaces/index.js.map +1 -0
  48. package/dist/molecules/alert/Alert.d.ts +6 -0
  49. package/dist/molecules/alert/Alert.js +27 -0
  50. package/dist/molecules/alert/Alert.js.map +1 -0
  51. package/dist/molecules/button/Button.d.ts +8 -0
  52. package/dist/molecules/button/Button.js +52 -0
  53. package/dist/molecules/button/Button.js.map +1 -0
  54. package/dist/{components/card/card.component.d.ts → molecules/card/Card.d.ts} +6 -7
  55. package/dist/molecules/card/Card.js +12 -0
  56. package/dist/molecules/card/Card.js.map +1 -0
  57. package/dist/molecules/forms/form-control/FormControl.d.ts +17 -0
  58. package/dist/molecules/forms/form-control/FormControl.js +51 -0
  59. package/dist/molecules/forms/form-control/FormControl.js.map +1 -0
  60. package/dist/molecules/forms/input-tags/InputTags.d.ts +2 -0
  61. package/dist/molecules/forms/input-tags/InputTags.interface.d.ts +7 -0
  62. package/dist/molecules/forms/input-tags/InputTags.interface.js +2 -0
  63. package/dist/molecules/forms/input-tags/InputTags.interface.js.map +1 -0
  64. package/dist/molecules/forms/input-tags/InputTags.js +25 -0
  65. package/dist/molecules/forms/input-tags/InputTags.js.map +1 -0
  66. package/dist/molecules/forms/input-tags/all.d.ts +2 -0
  67. package/dist/molecules/forms/input-tags/all.js +9 -0
  68. package/dist/molecules/forms/input-tags/all.js.map +1 -0
  69. package/dist/molecules/forms/input-tags/components/ChoicesTags.d.ts +307 -0
  70. package/dist/molecules/forms/input-tags/components/ChoicesTags.js +51 -0
  71. package/dist/molecules/forms/input-tags/components/ChoicesTags.js.map +1 -0
  72. package/dist/molecules/forms/input-tags/components/ReactTags.d.ts +2 -0
  73. package/dist/molecules/forms/input-tags/components/ReactTags.js +1937 -0
  74. package/dist/molecules/forms/input-tags/components/ReactTags.js.map +1 -0
  75. package/dist/molecules/forms/input-text/InputText.d.ts +2 -0
  76. package/dist/molecules/forms/input-text/InputText.interface.d.ts +4 -0
  77. package/dist/molecules/forms/input-text/InputText.interface.js +2 -0
  78. package/dist/molecules/forms/input-text/InputText.interface.js.map +1 -0
  79. package/dist/molecules/forms/input-text/InputText.js +54 -0
  80. package/dist/molecules/forms/input-text/InputText.js.map +1 -0
  81. package/dist/molecules/forms/select/Select.d.ts +2 -0
  82. package/dist/molecules/forms/select/Select.interface.d.ts +38 -0
  83. package/dist/molecules/forms/select/Select.interface.js +2 -0
  84. package/dist/molecules/forms/select/Select.interface.js.map +1 -0
  85. package/dist/molecules/forms/select/Select.js +16 -0
  86. package/dist/molecules/forms/select/Select.js.map +1 -0
  87. package/dist/molecules/forms/select/all.d.ts +2 -0
  88. package/dist/molecules/forms/select/all.js +9 -0
  89. package/dist/molecules/forms/select/all.js.map +1 -0
  90. package/dist/molecules/forms/select/components/ChoicesSelect.d.ts +7 -0
  91. package/dist/molecules/forms/select/components/ChoicesSelect.js +115 -0
  92. package/dist/molecules/forms/select/components/ChoicesSelect.js.map +1 -0
  93. package/dist/molecules/forms/select/components/HtmlSelect.d.ts +2 -0
  94. package/dist/molecules/forms/select/components/HtmlSelect.js +35 -0
  95. package/dist/molecules/forms/select/components/HtmlSelect.js.map +1 -0
  96. package/dist/molecules/forms/select/components/ReactSelect.d.ts +2 -0
  97. package/dist/molecules/forms/select/components/ReactSelect.js +46 -0
  98. package/dist/molecules/forms/select/components/ReactSelect.js.map +1 -0
  99. package/dist/molecules/forms/select/components/choices.template.d.ts +7 -0
  100. package/dist/molecules/forms/select/components/choices.template.js +9654 -0
  101. package/dist/molecules/forms/select/components/choices.template.js.map +1 -0
  102. package/dist/molecules/forms/select/hooks/useOptions.d.ts +9 -0
  103. package/dist/molecules/forms/select/hooks/useOptions.js +35 -0
  104. package/dist/molecules/forms/select/hooks/useOptions.js.map +1 -0
  105. package/dist/molecules/loader/Loader.d.ts +8 -0
  106. package/dist/molecules/loader/Loader.js +19 -0
  107. package/dist/molecules/loader/Loader.js.map +1 -0
  108. package/dist/{components/modal/modal.component.d.ts → molecules/modal/Modal.d.ts} +15 -15
  109. package/dist/molecules/modal/Modal.js +62 -0
  110. package/dist/molecules/modal/Modal.js.map +1 -0
  111. package/dist/molecules/pagination/Pagination.d.ts +18 -0
  112. package/dist/molecules/pagination/Pagination.js +77 -0
  113. package/dist/molecules/pagination/Pagination.js.map +1 -0
  114. package/dist/molecules/pagination/PaginationButton.d.ts +7 -0
  115. package/dist/molecules/pagination/PaginationButton.js +21 -0
  116. package/dist/molecules/pagination/PaginationButton.js.map +1 -0
  117. package/dist/molecules/pagination/all.d.ts +2 -0
  118. package/dist/molecules/pagination/all.js +12 -0
  119. package/dist/molecules/pagination/all.js.map +1 -0
  120. package/dist/{components/table → molecules/pagination}/utils/getPageNumbers.d.ts +3 -3
  121. package/dist/molecules/pagination/utils/getPageNumbers.js +25 -0
  122. package/dist/molecules/pagination/utils/getPageNumbers.js.map +1 -0
  123. package/dist/molecules/table/Table.d.ts +9 -0
  124. package/dist/molecules/table/Table.js +58 -0
  125. package/dist/molecules/table/Table.js.map +1 -0
  126. package/dist/molecules/table/all.d.ts +0 -0
  127. package/dist/molecules/table/all.js +19 -0
  128. package/dist/molecules/table/all.js.map +1 -0
  129. package/dist/molecules/table/components/DefaultArrowSort.d.ts +5 -0
  130. package/dist/molecules/table/components/DefaultArrowSort.js +22 -0
  131. package/dist/molecules/table/components/DefaultArrowSort.js.map +1 -0
  132. package/dist/molecules/table/components/DefaultCell.d.ts +5 -0
  133. package/dist/molecules/table/components/DefaultCell.js +13 -0
  134. package/dist/molecules/table/components/DefaultCell.js.map +1 -0
  135. package/dist/molecules/table/components/DefaultCellFooter.d.ts +6 -0
  136. package/dist/molecules/table/components/DefaultCellFooter.js +12 -0
  137. package/dist/molecules/table/components/DefaultCellFooter.js.map +1 -0
  138. package/dist/molecules/table/components/DefaultCellHeader.d.ts +6 -0
  139. package/dist/molecules/table/components/DefaultCellHeader.js +30 -0
  140. package/dist/molecules/table/components/DefaultCellHeader.js.map +1 -0
  141. package/dist/molecules/table/components/DefaultCellOperations.d.ts +10 -0
  142. package/dist/molecules/table/components/DefaultCellOperations.js +24 -0
  143. package/dist/molecules/table/components/DefaultCellOperations.js.map +1 -0
  144. package/dist/molecules/table/components/DefaultFilter.d.ts +11 -0
  145. package/dist/molecules/table/components/DefaultFilter.js +15 -0
  146. package/dist/molecules/table/components/DefaultFilter.js.map +1 -0
  147. package/dist/molecules/table/components/DefaultOperationButton.d.ts +11 -0
  148. package/dist/molecules/table/components/DefaultOperationButton.js +30 -0
  149. package/dist/molecules/table/components/DefaultOperationButton.js.map +1 -0
  150. package/dist/molecules/table/filters/Filters.d.js +2 -0
  151. package/dist/molecules/table/filters/Filters.d.js.map +1 -0
  152. package/dist/molecules/table/filters/RangeFilter.d.ts +3 -0
  153. package/dist/molecules/table/filters/RangeFilter.js +42 -0
  154. package/dist/molecules/table/filters/RangeFilter.js.map +1 -0
  155. package/dist/molecules/table/filters/SelectFilter.d.ts +3 -0
  156. package/dist/molecules/table/filters/SelectFilter.js +35 -0
  157. package/dist/molecules/table/filters/SelectFilter.js.map +1 -0
  158. package/dist/molecules/table/filters/TextFieldFilter.d.ts +3 -0
  159. package/dist/molecules/table/filters/TextFieldFilter.js +27 -0
  160. package/dist/molecules/table/filters/TextFieldFilter.js.map +1 -0
  161. package/dist/molecules/table/hooks/useTable.d.ts +15 -0
  162. package/dist/molecules/table/hooks/useTable.js +34 -0
  163. package/dist/molecules/table/hooks/useTable.js.map +1 -0
  164. package/dist/molecules/table/hooks/useUniqValues.d.ts +5 -0
  165. package/dist/molecules/table/hooks/useUniqValues.js +11 -0
  166. package/dist/molecules/table/hooks/useUniqValues.js.map +1 -0
  167. package/dist/molecules/table/interfaces/extends.d.ts +14 -0
  168. package/dist/molecules/table/interfaces/extends.js +2 -0
  169. package/dist/molecules/table/interfaces/extends.js.map +1 -0
  170. package/dist/molecules/table/utils/mapFormToColumns.d.ts +3 -0
  171. package/dist/molecules/table/utils/mapFormToColumns.js +39 -0
  172. package/dist/molecules/table/utils/mapFormToColumns.js.map +1 -0
  173. package/dist/{components/tabs/tabs.component.d.ts → molecules/tabs/Tabs.d.ts} +19 -19
  174. package/dist/molecules/tabs/Tabs.js +72 -0
  175. package/dist/molecules/tabs/Tabs.js.map +1 -0
  176. package/dist/organisms/form/Form.d.ts +22 -0
  177. package/dist/organisms/form/Form.js +15 -0
  178. package/dist/organisms/form/Form.js.map +1 -0
  179. package/dist/organisms/form/access/FormAccess.d.ts +9 -0
  180. package/dist/organisms/form/access/FormAccess.js +94 -0
  181. package/dist/organisms/form/access/FormAccess.js.map +1 -0
  182. package/dist/organisms/form/access/FormAccess.schema.d.ts +4 -0
  183. package/dist/organisms/form/access/FormAccess.schema.js +164 -0
  184. package/dist/organisms/form/access/FormAccess.schema.js.map +1 -0
  185. package/dist/organisms/form/access/FormAccess.utils.d.ts +23 -0
  186. package/dist/organisms/form/access/FormAccess.utils.js +68 -0
  187. package/dist/organisms/form/access/FormAccess.utils.js.map +1 -0
  188. package/dist/organisms/form/action/FormAction.d.ts +9 -0
  189. package/dist/organisms/form/action/FormAction.js +32 -0
  190. package/dist/organisms/form/action/FormAction.js.map +1 -0
  191. package/dist/organisms/form/builder/FormBuilder.d.ts +7 -0
  192. package/dist/organisms/form/builder/FormBuilder.js +17 -0
  193. package/dist/organisms/form/builder/FormBuilder.js.map +1 -0
  194. package/dist/organisms/form/builder/FormEdit.d.ts +8 -0
  195. package/dist/organisms/form/builder/FormEdit.js +70 -0
  196. package/dist/organisms/form/builder/FormEdit.js.map +1 -0
  197. package/dist/organisms/form/builder/FormEdit.reducer.d.ts +10 -0
  198. package/dist/organisms/form/builder/FormEdit.reducer.js +65 -0
  199. package/dist/organisms/form/builder/FormEdit.reducer.js.map +1 -0
  200. package/dist/organisms/form/builder/FormEditCtas.d.ts +15 -0
  201. package/dist/organisms/form/builder/FormEditCtas.js +52 -0
  202. package/dist/organisms/form/builder/FormEditCtas.js.map +1 -0
  203. package/dist/organisms/form/builder/FormParameters.d.ts +24 -0
  204. package/dist/organisms/form/builder/FormParameters.js +84 -0
  205. package/dist/organisms/form/builder/FormParameters.js.map +1 -0
  206. package/dist/organisms/form/builder/all.d.ts +6 -0
  207. package/dist/organisms/form/builder/all.js +26 -0
  208. package/dist/organisms/form/builder/all.js.map +1 -0
  209. package/dist/organisms/form/builder/useFormBuilder.d.ts +28 -0
  210. package/dist/organisms/form/builder/useFormBuilder.js +71 -0
  211. package/dist/organisms/form/builder/useFormBuilder.js.map +1 -0
  212. package/dist/{components/form-edit/useFormEdit.hook.d.ts → organisms/form/builder/useFormEdit.d.ts} +29 -29
  213. package/dist/organisms/form/builder/useFormEdit.js +36 -0
  214. package/dist/organisms/form/builder/useFormEdit.js.map +1 -0
  215. package/dist/{components/form-settings/formSettings.component.d.ts → organisms/form/settings/FormSettings.d.ts} +7 -8
  216. package/dist/organisms/form/settings/FormSettings.js +38 -0
  217. package/dist/organisms/form/settings/FormSettings.js.map +1 -0
  218. package/dist/organisms/form/settings/FormSettings.schema.d.ts +2 -0
  219. package/dist/organisms/form/settings/FormSettings.schema.js +60 -0
  220. package/dist/organisms/form/settings/FormSettings.schema.js.map +1 -0
  221. package/dist/organisms/form/settings/FormSettings.utils.d.ts +8 -0
  222. package/dist/organisms/form/settings/FormSettings.utils.js +23 -0
  223. package/dist/organisms/form/settings/FormSettings.utils.js.map +1 -0
  224. package/dist/organisms/form/types.d.ts +15 -0
  225. package/dist/organisms/form/types.js +2 -0
  226. package/dist/organisms/form/types.js.map +1 -0
  227. package/dist/organisms/form/useForm.d.ts +65 -0
  228. package/dist/organisms/form/useForm.js +776 -0
  229. package/dist/organisms/form/useForm.js.map +1 -0
  230. package/dist/{components/modal/removeModal.component.d.ts → organisms/modal/RemoveModal.d.ts} +9 -9
  231. package/dist/organisms/modal/RemoveModal.js +71 -0
  232. package/dist/organisms/modal/RemoveModal.js.map +1 -0
  233. package/dist/organisms/table/actions/ActionsTable.d.ts +10 -0
  234. package/dist/organisms/table/actions/ActionsTable.js +46 -0
  235. package/dist/organisms/table/actions/ActionsTable.js.map +1 -0
  236. package/dist/organisms/table/forms/FormsTable.d.ts +9 -0
  237. package/dist/organisms/table/forms/FormsTable.js +57 -0
  238. package/dist/organisms/table/forms/FormsTable.js.map +1 -0
  239. package/dist/organisms/table/forms/components/FormsCell.d.ts +5 -0
  240. package/dist/organisms/table/forms/components/FormsCell.js +50 -0
  241. package/dist/organisms/table/forms/components/FormsCell.js.map +1 -0
  242. package/dist/organisms/table/submissions/SubmissionsTable.d.ts +6 -0
  243. package/dist/organisms/table/submissions/SubmissionsTable.js +11 -0
  244. package/dist/organisms/table/submissions/SubmissionsTable.js.map +1 -0
  245. package/dist/react-app-env.d.js +2 -0
  246. package/dist/react-app-env.d.js.map +1 -0
  247. package/dist/react-table.d.js +2 -0
  248. package/dist/react-table.d.js.map +1 -0
  249. package/dist/registries/components.d.ts +3 -0
  250. package/dist/registries/components.js +19 -0
  251. package/dist/registries/components.js.map +1 -0
  252. package/dist/typings.d.js +2 -0
  253. package/dist/typings.d.js.map +1 -0
  254. package/dist/utils/getEventValue.d.ts +1 -1
  255. package/dist/utils/getEventValue.js +8 -0
  256. package/dist/utils/getEventValue.js.map +1 -0
  257. package/dist/utils/iconClass.d.ts +1 -1
  258. package/dist/utils/iconClass.js +9 -0
  259. package/dist/utils/iconClass.js.map +1 -0
  260. package/dist/utils/mapPagination.d.ts +1 -1
  261. package/dist/utils/mapPagination.js +11 -0
  262. package/dist/utils/mapPagination.js.map +1 -0
  263. package/dist/utils/stopPropagationWrapper.d.ts +1 -1
  264. package/dist/utils/stopPropagationWrapper.js +7 -0
  265. package/dist/utils/stopPropagationWrapper.js.map +1 -0
  266. package/package.json +29 -18
  267. package/readme.md +33 -20
  268. package/src/atoms/icon/Icon.stories.tsx +124 -0
  269. package/src/atoms/icon/Icon.tsx +16 -0
  270. package/src/index.ts +1 -6
  271. package/src/interfaces/ActionType.ts +26 -0
  272. package/src/interfaces/ComponentType.ts +3 -0
  273. package/src/interfaces/FormOptions.ts +4 -1
  274. package/src/interfaces/{FormSchema.ts → FormType.ts} +3 -3
  275. package/src/interfaces/Operation.ts +2 -2
  276. package/src/interfaces/{RoleSchema.ts → RoleType.ts} +1 -1
  277. package/src/interfaces/SubmissionType.ts +20 -0
  278. package/src/interfaces/index.ts +5 -4
  279. package/src/molecules/__fixtures__/build.js +28 -0
  280. package/src/molecules/__fixtures__/form-firstname.fixture.json +256 -0
  281. package/src/molecules/__fixtures__/form-schema.json +350 -0
  282. package/src/molecules/__fixtures__/form-submissions.json +11942 -0
  283. package/src/molecules/__fixtures__/form-wizard.fixture.json +2042 -0
  284. package/src/molecules/__fixtures__/products.json +81539 -0
  285. package/src/molecules/__fixtures__/useValue.hook.ts +14 -0
  286. package/src/{components/alert/alert.component.spec.tsx → molecules/alert/Alert.spec.tsx} +12 -15
  287. package/src/molecules/alert/Alert.stories.tsx +39 -0
  288. package/src/{components/alert/alert.component.tsx → molecules/alert/Alert.tsx} +9 -8
  289. package/src/molecules/button/Button.stories.tsx +106 -0
  290. package/src/molecules/button/Button.tsx +54 -0
  291. package/src/{components/card/card.component.spec.tsx → molecules/card/Card.spec.tsx} +3 -3
  292. package/src/{components/card/card.stories.tsx → molecules/card/Card.stories.tsx} +9 -4
  293. package/src/{components/card/card.component.tsx → molecules/card/Card.tsx} +1 -2
  294. package/src/{components/form-control/formControl.component.spec.tsx → molecules/forms/form-control/FormControl.spec.tsx} +9 -9
  295. package/src/molecules/forms/form-control/FormControl.stories.tsx +58 -0
  296. package/src/molecules/forms/form-control/FormControl.tsx +86 -0
  297. package/src/molecules/forms/input-tags/InputTags.interface.ts +9 -0
  298. package/src/molecules/forms/input-tags/InputTags.tsx +30 -0
  299. package/src/molecules/forms/input-tags/all.ts +6 -0
  300. package/src/molecules/forms/input-tags/components/ChoicesTags.stories.tsx +110 -0
  301. package/src/molecules/forms/input-tags/components/ChoicesTags.tsx +72 -0
  302. package/src/molecules/forms/input-tags/components/ReactTags.stories.tsx +140 -0
  303. package/src/molecules/forms/input-tags/components/ReactTags.tsx +38 -0
  304. package/src/molecules/forms/input-text/InputText.interface.ts +5 -0
  305. package/src/{components/input-text/inputText.component.spec.tsx → molecules/forms/input-text/InputText.spec.tsx} +8 -8
  306. package/src/molecules/forms/input-text/InputText.stories.tsx +179 -0
  307. package/src/molecules/forms/input-text/InputText.tsx +63 -0
  308. package/src/molecules/forms/select/Select.interface.ts +45 -0
  309. package/src/molecules/forms/select/Select.tsx +28 -0
  310. package/src/molecules/forms/select/all.ts +7 -0
  311. package/src/molecules/forms/select/components/ChoicesSelect.stories.tsx +332 -0
  312. package/src/molecules/forms/select/components/ChoicesSelect.tsx +159 -0
  313. package/src/molecules/forms/select/components/HtmlSelect.stories.tsx +305 -0
  314. package/src/molecules/forms/select/components/HtmlSelect.tsx +54 -0
  315. package/src/molecules/forms/select/components/ReactSelect.stories.tsx +287 -0
  316. package/src/molecules/forms/select/components/ReactSelect.tsx +60 -0
  317. package/src/molecules/forms/select/components/choices.template.tsx +38 -0
  318. package/src/molecules/forms/select/hooks/useOptions.spec.ts +154 -0
  319. package/src/molecules/forms/select/hooks/useOptions.ts +53 -0
  320. package/src/{components/loader/loader.component.spec.tsx → molecules/loader/Loader.spec.tsx} +4 -4
  321. package/src/molecules/loader/Loader.stories.tsx +43 -0
  322. package/src/{components/loader/loader.component.tsx → molecules/loader/Loader.tsx} +3 -11
  323. package/src/molecules/modal/Modal.spec.tsx +203 -0
  324. package/src/molecules/modal/Modal.stories.tsx +178 -0
  325. package/src/{components/modal/modal.component.tsx → molecules/modal/Modal.tsx} +1 -1
  326. package/src/{components/pagination/pagination.component.spec.tsx → molecules/pagination/Pagination.spec.tsx} +27 -22
  327. package/src/molecules/pagination/Pagination.stories.tsx +99 -0
  328. package/src/{components/pagination/pagination.component.tsx → molecules/pagination/Pagination.tsx} +34 -47
  329. package/src/molecules/pagination/PaginationButton.tsx +30 -0
  330. package/src/molecules/pagination/all.ts +3 -0
  331. package/src/molecules/table/Table.stories.tsx +272 -0
  332. package/src/molecules/table/Table.tsx +100 -0
  333. package/src/molecules/table/all.ts +16 -0
  334. package/src/molecules/table/components/DefaultArrowSort.tsx +26 -0
  335. package/src/molecules/table/components/DefaultCell.tsx +22 -0
  336. package/src/molecules/table/components/DefaultCellFooter.tsx +16 -0
  337. package/src/molecules/table/components/DefaultCellHeader.tsx +42 -0
  338. package/src/molecules/table/components/DefaultCellOperations.tsx +42 -0
  339. package/src/molecules/table/components/DefaultFilter.tsx +42 -0
  340. package/src/molecules/table/components/DefaultOperationButton.tsx +40 -0
  341. package/src/molecules/table/filters/Filters.d.ts +31 -0
  342. package/src/molecules/table/filters/RangeFilter.tsx +43 -0
  343. package/src/molecules/table/filters/SelectFilter.tsx +47 -0
  344. package/src/molecules/table/filters/TextFieldFilter.tsx +36 -0
  345. package/src/molecules/table/hooks/useTable.tsx +75 -0
  346. package/src/molecules/table/hooks/useUniqValues.tsx +10 -0
  347. package/src/molecules/table/interfaces/extends.ts +18 -0
  348. package/src/molecules/table/utils/mapFormToColumns.tsx +74 -0
  349. package/src/{components/tabs/tabs.component.spec.tsx → molecules/tabs/Tabs.spec.tsx} +6 -6
  350. package/src/molecules/tabs/Tabs.stories.tsx +141 -0
  351. package/src/{components/tabs/tabs.component.tsx → molecules/tabs/Tabs.tsx} +1 -1
  352. package/src/organisms/__fixtures__/WrapComponent.tsx +11 -0
  353. package/src/organisms/__fixtures__/form-actions.json +240 -0
  354. package/src/organisms/__fixtures__/form-firstname.fixture.json +256 -0
  355. package/src/organisms/__fixtures__/form-wizard.fixture.json +2042 -0
  356. package/src/organisms/__fixtures__/form.fixture.json +2067 -0
  357. package/src/organisms/__fixtures__/useEditForm.tsx +84 -0
  358. package/src/organisms/__fixtures__/utils.ts +74 -0
  359. package/src/{components/form/form.component.spec.tsx → organisms/form/Form.spec.tsx} +6 -7
  360. package/src/organisms/form/Form.stories.tsx +698 -0
  361. package/src/organisms/form/Form.tsx +29 -0
  362. package/src/{components/form-access/formAccess.schema.ts → organisms/form/access/FormAccess.schema.ts} +4 -6
  363. package/src/{components/form-access/formAccess.stories.tsx → organisms/form/access/FormAccess.stories.tsx} +8 -2
  364. package/src/{components/form-access/formAccess.component.tsx → organisms/form/access/FormAccess.tsx} +16 -18
  365. package/src/{components/form-access/formAccess.utils.spec.ts → organisms/form/access/FormAccess.utils.spec.ts} +13 -7
  366. package/src/{components/form-access/formAccess.utils.ts → organisms/form/access/FormAccess.utils.ts} +23 -20
  367. package/src/{components/form-action/formAction.stories.tsx → organisms/form/action/FormAction.stories.tsx} +11 -13
  368. package/src/{components/form-action/formAction.component.tsx → organisms/form/action/FormAction.tsx} +8 -8
  369. package/src/organisms/form/builder/FormBuilder.stories.tsx +97 -0
  370. package/src/organisms/form/builder/FormBuilder.tsx +28 -0
  371. package/src/{components/form-edit/formEdit.reducer.ts → organisms/form/builder/FormEdit.reducer.ts} +6 -6
  372. package/src/{components/form-edit/formEdit.stories.tsx → organisms/form/builder/FormEdit.stories.tsx} +88 -44
  373. package/src/organisms/form/builder/FormEdit.tsx +75 -0
  374. package/src/organisms/form/builder/FormEditCtas.tsx +97 -0
  375. package/src/{components/form-edit/formParameters.component.tsx → organisms/form/builder/FormParameters.tsx} +29 -29
  376. package/src/organisms/form/builder/all.ts +17 -0
  377. package/src/organisms/form/builder/useFormBuilder.ts +143 -0
  378. package/src/{components/form-edit/useFormEdit.hook.ts → organisms/form/builder/useFormEdit.ts} +8 -8
  379. package/src/{components/form-settings/formSettings.component.spec.tsx → organisms/form/settings/FormSettings.component.spec.tsx} +3 -4
  380. package/src/{components/form-settings/formSettings.schema.ts → organisms/form/settings/FormSettings.schema.ts} +2 -2
  381. package/src/{components/form-settings/formSettings.stories.tsx → organisms/form/settings/FormSettings.stories.tsx} +10 -10
  382. package/src/{components/form-settings/formSettings.component.tsx → organisms/form/settings/FormSettings.tsx} +8 -9
  383. package/src/{components/form-settings/formSettings.utils.spec.ts → organisms/form/settings/FormSettings.utils.spec.ts} +1 -1
  384. package/src/{components/form-settings/formSettings.utils.ts → organisms/form/settings/FormSettings.utils.ts} +4 -4
  385. package/src/organisms/form/types.ts +8 -0
  386. package/src/organisms/form/useForm.ts +223 -0
  387. package/src/organisms/modal/RemoveModal.stories.tsx +59 -0
  388. package/src/{components/modal/removeModal.component.tsx → organisms/modal/RemoveModal.tsx} +3 -3
  389. package/src/{components/actions-table/actionsTable.component.spec.tsx → organisms/table/actions/ActionsTable.spec.tsx} +14 -11
  390. package/src/{components/actions-table/actionsTable.stories.tsx → organisms/table/actions/ActionsTable.stories.tsx} +22 -24
  391. package/src/{components/actions-table/actionsTable.component.tsx → organisms/table/actions/ActionsTable.tsx} +14 -21
  392. package/src/{components/forms-table/formsTable.stories.tsx → organisms/table/forms/FormsTable.stories.tsx} +24 -28
  393. package/src/organisms/table/forms/FormsTable.tsx +66 -0
  394. package/src/organisms/table/forms/components/FormsCell.tsx +53 -0
  395. package/src/{components/submissions-table/submissionsTable.stories.tsx → organisms/table/submissions/SubmissionsTable.stories.tsx} +28 -31
  396. package/src/organisms/table/submissions/SubmissionsTable.tsx +13 -0
  397. package/src/registries/components.ts +23 -0
  398. package/src/utils/iconClass.ts +3 -1
  399. package/tsconfig.app.json +11 -0
  400. package/tsconfig.json +10 -5
  401. package/tsconfig.node.json +9 -4
  402. package/tsconfig.spec.json +14 -0
  403. package/vite.config.mts +69 -0
  404. package/vitest.config.mts +21 -0
  405. package/.eslintignore +0 -13
  406. package/.eslintrc.js +0 -7
  407. package/coverage.json +0 -6
  408. package/dist/components/actions-table/actionsTable.component.d.ts +0 -11
  409. package/dist/components/actions-table/actionsTable.component.spec.d.ts +0 -1
  410. package/dist/components/actions-table/actionsTable.stories.d.ts +0 -40
  411. package/dist/components/alert/alert.component.d.ts +0 -6
  412. package/dist/components/alert/alert.component.spec.d.ts +0 -1
  413. package/dist/components/alert/alert.stories.d.ts +0 -15
  414. package/dist/components/card/card.component.spec.d.ts +0 -1
  415. package/dist/components/card/card.stories.d.ts +0 -16
  416. package/dist/components/form/form.component.d.ts +0 -63
  417. package/dist/components/form/form.component.spec.d.ts +0 -1
  418. package/dist/components/form/form.stories.d.ts +0 -6445
  419. package/dist/components/form/useForm.hook.d.ts +0 -60
  420. package/dist/components/form-access/formAccess.component.d.ts +0 -9
  421. package/dist/components/form-access/formAccess.schema.d.ts +0 -5
  422. package/dist/components/form-access/formAccess.stories.d.ts +0 -21
  423. package/dist/components/form-access/formAccess.utils.d.ts +0 -24
  424. package/dist/components/form-access/formAccess.utils.spec.d.ts +0 -1
  425. package/dist/components/form-action/formAction.component.d.ts +0 -9
  426. package/dist/components/form-action/formAction.stories.d.ts +0 -409
  427. package/dist/components/form-builder/formBuilder.component.d.ts +0 -53
  428. package/dist/components/form-builder/formBuilder.stories.d.ts +0 -5989
  429. package/dist/components/form-control/formControl.component.d.ts +0 -14
  430. package/dist/components/form-control/formControl.component.spec.d.ts +0 -1
  431. package/dist/components/form-control/formControl.stories.d.ts +0 -58
  432. package/dist/components/form-edit/formCtas.component.d.ts +0 -28
  433. package/dist/components/form-edit/formEdit.component.d.ts +0 -19
  434. package/dist/components/form-edit/formEdit.reducer.d.ts +0 -10
  435. package/dist/components/form-edit/formEdit.stories.d.ts +0 -396
  436. package/dist/components/form-edit/formParameters.component.d.ts +0 -34
  437. package/dist/components/form-settings/formSettings.component.spec.d.ts +0 -1
  438. package/dist/components/form-settings/formSettings.schema.d.ts +0 -2
  439. package/dist/components/form-settings/formSettings.stories.d.ts +0 -58
  440. package/dist/components/form-settings/formSettings.utils.d.ts +0 -8
  441. package/dist/components/form-settings/formSettings.utils.spec.d.ts +0 -1
  442. package/dist/components/forms-table/components/formCell.component.d.ts +0 -7
  443. package/dist/components/forms-table/formsTable.component.d.ts +0 -11
  444. package/dist/components/forms-table/formsTable.stories.d.ts +0 -117
  445. package/dist/components/index.d.ts +0 -26
  446. package/dist/components/input-tags/inputTags.component.d.ts +0 -19
  447. package/dist/components/input-tags/inputTags.stories.d.ts +0 -76
  448. package/dist/components/input-text/inputText.component.d.ts +0 -28
  449. package/dist/components/input-text/inputText.component.spec.d.ts +0 -1
  450. package/dist/components/input-text/inputText.stories.d.ts +0 -101
  451. package/dist/components/loader/loader.component.d.ts +0 -17
  452. package/dist/components/loader/loader.component.spec.d.ts +0 -1
  453. package/dist/components/loader/loader.stories.d.ts +0 -15
  454. package/dist/components/modal/modal.component.spec.d.ts +0 -1
  455. package/dist/components/modal/modal.stories.d.ts +0 -44
  456. package/dist/components/pagination/pagination.component.d.ts +0 -18
  457. package/dist/components/pagination/pagination.component.spec.d.ts +0 -1
  458. package/dist/components/pagination/pagination.stories.d.ts +0 -16
  459. package/dist/components/react-component/reactComponent.component.d.ts +0 -90
  460. package/dist/components/select/select.component.d.ts +0 -14
  461. package/dist/components/select/select.component.spec.d.ts +0 -1
  462. package/dist/components/select/select.stories.d.ts +0 -164
  463. package/dist/components/submissions-table/submissionsTable.component.d.ts +0 -7
  464. package/dist/components/submissions-table/submissionsTable.stories.d.ts +0 -649
  465. package/dist/components/table/components/defaultArrowSort.component.d.ts +0 -2
  466. package/dist/components/table/components/defaultCell.component.d.ts +0 -2
  467. package/dist/components/table/components/defaultCellHeader.component.d.ts +0 -6
  468. package/dist/components/table/components/defaultCellOperations.component.d.ts +0 -13
  469. package/dist/components/table/components/defaultCells.component.d.ts +0 -5
  470. package/dist/components/table/components/defaultOperationButton.component.d.ts +0 -14
  471. package/dist/components/table/components/defaultRow.component.d.ts +0 -12
  472. package/dist/components/table/components/dragNDropContainer.d.ts +0 -4
  473. package/dist/components/table/filters/defaultColumnFilter.component.d.ts +0 -6
  474. package/dist/components/table/filters/defaultColumnFilter.component.spec.d.ts +0 -1
  475. package/dist/components/table/filters/selectColumnFilter.component.d.ts +0 -11
  476. package/dist/components/table/filters/selectColumnFilter.component.spec.d.ts +0 -1
  477. package/dist/components/table/filters/sliderColumnFilter.component.d.ts +0 -3
  478. package/dist/components/table/hooks/useCustomTable.hook.d.ts +0 -128
  479. package/dist/components/table/hooks/useDragnDropRow.hook.d.ts +0 -274
  480. package/dist/components/table/hooks/useOperations.hook.d.ts +0 -11
  481. package/dist/components/table/index.d.ts +0 -15
  482. package/dist/components/table/table.component.d.ts +0 -3
  483. package/dist/components/table/table.stories.d.ts +0 -71
  484. package/dist/components/table/utils/mapFormToColumns.d.ts +0 -3
  485. package/dist/components/table/utils/swapElements.d.ts +0 -1
  486. package/dist/components/table/utils/swapElements.spec.d.ts +0 -1
  487. package/dist/components/tabs/tabs.component.spec.d.ts +0 -1
  488. package/dist/components/tabs/tabs.component.stories.d.ts +0 -47
  489. package/dist/index.modern.js +0 -7437
  490. package/dist/index.modern.js.map +0 -1
  491. package/dist/interfaces/ActionSchema.d.ts +0 -23
  492. package/dist/interfaces/Submission.d.ts +0 -5
  493. package/dist/setupTests.d.ts +0 -1
  494. package/dist/utils/callLast.d.ts +0 -1
  495. package/jest.config.js +0 -6
  496. package/src/components/alert/alert.stories.tsx +0 -18
  497. package/src/components/form/form.component.tsx +0 -73
  498. package/src/components/form/form.stories.tsx +0 -253
  499. package/src/components/form/useForm.hook.ts +0 -216
  500. package/src/components/form-builder/formBuilder.component.tsx +0 -195
  501. package/src/components/form-builder/formBuilder.stories.tsx +0 -3667
  502. package/src/components/form-control/formControl.component.tsx +0 -58
  503. package/src/components/form-control/formControl.stories.tsx +0 -65
  504. package/src/components/form-edit/formCtas.component.tsx +0 -106
  505. package/src/components/form-edit/formEdit.component.tsx +0 -60
  506. package/src/components/forms-table/components/formCell.component.tsx +0 -48
  507. package/src/components/forms-table/formsTable.component.tsx +0 -42
  508. package/src/components/index.ts +0 -26
  509. package/src/components/input-tags/inputTags.component.tsx +0 -58
  510. package/src/components/input-tags/inputTags.stories.tsx +0 -97
  511. package/src/components/input-text/inputText.component.tsx +0 -85
  512. package/src/components/input-text/inputText.stories.tsx +0 -126
  513. package/src/components/loader/loader.stories.tsx +0 -18
  514. package/src/components/modal/modal.component.spec.tsx +0 -79
  515. package/src/components/modal/modal.stories.tsx +0 -192
  516. package/src/components/pagination/pagination.stories.tsx +0 -40
  517. package/src/components/react-component/reactComponent.component.tsx +0 -197
  518. package/src/components/select/select.component.spec.tsx +0 -85
  519. package/src/components/select/select.component.tsx +0 -88
  520. package/src/components/select/select.stories.tsx +0 -173
  521. package/src/components/submissions-table/submissionsTable.component.tsx +0 -16
  522. package/src/components/table/components/defaultArrowSort.component.tsx +0 -12
  523. package/src/components/table/components/defaultCell.component.tsx +0 -15
  524. package/src/components/table/components/defaultCellHeader.component.tsx +0 -19
  525. package/src/components/table/components/defaultCellOperations.component.tsx +0 -39
  526. package/src/components/table/components/defaultCells.component.tsx +0 -31
  527. package/src/components/table/components/defaultOperationButton.component.tsx +0 -53
  528. package/src/components/table/components/defaultRow.component.tsx +0 -51
  529. package/src/components/table/components/dragNDropContainer.tsx +0 -7
  530. package/src/components/table/filters/defaultColumnFilter.component.spec.tsx +0 -34
  531. package/src/components/table/filters/defaultColumnFilter.component.tsx +0 -39
  532. package/src/components/table/filters/selectColumnFilter.component.spec.tsx +0 -69
  533. package/src/components/table/filters/selectColumnFilter.component.tsx +0 -52
  534. package/src/components/table/filters/sliderColumnFilter.component.tsx +0 -31
  535. package/src/components/table/hooks/useCustomTable.hook.tsx +0 -272
  536. package/src/components/table/hooks/useDragnDropRow.hook.ts +0 -80
  537. package/src/components/table/hooks/useOperations.hook.tsx +0 -39
  538. package/src/components/table/index.ts +0 -15
  539. package/src/components/table/table.component.tsx +0 -100
  540. package/src/components/table/table.stories.tsx +0 -120
  541. package/src/components/table/utils/mapFormToColumns.tsx +0 -34
  542. package/src/components/table/utils/swapElements.spec.ts +0 -7
  543. package/src/components/table/utils/swapElements.ts +0 -7
  544. package/src/components/tabs/tabs.component.stories.tsx +0 -127
  545. package/src/interfaces/ActionSchema.ts +0 -26
  546. package/src/interfaces/Submission.ts +0 -5
  547. package/src/setupTests.tsx +0 -5
  548. package/src/utils/callLast.ts +0 -12
  549. /package/src/{components → molecules}/__fixtures__/form-actions.json +0 -0
  550. /package/src/{components → molecules}/__fixtures__/form.fixture.json +0 -0
  551. /package/src/{components/table → molecules/pagination}/utils/getPageNumbers.ts +0 -0
  552. /package/src/{components → organisms}/__fixtures__/form-schema.json +0 -0
  553. /package/src/{components → organisms}/__fixtures__/form-submissions.json +0 -0
  554. /package/src/{components/actions-table → organisms/table/actions}/__fixtures__/data.json +0 -0
@@ -0,0 +1,8 @@
1
+ function a(t) {
2
+ const { target: e } = t;
3
+ return t.target.multiple && t.target.selectedOptions ? Array.from(t.target.selectedOptions, (r) => r.value) : e.type === "checkbox" ? e.checked : e.value;
4
+ }
5
+ export {
6
+ a as getEventValue
7
+ };
8
+ //# sourceMappingURL=getEventValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getEventValue.js","sources":["../../src/utils/getEventValue.ts"],"sourcesContent":["export function getEventValue(event: any) {\n const { target } = event;\n\n if (event.target.multiple && event.target.selectedOptions) {\n return Array.from(event.target.selectedOptions, (option: any) => option.value);\n }\n\n return target.type === \"checkbox\" ? target.checked : target.value;\n}\n"],"names":["getEventValue","event","target","option"],"mappings":"AAAO,SAASA,EAAcC,GAAY;AAClC,QAAA,EAAE,QAAAC,MAAWD;AAEnB,SAAIA,EAAM,OAAO,YAAYA,EAAM,OAAO,kBACjC,MAAM,KAAKA,EAAM,OAAO,iBAAiB,CAACE,MAAgBA,EAAO,KAAK,IAGxED,EAAO,SAAS,aAAaA,EAAO,UAAUA,EAAO;AAC9D;"}
@@ -1 +1 @@
1
- export declare function iconClass(iconset: string | undefined, name: string, spinning?: boolean): string;
1
+ export declare function iconClass(iconset: string | undefined, name: string, spinning?: boolean): string;
@@ -0,0 +1,9 @@
1
+ import * as e from "formiojs";
2
+ const { Templates: o } = e;
3
+ function s(r, t, n) {
4
+ return o.current.iconClass(r || o.current.defaultIconset, t, n);
5
+ }
6
+ export {
7
+ s as iconClass
8
+ };
9
+ //# sourceMappingURL=iconClass.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iconClass.js","sources":["../../src/utils/iconClass.ts"],"sourcesContent":["import * as formio from \"formiojs\";\n\nconst { Templates } = formio;\n\nexport function iconClass(iconset: string | undefined, name: string, spinning?: boolean): string {\n return Templates.current.iconClass(iconset || Templates.current.defaultIconset, name, spinning);\n}\n"],"names":["Templates","formio","iconClass","iconset","name","spinning"],"mappings":";AAEA,MAAM,EAAE,WAAAA,EAAc,IAAAC;AAEN,SAAAC,EAAUC,GAA6BC,GAAcC,GAA4B;AACxF,SAAAL,EAAU,QAAQ,UAAUG,KAAWH,EAAU,QAAQ,gBAAgBI,GAAMC,CAAQ;AAChG;"}
@@ -1 +1 @@
1
- export declare function mapPagination({ skip, limit, serverCount, length }?: any): any;
1
+ export declare function mapPagination({ skip, limit, serverCount, length }?: any): any;
@@ -0,0 +1,11 @@
1
+ function o({ skip: n, limit: a, serverCount: e, length: g } = {}) {
2
+ return n = n || 0, a = a || 10, e = e || g, {
3
+ pageIndex: Math.floor(n / a),
4
+ pageSize: a,
5
+ pageCount: Math.ceil(e / a)
6
+ };
7
+ }
8
+ export {
9
+ o as mapPagination
10
+ };
11
+ //# sourceMappingURL=mapPagination.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mapPagination.js","sources":["../../src/utils/mapPagination.ts"],"sourcesContent":["export function mapPagination({ skip, limit, serverCount, length }: any = {}): any {\n skip = skip || 0;\n limit = limit || 10;\n serverCount = serverCount || length;\n\n return {\n pageIndex: Math.floor(skip / limit),\n pageSize: limit,\n pageCount: Math.ceil(serverCount / limit)\n };\n}\n"],"names":["mapPagination","skip","limit","serverCount","length"],"mappings":"AAAgB,SAAAA,EAAc,EAAE,MAAAC,GAAM,OAAAC,GAAO,aAAAC,GAAa,QAAAC,EAAO,IAAS,IAAS;AACjF,SAAAH,IAAOA,KAAQ,GACfC,IAAQA,KAAS,IACjBC,IAAcA,KAAeC,GAEtB;AAAA,IACL,WAAW,KAAK,MAAMH,IAAOC,CAAK;AAAA,IAClC,UAAUA;AAAA,IACV,WAAW,KAAK,KAAKC,IAAcD,CAAK;AAAA,EAC1C;AACF;"}
@@ -1 +1 @@
1
- export declare const stopPropagationWrapper: (fn: Function) => (event: any) => void;
1
+ export declare const stopPropagationWrapper: (fn: Function) => (event: any) => void;
@@ -0,0 +1,7 @@
1
+ const t = (o) => (p) => {
2
+ p.stopPropagation(), o();
3
+ };
4
+ export {
5
+ t as stopPropagationWrapper
6
+ };
7
+ //# sourceMappingURL=stopPropagationWrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stopPropagationWrapper.js","sources":["../../src/utils/stopPropagationWrapper.ts"],"sourcesContent":["export const stopPropagationWrapper = (fn: Function) => (event: any) => {\n event.stopPropagation();\n fn();\n};\n"],"names":["stopPropagationWrapper","fn","event"],"mappings":"AAAO,MAAMA,IAAyB,CAACC,MAAiB,CAACC,MAAe;AACtE,EAAAA,EAAM,gBAAgB,GACnBD,EAAA;AACL;"}
package/package.json CHANGED
@@ -1,51 +1,62 @@
1
1
  {
2
2
  "name": "@tsed/react-formio",
3
- "version": "2.3.6",
3
+ "version": "3.0.0-alpha.10",
4
4
  "description": "Provide a react formio wrapper. Written in TypeScript.",
5
+ "type": "module",
5
6
  "main": "./dist/index.js",
6
7
  "module": "./dist/index.modern.js",
7
8
  "exports": {
8
9
  ".": {
10
+ "types": "./dist/index.d.ts",
9
11
  "tsed-source": "./src/index.ts",
10
- "import": "./dist/index.modern.js",
11
- "require": "./dist/index.js",
12
- "default": "./dist/index.modern.js"
12
+ "default": "./dist/index.js"
13
+ },
14
+ "./*": {
15
+ "types": "./dist/*.d.ts",
16
+ "tsed-source": "./src/*",
17
+ "default": "./dist/*.js"
13
18
  }
14
19
  },
15
20
  "source": "src/index.ts",
16
21
  "scripts": {
17
- "lint:fix": "yarn lint --fix",
18
- "test": "cross-env NODE_ENV=test jest --coverage",
19
- "test:coverage:update": "write-coverage",
20
- "build": "microbundle --no-compress --format modern,cjs --jsx React.createElement --jsxFragment React.Fragment --globals react/jsx-runtime=jsx",
21
- "watch": "microbundle watch --no-compress --format modern,cjs --jsx React.createElement --jsxFragment React.Fragment --globals react/jsx-runtime=jsx"
22
+ "test": "vitest run --coverage",
23
+ "build": "vite build",
24
+ "watch": "vite build --watch"
22
25
  },
23
26
  "dependencies": {
24
27
  "classnames": "^2.3.1",
25
28
  "eventemitter2": "^6.4.3",
26
- "prop-types": "15.8.1"
29
+ "use-debounce": "^10.0.4"
27
30
  },
28
31
  "peerDependencies": {
29
32
  "@formio/choices.js": ">=9.0.1",
33
+ "@tanstack/react-table": ">=8.20.6",
30
34
  "formiojs": ">=4.0.0",
31
35
  "lodash": ">=4.17.20",
32
- "prop-types": ">=15.7.2",
36
+ "moment": ">=2.30.1",
33
37
  "react": ">=16.14.0",
34
38
  "react-dnd": ">=16.0.1",
35
39
  "react-dnd-html5-backend": ">=16.0.1",
36
40
  "react-dom": ">=16.14.0",
41
+ "react-select": ">=5.9.0",
37
42
  "react-table": ">=7.6.3",
38
43
  "tooltip.js": ">=1.3.3"
39
44
  },
40
45
  "devDependencies": {
41
- "@tsed/tailwind": "2.3.6",
42
- "@tsed/tailwind-formio": "2.3.6",
43
- "microbundle": "0.13.0"
46
+ "@tanstack/react-table": ">=8.20.6",
47
+ "@tsed/tailwind-formio": "3.0.0-alpha.10",
48
+ "@tsed/typescript": "3.0.0-alpha.10",
49
+ "microbundle": "0.13.0",
50
+ "vite": "5.4.11",
51
+ "vitest": "2.1.8"
44
52
  },
45
- "repository": "https://github.com/TypedProject/tsed-formio",
53
+ "repository": "https://github.com/tsedio/tsed-formio",
46
54
  "bugs": {
47
- "url": "https://github.com/TypedProject/tsed-formio/issues"
55
+ "url": "https://github.com/tsedio/tsed-formio/issues"
48
56
  },
49
- "homepage": "https://github.com/TypedProject/tsed-formio/tree/master/packages/react-formio",
50
- "author": "Romain Lenzotti"
57
+ "homepage": "https://github.com/tsedio/tsed-formio/tree/master/packages/react-formio",
58
+ "author": "Romain Lenzotti",
59
+ "publishConfig": {
60
+ "tag": "alpha"
61
+ }
51
62
  }
package/readme.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <p style="text-align: center" align="center">
2
- <a href="https://tsed.dev" target="_blank"><img src="https://tsed.dev/tsed-og.png" width="200" alt="Ts.ED logo"/></a>
2
+ <a href="https://tsed.io" target="_blank"><img src="https://tsed.io/tsed-og.png" width="200" alt="Ts.ED logo"/></a>
3
3
  </p>
4
4
 
5
5
  <div align="center">
@@ -14,11 +14,11 @@
14
14
  </div>
15
15
 
16
16
  <div align="center">
17
- <a href="https://tsed.dev/">Website</a>
17
+ <a href="https://tsed.io/">Website</a>
18
18
  <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
19
- <a href="https://tsed.dev/tutorials/prisma.html">Tutorial</a>
19
+ <a href="https://tsed.io/tutorials/prisma.html">Tutorial</a>
20
20
  <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
21
- <a href="https://slack.tsed.dev">Slack</a>
21
+ <a href="https://api.tsed.io/rest/slack/tsedio/tsed">Slack</a>
22
22
  <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
23
23
  <a href="https://twitter.com/TsED_io">Twitter</a>
24
24
  </div>
@@ -31,30 +31,30 @@ platform.
31
31
  This module is based on the original [react-formio](https://github.com/formio/react-formio) and add extra features
32
32
  listed above.
33
33
 
34
- See our [storybook](https://formio.tsed.dev/?path=/docs/getting-started--docs) to see all available components.
34
+ See our [storybook](https://formio.tsed.io/?path=/docs/getting-started--docs) to see all available components.
35
35
 
36
36
  ## Features
37
37
 
38
38
  Many components are provided to build your own backoffice based on Formio.js API:
39
39
 
40
- - [ActionsTable](https://formio.tsed.dev/?path=story/reactformio-actionstable--sandbox),
41
- - [FormAccess](https://formio.tsed.dev/?path=story/reactformio-formaccess--sandbox),
42
- - [FormAction](https://formio.tsed.dev/?path=story/reactformio-formaction--sandbox),
43
- - [Form](https://formio.tsed.dev/?path=docs/documentation-form--docs),
44
- - [FormBuilder](https://formio.tsed.dev/?path=docs/documentation-formbuilder--docs),
45
- - [FormEdit](https://formio.tsed.dev/?path=docs/documentation-formedit--docs),
46
- - [FormsTable](https://formio.tsed.dev/?path=docs/documentation-formstable--docs),
47
- - [InputTags](https://formio.tsed.dev/?path=story/reactformio-inputtags--sandbox),
48
- - [InputText](https://formio.tsed.dev/?path=story/reactformio-inputtext--sandbox),
49
- - [Pagination](https://formio.tsed.dev/?path=story/reactformio-pagination--sandbox),
50
- - [Select](https://formio.tsed.dev/?path=/story/reactformio-select--sandbox),
51
- - [SubmissionsTable](https://formio.tsed.dev/?path=/docs/documentation-submissionstable--docs).
52
- - [Table](https://formio.tsed.dev/?path=/story/reactformio-table--sandbox),
40
+ - ActionsTable,
41
+ - FormAccess,
42
+ - FormAction,
43
+ - Form,
44
+ - FormBuilder,
45
+ - FormEdit,
46
+ - FormsTable,
47
+ - InputTags,
48
+ - InputText,
49
+ - Pagination,
50
+ - Select,
51
+ - SubmissionsTable.
52
+ - Table,
53
53
  - Predefined Reducers for Actions, Action, Form, Forms, Submission, Submissions, etc...,
54
54
  - TypeScript support.
55
55
  - Tailwind support.
56
56
 
57
- ## Migrate from v1
57
+ ## Migrate to v2
58
58
 
59
59
  If you use redux actions from v1, you have to install `@tsed/redux-formio-stores` and remplace your imports:
60
60
 
@@ -63,6 +63,19 @@ If you use redux actions from v1, you have to install `@tsed/redux-formio-stores
63
63
  + import { defaultFormioReducer, formsReducer } from "@tsed/react-formio-stores";
64
64
  ```
65
65
 
66
+ ## Migrate to v3
67
+
68
+ - `@tsed/react-formio` is now build only for ESM environment.
69
+ - `@tsed/react-formio` use tree-shaking to reduce the bundle size, you have to import only what you need from the library.
70
+ - `@tsed/react-formio` drop the support of TailwindCSS v2.
71
+
72
+ Example:
73
+
74
+ ```diff
75
+ - import { Form } from "@tsed/react-formio";
76
+ + import { Form } from "@tsed/react-formio/organisms/form/Form";
77
+ ```
78
+
66
79
  ## Install
67
80
 
68
81
  `@tsed/react-formio` can be used on the server, or bundled for the client using an
@@ -91,7 +104,7 @@ function App() {
91
104
  export default App;
92
105
  ```
93
106
 
94
- See more on http://formio.tsed.dev/?path=/docs/getting-started--docs
107
+ See more on http://formio.tsed.io/?path=/docs/getting-started--docs
95
108
 
96
109
  ## Contributors
97
110
 
@@ -0,0 +1,124 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+ import Template from "@tsed/tailwind-formio";
3
+
4
+ import { Icon } from "./Icon";
5
+
6
+ /**
7
+ * Icon component to display icons based on [BxIcons](https://boxicons.com/).
8
+ *
9
+ * ## Usage
10
+ *
11
+ * ```ts
12
+ * import {Icon} from "@tsed/react-formio/atoms/icon/Icon";
13
+ * ```
14
+ *
15
+ * ## Override Icon
16
+ *
17
+ * This component is registered with the name `Icon` and can be overridden with the following code:
18
+ *
19
+ * ```ts
20
+ * registerComponent("Icon", MyIconComponent);
21
+ * ```
22
+ */
23
+ export default {
24
+ title: "Icon",
25
+ component: Icon,
26
+ argTypes: {
27
+ name: {
28
+ control: "text"
29
+ }
30
+ },
31
+ parameters: {
32
+ children: "Text",
33
+ variant: "primary"
34
+ }
35
+ } satisfies Meta<typeof Icon>;
36
+
37
+ type Story = StoryObj<typeof Icon>;
38
+
39
+ export const Usage: Story = {
40
+ args: {
41
+ name: "save"
42
+ }
43
+ };
44
+
45
+ export const Size: Story = {
46
+ args: {
47
+ name: "save"
48
+ },
49
+ render() {
50
+ return (
51
+ <div className='flex flex-wrap gap-3'>
52
+ {["text-sm", "text-large", "text-xl", "text-3xl", "text-8xl"].map((className) => (
53
+ <div key={className} className={"flex gap-3 items-end"}>
54
+ <Icon name='save' className={className} />
55
+ </div>
56
+ ))}
57
+ </div>
58
+ );
59
+ }
60
+ };
61
+
62
+ export const Colors: Story = {
63
+ args: {
64
+ name: "save"
65
+ },
66
+ render() {
67
+ return (
68
+ <div className='flex flex-wrap gap-3'>
69
+ {["text-sm text-red-600", "text-large text-primary", "text-xl text-secondary", "text-3xl text-green-600"].map((className) => (
70
+ <div key={className} className={"flex gap-3 items-end"}>
71
+ <Icon name='save' className={className} />
72
+ </div>
73
+ ))}
74
+ </div>
75
+ );
76
+ }
77
+ };
78
+
79
+ export const Rounded: Story = {
80
+ args: {
81
+ name: "save"
82
+ },
83
+ render() {
84
+ return (
85
+ <div className='flex flex-wrap gap-3'>
86
+ {["text-sm bg-red-600", "text-large bg-primary", "text-xl bg-secondary", "text-3xl bg-green-600"].map((className) => (
87
+ <div key={className} className={"flex gap-3 items-end"}>
88
+ <Icon name='save' className={className + " rounded-full text-white p-3"} />
89
+ </div>
90
+ ))}
91
+ </div>
92
+ );
93
+ }
94
+ };
95
+ /**
96
+ * Formio needs theses icons to be displayed in the form builder and other places.
97
+ */
98
+ export const PresetsForFormio: Story = {
99
+ args: {
100
+ name: "save"
101
+ },
102
+ render() {
103
+ return (
104
+ <div className='flex flex-wrap gap-3'>
105
+ {Object.entries(Template.templates.tailwind.ICONS).map(([icon]) => (
106
+ <div key={icon} className={"flex gap-3 flex-wrap"}>
107
+ <div
108
+ className={"flex flex-col justify-center items-center space-y-3 border-1 border-gray-300 rounded-md"}
109
+ style={{
110
+ width: "100px",
111
+ height: "100px"
112
+ }}
113
+ >
114
+ <div>
115
+ <Icon name={icon} />
116
+ </div>
117
+ <span className='text-sm'>{icon}</span>
118
+ </div>
119
+ </div>
120
+ ))}
121
+ </div>
122
+ );
123
+ }
124
+ };
@@ -0,0 +1,16 @@
1
+ import cx from "classnames";
2
+ import type { HTMLAttributes } from "react";
3
+
4
+ import { registerComponent } from "../../registries/components";
5
+ import { iconClass } from "../../utils/iconClass";
6
+
7
+ export interface IconProps extends HTMLAttributes<HTMLElement> {
8
+ iconset?: string;
9
+ name: string;
10
+ }
11
+
12
+ export function Icon({ iconset, name, className, ...props }: IconProps) {
13
+ return <i {...props} className={cx(iconClass(iconset, name), className)} />;
14
+ }
15
+
16
+ registerComponent("Icon", Icon);
package/src/index.ts CHANGED
@@ -2,6 +2,7 @@ import Webform from "formiojs/Webform";
2
2
  import WebformBuilder from "formiojs/WebformBuilder";
3
3
  import Wizard from "formiojs/Wizard";
4
4
  import WizardBuilder from "formiojs/WizardBuilder";
5
+
5
6
  export {
6
7
  Webform,
7
8
  WebformBuilder,
@@ -10,11 +11,5 @@ export {
10
11
  // editFormUtils,
11
12
  };
12
13
 
13
- export * from "./components";
14
- export * from "./hooks/useTooltip";
15
14
  export * from "./interfaces";
16
- export * from "./utils/callLast";
17
- export * from "./utils/iconClass";
18
- export * from "./utils/mapPagination";
19
- export * from "./utils/stopPropagationWrapper";
20
15
  export { Components, Formio, Templates, Utils } from "formiojs";
@@ -0,0 +1,26 @@
1
+ import { FormType } from "./FormType";
2
+
3
+ export type ActionDefaultsType = {
4
+ handler: string[];
5
+ method: string[];
6
+ priority: number;
7
+ name: string;
8
+ title: string;
9
+ };
10
+
11
+ export interface ActionInfoType extends Record<string, unknown> {
12
+ name: string;
13
+ title: string;
14
+ description: string;
15
+ priority: number;
16
+ defaults: ActionDefaultsType;
17
+ }
18
+
19
+ export interface ActionType extends ActionInfoType {
20
+ _id?: string;
21
+ settingsForm: Partial<FormType>;
22
+ access?: {
23
+ handler: boolean;
24
+ method: boolean;
25
+ };
26
+ }
@@ -0,0 +1,3 @@
1
+ import { ExtendedComponentSchema } from "formiojs";
2
+
3
+ export type ComponentType = ExtendedComponentSchema;
@@ -1,4 +1,4 @@
1
- import { EventEmitter2 } from "eventemitter2";
1
+ import type { EventEmitter2 } from "eventemitter2";
2
2
 
3
3
  export interface FormOptions {
4
4
  iconset?: string;
@@ -8,4 +8,7 @@ export interface FormOptions {
8
8
  template?: string;
9
9
  saveDraft?: boolean;
10
10
  events?: EventEmitter2;
11
+ hooks?: {
12
+ customValidation?: Function;
13
+ };
11
14
  }
@@ -1,11 +1,11 @@
1
- import { ExtendedComponentSchema } from "formiojs";
1
+ import type { ComponentType } from "./ComponentType";
2
2
 
3
- export type FormSchema = {
3
+ export type FormType = {
4
4
  _id?: string;
5
5
  title?: string;
6
6
  name?: string;
7
7
  machineName?: string;
8
- components: ExtendedComponentSchema[];
8
+ components: ComponentType[];
9
9
  tags?: string[];
10
10
  action?: string;
11
11
  properties?: Record<string, any>;
@@ -1,9 +1,9 @@
1
1
  import React from "react";
2
2
 
3
- import { OperationButtonProps } from "../components/table/components/defaultOperationButton.component";
3
+ import type { OperationButtonProps } from "../molecules/table/components/DefaultOperationButton.js";
4
4
 
5
5
  export type PermissionsResolver<Data = any> = (data: Data, ctx: any) => void;
6
- export type OnClickOperation<Data = any> = (data: Data, operation: Operation) => void;
6
+ // export type OnClickOperation<Data = any> = (data: Data, operation: Operation) => void;
7
7
 
8
8
  export interface Operation<Data = any> {
9
9
  /**
@@ -1,4 +1,4 @@
1
- export interface RoleSchema extends Record<string, unknown> {
1
+ export interface RoleType extends Record<string, unknown> {
2
2
  _id?: string;
3
3
  title: string;
4
4
  admin: boolean;
@@ -0,0 +1,20 @@
1
+ import type { ComponentType } from "./ComponentType";
2
+
3
+ export type JSON = unknown | string | number | boolean | null | undefined | JSON[] | { [key: string]: JSON };
4
+
5
+ export interface SubmissionType<Data extends { [key: string]: JSON } = { [key: string]: JSON }> extends Record<string, JSON> {
6
+ _id?: string;
7
+ data: Data;
8
+ metadata?: { [key: string]: JSON };
9
+ state?: string;
10
+ }
11
+
12
+ export interface ChangedSubmission<Data extends { [key: string]: JSON } = { [key: string]: JSON }> extends SubmissionType<Data> {
13
+ data: Data;
14
+ changed?: {
15
+ component: ComponentType;
16
+ instance: any;
17
+ value: unknown;
18
+ } & Record<string, JSON>;
19
+ isValid: boolean;
20
+ }
@@ -1,8 +1,9 @@
1
- export * from "./ActionSchema";
1
+ export * from "./ActionType";
2
2
  export * from "./ColumnIdentifier";
3
+ export * from "./ComponentType";
3
4
  export * from "./FormOptions";
4
- export * from "./FormSchema";
5
+ export * from "./FormType";
5
6
  export * from "./Operation";
6
7
  export * from "./QueryOptions";
7
- export * from "./RoleSchema";
8
- export * from "./Submission";
8
+ export * from "./RoleType";
9
+ export * from "./SubmissionType";
@@ -0,0 +1,28 @@
1
+ import { writeFile } from "node:fs/promises";
2
+
3
+ import { v4 } from "uuid";
4
+
5
+ import products from "./products.json" with { type: "json" };
6
+
7
+ const result = products.map((product) => {
8
+ return {
9
+ _id: v4(),
10
+ owner: null,
11
+ roles: [],
12
+ data: {
13
+ id: product.id,
14
+ label: product.title,
15
+ description: product.description_title,
16
+ image: product.media.immersive_image,
17
+ price: product.price?.initial_price?.per_trip,
18
+ currency: product.price?.currency
19
+ },
20
+ access: [],
21
+ externalIds: [],
22
+ created: new Date().toISOString(),
23
+ modified: new Date().toISOString(),
24
+ form: "5e972ae7a1a692917cf54f9e"
25
+ };
26
+ });
27
+
28
+ await writeFile("./form-submissions.json", JSON.stringify(result, null, 2), { encoding: "utf-8" });