@tsed/react-formio 3.0.0-alpha.8 → 3.0.0-rc.1
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/all.d.ts +0 -0
- package/dist/all.js +38 -0
- package/dist/all.js.map +1 -0
- package/dist/atoms/icon/Icon.d.ts +4 -3
- package/dist/atoms/icon/Icon.js +9 -8
- package/dist/atoms/icon/Icon.js.map +1 -1
- package/dist/chunks/_commonjsHelpers.js +30 -3
- package/dist/chunks/_commonjsHelpers.js.map +1 -1
- package/dist/chunks/index.js +33 -30
- package/dist/chunks/index.js.map +1 -1
- package/dist/chunks/index.module.js +16 -16
- package/dist/chunks/index.module.js.map +1 -1
- package/dist/chunks/index2.js +56953 -0
- package/dist/chunks/index2.js.map +1 -0
- package/dist/chunks/react-select-animated.esm.js +3616 -0
- package/dist/chunks/react-select-animated.esm.js.map +1 -0
- package/dist/contexts/FormioContext.d.ts +19 -0
- package/dist/contexts/FormioContext.js +35 -0
- package/dist/contexts/FormioContext.js.map +1 -0
- package/dist/hooks/keyboard.constants.d.ts +38 -0
- package/dist/hooks/keyboard.constants.js +7 -0
- package/dist/hooks/keyboard.constants.js.map +1 -0
- package/dist/hooks/useFormioContext.d.ts +10 -0
- package/dist/hooks/useFormioContext.js +12 -0
- package/dist/hooks/useFormioContext.js.map +1 -0
- package/dist/hooks/useI18n.d.ts +4 -0
- package/dist/hooks/useI18n.js +9 -0
- package/dist/hooks/useI18n.js.map +1 -0
- package/dist/hooks/useKeyboardControls.d.ts +12 -0
- package/dist/hooks/useKeyboardControls.js +35 -0
- package/dist/hooks/useKeyboardControls.js.map +1 -0
- package/dist/hooks/useTooltip.js.map +1 -1
- package/dist/index.d.ts +1 -6
- package/dist/index.js +18 -13
- package/dist/index.js.map +1 -1
- package/dist/interfaces/ComponentType.d.ts +6 -2
- package/dist/interfaces/FormBuilderOptions.d.ts +7 -0
- package/dist/interfaces/FormBuilderOptions.js +2 -0
- package/dist/interfaces/FormBuilderOptions.js.map +1 -0
- package/dist/interfaces/FormOptions.d.ts +6 -13
- package/dist/interfaces/FormType.d.ts +4 -11
- package/dist/interfaces/Operation.d.ts +13 -4
- package/dist/interfaces/SubmissionType.d.ts +5 -10
- package/dist/interfaces/index.d.ts +1 -0
- package/dist/molecules/alert/Alert.js.map +1 -1
- package/dist/molecules/button/Button.d.ts +18 -5
- package/dist/molecules/button/Button.js +24 -28
- package/dist/molecules/button/Button.js.map +1 -1
- package/dist/molecules/card/Card.js +9 -7
- package/dist/molecules/card/Card.js.map +1 -1
- package/dist/molecules/forms/form-control/FormControl.d.ts +14 -12
- package/dist/molecules/forms/form-control/FormControl.js +46 -22
- package/dist/molecules/forms/form-control/FormControl.js.map +1 -1
- package/dist/molecules/forms/input-tags/InputTags.d.ts +2 -8
- 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 +21 -27
- package/dist/molecules/forms/input-tags/InputTags.js.map +1 -1
- 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 +1926 -0
- package/dist/molecules/forms/input-tags/components/ReactTags.js.map +1 -0
- package/dist/molecules/forms/input-text/InputText.d.ts +2 -14
- 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 +46 -56
- package/dist/molecules/forms/input-text/InputText.js.map +1 -1
- package/dist/molecules/forms/select/Select.d.ts +1 -1
- package/dist/molecules/forms/select/{Select.interfaces.d.ts → Select.interface.d.ts} +8 -10
- 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 +9 -10
- package/dist/molecules/forms/select/Select.js.map +1 -1
- package/dist/molecules/forms/select/all.d.ts +1 -1
- package/dist/molecules/forms/select/all.js +1 -0
- package/dist/molecules/forms/select/all.js.map +1 -1
- package/dist/molecules/forms/select/components/ChoicesSelect.d.ts +1 -1
- package/dist/molecules/forms/select/components/ChoicesSelect.js +72 -83
- package/dist/molecules/forms/select/components/ChoicesSelect.js.map +1 -1
- package/dist/molecules/forms/select/components/HtmlSelect.d.ts +1 -1
- package/dist/molecules/forms/select/components/HtmlSelect.js +17 -16
- package/dist/molecules/forms/select/components/HtmlSelect.js.map +1 -1
- package/dist/molecules/forms/select/components/ReactSelect.d.ts +1 -1
- package/dist/molecules/forms/select/components/ReactSelect.js +28 -3034
- package/dist/molecules/forms/select/components/ReactSelect.js.map +1 -1
- package/dist/molecules/forms/select/components/choices.template.js +2340 -2257
- package/dist/molecules/forms/select/components/choices.template.js.map +1 -1
- package/dist/molecules/forms/select/hooks/useOptions.d.ts +3 -3
- package/dist/molecules/forms/select/hooks/useOptions.js +15 -15
- package/dist/molecules/forms/select/hooks/useOptions.js.map +1 -1
- package/dist/molecules/loader/Loader.d.ts +4 -4
- package/dist/molecules/loader/Loader.js +16 -8
- package/dist/molecules/loader/Loader.js.map +1 -1
- package/dist/molecules/modal/Modal.js +23 -24
- package/dist/molecules/modal/Modal.js.map +1 -1
- package/dist/molecules/pagination/Pagination.d.ts +7 -6
- package/dist/molecules/pagination/Pagination.js +48 -57
- package/dist/molecules/pagination/Pagination.js.map +1 -1
- package/dist/molecules/pagination/PaginationButton.js +10 -10
- package/dist/molecules/pagination/PaginationButton.js.map +1 -1
- package/dist/molecules/pagination/all.js +5 -4
- package/dist/molecules/pagination/all.js.map +1 -1
- package/dist/molecules/pagination/utils/getPageNumbers.js.map +1 -0
- package/dist/molecules/table/Table.d.ts +16 -2
- package/dist/molecules/table/Table.js +53 -77
- package/dist/molecules/table/Table.js.map +1 -1
- 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 -1
- package/dist/molecules/table/components/DefaultArrowSort.js +17 -5
- package/dist/molecules/table/components/DefaultArrowSort.js.map +1 -1
- package/dist/molecules/table/components/DefaultCell.d.ts +5 -1
- package/dist/molecules/table/components/DefaultCell.js +8 -6
- package/dist/molecules/table/components/DefaultCell.js.map +1 -1
- 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 +5 -8
- package/dist/molecules/table/components/DefaultCellHeader.js +25 -9
- package/dist/molecules/table/components/DefaultCellHeader.js.map +1 -1
- package/dist/molecules/table/components/DefaultCellOperations.d.ts +16 -10
- package/dist/molecules/table/components/DefaultCellOperations.js +23 -14
- package/dist/molecules/table/components/DefaultCellOperations.js.map +1 -1
- 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 +16 -12
- package/dist/molecules/table/components/DefaultOperationButton.js +16 -31
- package/dist/molecules/table/components/DefaultOperationButton.js.map +1 -1
- 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 +41 -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 +33 -0
- package/dist/molecules/table/filters/SelectFilter.js.map +1 -0
- package/dist/molecules/table/filters/TextFieldFilter.d.ts +3 -0
- package/dist/molecules/table/filters/TextFieldFilter.js +27 -0
- package/dist/molecules/table/filters/TextFieldFilter.js.map +1 -0
- package/dist/molecules/table/hooks/useTable.d.ts +23 -0
- package/dist/molecules/table/hooks/useTable.js +35 -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 +2 -2
- package/dist/molecules/table/utils/mapFormToColumns.js +34 -18
- package/dist/molecules/table/utils/mapFormToColumns.js.map +1 -1
- package/dist/molecules/tabs/Tab.d.ts +13 -0
- package/dist/molecules/tabs/Tab.js +66 -0
- package/dist/molecules/tabs/Tab.js.map +1 -0
- package/dist/molecules/tabs/TabList.d.ts +2 -0
- package/dist/molecules/tabs/TabList.js +23 -0
- package/dist/molecules/tabs/TabList.js.map +1 -0
- package/dist/molecules/tabs/TabPanel.d.ts +9 -0
- package/dist/molecules/tabs/TabPanel.js +27 -0
- package/dist/molecules/tabs/TabPanel.js.map +1 -0
- package/dist/molecules/tabs/Tabs.d.ts +4 -16
- package/dist/molecules/tabs/Tabs.js +7 -67
- package/dist/molecules/tabs/Tabs.js.map +1 -1
- package/dist/molecules/tabs/TabsBody.d.ts +1 -0
- package/dist/molecules/tabs/TabsBody.js +10 -0
- package/dist/molecules/tabs/TabsBody.js.map +1 -0
- package/dist/molecules/tabs/TabsLegacy.d.ts +18 -0
- package/dist/molecules/tabs/TabsLegacy.js +49 -0
- package/dist/molecules/tabs/TabsLegacy.js.map +1 -0
- package/dist/molecules/tabs/all.d.ts +5 -0
- package/dist/molecules/tabs/all.js +13 -0
- package/dist/molecules/tabs/all.js.map +1 -0
- package/dist/molecules/tabs/context/TabControl.d.ts +52 -0
- package/dist/molecules/tabs/context/TabControl.js +85 -0
- package/dist/molecules/tabs/context/TabControl.js.map +1 -0
- package/dist/molecules/tabs/hooks/tabControl.d.ts +44 -0
- package/dist/molecules/tabs/hooks/tabControl.js +34 -0
- package/dist/molecules/tabs/hooks/tabControl.js.map +1 -0
- package/dist/organisms/form/Form.js.map +1 -1
- package/dist/organisms/form/access/FormAccess.js +41 -41
- package/dist/organisms/form/access/FormAccess.js.map +1 -1
- package/dist/organisms/form/access/FormAccess.schema.js +1 -0
- package/dist/organisms/form/access/FormAccess.schema.js.map +1 -1
- package/dist/organisms/form/access/FormAccess.utils.js +2 -2
- package/dist/organisms/form/access/FormAccess.utils.js.map +1 -1
- package/dist/organisms/form/actions/FormAction.js +34 -0
- package/dist/organisms/form/actions/FormAction.js.map +1 -0
- package/dist/organisms/form/builder/FormBuilder.js.map +1 -1
- package/dist/organisms/form/builder/FormEdit.d.ts +7 -3
- package/dist/organisms/form/builder/FormEdit.js +46 -42
- package/dist/organisms/form/builder/FormEdit.js.map +1 -1
- package/dist/organisms/form/builder/FormEdit.reducer.js.map +1 -1
- package/dist/organisms/form/builder/FormEditCtas.d.ts +2 -2
- package/dist/organisms/form/builder/FormEditCtas.js +36 -35
- package/dist/organisms/form/builder/FormEditCtas.js.map +1 -1
- package/dist/organisms/form/builder/FormParameters.d.ts +3 -2
- package/dist/organisms/form/builder/FormParameters.js +19 -18
- package/dist/organisms/form/builder/FormParameters.js.map +1 -1
- package/dist/organisms/form/builder/all.js +17 -13
- package/dist/organisms/form/builder/all.js.map +1 -1
- package/dist/organisms/form/builder/useFormBuilder.d.ts +4 -4
- package/dist/organisms/form/builder/useFormBuilder.js +36 -33
- package/dist/organisms/form/builder/useFormBuilder.js.map +1 -1
- package/dist/organisms/form/builder/useFormEdit.d.ts +2 -2
- package/dist/organisms/form/builder/useFormEdit.js +1 -1
- package/dist/organisms/form/builder/useFormEdit.js.map +1 -1
- package/dist/organisms/form/exports/FormExport.d.ts +6 -0
- package/dist/organisms/form/exports/FormExport.js +56 -0
- package/dist/organisms/form/exports/FormExport.js.map +1 -0
- package/dist/organisms/form/preview/FormPreview.d.ts +6 -0
- package/dist/organisms/form/preview/FormPreview.js +12 -0
- package/dist/organisms/form/preview/FormPreview.js.map +1 -0
- package/dist/organisms/form/settings/FormSettings.js +28 -28
- package/dist/organisms/form/settings/FormSettings.js.map +1 -1
- package/dist/organisms/form/settings/FormSettings.schema.js.map +1 -1
- package/dist/organisms/form/settings/FormSettings.utils.js.map +1 -1
- package/dist/organisms/form/useForm.d.ts +2 -1
- package/dist/organisms/form/useForm.js +664 -661
- package/dist/organisms/form/useForm.js.map +1 -1
- package/dist/organisms/modal/RemoveModal.js +16 -17
- package/dist/organisms/modal/RemoveModal.js.map +1 -1
- package/dist/organisms/table/actions/ActionsTable.d.ts +4 -3
- package/dist/organisms/table/actions/ActionsTable.js +21 -33
- package/dist/organisms/table/actions/ActionsTable.js.map +1 -1
- package/dist/organisms/table/forms/FormsTable.d.ts +2 -3
- package/dist/organisms/table/forms/FormsTable.js +48 -27
- package/dist/organisms/table/forms/FormsTable.js.map +1 -1
- 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 +12 -4
- package/dist/organisms/table/submissions/SubmissionsTable.js +10 -17
- package/dist/organisms/table/submissions/SubmissionsTable.js.map +1 -1
- package/dist/organisms/views/FormViews.d.ts +24 -0
- package/dist/organisms/views/FormViews.js +97 -0
- package/dist/organisms/views/FormViews.js.map +1 -0
- package/dist/registries/components.js +12 -11
- package/dist/registries/components.js.map +1 -1
- package/dist/utils/getEventValue.js.map +1 -1
- package/dist/utils/iconClass.js +4 -5
- package/dist/utils/iconClass.js.map +1 -1
- package/dist/utils/mapPagination.js.map +1 -1
- package/dist/utils/stopPropagationWrapper.js.map +1 -1
- package/package.json +10 -8
- package/readme.md +7 -8
- package/src/all.ts +34 -0
- package/src/atoms/icon/Icon.stories.tsx +71 -22
- package/src/atoms/icon/Icon.tsx +14 -4
- package/src/contexts/FormioContext.tsx +89 -0
- package/src/hooks/keyboard.constants.ts +40 -0
- package/src/hooks/useFormioContext.ts +13 -0
- package/src/hooks/useI18n.ts +9 -0
- package/src/hooks/useKeyboardControls.spec.tsx +208 -0
- package/src/hooks/useKeyboardControls.ts +84 -0
- package/src/index.ts +17 -13
- package/src/interfaces/ComponentType.ts +2 -2
- package/src/interfaces/FormBuilderOptions.ts +9 -0
- package/src/interfaces/FormOptions.ts +7 -13
- package/src/interfaces/FormType.ts +5 -11
- package/src/interfaces/Operation.ts +10 -4
- package/src/interfaces/SubmissionType.ts +9 -8
- package/src/interfaces/index.ts +1 -0
- package/src/molecules/__fixtures__/build.js +28 -0
- package/src/molecules/__fixtures__/form-schema.json +76 -195
- package/src/molecules/__fixtures__/form-submissions.json +11846 -46
- package/src/molecules/__fixtures__/products.json +81539 -0
- package/src/molecules/button/Button.stories.tsx +1 -1
- package/src/molecules/button/Button.tsx +43 -24
- package/src/molecules/card/Card.tsx +4 -0
- package/src/molecules/forms/form-control/FormControl.spec.tsx +7 -4
- package/src/molecules/forms/form-control/FormControl.stories.tsx +4 -4
- package/src/molecules/forms/form-control/FormControl.tsx +46 -20
- package/src/molecules/forms/input-tags/InputTags.interface.ts +9 -0
- package/src/molecules/forms/input-tags/InputTags.tsx +20 -42
- 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/molecules/forms/input-text/InputText.spec.tsx +1 -1
- package/src/molecules/forms/input-text/InputText.stories.tsx +4 -4
- package/src/molecules/forms/input-text/InputText.tsx +38 -53
- package/src/molecules/forms/select/{Select.interfaces.ts → Select.interface.ts} +8 -10
- package/src/molecules/forms/select/Select.tsx +5 -3
- package/src/molecules/forms/select/all.ts +2 -1
- package/src/molecules/forms/select/components/ChoicesSelect.stories.tsx +8 -7
- package/src/molecules/forms/select/components/ChoicesSelect.tsx +9 -18
- package/src/molecules/forms/select/components/HtmlSelect.stories.tsx +7 -7
- package/src/molecules/forms/select/components/HtmlSelect.tsx +3 -2
- package/src/molecules/forms/select/components/ReactSelect.stories.tsx +10 -8
- package/src/molecules/forms/select/components/ReactSelect.tsx +1 -1
- package/src/molecules/forms/select/hooks/useOptions.ts +6 -2
- package/src/molecules/loader/Loader.spec.tsx +2 -2
- package/src/molecules/loader/Loader.stories.tsx +7 -4
- package/src/molecules/loader/Loader.tsx +16 -6
- package/src/molecules/modal/Modal.stories.tsx +1 -1
- package/src/molecules/pagination/Pagination.spec.tsx +11 -11
- package/src/molecules/pagination/Pagination.stories.tsx +32 -10
- package/src/molecules/pagination/Pagination.tsx +29 -26
- package/src/molecules/table/Table.stories.tsx +284 -101
- package/src/molecules/table/Table.tsx +91 -86
- package/src/molecules/table/all.ts +16 -0
- package/src/molecules/table/components/DefaultArrowSort.tsx +20 -4
- package/src/molecules/table/components/DefaultCell.tsx +10 -1
- package/src/molecules/table/components/DefaultCellFooter.tsx +16 -0
- package/src/molecules/table/components/DefaultCellHeader.tsx +33 -13
- package/src/molecules/table/components/DefaultCellOperations.tsx +31 -20
- package/src/molecules/table/components/DefaultFilter.tsx +42 -0
- package/src/molecules/table/components/DefaultOperationButton.tsx +19 -34
- 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 +76 -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 +69 -26
- package/src/molecules/tabs/Tab.tsx +106 -0
- package/src/molecules/tabs/TabList.tsx +37 -0
- package/src/molecules/tabs/TabPanel.tsx +37 -0
- package/src/molecules/tabs/Tabs.spec.tsx +126 -73
- package/src/molecules/tabs/Tabs.stories.tsx +298 -65
- package/src/molecules/tabs/Tabs.tsx +10 -81
- package/src/molecules/tabs/TabsBody.tsx +11 -0
- package/src/molecules/tabs/TabsLegacy.stories.tsx +103 -0
- package/src/molecules/tabs/TabsLegacy.tsx +86 -0
- package/src/molecules/tabs/all.ts +5 -0
- package/src/molecules/tabs/context/TabControl.tsx +166 -0
- package/src/molecules/tabs/hooks/tabControl.spec.tsx +388 -0
- package/src/molecules/tabs/hooks/tabControl.ts +52 -0
- package/src/organisms/__fixtures__/form-firstname.fixture.json +1 -0
- package/src/organisms/__fixtures__/form.fixture.json +1 -0
- package/src/organisms/form/Form.stories.tsx +104 -124
- package/src/organisms/form/access/FormAccess.schema.ts +1 -0
- package/src/organisms/form/access/FormAccess.stories.tsx +6 -4
- package/src/organisms/form/actions/FormAction.stories.tsx +426 -0
- package/src/organisms/form/{action → actions}/FormAction.tsx +2 -2
- package/src/organisms/form/builder/FormBuilder.stories.tsx +7 -4
- package/src/organisms/form/builder/FormEdit.reducer.spec.ts +136 -0
- package/src/organisms/form/builder/FormEdit.stories.tsx +16 -13
- package/src/organisms/form/builder/FormEdit.tsx +15 -7
- package/src/organisms/form/builder/FormEditCtas.tsx +10 -10
- package/src/organisms/form/builder/FormParameters.tsx +8 -4
- package/src/organisms/form/builder/all.ts +4 -0
- package/src/organisms/form/builder/useFormBuilder.ts +12 -7
- package/src/organisms/form/builder/useFormEdit.ts +3 -3
- package/src/organisms/form/exports/FormExport.stories.tsx +68 -0
- package/src/organisms/form/exports/FormExport.tsx +61 -0
- package/src/organisms/form/preview/FormPreview.stories.tsx +58 -0
- package/src/organisms/form/preview/FormPreview.tsx +23 -0
- package/src/organisms/form/settings/FormSettings.component.spec.tsx +3 -1
- package/src/organisms/form/settings/FormSettings.stories.tsx +2 -2
- package/src/organisms/form/settings/FormSettings.tsx +6 -6
- package/src/organisms/form/useForm.ts +2 -3
- package/src/organisms/modal/RemoveModal.stories.tsx +1 -1
- package/src/organisms/table/actions/ActionsTable.spec.tsx +7 -5
- package/src/organisms/table/actions/ActionsTable.stories.tsx +48 -45
- package/src/organisms/table/actions/ActionsTable.tsx +14 -18
- package/src/organisms/table/forms/FormsTable.stories.tsx +2 -0
- package/src/organisms/table/forms/FormsTable.tsx +53 -23
- package/src/organisms/table/forms/components/FormsCell.tsx +53 -0
- package/src/organisms/table/submissions/SubmissionsTable.stories.tsx +101 -57
- package/src/organisms/table/submissions/SubmissionsTable.tsx +12 -5
- package/src/organisms/views/FormViews.stories.tsx +221 -0
- package/src/organisms/views/FormViews.tsx +148 -0
- package/src/registries/components.ts +7 -1
- package/src/utils/iconClass.ts +1 -3
- package/vite.config.mts +2 -2
- package/dist/molecules/forms/select/Select.interfaces.js +0 -2
- package/dist/molecules/forms/select/Select.interfaces.js.map +0 -1
- package/dist/molecules/table/components/DefaultCells.d.ts +0 -4
- package/dist/molecules/table/components/DefaultCells.js +0 -23
- package/dist/molecules/table/components/DefaultCells.js.map +0 -1
- package/dist/molecules/table/components/DefaultRow.d.ts +0 -12
- package/dist/molecules/table/components/DefaultRow.js +0 -26
- package/dist/molecules/table/components/DefaultRow.js.map +0 -1
- package/dist/molecules/table/components/DragNDropContainer.d.ts +0 -4
- package/dist/molecules/table/components/DragNDropContainer.js +0 -10
- package/dist/molecules/table/components/DragNDropContainer.js.map +0 -1
- package/dist/molecules/table/filters/DefaultColumnFilter.d.ts +0 -10
- package/dist/molecules/table/filters/DefaultColumnFilter.js +0 -29
- package/dist/molecules/table/filters/DefaultColumnFilter.js.map +0 -1
- package/dist/molecules/table/filters/SelectColumnFilter.d.ts +0 -10
- package/dist/molecules/table/filters/SelectColumnFilter.js +0 -34
- package/dist/molecules/table/filters/SelectColumnFilter.js.map +0 -1
- package/dist/molecules/table/filters/SliderColumnFilter.d.ts +0 -9
- package/dist/molecules/table/filters/SliderColumnFilter.js +0 -27
- package/dist/molecules/table/filters/SliderColumnFilter.js.map +0 -1
- package/dist/molecules/table/hooks/useCustomTable.d.ts +0 -128
- package/dist/molecules/table/hooks/useCustomTable.js +0 -130
- package/dist/molecules/table/hooks/useCustomTable.js.map +0 -1
- package/dist/molecules/table/hooks/useDragnDropRow.d.ts +0 -272
- package/dist/molecules/table/hooks/useDragnDropRow.js +0 -40
- package/dist/molecules/table/hooks/useDragnDropRow.js.map +0 -1
- package/dist/molecules/table/hooks/useOperations.d.ts +0 -11
- package/dist/molecules/table/hooks/useOperations.js +0 -25
- package/dist/molecules/table/hooks/useOperations.js.map +0 -1
- package/dist/molecules/table/index.d.ts +0 -15
- package/dist/molecules/table/index.js +0 -35
- package/dist/molecules/table/index.js.map +0 -1
- package/dist/molecules/table/utils/getPageNumbers.js.map +0 -1
- package/dist/molecules/table/utils/swapElements.d.ts +0 -1
- package/dist/molecules/table/utils/swapElements.js +0 -5
- package/dist/molecules/table/utils/swapElements.js.map +0 -1
- package/dist/organisms/form/action/FormAction.js +0 -32
- package/dist/organisms/form/action/FormAction.js.map +0 -1
- package/dist/organisms/table/forms/components/FormCell.d.ts +0 -6
- package/dist/organisms/table/forms/components/FormCell.js +0 -50
- package/dist/organisms/table/forms/components/FormCell.js.map +0 -1
- package/dist/typings.d.js +0 -2
- package/dist/typings.d.js.map +0 -1
- package/src/molecules/forms/input-tags/InputTags.stories.tsx +0 -81
- package/src/molecules/table/components/DefaultCells.tsx +0 -30
- package/src/molecules/table/components/DefaultRow.tsx +0 -52
- package/src/molecules/table/components/DragNDropContainer.tsx +0 -7
- package/src/molecules/table/filters/DefaultColumnFilter.spec.tsx +0 -33
- package/src/molecules/table/filters/DefaultColumnFilter.tsx +0 -38
- package/src/molecules/table/filters/SelectColumnFilter.spec.tsx +0 -68
- package/src/molecules/table/filters/SelectColumnFilter.tsx +0 -51
- package/src/molecules/table/filters/SliderColumnFilter.tsx +0 -28
- package/src/molecules/table/hooks/useCustomTable.tsx +0 -268
- package/src/molecules/table/hooks/useDragnDropRow.ts +0 -80
- package/src/molecules/table/hooks/useOperations.tsx +0 -39
- package/src/molecules/table/index.ts +0 -15
- package/src/molecules/table/utils/swapElements.spec.ts +0 -7
- package/src/molecules/table/utils/swapElements.ts +0 -7
- package/src/organisms/form/action/FormAction.stories.tsx +0 -364
- package/src/organisms/table/forms/components/FormCell.tsx +0 -47
- package/src/typings.d.ts +0 -3
- package/tsconfig.app.json +0 -11
- package/tsconfig.json +0 -21
- package/tsconfig.node.json +0 -13
- package/tsconfig.spec.json +0 -14
- /package/dist/molecules/{table → pagination}/utils/getPageNumbers.d.ts +0 -0
- /package/dist/molecules/{table → pagination}/utils/getPageNumbers.js +0 -0
- /package/dist/organisms/form/{action → actions}/FormAction.d.ts +0 -0
- /package/src/molecules/{table → pagination}/utils/getPageNumbers.ts +0 -0
|
@@ -1,59 +1,47 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import { c as
|
|
3
|
-
import
|
|
4
|
-
import { useState as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import "../../../molecules/
|
|
8
|
-
import "
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import "react-dnd";
|
|
12
|
-
import { Table as A } from "../../../molecules/table/Table.js";
|
|
13
|
-
import "formiojs";
|
|
14
|
-
function B({
|
|
15
|
-
disableFilters: s = !0,
|
|
16
|
-
disablePagination: c = !0,
|
|
17
|
-
availableActions: r = [],
|
|
18
|
-
onAddAction: m = b,
|
|
19
|
-
...e
|
|
20
|
-
}) {
|
|
21
|
-
const { i18n: i = (a) => a } = e, [t, l] = f(""), d = [
|
|
1
|
+
import { jsx as o, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { c as m } from "../../../chunks/index.js";
|
|
3
|
+
import d from "lodash/noop";
|
|
4
|
+
import { useState as p } from "react";
|
|
5
|
+
import { useI18n as u } from "../../../hooks/useI18n.js";
|
|
6
|
+
import { Select as b } from "../../../molecules/forms/select/Select.js";
|
|
7
|
+
import { Table as f } from "../../../molecules/table/Table.js";
|
|
8
|
+
import { iconClass as h } from "../../../utils/iconClass.js";
|
|
9
|
+
function T({ availableActions: n = [], onAddAction: c = d, ...a }) {
|
|
10
|
+
const { t: e } = u(a.i18n), [t, s] = p(""), r = [
|
|
22
11
|
{
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
id: "title"
|
|
12
|
+
header: e("Action"),
|
|
13
|
+
accessorKey: "title"
|
|
26
14
|
}
|
|
27
15
|
];
|
|
28
|
-
return /* @__PURE__ */ o(
|
|
16
|
+
return /* @__PURE__ */ o(f, { ...a, columns: r, children: /* @__PURE__ */ i("div", { className: "pagination-group", children: [
|
|
29
17
|
/* @__PURE__ */ o(
|
|
30
|
-
|
|
18
|
+
b,
|
|
31
19
|
{
|
|
32
20
|
"data-testid": "action-table-select",
|
|
33
21
|
name: "actions",
|
|
34
22
|
value: t,
|
|
35
|
-
options: [{ label:
|
|
36
|
-
onChange: (
|
|
23
|
+
options: [{ label: e("Select an action"), value: "" }].concat(n),
|
|
24
|
+
onChange: (v, l) => s(l)
|
|
37
25
|
}
|
|
38
26
|
),
|
|
39
|
-
/* @__PURE__ */ o("div", { className: "pl-3", children: /* @__PURE__ */
|
|
27
|
+
/* @__PURE__ */ o("div", { className: "pl-3", children: /* @__PURE__ */ i(
|
|
40
28
|
"button",
|
|
41
29
|
{
|
|
42
30
|
"data-testid": "action-table-add",
|
|
43
31
|
disabled: t === "",
|
|
44
32
|
className: "btn btn-success",
|
|
45
|
-
onClick: () => t &&
|
|
33
|
+
onClick: () => t && c(t),
|
|
46
34
|
type: "submit",
|
|
47
35
|
children: [
|
|
48
|
-
/* @__PURE__ */ o("i", { className:
|
|
36
|
+
/* @__PURE__ */ o("i", { className: m(h(void 0, "plus"), "mr-1") }),
|
|
49
37
|
" ",
|
|
50
|
-
|
|
38
|
+
e("Add action")
|
|
51
39
|
]
|
|
52
40
|
}
|
|
53
41
|
) })
|
|
54
42
|
] }) });
|
|
55
43
|
}
|
|
56
44
|
export {
|
|
57
|
-
|
|
45
|
+
T as ActionsTable
|
|
58
46
|
};
|
|
59
47
|
//# sourceMappingURL=ActionsTable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionsTable.js","sources":["../../../../src/organisms/table/actions/ActionsTable.tsx"],"sourcesContent":["import classnames from \"classnames\";\nimport noop from \"lodash/noop\";\nimport { useState } from \"react\";\n\nimport { ActionType } from \"../../../interfaces\";\nimport { Select } from \"../../../molecules/forms/select/Select\";\nimport { Table, type TableProps } from \"../../../molecules/table\";\nimport { iconClass } from \"../../../utils/iconClass\";\n\nexport type ActionsTableProps = Omit<TableProps<ActionType>, \"columns\"> & {\n onAddAction?: (actionName: string) => void;\n availableActions?: { label: string; value: string }[];\n};\n\nexport function ActionsTable({
|
|
1
|
+
{"version":3,"file":"ActionsTable.js","sources":["../../../../src/organisms/table/actions/ActionsTable.tsx"],"sourcesContent":["import { ColumnDef } from \"@tanstack/react-table\";\nimport classnames from \"classnames\";\nimport noop from \"lodash/noop\";\nimport { useState } from \"react\";\n\nimport { useI18n } from \"../../../hooks/useI18n.js\";\nimport { ActionType, type FormOptions } from \"../../../interfaces\";\nimport { Select } from \"../../../molecules/forms/select/Select\";\nimport { Table, type TableProps } from \"../../../molecules/table/Table\";\nimport { iconClass } from \"../../../utils/iconClass\";\n\nexport type ActionsTableProps = Omit<TableProps<ActionType>, \"columns\"> & {\n onAddAction?: (actionName: string) => void;\n availableActions?: { label: string; value: string }[];\n i18n?: FormOptions[\"i18n\"];\n};\n\nexport function ActionsTable({ availableActions = [], onAddAction = noop, ...props }: ActionsTableProps) {\n const { t } = useI18n(props.i18n);\n const [currentAction, setAction] = useState(\"\");\n\n const columns: ColumnDef<ActionType>[] = [\n {\n header: t(\"Action\"),\n accessorKey: \"title\"\n }\n ];\n\n return (\n <Table {...props} columns={columns}>\n <div className={\"pagination-group\"}>\n <Select\n data-testid={\"action-table-select\"}\n name={\"actions\"}\n value={currentAction}\n options={[{ label: t(\"Select an action\"), value: \"\" }].concat(availableActions)}\n onChange={(_, action) => setAction(action)}\n />\n <div className={\"pl-3\"}>\n <button\n data-testid={\"action-table-add\"}\n disabled={currentAction === \"\"}\n className={\"btn btn-success\"}\n onClick={() => currentAction && onAddAction(currentAction)}\n type={\"submit\"}\n >\n <i className={classnames(iconClass(undefined, \"plus\"), \"mr-1\")} /> {t(\"Add action\")}\n </button>\n </div>\n </div>\n </Table>\n );\n}\n"],"names":["ActionsTable","availableActions","onAddAction","noop","props","t","useI18n","currentAction","setAction","useState","columns","jsx","Table","jsxs","Select","_","action","classnames","iconClass"],"mappings":";;;;;;;;AAiBO,SAASA,EAAa,EAAE,kBAAAC,IAAmB,CAAA,GAAI,aAAAC,IAAcC,GAAM,GAAGC,KAA4B;AACvG,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAQF,EAAM,IAAI,GAC1B,CAACG,GAAeC,CAAS,IAAIC,EAAS,EAAE,GAExCC,IAAmC;AAAA,IACvC;AAAA,MACE,QAAQL,EAAE,QAAQ;AAAA,MAClB,aAAa;AAAA,IAAA;AAAA,EACf;AAGF,SACE,gBAAAM,EAACC,KAAO,GAAGR,GAAO,SAAAM,GAChB,UAAA,gBAAAG,EAAC,OAAA,EAAI,WAAW,oBACd,UAAA;AAAA,IAAA,gBAAAF;AAAA,MAACG;AAAA,MAAA;AAAA,QACC,eAAa;AAAA,QACb,MAAM;AAAA,QACN,OAAOP;AAAA,QACP,SAAS,CAAC,EAAE,OAAOF,EAAE,kBAAkB,GAAG,OAAO,GAAA,CAAI,EAAE,OAAOJ,CAAgB;AAAA,QAC9E,UAAU,CAACc,GAAGC,MAAWR,EAAUQ,CAAM;AAAA,MAAA;AAAA,IAAA;AAAA,IAE3C,gBAAAL,EAAC,OAAA,EAAI,WAAW,QACd,UAAA,gBAAAE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,eAAa;AAAA,QACb,UAAUN,MAAkB;AAAA,QAC5B,WAAW;AAAA,QACX,SAAS,MAAMA,KAAiBL,EAAYK,CAAa;AAAA,QACzD,MAAM;AAAA,QAEN,UAAA;AAAA,UAAA,gBAAAI,EAAC,KAAA,EAAE,WAAWM,EAAWC,EAAU,QAAW,MAAM,GAAG,MAAM,GAAG;AAAA,UAAE;AAAA,UAAEb,EAAE,YAAY;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,EACpF,CACF;AAAA,EAAA,EAAA,CACF,EAAA,CACF;AAEJ;"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { FormType } from '../../../interfaces';
|
|
2
|
-
import { TableProps } from '../../../molecules/table';
|
|
2
|
+
import { TableProps } from '../../../molecules/table/Table';
|
|
3
3
|
export type FormsTableProps = Omit<TableProps<FormType>, "columns"> & {
|
|
4
|
-
icon?: string;
|
|
5
4
|
tags?: {
|
|
6
5
|
label: string;
|
|
7
6
|
value: string;
|
|
8
7
|
}[];
|
|
9
8
|
};
|
|
10
|
-
export declare function FormsTable({
|
|
9
|
+
export declare function FormsTable({ tags, ...props }: FormsTableProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,37 +1,58 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import "
|
|
3
|
-
import "../../../
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import "react-table";
|
|
9
|
-
import "../../../molecules/pagination/Pagination.js";
|
|
10
|
-
import "lodash/omit";
|
|
11
|
-
import "react-dnd";
|
|
12
|
-
import { Table as a } from "../../../molecules/table/Table.js";
|
|
13
|
-
import { FormsCell as u } from "./components/FormCell.js";
|
|
14
|
-
function S({ Cell: l, ...e }) {
|
|
15
|
-
const { i18n: r = (t) => t, tags: i } = e, c = l || u, n = [
|
|
2
|
+
import "./components/FormsCell.js";
|
|
3
|
+
import { useI18n as a } from "../../../hooks/useI18n.js";
|
|
4
|
+
import { Table as c } from "../../../molecules/table/Table.js";
|
|
5
|
+
import { getComponent as m } from "../../../registries/components.js";
|
|
6
|
+
function T({ tags: r, ...t }) {
|
|
7
|
+
const { t: e } = a(t.i18n), l = m("FormsCell"), s = [
|
|
16
8
|
{
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
9
|
+
header: e("Title"),
|
|
10
|
+
accessorKey: "title",
|
|
11
|
+
cell: (n) => /* @__PURE__ */ o(l, { ...n, i18n: e }),
|
|
12
|
+
meta: {
|
|
13
|
+
cellProps: {
|
|
14
|
+
colSpan: 2
|
|
15
|
+
}
|
|
16
|
+
}
|
|
23
17
|
},
|
|
24
18
|
{
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
19
|
+
header: e("Tags"),
|
|
20
|
+
accessorKey: "tags",
|
|
21
|
+
meta: {
|
|
22
|
+
cellProps: {
|
|
23
|
+
hidden: !0
|
|
24
|
+
},
|
|
25
|
+
filter: {
|
|
26
|
+
variant: "select",
|
|
27
|
+
layout: "react",
|
|
28
|
+
options: r
|
|
29
|
+
}
|
|
30
|
+
}
|
|
30
31
|
}
|
|
32
|
+
// {
|
|
33
|
+
// Header: i18n("Title"),
|
|
34
|
+
// accessor: "title",
|
|
35
|
+
// id: "title",
|
|
36
|
+
// Cell: (props: any) => <FormCell {...props} icon={props.icon} i18n={i18n} />,
|
|
37
|
+
// Filter: DefaultColumnFilter,
|
|
38
|
+
// colspan: 2
|
|
39
|
+
// },
|
|
40
|
+
// {
|
|
41
|
+
// Header: i18n("Tags"),
|
|
42
|
+
// accessor: "tags",
|
|
43
|
+
// id: "tags",
|
|
44
|
+
// hidden: true,
|
|
45
|
+
// Filter: (props: any) =>
|
|
46
|
+
// tags && tags.length ? (
|
|
47
|
+
// <SelectColumnFilter {...props} column={{ ...props.columns, choices: tags }} />
|
|
48
|
+
// ) : (
|
|
49
|
+
// <DefaultColumnFilter {...props} />
|
|
50
|
+
// )
|
|
51
|
+
// }
|
|
31
52
|
];
|
|
32
|
-
return /* @__PURE__ */ o(
|
|
53
|
+
return /* @__PURE__ */ o(c, { ...t, columns: s });
|
|
33
54
|
}
|
|
34
55
|
export {
|
|
35
|
-
|
|
56
|
+
T as FormsTable
|
|
36
57
|
};
|
|
37
58
|
//# sourceMappingURL=FormsTable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormsTable.js","sources":["../../../../src/organisms/table/forms/FormsTable.tsx"],"sourcesContent":["import type { FormType } from \"../../../interfaces\";\nimport {
|
|
1
|
+
{"version":3,"file":"FormsTable.js","sources":["../../../../src/organisms/table/forms/FormsTable.tsx"],"sourcesContent":["import \"./components/FormsCell.js\";\n\nimport { ColumnDef } from \"@tanstack/react-table\";\n\nimport { useI18n } from \"../../../hooks/useI18n.js\";\nimport type { FormType } from \"../../../interfaces\";\nimport { Table, TableProps } from \"../../../molecules/table/Table\";\nimport { getComponent } from \"../../../registries/components.js\";\nimport { FormsCell } from \"./components/FormsCell.js\";\n\nexport type FormsTableProps = Omit<TableProps<FormType>, \"columns\"> & {\n tags?: { label: string; value: string }[];\n};\n\nexport function FormsTable({ tags, ...props }: FormsTableProps) {\n const { t } = useI18n(props.i18n);\n const Cell = getComponent<typeof FormsCell>(\"FormsCell\");\n\n const columns: ColumnDef<any>[] = [\n {\n header: t(\"Title\"),\n accessorKey: \"title\",\n cell: (context) => <Cell {...context} i18n={t} />,\n meta: {\n cellProps: {\n colSpan: 2\n }\n }\n },\n {\n header: t(\"Tags\"),\n accessorKey: \"tags\",\n meta: {\n cellProps: {\n hidden: true\n },\n filter: {\n variant: \"select\",\n layout: \"react\",\n options: tags\n }\n }\n }\n // {\n // Header: i18n(\"Title\"),\n // accessor: \"title\",\n // id: \"title\",\n // Cell: (props: any) => <FormCell {...props} icon={props.icon} i18n={i18n} />,\n // Filter: DefaultColumnFilter,\n // colspan: 2\n // },\n // {\n // Header: i18n(\"Tags\"),\n // accessor: \"tags\",\n // id: \"tags\",\n // hidden: true,\n // Filter: (props: any) =>\n // tags && tags.length ? (\n // <SelectColumnFilter {...props} column={{ ...props.columns, choices: tags }} />\n // ) : (\n // <DefaultColumnFilter {...props} />\n // )\n // }\n ];\n\n return <Table {...(props as any)} columns={columns} />;\n}\n"],"names":["FormsTable","tags","props","t","useI18n","Cell","getComponent","columns","context","jsx","Table"],"mappings":";;;;;AAcO,SAASA,EAAW,EAAE,MAAAC,GAAM,GAAGC,KAA0B;AAC9D,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAQF,EAAM,IAAI,GAC1BG,IAAOC,EAA+B,WAAW,GAEjDC,IAA4B;AAAA,IAChC;AAAA,MACE,QAAQJ,EAAE,OAAO;AAAA,MACjB,aAAa;AAAA,MACb,MAAM,CAACK,MAAY,gBAAAC,EAACJ,KAAM,GAAGG,GAAS,MAAML,GAAG;AAAA,MAC/C,MAAM;AAAA,QACJ,WAAW;AAAA,UACT,SAAS;AAAA,QAAA;AAAA,MACX;AAAA,IACF;AAAA,IAEF;AAAA,MACE,QAAQA,EAAE,MAAM;AAAA,MAChB,aAAa;AAAA,MACb,MAAM;AAAA,QACJ,WAAW;AAAA,UACT,QAAQ;AAAA,QAAA;AAAA,QAEV,QAAQ;AAAA,UACN,SAAS;AAAA,UACT,QAAQ;AAAA,UACR,SAASF;AAAA,QAAA;AAAA,MACX;AAAA,IACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EACF;AAuBF,SAAO,gBAAAQ,EAACC,GAAA,EAAO,GAAIR,GAAe,SAAAK,EAAA,CAAkB;AACtD;"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsxs as e, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { c as t } from "../../../../chunks/index.js";
|
|
3
|
+
import m from "moment";
|
|
4
|
+
import { registerComponent as c } from "../../../../registries/components.js";
|
|
5
|
+
import { iconClass as s } from "../../../../utils/iconClass.js";
|
|
6
|
+
import { stopPropagationWrapper as n } from "../../../../utils/stopPropagationWrapper.js";
|
|
7
|
+
function p(i) {
|
|
8
|
+
const {
|
|
9
|
+
row: { original: a }
|
|
10
|
+
} = i;
|
|
11
|
+
return /* @__PURE__ */ e("div", { className: "p-1", children: [
|
|
12
|
+
/* @__PURE__ */ e("h4", { className: "text-primary text-lg flex space-x-2 items-center", children: [
|
|
13
|
+
/* @__PURE__ */ r("i", { className: t(s(void 0, "server"), "text-secondary") }),
|
|
14
|
+
/* @__PURE__ */ r("span", { children: a.title })
|
|
15
|
+
] }),
|
|
16
|
+
/* @__PURE__ */ e("ul", { className: "reset-list text-gray-500", children: [
|
|
17
|
+
/* @__PURE__ */ e("li", { className: "text-sm", children: [
|
|
18
|
+
"Name: ",
|
|
19
|
+
a.name || a.machineName
|
|
20
|
+
] }),
|
|
21
|
+
/* @__PURE__ */ e("li", { className: "mt-5 flex space-x-1", children: [
|
|
22
|
+
/* @__PURE__ */ e("span", { className: "badge bg-light flex space-x-1", children: [
|
|
23
|
+
/* @__PURE__ */ r("i", { className: s(void 0, "history") }),
|
|
24
|
+
/* @__PURE__ */ e("span", { children: [
|
|
25
|
+
"Updated ",
|
|
26
|
+
m(a.modified).fromNow()
|
|
27
|
+
] })
|
|
28
|
+
] }),
|
|
29
|
+
(a.tags || []).map((l, o) => /* @__PURE__ */ e(
|
|
30
|
+
"button",
|
|
31
|
+
{
|
|
32
|
+
className: "badge badge-hover bg-secondary flex space-x-1",
|
|
33
|
+
onClick: n(() => {
|
|
34
|
+
}),
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ r("i", { className: s(void 0, "tags") }),
|
|
37
|
+
/* @__PURE__ */ r("span", { children: l })
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
o
|
|
41
|
+
))
|
|
42
|
+
] })
|
|
43
|
+
] })
|
|
44
|
+
] });
|
|
45
|
+
}
|
|
46
|
+
c("FormsCell", p);
|
|
47
|
+
export {
|
|
48
|
+
p as FormsCell
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=FormsCell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormsCell.js","sources":["../../../../../src/organisms/table/forms/components/FormsCell.tsx"],"sourcesContent":["import { CellContext } from \"@tanstack/react-table\";\nimport cx from \"classnames\";\nimport moment from \"moment\";\n\nimport type { FormType } from \"../../../../interfaces/index.js\";\nimport { registerComponent } from \"../../../../registries/components.js\";\nimport { iconClass } from \"../../../../utils/iconClass\";\nimport { stopPropagationWrapper } from \"../../../../utils/stopPropagationWrapper\";\n\nexport function FormsCell(\n props: CellContext<FormType, any> & {\n i18n: (i18n: string) => string;\n }\n) {\n const {\n row: { original: form }\n } = props;\n\n return (\n <div className={\"p-1\"}>\n <h4 className={\"text-primary text-lg flex space-x-2 items-center\"}>\n <i className={cx(iconClass(undefined, \"server\"), \"text-secondary\")} />\n <span>{form.title}</span>\n </h4>\n\n <ul className='reset-list text-gray-500'>\n <li className={\"text-sm\"}>Name: {form.name || form.machineName}</li>\n <li className='mt-5 flex space-x-1'>\n <span className='badge bg-light flex space-x-1'>\n <i className={iconClass(undefined, \"history\")} />\n <span>Updated {moment(form.modified).fromNow()}</span>\n </span>\n\n {(form.tags || []).map((tag, index) => (\n <button\n key={index}\n className='badge badge-hover bg-secondary flex space-x-1'\n onClick={stopPropagationWrapper(() => {\n // props.setFilter(\"tags\", tag);\n // props.gotoPage(0);\n })}\n >\n <i className={iconClass(undefined, \"tags\")} />\n <span>{tag}</span>\n </button>\n ))}\n </li>\n </ul>\n </div>\n );\n}\n\nregisterComponent(\"FormsCell\", FormsCell);\n"],"names":["FormsCell","props","form","jsxs","jsx","cx","iconClass","moment","tag","index","stopPropagationWrapper","registerComponent"],"mappings":";;;;;;AASO,SAASA,EACdC,GAGA;AACA,QAAM;AAAA,IACJ,KAAK,EAAE,UAAUC,EAAA;AAAA,EAAK,IACpBD;AAEJ,SACE,gBAAAE,EAAC,OAAA,EAAI,WAAW,OACd,UAAA;AAAA,IAAA,gBAAAA,EAAC,MAAA,EAAG,WAAW,oDACb,UAAA;AAAA,MAAA,gBAAAC,EAAC,KAAA,EAAE,WAAWC,EAAGC,EAAU,QAAW,QAAQ,GAAG,gBAAgB,GAAG;AAAA,MACpE,gBAAAF,EAAC,QAAA,EAAM,UAAAF,EAAK,MAAA,CAAM;AAAA,IAAA,GACpB;AAAA,IAEA,gBAAAC,EAAC,MAAA,EAAG,WAAU,4BACZ,UAAA;AAAA,MAAA,gBAAAA,EAAC,MAAA,EAAG,WAAW,WAAW,UAAA;AAAA,QAAA;AAAA,QAAOD,EAAK,QAAQA,EAAK;AAAA,MAAA,GAAY;AAAA,MAC/D,gBAAAC,EAAC,MAAA,EAAG,WAAU,uBACZ,UAAA;AAAA,QAAA,gBAAAA,EAAC,QAAA,EAAK,WAAU,iCACd,UAAA;AAAA,UAAA,gBAAAC,EAAC,KAAA,EAAE,WAAWE,EAAU,QAAW,SAAS,GAAG;AAAA,4BAC9C,QAAA,EAAK,UAAA;AAAA,YAAA;AAAA,YAASC,EAAOL,EAAK,QAAQ,EAAE,QAAA;AAAA,UAAQ,EAAA,CAAE;AAAA,QAAA,GACjD;AAAA,SAEEA,EAAK,QAAQ,CAAA,GAAI,IAAI,CAACM,GAAKC,MAC3B,gBAAAN;AAAA,UAAC;AAAA,UAAA;AAAA,YAEC,WAAU;AAAA,YACV,SAASO,EAAuB,MAAM;AAAA,YAGtC,CAAC;AAAA,YAED,UAAA;AAAA,cAAA,gBAAAN,EAAC,KAAA,EAAE,WAAWE,EAAU,QAAW,MAAM,GAAG;AAAA,cAC5C,gBAAAF,EAAC,UAAM,UAAAI,EAAA,CAAI;AAAA,YAAA;AAAA,UAAA;AAAA,UARNC;AAAA,QAAA,CAUR;AAAA,MAAA,EAAA,CACH;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;AAEAE,EAAkB,aAAaX,CAAS;"}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import { FormType, SubmissionType } from '../../../interfaces';
|
|
2
|
-
import { TableProps } from '../../../molecules/table';
|
|
3
|
-
export type SubmissionsTableProps
|
|
1
|
+
import { FormType, JSON, SubmissionType } from '../../../interfaces';
|
|
2
|
+
import { TableProps } from '../../../molecules/table/Table';
|
|
3
|
+
export type SubmissionsTableProps<Data extends {
|
|
4
|
+
[key: string]: JSON;
|
|
5
|
+
} = {
|
|
6
|
+
[key: string]: JSON;
|
|
7
|
+
}> = Omit<TableProps<SubmissionType<Data>>, "columns"> & {
|
|
4
8
|
form?: FormType;
|
|
5
9
|
};
|
|
6
|
-
export declare function SubmissionsTable
|
|
10
|
+
export declare function SubmissionsTable<Data extends {
|
|
11
|
+
[key: string]: JSON;
|
|
12
|
+
} = {
|
|
13
|
+
[key: string]: JSON;
|
|
14
|
+
}>({ form, ...props }: SubmissionsTableProps<Data>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import "
|
|
3
|
-
import "../../../
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import "lodash/omit";
|
|
11
|
-
import "react-dnd";
|
|
12
|
-
import { Table as i } from "../../../molecules/table/Table.js";
|
|
13
|
-
import { mapFormToColumns as p } from "../../../molecules/table/utils/mapFormToColumns.js";
|
|
14
|
-
function F({ form: o, ...m }) {
|
|
15
|
-
const r = o && p(o);
|
|
16
|
-
return /* @__PURE__ */ t(i, { ...m, columns: r });
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { Table as s } from "../../../molecules/table/Table.js";
|
|
3
|
+
import { mapFormToColumns as t } from "../../../molecules/table/utils/mapFormToColumns.js";
|
|
4
|
+
function e({
|
|
5
|
+
form: o,
|
|
6
|
+
...m
|
|
7
|
+
}) {
|
|
8
|
+
const r = o && t(o);
|
|
9
|
+
return /* @__PURE__ */ n(s, { ...m, columns: r });
|
|
17
10
|
}
|
|
18
11
|
export {
|
|
19
|
-
|
|
12
|
+
e as SubmissionsTable
|
|
20
13
|
};
|
|
21
14
|
//# sourceMappingURL=SubmissionsTable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubmissionsTable.js","sources":["../../../../src/organisms/table/submissions/SubmissionsTable.tsx"],"sourcesContent":["import type { FormType, SubmissionType } from \"../../../interfaces\";\nimport {
|
|
1
|
+
{"version":3,"file":"SubmissionsTable.js","sources":["../../../../src/organisms/table/submissions/SubmissionsTable.tsx"],"sourcesContent":["import type { FormType, JSON, SubmissionType } from \"../../../interfaces\";\nimport { Table, type TableProps } from \"../../../molecules/table/Table\";\nimport { mapFormToColumns } from \"../../../molecules/table/utils/mapFormToColumns.js\";\n\nexport type SubmissionsTableProps<Data extends { [key: string]: JSON } = { [key: string]: JSON }> = Omit<\n TableProps<SubmissionType<Data>>,\n \"columns\"\n> & {\n form?: FormType;\n};\n\nexport function SubmissionsTable<Data extends { [key: string]: JSON } = { [key: string]: JSON }>({\n form,\n ...props\n}: SubmissionsTableProps<Data>) {\n const columns: any[] | undefined = form && mapFormToColumns(form);\n\n return <Table {...(props as any)} columns={columns!} />;\n}\n"],"names":["SubmissionsTable","form","props","columns","mapFormToColumns","jsx","Table"],"mappings":";;;AAWO,SAASA,EAAiF;AAAA,EAC/F,MAAAC;AAAA,EACA,GAAGC;AACL,GAAgC;AAC9B,QAAMC,IAA6BF,KAAQG,EAAiBH,CAAI;AAEhE,SAAO,gBAAAI,EAACC,GAAA,EAAO,GAAIJ,GAAe,SAAAC,EAAA,CAAmB;AACvD;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FormOptions, JSON, PermissionsResolver } from '../../interfaces/index.js';
|
|
2
|
+
import { FormAccessProps } from '../form/access/FormAccess.js';
|
|
3
|
+
import { FormEditProps } from '../form/builder/FormEdit.js';
|
|
4
|
+
import { ActionsTableProps } from '../table/actions/ActionsTable.js';
|
|
5
|
+
import { SubmissionsTableProps } from '../table/submissions/SubmissionsTable.js';
|
|
6
|
+
export type FormViewsProps<Data extends {
|
|
7
|
+
[key: string]: JSON;
|
|
8
|
+
} = {
|
|
9
|
+
[key: string]: JSON;
|
|
10
|
+
}> = {
|
|
11
|
+
form: FormEditProps["form"];
|
|
12
|
+
submissions: SubmissionsTableProps<Data>["data"];
|
|
13
|
+
availableActions: ActionsTableProps["availableActions"];
|
|
14
|
+
actions: ActionsTableProps["data"];
|
|
15
|
+
roles?: FormAccessProps["roles"];
|
|
16
|
+
i18n?: FormOptions["i18n"];
|
|
17
|
+
onAction: () => void;
|
|
18
|
+
permissionsResolver?: PermissionsResolver<Data>;
|
|
19
|
+
};
|
|
20
|
+
export declare function FormViews<Data extends {
|
|
21
|
+
[key: string]: JSON;
|
|
22
|
+
} = {
|
|
23
|
+
[key: string]: JSON;
|
|
24
|
+
}>({ form, roles, availableActions, actions, permissionsResolver, submissions, ...props }: FormViewsProps<Data>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { jsxs as c, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useI18n as f } from "../../hooks/useI18n.js";
|
|
3
|
+
import { getComponent as a } from "../../registries/components.js";
|
|
4
|
+
import { FormAccess as g } from "../form/access/FormAccess.js";
|
|
5
|
+
import { FormEdit as w } from "../form/builder/FormEdit.js";
|
|
6
|
+
import { FormExport as y } from "../form/exports/FormExport.js";
|
|
7
|
+
import { FormPreview as E } from "../form/preview/FormPreview.js";
|
|
8
|
+
import { FormSettings as F } from "../form/settings/FormSettings.js";
|
|
9
|
+
import { ActionsTable as N } from "../table/actions/ActionsTable.js";
|
|
10
|
+
import { SubmissionsTable as x } from "../table/submissions/SubmissionsTable.js";
|
|
11
|
+
function A(e) {
|
|
12
|
+
return [
|
|
13
|
+
{
|
|
14
|
+
title: "Edit",
|
|
15
|
+
action: "submission:edit",
|
|
16
|
+
alias: "row",
|
|
17
|
+
icon: "edit",
|
|
18
|
+
permissionsResolver: e
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
action: "submission:delete",
|
|
22
|
+
icon: "trash",
|
|
23
|
+
buttonType: "danger",
|
|
24
|
+
permissionsResolver: e
|
|
25
|
+
}
|
|
26
|
+
];
|
|
27
|
+
}
|
|
28
|
+
function O(e) {
|
|
29
|
+
return [
|
|
30
|
+
{
|
|
31
|
+
title: "Edit",
|
|
32
|
+
action: "action:edit",
|
|
33
|
+
alias: "row",
|
|
34
|
+
icon: "edit",
|
|
35
|
+
permissionsResolver: e
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
action: "action:delete",
|
|
39
|
+
icon: "trash",
|
|
40
|
+
buttonType: "danger",
|
|
41
|
+
permissionsResolver: e
|
|
42
|
+
}
|
|
43
|
+
];
|
|
44
|
+
}
|
|
45
|
+
function q({
|
|
46
|
+
form: e,
|
|
47
|
+
roles: l,
|
|
48
|
+
availableActions: d,
|
|
49
|
+
actions: b,
|
|
50
|
+
permissionsResolver: s,
|
|
51
|
+
submissions: m,
|
|
52
|
+
...r
|
|
53
|
+
}) {
|
|
54
|
+
const { t: n } = f(r.i18n), u = a("Tabs"), p = a("TabList"), o = a("Tab"), h = a("TabsBody"), t = a("TabPanel"), T = A(s), v = O(s);
|
|
55
|
+
return /* @__PURE__ */ c(u, { children: [
|
|
56
|
+
/* @__PURE__ */ c(p, { children: [
|
|
57
|
+
/* @__PURE__ */ i(o, { value: 0, icon: "edit", children: n("Edit") }),
|
|
58
|
+
/* @__PURE__ */ i(o, { value: 1, icon: "data", children: n("Data") }),
|
|
59
|
+
/* @__PURE__ */ i(o, { value: 2, icon: "test-tube", children: n("Preview") }),
|
|
60
|
+
/* @__PURE__ */ i(o, { value: 3, icon: "paper-plane", children: n("Actions") }),
|
|
61
|
+
/* @__PURE__ */ i(o, { value: 4, icon: "lock", children: n("Access") }),
|
|
62
|
+
/* @__PURE__ */ i(o, { value: 5, icon: "download", children: n("Export") }),
|
|
63
|
+
/* @__PURE__ */ i(o, { value: 6, icon: "cog", children: n("Settings") })
|
|
64
|
+
] }),
|
|
65
|
+
/* @__PURE__ */ c(h, { children: [
|
|
66
|
+
/* @__PURE__ */ i(t, { value: 0, className: "p-3 border-l-1 border-b-1 border-r-1 border-gray-300", children: /* @__PURE__ */ i(w, { form: e }) }),
|
|
67
|
+
/* @__PURE__ */ i(t, { value: 1, children: /* @__PURE__ */ i(
|
|
68
|
+
x,
|
|
69
|
+
{
|
|
70
|
+
className: "border-top-0",
|
|
71
|
+
form: e,
|
|
72
|
+
data: m,
|
|
73
|
+
i18n: r.i18n,
|
|
74
|
+
operations: T
|
|
75
|
+
}
|
|
76
|
+
) }),
|
|
77
|
+
/* @__PURE__ */ i(t, { value: 2, children: /* @__PURE__ */ i(E, { form: e, i18n: r.i18n }) }),
|
|
78
|
+
/* @__PURE__ */ i(t, { value: 3, children: /* @__PURE__ */ i(
|
|
79
|
+
N,
|
|
80
|
+
{
|
|
81
|
+
className: "border-top-0",
|
|
82
|
+
availableActions: d,
|
|
83
|
+
data: b,
|
|
84
|
+
operations: v,
|
|
85
|
+
i18n: r.i18n
|
|
86
|
+
}
|
|
87
|
+
) }),
|
|
88
|
+
/* @__PURE__ */ i(t, { value: 4, className: "pt-3", children: /* @__PURE__ */ i(g, { form: e, roles: l, options: r }) }),
|
|
89
|
+
/* @__PURE__ */ i(t, { value: 5, className: "pt-3", children: /* @__PURE__ */ i(y, { i18n: r.i18n }) }),
|
|
90
|
+
/* @__PURE__ */ i(t, { value: 6, className: "p-3 border-l-1 border-b-1 border-r-1 border-gray-300", children: /* @__PURE__ */ i(F, { form: e, options: {} }) })
|
|
91
|
+
] })
|
|
92
|
+
] });
|
|
93
|
+
}
|
|
94
|
+
export {
|
|
95
|
+
q as FormViews
|
|
96
|
+
};
|
|
97
|
+
//# sourceMappingURL=FormViews.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormViews.js","sources":["../../../src/organisms/views/FormViews.tsx"],"sourcesContent":["import { useI18n } from \"../../hooks/useI18n.js\";\nimport type { FormOptions, FormType, JSON, PermissionsResolver } from \"../../interfaces/index.js\";\nimport type { Tab as DefaultTab } from \"../../molecules/tabs/Tab.js\";\nimport type { TabList as DefaultTabList } from \"../../molecules/tabs/TabList.js\";\nimport type { TabPanel as DefaultTabPanel } from \"../../molecules/tabs/TabPanel.js\";\nimport type { Tabs as DefaultTabs } from \"../../molecules/tabs/Tabs.js\";\nimport type { TabsBody as DefaultTabsBody } from \"../../molecules/tabs/TabsBody.js\";\nimport { getComponent } from \"../../registries/components.js\";\nimport { FormAccess, type FormAccessProps } from \"../form/access/FormAccess.js\";\nimport { FormEdit, type FormEditProps } from \"../form/builder/FormEdit.js\";\nimport { FormExport } from \"../form/exports/FormExport.js\";\nimport { FormPreview } from \"../form/preview/FormPreview.js\";\nimport { FormSettings } from \"../form/settings/FormSettings.js\";\nimport { ActionsTable, type ActionsTableProps } from \"../table/actions/ActionsTable.js\";\nimport { SubmissionsTable, type SubmissionsTableProps } from \"../table/submissions/SubmissionsTable.js\";\n\nexport type FormViewsProps<Data extends { [key: string]: JSON } = { [key: string]: JSON }> = {\n form: FormEditProps[\"form\"];\n submissions: SubmissionsTableProps<Data>[\"data\"];\n availableActions: ActionsTableProps[\"availableActions\"];\n actions: ActionsTableProps[\"data\"];\n roles?: FormAccessProps[\"roles\"];\n i18n?: FormOptions[\"i18n\"];\n onAction: () => void;\n permissionsResolver?: PermissionsResolver<Data>;\n};\n\nfunction useSubmissionsOperations<Data extends { [key: string]: JSON } = { [key: string]: JSON }>(\n permissionsResolver?: PermissionsResolver<Data>\n) {\n return [\n {\n title: \"Edit\",\n action: \"submission:edit\",\n alias: \"row\",\n icon: \"edit\",\n permissionsResolver\n },\n {\n action: \"submission:delete\",\n icon: \"trash\",\n buttonType: \"danger\",\n permissionsResolver\n }\n ] as SubmissionsTableProps<Data>[\"operations\"];\n}\n\nfunction useActionsOperations<Data extends { [key: string]: JSON } = { [key: string]: JSON }>(\n permissionsResolver?: PermissionsResolver<Data>\n) {\n return [\n {\n title: \"Edit\",\n action: \"action:edit\",\n alias: \"row\",\n icon: \"edit\",\n permissionsResolver\n },\n {\n action: \"action:delete\",\n icon: \"trash\",\n buttonType: \"danger\",\n permissionsResolver\n }\n ] as SubmissionsTableProps<Data>[\"operations\"];\n}\n\nexport function FormViews<Data extends { [key: string]: JSON } = { [key: string]: JSON }>({\n form,\n roles,\n availableActions,\n actions,\n permissionsResolver,\n submissions,\n ...props\n}: FormViewsProps<Data>) {\n const { t } = useI18n(props.i18n);\n const Tabs = getComponent<typeof DefaultTabs>(\"Tabs\");\n const TabList = getComponent<typeof DefaultTabList>(\"TabList\");\n const Tab = getComponent<typeof DefaultTab>(\"Tab\");\n const TabsBody = getComponent<typeof DefaultTabsBody>(\"TabsBody\");\n const TabPanel = getComponent<typeof DefaultTabPanel>(\"TabPanel\");\n const submissionsOperations = useSubmissionsOperations<Data>(permissionsResolver);\n const actionsOperations = useActionsOperations<any>(permissionsResolver);\n\n return (\n <Tabs>\n <TabList>\n <Tab value={0} icon='edit'>\n {t(\"Edit\")}\n </Tab>\n <Tab value={1} icon='data'>\n {t(\"Data\")}\n </Tab>\n <Tab value={2} icon='test-tube'>\n {t(\"Preview\")}\n </Tab>\n <Tab value={3} icon='paper-plane'>\n {t(\"Actions\")}\n </Tab>\n <Tab value={4} icon='lock'>\n {t(\"Access\")}\n </Tab>\n <Tab value={5} icon='download'>\n {t(\"Export\")}\n </Tab>\n <Tab value={6} icon='cog'>\n {t(\"Settings\")}\n </Tab>\n </TabList>\n <TabsBody>\n <TabPanel value={0} className='p-3 border-l-1 border-b-1 border-r-1 border-gray-300'>\n <FormEdit form={form} />\n </TabPanel>\n <TabPanel value={1}>\n <SubmissionsTable<Data>\n className={\"border-top-0\"}\n form={form as FormType}\n data={submissions}\n i18n={props.i18n}\n operations={submissionsOperations}\n />\n </TabPanel>\n <TabPanel value={2}>\n <FormPreview form={form as FormType} i18n={props.i18n} />\n </TabPanel>\n <TabPanel value={3}>\n <ActionsTable\n className={\"border-top-0\"}\n availableActions={availableActions}\n data={actions}\n operations={actionsOperations as any}\n i18n={props.i18n}\n />\n </TabPanel>\n <TabPanel value={4} className='pt-3'>\n <FormAccess form={form as FormType} roles={roles} options={props} />\n </TabPanel>\n <TabPanel value={5} className='pt-3'>\n <FormExport i18n={props.i18n} />\n </TabPanel>\n <TabPanel value={6} className='p-3 border-l-1 border-b-1 border-r-1 border-gray-300'>\n <FormSettings form={form as FormType} options={{}} />\n </TabPanel>\n </TabsBody>\n </Tabs>\n );\n}\n"],"names":["useSubmissionsOperations","permissionsResolver","useActionsOperations","FormViews","form","roles","availableActions","actions","submissions","props","t","useI18n","Tabs","getComponent","TabList","Tab","TabsBody","TabPanel","submissionsOperations","actionsOperations","jsxs","jsx","FormEdit","SubmissionsTable","FormPreview","ActionsTable","FormAccess","FormExport","FormSettings"],"mappings":";;;;;;;;;;AA2BA,SAASA,EACPC,GACA;AACA,SAAO;AAAA,IACL;AAAA,MACE,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,MAAM;AAAA,MACN,qBAAAA;AAAA,IAAA;AAAA,IAEF;AAAA,MACE,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,qBAAAA;AAAA,IAAA;AAAA,EACF;AAEJ;AAEA,SAASC,EACPD,GACA;AACA,SAAO;AAAA,IACL;AAAA,MACE,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,MAAM;AAAA,MACN,qBAAAA;AAAA,IAAA;AAAA,IAEF;AAAA,MACE,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,qBAAAA;AAAA,IAAA;AAAA,EACF;AAEJ;AAEO,SAASE,EAA0E;AAAA,EACxF,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,SAAAC;AAAA,EACA,qBAAAN;AAAA,EACA,aAAAO;AAAA,EACA,GAAGC;AACL,GAAyB;AACvB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAQF,EAAM,IAAI,GAC1BG,IAAOC,EAAiC,MAAM,GAC9CC,IAAUD,EAAoC,SAAS,GACvDE,IAAMF,EAAgC,KAAK,GAC3CG,IAAWH,EAAqC,UAAU,GAC1DI,IAAWJ,EAAqC,UAAU,GAC1DK,IAAwBlB,EAA+BC,CAAmB,GAC1EkB,IAAoBjB,EAA0BD,CAAmB;AAEvE,2BACGW,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAQ,EAACN,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAO,EAACN,KAAI,OAAO,GAAG,MAAK,QACjB,UAAAL,EAAE,MAAM,GACX;AAAA,MACA,gBAAAW,EAACN,KAAI,OAAO,GAAG,MAAK,QACjB,UAAAL,EAAE,MAAM,GACX;AAAA,MACA,gBAAAW,EAACN,KAAI,OAAO,GAAG,MAAK,aACjB,UAAAL,EAAE,SAAS,GACd;AAAA,MACA,gBAAAW,EAACN,KAAI,OAAO,GAAG,MAAK,eACjB,UAAAL,EAAE,SAAS,GACd;AAAA,MACA,gBAAAW,EAACN,KAAI,OAAO,GAAG,MAAK,QACjB,UAAAL,EAAE,QAAQ,GACb;AAAA,MACA,gBAAAW,EAACN,KAAI,OAAO,GAAG,MAAK,YACjB,UAAAL,EAAE,QAAQ,GACb;AAAA,MACA,gBAAAW,EAACN,KAAI,OAAO,GAAG,MAAK,OACjB,UAAAL,EAAE,UAAU,EAAA,CACf;AAAA,IAAA,GACF;AAAA,sBACCM,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAK,EAACJ,GAAA,EAAS,OAAO,GAAG,WAAU,wDAC5B,UAAA,gBAAAI,EAACC,GAAA,EAAS,MAAAlB,GAAY,EAAA,CACxB;AAAA,MACA,gBAAAiB,EAACJ,GAAA,EAAS,OAAO,GACf,UAAA,gBAAAI;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,WAAW;AAAA,UACX,MAAAnB;AAAA,UACA,MAAMI;AAAA,UACN,MAAMC,EAAM;AAAA,UACZ,YAAYS;AAAA,QAAA;AAAA,MAAA,GAEhB;AAAA,MACA,gBAAAG,EAACJ,GAAA,EAAS,OAAO,GACf,UAAA,gBAAAI,EAACG,KAAY,MAAApB,GAAwB,MAAMK,EAAM,KAAA,CAAM,EAAA,CACzD;AAAA,MACA,gBAAAY,EAACJ,GAAA,EAAS,OAAO,GACf,UAAA,gBAAAI;AAAA,QAACI;AAAA,QAAA;AAAA,UACC,WAAW;AAAA,UACX,kBAAAnB;AAAA,UACA,MAAMC;AAAA,UACN,YAAYY;AAAA,UACZ,MAAMV,EAAM;AAAA,QAAA;AAAA,MAAA,GAEhB;AAAA,MACA,gBAAAY,EAACJ,GAAA,EAAS,OAAO,GAAG,WAAU,QAC5B,UAAA,gBAAAI,EAACK,GAAA,EAAW,MAAAtB,GAAwB,OAAAC,GAAc,SAASI,EAAA,CAAO,GACpE;AAAA,MACA,gBAAAY,EAACJ,GAAA,EAAS,OAAO,GAAG,WAAU,QAC5B,UAAA,gBAAAI,EAACM,GAAA,EAAW,MAAMlB,EAAM,KAAA,CAAM,EAAA,CAChC;AAAA,MACA,gBAAAY,EAACJ,GAAA,EAAS,OAAO,GAAG,WAAU,wDAC5B,UAAA,gBAAAI,EAACO,GAAA,EAAa,MAAAxB,GAAwB,SAAS,CAAA,EAAC,CAAG,EAAA,CACrD;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
const
|
|
2
|
-
function
|
|
3
|
-
|
|
1
|
+
const t = /* @__PURE__ */ new Map();
|
|
2
|
+
function e(n, o) {
|
|
3
|
+
t.set(n, o);
|
|
4
4
|
}
|
|
5
|
-
function
|
|
5
|
+
function s(n) {
|
|
6
6
|
if (Array.isArray(n)) {
|
|
7
|
-
for (const
|
|
8
|
-
if (
|
|
9
|
-
return
|
|
7
|
+
for (const r of n)
|
|
8
|
+
if (t.has(r))
|
|
9
|
+
return t.get(r);
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
const o = t.get(n);
|
|
12
|
+
return o || console.warn(`Missing component for ${n}`), o;
|
|
12
13
|
}
|
|
13
14
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
t as components,
|
|
16
|
+
s as getComponent,
|
|
17
|
+
e as registerComponent
|
|
17
18
|
};
|
|
18
19
|
//# sourceMappingURL=components.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.js","sources":["../../src/registries/components.ts"],"sourcesContent":["export const components = new Map<string, unknown>();\n\nexport function registerComponent(type: string, component: unknown) {\n components.set(type, component);\n}\n\nexport function getComponent<Cmp>(type: string | string[]): Cmp {\n if (Array.isArray(type)) {\n for (const t of type) {\n if (components.has(t)) {\n return components.get(t) as unknown as Cmp;\n }\n }\n }\n\n
|
|
1
|
+
{"version":3,"file":"components.js","sources":["../../src/registries/components.ts"],"sourcesContent":["export const components = new Map<string, unknown>();\n\nexport function registerComponent(type: string, component: unknown) {\n components.set(type, component);\n}\n\nexport function getComponent<Cmp>(type: string | string[]): Cmp {\n if (Array.isArray(type)) {\n for (const t of type) {\n if (components.has(t)) {\n return components.get(t) as unknown as Cmp;\n }\n }\n }\n\n const result = components.get(type as string) as unknown as Cmp;\n\n if (!result) {\n console.warn(`Missing component for ${type}`);\n }\n\n return result;\n}\n"],"names":["components","registerComponent","type","component","getComponent","t","result"],"mappings":"AAAO,MAAMA,wBAAiB,IAAA;AAEvB,SAASC,EAAkBC,GAAcC,GAAoB;AAClE,EAAAH,EAAW,IAAIE,GAAMC,CAAS;AAChC;AAEO,SAASC,EAAkBF,GAA8B;AAC9D,MAAI,MAAM,QAAQA,CAAI;AACpB,eAAWG,KAAKH;AACd,UAAIF,EAAW,IAAIK,CAAC;AAClB,eAAOL,EAAW,IAAIK,CAAC;AAAA;AAK7B,QAAMC,IAASN,EAAW,IAAIE,CAAc;AAE5C,SAAKI,KACH,QAAQ,KAAK,yBAAyBJ,CAAI,EAAE,GAGvCI;AACT;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getEventValue.js","sources":["../../src/utils/getEventValue.ts"],"sourcesContent":["export function getEventValue(event: any) {\n const { target } = event;\n\n if (event.target.multiple && event.target.selectedOptions) {\n return Array.from(event.target.selectedOptions, (option: any) => option.value);\n }\n\n return target.type === \"checkbox\" ? target.checked : target.value;\n}\n"],"names":["getEventValue","event","target","option"],"mappings":"AAAO,SAASA,EAAcC,GAAY;
|
|
1
|
+
{"version":3,"file":"getEventValue.js","sources":["../../src/utils/getEventValue.ts"],"sourcesContent":["export function getEventValue(event: any) {\n const { target } = event;\n\n if (event.target.multiple && event.target.selectedOptions) {\n return Array.from(event.target.selectedOptions, (option: any) => option.value);\n }\n\n return target.type === \"checkbox\" ? target.checked : target.value;\n}\n"],"names":["getEventValue","event","target","option"],"mappings":"AAAO,SAASA,EAAcC,GAAY;AACxC,QAAM,EAAE,QAAAC,MAAWD;AAEnB,SAAIA,EAAM,OAAO,YAAYA,EAAM,OAAO,kBACjC,MAAM,KAAKA,EAAM,OAAO,iBAAiB,CAACE,MAAgBA,EAAO,KAAK,IAGxED,EAAO,SAAS,aAAaA,EAAO,UAAUA,EAAO;AAC9D;"}
|
package/dist/utils/iconClass.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
return o.current.iconClass(r || o.current.defaultIconset, t, n);
|
|
1
|
+
import { c as t } from "../chunks/index2.js";
|
|
2
|
+
function n(e, r, s) {
|
|
3
|
+
return t.Templates.current.iconClass(e || t.Templates.current.defaultIconset, r, s);
|
|
5
4
|
}
|
|
6
5
|
export {
|
|
7
|
-
|
|
6
|
+
n as iconClass
|
|
8
7
|
};
|
|
9
8
|
//# sourceMappingURL=iconClass.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iconClass.js","sources":["../../src/utils/iconClass.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"iconClass.js","sources":["../../src/utils/iconClass.ts"],"sourcesContent":["import { Templates } from \"@formio/js\";\n\nexport function iconClass(iconset: string | undefined, name: string, spinning?: boolean): string {\n return Templates.current.iconClass(iconset || Templates.current.defaultIconset, name, spinning);\n}\n"],"names":["iconClass","iconset","name","spinning","Templates"],"mappings":";AAEO,SAASA,EAAUC,GAA6BC,GAAcC,GAA4B;AAC/F,SAAOC,EAAAA,UAAU,QAAQ,UAAUH,KAAWG,EAAAA,UAAU,QAAQ,gBAAgBF,GAAMC,CAAQ;AAChG;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapPagination.js","sources":["../../src/utils/mapPagination.ts"],"sourcesContent":["export function mapPagination({ skip, limit, serverCount, length }: any = {}): any {\n skip = skip || 0;\n limit = limit || 10;\n serverCount = serverCount || length;\n\n return {\n pageIndex: Math.floor(skip / limit),\n pageSize: limit,\n pageCount: Math.ceil(serverCount / limit)\n };\n}\n"],"names":["mapPagination","skip","limit","serverCount","length"],"mappings":"
|
|
1
|
+
{"version":3,"file":"mapPagination.js","sources":["../../src/utils/mapPagination.ts"],"sourcesContent":["export function mapPagination({ skip, limit, serverCount, length }: any = {}): any {\n skip = skip || 0;\n limit = limit || 10;\n serverCount = serverCount || length;\n\n return {\n pageIndex: Math.floor(skip / limit),\n pageSize: limit,\n pageCount: Math.ceil(serverCount / limit)\n };\n}\n"],"names":["mapPagination","skip","limit","serverCount","length"],"mappings":"AAAO,SAASA,EAAc,EAAE,MAAAC,GAAM,OAAAC,GAAO,aAAAC,GAAa,QAAAC,EAAA,IAAgB,IAAS;AACjF,SAAAH,IAAOA,KAAQ,GACfC,IAAQA,KAAS,IACjBC,IAAcA,KAAeC,GAEtB;AAAA,IACL,WAAW,KAAK,MAAMH,IAAOC,CAAK;AAAA,IAClC,UAAUA;AAAA,IACV,WAAW,KAAK,KAAKC,IAAcD,CAAK;AAAA,EAAA;AAE5C;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stopPropagationWrapper.js","sources":["../../src/utils/stopPropagationWrapper.ts"],"sourcesContent":["export const stopPropagationWrapper = (fn: Function) => (event: any) => {\n event.stopPropagation();\n fn();\n};\n"],"names":["stopPropagationWrapper","fn","event"],"mappings":"AAAO,MAAMA,IAAyB,CAACC,MAAiB,CAACC,MAAe;AACtE,EAAAA,EAAM,
|
|
1
|
+
{"version":3,"file":"stopPropagationWrapper.js","sources":["../../src/utils/stopPropagationWrapper.ts"],"sourcesContent":["export const stopPropagationWrapper = (fn: Function) => (event: any) => {\n event.stopPropagation();\n fn();\n};\n"],"names":["stopPropagationWrapper","fn","event"],"mappings":"AAAO,MAAMA,IAAyB,CAACC,MAAiB,CAACC,MAAe;AACtE,EAAAA,EAAM,gBAAA,GACND,EAAA;AACF;"}
|