@openui5/sap.ui.layout 1.115.1 → 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/.reuse/dep5 +0 -5
- package/THIRDPARTY.txt +1 -7
- 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 +45 -19
- 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 +6 -2
- package/src/sap/ui/layout/changeHandler/AddSimpleFormGroup.js +1 -1
- package/src/sap/ui/layout/changeHandler/HideSimpleForm.js +8 -3
- package/src/sap/ui/layout/changeHandler/MoveSimpleForm.js +19 -10
- 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/AlignedFlowLayout.less +1 -1
- package/src/sap/ui/layout/themes/base/FormLayout.less +5 -0
- package/ui5.yaml +1 -1
|
@@ -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