@sapui5/sap.fe.core 1.124.2 → 1.124.4

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.
@@ -405,6 +405,7 @@ export type ColumnExportSettings = Partial<{
405
405
  isCurrency: boolean;
406
406
  property: string[];
407
407
  width: number;
408
+ autoScale: boolean;
408
409
  }>;
409
410
  // Properties for Annotation Columns
410
411
  export type AnnotationTableColumn = AnnotationTableColumnForOverride & {
@@ -877,44 +878,48 @@ function findColumnByPath(path: string, tableColumns: TableColumn[]): TableColum
877
878
  });
878
879
  }
879
880
  /**
880
- * Sets the 'unit' and 'textArrangement' properties in columns when necessary.
881
+ * Sets the 'unit', 'textArrangement', 'timezone' and 'exportsettings' properties in columns when necessary.
881
882
  *
882
883
  * @param entityType The entity type displayed in the table
883
884
  * @param tableColumns The columns to be updated
884
885
  */
885
886
  export function updateLinkedProperties(entityType: EntityType, tableColumns: TableColumn[]): void {
886
887
  tableColumns.forEach((oColumn) => {
887
- const oTableColumn = oColumn as AnnotationTableColumn;
888
- if (oTableColumn.propertyInfos === undefined && oTableColumn.relativePath) {
889
- const oProperty = entityType.entityProperties.find((oProp: Property) => oProp.name === oTableColumn.relativePath);
890
- if (oProperty) {
891
- const oUnit = getAssociatedCurrencyProperty(oProperty) || getAssociatedUnitProperty(oProperty);
892
- const oTimezone = getAssociatedTimezoneProperty(oProperty);
893
- const sTimezone = oProperty?.annotations?.Common?.Timezone;
894
- if (oUnit) {
895
- const oUnitColumn = findColumnByPath(oUnit.name, tableColumns);
896
- oTableColumn.unit = oUnitColumn?.name;
888
+ const tableColumn = oColumn as AnnotationTableColumn;
889
+ if (tableColumn.propertyInfos === undefined && tableColumn.relativePath) {
890
+ const property = entityType.entityProperties.find((prop: Property) => prop.name === tableColumn.relativePath);
891
+ if (property) {
892
+ const unitProperty = getAssociatedCurrencyProperty(property) || getAssociatedUnitProperty(property);
893
+ const timezoneProperty = getAssociatedTimezoneProperty(property);
894
+ const timezone = property?.annotations?.Common?.Timezone;
895
+ if (unitProperty) {
896
+ const unitColumn = findColumnByPath(unitProperty.name, tableColumns);
897
+ tableColumn.unit = unitColumn?.name;
897
898
  } else {
898
- const sUnit = oProperty?.annotations?.Measures?.ISOCurrency || oProperty?.annotations?.Measures?.Unit;
899
- if (sUnit) {
900
- oTableColumn.unitText = `${sUnit}`;
899
+ const unit = property?.annotations?.Measures?.ISOCurrency || property?.annotations?.Measures?.Unit;
900
+ if (unit) {
901
+ tableColumn.unitText = `${unit}`;
901
902
  }
902
903
  }
903
- if (oTimezone) {
904
- const oTimezoneColumn = findColumnByPath(oTimezone.name, tableColumns);
905
- oTableColumn.timezone = oTimezoneColumn?.name;
906
- } else if (sTimezone) {
907
- oTableColumn.timezoneText = sTimezone.toString();
904
+ if (timezoneProperty) {
905
+ const oTimezoneColumn = findColumnByPath(timezoneProperty.name, tableColumns);
906
+ tableColumn.timezone = oTimezoneColumn?.name;
907
+ } else if (timezone) {
908
+ tableColumn.timezoneText = timezone.toString();
908
909
  }
909
- const displayMode = getDisplayMode(oProperty),
910
- textAnnotation = oProperty.annotations.Common?.Text;
910
+ const displayMode = getDisplayMode(property),
911
+ textAnnotation = property.annotations.Common?.Text;
911
912
  if (isPathAnnotationExpression(textAnnotation) && displayMode !== "Value") {
912
- const oTextColumn = findColumnByPath(textAnnotation.path, tableColumns);
913
- if (oTextColumn && oTextColumn.name !== oTableColumn.name) {
914
- oTableColumn.textArrangement = {
915
- textProperty: oTextColumn.name,
913
+ const textColumn = findColumnByPath(textAnnotation.path, tableColumns);
914
+ if (textColumn && textColumn.name !== tableColumn.name) {
915
+ tableColumn.textArrangement = {
916
+ textProperty: textColumn.name,
916
917
  mode: displayMode
917
918
  };
919
+ // If text properties are used but hidden, we must include them to the export as there are used in the paste
920
+ if (!textColumn.exportSettings) {
921
+ textColumn.exportSettings = { type: "String" };
922
+ }
918
923
  }
919
924
  }
920
925
  }
@@ -2012,6 +2017,9 @@ const createColumnExportSettings = function (
2012
2017
  wrap: relatedPropertiesInfo?.exportSettings.wrap,
2013
2018
  utc: utc
2014
2019
  };
2020
+ if (exportSettings.unitProperty || exportSettings.unit) {
2021
+ exportSettings.autoScale = true;
2022
+ }
2015
2023
  return removeUndefinedFromExportSettings(exportSettings);
2016
2024
  };
2017
2025
  /**