@gisce/react-ooui 1.5.1 → 2.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +73 -42
- package/src/actionbar/FormActionBar.tsx +1 -1
- package/src/actionbar/TreeActionBar.tsx +1 -1
- package/src/common/DatePicker.tsx +2 -2
- package/src/common/SelectAllRecordsRow.tsx +4 -5
- package/src/context/ContentRootContext.tsx +61 -54
- package/src/context/TabManagerContext.tsx +3 -4
- package/src/helpers/dynamicColumnsHelper.ts +1 -1
- package/src/helpers/filesHelper.ts +7 -7
- package/src/helpers/formHelper.ts +23 -24
- package/src/helpers/one2manyHelper.ts +6 -6
- package/src/helpers/searchHelper.ts +8 -5
- package/src/helpers/treeHelper.ts +7 -7
- package/src/helpers/viewHelper.ts +2 -2
- package/src/hooks/useExport.ts +2 -3
- package/src/hooks/useSearch.ts +8 -8
- package/src/index.ts +4 -0
- package/src/stories/Binary.stories.tsx +0 -3
- package/src/stories/Boolean.stories.tsx +0 -3
- package/src/stories/Button.stories.tsx +8 -14
- package/src/stories/Char.stories.tsx +0 -3
- package/src/stories/FiberGrid.stories.tsx +0 -3
- package/src/stories/Float.stories.tsx +0 -3
- package/src/stories/FloatTime.stories.tsx +0 -3
- package/src/stories/Image.stories.tsx +0 -3
- package/src/stories/Integer.stories.tsx +0 -3
- package/src/stories/Label.stories.tsx +0 -3
- package/src/stories/Many2one.stories.tsx +0 -3
- package/src/stories/One2many.stories.tsx +4 -11
- package/src/stories/ProgressBar.stories.tsx +0 -3
- package/src/stories/Reference.stories.tsx +0 -3
- package/src/stories/Selection.stories.tsx +0 -3
- package/src/stories/Separator.stories.tsx +3 -7
- package/src/stories/Text.stories.tsx +0 -3
- package/src/stories/containers/Group.stories.tsx +0 -5
- package/src/stories/containers/NewLine.stories.tsx +0 -4
- package/src/stories/containers/Notebook.stories.tsx +0 -5
- package/src/stories/custom/Avatar.stories.tsx +0 -1
- package/src/stories/custom/ButtonGroup.stories.tsx +36 -23
- package/src/stories/custom/CodeEditor.stories.tsx +1 -4
- package/src/stories/custom/Indicator.stories.tsx +3 -11
- package/src/stories/custom/Markdown.stories.tsx +2 -6
- package/src/stories/custom/MultiCheckbox.stories.tsx +20 -15
- package/src/stories/custom/Radio.stories.tsx +13 -16
- package/src/stories/custom/Steps.stories.tsx +7 -5
- package/src/stories/custom/Switch.stories.tsx +0 -3
- package/src/stories/custom/Tag.stories.tsx +17 -11
- package/src/stories/custom/Tags.stories.tsx +20 -16
- package/src/stories/forms/PreferencesForm.stories.tsx +0 -4
- package/src/stories/ui/ActionBar.stories.tsx +0 -3
- package/src/stories/ui/FavouriteButton.stories.tsx +0 -3
- package/src/stories/ui/GoToResourceModal.stories.tsx +0 -3
- package/src/stories/views/SearchTree.stories.tsx +43 -89
- package/src/stories/views/Tab.stories.tsx +0 -3
- package/src/stories/views/TabsAndContent.stories.tsx +0 -3
- package/src/stories/views/Tree.stories.jsx +0 -4
- package/src/stories/views/searchFilter/DateRangePicker.stories.tsx +0 -3
- package/src/stories/views/searchFilter/DateTimeRangePicker.stories.tsx +0 -3
- package/src/stories/views/searchFilter/PairFields.stories.tsx +0 -3
- package/src/stories/views/searchFilter/SearchFilter.stories.tsx +0 -4
- package/src/stories/views/searchFilter/examples/PartnersSearchFilter.stories.tsx +0 -4
- package/src/types/index.ts +94 -43
- package/src/ui/FavouriteButton.tsx +2 -3
- package/src/views/ActionView.tsx +12 -11
- package/src/views/RootView.tsx +5 -6
- package/src/widgets/base/Binary.tsx +2 -2
- package/src/widgets/base/Boolean.tsx +1 -2
- package/src/widgets/base/Float.tsx +1 -1
- package/src/widgets/base/Integer.tsx +2 -2
- package/src/widgets/base/Label.tsx +9 -9
- package/src/widgets/base/LinkInput.tsx +6 -1
- package/src/widgets/base/MultiSelection.tsx +1 -2
- package/src/widgets/base/Selection.tsx +11 -5
- package/src/widgets/base/Time.tsx +13 -12
- package/src/widgets/base/many2one/Many2one.tsx +7 -8
- package/src/widgets/base/many2one/Many2oneSuffix.tsx +23 -12
- package/src/widgets/base/one2many/One2manyInput.tsx +13 -14
- package/src/widgets/containers/Notebook.tsx +9 -2
- package/src/widgets/custom/ButtonGroup.tsx +13 -10
- package/src/widgets/custom/CodeEditor.tsx +7 -3
- package/src/widgets/custom/Comments.tsx +76 -70
- package/src/widgets/custom/Indicator.tsx +1 -2
- package/src/widgets/custom/MultiCheckbox.tsx +2 -2
- package/src/widgets/custom/Tag.tsx +20 -16
- package/src/widgets/custom/Tags.tsx +3 -3
- package/src/widgets/custom/Timeline.tsx +6 -6
- package/src/widgets/views/Dashboard/DashboardTree.tsx +2 -2
- package/src/widgets/views/DashboardGrid/DashboardGrid.types.ts +1 -1
- package/src/widgets/views/Form.tsx +9 -10
- package/src/widgets/views/Graph/GraphIndicator.tsx +7 -7
- package/src/widgets/views/SearchTree.tsx +2 -2
- package/src/widgets/views/Tree.tsx +15 -16
- package/src/widgets/views/searchFilter/DateTimeRangePicker.tsx +1 -3
- package/dist/ConnectionProvider.d.ts +0 -7
- package/dist/ConnectionProvider.d.ts.map +0 -1
- package/dist/actionbar/ActionButton.d.ts +0 -13
- package/dist/actionbar/ActionButton.d.ts.map +0 -1
- package/dist/actionbar/AttachmentsButton.d.ts +0 -12
- package/dist/actionbar/AttachmentsButton.d.ts.map +0 -1
- package/dist/actionbar/AttachmentsButtonWrapper.d.ts +0 -19
- package/dist/actionbar/AttachmentsButtonWrapper.d.ts.map +0 -1
- package/dist/actionbar/ButtonWithBadge.d.ts +0 -8
- package/dist/actionbar/ButtonWithBadge.d.ts.map +0 -1
- package/dist/actionbar/ChangeViewButton.d.ts +0 -13
- package/dist/actionbar/ChangeViewButton.d.ts.map +0 -1
- package/dist/actionbar/DashboardActionBar.d.ts +0 -4
- package/dist/actionbar/DashboardActionBar.d.ts.map +0 -1
- package/dist/actionbar/DropdownButton.d.ts +0 -12
- package/dist/actionbar/DropdownButton.d.ts.map +0 -1
- package/dist/actionbar/FormActionBar.d.ts +0 -6
- package/dist/actionbar/FormActionBar.d.ts.map +0 -1
- package/dist/actionbar/GraphActionBar.d.ts +0 -6
- package/dist/actionbar/GraphActionBar.d.ts.map +0 -1
- package/dist/actionbar/NewButton.d.ts +0 -7
- package/dist/actionbar/NewButton.d.ts.map +0 -1
- package/dist/actionbar/SearchBar.d.ts +0 -9
- package/dist/actionbar/SearchBar.d.ts.map +0 -1
- package/dist/actionbar/TreeActionBar.d.ts +0 -9
- package/dist/actionbar/TreeActionBar.d.ts.map +0 -1
- package/dist/common/ButtonWithTooltip.d.ts +0 -8
- package/dist/common/ButtonWithTooltip.d.ts.map +0 -1
- package/dist/common/DatePicker.d.ts +0 -20
- package/dist/common/DatePicker.d.ts.map +0 -1
- package/dist/common/Field.d.ts +0 -14
- package/dist/common/Field.d.ts.map +0 -1
- package/dist/common/SelectAllRecordsRow.d.ts +0 -10
- package/dist/common/SelectAllRecordsRow.d.ts.map +0 -1
- package/dist/context/ActionViewContext.d.ts +0 -65
- package/dist/context/ActionViewContext.d.ts.map +0 -1
- package/dist/context/ConfigContext.d.ts +0 -7
- package/dist/context/ConfigContext.d.ts.map +0 -1
- package/dist/context/ContentRootContext.d.ts +0 -19
- package/dist/context/ContentRootContext.d.ts.map +0 -1
- package/dist/context/DashboardActionContext.d.ts +0 -19
- package/dist/context/DashboardActionContext.d.ts.map +0 -1
- package/dist/context/FormContext.d.ts +0 -35
- package/dist/context/FormContext.d.ts.map +0 -1
- package/dist/context/FormModalContext.d.ts +0 -11
- package/dist/context/FormModalContext.d.ts.map +0 -1
- package/dist/context/LocaleContext.d.ts +0 -14
- package/dist/context/LocaleContext.d.ts.map +0 -1
- package/dist/context/One2manyContext.d.ts +0 -17
- package/dist/context/One2manyContext.d.ts.map +0 -1
- package/dist/context/TabManagerContext.d.ts +0 -50
- package/dist/context/TabManagerContext.d.ts.map +0 -1
- package/dist/helpers/containerHelper.d.ts +0 -22
- package/dist/helpers/containerHelper.d.ts.map +0 -1
- package/dist/helpers/dynamicColumnsHelper.d.ts +0 -8
- package/dist/helpers/dynamicColumnsHelper.d.ts.map +0 -1
- package/dist/helpers/errorHelper.d.ts +0 -6
- package/dist/helpers/errorHelper.d.ts.map +0 -1
- package/dist/helpers/filesHelper.d.ts +0 -8
- package/dist/helpers/filesHelper.d.ts.map +0 -1
- package/dist/helpers/formHelper.d.ts +0 -36
- package/dist/helpers/formHelper.d.ts.map +0 -1
- package/dist/helpers/iconMapper.d.ts +0 -13
- package/dist/helpers/iconMapper.d.ts.map +0 -1
- package/dist/helpers/logInfoHelper.d.ts +0 -3
- package/dist/helpers/logInfoHelper.d.ts.map +0 -1
- package/dist/helpers/one2manyHelper.d.ts +0 -37
- package/dist/helpers/one2manyHelper.d.ts.map +0 -1
- package/dist/helpers/searchHelper.d.ts +0 -6
- package/dist/helpers/searchHelper.d.ts.map +0 -1
- package/dist/helpers/timeHelper.d.ts +0 -4
- package/dist/helpers/timeHelper.d.ts.map +0 -1
- package/dist/helpers/treeHelper.d.ts +0 -23
- package/dist/helpers/treeHelper.d.ts.map +0 -1
- package/dist/helpers/viewHelper.d.ts +0 -10
- package/dist/helpers/viewHelper.d.ts.map +0 -1
- package/dist/hooks/useExport.d.ts +0 -44
- package/dist/hooks/useExport.d.ts.map +0 -1
- package/dist/hooks/useSearch.d.ts +0 -56
- package/dist/hooks/useSearch.d.ts.map +0 -1
- package/dist/hooks/useWindowDimensions.d.ts +0 -7
- package/dist/hooks/useWindowDimensions.d.ts.map +0 -1
- package/dist/index.d.ts +0 -57
- package/dist/index.d.ts.map +0 -1
- package/dist/locales/ca_ES.d.ts +0 -93
- package/dist/locales/ca_ES.d.ts.map +0 -1
- package/dist/locales/en_US.d.ts +0 -93
- package/dist/locales/en_US.d.ts.map +0 -1
- package/dist/locales/es_ES.d.ts +0 -93
- package/dist/locales/es_ES.d.ts.map +0 -1
- package/dist/react-ooui.es.js +0 -11763
- package/dist/react-ooui.es.js.map +0 -1
- package/dist/react-ooui.umd.js +0 -42
- package/dist/react-ooui.umd.js.map +0 -1
- package/dist/style.css +0 -1
- package/dist/types/index.d.ts +0 -256
- package/dist/types/index.d.ts.map +0 -1
- package/dist/ui/ActionErrorDialog.d.ts +0 -3
- package/dist/ui/ActionErrorDialog.d.ts.map +0 -1
- package/dist/ui/ConfirmDialog.d.ts +0 -7
- package/dist/ui/ConfirmDialog.d.ts.map +0 -1
- package/dist/ui/ErrorAlert.d.ts +0 -6
- package/dist/ui/ErrorAlert.d.ts.map +0 -1
- package/dist/ui/FavouriteButton.d.ts +0 -26
- package/dist/ui/FavouriteButton.d.ts.map +0 -1
- package/dist/ui/FormErrorsDialog.d.ts +0 -3
- package/dist/ui/FormErrorsDialog.d.ts.map +0 -1
- package/dist/ui/GenericErrorDialog.d.ts +0 -3
- package/dist/ui/GenericErrorDialog.d.ts.map +0 -1
- package/dist/ui/GoToResourceModal.d.ts +0 -10
- package/dist/ui/GoToResourceModal.d.ts.map +0 -1
- package/dist/ui/InfoDialog.d.ts +0 -3
- package/dist/ui/InfoDialog.d.ts.map +0 -1
- package/dist/ui/RefreshItemDialog.d.ts +0 -7
- package/dist/ui/RefreshItemDialog.d.ts.map +0 -1
- package/dist/ui/RemoveItemDialog.d.ts +0 -6
- package/dist/ui/RemoveItemDialog.d.ts.map +0 -1
- package/dist/ui/TitleHeader.d.ts +0 -8
- package/dist/ui/TitleHeader.d.ts.map +0 -1
- package/dist/ui/UnlinkItemDialog.d.ts +0 -6
- package/dist/ui/UnlinkItemDialog.d.ts.map +0 -1
- package/dist/ui/UnsavedChangesDialog.d.ts +0 -7
- package/dist/ui/UnsavedChangesDialog.d.ts.map +0 -1
- package/dist/ui/WarningDialog.d.ts +0 -3
- package/dist/ui/WarningDialog.d.ts.map +0 -1
- package/dist/views/ActionView.d.ts +0 -22
- package/dist/views/ActionView.d.ts.map +0 -1
- package/dist/views/CurrentTabContent.d.ts +0 -4
- package/dist/views/CurrentTabContent.d.ts.map +0 -1
- package/dist/views/RootView.d.ts +0 -14
- package/dist/views/RootView.d.ts.map +0 -1
- package/dist/views/TabContent.d.ts +0 -8
- package/dist/views/TabContent.d.ts.map +0 -1
- package/dist/views/TabSelector.d.ts +0 -4
- package/dist/views/TabSelector.d.ts.map +0 -1
- package/dist/views/Welcome.d.ts +0 -4
- package/dist/views/Welcome.d.ts.map +0 -1
- package/dist/views/actionViews/DashboardActionView.d.ts +0 -7
- package/dist/views/actionViews/DashboardActionView.d.ts.map +0 -1
- package/dist/views/actionViews/FormActionView.d.ts +0 -18
- package/dist/views/actionViews/FormActionView.d.ts.map +0 -1
- package/dist/views/actionViews/GraphActionView.d.ts +0 -13
- package/dist/views/actionViews/GraphActionView.d.ts.map +0 -1
- package/dist/views/actionViews/TreeActionView.d.ts +0 -20
- package/dist/views/actionViews/TreeActionView.d.ts.map +0 -1
- package/dist/views/tabs/Tab.d.ts +0 -11
- package/dist/views/tabs/Tab.d.ts.map +0 -1
- package/dist/widgets/WidgetFactory.d.ts +0 -4
- package/dist/widgets/WidgetFactory.d.ts.map +0 -1
- package/dist/widgets/base/Binary.d.ts +0 -14
- package/dist/widgets/base/Binary.d.ts.map +0 -1
- package/dist/widgets/base/Boolean.d.ts +0 -4
- package/dist/widgets/base/Boolean.d.ts.map +0 -1
- package/dist/widgets/base/Button.d.ts +0 -8
- package/dist/widgets/base/Button.d.ts.map +0 -1
- package/dist/widgets/base/Char.d.ts +0 -8
- package/dist/widgets/base/Char.d.ts.map +0 -1
- package/dist/widgets/base/Date.d.ts +0 -5
- package/dist/widgets/base/Date.d.ts.map +0 -1
- package/dist/widgets/base/DateTime.d.ts +0 -5
- package/dist/widgets/base/DateTime.d.ts.map +0 -1
- package/dist/widgets/base/Email.d.ts +0 -4
- package/dist/widgets/base/Email.d.ts.map +0 -1
- package/dist/widgets/base/Float.d.ts +0 -4
- package/dist/widgets/base/Float.d.ts.map +0 -1
- package/dist/widgets/base/FloatTime.d.ts +0 -12
- package/dist/widgets/base/FloatTime.d.ts.map +0 -1
- package/dist/widgets/base/Image.d.ts +0 -14
- package/dist/widgets/base/Image.d.ts.map +0 -1
- package/dist/widgets/base/Integer.d.ts +0 -8
- package/dist/widgets/base/Integer.d.ts.map +0 -1
- package/dist/widgets/base/Label.d.ts +0 -9
- package/dist/widgets/base/Label.d.ts.map +0 -1
- package/dist/widgets/base/LinkInput.d.ts +0 -12
- package/dist/widgets/base/LinkInput.d.ts.map +0 -1
- package/dist/widgets/base/MultiSelection.d.ts +0 -10
- package/dist/widgets/base/MultiSelection.d.ts.map +0 -1
- package/dist/widgets/base/ProgressBar.d.ts +0 -7
- package/dist/widgets/base/ProgressBar.d.ts.map +0 -1
- package/dist/widgets/base/Reference.d.ts +0 -16
- package/dist/widgets/base/Reference.d.ts.map +0 -1
- package/dist/widgets/base/ReferenceTree.d.ts +0 -8
- package/dist/widgets/base/ReferenceTree.d.ts.map +0 -1
- package/dist/widgets/base/Selection.d.ts +0 -10
- package/dist/widgets/base/Selection.d.ts.map +0 -1
- package/dist/widgets/base/Separator.d.ts +0 -8
- package/dist/widgets/base/Separator.d.ts.map +0 -1
- package/dist/widgets/base/Text.d.ts +0 -8
- package/dist/widgets/base/Text.d.ts.map +0 -1
- package/dist/widgets/base/Time.d.ts +0 -12
- package/dist/widgets/base/Time.d.ts.map +0 -1
- package/dist/widgets/base/Url.d.ts +0 -4
- package/dist/widgets/base/Url.d.ts.map +0 -1
- package/dist/widgets/base/many2one/Many2one.d.ts +0 -16
- package/dist/widgets/base/many2one/Many2one.d.ts.map +0 -1
- package/dist/widgets/base/many2one/Many2oneSuffix.d.ts +0 -9
- package/dist/widgets/base/many2one/Many2oneSuffix.d.ts.map +0 -1
- package/dist/widgets/base/many2one/Many2oneSuffixModal.d.ts +0 -10
- package/dist/widgets/base/many2one/Many2oneSuffixModal.d.ts.map +0 -1
- package/dist/widgets/base/many2one/Many2oneTree.d.ts +0 -6
- package/dist/widgets/base/many2one/Many2oneTree.d.ts.map +0 -1
- package/dist/widgets/base/one2many/One2many.d.ts +0 -8
- package/dist/widgets/base/one2many/One2many.d.ts.map +0 -1
- package/dist/widgets/base/one2many/One2manyInput.d.ts +0 -23
- package/dist/widgets/base/one2many/One2manyInput.d.ts.map +0 -1
- package/dist/widgets/base/one2many/One2manyTopBar.d.ts +0 -23
- package/dist/widgets/base/one2many/One2manyTopBar.d.ts.map +0 -1
- package/dist/widgets/containers/Container.d.ts +0 -9
- package/dist/widgets/containers/Container.d.ts.map +0 -1
- package/dist/widgets/containers/Group.d.ts +0 -10
- package/dist/widgets/containers/Group.d.ts.map +0 -1
- package/dist/widgets/containers/Notebook.d.ts +0 -9
- package/dist/widgets/containers/Notebook.d.ts.map +0 -1
- package/dist/widgets/custom/Avatar.d.ts +0 -10
- package/dist/widgets/custom/Avatar.d.ts.map +0 -1
- package/dist/widgets/custom/ButtonGroup.d.ts +0 -8
- package/dist/widgets/custom/ButtonGroup.d.ts.map +0 -1
- package/dist/widgets/custom/CodeEditor.d.ts +0 -9
- package/dist/widgets/custom/CodeEditor.d.ts.map +0 -1
- package/dist/widgets/custom/Comments.d.ts +0 -35
- package/dist/widgets/custom/Comments.d.ts.map +0 -1
- package/dist/widgets/custom/FiberGrid.d.ts +0 -10
- package/dist/widgets/custom/FiberGrid.d.ts.map +0 -1
- package/dist/widgets/custom/Indicator.d.ts +0 -10
- package/dist/widgets/custom/Indicator.d.ts.map +0 -1
- package/dist/widgets/custom/Markdown.d.ts +0 -5
- package/dist/widgets/custom/Markdown.d.ts.map +0 -1
- package/dist/widgets/custom/MultiCheckbox.d.ts +0 -14
- package/dist/widgets/custom/MultiCheckbox.d.ts.map +0 -1
- package/dist/widgets/custom/Radio.d.ts +0 -10
- package/dist/widgets/custom/Radio.d.ts.map +0 -1
- package/dist/widgets/custom/Steps.d.ts +0 -13
- package/dist/widgets/custom/Steps.d.ts.map +0 -1
- package/dist/widgets/custom/Switch.d.ts +0 -4
- package/dist/widgets/custom/Switch.d.ts.map +0 -1
- package/dist/widgets/custom/Tag.d.ts +0 -7
- package/dist/widgets/custom/Tag.d.ts.map +0 -1
- package/dist/widgets/custom/Tags.d.ts +0 -15
- package/dist/widgets/custom/Tags.d.ts.map +0 -1
- package/dist/widgets/custom/Timeline.d.ts +0 -16
- package/dist/widgets/custom/Timeline.d.ts.map +0 -1
- package/dist/widgets/modals/ExportModal.d.ts +0 -15
- package/dist/widgets/modals/ExportModal.d.ts.map +0 -1
- package/dist/widgets/modals/FormModal.d.ts +0 -12
- package/dist/widgets/modals/FormModal.d.ts.map +0 -1
- package/dist/widgets/modals/SearchModal.d.ts +0 -13
- package/dist/widgets/modals/SearchModal.d.ts.map +0 -1
- package/dist/widgets/modals/TranslationModal.d.ts +0 -12
- package/dist/widgets/modals/TranslationModal.d.ts.map +0 -1
- package/dist/widgets/views/Dashboard/Dashboard.d.ts +0 -5
- package/dist/widgets/views/Dashboard/Dashboard.d.ts.map +0 -1
- package/dist/widgets/views/Dashboard/DashboardForm.d.ts +0 -4
- package/dist/widgets/views/Dashboard/DashboardForm.d.ts.map +0 -1
- package/dist/widgets/views/Dashboard/DashboardTree.d.ts +0 -19
- package/dist/widgets/views/Dashboard/DashboardTree.d.ts.map +0 -1
- package/dist/widgets/views/Dashboard/dashboardHelper.d.ts +0 -6
- package/dist/widgets/views/Dashboard/dashboardHelper.d.ts.map +0 -1
- package/dist/widgets/views/DashboardGrid/DashboardGrid.d.ts +0 -4
- package/dist/widgets/views/DashboardGrid/DashboardGrid.d.ts.map +0 -1
- package/dist/widgets/views/DashboardGrid/DashboardGrid.types.d.ts +0 -6
- package/dist/widgets/views/DashboardGrid/DashboardGrid.types.d.ts.map +0 -1
- package/dist/widgets/views/DashboardGrid/DashboardGridItem.d.ts +0 -4
- package/dist/widgets/views/DashboardGrid/DashboardGridItem.d.ts.map +0 -1
- package/dist/widgets/views/DashboardGrid/DashboardGridItem.types.d.ts +0 -11
- package/dist/widgets/views/DashboardGrid/DashboardGridItem.types.d.ts.map +0 -1
- package/dist/widgets/views/DashboardGrid/index.d.ts +0 -5
- package/dist/widgets/views/DashboardGrid/index.d.ts.map +0 -1
- package/dist/widgets/views/Form.d.ts +0 -29
- package/dist/widgets/views/Form.d.ts.map +0 -1
- package/dist/widgets/views/Graph/Graph.d.ts +0 -11
- package/dist/widgets/views/Graph/Graph.d.ts.map +0 -1
- package/dist/widgets/views/Graph/GraphChart.d.ts +0 -11
- package/dist/widgets/views/Graph/GraphChart.d.ts.map +0 -1
- package/dist/widgets/views/Graph/GraphDefaults.d.ts +0 -83
- package/dist/widgets/views/Graph/GraphDefaults.d.ts.map +0 -1
- package/dist/widgets/views/Graph/GraphIndicator.d.ts +0 -17
- package/dist/widgets/views/Graph/GraphIndicator.d.ts.map +0 -1
- package/dist/widgets/views/Graph/useGraphData.d.ts +0 -20
- package/dist/widgets/views/Graph/useGraphData.d.ts.map +0 -1
- package/dist/widgets/views/SearchTree.d.ts +0 -24
- package/dist/widgets/views/SearchTree.d.ts.map +0 -1
- package/dist/widgets/views/Tree.d.ts +0 -32
- package/dist/widgets/views/Tree.d.ts.map +0 -1
- package/dist/widgets/views/searchFilter/DateRangePicker.d.ts +0 -4
- package/dist/widgets/views/searchFilter/DateRangePicker.d.ts.map +0 -1
- package/dist/widgets/views/searchFilter/DateTimeRangePicker.d.ts +0 -4
- package/dist/widgets/views/searchFilter/DateTimeRangePicker.d.ts.map +0 -1
- package/dist/widgets/views/searchFilter/PairFields.d.ts +0 -4
- package/dist/widgets/views/searchFilter/PairFields.d.ts.map +0 -1
- package/dist/widgets/views/searchFilter/SearchBottomBar.d.ts +0 -10
- package/dist/widgets/views/searchFilter/SearchBottomBar.d.ts.map +0 -1
- package/dist/widgets/views/searchFilter/SearchField.d.ts +0 -8
- package/dist/widgets/views/searchFilter/SearchField.d.ts.map +0 -1
- package/dist/widgets/views/searchFilter/SearchFilter.d.ts +0 -20
- package/dist/widgets/views/searchFilter/SearchFilter.d.ts.map +0 -1
- package/dist/widgets/views/searchFilter/SearchParams.d.ts +0 -7
- package/dist/widgets/views/searchFilter/SearchParams.d.ts.map +0 -1
- package/src/tailwind.css +0 -8
- package/src/tailwind.generated.css +0 -168533
package/package.json
CHANGED
|
@@ -1,34 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gisce/react-ooui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-alpha.1",
|
|
4
|
+
"engines": {
|
|
5
|
+
"node": "20.5.0"
|
|
6
|
+
},
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
4
10
|
"files": [
|
|
5
11
|
"dist",
|
|
6
12
|
"src",
|
|
7
13
|
"README.md"
|
|
8
14
|
],
|
|
9
|
-
"main": "./dist/react-ooui.umd.js",
|
|
10
15
|
"module": "./dist/react-ooui.es.js",
|
|
11
16
|
"types": "./dist/index.d.ts",
|
|
12
17
|
"exports": {
|
|
13
18
|
".": {
|
|
14
|
-
"import": "./dist/react-ooui.es.js"
|
|
15
|
-
"require": "./dist/react-ooui.umd.js"
|
|
19
|
+
"import": "./dist/react-ooui.es.js"
|
|
16
20
|
}
|
|
17
21
|
},
|
|
18
|
-
"publishConfig": {
|
|
19
|
-
"access": "public"
|
|
20
|
-
},
|
|
21
22
|
"scripts": {
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"storybook": "start-storybook -p 6006",
|
|
31
|
-
"build-storybook": "build-storybook"
|
|
23
|
+
"preinstall": "npx only-allow npm",
|
|
24
|
+
"build": "tsc --noEmit && vite build",
|
|
25
|
+
"preview": "npm run build && vite preview",
|
|
26
|
+
"dev:vite": "while :; do tsc && vite build --watch --force; done",
|
|
27
|
+
"dev:tsc": "tsc --noEmit --watch",
|
|
28
|
+
"prepare": "husky install",
|
|
29
|
+
"start": "concurrently npm:dev:*",
|
|
30
|
+
"check": "lint-staged"
|
|
32
31
|
},
|
|
33
32
|
"dependencies": {
|
|
34
33
|
"@ant-design/plots": "^1.0.9",
|
|
@@ -49,51 +48,83 @@
|
|
|
49
48
|
"react-hotkeys-hook": "^3.4.4",
|
|
50
49
|
"react-markdown": "^8.0.7",
|
|
51
50
|
"react-measure": "^2.5.2",
|
|
51
|
+
"styled-components": "5.3.5",
|
|
52
52
|
"use-deep-compare-effect": "^1.8.1",
|
|
53
53
|
"uuid": "^3.4.0",
|
|
54
54
|
"validator": "^13.6.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@
|
|
58
|
-
"@
|
|
59
|
-
"@
|
|
60
|
-
"@storybook/addon-interactions": "^6.5.12",
|
|
61
|
-
"@storybook/addon-knobs": "^6.4.0",
|
|
62
|
-
"@storybook/addon-links": "^6.5.12",
|
|
63
|
-
"@storybook/builder-vite": "^0.2.2",
|
|
64
|
-
"@storybook/react": "^6.5.12",
|
|
65
|
-
"@storybook/testing-library": "^0.0.13",
|
|
66
|
-
"@tailwindcss/postcss7-compat": "^2.0.2",
|
|
67
|
-
"@types/jest": "^26.0.15",
|
|
57
|
+
"@semantic-release/exec": "6.0.3",
|
|
58
|
+
"@semantic-release/git": "10.0.1",
|
|
59
|
+
"@semantic-release/npm": "10.0.4",
|
|
68
60
|
"@types/lodash": "^4.14.170",
|
|
69
61
|
"@types/md5": "^2.3.2",
|
|
70
|
-
"@types/node": "^12.0.0",
|
|
71
62
|
"@types/react": "^17.0.1",
|
|
72
63
|
"@types/react-dom": "^17.0.1",
|
|
73
64
|
"@types/react-grid-layout": "^1.3.2",
|
|
74
65
|
"@types/react-measure": "^2.0.7",
|
|
75
66
|
"@types/react-responsive": "^8.0.2",
|
|
67
|
+
"@types/rollup-plugin-peer-deps-external": "^2.2.2",
|
|
76
68
|
"@types/scroll-into-view": "^1.16.0",
|
|
77
69
|
"@types/styled-components": "^5.1.7",
|
|
78
70
|
"@types/uuid": "^8.3.1",
|
|
79
71
|
"@types/validator": "^13.6.3",
|
|
80
|
-
"@
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
72
|
+
"@typescript-eslint/eslint-plugin": "5.59.0",
|
|
73
|
+
"@typescript-eslint/parser": "5.59.0",
|
|
74
|
+
"@vitejs/plugin-react-swc": "3.3.2",
|
|
75
|
+
"concurrently": "8.2.0",
|
|
76
|
+
"eslint": "8.51.0",
|
|
77
|
+
"eslint-config-prettier": "8.5.0",
|
|
78
|
+
"eslint-config-standard-with-typescript": "24.0.0",
|
|
79
|
+
"eslint-plugin-import": "2.28.0",
|
|
80
|
+
"eslint-plugin-n": "15.6.0",
|
|
81
|
+
"eslint-plugin-promise": "6.1.1",
|
|
82
|
+
"eslint-plugin-react": "7.33.1",
|
|
83
|
+
"eslint-plugin-react-hooks": "4.6.0",
|
|
84
|
+
"husky": "8.0.3",
|
|
85
|
+
"lint-staged": "13.2.3",
|
|
86
|
+
"only-allow": "1.1.1",
|
|
87
|
+
"prettier": "3.0.1",
|
|
87
88
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"vite": "^3.
|
|
92
|
-
"vite-plugin-
|
|
89
|
+
"semantic-release": "21.0.7",
|
|
90
|
+
"typescript": "^5.0.4",
|
|
91
|
+
"vite": "4.4.8",
|
|
92
|
+
"vite-plugin-dts": "^3.6.0",
|
|
93
|
+
"vite-plugin-package-version": "1.0.2",
|
|
94
|
+
"vite-tsconfig-paths": "3.5.0"
|
|
93
95
|
},
|
|
94
96
|
"peerDependencies": {
|
|
95
97
|
"react": "^17.0.1",
|
|
96
98
|
"react-dom": "^17.0.1",
|
|
97
|
-
"styled-components": "
|
|
99
|
+
"styled-components": "5.3.5"
|
|
100
|
+
},
|
|
101
|
+
"lint-staged": {
|
|
102
|
+
"src/**/*.{js,jsx,ts,tsx}": "eslint --fix",
|
|
103
|
+
"src/**/*.{js,jsx,ts,tsx,json,css,md}": "prettier --write"
|
|
104
|
+
},
|
|
105
|
+
"release": {
|
|
106
|
+
"branches": [
|
|
107
|
+
"master",
|
|
108
|
+
{
|
|
109
|
+
"name": "develop",
|
|
110
|
+
"prerelease": "rc"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"name": "alpha",
|
|
114
|
+
"prerelease": true
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
"plugins": [
|
|
118
|
+
"@semantic-release/commit-analyzer",
|
|
119
|
+
"@semantic-release/release-notes-generator",
|
|
120
|
+
[
|
|
121
|
+
"@semantic-release/npm",
|
|
122
|
+
{
|
|
123
|
+
"npmPublish": true
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
"@semantic-release/github",
|
|
127
|
+
"@semantic-release/git"
|
|
128
|
+
]
|
|
98
129
|
}
|
|
99
130
|
}
|
|
@@ -141,7 +141,7 @@ function FormActionBar({ toolbar }: { toolbar: any }) {
|
|
|
141
141
|
try {
|
|
142
142
|
setRemovingItem?.(true);
|
|
143
143
|
|
|
144
|
-
await ConnectionProvider.getHandler().
|
|
144
|
+
await ConnectionProvider.getHandler().deleteObjects({
|
|
145
145
|
model: currentModel!,
|
|
146
146
|
ids: [currentId!],
|
|
147
147
|
});
|
|
@@ -92,7 +92,7 @@ function TreeActionBar(props: Props) {
|
|
|
92
92
|
try {
|
|
93
93
|
setRemovingItem?.(true);
|
|
94
94
|
|
|
95
|
-
await ConnectionProvider.getHandler().
|
|
95
|
+
await ConnectionProvider.getHandler().deleteObjects({
|
|
96
96
|
model: currentModel!,
|
|
97
97
|
ids: selectedRowItems!.map((item) => item.id),
|
|
98
98
|
});
|
|
@@ -5,9 +5,9 @@ import Field from "@/common/Field";
|
|
|
5
5
|
import { WidgetProps } from "@/types";
|
|
6
6
|
import { Date as DateOoui } from "@gisce/ooui";
|
|
7
7
|
import dayjs from "dayjs";
|
|
8
|
-
const { useToken } = theme;
|
|
9
8
|
import weekday from "dayjs/plugin/weekday";
|
|
10
9
|
import localeData from "dayjs/plugin/localeData";
|
|
10
|
+
const { useToken } = theme;
|
|
11
11
|
dayjs.extend(weekday);
|
|
12
12
|
dayjs.extend(localeData);
|
|
13
13
|
|
|
@@ -47,7 +47,7 @@ interface DatePickerInputProps {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
const DatePickerInput: React.FC<DatePickerInputProps> = (
|
|
50
|
-
props: DatePickerInputProps
|
|
50
|
+
props: DatePickerInputProps,
|
|
51
51
|
) => {
|
|
52
52
|
const { value, onChange, ooui, showTime } = props;
|
|
53
53
|
const { id, readOnly, required } = ooui as DateOoui;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
|
-
import { useContext, useState } from "react";
|
|
3
|
-
import React from "react";
|
|
2
|
+
import React, { useContext, useState } from "react";
|
|
4
3
|
import { Spin } from "antd";
|
|
5
4
|
import { LocaleContext, LocaleContextType } from "@/context/LocaleContext";
|
|
6
5
|
import Link from "antd/es/typography/Link";
|
|
@@ -60,7 +59,7 @@ export const SelectAllRecordsRow = ({
|
|
|
60
59
|
<span>
|
|
61
60
|
{translations.recordsSelected.replace(
|
|
62
61
|
"{numberOfSelectedRows}",
|
|
63
|
-
numberOfVisibleSelectedRows.toString()
|
|
62
|
+
numberOfVisibleSelectedRows.toString(),
|
|
64
63
|
) + " "}
|
|
65
64
|
|
|
66
65
|
{loading ? (
|
|
@@ -69,7 +68,7 @@ export const SelectAllRecordsRow = ({
|
|
|
69
68
|
<Link onClick={handleClick} style={{ fontWeight: 600 }}>
|
|
70
69
|
{translations.selectAllRecords.replace(
|
|
71
70
|
"{totalRecords}",
|
|
72
|
-
totalRecords.toString()
|
|
71
|
+
totalRecords.toString(),
|
|
73
72
|
)}
|
|
74
73
|
</Link>
|
|
75
74
|
)}
|
|
@@ -80,7 +79,7 @@ export const SelectAllRecordsRow = ({
|
|
|
80
79
|
<span style={{ fontWeight: 600 }}>
|
|
81
80
|
{translations.allRecordsSelected.replace(
|
|
82
81
|
"{totalRecords}",
|
|
83
|
-
numberOfRealSelectedRows.toString()
|
|
82
|
+
numberOfRealSelectedRows.toString(),
|
|
84
83
|
) + " "}
|
|
85
84
|
</span>
|
|
86
85
|
);
|
|
@@ -59,14 +59,14 @@ const callRefreshValues = async (fns: any[]) => {
|
|
|
59
59
|
|
|
60
60
|
const ContentRootProvider = (
|
|
61
61
|
props: ContentRootProviderProps,
|
|
62
|
-
ref: any
|
|
62
|
+
ref: any,
|
|
63
63
|
): any => {
|
|
64
64
|
const { children, globalValues = {} } = props;
|
|
65
65
|
const reportInProgressInterval = useRef<any>();
|
|
66
66
|
const waitingForReport = useRef<boolean>();
|
|
67
67
|
const [reportGenerating, setReportGenerating] = useState<boolean>(false);
|
|
68
68
|
const tabManagerContext = useContext(
|
|
69
|
-
TabManagerContext
|
|
69
|
+
TabManagerContext,
|
|
70
70
|
) as TabManagerContextType;
|
|
71
71
|
const { openAction } = tabManagerContext || {};
|
|
72
72
|
const onRefreshParentValues = useRef<any>([]);
|
|
@@ -82,7 +82,7 @@ const ContentRootProvider = (
|
|
|
82
82
|
const [actionModalOptions, setActionModalOptions] = useState<ActionModalOpts>(
|
|
83
83
|
{
|
|
84
84
|
context: {},
|
|
85
|
-
}
|
|
85
|
+
},
|
|
86
86
|
);
|
|
87
87
|
|
|
88
88
|
async function generateReport(options: GenerateReportOptions) {
|
|
@@ -103,7 +103,7 @@ const ContentRootProvider = (
|
|
|
103
103
|
|
|
104
104
|
const { ids } = datas || {};
|
|
105
105
|
|
|
106
|
-
|
|
106
|
+
const idsToExecute = ids || [];
|
|
107
107
|
|
|
108
108
|
const reportContextParsed =
|
|
109
109
|
typeof reportContext === "string"
|
|
@@ -182,9 +182,12 @@ const ContentRootProvider = (
|
|
|
182
182
|
context,
|
|
183
183
|
});
|
|
184
184
|
} else if (type === "ir.actions.act_window") {
|
|
185
|
-
return await runAction({actionData, fields, values, context});
|
|
185
|
+
return await runAction({ actionData, fields, values, context });
|
|
186
186
|
} else if (type === "ir.actions.act_url") {
|
|
187
|
-
window.open(
|
|
187
|
+
window.open(
|
|
188
|
+
stringFormat(actionData.url, { ...values, context }),
|
|
189
|
+
"_blank",
|
|
190
|
+
);
|
|
188
191
|
} else {
|
|
189
192
|
showErrorDialog(`${type} action not supported`);
|
|
190
193
|
return {};
|
|
@@ -275,7 +278,7 @@ const ContentRootProvider = (
|
|
|
275
278
|
context: mergedContext,
|
|
276
279
|
domain: parsedDomain,
|
|
277
280
|
model: actionData.res_model,
|
|
278
|
-
views
|
|
281
|
+
views,
|
|
279
282
|
title: actionData.name,
|
|
280
283
|
initialView,
|
|
281
284
|
action_id: actionData.id,
|
|
@@ -346,52 +349,54 @@ const ContentRootProvider = (
|
|
|
346
349
|
});
|
|
347
350
|
}
|
|
348
351
|
|
|
349
|
-
return (
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
352
|
+
return (
|
|
353
|
+
<>
|
|
354
|
+
<ContentRootContext.Provider
|
|
355
|
+
value={{
|
|
356
|
+
processAction,
|
|
357
|
+
globalValues,
|
|
358
|
+
}}
|
|
359
|
+
>
|
|
360
|
+
<>
|
|
361
|
+
{children}
|
|
362
|
+
<Modal
|
|
363
|
+
title={t("generatingReport")}
|
|
364
|
+
open={reportGenerating}
|
|
365
|
+
footer={null}
|
|
366
|
+
closable={false}
|
|
367
|
+
centered
|
|
368
|
+
maskClosable={false}
|
|
369
|
+
>
|
|
370
|
+
<Spin />
|
|
371
|
+
</Modal>
|
|
372
|
+
<FormModal
|
|
373
|
+
buttonModal
|
|
374
|
+
parentContext={actionModalOptions.context}
|
|
375
|
+
model={actionModalOptions.model!}
|
|
376
|
+
formView={actionModalOptions.formView}
|
|
377
|
+
visible={actionModalVisible}
|
|
378
|
+
onSubmitSucceed={onFormModalSucceed}
|
|
379
|
+
onCancel={() => {
|
|
380
|
+
callRefreshValues(onRefreshParentValues.current);
|
|
381
|
+
onRefreshParentValues.current = [];
|
|
382
|
+
setActionModalVisible(false);
|
|
383
|
+
setActionModalOptions({
|
|
384
|
+
domain: undefined,
|
|
385
|
+
model: undefined,
|
|
386
|
+
context: {},
|
|
387
|
+
formView: undefined,
|
|
388
|
+
actionData: undefined,
|
|
389
|
+
});
|
|
390
|
+
}}
|
|
391
|
+
showFooter={false}
|
|
392
|
+
actionDomain={actionModalOptions.domain}
|
|
393
|
+
isMenuAction={actionModalOptions?.actionData !== undefined}
|
|
394
|
+
actionData={actionModalOptions?.actionData}
|
|
395
|
+
/>
|
|
396
|
+
</>
|
|
397
|
+
</ContentRootContext.Provider>
|
|
398
|
+
</>
|
|
399
|
+
);
|
|
395
400
|
};
|
|
396
401
|
|
|
397
402
|
async function getViewsAndInitialView({
|
|
@@ -439,7 +444,9 @@ async function getViewsAndInitialView({
|
|
|
439
444
|
};
|
|
440
445
|
} else if (!view_id) {
|
|
441
446
|
const type = view_mode.split(",")[0];
|
|
442
|
-
const [retrievedViewId] = retriedViewData.find(
|
|
447
|
+
const [retrievedViewId] = retriedViewData.find(
|
|
448
|
+
([_, viewType]) => viewType === type,
|
|
449
|
+
)!;
|
|
443
450
|
initialView = { id: retrievedViewId, type };
|
|
444
451
|
} else {
|
|
445
452
|
initialView = {
|
|
@@ -20,7 +20,7 @@ export type TabManagerContextType = {
|
|
|
20
20
|
domain: any;
|
|
21
21
|
context: any;
|
|
22
22
|
model: string;
|
|
23
|
-
views:
|
|
23
|
+
views: any[];
|
|
24
24
|
title: string;
|
|
25
25
|
target: string;
|
|
26
26
|
initialView: InitialViewData;
|
|
@@ -69,9 +69,8 @@ export type TabManagerContextType = {
|
|
|
69
69
|
setCurrentId?: (id?: number) => void;
|
|
70
70
|
};
|
|
71
71
|
|
|
72
|
-
export const TabManagerContext =
|
|
73
|
-
null
|
|
74
|
-
);
|
|
72
|
+
export const TabManagerContext =
|
|
73
|
+
React.createContext<TabManagerContextType | null>(null);
|
|
75
74
|
|
|
76
75
|
type TabManagerProviderProps = TabManagerContextType & {
|
|
77
76
|
children: React.ReactNode;
|
|
@@ -8,7 +8,7 @@ export function getFilesize(base64string: string) {
|
|
|
8
8
|
|
|
9
9
|
export async function getMimeType(base64string: string) {
|
|
10
10
|
const mimeInfo = await fileTypeFromBuffer(
|
|
11
|
-
Buffer.from(base64string, "base64")
|
|
11
|
+
Buffer.from(base64string, "base64"),
|
|
12
12
|
);
|
|
13
13
|
if (!mimeInfo) {
|
|
14
14
|
return {
|
|
@@ -29,13 +29,13 @@ export const toBase64 = (file: File): Promise<string> =>
|
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
export function openBase64InNewTab(data: string, mimeType: string) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
for (
|
|
32
|
+
const byteCharacters = atob(data);
|
|
33
|
+
const byteNumbers = new Array(byteCharacters.length);
|
|
34
|
+
for (let i = 0; i < byteCharacters.length; i++) {
|
|
35
35
|
byteNumbers[i] = byteCharacters.charCodeAt(i);
|
|
36
36
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
const byteArray = new Uint8Array(byteNumbers);
|
|
38
|
+
const file = new Blob([byteArray], { type: mimeType + ";base64" });
|
|
39
|
+
const fileURL = URL.createObjectURL(file);
|
|
40
40
|
window.open(fileURL);
|
|
41
41
|
}
|
|
@@ -57,7 +57,7 @@ export const getTouchedValues = ({
|
|
|
57
57
|
|
|
58
58
|
const nonOriginalItems =
|
|
59
59
|
target[key]?.items?.filter(
|
|
60
|
-
(item: One2manyItem) => item.operation !== "original"
|
|
60
|
+
(item: One2manyItem) => item.operation !== "original",
|
|
61
61
|
) || [];
|
|
62
62
|
|
|
63
63
|
if (nonOriginalItems.length > 0) {
|
|
@@ -203,7 +203,7 @@ export const mergeSearchFields = (searchFields: any[]) => {
|
|
|
203
203
|
|
|
204
204
|
mergedSearchFields.primary = mergedSearchFields.primary.concat(sf.primary);
|
|
205
205
|
mergedSearchFields.secondary = mergedSearchFields.secondary.concat(
|
|
206
|
-
sf.secondary
|
|
206
|
+
sf.secondary,
|
|
207
207
|
);
|
|
208
208
|
});
|
|
209
209
|
|
|
@@ -224,7 +224,7 @@ export const transformPlainMany2Ones = ({
|
|
|
224
224
|
values: any;
|
|
225
225
|
fields: any;
|
|
226
226
|
}) => {
|
|
227
|
-
|
|
227
|
+
const reformattedValues: { [key: string]: any } = {};
|
|
228
228
|
|
|
229
229
|
Object.keys(values).forEach((key) => {
|
|
230
230
|
const value = values[key];
|
|
@@ -245,30 +245,29 @@ export const transformPlainMany2Ones = ({
|
|
|
245
245
|
return reformattedValues;
|
|
246
246
|
};
|
|
247
247
|
|
|
248
|
-
|
|
249
248
|
export const colorFromString = (text: string) => {
|
|
250
249
|
let hash = 0;
|
|
251
|
-
text = text.toString().padEnd(10,
|
|
250
|
+
text = text.toString().padEnd(10, "0");
|
|
252
251
|
for (let i = 0; i < text.length; i++) {
|
|
253
252
|
hash = text.charCodeAt(i) + ((hash << 5) - hash);
|
|
254
253
|
}
|
|
255
|
-
let hexColour =
|
|
254
|
+
let hexColour = "#";
|
|
256
255
|
for (let i = 0; i < 3; i++) {
|
|
257
|
-
|
|
258
|
-
hexColour += (
|
|
256
|
+
const value = (hash >> (i * 8)) & 0xff;
|
|
257
|
+
hexColour += ("00" + value.toString(16)).slice(-2);
|
|
259
258
|
}
|
|
260
259
|
return hexColour;
|
|
261
|
-
}
|
|
260
|
+
};
|
|
262
261
|
|
|
263
262
|
export const colorTextFromBackground = (color: string) => {
|
|
264
263
|
function getRGB(c: string): number {
|
|
265
|
-
return parseInt(c, 16) || parseInt(c)
|
|
264
|
+
return parseInt(c, 16) || parseInt(c);
|
|
266
265
|
}
|
|
267
266
|
|
|
268
|
-
function getsRGB(c: string
|
|
267
|
+
function getsRGB(c: string) {
|
|
269
268
|
return getRGB(c) / 255 <= 0.03928
|
|
270
269
|
? getRGB(c) / 255 / 12.92
|
|
271
|
-
: Math.pow((getRGB(c) / 255 + 0.055) / 1.055, 2.4)
|
|
270
|
+
: Math.pow((getRGB(c) / 255 + 0.055) / 1.055, 2.4);
|
|
272
271
|
}
|
|
273
272
|
|
|
274
273
|
function getLuminance(hexColor: string) {
|
|
@@ -276,27 +275,27 @@ export const colorTextFromBackground = (color: string) => {
|
|
|
276
275
|
0.2126 * getsRGB(hexColor.substr(1, 2)) +
|
|
277
276
|
0.7152 * getsRGB(hexColor.substr(3, 2)) +
|
|
278
277
|
0.0722 * getsRGB(hexColor.substr(-2))
|
|
279
|
-
)
|
|
278
|
+
);
|
|
280
279
|
}
|
|
281
280
|
|
|
282
281
|
function getContrast(f: string, b: string) {
|
|
283
|
-
const L1 = getLuminance(f)
|
|
284
|
-
const L2 = getLuminance(b)
|
|
285
|
-
return (Math.max(L1, L2) + 0.05) / (Math.min(L1, L2) + 0.05)
|
|
282
|
+
const L1 = getLuminance(f);
|
|
283
|
+
const L2 = getLuminance(b);
|
|
284
|
+
return (Math.max(L1, L2) + 0.05) / (Math.min(L1, L2) + 0.05);
|
|
286
285
|
}
|
|
287
286
|
|
|
288
287
|
function getTextColor(bgColor: string) {
|
|
289
|
-
const whiteContrast = getContrast(bgColor,
|
|
290
|
-
const blackContrast = getContrast(bgColor,
|
|
288
|
+
const whiteContrast = getContrast(bgColor, "#ffffff");
|
|
289
|
+
const blackContrast = getContrast(bgColor, "#000000");
|
|
291
290
|
|
|
292
|
-
return whiteContrast > blackContrast ?
|
|
291
|
+
return whiteContrast > blackContrast ? "#ffffff" : "#000000";
|
|
293
292
|
}
|
|
294
293
|
|
|
295
294
|
return getTextColor(color);
|
|
296
|
-
|
|
297
|
-
}
|
|
298
|
-
|
|
295
|
+
};
|
|
299
296
|
|
|
300
297
|
export const stringFormat = (text: string, values: any): string => {
|
|
301
|
-
return text.replace(/\{([^}]+)\}/g, (match, key)
|
|
302
|
-
|
|
298
|
+
return text.replace(/\{([^}]+)\}/g, (match, key) =>
|
|
299
|
+
values[key] !== undefined ? values[key] : match,
|
|
300
|
+
);
|
|
301
|
+
};
|
|
@@ -18,7 +18,7 @@ type ReadObjectValuesOptions = {
|
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
const readObjectValues = async (
|
|
21
|
-
options: ReadObjectValuesOptions
|
|
21
|
+
options: ReadObjectValuesOptions,
|
|
22
22
|
): Promise<[One2manyItem[], any]> => {
|
|
23
23
|
const {
|
|
24
24
|
items,
|
|
@@ -30,7 +30,7 @@ const readObjectValues = async (
|
|
|
30
30
|
} = options;
|
|
31
31
|
|
|
32
32
|
const temporalItems: One2manyItem = items.filter(
|
|
33
|
-
(item) => item.operation !== "original"
|
|
33
|
+
(item) => item.operation !== "original",
|
|
34
34
|
);
|
|
35
35
|
|
|
36
36
|
// We get a number array of id's
|
|
@@ -43,8 +43,8 @@ const readObjectValues = async (
|
|
|
43
43
|
tree: treeView.fields,
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
-
let values = []
|
|
47
|
-
|
|
46
|
+
let values = [];
|
|
47
|
+
let evaluatedColorsForTree;
|
|
48
48
|
|
|
49
49
|
if (currentView === "tree" && treeView?.arch) {
|
|
50
50
|
const colors = getTree(treeView as TreeView)?.colors;
|
|
@@ -85,7 +85,7 @@ const readObjectValues = async (
|
|
|
85
85
|
// We fill the values property of the One2manyItem with the retrieved values from the API
|
|
86
86
|
const originalItemsWithFetchedValues: One2manyItem[] = items.map((item) => {
|
|
87
87
|
const fetchedItemValues = filteredValues.find(
|
|
88
|
-
(itemValues: any) => itemValues.id === item.id
|
|
88
|
+
(itemValues: any) => itemValues.id === item.id,
|
|
89
89
|
);
|
|
90
90
|
|
|
91
91
|
const itemWithFetchedValues = {
|
|
@@ -177,7 +177,7 @@ const convertToPlain2ManyValues = (values: any, fields: any) => {
|
|
|
177
177
|
values[key]?.items
|
|
178
178
|
) {
|
|
179
179
|
result[key] = values[key].items.filter(
|
|
180
|
-
(item: One2manyItem) => item.operation !== "pendingRemove"
|
|
180
|
+
(item: One2manyItem) => item.operation !== "pendingRemove",
|
|
181
181
|
);
|
|
182
182
|
} else {
|
|
183
183
|
result[key] = values[key];
|
|
@@ -8,7 +8,10 @@ const convertBooleanParamIfNeeded = (value: any) => {
|
|
|
8
8
|
export const getParamsForFields = (values: any, widgetContainer: any) => {
|
|
9
9
|
const filteredValues = removeUndefinedFields(values);
|
|
10
10
|
const groupedDateTime = groupDateTimeValuesIfNeeded(filteredValues);
|
|
11
|
-
const groupedValues = ungroupDateValuesIfNeeded(
|
|
11
|
+
const groupedValues = ungroupDateValuesIfNeeded(
|
|
12
|
+
groupedDateTime,
|
|
13
|
+
widgetContainer,
|
|
14
|
+
);
|
|
12
15
|
|
|
13
16
|
const params = [
|
|
14
17
|
...Object.keys(groupedValues).map((key) => {
|
|
@@ -64,7 +67,7 @@ const getParamForField = (key: string, value: any, widgetContainer: any) => {
|
|
|
64
67
|
key,
|
|
65
68
|
"in",
|
|
66
69
|
value.map((valueEntry: string) =>
|
|
67
|
-
convertBooleanParamIfNeeded(valueEntry)
|
|
70
|
+
convertBooleanParamIfNeeded(valueEntry),
|
|
68
71
|
),
|
|
69
72
|
];
|
|
70
73
|
} else {
|
|
@@ -83,7 +86,7 @@ const removeDateTimeSingleFields = (values: any) => {
|
|
|
83
86
|
Object.keys(newValues).forEach(
|
|
84
87
|
(key) =>
|
|
85
88
|
(key.indexOf("#time") !== -1 || key.indexOf("#date") !== -1) &&
|
|
86
|
-
delete newValues[key]
|
|
89
|
+
delete newValues[key],
|
|
87
90
|
);
|
|
88
91
|
return newValues;
|
|
89
92
|
};
|
|
@@ -133,7 +136,7 @@ const ungroupDateValuesIfNeeded = (values: any, widgetContainer: any) => {
|
|
|
133
136
|
return widget && widget.type === "date";
|
|
134
137
|
});
|
|
135
138
|
|
|
136
|
-
|
|
139
|
+
const newValues: any = { ...values };
|
|
137
140
|
|
|
138
141
|
dateFields.forEach((key) => {
|
|
139
142
|
delete newValues[key];
|
|
@@ -156,7 +159,7 @@ export const removeUndefinedFields = (values: any) => {
|
|
|
156
159
|
(newValues[key] === undefined ||
|
|
157
160
|
newValues[key] === null ||
|
|
158
161
|
newValues[key] === "") &&
|
|
159
|
-
delete newValues[key]
|
|
162
|
+
delete newValues[key],
|
|
160
163
|
);
|
|
161
164
|
return newValues;
|
|
162
165
|
};
|