@sapui5/sap.suite.ui.generic.template 1.142.8 → 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.
- package/package.json +1 -1
- package/src/sap/suite/ui/generic/template/.library +1 -1
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/Canvas/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/controller/ControllerImplementation.js +2 -2
- package/src/sap/suite/ui/generic/template/ObjectPage/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/QuickCreate/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/QuickView/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/genericUtilities/controlHelper.js +29 -29
- package/src/sap/suite/ui/generic/template/lib/AppComponent.js +1 -1
- package/src/sap/suite/ui/generic/template/lib/navigation/NavigationController.js +1 -1
- package/src/sap/suite/ui/generic/template/library.js +1 -1
package/package.json
CHANGED
|
@@ -1493,7 +1493,7 @@ sap.ui.define([
|
|
|
1493
1493
|
return null;
|
|
1494
1494
|
}
|
|
1495
1495
|
if (controlHelper.isSmartField(oControl)){ // check whether the SmartField is the correct target for focussing
|
|
1496
|
-
return controlHelper.getSmartFieldIsFocussableForInputPromise(oControl).then(function(bIsFocussable){
|
|
1496
|
+
return controlHelper.getSmartFieldIsFocussableForInputPromise(oControl, true).then(function(bIsFocussable){
|
|
1497
1497
|
return bIsFocussable && oControl; // If the SmartField has turned out to be focussable take it. Otherwise no need to investigate the subtree below it.
|
|
1498
1498
|
});
|
|
1499
1499
|
}
|
|
@@ -1553,7 +1553,7 @@ sap.ui.define([
|
|
|
1553
1553
|
//set the focus on the control passed by application
|
|
1554
1554
|
if (controlHelper.isSmartField(oFocusControl)) {
|
|
1555
1555
|
// check whether the SmartField is the correct target for focussing
|
|
1556
|
-
controlHelper.getSmartFieldIsFocussableForInputPromise(oFocusControl).then(function (bIsFocusable) {
|
|
1556
|
+
controlHelper.getSmartFieldIsFocussableForInputPromise(oFocusControl, true).then(function (bIsFocusable) {
|
|
1557
1557
|
if (bIsFocusable) {
|
|
1558
1558
|
controlHelper.focusUI5Control(oFocusControl);
|
|
1559
1559
|
} else {
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
sap.ui.define([
|
|
2
|
-
"sap/ui/dom/getFirstEditableInput",
|
|
2
|
+
"sap/ui/dom/getFirstEditableInput",
|
|
3
3
|
"sap/suite/ui/generic/template/genericUtilities/FeLogger",
|
|
4
4
|
"sap/ui/core/Element",
|
|
5
5
|
"sap/ui/table/plugins/MultiSelectionPlugin"
|
|
6
6
|
], function(getFirstEditableInput, FeLogger, Element, MultiSelectionPlugin) {
|
|
7
7
|
"use strict";
|
|
8
|
-
|
|
8
|
+
|
|
9
9
|
var oFeLogger = new FeLogger("genericUtilities.controlHelper");
|
|
10
10
|
var oLogger = oFeLogger.getLogger();
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
var byId = Element.getElementById;
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
function isControlOfType(sPathToType, oControl){
|
|
15
15
|
var FNClass = sap.ui.require(sPathToType);
|
|
16
16
|
return typeof FNClass === "function" && (oControl instanceof FNClass);
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
|
|
19
19
|
function getUI5ControlForDomElement(oDom){
|
|
20
20
|
for (; oDom; oDom = oDom.parentNode) {
|
|
21
21
|
if (oDom.hasAttribute && oDom.hasAttribute("data-sap-ui")) {
|
|
22
22
|
return byId(oDom.id);
|
|
23
23
|
}
|
|
24
|
-
}
|
|
24
|
+
}
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
|
|
27
27
|
function focusUI5Control(oControl, oFocusInfo){
|
|
28
28
|
if (oControl && oControl.focus) {
|
|
29
29
|
oLogger.debug("Set focus on control with id " + oControl.getId());
|
|
@@ -52,9 +52,9 @@ sap.ui.define([
|
|
|
52
52
|
if (oTest !== oControl){
|
|
53
53
|
oLogger.warning(oCurrentFocus ? ("Focus is now on control with id " + oCurrentFocus.getId()) : "There is no focus now");
|
|
54
54
|
}
|
|
55
|
-
}
|
|
55
|
+
}
|
|
56
56
|
}
|
|
57
|
-
|
|
57
|
+
|
|
58
58
|
function focusDom(oDom, oFocusInfo){
|
|
59
59
|
var oUi5Control = getUI5ControlForDomElement(oDom);
|
|
60
60
|
focusUI5Control(oUi5Control, oFocusInfo);
|
|
@@ -66,12 +66,12 @@ sap.ui.define([
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
// returns a Promise that resolves to the boolean information whether the SmartField is a possible focus target for input.
|
|
69
|
-
function getSmartFieldIsFocussableForInputPromise(oSmartField) {
|
|
69
|
+
function getSmartFieldIsFocussableForInputPromise(oSmartField, isSmartForm) {
|
|
70
70
|
return oSmartField._getComputedMetadata().then(function () {
|
|
71
71
|
return (oSmartField.getMode() === "edit") && (oSmartField._getICRenderedPromise() || Promise.resolve());
|
|
72
72
|
}).then(function () {
|
|
73
|
-
var oFirstFocusableInput = !oSmartField._bEdmBoolDetected && getFirstEditableInput(oSmartField.getDomRef());
|
|
74
|
-
return !(!oFirstFocusableInput || oFirstFocusableInput.type === "checkbox");
|
|
73
|
+
var oFirstFocusableInput = (!oSmartField._bEdmBoolDetected || isSmartForm) && getFirstEditableInput(oSmartField.getDomRef());
|
|
74
|
+
return !(!oFirstFocusableInput || (oFirstFocusableInput.type === "checkbox" && !isSmartForm));
|
|
75
75
|
}).catch(function () {
|
|
76
76
|
return false;
|
|
77
77
|
});
|
|
@@ -82,12 +82,12 @@ sap.ui.define([
|
|
|
82
82
|
function getControlWithFocus(){
|
|
83
83
|
return getUI5ControlForDomElement(document.activeElement);
|
|
84
84
|
}
|
|
85
|
-
|
|
85
|
+
|
|
86
86
|
// Returns the parent of a given sap.ui.core.Element, but considers that for Components the parent is to be found via the oContainer property.
|
|
87
87
|
function getParent(oElement){
|
|
88
88
|
return oElement.getParent() || oElement.oContainer;
|
|
89
89
|
}
|
|
90
|
-
|
|
90
|
+
|
|
91
91
|
// If oChild is identified to be invisible, null is returned. Otherwise its parent is returned.
|
|
92
92
|
// If the parent does not exist a faulty value is returned.
|
|
93
93
|
// This is a heuristic method.
|
|
@@ -113,7 +113,7 @@ sap.ui.define([
|
|
|
113
113
|
}
|
|
114
114
|
return vRet;
|
|
115
115
|
}
|
|
116
|
-
|
|
116
|
+
|
|
117
117
|
// Return a list of all children of the given control (in the 'correct' order). Only implemented for certain control types.
|
|
118
118
|
// For the other control types it returns null or an empty array depending on bAlwaysReturnAList.
|
|
119
119
|
function getChildren(oControl, bAlwaysReturnAList){
|
|
@@ -127,7 +127,7 @@ sap.ui.define([
|
|
|
127
127
|
return oControl.getBlocks().concat(oControl.getMoreBlocks());
|
|
128
128
|
}
|
|
129
129
|
if (isControlOfType("sap/ui/comp/smartform/Group", oControl)){
|
|
130
|
-
return oControl.getFormElements();
|
|
130
|
+
return oControl.getFormElements();
|
|
131
131
|
}
|
|
132
132
|
if (isControlOfType("sap/ui/table/Column", oControl)){
|
|
133
133
|
var aRet = oControl.getMultiLabels();
|
|
@@ -135,11 +135,11 @@ sap.ui.define([
|
|
|
135
135
|
if (oLabel){
|
|
136
136
|
aRet.push(oLabel);
|
|
137
137
|
}
|
|
138
|
-
return aRet;
|
|
139
|
-
}
|
|
138
|
+
return aRet;
|
|
139
|
+
}
|
|
140
140
|
return bAlwaysReturnAList ? [] : null;
|
|
141
141
|
}
|
|
142
|
-
|
|
142
|
+
|
|
143
143
|
// Sorter that compares the position of two child controls which have a common parent.
|
|
144
144
|
// Returns a positive integer when oChild1 is larger, a negative number if oChild2 is larger, and 0 if they are identical.
|
|
145
145
|
// Depends on getChildren() being implemented for commonParent. If this is not the case, at least a reproducable order is guaranteed.
|
|
@@ -160,13 +160,13 @@ sap.ui.define([
|
|
|
160
160
|
}
|
|
161
161
|
if (iPositionCompare & Node.DOCUMENT_POSITION_FOLLOWING){
|
|
162
162
|
return -1;
|
|
163
|
-
}
|
|
163
|
+
}
|
|
164
164
|
}
|
|
165
165
|
return 1 - 2 * (!oDomRef1 === !oDomRef2 ? oChild1.getId() < oChild2.getId() : !oDomRef2); // if we cannot determine a reasonable order we still want to have a reproducable order. Note that elements with DomRef must clearly be separated from those without.
|
|
166
166
|
}
|
|
167
167
|
return (iPos1 >= 0 && iPos2 >= 0) ? (iPos1 - iPos2) : (iPos2 - iPos1); // if only one child has been identified in the list of children it takes precedence.
|
|
168
168
|
}
|
|
169
|
-
|
|
169
|
+
|
|
170
170
|
// This function defines which instances of sap.ui.core.Element are relevant for investigation (Currently used in fnSearchInTree).
|
|
171
171
|
// They must posess a property 'visible' (which is guaranteed for all instances of sap.ui.core.Control) which is true.
|
|
172
172
|
// If they have a property 'enabled' this must be true as well.
|
|
@@ -176,7 +176,7 @@ sap.ui.define([
|
|
|
176
176
|
return checkForRelevance(oCell);
|
|
177
177
|
}) : (typeof oElement.getVisible === "function" && oElement.getVisible() && (typeof oElement.getEnabled !== "function" || oElement.getEnabled()));
|
|
178
178
|
}
|
|
179
|
-
|
|
179
|
+
|
|
180
180
|
// This function allows a depth-first search in an element tree starting with root oElement
|
|
181
181
|
// Thereby, the following logic is applied
|
|
182
182
|
// - Children of an element are determined by function getChildren in this class. If this provides an empty array method findElements of the element is used
|
|
@@ -188,14 +188,14 @@ sap.ui.define([
|
|
|
188
188
|
// Note that mAlreadyAnalyzed will be updated by this function
|
|
189
189
|
// fnHandleElement(oElement) is a function that will be called on all relevant elements of the tree.
|
|
190
190
|
// This function can work asynchronously (i.e. return a Promise) or synchronously (i.e. return something which is not a Promise) on a case-by-case basis.
|
|
191
|
-
// In the second case the return value will be considered as the result of the function. In the first case the value the Promise resolves to will be considered as the result.
|
|
191
|
+
// In the second case the return value will be considered as the result of the function. In the first case the value the Promise resolves to will be considered as the result.
|
|
192
192
|
// If the result is a truthy value for one element this value is considered as the result of fnSearchInTree and the processing is stopped.
|
|
193
193
|
// fnSearchInTree returns this result synchronously if all calls of fnHandleElement which have been performed until then have worked synchronously.
|
|
194
194
|
// If the result of fnHandleElement is faulty the depth-first search of the tree proceeds. Thereby the processing of the subtree of oElement is
|
|
195
195
|
// skipped if the result was exactly false. For other faulty values the subtree will be processed next.
|
|
196
196
|
// Note that this process will never work on two elements in parallel. If the processing of one element is asynchronous the process is interrupted until
|
|
197
197
|
// the result of this step is available. Only then the next element will be analyzed.
|
|
198
|
-
// If fnHandleElement never results in a truthy value then fnSearchInTree results in null.
|
|
198
|
+
// If fnHandleElement never results in a truthy value then fnSearchInTree results in null.
|
|
199
199
|
function fnSearchInTree(mAlreadyAnalyzed, oElement, fnHandleElement){
|
|
200
200
|
mAlreadyAnalyzed = mAlreadyAnalyzed || Object.create(null);
|
|
201
201
|
var sId = oElement.getId();
|
|
@@ -213,7 +213,7 @@ sap.ui.define([
|
|
|
213
213
|
if (!aChildren){ // if getChildren does not care for the control type of oElement
|
|
214
214
|
aChildren = oElement.findElements(false);
|
|
215
215
|
aChildren.sort(fnSortChildControls.bind(null, oElement));
|
|
216
|
-
}
|
|
216
|
+
}
|
|
217
217
|
aChildren.some(function(oChild){
|
|
218
218
|
vResult = fnSearchInTree(mAlreadyAnalyzed, oChild, fnHandleElement);
|
|
219
219
|
return vResult; // If vResult is truthy it is either a Promise (which makes the processing asynchronous) or the result of fnSearchInTree. In both cases we should stop now.
|
|
@@ -233,12 +233,12 @@ sap.ui.define([
|
|
|
233
233
|
}
|
|
234
234
|
// When coming here we have synchronously either found a node with a truthy result or have processed the whole tree without finding any truthy result
|
|
235
235
|
mAlreadyAnalyzed[sId] = 2;
|
|
236
|
-
return vResult || null;
|
|
236
|
+
return vResult || null;
|
|
237
237
|
}
|
|
238
238
|
|
|
239
239
|
/**
|
|
240
240
|
* Returns the selection plugin for the given UI table
|
|
241
|
-
* @param {sap.ui.table.Table} oUiTable
|
|
241
|
+
* @param {sap.ui.table.Table} oUiTable
|
|
242
242
|
* @returns {sap.ui.table.plugins.MultiSelectionPlugin|undefined}
|
|
243
243
|
*/
|
|
244
244
|
function fnGetSelectionPluginForUITable (oUiTable) {
|
|
@@ -286,10 +286,10 @@ sap.ui.define([
|
|
|
286
286
|
searchInTree: fnSearchInTree.bind(null, null),
|
|
287
287
|
getSelectionPluginForUITable: fnGetSelectionPluginForUITable
|
|
288
288
|
};
|
|
289
|
-
|
|
289
|
+
|
|
290
290
|
oControlHelper.isTable = function(oControl){
|
|
291
291
|
return oControlHelper.isSmartTable(oControl) || oControlHelper.isUiTable(oControl) || oControlHelper.isMTable(oControl);
|
|
292
292
|
};
|
|
293
|
-
|
|
293
|
+
|
|
294
294
|
return oControlHelper;
|
|
295
295
|
});
|
|
@@ -959,7 +959,7 @@ sap.ui.define([
|
|
|
959
959
|
* @public
|
|
960
960
|
* @extends sap.ui.core.UIComponent
|
|
961
961
|
* @author SAP SE
|
|
962
|
-
* @version 1.142.
|
|
962
|
+
* @version 1.142.9
|
|
963
963
|
* @name sap.suite.ui.generic.template.lib.AppComponent
|
|
964
964
|
*/
|
|
965
965
|
var oAppComponent = UIComponent.extend("sap.suite.ui.generic.template.lib.AppComponent", {
|
|
@@ -3213,7 +3213,7 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
3213
3213
|
* @param {sap.suite.ui.generic.template.lib.AppComponent} oAppComponent The AppComponent instance
|
|
3214
3214
|
* @public
|
|
3215
3215
|
* @extends sap.ui.base.Object
|
|
3216
|
-
* @version 1.142.
|
|
3216
|
+
* @version 1.142.9
|
|
3217
3217
|
* @since 1.30.0
|
|
3218
3218
|
* @alias sap.suite.ui.generic.template.lib.NavigationController
|
|
3219
3219
|
*/
|