@visactor/vtable 1.19.4 → 1.19.6
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 +0 -4
- package/cjs/ListTable.js +0 -10
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotChart.js +4 -2
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/PivotTable.d.ts +0 -8
- package/cjs/PivotTable.js +0 -28
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/core/BaseTable.js +5 -3
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/record-helper.js +115 -11
- package/cjs/core/record-helper.js.map +1 -1
- package/cjs/data/CachedDataSource.d.ts +1 -1
- package/cjs/data/CachedDataSource.js +5 -5
- package/cjs/data/CachedDataSource.js.map +1 -1
- package/cjs/event/listener/table-group.js +1 -1
- package/cjs/event/listener/table-group.js.map +1 -1
- package/cjs/event/self-event-listener/list-table/checkbox.js +1 -1
- package/cjs/event/self-event-listener/list-table/checkbox.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/index.js +1 -2
- package/cjs/layout/pivot-header-layout.js +1 -1
- package/cjs/layout/pivot-layout.js +0 -2
- package/cjs/layout/row-height-map.js +1 -1
- package/cjs/layout/simple-header-layout.js +1 -1
- package/cjs/layout/tree-helper.js +1 -1
- package/cjs/plugins/custom-cell-style.js +2 -1
- package/cjs/plugins/index.js +1 -1
- package/cjs/plugins/interface.js +1 -1
- package/cjs/plugins/invert-highlight.js +1 -1
- package/cjs/plugins/list-tree-stick-cell.js +1 -1
- package/cjs/plugins/plugin-manager.js +1 -1
- package/cjs/scenegraph/graphic/chart.js +1 -1
- package/cjs/scenegraph/graphic/chart.js.map +1 -1
- package/cjs/scenegraph/icon/icon-update.js +1 -1
- package/cjs/scenegraph/icon/icon-update.js.map +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js +47 -2
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/layout/update-height.js +1 -1
- package/cjs/scenegraph/layout/update-height.js.map +1 -1
- package/cjs/scenegraph/scenegraph.js +1 -1
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/utils/text-icon-layout.js +1 -0
- package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/cjs/state/checkbox/checkbox.js +2 -1
- package/cjs/state/checkbox/checkbox.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +11 -0
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +21 -14
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +270 -87
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.d.ts +0 -4
- package/es/ListTable.js +0 -10
- package/es/ListTable.js.map +1 -1
- package/es/PivotChart.js +4 -2
- package/es/PivotChart.js.map +1 -1
- package/es/PivotTable.d.ts +0 -8
- package/es/PivotTable.js +0 -28
- package/es/PivotTable.js.map +1 -1
- package/es/core/BaseTable.js +5 -3
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/record-helper.js +114 -8
- package/es/core/record-helper.js.map +1 -1
- package/es/data/CachedDataSource.d.ts +1 -1
- package/es/data/CachedDataSource.js +5 -5
- package/es/data/CachedDataSource.js.map +1 -1
- package/es/event/listener/table-group.js +1 -1
- package/es/event/listener/table-group.js.map +1 -1
- package/es/event/self-event-listener/list-table/checkbox.js +1 -1
- package/es/event/self-event-listener/list-table/checkbox.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/index.js +1 -2
- package/es/layout/pivot-header-layout.js +1 -1
- package/es/layout/pivot-layout.js +0 -2
- package/es/layout/row-height-map.js +1 -1
- package/es/layout/simple-header-layout.js +1 -1
- package/es/layout/tree-helper.js +1 -1
- package/es/plugins/custom-cell-style.js +2 -1
- package/es/plugins/index.js +1 -1
- package/es/plugins/interface.js +1 -1
- package/es/plugins/invert-highlight.js +1 -1
- package/es/plugins/list-tree-stick-cell.js +1 -1
- package/es/plugins/plugin-manager.js +1 -1
- package/es/scenegraph/graphic/chart.js +1 -1
- package/es/scenegraph/graphic/chart.js.map +1 -1
- package/es/scenegraph/icon/icon-update.js +1 -1
- package/es/scenegraph/icon/icon-update.js.map +1 -1
- package/es/scenegraph/layout/compute-col-width.js +47 -2
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/layout/update-height.js +1 -1
- package/es/scenegraph/layout/update-height.js.map +1 -1
- package/es/scenegraph/scenegraph.js +1 -1
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/utils/text-icon-layout.js +1 -0
- package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/es/state/checkbox/checkbox.js +2 -1
- package/es/state/checkbox/checkbox.js.map +1 -1
- package/es/ts-types/base-table.d.ts +11 -0
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +21 -14
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +4 -4
package/dist/vtable.js
CHANGED
|
@@ -39613,13 +39613,14 @@
|
|
|
39613
39613
|
}
|
|
39614
39614
|
}
|
|
39615
39615
|
this.initTreeHierarchyState();
|
|
39616
|
-
this.
|
|
39616
|
+
this.updatePagination();
|
|
39617
39617
|
}
|
|
39618
39618
|
deleteRecordsForTree(recordIndexs) {
|
|
39619
39619
|
if (!isArray$7(recordIndexs) || recordIndexs.length === 0) {
|
|
39620
|
-
return;
|
|
39620
|
+
return [];
|
|
39621
39621
|
}
|
|
39622
39622
|
const recordIndexsMaxToMin = sortRecordIndexs(recordIndexs, -1);
|
|
39623
|
+
const deletedRecordIndexs = [];
|
|
39623
39624
|
for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
|
|
39624
39625
|
const recordIndex = recordIndexsMaxToMin[index];
|
|
39625
39626
|
if (isNumber$4(recordIndex) && (recordIndex >= this.sourceLength || recordIndex < 0)) {
|
|
@@ -39636,9 +39637,11 @@
|
|
|
39636
39637
|
parentRecord.children.splice(index, 1);
|
|
39637
39638
|
}
|
|
39638
39639
|
this.adjustBeforeChangedRecordsMap(recordIndex, 1, 'delete');
|
|
39640
|
+
deletedRecordIndexs.push(recordIndex);
|
|
39639
39641
|
}
|
|
39640
39642
|
this.initTreeHierarchyState();
|
|
39641
|
-
this.
|
|
39643
|
+
this.updatePagination();
|
|
39644
|
+
return deletedRecordIndexs;
|
|
39642
39645
|
}
|
|
39643
39646
|
updateRecordsForTree(records, recordIndexs) {
|
|
39644
39647
|
for (let index = 0; index < recordIndexs.length; index++) {
|
|
@@ -42644,6 +42647,9 @@
|
|
|
42644
42647
|
});
|
|
42645
42648
|
}
|
|
42646
42649
|
function dealWithIcon(icon, mark, col, row, range, table, dealWithIconComputeVar) {
|
|
42650
|
+
if (!icon) {
|
|
42651
|
+
return undefined;
|
|
42652
|
+
}
|
|
42647
42653
|
const iconAttribute = {};
|
|
42648
42654
|
if (icon.type === 'image') {
|
|
42649
42655
|
if (icon.isGif) {
|
|
@@ -45017,7 +45023,7 @@
|
|
|
45017
45023
|
}
|
|
45018
45024
|
|
|
45019
45025
|
function updateRowHeight(scene, row, detaY, skipTableHeightMap) {
|
|
45020
|
-
if (!skipTableHeightMap) {
|
|
45026
|
+
if (!skipTableHeightMap && detaY) {
|
|
45021
45027
|
scene.table._setRowHeight(row, scene.table.getRowHeight(row) + detaY, true);
|
|
45022
45028
|
}
|
|
45023
45029
|
for (let col = 0; col < scene.table.colCount; col++) {
|
|
@@ -47368,7 +47374,7 @@
|
|
|
47368
47374
|
renderHooks: {
|
|
47369
47375
|
afterClearRect(drawParams) {
|
|
47370
47376
|
const { context, layer, viewBox } = drawParams;
|
|
47371
|
-
if (layer.main && drawParams.clear) {
|
|
47377
|
+
if (layer.main && drawParams.clear && hoverColor) {
|
|
47372
47378
|
context.beginPath();
|
|
47373
47379
|
context.fillStyle = hoverColor;
|
|
47374
47380
|
context.rect(viewBox.x1, viewBox.y1, viewBox.x2 - viewBox.x1, viewBox.y2 - viewBox.y1);
|
|
@@ -49124,11 +49130,10 @@
|
|
|
49124
49130
|
});
|
|
49125
49131
|
|
|
49126
49132
|
function computeColsWidth(table, colStart, colEnd, update) {
|
|
49127
|
-
table.internalProps.columnWidthConfig &&
|
|
49128
|
-
table._parseColumnWidthConfig(table.internalProps.columnWidthConfig);
|
|
49133
|
+
table.internalProps.columnWidthConfig && _parseColumnWidthConfig(table, table.internalProps.columnWidthConfig);
|
|
49129
49134
|
table.isPivotTable() &&
|
|
49130
49135
|
table.internalProps.columnWidthConfigForRowHeader &&
|
|
49131
|
-
|
|
49136
|
+
_parseColumnWidthConfigForPivotRowHeader(table, table.internalProps.columnWidthConfigForRowHeader);
|
|
49132
49137
|
colStart = colStart ?? 0;
|
|
49133
49138
|
colEnd = colEnd ?? table.colCount - 1;
|
|
49134
49139
|
if (colStart === 0 && colEnd === table.colCount - 1) {
|
|
@@ -49686,6 +49691,83 @@
|
|
|
49686
49691
|
}
|
|
49687
49692
|
}
|
|
49688
49693
|
}
|
|
49694
|
+
function _parseColumnWidthConfig(table, columnWidthConfig) {
|
|
49695
|
+
if (table.isPivotTable()) {
|
|
49696
|
+
_parseColumnWidthConfigForPivotTable(table, columnWidthConfig);
|
|
49697
|
+
}
|
|
49698
|
+
else if (table.isListTable()) {
|
|
49699
|
+
_parseColumnWidthConfigForListTable(table, columnWidthConfig);
|
|
49700
|
+
}
|
|
49701
|
+
}
|
|
49702
|
+
function _parseColumnWidthConfigForListTable(table, columnWidthConfig) {
|
|
49703
|
+
for (let i = 0; i < columnWidthConfig?.length; i++) {
|
|
49704
|
+
const item = columnWidthConfig[i];
|
|
49705
|
+
const key = item.key;
|
|
49706
|
+
const width = item.width;
|
|
49707
|
+
const columnData = table.internalProps.layoutMap.getColumnByKey(key);
|
|
49708
|
+
if (columnData.columnDefine) {
|
|
49709
|
+
const { col } = columnData;
|
|
49710
|
+
if (!table.internalProps._widthResizedColMap.has(col)) {
|
|
49711
|
+
table._setColWidth(col, width);
|
|
49712
|
+
table.internalProps._widthResizedColMap.add(col);
|
|
49713
|
+
}
|
|
49714
|
+
}
|
|
49715
|
+
}
|
|
49716
|
+
}
|
|
49717
|
+
function _parseColumnWidthConfigForPivotTable(table, columnWidthConfig) {
|
|
49718
|
+
for (let i = 0; i < columnWidthConfig?.length; i++) {
|
|
49719
|
+
const item = columnWidthConfig[i];
|
|
49720
|
+
const dimensions = item.dimensions;
|
|
49721
|
+
const width = item.width;
|
|
49722
|
+
const cell = table.getCellAddressByHeaderPaths(dimensions);
|
|
49723
|
+
if (cell && cell.col >= table.rowHeaderLevelCount) {
|
|
49724
|
+
const cellPath = table.getCellHeaderPaths(cell.col, table.columnHeaderLevelCount);
|
|
49725
|
+
if (cellPath.colHeaderPaths.length === dimensions.length) {
|
|
49726
|
+
let match = true;
|
|
49727
|
+
for (let i = 0; i < dimensions.length; i++) {
|
|
49728
|
+
const dimension = dimensions[i];
|
|
49729
|
+
const finded = cellPath.colHeaderPaths.findIndex((colPath, index) => {
|
|
49730
|
+
if (colPath.indicatorKey === dimension.indicatorKey) {
|
|
49731
|
+
return true;
|
|
49732
|
+
}
|
|
49733
|
+
if (colPath.dimensionKey === dimension.dimensionKey && colPath.value === dimension.value) {
|
|
49734
|
+
return true;
|
|
49735
|
+
}
|
|
49736
|
+
return false;
|
|
49737
|
+
});
|
|
49738
|
+
if (finded < 0) {
|
|
49739
|
+
match = false;
|
|
49740
|
+
break;
|
|
49741
|
+
}
|
|
49742
|
+
}
|
|
49743
|
+
if (match && !table.internalProps._widthResizedColMap.has(cell.col)) {
|
|
49744
|
+
table._setColWidth(cell.col, width);
|
|
49745
|
+
table.internalProps._widthResizedColMap.add(cell.col);
|
|
49746
|
+
}
|
|
49747
|
+
}
|
|
49748
|
+
}
|
|
49749
|
+
else if (cell && cell.col < table.rowHeaderLevelCount) {
|
|
49750
|
+
if (!table.internalProps._widthResizedColMap.has(cell.col)) {
|
|
49751
|
+
table._setColWidth(cell.col, width);
|
|
49752
|
+
table.internalProps._widthResizedColMap.add(cell.col);
|
|
49753
|
+
}
|
|
49754
|
+
}
|
|
49755
|
+
}
|
|
49756
|
+
}
|
|
49757
|
+
function _parseColumnWidthConfigForPivotRowHeader(table, columnWidthConfig) {
|
|
49758
|
+
for (let i = 0; i < columnWidthConfig?.length; i++) {
|
|
49759
|
+
const item = columnWidthConfig[i];
|
|
49760
|
+
const dimensions = item.dimensions;
|
|
49761
|
+
const width = item.width;
|
|
49762
|
+
const cell = table.getCellAddressByHeaderPaths(dimensions);
|
|
49763
|
+
if (cell && cell.col < table.rowHeaderLevelCount) {
|
|
49764
|
+
if (!table.internalProps._widthResizedColMap.has(cell.col)) {
|
|
49765
|
+
table._setColWidth(cell.col, width);
|
|
49766
|
+
table.internalProps._widthResizedColMap.add(cell.col);
|
|
49767
|
+
}
|
|
49768
|
+
}
|
|
49769
|
+
}
|
|
49770
|
+
}
|
|
49689
49771
|
|
|
49690
49772
|
const emptyGroup = new Group$1({});
|
|
49691
49773
|
emptyGroup.role = 'empty';
|
|
@@ -54121,7 +54203,7 @@
|
|
|
54121
54203
|
}
|
|
54122
54204
|
updateCellRangeIcon(col, row, (icon) => icon.attribute.funcType === IconFuncTypeEnum.collapse || icon.attribute.funcType === IconFuncTypeEnum.expand, (icon) => {
|
|
54123
54205
|
dealWithIcon(iconConfig, icon);
|
|
54124
|
-
icon.name = iconConfig
|
|
54206
|
+
icon.name = iconConfig?.name;
|
|
54125
54207
|
}, scene);
|
|
54126
54208
|
}
|
|
54127
54209
|
function updateCellGroupIcon(cellGroup, filter, dealer) {
|
|
@@ -56036,7 +56118,7 @@
|
|
|
56036
56118
|
else if (this.table.isAutoRowHeight(this.table.columnHeaderLevelCount)) {
|
|
56037
56119
|
for (let i = 0; i < updateRows.length; i++) {
|
|
56038
56120
|
const row = updateRows[i];
|
|
56039
|
-
const oldHeight = this.table.
|
|
56121
|
+
const oldHeight = this.table.rowHeightsMap.get(row);
|
|
56040
56122
|
const newHeight = computeRowHeight(row, 0, this.table.colCount - 1, this.table);
|
|
56041
56123
|
if ((row >= this.proxy.rowStart && row <= this.proxy.rowEnd) ||
|
|
56042
56124
|
(row >= this.table.rowCount - this.table.bottomFrozenRowCount && row <= this.table.rowCount - 1)) {
|
|
@@ -57843,7 +57925,8 @@
|
|
|
57843
57925
|
}
|
|
57844
57926
|
function setCellCheckboxState(col, row, checked, table) {
|
|
57845
57927
|
const cellGroup = table.scenegraph.getCell(col, row);
|
|
57846
|
-
const checkbox = cellGroup?.getChildByName('checkbox')
|
|
57928
|
+
const checkbox = cellGroup?.getChildByName('checkbox') ||
|
|
57929
|
+
cellGroup?.getChildByName('checkbox-content')?._checkboxGroup?.getChildByName('checkbox');
|
|
57847
57930
|
if (!checkbox) {
|
|
57848
57931
|
const field = table.getHeaderField(col, row);
|
|
57849
57932
|
if (table.isHeader(col, row)) {
|
|
@@ -60392,7 +60475,7 @@
|
|
|
60392
60475
|
};
|
|
60393
60476
|
if (table.isHeader(col, row)) {
|
|
60394
60477
|
table.stateManager.setHeaderCheckedState(cellInfo.field, e.detail.checked);
|
|
60395
|
-
if (table.internalProps.
|
|
60478
|
+
if (table.internalProps.enableHeaderCheckboxCascade) {
|
|
60396
60479
|
const cellType = table.getCellType(col, row);
|
|
60397
60480
|
if (cellType === 'checkbox') {
|
|
60398
60481
|
table.scenegraph.updateCheckboxCellState(col, row, e.detail.checked);
|
|
@@ -61961,7 +62044,7 @@
|
|
|
61961
62044
|
});
|
|
61962
62045
|
}
|
|
61963
62046
|
function bindHeaderCheckboxChange(table) {
|
|
61964
|
-
if (table.internalProps.
|
|
62047
|
+
if (table.internalProps.enableHeaderCheckboxCascade !== true) {
|
|
61965
62048
|
return;
|
|
61966
62049
|
}
|
|
61967
62050
|
table.on('checkbox_state_change', args => {
|
|
@@ -67143,7 +67226,7 @@
|
|
|
67143
67226
|
return TABLE_EVENT_TYPE;
|
|
67144
67227
|
}
|
|
67145
67228
|
options;
|
|
67146
|
-
version = "1.19.
|
|
67229
|
+
version = "1.19.6";
|
|
67147
67230
|
pagination;
|
|
67148
67231
|
id = `VTable${Date.now()}`;
|
|
67149
67232
|
headerStyleCache;
|
|
@@ -67183,7 +67266,7 @@
|
|
|
67183
67266
|
if (options.customConfig?.imageAnonymous === false) {
|
|
67184
67267
|
vglobal.isImageAnonymous = false;
|
|
67185
67268
|
}
|
|
67186
|
-
const { frozenColCount = 0, unfreezeAllOnExceedsMaxWidth, frozenRowCount, defaultRowHeight = 40, defaultHeaderRowHeight, defaultColWidth = 80, defaultHeaderColWidth, widthMode = 'standard', heightMode = 'standard', autoFillWidth = false, autoFillHeight = false, containerFit = { width: false, height: false }, widthAdaptiveMode = 'only-body', heightAdaptiveMode = 'only-body', keyboardOptions, eventOptions, rowSeriesNumber, enableCheckboxCascade, columnResizeMode, rowResizeMode = 'none', resize, dragHeaderMode, dragOrder, showFrozenIcon, allowFrozenColCount, padding, hover, menu, select: click, customRender, pixelRatio = defaultPixelRatio, renderChartAsync, renderChartAsyncBatchCount, mode, modeParams, canvasWidth, canvasHeight, overscrollBehavior, limitMinWidth, limitMinHeight, clearDOM = true } = options;
|
|
67269
|
+
const { frozenColCount = 0, unfreezeAllOnExceedsMaxWidth, frozenRowCount, defaultRowHeight = 40, defaultHeaderRowHeight, defaultColWidth = 80, defaultHeaderColWidth, widthMode = 'standard', heightMode = 'standard', autoFillWidth = false, autoFillHeight = false, containerFit = { width: false, height: false }, widthAdaptiveMode = 'only-body', heightAdaptiveMode = 'only-body', keyboardOptions, eventOptions, rowSeriesNumber, enableCheckboxCascade, enableHeaderCheckboxCascade, columnResizeMode, rowResizeMode = 'none', resize, dragHeaderMode, dragOrder, showFrozenIcon, allowFrozenColCount, padding, hover, menu, select: click, customRender, pixelRatio = defaultPixelRatio, renderChartAsync, renderChartAsyncBatchCount, mode, modeParams, canvasWidth, canvasHeight, overscrollBehavior, limitMinWidth, limitMinHeight, clearDOM = true } = options;
|
|
67187
67270
|
const { groupConfig, groupBy, groupTitleFieldFormat, groupTitleCustomLayout, enableTreeStickCell } = options;
|
|
67188
67271
|
this.container = container;
|
|
67189
67272
|
this.options = options;
|
|
@@ -67271,6 +67354,7 @@
|
|
|
67271
67354
|
internalProps.eventOptions = eventOptions;
|
|
67272
67355
|
internalProps.rowSeriesNumber = rowSeriesNumber;
|
|
67273
67356
|
internalProps.enableCheckboxCascade = enableCheckboxCascade ?? rowSeriesNumber?.enableTreeCheckbox ?? true;
|
|
67357
|
+
internalProps.enableHeaderCheckboxCascade = enableCheckboxCascade || (enableHeaderCheckboxCascade ?? true);
|
|
67274
67358
|
internalProps.columnResizeMode = resize?.columnResizeMode ?? columnResizeMode;
|
|
67275
67359
|
internalProps.rowResizeMode = resize?.rowResizeMode ?? rowResizeMode;
|
|
67276
67360
|
internalProps.dragHeaderMode = dragOrder?.dragHeaderMode ?? dragHeaderMode ?? 'none';
|
|
@@ -68656,7 +68740,7 @@
|
|
|
68656
68740
|
this.editorManager?.cancelEdit();
|
|
68657
68741
|
this.options = options;
|
|
68658
68742
|
this._hasAutoImageColumn = undefined;
|
|
68659
|
-
const { frozenColCount = 0, unfreezeAllOnExceedsMaxWidth, defaultRowHeight = 40, defaultHeaderRowHeight, defaultColWidth = 80, defaultHeaderColWidth = 80, keyboardOptions, eventOptions, rowSeriesNumber, enableCheckboxCascade, columnResizeMode, rowResizeMode = 'none', resize, dragHeaderMode, dragOrder, showFrozenIcon, allowFrozenColCount, padding, hover, menu, select: click, pixelRatio, widthMode, heightMode, autoFillWidth, autoFillHeight, containerFit, widthAdaptiveMode, heightAdaptiveMode, customRender, renderChartAsync, renderChartAsyncBatchCount, canvasWidth, canvasHeight, overscrollBehavior, limitMinWidth, limitMinHeight } = options;
|
|
68743
|
+
const { frozenColCount = 0, unfreezeAllOnExceedsMaxWidth, defaultRowHeight = 40, defaultHeaderRowHeight, defaultColWidth = 80, defaultHeaderColWidth = 80, keyboardOptions, eventOptions, rowSeriesNumber, enableCheckboxCascade, enableHeaderCheckboxCascade, columnResizeMode, rowResizeMode = 'none', resize, dragHeaderMode, dragOrder, showFrozenIcon, allowFrozenColCount, padding, hover, menu, select: click, pixelRatio, widthMode, heightMode, autoFillWidth, autoFillHeight, containerFit, widthAdaptiveMode, heightAdaptiveMode, customRender, renderChartAsync, renderChartAsyncBatchCount, canvasWidth, canvasHeight, overscrollBehavior, limitMinWidth, limitMinHeight } = options;
|
|
68660
68744
|
const { groupConfig, groupBy, groupTitleFieldFormat, groupTitleCustomLayout, enableTreeStickCell } = options;
|
|
68661
68745
|
if (pixelRatio && pixelRatio !== this.internalProps.pixelRatio) {
|
|
68662
68746
|
this.internalProps.pixelRatio = pixelRatio;
|
|
@@ -68717,6 +68801,7 @@
|
|
|
68717
68801
|
internalProps.eventOptions = eventOptions;
|
|
68718
68802
|
internalProps.rowSeriesNumber = rowSeriesNumber;
|
|
68719
68803
|
internalProps.enableCheckboxCascade = enableCheckboxCascade ?? rowSeriesNumber?.enableTreeCheckbox ?? true;
|
|
68804
|
+
internalProps.enableHeaderCheckboxCascade = enableCheckboxCascade || (enableHeaderCheckboxCascade ?? true);
|
|
68720
68805
|
internalProps.columnResizeMode = resize?.columnResizeMode ?? columnResizeMode;
|
|
68721
68806
|
internalProps.rowResizeMode = resize?.rowResizeMode ?? rowResizeMode;
|
|
68722
68807
|
internalProps.dragHeaderMode = dragOrder?.dragHeaderMode ?? dragHeaderMode ?? 'none';
|
|
@@ -73847,6 +73932,7 @@
|
|
|
73847
73932
|
}
|
|
73848
73933
|
else if (table.dataSource.rowHierarchyType === 'tree') {
|
|
73849
73934
|
table.dataSource.addRecordsForTree?.([record], recordIndex);
|
|
73935
|
+
adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1);
|
|
73850
73936
|
table.refreshRowColCount();
|
|
73851
73937
|
table.internalProps.layoutMap.clearCellRangeMap();
|
|
73852
73938
|
table.sortState && sortRecords(table);
|
|
@@ -73855,6 +73941,7 @@
|
|
|
73855
73941
|
}
|
|
73856
73942
|
else if (table.sortState) {
|
|
73857
73943
|
table.dataSource.addRecordForSorted(record);
|
|
73944
|
+
table.stateManager.checkedState.clear();
|
|
73858
73945
|
sortRecords(table);
|
|
73859
73946
|
table.refreshRowColCount();
|
|
73860
73947
|
table.scenegraph.clearCells();
|
|
@@ -73867,6 +73954,7 @@
|
|
|
73867
73954
|
}
|
|
73868
73955
|
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
|
|
73869
73956
|
table.dataSource.addRecord(record, recordIndex);
|
|
73957
|
+
adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1);
|
|
73870
73958
|
const oldRowCount = table.rowCount;
|
|
73871
73959
|
table.refreshRowColCount();
|
|
73872
73960
|
if (table.scenegraph.proxy.totalActualBodyRowCount === 0) {
|
|
@@ -73948,6 +74036,7 @@
|
|
|
73948
74036
|
}
|
|
73949
74037
|
else if (table.dataSource.rowHierarchyType === 'tree') {
|
|
73950
74038
|
table.dataSource.addRecordsForTree?.(records, recordIndex);
|
|
74039
|
+
adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length);
|
|
73951
74040
|
table.refreshRowColCount();
|
|
73952
74041
|
table.internalProps.layoutMap.clearCellRangeMap();
|
|
73953
74042
|
table.sortState && sortRecords(table);
|
|
@@ -73971,6 +74060,7 @@
|
|
|
73971
74060
|
}
|
|
73972
74061
|
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
|
|
73973
74062
|
table.dataSource.addRecords(records, recordIndex);
|
|
74063
|
+
adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length);
|
|
73974
74064
|
const oldRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
73975
74065
|
table.refreshRowColCount();
|
|
73976
74066
|
if (table.scenegraph.proxy.totalActualBodyRowCount === 0) {
|
|
@@ -74065,7 +74155,13 @@
|
|
|
74065
74155
|
table.scenegraph.createSceneGraph();
|
|
74066
74156
|
}
|
|
74067
74157
|
else if (table.dataSource.rowHierarchyType === 'tree') {
|
|
74068
|
-
table.dataSource.deleteRecordsForTree?.(recordIndexs);
|
|
74158
|
+
const deletedRecordIndexs = table.dataSource.deleteRecordsForTree?.(recordIndexs);
|
|
74159
|
+
if (deletedRecordIndexs.length === 0) {
|
|
74160
|
+
return;
|
|
74161
|
+
}
|
|
74162
|
+
for (let index = 0; index < deletedRecordIndexs.length; index++) {
|
|
74163
|
+
adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);
|
|
74164
|
+
}
|
|
74069
74165
|
table.refreshRowColCount();
|
|
74070
74166
|
table.internalProps.layoutMap.clearCellRangeMap();
|
|
74071
74167
|
table.sortState && sortRecords(table);
|
|
@@ -74293,6 +74389,158 @@
|
|
|
74293
74389
|
}
|
|
74294
74390
|
}
|
|
74295
74391
|
}
|
|
74392
|
+
function adjustCheckBoxStateMapWithDeleteRecordIndex(table, recordIndex, count) {
|
|
74393
|
+
const { checkedState } = table.stateManager;
|
|
74394
|
+
if (!checkedState) {
|
|
74395
|
+
return;
|
|
74396
|
+
}
|
|
74397
|
+
if (table.dataSource.rowHierarchyType === 'tree') {
|
|
74398
|
+
let toOperateIndexArr;
|
|
74399
|
+
if (isNumber$4(recordIndex)) {
|
|
74400
|
+
toOperateIndexArr = [recordIndex];
|
|
74401
|
+
}
|
|
74402
|
+
else {
|
|
74403
|
+
toOperateIndexArr = recordIndex;
|
|
74404
|
+
}
|
|
74405
|
+
const toOperateIndexArrLength = toOperateIndexArr.length;
|
|
74406
|
+
const targetResult = [];
|
|
74407
|
+
checkedState.forEach((value, key) => {
|
|
74408
|
+
const keyArray = key.split(',');
|
|
74409
|
+
if (keyArray.length >= toOperateIndexArr.length) {
|
|
74410
|
+
for (let i = 0; i < keyArray.length; i++) {
|
|
74411
|
+
const toOperateIndex = toOperateIndexArr[i] ?? -1;
|
|
74412
|
+
const keyIndex = Number(keyArray[i]);
|
|
74413
|
+
if (toOperateIndex === keyIndex && i < keyArray.length - 1) ;
|
|
74414
|
+
else if ((toOperateIndex === keyIndex && i === keyArray.length - 1) || toOperateIndex === -1) {
|
|
74415
|
+
targetResult.push({
|
|
74416
|
+
originKey: key,
|
|
74417
|
+
value
|
|
74418
|
+
});
|
|
74419
|
+
break;
|
|
74420
|
+
}
|
|
74421
|
+
else if (toOperateIndex < keyIndex && i === toOperateIndexArrLength - 1) {
|
|
74422
|
+
keyArray[i] = (keyIndex - count).toString();
|
|
74423
|
+
targetResult.push({
|
|
74424
|
+
originKey: key,
|
|
74425
|
+
targetKey: keyArray.toString(),
|
|
74426
|
+
value
|
|
74427
|
+
});
|
|
74428
|
+
break;
|
|
74429
|
+
}
|
|
74430
|
+
else {
|
|
74431
|
+
break;
|
|
74432
|
+
}
|
|
74433
|
+
}
|
|
74434
|
+
}
|
|
74435
|
+
});
|
|
74436
|
+
targetResult.sort((a, b) => {
|
|
74437
|
+
const aArray = a.originKey.split(',');
|
|
74438
|
+
const bArray = b.originKey.split(',');
|
|
74439
|
+
const aLength = aArray.length;
|
|
74440
|
+
const bLength = bArray.length;
|
|
74441
|
+
const minLength = Math.min(aLength, bLength);
|
|
74442
|
+
for (let i = 0; i < minLength; i++) {
|
|
74443
|
+
const aIndex = Number(aArray[i]);
|
|
74444
|
+
const bIndex = Number(bArray[i]);
|
|
74445
|
+
if (aIndex !== bIndex) {
|
|
74446
|
+
return aIndex - bIndex;
|
|
74447
|
+
}
|
|
74448
|
+
}
|
|
74449
|
+
return aLength - bLength;
|
|
74450
|
+
});
|
|
74451
|
+
targetResult.forEach(({ originKey, targetKey, value }) => {
|
|
74452
|
+
checkedState.delete(originKey);
|
|
74453
|
+
if (targetKey) {
|
|
74454
|
+
checkedState.set(targetKey, value);
|
|
74455
|
+
}
|
|
74456
|
+
});
|
|
74457
|
+
}
|
|
74458
|
+
else {
|
|
74459
|
+
const length = checkedState.size;
|
|
74460
|
+
for (let key = length - 1; key >= recordIndex; key--) {
|
|
74461
|
+
const record = checkedState.get(key.toString());
|
|
74462
|
+
checkedState.delete(key.toString());
|
|
74463
|
+
checkedState.set((key - count).toString(), record);
|
|
74464
|
+
}
|
|
74465
|
+
}
|
|
74466
|
+
}
|
|
74467
|
+
function adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, count) {
|
|
74468
|
+
const { checkedState } = table.stateManager;
|
|
74469
|
+
if (!checkedState) {
|
|
74470
|
+
return;
|
|
74471
|
+
}
|
|
74472
|
+
if (table.dataSource.rowHierarchyType === 'tree') {
|
|
74473
|
+
let toOperateIndexArr;
|
|
74474
|
+
if (isNumber$4(recordIndex)) {
|
|
74475
|
+
toOperateIndexArr = [recordIndex];
|
|
74476
|
+
}
|
|
74477
|
+
else {
|
|
74478
|
+
toOperateIndexArr = recordIndex;
|
|
74479
|
+
}
|
|
74480
|
+
const toOperateIndexArrLength = toOperateIndexArr.length;
|
|
74481
|
+
const targetResult = [];
|
|
74482
|
+
checkedState.forEach((value, key) => {
|
|
74483
|
+
const keyArray = key.split(',');
|
|
74484
|
+
if (keyArray.length >= toOperateIndexArr.length) {
|
|
74485
|
+
for (let i = 0; i < keyArray.length; i++) {
|
|
74486
|
+
const toOperateIndex = toOperateIndexArr[i] ?? -1;
|
|
74487
|
+
const keyIndex = Number(keyArray[i]);
|
|
74488
|
+
if (toOperateIndex === keyIndex && (i === keyArray.length - 1 || i === toOperateIndexArrLength - 1)) {
|
|
74489
|
+
keyArray[i] = (keyIndex + count).toString();
|
|
74490
|
+
targetResult.push({
|
|
74491
|
+
originKey: key,
|
|
74492
|
+
targetKey: keyArray.toString(),
|
|
74493
|
+
value
|
|
74494
|
+
});
|
|
74495
|
+
break;
|
|
74496
|
+
}
|
|
74497
|
+
else if (toOperateIndex === keyIndex && i < keyArray.length - 1) ;
|
|
74498
|
+
else if (toOperateIndex < keyIndex && i === toOperateIndexArrLength - 1) {
|
|
74499
|
+
keyArray[i] = (keyIndex + count).toString();
|
|
74500
|
+
targetResult.push({
|
|
74501
|
+
originKey: key,
|
|
74502
|
+
targetKey: keyArray.toString(),
|
|
74503
|
+
value
|
|
74504
|
+
});
|
|
74505
|
+
break;
|
|
74506
|
+
}
|
|
74507
|
+
else {
|
|
74508
|
+
break;
|
|
74509
|
+
}
|
|
74510
|
+
}
|
|
74511
|
+
}
|
|
74512
|
+
});
|
|
74513
|
+
targetResult.sort((a, b) => {
|
|
74514
|
+
const aArray = a.originKey.split(',');
|
|
74515
|
+
const bArray = b.originKey.split(',');
|
|
74516
|
+
const aLength = aArray.length;
|
|
74517
|
+
const bLength = bArray.length;
|
|
74518
|
+
const minLength = Math.min(aLength, bLength);
|
|
74519
|
+
for (let i = 0; i < minLength; i++) {
|
|
74520
|
+
const aIndex = Number(aArray[i]);
|
|
74521
|
+
const bIndex = Number(bArray[i]);
|
|
74522
|
+
if (aIndex !== bIndex) {
|
|
74523
|
+
return -aIndex + bIndex;
|
|
74524
|
+
}
|
|
74525
|
+
}
|
|
74526
|
+
return -aLength + bLength;
|
|
74527
|
+
});
|
|
74528
|
+
targetResult.forEach(({ originKey, targetKey, value }) => {
|
|
74529
|
+
checkedState.delete(originKey);
|
|
74530
|
+
if (targetKey) {
|
|
74531
|
+
checkedState.set(targetKey, value);
|
|
74532
|
+
}
|
|
74533
|
+
});
|
|
74534
|
+
}
|
|
74535
|
+
else {
|
|
74536
|
+
const length = checkedState.size;
|
|
74537
|
+
for (let key = length - 1; key >= recordIndex; key--) {
|
|
74538
|
+
const record = checkedState.get(key.toString());
|
|
74539
|
+
checkedState.delete(key.toString());
|
|
74540
|
+
checkedState.set((key + count).toString(), record);
|
|
74541
|
+
}
|
|
74542
|
+
}
|
|
74543
|
+
}
|
|
74296
74544
|
|
|
74297
74545
|
function fixUpdateRowRange(diffPositions, col, row, table) {
|
|
74298
74546
|
const updateCells = [{ col, row }];
|
|
@@ -75422,21 +75670,6 @@
|
|
|
75422
75670
|
}
|
|
75423
75671
|
return this.dataSource.getTableIndex(index);
|
|
75424
75672
|
}
|
|
75425
|
-
_parseColumnWidthConfig(columnWidthConfig) {
|
|
75426
|
-
for (let i = 0; i < columnWidthConfig?.length; i++) {
|
|
75427
|
-
const item = columnWidthConfig[i];
|
|
75428
|
-
const key = item.key;
|
|
75429
|
-
const width = item.width;
|
|
75430
|
-
const columnData = this.internalProps.layoutMap.getColumnByKey(key);
|
|
75431
|
-
if (columnData.columnDefine) {
|
|
75432
|
-
const { col } = columnData;
|
|
75433
|
-
if (!this.internalProps._widthResizedColMap.has(col)) {
|
|
75434
|
-
this._setColWidth(col, width);
|
|
75435
|
-
this.internalProps._widthResizedColMap.add(col);
|
|
75436
|
-
}
|
|
75437
|
-
}
|
|
75438
|
-
}
|
|
75439
|
-
}
|
|
75440
75673
|
release() {
|
|
75441
75674
|
this.editorManager.release();
|
|
75442
75675
|
super.release();
|
|
@@ -88276,60 +88509,6 @@
|
|
|
88276
88509
|
});
|
|
88277
88510
|
}
|
|
88278
88511
|
}
|
|
88279
|
-
_parseColumnWidthConfig(columnWidthConfig) {
|
|
88280
|
-
for (let i = 0; i < columnWidthConfig?.length; i++) {
|
|
88281
|
-
const item = columnWidthConfig[i];
|
|
88282
|
-
const dimensions = item.dimensions;
|
|
88283
|
-
const width = item.width;
|
|
88284
|
-
const cell = this.getCellAddressByHeaderPaths(dimensions);
|
|
88285
|
-
if (cell && cell.col >= this.rowHeaderLevelCount) {
|
|
88286
|
-
const cellPath = this.getCellHeaderPaths(cell.col, this.columnHeaderLevelCount);
|
|
88287
|
-
if (cellPath.colHeaderPaths.length === dimensions.length) {
|
|
88288
|
-
let match = true;
|
|
88289
|
-
for (let i = 0; i < dimensions.length; i++) {
|
|
88290
|
-
const dimension = dimensions[i];
|
|
88291
|
-
const finded = cellPath.colHeaderPaths.findIndex((colPath, index) => {
|
|
88292
|
-
if (colPath.indicatorKey === dimension.indicatorKey) {
|
|
88293
|
-
return true;
|
|
88294
|
-
}
|
|
88295
|
-
if (colPath.dimensionKey === dimension.dimensionKey && colPath.value === dimension.value) {
|
|
88296
|
-
return true;
|
|
88297
|
-
}
|
|
88298
|
-
return false;
|
|
88299
|
-
});
|
|
88300
|
-
if (finded < 0) {
|
|
88301
|
-
match = false;
|
|
88302
|
-
break;
|
|
88303
|
-
}
|
|
88304
|
-
}
|
|
88305
|
-
if (match && !this.internalProps._widthResizedColMap.has(cell.col)) {
|
|
88306
|
-
this._setColWidth(cell.col, width);
|
|
88307
|
-
this.internalProps._widthResizedColMap.add(cell.col);
|
|
88308
|
-
}
|
|
88309
|
-
}
|
|
88310
|
-
}
|
|
88311
|
-
else if (cell && cell.col < this.rowHeaderLevelCount) {
|
|
88312
|
-
if (!this.internalProps._widthResizedColMap.has(cell.col)) {
|
|
88313
|
-
this._setColWidth(cell.col, width);
|
|
88314
|
-
this.internalProps._widthResizedColMap.add(cell.col);
|
|
88315
|
-
}
|
|
88316
|
-
}
|
|
88317
|
-
}
|
|
88318
|
-
}
|
|
88319
|
-
_parseColumnWidthConfigForRowHeader(columnWidthConfig) {
|
|
88320
|
-
for (let i = 0; i < columnWidthConfig?.length; i++) {
|
|
88321
|
-
const item = columnWidthConfig[i];
|
|
88322
|
-
const dimensions = item.dimensions;
|
|
88323
|
-
const width = item.width;
|
|
88324
|
-
const cell = this.getCellAddressByHeaderPaths(dimensions);
|
|
88325
|
-
if (cell && cell.col < this.rowHeaderLevelCount) {
|
|
88326
|
-
if (!this.internalProps._widthResizedColMap.has(cell.col)) {
|
|
88327
|
-
this._setColWidth(cell.col, width);
|
|
88328
|
-
this.internalProps._widthResizedColMap.add(cell.col);
|
|
88329
|
-
}
|
|
88330
|
-
}
|
|
88331
|
-
}
|
|
88332
|
-
}
|
|
88333
88512
|
updatePivotSortState(pivotSortStateConfig) {
|
|
88334
88513
|
this.pivotSortState = pivotSortStateConfig;
|
|
88335
88514
|
}
|
|
@@ -89201,6 +89380,8 @@
|
|
|
89201
89380
|
this.internalProps.columnResizeType = options.resize?.columnResizeType ?? options.columnResizeType ?? 'column';
|
|
89202
89381
|
this.internalProps.rowResizeType = options.resize?.rowResizeType ?? options.rowResizeType ?? 'row';
|
|
89203
89382
|
this.internalProps.dataConfig = { isPivotChart: true };
|
|
89383
|
+
this.internalProps.columnWidthConfig = options.columnWidthConfig;
|
|
89384
|
+
this.internalProps.columnWidthConfigForRowHeader = options.columnWidthConfigForRowHeader;
|
|
89204
89385
|
this._axes = isArray$7(options.axes) ? options.axes : [];
|
|
89205
89386
|
let columnDimensionTree;
|
|
89206
89387
|
let rowDimensionTree;
|
|
@@ -89361,6 +89542,8 @@
|
|
|
89361
89542
|
internalProps.columnResizeType = options.resize?.columnResizeType ?? options.columnResizeType ?? 'column';
|
|
89362
89543
|
internalProps.rowResizeType = options.resize?.rowResizeType ?? options.rowResizeType ?? 'row';
|
|
89363
89544
|
internalProps.dataConfig = { isPivotChart: true };
|
|
89545
|
+
this.internalProps.columnWidthConfig = options.columnWidthConfig;
|
|
89546
|
+
this.internalProps.columnWidthConfigForRowHeader = options.columnWidthConfigForRowHeader;
|
|
89364
89547
|
this._axes = isArray$7(options.axes) ? options.axes : [];
|
|
89365
89548
|
let columnDimensionTree;
|
|
89366
89549
|
let rowDimensionTree;
|
|
@@ -90867,7 +91050,7 @@
|
|
|
90867
91050
|
}
|
|
90868
91051
|
|
|
90869
91052
|
registerForVrender();
|
|
90870
|
-
const version = "1.19.
|
|
91053
|
+
const version = "1.19.6";
|
|
90871
91054
|
function getIcons() {
|
|
90872
91055
|
return get$2();
|
|
90873
91056
|
}
|