@visactor/vtable 1.5.5-beta.0 → 1.5.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.js +1 -1
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotTable.js +1 -1
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/core/BaseTable.js +1 -1
- package/cjs/core/BaseTable.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/debug-tool/debug-tool.js.map +1 -1
- package/cjs/scenegraph/graphic/chart.js +1 -1
- package/cjs/scenegraph/graphic/chart.js.map +1 -1
- package/cjs/scenegraph/refresh-node/update-chart.js +75 -29
- package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +1 -1
- package/cjs/scenegraph/scenegraph.js +3 -3
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/state/resize/update-resize-row.js +1 -1
- package/cjs/state/resize/update-resize-row.js.map +1 -1
- package/cjs/state/state.js +1 -1
- package/cjs/state/state.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +147 -58
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.js +1 -1
- package/es/ListTable.js.map +1 -1
- package/es/PivotTable.js +1 -1
- package/es/PivotTable.js.map +1 -1
- package/es/core/BaseTable.js +1 -1
- package/es/core/BaseTable.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/debug-tool/debug-tool.js.map +1 -1
- package/es/scenegraph/graphic/chart.js +1 -1
- package/es/scenegraph/graphic/chart.js.map +1 -1
- package/es/scenegraph/refresh-node/update-chart.js +75 -29
- package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
- package/es/scenegraph/scenegraph.d.ts +1 -1
- package/es/scenegraph/scenegraph.js +3 -3
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/state/resize/update-resize-row.js +1 -1
- package/es/state/resize/update-resize-row.js.map +1 -1
- package/es/state/state.js +1 -1
- package/es/state/state.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +5 -5
package/dist/vtable.js
CHANGED
|
@@ -54819,7 +54819,7 @@
|
|
|
54819
54819
|
ctx.rect(clipBound.x1, clipBound.y1, clipBound.x2 - clipBound.x1, clipBound.y2 - clipBound.y1);
|
|
54820
54820
|
ctx.clip();
|
|
54821
54821
|
ctx.clearMatrix();
|
|
54822
|
-
if (!chartStage.needRender) {
|
|
54822
|
+
if (table.options.canvas && !chartStage.needRender) {
|
|
54823
54823
|
chartStage.pauseRender();
|
|
54824
54824
|
table.scenegraph.stage.dirtyBounds.union(this.globalAABBBounds);
|
|
54825
54825
|
table.scenegraph.updateNextFrame();
|
|
@@ -60059,66 +60059,144 @@
|
|
|
60059
60059
|
}
|
|
60060
60060
|
|
|
60061
60061
|
function updateChartSizeForResizeColWidth(scenegraph, col) {
|
|
60062
|
-
|
|
60063
|
-
|
|
60064
|
-
|
|
60065
|
-
|
|
60066
|
-
|
|
60067
|
-
|
|
60068
|
-
|
|
60069
|
-
|
|
60070
|
-
|
|
60071
|
-
node.setAttribute('height', Math.ceil(height - node.attribute.cellPadding[0] - node.attribute.cellPadding[2]));
|
|
60072
|
-
}
|
|
60073
|
-
});
|
|
60062
|
+
const { table } = scenegraph;
|
|
60063
|
+
const layout = table.internalProps.layoutMap;
|
|
60064
|
+
const columnResizeType = col === -1 ? 'all' : table.internalProps.columnResizeType;
|
|
60065
|
+
if (columnResizeType === 'column') {
|
|
60066
|
+
const columnGroup = scenegraph.getColGroup(col);
|
|
60067
|
+
columnGroup?.forEachChildren((cellNode) => {
|
|
60068
|
+
const width = table.getColWidth(cellNode.col);
|
|
60069
|
+
const height = table.getRowHeight(cellNode.row);
|
|
60070
|
+
updateChartGraphicSize(cellNode, width, height);
|
|
60074
60071
|
});
|
|
60072
|
+
if (table.widthMode === 'adaptive' && col < table.colCount - 1) {
|
|
60073
|
+
const columnGroup = scenegraph.getColGroup(col + 1);
|
|
60074
|
+
columnGroup?.forEachChildren((cellNode) => {
|
|
60075
|
+
const width = table.getColWidth(cellNode.col);
|
|
60076
|
+
const height = table.getRowHeight(cellNode.row);
|
|
60077
|
+
updateChartGraphicSize(cellNode, width, height);
|
|
60078
|
+
});
|
|
60079
|
+
}
|
|
60075
60080
|
}
|
|
60076
|
-
|
|
60077
|
-
|
|
60081
|
+
else {
|
|
60082
|
+
let startCol = table.rowHeaderLevelCount;
|
|
60083
|
+
let endCol = table.colCount - 1;
|
|
60084
|
+
let resizeIndicatorKey;
|
|
60085
|
+
let resizeDimensionKey;
|
|
60086
|
+
let resizeDimensionValue;
|
|
60087
|
+
if (columnResizeType === 'indicator') {
|
|
60088
|
+
if (layout.indicatorsAsCol) {
|
|
60089
|
+
resizeIndicatorKey = layout.getIndicatorKey(col, table.columnHeaderLevelCount);
|
|
60090
|
+
}
|
|
60091
|
+
else {
|
|
60092
|
+
const headerPaths = layout.getCellHeaderPaths(col, table.columnHeaderLevelCount - 1);
|
|
60093
|
+
const headerPath = headerPaths.colHeaderPaths[headerPaths.colHeaderPaths.length - 1];
|
|
60094
|
+
resizeDimensionKey = headerPath.dimensionKey;
|
|
60095
|
+
resizeDimensionValue = headerPath.value;
|
|
60096
|
+
}
|
|
60097
|
+
}
|
|
60098
|
+
else if (columnResizeType === 'indicatorGroup') {
|
|
60099
|
+
const layout = table.internalProps.layoutMap;
|
|
60100
|
+
const headerPaths = layout.getCellHeaderPaths(table.stateManager.columnResize.col, table.columnHeaderLevelCount);
|
|
60101
|
+
const node = layout.getHeadNodeByRowOrColDimensions(headerPaths.colHeaderPaths.slice(0, headerPaths.colHeaderPaths.length - 1));
|
|
60102
|
+
startCol = node.startInTotal + table.frozenColCount;
|
|
60103
|
+
endCol = node.startInTotal + table.frozenColCount + node.size - 1;
|
|
60104
|
+
}
|
|
60105
|
+
for (let c = startCol; c <= endCol; c++) {
|
|
60078
60106
|
const columnGroup = scenegraph.getColGroup(c);
|
|
60079
|
-
columnGroup
|
|
60080
|
-
|
|
60081
|
-
|
|
60082
|
-
|
|
60083
|
-
|
|
60084
|
-
node.cacheCanvas = null;
|
|
60085
|
-
node.setAttribute('width', Math.ceil(width - node.attribute.cellPadding[3] - node.attribute.cellPadding[1]));
|
|
60086
|
-
node.setAttribute('height', Math.ceil(height - node.attribute.cellPadding[0] - node.attribute.cellPadding[2]));
|
|
60107
|
+
if (columnGroup) {
|
|
60108
|
+
if (columnResizeType === 'indicator') {
|
|
60109
|
+
const indicatorKey = layout.getIndicatorKey(c, table.columnHeaderLevelCount);
|
|
60110
|
+
if (layout.indicatorsAsCol && indicatorKey !== resizeIndicatorKey) {
|
|
60111
|
+
continue;
|
|
60087
60112
|
}
|
|
60113
|
+
else if (!layout.indicatorsAsCol) {
|
|
60114
|
+
const headerPaths = layout.getCellHeaderPaths(c, table.columnHeaderLevelCount - 1);
|
|
60115
|
+
const headerPath = headerPaths?.colHeaderPaths[headerPaths.colHeaderPaths.length - 1];
|
|
60116
|
+
if (!headerPath ||
|
|
60117
|
+
resizeDimensionKey !== headerPath.dimensionKey ||
|
|
60118
|
+
resizeDimensionValue !== headerPath.value) {
|
|
60119
|
+
continue;
|
|
60120
|
+
}
|
|
60121
|
+
}
|
|
60122
|
+
}
|
|
60123
|
+
columnGroup.forEachChildren((cellNode) => {
|
|
60124
|
+
const width = table.getColWidth(cellNode.col);
|
|
60125
|
+
const height = table.getRowHeight(cellNode.row);
|
|
60126
|
+
updateChartGraphicSize(cellNode, width, height);
|
|
60088
60127
|
});
|
|
60089
|
-
}
|
|
60128
|
+
}
|
|
60090
60129
|
}
|
|
60091
60130
|
}
|
|
60092
60131
|
}
|
|
60093
60132
|
function updateChartSizeForResizeRowHeight(scenegraph, row) {
|
|
60094
|
-
const
|
|
60095
|
-
|
|
60096
|
-
|
|
60097
|
-
|
|
60098
|
-
|
|
60099
|
-
|
|
60100
|
-
|
|
60101
|
-
|
|
60102
|
-
|
|
60103
|
-
|
|
60104
|
-
|
|
60105
|
-
|
|
60106
|
-
for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {
|
|
60107
|
-
for (let r = row; r <= scenegraph.proxy.rowEnd; r++) {
|
|
60108
|
-
updateCellNode(c, r);
|
|
60133
|
+
const { table } = scenegraph;
|
|
60134
|
+
const layout = table.internalProps.layoutMap;
|
|
60135
|
+
const state = table.stateManager;
|
|
60136
|
+
const rowResizeType = row === -1 ? 'all' : table.internalProps.rowResizeType;
|
|
60137
|
+
let startRow = table.columnHeaderLevelCount;
|
|
60138
|
+
let endRow = table.rowCount - 1;
|
|
60139
|
+
let resizeIndicatorKey;
|
|
60140
|
+
let resizeDimensionKey;
|
|
60141
|
+
let resizeDimensionValue;
|
|
60142
|
+
if (rowResizeType === 'indicator') {
|
|
60143
|
+
if (!layout.indicatorsAsCol) {
|
|
60144
|
+
resizeIndicatorKey = layout.getIndicatorKey(table.rowHeaderLevelCount, row);
|
|
60109
60145
|
}
|
|
60110
|
-
|
|
60111
|
-
|
|
60112
|
-
|
|
60113
|
-
|
|
60114
|
-
|
|
60146
|
+
else {
|
|
60147
|
+
const headerPaths = layout.getCellHeaderPaths(table.rowHeaderLevelCount - 1, row);
|
|
60148
|
+
const headerPath = headerPaths.rowHeaderPaths?.[headerPaths.rowHeaderPaths.length - 1];
|
|
60149
|
+
resizeDimensionKey = headerPath?.dimensionKey;
|
|
60150
|
+
resizeDimensionValue = headerPath?.value;
|
|
60151
|
+
}
|
|
60152
|
+
}
|
|
60153
|
+
else if (rowResizeType === 'indicatorGroup') {
|
|
60154
|
+
const layout = table.internalProps.layoutMap;
|
|
60155
|
+
const headerPaths = layout.getCellHeaderPaths(table.rowHeaderLevelCount, row);
|
|
60156
|
+
const node = layout.getHeadNodeByRowOrColDimensions(headerPaths.rowHeaderPaths.slice(0, headerPaths.rowHeaderPaths.length - 1));
|
|
60157
|
+
startRow = node.startInTotal + table.frozenRowCount;
|
|
60158
|
+
endRow = node.startInTotal + table.frozenRowCount + node.size - 1;
|
|
60159
|
+
}
|
|
60160
|
+
for (let col = scenegraph.proxy.colStart; col <= scenegraph.proxy.colEnd; col++) {
|
|
60161
|
+
if (rowResizeType === 'row') {
|
|
60162
|
+
const cellNode = scenegraph.highPerformanceGetCell(col, row);
|
|
60163
|
+
if (cellNode.role !== 'cell') {
|
|
60164
|
+
continue;
|
|
60165
|
+
}
|
|
60166
|
+
const width = table.getColWidth(cellNode.col);
|
|
60167
|
+
const height = table.getRowHeight(cellNode.row);
|
|
60168
|
+
updateChartGraphicSize(cellNode, width, height);
|
|
60169
|
+
if (table.heightMode === 'adaptive' && row < table.rowCount - 1) {
|
|
60170
|
+
const cellNode = scenegraph.highPerformanceGetCell(col, row + 1);
|
|
60171
|
+
const width = table.getColWidth(cellNode.col);
|
|
60172
|
+
const height = table.getRowHeight(cellNode.row);
|
|
60173
|
+
updateChartGraphicSize(cellNode, width, height);
|
|
60115
60174
|
}
|
|
60116
60175
|
}
|
|
60117
|
-
|
|
60118
|
-
|
|
60119
|
-
|
|
60120
|
-
|
|
60121
|
-
|
|
60176
|
+
else {
|
|
60177
|
+
for (let r = startRow; r <= endRow; r++) {
|
|
60178
|
+
if (rowResizeType === 'indicator') {
|
|
60179
|
+
const indicatorKey = layout.getIndicatorKey(state.table.rowHeaderLevelCount, r);
|
|
60180
|
+
if (!layout.indicatorsAsCol && indicatorKey !== resizeIndicatorKey) {
|
|
60181
|
+
continue;
|
|
60182
|
+
}
|
|
60183
|
+
else if (layout.indicatorsAsCol) {
|
|
60184
|
+
const headerPaths = layout.getCellHeaderPaths(state.table.rowHeaderLevelCount - 1, r);
|
|
60185
|
+
const headerPath = headerPaths?.rowHeaderPaths[headerPaths.rowHeaderPaths.length - 1];
|
|
60186
|
+
if (!headerPath ||
|
|
60187
|
+
resizeDimensionKey !== headerPath.dimensionKey ||
|
|
60188
|
+
resizeDimensionValue !== headerPath.value) {
|
|
60189
|
+
continue;
|
|
60190
|
+
}
|
|
60191
|
+
}
|
|
60192
|
+
}
|
|
60193
|
+
const cellNode = scenegraph.highPerformanceGetCell(col, r);
|
|
60194
|
+
if (cellNode.role !== 'cell') {
|
|
60195
|
+
continue;
|
|
60196
|
+
}
|
|
60197
|
+
const width = table.getColWidth(cellNode.col);
|
|
60198
|
+
const height = table.getRowHeight(cellNode.row);
|
|
60199
|
+
updateChartGraphicSize(cellNode, width, height);
|
|
60122
60200
|
}
|
|
60123
60201
|
}
|
|
60124
60202
|
}
|
|
@@ -60235,6 +60313,17 @@
|
|
|
60235
60313
|
}
|
|
60236
60314
|
});
|
|
60237
60315
|
}
|
|
60316
|
+
function updateChartGraphicSize(cellNode, width, height) {
|
|
60317
|
+
cellNode.forEachChildren((graphic) => {
|
|
60318
|
+
if (graphic.type === 'chart') {
|
|
60319
|
+
graphic.cacheCanvas = null;
|
|
60320
|
+
graphic.setAttributes({
|
|
60321
|
+
width: Math.ceil(width - graphic.attribute.cellPadding[3] - graphic.attribute.cellPadding[1]),
|
|
60322
|
+
height: Math.ceil(height - graphic.attribute.cellPadding[0] - graphic.attribute.cellPadding[2])
|
|
60323
|
+
});
|
|
60324
|
+
}
|
|
60325
|
+
});
|
|
60326
|
+
}
|
|
60238
60327
|
|
|
60239
60328
|
function initSceneGraph(scene) {
|
|
60240
60329
|
const width = scene.table.tableNoFrameWidth;
|
|
@@ -61413,8 +61502,8 @@
|
|
|
61413
61502
|
updateChartSizeForResizeColWidth(col) {
|
|
61414
61503
|
updateChartSizeForResizeColWidth(this, col);
|
|
61415
61504
|
}
|
|
61416
|
-
updateChartSizeForResizeRowHeight(
|
|
61417
|
-
updateChartSizeForResizeRowHeight(this,
|
|
61505
|
+
updateChartSizeForResizeRowHeight(row) {
|
|
61506
|
+
updateChartSizeForResizeRowHeight(this, row);
|
|
61418
61507
|
}
|
|
61419
61508
|
updateChartState(datum) {
|
|
61420
61509
|
this.table.isPivotChart() && updateChartState(this, datum);
|
|
@@ -61550,7 +61639,7 @@
|
|
|
61550
61639
|
this.table.heightMode === 'adaptive' ||
|
|
61551
61640
|
this.table.autoFillWidth ||
|
|
61552
61641
|
this.table.autoFillHeight) {
|
|
61553
|
-
this.updateChartSizeForResizeColWidth(
|
|
61642
|
+
this.updateChartSizeForResizeColWidth(-1);
|
|
61554
61643
|
}
|
|
61555
61644
|
this.proxy.progress();
|
|
61556
61645
|
this.updateNextFrame();
|
|
@@ -63818,7 +63907,7 @@
|
|
|
63818
63907
|
state.table.scenegraph.updateNextFrame();
|
|
63819
63908
|
}
|
|
63820
63909
|
function updateResizeColForRow(detaY, state) {
|
|
63821
|
-
if (state.table.heightMode === 'adaptive' && state.rowResize.row < state.table.
|
|
63910
|
+
if (state.table.heightMode === 'adaptive' && state.rowResize.row < state.table.rowCount - 1) {
|
|
63822
63911
|
state.table.scenegraph.updateRowHeight(state.rowResize.row, detaY);
|
|
63823
63912
|
state.table.scenegraph.updateRowHeight(state.rowResize.row + 1, -detaY);
|
|
63824
63913
|
state.table.internalProps._heightResizedRowMap.add(state.rowResize.row);
|
|
@@ -64305,7 +64394,7 @@
|
|
|
64305
64394
|
setTimeout(() => {
|
|
64306
64395
|
this.rowResize.resizing = false;
|
|
64307
64396
|
}, 0);
|
|
64308
|
-
this.table.scenegraph.
|
|
64397
|
+
this.table.scenegraph.updateChartSizeForResizeRowHeight(this.rowResize.row);
|
|
64309
64398
|
this.table.scenegraph.component.hideResizeRow();
|
|
64310
64399
|
this.table.scenegraph.updateNextFrame();
|
|
64311
64400
|
}
|
|
@@ -70723,7 +70812,7 @@
|
|
|
70723
70812
|
return TABLE_EVENT_TYPE;
|
|
70724
70813
|
}
|
|
70725
70814
|
options;
|
|
70726
|
-
version = "1.5.
|
|
70815
|
+
version = "1.5.6";
|
|
70727
70816
|
pagination;
|
|
70728
70817
|
id = `VTable${Date.now()}`;
|
|
70729
70818
|
headerStyleCache;
|
|
@@ -76532,7 +76621,7 @@
|
|
|
76532
76621
|
notFillHeight = this.getAllRowsHeight() <= this.tableNoFrameHeight;
|
|
76533
76622
|
}
|
|
76534
76623
|
if (this.widthMode === 'adaptive' || notFillWidth || this.heightMode === 'adaptive' || notFillHeight) {
|
|
76535
|
-
this.scenegraph.updateChartSizeForResizeColWidth(
|
|
76624
|
+
this.scenegraph.updateChartSizeForResizeColWidth(-1);
|
|
76536
76625
|
}
|
|
76537
76626
|
}
|
|
76538
76627
|
}
|
|
@@ -87184,7 +87273,7 @@
|
|
|
87184
87273
|
notFillHeight = this.getAllRowsHeight() <= this.tableNoFrameHeight;
|
|
87185
87274
|
}
|
|
87186
87275
|
if (this.widthMode === 'adaptive' || notFillWidth || this.heightMode === 'adaptive' || notFillHeight) {
|
|
87187
|
-
this.scenegraph.updateChartSizeForResizeColWidth(
|
|
87276
|
+
this.scenegraph.updateChartSizeForResizeColWidth(-1);
|
|
87188
87277
|
}
|
|
87189
87278
|
}
|
|
87190
87279
|
}
|
|
@@ -89284,7 +89373,7 @@
|
|
|
89284
89373
|
}
|
|
89285
89374
|
|
|
89286
89375
|
registerForVrender();
|
|
89287
|
-
const version = "1.5.
|
|
89376
|
+
const version = "1.5.6";
|
|
89288
89377
|
function getIcons() {
|
|
89289
89378
|
return get$2();
|
|
89290
89379
|
}
|