@sapui5/sap.fe.macros 1.140.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 +14 -10
- package/src/sap/fe/macros/Field.ts +15 -12
- package/src/sap/fe/macros/MacroAPI.js +9 -4
- package/src/sap/fe/macros/MacroAPI.ts +9 -4
- package/src/sap/fe/macros/MultiValueField.js +10 -5
- package/src/sap/fe/macros/MultiValueField.tsx +7 -1
- 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/Status.js +38 -13
- package/src/sap/fe/macros/Status.tsx +26 -6
- 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 +195 -55
- package/src/sap/fe/macros/ai/EasyFilterBar.tsx +234 -57
- 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/chart/Chart.js +2 -2
- package/src/sap/fe/macros/chart/Chart.tsx +1 -1
- package/src/sap/fe/macros/chart/MdcChartTemplate.js +4 -2
- package/src/sap/fe/macros/chart/MdcChartTemplate.tsx +4 -1
- 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 +2 -2
- package/src/sap/fe/macros/controls/BuildingBlockWithTemplating.ts +1 -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/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/field/Field.js +2 -2
- package/src/sap/fe/macros/field/Field.tsx +1 -1
- 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/FieldTemplating.js +3 -3
- package/src/sap/fe/macros/field/FieldTemplating.ts +4 -2
- package/src/sap/fe/macros/filter/FilterUtils.js +232 -2
- package/src/sap/fe/macros/filter/FilterUtils.ts +290 -4
- 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/FormContainer.block.js +555 -4
- package/src/sap/fe/macros/form/FormContainer.block.ts +665 -6
- package/src/sap/fe/macros/form/FormContainer.fragment.xml +1 -0
- package/src/sap/fe/macros/form/FormDelegate.js +6 -9
- package/src/sap/fe/macros/form/FormDelegate.ts +5 -8
- 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 +16 -8
- package/src/sap/fe/macros/internal/FilterField.block.ts +11 -7
- package/src/sap/fe/macros/internal/field/DisplayStyle.js +7 -1
- package/src/sap/fe/macros/internal/field/DisplayStyle.tsx +8 -0
- 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 +4 -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/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 +20 -2
- package/src/sap/fe/macros/messagebundle_ar.properties +1 -1
- package/src/sap/fe/macros/messagebundle_bg.properties +1 -1
- package/src/sap/fe/macros/messagebundle_ca.properties +1 -1
- package/src/sap/fe/macros/messagebundle_cnr.properties +1 -1
- package/src/sap/fe/macros/messagebundle_cs.properties +1 -1
- package/src/sap/fe/macros/messagebundle_cy.properties +1 -1
- package/src/sap/fe/macros/messagebundle_da.properties +1 -1
- package/src/sap/fe/macros/messagebundle_de.properties +4 -4
- package/src/sap/fe/macros/messagebundle_el.properties +1 -1
- package/src/sap/fe/macros/messagebundle_en.properties +1 -1
- package/src/sap/fe/macros/messagebundle_en_GB.properties +1 -1
- package/src/sap/fe/macros/messagebundle_en_US_saprigi.properties +1 -1
- package/src/sap/fe/macros/messagebundle_es.properties +2 -2
- package/src/sap/fe/macros/messagebundle_es_MX.properties +1 -1
- package/src/sap/fe/macros/messagebundle_et.properties +1 -1
- package/src/sap/fe/macros/messagebundle_fi.properties +1 -1
- package/src/sap/fe/macros/messagebundle_fr.properties +1 -1
- package/src/sap/fe/macros/messagebundle_fr_CA.properties +1 -1
- package/src/sap/fe/macros/messagebundle_hi.properties +1 -1
- package/src/sap/fe/macros/messagebundle_hr.properties +1 -1
- package/src/sap/fe/macros/messagebundle_hu.properties +1 -1
- package/src/sap/fe/macros/messagebundle_id.properties +5 -5
- package/src/sap/fe/macros/messagebundle_it.properties +1 -1
- package/src/sap/fe/macros/messagebundle_iw.properties +1 -1
- package/src/sap/fe/macros/messagebundle_ja.properties +5 -5
- package/src/sap/fe/macros/messagebundle_kk.properties +1 -1
- package/src/sap/fe/macros/messagebundle_ko.properties +2 -2
- package/src/sap/fe/macros/messagebundle_lt.properties +2 -2
- package/src/sap/fe/macros/messagebundle_lv.properties +1 -1
- package/src/sap/fe/macros/messagebundle_mk.properties +2 -2
- package/src/sap/fe/macros/messagebundle_ms.properties +1 -1
- package/src/sap/fe/macros/messagebundle_nl.properties +1 -1
- package/src/sap/fe/macros/messagebundle_no.properties +1 -1
- package/src/sap/fe/macros/messagebundle_pl.properties +1 -1
- package/src/sap/fe/macros/messagebundle_pt.properties +1 -1
- package/src/sap/fe/macros/messagebundle_pt_PT.properties +1 -1
- package/src/sap/fe/macros/messagebundle_ro.properties +1 -1
- package/src/sap/fe/macros/messagebundle_ru.properties +1 -1
- package/src/sap/fe/macros/messagebundle_sh.properties +1 -1
- package/src/sap/fe/macros/messagebundle_sk.properties +1 -1
- package/src/sap/fe/macros/messagebundle_sl.properties +1 -1
- package/src/sap/fe/macros/messagebundle_sr.properties +1 -1
- package/src/sap/fe/macros/messagebundle_sv.properties +1 -1
- package/src/sap/fe/macros/messagebundle_th.properties +1 -1
- package/src/sap/fe/macros/messagebundle_tr.properties +1 -1
- package/src/sap/fe/macros/messagebundle_uk.properties +1 -1
- package/src/sap/fe/macros/messagebundle_vi.properties +2 -2
- package/src/sap/fe/macros/messagebundle_zh_CN.properties +1 -1
- package/src/sap/fe/macros/messagebundle_zh_TW.properties +1 -1
- package/src/sap/fe/macros/messages/MessageButton.js +1 -1
- package/src/sap/fe/macros/messages/MessageButton.ts +2 -2
- package/src/sap/fe/macros/messages/MessagePopover.js +3 -1
- package/src/sap/fe/macros/messages/MessagePopover.ts +2 -0
- 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/MicroChartHelper.js +2 -2
- package/src/sap/fe/macros/microchart/MicroChartHelper.tsx +1 -1
- 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 +5 -5
- package/src/sap/fe/macros/table/MdcTableTemplate.tsx +15 -9
- 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 -2
- package/src/sap/fe/macros/table/TableHelper.ts +1 -1
- 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 +3 -2
- package/src/sap/fe/macros/table/Utils.ts +7 -2
- package/src/sap/fe/macros/table/delegates/TableDelegate.js +69 -33
- package/src/sap/fe/macros/table/delegates/TableDelegate.ts +75 -32
- 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/TableSharing.js +3 -2
- package/src/sap/fe/macros/table/mixin/TableSharing.ts +4 -3
- package/src/sap/fe/macros/valuehelp/ValueHelpDelegate.js +27 -10
- package/src/sap/fe/macros/valuehelp/ValueHelpDelegate.ts +31 -13
- package/src/sap/fe/macros/visualfilters/VisualFilter.js +5 -3
- package/src/sap/fe/macros/visualfilters/VisualFilter.tsx +3 -1
|
@@ -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,7 +326,7 @@ const oFilterUtils = {
|
|
|
326
326
|
aIgnoreProperties.concat(aParameters)
|
|
327
327
|
) as { filters: Filter }
|
|
328
328
|
).filters;
|
|
329
|
-
const hasEditStateMetadata = aPropertiesMetadata?.filter((property) => property.
|
|
329
|
+
const hasEditStateMetadata = aPropertiesMetadata?.filter((property) => property.name === "$editState");
|
|
330
330
|
let editStateFilter: Filter | undefined;
|
|
331
331
|
if (!aIgnoreProperties.includes("$editState") && hasEditStateMetadata && hasEditStateMetadata.length > 0) {
|
|
332
332
|
if (mConditions.hasOwnProperty("$editState")) {
|
|
@@ -335,8 +335,26 @@ const oFilterUtils = {
|
|
|
335
335
|
} else {
|
|
336
336
|
editStateFilter = EDITSTATE.getFilterForEditState("");
|
|
337
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
|
+
}
|
|
338
350
|
}
|
|
339
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
|
+
|
|
340
358
|
if (editStateFilter) {
|
|
341
359
|
const hasEditStateFilter = this.hasEditStateFilterRecursively(aFilters);
|
|
342
360
|
if (hasEditStateFilter) {
|
|
@@ -352,6 +370,274 @@ const oFilterUtils = {
|
|
|
352
370
|
}
|
|
353
371
|
return aFilters;
|
|
354
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
|
+
},
|
|
355
641
|
hasEditStateFilterRecursively: function (filters: Filter[]): boolean {
|
|
356
642
|
return filters.some((filter): boolean => {
|
|
357
643
|
if (filter.getPath() === "$editState") {
|