@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,117 @@
|
|
|
1
|
+
import { ViewType } from "@/types";
|
|
2
|
+
import { ShortcutApi } from "@/ui/FavouriteButton";
|
|
3
|
+
import { View } from "@/views/ActionView";
|
|
4
|
+
import React, { useState } from "react";
|
|
5
|
+
|
|
6
|
+
export type TabManagerContextType = {
|
|
7
|
+
openAction: ({
|
|
8
|
+
domain,
|
|
9
|
+
context,
|
|
10
|
+
model,
|
|
11
|
+
views,
|
|
12
|
+
title,
|
|
13
|
+
target,
|
|
14
|
+
initialView,
|
|
15
|
+
action_id,
|
|
16
|
+
action_type,
|
|
17
|
+
res_id,
|
|
18
|
+
values,
|
|
19
|
+
forced_values,
|
|
20
|
+
}: {
|
|
21
|
+
domain: any;
|
|
22
|
+
context: any;
|
|
23
|
+
model: string;
|
|
24
|
+
views: Array<any>;
|
|
25
|
+
title: string;
|
|
26
|
+
target: string;
|
|
27
|
+
initialView: View;
|
|
28
|
+
action_id: number;
|
|
29
|
+
action_type: string;
|
|
30
|
+
res_id?: number | boolean;
|
|
31
|
+
values?: any;
|
|
32
|
+
forced_values?: any;
|
|
33
|
+
}) => void;
|
|
34
|
+
openRelate: ({
|
|
35
|
+
relateData,
|
|
36
|
+
fields,
|
|
37
|
+
values,
|
|
38
|
+
action_id,
|
|
39
|
+
action_type,
|
|
40
|
+
}: {
|
|
41
|
+
relateData: any;
|
|
42
|
+
fields: any;
|
|
43
|
+
values: any;
|
|
44
|
+
action_id: number;
|
|
45
|
+
action_type: string;
|
|
46
|
+
}) => void;
|
|
47
|
+
openDefaultActionForModel: ({
|
|
48
|
+
model,
|
|
49
|
+
values,
|
|
50
|
+
forced_values,
|
|
51
|
+
initialViewType,
|
|
52
|
+
res_id,
|
|
53
|
+
}: {
|
|
54
|
+
model: string;
|
|
55
|
+
values?: any;
|
|
56
|
+
forced_values?: any;
|
|
57
|
+
initialViewType?: ViewType;
|
|
58
|
+
res_id?: number;
|
|
59
|
+
}) => void;
|
|
60
|
+
activeKey: string;
|
|
61
|
+
onChangeTab: (key: string) => void;
|
|
62
|
+
onRemoveTab: (key: string) => void;
|
|
63
|
+
openShortcut: (shortcut: ShortcutApi) => void;
|
|
64
|
+
tabs: any[];
|
|
65
|
+
currentView?: View;
|
|
66
|
+
setCurrentView?: (view?: View) => void;
|
|
67
|
+
currentId?: number;
|
|
68
|
+
setCurrentId?: (id?: number) => void;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export const TabManagerContext = React.createContext<TabManagerContextType | null>(
|
|
72
|
+
null
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
type TabManagerProviderProps = TabManagerContextType & {
|
|
76
|
+
children: React.ReactNode;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const TabManagerProvider = (props: TabManagerProviderProps): any => {
|
|
80
|
+
const {
|
|
81
|
+
children,
|
|
82
|
+
openAction,
|
|
83
|
+
openRelate,
|
|
84
|
+
openDefaultActionForModel,
|
|
85
|
+
openShortcut,
|
|
86
|
+
activeKey,
|
|
87
|
+
onChangeTab,
|
|
88
|
+
onRemoveTab,
|
|
89
|
+
tabs,
|
|
90
|
+
} = props;
|
|
91
|
+
|
|
92
|
+
const [currentView, setCurrentView] = useState<View>();
|
|
93
|
+
const [currentId, setCurrentId] = useState<number>();
|
|
94
|
+
|
|
95
|
+
return (
|
|
96
|
+
<TabManagerContext.Provider
|
|
97
|
+
value={{
|
|
98
|
+
openAction,
|
|
99
|
+
openRelate,
|
|
100
|
+
openDefaultActionForModel,
|
|
101
|
+
activeKey,
|
|
102
|
+
openShortcut,
|
|
103
|
+
onChangeTab,
|
|
104
|
+
onRemoveTab,
|
|
105
|
+
tabs,
|
|
106
|
+
currentId,
|
|
107
|
+
currentView,
|
|
108
|
+
setCurrentId,
|
|
109
|
+
setCurrentView,
|
|
110
|
+
}}
|
|
111
|
+
>
|
|
112
|
+
{children}
|
|
113
|
+
</TabManagerContext.Provider>
|
|
114
|
+
);
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export default TabManagerProvider;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { Widget, Label, Field, Container } from "@gisce/ooui";
|
|
2
|
+
|
|
3
|
+
const getSpanStyleForItem = ({
|
|
4
|
+
item,
|
|
5
|
+
responsiveBehaviour,
|
|
6
|
+
}: {
|
|
7
|
+
item: Widget;
|
|
8
|
+
responsiveBehaviour: boolean;
|
|
9
|
+
}) => {
|
|
10
|
+
return {
|
|
11
|
+
gridColumnStart: "span " + (responsiveBehaviour ? 1 : item.colspan),
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const fillRowWithEmptiesToFit = ({
|
|
16
|
+
row,
|
|
17
|
+
mustFillWithEmpties,
|
|
18
|
+
numberOfColumns,
|
|
19
|
+
}: {
|
|
20
|
+
row: any;
|
|
21
|
+
mustFillWithEmpties: boolean;
|
|
22
|
+
numberOfColumns: number;
|
|
23
|
+
}) => {
|
|
24
|
+
const rowWithEmptiesToFit: any = [];
|
|
25
|
+
let totalColSpan = 0;
|
|
26
|
+
|
|
27
|
+
const isLastItemAndMustFit = (columnIndex: number) => {
|
|
28
|
+
return (
|
|
29
|
+
columnIndex + 1 === row.length &&
|
|
30
|
+
totalColSpan < numberOfColumns &&
|
|
31
|
+
!mustFillWithEmpties
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
row.map((item: Widget, columnIndex: number) => {
|
|
36
|
+
totalColSpan += item.colspan;
|
|
37
|
+
|
|
38
|
+
if (isLastItemAndMustFit(columnIndex)) {
|
|
39
|
+
const gapsToAdjust = numberOfColumns - totalColSpan;
|
|
40
|
+
item.colspan = item.colspan + gapsToAdjust;
|
|
41
|
+
totalColSpan += gapsToAdjust;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
rowWithEmptiesToFit.push(item);
|
|
45
|
+
|
|
46
|
+
if (isLastItemAndMustFit(columnIndex)) {
|
|
47
|
+
const gapsToFill = numberOfColumns - totalColSpan;
|
|
48
|
+
for (let i = 0; i < gapsToFill; i += 1) {
|
|
49
|
+
rowWithEmptiesToFit.push(new Label({ string: "" }));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
return rowWithEmptiesToFit;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const expandWidgetsIfNeeded = ({
|
|
58
|
+
row,
|
|
59
|
+
numberOfColumns,
|
|
60
|
+
}: {
|
|
61
|
+
row: any;
|
|
62
|
+
numberOfColumns: number;
|
|
63
|
+
}) => {
|
|
64
|
+
return row.map((item: Widget) => {
|
|
65
|
+
if ((item as any)._mustExpand) {
|
|
66
|
+
(item as any).colspan = numberOfColumns;
|
|
67
|
+
return item;
|
|
68
|
+
}
|
|
69
|
+
return item;
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const getSingleRowTemplateColumns = (
|
|
74
|
+
row: Widget[],
|
|
75
|
+
numberOfColumns: number
|
|
76
|
+
) => {
|
|
77
|
+
const gridOptions = row.map((item: Widget) => {
|
|
78
|
+
if (item instanceof Label && (item as Label).fieldForLabel) {
|
|
79
|
+
return "auto";
|
|
80
|
+
}
|
|
81
|
+
if (item instanceof Container) {
|
|
82
|
+
return "auto";
|
|
83
|
+
}
|
|
84
|
+
return "1fr";
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
if (gridOptions.length < numberOfColumns) {
|
|
88
|
+
const columnsToAdd = numberOfColumns - gridOptions.length;
|
|
89
|
+
for (let i = 0; i < columnsToAdd; i++) {
|
|
90
|
+
gridOptions.push("1fr");
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return gridOptions.join(" ");
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const getTemplateColumns = (columns: number, fieldInRows: boolean) => {
|
|
97
|
+
// We check if we have any label+field inside (fieldInRows) the container.
|
|
98
|
+
// In this scenario, we must format the grid accordingly
|
|
99
|
+
// Otherwise, the grid will divide uniformly (auto)
|
|
100
|
+
const odd = fieldInRows ? "1fr" : "auto";
|
|
101
|
+
const even = "auto";
|
|
102
|
+
let templateColumns = "";
|
|
103
|
+
for (let i = 0; i < columns; i++) {
|
|
104
|
+
templateColumns += i % 2 ? odd : even;
|
|
105
|
+
if (i + 1 < columns) {
|
|
106
|
+
templateColumns += " ";
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return templateColumns;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const getMaxColspanForRows = (rows: Widget[][]) => {
|
|
113
|
+
const maxColspan = rows.map((row: Widget[]) => {
|
|
114
|
+
return row.reduce((prev, current) => {
|
|
115
|
+
return prev + current.colspan;
|
|
116
|
+
}, 0);
|
|
117
|
+
});
|
|
118
|
+
return maxColspan.reduce((a, b) => {
|
|
119
|
+
return Math.max(a, b);
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
const rowsHaveAnyField = (rows: Widget[][]) => {
|
|
124
|
+
let found = false;
|
|
125
|
+
|
|
126
|
+
rows.map((row: Widget[]) => {
|
|
127
|
+
row.map((item: Widget) => {
|
|
128
|
+
if (item instanceof Field) {
|
|
129
|
+
found = true;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
return found;
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
export {
|
|
138
|
+
fillRowWithEmptiesToFit,
|
|
139
|
+
getSpanStyleForItem,
|
|
140
|
+
expandWidgetsIfNeeded,
|
|
141
|
+
getMaxColspanForRows,
|
|
142
|
+
rowsHaveAnyField,
|
|
143
|
+
getSingleRowTemplateColumns,
|
|
144
|
+
getTemplateColumns,
|
|
145
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This function calculate the width of a string based on its length
|
|
3
|
+
* @param {String} text
|
|
4
|
+
* @param {String} font
|
|
5
|
+
*/
|
|
6
|
+
const getTextWidth = (text: string, font = "14px -apple-system") => {
|
|
7
|
+
const canvas = document.createElement("canvas");
|
|
8
|
+
const context = canvas.getContext("2d");
|
|
9
|
+
context!.font = font;
|
|
10
|
+
const metrics = context!.measureText(text);
|
|
11
|
+
return Math.round((metrics.width + 80) * 1.5);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* This function calculates the width of each column based in all CELL VALUES
|
|
16
|
+
* @param {Array} columns
|
|
17
|
+
* @param {Array} source
|
|
18
|
+
* @param {Number} maxWidthPerCell
|
|
19
|
+
*/
|
|
20
|
+
export const calculateColumnsWidth = (
|
|
21
|
+
columns: any,
|
|
22
|
+
source: any,
|
|
23
|
+
maxWidthPerCell = 500
|
|
24
|
+
) => {
|
|
25
|
+
if (columns.length === 0) {
|
|
26
|
+
return columns;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// First we calculate the width for each column
|
|
30
|
+
// The column width is based on its string length
|
|
31
|
+
|
|
32
|
+
const columnsWithWidth = columns.map((column: any) =>
|
|
33
|
+
Object.assign(column, {
|
|
34
|
+
width: getTextWidth(column.title),
|
|
35
|
+
})
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
// Since we have a minimum width (column's width already calculated),
|
|
39
|
+
// now we are going to verify if the cell value is bigger
|
|
40
|
+
// than the column width which is already set
|
|
41
|
+
|
|
42
|
+
source.map((entry: any) => {
|
|
43
|
+
columnsWithWidth.map((column: any, indexColumn: number) => {
|
|
44
|
+
const columnWidth = column.width;
|
|
45
|
+
const cellValue = (entry[column.key] as string) || "";
|
|
46
|
+
|
|
47
|
+
// Get the string width based on chars length
|
|
48
|
+
let cellWidth = getTextWidth(cellValue);
|
|
49
|
+
|
|
50
|
+
// Verify if the cell value is smaller than column's width
|
|
51
|
+
if (cellWidth < columnWidth) cellWidth = columnWidth;
|
|
52
|
+
|
|
53
|
+
// Verify if the cell value width is bigger than our max width flag
|
|
54
|
+
if (cellWidth > maxWidthPerCell) cellWidth = maxWidthPerCell;
|
|
55
|
+
|
|
56
|
+
// Update the column width
|
|
57
|
+
columnsWithWidth[indexColumn].width = cellWidth;
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
// Sum of all columns width to determine the table max width
|
|
62
|
+
const tableWidth = columnsWithWidth
|
|
63
|
+
.map((column: any) => column.width)
|
|
64
|
+
.reduce((a: any, b: any) => {
|
|
65
|
+
return a + b;
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
return {
|
|
69
|
+
columns: columnsWithWidth,
|
|
70
|
+
source,
|
|
71
|
+
tableWidth,
|
|
72
|
+
};
|
|
73
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import FileType from "file-type/browser";
|
|
2
|
+
|
|
3
|
+
export function getFilesize(base64string: string) {
|
|
4
|
+
const buffer = Buffer.from(base64string, "base64");
|
|
5
|
+
const inKbs = buffer.length / 1e3;
|
|
6
|
+
return `${Math.round((inKbs + Number.EPSILON) * 100) / 100} KB`;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export async function getMimeType(base64string: string) {
|
|
10
|
+
const mimeInfo = await FileType.fromBuffer(
|
|
11
|
+
Buffer.from(base64string, "base64")
|
|
12
|
+
);
|
|
13
|
+
if (!mimeInfo) {
|
|
14
|
+
return {
|
|
15
|
+
mime: "text/plain",
|
|
16
|
+
ext: "txt",
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return mimeInfo;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const toBase64 = (file: File): Promise<string> =>
|
|
24
|
+
new Promise((resolve, reject) => {
|
|
25
|
+
const reader = new FileReader();
|
|
26
|
+
reader.readAsDataURL(file);
|
|
27
|
+
reader.onload = (e: any) => resolve(e.target.result.split(",")[1]);
|
|
28
|
+
reader.onerror = (error) => reject(error);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export function openBase64InNewTab(data: string, mimeType: string) {
|
|
32
|
+
var byteCharacters = atob(data);
|
|
33
|
+
var byteNumbers = new Array(byteCharacters.length);
|
|
34
|
+
for (var i = 0; i < byteCharacters.length; i++) {
|
|
35
|
+
byteNumbers[i] = byteCharacters.charCodeAt(i);
|
|
36
|
+
}
|
|
37
|
+
var byteArray = new Uint8Array(byteNumbers);
|
|
38
|
+
var file = new Blob([byteArray], { type: mimeType + ";base64" });
|
|
39
|
+
var fileURL = URL.createObjectURL(file);
|
|
40
|
+
window.open(fileURL);
|
|
41
|
+
}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { One2manyItem } from "@/widgets/base/one2many/One2manyInput";
|
|
2
|
+
|
|
3
|
+
const filteredValues = (values: any, fields: any) => {
|
|
4
|
+
if (!fields) {
|
|
5
|
+
return values;
|
|
6
|
+
}
|
|
7
|
+
const filteredValues: any = {};
|
|
8
|
+
Object.keys(values).forEach((key) => {
|
|
9
|
+
if (fields[key] === undefined) {
|
|
10
|
+
// console.log(`${key} is not in fields`);
|
|
11
|
+
filteredValues[key] = values[key];
|
|
12
|
+
} else if (values[key] === false && fields[key].type !== "boolean") {
|
|
13
|
+
// Do nothing - filter the field.
|
|
14
|
+
} else if (fields[key].type === "boolean") {
|
|
15
|
+
const boolValue = values[key];
|
|
16
|
+
if (boolValue === 0) {
|
|
17
|
+
filteredValues[key] = false;
|
|
18
|
+
} else if (boolValue === 1) {
|
|
19
|
+
filteredValues[key] = true;
|
|
20
|
+
} else {
|
|
21
|
+
filteredValues[key] = values[key];
|
|
22
|
+
}
|
|
23
|
+
} else {
|
|
24
|
+
filteredValues[key] = values[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
return filteredValues;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const processValues = (values: any, fields: any) => {
|
|
31
|
+
const filterBooleans = filteredValues(values, fields);
|
|
32
|
+
return filterBooleans;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const getTouchedValues = ({
|
|
36
|
+
source,
|
|
37
|
+
target,
|
|
38
|
+
fields,
|
|
39
|
+
}: {
|
|
40
|
+
source: any;
|
|
41
|
+
target: any;
|
|
42
|
+
fields: any;
|
|
43
|
+
}) => {
|
|
44
|
+
const differences: any = {};
|
|
45
|
+
Object.keys(target).forEach((key) => {
|
|
46
|
+
const is2Many = fields[key]
|
|
47
|
+
? fields[key].type === "one2many" || fields[key].type === "many2many"
|
|
48
|
+
: false;
|
|
49
|
+
|
|
50
|
+
if (is2Many) {
|
|
51
|
+
const sourceValue = JSON.stringify(source[key]);
|
|
52
|
+
const targetValue = JSON.stringify(target[key]);
|
|
53
|
+
if (sourceValue === targetValue) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const nonOriginalItems =
|
|
58
|
+
target[key]?.items?.filter(
|
|
59
|
+
(item: One2manyItem) => item.operation !== "original"
|
|
60
|
+
) || [];
|
|
61
|
+
|
|
62
|
+
if (nonOriginalItems.length > 0) {
|
|
63
|
+
differences[key] = target[key];
|
|
64
|
+
}
|
|
65
|
+
} else if (Array.isArray(target[key])) {
|
|
66
|
+
if (source[key] === undefined) {
|
|
67
|
+
differences[key] = target[key];
|
|
68
|
+
} else if (fields[key].type === "many2one") {
|
|
69
|
+
if (!Array.isArray(source[key])) {
|
|
70
|
+
// This will mean the source many2one value is a numeric id
|
|
71
|
+
const numericId = source[key];
|
|
72
|
+
const [targetNumericId] = target[key];
|
|
73
|
+
if (numericId !== targetNumericId) {
|
|
74
|
+
differences[key] = target[key];
|
|
75
|
+
}
|
|
76
|
+
} else {
|
|
77
|
+
const sourceValue = JSON.stringify(source[key]);
|
|
78
|
+
const targetValue = JSON.stringify(target[key]);
|
|
79
|
+
if (sourceValue !== targetValue) {
|
|
80
|
+
differences[key] = target[key];
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
} else {
|
|
84
|
+
const sourceValue = JSON.stringify(source[key]);
|
|
85
|
+
const targetValue = JSON.stringify(target[key]);
|
|
86
|
+
if (sourceValue !== targetValue) {
|
|
87
|
+
differences[key] = target[key];
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
} else if (source[key] !== target[key]) {
|
|
91
|
+
if (target[key] === undefined) {
|
|
92
|
+
differences[key] = null;
|
|
93
|
+
} else {
|
|
94
|
+
differences[key] = target[key];
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
return differences;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export const checkFieldsType = ({
|
|
102
|
+
changedFields,
|
|
103
|
+
fields,
|
|
104
|
+
types,
|
|
105
|
+
}: {
|
|
106
|
+
changedFields: string[];
|
|
107
|
+
fields: any;
|
|
108
|
+
types: string[];
|
|
109
|
+
}) => {
|
|
110
|
+
const valuesChecked = changedFields.map((key) => {
|
|
111
|
+
return types.includes(fields[key]?.type);
|
|
112
|
+
});
|
|
113
|
+
return valuesChecked.some((i) => i === true);
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
export const mergeFieldsDomain = ({
|
|
117
|
+
fieldsDomain,
|
|
118
|
+
fields,
|
|
119
|
+
}: {
|
|
120
|
+
fieldsDomain: any;
|
|
121
|
+
fields: any;
|
|
122
|
+
}) => {
|
|
123
|
+
const output: any = {};
|
|
124
|
+
|
|
125
|
+
Object.keys(fields).forEach((key) => {
|
|
126
|
+
output[key] = fields[key];
|
|
127
|
+
|
|
128
|
+
if (fieldsDomain[key]) {
|
|
129
|
+
output[key].domain = fieldsDomain[key];
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
return output;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export const getValuesForDomain = (domain: any[]) => {
|
|
137
|
+
const values: any = {};
|
|
138
|
+
|
|
139
|
+
if (!domain || !Array.isArray(domain) || domain?.length === 0) {
|
|
140
|
+
return {};
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
domain.forEach((entry) => {
|
|
144
|
+
if (entry?.[1] === "=") {
|
|
145
|
+
values[entry[0]] = entry[2];
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
return values;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
export const getOnChangePayload = ({
|
|
153
|
+
onChangeFieldActionArgs,
|
|
154
|
+
values,
|
|
155
|
+
}: {
|
|
156
|
+
onChangeFieldActionArgs: any[];
|
|
157
|
+
values: any;
|
|
158
|
+
}) => {
|
|
159
|
+
const payload: any = {};
|
|
160
|
+
onChangeFieldActionArgs.forEach((arg: string) => {
|
|
161
|
+
if (values[arg]) {
|
|
162
|
+
payload[arg] = values[arg];
|
|
163
|
+
} else if (arg[0] === "'") {
|
|
164
|
+
payload[arg] = arg.replace(/'/g, "");
|
|
165
|
+
} else {
|
|
166
|
+
payload[arg] = false;
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
return payload;
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
export const mergeSearchFields = (searchFields: any[]) => {
|
|
173
|
+
const mergedSearchFields = {
|
|
174
|
+
primary: [],
|
|
175
|
+
secondary: [],
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
searchFields.forEach((sf) => {
|
|
179
|
+
if (!sf) {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
mergedSearchFields.primary = mergedSearchFields.primary.concat(sf.primary);
|
|
184
|
+
mergedSearchFields.secondary = mergedSearchFields.secondary.concat(
|
|
185
|
+
sf.secondary
|
|
186
|
+
);
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
return {
|
|
190
|
+
primary: mergedSearchFields.primary.filter(onlyUnique),
|
|
191
|
+
secondary: mergedSearchFields.secondary.filter(onlyUnique),
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
function onlyUnique(value: any, index: number, self: any) {
|
|
196
|
+
return self.indexOf(value) === index;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export const transformPlainMany2Ones = ({
|
|
200
|
+
values,
|
|
201
|
+
fields,
|
|
202
|
+
}: {
|
|
203
|
+
values: any;
|
|
204
|
+
fields: any;
|
|
205
|
+
}) => {
|
|
206
|
+
let reformattedValues: { [key: string]: any } = {};
|
|
207
|
+
|
|
208
|
+
Object.keys(values).forEach((key) => {
|
|
209
|
+
const value = values[key];
|
|
210
|
+
|
|
211
|
+
if (
|
|
212
|
+
fields[key] &&
|
|
213
|
+
fields[key].type === "many2one" &&
|
|
214
|
+
value &&
|
|
215
|
+
Array.isArray(value) &&
|
|
216
|
+
value.length === 2
|
|
217
|
+
) {
|
|
218
|
+
reformattedValues[key] = value[0];
|
|
219
|
+
} else {
|
|
220
|
+
reformattedValues[key] = value;
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
return reformattedValues;
|
|
225
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import * as Icons from "@ant-design/icons";
|
|
2
|
+
|
|
3
|
+
const iconMapping: { [key: string]: React.ElementType } = {
|
|
4
|
+
STOCK_HELP: Icons.QuestionOutlined,
|
|
5
|
+
STOCK_GO_UP: Icons.ArrowUpOutlined,
|
|
6
|
+
STOCK_SORT_DESCENDING: Icons.SortDescendingOutlined,
|
|
7
|
+
STOCK_ADD: Icons.PlusOutlined,
|
|
8
|
+
STOCK_GOTO_LAST: Icons.FastForwardOutlined,
|
|
9
|
+
STOCK_FIND: Icons.SearchOutlined,
|
|
10
|
+
STOCK_PROPERTIES: Icons.ControlOutlined,
|
|
11
|
+
STOCK_DIALOG_INFO: Icons.InfoOutlined,
|
|
12
|
+
STOCK_FLOPPY: Icons.UsbOutlined,
|
|
13
|
+
STOCK_JUSTIFY_CENTER: Icons.AlignCenterOutlined,
|
|
14
|
+
STOCK_GO_BACK: Icons.ArrowLeftOutlined,
|
|
15
|
+
STOCK_UNDERLINE: Icons.UnderlineOutlined,
|
|
16
|
+
STOCK_BOLD: Icons.BoldOutlined,
|
|
17
|
+
STOCK_APPLY: Icons.CheckOutlined,
|
|
18
|
+
STOCK_ZOOM_OUT: Icons.ZoomOutOutlined,
|
|
19
|
+
"terp-graph": Icons.PieChartOutlined,
|
|
20
|
+
"terp-crm": Icons.ContactsOutlined,
|
|
21
|
+
STOCK_STRIKETHROUGH: Icons.StrikethroughOutlined,
|
|
22
|
+
STOCK_MEDIA_REWIND: Icons.BackwardOutlined,
|
|
23
|
+
"terp-partner": Icons.TeamOutlined,
|
|
24
|
+
STOCK_PRINT: Icons.PrinterOutlined,
|
|
25
|
+
STOCK_NO: Icons.CloseOutlined,
|
|
26
|
+
"terp-mrp": Icons.BuildOutlined,
|
|
27
|
+
"terp-product": Icons.ShoppingOutlined,
|
|
28
|
+
STOCK_GOTO_FIRST: Icons.FastBackwardOutlined,
|
|
29
|
+
STOCK_CLOSE: Icons.CloseOutlined,
|
|
30
|
+
STOCK_REMOVE: Icons.MinusOutlined,
|
|
31
|
+
STOCK_CUT: Icons.ScissorOutlined,
|
|
32
|
+
STOCK_DIALOG_AUTHENTICATION: Icons.SafetyOutlined,
|
|
33
|
+
STOCK_ZOOM_FIT: Icons.ExpandOutlined,
|
|
34
|
+
STOCK_JUMP_TO: Icons.SelectOutlined,
|
|
35
|
+
STOCK_HARDDISK: Icons.HddOutlined,
|
|
36
|
+
STOCK_SAVE_AS: Icons.SaveOutlined,
|
|
37
|
+
STOCK_UNDO: Icons.UndoOutlined,
|
|
38
|
+
STOCK_JUSTIFY_RIGHT: Icons.AlignRightOutlined,
|
|
39
|
+
STOCK_DIALOG_ERROR: Icons.CloseCircleOutlined,
|
|
40
|
+
STOCK_INDEX: Icons.ProfileOutlined,
|
|
41
|
+
STOCK_GOTO_BOTTOM: Icons.VerticalAlignBottomOutlined,
|
|
42
|
+
STOCK_MEDIA_NEXT: Icons.StepForwardOutlined,
|
|
43
|
+
STOCK_REDO: Icons.RedoOutlined,
|
|
44
|
+
STOCK_COPY: Icons.CopyOutlined,
|
|
45
|
+
STOCK_MEDIA_PAUSE: Icons.PauseOutlined,
|
|
46
|
+
STOCK_GO_FORWARD: Icons.CaretRightOutlined,
|
|
47
|
+
STOCK_UNDELETE: Icons.UndoOutlined,
|
|
48
|
+
STOCK_EXECUTE: Icons.SettingOutlined,
|
|
49
|
+
STOCK_SAVE: Icons.SaveOutlined,
|
|
50
|
+
STOCK_DIALOG_QUESTION: Icons.QuestionCircleOutlined,
|
|
51
|
+
STOCK_SORT_ASCENDING: Icons.SortAscendingOutlined,
|
|
52
|
+
STOCK_REFRESH: Icons.ReloadOutlined,
|
|
53
|
+
STOCK_MEDIA_FORWARD: Icons.ForwardOutlined,
|
|
54
|
+
STOCK_STOP: Icons.BorderOutlined,
|
|
55
|
+
STOCK_PRINT_PREVIEW: Icons.PrinterOutlined,
|
|
56
|
+
STOCK_HOME: Icons.HomeOutlined,
|
|
57
|
+
STOCK_PASTE: Icons.CarryOutOutlined,
|
|
58
|
+
STOCK_ZOOM_100: Icons.ZoomInOutlined,
|
|
59
|
+
STOCK_FIND_AND_REPLACE: Icons.FileSearchOutlined,
|
|
60
|
+
STOCK_DIALOG_WARNING: Icons.WarningOutlined,
|
|
61
|
+
STOCK_ZOOM_IN: Icons.ZoomInOutlined,
|
|
62
|
+
STOCK_CONVERT: Icons.ExportOutlined,
|
|
63
|
+
STOCK_ITALIC: Icons.ItalicOutlined,
|
|
64
|
+
STOCK_YES: Icons.CheckOutlined,
|
|
65
|
+
STOCK_MEDIA_PLAY: Icons.PlayCircleOutlined,
|
|
66
|
+
STOCK_MEDIA_RECORD: Icons.VideoCameraOutlined,
|
|
67
|
+
STOCK_MEDIA_PREVIOUS: Icons.StepBackwardOutlined,
|
|
68
|
+
STOCK_NEW: Icons.FileAddOutlined,
|
|
69
|
+
STOCK_CANCEL: Icons.CloseOutlined,
|
|
70
|
+
STOCK_DISCONNECT: Icons.ApiOutlined,
|
|
71
|
+
STOCK_JUSTIFY_LEFT: Icons.AlignLeftOutlined,
|
|
72
|
+
STOCK_FILE: Icons.FileOutlined,
|
|
73
|
+
STOCK_QUIT: Icons.LogoutOutlined,
|
|
74
|
+
STOCK_EDIT: Icons.EditOutlined,
|
|
75
|
+
STOCK_CONNECT: Icons.ApiOutlined,
|
|
76
|
+
STOCK_GO_DOWN: Icons.CaretDownOutlined,
|
|
77
|
+
STOCK_NETWORK: Icons.ApartmentOutlined,
|
|
78
|
+
STOCK_OK: Icons.CheckOutlined,
|
|
79
|
+
STOCK_GOTO_TOP: Icons.VerticalAlignTopOutlined,
|
|
80
|
+
STOCK_ABOUT: Icons.StarOutlined,
|
|
81
|
+
STOCK_COLOR_PICKER: Icons.AimOutlined,
|
|
82
|
+
STOCK_SELECT_FONT: Icons.FontSizeOutlined,
|
|
83
|
+
"terp-purchase": Icons.ShoppingCartOutlined,
|
|
84
|
+
STOCK_DELETE: Icons.DeleteOutlined,
|
|
85
|
+
STOCK_DND: Icons.FileTextOutlined,
|
|
86
|
+
STOCK_CLEAR: Icons.CloseSquareOutlined,
|
|
87
|
+
STOCK_UNINDENT: Icons.AlignLeftOutlined,
|
|
88
|
+
STOCK_PREFERENCES: Icons.SettingOutlined,
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export default (key: string): React.ElementType => {
|
|
92
|
+
if (key.indexOf("gtk-") !== -1) {
|
|
93
|
+
const rootIcon = key.replace("gtk-", "").replace("-", "_");
|
|
94
|
+
const newKey = `STOCK_${rootIcon.toUpperCase()}`;
|
|
95
|
+
return iconMapping[newKey];
|
|
96
|
+
}
|
|
97
|
+
if (iconMapping.hasOwnProperty(key)) {
|
|
98
|
+
return iconMapping[key];
|
|
99
|
+
} else {
|
|
100
|
+
const antKey = `${key.split("-").map((word) => (
|
|
101
|
+
word.replace(/\w\S*/g, (w) => (w.charAt(0).toUpperCase() + w.substr(1).toLowerCase())))
|
|
102
|
+
).join("")}Outlined`
|
|
103
|
+
// @ts-ignore
|
|
104
|
+
return Icons[antKey];
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
};
|