@visactor/vtable 0.12.1 → 0.12.3-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/cjs/ListTable.js +9 -7
  2. package/cjs/ListTable.js.map +1 -1
  3. package/cjs/PivotTable.js +2 -2
  4. package/cjs/PivotTable.js.map +1 -1
  5. package/cjs/core/BaseTable.d.ts +1 -0
  6. package/cjs/core/BaseTable.js +4 -1
  7. package/cjs/core/BaseTable.js.map +1 -1
  8. package/cjs/core/TABLE_EVENT_TYPE.d.ts +2 -1
  9. package/cjs/core/TABLE_EVENT_TYPE.js +2 -1
  10. package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
  11. package/cjs/dataset/flatDataToObject.js +2 -1
  12. package/cjs/event/event.js +2 -3
  13. package/cjs/event/event.js.map +1 -1
  14. package/cjs/event/sparkline-event.js +1 -2
  15. package/cjs/index.d.ts +1 -1
  16. package/cjs/index.js +1 -1
  17. package/cjs/index.js.map +1 -1
  18. package/cjs/scenegraph/group-creater/progress/proxy.js +8 -7
  19. package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
  20. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +3 -3
  21. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  22. package/cjs/scenegraph/group-creater/progress/update-position/util.d.ts +1 -1
  23. package/cjs/scenegraph/group-creater/progress/update-position/util.js +10 -5
  24. package/cjs/scenegraph/group-creater/progress/update-position/util.js.map +1 -1
  25. package/cjs/scenegraph/scenegraph.js +1 -1
  26. package/cjs/scenegraph/scenegraph.js.map +1 -1
  27. package/cjs/scenegraph/stick-text/index.js +20 -18
  28. package/cjs/scenegraph/stick-text/index.js.map +1 -1
  29. package/cjs/themes/DARK.js +1 -1
  30. package/cjs/themes/DARK.js.map +1 -1
  31. package/cjs/themes/SIMPLIFY.js +1 -1
  32. package/cjs/themes/SIMPLIFY.js.map +1 -1
  33. package/cjs/ts-types/base-table.js.map +1 -1
  34. package/cjs/ts-types/events.d.ts +4 -2
  35. package/cjs/ts-types/events.js.map +1 -1
  36. package/cjs/ts-types/new-data-set.js.map +1 -1
  37. package/cjs/ts-types/table-engine.js.map +1 -1
  38. package/dist/vtable.js +49 -30
  39. package/dist/vtable.min.js +2 -2
  40. package/es/ListTable.js +10 -7
  41. package/es/ListTable.js.map +1 -1
  42. package/es/PivotTable.js +2 -2
  43. package/es/PivotTable.js.map +1 -1
  44. package/es/core/BaseTable.d.ts +1 -0
  45. package/es/core/BaseTable.js +4 -1
  46. package/es/core/BaseTable.js.map +1 -1
  47. package/es/core/TABLE_EVENT_TYPE.d.ts +2 -1
  48. package/es/core/TABLE_EVENT_TYPE.js +2 -1
  49. package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
  50. package/es/dataset/flatDataToObject.js +2 -1
  51. package/es/event/event.js +2 -3
  52. package/es/event/event.js.map +1 -1
  53. package/es/event/sparkline-event.js +1 -2
  54. package/es/index.d.ts +1 -1
  55. package/es/index.js +1 -1
  56. package/es/index.js.map +1 -1
  57. package/es/scenegraph/group-creater/progress/proxy.js +8 -6
  58. package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
  59. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +3 -3
  60. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  61. package/es/scenegraph/group-creater/progress/update-position/util.d.ts +1 -1
  62. package/es/scenegraph/group-creater/progress/update-position/util.js +10 -5
  63. package/es/scenegraph/group-creater/progress/update-position/util.js.map +1 -1
  64. package/es/scenegraph/scenegraph.js +1 -1
  65. package/es/scenegraph/scenegraph.js.map +1 -1
  66. package/es/scenegraph/stick-text/index.js +20 -18
  67. package/es/scenegraph/stick-text/index.js.map +1 -1
  68. package/es/themes/DARK.js +1 -1
  69. package/es/themes/DARK.js.map +1 -1
  70. package/es/themes/SIMPLIFY.js +1 -1
  71. package/es/themes/SIMPLIFY.js.map +1 -1
  72. package/es/ts-types/base-table.js.map +1 -1
  73. package/es/ts-types/events.d.ts +4 -2
  74. package/es/ts-types/events.js.map +1 -1
  75. package/es/ts-types/new-data-set.js.map +1 -1
  76. package/es/ts-types/table-engine.js.map +1 -1
  77. package/package.json +4 -4
  78. package/cjs/components/axis/get-axis-attributes.d.ts +0 -151
  79. package/es/components/axis/get-axis-attributes.d.ts +0 -151
package/dist/vtable.js CHANGED
@@ -3043,7 +3043,8 @@
3043
3043
  LEGEND_CHANGE: 'legend_change',
3044
3044
  MOUSEENTER_AXIS: 'mouseenter_axis',
3045
3045
  MOUSELEAVE_AXIS: 'mouseleave_axis',
3046
- AFTER_STAGE_RENDER: 'after_stage_render'
3046
+ AFTER_RENDER: 'after_render',
3047
+ INITIALIZED: 'initialized'
3047
3048
  };
3048
3049
 
3049
3050
  const judgeType = (value) => {
@@ -3704,7 +3705,7 @@
3704
3705
  hoverBgColor: '#EEE'
3705
3706
  },
3706
3707
  selectionStyle: {
3707
- cellBgColor: '#29364D',
3708
+ cellBgColor: 'rgba(255, 255, 255, 0.1)',
3708
3709
  cellBorderColor: '#4284FF',
3709
3710
  cellBorderLineWidth: 2
3710
3711
  }
@@ -4024,7 +4025,7 @@
4024
4025
  lineColor: '#416EFF',
4025
4026
  bgColor: '#D9E2FF'
4026
4027
  },
4027
- selectionStyle: { cellBorderColor: '#FD5', cellBgColor: '#6FA8DC' }
4028
+ selectionStyle: { cellBorderColor: '#FD5', cellBgColor: 'rgba(111, 168, 220, 0.1)' }
4028
4029
  };
4029
4030
 
4030
4031
  const themes$2 = {};
@@ -43948,7 +43949,7 @@
43948
43949
  }
43949
43950
  }
43950
43951
  }
43951
- function checkFirstColMerge(col, scrolling, proxy) {
43952
+ function checkFirstColMerge(col, proxy) {
43952
43953
  for (let row = 0; row < proxy.table.rowCount; row++) {
43953
43954
  if ((row >= proxy.table.columnHeaderLevelCount && row < proxy.rowStart) ||
43954
43955
  (row > proxy.rowEnd && row < proxy.table.rowCount - proxy.table.bottomFrozenRowCount)) {
@@ -43964,6 +43965,11 @@
43964
43965
  newCellGroup.col = col;
43965
43966
  newCellGroup.row = row;
43966
43967
  newCellGroup.setAttribute('x', proxy.table.getColsWidth(proxy.table.rowHeaderLevelCount, range.start.col - 1) - oldCellGroup.parent.attribute.x);
43968
+ newCellGroup.setAttributes({
43969
+ x: proxy.table.getColsWidth(proxy.table.rowHeaderLevelCount, range.start.col - 1) -
43970
+ oldCellGroup.parent.attribute.x,
43971
+ y: proxy.table.getRowsHeight(0, range.start.row - 1) - oldCellGroup.parent.attribute.y
43972
+ });
43967
43973
  oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup);
43968
43974
  oldCellGroup.parent.removeChild(oldCellGroup);
43969
43975
  oldCellGroup.needUpdate = false;
@@ -43982,7 +43988,8 @@
43982
43988
  cellGroup.setAttributes({
43983
43989
  width: 0,
43984
43990
  height: proxy.table.getRowHeight(cellGroup.row),
43985
- y: proxy.table.getRowsHeight(proxy.table.columnHeaderLevelCount, cellGroup.row - 1)
43991
+ y: proxy.table.getRowsHeight(proxy.table.columnHeaderLevelCount, cellGroup.row - 1),
43992
+ x: 0
43986
43993
  });
43987
43994
  cellGroup.clear();
43988
43995
  }
@@ -43991,12 +43998,13 @@
43991
43998
  function clearHadMergedColumn(colStart, colEnd, row, proxy) {
43992
43999
  for (let col = colStart; col <= colEnd; col++) {
43993
44000
  const cellGroup = proxy.highPerformanceGetCell(col, row, true);
43994
- if (cellGroup.role !== 'shadow-cell' && cellGroup.role !== 'empty' && cellGroup.row !== colStart) {
44001
+ if (cellGroup.role !== 'shadow-cell' && cellGroup.role !== 'empty' && cellGroup.col !== colStart) {
43995
44002
  cellGroup.role = 'shadow-cell';
43996
44003
  cellGroup.setAttributes({
43997
44004
  width: 0,
43998
44005
  height: proxy.table.getRowHeight(cellGroup.row),
43999
- y: proxy.table.getRowsHeight(proxy.table.columnHeaderLevelCount, cellGroup.row - 1)
44006
+ y: proxy.table.getRowsHeight(0, cellGroup.row - 1),
44007
+ x: 0
44000
44008
  });
44001
44009
  cellGroup.clear();
44002
44010
  }
@@ -44120,8 +44128,8 @@
44120
44128
  const syncRightCol = distEndCol;
44121
44129
  proxy.colStart = direction === 'left' ? proxy.colStart + count : proxy.colStart - count;
44122
44130
  proxy.colEnd = direction === 'left' ? proxy.colEnd + count : proxy.colEnd - count;
44123
- checkFirstColMerge(distStartCol, true, proxy);
44124
44131
  updateColContent(syncLeftCol, syncRightCol, proxy);
44132
+ checkFirstColMerge(distStartCol, proxy);
44125
44133
  updateAutoColumn(syncLeftCol, syncRightCol, proxy.table, direction);
44126
44134
  const colGroup = proxy.table.scenegraph.getColGroup(screenLeftCol);
44127
44135
  const deltaX = screenLeftX - (colGroup.attribute.x + proxy.table.getFrozenColsWidth() + proxy.table.scenegraph.proxy.deltaX);
@@ -44143,8 +44151,8 @@
44143
44151
  const syncRightCol = distEndCol;
44144
44152
  proxy.colStart = distStartCol;
44145
44153
  proxy.colEnd = distEndCol;
44146
- checkFirstColMerge(distStartCol, false, proxy);
44147
44154
  updateColContent(syncLeftCol, syncRightCol, proxy);
44155
+ checkFirstColMerge(distStartCol, proxy);
44148
44156
  updateAutoColumn(syncLeftCol, syncRightCol, proxy.table, distEndCol > proxy.bodyRightCol - (proxy.colEnd - proxy.colStart + 1) ? 'right' : 'left');
44149
44157
  proxy.table.scenegraph.proxy.deltaX = 0;
44150
44158
  proxy.currentCol = direction === 'left' ? proxy.currentCol + count : proxy.currentCol - count;
@@ -44576,7 +44584,7 @@
44576
44584
  }
44577
44585
  }
44578
44586
  setParamsForColumn() {
44579
- this.bodyLeftCol = this.table.rowHeaderLevelCount;
44587
+ this.bodyLeftCol = this.table.frozenColCount;
44580
44588
  this.bodyRightCol = this.table.colCount - 1 - this.table.rightFrozenColCount;
44581
44589
  const totalActualBodyColCount = Math.min(this.colLimit, this.bodyRightCol - this.bodyLeftCol + 1);
44582
44590
  this.totalCol = this.bodyLeftCol + totalActualBodyColCount - 1;
@@ -44658,11 +44666,11 @@
44658
44666
  createRowCellGroup(onceCount) {
44659
44667
  const endRow = Math.min(this.totalRow, this.currentRow + onceCount);
44660
44668
  computeRowsHeight(this.table, this.currentRow + 1, endRow, false);
44661
- if (this.table.rowHeaderLevelCount) {
44669
+ if (this.table.frozenColCount) {
44662
44670
  let maxHeight = 0;
44663
- for (let col = 0; col < this.table.rowHeaderLevelCount; col++) {
44671
+ for (let col = 0; col < this.table.frozenColCount; col++) {
44664
44672
  const colGroup = this.table.scenegraph.getColGroup(col);
44665
- const cellLocation = 'rowHeader';
44673
+ const cellLocation = this.table.isListTable() ? 'body' : 'rowHeader';
44666
44674
  const { height } = createComplexColumn(colGroup, col, colGroup.attribute.width, this.currentRow + 1, endRow, this.table.scenegraph.mergeMap, this.table.internalProps.defaultRowHeight, this.table, cellLocation);
44667
44675
  maxHeight = Math.max(maxHeight, height);
44668
44676
  this.table.scenegraph.rowHeaderGroup.setAttribute('height', maxHeight);
@@ -44672,7 +44680,7 @@
44672
44680
  let maxHeight = 0;
44673
44681
  for (let col = this.table.colCount - this.table.rightFrozenColCount; col < this.table.colCount; col++) {
44674
44682
  const colGroup = this.table.scenegraph.getColGroup(col);
44675
- const cellLocation = 'rowHeader';
44683
+ const cellLocation = this.table.isListTable() ? 'body' : 'rowHeader';
44676
44684
  const { height } = createComplexColumn(colGroup, col, colGroup.attribute.width, this.currentRow + 1, endRow, this.table.scenegraph.mergeMap, this.table.internalProps.defaultRowHeight, this.table, cellLocation);
44677
44685
  maxHeight = Math.max(maxHeight, height);
44678
44686
  this.table.scenegraph.rightFrozenGroup.setAttribute('height', maxHeight);
@@ -44681,6 +44689,9 @@
44681
44689
  let maxHeight = 0;
44682
44690
  for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {
44683
44691
  const colGroup = this.table.scenegraph.getColGroup(col);
44692
+ if (!colGroup) {
44693
+ continue;
44694
+ }
44684
44695
  const cellLocation = 'body';
44685
44696
  const { height } = createComplexColumn(colGroup, col, colGroup.attribute.width, this.currentRow + 1, endRow, this.table.scenegraph.mergeMap, this.table.internalProps.defaultRowHeight, this.table, cellLocation);
44686
44697
  maxHeight = Math.max(maxHeight, height);
@@ -45350,6 +45361,9 @@
45350
45361
  const colEnd = table.getAllColsWidth() > table.tableNoFrameWidth
45351
45362
  ? table.getColAt(scrollLeft + table.tableNoFrameWidth - 1).col
45352
45363
  : table.colCount - 1;
45364
+ if (colEnd < 0 || rowEnd < 0) {
45365
+ return;
45366
+ }
45353
45367
  for (let row = 0; row < frozenRowCount; row++) {
45354
45368
  for (let col = colStart; col <= colEnd; col++) {
45355
45369
  if (table._getCellStyle(col, row)?.textStick) {
@@ -46149,7 +46163,7 @@
46149
46163
  enableLayout: true,
46150
46164
  pluginList: table.isPivotChart() ? ['poptipForText'] : undefined,
46151
46165
  afterRender: () => {
46152
- this.table.fireListeners('after_stage_render', null);
46166
+ this.table.fireListeners('after_render', null);
46153
46167
  }
46154
46168
  });
46155
46169
  this.stage.defaultLayer.setTheme({
@@ -49843,11 +49857,6 @@
49843
49857
  }
49844
49858
  const { eventArgs } = eventArgsSet;
49845
49859
  if (eventArgs) {
49846
- if (!this.table.isPivotChart() &&
49847
- eventArgsSet?.eventArgs?.target.type !== 'chart' &&
49848
- eventArgs.event.pointerType !== 'touch') {
49849
- this.table.stateManeger.updateHoverPos(-1, -1);
49850
- }
49851
49860
  if (this.table.isPivotChart() &&
49852
49861
  (eventArgsSet?.eventArgs?.target.name === 'axis-label' || eventArgsSet?.eventArgs?.target.type === 'chart')) {
49853
49862
  this.table.stateManeger.updateSelectPos(-1, -1);
@@ -52720,7 +52729,7 @@
52720
52729
  return TABLE_EVENT_TYPE;
52721
52730
  }
52722
52731
  options;
52723
- version = "0.12.1";
52732
+ version = "0.12.3-alpha.0";
52724
52733
  pagination;
52725
52734
  id = `VTable${Date.now()}`;
52726
52735
  headerStyleCache;
@@ -53548,6 +53557,9 @@
53548
53557
  render() {
53549
53558
  this.scenegraph.renderSceneGraph();
53550
53559
  }
53560
+ renderAsync() {
53561
+ this.scenegraph.updateNextFrame();
53562
+ }
53551
53563
  _toRelativeRect(absoluteRect) {
53552
53564
  const rect = absoluteRect.copy();
53553
53565
  const visibleRect = this.getVisibleRect();
@@ -55976,6 +55988,9 @@
55976
55988
  internalProps.title = new Title(options.title, this);
55977
55989
  this.scenegraph.resize();
55978
55990
  }
55991
+ setTimeout(() => {
55992
+ this.fireListeners(TABLE_EVENT_TYPE.INITIALIZED, null);
55993
+ }, 0);
55979
55994
  }
55980
55995
  isListTable() {
55981
55996
  return true;
@@ -55997,7 +56012,7 @@
55997
56012
  this.headerStyleCache = new Map();
55998
56013
  this.bodyStyleCache = new Map();
55999
56014
  this.scenegraph.createSceneGraph();
56000
- this.render();
56015
+ this.renderAsync();
56001
56016
  }
56002
56017
  get header() {
56003
56018
  return this.internalProps.columns;
@@ -56006,9 +56021,7 @@
56006
56021
  this.internalProps.columns = header;
56007
56022
  this.options.header = header;
56008
56023
  this.refreshHeader();
56009
- setTimeout(() => {
56010
- this.render();
56011
- }, 0);
56024
+ this.renderAsync();
56012
56025
  }
56013
56026
  get transpose() {
56014
56027
  return this.internalProps.transpose ?? false;
@@ -56023,10 +56036,13 @@
56023
56036
  this.internalProps.layoutMap.transpose = transpose;
56024
56037
  this.refreshRowColCount();
56025
56038
  this._resetFrozenColCount();
56026
- this.render();
56039
+ this.renderAsync();
56027
56040
  }
56028
56041
  }
56029
56042
  getCellValue(col, row) {
56043
+ if (col === -1 || row === -1) {
56044
+ return null;
56045
+ }
56030
56046
  const table = this;
56031
56047
  if (table.internalProps.layoutMap.isHeader(col, row)) {
56032
56048
  const { title } = table.internalProps.layoutMap.getHeader(col, row);
@@ -56036,6 +56052,9 @@
56036
56052
  return table.getFieldData(fieldFormat || field, col, row);
56037
56053
  }
56038
56054
  getCellOriginValue(col, row) {
56055
+ if (col === -1 || row === -1) {
56056
+ return null;
56057
+ }
56039
56058
  const table = this;
56040
56059
  if (table.internalProps.layoutMap.isHeader(col, row)) {
56041
56060
  const { title } = table.internalProps.layoutMap.getHeader(col, row);
@@ -56114,7 +56133,7 @@
56114
56133
  this.dataSource.updatePagination(this.pagination);
56115
56134
  this.refreshRowColCount();
56116
56135
  this.scenegraph.createSceneGraph();
56117
- this.render();
56136
+ this.renderAsync();
56118
56137
  }
56119
56138
  }
56120
56139
  refreshHeader() {
@@ -60331,7 +60350,7 @@
60331
60350
  }
60332
60351
  return keys;
60333
60352
  }, []) ?? [];
60334
- this.dataset = new Dataset(this.internalProps.dataConfig, rowKeys, columnKeys, indicatorKeys, options.indicators, options.indicatorsAsCol ?? true, options.records, options.rowHierarchyType);
60353
+ this.dataset = new Dataset(this.internalProps.dataConfig, rowKeys, columnKeys, indicatorKeys, this.internalProps.indicators, options.indicatorsAsCol ?? true, options.records, options.rowHierarchyType, this.internalProps.columnTree, this.internalProps.rowTree);
60335
60354
  }
60336
60355
  this.refreshHeader();
60337
60356
  this.pivotSortState = [];
@@ -60429,7 +60448,7 @@
60429
60448
  }
60430
60449
  return keys;
60431
60450
  }, []);
60432
- this.dataset = new Dataset(internalProps.dataConfig, rowKeys, columnKeys, indicatorKeys, options.indicators, options.indicatorsAsCol ?? true, options.records, options.rowHierarchyType);
60451
+ this.dataset = new Dataset(internalProps.dataConfig, rowKeys, columnKeys, indicatorKeys, this.internalProps.indicators, options.indicatorsAsCol ?? true, options.records, options.rowHierarchyType, this.internalProps.columnTree, this.internalProps.rowTree);
60433
60452
  }
60434
60453
  this.refreshHeader();
60435
60454
  if (internalProps.releaseList) {
@@ -62421,7 +62440,7 @@
62421
62440
  return new Tag(params ? params.attribute : {});
62422
62441
  }
62423
62442
 
62424
- const version = "0.12.1";
62443
+ const version = "0.12.3-alpha.0";
62425
62444
  function getIcons() {
62426
62445
  return get$1();
62427
62446
  }