@gisce/react-ooui 0.1.0
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/LICENSE +21 -0
- package/README.md +58 -0
- package/dist/Config.d.ts +6 -0
- package/dist/Config.d.ts.map +1 -0
- package/dist/Config.js +7 -0
- package/dist/Config.js.map +1 -0
- package/dist/ConnectionProvider.d.ts +7 -0
- package/dist/ConnectionProvider.d.ts.map +1 -0
- package/dist/ConnectionProvider.js +18 -0
- package/dist/ConnectionProvider.js.map +1 -0
- package/dist/actionbar/ActionButton.d.ts +13 -0
- package/dist/actionbar/ActionButton.d.ts.map +1 -0
- package/dist/actionbar/ActionButton.js +17 -0
- package/dist/actionbar/ActionButton.js.map +1 -0
- package/dist/actionbar/AttachmentsButton.d.ts +11 -0
- package/dist/actionbar/AttachmentsButton.d.ts.map +1 -0
- package/dist/actionbar/AttachmentsButton.js +170 -0
- package/dist/actionbar/AttachmentsButton.js.map +1 -0
- package/dist/actionbar/AttachmentsButtonWrapper.d.ts +18 -0
- package/dist/actionbar/AttachmentsButtonWrapper.d.ts.map +1 -0
- package/dist/actionbar/AttachmentsButtonWrapper.js +72 -0
- package/dist/actionbar/AttachmentsButtonWrapper.js.map +1 -0
- package/dist/actionbar/ButtonWithBadge.d.ts +8 -0
- package/dist/actionbar/ButtonWithBadge.d.ts.map +1 -0
- package/dist/actionbar/ButtonWithBadge.js +47 -0
- package/dist/actionbar/ButtonWithBadge.js.map +1 -0
- package/dist/actionbar/ChangeViewButton.d.ts +12 -0
- package/dist/actionbar/ChangeViewButton.d.ts.map +1 -0
- package/dist/actionbar/ChangeViewButton.js +97 -0
- package/dist/actionbar/ChangeViewButton.js.map +1 -0
- package/dist/actionbar/DashboardActionBar.d.ts +4 -0
- package/dist/actionbar/DashboardActionBar.d.ts.map +1 -0
- package/dist/actionbar/DashboardActionBar.js +50 -0
- package/dist/actionbar/DashboardActionBar.js.map +1 -0
- package/dist/actionbar/DropdownButton.d.ts +12 -0
- package/dist/actionbar/DropdownButton.d.ts.map +1 -0
- package/dist/actionbar/DropdownButton.js +38 -0
- package/dist/actionbar/DropdownButton.js.map +1 -0
- package/dist/actionbar/FormActionBar.d.ts +4 -0
- package/dist/actionbar/FormActionBar.d.ts.map +1 -0
- package/dist/actionbar/FormActionBar.js +346 -0
- package/dist/actionbar/FormActionBar.js.map +1 -0
- package/dist/actionbar/NewButton.d.ts +7 -0
- package/dist/actionbar/NewButton.d.ts.map +1 -0
- package/dist/actionbar/NewButton.js +50 -0
- package/dist/actionbar/NewButton.js.map +1 -0
- package/dist/actionbar/SearchBar.d.ts +9 -0
- package/dist/actionbar/SearchBar.d.ts.map +1 -0
- package/dist/actionbar/SearchBar.js +55 -0
- package/dist/actionbar/SearchBar.js.map +1 -0
- package/dist/actionbar/TreeActionBar.d.ts +7 -0
- package/dist/actionbar/TreeActionBar.d.ts.map +1 -0
- package/dist/actionbar/TreeActionBar.js +233 -0
- package/dist/actionbar/TreeActionBar.js.map +1 -0
- package/dist/common/ButtonWithTooltip.d.ts +8 -0
- package/dist/common/ButtonWithTooltip.d.ts.map +1 -0
- package/dist/common/ButtonWithTooltip.js +36 -0
- package/dist/common/ButtonWithTooltip.js.map +1 -0
- package/dist/common/DatePicker.d.ts +8 -0
- package/dist/common/DatePicker.d.ts.map +1 -0
- package/dist/common/DatePicker.js +66 -0
- package/dist/common/DatePicker.js.map +1 -0
- package/dist/common/Field.d.ts +14 -0
- package/dist/common/Field.d.ts.map +1 -0
- package/dist/common/Field.js +68 -0
- package/dist/common/Field.js.map +1 -0
- package/dist/context/ActionViewContext.d.ts +54 -0
- package/dist/context/ActionViewContext.d.ts.map +1 -0
- package/dist/context/ActionViewContext.js +93 -0
- package/dist/context/ActionViewContext.js.map +1 -0
- package/dist/context/ContentRootContext.d.ts +19 -0
- package/dist/context/ContentRootContext.d.ts.map +1 -0
- package/dist/context/ContentRootContext.js +419 -0
- package/dist/context/ContentRootContext.js.map +1 -0
- package/dist/context/DashboardActionContext.d.ts +19 -0
- package/dist/context/DashboardActionContext.d.ts.map +1 -0
- package/dist/context/DashboardActionContext.js +39 -0
- package/dist/context/DashboardActionContext.js.map +1 -0
- package/dist/context/FormContext.d.ts +30 -0
- package/dist/context/FormContext.d.ts.map +1 -0
- package/dist/context/FormContext.js +29 -0
- package/dist/context/FormContext.js.map +1 -0
- package/dist/context/FormModalContext.d.ts +11 -0
- package/dist/context/FormModalContext.d.ts.map +1 -0
- package/dist/context/FormModalContext.js +16 -0
- package/dist/context/FormModalContext.js.map +1 -0
- package/dist/context/LocaleContext.d.ts +14 -0
- package/dist/context/LocaleContext.d.ts.map +1 -0
- package/dist/context/LocaleContext.js +34 -0
- package/dist/context/LocaleContext.js.map +1 -0
- package/dist/context/One2manyContext.d.ts +17 -0
- package/dist/context/One2manyContext.d.ts.map +1 -0
- package/dist/context/One2manyContext.js +40 -0
- package/dist/context/One2manyContext.js.map +1 -0
- package/dist/context/TabManagerContext.d.ts +50 -0
- package/dist/context/TabManagerContext.d.ts.map +1 -0
- package/dist/context/TabManagerContext.js +45 -0
- package/dist/context/TabManagerContext.js.map +1 -0
- package/dist/helpers/containerHelper.d.ts +22 -0
- package/dist/helpers/containerHelper.d.ts.map +1 -0
- package/dist/helpers/containerHelper.js +108 -0
- package/dist/helpers/containerHelper.js.map +1 -0
- package/dist/helpers/dynamicColumnsHelper.d.ts +8 -0
- package/dist/helpers/dynamicColumnsHelper.d.ts.map +1 -0
- package/dist/helpers/dynamicColumnsHelper.js +67 -0
- package/dist/helpers/dynamicColumnsHelper.js.map +1 -0
- package/dist/helpers/filesHelper.d.ts +8 -0
- package/dist/helpers/filesHelper.d.ts.map +1 -0
- package/dist/helpers/filesHelper.js +91 -0
- package/dist/helpers/filesHelper.js.map +1 -0
- package/dist/helpers/formHelper.d.ts +31 -0
- package/dist/helpers/formHelper.d.ts.map +1 -0
- package/dist/helpers/formHelper.js +191 -0
- package/dist/helpers/formHelper.js.map +1 -0
- package/dist/helpers/iconMapper.d.ts +3 -0
- package/dist/helpers/iconMapper.d.ts.map +1 -0
- package/dist/helpers/iconMapper.js +125 -0
- package/dist/helpers/iconMapper.js.map +1 -0
- package/dist/helpers/logInfoHelper.d.ts +3 -0
- package/dist/helpers/logInfoHelper.d.ts.map +1 -0
- package/dist/helpers/logInfoHelper.js +78 -0
- package/dist/helpers/logInfoHelper.js.map +1 -0
- package/dist/helpers/one2manyHelper.d.ts +29 -0
- package/dist/helpers/one2manyHelper.d.ts.map +1 -0
- package/dist/helpers/one2manyHelper.js +159 -0
- package/dist/helpers/one2manyHelper.js.map +1 -0
- package/dist/helpers/searchFilterHelper.d.ts +5 -0
- package/dist/helpers/searchFilterHelper.d.ts.map +1 -0
- package/dist/helpers/searchFilterHelper.js +157 -0
- package/dist/helpers/searchFilterHelper.js.map +1 -0
- package/dist/helpers/timeHelper.d.ts +4 -0
- package/dist/helpers/timeHelper.d.ts.map +1 -0
- package/dist/helpers/timeHelper.js +53 -0
- package/dist/helpers/timeHelper.js.map +1 -0
- package/dist/helpers/treeHelper.d.ts +16 -0
- package/dist/helpers/treeHelper.d.ts.map +1 -0
- package/dist/helpers/treeHelper.js +128 -0
- package/dist/helpers/treeHelper.js.map +1 -0
- package/dist/hooks/useEffectDebugger.d.ts +3 -0
- package/dist/hooks/useEffectDebugger.d.ts.map +1 -0
- package/dist/hooks/useEffectDebugger.js +43 -0
- package/dist/hooks/useEffectDebugger.js.map +1 -0
- package/dist/hooks/useWindowDimensions.d.ts +7 -0
- package/dist/hooks/useWindowDimensions.d.ts.map +1 -0
- package/dist/hooks/useWindowDimensions.js +29 -0
- package/dist/hooks/useWindowDimensions.js.map +1 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.LICENSE.txt +76 -0
- package/dist/index.js.map +1 -0
- package/dist/locales/ca_ES.d.ts +81 -0
- package/dist/locales/ca_ES.d.ts.map +1 -0
- package/dist/locales/ca_ES.js +82 -0
- package/dist/locales/ca_ES.js.map +1 -0
- package/dist/locales/en_US.d.ts +81 -0
- package/dist/locales/en_US.d.ts.map +1 -0
- package/dist/locales/en_US.js +82 -0
- package/dist/locales/en_US.js.map +1 -0
- package/dist/locales/es_ES.d.ts +81 -0
- package/dist/locales/es_ES.d.ts.map +1 -0
- package/dist/locales/es_ES.js +82 -0
- package/dist/locales/es_ES.js.map +1 -0
- package/dist/main.css +180 -0
- package/dist/types/index.d.ts +205 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/dist/ui/ActionErrorDialog.d.ts +3 -0
- package/dist/ui/ActionErrorDialog.d.ts.map +1 -0
- package/dist/ui/ActionErrorDialog.js +38 -0
- package/dist/ui/ActionErrorDialog.js.map +1 -0
- package/dist/ui/ConfirmDialog.d.ts +7 -0
- package/dist/ui/ConfirmDialog.d.ts.map +1 -0
- package/dist/ui/ConfirmDialog.js +24 -0
- package/dist/ui/ConfirmDialog.js.map +1 -0
- package/dist/ui/FavouriteButton.d.ts +26 -0
- package/dist/ui/FavouriteButton.d.ts.map +1 -0
- package/dist/ui/FavouriteButton.js +238 -0
- package/dist/ui/FavouriteButton.js.map +1 -0
- package/dist/ui/Fieldset.d.ts +8 -0
- package/dist/ui/Fieldset.d.ts.map +1 -0
- package/dist/ui/Fieldset.js +22 -0
- package/dist/ui/Fieldset.js.map +1 -0
- package/dist/ui/FormErrorsDialog.d.ts +3 -0
- package/dist/ui/FormErrorsDialog.d.ts.map +1 -0
- package/dist/ui/FormErrorsDialog.js +20 -0
- package/dist/ui/FormErrorsDialog.js.map +1 -0
- package/dist/ui/GenericErrorDialog.d.ts +3 -0
- package/dist/ui/GenericErrorDialog.d.ts.map +1 -0
- package/dist/ui/GenericErrorDialog.js +19 -0
- package/dist/ui/GenericErrorDialog.js.map +1 -0
- package/dist/ui/GoToResourceModal.d.ts +10 -0
- package/dist/ui/GoToResourceModal.d.ts.map +1 -0
- package/dist/ui/GoToResourceModal.js +49 -0
- package/dist/ui/GoToResourceModal.js.map +1 -0
- package/dist/ui/InfoDialog.d.ts +3 -0
- package/dist/ui/InfoDialog.d.ts.map +1 -0
- package/dist/ui/InfoDialog.js +13 -0
- package/dist/ui/InfoDialog.js.map +1 -0
- package/dist/ui/RefreshItemDialog.d.ts +7 -0
- package/dist/ui/RefreshItemDialog.d.ts.map +1 -0
- package/dist/ui/RefreshItemDialog.js +25 -0
- package/dist/ui/RefreshItemDialog.js.map +1 -0
- package/dist/ui/RemoveItemDialog.d.ts +6 -0
- package/dist/ui/RemoveItemDialog.d.ts.map +1 -0
- package/dist/ui/RemoveItemDialog.js +24 -0
- package/dist/ui/RemoveItemDialog.js.map +1 -0
- package/dist/ui/TitleHeader.d.ts +7 -0
- package/dist/ui/TitleHeader.d.ts.map +1 -0
- package/dist/ui/TitleHeader.js +93 -0
- package/dist/ui/TitleHeader.js.map +1 -0
- package/dist/ui/UnlinkItemDialog.d.ts +6 -0
- package/dist/ui/UnlinkItemDialog.d.ts.map +1 -0
- package/dist/ui/UnlinkItemDialog.js +24 -0
- package/dist/ui/UnlinkItemDialog.js.map +1 -0
- package/dist/ui/UnsavedChangesDialog.d.ts +7 -0
- package/dist/ui/UnsavedChangesDialog.d.ts.map +1 -0
- package/dist/ui/UnsavedChangesDialog.js +25 -0
- package/dist/ui/UnsavedChangesDialog.js.map +1 -0
- package/dist/ui/WarningDialog.d.ts +3 -0
- package/dist/ui/WarningDialog.d.ts.map +1 -0
- package/dist/ui/WarningDialog.js +20 -0
- package/dist/ui/WarningDialog.js.map +1 -0
- package/dist/views/ActionView.d.ts +24 -0
- package/dist/views/ActionView.d.ts.map +1 -0
- package/dist/views/ActionView.js +376 -0
- package/dist/views/ActionView.js.map +1 -0
- package/dist/views/CurrentTabContent.d.ts +4 -0
- package/dist/views/CurrentTabContent.d.ts.map +1 -0
- package/dist/views/CurrentTabContent.js +35 -0
- package/dist/views/CurrentTabContent.js.map +1 -0
- package/dist/views/RootView.d.ts +14 -0
- package/dist/views/RootView.d.ts.map +1 -0
- package/dist/views/RootView.js +469 -0
- package/dist/views/RootView.js.map +1 -0
- package/dist/views/TabContent.d.ts +8 -0
- package/dist/views/TabContent.d.ts.map +1 -0
- package/dist/views/TabContent.js +34 -0
- package/dist/views/TabContent.js.map +1 -0
- package/dist/views/TabSelector.d.ts +4 -0
- package/dist/views/TabSelector.d.ts.map +1 -0
- package/dist/views/TabSelector.js +34 -0
- package/dist/views/TabSelector.js.map +1 -0
- package/dist/views/Welcome.d.ts +4 -0
- package/dist/views/Welcome.d.ts.map +1 -0
- package/dist/views/Welcome.js +33 -0
- package/dist/views/Welcome.js.map +1 -0
- package/dist/views/tabs/Tab.d.ts +11 -0
- package/dist/views/tabs/Tab.d.ts.map +1 -0
- package/dist/views/tabs/Tab.js +54 -0
- package/dist/views/tabs/Tab.js.map +1 -0
- package/dist/widgets/WidgetFactory.d.ts +4 -0
- package/dist/widgets/WidgetFactory.d.ts.map +1 -0
- package/dist/widgets/WidgetFactory.js +85 -0
- package/dist/widgets/WidgetFactory.js.map +1 -0
- package/dist/widgets/base/Binary.d.ts +14 -0
- package/dist/widgets/base/Binary.d.ts.map +1 -0
- package/dist/widgets/base/Binary.js +173 -0
- package/dist/widgets/base/Binary.js.map +1 -0
- package/dist/widgets/base/Boolean.d.ts +4 -0
- package/dist/widgets/base/Boolean.d.ts.map +1 -0
- package/dist/widgets/base/Boolean.js +53 -0
- package/dist/widgets/base/Boolean.js.map +1 -0
- package/dist/widgets/base/Button.d.ts +8 -0
- package/dist/widgets/base/Button.d.ts.map +1 -0
- package/dist/widgets/base/Button.js +118 -0
- package/dist/widgets/base/Button.js.map +1 -0
- package/dist/widgets/base/Char.d.ts +8 -0
- package/dist/widgets/base/Char.d.ts.map +1 -0
- package/dist/widgets/base/Char.js +145 -0
- package/dist/widgets/base/Char.js.map +1 -0
- package/dist/widgets/base/Date.d.ts +5 -0
- package/dist/widgets/base/Date.d.ts.map +1 -0
- package/dist/widgets/base/Date.js +13 -0
- package/dist/widgets/base/Date.js.map +1 -0
- package/dist/widgets/base/DateTime.d.ts +5 -0
- package/dist/widgets/base/DateTime.d.ts.map +1 -0
- package/dist/widgets/base/DateTime.js +13 -0
- package/dist/widgets/base/DateTime.js.map +1 -0
- package/dist/widgets/base/Email.d.ts +4 -0
- package/dist/widgets/base/Email.d.ts.map +1 -0
- package/dist/widgets/base/Email.js +34 -0
- package/dist/widgets/base/Email.js.map +1 -0
- package/dist/widgets/base/Float.d.ts +4 -0
- package/dist/widgets/base/Float.d.ts.map +1 -0
- package/dist/widgets/base/Float.js +54 -0
- package/dist/widgets/base/Float.js.map +1 -0
- package/dist/widgets/base/FloatTime.d.ts +12 -0
- package/dist/widgets/base/FloatTime.d.ts.map +1 -0
- package/dist/widgets/base/FloatTime.js +122 -0
- package/dist/widgets/base/FloatTime.js.map +1 -0
- package/dist/widgets/base/Image.d.ts +14 -0
- package/dist/widgets/base/Image.d.ts.map +1 -0
- package/dist/widgets/base/Image.js +153 -0
- package/dist/widgets/base/Image.js.map +1 -0
- package/dist/widgets/base/Integer.d.ts +8 -0
- package/dist/widgets/base/Integer.d.ts.map +1 -0
- package/dist/widgets/base/Integer.js +57 -0
- package/dist/widgets/base/Integer.js.map +1 -0
- package/dist/widgets/base/Label.d.ts +9 -0
- package/dist/widgets/base/Label.d.ts.map +1 -0
- package/dist/widgets/base/Label.js +27 -0
- package/dist/widgets/base/Label.js.map +1 -0
- package/dist/widgets/base/LinkInput.d.ts +12 -0
- package/dist/widgets/base/LinkInput.d.ts.map +1 -0
- package/dist/widgets/base/LinkInput.js +70 -0
- package/dist/widgets/base/LinkInput.js.map +1 -0
- package/dist/widgets/base/MultiSelection.d.ts +10 -0
- package/dist/widgets/base/MultiSelection.d.ts.map +1 -0
- package/dist/widgets/base/MultiSelection.js +69 -0
- package/dist/widgets/base/MultiSelection.js.map +1 -0
- package/dist/widgets/base/ProgressBar.d.ts +7 -0
- package/dist/widgets/base/ProgressBar.d.ts.map +1 -0
- package/dist/widgets/base/ProgressBar.js +45 -0
- package/dist/widgets/base/ProgressBar.js.map +1 -0
- package/dist/widgets/base/Reference.d.ts +16 -0
- package/dist/widgets/base/Reference.d.ts.map +1 -0
- package/dist/widgets/base/Reference.js +93 -0
- package/dist/widgets/base/Reference.js.map +1 -0
- package/dist/widgets/base/Selection.d.ts +10 -0
- package/dist/widgets/base/Selection.d.ts.map +1 -0
- package/dist/widgets/base/Selection.js +51 -0
- package/dist/widgets/base/Selection.js.map +1 -0
- package/dist/widgets/base/Separator.d.ts +8 -0
- package/dist/widgets/base/Separator.d.ts.map +1 -0
- package/dist/widgets/base/Separator.js +15 -0
- package/dist/widgets/base/Separator.js.map +1 -0
- package/dist/widgets/base/Text.d.ts +8 -0
- package/dist/widgets/base/Text.d.ts.map +1 -0
- package/dist/widgets/base/Text.js +142 -0
- package/dist/widgets/base/Text.js.map +1 -0
- package/dist/widgets/base/Url.d.ts +4 -0
- package/dist/widgets/base/Url.d.ts.map +1 -0
- package/dist/widgets/base/Url.js +34 -0
- package/dist/widgets/base/Url.js.map +1 -0
- package/dist/widgets/base/many2one/Many2one.d.ts +16 -0
- package/dist/widgets/base/many2one/Many2one.d.ts.map +1 -0
- package/dist/widgets/base/many2one/Many2one.js +353 -0
- package/dist/widgets/base/many2one/Many2one.js.map +1 -0
- package/dist/widgets/base/many2one/Many2oneSuffix.d.ts +9 -0
- package/dist/widgets/base/many2one/Many2oneSuffix.d.ts.map +1 -0
- package/dist/widgets/base/many2one/Many2oneSuffix.js +215 -0
- package/dist/widgets/base/many2one/Many2oneSuffix.js.map +1 -0
- package/dist/widgets/base/many2one/Many2oneSuffixModal.d.ts +10 -0
- package/dist/widgets/base/many2one/Many2oneSuffixModal.d.ts.map +1 -0
- package/dist/widgets/base/many2one/Many2oneSuffixModal.js +37 -0
- package/dist/widgets/base/many2one/Many2oneSuffixModal.js.map +1 -0
- package/dist/widgets/base/one2many/One2many.d.ts +9 -0
- package/dist/widgets/base/one2many/One2many.d.ts.map +1 -0
- package/dist/widgets/base/one2many/One2many.js +188 -0
- package/dist/widgets/base/one2many/One2many.js.map +1 -0
- package/dist/widgets/base/one2many/One2manyInput.d.ts +23 -0
- package/dist/widgets/base/one2many/One2manyInput.d.ts.map +1 -0
- package/dist/widgets/base/one2many/One2manyInput.js +602 -0
- package/dist/widgets/base/one2many/One2manyInput.js.map +1 -0
- package/dist/widgets/base/one2many/One2manyTopBar.d.ts +21 -0
- package/dist/widgets/base/one2many/One2manyTopBar.d.ts.map +1 -0
- package/dist/widgets/base/one2many/One2manyTopBar.js +59 -0
- package/dist/widgets/base/one2many/One2manyTopBar.js.map +1 -0
- package/dist/widgets/containers/Container.d.ts +9 -0
- package/dist/widgets/containers/Container.d.ts.map +1 -0
- package/dist/widgets/containers/Container.js +77 -0
- package/dist/widgets/containers/Container.js.map +1 -0
- package/dist/widgets/containers/Group.d.ts +10 -0
- package/dist/widgets/containers/Group.d.ts.map +1 -0
- package/dist/widgets/containers/Group.js +15 -0
- package/dist/widgets/containers/Group.js.map +1 -0
- package/dist/widgets/containers/Notebook.d.ts +9 -0
- package/dist/widgets/containers/Notebook.d.ts.map +1 -0
- package/dist/widgets/containers/Notebook.js +21 -0
- package/dist/widgets/containers/Notebook.js.map +1 -0
- package/dist/widgets/custom/FiberGrid.d.ts +10 -0
- package/dist/widgets/custom/FiberGrid.d.ts.map +1 -0
- package/dist/widgets/custom/FiberGrid.js +50 -0
- package/dist/widgets/custom/FiberGrid.js.map +1 -0
- package/dist/widgets/custom/Indicator.d.ts +10 -0
- package/dist/widgets/custom/Indicator.d.ts.map +1 -0
- package/dist/widgets/custom/Indicator.js +44 -0
- package/dist/widgets/custom/Indicator.js.map +1 -0
- package/dist/widgets/custom/Timeline.d.ts +16 -0
- package/dist/widgets/custom/Timeline.d.ts.map +1 -0
- package/dist/widgets/custom/Timeline.js +231 -0
- package/dist/widgets/custom/Timeline.js.map +1 -0
- package/dist/widgets/modals/FormModal.d.ts +12 -0
- package/dist/widgets/modals/FormModal.d.ts.map +1 -0
- package/dist/widgets/modals/FormModal.js +174 -0
- package/dist/widgets/modals/FormModal.js.map +1 -0
- package/dist/widgets/modals/SearchModal.d.ts +13 -0
- package/dist/widgets/modals/SearchModal.d.ts.map +1 -0
- package/dist/widgets/modals/SearchModal.js +129 -0
- package/dist/widgets/modals/SearchModal.js.map +1 -0
- package/dist/widgets/modals/TranslationModal.d.ts +12 -0
- package/dist/widgets/modals/TranslationModal.d.ts.map +1 -0
- package/dist/widgets/modals/TranslationModal.js +254 -0
- package/dist/widgets/modals/TranslationModal.js.map +1 -0
- package/dist/widgets/views/Dashboard/Dashboard.d.ts +7 -0
- package/dist/widgets/views/Dashboard/Dashboard.d.ts.map +1 -0
- package/dist/widgets/views/Dashboard/Dashboard.js +368 -0
- package/dist/widgets/views/Dashboard/Dashboard.js.map +1 -0
- package/dist/widgets/views/Dashboard/Dashboard.types.d.ts +8 -0
- package/dist/widgets/views/Dashboard/Dashboard.types.d.ts.map +1 -0
- package/dist/widgets/views/Dashboard/Dashboard.types.js +3 -0
- package/dist/widgets/views/Dashboard/Dashboard.types.js.map +1 -0
- package/dist/widgets/views/Dashboard/DashboardForm.d.ts +4 -0
- package/dist/widgets/views/Dashboard/DashboardForm.d.ts.map +1 -0
- package/dist/widgets/views/Dashboard/DashboardForm.js +106 -0
- package/dist/widgets/views/Dashboard/DashboardForm.js.map +1 -0
- package/dist/widgets/views/Dashboard/DashboardTree.d.ts +19 -0
- package/dist/widgets/views/Dashboard/DashboardTree.d.ts.map +1 -0
- package/dist/widgets/views/Dashboard/DashboardTree.js +318 -0
- package/dist/widgets/views/Dashboard/DashboardTree.js.map +1 -0
- package/dist/widgets/views/Dashboard/dashboardHelper.d.ts +6 -0
- package/dist/widgets/views/Dashboard/dashboardHelper.d.ts.map +1 -0
- package/dist/widgets/views/Dashboard/dashboardHelper.js +136 -0
- package/dist/widgets/views/Dashboard/dashboardHelper.js.map +1 -0
- package/dist/widgets/views/DashboardGrid/DashboardGrid.d.ts +6 -0
- package/dist/widgets/views/DashboardGrid/DashboardGrid.d.ts.map +1 -0
- package/dist/widgets/views/DashboardGrid/DashboardGrid.js +31 -0
- package/dist/widgets/views/DashboardGrid/DashboardGrid.js.map +1 -0
- package/dist/widgets/views/DashboardGrid/DashboardGrid.types.d.ts +6 -0
- package/dist/widgets/views/DashboardGrid/DashboardGrid.types.d.ts.map +1 -0
- package/dist/widgets/views/DashboardGrid/DashboardGrid.types.js +3 -0
- package/dist/widgets/views/DashboardGrid/DashboardGrid.types.js.map +1 -0
- package/dist/widgets/views/DashboardGrid/DashboardGridItem.d.ts +4 -0
- package/dist/widgets/views/DashboardGrid/DashboardGridItem.d.ts.map +1 -0
- package/dist/widgets/views/DashboardGrid/DashboardGridItem.js +38 -0
- package/dist/widgets/views/DashboardGrid/DashboardGridItem.js.map +1 -0
- package/dist/widgets/views/DashboardGrid/DashboardGridItem.types.d.ts +11 -0
- package/dist/widgets/views/DashboardGrid/DashboardGridItem.types.d.ts.map +1 -0
- package/dist/widgets/views/DashboardGrid/DashboardGridItem.types.js +3 -0
- package/dist/widgets/views/DashboardGrid/DashboardGridItem.types.js.map +1 -0
- package/dist/widgets/views/DashboardGrid/index.d.ts +5 -0
- package/dist/widgets/views/DashboardGrid/index.d.ts.map +1 -0
- package/dist/widgets/views/DashboardGrid/index.js +17 -0
- package/dist/widgets/views/DashboardGrid/index.js.map +1 -0
- package/dist/widgets/views/Form.d.ts +28 -0
- package/dist/widgets/views/Form.d.ts.map +1 -0
- package/dist/widgets/views/Form.js +933 -0
- package/dist/widgets/views/Form.js.map +1 -0
- package/dist/widgets/views/Graph/Graph.d.ts +10 -0
- package/dist/widgets/views/Graph/Graph.d.ts.map +1 -0
- package/dist/widgets/views/Graph/Graph.js +150 -0
- package/dist/widgets/views/Graph/Graph.js.map +1 -0
- package/dist/widgets/views/Graph/GraphChart.d.ts +10 -0
- package/dist/widgets/views/Graph/GraphChart.d.ts.map +1 -0
- package/dist/widgets/views/Graph/GraphChart.js +104 -0
- package/dist/widgets/views/Graph/GraphChart.js.map +1 -0
- package/dist/widgets/views/Graph/GraphDefaults.d.ts +47 -0
- package/dist/widgets/views/Graph/GraphDefaults.d.ts.map +1 -0
- package/dist/widgets/views/Graph/GraphDefaults.js +62 -0
- package/dist/widgets/views/Graph/GraphDefaults.js.map +1 -0
- package/dist/widgets/views/Graph/GraphIndicator.d.ts +16 -0
- package/dist/widgets/views/Graph/GraphIndicator.d.ts.map +1 -0
- package/dist/widgets/views/Graph/GraphIndicator.js +292 -0
- package/dist/widgets/views/Graph/GraphIndicator.js.map +1 -0
- package/dist/widgets/views/Graph/useGraphData.d.ts +18 -0
- package/dist/widgets/views/Graph/useGraphData.d.ts.map +1 -0
- package/dist/widgets/views/Graph/useGraphData.js +163 -0
- package/dist/widgets/views/Graph/useGraphData.js.map +1 -0
- package/dist/widgets/views/SearchTree.d.ts +25 -0
- package/dist/widgets/views/SearchTree.d.ts.map +1 -0
- package/dist/widgets/views/SearchTree.js +495 -0
- package/dist/widgets/views/SearchTree.js.map +1 -0
- package/dist/widgets/views/Tree.d.ts +23 -0
- package/dist/widgets/views/Tree.d.ts.map +1 -0
- package/dist/widgets/views/Tree.js +180 -0
- package/dist/widgets/views/Tree.js.map +1 -0
- package/dist/widgets/views/searchFilter/DateRangePicker.d.ts +4 -0
- package/dist/widgets/views/searchFilter/DateRangePicker.d.ts.map +1 -0
- package/dist/widgets/views/searchFilter/DateRangePicker.js +26 -0
- package/dist/widgets/views/searchFilter/DateRangePicker.js.map +1 -0
- package/dist/widgets/views/searchFilter/DateTimeRangePicker.d.ts +4 -0
- package/dist/widgets/views/searchFilter/DateTimeRangePicker.d.ts.map +1 -0
- package/dist/widgets/views/searchFilter/DateTimeRangePicker.js +53 -0
- package/dist/widgets/views/searchFilter/DateTimeRangePicker.js.map +1 -0
- package/dist/widgets/views/searchFilter/PairFields.d.ts +4 -0
- package/dist/widgets/views/searchFilter/PairFields.d.ts.map +1 -0
- package/dist/widgets/views/searchFilter/PairFields.js +45 -0
- package/dist/widgets/views/searchFilter/PairFields.js.map +1 -0
- package/dist/widgets/views/searchFilter/SearchBottomBar.d.ts +10 -0
- package/dist/widgets/views/searchFilter/SearchBottomBar.d.ts.map +1 -0
- package/dist/widgets/views/searchFilter/SearchBottomBar.js +40 -0
- package/dist/widgets/views/searchFilter/SearchBottomBar.js.map +1 -0
- package/dist/widgets/views/searchFilter/SearchField.d.ts +8 -0
- package/dist/widgets/views/searchFilter/SearchField.d.ts.map +1 -0
- package/dist/widgets/views/searchFilter/SearchField.js +84 -0
- package/dist/widgets/views/searchFilter/SearchField.js.map +1 -0
- package/dist/widgets/views/searchFilter/SearchFilter.d.ts +15 -0
- package/dist/widgets/views/searchFilter/SearchFilter.d.ts.map +1 -0
- package/dist/widgets/views/searchFilter/SearchFilter.js +78 -0
- package/dist/widgets/views/searchFilter/SearchFilter.js.map +1 -0
- package/dist/widgets/views/searchFilter/SearchParams.d.ts +7 -0
- package/dist/widgets/views/searchFilter/SearchParams.d.ts.map +1 -0
- package/dist/widgets/views/searchFilter/SearchParams.js +44 -0
- package/dist/widgets/views/searchFilter/SearchParams.js.map +1 -0
- package/package.json +89 -0
- package/src/.eslintcache +1 -0
- package/src/Config.ts +4 -0
- package/src/ConnectionProvider.ts +16 -0
- package/src/__tests__/iconMapper.test.ts +15 -0
- package/src/__tests__/searchFilterHelper.spec.ts +386 -0
- package/src/actionbar/ActionButton.tsx +40 -0
- package/src/actionbar/AttachmentsButton.tsx +128 -0
- package/src/actionbar/AttachmentsButtonWrapper.tsx +139 -0
- package/src/actionbar/ButtonWithBadge.tsx +39 -0
- package/src/actionbar/ChangeViewButton.tsx +136 -0
- package/src/actionbar/DashboardActionBar.tsx +67 -0
- package/src/actionbar/DropdownButton.tsx +61 -0
- package/src/actionbar/FormActionBar.tsx +412 -0
- package/src/actionbar/NewButton.tsx +46 -0
- package/src/actionbar/SearchBar.tsx +69 -0
- package/src/actionbar/TreeActionBar.tsx +265 -0
- package/src/common/ButtonWithTooltip.tsx +18 -0
- package/src/common/DatePicker.tsx +93 -0
- package/src/common/Field.tsx +92 -0
- package/src/context/ActionViewContext.tsx +161 -0
- package/src/context/ContentRootContext.tsx +422 -0
- package/src/context/DashboardActionContext.tsx +45 -0
- package/src/context/FormContext.tsx +79 -0
- package/src/context/FormModalContext.tsx +29 -0
- package/src/context/LocaleContext.tsx +50 -0
- package/src/context/One2manyContext.tsx +46 -0
- package/src/context/TabManagerContext.tsx +117 -0
- package/src/helpers/containerHelper.ts +145 -0
- package/src/helpers/dynamicColumnsHelper.ts +73 -0
- package/src/helpers/filesHelper.ts +41 -0
- package/src/helpers/formHelper.ts +225 -0
- package/src/helpers/iconMapper.ts +108 -0
- package/src/helpers/logInfoHelper.tsx +28 -0
- package/src/helpers/one2manyHelper.ts +139 -0
- package/src/helpers/searchFilterHelper.ts +167 -0
- package/src/helpers/timeHelper.ts +58 -0
- package/src/helpers/treeHelper.ts +127 -0
- package/src/hooks/useEffectDebugger.ts +43 -0
- package/src/hooks/useWindowDimensions.ts +33 -0
- package/src/index.ts +136 -0
- package/src/locales/ca_ES.tsx +85 -0
- package/src/locales/en_US.tsx +82 -0
- package/src/locales/es_ES.tsx +86 -0
- package/src/stories/Binary.stories.tsx +23 -0
- package/src/stories/Boolean.stories.tsx +22 -0
- package/src/stories/Button.stories.tsx +120 -0
- package/src/stories/Char.stories.tsx +49 -0
- package/src/stories/FiberGrid.stories.tsx +109 -0
- package/src/stories/Float.stories.tsx +22 -0
- package/src/stories/FloatTime.stories.tsx +32 -0
- package/src/stories/Image.stories.tsx +25 -0
- package/src/stories/Integer.stories.tsx +22 -0
- package/src/stories/Label.stories.tsx +22 -0
- package/src/stories/Many2one.stories.tsx +31 -0
- package/src/stories/One2many.stories.tsx +292 -0
- package/src/stories/ProgressBar.stories.tsx +22 -0
- package/src/stories/Reference.stories.tsx +43 -0
- package/src/stories/Selection.stories.tsx +34 -0
- package/src/stories/Separator.stories.tsx +21 -0
- package/src/stories/Text.stories.tsx +35 -0
- package/src/stories/containers/Group.stories.tsx +63 -0
- package/src/stories/containers/NewLine.stories.tsx +53 -0
- package/src/stories/containers/Notebook.stories.tsx +91 -0
- package/src/stories/custom/Indicator.stories.tsx +41 -0
- package/src/stories/dashboard/Dashboard.stories.tsx +23 -0
- package/src/stories/dashboard/DashboardGrid.stories.tsx +30 -0
- package/src/stories/forms/Attachment.stories.tsx +24 -0
- package/src/stories/forms/CUPSForm.stories.tsx +25 -0
- package/src/stories/forms/Company.stories.tsx +25 -0
- package/src/stories/forms/CrmCaseForm.stories.tsx +25 -0
- package/src/stories/forms/Documents.stories.tsx +25 -0
- package/src/stories/forms/FormWithGridFiber.stories.tsx +25 -0
- package/src/stories/forms/FormWithLinks.stories.tsx +31 -0
- package/src/stories/forms/Lead.stories.tsx +25 -0
- package/src/stories/forms/ModContractForm.stories.tsx +25 -0
- package/src/stories/forms/PartnersForm.stories.tsx +25 -0
- package/src/stories/forms/PolissaForm.stories.tsx +25 -0
- package/src/stories/forms/PreferencesForm.stories.tsx +693 -0
- package/src/stories/forms/Signatures.stories.tsx +25 -0
- package/src/stories/forms/Switching.stories.tsx +25 -0
- package/src/stories/graphs/GraphIndicator.stories.tsx +20 -0
- package/src/stories/graphs/PieGraph.stories.tsx +78 -0
- package/src/stories/mocks/index.ts +42 -0
- package/src/stories/mocks/mockProvider.ts +180 -0
- package/src/stories/mocks/models/attachment.ts +1327 -0
- package/src/stories/mocks/models/butlleti.ts +344 -0
- package/src/stories/mocks/models/company.ts +137 -0
- package/src/stories/mocks/models/crm_case.ts +598 -0
- package/src/stories/mocks/models/cups.ts +910 -0
- package/src/stories/mocks/models/document.ts +225 -0
- package/src/stories/mocks/models/factura.ts +2727 -0
- package/src/stories/mocks/models/form_with_gridfiber.ts +143 -0
- package/src/stories/mocks/models/hist_autoconsum.ts +148 -0
- package/src/stories/mocks/models/lead.ts +2109 -0
- package/src/stories/mocks/models/modcontractual.ts +806 -0
- package/src/stories/mocks/models/partner.ts +1360 -0
- package/src/stories/mocks/models/polissa.ts +3133 -0
- package/src/stories/mocks/models/signatura.ts +618 -0
- package/src/stories/mocks/models/switching.ts +769 -0
- package/src/stories/modals/FormModal.stories.tsx +36 -0
- package/src/stories/modals/SearchModal.stories.tsx +37 -0
- package/src/stories/trees/FacturesTree.stories.tsx +16 -0
- package/src/stories/ui/ActionBar.stories.tsx +23 -0
- package/src/stories/ui/FavouriteButton.stories.tsx +18 -0
- package/src/stories/ui/GoToResourceModal.stories.tsx +26 -0
- package/src/stories/views/ActionView.stories.tsx +28 -0
- package/src/stories/views/SearchTree.stories.tsx +946 -0
- package/src/stories/views/Tab.stories.tsx +94 -0
- package/src/stories/views/TabManager.stories.tsx +15 -0
- package/src/stories/views/TabsAndContent.stories.tsx +89 -0
- package/src/stories/views/Tree.stories.js +166 -0
- package/src/stories/views/searchFilter/DateRangePicker.stories.tsx +23 -0
- package/src/stories/views/searchFilter/DateTimeRangePicker.stories.tsx +23 -0
- package/src/stories/views/searchFilter/PairFields.stories.tsx +23 -0
- package/src/stories/views/searchFilter/SearchFilter.stories.tsx +166 -0
- package/src/stories/views/searchFilter/examples/PartnersSearchFilter.stories.tsx +425 -0
- package/src/tailwind.css +8 -0
- package/src/tailwind.generated.css +168533 -0
- package/src/types/index.ts +275 -0
- package/src/ui/ActionErrorDialog.tsx +41 -0
- package/src/ui/ConfirmDialog.tsx +28 -0
- package/src/ui/FavouriteButton.tsx +261 -0
- package/src/ui/Fieldset.tsx +31 -0
- package/src/ui/FormErrorsDialog.tsx +17 -0
- package/src/ui/GenericErrorDialog.tsx +16 -0
- package/src/ui/GoToResourceModal.tsx +71 -0
- package/src/ui/InfoDialog.tsx +13 -0
- package/src/ui/RefreshItemDialog.tsx +29 -0
- package/src/ui/RemoveItemDialog.tsx +20 -0
- package/src/ui/TitleHeader.tsx +95 -0
- package/src/ui/UnlinkItemDialog.tsx +20 -0
- package/src/ui/UnsavedChangesDialog.tsx +29 -0
- package/src/ui/WarningDialog.tsx +17 -0
- package/src/views/ActionView.tsx +455 -0
- package/src/views/CurrentTabContent.tsx +21 -0
- package/src/views/RootView.tsx +467 -0
- package/src/views/TabContent.tsx +31 -0
- package/src/views/TabSelector.tsx +31 -0
- package/src/views/Welcome.tsx +18 -0
- package/src/views/tabs/Tab.tsx +77 -0
- package/src/widgets/WidgetFactory.tsx +109 -0
- package/src/widgets/base/Binary.tsx +141 -0
- package/src/widgets/base/Boolean.tsx +44 -0
- package/src/widgets/base/Button.tsx +77 -0
- package/src/widgets/base/Char.tsx +155 -0
- package/src/widgets/base/Date.tsx +12 -0
- package/src/widgets/base/DateTime.tsx +12 -0
- package/src/widgets/base/Email.tsx +27 -0
- package/src/widgets/base/Float.tsx +33 -0
- package/src/widgets/base/FloatTime.tsx +69 -0
- package/src/widgets/base/Image.tsx +120 -0
- package/src/widgets/base/Integer.tsx +38 -0
- package/src/widgets/base/Label.tsx +40 -0
- package/src/widgets/base/LinkInput.tsx +96 -0
- package/src/widgets/base/MultiSelection.tsx +82 -0
- package/src/widgets/base/ProgressBar.tsx +38 -0
- package/src/widgets/base/Reference.tsx +105 -0
- package/src/widgets/base/Selection.tsx +61 -0
- package/src/widgets/base/Separator.tsx +18 -0
- package/src/widgets/base/Text.tsx +156 -0
- package/src/widgets/base/Url.tsx +26 -0
- package/src/widgets/base/many2one/Many2one.tsx +331 -0
- package/src/widgets/base/many2one/Many2oneSuffix.tsx +210 -0
- package/src/widgets/base/many2one/Many2oneSuffixModal.tsx +41 -0
- package/src/widgets/base/one2many/One2many.tsx +102 -0
- package/src/widgets/base/one2many/One2manyInput.tsx +635 -0
- package/src/widgets/base/one2many/One2manyTopBar.tsx +143 -0
- package/src/widgets/containers/Container.tsx +97 -0
- package/src/widgets/containers/Group.tsx +34 -0
- package/src/widgets/containers/Notebook.tsx +35 -0
- package/src/widgets/custom/FiberGrid.tsx +51 -0
- package/src/widgets/custom/Indicator.tsx +66 -0
- package/src/widgets/custom/Timeline.tsx +190 -0
- package/src/widgets/modals/FormModal.tsx +127 -0
- package/src/widgets/modals/SearchModal.tsx +131 -0
- package/src/widgets/modals/TranslationModal.tsx +201 -0
- package/src/widgets/views/Dashboard/Dashboard.tsx +371 -0
- package/src/widgets/views/Dashboard/Dashboard.types.ts +8 -0
- package/src/widgets/views/Dashboard/DashboardForm.tsx +30 -0
- package/src/widgets/views/Dashboard/DashboardTree.tsx +287 -0
- package/src/widgets/views/Dashboard/dashboardHelper.ts +71 -0
- package/src/widgets/views/DashboardGrid/DashboardGrid.tsx +53 -0
- package/src/widgets/views/DashboardGrid/DashboardGrid.types.ts +4 -0
- package/src/widgets/views/DashboardGrid/DashboardGridItem.tsx +58 -0
- package/src/widgets/views/DashboardGrid/DashboardGridItem.types.ts +10 -0
- package/src/widgets/views/DashboardGrid/index.ts +4 -0
- package/src/widgets/views/Form.tsx +991 -0
- package/src/widgets/views/Graph/Graph.tsx +108 -0
- package/src/widgets/views/Graph/GraphChart.tsx +102 -0
- package/src/widgets/views/Graph/GraphDefaults.ts +57 -0
- package/src/widgets/views/Graph/GraphIndicator.tsx +360 -0
- package/src/widgets/views/Graph/useGraphData.tsx +142 -0
- package/src/widgets/views/SearchTree.tsx +542 -0
- package/src/widgets/views/Tree.tsx +267 -0
- package/src/widgets/views/searchFilter/DateRangePicker.tsx +16 -0
- package/src/widgets/views/searchFilter/DateTimeRangePicker.tsx +63 -0
- package/src/widgets/views/searchFilter/PairFields.tsx +56 -0
- package/src/widgets/views/searchFilter/SearchBottomBar.tsx +58 -0
- package/src/widgets/views/searchFilter/SearchField.tsx +73 -0
- package/src/widgets/views/searchFilter/SearchFilter.tsx +113 -0
- package/src/widgets/views/searchFilter/SearchParams.tsx +32 -0
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
import { FormView, GenerateReportOptions } from "@/types";
|
|
2
|
+
import React, {
|
|
3
|
+
useContext,
|
|
4
|
+
useRef,
|
|
5
|
+
useState,
|
|
6
|
+
forwardRef,
|
|
7
|
+
useImperativeHandle,
|
|
8
|
+
} from "react";
|
|
9
|
+
import showErrorDialog from "@/ui/ActionErrorDialog";
|
|
10
|
+
import { openBase64InNewTab, getMimeType } from "@/helpers/filesHelper";
|
|
11
|
+
import { parseContext } from "@gisce/ooui";
|
|
12
|
+
import ConnectionProvider from "@/ConnectionProvider";
|
|
13
|
+
import { Modal, Spin } from "antd";
|
|
14
|
+
import {
|
|
15
|
+
TabManagerContext,
|
|
16
|
+
TabManagerContextType,
|
|
17
|
+
} from "@/context/TabManagerContext";
|
|
18
|
+
import { FormModal } from "@/widgets/modals/FormModal";
|
|
19
|
+
import { LocaleContext, LocaleContextType } from "@/context/LocaleContext";
|
|
20
|
+
|
|
21
|
+
export type ContentRootContextType = {
|
|
22
|
+
processAction: ({
|
|
23
|
+
actionData,
|
|
24
|
+
fields,
|
|
25
|
+
values,
|
|
26
|
+
context,
|
|
27
|
+
}: {
|
|
28
|
+
actionData: any;
|
|
29
|
+
fields: any;
|
|
30
|
+
values: any;
|
|
31
|
+
context?: any;
|
|
32
|
+
onRefreshParentValues?: () => void;
|
|
33
|
+
}) => Promise<any>;
|
|
34
|
+
globalValues?: any;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
type ActionModalOpts = {
|
|
38
|
+
model?: string;
|
|
39
|
+
domain?: any;
|
|
40
|
+
context: any;
|
|
41
|
+
formView?: FormView;
|
|
42
|
+
actionData?: any;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const ContentRootContext = React.createContext<ContentRootContextType | null>(
|
|
46
|
+
null
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
type ContentRootProviderProps = {
|
|
50
|
+
children: React.ReactNode;
|
|
51
|
+
globalValues?: any;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const ContentRootProvider = (
|
|
55
|
+
props: ContentRootProviderProps,
|
|
56
|
+
ref: any
|
|
57
|
+
): any => {
|
|
58
|
+
const { children, globalValues = {} } = props;
|
|
59
|
+
const reportInProgressInterval = useRef<any>();
|
|
60
|
+
const waitingForReport = useRef<boolean>();
|
|
61
|
+
const [reportGenerating, setReportGenerating] = useState<boolean>(false);
|
|
62
|
+
const tabManagerContext = useContext(
|
|
63
|
+
TabManagerContext
|
|
64
|
+
) as TabManagerContextType;
|
|
65
|
+
const { openAction } = tabManagerContext || {};
|
|
66
|
+
const onRefreshParentValues = useRef<any>();
|
|
67
|
+
const { t } = useContext(LocaleContext) as LocaleContextType;
|
|
68
|
+
|
|
69
|
+
useImperativeHandle(ref, () => ({
|
|
70
|
+
openActionModal,
|
|
71
|
+
}));
|
|
72
|
+
|
|
73
|
+
// Action modal state
|
|
74
|
+
const [actionModalVisible, setActionModalVisible] = useState<boolean>(false);
|
|
75
|
+
|
|
76
|
+
const [actionModalOptions, setActionModalOptions] = useState<ActionModalOpts>(
|
|
77
|
+
{
|
|
78
|
+
context: {},
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
async function generateReport(options: GenerateReportOptions) {
|
|
83
|
+
const { reportData, fields, values, context = {} } = options;
|
|
84
|
+
|
|
85
|
+
const {
|
|
86
|
+
context: reportContext,
|
|
87
|
+
model,
|
|
88
|
+
datas = {},
|
|
89
|
+
report_name,
|
|
90
|
+
type,
|
|
91
|
+
} = reportData;
|
|
92
|
+
|
|
93
|
+
if (type !== "ir.actions.report.xml") {
|
|
94
|
+
showErrorDialog(`${type} action not supported`);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const { ids, ...datasource } = datas || {};
|
|
99
|
+
|
|
100
|
+
let idsToExecute = ids;
|
|
101
|
+
|
|
102
|
+
const reportContextParsed =
|
|
103
|
+
typeof reportContext === "string"
|
|
104
|
+
? parseContext({
|
|
105
|
+
context: reportContext,
|
|
106
|
+
fields,
|
|
107
|
+
values,
|
|
108
|
+
})
|
|
109
|
+
: reportContext;
|
|
110
|
+
|
|
111
|
+
if (!idsToExecute) {
|
|
112
|
+
const results = await ConnectionProvider.getHandler().searchAllIds({
|
|
113
|
+
params: [],
|
|
114
|
+
model: datasource.model || model,
|
|
115
|
+
totalItems: 1,
|
|
116
|
+
context: { ...context, ...reportContextParsed },
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
if (results.length === 0) {
|
|
120
|
+
showErrorDialog("Nothing to print");
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
idsToExecute = results;
|
|
125
|
+
datas.id = results[0];
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
try {
|
|
129
|
+
const newReportId = await ConnectionProvider.getHandler().createReport({
|
|
130
|
+
model,
|
|
131
|
+
name: report_name,
|
|
132
|
+
datas,
|
|
133
|
+
ids: idsToExecute,
|
|
134
|
+
context: { ...context, ...reportContextParsed },
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
setReportGenerating(true);
|
|
138
|
+
|
|
139
|
+
waitingForReport.current = true;
|
|
140
|
+
reportInProgressInterval.current = setInterval(() => {
|
|
141
|
+
evaluateReportStatus(newReportId);
|
|
142
|
+
}, 1000);
|
|
143
|
+
} catch (err) {
|
|
144
|
+
waitingForReport.current = false;
|
|
145
|
+
clearInterval(reportInProgressInterval.current);
|
|
146
|
+
showErrorDialog(err);
|
|
147
|
+
setReportGenerating(false);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
async function evaluateReportStatus(id: any) {
|
|
152
|
+
let reportState;
|
|
153
|
+
try {
|
|
154
|
+
reportState = await ConnectionProvider.getHandler().getReport({
|
|
155
|
+
id,
|
|
156
|
+
});
|
|
157
|
+
if (reportState.state && waitingForReport.current === true) {
|
|
158
|
+
waitingForReport.current = false;
|
|
159
|
+
clearInterval(reportInProgressInterval.current);
|
|
160
|
+
setReportGenerating(false);
|
|
161
|
+
const fileType: any = await getMimeType(reportState.result);
|
|
162
|
+
openBase64InNewTab(reportState.result, fileType.mime);
|
|
163
|
+
}
|
|
164
|
+
} catch (error) {
|
|
165
|
+
waitingForReport.current = false;
|
|
166
|
+
clearInterval(reportInProgressInterval.current);
|
|
167
|
+
setReportGenerating(false);
|
|
168
|
+
showErrorDialog(error.exception || error);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
async function processAction({
|
|
173
|
+
actionData,
|
|
174
|
+
fields,
|
|
175
|
+
values,
|
|
176
|
+
context,
|
|
177
|
+
onRefreshParentValues: onRefreshParentValuesFn,
|
|
178
|
+
}: {
|
|
179
|
+
actionData: any;
|
|
180
|
+
fields: any;
|
|
181
|
+
values: any;
|
|
182
|
+
context?: any;
|
|
183
|
+
onRefreshParentValues?: any;
|
|
184
|
+
}) {
|
|
185
|
+
const { type } = actionData;
|
|
186
|
+
onRefreshParentValues.current = onRefreshParentValuesFn;
|
|
187
|
+
|
|
188
|
+
if (type === "ir.actions.report.xml") {
|
|
189
|
+
return await generateReport({
|
|
190
|
+
reportData: actionData,
|
|
191
|
+
fields,
|
|
192
|
+
values,
|
|
193
|
+
context,
|
|
194
|
+
});
|
|
195
|
+
} else if (type === "ir.actions.act_window") {
|
|
196
|
+
return await runAction({ actionData, fields, values, context });
|
|
197
|
+
} else {
|
|
198
|
+
showErrorDialog(`${type} action not supported`);
|
|
199
|
+
return {};
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
async function runAction({
|
|
204
|
+
actionData: _actionData,
|
|
205
|
+
fields = {},
|
|
206
|
+
values = {},
|
|
207
|
+
context = {},
|
|
208
|
+
}: {
|
|
209
|
+
actionData: any;
|
|
210
|
+
fields?: any;
|
|
211
|
+
values?: any;
|
|
212
|
+
context?: any;
|
|
213
|
+
}) {
|
|
214
|
+
let actionData = _actionData;
|
|
215
|
+
|
|
216
|
+
if (!_actionData.res_model) {
|
|
217
|
+
actionData = (
|
|
218
|
+
await ConnectionProvider.getHandler().readObjects({
|
|
219
|
+
model: "ir.actions.act_window",
|
|
220
|
+
ids: [parseInt(_actionData.id)],
|
|
221
|
+
context,
|
|
222
|
+
})
|
|
223
|
+
)[0];
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
const responseContext =
|
|
227
|
+
typeof actionData?.context === "string"
|
|
228
|
+
? parseContext({
|
|
229
|
+
context: actionData.context,
|
|
230
|
+
fields,
|
|
231
|
+
values: { ...values, ...globalValues },
|
|
232
|
+
})
|
|
233
|
+
: actionData.context;
|
|
234
|
+
|
|
235
|
+
const mergedContext = {
|
|
236
|
+
...responseContext,
|
|
237
|
+
...context,
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
let parsedDomain = [];
|
|
241
|
+
|
|
242
|
+
if (actionData.domain) {
|
|
243
|
+
parsedDomain = await ConnectionProvider.getHandler().evalDomain({
|
|
244
|
+
domain: actionData.domain,
|
|
245
|
+
values: { ...values, ...globalValues },
|
|
246
|
+
context: mergedContext,
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// -- Possible values for target property --
|
|
251
|
+
// * new ==> modal
|
|
252
|
+
// * current ==> new tab
|
|
253
|
+
// * undefined ==> new tab
|
|
254
|
+
if (actionData.target === "new") {
|
|
255
|
+
const formView = (await ConnectionProvider.getHandler().getView({
|
|
256
|
+
model: actionData.res_model,
|
|
257
|
+
type: "form",
|
|
258
|
+
id: actionData?.view_id?.[0] || undefined,
|
|
259
|
+
context,
|
|
260
|
+
})) as FormView;
|
|
261
|
+
|
|
262
|
+
openActionModal({
|
|
263
|
+
domain: parsedDomain,
|
|
264
|
+
model: actionData.res_model,
|
|
265
|
+
formView,
|
|
266
|
+
context: mergedContext,
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
return {};
|
|
270
|
+
} else {
|
|
271
|
+
let initialView;
|
|
272
|
+
const viewTypes = actionData.view_mode.split(",");
|
|
273
|
+
const views = [];
|
|
274
|
+
|
|
275
|
+
for (const viewType of viewTypes) {
|
|
276
|
+
const viewData = await ConnectionProvider.getHandler().getView({
|
|
277
|
+
model: actionData.res_model,
|
|
278
|
+
type: viewType,
|
|
279
|
+
context: mergedContext,
|
|
280
|
+
});
|
|
281
|
+
views.push([viewData.view_id, viewType]);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
if (!actionData.view_id) {
|
|
285
|
+
const type = actionData.view_mode.split(",")[0];
|
|
286
|
+
|
|
287
|
+
const [retrievedViewId] = views.find(
|
|
288
|
+
([_, viewType]) => viewType === type
|
|
289
|
+
)!;
|
|
290
|
+
|
|
291
|
+
initialView = { id: retrievedViewId, type };
|
|
292
|
+
} else {
|
|
293
|
+
initialView = {
|
|
294
|
+
id: actionData.view_id,
|
|
295
|
+
type: actionData.view_mode.split(",")[0],
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
openAction?.({
|
|
300
|
+
target: "current",
|
|
301
|
+
context: mergedContext,
|
|
302
|
+
domain: parsedDomain,
|
|
303
|
+
model: actionData.res_model,
|
|
304
|
+
views: views,
|
|
305
|
+
title: actionData.name,
|
|
306
|
+
initialView,
|
|
307
|
+
action_id: actionData.id,
|
|
308
|
+
action_type: actionData.type,
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
return { closeParent: true };
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
function openActionModal({
|
|
316
|
+
domain,
|
|
317
|
+
model,
|
|
318
|
+
formView,
|
|
319
|
+
context,
|
|
320
|
+
actionData,
|
|
321
|
+
}: {
|
|
322
|
+
domain: any;
|
|
323
|
+
model: string;
|
|
324
|
+
formView: FormView;
|
|
325
|
+
context: any;
|
|
326
|
+
actionData?: any;
|
|
327
|
+
}) {
|
|
328
|
+
if (actionModalVisible) {
|
|
329
|
+
openNewActionModal({ domain, model, formView, context, actionData });
|
|
330
|
+
} else {
|
|
331
|
+
setActionModalOptions({ domain, model, context, formView, actionData });
|
|
332
|
+
setActionModalVisible(true);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
async function openNewActionModal({
|
|
337
|
+
domain,
|
|
338
|
+
model,
|
|
339
|
+
formView,
|
|
340
|
+
context,
|
|
341
|
+
actionData,
|
|
342
|
+
}: {
|
|
343
|
+
domain: any;
|
|
344
|
+
model: string;
|
|
345
|
+
formView: FormView;
|
|
346
|
+
context: any;
|
|
347
|
+
actionData?: any;
|
|
348
|
+
}) {
|
|
349
|
+
setActionModalOptions({
|
|
350
|
+
domain: undefined,
|
|
351
|
+
model: undefined,
|
|
352
|
+
context: {},
|
|
353
|
+
formView: undefined,
|
|
354
|
+
actionData: undefined,
|
|
355
|
+
});
|
|
356
|
+
setActionModalVisible(false);
|
|
357
|
+
await new Promise((resolve) => setTimeout(resolve, 300));
|
|
358
|
+
setActionModalOptions({ domain, model, context, formView, actionData });
|
|
359
|
+
setActionModalVisible(true);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
async function onFormModalSucceed() {
|
|
363
|
+
onRefreshParentValues.current?.();
|
|
364
|
+
setActionModalVisible(false);
|
|
365
|
+
setActionModalOptions({
|
|
366
|
+
domain: undefined,
|
|
367
|
+
model: undefined,
|
|
368
|
+
context: {},
|
|
369
|
+
formView: undefined,
|
|
370
|
+
actionData: undefined,
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
return (
|
|
375
|
+
<>
|
|
376
|
+
<ContentRootContext.Provider
|
|
377
|
+
value={{
|
|
378
|
+
processAction,
|
|
379
|
+
globalValues,
|
|
380
|
+
}}
|
|
381
|
+
>
|
|
382
|
+
<>
|
|
383
|
+
{children}
|
|
384
|
+
<Modal
|
|
385
|
+
title={t("generatingReport")}
|
|
386
|
+
visible={reportGenerating}
|
|
387
|
+
footer={null}
|
|
388
|
+
closable={false}
|
|
389
|
+
centered
|
|
390
|
+
>
|
|
391
|
+
<Spin />
|
|
392
|
+
</Modal>
|
|
393
|
+
<FormModal
|
|
394
|
+
buttonModal
|
|
395
|
+
parentContext={actionModalOptions.context}
|
|
396
|
+
model={actionModalOptions.model!}
|
|
397
|
+
formView={actionModalOptions.formView}
|
|
398
|
+
visible={actionModalVisible}
|
|
399
|
+
onSubmitSucceed={onFormModalSucceed}
|
|
400
|
+
onCancel={() => {
|
|
401
|
+
onRefreshParentValues.current?.();
|
|
402
|
+
setActionModalVisible(false);
|
|
403
|
+
setActionModalOptions({
|
|
404
|
+
domain: undefined,
|
|
405
|
+
model: undefined,
|
|
406
|
+
context: {},
|
|
407
|
+
formView: undefined,
|
|
408
|
+
actionData: undefined,
|
|
409
|
+
});
|
|
410
|
+
}}
|
|
411
|
+
showFooter={false}
|
|
412
|
+
actionDomain={actionModalOptions.domain}
|
|
413
|
+
isMenuAction={actionModalOptions?.actionData !== undefined}
|
|
414
|
+
actionData={actionModalOptions?.actionData}
|
|
415
|
+
/>
|
|
416
|
+
</>
|
|
417
|
+
</ContentRootContext.Provider>
|
|
418
|
+
</>
|
|
419
|
+
);
|
|
420
|
+
};
|
|
421
|
+
|
|
422
|
+
export default forwardRef(ContentRootProvider);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ShortcutApi } from "@/ui/FavouriteButton";
|
|
2
|
+
import React, { useState } from "react";
|
|
3
|
+
|
|
4
|
+
export type DashboardActionContextType = {
|
|
5
|
+
isLoading: boolean;
|
|
6
|
+
setIsLoading: (value: boolean) => void;
|
|
7
|
+
dashboardRef: any;
|
|
8
|
+
openAction: (action?: ShortcutApi) => void;
|
|
9
|
+
moveItemsEnabled: boolean;
|
|
10
|
+
setMoveItemsEnabled: (value: boolean) => void;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const DashboardActionContext = React.createContext<DashboardActionContextType | null>(
|
|
14
|
+
null
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
type DashboardActionProviderProps = {
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
dashboardRef: any;
|
|
20
|
+
openAction: (action?: ShortcutApi) => void;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const DashboardActionProvider = (props: DashboardActionProviderProps): any => {
|
|
24
|
+
const [isLoading, setIsLoading] = useState<boolean>(false);
|
|
25
|
+
const [moveItemsEnabled, setMoveItemsEnabled] = useState<boolean>(false);
|
|
26
|
+
|
|
27
|
+
const { children, dashboardRef, openAction } = props;
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<DashboardActionContext.Provider
|
|
31
|
+
value={{
|
|
32
|
+
isLoading,
|
|
33
|
+
setIsLoading,
|
|
34
|
+
dashboardRef,
|
|
35
|
+
openAction,
|
|
36
|
+
moveItemsEnabled,
|
|
37
|
+
setMoveItemsEnabled,
|
|
38
|
+
}}
|
|
39
|
+
>
|
|
40
|
+
{children}
|
|
41
|
+
</DashboardActionContext.Provider>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export default DashboardActionProvider;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import React, { useRef, useState } from "react";
|
|
2
|
+
|
|
3
|
+
export type FormContextType = {
|
|
4
|
+
activeId?: number;
|
|
5
|
+
activeModel: string;
|
|
6
|
+
setFieldValue: (field: string, value?: string) => void;
|
|
7
|
+
getFieldValue: (field: string) => string;
|
|
8
|
+
executeButtonAction: ({
|
|
9
|
+
type,
|
|
10
|
+
action,
|
|
11
|
+
context,
|
|
12
|
+
}: {
|
|
13
|
+
type: string;
|
|
14
|
+
action: string;
|
|
15
|
+
context?: any;
|
|
16
|
+
}) => Promise<void>;
|
|
17
|
+
getContext: () => Promise<any>;
|
|
18
|
+
getValues: () => Promise<any>;
|
|
19
|
+
getFields: () => Promise<any>;
|
|
20
|
+
setOriginalValue: (field: string, value: any) => void;
|
|
21
|
+
domain: any[];
|
|
22
|
+
submitForm?: (options?: {
|
|
23
|
+
callOnSubmitSucceed?: boolean;
|
|
24
|
+
}) => Promise<boolean>;
|
|
25
|
+
fetchValues?: () => void;
|
|
26
|
+
formHasChanges?: () => boolean;
|
|
27
|
+
elementHasLostFocus?: () => void;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const FormContext = React.createContext<FormContextType | null>(null);
|
|
31
|
+
|
|
32
|
+
type FormProviderProps = FormContextType & {
|
|
33
|
+
children: React.ReactNode;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const FormProvider = (props: FormProviderProps): any => {
|
|
37
|
+
const {
|
|
38
|
+
children,
|
|
39
|
+
activeId,
|
|
40
|
+
activeModel,
|
|
41
|
+
setFieldValue,
|
|
42
|
+
getFieldValue,
|
|
43
|
+
executeButtonAction,
|
|
44
|
+
getContext,
|
|
45
|
+
getValues,
|
|
46
|
+
setOriginalValue,
|
|
47
|
+
domain,
|
|
48
|
+
submitForm,
|
|
49
|
+
fetchValues,
|
|
50
|
+
formHasChanges,
|
|
51
|
+
elementHasLostFocus,
|
|
52
|
+
getFields,
|
|
53
|
+
} = props;
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<FormContext.Provider
|
|
57
|
+
value={{
|
|
58
|
+
domain,
|
|
59
|
+
getValues,
|
|
60
|
+
getFields,
|
|
61
|
+
activeId,
|
|
62
|
+
activeModel,
|
|
63
|
+
setFieldValue,
|
|
64
|
+
getFieldValue,
|
|
65
|
+
executeButtonAction,
|
|
66
|
+
getContext,
|
|
67
|
+
setOriginalValue,
|
|
68
|
+
submitForm,
|
|
69
|
+
fetchValues,
|
|
70
|
+
formHasChanges,
|
|
71
|
+
elementHasLostFocus,
|
|
72
|
+
}}
|
|
73
|
+
>
|
|
74
|
+
{children}
|
|
75
|
+
</FormContext.Provider>
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export default FormProvider;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
export type FormModalContextType = {
|
|
4
|
+
setTitle?: (title: string) => void;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export const FormModalContext = React.createContext<FormModalContextType | null>(
|
|
8
|
+
null
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
type FormModalProviderProps = FormModalContextType & {
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const FormModalProvider = (props: FormModalProviderProps): any => {
|
|
16
|
+
const { children, setTitle } = props;
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<FormModalContext.Provider
|
|
20
|
+
value={{
|
|
21
|
+
setTitle,
|
|
22
|
+
}}
|
|
23
|
+
>
|
|
24
|
+
{children}
|
|
25
|
+
</FormModalContext.Provider>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default FormModalProvider;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import ca_ES from "@/locales/ca_ES";
|
|
3
|
+
import en_US from "@/locales/en_US";
|
|
4
|
+
import es_ES from "@/locales/es_ES";
|
|
5
|
+
|
|
6
|
+
const localeStrings: any = {
|
|
7
|
+
ca_ES,
|
|
8
|
+
en_US,
|
|
9
|
+
es_ES,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type LocaleContextType = {
|
|
13
|
+
lang: string;
|
|
14
|
+
t: (key: string) => string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const LocaleContext = React.createContext<LocaleContextType | null>(
|
|
18
|
+
null
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
type LocaleContextProps = {
|
|
22
|
+
children: React.ReactNode;
|
|
23
|
+
lang: string;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const LocaleContextProvider = (props: LocaleContextProps): any => {
|
|
27
|
+
const { children, lang } = props;
|
|
28
|
+
|
|
29
|
+
function t(key: string): string {
|
|
30
|
+
return tForLang(key, lang);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<LocaleContext.Provider
|
|
35
|
+
value={{
|
|
36
|
+
lang,
|
|
37
|
+
t,
|
|
38
|
+
}}
|
|
39
|
+
>
|
|
40
|
+
{children}
|
|
41
|
+
</LocaleContext.Provider>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const tForLang = (key: string, lang: string) => {
|
|
46
|
+
const translated = localeStrings[lang]?.[key];
|
|
47
|
+
return translated || key;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export default LocaleContextProvider;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { ViewModes } from "@/widgets/base/one2many/One2many";
|
|
3
|
+
|
|
4
|
+
export type One2manyContextType = {
|
|
5
|
+
currentView: ViewModes;
|
|
6
|
+
setCurrentView: (view: ViewModes) => void;
|
|
7
|
+
itemIndex: number;
|
|
8
|
+
setItemIndex: (value: number) => void;
|
|
9
|
+
manualTriggerChange: boolean;
|
|
10
|
+
setManualTriggerChange: (value: boolean) => void;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const One2manyContext = React.createContext<One2manyContextType | null>(
|
|
14
|
+
null
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
const One2manyProvider = ({
|
|
18
|
+
children,
|
|
19
|
+
initialView,
|
|
20
|
+
}: {
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
initialView: ViewModes;
|
|
23
|
+
}): any => {
|
|
24
|
+
const [currentView, setCurrentView] = useState<ViewModes>(initialView);
|
|
25
|
+
const [itemIndex, setItemIndex] = useState<number>(0);
|
|
26
|
+
const [manualTriggerChange, setManualTriggerChange] = useState<boolean>(
|
|
27
|
+
false
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<One2manyContext.Provider
|
|
32
|
+
value={{
|
|
33
|
+
currentView,
|
|
34
|
+
setCurrentView,
|
|
35
|
+
itemIndex,
|
|
36
|
+
setItemIndex,
|
|
37
|
+
manualTriggerChange,
|
|
38
|
+
setManualTriggerChange,
|
|
39
|
+
}}
|
|
40
|
+
>
|
|
41
|
+
{children}
|
|
42
|
+
</One2manyContext.Provider>
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export default One2manyProvider;
|