@sapui5/sap.fe.templates 1.108.8 → 1.108.10

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 (42) hide show
  1. package/package.json +6 -3
  2. package/src/sap/fe/templates/.library +1 -1
  3. package/src/sap/fe/templates/AnalyticalListPage/Component.js +1 -7
  4. package/src/sap/fe/templates/AnalyticalListPage/chart/FEChartDelegate.js +1 -4
  5. package/src/sap/fe/templates/Feedback.js +3 -13
  6. package/src/sap/fe/templates/ListComponent.js +2 -19
  7. package/src/sap/fe/templates/ListReport/Component.js +1 -18
  8. package/src/sap/fe/templates/ListReport/ExtensionAPI.js +10 -35
  9. package/src/sap/fe/templates/ListReport/ListReport.view.xml +1 -1
  10. package/src/sap/fe/templates/ListReport/ListReportController.controller.js +80 -226
  11. package/src/sap/fe/templates/ListReport/ListReportController.controller.ts +9 -2
  12. package/src/sap/fe/templates/ListReport/ListReportTemplating.js +2 -7
  13. package/src/sap/fe/templates/ListReport/controls/MultipleModeControl.js +21 -108
  14. package/src/sap/fe/templates/ListReport/overrides/IntentBasedNavigation.js +9 -17
  15. package/src/sap/fe/templates/ListReport/overrides/Share.js +9 -25
  16. package/src/sap/fe/templates/ListReport/overrides/ViewState.js +51 -122
  17. package/src/sap/fe/templates/ListReport/view/fragments/MultipleMode.fragment.js +1 -23
  18. package/src/sap/fe/templates/ObjectPage/Component.js +12 -37
  19. package/src/sap/fe/templates/ObjectPage/ExtensionAPI.js +17 -54
  20. package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.js +256 -467
  21. package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.ts +69 -15
  22. package/src/sap/fe/templates/ObjectPage/ObjectPageTemplating.js +66 -198
  23. package/src/sap/fe/templates/ObjectPage/components/DraftHandlerButton.js +1 -32
  24. package/src/sap/fe/templates/ObjectPage/controls/StashableHBox.js +9 -37
  25. package/src/sap/fe/templates/ObjectPage/controls/StashableVBox.js +1 -7
  26. package/src/sap/fe/templates/ObjectPage/controls/SubSectionBlock.js +9 -31
  27. package/src/sap/fe/templates/ObjectPage/designtime/FlexBox.designtime.js +1 -1
  28. package/src/sap/fe/templates/ObjectPage/designtime/StashableHBox.designtime.js +2 -4
  29. package/src/sap/fe/templates/ObjectPage/designtime/StashableVBox.designtime.js +1 -1
  30. package/src/sap/fe/templates/ObjectPage/flexibility/ScrollableHeaderContainer.flexibility.js +4 -5
  31. package/src/sap/fe/templates/ObjectPage/flexibility/StashableHBox.flexibility.js +1 -1
  32. package/src/sap/fe/templates/ObjectPage/flexibility/StashableVBox.flexibility.js +1 -1
  33. package/src/sap/fe/templates/ObjectPage/overrides/IntentBasedNavigation.js +15 -20
  34. package/src/sap/fe/templates/ObjectPage/overrides/InternalRouting.js +1 -1
  35. package/src/sap/fe/templates/ObjectPage/overrides/MessageHandler.js +1 -1
  36. package/src/sap/fe/templates/ObjectPage/overrides/Paginator.js +4 -5
  37. package/src/sap/fe/templates/ObjectPage/overrides/Share.js +18 -68
  38. package/src/sap/fe/templates/ObjectPage/overrides/ViewState.js +5 -20
  39. package/src/sap/fe/templates/RootContainer/overrides/EditFlow.js +1 -2
  40. package/src/sap/fe/templates/TableScroller.js +1 -6
  41. package/src/sap/fe/templates/library.js +2 -5
  42. package/src/sap/fe/templates/messagebundle_it.properties +1 -1
@@ -29,8 +29,10 @@ import RootViewBaseController from "sap/fe/core/rootView/RootViewBaseController"
29
29
  import ChartRuntime from "sap/fe/macros/chart/ChartRuntime";
30
30
  import CommonHelper from "sap/fe/macros/CommonHelper";
31
31
  import DelegateUtil from "sap/fe/macros/DelegateUtil";
32
+ import type TableAPI from "sap/fe/macros/table/TableAPI";
32
33
  import TableUtils from "sap/fe/macros/table/Utils";
33
34
  import SelectionVariant from "sap/fe/navigation/SelectionVariant";
35
+ import type SubSectionBlock from "sap/fe/templates/ObjectPage/controls/SubSectionBlock";
34
36
  import type { default as ObjectPageExtensionAPI } from "sap/fe/templates/ObjectPage/ExtensionAPI";
35
37
  import { default as ExtensionAPI } from "sap/fe/templates/ObjectPage/ExtensionAPI";
36
38
  import EditFlowOverrides from "sap/fe/templates/RootContainer/overrides/EditFlow";
@@ -43,6 +45,7 @@ import Core from "sap/ui/core/Core";
43
45
  import Message from "sap/ui/core/message/Message";
44
46
  import OverrideExecution from "sap/ui/core/mvc/OverrideExecution";
45
47
  import type View from "sap/ui/core/mvc/View";
48
+ import type Table from "sap/ui/mdc/Table";
46
49
  import type Binding from "sap/ui/model/Binding";
47
50
  import type JSONModel from "sap/ui/model/json/JSONModel";
48
51
  import type Context from "sap/ui/model/odata/v4/Context";
@@ -205,6 +208,60 @@ class ObjectPageController extends PageController {
205
208
  return oTable && oTable.getRowBinding();
206
209
  }
207
210
 
211
+ /**
212
+ * Find the last visible subsection and add the sapUxAPObjectPageSubSectionFitContainer CSS class if it contains only a gridTable.
213
+ *
214
+ * @param subSections The sub sections to look for
215
+ * @private
216
+ */
217
+ private checkSectionsForGridTable(subSections: ObjectPageSubSection[]) {
218
+ const changeClassForTables = (event: Event, lastVisibleSubSection: ObjectPageSubSection) => {
219
+ const blocks = [...lastVisibleSubSection.getBlocks(), ...lastVisibleSubSection.getMoreBlocks()];
220
+ if (
221
+ blocks.length === 1 &&
222
+ this.searchTableInBlock(blocks[0] as SubSectionBlock)
223
+ ?.getType()
224
+ ?.isA("sap.ui.mdc.table.GridTableType")
225
+ ) {
226
+ //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
227
+ lastVisibleSubSection.addStyleClass("sapUxAPObjectPageSubSectionFitContainer");
228
+ lastVisibleSubSection.detachEvent("modelContextChange", changeClassForTables, this);
229
+ }
230
+ };
231
+ for (let subSectionIndex = subSections.length - 1; subSectionIndex >= 0; subSectionIndex--) {
232
+ if (subSections[subSectionIndex].getVisible()) {
233
+ const lastVisibleSubSection = subSections[subSectionIndex];
234
+ // We need to attach this event in order to manage the Object Page Lazy Loading mechanism
235
+ lastVisibleSubSection.attachEvent("modelContextChange", lastVisibleSubSection, changeClassForTables, this);
236
+ break;
237
+ }
238
+ }
239
+ }
240
+
241
+ /**
242
+ * Find a table in blocks of section.
243
+ *
244
+ * @param block One sub section block
245
+ * @returns Table if exists
246
+ */
247
+ private searchTableInBlock(block: SubSectionBlock) {
248
+ const control = block.content;
249
+ let tableAPI: TableAPI | undefined;
250
+ if (block.isA("sap.fe.templates.ObjectPage.controls.SubSectionBlock")) {
251
+ // The table may currently be shown in a full screen dialog, we can then get the reference to the TableAPI
252
+ // control from the custom data of the place holder panel
253
+ if (control.isA("sap.m.Panel") && control.data("FullScreenTablePlaceHolder")) {
254
+ tableAPI = control.data("tableAPIreference");
255
+ } else if (control.isA("sap.fe.macros.table.TableAPI")) {
256
+ tableAPI = control as TableAPI;
257
+ }
258
+ if (tableAPI) {
259
+ return tableAPI.content as Table;
260
+ }
261
+ }
262
+ return undefined;
263
+ }
264
+
208
265
  onBeforeRendering() {
209
266
  PageController.prototype.onBeforeRendering.apply(this);
210
267
  // In the retrieveTextFromValueList scenario we need to ensure in case of reload/refresh that the meta model in the methode retrieveTextFromValueList of the FieldRuntime is available
@@ -221,6 +278,17 @@ class ObjectPageController extends PageController {
221
278
  .catch(function (oError: any) {
222
279
  Log.error("Error while retrieving the resource bundle", oError);
223
280
  });
281
+ let subSections: ObjectPageSubSection[];
282
+ if (this._getObjectPageLayoutControl().getUseIconTabBar()) {
283
+ const sections = this._getObjectPageLayoutControl().getSections();
284
+ for (const section of sections) {
285
+ subSections = section.getSubSections();
286
+ this.checkSectionsForGridTable(subSections);
287
+ }
288
+ } else {
289
+ subSections = this._getAllSubSections();
290
+ this.checkSectionsForGridTable(subSections);
291
+ }
224
292
  }
225
293
 
226
294
  _onBeforeBinding(oContext: any, mParameters: any) {
@@ -349,7 +417,7 @@ class ObjectPageController extends PageController {
349
417
  // Due to the left alignment of the Draft switch and the collaborative draft avatar controls
350
418
  // there is a ToolbarSpacer in the actions aggregation which we need to exclude here!
351
419
  // Due to the ACC report, we also need not to check for the InvisibleText elements
352
- if (oAction.isA("sap.fe.macros.ShareAPI")) {
420
+ if (oAction.isA("sap.fe.macros.share.ShareAPI")) {
353
421
  // since ShareAPI does not have a disable property
354
422
  // hence there is no need to check if it is disbaled or not
355
423
  return oAction.getVisible();
@@ -960,7 +1028,6 @@ class ObjectPageController extends PageController {
960
1028
  }
961
1029
 
962
1030
  _findControlInSubSection(aParentElement: any, aSubsection: any, aControls: any, bIsChart?: boolean) {
963
- const aSubSectionTables = [];
964
1031
  for (let element = 0; element < aParentElement.length; element++) {
965
1032
  let oElement = aParentElement[element].getContent instanceof Function && aParentElement[element].getContent();
966
1033
  if (bIsChart) {
@@ -987,10 +1054,6 @@ class ObjectPageController extends PageController {
987
1054
  }
988
1055
  if (oElement && oElement.isA && oElement.isA("sap.ui.mdc.Table")) {
989
1056
  aControls.push(oElement);
990
- aSubSectionTables.push({
991
- "table": oElement,
992
- "gridTable": oElement.getType().isA("sap.ui.mdc.table.GridTableType")
993
- });
994
1057
  }
995
1058
 
996
1059
  if (oElement && oElement.isA && oElement.isA("sap.fe.macros.chart.ChartAPI")) {
@@ -1003,15 +1066,6 @@ class ObjectPageController extends PageController {
1003
1066
  aControls.push(oElement);
1004
1067
  }
1005
1068
  }
1006
- if (
1007
- aSubSectionTables.length === 1 &&
1008
- aParentElement.length === 1 &&
1009
- aSubSectionTables[0].gridTable &&
1010
- !aSubsection.hasStyleClass("sapUxAPObjectPageSubSectionFitContainer")
1011
- ) {
1012
- //In case there is only a single table in a section we fit that to the whole page so that the scrollbar comes only on table and not on page
1013
- aSubsection.addStyleClass("sapUxAPObjectPageSubSectionFitContainer");
1014
- }
1015
1069
  }
1016
1070
 
1017
1071
  _getAllSubSections() {