@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
|
@@ -40,8 +40,8 @@ sap.ui.define([
|
|
|
40
40
|
) {
|
|
41
41
|
"use strict";
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
const GroupEventType = library.GroupEventType;
|
|
44
|
+
const _private = TableUtils.createWeakMapFacade();
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
47
|
* Constructor for a new AnalyticalTable.
|
|
@@ -55,7 +55,7 @@ sap.ui.define([
|
|
|
55
55
|
* @see https://github.com/SAP/odata-vocabularies/blob/main/docs/v2-annotations.md
|
|
56
56
|
*
|
|
57
57
|
* @extends sap.ui.table.Table
|
|
58
|
-
* @version 1.
|
|
58
|
+
* @version 1.124.0
|
|
59
59
|
*
|
|
60
60
|
* @constructor
|
|
61
61
|
* @public
|
|
@@ -63,7 +63,7 @@ sap.ui.define([
|
|
|
63
63
|
* @see {@link topic:08197fa68e4f479cbe30f639cc1cd22c sap.ui.table}
|
|
64
64
|
* @see {@link fiori:/analytical-table-alv/ Analytical Table}
|
|
65
65
|
*/
|
|
66
|
-
|
|
66
|
+
const AnalyticalTable = Table.extend("sap.ui.table.AnalyticalTable", /** @lends sap.ui.table.AnalyticalTable.prototype */ {metadata: {
|
|
67
67
|
|
|
68
68
|
library: "sap.ui.table",
|
|
69
69
|
properties: {
|
|
@@ -184,12 +184,12 @@ sap.ui.define([
|
|
|
184
184
|
* @inheritDoc
|
|
185
185
|
*/
|
|
186
186
|
AnalyticalTable.prototype._getFixedBottomRowContexts = function() {
|
|
187
|
-
|
|
187
|
+
const oBinding = this.getBinding();
|
|
188
188
|
return oBinding ? [oBinding.getGrandTotalNode()] : [];
|
|
189
189
|
};
|
|
190
190
|
|
|
191
191
|
AnalyticalTable.prototype._getContexts = function(iStartIndex, iLength, iThreshold) {
|
|
192
|
-
|
|
192
|
+
const oBinding = this.getBinding();
|
|
193
193
|
if (oBinding) {
|
|
194
194
|
// first call getContexts to trigger data load but return nodes instead of contexts
|
|
195
195
|
return oBinding.getNodes(iStartIndex, iLength, iThreshold);
|
|
@@ -310,9 +310,9 @@ sap.ui.define([
|
|
|
310
310
|
};
|
|
311
311
|
|
|
312
312
|
AnalyticalTable.prototype.getModel = function(sName) {
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
if (oModel && oRowBindingInfo && oRowBindingInfo.model
|
|
313
|
+
const oModel = Table.prototype.getModel.apply(this, arguments);
|
|
314
|
+
const oRowBindingInfo = this.getBindingInfo("rows");
|
|
315
|
+
if (oModel && oRowBindingInfo && oRowBindingInfo.model === sName) {
|
|
316
316
|
ODataModelAdapter.apply(oModel);
|
|
317
317
|
}
|
|
318
318
|
return oModel;
|
|
@@ -399,8 +399,8 @@ sap.ui.define([
|
|
|
399
399
|
* @deprecated As of Version 1.44
|
|
400
400
|
*/
|
|
401
401
|
if (!oBindingInfo.parameters.hasOwnProperty("autoExpandMode")) {
|
|
402
|
-
|
|
403
|
-
if (sExpandMode
|
|
402
|
+
let sExpandMode = this.getAutoExpandMode();
|
|
403
|
+
if (sExpandMode !== "Bundled" && sExpandMode !== "Sequential") {
|
|
404
404
|
sExpandMode = "Bundled";
|
|
405
405
|
}
|
|
406
406
|
oBindingInfo.parameters.autoExpandMode = sExpandMode;
|
|
@@ -414,11 +414,11 @@ sap.ui.define([
|
|
|
414
414
|
};
|
|
415
415
|
|
|
416
416
|
AnalyticalTable.prototype._getColumnInformation = function() {
|
|
417
|
-
|
|
418
|
-
|
|
417
|
+
const aColumns = [];
|
|
418
|
+
const aTableColumns = this.getColumns();
|
|
419
419
|
|
|
420
|
-
for (
|
|
421
|
-
|
|
420
|
+
for (let i = 0; i < this._aGroupedColumns.length; i++) {
|
|
421
|
+
const oColumn = Element.getElementById(this._aGroupedColumns[i]);
|
|
422
422
|
|
|
423
423
|
if (!oColumn) {
|
|
424
424
|
continue;
|
|
@@ -434,8 +434,8 @@ sap.ui.define([
|
|
|
434
434
|
});
|
|
435
435
|
}
|
|
436
436
|
|
|
437
|
-
for (
|
|
438
|
-
|
|
437
|
+
for (let i = 0; i < aTableColumns.length; i++) {
|
|
438
|
+
const oColumn = aTableColumns[i];
|
|
439
439
|
|
|
440
440
|
if (this._aGroupedColumns.indexOf(oColumn.getId()) > -1) {
|
|
441
441
|
continue;
|
|
@@ -459,9 +459,9 @@ sap.ui.define([
|
|
|
459
459
|
};
|
|
460
460
|
|
|
461
461
|
function updateRowState(oState) {
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
462
|
+
const oBinding = this.getBinding();
|
|
463
|
+
const oBindingInfo = this.getBindingInfo("rows");
|
|
464
|
+
const oNode = oState.context;
|
|
465
465
|
|
|
466
466
|
oState.context = oNode.context; // The AnalyticalTable requests nodes from the binding.
|
|
467
467
|
|
|
@@ -492,24 +492,24 @@ sap.ui.define([
|
|
|
492
492
|
AnalyticalTable.prototype.onRowsUpdated = function(mParameters) {
|
|
493
493
|
Table.prototype.onRowsUpdated.apply(this, arguments);
|
|
494
494
|
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
495
|
+
const aRows = this.getRows();
|
|
496
|
+
const oBinding = this.getBinding();
|
|
497
|
+
const oFirstVisibleColumn = this._getVisibleColumns()[0];
|
|
498
498
|
|
|
499
|
-
for (
|
|
499
|
+
for (let iRowIndex = 0; iRowIndex < aRows.length; iRowIndex++) {
|
|
500
500
|
// show or hide the totals if not enabled - needs to be done by Table
|
|
501
501
|
// control since the model could be reused and thus the values cannot
|
|
502
502
|
// be cleared in the model - and the binding has no control over the
|
|
503
503
|
// value mapping - this happens directly via the context!
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
504
|
+
const oRow = aRows[iRowIndex];
|
|
505
|
+
const aCells = oRow.getCells();
|
|
506
|
+
const iCellCount = aCells.length;
|
|
507
507
|
|
|
508
|
-
for (
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
508
|
+
for (let iCellIndex = 0; iCellIndex < iCellCount; iCellIndex++) {
|
|
509
|
+
const oAnalyticalColumn = Column.ofCell(aCells[iCellIndex]);
|
|
510
|
+
const bIsMeasureCell = oBinding ? oBinding.isMeasure(oAnalyticalColumn.getLeadingProperty()) : false;
|
|
511
|
+
const $td = jQuery(aCells[iCellIndex].$().closest("td"));
|
|
512
|
+
let bHideCellContent = false;
|
|
513
513
|
|
|
514
514
|
if (oRow.isSummary() && bIsMeasureCell) {
|
|
515
515
|
bHideCellContent = !oAnalyticalColumn.getSummed();
|
|
@@ -523,7 +523,7 @@ sap.ui.define([
|
|
|
523
523
|
};
|
|
524
524
|
|
|
525
525
|
function onOpenTableContextMenu(oCellInfo, oMenu) {
|
|
526
|
-
|
|
526
|
+
const oRow = oCellInfo.isOfType(TableUtils.CELLTYPE.ANYCONTENTCELL) ? this.getRows()[oCellInfo.rowIndex] : null;
|
|
527
527
|
|
|
528
528
|
if (!oRow || !oRow.isGroupHeader()) {
|
|
529
529
|
this._removeGroupHeaderMenuItems(oMenu);
|
|
@@ -535,13 +535,13 @@ sap.ui.define([
|
|
|
535
535
|
}
|
|
536
536
|
|
|
537
537
|
AnalyticalTable.prototype._addGroupHeaderMenuItems = function(oMenu) {
|
|
538
|
-
|
|
538
|
+
const that = this;
|
|
539
539
|
|
|
540
540
|
function getGroupColumnInfo() {
|
|
541
|
-
|
|
541
|
+
const iIndex = that._iGroupedLevel - 1;
|
|
542
542
|
|
|
543
543
|
if (that._aGroupedColumns[iIndex]) {
|
|
544
|
-
|
|
544
|
+
const oGroupedColumn = that.getColumns().filter(function(oColumn) {
|
|
545
545
|
return that._aGroupedColumns[iIndex] === oColumn.getId();
|
|
546
546
|
})[0];
|
|
547
547
|
|
|
@@ -562,11 +562,11 @@ sap.ui.define([
|
|
|
562
562
|
this._mGroupHeaderMenuItems["visibility"] = new MenuItem({
|
|
563
563
|
text: TableUtils.getResourceText("TBL_SHOW_COLUMN"),
|
|
564
564
|
select: function() {
|
|
565
|
-
|
|
565
|
+
const oGroupColumnInfo = getGroupColumnInfo();
|
|
566
566
|
|
|
567
567
|
if (oGroupColumnInfo) {
|
|
568
|
-
|
|
569
|
-
|
|
568
|
+
const oColumn = oGroupColumnInfo.column;
|
|
569
|
+
const bShowIfGrouped = oColumn.getShowIfGrouped();
|
|
570
570
|
oColumn.setShowIfGrouped(!bShowIfGrouped);
|
|
571
571
|
|
|
572
572
|
that.fireGroup({column: oColumn, groupedColumns: oColumn.getParent()._aGroupedColumns, type: (!bShowIfGrouped ? GroupEventType.showGroupedColumn : GroupEventType.hideGroupedColumn)});
|
|
@@ -580,10 +580,10 @@ sap.ui.define([
|
|
|
580
580
|
this._mGroupHeaderMenuItems["ungroup"] = new MenuItem({
|
|
581
581
|
text: TableUtils.getResourceText("TBL_UNGROUP"),
|
|
582
582
|
select: function() {
|
|
583
|
-
|
|
583
|
+
const oGroupColumnInfo = getGroupColumnInfo();
|
|
584
584
|
|
|
585
585
|
if (oGroupColumnInfo && oGroupColumnInfo.column) {
|
|
586
|
-
|
|
586
|
+
const oUngroupedColumn = oGroupColumnInfo.column;
|
|
587
587
|
|
|
588
588
|
oUngroupedColumn.setGrouped(false);
|
|
589
589
|
that.fireGroup({column: oUngroupedColumn, groupedColumns: that._aGroupedColumns, type: GroupEventType.ungroup});
|
|
@@ -597,11 +597,11 @@ sap.ui.define([
|
|
|
597
597
|
this._mGroupHeaderMenuItems["ungroupall"] = new MenuItem({
|
|
598
598
|
text: TableUtils.getResourceText("TBL_UNGROUP_ALL"),
|
|
599
599
|
select: function() {
|
|
600
|
-
|
|
600
|
+
const aColumns = that.getColumns();
|
|
601
601
|
|
|
602
602
|
that.suspendUpdateAnalyticalInfo();
|
|
603
603
|
|
|
604
|
-
for (
|
|
604
|
+
for (let i = 0; i < aColumns.length; i++) {
|
|
605
605
|
aColumns[i].setGrouped(false);
|
|
606
606
|
}
|
|
607
607
|
|
|
@@ -616,11 +616,11 @@ sap.ui.define([
|
|
|
616
616
|
this._mGroupHeaderMenuItems["moveup"] = new MenuItem({
|
|
617
617
|
text: TableUtils.getResourceText("TBL_MOVE_UP"),
|
|
618
618
|
select: function() {
|
|
619
|
-
|
|
619
|
+
const oGroupColumnInfo = getGroupColumnInfo();
|
|
620
620
|
|
|
621
621
|
if (oGroupColumnInfo) {
|
|
622
|
-
|
|
623
|
-
|
|
622
|
+
const oColumn = oGroupColumnInfo.column;
|
|
623
|
+
const iIndex = that._aGroupedColumns.indexOf(oColumn.getId());
|
|
624
624
|
if (iIndex > 0) {
|
|
625
625
|
that._aGroupedColumns[iIndex] = that._aGroupedColumns.splice(iIndex - 1, 1, that._aGroupedColumns[iIndex])[0];
|
|
626
626
|
that.updateAnalyticalInfo();
|
|
@@ -637,11 +637,11 @@ sap.ui.define([
|
|
|
637
637
|
this._mGroupHeaderMenuItems["movedown"] = new MenuItem({
|
|
638
638
|
text: TableUtils.getResourceText("TBL_MOVE_DOWN"),
|
|
639
639
|
select: function() {
|
|
640
|
-
|
|
640
|
+
const oGroupColumnInfo = getGroupColumnInfo();
|
|
641
641
|
|
|
642
642
|
if (oGroupColumnInfo) {
|
|
643
|
-
|
|
644
|
-
|
|
643
|
+
const oColumn = oGroupColumnInfo.column;
|
|
644
|
+
const iIndex = that._aGroupedColumns.indexOf(oColumn.getId());
|
|
645
645
|
if (iIndex < that._aGroupedColumns.length) {
|
|
646
646
|
that._aGroupedColumns[iIndex] = that._aGroupedColumns.splice(iIndex + 1, 1, that._aGroupedColumns[iIndex])[0];
|
|
647
647
|
that.updateAnalyticalInfo();
|
|
@@ -725,9 +725,9 @@ sap.ui.define([
|
|
|
725
725
|
}
|
|
726
726
|
oMenu.addItem(this._mGroupHeaderMenuItems["expandall"]);
|
|
727
727
|
|
|
728
|
-
|
|
728
|
+
const oGroupColumnInfo = getGroupColumnInfo();
|
|
729
729
|
if (oGroupColumnInfo) {
|
|
730
|
-
|
|
730
|
+
const oColumn = oGroupColumnInfo.column;
|
|
731
731
|
if (oColumn.getShowIfGrouped()) {
|
|
732
732
|
this._mGroupHeaderMenuItems["visibility"].setText(TableUtils.getResourceText("TBL_HIDE_COLUMN"));
|
|
733
733
|
} else {
|
|
@@ -746,13 +746,13 @@ sap.ui.define([
|
|
|
746
746
|
return;
|
|
747
747
|
}
|
|
748
748
|
|
|
749
|
-
for (
|
|
749
|
+
for (const sItemKey in this._mGroupHeaderMenuItems) {
|
|
750
750
|
oMenu.removeItem(this._mGroupHeaderMenuItems[sItemKey]);
|
|
751
751
|
}
|
|
752
752
|
};
|
|
753
753
|
|
|
754
754
|
AnalyticalTable.prototype._cleanupGroupHeaderMenuItems = function() {
|
|
755
|
-
for (
|
|
755
|
+
for (const sItemKey in this._mGroupHeaderMenuItems) {
|
|
756
756
|
this._mGroupHeaderMenuItems[sItemKey].destroy();
|
|
757
757
|
}
|
|
758
758
|
this._mGroupHeaderMenuItems = null;
|
|
@@ -800,7 +800,7 @@ sap.ui.define([
|
|
|
800
800
|
|
|
801
801
|
AnalyticalTable.prototype.addColumn = function(vColumn, bSuppressInvalidate) {
|
|
802
802
|
//@TODO: Implement addColumn(Column[] || oColumn)
|
|
803
|
-
|
|
803
|
+
const oColumn = this._getColumn(vColumn);
|
|
804
804
|
if (oColumn.getGrouped()) {
|
|
805
805
|
this._addGroupedColumn(oColumn.getId());
|
|
806
806
|
}
|
|
@@ -811,7 +811,7 @@ sap.ui.define([
|
|
|
811
811
|
};
|
|
812
812
|
|
|
813
813
|
AnalyticalTable.prototype.insertColumn = function(vColumn, iIndex, bSuppressInvalidate) {
|
|
814
|
-
|
|
814
|
+
const oColumn = this._getColumn(vColumn);
|
|
815
815
|
if (oColumn.getGrouped()) {
|
|
816
816
|
this._addGroupedColumn(oColumn.getId());
|
|
817
817
|
}
|
|
@@ -821,16 +821,16 @@ sap.ui.define([
|
|
|
821
821
|
};
|
|
822
822
|
|
|
823
823
|
AnalyticalTable.prototype.removeColumn = function(vColumn, bSuppressInvalidate) {
|
|
824
|
-
|
|
824
|
+
const oResult = Table.prototype.removeColumn.apply(this, arguments);
|
|
825
825
|
|
|
826
826
|
// only remove from grouped columns if not caused by column move.
|
|
827
827
|
if (!this._bReorderInProcess) {
|
|
828
828
|
this._aGroupedColumns = jQuery.grep(this._aGroupedColumns, function(sValue) {
|
|
829
829
|
//check if vColum is an object with getId function
|
|
830
830
|
if (vColumn.getId) {
|
|
831
|
-
return sValue
|
|
831
|
+
return sValue !== vColumn.getId();
|
|
832
832
|
} else {
|
|
833
|
-
return sValue
|
|
833
|
+
return sValue === vColumn;
|
|
834
834
|
}
|
|
835
835
|
});
|
|
836
836
|
}
|
|
@@ -842,7 +842,7 @@ sap.ui.define([
|
|
|
842
842
|
|
|
843
843
|
AnalyticalTable.prototype.removeAllColumns = function(bSuppressInvalidate) {
|
|
844
844
|
this._aGroupedColumns = [];
|
|
845
|
-
|
|
845
|
+
const aResult = Table.prototype.removeAllColumns.apply(this, arguments);
|
|
846
846
|
|
|
847
847
|
this._updateColumns(bSuppressInvalidate);
|
|
848
848
|
|
|
@@ -851,7 +851,7 @@ sap.ui.define([
|
|
|
851
851
|
|
|
852
852
|
AnalyticalTable.prototype._getColumn = function(vColumn) {
|
|
853
853
|
if (typeof vColumn === "string") {
|
|
854
|
-
|
|
854
|
+
const oColumn = new AnalyticalColumn({
|
|
855
855
|
leadingProperty: vColumn,
|
|
856
856
|
template: vColumn,
|
|
857
857
|
managed: true
|
|
@@ -882,10 +882,10 @@ sap.ui.define([
|
|
|
882
882
|
return;
|
|
883
883
|
}
|
|
884
884
|
|
|
885
|
-
|
|
885
|
+
const oBinding = this.getBinding();
|
|
886
886
|
if (oBinding) {
|
|
887
|
-
|
|
888
|
-
|
|
887
|
+
const aColumnInfo = this._getColumnInformation();
|
|
888
|
+
const iNumberOfExpandedLevels = oBinding.getNumberOfExpandedLevels() || 0;
|
|
889
889
|
|
|
890
890
|
// The binding does not support the number of expanded levels to be bigger than the number of grouped columns.
|
|
891
891
|
if (iNumberOfExpandedLevels > this._aGroupedColumns.length) {
|
|
@@ -910,7 +910,7 @@ sap.ui.define([
|
|
|
910
910
|
};
|
|
911
911
|
|
|
912
912
|
AnalyticalTable.prototype._updateTotalRow = function(bSuppressInvalidate) {
|
|
913
|
-
|
|
913
|
+
const oBinding = this.getBinding();
|
|
914
914
|
|
|
915
915
|
this.setProperty("rowCountConstraints", {
|
|
916
916
|
fixedTop: false,
|
|
@@ -923,20 +923,20 @@ sap.ui.define([
|
|
|
923
923
|
return;
|
|
924
924
|
}
|
|
925
925
|
|
|
926
|
-
|
|
927
|
-
|
|
926
|
+
const oBinding = this.getBinding();
|
|
927
|
+
const oResult = oBinding && oBinding.getAnalyticalQueryResult();
|
|
928
928
|
|
|
929
929
|
if (oResult) {
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
930
|
+
const aColumns = this.getColumns();
|
|
931
|
+
const aGroupedDimensions = [];
|
|
932
|
+
let aUngroupedDimensions = [];
|
|
933
|
+
const aDimensions = [];
|
|
934
|
+
const oDimensionIndex = {};
|
|
935
|
+
let oColumn;
|
|
936
|
+
let oDimension;
|
|
937
937
|
|
|
938
938
|
// calculate an index of all dimensions and their columns. Grouping is done per dimension.
|
|
939
|
-
for (
|
|
939
|
+
for (let i = 0; i < aColumns.length; i++) {
|
|
940
940
|
oColumn = aColumns[i];
|
|
941
941
|
oColumn._isLastGroupableLeft = false;
|
|
942
942
|
oColumn._bLastGroupAndGrouped = false;
|
|
@@ -947,11 +947,11 @@ sap.ui.define([
|
|
|
947
947
|
continue;
|
|
948
948
|
}
|
|
949
949
|
|
|
950
|
-
|
|
950
|
+
const sLeadingProperty = oColumn.getLeadingProperty();
|
|
951
951
|
oDimension = oResult.findDimensionByPropertyName(sLeadingProperty);
|
|
952
952
|
|
|
953
953
|
if (oDimension) {
|
|
954
|
-
|
|
954
|
+
const sDimensionName = oDimension.getName();
|
|
955
955
|
if (!oDimensionIndex[sDimensionName]) {
|
|
956
956
|
oDimensionIndex[sDimensionName] = {dimension: oDimension, columns: [oColumn]};
|
|
957
957
|
} else {
|
|
@@ -960,18 +960,18 @@ sap.ui.define([
|
|
|
960
960
|
|
|
961
961
|
// if one column of a dimension is grouped, the dimension is considered as grouped.
|
|
962
962
|
// all columns which are not explicitly grouped will be flagged as dependendGrouped in the next step
|
|
963
|
-
if (oColumn.getGrouped() && aGroupedDimensions.indexOf(sDimensionName)
|
|
963
|
+
if (oColumn.getGrouped() && aGroupedDimensions.indexOf(sDimensionName) === -1) {
|
|
964
964
|
aGroupedDimensions.push(sDimensionName);
|
|
965
965
|
}
|
|
966
966
|
|
|
967
|
-
if (aDimensions.indexOf(sDimensionName)
|
|
967
|
+
if (aDimensions.indexOf(sDimensionName) === -1) {
|
|
968
968
|
aDimensions.push(sDimensionName);
|
|
969
969
|
}
|
|
970
970
|
}
|
|
971
971
|
}
|
|
972
972
|
|
|
973
973
|
aUngroupedDimensions = jQuery.grep(aDimensions, function(s) {
|
|
974
|
-
return aGroupedDimensions.indexOf(aGroupedDimensions, s)
|
|
974
|
+
return aGroupedDimensions.indexOf(aGroupedDimensions, s) === -1;
|
|
975
975
|
});
|
|
976
976
|
|
|
977
977
|
// for all grouped dimensions
|
|
@@ -987,16 +987,16 @@ sap.ui.define([
|
|
|
987
987
|
|
|
988
988
|
// if there is only one dimension left, their columns must remain visible even though they are grouped.
|
|
989
989
|
// this behavior is controlled by the flag _bLastGroupAndGrouped
|
|
990
|
-
if (aGroupedDimensions.length
|
|
990
|
+
if (aGroupedDimensions.length === aDimensions.length) {
|
|
991
991
|
oDimension = oResult.findDimensionByPropertyName(Element.getElementById(this._aGroupedColumns[this._aGroupedColumns.length - 1]).getLeadingProperty());
|
|
992
|
-
|
|
992
|
+
const aGroupedDimensionColumns = oDimensionIndex[oDimension.getName()].columns;
|
|
993
993
|
jQuery.each(aGroupedDimensionColumns, function(i, o) {
|
|
994
994
|
o._bLastGroupAndGrouped = true;
|
|
995
995
|
});
|
|
996
996
|
}
|
|
997
997
|
}
|
|
998
998
|
|
|
999
|
-
if (aUngroupedDimensions.length
|
|
999
|
+
if (aUngroupedDimensions.length === 1) {
|
|
1000
1000
|
jQuery.each(oDimensionIndex[aUngroupedDimensions[0]].columns, function(j, o) {
|
|
1001
1001
|
o._isLastGroupableLeft = true;
|
|
1002
1002
|
});
|
|
@@ -1005,17 +1005,17 @@ sap.ui.define([
|
|
|
1005
1005
|
};
|
|
1006
1006
|
|
|
1007
1007
|
AnalyticalTable.prototype._getFirstMeasureColumnIndex = function() {
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1008
|
+
const oBinding = this.getBinding();
|
|
1009
|
+
const oResultSet = oBinding && oBinding.getAnalyticalQueryResult();
|
|
1010
|
+
const aColumns = this._getVisibleColumns();
|
|
1011
1011
|
|
|
1012
1012
|
if (!oResultSet) {
|
|
1013
1013
|
return -1;
|
|
1014
1014
|
}
|
|
1015
1015
|
|
|
1016
|
-
for (
|
|
1017
|
-
|
|
1018
|
-
|
|
1016
|
+
for (let i = 0; i < aColumns.length; i++) {
|
|
1017
|
+
const oColumn = aColumns[i];
|
|
1018
|
+
const sLeadingProperty = oColumn.getLeadingProperty();
|
|
1019
1019
|
|
|
1020
1020
|
if (oResultSet.findMeasureByName(sLeadingProperty) || oResultSet.findMeasureByPropertyName(sLeadingProperty)) {
|
|
1021
1021
|
return i;
|
|
@@ -1024,11 +1024,11 @@ sap.ui.define([
|
|
|
1024
1024
|
};
|
|
1025
1025
|
|
|
1026
1026
|
AnalyticalTable.prototype._getTotalRowCount = function() {
|
|
1027
|
-
|
|
1027
|
+
let iTotalRowCount = Table.prototype._getTotalRowCount.apply(this, arguments);
|
|
1028
1028
|
|
|
1029
1029
|
if (iTotalRowCount === 1) {
|
|
1030
|
-
|
|
1031
|
-
|
|
1030
|
+
const oBinding = this.getBinding();
|
|
1031
|
+
const bHasGrandTotal = oBinding ? oBinding.providesGrandTotal() && oBinding.hasTotaledMeasures() : false;
|
|
1032
1032
|
|
|
1033
1033
|
if (bHasGrandTotal) {
|
|
1034
1034
|
iTotalRowCount = 0; // If there's only the grand total, the table has to act as if it's empty.
|
|
@@ -1045,7 +1045,7 @@ sap.ui.define([
|
|
|
1045
1045
|
* @public
|
|
1046
1046
|
*/
|
|
1047
1047
|
AnalyticalTable.prototype.getTotalSize = function() {
|
|
1048
|
-
|
|
1048
|
+
const oBinding = this.getBinding();
|
|
1049
1049
|
if (oBinding) {
|
|
1050
1050
|
return oBinding.getTotalSize();
|
|
1051
1051
|
}
|
|
@@ -1059,8 +1059,8 @@ sap.ui.define([
|
|
|
1059
1059
|
AnalyticalTable.prototype._onPersoApplied = function() {
|
|
1060
1060
|
Table.prototype._onPersoApplied.apply(this, arguments);
|
|
1061
1061
|
this._aGroupedColumns = [];
|
|
1062
|
-
|
|
1063
|
-
for (
|
|
1062
|
+
const aColumns = this.getColumns();
|
|
1063
|
+
for (let i = 0, l = aColumns.length; i < l; i++) {
|
|
1064
1064
|
if (aColumns[i].getGrouped()) {
|
|
1065
1065
|
this._addGroupedColumn(aColumns[i].getId());
|
|
1066
1066
|
}
|
|
@@ -1075,7 +1075,7 @@ sap.ui.define([
|
|
|
1075
1075
|
};
|
|
1076
1076
|
|
|
1077
1077
|
AnalyticalTable.prototype._removeGroupedColumn = function(sColumnId) {
|
|
1078
|
-
|
|
1078
|
+
const iIndex = this._aGroupedColumns.indexOf(sColumnId);
|
|
1079
1079
|
|
|
1080
1080
|
if (iIndex >= 0) {
|
|
1081
1081
|
this._aGroupedColumns.splice(iIndex, 1);
|
|
@@ -1284,16 +1284,16 @@ sap.ui.define([
|
|
|
1284
1284
|
* @ui5-restricted sap.ui.comp
|
|
1285
1285
|
*/
|
|
1286
1286
|
AnalyticalTable.prototype.getAnalyticalInfoOfRow = function(oRow) {
|
|
1287
|
-
|
|
1288
|
-
|
|
1287
|
+
const oBinding = this.getBinding();
|
|
1288
|
+
const oContext = oRow ? oRow.getRowBindingContext() : null;
|
|
1289
1289
|
|
|
1290
1290
|
if (!TableUtils.isA(oRow, "sap.ui.table.Row") || oRow.getParent() !== this || !oBinding || !oContext) {
|
|
1291
1291
|
return null;
|
|
1292
1292
|
}
|
|
1293
1293
|
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1294
|
+
const bIsGrandTotal = oContext === oBinding.getGrandTotalContext();
|
|
1295
|
+
let oContextInfo = null;
|
|
1296
|
+
let iLevel = -1;
|
|
1297
1297
|
if (bIsGrandTotal) {
|
|
1298
1298
|
oContextInfo = oBinding.getGrandTotalContextInfo();
|
|
1299
1299
|
iLevel = 0;
|
|
@@ -1304,15 +1304,15 @@ sap.ui.define([
|
|
|
1304
1304
|
}
|
|
1305
1305
|
}
|
|
1306
1306
|
|
|
1307
|
-
|
|
1308
|
-
|
|
1307
|
+
const bIsGroup = oContextInfo && oBinding.nodeHasChildren && oBinding.nodeHasChildren(oContextInfo);
|
|
1308
|
+
const bIsGroupTotal = !bIsGroup && !bIsGrandTotal && oContextInfo && oContextInfo.nodeState && oContextInfo.nodeState.sum;
|
|
1309
1309
|
|
|
1310
|
-
|
|
1310
|
+
const aGroupedColumns = [];
|
|
1311
1311
|
|
|
1312
1312
|
if (bIsGroupTotal || bIsGroup) {
|
|
1313
|
-
|
|
1313
|
+
const aAllGroupedColumns = this.getGroupedColumns();
|
|
1314
1314
|
if (aAllGroupedColumns.length > 0 && iLevel > 0 && iLevel <= aAllGroupedColumns.length) {
|
|
1315
|
-
for (
|
|
1315
|
+
for (let i = 0; i < iLevel; i++) {
|
|
1316
1316
|
aGroupedColumns.push(aAllGroupedColumns[i]);
|
|
1317
1317
|
}
|
|
1318
1318
|
}
|
|
@@ -1345,7 +1345,7 @@ sap.ui.define([
|
|
|
1345
1345
|
return;
|
|
1346
1346
|
}
|
|
1347
1347
|
|
|
1348
|
-
|
|
1348
|
+
const oBinding = this.getBinding();
|
|
1349
1349
|
|
|
1350
1350
|
if (!oBinding.bUseBatchRequests) {
|
|
1351
1351
|
_private(this).bPendingRequest = true;
|
|
@@ -1359,7 +1359,7 @@ sap.ui.define([
|
|
|
1359
1359
|
return;
|
|
1360
1360
|
}
|
|
1361
1361
|
|
|
1362
|
-
|
|
1362
|
+
const oBinding = this.getBinding();
|
|
1363
1363
|
|
|
1364
1364
|
if (!oBinding.bUseBatchRequests) {
|
|
1365
1365
|
_private(this).bPendingRequest = false;
|