@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
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Formio as ImportedFormio } from '@formio/js';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
|
+
type BaseConfigurationArgs = {
|
|
4
|
+
baseUrl?: string;
|
|
5
|
+
projectUrl?: string;
|
|
6
|
+
Formio?: typeof ImportedFormio;
|
|
7
|
+
};
|
|
8
|
+
export declare const FormioContext: import('react').Context<({
|
|
9
|
+
Formio: any;
|
|
10
|
+
baseUrl: any;
|
|
11
|
+
projectUrl: any;
|
|
12
|
+
} & {
|
|
13
|
+
token: any;
|
|
14
|
+
setToken: import('react').Dispatch<any>;
|
|
15
|
+
isAuthenticated: boolean;
|
|
16
|
+
logout: () => Promise<void>;
|
|
17
|
+
}) | null>;
|
|
18
|
+
export declare function FormioProvider({ children, baseUrl, projectUrl, Formio }: PropsWithChildren<BaseConfigurationArgs>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { c as r } from "../chunks/index2.js";
|
|
3
|
+
import { createContext as g, useState as c, useEffect as U } from "react";
|
|
4
|
+
const m = ({ baseUrl: t, projectUrl: o, Formio: e }) => e ? (t && e.setBaseUrl(t), o && e.setProjectUrl(o), {
|
|
5
|
+
Formio: e,
|
|
6
|
+
baseUrl: e.baseUrl,
|
|
7
|
+
projectUrl: e.projectUrl
|
|
8
|
+
}) : (t && r.Formio.setBaseUrl(t), o && r.Formio.setProjectUrl(o), {
|
|
9
|
+
Formio: r.Formio,
|
|
10
|
+
baseUrl: r.Formio.baseUrl,
|
|
11
|
+
projectUrl: r.Formio.projectUrl
|
|
12
|
+
}), d = ({ Formio: t }) => {
|
|
13
|
+
const [o, e] = c(t.getToken() || null), [s, n] = c(!!o);
|
|
14
|
+
return U(() => {
|
|
15
|
+
const u = async (l) => {
|
|
16
|
+
l ? (e(t.getToken()), n(!0)) : s && (await t.logout(), e(null), n(!1));
|
|
17
|
+
}, i = async () => {
|
|
18
|
+
s && (await t.currentUser() || (e(null), n(!1)));
|
|
19
|
+
};
|
|
20
|
+
return t.events.on("formio.user", u), i(), () => {
|
|
21
|
+
t.events.off("formio.user", u);
|
|
22
|
+
};
|
|
23
|
+
}, [s, t]), { token: o, setToken: e, isAuthenticated: s, logout: async () => {
|
|
24
|
+
await t.logout(), e(null), n(!1);
|
|
25
|
+
} };
|
|
26
|
+
}, h = g(null);
|
|
27
|
+
function k({ children: t, baseUrl: o, projectUrl: e, Formio: s }) {
|
|
28
|
+
const n = m({ baseUrl: o, projectUrl: e, Formio: s }), a = d({ Formio: n.Formio }), u = { ...n, ...a };
|
|
29
|
+
return /* @__PURE__ */ f(h.Provider, { value: u, children: t });
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
h as FormioContext,
|
|
33
|
+
k as FormioProvider
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=FormioContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormioContext.js","sources":["../../src/contexts/FormioContext.tsx"],"sourcesContent":["import { Formio as ImportedFormio } from \"@formio/js\";\nimport { createContext, type PropsWithChildren, useEffect, useState } from \"react\";\n\ntype BaseConfigurationArgs = {\n baseUrl?: string;\n projectUrl?: string;\n Formio?: typeof ImportedFormio;\n};\n\nconst useBaseConfiguration = ({ baseUrl, projectUrl, Formio }: BaseConfigurationArgs) => {\n if (!Formio) {\n if (baseUrl) {\n ImportedFormio.setBaseUrl(baseUrl);\n }\n if (projectUrl) {\n ImportedFormio.setProjectUrl(projectUrl);\n }\n return {\n Formio: ImportedFormio,\n baseUrl: ImportedFormio.baseUrl,\n projectUrl: ImportedFormio.projectUrl\n };\n }\n\n if (baseUrl) {\n Formio.setBaseUrl(baseUrl);\n }\n if (projectUrl) {\n Formio.setProjectUrl(projectUrl);\n }\n\n return {\n Formio,\n baseUrl: Formio.baseUrl,\n projectUrl: Formio.projectUrl\n };\n};\n\nconst useAuthentication = ({ Formio }: { Formio: typeof ImportedFormio }) => {\n const [token, setToken] = useState(Formio.getToken() || null);\n const [isAuthenticated, setIsAuthenticated] = useState(!!token);\n\n useEffect(() => {\n const handleUserEvent = async (user: unknown) => {\n if (user) {\n setToken(Formio.getToken());\n setIsAuthenticated(true);\n } else if (isAuthenticated) {\n await Formio.logout();\n setToken(null);\n setIsAuthenticated(false);\n }\n };\n\n const handleStaleToken = async () => {\n if (isAuthenticated) {\n const user = await Formio.currentUser();\n if (!user) {\n setToken(null);\n setIsAuthenticated(false);\n }\n }\n };\n\n Formio.events.on(\"formio.user\", handleUserEvent);\n handleStaleToken();\n\n return () => {\n Formio.events.off(\"formio.user\", handleUserEvent);\n };\n }, [isAuthenticated, Formio]);\n\n const logout = async () => {\n await Formio.logout();\n setToken(null);\n setIsAuthenticated(false);\n };\n\n return { token, setToken, isAuthenticated, logout };\n};\n\nexport const FormioContext = createContext<(ReturnType<typeof useBaseConfiguration> & ReturnType<typeof useAuthentication>) | null>(null);\n\nexport function FormioProvider({ children, baseUrl, projectUrl, Formio }: PropsWithChildren<BaseConfigurationArgs>) {\n const baseConfig = useBaseConfiguration({ baseUrl, projectUrl, Formio });\n const auth = useAuthentication({ Formio: baseConfig.Formio });\n const formio = { ...baseConfig, ...auth };\n return <FormioContext.Provider value={formio}>{children}</FormioContext.Provider>;\n}\n"],"names":["useBaseConfiguration","baseUrl","projectUrl","Formio","ImportedFormio","useAuthentication","token","setToken","useState","isAuthenticated","setIsAuthenticated","useEffect","handleUserEvent","user","handleStaleToken","FormioContext","createContext","FormioProvider","children","baseConfig","auth","formio"],"mappings":";;;AASA,MAAMA,IAAuB,CAAC,EAAE,SAAAC,GAAS,YAAAC,GAAY,QAAAC,QAC9CA,KAcDF,KACFE,EAAO,WAAWF,CAAO,GAEvBC,KACFC,EAAO,cAAcD,CAAU,GAG1B;AAAA,EACL,QAAAC;AAAA,EACA,SAASA,EAAO;AAAA,EAChB,YAAYA,EAAO;AAAA,MAvBfF,KACFG,EAAAA,OAAe,WAAWH,CAAO,GAE/BC,KACFE,EAAAA,OAAe,cAAcF,CAAU,GAElC;AAAA,EACL,QAAQE,EAAAA;AAAAA,EACR,SAASA,EAAAA,OAAe;AAAA,EACxB,YAAYA,EAAAA,OAAe;AAAA,IAkB3BC,IAAoB,CAAC,EAAE,QAAAF,QAAgD;AAC3E,QAAM,CAACG,GAAOC,CAAQ,IAAIC,EAASL,EAAO,SAAA,KAAc,IAAI,GACtD,CAACM,GAAiBC,CAAkB,IAAIF,EAAS,CAAC,CAACF,CAAK;AAE9D,SAAAK,EAAU,MAAM;AACd,UAAMC,IAAkB,OAAOC,MAAkB;AAC/C,MAAIA,KACFN,EAASJ,EAAO,UAAU,GAC1BO,EAAmB,EAAI,KACdD,MACT,MAAMN,EAAO,OAAA,GACbI,EAAS,IAAI,GACbG,EAAmB,EAAK;AAAA,IAE5B,GAEMI,IAAmB,YAAY;AACnC,MAAIL,MACW,MAAMN,EAAO,YAAA,MAExBI,EAAS,IAAI,GACbG,EAAmB,EAAK;AAAA,IAG9B;AAEA,WAAAP,EAAO,OAAO,GAAG,eAAeS,CAAe,GAC/CE,EAAA,GAEO,MAAM;AACX,MAAAX,EAAO,OAAO,IAAI,eAAeS,CAAe;AAAA,IAClD;AAAA,EACF,GAAG,CAACH,GAAiBN,CAAM,CAAC,GAQrB,EAAE,OAAAG,GAAO,UAAAC,GAAU,iBAAAE,GAAiB,QAN5B,YAAY;AACzB,UAAMN,EAAO,OAAA,GACbI,EAAS,IAAI,GACbG,EAAmB,EAAK;AAAA,EAC1B,EAE2C;AAC7C,GAEaK,IAAgBC,EAAuG,IAAI;AAEjI,SAASC,EAAe,EAAE,UAAAC,GAAU,SAAAjB,GAAS,YAAAC,GAAY,QAAAC,KAAoD;AAClH,QAAMgB,IAAanB,EAAqB,EAAE,SAAAC,GAAS,YAAAC,GAAY,QAAAC,GAAQ,GACjEiB,IAAOf,EAAkB,EAAE,QAAQc,EAAW,QAAQ,GACtDE,IAAS,EAAE,GAAGF,GAAY,GAAGC,EAAA;AACnC,2BAAQL,EAAc,UAAd,EAAuB,OAAOM,GAAS,UAAAH,GAAS;AAC1D;"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export declare const enum CODE {
|
|
2
|
+
ENTER = "Enter",
|
|
3
|
+
ESCAPE = "Escape",
|
|
4
|
+
ARROW_LEFT = "ArrowLeft",
|
|
5
|
+
ARROW_UP = "ArrowUp",
|
|
6
|
+
ARROW_RIGHT = "ArrowRight",
|
|
7
|
+
ARROW_DOWN = "ArrowDown",
|
|
8
|
+
SPACE = "Space",
|
|
9
|
+
END = "End",
|
|
10
|
+
HOME = "Home"
|
|
11
|
+
}
|
|
12
|
+
export declare const enum KEY {
|
|
13
|
+
ENTER = "Enter",
|
|
14
|
+
ESCAPE = "Escape",
|
|
15
|
+
ARROW_LEFT = "ArrowLeft",
|
|
16
|
+
ARROW_UP = "ArrowUp",
|
|
17
|
+
ARROW_RIGHT = "ArrowRight",
|
|
18
|
+
ARROW_DOWN = "ArrowDown",
|
|
19
|
+
END = "End",
|
|
20
|
+
HOME = "Home",
|
|
21
|
+
SPACE = " ",
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated
|
|
24
|
+
* Used by old browers, see https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values#whitespace_keys
|
|
25
|
+
*/
|
|
26
|
+
SPACEBAR = "Spacebar"
|
|
27
|
+
}
|
|
28
|
+
export declare const enum KEY_CODE {
|
|
29
|
+
ENTER = 13,
|
|
30
|
+
ESCAPE = 27,
|
|
31
|
+
ARROW_LEFT = 37,
|
|
32
|
+
ARROW_UP = 38,
|
|
33
|
+
ARROW_RIGHT = 39,
|
|
34
|
+
ARROW_DOWN = 40,
|
|
35
|
+
SPACE = 32,
|
|
36
|
+
END = 35,
|
|
37
|
+
HOME = 36
|
|
38
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
var A = /* @__PURE__ */ ((R) => (R.ENTER = "Enter", R.ESCAPE = "Escape", R.ARROW_LEFT = "ArrowLeft", R.ARROW_UP = "ArrowUp", R.ARROW_RIGHT = "ArrowRight", R.ARROW_DOWN = "ArrowDown", R.SPACE = "Space", R.END = "End", R.HOME = "Home", R))(A || {}), r = /* @__PURE__ */ ((R) => (R.ENTER = "Enter", R.ESCAPE = "Escape", R.ARROW_LEFT = "ArrowLeft", R.ARROW_UP = "ArrowUp", R.ARROW_RIGHT = "ArrowRight", R.ARROW_DOWN = "ArrowDown", R.END = "End", R.HOME = "Home", R.SPACE = " ", R.SPACEBAR = "Spacebar", R))(r || {}), W = /* @__PURE__ */ ((R) => (R[R.ENTER = 13] = "ENTER", R[R.ESCAPE = 27] = "ESCAPE", R[R.ARROW_LEFT = 37] = "ARROW_LEFT", R[R.ARROW_UP = 38] = "ARROW_UP", R[R.ARROW_RIGHT = 39] = "ARROW_RIGHT", R[R.ARROW_DOWN = 40] = "ARROW_DOWN", R[R.SPACE = 32] = "SPACE", R[R.END = 35] = "END", R[R.HOME = 36] = "HOME", R))(W || {});
|
|
2
|
+
export {
|
|
3
|
+
A as CODE,
|
|
4
|
+
r as KEY,
|
|
5
|
+
W as KEY_CODE
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=keyboard.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyboard.constants.js","sources":["../../src/hooks/keyboard.constants.ts"],"sourcesContent":["export const enum CODE {\n ENTER = \"Enter\",\n ESCAPE = \"Escape\",\n ARROW_LEFT = \"ArrowLeft\",\n ARROW_UP = \"ArrowUp\",\n ARROW_RIGHT = \"ArrowRight\",\n ARROW_DOWN = \"ArrowDown\",\n SPACE = \"Space\",\n END = \"End\",\n HOME = \"Home\"\n}\n\nexport const enum KEY {\n ENTER = \"Enter\",\n ESCAPE = \"Escape\",\n ARROW_LEFT = \"ArrowLeft\",\n ARROW_UP = \"ArrowUp\",\n ARROW_RIGHT = \"ArrowRight\",\n ARROW_DOWN = \"ArrowDown\",\n END = \"End\",\n HOME = \"Home\",\n SPACE = \" \",\n /**\n * @deprecated\n * Used by old browers, see https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values#whitespace_keys\n */\n SPACEBAR = \"Spacebar\"\n}\n\nexport const enum KEY_CODE {\n ENTER = 13,\n ESCAPE = 27,\n ARROW_LEFT = 37,\n ARROW_UP = 38,\n ARROW_RIGHT = 39,\n ARROW_DOWN = 40,\n SPACE = 32,\n END = 35,\n HOME = 36\n}\n"],"names":["CODE","KEY","KEY_CODE"],"mappings":"AAAO,IAAWA,sBAAAA,OAChBA,EAAA,QAAQ,SACRA,EAAA,SAAS,UACTA,EAAA,aAAa,aACbA,EAAA,WAAW,WACXA,EAAA,cAAc,cACdA,EAAA,aAAa,aACbA,EAAA,QAAQ,SACRA,EAAA,MAAM,OACNA,EAAA,OAAO,QATSA,IAAAA,KAAA,CAAA,CAAA,GAYAC,sBAAAA,OAChBA,EAAA,QAAQ,SACRA,EAAA,SAAS,UACTA,EAAA,aAAa,aACbA,EAAA,WAAW,WACXA,EAAA,cAAc,cACdA,EAAA,aAAa,aACbA,EAAA,MAAM,OACNA,EAAA,OAAO,QACPA,EAAA,QAAQ,KAKRA,EAAA,WAAW,YAdKA,IAAAA,KAAA,CAAA,CAAA,GAiBAC,sBAAAA,OAChBA,EAAAA,EAAA,QAAQ,EAAA,IAAR,SACAA,EAAAA,EAAA,SAAS,EAAA,IAAT,UACAA,EAAAA,EAAA,aAAa,EAAA,IAAb,cACAA,EAAAA,EAAA,WAAW,EAAA,IAAX,YACAA,EAAAA,EAAA,cAAc,EAAA,IAAd,eACAA,EAAAA,EAAA,aAAa,EAAA,IAAb,cACAA,EAAAA,EAAA,QAAQ,EAAA,IAAR,SACAA,EAAAA,EAAA,MAAM,EAAA,IAAN,OACAA,EAAAA,EAAA,OAAO,EAAA,IAAP,QATgBA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useContext as t } from "react";
|
|
2
|
+
import { FormioContext as r } from "../contexts/FormioContext.js";
|
|
3
|
+
function i() {
|
|
4
|
+
const o = t(r);
|
|
5
|
+
if (!o)
|
|
6
|
+
throw new Error("useFormioContext must be used within a FormioProvider component.");
|
|
7
|
+
return o;
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
i as useFormioContext
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=useFormioContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFormioContext.js","sources":["../../src/hooks/useFormioContext.ts"],"sourcesContent":["import { useContext } from \"react\";\n\nimport { FormioContext } from \"../contexts/FormioContext\";\n\nexport function useFormioContext() {\n const context = useContext(FormioContext);\n\n if (!context) {\n throw new Error(\"useFormioContext must be used within a FormioProvider component.\");\n }\n\n return context;\n}\n"],"names":["useFormioContext","context","useContext","FormioContext"],"mappings":";;AAIO,SAASA,IAAmB;AACjC,QAAMC,IAAUC,EAAWC,CAAa;AAExC,MAAI,CAACF;AACH,UAAM,IAAI,MAAM,kEAAkE;AAGpF,SAAOA;AACT;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useI18n.js","sources":["../../src/hooks/useI18n.ts"],"sourcesContent":["import type { FormOptions } from \"../interfaces/index.js\";\n\nexport function useI18n(labels?: FormOptions[\"i18n\"]) {\n return {\n t: (key: string, defaultValue: string = key) => {\n return labels?.[key] || defaultValue;\n }\n };\n}\n"],"names":["useI18n","labels","key","defaultValue"],"mappings":"AAEO,SAASA,EAAQC,GAA8B;AACpD,SAAO;AAAA,IACL,GAAG,CAACC,GAAaC,IAAuBD,MAC/BD,IAASC,CAAG,KAAKC;AAAA,EAC1B;AAEJ;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { KeyboardEvent } from 'react';
|
|
2
|
+
interface Options {
|
|
3
|
+
up?: VoidFunction;
|
|
4
|
+
down?: VoidFunction;
|
|
5
|
+
left?: VoidFunction;
|
|
6
|
+
right?: VoidFunction;
|
|
7
|
+
start?: VoidFunction;
|
|
8
|
+
end?: VoidFunction;
|
|
9
|
+
activate?: VoidFunction;
|
|
10
|
+
}
|
|
11
|
+
export declare const useKeyboardControls: ({ up, down, left, right, start, end, activate }: Options) => (event: KeyboardEvent<HTMLDivElement | HTMLButtonElement>) => void;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback as d } from "react";
|
|
3
|
+
import { CODE as u, KEY as c } from "./keyboard.constants.js";
|
|
4
|
+
const t = (o) => o.key === c.ENTER || o.key === c.SPACE || o.key === c.SPACEBAR || o.code === u.ENTER || o.code === u.SPACE, e = () => {
|
|
5
|
+
}, p = ({
|
|
6
|
+
up: o = e,
|
|
7
|
+
down: f = e,
|
|
8
|
+
left: E = e,
|
|
9
|
+
right: R = e,
|
|
10
|
+
start: i = e,
|
|
11
|
+
end: l = e,
|
|
12
|
+
activate: D = e
|
|
13
|
+
}) => d(
|
|
14
|
+
(r) => {
|
|
15
|
+
if (t(r))
|
|
16
|
+
return D();
|
|
17
|
+
if (r.code === u.HOME)
|
|
18
|
+
return r.preventDefault(), i();
|
|
19
|
+
if (r.code === u.END)
|
|
20
|
+
return r.preventDefault(), l();
|
|
21
|
+
if (r.code === u.ARROW_UP)
|
|
22
|
+
return r.preventDefault(), o();
|
|
23
|
+
if (r.code === u.ARROW_DOWN)
|
|
24
|
+
return r.preventDefault(), f();
|
|
25
|
+
if (r.code === u.ARROW_RIGHT)
|
|
26
|
+
return r.preventDefault(), R();
|
|
27
|
+
if (r.code === u.ARROW_LEFT)
|
|
28
|
+
return r.preventDefault(), E();
|
|
29
|
+
},
|
|
30
|
+
[D, f, l, E, R, i, o]
|
|
31
|
+
);
|
|
32
|
+
export {
|
|
33
|
+
p as useKeyboardControls
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=useKeyboardControls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useKeyboardControls.js","sources":["../../src/hooks/useKeyboardControls.ts"],"sourcesContent":["\"use client\";\n\nimport { type KeyboardEvent, useCallback } from \"react\";\n\nimport { CODE, KEY } from \"./keyboard.constants\";\n\ninterface Options {\n up?: VoidFunction;\n down?: VoidFunction;\n left?: VoidFunction;\n right?: VoidFunction;\n start?: VoidFunction;\n end?: VoidFunction;\n activate?: VoidFunction;\n}\n\nconst isActivateKey = (event: KeyboardEvent<HTMLDivElement | HTMLButtonElement>) => {\n return (\n event.key === KEY.ENTER ||\n event.key === KEY.SPACE ||\n event.key === KEY.SPACEBAR ||\n event.code === CODE.ENTER ||\n event.code === CODE.SPACE\n );\n};\n\nconst voidFn = () => {};\n\nexport const useKeyboardControls = ({\n up = voidFn,\n down = voidFn,\n left = voidFn,\n right = voidFn,\n start = voidFn,\n end = voidFn,\n activate = voidFn\n}: Options) => {\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement | HTMLButtonElement>) => {\n if (isActivateKey(event)) {\n return activate();\n }\n\n if (event.code === CODE.HOME) {\n event.preventDefault();\n\n return start();\n }\n\n if (event.code === CODE.END) {\n event.preventDefault();\n\n return end();\n }\n\n if (event.code === CODE.ARROW_UP) {\n event.preventDefault();\n\n return up();\n }\n\n if (event.code === CODE.ARROW_DOWN) {\n event.preventDefault();\n\n return down();\n }\n\n if (event.code === CODE.ARROW_RIGHT) {\n event.preventDefault();\n\n return right();\n }\n\n if (event.code === CODE.ARROW_LEFT) {\n event.preventDefault();\n\n return left();\n }\n },\n [activate, down, end, left, right, start, up]\n );\n\n return handleKeyDown;\n};\n"],"names":["isActivateKey","event","KEY","CODE","voidFn","useKeyboardControls","up","down","left","right","start","end","activate","useCallback"],"mappings":";;;AAgBA,MAAMA,IAAgB,CAACC,MAEnBA,EAAM,QAAQC,EAAI,SAClBD,EAAM,QAAQC,EAAI,SAClBD,EAAM,QAAQC,EAAI,YAClBD,EAAM,SAASE,EAAK,SACpBF,EAAM,SAASE,EAAK,OAIlBC,IAAS,MAAM;AAAC,GAETC,IAAsB,CAAC;AAAA,EAClC,IAAAC,IAAKF;AAAA,EACL,MAAAG,IAAOH;AAAA,EACP,MAAAI,IAAOJ;AAAA,EACP,OAAAK,IAAQL;AAAA,EACR,OAAAM,IAAQN;AAAA,EACR,KAAAO,IAAMP;AAAA,EACN,UAAAQ,IAAWR;AACb,MACwBS;AAAA,EACpB,CAACZ,MAA6D;AAC5D,QAAID,EAAcC,CAAK;AACrB,aAAOW,EAAA;AAGT,QAAIX,EAAM,SAASE,EAAK;AACtB,aAAAF,EAAM,eAAA,GAECS,EAAA;AAGT,QAAIT,EAAM,SAASE,EAAK;AACtB,aAAAF,EAAM,eAAA,GAECU,EAAA;AAGT,QAAIV,EAAM,SAASE,EAAK;AACtB,aAAAF,EAAM,eAAA,GAECK,EAAA;AAGT,QAAIL,EAAM,SAASE,EAAK;AACtB,aAAAF,EAAM,eAAA,GAECM,EAAA;AAGT,QAAIN,EAAM,SAASE,EAAK;AACtB,aAAAF,EAAM,eAAA,GAECQ,EAAA;AAGT,QAAIR,EAAM,SAASE,EAAK;AACtB,aAAAF,EAAM,eAAA,GAECO,EAAA;AAAA,EAEX;AAAA,EACA,CAACI,GAAUL,GAAMI,GAAKH,GAAMC,GAAOC,GAAOJ,CAAE;AAAA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTooltip.js","sources":["../../src/hooks/useTooltip.ts"],"sourcesContent":["import { useEffect, useRef } from \"react\";\nimport Tooltip, { Options } from \"tooltip.js\";\n\nexport function useTooltip(options: Options) {\n const ref = useRef<any>();\n\n useEffect(() => {\n ref.current && new Tooltip(ref.current as any, options);\n }, [ref, options]);\n\n return ref;\n}\n"],"names":["useTooltip","options","ref","useRef","useEffect","Tooltip"],"mappings":";;AAGO,SAASA,EAAWC,GAAkB;AAC3C,QAAMC,IAAMC,
|
|
1
|
+
{"version":3,"file":"useTooltip.js","sources":["../../src/hooks/useTooltip.ts"],"sourcesContent":["import { useEffect, useRef } from \"react\";\nimport Tooltip, { Options } from \"tooltip.js\";\n\nexport function useTooltip(options: Options) {\n const ref = useRef<any>();\n\n useEffect(() => {\n ref.current && new Tooltip(ref.current as any, options);\n }, [ref, options]);\n\n return ref;\n}\n"],"names":["useTooltip","options","ref","useRef","useEffect","Tooltip"],"mappings":";;AAGO,SAASA,EAAWC,GAAkB;AAC3C,QAAMC,IAAMC,EAAA;AAEZ,SAAAC,EAAU,MAAM;AACd,IAAAF,EAAI,WAAW,IAAIG,EAAQH,EAAI,SAAgBD,CAAO;AAAA,EACxD,GAAG,CAACC,GAAKD,CAAO,CAAC,GAEVC;AACT;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
import { default as Webform } from 'formiojs/Webform';
|
|
2
|
-
import { default as WebformBuilder } from 'formiojs/WebformBuilder';
|
|
3
|
-
import { default as Wizard } from 'formiojs/Wizard';
|
|
4
|
-
import { default as WizardBuilder } from 'formiojs/WizardBuilder';
|
|
5
|
-
export { Webform, WebformBuilder, Wizard, WizardBuilder };
|
|
6
1
|
export * from './interfaces';
|
|
7
|
-
export { Components, Formio, Templates, Utils } from '
|
|
2
|
+
export { Builders, Components, DefaultEvaluator, Displays, EventEmitter, Form, FormBuilder, Formio, Licenses, Providers, registerModule, Templates, useModule, Utils, Webform, Widgets } from '@formio/js';
|
package/dist/index.js
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { default as m } from "formiojs/Wizard";
|
|
4
|
-
import { default as l } from "formiojs/WizardBuilder";
|
|
5
|
-
import { Components as s, Formio as i, Templates as u, Utils as x } from "formiojs";
|
|
1
|
+
import { c as s } from "./chunks/index2.js";
|
|
2
|
+
const t = s.Builders, e = s.Components, r = s.DefaultEvaluator, n = s.Displays, i = s.EventEmitter, c = s.Form, l = s.FormBuilder, m = s.Formio, u = s.Licenses, d = s.Providers, a = s.Templates, p = s.Utils, E = s.Webform, v = s.Widgets, F = s.registerModule, f = s.useModule;
|
|
6
3
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
t as Builders,
|
|
5
|
+
e as Components,
|
|
6
|
+
r as DefaultEvaluator,
|
|
7
|
+
n as Displays,
|
|
8
|
+
i as EventEmitter,
|
|
9
|
+
c as Form,
|
|
10
|
+
l as FormBuilder,
|
|
11
|
+
m as Formio,
|
|
12
|
+
u as Licenses,
|
|
13
|
+
d as Providers,
|
|
14
|
+
a as Templates,
|
|
15
|
+
p as Utils,
|
|
16
|
+
E as Webform,
|
|
17
|
+
v as Widgets,
|
|
18
|
+
F as registerModule,
|
|
19
|
+
f as useModule
|
|
15
20
|
};
|
|
16
21
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type ComponentType =
|
|
1
|
+
import { Component } from '@formio/core';
|
|
2
|
+
export type ComponentType = Omit<Component, "components"> & {
|
|
3
|
+
components?: ComponentType[];
|
|
4
|
+
} & {
|
|
5
|
+
title?: string;
|
|
6
|
+
} & Record<string, unknown>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormBuilderOptions.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
template?: string;
|
|
8
|
-
saveDraft?: boolean;
|
|
9
|
-
events?: EventEmitter2;
|
|
10
|
-
hooks?: {
|
|
11
|
-
customValidation?: Function;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
1
|
+
import { EventEmitter, Form } from '@formio/js';
|
|
2
|
+
import { FormType } from './FormType.js';
|
|
3
|
+
export type FormOptions = Form["options"] & {
|
|
4
|
+
events?: EventEmitter;
|
|
5
|
+
currentForm?: FormType;
|
|
6
|
+
};
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
title?: string;
|
|
5
|
-
name?: string;
|
|
6
|
-
machineName?: string;
|
|
1
|
+
import { Form } from '@formio/core';
|
|
2
|
+
import { ComponentType } from './ComponentType.js';
|
|
3
|
+
export type FormType = Omit<Form, "components"> & {
|
|
7
4
|
components: ComponentType[];
|
|
8
|
-
|
|
9
|
-
action?: string;
|
|
10
|
-
properties?: Record<string, any>;
|
|
11
|
-
[key: string]: any;
|
|
12
|
-
};
|
|
5
|
+
} & Record<string, unknown>;
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { OperationButtonProps } from '../molecules/table';
|
|
3
|
-
|
|
4
|
-
export type
|
|
5
|
-
export
|
|
2
|
+
import { OperationButtonProps } from '../molecules/table/components/DefaultOperationButton.js';
|
|
3
|
+
import { JSON } from './SubmissionType.js';
|
|
4
|
+
export type CellMetadata = Record<string, unknown>;
|
|
5
|
+
export type PermissionsResolver<Data extends {
|
|
6
|
+
[key: string]: JSON;
|
|
7
|
+
} = {
|
|
8
|
+
[key: string]: JSON;
|
|
9
|
+
}> = (data: Data, metadata: CellMetadata, operation: Operation<Data>) => void;
|
|
10
|
+
export interface Operation<Data extends {
|
|
11
|
+
[key: string]: JSON;
|
|
12
|
+
} = {
|
|
13
|
+
[key: string]: JSON;
|
|
14
|
+
}> {
|
|
6
15
|
/**
|
|
7
16
|
* Action identifier
|
|
8
17
|
*/
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Component, Submission } from '@formio/core';
|
|
2
2
|
export type JSON = unknown | string | number | boolean | null | undefined | JSON[] | {
|
|
3
3
|
[key: string]: JSON;
|
|
4
4
|
};
|
|
5
|
-
export
|
|
5
|
+
export type SubmissionType<Data extends {
|
|
6
6
|
[key: string]: JSON;
|
|
7
7
|
} = {
|
|
8
8
|
[key: string]: JSON;
|
|
9
|
-
}>
|
|
10
|
-
_id?: string;
|
|
9
|
+
}> = Omit<Partial<Submission>, "data"> & {
|
|
11
10
|
data: Data;
|
|
12
|
-
|
|
13
|
-
[key: string]: JSON;
|
|
14
|
-
};
|
|
15
|
-
state?: string;
|
|
16
|
-
}
|
|
11
|
+
};
|
|
17
12
|
export interface ChangedSubmission<Data extends {
|
|
18
13
|
[key: string]: JSON;
|
|
19
14
|
} = {
|
|
@@ -21,7 +16,7 @@ export interface ChangedSubmission<Data extends {
|
|
|
21
16
|
}> extends SubmissionType<Data> {
|
|
22
17
|
data: Data;
|
|
23
18
|
changed?: {
|
|
24
|
-
component:
|
|
19
|
+
component: Component;
|
|
25
20
|
instance: any;
|
|
26
21
|
value: unknown;
|
|
27
22
|
} & Record<string, JSON>;
|
|
@@ -1 +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;
|
|
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;AACpC,SAAI,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;AACnD,UAAMC,IAAOH,EAAM,OAAOC,CAAG;AAC7B,6BACG,OAAA,EACC,UAAA;AAAA,MAAA,gBAAAG,EAAC,UAAA,EACE,UAAA;AAAA,QAAAD,EAAK;AAAA,QAAK;AAAA,QAAGA,EAAK;AAAA,QAAK;AAAA,MAAA,GAC1B;AAAA,MAAU;AAAA,MAAI;AAAA,MACXA,EAAK;AAAA,IAAA,EAAA,GAJAD,CAKV;AAAA,EAEJ,CAAC,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,MAC5B,gBAAAG,EAAC,OAAA,EAAiB,UAAAF,EAAK,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,OAAA,EAAI,WAAW,eAAeA,CAAI,IAAI,MAAK,SACzC,UAAA;AAAA,IAAAV,EAAYS,CAAO;AAAA,IACnBD;AAAA,EAAA,GACH;AAEJ;"}
|
|
@@ -1,8 +1,21 @@
|
|
|
1
|
-
import { ButtonHTMLAttributes } from 'react';
|
|
1
|
+
import { ButtonHTMLAttributes, PropsWithChildren } from 'react';
|
|
2
2
|
export declare const BUTTON_VARIANTS: string[];
|
|
3
|
-
|
|
3
|
+
interface BaseButtonProps<T extends HTMLElement> extends ButtonHTMLAttributes<T> {
|
|
4
|
+
tag?: "button" | "a" | "input" | "div";
|
|
4
5
|
variant?: (typeof BUTTON_VARIANTS)[keyof typeof BUTTON_VARIANTS] | string;
|
|
5
6
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
7
|
+
interface HTMLAnchorProps extends BaseButtonProps<HTMLAnchorElement> {
|
|
8
|
+
tag: "a";
|
|
9
|
+
}
|
|
10
|
+
interface HTMLButtonProps extends BaseButtonProps<HTMLButtonElement> {
|
|
11
|
+
tag?: "button";
|
|
12
|
+
}
|
|
13
|
+
interface HTMLInputProps extends BaseButtonProps<HTMLInputElement> {
|
|
14
|
+
tag: "input";
|
|
15
|
+
}
|
|
16
|
+
interface HTMLDivProps extends BaseButtonProps<HTMLDivElement> {
|
|
17
|
+
tag: "div";
|
|
18
|
+
}
|
|
19
|
+
export type ButtonProps = HTMLAnchorProps | HTMLButtonProps | HTMLInputProps | HTMLDivProps;
|
|
20
|
+
export declare const Button: import('react').ForwardRefExoticComponent<PropsWithChildren<ButtonProps> & import('react').RefAttributes<unknown>>;
|
|
21
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { registerComponent as
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { c as s } from "../../chunks/index.js";
|
|
3
|
+
import { forwardRef as u } from "react";
|
|
4
|
+
import { registerComponent as c } from "../../registries/components.js";
|
|
5
5
|
const k = [
|
|
6
6
|
"primary",
|
|
7
7
|
"secondary",
|
|
@@ -21,32 +21,28 @@ const k = [
|
|
|
21
21
|
"outline-light",
|
|
22
22
|
"outline-dark",
|
|
23
23
|
"outline-link"
|
|
24
|
-
],
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
disabled: n.disabled
|
|
34
|
-
},
|
|
35
|
-
`btn-${e}`,
|
|
36
|
-
t
|
|
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));
|
|
24
|
+
], i = u(({ tag: t = "button", variant: e, className: o, children: a, ...n }, l) => /* @__PURE__ */ d(
|
|
25
|
+
t,
|
|
26
|
+
{
|
|
27
|
+
...n,
|
|
28
|
+
ref: l,
|
|
29
|
+
className: s(
|
|
30
|
+
"btn flex gap-1",
|
|
31
|
+
{
|
|
32
|
+
disabled: n.disabled
|
|
42
33
|
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
34
|
+
`btn-${e}`,
|
|
35
|
+
o
|
|
36
|
+
),
|
|
37
|
+
disabled: n.disabled,
|
|
38
|
+
onClick: (r) => !n.disabled && n.onClick?.(r),
|
|
39
|
+
children: a
|
|
40
|
+
}
|
|
41
|
+
));
|
|
42
|
+
i.displayName = "Button";
|
|
43
|
+
c("Button", i);
|
|
48
44
|
export {
|
|
49
45
|
k as BUTTON_VARIANTS,
|
|
50
|
-
|
|
46
|
+
i as Button
|
|
51
47
|
};
|
|
52
48
|
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../../src/molecules/button/Button.tsx"],"sourcesContent":["import cx from \"classnames\";\nimport { type ButtonHTMLAttributes, forwardRef, type
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../../src/molecules/button/Button.tsx"],"sourcesContent":["import cx from \"classnames\";\nimport { type ButtonHTMLAttributes, forwardRef, 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\ninterface BaseButtonProps<T extends HTMLElement> extends ButtonHTMLAttributes<T> {\n tag?: \"button\" | \"a\" | \"input\" | \"div\";\n variant?: (typeof BUTTON_VARIANTS)[keyof typeof BUTTON_VARIANTS] | string;\n}\n\ninterface HTMLAnchorProps extends BaseButtonProps<HTMLAnchorElement> {\n tag: \"a\";\n}\n\ninterface HTMLButtonProps extends BaseButtonProps<HTMLButtonElement> {\n tag?: \"button\";\n}\n\ninterface HTMLInputProps extends BaseButtonProps<HTMLInputElement> {\n tag: \"input\";\n}\n\ninterface HTMLDivProps extends BaseButtonProps<HTMLDivElement> {\n tag: \"div\";\n}\n\nexport type ButtonProps = HTMLAnchorProps | HTMLButtonProps | HTMLInputProps | HTMLDivProps;\n\nexport const Button = forwardRef(({ tag: Tag = \"button\", variant, className, children, ...props }: PropsWithChildren<ButtonProps>, ref) => {\n return (\n <Tag\n {...(props as any)}\n ref={ref as any}\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 as any)}\n >\n {children}\n </Tag>\n );\n});\n\nButton.displayName = \"Button\";\n\nregisterComponent(\"Button\", Button);\n"],"names":["BUTTON_VARIANTS","Button","forwardRef","Tag","variant","className","children","props","ref","jsx","cx","evt","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,GAyBaC,IAASC,EAAW,CAAC,EAAE,KAAKC,IAAM,UAAU,SAAAC,GAAS,WAAAC,GAAW,UAAAC,GAAU,GAAGC,EAAA,GAAyCC,MAE/H,gBAAAC;AAAA,EAACN;AAAA,EAAA;AAAA,IACE,GAAII;AAAA,IACL,KAAAC;AAAA,IACA,WAAWE;AAAA,MACT;AAAA,MACA;AAAA,QACE,UAAUH,EAAM;AAAA,MAAA;AAAA,MAElB,OAAOH,CAAO;AAAA,MACdC;AAAA,IAAA;AAAA,IAEF,UAAUE,EAAM;AAAA,IAChB,SAAS,CAACI,MAAQ,CAACJ,EAAM,YAAYA,EAAM,UAAUI,CAAU;AAAA,IAE9D,UAAAL;AAAA,EAAA;AAAA,CAGN;AAEDL,EAAO,cAAc;AAErBW,EAAkB,UAAUX,CAAM;"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/* @__PURE__ */
|
|
1
|
+
import { jsxs as d, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { c as i } from "../../chunks/index.js";
|
|
3
|
+
import { registerComponent as s } from "../../registries/components.js";
|
|
4
|
+
function o({ children: a, label: e, className: c }) {
|
|
5
|
+
return /* @__PURE__ */ d("div", { className: i("card", c), children: [
|
|
6
|
+
/* @__PURE__ */ r("div", { className: "card-header ", children: /* @__PURE__ */ r("h4", { className: "card-title", children: e }) }),
|
|
7
|
+
/* @__PURE__ */ r("div", { className: "card-body", role: "article", children: a })
|
|
7
8
|
] });
|
|
8
9
|
}
|
|
10
|
+
s("Card", o);
|
|
9
11
|
export {
|
|
10
|
-
|
|
12
|
+
o as Card
|
|
11
13
|
};
|
|
12
14
|
//# sourceMappingURL=Card.js.map
|
|
@@ -1 +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":"
|
|
1
|
+
{"version":3,"file":"Card.js","sources":["../../../src/molecules/card/Card.tsx"],"sourcesContent":["import classnames from \"classnames\";\nimport { PropsWithChildren } from \"react\";\n\nimport { registerComponent } from \"../../registries/components.js\";\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\nregisterComponent(\"Card\", Card);\n"],"names":["Card","children","label","className","classnames","jsx","registerComponent"],"mappings":";;;AAUO,SAASA,EAAK,EAAE,UAAAC,GAAU,OAAAC,GAAO,WAAAC,KAA2C;AACjF,2BACG,OAAA,EAAI,WAAWC,EAAW,QAAQD,CAAS,GAC1C,UAAA;AAAA,IAAA,gBAAAE,EAAC,OAAA,EAAI,WAAW,gBACd,UAAA,gBAAAA,EAAC,QAAG,WAAW,cAAe,aAAM,EAAA,CACtC;AAAA,sBACC,OAAA,EAAI,WAAW,aAAa,MAAM,WAChC,UAAAJ,EAAA,CACH;AAAA,EAAA,GACF;AAEJ;AAEAK,EAAkB,QAAQN,CAAI;"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { PropsWithChildren, ReactNode } from 'react';
|
|
2
|
-
export
|
|
3
|
-
id?: string;
|
|
4
|
-
name: string;
|
|
5
|
-
value?: Data;
|
|
6
|
-
required?: boolean;
|
|
1
|
+
import { HTMLAttributes, InputHTMLAttributes, PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
export type BaseFormControlProps<Value = unknown> = {
|
|
7
3
|
label?: string;
|
|
8
|
-
className?: string;
|
|
9
|
-
onChange?: (name: string, value: any) => void;
|
|
10
4
|
description?: string | ReactNode;
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
before?: ReactNode | string;
|
|
6
|
+
after?: ReactNode | string;
|
|
13
7
|
shadow?: boolean;
|
|
14
|
-
|
|
15
|
-
|
|
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;
|