@openui5/sap.ui.table 1.123.0 → 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
|
@@ -14,12 +14,12 @@ sap.ui.define([], function() {
|
|
|
14
14
|
* Note: Do not access the functions of this helper directly, but via <code>sap.ui.table.utils.TableUtils.Binding...</code>
|
|
15
15
|
*
|
|
16
16
|
* @author SAP SE
|
|
17
|
-
* @version 1.
|
|
17
|
+
* @version 1.124.0
|
|
18
18
|
* @namespace
|
|
19
19
|
* @alias sap.ui.table.utils._BindingUtils
|
|
20
20
|
* @private
|
|
21
21
|
*/
|
|
22
|
-
|
|
22
|
+
const BindingUtils = {
|
|
23
23
|
TableUtils: null, // Avoid cyclic dependency. Will be filled by TableUtils.
|
|
24
24
|
|
|
25
25
|
/**
|
|
@@ -29,11 +29,11 @@ sap.ui.define([], function() {
|
|
|
29
29
|
* @returns {Promise} A promise on the metadata loaded state.
|
|
30
30
|
*/
|
|
31
31
|
metadataLoaded: function(oTable) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
const oBinding = oTable.getBinding();
|
|
33
|
+
const oModel = oBinding ? oBinding.getModel() : null;
|
|
34
|
+
let fResolvePromise = null;
|
|
35
|
+
let fRejectPromise = null;
|
|
36
|
+
const pMetadataLoaded = new Promise(function(resolve, reject) {
|
|
37
37
|
fResolvePromise = resolve;
|
|
38
38
|
fRejectPromise = reject;
|
|
39
39
|
});
|
|
@@ -18,12 +18,12 @@ sap.ui.define([
|
|
|
18
18
|
* Note: Do not access the functions of this helper directly, but via <code>sap.ui.table.utils.TableUtils.Column...</code>
|
|
19
19
|
*
|
|
20
20
|
* @author SAP SE
|
|
21
|
-
* @version 1.
|
|
21
|
+
* @version 1.124.0
|
|
22
22
|
* @namespace
|
|
23
23
|
* @alias sap.ui.table.utils._ColumnUtils
|
|
24
24
|
* @private
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
const ColumnUtils = {
|
|
27
27
|
|
|
28
28
|
TableUtils: null, // Avoid cyclic dependency. Will be filled by TableUtils
|
|
29
29
|
|
|
@@ -118,17 +118,17 @@ sap.ui.define([
|
|
|
118
118
|
* @private
|
|
119
119
|
*/
|
|
120
120
|
getColumnMap: function(oTable) {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
121
|
+
let i;
|
|
122
|
+
let oColumn;
|
|
123
|
+
let oColumnMapItem = {};
|
|
124
|
+
const oColumnMap = {};
|
|
125
|
+
const aColumns = oTable.getColumns();
|
|
126
126
|
|
|
127
|
-
|
|
127
|
+
const iMaxLevel = ColumnUtils.TableUtils.getHeaderRowCount(oTable);
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
const oParentReferences = {};
|
|
130
130
|
|
|
131
|
-
for (
|
|
131
|
+
for (let iColumnIndex = 0; iColumnIndex < aColumns.length; iColumnIndex++) {
|
|
132
132
|
oColumn = aColumns[iColumnIndex];
|
|
133
133
|
oColumnMapItem = {};
|
|
134
134
|
oColumnMapItem.id = oColumn.getId();
|
|
@@ -136,16 +136,16 @@ sap.ui.define([
|
|
|
136
136
|
oColumnMapItem.levelInfo = [];
|
|
137
137
|
oColumnMapItem.parents = [];
|
|
138
138
|
|
|
139
|
-
for (
|
|
139
|
+
for (let iLevel = 0; iLevel < iMaxLevel; iLevel++) {
|
|
140
140
|
oColumnMapItem.levelInfo[iLevel] = {};
|
|
141
141
|
oColumnMapItem.levelInfo[iLevel].spannedColumns = [];
|
|
142
142
|
|
|
143
|
-
|
|
143
|
+
const iHeaderSpan = ColumnUtils.getHeaderSpan(oColumn, iLevel);
|
|
144
144
|
// collect columns which are spanned by the current column
|
|
145
145
|
for (i = 1; i < iHeaderSpan; i++) {
|
|
146
|
-
|
|
146
|
+
const oSpannedColumn = aColumns[iColumnIndex + i];
|
|
147
147
|
if (oSpannedColumn) {
|
|
148
|
-
|
|
148
|
+
const sPannedColumnId = oSpannedColumn.getId();
|
|
149
149
|
oColumnMapItem.levelInfo[iLevel].spannedColumns.push(aColumns[iColumnIndex + i]);
|
|
150
150
|
if (!oParentReferences[sPannedColumnId]) {
|
|
151
151
|
oParentReferences[sPannedColumnId] = [];
|
|
@@ -158,9 +158,9 @@ sap.ui.define([
|
|
|
158
158
|
oColumnMap[oColumnMapItem.id] = oColumnMapItem;
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
|
|
161
|
+
const aColumnIds = Object.keys(oParentReferences);
|
|
162
162
|
for (i = 0; i < aColumnIds.length; i++) {
|
|
163
|
-
|
|
163
|
+
const sColumnId = aColumnIds[i];
|
|
164
164
|
oColumnMap[sColumnId].parents = oParentReferences[sColumnId];
|
|
165
165
|
}
|
|
166
166
|
|
|
@@ -177,7 +177,7 @@ sap.ui.define([
|
|
|
177
177
|
*/
|
|
178
178
|
getColumnMapItem: function(oTable, sColumnId) {
|
|
179
179
|
ColumnUtils.initColumnUtils(oTable);
|
|
180
|
-
|
|
180
|
+
const oSourceColumnMapItem = oTable._oColumnInfo.columnMap[sColumnId];
|
|
181
181
|
if (!oSourceColumnMapItem) {
|
|
182
182
|
Log.error("Column with ID '" + sColumnId + "' not found", oTable);
|
|
183
183
|
} else {
|
|
@@ -195,14 +195,14 @@ sap.ui.define([
|
|
|
195
195
|
* @returns {Array.<{column: sap.ui.table.Column, level: int}>|undefined} Array of column information.
|
|
196
196
|
*/
|
|
197
197
|
getParentSpannedColumns: function(oTable, sColumnId, iLevel) {
|
|
198
|
-
|
|
198
|
+
const oColumnMapItem = ColumnUtils.getColumnMapItem(oTable, sColumnId);
|
|
199
199
|
if (!oColumnMapItem) {
|
|
200
200
|
return undefined;
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
|
|
204
|
-
for (
|
|
205
|
-
|
|
203
|
+
const aParents = [];
|
|
204
|
+
for (let i = 0; i < oColumnMapItem.parents.length; i++) {
|
|
205
|
+
const oParent = oColumnMapItem.parents[i];
|
|
206
206
|
if (iLevel === undefined || oParent.level === iLevel) {
|
|
207
207
|
aParents.push(oParent);
|
|
208
208
|
}
|
|
@@ -222,22 +222,22 @@ sap.ui.define([
|
|
|
222
222
|
* @private
|
|
223
223
|
*/
|
|
224
224
|
getChildrenSpannedColumns: function(oTable, sColumnId, iLevel) {
|
|
225
|
-
|
|
225
|
+
const oColumnMapItem = ColumnUtils.getColumnMapItem(oTable, sColumnId);
|
|
226
226
|
if (!oColumnMapItem) {
|
|
227
227
|
return undefined;
|
|
228
228
|
}
|
|
229
229
|
|
|
230
|
-
|
|
231
|
-
|
|
230
|
+
const aChildren = [];
|
|
231
|
+
let iEnd;
|
|
232
232
|
if (iLevel === undefined) {
|
|
233
233
|
iEnd = oColumnMapItem.levelInfo.length;
|
|
234
234
|
} else {
|
|
235
235
|
iEnd = iLevel + 1;
|
|
236
236
|
}
|
|
237
237
|
|
|
238
|
-
for (
|
|
239
|
-
|
|
240
|
-
for (
|
|
238
|
+
for (let i = iLevel || 0; i < iEnd; i++) {
|
|
239
|
+
const oLevelInfo = oColumnMapItem.levelInfo[i];
|
|
240
|
+
for (let j = 0; j < oLevelInfo.spannedColumns.length; j++) {
|
|
241
241
|
aChildren.push({column: oLevelInfo.spannedColumns[j], level: i});
|
|
242
242
|
}
|
|
243
243
|
}
|
|
@@ -255,8 +255,8 @@ sap.ui.define([
|
|
|
255
255
|
* @returns {int} Header span.
|
|
256
256
|
*/
|
|
257
257
|
getHeaderSpan: function(oColumn, iLevel) {
|
|
258
|
-
|
|
259
|
-
|
|
258
|
+
let vHeaderSpans = oColumn.getHeaderSpan();
|
|
259
|
+
let iHeaderSpan;
|
|
260
260
|
|
|
261
261
|
if (!vHeaderSpans) {
|
|
262
262
|
return 1;
|
|
@@ -267,7 +267,7 @@ sap.ui.define([
|
|
|
267
267
|
}
|
|
268
268
|
|
|
269
269
|
function getSpan(sSpan) {
|
|
270
|
-
|
|
270
|
+
const result = parseInt(sSpan);
|
|
271
271
|
return isNaN(result) ? 1 : result;
|
|
272
272
|
}
|
|
273
273
|
|
|
@@ -313,21 +313,21 @@ sap.ui.define([
|
|
|
313
313
|
* @private
|
|
314
314
|
*/
|
|
315
315
|
getColumnBoundaries: function(oTable, sColumnId) {
|
|
316
|
-
|
|
316
|
+
const oColumnMapItem = ColumnUtils.getColumnMapItem(oTable, sColumnId);
|
|
317
317
|
if (!oColumnMapItem) {
|
|
318
318
|
return undefined;
|
|
319
319
|
}
|
|
320
320
|
|
|
321
|
-
|
|
321
|
+
let mColumns = {};
|
|
322
322
|
if (sColumnId) {
|
|
323
323
|
// initialize the column map with the start column for which the boundaries shall be determined
|
|
324
324
|
mColumns[sColumnId] = oColumnMapItem.column;
|
|
325
325
|
}
|
|
326
326
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
327
|
+
const fnTraverseColumnRelations = function(mColumns, aNewRelations) {
|
|
328
|
+
let oColumn;
|
|
329
|
+
let i;
|
|
330
|
+
let aDirectRelations = [];
|
|
331
331
|
aNewRelations = aNewRelations || [];
|
|
332
332
|
|
|
333
333
|
// get the direct relations for all collected columns
|
|
@@ -343,7 +343,7 @@ sap.ui.define([
|
|
|
343
343
|
aNewRelations = [];
|
|
344
344
|
for (i = 0; i < aDirectRelations.length; i++) {
|
|
345
345
|
oColumn = aDirectRelations[i].column;
|
|
346
|
-
|
|
346
|
+
const sColumnId = oColumn.getId();
|
|
347
347
|
if (!mColumns[sColumnId]) {
|
|
348
348
|
// keep track about new found relations for later recursion to avoid collecting information about
|
|
349
349
|
// already known related columns again.
|
|
@@ -366,21 +366,21 @@ sap.ui.define([
|
|
|
366
366
|
// all columns which are somehow related to each other by spanning column headers are collected now.
|
|
367
367
|
// It is time to calculate the boundaries, which is the start index and the end index in the columns aggregation
|
|
368
368
|
// of the table
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
for (
|
|
374
|
-
|
|
369
|
+
let iColumnIndex = oTable.indexOfColumn(oColumnMapItem.column);
|
|
370
|
+
const mBoundaries = {startColumn: oColumnMapItem.column, startIndex: iColumnIndex, endColumn: oColumnMapItem.column, endIndex: -1};
|
|
371
|
+
const aColumns = oTable.getColumns();
|
|
372
|
+
const aKeys = Object.getOwnPropertyNames(mColumns);
|
|
373
|
+
for (let i = 0; i < aKeys.length; i++) {
|
|
374
|
+
const oColumn = mColumns[aKeys[i]];
|
|
375
375
|
iColumnIndex = oTable.indexOfColumn(oColumn);
|
|
376
|
-
|
|
376
|
+
const iHeaderSpan = ColumnUtils.getMaxHeaderSpan(oColumn);
|
|
377
377
|
// start
|
|
378
378
|
if (iColumnIndex < mBoundaries.startIndex) {
|
|
379
379
|
mBoundaries.startIndex = iColumnIndex;
|
|
380
380
|
mBoundaries.startColumn = oColumn;
|
|
381
381
|
}
|
|
382
382
|
|
|
383
|
-
|
|
383
|
+
const iEndIndex = iColumnIndex + iHeaderSpan - 1;
|
|
384
384
|
// end
|
|
385
385
|
if (iEndIndex > mBoundaries.endIndex) {
|
|
386
386
|
mBoundaries.endIndex = iEndIndex;
|
|
@@ -400,13 +400,13 @@ sap.ui.define([
|
|
|
400
400
|
* @returns {boolean} Whether the column can be moved to another position.
|
|
401
401
|
*/
|
|
402
402
|
isColumnMovable: function(oColumn, bIgnoreReorderingProperty) {
|
|
403
|
-
|
|
403
|
+
const oTable = oColumn.getParent();
|
|
404
404
|
if (!oTable || (!oTable.getEnableColumnReordering() && !bIgnoreReorderingProperty)) {
|
|
405
405
|
// Column reordering is not active at all
|
|
406
406
|
return false;
|
|
407
407
|
}
|
|
408
408
|
|
|
409
|
-
|
|
409
|
+
const iCurrentIndex = oTable.indexOfColumn(oColumn);
|
|
410
410
|
|
|
411
411
|
if (iCurrentIndex < oTable.getComputedFixedColumnCount() || iCurrentIndex < oTable._iFirstReorderableIndex) {
|
|
412
412
|
// No movement of fixed columns or e.g. the first column in the TreeTable
|
|
@@ -414,7 +414,7 @@ sap.ui.define([
|
|
|
414
414
|
}
|
|
415
415
|
|
|
416
416
|
if (ColumnUtils.hasHeaderSpan(oColumn)
|
|
417
|
-
|| ColumnUtils.getParentSpannedColumns(oTable, oColumn.getId()).length
|
|
417
|
+
|| ColumnUtils.getParentSpannedColumns(oTable, oColumn.getId()).length !== 0) {
|
|
418
418
|
// No movement if the column is spanned by an other column or itself defines a span
|
|
419
419
|
return false;
|
|
420
420
|
}
|
|
@@ -430,9 +430,9 @@ sap.ui.define([
|
|
|
430
430
|
* @private
|
|
431
431
|
*/
|
|
432
432
|
normalizeColumnMoveTargetIndex: function(oColumn, iNewIndex) {
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
433
|
+
const oTable = oColumn.getParent();
|
|
434
|
+
const iCurrentIndex = oTable.indexOfColumn(oColumn);
|
|
435
|
+
const aColumns = oTable.getColumns();
|
|
436
436
|
|
|
437
437
|
if (iNewIndex > iCurrentIndex) {
|
|
438
438
|
// The index is always given for the current table setup
|
|
@@ -460,7 +460,7 @@ sap.ui.define([
|
|
|
460
460
|
* @returns {boolean} Whether the column can be moved to the desired position.
|
|
461
461
|
*/
|
|
462
462
|
isColumnMovableTo: function(oColumn, iNewIndex, bIgnoreReorderingProperty) {
|
|
463
|
-
|
|
463
|
+
const oTable = oColumn.getParent();
|
|
464
464
|
|
|
465
465
|
if (!oTable || iNewIndex === undefined || !ColumnUtils.isColumnMovable(oColumn, bIgnoreReorderingProperty)) {
|
|
466
466
|
// Column is not movable at all
|
|
@@ -474,19 +474,19 @@ sap.ui.define([
|
|
|
474
474
|
return false;
|
|
475
475
|
}
|
|
476
476
|
|
|
477
|
-
|
|
478
|
-
|
|
477
|
+
const iCurrentIndex = oTable.indexOfColumn(oColumn);
|
|
478
|
+
const aColumns = oTable.getColumns();
|
|
479
479
|
|
|
480
480
|
if (iNewIndex > iCurrentIndex) { // Column moved to higher index
|
|
481
481
|
// The column to be moved will appear after this column.
|
|
482
|
-
|
|
483
|
-
|
|
482
|
+
const oBeforeColumn = aColumns[iNewIndex >= aColumns.length ? aColumns.length - 1 : iNewIndex];
|
|
483
|
+
const oTargetBoundaries = ColumnUtils.getColumnBoundaries(oTable, oBeforeColumn.getId());
|
|
484
484
|
if (ColumnUtils.hasHeaderSpan(oBeforeColumn) || oTargetBoundaries.endIndex > iNewIndex) {
|
|
485
485
|
return false;
|
|
486
486
|
}
|
|
487
487
|
} else {
|
|
488
|
-
|
|
489
|
-
if (ColumnUtils.getParentSpannedColumns(oTable, oAfterColumn.getId()).length
|
|
488
|
+
const oAfterColumn = aColumns[iNewIndex]; // The column to be moved will appear before this column.
|
|
489
|
+
if (ColumnUtils.getParentSpannedColumns(oTable, oAfterColumn.getId()).length !== 0) {
|
|
490
490
|
// If column which is currently at the desired target position is spanned by previous columns
|
|
491
491
|
// also the column to reorder would be spanned after the move.
|
|
492
492
|
return false;
|
|
@@ -510,8 +510,8 @@ sap.ui.define([
|
|
|
510
510
|
return false;
|
|
511
511
|
}
|
|
512
512
|
|
|
513
|
-
|
|
514
|
-
|
|
513
|
+
const oTable = oColumn.getParent();
|
|
514
|
+
const iCurrentIndex = oTable.indexOfColumn(oColumn);
|
|
515
515
|
|
|
516
516
|
if (iNewIndex === iCurrentIndex) {
|
|
517
517
|
return false;
|
|
@@ -519,7 +519,7 @@ sap.ui.define([
|
|
|
519
519
|
|
|
520
520
|
iNewIndex = ColumnUtils.normalizeColumnMoveTargetIndex(oColumn, iNewIndex);
|
|
521
521
|
|
|
522
|
-
|
|
522
|
+
const bExecuteDefault = oTable.fireColumnMove({
|
|
523
523
|
column: oColumn,
|
|
524
524
|
newPos: iNewIndex
|
|
525
525
|
});
|
|
@@ -590,14 +590,14 @@ sap.ui.define([
|
|
|
590
590
|
bFireEvent = true;
|
|
591
591
|
}
|
|
592
592
|
|
|
593
|
-
|
|
593
|
+
const aColumns = oTable.getColumns();
|
|
594
594
|
if (iColumnIndex >= aColumns.length || !aColumns[iColumnIndex].getVisible()) {
|
|
595
595
|
return false;
|
|
596
596
|
}
|
|
597
597
|
|
|
598
|
-
|
|
599
|
-
for (
|
|
600
|
-
|
|
598
|
+
const aVisibleColumns = [];
|
|
599
|
+
for (let i = iColumnIndex; i < aColumns.length; i++) {
|
|
600
|
+
const oColumn = aColumns[i];
|
|
601
601
|
|
|
602
602
|
if (oColumn.getVisible()) {
|
|
603
603
|
aVisibleColumns.push(oColumn);
|
|
@@ -609,9 +609,9 @@ sap.ui.define([
|
|
|
609
609
|
}
|
|
610
610
|
}
|
|
611
611
|
|
|
612
|
-
|
|
613
|
-
for (
|
|
614
|
-
|
|
612
|
+
const aResizableColumns = [];
|
|
613
|
+
for (let i = 0; i < aVisibleColumns.length; i++) {
|
|
614
|
+
const oVisibleColumn = aVisibleColumns[i];
|
|
615
615
|
if (oVisibleColumn.getResizable()) {
|
|
616
616
|
aResizableColumns.push(oVisibleColumn);
|
|
617
617
|
}
|
|
@@ -620,17 +620,17 @@ sap.ui.define([
|
|
|
620
620
|
return false;
|
|
621
621
|
}
|
|
622
622
|
|
|
623
|
-
|
|
624
|
-
for (
|
|
625
|
-
|
|
623
|
+
let iSpanWidth = 0;
|
|
624
|
+
for (let i = 0; i < aVisibleColumns.length; i++) {
|
|
625
|
+
const oVisibleColumn = aVisibleColumns[i];
|
|
626
626
|
iSpanWidth += ColumnUtils.getColumnWidth(oTable, oVisibleColumn.getIndex());
|
|
627
627
|
}
|
|
628
628
|
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
629
|
+
let iPixelDelta = iWidth - iSpanWidth;
|
|
630
|
+
let iSharedPixelDelta = Math.round(iPixelDelta / aResizableColumns.length);
|
|
631
|
+
let bResizeWasPerformed = false;
|
|
632
632
|
|
|
633
|
-
|
|
633
|
+
const oTableElement = oTable.getDomRef();
|
|
634
634
|
|
|
635
635
|
// Fix Auto Columns if a column in the scrollable area was resized:
|
|
636
636
|
// Set minimum widths of all columns with variable width except those in aResizableColumns.
|
|
@@ -638,8 +638,9 @@ sap.ui.define([
|
|
|
638
638
|
// (see setMinColWidths in Table.js).
|
|
639
639
|
if (!ColumnUtils.TableUtils.isFixedColumn(oTable, iColumnIndex)) {
|
|
640
640
|
oTable._getVisibleColumns().forEach(function(col) {
|
|
641
|
-
|
|
642
|
-
|
|
641
|
+
const width = col.getWidth();
|
|
642
|
+
let colElement;
|
|
643
|
+
|
|
643
644
|
if (oTableElement && aResizableColumns.indexOf(col) < 0 && ColumnUtils.TableUtils.isVariableWidth(width)) {
|
|
644
645
|
colElement = oTableElement.querySelector("th[data-sap-ui-colid=\"" + col.getId() + "\"]");
|
|
645
646
|
if (colElement) {
|
|
@@ -650,28 +651,28 @@ sap.ui.define([
|
|
|
650
651
|
}
|
|
651
652
|
|
|
652
653
|
// Resize all resizable columns. Share the width change (pixel delta) between them.
|
|
653
|
-
for (
|
|
654
|
-
|
|
655
|
-
|
|
654
|
+
for (let i = 0; i < aResizableColumns.length; i++) {
|
|
655
|
+
const oResizableColumn = aResizableColumns[i];
|
|
656
|
+
const iColumnWidth = ColumnUtils.getColumnWidth(oTable, oResizableColumn.getIndex());
|
|
657
|
+
let iNewWidth = iColumnWidth + iSharedPixelDelta;
|
|
658
|
+
const iColMinWidth = ColumnUtils.getMinColumnWidth();
|
|
656
659
|
|
|
657
|
-
var iNewWidth = iColumnWidth + iSharedPixelDelta;
|
|
658
|
-
var iColMinWidth = ColumnUtils.getMinColumnWidth();
|
|
659
660
|
if (iNewWidth < iColMinWidth) {
|
|
660
661
|
iNewWidth = iColMinWidth;
|
|
661
662
|
}
|
|
662
663
|
|
|
663
|
-
|
|
664
|
+
const iWidthChange = iNewWidth - iColumnWidth;
|
|
664
665
|
|
|
665
666
|
// Distribute any remaining delta to the remaining columns.
|
|
666
667
|
if (Math.abs(iWidthChange) < Math.abs(iSharedPixelDelta)) {
|
|
667
|
-
|
|
668
|
+
const iRemainingColumnCount = aResizableColumns.length - (i + 1);
|
|
668
669
|
iPixelDelta -= iWidthChange;
|
|
669
670
|
iSharedPixelDelta = Math.round(iPixelDelta / iRemainingColumnCount);
|
|
670
671
|
}
|
|
671
672
|
|
|
672
673
|
if (iWidthChange !== 0) {
|
|
673
|
-
|
|
674
|
-
|
|
674
|
+
let bExecuteDefault = true;
|
|
675
|
+
const sWidth = iNewWidth + "px";
|
|
675
676
|
|
|
676
677
|
if (bFireEvent) {
|
|
677
678
|
bExecuteDefault = oTable.fireColumnResize({
|
|
@@ -705,18 +706,18 @@ sap.ui.define([
|
|
|
705
706
|
return null;
|
|
706
707
|
}
|
|
707
708
|
|
|
708
|
-
|
|
709
|
+
const aColumns = oTable.getColumns();
|
|
709
710
|
if (iColumnIndex >= aColumns.length) {
|
|
710
711
|
return null;
|
|
711
712
|
}
|
|
712
713
|
|
|
713
|
-
|
|
714
|
-
|
|
714
|
+
const oColumn = aColumns[iColumnIndex];
|
|
715
|
+
const sColumnWidth = oColumn.getWidth();
|
|
715
716
|
|
|
716
717
|
// If the columns width is "auto" or specified in percentage, get the width from the DOM.
|
|
717
718
|
if (sColumnWidth === "" || sColumnWidth === "auto" || sColumnWidth.match(/%$/)) {
|
|
718
719
|
if (oColumn.getVisible()) {
|
|
719
|
-
|
|
720
|
+
const oColumnElement = oColumn.getDomRef();
|
|
720
721
|
return oColumnElement ? oColumnElement.offsetWidth : 0;
|
|
721
722
|
} else {
|
|
722
723
|
return 0;
|
|
@@ -746,12 +747,12 @@ sap.ui.define([
|
|
|
746
747
|
return oLabel && oLabel.getText && oLabel.getText() || "";
|
|
747
748
|
}
|
|
748
749
|
|
|
749
|
-
|
|
750
|
+
let sText = oColumn.getName();
|
|
750
751
|
|
|
751
752
|
if (!sText) {
|
|
752
|
-
|
|
753
|
-
for (
|
|
754
|
-
|
|
753
|
+
const aMultiLabels = oColumn.getMultiLabels();
|
|
754
|
+
for (let i = aMultiLabels.length - 1; i >= 0; i--) {
|
|
755
|
+
const sLabelText = getLabelText(aMultiLabels[i]);
|
|
755
756
|
if (ColumnUtils.getHeaderSpan(oColumn, i) === 1 && sLabelText) {
|
|
756
757
|
sText = sLabelText;
|
|
757
758
|
break;
|
|
@@ -781,10 +782,10 @@ sap.ui.define([
|
|
|
781
782
|
return null;
|
|
782
783
|
}
|
|
783
784
|
|
|
784
|
-
|
|
785
|
-
|
|
785
|
+
let oLabel;
|
|
786
|
+
const aMultiLabels = oColumn.getMultiLabels();
|
|
786
787
|
|
|
787
|
-
for (
|
|
788
|
+
for (let i = aMultiLabels.length - 1; i >= 0; i--) {
|
|
788
789
|
if (ColumnUtils.getHeaderSpan(oColumn, i) === 1) {
|
|
789
790
|
oLabel = aMultiLabels[i];
|
|
790
791
|
break;
|