@tsed/react-formio 2.3.6 → 3.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +43 -0
- package/dist/chunks/index.js.map +1 -0
- 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/useTooltip.d.ts +2 -3
- package/dist/hooks/useTooltip.js +12 -0
- package/dist/hooks/useTooltip.js.map +1 -0
- package/dist/index.d.ts +7 -13
- package/dist/index.js +14 -7653
- 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/ColumnIdentifier.d.ts +14 -14
- package/dist/interfaces/ColumnIdentifier.js +2 -0
- package/dist/interfaces/ColumnIdentifier.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 +13 -10
- package/dist/interfaces/FormOptions.js +2 -0
- package/dist/interfaces/FormOptions.js.map +1 -0
- package/dist/interfaces/{FormSchema.d.ts → FormType.d.ts} +12 -12
- package/dist/interfaces/FormType.js +2 -0
- package/dist/interfaces/FormType.js.map +1 -0
- package/dist/interfaces/Operation.d.ts +28 -29
- package/dist/interfaces/Operation.js +2 -0
- package/dist/interfaces/Operation.js.map +1 -0
- package/dist/interfaces/QueryOptions.d.ts +23 -23
- package/dist/interfaces/QueryOptions.js +2 -0
- package/dist/interfaces/QueryOptions.js.map +1 -0
- package/dist/interfaces/{RoleSchema.d.ts → RoleType.d.ts} +6 -6
- 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 +9 -8
- package/dist/interfaces/index.js +2 -0
- package/dist/interfaces/index.js.map +1 -0
- package/dist/molecules/alert/Alert.d.ts +6 -0
- package/dist/molecules/alert/Alert.js +27 -0
- 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/{components/card/card.component.d.ts → molecules/card/Card.d.ts} +6 -7
- 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/molecules/loader/Loader.d.ts +8 -0
- package/dist/molecules/loader/Loader.js +19 -0
- package/dist/molecules/loader/Loader.js.map +1 -0
- package/dist/{components/modal/modal.component.d.ts → molecules/modal/Modal.d.ts} +15 -15
- package/dist/molecules/modal/Modal.js +62 -0
- package/dist/molecules/modal/Modal.js.map +1 -0
- package/dist/molecules/pagination/Pagination.d.ts +18 -0
- 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/{components/table → molecules/pagination}/utils/getPageNumbers.d.ts +3 -3
- package/dist/molecules/pagination/utils/getPageNumbers.js +25 -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.d.ts → molecules/tabs/Tabs.d.ts} +19 -19
- package/dist/molecules/tabs/Tabs.js +72 -0
- 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/organisms/form/access/FormAccess.d.ts +9 -0
- package/dist/organisms/form/access/FormAccess.js +94 -0
- package/dist/organisms/form/access/FormAccess.js.map +1 -0
- package/dist/organisms/form/access/FormAccess.schema.d.ts +4 -0
- package/dist/organisms/form/access/FormAccess.schema.js +164 -0
- package/dist/organisms/form/access/FormAccess.schema.js.map +1 -0
- package/dist/organisms/form/access/FormAccess.utils.d.ts +23 -0
- package/dist/organisms/form/access/FormAccess.utils.js +68 -0
- package/dist/organisms/form/access/FormAccess.utils.js.map +1 -0
- package/dist/organisms/form/action/FormAction.d.ts +9 -0
- package/dist/organisms/form/action/FormAction.js +32 -0
- 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/organisms/form/builder/FormEdit.reducer.js +65 -0
- 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} +29 -29
- package/dist/organisms/form/builder/useFormEdit.js +36 -0
- 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} +7 -8
- package/dist/organisms/form/settings/FormSettings.js +38 -0
- package/dist/organisms/form/settings/FormSettings.js.map +1 -0
- package/dist/organisms/form/settings/FormSettings.schema.d.ts +2 -0
- package/dist/organisms/form/settings/FormSettings.schema.js +60 -0
- package/dist/organisms/form/settings/FormSettings.schema.js.map +1 -0
- package/dist/organisms/form/settings/FormSettings.utils.d.ts +8 -0
- package/dist/organisms/form/settings/FormSettings.utils.js +23 -0
- 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} +9 -9
- package/dist/organisms/modal/RemoveModal.js +71 -0
- 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/react-app-env.d.js +2 -0
- package/dist/react-app-env.d.js.map +1 -0
- package/dist/react-table.d.js +2 -0
- package/dist/react-table.d.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/dist/typings.d.js +2 -0
- package/dist/typings.d.js.map +1 -0
- package/dist/utils/getEventValue.d.ts +1 -1
- package/dist/utils/getEventValue.js +8 -0
- package/dist/utils/getEventValue.js.map +1 -0
- package/dist/utils/iconClass.d.ts +1 -1
- package/dist/utils/iconClass.js +9 -0
- package/dist/utils/iconClass.js.map +1 -0
- package/dist/utils/mapPagination.d.ts +1 -1
- package/dist/utils/mapPagination.js +11 -0
- package/dist/utils/mapPagination.js.map +1 -0
- package/dist/utils/stopPropagationWrapper.d.ts +1 -1
- package/dist/utils/stopPropagationWrapper.js +7 -0
- package/dist/utils/stopPropagationWrapper.js.map +1 -0
- package/package.json +29 -18
- package/readme.md +33 -20
- 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 -15
- package/src/molecules/alert/Alert.stories.tsx +39 -0
- package/src/{components/alert/alert.component.tsx → molecules/alert/Alert.tsx} +9 -8
- 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 -3
- package/src/{components/card/card.stories.tsx → molecules/card/Card.stories.tsx} +9 -4
- package/src/{components/card/card.component.tsx → molecules/card/Card.tsx} +1 -2
- package/src/{components/form-control/formControl.component.spec.tsx → molecules/forms/form-control/FormControl.spec.tsx} +9 -9
- 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 -8
- 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} +4 -4
- package/src/molecules/loader/Loader.stories.tsx +43 -0
- package/src/{components/loader/loader.component.tsx → molecules/loader/Loader.tsx} +3 -11
- package/src/molecules/modal/Modal.spec.tsx +203 -0
- package/src/molecules/modal/Modal.stories.tsx +178 -0
- package/src/{components/modal/modal.component.tsx → molecules/modal/Modal.tsx} +1 -1
- package/src/{components/pagination/pagination.component.spec.tsx → molecules/pagination/Pagination.spec.tsx} +27 -22
- 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} +6 -6
- package/src/molecules/tabs/Tabs.stories.tsx +141 -0
- package/src/{components/tabs/tabs.component.tsx → molecules/tabs/Tabs.tsx} +1 -1
- 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} +6 -7
- 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} +16 -18
- 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 -13
- package/src/{components/form-action/formAction.component.tsx → organisms/form/action/FormAction.tsx} +8 -8
- 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} +88 -44
- 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} +29 -29
- 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} +3 -4
- 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 -10
- package/src/{components/form-settings/formSettings.component.tsx → organisms/form/settings/FormSettings.tsx} +8 -9
- 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} +3 -3
- package/src/{components/actions-table/actionsTable.component.spec.tsx → organisms/table/actions/ActionsTable.spec.tsx} +14 -11
- 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} +14 -21
- package/src/{components/forms-table/formsTable.stories.tsx → organisms/table/forms/FormsTable.stories.tsx} +24 -28
- 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} +28 -31
- package/src/organisms/table/submissions/SubmissionsTable.tsx +13 -0
- package/src/registries/components.ts +23 -0
- package/src/utils/iconClass.ts +3 -1
- package/tsconfig.app.json +11 -0
- package/tsconfig.json +10 -5
- package/tsconfig.node.json +9 -4
- package/tsconfig.spec.json +14 -0
- package/vite.config.mts +69 -0
- package/vitest.config.mts +21 -0
- package/.eslintignore +0 -13
- package/.eslintrc.js +0 -7
- package/coverage.json +0 -6
- package/dist/components/actions-table/actionsTable.component.d.ts +0 -11
- package/dist/components/actions-table/actionsTable.component.spec.d.ts +0 -1
- package/dist/components/actions-table/actionsTable.stories.d.ts +0 -40
- package/dist/components/alert/alert.component.d.ts +0 -6
- package/dist/components/alert/alert.component.spec.d.ts +0 -1
- package/dist/components/alert/alert.stories.d.ts +0 -15
- package/dist/components/card/card.component.spec.d.ts +0 -1
- package/dist/components/card/card.stories.d.ts +0 -16
- package/dist/components/form/form.component.d.ts +0 -63
- package/dist/components/form/form.component.spec.d.ts +0 -1
- package/dist/components/form/form.stories.d.ts +0 -6445
- package/dist/components/form/useForm.hook.d.ts +0 -60
- package/dist/components/form-access/formAccess.component.d.ts +0 -9
- package/dist/components/form-access/formAccess.schema.d.ts +0 -5
- package/dist/components/form-access/formAccess.stories.d.ts +0 -21
- package/dist/components/form-access/formAccess.utils.d.ts +0 -24
- package/dist/components/form-access/formAccess.utils.spec.d.ts +0 -1
- package/dist/components/form-action/formAction.component.d.ts +0 -9
- package/dist/components/form-action/formAction.stories.d.ts +0 -409
- package/dist/components/form-builder/formBuilder.component.d.ts +0 -53
- package/dist/components/form-builder/formBuilder.stories.d.ts +0 -5989
- package/dist/components/form-control/formControl.component.d.ts +0 -14
- package/dist/components/form-control/formControl.component.spec.d.ts +0 -1
- package/dist/components/form-control/formControl.stories.d.ts +0 -58
- package/dist/components/form-edit/formCtas.component.d.ts +0 -28
- package/dist/components/form-edit/formEdit.component.d.ts +0 -19
- package/dist/components/form-edit/formEdit.reducer.d.ts +0 -10
- package/dist/components/form-edit/formEdit.stories.d.ts +0 -396
- package/dist/components/form-edit/formParameters.component.d.ts +0 -34
- package/dist/components/form-settings/formSettings.component.spec.d.ts +0 -1
- package/dist/components/form-settings/formSettings.schema.d.ts +0 -2
- package/dist/components/form-settings/formSettings.stories.d.ts +0 -58
- package/dist/components/form-settings/formSettings.utils.d.ts +0 -8
- package/dist/components/form-settings/formSettings.utils.spec.d.ts +0 -1
- package/dist/components/forms-table/components/formCell.component.d.ts +0 -7
- package/dist/components/forms-table/formsTable.component.d.ts +0 -11
- package/dist/components/forms-table/formsTable.stories.d.ts +0 -117
- package/dist/components/index.d.ts +0 -26
- package/dist/components/input-tags/inputTags.component.d.ts +0 -19
- package/dist/components/input-tags/inputTags.stories.d.ts +0 -76
- package/dist/components/input-text/inputText.component.d.ts +0 -28
- package/dist/components/input-text/inputText.component.spec.d.ts +0 -1
- package/dist/components/input-text/inputText.stories.d.ts +0 -101
- package/dist/components/loader/loader.component.d.ts +0 -17
- package/dist/components/loader/loader.component.spec.d.ts +0 -1
- package/dist/components/loader/loader.stories.d.ts +0 -15
- package/dist/components/modal/modal.component.spec.d.ts +0 -1
- package/dist/components/modal/modal.stories.d.ts +0 -44
- package/dist/components/pagination/pagination.component.d.ts +0 -18
- package/dist/components/pagination/pagination.component.spec.d.ts +0 -1
- package/dist/components/pagination/pagination.stories.d.ts +0 -16
- package/dist/components/react-component/reactComponent.component.d.ts +0 -90
- package/dist/components/select/select.component.d.ts +0 -14
- package/dist/components/select/select.component.spec.d.ts +0 -1
- package/dist/components/select/select.stories.d.ts +0 -164
- package/dist/components/submissions-table/submissionsTable.component.d.ts +0 -7
- package/dist/components/submissions-table/submissionsTable.stories.d.ts +0 -649
- package/dist/components/table/components/defaultArrowSort.component.d.ts +0 -2
- package/dist/components/table/components/defaultCell.component.d.ts +0 -2
- package/dist/components/table/components/defaultCellHeader.component.d.ts +0 -6
- package/dist/components/table/components/defaultCellOperations.component.d.ts +0 -13
- package/dist/components/table/components/defaultCells.component.d.ts +0 -5
- package/dist/components/table/components/defaultOperationButton.component.d.ts +0 -14
- package/dist/components/table/components/defaultRow.component.d.ts +0 -12
- package/dist/components/table/components/dragNDropContainer.d.ts +0 -4
- package/dist/components/table/filters/defaultColumnFilter.component.d.ts +0 -6
- package/dist/components/table/filters/defaultColumnFilter.component.spec.d.ts +0 -1
- package/dist/components/table/filters/selectColumnFilter.component.d.ts +0 -11
- package/dist/components/table/filters/selectColumnFilter.component.spec.d.ts +0 -1
- package/dist/components/table/filters/sliderColumnFilter.component.d.ts +0 -3
- package/dist/components/table/hooks/useCustomTable.hook.d.ts +0 -128
- package/dist/components/table/hooks/useDragnDropRow.hook.d.ts +0 -274
- package/dist/components/table/hooks/useOperations.hook.d.ts +0 -11
- package/dist/components/table/index.d.ts +0 -15
- package/dist/components/table/table.component.d.ts +0 -3
- package/dist/components/table/table.stories.d.ts +0 -71
- package/dist/components/table/utils/mapFormToColumns.d.ts +0 -3
- package/dist/components/table/utils/swapElements.d.ts +0 -1
- package/dist/components/table/utils/swapElements.spec.d.ts +0 -1
- package/dist/components/tabs/tabs.component.spec.d.ts +0 -1
- package/dist/components/tabs/tabs.component.stories.d.ts +0 -47
- package/dist/index.modern.js +0 -7437
- package/dist/index.modern.js.map +0 -1
- package/dist/interfaces/ActionSchema.d.ts +0 -23
- package/dist/interfaces/Submission.d.ts +0 -5
- package/dist/setupTests.d.ts +0 -1
- package/dist/utils/callLast.d.ts +0 -1
- package/jest.config.js +0 -6
- package/src/components/alert/alert.stories.tsx +0 -18
- package/src/components/form/form.component.tsx +0 -73
- 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 -3667
- package/src/components/form-control/formControl.component.tsx +0 -58
- package/src/components/form-control/formControl.stories.tsx +0 -65
- package/src/components/form-edit/formCtas.component.tsx +0 -106
- package/src/components/form-edit/formEdit.component.tsx +0 -60
- package/src/components/forms-table/components/formCell.component.tsx +0 -48
- package/src/components/forms-table/formsTable.component.tsx +0 -42
- package/src/components/index.ts +0 -26
- 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 -18
- package/src/components/modal/modal.component.spec.tsx +0 -79
- package/src/components/modal/modal.stories.tsx +0 -192
- package/src/components/pagination/pagination.stories.tsx +0 -40
- package/src/components/react-component/reactComponent.component.tsx +0 -197
- package/src/components/select/select.component.spec.tsx +0 -85
- 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 -16
- package/src/components/table/components/defaultArrowSort.component.tsx +0 -12
- package/src/components/table/components/defaultCell.component.tsx +0 -15
- package/src/components/table/components/defaultCellHeader.component.tsx +0 -19
- package/src/components/table/components/defaultCellOperations.component.tsx +0 -39
- package/src/components/table/components/defaultCells.component.tsx +0 -31
- package/src/components/table/components/defaultOperationButton.component.tsx +0 -53
- 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 -34
- package/src/components/table/filters/defaultColumnFilter.component.tsx +0 -39
- package/src/components/table/filters/selectColumnFilter.component.spec.tsx +0 -69
- package/src/components/table/filters/selectColumnFilter.component.tsx +0 -52
- package/src/components/table/filters/sliderColumnFilter.component.tsx +0 -31
- package/src/components/table/hooks/useCustomTable.hook.tsx +0 -272
- 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 -34
- 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/setupTests.tsx +0 -5
- package/src/utils/callLast.ts +0 -12
- /package/src/{components → molecules}/__fixtures__/form-actions.json +0 -0
- /package/src/{components → molecules}/__fixtures__/form.fixture.json +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
|
@@ -1,52 +1,48 @@
|
|
|
1
|
+
import "../../../molecules/button/Button";
|
|
2
|
+
import "../../../molecules/forms/input-text/InputText";
|
|
3
|
+
import "../../../molecules/forms/select/all";
|
|
4
|
+
import "../../../molecules/forms/form-control/FormControl";
|
|
5
|
+
import "../../../molecules/pagination/all";
|
|
6
|
+
import "../../../molecules/table/all";
|
|
7
|
+
|
|
1
8
|
import tailwind from "@tsed/tailwind-formio";
|
|
2
|
-
import React from "react";
|
|
3
9
|
|
|
4
|
-
import { FormsTable } from "./
|
|
10
|
+
import { FormsTable } from "./FormsTable";
|
|
5
11
|
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* ```tsx
|
|
15
|
+
* import {FormsTable} from "@tsed/react-formio/organisms/table/forms/FormsTable";
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
6
18
|
export default {
|
|
7
|
-
title: "
|
|
19
|
+
title: "table/forms/FormsTable",
|
|
8
20
|
component: FormsTable,
|
|
9
21
|
argTypes: {
|
|
10
22
|
icon: {
|
|
11
|
-
control:
|
|
12
|
-
|
|
13
|
-
options: Object.keys(tailwind.templates.tailwind.ICONS)
|
|
14
|
-
}
|
|
23
|
+
control: "select",
|
|
24
|
+
options: Object.keys(tailwind.templates.tailwind.ICONS)
|
|
15
25
|
},
|
|
16
26
|
data: {
|
|
17
|
-
control:
|
|
18
|
-
type: "object"
|
|
19
|
-
}
|
|
27
|
+
control: "object"
|
|
20
28
|
},
|
|
21
29
|
operations: {
|
|
22
|
-
control:
|
|
23
|
-
type: "object"
|
|
24
|
-
}
|
|
30
|
+
control: "object"
|
|
25
31
|
},
|
|
26
32
|
isLoading: {
|
|
27
|
-
control:
|
|
28
|
-
type: "boolean"
|
|
29
|
-
}
|
|
33
|
+
control: "boolean"
|
|
30
34
|
},
|
|
31
35
|
isEmpty: {
|
|
32
|
-
control:
|
|
33
|
-
type: "boolean"
|
|
34
|
-
}
|
|
36
|
+
control: "boolean"
|
|
35
37
|
},
|
|
36
38
|
disableFilters: {
|
|
37
|
-
control:
|
|
38
|
-
type: "boolean"
|
|
39
|
-
}
|
|
39
|
+
control: "boolean"
|
|
40
40
|
},
|
|
41
41
|
disablePagination: {
|
|
42
|
-
control:
|
|
43
|
-
type: "boolean"
|
|
44
|
-
}
|
|
42
|
+
control: "boolean"
|
|
45
43
|
},
|
|
46
44
|
tags: {
|
|
47
|
-
control:
|
|
48
|
-
type: "object"
|
|
49
|
-
}
|
|
45
|
+
control: "object"
|
|
50
46
|
}
|
|
51
47
|
},
|
|
52
48
|
parameters: {}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import "./components/FormsCell.js";
|
|
2
|
+
|
|
3
|
+
import { ColumnDef } from "@tanstack/react-table";
|
|
4
|
+
|
|
5
|
+
import type { FormType } from "../../../interfaces";
|
|
6
|
+
import { Table, TableProps } from "../../../molecules/table/Table";
|
|
7
|
+
import { getComponent } from "../../../registries/components.js";
|
|
8
|
+
import { FormsCell } from "./components/FormsCell.js";
|
|
9
|
+
|
|
10
|
+
export type FormsTableProps = Omit<TableProps<FormType>, "columns"> & {
|
|
11
|
+
tags?: { label: string; value: string }[];
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export function FormsTable({ ...props }: FormsTableProps) {
|
|
15
|
+
const { i18n = (f: string) => f, tags } = props;
|
|
16
|
+
const Cell = getComponent<typeof FormsCell>("FormsCell");
|
|
17
|
+
|
|
18
|
+
const columns: ColumnDef<any>[] = [
|
|
19
|
+
{
|
|
20
|
+
header: i18n("Title"),
|
|
21
|
+
accessorKey: "title",
|
|
22
|
+
cell: (context) => <Cell {...context} i18n={i18n} />,
|
|
23
|
+
meta: {
|
|
24
|
+
cellProps: {
|
|
25
|
+
colSpan: 2
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
header: i18n("Tags"),
|
|
31
|
+
accessorKey: "tags",
|
|
32
|
+
meta: {
|
|
33
|
+
cellProps: {
|
|
34
|
+
hidden: true
|
|
35
|
+
},
|
|
36
|
+
filter: {
|
|
37
|
+
variant: "select",
|
|
38
|
+
layout: "react",
|
|
39
|
+
options: tags
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
// {
|
|
44
|
+
// Header: i18n("Title"),
|
|
45
|
+
// accessor: "title",
|
|
46
|
+
// id: "title",
|
|
47
|
+
// Cell: (props: any) => <FormCell {...props} icon={props.icon} i18n={i18n} />,
|
|
48
|
+
// Filter: DefaultColumnFilter,
|
|
49
|
+
// colspan: 2
|
|
50
|
+
// },
|
|
51
|
+
// {
|
|
52
|
+
// Header: i18n("Tags"),
|
|
53
|
+
// accessor: "tags",
|
|
54
|
+
// id: "tags",
|
|
55
|
+
// hidden: true,
|
|
56
|
+
// Filter: (props: any) =>
|
|
57
|
+
// tags && tags.length ? (
|
|
58
|
+
// <SelectColumnFilter {...props} column={{ ...props.columns, choices: tags }} />
|
|
59
|
+
// ) : (
|
|
60
|
+
// <DefaultColumnFilter {...props} />
|
|
61
|
+
// )
|
|
62
|
+
// }
|
|
63
|
+
];
|
|
64
|
+
|
|
65
|
+
return <Table {...(props as any)} columns={columns} />;
|
|
66
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { CellContext } from "@tanstack/react-table";
|
|
2
|
+
import cx from "classnames";
|
|
3
|
+
import moment from "moment";
|
|
4
|
+
|
|
5
|
+
import type { FormType } from "../../../../interfaces/index.js";
|
|
6
|
+
import { registerComponent } from "../../../../registries/components.js";
|
|
7
|
+
import { iconClass } from "../../../../utils/iconClass";
|
|
8
|
+
import { stopPropagationWrapper } from "../../../../utils/stopPropagationWrapper";
|
|
9
|
+
|
|
10
|
+
export function FormsCell(
|
|
11
|
+
props: CellContext<FormType, any> & {
|
|
12
|
+
i18n: (i18n: string) => string;
|
|
13
|
+
}
|
|
14
|
+
) {
|
|
15
|
+
const {
|
|
16
|
+
row: { original: form }
|
|
17
|
+
} = props;
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<div className={"p-1"}>
|
|
21
|
+
<h4 className={"text-primary text-lg flex space-x-2 items-center"}>
|
|
22
|
+
<i className={cx(iconClass(undefined, "server"), "text-secondary")} />
|
|
23
|
+
<span>{form.title}</span>
|
|
24
|
+
</h4>
|
|
25
|
+
|
|
26
|
+
<ul className='reset-list text-gray-500'>
|
|
27
|
+
<li className={"text-sm"}>Name: {form.name || form.machineName}</li>
|
|
28
|
+
<li className='mt-5 flex space-x-1'>
|
|
29
|
+
<span className='badge bg-light flex space-x-1'>
|
|
30
|
+
<i className={iconClass(undefined, "history")} />
|
|
31
|
+
<span>Updated {moment(form.modified).fromNow()}</span>
|
|
32
|
+
</span>
|
|
33
|
+
|
|
34
|
+
{(form.tags || []).map((tag, index) => (
|
|
35
|
+
<button
|
|
36
|
+
key={index}
|
|
37
|
+
className='badge badge-hover bg-secondary flex space-x-1'
|
|
38
|
+
onClick={stopPropagationWrapper(() => {
|
|
39
|
+
// props.setFilter("tags", tag);
|
|
40
|
+
// props.gotoPage(0);
|
|
41
|
+
})}
|
|
42
|
+
>
|
|
43
|
+
<i className={iconClass(undefined, "tags")} />
|
|
44
|
+
<span>{tag}</span>
|
|
45
|
+
</button>
|
|
46
|
+
))}
|
|
47
|
+
</li>
|
|
48
|
+
</ul>
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
registerComponent("FormsCell", FormsCell);
|
|
@@ -1,57 +1,54 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "../../../molecules/button/Button";
|
|
2
|
+
import "../../../molecules/forms/input-text/InputText";
|
|
3
|
+
import "../../../molecules/forms/select/all";
|
|
4
|
+
import "../../../molecules/pagination/all";
|
|
5
|
+
import "../../../molecules/table/all";
|
|
2
6
|
|
|
3
|
-
import {
|
|
4
|
-
import formSchema from "../__fixtures__/form-schema.json";
|
|
5
|
-
import formSubmissions from "../__fixtures__/form-submissions.json";
|
|
6
|
-
import { SubmissionsTable } from "./submissionsTable.component";
|
|
7
|
+
import { useState } from "react";
|
|
7
8
|
|
|
9
|
+
import { mapPagination } from "../../../utils/mapPagination";
|
|
10
|
+
import FormType from "../../__fixtures__/form-schema.json";
|
|
11
|
+
import formSubmissions from "../../__fixtures__/form-submissions.json";
|
|
12
|
+
import { SubmissionsTable } from "./SubmissionsTable";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* ```tsx
|
|
16
|
+
* import {SubmissionsTable} from "@tsed/react-formio/organisms/table/submissions/SubmissionsTable";
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
8
19
|
export default {
|
|
9
|
-
title: "
|
|
20
|
+
title: "table/submissions/SubmissionsTable",
|
|
10
21
|
component: SubmissionsTable,
|
|
11
22
|
argTypes: {
|
|
12
23
|
form: {
|
|
13
|
-
control:
|
|
14
|
-
type: "object"
|
|
15
|
-
}
|
|
24
|
+
control: "object"
|
|
16
25
|
},
|
|
17
26
|
data: {
|
|
18
|
-
control:
|
|
19
|
-
type: "object"
|
|
20
|
-
}
|
|
27
|
+
control: "object"
|
|
21
28
|
},
|
|
22
29
|
operations: {
|
|
23
|
-
control:
|
|
24
|
-
type: "object"
|
|
25
|
-
}
|
|
30
|
+
control: "object"
|
|
26
31
|
},
|
|
27
32
|
isLoading: {
|
|
28
|
-
control:
|
|
29
|
-
type: "boolean"
|
|
30
|
-
}
|
|
33
|
+
control: "boolean"
|
|
31
34
|
},
|
|
32
35
|
isEmpty: {
|
|
33
|
-
control:
|
|
34
|
-
type: "boolean"
|
|
35
|
-
}
|
|
36
|
+
control: "boolean"
|
|
36
37
|
},
|
|
37
38
|
disableFilters: {
|
|
38
|
-
control:
|
|
39
|
-
type: "boolean"
|
|
40
|
-
}
|
|
39
|
+
control: "boolean"
|
|
41
40
|
},
|
|
42
41
|
disablePagination: {
|
|
43
|
-
control:
|
|
44
|
-
type: "boolean"
|
|
45
|
-
}
|
|
42
|
+
control: "boolean"
|
|
46
43
|
}
|
|
47
44
|
},
|
|
48
45
|
parameters: {}
|
|
49
46
|
};
|
|
50
47
|
|
|
51
48
|
export const Sandbox = (args: any) => {
|
|
52
|
-
const [skip, setSkip] =
|
|
53
|
-
const [limit, setLimit] =
|
|
54
|
-
const [serverCount] =
|
|
49
|
+
const [skip, setSkip] = useState(0);
|
|
50
|
+
const [limit, setLimit] = useState(10);
|
|
51
|
+
const [serverCount] = useState(87);
|
|
55
52
|
|
|
56
53
|
const onChange = (obj: any) => {
|
|
57
54
|
setLimit(obj.pageSize);
|
|
@@ -73,7 +70,7 @@ export const Sandbox = (args: any) => {
|
|
|
73
70
|
};
|
|
74
71
|
|
|
75
72
|
Sandbox.args = {
|
|
76
|
-
form:
|
|
73
|
+
form: FormType,
|
|
77
74
|
data: formSubmissions,
|
|
78
75
|
operations: [
|
|
79
76
|
{
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { FormType, SubmissionType } from "../../../interfaces";
|
|
2
|
+
import { Table, type TableProps } from "../../../molecules/table/Table";
|
|
3
|
+
import { mapFormToColumns } from "../../../molecules/table/utils/mapFormToColumns.js";
|
|
4
|
+
|
|
5
|
+
export type SubmissionsTableProps = Omit<TableProps<SubmissionType>, "columns"> & {
|
|
6
|
+
form?: FormType;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export function SubmissionsTable({ form, ...props }: SubmissionsTableProps) {
|
|
10
|
+
const columns: any[] | undefined = form && mapFormToColumns(form);
|
|
11
|
+
|
|
12
|
+
return <Table {...props} columns={columns!} />;
|
|
13
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export const components = new Map<string, unknown>();
|
|
2
|
+
|
|
3
|
+
export function registerComponent(type: string, component: unknown) {
|
|
4
|
+
components.set(type, component);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function getComponent<Cmp>(type: string | string[]): Cmp {
|
|
8
|
+
if (Array.isArray(type)) {
|
|
9
|
+
for (const t of type) {
|
|
10
|
+
if (components.has(t)) {
|
|
11
|
+
return components.get(t) as unknown as Cmp;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const result = components.get(type as string) as unknown as Cmp;
|
|
17
|
+
|
|
18
|
+
if (!result) {
|
|
19
|
+
console.warn(`Missing component for ${type}`);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return result;
|
|
23
|
+
}
|
package/src/utils/iconClass.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as formio from "formiojs";
|
|
2
|
+
|
|
3
|
+
const { Templates } = formio;
|
|
2
4
|
|
|
3
5
|
export function iconClass(iconset: string | undefined, name: string, spinning?: boolean): string {
|
|
4
6
|
return Templates.current.iconClass(iconset || Templates.current.defaultIconset, name, spinning);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "@tsed/typescript/tsconfig.web.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"baseUrl": ".",
|
|
5
|
+
"noEmit": true,
|
|
6
|
+
"declaration": false,
|
|
7
|
+
"composite": false
|
|
8
|
+
},
|
|
9
|
+
"include": ["src/**/*.ts", "src/**/*.tsx"],
|
|
10
|
+
"exclude": ["node_modules", "dist", "src/**/*.spec.ts", "src/**/*.spec.tsx"]
|
|
11
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
{
|
|
2
|
-
"extends": "@tsed/
|
|
2
|
+
"extends": "@tsed/typescript/tsconfig.web.json",
|
|
3
3
|
"compilerOptions": {
|
|
4
|
-
"
|
|
5
|
-
"
|
|
4
|
+
"baseUrl": ".",
|
|
5
|
+
"composite": true,
|
|
6
|
+
"noEmit": true
|
|
6
7
|
},
|
|
7
|
-
"include": [
|
|
8
|
+
"include": [],
|
|
9
|
+
"exclude": [],
|
|
8
10
|
"references": [
|
|
11
|
+
{
|
|
12
|
+
"path": "./tsconfig.app.json"
|
|
13
|
+
},
|
|
9
14
|
{
|
|
10
15
|
"path": "./tsconfig.node.json"
|
|
11
16
|
},
|
|
12
17
|
{
|
|
13
|
-
"path": "
|
|
18
|
+
"path": "./tsconfig.spec.json"
|
|
14
19
|
}
|
|
15
20
|
]
|
|
16
21
|
}
|
package/tsconfig.node.json
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
+
"extends": "@tsed/typescript/tsconfig.web.json",
|
|
2
3
|
"compilerOptions": {
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
4
|
+
"module": "NodeNext",
|
|
5
|
+
"moduleResolution": "NodeNext",
|
|
6
|
+
"baseUrl": ".",
|
|
7
|
+
"noEmit": true,
|
|
8
|
+
"declaration": false,
|
|
9
|
+
"composite": false
|
|
6
10
|
},
|
|
7
|
-
"include": []
|
|
11
|
+
"include": ["vite.config.mts"],
|
|
12
|
+
"exclude": ["node_modules", "dist", "src/**/*.spec.ts", "src/**/*.spec.tsx"]
|
|
8
13
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "@tsed/typescript/tsconfig.web.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"baseUrl": ".",
|
|
5
|
+
"rootDir": ".",
|
|
6
|
+
"declaration": false,
|
|
7
|
+
"composite": false,
|
|
8
|
+
"noEmit": true,
|
|
9
|
+
"paths": {},
|
|
10
|
+
"types": ["vite/client", "vitest/globals", "@testing-library/jest-dom"]
|
|
11
|
+
},
|
|
12
|
+
"include": ["src/**/*.spec.tsx", "src/**/*.spec.ts", "vitest.config.mts"],
|
|
13
|
+
"exclude": ["node_modules", "dist", "coverage"]
|
|
14
|
+
}
|
package/vite.config.mts
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import {fileURLToPath} from "node:url";
|
|
2
|
+
|
|
3
|
+
import react from "@vitejs/plugin-react";
|
|
4
|
+
import {globbySync} from "globby";
|
|
5
|
+
import {extname, relative} from "path";
|
|
6
|
+
import preserveDirectives from "rollup-preserve-directives";
|
|
7
|
+
import {defineConfig} from "vite";
|
|
8
|
+
import dts from "vite-plugin-dts";
|
|
9
|
+
import {resolve} from "node:path";
|
|
10
|
+
|
|
11
|
+
import pkg from "./package.json" with {type: "json"};
|
|
12
|
+
|
|
13
|
+
// https://vitejs.dev/config/
|
|
14
|
+
export default defineConfig({
|
|
15
|
+
plugins: [
|
|
16
|
+
react(),
|
|
17
|
+
dts({
|
|
18
|
+
tsconfigPath: "./tsconfig.app.json",
|
|
19
|
+
aliasesExclude: [],
|
|
20
|
+
include: ["src/**/*.{ts,tsx}"],
|
|
21
|
+
exclude: ["**/*.spec.{ts,tsx}", "**/*.stories.{ts,tsx}", "**/__*__/**"]
|
|
22
|
+
})
|
|
23
|
+
],
|
|
24
|
+
resolve: {
|
|
25
|
+
alias: {}
|
|
26
|
+
},
|
|
27
|
+
build: {
|
|
28
|
+
sourcemap: true,
|
|
29
|
+
lib: {
|
|
30
|
+
entry: resolve(import.meta.dirname, "src/index.ts"),
|
|
31
|
+
formats: ["es"]
|
|
32
|
+
},
|
|
33
|
+
copyPublicDir: false,
|
|
34
|
+
rollupOptions: {
|
|
35
|
+
external: [
|
|
36
|
+
...Object.keys(pkg.peerDependencies || {}),
|
|
37
|
+
"react",
|
|
38
|
+
"react-dom",
|
|
39
|
+
"react/jsx-runtime",
|
|
40
|
+
/lodash\/.*/,
|
|
41
|
+
/formiojs\/.*/,
|
|
42
|
+
/@tsed\/.*/
|
|
43
|
+
],
|
|
44
|
+
plugins: [preserveDirectives() as any],
|
|
45
|
+
input: Object.fromEntries(
|
|
46
|
+
globbySync("src/**/*.{ts,tsx}", {
|
|
47
|
+
ignore: ["**/*.spec.{ts,tsx}", "**/*.stories.{ts,tsx}", "**/__*__/**"]
|
|
48
|
+
}).map((file) => {
|
|
49
|
+
return [
|
|
50
|
+
// The name of the entry point
|
|
51
|
+
// src/nested/foo.ts becomes nested/foo
|
|
52
|
+
relative("src", file.slice(0, file.length - extname(file).length)),
|
|
53
|
+
// The absolute path to the entry file
|
|
54
|
+
// src/nested/foo.ts becomes /project/src/nested/foo.ts
|
|
55
|
+
fileURLToPath(new URL(file, import.meta.url))
|
|
56
|
+
];
|
|
57
|
+
})
|
|
58
|
+
),
|
|
59
|
+
output: {
|
|
60
|
+
assetFileNames: "assets/[name][extname]",
|
|
61
|
+
chunkFileNames: "chunks/[name].js",
|
|
62
|
+
entryFileNames: "[name].js",
|
|
63
|
+
globals: {
|
|
64
|
+
react: "React"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import {presets} from "@tsed/vitest/presets";
|
|
3
|
+
import {defineConfig} from "vitest/config";
|
|
4
|
+
|
|
5
|
+
export default defineConfig(
|
|
6
|
+
{
|
|
7
|
+
...presets,
|
|
8
|
+
test: {
|
|
9
|
+
...presets.test,
|
|
10
|
+
coverage: {
|
|
11
|
+
...presets.test.coverage,
|
|
12
|
+
thresholds: {
|
|
13
|
+
statements: 0,
|
|
14
|
+
branches: 0,
|
|
15
|
+
functions: 0,
|
|
16
|
+
lines: 0
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
);
|
package/.eslintignore
DELETED
package/.eslintrc.js
DELETED
package/coverage.json
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { ActionSchema } from "../../interfaces";
|
|
3
|
-
import { TableProps } from "../table/hooks/useCustomTable.hook";
|
|
4
|
-
export type ActionsTableProps = Omit<TableProps<ActionSchema>, "columns"> & {
|
|
5
|
-
onAddAction?: (actionName: string) => void;
|
|
6
|
-
availableActions?: {
|
|
7
|
-
label: string;
|
|
8
|
-
value: string;
|
|
9
|
-
}[];
|
|
10
|
-
};
|
|
11
|
-
export declare function ActionsTable({ disableFilters, disablePagination, availableActions, onAddAction, ...props }: ActionsTableProps): React.JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from "@storybook/react";
|
|
2
|
-
import { ActionsTable } from "./actionsTable.component";
|
|
3
|
-
declare const _default: {
|
|
4
|
-
title: string;
|
|
5
|
-
component: typeof ActionsTable;
|
|
6
|
-
argTypes: {
|
|
7
|
-
data: {
|
|
8
|
-
control: {
|
|
9
|
-
type: "object";
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
operations: {
|
|
13
|
-
control: {
|
|
14
|
-
type: "object";
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
isLoading: {
|
|
18
|
-
control: {
|
|
19
|
-
type: "boolean";
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
disableFilters: {
|
|
23
|
-
control: {
|
|
24
|
-
type: "boolean";
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
disablePagination: {
|
|
28
|
-
control: {
|
|
29
|
-
type: "boolean";
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
onAddAction: {
|
|
33
|
-
action: string;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
parameters: {};
|
|
37
|
-
};
|
|
38
|
-
export default _default;
|
|
39
|
-
type Story = StoryObj<typeof ActionsTable>;
|
|
40
|
-
export declare const Sandbox: Story;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Alert } from "./alert.component";
|
|
3
|
-
declare const _default: {
|
|
4
|
-
title: string;
|
|
5
|
-
component: typeof Alert;
|
|
6
|
-
argTypes: {};
|
|
7
|
-
parameters: {};
|
|
8
|
-
};
|
|
9
|
-
export default _default;
|
|
10
|
-
export declare const Sandbox: {
|
|
11
|
-
(args: any): React.JSX.Element;
|
|
12
|
-
args: {
|
|
13
|
-
error: string;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Card } from "./card.component";
|
|
3
|
-
declare const _default: {
|
|
4
|
-
title: string;
|
|
5
|
-
component: typeof Card;
|
|
6
|
-
argTypes: {};
|
|
7
|
-
parameters: {};
|
|
8
|
-
};
|
|
9
|
-
export default _default;
|
|
10
|
-
export declare const Sandbox: {
|
|
11
|
-
(args: any): React.JSX.Element;
|
|
12
|
-
args: {
|
|
13
|
-
label: string;
|
|
14
|
-
children: string;
|
|
15
|
-
};
|
|
16
|
-
};
|