@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.
- package/dist/atoms/icon/Icon.d.ts +6 -0
- package/dist/atoms/icon/Icon.js +12 -0
- package/dist/atoms/icon/Icon.js.map +1 -0
- package/dist/chunks/_commonjsHelpers.js +7 -0
- package/dist/chunks/_commonjsHelpers.js.map +1 -0
- package/dist/chunks/index.js +16 -18
- package/dist/chunks/index.js.map +1 -1
- package/dist/chunks/index.module.js +56 -0
- package/dist/chunks/index.module.js.map +1 -0
- package/dist/chunks/react-select-animated.esm.js +3513 -0
- package/dist/chunks/react-select-animated.esm.js.map +1 -0
- package/dist/hooks/keyboard.constants.d.ts +38 -0
- package/dist/hooks/keyboard.constants.js +7 -0
- package/dist/hooks/keyboard.constants.js.map +1 -0
- package/dist/hooks/useKeyboardControls.d.ts +12 -0
- package/dist/hooks/useKeyboardControls.js +35 -0
- package/dist/hooks/useKeyboardControls.js.map +1 -0
- package/dist/index.d.ts +0 -6
- package/dist/index.js +12 -105
- package/dist/index.js.map +1 -1
- package/dist/interfaces/ActionType.d.ts +23 -0
- package/dist/interfaces/ActionType.js +2 -0
- package/dist/interfaces/ActionType.js.map +1 -0
- package/dist/interfaces/ComponentType.d.ts +2 -0
- package/dist/interfaces/ComponentType.js +2 -0
- package/dist/interfaces/ComponentType.js.map +1 -0
- package/dist/interfaces/FormOptions.d.ts +3 -0
- package/dist/interfaces/{FormSchema.d.ts → FormType.d.ts} +3 -3
- package/dist/interfaces/FormType.js +2 -0
- package/dist/interfaces/FormType.js.map +1 -0
- package/dist/interfaces/Operation.d.ts +13 -4
- package/dist/interfaces/{RoleSchema.d.ts → RoleType.d.ts} +1 -1
- package/dist/interfaces/RoleType.js +2 -0
- package/dist/interfaces/RoleType.js.map +1 -0
- package/dist/interfaces/SubmissionType.d.ts +29 -0
- package/dist/interfaces/SubmissionType.js +2 -0
- package/dist/interfaces/SubmissionType.js.map +1 -0
- package/dist/interfaces/index.d.ts +5 -4
- package/dist/molecules/alert/Alert.d.ts +6 -0
- package/dist/{components/alert/alert.component.js → molecules/alert/Alert.js} +10 -7
- package/dist/molecules/alert/Alert.js.map +1 -0
- package/dist/molecules/button/Button.d.ts +21 -0
- package/dist/molecules/button/Button.js +51 -0
- package/dist/molecules/button/Button.js.map +1 -0
- package/dist/molecules/card/Card.js +14 -0
- package/dist/molecules/card/Card.js.map +1 -0
- package/dist/molecules/forms/form-control/FormControl.d.ts +17 -0
- package/dist/molecules/forms/form-control/FormControl.js +51 -0
- package/dist/molecules/forms/form-control/FormControl.js.map +1 -0
- package/dist/molecules/forms/input-tags/InputTags.d.ts +2 -0
- package/dist/molecules/forms/input-tags/InputTags.interface.d.ts +7 -0
- package/dist/molecules/forms/input-tags/InputTags.interface.js +2 -0
- package/dist/molecules/forms/input-tags/InputTags.interface.js.map +1 -0
- package/dist/molecules/forms/input-tags/InputTags.js +25 -0
- package/dist/molecules/forms/input-tags/InputTags.js.map +1 -0
- package/dist/molecules/forms/input-tags/all.d.ts +2 -0
- package/dist/molecules/forms/input-tags/all.js +9 -0
- package/dist/molecules/forms/input-tags/all.js.map +1 -0
- package/dist/molecules/forms/input-tags/components/ChoicesTags.d.ts +307 -0
- package/dist/molecules/forms/input-tags/components/ChoicesTags.js +51 -0
- package/dist/molecules/forms/input-tags/components/ChoicesTags.js.map +1 -0
- package/dist/molecules/forms/input-tags/components/ReactTags.d.ts +2 -0
- package/dist/molecules/forms/input-tags/components/ReactTags.js +1937 -0
- package/dist/molecules/forms/input-tags/components/ReactTags.js.map +1 -0
- package/dist/molecules/forms/input-text/InputText.d.ts +2 -0
- package/dist/molecules/forms/input-text/InputText.interface.d.ts +4 -0
- package/dist/molecules/forms/input-text/InputText.interface.js +2 -0
- package/dist/molecules/forms/input-text/InputText.interface.js.map +1 -0
- package/dist/molecules/forms/input-text/InputText.js +54 -0
- package/dist/molecules/forms/input-text/InputText.js.map +1 -0
- package/dist/molecules/forms/select/Select.d.ts +2 -0
- package/dist/molecules/forms/select/Select.interface.d.ts +38 -0
- package/dist/molecules/forms/select/Select.interface.js +2 -0
- package/dist/molecules/forms/select/Select.interface.js.map +1 -0
- package/dist/molecules/forms/select/Select.js +16 -0
- package/dist/molecules/forms/select/Select.js.map +1 -0
- package/dist/molecules/forms/select/all.d.ts +2 -0
- package/dist/molecules/forms/select/all.js +9 -0
- package/dist/molecules/forms/select/all.js.map +1 -0
- package/dist/molecules/forms/select/components/ChoicesSelect.d.ts +7 -0
- package/dist/molecules/forms/select/components/ChoicesSelect.js +115 -0
- package/dist/molecules/forms/select/components/ChoicesSelect.js.map +1 -0
- package/dist/molecules/forms/select/components/HtmlSelect.d.ts +2 -0
- package/dist/molecules/forms/select/components/HtmlSelect.js +35 -0
- package/dist/molecules/forms/select/components/HtmlSelect.js.map +1 -0
- package/dist/molecules/forms/select/components/ReactSelect.d.ts +2 -0
- package/dist/molecules/forms/select/components/ReactSelect.js +46 -0
- package/dist/molecules/forms/select/components/ReactSelect.js.map +1 -0
- package/dist/molecules/forms/select/components/choices.template.d.ts +7 -0
- package/dist/molecules/forms/select/components/choices.template.js +9654 -0
- package/dist/molecules/forms/select/components/choices.template.js.map +1 -0
- package/dist/molecules/forms/select/hooks/useOptions.d.ts +9 -0
- package/dist/molecules/forms/select/hooks/useOptions.js +35 -0
- package/dist/molecules/forms/select/hooks/useOptions.js.map +1 -0
- package/dist/{components/loader/loader.component.d.ts → molecules/loader/Loader.d.ts} +0 -9
- package/dist/molecules/loader/Loader.js +19 -0
- package/dist/molecules/loader/Loader.js.map +1 -0
- package/dist/{components/modal/modal.component.js → molecules/modal/Modal.js} +1 -1
- package/dist/molecules/modal/Modal.js.map +1 -0
- package/dist/{components/pagination/pagination.component.d.ts → molecules/pagination/Pagination.d.ts} +6 -5
- package/dist/molecules/pagination/Pagination.js +77 -0
- package/dist/molecules/pagination/Pagination.js.map +1 -0
- package/dist/molecules/pagination/PaginationButton.d.ts +7 -0
- package/dist/molecules/pagination/PaginationButton.js +21 -0
- package/dist/molecules/pagination/PaginationButton.js.map +1 -0
- package/dist/molecules/pagination/all.d.ts +2 -0
- package/dist/molecules/pagination/all.js +12 -0
- package/dist/molecules/pagination/all.js.map +1 -0
- package/dist/molecules/pagination/utils/getPageNumbers.js.map +1 -0
- package/dist/molecules/table/Table.d.ts +17 -0
- package/dist/molecules/table/Table.js +63 -0
- package/dist/molecules/table/Table.js.map +1 -0
- package/dist/molecules/table/all.d.ts +0 -0
- package/dist/molecules/table/all.js +19 -0
- package/dist/molecules/table/all.js.map +1 -0
- package/dist/molecules/table/components/DefaultArrowSort.d.ts +5 -0
- package/dist/molecules/table/components/DefaultArrowSort.js +22 -0
- package/dist/molecules/table/components/DefaultArrowSort.js.map +1 -0
- package/dist/molecules/table/components/DefaultCell.d.ts +5 -0
- package/dist/molecules/table/components/DefaultCell.js +13 -0
- package/dist/molecules/table/components/DefaultCell.js.map +1 -0
- package/dist/molecules/table/components/DefaultCellFooter.d.ts +6 -0
- package/dist/molecules/table/components/DefaultCellFooter.js +12 -0
- package/dist/molecules/table/components/DefaultCellFooter.js.map +1 -0
- package/dist/molecules/table/components/DefaultCellHeader.d.ts +6 -0
- package/dist/molecules/table/components/DefaultCellHeader.js +30 -0
- package/dist/molecules/table/components/DefaultCellHeader.js.map +1 -0
- package/dist/molecules/table/components/DefaultCellOperations.d.ts +18 -0
- package/dist/molecules/table/components/DefaultCellOperations.js +30 -0
- package/dist/molecules/table/components/DefaultCellOperations.js.map +1 -0
- package/dist/molecules/table/components/DefaultFilter.d.ts +11 -0
- package/dist/molecules/table/components/DefaultFilter.js +15 -0
- package/dist/molecules/table/components/DefaultFilter.js.map +1 -0
- package/dist/molecules/table/components/DefaultOperationButton.d.ts +19 -0
- package/dist/molecules/table/components/DefaultOperationButton.js +30 -0
- package/dist/molecules/table/components/DefaultOperationButton.js.map +1 -0
- package/dist/molecules/table/filters/Filters.d.js +2 -0
- package/dist/molecules/table/filters/Filters.d.js.map +1 -0
- package/dist/molecules/table/filters/RangeFilter.d.ts +3 -0
- package/dist/molecules/table/filters/RangeFilter.js +42 -0
- package/dist/molecules/table/filters/RangeFilter.js.map +1 -0
- package/dist/molecules/table/filters/SelectFilter.d.ts +3 -0
- package/dist/molecules/table/filters/SelectFilter.js +35 -0
- package/dist/molecules/table/filters/SelectFilter.js.map +1 -0
- package/dist/molecules/table/filters/TextFieldFilter.d.ts +3 -0
- package/dist/molecules/table/filters/TextFieldFilter.js +27 -0
- package/dist/molecules/table/filters/TextFieldFilter.js.map +1 -0
- package/dist/molecules/table/hooks/useTable.d.ts +23 -0
- package/dist/molecules/table/hooks/useTable.js +34 -0
- package/dist/molecules/table/hooks/useTable.js.map +1 -0
- package/dist/molecules/table/hooks/useUniqValues.d.ts +5 -0
- package/dist/molecules/table/hooks/useUniqValues.js +11 -0
- package/dist/molecules/table/hooks/useUniqValues.js.map +1 -0
- package/dist/molecules/table/interfaces/extends.d.ts +14 -0
- package/dist/molecules/table/interfaces/extends.js +2 -0
- package/dist/molecules/table/interfaces/extends.js.map +1 -0
- package/dist/molecules/table/utils/mapFormToColumns.d.ts +3 -0
- package/dist/molecules/table/utils/mapFormToColumns.js +39 -0
- package/dist/molecules/table/utils/mapFormToColumns.js.map +1 -0
- package/dist/molecules/tabs/Tab.d.ts +13 -0
- package/dist/molecules/tabs/Tab.js +67 -0
- package/dist/molecules/tabs/Tab.js.map +1 -0
- package/dist/molecules/tabs/TabList.d.ts +2 -0
- package/dist/molecules/tabs/TabList.js +24 -0
- package/dist/molecules/tabs/TabList.js.map +1 -0
- package/dist/molecules/tabs/TabPanel.d.ts +9 -0
- package/dist/molecules/tabs/TabPanel.js +27 -0
- package/dist/molecules/tabs/TabPanel.js.map +1 -0
- package/dist/molecules/tabs/Tabs.d.ts +7 -0
- package/dist/molecules/tabs/Tabs.js +12 -0
- package/dist/molecules/tabs/Tabs.js.map +1 -0
- package/dist/molecules/tabs/TabsBody.d.ts +1 -0
- package/dist/molecules/tabs/TabsBody.js +10 -0
- package/dist/molecules/tabs/TabsBody.js.map +1 -0
- package/dist/molecules/tabs/TabsLegacy.d.ts +17 -0
- package/dist/molecules/tabs/TabsLegacy.js +49 -0
- package/dist/molecules/tabs/TabsLegacy.js.map +1 -0
- package/dist/molecules/tabs/all.d.ts +5 -0
- package/dist/molecules/tabs/all.js +13 -0
- package/dist/molecules/tabs/all.js.map +1 -0
- package/dist/molecules/tabs/context/TabControl.d.ts +52 -0
- package/dist/molecules/tabs/context/TabControl.js +85 -0
- package/dist/molecules/tabs/context/TabControl.js.map +1 -0
- package/dist/molecules/tabs/hooks/tabControl.d.ts +44 -0
- package/dist/molecules/tabs/hooks/tabControl.js +34 -0
- package/dist/molecules/tabs/hooks/tabControl.js.map +1 -0
- package/dist/organisms/form/Form.d.ts +22 -0
- package/dist/organisms/form/Form.js +15 -0
- package/dist/organisms/form/Form.js.map +1 -0
- package/dist/{components/form-access/formAccess.component.d.ts → organisms/form/access/FormAccess.d.ts} +2 -2
- package/dist/{components/form-access/formAccess.component.js → organisms/form/access/FormAccess.js} +4 -5
- package/dist/organisms/form/access/FormAccess.js.map +1 -0
- package/dist/organisms/form/access/FormAccess.schema.d.ts +4 -0
- package/dist/{components/form-access/formAccess.schema.js → organisms/form/access/FormAccess.schema.js} +1 -1
- package/dist/organisms/form/access/FormAccess.schema.js.map +1 -0
- package/dist/organisms/form/access/FormAccess.utils.d.ts +23 -0
- package/dist/{components/form-access/formAccess.utils.js → organisms/form/access/FormAccess.utils.js} +2 -2
- package/dist/organisms/form/access/FormAccess.utils.js.map +1 -0
- package/dist/{components/form-action/formAction.component.d.ts → organisms/form/actions/FormAction.d.ts} +4 -4
- package/dist/{components/form-action/formAction.component.js → organisms/form/actions/FormAction.js} +2 -2
- package/dist/organisms/form/actions/FormAction.js.map +1 -0
- package/dist/organisms/form/builder/FormBuilder.d.ts +7 -0
- package/dist/organisms/form/builder/FormBuilder.js +17 -0
- package/dist/organisms/form/builder/FormBuilder.js.map +1 -0
- package/dist/organisms/form/builder/FormEdit.d.ts +10 -0
- package/dist/organisms/form/builder/FormEdit.js +73 -0
- package/dist/organisms/form/builder/FormEdit.js.map +1 -0
- package/dist/organisms/form/builder/FormEdit.reducer.d.ts +10 -0
- package/dist/{components/form-edit/formEdit.reducer.js → organisms/form/builder/FormEdit.reducer.js} +1 -1
- package/dist/organisms/form/builder/FormEdit.reducer.js.map +1 -0
- package/dist/organisms/form/builder/FormEditCtas.d.ts +15 -0
- package/dist/organisms/form/builder/FormEditCtas.js +52 -0
- package/dist/organisms/form/builder/FormEditCtas.js.map +1 -0
- package/dist/organisms/form/builder/FormParameters.d.ts +24 -0
- package/dist/organisms/form/builder/FormParameters.js +84 -0
- package/dist/organisms/form/builder/FormParameters.js.map +1 -0
- package/dist/organisms/form/builder/all.d.ts +6 -0
- package/dist/organisms/form/builder/all.js +26 -0
- package/dist/organisms/form/builder/all.js.map +1 -0
- package/dist/organisms/form/builder/useFormBuilder.d.ts +28 -0
- package/dist/organisms/form/builder/useFormBuilder.js +71 -0
- package/dist/organisms/form/builder/useFormBuilder.js.map +1 -0
- package/dist/{components/form-edit/useFormEdit.hook.d.ts → organisms/form/builder/useFormEdit.d.ts} +7 -7
- package/dist/organisms/form/builder/useFormEdit.js +36 -0
- package/dist/organisms/form/builder/useFormEdit.js.map +1 -0
- package/dist/organisms/form/exports/FormExport.d.ts +5 -0
- package/dist/organisms/form/exports/FormExport.js +55 -0
- package/dist/organisms/form/exports/FormExport.js.map +1 -0
- package/dist/organisms/form/preview/FormPreview.d.ts +6 -0
- package/dist/organisms/form/preview/FormPreview.js +11 -0
- package/dist/organisms/form/preview/FormPreview.js.map +1 -0
- package/dist/{components/form-settings/formSettings.component.d.ts → organisms/form/settings/FormSettings.d.ts} +2 -2
- package/dist/{components/form-settings/formSettings.component.js → organisms/form/settings/FormSettings.js} +4 -4
- package/dist/organisms/form/settings/FormSettings.js.map +1 -0
- package/dist/organisms/form/settings/FormSettings.schema.d.ts +2 -0
- package/dist/{components/form-settings/formSettings.schema.js → organisms/form/settings/FormSettings.schema.js} +1 -1
- package/dist/organisms/form/settings/FormSettings.schema.js.map +1 -0
- package/dist/organisms/form/settings/FormSettings.utils.d.ts +8 -0
- package/dist/{components/form-settings/formSettings.utils.js → organisms/form/settings/FormSettings.utils.js} +1 -1
- package/dist/organisms/form/settings/FormSettings.utils.js.map +1 -0
- package/dist/organisms/form/types.d.ts +15 -0
- package/dist/organisms/form/types.js +2 -0
- package/dist/organisms/form/types.js.map +1 -0
- package/dist/organisms/form/useForm.d.ts +65 -0
- package/dist/organisms/form/useForm.js +776 -0
- package/dist/organisms/form/useForm.js.map +1 -0
- package/dist/{components/modal/removeModal.component.d.ts → organisms/modal/RemoveModal.d.ts} +1 -1
- package/dist/{components/modal/removeModal.component.js → organisms/modal/RemoveModal.js} +10 -10
- package/dist/organisms/modal/RemoveModal.js.map +1 -0
- package/dist/organisms/table/actions/ActionsTable.d.ts +10 -0
- package/dist/organisms/table/actions/ActionsTable.js +46 -0
- package/dist/organisms/table/actions/ActionsTable.js.map +1 -0
- package/dist/organisms/table/forms/FormsTable.d.ts +9 -0
- package/dist/organisms/table/forms/FormsTable.js +57 -0
- package/dist/organisms/table/forms/FormsTable.js.map +1 -0
- package/dist/organisms/table/forms/components/FormsCell.d.ts +5 -0
- package/dist/organisms/table/forms/components/FormsCell.js +50 -0
- package/dist/organisms/table/forms/components/FormsCell.js.map +1 -0
- package/dist/organisms/table/submissions/SubmissionsTable.d.ts +14 -0
- package/dist/organisms/table/submissions/SubmissionsTable.js +14 -0
- package/dist/organisms/table/submissions/SubmissionsTable.js.map +1 -0
- package/dist/organisms/views/FormViews.d.ts +24 -0
- package/dist/organisms/views/FormViews.js +96 -0
- package/dist/organisms/views/FormViews.js.map +1 -0
- package/dist/registries/components.d.ts +3 -0
- package/dist/registries/components.js +19 -0
- package/dist/registries/components.js.map +1 -0
- package/package.json +10 -8
- package/readme.md +27 -14
- package/src/atoms/icon/Icon.stories.tsx +124 -0
- package/src/atoms/icon/Icon.tsx +16 -0
- package/src/hooks/keyboard.constants.ts +40 -0
- package/src/hooks/useKeyboardControls.spec.tsx +208 -0
- package/src/hooks/useKeyboardControls.ts +84 -0
- package/src/index.ts +1 -6
- package/src/interfaces/ActionType.ts +26 -0
- package/src/interfaces/ComponentType.ts +3 -0
- package/src/interfaces/FormOptions.ts +4 -1
- package/src/interfaces/{FormSchema.ts → FormType.ts} +3 -3
- package/src/interfaces/Operation.ts +10 -4
- package/src/interfaces/{RoleSchema.ts → RoleType.ts} +1 -1
- package/src/interfaces/SubmissionType.ts +20 -0
- package/src/interfaces/index.ts +5 -4
- package/src/molecules/__fixtures__/build.js +28 -0
- package/src/molecules/__fixtures__/form-firstname.fixture.json +256 -0
- package/src/molecules/__fixtures__/form-schema.json +350 -0
- package/src/molecules/__fixtures__/form-submissions.json +11942 -0
- package/src/molecules/__fixtures__/form-wizard.fixture.json +2042 -0
- package/src/molecules/__fixtures__/products.json +81539 -0
- package/src/molecules/__fixtures__/useValue.hook.ts +14 -0
- package/src/{components/alert/alert.component.spec.tsx → molecules/alert/Alert.spec.tsx} +12 -14
- package/src/molecules/alert/Alert.stories.tsx +39 -0
- package/src/{components/alert/alert.component.tsx → molecules/alert/Alert.tsx} +10 -7
- package/src/molecules/button/Button.stories.tsx +106 -0
- package/src/molecules/button/Button.tsx +73 -0
- package/src/{components/card/card.component.spec.tsx → molecules/card/Card.spec.tsx} +3 -2
- package/src/{components/card/card.stories.tsx → molecules/card/Card.stories.tsx} +9 -2
- package/src/{components/card/card.component.tsx → molecules/card/Card.tsx} +4 -0
- package/src/{components/form-control/formControl.component.spec.tsx → molecules/forms/form-control/FormControl.spec.tsx} +9 -8
- package/src/molecules/forms/form-control/FormControl.stories.tsx +58 -0
- package/src/molecules/forms/form-control/FormControl.tsx +86 -0
- package/src/molecules/forms/input-tags/InputTags.interface.ts +9 -0
- package/src/molecules/forms/input-tags/InputTags.tsx +30 -0
- package/src/molecules/forms/input-tags/all.ts +6 -0
- package/src/molecules/forms/input-tags/components/ChoicesTags.stories.tsx +110 -0
- package/src/molecules/forms/input-tags/components/ChoicesTags.tsx +72 -0
- package/src/molecules/forms/input-tags/components/ReactTags.stories.tsx +140 -0
- package/src/molecules/forms/input-tags/components/ReactTags.tsx +38 -0
- package/src/molecules/forms/input-text/InputText.interface.ts +5 -0
- package/src/{components/input-text/inputText.component.spec.tsx → molecules/forms/input-text/InputText.spec.tsx} +8 -7
- package/src/molecules/forms/input-text/InputText.stories.tsx +179 -0
- package/src/molecules/forms/input-text/InputText.tsx +63 -0
- package/src/molecules/forms/select/Select.interface.ts +45 -0
- package/src/molecules/forms/select/Select.tsx +28 -0
- package/src/molecules/forms/select/all.ts +7 -0
- package/src/molecules/forms/select/components/ChoicesSelect.stories.tsx +332 -0
- package/src/molecules/forms/select/components/ChoicesSelect.tsx +159 -0
- package/src/molecules/forms/select/components/HtmlSelect.stories.tsx +305 -0
- package/src/molecules/forms/select/components/HtmlSelect.tsx +54 -0
- package/src/molecules/forms/select/components/ReactSelect.stories.tsx +287 -0
- package/src/molecules/forms/select/components/ReactSelect.tsx +60 -0
- package/src/molecules/forms/select/components/choices.template.tsx +38 -0
- package/src/molecules/forms/select/hooks/useOptions.spec.ts +154 -0
- package/src/molecules/forms/select/hooks/useOptions.ts +53 -0
- package/src/{components/loader/loader.component.spec.tsx → molecules/loader/Loader.spec.tsx} +3 -3
- package/src/molecules/loader/Loader.stories.tsx +43 -0
- package/src/{components/loader/loader.component.tsx → molecules/loader/Loader.tsx} +2 -10
- package/src/{components/modal/modal.component.spec.tsx → molecules/modal/Modal.spec.tsx} +131 -4
- package/src/molecules/modal/Modal.stories.tsx +178 -0
- package/src/{components/pagination/pagination.component.spec.tsx → molecules/pagination/Pagination.spec.tsx} +20 -14
- package/src/molecules/pagination/Pagination.stories.tsx +92 -0
- package/src/{components/pagination/pagination.component.tsx → molecules/pagination/Pagination.tsx} +34 -47
- package/src/molecules/pagination/PaginationButton.tsx +30 -0
- package/src/molecules/pagination/all.ts +3 -0
- package/src/molecules/table/Table.stories.tsx +305 -0
- package/src/molecules/table/Table.tsx +106 -0
- package/src/molecules/table/all.ts +16 -0
- package/src/molecules/table/components/DefaultArrowSort.tsx +26 -0
- package/src/molecules/table/components/DefaultCell.tsx +22 -0
- package/src/molecules/table/components/DefaultCellFooter.tsx +16 -0
- package/src/molecules/table/components/DefaultCellHeader.tsx +42 -0
- package/src/molecules/table/components/DefaultCellOperations.tsx +48 -0
- package/src/molecules/table/components/DefaultFilter.tsx +42 -0
- package/src/molecules/table/components/DefaultOperationButton.tsx +41 -0
- package/src/molecules/table/filters/Filters.d.ts +31 -0
- package/src/molecules/table/filters/RangeFilter.tsx +43 -0
- package/src/molecules/table/filters/SelectFilter.tsx +47 -0
- package/src/molecules/table/filters/TextFieldFilter.tsx +36 -0
- package/src/molecules/table/hooks/useTable.tsx +75 -0
- package/src/molecules/table/hooks/useUniqValues.tsx +10 -0
- package/src/molecules/table/interfaces/extends.ts +18 -0
- package/src/molecules/table/utils/mapFormToColumns.tsx +74 -0
- package/src/molecules/tabs/Tab.tsx +106 -0
- package/src/molecules/tabs/TabList.tsx +37 -0
- package/src/molecules/tabs/TabPanel.tsx +37 -0
- package/src/molecules/tabs/Tabs.spec.tsx +140 -0
- package/src/molecules/tabs/Tabs.stories.tsx +374 -0
- package/src/molecules/tabs/Tabs.tsx +21 -0
- package/src/molecules/tabs/TabsBody.tsx +11 -0
- package/src/molecules/tabs/TabsLegacy.stories.tsx +103 -0
- package/src/molecules/tabs/TabsLegacy.tsx +84 -0
- package/src/molecules/tabs/all.ts +5 -0
- package/src/molecules/tabs/context/TabControl.tsx +166 -0
- package/src/molecules/tabs/hooks/tabControl.spec.tsx +388 -0
- package/src/molecules/tabs/hooks/tabControl.ts +52 -0
- package/src/organisms/__fixtures__/WrapComponent.tsx +11 -0
- package/src/organisms/__fixtures__/form-actions.json +240 -0
- package/src/organisms/__fixtures__/form-firstname.fixture.json +257 -0
- package/src/organisms/__fixtures__/form-wizard.fixture.json +2042 -0
- package/src/organisms/__fixtures__/form.fixture.json +2068 -0
- package/src/organisms/__fixtures__/useEditForm.tsx +84 -0
- package/src/organisms/__fixtures__/utils.ts +74 -0
- package/src/{components/form/form.component.spec.tsx → organisms/form/Form.spec.tsx} +5 -6
- package/src/organisms/form/Form.stories.tsx +698 -0
- package/src/organisms/form/Form.tsx +29 -0
- package/src/{components/form-access/formAccess.schema.ts → organisms/form/access/FormAccess.schema.ts} +4 -6
- package/src/{components/form-access/formAccess.stories.tsx → organisms/form/access/FormAccess.stories.tsx} +8 -2
- package/src/{components/form-access/formAccess.component.tsx → organisms/form/access/FormAccess.tsx} +15 -17
- package/src/{components/form-access/formAccess.utils.spec.ts → organisms/form/access/FormAccess.utils.spec.ts} +13 -7
- package/src/{components/form-access/formAccess.utils.ts → organisms/form/access/FormAccess.utils.ts} +23 -20
- package/src/organisms/form/actions/FormAction.stories.tsx +422 -0
- package/src/{components/form-action/formAction.component.tsx → organisms/form/actions/FormAction.tsx} +7 -7
- package/src/organisms/form/builder/FormBuilder.stories.tsx +97 -0
- package/src/organisms/form/builder/FormBuilder.tsx +28 -0
- package/src/{components/form-edit/formEdit.reducer.ts → organisms/form/builder/FormEdit.reducer.ts} +6 -6
- package/src/{components/form-edit/formEdit.stories.tsx → organisms/form/builder/FormEdit.stories.tsx} +89 -43
- package/src/organisms/form/builder/FormEdit.tsx +81 -0
- package/src/organisms/form/builder/FormEditCtas.tsx +97 -0
- package/src/{components/form-edit/formParameters.component.tsx → organisms/form/builder/FormParameters.tsx} +28 -28
- package/src/organisms/form/builder/all.ts +17 -0
- package/src/organisms/form/builder/useFormBuilder.ts +143 -0
- package/src/{components/form-edit/useFormEdit.hook.ts → organisms/form/builder/useFormEdit.ts} +9 -9
- package/src/organisms/form/exports/FormExport.stories.tsx +71 -0
- package/src/organisms/form/exports/FormExport.tsx +58 -0
- package/src/organisms/form/preview/FormPreview.stories.tsx +61 -0
- package/src/organisms/form/preview/FormPreview.tsx +21 -0
- package/src/{components/form-settings/formSettings.component.spec.tsx → organisms/form/settings/FormSettings.component.spec.tsx} +2 -2
- package/src/{components/form-settings/formSettings.schema.ts → organisms/form/settings/FormSettings.schema.ts} +2 -2
- package/src/{components/form-settings/formSettings.stories.tsx → organisms/form/settings/FormSettings.stories.tsx} +10 -8
- package/src/{components/form-settings/formSettings.component.tsx → organisms/form/settings/FormSettings.tsx} +7 -8
- package/src/{components/form-settings/formSettings.utils.spec.ts → organisms/form/settings/FormSettings.utils.spec.ts} +1 -1
- package/src/{components/form-settings/formSettings.utils.ts → organisms/form/settings/FormSettings.utils.ts} +4 -4
- package/src/organisms/form/types.ts +8 -0
- package/src/organisms/form/useForm.ts +223 -0
- package/src/organisms/modal/RemoveModal.stories.tsx +59 -0
- package/src/{components/modal/removeModal.component.tsx → organisms/modal/RemoveModal.tsx} +2 -2
- package/src/{components/actions-table/actionsTable.component.spec.tsx → organisms/table/actions/ActionsTable.spec.tsx} +11 -7
- package/src/{components/actions-table/actionsTable.stories.tsx → organisms/table/actions/ActionsTable.stories.tsx} +58 -58
- package/src/{components/actions-table/actionsTable.component.tsx → organisms/table/actions/ActionsTable.tsx} +13 -20
- package/src/{components/forms-table/formsTable.stories.tsx → organisms/table/forms/FormsTable.stories.tsx} +24 -27
- package/src/organisms/table/forms/FormsTable.tsx +66 -0
- package/src/organisms/table/forms/components/FormsCell.tsx +53 -0
- package/src/organisms/table/submissions/SubmissionsTable.stories.tsx +142 -0
- package/src/organisms/table/submissions/SubmissionsTable.tsx +19 -0
- package/src/organisms/views/FormViews.stories.tsx +224 -0
- package/src/organisms/views/FormViews.tsx +146 -0
- package/src/registries/components.ts +23 -0
- package/tsconfig.app.json +1 -1
- package/tsconfig.json +3 -0
- package/tsconfig.node.json +13 -0
- package/dist/components/actions-table/actionsTable.component.d.ts +0 -10
- package/dist/components/actions-table/actionsTable.component.js +0 -53
- package/dist/components/actions-table/actionsTable.component.js.map +0 -1
- package/dist/components/alert/alert.component.d.ts +0 -5
- package/dist/components/alert/alert.component.js.map +0 -1
- package/dist/components/card/card.component.js +0 -12
- package/dist/components/card/card.component.js.map +0 -1
- package/dist/components/form/form.component.d.ts +0 -62
- package/dist/components/form/form.component.js +0 -64
- package/dist/components/form/form.component.js.map +0 -1
- package/dist/components/form/useForm.hook.d.ts +0 -59
- package/dist/components/form/useForm.hook.js +0 -64
- package/dist/components/form/useForm.hook.js.map +0 -1
- package/dist/components/form-access/formAccess.component.js.map +0 -1
- package/dist/components/form-access/formAccess.schema.d.ts +0 -5
- package/dist/components/form-access/formAccess.schema.js.map +0 -1
- package/dist/components/form-access/formAccess.utils.d.ts +0 -24
- package/dist/components/form-access/formAccess.utils.js.map +0 -1
- package/dist/components/form-action/formAction.component.js.map +0 -1
- package/dist/components/form-builder/formBuilder.component.d.ts +0 -53
- package/dist/components/form-builder/formBuilder.component.js +0 -142
- package/dist/components/form-builder/formBuilder.component.js.map +0 -1
- package/dist/components/form-control/formControl.component.d.ts +0 -14
- package/dist/components/form-control/formControl.component.js +0 -26
- package/dist/components/form-control/formControl.component.js.map +0 -1
- package/dist/components/form-edit/formCtas.component.d.ts +0 -28
- package/dist/components/form-edit/formCtas.component.js +0 -70
- package/dist/components/form-edit/formCtas.component.js.map +0 -1
- package/dist/components/form-edit/formEdit.component.d.ts +0 -18
- package/dist/components/form-edit/formEdit.component.js +0 -57
- package/dist/components/form-edit/formEdit.component.js.map +0 -1
- package/dist/components/form-edit/formEdit.reducer.d.ts +0 -10
- package/dist/components/form-edit/formEdit.reducer.js.map +0 -1
- package/dist/components/form-edit/formParameters.component.d.ts +0 -34
- package/dist/components/form-edit/formParameters.component.js +0 -92
- package/dist/components/form-edit/formParameters.component.js.map +0 -1
- package/dist/components/form-edit/useFormEdit.hook.js +0 -36
- package/dist/components/form-edit/useFormEdit.hook.js.map +0 -1
- package/dist/components/form-settings/formSettings.component.js.map +0 -1
- package/dist/components/form-settings/formSettings.schema.d.ts +0 -2
- package/dist/components/form-settings/formSettings.schema.js.map +0 -1
- package/dist/components/form-settings/formSettings.utils.d.ts +0 -8
- package/dist/components/form-settings/formSettings.utils.js.map +0 -1
- package/dist/components/forms-table/components/formCell.component.d.ts +0 -6
- package/dist/components/forms-table/components/formCell.component.js +0 -50
- package/dist/components/forms-table/components/formCell.component.js.map +0 -1
- package/dist/components/forms-table/formsTable.component.d.ts +0 -10
- package/dist/components/forms-table/formsTable.component.js +0 -29
- package/dist/components/forms-table/formsTable.component.js.map +0 -1
- package/dist/components/index.d.ts +0 -25
- package/dist/components/index.js +0 -86
- package/dist/components/index.js.map +0 -1
- package/dist/components/input-tags/inputTags.component.d.ts +0 -18
- package/dist/components/input-tags/inputTags.component.js +0 -37
- package/dist/components/input-tags/inputTags.component.js.map +0 -1
- package/dist/components/input-text/inputText.component.d.ts +0 -27
- package/dist/components/input-text/inputText.component.js +0 -70
- package/dist/components/input-text/inputText.component.js.map +0 -1
- package/dist/components/loader/loader.component.js +0 -26
- package/dist/components/loader/loader.component.js.map +0 -1
- package/dist/components/modal/modal.component.js.map +0 -1
- package/dist/components/modal/removeModal.component.js.map +0 -1
- package/dist/components/pagination/pagination.component.js +0 -87
- package/dist/components/pagination/pagination.component.js.map +0 -1
- package/dist/components/select/select.component.d.ts +0 -14
- package/dist/components/select/select.component.js +0 -60
- package/dist/components/select/select.component.js.map +0 -1
- package/dist/components/submissions-table/submissionsTable.component.d.ts +0 -6
- package/dist/components/submissions-table/submissionsTable.component.js +0 -11
- package/dist/components/submissions-table/submissionsTable.component.js.map +0 -1
- package/dist/components/table/components/defaultArrowSort.component.d.ts +0 -1
- package/dist/components/table/components/defaultArrowSort.component.js +0 -10
- package/dist/components/table/components/defaultArrowSort.component.js.map +0 -1
- package/dist/components/table/components/defaultCell.component.d.ts +0 -1
- package/dist/components/table/components/defaultCell.component.js +0 -11
- package/dist/components/table/components/defaultCell.component.js.map +0 -1
- package/dist/components/table/components/defaultCellHeader.component.d.ts +0 -5
- package/dist/components/table/components/defaultCellHeader.component.js +0 -14
- package/dist/components/table/components/defaultCellHeader.component.js.map +0 -1
- package/dist/components/table/components/defaultCellOperations.component.d.ts +0 -12
- package/dist/components/table/components/defaultCellOperations.component.js +0 -21
- package/dist/components/table/components/defaultCellOperations.component.js.map +0 -1
- package/dist/components/table/components/defaultCells.component.d.ts +0 -4
- package/dist/components/table/components/defaultCells.component.js +0 -23
- package/dist/components/table/components/defaultCells.component.js.map +0 -1
- package/dist/components/table/components/defaultOperationButton.component.d.ts +0 -15
- package/dist/components/table/components/defaultOperationButton.component.js +0 -45
- package/dist/components/table/components/defaultOperationButton.component.js.map +0 -1
- package/dist/components/table/components/defaultRow.component.d.ts +0 -12
- package/dist/components/table/components/defaultRow.component.js +0 -25
- package/dist/components/table/components/defaultRow.component.js.map +0 -1
- package/dist/components/table/components/dragNDropContainer.d.ts +0 -4
- package/dist/components/table/components/dragNDropContainer.js +0 -10
- package/dist/components/table/components/dragNDropContainer.js.map +0 -1
- package/dist/components/table/filters/defaultColumnFilter.component.d.ts +0 -5
- package/dist/components/table/filters/defaultColumnFilter.component.js +0 -32
- package/dist/components/table/filters/defaultColumnFilter.component.js.map +0 -1
- package/dist/components/table/filters/selectColumnFilter.component.d.ts +0 -10
- package/dist/components/table/filters/selectColumnFilter.component.js +0 -34
- package/dist/components/table/filters/selectColumnFilter.component.js.map +0 -1
- package/dist/components/table/filters/sliderColumnFilter.component.d.ts +0 -2
- package/dist/components/table/filters/sliderColumnFilter.component.js +0 -27
- package/dist/components/table/filters/sliderColumnFilter.component.js.map +0 -1
- package/dist/components/table/hooks/useCustomTable.hook.d.ts +0 -128
- package/dist/components/table/hooks/useCustomTable.hook.js +0 -130
- package/dist/components/table/hooks/useCustomTable.hook.js.map +0 -1
- package/dist/components/table/hooks/useDragnDropRow.hook.d.ts +0 -272
- package/dist/components/table/hooks/useDragnDropRow.hook.js +0 -40
- package/dist/components/table/hooks/useDragnDropRow.hook.js.map +0 -1
- package/dist/components/table/hooks/useOperations.hook.d.ts +0 -11
- package/dist/components/table/hooks/useOperations.hook.js +0 -25
- package/dist/components/table/hooks/useOperations.hook.js.map +0 -1
- package/dist/components/table/index.d.ts +0 -15
- package/dist/components/table/index.js +0 -35
- package/dist/components/table/index.js.map +0 -1
- package/dist/components/table/table.component.d.ts +0 -3
- package/dist/components/table/table.component.js +0 -81
- package/dist/components/table/table.component.js.map +0 -1
- package/dist/components/table/utils/getPageNumbers.js.map +0 -1
- package/dist/components/table/utils/mapFormToColumns.d.ts +0 -3
- package/dist/components/table/utils/mapFormToColumns.js +0 -23
- package/dist/components/table/utils/mapFormToColumns.js.map +0 -1
- package/dist/components/table/utils/swapElements.d.ts +0 -1
- package/dist/components/table/utils/swapElements.js +0 -5
- package/dist/components/table/utils/swapElements.js.map +0 -1
- package/dist/components/tabs/tabs.component.d.ts +0 -19
- package/dist/components/tabs/tabs.component.js +0 -72
- package/dist/components/tabs/tabs.component.js.map +0 -1
- package/dist/interfaces/ActionSchema.d.ts +0 -23
- package/dist/interfaces/ActionSchema.js +0 -2
- package/dist/interfaces/ActionSchema.js.map +0 -1
- package/dist/interfaces/FormSchema.js +0 -2
- package/dist/interfaces/FormSchema.js.map +0 -1
- package/dist/interfaces/RoleSchema.js +0 -2
- package/dist/interfaces/RoleSchema.js.map +0 -1
- package/dist/interfaces/Submission.d.ts +0 -5
- package/dist/interfaces/Submission.js +0 -2
- package/dist/interfaces/Submission.js.map +0 -1
- package/dist/utils/callLast.d.ts +0 -1
- package/dist/utils/callLast.js +0 -10
- package/dist/utils/callLast.js.map +0 -1
- package/src/components/alert/alert.stories.tsx +0 -16
- package/src/components/form/form.component.tsx +0 -72
- package/src/components/form/form.stories.tsx +0 -253
- package/src/components/form/useForm.hook.ts +0 -216
- package/src/components/form-action/formAction.stories.tsx +0 -364
- package/src/components/form-builder/formBuilder.component.tsx +0 -195
- package/src/components/form-builder/formBuilder.stories.tsx +0 -3665
- package/src/components/form-control/formControl.component.tsx +0 -58
- package/src/components/form-control/formControl.stories.tsx +0 -63
- package/src/components/form-edit/formCtas.component.tsx +0 -106
- package/src/components/form-edit/formEdit.component.tsx +0 -59
- package/src/components/forms-table/components/formCell.component.tsx +0 -47
- package/src/components/forms-table/formsTable.component.tsx +0 -40
- package/src/components/index.ts +0 -25
- package/src/components/input-tags/inputTags.component.tsx +0 -58
- package/src/components/input-tags/inputTags.stories.tsx +0 -97
- package/src/components/input-text/inputText.component.tsx +0 -85
- package/src/components/input-text/inputText.stories.tsx +0 -126
- package/src/components/loader/loader.stories.tsx +0 -16
- package/src/components/modal/modal.stories.tsx +0 -190
- package/src/components/pagination/pagination.stories.tsx +0 -40
- package/src/components/select/select.component.spec.tsx +0 -84
- package/src/components/select/select.component.tsx +0 -88
- package/src/components/select/select.stories.tsx +0 -173
- package/src/components/submissions-table/submissionsTable.component.tsx +0 -14
- package/src/components/submissions-table/submissionsTable.stories.tsx +0 -99
- package/src/components/table/components/defaultArrowSort.component.tsx +0 -10
- package/src/components/table/components/defaultCell.component.tsx +0 -13
- package/src/components/table/components/defaultCellHeader.component.tsx +0 -18
- package/src/components/table/components/defaultCellOperations.component.tsx +0 -37
- package/src/components/table/components/defaultCells.component.tsx +0 -30
- package/src/components/table/components/defaultOperationButton.component.tsx +0 -56
- package/src/components/table/components/defaultRow.component.tsx +0 -51
- package/src/components/table/components/dragNDropContainer.tsx +0 -7
- package/src/components/table/filters/defaultColumnFilter.component.spec.tsx +0 -31
- package/src/components/table/filters/defaultColumnFilter.component.tsx +0 -39
- package/src/components/table/filters/selectColumnFilter.component.spec.tsx +0 -66
- package/src/components/table/filters/selectColumnFilter.component.tsx +0 -51
- package/src/components/table/filters/sliderColumnFilter.component.tsx +0 -28
- package/src/components/table/hooks/useCustomTable.hook.tsx +0 -268
- package/src/components/table/hooks/useDragnDropRow.hook.ts +0 -80
- package/src/components/table/hooks/useOperations.hook.tsx +0 -39
- package/src/components/table/index.ts +0 -15
- package/src/components/table/table.component.tsx +0 -100
- package/src/components/table/table.stories.tsx +0 -120
- package/src/components/table/utils/mapFormToColumns.tsx +0 -33
- package/src/components/table/utils/swapElements.spec.ts +0 -7
- package/src/components/table/utils/swapElements.ts +0 -7
- package/src/components/tabs/tabs.component.spec.tsx +0 -87
- package/src/components/tabs/tabs.component.stories.tsx +0 -127
- package/src/components/tabs/tabs.component.tsx +0 -92
- package/src/interfaces/ActionSchema.ts +0 -26
- package/src/interfaces/Submission.ts +0 -5
- package/src/utils/callLast.ts +0 -12
- /package/dist/{components/card/card.component.d.ts → molecules/card/Card.d.ts} +0 -0
- /package/dist/{components/modal/modal.component.d.ts → molecules/modal/Modal.d.ts} +0 -0
- /package/dist/{components/table → molecules/pagination}/utils/getPageNumbers.d.ts +0 -0
- /package/dist/{components/table → molecules/pagination}/utils/getPageNumbers.js +0 -0
- /package/src/{components → molecules}/__fixtures__/form-actions.json +0 -0
- /package/src/{components → molecules}/__fixtures__/form.fixture.json +0 -0
- /package/src/{components/modal/modal.component.tsx → molecules/modal/Modal.tsx} +0 -0
- /package/src/{components/table → molecules/pagination}/utils/getPageNumbers.ts +0 -0
- /package/src/{components → organisms}/__fixtures__/form-schema.json +0 -0
- /package/src/{components → organisms}/__fixtures__/form-submissions.json +0 -0
- /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
package/tsconfig.json
CHANGED
|
@@ -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 +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
|