@gisce/react-ooui 2.0.0-alpha.6 → 2.0.0-alpha.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ConnectionProvider.d.ts +7 -0
- package/dist/ConnectionProvider.d.ts.map +1 -0
- package/dist/actionbar/ActionButton.d.ts +12 -0
- package/dist/actionbar/ActionButton.d.ts.map +1 -0
- package/dist/actionbar/AttachmentsButton.d.ts +11 -0
- package/dist/actionbar/AttachmentsButton.d.ts.map +1 -0
- package/dist/actionbar/AttachmentsButtonWrapper.d.ts +18 -0
- package/dist/actionbar/AttachmentsButtonWrapper.d.ts.map +1 -0
- package/dist/actionbar/ButtonWithBadge.d.ts +7 -0
- package/dist/actionbar/ButtonWithBadge.d.ts.map +1 -0
- package/dist/actionbar/ChangeViewButton.d.ts +12 -0
- package/dist/actionbar/ChangeViewButton.d.ts.map +1 -0
- package/dist/actionbar/DashboardActionBar.d.ts +3 -0
- package/dist/actionbar/DashboardActionBar.d.ts.map +1 -0
- package/dist/actionbar/DropdownButton.d.ts +13 -0
- package/dist/actionbar/DropdownButton.d.ts.map +1 -0
- package/dist/actionbar/FormActionBar.d.ts +5 -0
- package/dist/actionbar/FormActionBar.d.ts.map +1 -0
- package/dist/actionbar/GraphActionBar.d.ts +5 -0
- package/dist/actionbar/GraphActionBar.d.ts.map +1 -0
- package/dist/actionbar/NewButton.d.ts +6 -0
- package/dist/actionbar/NewButton.d.ts.map +1 -0
- package/dist/actionbar/SearchBar.d.ts +8 -0
- package/dist/actionbar/SearchBar.d.ts.map +1 -0
- package/dist/actionbar/TreeActionBar.d.ts +8 -0
- package/dist/actionbar/TreeActionBar.d.ts.map +1 -0
- package/dist/common/ButtonWithTooltip.d.ts +7 -0
- package/dist/common/ButtonWithTooltip.d.ts.map +1 -0
- package/dist/common/DatePicker.d.ts +19 -0
- package/dist/common/DatePicker.d.ts.map +1 -0
- package/dist/common/Field.d.ts +14 -0
- package/dist/common/Field.d.ts.map +1 -0
- package/dist/common/SelectAllRecordsRow.d.ts +9 -0
- package/dist/common/SelectAllRecordsRow.d.ts.map +1 -0
- package/dist/common/TimePicker.d.ts +10 -0
- package/dist/common/TimePicker.d.ts.map +1 -0
- package/dist/context/ActionViewContext.d.ts +65 -0
- package/dist/context/ActionViewContext.d.ts.map +1 -0
- package/dist/context/ConfigContext.d.ts +15 -0
- package/dist/context/ConfigContext.d.ts.map +1 -0
- package/dist/context/ContentRootContext.d.ts +19 -0
- package/dist/context/ContentRootContext.d.ts.map +1 -0
- package/dist/context/DashboardActionContext.d.ts +19 -0
- package/dist/context/DashboardActionContext.d.ts.map +1 -0
- package/dist/context/FormContext.d.ts +35 -0
- package/dist/context/FormContext.d.ts.map +1 -0
- package/dist/context/FormModalContext.d.ts +11 -0
- package/dist/context/FormModalContext.d.ts.map +1 -0
- package/dist/context/LocaleContext.d.ts +14 -0
- package/dist/context/LocaleContext.d.ts.map +1 -0
- package/dist/context/One2manyContext.d.ts +17 -0
- package/dist/context/One2manyContext.d.ts.map +1 -0
- package/dist/context/TabManagerContext.d.ts +50 -0
- package/dist/context/TabManagerContext.d.ts.map +1 -0
- package/dist/helpers/containerHelper.d.ts +22 -0
- package/dist/helpers/containerHelper.d.ts.map +1 -0
- package/dist/helpers/dayjs.d.ts +3 -0
- package/dist/helpers/dayjs.d.ts.map +1 -0
- package/dist/helpers/dynamicColumnsHelper.d.ts +16 -0
- package/dist/helpers/dynamicColumnsHelper.d.ts.map +1 -0
- package/dist/helpers/errorHelper.d.ts +6 -0
- package/dist/helpers/errorHelper.d.ts.map +1 -0
- package/dist/helpers/filesHelper.d.ts +8 -0
- package/dist/helpers/filesHelper.d.ts.map +1 -0
- package/dist/helpers/formHelper.d.ts +36 -0
- package/dist/helpers/formHelper.d.ts.map +1 -0
- package/dist/helpers/iconMapper.d.ts +13 -0
- package/dist/helpers/iconMapper.d.ts.map +1 -0
- package/dist/helpers/logInfoHelper.d.ts +3 -0
- package/dist/helpers/logInfoHelper.d.ts.map +1 -0
- package/dist/helpers/one2manyHelper.d.ts +37 -0
- package/dist/helpers/one2manyHelper.d.ts.map +1 -0
- package/dist/helpers/searchHelper.d.ts +6 -0
- package/dist/helpers/searchHelper.d.ts.map +1 -0
- package/dist/helpers/timeHelper.d.ts +4 -0
- package/dist/helpers/timeHelper.d.ts.map +1 -0
- package/dist/helpers/treeHelper.d.ts +23 -0
- package/dist/helpers/treeHelper.d.ts.map +1 -0
- package/dist/helpers/viewHelper.d.ts +10 -0
- package/dist/helpers/viewHelper.d.ts.map +1 -0
- package/dist/hooks/useEffectDebugger.d.ts +3 -0
- package/dist/hooks/useEffectDebugger.d.ts.map +1 -0
- package/dist/hooks/useExport.d.ts +44 -0
- package/dist/hooks/useExport.d.ts.map +1 -0
- package/dist/hooks/useFetchViews.d.ts +1 -0
- package/dist/hooks/useFetchViews.d.ts.map +1 -0
- package/dist/hooks/useSearch.d.ts +56 -0
- package/dist/hooks/useSearch.d.ts.map +1 -0
- package/dist/hooks/useWindowDimensions.d.ts +7 -0
- package/dist/hooks/useWindowDimensions.d.ts.map +1 -0
- package/dist/index.d.ts +59 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/locales/ca_ES.d.ts +94 -0
- package/dist/locales/ca_ES.d.ts.map +1 -0
- package/dist/locales/en_US.d.ts +94 -0
- package/dist/locales/en_US.d.ts.map +1 -0
- package/dist/locales/es_ES.d.ts +94 -0
- package/dist/locales/es_ES.d.ts.map +1 -0
- package/dist/react-ooui.es.js +10077 -0
- package/dist/react-ooui.es.js.map +1 -0
- package/dist/style.css +1 -0
- package/dist/types/index.d.ts +258 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/ui/ActionErrorDialog.d.ts +3 -0
- package/dist/ui/ActionErrorDialog.d.ts.map +1 -0
- package/dist/ui/ConfirmDialog.d.ts +7 -0
- package/dist/ui/ConfirmDialog.d.ts.map +1 -0
- package/dist/ui/ErrorAlert.d.ts +5 -0
- package/dist/ui/ErrorAlert.d.ts.map +1 -0
- package/dist/ui/FavouriteButton.d.ts +25 -0
- package/dist/ui/FavouriteButton.d.ts.map +1 -0
- package/dist/ui/FormErrorsDialog.d.ts +3 -0
- package/dist/ui/FormErrorsDialog.d.ts.map +1 -0
- package/dist/ui/GenericErrorDialog.d.ts +3 -0
- package/dist/ui/GenericErrorDialog.d.ts.map +1 -0
- package/dist/ui/GoToResourceModal.d.ts +9 -0
- package/dist/ui/GoToResourceModal.d.ts.map +1 -0
- package/dist/ui/InfoDialog.d.ts +3 -0
- package/dist/ui/InfoDialog.d.ts.map +1 -0
- package/dist/ui/RefreshItemDialog.d.ts +7 -0
- package/dist/ui/RefreshItemDialog.d.ts.map +1 -0
- package/dist/ui/RemoveItemDialog.d.ts +6 -0
- package/dist/ui/RemoveItemDialog.d.ts.map +1 -0
- package/dist/ui/TitleHeader.d.ts +7 -0
- package/dist/ui/TitleHeader.d.ts.map +1 -0
- package/dist/ui/UnlinkItemDialog.d.ts +6 -0
- package/dist/ui/UnlinkItemDialog.d.ts.map +1 -0
- package/dist/ui/UnsavedChangesDialog.d.ts +7 -0
- package/dist/ui/UnsavedChangesDialog.d.ts.map +1 -0
- package/dist/ui/WarningDialog.d.ts +3 -0
- package/dist/ui/WarningDialog.d.ts.map +1 -0
- package/dist/views/ActionView.d.ts +22 -0
- package/dist/views/ActionView.d.ts.map +1 -0
- package/dist/views/CurrentTabContent.d.ts +3 -0
- package/dist/views/CurrentTabContent.d.ts.map +1 -0
- package/dist/views/RootView.d.ts +14 -0
- package/dist/views/RootView.d.ts.map +1 -0
- package/dist/views/TabContent.d.ts +8 -0
- package/dist/views/TabContent.d.ts.map +1 -0
- package/dist/views/TabSelector.d.ts +3 -0
- package/dist/views/TabSelector.d.ts.map +1 -0
- package/dist/views/Welcome.d.ts +4 -0
- package/dist/views/Welcome.d.ts.map +1 -0
- package/dist/views/actionViews/DashboardActionView.d.ts +7 -0
- package/dist/views/actionViews/DashboardActionView.d.ts.map +1 -0
- package/dist/views/actionViews/FormActionView.d.ts +17 -0
- package/dist/views/actionViews/FormActionView.d.ts.map +1 -0
- package/dist/views/actionViews/GraphActionView.d.ts +12 -0
- package/dist/views/actionViews/GraphActionView.d.ts.map +1 -0
- package/dist/views/actionViews/TreeActionView.d.ts +19 -0
- package/dist/views/actionViews/TreeActionView.d.ts.map +1 -0
- package/dist/views/tabs/Tab.d.ts +10 -0
- package/dist/views/tabs/Tab.d.ts.map +1 -0
- package/dist/widgets/WidgetFactory.d.ts +4 -0
- package/dist/widgets/WidgetFactory.d.ts.map +1 -0
- package/dist/widgets/base/Binary.d.ts +13 -0
- package/dist/widgets/base/Binary.d.ts.map +1 -0
- package/dist/widgets/base/Boolean.d.ts +3 -0
- package/dist/widgets/base/Boolean.d.ts.map +1 -0
- package/dist/widgets/base/Button.d.ts +7 -0
- package/dist/widgets/base/Button.d.ts.map +1 -0
- package/dist/widgets/base/Char.d.ts +7 -0
- package/dist/widgets/base/Char.d.ts.map +1 -0
- package/dist/widgets/base/Date.d.ts +4 -0
- package/dist/widgets/base/Date.d.ts.map +1 -0
- package/dist/widgets/base/DateTime.d.ts +4 -0
- package/dist/widgets/base/DateTime.d.ts.map +1 -0
- package/dist/widgets/base/Email.d.ts +3 -0
- package/dist/widgets/base/Email.d.ts.map +1 -0
- package/dist/widgets/base/Float.d.ts +3 -0
- package/dist/widgets/base/Float.d.ts.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/Image.d.ts +13 -0
- package/dist/widgets/base/Image.d.ts.map +1 -0
- package/dist/widgets/base/Integer.d.ts +7 -0
- package/dist/widgets/base/Integer.d.ts.map +1 -0
- package/dist/widgets/base/Label.d.ts +8 -0
- package/dist/widgets/base/Label.d.ts.map +1 -0
- package/dist/widgets/base/LinkInput.d.ts +11 -0
- package/dist/widgets/base/LinkInput.d.ts.map +1 -0
- package/dist/widgets/base/MultiSelection.d.ts +9 -0
- package/dist/widgets/base/MultiSelection.d.ts.map +1 -0
- package/dist/widgets/base/ProgressBar.d.ts +6 -0
- package/dist/widgets/base/ProgressBar.d.ts.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/ReferenceTree.d.ts +8 -0
- package/dist/widgets/base/ReferenceTree.d.ts.map +1 -0
- package/dist/widgets/base/Selection.d.ts +9 -0
- package/dist/widgets/base/Selection.d.ts.map +1 -0
- package/dist/widgets/base/Separator.d.ts +7 -0
- package/dist/widgets/base/Separator.d.ts.map +1 -0
- package/dist/widgets/base/Text.d.ts +7 -0
- package/dist/widgets/base/Text.d.ts.map +1 -0
- package/dist/widgets/base/Time.d.ts +11 -0
- package/dist/widgets/base/Time.d.ts.map +1 -0
- package/dist/widgets/base/Url.d.ts +3 -0
- package/dist/widgets/base/Url.d.ts.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/Many2oneSuffix.d.ts +8 -0
- package/dist/widgets/base/many2one/Many2oneSuffix.d.ts.map +1 -0
- package/dist/widgets/base/many2one/Many2oneSuffixModal.d.ts +9 -0
- package/dist/widgets/base/many2one/Many2oneSuffixModal.d.ts.map +1 -0
- package/dist/widgets/base/many2one/Many2oneTree.d.ts +6 -0
- package/dist/widgets/base/many2one/Many2oneTree.d.ts.map +1 -0
- package/dist/widgets/base/one2many/One2many.d.ts +7 -0
- package/dist/widgets/base/one2many/One2many.d.ts.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/One2manyTopBar.d.ts +22 -0
- package/dist/widgets/base/one2many/One2manyTopBar.d.ts.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/Group.d.ts +10 -0
- package/dist/widgets/containers/Group.d.ts.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/custom/Avatar.d.ts +10 -0
- package/dist/widgets/custom/Avatar.d.ts.map +1 -0
- package/dist/widgets/custom/ButtonGroup.d.ts +7 -0
- package/dist/widgets/custom/ButtonGroup.d.ts.map +1 -0
- package/dist/widgets/custom/CodeEditor.d.ts +8 -0
- package/dist/widgets/custom/CodeEditor.d.ts.map +1 -0
- package/dist/widgets/custom/Comments.d.ts +34 -0
- package/dist/widgets/custom/Comments.d.ts.map +1 -0
- package/dist/widgets/custom/FiberGrid.d.ts +9 -0
- package/dist/widgets/custom/FiberGrid.d.ts.map +1 -0
- package/dist/widgets/custom/Indicator.d.ts +9 -0
- package/dist/widgets/custom/Indicator.d.ts.map +1 -0
- package/dist/widgets/custom/Markdown.d.ts +4 -0
- package/dist/widgets/custom/Markdown.d.ts.map +1 -0
- package/dist/widgets/custom/MultiCheckbox.d.ts +13 -0
- package/dist/widgets/custom/MultiCheckbox.d.ts.map +1 -0
- package/dist/widgets/custom/Radio.d.ts +9 -0
- package/dist/widgets/custom/Radio.d.ts.map +1 -0
- package/dist/widgets/custom/Steps.d.ts +12 -0
- package/dist/widgets/custom/Steps.d.ts.map +1 -0
- package/dist/widgets/custom/Switch.d.ts +3 -0
- package/dist/widgets/custom/Switch.d.ts.map +1 -0
- package/dist/widgets/custom/Tag.d.ts +6 -0
- package/dist/widgets/custom/Tag.d.ts.map +1 -0
- package/dist/widgets/custom/Tags.d.ts +14 -0
- package/dist/widgets/custom/Tags.d.ts.map +1 -0
- package/dist/widgets/custom/Timeline.d.ts +15 -0
- package/dist/widgets/custom/Timeline.d.ts.map +1 -0
- package/dist/widgets/modals/ExportModal.d.ts +14 -0
- package/dist/widgets/modals/ExportModal.d.ts.map +1 -0
- package/dist/widgets/modals/FormModal.d.ts +11 -0
- package/dist/widgets/modals/FormModal.d.ts.map +1 -0
- package/dist/widgets/modals/SearchModal.d.ts +12 -0
- package/dist/widgets/modals/SearchModal.d.ts.map +1 -0
- package/dist/widgets/modals/TranslationModal.d.ts +11 -0
- package/dist/widgets/modals/TranslationModal.d.ts.map +1 -0
- package/dist/widgets/views/Dashboard/Dashboard.d.ts +5 -0
- package/dist/widgets/views/Dashboard/Dashboard.d.ts.map +1 -0
- package/dist/widgets/views/Dashboard/DashboardForm.d.ts +3 -0
- package/dist/widgets/views/Dashboard/DashboardForm.d.ts.map +1 -0
- package/dist/widgets/views/Dashboard/DashboardTree.d.ts +18 -0
- package/dist/widgets/views/Dashboard/DashboardTree.d.ts.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/DashboardGrid/DashboardGrid.d.ts +3 -0
- package/dist/widgets/views/DashboardGrid/DashboardGrid.d.ts.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/DashboardGridItem.d.ts +3 -0
- package/dist/widgets/views/DashboardGrid/DashboardGridItem.d.ts.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/index.d.ts +5 -0
- package/dist/widgets/views/DashboardGrid/index.d.ts.map +1 -0
- package/dist/widgets/views/Form.d.ts +29 -0
- package/dist/widgets/views/Form.d.ts.map +1 -0
- package/dist/widgets/views/Graph/Graph.d.ts +11 -0
- package/dist/widgets/views/Graph/Graph.d.ts.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/GraphDefaults.d.ts +83 -0
- package/dist/widgets/views/Graph/GraphDefaults.d.ts.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/useGraphData.d.ts +20 -0
- package/dist/widgets/views/Graph/useGraphData.d.ts.map +1 -0
- package/dist/widgets/views/SearchTree.d.ts +24 -0
- package/dist/widgets/views/SearchTree.d.ts.map +1 -0
- package/dist/widgets/views/Tree/Tree.d.ts +33 -0
- package/dist/widgets/views/Tree/Tree.d.ts.map +1 -0
- package/dist/widgets/views/Tree/index.d.ts +2 -0
- package/dist/widgets/views/Tree/index.d.ts.map +1 -0
- package/dist/widgets/views/Tree/treeComponents.d.ts +131 -0
- package/dist/widgets/views/Tree/treeComponents.d.ts.map +1 -0
- package/dist/widgets/views/searchFilter/DateRangePicker.d.ts +3 -0
- package/dist/widgets/views/searchFilter/DateRangePicker.d.ts.map +1 -0
- package/dist/widgets/views/searchFilter/DateTimeRangePicker.d.ts +3 -0
- package/dist/widgets/views/searchFilter/DateTimeRangePicker.d.ts.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/SearchBottomBar.d.ts +10 -0
- package/dist/widgets/views/searchFilter/SearchBottomBar.d.ts.map +1 -0
- package/dist/widgets/views/searchFilter/SearchField.d.ts +7 -0
- package/dist/widgets/views/searchFilter/SearchField.d.ts.map +1 -0
- package/dist/widgets/views/searchFilter/SearchFilter.d.ts +19 -0
- package/dist/widgets/views/searchFilter/SearchFilter.d.ts.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/package.json +43 -18
- package/src/ConnectionProvider.ts +1 -1
- package/src/__tests__/iconMapper.test.ts +4 -4
- package/src/actionbar/AttachmentsButton.tsx +25 -23
- package/src/actionbar/AttachmentsButtonWrapper.tsx +2 -2
- package/src/actionbar/ButtonWithBadge.tsx +4 -2
- package/src/actionbar/ChangeViewButton.tsx +1 -1
- package/src/actionbar/DashboardActionBar.tsx +2 -6
- package/src/actionbar/DropdownButton.tsx +100 -37
- package/src/actionbar/FormActionBar.tsx +22 -16
- package/src/actionbar/NewButton.tsx +1 -1
- package/src/actionbar/TreeActionBar.tsx +86 -79
- package/src/common/DatePicker.tsx +4 -5
- package/src/common/Field.tsx +2 -1
- package/src/common/TimePicker.tsx +38 -0
- package/src/context/ActionViewContext.tsx +8 -4
- package/src/context/ConfigContext.tsx +22 -3
- package/src/context/DashboardActionContext.tsx +2 -3
- package/src/context/FormModalContext.tsx +2 -3
- package/src/context/LocaleContext.tsx +1 -1
- package/src/context/One2manyContext.tsx +3 -4
- package/src/helpers/containerHelper.ts +1 -1
- package/src/helpers/dayjs.ts +21 -0
- package/src/helpers/dynamicColumnsHelper.ts +2 -2
- package/src/helpers/iconMapper.ts +5 -5
- package/src/helpers/logInfoHelper.tsx +8 -6
- package/src/helpers/timeHelper.ts +2 -2
- package/src/helpers/{treeHelper.ts → treeHelper.tsx} +25 -4
- package/src/hooks/useEffectDebugger.ts +2 -2
- package/src/hooks/useExport.ts +9 -8
- package/src/hooks/useWindowDimensions.ts +1 -1
- package/src/index.ts +1 -1
- package/src/locales/ca_ES.tsx +1 -0
- package/src/locales/en_US.tsx +1 -0
- package/src/locales/es_ES.tsx +2 -0
- package/src/stories/Char.stories.tsx +27 -0
- package/src/stories/Time.stories.tsx +2 -3
- package/src/stories/Utils.stories.tsx +1 -3
- package/src/stories/containers/Group.stories.tsx +2 -3
- package/src/stories/containers/Notebook.stories.tsx +0 -6
- package/src/stories/custom/Avatar.stories.tsx +2 -6
- package/src/stories/custom/Comments.stories.tsx +32 -25
- package/src/stories/forms/FormWithLinks.stories.tsx +1 -2
- package/src/stories/forms/ModContractForm.stories.tsx +1 -0
- package/src/stories/forms/PreferencesForm.stories.tsx +1 -2
- package/src/stories/mocks/mockProvider.ts +5 -2
- package/src/stories/mocks/models/attachment.ts +1 -2
- package/src/stories/mocks/models/butlleti.ts +249 -297
- package/src/stories/mocks/models/company.ts +2 -4
- package/src/stories/mocks/models/cups.ts +18 -1
- package/src/stories/mocks/models/document.ts +2 -4
- package/src/stories/mocks/models/factura.ts +14 -28
- package/src/stories/mocks/models/form_with_gridfiber.ts +2 -4
- package/src/stories/mocks/models/hist_autoconsum.ts +2 -4
- package/src/stories/mocks/models/lead.ts +8 -16
- package/src/stories/mocks/models/modcontractual.ts +229 -83
- package/src/stories/mocks/models/partner.ts +20 -40
- package/src/stories/mocks/models/polissa.ts +6 -12
- package/src/stories/mocks/models/res_partner_category.ts +3 -3
- package/src/stories/mocks/models/signatura.ts +135 -195
- package/src/stories/mocks/models/switching.ts +2 -4
- package/src/stories/ui/GoToResourceModal.stories.tsx +3 -2
- package/src/stories/views/Tree.stories.jsx +3 -5
- package/src/stories/views/searchFilter/examples/PartnersSearchFilter.stories.tsx +15 -30
- package/src/types/index.ts +2 -1
- package/src/ui/ConfirmDialog.tsx +1 -1
- package/src/ui/GoToResourceModal.tsx +8 -7
- package/src/ui/TitleHeader.tsx +8 -1
- package/src/views/ActionView.tsx +41 -30
- package/src/views/CurrentTabContent.tsx +1 -1
- package/src/views/TabContent.tsx +1 -1
- package/src/views/TabSelector.tsx +1 -1
- package/src/views/actionViews/DashboardActionView.tsx +7 -2
- package/src/views/actionViews/GraphActionView.tsx +1 -1
- package/src/views/actionViews/TreeActionView.tsx +2 -2
- package/src/widgets/WidgetFactory.tsx +1 -1
- package/src/widgets/base/Button.tsx +1 -1
- package/src/widgets/base/Float.tsx +0 -1
- package/src/widgets/base/FloatTime.tsx +1 -1
- package/src/widgets/base/Integer.tsx +0 -1
- package/src/widgets/base/Reference.tsx +1 -1
- package/src/widgets/base/ReferenceTree.tsx +1 -1
- package/src/widgets/base/Separator.tsx +3 -4
- package/src/widgets/base/Time.tsx +5 -7
- package/src/widgets/base/many2one/Many2oneSuffixModal.tsx +2 -2
- package/src/widgets/base/one2many/One2many.tsx +2 -2
- package/src/widgets/base/one2many/One2manyInput.tsx +6 -5
- package/src/widgets/custom/Avatar.tsx +15 -7
- package/src/widgets/custom/Comments.tsx +4 -7
- package/src/widgets/custom/Markdown.tsx +18 -8
- package/src/widgets/custom/MultiCheckbox.tsx +1 -1
- package/src/widgets/custom/Radio.tsx +2 -4
- package/src/widgets/custom/Steps.tsx +10 -9
- package/src/widgets/custom/Switch.tsx +1 -5
- package/src/widgets/custom/Tags.tsx +1 -1
- package/src/widgets/modals/FormModal.tsx +5 -2
- package/src/widgets/modals/SearchModal.tsx +33 -33
- package/src/widgets/modals/TranslationModal.tsx +3 -3
- package/src/widgets/views/Dashboard/Dashboard.tsx +3 -3
- package/src/widgets/views/Dashboard/DashboardTree.tsx +3 -1
- package/src/widgets/views/DashboardGrid/DashboardGrid.tsx +3 -3
- package/src/widgets/views/DashboardGrid/DashboardGridItem.tsx +2 -2
- package/src/widgets/views/Form.tsx +2 -2
- package/src/widgets/views/Graph/Graph.tsx +1 -1
- package/src/widgets/views/Graph/GraphChart.tsx +2 -2
- package/src/widgets/views/Graph/GraphDefaults.ts +3 -3
- package/src/widgets/views/Graph/useGraphData.tsx +1 -1
- package/src/widgets/views/SearchTree.tsx +23 -13
- package/src/widgets/views/Tree/Tree.tsx +295 -0
- package/src/widgets/views/Tree/index.ts +1 -0
- package/src/widgets/views/Tree/treeComponents.tsx +276 -0
- package/src/widgets/views/searchFilter/DateTimeRangePicker.tsx +34 -8
- package/src/widgets/views/searchFilter/SearchBottomBar.tsx +4 -8
- package/src/widgets/views/searchFilter/SearchField.tsx +5 -1
- package/src/widgets/views/searchFilter/SearchFilter.tsx +3 -2
- package/src/widgets/views/searchFilter/SearchParams.tsx +7 -4
- package/src/widgets/views/Tree.tsx +0 -412
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Menu, Dropdown, Button } from "antd";
|
|
1
|
+
import { memo, useState, useMemo, useCallback } from "react";
|
|
2
|
+
import { Menu, Dropdown, Button, Input } from "antd";
|
|
3
3
|
import { DownOutlined } from "@ant-design/icons";
|
|
4
4
|
|
|
5
|
+
const { Search } = Input;
|
|
6
|
+
|
|
5
7
|
type Props = {
|
|
6
8
|
onItemClick: (event: any) => void;
|
|
7
9
|
items: any[];
|
|
@@ -9,53 +11,114 @@ type Props = {
|
|
|
9
11
|
icon: any;
|
|
10
12
|
label?: string;
|
|
11
13
|
disabled?: boolean;
|
|
14
|
+
searchable?: true | false | "auto";
|
|
12
15
|
};
|
|
13
16
|
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
const DropdownButton: React.FC<Props> = memo(
|
|
18
|
+
({
|
|
16
19
|
icon,
|
|
17
20
|
tooltip,
|
|
18
21
|
items = [],
|
|
19
22
|
onItemClick,
|
|
20
23
|
label,
|
|
21
24
|
disabled = false,
|
|
22
|
-
|
|
25
|
+
searchable = "auto",
|
|
26
|
+
}: Props) => {
|
|
27
|
+
const [searchValue, setSearchValue] = useState<string>();
|
|
28
|
+
|
|
29
|
+
const mustShowSearch =
|
|
30
|
+
searchable === true || (searchable === "auto" && items.length > 3);
|
|
31
|
+
|
|
32
|
+
const onSearch = useCallback((value?: string) => {
|
|
33
|
+
const sanitizedValue = value?.trim();
|
|
34
|
+
if (sanitizedValue && sanitizedValue.length > 0) {
|
|
35
|
+
setSearchValue(sanitizedValue);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
setSearchValue(undefined);
|
|
39
|
+
}, []);
|
|
23
40
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
41
|
+
const filteredItems = useMemo(() => {
|
|
42
|
+
if (searchValue) {
|
|
43
|
+
return items
|
|
44
|
+
.map((item) => {
|
|
45
|
+
if (item.name.toLowerCase().includes(searchValue.toLowerCase())) {
|
|
46
|
+
return { ...item };
|
|
47
|
+
}
|
|
48
|
+
return { ...item, name: "no_match" };
|
|
49
|
+
})
|
|
50
|
+
.sort((a, b) => {
|
|
51
|
+
// all the items with name "no_match" have to be in the end of the array
|
|
52
|
+
if (a.name === "no_match") return 1;
|
|
53
|
+
if (b.name === "no_match") return -1;
|
|
54
|
+
return 0;
|
|
55
|
+
});
|
|
28
56
|
}
|
|
29
|
-
return
|
|
30
|
-
});
|
|
57
|
+
return items;
|
|
58
|
+
}, [items, searchValue]);
|
|
59
|
+
|
|
60
|
+
const handleMenuClick = useCallback(
|
|
61
|
+
(event: any) => {
|
|
62
|
+
const itemClicked = filteredItems.find(
|
|
63
|
+
(item: any) => item.id.toString() === event.key,
|
|
64
|
+
);
|
|
65
|
+
if (itemClicked && itemClicked.name !== "no_match")
|
|
66
|
+
onItemClick(itemClicked);
|
|
67
|
+
},
|
|
68
|
+
[onItemClick, filteredItems],
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
const getMenu = useMemo(() => {
|
|
72
|
+
const menuItems = filteredItems.map((item, idx) => {
|
|
73
|
+
if (item.name === "divider")
|
|
74
|
+
return <Menu.Divider key={"divider" + idx} />;
|
|
75
|
+
if (item.name === "no_match")
|
|
76
|
+
return (
|
|
77
|
+
<Menu.Item
|
|
78
|
+
key={"no_match" + idx}
|
|
79
|
+
style={{ cursor: "auto", pointerEvents: "none", opacity: 0 }}
|
|
80
|
+
>
|
|
81
|
+
{item.name}
|
|
82
|
+
</Menu.Item>
|
|
83
|
+
);
|
|
84
|
+
return <Menu.Item key={item.id}>{item.name}</Menu.Item>;
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<Menu onClick={handleMenuClick}>
|
|
89
|
+
{mustShowSearch && (
|
|
90
|
+
<div style={{ padding: 5 }}>
|
|
91
|
+
<Search
|
|
92
|
+
onChange={(e) => onSearch(e.target.value)}
|
|
93
|
+
onSearch={onSearch}
|
|
94
|
+
allowClear
|
|
95
|
+
/>
|
|
96
|
+
</div>
|
|
97
|
+
)}
|
|
98
|
+
<div
|
|
99
|
+
style={{
|
|
100
|
+
width: 300,
|
|
101
|
+
maxHeight: 300,
|
|
102
|
+
overflowY: "auto",
|
|
103
|
+
}}
|
|
104
|
+
>
|
|
105
|
+
<Menu.ItemGroup title={tooltip}>{menuItems}</Menu.ItemGroup>
|
|
106
|
+
</div>
|
|
107
|
+
</Menu>
|
|
108
|
+
);
|
|
109
|
+
}, [filteredItems, handleMenuClick, mustShowSearch, onSearch, tooltip]);
|
|
31
110
|
|
|
32
111
|
return (
|
|
33
|
-
|
|
34
|
-
<
|
|
35
|
-
|
|
112
|
+
<>
|
|
113
|
+
<Dropdown overlay={getMenu} disabled={disabled || items.length === 0}>
|
|
114
|
+
<Button>
|
|
115
|
+
{icon} {label} <DownOutlined />
|
|
116
|
+
</Button>
|
|
117
|
+
</Dropdown>
|
|
118
|
+
</>
|
|
36
119
|
);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const itemClicked = items.find((item: any) => {
|
|
41
|
-
return !isNaN(event.key)
|
|
42
|
-
? item.id === parseInt(event.key)
|
|
43
|
-
: item.id === event.key;
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
onItemClick(itemClicked);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return (
|
|
50
|
-
<Dropdown
|
|
51
|
-
overlay={getMenu()}
|
|
52
|
-
disabled={disabled || !items || items.length === 0}
|
|
53
|
-
>
|
|
54
|
-
<Button>
|
|
55
|
-
{icon} {label} <DownOutlined />
|
|
56
|
-
</Button>
|
|
57
|
-
</Dropdown>
|
|
58
|
-
);
|
|
59
|
-
}
|
|
120
|
+
},
|
|
121
|
+
);
|
|
122
|
+
DropdownButton.displayName = "DropdownButton";
|
|
60
123
|
|
|
61
124
|
export default DropdownButton;
|
|
@@ -70,12 +70,12 @@ function FormActionBar({ toolbar }: { toolbar: any }) {
|
|
|
70
70
|
const { t, lang } = useContext(LocaleContext) as LocaleContextType;
|
|
71
71
|
|
|
72
72
|
const contentRootContext = useContext(
|
|
73
|
-
ContentRootContext
|
|
73
|
+
ContentRootContext,
|
|
74
74
|
) as ContentRootContextType;
|
|
75
75
|
const { processAction } = contentRootContext || {};
|
|
76
76
|
|
|
77
77
|
const tabManagerContext = useContext(
|
|
78
|
-
TabManagerContext
|
|
78
|
+
TabManagerContext,
|
|
79
79
|
) as TabManagerContextType;
|
|
80
80
|
const { openRelate, openDefaultActionForModel } = tabManagerContext || {};
|
|
81
81
|
|
|
@@ -144,6 +144,7 @@ function FormActionBar({ toolbar }: { toolbar: any }) {
|
|
|
144
144
|
await ConnectionProvider.getHandler().deleteObjects({
|
|
145
145
|
model: currentModel!,
|
|
146
146
|
ids: [currentId!],
|
|
147
|
+
context: (formRef.current as any).getContext(),
|
|
147
148
|
});
|
|
148
149
|
|
|
149
150
|
const filteredResults = results?.filter((item: any) => {
|
|
@@ -182,7 +183,7 @@ function FormActionBar({ toolbar }: { toolbar: any }) {
|
|
|
182
183
|
});
|
|
183
184
|
|
|
184
185
|
if (newId) {
|
|
185
|
-
await goToResourceId?.(newId);
|
|
186
|
+
await goToResourceId?.([newId]);
|
|
186
187
|
}
|
|
187
188
|
} catch (e) {
|
|
188
189
|
showErrorDialog(JSON.stringify(e));
|
|
@@ -414,14 +415,7 @@ function FormActionBar({ toolbar }: { toolbar: any }) {
|
|
|
414
415
|
const res_id = result.currentId as number;
|
|
415
416
|
const res_model = currentModel as string;
|
|
416
417
|
openDefaultActionForModel({
|
|
417
|
-
|
|
418
|
-
values: {
|
|
419
|
-
selection_associated_object: `${res_model},${res_id}`,
|
|
420
|
-
},
|
|
421
|
-
forced_values: {
|
|
422
|
-
res_model,
|
|
423
|
-
res_id,
|
|
424
|
-
},
|
|
418
|
+
...getAttachmentActionPayload(res_model, res_id),
|
|
425
419
|
initialViewType: "form",
|
|
426
420
|
});
|
|
427
421
|
}}
|
|
@@ -437,11 +431,7 @@ function FormActionBar({ toolbar }: { toolbar: any }) {
|
|
|
437
431
|
const res_id = result.currentId as number;
|
|
438
432
|
const res_model = currentModel as string;
|
|
439
433
|
openDefaultActionForModel({
|
|
440
|
-
|
|
441
|
-
domain: [
|
|
442
|
-
["res_model", "=", `${res_model}`],
|
|
443
|
-
["res_id", "=", `${res_id}`],
|
|
444
|
-
],
|
|
434
|
+
...getAttachmentActionPayload(res_model, res_id),
|
|
445
435
|
initialViewType: "tree",
|
|
446
436
|
});
|
|
447
437
|
}}
|
|
@@ -482,4 +472,20 @@ async function saveDocument({
|
|
|
482
472
|
}
|
|
483
473
|
}
|
|
484
474
|
|
|
475
|
+
function getAttachmentActionPayload(res_model: string, res_id: number) {
|
|
476
|
+
return {
|
|
477
|
+
model: "ir.attachment",
|
|
478
|
+
domain: [
|
|
479
|
+
["res_model", "=", `${res_model}`],
|
|
480
|
+
["res_id", "=", `${res_id}`],
|
|
481
|
+
],
|
|
482
|
+
values: {
|
|
483
|
+
selection_associated_object: `${res_model},${res_id}`,
|
|
484
|
+
},
|
|
485
|
+
forced_values: {
|
|
486
|
+
res_model,
|
|
487
|
+
res_id,
|
|
488
|
+
},
|
|
489
|
+
};
|
|
490
|
+
}
|
|
485
491
|
export default FormActionBar;
|
|
@@ -16,7 +16,7 @@ function NewButton(props: Props) {
|
|
|
16
16
|
const { disabled = false } = props;
|
|
17
17
|
|
|
18
18
|
const { formHasChanges, onNewClicked: onNewClickedProps } = useContext(
|
|
19
|
-
ActionViewContext
|
|
19
|
+
ActionViewContext,
|
|
20
20
|
) as ActionViewContextType;
|
|
21
21
|
const { t, lang } = useContext(LocaleContext) as LocaleContextType;
|
|
22
22
|
|
|
@@ -30,7 +30,7 @@ import { showLogInfo } from "@/helpers/logInfoHelper";
|
|
|
30
30
|
import SearchBar from "./SearchBar";
|
|
31
31
|
import { ExportModal } from "..";
|
|
32
32
|
import { mergeParams } from "@/helpers/searchHelper";
|
|
33
|
-
import {
|
|
33
|
+
import { ErpFeatureKeys, useFeatureIsEnabled } from "@/context/ConfigContext";
|
|
34
34
|
|
|
35
35
|
type Props = {
|
|
36
36
|
parentContext?: any;
|
|
@@ -66,10 +66,12 @@ function TreeActionBar(props: Props) {
|
|
|
66
66
|
} = useContext(ActionViewContext) as ActionViewContextType;
|
|
67
67
|
|
|
68
68
|
const { parentContext = {}, treeExpandable, toolbar } = props;
|
|
69
|
-
const
|
|
69
|
+
const advancedExportEnabled = useFeatureIsEnabled(
|
|
70
|
+
ErpFeatureKeys.FEATURE_ADVANCED_EXPORT,
|
|
71
|
+
);
|
|
70
72
|
const { t, lang } = useContext(LocaleContext) as LocaleContextType;
|
|
71
73
|
const contentRootContext = useContext(
|
|
72
|
-
ContentRootContext
|
|
74
|
+
ContentRootContext,
|
|
73
75
|
) as ContentRootContextType;
|
|
74
76
|
const { processAction } = contentRootContext || {};
|
|
75
77
|
const [exportModalVisible, setExportModalVisible] = useState(false);
|
|
@@ -95,6 +97,7 @@ function TreeActionBar(props: Props) {
|
|
|
95
97
|
await ConnectionProvider.getHandler().deleteObjects({
|
|
96
98
|
model: currentModel!,
|
|
97
99
|
ids: selectedRowItems!.map((item) => item.id),
|
|
100
|
+
context: { ...parentContext },
|
|
98
101
|
});
|
|
99
102
|
|
|
100
103
|
setCurrentId?.(undefined);
|
|
@@ -286,85 +289,89 @@ function TreeActionBar(props: Props) {
|
|
|
286
289
|
});
|
|
287
290
|
}}
|
|
288
291
|
/>
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
tooltip={t("export")}
|
|
316
|
-
items={[
|
|
317
|
-
{
|
|
318
|
-
id: "print_screen",
|
|
319
|
-
name: t("printScreen"),
|
|
320
|
-
},
|
|
321
|
-
{
|
|
322
|
-
id: "export",
|
|
323
|
-
name: t("advancedExport"),
|
|
324
|
-
},
|
|
325
|
-
]}
|
|
326
|
-
onItemClick={(itemClicked: any) => {
|
|
327
|
-
if (itemClicked.id === "print_screen") {
|
|
328
|
-
let idsToExport = selectedRowItems?.map((item) => item.id) || [];
|
|
329
|
-
|
|
330
|
-
if (idsToExport.length === 0) {
|
|
331
|
-
idsToExport = results?.map((item) => item.id) || [];
|
|
292
|
+
{advancedExportEnabled && (
|
|
293
|
+
<>
|
|
294
|
+
{separator()}
|
|
295
|
+
<DropdownButton
|
|
296
|
+
icon={
|
|
297
|
+
<Icon
|
|
298
|
+
component={() => (
|
|
299
|
+
<svg
|
|
300
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
301
|
+
className="icon icon-tabler icon-tabler-database-export"
|
|
302
|
+
width="1em"
|
|
303
|
+
height="1em"
|
|
304
|
+
viewBox="0 0 24 24"
|
|
305
|
+
strokeWidth="1.5"
|
|
306
|
+
fill="none"
|
|
307
|
+
stroke="currentColor"
|
|
308
|
+
strokeLinecap="round"
|
|
309
|
+
strokeLinejoin="round"
|
|
310
|
+
>
|
|
311
|
+
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
|
312
|
+
<ellipse cx="12" cy="6" rx="8" ry="3" />
|
|
313
|
+
<path d="M4 6v6c0 1.657 3.582 3 8 3a19.84 19.84 0 0 0 3.302 -.267m4.698 -2.733v-6" />
|
|
314
|
+
<path d="M4 12v6c0 1.599 3.335 2.905 7.538 2.995m8.462 -6.995v-2m-6 7h7m-3 -3l3 3l-3 3" />
|
|
315
|
+
</svg>
|
|
316
|
+
)}
|
|
317
|
+
/>
|
|
332
318
|
}
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
type: "ir.actions.report.xml",
|
|
339
|
-
datas: {
|
|
340
|
-
model: currentModel,
|
|
341
|
-
ids: idsToExport,
|
|
319
|
+
tooltip={t("export")}
|
|
320
|
+
items={[
|
|
321
|
+
{
|
|
322
|
+
id: "print_screen",
|
|
323
|
+
name: t("printScreen"),
|
|
342
324
|
},
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
325
|
+
{
|
|
326
|
+
id: "export",
|
|
327
|
+
name: t("advancedExport"),
|
|
328
|
+
},
|
|
329
|
+
]}
|
|
330
|
+
onItemClick={(itemClicked: any) => {
|
|
331
|
+
if (itemClicked.id === "print_screen") {
|
|
332
|
+
let idsToExport =
|
|
333
|
+
selectedRowItems?.map((item) => item.id) || [];
|
|
346
334
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
335
|
+
if (idsToExport.length === 0) {
|
|
336
|
+
idsToExport = results?.map((item) => item.id) || [];
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
runAction({
|
|
340
|
+
id: -1,
|
|
341
|
+
model: currentModel,
|
|
342
|
+
report_name: "printscreen.list",
|
|
343
|
+
type: "ir.actions.report.xml",
|
|
344
|
+
datas: {
|
|
345
|
+
model: currentModel,
|
|
346
|
+
ids: idsToExport,
|
|
347
|
+
},
|
|
348
|
+
});
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
setExportModalVisible(true);
|
|
353
|
+
}}
|
|
354
|
+
disabled={
|
|
355
|
+
duplicatingItem || removingItem || treeIsLoading || hasNameSearch
|
|
356
|
+
}
|
|
357
|
+
/>
|
|
358
|
+
<ExportModal
|
|
359
|
+
visible={exportModalVisible}
|
|
360
|
+
locale={lang}
|
|
361
|
+
onClose={() => setExportModalVisible(false)}
|
|
362
|
+
model={currentModel!}
|
|
363
|
+
domain={mergeParams(
|
|
364
|
+
searchTreeRef?.current?.getDomain() || [],
|
|
365
|
+
searchParams || [],
|
|
366
|
+
)}
|
|
367
|
+
limit={limit}
|
|
368
|
+
totalRegisters={totalItems || 0}
|
|
369
|
+
selectedRegistersToExport={selectedRowItems}
|
|
370
|
+
visibleRegisters={results?.length || 0}
|
|
371
|
+
context={parentContext}
|
|
372
|
+
/>
|
|
373
|
+
</>
|
|
374
|
+
)}
|
|
368
375
|
</Space>
|
|
369
376
|
);
|
|
370
377
|
}
|
|
@@ -4,12 +4,8 @@ import React from "react";
|
|
|
4
4
|
import Field from "@/common/Field";
|
|
5
5
|
import { WidgetProps } from "@/types";
|
|
6
6
|
import { Date as DateOoui } from "@gisce/ooui";
|
|
7
|
-
import dayjs from "dayjs";
|
|
8
|
-
import weekday from "dayjs/plugin/weekday";
|
|
9
|
-
import localeData from "dayjs/plugin/localeData";
|
|
7
|
+
import dayjs from "@/helpers/dayjs";
|
|
10
8
|
const { useToken } = theme;
|
|
11
|
-
dayjs.extend(weekday);
|
|
12
|
-
dayjs.extend(localeData);
|
|
13
9
|
|
|
14
10
|
type DatePickerProps = WidgetProps & {
|
|
15
11
|
showTime?: boolean;
|
|
@@ -92,6 +88,9 @@ const DatePickerInput: React.FC<DatePickerInputProps> = (
|
|
|
92
88
|
format={DatePickerConfig[mode].dateDisplayFormat}
|
|
93
89
|
value={dateValue}
|
|
94
90
|
onChange={onValueStringChange}
|
|
91
|
+
showNow={false}
|
|
92
|
+
showToday={false}
|
|
93
|
+
changeOnBlur={true}
|
|
95
94
|
/>
|
|
96
95
|
);
|
|
97
96
|
};
|
package/src/common/Field.tsx
CHANGED
|
@@ -45,6 +45,7 @@ export default function Field({
|
|
|
45
45
|
name={id}
|
|
46
46
|
valuePropName={valuePropName}
|
|
47
47
|
rules={rules}
|
|
48
|
+
help={ooui.tooltipInline ? ooui.tooltip : null}
|
|
48
49
|
>
|
|
49
50
|
{children}
|
|
50
51
|
</Form.Item>
|
|
@@ -60,7 +61,7 @@ export default function Field({
|
|
|
60
61
|
new LabelOoui({
|
|
61
62
|
name: id + "_label",
|
|
62
63
|
string: label,
|
|
63
|
-
help: tooltip,
|
|
64
|
+
help: ooui.tooltipInline ? false : tooltip,
|
|
64
65
|
fieldForLabel: id,
|
|
65
66
|
})
|
|
66
67
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { TimePicker as AntTimePicker } from "antd";
|
|
2
|
+
import { useRef } from "react";
|
|
3
|
+
import { Dayjs } from "dayjs";
|
|
4
|
+
|
|
5
|
+
interface TimePickerProps {
|
|
6
|
+
value?: Dayjs | null;
|
|
7
|
+
onChange: (newValue: Dayjs | null, timestring?: string) => void;
|
|
8
|
+
numberOfSelectsToHide?: number;
|
|
9
|
+
[key: string]: any; // Accept any additional props
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const TimePicker = ({
|
|
13
|
+
value,
|
|
14
|
+
onChange,
|
|
15
|
+
numberOfSelectsToHide = 2,
|
|
16
|
+
...rest
|
|
17
|
+
}: TimePickerProps) => {
|
|
18
|
+
const picker = useRef<any>();
|
|
19
|
+
const pickerSelectedTimes = useRef(0);
|
|
20
|
+
return (
|
|
21
|
+
<AntTimePicker
|
|
22
|
+
{...rest}
|
|
23
|
+
ref={picker}
|
|
24
|
+
value={value}
|
|
25
|
+
onChange={onChange}
|
|
26
|
+
showNow={false}
|
|
27
|
+
changeOnBlur={true}
|
|
28
|
+
onSelect={(newValue) => {
|
|
29
|
+
onChange?.(newValue);
|
|
30
|
+
pickerSelectedTimes.current += 1;
|
|
31
|
+
if (pickerSelectedTimes.current === numberOfSelectsToHide) {
|
|
32
|
+
picker.current?.blur();
|
|
33
|
+
pickerSelectedTimes.current = 0;
|
|
34
|
+
}
|
|
35
|
+
}}
|
|
36
|
+
/>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
@@ -48,7 +48,7 @@ export type ActionViewContextType = {
|
|
|
48
48
|
setSearchTreeNameSearch?: (searchString?: string) => void;
|
|
49
49
|
previousView?: View;
|
|
50
50
|
setPreviousView?: (view: View) => void;
|
|
51
|
-
goToResourceId?: (
|
|
51
|
+
goToResourceId?: (ids: number[]) => Promise<void>;
|
|
52
52
|
searchValues?: any;
|
|
53
53
|
setSearchValues?: (value: any) => void;
|
|
54
54
|
limit?: number;
|
|
@@ -105,7 +105,7 @@ const ActionViewProvider = (props: ActionViewProviderProps): any => {
|
|
|
105
105
|
const [previousView, setPreviousView] = useState<View>();
|
|
106
106
|
const [searchValues, setSearchValues] = useState<any>({});
|
|
107
107
|
const [limit, setLimit] = useState<number>(
|
|
108
|
-
limitProps !== undefined ? limitProps : DEFAULT_SEARCH_LIMIT
|
|
108
|
+
limitProps !== undefined ? limitProps : DEFAULT_SEARCH_LIMIT,
|
|
109
109
|
);
|
|
110
110
|
const [title, setTitle] = useState<string>(titleProps);
|
|
111
111
|
|
|
@@ -125,7 +125,9 @@ const ActionViewProvider = (props: ActionViewProviderProps): any => {
|
|
|
125
125
|
setPreviousView(availableViews[0]);
|
|
126
126
|
} else if (availableViews.length > 1) {
|
|
127
127
|
setPreviousView(
|
|
128
|
-
availableViews.filter(
|
|
128
|
+
availableViews.filter(
|
|
129
|
+
(view) => view.view_id !== currentView.view_id,
|
|
130
|
+
)[0],
|
|
129
131
|
);
|
|
130
132
|
}
|
|
131
133
|
}, [availableViews]);
|
|
@@ -136,7 +138,9 @@ const ActionViewProvider = (props: ActionViewProviderProps): any => {
|
|
|
136
138
|
availableViews.length > 1
|
|
137
139
|
) {
|
|
138
140
|
setPreviousView(
|
|
139
|
-
availableViews.filter(
|
|
141
|
+
availableViews.filter(
|
|
142
|
+
(view) => view.view_id !== currentView.view_id,
|
|
143
|
+
)[0],
|
|
140
144
|
);
|
|
141
145
|
}
|
|
142
146
|
}, [currentView]);
|
|
@@ -1,9 +1,28 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
2
|
|
|
3
3
|
interface ConfigContextProps {
|
|
4
|
-
|
|
4
|
+
erpFeatures: ErpFeaturesMap;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
export const ConfigContext = React.createContext<ConfigContextProps>({
|
|
8
|
-
|
|
8
|
+
erpFeatures: {},
|
|
9
9
|
});
|
|
10
|
+
|
|
11
|
+
// TODO: this should be defined in a third package, because we are duplicating it both in webclient and here
|
|
12
|
+
export enum ErpFeatureKeys {
|
|
13
|
+
FEATURE_ADVANCED_EXPORT = "export_data2",
|
|
14
|
+
// ... add more features here
|
|
15
|
+
}
|
|
16
|
+
// TODO: this should be defined in a third package, because we are duplicating it both in webclient and here
|
|
17
|
+
export type ErpFeaturesMap = {
|
|
18
|
+
[key in ErpFeatureKeys]?: boolean;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const useConfigContext = () => {
|
|
22
|
+
return useContext(ConfigContext);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const useFeatureIsEnabled = (featureKey: ErpFeatureKeys): boolean => {
|
|
26
|
+
const { erpFeatures } = useConfigContext();
|
|
27
|
+
return !!erpFeatures[featureKey];
|
|
28
|
+
};
|
|
@@ -10,9 +10,8 @@ export type DashboardActionContextType = {
|
|
|
10
10
|
setMoveItemsEnabled: (value: boolean) => void;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
export const DashboardActionContext =
|
|
14
|
-
null
|
|
15
|
-
);
|
|
13
|
+
export const DashboardActionContext =
|
|
14
|
+
React.createContext<DashboardActionContextType | null>(null);
|
|
16
15
|
|
|
17
16
|
type DashboardActionProviderProps = {
|
|
18
17
|
children: React.ReactNode;
|
|
@@ -4,9 +4,8 @@ export type FormModalContextType = {
|
|
|
4
4
|
setTitle?: (title: string) => void;
|
|
5
5
|
};
|
|
6
6
|
|
|
7
|
-
export const FormModalContext =
|
|
8
|
-
null
|
|
9
|
-
);
|
|
7
|
+
export const FormModalContext =
|
|
8
|
+
React.createContext<FormModalContextType | null>(null);
|
|
10
9
|
|
|
11
10
|
type FormModalProviderProps = FormModalContextType & {
|
|
12
11
|
children: React.ReactNode;
|
|
@@ -11,7 +11,7 @@ export type One2manyContextType = {
|
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
export const One2manyContext = React.createContext<One2manyContextType | null>(
|
|
14
|
-
null
|
|
14
|
+
null,
|
|
15
15
|
);
|
|
16
16
|
|
|
17
17
|
const One2manyProvider = ({
|
|
@@ -23,9 +23,8 @@ const One2manyProvider = ({
|
|
|
23
23
|
}): any => {
|
|
24
24
|
const [currentView, setCurrentView] = useState<ViewType>(initialView);
|
|
25
25
|
const [itemIndex, setItemIndex] = useState<number>(0);
|
|
26
|
-
const [manualTriggerChange, setManualTriggerChange] =
|
|
27
|
-
false
|
|
28
|
-
);
|
|
26
|
+
const [manualTriggerChange, setManualTriggerChange] =
|
|
27
|
+
useState<boolean>(false);
|
|
29
28
|
|
|
30
29
|
return (
|
|
31
30
|
<One2manyContext.Provider
|
|
@@ -72,7 +72,7 @@ const expandWidgetsIfNeeded = ({
|
|
|
72
72
|
|
|
73
73
|
const getSingleRowTemplateColumns = (
|
|
74
74
|
row: Widget[],
|
|
75
|
-
numberOfColumns: number
|
|
75
|
+
numberOfColumns: number,
|
|
76
76
|
) => {
|
|
77
77
|
const gridOptions = row.map((item: Widget) => {
|
|
78
78
|
if (item instanceof Label && (item as Label).fieldForLabel) {
|