@sapui5/sap.suite.ui.generic.template 1.120.42 → 1.120.43
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/i18n/i18n_id.properties +2 -2
- 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/i18n/i18n_id.properties +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/detailTemplates/detailUtils.js +18 -1
- package/src/sap/suite/ui/generic/template/genericUtilities/controlHelper.js +30 -27
- package/src/sap/suite/ui/generic/template/lib/AppComponent.js +5 -1
- package/src/sap/suite/ui/generic/template/lib/CommonEventHandlers.js +4 -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
|
@@ -63,9 +63,9 @@ VISUAL_FILTER_CHART_TYPE_Donut=Bagan Donat
|
|
|
63
63
|
|
|
64
64
|
VISUAL_FILTER_SORTING=Pengurutan
|
|
65
65
|
|
|
66
|
-
VISUAL_FILTER_SORTING_ASCENDING=
|
|
66
|
+
VISUAL_FILTER_SORTING_ASCENDING=Menaik
|
|
67
67
|
|
|
68
|
-
VISUAL_FILTER_SORTING_DESCENDING=
|
|
68
|
+
VISUAL_FILTER_SORTING_DESCENDING=Menurun
|
|
69
69
|
|
|
70
70
|
VISUAL_FILTER_LINE_CHART_TIME_LINE=Tampilkan
|
|
71
71
|
|
|
@@ -92,7 +92,7 @@ LOCKED_OBJECT_FILTER=Dikunci oleh Pengguna Lain
|
|
|
92
92
|
|
|
93
93
|
UNSAVED_CHANGES=Perubahan Belum Disimpan
|
|
94
94
|
|
|
95
|
-
UNSAVED_CHANGES_FILTER=Perubahan oleh Pengguna Lain
|
|
95
|
+
UNSAVED_CHANGES_FILTER=Perubahan yang Belum Disimpan oleh Pengguna Lain
|
|
96
96
|
|
|
97
97
|
SHARE=Bagikan
|
|
98
98
|
|
|
@@ -1503,7 +1503,7 @@ sap.ui.define([
|
|
|
1503
1503
|
return null;
|
|
1504
1504
|
}
|
|
1505
1505
|
if (controlHelper.isSmartField(oControl)){ // check whether the SmartField is the correct target for focussing
|
|
1506
|
-
return controlHelper.getSmartFieldIsFocussableForInputPromise(oControl).then(function(bIsFocussable){
|
|
1506
|
+
return controlHelper.getSmartFieldIsFocussableForInputPromise(oControl, true).then(function(bIsFocussable){
|
|
1507
1507
|
return bIsFocussable && oControl; // If the SmartField has turned out to be focussable take it. Otherwise no need to investigate the subtree below it.
|
|
1508
1508
|
});
|
|
1509
1509
|
}
|
|
@@ -1563,7 +1563,7 @@ sap.ui.define([
|
|
|
1563
1563
|
//set the focus on the control passed by application
|
|
1564
1564
|
if (controlHelper.isSmartField(oFocusControl)) {
|
|
1565
1565
|
// check whether the SmartField is the correct target for focussing
|
|
1566
|
-
controlHelper.getSmartFieldIsFocussableForInputPromise(oFocusControl).then(function (bIsFocusable) {
|
|
1566
|
+
controlHelper.getSmartFieldIsFocussableForInputPromise(oFocusControl, true).then(function (bIsFocusable) {
|
|
1567
1567
|
if (bIsFocusable) {
|
|
1568
1568
|
controlHelper.focusUI5Control(oFocusControl);
|
|
1569
1569
|
} else {
|
|
@@ -160,7 +160,24 @@ sap.ui.define([ "sap/suite/ui/generic/template/genericUtilities/FeLogger", "sap/
|
|
|
160
160
|
function fnApplyAndUp(oEvent) {
|
|
161
161
|
var oControl = oEvent.getSource();
|
|
162
162
|
var oCRUDActionHandler = oTemplateUtils.oComponentUtils.getCRUDActionHandler();
|
|
163
|
-
|
|
163
|
+
|
|
164
|
+
// Pre-check validation to decide navigation
|
|
165
|
+
var oAppComponent = oController.getOwnerComponent().getAppComponent();
|
|
166
|
+
var oManifestSettings = oAppComponent.getManifest()["sap.ui.generic.app"];
|
|
167
|
+
var bNavigateImmediately = oManifestSettings &&
|
|
168
|
+
oManifestSettings.settings &&
|
|
169
|
+
oManifestSettings.settings.applyButtonNavigatesImmediately;
|
|
170
|
+
if (bNavigateImmediately) {
|
|
171
|
+
oCRUDActionHandler.hasValidationMessageOnDetailsViews().then(function(bHasValidationErrors) {
|
|
172
|
+
if (!bHasValidationErrors) {
|
|
173
|
+
// No frontend errors - navigate immediately
|
|
174
|
+
fnNavigateUp();
|
|
175
|
+
oTemplateUtils.oServices.oApplicationController.synchronizeDraftAsync();
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
} else {
|
|
179
|
+
oCRUDActionHandler.handleCRUDScenario(2, fnApplyAndUpImpl.bind(null, oControl));
|
|
180
|
+
}
|
|
164
181
|
}
|
|
165
182
|
|
|
166
183
|
var oDiscardEditHandler; // singleton, initialized on demand
|
|
@@ -1,24 +1,27 @@
|
|
|
1
|
-
sap.ui.define([
|
|
1
|
+
sap.ui.define([
|
|
2
|
+
"sap/ui/dom/getFirstEditableInput",
|
|
3
|
+
"sap/suite/ui/generic/template/genericUtilities/FeLogger"
|
|
4
|
+
], function(getFirstEditableInput, FeLogger) {
|
|
2
5
|
"use strict";
|
|
3
|
-
|
|
6
|
+
|
|
4
7
|
var oFeLogger = new FeLogger("genericUtilities.controlHelper");
|
|
5
8
|
var oLogger = oFeLogger.getLogger();
|
|
6
|
-
|
|
9
|
+
|
|
7
10
|
var byId = sap.ui.getCore().byId;
|
|
8
|
-
|
|
11
|
+
|
|
9
12
|
function isControlOfType(sPathToType, oControl){
|
|
10
13
|
var FNClass = sap.ui.require(sPathToType);
|
|
11
14
|
return typeof FNClass === "function" && (oControl instanceof FNClass);
|
|
12
15
|
}
|
|
13
|
-
|
|
16
|
+
|
|
14
17
|
function getUI5ControlForDomElement(oDom){
|
|
15
18
|
for (; oDom; oDom = oDom.parentNode) {
|
|
16
19
|
if (oDom.hasAttribute && oDom.hasAttribute("data-sap-ui")) {
|
|
17
20
|
return sap.ui.getCore().byId(oDom.id);
|
|
18
21
|
}
|
|
19
|
-
}
|
|
22
|
+
}
|
|
20
23
|
}
|
|
21
|
-
|
|
24
|
+
|
|
22
25
|
function focusUI5Control(oControl, oFocusInfo){
|
|
23
26
|
if (oControl && oControl.focus) {
|
|
24
27
|
oLogger.debug("Set focus on control with id " + oControl.getId());
|
|
@@ -40,9 +43,9 @@ sap.ui.define(["sap/ui/dom/getFirstEditableInput", "sap/suite/ui/generic/templat
|
|
|
40
43
|
if (oTest !== oControl){
|
|
41
44
|
oLogger.warning(oCurrentFocus ? ("Focus is now on control with id " + oCurrentFocus.getId()) : "There is no focus now");
|
|
42
45
|
}
|
|
43
|
-
}
|
|
46
|
+
}
|
|
44
47
|
}
|
|
45
|
-
|
|
48
|
+
|
|
46
49
|
function focusDom(oDom, oFocusInfo){
|
|
47
50
|
var oUi5Control = getUI5ControlForDomElement(oDom);
|
|
48
51
|
focusUI5Control(oUi5Control, oFocusInfo);
|
|
@@ -54,12 +57,12 @@ sap.ui.define(["sap/ui/dom/getFirstEditableInput", "sap/suite/ui/generic/templat
|
|
|
54
57
|
}
|
|
55
58
|
|
|
56
59
|
// returns a Promise that resolves to the boolean information whether the SmartField is a possible focus target for input.
|
|
57
|
-
function getSmartFieldIsFocussableForInputPromise(oSmartField) {
|
|
60
|
+
function getSmartFieldIsFocussableForInputPromise(oSmartField, isSmartForm) {
|
|
58
61
|
return oSmartField._getComputedMetadata().then(function () {
|
|
59
62
|
return (oSmartField.getMode() === "edit") && (oSmartField._getICRenderedPromise() || Promise.resolve());
|
|
60
63
|
}).then(function () {
|
|
61
|
-
var oFirstFocusableInput = !oSmartField._bEdmBoolDetected && getFirstEditableInput(oSmartField.getDomRef());
|
|
62
|
-
return !(!oFirstFocusableInput || oFirstFocusableInput.type === "checkbox");
|
|
64
|
+
var oFirstFocusableInput = (!oSmartField._bEdmBoolDetected || isSmartForm) && getFirstEditableInput(oSmartField.getDomRef());
|
|
65
|
+
return !(!oFirstFocusableInput || (oFirstFocusableInput.type === "checkbox" && !isSmartForm));
|
|
63
66
|
}).catch(function () {
|
|
64
67
|
return false;
|
|
65
68
|
});
|
|
@@ -70,7 +73,7 @@ sap.ui.define(["sap/ui/dom/getFirstEditableInput", "sap/suite/ui/generic/templat
|
|
|
70
73
|
function getControlWithFocus(){
|
|
71
74
|
return getUI5ControlForDomElement(document.activeElement);
|
|
72
75
|
}
|
|
73
|
-
|
|
76
|
+
|
|
74
77
|
// If oChild is identified to be invisible, null is returned. Otherwise its parent is returned.
|
|
75
78
|
// If the parent does not exist a faulty value is returned.
|
|
76
79
|
// This is a heuristic method.
|
|
@@ -99,7 +102,7 @@ sap.ui.define(["sap/ui/dom/getFirstEditableInput", "sap/suite/ui/generic/templat
|
|
|
99
102
|
}
|
|
100
103
|
return vRet;
|
|
101
104
|
}
|
|
102
|
-
|
|
105
|
+
|
|
103
106
|
// Return a list of all children of the given control (in the 'correct' order). Only implemented for certain control types.
|
|
104
107
|
// For the other control types it returns null or an empty array depending on bAlwaysReturnAList.
|
|
105
108
|
function getChildren(oControl, bAlwaysReturnAList){
|
|
@@ -113,7 +116,7 @@ sap.ui.define(["sap/ui/dom/getFirstEditableInput", "sap/suite/ui/generic/templat
|
|
|
113
116
|
return oControl.getBlocks().concat(oControl.getMoreBlocks());
|
|
114
117
|
}
|
|
115
118
|
if (isControlOfType("sap/ui/comp/smartform/Group", oControl)){
|
|
116
|
-
return oControl.getFormElements();
|
|
119
|
+
return oControl.getFormElements();
|
|
117
120
|
}
|
|
118
121
|
if (isControlOfType("sap/ui/table/Column", oControl)){
|
|
119
122
|
var aRet = oControl.getMultiLabels();
|
|
@@ -121,11 +124,11 @@ sap.ui.define(["sap/ui/dom/getFirstEditableInput", "sap/suite/ui/generic/templat
|
|
|
121
124
|
if (oLabel){
|
|
122
125
|
aRet.push(oLabel);
|
|
123
126
|
}
|
|
124
|
-
return aRet;
|
|
125
|
-
}
|
|
127
|
+
return aRet;
|
|
128
|
+
}
|
|
126
129
|
return bAlwaysReturnAList ? [] : null;
|
|
127
130
|
}
|
|
128
|
-
|
|
131
|
+
|
|
129
132
|
// Sorter that compares the position of two child controls which have a common parent.
|
|
130
133
|
// Returns a positive integer when oChild1 is larger, a negative number if oChild2 is larger, and 0 if they are identical.
|
|
131
134
|
// Depends on getChildren() being implemented for commonParent. If this is not the case, at least a reproducable order is guaranteed.
|
|
@@ -146,13 +149,13 @@ sap.ui.define(["sap/ui/dom/getFirstEditableInput", "sap/suite/ui/generic/templat
|
|
|
146
149
|
}
|
|
147
150
|
if (iPositionCompare & Node.DOCUMENT_POSITION_FOLLOWING){
|
|
148
151
|
return -1;
|
|
149
|
-
}
|
|
152
|
+
}
|
|
150
153
|
}
|
|
151
154
|
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.
|
|
152
155
|
}
|
|
153
156
|
return (iPos1 >= 0 && iPos2 >= 0) ? (iPos1 - iPos2) : (iPos2 - iPos1); // if only one child has been identified in the list of children it takes precedence.
|
|
154
157
|
}
|
|
155
|
-
|
|
158
|
+
|
|
156
159
|
// This function defines which instances of sap.ui.core.Element are relevant for investigation (Currently used in fnSearchInTree).
|
|
157
160
|
// They must posess a property 'visible' (which is guaranteed for all instances of sap.ui.core.Control) which is true.
|
|
158
161
|
// If they have a property 'enabled' this must be true as well.
|
|
@@ -162,7 +165,7 @@ sap.ui.define(["sap/ui/dom/getFirstEditableInput", "sap/suite/ui/generic/templat
|
|
|
162
165
|
return checkForRelevance(oCell);
|
|
163
166
|
}) : (typeof oElement.getVisible === "function" && oElement.getVisible() && (typeof oElement.getEnabled !== "function" || oElement.getEnabled()));
|
|
164
167
|
}
|
|
165
|
-
|
|
168
|
+
|
|
166
169
|
// This function allows a depth-first search in an element tree starting with root oElement
|
|
167
170
|
// Thereby, the following logic is applied
|
|
168
171
|
// - 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
|
|
@@ -174,14 +177,14 @@ sap.ui.define(["sap/ui/dom/getFirstEditableInput", "sap/suite/ui/generic/templat
|
|
|
174
177
|
// Note that mAlreadyAnalyzed will be updated by this function
|
|
175
178
|
// fnHandleElement(oElement) is a function that will be called on all relevant elements of the tree.
|
|
176
179
|
// 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.
|
|
177
|
-
// 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.
|
|
180
|
+
// 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.
|
|
178
181
|
// If the result is a truthy value for one element this value is considered as the result of fnSearchInTree and the processing is stopped.
|
|
179
182
|
// fnSearchInTree returns this result synchronously if all calls of fnHandleElement which have been performed until then have worked synchronously.
|
|
180
183
|
// If the result of fnHandleElement is faulty the depth-first search of the tree proceeds. Thereby the processing of the subtree of oElement is
|
|
181
184
|
// skipped if the result was exactly false. For other faulty values the subtree will be processed next.
|
|
182
185
|
// 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
|
|
183
186
|
// the result of this step is available. Only then the next element will be analyzed.
|
|
184
|
-
// If fnHandleElement never results in a truthy value then fnSearchInTree results in null.
|
|
187
|
+
// If fnHandleElement never results in a truthy value then fnSearchInTree results in null.
|
|
185
188
|
function fnSearchInTree(mAlreadyAnalyzed, oElement, fnHandleElement){
|
|
186
189
|
mAlreadyAnalyzed = mAlreadyAnalyzed || Object.create(null);
|
|
187
190
|
var sId = oElement.getId();
|
|
@@ -199,7 +202,7 @@ sap.ui.define(["sap/ui/dom/getFirstEditableInput", "sap/suite/ui/generic/templat
|
|
|
199
202
|
if (!aChildren){ // if getChildren does not care for the control type of oElement
|
|
200
203
|
aChildren = oElement.findElements(false);
|
|
201
204
|
aChildren.sort(fnSortChildControls.bind(null, oElement));
|
|
202
|
-
}
|
|
205
|
+
}
|
|
203
206
|
aChildren.some(function(oChild){
|
|
204
207
|
vResult = fnSearchInTree(mAlreadyAnalyzed, oChild, fnHandleElement);
|
|
205
208
|
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.
|
|
@@ -219,7 +222,7 @@ sap.ui.define(["sap/ui/dom/getFirstEditableInput", "sap/suite/ui/generic/templat
|
|
|
219
222
|
}
|
|
220
223
|
// 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
|
|
221
224
|
mAlreadyAnalyzed[sId] = 2;
|
|
222
|
-
return vResult || null;
|
|
225
|
+
return vResult || null;
|
|
223
226
|
}
|
|
224
227
|
|
|
225
228
|
var oControlHelper = {
|
|
@@ -261,10 +264,10 @@ sap.ui.define(["sap/ui/dom/getFirstEditableInput", "sap/suite/ui/generic/templat
|
|
|
261
264
|
sortChildControls: fnSortChildControls,
|
|
262
265
|
searchInTree: fnSearchInTree.bind(null, null)
|
|
263
266
|
};
|
|
264
|
-
|
|
267
|
+
|
|
265
268
|
oControlHelper.isTable = function(oControl){
|
|
266
269
|
return oControlHelper.isSmartTable(oControl) || oControlHelper.isUiTable(oControl) || oControlHelper.isMTable(oControl);
|
|
267
270
|
};
|
|
268
|
-
|
|
271
|
+
|
|
269
272
|
return oControlHelper;
|
|
270
273
|
});
|
|
@@ -939,7 +939,7 @@ sap.ui.define([
|
|
|
939
939
|
* @extends sap.ui.core.UIComponent
|
|
940
940
|
* @abstract
|
|
941
941
|
* @author SAP SE
|
|
942
|
-
* @version 1.120.
|
|
942
|
+
* @version 1.120.43
|
|
943
943
|
* @name sap.suite.ui.generic.template.lib.AppComponent
|
|
944
944
|
*/
|
|
945
945
|
return UIComponent.extend("sap.suite.ui.generic.template.lib.AppComponent", {
|
|
@@ -994,6 +994,10 @@ sap.ui.define([
|
|
|
994
994
|
type: "string",
|
|
995
995
|
defaultValue: "Middle"
|
|
996
996
|
},
|
|
997
|
+
applyButtonNavigatesImmediately : {
|
|
998
|
+
type:"boolean",
|
|
999
|
+
defaultValue: false
|
|
1000
|
+
},
|
|
997
1001
|
//The column layout is used by default in the SmartForm on the object page
|
|
998
1002
|
useColumnLayoutForSmartForm: {
|
|
999
1003
|
type: "boolean",
|
|
@@ -166,7 +166,10 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
166
166
|
oCurrentPaginatorInfo = oRet; // make sure that the navigation below does not create a new paginator info but reuses the existing one
|
|
167
167
|
onListNavigate(oSourceItem, oState, oTargetContext, true, oViewProxy);
|
|
168
168
|
};
|
|
169
|
-
|
|
169
|
+
var oComponent = oController.getOwnerComponent();
|
|
170
|
+
var bOpenInEditMode = !!oComponent.getEditFlow && oComponent.getEditFlow() === "direct";
|
|
171
|
+
|
|
172
|
+
if (bIsActive && bIsEditItem && !bOpenInEditMode){ // in this case oListBinding (and thus oContext which was derived from it) points to the active version, but we are already in the draft version
|
|
170
173
|
oServices.oApplication.registerContext(oContext, oComponentUtils.getViewLevel() + 1); // determine the sibling context
|
|
171
174
|
var oSiblingPromise = oServices.oApplication.getDraftSiblingPromise(oContext); // as the "real" target of this pagination
|
|
172
175
|
oSiblingPromise.then(fnPaginateImpl);
|
|
@@ -3094,7 +3094,7 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
3094
3094
|
* @param {sap.suite.ui.generic.template.lib.AppComponent} oAppComponent The AppComponent instance
|
|
3095
3095
|
* @public
|
|
3096
3096
|
* @extends sap.ui.base.Object
|
|
3097
|
-
* @version 1.120.
|
|
3097
|
+
* @version 1.120.43
|
|
3098
3098
|
* @since 1.30.0
|
|
3099
3099
|
* @alias sap.suite.ui.generic.template.lib.NavigationController
|
|
3100
3100
|
*/
|