@tsed/react-formio 3.0.0-alpha.1 → 3.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/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 +1 -2
- 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 +8 -0
- package/dist/molecules/button/Button.js +52 -0
- package/dist/molecules/button/Button.js.map +1 -0
- package/dist/molecules/card/Card.js +12 -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 +9 -0
- package/dist/molecules/table/Table.js +58 -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 +10 -0
- package/dist/molecules/table/components/DefaultCellOperations.js +24 -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 +11 -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 +15 -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/{components/tabs/tabs.component.js → molecules/tabs/Tabs.js} +12 -12
- package/dist/molecules/tabs/Tabs.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/action/FormAction.d.ts} +4 -4
- package/dist/{components/form-action/formAction.component.js → organisms/form/action/FormAction.js} +2 -2
- package/dist/organisms/form/action/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 +8 -0
- package/dist/organisms/form/builder/FormEdit.js +70 -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/{components/form-edit/useFormEdit.hook.js → organisms/form/builder/useFormEdit.js} +2 -2
- package/dist/organisms/form/builder/useFormEdit.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 +6 -0
- package/dist/organisms/table/submissions/SubmissionsTable.js +11 -0
- package/dist/organisms/table/submissions/SubmissionsTable.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/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 +2 -2
- 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 +54 -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/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 +99 -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 +272 -0
- package/src/molecules/table/Table.tsx +100 -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 +42 -0
- package/src/molecules/table/components/DefaultFilter.tsx +42 -0
- package/src/molecules/table/components/DefaultOperationButton.tsx +40 -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/{components/tabs/tabs.component.spec.tsx → molecules/tabs/Tabs.spec.tsx} +4 -4
- package/src/molecules/tabs/Tabs.stories.tsx +141 -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 +256 -0
- package/src/organisms/__fixtures__/form-wizard.fixture.json +2042 -0
- package/src/organisms/__fixtures__/form.fixture.json +2067 -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/{components/form-action/formAction.stories.tsx → organisms/form/action/FormAction.stories.tsx} +11 -11
- package/src/{components/form-action/formAction.component.tsx → organisms/form/action/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 +75 -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} +8 -8
- 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} +22 -24
- 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/{components/submissions-table/submissionsTable.stories.tsx → organisms/table/submissions/SubmissionsTable.stories.tsx} +24 -27
- package/src/organisms/table/submissions/SubmissionsTable.tsx +13 -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.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.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-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/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.stories.tsx +0 -127
- 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/dist/{components/tabs/tabs.component.d.ts → molecules/tabs/Tabs.d.ts} +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/card/card.component.tsx → molecules/card/Card.tsx} +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/tabs/tabs.component.tsx → molecules/tabs/Tabs.tsx} +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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/react-formio",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.10",
|
|
4
4
|
"description": "Provide a react formio wrapper. Written in TypeScript.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -26,33 +26,35 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"classnames": "^2.3.1",
|
|
28
28
|
"eventemitter2": "^6.4.3",
|
|
29
|
-
"
|
|
29
|
+
"use-debounce": "^10.0.4"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"@formio/choices.js": ">=9.0.1",
|
|
33
|
+
"@tanstack/react-table": ">=8.20.6",
|
|
33
34
|
"formiojs": ">=4.0.0",
|
|
34
35
|
"lodash": ">=4.17.20",
|
|
35
36
|
"moment": ">=2.30.1",
|
|
36
|
-
"prop-types": ">=15.7.2",
|
|
37
37
|
"react": ">=16.14.0",
|
|
38
38
|
"react-dnd": ">=16.0.1",
|
|
39
39
|
"react-dnd-html5-backend": ">=16.0.1",
|
|
40
40
|
"react-dom": ">=16.14.0",
|
|
41
|
+
"react-select": ">=5.9.0",
|
|
41
42
|
"react-table": ">=7.6.3",
|
|
42
43
|
"tooltip.js": ">=1.3.3"
|
|
43
44
|
},
|
|
44
45
|
"devDependencies": {
|
|
45
|
-
"@
|
|
46
|
-
"@tsed/
|
|
46
|
+
"@tanstack/react-table": ">=8.20.6",
|
|
47
|
+
"@tsed/tailwind-formio": "3.0.0-alpha.10",
|
|
48
|
+
"@tsed/typescript": "3.0.0-alpha.10",
|
|
47
49
|
"microbundle": "0.13.0",
|
|
48
50
|
"vite": "5.4.11",
|
|
49
51
|
"vitest": "2.1.8"
|
|
50
52
|
},
|
|
51
|
-
"repository": "https://github.com/
|
|
53
|
+
"repository": "https://github.com/tsedio/tsed-formio",
|
|
52
54
|
"bugs": {
|
|
53
|
-
"url": "https://github.com/
|
|
55
|
+
"url": "https://github.com/tsedio/tsed-formio/issues"
|
|
54
56
|
},
|
|
55
|
-
"homepage": "https://github.com/
|
|
57
|
+
"homepage": "https://github.com/tsedio/tsed-formio/tree/master/packages/react-formio",
|
|
56
58
|
"author": "Romain Lenzotti",
|
|
57
59
|
"publishConfig": {
|
|
58
60
|
"tag": "alpha"
|
package/readme.md
CHANGED
|
@@ -37,24 +37,24 @@ See our [storybook](https://formio.tsed.io/?path=/docs/getting-started--docs) to
|
|
|
37
37
|
|
|
38
38
|
Many components are provided to build your own backoffice based on Formio.js API:
|
|
39
39
|
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
40
|
+
- ActionsTable,
|
|
41
|
+
- FormAccess,
|
|
42
|
+
- FormAction,
|
|
43
|
+
- Form,
|
|
44
|
+
- FormBuilder,
|
|
45
|
+
- FormEdit,
|
|
46
|
+
- FormsTable,
|
|
47
|
+
- InputTags,
|
|
48
|
+
- InputText,
|
|
49
|
+
- Pagination,
|
|
50
|
+
- Select,
|
|
51
|
+
- SubmissionsTable.
|
|
52
|
+
- Table,
|
|
53
53
|
- Predefined Reducers for Actions, Action, Form, Forms, Submission, Submissions, etc...,
|
|
54
54
|
- TypeScript support.
|
|
55
55
|
- Tailwind support.
|
|
56
56
|
|
|
57
|
-
## Migrate
|
|
57
|
+
## Migrate to v2
|
|
58
58
|
|
|
59
59
|
If you use redux actions from v1, you have to install `@tsed/redux-formio-stores` and remplace your imports:
|
|
60
60
|
|
|
@@ -63,6 +63,19 @@ If you use redux actions from v1, you have to install `@tsed/redux-formio-stores
|
|
|
63
63
|
+ import { defaultFormioReducer, formsReducer } from "@tsed/react-formio-stores";
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
+
## Migrate to v3
|
|
67
|
+
|
|
68
|
+
- `@tsed/react-formio` is now build only for ESM environment.
|
|
69
|
+
- `@tsed/react-formio` use tree-shaking to reduce the bundle size, you have to import only what you need from the library.
|
|
70
|
+
- `@tsed/react-formio` drop the support of TailwindCSS v2.
|
|
71
|
+
|
|
72
|
+
Example:
|
|
73
|
+
|
|
74
|
+
```diff
|
|
75
|
+
- import { Form } from "@tsed/react-formio";
|
|
76
|
+
+ import { Form } from "@tsed/react-formio/organisms/form/Form";
|
|
77
|
+
```
|
|
78
|
+
|
|
66
79
|
## Install
|
|
67
80
|
|
|
68
81
|
`@tsed/react-formio` can be used on the server, or bundled for the client using an
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Template from "@tsed/tailwind-formio";
|
|
3
|
+
|
|
4
|
+
import { Icon } from "./Icon";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Icon component to display icons based on [BxIcons](https://boxicons.com/).
|
|
8
|
+
*
|
|
9
|
+
* ## Usage
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* import {Icon} from "@tsed/react-formio/atoms/icon/Icon";
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* ## Override Icon
|
|
16
|
+
*
|
|
17
|
+
* This component is registered with the name `Icon` and can be overridden with the following code:
|
|
18
|
+
*
|
|
19
|
+
* ```ts
|
|
20
|
+
* registerComponent("Icon", MyIconComponent);
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export default {
|
|
24
|
+
title: "Icon",
|
|
25
|
+
component: Icon,
|
|
26
|
+
argTypes: {
|
|
27
|
+
name: {
|
|
28
|
+
control: "text"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
parameters: {
|
|
32
|
+
children: "Text",
|
|
33
|
+
variant: "primary"
|
|
34
|
+
}
|
|
35
|
+
} satisfies Meta<typeof Icon>;
|
|
36
|
+
|
|
37
|
+
type Story = StoryObj<typeof Icon>;
|
|
38
|
+
|
|
39
|
+
export const Usage: Story = {
|
|
40
|
+
args: {
|
|
41
|
+
name: "save"
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const Size: Story = {
|
|
46
|
+
args: {
|
|
47
|
+
name: "save"
|
|
48
|
+
},
|
|
49
|
+
render() {
|
|
50
|
+
return (
|
|
51
|
+
<div className='flex flex-wrap gap-3'>
|
|
52
|
+
{["text-sm", "text-large", "text-xl", "text-3xl", "text-8xl"].map((className) => (
|
|
53
|
+
<div key={className} className={"flex gap-3 items-end"}>
|
|
54
|
+
<Icon name='save' className={className} />
|
|
55
|
+
</div>
|
|
56
|
+
))}
|
|
57
|
+
</div>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const Colors: Story = {
|
|
63
|
+
args: {
|
|
64
|
+
name: "save"
|
|
65
|
+
},
|
|
66
|
+
render() {
|
|
67
|
+
return (
|
|
68
|
+
<div className='flex flex-wrap gap-3'>
|
|
69
|
+
{["text-sm text-red-600", "text-large text-primary", "text-xl text-secondary", "text-3xl text-green-600"].map((className) => (
|
|
70
|
+
<div key={className} className={"flex gap-3 items-end"}>
|
|
71
|
+
<Icon name='save' className={className} />
|
|
72
|
+
</div>
|
|
73
|
+
))}
|
|
74
|
+
</div>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export const Rounded: Story = {
|
|
80
|
+
args: {
|
|
81
|
+
name: "save"
|
|
82
|
+
},
|
|
83
|
+
render() {
|
|
84
|
+
return (
|
|
85
|
+
<div className='flex flex-wrap gap-3'>
|
|
86
|
+
{["text-sm bg-red-600", "text-large bg-primary", "text-xl bg-secondary", "text-3xl bg-green-600"].map((className) => (
|
|
87
|
+
<div key={className} className={"flex gap-3 items-end"}>
|
|
88
|
+
<Icon name='save' className={className + " rounded-full text-white p-3"} />
|
|
89
|
+
</div>
|
|
90
|
+
))}
|
|
91
|
+
</div>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Formio needs theses icons to be displayed in the form builder and other places.
|
|
97
|
+
*/
|
|
98
|
+
export const PresetsForFormio: Story = {
|
|
99
|
+
args: {
|
|
100
|
+
name: "save"
|
|
101
|
+
},
|
|
102
|
+
render() {
|
|
103
|
+
return (
|
|
104
|
+
<div className='flex flex-wrap gap-3'>
|
|
105
|
+
{Object.entries(Template.templates.tailwind.ICONS).map(([icon]) => (
|
|
106
|
+
<div key={icon} className={"flex gap-3 flex-wrap"}>
|
|
107
|
+
<div
|
|
108
|
+
className={"flex flex-col justify-center items-center space-y-3 border-1 border-gray-300 rounded-md"}
|
|
109
|
+
style={{
|
|
110
|
+
width: "100px",
|
|
111
|
+
height: "100px"
|
|
112
|
+
}}
|
|
113
|
+
>
|
|
114
|
+
<div>
|
|
115
|
+
<Icon name={icon} />
|
|
116
|
+
</div>
|
|
117
|
+
<span className='text-sm'>{icon}</span>
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
))}
|
|
121
|
+
</div>
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import cx from "classnames";
|
|
2
|
+
import type { HTMLAttributes } from "react";
|
|
3
|
+
|
|
4
|
+
import { registerComponent } from "../../registries/components";
|
|
5
|
+
import { iconClass } from "../../utils/iconClass";
|
|
6
|
+
|
|
7
|
+
export interface IconProps extends HTMLAttributes<HTMLElement> {
|
|
8
|
+
iconset?: string;
|
|
9
|
+
name: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function Icon({ iconset, name, className, ...props }: IconProps) {
|
|
13
|
+
return <i {...props} className={cx(iconClass(iconset, name), className)} />;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
registerComponent("Icon", Icon);
|
package/src/index.ts
CHANGED
|
@@ -2,6 +2,7 @@ import Webform from "formiojs/Webform";
|
|
|
2
2
|
import WebformBuilder from "formiojs/WebformBuilder";
|
|
3
3
|
import Wizard from "formiojs/Wizard";
|
|
4
4
|
import WizardBuilder from "formiojs/WizardBuilder";
|
|
5
|
+
|
|
5
6
|
export {
|
|
6
7
|
Webform,
|
|
7
8
|
WebformBuilder,
|
|
@@ -10,11 +11,5 @@ export {
|
|
|
10
11
|
// editFormUtils,
|
|
11
12
|
};
|
|
12
13
|
|
|
13
|
-
export * from "./components";
|
|
14
|
-
export * from "./hooks/useTooltip";
|
|
15
14
|
export * from "./interfaces";
|
|
16
|
-
export * from "./utils/callLast";
|
|
17
|
-
export * from "./utils/iconClass";
|
|
18
|
-
export * from "./utils/mapPagination";
|
|
19
|
-
export * from "./utils/stopPropagationWrapper";
|
|
20
15
|
export { Components, Formio, Templates, Utils } from "formiojs";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { FormType } from "./FormType";
|
|
2
|
+
|
|
3
|
+
export type ActionDefaultsType = {
|
|
4
|
+
handler: string[];
|
|
5
|
+
method: string[];
|
|
6
|
+
priority: number;
|
|
7
|
+
name: string;
|
|
8
|
+
title: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export interface ActionInfoType extends Record<string, unknown> {
|
|
12
|
+
name: string;
|
|
13
|
+
title: string;
|
|
14
|
+
description: string;
|
|
15
|
+
priority: number;
|
|
16
|
+
defaults: ActionDefaultsType;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface ActionType extends ActionInfoType {
|
|
20
|
+
_id?: string;
|
|
21
|
+
settingsForm: Partial<FormType>;
|
|
22
|
+
access?: {
|
|
23
|
+
handler: boolean;
|
|
24
|
+
method: boolean;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EventEmitter2 } from "eventemitter2";
|
|
1
|
+
import type { EventEmitter2 } from "eventemitter2";
|
|
2
2
|
|
|
3
3
|
export interface FormOptions {
|
|
4
4
|
iconset?: string;
|
|
@@ -8,4 +8,7 @@ export interface FormOptions {
|
|
|
8
8
|
template?: string;
|
|
9
9
|
saveDraft?: boolean;
|
|
10
10
|
events?: EventEmitter2;
|
|
11
|
+
hooks?: {
|
|
12
|
+
customValidation?: Function;
|
|
13
|
+
};
|
|
11
14
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ComponentType } from "./ComponentType";
|
|
2
2
|
|
|
3
|
-
export type
|
|
3
|
+
export type FormType = {
|
|
4
4
|
_id?: string;
|
|
5
5
|
title?: string;
|
|
6
6
|
name?: string;
|
|
7
7
|
machineName?: string;
|
|
8
|
-
components:
|
|
8
|
+
components: ComponentType[];
|
|
9
9
|
tags?: string[];
|
|
10
10
|
action?: string;
|
|
11
11
|
properties?: Record<string, any>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
|
|
3
|
-
import { OperationButtonProps } from "../
|
|
3
|
+
import type { OperationButtonProps } from "../molecules/table/components/DefaultOperationButton.js";
|
|
4
4
|
|
|
5
5
|
export type PermissionsResolver<Data = any> = (data: Data, ctx: any) => void;
|
|
6
|
-
export type OnClickOperation<Data = any> = (data: Data, operation: Operation) => void;
|
|
6
|
+
// export type OnClickOperation<Data = any> = (data: Data, operation: Operation) => void;
|
|
7
7
|
|
|
8
8
|
export interface Operation<Data = any> {
|
|
9
9
|
/**
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ComponentType } from "./ComponentType";
|
|
2
|
+
|
|
3
|
+
export type JSON = unknown | string | number | boolean | null | undefined | JSON[] | { [key: string]: JSON };
|
|
4
|
+
|
|
5
|
+
export interface SubmissionType<Data extends { [key: string]: JSON } = { [key: string]: JSON }> extends Record<string, JSON> {
|
|
6
|
+
_id?: string;
|
|
7
|
+
data: Data;
|
|
8
|
+
metadata?: { [key: string]: JSON };
|
|
9
|
+
state?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface ChangedSubmission<Data extends { [key: string]: JSON } = { [key: string]: JSON }> extends SubmissionType<Data> {
|
|
13
|
+
data: Data;
|
|
14
|
+
changed?: {
|
|
15
|
+
component: ComponentType;
|
|
16
|
+
instance: any;
|
|
17
|
+
value: unknown;
|
|
18
|
+
} & Record<string, JSON>;
|
|
19
|
+
isValid: boolean;
|
|
20
|
+
}
|
package/src/interfaces/index.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./ActionType";
|
|
2
2
|
export * from "./ColumnIdentifier";
|
|
3
|
+
export * from "./ComponentType";
|
|
3
4
|
export * from "./FormOptions";
|
|
4
|
-
export * from "./
|
|
5
|
+
export * from "./FormType";
|
|
5
6
|
export * from "./Operation";
|
|
6
7
|
export * from "./QueryOptions";
|
|
7
|
-
export * from "./
|
|
8
|
-
export * from "./
|
|
8
|
+
export * from "./RoleType";
|
|
9
|
+
export * from "./SubmissionType";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { writeFile } from "node:fs/promises";
|
|
2
|
+
|
|
3
|
+
import { v4 } from "uuid";
|
|
4
|
+
|
|
5
|
+
import products from "./products.json" with { type: "json" };
|
|
6
|
+
|
|
7
|
+
const result = products.map((product) => {
|
|
8
|
+
return {
|
|
9
|
+
_id: v4(),
|
|
10
|
+
owner: null,
|
|
11
|
+
roles: [],
|
|
12
|
+
data: {
|
|
13
|
+
id: product.id,
|
|
14
|
+
label: product.title,
|
|
15
|
+
description: product.description_title,
|
|
16
|
+
image: product.media.immersive_image,
|
|
17
|
+
price: product.price?.initial_price?.per_trip,
|
|
18
|
+
currency: product.price?.currency
|
|
19
|
+
},
|
|
20
|
+
access: [],
|
|
21
|
+
externalIds: [],
|
|
22
|
+
created: new Date().toISOString(),
|
|
23
|
+
modified: new Date().toISOString(),
|
|
24
|
+
form: "5e972ae7a1a692917cf54f9e"
|
|
25
|
+
};
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
await writeFile("./form-submissions.json", JSON.stringify(result, null, 2), { encoding: "utf-8" });
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "form",
|
|
3
|
+
"display": "form",
|
|
4
|
+
"tags": [],
|
|
5
|
+
"components": [
|
|
6
|
+
{
|
|
7
|
+
"label": "First name",
|
|
8
|
+
"labelPosition": "top",
|
|
9
|
+
"placeholder": "",
|
|
10
|
+
"description": "",
|
|
11
|
+
"tooltip": "",
|
|
12
|
+
"prefix": "",
|
|
13
|
+
"suffix": "",
|
|
14
|
+
"widget": {
|
|
15
|
+
"type": "input"
|
|
16
|
+
},
|
|
17
|
+
"inputMask": "",
|
|
18
|
+
"displayMask": "",
|
|
19
|
+
"applyMaskOn": "change",
|
|
20
|
+
"allowMultipleMasks": false,
|
|
21
|
+
"customClass": "",
|
|
22
|
+
"tabindex": "",
|
|
23
|
+
"autocomplete": "",
|
|
24
|
+
"hidden": false,
|
|
25
|
+
"hideLabel": false,
|
|
26
|
+
"showWordCount": false,
|
|
27
|
+
"showCharCount": false,
|
|
28
|
+
"mask": false,
|
|
29
|
+
"autofocus": false,
|
|
30
|
+
"spellcheck": true,
|
|
31
|
+
"disabled": false,
|
|
32
|
+
"tableView": true,
|
|
33
|
+
"modalEdit": false,
|
|
34
|
+
"multiple": false,
|
|
35
|
+
"persistent": true,
|
|
36
|
+
"inputFormat": "plain",
|
|
37
|
+
"protected": false,
|
|
38
|
+
"dbIndex": false,
|
|
39
|
+
"case": "",
|
|
40
|
+
"truncateMultipleSpaces": false,
|
|
41
|
+
"encrypted": false,
|
|
42
|
+
"redrawOn": "",
|
|
43
|
+
"clearOnHide": true,
|
|
44
|
+
"customDefaultValue": "",
|
|
45
|
+
"calculateValue": "",
|
|
46
|
+
"calculateServer": false,
|
|
47
|
+
"allowCalculateOverride": false,
|
|
48
|
+
"validateOn": "change",
|
|
49
|
+
"validate": {
|
|
50
|
+
"required": false,
|
|
51
|
+
"pattern": "",
|
|
52
|
+
"customMessage": "",
|
|
53
|
+
"custom": "",
|
|
54
|
+
"customPrivate": false,
|
|
55
|
+
"json": "",
|
|
56
|
+
"minLength": "",
|
|
57
|
+
"maxLength": "",
|
|
58
|
+
"strictDateValidation": false,
|
|
59
|
+
"multiple": false,
|
|
60
|
+
"unique": false
|
|
61
|
+
},
|
|
62
|
+
"unique": false,
|
|
63
|
+
"validateWhenHidden": false,
|
|
64
|
+
"errorLabel": "",
|
|
65
|
+
"errors": "",
|
|
66
|
+
"key": "firstName",
|
|
67
|
+
"tags": [],
|
|
68
|
+
"properties": {},
|
|
69
|
+
"conditional": {
|
|
70
|
+
"show": null,
|
|
71
|
+
"when": null,
|
|
72
|
+
"eq": "",
|
|
73
|
+
"json": ""
|
|
74
|
+
},
|
|
75
|
+
"customConditional": "",
|
|
76
|
+
"logic": [],
|
|
77
|
+
"attributes": {},
|
|
78
|
+
"overlay": {
|
|
79
|
+
"style": "",
|
|
80
|
+
"page": "",
|
|
81
|
+
"left": "",
|
|
82
|
+
"top": "",
|
|
83
|
+
"width": "",
|
|
84
|
+
"height": ""
|
|
85
|
+
},
|
|
86
|
+
"type": "textfield",
|
|
87
|
+
"dataGridLabel": false,
|
|
88
|
+
"input": true,
|
|
89
|
+
"refreshOn": "",
|
|
90
|
+
"addons": [],
|
|
91
|
+
"inputType": "text",
|
|
92
|
+
"defaultValue": ""
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"label": "Last name",
|
|
96
|
+
"labelPosition": "top",
|
|
97
|
+
"placeholder": "",
|
|
98
|
+
"description": "",
|
|
99
|
+
"tooltip": "",
|
|
100
|
+
"prefix": "",
|
|
101
|
+
"suffix": "",
|
|
102
|
+
"widget": {
|
|
103
|
+
"type": "input"
|
|
104
|
+
},
|
|
105
|
+
"inputMask": "",
|
|
106
|
+
"displayMask": "",
|
|
107
|
+
"applyMaskOn": "change",
|
|
108
|
+
"allowMultipleMasks": false,
|
|
109
|
+
"customClass": "",
|
|
110
|
+
"tabindex": "",
|
|
111
|
+
"autocomplete": "",
|
|
112
|
+
"hidden": false,
|
|
113
|
+
"hideLabel": false,
|
|
114
|
+
"showWordCount": false,
|
|
115
|
+
"showCharCount": false,
|
|
116
|
+
"mask": false,
|
|
117
|
+
"autofocus": false,
|
|
118
|
+
"spellcheck": true,
|
|
119
|
+
"disabled": false,
|
|
120
|
+
"tableView": true,
|
|
121
|
+
"modalEdit": false,
|
|
122
|
+
"multiple": false,
|
|
123
|
+
"persistent": true,
|
|
124
|
+
"inputFormat": "plain",
|
|
125
|
+
"protected": false,
|
|
126
|
+
"dbIndex": false,
|
|
127
|
+
"case": "",
|
|
128
|
+
"truncateMultipleSpaces": false,
|
|
129
|
+
"encrypted": false,
|
|
130
|
+
"redrawOn": "",
|
|
131
|
+
"clearOnHide": true,
|
|
132
|
+
"customDefaultValue": "",
|
|
133
|
+
"calculateValue": "",
|
|
134
|
+
"calculateServer": false,
|
|
135
|
+
"allowCalculateOverride": false,
|
|
136
|
+
"validateOn": "change",
|
|
137
|
+
"validate": {
|
|
138
|
+
"required": false,
|
|
139
|
+
"pattern": "",
|
|
140
|
+
"customMessage": "",
|
|
141
|
+
"custom": "",
|
|
142
|
+
"customPrivate": false,
|
|
143
|
+
"json": "",
|
|
144
|
+
"minLength": "",
|
|
145
|
+
"maxLength": "",
|
|
146
|
+
"strictDateValidation": false,
|
|
147
|
+
"multiple": false,
|
|
148
|
+
"unique": false
|
|
149
|
+
},
|
|
150
|
+
"unique": false,
|
|
151
|
+
"validateWhenHidden": false,
|
|
152
|
+
"errorLabel": "",
|
|
153
|
+
"errors": "",
|
|
154
|
+
"key": "lastName",
|
|
155
|
+
"tags": [],
|
|
156
|
+
"properties": {},
|
|
157
|
+
"conditional": {
|
|
158
|
+
"show": null,
|
|
159
|
+
"when": null,
|
|
160
|
+
"eq": "",
|
|
161
|
+
"json": ""
|
|
162
|
+
},
|
|
163
|
+
"customConditional": "",
|
|
164
|
+
"logic": [],
|
|
165
|
+
"attributes": {},
|
|
166
|
+
"overlay": {
|
|
167
|
+
"style": "",
|
|
168
|
+
"page": "",
|
|
169
|
+
"left": "",
|
|
170
|
+
"top": "",
|
|
171
|
+
"width": "",
|
|
172
|
+
"height": ""
|
|
173
|
+
},
|
|
174
|
+
"type": "textfield",
|
|
175
|
+
"dataGridLabel": false,
|
|
176
|
+
"input": true,
|
|
177
|
+
"refreshOn": "",
|
|
178
|
+
"addons": [],
|
|
179
|
+
"inputType": "text",
|
|
180
|
+
"defaultValue": ""
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"type": "button",
|
|
184
|
+
"label": "Submit",
|
|
185
|
+
"key": "submit",
|
|
186
|
+
"size": "md",
|
|
187
|
+
"block": false,
|
|
188
|
+
"action": "submit",
|
|
189
|
+
"disableOnInvalid": true,
|
|
190
|
+
"theme": "primary",
|
|
191
|
+
"input": true,
|
|
192
|
+
"placeholder": "",
|
|
193
|
+
"prefix": "",
|
|
194
|
+
"customClass": "",
|
|
195
|
+
"suffix": "",
|
|
196
|
+
"multiple": false,
|
|
197
|
+
"defaultValue": null,
|
|
198
|
+
"protected": false,
|
|
199
|
+
"unique": false,
|
|
200
|
+
"persistent": false,
|
|
201
|
+
"hidden": false,
|
|
202
|
+
"clearOnHide": true,
|
|
203
|
+
"refreshOn": "",
|
|
204
|
+
"redrawOn": "",
|
|
205
|
+
"tableView": false,
|
|
206
|
+
"modalEdit": false,
|
|
207
|
+
"labelPosition": "top",
|
|
208
|
+
"description": "",
|
|
209
|
+
"errorLabel": "",
|
|
210
|
+
"tooltip": "",
|
|
211
|
+
"hideLabel": false,
|
|
212
|
+
"tabindex": "",
|
|
213
|
+
"disabled": false,
|
|
214
|
+
"autofocus": false,
|
|
215
|
+
"dbIndex": false,
|
|
216
|
+
"customDefaultValue": "",
|
|
217
|
+
"calculateValue": "",
|
|
218
|
+
"calculateServer": false,
|
|
219
|
+
"widget": {
|
|
220
|
+
"type": "input"
|
|
221
|
+
},
|
|
222
|
+
"attributes": {},
|
|
223
|
+
"validateOn": "change",
|
|
224
|
+
"validate": {
|
|
225
|
+
"required": false,
|
|
226
|
+
"custom": "",
|
|
227
|
+
"customPrivate": false,
|
|
228
|
+
"strictDateValidation": false,
|
|
229
|
+
"multiple": false,
|
|
230
|
+
"unique": false
|
|
231
|
+
},
|
|
232
|
+
"conditional": {
|
|
233
|
+
"show": null,
|
|
234
|
+
"when": null,
|
|
235
|
+
"eq": ""
|
|
236
|
+
},
|
|
237
|
+
"overlay": {
|
|
238
|
+
"style": "",
|
|
239
|
+
"left": "",
|
|
240
|
+
"top": "",
|
|
241
|
+
"width": "",
|
|
242
|
+
"height": ""
|
|
243
|
+
},
|
|
244
|
+
"allowCalculateOverride": false,
|
|
245
|
+
"encrypted": false,
|
|
246
|
+
"showCharCount": false,
|
|
247
|
+
"showWordCount": false,
|
|
248
|
+
"properties": {},
|
|
249
|
+
"allowMultipleMasks": false,
|
|
250
|
+
"leftIcon": "",
|
|
251
|
+
"rightIcon": "",
|
|
252
|
+
"dataGridLabel": true,
|
|
253
|
+
"addons": []
|
|
254
|
+
}
|
|
255
|
+
]
|
|
256
|
+
}
|