@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.
Files changed (47) hide show
  1. package/cjs/ListTable.js +1 -1
  2. package/cjs/ListTable.js.map +1 -1
  3. package/cjs/PivotTable.js +1 -1
  4. package/cjs/PivotTable.js.map +1 -1
  5. package/cjs/core/BaseTable.js +1 -1
  6. package/cjs/core/BaseTable.js.map +1 -1
  7. package/cjs/index.d.ts +1 -1
  8. package/cjs/index.js +1 -1
  9. package/cjs/index.js.map +1 -1
  10. package/cjs/scenegraph/debug-tool/debug-tool.js.map +1 -1
  11. package/cjs/scenegraph/graphic/chart.js +1 -1
  12. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  13. package/cjs/scenegraph/refresh-node/update-chart.js +75 -29
  14. package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
  15. package/cjs/scenegraph/scenegraph.d.ts +1 -1
  16. package/cjs/scenegraph/scenegraph.js +3 -3
  17. package/cjs/scenegraph/scenegraph.js.map +1 -1
  18. package/cjs/state/resize/update-resize-row.js +1 -1
  19. package/cjs/state/resize/update-resize-row.js.map +1 -1
  20. package/cjs/state/state.js +1 -1
  21. package/cjs/state/state.js.map +1 -1
  22. package/cjs/vrender.js.map +1 -1
  23. package/dist/vtable.js +147 -58
  24. package/dist/vtable.min.js +2 -2
  25. package/es/ListTable.js +1 -1
  26. package/es/ListTable.js.map +1 -1
  27. package/es/PivotTable.js +1 -1
  28. package/es/PivotTable.js.map +1 -1
  29. package/es/core/BaseTable.js +1 -1
  30. package/es/core/BaseTable.js.map +1 -1
  31. package/es/index.d.ts +1 -1
  32. package/es/index.js +1 -1
  33. package/es/index.js.map +1 -1
  34. package/es/scenegraph/debug-tool/debug-tool.js.map +1 -1
  35. package/es/scenegraph/graphic/chart.js +1 -1
  36. package/es/scenegraph/graphic/chart.js.map +1 -1
  37. package/es/scenegraph/refresh-node/update-chart.js +75 -29
  38. package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
  39. package/es/scenegraph/scenegraph.d.ts +1 -1
  40. package/es/scenegraph/scenegraph.js +3 -3
  41. package/es/scenegraph/scenegraph.js.map +1 -1
  42. package/es/state/resize/update-resize-row.js +1 -1
  43. package/es/state/resize/update-resize-row.js.map +1 -1
  44. package/es/state/state.js +1 -1
  45. package/es/state/state.js.map +1 -1
  46. package/es/vrender.js.map +1 -1
  47. 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
- for (let c = col; c <= scenegraph.proxy.colEnd; c++) {
60063
- const columnGroup = scenegraph.getColGroup(c);
60064
- columnGroup?.getChildren()?.forEach((cellNode) => {
60065
- const width = scenegraph.table.getColWidth(cellNode.col);
60066
- const height = scenegraph.table.getRowHeight(cellNode.row);
60067
- cellNode.children.forEach((node) => {
60068
- if (node.type === 'chart') {
60069
- node.cacheCanvas = null;
60070
- node.setAttribute('width', Math.ceil(width - node.attribute.cellPadding[3] - node.attribute.cellPadding[1]));
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
- if (!scenegraph.table.isPivotChart() && scenegraph.table.rightFrozenColCount >= 1) {
60077
- for (let c = scenegraph.table.colCount - scenegraph.table.rightFrozenColCount; c <= scenegraph.table.colCount - 1; c++) {
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?.getChildren()?.forEach((cellNode) => {
60080
- const width = scenegraph.table.getColWidth(cellNode.col);
60081
- const height = scenegraph.table.getRowHeight(cellNode.row);
60082
- cellNode.children.forEach((node) => {
60083
- if (node.type === 'chart') {
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 updateCellNode = (c, r) => {
60095
- const cellNode = scenegraph.getCell(c, r);
60096
- const width = scenegraph.table.getColWidth(cellNode.col);
60097
- const height = scenegraph.table.getRowHeight(cellNode.row);
60098
- cellNode.children.forEach((node) => {
60099
- if (node.type === 'chart') {
60100
- node.cacheCanvas = null;
60101
- node.setAttribute('width', Math.ceil(width - node.attribute.cellPadding[3] - node.attribute.cellPadding[1]));
60102
- node.setAttribute('height', Math.ceil(height - node.attribute.cellPadding[0] - node.attribute.cellPadding[2]));
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
- if (scenegraph.table.rightFrozenColCount >= 1) {
60112
- for (let c = scenegraph.table.colCount - scenegraph.table.rightFrozenColCount; c <= scenegraph.table.colCount - 1; c++) {
60113
- for (let r = row; r <= scenegraph.proxy.rowEnd; r++) {
60114
- updateCellNode(c, r);
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
- if (scenegraph.table.frozenColCount >= 1) {
60119
- for (let c = 0; c <= scenegraph.table.frozenColCount - 1; c++) {
60120
- for (let r = row; r <= scenegraph.proxy.rowEnd; r++) {
60121
- updateCellNode(c, r);
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(col) {
61417
- updateChartSizeForResizeRowHeight(this, col);
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(this.table.rowHeaderLevelCount);
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.colCount - 1) {
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.updateChartSizeForResizeColWidth(this.rowResize.row);
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.5-beta.0";
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(0);
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(0);
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.5-beta.0";
89376
+ const version = "1.5.6";
89288
89377
  function getIcons() {
89289
89378
  return get$2();
89290
89379
  }