@sapui5/sap.fe.macros 1.142.0 → 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/CollaborativeDraftHandler.js +1 -7
- package/src/sap/fe/macros/CollaborativeDraftHandler.tsx +0 -6
- 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 +5 -5
- package/src/sap/fe/macros/Field.ts +5 -3
- package/src/sap/fe/macros/FooterContent.js +3 -2
- package/src/sap/fe/macros/FooterContent.tsx +2 -10
- package/src/sap/fe/macros/KPITag.js +6 -6
- package/src/sap/fe/macros/KPITag.tsx +5 -5
- package/src/sap/fe/macros/MacroAPI.js +2 -2
- package/src/sap/fe/macros/MacroAPI.ts +1 -1
- package/src/sap/fe/macros/MessageButton.js +3 -3
- package/src/sap/fe/macros/MessageButton.tsx +3 -2
- package/src/sap/fe/macros/MicroChart.js +3 -2
- package/src/sap/fe/macros/MicroChart.tsx +1 -1
- 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 +6 -5
- package/src/sap/fe/macros/Status.tsx +3 -4
- 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/SummarizationButton.js +6 -4
- package/src/sap/fe/macros/ai/SummarizationButton.tsx +5 -3
- package/src/sap/fe/macros/chart/ChartDelegate.js +22 -1
- package/src/sap/fe/macros/chart/ChartDelegate.ts +29 -2
- package/src/sap/fe/macros/chart/MdcChartTemplate.js +5 -2
- package/src/sap/fe/macros/chart/MdcChartTemplate.tsx +5 -2
- 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/NumberWithUnitOrCurrency.js +3 -1
- package/src/sap/fe/macros/controls/NumberWithUnitOrCurrency.tsx +2 -0
- package/src/sap/fe/macros/coreUI/CreateDialog.js +2 -2
- package/src/sap/fe/macros/coreUI/CreateDialog.tsx +1 -1
- package/src/sap/fe/macros/coreUI/OperationParameterDialog.js +4 -4
- package/src/sap/fe/macros/coreUI/OperationParameterDialog.tsx +3 -3
- package/src/sap/fe/macros/field/FieldFormatOptions.js +2 -2
- package/src/sap/fe/macros/field/FieldFormatOptions.ts +1 -1
- package/src/sap/fe/macros/field/FieldRuntime.js +7 -2
- package/src/sap/fe/macros/field/FieldRuntime.ts +7 -1
- package/src/sap/fe/macros/filter/FilterUtils.js +31 -5
- package/src/sap/fe/macros/filter/FilterUtils.ts +40 -6
- package/src/sap/fe/macros/filterBar/FilterBarAPI.js +6 -3
- package/src/sap/fe/macros/filterBar/FilterBarAPI.ts +5 -1
- package/src/sap/fe/macros/filterBar/FilterBarDelegate.js +19 -9
- package/src/sap/fe/macros/filterBar/FilterBarDelegate.ts +76 -61
- 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/form/FormContainer.block.js +22 -6
- package/src/sap/fe/macros/form/FormContainer.block.ts +24 -6
- 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} +1 -1
- package/src/sap/fe/macros/messagebundle.properties +6 -0
- package/src/sap/fe/macros/messagebundle_en_US_saprigi.properties +1 -1
- 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/table/Action.js +7 -4
- package/src/sap/fe/macros/table/Action.ts +3 -3
- 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 +6 -9
- package/src/sap/fe/macros/table/MdcTableTemplate.tsx +5 -7
- package/src/sap/fe/macros/table/Table.block.js +6 -3
- package/src/sap/fe/macros/table/Table.block.tsx +13 -3
- package/src/sap/fe/macros/table/TableAPI.js +13 -8
- package/src/sap/fe/macros/table/TableAPI.ts +10 -3
- package/src/sap/fe/macros/table/TableDefinition.js +2 -2
- package/src/sap/fe/macros/table/TableDefinition.ts +1 -1
- package/src/sap/fe/macros/table/TableEventHandlerProvider.js +3 -1
- package/src/sap/fe/macros/table/TableEventHandlerProvider.ts +4 -0
- package/src/sap/fe/macros/table/TableRuntime.js +24 -12
- package/src/sap/fe/macros/table/TableRuntime.ts +27 -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 +6 -4
- package/src/sap/fe/macros/table/delegates/TableDelegate.ts +6 -5
- 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 +14 -5
- package/src/sap/fe/macros/table/massEdit/MassEditDialogHelper.tsx +13 -4
- 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 +37 -10
- package/src/sap/fe/macros/table/mixin/EmptyRowsHandler.ts +39 -15
- 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
|
@@ -39,6 +39,7 @@ import DelegateUtil from "sap/fe/macros/DelegateUtil";
|
|
|
39
39
|
import FieldHelper from "sap/fe/macros/field/FieldHelper";
|
|
40
40
|
import type { IFilterControl } from "sap/fe/macros/filter/FilterUtils";
|
|
41
41
|
import FilterUtils from "sap/fe/macros/filter/FilterUtils";
|
|
42
|
+
import UOMValidationDelegate from "sap/fe/macros/filterBar/UOMValidationDelegate";
|
|
42
43
|
import type { PropertyInfo } from "sap/fe/macros/internal/PropertyInfo";
|
|
43
44
|
import { getValueHelpTemplate } from "sap/fe/macros/internal/valuehelp/ValueHelpTemplating";
|
|
44
45
|
import type { ControlPropertyInfo } from "sap/fe/macros/mdc/adapter/StateHelper";
|
|
@@ -60,61 +61,62 @@ import type MacroAPI from "../MacroAPI";
|
|
|
60
61
|
|
|
61
62
|
type ModifierElement = UI5Element | UI5Element[] | Element | Element[];
|
|
62
63
|
type NullableModifierElement = void | ModifierElement | null;
|
|
63
|
-
const ODataFilterBarDelegate = Object.assign({}, FilterBarDelegate) as typeof FilterBarDelegate &
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
64
|
+
const ODataFilterBarDelegate = Object.assign({}, FilterBarDelegate, UOMValidationDelegate) as typeof FilterBarDelegate &
|
|
65
|
+
typeof UOMValidationDelegate & {
|
|
66
|
+
apiVersion: number;
|
|
67
|
+
_isFilterInSelectionFields(selectionFields: SelectionFields, filterFieldInfo: FilterField): boolean;
|
|
68
|
+
_findSelectionField(aSelectionFields: FilterField[], sFlexName: string): FilterField | undefined;
|
|
69
|
+
clearFilters(oFilterControl: FilterBar): Promise<void>;
|
|
70
|
+
getTypeMap(): typeof TypeMap;
|
|
71
|
+
fetchFilterProperties(filterBar: IFilterControl): Promise<ControlPropertyInfo[] | PropertyInfoExternal[]>;
|
|
72
|
+
fetchProperties(filterBar: FilterBar): Promise<PropertyInfoExternal[]>;
|
|
73
|
+
_isFilterAdaptable(
|
|
74
|
+
filterFieldInfo: FilterField,
|
|
75
|
+
propertyAnnotations: Property,
|
|
76
|
+
selectionFields?: SelectionFields,
|
|
77
|
+
filterFacets?: FilterFacets
|
|
78
|
+
): boolean;
|
|
79
|
+
fetchPropertiesForEntity(sEntityTypePath: string, oMetaModel: ODataMetaModel, oFilterControl: IFilterControl): PropertyInfo[];
|
|
80
|
+
_templateCustomFilter(
|
|
81
|
+
oFilterBar: IFilterControl,
|
|
82
|
+
sIdPrefix: string,
|
|
83
|
+
oSelectionFieldInfo: FilterField,
|
|
84
|
+
oMetaModel: ODataMetaModel,
|
|
85
|
+
oModifier: BaseTreeModifier
|
|
86
|
+
): Promise<ModifierElement>;
|
|
87
|
+
_addP13nItem(sPropertyInfoName: string, oParentControl: FilterBar): Promise<NullableModifierElement>;
|
|
88
|
+
_addFlexItem(
|
|
89
|
+
sFlexPropertyName: string,
|
|
90
|
+
oParentControl: FilterBar,
|
|
91
|
+
oMetaModel: ODataMetaModel,
|
|
92
|
+
oModifier: BaseTreeModifier | undefined,
|
|
93
|
+
oAppComponent?: AppComponent,
|
|
94
|
+
view?: View
|
|
95
|
+
): Promise<NullableModifierElement>;
|
|
96
|
+
addItem(
|
|
97
|
+
oParentControl: FilterBar,
|
|
98
|
+
sPropertyInfoName: string,
|
|
99
|
+
mPropertyBag?: { modifier: BaseTreeModifier; appComponent: AppComponent }
|
|
100
|
+
): Promise<NullableModifierElement>;
|
|
101
|
+
addCondition(
|
|
102
|
+
oParentControl: FilterBar,
|
|
103
|
+
sPropertyInfoName: string,
|
|
104
|
+
mPropertyBag: { appComponent: AppComponent; modifier: BaseTreeModifier }
|
|
105
|
+
): Promise<void | null>;
|
|
106
|
+
removeItem(
|
|
107
|
+
oParentControl: FilterBar,
|
|
108
|
+
oFilterFieldProperty: UI5Element | Element,
|
|
109
|
+
mPropertyBag: { appComponent: AppComponent; modifier: BaseTreeModifier }
|
|
110
|
+
): Promise<boolean | null>;
|
|
111
|
+
removeCondition(
|
|
112
|
+
oParentControl: FilterBar,
|
|
113
|
+
sPropertyInfoName: string,
|
|
114
|
+
mPropertyBag: {
|
|
115
|
+
appComponent: AppComponent;
|
|
116
|
+
modifier: BaseTreeModifier;
|
|
117
|
+
}
|
|
118
|
+
): Promise<void | null>;
|
|
119
|
+
};
|
|
118
120
|
ODataFilterBarDelegate.apiVersion = 2;
|
|
119
121
|
const EDIT_STATE_PROPERTY_NAME = "$editState",
|
|
120
122
|
SEARCH_PROPERTY_NAME = "$search",
|
|
@@ -420,8 +422,9 @@ async function _addPropertyInfo(
|
|
|
420
422
|
|
|
421
423
|
const delegate = await mPropertyBag.modifier.getProperty<FilterBarDelegate>(oParentControl, "delegate");
|
|
422
424
|
const aPropertyInfo = await mPropertyBag.modifier.getProperty<FEPropertyInfo[]>(oParentControl, "propertyInfo");
|
|
425
|
+
const propertyInfoExists = await FilterUtils._checkIfPropertyInfoExists(oParentControl, mPropertyBag.modifier, sPropertyInfoName);
|
|
423
426
|
//We do not get propertyInfo in case of table filters
|
|
424
|
-
if (aPropertyInfo) {
|
|
427
|
+
if (aPropertyInfo && !propertyInfoExists) {
|
|
425
428
|
const hasPropertyInfo = aPropertyInfo.some(function (prop: FEPropertyInfo) {
|
|
426
429
|
return prop.key === sPropertyInfoKey || prop.name === sPropertyInfoKey;
|
|
427
430
|
});
|
|
@@ -479,12 +482,13 @@ async function _updatePropertyInfo(
|
|
|
479
482
|
propertyBag.modifier.setProperty(parentControl, "propertyInfo", _propertyInfo);
|
|
480
483
|
}
|
|
481
484
|
/**
|
|
482
|
-
* Method responsible for creating filter field in standalone mode
|
|
485
|
+
* Method responsible for creating the filter field in standalone mode and in the personalization settings of the filter bar.
|
|
483
486
|
* @param oParentControl Parent control instance to which the filter field is added
|
|
484
487
|
* @param sPropertyInfoName Name of the property being added as the filter field
|
|
485
488
|
* @param mPropertyBag Instance of the property bag from Flex API
|
|
486
489
|
* @param mPropertyBag.appComponent AppComponent
|
|
487
490
|
* @param mPropertyBag.modifier Modifier from Flex API
|
|
491
|
+
* @param mPropertyBag.view Instance of the view
|
|
488
492
|
* @returns Once resolved, a filter field definition is returned
|
|
489
493
|
*/
|
|
490
494
|
ODataFilterBarDelegate.addItem = async function (
|
|
@@ -503,7 +507,8 @@ ODataFilterBarDelegate.addItem = async function (
|
|
|
503
507
|
return Promise.resolve(null);
|
|
504
508
|
}
|
|
505
509
|
const isXML = modifier && modifier.targets === "xmlTree";
|
|
506
|
-
|
|
510
|
+
const propertyInfoExists = isXML ? await FilterUtils._checkIfPropertyInfoExists(oParentControl, modifier, sPropertyInfoName) : true;
|
|
511
|
+
if (isXML && !propertyInfoExists) {
|
|
507
512
|
await _addPropertyInfo(oParentControl, mPropertyBag, oMetaModel, sPropertyInfoName);
|
|
508
513
|
}
|
|
509
514
|
return ODataFilterBarDelegate._addFlexItem(
|
|
@@ -540,6 +545,7 @@ ODataFilterBarDelegate.removeItem = async function (
|
|
|
540
545
|
return Promise.resolve(null);
|
|
541
546
|
}
|
|
542
547
|
const filterFieldProperty = await mPropertyBag.modifier.getProperty(oFilterFieldProperty, "propertyKey");
|
|
548
|
+
|
|
543
549
|
await _addPropertyInfo(oParentControl, mPropertyBag, oMetaModel, filterFieldProperty as string);
|
|
544
550
|
}
|
|
545
551
|
if (
|
|
@@ -864,6 +870,14 @@ ODataFilterBarDelegate._addFlexItem = async function (
|
|
|
864
870
|
oAppComponent: AppComponent | undefined,
|
|
865
871
|
view?: View | undefined
|
|
866
872
|
): Promise<NullableModifierElement> {
|
|
873
|
+
let propertyInfosFromFilterBar: PropertyInfo[] = [];
|
|
874
|
+
const bIsXML = !!oModifier && oModifier.targets === "xmlTree";
|
|
875
|
+
if (bIsXML) {
|
|
876
|
+
const customDataValue = await DelegateUtil.getCustomDataWithModifier<string>(oParentControl, "feFilterInfo", oModifier);
|
|
877
|
+
if (customDataValue) {
|
|
878
|
+
propertyInfosFromFilterBar = JSON.parse(customDataValue) as PropertyInfo[]; // retrieve pre-fetched filter info from custom data, required during templating
|
|
879
|
+
}
|
|
880
|
+
}
|
|
867
881
|
const sFilterBarId = oModifier ? oModifier.getId(oParentControl) : oParentControl.getId(),
|
|
868
882
|
sIdPrefix = oModifier ? "" : "Adaptation",
|
|
869
883
|
aSelectionFields = FilterUtils.getConvertedFilterFields(
|
|
@@ -873,11 +887,12 @@ ODataFilterBarDelegate._addFlexItem = async function (
|
|
|
873
887
|
oMetaModel,
|
|
874
888
|
oAppComponent,
|
|
875
889
|
oModifier,
|
|
876
|
-
oModifier ? undefined : getLineItemQualifierFromTable(oParentControl.getParent()!, oMetaModel)
|
|
890
|
+
oModifier ? undefined : getLineItemQualifierFromTable(oParentControl.getParent()!, oMetaModel),
|
|
891
|
+
propertyInfosFromFilterBar
|
|
877
892
|
),
|
|
878
893
|
oSelectionField = ODataFilterBarDelegate._findSelectionField(aSelectionFields, sFlexPropertyName),
|
|
879
|
-
sPropertyPath = _getPropertyPath(sFlexPropertyName)
|
|
880
|
-
|
|
894
|
+
sPropertyPath = _getPropertyPath(sFlexPropertyName);
|
|
895
|
+
|
|
881
896
|
if (sFlexPropertyName === EDIT_STATE_PROPERTY_NAME) {
|
|
882
897
|
return _templateEditState(_generateIdPrefix(sFilterBarId, `${sIdPrefix}FilterField`), oMetaModel, oModifier);
|
|
883
898
|
} else if (sFlexPropertyName === SEARCH_PROPERTY_NAME) {
|