@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
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FormType } from './FormType';
|
|
2
|
+
export type ActionDefaultsType = {
|
|
3
|
+
handler: string[];
|
|
4
|
+
method: string[];
|
|
5
|
+
priority: number;
|
|
6
|
+
name: string;
|
|
7
|
+
title: string;
|
|
8
|
+
};
|
|
9
|
+
export interface ActionInfoType extends Record<string, unknown> {
|
|
10
|
+
name: string;
|
|
11
|
+
title: string;
|
|
12
|
+
description: string;
|
|
13
|
+
priority: number;
|
|
14
|
+
defaults: ActionDefaultsType;
|
|
15
|
+
}
|
|
16
|
+
export interface ActionType extends ActionInfoType {
|
|
17
|
+
_id?: string;
|
|
18
|
+
settingsForm: Partial<FormType>;
|
|
19
|
+
access?: {
|
|
20
|
+
handler: boolean;
|
|
21
|
+
method: boolean;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionType.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export interface ColumnIdentifier {
|
|
2
|
-
/**
|
|
3
|
-
* Column identifier
|
|
4
|
-
*/
|
|
5
|
-
id: string;
|
|
6
|
-
/**
|
|
7
|
-
* Filter value
|
|
8
|
-
*/
|
|
9
|
-
value?: any;
|
|
10
|
-
/**
|
|
11
|
-
* Sort order
|
|
12
|
-
*/
|
|
13
|
-
desc?: boolean;
|
|
14
|
-
}
|
|
1
|
+
export interface ColumnIdentifier {
|
|
2
|
+
/**
|
|
3
|
+
* Column identifier
|
|
4
|
+
*/
|
|
5
|
+
id: string;
|
|
6
|
+
/**
|
|
7
|
+
* Filter value
|
|
8
|
+
*/
|
|
9
|
+
value?: any;
|
|
10
|
+
/**
|
|
11
|
+
* Sort order
|
|
12
|
+
*/
|
|
13
|
+
desc?: boolean;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColumnIdentifier.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComponentType.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { EventEmitter2 } from
|
|
2
|
-
export interface FormOptions {
|
|
3
|
-
iconset?: string;
|
|
4
|
-
readOnly?: boolean;
|
|
5
|
-
noAlerts?: boolean;
|
|
6
|
-
i18n?: (f: string) => string;
|
|
7
|
-
template?: string;
|
|
8
|
-
saveDraft?: boolean;
|
|
9
|
-
events?: EventEmitter2;
|
|
10
|
-
|
|
1
|
+
import { EventEmitter2 } from 'eventemitter2';
|
|
2
|
+
export interface FormOptions {
|
|
3
|
+
iconset?: string;
|
|
4
|
+
readOnly?: boolean;
|
|
5
|
+
noAlerts?: boolean;
|
|
6
|
+
i18n?: (f: string) => string;
|
|
7
|
+
template?: string;
|
|
8
|
+
saveDraft?: boolean;
|
|
9
|
+
events?: EventEmitter2;
|
|
10
|
+
hooks?: {
|
|
11
|
+
customValidation?: Function;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormOptions.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type
|
|
3
|
-
_id?: string;
|
|
4
|
-
title?: string;
|
|
5
|
-
name?: string;
|
|
6
|
-
machineName?: string;
|
|
7
|
-
components:
|
|
8
|
-
tags?: string[];
|
|
9
|
-
action?: string;
|
|
10
|
-
properties?: Record<string, any>;
|
|
11
|
-
[key: string]: any;
|
|
12
|
-
};
|
|
1
|
+
import { ComponentType } from './ComponentType';
|
|
2
|
+
export type FormType = {
|
|
3
|
+
_id?: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
machineName?: string;
|
|
7
|
+
components: ComponentType[];
|
|
8
|
+
tags?: string[];
|
|
9
|
+
action?: string;
|
|
10
|
+
properties?: Record<string, any>;
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormType.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { OperationButtonProps } from
|
|
3
|
-
export type PermissionsResolver<Data = any> = (data: Data, ctx: any) => void;
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { OperationButtonProps } from '../molecules/table/components/DefaultOperationButton.js';
|
|
3
|
+
export type PermissionsResolver<Data = any> = (data: Data, ctx: any) => void;
|
|
4
|
+
export interface Operation<Data = any> {
|
|
5
|
+
/**
|
|
6
|
+
* Action identifier
|
|
7
|
+
*/
|
|
8
|
+
action: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Alias Operation
|
|
12
|
+
*/
|
|
13
|
+
alias?: string;
|
|
14
|
+
path?: string;
|
|
15
|
+
className?: string;
|
|
16
|
+
buttonType?: string;
|
|
17
|
+
buttonSize?: string;
|
|
18
|
+
buttonOutline?: boolean;
|
|
19
|
+
icon?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Custom ActionButton
|
|
22
|
+
*/
|
|
23
|
+
OperationButton?: React.ComponentType<OperationButtonProps>;
|
|
24
|
+
/**
|
|
25
|
+
* Permission resolver to display ActionButton
|
|
26
|
+
*/
|
|
27
|
+
permissionsResolver?: PermissionsResolver<Data>;
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Operation.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { ColumnIdentifier } from
|
|
2
|
-
export type QueryOptions = {
|
|
3
|
-
/**
|
|
4
|
-
* Current displayed page
|
|
5
|
-
*/
|
|
6
|
-
pageIndex: any;
|
|
7
|
-
/**
|
|
8
|
-
* Pagination size
|
|
9
|
-
*/
|
|
10
|
-
pageSize: any;
|
|
11
|
-
/**
|
|
12
|
-
* SortBy state
|
|
13
|
-
*/
|
|
14
|
-
sortBy: ColumnIdentifier[];
|
|
15
|
-
/**
|
|
16
|
-
* Filters state
|
|
17
|
-
*/
|
|
18
|
-
filters: ColumnIdentifier[];
|
|
19
|
-
/**
|
|
20
|
-
* Focused input filter (let the Table component retrieve focus state when we fill the filter)
|
|
21
|
-
*/
|
|
22
|
-
filterId: string;
|
|
23
|
-
};
|
|
1
|
+
import { ColumnIdentifier } from './ColumnIdentifier';
|
|
2
|
+
export type QueryOptions = {
|
|
3
|
+
/**
|
|
4
|
+
* Current displayed page
|
|
5
|
+
*/
|
|
6
|
+
pageIndex: any;
|
|
7
|
+
/**
|
|
8
|
+
* Pagination size
|
|
9
|
+
*/
|
|
10
|
+
pageSize: any;
|
|
11
|
+
/**
|
|
12
|
+
* SortBy state
|
|
13
|
+
*/
|
|
14
|
+
sortBy: ColumnIdentifier[];
|
|
15
|
+
/**
|
|
16
|
+
* Filters state
|
|
17
|
+
*/
|
|
18
|
+
filters: ColumnIdentifier[];
|
|
19
|
+
/**
|
|
20
|
+
* Focused input filter (let the Table component retrieve focus state when we fill the filter)
|
|
21
|
+
*/
|
|
22
|
+
filterId: string;
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueryOptions.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export interface
|
|
2
|
-
_id?: string;
|
|
3
|
-
title: string;
|
|
4
|
-
admin: boolean;
|
|
5
|
-
default: boolean;
|
|
6
|
-
}
|
|
1
|
+
export interface RoleType extends Record<string, unknown> {
|
|
2
|
+
_id?: string;
|
|
3
|
+
title: string;
|
|
4
|
+
admin: boolean;
|
|
5
|
+
default: boolean;
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoleType.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ComponentType } from './ComponentType';
|
|
2
|
+
export type JSON = unknown | string | number | boolean | null | undefined | JSON[] | {
|
|
3
|
+
[key: string]: JSON;
|
|
4
|
+
};
|
|
5
|
+
export interface SubmissionType<Data extends {
|
|
6
|
+
[key: string]: JSON;
|
|
7
|
+
} = {
|
|
8
|
+
[key: string]: JSON;
|
|
9
|
+
}> extends Record<string, JSON> {
|
|
10
|
+
_id?: string;
|
|
11
|
+
data: Data;
|
|
12
|
+
metadata?: {
|
|
13
|
+
[key: string]: JSON;
|
|
14
|
+
};
|
|
15
|
+
state?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface ChangedSubmission<Data extends {
|
|
18
|
+
[key: string]: JSON;
|
|
19
|
+
} = {
|
|
20
|
+
[key: string]: JSON;
|
|
21
|
+
}> extends SubmissionType<Data> {
|
|
22
|
+
data: Data;
|
|
23
|
+
changed?: {
|
|
24
|
+
component: ComponentType;
|
|
25
|
+
instance: any;
|
|
26
|
+
value: unknown;
|
|
27
|
+
} & Record<string, JSON>;
|
|
28
|
+
isValid: boolean;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubmissionType.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
1
|
+
export * from './ActionType';
|
|
2
|
+
export * from './ColumnIdentifier';
|
|
3
|
+
export * from './ComponentType';
|
|
4
|
+
export * from './FormOptions';
|
|
5
|
+
export * from './FormType';
|
|
6
|
+
export * from './Operation';
|
|
7
|
+
export * from './QueryOptions';
|
|
8
|
+
export * from './RoleType';
|
|
9
|
+
export * from './SubmissionType';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsxs as n, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
function s(e) {
|
|
3
|
+
return !e || Array.isArray(e) && !e.length ? "" : typeof e == "string" ? e : Array.isArray(e) ? e.map(s) : Object.prototype.hasOwnProperty.call(e, "errors") ? Object.keys(e.errors).map((t, a) => {
|
|
4
|
+
const r = e.errors[t];
|
|
5
|
+
return /* @__PURE__ */ n("div", { children: [
|
|
6
|
+
/* @__PURE__ */ n("strong", { children: [
|
|
7
|
+
r.name,
|
|
8
|
+
" (",
|
|
9
|
+
r.path,
|
|
10
|
+
")"
|
|
11
|
+
] }),
|
|
12
|
+
" ",
|
|
13
|
+
"- ",
|
|
14
|
+
r.message
|
|
15
|
+
] }, a);
|
|
16
|
+
}) : Object.prototype.hasOwnProperty.call(e, "message") ? e.message : Object.prototype.hasOwnProperty.call(e, "name") && e.name === "ValidationError" ? e.details.map((t, a) => /* @__PURE__ */ l("div", { children: t.message }, a)) : Object.prototype.hasOwnProperty.call(e, "_id") && Object.prototype.hasOwnProperty.call(e, "display") ? "Another user has saved this form already. Please reload and re-apply your changes." : "An error occurred. See console logs for details.";
|
|
17
|
+
}
|
|
18
|
+
function o({ children: e, message: t, type: a = "danger" }) {
|
|
19
|
+
return /* @__PURE__ */ n("div", { className: `alert alert-${a}`, role: "alert", children: [
|
|
20
|
+
s(t),
|
|
21
|
+
e
|
|
22
|
+
] });
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
o as Alert
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=Alert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Alert.js","sources":["../../../src/molecules/alert/Alert.tsx"],"sourcesContent":["import { PropsWithChildren } from \"react\";\n\nfunction formatError(error: any): any {\n if (!error || (Array.isArray(error) && !error.length)) {\n return \"\";\n }\n\n if (typeof error === \"string\") {\n return error;\n }\n\n if (Array.isArray(error)) {\n return error.map(formatError);\n }\n\n if (Object.prototype.hasOwnProperty.call(error, \"errors\")) {\n return Object.keys(error.errors).map((key, index) => {\n const item = error.errors[key];\n return (\n <div key={index}>\n <strong>\n {item.name} ({item.path})\n </strong>{\" \"}\n - {item.message}\n </div>\n );\n });\n }\n\n // If this is a standard error.\n if (Object.prototype.hasOwnProperty.call(error, \"message\")) {\n return error.message;\n }\n\n // If this is a joy validation error.\n if (Object.prototype.hasOwnProperty.call(error, \"name\") && error.name === \"ValidationError\") {\n return error.details.map((item: any, index: number) => {\n return <div key={index}>{item.message}</div>;\n });\n }\n\n // If a conflict error occurs on a form, the form is returned.\n if (Object.prototype.hasOwnProperty.call(error, \"_id\") && Object.prototype.hasOwnProperty.call(error, \"display\")) {\n return \"Another user has saved this form already. Please reload and re-apply your changes.\";\n }\n\n return \"An error occurred. See console logs for details.\";\n}\n\nexport interface AlertProps {\n message?: string | any | string[];\n type?: string;\n}\n\nexport function Alert({ children, message, type = \"danger\" }: PropsWithChildren<AlertProps>) {\n return (\n <div className={`alert alert-${type}`} role='alert'>\n {formatError(message)}\n {children}\n </div>\n );\n}\n"],"names":["formatError","error","key","index","item","jsxs","jsx","Alert","children","message","type"],"mappings":";AAEA,SAASA,EAAYC,GAAiB;AAChC,SAAA,CAACA,KAAU,MAAM,QAAQA,CAAK,KAAK,CAACA,EAAM,SACrC,KAGL,OAAOA,KAAU,WACZA,IAGL,MAAM,QAAQA,CAAK,IACdA,EAAM,IAAID,CAAW,IAG1B,OAAO,UAAU,eAAe,KAAKC,GAAO,QAAQ,IAC/C,OAAO,KAAKA,EAAM,MAAM,EAAE,IAAI,CAACC,GAAKC,MAAU;AAC7C,UAAAC,IAAOH,EAAM,OAAOC,CAAG;AAC7B,6BACG,OACC,EAAA,UAAA;AAAA,MAAA,gBAAAG,EAAC,UACE,EAAA,UAAA;AAAA,QAAKD,EAAA;AAAA,QAAK;AAAA,QAAGA,EAAK;AAAA,QAAK;AAAA,MAAA,GAC1B;AAAA,MAAU;AAAA,MAAI;AAAA,MACXA,EAAK;AAAA,IAAA,EAAA,GAJAD,CAKV;AAAA,EAAA,CAEH,IAIC,OAAO,UAAU,eAAe,KAAKF,GAAO,SAAS,IAChDA,EAAM,UAIX,OAAO,UAAU,eAAe,KAAKA,GAAO,MAAM,KAAKA,EAAM,SAAS,oBACjEA,EAAM,QAAQ,IAAI,CAACG,GAAWD,MAC3B,gBAAAG,EAAA,OAAA,EAAiB,UAAKF,EAAA,QAAA,GAAbD,CAAqB,CACvC,IAIC,OAAO,UAAU,eAAe,KAAKF,GAAO,KAAK,KAAK,OAAO,UAAU,eAAe,KAAKA,GAAO,SAAS,IACtG,uFAGF;AACT;AAOO,SAASM,EAAM,EAAE,UAAAC,GAAU,SAAAC,GAAS,MAAAC,IAAO,YAA2C;AAC3F,2BACG,OAAI,EAAA,WAAW,eAAeA,CAAI,IAAI,MAAK,SACzC,UAAA;AAAA,IAAAV,EAAYS,CAAO;AAAA,IACnBD;AAAA,EAAA,GACH;AAEJ;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes } from 'react';
|
|
2
|
+
export declare const BUTTON_VARIANTS: string[];
|
|
3
|
+
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
|
+
variant?: (typeof BUTTON_VARIANTS)[keyof typeof BUTTON_VARIANTS] | string;
|
|
5
|
+
}
|
|
6
|
+
export declare const Button: import('react').ForwardRefExoticComponent<ButtonProps & {
|
|
7
|
+
children?: import('react').ReactNode | undefined;
|
|
8
|
+
} & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { c as d } from "../../chunks/index.js";
|
|
3
|
+
import { forwardRef as u } from "react";
|
|
4
|
+
import { registerComponent as c } from "../../registries/components.js";
|
|
5
|
+
const k = [
|
|
6
|
+
"primary",
|
|
7
|
+
"secondary",
|
|
8
|
+
"success",
|
|
9
|
+
"danger",
|
|
10
|
+
"warning",
|
|
11
|
+
"info",
|
|
12
|
+
"light",
|
|
13
|
+
"dark",
|
|
14
|
+
"link",
|
|
15
|
+
"outline-primary",
|
|
16
|
+
"outline-secondary",
|
|
17
|
+
"outline-success",
|
|
18
|
+
"outline-danger",
|
|
19
|
+
"outline-warning",
|
|
20
|
+
"outline-info",
|
|
21
|
+
"outline-light",
|
|
22
|
+
"outline-dark",
|
|
23
|
+
"outline-link"
|
|
24
|
+
], m = u(
|
|
25
|
+
({ variant: t, className: e, children: o, ...n }, l) => /* @__PURE__ */ r(
|
|
26
|
+
"button",
|
|
27
|
+
{
|
|
28
|
+
...n,
|
|
29
|
+
ref: l,
|
|
30
|
+
className: d(
|
|
31
|
+
"btn flex gap-1",
|
|
32
|
+
{
|
|
33
|
+
disabled: n.disabled
|
|
34
|
+
},
|
|
35
|
+
`btn-${t}`,
|
|
36
|
+
e
|
|
37
|
+
),
|
|
38
|
+
disabled: n.disabled,
|
|
39
|
+
onClick: (a) => {
|
|
40
|
+
var i;
|
|
41
|
+
return !n.disabled && ((i = n.onClick) == null ? void 0 : i.call(n, a));
|
|
42
|
+
},
|
|
43
|
+
children: o
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
);
|
|
47
|
+
c("Button", m);
|
|
48
|
+
export {
|
|
49
|
+
k as BUTTON_VARIANTS,
|
|
50
|
+
m as Button
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=Button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../../src/molecules/button/Button.tsx"],"sourcesContent":["import cx from \"classnames\";\nimport { type ButtonHTMLAttributes, forwardRef, type LegacyRef, type PropsWithChildren } from \"react\";\n\nimport { registerComponent } from \"../../registries/components\";\n\nexport const BUTTON_VARIANTS = [\n \"primary\",\n \"secondary\",\n \"success\",\n \"danger\",\n \"warning\",\n \"info\",\n \"light\",\n \"dark\",\n \"link\",\n \"outline-primary\",\n \"outline-secondary\",\n \"outline-success\",\n \"outline-danger\",\n \"outline-warning\",\n \"outline-info\",\n \"outline-light\",\n \"outline-dark\",\n \"outline-link\"\n];\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n variant?: (typeof BUTTON_VARIANTS)[keyof typeof BUTTON_VARIANTS] | string;\n}\n\nexport const Button = forwardRef(\n ({ variant, className, children, ...props }: PropsWithChildren<ButtonProps>, ref: LegacyRef<HTMLButtonElement>) => {\n return (\n <button\n {...props}\n ref={ref}\n className={cx(\n \"btn flex gap-1\",\n {\n disabled: props.disabled\n },\n `btn-${variant}`,\n className\n )}\n disabled={props.disabled}\n onClick={(evt) => !props.disabled && props.onClick?.(evt)}\n >\n {children}\n </button>\n );\n }\n);\n\nregisterComponent(\"Button\", Button);\n"],"names":["BUTTON_VARIANTS","Button","forwardRef","variant","className","children","props","ref","jsx","cx","evt","_a","registerComponent"],"mappings":";;;;AAKO,MAAMA,IAAkB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAMaC,IAASC;AAAA,EACpB,CAAC,EAAE,SAAAC,GAAS,WAAAC,GAAW,UAAAC,GAAU,GAAGC,KAAyCC,MAEzE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGF;AAAA,MACJ,KAAAC;AAAA,MACA,WAAWE;AAAA,QACT;AAAA,QACA;AAAA,UACE,UAAUH,EAAM;AAAA,QAClB;AAAA,QACA,OAAOH,CAAO;AAAA,QACdC;AAAA,MACF;AAAA,MACA,UAAUE,EAAM;AAAA,MAChB,SAAS,CAACI;;AAAQ,gBAACJ,EAAM,cAAYK,IAAAL,EAAM,YAAN,gBAAAK,EAAA,KAAAL,GAAgBI;AAAA;AAAA,MAEpD,UAAAL;AAAA,IAAA;AAAA,EACH;AAGN;AAEAO,EAAkB,UAAUX,CAAM;"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
export interface CardProps {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
export declare function Card({ children, label, className }: PropsWithChildren<CardProps>): React.JSX.Element;
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
export interface CardProps {
|
|
3
|
+
label: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function Card({ children, label, className }: PropsWithChildren<CardProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsxs as d, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { c as s } from "../../chunks/index.js";
|
|
3
|
+
function m({ children: a, label: c, className: e }) {
|
|
4
|
+
return /* @__PURE__ */ d("div", { className: s("card", e), children: [
|
|
5
|
+
/* @__PURE__ */ r("div", { className: "card-header ", children: /* @__PURE__ */ r("h4", { className: "card-title", children: c }) }),
|
|
6
|
+
/* @__PURE__ */ r("div", { className: "card-body", role: "article", children: a })
|
|
7
|
+
] });
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
m as Card
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=Card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.js","sources":["../../../src/molecules/card/Card.tsx"],"sourcesContent":["import classnames from \"classnames\";\nimport { PropsWithChildren } from \"react\";\n\nexport interface CardProps {\n label: string;\n className?: string;\n}\n\nexport function Card({ children, label, className }: PropsWithChildren<CardProps>) {\n return (\n <div className={classnames(\"card\", className)}>\n <div className={\"card-header \"}>\n <h4 className={\"card-title\"}>{label}</h4>\n </div>\n <div className={\"card-body\"} role={\"article\"}>\n {children}\n </div>\n </div>\n );\n}\n"],"names":["Card","children","label","className","classnames","jsx"],"mappings":";;AAQO,SAASA,EAAK,EAAE,UAAAC,GAAU,OAAAC,GAAO,WAAAC,KAA2C;AACjF,2BACG,OAAI,EAAA,WAAWC,EAAW,QAAQD,CAAS,GAC1C,UAAA;AAAA,IAAC,gBAAAE,EAAA,OAAA,EAAI,WAAW,gBACd,UAAA,gBAAAA,EAAC,QAAG,WAAW,cAAe,aAAM,EACtC,CAAA;AAAA,sBACC,OAAI,EAAA,WAAW,aAAa,MAAM,WAChC,UAAAJ,EACH,CAAA;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HTMLAttributes, InputHTMLAttributes, PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
export type BaseFormControlProps<Value = unknown> = {
|
|
3
|
+
label?: string;
|
|
4
|
+
description?: string | ReactNode;
|
|
5
|
+
before?: ReactNode | string;
|
|
6
|
+
after?: ReactNode | string;
|
|
7
|
+
shadow?: boolean;
|
|
8
|
+
value?: Value;
|
|
9
|
+
onChange?: (name: string | undefined, value: Value) => void;
|
|
10
|
+
/**
|
|
11
|
+
* The input size
|
|
12
|
+
*/
|
|
13
|
+
size?: "small" | string;
|
|
14
|
+
};
|
|
15
|
+
export type FormControlProps<Value = unknown, Attributes extends HTMLAttributes<HTMLElement> = InputHTMLAttributes<HTMLInputElement>> = BaseFormControlProps<Value> & Omit<Attributes, "onChange" | "value" | "size">;
|
|
16
|
+
export declare function cleanFormControlProps(props: FormControlProps, omitted?: string[]): any;
|
|
17
|
+
export declare function FormControl<Value = unknown>({ children, name, id, required, before, after, description, label, size, className }: PropsWithChildren<FormControlProps<Value>>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsxs as d, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "../../../chunks/index.js";
|
|
3
|
+
import u from "lodash/omit";
|
|
4
|
+
import { registerComponent as f } from "../../../registries/components.js";
|
|
5
|
+
function C(t, r = []) {
|
|
6
|
+
return u(t, ["label", "description", "prefix", "suffix", "size", "shadow", ...r]);
|
|
7
|
+
}
|
|
8
|
+
function h({
|
|
9
|
+
children: t,
|
|
10
|
+
name: r = "",
|
|
11
|
+
id: n = r,
|
|
12
|
+
required: m,
|
|
13
|
+
before: i,
|
|
14
|
+
after: e,
|
|
15
|
+
description: s,
|
|
16
|
+
label: l,
|
|
17
|
+
size: a,
|
|
18
|
+
className: p
|
|
19
|
+
}) {
|
|
20
|
+
return /* @__PURE__ */ d(
|
|
21
|
+
"div",
|
|
22
|
+
{
|
|
23
|
+
"data-testid": r && `form-group-${r}`,
|
|
24
|
+
id: `form-group-${r || ""}`,
|
|
25
|
+
className: c(
|
|
26
|
+
"form-group",
|
|
27
|
+
{
|
|
28
|
+
"-with-before": !!i,
|
|
29
|
+
"-with-after": !!e
|
|
30
|
+
},
|
|
31
|
+
a && `-size-${a}`,
|
|
32
|
+
p
|
|
33
|
+
),
|
|
34
|
+
children: [
|
|
35
|
+
l && /* @__PURE__ */ o("label", { htmlFor: n, "data-testid": "form-control-label", className: `col-form-label ${m ? " field-required" : ""}`, children: l }),
|
|
36
|
+
/* @__PURE__ */ d("div", { className: "input-group", children: [
|
|
37
|
+
i && /* @__PURE__ */ o("div", { className: "input-group-prepend", children: /* @__PURE__ */ o("span", { className: "input-group-text", "data-testid": "form-control-prefix", children: i }) }),
|
|
38
|
+
t,
|
|
39
|
+
e && /* @__PURE__ */ o("div", { className: "input-group-append", children: /* @__PURE__ */ o("span", { className: "input-group-text", "data-testid": "form-control-suffix", children: e }) })
|
|
40
|
+
] }),
|
|
41
|
+
s && /* @__PURE__ */ o("div", { "data-testid": "form-control-description", className: "form-text text-muted", children: s })
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
f("FormControl", h);
|
|
47
|
+
export {
|
|
48
|
+
h as FormControl,
|
|
49
|
+
C as cleanFormControlProps
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=FormControl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormControl.js","sources":["../../../../src/molecules/forms/form-control/FormControl.tsx"],"sourcesContent":["import classnames from \"classnames\";\nimport omit from \"lodash/omit\";\nimport { HTMLAttributes, InputHTMLAttributes, PropsWithChildren, ReactNode } from \"react\";\n\nimport { registerComponent } from \"../../../registries/components\";\n\nexport type BaseFormControlProps<Value = unknown> = {\n label?: string;\n description?: string | ReactNode;\n before?: ReactNode | string;\n after?: ReactNode | string;\n shadow?: boolean;\n value?: Value;\n onChange?: (name: string | undefined, value: Value) => void;\n /**\n * The input size\n */\n size?: \"small\" | string;\n};\nexport type FormControlProps<\n Value = unknown,\n Attributes extends HTMLAttributes<HTMLElement> = InputHTMLAttributes<HTMLInputElement>\n> = BaseFormControlProps<Value> & Omit<Attributes, \"onChange\" | \"value\" | \"size\">;\n\nexport function cleanFormControlProps(props: FormControlProps, omitted: string[] = []): any {\n return omit(props, [\"label\", \"description\", \"prefix\", \"suffix\", \"size\", \"shadow\", ...omitted]);\n}\n\nexport function FormControl<Value = unknown>({\n children,\n name = \"\",\n id = name,\n required,\n before,\n after,\n description,\n label,\n size,\n className\n}: PropsWithChildren<FormControlProps<Value>>) {\n return (\n <div\n data-testid={name && `form-group-${name}`}\n id={`form-group-${name || \"\"}`}\n className={classnames(\n \"form-group\",\n {\n \"-with-before\": !!before,\n \"-with-after\": !!after\n },\n size && `-size-${size}`,\n className\n )}\n >\n {label && (\n <label htmlFor={id} data-testid='form-control-label' className={`col-form-label ${required ? \" field-required\" : \"\"}`}>\n {label}\n </label>\n )}\n <div className={\"input-group\"}>\n {before && (\n <div className='input-group-prepend'>\n <span className='input-group-text' data-testid='form-control-prefix'>\n {before}\n </span>\n </div>\n )}\n {children}\n {after && (\n <div className='input-group-append'>\n <span className='input-group-text' data-testid='form-control-suffix'>\n {after}\n </span>\n </div>\n )}\n </div>\n {description && (\n <div data-testid='form-control-description' className='form-text text-muted'>\n {description}\n </div>\n )}\n </div>\n );\n}\n\nregisterComponent(\"FormControl\", FormControl);\n"],"names":["cleanFormControlProps","props","omitted","omit","FormControl","children","name","id","required","before","after","description","label","size","className","jsxs","classnames","jsx","registerComponent"],"mappings":";;;;AAwBO,SAASA,EAAsBC,GAAyBC,IAAoB,IAAS;AACnF,SAAAC,EAAKF,GAAO,CAAC,SAAS,eAAe,UAAU,UAAU,QAAQ,UAAU,GAAGC,CAAO,CAAC;AAC/F;AAEO,SAASE,EAA6B;AAAA,EAC3C,UAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,IAAAC,IAAKD;AAAA,EACL,UAAAE;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,WAAAC;AACF,GAA+C;AAE3C,SAAA,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,eAAaT,KAAQ,cAAcA,CAAI;AAAA,MACvC,IAAI,cAAcA,KAAQ,EAAE;AAAA,MAC5B,WAAWU;AAAAA,QACT;AAAA,QACA;AAAA,UACE,gBAAgB,CAAC,CAACP;AAAA,UAClB,eAAe,CAAC,CAACC;AAAA,QACnB;AAAA,QACAG,KAAQ,SAASA,CAAI;AAAA,QACrBC;AAAA,MACF;AAAA,MAEC,UAAA;AAAA,QAAAF,KACE,gBAAAK,EAAA,SAAA,EAAM,SAASV,GAAI,eAAY,sBAAqB,WAAW,kBAAkBC,IAAW,oBAAoB,EAAE,IAChH,UACHI,GAAA;AAAA,QAEF,gBAAAG,EAAC,OAAI,EAAA,WAAW,eACb,UAAA;AAAA,UACCN,KAAA,gBAAAQ,EAAC,OAAI,EAAA,WAAU,uBACb,UAAA,gBAAAA,EAAC,QAAK,EAAA,WAAU,oBAAmB,eAAY,uBAC5C,UAAAR,EACH,CAAA,GACF;AAAA,UAEDJ;AAAA,UACAK,KACC,gBAAAO,EAAC,OAAI,EAAA,WAAU,sBACb,UAAA,gBAAAA,EAAC,QAAK,EAAA,WAAU,oBAAmB,eAAY,uBAC5C,UAAAP,EAAA,CACH,EACF,CAAA;AAAA,QAAA,GAEJ;AAAA,QACCC,KACE,gBAAAM,EAAA,OAAA,EAAI,eAAY,4BAA2B,WAAU,wBACnD,UACHN,EAAA,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAEJ;AAEJ;AAEAO,EAAkB,eAAed,CAAW;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { InputHTMLAttributes } from 'react';
|
|
2
|
+
import { FormControlProps } from '../form-control/FormControl';
|
|
3
|
+
export interface InputTagsProps<Data = string> extends FormControlProps<Data[], InputHTMLAttributes<HTMLInputElement>> {
|
|
4
|
+
layout?: "html5" | "react" | "choicesjs";
|
|
5
|
+
delimiter?: string;
|
|
6
|
+
customProperties?: Record<string, any>;
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputTags.interface.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { registerComponent as d, getComponent as s } from "../../../registries/components.js";
|
|
3
|
+
function I(e) {
|
|
4
|
+
const { name: o, id: t = o, label: i, required: n, description: m, before: a, after: c, size: l, className: p, layout: u = "choicesjs", ...g } = e, f = s("FormControl"), C = s([`InputTags.${u}`, "Input"]);
|
|
5
|
+
return console.log("VALUE", e.value), /* @__PURE__ */ r(
|
|
6
|
+
f,
|
|
7
|
+
{
|
|
8
|
+
id: t,
|
|
9
|
+
name: o,
|
|
10
|
+
label: i,
|
|
11
|
+
required: n,
|
|
12
|
+
description: m,
|
|
13
|
+
before: a,
|
|
14
|
+
after: c,
|
|
15
|
+
size: l,
|
|
16
|
+
className: p,
|
|
17
|
+
children: /* @__PURE__ */ r(C, { ...g, id: t, name: o, required: n })
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
d("InputTags", I);
|
|
22
|
+
export {
|
|
23
|
+
I as InputTags
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=InputTags.js.map
|