@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
|
@@ -28,16 +28,16 @@ sap.ui.define([
|
|
|
28
28
|
) {
|
|
29
29
|
"use strict";
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
const SortOrder = CoreLibrary.SortOrder;
|
|
32
|
+
const ColumnUtils = TableUtils.Column;
|
|
33
|
+
const mFlexCellContentAlignment = {
|
|
34
34
|
Begin: "flex-start",
|
|
35
35
|
End: "flex-end",
|
|
36
36
|
Left: undefined, // Set on every call of TableRenderer#render to respect the current text direction.
|
|
37
37
|
Right: undefined, // Set on every call of TableRenderer#render to respect the current text direction.
|
|
38
38
|
Center: "center"
|
|
39
39
|
};
|
|
40
|
-
|
|
40
|
+
const Hook = TableUtils.Hook.Keys.TableRenderer;
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* Table renderer.
|
|
@@ -45,7 +45,7 @@ sap.ui.define([
|
|
|
45
45
|
* @namespace
|
|
46
46
|
* @alias sap.ui.table.TableRenderer
|
|
47
47
|
*/
|
|
48
|
-
|
|
48
|
+
const TableRenderer = {
|
|
49
49
|
apiVersion: 2
|
|
50
50
|
};
|
|
51
51
|
|
|
@@ -94,7 +94,7 @@ sap.ui.define([
|
|
|
94
94
|
*/
|
|
95
95
|
try {
|
|
96
96
|
// This class flags whether the sap.m. library is loaded or not.
|
|
97
|
-
|
|
97
|
+
const sSapMTableClass = TableUtils._getTableTemplateHelper(true).addTableClass();
|
|
98
98
|
if (sSapMTableClass) {
|
|
99
99
|
rm.class(sSapMTableClass);
|
|
100
100
|
}
|
|
@@ -102,7 +102,7 @@ sap.ui.define([
|
|
|
102
102
|
// ignore
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
const oScrollExtension = oTable._getScrollExtension();
|
|
106
106
|
if (oScrollExtension.isVerticalScrollbarRequired() && !oScrollExtension.isVerticalScrollbarExternal()) {
|
|
107
107
|
rm.class("sapUiTableVScr"); // show vertical scrollbar
|
|
108
108
|
}
|
|
@@ -114,8 +114,8 @@ sap.ui.define([
|
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
if (TableUtils.hasRowActions(oTable)) {
|
|
117
|
-
|
|
118
|
-
rm.class(iRowActionCount
|
|
117
|
+
const iRowActionCount = oTable.getRowActionCount();
|
|
118
|
+
rm.class(iRowActionCount === 1 ? "sapUiTableRActS" : "sapUiTableRAct");
|
|
119
119
|
} else if (TableUtils.hasRowNavigationIndicators(oTable)) {
|
|
120
120
|
rm.class("sapUiTableRowNavIndicator");
|
|
121
121
|
}
|
|
@@ -128,7 +128,7 @@ sap.ui.define([
|
|
|
128
128
|
rm.class("sapUiTableOverlay");
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
|
|
131
|
+
const sModeClass = TableUtils.Grouping.getModeCssClass(oTable);
|
|
132
132
|
if (sModeClass) {
|
|
133
133
|
rm.class(sModeClass);
|
|
134
134
|
}
|
|
@@ -187,7 +187,7 @@ sap.ui.define([
|
|
|
187
187
|
|
|
188
188
|
rm.close("div");
|
|
189
189
|
|
|
190
|
-
|
|
190
|
+
const oCreationRow = oTable.getCreationRow();
|
|
191
191
|
if (oCreationRow && oCreationRow.getVisible()) {
|
|
192
192
|
rm.renderControl(oCreationRow);
|
|
193
193
|
|
|
@@ -265,7 +265,7 @@ sap.ui.define([
|
|
|
265
265
|
};
|
|
266
266
|
|
|
267
267
|
TableRenderer.renderExtensions = function(rm, oTable, aExtensions) {
|
|
268
|
-
for (
|
|
268
|
+
for (let i = 0, l = aExtensions.length; i < l; i++) {
|
|
269
269
|
this.renderExtension(rm, oTable, aExtensions[i]);
|
|
270
270
|
}
|
|
271
271
|
};
|
|
@@ -282,7 +282,7 @@ sap.ui.define([
|
|
|
282
282
|
};
|
|
283
283
|
|
|
284
284
|
TableRenderer.renderTable = function(rm, oTable) {
|
|
285
|
-
|
|
285
|
+
const bHasRows = oTable.getRows().length > 0;
|
|
286
286
|
|
|
287
287
|
this.renderTabElement(rm, "sapUiTableCtrlBefore", bHasRows ? "0" : "-1");
|
|
288
288
|
|
|
@@ -297,7 +297,7 @@ sap.ui.define([
|
|
|
297
297
|
this.renderTabElement(rm, "sapUiTableCtrlAfter", bHasRows ? "0" : "-1");
|
|
298
298
|
this.renderTabElement(rm, null, "-1", oTable.getId() + "-focusDummy");
|
|
299
299
|
|
|
300
|
-
|
|
300
|
+
const oCreationRow = oTable.getCreationRow();
|
|
301
301
|
if (!oCreationRow || !oCreationRow.getVisible()) {
|
|
302
302
|
this.renderHSbBackground(rm, oTable);
|
|
303
303
|
this.renderHSb(rm, oTable);
|
|
@@ -319,7 +319,7 @@ sap.ui.define([
|
|
|
319
319
|
oTable._getAccRenderExtension().writeAriaAttributesFor(rm, oTable, "NODATA");
|
|
320
320
|
rm.openEnd();
|
|
321
321
|
|
|
322
|
-
|
|
322
|
+
const vNoContentMessage = TableUtils.getNoContentMessage(oTable);
|
|
323
323
|
|
|
324
324
|
if (TableUtils.isA(vNoContentMessage, "sap.ui.core.Control")) {
|
|
325
325
|
rm.renderControl(vNoContentMessage);
|
|
@@ -350,9 +350,9 @@ sap.ui.define([
|
|
|
350
350
|
// =============================================================================
|
|
351
351
|
|
|
352
352
|
TableRenderer.renderColHdr = function(rm, oTable) {
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
353
|
+
const nRows = TableUtils.getHeaderRowCount(oTable);
|
|
354
|
+
const aCols = oTable.getColumns();
|
|
355
|
+
const iFixedColumnCount = oTable.getComputedFixedColumnCount();
|
|
356
356
|
|
|
357
357
|
rm.openStart("div");
|
|
358
358
|
rm.class("sapUiTableColHdrCnt");
|
|
@@ -377,7 +377,7 @@ sap.ui.define([
|
|
|
377
377
|
rm.openStart("div", oTable.getId() + "-sapUiTableColHdrScr");
|
|
378
378
|
rm.class("sapUiTableCHA"); // marker for the column header area
|
|
379
379
|
rm.class("sapUiTableCtrlScr");
|
|
380
|
-
if (aCols.length
|
|
380
|
+
if (aCols.length === 0) {
|
|
381
381
|
rm.class("sapUiTableHasNoColumns");
|
|
382
382
|
}
|
|
383
383
|
if (iFixedColumnCount > 0) {
|
|
@@ -422,9 +422,9 @@ sap.ui.define([
|
|
|
422
422
|
};
|
|
423
423
|
|
|
424
424
|
TableRenderer.renderColRowHdr = function(rm, oTable) {
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
425
|
+
let bEnabled = false;
|
|
426
|
+
let bSelAll = false;
|
|
427
|
+
const mRenderConfig = oTable._getSelectionPlugin().getRenderConfig();
|
|
428
428
|
|
|
429
429
|
rm.openStart("div", oTable.getId() + "-selall");
|
|
430
430
|
|
|
@@ -432,14 +432,15 @@ sap.ui.define([
|
|
|
432
432
|
rm.class("sapUiTableHeaderCell");
|
|
433
433
|
rm.class("sapUiTableRowSelectionHeaderCell");
|
|
434
434
|
|
|
435
|
-
var sSelectAllResourceTextID;
|
|
436
435
|
if (mRenderConfig.headerSelector.visible) {
|
|
437
|
-
|
|
436
|
+
const bAllRowsSelected = mRenderConfig.headerSelector.selected;
|
|
438
437
|
|
|
439
438
|
if (mRenderConfig.headerSelector.type === "toggle") {
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
439
|
+
const sTitle = bAllRowsSelected ? "TBL_DESELECT_ALL" : "TBL_SELECT_ALL";
|
|
440
|
+
rm.attr("title", TableUtils.getResourceText(sTitle));
|
|
441
|
+
} else if (mRenderConfig.headerSelector.type === "custom") {
|
|
442
|
+
const sTitle = mRenderConfig.headerSelector.tooltip;
|
|
443
|
+
rm.attr("title", sTitle);
|
|
443
444
|
|
|
444
445
|
if (!mRenderConfig.headerSelector.enabled) {
|
|
445
446
|
rm.class("sapUiTableSelAllDisabled");
|
|
@@ -447,9 +448,6 @@ sap.ui.define([
|
|
|
447
448
|
}
|
|
448
449
|
}
|
|
449
450
|
|
|
450
|
-
if (sSelectAllResourceTextID) {
|
|
451
|
-
rm.attr("title", TableUtils.getResourceText(sSelectAllResourceTextID));
|
|
452
|
-
}
|
|
453
451
|
if (!bAllRowsSelected) {
|
|
454
452
|
rm.class("sapUiTableSelAll");
|
|
455
453
|
} else {
|
|
@@ -461,7 +459,7 @@ sap.ui.define([
|
|
|
461
459
|
|
|
462
460
|
rm.attr("tabindex", "-1");
|
|
463
461
|
|
|
464
|
-
|
|
462
|
+
const oParams = {
|
|
465
463
|
enabled: bEnabled,
|
|
466
464
|
checked: bSelAll
|
|
467
465
|
};
|
|
@@ -470,7 +468,7 @@ sap.ui.define([
|
|
|
470
468
|
rm.openEnd();
|
|
471
469
|
|
|
472
470
|
if (mRenderConfig.headerSelector.visible) {
|
|
473
|
-
if (mRenderConfig.headerSelector.type === "
|
|
471
|
+
if (mRenderConfig.headerSelector.type === "custom" && mRenderConfig.headerSelector.icon) {
|
|
474
472
|
rm.renderControl(mRenderConfig.headerSelector.icon);
|
|
475
473
|
} else {
|
|
476
474
|
rm.openStart("div");
|
|
@@ -492,17 +490,18 @@ sap.ui.define([
|
|
|
492
490
|
};
|
|
493
491
|
|
|
494
492
|
TableRenderer.renderCol = function(rm, oTable, oColumn, iHeader, nSpan, bIsFirstColumn, bIsLastFixedColumn, bIsLastColumn, bRenderIcons) {
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
493
|
+
let oLabel;
|
|
494
|
+
const bInvisible = !nSpan;
|
|
495
|
+
const iIndex = oColumn.getIndex();
|
|
496
|
+
const aLabels = oColumn.getMultiLabels();
|
|
497
|
+
|
|
499
498
|
if (aLabels.length > 0) {
|
|
500
499
|
oLabel = aLabels[iHeader];
|
|
501
|
-
} else if (iHeader
|
|
500
|
+
} else if (iHeader === 0) {
|
|
502
501
|
oLabel = oColumn.getLabel();
|
|
503
502
|
}
|
|
504
503
|
|
|
505
|
-
|
|
504
|
+
let sHeaderId = oColumn.getId();
|
|
506
505
|
if (iHeader === 0) {
|
|
507
506
|
rm.openStart("td", oColumn);
|
|
508
507
|
} else {
|
|
@@ -515,7 +514,7 @@ sap.ui.define([
|
|
|
515
514
|
|
|
516
515
|
rm.attr("tabindex", "-1");
|
|
517
516
|
|
|
518
|
-
|
|
517
|
+
const mAccParams = {
|
|
519
518
|
column: oColumn,
|
|
520
519
|
headerId: sHeaderId,
|
|
521
520
|
index: iIndex
|
|
@@ -527,8 +526,8 @@ sap.ui.define([
|
|
|
527
526
|
}
|
|
528
527
|
|
|
529
528
|
if (bRenderIcons) {
|
|
530
|
-
|
|
531
|
-
|
|
529
|
+
const bFiltered = oColumn.getFiltered();
|
|
530
|
+
let bSorted = oColumn.getSortOrder() !== SortOrder.None;
|
|
532
531
|
|
|
533
532
|
/** @deprecated As of version 1.120 */
|
|
534
533
|
if (!oColumn.getSorted()) {
|
|
@@ -554,7 +553,7 @@ sap.ui.define([
|
|
|
554
553
|
rm.class("sapUiTableHeaderCell");
|
|
555
554
|
rm.class("sapUiTableHeaderDataCell");
|
|
556
555
|
|
|
557
|
-
|
|
556
|
+
const oColumnHeaderMenu = oColumn.getHeaderMenuInstance();
|
|
558
557
|
if (oTable.getEnableColumnReordering() || oColumnHeaderMenu && oColumnHeaderMenu.getAriaHasPopupType() !== "None") {
|
|
559
558
|
rm.class("sapUiTableHeaderCellActive");
|
|
560
559
|
}
|
|
@@ -580,7 +579,7 @@ sap.ui.define([
|
|
|
580
579
|
if (oTable.getColumnHeaderHeight() > 0) {
|
|
581
580
|
rm.style("height", oTable.getColumnHeaderHeight() + "px");
|
|
582
581
|
}
|
|
583
|
-
|
|
582
|
+
const sTooltip = oColumn.getTooltip_AsString();
|
|
584
583
|
if (sTooltip) {
|
|
585
584
|
rm.attr("title", sTooltip);
|
|
586
585
|
}
|
|
@@ -593,8 +592,8 @@ sap.ui.define([
|
|
|
593
592
|
rm.class("sapUiTableFirstColumnCell");
|
|
594
593
|
}
|
|
595
594
|
|
|
596
|
-
|
|
597
|
-
|
|
595
|
+
const sHAlign = oColumn.getHAlign();
|
|
596
|
+
const sTextAlign = Renderer.getTextAlign(sHAlign);
|
|
598
597
|
|
|
599
598
|
if (sTextAlign) {
|
|
600
599
|
rm.style("text-align", sTextAlign);
|
|
@@ -636,7 +635,7 @@ sap.ui.define([
|
|
|
636
635
|
rm.openEnd();
|
|
637
636
|
|
|
638
637
|
// start with the first current top visible row
|
|
639
|
-
for (
|
|
638
|
+
for (let row = 0, count = oTable.getRows().length; row < count; row++) {
|
|
640
639
|
this.renderRowAddon(rm, oTable, oTable.getRows()[row], row, true);
|
|
641
640
|
}
|
|
642
641
|
|
|
@@ -654,7 +653,7 @@ sap.ui.define([
|
|
|
654
653
|
rm.openEnd();
|
|
655
654
|
|
|
656
655
|
// start with the first current top visible row
|
|
657
|
-
for (
|
|
656
|
+
for (let row = 0, count = oTable.getRows().length; row < count; row++) {
|
|
658
657
|
this.renderRowAddon(rm, oTable, oTable.getRows()[row], row, false);
|
|
659
658
|
}
|
|
660
659
|
|
|
@@ -662,8 +661,8 @@ sap.ui.define([
|
|
|
662
661
|
};
|
|
663
662
|
|
|
664
663
|
TableRenderer.addRowCSSClasses = function(rm, oTable, iIndex) {
|
|
665
|
-
|
|
666
|
-
|
|
664
|
+
const mRowCounts = oTable._getRowCounts();
|
|
665
|
+
const iFirstFixedBottomRowIndex = TableUtils.getFirstFixedBottomRowIndex(oTable);
|
|
667
666
|
|
|
668
667
|
if (iIndex === 0) {
|
|
669
668
|
rm.class("sapUiTableFirstRow");
|
|
@@ -672,10 +671,10 @@ sap.ui.define([
|
|
|
672
671
|
}
|
|
673
672
|
|
|
674
673
|
if (mRowCounts.fixedTop > 0) {
|
|
675
|
-
if (iIndex
|
|
674
|
+
if (iIndex === mRowCounts.fixedTop - 1) {
|
|
676
675
|
rm.class("sapUiTableRowLastFixedTop");
|
|
677
676
|
}
|
|
678
|
-
if (iIndex
|
|
677
|
+
if (iIndex === mRowCounts.fixedTop) {
|
|
679
678
|
rm.class("sapUiTableRowFirstScrollable");
|
|
680
679
|
}
|
|
681
680
|
}
|
|
@@ -688,7 +687,7 @@ sap.ui.define([
|
|
|
688
687
|
};
|
|
689
688
|
|
|
690
689
|
TableRenderer.renderRowAddon = function(rm, oTable, oRow, iRowIndex, bHeader) {
|
|
691
|
-
|
|
690
|
+
const bRowSelected = oTable._getSelectionPlugin().isSelected(oRow);
|
|
692
691
|
|
|
693
692
|
rm.openStart("div");
|
|
694
693
|
|
|
@@ -704,7 +703,7 @@ sap.ui.define([
|
|
|
704
703
|
rm.class("sapUiTableRowSel");
|
|
705
704
|
}
|
|
706
705
|
|
|
707
|
-
if (iRowIndex % 2
|
|
706
|
+
if (iRowIndex % 2 !== 0 && oTable.getAlternateRowColors() && !TableUtils.Grouping.isInTreeMode(oTable)) {
|
|
708
707
|
rm.class("sapUiTableRowAlternate");
|
|
709
708
|
}
|
|
710
709
|
|
|
@@ -721,7 +720,7 @@ sap.ui.define([
|
|
|
721
720
|
|
|
722
721
|
rm.attr("tabindex", "-1");
|
|
723
722
|
|
|
724
|
-
|
|
723
|
+
const oParams = {
|
|
725
724
|
rowSelected: bRowSelected,
|
|
726
725
|
rowHidden: oRow.isEmpty()
|
|
727
726
|
};
|
|
@@ -732,7 +731,7 @@ sap.ui.define([
|
|
|
732
731
|
this.writeRowHighlightContent(rm, oTable, oRow, iRowIndex);
|
|
733
732
|
this.writeRowSelectorContent(rm, oTable, oRow);
|
|
734
733
|
} else {
|
|
735
|
-
|
|
734
|
+
const oAction = oRow.getRowAction();
|
|
736
735
|
if (oAction) {
|
|
737
736
|
rm.renderControl(oAction);
|
|
738
737
|
}
|
|
@@ -776,7 +775,7 @@ sap.ui.define([
|
|
|
776
775
|
};
|
|
777
776
|
|
|
778
777
|
TableRenderer.renderTableControl = function(rm, oTable, bFixedTable) {
|
|
779
|
-
|
|
778
|
+
let iStartColumn; let iEndColumn;
|
|
780
779
|
|
|
781
780
|
if (bFixedTable) {
|
|
782
781
|
iStartColumn = 0;
|
|
@@ -786,8 +785,8 @@ sap.ui.define([
|
|
|
786
785
|
iEndColumn = oTable.getColumns().length;
|
|
787
786
|
}
|
|
788
787
|
|
|
789
|
-
|
|
790
|
-
|
|
788
|
+
const mRowCounts = oTable._getRowCounts();
|
|
789
|
+
const aRows = oTable.getRows();
|
|
791
790
|
|
|
792
791
|
if (mRowCounts.fixedTop > 0) {
|
|
793
792
|
this.renderTableControlCnt(rm, oTable, bFixedTable, iStartColumn, iEndColumn, true, false, 0, mRowCounts.fixedTop);
|
|
@@ -799,9 +798,9 @@ sap.ui.define([
|
|
|
799
798
|
};
|
|
800
799
|
|
|
801
800
|
TableRenderer.renderTableControlCnt = function(rm, oTable, bFixedTable, iStartColumn, iEndColumn, bFixedRow, bFixedBottomRow, iStartRow, iEndRow, bHeader) {
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
801
|
+
let sSuffix = bHeader ? "-header" : "-table";
|
|
802
|
+
let sId = oTable.getId() + sSuffix;
|
|
803
|
+
const sClasses = [];
|
|
805
804
|
|
|
806
805
|
if (bFixedTable) {
|
|
807
806
|
sId += "-fixed";
|
|
@@ -839,7 +838,7 @@ sap.ui.define([
|
|
|
839
838
|
|
|
840
839
|
rm.openStart("tr");
|
|
841
840
|
rm.class("sapUiTableCtrlCol");
|
|
842
|
-
if (iStartRow
|
|
841
|
+
if (iStartRow === 0) {
|
|
843
842
|
rm.class("sapUiTableCtrlFirstCol");
|
|
844
843
|
}
|
|
845
844
|
if (bHeader) {
|
|
@@ -847,20 +846,20 @@ sap.ui.define([
|
|
|
847
846
|
}
|
|
848
847
|
rm.openEnd();
|
|
849
848
|
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
849
|
+
const aCols = oTable.getColumns();
|
|
850
|
+
const aColParams = new Array(iEndColumn);
|
|
851
|
+
let iCol;
|
|
852
|
+
let oColumn;
|
|
853
|
+
let bRenderDummyColumn = !bFixedTable && iEndColumn > iStartColumn;
|
|
854
|
+
const aVisibleColumns = oTable._getVisibleColumns();
|
|
856
855
|
|
|
857
856
|
for (iCol = iStartColumn; iCol < iEndColumn; iCol++) {
|
|
858
857
|
oColumn = aCols[iCol];
|
|
859
|
-
|
|
858
|
+
const oColParam = {
|
|
860
859
|
shouldRender: !!(oColumn && oColumn.shouldRender())
|
|
861
860
|
};
|
|
862
861
|
if (oColParam.shouldRender) {
|
|
863
|
-
|
|
862
|
+
let sWidth = oColumn.getWidth();
|
|
864
863
|
if (TableUtils.isVariableWidth(sWidth)) {
|
|
865
864
|
// if some of the columns have variable width, they serve as the dummy column
|
|
866
865
|
// and take available place. Do not render a dummy column in this case.
|
|
@@ -885,10 +884,10 @@ sap.ui.define([
|
|
|
885
884
|
for (iCol = iStartColumn; iCol < iEndColumn; iCol++) {
|
|
886
885
|
sSuffix = bHeader ? "_hdr" : "_col";
|
|
887
886
|
oColumn = aCols[iCol];
|
|
888
|
-
oColParam = aColParams[iCol];
|
|
887
|
+
const oColParam = aColParams[iCol];
|
|
889
888
|
|
|
890
889
|
if (oColParam.shouldRender) {
|
|
891
|
-
if (iStartRow
|
|
890
|
+
if (iStartRow === 0) {
|
|
892
891
|
rm.openStart("th", oTable.getId() + sSuffix + iCol);
|
|
893
892
|
oTable._getAccRenderExtension().writeAriaAttributesFor(rm, oTable, "TH", {column: oColumn});
|
|
894
893
|
} else {
|
|
@@ -901,7 +900,7 @@ sap.ui.define([
|
|
|
901
900
|
rm.class("sapUiTableFirstVisibleColumnTH");
|
|
902
901
|
}
|
|
903
902
|
rm.openEnd();
|
|
904
|
-
if (iStartRow
|
|
903
|
+
if (iStartRow === 0 && TableUtils.getHeaderRowCount(oTable) === 0 && !bHeader) {
|
|
905
904
|
if (oColumn.getMultiLabels().length > 0) {
|
|
906
905
|
rm.renderControl(oColumn.getMultiLabels()[0]);
|
|
907
906
|
} else {
|
|
@@ -925,21 +924,21 @@ sap.ui.define([
|
|
|
925
924
|
rm.openStart("tbody").openEnd();
|
|
926
925
|
|
|
927
926
|
// render the table rows
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
927
|
+
const aRows = oTable.getRows();
|
|
928
|
+
let row;
|
|
929
|
+
let count;
|
|
931
930
|
if (bHeader) {
|
|
932
931
|
for (row = iStartRow, count = iEndRow; row < count; row++) {
|
|
933
932
|
this.renderColumnHeaderRow(rm, oTable, row, bFixedTable, iStartColumn, iEndColumn, bRenderDummyColumn, row === count - 1);
|
|
934
933
|
}
|
|
935
934
|
} else {
|
|
936
935
|
// check whether the row can be clicked to change the selection
|
|
937
|
-
|
|
938
|
-
|
|
936
|
+
const bSelectOnCellsAllowed = TableUtils.isRowSelectionAllowed(oTable);
|
|
937
|
+
const bRowsDraggable = oTable.getDragDropConfig().some(function(oDragDropInfo) {
|
|
939
938
|
return oDragDropInfo.getMetadata().isInstanceOf("sap.ui.core.dnd.IDragInfo") && oDragDropInfo.getSourceAggregation() === "rows";
|
|
940
939
|
});
|
|
941
940
|
|
|
942
|
-
|
|
941
|
+
const iLastFixedColumnIndex = this.getLastFixedColumnIndex(oTable);
|
|
943
942
|
|
|
944
943
|
for (row = iStartRow, count = iEndRow; row < count; row++) {
|
|
945
944
|
this.renderTableRow(rm, oTable, aRows[row], row, bFixedTable, iStartColumn, iEndColumn, false, aVisibleColumns, iLastFixedColumnIndex, bRenderDummyColumn, bSelectOnCellsAllowed, bRowsDraggable);
|
|
@@ -963,7 +962,7 @@ sap.ui.define([
|
|
|
963
962
|
rm.close("div");
|
|
964
963
|
|
|
965
964
|
if (TableUtils.Grouping.showGroupMenuButton(oTable)) {
|
|
966
|
-
|
|
965
|
+
const oIconInfo = IconPool.getIconInfo("sap-icon://drop-down-list");
|
|
967
966
|
rm.openStart("div").class("sapUiTableGroupMenuButton").openEnd();
|
|
968
967
|
rm.text(oIconInfo.content);
|
|
969
968
|
rm.close("div");
|
|
@@ -984,8 +983,8 @@ sap.ui.define([
|
|
|
984
983
|
return;
|
|
985
984
|
}
|
|
986
985
|
|
|
987
|
-
|
|
988
|
-
|
|
986
|
+
const oRowSettings = oRow.getAggregation("_settings");
|
|
987
|
+
const sHighlightClass = oRowSettings._getHighlightCSSClassName();
|
|
989
988
|
|
|
990
989
|
rm.openStart("div", oRow.getId() + "-highlight");
|
|
991
990
|
rm.class("sapUiTableRowHighlight");
|
|
@@ -1008,7 +1007,7 @@ sap.ui.define([
|
|
|
1008
1007
|
return;
|
|
1009
1008
|
}
|
|
1010
1009
|
|
|
1011
|
-
|
|
1010
|
+
const oRowSettings = oRow.getAggregation("_settings");
|
|
1012
1011
|
|
|
1013
1012
|
rm.openStart("div", oRow.getId() + "-navIndicator");
|
|
1014
1013
|
if (oRowSettings.getNavigated()) {
|
|
@@ -1029,14 +1028,14 @@ sap.ui.define([
|
|
|
1029
1028
|
//
|
|
1030
1029
|
// Render header cells
|
|
1031
1030
|
//
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1031
|
+
const aColumns = this.getColumnsToRender(oTable, iStartColumn, iEndColumn);
|
|
1032
|
+
let nSpan = 0;
|
|
1033
|
+
let iLastVisibleCol = -1;
|
|
1035
1034
|
|
|
1036
1035
|
// collect header spans and find the last visible column header
|
|
1037
1036
|
function collectHeaderSpans(oColumn, index, aCols) {
|
|
1038
|
-
|
|
1039
|
-
|
|
1037
|
+
let colSpan = ColumnUtils.getHeaderSpan(oColumn, iRow);
|
|
1038
|
+
let iColIndex;
|
|
1040
1039
|
|
|
1041
1040
|
if (nSpan < 1) {
|
|
1042
1041
|
if (colSpan > 1) {
|
|
@@ -1060,8 +1059,8 @@ sap.ui.define([
|
|
|
1060
1059
|
function renderColumn(oColumn, iIndex) {
|
|
1061
1060
|
this.renderCol(rm, oTable, oColumn, iRow, oColumn._nSpan,
|
|
1062
1061
|
iIndex === 0,
|
|
1063
|
-
bFixedTable && (iIndex
|
|
1064
|
-
!bFixedTable && (iIndex
|
|
1062
|
+
bFixedTable && (iIndex === iLastVisibleCol),
|
|
1063
|
+
!bFixedTable && (iIndex === iLastVisibleCol),
|
|
1065
1064
|
oColumn._nSpan === 1 && !oColumn._bIconsRendered);
|
|
1066
1065
|
|
|
1067
1066
|
oColumn._bIconsRendered = oColumn._bIconsRendered || oColumn._nSpan === 1;
|
|
@@ -1086,7 +1085,7 @@ sap.ui.define([
|
|
|
1086
1085
|
return;
|
|
1087
1086
|
}
|
|
1088
1087
|
|
|
1089
|
-
|
|
1088
|
+
const oSelectionPlugin = oTable._getSelectionPlugin();
|
|
1090
1089
|
|
|
1091
1090
|
if (bFixedTable) {
|
|
1092
1091
|
rm.openStart("tr", oRow.getId() + "-fixed");
|
|
@@ -1112,7 +1111,7 @@ sap.ui.define([
|
|
|
1112
1111
|
rm.class("sapUiTableRowSel");
|
|
1113
1112
|
}
|
|
1114
1113
|
|
|
1115
|
-
if (iRowIndex % 2
|
|
1114
|
+
if (iRowIndex % 2 !== 0 && oTable.getAlternateRowColors() && !TableUtils.Grouping.isInTreeMode(oTable)) {
|
|
1116
1115
|
rm.class("sapUiTableRowAlternate");
|
|
1117
1116
|
}
|
|
1118
1117
|
|
|
@@ -1121,8 +1120,8 @@ sap.ui.define([
|
|
|
1121
1120
|
rm.attr("data-sap-ui-rowindex", iRowIndex);
|
|
1122
1121
|
TableUtils.Hook.call(oTable, Hook.RenderRowStyles, rm);
|
|
1123
1122
|
|
|
1124
|
-
|
|
1125
|
-
|
|
1123
|
+
const oRowSettings = oRow.getAggregation("_settings");
|
|
1124
|
+
const oParams = {
|
|
1126
1125
|
index: iRowIndex,
|
|
1127
1126
|
fixedCol: bFixedTable,
|
|
1128
1127
|
rowNavigated: oRowSettings ? oRowSettings.getNavigated() : false
|
|
@@ -1131,10 +1130,10 @@ sap.ui.define([
|
|
|
1131
1130
|
|
|
1132
1131
|
rm.openEnd();
|
|
1133
1132
|
|
|
1134
|
-
|
|
1135
|
-
|
|
1133
|
+
const bSelected = !oRow.isEmpty() && oSelectionPlugin.isSelected(oRow); //see TableRenderer.renderRowAddon
|
|
1134
|
+
const aCells = oRow.getCells();
|
|
1136
1135
|
|
|
1137
|
-
for (
|
|
1136
|
+
for (let cell = 0, count = aCells.length; cell < count; cell++) {
|
|
1138
1137
|
this.renderTableCell(rm, oTable, oRow, aCells[cell], cell, bFixedTable, iStartColumn, iEndColumn, aVisibleColumns, iLastFixedColumnIndex, bSelected);
|
|
1139
1138
|
}
|
|
1140
1139
|
if (!bFixedTable && bHasOnlyFixedColumns && aCells.length > 0) {
|
|
@@ -1147,21 +1146,21 @@ sap.ui.define([
|
|
|
1147
1146
|
};
|
|
1148
1147
|
|
|
1149
1148
|
TableRenderer.renderTableCell = function(rm, oTable, oRow, oCell, iCellIndex, bFixedTable, iStartColumn, iEndColumn, aVisibleColumns, iLastFixedColumnIndex, bSelected) {
|
|
1150
|
-
|
|
1151
|
-
|
|
1149
|
+
const oColumn = Column.ofCell(oCell);
|
|
1150
|
+
const iColIndex = oColumn.getIndex();
|
|
1152
1151
|
|
|
1153
1152
|
if (oColumn.shouldRender() && iStartColumn <= iColIndex && iEndColumn > iColIndex) {
|
|
1154
|
-
|
|
1153
|
+
const sId = oRow.getId() + "-col" + iCellIndex;
|
|
1155
1154
|
rm.openStart("td", sId);
|
|
1156
1155
|
rm.attr("tabindex", "-1");
|
|
1157
1156
|
rm.attr("data-sap-ui-colid", oColumn.getId());
|
|
1158
1157
|
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1158
|
+
const nColumns = aVisibleColumns.length;
|
|
1159
|
+
const bIsFirstColumn = nColumns > 0 && aVisibleColumns[0] === oColumn;
|
|
1160
|
+
const bIsLastColumn = nColumns > 0 && aVisibleColumns[nColumns - 1] === oColumn;
|
|
1161
|
+
const bIsLastFixedColumn = bFixedTable && iLastFixedColumnIndex === iColIndex;
|
|
1163
1162
|
|
|
1164
|
-
|
|
1163
|
+
const oParams = {
|
|
1165
1164
|
index: iColIndex,
|
|
1166
1165
|
column: oColumn,
|
|
1167
1166
|
row: oRow,
|
|
@@ -1170,7 +1169,7 @@ sap.ui.define([
|
|
|
1170
1169
|
};
|
|
1171
1170
|
oTable._getAccRenderExtension().writeAriaAttributesFor(rm, oTable, "DATACELL", oParams);
|
|
1172
1171
|
|
|
1173
|
-
|
|
1172
|
+
const sTextAlign = Renderer.getTextAlign(oColumn.getHAlign());
|
|
1174
1173
|
if (sTextAlign) {
|
|
1175
1174
|
rm.style("text-align", sTextAlign);
|
|
1176
1175
|
}
|
|
@@ -1212,7 +1211,7 @@ sap.ui.define([
|
|
|
1212
1211
|
|
|
1213
1212
|
TableRenderer.renderTableCellControl = function(rm, oTable, oCell, bIsFirstColumn) {
|
|
1214
1213
|
if (bIsFirstColumn && TableUtils.Grouping.isInTreeMode(oTable)) {
|
|
1215
|
-
|
|
1214
|
+
const oRow = oCell.getParent();
|
|
1216
1215
|
rm.openStart("span", oRow.getId() + "-treeicon");
|
|
1217
1216
|
rm.class("sapUiTableTreeIcon");
|
|
1218
1217
|
rm.attr("tabindex", "-1");
|
|
@@ -1224,8 +1223,8 @@ sap.ui.define([
|
|
|
1224
1223
|
};
|
|
1225
1224
|
|
|
1226
1225
|
TableRenderer.renderVSb = function(rm, oTable, mConfig) {
|
|
1227
|
-
|
|
1228
|
-
|
|
1226
|
+
const oScrollExtension = oTable._getScrollExtension();
|
|
1227
|
+
const mRowCounts = oTable._getRowCounts();
|
|
1229
1228
|
|
|
1230
1229
|
mConfig = Object.assign({
|
|
1231
1230
|
tabIndex: true
|
|
@@ -1358,11 +1357,11 @@ sap.ui.define([
|
|
|
1358
1357
|
* @private
|
|
1359
1358
|
*/
|
|
1360
1359
|
TableRenderer.getLastFixedColumnIndex = function(oTable) {
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1360
|
+
const iFixedColumnCount = oTable.getComputedFixedColumnCount();
|
|
1361
|
+
const aCols = oTable.getColumns();
|
|
1362
|
+
let oColumn; let iLastFixedColumnIndex;
|
|
1364
1363
|
|
|
1365
|
-
for (
|
|
1364
|
+
for (let i = iFixedColumnCount - 1; i >= 0; i--) {
|
|
1366
1365
|
oColumn = aCols[i];
|
|
1367
1366
|
if (oColumn.shouldRender()) {
|
|
1368
1367
|
iLastFixedColumnIndex = i;
|