@visactor/vtable 1.15.2 → 1.16.0-alpha.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/cjs/PivotChart.d.ts +0 -1
- package/cjs/PivotChart.js +2 -5
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/PivotTable.d.ts +2 -2
- package/cjs/PivotTable.js +41 -33
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +1 -2
- package/cjs/core/BaseTable.js +2 -2
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/data/DataSource.d.ts +2 -2
- package/cjs/data/DataSource.js +4 -4
- package/cjs/data/DataSource.js.map +1 -1
- package/cjs/dataset/dataset.d.ts +3 -2
- package/cjs/dataset/dataset.js +12 -9
- package/cjs/dataset/dataset.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/layout/layout-helper.js +8 -8
- package/cjs/layout/layout-helper.js.map +1 -1
- package/cjs/layout/pivot-header-layout.d.ts +33 -5
- package/cjs/layout/pivot-header-layout.js +137 -31
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/layout/tree-helper.d.ts +5 -4
- package/cjs/layout/tree-helper.js +105 -23
- package/cjs/layout/tree-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.d.ts +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.js +5 -2
- package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.js +8 -4
- package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/layout/frozen.d.ts +1 -0
- package/cjs/scenegraph/layout/frozen.js +91 -2
- package/cjs/scenegraph/layout/frozen.js.map +1 -1
- package/cjs/scenegraph/layout/update-col.js +4 -1
- package/cjs/scenegraph/layout/update-col.js.map +1 -1
- package/cjs/scenegraph/layout/update-row.js +3 -2
- package/cjs/scenegraph/layout/update-row.js.map +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +5 -0
- package/cjs/scenegraph/scenegraph.js +18 -0
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/utils/get-hierarchy-offset.js +1 -1
- package/cjs/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
- package/cjs/state/state.d.ts +2 -0
- package/cjs/state/state.js +7 -2
- package/cjs/state/state.js.map +1 -1
- package/cjs/tools/NumberMap.js +4 -2
- package/cjs/tools/NumberMap.js.map +1 -1
- package/cjs/tools/diff-cell.d.ts +58 -3
- package/cjs/tools/diff-cell.js +90 -11
- package/cjs/tools/diff-cell.js.map +1 -1
- package/cjs/tools/get-data-path/create-dataset.js +1 -1
- package/cjs/tools/get-data-path/create-dataset.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +2 -1
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/list-table/define/basic-define.d.ts +1 -1
- package/cjs/ts-types/list-table/define/basic-define.js.map +1 -1
- package/cjs/ts-types/list-table/layout-map/api.d.ts +4 -4
- package/cjs/ts-types/list-table/layout-map/api.js.map +1 -1
- package/cjs/ts-types/pivot-table/dimension/basic-dimension.d.ts +2 -2
- package/cjs/ts-types/pivot-table/dimension/basic-dimension.js.map +1 -1
- package/cjs/ts-types/pivot-table/indicator/basic-indicator.d.ts +1 -1
- package/cjs/ts-types/pivot-table/indicator/basic-indicator.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +6 -3
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +759 -116
- package/dist/vtable.min.js +2 -2
- package/es/PivotChart.d.ts +0 -1
- package/es/PivotChart.js +2 -5
- package/es/PivotChart.js.map +1 -1
- package/es/PivotTable.d.ts +2 -2
- package/es/PivotTable.js +41 -33
- package/es/PivotTable.js.map +1 -1
- package/es/core/BaseTable.d.ts +1 -2
- package/es/core/BaseTable.js +2 -2
- package/es/core/BaseTable.js.map +1 -1
- package/es/data/DataSource.d.ts +2 -2
- package/es/data/DataSource.js +4 -4
- package/es/data/DataSource.js.map +1 -1
- package/es/dataset/dataset.d.ts +3 -2
- package/es/dataset/dataset.js +12 -9
- package/es/dataset/dataset.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/layout/layout-helper.js +8 -8
- package/es/layout/layout-helper.js.map +1 -1
- package/es/layout/pivot-header-layout.d.ts +33 -5
- package/es/layout/pivot-header-layout.js +138 -33
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/layout/tree-helper.d.ts +5 -4
- package/es/layout/tree-helper.js +102 -19
- package/es/layout/tree-helper.js.map +1 -1
- package/es/scenegraph/group-creater/progress/proxy.d.ts +1 -1
- package/es/scenegraph/group-creater/progress/proxy.js +5 -2
- package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/update-auto-row.js +8 -4
- package/es/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -1
- package/es/scenegraph/layout/compute-col-width.js +1 -1
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/layout/frozen.d.ts +1 -0
- package/es/scenegraph/layout/frozen.js +89 -0
- package/es/scenegraph/layout/frozen.js.map +1 -1
- package/es/scenegraph/layout/update-col.js +4 -1
- package/es/scenegraph/layout/update-col.js.map +1 -1
- package/es/scenegraph/layout/update-row.js +3 -2
- package/es/scenegraph/layout/update-row.js.map +1 -1
- package/es/scenegraph/scenegraph.d.ts +5 -0
- package/es/scenegraph/scenegraph.js +16 -1
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/utils/get-hierarchy-offset.js +1 -1
- package/es/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
- package/es/state/state.d.ts +2 -0
- package/es/state/state.js +7 -2
- package/es/state/state.js.map +1 -1
- package/es/tools/NumberMap.js +4 -2
- package/es/tools/NumberMap.js.map +1 -1
- package/es/tools/diff-cell.d.ts +58 -3
- package/es/tools/diff-cell.js +85 -9
- package/es/tools/diff-cell.js.map +1 -1
- package/es/tools/get-data-path/create-dataset.js +1 -1
- package/es/tools/get-data-path/create-dataset.js.map +1 -1
- package/es/ts-types/base-table.d.ts +2 -1
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/list-table/define/basic-define.d.ts +1 -1
- package/es/ts-types/list-table/define/basic-define.js.map +1 -1
- package/es/ts-types/list-table/layout-map/api.d.ts +4 -4
- package/es/ts-types/list-table/layout-map/api.js.map +1 -1
- package/es/ts-types/pivot-table/dimension/basic-dimension.d.ts +2 -2
- package/es/ts-types/pivot-table/dimension/basic-dimension.js.map +1 -1
- package/es/ts-types/pivot-table/indicator/basic-indicator.d.ts +1 -1
- package/es/ts-types/pivot-table/indicator/basic-indicator.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +6 -3
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +5 -5
package/dist/vtable.js
CHANGED
|
@@ -29230,9 +29230,9 @@
|
|
|
29230
29230
|
this.delLast();
|
|
29231
29231
|
}
|
|
29232
29232
|
addAndReorder(index, newValue) {
|
|
29233
|
-
const lastIndex = this.getLastIndex();
|
|
29234
|
-
this.adjustOrder(index, index + 1, lastIndex - index);
|
|
29235
29233
|
if (isValid$3(newValue)) {
|
|
29234
|
+
const lastIndex = this.getLastIndex();
|
|
29235
|
+
this.adjustOrder(index, index + 1, lastIndex - index);
|
|
29236
29236
|
this.put(index, newValue);
|
|
29237
29237
|
}
|
|
29238
29238
|
}
|
|
@@ -30745,7 +30745,7 @@
|
|
|
30745
30745
|
hasHierarchyStateExpand = false;
|
|
30746
30746
|
beforeChangedRecordsMap = new Map();
|
|
30747
30747
|
registedAggregators = {};
|
|
30748
|
-
rowHierarchyType;
|
|
30748
|
+
rowHierarchyType = 'grid';
|
|
30749
30749
|
fieldAggregators = [];
|
|
30750
30750
|
columns;
|
|
30751
30751
|
lastFilterRules;
|
|
@@ -36038,7 +36038,11 @@
|
|
|
36038
36038
|
if (layoutMap.isHeader(col, row)) {
|
|
36039
36039
|
const hd = layoutMap.getHeader(col, row);
|
|
36040
36040
|
if (isValid$3(hd?.hierarchyLevel)) {
|
|
36041
|
-
cellHierarchyIndent =
|
|
36041
|
+
cellHierarchyIndent =
|
|
36042
|
+
(hd.hierarchyLevel ?? 0) *
|
|
36043
|
+
(layoutMap.rowHierarchyType === 'tree'
|
|
36044
|
+
? layoutMap.rowHierarchyIndent ?? 0
|
|
36045
|
+
: 0);
|
|
36042
36046
|
if (layoutMap.rowHierarchyTextStartAlignment &&
|
|
36043
36047
|
!table.internalProps.headerHelper.getHierarchyIcon(col, row)) {
|
|
36044
36048
|
cellHierarchyIndent += table.internalProps.headerHelper.getHierarchyIconWidth();
|
|
@@ -42804,7 +42808,10 @@
|
|
|
42804
42808
|
}
|
|
42805
42809
|
if (isValid$3(hd?.hierarchyLevel)) {
|
|
42806
42810
|
cellHierarchyIndent =
|
|
42807
|
-
(hd.hierarchyLevel ?? 0) *
|
|
42811
|
+
(hd.hierarchyLevel ?? 0) *
|
|
42812
|
+
(layoutMap.rowHierarchyType === 'tree'
|
|
42813
|
+
? layoutMap.rowHierarchyIndent ?? 0
|
|
42814
|
+
: 0);
|
|
42808
42815
|
if (layoutMap.rowHierarchyTextStartAlignment &&
|
|
42809
42816
|
!table.internalProps.headerHelper.getHierarchyIcon(col, row)) {
|
|
42810
42817
|
cellHierarchyIndent += table.internalProps.headerHelper.getHierarchyIconWidth();
|
|
@@ -43808,10 +43815,11 @@
|
|
|
43808
43815
|
y = cellGroup._prev?.attribute.y + table.getRowHeight(cellGroup._prev.row);
|
|
43809
43816
|
}
|
|
43810
43817
|
else if (part) {
|
|
43811
|
-
const
|
|
43818
|
+
const baseRowIndex = rowEnd === table.rowCount - table.bottomFrozenRowCount - 1 ? rowEnd : rowEnd + 1;
|
|
43819
|
+
const baseCellGroup = table.scenegraph.highPerformanceGetCell(col, baseRowIndex, true);
|
|
43812
43820
|
y = baseCellGroup.attribute.y;
|
|
43813
43821
|
if (isValid$3(y)) {
|
|
43814
|
-
for (let r = row; r
|
|
43822
|
+
for (let r = row; r < baseRowIndex; r++) {
|
|
43815
43823
|
y -= table.getRowHeight(r);
|
|
43816
43824
|
}
|
|
43817
43825
|
}
|
|
@@ -43837,9 +43845,15 @@
|
|
|
43837
43845
|
y = cellGroup._next?.attribute.y - table.getRowHeight(cellGroup.row);
|
|
43838
43846
|
}
|
|
43839
43847
|
else if (part) {
|
|
43840
|
-
const
|
|
43841
|
-
|
|
43842
|
-
|
|
43848
|
+
const baseRowIndex = rowStart <= table.frozenRowCount ? table.frozenRowCount : rowStart - 1;
|
|
43849
|
+
if (rowStart <= table.frozenRowCount) {
|
|
43850
|
+
y = 0;
|
|
43851
|
+
}
|
|
43852
|
+
else {
|
|
43853
|
+
const baseCellGroup = table.scenegraph.highPerformanceGetCell(col, baseRowIndex, true);
|
|
43854
|
+
y = baseCellGroup.attribute.y;
|
|
43855
|
+
}
|
|
43856
|
+
for (let r = baseRowIndex; r < row; r++) {
|
|
43843
43857
|
const height = table.getRowHeight(r);
|
|
43844
43858
|
y += height;
|
|
43845
43859
|
}
|
|
@@ -44492,7 +44506,6 @@
|
|
|
44492
44506
|
rowStart = 0;
|
|
44493
44507
|
rowEnd = 0;
|
|
44494
44508
|
referenceRow = 0;
|
|
44495
|
-
bodyTopRow;
|
|
44496
44509
|
bodyBottomRow;
|
|
44497
44510
|
screenRowCount;
|
|
44498
44511
|
firstScreenRowLimit;
|
|
@@ -44551,6 +44564,9 @@
|
|
|
44551
44564
|
get bodyLeftCol() {
|
|
44552
44565
|
return this.table.frozenColCount;
|
|
44553
44566
|
}
|
|
44567
|
+
get bodyTopRow() {
|
|
44568
|
+
return this.table.frozenRowCount;
|
|
44569
|
+
}
|
|
44554
44570
|
setParamsForColumn() {
|
|
44555
44571
|
this.bodyRightCol = this.table.colCount - 1 - this.table.rightFrozenColCount;
|
|
44556
44572
|
const totalActualBodyColCount = Math.min(this.colLimit, this.bodyRightCol - this.bodyLeftCol + 1);
|
|
@@ -44570,7 +44586,6 @@
|
|
|
44570
44586
|
this.colUpdatePos = this.bodyRightCol;
|
|
44571
44587
|
}
|
|
44572
44588
|
setParamsForRow() {
|
|
44573
|
-
this.bodyTopRow = this.table.frozenRowCount;
|
|
44574
44589
|
this.bodyBottomRow = this.table.rowCount - 1 - this.table.bottomFrozenRowCount;
|
|
44575
44590
|
const totalActualBodyRowCount = Math.min(this.rowLimit, this.bodyBottomRow - this.bodyTopRow + 1);
|
|
44576
44591
|
this.totalActualBodyRowCount = totalActualBodyRowCount;
|
|
@@ -44589,7 +44604,6 @@
|
|
|
44589
44604
|
this.rowUpdatePos = this.bodyBottomRow;
|
|
44590
44605
|
}
|
|
44591
44606
|
refreshRowCount() {
|
|
44592
|
-
this.bodyTopRow = this.table.frozenRowCount;
|
|
44593
44607
|
this.bodyBottomRow = this.table.rowCount - 1 - this.table.bottomFrozenRowCount;
|
|
44594
44608
|
const totalActualBodyRowCount = Math.min(this.rowLimit, this.bodyBottomRow - this.bodyTopRow + 1);
|
|
44595
44609
|
this.totalActualBodyRowCount = totalActualBodyRowCount;
|
|
@@ -45782,8 +45796,8 @@
|
|
|
45782
45796
|
rowUpdatePos = isValid$3(rowUpdatePos) ? (isValid$3(pos) ? Math.min(rowUpdatePos, pos) : rowUpdatePos) : pos;
|
|
45783
45797
|
}
|
|
45784
45798
|
if (isNumber$4(updateAfter)) {
|
|
45785
|
-
for (let col = 0; col < table.colCount; col++) {
|
|
45786
|
-
for (let row = updateAfter; row < table.rowCount; row++) {
|
|
45799
|
+
for (let col = 0; col < Math.max(table.colCount, table.internalProps._oldColCount ?? table.colCount); col++) {
|
|
45800
|
+
for (let row = updateAfter; row < Math.max(table.rowCount, table.internalProps._oldRowCount ?? table.rowCount); row++) {
|
|
45787
45801
|
const cellGroup = scene.highPerformanceGetCell(col, row, true);
|
|
45788
45802
|
cellGroup && (cellGroup.needUpdate = true);
|
|
45789
45803
|
}
|
|
@@ -45800,7 +45814,7 @@
|
|
|
45800
45814
|
const minRow = Math.min(...addRows);
|
|
45801
45815
|
scene.proxy.rowUpdatePos = Math.min(minRow, scene.proxy.rowUpdatePos);
|
|
45802
45816
|
}
|
|
45803
|
-
scene.proxy.rowUpdateDirection = '
|
|
45817
|
+
scene.proxy.rowUpdateDirection = 'down';
|
|
45804
45818
|
scene.proxy.updateCellGroups(scene.proxy.screenRowCount * 2);
|
|
45805
45819
|
updateBottomFrozeCellGroups();
|
|
45806
45820
|
}
|
|
@@ -46652,6 +46666,116 @@
|
|
|
46652
46666
|
container.appendChild(newNode);
|
|
46653
46667
|
}
|
|
46654
46668
|
}
|
|
46669
|
+
function resetRowFrozen(scene) {
|
|
46670
|
+
if (scene.frozenRowCount > scene.table.frozenRowCount) {
|
|
46671
|
+
scene.bodyGroup.setAttribute('width', scene.colHeaderGroup.attribute.width);
|
|
46672
|
+
scene.bodyGroup.setAttribute('x', scene.colHeaderGroup.attribute.x);
|
|
46673
|
+
scene.rowHeaderGroup.setAttribute('width', scene.cornerHeaderGroup.attribute.width);
|
|
46674
|
+
for (let i = 0; i < scene.frozenRowCount - scene.table.frozenRowCount; i++) {
|
|
46675
|
+
moveRowFromColHeaderToBody(scene);
|
|
46676
|
+
moveRowFromCornerHeaderToRowHeader(scene);
|
|
46677
|
+
moveRowFromTopRightCornerToRight(scene);
|
|
46678
|
+
}
|
|
46679
|
+
}
|
|
46680
|
+
else if (scene.frozenRowCount < scene.table.frozenRowCount) {
|
|
46681
|
+
scene.colHeaderGroup.setAttribute('width', scene.bodyGroup.attribute.width);
|
|
46682
|
+
scene.colHeaderGroup.setAttribute('x', scene.bodyGroup.attribute.x);
|
|
46683
|
+
scene.cornerHeaderGroup.setAttribute('width', scene.rowHeaderGroup.attribute.width);
|
|
46684
|
+
for (let i = 0; i < scene.table.frozenRowCount - scene.frozenRowCount; i++) {
|
|
46685
|
+
moveRowFromBodyToColHeader(scene);
|
|
46686
|
+
moveRowFromRowHeaderToCornerHeader(scene);
|
|
46687
|
+
moveRowFromRightToTopRightCorner(scene);
|
|
46688
|
+
}
|
|
46689
|
+
}
|
|
46690
|
+
updateReactComponentContainer(scene);
|
|
46691
|
+
scene.recreateAllSelectRangeComponents();
|
|
46692
|
+
scene.frozenRowCount = scene.table.frozenRowCount;
|
|
46693
|
+
scene.frozenColCount = scene.rowHeaderGroup?.childrenCount ?? 0;
|
|
46694
|
+
scene.proxy.rowStart = scene.bodyGroup.firstChild?.firstChild?.row ?? scene.table.frozenRowCount;
|
|
46695
|
+
scene.bodyGroup.setAttribute('y', scene.colHeaderGroup.attribute.height);
|
|
46696
|
+
scene.rowHeaderGroup.setAttribute('y', scene.cornerHeaderGroup.attribute.height);
|
|
46697
|
+
scene.updateContainer();
|
|
46698
|
+
scene.updateBorderSizeAndPosition();
|
|
46699
|
+
scene.hasFrozen = true;
|
|
46700
|
+
}
|
|
46701
|
+
function moveRowFromBodyToColHeader(scene) {
|
|
46702
|
+
let hasSetedHeight = false;
|
|
46703
|
+
for (let i = 0; i < scene.bodyGroup.childrenCount; i++) {
|
|
46704
|
+
const colGroup = scene.bodyGroup.children[i];
|
|
46705
|
+
const rowCell = colGroup.firstChild;
|
|
46706
|
+
scene.colHeaderGroup.children[i]?.appendChild(rowCell);
|
|
46707
|
+
if (!hasSetedHeight) {
|
|
46708
|
+
scene.colHeaderGroup.setAttribute('height', scene.colHeaderGroup.attribute.height + rowCell.attribute.height);
|
|
46709
|
+
scene.bodyGroup.setAttribute('height', scene.bodyGroup.attribute.height - rowCell.attribute.height);
|
|
46710
|
+
hasSetedHeight = true;
|
|
46711
|
+
}
|
|
46712
|
+
}
|
|
46713
|
+
}
|
|
46714
|
+
function moveRowFromRowHeaderToCornerHeader(scene) {
|
|
46715
|
+
let hasSetedHeight = false;
|
|
46716
|
+
for (let i = 0; i < scene.rowHeaderGroup.childrenCount; i++) {
|
|
46717
|
+
const colGroup = scene.rowHeaderGroup.children[i];
|
|
46718
|
+
const rowCell = colGroup.firstChild;
|
|
46719
|
+
scene.cornerHeaderGroup.children[i]?.appendChild(rowCell);
|
|
46720
|
+
if (!hasSetedHeight) {
|
|
46721
|
+
scene.cornerHeaderGroup.setAttribute('height', scene.cornerHeaderGroup.attribute.height + rowCell.attribute.height);
|
|
46722
|
+
scene.rowHeaderGroup.setAttribute('height', scene.rowHeaderGroup.attribute.height - rowCell.attribute.height);
|
|
46723
|
+
hasSetedHeight = true;
|
|
46724
|
+
}
|
|
46725
|
+
}
|
|
46726
|
+
}
|
|
46727
|
+
function moveRowFromRightToTopRightCorner(scene) {
|
|
46728
|
+
let hasSetedHeight = false;
|
|
46729
|
+
for (let i = 0; i < scene.rightFrozenGroup.childrenCount; i++) {
|
|
46730
|
+
const colGroup = scene.rightFrozenGroup.children[i];
|
|
46731
|
+
const rowCell = colGroup.firstChild;
|
|
46732
|
+
scene.rightTopCornerGroup.children[i]?.appendChild(rowCell);
|
|
46733
|
+
if (!hasSetedHeight) {
|
|
46734
|
+
scene.rightTopCornerGroup.setAttribute('height', scene.rightTopCornerGroup.attribute.height + rowCell.attribute.height);
|
|
46735
|
+
scene.rightFrozenGroup.setAttribute('height', scene.rightFrozenGroup.attribute.height - rowCell.attribute.height);
|
|
46736
|
+
hasSetedHeight = true;
|
|
46737
|
+
}
|
|
46738
|
+
}
|
|
46739
|
+
}
|
|
46740
|
+
function moveRowFromColHeaderToBody(scene) {
|
|
46741
|
+
let hasSetedHeight = false;
|
|
46742
|
+
for (let i = 0; i < scene.colHeaderGroup.childrenCount; i++) {
|
|
46743
|
+
const colGroup = scene.colHeaderGroup.children[i];
|
|
46744
|
+
const rowCell = colGroup.lastChild;
|
|
46745
|
+
insertBefore(scene.bodyGroup.children[i], rowCell, scene.bodyGroup.children[i].firstChild);
|
|
46746
|
+
if (!hasSetedHeight) {
|
|
46747
|
+
scene.colHeaderGroup.setAttribute('height', scene.colHeaderGroup.attribute.height - rowCell.attribute.height);
|
|
46748
|
+
scene.bodyGroup.setAttribute('height', scene.bodyGroup.attribute.height + rowCell.attribute.height);
|
|
46749
|
+
hasSetedHeight = true;
|
|
46750
|
+
}
|
|
46751
|
+
}
|
|
46752
|
+
}
|
|
46753
|
+
function moveRowFromCornerHeaderToRowHeader(scene) {
|
|
46754
|
+
let hasSetedHeight = false;
|
|
46755
|
+
for (let i = 0; i < scene.cornerHeaderGroup.childrenCount; i++) {
|
|
46756
|
+
const colGroup = scene.cornerHeaderGroup.children[i];
|
|
46757
|
+
const rowCell = colGroup.lastChild;
|
|
46758
|
+
insertBefore(scene.rowHeaderGroup.children[i], rowCell, scene.rowHeaderGroup.children[i].firstChild);
|
|
46759
|
+
if (!hasSetedHeight) {
|
|
46760
|
+
scene.cornerHeaderGroup.setAttribute('height', scene.cornerHeaderGroup.attribute.height - rowCell.attribute.height);
|
|
46761
|
+
scene.rowHeaderGroup.setAttribute('height', scene.rowHeaderGroup.attribute.height + rowCell.attribute.height);
|
|
46762
|
+
hasSetedHeight = true;
|
|
46763
|
+
}
|
|
46764
|
+
}
|
|
46765
|
+
}
|
|
46766
|
+
function moveRowFromTopRightCornerToRight(scene) {
|
|
46767
|
+
let hasSetedHeight = false;
|
|
46768
|
+
for (let i = 0; i < scene.rightTopCornerGroup.childrenCount; i++) {
|
|
46769
|
+
const colGroup = scene.rightTopCornerGroup.children[i];
|
|
46770
|
+
const rowCell = colGroup.lastChild;
|
|
46771
|
+
insertBefore(scene.rightFrozenGroup.children[i], rowCell, scene.rightFrozenGroup.children[i].firstChild);
|
|
46772
|
+
if (!hasSetedHeight) {
|
|
46773
|
+
scene.rightTopCornerGroup.setAttribute('height', scene.rightTopCornerGroup.attribute.height - rowCell.attribute.height);
|
|
46774
|
+
scene.rightFrozenGroup.setAttribute('height', scene.rightFrozenGroup.attribute.height + rowCell.attribute.height);
|
|
46775
|
+
hasSetedHeight = true;
|
|
46776
|
+
}
|
|
46777
|
+
}
|
|
46778
|
+
}
|
|
46655
46779
|
|
|
46656
46780
|
function updateChartSizeForResizeColWidth(scenegraph, col) {
|
|
46657
46781
|
const { table } = scenegraph;
|
|
@@ -47370,8 +47494,8 @@
|
|
|
47370
47494
|
}
|
|
47371
47495
|
});
|
|
47372
47496
|
if (isNumber$4(updateAfter)) {
|
|
47373
|
-
for (let col = updateAfter; col < table.colCount; col++) {
|
|
47374
|
-
for (let row = 0; row < table.rowCount; row++) {
|
|
47497
|
+
for (let col = updateAfter; col < Math.max(table.colCount, table.internalProps._oldColCount ?? table.colCount); col++) {
|
|
47498
|
+
for (let row = 0; row < Math.max(table.rowCount, table.internalProps._oldRowCount ?? table.rowCount); row++) {
|
|
47375
47499
|
const cellGroup = scene.highPerformanceGetCell(col, row, true);
|
|
47376
47500
|
cellGroup && (cellGroup.needUpdate = true);
|
|
47377
47501
|
}
|
|
@@ -47422,6 +47546,10 @@
|
|
|
47422
47546
|
if (bottomColGroup && bottomColGroup.parent === scene.bottomFrozenGroup) {
|
|
47423
47547
|
scene.bottomFrozenGroup.removeChild(bottomColGroup);
|
|
47424
47548
|
}
|
|
47549
|
+
const headerColGroup = scene.getColGroup(col, true);
|
|
47550
|
+
if (headerColGroup && headerColGroup.parent === scene.colHeaderGroup) {
|
|
47551
|
+
scene.colHeaderGroup.removeChild(headerColGroup);
|
|
47552
|
+
}
|
|
47425
47553
|
}
|
|
47426
47554
|
}
|
|
47427
47555
|
if (col >= proxy.colStart && col <= proxy.colEnd) {
|
|
@@ -48743,6 +48871,9 @@
|
|
|
48743
48871
|
resetFrozen() {
|
|
48744
48872
|
resetFrozen(this);
|
|
48745
48873
|
}
|
|
48874
|
+
resetRowFrozen() {
|
|
48875
|
+
resetRowFrozen(this);
|
|
48876
|
+
}
|
|
48746
48877
|
updateCellLayoutWidthCertainWidth(columnGroup, detaRow, col) {
|
|
48747
48878
|
const width = columnGroup.attribute.width;
|
|
48748
48879
|
let isUpdate = false;
|
|
@@ -48945,6 +49076,13 @@
|
|
|
48945
49076
|
this.resetFrozen();
|
|
48946
49077
|
this.component.updateScrollBar();
|
|
48947
49078
|
}
|
|
49079
|
+
updateRowFrozen() {
|
|
49080
|
+
if (this.clear) {
|
|
49081
|
+
return;
|
|
49082
|
+
}
|
|
49083
|
+
this.resetRowFrozen();
|
|
49084
|
+
this.component.updateScrollBar();
|
|
49085
|
+
}
|
|
48948
49086
|
dealWidthRightFrozen(rightFrozenColCount) {
|
|
48949
49087
|
if (this.clear) {
|
|
48950
49088
|
this.table.internalProps.rightFrozenColCount = rightFrozenColCount;
|
|
@@ -49107,6 +49245,27 @@
|
|
|
49107
49245
|
this.component.updateScrollBar();
|
|
49108
49246
|
this.updateNextFrame();
|
|
49109
49247
|
}
|
|
49248
|
+
updateCornerHeaderCells() {
|
|
49249
|
+
for (let col = 0; col < this.table.frozenColCount; col++) {
|
|
49250
|
+
for (let row = 0; row < this.table.frozenRowCount; row++) {
|
|
49251
|
+
updateCell$1(col, row, this.table, false);
|
|
49252
|
+
}
|
|
49253
|
+
}
|
|
49254
|
+
}
|
|
49255
|
+
updateRowHeaderCells() {
|
|
49256
|
+
for (let col = 0; col < this.table.frozenColCount; col++) {
|
|
49257
|
+
for (let row = this.table.frozenRowCount; row < this.table.rowCount; row++) {
|
|
49258
|
+
updateCell$1(col, row, this.table, false);
|
|
49259
|
+
}
|
|
49260
|
+
}
|
|
49261
|
+
}
|
|
49262
|
+
updateColumnHeaderCells() {
|
|
49263
|
+
for (let row = 0; row < this.table.frozenRowCount; row++) {
|
|
49264
|
+
for (let col = this.table.frozenColCount; col < this.table.colCount; col++) {
|
|
49265
|
+
updateCell$1(col, row, this.table, false);
|
|
49266
|
+
}
|
|
49267
|
+
}
|
|
49268
|
+
}
|
|
49110
49269
|
getColumnGroupX(col) {
|
|
49111
49270
|
if (col < this.table.rowHeaderLevelCount) {
|
|
49112
49271
|
return this.table.getColsWidth(0, col - 1);
|
|
@@ -51155,7 +51314,8 @@
|
|
|
51155
51314
|
}
|
|
51156
51315
|
];
|
|
51157
51316
|
this.frozen = {
|
|
51158
|
-
col: -1
|
|
51317
|
+
col: -1,
|
|
51318
|
+
row: -1
|
|
51159
51319
|
};
|
|
51160
51320
|
this.tablePosition = {
|
|
51161
51321
|
absoluteX: 0,
|
|
@@ -51234,7 +51394,8 @@
|
|
|
51234
51394
|
}
|
|
51235
51395
|
];
|
|
51236
51396
|
this.frozen = {
|
|
51237
|
-
col: -1
|
|
51397
|
+
col: -1,
|
|
51398
|
+
row: -1
|
|
51238
51399
|
};
|
|
51239
51400
|
this.scroll = {
|
|
51240
51401
|
horizontalBarPos: 0,
|
|
@@ -51631,6 +51792,12 @@
|
|
|
51631
51792
|
this.table.scenegraph.updateFrozenIcon(0, this.table.colCount - 1);
|
|
51632
51793
|
}
|
|
51633
51794
|
}
|
|
51795
|
+
setFrozenRow(row) {
|
|
51796
|
+
if (row !== this.frozen.row) {
|
|
51797
|
+
this.frozen.row = row;
|
|
51798
|
+
this.table.scenegraph.updateRowFrozen();
|
|
51799
|
+
}
|
|
51800
|
+
}
|
|
51634
51801
|
checkVerticalScrollBarEnd() {
|
|
51635
51802
|
const totalHeight = this.table.getAllRowsHeight();
|
|
51636
51803
|
const scrollTop = this.scroll.verticalBarPos;
|
|
@@ -56907,7 +57074,7 @@
|
|
|
56907
57074
|
sharedVar;
|
|
56908
57075
|
hasHideNode = false;
|
|
56909
57076
|
sizeIncludeParent = false;
|
|
56910
|
-
|
|
57077
|
+
setExpandLevel;
|
|
56911
57078
|
hierarchyType;
|
|
56912
57079
|
tree = {
|
|
56913
57080
|
id: 0,
|
|
@@ -56922,17 +57089,20 @@
|
|
|
56922
57089
|
hierarchyState: undefined
|
|
56923
57090
|
};
|
|
56924
57091
|
totalLevel = 0;
|
|
57092
|
+
expandedMaxLevel = 0;
|
|
56925
57093
|
dimensionKeys = new NumberMap();
|
|
56926
57094
|
dimensionKeysIncludeVirtual = new NumberMap();
|
|
56927
57095
|
cache = new Map();
|
|
56928
57096
|
constructor(tree, sharedVar, hierarchyType = 'grid', rowExpandLevel = undefined) {
|
|
56929
57097
|
this.sizeIncludeParent = rowExpandLevel !== null && rowExpandLevel !== undefined;
|
|
56930
|
-
this.
|
|
57098
|
+
this.setExpandLevel = rowExpandLevel;
|
|
56931
57099
|
this.hierarchyType = hierarchyType;
|
|
56932
57100
|
this.sharedVar = sharedVar;
|
|
56933
57101
|
this.reset(tree);
|
|
56934
57102
|
}
|
|
56935
57103
|
reset(tree) {
|
|
57104
|
+
this.totalLevel = 0;
|
|
57105
|
+
this.expandedMaxLevel = 0;
|
|
56936
57106
|
this.hasHideNode = false;
|
|
56937
57107
|
this.cache.clear();
|
|
56938
57108
|
this.dimensionKeys = new NumberMap();
|
|
@@ -56976,6 +57146,7 @@
|
|
|
56976
57146
|
children.forEach((n) => {
|
|
56977
57147
|
n.level = (node.level ?? 0) + 1;
|
|
56978
57148
|
this.totalLevel = Math.max(this.totalLevel, n.level + 1);
|
|
57149
|
+
this.expandedMaxLevel = Math.max(this.expandedMaxLevel, n.level + 1);
|
|
56979
57150
|
size += this.setTreeNode(n, size, node);
|
|
56980
57151
|
});
|
|
56981
57152
|
}
|
|
@@ -56987,18 +57158,23 @@
|
|
|
56987
57158
|
});
|
|
56988
57159
|
}
|
|
56989
57160
|
else if (!node.hierarchyState &&
|
|
56990
|
-
node.level + 1 < this.
|
|
57161
|
+
node.level + 1 < this.setExpandLevel &&
|
|
56991
57162
|
(children?.length >= 1 || children === true)) {
|
|
56992
|
-
|
|
57163
|
+
if (!(children[0]?.indicatorKey && this.hierarchyType === 'grid-tree')) {
|
|
57164
|
+
node.hierarchyState = HierarchyState.expand;
|
|
57165
|
+
}
|
|
56993
57166
|
children?.length >= 1 &&
|
|
56994
57167
|
children.forEach((n) => {
|
|
56995
57168
|
n.level = (node.level ?? 0) + 1;
|
|
56996
57169
|
this.totalLevel = Math.max(this.totalLevel, n.level + 1);
|
|
57170
|
+
this.expandedMaxLevel = Math.max(this.expandedMaxLevel, n.level + 1);
|
|
56997
57171
|
size += this.setTreeNode(n, size, node);
|
|
56998
57172
|
});
|
|
56999
57173
|
}
|
|
57000
57174
|
else if (children?.length >= 1 || children === true) {
|
|
57001
|
-
|
|
57175
|
+
if (!(children[0]?.indicatorKey && this.hierarchyType === 'grid-tree')) {
|
|
57176
|
+
node.hierarchyState = HierarchyState.collapse;
|
|
57177
|
+
}
|
|
57002
57178
|
children?.length >= 1 &&
|
|
57003
57179
|
children.forEach((n) => {
|
|
57004
57180
|
n.level = (node.level ?? 0) + 1;
|
|
@@ -57019,22 +57195,6 @@
|
|
|
57019
57195
|
path.shift();
|
|
57020
57196
|
return path;
|
|
57021
57197
|
}
|
|
57022
|
-
getTreePathByCellIds(ids) {
|
|
57023
|
-
const path = [];
|
|
57024
|
-
let nodes = this.tree.children;
|
|
57025
|
-
for (let i = 0; i < ids.length; i++) {
|
|
57026
|
-
const id = ids[i];
|
|
57027
|
-
const pathNode = this.findNodeById(nodes, id);
|
|
57028
|
-
if (pathNode) {
|
|
57029
|
-
path.push(pathNode);
|
|
57030
|
-
nodes = pathNode.children;
|
|
57031
|
-
}
|
|
57032
|
-
else {
|
|
57033
|
-
break;
|
|
57034
|
-
}
|
|
57035
|
-
}
|
|
57036
|
-
return path;
|
|
57037
|
-
}
|
|
57038
57198
|
findNodeById(nodes, id) {
|
|
57039
57199
|
return nodes.find(node => {
|
|
57040
57200
|
return node.id === id;
|
|
@@ -57263,6 +57423,146 @@
|
|
|
57263
57423
|
layoutMap.colIndex++;
|
|
57264
57424
|
}
|
|
57265
57425
|
}
|
|
57426
|
+
function dealHeaderForGridTreeMode(hd, _headerCellIds, results, roots, row, totalLevel, expandedMaxLevel, show, dimensions, isRowTree, indicatorsAsCol, layoutMap) {
|
|
57427
|
+
const id = hd.id;
|
|
57428
|
+
const dimensionInfo = layoutMap.rowsDefine?.find(dimension => typeof dimension === 'string' ? false : dimension.dimensionKey === hd.dimensionKey) ??
|
|
57429
|
+
layoutMap.columnsDefine?.find(dimension => typeof dimension === 'string' ? false : dimension.dimensionKey === hd.dimensionKey);
|
|
57430
|
+
const indicatorInfo = layoutMap.indicatorsDefine?.find(indicator => {
|
|
57431
|
+
if (typeof indicator === 'string') {
|
|
57432
|
+
return false;
|
|
57433
|
+
}
|
|
57434
|
+
if (hd.indicatorKey) {
|
|
57435
|
+
return indicator.indicatorKey === hd.indicatorKey;
|
|
57436
|
+
}
|
|
57437
|
+
return indicator.title === hd.value && !hd.dimensionKey;
|
|
57438
|
+
});
|
|
57439
|
+
const cell = {
|
|
57440
|
+
id,
|
|
57441
|
+
title: hd.value ?? indicatorInfo?.title,
|
|
57442
|
+
field: hd.dimensionKey,
|
|
57443
|
+
style: typeof (indicatorInfo ?? dimensionInfo)?.headerStyle === 'function'
|
|
57444
|
+
? (indicatorInfo ?? dimensionInfo)?.headerStyle
|
|
57445
|
+
: Object.assign({}, (indicatorInfo ?? dimensionInfo)?.headerStyle),
|
|
57446
|
+
headerType: indicatorInfo?.headerType ?? dimensionInfo?.headerType ?? 'text',
|
|
57447
|
+
headerIcon: indicatorInfo?.headerIcon ?? dimensionInfo?.headerIcon,
|
|
57448
|
+
define: Object.assign(hd, {
|
|
57449
|
+
linkJump: (indicatorInfo ?? dimensionInfo)?.linkJump,
|
|
57450
|
+
linkDetect: (indicatorInfo ?? dimensionInfo)?.linkDetect,
|
|
57451
|
+
templateLink: (indicatorInfo ?? dimensionInfo)?.templateLink,
|
|
57452
|
+
keepAspectRatio: (indicatorInfo ?? dimensionInfo)?.keepAspectRatio ?? false,
|
|
57453
|
+
imageAutoSizing: (indicatorInfo ?? dimensionInfo)?.imageAutoSizing,
|
|
57454
|
+
headerCustomRender: (indicatorInfo ?? dimensionInfo)?.headerCustomRender,
|
|
57455
|
+
headerCustomLayout: (indicatorInfo ?? dimensionInfo)?.headerCustomLayout,
|
|
57456
|
+
dragHeader: dimensionInfo?.dragHeader,
|
|
57457
|
+
disableHeaderHover: !!(indicatorInfo ?? dimensionInfo)?.disableHeaderHover,
|
|
57458
|
+
disableHeaderSelect: !!(indicatorInfo ?? dimensionInfo)?.disableHeaderSelect,
|
|
57459
|
+
showSort: indicatorInfo?.showSort ?? dimensionInfo?.showSort,
|
|
57460
|
+
hide: indicatorInfo?.hide
|
|
57461
|
+
}),
|
|
57462
|
+
fieldFormat: indicatorInfo?.headerFormat ?? dimensionInfo?.headerFormat,
|
|
57463
|
+
dropDownMenu: indicatorInfo?.dropDownMenu ?? dimensionInfo?.dropDownMenu,
|
|
57464
|
+
pivotInfo: {
|
|
57465
|
+
value: hd.value,
|
|
57466
|
+
dimensionKey: hd.dimensionKey,
|
|
57467
|
+
isPivotCorner: false
|
|
57468
|
+
},
|
|
57469
|
+
hierarchyLevel: hd.level,
|
|
57470
|
+
dimensionTotalLevel: totalLevel,
|
|
57471
|
+
hierarchyState: hd.hierarchyState,
|
|
57472
|
+
width: dimensionInfo?.width,
|
|
57473
|
+
minWidth: dimensionInfo?.minWidth,
|
|
57474
|
+
maxWidth: dimensionInfo?.maxWidth,
|
|
57475
|
+
showSort: indicatorInfo?.showSort ?? dimensionInfo?.showSort,
|
|
57476
|
+
sort: indicatorInfo?.sort,
|
|
57477
|
+
description: dimensionInfo?.description,
|
|
57478
|
+
parentCellId: roots[roots.length - 1]
|
|
57479
|
+
};
|
|
57480
|
+
if (indicatorInfo) {
|
|
57481
|
+
if (indicatorInfo.customRender) {
|
|
57482
|
+
hd.customRender = indicatorInfo.customRender;
|
|
57483
|
+
}
|
|
57484
|
+
if (!isValid$3(layoutMap._indicators?.find(indicator => indicator.indicatorKey === indicatorInfo.indicatorKey))) {
|
|
57485
|
+
layoutMap._indicators?.push({
|
|
57486
|
+
id: ++layoutMap.sharedVar.seqId,
|
|
57487
|
+
indicatorKey: indicatorInfo.indicatorKey,
|
|
57488
|
+
field: indicatorInfo.indicatorKey,
|
|
57489
|
+
fieldFormat: indicatorInfo?.format,
|
|
57490
|
+
cellType: indicatorInfo?.cellType ?? indicatorInfo?.columnType ?? 'text',
|
|
57491
|
+
chartModule: 'chartModule' in indicatorInfo ? indicatorInfo.chartModule : null,
|
|
57492
|
+
chartSpec: 'chartSpec' in indicatorInfo ? indicatorInfo.chartSpec : null,
|
|
57493
|
+
noDataRenderNothing: 'noDataRenderNothing' in indicatorInfo ? indicatorInfo.noDataRenderNothing : false,
|
|
57494
|
+
sparklineSpec: 'sparklineSpec' in indicatorInfo ? indicatorInfo.sparklineSpec : null,
|
|
57495
|
+
style: indicatorInfo?.style,
|
|
57496
|
+
icon: indicatorInfo?.icon,
|
|
57497
|
+
define: Object.assign({}, hd, indicatorInfo, {
|
|
57498
|
+
dragHeader: dimensionInfo?.dragHeader
|
|
57499
|
+
}),
|
|
57500
|
+
width: indicatorInfo?.width,
|
|
57501
|
+
minWidth: indicatorInfo?.minWidth,
|
|
57502
|
+
maxWidth: indicatorInfo?.maxWidth,
|
|
57503
|
+
disableColumnResize: indicatorInfo?.disableColumnResize
|
|
57504
|
+
});
|
|
57505
|
+
}
|
|
57506
|
+
}
|
|
57507
|
+
else if (hd.indicatorKey) {
|
|
57508
|
+
if (!isValid$3(layoutMap._indicators?.find(indicator => indicator.indicatorKey === hd.indicatorKey))) {
|
|
57509
|
+
layoutMap._indicators?.push({
|
|
57510
|
+
id: ++layoutMap.sharedVar.seqId,
|
|
57511
|
+
indicatorKey: hd.indicatorKey,
|
|
57512
|
+
field: hd.indicatorKey,
|
|
57513
|
+
cellType: 'text',
|
|
57514
|
+
define: Object.assign({}, hd)
|
|
57515
|
+
});
|
|
57516
|
+
}
|
|
57517
|
+
}
|
|
57518
|
+
results[id] = cell;
|
|
57519
|
+
layoutMap._headerObjects[id] = cell;
|
|
57520
|
+
for (let r = row - 1; r >= 0; r--) {
|
|
57521
|
+
_headerCellIds[r][layoutMap.colIndex] = roots[r];
|
|
57522
|
+
}
|
|
57523
|
+
_headerCellIds[row][layoutMap.colIndex] = id;
|
|
57524
|
+
const span = Math.min((isRowTree ? indicatorsAsCol : !indicatorsAsCol) ? expandedMaxLevel : expandedMaxLevel - 1, hd.levelSpan ?? 1000);
|
|
57525
|
+
if (span > 0) {
|
|
57526
|
+
for (let r = row + 1; r < span; r++) {
|
|
57527
|
+
if (!_headerCellIds[r]) {
|
|
57528
|
+
_headerCellIds[r] = [];
|
|
57529
|
+
for (let col = 0; col < layoutMap.colIndex; col++) {
|
|
57530
|
+
_headerCellIds[r][col] = _headerCellIds[row][col];
|
|
57531
|
+
}
|
|
57532
|
+
}
|
|
57533
|
+
_headerCellIds[r][layoutMap.colIndex] = id;
|
|
57534
|
+
}
|
|
57535
|
+
}
|
|
57536
|
+
if ((hd.hierarchyState === HierarchyState.expand && hd).children?.length >= 1) {
|
|
57537
|
+
layoutMap._addHeadersForGridTreeMode(_headerCellIds, row + (hd.levelSpan ?? 1), hd.children ?? [], [...roots, ...Array(hd.levelSpan ?? 1).fill(id)], totalLevel, expandedMaxLevel, show && hd.hierarchyState === HierarchyState.expand, dimensions, results, isRowTree);
|
|
57538
|
+
}
|
|
57539
|
+
else {
|
|
57540
|
+
const needSupplementLength = (isRowTree ? indicatorsAsCol : !indicatorsAsCol)
|
|
57541
|
+
? expandedMaxLevel
|
|
57542
|
+
: expandedMaxLevel - 1;
|
|
57543
|
+
for (let r = row + 1; r < needSupplementLength; r++) {
|
|
57544
|
+
if (!_headerCellIds[r]) {
|
|
57545
|
+
_headerCellIds[r] = [];
|
|
57546
|
+
}
|
|
57547
|
+
_headerCellIds[r][layoutMap.colIndex] = id;
|
|
57548
|
+
}
|
|
57549
|
+
if (row <= needSupplementLength - 1 &&
|
|
57550
|
+
((isRowTree && indicatorsAsCol === false) || (!isRowTree && indicatorsAsCol === true))) {
|
|
57551
|
+
let lastIndidcatorChildren = hd;
|
|
57552
|
+
const levelSpan = needSupplementLength - row;
|
|
57553
|
+
while (lastIndidcatorChildren) {
|
|
57554
|
+
if (lastIndidcatorChildren.children?.[0].indicatorKey) {
|
|
57555
|
+
break;
|
|
57556
|
+
}
|
|
57557
|
+
lastIndidcatorChildren = lastIndidcatorChildren.children[0];
|
|
57558
|
+
}
|
|
57559
|
+
layoutMap._addHeadersForGridTreeMode(_headerCellIds, expandedMaxLevel - 1, lastIndidcatorChildren.children ?? [], [...roots, ...Array(Math.max(levelSpan, hd.levelSpan ?? 1)).fill(id)], totalLevel, expandedMaxLevel, true, dimensions, results, isRowTree);
|
|
57560
|
+
}
|
|
57561
|
+
else {
|
|
57562
|
+
layoutMap.colIndex++;
|
|
57563
|
+
}
|
|
57564
|
+
}
|
|
57565
|
+
}
|
|
57266
57566
|
function dealHeaderForTreeMode(hd, _headerCellIds, results, roots, row, totalLevel, show, dimensions, layoutMap) {
|
|
57267
57567
|
const id = hd.id;
|
|
57268
57568
|
const dimensionInfo = dimensions.find(dimension => typeof dimension === 'string' ? false : dimension.dimensionKey === hd.dimensionKey);
|
|
@@ -57538,13 +57838,13 @@
|
|
|
57538
57838
|
if (table.options.indicatorsAsCol !== false && table.options.supplementIndicatorNodes !== false) {
|
|
57539
57839
|
table.internalProps.columnTree = supplementIndicatorNodesForCustomTree(table.internalProps.columnTree, options.indicators);
|
|
57540
57840
|
}
|
|
57541
|
-
columnDimensionTree = new DimensionTree(table.internalProps.columnTree ?? [], table.layoutNodeId);
|
|
57841
|
+
columnDimensionTree = new DimensionTree(table.internalProps.columnTree ?? [], table.layoutNodeId, table.options.columnHierarchyType, table.options.columnHierarchyType !== 'grid' ? table.options.columnExpandLevel ?? 1 : undefined);
|
|
57542
57842
|
}
|
|
57543
57843
|
if (options.rowTree) {
|
|
57544
57844
|
if (table.options.indicatorsAsCol === false && table.options.supplementIndicatorNodes !== false) {
|
|
57545
57845
|
table.internalProps.rowTree = supplementIndicatorNodesForCustomTree(table.internalProps.rowTree, options.indicators);
|
|
57546
57846
|
}
|
|
57547
|
-
rowDimensionTree = new DimensionTree(table.internalProps.rowTree ?? [], table.layoutNodeId, table.options.rowHierarchyType, table.options.rowHierarchyType
|
|
57847
|
+
rowDimensionTree = new DimensionTree(table.internalProps.rowTree ?? [], table.layoutNodeId, table.options.rowHierarchyType, table.options.rowHierarchyType !== 'grid' ? table.options.rowExpandLevel ?? 1 : undefined);
|
|
57548
57848
|
}
|
|
57549
57849
|
const rowKeys = rowDimensionTree?.dimensionKeys?.count
|
|
57550
57850
|
? rowDimensionTree.dimensionKeys.valueArr()
|
|
@@ -57611,7 +57911,7 @@
|
|
|
57611
57911
|
}
|
|
57612
57912
|
return keys;
|
|
57613
57913
|
}, []) ?? [];
|
|
57614
|
-
if (options.rowHierarchyType
|
|
57914
|
+
if (options.rowHierarchyType !== 'grid' && (options.extensionRows?.length ?? 0) >= 1) {
|
|
57615
57915
|
options.extensionRows?.forEach(extensionRow => {
|
|
57616
57916
|
const extension_rowKeys = [];
|
|
57617
57917
|
extensionRow.rows.forEach(row => {
|
|
@@ -59198,7 +59498,7 @@
|
|
|
59198
59498
|
return TABLE_EVENT_TYPE;
|
|
59199
59499
|
}
|
|
59200
59500
|
options;
|
|
59201
|
-
version = "1.
|
|
59501
|
+
version = "1.16.0-alpha.0";
|
|
59202
59502
|
pagination;
|
|
59203
59503
|
id = `VTable${Date.now()}`;
|
|
59204
59504
|
headerStyleCache;
|
|
@@ -59557,6 +59857,7 @@
|
|
|
59557
59857
|
}
|
|
59558
59858
|
set frozenRowCount(frozenRowCount) {
|
|
59559
59859
|
this.internalProps.frozenRowCount = frozenRowCount;
|
|
59860
|
+
this.stateManager.setFrozenRow(this.internalProps.frozenRowCount);
|
|
59560
59861
|
}
|
|
59561
59862
|
get rightFrozenColCount() {
|
|
59562
59863
|
return this.internalProps?.layoutMap?.rightFrozenColCount ?? this.internalProps?.rightFrozenColCount ?? 0;
|
|
@@ -72782,34 +73083,134 @@
|
|
|
72782
73083
|
|
|
72783
73084
|
function diffCellAddress(col, row, oldCellIds, newCellIds, oldRowHeaderCellPositons, layout) {
|
|
72784
73085
|
const columnHeaderStart = layout.columnHeaderLevelCount;
|
|
72785
|
-
const
|
|
72786
|
-
const
|
|
73086
|
+
const addCellPositionsRowDirection = [];
|
|
73087
|
+
const removeCellPositionsRowDirection = [];
|
|
72787
73088
|
for (let i = 0; i < oldCellIds.length; i++) {
|
|
72788
73089
|
if (!newCellIds.includes(oldCellIds[i])) {
|
|
72789
|
-
|
|
73090
|
+
removeCellPositionsRowDirection.push(oldRowHeaderCellPositons[i]);
|
|
72790
73091
|
}
|
|
72791
73092
|
}
|
|
72792
73093
|
for (let i = 0; i < newCellIds.length; i++) {
|
|
72793
73094
|
if (!oldCellIds.includes(newCellIds[i])) {
|
|
72794
73095
|
const newCellAddr = { col, row: columnHeaderStart + i };
|
|
72795
|
-
|
|
73096
|
+
addCellPositionsRowDirection.push(newCellAddr);
|
|
72796
73097
|
}
|
|
72797
73098
|
}
|
|
72798
73099
|
let parentId = layout.getParentCellId(col, row);
|
|
72799
73100
|
let parentCellAddress = layout.getRowHeaderCellAddressByCellId(parentId);
|
|
72800
|
-
const
|
|
72801
|
-
parentCellAddress &&
|
|
73101
|
+
const updateCellPositionsRowDirection = [];
|
|
73102
|
+
parentCellAddress && updateCellPositionsRowDirection.push(parentCellAddress);
|
|
72802
73103
|
while (parentId) {
|
|
72803
73104
|
parentId = layout.getParentCellId(parentCellAddress.col, parentCellAddress.row);
|
|
72804
73105
|
if (parentId) {
|
|
72805
73106
|
parentCellAddress = layout.getRowHeaderCellAddressByCellId(parentId);
|
|
72806
|
-
|
|
73107
|
+
updateCellPositionsRowDirection.push(parentCellAddress);
|
|
72807
73108
|
}
|
|
72808
73109
|
}
|
|
72809
73110
|
return {
|
|
72810
|
-
|
|
72811
|
-
|
|
72812
|
-
|
|
73111
|
+
addCellPositionsRowDirection,
|
|
73112
|
+
removeCellPositionsRowDirection,
|
|
73113
|
+
updateCellPositionsRowDirection
|
|
73114
|
+
};
|
|
73115
|
+
}
|
|
73116
|
+
function diffCellAddressForGridTree(col, row, oldCellIds, newCellIds, oldRowHeaderCellPositons, layout) {
|
|
73117
|
+
const columnHeaderStart = layout.columnHeaderLevelCount;
|
|
73118
|
+
const addCellPositionsRowDirection = [];
|
|
73119
|
+
const removeCellPositionsRowDirection = [];
|
|
73120
|
+
for (let i = 0; i < oldCellIds.length; i++) {
|
|
73121
|
+
if (!newCellIds.includes(oldCellIds[i])) {
|
|
73122
|
+
removeCellPositionsRowDirection.push(oldRowHeaderCellPositons[i]);
|
|
73123
|
+
}
|
|
73124
|
+
}
|
|
73125
|
+
for (let i = 0; i < newCellIds.length; i++) {
|
|
73126
|
+
if (!oldCellIds.includes(newCellIds[i])) {
|
|
73127
|
+
const newCellAddr = { col, row: columnHeaderStart + i };
|
|
73128
|
+
addCellPositionsRowDirection.push(newCellAddr);
|
|
73129
|
+
}
|
|
73130
|
+
}
|
|
73131
|
+
let parentId = layout.getParentCellId(col, row);
|
|
73132
|
+
let parentCellAddress = layout.getRowHeaderCellAddressByCellId(parentId);
|
|
73133
|
+
const updateCellPositionsRowDirection = [];
|
|
73134
|
+
parentCellAddress && updateCellPositionsRowDirection.push(parentCellAddress);
|
|
73135
|
+
while (parentId) {
|
|
73136
|
+
parentId = layout.getParentCellId(parentCellAddress.col, parentCellAddress.row);
|
|
73137
|
+
if (parentId) {
|
|
73138
|
+
parentCellAddress = layout.getRowHeaderCellAddressByCellId(parentId);
|
|
73139
|
+
updateCellPositionsRowDirection.push(parentCellAddress);
|
|
73140
|
+
}
|
|
73141
|
+
}
|
|
73142
|
+
const addCellPositionsColumnDirection = [];
|
|
73143
|
+
const removeCellPositionsColumnDirection = [];
|
|
73144
|
+
if (layout.rowHierarchyType === 'grid-tree' &&
|
|
73145
|
+
layout.cornerSetting.titleOnDimension === 'column' &&
|
|
73146
|
+
layout.rowHeaderLevelCount !== layout._cornerHeaderCellIds[0].length) {
|
|
73147
|
+
if (layout.rowHeaderLevelCount > layout._cornerHeaderCellIds[0].length) {
|
|
73148
|
+
for (let i = layout._cornerHeaderCellIds[0].length; i < layout.rowHeaderLevelCount; i++) {
|
|
73149
|
+
addCellPositionsColumnDirection.push({ col: i, row });
|
|
73150
|
+
}
|
|
73151
|
+
}
|
|
73152
|
+
else {
|
|
73153
|
+
for (let i = layout.rowHeaderLevelCount; i < layout._cornerHeaderCellIds[0].length; i++) {
|
|
73154
|
+
removeCellPositionsColumnDirection.push({ col: i, row });
|
|
73155
|
+
}
|
|
73156
|
+
}
|
|
73157
|
+
}
|
|
73158
|
+
return {
|
|
73159
|
+
addCellPositionsRowDirection,
|
|
73160
|
+
removeCellPositionsRowDirection,
|
|
73161
|
+
updateCellPositionsRowDirection,
|
|
73162
|
+
addCellPositionsColumnDirection,
|
|
73163
|
+
removeCellPositionsColumnDirection
|
|
73164
|
+
};
|
|
73165
|
+
}
|
|
73166
|
+
function diffCellAddressForGridTreeOnColumn(col, row, oldCellIds, newCellIds, oldRowHeaderCellPositons, layout) {
|
|
73167
|
+
const rowHeaderStart = layout.rowHeaderLevelCount;
|
|
73168
|
+
const addCellPositionsColumnDirection = [];
|
|
73169
|
+
const removeCellPositionsColumnDirection = [];
|
|
73170
|
+
for (let i = 0; i < oldCellIds.length; i++) {
|
|
73171
|
+
if (!newCellIds.includes(oldCellIds[i])) {
|
|
73172
|
+
removeCellPositionsColumnDirection.push(oldRowHeaderCellPositons[i]);
|
|
73173
|
+
}
|
|
73174
|
+
}
|
|
73175
|
+
for (let i = 0; i < newCellIds.length; i++) {
|
|
73176
|
+
if (!oldCellIds.includes(newCellIds[i])) {
|
|
73177
|
+
const newCellAddr = { col: rowHeaderStart + i, row };
|
|
73178
|
+
addCellPositionsColumnDirection.push(newCellAddr);
|
|
73179
|
+
}
|
|
73180
|
+
}
|
|
73181
|
+
let parentId = layout.getParentCellId(col, row);
|
|
73182
|
+
let parentCellAddress = layout.getRowHeaderCellAddressByCellId(parentId);
|
|
73183
|
+
const updateCellPositionsColumnDirection = [];
|
|
73184
|
+
parentCellAddress && updateCellPositionsColumnDirection.push(parentCellAddress);
|
|
73185
|
+
while (parentCellAddress && parentId) {
|
|
73186
|
+
parentId = layout.getParentCellId(parentCellAddress.col, parentCellAddress.row);
|
|
73187
|
+
if (parentId) {
|
|
73188
|
+
parentCellAddress = layout.getRowHeaderCellAddressByCellId(parentId);
|
|
73189
|
+
updateCellPositionsColumnDirection.push(parentCellAddress);
|
|
73190
|
+
}
|
|
73191
|
+
}
|
|
73192
|
+
const addCellPositionsRowDirection = [];
|
|
73193
|
+
const removeCellPositionsRowDirection = [];
|
|
73194
|
+
if (layout.columnHierarchyType === 'grid-tree' &&
|
|
73195
|
+
layout.cornerSetting.titleOnDimension === 'row' &&
|
|
73196
|
+
layout.columnHeaderLevelCount !== layout._cornerHeaderCellIds.length) {
|
|
73197
|
+
if (layout.columnHeaderLevelCount > layout._cornerHeaderCellIds.length) {
|
|
73198
|
+
for (let i = layout._cornerHeaderCellIds.length; i < layout.columnHeaderLevelCount; i++) {
|
|
73199
|
+
addCellPositionsRowDirection.push({ col, row: i });
|
|
73200
|
+
}
|
|
73201
|
+
}
|
|
73202
|
+
else {
|
|
73203
|
+
for (let i = layout.columnHeaderLevelCount; i < layout._cornerHeaderCellIds.length; i++) {
|
|
73204
|
+
removeCellPositionsRowDirection.push({ col, row: i });
|
|
73205
|
+
}
|
|
73206
|
+
}
|
|
73207
|
+
}
|
|
73208
|
+
return {
|
|
73209
|
+
addCellPositionsColumnDirection,
|
|
73210
|
+
removeCellPositionsColumnDirection,
|
|
73211
|
+
updateCellPositionsColumnDirection,
|
|
73212
|
+
addCellPositionsRowDirection,
|
|
73213
|
+
removeCellPositionsRowDirection
|
|
72813
73214
|
};
|
|
72814
73215
|
}
|
|
72815
73216
|
|
|
@@ -72853,7 +73254,9 @@
|
|
|
72853
73254
|
cornerSetting;
|
|
72854
73255
|
_indicatorShowType = 'column';
|
|
72855
73256
|
rowHierarchyType;
|
|
73257
|
+
columnHierarchyType;
|
|
72856
73258
|
rowExpandLevel;
|
|
73259
|
+
columnExpandLevel;
|
|
72857
73260
|
rowHierarchyIndent;
|
|
72858
73261
|
rowHierarchyTextStartAlignment = false;
|
|
72859
73262
|
rowDimensionKeys = [];
|
|
@@ -72909,7 +73312,9 @@
|
|
|
72909
73312
|
this.rowHeaderTitle = table.options.rowHeaderTitle;
|
|
72910
73313
|
this.columnHeaderTitle = table.options.columnHeaderTitle;
|
|
72911
73314
|
this.rowHierarchyType = table.options.rowHierarchyType ?? 'grid';
|
|
73315
|
+
this.columnHierarchyType = table.options.columnHierarchyType ?? 'grid';
|
|
72912
73316
|
this.rowExpandLevel = table.options.rowExpandLevel ?? 1;
|
|
73317
|
+
this.columnExpandLevel = table.options.columnExpandLevel ?? 1;
|
|
72913
73318
|
this.rowHierarchyIndent = table.options.rowHierarchyIndent ?? 20;
|
|
72914
73319
|
this.rowHierarchyTextStartAlignment = table.options.rowHierarchyTextStartAlignment;
|
|
72915
73320
|
this.cornerSetting = Object.assign({ titleOnDimension: 'column', forceShowHeader: false }, table.options.corner);
|
|
@@ -73121,20 +73526,26 @@
|
|
|
73121
73526
|
}
|
|
73122
73527
|
_generateColHeaderIds() {
|
|
73123
73528
|
if (this.columnDimensionTree.tree.children?.length >= 1) {
|
|
73124
|
-
|
|
73125
|
-
|
|
73126
|
-
|
|
73127
|
-
|
|
73128
|
-
|
|
73129
|
-
|
|
73130
|
-
this.
|
|
73131
|
-
|
|
73132
|
-
|
|
73133
|
-
|
|
73134
|
-
this.
|
|
73529
|
+
if (this.columnHierarchyType === 'grid-tree') {
|
|
73530
|
+
const startCol = 0;
|
|
73531
|
+
this._addHeadersForGridTreeMode(this._columnHeaderCellFullPathIds, startCol, this.columnDimensionTree.tree.children, [], this.columnDimensionTree.totalLevel, this._getColumnHeaderTreeExpandedMaxLevelCount(), true, this.columnsDefine, this.columnHeaderObjs, false);
|
|
73532
|
+
}
|
|
73533
|
+
else {
|
|
73534
|
+
let startRow = 0;
|
|
73535
|
+
if (this.dataset &&
|
|
73536
|
+
!this._table.isPivotChart() &&
|
|
73537
|
+
(this.dataset.records?.length ?? 0) === 0 &&
|
|
73538
|
+
!this.dataset.customColTree &&
|
|
73539
|
+
!this.dataset.customRowTree &&
|
|
73540
|
+
this.indicatorsAsCol &&
|
|
73541
|
+
this._getColumnHeaderTreeExpandedMaxLevelCount() < this.columnHeaderLevelCount) {
|
|
73542
|
+
startRow = this.columnHeaderLevelCount - this._getColumnHeaderTreeExpandedMaxLevelCount();
|
|
73543
|
+
for (let i = 0; i < startRow; i++) {
|
|
73544
|
+
this._columnHeaderCellFullPathIds.unshift([]);
|
|
73545
|
+
}
|
|
73135
73546
|
}
|
|
73547
|
+
this._addHeaders(this._columnHeaderCellFullPathIds, startRow, this.columnDimensionTree.tree.children, [], this.columnHeaderObjs);
|
|
73136
73548
|
}
|
|
73137
|
-
this._addHeaders(this._columnHeaderCellFullPathIds, startRow, this.columnDimensionTree.tree.children, [], this.columnHeaderObjs);
|
|
73138
73549
|
}
|
|
73139
73550
|
if (this.columnHeaderTitle) {
|
|
73140
73551
|
this.sharedVar.seqId = Math.max(this.sharedVar.seqId, this._headerObjects.length);
|
|
@@ -73169,6 +73580,10 @@
|
|
|
73169
73580
|
if (this.rowHierarchyType === 'tree') {
|
|
73170
73581
|
this._addHeadersForTreeMode(this._rowHeaderCellFullPathIds_FULL, 0, this.rowDimensionTree.tree.children, [], this.rowDimensionTree.totalLevel, true, this.rowsDefine, this.rowHeaderObjs);
|
|
73171
73582
|
}
|
|
73583
|
+
else if (this.rowHierarchyType === 'grid-tree') {
|
|
73584
|
+
const startRow = 0;
|
|
73585
|
+
this._addHeadersForGridTreeMode(this._rowHeaderCellFullPathIds_FULL, startRow, this.rowDimensionTree.tree.children, [], this.rowDimensionTree.totalLevel, this._getRowHeaderTreeExpandedMaxLevelCount(), true, this.rowsDefine, this.rowHeaderObjs, true);
|
|
73586
|
+
}
|
|
73172
73587
|
else {
|
|
73173
73588
|
let startRow = 0;
|
|
73174
73589
|
if (this.dataset &&
|
|
@@ -73177,8 +73592,8 @@
|
|
|
73177
73592
|
!this.dataset.customColTree &&
|
|
73178
73593
|
!this.dataset.customRowTree &&
|
|
73179
73594
|
!this.indicatorsAsCol &&
|
|
73180
|
-
this.
|
|
73181
|
-
startRow = this.rowHeaderLevelCount - this.
|
|
73595
|
+
this._getRowHeaderTreeExpandedMaxLevelCount() < this.rowHeaderLevelCount) {
|
|
73596
|
+
startRow = this.rowHeaderLevelCount - this._getRowHeaderTreeExpandedMaxLevelCount();
|
|
73182
73597
|
for (let i = 0; i < startRow; i++) {
|
|
73183
73598
|
this._rowHeaderCellFullPathIds_FULL.unshift([]);
|
|
73184
73599
|
}
|
|
@@ -73214,6 +73629,29 @@
|
|
|
73214
73629
|
this._headerObjects[id] = cell;
|
|
73215
73630
|
}
|
|
73216
73631
|
}
|
|
73632
|
+
_getRowHeaderTreeExpandedMaxLevelCount() {
|
|
73633
|
+
if (this.rowHierarchyType === 'tree') {
|
|
73634
|
+
return 1;
|
|
73635
|
+
}
|
|
73636
|
+
else if (this.rowHierarchyType === 'grid-tree') {
|
|
73637
|
+
return this.cornerSetting.titleOnDimension === 'row'
|
|
73638
|
+
? this.rowDimensionTree.totalLevel
|
|
73639
|
+
: this.indicatorsAsCol
|
|
73640
|
+
? this.rowDimensionTree.expandedMaxLevel
|
|
73641
|
+
: this.rowDimensionTree.expandedMaxLevel + 1;
|
|
73642
|
+
}
|
|
73643
|
+
return this.rowDimensionTree.totalLevel;
|
|
73644
|
+
}
|
|
73645
|
+
_getColumnHeaderTreeExpandedMaxLevelCount() {
|
|
73646
|
+
if (this.columnHierarchyType === 'grid-tree') {
|
|
73647
|
+
return this.cornerSetting.titleOnDimension === 'column'
|
|
73648
|
+
? this.columnDimensionTree.totalLevel
|
|
73649
|
+
: this.indicatorsAsCol === false
|
|
73650
|
+
? this.columnDimensionTree.expandedMaxLevel
|
|
73651
|
+
: this.columnDimensionTree.expandedMaxLevel + 1;
|
|
73652
|
+
}
|
|
73653
|
+
return this.columnDimensionTree.totalLevel;
|
|
73654
|
+
}
|
|
73217
73655
|
_addHeaders(_headerCellIds, row, header, roots, results) {
|
|
73218
73656
|
const _this = this;
|
|
73219
73657
|
function _newRow(row) {
|
|
@@ -73256,6 +73694,27 @@
|
|
|
73256
73694
|
dealHeaderForTreeMode(hd, _headerCellIds, results, roots, row, totalLevel, show, dimensions, this);
|
|
73257
73695
|
}
|
|
73258
73696
|
}
|
|
73697
|
+
_addHeadersForGridTreeMode(_headerCellIds, row, header, roots, totalLevel, expandedMaxLevel, show, dimensions, results, isRowTree) {
|
|
73698
|
+
const _this = this;
|
|
73699
|
+
function _newRow(row) {
|
|
73700
|
+
const newRow = (_headerCellIds[row] = []);
|
|
73701
|
+
if (_this.colIndex === 0) {
|
|
73702
|
+
return newRow;
|
|
73703
|
+
}
|
|
73704
|
+
const prev = _headerCellIds[row - 1];
|
|
73705
|
+
for (let col = 0; col < prev?.length; col++) {
|
|
73706
|
+
newRow[col] = prev[col];
|
|
73707
|
+
}
|
|
73708
|
+
return newRow;
|
|
73709
|
+
}
|
|
73710
|
+
if (!_headerCellIds[row]) {
|
|
73711
|
+
_newRow(row);
|
|
73712
|
+
}
|
|
73713
|
+
for (let i = 0; i < header.length; i++) {
|
|
73714
|
+
const hd = header[i];
|
|
73715
|
+
dealHeaderForGridTreeMode(hd, _headerCellIds, results, roots, row, totalLevel, expandedMaxLevel, show, dimensions, isRowTree, this.indicatorsAsCol, this);
|
|
73716
|
+
}
|
|
73717
|
+
}
|
|
73259
73718
|
_addCornerHeaders(colDimensionKeys, rowDimensionKeys, dimensions) {
|
|
73260
73719
|
const results = [];
|
|
73261
73720
|
if (this.cornerSetting.titleOnDimension === 'all') {
|
|
@@ -73911,13 +74370,12 @@
|
|
|
73911
74370
|
this.columnHeaderLevelCount = 0;
|
|
73912
74371
|
return;
|
|
73913
74372
|
}
|
|
73914
|
-
let count = this.
|
|
73915
|
-
|
|
73916
|
-
|
|
73917
|
-
|
|
73918
|
-
|
|
73919
|
-
|
|
73920
|
-
: this.columnDimensionTree.totalLevel;
|
|
74373
|
+
let count = this._getColumnHeaderTreeExpandedMaxLevelCount();
|
|
74374
|
+
if (this.indicatorsAsCol &&
|
|
74375
|
+
this.hideIndicatorName &&
|
|
74376
|
+
this.colDimensionKeys[this.colDimensionKeys.length - 1] === this.indicatorDimensionKey) {
|
|
74377
|
+
count--;
|
|
74378
|
+
}
|
|
73921
74379
|
if (count === 0 &&
|
|
73922
74380
|
this.dataset &&
|
|
73923
74381
|
!this.dataset.customColTree?.length) {
|
|
@@ -73967,7 +74425,7 @@
|
|
|
73967
74425
|
this.rowHeaderLevelCount = 1 + extensionRowCount;
|
|
73968
74426
|
return;
|
|
73969
74427
|
}
|
|
73970
|
-
const rowLevelCount = this.
|
|
74428
|
+
const rowLevelCount = this._getRowHeaderTreeExpandedMaxLevelCount();
|
|
73971
74429
|
let count = rowLevelCount;
|
|
73972
74430
|
if (count === 0 &&
|
|
73973
74431
|
this.dataset &&
|
|
@@ -74019,7 +74477,7 @@
|
|
|
74019
74477
|
this._rowHeaderLevelCount = count;
|
|
74020
74478
|
}
|
|
74021
74479
|
get colCount() {
|
|
74022
|
-
return ((this.
|
|
74480
|
+
return ((this._getColumnHeaderTreeExpandedMaxLevelCount() > 0 ||
|
|
74023
74481
|
this._table.isPivotChart() ||
|
|
74024
74482
|
this.dataset.records?.length > 0 ||
|
|
74025
74483
|
(this.dataset.records && !Array.isArray(this.dataset.records))
|
|
@@ -74363,9 +74821,20 @@
|
|
|
74363
74821
|
const recordCol = this.getBodyIndexByCol(col);
|
|
74364
74822
|
const recordRow = this.getBodyIndexByRow(row) + this.currentPageStartIndex;
|
|
74365
74823
|
if (!colPath && row >= 0 && recordCol >= 0) {
|
|
74366
|
-
colPath =
|
|
74367
|
-
|
|
74368
|
-
|
|
74824
|
+
colPath = [];
|
|
74825
|
+
if (this.columnHierarchyType === 'grid-tree') {
|
|
74826
|
+
const col_pathIds = [];
|
|
74827
|
+
this._columnHeaderCellFullPathIds.map(arr => {
|
|
74828
|
+
col_pathIds.push(arr[recordCol]);
|
|
74829
|
+
});
|
|
74830
|
+
const findedRowPath = this.getTreePathByCellIds(col_pathIds);
|
|
74831
|
+
colPath.push(...findedRowPath);
|
|
74832
|
+
}
|
|
74833
|
+
else {
|
|
74834
|
+
colPath = this.columnDimensionTree.getTreePath(recordCol, this.showHeader && this.showColumnHeader
|
|
74835
|
+
? row - (this.columnHeaderTitle ? 1 : 0)
|
|
74836
|
+
: this.columnDimensionTree.totalLevel);
|
|
74837
|
+
}
|
|
74369
74838
|
this.setColHeaderPathCache(col, row, colPath);
|
|
74370
74839
|
}
|
|
74371
74840
|
if (!rowPath && col >= 0 && recordRow >= 0) {
|
|
@@ -74388,12 +74857,17 @@
|
|
|
74388
74857
|
break;
|
|
74389
74858
|
}
|
|
74390
74859
|
}
|
|
74391
|
-
const findedRowPath =
|
|
74860
|
+
const findedRowPath = this.getTreePathByCellIds(pathIds);
|
|
74392
74861
|
rowPath.push(...findedRowPath);
|
|
74393
74862
|
findTree = this._rowHeaderExtensionTree[row_pathIds[level]];
|
|
74394
74863
|
level++;
|
|
74395
74864
|
}
|
|
74396
74865
|
}
|
|
74866
|
+
else if (this.rowHierarchyType === 'grid-tree') {
|
|
74867
|
+
const row_pathIds = this._rowHeaderCellFullPathIds[recordRow];
|
|
74868
|
+
const findedRowPath = this.getTreePathByCellIds(row_pathIds);
|
|
74869
|
+
rowPath.push(...findedRowPath);
|
|
74870
|
+
}
|
|
74397
74871
|
else {
|
|
74398
74872
|
rowPath = this.rowDimensionTree.getTreePath(recordRow, this.showHeader && this.showRowHeader
|
|
74399
74873
|
? col - (this.rowHeaderTitle ? 1 : 0) - this.leftRowSeriesNumberColumnCount
|
|
@@ -74404,6 +74878,20 @@
|
|
|
74404
74878
|
const p = { colHeaderPaths: colPath, rowHeaderPaths: rowPath, cellLocation: this.getCellLocation(col, row) };
|
|
74405
74879
|
return p;
|
|
74406
74880
|
}
|
|
74881
|
+
getTreePathByCellIds(row_pathIds) {
|
|
74882
|
+
const paths = [];
|
|
74883
|
+
for (let i = 0; i < row_pathIds.length; i++) {
|
|
74884
|
+
const id = row_pathIds[i];
|
|
74885
|
+
if (i > 0 && id === row_pathIds[i - 1]) {
|
|
74886
|
+
continue;
|
|
74887
|
+
}
|
|
74888
|
+
const hd = this._headerObjects[id];
|
|
74889
|
+
if (hd?.define) {
|
|
74890
|
+
paths.push(hd.define);
|
|
74891
|
+
}
|
|
74892
|
+
}
|
|
74893
|
+
return paths;
|
|
74894
|
+
}
|
|
74407
74895
|
getCellHeaderPaths(col, row) {
|
|
74408
74896
|
const headerPathsWidthNode = this.getCellHeaderPathsWithTreeNode(col, row);
|
|
74409
74897
|
const headerPaths = {
|
|
@@ -74492,6 +74980,8 @@
|
|
|
74492
74980
|
}
|
|
74493
74981
|
toggleHierarchyState(col, row) {
|
|
74494
74982
|
this.colIndex = 0;
|
|
74983
|
+
const lastLevelIndex = (this.indicatorsAsCol ? this.rowHeaderLevelCount - 1 : this.rowHeaderLevelCount - 2) -
|
|
74984
|
+
this.leftRowSeriesNumberColumnCount;
|
|
74495
74985
|
const oldRowHeaderCellIds = this._rowHeaderCellFullPathIds_FULL.slice(0);
|
|
74496
74986
|
const oldRowHeaderCellPositons = oldRowHeaderCellIds.map((id, row) => {
|
|
74497
74987
|
return { col, row: row + this.columnHeaderLevelCount };
|
|
@@ -74500,11 +74990,18 @@
|
|
|
74500
74990
|
hd.define.hierarchyState =
|
|
74501
74991
|
hd.define.hierarchyState === HierarchyState.collapse ? HierarchyState.expand : HierarchyState.collapse;
|
|
74502
74992
|
this.rowDimensionTree.reset(this.rowDimensionTree.tree.children);
|
|
74993
|
+
this.resetRowHeaderLevelCount();
|
|
74503
74994
|
this._rowHeaderCellFullPathIds_FULL = [];
|
|
74504
74995
|
this.rowDimensionKeys = this.rowDimensionTree.dimensionKeysIncludeVirtual.valueArr();
|
|
74505
74996
|
this.fullRowDimensionKeys = [];
|
|
74506
74997
|
this.fullRowDimensionKeys = this.fullRowDimensionKeys.concat(this.rowDimensionKeys);
|
|
74507
|
-
|
|
74998
|
+
if (this.rowHierarchyType === 'tree') {
|
|
74999
|
+
this._addHeadersForTreeMode(this._rowHeaderCellFullPathIds_FULL, 0, this.rowDimensionTree.tree.children, [], this.rowDimensionTree.totalLevel, true, this.rowsDefine, this.rowHeaderObjs);
|
|
75000
|
+
}
|
|
75001
|
+
else if (this.rowHierarchyType === 'grid-tree') {
|
|
75002
|
+
const startRow = 0;
|
|
75003
|
+
this._addHeadersForGridTreeMode(this._rowHeaderCellFullPathIds_FULL, startRow, this.rowDimensionTree.tree.children, [], this.rowDimensionTree.totalLevel, this._getRowHeaderTreeExpandedMaxLevelCount(), true, this.rowsDefine, this.rowHeaderObjs, true);
|
|
75004
|
+
}
|
|
74508
75005
|
if (this.rowHeaderTitle) {
|
|
74509
75006
|
const id = ++this.sharedVar.seqId;
|
|
74510
75007
|
const firstColIds = Array(this.rowCount - this.columnHeaderLevelCount).fill(id);
|
|
@@ -74544,9 +75041,81 @@
|
|
|
74544
75041
|
}, {});
|
|
74545
75042
|
this._CellHeaderPathMap = new Map();
|
|
74546
75043
|
this._largeCellRangeCache.length = 0;
|
|
74547
|
-
|
|
75044
|
+
let diffCell;
|
|
75045
|
+
if (this.rowHierarchyType === 'tree') {
|
|
75046
|
+
diffCell = diffCellAddress(col, row, oldRowHeaderCellIds.map(oldCellId => oldCellId[col - this.leftRowSeriesNumberColumnCount]), this._rowHeaderCellFullPathIds_FULL.map(newCellId => newCellId[col - this.leftRowSeriesNumberColumnCount]), oldRowHeaderCellPositons, this);
|
|
75047
|
+
}
|
|
75048
|
+
else {
|
|
75049
|
+
const new_lastLevelIndex = (this.indicatorsAsCol ? this.rowHeaderLevelCount - 1 : this.rowHeaderLevelCount - 2) -
|
|
75050
|
+
this.leftRowSeriesNumberColumnCount;
|
|
75051
|
+
diffCell = diffCellAddressForGridTree(col, row, oldRowHeaderCellIds.map(oldCellId => oldCellId[lastLevelIndex]), this._rowHeaderCellFullPathIds_FULL.map(newCellId => newCellId[new_lastLevelIndex]), oldRowHeaderCellPositons, this);
|
|
75052
|
+
}
|
|
74548
75053
|
this.generateCellIdsConsiderHideHeader();
|
|
74549
75054
|
this.setPagination(this.pagination);
|
|
75055
|
+
if (this.rowHierarchyType === 'grid-tree') {
|
|
75056
|
+
this.setColumnWidths();
|
|
75057
|
+
}
|
|
75058
|
+
return diffCell;
|
|
75059
|
+
}
|
|
75060
|
+
toggleHierarchyStateForColumnTree(col, row) {
|
|
75061
|
+
this.colIndex = 0;
|
|
75062
|
+
const lastLevelIndex = !this.indicatorsAsCol ? this.columnHeaderLevelCount - 1 : this.columnHeaderLevelCount - 2;
|
|
75063
|
+
const oldColumnHeaderCellIds = this._columnHeaderCellFullPathIds.slice(0);
|
|
75064
|
+
const oldColumnHeaderCellPositons = oldColumnHeaderCellIds[this.columnHeaderLevelCount - 1].map((id, col) => {
|
|
75065
|
+
return { col: col + this.rowHeaderLevelCount, row };
|
|
75066
|
+
});
|
|
75067
|
+
const hd = this.getHeader(col, row);
|
|
75068
|
+
hd.define.hierarchyState =
|
|
75069
|
+
hd.define.hierarchyState === HierarchyState.collapse ? HierarchyState.expand : HierarchyState.collapse;
|
|
75070
|
+
this.columnDimensionTree.reset(this.columnDimensionTree.tree.children);
|
|
75071
|
+
this.resetColumnHeaderLevelCount();
|
|
75072
|
+
this._columnHeaderCellFullPathIds = [];
|
|
75073
|
+
this.colDimensionKeys = this.columnDimensionTree.dimensionKeysIncludeVirtual.valueArr();
|
|
75074
|
+
if (this.columnHierarchyType === 'grid-tree') {
|
|
75075
|
+
const startRow = 0;
|
|
75076
|
+
this._addHeadersForGridTreeMode(this._columnHeaderCellFullPathIds, startRow, this.columnDimensionTree.tree.children, [], this.columnDimensionTree.totalLevel, this._getColumnHeaderTreeExpandedMaxLevelCount(), true, this.columnsDefine, this.columnHeaderObjs, false);
|
|
75077
|
+
}
|
|
75078
|
+
if (this.columnHeaderTitle) {
|
|
75079
|
+
const id = ++this.sharedVar.seqId;
|
|
75080
|
+
const firstRowIds = Array(this.colCount - this.rowHeaderLevelCount - this.rightFrozenColCount).fill(id);
|
|
75081
|
+
this._columnHeaderCellFullPathIds.unshift(firstRowIds);
|
|
75082
|
+
const cell = {
|
|
75083
|
+
id,
|
|
75084
|
+
title: typeof this.columnHeaderTitle.title === 'string'
|
|
75085
|
+
? this.columnHeaderTitle.title
|
|
75086
|
+
: this.columnsDefine.reduce((title, value) => {
|
|
75087
|
+
if (typeof value === 'string') {
|
|
75088
|
+
return title;
|
|
75089
|
+
}
|
|
75090
|
+
return title + (title ? `/${value.title}` : `${value.title}`);
|
|
75091
|
+
}, ''),
|
|
75092
|
+
field: undefined,
|
|
75093
|
+
headerType: this.columnHeaderTitle?.headerType ?? 'text',
|
|
75094
|
+
style: this.columnHeaderTitle?.headerStyle,
|
|
75095
|
+
define: {
|
|
75096
|
+
id,
|
|
75097
|
+
disableHeaderHover: !!this.columnHeaderTitle?.disableHeaderHover,
|
|
75098
|
+
disableHeaderSelect: !!this.columnHeaderTitle?.disableHeaderSelect
|
|
75099
|
+
}
|
|
75100
|
+
};
|
|
75101
|
+
this.columnHeaderObjs.push(cell);
|
|
75102
|
+
this._headerObjects[id] = cell;
|
|
75103
|
+
}
|
|
75104
|
+
this.colIndex = 0;
|
|
75105
|
+
this._headerObjectMap = this._headerObjects.reduce((o, e) => {
|
|
75106
|
+
o[e.id] = e;
|
|
75107
|
+
return o;
|
|
75108
|
+
}, {});
|
|
75109
|
+
this._CellHeaderPathMap = new Map();
|
|
75110
|
+
this._largeCellRangeCache.length = 0;
|
|
75111
|
+
const new_lastLevelIndex = !this.indicatorsAsCol
|
|
75112
|
+
? this.columnHeaderLevelCount - 1
|
|
75113
|
+
: this.columnHeaderLevelCount - 2;
|
|
75114
|
+
const diffCell = diffCellAddressForGridTreeOnColumn(col, row, oldColumnHeaderCellIds[lastLevelIndex], this._columnHeaderCellFullPathIds[new_lastLevelIndex], oldColumnHeaderCellPositons, this);
|
|
75115
|
+
this.generateCellIdsConsiderHideHeader();
|
|
75116
|
+
if (this.columnHierarchyType === 'grid-tree') {
|
|
75117
|
+
this.setColumnWidths();
|
|
75118
|
+
}
|
|
74550
75119
|
return diffCell;
|
|
74551
75120
|
}
|
|
74552
75121
|
isHeaderForColWidth(col, row) {
|
|
@@ -75563,8 +76132,8 @@
|
|
|
75563
76132
|
this._table._syncHierarchyState(beforeRowDimension, node);
|
|
75564
76133
|
}
|
|
75565
76134
|
});
|
|
75566
|
-
this.columnDimensionTree = new DimensionTree(this.columnTree ?? [], this.sharedVar);
|
|
75567
|
-
this.rowDimensionTree = new DimensionTree(this.rowTree ?? [], this.sharedVar, this.rowHierarchyType, this.rowHierarchyType
|
|
76135
|
+
this.columnDimensionTree = new DimensionTree(this.columnTree ?? [], this.sharedVar, this.columnHierarchyType, this.columnHierarchyType !== 'grid' ? this.columnExpandLevel : undefined);
|
|
76136
|
+
this.rowDimensionTree = new DimensionTree(this.rowTree ?? [], this.sharedVar, this.rowHierarchyType, this.rowHierarchyType !== 'grid' ? this.rowExpandLevel : undefined);
|
|
75568
76137
|
this.resetColumnHeaderLevelCount();
|
|
75569
76138
|
this._generateColHeaderIds();
|
|
75570
76139
|
this.colIndex = 0;
|
|
@@ -75733,6 +76302,30 @@
|
|
|
75733
76302
|
this._cornerHeaderCellIds.splice(0, this._cornerHeaderCellIds.length);
|
|
75734
76303
|
}
|
|
75735
76304
|
}
|
|
76305
|
+
if (this.rowHierarchyType === 'grid-tree' && this.cornerSetting.titleOnDimension === 'column') {
|
|
76306
|
+
if (this._cornerHeaderCellIds[0].length < this._rowHeaderCellIds[0].length) {
|
|
76307
|
+
this._cornerHeaderCellIds.forEach((cellIds, index) => {
|
|
76308
|
+
const oldLength = cellIds.length;
|
|
76309
|
+
cellIds.length = this._rowHeaderCellIds[0].length;
|
|
76310
|
+
cellIds.fill(cellIds[0], oldLength);
|
|
76311
|
+
});
|
|
76312
|
+
}
|
|
76313
|
+
else if (this._cornerHeaderCellIds[0].length > this._rowHeaderCellIds[0].length) {
|
|
76314
|
+
this._cornerHeaderCellIds.forEach((cellIds, index) => {
|
|
76315
|
+
cellIds.length = this._rowHeaderCellIds[0].length;
|
|
76316
|
+
});
|
|
76317
|
+
}
|
|
76318
|
+
}
|
|
76319
|
+
else if (this.columnHierarchyType === 'grid-tree' && this.cornerSetting.titleOnDimension === 'row') {
|
|
76320
|
+
if (this._cornerHeaderCellIds?.length < this._columnHeaderCellIds?.length) {
|
|
76321
|
+
const oldLength = this._cornerHeaderCellIds.length;
|
|
76322
|
+
this._cornerHeaderCellIds.length = this._columnHeaderCellIds.length;
|
|
76323
|
+
this._cornerHeaderCellIds.fill(this._cornerHeaderCellIds[0], oldLength);
|
|
76324
|
+
}
|
|
76325
|
+
else if (this._cornerHeaderCellIds?.length > this._columnHeaderCellIds?.length) {
|
|
76326
|
+
this._cornerHeaderCellIds.length = this._columnHeaderCellIds.length;
|
|
76327
|
+
}
|
|
76328
|
+
}
|
|
75736
76329
|
}
|
|
75737
76330
|
enableUseGetBodyCache() {
|
|
75738
76331
|
this._useGetBodyCache = true;
|
|
@@ -76116,16 +76709,18 @@
|
|
|
76116
76709
|
colHeaderTree;
|
|
76117
76710
|
rowHeaderTree;
|
|
76118
76711
|
rowHierarchyType;
|
|
76712
|
+
columnHierarchyType;
|
|
76119
76713
|
indicators;
|
|
76120
76714
|
indicatorsAsCol;
|
|
76121
76715
|
totalRecordsTree = {};
|
|
76122
76716
|
hasExtensionRowTree;
|
|
76123
76717
|
parseCustomTreeToMatchRecords;
|
|
76124
|
-
constructor(dataConfig, rows, columns, indicatorKeys, indicators, indicatorsAsCol, records, rowHierarchyType, customColTree, customRowTree, needSplitPositiveAndNegative, hasExtensionRowTree, parseCustomTreeToMatchRecords) {
|
|
76718
|
+
constructor(dataConfig, rows, columns, indicatorKeys, indicators, indicatorsAsCol, records, rowHierarchyType, columnHierarchyType, customColTree, customRowTree, needSplitPositiveAndNegative, hasExtensionRowTree, parseCustomTreeToMatchRecords) {
|
|
76125
76719
|
this.registerAggregators();
|
|
76126
76720
|
this.dataConfig = dataConfig;
|
|
76127
76721
|
this.filterRules = this.dataConfig?.filterRules;
|
|
76128
76722
|
this.rowHierarchyType = rowHierarchyType ?? 'grid';
|
|
76723
|
+
this.columnHierarchyType = columnHierarchyType ?? 'grid';
|
|
76129
76724
|
this.sortRules = this.dataConfig?.sortRules;
|
|
76130
76725
|
this.aggregationRules = this.dataConfig?.aggregationRules;
|
|
76131
76726
|
this.derivedFieldRules = this.dataConfig?.derivedFieldRules;
|
|
@@ -76496,7 +77091,7 @@
|
|
|
76496
77091
|
}
|
|
76497
77092
|
else if (this.dataConfig?.totals?.row?.subTotalsDimensions &&
|
|
76498
77093
|
this.dataConfig?.totals?.row?.subTotalsDimensions.indexOf(this.rows[l - 1]) >= 0) {
|
|
76499
|
-
if (this.rowHierarchyType
|
|
77094
|
+
if (this.rowHierarchyType !== 'tree') {
|
|
76500
77095
|
rowKey.push(this.rowSubTotalLabel);
|
|
76501
77096
|
}
|
|
76502
77097
|
isToTalRecord = true;
|
|
@@ -76808,6 +77403,14 @@
|
|
|
76808
77403
|
}
|
|
76809
77404
|
});
|
|
76810
77405
|
}
|
|
77406
|
+
if (rowKey.length < this.rows.length && this.rowHierarchyType === 'grid-tree') {
|
|
77407
|
+
if (rowKey[0] === this.rowGrandTotalLabel) ;
|
|
77408
|
+
else if (this.totals?.row?.subTotalsDimensions &&
|
|
77409
|
+
this.totals?.row?.subTotalsDimensions?.length >= 1 &&
|
|
77410
|
+
rowKey[rowKey.length - 1] !== this.rowSubTotalLabel) {
|
|
77411
|
+
rowKey.push(this.rowSubTotalLabel);
|
|
77412
|
+
}
|
|
77413
|
+
}
|
|
76811
77414
|
flatRowKey = join(rowKey, this.stringJoinChar);
|
|
76812
77415
|
}
|
|
76813
77416
|
if (typeof colKey === 'string') {
|
|
@@ -76821,6 +77424,14 @@
|
|
|
76821
77424
|
}
|
|
76822
77425
|
});
|
|
76823
77426
|
}
|
|
77427
|
+
if (colKey.length < this.columns.length && this.columnHierarchyType === 'grid-tree') {
|
|
77428
|
+
if (colKey[0] === this.colGrandTotalLabel) ;
|
|
77429
|
+
else if (this.totals?.column?.subTotalsDimensions &&
|
|
77430
|
+
this.totals?.column?.subTotalsDimensions?.length >= 1 &&
|
|
77431
|
+
colKey[colKey.length - 1] !== this.colSubTotalLabel) {
|
|
77432
|
+
colKey.push(this.colSubTotalLabel);
|
|
77433
|
+
}
|
|
77434
|
+
}
|
|
76824
77435
|
flatColKey = join(colKey, this.stringJoinChar);
|
|
76825
77436
|
}
|
|
76826
77437
|
const agg = this.tree[flatRowKey]?.[flatColKey]?.[indicatorIndex];
|
|
@@ -77141,7 +77752,7 @@
|
|
|
77141
77752
|
const dimensionIndex = that.rows.indexOf(dimension);
|
|
77142
77753
|
if (dimensionIndex >= 0 && dimensionIndex < that.rows.length - 1) {
|
|
77143
77754
|
const rowTotalKey = rowKey.slice(0, dimensionIndex + 1);
|
|
77144
|
-
if (this.rowHierarchyType
|
|
77755
|
+
if (this.rowHierarchyType !== 'tree') {
|
|
77145
77756
|
rowTotalKey.push(that.rowSubTotalLabel);
|
|
77146
77757
|
}
|
|
77147
77758
|
const flatRowTotalKey = rowTotalKey.join(this.stringJoinChar);
|
|
@@ -77629,6 +78240,12 @@
|
|
|
77629
78240
|
}
|
|
77630
78241
|
super(container, options);
|
|
77631
78242
|
if (options) {
|
|
78243
|
+
if (!options.rowHierarchyType) {
|
|
78244
|
+
options.rowHierarchyType = 'grid';
|
|
78245
|
+
}
|
|
78246
|
+
if (!options.columnHierarchyType) {
|
|
78247
|
+
options.columnHierarchyType = 'grid';
|
|
78248
|
+
}
|
|
77632
78249
|
if (options.layout) {
|
|
77633
78250
|
Object.assign(options, options.layout);
|
|
77634
78251
|
}
|
|
@@ -77657,8 +78274,8 @@
|
|
|
77657
78274
|
this.internalProps.recordsIsTwoDimensionalArray = true;
|
|
77658
78275
|
}
|
|
77659
78276
|
if (options.customConfig?.enableDataAnalysis === false) {
|
|
77660
|
-
const columnDimensionTree = new DimensionTree(this.internalProps.columnTree ?? [], this.layoutNodeId);
|
|
77661
|
-
const rowDimensionTree = new DimensionTree(this.internalProps.rowTree ?? [], this.layoutNodeId, this.options.rowHierarchyType, this.options.rowHierarchyType
|
|
78277
|
+
const columnDimensionTree = new DimensionTree(this.internalProps.columnTree ?? [], this.layoutNodeId, this.options.columnHierarchyType, this.options.columnHierarchyType !== 'grid' ? this.options.columnExpandLevel ?? 1 : undefined);
|
|
78278
|
+
const rowDimensionTree = new DimensionTree(this.internalProps.rowTree ?? [], this.layoutNodeId, this.options.rowHierarchyType, this.options.rowHierarchyType !== 'grid' ? this.options.rowExpandLevel ?? 1 : undefined);
|
|
77662
78279
|
this.internalProps.layoutMap = new PivotHeaderLayoutMap(this, null, columnDimensionTree, rowDimensionTree);
|
|
77663
78280
|
if (this.internalProps.recordsIsTwoDimensionalArray === false) {
|
|
77664
78281
|
this.flatDataToObjects = new FlatDataToObjects({
|
|
@@ -77674,7 +78291,7 @@
|
|
|
77674
78291
|
const keysResults = parseColKeyRowKeyForPivotTable(this, options);
|
|
77675
78292
|
const { rowKeys, columnKeys, indicatorKeys } = keysResults;
|
|
77676
78293
|
let { columnDimensionTree, rowDimensionTree } = keysResults;
|
|
77677
|
-
this.dataset = new Dataset(this.internalProps.dataConfig, rowKeys, columnKeys, indicatorKeys, this.internalProps.indicators, options.indicatorsAsCol ?? true, options.records, options.rowHierarchyType, this.internalProps.columnTree, this.internalProps.rowTree, false, !!options.extensionRows, !!options.parseCustomTreeToMatchRecords);
|
|
78294
|
+
this.dataset = new Dataset(this.internalProps.dataConfig, rowKeys, columnKeys, indicatorKeys, this.internalProps.indicators, options.indicatorsAsCol ?? true, options.records, options.rowHierarchyType, options.columnHierarchyType, this.internalProps.columnTree, this.internalProps.rowTree, false, !!options.extensionRows, !!options.parseCustomTreeToMatchRecords);
|
|
77678
78295
|
if (!options.columnTree) {
|
|
77679
78296
|
if (options.indicatorsAsCol !== false) {
|
|
77680
78297
|
this.dataset.colHeaderTree = supplementIndicatorNodesForCustomTree(this.dataset.colHeaderTree, options.indicators);
|
|
@@ -77683,7 +78300,7 @@
|
|
|
77683
78300
|
options.indicators &&
|
|
77684
78301
|
this.dataset.colHeaderTree &&
|
|
77685
78302
|
deleteHideIndicatorNode(this.dataset.colHeaderTree, options.indicators, false, this);
|
|
77686
|
-
columnDimensionTree = new DimensionTree(this.dataset.colHeaderTree ?? [], this.layoutNodeId);
|
|
78303
|
+
columnDimensionTree = new DimensionTree(this.dataset.colHeaderTree ?? [], this.layoutNodeId, this.options.columnHierarchyType, this.options.columnHierarchyType !== 'grid' ? this.options.columnExpandLevel ?? 1 : undefined);
|
|
77687
78304
|
}
|
|
77688
78305
|
else {
|
|
77689
78306
|
if (columnDimensionTree.hasHideNode) {
|
|
@@ -77699,7 +78316,7 @@
|
|
|
77699
78316
|
this.dataset.rowHeaderTree &&
|
|
77700
78317
|
options.indicators &&
|
|
77701
78318
|
deleteHideIndicatorNode(this.dataset.rowHeaderTree, options.indicators, false, this);
|
|
77702
|
-
rowDimensionTree = new DimensionTree(this.dataset.rowHeaderTree ?? [], this.layoutNodeId, this.options.rowHierarchyType, this.options.rowHierarchyType
|
|
78319
|
+
rowDimensionTree = new DimensionTree(this.dataset.rowHeaderTree ?? [], this.layoutNodeId, this.options.rowHierarchyType, this.options.rowHierarchyType !== 'grid' ? this.options.rowExpandLevel ?? 1 : undefined);
|
|
77703
78320
|
}
|
|
77704
78321
|
else {
|
|
77705
78322
|
if (rowDimensionTree.hasHideNode) {
|
|
@@ -77775,6 +78392,12 @@
|
|
|
77775
78392
|
updateOption(options) {
|
|
77776
78393
|
const internalProps = this.internalProps;
|
|
77777
78394
|
super.updateOption(options);
|
|
78395
|
+
if (!options.rowHierarchyType) {
|
|
78396
|
+
options.rowHierarchyType = 'grid';
|
|
78397
|
+
}
|
|
78398
|
+
if (!options.columnHierarchyType) {
|
|
78399
|
+
options.columnHierarchyType = 'grid';
|
|
78400
|
+
}
|
|
77778
78401
|
this.layoutNodeId = { seqId: 0 };
|
|
77779
78402
|
this.internalProps.columns = cloneDeep$1(options.columns);
|
|
77780
78403
|
this.internalProps.rows = cloneDeep$1(options.rows);
|
|
@@ -77797,8 +78420,8 @@
|
|
|
77797
78420
|
internalProps.dataConfig = cloneDeep$1(options.dataConfig);
|
|
77798
78421
|
this.internalProps.columnWidthConfig = options.columnWidthConfig;
|
|
77799
78422
|
this.internalProps.columnWidthConfigForRowHeader = options.columnWidthConfigForRowHeader;
|
|
77800
|
-
if (options?.rowHierarchyType
|
|
77801
|
-
this.internalProps.layoutMap.rowHierarchyType
|
|
78423
|
+
if (options?.rowHierarchyType !== 'grid' &&
|
|
78424
|
+
this.internalProps.layoutMap.rowHierarchyType !== 'grid' &&
|
|
77802
78425
|
this.internalProps.layoutMap.rowExpandLevel === options?.rowExpandLevel) {
|
|
77803
78426
|
const beforeRowDimensions = this.internalProps.layoutMap.rowDimensionTree.tree.children;
|
|
77804
78427
|
this.internalProps.rowTree?.forEach((node, index) => {
|
|
@@ -77817,10 +78440,10 @@
|
|
|
77817
78440
|
let columnDimensionTree;
|
|
77818
78441
|
let rowDimensionTree;
|
|
77819
78442
|
if (options.columnTree) {
|
|
77820
|
-
columnDimensionTree = new DimensionTree(this.internalProps.columnTree ?? [], this.layoutNodeId);
|
|
78443
|
+
columnDimensionTree = new DimensionTree(this.internalProps.columnTree ?? [], this.layoutNodeId, this.options.columnHierarchyType, this.options.columnHierarchyType !== 'grid' ? this.options.columnExpandLevel ?? 1 : undefined);
|
|
77821
78444
|
}
|
|
77822
78445
|
if (options.rowTree) {
|
|
77823
|
-
rowDimensionTree = new DimensionTree(this.internalProps.rowTree ?? [], this.layoutNodeId, this.options.rowHierarchyType, this.options.rowHierarchyType
|
|
78446
|
+
rowDimensionTree = new DimensionTree(this.internalProps.rowTree ?? [], this.layoutNodeId, this.options.rowHierarchyType, this.options.rowHierarchyType !== 'grid' ? this.options.rowExpandLevel ?? 1 : undefined);
|
|
77824
78447
|
}
|
|
77825
78448
|
internalProps.layoutMap = new PivotHeaderLayoutMap(this, null, columnDimensionTree, rowDimensionTree);
|
|
77826
78449
|
if (this.internalProps.recordsIsTwoDimensionalArray === false) {
|
|
@@ -77837,7 +78460,7 @@
|
|
|
77837
78460
|
const keysResults = parseColKeyRowKeyForPivotTable(this, options);
|
|
77838
78461
|
const { rowKeys, columnKeys, indicatorKeys } = keysResults;
|
|
77839
78462
|
let { columnDimensionTree, rowDimensionTree } = keysResults;
|
|
77840
|
-
this.dataset = new Dataset(internalProps.dataConfig, rowKeys, columnKeys, indicatorKeys, this.internalProps.indicators, options.indicatorsAsCol ?? true, records, options.rowHierarchyType, this.internalProps.columnTree, this.internalProps.rowTree, false, !!options.extensionRows, !!options.parseCustomTreeToMatchRecords);
|
|
78463
|
+
this.dataset = new Dataset(internalProps.dataConfig, rowKeys, columnKeys, indicatorKeys, this.internalProps.indicators, options.indicatorsAsCol ?? true, records, options.rowHierarchyType, options.columnHierarchyType, this.internalProps.columnTree, this.internalProps.rowTree, false, !!options.extensionRows, !!options.parseCustomTreeToMatchRecords);
|
|
77841
78464
|
if (!options.columnTree) {
|
|
77842
78465
|
if (options.indicatorsAsCol !== false) {
|
|
77843
78466
|
this.dataset.colHeaderTree = supplementIndicatorNodesForCustomTree(this.dataset.colHeaderTree, options.indicators);
|
|
@@ -77846,7 +78469,7 @@
|
|
|
77846
78469
|
options.indicators &&
|
|
77847
78470
|
this.dataset.colHeaderTree &&
|
|
77848
78471
|
deleteHideIndicatorNode(this.dataset.colHeaderTree, options.indicators, false, this);
|
|
77849
|
-
columnDimensionTree = new DimensionTree(this.dataset.colHeaderTree ?? [], this.layoutNodeId);
|
|
78472
|
+
columnDimensionTree = new DimensionTree(this.dataset.colHeaderTree ?? [], this.layoutNodeId, this.options.columnHierarchyType, this.options.columnHierarchyType !== 'grid' ? this.options.columnExpandLevel ?? 1 : undefined);
|
|
77850
78473
|
}
|
|
77851
78474
|
else {
|
|
77852
78475
|
if (columnDimensionTree.hasHideNode) {
|
|
@@ -77862,7 +78485,7 @@
|
|
|
77862
78485
|
this.dataset.rowHeaderTree &&
|
|
77863
78486
|
options.indicators &&
|
|
77864
78487
|
deleteHideIndicatorNode(this.dataset.rowHeaderTree, options.indicators, false, this);
|
|
77865
|
-
rowDimensionTree = new DimensionTree(this.dataset.rowHeaderTree ?? [], this.layoutNodeId, this.options.rowHierarchyType, this.options.rowHierarchyType
|
|
78488
|
+
rowDimensionTree = new DimensionTree(this.dataset.rowHeaderTree ?? [], this.layoutNodeId, this.options.rowHierarchyType, this.options.rowHierarchyType !== 'grid' ? this.options.rowExpandLevel ?? 1 : undefined);
|
|
77866
78489
|
}
|
|
77867
78490
|
else {
|
|
77868
78491
|
if (rowDimensionTree.hasHideNode) {
|
|
@@ -77952,6 +78575,7 @@
|
|
|
77952
78575
|
table.rightFrozenColCount = this.options.rightFrozenColCount ?? 0;
|
|
77953
78576
|
}
|
|
77954
78577
|
this.stateManager.setFrozenCol(this.internalProps.frozenColCount);
|
|
78578
|
+
this.stateManager.setFrozenRow(this.frozenRowCount);
|
|
77955
78579
|
}
|
|
77956
78580
|
_getSortFuncFromHeaderOption(columns, field, fieldKey) {
|
|
77957
78581
|
return undefined;
|
|
@@ -77959,6 +78583,9 @@
|
|
|
77959
78583
|
get rowHierarchyType() {
|
|
77960
78584
|
return this.internalProps.layoutMap.rowHierarchyType;
|
|
77961
78585
|
}
|
|
78586
|
+
get columnHierarchyType() {
|
|
78587
|
+
return this.internalProps.layoutMap.columnHierarchyType;
|
|
78588
|
+
}
|
|
77962
78589
|
_syncHierarchyState(sourceNode, targetNode) {
|
|
77963
78590
|
if (sourceNode.value === targetNode.value && sourceNode.dimensionKey === targetNode.dimensionKey) {
|
|
77964
78591
|
targetNode.hierarchyState =
|
|
@@ -78651,6 +79278,11 @@
|
|
|
78651
79278
|
}
|
|
78652
79279
|
}
|
|
78653
79280
|
_refreshHierarchyState(col, row, recalculateColWidths = true, beforeUpdateCell) {
|
|
79281
|
+
this.frozenColCount;
|
|
79282
|
+
this.frozenRowCount;
|
|
79283
|
+
const visibleStartRow = this.getBodyVisibleRowRange().rowStart;
|
|
79284
|
+
this.internalProps._oldRowCount = this.rowCount;
|
|
79285
|
+
this.internalProps._oldColCount = this.colCount;
|
|
78654
79286
|
let notFillWidth = false;
|
|
78655
79287
|
let notFillHeight = false;
|
|
78656
79288
|
this.stateManager.updateHoverIcon(col, row, undefined, undefined);
|
|
@@ -78663,13 +79295,28 @@
|
|
|
78663
79295
|
notFillHeight = this.getAllRowsHeight() <= this.tableNoFrameHeight;
|
|
78664
79296
|
}
|
|
78665
79297
|
}
|
|
78666
|
-
const
|
|
79298
|
+
const isChangeRowTree = this.internalProps.layoutMap.isRowHeader(col, row);
|
|
79299
|
+
const result = isChangeRowTree
|
|
79300
|
+
? this.internalProps.layoutMap.toggleHierarchyState(col, row)
|
|
79301
|
+
: this.internalProps.layoutMap.toggleHierarchyStateForColumnTree(col, row);
|
|
78667
79302
|
beforeUpdateCell && beforeUpdateCell();
|
|
78668
79303
|
this.refreshRowColCount();
|
|
79304
|
+
this.frozenColCount;
|
|
79305
|
+
this.frozenRowCount;
|
|
78669
79306
|
this.clearCellStyleCache();
|
|
78670
|
-
this.
|
|
79307
|
+
if (this.rowHierarchyType === 'tree') {
|
|
79308
|
+
this.scenegraph.updateHierarchyIcon(col, row);
|
|
79309
|
+
}
|
|
78671
79310
|
this.reactCustomLayout?.clearCache();
|
|
78672
|
-
this.
|
|
79311
|
+
if (this.rowHierarchyType !== 'grid-tree' && this.columnHierarchyType !== 'grid-tree') {
|
|
79312
|
+
this.scenegraph.updateRow(result.removeCellPositionsRowDirection, result.addCellPositionsRowDirection, result.updateCellPositionsRowDirection, recalculateColWidths);
|
|
79313
|
+
}
|
|
79314
|
+
else {
|
|
79315
|
+
this.scenegraph.clearCells();
|
|
79316
|
+
this.clearCellStyleCache();
|
|
79317
|
+
this.scenegraph.createSceneGraph();
|
|
79318
|
+
this.scrollToRow(visibleStartRow);
|
|
79319
|
+
}
|
|
78673
79320
|
this.reactCustomLayout?.updateAllCustomCell();
|
|
78674
79321
|
if (checkHasChart) {
|
|
78675
79322
|
if (this.autoFillWidth && !notFillWidth) {
|
|
@@ -78682,6 +79329,8 @@
|
|
|
78682
79329
|
this.scenegraph.updateChartSizeForResizeColWidth(-1);
|
|
78683
79330
|
}
|
|
78684
79331
|
}
|
|
79332
|
+
this.internalProps._oldRowCount = undefined;
|
|
79333
|
+
this.internalProps._oldColCount = undefined;
|
|
78685
79334
|
}
|
|
78686
79335
|
getHeaderCellAddressByPath(dimensionPaths) {
|
|
78687
79336
|
const cellAddress = this.internalProps.layoutMap.getPivotCellAdress(dimensionPaths);
|
|
@@ -78726,9 +79375,6 @@
|
|
|
78726
79375
|
const headerNodes = layoutMap.getCellHeaderPathsWithTreeNode(col, row);
|
|
78727
79376
|
return headerNodes;
|
|
78728
79377
|
}
|
|
78729
|
-
_hasHierarchyTreeHeader() {
|
|
78730
|
-
return this.internalProps.layoutMap.rowHierarchyType === 'tree';
|
|
78731
|
-
}
|
|
78732
79378
|
getMenuInfo(col, row, type) {
|
|
78733
79379
|
const dimensionInfos = this.internalProps.layoutMap.getPivotDimensionInfo(col, row);
|
|
78734
79380
|
const result = {
|
|
@@ -78772,7 +79418,7 @@
|
|
|
78772
79418
|
options.indicators &&
|
|
78773
79419
|
this.dataset.colHeaderTree &&
|
|
78774
79420
|
deleteHideIndicatorNode(this.dataset.colHeaderTree, options.indicators, false, this);
|
|
78775
|
-
columnDimensionTree = new DimensionTree(this.dataset.colHeaderTree ?? [], this.layoutNodeId);
|
|
79421
|
+
columnDimensionTree = new DimensionTree(this.dataset.colHeaderTree ?? [], this.layoutNodeId, this.options.columnHierarchyType, this.options.columnHierarchyType !== 'grid' ? this.options.columnExpandLevel ?? 1 : undefined);
|
|
78776
79422
|
}
|
|
78777
79423
|
if (options.rowTree) {
|
|
78778
79424
|
rowDimensionTree = internalProps.layoutMap.rowDimensionTree;
|
|
@@ -78782,7 +79428,7 @@
|
|
|
78782
79428
|
this.dataset.rowHeaderTree &&
|
|
78783
79429
|
options.indicators &&
|
|
78784
79430
|
deleteHideIndicatorNode(this.dataset.rowHeaderTree, options.indicators, false, this);
|
|
78785
|
-
rowDimensionTree = new DimensionTree(this.dataset.rowHeaderTree ?? [], this.layoutNodeId, this.options.rowHierarchyType, this.options.rowHierarchyType
|
|
79431
|
+
rowDimensionTree = new DimensionTree(this.dataset.rowHeaderTree ?? [], this.layoutNodeId, this.options.rowHierarchyType, this.options.rowHierarchyType !== 'grid' ? this.options.rowExpandLevel ?? 1 : undefined);
|
|
78786
79432
|
}
|
|
78787
79433
|
internalProps.layoutMap = new PivotHeaderLayoutMap(this, this.dataset, columnDimensionTree, rowDimensionTree);
|
|
78788
79434
|
this.pivotSortState = [];
|
|
@@ -79275,7 +79921,7 @@
|
|
|
79275
79921
|
this.internalProps.dataConfig.collectValuesBy = this._generateCollectValuesConfig(columnKeys, rowKeys);
|
|
79276
79922
|
this.internalProps.dataConfig.aggregationRules = this._generateAggregationRules();
|
|
79277
79923
|
this.internalProps.dataConfig.dimensionSortArray = this._getDimensionSortArray();
|
|
79278
|
-
this.dataset = new Dataset(this.internalProps.dataConfig, rowKeys, columnKeys, indicatorKeys, this.internalProps.indicators, options.indicatorsAsCol ?? true, options.records, undefined, this.internalProps.columnTree, this.internalProps.rowTree, true);
|
|
79924
|
+
this.dataset = new Dataset(this.internalProps.dataConfig, rowKeys, columnKeys, indicatorKeys, this.internalProps.indicators, options.indicatorsAsCol ?? true, options.records, undefined, undefined, this.internalProps.columnTree, this.internalProps.rowTree, true);
|
|
79279
79925
|
if (this.options.indicatorsAsCol && checkHasCartesianChart(this.internalProps.indicators)) {
|
|
79280
79926
|
const supplyAxisNode = (nodes) => {
|
|
79281
79927
|
nodes.forEach((node) => {
|
|
@@ -79435,7 +80081,7 @@
|
|
|
79435
80081
|
this.internalProps.dataConfig.collectValuesBy = this._generateCollectValuesConfig(columnKeys, rowKeys);
|
|
79436
80082
|
this.internalProps.dataConfig.aggregationRules = this._generateAggregationRules();
|
|
79437
80083
|
this.internalProps.dataConfig.dimensionSortArray = this._getDimensionSortArray();
|
|
79438
|
-
this.dataset = new Dataset(this.internalProps.dataConfig, rowKeys, columnKeys, indicatorKeys, this.internalProps.indicators, options.indicatorsAsCol ?? true, options.records ?? this.internalProps.records, undefined, this.internalProps.columnTree, this.internalProps.rowTree, true);
|
|
80084
|
+
this.dataset = new Dataset(this.internalProps.dataConfig, rowKeys, columnKeys, indicatorKeys, this.internalProps.indicators, options.indicatorsAsCol ?? true, options.records ?? this.internalProps.records, undefined, undefined, this.internalProps.columnTree, this.internalProps.rowTree, true);
|
|
79439
80085
|
if (this.options.indicatorsAsCol && checkHasCartesianChart(this.internalProps.indicators)) {
|
|
79440
80086
|
const supplyAxisNode = (nodes) => {
|
|
79441
80087
|
nodes.forEach((node) => {
|
|
@@ -79766,9 +80412,6 @@
|
|
|
79766
80412
|
getHierarchyState(col, row) {
|
|
79767
80413
|
return this._getHeaderLayoutMap(col, row)?.hierarchyState;
|
|
79768
80414
|
}
|
|
79769
|
-
_hasHierarchyTreeHeader() {
|
|
79770
|
-
return this.internalProps.layoutMap.rowHierarchyType === 'tree';
|
|
79771
|
-
}
|
|
79772
80415
|
getMenuInfo(col, row, type) {
|
|
79773
80416
|
const dimensionInfos = this.internalProps.layoutMap.getPivotDimensionInfo(col, row);
|
|
79774
80417
|
const result = {
|
|
@@ -80566,7 +81209,7 @@
|
|
|
80566
81209
|
}, []) ?? [];
|
|
80567
81210
|
dataConfig.collectValuesBy = _generateCollectValuesConfig(options, columnKeys, rowKeys);
|
|
80568
81211
|
dataConfig.aggregationRules = _generateAggregationRules(options);
|
|
80569
|
-
const dataset = new Dataset(dataConfig, rowKeys, columnKeys, indicatorKeys, options.indicators, options.indicatorsAsCol ?? true, options.records, undefined, columnTree || options.columnTree, rowTree || options.rowTree, true);
|
|
81212
|
+
const dataset = new Dataset(dataConfig, rowKeys, columnKeys, indicatorKeys, options.indicators, options.indicatorsAsCol ?? true, options.records, undefined, undefined, columnTree || options.columnTree, rowTree || options.rowTree, true);
|
|
80570
81213
|
return { dataset, columnDimensionTree, rowDimensionTree, layoutNodeId };
|
|
80571
81214
|
}
|
|
80572
81215
|
function _generateCollectValuesConfig(option, columnKeys, rowKeys) {
|
|
@@ -80813,7 +81456,7 @@
|
|
|
80813
81456
|
}
|
|
80814
81457
|
|
|
80815
81458
|
registerForVrender();
|
|
80816
|
-
const version = "1.
|
|
81459
|
+
const version = "1.16.0-alpha.0";
|
|
80817
81460
|
function getIcons() {
|
|
80818
81461
|
return get$2();
|
|
80819
81462
|
}
|