@sapui5/sap.fe.core 1.136.0 → 1.136.1
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/core/.library +1 -1
- package/src/sap/fe/core/AppComponent.js +4 -6
- package/src/sap/fe/core/AppComponent.ts +4 -4
- package/src/sap/fe/core/CommonUtils.js +41 -14
- package/src/sap/fe/core/CommonUtils.ts +47 -16
- package/src/sap/fe/core/IRowBindingInterface.js +1 -1
- package/src/sap/fe/core/IRowBindingInterface.ts +1 -1
- package/src/sap/fe/core/buildingBlocks/BuildingBlock.js +4 -1
- package/src/sap/fe/core/buildingBlocks/BuildingBlock.ts +3 -0
- package/src/sap/fe/core/buildingBlocks/templating/BuildingBlockTemplateProcessor.js +12 -4
- package/src/sap/fe/core/buildingBlocks/templating/BuildingBlockTemplateProcessor.ts +10 -3
- package/src/sap/fe/core/controllerextensions/CollaborativeDraft.js +139 -5
- package/src/sap/fe/core/controllerextensions/CollaborativeDraft.ts +169 -4
- package/src/sap/fe/core/controllerextensions/EditFlow.js +48 -43
- package/src/sap/fe/core/controllerextensions/EditFlow.ts +54 -51
- package/src/sap/fe/core/controllerextensions/InlineEditFlow.js +39 -5
- package/src/sap/fe/core/controllerextensions/InlineEditFlow.ts +38 -1
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +12 -13
- package/src/sap/fe/core/controllerextensions/InternalRouting.ts +10 -11
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +32 -21
- package/src/sap/fe/core/controllerextensions/MessageHandler.ts +31 -20
- package/src/sap/fe/core/controllerextensions/PageReady.js +6 -3
- package/src/sap/fe/core/controllerextensions/PageReady.ts +6 -2
- package/src/sap/fe/core/controllerextensions/Recommendations.js +3 -2
- package/src/sap/fe/core/controllerextensions/Recommendations.ts +7 -5
- package/src/sap/fe/core/controllerextensions/Share.js +6 -6
- package/src/sap/fe/core/controllerextensions/Share.ts +3 -4
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.js +9 -11
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.ts +8 -13
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js +9 -9
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.ts +20 -10
- package/src/sap/fe/core/controllerextensions/editFlow/draft.js +31 -8
- package/src/sap/fe/core/controllerextensions/editFlow/draft.ts +46 -9
- package/src/sap/fe/core/controllerextensions/editFlow/draftDataLossPopup.js +2 -2
- package/src/sap/fe/core/controllerextensions/editFlow/draftDataLossPopup.ts +1 -1
- package/src/sap/fe/core/controllerextensions/editFlow/operations/ODataOperation.js +20 -18
- package/src/sap/fe/core/controllerextensions/editFlow/operations/ODataOperation.ts +37 -23
- package/src/sap/fe/core/controllerextensions/editFlow/operations/ODataStrictHandling.js +4 -3
- package/src/sap/fe/core/controllerextensions/editFlow/operations/ODataStrictHandling.ts +6 -1
- package/src/sap/fe/core/controllerextensions/editFlow/operations/Operation.js +6 -3
- package/src/sap/fe/core/controllerextensions/editFlow/operations/Operation.ts +11 -3
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.js +5 -2
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.ts +3 -2
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js +2 -2
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.ts +1 -1
- package/src/sap/fe/core/controls/CommandExecution.js +1 -1
- package/src/sap/fe/core/controls/CommandExecution.ts +1 -1
- package/src/sap/fe/core/controls/HideFormGroupAutomatically.js +3 -2
- package/src/sap/fe/core/controls/HideFormGroupAutomatically.ts +2 -0
- package/src/sap/fe/core/converters/controls/Common/Action.js +5 -2
- package/src/sap/fe/core/converters/controls/Common/Action.ts +4 -1
- package/src/sap/fe/core/converters/controls/Common/Chart.js +7 -2
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +11 -1
- package/src/sap/fe/core/converters/controls/Common/table/Columns.js +41 -58
- package/src/sap/fe/core/converters/controls/Common/table/Columns.ts +43 -111
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +14 -6
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +23 -6
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +6 -3
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +5 -2
- package/src/sap/fe/core/formatters/ValueFormatter.js +21 -1
- package/src/sap/fe/core/formatters/ValueFormatter.ts +19 -0
- package/src/sap/fe/core/fpm/manifest.json +1 -1
- package/src/sap/fe/core/helpers/DeleteHelper.js +2 -2
- package/src/sap/fe/core/helpers/DeleteHelper.ts +1 -1
- package/src/sap/fe/core/helpers/ModelHelper.js +2 -2
- package/src/sap/fe/core/helpers/ModelHelper.ts +1 -1
- package/src/sap/fe/core/helpers/PasteHelper.js +2 -2
- package/src/sap/fe/core/helpers/PasteHelper.ts +1 -1
- package/src/sap/fe/core/helpers/StableIdHelper.js +2 -2
- package/src/sap/fe/core/helpers/StableIdHelper.ts +4 -1
- package/src/sap/fe/core/helpers/TitleHelper.js +13 -6
- package/src/sap/fe/core/helpers/TitleHelper.ts +19 -6
- package/src/sap/fe/core/library.js +1 -1
- package/src/sap/fe/core/messagebundle.properties +0 -1
- package/src/sap/fe/core/rootView/Fcl.controller.js +9 -15
- package/src/sap/fe/core/rootView/Fcl.controller.ts +9 -15
- package/src/sap/fe/core/services/collaborativeDraftServiceFactory.js +9 -6
- package/src/sap/fe/core/services/collaborativeDraftServiceFactory.ts +7 -6
- package/src/sap/fe/core/templating/DataModelPathHelper.js +2 -2
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +1 -1
- package/src/sap/fe/core/templating/EntitySetHelper.js +60 -48
- package/src/sap/fe/core/templating/EntitySetHelper.ts +80 -58
- package/src/sap/fe/core/templating/SemanticObjectHelper.js +6 -4
- package/src/sap/fe/core/templating/SemanticObjectHelper.ts +5 -5
- package/src/sap/fe/core/templating/UIFormatters.js +7 -1
- package/src/sap/fe/core/templating/UIFormatters.ts +4 -0
|
@@ -26,7 +26,8 @@ import {
|
|
|
26
26
|
ifElse,
|
|
27
27
|
not,
|
|
28
28
|
or,
|
|
29
|
-
pathInModel
|
|
29
|
+
pathInModel,
|
|
30
|
+
setUpConstraints
|
|
30
31
|
} from "sap/fe/base/BindingToolkit";
|
|
31
32
|
import type ConverterContext from "sap/fe/core/converters/ConverterContext";
|
|
32
33
|
import type {
|
|
@@ -100,6 +101,7 @@ import type { DefaultTypeForEdmType } from "sap/fe/core/type/EDM";
|
|
|
100
101
|
import tableFormatters from "sap/fe/macros/formatters/TableFormatter";
|
|
101
102
|
import type Control from "sap/ui/core/Control";
|
|
102
103
|
import type { MDCTablePropertyInfo as PropertyInfo, VisualSettings } from "sap/ui/mdc/Table";
|
|
104
|
+
import type SimpleType from "sap/ui/model/SimpleType";
|
|
103
105
|
|
|
104
106
|
// Custom Column from Manifest
|
|
105
107
|
type ManifestDefinedCustomColumn = CustomDefinedTableColumn & {
|
|
@@ -161,7 +163,7 @@ type AnnotationTableColumnForOverride = BaseTableColumn & {
|
|
|
161
163
|
exportSettings?: ColumnExportSettings | null;
|
|
162
164
|
};
|
|
163
165
|
|
|
164
|
-
type PropertyTypeConstraints = Partial<{
|
|
166
|
+
export type PropertyTypeConstraints = Partial<{
|
|
165
167
|
scale: number;
|
|
166
168
|
precision: number;
|
|
167
169
|
maxLength: number;
|
|
@@ -180,9 +182,9 @@ export type PropertyTypeFormatOptions = Partial<{
|
|
|
180
182
|
|
|
181
183
|
export type PropertyTypeConfig = {
|
|
182
184
|
type?: string;
|
|
183
|
-
constraints
|
|
184
|
-
formatOptions
|
|
185
|
-
typeInstance?:
|
|
185
|
+
constraints?: PropertyTypeConstraints;
|
|
186
|
+
formatOptions?: PropertyTypeFormatOptions;
|
|
187
|
+
typeInstance?: SimpleType;
|
|
186
188
|
baseType?: string;
|
|
187
189
|
className?: keyof typeof DefaultTypeForEdmType;
|
|
188
190
|
};
|
|
@@ -463,8 +465,6 @@ export const getColumnsFromEntityType = function (
|
|
|
463
465
|
columnsToBeCreated[name] = relatedPropertiesInfo.properties[name].annotationProperty;
|
|
464
466
|
});
|
|
465
467
|
}
|
|
466
|
-
// update Property Label when it's referenced only once in a column, new label will be the label of the column
|
|
467
|
-
updatePropertyLabel(annotationColumns, columnsToBeCreated, columnInfo);
|
|
468
468
|
if (additionalPropertyNames.length > 0) {
|
|
469
469
|
columnInfo.additionalPropertyInfos = additionalPropertyNames;
|
|
470
470
|
// Create columns for additional properties identified for ALP use case.
|
|
@@ -551,7 +551,7 @@ const getColumnDefinitionFromProperty = function (
|
|
|
551
551
|
const isAPropertyFromTextOnlyAnnotation = displayModeOfDescriptionPropertiesMap[relativePath] === "Description";
|
|
552
552
|
const sortable =
|
|
553
553
|
(!isHidden || isAPropertyFromTextOnlyAnnotation) && !restrictionsOnProperties?.nonSortableProperties.includes(relativePath);
|
|
554
|
-
const filterable = !
|
|
554
|
+
const filterable = !restrictionsOnProperties?.nonFilterableProperties.includes(relativePath);
|
|
555
555
|
const typeConfig = {
|
|
556
556
|
className: property.type || dataType,
|
|
557
557
|
formatOptions: propertyTypeConfig.formatOptions,
|
|
@@ -561,8 +561,7 @@ const getColumnDefinitionFromProperty = function (
|
|
|
561
561
|
if (_isExportableColumn(property)) {
|
|
562
562
|
exportSettings = createColumnExportSettings(property, relatedPropertiesInfo);
|
|
563
563
|
}
|
|
564
|
-
const availability:
|
|
565
|
-
!isHidden && (availableForAdaptation || displayModeOfDescriptionPropertiesMap[relativePath]) ? "Adaptation" : "Hidden";
|
|
564
|
+
const availability = !isHidden && availableForAdaptation ? "Adaptation" : "Hidden";
|
|
566
565
|
const collectedNavigationPropertyLabels: string[] | undefined = _getCollectedNavigationPropertyLabels(relativePath, converterContext);
|
|
567
566
|
if (relativePathForMultiValue) {
|
|
568
567
|
relativePath = relativePathForMultiValue;
|
|
@@ -699,33 +698,6 @@ const removeUndefinedFromExportSettings = function (exportSettings: ColumnExport
|
|
|
699
698
|
return exportSettings;
|
|
700
699
|
};
|
|
701
700
|
|
|
702
|
-
/**
|
|
703
|
-
* Update property label in case it's only referenced in one column. The label of the column must be used instead of the property label.
|
|
704
|
-
* This update also is applied for the tooltip as it is based on the column's label.
|
|
705
|
-
* @param annotationColumns The array of columns created based on LineItem annotations.
|
|
706
|
-
* @param columnsToBeCreated The columns to be created
|
|
707
|
-
* @param columnInfo The column definition
|
|
708
|
-
* @param columnName The name of the column
|
|
709
|
-
*/
|
|
710
|
-
function updatePropertyLabel(
|
|
711
|
-
annotationColumns: AnnotationTableColumn[],
|
|
712
|
-
columnsToBeCreated: Record<string, Property>,
|
|
713
|
-
columnInfo: AnnotationTableColumn,
|
|
714
|
-
columnName?: string
|
|
715
|
-
): void {
|
|
716
|
-
const linkedAnnotationColumns = annotationColumns.filter(
|
|
717
|
-
(col) => col.propertyInfos?.includes(columnInfo.relativePath) || (columnName && col.propertyInfos?.includes(columnName))
|
|
718
|
-
);
|
|
719
|
-
if (
|
|
720
|
-
linkedAnnotationColumns?.length === 1 &&
|
|
721
|
-
(columnsToBeCreated[columnInfo.relativePath] || (columnName && columnsToBeCreated[columnName])) &&
|
|
722
|
-
linkedAnnotationColumns[0].propertyInfos?.length === 1
|
|
723
|
-
) {
|
|
724
|
-
columnInfo.label = linkedAnnotationColumns[0].label;
|
|
725
|
-
columnInfo.tooltip = linkedAnnotationColumns[0].tooltip;
|
|
726
|
-
}
|
|
727
|
-
}
|
|
728
|
-
|
|
729
701
|
/**
|
|
730
702
|
* Returns Boolean true for exportable columns, false for non exportable columns.
|
|
731
703
|
* @param source The dataField or property to be evaluated
|
|
@@ -989,7 +961,6 @@ const _createRelatedColumns = function (
|
|
|
989
961
|
newNameRelativeTargetPath
|
|
990
962
|
);
|
|
991
963
|
computeHiddenOnRelatedColumns(existingColumns, name, column);
|
|
992
|
-
updatePropertyLabel(existingColumns, columnsToBeCreated, column, name);
|
|
993
964
|
relatedColumns.push(column);
|
|
994
965
|
relatedPropertyNameMap[name] = newNameRelativeTargetPath ?? name;
|
|
995
966
|
} else if (relatedColumn === undefined) {
|
|
@@ -1008,7 +979,6 @@ const _createRelatedColumns = function (
|
|
|
1008
979
|
tableCreationMode
|
|
1009
980
|
);
|
|
1010
981
|
computeHiddenOnRelatedColumns(existingColumns, name, column);
|
|
1011
|
-
updatePropertyLabel(existingColumns, columnsToBeCreated, column);
|
|
1012
982
|
relatedColumns.push(column);
|
|
1013
983
|
} else if (relatedColumn.annotationPath !== annotationPath || relatedColumn.propertyInfos) {
|
|
1014
984
|
// Case 2: The existing column points to a LineItem (or)
|
|
@@ -1031,7 +1001,6 @@ const _createRelatedColumns = function (
|
|
|
1031
1001
|
tableCreationMode
|
|
1032
1002
|
);
|
|
1033
1003
|
computeHiddenOnRelatedColumns(existingColumns, name, column);
|
|
1034
|
-
updatePropertyLabel(existingColumns, columnsToBeCreated, column);
|
|
1035
1004
|
relatedColumns.push(column);
|
|
1036
1005
|
relatedPropertyNameMap[name] = newName;
|
|
1037
1006
|
} else if (
|
|
@@ -1040,28 +1009,6 @@ const _createRelatedColumns = function (
|
|
|
1040
1009
|
) {
|
|
1041
1010
|
relatedPropertyNameMap[name] = newName;
|
|
1042
1011
|
}
|
|
1043
|
-
} else if (
|
|
1044
|
-
displayModeOfDescriptionPropertiesMap[name] === "Description" &&
|
|
1045
|
-
!relatedColumn.filterable &&
|
|
1046
|
-
!restrictionsOnProperties?.nonFilterableProperties.includes(name)
|
|
1047
|
-
) {
|
|
1048
|
-
// Case 4: The column is a referenced text only property. Set it to hidden, non sortable nor groupable.
|
|
1049
|
-
// Case 5: The column isn't already available for filtering as it could be referenced on another column (e.g. text first).
|
|
1050
|
-
restrictionsOnProperties?.nonSortableProperties.push(name);
|
|
1051
|
-
const column = getColumnDefinitionFromProperty(
|
|
1052
|
-
property,
|
|
1053
|
-
annotationPath,
|
|
1054
|
-
name,
|
|
1055
|
-
false,
|
|
1056
|
-
false,
|
|
1057
|
-
aggregationHelper,
|
|
1058
|
-
converterContext,
|
|
1059
|
-
{},
|
|
1060
|
-
restrictionsOnProperties,
|
|
1061
|
-
tableCreationMode
|
|
1062
|
-
);
|
|
1063
|
-
column.isGroupable = false;
|
|
1064
|
-
relatedColumns.push(column);
|
|
1065
1012
|
}
|
|
1066
1013
|
});
|
|
1067
1014
|
// The property 'name' has been prefixed with 'Property::' for uniqueness.
|
|
@@ -1547,7 +1494,7 @@ const getColumnsFromAnnotations = function (
|
|
|
1547
1494
|
...formatOptions,
|
|
1548
1495
|
...propertyTypeConfig?.formatOptions
|
|
1549
1496
|
},
|
|
1550
|
-
constraints:
|
|
1497
|
+
constraints: propertyTypeConfig?.constraints
|
|
1551
1498
|
};
|
|
1552
1499
|
const visualSettings: VisualSettings = {};
|
|
1553
1500
|
if (!dataType || !typeConfig) {
|
|
@@ -2231,61 +2178,46 @@ function createPropertyAnnotatedTextOnly(
|
|
|
2231
2178
|
}
|
|
2232
2179
|
}
|
|
2233
2180
|
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2181
|
+
/**
|
|
2182
|
+
* Retrieves the property type configuration based on the provided property or data type.
|
|
2183
|
+
* @param property The property or data field to determine the type configuration for.
|
|
2184
|
+
* @param dataType The data type to use for type configuration if not determined from the property.
|
|
2185
|
+
* @returns The property type configuration object.
|
|
2186
|
+
*/
|
|
2187
|
+
export function getTypeConfig(property: Property | DataFieldAbstractTypes | undefined, dataType?: string): PropertyTypeConfig {
|
|
2188
|
+
let targetMapping,
|
|
2189
|
+
formatOptions: PropertyTypeFormatOptions | undefined = {};
|
|
2190
|
+
if (isProperty(property)) {
|
|
2191
|
+
targetMapping = isTypeDefinition(property.targetType)
|
|
2192
|
+
? EDM_TYPE_MAPPING[property.targetType.underlyingType]
|
|
2193
|
+
: EDM_TYPE_MAPPING[property.type];
|
|
2240
2194
|
}
|
|
2241
|
-
if (
|
|
2242
|
-
|
|
2195
|
+
if (!targetMapping && dataType !== undefined) {
|
|
2196
|
+
targetMapping = EDM_TYPE_MAPPING[dataType];
|
|
2243
2197
|
}
|
|
2244
2198
|
const propertyTypeConfig: PropertyTypeConfig = {
|
|
2245
|
-
type:
|
|
2246
|
-
constraints: {},
|
|
2247
|
-
formatOptions: {}
|
|
2199
|
+
type: targetMapping?.type
|
|
2248
2200
|
};
|
|
2249
|
-
if (
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
nullable: oTargetMapping.constraints?.$Nullable ? oProperty.nullable : undefined,
|
|
2255
|
-
minimum:
|
|
2256
|
-
oTargetMapping.constraints?.["@Org.OData.Validation.V1.Minimum/$Decimal"] &&
|
|
2257
|
-
!isNaN(oProperty.annotations?.Validation?.Minimum)
|
|
2258
|
-
? `${oProperty.annotations?.Validation?.Minimum}`
|
|
2259
|
-
: undefined,
|
|
2260
|
-
maximum:
|
|
2261
|
-
oTargetMapping.constraints?.["@Org.OData.Validation.V1.Maximum/$Decimal"] &&
|
|
2262
|
-
!isNaN(oProperty.annotations?.Validation?.Maximum)
|
|
2263
|
-
? `${oProperty.annotations?.Validation?.Maximum}`
|
|
2264
|
-
: undefined,
|
|
2265
|
-
isDigitSequence:
|
|
2266
|
-
propertyTypeConfig.type === "sap.ui.model.odata.type.String" &&
|
|
2267
|
-
oTargetMapping.constraints?.[`@${CommonAnnotationTerms.IsDigitSequence}`] &&
|
|
2268
|
-
oProperty.annotations?.Common?.IsDigitSequence
|
|
2269
|
-
? true
|
|
2270
|
-
: undefined
|
|
2271
|
-
};
|
|
2201
|
+
if (targetMapping && isProperty(property)) {
|
|
2202
|
+
const constraints = setUpConstraints(targetMapping, property);
|
|
2203
|
+
if (Object.keys(constraints).length) {
|
|
2204
|
+
propertyTypeConfig.constraints = constraints;
|
|
2205
|
+
}
|
|
2272
2206
|
}
|
|
2273
|
-
propertyTypeConfig.
|
|
2274
|
-
|
|
2207
|
+
if (propertyTypeConfig.type !== "sap.ui.model.odata.type.Stream") {
|
|
2208
|
+
if (
|
|
2275
2209
|
propertyTypeConfig?.type?.indexOf("sap.ui.model.odata.type.Int") === 0 ||
|
|
2276
2210
|
propertyTypeConfig?.type?.indexOf("sap.ui.model.odata.type.Double") === 0
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
: undefined
|
|
2288
|
-
};
|
|
2211
|
+
) {
|
|
2212
|
+
formatOptions = { parseAsString: false, emptyString: "" };
|
|
2213
|
+
}
|
|
2214
|
+
if (propertyTypeConfig.type === "sap.ui.model.odata.type.String" && propertyTypeConfig.constraints?.nullable === false) {
|
|
2215
|
+
formatOptions = { parseKeepsEmptyString: true };
|
|
2216
|
+
}
|
|
2217
|
+
}
|
|
2218
|
+
if (Object.keys(formatOptions).length) {
|
|
2219
|
+
propertyTypeConfig.formatOptions = formatOptions;
|
|
2220
|
+
}
|
|
2289
2221
|
return propertyTypeConfig;
|
|
2290
2222
|
}
|
|
2291
2223
|
|