@openui5/sap.ui.layout 1.91.0 → 1.93.2
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/.reuse/dep5 +46 -0
- package/THIRDPARTY.txt +59 -1
- package/package.json +2 -2
- package/src/sap/ui/layout/.library +1 -1
- package/src/sap/ui/layout/AlignedFlowLayout.js +1 -1
- package/src/sap/ui/layout/AssociativeSplitter.js +1 -1
- package/src/sap/ui/layout/BlockLayout.js +1 -1
- package/src/sap/ui/layout/BlockLayoutCell.js +1 -1
- package/src/sap/ui/layout/BlockLayoutCellData.js +1 -1
- package/src/sap/ui/layout/BlockLayoutRow.js +2 -2
- package/src/sap/ui/layout/DynamicSideContent.js +4 -4
- package/src/sap/ui/layout/FixFlex.js +1 -1
- package/src/sap/ui/layout/Grid.js +1 -1
- package/src/sap/ui/layout/GridData.js +1 -1
- package/src/sap/ui/layout/GridRenderer.js +1 -1
- package/src/sap/ui/layout/HorizontalLayout.js +1 -1
- package/src/sap/ui/layout/PaneContainer.js +40 -2
- package/src/sap/ui/layout/ResponsiveFlowLayout.js +1 -1
- package/src/sap/ui/layout/ResponsiveFlowLayoutData.js +1 -1
- package/src/sap/ui/layout/ResponsiveSplitter.js +1 -1
- package/src/sap/ui/layout/ResponsiveSplitterPage.js +1 -1
- package/src/sap/ui/layout/SplitPane.js +13 -4
- package/src/sap/ui/layout/Splitter.js +2 -2
- package/src/sap/ui/layout/SplitterLayoutData.js +6 -2
- package/src/sap/ui/layout/VerticalLayout.js +1 -1
- package/src/sap/ui/layout/changeHandler/AddFormContainer.js +49 -22
- package/src/sap/ui/layout/changeHandler/AddFormField.js +40 -30
- package/src/sap/ui/layout/changeHandler/AddSimpleFormField.js +42 -27
- package/src/sap/ui/layout/changeHandler/AddSimpleFormGroup.js +76 -60
- package/src/sap/ui/layout/changeHandler/HideSimpleForm.js +166 -92
- package/src/sap/ui/layout/changeHandler/MoveSimpleForm.js +185 -141
- package/src/sap/ui/layout/changeHandler/RenameFormContainer.js +45 -35
- package/src/sap/ui/layout/changeHandler/RenameSimpleForm.js +13 -9
- package/src/sap/ui/layout/changeHandler/UnhideSimpleForm.js +64 -49
- package/src/sap/ui/layout/cssgrid/CSSGrid.js +1 -1
- package/src/sap/ui/layout/cssgrid/GridBasicLayout.js +1 -1
- package/src/sap/ui/layout/cssgrid/GridBoxLayout.js +1 -1
- package/src/sap/ui/layout/cssgrid/GridBoxLayoutStyleHelper.js +1 -1
- package/src/sap/ui/layout/cssgrid/GridItemLayoutData.js +1 -1
- package/src/sap/ui/layout/cssgrid/GridLayoutBase.js +1 -1
- package/src/sap/ui/layout/cssgrid/GridLayoutDelegate.js +1 -1
- package/src/sap/ui/layout/cssgrid/GridResponsiveLayout.js +1 -1
- package/src/sap/ui/layout/cssgrid/GridSettings.js +1 -1
- package/src/sap/ui/layout/cssgrid/ResponsiveColumnItemLayoutData.js +1 -1
- package/src/sap/ui/layout/cssgrid/ResponsiveColumnLayout.js +1 -1
- package/src/sap/ui/layout/designtime/form/SimpleForm.designtime.js +7 -2
- package/src/sap/ui/layout/form/ColumnContainerData.js +1 -1
- package/src/sap/ui/layout/form/ColumnElementData.js +1 -1
- package/src/sap/ui/layout/form/ColumnLayout.js +8 -5
- package/src/sap/ui/layout/form/ColumnLayoutRenderer.js +4 -5
- package/src/sap/ui/layout/form/Form.js +3 -3
- package/src/sap/ui/layout/form/FormContainer.js +3 -3
- package/src/sap/ui/layout/form/FormElement.js +2 -4
- package/src/sap/ui/layout/form/FormLayout.js +61 -5
- package/src/sap/ui/layout/form/FormLayoutRenderer.js +30 -19
- package/src/sap/ui/layout/form/GridContainerData.js +1 -1
- package/src/sap/ui/layout/form/GridElementData.js +1 -1
- package/src/sap/ui/layout/form/GridLayout.js +1 -1
- package/src/sap/ui/layout/form/GridLayoutRenderer.js +5 -9
- package/src/sap/ui/layout/form/ResponsiveGridLayout.js +8 -10
- package/src/sap/ui/layout/form/ResponsiveLayout.js +9 -4
- package/src/sap/ui/layout/form/SemanticFormElement.js +53 -36
- package/src/sap/ui/layout/form/SimpleForm.js +12 -10
- package/src/sap/ui/layout/library.js +4 -2
- package/src/sap/ui/layout/themes/base/GridLayout.less +0 -17
- package/src/sap/ui/layout/themes/base/ResponsiveLayout.less +0 -10
- package/src/sap/ui/layout/themes/base/ResponsiveSplitter.less +4 -2
- package/src/sap/ui/layout/themes/base/Splitter.less +1 -9
|
@@ -13,11 +13,15 @@ sap.ui.define([
|
|
|
13
13
|
* Change handler for hiding of a control.
|
|
14
14
|
* @alias sap.ui.fl.changeHandler.HideControl
|
|
15
15
|
* @author SAP SE
|
|
16
|
-
* @version 1.
|
|
16
|
+
* @version 1.93.2
|
|
17
17
|
* @experimental Since 1.27.0
|
|
18
18
|
*/
|
|
19
19
|
var UnhideForm = { };
|
|
20
20
|
|
|
21
|
+
function _isXmlModifier(mPropertyBag) {
|
|
22
|
+
return mPropertyBag.modifier.targets === "xmlTree";
|
|
23
|
+
}
|
|
24
|
+
|
|
21
25
|
/**
|
|
22
26
|
* Unhides a control
|
|
23
27
|
*
|
|
@@ -25,7 +29,7 @@ sap.ui.define([
|
|
|
25
29
|
* @param {sap.ui.core.Control} oControl - control that matches the change selector for applying the change
|
|
26
30
|
* @param {object} mPropertyBag - map containing the control modifier object (either sap.ui.core.util.reflection.JsControlTreeModifier or
|
|
27
31
|
* sap.ui.core.util.reflection.XmlTreeModifier), the view object where the controls are embedded and the application component
|
|
28
|
-
* @returns {
|
|
32
|
+
* @returns {Promise} Promise resolving when change is successfully applied
|
|
29
33
|
* @public
|
|
30
34
|
*/
|
|
31
35
|
UnhideForm.applyChange = function(oChangeWrapper, oControl, mPropertyBag) {
|
|
@@ -35,34 +39,42 @@ sap.ui.define([
|
|
|
35
39
|
|
|
36
40
|
var oChangeDefinition = oChangeWrapper.getDefinition();
|
|
37
41
|
|
|
42
|
+
// in case of custom fields the application needs to be on JS.
|
|
43
|
+
// In the other case the visuality of the control will be overriden by the custom field binding afterwards
|
|
44
|
+
if (_isXmlModifier(mPropertyBag)) {
|
|
45
|
+
return Promise.reject(Error("Change cannot be applied in XML. Retrying in JS."));
|
|
46
|
+
}
|
|
47
|
+
|
|
38
48
|
// !important : sUnhideId was used in 1.40, do not remove for compatibility reasons!
|
|
39
49
|
var oControlToUnhide = oModifier.bySelector(oChangeDefinition.content.elementSelector || oChangeDefinition.content.sUnhideId, oAppComponent, oView);
|
|
40
|
-
|
|
41
|
-
|
|
50
|
+
return Promise.resolve()
|
|
51
|
+
.then(function() {
|
|
52
|
+
return oModifier.getAggregation(oControl, "content");
|
|
53
|
+
})
|
|
54
|
+
.then(function(aContent) {
|
|
55
|
+
var iStart = -1;
|
|
42
56
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
if (oChangeDefinition.changeType === "unhideSimpleFormField") {
|
|
58
|
+
oChangeWrapper.setRevertData(true);
|
|
59
|
+
aContent.some(function (oField, index) {
|
|
60
|
+
if (oField === oControlToUnhide) {
|
|
61
|
+
iStart = index;
|
|
62
|
+
oModifier.setVisible(oField, true);
|
|
63
|
+
}
|
|
64
|
+
if (iStart >= 0 && index > iStart) {
|
|
65
|
+
if ((oModifier.getControlType(oField) === "sap.m.Label")
|
|
66
|
+
|| (oModifier.getControlType(oField) === "sap.ui.comp.smartfield.SmartLabel")
|
|
67
|
+
|| (oModifier.getControlType(oField) === "sap.ui.core.Title")
|
|
68
|
+
|| (oModifier.getControlType(oField) === "sap.m.Title")
|
|
69
|
+
|| (oModifier.getControlType(oField) === "sap.m.Toolbar")
|
|
70
|
+
|| (oModifier.getControlType(oField) === "sap.m.OverflowToolbar")) {
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
oModifier.setVisible(oField, true);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
61
76
|
}
|
|
62
77
|
});
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return true;
|
|
66
78
|
};
|
|
67
79
|
|
|
68
80
|
/**
|
|
@@ -100,7 +112,7 @@ sap.ui.define([
|
|
|
100
112
|
* @param {object} mPropertyBag.modifier Modifier for the controls
|
|
101
113
|
* @param {object} mPropertyBag.appComponent Component in which the change should be applied
|
|
102
114
|
* @param {object} mPropertyBag.view Application view
|
|
103
|
-
* @returns {
|
|
115
|
+
* @returns {Promise} Promise resolving when change is successfully reverted
|
|
104
116
|
* @public
|
|
105
117
|
*/
|
|
106
118
|
UnhideForm.revertChange = function(oChangeWrapper, oControl, mPropertyBag) {
|
|
@@ -112,32 +124,35 @@ sap.ui.define([
|
|
|
112
124
|
|
|
113
125
|
// !important : sUnhideId was used in 1.40, do not remove for compatibility reasons!
|
|
114
126
|
var oControlToRevertUnhide = oModifier.bySelector(oChangeDefinition.content.elementSelector || oChangeDefinition.content.sUnhideId, oAppComponent, oView);
|
|
115
|
-
|
|
116
|
-
|
|
127
|
+
return Promise.resolve()
|
|
128
|
+
.then(function() {
|
|
129
|
+
return oModifier.getAggregation(oControl, "content");
|
|
130
|
+
})
|
|
131
|
+
.then(function(aContent) {
|
|
132
|
+
var iStart = -1;
|
|
117
133
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
134
|
+
if (oChangeDefinition.changeType === "unhideSimpleFormField") {
|
|
135
|
+
aContent.some(function (oField, index) {
|
|
136
|
+
if (oField === oControlToRevertUnhide) {
|
|
137
|
+
iStart = index;
|
|
138
|
+
oModifier.setVisible(oField, false);
|
|
139
|
+
}
|
|
140
|
+
if (iStart >= 0 && index > iStart) {
|
|
141
|
+
if ((oModifier.getControlType(oField) === "sap.m.Label")
|
|
142
|
+
|| (oModifier.getControlType(oField) === "sap.ui.comp.smartfield.SmartLabel")
|
|
143
|
+
|| (oModifier.getControlType(oField) === "sap.ui.core.Title")
|
|
144
|
+
|| (oModifier.getControlType(oField) === "sap.m.Title")
|
|
145
|
+
|| (oModifier.getControlType(oField) === "sap.m.Toolbar")
|
|
146
|
+
|| (oModifier.getControlType(oField) === "sap.m.OverflowToolbar")) {
|
|
147
|
+
return undefined;
|
|
148
|
+
}
|
|
149
|
+
oModifier.setVisible(oField, false);
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
oChangeWrapper.resetRevertData();
|
|
135
153
|
}
|
|
154
|
+
return Promise.resolve();
|
|
136
155
|
});
|
|
137
|
-
oChangeWrapper.resetRevertData();
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
return true;
|
|
141
156
|
};
|
|
142
157
|
|
|
143
158
|
UnhideForm.getChangeVisualizationInfo = function(oChange) {
|
|
@@ -95,7 +95,7 @@ sap.ui.define([
|
|
|
95
95
|
* @see {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Grid_Layout MDN web docs: CSS Grid Layout}
|
|
96
96
|
*
|
|
97
97
|
* @author SAP SE
|
|
98
|
-
* @version 1.
|
|
98
|
+
* @version 1.93.2
|
|
99
99
|
*
|
|
100
100
|
* @extends sap.ui.core.Control
|
|
101
101
|
* @implements sap.ui.layout.cssgrid.IGridConfigurable
|
|
@@ -21,7 +21,7 @@ sap.ui.define([
|
|
|
21
21
|
* Have to possibility to hold multiple sap.ui.layout.cssgrid.GridSettings and apply the currently active GridSettings.
|
|
22
22
|
*
|
|
23
23
|
* @author SAP SE
|
|
24
|
-
* @version 1.
|
|
24
|
+
* @version 1.93.2
|
|
25
25
|
*
|
|
26
26
|
* @extends sap.ui.layout.cssgrid.GridLayoutBase
|
|
27
27
|
*
|
|
@@ -195,6 +195,7 @@ sap.ui.define([
|
|
|
195
195
|
bContent = true;
|
|
196
196
|
} else if ((aToolbarContent.length === 1) &&
|
|
197
197
|
(!aToolbarContent[0].getMetadata().isInstanceOf("sap.ui.core.Label") &&
|
|
198
|
+
// eslint-disable-next-line no-unsafe-negation
|
|
198
199
|
!aToolbarContent[0] instanceof sap.ui.core.Title && !aToolbarContent[0] instanceof sap.m.Title)) {
|
|
199
200
|
bContent = true;
|
|
200
201
|
}
|
|
@@ -225,11 +226,15 @@ sap.ui.define([
|
|
|
225
226
|
},
|
|
226
227
|
remove: {
|
|
227
228
|
changeType: "hideSimpleFormField",
|
|
228
|
-
changeOnRelevantContainer: true
|
|
229
|
+
changeOnRelevantContainer: true,
|
|
230
|
+
// SimpleForm field visibility changes could be invalidated by custom field visibility settings
|
|
231
|
+
jsOnly: true
|
|
229
232
|
},
|
|
230
233
|
reveal: {
|
|
231
234
|
changeType: "unhideSimpleFormField",
|
|
232
|
-
changeOnRelevantContainer: true
|
|
235
|
+
changeOnRelevantContainer: true,
|
|
236
|
+
// SimpleForm field visibility changes could be invalidated by custom field visibility settings
|
|
237
|
+
jsOnly: true
|
|
233
238
|
}
|
|
234
239
|
},
|
|
235
240
|
getStableElements: getStableElements
|
|
@@ -11,10 +11,9 @@ sap.ui.define([
|
|
|
11
11
|
'sap/ui/layout/library',
|
|
12
12
|
'./FormLayout',
|
|
13
13
|
'./ColumnLayoutRenderer',
|
|
14
|
-
"sap/ui/thirdparty/jquery"
|
|
15
|
-
'sap/base/Log'
|
|
14
|
+
"sap/ui/thirdparty/jquery"
|
|
16
15
|
],
|
|
17
|
-
function(Device, ResizeHandler, library, FormLayout, ColumnLayoutRenderer, jQuery
|
|
16
|
+
function(Device, ResizeHandler, library, FormLayout, ColumnLayoutRenderer, jQuery) {
|
|
18
17
|
"use strict";
|
|
19
18
|
|
|
20
19
|
/* global ResizeObserver */
|
|
@@ -61,7 +60,7 @@ sap.ui.define([
|
|
|
61
60
|
* This control cannot be used stand-alone, it just renders a <code>Form</code> control,
|
|
62
61
|
* so it must be assigned to a <code>Form</code> control using the <code>layout</code> aggregation.
|
|
63
62
|
* @extends sap.ui.layout.form.FormLayout
|
|
64
|
-
* @version 1.
|
|
63
|
+
* @version 1.93.2
|
|
65
64
|
*
|
|
66
65
|
* @constructor
|
|
67
66
|
* @public
|
|
@@ -110,6 +109,8 @@ sap.ui.define([
|
|
|
110
109
|
|
|
111
110
|
ColumnLayout.prototype.init = function(){
|
|
112
111
|
|
|
112
|
+
FormLayout.prototype.init.apply(this, arguments);
|
|
113
|
+
|
|
113
114
|
this._iBreakPointTablet = Device.media._predefinedRangeSets[Device.media.RANGESETS.SAP_STANDARD_EXTENDED].points[0];
|
|
114
115
|
this._iBreakPointDesktop = Device.media._predefinedRangeSets[Device.media.RANGESETS.SAP_STANDARD_EXTENDED].points[1];
|
|
115
116
|
this._iBreakPointLargeDesktop = Device.media._predefinedRangeSets[Device.media.RANGESETS.SAP_STANDARD_EXTENDED].points[2];
|
|
@@ -131,6 +132,8 @@ sap.ui.define([
|
|
|
131
132
|
|
|
132
133
|
ColumnLayout.prototype.onBeforeRendering = function( oEvent ){
|
|
133
134
|
|
|
135
|
+
FormLayout.prototype.onBeforeRendering.apply(this, arguments);
|
|
136
|
+
|
|
134
137
|
if (this.getColumnsM() > this.getColumnsL() || this.getColumnsL() > this.getColumnsXL() ) {
|
|
135
138
|
throw new Error("Column size not correct defined for " + this);
|
|
136
139
|
}
|
|
@@ -249,7 +252,7 @@ sap.ui.define([
|
|
|
249
252
|
oOptions.XL.Size = oLD.getColumnsXL();
|
|
250
253
|
|
|
251
254
|
if (oOptions.M.Size > iColumnsM || oOptions.L.Size > iColumnsL || oOptions.XL.Size > iColumnsXL) {
|
|
252
|
-
|
|
255
|
+
throw new Error("More cells defined for FormContainer " + oContainer.getId() + " than columns on " + this);
|
|
253
256
|
}
|
|
254
257
|
}
|
|
255
258
|
|
|
@@ -7,9 +7,8 @@
|
|
|
7
7
|
sap.ui.define([
|
|
8
8
|
'sap/ui/core/Renderer',
|
|
9
9
|
'sap/ui/Device',
|
|
10
|
-
'./FormLayoutRenderer'
|
|
11
|
-
|
|
12
|
-
], function(Renderer, Device, FormLayoutRenderer, Log) {
|
|
10
|
+
'./FormLayoutRenderer'
|
|
11
|
+
], function(Renderer, Device, FormLayoutRenderer) {
|
|
13
12
|
"use strict";
|
|
14
13
|
|
|
15
14
|
/**
|
|
@@ -113,7 +112,7 @@ sap.ui.define([
|
|
|
113
112
|
|
|
114
113
|
oRm.openEnd();
|
|
115
114
|
|
|
116
|
-
this.renderHeader(oRm, oToolbar, oTitle, oContainer._oExpandButton, bExpandable,
|
|
115
|
+
this.renderHeader(oRm, oToolbar, oTitle, oContainer._oExpandButton, bExpandable, oLayout._sFormSubTitleSize, oContainer.getId());
|
|
117
116
|
|
|
118
117
|
oRm.openStart("div", oContainer.getId() + "-content")
|
|
119
118
|
.class("sapUiFormCLContainerCont")
|
|
@@ -167,7 +166,7 @@ sap.ui.define([
|
|
|
167
166
|
for (var k = 0, kl = aFields.length; k < kl; k++) {
|
|
168
167
|
var oField = aFields[k];
|
|
169
168
|
if (!oField.isA("sap.ui.core.IFormContent")) {
|
|
170
|
-
|
|
169
|
+
throw new Error(oField + " is not a valid Form content! Only use valid content in " + oLayout);
|
|
171
170
|
}
|
|
172
171
|
oOptions = oLayout._getFieldSize(oField);
|
|
173
172
|
oRm.openStart("div");
|
|
@@ -44,7 +44,7 @@ sap.ui.define([
|
|
|
44
44
|
* @extends sap.ui.core.Control
|
|
45
45
|
*
|
|
46
46
|
* @author SAP SE
|
|
47
|
-
* @version 1.
|
|
47
|
+
* @version 1.93.2
|
|
48
48
|
*
|
|
49
49
|
* @constructor
|
|
50
50
|
* @public
|
|
@@ -254,7 +254,7 @@ sap.ui.define([
|
|
|
254
254
|
var oLayout = this.getLayout();
|
|
255
255
|
if (oLayout && oLayout.getContainerRenderedDomRef) {
|
|
256
256
|
return oLayout.getContainerRenderedDomRef(oContainer);
|
|
257
|
-
}else
|
|
257
|
+
} else {
|
|
258
258
|
return null;
|
|
259
259
|
}
|
|
260
260
|
|
|
@@ -273,7 +273,7 @@ sap.ui.define([
|
|
|
273
273
|
var oLayout = this.getLayout();
|
|
274
274
|
if (oLayout && oLayout.getElementRenderedDomRef) {
|
|
275
275
|
return oLayout.getElementRenderedDomRef(oElement);
|
|
276
|
-
}else
|
|
276
|
+
} else {
|
|
277
277
|
return null;
|
|
278
278
|
}
|
|
279
279
|
|
|
@@ -28,7 +28,7 @@ sap.ui.define([
|
|
|
28
28
|
* @extends sap.ui.core.Element
|
|
29
29
|
*
|
|
30
30
|
* @author SAP SE
|
|
31
|
-
* @version 1.
|
|
31
|
+
* @version 1.93.2
|
|
32
32
|
*
|
|
33
33
|
* @constructor
|
|
34
34
|
* @public
|
|
@@ -251,7 +251,7 @@ sap.ui.define([
|
|
|
251
251
|
|
|
252
252
|
if (oForm && oForm.getContainerRenderedDomRef) {
|
|
253
253
|
return oForm.getContainerRenderedDomRef(that);
|
|
254
|
-
}else
|
|
254
|
+
} else {
|
|
255
255
|
return null;
|
|
256
256
|
}
|
|
257
257
|
|
|
@@ -271,7 +271,7 @@ sap.ui.define([
|
|
|
271
271
|
|
|
272
272
|
if (oForm && oForm.getElementRenderedDomRef) {
|
|
273
273
|
return oForm.getElementRenderedDomRef(oElement);
|
|
274
|
-
}else
|
|
274
|
+
} else {
|
|
275
275
|
return null;
|
|
276
276
|
}
|
|
277
277
|
|
|
@@ -26,7 +26,7 @@ sap.ui.define([
|
|
|
26
26
|
* @extends sap.ui.core.Element
|
|
27
27
|
*
|
|
28
28
|
* @author SAP SE
|
|
29
|
-
* @version 1.
|
|
29
|
+
* @version 1.93.2
|
|
30
30
|
*
|
|
31
31
|
* @constructor
|
|
32
32
|
* @public
|
|
@@ -271,8 +271,6 @@ sap.ui.define([
|
|
|
271
271
|
|
|
272
272
|
}
|
|
273
273
|
|
|
274
|
-
return mAriaProps;
|
|
275
|
-
|
|
276
274
|
};
|
|
277
275
|
|
|
278
276
|
/*
|
|
@@ -302,7 +300,7 @@ sap.ui.define([
|
|
|
302
300
|
|
|
303
301
|
if (oContainer && oContainer.getElementRenderedDomRef) {
|
|
304
302
|
return oContainer.getElementRenderedDomRef(that);
|
|
305
|
-
}else
|
|
303
|
+
} else {
|
|
306
304
|
return null;
|
|
307
305
|
}
|
|
308
306
|
|
|
@@ -9,12 +9,13 @@ sap.ui.define([
|
|
|
9
9
|
'sap/ui/core/Control',
|
|
10
10
|
'sap/ui/layout/library',
|
|
11
11
|
'./FormLayoutRenderer',
|
|
12
|
-
|
|
12
|
+
'sap/ui/core/theming/Parameters',
|
|
13
|
+
'sap/ui/thirdparty/jquery',
|
|
13
14
|
// jQuery custom selectors ":sapFocusable"
|
|
14
15
|
'sap/ui/dom/jquery/Selectors',
|
|
15
16
|
// jQuery Plugin "control"
|
|
16
17
|
'sap/ui/dom/jquery/control'
|
|
17
|
-
], function(Control, library, FormLayoutRenderer, jQuery) {
|
|
18
|
+
], function(Control, library, FormLayoutRenderer, Parameters, jQuery) {
|
|
18
19
|
"use strict";
|
|
19
20
|
|
|
20
21
|
// shortcut for sap.ui.layout.BackgroundDesign
|
|
@@ -35,7 +36,7 @@ sap.ui.define([
|
|
|
35
36
|
* @extends sap.ui.core.Control
|
|
36
37
|
*
|
|
37
38
|
* @author SAP SE
|
|
38
|
-
* @version 1.
|
|
39
|
+
* @version 1.93.2
|
|
39
40
|
*
|
|
40
41
|
* @constructor
|
|
41
42
|
* @public
|
|
@@ -60,6 +61,20 @@ sap.ui.define([
|
|
|
60
61
|
|
|
61
62
|
/* eslint-disable no-lonely-if */
|
|
62
63
|
|
|
64
|
+
FormLayout.prototype.init = function(){
|
|
65
|
+
|
|
66
|
+
this._sFormTitleSize = "H4"; // to have default as Theme parameter could be loaded async.
|
|
67
|
+
this._sFormSubTitleSize = "H5";
|
|
68
|
+
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
FormLayout.prototype.onBeforeRendering = function( oEvent ){
|
|
72
|
+
|
|
73
|
+
// get title sizes from theme
|
|
74
|
+
this.loadTitleSizes();
|
|
75
|
+
|
|
76
|
+
};
|
|
77
|
+
|
|
63
78
|
FormLayout.prototype.contentOnAfterRendering = function(oFormElement, oControl){
|
|
64
79
|
|
|
65
80
|
if (library.form.FormHelper.bArrowKeySupport) {
|
|
@@ -887,7 +902,7 @@ sap.ui.define([
|
|
|
887
902
|
|
|
888
903
|
if (this.getDomRef()) {
|
|
889
904
|
return (oContainer.getId() ? window.document.getElementById(oContainer.getId()) : null);
|
|
890
|
-
}else
|
|
905
|
+
} else {
|
|
891
906
|
return null;
|
|
892
907
|
}
|
|
893
908
|
|
|
@@ -904,7 +919,7 @@ sap.ui.define([
|
|
|
904
919
|
|
|
905
920
|
if (this.getDomRef()) {
|
|
906
921
|
return (oElement.getId() ? window.document.getElementById(oElement.getId()) : null);
|
|
907
|
-
}else
|
|
922
|
+
} else {
|
|
908
923
|
return null;
|
|
909
924
|
}
|
|
910
925
|
|
|
@@ -941,6 +956,47 @@ sap.ui.define([
|
|
|
941
956
|
FormLayout.prototype.getLayoutDataForSemanticField = function(iFields, iIndex, oLayoutData) {
|
|
942
957
|
};
|
|
943
958
|
|
|
959
|
+
/**
|
|
960
|
+
* Determines the sizes for <code>Form</code> and <code>FormContainer</code> from the theme
|
|
961
|
+
*
|
|
962
|
+
* @private
|
|
963
|
+
* @since: 1.92.0
|
|
964
|
+
*/
|
|
965
|
+
FormLayout.prototype.loadTitleSizes = function() {
|
|
966
|
+
|
|
967
|
+
// read theme parameters to get current header sizes
|
|
968
|
+
var oSizes = Parameters.get({
|
|
969
|
+
name: ['sap.ui.layout.FormLayout:_sap_ui_layout_FormLayout_FormTitleSize', 'sap.ui.layout.FormLayout:_sap_ui_layout_FormLayout_FormSubTitleSize'],
|
|
970
|
+
callback: this.applyTitleSizes.bind(this)
|
|
971
|
+
});
|
|
972
|
+
if (oSizes && oSizes.hasOwnProperty('sap.ui.layout.FormLayout:_sap_ui_layout_FormLayout_FormTitleSize')) { // sync case
|
|
973
|
+
this.applyTitleSizes(oSizes, true);
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
};
|
|
977
|
+
|
|
978
|
+
/**
|
|
979
|
+
* Applies the sizes for <code>Form</code> and <code>FormContainer</code> from the theme
|
|
980
|
+
*
|
|
981
|
+
* @param {object} oSizes Sizes from theme parameters
|
|
982
|
+
* @param {boolean} bSync If set, the paramters are determines synchronously. (No re-rendering needed.)
|
|
983
|
+
* @private
|
|
984
|
+
* @since: 1.92.0
|
|
985
|
+
*/
|
|
986
|
+
FormLayout.prototype.applyTitleSizes = function(oSizes, bSync) {
|
|
987
|
+
|
|
988
|
+
if (oSizes && (this._sFormTitleSize !== oSizes["sap.ui.layout.FormLayout:_sap_ui_layout_FormLayout_FormTitleSize"] ||
|
|
989
|
+
this._sFormSubTitleSize !== oSizes["sap.ui.layout.FormLayout:_sap_ui_layout_FormLayout_FormSubTitleSize"])) {
|
|
990
|
+
this._sFormTitleSize = oSizes["sap.ui.layout.FormLayout:_sap_ui_layout_FormLayout_FormTitleSize"];
|
|
991
|
+
this._sFormSubTitleSize = oSizes["sap.ui.layout.FormLayout:_sap_ui_layout_FormLayout_FormSubTitleSize"];
|
|
992
|
+
|
|
993
|
+
if (!bSync) {
|
|
994
|
+
this.invalidate(); // re-render
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
};
|
|
999
|
+
|
|
944
1000
|
return FormLayout;
|
|
945
1001
|
|
|
946
1002
|
});
|