@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,28 @@
|
|
|
1
|
+
import ConnectionProvider from "@/ConnectionProvider";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import showInfo from "@/ui/InfoDialog";
|
|
4
|
+
|
|
5
|
+
async function showLogInfo(
|
|
6
|
+
model: string,
|
|
7
|
+
currentId: number,
|
|
8
|
+
translateFn: Function
|
|
9
|
+
) {
|
|
10
|
+
const logInfo = ((await ConnectionProvider.getHandler().getLogInfo({
|
|
11
|
+
model,
|
|
12
|
+
ids: [currentId],
|
|
13
|
+
})) as any)[0];
|
|
14
|
+
|
|
15
|
+
const { create_date, create_uid, id, write_date, write_uid } = logInfo;
|
|
16
|
+
|
|
17
|
+
showInfo(
|
|
18
|
+
<div>
|
|
19
|
+
{"ID: " + id} <br />
|
|
20
|
+
{translateFn("createdBy") + ": " + create_uid[1]} <br />
|
|
21
|
+
{translateFn("creationDate") + ": " + create_date} <br />
|
|
22
|
+
{translateFn("lastUpdatedBy") + ": " + write_uid[1]} <br />
|
|
23
|
+
{translateFn("lastUpdatedDate") + ": " + write_date}
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { showLogInfo };
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { One2manyItem } from "@/widgets/base/one2many/One2manyInput";
|
|
2
|
+
import ConnectionProvider from "@/ConnectionProvider";
|
|
3
|
+
|
|
4
|
+
type ReadObjectValuesOptions = {
|
|
5
|
+
items: One2manyItem[];
|
|
6
|
+
model: string;
|
|
7
|
+
treeFields: any;
|
|
8
|
+
formFields: any;
|
|
9
|
+
context?: any;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const readObjectValues = async (
|
|
13
|
+
options: ReadObjectValuesOptions
|
|
14
|
+
): Promise<One2manyItem[]> => {
|
|
15
|
+
const { items, model, formFields, treeFields, context = {} } = options;
|
|
16
|
+
|
|
17
|
+
const temporalItems: One2manyItem = items.filter(
|
|
18
|
+
(item) => item.operation !== "original"
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
// We get a number array of id's
|
|
22
|
+
const idsToFetch = items
|
|
23
|
+
.filter((item) => item.operation === "original")
|
|
24
|
+
.map((item) => item.id) as number[];
|
|
25
|
+
|
|
26
|
+
const values = await ConnectionProvider.getHandler().readObjects({
|
|
27
|
+
model,
|
|
28
|
+
ids: idsToFetch,
|
|
29
|
+
fields: { ...formFields, ...treeFields },
|
|
30
|
+
context,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const formValues = values.map((result: any) => {
|
|
34
|
+
const resultFormValues: any = {};
|
|
35
|
+
Object.keys(result).forEach((key) => {
|
|
36
|
+
if (formFields.hasOwnProperty(key) || key === "id") {
|
|
37
|
+
resultFormValues[key] = result[key];
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
return resultFormValues;
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const treeValues = values.map((result: any) => {
|
|
44
|
+
const resultTreeValues: any = {};
|
|
45
|
+
Object.keys(result).forEach((key) => {
|
|
46
|
+
if (treeFields.hasOwnProperty(key) || key === "id") {
|
|
47
|
+
resultTreeValues[key] = result[key];
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
return resultTreeValues;
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// We fill the values property of the One2manyItem with the retrieved values from the API
|
|
54
|
+
const originalItemsWithFetchedValues: One2manyItem[] = items.map((item) => {
|
|
55
|
+
const fetchedFormItemValues = formValues.find(
|
|
56
|
+
(itemValues: any) => itemValues.id === item.id
|
|
57
|
+
);
|
|
58
|
+
const fetchedTreeItemValues = treeValues.find(
|
|
59
|
+
(itemValues: any) => itemValues.id === item.id
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
return {
|
|
63
|
+
...item,
|
|
64
|
+
values: fetchedFormItemValues,
|
|
65
|
+
treeValues: fetchedTreeItemValues,
|
|
66
|
+
};
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
return originalItemsWithFetchedValues.concat(temporalItems);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
type RemoveItemOptions = {
|
|
73
|
+
model: string;
|
|
74
|
+
activeId: number;
|
|
75
|
+
fieldName: string;
|
|
76
|
+
idsToRemove: number[];
|
|
77
|
+
fields: any;
|
|
78
|
+
isMany2many: boolean;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const removeItems = async (options: RemoveItemOptions) => {
|
|
82
|
+
const {
|
|
83
|
+
model,
|
|
84
|
+
activeId,
|
|
85
|
+
fieldName,
|
|
86
|
+
idsToRemove,
|
|
87
|
+
fields,
|
|
88
|
+
isMany2many,
|
|
89
|
+
} = options;
|
|
90
|
+
|
|
91
|
+
const values: any = {};
|
|
92
|
+
values[fieldName] = [];
|
|
93
|
+
|
|
94
|
+
for (const idToRemove of idsToRemove) {
|
|
95
|
+
values[fieldName].push([isMany2many ? 3 : 2, idToRemove]);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
await ConnectionProvider.getHandler().update({
|
|
99
|
+
model,
|
|
100
|
+
id: activeId,
|
|
101
|
+
values,
|
|
102
|
+
fields,
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
type LinkItemOptions = {
|
|
107
|
+
model: string;
|
|
108
|
+
activeId: number;
|
|
109
|
+
fieldName: string;
|
|
110
|
+
id: number;
|
|
111
|
+
fields: any;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const linkItem = async (options: LinkItemOptions) => {
|
|
115
|
+
const { model, activeId, fieldName, id, fields } = options;
|
|
116
|
+
|
|
117
|
+
const values: any = {};
|
|
118
|
+
values[fieldName] = [[4, id]];
|
|
119
|
+
|
|
120
|
+
await ConnectionProvider.getHandler().update({
|
|
121
|
+
model,
|
|
122
|
+
id: activeId,
|
|
123
|
+
values,
|
|
124
|
+
fields,
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const getNextPendingId = (items: One2manyItem[]) => {
|
|
129
|
+
const negativeIds: number[] = items
|
|
130
|
+
.filter((item) => item.id && item.id < 0)
|
|
131
|
+
.map((item) => item.id!);
|
|
132
|
+
if (negativeIds.length === 0) {
|
|
133
|
+
return -1;
|
|
134
|
+
} else {
|
|
135
|
+
return Math.min(...negativeIds) - 1;
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
export { readObjectValues, removeItems, linkItem, getNextPendingId };
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
const convertBooleanParamIfNeeded = (value: any) => {
|
|
2
|
+
if ((typeof value === "string" && value === "true") || value === "false") {
|
|
3
|
+
return value === "true";
|
|
4
|
+
}
|
|
5
|
+
return value;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const getParamsForFields = (values: any, fields: any) => {
|
|
9
|
+
const filteredValues = removeUndefinedFields(values);
|
|
10
|
+
const groupedDateTime = groupDateTimeValuesIfNeeded(filteredValues);
|
|
11
|
+
const groupedValues = ungroupDateValuesIfNeeded(groupedDateTime, fields);
|
|
12
|
+
|
|
13
|
+
const params = [
|
|
14
|
+
...Object.keys(groupedValues).map((key) => {
|
|
15
|
+
return getParamForField(key, groupedValues[key], fields);
|
|
16
|
+
}),
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
// This is needed because in case of datetime we receive an array of arrays
|
|
20
|
+
const paramsForFields = params.reduce((acc, curVal) => {
|
|
21
|
+
if (Array.isArray(curVal[0])) {
|
|
22
|
+
return acc.concat(curVal);
|
|
23
|
+
}
|
|
24
|
+
return [...acc, curVal];
|
|
25
|
+
}, []);
|
|
26
|
+
|
|
27
|
+
return paramsForFields;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const getParamForField = (key: string, value: any, fields: any) => {
|
|
31
|
+
const filteredKey = key.split("#")[0];
|
|
32
|
+
const type = fields[filteredKey].type;
|
|
33
|
+
|
|
34
|
+
if (
|
|
35
|
+
type === "char" ||
|
|
36
|
+
type === "text" ||
|
|
37
|
+
type === "many2one" ||
|
|
38
|
+
type === "many2many" ||
|
|
39
|
+
type === "one2many"
|
|
40
|
+
) {
|
|
41
|
+
return [key, "ilike", value];
|
|
42
|
+
} else if (
|
|
43
|
+
type === "float" ||
|
|
44
|
+
type === "integer" ||
|
|
45
|
+
type === "float_time" ||
|
|
46
|
+
type === "progressbar"
|
|
47
|
+
) {
|
|
48
|
+
const operator = key.indexOf("#from") !== -1 ? ">=" : "<=";
|
|
49
|
+
return [filteredKey, operator, value];
|
|
50
|
+
} else if (type === "date") {
|
|
51
|
+
const operator = key.indexOf("#from") !== -1 ? ">=" : "<=";
|
|
52
|
+
return [filteredKey, operator, value.format("YYYY-MM-DD")];
|
|
53
|
+
} else if (type === "datetime") {
|
|
54
|
+
const filteredValues = [];
|
|
55
|
+
if (value[0]) {
|
|
56
|
+
filteredValues.push([filteredKey, ">=", value[0]]);
|
|
57
|
+
}
|
|
58
|
+
if (value[1]) {
|
|
59
|
+
filteredValues.push([filteredKey, "<=", value[1]]);
|
|
60
|
+
}
|
|
61
|
+
return filteredValues;
|
|
62
|
+
} else if (type === "selection") {
|
|
63
|
+
return [
|
|
64
|
+
key,
|
|
65
|
+
"in",
|
|
66
|
+
value.map((valueEntry: string) =>
|
|
67
|
+
convertBooleanParamIfNeeded(valueEntry)
|
|
68
|
+
),
|
|
69
|
+
];
|
|
70
|
+
} else {
|
|
71
|
+
return [key, "=", convertBooleanParamIfNeeded(value)];
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const getDatetimeDateFields = (values: any) => {
|
|
76
|
+
return Object.keys(values).filter((key) => {
|
|
77
|
+
return key.indexOf("#date") !== -1;
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const removeDateTimeSingleFields = (values: any) => {
|
|
82
|
+
const newValues = { ...values };
|
|
83
|
+
Object.keys(newValues).forEach(
|
|
84
|
+
(key) =>
|
|
85
|
+
(key.indexOf("#time") !== -1 || key.indexOf("#date") !== -1) &&
|
|
86
|
+
delete newValues[key]
|
|
87
|
+
);
|
|
88
|
+
return newValues;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const groupDateTimeValuesIfNeeded = (values: any) => {
|
|
92
|
+
const newValues: any = { ...removeDateTimeSingleFields(values) };
|
|
93
|
+
|
|
94
|
+
const datetimeDateFields = getDatetimeDateFields(values);
|
|
95
|
+
|
|
96
|
+
datetimeDateFields.forEach((field) => {
|
|
97
|
+
const datePair = values[field];
|
|
98
|
+
const baseKey = field.split("#")[0];
|
|
99
|
+
const timeKey = baseKey + "#time";
|
|
100
|
+
const timePair = values[timeKey];
|
|
101
|
+
|
|
102
|
+
let from, to;
|
|
103
|
+
|
|
104
|
+
if (datePair[0] !== null) {
|
|
105
|
+
const dateValueFrom = datePair[0].format("YYYY-MM-DD");
|
|
106
|
+
from = dateValueFrom;
|
|
107
|
+
|
|
108
|
+
if (timePair && timePair[0] !== null) {
|
|
109
|
+
const timeValueFrom = timePair[0].format("HH:mm:ss");
|
|
110
|
+
from = from + " " + timeValueFrom;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (datePair[1] !== null) {
|
|
115
|
+
const dateValueTo = datePair[1].format("YYYY-MM-DD");
|
|
116
|
+
to = dateValueTo;
|
|
117
|
+
|
|
118
|
+
if (timePair && timePair[1] !== null) {
|
|
119
|
+
const timeValueTo = timePair[1].format("HH:mm:ss");
|
|
120
|
+
to = to + " " + timeValueTo;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
newValues[baseKey + "#datetime"] = [from, to];
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
return newValues;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
const ungroupDateValuesIfNeeded = (values: any, fields: any) => {
|
|
131
|
+
const dateFields = Object.keys(values).filter((key) => {
|
|
132
|
+
return fields[key] && fields[key].type === "date";
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
let newValues: any = { ...values };
|
|
136
|
+
|
|
137
|
+
dateFields.forEach((key) => {
|
|
138
|
+
delete newValues[key];
|
|
139
|
+
if (values[key][0] !== null) {
|
|
140
|
+
newValues[key + "#from"] = values[key][0];
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if (values[key][1] !== null) {
|
|
144
|
+
newValues[key + "#to"] = values[key][1];
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
return newValues;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
const removeUndefinedFields = (values: any) => {
|
|
152
|
+
const newValues = { ...values };
|
|
153
|
+
Object.keys(newValues).forEach(
|
|
154
|
+
(key) =>
|
|
155
|
+
(newValues[key] === undefined ||
|
|
156
|
+
newValues[key] === null ||
|
|
157
|
+
newValues[key] === "") &&
|
|
158
|
+
delete newValues[key]
|
|
159
|
+
);
|
|
160
|
+
return newValues;
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
export {
|
|
164
|
+
removeUndefinedFields,
|
|
165
|
+
groupDateTimeValuesIfNeeded,
|
|
166
|
+
getParamsForFields,
|
|
167
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
function parseStringToFloat(text?: string) {
|
|
2
|
+
if (!text) {
|
|
3
|
+
return undefined;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
try {
|
|
7
|
+
if (text.includes(":")) {
|
|
8
|
+
const splitted = text.trim().split(":");
|
|
9
|
+
return (
|
|
10
|
+
Math.round(
|
|
11
|
+
(parseInt(splitted[0]) + parseInt(splitted[1]) / 60.0) * 10000
|
|
12
|
+
) / 10000
|
|
13
|
+
);
|
|
14
|
+
} else {
|
|
15
|
+
return parseFloat(text.trim());
|
|
16
|
+
}
|
|
17
|
+
} catch (err) {
|
|
18
|
+
return 0;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function parseFloatToString(num?: number) {
|
|
23
|
+
if (num === undefined) {
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
let finalString;
|
|
28
|
+
let hours = Math.floor(Math.abs(num));
|
|
29
|
+
let mins = Math.round((Math.abs(num) % 1) * 100) / 100;
|
|
30
|
+
|
|
31
|
+
if (mins >= 1) {
|
|
32
|
+
hours = hours + 1;
|
|
33
|
+
mins = 0.0;
|
|
34
|
+
} else {
|
|
35
|
+
mins = mins * 60;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const hoursString = hours.toLocaleString("en-US", {
|
|
39
|
+
minimumIntegerDigits: 2,
|
|
40
|
+
maximumFractionDigits: 0,
|
|
41
|
+
useGrouping: false,
|
|
42
|
+
});
|
|
43
|
+
const minsStrings = mins.toLocaleString("en-US", {
|
|
44
|
+
minimumIntegerDigits: 2,
|
|
45
|
+
maximumFractionDigits: 0,
|
|
46
|
+
useGrouping: false,
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
finalString = `${hoursString}:${minsStrings}`;
|
|
50
|
+
|
|
51
|
+
if (num < 0) {
|
|
52
|
+
finalString = "-" + finalString;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return finalString;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export { parseStringToFloat, parseFloatToString };
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { Tree as TreeOoui, Selection, Many2one, Boolean } from "@gisce/ooui";
|
|
2
|
+
import { TreeView, Column } from "@/types";
|
|
3
|
+
|
|
4
|
+
const getTree = (treeView: TreeView): TreeOoui => {
|
|
5
|
+
const xml = treeView.arch;
|
|
6
|
+
const fields = treeView.fields;
|
|
7
|
+
const tree = new TreeOoui(fields);
|
|
8
|
+
tree.parse(xml);
|
|
9
|
+
return tree;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const getTableColumns = (tree: TreeOoui, components: any): Array<Column> => {
|
|
13
|
+
const tableColumns = tree.columns.map((column) => {
|
|
14
|
+
const type = column.type;
|
|
15
|
+
const key = column.id;
|
|
16
|
+
const component = components?.[type];
|
|
17
|
+
let render;
|
|
18
|
+
|
|
19
|
+
if (component) {
|
|
20
|
+
render = (item: any) => {
|
|
21
|
+
return component(item);
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
key,
|
|
27
|
+
dataIndex: key,
|
|
28
|
+
title: column.label,
|
|
29
|
+
render,
|
|
30
|
+
sorter: (a: any, b: any) => {
|
|
31
|
+
let aItem = a[key] || "",
|
|
32
|
+
bItem = b[key] || "";
|
|
33
|
+
|
|
34
|
+
if (type === "many2one") {
|
|
35
|
+
aItem = a[key]?.value || "";
|
|
36
|
+
bItem = b[key]?.value || "";
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (aItem < bItem) return -1;
|
|
40
|
+
if (aItem > bItem) return 1;
|
|
41
|
+
return 0;
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
return tableColumns;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const getTableItems = (treeOoui: TreeOoui, results: Array<any>): Array<any> => {
|
|
49
|
+
const tableItems = results.map((item: any) => {
|
|
50
|
+
const parsedItem: any = {};
|
|
51
|
+
Object.keys(item).map((key) => {
|
|
52
|
+
if (key === "id") {
|
|
53
|
+
parsedItem[key] = item[key];
|
|
54
|
+
} else {
|
|
55
|
+
const widget = treeOoui.findById(key);
|
|
56
|
+
|
|
57
|
+
if (widget instanceof Selection) {
|
|
58
|
+
const selection = widget;
|
|
59
|
+
parsedItem[key] = selection.selectionValues.get(item[key]);
|
|
60
|
+
} else if (widget instanceof Many2one) {
|
|
61
|
+
parsedItem[key] = item[key] &&
|
|
62
|
+
Array.isArray(item[key]) &&
|
|
63
|
+
item[key].length === 2 && {
|
|
64
|
+
model: widget.relation,
|
|
65
|
+
id: item[key][0],
|
|
66
|
+
value: item[key][1],
|
|
67
|
+
};
|
|
68
|
+
} else if (widget instanceof Boolean) {
|
|
69
|
+
parsedItem[key] = item[key];
|
|
70
|
+
} else if (widget) {
|
|
71
|
+
parsedItem[key] = item[key] === false ? "" : item[key];
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
return parsedItem;
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
return tableItems;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
function itemHasBooleans({ values, fields }: { values: any; fields: any }) {
|
|
82
|
+
if (!fields) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
return Object.keys(values).some((key) => {
|
|
86
|
+
return fields[key] !== undefined && fields[key].type === "boolean";
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function convertBooleansToNumeric({
|
|
91
|
+
values,
|
|
92
|
+
fields,
|
|
93
|
+
}: {
|
|
94
|
+
values: any;
|
|
95
|
+
fields: any;
|
|
96
|
+
}) {
|
|
97
|
+
if (!fields) {
|
|
98
|
+
return values;
|
|
99
|
+
}
|
|
100
|
+
const filteredValues: any = {};
|
|
101
|
+
Object.keys(values).forEach((key) => {
|
|
102
|
+
if (fields[key] !== undefined && fields[key].type === "boolean") {
|
|
103
|
+
filteredValues[key] = values[key] === true ? 1 : 0;
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
return { ...values, ...filteredValues };
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function getColorMap(colorsValue: any) {
|
|
110
|
+
if (!colorsValue) {
|
|
111
|
+
return undefined;
|
|
112
|
+
}
|
|
113
|
+
const map: any = {};
|
|
114
|
+
colorsValue.forEach((colorEntry: any) => {
|
|
115
|
+
map[colorEntry.id] = colorEntry.colors;
|
|
116
|
+
});
|
|
117
|
+
return map;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export {
|
|
121
|
+
getTableColumns,
|
|
122
|
+
getTableItems,
|
|
123
|
+
getTree,
|
|
124
|
+
convertBooleansToNumeric,
|
|
125
|
+
itemHasBooleans,
|
|
126
|
+
getColorMap,
|
|
127
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { useRef, useEffect } from "react";
|
|
2
|
+
|
|
3
|
+
const usePrevious = (value: any, initialValue: any) => {
|
|
4
|
+
const ref = useRef(initialValue);
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
ref.current = value;
|
|
7
|
+
});
|
|
8
|
+
return ref.current;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const useEffectDebugger = (
|
|
12
|
+
effectHook: any,
|
|
13
|
+
dependencies: any,
|
|
14
|
+
dependencyNames = []
|
|
15
|
+
) => {
|
|
16
|
+
const previousDeps = usePrevious(dependencies, []);
|
|
17
|
+
|
|
18
|
+
const changedDeps = dependencies.reduce(
|
|
19
|
+
(accum: any, dependency: any, index: any) => {
|
|
20
|
+
if (dependency !== previousDeps[index]) {
|
|
21
|
+
const keyName = dependencyNames[index] || index;
|
|
22
|
+
return {
|
|
23
|
+
...accum,
|
|
24
|
+
[keyName]: {
|
|
25
|
+
before: previousDeps[index],
|
|
26
|
+
after: dependency,
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return accum;
|
|
32
|
+
},
|
|
33
|
+
{}
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
if (Object.keys(changedDeps).length) {
|
|
37
|
+
console.log("[use-effect-debugger] ", changedDeps);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
useEffect(effectHook, dependencies);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export { useEffectDebugger };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useState, useEffect } from "react";
|
|
2
|
+
|
|
3
|
+
const MODAL_WIDTH_CONSTANT = 0.7;
|
|
4
|
+
|
|
5
|
+
function getWindowDimensions() {
|
|
6
|
+
const { innerWidth: width, innerHeight: height } = window;
|
|
7
|
+
return {
|
|
8
|
+
width,
|
|
9
|
+
height,
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default function useWindowDimensions() {
|
|
14
|
+
const [windowDimensions, setWindowDimensions] = useState(
|
|
15
|
+
getWindowDimensions()
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
function handleResize() {
|
|
20
|
+
setWindowDimensions(getWindowDimensions());
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
window.addEventListener("resize", handleResize);
|
|
24
|
+
return () => window.removeEventListener("resize", handleResize);
|
|
25
|
+
}, []);
|
|
26
|
+
|
|
27
|
+
return {
|
|
28
|
+
modalWidth: windowDimensions.width * MODAL_WIDTH_CONSTANT,
|
|
29
|
+
modalHeight: windowDimensions.height,
|
|
30
|
+
width: windowDimensions.width,
|
|
31
|
+
height: windowDimensions.height,
|
|
32
|
+
};
|
|
33
|
+
}
|