@gisce/react-ooui 2.0.0-alpha.6 → 2.0.0-alpha.61
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} +26 -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
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import { memo, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
2
|
+
import { Pagination as AntPagination, Row, Col, Spin, Badge } from "antd";
|
|
3
|
+
import {
|
|
4
|
+
getTree,
|
|
5
|
+
getTableColumns,
|
|
6
|
+
getTableItems,
|
|
7
|
+
hasActualValues,
|
|
8
|
+
} from "@/helpers/treeHelper";
|
|
9
|
+
import { Tree as TreeOoui } from "@gisce/ooui";
|
|
10
|
+
import { TreeView } from "@/types";
|
|
11
|
+
import { LocaleContext, LocaleContextType } from "@/context/LocaleContext";
|
|
12
|
+
import { calculateColumnsWidth } from "@/helpers/dynamicColumnsHelper";
|
|
13
|
+
import { Table as GisceTable } from "@gisce/react-formiga-table";
|
|
14
|
+
import {
|
|
15
|
+
PlusSquareOutlined,
|
|
16
|
+
MinusSquareOutlined,
|
|
17
|
+
LoadingOutlined,
|
|
18
|
+
} from "@ant-design/icons";
|
|
19
|
+
import {
|
|
20
|
+
ActionViewContext,
|
|
21
|
+
ActionViewContextType,
|
|
22
|
+
} from "@/context/ActionViewContext";
|
|
23
|
+
import { SelectAllRecordsRow } from "@/common/SelectAllRecordsRow";
|
|
24
|
+
import { COLUMN_COMPONENTS } from "./treeComponents";
|
|
25
|
+
import ErrorBoundary from "antd/es/alert/ErrorBoundary";
|
|
26
|
+
|
|
27
|
+
type Props = {
|
|
28
|
+
total?: number;
|
|
29
|
+
limit: number;
|
|
30
|
+
page?: number;
|
|
31
|
+
loading: boolean;
|
|
32
|
+
treeView: TreeView;
|
|
33
|
+
results: any[];
|
|
34
|
+
showPagination?: boolean;
|
|
35
|
+
onRequestPageChange?: (page: number, pageSize?: number) => void;
|
|
36
|
+
onRowClicked?: (record: any) => void;
|
|
37
|
+
onRowSelectionChange?: (selectedRowKeys: any[]) => void;
|
|
38
|
+
selectedRowKeys?: number[];
|
|
39
|
+
scrollY?: number;
|
|
40
|
+
colorsForResults?: { [key: number]: string };
|
|
41
|
+
statusForResults?: { [key: number]: string };
|
|
42
|
+
onChangeSort?: (results: any) => void;
|
|
43
|
+
sorter?: any;
|
|
44
|
+
onFetchChildrenForRecord?: (item: any) => Promise<any[]>;
|
|
45
|
+
childField?: string;
|
|
46
|
+
rootTree?: boolean;
|
|
47
|
+
context?: any;
|
|
48
|
+
readonly?: boolean;
|
|
49
|
+
onSelectAllRecords?: () => Promise<void>;
|
|
50
|
+
};
|
|
51
|
+
export const Tree = memo((props: Props) => {
|
|
52
|
+
const {
|
|
53
|
+
page = 1,
|
|
54
|
+
limit,
|
|
55
|
+
total,
|
|
56
|
+
treeView,
|
|
57
|
+
results,
|
|
58
|
+
onRequestPageChange,
|
|
59
|
+
loading,
|
|
60
|
+
onRowClicked,
|
|
61
|
+
showPagination = true,
|
|
62
|
+
selectedRowKeys = [],
|
|
63
|
+
onRowSelectionChange,
|
|
64
|
+
scrollY,
|
|
65
|
+
colorsForResults = {},
|
|
66
|
+
statusForResults = {},
|
|
67
|
+
onChangeSort,
|
|
68
|
+
sorter,
|
|
69
|
+
onFetchChildrenForRecord,
|
|
70
|
+
childField,
|
|
71
|
+
rootTree = false,
|
|
72
|
+
context,
|
|
73
|
+
readonly,
|
|
74
|
+
onSelectAllRecords,
|
|
75
|
+
} = props;
|
|
76
|
+
|
|
77
|
+
const [items, setItems] = useState<any[]>([]);
|
|
78
|
+
|
|
79
|
+
const errorInParseColors = useRef<boolean>(false);
|
|
80
|
+
|
|
81
|
+
const [treeOoui, setTreeOoui] = useState<TreeOoui>();
|
|
82
|
+
|
|
83
|
+
const { t } = useContext(LocaleContext) as LocaleContextType;
|
|
84
|
+
const internalLimit = useRef(limit);
|
|
85
|
+
|
|
86
|
+
const actionViewContext = useContext(
|
|
87
|
+
ActionViewContext,
|
|
88
|
+
) as ActionViewContextType;
|
|
89
|
+
const { title = undefined, setTitle = undefined } =
|
|
90
|
+
(rootTree ? actionViewContext : {}) || {};
|
|
91
|
+
|
|
92
|
+
const columns = useMemo(() => {
|
|
93
|
+
if (!treeOoui) {
|
|
94
|
+
return undefined;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return getTableColumns(
|
|
98
|
+
treeOoui,
|
|
99
|
+
{
|
|
100
|
+
...COLUMN_COMPONENTS,
|
|
101
|
+
},
|
|
102
|
+
context,
|
|
103
|
+
);
|
|
104
|
+
}, [context, treeOoui]);
|
|
105
|
+
|
|
106
|
+
useEffect(() => {
|
|
107
|
+
const treeOoui = getTree(treeView);
|
|
108
|
+
setTreeOoui(treeOoui);
|
|
109
|
+
if (treeOoui.string && title !== treeOoui.string) {
|
|
110
|
+
setTitle?.(treeOoui.string);
|
|
111
|
+
}
|
|
112
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
113
|
+
}, [treeView, title]);
|
|
114
|
+
|
|
115
|
+
useEffect(() => {
|
|
116
|
+
if (!treeOoui) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
errorInParseColors.current = false;
|
|
120
|
+
const items = getTableItems(treeOoui, results);
|
|
121
|
+
setItems(items);
|
|
122
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
123
|
+
}, [results]);
|
|
124
|
+
|
|
125
|
+
useEffect(() => {
|
|
126
|
+
internalLimit.current = limit;
|
|
127
|
+
}, [limit]);
|
|
128
|
+
|
|
129
|
+
const from = (page - 1) * internalLimit.current + 1;
|
|
130
|
+
const to = from - 1 + items.length;
|
|
131
|
+
const summary =
|
|
132
|
+
total === undefined
|
|
133
|
+
? null
|
|
134
|
+
: total === 0
|
|
135
|
+
? t("no_results")
|
|
136
|
+
: t("summary")
|
|
137
|
+
.replace("{from}", from?.toString())
|
|
138
|
+
.replace("{to}", to?.toString())
|
|
139
|
+
.replace("{total}", total?.toString());
|
|
140
|
+
|
|
141
|
+
const pagination = useMemo(() => {
|
|
142
|
+
if (!showPagination || treeView.isExpandable) {
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const numberOfVisibleSelectedRows = items?.filter(
|
|
147
|
+
(entry) => selectedRowKeys && selectedRowKeys.includes(entry.id),
|
|
148
|
+
).length;
|
|
149
|
+
|
|
150
|
+
return loading ? null : total === undefined ? (
|
|
151
|
+
<Spin className="pb-4" />
|
|
152
|
+
) : (
|
|
153
|
+
<Row align="bottom" className="pb-4">
|
|
154
|
+
<Col span={onSelectAllRecords ? 8 : 12}>
|
|
155
|
+
<AntPagination
|
|
156
|
+
total={total}
|
|
157
|
+
pageSize={
|
|
158
|
+
internalLimit.current === 0 ? total : internalLimit.current
|
|
159
|
+
}
|
|
160
|
+
current={page}
|
|
161
|
+
showSizeChanger={false}
|
|
162
|
+
onChange={onRequestPageChange}
|
|
163
|
+
/>
|
|
164
|
+
</Col>
|
|
165
|
+
{onSelectAllRecords && (
|
|
166
|
+
<Col span={8} className="text-center">
|
|
167
|
+
<SelectAllRecordsRow
|
|
168
|
+
numberOfVisibleSelectedRows={numberOfVisibleSelectedRows}
|
|
169
|
+
numberOfRealSelectedRows={selectedRowKeys?.length || 0}
|
|
170
|
+
numberOfTotalRows={items.length}
|
|
171
|
+
totalRecords={total || 0}
|
|
172
|
+
onSelectAllRecords={onSelectAllRecords}
|
|
173
|
+
/>
|
|
174
|
+
</Col>
|
|
175
|
+
)}
|
|
176
|
+
<Col span={onSelectAllRecords ? 8 : 12} className="text-right">
|
|
177
|
+
{summary}
|
|
178
|
+
</Col>
|
|
179
|
+
</Row>
|
|
180
|
+
);
|
|
181
|
+
}, [
|
|
182
|
+
items,
|
|
183
|
+
loading,
|
|
184
|
+
onRequestPageChange,
|
|
185
|
+
onSelectAllRecords,
|
|
186
|
+
page,
|
|
187
|
+
selectedRowKeys,
|
|
188
|
+
showPagination,
|
|
189
|
+
summary,
|
|
190
|
+
total,
|
|
191
|
+
treeView.isExpandable,
|
|
192
|
+
]);
|
|
193
|
+
|
|
194
|
+
const sums = useMemo(() => {
|
|
195
|
+
if (!treeOoui) {
|
|
196
|
+
return null;
|
|
197
|
+
}
|
|
198
|
+
const sumFields = treeOoui.columns
|
|
199
|
+
.filter((it) => it.sum !== undefined)
|
|
200
|
+
.map((it) => {
|
|
201
|
+
return { label: it.sum, field: it.id };
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
if (!sumFields || sumFields.length === 0) {
|
|
205
|
+
return null;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
const summary: string[] = [];
|
|
209
|
+
const sumItems =
|
|
210
|
+
selectedRowKeys?.length > 0
|
|
211
|
+
? items.filter((result: any) => {
|
|
212
|
+
return selectedRowKeys.includes(result.id);
|
|
213
|
+
})
|
|
214
|
+
: items;
|
|
215
|
+
|
|
216
|
+
sumFields.forEach((sumField) => {
|
|
217
|
+
const total = sumItems.reduce((prev, current) => {
|
|
218
|
+
if (current[sumField.field] && !isNaN(current[sumField.field]))
|
|
219
|
+
return prev + current[sumField.field];
|
|
220
|
+
else return prev;
|
|
221
|
+
}, 0);
|
|
222
|
+
|
|
223
|
+
summary.push(`${sumField.label}: ${Math.round(total * 100) / 100}`);
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
return <div className="p-1 pb-0 pl-2 mt-2 ">{summary.join(", ")}</div>;
|
|
227
|
+
}, [items, selectedRowKeys, treeOoui]);
|
|
228
|
+
|
|
229
|
+
const dataTable = useMemo(() => {
|
|
230
|
+
if (treeOoui !== null && columns && columns.length > 0) {
|
|
231
|
+
const maxWidthPerCell = 600;
|
|
232
|
+
return calculateColumnsWidth(columns, items, maxWidthPerCell);
|
|
233
|
+
}
|
|
234
|
+
return undefined;
|
|
235
|
+
}, [columns, items, treeOoui]);
|
|
236
|
+
|
|
237
|
+
const adjustedHeight = useMemo(() => {
|
|
238
|
+
if (scrollY && treeOoui?.columns.some((it: any) => it.sum !== undefined)) {
|
|
239
|
+
return scrollY - 30;
|
|
240
|
+
}
|
|
241
|
+
return scrollY;
|
|
242
|
+
}, [scrollY, treeOoui?.columns]);
|
|
243
|
+
|
|
244
|
+
if (treeOoui === null || !dataTable || dataTable?.columns?.length === 0) {
|
|
245
|
+
return <Spin style={{ padding: "2rem" }} />;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
return (
|
|
249
|
+
<ErrorBoundary>
|
|
250
|
+
{pagination}
|
|
251
|
+
<GisceTable
|
|
252
|
+
height={adjustedHeight!}
|
|
253
|
+
columns={dataTable.columns}
|
|
254
|
+
dataSource={items}
|
|
255
|
+
loading={loading}
|
|
256
|
+
loadingComponent={<Spin />}
|
|
257
|
+
onRowStyle={(record: any) => {
|
|
258
|
+
if (colorsForResults![record.id]) {
|
|
259
|
+
return { color: colorsForResults![record.id] };
|
|
260
|
+
}
|
|
261
|
+
return undefined;
|
|
262
|
+
}}
|
|
263
|
+
onRowStatus={
|
|
264
|
+
hasActualValues(statusForResults)
|
|
265
|
+
? (record: any) => {
|
|
266
|
+
if (statusForResults![record.id]) {
|
|
267
|
+
return <Badge color={statusForResults[record.id]} />;
|
|
268
|
+
}
|
|
269
|
+
return undefined;
|
|
270
|
+
}
|
|
271
|
+
: undefined
|
|
272
|
+
}
|
|
273
|
+
onRowDoubleClick={onRowClicked}
|
|
274
|
+
onRowSelectionChange={onRowSelectionChange}
|
|
275
|
+
onChangeSort={onChangeSort}
|
|
276
|
+
sorter={sorter}
|
|
277
|
+
readonly={readonly}
|
|
278
|
+
expandableOpts={
|
|
279
|
+
onFetchChildrenForRecord
|
|
280
|
+
? {
|
|
281
|
+
expandIcon: PlusSquareOutlined,
|
|
282
|
+
collapseIcon: MinusSquareOutlined,
|
|
283
|
+
loadingIcon: LoadingOutlined,
|
|
284
|
+
onFetchChildrenForRecord,
|
|
285
|
+
childField: childField!,
|
|
286
|
+
}
|
|
287
|
+
: undefined
|
|
288
|
+
}
|
|
289
|
+
/>
|
|
290
|
+
{sums}
|
|
291
|
+
</ErrorBoundary>
|
|
292
|
+
);
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
Tree.displayName = "Tree";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Tree";
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import { ReactElement, useCallback, useEffect, useMemo, useState } from "react";
|
|
2
|
+
import { Checkbox, Spin } from "antd";
|
|
3
|
+
import { parseFloatToString } from "@/helpers/timeHelper";
|
|
4
|
+
import { ProgressBarInput } from "../../base/ProgressBar";
|
|
5
|
+
import { One2manyValue } from "../../base/one2many/One2manyInput";
|
|
6
|
+
import { Interweave } from "interweave";
|
|
7
|
+
import { Many2oneTree } from "../../base/many2one/Many2oneTree";
|
|
8
|
+
import { ReferenceTree } from "../../base/ReferenceTree";
|
|
9
|
+
import dayjs from "@/helpers/dayjs";
|
|
10
|
+
import Avatar from "../../custom/Avatar";
|
|
11
|
+
import { CustomTag, TagInput } from "../../custom/Tag";
|
|
12
|
+
import { DatePickerConfig } from "@/common/DatePicker";
|
|
13
|
+
import ConnectionProvider from "@/ConnectionProvider";
|
|
14
|
+
import { colorFromString } from "@/helpers/formHelper";
|
|
15
|
+
|
|
16
|
+
export const BooleanComponent = ({
|
|
17
|
+
value,
|
|
18
|
+
}: {
|
|
19
|
+
value: boolean;
|
|
20
|
+
}): ReactElement => {
|
|
21
|
+
return useMemo(
|
|
22
|
+
() => (
|
|
23
|
+
<div
|
|
24
|
+
style={{
|
|
25
|
+
display: "flex",
|
|
26
|
+
justifyContent: "center",
|
|
27
|
+
alignContent: "center",
|
|
28
|
+
}}
|
|
29
|
+
>
|
|
30
|
+
<Checkbox checked={value} disabled />
|
|
31
|
+
</div>
|
|
32
|
+
),
|
|
33
|
+
[value],
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const Many2OneComponent = ({ value }: { value: any }): ReactElement => {
|
|
38
|
+
return useMemo(() => <Many2oneTree m2oField={value} />, [value]);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const TextComponent = ({ value }: { value: any }): ReactElement => {
|
|
42
|
+
return useMemo(
|
|
43
|
+
() => (
|
|
44
|
+
<Interweave
|
|
45
|
+
content={value?.toString().replace(/(?:\r\n|\r|\n)/g, "<br>")}
|
|
46
|
+
/>
|
|
47
|
+
),
|
|
48
|
+
[value],
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const DateComponent = ({ value }: { value: any }): ReactElement => {
|
|
53
|
+
return useMemo(() => {
|
|
54
|
+
if (!value || (value && value.length === 0)) return <></>;
|
|
55
|
+
|
|
56
|
+
const formattedValue = dayjs(
|
|
57
|
+
value,
|
|
58
|
+
DatePickerConfig.date.dateInternalFormat,
|
|
59
|
+
).format(DatePickerConfig.date.dateDisplayFormat);
|
|
60
|
+
return <>{formattedValue}</>;
|
|
61
|
+
}, [value]);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const DateTimeComponent = ({ value }: { value: any }): ReactElement => {
|
|
65
|
+
return useMemo(() => {
|
|
66
|
+
if (!value || (value && value.length === 0)) return <></>;
|
|
67
|
+
const formattedValue = dayjs(
|
|
68
|
+
value,
|
|
69
|
+
DatePickerConfig.time.dateInternalFormat,
|
|
70
|
+
).format(DatePickerConfig.time.dateDisplayFormat);
|
|
71
|
+
return <>{formattedValue}</>;
|
|
72
|
+
}, [value]);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export const One2ManyComponent = ({
|
|
76
|
+
value,
|
|
77
|
+
}: {
|
|
78
|
+
value: One2manyValue;
|
|
79
|
+
}): ReactElement => {
|
|
80
|
+
return useMemo(() => {
|
|
81
|
+
const length = Array.isArray(value?.items) ? value?.items.length : 0;
|
|
82
|
+
return <>{`( ${length} )`}</>;
|
|
83
|
+
}, [value]);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export const ProgressBarComponent = ({
|
|
87
|
+
value,
|
|
88
|
+
}: {
|
|
89
|
+
value: any;
|
|
90
|
+
}): ReactElement => {
|
|
91
|
+
return useMemo(() => <ProgressBarInput value={value} />, [value]);
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export const FloatTimeComponent = ({ value }: { value: any }): ReactElement => {
|
|
95
|
+
return useMemo(() => <>{parseFloatToString(value)}</>, [value]);
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export const NumberComponent = ({ value }: { value: number }): ReactElement => {
|
|
99
|
+
return useMemo(
|
|
100
|
+
() => <div style={{ textAlign: "right" }}>{value}</div>,
|
|
101
|
+
[value],
|
|
102
|
+
);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export const ImageComponent = ({ value }: { value: string }): ReactElement => {
|
|
106
|
+
return useMemo(
|
|
107
|
+
() => (
|
|
108
|
+
<img
|
|
109
|
+
src={`data:image/*;base64,${value}`}
|
|
110
|
+
style={{ maxWidth: "50px", padding: "5px" }}
|
|
111
|
+
/>
|
|
112
|
+
),
|
|
113
|
+
[value],
|
|
114
|
+
);
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export const TagComponent = ({
|
|
118
|
+
value,
|
|
119
|
+
key,
|
|
120
|
+
ooui,
|
|
121
|
+
context,
|
|
122
|
+
}: {
|
|
123
|
+
value: any;
|
|
124
|
+
key: string;
|
|
125
|
+
ooui: any;
|
|
126
|
+
context: any;
|
|
127
|
+
}): ReactElement => {
|
|
128
|
+
return useMemo(() => <TagInput ooui={ooui} value={value} />, [ooui, value]);
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export const SelectionComponent = ({
|
|
132
|
+
value,
|
|
133
|
+
key,
|
|
134
|
+
ooui,
|
|
135
|
+
context,
|
|
136
|
+
}: {
|
|
137
|
+
value: any;
|
|
138
|
+
key: string;
|
|
139
|
+
ooui: any;
|
|
140
|
+
context: any;
|
|
141
|
+
}): ReactElement => {
|
|
142
|
+
return useMemo(() => <>{ooui.selectionValues.get(value)}</>, [ooui, value]);
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
export const ReferenceComponent = ({
|
|
146
|
+
value,
|
|
147
|
+
key,
|
|
148
|
+
ooui,
|
|
149
|
+
context,
|
|
150
|
+
}: {
|
|
151
|
+
value: any;
|
|
152
|
+
key: string;
|
|
153
|
+
ooui: any;
|
|
154
|
+
context: any;
|
|
155
|
+
}): ReactElement => {
|
|
156
|
+
return useMemo(
|
|
157
|
+
() => (
|
|
158
|
+
<ReferenceTree
|
|
159
|
+
value={value}
|
|
160
|
+
selectionValues={ooui.selectionValues}
|
|
161
|
+
context={context}
|
|
162
|
+
/>
|
|
163
|
+
),
|
|
164
|
+
[context, ooui.selectionValues, value],
|
|
165
|
+
);
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
export const AvatarComponent = ({
|
|
169
|
+
value,
|
|
170
|
+
key,
|
|
171
|
+
ooui,
|
|
172
|
+
context,
|
|
173
|
+
}: {
|
|
174
|
+
value: any;
|
|
175
|
+
key: string;
|
|
176
|
+
ooui: any;
|
|
177
|
+
context: any;
|
|
178
|
+
}): ReactElement => {
|
|
179
|
+
return useMemo(() => <Avatar ooui={ooui} value={value} />, [ooui, value]);
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
export const TagsComponent = ({
|
|
183
|
+
value,
|
|
184
|
+
key,
|
|
185
|
+
ooui,
|
|
186
|
+
context,
|
|
187
|
+
}: {
|
|
188
|
+
value: any;
|
|
189
|
+
key: string;
|
|
190
|
+
ooui: any;
|
|
191
|
+
context: any;
|
|
192
|
+
}): ReactElement => {
|
|
193
|
+
const [values, setValues] = useState<Array<{ id: number; name: string }>>([]);
|
|
194
|
+
const [loading, setLoading] = useState<boolean>(false);
|
|
195
|
+
const { relation, field } = ooui;
|
|
196
|
+
|
|
197
|
+
const loadValues = useCallback(async () => {
|
|
198
|
+
try {
|
|
199
|
+
setLoading(true);
|
|
200
|
+
const optionsRead = await ConnectionProvider.getHandler().search({
|
|
201
|
+
model: relation,
|
|
202
|
+
params: [["id", "in", value.items.map((v: any) => v.id)]],
|
|
203
|
+
fields: [field],
|
|
204
|
+
context,
|
|
205
|
+
});
|
|
206
|
+
setValues(
|
|
207
|
+
optionsRead.map((i: any) => {
|
|
208
|
+
const { id, name } = i;
|
|
209
|
+
return { id, name };
|
|
210
|
+
}),
|
|
211
|
+
);
|
|
212
|
+
} catch (error) {
|
|
213
|
+
console.error("Error loading data", error);
|
|
214
|
+
} finally {
|
|
215
|
+
setLoading(false);
|
|
216
|
+
}
|
|
217
|
+
}, [context, field, relation, value.items]);
|
|
218
|
+
|
|
219
|
+
useEffect(() => {
|
|
220
|
+
if (value?.items && value?.items.length > 0) {
|
|
221
|
+
loadValues();
|
|
222
|
+
}
|
|
223
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
224
|
+
}, [value?.items]);
|
|
225
|
+
|
|
226
|
+
const tags = useMemo(
|
|
227
|
+
() =>
|
|
228
|
+
values.map((entry) => {
|
|
229
|
+
const { id, name } = entry;
|
|
230
|
+
const color = colorFromString(name);
|
|
231
|
+
return (
|
|
232
|
+
<CustomTag key={`${id}`} color={color}>
|
|
233
|
+
{name}
|
|
234
|
+
</CustomTag>
|
|
235
|
+
);
|
|
236
|
+
}),
|
|
237
|
+
[values],
|
|
238
|
+
);
|
|
239
|
+
|
|
240
|
+
return useMemo(() => {
|
|
241
|
+
if (loading) {
|
|
242
|
+
return <Spin />;
|
|
243
|
+
}
|
|
244
|
+
return (
|
|
245
|
+
<div
|
|
246
|
+
style={{
|
|
247
|
+
maxWidth: "300px",
|
|
248
|
+
whiteSpace: "break-spaces",
|
|
249
|
+
lineHeight: "30px",
|
|
250
|
+
}}
|
|
251
|
+
>
|
|
252
|
+
{tags}
|
|
253
|
+
</div>
|
|
254
|
+
);
|
|
255
|
+
}, [tags, loading]);
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
export const COLUMN_COMPONENTS = {
|
|
259
|
+
boolean: BooleanComponent,
|
|
260
|
+
many2one: Many2OneComponent,
|
|
261
|
+
text: TextComponent,
|
|
262
|
+
one2many: One2ManyComponent,
|
|
263
|
+
many2many: One2ManyComponent,
|
|
264
|
+
progressbar: ProgressBarComponent,
|
|
265
|
+
float_time: FloatTimeComponent,
|
|
266
|
+
image: ImageComponent,
|
|
267
|
+
integer: NumberComponent,
|
|
268
|
+
float: NumberComponent,
|
|
269
|
+
reference: ReferenceComponent,
|
|
270
|
+
tag: TagComponent,
|
|
271
|
+
selection: SelectionComponent,
|
|
272
|
+
date: DateComponent,
|
|
273
|
+
datetime: DateTimeComponent,
|
|
274
|
+
avatar: AvatarComponent,
|
|
275
|
+
tags: TagsComponent,
|
|
276
|
+
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { DatePicker,
|
|
2
|
-
|
|
3
|
-
import React from "react";
|
|
1
|
+
import { DatePicker, Row, Col } from "antd";
|
|
4
2
|
import Field from "@/common/Field";
|
|
5
3
|
import { Field as FieldOoui, Label as LabelOoui } from "@gisce/ooui";
|
|
6
4
|
import { WidgetProps } from "@/types";
|
|
7
5
|
import Label from "@/widgets/base/Label";
|
|
6
|
+
import { TimePicker } from "../../../common/TimePicker";
|
|
8
7
|
|
|
9
8
|
export const DateTimeRangePicker = (props: WidgetProps) => {
|
|
10
9
|
const { ooui, showLabel = false } = props;
|
|
@@ -48,14 +47,41 @@ export const DateTimeRangePicker = (props: WidgetProps) => {
|
|
|
48
47
|
</Col>
|
|
49
48
|
<Col>
|
|
50
49
|
<Field {...props} ooui={fields[1]} showLabel={false}>
|
|
51
|
-
<
|
|
52
|
-
className="w-60"
|
|
53
|
-
allowEmpty={[true, true]}
|
|
54
|
-
format={"HH:mm"}
|
|
55
|
-
></TimePicker.RangePicker>
|
|
50
|
+
<TimeRangePicker />
|
|
56
51
|
</Field>
|
|
57
52
|
</Col>
|
|
58
53
|
</Row>
|
|
59
54
|
</>
|
|
60
55
|
);
|
|
61
56
|
};
|
|
57
|
+
|
|
58
|
+
const TimeRangePicker = ({
|
|
59
|
+
value,
|
|
60
|
+
onChange,
|
|
61
|
+
}: {
|
|
62
|
+
value?: any;
|
|
63
|
+
onChange?: (newValue: any) => void;
|
|
64
|
+
}) => {
|
|
65
|
+
return (
|
|
66
|
+
<div style={{ marginTop: 5 }}>
|
|
67
|
+
<TimePicker
|
|
68
|
+
placeholder="Start time"
|
|
69
|
+
format={"HH:mm"}
|
|
70
|
+
style={{ width: 115, marginRight: 10 }}
|
|
71
|
+
value={value?.[0]}
|
|
72
|
+
onChange={(newValue) => {
|
|
73
|
+
onChange?.([newValue, value?.[1]]);
|
|
74
|
+
}}
|
|
75
|
+
/>
|
|
76
|
+
<TimePicker
|
|
77
|
+
placeholder="End time"
|
|
78
|
+
style={{ width: 115 }}
|
|
79
|
+
format={"HH:mm"}
|
|
80
|
+
value={value?.[1]}
|
|
81
|
+
onChange={(newValue) => {
|
|
82
|
+
onChange?.([value?.[0], newValue]);
|
|
83
|
+
}}
|
|
84
|
+
/>
|
|
85
|
+
</div>
|
|
86
|
+
);
|
|
87
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactElement, useContext } from "react";
|
|
2
2
|
|
|
3
3
|
import { Row, Col, Button } from "antd";
|
|
4
4
|
import {
|
|
@@ -17,13 +17,9 @@ type Props = {
|
|
|
17
17
|
onClear: () => void;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
export function SearchBottomBar(props: Props):
|
|
21
|
-
const {
|
|
22
|
-
|
|
23
|
-
advancedFilter,
|
|
24
|
-
onClear,
|
|
25
|
-
isSearching,
|
|
26
|
-
} = props;
|
|
20
|
+
export function SearchBottomBar(props: Props): ReactElement {
|
|
21
|
+
const { onAdvancedFilterToggle, advancedFilter, onClear, isSearching } =
|
|
22
|
+
props;
|
|
27
23
|
|
|
28
24
|
const { t } = useContext(LocaleContext) as LocaleContextType;
|
|
29
25
|
|
|
@@ -8,7 +8,11 @@ import { PairFields } from "./PairFields";
|
|
|
8
8
|
|
|
9
9
|
import { LocaleContext, LocaleContextType } from "@/context/LocaleContext";
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
Field,
|
|
13
|
+
SearchFieldTypes,
|
|
14
|
+
Selection as SelectionOoui,
|
|
15
|
+
} from "@gisce/ooui";
|
|
12
16
|
import { MultiSelection } from "@/widgets/base/MultiSelection";
|
|
13
17
|
|
|
14
18
|
type Props = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useEffect, useRef, useState } from "react";
|
|
2
2
|
import { Form, Row, Col, Alert, theme } from "antd";
|
|
3
3
|
import useDeepCompareEffect from "use-deep-compare-effect";
|
|
4
4
|
|
|
@@ -60,6 +60,7 @@ function SearchFilter(props: Props) {
|
|
|
60
60
|
|
|
61
61
|
useEffect(() => {
|
|
62
62
|
form.setFieldsValue(searchValues);
|
|
63
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
63
64
|
}, [searchValues]);
|
|
64
65
|
|
|
65
66
|
const getRowsAndCols = () => {
|
|
@@ -101,7 +102,7 @@ function SearchFilter(props: Props) {
|
|
|
101
102
|
delete values.limit;
|
|
102
103
|
const newParams = getParamsForFields(
|
|
103
104
|
values,
|
|
104
|
-
sfo.current?._advancedSearchContainer
|
|
105
|
+
sfo.current?._advancedSearchContainer,
|
|
105
106
|
);
|
|
106
107
|
|
|
107
108
|
onSubmit({ params: newParams, offset, limit, searchValues: values });
|