@sapui5/sap.fe.templates 1.96.0 → 1.97.0

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 (22) hide show
  1. package/package.json +6 -3
  2. package/src/sap/fe/templates/.library +1 -1
  3. package/src/sap/fe/templates/ListReport/ListReport.view.xml +2 -2
  4. package/src/sap/fe/templates/ListReport/ListReportController.controller.js +91 -60
  5. package/src/sap/fe/templates/ListReport/overrides/ViewState.js +31 -5
  6. package/src/sap/fe/templates/ObjectPage/AnnotationHelper.js +2 -2
  7. package/src/sap/fe/templates/ObjectPage/Component.js +18 -1
  8. package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.js +114 -85
  9. package/src/sap/fe/templates/ObjectPage/controls/StashableHBox.js +8 -0
  10. package/src/sap/fe/templates/ObjectPage/overrides/ViewState.js +23 -3
  11. package/src/sap/fe/templates/ObjectPage/templating/ObjectPageTemplating.js +6 -5
  12. package/src/sap/fe/templates/ObjectPage/templating/ObjectPageTemplating.ts +6 -4
  13. package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderDataPointTitle.fragment.xml +26 -16
  14. package/src/sap/fe/templates/ObjectPage/view/fragments/ObjectPageHeaderForm.fragment.xml +5 -5
  15. package/src/sap/fe/templates/RootContainer/controller/Fcl.controller.js +63 -9
  16. package/src/sap/fe/templates/RootContainer/controller/NavContainer.controller.js +54 -32
  17. package/src/sap/fe/templates/RootContainer/controller/RootContainerBaseController.js +24 -21
  18. package/src/sap/fe/templates/RootContainer/view/Fcl.view.xml +2 -1
  19. package/src/sap/fe/templates/RootContainer/view/NavContainer.view.xml +1 -1
  20. package/src/sap/fe/templates/controls/Table.fragment.xml +2 -0
  21. package/src/sap/fe/templates/library.js +1 -1
  22. package/src/sap/fe/templates/controls/OverflowToolbarButtonHover.js +0 -25
@@ -7,12 +7,14 @@ sap.ui.define(
7
7
  "sap/ui/model/json/JSONModel",
8
8
  "./RootContainerBaseController",
9
9
  "sap/fe/core/CommonUtils",
10
+ "sap/fe/core/helpers/KeepAliveHelper",
10
11
  "sap/fe/core/controllerextensions/ViewState",
11
12
  "sap/m/Link",
12
13
  "sap/m/MessagePage",
13
- "sap/m/MessageBox"
14
+ "sap/m/MessageBox",
15
+ "sap/base/Log"
14
16
  ],
15
- function(JSONModel, BaseController, CommonUtils, ViewState, Link, MessagePage, MessageBox) {
17
+ function(JSONModel, BaseController, CommonUtils, KeepAliveHelper, ViewState, Link, MessagePage, MessageBox, Log) {
16
18
  "use strict";
17
19
 
18
20
  /**
@@ -72,7 +74,7 @@ sap.ui.define(
72
74
 
73
75
  return oPagePromise.then(function(oCurrentPage) {
74
76
  var oTargetView = CommonUtils.getTargetView(oCurrentPage);
75
- return CommonUtils.restoreView(oTargetView);
77
+ return KeepAliveHelper.restoreView(oTargetView);
76
78
  });
77
79
  },
78
80
 
@@ -126,40 +128,60 @@ sap.ui.define(
126
128
  _scrollTablesToLastNavigatedItems: function() {},
127
129
 
128
130
  displayMessagePage: function(sErrorMessage, mParameters) {
129
- var oNavContainer = this._getNavContainer();
131
+ return new Promise(
132
+ function(resolve, reject) {
133
+ try {
134
+ var oNavContainer = this._getNavContainer();
135
+
136
+ if (!this.oMessagePage) {
137
+ this.oMessagePage = new MessagePage({
138
+ showHeader: false,
139
+ icon: "sap-icon://message-error"
140
+ });
130
141
 
131
- if (!this.oMessagePage) {
132
- this.oMessagePage = new MessagePage({
133
- showHeader: false,
134
- icon: "sap-icon://message-error"
135
- });
142
+ oNavContainer.addPage(this.oMessagePage);
143
+ }
136
144
 
137
- oNavContainer.addPage(this.oMessagePage);
138
- }
145
+ this.oMessagePage.setText(sErrorMessage);
146
+
147
+ if (mParameters.technicalMessage) {
148
+ this.oMessagePage.setCustomDescription(
149
+ new Link({
150
+ text: mParameters.description || mParameters.technicalMessage,
151
+ press: function() {
152
+ MessageBox.show(mParameters.technicalMessage, {
153
+ icon: MessageBox.Icon.ERROR,
154
+ title: mParameters.title,
155
+ actions: [MessageBox.Action.OK],
156
+ defaultAction: MessageBox.Action.OK,
157
+ details: mParameters.technicalDetails || "",
158
+ contentWidth: "60%"
159
+ });
160
+ }
161
+ })
162
+ );
163
+ } else {
164
+ this.oMessagePage.setDescription(mParameters.description || "");
165
+ }
139
166
 
140
- this.oMessagePage.setText(sErrorMessage);
141
-
142
- if (mParameters.technicalMessage) {
143
- this.oMessagePage.setCustomDescription(
144
- new Link({
145
- text: mParameters.description || mParameters.technicalMessage,
146
- press: function() {
147
- MessageBox.show(mParameters.technicalMessage, {
148
- icon: MessageBox.Icon.ERROR,
149
- title: mParameters.title,
150
- actions: [MessageBox.Action.OK],
151
- defaultAction: MessageBox.Action.OK,
152
- details: mParameters.technicalDetails || "",
153
- contentWidth: "60%"
167
+ if (mParameters.handleShellBack) {
168
+ var oErrorOriginPage = oNavContainer.getCurrentPage(),
169
+ oAppComponent = CommonUtils.getAppComponent(oNavContainer.getCurrentPage());
170
+ oAppComponent.getShellServices().setBackNavigation(function() {
171
+ oNavContainer.to(oErrorOriginPage.getId());
172
+ oAppComponent.getShellServices().setBackNavigation();
154
173
  });
155
174
  }
156
- })
157
- );
158
- } else {
159
- this.oMessagePage.setDescription(mParameters.description || "");
160
- }
161
-
162
- oNavContainer.to(this.oMessagePage.getId());
175
+ oNavContainer.attachAfterNavigate(function() {
176
+ resolve(true);
177
+ });
178
+ oNavContainer.to(this.oMessagePage.getId());
179
+ } catch (e) {
180
+ reject(false);
181
+ Log.info(e);
182
+ }
183
+ }.bind(this)
184
+ );
163
185
  }
164
186
  });
165
187
  },
@@ -53,12 +53,12 @@ sap.ui.define(
53
53
  this.oPlaceholder.attachRouteMatchers();
54
54
  this.getAppComponent()
55
55
  .getRoutingService()
56
- .attachAfterRouteMatched(this.shellTitleHandler, this);
56
+ .attachAfterRouteMatched(this._onAfterRouteMatched, this);
57
57
  },
58
58
  onExit: function() {
59
59
  this.getAppComponent()
60
60
  .getRoutingService()
61
- .detachAfterRouteMatched(this.shellTitleHandler, this);
61
+ .detachAfterRouteMatched(this._onAfterRouteMatched, this);
62
62
  this.oRouter = null;
63
63
 
64
64
  SizeHelper.exit();
@@ -132,46 +132,49 @@ sap.ui.define(
132
132
  },
133
133
 
134
134
  /**
135
- * This function is updating the shell title after each navigation.
135
+ * Callback when the navigation is done.
136
+ * - update the shell title.
137
+ * - update table scroll.
138
+ * - call onPageReady on the rightMostView.
136
139
  *
137
140
  * @param oEvent
138
- * @name sap.fe.templates.RootContainer.controller.BaseController#shellTitleHandler
141
+ * @name sap.fe.templates.RootContainer.controller.BaseController#_onAfterRouteMatched
139
142
  * @memberof sap.fe.templates.RootContainer.controller.BaseController
140
143
  */
141
- shellTitleHandler: function(oEvent) {
144
+ _onAfterRouteMatched: function(oEvent) {
142
145
  var that = this;
143
- if (!that.oShellTitlePromise) {
144
- that.oShellTitlePromise = that
146
+ if (!that._oRouteMatchedPromise) {
147
+ that._oRouteMatchedPromise = that
145
148
  .waitForRightMostViewReady(oEvent)
146
149
  .then(function(oView) {
150
+ // The autoFocus is initially disabled on the navContainer or the FCL, so that the focus stays on the Shell menu
151
+ // even if the app takes a long time to launch
152
+ // The first time the view is displayed, we need to enable the autofocus so that it's managed properly during navigation
153
+ var oRootControl = that.getView().getContent()[0];
154
+ if (oRootControl && oRootControl.getAutoFocus && !oRootControl.getAutoFocus()) {
155
+ oRootControl.setProperty("autoFocus", true, true); // Do not mark the container as invalid, otherwise it's re-rendered
156
+ }
157
+
147
158
  var oAppComponent = that.getAppComponent();
148
159
  var oData = { oView: oView, oAppComponent: oAppComponent };
149
160
  that._scrollTablesToLastNavigatedItems();
150
161
  if (oAppComponent.getEnvironmentCapabilities().getCapabilities().UShell) {
151
162
  that.computeTitleHierarchy(oData);
152
163
  }
153
- var oLastFocusedControl = oAppComponent.getRouterProxy().getFocusControlForCurrentHash();
164
+ var bForceFocus = oAppComponent.getRouterProxy().isFocusForced();
165
+ oAppComponent.getRouterProxy().setFocusForced(false); // reset
154
166
  if (oView.getController() && oView.getController().onPageReady) {
155
- if (oLastFocusedControl) {
156
- oView.getParent().onPageReady({ lastFocusedControl: oLastFocusedControl });
157
- } else {
158
- var currentFocusedControlId = sap.ui.getCore().getCurrentFocusedControlId();
159
- var oCurrentFocusedControl = {
160
- controlId: currentFocusedControlId,
161
- focusInfo: { id: currentFocusedControlId }
162
- };
163
- oView.getParent().onPageReady({ lastFocusedControl: oCurrentFocusedControl });
164
- }
167
+ oView.getParent().onPageReady({ forceFocus: bForceFocus });
165
168
  }
166
169
  if (that.onContainerReady) {
167
170
  that.onContainerReady();
168
171
  }
169
-
170
- that.oShellTitlePromise = null;
171
172
  })
172
173
  .catch(function(oError) {
173
174
  Log.error("An error occurs while computing the title hierarchy and calling focus method", oError);
174
- that.oShellTitlePromise = null;
175
+ })
176
+ .finally(function() {
177
+ that._oRouteMatchedPromise = null;
175
178
  });
176
179
  }
177
180
  },
@@ -8,8 +8,9 @@
8
8
  <FlexibleColumnLayout
9
9
  id="appContent"
10
10
  backgroundDesign="Transparent"
11
- layout="{fcl>/layout}"
12
11
  stateChange="onStateChanged"
13
12
  afterEndColumnNavigate="onStateChanged"
13
+ restoreFocusOnBackNavigation="true"
14
+ autoFocus="false"
14
15
  />
15
16
  </mvc:View>
@@ -5,5 +5,5 @@
5
5
  height="100%"
6
6
  controllerName="sap.fe.templates.RootContainer.controller.NavContainer"
7
7
  >
8
- <NavContainer id="appContent" />
8
+ <NavContainer id="appContent" autoFocus="false" />
9
9
  </mvc:View>
@@ -19,6 +19,8 @@
19
19
  onSegmentedButtonPressed="{= ${converterContext>hasMultiVisualizations} ? '.handlers.onSegmentedButtonPressed' : undefined }"
20
20
  visible="{= ${converterContext>hasMultiVisualizations} ? '{= ${pageInternal>alpContentView} !== \'Chart\'}' : 'true' }"
21
21
  tabTitle="{view>title}"
22
+ fieldMode='{= ${converterContext>templateType} === "ListReport" ? "nowrapper" : ""}'
23
+ stateChanged='{= ${converterContext>template} !== "ObjectPage" ? ".handlers.onTableStateChanged" : undefined}'
22
24
  >
23
25
  </macro:Table>
24
26
  </core:FragmentDefinition>
@@ -46,7 +46,7 @@ sap.ui.define(
46
46
  interfaces: [],
47
47
  controls: [],
48
48
  elements: [],
49
- version: "1.96.0",
49
+ version: "1.97.0",
50
50
  noLibraryCSS: true
51
51
  });
52
52
  if (!sap.fe.templates.ObjectPage) {
@@ -1,25 +0,0 @@
1
- /*!
2
- * SAPUI5
3
- * (c) Copyright 2009-2021 SAP SE. All rights reserved.
4
- */
5
-
6
- sap.ui.define(["sap/m/OverflowToolbarButton"], function(OverflowToolbarButton) {
7
- "use strict";
8
-
9
- var OverflowToolbarButtonHover = OverflowToolbarButton.extend("sap.fe.templates.ObjectPage.controls.OverflowToolbarButtonHover", {
10
- metadata: {
11
- events: {
12
- hover: {} // this Button has also a "hover" event, in addition to "press" of the normal Button
13
- }
14
- },
15
-
16
- // the hover event handler:
17
- onmouseover: function(evt) {
18
- // is called when the Button is hovered - no event registration required
19
- this.fireHover();
20
- },
21
- renderer: {}
22
- });
23
-
24
- return OverflowToolbarButtonHover;
25
- });