@sapui5/sap.fe.macros 1.139.0 → 1.141.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/Chart.js +53 -2
- package/src/sap/fe/macros/Chart.tsx +55 -0
- package/src/sap/fe/macros/CollaborativeDraftHandler.js +230 -0
- package/src/sap/fe/macros/CollaborativeDraftHandler.tsx +218 -0
- package/src/sap/fe/macros/CommonHelper.js +59 -15
- package/src/sap/fe/macros/CommonHelper.ts +65 -14
- package/src/sap/fe/macros/ConditionalSwitch.js +174 -0
- package/src/sap/fe/macros/ConditionalSwitch.tsx +141 -0
- package/src/sap/fe/macros/ConditionalSwitchProperty.js +78 -0
- package/src/sap/fe/macros/ConditionalSwitchProperty.tsx +62 -0
- package/src/sap/fe/macros/Field.js +78 -64
- package/src/sap/fe/macros/Field.ts +97 -68
- package/src/sap/fe/macros/FooterContent.js +5 -2
- package/src/sap/fe/macros/FooterContent.tsx +4 -1
- package/src/sap/fe/macros/MacroAPI.js +9 -4
- package/src/sap/fe/macros/MacroAPI.ts +9 -4
- package/src/sap/fe/macros/MessageButton.js +1 -2
- package/src/sap/fe/macros/MessageButton.tsx +0 -1
- package/src/sap/fe/macros/MultiValueField.js +10 -7
- package/src/sap/fe/macros/MultiValueField.tsx +7 -3
- package/src/sap/fe/macros/Page.js +5 -7
- package/src/sap/fe/macros/Page.tsx +4 -6
- package/src/sap/fe/macros/Paginator.js +9 -4
- package/src/sap/fe/macros/Paginator.tsx +12 -3
- package/src/sap/fe/macros/RichTextEditor.js +3 -2
- package/src/sap/fe/macros/RichTextEditor.tsx +2 -1
- package/src/sap/fe/macros/Share.js +14 -2
- package/src/sap/fe/macros/Share.tsx +13 -0
- package/src/sap/fe/macros/Status.js +251 -0
- package/src/sap/fe/macros/Status.tsx +212 -0
- package/src/sap/fe/macros/ValueHelp.js +4 -28
- package/src/sap/fe/macros/ValueHelp.tsx +2 -42
- package/src/sap/fe/macros/ai/EasyFillDialog.js +11 -17
- package/src/sap/fe/macros/ai/EasyFillDialog.tsx +11 -16
- package/src/sap/fe/macros/ai/EasyFilterBar.js +246 -97
- package/src/sap/fe/macros/ai/EasyFilterBar.tsx +302 -106
- package/src/sap/fe/macros/ai/EasyFilterDataFetcher.js +76 -33
- package/src/sap/fe/macros/ai/EasyFilterDataFetcher.ts +89 -40
- package/src/sap/fe/macros/ai/SummarizationButton.js +2 -2
- package/src/sap/fe/macros/ai/SummarizationButton.tsx +1 -1
- package/src/sap/fe/macros/chart/Chart.js +2 -2
- package/src/sap/fe/macros/chart/Chart.tsx +1 -1
- package/src/sap/fe/macros/chart/ChartHelper.js +1 -2
- package/src/sap/fe/macros/chart/ChartHelper.ts +0 -1
- package/src/sap/fe/macros/chart/ChartRuntime.js +1 -2
- package/src/sap/fe/macros/chart/ChartRuntime.ts +0 -1
- package/src/sap/fe/macros/chart/MdcChartTemplate.js +5 -5
- package/src/sap/fe/macros/chart/MdcChartTemplate.tsx +5 -5
- package/src/sap/fe/macros/contentSwitcher/ContentSwitcher.js +9 -2
- package/src/sap/fe/macros/contentSwitcher/ContentSwitcher.tsx +8 -0
- package/src/sap/fe/macros/controls/BuildingBlockObjectProperty.js +5 -1
- package/src/sap/fe/macros/controls/BuildingBlockObjectProperty.ts +4 -0
- package/src/sap/fe/macros/controls/BuildingBlockWithTemplating.js +4 -2
- package/src/sap/fe/macros/controls/BuildingBlockWithTemplating.ts +3 -1
- package/src/sap/fe/macros/controls/FilterBar.js +14 -5
- package/src/sap/fe/macros/controls/FilterBar.ts +3 -0
- package/src/sap/fe/macros/controls/NumberWithUnitOrCurrency.js +2 -2
- package/src/sap/fe/macros/controls/NumberWithUnitOrCurrency.tsx +2 -2
- package/src/sap/fe/macros/controls/RadioButtons.js +61 -38
- package/src/sap/fe/macros/controls/RadioButtons.tsx +39 -18
- package/src/sap/fe/macros/controls/Section.js +4 -3
- package/src/sap/fe/macros/controls/Section.ts +3 -2
- package/src/sap/fe/macros/controls/section/SubSection.js +63 -8
- package/src/sap/fe/macros/controls/section/SubSection.ts +67 -1
- package/src/sap/fe/macros/coreUI/OperationParameterDialog.js +43 -4
- package/src/sap/fe/macros/coreUI/OperationParameterDialog.tsx +48 -1
- package/src/sap/fe/macros/designtime/Designtime.helper.js +28 -1
- package/src/sap/fe/macros/designtime/Designtime.helper.ts +27 -0
- package/src/sap/fe/macros/field/Field.js +2 -2
- package/src/sap/fe/macros/field/Field.tsx +1 -1
- package/src/sap/fe/macros/field/FieldBaseDelegate.js +13 -7
- package/src/sap/fe/macros/field/FieldBaseDelegate.ts +12 -8
- package/src/sap/fe/macros/field/FieldFormatOptions.js +25 -2
- package/src/sap/fe/macros/field/FieldFormatOptions.ts +13 -0
- package/src/sap/fe/macros/field/FieldHelper.js +2 -2
- package/src/sap/fe/macros/field/FieldHelper.ts +1 -4
- package/src/sap/fe/macros/field/FieldRuntime.js +1 -2
- package/src/sap/fe/macros/field/FieldRuntime.ts +0 -1
- package/src/sap/fe/macros/field/FieldTemplating.js +3 -3
- package/src/sap/fe/macros/field/FieldTemplating.ts +4 -2
- package/src/sap/fe/macros/filter/FilterUtils.js +233 -5
- package/src/sap/fe/macros/filter/FilterUtils.ts +291 -7
- package/src/sap/fe/macros/filterBar/FilterBar.block.js +5 -3
- package/src/sap/fe/macros/filterBar/FilterBar.block.tsx +4 -2
- package/src/sap/fe/macros/filterBar/FilterBar.js +2 -2
- package/src/sap/fe/macros/filterBar/FilterBar.tsx +1 -1
- package/src/sap/fe/macros/filterBar/FilterBarAPI.js +63 -27
- package/src/sap/fe/macros/filterBar/FilterBarAPI.ts +49 -3
- package/src/sap/fe/macros/filterBar/FilterBarDelegate.js +5 -3
- package/src/sap/fe/macros/filterBar/FilterBarDelegate.ts +5 -2
- package/src/sap/fe/macros/filterBar/mixin/FilterBarAPIStateHandler.js +7 -2
- package/src/sap/fe/macros/filterBar/mixin/FilterBarAPIStateHandler.ts +6 -1
- package/src/sap/fe/macros/form/Form.block.js +7 -8
- package/src/sap/fe/macros/form/Form.block.ts +4 -6
- package/src/sap/fe/macros/form/Form.js +1 -4
- package/src/sap/fe/macros/form/Form.tsx +0 -3
- package/src/sap/fe/macros/form/FormContainer.block.js +555 -5
- package/src/sap/fe/macros/form/FormContainer.block.ts +665 -7
- package/src/sap/fe/macros/form/FormContainer.fragment.xml +1 -0
- package/src/sap/fe/macros/form/FormDelegate.js +24 -8
- package/src/sap/fe/macros/form/FormDelegate.ts +29 -7
- package/src/sap/fe/macros/form/FormHelper.js +1 -2
- package/src/sap/fe/macros/form/FormHelper.ts +0 -1
- package/src/sap/fe/macros/fpm/CustomFragment.block.js +1 -2
- package/src/sap/fe/macros/fpm/CustomFragment.block.ts +0 -1
- package/src/sap/fe/macros/internal/ActionCommand.block.js +1 -2
- package/src/sap/fe/macros/internal/ActionCommand.block.ts +0 -1
- package/src/sap/fe/macros/internal/DataPoint.js +3 -2
- package/src/sap/fe/macros/internal/DataPoint.tsx +10 -1
- package/src/sap/fe/macros/internal/FilterField.block.js +19 -5
- package/src/sap/fe/macros/internal/FilterField.block.ts +16 -4
- package/src/sap/fe/macros/internal/field/DisplayStyle.js +9 -3
- package/src/sap/fe/macros/internal/field/DisplayStyle.tsx +10 -2
- package/src/sap/fe/macros/internal/field/EditStyle.js +21 -4
- package/src/sap/fe/macros/internal/field/EditStyle.tsx +18 -4
- package/src/sap/fe/macros/internal/field/FieldStructureHelper.js +3 -2
- package/src/sap/fe/macros/internal/field/FieldStructureHelper.ts +5 -1
- package/src/sap/fe/macros/internal/filterField/FilterFieldTemplate.fragment.xml +1 -0
- package/src/sap/fe/macros/internal/helpers/ActionHelper.js +36 -5
- package/src/sap/fe/macros/internal/helpers/ActionHelper.ts +34 -4
- package/src/sap/fe/macros/internal/valuehelp/AdditionalValueHelper.js +46 -8
- package/src/sap/fe/macros/internal/valuehelp/AdditionalValueHelper.ts +60 -6
- package/src/sap/fe/macros/internal/valuehelp/TableDelegate.js +38 -2
- package/src/sap/fe/macros/internal/valuehelp/TableDelegate.ts +37 -2
- package/src/sap/fe/macros/internal/valuehelp/ValueListDialogTable.fragment.xml +1 -1
- package/src/sap/fe/macros/internal/valuehelp/ValueListHelper.js +10 -3
- package/src/sap/fe/macros/internal/valuehelp/ValueListHelper.ts +13 -2
- package/src/sap/fe/macros/library.js +1 -1
- package/src/sap/fe/macros/mdc/adapter/StateFilterToSelectionVariant.js +2 -1
- package/src/sap/fe/macros/mdc/adapter/StateFilterToSelectionVariant.ts +1 -0
- package/src/sap/fe/macros/messagebundle.properties +24 -4
- package/src/sap/fe/macros/messagebundle_ar.properties +8 -2
- package/src/sap/fe/macros/messagebundle_bg.properties +8 -2
- package/src/sap/fe/macros/messagebundle_ca.properties +11 -5
- package/src/sap/fe/macros/messagebundle_cnr.properties +8 -2
- package/src/sap/fe/macros/messagebundle_cs.properties +7 -1
- package/src/sap/fe/macros/messagebundle_cy.properties +9 -3
- package/src/sap/fe/macros/messagebundle_da.properties +8 -2
- package/src/sap/fe/macros/messagebundle_de.properties +13 -7
- package/src/sap/fe/macros/messagebundle_el.properties +7 -1
- package/src/sap/fe/macros/messagebundle_en.properties +11 -5
- package/src/sap/fe/macros/messagebundle_en_GB.properties +9 -3
- package/src/sap/fe/macros/messagebundle_en_US_saprigi.properties +11 -5
- package/src/sap/fe/macros/messagebundle_es.properties +10 -4
- package/src/sap/fe/macros/messagebundle_es_MX.properties +11 -5
- package/src/sap/fe/macros/messagebundle_et.properties +9 -3
- package/src/sap/fe/macros/messagebundle_fi.properties +7 -1
- package/src/sap/fe/macros/messagebundle_fr.properties +9 -3
- package/src/sap/fe/macros/messagebundle_fr_CA.properties +8 -2
- package/src/sap/fe/macros/messagebundle_hi.properties +8 -2
- package/src/sap/fe/macros/messagebundle_hr.properties +8 -2
- package/src/sap/fe/macros/messagebundle_hu.properties +7 -1
- package/src/sap/fe/macros/messagebundle_id.properties +15 -9
- package/src/sap/fe/macros/messagebundle_it.properties +7 -1
- package/src/sap/fe/macros/messagebundle_iw.properties +8 -2
- package/src/sap/fe/macros/messagebundle_ja.properties +13 -7
- package/src/sap/fe/macros/messagebundle_kk.properties +11 -5
- package/src/sap/fe/macros/messagebundle_ko.properties +8 -2
- package/src/sap/fe/macros/messagebundle_lt.properties +9 -3
- package/src/sap/fe/macros/messagebundle_lv.properties +8 -2
- package/src/sap/fe/macros/messagebundle_mk.properties +8 -2
- package/src/sap/fe/macros/messagebundle_ms.properties +7 -1
- package/src/sap/fe/macros/messagebundle_nl.properties +7 -1
- package/src/sap/fe/macros/messagebundle_no.properties +7 -1
- package/src/sap/fe/macros/messagebundle_pl.properties +8 -2
- package/src/sap/fe/macros/messagebundle_pt.properties +7 -1
- package/src/sap/fe/macros/messagebundle_pt_PT.properties +7 -1
- package/src/sap/fe/macros/messagebundle_ro.properties +8 -2
- package/src/sap/fe/macros/messagebundle_ru.properties +10 -4
- package/src/sap/fe/macros/messagebundle_sh.properties +8 -2
- package/src/sap/fe/macros/messagebundle_sk.properties +7 -1
- package/src/sap/fe/macros/messagebundle_sl.properties +7 -1
- package/src/sap/fe/macros/messagebundle_sr.properties +8 -2
- package/src/sap/fe/macros/messagebundle_sv.properties +7 -1
- package/src/sap/fe/macros/messagebundle_th.properties +8 -2
- package/src/sap/fe/macros/messagebundle_tr.properties +7 -1
- package/src/sap/fe/macros/messagebundle_uk.properties +10 -4
- package/src/sap/fe/macros/messagebundle_vi.properties +10 -4
- package/src/sap/fe/macros/messagebundle_zh_CN.properties +7 -1
- package/src/sap/fe/macros/messagebundle_zh_TW.properties +8 -2
- package/src/sap/fe/macros/messages/MessageButton.js +39 -18
- package/src/sap/fe/macros/messages/MessageButton.ts +42 -19
- package/src/sap/fe/macros/messages/MessagePopover.js +4 -2
- package/src/sap/fe/macros/messages/MessagePopover.ts +6 -4
- package/src/sap/fe/macros/microchart/MicroChart.js +2 -2
- package/src/sap/fe/macros/microchart/MicroChart.tsx +1 -1
- package/src/sap/fe/macros/microchart/MicroChartContainer.js +1 -2
- package/src/sap/fe/macros/microchart/MicroChartContainer.ts +1 -2
- package/src/sap/fe/macros/microchart/MicroChartHelper.js +2 -3
- package/src/sap/fe/macros/microchart/MicroChartHelper.tsx +1 -2
- package/src/sap/fe/macros/share/ShareAPI.js +4 -29
- package/src/sap/fe/macros/share/ShareAPI.ts +1 -32
- package/src/sap/fe/macros/situations/SituationsPopover.js +3 -1
- package/src/sap/fe/macros/situations/SituationsPopover.ts +2 -0
- package/src/sap/fe/macros/table/ActionsTemplating.js +4 -8
- package/src/sap/fe/macros/table/ActionsTemplating.tsx +5 -8
- package/src/sap/fe/macros/table/BasicSearch.js +1 -1
- package/src/sap/fe/macros/table/BasicSearch.ts +2 -1
- package/src/sap/fe/macros/table/Column.js +14 -2
- package/src/sap/fe/macros/table/Column.ts +7 -0
- package/src/sap/fe/macros/table/ColumnExportSettings.js +83 -15
- package/src/sap/fe/macros/table/ColumnExportSettings.ts +44 -0
- package/src/sap/fe/macros/table/ColumnOverride.js +14 -2
- package/src/sap/fe/macros/table/ColumnOverride.ts +7 -0
- package/src/sap/fe/macros/table/MdcTableTemplate.js +7 -5
- package/src/sap/fe/macros/table/MdcTableTemplate.tsx +21 -11
- package/src/sap/fe/macros/table/QuickFilterSelector.js +12 -3
- package/src/sap/fe/macros/table/QuickFilterSelector.tsx +15 -2
- package/src/sap/fe/macros/table/Table.block.js +188 -147
- package/src/sap/fe/macros/table/Table.block.tsx +41 -11
- package/src/sap/fe/macros/table/Table.js +16 -10
- package/src/sap/fe/macros/table/Table.tsx +16 -10
- package/src/sap/fe/macros/table/TableAPI.js +224 -184
- package/src/sap/fe/macros/table/TableAPI.ts +63 -19
- package/src/sap/fe/macros/table/TableEventHandlerProvider.js +6 -6
- package/src/sap/fe/macros/table/TableEventHandlerProvider.ts +5 -4
- package/src/sap/fe/macros/table/TableHelper.js +2 -3
- package/src/sap/fe/macros/table/TableHelper.ts +1 -2
- package/src/sap/fe/macros/table/TableRuntime.js +24 -5
- package/src/sap/fe/macros/table/TableRuntime.ts +31 -3
- package/src/sap/fe/macros/table/TreeTable.js +16 -10
- package/src/sap/fe/macros/table/TreeTable.tsx +16 -10
- package/src/sap/fe/macros/table/Utils.js +8 -3
- package/src/sap/fe/macros/table/Utils.ts +12 -3
- package/src/sap/fe/macros/table/delegates/ALPTableDelegate.js +1 -2
- package/src/sap/fe/macros/table/delegates/ALPTableDelegate.ts +0 -1
- package/src/sap/fe/macros/table/delegates/TableDelegate.js +69 -34
- package/src/sap/fe/macros/table/delegates/TableDelegate.ts +75 -33
- package/src/sap/fe/macros/table/delegates/TreeTableDelegate.js +1 -2
- package/src/sap/fe/macros/table/delegates/TreeTableDelegate.ts +0 -1
- package/src/sap/fe/macros/table/massEdit/MassEditDialog.js +10 -10
- package/src/sap/fe/macros/table/massEdit/MassEditDialog.tsx +11 -9
- package/src/sap/fe/macros/table/massEdit/MassEditDialogHelper.js +14 -12
- package/src/sap/fe/macros/table/massEdit/MassEditDialogHelper.tsx +11 -10
- package/src/sap/fe/macros/table/mixin/ContextMenuHandler.js +34 -4
- package/src/sap/fe/macros/table/mixin/ContextMenuHandler.ts +45 -2
- package/src/sap/fe/macros/table/mixin/EmptyRowsHandler.js +55 -12
- package/src/sap/fe/macros/table/mixin/EmptyRowsHandler.ts +71 -9
- package/src/sap/fe/macros/table/mixin/TableAPIStateHandler.js +53 -2
- package/src/sap/fe/macros/table/mixin/TableAPIStateHandler.ts +55 -0
- package/src/sap/fe/macros/table/mixin/TableExport.js +22 -3
- package/src/sap/fe/macros/table/mixin/TableExport.ts +25 -4
- package/src/sap/fe/macros/table/mixin/TableHierarchy.js +5 -1
- package/src/sap/fe/macros/table/mixin/TableHierarchy.ts +7 -0
- package/src/sap/fe/macros/table/mixin/TableSharing.js +4 -2
- package/src/sap/fe/macros/table/mixin/TableSharing.ts +10 -1
- package/src/sap/fe/macros/valuehelp/ValueHelpDelegate.js +36 -10
- package/src/sap/fe/macros/valuehelp/ValueHelpDelegate.ts +44 -9
- package/src/sap/fe/macros/visualfilters/VisualFilter.js +5 -4
- package/src/sap/fe/macros/visualfilters/VisualFilter.tsx +3 -2
- package/src/sap/fe/macros/visualfilters/VisualFilterRuntime.js +2 -3
- package/src/sap/fe/macros/visualfilters/VisualFilterRuntime.ts +1 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { EntityType,
|
|
1
|
+
import type { EntityType,Property } from "@sap-ux/vocabularies-types";
|
|
2
2
|
import type { PropertyPath } from "@sap-ux/vocabularies-types/Edm";
|
|
3
3
|
import { CommonAnnotationTypes } from "@sap-ux/vocabularies-types/vocabularies/Common";
|
|
4
4
|
import type { SelectionFields } from "@sap-ux/vocabularies-types/vocabularies/UI";
|
|
@@ -8,13 +8,13 @@ import type AppComponent from "sap/fe/core/AppComponent";
|
|
|
8
8
|
import type { BaseTreeModifier } from "sap/fe/core/CommonUtils";
|
|
9
9
|
import CommonUtils from "sap/fe/core/CommonUtils";
|
|
10
10
|
import ConverterContext from "sap/fe/core/converters/ConverterContext";
|
|
11
|
-
import type { BaseManifestSettings } from "sap/fe/core/converters/ManifestSettings";
|
|
11
|
+
import type { BaseManifestSettings,HiddenDraft } from "sap/fe/core/converters/ManifestSettings";
|
|
12
12
|
import ManifestWrapper from "sap/fe/core/converters/ManifestWrapper";
|
|
13
13
|
import * as MetaModelConverter from "sap/fe/core/converters/MetaModelConverter";
|
|
14
14
|
import type { IDiagnostics } from "sap/fe/core/converters/TemplateConverter";
|
|
15
15
|
import type { TableVisualization } from "sap/fe/core/converters/controls/Common/Table";
|
|
16
16
|
import type { PropertyTypeConfig } from "sap/fe/core/converters/controls/Common/table/Columns";
|
|
17
|
-
import type { FilterField,
|
|
17
|
+
import type { FilterField,PropertyInfo,PropertyInfoExternal } from "sap/fe/core/converters/controls/ListReport/FilterBar";
|
|
18
18
|
import * as FilterBarConverter from "sap/fe/core/converters/controls/ListReport/FilterBar";
|
|
19
19
|
import { getAllCustomAggregates } from "sap/fe/core/helpers/MetaModelFunction";
|
|
20
20
|
import ModelHelper from "sap/fe/core/helpers/ModelHelper";
|
|
@@ -326,19 +326,35 @@ const oFilterUtils = {
|
|
|
326
326
|
aIgnoreProperties.concat(aParameters)
|
|
327
327
|
) as { filters: Filter }
|
|
328
328
|
).filters;
|
|
329
|
-
const
|
|
330
|
-
const hasEditStateFieldVisible = currState?.items?.some((cs: { [key: string]: string }) => cs?.key === "$editState");
|
|
331
|
-
const hasEditStateMetadata = Array.isArray(aPropertiesMetadata) && aPropertiesMetadata?.some((cs) => cs?.key === "$editState");
|
|
329
|
+
const hasEditStateMetadata = aPropertiesMetadata?.filter((property) => property.name === "$editState");
|
|
332
330
|
let editStateFilter: Filter | undefined;
|
|
333
|
-
if (!aIgnoreProperties.includes("$editState") &&
|
|
331
|
+
if (!aIgnoreProperties.includes("$editState") && hasEditStateMetadata && hasEditStateMetadata.length > 0) {
|
|
334
332
|
if (mConditions.hasOwnProperty("$editState")) {
|
|
335
333
|
const editStateValue = mConditions["$editState"];
|
|
336
334
|
editStateFilter = EDITSTATE.getFilterForEditState(editStateValue?.[0]?.values?.[0]);
|
|
337
335
|
} else {
|
|
338
336
|
editStateFilter = EDITSTATE.getFilterForEditState("");
|
|
339
337
|
}
|
|
338
|
+
} else {
|
|
339
|
+
const view = CommonUtils.getTargetView(oIFilter);
|
|
340
|
+
const appComponent = CommonUtils.getAppComponent(view);
|
|
341
|
+
const isHiddenDraftEnabled = (appComponent.getEnvironmentCapabilities()?.getCapabilities()?.HiddenDraft as HiddenDraft)
|
|
342
|
+
?.enabled;
|
|
343
|
+
if (
|
|
344
|
+
isHiddenDraftEnabled &&
|
|
345
|
+
oIFilter.hasOwnProperty("disableDraftEditStateFilter") &&
|
|
346
|
+
oIFilter.getProperty("disableDraftEditStateFilter")
|
|
347
|
+
) {
|
|
348
|
+
editStateFilter = EDITSTATE.getFilterForEditState("ALL");
|
|
349
|
+
}
|
|
340
350
|
}
|
|
341
351
|
let aFilters = oFilter ? [oFilter] : [];
|
|
352
|
+
|
|
353
|
+
//( Transform DateTimeOffset precision 7 filters
|
|
354
|
+
if (oIFilter.isA<FilterBar>("sap.ui.mdc.FilterBar")) {
|
|
355
|
+
this._transformDateTimeOffsetFilters(aFilters, mConditions, oIFilter as FilterBar);
|
|
356
|
+
}
|
|
357
|
+
|
|
342
358
|
if (editStateFilter) {
|
|
343
359
|
const hasEditStateFilter = this.hasEditStateFilterRecursively(aFilters);
|
|
344
360
|
if (hasEditStateFilter) {
|
|
@@ -354,6 +370,274 @@ const oFilterUtils = {
|
|
|
354
370
|
}
|
|
355
371
|
return aFilters;
|
|
356
372
|
},
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Transforms DateTimeOffset precision 7 filters by converting EQ operators to BT operators
|
|
376
|
+
* with microsecond precision range from .0000000 to .9990000.
|
|
377
|
+
* @param aFilters Array of filter objects to transform
|
|
378
|
+
* @param mConditions Filter conditions from the filter bar
|
|
379
|
+
* @param oFilterBar The filter bar instance to access property information
|
|
380
|
+
*/
|
|
381
|
+
_transformDateTimeOffsetFilters: function (
|
|
382
|
+
aFilters: Filter[],
|
|
383
|
+
mConditions: Record<string, ConditionObject[]>,
|
|
384
|
+
oFilterBar: FilterBar
|
|
385
|
+
): void {
|
|
386
|
+
if (!aFilters || !Array.isArray(aFilters) || !mConditions) {
|
|
387
|
+
return;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
// Handle nested filter structure - when multiple filters are defined,
|
|
391
|
+
// they may be contained within aFilters[0].aFilters
|
|
392
|
+
let actualFilters: Filter[] = aFilters;
|
|
393
|
+
const firstFilter = aFilters[0] as Filter & { aFilters?: Filter[] };
|
|
394
|
+
if (firstFilter?.aFilters && firstFilter.aFilters.length > 0) {
|
|
395
|
+
actualFilters = firstFilter.aFilters;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
// Get property helper to access property metadata
|
|
399
|
+
const oPropertyHelper = oFilterBar.getPropertyHelper();
|
|
400
|
+
if (!oPropertyHelper) {
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
// Create a set of condition paths that are DateTimeOffset precision 7
|
|
405
|
+
const dateTimeOffsetPaths: Set<string> = new Set<string>();
|
|
406
|
+
|
|
407
|
+
Object.keys(mConditions).forEach(function (sConditionPath: string): void {
|
|
408
|
+
if (mConditions[sConditionPath] && mConditions[sConditionPath].length > 0) {
|
|
409
|
+
// Use the full condition path for property helper
|
|
410
|
+
const propertyInfo = oPropertyHelper.getProperty(sConditionPath) as
|
|
411
|
+
| {
|
|
412
|
+
dataType?: string;
|
|
413
|
+
constraints?: { precision?: number };
|
|
414
|
+
typeConfig?: {
|
|
415
|
+
typeInstance?: {
|
|
416
|
+
constraints?: { precision?: number };
|
|
417
|
+
getName(): string;
|
|
418
|
+
};
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
| undefined;
|
|
422
|
+
|
|
423
|
+
// Check if property is DateTimeOffset with precision 7
|
|
424
|
+
const isDateTimeOffset: boolean =
|
|
425
|
+
(propertyInfo?.dataType?.includes("DateTimeOffset") ?? false) ||
|
|
426
|
+
(propertyInfo?.typeConfig?.typeInstance?.getName().includes("DateTimeOffset") ?? false);
|
|
427
|
+
const precision: number | undefined =
|
|
428
|
+
propertyInfo?.constraints?.precision ?? propertyInfo?.typeConfig?.typeInstance?.constraints?.precision;
|
|
429
|
+
|
|
430
|
+
if (isDateTimeOffset && precision === 7) {
|
|
431
|
+
dateTimeOffsetPaths.add(sConditionPath);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
// Transform filters recursively to handle all nested structures
|
|
437
|
+
this._transformDateTimeOffSetFilterValueRecursively(actualFilters, dateTimeOffsetPaths);
|
|
438
|
+
},
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* Recursively transforms filters to handle all possible nested aFilters structures.
|
|
442
|
+
* @param aFilters Array of filter objects to transform
|
|
443
|
+
* @param dateTimeOffsetPaths Set of condition paths that are DateTimeOffset precision 7
|
|
444
|
+
*/
|
|
445
|
+
_transformDateTimeOffSetFilterValueRecursively: function (aFilters: Filter[], dateTimeOffsetPaths: Set<string>): void {
|
|
446
|
+
for (let i = 0; i < aFilters.length; i++) {
|
|
447
|
+
const filter: Filter = aFilters[i];
|
|
448
|
+
|
|
449
|
+
// Check if this filter has nested aFilters (multiple conditions for same field)
|
|
450
|
+
const filterWithNestedFilters = filter as Filter & { aFilters?: Filter[]; bAnd?: boolean };
|
|
451
|
+
if (filterWithNestedFilters.aFilters && filterWithNestedFilters.aFilters.length > 0) {
|
|
452
|
+
// Recursively transform nested filters for deeper nesting levels
|
|
453
|
+
this._transformDateTimeOffSetFilterValueRecursively(filterWithNestedFilters.aFilters, dateTimeOffsetPaths);
|
|
454
|
+
continue;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
const filterPath: string | undefined = filter.getPath();
|
|
458
|
+
const filterOperator: FilterOperator | undefined = filter.getOperator() as FilterOperator | undefined;
|
|
459
|
+
const filterValue1: unknown = filter.getValue1();
|
|
460
|
+
|
|
461
|
+
// Handle undefined filterOperator gracefully
|
|
462
|
+
if (filterOperator === undefined) {
|
|
463
|
+
Log.warning(
|
|
464
|
+
"FilterUtils._transformDateTimeOffsetFilters: Filter operator is undefined, skipping filter transformation",
|
|
465
|
+
`filterPath: ${filterPath}, filterValue1: ${filterValue1}`
|
|
466
|
+
);
|
|
467
|
+
continue; // Skip this filter and continue with next one
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
if (filterOperator === "EQ" && filterValue1 !== undefined && filterValue1 !== null) {
|
|
471
|
+
// For direct properties - check if the path matches any condition path
|
|
472
|
+
if (filterPath && dateTimeOffsetPaths.has(filterPath)) {
|
|
473
|
+
const transformedFilter: Filter | null = this._transformDateTimeOffSetFilterValue(filter);
|
|
474
|
+
if (transformedFilter) {
|
|
475
|
+
aFilters[i] = transformedFilter;
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
} else if (filterOperator === "Any") {
|
|
479
|
+
const nestedFilter = filter.getCondition();
|
|
480
|
+
if (!nestedFilter) {
|
|
481
|
+
continue;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
// Check if the nested filter has multiple conditions (aFilters array)
|
|
485
|
+
const nestedFilterWithMultipleConditions = nestedFilter as Filter & { aFilters?: Filter[]; bAnd?: boolean };
|
|
486
|
+
if (nestedFilterWithMultipleConditions.aFilters && nestedFilterWithMultipleConditions.aFilters.length > 0) {
|
|
487
|
+
// Handle multiple conditions within navigation property
|
|
488
|
+
let hasTransformation = false;
|
|
489
|
+
|
|
490
|
+
for (let j = 0; j < nestedFilterWithMultipleConditions.aFilters.length; j++) {
|
|
491
|
+
const subFilter: Filter = nestedFilterWithMultipleConditions.aFilters[j];
|
|
492
|
+
|
|
493
|
+
// Check for further nesting within sub-filters
|
|
494
|
+
const subFilterWithNesting = subFilter as Filter & { aFilters?: Filter[] };
|
|
495
|
+
if (subFilterWithNesting.aFilters && subFilterWithNesting.aFilters.length > 0) {
|
|
496
|
+
// Recursively handle deeper nesting levels
|
|
497
|
+
this._transformDateTimeOffSetFilterValueRecursively(subFilterWithNesting.aFilters, dateTimeOffsetPaths);
|
|
498
|
+
continue;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
const subFilterPath: string | undefined = subFilter.getPath();
|
|
502
|
+
const subFilterOperator: FilterOperator | undefined = subFilter.getOperator() as FilterOperator | undefined;
|
|
503
|
+
const subFilterValue1: unknown = subFilter.getValue1();
|
|
504
|
+
|
|
505
|
+
// Handle undefined subFilterOperator gracefully
|
|
506
|
+
if (subFilterOperator === undefined) {
|
|
507
|
+
Log.warning(
|
|
508
|
+
"FilterUtils._transformDateTimeOffsetFilters: Filter operator is undefined, skipping filter transformation",
|
|
509
|
+
`filterPath: ${subFilterPath}, filterValue1: ${subFilterValue1}`
|
|
510
|
+
);
|
|
511
|
+
continue; // Skip this sub-filter
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
if (subFilterOperator === "EQ" && subFilterValue1 !== undefined && subFilterValue1 !== null) {
|
|
515
|
+
// Check if any condition path matches the navigation pattern
|
|
516
|
+
const matchingConditionPath: string | undefined = Array.from(dateTimeOffsetPaths).find(function (
|
|
517
|
+
sConditionPath: string
|
|
518
|
+
): boolean {
|
|
519
|
+
// Extract navigation and property parts from condition path
|
|
520
|
+
const pathParts: string[] = sConditionPath.split("/");
|
|
521
|
+
if (pathParts.length === 2) {
|
|
522
|
+
const navigationPart: string = pathParts[0].replace("*", ""); // "_Item*" -> "_Item"
|
|
523
|
+
const propertyPart: string = pathParts[1]; // "BillingDocumentDate"
|
|
524
|
+
|
|
525
|
+
// Check if filter navigation matches and sub filter ends with property
|
|
526
|
+
return filterPath === navigationPart && Boolean(subFilterPath?.endsWith(propertyPart));
|
|
527
|
+
}
|
|
528
|
+
return false;
|
|
529
|
+
});
|
|
530
|
+
|
|
531
|
+
if (matchingConditionPath) {
|
|
532
|
+
const transformedSubFilter: Filter | null = this._transformDateTimeOffSetFilterValue(subFilter);
|
|
533
|
+
if (transformedSubFilter) {
|
|
534
|
+
nestedFilterWithMultipleConditions.aFilters[j] = transformedSubFilter;
|
|
535
|
+
hasTransformation = true;
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
// If any transformation occurred, recreate the Any filter with updated nested conditions
|
|
542
|
+
if (hasTransformation) {
|
|
543
|
+
aFilters[i] = new Filter({
|
|
544
|
+
path: filterPath,
|
|
545
|
+
operator: "Any",
|
|
546
|
+
variable: filter.getVariable(),
|
|
547
|
+
condition: new Filter({
|
|
548
|
+
filters: nestedFilterWithMultipleConditions.aFilters,
|
|
549
|
+
and: nestedFilterWithMultipleConditions.bAnd ?? true
|
|
550
|
+
})
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
} else {
|
|
554
|
+
// Handle single condition within navigation property
|
|
555
|
+
const nestedFilterPath: string | undefined = nestedFilter.getPath();
|
|
556
|
+
const nestedFilterOperator: FilterOperator | undefined = nestedFilter.getOperator() as FilterOperator | undefined;
|
|
557
|
+
|
|
558
|
+
const nestedFilterValue1: unknown = nestedFilter.getValue1();
|
|
559
|
+
|
|
560
|
+
// Handle undefined nestedFilterOperator gracefully
|
|
561
|
+
|
|
562
|
+
if (nestedFilterOperator === undefined) {
|
|
563
|
+
Log.warning(
|
|
564
|
+
"FilterUtils._transformDateTimeOffsetFilters: Filter operator is undefined, skipping filter transformation",
|
|
565
|
+
`filterPath: ${nestedFilterPath}, filterValue1: ${nestedFilterValue1}`
|
|
566
|
+
);
|
|
567
|
+
continue; // Skip this nested filter
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
if (nestedFilterOperator === "EQ" && nestedFilterValue1 !== undefined && nestedFilterValue1 !== null) {
|
|
571
|
+
// Check if any condition path matches the navigation pattern
|
|
572
|
+
const matchingConditionPath: string | undefined = Array.from(dateTimeOffsetPaths).find(function (
|
|
573
|
+
sConditionPath: string
|
|
574
|
+
): boolean {
|
|
575
|
+
// Extract navigation and property parts from condition path
|
|
576
|
+
const pathParts: string[] = sConditionPath.split("/");
|
|
577
|
+
if (pathParts.length === 2) {
|
|
578
|
+
const navigationPart: string = pathParts[0].replace("*", ""); // "_Item*" -> "_Item"
|
|
579
|
+
const propertyPart: string = pathParts[1]; // "RequestedDeliveryDate"
|
|
580
|
+
|
|
581
|
+
// Check if filter navigation matches and nested filter ends with property
|
|
582
|
+
return filterPath === navigationPart && Boolean(nestedFilterPath?.endsWith(propertyPart));
|
|
583
|
+
}
|
|
584
|
+
return false;
|
|
585
|
+
});
|
|
586
|
+
|
|
587
|
+
if (matchingConditionPath) {
|
|
588
|
+
const transformedNestedFilter: Filter | null = this._transformDateTimeOffSetFilterValue(nestedFilter);
|
|
589
|
+
if (transformedNestedFilter) {
|
|
590
|
+
// Create new Any filter with transformed nested filter
|
|
591
|
+
aFilters[i] = new Filter({
|
|
592
|
+
path: filterPath,
|
|
593
|
+
operator: "Any",
|
|
594
|
+
variable: filter.getVariable(),
|
|
595
|
+
condition: transformedNestedFilter
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
},
|
|
604
|
+
|
|
605
|
+
/**
|
|
606
|
+
* Transforms a single filter value from EQ to BT with microsecond precision.
|
|
607
|
+
* @param filter The filter object to transform
|
|
608
|
+
* @returns The transformed filter or null if no transformation needed
|
|
609
|
+
*/
|
|
610
|
+
_transformDateTimeOffSetFilterValue: function (filter: Filter): Filter | null {
|
|
611
|
+
const originalValue: string | undefined = filter.getValue1()?.toString();
|
|
612
|
+
|
|
613
|
+
if (!originalValue) {
|
|
614
|
+
return null;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
// Parse the datetime value: 2025-08-13T15:19:15.0000000+02:00 or 2025-08-13T15:19:15.0000000Z
|
|
618
|
+
const dateTimeMatch: RegExpMatchArray | null = originalValue.match(
|
|
619
|
+
/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2})(?:\.(\d{0,7}))?([+-]\d{2}:\d{2}|Z)$/
|
|
620
|
+
);
|
|
621
|
+
|
|
622
|
+
if (dateTimeMatch) {
|
|
623
|
+
const dateTimePart: string = dateTimeMatch[1];
|
|
624
|
+
const timezone: string = dateTimeMatch[3];
|
|
625
|
+
|
|
626
|
+
// Create microsecond range values
|
|
627
|
+
const startValue = `${dateTimePart}.0000000${timezone}`;
|
|
628
|
+
const endValue = `${dateTimePart}.9990000${timezone}`;
|
|
629
|
+
|
|
630
|
+
// Return new BT filter with microsecond range
|
|
631
|
+
return new Filter({
|
|
632
|
+
path: filter.getPath(),
|
|
633
|
+
operator: FilterOperator.BT,
|
|
634
|
+
value1: startValue,
|
|
635
|
+
value2: endValue
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
return null;
|
|
640
|
+
},
|
|
357
641
|
hasEditStateFilterRecursively: function (filters: Filter[]): boolean {
|
|
358
642
|
return filters.some((filter): boolean => {
|
|
359
643
|
if (filter.getPath() === "$editState") {
|