@sapui5/sap.fe.templates 1.142.7 → 1.142.9

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.
@@ -2,7 +2,7 @@ import type { SemanticObjectMappingType } from "@sap-ux/vocabularies-types/vocab
2
2
  import Log from "sap/base/Log";
3
3
  import merge from "sap/base/util/merge";
4
4
  import type { EnhanceWithUI5 } from "sap/fe/base/ClassSupport";
5
- import { defineUI5Class,extensible,finalExtension,publicExtension,usingExtension } from "sap/fe/base/ClassSupport";
5
+ import { defineUI5Class, extensible, finalExtension, publicExtension, usingExtension } from "sap/fe/base/ClassSupport";
6
6
  import ActionRuntime from "sap/fe/core/ActionRuntime";
7
7
  import type { StartupParameters } from "sap/fe/core/AppComponent";
8
8
  import type { FEView } from "sap/fe/core/BaseController";
@@ -24,7 +24,7 @@ import UiModelConstants from "sap/fe/core/controllerextensions/editFlow/editFlow
24
24
  import NavigationReason from "sap/fe/core/controllerextensions/routing/NavigationReason";
25
25
  import type CommandExecution from "sap/fe/core/controls/CommandExecution";
26
26
  import { RecommendationDialogDecision } from "sap/fe/core/controls/Recommendations/ConfirmRecommendationDialog";
27
- import type { HiddenDraft,MicroChartManifestConfiguration } from "sap/fe/core/converters/ManifestSettings";
27
+ import type { HiddenDraft, MicroChartManifestConfiguration } from "sap/fe/core/converters/ManifestSettings";
28
28
  import type { InternalModelContext } from "sap/fe/core/helpers/ModelHelper";
29
29
  import ModelHelper from "sap/fe/core/helpers/ModelHelper";
30
30
  import { getResourceModel } from "sap/fe/core/helpers/ResourceModelHelper";
@@ -54,6 +54,7 @@ import InstanceManager from "sap/m/InstanceManager";
54
54
  import MessageBox from "sap/m/MessageBox";
55
55
  import type NavContainer from "sap/m/NavContainer";
56
56
  import type Popover from "sap/m/Popover";
57
+ import type SearchField from "sap/m/SearchField";
57
58
  import type ToolbarSpacer from "sap/m/ToolbarSpacer";
58
59
  import Device from "sap/ui/Device";
59
60
  import type UI5Event from "sap/ui/base/Event";
@@ -289,12 +290,13 @@ class ObjectPageController extends PageController {
289
290
  }
290
291
 
291
292
  /**
292
- * Find the last visible subsection and add the sapUxAPObjectPageSubSectionFitContainer CSS class if it contains only a GridTable or a TreeTable.
293
+ * Add the sapUxAPObjectPageSubSectionFitContainer CSS class to every visible subsection that contains only a single GridTable or TreeTable.
294
+ * 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.
293
295
  * @param subSections The sub sections to look for
294
296
  */
295
297
  private checkSectionsForNonResponsiveTable(subSections: ObjectPageSubSection[]): void {
296
- const changeClassForTables = (event: Event, lastVisibleSubSection: ObjectPageSubSection): void => {
297
- const blocks = [...lastVisibleSubSection.getBlocks(), ...lastVisibleSubSection.getMoreBlocks()];
298
+ const changeClassForTables = (event: Event, visibleSubSection: ObjectPageSubSection): void => {
299
+ const blocks = [...visibleSubSection.getBlocks(), ...visibleSubSection.getMoreBlocks()];
298
300
  if (blocks.length === 1) {
299
301
  const table = this.searchTableInBlock(blocks[0] as SubSectionBlock);
300
302
  if (!table) {
@@ -310,17 +312,15 @@ class ObjectPageController extends PageController {
310
312
  tableAPI?.getTableDefinition().control.rowCountMode === "Auto"
311
313
  ) {
312
314
  //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
313
- lastVisibleSubSection.addStyleClass("sapUxAPObjectPageSubSectionFitContainer");
314
- lastVisibleSubSection.detachEvent("modelContextChange", changeClassForTables, this);
315
+ visibleSubSection.addStyleClass("sapUxAPObjectPageSubSectionFitContainer");
316
+ visibleSubSection.detachEvent("modelContextChange", changeClassForTables, this);
315
317
  }
316
318
  }
317
319
  };
318
- for (let subSectionIndex = subSections.length - 1; subSectionIndex >= 0; subSectionIndex--) {
319
- if (subSections[subSectionIndex].getVisible()) {
320
- const lastVisibleSubSection = subSections[subSectionIndex];
320
+ for (const subSection of subSections) {
321
+ if (subSection.getVisible()) {
321
322
  // We need to attach this event in order to manage the Object Page Lazy Loading mechanism
322
- lastVisibleSubSection.attachEvent("modelContextChange", lastVisibleSubSection, changeClassForTables, this);
323
- break;
323
+ subSection.attachEvent("modelContextChange", subSection, changeClassForTables, this);
324
324
  }
325
325
  }
326
326
  }
@@ -623,7 +623,7 @@ class ObjectPageController extends PageController {
623
623
  // We set the focus in a timeeout, otherwise the focus sometimes goes to the TabBar
624
624
  const oObjectPage = this._getObjectPageLayoutControl();
625
625
  const oMandatoryField = this._getFirstEmptyMandatoryFieldFromSubSection(aSubSections);
626
- let oFieldToFocus;
626
+ let oFieldToFocus: UI5Element | undefined;
627
627
  if (oMandatoryField) {
628
628
  if (oMandatoryField.isA("sap.fe.macros.MultiValueField")) {
629
629
  oFieldToFocus = (oMandatoryField as unknown as MultiValueFieldBlock).getMultiValueField();
@@ -639,9 +639,22 @@ class ObjectPageController extends PageController {
639
639
  const focusInfo = oFieldToFocus.getFocusInfo() as { targetInfo: object };
640
640
  focusInfo.targetInfo = { silent: true };
641
641
  if (oFieldToFocus.isA("sap.ui.mdc.field.FieldInput")) {
642
- oFieldToFocus = oFieldToFocus.getParent();
642
+ oFieldToFocus = oFieldToFocus.getParent() as UI5Element | undefined;
643
+ }
644
+
645
+ if (
646
+ oFieldToFocus?.isA<SearchField>("sap.m.SearchField") &&
647
+ oFieldToFocus.getEnableSuggestions() &&
648
+ !oFieldToFocus.isBound("enableSuggestions")
649
+ ) {
650
+ // In case the focus is set on a search field with suggestions, we temporarily disable the suggestions to avoid triggering them on focus
651
+ // unless this property is bound (to avoid modifying something in a model)
652
+ oFieldToFocus.setEnableSuggestions(false);
653
+ oFieldToFocus.focus(focusInfo);
654
+ oFieldToFocus.setEnableSuggestions(true);
655
+ } else {
656
+ oFieldToFocus?.focus(focusInfo);
643
657
  }
644
- oFieldToFocus.focus(focusInfo);
645
658
  }
646
659
  }.bind(this),
647
660
  0 //300
@@ -4,7 +4,7 @@
4
4
  "id": "sap.fe.templates.ObjectPage",
5
5
  "type": "component",
6
6
  "applicationVersion": {
7
- "version": "1.142.7"
7
+ "version": "1.142.9"
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.142.7",
39
+ version: "1.142.9",
40
40
  noLibraryCSS: true
41
41
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
42
42
  });