@openui5/sap.ui.layout 1.119.1 → 1.120.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/THIRDPARTY.txt +6 -6
- 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 +2 -132
- 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 +1 -1
- package/src/sap/ui/layout/DynamicSideContent.js +1 -1
- package/src/sap/ui/layout/FixFlex.js +1 -1
- package/src/sap/ui/layout/Grid.js +11 -6
- 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 +103 -18
- package/src/sap/ui/layout/SplitterLayoutData.js +21 -8
- 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/designtime/messagebundle_mk.properties +19 -0
- package/src/sap/ui/layout/designtime/messagebundle_sh.properties +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 +23 -23
- package/src/sap/ui/layout/form/Form.js +19 -7
- package/src/sap/ui/layout/form/FormContainer.js +22 -11
- package/src/sap/ui/layout/form/FormElement.js +6 -6
- package/src/sap/ui/layout/form/FormHelper.js +176 -0
- package/src/sap/ui/layout/form/FormLayout.js +14 -11
- package/src/sap/ui/layout/form/FormLayoutRenderer.js +3 -2
- package/src/sap/ui/layout/form/FormRenderer.js +5 -5
- package/src/sap/ui/layout/form/GridContainerData.js +4 -1
- package/src/sap/ui/layout/form/GridElementData.js +4 -1
- package/src/sap/ui/layout/form/GridLayout.js +1 -1
- package/src/sap/ui/layout/form/ResponsiveGridLayout.js +20 -20
- package/src/sap/ui/layout/form/ResponsiveLayout.js +1 -1
- package/src/sap/ui/layout/form/SemanticFormElement.js +8 -8
- package/src/sap/ui/layout/form/SimpleForm.js +1 -1
- package/src/sap/ui/layout/library.js +8 -21
- package/src/sap/ui/layout/messagebundle_mk.properties +17 -0
- package/src/sap/ui/layout/themes/base/ResponsiveGridLayout.less +1 -1
- package/ui5.yaml +4 -4
package/THIRDPARTY.txt
CHANGED
|
@@ -179,7 +179,7 @@ License: Apache-2.0
|
|
|
179
179
|
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
|
|
180
180
|
Contained in: src/sap.ui.core/src/sap/ui/thirdparty/caja-html-sanitizer.js
|
|
181
181
|
|
|
182
|
-
Component: Unicode Common Locale Data Repository, version:
|
|
182
|
+
Component: Unicode Common Locale Data Repository, version: 43
|
|
183
183
|
Copyright: 1991-2014 Unicode, Inc.
|
|
184
184
|
License: Unicode-DFS-2015
|
|
185
185
|
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Unicode-DFS-2015.txt
|
|
@@ -334,7 +334,7 @@ License: ISC
|
|
|
334
334
|
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/ISC.txt
|
|
335
335
|
Contained in: src/sap.ui.core/src/sap/ui/core/cache/LRUPersistentCache.js
|
|
336
336
|
|
|
337
|
-
Component: Time Zone Database, version:
|
|
337
|
+
Component: Time Zone Database, version: 2023c
|
|
338
338
|
Copyright: Arthur David Olson, Paul Eggert and other contributors
|
|
339
339
|
License: LicenseRef-tzdata-PublicDomain
|
|
340
340
|
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/LicenseRef-tzdata-PublicDomain.txt
|
|
@@ -416,7 +416,7 @@ Contained in: src/sap.ui.integration/test/sap/ui/integration/demokit/cardExplore
|
|
|
416
416
|
|
|
417
417
|
Library: sap.ui.webc.common:
|
|
418
418
|
|
|
419
|
-
Component: UI5 Web Components, version: 1.
|
|
419
|
+
Component: UI5 Web Components, version: 1.18.0
|
|
420
420
|
Copyright: SAP
|
|
421
421
|
License: Apache-2.0
|
|
422
422
|
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
|
|
@@ -436,13 +436,13 @@ Contained in: src/sap.ui.webc.common/src/sap/ui/webc/common/thirdparty/lit-html/
|
|
|
436
436
|
|
|
437
437
|
Library: sap.ui.webc.fiori:
|
|
438
438
|
|
|
439
|
-
Component: UI5 Web Components, version: 1.
|
|
439
|
+
Component: UI5 Web Components, version: 1.18.0
|
|
440
440
|
Copyright: SAP
|
|
441
441
|
License: Apache-2.0
|
|
442
442
|
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
|
|
443
443
|
Contained in: src/sap.ui.webc.fiori/src/sap/ui/webc/fiori/thirdparty/*.*
|
|
444
444
|
|
|
445
|
-
Component: ZXing, version: 0.
|
|
445
|
+
Component: ZXing, version: 0.17.1
|
|
446
446
|
Copyright: 2005 Sun Microsystems, Inc.; 2010-2014 University of Manchester; 2010-2015 Stian Soiland-Reyes; 2015 Peter Hull
|
|
447
447
|
License: Apache-2.0
|
|
448
448
|
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
|
|
@@ -451,7 +451,7 @@ Contained in: src/sap.ui.webc.fiori/src/sap/ui/webc/fiori/lib/zxing.js
|
|
|
451
451
|
|
|
452
452
|
Library: sap.ui.webc.main:
|
|
453
453
|
|
|
454
|
-
Component: UI5 Web Components, version: 1.
|
|
454
|
+
Component: UI5 Web Components, version: 1.18.0
|
|
455
455
|
Copyright: SAP
|
|
456
456
|
License: Apache-2.0
|
|
457
457
|
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openui5/sap.ui.layout",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.120.0",
|
|
4
4
|
"description": "OpenUI5 UI Library sap.ui.layout",
|
|
5
5
|
"author": "SAP SE (https://www.sap.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -14,6 +14,6 @@
|
|
|
14
14
|
"url": "https://github.com/SAP/openui5.git"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@openui5/sap.ui.core": "1.
|
|
17
|
+
"@openui5/sap.ui.core": "1.120.0"
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<copyright>OpenUI5
|
|
7
7
|
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
8
8
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.</copyright>
|
|
9
|
-
<version>1.
|
|
9
|
+
<version>1.120.0</version>
|
|
10
10
|
|
|
11
11
|
<documentation>SAPUI5 library with layout controls.</documentation>
|
|
12
12
|
|
|
@@ -24,7 +24,7 @@ sap.ui.define([
|
|
|
24
24
|
* @extends sap.ui.layout.Splitter
|
|
25
25
|
*
|
|
26
26
|
* @author SAP SE
|
|
27
|
-
* @version 1.
|
|
27
|
+
* @version 1.120.0
|
|
28
28
|
*
|
|
29
29
|
* @constructor
|
|
30
30
|
* @private
|
|
@@ -120,95 +120,9 @@ sap.ui.define([
|
|
|
120
120
|
}
|
|
121
121
|
};
|
|
122
122
|
|
|
123
|
-
// Overriding sap.ui.layout.Splitter's calculation functions in order to make it responsive
|
|
124
|
-
|
|
125
123
|
/**
|
|
126
124
|
* @override
|
|
127
|
-
|
|
128
|
-
AssociativeSplitter.prototype._resizeContents = function (iLeftContent, iPixels, bFinal) {
|
|
129
|
-
var aContentAreas, oLd1, oLd2, sSize1,
|
|
130
|
-
sSize2, $Cnt1, $Cnt2, iNewSize1, iNewSize2,
|
|
131
|
-
iMinSize1, iMinSize2,
|
|
132
|
-
sFinalSize1, sFinalSize2, iDiff,
|
|
133
|
-
sMoveContentSize1 = parseFloat(this._move.c1Size).toFixed(5),
|
|
134
|
-
sMoveContentSize2 = parseFloat(this._move.c2Size).toFixed(5),
|
|
135
|
-
fMoveC1Size = parseFloat(sMoveContentSize1),
|
|
136
|
-
fMoveC2Size = parseFloat(sMoveContentSize2);
|
|
137
|
-
|
|
138
|
-
if (isNaN(iPixels)) {
|
|
139
|
-
Log.warning("Splitter: Received invalid resizing values - resize aborted.");
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
aContentAreas = this._getContentAreas();
|
|
144
|
-
oLd1 = aContentAreas[iLeftContent].getLayoutData();
|
|
145
|
-
oLd2 = aContentAreas[iLeftContent + 1].getLayoutData();
|
|
146
|
-
|
|
147
|
-
sSize1 = oLd1.getSize();
|
|
148
|
-
sSize2 = oLd2.getSize();
|
|
149
|
-
|
|
150
|
-
$Cnt1 = this.$("content-" + iLeftContent);
|
|
151
|
-
$Cnt2 = this.$("content-" + (iLeftContent + 1));
|
|
152
|
-
|
|
153
|
-
iNewSize1 = fMoveC1Size + iPixels;
|
|
154
|
-
iNewSize2 = fMoveC2Size - iPixels;
|
|
155
|
-
iMinSize1 = parseInt(oLd1.getMinSize());
|
|
156
|
-
iMinSize2 = parseInt(oLd2.getMinSize());
|
|
157
|
-
|
|
158
|
-
// Adhere to size constraints
|
|
159
|
-
if (iNewSize1 < iMinSize1) {
|
|
160
|
-
iDiff = iMinSize1 - iNewSize1;
|
|
161
|
-
iPixels += iDiff;
|
|
162
|
-
iNewSize1 = iMinSize1;
|
|
163
|
-
iNewSize2 -= iDiff;
|
|
164
|
-
} else if (iNewSize2 < iMinSize2) {
|
|
165
|
-
iDiff = iMinSize2 - iNewSize2;
|
|
166
|
-
iPixels -= iDiff;
|
|
167
|
-
iNewSize2 = iMinSize2;
|
|
168
|
-
iNewSize1 -= iDiff;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
if (bFinal) {
|
|
172
|
-
// in this case widths of the areas are % from the available content width (bars excluded)
|
|
173
|
-
var iAvailableContentSize = this._calcAvailableContentSize();
|
|
174
|
-
|
|
175
|
-
// Resize finished, set layout data in content areas
|
|
176
|
-
if (sSize1 === "auto" && sSize2 !== "auto") {
|
|
177
|
-
// First pane has auto size - only change size of second pane
|
|
178
|
-
sFinalSize2 = this._pxToPercent(iNewSize2, iAvailableContentSize);
|
|
179
|
-
oLd2.setSize(sFinalSize2);
|
|
180
|
-
oLd2._markModified();
|
|
181
|
-
} else if (sSize1 !== "auto" && sSize2 === "auto") {
|
|
182
|
-
// Second pane has auto size - only change size of first pane
|
|
183
|
-
sFinalSize1 = this._pxToPercent(iNewSize1, iAvailableContentSize);
|
|
184
|
-
oLd1.setSize(sFinalSize1);
|
|
185
|
-
oLd1._markModified();
|
|
186
|
-
} else {
|
|
187
|
-
sFinalSize1 = this._pxToPercent(iNewSize1, iAvailableContentSize);
|
|
188
|
-
sFinalSize2 = this._pxToPercent(iNewSize2, iAvailableContentSize);
|
|
189
|
-
|
|
190
|
-
oLd1.setSize(sFinalSize1);
|
|
191
|
-
oLd2.setSize(sFinalSize2);
|
|
192
|
-
oLd1._markModified();
|
|
193
|
-
oLd2._markModified();
|
|
194
|
-
}
|
|
195
|
-
} else { // Live-Resize, resize contents in Dom
|
|
196
|
-
// in this case widths of the areas are % from the total size (bars included)
|
|
197
|
-
var iTotalSplitterSize = this._getTotalSize();
|
|
198
|
-
|
|
199
|
-
sFinalSize1 = this._pxToPercent(iNewSize1, iTotalSplitterSize);
|
|
200
|
-
sFinalSize2 = this._pxToPercent(iNewSize2, iTotalSplitterSize);
|
|
201
|
-
|
|
202
|
-
$Cnt1.css(this._sizeType, sFinalSize1);
|
|
203
|
-
$Cnt2.css(this._sizeType, sFinalSize2);
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* Upon bar resizing AssociativeSplitter sets layoutData's size to %.
|
|
209
|
-
* This override is needed to check if such % would exceed the available space.
|
|
210
|
-
* If so, the size is reduced.
|
|
211
|
-
* @override
|
|
125
|
+
* If there is single "%"-sized area after pagination, let it take the remaining size
|
|
212
126
|
*/
|
|
213
127
|
AssociativeSplitter.prototype._calcPercentBasedSizes = function (aPercentSizeIdx, iRemainingSize) {
|
|
214
128
|
var aContentAreas = this._getContentAreas(),
|
|
@@ -222,53 +136,9 @@ sap.ui.define([
|
|
|
222
136
|
iRemainingSize = Splitter.prototype._calcPercentBasedSizes.apply(this, arguments);
|
|
223
137
|
}
|
|
224
138
|
|
|
225
|
-
var iMinSizeOfAutoSizedAreas = aContentAreas
|
|
226
|
-
.filter(function (oArea) {
|
|
227
|
-
return oArea.getLayoutData().getSize() === "auto";
|
|
228
|
-
})
|
|
229
|
-
.reduce(function (iSum, oArea) {
|
|
230
|
-
return iSum + oArea.getLayoutData().getMinSize();
|
|
231
|
-
}, 0);
|
|
232
|
-
|
|
233
|
-
// calculated % exceed the available space - shrink areas if possible
|
|
234
|
-
if (iRemainingSize < iMinSizeOfAutoSizedAreas) {
|
|
235
|
-
var iNeededSize = Math.abs(iRemainingSize - iMinSizeOfAutoSizedAreas);
|
|
236
|
-
|
|
237
|
-
// shrink areas from right to left
|
|
238
|
-
for (var i = aPercentSizeIdx.length - 1; i >= 0; i--) {
|
|
239
|
-
var iIdx = aPercentSizeIdx[i],
|
|
240
|
-
oArea = aContentAreas[iIdx],
|
|
241
|
-
iCalculatedSize = this._calculatedSizes[iIdx],
|
|
242
|
-
oLD = oArea.getLayoutData();
|
|
243
|
-
|
|
244
|
-
if (oLD._isMarked()) {
|
|
245
|
-
var iNewSize = iCalculatedSize - iNeededSize;
|
|
246
|
-
|
|
247
|
-
if (iNewSize < oLD.getMinSize()) {
|
|
248
|
-
iNewSize = oLD.getMinSize();
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
this._calculatedSizes[iIdx] = iNewSize;
|
|
252
|
-
|
|
253
|
-
var iIncreasedSize = iCalculatedSize - iNewSize;
|
|
254
|
-
iNeededSize -= iIncreasedSize;
|
|
255
|
-
iRemainingSize += iIncreasedSize;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
// already shrunk enough
|
|
259
|
-
if (iNeededSize <= 0) {
|
|
260
|
-
break;
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
|
|
265
139
|
return iRemainingSize;
|
|
266
140
|
};
|
|
267
141
|
|
|
268
|
-
AssociativeSplitter.prototype._pxToPercent = function (iPx, iFullSize) {
|
|
269
|
-
return (iPx * 100) / iFullSize + "%";
|
|
270
|
-
};
|
|
271
|
-
|
|
272
142
|
/**
|
|
273
143
|
* @override
|
|
274
144
|
*/
|
|
@@ -59,7 +59,7 @@ sap.ui.define([
|
|
|
59
59
|
* @extends sap.ui.core.Control
|
|
60
60
|
*
|
|
61
61
|
* @author SAP SE
|
|
62
|
-
* @version 1.
|
|
62
|
+
* @version 1.120.0
|
|
63
63
|
*
|
|
64
64
|
* @constructor
|
|
65
65
|
* @public
|
|
@@ -147,11 +147,16 @@ sap.ui.define([
|
|
|
147
147
|
(function() {
|
|
148
148
|
|
|
149
149
|
Grid.prototype.init = function() {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
150
|
+
/**
|
|
151
|
+
* @deprecated As of version 1.120
|
|
152
|
+
*/
|
|
153
|
+
(() => {
|
|
154
|
+
// Library specific class
|
|
155
|
+
var sClass = library.GridHelper.getLibrarySpecificClass();
|
|
156
|
+
if (sClass) {
|
|
157
|
+
this.addStyleClass(sClass);
|
|
158
|
+
}
|
|
159
|
+
})();
|
|
155
160
|
|
|
156
161
|
this._iBreakPointTablet = Device.media._predefinedRangeSets[Device.media.RANGESETS.SAP_STANDARD_EXTENDED].points[0];
|
|
157
162
|
this._iBreakPointDesktop = Device.media._predefinedRangeSets[Device.media.RANGESETS.SAP_STANDARD_EXTENDED].points[1];
|
|
@@ -70,7 +70,7 @@ sap.ui.define([
|
|
|
70
70
|
* @extends sap.ui.core.Control
|
|
71
71
|
*
|
|
72
72
|
* @author SAP SE
|
|
73
|
-
* @version 1.
|
|
73
|
+
* @version 1.120.0
|
|
74
74
|
*
|
|
75
75
|
* @constructor
|
|
76
76
|
* @public
|
|
@@ -575,10 +575,9 @@ sap.ui.define([
|
|
|
575
575
|
/**
|
|
576
576
|
* Resizes the contents after a bar has been moved
|
|
577
577
|
*
|
|
578
|
-
* @param {int}
|
|
579
|
-
* @param {number}
|
|
580
|
-
* @param {boolean}
|
|
581
|
-
* content areas)
|
|
578
|
+
* @param {int} iLeftContent Index of the first (left) content that is resized
|
|
579
|
+
* @param {number} iPixels Number of pixels to increase the first and decrease the second content
|
|
580
|
+
* @param {boolean} bFinal Whether this is the final position (sets the size in the layoutData of the content areas)
|
|
582
581
|
*/
|
|
583
582
|
Splitter.prototype._resizeContents = function(iLeftContent, iPixels, bFinal) {
|
|
584
583
|
if (isNaN(iPixels)) {
|
|
@@ -596,10 +595,15 @@ sap.ui.define([
|
|
|
596
595
|
var $Cnt1 = this.$("content-" + iLeftContent);
|
|
597
596
|
var $Cnt2 = this.$("content-" + (iLeftContent + 1));
|
|
598
597
|
|
|
599
|
-
var
|
|
600
|
-
var
|
|
601
|
-
|
|
602
|
-
var
|
|
598
|
+
var sMoveContentSize1 = parseFloat(this._move.c1Size).toFixed(5);
|
|
599
|
+
var sMoveContentSize2 = parseFloat(this._move.c2Size).toFixed(5);
|
|
600
|
+
|
|
601
|
+
var iNewSize1 = parseFloat(sMoveContentSize1) + iPixels;
|
|
602
|
+
var iNewSize2 = parseFloat(sMoveContentSize2) - iPixels;
|
|
603
|
+
var iMinSize1 = parseInt(oLd1.getMinSize());
|
|
604
|
+
var iMinSize2 = parseInt(oLd2.getMinSize());
|
|
605
|
+
|
|
606
|
+
var sFinalSize1, sFinalSize2;
|
|
603
607
|
|
|
604
608
|
// Adhere to size constraints
|
|
605
609
|
var iDiff;
|
|
@@ -616,24 +620,56 @@ sap.ui.define([
|
|
|
616
620
|
}
|
|
617
621
|
|
|
618
622
|
if (bFinal) {
|
|
623
|
+
// in this case widths of the areas are % from the available content width (bars excluded)
|
|
624
|
+
var iAvailableContentSize = this._calcAvailableContentSize();
|
|
625
|
+
|
|
619
626
|
// Resize finished, set layout data in content areas
|
|
620
627
|
if (sSize1 === "auto" && sSize2 !== "auto") {
|
|
621
628
|
// First pane has auto size - only change size of second pane
|
|
622
|
-
|
|
629
|
+
sFinalSize2 = this._calcAreaSizeWithUnit(iNewSize2, iAvailableContentSize, oLd2._getSizeUnit());
|
|
630
|
+
oLd2.setSize(sFinalSize2);
|
|
631
|
+
oLd2._markModified();
|
|
623
632
|
} else if (sSize1 !== "auto" && sSize2 === "auto") {
|
|
624
633
|
// Second pane has auto size - only change size of first pane
|
|
625
|
-
|
|
634
|
+
sFinalSize1 = this._calcAreaSizeWithUnit(iNewSize1, iAvailableContentSize, oLd1._getSizeUnit());
|
|
635
|
+
oLd1.setSize(sFinalSize1);
|
|
636
|
+
oLd1._markModified();
|
|
626
637
|
} else {
|
|
627
|
-
|
|
628
|
-
|
|
638
|
+
sFinalSize1 = this._calcAreaSizeWithUnit(iNewSize1, iAvailableContentSize, oLd1._getSizeUnit());
|
|
639
|
+
sFinalSize2 = this._calcAreaSizeWithUnit(iNewSize2, iAvailableContentSize, oLd2._getSizeUnit());
|
|
640
|
+
|
|
641
|
+
oLd1.setSize(sFinalSize1);
|
|
642
|
+
oLd2.setSize(sFinalSize2);
|
|
643
|
+
oLd1._markModified();
|
|
644
|
+
oLd2._markModified();
|
|
629
645
|
}
|
|
630
|
-
} else {
|
|
631
|
-
//
|
|
632
|
-
|
|
633
|
-
|
|
646
|
+
} else { // Live-Resize, resize contents in Dom
|
|
647
|
+
// in this case widths of the areas are % from the total size (bars included)
|
|
648
|
+
var iTotalSplitterSize = this._getTotalSize();
|
|
649
|
+
|
|
650
|
+
sFinalSize1 = this._pxToPercent(iNewSize1, iTotalSplitterSize);
|
|
651
|
+
sFinalSize2 = this._pxToPercent(iNewSize2, iTotalSplitterSize);
|
|
652
|
+
|
|
653
|
+
$Cnt1.css(this._sizeType, sFinalSize1);
|
|
654
|
+
$Cnt2.css(this._sizeType, sFinalSize2);
|
|
634
655
|
}
|
|
635
656
|
};
|
|
636
657
|
|
|
658
|
+
Splitter.prototype._calcAreaSizeWithUnit = function (iPx, iAvailable, sUnit) {
|
|
659
|
+
if (sUnit === "px") {
|
|
660
|
+
return iPx + "px";
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
if (sUnit === "rem") {
|
|
664
|
+
return (iPx / iRemAsPixels) + "rem"; // TODO: use Rem class
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
return this._pxToPercent(iPx, iAvailable);
|
|
668
|
+
};
|
|
669
|
+
|
|
670
|
+
Splitter.prototype._pxToPercent = function (iPx, iFullSize) {
|
|
671
|
+
return (iPx * 100) / iFullSize + "%";
|
|
672
|
+
};
|
|
637
673
|
|
|
638
674
|
////////////////////////////////////////// Private Methods /////////////////////////////////////////
|
|
639
675
|
|
|
@@ -890,11 +926,19 @@ sap.ui.define([
|
|
|
890
926
|
}
|
|
891
927
|
};
|
|
892
928
|
|
|
929
|
+
/**
|
|
930
|
+
* Calculates sizes of areas sized with "%".
|
|
931
|
+
* If some "%" area would exceed the available space, its size is reduced.
|
|
932
|
+
* @param {int[]} aPercentSizeIdx Areas that are sized with "%"
|
|
933
|
+
* @param {int} iRemainingSize Remaining size to distribute the "%" areas
|
|
934
|
+
* @returns {int} How much space is left after distributing the "%" areas
|
|
935
|
+
*/
|
|
893
936
|
Splitter.prototype._calcPercentBasedSizes = function (aPercentSizeIdx, iRemainingSize) {
|
|
894
937
|
var aContentAreas = this._getContentAreas(),
|
|
895
938
|
iAvailableContentSize = this._calcAvailableContentSize();
|
|
896
939
|
|
|
897
|
-
|
|
940
|
+
// Step1: Distribute the % in the available size
|
|
941
|
+
for (let i = 0; i < aPercentSizeIdx.length; ++i) {
|
|
898
942
|
var idx = aPercentSizeIdx[i];
|
|
899
943
|
// Percent based value - deduct it from available size
|
|
900
944
|
var iAreaSize = parseFloat(aContentAreas[idx].getLayoutData().getSize()) / 100 * iAvailableContentSize;
|
|
@@ -908,6 +952,47 @@ sap.ui.define([
|
|
|
908
952
|
iRemainingSize -= iAreaSize;
|
|
909
953
|
}
|
|
910
954
|
|
|
955
|
+
// Step2: Check if the distributed % would violate the minSize constrains of the remaining "auto" areas
|
|
956
|
+
var iMinSizeOfAutoSizedAreas = aContentAreas
|
|
957
|
+
.filter(function (oArea) {
|
|
958
|
+
return oArea.getLayoutData().getSize() === "auto";
|
|
959
|
+
})
|
|
960
|
+
.reduce(function (iSum, oArea) {
|
|
961
|
+
return iSum + oArea.getLayoutData().getMinSize();
|
|
962
|
+
}, 0);
|
|
963
|
+
|
|
964
|
+
// calculated % exceed the available space - shrink areas if possible
|
|
965
|
+
if (iRemainingSize < iMinSizeOfAutoSizedAreas) {
|
|
966
|
+
var iNeededSize = Math.abs(iRemainingSize - iMinSizeOfAutoSizedAreas);
|
|
967
|
+
|
|
968
|
+
// shrink areas from right to left
|
|
969
|
+
for (var i = aPercentSizeIdx.length - 1; i >= 0; i--) {
|
|
970
|
+
var iIdx = aPercentSizeIdx[i],
|
|
971
|
+
oArea = aContentAreas[iIdx],
|
|
972
|
+
iCalculatedSize = this._calculatedSizes[iIdx],
|
|
973
|
+
oLD = oArea.getLayoutData();
|
|
974
|
+
|
|
975
|
+
if (oLD._isMarked()) {
|
|
976
|
+
var iNewSize = iCalculatedSize - iNeededSize;
|
|
977
|
+
|
|
978
|
+
if (iNewSize < oLD.getMinSize()) {
|
|
979
|
+
iNewSize = oLD.getMinSize();
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
this._calculatedSizes[iIdx] = iNewSize;
|
|
983
|
+
|
|
984
|
+
var iIncreasedSize = iCalculatedSize - iNewSize;
|
|
985
|
+
iNeededSize -= iIncreasedSize;
|
|
986
|
+
iRemainingSize += iIncreasedSize;
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
// already shrunk enough
|
|
990
|
+
if (iNeededSize <= 0) {
|
|
991
|
+
break;
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
|
|
911
996
|
return iRemainingSize;
|
|
912
997
|
};
|
|
913
998
|
|
|
@@ -19,12 +19,10 @@ sap.ui.define(['sap/ui/core/LayoutData', './library'],
|
|
|
19
19
|
*
|
|
20
20
|
* @class
|
|
21
21
|
* Holds layout data for the splitter contents.
|
|
22
|
-
* Allowed size values are numeric values ending in "px"
|
|
23
|
-
|
|
24
|
-
* (The CSS value "auto" is used internally to recalculate the size of the content
|
|
25
|
-
* dynamically and is not directly set as style property.)
|
|
22
|
+
* Allowed size values are numeric values ending in "px", "rem", "%" and "auto".
|
|
23
|
+
|
|
26
24
|
* @extends sap.ui.core.LayoutData
|
|
27
|
-
* @version 1.
|
|
25
|
+
* @version 1.120.0
|
|
28
26
|
*
|
|
29
27
|
* @constructor
|
|
30
28
|
* @public
|
|
@@ -46,9 +44,6 @@ sap.ui.define(['sap/ui/core/LayoutData', './library'],
|
|
|
46
44
|
/**
|
|
47
45
|
* The size of the splitter content.
|
|
48
46
|
* This property is updated when the area is resized by the user.
|
|
49
|
-
*
|
|
50
|
-
* <b>Note:</b> Resizing areas in the sap.ui.layout.Splitter sets this property to "px" values,
|
|
51
|
-
* while resizing areas in the sap.ui.layout.ResponsiveSplitter sets it to % values.
|
|
52
47
|
*/
|
|
53
48
|
size : {type : "sap.ui.core.CSSSize", group : "Dimension", defaultValue : 'auto'},
|
|
54
49
|
|
|
@@ -72,5 +67,23 @@ sap.ui.define(['sap/ui/core/LayoutData', './library'],
|
|
|
72
67
|
return this._bIsModified;
|
|
73
68
|
};
|
|
74
69
|
|
|
70
|
+
SplitterLayoutData.prototype._getSizeUnit = function () {
|
|
71
|
+
const sSize = this.getSize();
|
|
72
|
+
|
|
73
|
+
if (sSize.includes("px")) {
|
|
74
|
+
return "px";
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (sSize.includes("rem")) {
|
|
78
|
+
return "rem";
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (sSize.includes("%")) {
|
|
82
|
+
return "%";
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return "auto";
|
|
86
|
+
};
|
|
87
|
+
|
|
75
88
|
return SplitterLayoutData;
|
|
76
89
|
});
|