@openui5/sap.ui.table 1.123.1 → 1.124.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/.eslintrc.json +9 -1
- package/package.json +3 -3
- package/src/sap/ui/table/.library +1 -1
- package/src/sap/ui/table/AnalyticalColumn.js +40 -40
- package/src/sap/ui/table/AnalyticalColumnMenu.js +11 -11
- package/src/sap/ui/table/AnalyticalTable.js +107 -107
- package/src/sap/ui/table/Column.js +83 -83
- package/src/sap/ui/table/ColumnMenu.js +54 -54
- package/src/sap/ui/table/CreationRow.js +29 -29
- package/src/sap/ui/table/CreationRowRenderer.js +21 -21
- package/src/sap/ui/table/Row.js +55 -56
- package/src/sap/ui/table/RowAction.js +27 -27
- package/src/sap/ui/table/RowActionItem.js +7 -7
- package/src/sap/ui/table/RowActionRenderer.js +3 -3
- package/src/sap/ui/table/RowSettings.js +28 -37
- package/src/sap/ui/table/Table.js +263 -266
- package/src/sap/ui/table/TablePersoController.js +46 -46
- package/src/sap/ui/table/TableRenderer.js +112 -113
- package/src/sap/ui/table/TreeTable.js +16 -16
- package/src/sap/ui/table/designtime/Table.designtime.js +2 -2
- package/src/sap/ui/table/extensions/Accessibility.js +185 -181
- package/src/sap/ui/table/extensions/AccessibilityRender.js +15 -15
- package/src/sap/ui/table/extensions/DragAndDrop.js +47 -47
- package/src/sap/ui/table/extensions/ExtensionBase.js +9 -9
- package/src/sap/ui/table/extensions/Keyboard.js +40 -40
- package/src/sap/ui/table/extensions/KeyboardDelegate.js +257 -264
- package/src/sap/ui/table/extensions/Pointer.js +108 -109
- package/src/sap/ui/table/extensions/Scrolling.js +289 -285
- package/src/sap/ui/table/extensions/ScrollingIOS.js +50 -50
- package/src/sap/ui/table/extensions/Synchronization.js +32 -32
- package/src/sap/ui/table/library.js +12 -12
- package/src/sap/ui/table/menus/ColumnHeaderMenuAdapter.js +9 -9
- package/src/sap/ui/table/menus/LegacyColumnMenuAdapter.js +35 -37
- package/src/sap/ui/table/menus/MobileColumnHeaderMenuAdapter.js +23 -23
- package/src/sap/ui/table/messagebundle_sh.properties +9 -9
- package/src/sap/ui/table/plugins/BindingSelection.js +26 -25
- package/src/sap/ui/table/plugins/MultiSelectionPlugin.js +77 -32
- package/src/sap/ui/table/plugins/ODataV4Selection.js +81 -35
- package/src/sap/ui/table/plugins/PluginBase.js +12 -12
- package/src/sap/ui/table/plugins/SelectionModelSelection.js +13 -12
- package/src/sap/ui/table/plugins/SelectionPlugin.js +3 -3
- package/src/sap/ui/table/plugins/V4Aggregation.js +38 -38
- package/src/sap/ui/table/rowmodes/Auto.js +59 -61
- package/src/sap/ui/table/rowmodes/Fixed.js +18 -18
- package/src/sap/ui/table/rowmodes/Interactive.js +42 -44
- package/src/sap/ui/table/rowmodes/RowMode.js +64 -63
- package/src/sap/ui/table/rowmodes/Type.js +1 -1
- package/src/sap/ui/table/rowmodes/Variable.js +4 -4
- package/src/sap/ui/table/rules/Accessibility.support.js +15 -16
- package/src/sap/ui/table/rules/Binding.support.js +11 -11
- package/src/sap/ui/table/rules/ColumnTemplate.support.js +10 -10
- package/src/sap/ui/table/rules/Plugins.support.js +7 -7
- package/src/sap/ui/table/rules/Rows.support.js +29 -29
- package/src/sap/ui/table/rules/TableHelper.support.js +10 -10
- package/src/sap/ui/table/themes/base/library.source.less +2 -0
- package/src/sap/ui/table/utils/TableUtils.js +130 -128
- package/src/sap/ui/table/utils/_BindingUtils.js +7 -7
- package/src/sap/ui/table/utils/_ColumnUtils.js +98 -97
- package/src/sap/ui/table/utils/_GroupingUtils.js +56 -56
- package/src/sap/ui/table/utils/_HookUtils.js +26 -26
- package/src/sap/ui/table/utils/_MenuUtils.js +19 -19
|
@@ -27,14 +27,14 @@ sap.ui.define([
|
|
|
27
27
|
* @class Implements the selection methods for a table.
|
|
28
28
|
* @extends sap.ui.core.Element
|
|
29
29
|
* @author SAP SE
|
|
30
|
-
* @version 1.
|
|
30
|
+
* @version 1.124.0
|
|
31
31
|
* @public
|
|
32
32
|
* @since 1.64
|
|
33
33
|
* @experimental As of version 1.64
|
|
34
34
|
* @alias sap.ui.table.plugins.SelectionPlugin
|
|
35
35
|
* @borrows sap.ui.table.plugins.PluginBase.findOn as findOn
|
|
36
36
|
*/
|
|
37
|
-
|
|
37
|
+
const SelectionPlugin = PluginBase.extend("sap.ui.table.plugins.SelectionPlugin", {metadata: {
|
|
38
38
|
"abstract": true,
|
|
39
39
|
library: "sap.ui.table",
|
|
40
40
|
properties: {
|
|
@@ -57,7 +57,7 @@ sap.ui.define([
|
|
|
57
57
|
SelectionPlugin.findOn = PluginBase.findOn;
|
|
58
58
|
|
|
59
59
|
SelectionPlugin.prototype.setParent = function(oParent) {
|
|
60
|
-
|
|
60
|
+
const oTable = this.getTable();
|
|
61
61
|
|
|
62
62
|
PluginBase.prototype.setParent.apply(this, arguments);
|
|
63
63
|
(oParent || oTable)._initSelectionPlugin();
|
|
@@ -15,8 +15,8 @@ sap.ui.define([
|
|
|
15
15
|
"use strict";
|
|
16
16
|
|
|
17
17
|
function defaultGroupHeaderFormatter(oContext, mGroupLevelInfo) {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
let sResourceKey = "TBL_ROW_GROUP_TITLE";
|
|
19
|
+
const aValues = [mGroupLevelInfo.property.label, oContext.getProperty(mGroupLevelInfo.property.path, true)];
|
|
20
20
|
|
|
21
21
|
if (mGroupLevelInfo.textProperty) {
|
|
22
22
|
sResourceKey = "TBL_ROW_GROUP_TITLE_FULL";
|
|
@@ -32,14 +32,14 @@ sap.ui.define([
|
|
|
32
32
|
* @class TODO (don't forget to document fixed row count restrictions because fixed rows are set by this plugin)
|
|
33
33
|
* @extends sap.ui.table.plugins.PluginBase
|
|
34
34
|
* @author SAP SE
|
|
35
|
-
* @version 1.
|
|
35
|
+
* @version 1.124.0
|
|
36
36
|
* @private
|
|
37
37
|
* @since 1.76
|
|
38
38
|
* @ui5-restricted sap.ui.mdc
|
|
39
39
|
* @alias sap.ui.table.plugins.V4Aggregation
|
|
40
40
|
* @borrows sap.ui.table.plugins.PluginBase.findOn as findOn
|
|
41
41
|
*/
|
|
42
|
-
|
|
42
|
+
const V4Aggregation = PluginBase.extend("sap.ui.table.plugins.V4Aggregation", /** @lends sap.ui.table.plugins.V4Aggregation.prototype */ {
|
|
43
43
|
metadata: {
|
|
44
44
|
library: "sap.ui.table",
|
|
45
45
|
properties: {
|
|
@@ -77,7 +77,7 @@ sap.ui.define([
|
|
|
77
77
|
* @inheritDoc
|
|
78
78
|
*/
|
|
79
79
|
V4Aggregation.prototype.activate = function() {
|
|
80
|
-
|
|
80
|
+
const oBinding = this.getTableBinding();
|
|
81
81
|
|
|
82
82
|
if (oBinding && !oBinding.isA("sap.ui.model.odata.v4.ODataListBinding")) {
|
|
83
83
|
return;
|
|
@@ -118,7 +118,7 @@ sap.ui.define([
|
|
|
118
118
|
TableUtils.Hook.deregister(this, TableUtils.Hook.Keys.Row.Expand, expandRow, this);
|
|
119
119
|
TableUtils.Hook.deregister(this, TableUtils.Hook.Keys.Row.Collapse, collapseRow, this);
|
|
120
120
|
|
|
121
|
-
|
|
121
|
+
const oBinding = oTable.getBinding();
|
|
122
122
|
if (oBinding) {
|
|
123
123
|
oBinding.setAggregation();
|
|
124
124
|
}
|
|
@@ -130,7 +130,7 @@ sap.ui.define([
|
|
|
130
130
|
* @param {sap.ui.table.plugins.V4Aggregation} oPlugin The instance of the plugin.
|
|
131
131
|
*/
|
|
132
132
|
function resetCellContentVisibilitySettings(oPlugin) {
|
|
133
|
-
|
|
133
|
+
const oTable = oPlugin.getTable();
|
|
134
134
|
|
|
135
135
|
if (oTable) {
|
|
136
136
|
oTable.getColumns().forEach(function(oColumn) {
|
|
@@ -145,15 +145,15 @@ sap.ui.define([
|
|
|
145
145
|
* @param {sap.ui.table.plugins.V4Aggregation} oPlugin The instance of the plugin.
|
|
146
146
|
*/
|
|
147
147
|
function updateCellContentVisibilitySettings(oPlugin) {
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
const oTable = oPlugin.getTable();
|
|
149
|
+
const sGroupSummary = oPlugin.getGroupSummary();
|
|
150
150
|
|
|
151
151
|
if (!oTable || !oPlugin._mColumnState) {
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
oTable.getColumns().forEach(function(oColumn) {
|
|
156
|
-
|
|
156
|
+
const mColumnState = oPlugin._mColumnState[oColumn.getId()];
|
|
157
157
|
|
|
158
158
|
if (mColumnState) {
|
|
159
159
|
oColumn._setCellContentVisibilitySettings({
|
|
@@ -197,12 +197,12 @@ sap.ui.define([
|
|
|
197
197
|
};
|
|
198
198
|
|
|
199
199
|
V4Aggregation.prototype.updateRowState = function(oState) {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
200
|
+
const iLevel = oState.context.getProperty("@$ui5.node.level");
|
|
201
|
+
const bContainsTotals = oState.context.getProperty("@$ui5.node.isTotal");
|
|
202
|
+
const bIsLeaf = oState.context.getProperty("@$ui5.node.isExpanded") === undefined;
|
|
203
|
+
const bIsGrandTotal = iLevel === 0 && bContainsTotals;
|
|
204
|
+
const bIsGroupHeader = iLevel > 0 && !bIsLeaf;
|
|
205
|
+
const bIsGroupTotal = !bIsGroupHeader && bContainsTotals;
|
|
206
206
|
|
|
207
207
|
oState.level = iLevel;
|
|
208
208
|
oState.expandable = bIsGroupHeader;
|
|
@@ -216,9 +216,9 @@ sap.ui.define([
|
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
if (bIsGroupHeader) {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
219
|
+
const mGroupLevelInfo = this._aGroupLevels[iLevel - 1];
|
|
220
|
+
const fnGroupHeaderFormatter = this.getGroupHeaderFormatter();
|
|
221
|
+
const sCustomGroupHeaderTitle = fnGroupHeaderFormatter ? fnGroupHeaderFormatter(oState.context, mGroupLevelInfo.property.key) : undefined;
|
|
222
222
|
|
|
223
223
|
if (sCustomGroupHeaderTitle === undefined) {
|
|
224
224
|
oState.title = defaultGroupHeaderFormatter(oState.context, mGroupLevelInfo);
|
|
@@ -276,9 +276,9 @@ sap.ui.define([
|
|
|
276
276
|
this._aGroupLevels = undefined;
|
|
277
277
|
this._sSearch = undefined;
|
|
278
278
|
} else {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
279
|
+
const aAllUnitProperties = [];
|
|
280
|
+
let aAllAdditionalProperties = [];
|
|
281
|
+
let aAdditionalProperties;
|
|
282
282
|
|
|
283
283
|
// Always use keys in the properties to be grouped
|
|
284
284
|
this._mGroup = this.getPropertyInfos().reduce(function(mGroup, oPropertyInfo) {
|
|
@@ -296,7 +296,7 @@ sap.ui.define([
|
|
|
296
296
|
this._mAggregate = {};
|
|
297
297
|
|
|
298
298
|
// Find grouped and aggregated properties
|
|
299
|
-
|
|
299
|
+
const aVisible = oAggregateInfo.visible.concat(); // Copy
|
|
300
300
|
if (oAggregateInfo.groupLevels) {
|
|
301
301
|
// We need to consider groupLevels as visible properties, to add them in the query properly if they have an 'additionally' property
|
|
302
302
|
oAggregateInfo.groupLevels.forEach(function(sGroupLevelName) {
|
|
@@ -306,7 +306,7 @@ sap.ui.define([
|
|
|
306
306
|
});
|
|
307
307
|
}
|
|
308
308
|
aVisible.forEach(function(sVisiblePropertyName) {
|
|
309
|
-
|
|
309
|
+
const oPropertyInfo = this.findPropertyInfo(sVisiblePropertyName);
|
|
310
310
|
|
|
311
311
|
if (!oPropertyInfo) {
|
|
312
312
|
return;
|
|
@@ -333,7 +333,7 @@ sap.ui.define([
|
|
|
333
333
|
}
|
|
334
334
|
|
|
335
335
|
if (oPropertyInfo.unit) {
|
|
336
|
-
|
|
336
|
+
const oUnitPropertyInfo = this.findPropertyInfo(oPropertyInfo.unit);
|
|
337
337
|
if (oUnitPropertyInfo) {
|
|
338
338
|
this._mAggregate[oPropertyInfo.path].unit = oUnitPropertyInfo.path;
|
|
339
339
|
aAllUnitProperties.push(oUnitPropertyInfo.path);
|
|
@@ -345,7 +345,7 @@ sap.ui.define([
|
|
|
345
345
|
oPropertyInfo.aggregationDetails.customAggregate.contextDefiningProperties) {
|
|
346
346
|
|
|
347
347
|
oPropertyInfo.aggregationDetails.customAggregate.contextDefiningProperties.forEach(function(sContextDefiningPropertyName) {
|
|
348
|
-
|
|
348
|
+
const oDefiningPropertyInfo = this.findPropertyInfo(sContextDefiningPropertyName);
|
|
349
349
|
if (oDefiningPropertyInfo) {
|
|
350
350
|
this._mGroup[oDefiningPropertyInfo.path] = {};
|
|
351
351
|
aAdditionalProperties = getAdditionalPropertyPaths(this, oPropertyInfo);
|
|
@@ -363,7 +363,7 @@ sap.ui.define([
|
|
|
363
363
|
this._aGroupLevels = [];
|
|
364
364
|
if (oAggregateInfo.groupLevels) {
|
|
365
365
|
oAggregateInfo.groupLevels.forEach(function(sGroupLevelName) {
|
|
366
|
-
|
|
366
|
+
const oGroupedPropertyInfo = this.findPropertyInfo(sGroupLevelName);
|
|
367
367
|
if (oGroupedPropertyInfo) {
|
|
368
368
|
this._aGroupLevels.push({
|
|
369
369
|
property: oGroupedPropertyInfo,
|
|
@@ -412,7 +412,7 @@ sap.ui.define([
|
|
|
412
412
|
return;
|
|
413
413
|
}
|
|
414
414
|
|
|
415
|
-
|
|
415
|
+
const mAggregation = {
|
|
416
416
|
aggregate: deepClone(this._mAggregate),
|
|
417
417
|
group: deepClone(this._mGroup),
|
|
418
418
|
groupLevels: this._aGroupLevels ? this._aGroupLevels.map(function(mGroupLevelInfo) {
|
|
@@ -431,7 +431,7 @@ sap.ui.define([
|
|
|
431
431
|
|
|
432
432
|
function getAdditionalPropertyPaths(oPlugin, oPropertyInfo) {
|
|
433
433
|
if (oPropertyInfo.text) {
|
|
434
|
-
|
|
434
|
+
const oTextPropertyInfo = oPlugin.findPropertyInfo(oPropertyInfo.text);
|
|
435
435
|
if (oTextPropertyInfo) {
|
|
436
436
|
return [oTextPropertyInfo.path];
|
|
437
437
|
}
|
|
@@ -441,7 +441,7 @@ sap.ui.define([
|
|
|
441
441
|
}
|
|
442
442
|
|
|
443
443
|
function expandRow(oRow) {
|
|
444
|
-
|
|
444
|
+
const oBindingContext = oRow.getRowBindingContext();
|
|
445
445
|
|
|
446
446
|
if (oBindingContext) {
|
|
447
447
|
oBindingContext.expand();
|
|
@@ -449,7 +449,7 @@ sap.ui.define([
|
|
|
449
449
|
}
|
|
450
450
|
|
|
451
451
|
function collapseRow(oRow) {
|
|
452
|
-
|
|
452
|
+
const oBindingContext = oRow.getRowBindingContext();
|
|
453
453
|
|
|
454
454
|
if (oBindingContext) {
|
|
455
455
|
oBindingContext.collapse();
|
|
@@ -473,18 +473,18 @@ sap.ui.define([
|
|
|
473
473
|
};
|
|
474
474
|
|
|
475
475
|
V4Aggregation.prototype.updateAggregation = function() {
|
|
476
|
-
|
|
476
|
+
const oBinding = this.getTableBinding();
|
|
477
477
|
if (oBinding) {
|
|
478
478
|
oBinding.setAggregation(this.getAggregationInfo());
|
|
479
479
|
}
|
|
480
480
|
};
|
|
481
481
|
|
|
482
482
|
function handleGrandTotals(oPlugin, mAggregation) {
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
483
|
+
const sTotalSummaryOnTop = oPlugin.getTotalSummaryOnTop();
|
|
484
|
+
const sTotalSummaryOnBottom = oPlugin.getTotalSummaryOnBottom();
|
|
485
|
+
const bShowTotalSummaryOnTop = sTotalSummaryOnTop === "On" || sTotalSummaryOnTop === "Fixed";
|
|
486
|
+
const bShowTotalSummaryOnBottom = sTotalSummaryOnBottom === "On" || sTotalSummaryOnBottom === "Fixed";
|
|
487
|
+
const bHasGrandTotals = Object.keys(mAggregation.aggregate).some(function(sKey) {
|
|
488
488
|
return mAggregation.aggregate[sKey].grandTotal;
|
|
489
489
|
});
|
|
490
490
|
|
|
@@ -507,7 +507,7 @@ sap.ui.define([
|
|
|
507
507
|
}
|
|
508
508
|
|
|
509
509
|
function handleGroupTotals(oPlugin, mAggregation) {
|
|
510
|
-
|
|
510
|
+
const sGroupSummary = oPlugin.getGroupSummary();
|
|
511
511
|
|
|
512
512
|
if (sGroupSummary === "Top") {
|
|
513
513
|
mAggregation.subtotalsAtBottomOnly = undefined;
|
|
@@ -16,7 +16,7 @@ sap.ui.define([
|
|
|
16
16
|
) {
|
|
17
17
|
"use strict";
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
const _private = TableUtils.createWeakMapFacade();
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Constructor for a new <code>Auto</code> row mode.
|
|
@@ -38,9 +38,9 @@ sap.ui.define([
|
|
|
38
38
|
* @public
|
|
39
39
|
*
|
|
40
40
|
* @author SAP SE
|
|
41
|
-
* @version 1.
|
|
41
|
+
* @version 1.124.0
|
|
42
42
|
*/
|
|
43
|
-
|
|
43
|
+
const AutoRowMode = RowMode.extend("sap.ui.table.rowmodes.Auto", /** @lends sap.ui.table.rowmodes.Auto.prototype */ {
|
|
44
44
|
metadata: {
|
|
45
45
|
library: "sap.ui.table",
|
|
46
46
|
properties: {
|
|
@@ -90,20 +90,19 @@ sap.ui.define([
|
|
|
90
90
|
}
|
|
91
91
|
});
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
const TableDelegate = {};
|
|
94
94
|
|
|
95
95
|
// TODO: This function can be removed and replaced with #getBaseRowHeightOfTable once the table is changed to a div-based layout.
|
|
96
96
|
function getRowHeight(oRowMode) {
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
const oTable = oRowMode.getTable();
|
|
98
|
+
const oRowContainer = oTable ? oTable.getDomRef("tableCCnt") : null;
|
|
99
99
|
|
|
100
100
|
if (oRowContainer && Device.browser.chrome && window.devicePixelRatio !== 1) {
|
|
101
101
|
// Because of a bug in the zoom algorithm of Chrome, the actual height of a DOM element can be different
|
|
102
102
|
// to what is set in inline styles or CSS. Therefore, we need to get the height of a row from the DOM.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
var nRowHeight;
|
|
103
|
+
const oTableElement = document.createElement("table");
|
|
104
|
+
const oRowElement = oTableElement.insertRow();
|
|
105
|
+
const iRowContentHeight = oRowMode.getRowContentHeight();
|
|
107
106
|
|
|
108
107
|
oTableElement.classList.add("sapUiTableCtrl");
|
|
109
108
|
oRowElement.classList.add("sapUiTableTr");
|
|
@@ -113,7 +112,7 @@ sap.ui.define([
|
|
|
113
112
|
}
|
|
114
113
|
|
|
115
114
|
oRowContainer.appendChild(oTableElement);
|
|
116
|
-
nRowHeight = oRowElement.getBoundingClientRect().height;
|
|
115
|
+
const nRowHeight = oRowElement.getBoundingClientRect().height;
|
|
117
116
|
oRowContainer.removeChild(oTableElement);
|
|
118
117
|
|
|
119
118
|
return nRowHeight;
|
|
@@ -183,7 +182,7 @@ sap.ui.define([
|
|
|
183
182
|
* @deprecated As of version 1.119
|
|
184
183
|
*/
|
|
185
184
|
if (this.bLegacy) {
|
|
186
|
-
|
|
185
|
+
const oTable = this.getTable();
|
|
187
186
|
return oTable ? oTable.getFixedRowCount() : 0;
|
|
188
187
|
}
|
|
189
188
|
|
|
@@ -195,7 +194,7 @@ sap.ui.define([
|
|
|
195
194
|
* @deprecated As of version 1.119
|
|
196
195
|
*/
|
|
197
196
|
if (this.bLegacy) {
|
|
198
|
-
|
|
197
|
+
const oTable = this.getTable();
|
|
199
198
|
return oTable ? oTable.getFixedBottomRowCount() : 0;
|
|
200
199
|
}
|
|
201
200
|
|
|
@@ -207,7 +206,7 @@ sap.ui.define([
|
|
|
207
206
|
* @deprecated As of version 1.119
|
|
208
207
|
*/
|
|
209
208
|
if (this.bLegacy) {
|
|
210
|
-
|
|
209
|
+
const oTable = this.getTable();
|
|
211
210
|
return oTable ? oTable.getMinAutoRowCount() : 0;
|
|
212
211
|
}
|
|
213
212
|
|
|
@@ -219,7 +218,7 @@ sap.ui.define([
|
|
|
219
218
|
* @deprecated As of version 1.119
|
|
220
219
|
*/
|
|
221
220
|
if (this.bLegacy) {
|
|
222
|
-
|
|
221
|
+
const oTable = this.getTable();
|
|
223
222
|
return oTable ? oTable.getRowHeight() : 0;
|
|
224
223
|
}
|
|
225
224
|
|
|
@@ -249,8 +248,8 @@ sap.ui.define([
|
|
|
249
248
|
* @private
|
|
250
249
|
*/
|
|
251
250
|
AutoRowMode.prototype._getMinRowCount = function() {
|
|
252
|
-
|
|
253
|
-
|
|
251
|
+
const iMinRowCount = this.getMinRowCount();
|
|
252
|
+
const iMaxRowCount = this.getMaxRowCount();
|
|
254
253
|
|
|
255
254
|
if (iMaxRowCount >= 0) {
|
|
256
255
|
return Math.min(iMinRowCount, iMaxRowCount);
|
|
@@ -260,14 +259,14 @@ sap.ui.define([
|
|
|
260
259
|
};
|
|
261
260
|
|
|
262
261
|
AutoRowMode.prototype.getMinRequestLength = function() {
|
|
263
|
-
|
|
264
|
-
|
|
262
|
+
const oTable = this.getTable();
|
|
263
|
+
let iRequestLength = this.getConfiguredRowCount();
|
|
265
264
|
|
|
266
265
|
if (isRowCountInitial(this) || (oTable && !oTable._bContextsAvailable)) {
|
|
267
266
|
// Due to the dynamic nature of this mode, the requests during initialization of the table's rows or rows binding should consider the
|
|
268
267
|
// screen height to avoid multiple requests in case the height available for the table increases. This can happen, for example, during
|
|
269
268
|
// the startup phase of an application.
|
|
270
|
-
|
|
269
|
+
const iEstimatedMaxRowCount = Math.ceil(Device.resize.height / TableUtils.DefaultRowHeight.sapUiSizeCondensed);
|
|
271
270
|
iRequestLength = Math.max(iRequestLength, iEstimatedMaxRowCount);
|
|
272
271
|
}
|
|
273
272
|
|
|
@@ -276,7 +275,7 @@ sap.ui.define([
|
|
|
276
275
|
|
|
277
276
|
AutoRowMode.prototype.updateTable = function() {
|
|
278
277
|
if (this.getHideEmptyRows() && this.getComputedRowCounts().count === 0) {
|
|
279
|
-
|
|
278
|
+
const iConfiguredRowCount = this.getConfiguredRowCount();
|
|
280
279
|
|
|
281
280
|
if (iConfiguredRowCount > 0) {
|
|
282
281
|
this.getRowContexts(iConfiguredRowCount);
|
|
@@ -297,9 +296,9 @@ sap.ui.define([
|
|
|
297
296
|
};
|
|
298
297
|
}
|
|
299
298
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
299
|
+
let iRowCount = this.getConfiguredRowCount();
|
|
300
|
+
const iFixedTopRowCount = this.getFixedTopRowCount();
|
|
301
|
+
const iFixedBottomRowCount = this.getFixedBottomRowCount();
|
|
303
302
|
|
|
304
303
|
if (this.getHideEmptyRows()) {
|
|
305
304
|
iRowCount = Math.min(iRowCount, this.getTotalRowCountOfTable());
|
|
@@ -309,12 +308,12 @@ sap.ui.define([
|
|
|
309
308
|
};
|
|
310
309
|
|
|
311
310
|
AutoRowMode.prototype.getTableStyles = function() {
|
|
312
|
-
|
|
311
|
+
let sHeight = "0px"; // The table's DOM parent needs to be able to shrink.
|
|
313
312
|
|
|
314
313
|
if (isRowCountInitial(this)) {
|
|
315
314
|
sHeight = "auto";
|
|
316
315
|
} else {
|
|
317
|
-
|
|
316
|
+
const iRowCount = this.getConfiguredRowCount();
|
|
318
317
|
|
|
319
318
|
if (iRowCount === 0 || iRowCount === this._getMinRowCount()) {
|
|
320
319
|
sHeight = "auto";
|
|
@@ -331,7 +330,7 @@ sap.ui.define([
|
|
|
331
330
|
return undefined;
|
|
332
331
|
}
|
|
333
332
|
|
|
334
|
-
|
|
333
|
+
let iRowCountDelta;
|
|
335
334
|
|
|
336
335
|
if (isRowCountInitial(this)) {
|
|
337
336
|
iRowCountDelta = this._getMinRowCount();
|
|
@@ -351,7 +350,7 @@ sap.ui.define([
|
|
|
351
350
|
};
|
|
352
351
|
|
|
353
352
|
AutoRowMode.prototype.renderRowStyles = function(oRM) {
|
|
354
|
-
|
|
353
|
+
const iRowContentHeight = this.getRowContentHeight();
|
|
355
354
|
|
|
356
355
|
if (iRowContentHeight > 0) {
|
|
357
356
|
oRM.style("height", this.getBaseRowHeightOfTable() + "px");
|
|
@@ -359,7 +358,7 @@ sap.ui.define([
|
|
|
359
358
|
};
|
|
360
359
|
|
|
361
360
|
AutoRowMode.prototype.renderCellContentStyles = function(oRM) {
|
|
362
|
-
|
|
361
|
+
let iRowContentHeight = this.getRowContentHeight();
|
|
363
362
|
|
|
364
363
|
/**
|
|
365
364
|
* @deprecated As of version 1.119
|
|
@@ -391,7 +390,7 @@ sap.ui.define([
|
|
|
391
390
|
*/
|
|
392
391
|
AutoRowMode.prototype._onTableRefreshRows = function() {
|
|
393
392
|
// The computed row count cannot be used here, because the table's total row count (binding length) is not known yet.
|
|
394
|
-
|
|
393
|
+
const iConfiguredRowCount = this.getConfiguredRowCount();
|
|
395
394
|
|
|
396
395
|
if (iConfiguredRowCount > 0) {
|
|
397
396
|
if (!isRowCountInitial(this)) {
|
|
@@ -408,8 +407,8 @@ sap.ui.define([
|
|
|
408
407
|
* @private
|
|
409
408
|
*/
|
|
410
409
|
AutoRowMode.prototype.getConfiguredRowCount = function() {
|
|
411
|
-
|
|
412
|
-
|
|
410
|
+
let iRowCount = Math.max(0, this.getMinRowCount(), _private(this).rowCount);
|
|
411
|
+
const iMaxRowCount = this.getMaxRowCount();
|
|
413
412
|
|
|
414
413
|
if (iMaxRowCount >= 0) {
|
|
415
414
|
iRowCount = Math.min(iRowCount, iMaxRowCount);
|
|
@@ -447,7 +446,7 @@ sap.ui.define([
|
|
|
447
446
|
* @private
|
|
448
447
|
*/
|
|
449
448
|
AutoRowMode.prototype.registerResizeHandler = function(bOnTableParent) {
|
|
450
|
-
|
|
449
|
+
const oTable = this.getTable();
|
|
451
450
|
|
|
452
451
|
if (oTable) {
|
|
453
452
|
TableUtils.registerResizeHandler(oTable, "AutoRowMode", this.onResize.bind(this), null, bOnTableParent === true);
|
|
@@ -462,7 +461,7 @@ sap.ui.define([
|
|
|
462
461
|
* @private
|
|
463
462
|
*/
|
|
464
463
|
AutoRowMode.prototype.deregisterResizeHandler = function() {
|
|
465
|
-
|
|
464
|
+
const oTable = this.getTable();
|
|
466
465
|
|
|
467
466
|
if (oTable) {
|
|
468
467
|
TableUtils.deregisterResizeHandler(oTable, ["AutoRowMode, AutoRowMode-BeforeTable, AutoRowMode-AfterTable"]);
|
|
@@ -476,8 +475,8 @@ sap.ui.define([
|
|
|
476
475
|
* @private
|
|
477
476
|
*/
|
|
478
477
|
AutoRowMode.prototype.onResize = function(oEvent) {
|
|
479
|
-
|
|
480
|
-
|
|
478
|
+
const iOldHeight = oEvent.oldSize.height;
|
|
479
|
+
const iNewHeight = oEvent.size.height;
|
|
481
480
|
|
|
482
481
|
if (iOldHeight !== iNewHeight) {
|
|
483
482
|
signalStartTableUpdate(this);
|
|
@@ -514,8 +513,8 @@ sap.ui.define([
|
|
|
514
513
|
AutoRowMode.prototype.adjustRowCountToAvailableSpace = function(sReason, bStartAutomaticAdjustment) {
|
|
515
514
|
bStartAutomaticAdjustment = bStartAutomaticAdjustment === true;
|
|
516
515
|
|
|
517
|
-
|
|
518
|
-
|
|
516
|
+
const oTable = this.getTable();
|
|
517
|
+
const oTableDomRef = oTable ? oTable.getDomRef() : null;
|
|
519
518
|
|
|
520
519
|
if (!oTable || oTable._bInvalid || !oTableDomRef || !TableUtils.isThemeApplied()) {
|
|
521
520
|
signalEndTableUpdate(this);
|
|
@@ -535,14 +534,13 @@ sap.ui.define([
|
|
|
535
534
|
return;
|
|
536
535
|
}
|
|
537
536
|
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
var iNewComputedRowCount;
|
|
537
|
+
const iNewHeight = this.determineAvailableSpace();
|
|
538
|
+
const oOldRowCount = this.getConfiguredRowCount();
|
|
539
|
+
const iNewRowCount = Math.floor(iNewHeight / getRowHeight(this));
|
|
540
|
+
const iOldComputedRowCount = this.getComputedRowCounts().count;
|
|
543
541
|
|
|
544
542
|
_private(this).rowCount = iNewRowCount;
|
|
545
|
-
iNewComputedRowCount = this.getComputedRowCounts().count;
|
|
543
|
+
const iNewComputedRowCount = this.getComputedRowCounts().count;
|
|
546
544
|
|
|
547
545
|
/**
|
|
548
546
|
* @deprecated As of version 1.119
|
|
@@ -582,22 +580,22 @@ sap.ui.define([
|
|
|
582
580
|
* @private
|
|
583
581
|
*/
|
|
584
582
|
AutoRowMode.prototype.determineAvailableSpace = function() {
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
583
|
+
const oTable = this.getTable();
|
|
584
|
+
const oTableDomRef = oTable ? oTable.getDomRef() : null;
|
|
585
|
+
const oRowContainer = oTable ? oTable.getDomRef("tableCCnt") : null;
|
|
586
|
+
const oPlaceholder = oTable ? oTable.getDomRef("placeholder-bottom") : null;
|
|
589
587
|
|
|
590
588
|
if (!oTableDomRef || !oRowContainer || !oTableDomRef.parentNode) {
|
|
591
589
|
return 0;
|
|
592
590
|
}
|
|
593
591
|
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
592
|
+
let iUsedHeight = 0;
|
|
593
|
+
const iRowContainerHeight = oRowContainer.clientHeight;
|
|
594
|
+
const iPlaceholderHeight = oPlaceholder ? oPlaceholder.clientHeight : 0;
|
|
597
595
|
|
|
598
596
|
if (_private(this).bTableIsFlexItem) {
|
|
599
|
-
|
|
600
|
-
for (
|
|
597
|
+
const aChildNodes = oTableDomRef.childNodes;
|
|
598
|
+
for (let i = 0; i < aChildNodes.length; i++) {
|
|
601
599
|
iUsedHeight += aChildNodes[i].offsetHeight;
|
|
602
600
|
}
|
|
603
601
|
iUsedHeight -= iRowContainerHeight - iPlaceholderHeight;
|
|
@@ -606,9 +604,9 @@ sap.ui.define([
|
|
|
606
604
|
}
|
|
607
605
|
|
|
608
606
|
// For simplicity always add the default height of the horizontal scrollbar to the used height, even if it will not be visible.
|
|
609
|
-
|
|
607
|
+
const oScrollExtension = oTable._getScrollExtension();
|
|
610
608
|
if (!oScrollExtension.isHorizontalScrollbarVisible()) {
|
|
611
|
-
|
|
609
|
+
const mDefaultScrollbarHeight = {};
|
|
612
610
|
mDefaultScrollbarHeight[Device.browser.BROWSER.CHROME] = 16;
|
|
613
611
|
mDefaultScrollbarHeight[Device.browser.BROWSER.FIREFOX] = 16;
|
|
614
612
|
mDefaultScrollbarHeight[Device.browser.BROWSER.SAFARI] = 16;
|
|
@@ -616,9 +614,9 @@ sap.ui.define([
|
|
|
616
614
|
iUsedHeight += mDefaultScrollbarHeight[Device.browser.name];
|
|
617
615
|
}
|
|
618
616
|
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
617
|
+
const oReferenceElement = _private(this).bTableIsFlexItem ? oTableDomRef : oTableDomRef.parentNode;
|
|
618
|
+
const iNewAvailableSpace = Math.max(0, Math.floor(jQuery(oReferenceElement).height() - iUsedHeight));
|
|
619
|
+
const iAvailableSpaceDifference = Math.abs(iNewAvailableSpace - _private(this).iLastAvailableSpace);
|
|
622
620
|
|
|
623
621
|
if (iAvailableSpaceDifference >= 5) {
|
|
624
622
|
_private(this).iLastAvailableSpace = iNewAvailableSpace;
|
|
@@ -631,7 +629,7 @@ sap.ui.define([
|
|
|
631
629
|
* @this sap.ui.table.rowmodes.Auto
|
|
632
630
|
*/
|
|
633
631
|
TableDelegate.onBeforeRendering = function(oEvent) {
|
|
634
|
-
|
|
632
|
+
const bRenderedRows = oEvent && oEvent.isMarked("renderRows");
|
|
635
633
|
|
|
636
634
|
if (!bRenderedRows) {
|
|
637
635
|
this.stopAutoRowMode();
|
|
@@ -642,7 +640,7 @@ sap.ui.define([
|
|
|
642
640
|
* @this sap.ui.table.rowmodes.Auto
|
|
643
641
|
*/
|
|
644
642
|
TableDelegate.onAfterRendering = function(oEvent) {
|
|
645
|
-
|
|
643
|
+
const bRenderedRows = oEvent && oEvent.isMarked("renderRows");
|
|
646
644
|
|
|
647
645
|
if (!bRenderedRows) {
|
|
648
646
|
this.startAutoRowMode();
|
|
@@ -655,7 +653,7 @@ sap.ui.define([
|
|
|
655
653
|
}
|
|
656
654
|
|
|
657
655
|
function signalEndTableUpdate(oRowMode) {
|
|
658
|
-
for (
|
|
656
|
+
for (let i = 0; i < _private(oRowMode).iPendingStartTableUpdateSignals; i++) {
|
|
659
657
|
TableUtils.Hook.call(oRowMode.getTable(), TableUtils.Hook.Keys.Signal, "EndTableUpdate");
|
|
660
658
|
}
|
|
661
659
|
_private(oRowMode).iPendingStartTableUpdateSignals = 0;
|