@openui5/sap.ui.layout 1.116.0 → 1.117.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.
- 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/BlockLayoutCellRenderer.js +0 -4
- package/src/sap/ui/layout/BlockLayoutRow.js +2 -1
- package/src/sap/ui/layout/BlockLayoutRowRenderer.js +3 -0
- package/src/sap/ui/layout/DynamicSideContent.js +9 -2
- package/src/sap/ui/layout/FixFlex.js +3 -3
- 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 +1 -1
- 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 +1 -1
- package/src/sap/ui/layout/Splitter.js +1 -1
- package/src/sap/ui/layout/SplitterLayoutData.js +1 -1
- package/src/sap/ui/layout/VerticalLayout.js +1 -1
- package/src/sap/ui/layout/changeHandler/AddFormContainer.js +1 -1
- package/src/sap/ui/layout/changeHandler/AddFormField.js +1 -1
- package/src/sap/ui/layout/changeHandler/AddSimpleFormField.js +1 -1
- package/src/sap/ui/layout/changeHandler/AddSimpleFormGroup.js +1 -1
- package/src/sap/ui/layout/changeHandler/HideSimpleForm.js +1 -1
- package/src/sap/ui/layout/changeHandler/MoveSimpleForm.js +1 -1
- package/src/sap/ui/layout/changeHandler/RenameFormContainer.js +1 -1
- package/src/sap/ui/layout/changeHandler/RenameSimpleForm.js +1 -1
- package/src/sap/ui/layout/changeHandler/UnhideSimpleForm.js +1 -1
- 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/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/form/ColumnContainerData.js +1 -1
- package/src/sap/ui/layout/form/ColumnElementData.js +1 -1
- package/src/sap/ui/layout/form/ColumnLayout.js +7 -1
- package/src/sap/ui/layout/form/ColumnLayoutRenderer.js +67 -10
- package/src/sap/ui/layout/form/Form.js +1 -1
- package/src/sap/ui/layout/form/FormContainer.js +1 -1
- package/src/sap/ui/layout/form/FormElement.js +20 -4
- package/src/sap/ui/layout/form/FormLayout.js +32 -11
- package/src/sap/ui/layout/form/FormLayoutRenderer.js +12 -1
- 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/ResponsiveGridLayout.js +1 -1
- package/src/sap/ui/layout/form/ResponsiveLayout.js +1 -1
- package/src/sap/ui/layout/form/SemanticFormElement.js +117 -20
- package/src/sap/ui/layout/form/SimpleForm.js +28 -15
- package/src/sap/ui/layout/library.js +2 -2
- package/src/sap/ui/layout/themes/base/FormLayout.less +5 -0
- package/ui5.yaml +1 -1
|
@@ -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.117.0
|
|
30
30
|
*
|
|
31
31
|
* @constructor
|
|
32
32
|
* @public
|
|
@@ -312,12 +312,12 @@ sap.ui.define([
|
|
|
312
312
|
*
|
|
313
313
|
* @param {boolean} bEditable Editable state of the <code>Form</code>
|
|
314
314
|
* @protected
|
|
315
|
-
* @restricted sap.ui.layout.form.FormContainer
|
|
315
|
+
* @ui5-restricted sap.ui.layout.form.FormContainer
|
|
316
316
|
* @since 1.74.0
|
|
317
317
|
*/
|
|
318
318
|
FormElement.prototype._setEditable = function(bEditable) {
|
|
319
319
|
|
|
320
|
-
var bOldEditable = this.
|
|
320
|
+
var bOldEditable = this._getEditable();
|
|
321
321
|
this.setProperty("_editable", bEditable, true); // do not invalidate whole FormElement
|
|
322
322
|
|
|
323
323
|
if (bEditable !== bOldEditable) {
|
|
@@ -326,6 +326,22 @@ sap.ui.define([
|
|
|
326
326
|
|
|
327
327
|
};
|
|
328
328
|
|
|
329
|
+
/**
|
|
330
|
+
* Gets the editable state of the <code>FormElement</code>.
|
|
331
|
+
*
|
|
332
|
+
* This must only be called from the <code>Form</code> and its <code>FormLayout</code>.
|
|
333
|
+
*
|
|
334
|
+
* @returns {boolean} Editable state of the <code>Form</code>
|
|
335
|
+
* @protected
|
|
336
|
+
* @ui5-restricted sap.ui.layout.form.FormLayout
|
|
337
|
+
* @since 1.117.0
|
|
338
|
+
*/
|
|
339
|
+
FormElement.prototype._getEditable = function() {
|
|
340
|
+
|
|
341
|
+
return this.getProperty("_editable");
|
|
342
|
+
|
|
343
|
+
};
|
|
344
|
+
|
|
329
345
|
/**
|
|
330
346
|
* Labels inside of a Form must be invalidated if "editable" changed on Form
|
|
331
347
|
* @protected
|
|
@@ -453,7 +469,7 @@ sap.ui.define([
|
|
|
453
469
|
}
|
|
454
470
|
|
|
455
471
|
var oFormElement = this.getParent();
|
|
456
|
-
return !oFormElement.
|
|
472
|
+
return !oFormElement._getEditable();
|
|
457
473
|
}
|
|
458
474
|
|
|
459
475
|
return false;
|
|
@@ -36,7 +36,7 @@ sap.ui.define([
|
|
|
36
36
|
* @extends sap.ui.core.Control
|
|
37
37
|
*
|
|
38
38
|
* @author SAP SE
|
|
39
|
-
* @version 1.
|
|
39
|
+
* @version 1.117.0
|
|
40
40
|
*
|
|
41
41
|
* @constructor
|
|
42
42
|
* @public
|
|
@@ -84,10 +84,14 @@ sap.ui.define([
|
|
|
84
84
|
jQuery(oControl.getFocusDomRef()).data("sap.InNavArea", true);
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
if (this.renderControlsForSemanticElement() && oFormElement.isA("sap.ui.layout.form.SemanticFormElement") && !oFormElement._getEditable()) {
|
|
88
|
+
// If in SemanticFormElement in display mode controls are not concatenated but rendered as they are devided by delemitters they need to keep their own size,
|
|
89
|
+
// but must not be larger than the available space.
|
|
90
|
+
oControl.$().css("max-width", "100%");
|
|
91
|
+
} else if (oControl.getWidth && ( !oControl.getWidth() || oControl.getWidth() == "auto" ) &&
|
|
90
92
|
(!oControl.getFormDoNotAdjustWidth || !oControl.getFormDoNotAdjustWidth())) {
|
|
93
|
+
// In the visual designed layouts, the controls should have the size of the Form cells to align
|
|
94
|
+
// -> The width must be set to 100% (if no other width set)
|
|
91
95
|
oControl.$().css("width", "100%");
|
|
92
96
|
}
|
|
93
97
|
|
|
@@ -929,36 +933,53 @@ sap.ui.define([
|
|
|
929
933
|
};
|
|
930
934
|
|
|
931
935
|
/**
|
|
932
|
-
* In
|
|
933
|
-
* They should use only a small space. So <code>Layout</code
|
|
936
|
+
* In {@link sap.ui.layout.SemanticFormElement SemanticFormElement}, delimiters are rendered.
|
|
937
|
+
* They should use only a small space. So <code>Layout</code>-dependent <code>LayoutData</code>
|
|
934
938
|
* are needed.
|
|
935
939
|
*
|
|
936
|
-
* This function
|
|
940
|
+
* This function needs to be implemented by the specific <code>Layout</code>.
|
|
937
941
|
*
|
|
938
942
|
* @return {sap.ui.core.LayoutData | Promise} LayoutData or promise retuning LayoutData
|
|
939
|
-
* @
|
|
943
|
+
* @protected
|
|
940
944
|
* @since: 1.86.0
|
|
941
945
|
*/
|
|
942
946
|
FormLayout.prototype.getLayoutDataForDelimiter = function() {
|
|
943
947
|
};
|
|
944
948
|
|
|
945
949
|
/**
|
|
946
|
-
* In
|
|
950
|
+
* In {@link sap.ui.layout.SemanticFormElement SemanticFormElement}, delimiters are rendered.
|
|
947
951
|
* The fields should be rendered per default in a way, the field and the corresponding delimiter filling one row in
|
|
948
952
|
* phone mode. In desktop mode they should all be in one row.
|
|
949
953
|
*
|
|
950
|
-
* This function
|
|
954
|
+
* This function needs to be implemented by the specific <code>Layout</code>.
|
|
951
955
|
*
|
|
952
956
|
* @param {int} iFields Number of field in the <code>SemanticFormElement</code>
|
|
953
957
|
* @param {int} iIndex Index of field in the <code>SemanticFormElement</code>
|
|
954
958
|
* @param {sap.ui.core.LayoutData} [oLayoutData] existing <code>LayoutData</code> that might be just changed
|
|
955
959
|
* @return {sap.ui.core.LayoutData | Promise} LayoutData or promise retuning LayoutData
|
|
956
|
-
* @
|
|
960
|
+
* @protected
|
|
957
961
|
* @since: 1.86.0
|
|
958
962
|
*/
|
|
959
963
|
FormLayout.prototype.getLayoutDataForSemanticField = function(iFields, iIndex, oLayoutData) {
|
|
960
964
|
};
|
|
961
965
|
|
|
966
|
+
/**
|
|
967
|
+
* For {@link sap.ui.layout.SemanticFormElement SemanticFormElement}, all text-based controls should be concatenated in display mode.
|
|
968
|
+
* If the <code>Layout</code> supports rendering of single controls, they are rendered divided by delimiters.
|
|
969
|
+
* If the <code>Layout</code> doesn't support this, one concatenated text is rendered. Here only text is supported, no links or other special rendering.
|
|
970
|
+
*
|
|
971
|
+
* This function needs to be implemented by the specific <code>Layout</code>.
|
|
972
|
+
*
|
|
973
|
+
* @return {boolean} <code>true</code> if layout allows to render single controls for {@link sap.ui.layout.SemanticFormElement SemanticFormElement}
|
|
974
|
+
* @protected
|
|
975
|
+
* @since: 1.117.0
|
|
976
|
+
*/
|
|
977
|
+
FormLayout.prototype.renderControlsForSemanticElement = function() {
|
|
978
|
+
|
|
979
|
+
return false;
|
|
980
|
+
|
|
981
|
+
};
|
|
982
|
+
|
|
962
983
|
/**
|
|
963
984
|
* Determines the sizes for <code>Form</code> and <code>FormContainer</code> from the theme
|
|
964
985
|
*
|
|
@@ -126,7 +126,11 @@ sap.ui.define([
|
|
|
126
126
|
var aElements = oContainer.getVisibleFormElements();
|
|
127
127
|
for (var j = 0, jl = aElements.length; j < jl; j++) {
|
|
128
128
|
var oElement = aElements[j];
|
|
129
|
-
|
|
129
|
+
if (oElement.isA("sap.ui.layout.form.SemanticFormElement") && !oElement._getEditable()) {
|
|
130
|
+
this.renderSemanticElement(rm, oLayout, oElement);
|
|
131
|
+
} else {
|
|
132
|
+
this.renderElement(rm, oLayout, oElement);
|
|
133
|
+
}
|
|
130
134
|
}
|
|
131
135
|
|
|
132
136
|
if (bExpandable) {
|
|
@@ -162,6 +166,13 @@ sap.ui.define([
|
|
|
162
166
|
|
|
163
167
|
};
|
|
164
168
|
|
|
169
|
+
FormLayoutRenderer.renderSemanticElement = function(rm, oLayout, oElement){
|
|
170
|
+
|
|
171
|
+
// just render like standard Element as default
|
|
172
|
+
this.renderElement(rm, oLayout, oElement);
|
|
173
|
+
|
|
174
|
+
};
|
|
175
|
+
|
|
165
176
|
/**
|
|
166
177
|
* Renders the title for a <code>Form</code> or a <code>FormContainer</code>
|
|
167
178
|
*
|
|
@@ -53,7 +53,7 @@ sap.ui.define([
|
|
|
53
53
|
*
|
|
54
54
|
* This control cannot be used stand-alone, it just renders a <code>Form</code>, so it must be assigned to a <code>Form</code> using the <code>layout</code> aggregation.
|
|
55
55
|
* @extends sap.ui.layout.form.FormLayout
|
|
56
|
-
* @version 1.
|
|
56
|
+
* @version 1.117.0
|
|
57
57
|
*
|
|
58
58
|
* @constructor
|
|
59
59
|
* @public
|
|
@@ -30,7 +30,7 @@ sap.ui.define([
|
|
|
30
30
|
* @extends sap.ui.layout.form.FormElement
|
|
31
31
|
*
|
|
32
32
|
* @author SAP SE
|
|
33
|
-
* @version 1.
|
|
33
|
+
* @version 1.117.0
|
|
34
34
|
*
|
|
35
35
|
* @constructor
|
|
36
36
|
* @public
|
|
@@ -83,7 +83,8 @@ sap.ui.define([
|
|
|
83
83
|
|
|
84
84
|
this._oObserver.observe(this, {
|
|
85
85
|
properties: ["_editable", "delimiter"],
|
|
86
|
-
aggregations: ["fieldLabels"]
|
|
86
|
+
aggregations: ["fieldLabels"],
|
|
87
|
+
parent: true
|
|
87
88
|
});
|
|
88
89
|
|
|
89
90
|
};
|
|
@@ -101,7 +102,7 @@ sap.ui.define([
|
|
|
101
102
|
|
|
102
103
|
var aDelimiters = this.getAggregation("delimiters", []);
|
|
103
104
|
if (aDelimiters.indexOf(oElement) < 0) {
|
|
104
|
-
if (
|
|
105
|
+
if (!_renderAsText.call(this)) {
|
|
105
106
|
// assign label texts in in edit mode
|
|
106
107
|
var iIndex = this.indexOfField(oElement);
|
|
107
108
|
if (iIndex >= 0) {
|
|
@@ -180,7 +181,15 @@ sap.ui.define([
|
|
|
180
181
|
_updateLayoutData.call(this); // as Layout might be set after Fields, so LayoutData can only be determined now
|
|
181
182
|
}
|
|
182
183
|
|
|
183
|
-
if (
|
|
184
|
+
if (!_renderAsText.call(this)) {
|
|
185
|
+
if (this.getAggregation("_displayField")) {
|
|
186
|
+
// switch to control mode missing, this could happen if something unexpected chaged on field what leads to update of getFormRenderAsControl
|
|
187
|
+
// (happens if the change is not observed because of missing property in getFormObservingProperties or some internal change)
|
|
188
|
+
// -> update now, even if it is somehow late and could lead to re-rendering
|
|
189
|
+
this.destroyAggregation("_displayField");
|
|
190
|
+
_updateControlsForEdit.call(this);
|
|
191
|
+
}
|
|
192
|
+
|
|
184
193
|
var aFields = this.getFields();
|
|
185
194
|
var aDelemiters = this.getAggregation("_delimiters", []);
|
|
186
195
|
for (var i = 0; i < aFields.length; i++) {
|
|
@@ -193,6 +202,15 @@ sap.ui.define([
|
|
|
193
202
|
}
|
|
194
203
|
}
|
|
195
204
|
} else {
|
|
205
|
+
if (!this.getAggregation("_displayField")) {
|
|
206
|
+
// switch to display mode missing, this could happen if something unexpected chaged on field what leads to update of getFormRenderAsControl
|
|
207
|
+
// (happens if the change is not observed because of missing property in getFormObservingProperties or some internal change)
|
|
208
|
+
// -> update now, even if it is somehow late and could lead to re-rendering
|
|
209
|
+
this.destroyAggregation("_delimiters");
|
|
210
|
+
this._bLayoutDataCreated = false;
|
|
211
|
+
_updateControlsForDisplay.call(this);
|
|
212
|
+
}
|
|
213
|
+
|
|
196
214
|
var oDisplay = this.getAggregation("_displayField");
|
|
197
215
|
if (oDisplay) {
|
|
198
216
|
aFieldsForRendering.push(oDisplay);
|
|
@@ -213,7 +231,9 @@ sap.ui.define([
|
|
|
213
231
|
|
|
214
232
|
if (oChanges.object === this) {
|
|
215
233
|
// it's the FormElement
|
|
216
|
-
if (oChanges.
|
|
234
|
+
if (oChanges.type === "parent") {
|
|
235
|
+
_parentChanged.call(this, oChanges.mutation, oChanges.parent);
|
|
236
|
+
} else if (oChanges.name === "fields") {
|
|
217
237
|
_fieldChanged.call(this, oChanges.child, oChanges.mutation);
|
|
218
238
|
} else if (oChanges.name === "_editable") {
|
|
219
239
|
_editableChanged.call(this, oChanges.current);
|
|
@@ -223,8 +243,12 @@ sap.ui.define([
|
|
|
223
243
|
_fieldLabelsChanged.call(this, oChanges.mutation, oChanges.child);
|
|
224
244
|
}
|
|
225
245
|
} else {
|
|
226
|
-
// it's some content control
|
|
227
|
-
if (oChanges.
|
|
246
|
+
// it's some content control or parent
|
|
247
|
+
if (oChanges.type === "parent") {
|
|
248
|
+
_parentChanged.call(this, oChanges.mutation, oChanges.parent);
|
|
249
|
+
} else if (oChanges.name === "layout") {
|
|
250
|
+
_layoutChanged.call(this, oChanges.child, oChanges.mutation);
|
|
251
|
+
} else if (oChanges.object.isA("sap.ui.core.Label")) {
|
|
228
252
|
_fieldLabelChanged.call(this, oChanges);
|
|
229
253
|
} else {
|
|
230
254
|
_controlChanged.call(this, oChanges);
|
|
@@ -240,9 +264,12 @@ sap.ui.define([
|
|
|
240
264
|
if (bEditable) {
|
|
241
265
|
this.destroyAggregation("_displayField");
|
|
242
266
|
_updateControlsForEdit.call(this);
|
|
243
|
-
} else {
|
|
267
|
+
} else if (_renderAsText.call(this)) {
|
|
244
268
|
this.destroyAggregation("_delimiters");
|
|
269
|
+
this._bLayoutDataCreated = false;
|
|
245
270
|
_updateControlsForDisplay.call(this);
|
|
271
|
+
} else { // switched to display mode but render controls -> update delemitters with spacing
|
|
272
|
+
_updateControlsForEdit.call(this);
|
|
246
273
|
}
|
|
247
274
|
|
|
248
275
|
}
|
|
@@ -254,8 +281,13 @@ sap.ui.define([
|
|
|
254
281
|
throw new Error(oField + " is not valid Form content. " + this); // only support allowed Fields
|
|
255
282
|
}
|
|
256
283
|
var aProperties = ["visible"];
|
|
284
|
+
if (oField.getFormObservingProperties) {
|
|
285
|
+
aProperties = aProperties.concat(oField.getFormObservingProperties());
|
|
286
|
+
}
|
|
257
287
|
if (oField.getFormValueProperty) {
|
|
288
|
+
if (aProperties.indexOf(oField.getFormValueProperty()) === -1) {
|
|
258
289
|
aProperties.push(oField.getFormValueProperty());
|
|
290
|
+
}
|
|
259
291
|
} else if (oField.getMetadata().getProperty("value")) {
|
|
260
292
|
aProperties.push("value");
|
|
261
293
|
} else if (oField.getMetadata().getProperty("text")) {
|
|
@@ -273,7 +305,7 @@ sap.ui.define([
|
|
|
273
305
|
}
|
|
274
306
|
}
|
|
275
307
|
|
|
276
|
-
if (
|
|
308
|
+
if (!_renderAsText.call(this)) {
|
|
277
309
|
_updateControlsForEdit.call(this);
|
|
278
310
|
} else {
|
|
279
311
|
_updateControlsForDisplay.call(this, true);
|
|
@@ -285,7 +317,7 @@ sap.ui.define([
|
|
|
285
317
|
|
|
286
318
|
function _delimiterChanged(sDelimiter) {
|
|
287
319
|
|
|
288
|
-
if (
|
|
320
|
+
if (!_renderAsText.call(this)) {
|
|
289
321
|
_updateControlsForEdit.call(this);
|
|
290
322
|
} else {
|
|
291
323
|
_updateDisplayText.call(this, false);
|
|
@@ -315,13 +347,14 @@ sap.ui.define([
|
|
|
315
347
|
function _controlChanged(oChanges) {
|
|
316
348
|
|
|
317
349
|
var sProperyName = oChanges.object.getFormValueProperty ? oChanges.object.getFormValueProperty() : null;
|
|
350
|
+
var aObservingProperties = oChanges.object.getFormObservingProperties ? oChanges.object.getFormObservingProperties() : [];
|
|
318
351
|
if (oChanges.name === sProperyName || oChanges.name === "value" || oChanges.name === "text") {
|
|
319
352
|
// update display control
|
|
320
|
-
if (
|
|
353
|
+
if (_renderAsText.call(this)) {
|
|
321
354
|
_updateDisplayText.call(this, false);
|
|
322
355
|
}
|
|
323
|
-
} else if (oChanges.name === "visible") {
|
|
324
|
-
if (
|
|
356
|
+
} else if (oChanges.name === "visible" || aObservingProperties.indexOf(oChanges.name) >= 0) {
|
|
357
|
+
if (!_renderAsText.call(this)) {
|
|
325
358
|
_updateControlsForEdit.call(this);
|
|
326
359
|
} else {
|
|
327
360
|
_updateControlsForDisplay.call(this, true);
|
|
@@ -342,26 +375,31 @@ sap.ui.define([
|
|
|
342
375
|
function _updateControlsForEdit() {
|
|
343
376
|
|
|
344
377
|
var aFields = this.getFields();
|
|
345
|
-
var
|
|
378
|
+
var aDelimiters = this.getAggregation("_delimiters", []);
|
|
346
379
|
var sDelimiter = this.getDelimiter();
|
|
347
380
|
var sId = this.getId() + "-delimiter-";
|
|
348
381
|
var i = 0;
|
|
349
382
|
|
|
383
|
+
if (!this._getEditable()) {
|
|
384
|
+
sDelimiter = " " + sDelimiter + " "; // use Space to align spacing with concatenated texts
|
|
385
|
+
}
|
|
386
|
+
|
|
350
387
|
for (i = 0; i < aFields.length; i++) {
|
|
351
388
|
if (i < aFields.length - 1) {
|
|
352
|
-
if (
|
|
353
|
-
library.form.FormHelper.updateDelimiter(
|
|
389
|
+
if (aDelimiters.length > i) {
|
|
390
|
+
library.form.FormHelper.updateDelimiter(aDelimiters[i], sDelimiter);
|
|
354
391
|
} else {
|
|
355
392
|
var oDelimiter = library.form.FormHelper.createDelimiter(sDelimiter, sId + i);
|
|
393
|
+
oDelimiter.addStyleClass("sapUiFormDelimiter");
|
|
356
394
|
this.addAggregation("_delimiters", oDelimiter);
|
|
357
395
|
}
|
|
358
396
|
}
|
|
359
397
|
}
|
|
360
398
|
|
|
361
399
|
// remove unused delimiters
|
|
362
|
-
if (
|
|
363
|
-
for (i = aFields.length - 1; i <
|
|
364
|
-
|
|
400
|
+
if (aDelimiters.length > 0 && aDelimiters.length > aFields.length - 1) {
|
|
401
|
+
for (i = aFields.length - 1; i < aDelimiters.length; i++) {
|
|
402
|
+
aDelimiters[i].destroy();
|
|
365
403
|
}
|
|
366
404
|
}
|
|
367
405
|
|
|
@@ -499,7 +537,7 @@ sap.ui.define([
|
|
|
499
537
|
return;
|
|
500
538
|
}
|
|
501
539
|
|
|
502
|
-
if (this.
|
|
540
|
+
if (this._getEditable()) {
|
|
503
541
|
// delimiters
|
|
504
542
|
for (i = 0; i < aDelemiters.length; i++) {
|
|
505
543
|
var oDelimiter = aDelemiters[i];
|
|
@@ -548,6 +586,65 @@ sap.ui.define([
|
|
|
548
586
|
|
|
549
587
|
}
|
|
550
588
|
|
|
589
|
+
function _renderAsText() {
|
|
590
|
+
|
|
591
|
+
if (this._getEditable()) {
|
|
592
|
+
return false;
|
|
593
|
+
} else {
|
|
594
|
+
var aFields = this.getFields();
|
|
595
|
+
var bRenderAsControl = true;
|
|
596
|
+
|
|
597
|
+
for (var i = 0; i < aFields.length; i++) {
|
|
598
|
+
if (!aFields[i].getFormRenderAsControl || !aFields[i].getFormRenderAsControl()) {
|
|
599
|
+
bRenderAsControl = false;
|
|
600
|
+
break;
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
var oFormContainer = this.getParent();
|
|
605
|
+
var oForm = oFormContainer && oFormContainer.getParent();
|
|
606
|
+
var oLayout = oForm && oForm.getLayout();
|
|
607
|
+
var bRenderControls = oLayout ? oLayout.renderControlsForSemanticElement() : true; // if no layout assigned right now render as controls per default
|
|
608
|
+
return !(bRenderAsControl && bRenderControls);
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
function _parentChanged(sMutation, oParent) {
|
|
614
|
+
|
|
615
|
+
var oLayout;
|
|
616
|
+
if (sMutation === "set") {
|
|
617
|
+
var oForm;
|
|
618
|
+
if (oParent.isA("sap.ui.layout.form.FormContainer")) {
|
|
619
|
+
this._oObserver.observe(oParent, {
|
|
620
|
+
parent: true
|
|
621
|
+
});
|
|
622
|
+
oForm = oParent.getParent();
|
|
623
|
+
} else if (oParent.isA("sap.ui.layout.form.Form")) {
|
|
624
|
+
this._oObserver.observe(oParent, {
|
|
625
|
+
aggregations: ["layout"]
|
|
626
|
+
});
|
|
627
|
+
oForm = oParent;
|
|
628
|
+
}
|
|
629
|
+
oLayout = oForm && oForm.getLayout();
|
|
630
|
+
} else if (oParent.isA("sap.ui.layout.form.FormContainer") || oParent.isA("sap.ui.layout.form.Form")) {
|
|
631
|
+
this._oObserver.unobserve(oParent);
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
if (oLayout) { // as long as we have no layout no update needed
|
|
635
|
+
_layoutChanged.call(this, oLayout);
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
function _layoutChanged(oLayout, sMutation) {
|
|
641
|
+
|
|
642
|
+
// as layout change could lead to change of rendering mode (layout might not support to render controls) mode needs to be checked
|
|
643
|
+
_editableChanged.call(this, this._getEditable());
|
|
644
|
+
_updateLayoutData.call(this);
|
|
645
|
+
|
|
646
|
+
}
|
|
647
|
+
|
|
551
648
|
return SemanticFormElement;
|
|
552
649
|
|
|
553
650
|
});
|
|
@@ -8,19 +8,17 @@
|
|
|
8
8
|
sap.ui.define([
|
|
9
9
|
'sap/ui/core/Control',
|
|
10
10
|
'sap/ui/base/ManagedObjectObserver',
|
|
11
|
-
'sap/ui/core/ResizeHandler',
|
|
12
11
|
'sap/ui/layout/library',
|
|
13
12
|
'./Form',
|
|
14
13
|
'./FormContainer',
|
|
15
14
|
'./FormElement',
|
|
16
15
|
'./FormLayout',
|
|
17
16
|
'./SimpleFormRenderer',
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
'sap/base/Log',
|
|
18
|
+
'sap/ui/thirdparty/jquery'
|
|
20
19
|
], function(
|
|
21
20
|
Control,
|
|
22
21
|
ManagedObjectObserver,
|
|
23
|
-
ResizeHandler,
|
|
24
22
|
library,
|
|
25
23
|
Form,
|
|
26
24
|
FormContainer,
|
|
@@ -45,6 +43,8 @@ sap.ui.define([
|
|
|
45
43
|
var GridContainerData;
|
|
46
44
|
var GridElementData;
|
|
47
45
|
var ColumnLayout;
|
|
46
|
+
var ResizeHandler;
|
|
47
|
+
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
50
|
* Constructor for a new sap.ui.layout.form.SimpleForm.
|
|
@@ -67,7 +67,7 @@ sap.ui.define([
|
|
|
67
67
|
* <b>Note:</b> If a more complex form is needed, use the <code>{@link sap.ui.layout.form.Form Form}</code> control instead.
|
|
68
68
|
*
|
|
69
69
|
* @extends sap.ui.core.Control
|
|
70
|
-
* @version 1.
|
|
70
|
+
* @version 1.117.0
|
|
71
71
|
*
|
|
72
72
|
* @constructor
|
|
73
73
|
* @public
|
|
@@ -96,6 +96,7 @@ sap.ui.define([
|
|
|
96
96
|
* irrespective of whether a <code>width</code> is reached or the available parents width is reached.
|
|
97
97
|
*
|
|
98
98
|
* <b>Note:</b> This property is only used if a <code>ResponsiveLayout</code> is used as a layout.
|
|
99
|
+
* @deprecated As of version 1.93, use another <code>Layout</code>
|
|
99
100
|
*/
|
|
100
101
|
minWidth : {type : "int", group : "Appearance", defaultValue : -1},
|
|
101
102
|
|
|
@@ -125,6 +126,7 @@ sap.ui.define([
|
|
|
125
126
|
* Specifies the min-width in pixels of the label in all form rows.
|
|
126
127
|
*
|
|
127
128
|
* <b>Note:</b> This property is only used if a <code>ResponsiveLayout</code> is used as a layout.
|
|
129
|
+
* @deprecated As of version 1.93, use another <code>Layout</code>
|
|
128
130
|
*/
|
|
129
131
|
labelMinWidth : {type : "int", group : "Misc", defaultValue : 192},
|
|
130
132
|
|
|
@@ -136,9 +138,11 @@ sap.ui.define([
|
|
|
136
138
|
*
|
|
137
139
|
* <b>Note</b> If possible, set the <code>layout</code> before adding content to prevent calculations for the default layout.
|
|
138
140
|
*
|
|
139
|
-
* <b>Note</b> The <code>ResponsiveLayout</code> has been deprecated and must no longer be used.
|
|
141
|
+
* <b>Note</b> The <code>ResponsiveLayout</code> has been deprecated and must no longer be used.
|
|
142
|
+
*
|
|
143
|
+
* <b>Note</b> As of version 1.117, the <code>ResponsiveGridLayout</code> is used as default.
|
|
140
144
|
*/
|
|
141
|
-
layout : {type : "sap.ui.layout.form.SimpleFormLayout", group : "Misc", defaultValue : SimpleFormLayout.
|
|
145
|
+
layout : {type : "sap.ui.layout.form.SimpleFormLayout", group : "Misc", defaultValue : SimpleFormLayout.ResponsiveGridLayout},
|
|
142
146
|
|
|
143
147
|
/**
|
|
144
148
|
* Default span for labels in extra large size.
|
|
@@ -478,7 +482,7 @@ sap.ui.define([
|
|
|
478
482
|
(!this._bColumnLayoutRequested && sLayout === SimpleFormLayout.ColumnLayout)) {
|
|
479
483
|
// if Layout is still loaded do it after it is loaded
|
|
480
484
|
var bLayout = true;
|
|
481
|
-
if (!oForm.getLayout()) {
|
|
485
|
+
if (!oForm.getLayout()) { // default layout used -> as we don't know if layout will be set it must latest be created on rendering
|
|
482
486
|
bLayout = _setFormLayout.call(this);
|
|
483
487
|
}
|
|
484
488
|
|
|
@@ -496,8 +500,10 @@ sap.ui.define([
|
|
|
496
500
|
this.$().css("visibility", "hidden"); //avoid that a wrong layouting is visible
|
|
497
501
|
this._applyLinebreaks();
|
|
498
502
|
|
|
499
|
-
//attach the resize handler
|
|
500
|
-
this.
|
|
503
|
+
//attach the resize handler (only if layout an ResizeHandler already loaded)
|
|
504
|
+
if (!this._bResponsiveLayoutRequested && ResizeHandler) {
|
|
505
|
+
this._sResizeListenerId = ResizeHandler.register(this.getDomRef(), jQuery.proxy(this._resize, this));
|
|
506
|
+
}
|
|
501
507
|
this._bChangedByMe = false;
|
|
502
508
|
}
|
|
503
509
|
|
|
@@ -1109,13 +1115,14 @@ sap.ui.define([
|
|
|
1109
1115
|
SimpleForm.prototype.setLayout = function(sLayout) {
|
|
1110
1116
|
|
|
1111
1117
|
var sOldLayout = this.getLayout();
|
|
1118
|
+
var bDefault = this.isPropertyInitial("layout"); // if default is used and layout not defined setLayout is not called
|
|
1112
1119
|
if (sLayout != sOldLayout) {
|
|
1113
1120
|
_removeOldLayoutData.call(this);
|
|
1114
1121
|
}
|
|
1115
1122
|
|
|
1116
1123
|
this.setProperty("layout", sLayout);
|
|
1117
1124
|
|
|
1118
|
-
if (sLayout != sOldLayout) {
|
|
1125
|
+
if (sLayout != sOldLayout || bDefault) { // Layout changed or default set explicit -> we know what layout is used and can create the Control
|
|
1119
1126
|
var bSet = _setFormLayout.call(this);
|
|
1120
1127
|
|
|
1121
1128
|
if (bSet) {
|
|
@@ -1177,12 +1184,14 @@ sap.ui.define([
|
|
|
1177
1184
|
|
|
1178
1185
|
switch (this.getLayout()) {
|
|
1179
1186
|
case SimpleFormLayout.ResponsiveLayout:
|
|
1180
|
-
if ((!ResponsiveLayout || !ResponsiveFlowLayoutData) && !this._bResponsiveLayoutRequested) {
|
|
1187
|
+
if ((!ResponsiveLayout || !ResponsiveFlowLayoutData || !ResizeHandler) && !this._bResponsiveLayoutRequested) {
|
|
1181
1188
|
ResponsiveLayout = sap.ui.require("sap/ui/layout/form/ResponsiveLayout");
|
|
1182
1189
|
ResponsiveFlowLayoutData = sap.ui.require("sap/ui/layout/ResponsiveFlowLayoutData");
|
|
1183
|
-
|
|
1190
|
+
ResizeHandler = sap.ui.require("sap/ui/core/ResizeHandler");
|
|
1191
|
+
if (!ResponsiveLayout || !ResponsiveFlowLayoutData || !ResizeHandler) {
|
|
1184
1192
|
sap.ui.require(["sap/ui/layout/form/ResponsiveLayout",
|
|
1185
|
-
"sap/ui/layout/ResponsiveFlowLayoutData"
|
|
1193
|
+
"sap/ui/layout/ResponsiveFlowLayoutData",
|
|
1194
|
+
"sap/ui/core/ResizeHandler"],
|
|
1186
1195
|
_ResponsiveLayoutLoaded.bind(this));
|
|
1187
1196
|
this._bResponsiveLayoutRequested = true;
|
|
1188
1197
|
}
|
|
@@ -1246,14 +1255,18 @@ sap.ui.define([
|
|
|
1246
1255
|
|
|
1247
1256
|
}
|
|
1248
1257
|
|
|
1249
|
-
function _ResponsiveLayoutLoaded(fnResponsiveLayout, fnResponsiveFlowLayoutData) {
|
|
1258
|
+
function _ResponsiveLayoutLoaded(fnResponsiveLayout, fnResponsiveFlowLayoutData, fnResizeHandler) {
|
|
1250
1259
|
|
|
1251
1260
|
ResponsiveLayout = fnResponsiveLayout;
|
|
1252
1261
|
ResponsiveFlowLayoutData = fnResponsiveFlowLayoutData;
|
|
1262
|
+
ResizeHandler = fnResizeHandler;
|
|
1253
1263
|
this._bResponsiveLayoutRequested = false;
|
|
1254
1264
|
|
|
1255
1265
|
if (this.getLayout() == SimpleFormLayout.ResponsiveLayout) { // as layout might changed
|
|
1256
1266
|
_updateLayoutAfterLoaded.call(this);
|
|
1267
|
+
if (this.getDomRef() && !this._sResizeListenerId) { // register resize handler after layout and ResizeHandler is loaded
|
|
1268
|
+
this._sResizeListenerId = ResizeHandler.register(this.getDomRef(), jQuery.proxy(this._resize, this));
|
|
1269
|
+
}
|
|
1257
1270
|
}
|
|
1258
1271
|
|
|
1259
1272
|
}
|
|
@@ -20,13 +20,13 @@ sap.ui.define([
|
|
|
20
20
|
* @namespace
|
|
21
21
|
* @alias sap.ui.layout
|
|
22
22
|
* @author SAP SE
|
|
23
|
-
* @version 1.
|
|
23
|
+
* @version 1.117.0
|
|
24
24
|
* @since 1.15
|
|
25
25
|
* @public
|
|
26
26
|
*/
|
|
27
27
|
var thisLib = sap.ui.getCore().initLibrary({
|
|
28
28
|
name : "sap.ui.layout",
|
|
29
|
-
version: "1.
|
|
29
|
+
version: "1.117.0",
|
|
30
30
|
dependencies: ["sap.ui.core"],
|
|
31
31
|
designtime: "sap/ui/layout/designtime/library.designtime",
|
|
32
32
|
types: [
|
|
@@ -111,4 +111,9 @@
|
|
|
111
111
|
.sapUiSizeCompact .sapUiFormContainerTitle > .sapUiFormTitle {
|
|
112
112
|
height: 2rem;
|
|
113
113
|
line-height: 2rem;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/* SemanticFormElement */
|
|
117
|
+
.sapUiForm .sapUiFormDelimiter { /* add Form class to make sure to overwrite sapMText setting */
|
|
118
|
+
white-space: pre-wrap; /* To render whitespaces in display mode if controls are rendered */
|
|
114
119
|
}
|
package/ui5.yaml
CHANGED