@tsed/react-formio 3.0.0-alpha.1 → 3.0.0-alpha.11

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 (626) 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 +16 -18
  7. package/dist/chunks/index.js.map +1 -1
  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/keyboard.constants.d.ts +38 -0
  13. package/dist/hooks/keyboard.constants.js +7 -0
  14. package/dist/hooks/keyboard.constants.js.map +1 -0
  15. package/dist/hooks/useKeyboardControls.d.ts +12 -0
  16. package/dist/hooks/useKeyboardControls.js +35 -0
  17. package/dist/hooks/useKeyboardControls.js.map +1 -0
  18. package/dist/index.d.ts +0 -6
  19. package/dist/index.js +12 -105
  20. package/dist/index.js.map +1 -1
  21. package/dist/interfaces/ActionType.d.ts +23 -0
  22. package/dist/interfaces/ActionType.js +2 -0
  23. package/dist/interfaces/ActionType.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 +3 -0
  28. package/dist/interfaces/{FormSchema.d.ts → FormType.d.ts} +3 -3
  29. package/dist/interfaces/FormType.js +2 -0
  30. package/dist/interfaces/FormType.js.map +1 -0
  31. package/dist/interfaces/Operation.d.ts +13 -4
  32. package/dist/interfaces/{RoleSchema.d.ts → RoleType.d.ts} +1 -1
  33. package/dist/interfaces/RoleType.js +2 -0
  34. package/dist/interfaces/RoleType.js.map +1 -0
  35. package/dist/interfaces/SubmissionType.d.ts +29 -0
  36. package/dist/interfaces/SubmissionType.js +2 -0
  37. package/dist/interfaces/SubmissionType.js.map +1 -0
  38. package/dist/interfaces/index.d.ts +5 -4
  39. package/dist/molecules/alert/Alert.d.ts +6 -0
  40. package/dist/{components/alert/alert.component.js → molecules/alert/Alert.js} +10 -7
  41. package/dist/molecules/alert/Alert.js.map +1 -0
  42. package/dist/molecules/button/Button.d.ts +21 -0
  43. package/dist/molecules/button/Button.js +51 -0
  44. package/dist/molecules/button/Button.js.map +1 -0
  45. package/dist/molecules/card/Card.js +14 -0
  46. package/dist/molecules/card/Card.js.map +1 -0
  47. package/dist/molecules/forms/form-control/FormControl.d.ts +17 -0
  48. package/dist/molecules/forms/form-control/FormControl.js +51 -0
  49. package/dist/molecules/forms/form-control/FormControl.js.map +1 -0
  50. package/dist/molecules/forms/input-tags/InputTags.d.ts +2 -0
  51. package/dist/molecules/forms/input-tags/InputTags.interface.d.ts +7 -0
  52. package/dist/molecules/forms/input-tags/InputTags.interface.js +2 -0
  53. package/dist/molecules/forms/input-tags/InputTags.interface.js.map +1 -0
  54. package/dist/molecules/forms/input-tags/InputTags.js +25 -0
  55. package/dist/molecules/forms/input-tags/InputTags.js.map +1 -0
  56. package/dist/molecules/forms/input-tags/all.d.ts +2 -0
  57. package/dist/molecules/forms/input-tags/all.js +9 -0
  58. package/dist/molecules/forms/input-tags/all.js.map +1 -0
  59. package/dist/molecules/forms/input-tags/components/ChoicesTags.d.ts +307 -0
  60. package/dist/molecules/forms/input-tags/components/ChoicesTags.js +51 -0
  61. package/dist/molecules/forms/input-tags/components/ChoicesTags.js.map +1 -0
  62. package/dist/molecules/forms/input-tags/components/ReactTags.d.ts +2 -0
  63. package/dist/molecules/forms/input-tags/components/ReactTags.js +1937 -0
  64. package/dist/molecules/forms/input-tags/components/ReactTags.js.map +1 -0
  65. package/dist/molecules/forms/input-text/InputText.d.ts +2 -0
  66. package/dist/molecules/forms/input-text/InputText.interface.d.ts +4 -0
  67. package/dist/molecules/forms/input-text/InputText.interface.js +2 -0
  68. package/dist/molecules/forms/input-text/InputText.interface.js.map +1 -0
  69. package/dist/molecules/forms/input-text/InputText.js +54 -0
  70. package/dist/molecules/forms/input-text/InputText.js.map +1 -0
  71. package/dist/molecules/forms/select/Select.d.ts +2 -0
  72. package/dist/molecules/forms/select/Select.interface.d.ts +38 -0
  73. package/dist/molecules/forms/select/Select.interface.js +2 -0
  74. package/dist/molecules/forms/select/Select.interface.js.map +1 -0
  75. package/dist/molecules/forms/select/Select.js +16 -0
  76. package/dist/molecules/forms/select/Select.js.map +1 -0
  77. package/dist/molecules/forms/select/all.d.ts +2 -0
  78. package/dist/molecules/forms/select/all.js +9 -0
  79. package/dist/molecules/forms/select/all.js.map +1 -0
  80. package/dist/molecules/forms/select/components/ChoicesSelect.d.ts +7 -0
  81. package/dist/molecules/forms/select/components/ChoicesSelect.js +115 -0
  82. package/dist/molecules/forms/select/components/ChoicesSelect.js.map +1 -0
  83. package/dist/molecules/forms/select/components/HtmlSelect.d.ts +2 -0
  84. package/dist/molecules/forms/select/components/HtmlSelect.js +35 -0
  85. package/dist/molecules/forms/select/components/HtmlSelect.js.map +1 -0
  86. package/dist/molecules/forms/select/components/ReactSelect.d.ts +2 -0
  87. package/dist/molecules/forms/select/components/ReactSelect.js +46 -0
  88. package/dist/molecules/forms/select/components/ReactSelect.js.map +1 -0
  89. package/dist/molecules/forms/select/components/choices.template.d.ts +7 -0
  90. package/dist/molecules/forms/select/components/choices.template.js +9654 -0
  91. package/dist/molecules/forms/select/components/choices.template.js.map +1 -0
  92. package/dist/molecules/forms/select/hooks/useOptions.d.ts +9 -0
  93. package/dist/molecules/forms/select/hooks/useOptions.js +35 -0
  94. package/dist/molecules/forms/select/hooks/useOptions.js.map +1 -0
  95. package/dist/{components/loader/loader.component.d.ts → molecules/loader/Loader.d.ts} +0 -9
  96. package/dist/molecules/loader/Loader.js +19 -0
  97. package/dist/molecules/loader/Loader.js.map +1 -0
  98. package/dist/{components/modal/modal.component.js → molecules/modal/Modal.js} +1 -1
  99. package/dist/molecules/modal/Modal.js.map +1 -0
  100. package/dist/{components/pagination/pagination.component.d.ts → molecules/pagination/Pagination.d.ts} +6 -5
  101. package/dist/molecules/pagination/Pagination.js +77 -0
  102. package/dist/molecules/pagination/Pagination.js.map +1 -0
  103. package/dist/molecules/pagination/PaginationButton.d.ts +7 -0
  104. package/dist/molecules/pagination/PaginationButton.js +21 -0
  105. package/dist/molecules/pagination/PaginationButton.js.map +1 -0
  106. package/dist/molecules/pagination/all.d.ts +2 -0
  107. package/dist/molecules/pagination/all.js +12 -0
  108. package/dist/molecules/pagination/all.js.map +1 -0
  109. package/dist/molecules/pagination/utils/getPageNumbers.js.map +1 -0
  110. package/dist/molecules/table/Table.d.ts +17 -0
  111. package/dist/molecules/table/Table.js +63 -0
  112. package/dist/molecules/table/Table.js.map +1 -0
  113. package/dist/molecules/table/all.d.ts +0 -0
  114. package/dist/molecules/table/all.js +19 -0
  115. package/dist/molecules/table/all.js.map +1 -0
  116. package/dist/molecules/table/components/DefaultArrowSort.d.ts +5 -0
  117. package/dist/molecules/table/components/DefaultArrowSort.js +22 -0
  118. package/dist/molecules/table/components/DefaultArrowSort.js.map +1 -0
  119. package/dist/molecules/table/components/DefaultCell.d.ts +5 -0
  120. package/dist/molecules/table/components/DefaultCell.js +13 -0
  121. package/dist/molecules/table/components/DefaultCell.js.map +1 -0
  122. package/dist/molecules/table/components/DefaultCellFooter.d.ts +6 -0
  123. package/dist/molecules/table/components/DefaultCellFooter.js +12 -0
  124. package/dist/molecules/table/components/DefaultCellFooter.js.map +1 -0
  125. package/dist/molecules/table/components/DefaultCellHeader.d.ts +6 -0
  126. package/dist/molecules/table/components/DefaultCellHeader.js +30 -0
  127. package/dist/molecules/table/components/DefaultCellHeader.js.map +1 -0
  128. package/dist/molecules/table/components/DefaultCellOperations.d.ts +18 -0
  129. package/dist/molecules/table/components/DefaultCellOperations.js +30 -0
  130. package/dist/molecules/table/components/DefaultCellOperations.js.map +1 -0
  131. package/dist/molecules/table/components/DefaultFilter.d.ts +11 -0
  132. package/dist/molecules/table/components/DefaultFilter.js +15 -0
  133. package/dist/molecules/table/components/DefaultFilter.js.map +1 -0
  134. package/dist/molecules/table/components/DefaultOperationButton.d.ts +19 -0
  135. package/dist/molecules/table/components/DefaultOperationButton.js +30 -0
  136. package/dist/molecules/table/components/DefaultOperationButton.js.map +1 -0
  137. package/dist/molecules/table/filters/Filters.d.js +2 -0
  138. package/dist/molecules/table/filters/Filters.d.js.map +1 -0
  139. package/dist/molecules/table/filters/RangeFilter.d.ts +3 -0
  140. package/dist/molecules/table/filters/RangeFilter.js +42 -0
  141. package/dist/molecules/table/filters/RangeFilter.js.map +1 -0
  142. package/dist/molecules/table/filters/SelectFilter.d.ts +3 -0
  143. package/dist/molecules/table/filters/SelectFilter.js +35 -0
  144. package/dist/molecules/table/filters/SelectFilter.js.map +1 -0
  145. package/dist/molecules/table/filters/TextFieldFilter.d.ts +3 -0
  146. package/dist/molecules/table/filters/TextFieldFilter.js +27 -0
  147. package/dist/molecules/table/filters/TextFieldFilter.js.map +1 -0
  148. package/dist/molecules/table/hooks/useTable.d.ts +23 -0
  149. package/dist/molecules/table/hooks/useTable.js +34 -0
  150. package/dist/molecules/table/hooks/useTable.js.map +1 -0
  151. package/dist/molecules/table/hooks/useUniqValues.d.ts +5 -0
  152. package/dist/molecules/table/hooks/useUniqValues.js +11 -0
  153. package/dist/molecules/table/hooks/useUniqValues.js.map +1 -0
  154. package/dist/molecules/table/interfaces/extends.d.ts +14 -0
  155. package/dist/molecules/table/interfaces/extends.js +2 -0
  156. package/dist/molecules/table/interfaces/extends.js.map +1 -0
  157. package/dist/molecules/table/utils/mapFormToColumns.d.ts +3 -0
  158. package/dist/molecules/table/utils/mapFormToColumns.js +39 -0
  159. package/dist/molecules/table/utils/mapFormToColumns.js.map +1 -0
  160. package/dist/molecules/tabs/Tab.d.ts +13 -0
  161. package/dist/molecules/tabs/Tab.js +67 -0
  162. package/dist/molecules/tabs/Tab.js.map +1 -0
  163. package/dist/molecules/tabs/TabList.d.ts +2 -0
  164. package/dist/molecules/tabs/TabList.js +24 -0
  165. package/dist/molecules/tabs/TabList.js.map +1 -0
  166. package/dist/molecules/tabs/TabPanel.d.ts +9 -0
  167. package/dist/molecules/tabs/TabPanel.js +27 -0
  168. package/dist/molecules/tabs/TabPanel.js.map +1 -0
  169. package/dist/molecules/tabs/Tabs.d.ts +7 -0
  170. package/dist/molecules/tabs/Tabs.js +12 -0
  171. package/dist/molecules/tabs/Tabs.js.map +1 -0
  172. package/dist/molecules/tabs/TabsBody.d.ts +1 -0
  173. package/dist/molecules/tabs/TabsBody.js +10 -0
  174. package/dist/molecules/tabs/TabsBody.js.map +1 -0
  175. package/dist/molecules/tabs/TabsLegacy.d.ts +17 -0
  176. package/dist/molecules/tabs/TabsLegacy.js +49 -0
  177. package/dist/molecules/tabs/TabsLegacy.js.map +1 -0
  178. package/dist/molecules/tabs/all.d.ts +5 -0
  179. package/dist/molecules/tabs/all.js +13 -0
  180. package/dist/molecules/tabs/all.js.map +1 -0
  181. package/dist/molecules/tabs/context/TabControl.d.ts +52 -0
  182. package/dist/molecules/tabs/context/TabControl.js +85 -0
  183. package/dist/molecules/tabs/context/TabControl.js.map +1 -0
  184. package/dist/molecules/tabs/hooks/tabControl.d.ts +44 -0
  185. package/dist/molecules/tabs/hooks/tabControl.js +34 -0
  186. package/dist/molecules/tabs/hooks/tabControl.js.map +1 -0
  187. package/dist/organisms/form/Form.d.ts +22 -0
  188. package/dist/organisms/form/Form.js +15 -0
  189. package/dist/organisms/form/Form.js.map +1 -0
  190. package/dist/{components/form-access/formAccess.component.d.ts → organisms/form/access/FormAccess.d.ts} +2 -2
  191. package/dist/{components/form-access/formAccess.component.js → organisms/form/access/FormAccess.js} +4 -5
  192. package/dist/organisms/form/access/FormAccess.js.map +1 -0
  193. package/dist/organisms/form/access/FormAccess.schema.d.ts +4 -0
  194. package/dist/{components/form-access/formAccess.schema.js → organisms/form/access/FormAccess.schema.js} +1 -1
  195. package/dist/organisms/form/access/FormAccess.schema.js.map +1 -0
  196. package/dist/organisms/form/access/FormAccess.utils.d.ts +23 -0
  197. package/dist/{components/form-access/formAccess.utils.js → organisms/form/access/FormAccess.utils.js} +2 -2
  198. package/dist/organisms/form/access/FormAccess.utils.js.map +1 -0
  199. package/dist/{components/form-action/formAction.component.d.ts → organisms/form/actions/FormAction.d.ts} +4 -4
  200. package/dist/{components/form-action/formAction.component.js → organisms/form/actions/FormAction.js} +2 -2
  201. package/dist/organisms/form/actions/FormAction.js.map +1 -0
  202. package/dist/organisms/form/builder/FormBuilder.d.ts +7 -0
  203. package/dist/organisms/form/builder/FormBuilder.js +17 -0
  204. package/dist/organisms/form/builder/FormBuilder.js.map +1 -0
  205. package/dist/organisms/form/builder/FormEdit.d.ts +10 -0
  206. package/dist/organisms/form/builder/FormEdit.js +73 -0
  207. package/dist/organisms/form/builder/FormEdit.js.map +1 -0
  208. package/dist/organisms/form/builder/FormEdit.reducer.d.ts +10 -0
  209. package/dist/{components/form-edit/formEdit.reducer.js → organisms/form/builder/FormEdit.reducer.js} +1 -1
  210. package/dist/organisms/form/builder/FormEdit.reducer.js.map +1 -0
  211. package/dist/organisms/form/builder/FormEditCtas.d.ts +15 -0
  212. package/dist/organisms/form/builder/FormEditCtas.js +52 -0
  213. package/dist/organisms/form/builder/FormEditCtas.js.map +1 -0
  214. package/dist/organisms/form/builder/FormParameters.d.ts +24 -0
  215. package/dist/organisms/form/builder/FormParameters.js +84 -0
  216. package/dist/organisms/form/builder/FormParameters.js.map +1 -0
  217. package/dist/organisms/form/builder/all.d.ts +6 -0
  218. package/dist/organisms/form/builder/all.js +26 -0
  219. package/dist/organisms/form/builder/all.js.map +1 -0
  220. package/dist/organisms/form/builder/useFormBuilder.d.ts +28 -0
  221. package/dist/organisms/form/builder/useFormBuilder.js +71 -0
  222. package/dist/organisms/form/builder/useFormBuilder.js.map +1 -0
  223. package/dist/{components/form-edit/useFormEdit.hook.d.ts → organisms/form/builder/useFormEdit.d.ts} +7 -7
  224. package/dist/organisms/form/builder/useFormEdit.js +36 -0
  225. package/dist/organisms/form/builder/useFormEdit.js.map +1 -0
  226. package/dist/organisms/form/exports/FormExport.d.ts +5 -0
  227. package/dist/organisms/form/exports/FormExport.js +55 -0
  228. package/dist/organisms/form/exports/FormExport.js.map +1 -0
  229. package/dist/organisms/form/preview/FormPreview.d.ts +6 -0
  230. package/dist/organisms/form/preview/FormPreview.js +11 -0
  231. package/dist/organisms/form/preview/FormPreview.js.map +1 -0
  232. package/dist/{components/form-settings/formSettings.component.d.ts → organisms/form/settings/FormSettings.d.ts} +2 -2
  233. package/dist/{components/form-settings/formSettings.component.js → organisms/form/settings/FormSettings.js} +4 -4
  234. package/dist/organisms/form/settings/FormSettings.js.map +1 -0
  235. package/dist/organisms/form/settings/FormSettings.schema.d.ts +2 -0
  236. package/dist/{components/form-settings/formSettings.schema.js → organisms/form/settings/FormSettings.schema.js} +1 -1
  237. package/dist/organisms/form/settings/FormSettings.schema.js.map +1 -0
  238. package/dist/organisms/form/settings/FormSettings.utils.d.ts +8 -0
  239. package/dist/{components/form-settings/formSettings.utils.js → organisms/form/settings/FormSettings.utils.js} +1 -1
  240. package/dist/organisms/form/settings/FormSettings.utils.js.map +1 -0
  241. package/dist/organisms/form/types.d.ts +15 -0
  242. package/dist/organisms/form/types.js +2 -0
  243. package/dist/organisms/form/types.js.map +1 -0
  244. package/dist/organisms/form/useForm.d.ts +65 -0
  245. package/dist/organisms/form/useForm.js +776 -0
  246. package/dist/organisms/form/useForm.js.map +1 -0
  247. package/dist/{components/modal/removeModal.component.d.ts → organisms/modal/RemoveModal.d.ts} +1 -1
  248. package/dist/{components/modal/removeModal.component.js → organisms/modal/RemoveModal.js} +10 -10
  249. package/dist/organisms/modal/RemoveModal.js.map +1 -0
  250. package/dist/organisms/table/actions/ActionsTable.d.ts +10 -0
  251. package/dist/organisms/table/actions/ActionsTable.js +46 -0
  252. package/dist/organisms/table/actions/ActionsTable.js.map +1 -0
  253. package/dist/organisms/table/forms/FormsTable.d.ts +9 -0
  254. package/dist/organisms/table/forms/FormsTable.js +57 -0
  255. package/dist/organisms/table/forms/FormsTable.js.map +1 -0
  256. package/dist/organisms/table/forms/components/FormsCell.d.ts +5 -0
  257. package/dist/organisms/table/forms/components/FormsCell.js +50 -0
  258. package/dist/organisms/table/forms/components/FormsCell.js.map +1 -0
  259. package/dist/organisms/table/submissions/SubmissionsTable.d.ts +14 -0
  260. package/dist/organisms/table/submissions/SubmissionsTable.js +14 -0
  261. package/dist/organisms/table/submissions/SubmissionsTable.js.map +1 -0
  262. package/dist/organisms/views/FormViews.d.ts +24 -0
  263. package/dist/organisms/views/FormViews.js +96 -0
  264. package/dist/organisms/views/FormViews.js.map +1 -0
  265. package/dist/registries/components.d.ts +3 -0
  266. package/dist/registries/components.js +19 -0
  267. package/dist/registries/components.js.map +1 -0
  268. package/package.json +10 -8
  269. package/readme.md +27 -14
  270. package/src/atoms/icon/Icon.stories.tsx +124 -0
  271. package/src/atoms/icon/Icon.tsx +16 -0
  272. package/src/hooks/keyboard.constants.ts +40 -0
  273. package/src/hooks/useKeyboardControls.spec.tsx +208 -0
  274. package/src/hooks/useKeyboardControls.ts +84 -0
  275. package/src/index.ts +1 -6
  276. package/src/interfaces/ActionType.ts +26 -0
  277. package/src/interfaces/ComponentType.ts +3 -0
  278. package/src/interfaces/FormOptions.ts +4 -1
  279. package/src/interfaces/{FormSchema.ts → FormType.ts} +3 -3
  280. package/src/interfaces/Operation.ts +10 -4
  281. package/src/interfaces/{RoleSchema.ts → RoleType.ts} +1 -1
  282. package/src/interfaces/SubmissionType.ts +20 -0
  283. package/src/interfaces/index.ts +5 -4
  284. package/src/molecules/__fixtures__/build.js +28 -0
  285. package/src/molecules/__fixtures__/form-firstname.fixture.json +256 -0
  286. package/src/molecules/__fixtures__/form-schema.json +350 -0
  287. package/src/molecules/__fixtures__/form-submissions.json +11942 -0
  288. package/src/molecules/__fixtures__/form-wizard.fixture.json +2042 -0
  289. package/src/molecules/__fixtures__/products.json +81539 -0
  290. package/src/molecules/__fixtures__/useValue.hook.ts +14 -0
  291. package/src/{components/alert/alert.component.spec.tsx → molecules/alert/Alert.spec.tsx} +12 -14
  292. package/src/molecules/alert/Alert.stories.tsx +39 -0
  293. package/src/{components/alert/alert.component.tsx → molecules/alert/Alert.tsx} +10 -7
  294. package/src/molecules/button/Button.stories.tsx +106 -0
  295. package/src/molecules/button/Button.tsx +73 -0
  296. package/src/{components/card/card.component.spec.tsx → molecules/card/Card.spec.tsx} +3 -2
  297. package/src/{components/card/card.stories.tsx → molecules/card/Card.stories.tsx} +9 -2
  298. package/src/{components/card/card.component.tsx → molecules/card/Card.tsx} +4 -0
  299. package/src/{components/form-control/formControl.component.spec.tsx → molecules/forms/form-control/FormControl.spec.tsx} +9 -8
  300. package/src/molecules/forms/form-control/FormControl.stories.tsx +58 -0
  301. package/src/molecules/forms/form-control/FormControl.tsx +86 -0
  302. package/src/molecules/forms/input-tags/InputTags.interface.ts +9 -0
  303. package/src/molecules/forms/input-tags/InputTags.tsx +30 -0
  304. package/src/molecules/forms/input-tags/all.ts +6 -0
  305. package/src/molecules/forms/input-tags/components/ChoicesTags.stories.tsx +110 -0
  306. package/src/molecules/forms/input-tags/components/ChoicesTags.tsx +72 -0
  307. package/src/molecules/forms/input-tags/components/ReactTags.stories.tsx +140 -0
  308. package/src/molecules/forms/input-tags/components/ReactTags.tsx +38 -0
  309. package/src/molecules/forms/input-text/InputText.interface.ts +5 -0
  310. package/src/{components/input-text/inputText.component.spec.tsx → molecules/forms/input-text/InputText.spec.tsx} +8 -7
  311. package/src/molecules/forms/input-text/InputText.stories.tsx +179 -0
  312. package/src/molecules/forms/input-text/InputText.tsx +63 -0
  313. package/src/molecules/forms/select/Select.interface.ts +45 -0
  314. package/src/molecules/forms/select/Select.tsx +28 -0
  315. package/src/molecules/forms/select/all.ts +7 -0
  316. package/src/molecules/forms/select/components/ChoicesSelect.stories.tsx +332 -0
  317. package/src/molecules/forms/select/components/ChoicesSelect.tsx +159 -0
  318. package/src/molecules/forms/select/components/HtmlSelect.stories.tsx +305 -0
  319. package/src/molecules/forms/select/components/HtmlSelect.tsx +54 -0
  320. package/src/molecules/forms/select/components/ReactSelect.stories.tsx +287 -0
  321. package/src/molecules/forms/select/components/ReactSelect.tsx +60 -0
  322. package/src/molecules/forms/select/components/choices.template.tsx +38 -0
  323. package/src/molecules/forms/select/hooks/useOptions.spec.ts +154 -0
  324. package/src/molecules/forms/select/hooks/useOptions.ts +53 -0
  325. package/src/{components/loader/loader.component.spec.tsx → molecules/loader/Loader.spec.tsx} +3 -3
  326. package/src/molecules/loader/Loader.stories.tsx +43 -0
  327. package/src/{components/loader/loader.component.tsx → molecules/loader/Loader.tsx} +2 -10
  328. package/src/{components/modal/modal.component.spec.tsx → molecules/modal/Modal.spec.tsx} +131 -4
  329. package/src/molecules/modal/Modal.stories.tsx +178 -0
  330. package/src/{components/pagination/pagination.component.spec.tsx → molecules/pagination/Pagination.spec.tsx} +20 -14
  331. package/src/molecules/pagination/Pagination.stories.tsx +92 -0
  332. package/src/{components/pagination/pagination.component.tsx → molecules/pagination/Pagination.tsx} +34 -47
  333. package/src/molecules/pagination/PaginationButton.tsx +30 -0
  334. package/src/molecules/pagination/all.ts +3 -0
  335. package/src/molecules/table/Table.stories.tsx +305 -0
  336. package/src/molecules/table/Table.tsx +106 -0
  337. package/src/molecules/table/all.ts +16 -0
  338. package/src/molecules/table/components/DefaultArrowSort.tsx +26 -0
  339. package/src/molecules/table/components/DefaultCell.tsx +22 -0
  340. package/src/molecules/table/components/DefaultCellFooter.tsx +16 -0
  341. package/src/molecules/table/components/DefaultCellHeader.tsx +42 -0
  342. package/src/molecules/table/components/DefaultCellOperations.tsx +48 -0
  343. package/src/molecules/table/components/DefaultFilter.tsx +42 -0
  344. package/src/molecules/table/components/DefaultOperationButton.tsx +41 -0
  345. package/src/molecules/table/filters/Filters.d.ts +31 -0
  346. package/src/molecules/table/filters/RangeFilter.tsx +43 -0
  347. package/src/molecules/table/filters/SelectFilter.tsx +47 -0
  348. package/src/molecules/table/filters/TextFieldFilter.tsx +36 -0
  349. package/src/molecules/table/hooks/useTable.tsx +75 -0
  350. package/src/molecules/table/hooks/useUniqValues.tsx +10 -0
  351. package/src/molecules/table/interfaces/extends.ts +18 -0
  352. package/src/molecules/table/utils/mapFormToColumns.tsx +74 -0
  353. package/src/molecules/tabs/Tab.tsx +106 -0
  354. package/src/molecules/tabs/TabList.tsx +37 -0
  355. package/src/molecules/tabs/TabPanel.tsx +37 -0
  356. package/src/molecules/tabs/Tabs.spec.tsx +140 -0
  357. package/src/molecules/tabs/Tabs.stories.tsx +374 -0
  358. package/src/molecules/tabs/Tabs.tsx +21 -0
  359. package/src/molecules/tabs/TabsBody.tsx +11 -0
  360. package/src/molecules/tabs/TabsLegacy.stories.tsx +103 -0
  361. package/src/molecules/tabs/TabsLegacy.tsx +84 -0
  362. package/src/molecules/tabs/all.ts +5 -0
  363. package/src/molecules/tabs/context/TabControl.tsx +166 -0
  364. package/src/molecules/tabs/hooks/tabControl.spec.tsx +388 -0
  365. package/src/molecules/tabs/hooks/tabControl.ts +52 -0
  366. package/src/organisms/__fixtures__/WrapComponent.tsx +11 -0
  367. package/src/organisms/__fixtures__/form-actions.json +240 -0
  368. package/src/organisms/__fixtures__/form-firstname.fixture.json +257 -0
  369. package/src/organisms/__fixtures__/form-wizard.fixture.json +2042 -0
  370. package/src/organisms/__fixtures__/form.fixture.json +2068 -0
  371. package/src/organisms/__fixtures__/useEditForm.tsx +84 -0
  372. package/src/organisms/__fixtures__/utils.ts +74 -0
  373. package/src/{components/form/form.component.spec.tsx → organisms/form/Form.spec.tsx} +5 -6
  374. package/src/organisms/form/Form.stories.tsx +698 -0
  375. package/src/organisms/form/Form.tsx +29 -0
  376. package/src/{components/form-access/formAccess.schema.ts → organisms/form/access/FormAccess.schema.ts} +4 -6
  377. package/src/{components/form-access/formAccess.stories.tsx → organisms/form/access/FormAccess.stories.tsx} +8 -2
  378. package/src/{components/form-access/formAccess.component.tsx → organisms/form/access/FormAccess.tsx} +15 -17
  379. package/src/{components/form-access/formAccess.utils.spec.ts → organisms/form/access/FormAccess.utils.spec.ts} +13 -7
  380. package/src/{components/form-access/formAccess.utils.ts → organisms/form/access/FormAccess.utils.ts} +23 -20
  381. package/src/organisms/form/actions/FormAction.stories.tsx +422 -0
  382. package/src/{components/form-action/formAction.component.tsx → organisms/form/actions/FormAction.tsx} +7 -7
  383. package/src/organisms/form/builder/FormBuilder.stories.tsx +97 -0
  384. package/src/organisms/form/builder/FormBuilder.tsx +28 -0
  385. package/src/{components/form-edit/formEdit.reducer.ts → organisms/form/builder/FormEdit.reducer.ts} +6 -6
  386. package/src/{components/form-edit/formEdit.stories.tsx → organisms/form/builder/FormEdit.stories.tsx} +89 -43
  387. package/src/organisms/form/builder/FormEdit.tsx +81 -0
  388. package/src/organisms/form/builder/FormEditCtas.tsx +97 -0
  389. package/src/{components/form-edit/formParameters.component.tsx → organisms/form/builder/FormParameters.tsx} +28 -28
  390. package/src/organisms/form/builder/all.ts +17 -0
  391. package/src/organisms/form/builder/useFormBuilder.ts +143 -0
  392. package/src/{components/form-edit/useFormEdit.hook.ts → organisms/form/builder/useFormEdit.ts} +9 -9
  393. package/src/organisms/form/exports/FormExport.stories.tsx +71 -0
  394. package/src/organisms/form/exports/FormExport.tsx +58 -0
  395. package/src/organisms/form/preview/FormPreview.stories.tsx +61 -0
  396. package/src/organisms/form/preview/FormPreview.tsx +21 -0
  397. package/src/{components/form-settings/formSettings.component.spec.tsx → organisms/form/settings/FormSettings.component.spec.tsx} +2 -2
  398. package/src/{components/form-settings/formSettings.schema.ts → organisms/form/settings/FormSettings.schema.ts} +2 -2
  399. package/src/{components/form-settings/formSettings.stories.tsx → organisms/form/settings/FormSettings.stories.tsx} +10 -8
  400. package/src/{components/form-settings/formSettings.component.tsx → organisms/form/settings/FormSettings.tsx} +7 -8
  401. package/src/{components/form-settings/formSettings.utils.spec.ts → organisms/form/settings/FormSettings.utils.spec.ts} +1 -1
  402. package/src/{components/form-settings/formSettings.utils.ts → organisms/form/settings/FormSettings.utils.ts} +4 -4
  403. package/src/organisms/form/types.ts +8 -0
  404. package/src/organisms/form/useForm.ts +223 -0
  405. package/src/organisms/modal/RemoveModal.stories.tsx +59 -0
  406. package/src/{components/modal/removeModal.component.tsx → organisms/modal/RemoveModal.tsx} +2 -2
  407. package/src/{components/actions-table/actionsTable.component.spec.tsx → organisms/table/actions/ActionsTable.spec.tsx} +11 -7
  408. package/src/{components/actions-table/actionsTable.stories.tsx → organisms/table/actions/ActionsTable.stories.tsx} +58 -58
  409. package/src/{components/actions-table/actionsTable.component.tsx → organisms/table/actions/ActionsTable.tsx} +13 -20
  410. package/src/{components/forms-table/formsTable.stories.tsx → organisms/table/forms/FormsTable.stories.tsx} +24 -27
  411. package/src/organisms/table/forms/FormsTable.tsx +66 -0
  412. package/src/organisms/table/forms/components/FormsCell.tsx +53 -0
  413. package/src/organisms/table/submissions/SubmissionsTable.stories.tsx +142 -0
  414. package/src/organisms/table/submissions/SubmissionsTable.tsx +19 -0
  415. package/src/organisms/views/FormViews.stories.tsx +224 -0
  416. package/src/organisms/views/FormViews.tsx +146 -0
  417. package/src/registries/components.ts +23 -0
  418. package/tsconfig.app.json +1 -1
  419. package/tsconfig.json +3 -0
  420. package/tsconfig.node.json +13 -0
  421. package/dist/components/actions-table/actionsTable.component.d.ts +0 -10
  422. package/dist/components/actions-table/actionsTable.component.js +0 -53
  423. package/dist/components/actions-table/actionsTable.component.js.map +0 -1
  424. package/dist/components/alert/alert.component.d.ts +0 -5
  425. package/dist/components/alert/alert.component.js.map +0 -1
  426. package/dist/components/card/card.component.js +0 -12
  427. package/dist/components/card/card.component.js.map +0 -1
  428. package/dist/components/form/form.component.d.ts +0 -62
  429. package/dist/components/form/form.component.js +0 -64
  430. package/dist/components/form/form.component.js.map +0 -1
  431. package/dist/components/form/useForm.hook.d.ts +0 -59
  432. package/dist/components/form/useForm.hook.js +0 -64
  433. package/dist/components/form/useForm.hook.js.map +0 -1
  434. package/dist/components/form-access/formAccess.component.js.map +0 -1
  435. package/dist/components/form-access/formAccess.schema.d.ts +0 -5
  436. package/dist/components/form-access/formAccess.schema.js.map +0 -1
  437. package/dist/components/form-access/formAccess.utils.d.ts +0 -24
  438. package/dist/components/form-access/formAccess.utils.js.map +0 -1
  439. package/dist/components/form-action/formAction.component.js.map +0 -1
  440. package/dist/components/form-builder/formBuilder.component.d.ts +0 -53
  441. package/dist/components/form-builder/formBuilder.component.js +0 -142
  442. package/dist/components/form-builder/formBuilder.component.js.map +0 -1
  443. package/dist/components/form-control/formControl.component.d.ts +0 -14
  444. package/dist/components/form-control/formControl.component.js +0 -26
  445. package/dist/components/form-control/formControl.component.js.map +0 -1
  446. package/dist/components/form-edit/formCtas.component.d.ts +0 -28
  447. package/dist/components/form-edit/formCtas.component.js +0 -70
  448. package/dist/components/form-edit/formCtas.component.js.map +0 -1
  449. package/dist/components/form-edit/formEdit.component.d.ts +0 -18
  450. package/dist/components/form-edit/formEdit.component.js +0 -57
  451. package/dist/components/form-edit/formEdit.component.js.map +0 -1
  452. package/dist/components/form-edit/formEdit.reducer.d.ts +0 -10
  453. package/dist/components/form-edit/formEdit.reducer.js.map +0 -1
  454. package/dist/components/form-edit/formParameters.component.d.ts +0 -34
  455. package/dist/components/form-edit/formParameters.component.js +0 -92
  456. package/dist/components/form-edit/formParameters.component.js.map +0 -1
  457. package/dist/components/form-edit/useFormEdit.hook.js +0 -36
  458. package/dist/components/form-edit/useFormEdit.hook.js.map +0 -1
  459. package/dist/components/form-settings/formSettings.component.js.map +0 -1
  460. package/dist/components/form-settings/formSettings.schema.d.ts +0 -2
  461. package/dist/components/form-settings/formSettings.schema.js.map +0 -1
  462. package/dist/components/form-settings/formSettings.utils.d.ts +0 -8
  463. package/dist/components/form-settings/formSettings.utils.js.map +0 -1
  464. package/dist/components/forms-table/components/formCell.component.d.ts +0 -6
  465. package/dist/components/forms-table/components/formCell.component.js +0 -50
  466. package/dist/components/forms-table/components/formCell.component.js.map +0 -1
  467. package/dist/components/forms-table/formsTable.component.d.ts +0 -10
  468. package/dist/components/forms-table/formsTable.component.js +0 -29
  469. package/dist/components/forms-table/formsTable.component.js.map +0 -1
  470. package/dist/components/index.d.ts +0 -25
  471. package/dist/components/index.js +0 -86
  472. package/dist/components/index.js.map +0 -1
  473. package/dist/components/input-tags/inputTags.component.d.ts +0 -18
  474. package/dist/components/input-tags/inputTags.component.js +0 -37
  475. package/dist/components/input-tags/inputTags.component.js.map +0 -1
  476. package/dist/components/input-text/inputText.component.d.ts +0 -27
  477. package/dist/components/input-text/inputText.component.js +0 -70
  478. package/dist/components/input-text/inputText.component.js.map +0 -1
  479. package/dist/components/loader/loader.component.js +0 -26
  480. package/dist/components/loader/loader.component.js.map +0 -1
  481. package/dist/components/modal/modal.component.js.map +0 -1
  482. package/dist/components/modal/removeModal.component.js.map +0 -1
  483. package/dist/components/pagination/pagination.component.js +0 -87
  484. package/dist/components/pagination/pagination.component.js.map +0 -1
  485. package/dist/components/select/select.component.d.ts +0 -14
  486. package/dist/components/select/select.component.js +0 -60
  487. package/dist/components/select/select.component.js.map +0 -1
  488. package/dist/components/submissions-table/submissionsTable.component.d.ts +0 -6
  489. package/dist/components/submissions-table/submissionsTable.component.js +0 -11
  490. package/dist/components/submissions-table/submissionsTable.component.js.map +0 -1
  491. package/dist/components/table/components/defaultArrowSort.component.d.ts +0 -1
  492. package/dist/components/table/components/defaultArrowSort.component.js +0 -10
  493. package/dist/components/table/components/defaultArrowSort.component.js.map +0 -1
  494. package/dist/components/table/components/defaultCell.component.d.ts +0 -1
  495. package/dist/components/table/components/defaultCell.component.js +0 -11
  496. package/dist/components/table/components/defaultCell.component.js.map +0 -1
  497. package/dist/components/table/components/defaultCellHeader.component.d.ts +0 -5
  498. package/dist/components/table/components/defaultCellHeader.component.js +0 -14
  499. package/dist/components/table/components/defaultCellHeader.component.js.map +0 -1
  500. package/dist/components/table/components/defaultCellOperations.component.d.ts +0 -12
  501. package/dist/components/table/components/defaultCellOperations.component.js +0 -21
  502. package/dist/components/table/components/defaultCellOperations.component.js.map +0 -1
  503. package/dist/components/table/components/defaultCells.component.d.ts +0 -4
  504. package/dist/components/table/components/defaultCells.component.js +0 -23
  505. package/dist/components/table/components/defaultCells.component.js.map +0 -1
  506. package/dist/components/table/components/defaultOperationButton.component.d.ts +0 -15
  507. package/dist/components/table/components/defaultOperationButton.component.js +0 -45
  508. package/dist/components/table/components/defaultOperationButton.component.js.map +0 -1
  509. package/dist/components/table/components/defaultRow.component.d.ts +0 -12
  510. package/dist/components/table/components/defaultRow.component.js +0 -25
  511. package/dist/components/table/components/defaultRow.component.js.map +0 -1
  512. package/dist/components/table/components/dragNDropContainer.d.ts +0 -4
  513. package/dist/components/table/components/dragNDropContainer.js +0 -10
  514. package/dist/components/table/components/dragNDropContainer.js.map +0 -1
  515. package/dist/components/table/filters/defaultColumnFilter.component.d.ts +0 -5
  516. package/dist/components/table/filters/defaultColumnFilter.component.js +0 -32
  517. package/dist/components/table/filters/defaultColumnFilter.component.js.map +0 -1
  518. package/dist/components/table/filters/selectColumnFilter.component.d.ts +0 -10
  519. package/dist/components/table/filters/selectColumnFilter.component.js +0 -34
  520. package/dist/components/table/filters/selectColumnFilter.component.js.map +0 -1
  521. package/dist/components/table/filters/sliderColumnFilter.component.d.ts +0 -2
  522. package/dist/components/table/filters/sliderColumnFilter.component.js +0 -27
  523. package/dist/components/table/filters/sliderColumnFilter.component.js.map +0 -1
  524. package/dist/components/table/hooks/useCustomTable.hook.d.ts +0 -128
  525. package/dist/components/table/hooks/useCustomTable.hook.js +0 -130
  526. package/dist/components/table/hooks/useCustomTable.hook.js.map +0 -1
  527. package/dist/components/table/hooks/useDragnDropRow.hook.d.ts +0 -272
  528. package/dist/components/table/hooks/useDragnDropRow.hook.js +0 -40
  529. package/dist/components/table/hooks/useDragnDropRow.hook.js.map +0 -1
  530. package/dist/components/table/hooks/useOperations.hook.d.ts +0 -11
  531. package/dist/components/table/hooks/useOperations.hook.js +0 -25
  532. package/dist/components/table/hooks/useOperations.hook.js.map +0 -1
  533. package/dist/components/table/index.d.ts +0 -15
  534. package/dist/components/table/index.js +0 -35
  535. package/dist/components/table/index.js.map +0 -1
  536. package/dist/components/table/table.component.d.ts +0 -3
  537. package/dist/components/table/table.component.js +0 -81
  538. package/dist/components/table/table.component.js.map +0 -1
  539. package/dist/components/table/utils/getPageNumbers.js.map +0 -1
  540. package/dist/components/table/utils/mapFormToColumns.d.ts +0 -3
  541. package/dist/components/table/utils/mapFormToColumns.js +0 -23
  542. package/dist/components/table/utils/mapFormToColumns.js.map +0 -1
  543. package/dist/components/table/utils/swapElements.d.ts +0 -1
  544. package/dist/components/table/utils/swapElements.js +0 -5
  545. package/dist/components/table/utils/swapElements.js.map +0 -1
  546. package/dist/components/tabs/tabs.component.d.ts +0 -19
  547. package/dist/components/tabs/tabs.component.js +0 -72
  548. package/dist/components/tabs/tabs.component.js.map +0 -1
  549. package/dist/interfaces/ActionSchema.d.ts +0 -23
  550. package/dist/interfaces/ActionSchema.js +0 -2
  551. package/dist/interfaces/ActionSchema.js.map +0 -1
  552. package/dist/interfaces/FormSchema.js +0 -2
  553. package/dist/interfaces/FormSchema.js.map +0 -1
  554. package/dist/interfaces/RoleSchema.js +0 -2
  555. package/dist/interfaces/RoleSchema.js.map +0 -1
  556. package/dist/interfaces/Submission.d.ts +0 -5
  557. package/dist/interfaces/Submission.js +0 -2
  558. package/dist/interfaces/Submission.js.map +0 -1
  559. package/dist/utils/callLast.d.ts +0 -1
  560. package/dist/utils/callLast.js +0 -10
  561. package/dist/utils/callLast.js.map +0 -1
  562. package/src/components/alert/alert.stories.tsx +0 -16
  563. package/src/components/form/form.component.tsx +0 -72
  564. package/src/components/form/form.stories.tsx +0 -253
  565. package/src/components/form/useForm.hook.ts +0 -216
  566. package/src/components/form-action/formAction.stories.tsx +0 -364
  567. package/src/components/form-builder/formBuilder.component.tsx +0 -195
  568. package/src/components/form-builder/formBuilder.stories.tsx +0 -3665
  569. package/src/components/form-control/formControl.component.tsx +0 -58
  570. package/src/components/form-control/formControl.stories.tsx +0 -63
  571. package/src/components/form-edit/formCtas.component.tsx +0 -106
  572. package/src/components/form-edit/formEdit.component.tsx +0 -59
  573. package/src/components/forms-table/components/formCell.component.tsx +0 -47
  574. package/src/components/forms-table/formsTable.component.tsx +0 -40
  575. package/src/components/index.ts +0 -25
  576. package/src/components/input-tags/inputTags.component.tsx +0 -58
  577. package/src/components/input-tags/inputTags.stories.tsx +0 -97
  578. package/src/components/input-text/inputText.component.tsx +0 -85
  579. package/src/components/input-text/inputText.stories.tsx +0 -126
  580. package/src/components/loader/loader.stories.tsx +0 -16
  581. package/src/components/modal/modal.stories.tsx +0 -190
  582. package/src/components/pagination/pagination.stories.tsx +0 -40
  583. package/src/components/select/select.component.spec.tsx +0 -84
  584. package/src/components/select/select.component.tsx +0 -88
  585. package/src/components/select/select.stories.tsx +0 -173
  586. package/src/components/submissions-table/submissionsTable.component.tsx +0 -14
  587. package/src/components/submissions-table/submissionsTable.stories.tsx +0 -99
  588. package/src/components/table/components/defaultArrowSort.component.tsx +0 -10
  589. package/src/components/table/components/defaultCell.component.tsx +0 -13
  590. package/src/components/table/components/defaultCellHeader.component.tsx +0 -18
  591. package/src/components/table/components/defaultCellOperations.component.tsx +0 -37
  592. package/src/components/table/components/defaultCells.component.tsx +0 -30
  593. package/src/components/table/components/defaultOperationButton.component.tsx +0 -56
  594. package/src/components/table/components/defaultRow.component.tsx +0 -51
  595. package/src/components/table/components/dragNDropContainer.tsx +0 -7
  596. package/src/components/table/filters/defaultColumnFilter.component.spec.tsx +0 -31
  597. package/src/components/table/filters/defaultColumnFilter.component.tsx +0 -39
  598. package/src/components/table/filters/selectColumnFilter.component.spec.tsx +0 -66
  599. package/src/components/table/filters/selectColumnFilter.component.tsx +0 -51
  600. package/src/components/table/filters/sliderColumnFilter.component.tsx +0 -28
  601. package/src/components/table/hooks/useCustomTable.hook.tsx +0 -268
  602. package/src/components/table/hooks/useDragnDropRow.hook.ts +0 -80
  603. package/src/components/table/hooks/useOperations.hook.tsx +0 -39
  604. package/src/components/table/index.ts +0 -15
  605. package/src/components/table/table.component.tsx +0 -100
  606. package/src/components/table/table.stories.tsx +0 -120
  607. package/src/components/table/utils/mapFormToColumns.tsx +0 -33
  608. package/src/components/table/utils/swapElements.spec.ts +0 -7
  609. package/src/components/table/utils/swapElements.ts +0 -7
  610. package/src/components/tabs/tabs.component.spec.tsx +0 -87
  611. package/src/components/tabs/tabs.component.stories.tsx +0 -127
  612. package/src/components/tabs/tabs.component.tsx +0 -92
  613. package/src/interfaces/ActionSchema.ts +0 -26
  614. package/src/interfaces/Submission.ts +0 -5
  615. package/src/utils/callLast.ts +0 -12
  616. /package/dist/{components/card/card.component.d.ts → molecules/card/Card.d.ts} +0 -0
  617. /package/dist/{components/modal/modal.component.d.ts → molecules/modal/Modal.d.ts} +0 -0
  618. /package/dist/{components/table → molecules/pagination}/utils/getPageNumbers.d.ts +0 -0
  619. /package/dist/{components/table → molecules/pagination}/utils/getPageNumbers.js +0 -0
  620. /package/src/{components → molecules}/__fixtures__/form-actions.json +0 -0
  621. /package/src/{components → molecules}/__fixtures__/form.fixture.json +0 -0
  622. /package/src/{components/modal/modal.component.tsx → molecules/modal/Modal.tsx} +0 -0
  623. /package/src/{components/table → molecules/pagination}/utils/getPageNumbers.ts +0 -0
  624. /package/src/{components → organisms}/__fixtures__/form-schema.json +0 -0
  625. /package/src/{components → organisms}/__fixtures__/form-submissions.json +0 -0
  626. /package/src/{components/actions-table → organisms/table/actions}/__fixtures__/data.json +0 -0
@@ -0,0 +1,224 @@
1
+ import "../../molecules/button/Button";
2
+ import "../../molecules/forms/input-text/InputText";
3
+ import "../../molecules/forms/select/all";
4
+ import "../../molecules/forms/form-control/FormControl";
5
+ import "../../molecules/pagination/all";
6
+ import "../../molecules/table/all";
7
+ import "../../molecules/tabs/all";
8
+ import "../../molecules/card/Card";
9
+ import "../form/builder/all";
10
+ import "../form/Form";
11
+
12
+ import { Meta, StoryObj } from "@storybook/react";
13
+
14
+ import ActionsTableStory from "../table/actions/ActionsTable.stories.js";
15
+ import SubmissionsTableStory from "../table/submissions/SubmissionsTable.stories.js";
16
+ import { FormViews } from "./FormViews.js";
17
+
18
+ /**
19
+ * FormViews component displays a tabbed interface for managing forms with tabs for editing,
20
+ * viewing submissions, previewing, managing actions, controlling access, exporting, and configuring settings.
21
+ *
22
+ * ```tsx
23
+ * import { FormViews } from "@tsed/react-formio/organisms/views/FormViews";
24
+ * ```
25
+ *
26
+ * ## Implementation
27
+ *
28
+ * ```tsx
29
+ * import type { FormType } from "../../interfaces/index.js";
30
+ * import type { Tab as DefaultTab } from "../../molecules/tabs/Tab.js";
31
+ * import type { TabList as DefaultTabList } from "../../molecules/tabs/TabList.js";
32
+ * import type { TabPanel as DefaultTabPanel } from "../../molecules/tabs/TabPanel.js";
33
+ * import type { Tabs as DefaultTabs } from "../../molecules/tabs/Tabs.js";
34
+ * import type { TabsBody as DefaultTabsBody } from "../../molecules/tabs/TabsBody.js";
35
+ * import { getComponent } from "../../registries/components.js";
36
+ * import { FormAccess, type FormAccessProps } from "../form/access/FormAccess.js";
37
+ * import { FormEdit, type FormEditProps } from "../form/builder/FormEdit.js";
38
+ * import { FormExport } from "../form/exports/FormExport.js";
39
+ * import { FormPreview } from "../form/preview/FormPreview.js";
40
+ * import { FormSettings } from "../form/settings/FormSettings.js";
41
+ * import { ActionsTable, type ActionsTableProps } from "../table/actions/ActionsTable.js";
42
+ * import { SubmissionsTable, type SubmissionsTableProps } from "../table/submissions/SubmissionsTable.js";
43
+ *
44
+ * export type FormViewsProps = {
45
+ * form: FormEditProps["form"];
46
+ * submissions: SubmissionsTableProps["data"];
47
+ * availableActions: ActionsTableProps["availableActions"];
48
+ * actions: ActionsTableProps["data"];
49
+ * roles?: FormAccessProps["roles"];
50
+ * i18n?: (key: string) => string;
51
+ * onAction: () => void;
52
+ * operations: SubmissionsTableProps["operations"];
53
+ * };
54
+ *
55
+ * export function FormViews({ form, roles, availableActions, actions, submissions, operations, i18n = (f) => f }: FormViewsProps) {
56
+ * const Tabs = getComponent<typeof DefaultTabs>("Tabs");
57
+ * const TabList = getComponent<typeof DefaultTabList>("TabList");
58
+ * const Tab = getComponent<typeof DefaultTab>("Tab");
59
+ * const TabsBody = getComponent<typeof DefaultTabsBody>("TabsBody");
60
+ * const TabPanel = getComponent<typeof DefaultTabPanel>("TabPanel");
61
+ *
62
+ * return (
63
+ * <Tabs>
64
+ * <TabList>
65
+ * <Tab value={0} icon='edit'>
66
+ * {i18n("Edit")}
67
+ * </Tab>
68
+ * <Tab value={1} icon='data'>
69
+ * {i18n("Data")}
70
+ * </Tab>
71
+ * <Tab value={2} icon='test-tube'>
72
+ * {i18n("Preview")}
73
+ * </Tab>
74
+ * <Tab value={3} icon='paper-plane'>
75
+ * {i18n("Actions")}
76
+ * </Tab>
77
+ * <Tab value={4} icon='lock'>
78
+ * {i18n("Access")}
79
+ * </Tab>
80
+ * <Tab value={5} icon='download'>
81
+ * {i18n("Export")}
82
+ * </Tab>
83
+ * <Tab value={6} icon='cog'>
84
+ * {i18n("Settings")}
85
+ * </Tab>
86
+ * </TabList>
87
+ * <TabsBody>
88
+ * <TabPanel value={0} className='p-3 border-l-1 border-b-1 border-r-1 border-gray-300'>
89
+ * <FormEdit form={form} options={{ i18n }} />
90
+ * </TabPanel>
91
+ * <TabPanel value={1}>
92
+ * <SubmissionsTable className={"border-top-0"} form={form as FormType} data={submissions} i18n={i18n} operations={operations} />
93
+ * </TabPanel>
94
+ * <TabPanel value={2}>
95
+ * <FormPreview form={form as FormType} i18n={i18n} />
96
+ * </TabPanel>
97
+ * <TabPanel value={3}>
98
+ * <ActionsTable className={"border-top-0"} availableActions={availableActions} data={actions} operations={[]} i18n={i18n} />
99
+ * </TabPanel>
100
+ * <TabPanel value={4} className='pt-3'>
101
+ * <FormAccess form={form as FormType} roles={roles} options={{ i18n }} />
102
+ * </TabPanel>
103
+ * <TabPanel value={5} className='pt-3'>
104
+ * <FormExport i18n={i18n} />
105
+ * </TabPanel>
106
+ * <TabPanel value={6} className='p-3 border-l-1 border-b-1 border-r-1 border-gray-300'>
107
+ * <FormSettings form={form as FormType} options={{}} />
108
+ * </TabPanel>
109
+ * </TabsBody>
110
+ * </Tabs>
111
+ * );
112
+ * }
113
+ * ```
114
+ */
115
+ export default {
116
+ title: "views/FormViews",
117
+ component: FormViews,
118
+ argTypes: {
119
+ form: {
120
+ description: "The form object to manage",
121
+ control: "object"
122
+ },
123
+ submissions: {
124
+ description: "Submission data to display in the Data tab",
125
+ control: "object"
126
+ },
127
+ // operations: {
128
+ // description: "Operations available for submissions",
129
+ // control: "object"
130
+ // },
131
+ roles: {
132
+ description: "Roles for access control",
133
+ control: "object"
134
+ },
135
+ i18n: {
136
+ description: "Internationalization function"
137
+ },
138
+ onAction: {
139
+ action: "onAction",
140
+ description: "Callback when an action is triggered"
141
+ }
142
+ },
143
+ parameters: {
144
+ docs: {
145
+ description: {
146
+ component:
147
+ "Component that displays a tabbed interface for managing forms with tabs for editing, viewing submissions, previewing, managing actions, controlling access, exporting, and configuring settings."
148
+ }
149
+ }
150
+ }
151
+ } satisfies Meta<typeof FormViews>;
152
+
153
+ type Story = StoryObj<typeof FormViews>;
154
+
155
+ /**
156
+ * Basic form view with a simple form
157
+ */
158
+ export const Usage: Story = {
159
+ args: {
160
+ form: SubmissionsTableStory.args.form as any,
161
+ submissions: SubmissionsTableStory.args.data as any,
162
+ // operations: SubmissionsTableStory.args.operations,
163
+ actions: ActionsTableStory.args.data as any,
164
+ roles: [
165
+ {
166
+ _id: "1",
167
+ title: "Administrator"
168
+ },
169
+ {
170
+ _id: "2",
171
+ title: "Authenticated"
172
+ },
173
+ {
174
+ _id: "3",
175
+ title: "Anonymous"
176
+ }
177
+ ],
178
+ i18n: (key: string) => key,
179
+ onAction: () => console.log("Action triggered")
180
+ }
181
+ };
182
+
183
+ /**
184
+ * Form view with translated labels
185
+ */
186
+ export const Translated: Story = {
187
+ args: {
188
+ form: SubmissionsTableStory.args.form as any,
189
+ submissions: SubmissionsTableStory.args.data as any,
190
+ // operations: SubmissionsTableStory.args.operations,
191
+ actions: ActionsTableStory.args.data as any,
192
+ roles: [
193
+ {
194
+ _id: "1",
195
+ title: "Administrator"
196
+ },
197
+ {
198
+ _id: "2",
199
+ title: "Authenticated"
200
+ },
201
+ {
202
+ _id: "3",
203
+ title: "Anonymous"
204
+ }
205
+ ],
206
+ i18n: (key: string) => {
207
+ const translations: Record<string, string> = {
208
+ Edit: "Éditer",
209
+ Data: "Données",
210
+ Preview: "Aperçu",
211
+ Actions: "Actions",
212
+ Access: "Accès",
213
+ Export: "Exporter",
214
+ Settings: "Paramètres",
215
+ "Form with First Name": "Formulaire avec prénom",
216
+ "First name": "Prénom",
217
+ "Last name": "Nom de famille",
218
+ Submit: "Soumettre"
219
+ };
220
+ return translations[key] || key;
221
+ },
222
+ onAction: () => console.log("Action triggered")
223
+ }
224
+ };
@@ -0,0 +1,146 @@
1
+ import type { FormType, JSON, PermissionsResolver } from "../../interfaces/index.js";
2
+ import type { Tab as DefaultTab } from "../../molecules/tabs/Tab.js";
3
+ import type { TabList as DefaultTabList } from "../../molecules/tabs/TabList.js";
4
+ import type { TabPanel as DefaultTabPanel } from "../../molecules/tabs/TabPanel.js";
5
+ import type { Tabs as DefaultTabs } from "../../molecules/tabs/Tabs.js";
6
+ import type { TabsBody as DefaultTabsBody } from "../../molecules/tabs/TabsBody.js";
7
+ import { getComponent } from "../../registries/components.js";
8
+ import { FormAccess, type FormAccessProps } from "../form/access/FormAccess.js";
9
+ import { FormEdit, type FormEditProps } from "../form/builder/FormEdit.js";
10
+ import { FormExport } from "../form/exports/FormExport.js";
11
+ import { FormPreview } from "../form/preview/FormPreview.js";
12
+ import { FormSettings } from "../form/settings/FormSettings.js";
13
+ import { ActionsTable, type ActionsTableProps } from "../table/actions/ActionsTable.js";
14
+ import { SubmissionsTable, type SubmissionsTableProps } from "../table/submissions/SubmissionsTable.js";
15
+
16
+ export type FormViewsProps<Data extends { [key: string]: JSON } = { [key: string]: JSON }> = {
17
+ form: FormEditProps["form"];
18
+ submissions: SubmissionsTableProps<Data>["data"];
19
+ availableActions: ActionsTableProps["availableActions"];
20
+ actions: ActionsTableProps["data"];
21
+ roles?: FormAccessProps["roles"];
22
+ i18n?: (key: string) => string;
23
+ onAction: () => void;
24
+ permissionsResolver?: PermissionsResolver<Data>;
25
+ };
26
+
27
+ function useSubmissionsOperations<Data extends { [key: string]: JSON } = { [key: string]: JSON }>(
28
+ permissionsResolver?: PermissionsResolver<Data>
29
+ ) {
30
+ return [
31
+ {
32
+ title: "Edit",
33
+ action: "submission:edit",
34
+ alias: "row",
35
+ icon: "edit",
36
+ permissionsResolver
37
+ },
38
+ {
39
+ action: "submission:delete",
40
+ icon: "trash",
41
+ buttonType: "danger",
42
+ permissionsResolver
43
+ }
44
+ ] as SubmissionsTableProps<Data>["operations"];
45
+ }
46
+
47
+ function useActionsOperations<Data extends { [key: string]: JSON } = { [key: string]: JSON }>(
48
+ permissionsResolver?: PermissionsResolver<Data>
49
+ ) {
50
+ return [
51
+ {
52
+ title: "Edit",
53
+ action: "action:edit",
54
+ alias: "row",
55
+ icon: "edit",
56
+ permissionsResolver
57
+ },
58
+ {
59
+ action: "action:delete",
60
+ icon: "trash",
61
+ buttonType: "danger",
62
+ permissionsResolver
63
+ }
64
+ ] as SubmissionsTableProps<Data>["operations"];
65
+ }
66
+
67
+ export function FormViews<Data extends { [key: string]: JSON } = { [key: string]: JSON }>({
68
+ form,
69
+ roles,
70
+ availableActions,
71
+ actions,
72
+ permissionsResolver,
73
+ submissions,
74
+ i18n = (f) => f
75
+ }: FormViewsProps<Data>) {
76
+ const Tabs = getComponent<typeof DefaultTabs>("Tabs");
77
+ const TabList = getComponent<typeof DefaultTabList>("TabList");
78
+ const Tab = getComponent<typeof DefaultTab>("Tab");
79
+ const TabsBody = getComponent<typeof DefaultTabsBody>("TabsBody");
80
+ const TabPanel = getComponent<typeof DefaultTabPanel>("TabPanel");
81
+ const submissionsOperations = useSubmissionsOperations<Data>(permissionsResolver);
82
+ const actionsOperations = useActionsOperations<any>(permissionsResolver);
83
+
84
+ return (
85
+ <Tabs>
86
+ <TabList>
87
+ <Tab value={0} icon='edit'>
88
+ {i18n("Edit")}
89
+ </Tab>
90
+ <Tab value={1} icon='data'>
91
+ {i18n("Data")}
92
+ </Tab>
93
+ <Tab value={2} icon='test-tube'>
94
+ {i18n("Preview")}
95
+ </Tab>
96
+ <Tab value={3} icon='paper-plane'>
97
+ {i18n("Actions")}
98
+ </Tab>
99
+ <Tab value={4} icon='lock'>
100
+ {i18n("Access")}
101
+ </Tab>
102
+ <Tab value={5} icon='download'>
103
+ {i18n("Export")}
104
+ </Tab>
105
+ <Tab value={6} icon='cog'>
106
+ {i18n("Settings")}
107
+ </Tab>
108
+ </TabList>
109
+ <TabsBody>
110
+ <TabPanel value={0} className='p-3 border-l-1 border-b-1 border-r-1 border-gray-300'>
111
+ <FormEdit form={form} options={{ i18n }} />
112
+ </TabPanel>
113
+ <TabPanel value={1}>
114
+ <SubmissionsTable<Data>
115
+ className={"border-top-0"}
116
+ form={form as FormType}
117
+ data={submissions}
118
+ i18n={i18n}
119
+ operations={submissionsOperations}
120
+ />
121
+ </TabPanel>
122
+ <TabPanel value={2}>
123
+ <FormPreview form={form as FormType} i18n={i18n} />
124
+ </TabPanel>
125
+ <TabPanel value={3}>
126
+ <ActionsTable
127
+ className={"border-top-0"}
128
+ availableActions={availableActions}
129
+ data={actions}
130
+ operations={actionsOperations as any}
131
+ i18n={i18n}
132
+ />
133
+ </TabPanel>
134
+ <TabPanel value={4} className='pt-3'>
135
+ <FormAccess form={form as FormType} roles={roles} options={{ i18n }} />
136
+ </TabPanel>
137
+ <TabPanel value={5} className='pt-3'>
138
+ <FormExport i18n={i18n} />
139
+ </TabPanel>
140
+ <TabPanel value={6} className='p-3 border-l-1 border-b-1 border-r-1 border-gray-300'>
141
+ <FormSettings form={form as FormType} options={{}} />
142
+ </TabPanel>
143
+ </TabsBody>
144
+ </Tabs>
145
+ );
146
+ }
@@ -0,0 +1,23 @@
1
+ export const components = new Map<string, unknown>();
2
+
3
+ export function registerComponent(type: string, component: unknown) {
4
+ components.set(type, component);
5
+ }
6
+
7
+ export function getComponent<Cmp>(type: string | string[]): Cmp {
8
+ if (Array.isArray(type)) {
9
+ for (const t of type) {
10
+ if (components.has(t)) {
11
+ return components.get(t) as unknown as Cmp;
12
+ }
13
+ }
14
+ }
15
+
16
+ const result = components.get(type as string) as unknown as Cmp;
17
+
18
+ if (!result) {
19
+ console.warn(`Missing component for ${type}`);
20
+ }
21
+
22
+ return result;
23
+ }
package/tsconfig.app.json CHANGED
@@ -6,6 +6,6 @@
6
6
  "declaration": false,
7
7
  "composite": false
8
8
  },
9
- "include": ["src/**/*.ts", "src/**/*.tsx", "vite.config.mts"],
9
+ "include": ["src/**/*.ts", "src/**/*.tsx"],
10
10
  "exclude": ["node_modules", "dist", "src/**/*.spec.ts", "src/**/*.spec.tsx"]
11
11
  }
package/tsconfig.json CHANGED
@@ -11,6 +11,9 @@
11
11
  {
12
12
  "path": "./tsconfig.app.json"
13
13
  },
14
+ {
15
+ "path": "./tsconfig.node.json"
16
+ },
14
17
  {
15
18
  "path": "./tsconfig.spec.json"
16
19
  }
@@ -0,0 +1,13 @@
1
+ {
2
+ "extends": "@tsed/typescript/tsconfig.web.json",
3
+ "compilerOptions": {
4
+ "module": "NodeNext",
5
+ "moduleResolution": "NodeNext",
6
+ "baseUrl": ".",
7
+ "noEmit": true,
8
+ "declaration": false,
9
+ "composite": false
10
+ },
11
+ "include": ["vite.config.mts"],
12
+ "exclude": ["node_modules", "dist", "src/**/*.spec.ts", "src/**/*.spec.tsx"]
13
+ }
@@ -1,10 +0,0 @@
1
- import { ActionSchema } from '../../interfaces';
2
- import { TableProps } from '../table/hooks/useCustomTable.hook';
3
- export type ActionsTableProps = Omit<TableProps<ActionSchema>, "columns"> & {
4
- onAddAction?: (actionName: string) => void;
5
- availableActions?: {
6
- label: string;
7
- value: string;
8
- }[];
9
- };
10
- export declare function ActionsTable({ disableFilters, disablePagination, availableActions, onAddAction, ...props }: ActionsTableProps): import("react/jsx-runtime").JSX.Element;
@@ -1,53 +0,0 @@
1
- import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
- import { c as p } from "../../chunks/index.js";
3
- import b from "lodash/noop";
4
- import { useState as f } from "react";
5
- import { iconClass as h } from "../../utils/iconClass.js";
6
- import { Select as v } from "../select/select.component.js";
7
- import { Table as A } from "../table/table.component.js";
8
- function k({
9
- disableFilters: n = !0,
10
- disablePagination: s = !0,
11
- availableActions: l = [],
12
- onAddAction: r = b,
13
- ...o
14
- }) {
15
- const { i18n: a = (c) => c } = o, [t, m] = f(""), d = [
16
- {
17
- Header: a("Actions"),
18
- accessor: "title",
19
- id: "title"
20
- }
21
- ];
22
- return /* @__PURE__ */ e(A, { ...o, disableFilters: n, disablePagination: s, columns: d, children: /* @__PURE__ */ i("div", { className: "pagination-group", children: [
23
- /* @__PURE__ */ e(
24
- v,
25
- {
26
- "data-testid": "action-table-select",
27
- name: "actions",
28
- value: t,
29
- choices: [{ label: a("Select an action"), value: "" }].concat(l),
30
- onChange: (c, u) => m(u)
31
- }
32
- ),
33
- /* @__PURE__ */ e("div", { className: "pl-3", children: /* @__PURE__ */ i(
34
- "button",
35
- {
36
- "data-testid": "action-table-add",
37
- disabled: t === "",
38
- className: "btn btn-success",
39
- onClick: () => t && r(t),
40
- type: "submit",
41
- children: [
42
- /* @__PURE__ */ e("i", { className: p(h(void 0, "plus"), "mr-1") }),
43
- " ",
44
- a("Add action")
45
- ]
46
- }
47
- ) })
48
- ] }) });
49
- }
50
- export {
51
- k as ActionsTable
52
- };
53
- //# sourceMappingURL=actionsTable.component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"actionsTable.component.js","sources":["../../../src/components/actions-table/actionsTable.component.tsx"],"sourcesContent":["import classnames from \"classnames\";\nimport noop from \"lodash/noop\";\nimport { useState } from \"react\";\n\nimport { ActionSchema } from \"../../interfaces\";\nimport { iconClass } from \"../../utils/iconClass\";\nimport { Select } from \"../select/select.component\";\nimport { TableProps } from \"../table/hooks/useCustomTable.hook\";\nimport { Table } from \"../table/table.component\";\n\nexport type ActionsTableProps = Omit<TableProps<ActionSchema>, \"columns\"> & {\n onAddAction?: (actionName: string) => void;\n availableActions?: { label: string; value: string }[];\n};\n\nexport function ActionsTable({\n disableFilters = true,\n disablePagination = true,\n availableActions = [],\n onAddAction = noop,\n ...props\n}: ActionsTableProps) {\n const { i18n = (f: string) => f } = props;\n const [currentAction, setAction] = useState(\"\");\n\n const columns = [\n {\n Header: i18n(\"Actions\"),\n accessor: \"title\",\n id: \"title\"\n }\n ];\n\n return (\n <Table {...props} disableFilters={disableFilters} disablePagination={disablePagination} columns={columns}>\n <div className={\"pagination-group\"}>\n <Select\n data-testid={\"action-table-select\"}\n name={\"actions\"}\n value={currentAction}\n choices={[{ label: i18n(\"Select an action\"), value: \"\" }].concat(availableActions)}\n onChange={(name: string, action: string) => setAction(action)}\n />\n <div className={\"pl-3\"}>\n <button\n data-testid={\"action-table-add\"}\n disabled={currentAction === \"\"}\n className={\"btn btn-success\"}\n onClick={() => currentAction && onAddAction(currentAction)}\n type={\"submit\"}\n >\n <i className={classnames(iconClass(undefined, \"plus\"), \"mr-1\")} /> {i18n(\"Add action\")}\n </button>\n </div>\n </div>\n </Table>\n );\n}\n"],"names":["ActionsTable","disableFilters","disablePagination","availableActions","onAddAction","noop","props","i18n","f","currentAction","setAction","useState","columns","jsx","Table","jsxs","Select","name","action","classnames","iconClass"],"mappings":";;;;;;;AAeO,SAASA,EAAa;AAAA,EAC3B,gBAAAC,IAAiB;AAAA,EACjB,mBAAAC,IAAoB;AAAA,EACpB,kBAAAC,IAAmB,CAAC;AAAA,EACpB,aAAAC,IAAcC;AAAA,EACd,GAAGC;AACL,GAAsB;AACpB,QAAM,EAAE,MAAAC,IAAO,CAACC,MAAcA,EAAM,IAAAF,GAC9B,CAACG,GAAeC,CAAS,IAAIC,EAAS,EAAE,GAExCC,IAAU;AAAA,IACd;AAAA,MACE,QAAQL,EAAK,SAAS;AAAA,MACtB,UAAU;AAAA,MACV,IAAI;AAAA,IAAA;AAAA,EAER;AAGE,SAAA,gBAAAM,EAACC,GAAO,EAAA,GAAGR,GAAO,gBAAAL,GAAgC,mBAAAC,GAAsC,SAAAU,GACtF,UAAA,gBAAAG,EAAC,OAAI,EAAA,WAAW,oBACd,UAAA;AAAA,IAAA,gBAAAF;AAAA,MAACG;AAAA,MAAA;AAAA,QACC,eAAa;AAAA,QACb,MAAM;AAAA,QACN,OAAOP;AAAA,QACP,SAAS,CAAC,EAAE,OAAOF,EAAK,kBAAkB,GAAG,OAAO,GAAI,CAAA,EAAE,OAAOJ,CAAgB;AAAA,QACjF,UAAU,CAACc,GAAcC,MAAmBR,EAAUQ,CAAM;AAAA,MAAA;AAAA,IAC9D;AAAA,IACA,gBAAAL,EAAC,OAAI,EAAA,WAAW,QACd,UAAA,gBAAAE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,eAAa;AAAA,QACb,UAAUN,MAAkB;AAAA,QAC5B,WAAW;AAAA,QACX,SAAS,MAAMA,KAAiBL,EAAYK,CAAa;AAAA,QACzD,MAAM;AAAA,QAEN,UAAA;AAAA,UAAC,gBAAAI,EAAA,KAAA,EAAE,WAAWM,EAAWC,EAAU,QAAW,MAAM,GAAG,MAAM,GAAG;AAAA,UAAE;AAAA,UAAEb,EAAK,YAAY;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,EAEzF,CAAA;AAAA,EAAA,EAAA,CACF,EACF,CAAA;AAEJ;"}
@@ -1,5 +0,0 @@
1
- export interface AlertProps {
2
- error?: any | any[];
3
- type?: string;
4
- }
5
- export declare function Alert({ error, type }: AlertProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1 +0,0 @@
1
- {"version":3,"file":"alert.component.js","sources":["../../../src/components/alert/alert.component.tsx"],"sourcesContent":["function formatError(error: any): any {\n if (typeof error === \"string\") {\n return error;\n }\n\n if (Array.isArray(error)) {\n return error.map(formatError);\n }\n\n if (Object.prototype.hasOwnProperty.call(error, \"errors\")) {\n return Object.keys(error.errors).map((key, index) => {\n const item = error.errors[key];\n return (\n <div key={index}>\n <strong>\n {item.name} ({item.path})\n </strong>{\" \"}\n - {item.message}\n </div>\n );\n });\n }\n\n // If this is a standard error.\n if (Object.prototype.hasOwnProperty.call(error, \"message\")) {\n return error.message;\n }\n\n // If this is a joy validation error.\n if (Object.prototype.hasOwnProperty.call(error, \"name\") && error.name === \"ValidationError\") {\n return error.details.map((item: any, index: number) => {\n return <div key={index}>{item.message}</div>;\n });\n }\n\n // If a conflict error occurs on a form, the form is returned.\n if (Object.prototype.hasOwnProperty.call(error, \"_id\") && Object.prototype.hasOwnProperty.call(error, \"display\")) {\n return \"Another user has saved this form already. Please reload and re-apply your changes.\";\n }\n\n return \"An error occurred. See console logs for details.\";\n}\n\nexport interface AlertProps {\n error?: any | any[];\n type?: string;\n}\n\nexport function Alert({ error, type = \"danger\" }: AlertProps) {\n if (!error || (Array.isArray(error) && !error.length)) {\n return null;\n }\n\n return (\n <div className={`alert alert-${type}`} role='alert'>\n {formatError(error)}\n </div>\n );\n}\n"],"names":["formatError","error","key","index","item","jsxs","jsx","Alert","type"],"mappings":";AAAA,SAASA,EAAYC,GAAiB;AAChC,SAAA,OAAOA,KAAU,WACZA,IAGL,MAAM,QAAQA,CAAK,IACdA,EAAM,IAAID,CAAW,IAG1B,OAAO,UAAU,eAAe,KAAKC,GAAO,QAAQ,IAC/C,OAAO,KAAKA,EAAM,MAAM,EAAE,IAAI,CAACC,GAAKC,MAAU;AAC7C,UAAAC,IAAOH,EAAM,OAAOC,CAAG;AAC7B,6BACG,OACC,EAAA,UAAA;AAAA,MAAA,gBAAAG,EAAC,UACE,EAAA,UAAA;AAAA,QAAKD,EAAA;AAAA,QAAK;AAAA,QAAGA,EAAK;AAAA,QAAK;AAAA,MAAA,GAC1B;AAAA,MAAU;AAAA,MAAI;AAAA,MACXA,EAAK;AAAA,IAAA,EAAA,GAJAD,CAKV;AAAA,EAAA,CAEH,IAIC,OAAO,UAAU,eAAe,KAAKF,GAAO,SAAS,IAChDA,EAAM,UAIX,OAAO,UAAU,eAAe,KAAKA,GAAO,MAAM,KAAKA,EAAM,SAAS,oBACjEA,EAAM,QAAQ,IAAI,CAACG,GAAWD,MAC3B,gBAAAG,EAAA,OAAA,EAAiB,UAAKF,EAAA,QAAA,GAAbD,CAAqB,CACvC,IAIC,OAAO,UAAU,eAAe,KAAKF,GAAO,KAAK,KAAK,OAAO,UAAU,eAAe,KAAKA,GAAO,SAAS,IACtG,uFAGF;AACT;AAOO,SAASM,EAAM,EAAE,OAAAN,GAAO,MAAAO,IAAO,YAAwB;AACxD,SAAA,CAACP,KAAU,MAAM,QAAQA,CAAK,KAAK,CAACA,EAAM,SACrC,OAIP,gBAAAK,EAAC,OAAI,EAAA,WAAW,eAAeE,CAAI,IAAI,MAAK,SACzC,UAAYR,EAAAC,CAAK,EACpB,CAAA;AAEJ;"}
@@ -1,12 +0,0 @@
1
- import { jsxs as s, jsx as a } from "react/jsx-runtime";
2
- import { c as d } from "../../chunks/index.js";
3
- function m({ children: r, label: c, className: e }) {
4
- return /* @__PURE__ */ s("div", { className: d("card", e), children: [
5
- /* @__PURE__ */ a("div", { className: "card-header ", children: /* @__PURE__ */ a("h4", { className: "card-title", children: c }) }),
6
- /* @__PURE__ */ a("div", { className: "card-body", role: "article", children: r })
7
- ] });
8
- }
9
- export {
10
- m as Card
11
- };
12
- //# sourceMappingURL=card.component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"card.component.js","sources":["../../../src/components/card/card.component.tsx"],"sourcesContent":["import classnames from \"classnames\";\nimport { PropsWithChildren } from \"react\";\n\nexport interface CardProps {\n label: string;\n className?: string;\n}\n\nexport function Card({ children, label, className }: PropsWithChildren<CardProps>) {\n return (\n <div className={classnames(\"card\", className)}>\n <div className={\"card-header \"}>\n <h4 className={\"card-title\"}>{label}</h4>\n </div>\n <div className={\"card-body\"} role={\"article\"}>\n {children}\n </div>\n </div>\n );\n}\n"],"names":["Card","children","label","className","classnames","jsx"],"mappings":";;AAQO,SAASA,EAAK,EAAE,UAAAC,GAAU,OAAAC,GAAO,WAAAC,KAA2C;AACjF,2BACG,OAAI,EAAA,WAAWC,EAAW,QAAQD,CAAS,GAC1C,UAAA;AAAA,IAAC,gBAAAE,EAAA,OAAA,EAAI,WAAW,gBACd,UAAA,gBAAAA,EAAC,QAAG,WAAW,cAAe,aAAM,EACtC,CAAA;AAAA,sBACC,OAAI,EAAA,WAAW,aAAa,MAAM,WAChC,UAAAJ,EACH,CAAA;AAAA,EAAA,GACF;AAEJ;"}
@@ -1,62 +0,0 @@
1
- import { default as PropTypes } from 'prop-types';
2
- import { UseFormHookProps } from './useForm.hook';
3
- export interface FormProps<Data = any> extends UseFormHookProps<Data> {
4
- name?: string;
5
- /**
6
- *
7
- */
8
- className?: string;
9
- }
10
- export declare function Form<Data = any>(props: Partial<FormProps<Data>>): import("react/jsx-runtime").JSX.Element;
11
- export declare namespace Form {
12
- var propTypes: {
13
- name: PropTypes.Requireable<string>;
14
- className: PropTypes.Requireable<string>;
15
- /**
16
- *
17
- */
18
- src: PropTypes.Requireable<string>;
19
- /**
20
- * url to fetch form
21
- */
22
- url: PropTypes.Requireable<string>;
23
- /**
24
- * Raw form object
25
- */
26
- form: PropTypes.Requireable<object>;
27
- /**
28
- * Data submission
29
- */
30
- submission: PropTypes.Requireable<object>;
31
- /**
32
- * Configuration option
33
- */
34
- options: PropTypes.Requireable<PropTypes.InferProps<{
35
- readOnly: PropTypes.Requireable<boolean>;
36
- noAlerts: PropTypes.Requireable<boolean>;
37
- i18n: PropTypes.Requireable<any>;
38
- template: PropTypes.Requireable<string>;
39
- saveDraft: PropTypes.Requireable<boolean>;
40
- hooks: PropTypes.Requireable<any>;
41
- }>>;
42
- onPrevPage: PropTypes.Requireable<(...args: any[]) => any>;
43
- onNextPage: PropTypes.Requireable<(...args: any[]) => any>;
44
- onCancel: PropTypes.Requireable<(...args: any[]) => any>;
45
- onChange: PropTypes.Requireable<(...args: any[]) => any>;
46
- onCustomEvent: PropTypes.Requireable<(...args: any[]) => any>;
47
- onComponentChange: PropTypes.Requireable<(...args: any[]) => any>;
48
- onSubmit: PropTypes.Requireable<(...args: any[]) => any>;
49
- onAsyncSubmit: PropTypes.Requireable<(...args: any[]) => any>;
50
- onSubmitDone: PropTypes.Requireable<(...args: any[]) => any>;
51
- onFormLoad: PropTypes.Requireable<(...args: any[]) => any>;
52
- onError: PropTypes.Requireable<(...args: any[]) => any>;
53
- onRender: PropTypes.Requireable<(...args: any[]) => any>;
54
- onAttach: PropTypes.Requireable<(...args: any[]) => any>;
55
- onBuild: PropTypes.Requireable<(...args: any[]) => any>;
56
- onFocus: PropTypes.Requireable<(...args: any[]) => any>;
57
- onBlur: PropTypes.Requireable<(...args: any[]) => any>;
58
- onInitialized: PropTypes.Requireable<(...args: any[]) => any>;
59
- onFormReady: PropTypes.Requireable<(...args: any[]) => any>;
60
- formioform: PropTypes.Requireable<any>;
61
- };
62
- }
@@ -1,64 +0,0 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { Components as r } from "formiojs";
3
- import m from "formiojs/components";
4
- import n from "prop-types";
5
- import { useForm as s } from "./useForm.hook.js";
6
- r.setComponents(m);
7
- function c(o) {
8
- const { element: e } = s(o);
9
- return /* @__PURE__ */ t("div", { "data-testid": `formioContainer${o.name || ""}`, ref: e, className: o.className });
10
- }
11
- c.propTypes = {
12
- name: n.string,
13
- className: n.string,
14
- /**
15
- *
16
- */
17
- src: n.string,
18
- /**
19
- * url to fetch form
20
- */
21
- url: n.string,
22
- /**
23
- * Raw form object
24
- */
25
- form: n.object,
26
- /**
27
- * Data submission
28
- */
29
- submission: n.object,
30
- /**
31
- * Configuration option
32
- */
33
- options: n.shape({
34
- readOnly: n.bool,
35
- noAlerts: n.bool,
36
- i18n: n.any,
37
- template: n.string,
38
- saveDraft: n.bool,
39
- hooks: n.any
40
- }),
41
- onPrevPage: n.func,
42
- onNextPage: n.func,
43
- onCancel: n.func,
44
- onChange: n.func,
45
- onCustomEvent: n.func,
46
- onComponentChange: n.func,
47
- onSubmit: n.func,
48
- onAsyncSubmit: n.func,
49
- onSubmitDone: n.func,
50
- onFormLoad: n.func,
51
- onError: n.func,
52
- onRender: n.func,
53
- onAttach: n.func,
54
- onBuild: n.func,
55
- onFocus: n.func,
56
- onBlur: n.func,
57
- onInitialized: n.func,
58
- onFormReady: n.func,
59
- formioform: n.any
60
- };
61
- export {
62
- c as Form
63
- };
64
- //# sourceMappingURL=form.component.js.map