@sapui5/sap.fe.templates 1.136.15 → 1.136.17

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.
@@ -55,6 +55,7 @@ import MessageBox from "sap/m/MessageBox";
55
55
  import type NavContainer from "sap/m/NavContainer";
56
56
  import type OverflowToolbar from "sap/m/OverflowToolbar";
57
57
  import type Popover from "sap/m/Popover";
58
+ import type SearchField from "sap/m/SearchField";
58
59
  import type ToolbarSpacer from "sap/m/ToolbarSpacer";
59
60
  import Device from "sap/ui/Device";
60
61
  import type UI5Event from "sap/ui/base/Event";
@@ -277,12 +278,13 @@ class ObjectPageController extends PageController {
277
278
  }
278
279
 
279
280
  /**
280
- * Find the last visible subsection and add the sapUxAPObjectPageSubSectionFitContainer CSS class if it contains only a GridTable or a TreeTable.
281
+ * Add the sapUxAPObjectPageSubSectionFitContainer CSS class to every visible subsection that contains only a single GridTable or TreeTable.
282
+ * This makes the table fill the full height of its container so that the scrollbar appears on the table itself rather than on the page.
281
283
  * @param subSections The sub sections to look for
282
284
  */
283
285
  private checkSectionsForNonResponsiveTable(subSections: ObjectPageSubSection[]): void {
284
- const changeClassForTables = (event: Event, lastVisibleSubSection: ObjectPageSubSection): void => {
285
- const blocks = [...lastVisibleSubSection.getBlocks(), ...lastVisibleSubSection.getMoreBlocks()];
286
+ const changeClassForTables = (event: Event, visibleSubSection: ObjectPageSubSection): void => {
287
+ const blocks = [...visibleSubSection.getBlocks(), ...visibleSubSection.getMoreBlocks()];
286
288
  if (blocks.length === 1) {
287
289
  const table = this.searchTableInBlock(blocks[0] as SubSectionBlock);
288
290
  if (!table) {
@@ -298,17 +300,15 @@ class ObjectPageController extends PageController {
298
300
  tableAPI?.getTableDefinition().control.rowCountMode === "Auto"
299
301
  ) {
300
302
  //In case there is only a single table in a subSection we fit that to the whole page so that the scrollbar comes only on table and not on page
301
- lastVisibleSubSection.addStyleClass("sapUxAPObjectPageSubSectionFitContainer");
302
- lastVisibleSubSection.detachEvent("modelContextChange", changeClassForTables, this);
303
+ visibleSubSection.addStyleClass("sapUxAPObjectPageSubSectionFitContainer");
304
+ visibleSubSection.detachEvent("modelContextChange", changeClassForTables, this);
303
305
  }
304
306
  }
305
307
  };
306
- for (let subSectionIndex = subSections.length - 1; subSectionIndex >= 0; subSectionIndex--) {
307
- if (subSections[subSectionIndex].getVisible()) {
308
- const lastVisibleSubSection = subSections[subSectionIndex];
308
+ for (const subSection of subSections) {
309
+ if (subSection.getVisible()) {
309
310
  // We need to attach this event in order to manage the Object Page Lazy Loading mechanism
310
- lastVisibleSubSection.attachEvent("modelContextChange", lastVisibleSubSection, changeClassForTables, this);
311
- break;
311
+ subSection.attachEvent("modelContextChange", subSection, changeClassForTables, this);
312
312
  }
313
313
  }
314
314
  }
@@ -537,7 +537,7 @@ class ObjectPageController extends PageController {
537
537
  // We set the focus in a timeeout, otherwise the focus sometimes goes to the TabBar
538
538
  const oObjectPage = this._getObjectPageLayoutControl();
539
539
  const oMandatoryField = this._getFirstEmptyMandatoryFieldFromSubSection(aSubSections);
540
- let oFieldToFocus;
540
+ let oFieldToFocus: UI5Element | undefined;
541
541
  if (oMandatoryField) {
542
542
  oFieldToFocus = (oMandatoryField as unknown as { content: { getContentEdit: Function } }).content.getContentEdit()[0];
543
543
  } else {
@@ -547,9 +547,22 @@ class ObjectPageController extends PageController {
547
547
  const focusInfo = oFieldToFocus.getFocusInfo() as { targetInfo: object };
548
548
  focusInfo.targetInfo = { silent: true };
549
549
  if (oFieldToFocus.isA("sap.ui.mdc.field.FieldInput")) {
550
- oFieldToFocus = oFieldToFocus.getParent();
550
+ oFieldToFocus = oFieldToFocus.getParent() as UI5Element | undefined;
551
+ }
552
+
553
+ if (
554
+ oFieldToFocus?.isA<SearchField>("sap.m.SearchField") &&
555
+ oFieldToFocus.getEnableSuggestions() &&
556
+ !oFieldToFocus.isBound("enableSuggestions")
557
+ ) {
558
+ // In case the focus is set on a search field with suggestions, we temporarily disable the suggestions to avoid triggering them on focus
559
+ // unless this property is bound (to avoid modifying something in a model)
560
+ oFieldToFocus.setEnableSuggestions(false);
561
+ oFieldToFocus.focus(focusInfo);
562
+ oFieldToFocus.setEnableSuggestions(true);
563
+ } else {
564
+ oFieldToFocus?.focus(focusInfo);
551
565
  }
552
- oFieldToFocus.focus(focusInfo);
553
566
  }
554
567
  }.bind(this),
555
568
  0
@@ -4,7 +4,7 @@
4
4
  "id": "sap.fe.templates.ObjectPage",
5
5
  "type": "component",
6
6
  "applicationVersion": {
7
- "version": "1.136.15"
7
+ "version": "1.136.17"
8
8
  },
9
9
  "title": "Object Page",
10
10
  "tags": {
@@ -36,7 +36,7 @@ sap.ui.define(["sap/f/library", "sap/fe/core/library", "sap/fe/macros/library",
36
36
  controls: [],
37
37
  elements: [],
38
38
  // eslint-disable-next-line no-template-curly-in-string
39
- version: "1.136.15",
39
+ version: "1.136.17",
40
40
  noLibraryCSS: true
41
41
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
42
42
  });
@@ -1,6 +1,6 @@
1
1
 
2
2
 
3
- T_LR_VARIANT_APPLY_AUTOMATICALLY_WHEN_FILTER_SET=\u05D0\u05DD \u05D6\u05DE\u05D9\u05E0\u05D9\u05DD \u05E2\u05E8\u05DB\u05D9 \u05DE\u05E1\u05E0\u05DF \u05DE\u05D5\u05D2\u05D3\u05E8\u05D9\u05DD \u05DE\u05E8\u05D0\u05E9, \u05D4\u05EA\u05D5\u05DB\u05DF \u05E0\u05D8\u05E2\u05DF \u05D0\u05D5\u05D8\u05D5\u05DE\u05D8\u05D9\u05EA.
3
+ T_LR_VARIANT_APPLY_AUTOMATICALLY_WHEN_FILTER_SET=\u05D0\u05DD \u05E2\u05E8\u05DB\u05D9 \u05DE\u05E1\u05E0\u05DF \u05DE\u05D5\u05D2\u05D3\u05E8\u05D9\u05DD \u05DE\u05E8\u05D0\u05E9 \u05D6\u05DE\u05D9\u05E0\u05D9\u05DD, \u05D4\u05EA\u05D5\u05DB\u05DF \u05E0\u05D8\u05E2\u05DF \u05D0\u05D5\u05D8\u05D5\u05DE\u05D8\u05D9\u05EA.
4
4
 
5
5
 
6
6
 
@@ -224,7 +224,7 @@ T_ILLUSTRATED_MESSAGE_TITLE_NODATA=Det finnes ingen posisjoner
224
224
 
225
225
  T_ILLUSTRATED_MESSAGE_TITLE_NOSEARCHRESULTS=Finner ingen data
226
226
 
227
- T_ILLUSTRATED_MESSAGE_TITLE_BEFORESEARCH=La oss komme i gang med \u00E5 s\u00F8ke
227
+ T_ILLUSTRATED_MESSAGE_TITLE_BEFORESEARCH=La oss f\u00E5 noen treff
228
228
 
229
229
  T_TABLE_AND_CHART_NO_DATA_TEXT=Definer relevante filtre og velg "Start" for \u00E5 starte.
230
230