@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.
Files changed (87) hide show
  1. package/package.json +1 -1
  2. package/src/sap/fe/core/.library +1 -1
  3. package/src/sap/fe/core/AppComponent.js +4 -6
  4. package/src/sap/fe/core/AppComponent.ts +4 -4
  5. package/src/sap/fe/core/CommonUtils.js +41 -14
  6. package/src/sap/fe/core/CommonUtils.ts +47 -16
  7. package/src/sap/fe/core/IRowBindingInterface.js +1 -1
  8. package/src/sap/fe/core/IRowBindingInterface.ts +1 -1
  9. package/src/sap/fe/core/buildingBlocks/BuildingBlock.js +4 -1
  10. package/src/sap/fe/core/buildingBlocks/BuildingBlock.ts +3 -0
  11. package/src/sap/fe/core/buildingBlocks/templating/BuildingBlockTemplateProcessor.js +12 -4
  12. package/src/sap/fe/core/buildingBlocks/templating/BuildingBlockTemplateProcessor.ts +10 -3
  13. package/src/sap/fe/core/controllerextensions/CollaborativeDraft.js +139 -5
  14. package/src/sap/fe/core/controllerextensions/CollaborativeDraft.ts +169 -4
  15. package/src/sap/fe/core/controllerextensions/EditFlow.js +48 -43
  16. package/src/sap/fe/core/controllerextensions/EditFlow.ts +54 -51
  17. package/src/sap/fe/core/controllerextensions/InlineEditFlow.js +39 -5
  18. package/src/sap/fe/core/controllerextensions/InlineEditFlow.ts +38 -1
  19. package/src/sap/fe/core/controllerextensions/InternalRouting.js +12 -13
  20. package/src/sap/fe/core/controllerextensions/InternalRouting.ts +10 -11
  21. package/src/sap/fe/core/controllerextensions/MessageHandler.js +32 -21
  22. package/src/sap/fe/core/controllerextensions/MessageHandler.ts +31 -20
  23. package/src/sap/fe/core/controllerextensions/PageReady.js +6 -3
  24. package/src/sap/fe/core/controllerextensions/PageReady.ts +6 -2
  25. package/src/sap/fe/core/controllerextensions/Recommendations.js +3 -2
  26. package/src/sap/fe/core/controllerextensions/Recommendations.ts +7 -5
  27. package/src/sap/fe/core/controllerextensions/Share.js +6 -6
  28. package/src/sap/fe/core/controllerextensions/Share.ts +3 -4
  29. package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.js +9 -11
  30. package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.ts +8 -13
  31. package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js +9 -9
  32. package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.ts +20 -10
  33. package/src/sap/fe/core/controllerextensions/editFlow/draft.js +31 -8
  34. package/src/sap/fe/core/controllerextensions/editFlow/draft.ts +46 -9
  35. package/src/sap/fe/core/controllerextensions/editFlow/draftDataLossPopup.js +2 -2
  36. package/src/sap/fe/core/controllerextensions/editFlow/draftDataLossPopup.ts +1 -1
  37. package/src/sap/fe/core/controllerextensions/editFlow/operations/ODataOperation.js +20 -18
  38. package/src/sap/fe/core/controllerextensions/editFlow/operations/ODataOperation.ts +37 -23
  39. package/src/sap/fe/core/controllerextensions/editFlow/operations/ODataStrictHandling.js +4 -3
  40. package/src/sap/fe/core/controllerextensions/editFlow/operations/ODataStrictHandling.ts +6 -1
  41. package/src/sap/fe/core/controllerextensions/editFlow/operations/Operation.js +6 -3
  42. package/src/sap/fe/core/controllerextensions/editFlow/operations/Operation.ts +11 -3
  43. package/src/sap/fe/core/controllerextensions/editFlow/sticky.js +5 -2
  44. package/src/sap/fe/core/controllerextensions/editFlow/sticky.ts +3 -2
  45. package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js +2 -2
  46. package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.ts +1 -1
  47. package/src/sap/fe/core/controls/CommandExecution.js +1 -1
  48. package/src/sap/fe/core/controls/CommandExecution.ts +1 -1
  49. package/src/sap/fe/core/controls/HideFormGroupAutomatically.js +3 -2
  50. package/src/sap/fe/core/controls/HideFormGroupAutomatically.ts +2 -0
  51. package/src/sap/fe/core/converters/controls/Common/Action.js +5 -2
  52. package/src/sap/fe/core/converters/controls/Common/Action.ts +4 -1
  53. package/src/sap/fe/core/converters/controls/Common/Chart.js +7 -2
  54. package/src/sap/fe/core/converters/controls/Common/Chart.ts +11 -1
  55. package/src/sap/fe/core/converters/controls/Common/table/Columns.js +41 -58
  56. package/src/sap/fe/core/converters/controls/Common/table/Columns.ts +43 -111
  57. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +14 -6
  58. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +23 -6
  59. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +6 -3
  60. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +5 -2
  61. package/src/sap/fe/core/formatters/ValueFormatter.js +21 -1
  62. package/src/sap/fe/core/formatters/ValueFormatter.ts +19 -0
  63. package/src/sap/fe/core/fpm/manifest.json +1 -1
  64. package/src/sap/fe/core/helpers/DeleteHelper.js +2 -2
  65. package/src/sap/fe/core/helpers/DeleteHelper.ts +1 -1
  66. package/src/sap/fe/core/helpers/ModelHelper.js +2 -2
  67. package/src/sap/fe/core/helpers/ModelHelper.ts +1 -1
  68. package/src/sap/fe/core/helpers/PasteHelper.js +2 -2
  69. package/src/sap/fe/core/helpers/PasteHelper.ts +1 -1
  70. package/src/sap/fe/core/helpers/StableIdHelper.js +2 -2
  71. package/src/sap/fe/core/helpers/StableIdHelper.ts +4 -1
  72. package/src/sap/fe/core/helpers/TitleHelper.js +13 -6
  73. package/src/sap/fe/core/helpers/TitleHelper.ts +19 -6
  74. package/src/sap/fe/core/library.js +1 -1
  75. package/src/sap/fe/core/messagebundle.properties +0 -1
  76. package/src/sap/fe/core/rootView/Fcl.controller.js +9 -15
  77. package/src/sap/fe/core/rootView/Fcl.controller.ts +9 -15
  78. package/src/sap/fe/core/services/collaborativeDraftServiceFactory.js +9 -6
  79. package/src/sap/fe/core/services/collaborativeDraftServiceFactory.ts +7 -6
  80. package/src/sap/fe/core/templating/DataModelPathHelper.js +2 -2
  81. package/src/sap/fe/core/templating/DataModelPathHelper.ts +1 -1
  82. package/src/sap/fe/core/templating/EntitySetHelper.js +60 -48
  83. package/src/sap/fe/core/templating/EntitySetHelper.ts +80 -58
  84. package/src/sap/fe/core/templating/SemanticObjectHelper.js +6 -4
  85. package/src/sap/fe/core/templating/SemanticObjectHelper.ts +5 -5
  86. package/src/sap/fe/core/templating/UIFormatters.js +7 -1
  87. 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: PropertyTypeConstraints;
184
- formatOptions: PropertyTypeFormatOptions;
185
- typeInstance?: unknown;
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 = !isAPropertyFromTextOnlyAnnotation && !restrictionsOnProperties?.nonFilterableProperties.includes(relativePath);
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: AvailabilityType =
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: { ...propertyTypeConfig?.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
- export function getTypeConfig(oProperty: Property | DataFieldAbstractTypes | undefined, dataType: string | undefined): PropertyTypeConfig {
2235
- let oTargetMapping;
2236
- if (isProperty(oProperty)) {
2237
- oTargetMapping = isTypeDefinition(oProperty.targetType)
2238
- ? EDM_TYPE_MAPPING[oProperty.targetType.underlyingType]
2239
- : EDM_TYPE_MAPPING[oProperty.type];
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 (oTargetMapping === undefined && dataType !== undefined) {
2242
- oTargetMapping = EDM_TYPE_MAPPING[dataType];
2195
+ if (!targetMapping && dataType !== undefined) {
2196
+ targetMapping = EDM_TYPE_MAPPING[dataType];
2243
2197
  }
2244
2198
  const propertyTypeConfig: PropertyTypeConfig = {
2245
- type: oTargetMapping?.type,
2246
- constraints: {},
2247
- formatOptions: {}
2199
+ type: targetMapping?.type
2248
2200
  };
2249
- if (isProperty(oProperty) && oTargetMapping !== undefined) {
2250
- propertyTypeConfig.constraints = {
2251
- scale: oTargetMapping.constraints?.$Scale ? oProperty.scale : undefined,
2252
- precision: oTargetMapping.constraints?.$Precision ? oProperty.precision : undefined,
2253
- maxLength: oTargetMapping.constraints?.$MaxLength ? oProperty.maxLength : undefined,
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.formatOptions = {
2274
- parseAsString:
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
- ? false
2278
- : undefined,
2279
- emptyString:
2280
- propertyTypeConfig?.type?.indexOf("sap.ui.model.odata.type.Int") === 0 ||
2281
- propertyTypeConfig?.type?.indexOf("sap.ui.model.odata.type.Double") === 0
2282
- ? ""
2283
- : undefined,
2284
- parseKeepsEmptyString:
2285
- propertyTypeConfig.type === "sap.ui.model.odata.type.String" && propertyTypeConfig.constraints.nullable === false
2286
- ? true
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