@openui5/sap.f 1.120.6 → 1.121.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 +23 -21
- package/THIRDPARTY.txt +6 -43
- package/package.json +4 -4
- package/src/sap/f/.library +1 -1
- package/src/sap/f/Avatar.js +5 -4
- package/src/sap/f/AvatarGroup.js +4 -4
- package/src/sap/f/AvatarGroupItem.js +1 -1
- package/src/sap/f/CalendarAppointmentInCard.js +1 -1
- package/src/sap/f/CalendarInCard.js +7 -5
- package/src/sap/f/CalendarInCardRenderer.js +6 -11
- package/src/sap/f/Card.js +1 -1
- package/src/sap/f/CardBase.js +6 -6
- package/src/sap/f/DynamicPage.js +35 -15
- package/src/sap/f/DynamicPageAccessibleLandmarkInfo.js +1 -1
- package/src/sap/f/DynamicPageHeader.js +30 -16
- package/src/sap/f/DynamicPageTitle.js +10 -8
- package/src/sap/f/FlexibleColumnLayout.js +220 -90
- package/src/sap/f/FlexibleColumnLayoutAccessibleLandmarkInfo.js +1 -1
- package/src/sap/f/FlexibleColumnLayoutRenderer.js +7 -3
- package/src/sap/f/FlexibleColumnLayoutSemanticHelper.js +1 -1
- package/src/sap/f/GridContainer.js +45 -46
- package/src/sap/f/GridContainerItemLayoutData.js +1 -1
- package/src/sap/f/GridContainerRenderer.js +19 -11
- package/src/sap/f/GridContainerSettings.js +2 -2
- package/src/sap/f/GridList.js +15 -4
- package/src/sap/f/GridListItem.js +1 -1
- package/src/sap/f/GridNavigationMatrix.js +3 -3
- package/src/sap/f/IllustratedMessage.js +1 -1
- package/src/sap/f/Illustration.js +1 -1
- package/src/sap/f/PlanningCalendarInCardLegend.js +4 -5
- package/src/sap/f/PlanningCalendarInCardLegendRenderer.js +4 -4
- package/src/sap/f/ProductSwitch.js +7 -7
- package/src/sap/f/ProductSwitchItem.js +1 -1
- package/src/sap/f/ProductSwitchRenderer.js +3 -3
- package/src/sap/f/SearchManager.js +4 -4
- package/src/sap/f/ShellBar.js +71 -10
- package/src/sap/f/ShellBarRenderer.js +3 -3
- package/src/sap/f/SidePanel.js +22 -11
- package/src/sap/f/SidePanelItem.js +1 -1
- package/src/sap/f/cards/BaseHeader.js +21 -9
- package/src/sap/f/cards/Header.js +1 -1
- package/src/sap/f/cards/NumericHeader.js +1 -1
- package/src/sap/f/cards/NumericIndicators.js +1 -1
- package/src/sap/f/cards/NumericSideIndicator.js +1 -1
- package/src/sap/f/cards/loading/AnalyticalPlaceholder.js +1 -1
- package/src/sap/f/cards/loading/CalendarPlaceholder.js +1 -1
- package/src/sap/f/cards/loading/GenericPlaceholder.js +1 -1
- package/src/sap/f/cards/loading/ListPlaceholder.js +1 -1
- package/src/sap/f/cards/loading/ObjectPlaceholder.js +1 -1
- package/src/sap/f/cards/loading/PlaceholderBase.js +1 -1
- package/src/sap/f/cards/loading/PlaceholderBaseRenderer.js +2 -2
- package/src/sap/f/cards/loading/TablePlaceholder.js +1 -1
- package/src/sap/f/cards/loading/TimelinePlaceholder.js +1 -1
- package/src/sap/f/changeHandler/MoveDynamicPageTitleActions.js +1 -1
- package/src/sap/f/delegate/GridContainerItemNavigation.js +1 -1
- package/src/sap/f/delegate/GridItemNavigation.js +1 -1
- package/src/sap/f/designtime/messagebundle_en_US_saprigi.properties +4 -4
- package/src/sap/f/dnd/GridDragOver.js +5 -5
- package/src/sap/f/dnd/GridDropInfo.js +1 -1
- package/src/sap/f/library.js +23 -19
- package/src/sap/f/messagebundle.properties +4 -1
- package/src/sap/f/messagebundle_ar.properties +2 -0
- package/src/sap/f/messagebundle_bg.properties +2 -0
- package/src/sap/f/messagebundle_ca.properties +2 -0
- package/src/sap/f/messagebundle_cnr.properties +2 -0
- package/src/sap/f/messagebundle_cs.properties +2 -0
- package/src/sap/f/messagebundle_cy.properties +2 -0
- package/src/sap/f/messagebundle_da.properties +2 -0
- package/src/sap/f/messagebundle_de.properties +2 -0
- package/src/sap/f/messagebundle_el.properties +2 -0
- package/src/sap/f/messagebundle_en.properties +86 -1
- package/src/sap/f/messagebundle_en_GB.properties +2 -0
- package/src/sap/f/messagebundle_en_US_saprigi.properties +82 -80
- package/src/sap/f/messagebundle_es.properties +2 -0
- package/src/sap/f/messagebundle_es_MX.properties +2 -0
- package/src/sap/f/messagebundle_et.properties +2 -0
- package/src/sap/f/messagebundle_fi.properties +2 -0
- package/src/sap/f/messagebundle_fr.properties +2 -0
- package/src/sap/f/messagebundle_fr_CA.properties +2 -0
- package/src/sap/f/messagebundle_hi.properties +2 -0
- package/src/sap/f/messagebundle_hr.properties +2 -0
- package/src/sap/f/messagebundle_hu.properties +2 -0
- package/src/sap/f/messagebundle_id.properties +2 -0
- package/src/sap/f/messagebundle_it.properties +2 -0
- package/src/sap/f/messagebundle_iw.properties +2 -0
- package/src/sap/f/messagebundle_ja.properties +2 -0
- package/src/sap/f/messagebundle_kk.properties +2 -0
- package/src/sap/f/messagebundle_ko.properties +2 -0
- package/src/sap/f/messagebundle_lt.properties +2 -0
- package/src/sap/f/messagebundle_lv.properties +2 -0
- package/src/sap/f/messagebundle_mk.properties +2 -0
- package/src/sap/f/messagebundle_ms.properties +2 -0
- package/src/sap/f/messagebundle_nl.properties +2 -0
- package/src/sap/f/messagebundle_no.properties +2 -0
- package/src/sap/f/messagebundle_pl.properties +2 -0
- package/src/sap/f/messagebundle_pt.properties +2 -0
- package/src/sap/f/messagebundle_pt_PT.properties +2 -0
- package/src/sap/f/messagebundle_ro.properties +2 -0
- package/src/sap/f/messagebundle_ru.properties +2 -0
- package/src/sap/f/messagebundle_sh.properties +2 -0
- package/src/sap/f/messagebundle_sk.properties +2 -0
- package/src/sap/f/messagebundle_sl.properties +2 -0
- package/src/sap/f/messagebundle_sr.properties +2 -0
- package/src/sap/f/messagebundle_sv.properties +2 -0
- package/src/sap/f/messagebundle_th.properties +2 -0
- package/src/sap/f/messagebundle_tr.properties +2 -0
- package/src/sap/f/messagebundle_uk.properties +3 -1
- package/src/sap/f/messagebundle_vi.properties +2 -0
- package/src/sap/f/messagebundle_zh_CN.properties +2 -0
- package/src/sap/f/messagebundle_zh_TW.properties +2 -0
- package/src/sap/f/semantic/AddAction.js +1 -1
- package/src/sap/f/semantic/CloseAction.js +1 -1
- package/src/sap/f/semantic/CopyAction.js +1 -1
- package/src/sap/f/semantic/DeleteAction.js +1 -1
- package/src/sap/f/semantic/DiscussInJamAction.js +1 -1
- package/src/sap/f/semantic/EditAction.js +1 -1
- package/src/sap/f/semantic/ExitFullScreenAction.js +1 -1
- package/src/sap/f/semantic/FavoriteAction.js +1 -1
- package/src/sap/f/semantic/FlagAction.js +1 -1
- package/src/sap/f/semantic/FooterMainAction.js +1 -1
- package/src/sap/f/semantic/FullScreenAction.js +1 -1
- package/src/sap/f/semantic/MainAction.js +1 -1
- package/src/sap/f/semantic/MessagesIndicator.js +1 -1
- package/src/sap/f/semantic/NegativeAction.js +1 -1
- package/src/sap/f/semantic/PositiveAction.js +1 -1
- package/src/sap/f/semantic/PrintAction.js +1 -1
- package/src/sap/f/semantic/SemanticButton.js +1 -1
- package/src/sap/f/semantic/SemanticConfiguration.js +7 -8
- package/src/sap/f/semantic/SemanticControl.js +1 -1
- package/src/sap/f/semantic/SemanticFooter.js +2 -2
- package/src/sap/f/semantic/SemanticPage.js +19 -17
- package/src/sap/f/semantic/SemanticShareMenu.js +5 -2
- package/src/sap/f/semantic/SemanticToggleButton.js +1 -1
- package/src/sap/f/semantic/SendEmailAction.js +1 -1
- package/src/sap/f/semantic/SendMessageAction.js +1 -1
- package/src/sap/f/semantic/ShareInJamAction.js +1 -1
- package/src/sap/f/semantic/TitleMainAction.js +1 -1
- package/src/sap/f/shellBar/Accessibility.js +5 -5
- package/src/sap/f/shellBar/AdditionalContentSupport.js +1 -1
- package/src/sap/f/shellBar/CoPilot.js +8 -7
- package/src/sap/f/shellBar/ControlSpacer.js +1 -1
- package/src/sap/f/shellBar/Factory.js +14 -8
- package/src/sap/f/shellBar/ResponsiveHandler.js +23 -6
- package/src/sap/f/shellBar/Search.js +20 -4
- package/src/sap/f/themes/base/Card.less +2 -2
- package/src/sap/f/themes/base/CardLoading.less +94 -5
- package/src/sap/f/themes/base/DynamicPage.less +1 -1
- package/src/sap/f/themes/base/DynamicPageHeader.less +1 -1
- package/src/sap/f/themes/base/DynamicPageTitle.less +1 -1
- package/src/sap/f/themes/base/GridContainer.less +6 -4
- package/src/sap/f/themes/base/ShellBar.less +32 -13
- package/LICENSES/BSD-2-Clause.txt +0 -22
|
@@ -6,6 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
// Provides control sap.f.FlexibleColumnLayout.
|
|
8
8
|
sap.ui.define([
|
|
9
|
+
"sap/base/i18n/Localization",
|
|
10
|
+
"sap/ui/core/ControlBehavior",
|
|
11
|
+
"sap/ui/core/Lib",
|
|
12
|
+
"sap/ui/core/RenderManager",
|
|
9
13
|
"sap/ui/thirdparty/jquery",
|
|
10
14
|
"./library",
|
|
11
15
|
"sap/ui/core/library",
|
|
@@ -23,8 +27,13 @@ sap.ui.define([
|
|
|
23
27
|
"sap/base/util/isEmptyObject",
|
|
24
28
|
"sap/base/util/merge",
|
|
25
29
|
"sap/ui/core/InvisibleMessage",
|
|
26
|
-
|
|
30
|
+
// provides jQuery.fn.firstFocusableDomRef
|
|
31
|
+
"sap/ui/dom/jquery/Focusable"
|
|
27
32
|
], function(
|
|
33
|
+
Localization,
|
|
34
|
+
ControlBehavior,
|
|
35
|
+
Library,
|
|
36
|
+
RenderManager,
|
|
28
37
|
jQuery,
|
|
29
38
|
library,
|
|
30
39
|
coreLibrary,
|
|
@@ -67,7 +76,9 @@ sap.ui.define([
|
|
|
67
76
|
* three columns (referred to as <code>Begin</code>, <code>Mid</code> and <code>End</code>) rather than two
|
|
68
77
|
* (<code>Master</code>, <code>Detail</code>). The width of the three columns is variable.
|
|
69
78
|
*
|
|
70
|
-
* There are several possible layouts that can be changed either with the control's API, or by the user with the help of
|
|
79
|
+
* There are several possible layouts that can be changed either with the control's API, or by the user with the help of the draggable column separators.
|
|
80
|
+
* The draggable column separators allow the user to customize the column widths for the current layout, or to switch to a new layout (if the user drags the column separator past a breakpoint that delimits two different layouts).
|
|
81
|
+
* After the user customized the column widths for a given layout, these user preferences are internally saved and automatically re-applied whenever the user re-visits the same layout.
|
|
71
82
|
*
|
|
72
83
|
* Internally the control makes use of three instances of {@link sap.m.NavContainer}, thus forming the three columns.
|
|
73
84
|
*
|
|
@@ -97,7 +108,7 @@ sap.ui.define([
|
|
|
97
108
|
*
|
|
98
109
|
* @extends sap.ui.core.Control
|
|
99
110
|
* @author SAP SE
|
|
100
|
-
* @version 1.
|
|
111
|
+
* @version 1.121.0
|
|
101
112
|
*
|
|
102
113
|
* @constructor
|
|
103
114
|
* @public
|
|
@@ -213,8 +224,8 @@ sap.ui.define([
|
|
|
213
224
|
* Fired when there is a change in the <code>layout</code> property or in the maximum number of columns that can be displayed at once.
|
|
214
225
|
* <br/></br>
|
|
215
226
|
* <ul>The interactions that may lead to a state change are:
|
|
216
|
-
* <li>
|
|
217
|
-
* <li>
|
|
227
|
+
* <li>The property <code>layout</code> was changed indirectly by the user dragging the column separator or clicking on its arrow (where arrow is available).</li>
|
|
228
|
+
* <li>The user resized the browser window beyond a breakpoint, thus changing the maximum number of columns that can be displayed at once.</li></ul>
|
|
218
229
|
* <br/><br/>
|
|
219
230
|
* <b>Note: </b>The event is suppressed while the control has zero width and will be fired the first time it gets a non-zero width
|
|
220
231
|
*
|
|
@@ -239,13 +250,13 @@ sap.ui.define([
|
|
|
239
250
|
type: "int"
|
|
240
251
|
},
|
|
241
252
|
/**
|
|
242
|
-
* Indicates whether the layout changed as a result of the user clicking a
|
|
253
|
+
* Indicates whether the layout changed as a result of the user clicking a column separator's arrow or dragging the column separators
|
|
243
254
|
*/
|
|
244
255
|
isNavigationArrow: {
|
|
245
256
|
type: "boolean"
|
|
246
257
|
},
|
|
247
258
|
/**
|
|
248
|
-
* Indicates whether the maximum number of columns that can be displayed at once changed
|
|
259
|
+
* Indicates whether the maximum number of columns that can be displayed at once changed due to resize of the entire browser window
|
|
249
260
|
*/
|
|
250
261
|
isResize: {
|
|
251
262
|
type: "boolean"
|
|
@@ -686,6 +697,17 @@ sap.ui.define([
|
|
|
686
697
|
end: 0
|
|
687
698
|
};
|
|
688
699
|
|
|
700
|
+
// Create bound listener functions for keyboard event handling
|
|
701
|
+
this._keyListeners = {
|
|
702
|
+
increase : this._resizeColumnOnKeypress.bind(this, "inc", 1),
|
|
703
|
+
decrease : this._resizeColumnOnKeypress.bind(this, "dec", 1),
|
|
704
|
+
increaseMore : this._resizeColumnOnKeypress.bind(this, "incMore", 2),
|
|
705
|
+
decreaseMore : this._resizeColumnOnKeypress.bind(this, "decMore", 2),
|
|
706
|
+
max : this._resizeColumnOnKeypress.bind(this, "max", 1),
|
|
707
|
+
min : this._resizeColumnOnKeypress.bind(this, "min", 1)
|
|
708
|
+
};
|
|
709
|
+
this._enableKeyboardListeners();
|
|
710
|
+
|
|
689
711
|
this._oInvisibleMessage = null;
|
|
690
712
|
this._boundColumnSeparatorMove = this._onColumnSeparatorMove.bind(this);
|
|
691
713
|
this._boundColumnSeparatorMoveEnd = this._onColumnSeparatorMoveEnd.bind(this);
|
|
@@ -715,6 +737,20 @@ sap.ui.define([
|
|
|
715
737
|
}
|
|
716
738
|
};
|
|
717
739
|
|
|
740
|
+
/**
|
|
741
|
+
* Connects the keyboard event listeners so resizing via keyboard will be possible
|
|
742
|
+
*/
|
|
743
|
+
FlexibleColumnLayout.prototype._enableKeyboardListeners = function() {
|
|
744
|
+
this.onsaprightmodifiers = this._keyListeners.increase;
|
|
745
|
+
this.onsapleftmodifiers = this._keyListeners.decrease;
|
|
746
|
+
this.onsapright = this._keyListeners.increaseMore;
|
|
747
|
+
this.onsapleft = this._keyListeners.decreaseMore;
|
|
748
|
+
this.onsapend = this._keyListeners.max;
|
|
749
|
+
this.onsaphome = this._keyListeners.min;
|
|
750
|
+
|
|
751
|
+
this._keyboardEnabled = true;
|
|
752
|
+
};
|
|
753
|
+
|
|
718
754
|
/**
|
|
719
755
|
* Called on after rendering of the internal <code>NavContainer</code> instances to check their rendered pages
|
|
720
756
|
* @private
|
|
@@ -857,7 +893,7 @@ sap.ui.define([
|
|
|
857
893
|
*/
|
|
858
894
|
FlexibleColumnLayout.prototype._flushColumnContent = function (sColumn) {
|
|
859
895
|
var oControl = this.getAggregation("_" + sColumn + "ColumnNav"),
|
|
860
|
-
oRm =
|
|
896
|
+
oRm = new RenderManager().getInterface();
|
|
861
897
|
|
|
862
898
|
oRm.renderControl(oControl);
|
|
863
899
|
oRm.flush(this._$columns[sColumn].find(".sapFFCLColumnContent")[0], undefined, true);
|
|
@@ -1081,7 +1117,7 @@ sap.ui.define([
|
|
|
1081
1117
|
};
|
|
1082
1118
|
|
|
1083
1119
|
/**
|
|
1084
|
-
* Saves the DOM references of the columns and
|
|
1120
|
+
* Saves the DOM references of the columns and column separators.
|
|
1085
1121
|
* @private
|
|
1086
1122
|
*/
|
|
1087
1123
|
FlexibleColumnLayout.prototype._cacheDOMElements = function () {
|
|
@@ -1302,11 +1338,11 @@ sap.ui.define([
|
|
|
1302
1338
|
sNewWidth = convertPxToCSSSizeString(iNewWidth, this._getControlWidth(), oColumnConfig.shouldInsetColumn),
|
|
1303
1339
|
bAutoSize = oColumnConfig.autoSize,
|
|
1304
1340
|
bAnimationsEnabled = oColumnConfig.hasAnimations,
|
|
1305
|
-
|
|
1341
|
+
bHidden = !iNewWidth,
|
|
1306
1342
|
bResizeColumnWithAnimation = this._canResizeColumnWithAnimation(sColumn, oColumnConfig),
|
|
1307
|
-
bSuspendResizeHandler = bAnimationsEnabled
|
|
1343
|
+
bSuspendResizeHandler = bAnimationsEnabled,
|
|
1308
1344
|
fnAfterResizeCallback = this._afterColumnResize.bind(this, sColumn, merge(oColumnConfig, {
|
|
1309
|
-
resumeResizeHandler: bSuspendResizeHandler // toggle back after resize
|
|
1345
|
+
resumeResizeHandler: bSuspendResizeHandler && !bHidden // toggle back after resize
|
|
1310
1346
|
})),
|
|
1311
1347
|
fnResizeErrorCallback = function() {
|
|
1312
1348
|
ResizeHandler.resume(oColumnDomRef);
|
|
@@ -1345,10 +1381,10 @@ sap.ui.define([
|
|
|
1345
1381
|
}
|
|
1346
1382
|
|
|
1347
1383
|
// For tablet and desktop - notify child controls to render with reduced container size, if they need to
|
|
1348
|
-
if (oColumnConfig.updateContextualSettings && !Device.system.phone) {
|
|
1384
|
+
if (oColumnConfig.updateContextualSettings && !Device.system.phone && iNewWidth) {
|
|
1349
1385
|
this._updateColumnContextualSettings(sColumn, iNewWidth);
|
|
1350
1386
|
}
|
|
1351
|
-
if (oColumnConfig.updateMediaCSSClases && !Device.system.phone) {
|
|
1387
|
+
if (oColumnConfig.updateMediaCSSClases && !Device.system.phone && iNewWidth) {
|
|
1352
1388
|
this._updateColumnCSSClasses(sColumn, iNewWidth);
|
|
1353
1389
|
}
|
|
1354
1390
|
};
|
|
@@ -1373,6 +1409,9 @@ sap.ui.define([
|
|
|
1373
1409
|
iNewWidth = oOptions.width,
|
|
1374
1410
|
bShouldRestoreFocus = oOptions.shouldRestoreFocus;
|
|
1375
1411
|
|
|
1412
|
+
//BCP: 1980006195
|
|
1413
|
+
oColumn.toggleClass("sapFFCLColumnHidden", iNewWidth === 0);
|
|
1414
|
+
|
|
1376
1415
|
if (bShouldRevealColumn || bShouldConcealColumn ) {
|
|
1377
1416
|
oColumn[0].querySelector(".sapFFCLColumnContent").style.width = "";
|
|
1378
1417
|
}
|
|
@@ -1384,9 +1423,6 @@ sap.ui.define([
|
|
|
1384
1423
|
oColumn.removeClass("sapFFCLColumnActive");
|
|
1385
1424
|
}
|
|
1386
1425
|
|
|
1387
|
-
//BCP: 1980006195
|
|
1388
|
-
oColumn.toggleClass("sapFFCLColumnHidden", iNewWidth === 0);
|
|
1389
|
-
|
|
1390
1426
|
if (oOptions.resumeResizeHandler) {
|
|
1391
1427
|
ResizeHandler.resume(oColumn[0]);
|
|
1392
1428
|
}
|
|
@@ -1405,14 +1441,14 @@ sap.ui.define([
|
|
|
1405
1441
|
oColumn = this._$columns[sColumn],
|
|
1406
1442
|
oColumnDomRef = oColumn[0];
|
|
1407
1443
|
|
|
1408
|
-
oColumn.toggleClass(FlexibleColumnLayout.PINNED_COLUMN_CLASS_NAME, bShouldPin);
|
|
1409
|
-
|
|
1410
1444
|
if (bShouldRevealColumn) {
|
|
1411
|
-
oColumnDomRef.querySelector(".sapFFCLColumnContent").style.width =
|
|
1445
|
+
oColumnDomRef.querySelector(".sapFFCLColumnContent").style.width = oColumnWidths[sColumn] + "px";
|
|
1412
1446
|
} else if (bShouldConcealColumn) {
|
|
1413
1447
|
oColumnDomRef.querySelector(".sapFFCLColumnContent").style.width = oColumnDomRef.offsetWidth + "px";
|
|
1414
1448
|
}
|
|
1415
1449
|
|
|
1450
|
+
oColumn.toggleClass(FlexibleColumnLayout.PINNED_COLUMN_CLASS_NAME, bShouldPin);
|
|
1451
|
+
|
|
1416
1452
|
}, this);
|
|
1417
1453
|
};
|
|
1418
1454
|
|
|
@@ -1443,7 +1479,7 @@ sap.ui.define([
|
|
|
1443
1479
|
};
|
|
1444
1480
|
|
|
1445
1481
|
FlexibleColumnLayout.prototype._getDefaultResizeOptions = function () {
|
|
1446
|
-
var sAnimationMode =
|
|
1482
|
+
var sAnimationMode = ControlBehavior.getAnimationMode();
|
|
1447
1483
|
return {
|
|
1448
1484
|
layout: this.getLayout(),
|
|
1449
1485
|
previousLayout: this._getPreviousLayout(),
|
|
@@ -1461,7 +1497,7 @@ sap.ui.define([
|
|
|
1461
1497
|
|
|
1462
1498
|
FlexibleColumnLayout.prototype._addDetailedActiveClasses = function (sLayout) {
|
|
1463
1499
|
var aColumns = FlexibleColumnLayout.COLUMN_ORDER.slice(),
|
|
1464
|
-
bRtl =
|
|
1500
|
+
bRtl = Localization.getRTL(),
|
|
1465
1501
|
aActiveColumns = aColumns.filter(function (sColumn) {
|
|
1466
1502
|
return this._getColumnSizeForLayout(sColumn, sLayout) > 0;
|
|
1467
1503
|
}, this);
|
|
@@ -1480,12 +1516,62 @@ sap.ui.define([
|
|
|
1480
1516
|
}
|
|
1481
1517
|
};
|
|
1482
1518
|
|
|
1519
|
+
FlexibleColumnLayout.prototype._resizeColumnOnKeypress = function (sType, iStepSize, oEvent) {
|
|
1520
|
+
|
|
1521
|
+
var oSeparator = this._getColumnSeparator(oEvent.target),
|
|
1522
|
+
iStartX, iEndX;
|
|
1523
|
+
|
|
1524
|
+
if (!oSeparator) {
|
|
1525
|
+
return;
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
var iBigStep = this._getControlWidth();
|
|
1529
|
+
|
|
1530
|
+
var iStep = 0;
|
|
1531
|
+
switch (sType) {
|
|
1532
|
+
case "inc":
|
|
1533
|
+
iStep = iStepSize;
|
|
1534
|
+
break;
|
|
1535
|
+
|
|
1536
|
+
case "incMore":
|
|
1537
|
+
iStep = iStepSize * 10;
|
|
1538
|
+
break;
|
|
1539
|
+
|
|
1540
|
+
case "dec":
|
|
1541
|
+
iStep = 0 - iStepSize;
|
|
1542
|
+
break;
|
|
1543
|
+
|
|
1544
|
+
case "decMore":
|
|
1545
|
+
iStep = 0 - iStepSize * 10;
|
|
1546
|
+
break;
|
|
1547
|
+
|
|
1548
|
+
case "max":
|
|
1549
|
+
iStep = iBigStep;
|
|
1550
|
+
break;
|
|
1551
|
+
|
|
1552
|
+
case "min":
|
|
1553
|
+
iStep = 0 - iBigStep;
|
|
1554
|
+
break;
|
|
1555
|
+
|
|
1556
|
+
default:
|
|
1557
|
+
Log.warn("[FlexibleColumnLayout] Invalid keyboard resize type");
|
|
1558
|
+
break;
|
|
1559
|
+
}
|
|
1560
|
+
|
|
1561
|
+
iStartX = oSeparator && oSeparator.getBoundingClientRect().x;
|
|
1562
|
+
iEndX = iStartX + iStep;
|
|
1563
|
+
|
|
1564
|
+
this._onColumnSeparatorMoveStart({pageX: iStartX}, oSeparator);
|
|
1565
|
+
this._onColumnSeparatorMove({pageX: iEndX});
|
|
1566
|
+
this._onColumnSeparatorMoveEnd({pageX: iEndX});
|
|
1567
|
+
};
|
|
1568
|
+
|
|
1483
1569
|
FlexibleColumnLayout.prototype._onColumnSeparatorMoveStart = function (oEvent, oSeparator, bTouch) {
|
|
1484
1570
|
// needed to position the separator presizely
|
|
1485
|
-
var bRtl =
|
|
1571
|
+
var bRtl = Localization.getRTL(),
|
|
1486
1572
|
iStartOffset = this._getDraggedSeparatorStartOffset(oSeparator, bRtl);
|
|
1487
1573
|
|
|
1488
|
-
this.
|
|
1574
|
+
this._oMoveInfo = {
|
|
1489
1575
|
cursorStartX: oEvent.pageX,
|
|
1490
1576
|
cursorX: oEvent.pageX, // the mouse/finger position-x
|
|
1491
1577
|
columnWidths: {
|
|
@@ -1518,16 +1604,16 @@ sap.ui.define([
|
|
|
1518
1604
|
}
|
|
1519
1605
|
|
|
1520
1606
|
var iCursonX = getCursorPositionX(oEvent);
|
|
1521
|
-
this.
|
|
1607
|
+
this._previewResizedColumnsOnMoveSeparator(iCursonX);
|
|
1522
1608
|
};
|
|
1523
1609
|
|
|
1524
1610
|
FlexibleColumnLayout.prototype._onColumnSeparatorMoveEnd = function (oEvent) {
|
|
1525
1611
|
var iCursonX = getCursorPositionX(oEvent);
|
|
1526
|
-
this.
|
|
1612
|
+
this._previewResizedColumnsOnMoveSeparator(iCursonX, true /* resize end */);
|
|
1527
1613
|
this._saveResizedColumWidths();
|
|
1528
1614
|
|
|
1529
|
-
if (this.
|
|
1530
|
-
this.setLayout(this.
|
|
1615
|
+
if (this._oMoveInfo.layout !== this.getLayout()) {
|
|
1616
|
+
this.setLayout(this._oMoveInfo.layout);
|
|
1531
1617
|
this._fireStateChange(true, false);
|
|
1532
1618
|
}
|
|
1533
1619
|
|
|
@@ -1561,11 +1647,11 @@ sap.ui.define([
|
|
|
1561
1647
|
};
|
|
1562
1648
|
|
|
1563
1649
|
FlexibleColumnLayout.prototype._enterInteractiveResizeMode = function (bTouch) {
|
|
1564
|
-
var oSeparatorPosition = this.
|
|
1650
|
+
var oSeparatorPosition = this._oMoveInfo.separatorPosition;
|
|
1565
1651
|
|
|
1566
1652
|
this._$overlay.css("display", "block");
|
|
1567
1653
|
this._$overlaySeparator.css(oSeparatorPosition.direction, oSeparatorPosition.x);
|
|
1568
|
-
this.
|
|
1654
|
+
this._oMoveInfo.separator.style.visibility = "hidden";
|
|
1569
1655
|
|
|
1570
1656
|
if (bTouch) {
|
|
1571
1657
|
document.addEventListener("touchend", this._boundColumnSeparatorMoveEnd);
|
|
@@ -1578,63 +1664,63 @@ sap.ui.define([
|
|
|
1578
1664
|
|
|
1579
1665
|
FlexibleColumnLayout.prototype._exitInteractiveResizeMode = function () {
|
|
1580
1666
|
this._$overlay.css("display", "");
|
|
1581
|
-
this.
|
|
1582
|
-
this.
|
|
1667
|
+
this._oMoveInfo.separator.style.visibility = "";
|
|
1668
|
+
this._oMoveInfo.separator.focus();
|
|
1583
1669
|
this._ignoreMouse = false;
|
|
1584
1670
|
this._ignoreTouch = false;
|
|
1585
|
-
this.
|
|
1671
|
+
this._oMoveInfo = null;
|
|
1586
1672
|
document.removeEventListener("mouseup", this._boundColumnSeparatorMoveEnd);
|
|
1587
1673
|
document.removeEventListener("mousemove", this._boundColumnSeparatorMove);
|
|
1588
1674
|
document.removeEventListener("touchend", this._boundColumnSeparatorMoveEnd);
|
|
1589
1675
|
document.removeEventListener("touchmove", this._boundColumnSeparatorMove);
|
|
1590
1676
|
};
|
|
1591
1677
|
|
|
1592
|
-
FlexibleColumnLayout.prototype.
|
|
1678
|
+
FlexibleColumnLayout.prototype._previewResizedColumnsOnMoveSeparator = function (cursorX, bIsResizeEnd) {
|
|
1593
1679
|
var getPositionOffset = function (iOldCursorX) {
|
|
1594
1680
|
var iOffset = cursorX - iOldCursorX;
|
|
1595
|
-
return this.
|
|
1681
|
+
return this._oMoveInfo.rtl ? -iOffset : iOffset;
|
|
1596
1682
|
}.bind(this);
|
|
1597
1683
|
|
|
1598
|
-
this.
|
|
1599
|
-
this.
|
|
1600
|
-
this.
|
|
1684
|
+
this._oMoveInfo.offsetFromPreviousPosition = getPositionOffset(this._oMoveInfo.cursorX);
|
|
1685
|
+
this._oMoveInfo.offsetFromStartPosition = getPositionOffset(this._oMoveInfo.cursorStartX);
|
|
1686
|
+
this._oMoveInfo.cursorX = cursorX;
|
|
1601
1687
|
|
|
1602
|
-
if (!this.
|
|
1688
|
+
if (!this._oMoveInfo.offsetFromStartPosition) {
|
|
1603
1689
|
return;
|
|
1604
1690
|
}
|
|
1605
1691
|
|
|
1606
|
-
if (!this.
|
|
1692
|
+
if (!this._oMoveInfo.offsetFromPreviousPosition && !bIsResizeEnd) {
|
|
1607
1693
|
return;
|
|
1608
1694
|
}
|
|
1609
1695
|
|
|
1610
|
-
var aResizedColumns = getInteractivelyResizedColumns(this.
|
|
1611
|
-
sSeparator = getSeparatorName(this.
|
|
1612
|
-
bForwardResizeDirection = this.
|
|
1696
|
+
var aResizedColumns = getInteractivelyResizedColumns(this._oMoveInfo.separator, this._oMoveInfo.layout, this.getMaxColumnsCount()),
|
|
1697
|
+
sSeparator = getSeparatorName(this._oMoveInfo.separator),
|
|
1698
|
+
bForwardResizeDirection = this._oMoveInfo.offsetFromStartPosition > 0,
|
|
1613
1699
|
sColumnEnlargedByDragging = aResizedColumns[bForwardResizeDirection ? 0 : 1],
|
|
1614
1700
|
iSeparatorsCount = this._getVisibleColumnSeparatorsCount(),
|
|
1615
1701
|
iSeparatorsCountDiff = 0,
|
|
1616
1702
|
iOffsetOnSeparatorsCountChange = 0,
|
|
1617
1703
|
iOffsetOnColumnWidthNormalization,
|
|
1618
|
-
sPreviousLayout = this.
|
|
1704
|
+
sPreviousLayout = this._oMoveInfo.layout,
|
|
1619
1705
|
sLayout,
|
|
1620
1706
|
bLayoutChange,
|
|
1621
1707
|
oNewColumnWidths,
|
|
1622
1708
|
bResizeWithPinning;
|
|
1623
1709
|
|
|
1624
|
-
this.
|
|
1625
|
-
this.
|
|
1626
|
-
this.
|
|
1710
|
+
this._oMoveInfo.columnWidths[aResizedColumns[0]] += this._oMoveInfo.offsetFromPreviousPosition;
|
|
1711
|
+
this._oMoveInfo.columnWidths[aResizedColumns[1]] -= this._oMoveInfo.offsetFromPreviousPosition;
|
|
1712
|
+
this._oMoveInfo.columnEnlargedByDragging = sColumnEnlargedByDragging;
|
|
1627
1713
|
|
|
1628
|
-
oNewColumnWidths = merge({}, this.
|
|
1714
|
+
oNewColumnWidths = merge({}, this._oMoveInfo.columnWidths);
|
|
1629
1715
|
|
|
1630
1716
|
// if some column is below min allowed width => expand it
|
|
1631
1717
|
this._normalizeColumnWidths(oNewColumnWidths, aResizedColumns);
|
|
1632
1718
|
|
|
1633
1719
|
// if normalization led to width change of some column => the column separator will be offset
|
|
1634
|
-
iOffsetOnColumnWidthNormalization = this.
|
|
1720
|
+
iOffsetOnColumnWidthNormalization = this._oMoveInfo.columnWidths[aResizedColumns[1]] - oNewColumnWidths[aResizedColumns[1]];
|
|
1635
1721
|
|
|
1636
1722
|
// update the dragged separator to match the new mouse/touch position
|
|
1637
|
-
this._offsetDraggedColumnSeparator(this.
|
|
1723
|
+
this._offsetDraggedColumnSeparator(this._oMoveInfo.offsetFromPreviousPosition + iOffsetOnColumnWidthNormalization);
|
|
1638
1724
|
|
|
1639
1725
|
// if the user drags to expand a hidden column, show its content
|
|
1640
1726
|
this._toggleColumnVisibility(sColumnEnlargedByDragging, true);
|
|
@@ -1665,30 +1751,40 @@ sap.ui.define([
|
|
|
1665
1751
|
columnEnlargedByDragging: sColumnEnlargedByDragging
|
|
1666
1752
|
});
|
|
1667
1753
|
|
|
1668
|
-
this.
|
|
1754
|
+
this._oMoveInfo.layout = sLayout;
|
|
1669
1755
|
// allow compute dragging direction relative to the last layout
|
|
1670
|
-
this.
|
|
1756
|
+
this._oMoveInfo.cursorStartX = cursorX;
|
|
1671
1757
|
}
|
|
1672
1758
|
|
|
1673
|
-
this.
|
|
1759
|
+
this._oMoveInfo.columnWidths = oNewColumnWidths;
|
|
1674
1760
|
|
|
1675
|
-
if (bResizeWithPinning) {
|
|
1761
|
+
if (bResizeWithPinning || bIsResizeEnd) {
|
|
1676
1762
|
// call the dedicated function in order to resize with reveal/conceal effect
|
|
1763
|
+
// or update CSS classes on resizeEnd
|
|
1677
1764
|
this._resizeColumns({
|
|
1678
1765
|
columnWidths: oNewColumnWidths,
|
|
1679
1766
|
layout: sLayout,
|
|
1680
1767
|
previousLayout: sPreviousLayout,
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
updateDetailedActiveClasses: false,
|
|
1768
|
+
updateMediaCSSClases: bIsResizeEnd,
|
|
1769
|
+
updateDetailedActiveClasses: bIsResizeEnd,
|
|
1684
1770
|
restoreFocusOnBackNavigation: false
|
|
1685
1771
|
});
|
|
1686
1772
|
} else {
|
|
1687
1773
|
// only offset the rendered columns
|
|
1688
1774
|
// skip mid column as it has width: 100% by default (to allow the mid column
|
|
1689
1775
|
// take the space that remains after sizing its sibling columns)
|
|
1690
|
-
this._$columns.begin.css("width", this.
|
|
1691
|
-
this._$columns.end.css("width", this.
|
|
1776
|
+
this._$columns.begin.css("width", this._oMoveInfo.columnWidths.begin + "px");
|
|
1777
|
+
this._$columns.end.css("width", this._oMoveInfo.columnWidths.end + "px");
|
|
1778
|
+
aResizedColumns.forEach(function(sColumn) {
|
|
1779
|
+
this._updateColumnContextualSettings(sColumn, this._oMoveInfo.columnWidths[sColumn]);
|
|
1780
|
+
}, this);
|
|
1781
|
+
}
|
|
1782
|
+
|
|
1783
|
+
if (bLayoutChange) {
|
|
1784
|
+
this.fireEvent("_liveStateChange", {
|
|
1785
|
+
layout: sLayout,
|
|
1786
|
+
maxColumnsCount: this.getMaxColumnsCount()
|
|
1787
|
+
});
|
|
1692
1788
|
}
|
|
1693
1789
|
};
|
|
1694
1790
|
|
|
@@ -1747,9 +1843,9 @@ sap.ui.define([
|
|
|
1747
1843
|
};
|
|
1748
1844
|
|
|
1749
1845
|
FlexibleColumnLayout.prototype._offsetDraggedColumnSeparator = function (iOffset) {
|
|
1750
|
-
this.
|
|
1751
|
-
this._$overlaySeparator.css(this.
|
|
1752
|
-
this.
|
|
1846
|
+
this._oMoveInfo.separatorPosition.x += iOffset;
|
|
1847
|
+
this._$overlaySeparator.css(this._oMoveInfo.separatorPosition.direction,
|
|
1848
|
+
this._oMoveInfo.separatorPosition.x);
|
|
1753
1849
|
};
|
|
1754
1850
|
|
|
1755
1851
|
FlexibleColumnLayout.prototype._toggleColumnVisibility = function (sColumn, bShow) {
|
|
@@ -1813,12 +1909,12 @@ sap.ui.define([
|
|
|
1813
1909
|
* @returns {boolean} the flag
|
|
1814
1910
|
*/
|
|
1815
1911
|
FlexibleColumnLayout.prototype._isColumnAllowedToHaveBelowMinWidth = function (sColumn) {
|
|
1816
|
-
if (!this.
|
|
1912
|
+
if (!this._oMoveInfo) {
|
|
1817
1913
|
// outside interactive resize the min-width restriction should always be valid
|
|
1818
1914
|
return false;
|
|
1819
1915
|
}
|
|
1820
1916
|
|
|
1821
|
-
if (sColumn === this.
|
|
1917
|
+
if (sColumn === this._oMoveInfo.columnEnlargedByDragging) {
|
|
1822
1918
|
// the user us revealing a hidden column by dragging
|
|
1823
1919
|
// its ajacent separator => do not yet expand the column to min-width
|
|
1824
1920
|
// untill the user stops dragging, to prevent undesired visual jump
|
|
@@ -1898,8 +1994,8 @@ sap.ui.define([
|
|
|
1898
1994
|
};
|
|
1899
1995
|
|
|
1900
1996
|
FlexibleColumnLayout.prototype._saveResizedColumWidths = function() {
|
|
1901
|
-
var sNewLayout = this.
|
|
1902
|
-
oColumnPercentWidths = this._convertColumnPxWidthToPercent(this.
|
|
1997
|
+
var sNewLayout = this._oMoveInfo.layout,
|
|
1998
|
+
oColumnPercentWidths = this._convertColumnPxWidthToPercent(this._oMoveInfo.columnWidths, sNewLayout),
|
|
1903
1999
|
sNewWidthsDistribution = Object.values(oColumnPercentWidths).join("/");
|
|
1904
2000
|
|
|
1905
2001
|
if (this._isValidWidthDistributionForLayout(sNewWidthsDistribution, sNewLayout)) {
|
|
@@ -2135,23 +2231,30 @@ sap.ui.define([
|
|
|
2135
2231
|
var iVisibleColumnsCount = this._getMaxColumnsCountForLayout(sLayout, FlexibleColumnLayout.DESKTOP_BREAKPOINT),
|
|
2136
2232
|
sLastVisibleColumn = this._getLastVisibleColumnForLayout(sLayout),
|
|
2137
2233
|
bIsLastColumn = sColumn === sLastVisibleColumn,
|
|
2234
|
+
sPreviousLastVisibleColumn = this._getLastVisibleColumnForLayout(sPreviousLayout),
|
|
2138
2235
|
iPreviousVisibleColumnsCount = this._getMaxColumnsCountForLayout(sPreviousLayout, FlexibleColumnLayout.DESKTOP_BREAKPOINT),
|
|
2139
|
-
bWasFullScreen = (sPreviousLayout
|
|
2236
|
+
bWasFullScreen = this._isFullScreenLayout(sPreviousLayout),
|
|
2237
|
+
bIsFullscreen = this._isFullScreenLayout(sLayout);
|
|
2238
|
+
|
|
2239
|
+
return ((iVisibleColumnsCount > iPreviousVisibleColumnsCount)
|
|
2240
|
+
&& !(sPreviousLayout === LT.MidColumnFullScreen || sPreviousLayout === LT.EndColumnFullScreen)
|
|
2241
|
+
&& bIsLastColumn
|
|
2242
|
+
|| (bWasFullScreen && bIsFullscreen && sPreviousLastVisibleColumn !== sColumn && bIsLastColumn));
|
|
2243
|
+
};
|
|
2140
2244
|
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
bIsLastColumn;
|
|
2245
|
+
FlexibleColumnLayout.prototype._isFullScreenLayout = function (sLayout) {
|
|
2246
|
+
return sLayout === LT.OneColumn || sLayout === LT.MidColumnFullScreen || sLayout === LT.EndColumnFullScreen;
|
|
2144
2247
|
};
|
|
2145
2248
|
|
|
2146
2249
|
FlexibleColumnLayout.prototype._isInteractivelyResizedColumn = function (sColumn) {
|
|
2147
|
-
return this.
|
|
2250
|
+
return this._oMoveInfo && this._isColumnAdjacentToDraggedSeparator(sColumn);
|
|
2148
2251
|
};
|
|
2149
2252
|
|
|
2150
2253
|
FlexibleColumnLayout.prototype._isColumnAdjacentToDraggedSeparator = function (sColumn) {
|
|
2151
|
-
return this.
|
|
2152
|
-
this.
|
|
2153
|
-
(this._$columns[sColumn][0] === this.
|
|
2154
|
-
this._$columns[sColumn][0] === this.
|
|
2254
|
+
return this._oMoveInfo &&
|
|
2255
|
+
this._oMoveInfo.separator &&
|
|
2256
|
+
(this._$columns[sColumn][0] === this._oMoveInfo.separator.previousElementSibling ||
|
|
2257
|
+
this._$columns[sColumn][0] === this._oMoveInfo.separator.nextElementSibling);
|
|
2155
2258
|
};
|
|
2156
2259
|
|
|
2157
2260
|
/**
|
|
@@ -2167,12 +2270,15 @@ sap.ui.define([
|
|
|
2167
2270
|
var iVisibleColumnsCount = this._getMaxColumnsCountForLayout(sLayout, FlexibleColumnLayout.DESKTOP_BREAKPOINT),
|
|
2168
2271
|
iPreviousVisibleColumnsCount = this._getMaxColumnsCountForLayout(sPreviousLayout, FlexibleColumnLayout.DESKTOP_BREAKPOINT),
|
|
2169
2272
|
sPreviousLastVisibleColumn = this._getLastVisibleColumnForLayout(sPreviousLayout),
|
|
2170
|
-
|
|
2273
|
+
sLastVisibleColumn = this._getLastVisibleColumnForLayout(sLayout),
|
|
2274
|
+
bWasFullScreen = this._isFullScreenLayout(sPreviousLayout),
|
|
2275
|
+
bIsFullscreen = this._isFullScreenLayout(sLayout);
|
|
2171
2276
|
|
|
2172
|
-
return (iVisibleColumnsCount < iPreviousVisibleColumnsCount
|
|
2277
|
+
return ((iVisibleColumnsCount < iPreviousVisibleColumnsCount
|
|
2173
2278
|
&& sColumn === sPreviousLastVisibleColumn
|
|
2174
|
-
&& !
|
|
2175
|
-
&& this._getColumnSizeForLayout(sColumn, sLayout) === 0)
|
|
2279
|
+
&& !(sPreviousLayout === LT.MidColumnFullScreen || sPreviousLayout === LT.EndColumnFullScreen)
|
|
2280
|
+
&& this._getColumnSizeForLayout(sColumn, sLayout) === 0)
|
|
2281
|
+
|| (bWasFullScreen && bIsFullscreen && sColumn !== sLastVisibleColumn && sPreviousLastVisibleColumn === sColumn));
|
|
2176
2282
|
};
|
|
2177
2283
|
|
|
2178
2284
|
/**
|
|
@@ -2361,7 +2467,7 @@ sap.ui.define([
|
|
|
2361
2467
|
// Always resize the columns when the browser is resized
|
|
2362
2468
|
this._resizeColumns();
|
|
2363
2469
|
|
|
2364
|
-
//
|
|
2470
|
+
// only fire the event if the maximum number of columns that can be shown has changed
|
|
2365
2471
|
if (iMaxColumnsCount !== iOldMaxColumnsCount) {
|
|
2366
2472
|
this._fireStateChange(false, true);
|
|
2367
2473
|
}
|
|
@@ -2405,7 +2511,7 @@ sap.ui.define([
|
|
|
2405
2511
|
|
|
2406
2512
|
iMaxColumnsCount = this.getMaxColumnsCount();
|
|
2407
2513
|
|
|
2408
|
-
// Only show
|
|
2514
|
+
// Only show separators if 2 or 3 columns can be displayed at a time
|
|
2409
2515
|
if (iMaxColumnsCount > 1) {
|
|
2410
2516
|
oMap[LT.TwoColumnsBeginExpanded] = ["begin"];
|
|
2411
2517
|
oMap[LT.TwoColumnsMidExpanded] = ["begin"];
|
|
@@ -2431,7 +2537,7 @@ sap.ui.define([
|
|
|
2431
2537
|
var aNeededSeparators = [],
|
|
2432
2538
|
bIsNavContainersContentRendered;
|
|
2433
2539
|
|
|
2434
|
-
// Stop here if the control isn't rendered yet or in phone mode, where
|
|
2540
|
+
// Stop here if the control isn't rendered yet or in phone mode, where separators aren't necessary
|
|
2435
2541
|
if (!this.isActive() || Device.system.phone) {
|
|
2436
2542
|
return;
|
|
2437
2543
|
}
|
|
@@ -2459,7 +2565,7 @@ sap.ui.define([
|
|
|
2459
2565
|
this._oColumnSeparators[sKey].data("visible", bShow);
|
|
2460
2566
|
};
|
|
2461
2567
|
|
|
2462
|
-
FlexibleColumnLayout.prototype._fireStateChange = function (
|
|
2568
|
+
FlexibleColumnLayout.prototype._fireStateChange = function (bIsColumnSeparatorInteraction, bIsResize) {
|
|
2463
2569
|
|
|
2464
2570
|
// The event should not be fired if the control has zero width as all relevant layout calculations are size-based
|
|
2465
2571
|
if (this._getControlWidth() === 0) {
|
|
@@ -2467,7 +2573,7 @@ sap.ui.define([
|
|
|
2467
2573
|
}
|
|
2468
2574
|
|
|
2469
2575
|
this.fireStateChange({
|
|
2470
|
-
isNavigationArrow:
|
|
2576
|
+
isNavigationArrow: bIsColumnSeparatorInteraction,
|
|
2471
2577
|
isResize: bIsResize,
|
|
2472
2578
|
layout: this.getLayout(),
|
|
2473
2579
|
maxColumnsCount: this.getMaxColumnsCount()
|
|
@@ -2863,14 +2969,14 @@ sap.ui.define([
|
|
|
2863
2969
|
/**
|
|
2864
2970
|
* Returns a string, representing the relative percentage sizes of the columns for the given layout in the format "begin/mid/end" (f.e. "33/67/0")
|
|
2865
2971
|
* @param {string} sLayout - the layout
|
|
2866
|
-
* @param {boolean}
|
|
2972
|
+
* @param {boolean} bAsIntArray - return an array in the format [33, 67, 0] instead of a string "33/67/0"
|
|
2867
2973
|
* @param {number} [iMaxColumnsCount] the maximun number of columns. If not provided, the result of
|
|
2868
2974
|
* <code>getMaxColumnsCount</code> will be taken
|
|
2869
2975
|
* @returns {string|array}
|
|
2870
2976
|
* @private
|
|
2871
2977
|
* @ui5-restricted sap.f.FlexibleColumnLayoutSemanticHelper
|
|
2872
2978
|
*/
|
|
2873
|
-
FlexibleColumnLayout.prototype._getColumnWidthDistributionForLayout = function (sLayout,
|
|
2979
|
+
FlexibleColumnLayout.prototype._getColumnWidthDistributionForLayout = function (sLayout, bAsIntArray, iMaxColumnsCount) {
|
|
2874
2980
|
var sColumnWidthDistribution = this._getLocalStorage(iMaxColumnsCount).get(sLayout),
|
|
2875
2981
|
vResult;
|
|
2876
2982
|
|
|
@@ -2887,10 +2993,11 @@ sap.ui.define([
|
|
|
2887
2993
|
vResult = this._getDefaultColumnWidthDistributionForLayout(sLayout, iMaxColumnsCount);
|
|
2888
2994
|
}
|
|
2889
2995
|
|
|
2890
|
-
if (
|
|
2996
|
+
if (bAsIntArray) {
|
|
2891
2997
|
vResult = vResult.split("/").map(function (sColumnWidth) {
|
|
2892
|
-
return
|
|
2998
|
+
return Math.round(parseFloat(sColumnWidth));
|
|
2893
2999
|
});
|
|
3000
|
+
normalizeColumnPercentWidths(vResult);
|
|
2894
3001
|
}
|
|
2895
3002
|
|
|
2896
3003
|
return vResult;
|
|
@@ -2971,7 +3078,7 @@ sap.ui.define([
|
|
|
2971
3078
|
* @returns {Object} the resource bundle object
|
|
2972
3079
|
*/
|
|
2973
3080
|
FlexibleColumnLayout._getResourceBundle = function () {
|
|
2974
|
-
return
|
|
3081
|
+
return Library.getResourceBundleFor("sap.f");
|
|
2975
3082
|
};
|
|
2976
3083
|
|
|
2977
3084
|
|
|
@@ -3081,7 +3188,7 @@ sap.ui.define([
|
|
|
3081
3188
|
LayoutHistory.prototype.getEntry = function (iIndex, bRecentFirst) {
|
|
3082
3189
|
var aHistory = this._aLayoutHistory;
|
|
3083
3190
|
if (bRecentFirst) {
|
|
3084
|
-
aHistory = this._aLayoutHistory.
|
|
3191
|
+
aHistory = this._aLayoutHistory.slice().reverse();
|
|
3085
3192
|
}
|
|
3086
3193
|
return aHistory[iIndex];
|
|
3087
3194
|
};
|
|
@@ -3278,6 +3385,29 @@ sap.ui.define([
|
|
|
3278
3385
|
return oConfig.pageX;
|
|
3279
3386
|
}
|
|
3280
3387
|
|
|
3388
|
+
/**
|
|
3389
|
+
* Ensures the sum of all column percent widths is 100.
|
|
3390
|
+
* (Used after converting all the column widths from floats to integers,
|
|
3391
|
+
* to avoid inconsistency of the final sum due to rounding.)
|
|
3392
|
+
*
|
|
3393
|
+
* @param {object} aColumnPercentWidths the percent widths of all three columns
|
|
3394
|
+
*/
|
|
3395
|
+
function normalizeColumnPercentWidths(aColumnPercentWidths) {
|
|
3396
|
+
var oColumnIndex = {
|
|
3397
|
+
begin: 0,
|
|
3398
|
+
mid: 1,
|
|
3399
|
+
end: 2
|
|
3400
|
+
},
|
|
3401
|
+
iSum = aColumnPercentWidths.reduce((a, b) => a + b, 0);
|
|
3402
|
+
if (iSum !== 100) {
|
|
3403
|
+
// the CSS of the mid column always causes it take the space that remained
|
|
3404
|
+
// after sizing the begin and end columns
|
|
3405
|
+
aColumnPercentWidths[oColumnIndex.mid] = 100 -
|
|
3406
|
+
(aColumnPercentWidths[oColumnIndex.begin] + aColumnPercentWidths[oColumnIndex.end]);
|
|
3407
|
+
}
|
|
3408
|
+
}
|
|
3409
|
+
|
|
3410
|
+
|
|
3281
3411
|
return FlexibleColumnLayout;
|
|
3282
3412
|
|
|
3283
3413
|
});
|