@sapui5/sap.fe.macros 1.141.2 → 1.143.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/sap/fe/macros/.library +1 -1
- package/src/sap/fe/macros/Breadcrumbs.js +4 -10
- package/src/sap/fe/macros/Breadcrumbs.tsx +2 -8
- package/src/sap/fe/macros/Chart.js +34 -23
- package/src/sap/fe/macros/Chart.tsx +25 -11
- package/src/sap/fe/macros/CollaborativeDraftHandler.js +47 -36
- package/src/sap/fe/macros/CollaborativeDraftHandler.tsx +50 -31
- package/src/sap/fe/macros/CollectionBindingInfo.js +8 -2
- package/src/sap/fe/macros/CollectionBindingInfo.ts +11 -6
- package/src/sap/fe/macros/CommonHelper.js +14 -24
- package/src/sap/fe/macros/CommonHelper.ts +18 -25
- package/src/sap/fe/macros/ConditionalSwitch.js +1 -2
- package/src/sap/fe/macros/ConditionalSwitch.tsx +0 -1
- package/src/sap/fe/macros/ConditionalSwitchProperty.js +1 -3
- package/src/sap/fe/macros/ConditionalSwitchProperty.tsx +0 -2
- package/src/sap/fe/macros/Field.js +34 -17
- package/src/sap/fe/macros/Field.ts +64 -32
- package/src/sap/fe/macros/FooterContent.js +7 -3
- package/src/sap/fe/macros/FooterContent.tsx +8 -13
- package/src/sap/fe/macros/KPITag.js +6 -6
- package/src/sap/fe/macros/KPITag.tsx +8 -6
- package/src/sap/fe/macros/MacroAPI.js +4 -3
- package/src/sap/fe/macros/MacroAPI.ts +3 -3
- package/src/sap/fe/macros/MessageButton.js +4 -3
- package/src/sap/fe/macros/MessageButton.tsx +7 -3
- package/src/sap/fe/macros/MicroChart.js +12 -7
- package/src/sap/fe/macros/MicroChart.tsx +9 -3
- package/src/sap/fe/macros/MultiValueField.js +22 -36
- package/src/sap/fe/macros/MultiValueField.tsx +34 -66
- package/src/sap/fe/macros/RichTextEditor.js +3 -4
- package/src/sap/fe/macros/RichTextEditor.tsx +2 -3
- package/src/sap/fe/macros/Share.js +7 -7
- package/src/sap/fe/macros/Share.tsx +9 -6
- package/src/sap/fe/macros/Status.js +39 -11
- package/src/sap/fe/macros/Status.tsx +25 -5
- package/src/sap/fe/macros/ValueHelp.js +5 -2
- package/src/sap/fe/macros/ValueHelp.tsx +5 -0
- package/src/sap/fe/macros/ai/EasyFillDialog.js +2 -1
- package/src/sap/fe/macros/ai/EasyFillDialog.tsx +1 -0
- package/src/sap/fe/macros/ai/EasyFilterBar.js +7 -34
- package/src/sap/fe/macros/ai/EasyFilterBar.tsx +6 -35
- package/src/sap/fe/macros/ai/EasyFilterDataFetcher.js +31 -7
- package/src/sap/fe/macros/ai/EasyFilterDataFetcher.ts +33 -6
- package/src/sap/fe/macros/ai/SummarizationButton.js +6 -4
- package/src/sap/fe/macros/ai/SummarizationButton.tsx +5 -3
- package/src/sap/fe/macros/chart/Action.js +25 -2
- package/src/sap/fe/macros/chart/Action.ts +13 -0
- package/src/sap/fe/macros/chart/ActionGroup.js +25 -2
- package/src/sap/fe/macros/chart/ActionGroup.ts +13 -0
- package/src/sap/fe/macros/chart/ChartDelegate.js +29 -8
- package/src/sap/fe/macros/chart/ChartDelegate.ts +46 -14
- package/src/sap/fe/macros/chart/MdcChartTemplate.js +58 -12
- package/src/sap/fe/macros/chart/MdcChartTemplate.tsx +75 -13
- package/src/sap/fe/macros/chart/OverflowGroup.js +62 -0
- package/src/sap/fe/macros/chart/OverflowGroup.ts +22 -0
- package/src/sap/fe/macros/controls/BuildingBlockObjectProperty.js +7 -7
- package/src/sap/fe/macros/controls/BuildingBlockObjectProperty.ts +3 -2
- package/src/sap/fe/macros/controls/FileWrapper.js +11 -5
- package/src/sap/fe/macros/controls/FileWrapper.ts +10 -4
- package/src/sap/fe/macros/controls/FilterBar.js +39 -3
- package/src/sap/fe/macros/controls/FilterBar.ts +42 -1
- package/src/sap/fe/macros/controls/NumberWithUnitOrCurrency.js +3 -1
- package/src/sap/fe/macros/controls/NumberWithUnitOrCurrency.tsx +2 -0
- package/src/sap/fe/macros/controls/RadioButtons.js +18 -5
- package/src/sap/fe/macros/controls/RadioButtons.tsx +10 -1
- package/src/sap/fe/macros/coreUI/CreateDialog.js +3 -3
- package/src/sap/fe/macros/coreUI/CreateDialog.tsx +2 -2
- package/src/sap/fe/macros/coreUI/OperationParameterDialog.js +40 -12
- package/src/sap/fe/macros/coreUI/OperationParameterDialog.tsx +48 -9
- package/src/sap/fe/macros/draftIndicator/DraftIndicator.js +4 -2
- package/src/sap/fe/macros/draftIndicator/DraftIndicator.tsx +3 -1
- package/src/sap/fe/macros/field/FieldFormatOptions.js +4 -4
- package/src/sap/fe/macros/field/FieldFormatOptions.ts +2 -2
- package/src/sap/fe/macros/field/FieldHelper.js +4 -3
- package/src/sap/fe/macros/field/FieldHelper.ts +7 -1
- package/src/sap/fe/macros/field/FieldRuntime.js +44 -9
- package/src/sap/fe/macros/field/FieldRuntime.ts +72 -8
- package/src/sap/fe/macros/field/FieldRuntimeHelper.js +3 -34
- package/src/sap/fe/macros/field/FieldRuntimeHelper.ts +28 -53
- package/src/sap/fe/macros/field/FieldTemplating.js +5 -4
- package/src/sap/fe/macros/field/FieldTemplating.ts +6 -4
- package/src/sap/fe/macros/filter/FilterFieldHelper.js +6 -4
- package/src/sap/fe/macros/filter/FilterFieldHelper.ts +7 -2
- package/src/sap/fe/macros/filter/FilterUtils.js +130 -40
- package/src/sap/fe/macros/filter/FilterUtils.ts +167 -45
- package/src/sap/fe/macros/filterBar/ExtendedSemanticDateOperators.js +2 -2
- package/src/sap/fe/macros/filterBar/ExtendedSemanticDateOperators.ts +1 -1
- package/src/sap/fe/macros/filterBar/FilterBar.block.js +4 -3
- package/src/sap/fe/macros/filterBar/FilterBar.block.tsx +19 -8
- package/src/sap/fe/macros/filterBar/FilterBarAPI.js +15 -9
- package/src/sap/fe/macros/filterBar/FilterBarAPI.ts +36 -17
- package/src/sap/fe/macros/filterBar/FilterBarDelegate.js +21 -10
- package/src/sap/fe/macros/filterBar/FilterBarDelegate.ts +81 -63
- package/src/sap/fe/macros/filterBar/UOMValidationDelegate.js +376 -0
- package/src/sap/fe/macros/filterBar/UOMValidationDelegate.ts +463 -0
- package/src/sap/fe/macros/filterBar/mixin/FilterBarAPIStateHandler.js +4 -3
- package/src/sap/fe/macros/filterBar/mixin/FilterBarAPIStateHandler.ts +3 -2
- package/src/sap/fe/macros/form/Form.block.js +27 -2
- package/src/sap/fe/macros/form/Form.block.ts +31 -11
- package/src/sap/fe/macros/form/FormActionButtons.fragment.xml +13 -3
- package/src/sap/fe/macros/form/FormContainer.block.js +110 -63
- package/src/sap/fe/macros/form/FormContainer.block.ts +121 -64
- package/src/sap/fe/macros/formatters/TableFormatter.js +13 -10
- package/src/sap/fe/macros/formatters/TableFormatter.ts +11 -9
- package/src/sap/fe/macros/formatters/VisualFilterFormatter.js +6 -4
- package/src/sap/fe/macros/formatters/VisualFilterFormatter.ts +5 -5
- package/src/sap/fe/macros/inlineEdit/InlineEdit.js +5 -5
- package/src/sap/fe/macros/inlineEdit/InlineEdit.ts +4 -4
- package/src/sap/fe/macros/insights/InsightsService.js +3 -2
- package/src/sap/fe/macros/insights/InsightsService.ts +2 -1
- package/src/sap/fe/macros/internal/DataPoint.js +7 -8
- package/src/sap/fe/macros/internal/DataPoint.tsx +6 -9
- package/src/sap/fe/macros/internal/field/DisplayStyle.js +8 -6
- package/src/sap/fe/macros/internal/field/DisplayStyle.tsx +7 -8
- package/src/sap/fe/macros/internal/field/EditStyle.js +9 -20
- package/src/sap/fe/macros/internal/field/EditStyle.tsx +17 -41
- package/src/sap/fe/macros/internal/field/FieldBlockStructure.js +2 -2
- package/src/sap/fe/macros/internal/field/FieldBlockStructure.tsx +1 -1
- package/src/sap/fe/macros/internal/field/FieldStructure.js +1 -2
- package/src/sap/fe/macros/internal/field/FieldStructure.tsx +0 -2
- package/src/sap/fe/macros/internal/field/FieldStructureHelper.js +7 -7
- package/src/sap/fe/macros/internal/field/FieldStructureHelper.ts +17 -11
- package/src/sap/fe/macros/internal/helpers/DataPointTemplating.js +6 -2
- package/src/sap/fe/macros/internal/helpers/DataPointTemplating.ts +5 -1
- package/src/sap/fe/macros/internal/valuehelp/AdditionalValueFormatter.js +9 -6
- package/src/sap/fe/macros/internal/valuehelp/AdditionalValueFormatter.ts +7 -5
- package/src/sap/fe/macros/internal/valuehelp/TableDelegate.js +4 -4
- package/src/sap/fe/macros/internal/valuehelp/TableDelegate.ts +6 -6
- package/src/sap/fe/macros/internal/valuehelp/ValueListDialogTable.fragment.xml +5 -2
- package/src/sap/fe/macros/internal/valuehelp/ValueListHelper.js +2 -2
- package/src/sap/fe/macros/internal/valuehelp/ValueListHelper.ts +2 -1
- package/src/sap/fe/macros/library.js +5 -6
- package/src/sap/fe/macros/{library.ts → library.tsx} +3 -1
- package/src/sap/fe/macros/mdc/adapter/StateHelper.js +15 -5
- package/src/sap/fe/macros/mdc/adapter/StateHelper.ts +21 -5
- package/src/sap/fe/macros/messagebundle.properties +13 -5
- package/src/sap/fe/macros/messagebundle_ar.properties +12 -3
- package/src/sap/fe/macros/messagebundle_bg.properties +13 -4
- package/src/sap/fe/macros/messagebundle_ca.properties +12 -3
- package/src/sap/fe/macros/messagebundle_cnr.properties +12 -3
- package/src/sap/fe/macros/messagebundle_cs.properties +11 -2
- package/src/sap/fe/macros/messagebundle_cy.properties +12 -3
- package/src/sap/fe/macros/messagebundle_da.properties +12 -3
- package/src/sap/fe/macros/messagebundle_de.properties +16 -7
- package/src/sap/fe/macros/messagebundle_el.properties +13 -4
- package/src/sap/fe/macros/messagebundle_en.properties +13 -4
- package/src/sap/fe/macros/messagebundle_en_GB.properties +13 -4
- package/src/sap/fe/macros/messagebundle_en_US_saprigi.properties +13 -4
- package/src/sap/fe/macros/messagebundle_es.properties +12 -3
- package/src/sap/fe/macros/messagebundle_es_MX.properties +12 -3
- package/src/sap/fe/macros/messagebundle_et.properties +12 -3
- package/src/sap/fe/macros/messagebundle_fi.properties +12 -3
- package/src/sap/fe/macros/messagebundle_fr.properties +12 -3
- package/src/sap/fe/macros/messagebundle_fr_CA.properties +12 -3
- package/src/sap/fe/macros/messagebundle_hi.properties +12 -3
- package/src/sap/fe/macros/messagebundle_hr.properties +13 -4
- package/src/sap/fe/macros/messagebundle_hu.properties +12 -3
- package/src/sap/fe/macros/messagebundle_id.properties +18 -9
- package/src/sap/fe/macros/messagebundle_it.properties +12 -3
- package/src/sap/fe/macros/messagebundle_iw.properties +12 -3
- package/src/sap/fe/macros/messagebundle_ja.properties +12 -3
- package/src/sap/fe/macros/messagebundle_kk.properties +11 -2
- package/src/sap/fe/macros/messagebundle_ko.properties +13 -4
- package/src/sap/fe/macros/messagebundle_lt.properties +12 -3
- package/src/sap/fe/macros/messagebundle_lv.properties +12 -3
- package/src/sap/fe/macros/messagebundle_mk.properties +12 -3
- package/src/sap/fe/macros/messagebundle_ms.properties +12 -3
- package/src/sap/fe/macros/messagebundle_nl.properties +12 -3
- package/src/sap/fe/macros/messagebundle_no.properties +12 -3
- package/src/sap/fe/macros/messagebundle_pl.properties +12 -3
- package/src/sap/fe/macros/messagebundle_pt.properties +12 -3
- package/src/sap/fe/macros/messagebundle_pt_PT.properties +12 -3
- package/src/sap/fe/macros/messagebundle_ro.properties +13 -4
- package/src/sap/fe/macros/messagebundle_ru.properties +12 -3
- package/src/sap/fe/macros/messagebundle_sh.properties +12 -3
- package/src/sap/fe/macros/messagebundle_sk.properties +12 -3
- package/src/sap/fe/macros/messagebundle_sl.properties +13 -4
- package/src/sap/fe/macros/messagebundle_sr.properties +12 -3
- package/src/sap/fe/macros/messagebundle_sv.properties +12 -3
- package/src/sap/fe/macros/messagebundle_th.properties +11 -2
- package/src/sap/fe/macros/messagebundle_tr.properties +12 -3
- package/src/sap/fe/macros/messagebundle_uk.properties +12 -3
- package/src/sap/fe/macros/messagebundle_vi.properties +13 -4
- package/src/sap/fe/macros/messagebundle_zh_CN.properties +12 -3
- package/src/sap/fe/macros/messagebundle_zh_TW.properties +12 -3
- package/src/sap/fe/macros/messages/MessageButton.js +21 -12
- package/src/sap/fe/macros/messages/MessageButton.ts +21 -11
- package/src/sap/fe/macros/multivaluefield/MultiValueFieldDelegate.js +7 -3
- package/src/sap/fe/macros/multivaluefield/MultiValueFieldDelegate.ts +8 -2
- package/src/sap/fe/macros/quickView/QuickView.js +5 -4
- package/src/sap/fe/macros/quickView/QuickView.tsx +10 -3
- package/src/sap/fe/macros/richtexteditor/ButtonGroup.js +2 -2
- package/src/sap/fe/macros/richtexteditor/ButtonGroup.ts +2 -2
- package/src/sap/fe/macros/table/Action.js +21 -5
- package/src/sap/fe/macros/table/Action.ts +14 -4
- package/src/sap/fe/macros/table/ActionGroup.js +15 -2
- package/src/sap/fe/macros/table/ActionGroup.ts +8 -0
- package/src/sap/fe/macros/table/ActionGroupOverride.js +14 -2
- package/src/sap/fe/macros/table/ActionGroupOverride.ts +7 -0
- package/src/sap/fe/macros/table/ActionOverride.js +14 -2
- package/src/sap/fe/macros/table/ActionOverride.ts +7 -0
- package/src/sap/fe/macros/table/ActionsTemplating.js +16 -2
- package/src/sap/fe/macros/table/ActionsTemplating.tsx +15 -0
- package/src/sap/fe/macros/table/Column.js +3 -2
- package/src/sap/fe/macros/table/Column.ts +1 -1
- package/src/sap/fe/macros/table/MdcTableTemplate.js +96 -18
- package/src/sap/fe/macros/table/MdcTableTemplate.tsx +136 -17
- package/src/sap/fe/macros/table/OverflowGroups.js +59 -0
- package/src/sap/fe/macros/table/OverflowGroups.ts +27 -0
- package/src/sap/fe/macros/table/Table.block.js +74 -30
- package/src/sap/fe/macros/table/Table.block.tsx +77 -14
- package/src/sap/fe/macros/table/TableAPI.js +175 -132
- package/src/sap/fe/macros/table/TableAPI.ts +67 -30
- package/src/sap/fe/macros/table/TableDefinition.js +20 -3
- package/src/sap/fe/macros/table/TableDefinition.ts +18 -2
- package/src/sap/fe/macros/table/TableEventHandlerProvider.js +6 -3
- package/src/sap/fe/macros/table/TableEventHandlerProvider.ts +12 -9
- package/src/sap/fe/macros/table/TableHelper.js +5 -2
- package/src/sap/fe/macros/table/TableHelper.ts +5 -2
- package/src/sap/fe/macros/table/TableRuntime.js +25 -13
- package/src/sap/fe/macros/table/TableRuntime.ts +31 -17
- package/src/sap/fe/macros/table/TableSizeHelper.js +4 -4
- package/src/sap/fe/macros/table/TableSizeHelper.ts +6 -11
- package/src/sap/fe/macros/table/Utils.js +9 -3
- package/src/sap/fe/macros/table/Utils.ts +14 -8
- package/src/sap/fe/macros/table/delegates/TableDelegate.js +72 -29
- package/src/sap/fe/macros/table/delegates/TableDelegate.ts +114 -123
- package/src/sap/fe/macros/table/massEdit/MassEditDialog.js +41 -15
- package/src/sap/fe/macros/table/massEdit/MassEditDialog.tsx +41 -22
- package/src/sap/fe/macros/table/massEdit/MassEditDialogHelper.js +15 -6
- package/src/sap/fe/macros/table/massEdit/MassEditDialogHelper.tsx +14 -5
- package/src/sap/fe/macros/table/massEdit/MassEditField.js +1 -1
- package/src/sap/fe/macros/table/massEdit/MassEditField.tsx +3 -6
- package/src/sap/fe/macros/table/mixin/ContextMenuHandler.js +2 -3
- package/src/sap/fe/macros/table/mixin/ContextMenuHandler.ts +3 -2
- package/src/sap/fe/macros/table/mixin/EmptyRowsHandler.js +42 -14
- package/src/sap/fe/macros/table/mixin/EmptyRowsHandler.ts +49 -19
- package/src/sap/fe/macros/table/mixin/TableAPIStateHandler.js +7 -9
- package/src/sap/fe/macros/table/mixin/TableAPIStateHandler.ts +7 -8
- package/src/sap/fe/macros/table/mixin/TableExport.js +1 -1
- package/src/sap/fe/macros/table/mixin/TableExport.ts +3 -3
- package/src/sap/fe/macros/table/mixin/TableHierarchy.js +3 -4
- package/src/sap/fe/macros/table/mixin/TableHierarchy.ts +2 -3
- package/src/sap/fe/macros/table/uploadTable/UploadTableRuntime.js +5 -4
- package/src/sap/fe/macros/table/uploadTable/UploadTableRuntime.ts +6 -3
- package/src/sap/fe/macros/valuehelp/ValueHelpDelegate.js +17 -10
- package/src/sap/fe/macros/valuehelp/ValueHelpDelegate.ts +24 -9
- package/src/sap/fe/macros/visualfilters/InteractiveChartHelper.js +4 -4
- package/src/sap/fe/macros/visualfilters/InteractiveChartHelper.ts +3 -3
- package/src/sap/fe/macros/visualfilters/VisualFilter.js +20 -2
- package/src/sap/fe/macros/visualfilters/VisualFilter.tsx +28 -6
- package/src/sap/fe/macros/visualfilters/VisualFilterRuntime.js +6 -3
- package/src/sap/fe/macros/visualfilters/VisualFilterRuntime.ts +4 -3
- package/src/sap/fe/macros/visualfilters/fragments/InteractiveCharts.js +3 -3
- package/src/sap/fe/macros/visualfilters/fragments/InteractiveCharts.tsx +10 -4
- package/src/sap/fe/macros/visualfilters/fragments/InteractiveDonutChart.fragment.xml +1 -1
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { EntitySet, NavigationProperty, Property } from "@sap-ux/vocabularies-types";
|
|
2
|
+
import type {
|
|
3
|
+
ConnectedFields,
|
|
4
|
+
DataField,
|
|
5
|
+
DataFieldAbstractTypes,
|
|
6
|
+
DataFieldForAnnotation,
|
|
7
|
+
DataPointType,
|
|
8
|
+
FieldGroupType
|
|
9
|
+
} from "@sap-ux/vocabularies-types/vocabularies/UI";
|
|
2
10
|
import Log from "sap/base/Log";
|
|
3
11
|
import deepEqual from "sap/base/util/deepEqual";
|
|
4
12
|
import deepExtend from "sap/base/util/deepExtend";
|
|
@@ -11,12 +19,12 @@ import type { FEView } from "sap/fe/core/BaseController";
|
|
|
11
19
|
import type { BaseTreeModifier } from "sap/fe/core/CommonUtils";
|
|
12
20
|
import CommonUtils from "sap/fe/core/CommonUtils";
|
|
13
21
|
import type TemplateComponent from "sap/fe/core/TemplateComponent";
|
|
22
|
+
import CollaborationManager from "sap/fe/core/controllerextensions/cards/CollaborationManager";
|
|
14
23
|
import type { ListReportManifestSettings } from "sap/fe/core/converters/ManifestSettings";
|
|
24
|
+
import * as MetaModelConverter from "sap/fe/core/converters/MetaModelConverter";
|
|
15
25
|
import { getInvolvedDataModelObjects } from "sap/fe/core/converters/MetaModelConverter";
|
|
16
|
-
import type {
|
|
17
|
-
|
|
18
|
-
import type { EntitySet, NavigationProperty } from "@sap-ux/vocabularies-types";
|
|
19
|
-
import CollaborationManager from "sap/fe/core/controllerextensions/cards/CollaborationManager";
|
|
26
|
+
import type { PageContextPathTarget } from "sap/fe/core/converters/TemplateConverter";
|
|
27
|
+
import FilterRestrictions from "sap/fe/core/converters/controls/Common/filter/FilterRestrictions";
|
|
20
28
|
import type {
|
|
21
29
|
AnnotationTableColumn,
|
|
22
30
|
ColumnExportSettings,
|
|
@@ -26,6 +34,7 @@ import type {
|
|
|
26
34
|
} from "sap/fe/core/converters/controls/Common/table/Columns";
|
|
27
35
|
import { ColumnType } from "sap/fe/core/converters/controls/Common/table/Columns";
|
|
28
36
|
import type { CustomElement } from "sap/fe/core/converters/helpers/ConfigurableObject";
|
|
37
|
+
import { getConnectedFieldsData, getConnectedFieldsSeparator } from "sap/fe/core/converters/helpers/DataFieldHelper";
|
|
29
38
|
import ValueFormatter from "sap/fe/core/formatters/ValueFormatter";
|
|
30
39
|
import DeleteHelper from "sap/fe/core/helpers/DeleteHelper";
|
|
31
40
|
import ExcelFormat from "sap/fe/core/helpers/ExcelFormatHelper";
|
|
@@ -34,10 +43,11 @@ import ModelHelper from "sap/fe/core/helpers/ModelHelper";
|
|
|
34
43
|
import PromiseKeeper from "sap/fe/core/helpers/PromiseKeeper";
|
|
35
44
|
import { getLocalizedText, getResourceModel } from "sap/fe/core/helpers/ResourceModelHelper";
|
|
36
45
|
import SizeHelper from "sap/fe/core/helpers/SizeHelper";
|
|
46
|
+
import type { WrappedCard } from "sap/fe/core/services/CollaborationManagerServiceFactory";
|
|
37
47
|
import type { DataModelObjectPath } from "sap/fe/core/templating/DataModelPathHelper";
|
|
38
48
|
import { isPathFilterable } from "sap/fe/core/templating/DataModelPathHelper";
|
|
39
49
|
import { isTypeFilterable } from "sap/fe/core/type/EDM";
|
|
40
|
-
import type {
|
|
50
|
+
import type { SerializedCollectionBindingInfo } from "sap/fe/macros/CollectionBindingInfo";
|
|
41
51
|
import CollectionBindingInfoAPI from "sap/fe/macros/CollectionBindingInfo";
|
|
42
52
|
import CommonHelper from "sap/fe/macros/CommonHelper";
|
|
43
53
|
import DelegateUtil from "sap/fe/macros/DelegateUtil";
|
|
@@ -58,7 +68,6 @@ import IllustratedMessageType from "sap/m/IllustratedMessageType";
|
|
|
58
68
|
import type { BaseAggregationBindingInfo } from "sap/ui/base/ManagedObject";
|
|
59
69
|
import UI5Element from "sap/ui/core/Element";
|
|
60
70
|
import Fragment from "sap/ui/core/Fragment";
|
|
61
|
-
import type View from "sap/ui/core/mvc/View";
|
|
62
71
|
import XMLPreprocessor from "sap/ui/core/util/XMLPreprocessor";
|
|
63
72
|
import type { JsControlTreeModifier } from "sap/ui/core/util/reflection";
|
|
64
73
|
import type Control from "sap/ui/mdc/Control";
|
|
@@ -79,12 +88,17 @@ import type ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
|
|
|
79
88
|
import type ODataModel from "sap/ui/model/odata/v4/ODataModel";
|
|
80
89
|
import type QuickFilterSelector from "../QuickFilterSelector";
|
|
81
90
|
import TableEventHandlerProvider from "../TableEventHandlerProvider";
|
|
82
|
-
|
|
83
91
|
const SEMANTICKEY_HAS_DRAFTINDICATOR = "/semanticKeyHasDraftIndicator";
|
|
84
92
|
const SEARCH_HAS_BEEN_FIRED = "searchFired";
|
|
85
93
|
const COLUMN_HAS_BEEN_ADDED = "columnAdded";
|
|
86
94
|
const PREVIOUS_SORTERS = "previousSorters";
|
|
87
95
|
|
|
96
|
+
async function delayFor(delay: number): Promise<void> {
|
|
97
|
+
return new Promise<void>((resolve) => {
|
|
98
|
+
setTimeout(resolve, delay);
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
|
|
88
102
|
/**
|
|
89
103
|
* Helper class for sap.ui.mdc.Table.
|
|
90
104
|
* <h3><b>Note:</b></h3>
|
|
@@ -137,10 +151,11 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
137
151
|
case "com.sap.vocabularies.UI.v1.DataField":
|
|
138
152
|
oDataFieldWidth = TableSizeHelper.getWidthForDataField(
|
|
139
153
|
oData,
|
|
140
|
-
showDataFieldsLabel,
|
|
141
154
|
propertyInfos,
|
|
142
155
|
convertedMetaData,
|
|
143
|
-
false
|
|
156
|
+
false,
|
|
157
|
+
involvedDataModelObjects as DataModelObjectPath<Property | DataFieldAbstractTypes | DataPointType>,
|
|
158
|
+
showDataFieldsLabel
|
|
144
159
|
);
|
|
145
160
|
break;
|
|
146
161
|
case "com.sap.vocabularies.UI.v1.DataFieldForAction":
|
|
@@ -166,7 +181,54 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
166
181
|
});
|
|
167
182
|
}
|
|
168
183
|
},
|
|
169
|
-
|
|
184
|
+
/**
|
|
185
|
+
* This function calculates the width of a ConnectedFields column.
|
|
186
|
+
* The width of the ConnectedFields is the sum of the width of the 2 properties contained in the ConnectedFields
|
|
187
|
+
* The result of this calculation is stored in the visualSettings.widthCalculation.minWidth property, which is used by the MDCtable.
|
|
188
|
+
* @param table Instance of the MDCtable
|
|
189
|
+
* @param propertyInfo Current propertyInfo
|
|
190
|
+
* @param propertyInfos Array of properties
|
|
191
|
+
* @private
|
|
192
|
+
* @alias sap.fe.macros.TableDelegate
|
|
193
|
+
*/
|
|
194
|
+
_computeVisualSettingsForConnectedField: function (
|
|
195
|
+
table: Table,
|
|
196
|
+
propertyInfo: EnhancedFEPropertyInfo,
|
|
197
|
+
propertyInfos: EnhancedFEPropertyInfo[]
|
|
198
|
+
) {
|
|
199
|
+
if (propertyInfo.key.indexOf("DataFieldForAnnotation::ConnectedFields::") === 0) {
|
|
200
|
+
const metaModel = (table.getModel() as ODataModel).getMetaModel();
|
|
201
|
+
const involvedDataModelObjects = getInvolvedDataModelObjects(metaModel.getContext(propertyInfo.annotationPath));
|
|
202
|
+
const convertedMetaData = involvedDataModelObjects.convertedTypes;
|
|
203
|
+
const dataField = involvedDataModelObjects.targetObject as DataFieldForAnnotation;
|
|
204
|
+
const connectedFields = dataField.Target.$target as ConnectedFields;
|
|
205
|
+
const connectedFieldsSeparator = getConnectedFieldsSeparator(connectedFields);
|
|
206
|
+
const fieldWidths: number[] = [];
|
|
207
|
+
getConnectedFieldsData(connectedFields).forEach(function (data: DataFieldAbstractTypes) {
|
|
208
|
+
const dataFieldWidth = TableSizeHelper.getWidthForDataField(
|
|
209
|
+
data as DataField,
|
|
210
|
+
propertyInfos,
|
|
211
|
+
convertedMetaData,
|
|
212
|
+
false,
|
|
213
|
+
involvedDataModelObjects as DataModelObjectPath<Property | DataFieldAbstractTypes | DataPointType>
|
|
214
|
+
);
|
|
215
|
+
if (dataFieldWidth) {
|
|
216
|
+
fieldWidths.push(dataFieldWidth.propertyWidth);
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
const separatorWidth = SizeHelper.getButtonWidth(connectedFieldsSeparator);
|
|
220
|
+
fieldWidths.push(separatorWidth);
|
|
221
|
+
const columnWidth = fieldWidths.reduce(function (acc: number, value: number) {
|
|
222
|
+
return acc + value;
|
|
223
|
+
}, 0);
|
|
224
|
+
propertyInfo.visualSettings = deepExtend(propertyInfo.visualSettings as object, {
|
|
225
|
+
widthCalculation: {
|
|
226
|
+
verticalArrangement: true,
|
|
227
|
+
minWidth: Math.ceil(columnWidth)
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
},
|
|
170
232
|
_computeVisualSettingsForPropertyWithValueHelp: function (table: Table, property: EnhancedFEPropertyInfo) {
|
|
171
233
|
const tableAPI = this._getTableAPI(table);
|
|
172
234
|
if (!property.propertyInfos) {
|
|
@@ -183,7 +245,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
183
245
|
}
|
|
184
246
|
}
|
|
185
247
|
},
|
|
186
|
-
|
|
187
248
|
_computeVisualSettingsForPropertyWithUnit: function (
|
|
188
249
|
table: Table,
|
|
189
250
|
propertyInfo: PropertyInfo,
|
|
@@ -210,7 +271,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
210
271
|
});
|
|
211
272
|
}
|
|
212
273
|
},
|
|
213
|
-
|
|
214
274
|
_computeLabel: function (property: EnhancedFEPropertyInfo, labelMap: { [label: string]: EnhancedFEPropertyInfo[] }) {
|
|
215
275
|
if (property.label) {
|
|
216
276
|
const propertiesWithSameLabel = labelMap[property.label];
|
|
@@ -252,12 +312,14 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
252
312
|
});
|
|
253
313
|
properties.forEach((property) => {
|
|
254
314
|
this._computeVisualSettingsForFieldGroup(table, property, properties);
|
|
315
|
+
this._computeVisualSettingsForConnectedField(table, property, properties);
|
|
255
316
|
this._computeVisualSettingsForPropertyWithValueHelp(table, property);
|
|
256
317
|
this._computeLabel(property, labelMap);
|
|
257
318
|
});
|
|
258
319
|
// Add the $editState property
|
|
259
320
|
properties.push({
|
|
260
321
|
key: "$editState",
|
|
322
|
+
name: "$editState",
|
|
261
323
|
path: "$editState",
|
|
262
324
|
groupLabel: "",
|
|
263
325
|
group: "",
|
|
@@ -270,7 +332,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
270
332
|
} as EnhancedFEPropertyInfo);
|
|
271
333
|
return properties;
|
|
272
334
|
},
|
|
273
|
-
|
|
274
335
|
_getTableAPI(table: Table): TableAPI {
|
|
275
336
|
let tableAPI: TableAPI | undefined = table.getParent() as TableAPI;
|
|
276
337
|
if (!tableAPI) {
|
|
@@ -278,12 +339,10 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
278
339
|
}
|
|
279
340
|
return tableAPI;
|
|
280
341
|
},
|
|
281
|
-
|
|
282
342
|
getColumnsFor: function (table: Table): TableColumn[] {
|
|
283
343
|
const tableAPI = this._getTableAPI(table);
|
|
284
344
|
return tableAPI.getTableDefinition().columns;
|
|
285
345
|
},
|
|
286
|
-
|
|
287
346
|
/**
|
|
288
347
|
* Returns the export capabilities for the given sap.ui.mdc.Table instance.
|
|
289
348
|
* @param oTable Instance of the table
|
|
@@ -319,7 +378,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
319
378
|
return oCapabilities;
|
|
320
379
|
});
|
|
321
380
|
},
|
|
322
|
-
|
|
323
381
|
/**
|
|
324
382
|
* Filtering on navigation properties that are not part of the LineItem annotation nor of the custom columns is forbidden.
|
|
325
383
|
* @param columnInfo
|
|
@@ -337,7 +395,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
337
395
|
!(isConstant(isFilterable) && isFilterable.value === false))
|
|
338
396
|
);
|
|
339
397
|
},
|
|
340
|
-
|
|
341
398
|
_fetchPropertyInfo: function (
|
|
342
399
|
metaModel: MetaModel,
|
|
343
400
|
columnInfo: AnnotationTableColumn,
|
|
@@ -379,23 +436,19 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
379
436
|
// if I set this clipBoardSettings the copy provider extract the data according to the template in the html property and it is properly copied in excel
|
|
380
437
|
// but when we copy elsewhere we only get the raw data and not the templated data
|
|
381
438
|
}
|
|
382
|
-
|
|
383
439
|
// Set visualSettings only if it exists
|
|
384
440
|
if (columnInfo.visualSettings && Object.keys(columnInfo.visualSettings).length > 0) {
|
|
385
441
|
propertyInfo.visualSettings = columnInfo.visualSettings;
|
|
386
442
|
}
|
|
387
|
-
|
|
388
443
|
if (columnInfo.exportDataPointTargetValue) {
|
|
389
444
|
propertyInfo.exportDataPointTargetValue = columnInfo.exportDataPointTargetValue;
|
|
390
445
|
}
|
|
391
|
-
|
|
392
446
|
// MDC expects 'propertyInfos' only for complex properties.
|
|
393
447
|
// An empty array throws validation error and undefined value is unhandled.
|
|
394
448
|
if (columnInfo.propertyInfos?.length) {
|
|
395
449
|
propertyInfo.propertyInfos = columnInfo.propertyInfos;
|
|
396
450
|
} else {
|
|
397
451
|
// Add properties which are supported only by simple PropertyInfos.
|
|
398
|
-
|
|
399
452
|
//get the DataModelObjectPath for the column
|
|
400
453
|
const columnDataModelObjectPath = getInvolvedDataModelObjects(
|
|
401
454
|
metaModel.getContext(columnInfo.annotationPath),
|
|
@@ -429,12 +482,9 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
429
482
|
});
|
|
430
483
|
}
|
|
431
484
|
}
|
|
432
|
-
|
|
433
485
|
this._computeVisualSettingsForPropertyWithUnit(table, propertyInfo, columnInfo.unit, columnInfo.unitText, columnInfo.timezoneText);
|
|
434
|
-
|
|
435
486
|
return propertyInfo;
|
|
436
487
|
},
|
|
437
|
-
|
|
438
488
|
/**
|
|
439
489
|
* Extend the export settings based on the column info.
|
|
440
490
|
* @param exportSettings The export settings to be extended
|
|
@@ -451,7 +501,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
451
501
|
}
|
|
452
502
|
return exportSettings;
|
|
453
503
|
},
|
|
454
|
-
|
|
455
504
|
/**
|
|
456
505
|
* Gets the type config for the given column info.
|
|
457
506
|
* @param columnInfo The columnInfo object.
|
|
@@ -488,7 +537,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
488
537
|
}
|
|
489
538
|
propertyInfo.text = columnInfo.textArrangement?.textProperty;
|
|
490
539
|
},
|
|
491
|
-
|
|
492
540
|
_updateAnalyticalPropertyInfoAttributes(propertyInfo: PropertyInfo, columnInfo: AnnotationTableColumn) {
|
|
493
541
|
if (columnInfo.aggregatable) {
|
|
494
542
|
propertyInfo.aggregatable = columnInfo.aggregatable;
|
|
@@ -497,7 +545,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
497
545
|
propertyInfo.extension = columnInfo.extension;
|
|
498
546
|
}
|
|
499
547
|
},
|
|
500
|
-
|
|
501
548
|
_fetchComputedPropertyInfo: function (columnInfo: ComputedTableColumn, table: Table) {
|
|
502
549
|
const label = getLocalizedText(columnInfo.label, table); // Todo: To be removed once MDC provides translation support
|
|
503
550
|
const propertyInfo: PropertyInfo = {
|
|
@@ -516,11 +563,12 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
516
563
|
}
|
|
517
564
|
return propertyInfo;
|
|
518
565
|
},
|
|
519
|
-
|
|
520
566
|
_fetchCustomPropertyInfo: function (columnInfo: CustomBasedTableColumn, table: Table, appComponent: AppComponent) {
|
|
521
567
|
let label;
|
|
522
568
|
if (columnInfo.header) {
|
|
523
|
-
if (columnInfo.header.
|
|
569
|
+
if (columnInfo.header.binding) {
|
|
570
|
+
label = columnInfo.header.binding.getExternalValue();
|
|
571
|
+
} else if (columnInfo.header.startsWith("{metaModel>")) {
|
|
524
572
|
label = ModelHelper.fetchTextFromMetaModel(columnInfo.header, undefined, (table.getModel() as ODataModel).getMetaModel());
|
|
525
573
|
} else {
|
|
526
574
|
label = getLocalizedText(columnInfo.header, appComponent); // Todo: To be removed once MDC provides translation support
|
|
@@ -536,7 +584,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
536
584
|
exportSettings: columnInfo.exportSettings,
|
|
537
585
|
visualSettings: columnInfo.visualSettings as PropertyInfo["visualSettings"]
|
|
538
586
|
};
|
|
539
|
-
|
|
540
587
|
// MDC expects 'propertyInfos' only for complex properties.
|
|
541
588
|
// An empty array throws validation error and undefined value is unhandled.
|
|
542
589
|
if (columnInfo.propertyInfos && columnInfo.propertyInfos.length) {
|
|
@@ -580,9 +627,11 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
580
627
|
appComponent: AppComponent
|
|
581
628
|
): Promise<PropertyInfo[]> {
|
|
582
629
|
// when fetching properties, this binding context is needed - so lets create it only once and use if for all properties/data-fields/line-items
|
|
583
|
-
const bindingPath = ModelHelper.getEntitySetPath(entityTypePath);
|
|
584
630
|
let fetchedProperties: PropertyInfo[] = [];
|
|
585
|
-
const
|
|
631
|
+
const dataModel = MetaModelConverter.getInvolvedDataModelObjects(metaModel.getContext(entityTypePath));
|
|
632
|
+
const nonFilterableProperties = FilterRestrictions.getFilterRestrictionsByDataModel(
|
|
633
|
+
dataModel as DataModelObjectPath<PageContextPathTarget>
|
|
634
|
+
).NonFilterableProperties;
|
|
586
635
|
return Promise.resolve(this.getColumnsFor(table))
|
|
587
636
|
.then((columns: TableColumn[]) => {
|
|
588
637
|
// DraftAdministrativeData does not work via 'entitySet/$NavigationPropertyBinding/DraftAdministrativeData'
|
|
@@ -626,7 +675,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
626
675
|
return fetchedProperties;
|
|
627
676
|
});
|
|
628
677
|
},
|
|
629
|
-
|
|
630
678
|
_getCachedOrFetchPropertiesForEntity: async function (
|
|
631
679
|
table: Table,
|
|
632
680
|
entityTypePath: string,
|
|
@@ -638,6 +686,10 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
638
686
|
if (fetchedProperties.length) {
|
|
639
687
|
return Promise.resolve(fetchedProperties);
|
|
640
688
|
}
|
|
689
|
+
if (appComponent.delayTime > 0) {
|
|
690
|
+
// First call let's add a small delay to ensure this doesn't block the initial view creation
|
|
691
|
+
await delayFor(appComponent.delayTime);
|
|
692
|
+
}
|
|
641
693
|
return this._fetchPropertiesForEntity(table, entityTypePath, metaModel, appComponent).then(function (
|
|
642
694
|
subFetchedProperties: PropertyInfo[]
|
|
643
695
|
) {
|
|
@@ -661,28 +713,25 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
661
713
|
table.setNoData(illustratedMessage);
|
|
662
714
|
}
|
|
663
715
|
},
|
|
664
|
-
|
|
665
|
-
setTableNoDataIllustratedMessage: function (table: Table, bindingInfo: CollectionBindingInfo) {
|
|
716
|
+
setTableNoDataIllustratedMessage: function (table: Table, bindingInfo: SerializedCollectionBindingInfo) {
|
|
666
717
|
const tableFilterInfo = TableUtils.getAllFilterInfo(table);
|
|
667
718
|
const resourceModel = getResourceModel(table);
|
|
668
719
|
const suffixResourceKey = bindingInfo.path?.startsWith("/") ? bindingInfo.path.substring(1) : bindingInfo.path;
|
|
669
720
|
let illustratedInformation: $IllustratedMessageSettings;
|
|
670
|
-
|
|
671
721
|
const getNoDataIllustratedMessageWithFilters = function (): $IllustratedMessageSettings {
|
|
672
722
|
if (table.data("hiddenFilters") || table.getQuickFilter()) {
|
|
673
723
|
return {
|
|
674
|
-
title: resourceModel.getText("T_ILLUSTRATED_MESSAGE_TITLE_NOSEARCHRESULTS"),
|
|
724
|
+
title: resourceModel.getText("T_ILLUSTRATED_MESSAGE_TITLE_NOSEARCHRESULTS", undefined, suffixResourceKey),
|
|
675
725
|
description: resourceModel.getText("M_TABLE_AND_CHART_NO_DATA_TEXT_MULTI_VIEW", undefined, suffixResourceKey),
|
|
676
|
-
illustrationType: IllustratedMessageType.
|
|
726
|
+
illustrationType: IllustratedMessageType.NoFilterResults
|
|
677
727
|
};
|
|
678
728
|
}
|
|
679
729
|
return {
|
|
680
|
-
title: resourceModel.getText("T_ILLUSTRATED_MESSAGE_TITLE_NOSEARCHRESULTS"),
|
|
730
|
+
title: resourceModel.getText("T_ILLUSTRATED_MESSAGE_TITLE_NOSEARCHRESULTS", undefined, suffixResourceKey),
|
|
681
731
|
description: resourceModel.getText("T_TABLE_AND_CHART_NO_DATA_TEXT_WITH_FILTER", undefined, suffixResourceKey),
|
|
682
|
-
illustrationType: IllustratedMessageType.
|
|
732
|
+
illustrationType: IllustratedMessageType.NoFilterResults
|
|
683
733
|
};
|
|
684
734
|
};
|
|
685
|
-
|
|
686
735
|
const filterAssociation = table.getFilter();
|
|
687
736
|
const hasFilterOrSearch = tableFilterInfo.search || tableFilterInfo.filters?.length;
|
|
688
737
|
if (filterAssociation && !/BasicSearch$/.test(filterAssociation)) {
|
|
@@ -692,9 +741,9 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
692
741
|
illustratedInformation = getNoDataIllustratedMessageWithFilters();
|
|
693
742
|
} else {
|
|
694
743
|
illustratedInformation = {
|
|
695
|
-
title: resourceModel.getText("T_ILLUSTRATED_MESSAGE_TITLE_NOSEARCHRESULTS"),
|
|
744
|
+
title: resourceModel.getText("T_ILLUSTRATED_MESSAGE_TITLE_NOSEARCHRESULTS", undefined, suffixResourceKey),
|
|
696
745
|
description: resourceModel.getText("T_TABLE_AND_CHART_NO_DATA_TEXT", undefined, suffixResourceKey),
|
|
697
|
-
illustrationType: IllustratedMessageType.
|
|
746
|
+
illustrationType: IllustratedMessageType.NoFilterResults
|
|
698
747
|
};
|
|
699
748
|
}
|
|
700
749
|
} else if (hasFilterOrSearch) {
|
|
@@ -702,9 +751,9 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
702
751
|
illustratedInformation = getNoDataIllustratedMessageWithFilters();
|
|
703
752
|
} else {
|
|
704
753
|
illustratedInformation = {
|
|
705
|
-
title: resourceModel.getText("T_ILLUSTRATED_MESSAGE_TITLE_NODATA"),
|
|
754
|
+
title: resourceModel.getText("T_ILLUSTRATED_MESSAGE_TITLE_NODATA", undefined, suffixResourceKey),
|
|
706
755
|
description: resourceModel.getText("M_TABLE_AND_CHART_NO_FILTERS_NO_DATA_TEXT", undefined, suffixResourceKey),
|
|
707
|
-
illustrationType: IllustratedMessageType.
|
|
756
|
+
illustrationType: IllustratedMessageType.NoEntries
|
|
708
757
|
};
|
|
709
758
|
}
|
|
710
759
|
if (CommonUtils.getTargetView(table).getViewData().liveMode) {
|
|
@@ -712,15 +761,14 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
712
761
|
illustratedInformation = getNoDataIllustratedMessageWithFilters();
|
|
713
762
|
} else {
|
|
714
763
|
illustratedInformation = {
|
|
715
|
-
title: resourceModel.getText("T_ILLUSTRATED_MESSAGE_TITLE_NOSEARCHRESULTS"),
|
|
716
|
-
description: resourceModel.getText("M_TABLE_AND_CHART_NO_FILTERS_NO_DATA_TEXT"),
|
|
717
|
-
illustrationType: IllustratedMessageType.
|
|
764
|
+
title: resourceModel.getText("T_ILLUSTRATED_MESSAGE_TITLE_NOSEARCHRESULTS", undefined, suffixResourceKey),
|
|
765
|
+
description: resourceModel.getText("M_TABLE_AND_CHART_NO_FILTERS_NO_DATA_TEXT", undefined, suffixResourceKey),
|
|
766
|
+
illustrationType: IllustratedMessageType.NoFilterResults
|
|
718
767
|
};
|
|
719
768
|
}
|
|
720
769
|
}
|
|
721
770
|
const tableAPI = this._getTableAPI(table);
|
|
722
771
|
illustratedInformation.illustrationSize = tableAPI.getNoDataMessageMode();
|
|
723
|
-
|
|
724
772
|
if (illustratedInformation.illustrationSize === "text") {
|
|
725
773
|
const currentNoData = table.getNoData();
|
|
726
774
|
if (typeof currentNoData === "string" && currentNoData === illustratedInformation.description) {
|
|
@@ -732,7 +780,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
732
780
|
this.setNoDataInformation(table, illustratedInformation);
|
|
733
781
|
}
|
|
734
782
|
},
|
|
735
|
-
|
|
736
783
|
/**
|
|
737
784
|
* Handles the dataRequested event for the table binding to set up table defaults.
|
|
738
785
|
* @param oTable The MDC table instance
|
|
@@ -748,7 +795,7 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
748
795
|
setTimeout(() => {
|
|
749
796
|
oInternalModelContext.setProperty("dataRequestedTimeoutSet", false);
|
|
750
797
|
const oTableAPI = oTable ? (oTable.getParent() as TableAPI) : null;
|
|
751
|
-
if (oTableAPI) {
|
|
798
|
+
if (oTableAPI && CommonUtils.getIsEditable(oTable)) {
|
|
752
799
|
oTableAPI.tableDefaultsPromise = (oTableAPI.getTableDefaults(oTable) ?? Promise.resolve({})) as Promise<object>;
|
|
753
800
|
}
|
|
754
801
|
}, 0);
|
|
@@ -757,7 +804,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
757
804
|
oInternalModelContext.setProperty("dataRequestedAttached", true);
|
|
758
805
|
}
|
|
759
806
|
},
|
|
760
|
-
|
|
761
807
|
handleTableDataReceived: function (oTable: Table, oInternalModelContext: InternalModelContext): void {
|
|
762
808
|
const oBinding = oTable && oTable.getRowBinding(),
|
|
763
809
|
bDataReceivedAttached = oInternalModelContext && oInternalModelContext.getProperty("dataReceivedAttached");
|
|
@@ -789,7 +835,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
789
835
|
oInternalModelContext.setProperty("dataReceivedAttached", true);
|
|
790
836
|
}
|
|
791
837
|
},
|
|
792
|
-
|
|
793
838
|
/**
|
|
794
839
|
* Set the optimistic batch promise for the enabler callback function.
|
|
795
840
|
* @param controller The controller
|
|
@@ -802,7 +847,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
802
847
|
this.setOptimisticBatchForModel(controller, model, tableAPI);
|
|
803
848
|
}
|
|
804
849
|
},
|
|
805
|
-
|
|
806
850
|
/**
|
|
807
851
|
* Enable the optimistic batch mode if available.
|
|
808
852
|
* @param controller
|
|
@@ -814,7 +858,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
814
858
|
const tableAPI = this._getTableAPI(table);
|
|
815
859
|
tableAPI.getOptimisticBatchEnablerPromise()?.resolve(!filtersPropertiesAsPotentiallySensitiveDataOrDateType);
|
|
816
860
|
},
|
|
817
|
-
|
|
818
861
|
/**
|
|
819
862
|
* Setter for the optimistic batch enabler callback function.
|
|
820
863
|
* @param controller
|
|
@@ -831,10 +874,8 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
831
874
|
});
|
|
832
875
|
}
|
|
833
876
|
},
|
|
834
|
-
|
|
835
877
|
rebind: async function (oTable: Table, oBindingInfo: BaseAggregationBindingInfo): Promise<void> {
|
|
836
878
|
const tableAPI = this._getTableAPI(oTable);
|
|
837
|
-
|
|
838
879
|
const bIsSuspended = tableAPI?.getProperty("bindingSuspended");
|
|
839
880
|
tableAPI?.setProperty("outDatedBinding", bIsSuspended);
|
|
840
881
|
if (!bIsSuspended) {
|
|
@@ -853,7 +894,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
853
894
|
}
|
|
854
895
|
return Promise.resolve();
|
|
855
896
|
},
|
|
856
|
-
|
|
857
897
|
/**
|
|
858
898
|
* Fetches the relevant metadata for the table and returns property info array.
|
|
859
899
|
* @param table Instance of the MDCtable
|
|
@@ -875,7 +915,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
875
915
|
return properties;
|
|
876
916
|
});
|
|
877
917
|
},
|
|
878
|
-
|
|
879
918
|
preInit: async function (table: Table): Promise<void> {
|
|
880
919
|
return (TableDelegateBase.preInit as (table: Table) => Promise<void>).apply(this, [table]).then(() => {
|
|
881
920
|
/**
|
|
@@ -890,7 +929,7 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
890
929
|
return;
|
|
891
930
|
});
|
|
892
931
|
},
|
|
893
|
-
updateBindingInfo: function (table: Table, bindingInfo:
|
|
932
|
+
updateBindingInfo: function (table: Table, bindingInfo: SerializedCollectionBindingInfo) {
|
|
894
933
|
const internalBindingContext = table.getBindingContext("internal") as InternalModelContext | undefined;
|
|
895
934
|
const tableAPI = this._getTableAPI(table);
|
|
896
935
|
const quickFilter = table.getQuickFilter() as QuickFilterSelector | undefined;
|
|
@@ -903,7 +942,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
903
942
|
this.setTableNoDataIllustratedMessage(table, bindingInfo);
|
|
904
943
|
this._handleRecommendationOutputFields(table, bindingInfo);
|
|
905
944
|
this._handleFiltersForExternalID(table, bindingInfo);
|
|
906
|
-
|
|
907
945
|
tableAPI?.fireEvent("beforeRebindTable", {
|
|
908
946
|
collectionBindingInfo: collectionBindingInfoAPI,
|
|
909
947
|
quickFilterKey: quickFilter?.getSelectedKey()
|
|
@@ -931,8 +969,7 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
931
969
|
Log.error("Error while updating the binding info", e as string);
|
|
932
970
|
}
|
|
933
971
|
},
|
|
934
|
-
|
|
935
|
-
_handleSortersOnCurrenciesOrUoM: function (table: Table, bindingInfo: CollectionBindingInfo) {
|
|
972
|
+
_handleSortersOnCurrenciesOrUoM: function (table: Table, bindingInfo: SerializedCollectionBindingInfo) {
|
|
936
973
|
const sorters: Sorter[] | undefined = bindingInfo.sorter;
|
|
937
974
|
const newSortersToBeApplied: Sorter[] = [];
|
|
938
975
|
if (sorters?.length) {
|
|
@@ -952,8 +989,7 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
952
989
|
bindingInfo.sorter = newSortersToBeApplied;
|
|
953
990
|
}
|
|
954
991
|
},
|
|
955
|
-
|
|
956
|
-
_handleFiltersForExternalID: function (table: Table, bindingInfo: CollectionBindingInfo) {
|
|
992
|
+
_handleFiltersForExternalID: function (table: Table, bindingInfo: SerializedCollectionBindingInfo) {
|
|
957
993
|
const metaModel = (table.getModel() as ODataModel)?.getMetaModel();
|
|
958
994
|
const entityTypePath = bindingInfo.path + "/";
|
|
959
995
|
const filters = bindingInfo.filters?.getFilters();
|
|
@@ -961,8 +997,7 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
961
997
|
TableUtils.updateFiltersForExternalID(metaModel, filters as unknown as ConditionObject[], entityTypePath);
|
|
962
998
|
}
|
|
963
999
|
},
|
|
964
|
-
|
|
965
|
-
_handleRecommendationOutputFields: function (table: Table, oBindingInfo: CollectionBindingInfo) {
|
|
1000
|
+
_handleRecommendationOutputFields: function (table: Table, oBindingInfo: SerializedCollectionBindingInfo) {
|
|
966
1001
|
const tableAPI = this._getTableAPI(table);
|
|
967
1002
|
const controller = tableAPI?.getPageController();
|
|
968
1003
|
if (controller?.recommendations.isRecommendationEnabled()) {
|
|
@@ -976,7 +1011,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
976
1011
|
}
|
|
977
1012
|
}
|
|
978
1013
|
},
|
|
979
|
-
|
|
980
1014
|
/**
|
|
981
1015
|
* Update the cards when the binding is refreshed.
|
|
982
1016
|
* @param table The mdc table control.
|
|
@@ -996,7 +1030,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
996
1030
|
appComponent.getCollaborationManagerService().shareAvailableCards();
|
|
997
1031
|
}
|
|
998
1032
|
},
|
|
999
|
-
|
|
1000
1033
|
/**
|
|
1001
1034
|
* The hook implemented by MDC that we can override.
|
|
1002
1035
|
* This allows us to define properties to be requested in the MDC table (Main case is for the analytical table).
|
|
@@ -1014,7 +1047,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
1014
1047
|
Object.keys(tableAPI.tableDefinition.requestAtLeast)
|
|
1015
1048
|
// for analytic tables with aggregationOnLeafLevel we should not request the semanticKey expected when all keys are requested -> it will permits to navigate from a node level when semanticKey are enabled
|
|
1016
1049
|
// restriction are also excluded as we cannot destinguish between a node and a aggregation level
|
|
1017
|
-
|
|
1018
1050
|
.filter((fieldName: string) =>
|
|
1019
1051
|
!allKkeysRequested
|
|
1020
1052
|
? tableAPI.tableDefinition.requestAtLeast[fieldName].some(
|
|
@@ -1026,7 +1058,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
1026
1058
|
}
|
|
1027
1059
|
return Object.keys(tableAPI.tableDefinition.requestAtLeast ?? {});
|
|
1028
1060
|
},
|
|
1029
|
-
|
|
1030
1061
|
/**
|
|
1031
1062
|
* Check if all keys() excepted IsActiveEntity) are requested in the table.
|
|
1032
1063
|
* @param tableAPI The table API
|
|
@@ -1038,11 +1069,9 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
1038
1069
|
const keyPropertyNames = allColumns
|
|
1039
1070
|
.filter((c) => c.isKey && c.relativePath && c.relativePath !== "IsActiveEntity")
|
|
1040
1071
|
.map((c) => c.relativePath);
|
|
1041
|
-
|
|
1042
1072
|
const displayedColumns = table
|
|
1043
1073
|
.getColumns()
|
|
1044
1074
|
.map((column) => tableAPI.getTableDefinition().columns.find((c) => c.name === column.getPropertyKey()));
|
|
1045
|
-
|
|
1046
1075
|
// Store all properties referenced by displayed columns in a Set
|
|
1047
1076
|
const referencedPropertyPaths = new Set<string>();
|
|
1048
1077
|
function processColumn(col: AnnotationTableColumn): void {
|
|
@@ -1050,7 +1079,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
1050
1079
|
if (col.relativePath && col.propertyInfos === undefined) {
|
|
1051
1080
|
referencedPropertyPaths.add(col.relativePath);
|
|
1052
1081
|
}
|
|
1053
|
-
|
|
1054
1082
|
// Add the additional properties referenced by the column
|
|
1055
1083
|
col.extension?.additionalProperties?.forEach((additionalColumnName) => {
|
|
1056
1084
|
const additionalColumn = allColumns.find((c) => c.name === additionalColumnName);
|
|
@@ -1065,7 +1093,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
1065
1093
|
}
|
|
1066
1094
|
// Process the column itself
|
|
1067
1095
|
processColumn(column as AnnotationTableColumn);
|
|
1068
|
-
|
|
1069
1096
|
// Process the columns referenced by the column
|
|
1070
1097
|
column.propertyInfos?.forEach((relatedColumnName) => {
|
|
1071
1098
|
const relatedColumn = allColumns.find((c) => c.name === relatedColumnName);
|
|
@@ -1074,7 +1101,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
1074
1101
|
}
|
|
1075
1102
|
});
|
|
1076
1103
|
});
|
|
1077
|
-
|
|
1078
1104
|
return keyPropertyNames.every((propName) => propName && referencedPropertyPaths.has(propName));
|
|
1079
1105
|
},
|
|
1080
1106
|
/**
|
|
@@ -1091,7 +1117,7 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
1091
1117
|
// If not found in aggregation, check the query options
|
|
1092
1118
|
return binding.getQueryOptionsFromParameters().$search;
|
|
1093
1119
|
},
|
|
1094
|
-
updateBinding: function (table: MDCTable, bindingInfo:
|
|
1120
|
+
updateBinding: function (table: MDCTable, bindingInfo: SerializedCollectionBindingInfo, binding?: ODataListBinding): void {
|
|
1095
1121
|
const tableAPI = this._getTableAPI(table);
|
|
1096
1122
|
const bIsSuspended = tableAPI?.getProperty("bindingSuspended");
|
|
1097
1123
|
if (!bIsSuspended) {
|
|
@@ -1108,14 +1134,12 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
1108
1134
|
delete bindingInfo.parameters.$$getKeepAliveContext;
|
|
1109
1135
|
}
|
|
1110
1136
|
}
|
|
1111
|
-
|
|
1112
1137
|
let needManualRefresh = false;
|
|
1113
1138
|
const view = CommonUtils.getTargetView(table);
|
|
1114
1139
|
const internalBindingContext = table.getBindingContext("internal");
|
|
1115
1140
|
const manualUpdatePropertyKey = "pendingManualBindingUpdate";
|
|
1116
1141
|
const pendingManualUpdate = internalBindingContext?.getProperty(manualUpdatePropertyKey) as boolean;
|
|
1117
1142
|
const newSorters = JSON.stringify(bindingInfo.sorter ?? []);
|
|
1118
|
-
|
|
1119
1143
|
if (binding) {
|
|
1120
1144
|
/**
|
|
1121
1145
|
* Manual refresh if filters are not changed by binding.refresh() since updating the bindingInfo
|
|
@@ -1125,7 +1149,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
1125
1149
|
const viewData = view?.getViewData() as ListReportManifestSettings;
|
|
1126
1150
|
const oldFilters = binding.getFilters("Application");
|
|
1127
1151
|
const previousSorters = internalBindingContext?.getProperty(PREVIOUS_SORTERS) ?? "[]";
|
|
1128
|
-
|
|
1129
1152
|
const filterNotChanged =
|
|
1130
1153
|
((bindingInfo.filters === null && oldFilters.length === 0) || // on analytical tables, the filters are set to null when no filters
|
|
1131
1154
|
deepEqual(bindingInfo.filters, oldFilters[0])) &&
|
|
@@ -1133,7 +1156,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
1133
1156
|
bindingInfo.path === binding.getPath() && // The path can be changed in case of a parametrized entity
|
|
1134
1157
|
this.getSearchQuery(binding) === bindingInfo?.parameters?.$search;
|
|
1135
1158
|
const LRMultiViewEnabled = !!viewData.views;
|
|
1136
|
-
|
|
1137
1159
|
needManualRefresh =
|
|
1138
1160
|
filterNotChanged &&
|
|
1139
1161
|
(internalBindingContext?.getProperty(SEARCH_HAS_BEEN_FIRED) || // check if the search has been triggered
|
|
@@ -1145,7 +1167,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
1145
1167
|
if (tableAPI.getTableDefinition().enableAnalytics !== true) {
|
|
1146
1168
|
// Aggregate conditions never make sense outside of an analytical table
|
|
1147
1169
|
table.setAggregateConditions();
|
|
1148
|
-
|
|
1149
1170
|
// Group conditions don't make sense in a Tree or Grid table
|
|
1150
1171
|
if (
|
|
1151
1172
|
tableAPI.getTableDefinition().control.type === "GridTable" ||
|
|
@@ -1161,7 +1182,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
1161
1182
|
tableAPI.setTableBindingInfo(bindingInfo);
|
|
1162
1183
|
// we make the call to update the download url but do not await it
|
|
1163
1184
|
tableAPI.setDownloadUrl();
|
|
1164
|
-
|
|
1165
1185
|
table.fireEvent("bindingUpdated");
|
|
1166
1186
|
if (needManualRefresh && table.getFilter() && binding) {
|
|
1167
1187
|
binding
|
|
@@ -1177,12 +1197,10 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
1177
1197
|
internalBindingContext?.setProperty(SEARCH_HAS_BEEN_FIRED, false);
|
|
1178
1198
|
internalBindingContext?.setProperty(COLUMN_HAS_BEEN_ADDED, false);
|
|
1179
1199
|
internalBindingContext?.setProperty(PREVIOUS_SORTERS, newSorters);
|
|
1180
|
-
|
|
1181
1200
|
//for Treetable, it's necessary to clear the pastableContexts since the binding destroys previous contexts.
|
|
1182
1201
|
if (tableAPI.getTableDefinition().control.type === "TreeTable") {
|
|
1183
1202
|
internalBindingContext?.setProperty("pastableContexts", []);
|
|
1184
1203
|
}
|
|
1185
|
-
|
|
1186
1204
|
const attachedEvents = tableAPI.storedEvents ?? [];
|
|
1187
1205
|
attachedEvents.forEach(({ eventId, callback, listener, data }) => {
|
|
1188
1206
|
table.getRowBinding()?.attachEvent(eventId, data, callback, listener);
|
|
@@ -1190,8 +1208,7 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
1190
1208
|
}
|
|
1191
1209
|
tableAPI?.setProperty("outDatedBinding", bIsSuspended);
|
|
1192
1210
|
},
|
|
1193
|
-
|
|
1194
|
-
_computeRowBindingInfoFromTemplate: function (oTable: Table): CollectionBindingInfo {
|
|
1211
|
+
_computeRowBindingInfoFromTemplate: function (oTable: Table): SerializedCollectionBindingInfo {
|
|
1195
1212
|
const tableAPI = this._getTableAPI(oTable);
|
|
1196
1213
|
const rowBindingInfo = tableAPI.getTableTemplateBindingInfo();
|
|
1197
1214
|
const bindingContext = oTable.getBindingContext();
|
|
@@ -1207,15 +1224,13 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
1207
1224
|
) {
|
|
1208
1225
|
tableCanBeInInlineEdit = true;
|
|
1209
1226
|
}
|
|
1210
|
-
|
|
1211
1227
|
if (tableCanBeInInlineEdit) {
|
|
1212
1228
|
rowBindingInfo.parameters ??= {};
|
|
1213
1229
|
rowBindingInfo.parameters.$$updateGroupId = CommonUtils.INLINEEDIT_UPDATEGROUPID;
|
|
1214
1230
|
}
|
|
1215
|
-
|
|
1216
1231
|
return rowBindingInfo;
|
|
1217
1232
|
},
|
|
1218
|
-
_internalUpdateBindingInfo: function (oTable: Table, oBindingInfo:
|
|
1233
|
+
_internalUpdateBindingInfo: function (oTable: Table, oBindingInfo: SerializedCollectionBindingInfo) {
|
|
1219
1234
|
const oInternalModelContext = oTable.getBindingContext("internal") as InternalModelContext | undefined;
|
|
1220
1235
|
Object.assign(oBindingInfo, this._computeRowBindingInfoFromTemplate(oTable));
|
|
1221
1236
|
/**
|
|
@@ -1232,7 +1247,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
1232
1247
|
if (oInternalModelContext) {
|
|
1233
1248
|
oInternalModelContext.setProperty("dataReceivedAttached", false);
|
|
1234
1249
|
}
|
|
1235
|
-
|
|
1236
1250
|
let oFilter;
|
|
1237
1251
|
const oFilterInfo = TableUtils.getAllFilterInfo(oTable);
|
|
1238
1252
|
// Prepare binding info with filter/search parameters
|
|
@@ -1242,7 +1256,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
1242
1256
|
if (oFilterInfo.bindingPath) {
|
|
1243
1257
|
oBindingInfo.path = oFilterInfo.bindingPath;
|
|
1244
1258
|
}
|
|
1245
|
-
|
|
1246
1259
|
const oDataStateIndicator = oTable.getDataStateIndicator();
|
|
1247
1260
|
if (oDataStateIndicator && oDataStateIndicator.isFiltering()) {
|
|
1248
1261
|
// Include filters on messageStrip
|
|
@@ -1253,11 +1266,13 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
1253
1266
|
} else {
|
|
1254
1267
|
this.updateBindingInfoWithSearchQuery(oBindingInfo, oFilterInfo, oFilter);
|
|
1255
1268
|
}
|
|
1256
|
-
|
|
1257
1269
|
this.addFilterOnActiveEntities(oTable, oBindingInfo);
|
|
1258
1270
|
},
|
|
1259
|
-
|
|
1260
|
-
|
|
1271
|
+
updateBindingInfoWithSearchQuery: function (
|
|
1272
|
+
bindingInfo: SerializedCollectionBindingInfo,
|
|
1273
|
+
filterInfo: InternalBindingInfo,
|
|
1274
|
+
filter?: Filter
|
|
1275
|
+
) {
|
|
1261
1276
|
bindingInfo.filters = filter;
|
|
1262
1277
|
bindingInfo.parameters ??= {};
|
|
1263
1278
|
if (filterInfo.search) {
|
|
@@ -1271,9 +1286,8 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
1271
1286
|
* @param table
|
|
1272
1287
|
* @param bindingInfo
|
|
1273
1288
|
*/
|
|
1274
|
-
addFilterOnActiveEntities: function (table: Table, bindingInfo:
|
|
1289
|
+
addFilterOnActiveEntities: function (table: Table, bindingInfo: SerializedCollectionBindingInfo) {
|
|
1275
1290
|
const payload = table.getPayload() as { filterOnActiveEntities?: boolean };
|
|
1276
|
-
|
|
1277
1291
|
if (payload?.filterOnActiveEntities === true) {
|
|
1278
1292
|
const filterOnActive = new Filter({ path: "IsActiveEntity", operator: "EQ", value1: true });
|
|
1279
1293
|
if (bindingInfo.filters) {
|
|
@@ -1283,7 +1297,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
1283
1297
|
}
|
|
1284
1298
|
}
|
|
1285
1299
|
},
|
|
1286
|
-
|
|
1287
1300
|
/**
|
|
1288
1301
|
* Creates a template from the fragment of a slot column.
|
|
1289
1302
|
* @param columnInfo The custom table column
|
|
@@ -1294,7 +1307,7 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
1294
1307
|
*/
|
|
1295
1308
|
_templateSlotColumnFragment: async function (
|
|
1296
1309
|
columnInfo: CustomElement<CustomBasedTableColumn>,
|
|
1297
|
-
view:
|
|
1310
|
+
view: FEView,
|
|
1298
1311
|
modifier: BaseTreeModifier | JsControlTreeModifier,
|
|
1299
1312
|
tableId: string
|
|
1300
1313
|
): Promise<null | Control | Control[] | Element> {
|
|
@@ -1308,7 +1321,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
1308
1321
|
return Promise.resolve(null);
|
|
1309
1322
|
}
|
|
1310
1323
|
const slotXML = slotColumnsXML.getElementsByTagName("slot")[0];
|
|
1311
|
-
|
|
1312
1324
|
if (columnInfo.template) {
|
|
1313
1325
|
if (slotXML) {
|
|
1314
1326
|
const oTemplate = new DOMParser().parseFromString(columnInfo.template as string, "text/xml");
|
|
@@ -1333,10 +1345,9 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
1333
1345
|
return Fragment.load({
|
|
1334
1346
|
type: "XML",
|
|
1335
1347
|
definition: resultXML,
|
|
1336
|
-
controller: view.getController()
|
|
1348
|
+
controller: view.getController().getExtensionAPI()
|
|
1337
1349
|
}) as Promise<Control | Control[]>;
|
|
1338
1350
|
},
|
|
1339
|
-
|
|
1340
1351
|
_getExportFormat: function (dataType?: string) {
|
|
1341
1352
|
switch (dataType) {
|
|
1342
1353
|
case "Edm.Date":
|
|
@@ -1349,11 +1360,9 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
1349
1360
|
return undefined;
|
|
1350
1361
|
}
|
|
1351
1362
|
},
|
|
1352
|
-
|
|
1353
1363
|
_getVHRelevantFields: function (oMetaModel: ODataMetaModel, sMetadataPath: string, sBindingPath?: string): string[] {
|
|
1354
1364
|
let aFields: string[] = [],
|
|
1355
1365
|
oDataFieldData = oMetaModel.getObject(sMetadataPath);
|
|
1356
|
-
|
|
1357
1366
|
if (oDataFieldData.$kind && oDataFieldData.$kind === "Property") {
|
|
1358
1367
|
oDataFieldData = oMetaModel.getObject(`${sMetadataPath}@com.sap.vocabularies.UI.v1.DataFieldDefault`);
|
|
1359
1368
|
sMetadataPath = `${sMetadataPath}@com.sap.vocabularies.UI.v1.DataFieldDefault`;
|
|
@@ -1470,7 +1479,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
1470
1479
|
}
|
|
1471
1480
|
return;
|
|
1472
1481
|
},
|
|
1473
|
-
|
|
1474
1482
|
/**
|
|
1475
1483
|
* Invoked when a column is added using the table personalization dialog.
|
|
1476
1484
|
* @param table Instance of table control
|
|
@@ -1495,7 +1503,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
1495
1503
|
// We return null here because everything should apply at runtime
|
|
1496
1504
|
return Promise.resolve(null);
|
|
1497
1505
|
}
|
|
1498
|
-
|
|
1499
1506
|
const columnInfo = aColumns.find(function (oColumn) {
|
|
1500
1507
|
return oColumn.name === propertyInfoName;
|
|
1501
1508
|
});
|
|
@@ -1518,26 +1525,21 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
1518
1525
|
mPropertyBag.view ||
|
|
1519
1526
|
CommonUtils.getTargetView(table as UI5Element) ||
|
|
1520
1527
|
(mPropertyBag.appComponent ? CommonUtils.getCurrentPageView(mPropertyBag.appComponent) : undefined);
|
|
1521
|
-
|
|
1522
1528
|
if (columnInfo.type === "Default") {
|
|
1523
1529
|
Log.error("Custom columns defined in the manifest are not supported when using a table building block.");
|
|
1524
1530
|
throw new Error("Custom columns defined in the manifest are not supported when using a table building block.");
|
|
1525
1531
|
}
|
|
1526
|
-
|
|
1527
1532
|
if (columnInfo.type === "Slot") {
|
|
1528
1533
|
return this._templateSlotColumnFragment(columnInfo as CustomElement<CustomBasedTableColumn>, view, oModifier, sTableId);
|
|
1529
1534
|
}
|
|
1530
|
-
|
|
1531
1535
|
if (columnInfo.type === "Computed") {
|
|
1532
1536
|
const enableAnalytics = this._getTableAPI(table as Table).getTableDefinition().enableAnalytics;
|
|
1533
1537
|
return getComputedColumn(sTableId, columnInfo as ComputedTableColumn, oTableContext, enableAnalytics);
|
|
1534
1538
|
}
|
|
1535
|
-
|
|
1536
1539
|
// fall-back
|
|
1537
1540
|
if (!oMetaModel) {
|
|
1538
1541
|
return Promise.resolve(null);
|
|
1539
1542
|
}
|
|
1540
|
-
|
|
1541
1543
|
let propertyInfos = tableAPI.getEnhancedFetchedPropertyInfos();
|
|
1542
1544
|
if (!propertyInfos.length) {
|
|
1543
1545
|
// If the propertyInfos are not fetched yet, we need to fetch them
|
|
@@ -1548,9 +1550,7 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
1548
1550
|
const propertyInfo = propertyInfos.find(function (propInfo: EnhancedFEPropertyInfo) {
|
|
1549
1551
|
return propInfo.name === propertyInfoName;
|
|
1550
1552
|
});
|
|
1551
|
-
|
|
1552
1553
|
const oPropertyContext: Context = oMetaModel.createBindingContext(propertyInfo!.annotationPath)!;
|
|
1553
|
-
|
|
1554
1554
|
const fnTemplateFragment = async (
|
|
1555
1555
|
oInPropertyInfo: unknown,
|
|
1556
1556
|
oView: FEView
|
|
@@ -1558,7 +1558,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
1558
1558
|
let bDisplayMode: boolean | undefined;
|
|
1559
1559
|
let sTableTypeCustomData: string | undefined;
|
|
1560
1560
|
let sCreationModeCustomData: string | undefined;
|
|
1561
|
-
|
|
1562
1561
|
return Promise.all([
|
|
1563
1562
|
DelegateUtil.getCustomDataWithModifier<string | boolean>(table, "displayModePropertyBinding", oModifier),
|
|
1564
1563
|
DelegateUtil.getCustomDataWithModifier<string>(table, "tableType", oModifier),
|
|
@@ -1574,7 +1573,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
1574
1573
|
if (bDisplayMode !== undefined && typeof bDisplayMode !== "boolean") {
|
|
1575
1574
|
bDisplayMode = bDisplayMode === "true";
|
|
1576
1575
|
}
|
|
1577
|
-
|
|
1578
1576
|
const oThis = new JSONModel({
|
|
1579
1577
|
enableAutoColumnWidth: tableAPI.getTableDefinition().control.enableAutoColumnWidth,
|
|
1580
1578
|
readOnly: bDisplayMode,
|
|
@@ -1604,7 +1602,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
1604
1602
|
},
|
|
1605
1603
|
appComponent: mPropertyBag.appComponent
|
|
1606
1604
|
};
|
|
1607
|
-
|
|
1608
1605
|
const tableCollection = getInvolvedDataModelObjects<EntitySet | NavigationProperty>(
|
|
1609
1606
|
oMetaModel.createBindingContext(tableAPI.tableDefinition.annotation.collection)!
|
|
1610
1607
|
);
|
|
@@ -1635,10 +1632,8 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
1635
1632
|
});
|
|
1636
1633
|
});
|
|
1637
1634
|
};
|
|
1638
|
-
|
|
1639
1635
|
return fnTemplateFragment(propertyInfo, view);
|
|
1640
1636
|
},
|
|
1641
|
-
|
|
1642
1637
|
/**
|
|
1643
1638
|
* Provide the Table's filter delegate to provide basic filter functionality such as adding FilterFields.
|
|
1644
1639
|
* @returns Object for the Tables filter personalization.
|
|
@@ -1660,7 +1655,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
1660
1655
|
}
|
|
1661
1656
|
);
|
|
1662
1657
|
},
|
|
1663
|
-
|
|
1664
1658
|
/**
|
|
1665
1659
|
* Returns the TypeMap attached to this delegate.
|
|
1666
1660
|
* @returns Any instance of TypeMap
|
|
@@ -1668,7 +1662,6 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
1668
1662
|
getTypeMap: function (/*oPayload: object*/) {
|
|
1669
1663
|
return TypeMap;
|
|
1670
1664
|
},
|
|
1671
|
-
|
|
1672
1665
|
/**
|
|
1673
1666
|
* Format the title of the group header .
|
|
1674
1667
|
* @param table Instance of table control
|
|
@@ -1696,14 +1689,12 @@ export default Object.assign({}, TableDelegateBase, {
|
|
|
1696
1689
|
case "Description":
|
|
1697
1690
|
value = propertyInfo.descriptionProperty ? context.getProperty(propertyInfo.descriptionProperty, externalFormat) : null;
|
|
1698
1691
|
break;
|
|
1699
|
-
|
|
1700
1692
|
case "DescriptionValue":
|
|
1701
1693
|
value = ValueFormatter.formatWithBrackets(
|
|
1702
1694
|
propertyInfo.descriptionProperty ? context.getProperty(propertyInfo.descriptionProperty, externalFormat) : null,
|
|
1703
1695
|
propertyInfo.valueProperty ? context.getProperty(propertyInfo.valueProperty, externalFormat) : null
|
|
1704
1696
|
);
|
|
1705
1697
|
break;
|
|
1706
|
-
|
|
1707
1698
|
case "ValueDescription":
|
|
1708
1699
|
value = ValueFormatter.formatWithBrackets(
|
|
1709
1700
|
propertyInfo.valueProperty ? context.getProperty(propertyInfo.valueProperty, externalFormat) : null,
|