@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,422 @@
|
|
|
1
|
+
import "../../../molecules/card/Card.js";
|
|
2
|
+
import "../Form.js";
|
|
3
|
+
|
|
4
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
5
|
+
|
|
6
|
+
import { FormAction } from "./FormAction.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* FormAction component displays a form for configuring form action
|
|
10
|
+
*
|
|
11
|
+
* ```tsx
|
|
12
|
+
* import {FormAction} from "@tsed/react-formio/organisms/form/action/FormAction";
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export default {
|
|
16
|
+
title: "form/action/FormAction",
|
|
17
|
+
component: FormAction,
|
|
18
|
+
argTypes: {
|
|
19
|
+
actionInfo: {
|
|
20
|
+
description: "Information about the action including defaults and settings form",
|
|
21
|
+
control: "object"
|
|
22
|
+
},
|
|
23
|
+
submission: {
|
|
24
|
+
description: "Submission data to fill the form",
|
|
25
|
+
control: "object"
|
|
26
|
+
},
|
|
27
|
+
onSubmit: {
|
|
28
|
+
action: "onSubmit",
|
|
29
|
+
description: "Callback when the form is submitted"
|
|
30
|
+
},
|
|
31
|
+
options: {
|
|
32
|
+
description: "Form options",
|
|
33
|
+
control: "object"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
parameters: {
|
|
37
|
+
docs: {
|
|
38
|
+
description: {
|
|
39
|
+
component: "Component that displays a form for configuring form actions such as save, email, webhook, etc."
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
} satisfies Meta<typeof FormAction>;
|
|
44
|
+
|
|
45
|
+
type Story = StoryObj<typeof FormAction>;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Basic save action configuration
|
|
49
|
+
*/
|
|
50
|
+
export const SaveAction: Story = {
|
|
51
|
+
args: {
|
|
52
|
+
actionInfo: {
|
|
53
|
+
name: "save",
|
|
54
|
+
title: "Save Submission",
|
|
55
|
+
description: "Saves the submission into the database.",
|
|
56
|
+
priority: 10,
|
|
57
|
+
defaults: {
|
|
58
|
+
handler: ["before"],
|
|
59
|
+
method: ["create", "update"],
|
|
60
|
+
priority: 10,
|
|
61
|
+
name: "save",
|
|
62
|
+
title: "Save Submission"
|
|
63
|
+
},
|
|
64
|
+
access: {
|
|
65
|
+
handler: false,
|
|
66
|
+
method: false
|
|
67
|
+
},
|
|
68
|
+
settingsForm: {
|
|
69
|
+
components: [
|
|
70
|
+
{
|
|
71
|
+
type: "hidden",
|
|
72
|
+
input: true,
|
|
73
|
+
key: "priority"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
type: "hidden",
|
|
77
|
+
input: true,
|
|
78
|
+
key: "name"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
type: "textfield",
|
|
82
|
+
input: true,
|
|
83
|
+
label: "Title",
|
|
84
|
+
key: "title"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
type: "fieldset",
|
|
88
|
+
input: false,
|
|
89
|
+
tree: true,
|
|
90
|
+
legend: "Action Settings",
|
|
91
|
+
components: [
|
|
92
|
+
{
|
|
93
|
+
input: false,
|
|
94
|
+
type: "container",
|
|
95
|
+
key: "settings",
|
|
96
|
+
components: [
|
|
97
|
+
{
|
|
98
|
+
type: "resourcefields",
|
|
99
|
+
key: "resource",
|
|
100
|
+
title: "Save submission to",
|
|
101
|
+
placeholder: "This form",
|
|
102
|
+
basePath: "/project/5d0797bc872fc7d140559857/form",
|
|
103
|
+
form: "62b18b10fbbba513555c6c5e",
|
|
104
|
+
required: false
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
type: "fieldset",
|
|
112
|
+
input: false,
|
|
113
|
+
tree: false,
|
|
114
|
+
key: "conditions",
|
|
115
|
+
legend: "Action Execution",
|
|
116
|
+
components: [
|
|
117
|
+
{
|
|
118
|
+
type: "select",
|
|
119
|
+
input: true,
|
|
120
|
+
key: "handler",
|
|
121
|
+
label: "Handler",
|
|
122
|
+
placeholder: "Select which handler(s) you would like to trigger",
|
|
123
|
+
dataSrc: "json",
|
|
124
|
+
data: {
|
|
125
|
+
json: '[{"name":"before","title":"Before"},{"name":"after","title":"After"}]'
|
|
126
|
+
},
|
|
127
|
+
template: "<span>{{ item.title }}</span>",
|
|
128
|
+
valueProperty: "name",
|
|
129
|
+
multiple: true
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
type: "select",
|
|
133
|
+
input: true,
|
|
134
|
+
label: "Methods",
|
|
135
|
+
key: "method",
|
|
136
|
+
placeholder: "Trigger action on method(s)",
|
|
137
|
+
dataSrc: "json",
|
|
138
|
+
data: {
|
|
139
|
+
json: '[{"name":"create","title":"Create"},{"name":"update","title":"Update"},{"name":"read","title":"Read"},{"name":"delete","title":"Delete"},{"name":"index","title":"Index"}]'
|
|
140
|
+
},
|
|
141
|
+
template: "<span>{{ item.title }}</span>",
|
|
142
|
+
valueProperty: "name",
|
|
143
|
+
multiple: true
|
|
144
|
+
}
|
|
145
|
+
]
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
type: "button",
|
|
149
|
+
input: true,
|
|
150
|
+
label: "Save Action",
|
|
151
|
+
key: "submit",
|
|
152
|
+
size: "md",
|
|
153
|
+
action: "submit",
|
|
154
|
+
disableOnInvalid: true,
|
|
155
|
+
theme: "primary"
|
|
156
|
+
}
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
options: { template: "tailwind", iconset: "bx" }
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Email action configuration
|
|
166
|
+
*/
|
|
167
|
+
export const EmailAction: Story = {
|
|
168
|
+
args: {
|
|
169
|
+
actionInfo: {
|
|
170
|
+
name: "email",
|
|
171
|
+
title: "Email",
|
|
172
|
+
description: "Sends an email when a form is submitted.",
|
|
173
|
+
priority: 0,
|
|
174
|
+
defaults: {
|
|
175
|
+
handler: ["after"],
|
|
176
|
+
method: ["create"],
|
|
177
|
+
priority: 0,
|
|
178
|
+
name: "email",
|
|
179
|
+
title: "Email"
|
|
180
|
+
},
|
|
181
|
+
access: {
|
|
182
|
+
handler: false,
|
|
183
|
+
method: false
|
|
184
|
+
},
|
|
185
|
+
settingsForm: {
|
|
186
|
+
components: [
|
|
187
|
+
{
|
|
188
|
+
type: "hidden",
|
|
189
|
+
input: true,
|
|
190
|
+
key: "priority"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
type: "hidden",
|
|
194
|
+
input: true,
|
|
195
|
+
key: "name"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
type: "textfield",
|
|
199
|
+
input: true,
|
|
200
|
+
label: "Title",
|
|
201
|
+
key: "title"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
type: "fieldset",
|
|
205
|
+
input: false,
|
|
206
|
+
tree: true,
|
|
207
|
+
legend: "Email Settings",
|
|
208
|
+
components: [
|
|
209
|
+
{
|
|
210
|
+
type: "textfield",
|
|
211
|
+
input: true,
|
|
212
|
+
label: "From",
|
|
213
|
+
key: "from",
|
|
214
|
+
placeholder: "no-reply@example.com",
|
|
215
|
+
defaultValue: "no-reply@example.com",
|
|
216
|
+
multiple: false
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
type: "textfield",
|
|
220
|
+
input: true,
|
|
221
|
+
label: "To",
|
|
222
|
+
key: "to",
|
|
223
|
+
placeholder: "user@example.com",
|
|
224
|
+
multiple: true
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
type: "textfield",
|
|
228
|
+
input: true,
|
|
229
|
+
label: "Subject",
|
|
230
|
+
key: "subject",
|
|
231
|
+
placeholder: "New submission for {{ form.title }}",
|
|
232
|
+
defaultValue: "New submission for {{ form.title }}"
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
type: "textarea",
|
|
236
|
+
input: true,
|
|
237
|
+
label: "Message",
|
|
238
|
+
key: "message",
|
|
239
|
+
placeholder: "{{ submission.data }}",
|
|
240
|
+
defaultValue: "{{ submission.data }}",
|
|
241
|
+
rows: 5
|
|
242
|
+
}
|
|
243
|
+
]
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
type: "fieldset",
|
|
247
|
+
input: false,
|
|
248
|
+
tree: false,
|
|
249
|
+
key: "conditions",
|
|
250
|
+
legend: "Action Execution",
|
|
251
|
+
components: [
|
|
252
|
+
{
|
|
253
|
+
type: "select",
|
|
254
|
+
input: true,
|
|
255
|
+
key: "handler",
|
|
256
|
+
label: "Handler",
|
|
257
|
+
placeholder: "Select which handler(s) you would like to trigger",
|
|
258
|
+
dataSrc: "json",
|
|
259
|
+
data: {
|
|
260
|
+
json: '[{"name":"before","title":"Before"},{"name":"after","title":"After"}]'
|
|
261
|
+
},
|
|
262
|
+
template: "<span>{{ item.title }}</span>",
|
|
263
|
+
valueProperty: "name",
|
|
264
|
+
multiple: true
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
type: "select",
|
|
268
|
+
input: true,
|
|
269
|
+
label: "Methods",
|
|
270
|
+
key: "method",
|
|
271
|
+
placeholder: "Trigger action on method(s)",
|
|
272
|
+
dataSrc: "json",
|
|
273
|
+
data: {
|
|
274
|
+
json: '[{"name":"create","title":"Create"},{"name":"update","title":"Update"},{"name":"read","title":"Read"},{"name":"delete","title":"Delete"},{"name":"index","title":"Index"}]'
|
|
275
|
+
},
|
|
276
|
+
template: "<span>{{ item.title }}</span>",
|
|
277
|
+
valueProperty: "name",
|
|
278
|
+
multiple: true
|
|
279
|
+
}
|
|
280
|
+
]
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
type: "button",
|
|
284
|
+
input: true,
|
|
285
|
+
label: "Save Action",
|
|
286
|
+
key: "submit",
|
|
287
|
+
size: "md",
|
|
288
|
+
action: "submit",
|
|
289
|
+
disableOnInvalid: true,
|
|
290
|
+
theme: "primary"
|
|
291
|
+
}
|
|
292
|
+
]
|
|
293
|
+
}
|
|
294
|
+
},
|
|
295
|
+
options: { template: "tailwind", iconset: "bx" }
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Webhook action configuration
|
|
301
|
+
*/
|
|
302
|
+
export const WebhookAction: Story = {
|
|
303
|
+
args: {
|
|
304
|
+
actionInfo: {
|
|
305
|
+
name: "webhook",
|
|
306
|
+
title: "Webhook",
|
|
307
|
+
description: "Sends a submission to a URL.",
|
|
308
|
+
priority: 0,
|
|
309
|
+
defaults: {
|
|
310
|
+
handler: ["after"],
|
|
311
|
+
method: ["create", "update"],
|
|
312
|
+
priority: 0,
|
|
313
|
+
name: "webhook",
|
|
314
|
+
title: "Webhook"
|
|
315
|
+
},
|
|
316
|
+
access: {
|
|
317
|
+
handler: false,
|
|
318
|
+
method: false
|
|
319
|
+
},
|
|
320
|
+
settingsForm: {
|
|
321
|
+
components: [
|
|
322
|
+
{
|
|
323
|
+
type: "hidden",
|
|
324
|
+
input: true,
|
|
325
|
+
key: "priority"
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
type: "hidden",
|
|
329
|
+
input: true,
|
|
330
|
+
key: "name"
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
type: "textfield",
|
|
334
|
+
input: true,
|
|
335
|
+
label: "Title",
|
|
336
|
+
key: "title"
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
type: "fieldset",
|
|
340
|
+
input: false,
|
|
341
|
+
tree: true,
|
|
342
|
+
legend: "Webhook Settings",
|
|
343
|
+
components: [
|
|
344
|
+
{
|
|
345
|
+
type: "textfield",
|
|
346
|
+
input: true,
|
|
347
|
+
label: "URL",
|
|
348
|
+
key: "url",
|
|
349
|
+
placeholder: "https://example.com/webhook",
|
|
350
|
+
multiple: false
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
type: "select",
|
|
354
|
+
input: true,
|
|
355
|
+
label: "Method",
|
|
356
|
+
key: "webhookMethod",
|
|
357
|
+
placeholder: "Select HTTP method",
|
|
358
|
+
dataSrc: "values",
|
|
359
|
+
data: {
|
|
360
|
+
values: [
|
|
361
|
+
{ label: "POST", value: "post" },
|
|
362
|
+
{ label: "PUT", value: "put" },
|
|
363
|
+
{ label: "PATCH", value: "patch" }
|
|
364
|
+
]
|
|
365
|
+
},
|
|
366
|
+
defaultValue: "post"
|
|
367
|
+
}
|
|
368
|
+
]
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
type: "fieldset",
|
|
372
|
+
input: false,
|
|
373
|
+
tree: false,
|
|
374
|
+
key: "conditions",
|
|
375
|
+
legend: "Action Execution",
|
|
376
|
+
components: [
|
|
377
|
+
{
|
|
378
|
+
type: "select",
|
|
379
|
+
input: true,
|
|
380
|
+
key: "handler",
|
|
381
|
+
label: "Handler",
|
|
382
|
+
placeholder: "Select which handler(s) you would like to trigger",
|
|
383
|
+
dataSrc: "json",
|
|
384
|
+
data: {
|
|
385
|
+
json: '[{"name":"before","title":"Before"},{"name":"after","title":"After"}]'
|
|
386
|
+
},
|
|
387
|
+
template: "<span>{{ item.title }}</span>",
|
|
388
|
+
valueProperty: "name",
|
|
389
|
+
multiple: true
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
type: "select",
|
|
393
|
+
input: true,
|
|
394
|
+
label: "Methods",
|
|
395
|
+
key: "method",
|
|
396
|
+
placeholder: "Trigger action on method(s)",
|
|
397
|
+
dataSrc: "json",
|
|
398
|
+
data: {
|
|
399
|
+
json: '[{"name":"create","title":"Create"},{"name":"update","title":"Update"},{"name":"read","title":"Read"},{"name":"delete","title":"Delete"},{"name":"index","title":"Index"}]'
|
|
400
|
+
},
|
|
401
|
+
template: "<span>{{ item.title }}</span>",
|
|
402
|
+
valueProperty: "name",
|
|
403
|
+
multiple: true
|
|
404
|
+
}
|
|
405
|
+
]
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
type: "button",
|
|
409
|
+
input: true,
|
|
410
|
+
label: "Save Action",
|
|
411
|
+
key: "submit",
|
|
412
|
+
size: "md",
|
|
413
|
+
action: "submit",
|
|
414
|
+
disableOnInvalid: true,
|
|
415
|
+
theme: "primary"
|
|
416
|
+
}
|
|
417
|
+
]
|
|
418
|
+
}
|
|
419
|
+
},
|
|
420
|
+
options: { template: "tailwind", iconset: "bx" }
|
|
421
|
+
}
|
|
422
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import FormioUtils from "formiojs/utils";
|
|
2
2
|
import { PropsWithChildren, ReactElement } from "react";
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
import { Form } from "
|
|
4
|
+
import { ActionDefaultsType, ActionType, FormOptions, SubmissionType } from "../../../interfaces";
|
|
5
|
+
import { Form } from "../../form/Form";
|
|
6
6
|
|
|
7
|
-
function mapData(options: any, defaults:
|
|
7
|
+
function mapData(options: any, defaults: ActionDefaultsType): any {
|
|
8
8
|
return {
|
|
9
9
|
...defaults,
|
|
10
10
|
...options
|
|
@@ -33,9 +33,9 @@ function mapSettingsForm({ action, ...settingsForm }: any): any {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
export interface FormActionProps {
|
|
36
|
-
actionInfo: Partial<
|
|
37
|
-
submission?: Partial<
|
|
38
|
-
onSubmit?: (submission:
|
|
36
|
+
actionInfo: Partial<ActionType>;
|
|
37
|
+
submission?: Partial<SubmissionType>;
|
|
38
|
+
onSubmit?: (submission: SubmissionType<ActionType>) => void;
|
|
39
39
|
options: FormOptions;
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -51,7 +51,7 @@ export function FormAction({ actionInfo, children, onSubmit, options, ...props }
|
|
|
51
51
|
<div>
|
|
52
52
|
{children}
|
|
53
53
|
|
|
54
|
-
<Form form={form} submission={submission} onSubmit={onSubmit} options={options} />
|
|
54
|
+
<Form<ActionType> form={form} submission={submission} onSubmit={onSubmit} options={options} />
|
|
55
55
|
|
|
56
56
|
{children}
|
|
57
57
|
</div>
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
|
|
3
|
+
import form from "../../__fixtures__/form.fixture.json";
|
|
4
|
+
import formWizard from "../../__fixtures__/form-wizard.fixture.json";
|
|
5
|
+
import { FormBuilder } from "./FormBuilder";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The [FormBuilder](/story/reactformio-formbuilder--sandbox) class can be used to embed a form builder directly in your React application.
|
|
9
|
+
*
|
|
10
|
+
* Please note that you'll need to include the CSS for the form builder from formio.js as well.
|
|
11
|
+
*
|
|
12
|
+
* Please note that the [FormBuilder](/story/reactformio-formbuilder--sandbox) component does not load and save from/to an url.
|
|
13
|
+
* You must handle the form definition loading and saving yourself or use the [FormEdit](/docs/documentation-formedit--docs) component.
|
|
14
|
+
*
|
|
15
|
+
* ```tsx
|
|
16
|
+
* import {FormBuilder} from "@tsed/react-formio/organisms/form/builder/FormBuilder";
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
export default {
|
|
21
|
+
title: "form/builder/FormBuilder",
|
|
22
|
+
component: FormBuilder,
|
|
23
|
+
argTypes: {
|
|
24
|
+
display: {
|
|
25
|
+
control: "select",
|
|
26
|
+
options: ["form", "wizard", "pdf"]
|
|
27
|
+
},
|
|
28
|
+
components: {
|
|
29
|
+
control: "object"
|
|
30
|
+
},
|
|
31
|
+
options: {
|
|
32
|
+
description:
|
|
33
|
+
"The form builder options. See [here](https://help.form.io/developers/form-development/form-builder#form-builder-options) for more details.",
|
|
34
|
+
control: "object"
|
|
35
|
+
},
|
|
36
|
+
onBuilderReady: {
|
|
37
|
+
description:
|
|
38
|
+
"A callback function that gets called when the form builder has rendered. It is useful for accessing the underlying @formio/js FormBuilder instance.",
|
|
39
|
+
action: "onBuilderReady"
|
|
40
|
+
},
|
|
41
|
+
onChange: {
|
|
42
|
+
description: "A callback function that gets called when the form being built has changed.",
|
|
43
|
+
action: "onChange"
|
|
44
|
+
},
|
|
45
|
+
onSaveComponent: {
|
|
46
|
+
description: "A callback function that gets called when a component is saved in the builder.",
|
|
47
|
+
action: "onSaveComponent"
|
|
48
|
+
},
|
|
49
|
+
onEditComponent: {
|
|
50
|
+
description: "A callback function that gets called when a component is edited in the builder.",
|
|
51
|
+
action: "onEditComponent"
|
|
52
|
+
},
|
|
53
|
+
onUpdateComponent: {
|
|
54
|
+
description: "A callback function that gets called when a component is updated in the builder.",
|
|
55
|
+
action: "onUpdateComponent"
|
|
56
|
+
},
|
|
57
|
+
onDeleteComponent: {
|
|
58
|
+
description: "A callback function that gets called when a component is deleted in the builder.",
|
|
59
|
+
action: "onDeleteComponent"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
tags: ["autodocs"]
|
|
63
|
+
} satisfies Meta<typeof FormBuilder>;
|
|
64
|
+
|
|
65
|
+
type Story = StoryObj<typeof FormBuilder>;
|
|
66
|
+
/**
|
|
67
|
+
* A traditional web form that is typically filled out by end-users from top to bottom
|
|
68
|
+
*/
|
|
69
|
+
export const WebForm: Story = {
|
|
70
|
+
args: {
|
|
71
|
+
display: form.display as any,
|
|
72
|
+
options: { template: "tailwind", iconset: "bx" },
|
|
73
|
+
components: form.components as any
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* This form configuration allows users to progress through the form in bite-size sections instead of presenting the entire form to the user.
|
|
78
|
+
* If you are creating a form containing many fields, this is a great option to improve the user experience.
|
|
79
|
+
*/
|
|
80
|
+
export const Wizard: Story = {
|
|
81
|
+
args: {
|
|
82
|
+
display: formWizard.display as any,
|
|
83
|
+
components: formWizard.components as any,
|
|
84
|
+
options: { template: "tailwind", iconset: "bx" }
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* PDF-First forms allow users to upload a PDF form and add overlay fields to the form, modernizing the traditional old and clunky PDF form.
|
|
89
|
+
* For a more in-depth guide on the PDF forms please navigate to the [following documentation](https://help.form.io/userguide/forms/pdf#introduction).
|
|
90
|
+
*/
|
|
91
|
+
export const Pdf: Story = {
|
|
92
|
+
args: {
|
|
93
|
+
display: "pdf",
|
|
94
|
+
components: [],
|
|
95
|
+
options: { template: "tailwind", iconset: "bx" }
|
|
96
|
+
}
|
|
97
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { CSSProperties } from "react";
|
|
2
|
+
|
|
3
|
+
import { registerComponent } from "../../../registries/components";
|
|
4
|
+
import { useFormBuilder, UseFormBuilderProps } from "./useFormBuilder";
|
|
5
|
+
|
|
6
|
+
export function FormBuilder({
|
|
7
|
+
className = "",
|
|
8
|
+
style = {},
|
|
9
|
+
["data-testid"]: dataTestId = "formio-builder-container",
|
|
10
|
+
...props
|
|
11
|
+
}: UseFormBuilderProps & {
|
|
12
|
+
className?: string;
|
|
13
|
+
style?: CSSProperties;
|
|
14
|
+
["data-testid"]?: string;
|
|
15
|
+
}) {
|
|
16
|
+
const renderElement = useFormBuilder(props);
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<div style={style} className={className} data-testid={dataTestId}>
|
|
20
|
+
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */}
|
|
21
|
+
<div ref={renderElement} onClick={(e) => e.stopPropagation()}>
|
|
22
|
+
<div />
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
registerComponent("FormBuilder", FormBuilder);
|
package/src/{components/form-edit/formEdit.reducer.ts → organisms/form/builder/FormEdit.reducer.ts}
RENAMED
|
@@ -2,15 +2,15 @@ import camelCase from "lodash/camelCase";
|
|
|
2
2
|
import cloneDeep from "lodash/cloneDeep";
|
|
3
3
|
import isEqual from "lodash/isEqual";
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import type { FormType } from "../../../interfaces";
|
|
6
6
|
|
|
7
|
-
export const hasChanged = (form: Partial<
|
|
7
|
+
export const hasChanged = (form: Partial<FormType>, value: Partial<FormType>): boolean => !isEqual(form, value);
|
|
8
8
|
|
|
9
9
|
export interface FormEditState {
|
|
10
|
-
past: Partial<
|
|
11
|
-
future: Partial<
|
|
12
|
-
current: Partial<
|
|
13
|
-
original: Partial<
|
|
10
|
+
past: Partial<FormType>[];
|
|
11
|
+
future: Partial<FormType>[];
|
|
12
|
+
current: Partial<FormType>;
|
|
13
|
+
original: Partial<FormType>;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export function createInitialState(props: any): FormEditState {
|