@visactor/vtable 0.15.5 → 0.16.1
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/ListTable.d.ts +5 -2
- package/cjs/ListTable.js +161 -16
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotChart.d.ts +1 -1
- package/cjs/PivotChart.js +1 -1
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/PivotTable.d.ts +1 -1
- package/cjs/PivotTable.js +1 -1
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/components/menu/dom/logic/MenuElement.js +3 -3
- package/cjs/components/menu/dom/logic/MenuElement.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +1 -1
- package/cjs/core/BaseTable.js +4 -4
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/tableHelper.d.ts +2 -0
- package/cjs/core/tableHelper.js +18 -3
- package/cjs/core/tableHelper.js.map +1 -1
- package/cjs/data/DataSource.d.ts +8 -1
- package/cjs/data/DataSource.js +59 -2
- package/cjs/data/DataSource.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/scenegraph/group-creater/column.d.ts +0 -4
- package/cjs/scenegraph/group-creater/column.js +1 -19
- package/cjs/scenegraph/group-creater/column.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.d.ts +2 -0
- package/cjs/scenegraph/group-creater/progress/proxy.js +17 -3
- package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +4 -0
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
- package/cjs/scenegraph/layout/auto-height.d.ts +1 -2
- package/cjs/scenegraph/layout/auto-height.js +1 -36
- package/cjs/scenegraph/layout/auto-height.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/update-col.d.ts +3 -0
- package/cjs/scenegraph/layout/update-col.js +203 -0
- package/cjs/scenegraph/layout/update-col.js.map +1 -0
- package/cjs/scenegraph/layout/update-height.js +1 -1
- package/cjs/scenegraph/layout/update-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-row.js +94 -49
- package/cjs/scenegraph/layout/update-row.js.map +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +5 -0
- package/cjs/scenegraph/scenegraph.js +24 -3
- 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/resize/update-resize-column.js +1 -1
- package/cjs/state/resize/update-resize-column.js.map +1 -1
- package/cjs/state/state.d.ts +2 -0
- package/cjs/state/state.js +47 -2
- package/cjs/state/state.js.map +1 -1
- package/cjs/themes/DARK.js.map +1 -1
- package/cjs/tools/diff-cell.js +1 -1
- package/cjs/tools/diff-cell.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +1 -1
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +3 -0
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/dist/vtable.js +981 -118
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.d.ts +5 -2
- package/es/ListTable.js +161 -17
- package/es/ListTable.js.map +1 -1
- package/es/PivotChart.d.ts +1 -1
- package/es/PivotChart.js +1 -1
- package/es/PivotChart.js.map +1 -1
- package/es/PivotTable.d.ts +1 -1
- package/es/PivotTable.js +1 -1
- package/es/PivotTable.js.map +1 -1
- package/es/components/menu/dom/logic/MenuElement.js +3 -3
- package/es/components/menu/dom/logic/MenuElement.js.map +1 -1
- package/es/core/BaseTable.d.ts +1 -1
- package/es/core/BaseTable.js +4 -4
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/tableHelper.d.ts +2 -0
- package/es/core/tableHelper.js +16 -0
- package/es/core/tableHelper.js.map +1 -1
- package/es/data/DataSource.d.ts +8 -1
- package/es/data/DataSource.js +59 -2
- package/es/data/DataSource.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/scenegraph/group-creater/column.d.ts +0 -4
- package/es/scenegraph/group-creater/column.js +0 -16
- package/es/scenegraph/group-creater/column.js.map +1 -1
- package/es/scenegraph/group-creater/progress/proxy.d.ts +2 -0
- package/es/scenegraph/group-creater/progress/proxy.js +16 -2
- package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +4 -0
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
- package/es/scenegraph/layout/auto-height.d.ts +1 -2
- package/es/scenegraph/layout/auto-height.js +0 -33
- package/es/scenegraph/layout/auto-height.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/update-col.d.ts +3 -0
- package/es/scenegraph/layout/update-col.js +200 -0
- package/es/scenegraph/layout/update-col.js.map +1 -0
- package/es/scenegraph/layout/update-height.js +1 -1
- package/es/scenegraph/layout/update-height.js.map +1 -1
- package/es/scenegraph/layout/update-row.js +94 -49
- package/es/scenegraph/layout/update-row.js.map +1 -1
- package/es/scenegraph/scenegraph.d.ts +5 -0
- package/es/scenegraph/scenegraph.js +25 -2
- 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/resize/update-resize-column.js +1 -1
- package/es/state/resize/update-resize-column.js.map +1 -1
- package/es/state/state.d.ts +2 -0
- package/es/state/state.js +47 -2
- package/es/state/state.js.map +1 -1
- package/es/themes/DARK.js.map +1 -1
- package/es/tools/diff-cell.js +1 -1
- package/es/tools/diff-cell.js.map +1 -1
- package/es/ts-types/base-table.d.ts +1 -1
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +3 -0
- package/es/ts-types/table-engine.js.map +1 -1
- package/package.json +4 -4
package/dist/vtable.js
CHANGED
|
@@ -49267,7 +49267,7 @@
|
|
|
49267
49267
|
let parentId = layout.getParentCellId(col, row);
|
|
49268
49268
|
let parentCellAddress = layout.getRowHeaderCellAddressByCellId(parentId);
|
|
49269
49269
|
const updateCellPositions = [];
|
|
49270
|
-
updateCellPositions.push(parentCellAddress);
|
|
49270
|
+
parentCellAddress && updateCellPositions.push(parentCellAddress);
|
|
49271
49271
|
while (parentId) {
|
|
49272
49272
|
parentId = layout.getParentCellId(parentCellAddress.col, parentCellAddress.row);
|
|
49273
49273
|
if (parentId) {
|
|
@@ -49397,6 +49397,7 @@
|
|
|
49397
49397
|
lastOrderFn;
|
|
49398
49398
|
lastOrderField;
|
|
49399
49399
|
currentIndexedData = [];
|
|
49400
|
+
userPagination;
|
|
49400
49401
|
pagination;
|
|
49401
49402
|
_currentPagerIndexedData;
|
|
49402
49403
|
enableHierarchyState = false;
|
|
@@ -49412,6 +49413,7 @@
|
|
|
49412
49413
|
this._source = obj?.source ?? obj;
|
|
49413
49414
|
this.sortedIndexMap = new Map();
|
|
49414
49415
|
this._currentPagerIndexedData = [];
|
|
49416
|
+
this.userPagination = pagination;
|
|
49415
49417
|
this.pagination = pagination || {
|
|
49416
49418
|
totalCount: this._sourceLength,
|
|
49417
49419
|
perPageCount: this._sourceLength,
|
|
@@ -49621,6 +49623,112 @@
|
|
|
49621
49623
|
p_node.children.splice(c_node_index, 1, record);
|
|
49622
49624
|
}
|
|
49623
49625
|
}
|
|
49626
|
+
addRecord(record, index) {
|
|
49627
|
+
this.source.splice(index, 0, record);
|
|
49628
|
+
this.currentIndexedData.push(this.currentIndexedData.length);
|
|
49629
|
+
this._sourceLength += 1;
|
|
49630
|
+
if (this.userPagination) {
|
|
49631
|
+
this.pagination.totalCount = this._sourceLength;
|
|
49632
|
+
const { perPageCount, currentPage } = this.pagination;
|
|
49633
|
+
const startIndex = perPageCount * (currentPage || 0);
|
|
49634
|
+
const endIndex = startIndex + perPageCount;
|
|
49635
|
+
if (index < endIndex) {
|
|
49636
|
+
this.updatePagerData();
|
|
49637
|
+
}
|
|
49638
|
+
}
|
|
49639
|
+
else {
|
|
49640
|
+
this.pagination.perPageCount = this._sourceLength;
|
|
49641
|
+
this.pagination.totalCount = this._sourceLength;
|
|
49642
|
+
this.updatePagerData();
|
|
49643
|
+
}
|
|
49644
|
+
}
|
|
49645
|
+
addRecords(recordArr, index) {
|
|
49646
|
+
if (Array.isArray(recordArr)) {
|
|
49647
|
+
this.source.splice(index, 0, ...recordArr);
|
|
49648
|
+
for (let i = 0; i < recordArr.length; i++) {
|
|
49649
|
+
this.currentIndexedData.push(this.currentIndexedData.length);
|
|
49650
|
+
}
|
|
49651
|
+
this._sourceLength += recordArr.length;
|
|
49652
|
+
}
|
|
49653
|
+
if (this.userPagination) {
|
|
49654
|
+
this.pagination.totalCount = this._sourceLength;
|
|
49655
|
+
const { perPageCount, currentPage } = this.pagination;
|
|
49656
|
+
const startIndex = perPageCount * (currentPage || 0);
|
|
49657
|
+
const endIndex = startIndex + perPageCount;
|
|
49658
|
+
if (index < endIndex) {
|
|
49659
|
+
this.updatePagerData();
|
|
49660
|
+
}
|
|
49661
|
+
}
|
|
49662
|
+
else {
|
|
49663
|
+
this.pagination.perPageCount = this._sourceLength;
|
|
49664
|
+
this.pagination.totalCount = this._sourceLength;
|
|
49665
|
+
this.updatePagerData();
|
|
49666
|
+
}
|
|
49667
|
+
}
|
|
49668
|
+
addRecordForSorted(record) {
|
|
49669
|
+
this.source.push(record);
|
|
49670
|
+
this.currentIndexedData.push(this.currentIndexedData.length);
|
|
49671
|
+
this._sourceLength += 1;
|
|
49672
|
+
this.sortedIndexMap.clear();
|
|
49673
|
+
if (!this.userPagination) {
|
|
49674
|
+
this.pagination.perPageCount = this._sourceLength;
|
|
49675
|
+
this.pagination.totalCount = this._sourceLength;
|
|
49676
|
+
}
|
|
49677
|
+
}
|
|
49678
|
+
addRecordsForSorted(recordArr) {
|
|
49679
|
+
if (Array.isArray(recordArr)) {
|
|
49680
|
+
this.source.push(...recordArr);
|
|
49681
|
+
for (let i = 0; i < recordArr.length; i++) {
|
|
49682
|
+
this.currentIndexedData.push(this.currentIndexedData.length);
|
|
49683
|
+
}
|
|
49684
|
+
this._sourceLength += recordArr.length;
|
|
49685
|
+
this.sortedIndexMap.clear();
|
|
49686
|
+
}
|
|
49687
|
+
if (!this.userPagination) {
|
|
49688
|
+
this.pagination.perPageCount = this._sourceLength;
|
|
49689
|
+
this.pagination.totalCount = this._sourceLength;
|
|
49690
|
+
}
|
|
49691
|
+
}
|
|
49692
|
+
deleteRecordsForSorted(recordIndexs) {
|
|
49693
|
+
const recordIndexsMaxToMin = recordIndexs.sort((a, b) => b - a);
|
|
49694
|
+
for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
|
|
49695
|
+
const recordIndex = recordIndexsMaxToMin[index];
|
|
49696
|
+
if (recordIndex >= this._sourceLength || recordIndex < 0) {
|
|
49697
|
+
continue;
|
|
49698
|
+
}
|
|
49699
|
+
const rawIndex = this.currentIndexedData[recordIndex];
|
|
49700
|
+
this.source.splice(rawIndex, 1);
|
|
49701
|
+
this._sourceLength -= 1;
|
|
49702
|
+
}
|
|
49703
|
+
this.sortedIndexMap.clear();
|
|
49704
|
+
if (!this.userPagination) {
|
|
49705
|
+
this.pagination.perPageCount = this._sourceLength;
|
|
49706
|
+
this.pagination.totalCount = this._sourceLength;
|
|
49707
|
+
}
|
|
49708
|
+
}
|
|
49709
|
+
deleteRecords(recordIndexs) {
|
|
49710
|
+
const realDeletedRecordIndexs = [];
|
|
49711
|
+
const recordIndexsMaxToMin = recordIndexs.sort((a, b) => b - a);
|
|
49712
|
+
for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
|
|
49713
|
+
const recordIndex = recordIndexsMaxToMin[index];
|
|
49714
|
+
if (recordIndex >= this._sourceLength || recordIndex < 0) {
|
|
49715
|
+
continue;
|
|
49716
|
+
}
|
|
49717
|
+
realDeletedRecordIndexs.push(recordIndex);
|
|
49718
|
+
this.source.splice(recordIndex, 1);
|
|
49719
|
+
this.currentIndexedData.pop();
|
|
49720
|
+
this._sourceLength -= 1;
|
|
49721
|
+
}
|
|
49722
|
+
if (this.userPagination) {
|
|
49723
|
+
this.updatePagerData();
|
|
49724
|
+
}
|
|
49725
|
+
else {
|
|
49726
|
+
this.pagination.perPageCount = this._sourceLength;
|
|
49727
|
+
this.pagination.totalCount = this._sourceLength;
|
|
49728
|
+
this.updatePagerData();
|
|
49729
|
+
}
|
|
49730
|
+
return realDeletedRecordIndexs;
|
|
49731
|
+
}
|
|
49624
49732
|
sort(field, order, orderFn = order !== 'desc'
|
|
49625
49733
|
? (v1, v2) => (v1 === v2 ? 0 : v1 > v2 ? 1 : -1)
|
|
49626
49734
|
: (v1, v2) => (v1 === v2 ? 0 : v1 < v2 ? 1 : -1)) {
|
|
@@ -49688,7 +49796,7 @@
|
|
|
49688
49796
|
});
|
|
49689
49797
|
}
|
|
49690
49798
|
}
|
|
49691
|
-
get
|
|
49799
|
+
get sourceLength() {
|
|
49692
49800
|
return this._sourceLength;
|
|
49693
49801
|
}
|
|
49694
49802
|
set sourceLength(sourceLen) {
|
|
@@ -50499,6 +50607,32 @@
|
|
|
50499
50607
|
hasFunctionPros
|
|
50500
50608
|
};
|
|
50501
50609
|
}
|
|
50610
|
+
function sortRecords(table) {
|
|
50611
|
+
if (table.sortState) {
|
|
50612
|
+
let order;
|
|
50613
|
+
let field;
|
|
50614
|
+
let fieldKey;
|
|
50615
|
+
if (Array.isArray(table.sortState)) {
|
|
50616
|
+
if (table.sortState.length !== 0) {
|
|
50617
|
+
({ order, field, fieldKey } = table.sortState?.[0]);
|
|
50618
|
+
}
|
|
50619
|
+
}
|
|
50620
|
+
else {
|
|
50621
|
+
({ order, field, fieldKey } = table.sortState);
|
|
50622
|
+
}
|
|
50623
|
+
if (order && field && order !== 'normal') {
|
|
50624
|
+
const sortFunc = table._getSortFuncFromHeaderOption(undefined, field, fieldKey);
|
|
50625
|
+
let hd;
|
|
50626
|
+
if (fieldKey) {
|
|
50627
|
+
hd = table.internalProps.layoutMap.headerObjects.find((col) => col && col.fieldKey === fieldKey);
|
|
50628
|
+
}
|
|
50629
|
+
else {
|
|
50630
|
+
hd = table.internalProps.layoutMap.headerObjects.find((col) => col && col.field === field);
|
|
50631
|
+
}
|
|
50632
|
+
table.dataSource.sort(hd.field, order, sortFunc ?? defaultOrderFn);
|
|
50633
|
+
}
|
|
50634
|
+
}
|
|
50635
|
+
}
|
|
50502
50636
|
|
|
50503
50637
|
let Icon$1 = class Icon extends Image$3 {
|
|
50504
50638
|
role;
|
|
@@ -52543,7 +52677,7 @@
|
|
|
52543
52677
|
else {
|
|
52544
52678
|
const define = table.getBodyColumnDefine(col, row);
|
|
52545
52679
|
if (define?.tree) {
|
|
52546
|
-
const indexArr = table.dataSource.getIndexKey(table.
|
|
52680
|
+
const indexArr = table.dataSource.getIndexKey(table.getRecordShowIndexByCell(col, row));
|
|
52547
52681
|
cellHierarchyIndent =
|
|
52548
52682
|
Array.isArray(indexArr) && table.getHierarchyState(col, row) !== HierarchyState.none
|
|
52549
52683
|
? (indexArr.length - 1) * (layoutMap.hierarchyIndent ?? 0)
|
|
@@ -55249,7 +55383,7 @@
|
|
|
55249
55383
|
}
|
|
55250
55384
|
else {
|
|
55251
55385
|
rowStart = row + 1;
|
|
55252
|
-
rowEnd = scene.bodyRowEnd
|
|
55386
|
+
rowEnd = scene.bodyRowEnd;
|
|
55253
55387
|
}
|
|
55254
55388
|
for (let rowIndex = rowStart; rowIndex <= rowEnd; rowIndex++) {
|
|
55255
55389
|
for (let colIndex = 0; colIndex < scene.table.colCount; colIndex++) {
|
|
@@ -57654,7 +57788,7 @@
|
|
|
57654
57788
|
deltaRow = prepareDeltaRow;
|
|
57655
57789
|
const define = table.getBodyColumnDefine(col, row);
|
|
57656
57790
|
if (define?.tree) {
|
|
57657
|
-
const indexArr = table.dataSource.getIndexKey(table.
|
|
57791
|
+
const indexArr = table.dataSource.getIndexKey(table.getRecordShowIndexByCell(col, row));
|
|
57658
57792
|
cellHierarchyIndent =
|
|
57659
57793
|
Array.isArray(indexArr) && table.getHierarchyState(col, row) !== HierarchyState.none
|
|
57660
57794
|
? (indexArr.length - 1) * (layoutMap.hierarchyIndent ?? 0)
|
|
@@ -58193,6 +58327,10 @@
|
|
|
58193
58327
|
colHeaderColGroup && updateColGroupContent(colHeaderColGroup, proxy);
|
|
58194
58328
|
const bottomColGroup = proxy.table.scenegraph.getColGroupInBottom(col);
|
|
58195
58329
|
bottomColGroup && updateColGroupContent(bottomColGroup, proxy);
|
|
58330
|
+
const rightTopColGroup = proxy.table.scenegraph.getColGroupInRightTopCorner(col);
|
|
58331
|
+
rightTopColGroup && updateColGroupContent(rightTopColGroup, proxy);
|
|
58332
|
+
const rightBottomColGroup = proxy.table.scenegraph.getColGroupInRightBottomCorner(col);
|
|
58333
|
+
rightBottomColGroup && updateColGroupContent(rightBottomColGroup, proxy);
|
|
58196
58334
|
}
|
|
58197
58335
|
}
|
|
58198
58336
|
function updateAllColPosition(distStartColY, count, direction, proxy) {
|
|
@@ -58628,7 +58766,7 @@
|
|
|
58628
58766
|
this.xLimitRight = totalWidth - totalBodyWidth / 2;
|
|
58629
58767
|
const widthLimit = this.table.tableNoFrameWidth * 5;
|
|
58630
58768
|
this.screenColCount = Math.ceil(this.table.tableNoFrameWidth / defaultColWidth);
|
|
58631
|
-
this.firstScreenColLimit = this.bodyLeftCol + Math.min(this.colLimit, Math.ceil(widthLimit / defaultColWidth));
|
|
58769
|
+
this.firstScreenColLimit = Math.max(15, this.bodyLeftCol + Math.min(this.colLimit, Math.ceil(widthLimit / defaultColWidth)));
|
|
58632
58770
|
this.colUpdatePos = this.bodyRightCol;
|
|
58633
58771
|
}
|
|
58634
58772
|
setParamsForRow() {
|
|
@@ -58646,7 +58784,7 @@
|
|
|
58646
58784
|
this.yLimitBottom = totalHeight - totalBodyHeight / 2;
|
|
58647
58785
|
const heightLimit = this.table.tableNoFrameHeight * 5;
|
|
58648
58786
|
this.screenRowCount = Math.ceil(this.table.tableNoFrameHeight / defaultRowHeight);
|
|
58649
|
-
this.firstScreenRowLimit = this.bodyTopRow + Math.min(this.rowLimit, Math.ceil(heightLimit / defaultRowHeight));
|
|
58787
|
+
this.firstScreenRowLimit = Math.max(30, this.bodyTopRow + Math.min(this.rowLimit, Math.ceil(heightLimit / defaultRowHeight)));
|
|
58650
58788
|
this.rowUpdatePos = this.bodyBottomRow;
|
|
58651
58789
|
}
|
|
58652
58790
|
resize() {
|
|
@@ -58845,6 +58983,30 @@
|
|
|
58845
58983
|
}
|
|
58846
58984
|
this.rowUpdatePos = distRow + 1;
|
|
58847
58985
|
}
|
|
58986
|
+
updateBottomFrozenCellGroups() {
|
|
58987
|
+
const startRow = this.table.rowCount - this.table.bottomFrozenRowCount;
|
|
58988
|
+
const endRow = this.table.rowCount - 1;
|
|
58989
|
+
if (this.table.heightMode === 'autoHeight') {
|
|
58990
|
+
computeRowsHeight(this.table, startRow, endRow, false);
|
|
58991
|
+
}
|
|
58992
|
+
updateRowContent(startRow, endRow, this);
|
|
58993
|
+
if (this.table.heightMode === 'autoHeight') {
|
|
58994
|
+
updateAutoRow(this.bodyLeftCol, this.bodyRightCol, startRow, endRow, this.table, this.rowUpdateDirection);
|
|
58995
|
+
updateAutoRow(0, this.table.frozenColCount - 1, startRow, endRow, this.table, this.rowUpdateDirection);
|
|
58996
|
+
updateAutoRow(this.table.colCount - this.table.rightFrozenColCount, this.table.colCount - 1, startRow, endRow, this.table, this.rowUpdateDirection);
|
|
58997
|
+
}
|
|
58998
|
+
}
|
|
58999
|
+
updateRightFrozenCellGroups() {
|
|
59000
|
+
const startCol = this.table.colCount - this.table.rightFrozenColCount;
|
|
59001
|
+
const endCol = this.table.colCount - 1;
|
|
59002
|
+
if (this.table.widthMode === 'autoWidth') {
|
|
59003
|
+
computeColsWidth(this.table, startCol, endCol, false);
|
|
59004
|
+
}
|
|
59005
|
+
updateColContent(startCol, endCol, this);
|
|
59006
|
+
if (this.table.heightMode === 'autoHeight') {
|
|
59007
|
+
updateAutoColumn(startCol, endCol, this.table, this.colUpdateDirection);
|
|
59008
|
+
}
|
|
59009
|
+
}
|
|
58848
59010
|
async updateColCellGroupsAsync() {
|
|
58849
59011
|
this.updateColGroups(this.taskRowCount);
|
|
58850
59012
|
}
|
|
@@ -59446,8 +59608,9 @@
|
|
|
59446
59608
|
|
|
59447
59609
|
function updateRow(removeCells, addCells, updateCells, table) {
|
|
59448
59610
|
const scene = table.scenegraph;
|
|
59449
|
-
const removeRows = deduplication(removeCells.map(cell => cell.row)).sort((a, b) => b - a);
|
|
59450
|
-
const addRows = deduplication(addCells.map(cell => cell.row)).sort((a, b) => a - b);
|
|
59611
|
+
const removeRows = deduplication$1(removeCells.map(cell => cell.row)).sort((a, b) => b - a);
|
|
59612
|
+
const addRows = deduplication$1(addCells.map(cell => cell.row)).sort((a, b) => a - b);
|
|
59613
|
+
const updateRows = deduplication$1(updateCells.map(cell => cell.row)).sort((a, b) => a - b);
|
|
59451
59614
|
removeRows.forEach(row => {
|
|
59452
59615
|
removeRow(row, scene);
|
|
59453
59616
|
});
|
|
@@ -59462,31 +59625,30 @@
|
|
|
59462
59625
|
let updateAfter;
|
|
59463
59626
|
addRows.forEach(row => {
|
|
59464
59627
|
const needUpdateAfter = addRow(row, scene);
|
|
59465
|
-
updateAfter = updateAfter
|
|
59628
|
+
updateAfter = updateAfter ?? needUpdateAfter;
|
|
59466
59629
|
scene.table.rowHeightsMap.adjustOrder(row, row + 1, scene.table.rowHeightsMap.count() - row);
|
|
59467
59630
|
});
|
|
59468
59631
|
resetRowNumberAndY(scene);
|
|
59469
|
-
|
|
59470
|
-
|
|
59471
|
-
|
|
59472
|
-
|
|
59473
|
-
|
|
59474
|
-
|
|
59475
|
-
|
|
59476
|
-
|
|
59477
|
-
updateCell$1(col, row, scene.table, false);
|
|
59632
|
+
for (let col = 0; col < table.colCount; col++) {
|
|
59633
|
+
updateRows.forEach(r => {
|
|
59634
|
+
const mergeInfo = getCellMergeInfo(scene.table, col, r);
|
|
59635
|
+
if (mergeInfo) {
|
|
59636
|
+
for (let col = mergeInfo.start.col; col <= mergeInfo.end.col; col++) {
|
|
59637
|
+
for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) {
|
|
59638
|
+
updateCell$1(col, row, scene.table, false);
|
|
59639
|
+
}
|
|
59478
59640
|
}
|
|
59479
59641
|
}
|
|
59480
|
-
|
|
59481
|
-
|
|
59482
|
-
|
|
59483
|
-
}
|
|
59484
|
-
}
|
|
59642
|
+
else {
|
|
59643
|
+
updateCell$1(col, r, scene.table, false);
|
|
59644
|
+
}
|
|
59645
|
+
});
|
|
59646
|
+
}
|
|
59485
59647
|
if (isNumber$7(updateAfter)) {
|
|
59486
59648
|
for (let col = 0; col < table.colCount; col++) {
|
|
59487
59649
|
for (let row = updateAfter; row < table.rowCount; row++) {
|
|
59488
59650
|
const cellGroup = scene.highPerformanceGetCell(col, row, true);
|
|
59489
|
-
cellGroup.needUpdate = true;
|
|
59651
|
+
cellGroup && (cellGroup.needUpdate = true);
|
|
59490
59652
|
}
|
|
59491
59653
|
}
|
|
59492
59654
|
scene.proxy.rowUpdatePos = updateAfter;
|
|
@@ -59498,14 +59660,29 @@
|
|
|
59498
59660
|
}
|
|
59499
59661
|
scene.proxy.rowUpdateDirection = 'up';
|
|
59500
59662
|
scene.proxy.updateCellGroups(scene.proxy.screenRowCount * 2);
|
|
59663
|
+
updateBottomFrozeCellGroups();
|
|
59501
59664
|
scene.proxy.progress();
|
|
59502
59665
|
}
|
|
59503
59666
|
else if (removeRows.length) {
|
|
59504
59667
|
scene.proxy.updateCellGroups(scene.proxy.screenRowCount * 2);
|
|
59668
|
+
updateBottomFrozeCellGroups();
|
|
59505
59669
|
scene.proxy.progress();
|
|
59506
59670
|
}
|
|
59507
59671
|
const newTotalHeight = table.getRowsHeight(table.frozenRowCount, table.rowCount - 1 - table.bottomFrozenRowCount);
|
|
59508
59672
|
scene.updateContainerHeight(scene.table.frozenRowCount, newTotalHeight - scene.bodyGroup.attribute.height);
|
|
59673
|
+
function updateBottomFrozeCellGroups() {
|
|
59674
|
+
if (addRows?.[addRows?.length - 1] >= table.rowCount - table.bottomFrozenRowCount ||
|
|
59675
|
+
updateRows?.[updateRows?.length - 1] >= table.rowCount - table.bottomFrozenRowCount ||
|
|
59676
|
+
removeRows?.[0] >= table.rowCount - table.bottomFrozenRowCount) {
|
|
59677
|
+
for (let col = 0; col < table.colCount; col++) {
|
|
59678
|
+
for (let row = table.rowCount - table.bottomFrozenRowCount; row < table.rowCount; row++) {
|
|
59679
|
+
const cellGroup = scene.highPerformanceGetCell(col, row, true);
|
|
59680
|
+
cellGroup && (cellGroup.needUpdate = true);
|
|
59681
|
+
}
|
|
59682
|
+
}
|
|
59683
|
+
scene.proxy.updateBottomFrozenCellGroups();
|
|
59684
|
+
}
|
|
59685
|
+
}
|
|
59509
59686
|
}
|
|
59510
59687
|
function removeRow(row, scene) {
|
|
59511
59688
|
removeCellGroup(row, scene);
|
|
@@ -59545,7 +59722,7 @@
|
|
|
59545
59722
|
}
|
|
59546
59723
|
return row;
|
|
59547
59724
|
}
|
|
59548
|
-
function deduplication(array) {
|
|
59725
|
+
function deduplication$1(array) {
|
|
59549
59726
|
const result = [];
|
|
59550
59727
|
for (let i = 0; i < array.length; i++) {
|
|
59551
59728
|
if (result.indexOf(array[i]) === -1) {
|
|
@@ -59555,84 +59732,125 @@
|
|
|
59555
59732
|
return result;
|
|
59556
59733
|
}
|
|
59557
59734
|
function resetRowNumber(scene) {
|
|
59558
|
-
|
|
59559
|
-
|
|
59560
|
-
|
|
59561
|
-
|
|
59562
|
-
continue;
|
|
59563
|
-
}
|
|
59564
|
-
let rowIndex = headerColGroup.firstChild?.row;
|
|
59565
|
-
headerColGroup.forEachChildren((cellGroup) => {
|
|
59566
|
-
cellGroup.row = rowIndex;
|
|
59567
|
-
const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);
|
|
59568
|
-
if (merge) {
|
|
59569
|
-
cellGroup.mergeStartCol = merge.start.col;
|
|
59570
|
-
cellGroup.mergeStartRow = merge.start.row;
|
|
59571
|
-
cellGroup.mergeEndCol = merge.end.col;
|
|
59572
|
-
cellGroup.mergeEndRow = merge.end.row;
|
|
59573
|
-
}
|
|
59735
|
+
scene.bodyGroup.forEachChildren((colGroup) => {
|
|
59736
|
+
let rowIndex = scene.bodyRowStart;
|
|
59737
|
+
colGroup?.forEachChildren((cellGroup) => {
|
|
59738
|
+
processCell(cellGroup, rowIndex);
|
|
59574
59739
|
rowIndex++;
|
|
59575
59740
|
});
|
|
59576
|
-
|
|
59577
|
-
|
|
59578
|
-
|
|
59579
|
-
|
|
59580
|
-
|
|
59581
|
-
|
|
59582
|
-
|
|
59583
|
-
|
|
59584
|
-
|
|
59585
|
-
|
|
59741
|
+
});
|
|
59742
|
+
scene.rowHeaderGroup.forEachChildren((colGroup) => {
|
|
59743
|
+
let rowIndex = scene.bodyRowStart;
|
|
59744
|
+
colGroup?.forEachChildren((cellGroup) => {
|
|
59745
|
+
processCell(cellGroup, rowIndex);
|
|
59746
|
+
rowIndex++;
|
|
59747
|
+
});
|
|
59748
|
+
});
|
|
59749
|
+
scene.rightFrozenGroup.forEachChildren((colGroup) => {
|
|
59750
|
+
let rowIndex = scene.bodyRowStart;
|
|
59751
|
+
colGroup?.forEachChildren((cellGroup) => {
|
|
59752
|
+
processCell(cellGroup, rowIndex);
|
|
59753
|
+
rowIndex++;
|
|
59754
|
+
});
|
|
59755
|
+
});
|
|
59756
|
+
scene.bottomFrozenGroup.forEachChildren((colGroup) => {
|
|
59757
|
+
let rowIndex = scene.table.rowCount - scene.table.bottomFrozenRowCount;
|
|
59758
|
+
colGroup?.forEachChildren((cellGroup) => {
|
|
59759
|
+
processCell(cellGroup, rowIndex);
|
|
59760
|
+
rowIndex++;
|
|
59761
|
+
});
|
|
59762
|
+
});
|
|
59763
|
+
scene.leftBottomCornerGroup.forEachChildren((colGroup) => {
|
|
59764
|
+
let rowIndex = scene.table.rowCount - scene.table.bottomFrozenRowCount;
|
|
59765
|
+
colGroup?.forEachChildren((cellGroup) => {
|
|
59766
|
+
processCell(cellGroup, rowIndex);
|
|
59767
|
+
rowIndex++;
|
|
59768
|
+
});
|
|
59769
|
+
});
|
|
59770
|
+
scene.rightBottomCornerGroup.forEachChildren((colGroup) => {
|
|
59771
|
+
let rowIndex = scene.table.rowCount - scene.table.bottomFrozenRowCount;
|
|
59772
|
+
colGroup?.forEachChildren((cellGroup) => {
|
|
59773
|
+
processCell(cellGroup, rowIndex);
|
|
59586
59774
|
rowIndex++;
|
|
59587
59775
|
});
|
|
59776
|
+
});
|
|
59777
|
+
function processCell(cellGroup, rowIndex) {
|
|
59778
|
+
cellGroup.row = rowIndex;
|
|
59779
|
+
const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);
|
|
59780
|
+
if (merge) {
|
|
59781
|
+
cellGroup.mergeStartCol = merge.start.col;
|
|
59782
|
+
cellGroup.mergeStartCol = merge.start.col;
|
|
59783
|
+
cellGroup.mergeEndCol = merge.end.col;
|
|
59784
|
+
cellGroup.mergeEndCol = merge.end.col;
|
|
59785
|
+
}
|
|
59588
59786
|
}
|
|
59589
59787
|
}
|
|
59590
59788
|
function resetRowNumberAndY(scene) {
|
|
59591
|
-
scene.
|
|
59592
|
-
|
|
59593
|
-
|
|
59594
|
-
|
|
59595
|
-
|
|
59596
|
-
|
|
59597
|
-
|
|
59598
|
-
|
|
59599
|
-
|
|
59600
|
-
|
|
59601
|
-
|
|
59602
|
-
let
|
|
59789
|
+
scene.bodyGroup.forEachChildren((colGroup) => {
|
|
59790
|
+
let rowIndex = scene.bodyRowStart;
|
|
59791
|
+
let y = scene.getCellGroupY(rowIndex);
|
|
59792
|
+
colGroup?.forEachChildren((cellGroup) => {
|
|
59793
|
+
processCell(cellGroup, rowIndex, y);
|
|
59794
|
+
rowIndex++;
|
|
59795
|
+
y += cellGroup.attribute.height;
|
|
59796
|
+
});
|
|
59797
|
+
});
|
|
59798
|
+
scene.rowHeaderGroup.forEachChildren((colGroup) => {
|
|
59799
|
+
let rowIndex = scene.bodyRowStart;
|
|
59800
|
+
let y = scene.getCellGroupY(rowIndex);
|
|
59801
|
+
colGroup?.forEachChildren((cellGroup) => {
|
|
59802
|
+
processCell(cellGroup, rowIndex, y);
|
|
59803
|
+
rowIndex++;
|
|
59804
|
+
y += cellGroup.attribute.height;
|
|
59805
|
+
});
|
|
59806
|
+
});
|
|
59807
|
+
scene.rightFrozenGroup.forEachChildren((colGroup) => {
|
|
59808
|
+
let rowIndex = scene.bodyRowStart;
|
|
59809
|
+
let y = scene.getCellGroupY(rowIndex);
|
|
59810
|
+
colGroup?.forEachChildren((cellGroup) => {
|
|
59811
|
+
processCell(cellGroup, rowIndex, y);
|
|
59812
|
+
rowIndex++;
|
|
59813
|
+
y += cellGroup.attribute.height;
|
|
59814
|
+
});
|
|
59815
|
+
});
|
|
59816
|
+
scene.bottomFrozenGroup.forEachChildren((colGroup) => {
|
|
59817
|
+
let rowIndex = scene.table.rowCount - scene.table.bottomFrozenRowCount;
|
|
59603
59818
|
let y = 0;
|
|
59604
|
-
|
|
59605
|
-
|
|
59606
|
-
colGroup.forEachChildren((cellGroup) => {
|
|
59607
|
-
cellGroup.row = rowIndex;
|
|
59608
|
-
const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);
|
|
59609
|
-
if (merge) {
|
|
59610
|
-
cellGroup.mergeStartCol = merge.start.col;
|
|
59611
|
-
cellGroup.mergeStartRow = merge.start.row;
|
|
59612
|
-
cellGroup.mergeEndCol = merge.end.col;
|
|
59613
|
-
cellGroup.mergeEndRow = merge.end.row;
|
|
59614
|
-
}
|
|
59819
|
+
colGroup?.forEachChildren((cellGroup) => {
|
|
59820
|
+
processCell(cellGroup, rowIndex, y);
|
|
59615
59821
|
rowIndex++;
|
|
59616
|
-
if (cellGroup.role !== 'cell') {
|
|
59617
|
-
return;
|
|
59618
|
-
}
|
|
59619
|
-
cellGroup.setAttribute('y', y);
|
|
59620
59822
|
y += cellGroup.attribute.height;
|
|
59621
59823
|
});
|
|
59622
|
-
|
|
59623
|
-
|
|
59624
|
-
|
|
59625
|
-
|
|
59626
|
-
|
|
59627
|
-
|
|
59628
|
-
cellGroup.mergeStartRow = merge.start.row;
|
|
59629
|
-
cellGroup.mergeEndCol = merge.end.col;
|
|
59630
|
-
cellGroup.mergeEndRow = merge.end.row;
|
|
59631
|
-
}
|
|
59824
|
+
});
|
|
59825
|
+
scene.leftBottomCornerGroup.forEachChildren((colGroup) => {
|
|
59826
|
+
let rowIndex = scene.table.rowCount - scene.table.bottomFrozenRowCount;
|
|
59827
|
+
let y = 0;
|
|
59828
|
+
colGroup?.forEachChildren((cellGroup) => {
|
|
59829
|
+
processCell(cellGroup, rowIndex, y);
|
|
59632
59830
|
rowIndex++;
|
|
59831
|
+
y += cellGroup.attribute.height;
|
|
59633
59832
|
});
|
|
59833
|
+
});
|
|
59834
|
+
scene.rightBottomCornerGroup.forEachChildren((colGroup) => {
|
|
59835
|
+
let rowIndex = scene.table.rowCount - scene.table.bottomFrozenRowCount;
|
|
59836
|
+
let y = 0;
|
|
59837
|
+
colGroup?.forEachChildren((cellGroup) => {
|
|
59838
|
+
processCell(cellGroup, rowIndex, y);
|
|
59839
|
+
rowIndex++;
|
|
59840
|
+
y += cellGroup.attribute.height;
|
|
59841
|
+
});
|
|
59842
|
+
});
|
|
59843
|
+
function processCell(cellGroup, rowIndex, y) {
|
|
59844
|
+
cellGroup.row = rowIndex;
|
|
59845
|
+
cellGroup.setAttribute('y', y);
|
|
59846
|
+
const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);
|
|
59847
|
+
if (merge) {
|
|
59848
|
+
cellGroup.mergeStartCol = merge.start.col;
|
|
59849
|
+
cellGroup.mergeStartCol = merge.start.col;
|
|
59850
|
+
cellGroup.mergeEndCol = merge.end.col;
|
|
59851
|
+
cellGroup.mergeEndCol = merge.end.col;
|
|
59852
|
+
}
|
|
59634
59853
|
}
|
|
59635
|
-
return newTotalHeight;
|
|
59636
59854
|
}
|
|
59637
59855
|
function addRowCellGroup(row, scene) {
|
|
59638
59856
|
for (let col = 0; col < scene.table.colCount; col++) {
|
|
@@ -60780,6 +60998,342 @@
|
|
|
60780
60998
|
return cellGroup;
|
|
60781
60999
|
}
|
|
60782
61000
|
|
|
61001
|
+
function updateCol(removeCells, addCells, updateCells, table) {
|
|
61002
|
+
const scene = table.scenegraph;
|
|
61003
|
+
const removeCols = deduplication(removeCells.map(cell => cell.col)).sort((a, b) => b - a);
|
|
61004
|
+
const addCols = deduplication(addCells.map(cell => cell.col)).sort((a, b) => a - b);
|
|
61005
|
+
const updateCols = deduplication(updateCells.map(cell => cell.col)).sort((a, b) => a - b);
|
|
61006
|
+
removeCols.forEach(col => {
|
|
61007
|
+
removeCol(col, scene);
|
|
61008
|
+
});
|
|
61009
|
+
removeCols.forEach(col => {
|
|
61010
|
+
scene.table.colWidthsMap.adjustOrder(col + 1, col, scene.table.colWidthsMap.count() - col - 1);
|
|
61011
|
+
scene.table.colWidthsMap.del(scene.table.colWidthsMap.count() - 1);
|
|
61012
|
+
});
|
|
61013
|
+
if (removeCols.length) {
|
|
61014
|
+
resetColNumber(scene);
|
|
61015
|
+
}
|
|
61016
|
+
scene.table._clearColRangeWidthsMap();
|
|
61017
|
+
let updateAfter;
|
|
61018
|
+
addCols.forEach(col => {
|
|
61019
|
+
const needUpdateAfter = addCol(col, scene);
|
|
61020
|
+
resetColNumber(scene);
|
|
61021
|
+
updateAfter = updateAfter ?? needUpdateAfter;
|
|
61022
|
+
scene.table.colWidthsMap.adjustOrder(col, col + 1, scene.table.colWidthsMap.count() - col);
|
|
61023
|
+
});
|
|
61024
|
+
resetColNumberAndX(scene);
|
|
61025
|
+
updateCols.forEach(col => {
|
|
61026
|
+
for (let row = 0; row < table.rowCount; row++) {
|
|
61027
|
+
const mergeInfo = getCellMergeInfo(scene.table, col, row);
|
|
61028
|
+
if (mergeInfo) {
|
|
61029
|
+
for (let col = mergeInfo.start.col; col <= mergeInfo.end.col; col++) {
|
|
61030
|
+
for (let col = mergeInfo.start.col; col <= mergeInfo.end.col; col++) {
|
|
61031
|
+
updateCell$1(col, row, scene.table, false);
|
|
61032
|
+
}
|
|
61033
|
+
}
|
|
61034
|
+
}
|
|
61035
|
+
else {
|
|
61036
|
+
updateCell$1(col, row, scene.table, false);
|
|
61037
|
+
}
|
|
61038
|
+
}
|
|
61039
|
+
});
|
|
61040
|
+
if (isNumber$7(updateAfter)) {
|
|
61041
|
+
for (let col = updateAfter; col < table.colCount; col++) {
|
|
61042
|
+
for (let row = 0; row < table.rowCount; row++) {
|
|
61043
|
+
const cellGroup = scene.highPerformanceGetCell(col, row, true);
|
|
61044
|
+
cellGroup && (cellGroup.needUpdate = true);
|
|
61045
|
+
}
|
|
61046
|
+
}
|
|
61047
|
+
scene.proxy.colUpdatePos = updateAfter;
|
|
61048
|
+
}
|
|
61049
|
+
if (addCols.length) {
|
|
61050
|
+
if (!isNumber$7(updateAfter)) {
|
|
61051
|
+
const minCol = Math.min(...addCols);
|
|
61052
|
+
scene.proxy.colUpdatePos = minCol;
|
|
61053
|
+
}
|
|
61054
|
+
scene.proxy.colUpdateDirection = 'left';
|
|
61055
|
+
scene.proxy.updateColGroups(scene.proxy.screenColCount * 2);
|
|
61056
|
+
updateRightFrozeCellGroups();
|
|
61057
|
+
scene.proxy.progress();
|
|
61058
|
+
}
|
|
61059
|
+
else if (removeCols.length) {
|
|
61060
|
+
scene.proxy.updateColGroups(scene.proxy.screenColCount * 2);
|
|
61061
|
+
updateRightFrozeCellGroups();
|
|
61062
|
+
scene.proxy.progress();
|
|
61063
|
+
}
|
|
61064
|
+
const newTotalWidth = table.getColsWidth(table.frozenColCount, table.colCount - 1);
|
|
61065
|
+
scene.updateContainerWidth(scene.table.frozenColCount, newTotalWidth - scene.bodyGroup.attribute.width);
|
|
61066
|
+
function updateRightFrozeCellGroups() {
|
|
61067
|
+
if (addCols?.[addCols?.length - 1] >= table.colCount - table.rightFrozenColCount ||
|
|
61068
|
+
updateCols?.[updateCols?.length - 1] >= table.colCount - table.rightFrozenColCount ||
|
|
61069
|
+
removeCols?.[0] >= table.colCount - table.rightFrozenColCount) {
|
|
61070
|
+
for (let col = table.colCount - table.rightFrozenColCount; col < table.colCount; col++) {
|
|
61071
|
+
for (let row = 0; row < table.rowCount; row++) {
|
|
61072
|
+
const cellGroup = scene.highPerformanceGetCell(col, row, true);
|
|
61073
|
+
cellGroup && (cellGroup.needUpdate = true);
|
|
61074
|
+
}
|
|
61075
|
+
}
|
|
61076
|
+
scene.proxy.updateRightFrozenCellGroups();
|
|
61077
|
+
}
|
|
61078
|
+
}
|
|
61079
|
+
}
|
|
61080
|
+
function removeCol(col, scene) {
|
|
61081
|
+
const proxy = scene.proxy;
|
|
61082
|
+
if (col >= scene.table.rowHeaderLevelCount) {
|
|
61083
|
+
if (col >= scene.table.colCount - scene.table.rightFrozenColCount) ;
|
|
61084
|
+
else {
|
|
61085
|
+
const colGroup = scene.getColGroup(col, false);
|
|
61086
|
+
if (colGroup && colGroup.parent === scene.bodyGroup) {
|
|
61087
|
+
scene.bodyGroup.removeChild(colGroup);
|
|
61088
|
+
}
|
|
61089
|
+
const bottomColGroup = scene.getColGroupInBottom(col);
|
|
61090
|
+
if (bottomColGroup && bottomColGroup.parent === scene.bottomFrozenGroup) {
|
|
61091
|
+
scene.bottomFrozenGroup.removeChild(bottomColGroup);
|
|
61092
|
+
}
|
|
61093
|
+
}
|
|
61094
|
+
}
|
|
61095
|
+
if (col >= proxy.colStart && col <= proxy.colEnd) {
|
|
61096
|
+
proxy.colEnd--;
|
|
61097
|
+
proxy.currentCol--;
|
|
61098
|
+
}
|
|
61099
|
+
proxy.bodyRightCol--;
|
|
61100
|
+
const totalActualBodyColCount = Math.min(proxy.colLimit, proxy.bodyRightCol - proxy.bodyLeftCol + 1);
|
|
61101
|
+
proxy.totalActualBodyColCount = totalActualBodyColCount;
|
|
61102
|
+
proxy.totalCol = proxy.colStart + totalActualBodyColCount - 1;
|
|
61103
|
+
}
|
|
61104
|
+
function addCol(col, scene) {
|
|
61105
|
+
const proxy = scene.proxy;
|
|
61106
|
+
proxy.bodyRightCol++;
|
|
61107
|
+
const totalActualBodyColCount = Math.min(proxy.colLimit, proxy.bodyRightCol - proxy.bodyLeftCol + 1);
|
|
61108
|
+
proxy.totalActualBodyColCount = totalActualBodyColCount;
|
|
61109
|
+
proxy.totalCol = proxy.colStart + totalActualBodyColCount - 1;
|
|
61110
|
+
if (col < proxy.colStart) {
|
|
61111
|
+
return undefined;
|
|
61112
|
+
}
|
|
61113
|
+
else if (col > proxy.colEnd) {
|
|
61114
|
+
if (proxy.colEnd - proxy.colStart + 1 < proxy.colLimit) {
|
|
61115
|
+
proxy.colEnd++;
|
|
61116
|
+
proxy.currentCol++;
|
|
61117
|
+
addColGroup(col, scene);
|
|
61118
|
+
return col;
|
|
61119
|
+
}
|
|
61120
|
+
return undefined;
|
|
61121
|
+
}
|
|
61122
|
+
if (proxy.colEnd - proxy.colStart + 1 < proxy.colLimit) {
|
|
61123
|
+
proxy.colEnd++;
|
|
61124
|
+
proxy.currentCol++;
|
|
61125
|
+
addColGroup(col, scene);
|
|
61126
|
+
return col;
|
|
61127
|
+
}
|
|
61128
|
+
return col;
|
|
61129
|
+
}
|
|
61130
|
+
function deduplication(array) {
|
|
61131
|
+
const result = [];
|
|
61132
|
+
for (let i = 0; i < array.length; i++) {
|
|
61133
|
+
if (result.indexOf(array[i]) === -1) {
|
|
61134
|
+
result.push(array[i]);
|
|
61135
|
+
}
|
|
61136
|
+
}
|
|
61137
|
+
return result;
|
|
61138
|
+
}
|
|
61139
|
+
function resetColNumber(scene) {
|
|
61140
|
+
let colIndex = scene.bodyColStart;
|
|
61141
|
+
scene.bodyGroup.forEachChildren((colGroup) => {
|
|
61142
|
+
colGroup.col = colIndex;
|
|
61143
|
+
colGroup?.forEachChildren((cellGroup) => {
|
|
61144
|
+
processCell(cellGroup);
|
|
61145
|
+
});
|
|
61146
|
+
colIndex++;
|
|
61147
|
+
});
|
|
61148
|
+
colIndex = scene.bodyColStart;
|
|
61149
|
+
scene.colHeaderGroup.forEachChildren((colGroup) => {
|
|
61150
|
+
colGroup.col = colIndex;
|
|
61151
|
+
colGroup?.forEachChildren((cellGroup) => {
|
|
61152
|
+
processCell(cellGroup);
|
|
61153
|
+
});
|
|
61154
|
+
colIndex++;
|
|
61155
|
+
});
|
|
61156
|
+
colIndex = scene.bodyColStart;
|
|
61157
|
+
scene.bottomFrozenGroup.forEachChildren((colGroup) => {
|
|
61158
|
+
colGroup.col = colIndex;
|
|
61159
|
+
colGroup?.forEachChildren((cellGroup) => {
|
|
61160
|
+
processCell(cellGroup);
|
|
61161
|
+
});
|
|
61162
|
+
colIndex++;
|
|
61163
|
+
});
|
|
61164
|
+
function processCell(cellGroup) {
|
|
61165
|
+
cellGroup.col = colIndex;
|
|
61166
|
+
const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);
|
|
61167
|
+
if (merge) {
|
|
61168
|
+
cellGroup.mergeStartCol = merge.start.col;
|
|
61169
|
+
cellGroup.mergeStartCol = merge.start.col;
|
|
61170
|
+
cellGroup.mergeEndCol = merge.end.col;
|
|
61171
|
+
cellGroup.mergeEndCol = merge.end.col;
|
|
61172
|
+
}
|
|
61173
|
+
if (cellGroup.role !== 'cell') {
|
|
61174
|
+
return;
|
|
61175
|
+
}
|
|
61176
|
+
}
|
|
61177
|
+
}
|
|
61178
|
+
function resetColNumberAndX(scene) {
|
|
61179
|
+
let colIndex = scene.bodyColStart;
|
|
61180
|
+
let x = scene.getCellGroupX(colIndex);
|
|
61181
|
+
scene.bodyGroup.forEachChildren((colGroup) => {
|
|
61182
|
+
colGroup.col = colIndex;
|
|
61183
|
+
colGroup?.forEachChildren((cellGroup) => {
|
|
61184
|
+
processCell(cellGroup);
|
|
61185
|
+
});
|
|
61186
|
+
colGroup.setAttribute('x', x);
|
|
61187
|
+
x += colGroup.attribute.width;
|
|
61188
|
+
colIndex++;
|
|
61189
|
+
});
|
|
61190
|
+
colIndex = scene.bodyColStart;
|
|
61191
|
+
x = scene.getCellGroupX(colIndex);
|
|
61192
|
+
scene.colHeaderGroup.forEachChildren((colGroup) => {
|
|
61193
|
+
colGroup.col = colIndex;
|
|
61194
|
+
colGroup?.forEachChildren((cellGroup) => {
|
|
61195
|
+
processCell(cellGroup);
|
|
61196
|
+
});
|
|
61197
|
+
colGroup.setAttribute('x', x);
|
|
61198
|
+
x += colGroup.attribute.width;
|
|
61199
|
+
colIndex++;
|
|
61200
|
+
});
|
|
61201
|
+
colIndex = scene.bodyColStart;
|
|
61202
|
+
x = scene.getCellGroupX(colIndex);
|
|
61203
|
+
scene.bottomFrozenGroup.forEachChildren((colGroup) => {
|
|
61204
|
+
colGroup.col = colIndex;
|
|
61205
|
+
colGroup?.forEachChildren((cellGroup) => {
|
|
61206
|
+
processCell(cellGroup);
|
|
61207
|
+
});
|
|
61208
|
+
colGroup.setAttribute('x', x);
|
|
61209
|
+
x += colGroup.attribute.width;
|
|
61210
|
+
colIndex++;
|
|
61211
|
+
});
|
|
61212
|
+
colIndex = scene.table.colCount - scene.table.rightFrozenColCount;
|
|
61213
|
+
x = 0;
|
|
61214
|
+
scene.rightFrozenGroup.forEachChildren((colGroup) => {
|
|
61215
|
+
colGroup.col = colIndex;
|
|
61216
|
+
colGroup?.forEachChildren((cellGroup) => {
|
|
61217
|
+
processCell(cellGroup);
|
|
61218
|
+
});
|
|
61219
|
+
colGroup.setAttribute('x', x);
|
|
61220
|
+
x += colGroup.attribute.width;
|
|
61221
|
+
colIndex++;
|
|
61222
|
+
});
|
|
61223
|
+
colIndex = scene.table.colCount - scene.table.rightFrozenColCount;
|
|
61224
|
+
x = 0;
|
|
61225
|
+
scene.rightTopCornerGroup.forEachChildren((colGroup) => {
|
|
61226
|
+
colGroup.col = colIndex;
|
|
61227
|
+
colGroup?.forEachChildren((cellGroup) => {
|
|
61228
|
+
processCell(cellGroup);
|
|
61229
|
+
});
|
|
61230
|
+
colGroup.setAttribute('x', x);
|
|
61231
|
+
x += colGroup.attribute.width;
|
|
61232
|
+
colIndex++;
|
|
61233
|
+
});
|
|
61234
|
+
colIndex = scene.table.colCount - scene.table.rightFrozenColCount;
|
|
61235
|
+
x = 0;
|
|
61236
|
+
scene.rightBottomCornerGroup.forEachChildren((colGroup) => {
|
|
61237
|
+
colGroup.col = colIndex;
|
|
61238
|
+
colGroup?.forEachChildren((cellGroup) => {
|
|
61239
|
+
processCell(cellGroup);
|
|
61240
|
+
});
|
|
61241
|
+
colGroup.setAttribute('x', x);
|
|
61242
|
+
x += colGroup.attribute.width;
|
|
61243
|
+
colIndex++;
|
|
61244
|
+
});
|
|
61245
|
+
function processCell(cellGroup) {
|
|
61246
|
+
cellGroup.col = colIndex;
|
|
61247
|
+
const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);
|
|
61248
|
+
if (merge) {
|
|
61249
|
+
cellGroup.mergeStartCol = merge.start.col;
|
|
61250
|
+
cellGroup.mergeStartCol = merge.start.col;
|
|
61251
|
+
cellGroup.mergeEndCol = merge.end.col;
|
|
61252
|
+
cellGroup.mergeEndCol = merge.end.col;
|
|
61253
|
+
}
|
|
61254
|
+
if (cellGroup.role !== 'cell') {
|
|
61255
|
+
return;
|
|
61256
|
+
}
|
|
61257
|
+
}
|
|
61258
|
+
}
|
|
61259
|
+
function addColGroup(col, scene) {
|
|
61260
|
+
if (scene.colHeaderGroup && scene.table.columnHeaderLevelCount > 0) {
|
|
61261
|
+
const columnGroup = new Group$1({
|
|
61262
|
+
x: 0,
|
|
61263
|
+
y: 0,
|
|
61264
|
+
width: scene.table.getColWidth(col),
|
|
61265
|
+
height: 0,
|
|
61266
|
+
clip: false,
|
|
61267
|
+
pickable: false
|
|
61268
|
+
});
|
|
61269
|
+
columnGroup.role = 'column';
|
|
61270
|
+
columnGroup.col = col;
|
|
61271
|
+
const colAfter = scene.getColGroup(col, true);
|
|
61272
|
+
if (colAfter) {
|
|
61273
|
+
scene.colHeaderGroup.insertBefore(columnGroup, colAfter);
|
|
61274
|
+
}
|
|
61275
|
+
else {
|
|
61276
|
+
scene.colHeaderGroup.appendChild(columnGroup);
|
|
61277
|
+
}
|
|
61278
|
+
generateCellGroup(columnGroup, col, 0, scene.table.columnHeaderLevelCount - 1);
|
|
61279
|
+
}
|
|
61280
|
+
if (scene.bodyGroup) {
|
|
61281
|
+
const columnGroup = new Group$1({
|
|
61282
|
+
x: 0,
|
|
61283
|
+
y: 0,
|
|
61284
|
+
width: scene.table.getColWidth(col),
|
|
61285
|
+
height: 0,
|
|
61286
|
+
clip: false,
|
|
61287
|
+
pickable: false
|
|
61288
|
+
});
|
|
61289
|
+
columnGroup.role = 'column';
|
|
61290
|
+
columnGroup.col = col;
|
|
61291
|
+
const colAfter = scene.getColGroup(col, false);
|
|
61292
|
+
if (colAfter) {
|
|
61293
|
+
scene.bodyGroup.insertBefore(columnGroup, colAfter);
|
|
61294
|
+
}
|
|
61295
|
+
else {
|
|
61296
|
+
scene.bodyGroup.appendChild(columnGroup);
|
|
61297
|
+
}
|
|
61298
|
+
generateCellGroup(columnGroup, col, scene.bodyRowStart, scene.bodyRowEnd);
|
|
61299
|
+
}
|
|
61300
|
+
if (scene.bottomFrozenGroup && scene.table.bottomFrozenRowCount > 0) {
|
|
61301
|
+
const columnGroup = new Group$1({
|
|
61302
|
+
x: 0,
|
|
61303
|
+
y: 0,
|
|
61304
|
+
width: scene.table.getColWidth(col),
|
|
61305
|
+
height: 0,
|
|
61306
|
+
clip: false,
|
|
61307
|
+
pickable: false
|
|
61308
|
+
});
|
|
61309
|
+
columnGroup.role = 'column';
|
|
61310
|
+
columnGroup.col = col;
|
|
61311
|
+
const colAfter = scene.getColGroupInBottom(col);
|
|
61312
|
+
if (colAfter) {
|
|
61313
|
+
scene.bottomFrozenGroup.insertBefore(columnGroup, colAfter);
|
|
61314
|
+
}
|
|
61315
|
+
else {
|
|
61316
|
+
scene.bottomFrozenGroup.appendChild(columnGroup);
|
|
61317
|
+
}
|
|
61318
|
+
generateCellGroup(columnGroup, col, scene.table.rowCount - scene.table.bottomFrozenRowCount, scene.table.rowCount - 1);
|
|
61319
|
+
}
|
|
61320
|
+
function generateCellGroup(group, col, rowStart, rowEnd) {
|
|
61321
|
+
for (let row = rowStart; row <= rowEnd; row++) {
|
|
61322
|
+
const cellGroup = new Group$1({
|
|
61323
|
+
x: 0,
|
|
61324
|
+
y: 0,
|
|
61325
|
+
width: scene.table.getColWidth(col),
|
|
61326
|
+
height: scene.table.getRowHeight(row)
|
|
61327
|
+
});
|
|
61328
|
+
cellGroup.role = 'cell';
|
|
61329
|
+
cellGroup.col = col;
|
|
61330
|
+
cellGroup.row = row;
|
|
61331
|
+
cellGroup.needUpdate = true;
|
|
61332
|
+
group.appendChild(cellGroup);
|
|
61333
|
+
}
|
|
61334
|
+
}
|
|
61335
|
+
}
|
|
61336
|
+
|
|
60783
61337
|
loadPoptip();
|
|
60784
61338
|
container$1.load(splitModule);
|
|
60785
61339
|
container$1.load(textMeasureModule);
|
|
@@ -60895,16 +61449,16 @@
|
|
|
60895
61449
|
return this.tableGroup.attribute?.y ?? 0;
|
|
60896
61450
|
}
|
|
60897
61451
|
get bodyRowStart() {
|
|
60898
|
-
if (this.transpose || this.isPivot) {
|
|
60899
|
-
return this.table.columnHeaderLevelCount;
|
|
60900
|
-
}
|
|
60901
61452
|
return this.proxy.rowStart ?? 0;
|
|
60902
61453
|
}
|
|
60903
61454
|
get bodyRowEnd() {
|
|
60904
|
-
|
|
60905
|
-
|
|
60906
|
-
|
|
60907
|
-
return this.proxy.
|
|
61455
|
+
return this.proxy.rowEnd ?? this.table.rowCount - 1;
|
|
61456
|
+
}
|
|
61457
|
+
get bodyColStart() {
|
|
61458
|
+
return this.proxy.colStart ?? 0;
|
|
61459
|
+
}
|
|
61460
|
+
get bodyColEnd() {
|
|
61461
|
+
return this.proxy.colEnd ?? this.table.colCount - 1;
|
|
60908
61462
|
}
|
|
60909
61463
|
initSceneGraph() {
|
|
60910
61464
|
this.isPivot = this.table.isPivotTable();
|
|
@@ -61189,6 +61743,13 @@
|
|
|
61189
61743
|
updateCellSelectBorder(newStartCol, newStartRow, newEndCol, newEndRow) {
|
|
61190
61744
|
updateCellSelectBorder(this, newStartCol, newStartRow, newEndCol, newEndRow);
|
|
61191
61745
|
}
|
|
61746
|
+
recreateAllSelectRangeComponents() {
|
|
61747
|
+
deleteAllSelectBorder(this);
|
|
61748
|
+
this.table.stateManager.select.ranges.forEach((cellRange) => {
|
|
61749
|
+
updateCellSelectBorder(this, cellRange.start.col, cellRange.start.row, cellRange.end.col, cellRange.end.row);
|
|
61750
|
+
});
|
|
61751
|
+
moveSelectingRangeComponentsToSelectedRangeComponents(this);
|
|
61752
|
+
}
|
|
61192
61753
|
updateColWidth(col, detaX, skipUpdateContainer) {
|
|
61193
61754
|
updateColWidth(this, col, Math.round(detaX));
|
|
61194
61755
|
if (!skipUpdateContainer) {
|
|
@@ -61837,6 +62398,17 @@
|
|
|
61837
62398
|
this.component.updateScrollBar();
|
|
61838
62399
|
this.updateNextFrame();
|
|
61839
62400
|
}
|
|
62401
|
+
updateCol(removeCells, addCells, updateCells = []) {
|
|
62402
|
+
updateCol(removeCells, addCells, updateCells, this.table);
|
|
62403
|
+
this.recalculateColWidths();
|
|
62404
|
+
this.recalculateRowHeights();
|
|
62405
|
+
this.table.stateManager.checkFrozen();
|
|
62406
|
+
if (!this.isPivot && !this.transpose) {
|
|
62407
|
+
this.component.setFrozenColumnShadow(this.table.frozenColCount - 1);
|
|
62408
|
+
}
|
|
62409
|
+
this.component.updateScrollBar();
|
|
62410
|
+
this.updateNextFrame();
|
|
62411
|
+
}
|
|
61840
62412
|
getColumnGroupX(col) {
|
|
61841
62413
|
if (col < this.table.rowHeaderLevelCount) {
|
|
61842
62414
|
return this.table.getColsWidth(0, col - 1);
|
|
@@ -61861,6 +62433,18 @@
|
|
|
61861
62433
|
}
|
|
61862
62434
|
return 0;
|
|
61863
62435
|
}
|
|
62436
|
+
getCellGroupX(col) {
|
|
62437
|
+
if (col < this.table.rowHeaderLevelCount) {
|
|
62438
|
+
return this.table.getColsWidth(0, col - 1);
|
|
62439
|
+
}
|
|
62440
|
+
else if (col < this.table.colCount - this.table.rightFrozenColCount) {
|
|
62441
|
+
return this.table.getColsWidth(this.table.rowHeaderLevelCount, col - 1);
|
|
62442
|
+
}
|
|
62443
|
+
else if (col < this.table.colCount) {
|
|
62444
|
+
return this.table.getColsWidth(this.table.colCount - this.table.rightFrozenColCount, col - 1);
|
|
62445
|
+
}
|
|
62446
|
+
return 0;
|
|
62447
|
+
}
|
|
61864
62448
|
}
|
|
61865
62449
|
|
|
61866
62450
|
function checkCellInSelect(col, row, cellRanges) {
|
|
@@ -62650,7 +63234,7 @@
|
|
|
62650
63234
|
}
|
|
62651
63235
|
function updateResizeColForAll(detaX, state) {
|
|
62652
63236
|
const layout = state.table.internalProps.layoutMap;
|
|
62653
|
-
for (let col = state.table.
|
|
63237
|
+
for (let col = state.table.frozenColCount; col < state.table.colCount - state.table.rightFrozenColCount; col++) {
|
|
62654
63238
|
if (!(state.table.internalProps.transpose || (state.table.isPivotTable() && !layout.indicatorsAsCol))) {
|
|
62655
63239
|
const cellDefine = layout.getBody(col, state.table.columnHeaderLevelCount);
|
|
62656
63240
|
if (cellDefine?.disableColumnResize) {
|
|
@@ -62750,6 +63334,63 @@
|
|
|
62750
63334
|
this.setSelectState();
|
|
62751
63335
|
this.setFrozenState();
|
|
62752
63336
|
}
|
|
63337
|
+
updateOptionSetState() {
|
|
63338
|
+
this._updateOptionSetState();
|
|
63339
|
+
this.setHoverState();
|
|
63340
|
+
this.setSelectState();
|
|
63341
|
+
this.setFrozenState();
|
|
63342
|
+
}
|
|
63343
|
+
_updateOptionSetState() {
|
|
63344
|
+
this.interactionState = InteractionState.default;
|
|
63345
|
+
this.hoverIcon = {
|
|
63346
|
+
col: -1,
|
|
63347
|
+
row: -1,
|
|
63348
|
+
icon: null
|
|
63349
|
+
};
|
|
63350
|
+
this.columnResize = {
|
|
63351
|
+
col: -1,
|
|
63352
|
+
x: 0,
|
|
63353
|
+
resizing: false
|
|
63354
|
+
};
|
|
63355
|
+
this.columnMove = {
|
|
63356
|
+
colSource: -1,
|
|
63357
|
+
colTarget: -1,
|
|
63358
|
+
rowSource: -1,
|
|
63359
|
+
rowTarget: -1,
|
|
63360
|
+
x: 0,
|
|
63361
|
+
y: 0,
|
|
63362
|
+
moving: false
|
|
63363
|
+
};
|
|
63364
|
+
this.menu = {
|
|
63365
|
+
x: -1,
|
|
63366
|
+
y: -1,
|
|
63367
|
+
isShow: false,
|
|
63368
|
+
itemList: [],
|
|
63369
|
+
bounds: new Bounds(),
|
|
63370
|
+
highlightIndex: -1,
|
|
63371
|
+
dropDownMenuHighlight: []
|
|
63372
|
+
};
|
|
63373
|
+
this.sort = {
|
|
63374
|
+
col: -1,
|
|
63375
|
+
row: -1,
|
|
63376
|
+
order: 'normal'
|
|
63377
|
+
};
|
|
63378
|
+
this.frozen = {
|
|
63379
|
+
col: -1
|
|
63380
|
+
};
|
|
63381
|
+
this.tablePosition = {
|
|
63382
|
+
absoluteX: 0,
|
|
63383
|
+
absoluteY: 0
|
|
63384
|
+
};
|
|
63385
|
+
this.drill = {
|
|
63386
|
+
col: -1,
|
|
63387
|
+
row: -1
|
|
63388
|
+
};
|
|
63389
|
+
this.sparkLine = {
|
|
63390
|
+
col: -1,
|
|
63391
|
+
row: -1
|
|
63392
|
+
};
|
|
63393
|
+
}
|
|
62753
63394
|
_initState() {
|
|
62754
63395
|
this.interactionState = InteractionState.default;
|
|
62755
63396
|
this.select = {
|
|
@@ -63348,7 +63989,7 @@
|
|
|
63348
63989
|
}
|
|
63349
63990
|
}
|
|
63350
63991
|
setCheckedState(col, row, field, checked) {
|
|
63351
|
-
const recordIndex = this.table.
|
|
63992
|
+
const recordIndex = this.table.getRecordShowIndexByCell(col, row);
|
|
63352
63993
|
if (recordIndex >= 0) {
|
|
63353
63994
|
const dataIndex = this.table.dataSource.getIndexKey(recordIndex);
|
|
63354
63995
|
if (this.checkedState[dataIndex]) {
|
|
@@ -63383,7 +64024,7 @@
|
|
|
63383
64024
|
}
|
|
63384
64025
|
return this.headerCheckedState[field];
|
|
63385
64026
|
}
|
|
63386
|
-
const recordIndex = this.table.
|
|
64027
|
+
const recordIndex = this.table.getRecordShowIndexByCell(col, row);
|
|
63387
64028
|
if (recordIndex >= 0) {
|
|
63388
64029
|
const dataIndex = this.table.dataSource.getIndexKey(recordIndex);
|
|
63389
64030
|
if (isValid$5(this.checkedState[dataIndex]?.[field])) {
|
|
@@ -65710,7 +66351,6 @@
|
|
|
65710
66351
|
}
|
|
65711
66352
|
if (rootElementTop + rootElementHeight > containerHeight) {
|
|
65712
66353
|
rootElementTop = containerHeight - rootElementHeight;
|
|
65713
|
-
rootElementLeft += rootElementWidth - 2;
|
|
65714
66354
|
}
|
|
65715
66355
|
if (rootElementTop < 0) {
|
|
65716
66356
|
rootElementTop = rootElementTop / 2;
|
|
@@ -67780,7 +68420,7 @@
|
|
|
67780
68420
|
return TABLE_EVENT_TYPE;
|
|
67781
68421
|
}
|
|
67782
68422
|
options;
|
|
67783
|
-
version = "0.
|
|
68423
|
+
version = "0.16.1";
|
|
67784
68424
|
pagination;
|
|
67785
68425
|
id = `VTable${Date.now()}`;
|
|
67786
68426
|
headerStyleCache;
|
|
@@ -68895,7 +69535,7 @@
|
|
|
68895
69535
|
internalProps.title?.release();
|
|
68896
69536
|
internalProps.layoutMap.release();
|
|
68897
69537
|
this.scenegraph.clearCells();
|
|
68898
|
-
this.stateManager.
|
|
69538
|
+
this.stateManager.updateOptionSetState();
|
|
68899
69539
|
this._updateSize();
|
|
68900
69540
|
this.eventManager.updateEventBinder();
|
|
68901
69541
|
if (options.legends) {
|
|
@@ -69268,7 +69908,7 @@
|
|
|
69268
69908
|
if (this.internalProps.layoutMap.isHeader(col, row)) {
|
|
69269
69909
|
return undefined;
|
|
69270
69910
|
}
|
|
69271
|
-
return this.internalProps.dataSource?.get(this.
|
|
69911
|
+
return this.internalProps.dataSource?.get(this.getRecordShowIndexByCell(col, row));
|
|
69272
69912
|
}
|
|
69273
69913
|
getRecordByRowCol(col, row) {
|
|
69274
69914
|
return this.getRecordByCell(col, row);
|
|
@@ -69404,7 +70044,7 @@
|
|
|
69404
70044
|
if (table.internalProps.layoutMap.isHeader(col, row)) {
|
|
69405
70045
|
return false;
|
|
69406
70046
|
}
|
|
69407
|
-
const index = table.
|
|
70047
|
+
const index = table.getRecordShowIndexByCell(col, row);
|
|
69408
70048
|
return table.internalProps.dataSource.hasField(index, field);
|
|
69409
70049
|
}
|
|
69410
70050
|
_getCellStyle(col, row) {
|
|
@@ -71464,7 +72104,7 @@
|
|
|
71464
72104
|
const { field } = table.internalProps.layoutMap.getBody(col, row);
|
|
71465
72105
|
return table.getRawFieldData(field, col, row);
|
|
71466
72106
|
}
|
|
71467
|
-
|
|
72107
|
+
getRecordShowIndexByCell(col, row) {
|
|
71468
72108
|
const { layoutMap } = this.internalProps;
|
|
71469
72109
|
return layoutMap.getRecordIndexByCell(col, row);
|
|
71470
72110
|
}
|
|
@@ -71490,7 +72130,7 @@
|
|
|
71490
72130
|
}
|
|
71491
72131
|
getCellOriginRecord(col, row) {
|
|
71492
72132
|
const table = this;
|
|
71493
|
-
const index = table.
|
|
72133
|
+
const index = table.getRecordShowIndexByCell(col, row);
|
|
71494
72134
|
if (index > -1) {
|
|
71495
72135
|
return table.dataSource.get(index);
|
|
71496
72136
|
}
|
|
@@ -71498,7 +72138,7 @@
|
|
|
71498
72138
|
}
|
|
71499
72139
|
getCellRawRecord(col, row) {
|
|
71500
72140
|
const table = this;
|
|
71501
|
-
const index = table.
|
|
72141
|
+
const index = table.getRecordShowIndexByCell(col, row);
|
|
71502
72142
|
if (index > -1) {
|
|
71503
72143
|
return table.dataSource.getRaw(index);
|
|
71504
72144
|
}
|
|
@@ -71606,6 +72246,9 @@
|
|
|
71606
72246
|
(table.internalProps.dataSource?.length ?? 0) * layoutMap.bodyRowSpanCount + layoutMap.headerLevelCount;
|
|
71607
72247
|
table.frozenRowCount = 0;
|
|
71608
72248
|
this.internalProps.frozenColCount = layoutMap.headerLevelCount ?? 0;
|
|
72249
|
+
if (table.bottomFrozenRowCount !== (this.options.bottomFrozenRowCount ?? 0)) {
|
|
72250
|
+
table.bottomFrozenRowCount = this.options.bottomFrozenRowCount ?? 0;
|
|
72251
|
+
}
|
|
71609
72252
|
if (table.rightFrozenColCount !== (this.options.rightFrozenColCount ?? 0)) {
|
|
71610
72253
|
table.rightFrozenColCount = this.options.rightFrozenColCount ?? 0;
|
|
71611
72254
|
}
|
|
@@ -71633,7 +72276,7 @@
|
|
|
71633
72276
|
if (table.internalProps.layoutMap.isHeader(col, row)) {
|
|
71634
72277
|
return null;
|
|
71635
72278
|
}
|
|
71636
|
-
const index = table.
|
|
72279
|
+
const index = table.getRecordShowIndexByCell(col, row);
|
|
71637
72280
|
return table.internalProps.dataSource.getField(index, field, col, row, this);
|
|
71638
72281
|
}
|
|
71639
72282
|
getRawFieldData(field, col, row) {
|
|
@@ -71644,7 +72287,7 @@
|
|
|
71644
72287
|
if (table.internalProps.layoutMap.isHeader(col, row)) {
|
|
71645
72288
|
return null;
|
|
71646
72289
|
}
|
|
71647
|
-
const index = table.
|
|
72290
|
+
const index = table.getRecordShowIndexByCell(col, row);
|
|
71648
72291
|
return table.internalProps.dataSource.getRawField(index, field, col, row, this);
|
|
71649
72292
|
}
|
|
71650
72293
|
moveHeaderPosition(source, target) {
|
|
@@ -71751,7 +72394,7 @@
|
|
|
71751
72394
|
if (!define.tree) {
|
|
71752
72395
|
return HierarchyState.none;
|
|
71753
72396
|
}
|
|
71754
|
-
const index = this.
|
|
72397
|
+
const index = this.getRecordShowIndexByCell(col, row);
|
|
71755
72398
|
return this.dataSource.getHierarchyState(index);
|
|
71756
72399
|
}
|
|
71757
72400
|
toggleHierarchyState(col, row) {
|
|
@@ -71778,7 +72421,7 @@
|
|
|
71778
72421
|
}
|
|
71779
72422
|
}
|
|
71780
72423
|
_refreshHierarchyState(col, row) {
|
|
71781
|
-
const index = this.
|
|
72424
|
+
const index = this.getRecordShowIndexByCell(col, row);
|
|
71782
72425
|
const diffDataIndices = this.dataSource.toggleHierarchyState(index);
|
|
71783
72426
|
const diffPositions = this.internalProps.layoutMap.toggleHierarchyState(diffDataIndices);
|
|
71784
72427
|
this.refreshRowColCount();
|
|
@@ -71878,7 +72521,7 @@
|
|
|
71878
72521
|
const field = define?.field;
|
|
71879
72522
|
const cellType = define?.cellType;
|
|
71880
72523
|
if (isValid$5(field) && cellType === 'checkbox') {
|
|
71881
|
-
const dataIndex = this.dataSource.getIndexKey(this.
|
|
72524
|
+
const dataIndex = this.dataSource.getIndexKey(this.getRecordShowIndexByCell(col, row));
|
|
71882
72525
|
return this.stateManager.checkedState[dataIndex][field];
|
|
71883
72526
|
}
|
|
71884
72527
|
return undefined;
|
|
@@ -71935,7 +72578,7 @@
|
|
|
71935
72578
|
setRecordChildren(records, col, row) {
|
|
71936
72579
|
const record = this.getCellOriginRecord(col, row);
|
|
71937
72580
|
record.children = records;
|
|
71938
|
-
const index = this.
|
|
72581
|
+
const index = this.getRecordShowIndexByCell(col, row);
|
|
71939
72582
|
this.dataSource.setRecord(record, index);
|
|
71940
72583
|
this._refreshHierarchyState(col, row);
|
|
71941
72584
|
}
|
|
@@ -71972,7 +72615,7 @@
|
|
|
71972
72615
|
return editorDefine;
|
|
71973
72616
|
}
|
|
71974
72617
|
changeCellValue(col, row, value) {
|
|
71975
|
-
const recordIndex = this.
|
|
72618
|
+
const recordIndex = this.getRecordShowIndexByCell(col, row);
|
|
71976
72619
|
const { field } = this.internalProps.layoutMap.getBody(col, row);
|
|
71977
72620
|
this.dataSource.changeFieldValue(value, recordIndex, field, col, row, this);
|
|
71978
72621
|
this.scenegraph.updateCellContent(col, row);
|
|
@@ -72004,6 +72647,226 @@
|
|
|
72004
72647
|
});
|
|
72005
72648
|
this.scenegraph.updateNextFrame();
|
|
72006
72649
|
}
|
|
72650
|
+
addRecord(record, recordIndex) {
|
|
72651
|
+
if (this.sortState) {
|
|
72652
|
+
this.dataSource.addRecordForSorted(record);
|
|
72653
|
+
sortRecords(this);
|
|
72654
|
+
this.refreshRowColCount();
|
|
72655
|
+
this.scenegraph.clearCells();
|
|
72656
|
+
this.scenegraph.createSceneGraph();
|
|
72657
|
+
}
|
|
72658
|
+
else {
|
|
72659
|
+
if (recordIndex === undefined || recordIndex > this.dataSource.sourceLength) {
|
|
72660
|
+
recordIndex = this.dataSource.sourceLength;
|
|
72661
|
+
}
|
|
72662
|
+
const headerCount = this.transpose ? this.rowHeaderLevelCount : this.columnHeaderLevelCount;
|
|
72663
|
+
this.dataSource.addRecord(record, recordIndex);
|
|
72664
|
+
const oldRowCount = this.rowCount;
|
|
72665
|
+
this.refreshRowColCount();
|
|
72666
|
+
const newRowCount = this.transpose ? this.colCount : this.rowCount;
|
|
72667
|
+
if (this.pagination) {
|
|
72668
|
+
const { perPageCount, currentPage } = this.pagination;
|
|
72669
|
+
const startIndex = perPageCount * (currentPage || 0);
|
|
72670
|
+
const endIndex = startIndex + perPageCount;
|
|
72671
|
+
if (recordIndex < endIndex) {
|
|
72672
|
+
if (recordIndex < endIndex - perPageCount) {
|
|
72673
|
+
this.scenegraph.clearCells();
|
|
72674
|
+
this.scenegraph.createSceneGraph();
|
|
72675
|
+
}
|
|
72676
|
+
else {
|
|
72677
|
+
const rowNum = recordIndex - (endIndex - perPageCount) + headerCount;
|
|
72678
|
+
if (oldRowCount - headerCount === this.pagination.perPageCount) {
|
|
72679
|
+
const updateRows = [];
|
|
72680
|
+
for (let row = rowNum; row < newRowCount; row++) {
|
|
72681
|
+
if (this.transpose) {
|
|
72682
|
+
updateRows.push({ col: row, row: 0 });
|
|
72683
|
+
}
|
|
72684
|
+
else {
|
|
72685
|
+
updateRows.push({ col: 0, row });
|
|
72686
|
+
}
|
|
72687
|
+
}
|
|
72688
|
+
this.transpose
|
|
72689
|
+
? this.scenegraph.updateCol([], [], updateRows)
|
|
72690
|
+
: this.scenegraph.updateRow([], [], updateRows);
|
|
72691
|
+
}
|
|
72692
|
+
else {
|
|
72693
|
+
const addRows = [];
|
|
72694
|
+
for (let row = rowNum; row < Math.min(newRowCount, rowNum + 1); row++) {
|
|
72695
|
+
if (this.transpose) {
|
|
72696
|
+
addRows.push({ col: row, row: 0 });
|
|
72697
|
+
}
|
|
72698
|
+
else {
|
|
72699
|
+
addRows.push({ col: 0, row });
|
|
72700
|
+
}
|
|
72701
|
+
}
|
|
72702
|
+
this.transpose ? this.scenegraph.updateCol([], addRows, []) : this.scenegraph.updateRow([], addRows, []);
|
|
72703
|
+
}
|
|
72704
|
+
}
|
|
72705
|
+
}
|
|
72706
|
+
}
|
|
72707
|
+
else {
|
|
72708
|
+
const addRows = [];
|
|
72709
|
+
for (let row = recordIndex + headerCount; row < recordIndex + headerCount + 1; row++) {
|
|
72710
|
+
if (this.transpose) {
|
|
72711
|
+
addRows.push({ col: row, row: 0 });
|
|
72712
|
+
}
|
|
72713
|
+
else {
|
|
72714
|
+
addRows.push({ col: 0, row });
|
|
72715
|
+
}
|
|
72716
|
+
}
|
|
72717
|
+
this.transpose ? this.scenegraph.updateCol([], addRows, []) : this.scenegraph.updateRow([], addRows, []);
|
|
72718
|
+
}
|
|
72719
|
+
}
|
|
72720
|
+
}
|
|
72721
|
+
addRecords(records, recordIndex) {
|
|
72722
|
+
if (this.sortState) {
|
|
72723
|
+
this.dataSource.addRecordsForSorted(records);
|
|
72724
|
+
sortRecords(this);
|
|
72725
|
+
this.refreshRowColCount();
|
|
72726
|
+
this.scenegraph.clearCells();
|
|
72727
|
+
this.scenegraph.createSceneGraph();
|
|
72728
|
+
}
|
|
72729
|
+
else {
|
|
72730
|
+
if (recordIndex === undefined || recordIndex > this.dataSource.sourceLength) {
|
|
72731
|
+
recordIndex = this.dataSource.sourceLength;
|
|
72732
|
+
}
|
|
72733
|
+
else if (recordIndex < 0) {
|
|
72734
|
+
recordIndex = 0;
|
|
72735
|
+
}
|
|
72736
|
+
const headerCount = this.transpose ? this.rowHeaderLevelCount : this.columnHeaderLevelCount;
|
|
72737
|
+
this.dataSource.addRecords(records, recordIndex);
|
|
72738
|
+
const oldRowCount = this.transpose ? this.colCount : this.rowCount;
|
|
72739
|
+
this.refreshRowColCount();
|
|
72740
|
+
const newRowCount = this.transpose ? this.colCount : this.rowCount;
|
|
72741
|
+
if (this.pagination) {
|
|
72742
|
+
const { perPageCount, currentPage } = this.pagination;
|
|
72743
|
+
const startIndex = perPageCount * (currentPage || 0);
|
|
72744
|
+
const endIndex = startIndex + perPageCount;
|
|
72745
|
+
if (recordIndex < endIndex) {
|
|
72746
|
+
if (recordIndex < endIndex - perPageCount) {
|
|
72747
|
+
this.scenegraph.clearCells();
|
|
72748
|
+
this.scenegraph.createSceneGraph();
|
|
72749
|
+
}
|
|
72750
|
+
else {
|
|
72751
|
+
const rowNum = recordIndex - (endIndex - perPageCount) + headerCount;
|
|
72752
|
+
if (oldRowCount - headerCount === this.pagination.perPageCount) {
|
|
72753
|
+
const updateRows = [];
|
|
72754
|
+
for (let row = rowNum; row < newRowCount; row++) {
|
|
72755
|
+
if (this.transpose) {
|
|
72756
|
+
updateRows.push({ col: row, row: 0 });
|
|
72757
|
+
}
|
|
72758
|
+
else {
|
|
72759
|
+
updateRows.push({ col: 0, row });
|
|
72760
|
+
}
|
|
72761
|
+
}
|
|
72762
|
+
this.transpose
|
|
72763
|
+
? this.scenegraph.updateCol([], [], updateRows)
|
|
72764
|
+
: this.scenegraph.updateRow([], [], updateRows);
|
|
72765
|
+
}
|
|
72766
|
+
else {
|
|
72767
|
+
const addRows = [];
|
|
72768
|
+
for (let row = rowNum; row < Math.min(newRowCount, rowNum + (Array.isArray(records) ? records.length : 1)); row++) {
|
|
72769
|
+
if (this.transpose) {
|
|
72770
|
+
addRows.push({ col: row, row: 0 });
|
|
72771
|
+
}
|
|
72772
|
+
else {
|
|
72773
|
+
addRows.push({ col: 0, row });
|
|
72774
|
+
}
|
|
72775
|
+
}
|
|
72776
|
+
this.transpose ? this.scenegraph.updateCol([], addRows, []) : this.scenegraph.updateRow([], addRows, []);
|
|
72777
|
+
}
|
|
72778
|
+
}
|
|
72779
|
+
}
|
|
72780
|
+
}
|
|
72781
|
+
else {
|
|
72782
|
+
const addRows = [];
|
|
72783
|
+
for (let row = recordIndex + headerCount; row < recordIndex + headerCount + (Array.isArray(records) ? records.length : 1); row++) {
|
|
72784
|
+
if (this.transpose) {
|
|
72785
|
+
addRows.push({ col: row, row: 0 });
|
|
72786
|
+
}
|
|
72787
|
+
else {
|
|
72788
|
+
addRows.push({ col: 0, row });
|
|
72789
|
+
}
|
|
72790
|
+
}
|
|
72791
|
+
this.transpose ? this.scenegraph.updateCol([], addRows, []) : this.scenegraph.updateRow([], addRows, []);
|
|
72792
|
+
}
|
|
72793
|
+
}
|
|
72794
|
+
}
|
|
72795
|
+
deleteRecords(recordIndexs) {
|
|
72796
|
+
if (recordIndexs?.length > 0) {
|
|
72797
|
+
if (this.sortState) {
|
|
72798
|
+
this.dataSource.deleteRecordsForSorted(recordIndexs);
|
|
72799
|
+
sortRecords(this);
|
|
72800
|
+
this.refreshRowColCount();
|
|
72801
|
+
this.scenegraph.clearCells();
|
|
72802
|
+
this.scenegraph.createSceneGraph();
|
|
72803
|
+
}
|
|
72804
|
+
else {
|
|
72805
|
+
const deletedRecordIndexs = this.dataSource.deleteRecords(recordIndexs);
|
|
72806
|
+
if (deletedRecordIndexs.length === 0) {
|
|
72807
|
+
return;
|
|
72808
|
+
}
|
|
72809
|
+
const oldRowCount = this.transpose ? this.colCount : this.rowCount;
|
|
72810
|
+
this.refreshRowColCount();
|
|
72811
|
+
const newRowCount = this.transpose ? this.colCount : this.rowCount;
|
|
72812
|
+
const recordIndexsMinToMax = deletedRecordIndexs.sort((a, b) => a - b);
|
|
72813
|
+
const minRecordIndex = recordIndexsMinToMax[0];
|
|
72814
|
+
if (this.pagination) {
|
|
72815
|
+
const { perPageCount, currentPage } = this.pagination;
|
|
72816
|
+
const startIndex = perPageCount * (currentPage || 0);
|
|
72817
|
+
const endIndex = startIndex + perPageCount;
|
|
72818
|
+
if (minRecordIndex < endIndex) {
|
|
72819
|
+
if (minRecordIndex < endIndex - perPageCount) {
|
|
72820
|
+
this.scenegraph.clearCells();
|
|
72821
|
+
this.scenegraph.createSceneGraph();
|
|
72822
|
+
}
|
|
72823
|
+
else {
|
|
72824
|
+
const minRowNum = minRecordIndex -
|
|
72825
|
+
(endIndex - perPageCount) +
|
|
72826
|
+
(this.transpose ? this.rowHeaderLevelCount : this.columnHeaderLevelCount);
|
|
72827
|
+
const updateRows = [];
|
|
72828
|
+
const delRows = [];
|
|
72829
|
+
for (let row = minRowNum; row < newRowCount; row++) {
|
|
72830
|
+
if (this.transpose) {
|
|
72831
|
+
updateRows.push({ col: row, row: 0 });
|
|
72832
|
+
}
|
|
72833
|
+
else {
|
|
72834
|
+
updateRows.push({ col: 0, row });
|
|
72835
|
+
}
|
|
72836
|
+
}
|
|
72837
|
+
if (newRowCount < oldRowCount) {
|
|
72838
|
+
for (let row = newRowCount; row < oldRowCount; row++) {
|
|
72839
|
+
if (this.transpose) {
|
|
72840
|
+
delRows.push({ col: row, row: 0 });
|
|
72841
|
+
}
|
|
72842
|
+
else {
|
|
72843
|
+
delRows.push({ col: 0, row });
|
|
72844
|
+
}
|
|
72845
|
+
}
|
|
72846
|
+
}
|
|
72847
|
+
this.transpose
|
|
72848
|
+
? this.scenegraph.updateCol(delRows, [], updateRows)
|
|
72849
|
+
: this.scenegraph.updateRow(delRows, [], updateRows);
|
|
72850
|
+
}
|
|
72851
|
+
}
|
|
72852
|
+
}
|
|
72853
|
+
else {
|
|
72854
|
+
const delRows = [];
|
|
72855
|
+
for (let index = 0; index < recordIndexsMinToMax.length; index++) {
|
|
72856
|
+
const recordIndex = recordIndexsMinToMax[index];
|
|
72857
|
+
const rowNum = recordIndex + (this.transpose ? this.rowHeaderLevelCount : this.columnHeaderLevelCount);
|
|
72858
|
+
if (this.transpose) {
|
|
72859
|
+
delRows.push({ col: rowNum, row: 0 });
|
|
72860
|
+
}
|
|
72861
|
+
else {
|
|
72862
|
+
delRows.push({ col: 0, row: rowNum });
|
|
72863
|
+
}
|
|
72864
|
+
}
|
|
72865
|
+
this.transpose ? this.scenegraph.updateCol(delRows, [], []) : this.scenegraph.updateRow(delRows, [], []);
|
|
72866
|
+
}
|
|
72867
|
+
}
|
|
72868
|
+
}
|
|
72869
|
+
}
|
|
72007
72870
|
}
|
|
72008
72871
|
|
|
72009
72872
|
class DimensionTree {
|
|
@@ -76243,7 +77106,7 @@
|
|
|
76243
77106
|
});
|
|
76244
77107
|
}
|
|
76245
77108
|
}
|
|
76246
|
-
|
|
77109
|
+
getRecordShowIndexByCell(col, row) {
|
|
76247
77110
|
return undefined;
|
|
76248
77111
|
}
|
|
76249
77112
|
getTableIndexByRecordIndex(recordIndex) {
|
|
@@ -76876,7 +77739,7 @@
|
|
|
76876
77739
|
});
|
|
76877
77740
|
}
|
|
76878
77741
|
}
|
|
76879
|
-
|
|
77742
|
+
getRecordShowIndexByCell(col, row) {
|
|
76880
77743
|
return undefined;
|
|
76881
77744
|
}
|
|
76882
77745
|
getTableIndexByRecordIndex(recordIndex) {
|
|
@@ -77978,7 +78841,7 @@
|
|
|
77978
78841
|
return new Tag$1(params ? params.attribute : {});
|
|
77979
78842
|
}
|
|
77980
78843
|
|
|
77981
|
-
const version = "0.
|
|
78844
|
+
const version = "0.16.1";
|
|
77982
78845
|
function getIcons() {
|
|
77983
78846
|
return get$2();
|
|
77984
78847
|
}
|