@visactor/vtable 0.12.1-alpha.1 → 0.12.2

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 +2 -0
  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/components/tooltip/TooltipHandler.js +17 -8
  6. package/cjs/components/tooltip/TooltipHandler.js.map +1 -1
  7. package/cjs/core/BaseTable.js +1 -1
  8. package/cjs/core/BaseTable.js.map +1 -1
  9. package/cjs/dataset/dataset.d.ts +1 -0
  10. package/cjs/dataset/dataset.js +89 -58
  11. package/cjs/dataset/dataset.js.map +1 -1
  12. package/cjs/event/event.js +2 -3
  13. package/cjs/event/event.js.map +1 -1
  14. package/cjs/index.d.ts +1 -1
  15. package/cjs/index.js +1 -1
  16. package/cjs/index.js.map +1 -1
  17. package/cjs/layout/chart-helper/get-axis-config.d.ts +11 -0
  18. package/cjs/layout/chart-helper/get-axis-config.js +65 -62
  19. package/cjs/layout/chart-helper/get-axis-config.js.map +1 -1
  20. package/cjs/layout/chart-helper/get-chart-spec.js +9 -24
  21. package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
  22. package/cjs/layout/pivot-header-layout.js +2 -2
  23. package/cjs/layout/pivot-header-layout.js.map +1 -1
  24. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +3 -3
  25. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  26. package/cjs/scenegraph/group-creater/progress/update-position/util.d.ts +1 -1
  27. package/cjs/scenegraph/group-creater/progress/update-position/util.js +10 -5
  28. package/cjs/scenegraph/group-creater/progress/update-position/util.js.map +1 -1
  29. package/cjs/scenegraph/stick-text/index.js +20 -18
  30. package/cjs/scenegraph/stick-text/index.js.map +1 -1
  31. package/cjs/themes/DARK.js +1 -1
  32. package/cjs/themes/DARK.js.map +1 -1
  33. package/cjs/themes/SIMPLIFY.js +1 -1
  34. package/cjs/themes/SIMPLIFY.js.map +1 -1
  35. package/cjs/ts-types/base-table.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 +238 -199
  39. package/dist/vtable.min.js +2 -2
  40. package/es/ListTable.js +2 -0
  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/components/tooltip/TooltipHandler.js +17 -8
  45. package/es/components/tooltip/TooltipHandler.js.map +1 -1
  46. package/es/core/BaseTable.js +1 -1
  47. package/es/core/BaseTable.js.map +1 -1
  48. package/es/dataset/dataset.d.ts +1 -0
  49. package/es/dataset/dataset.js +89 -58
  50. package/es/dataset/dataset.js.map +1 -1
  51. package/es/event/event.js +2 -3
  52. package/es/event/event.js.map +1 -1
  53. package/es/index.d.ts +1 -1
  54. package/es/index.js +1 -1
  55. package/es/index.js.map +1 -1
  56. package/es/layout/chart-helper/get-axis-config.d.ts +11 -0
  57. package/es/layout/chart-helper/get-axis-config.js +61 -57
  58. package/es/layout/chart-helper/get-axis-config.js.map +1 -1
  59. package/es/layout/chart-helper/get-chart-spec.js +6 -21
  60. package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
  61. package/es/layout/pivot-header-layout.js +2 -2
  62. package/es/layout/pivot-header-layout.js.map +1 -1
  63. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +3 -3
  64. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  65. package/es/scenegraph/group-creater/progress/update-position/util.d.ts +1 -1
  66. package/es/scenegraph/group-creater/progress/update-position/util.js +10 -5
  67. package/es/scenegraph/group-creater/progress/update-position/util.js.map +1 -1
  68. package/es/scenegraph/stick-text/index.js +20 -18
  69. package/es/scenegraph/stick-text/index.js.map +1 -1
  70. package/es/themes/DARK.js +1 -1
  71. package/es/themes/DARK.js.map +1 -1
  72. package/es/themes/SIMPLIFY.js +1 -1
  73. package/es/themes/SIMPLIFY.js.map +1 -1
  74. package/es/ts-types/base-table.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 +2 -2
  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
@@ -3704,7 +3704,7 @@
3704
3704
  hoverBgColor: '#EEE'
3705
3705
  },
3706
3706
  selectionStyle: {
3707
- cellBgColor: '#29364D',
3707
+ cellBgColor: 'rgba(255, 255, 255, 0.1)',
3708
3708
  cellBorderColor: '#4284FF',
3709
3709
  cellBorderLineWidth: 2
3710
3710
  }
@@ -4024,7 +4024,7 @@
4024
4024
  lineColor: '#416EFF',
4025
4025
  bgColor: '#D9E2FF'
4026
4026
  },
4027
- selectionStyle: { cellBorderColor: '#FD5', cellBgColor: '#6FA8DC' }
4027
+ selectionStyle: { cellBorderColor: '#FD5', cellBgColor: 'rgba(111, 168, 220, 0.1)' }
4028
4028
  };
4029
4029
 
4030
4030
  const themes$2 = {};
@@ -39785,35 +39785,14 @@
39785
39785
  row === layout.columnHeaderLevelCount - 1 &&
39786
39786
  col >= layout.rowHeaderLevelCount &&
39787
39787
  col < layout.colCount - layout.rightFrozenColCount) {
39788
- const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, layout.columnHeaderLevelCount - 1);
39789
- let defaultKey = indicatorKeys?.[1];
39790
- if (isArray$5(defaultKey)) {
39791
- defaultKey = defaultKey[0];
39792
- }
39793
- if (!defaultKey) {
39794
- return undefined;
39788
+ const { axisOption, isPercent, isZeroAlign, seriesIndice } = getAxisOption(col, row + 1, 'top', layout);
39789
+ if (axisOption?.visible === false) {
39790
+ return;
39795
39791
  }
39796
- const { axisOption, isPercent, isZeroAlign } = getAxisOption(col, row + 1, 'top', layout);
39797
- const data = layout.dataset.collectedValues[defaultKey + (isZeroAlign ? '_align' : '')]
39798
- ? layout.dataset.collectedValues[defaultKey + (isZeroAlign ? '_align' : '')]
39799
- : layout.dataset.collectedValues[defaultKey];
39792
+ const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, layout.columnHeaderLevelCount - 1);
39800
39793
  const colPath = layout.getColKeysPath(col, row);
39801
- const range = merge$1({}, data?.[colPath ?? ''] ?? { min: 0, max: 1 });
39802
- if (range.positiveMax && range.positiveMax > range.max) {
39803
- range.max = range.positiveMax;
39804
- }
39805
- if (range.negativeMin && range.negativeMin < range.min) {
39806
- range.min = range.negativeMin;
39807
- }
39808
- if (range.min === range.max) {
39809
- if (range.min > 0) {
39810
- range.min = 0;
39811
- }
39812
- else {
39813
- range.max = 0;
39814
- }
39815
- }
39816
- if (axisOption?.visible === false) {
39794
+ const range = getAxisRange(layout.dataset.collectedValues, indicatorKeys, isZeroAlign, colPath, seriesIndice ?? 1);
39795
+ if (!range) {
39817
39796
  return;
39818
39797
  }
39819
39798
  if (isPercent) {
@@ -39843,30 +39822,15 @@
39843
39822
  else if (row === layout.rowCount - layout.bottomFrozenRowCount &&
39844
39823
  col >= layout.rowHeaderLevelCount &&
39845
39824
  col < layout.colCount - layout.rightFrozenColCount) {
39825
+ const { axisOption, isPercent, isZeroAlign, seriesIndice } = getAxisOption(col, row - 1, 'bottom', layout);
39826
+ if (axisOption?.visible === false) {
39827
+ return;
39828
+ }
39846
39829
  const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, row);
39847
- let defaultKey = indicatorKeys?.[0];
39848
- if (isArray$5(defaultKey)) {
39849
- defaultKey = defaultKey[0];
39850
- }
39851
- const { axisOption, isPercent, isZeroAlign } = getAxisOption(col, row - 1, 'bottom', layout);
39852
- const data = layout.dataset.collectedValues[defaultKey + (isZeroAlign ? '_align' : '')]
39853
- ? layout.dataset.collectedValues[defaultKey + (isZeroAlign ? '_align' : '')]
39854
- : layout.dataset.collectedValues[defaultKey];
39855
39830
  const colPath = layout.getColKeysPath(col, row);
39856
- const range = merge$1({}, data?.[colPath ?? ''] ?? { min: 0, max: 1 });
39857
- if (range.positiveMax && range.positiveMax > range.max) {
39858
- range.max = range.positiveMax;
39859
- }
39860
- if (range.negativeMin && range.negativeMin < range.min) {
39861
- range.min = range.negativeMin;
39862
- }
39863
- if (range.min === range.max) {
39864
- if (range.min > 0) {
39865
- range.min = 0;
39866
- }
39867
- else {
39868
- range.max = 0;
39869
- }
39831
+ const range = getAxisRange(layout.dataset.collectedValues, indicatorKeys, isZeroAlign, colPath, seriesIndice ?? 0);
39832
+ if (!range) {
39833
+ return;
39870
39834
  }
39871
39835
  let indicatorInfo = null;
39872
39836
  indicatorKeys?.forEach(key => {
@@ -39875,9 +39839,6 @@
39875
39839
  indicatorInfo = info;
39876
39840
  }
39877
39841
  });
39878
- if (axisOption?.visible === false) {
39879
- return;
39880
- }
39881
39842
  if (isPercent) {
39882
39843
  range.min = range.min < 0 ? -1 : 0;
39883
39844
  range.max = range.max > 0 ? 1 : 0;
@@ -39935,30 +39896,15 @@
39935
39896
  if (col === layout.rowHeaderLevelCount - 1 &&
39936
39897
  row >= layout.columnHeaderLevelCount &&
39937
39898
  row < layout.rowCount - layout.bottomFrozenRowCount) {
39899
+ const { axisOption, isPercent, isZeroAlign, seriesIndice } = getAxisOption(col + 1, row, 'left', layout);
39900
+ if (axisOption?.visible === false) {
39901
+ return;
39902
+ }
39938
39903
  const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, row);
39939
- let defaultKey = indicatorKeys?.[0];
39940
- if (isArray$5(defaultKey)) {
39941
- defaultKey = defaultKey[0];
39942
- }
39943
- const { axisOption, isPercent, isZeroAlign } = getAxisOption(col + 1, row, 'left', layout);
39944
- const data = layout.dataset.collectedValues[defaultKey + (isZeroAlign ? '_align' : '')]
39945
- ? layout.dataset.collectedValues[defaultKey + (isZeroAlign ? '_align' : '')]
39946
- : layout.dataset.collectedValues[defaultKey];
39947
39904
  const rowPath = layout.getRowKeysPath(col, row);
39948
- const range = merge$1({}, data?.[rowPath ?? ''] ?? { min: 0, max: 1 });
39949
- if (range.positiveMax && range.positiveMax > range.max) {
39950
- range.max = range.positiveMax;
39951
- }
39952
- if (range.negativeMin && range.negativeMin < range.min) {
39953
- range.min = range.negativeMin;
39954
- }
39955
- if (range.min === range.max) {
39956
- if (range.min > 0) {
39957
- range.min = 0;
39958
- }
39959
- else {
39960
- range.max = 0;
39961
- }
39905
+ const range = getAxisRange(layout.dataset.collectedValues, indicatorKeys, isZeroAlign, rowPath, seriesIndice ?? 0);
39906
+ if (!range) {
39907
+ return;
39962
39908
  }
39963
39909
  let indicatorInfo = null;
39964
39910
  indicatorKeys?.forEach(key => {
@@ -39967,9 +39913,6 @@
39967
39913
  indicatorInfo = info;
39968
39914
  }
39969
39915
  });
39970
- if (axisOption?.visible === false) {
39971
- return;
39972
- }
39973
39916
  if (isPercent) {
39974
39917
  range.min = range.min < 0 ? -1 : 0;
39975
39918
  range.max = range.max > 0 ? 1 : 0;
@@ -40002,35 +39945,14 @@
40002
39945
  else if (col === layout.colCount - layout.rightFrozenColCount &&
40003
39946
  row >= layout.columnHeaderLevelCount &&
40004
39947
  row < layout.rowCount - layout.bottomFrozenRowCount) {
40005
- const indicatorKeys = layout.getIndicatorKeyInChartSpec(layout.rowHeaderLevelCount - 1, row);
40006
- let defaultKey = indicatorKeys?.[1];
40007
- if (isArray$5(defaultKey)) {
40008
- defaultKey = defaultKey[0];
40009
- }
40010
- if (!defaultKey) {
40011
- return undefined;
39948
+ const { axisOption, isPercent, isZeroAlign, seriesIndice } = getAxisOption(col - 1, row, 'right', layout);
39949
+ if (axisOption?.visible === false) {
39950
+ return;
40012
39951
  }
40013
- const { axisOption, isPercent, isZeroAlign } = getAxisOption(col - 1, row, 'right', layout);
40014
- const data = layout.dataset.collectedValues[defaultKey + (isZeroAlign ? '_align' : '')]
40015
- ? layout.dataset.collectedValues[defaultKey + (isZeroAlign ? '_align' : '')]
40016
- : layout.dataset.collectedValues[defaultKey];
39952
+ const indicatorKeys = layout.getIndicatorKeyInChartSpec(layout.rowHeaderLevelCount - 1, row);
40017
39953
  const rowPath = layout.getRowKeysPath(col, row);
40018
- const range = merge$1({}, data?.[rowPath ?? ''] ?? { min: 0, max: 1 });
40019
- if (range.positiveMax && range.positiveMax > range.max) {
40020
- range.max = range.positiveMax;
40021
- }
40022
- if (range.negativeMin && range.negativeMin < range.min) {
40023
- range.min = range.negativeMin;
40024
- }
40025
- if (range.min === range.max) {
40026
- if (range.min > 0) {
40027
- range.min = 0;
40028
- }
40029
- else {
40030
- range.max = 0;
40031
- }
40032
- }
40033
- if (axisOption?.visible === false) {
39954
+ const range = getAxisRange(layout.dataset.collectedValues, indicatorKeys, isZeroAlign, rowPath, seriesIndice ?? 1);
39955
+ if (!range) {
40034
39956
  return;
40035
39957
  }
40036
39958
  if (isPercent) {
@@ -40091,10 +40013,19 @@
40091
40013
  return axis.orient === orient;
40092
40014
  });
40093
40015
  if (axisOption) {
40016
+ const { seriesIndex, seriesId } = axisOption;
40017
+ let seriesIndice;
40018
+ if (isValid$5(seriesId) && isArray$5(spec.series)) {
40019
+ seriesIndice = (isArray$5(seriesId) ? seriesId : [seriesId]).map(id => spec.series.findIndex((s) => s.id === id));
40020
+ }
40021
+ else if (isValid$5(seriesIndex) && isArray$5(spec.series)) {
40022
+ seriesIndice = seriesIndex;
40023
+ }
40094
40024
  return {
40095
40025
  axisOption,
40096
40026
  isPercent: spec.percent,
40097
- isZeroAlign: checkZeroAlign(spec, orient, layout)
40027
+ isZeroAlign: checkZeroAlign(spec, orient, layout),
40028
+ seriesIndice
40098
40029
  };
40099
40030
  }
40100
40031
  }
@@ -40143,6 +40074,48 @@
40143
40074
  }
40144
40075
  return false;
40145
40076
  }
40077
+ function getAxisRange(collectedValues, indicatorKeys, isZeroAlign, colPath, seriesId) {
40078
+ if (isArray$5(seriesId)) {
40079
+ const range = { min: Infinity, max: -Infinity };
40080
+ for (let i = 0; i < seriesId.length; i++) {
40081
+ const singleRange = getAxisRange(collectedValues, indicatorKeys, isZeroAlign, colPath, seriesId[i]);
40082
+ if (singleRange) {
40083
+ range.min = Math.min(range.min, singleRange.min);
40084
+ range.max = Math.max(range.max, singleRange.max);
40085
+ }
40086
+ }
40087
+ if (isFinite(range.min) && isFinite(range.max)) {
40088
+ return range;
40089
+ }
40090
+ return null;
40091
+ }
40092
+ let defaultKey = indicatorKeys?.[seriesId];
40093
+ if (isArray$5(defaultKey)) {
40094
+ defaultKey = defaultKey[0];
40095
+ }
40096
+ if (!defaultKey) {
40097
+ return null;
40098
+ }
40099
+ const data = collectedValues[defaultKey + (isZeroAlign ? '_align' : '')]
40100
+ ? collectedValues[defaultKey + (isZeroAlign ? '_align' : '')]
40101
+ : collectedValues[defaultKey];
40102
+ const range = merge$1({}, data?.[colPath ?? ''] ?? { min: 0, max: 1 });
40103
+ if (range.positiveMax && range.positiveMax > range.max) {
40104
+ range.max = range.positiveMax;
40105
+ }
40106
+ if (range.negativeMin && range.negativeMin < range.min) {
40107
+ range.min = range.negativeMin;
40108
+ }
40109
+ if (range.min === range.max) {
40110
+ if (range.min > 0) {
40111
+ range.min = 0;
40112
+ }
40113
+ else {
40114
+ range.max = 0;
40115
+ }
40116
+ }
40117
+ return range;
40118
+ }
40146
40119
 
40147
40120
  function computeAxisComponentWidth(config, table) {
40148
40121
  const attribute = merge$1({}, commonAxis, config);
@@ -43975,7 +43948,7 @@
43975
43948
  }
43976
43949
  }
43977
43950
  }
43978
- function checkFirstColMerge(col, scrolling, proxy) {
43951
+ function checkFirstColMerge(col, proxy) {
43979
43952
  for (let row = 0; row < proxy.table.rowCount; row++) {
43980
43953
  if ((row >= proxy.table.columnHeaderLevelCount && row < proxy.rowStart) ||
43981
43954
  (row > proxy.rowEnd && row < proxy.table.rowCount - proxy.table.bottomFrozenRowCount)) {
@@ -43991,6 +43964,11 @@
43991
43964
  newCellGroup.col = col;
43992
43965
  newCellGroup.row = row;
43993
43966
  newCellGroup.setAttribute('x', proxy.table.getColsWidth(proxy.table.rowHeaderLevelCount, range.start.col - 1) - oldCellGroup.parent.attribute.x);
43967
+ newCellGroup.setAttributes({
43968
+ x: proxy.table.getColsWidth(proxy.table.rowHeaderLevelCount, range.start.col - 1) -
43969
+ oldCellGroup.parent.attribute.x,
43970
+ y: proxy.table.getRowsHeight(0, range.start.row - 1) - oldCellGroup.parent.attribute.y
43971
+ });
43994
43972
  oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup);
43995
43973
  oldCellGroup.parent.removeChild(oldCellGroup);
43996
43974
  oldCellGroup.needUpdate = false;
@@ -44009,7 +43987,8 @@
44009
43987
  cellGroup.setAttributes({
44010
43988
  width: 0,
44011
43989
  height: proxy.table.getRowHeight(cellGroup.row),
44012
- y: proxy.table.getRowsHeight(proxy.table.columnHeaderLevelCount, cellGroup.row - 1)
43990
+ y: proxy.table.getRowsHeight(proxy.table.columnHeaderLevelCount, cellGroup.row - 1),
43991
+ x: 0
44013
43992
  });
44014
43993
  cellGroup.clear();
44015
43994
  }
@@ -44018,12 +43997,13 @@
44018
43997
  function clearHadMergedColumn(colStart, colEnd, row, proxy) {
44019
43998
  for (let col = colStart; col <= colEnd; col++) {
44020
43999
  const cellGroup = proxy.highPerformanceGetCell(col, row, true);
44021
- if (cellGroup.role !== 'shadow-cell' && cellGroup.role !== 'empty' && cellGroup.row !== colStart) {
44000
+ if (cellGroup.role !== 'shadow-cell' && cellGroup.role !== 'empty' && cellGroup.col !== colStart) {
44022
44001
  cellGroup.role = 'shadow-cell';
44023
44002
  cellGroup.setAttributes({
44024
44003
  width: 0,
44025
44004
  height: proxy.table.getRowHeight(cellGroup.row),
44026
- y: proxy.table.getRowsHeight(proxy.table.columnHeaderLevelCount, cellGroup.row - 1)
44005
+ y: proxy.table.getRowsHeight(0, cellGroup.row - 1),
44006
+ x: 0
44027
44007
  });
44028
44008
  cellGroup.clear();
44029
44009
  }
@@ -44147,8 +44127,8 @@
44147
44127
  const syncRightCol = distEndCol;
44148
44128
  proxy.colStart = direction === 'left' ? proxy.colStart + count : proxy.colStart - count;
44149
44129
  proxy.colEnd = direction === 'left' ? proxy.colEnd + count : proxy.colEnd - count;
44150
- checkFirstColMerge(distStartCol, true, proxy);
44151
44130
  updateColContent(syncLeftCol, syncRightCol, proxy);
44131
+ checkFirstColMerge(distStartCol, proxy);
44152
44132
  updateAutoColumn(syncLeftCol, syncRightCol, proxy.table, direction);
44153
44133
  const colGroup = proxy.table.scenegraph.getColGroup(screenLeftCol);
44154
44134
  const deltaX = screenLeftX - (colGroup.attribute.x + proxy.table.getFrozenColsWidth() + proxy.table.scenegraph.proxy.deltaX);
@@ -44170,8 +44150,8 @@
44170
44150
  const syncRightCol = distEndCol;
44171
44151
  proxy.colStart = distStartCol;
44172
44152
  proxy.colEnd = distEndCol;
44173
- checkFirstColMerge(distStartCol, false, proxy);
44174
44153
  updateColContent(syncLeftCol, syncRightCol, proxy);
44154
+ checkFirstColMerge(distStartCol, proxy);
44175
44155
  updateAutoColumn(syncLeftCol, syncRightCol, proxy.table, distEndCol > proxy.bodyRightCol - (proxy.colEnd - proxy.colStart + 1) ? 'right' : 'left');
44176
44156
  proxy.table.scenegraph.proxy.deltaX = 0;
44177
44157
  proxy.currentCol = direction === 'left' ? proxy.currentCol + count : proxy.currentCol - count;
@@ -45377,6 +45357,9 @@
45377
45357
  const colEnd = table.getAllColsWidth() > table.tableNoFrameWidth
45378
45358
  ? table.getColAt(scrollLeft + table.tableNoFrameWidth - 1).col
45379
45359
  : table.colCount - 1;
45360
+ if (colEnd < 0 || rowEnd < 0) {
45361
+ return;
45362
+ }
45380
45363
  for (let row = 0; row < frozenRowCount; row++) {
45381
45364
  for (let col = colStart; col <= colEnd; col++) {
45382
45365
  if (table._getCellStyle(col, row)?.textStick) {
@@ -49870,11 +49853,6 @@
49870
49853
  }
49871
49854
  const { eventArgs } = eventArgsSet;
49872
49855
  if (eventArgs) {
49873
- if (!this.table.isPivotChart() &&
49874
- eventArgsSet?.eventArgs?.target.type !== 'chart' &&
49875
- eventArgs.event.pointerType !== 'touch') {
49876
- this.table.stateManeger.updateHoverPos(-1, -1);
49877
- }
49878
49856
  if (this.table.isPivotChart() &&
49879
49857
  (eventArgsSet?.eventArgs?.target.name === 'axis-label' || eventArgsSet?.eventArgs?.target.type === 'chart')) {
49880
49858
  this.table.stateManeger.updateSelectPos(-1, -1);
@@ -51620,16 +51598,27 @@
51620
51598
  return;
51621
51599
  }
51622
51600
  }
51623
- if (table.internalProps.tooltip?.isShowOverflowTextTooltip) {
51601
+ let tooltipOption;
51602
+ const headerDescription = table.getHeaderDescription(col, row);
51603
+ if (headerDescription) {
51604
+ const rect = table.getCellRangeRelativeRect({ col, row });
51605
+ tooltipOption = {
51606
+ content: headerDescription,
51607
+ referencePosition: {
51608
+ placement: Placement.bottom,
51609
+ rect
51610
+ },
51611
+ style: { arrowMark: false }
51612
+ };
51613
+ }
51614
+ else if (table.internalProps.tooltip?.isShowOverflowTextTooltip) {
51624
51615
  const overflowText = table.getCellOverflowText(col, row);
51625
- const headerDescription = table.getHeaderDescription(col, row);
51626
51616
  const rect = table.getCellRangeRelativeRect({ col, row });
51627
- let tooltipOption;
51628
51617
  if (overflowText) {
51629
51618
  tooltipOption = {
51630
51619
  content: headerDescription
51631
51620
  ? `${headerDescription}
51632
- ${overflowText}`
51621
+ ${overflowText}`
51633
51622
  : overflowText,
51634
51623
  referencePosition: {
51635
51624
  placement: Placement.bottom,
@@ -51638,19 +51627,9 @@
51638
51627
  style: { arrowMark: false }
51639
51628
  };
51640
51629
  }
51641
- if (headerDescription) {
51642
- tooltipOption = {
51643
- content: headerDescription,
51644
- referencePosition: {
51645
- placement: Placement.bottom,
51646
- rect
51647
- },
51648
- style: { arrowMark: false }
51649
- };
51650
- }
51651
- if (tooltipOption) {
51652
- this._bindToCell(e.col, e.row, tooltipOption);
51653
- }
51630
+ }
51631
+ if (tooltipOption) {
51632
+ this._bindToCell(e.col, e.row, tooltipOption);
51654
51633
  }
51655
51634
  });
51656
51635
  table.on(TABLE_EVENT_TYPE.MOUSEMOVE_CELL, e => {
@@ -52746,7 +52725,7 @@
52746
52725
  return TABLE_EVENT_TYPE;
52747
52726
  }
52748
52727
  options;
52749
- version = "0.12.1-alpha.1";
52728
+ version = "0.12.2";
52750
52729
  pagination;
52751
52730
  id = `VTable${Date.now()}`;
52752
52731
  headerStyleCache;
@@ -54968,23 +54947,10 @@
54968
54947
  const axes = [];
54969
54948
  if (layout.indicatorsAsCol) {
54970
54949
  const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, row);
54971
- layout.getRecordIndexByCol(col);
54950
+ const colPath = layout.getColKeysPath(col, row);
54972
54951
  indicatorKeys.forEach((key, index) => {
54973
- if (isArray$5(key)) {
54974
- key = key[0];
54975
- }
54976
- const { axisOption, isPercent, isZeroAlign } = getAxisOption(col, row, index === 0 ? 'bottom' : 'top', layout);
54977
- const data = layout.dataset.collectedValues[key + (isZeroAlign ? '_align' : '')]
54978
- ? layout.dataset.collectedValues[key + (isZeroAlign ? '_align' : '')]
54979
- : layout.dataset.collectedValues[key];
54980
- const colPath = layout.getColKeysPath(col, row);
54981
- const range = merge$1({}, data?.[colPath ?? ''] ?? { min: 0, max: 1 });
54982
- if (range.positiveMax && range.positiveMax > range.max) {
54983
- range.max = range.positiveMax;
54984
- }
54985
- if (range.negativeMin && range.negativeMin < range.min) {
54986
- range.min = range.negativeMin;
54987
- }
54952
+ const { axisOption, isPercent, isZeroAlign, seriesIndice } = getAxisOption(col, row, index === 0 ? 'bottom' : 'top', layout);
54953
+ const range = getAxisRange(layout.dataset.collectedValues, indicatorKeys, isZeroAlign, colPath, seriesIndice ?? index);
54988
54954
  if (isPercent) {
54989
54955
  range.min = range.min < 0 ? -1 : 0;
54990
54956
  range.max = range.max > 0 ? 1 : 0;
@@ -55044,20 +55010,8 @@
55044
55010
  const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, row);
55045
55011
  const rowPath = layout.getRowKeysPath(col, row);
55046
55012
  indicatorKeys.forEach((key, index) => {
55047
- if (isArray$5(key)) {
55048
- key = key[0];
55049
- }
55050
- const { axisOption, isPercent, isZeroAlign } = getAxisOption(col, row, index === 0 ? 'left' : 'right', layout);
55051
- const data = layout.dataset.collectedValues[key + (isZeroAlign ? '_align' : '')]
55052
- ? layout.dataset.collectedValues[key + (isZeroAlign ? '_align' : '')]
55053
- : layout.dataset.collectedValues[key];
55054
- const range = merge$1({}, data?.[rowPath ?? ''] ?? { min: 0, max: 1 });
55055
- if (range.positiveMax && range.positiveMax > range.max) {
55056
- range.max = range.positiveMax;
55057
- }
55058
- if (range.negativeMin && range.negativeMin < range.min) {
55059
- range.min = range.negativeMin;
55060
- }
55013
+ const { axisOption, isPercent, isZeroAlign, seriesIndice } = getAxisOption(col, row, index === 0 ? 'left' : 'right', layout);
55014
+ const range = getAxisRange(layout.dataset.collectedValues, indicatorKeys, isZeroAlign, rowPath, seriesIndice ?? index);
55061
55015
  if (isPercent) {
55062
55016
  range.min = range.min < 0 ? -1 : 0;
55063
55017
  range.max = range.max > 0 ? 1 : 0;
@@ -56078,6 +56032,9 @@
56078
56032
  }
56079
56033
  }
56080
56034
  getCellValue(col, row) {
56035
+ if (col === -1 || row === -1) {
56036
+ return null;
56037
+ }
56081
56038
  const table = this;
56082
56039
  if (table.internalProps.layoutMap.isHeader(col, row)) {
56083
56040
  const { title } = table.internalProps.layoutMap.getHeader(col, row);
@@ -56087,6 +56044,9 @@
56087
56044
  return table.getFieldData(fieldFormat || field, col, row);
56088
56045
  }
56089
56046
  getCellOriginValue(col, row) {
56047
+ if (col === -1 || row === -1) {
56048
+ return null;
56049
+ }
56090
56050
  const table = this;
56091
56051
  if (table.internalProps.layoutMap.isHeader(col, row)) {
56092
56052
  const { title } = table.internalProps.layoutMap.getHeader(col, row);
@@ -56919,7 +56879,7 @@
56919
56879
  });
56920
56880
  const cell = {
56921
56881
  id,
56922
- title: hd.value ?? indicatorInfo.title,
56882
+ title: hd.value ?? indicatorInfo?.title,
56923
56883
  field: hd.dimensionKey,
56924
56884
  style: typeof (indicatorInfo ?? dimensionInfo)?.headerStyle === 'function'
56925
56885
  ? (indicatorInfo ?? dimensionInfo)?.headerStyle
@@ -57631,7 +57591,7 @@
57631
57591
  }
57632
57592
  getCellRange(col, row) {
57633
57593
  const result = { start: { col, row }, end: { col, row } };
57634
- if (!this.isHeader(col, row) || col === -1 || row === -1 || this.isIndicatorHeader(col, row)) {
57594
+ if (!this.isHeader(col, row) || col === -1 || row === -1) {
57635
57595
  return result;
57636
57596
  }
57637
57597
  if (this.isRightFrozenColumn(col, row) || this.isBottomFrozenRow(col, row)) {
@@ -59380,6 +59340,7 @@
59380
59340
  rowHierarchyType;
59381
59341
  indicators;
59382
59342
  indicatorsAsCol;
59343
+ totalRecordsTree = {};
59383
59344
  constructor(dataConfig, rows, columns, indicatorKeys, indicators, indicatorsAsCol, records, rowHierarchyType, customColTree, customRowTree, needSplitPositiveAndNegative) {
59384
59345
  this.registerAggregators();
59385
59346
  this.dataConfig = dataConfig;
@@ -59434,7 +59395,9 @@
59434
59395
  }
59435
59396
  else {
59436
59397
  if (this.rowHierarchyType === 'tree') {
59437
- this.rowHeaderTree = this.ArrToTree1(this.rowKeys, this.rows, indicatorsAsCol ? undefined : indicators);
59398
+ this.rowHeaderTree = this.ArrToTree1(this.rowKeys, this.rows, indicatorsAsCol ? undefined : indicators, this?.totals?.row?.showGrandTotals ||
59399
+ (!indicatorsAsCol && this.columns.length === 0) ||
59400
+ (indicatorsAsCol && this.rows.length === 0), this.rowGrandTotalLabel);
59438
59401
  }
59439
59402
  else {
59440
59403
  this.rowHeaderTree = this.ArrToTree(this.rowKeys, this.rows, indicatorsAsCol ? undefined : indicators, this.rowsIsTotal, this?.totals?.row?.showGrandTotals ||
@@ -59560,16 +59523,6 @@
59560
59523
  this.derivedFieldRules?.forEach((derivedFieldRule, i) => {
59561
59524
  record[derivedFieldRule.fieldName] = derivedFieldRule.derivedFunc(record);
59562
59525
  });
59563
- const colKey = [];
59564
- const rowKey = [];
59565
- for (let l = 0, len1 = this.rows.length; l < len1; l++) {
59566
- const rowAttr = this.rows[l];
59567
- rowKey.push(record[rowAttr]);
59568
- }
59569
- for (let n = 0, len2 = this.columns.length; n < len2; n++) {
59570
- const colAttr = this.columns[n];
59571
- colKey.push(record[colAttr]);
59572
- }
59573
59526
  for (const field in this.collectValuesBy) {
59574
59527
  if (record[field]) {
59575
59528
  if (!this.collectedValues[field]) {
@@ -59610,8 +59563,81 @@
59610
59563
  }
59611
59564
  }
59612
59565
  }
59566
+ const colKey = [];
59567
+ const rowKey = [];
59568
+ let isToTalRecord = false;
59569
+ for (let l = 0, len1 = this.rows.length; l < len1; l++) {
59570
+ const rowAttr = this.rows[l];
59571
+ if (rowAttr in record) {
59572
+ rowKey.push(record[rowAttr]);
59573
+ }
59574
+ else {
59575
+ if (this.dataConfig?.totals?.row?.showGrandTotals &&
59576
+ l === 0 &&
59577
+ !this.rows.find((rk) => {
59578
+ return rk in record;
59579
+ })) {
59580
+ rowKey.push(this.rowGrandTotalLabel);
59581
+ isToTalRecord = true;
59582
+ break;
59583
+ }
59584
+ else if (this.dataConfig?.totals?.row?.showSubTotals &&
59585
+ this.dataConfig?.totals?.row?.subTotalsDimensions.indexOf(this.rows[l - 1]) >= 0) {
59586
+ if (this.rowHierarchyType === 'grid') {
59587
+ rowKey.push(this.rowSubTotalLabel);
59588
+ }
59589
+ isToTalRecord = true;
59590
+ break;
59591
+ }
59592
+ }
59593
+ }
59594
+ for (let n = 0, len2 = this.columns.length; n < len2; n++) {
59595
+ const colAttr = this.columns[n];
59596
+ if (colAttr in record) {
59597
+ colKey.push(record[colAttr]);
59598
+ }
59599
+ else {
59600
+ if (this.dataConfig?.totals?.column?.showGrandTotals &&
59601
+ n === 0 &&
59602
+ !this.columns.find((ck) => {
59603
+ return ck in record;
59604
+ })) {
59605
+ colKey.push(this.colGrandTotalLabel);
59606
+ isToTalRecord = true;
59607
+ break;
59608
+ }
59609
+ else if (this.dataConfig?.totals?.column?.showSubTotals &&
59610
+ this.dataConfig?.totals?.column?.subTotalsDimensions.indexOf(this.columns[n - 1]) >= 0) {
59611
+ colKey.push(this.colSubTotalLabel);
59612
+ isToTalRecord = true;
59613
+ break;
59614
+ }
59615
+ }
59616
+ }
59613
59617
  const flatRowKey = rowKey.join(this.stringJoinChar);
59614
59618
  const flatColKey = colKey.join(this.stringJoinChar);
59619
+ if (isToTalRecord) {
59620
+ if (!this.totalRecordsTree[flatRowKey]) {
59621
+ this.totalRecordsTree[flatRowKey] = {};
59622
+ }
59623
+ if (!this.totalRecordsTree[flatRowKey][flatColKey]) {
59624
+ this.totalRecordsTree[flatRowKey][flatColKey] = [];
59625
+ }
59626
+ for (let i = 0; i < this.indicatorKeys.length; i++) {
59627
+ const aggRule = this.getAggregatorRule(this.indicatorKeys[i]);
59628
+ if (!this.totalRecordsTree[flatRowKey]?.[flatColKey]?.[i]) {
59629
+ this.totalRecordsTree[flatRowKey][flatColKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM](aggRule?.field ?? this.indicatorKeys[i], aggRule?.formatFun ??
59630
+ this.indicators?.find((indicator) => {
59631
+ if (typeof indicator !== 'string') {
59632
+ return indicator.indicatorKey === this.indicatorKeys[i];
59633
+ }
59634
+ return false;
59635
+ })?.format);
59636
+ }
59637
+ this.indicatorKeys[i] in record && this.totalRecordsTree[flatRowKey]?.[flatColKey]?.[i].push(record);
59638
+ }
59639
+ return;
59640
+ }
59615
59641
  if (rowKey.length !== 0) {
59616
59642
  if (!this.rowFlatKeys[flatRowKey]) {
59617
59643
  this.rowKeys.push(rowKey);
@@ -59884,16 +59910,22 @@
59884
59910
  that?.totals?.row?.showGrandTotals) {
59885
59911
  const rowTotalKeys = [];
59886
59912
  const colCompute = (flatRowKey, flatColKey) => {
59913
+ if (this.totalRecordsTree?.[flatRowKey]?.[flatColKey]) {
59914
+ this.tree[flatRowKey][flatColKey] = this.totalRecordsTree?.[flatRowKey]?.[flatColKey];
59915
+ return;
59916
+ }
59887
59917
  const colKey = flatColKey.split(this.stringJoinChar);
59888
59918
  for (let i = 0, len = that.totals?.column?.subTotalsDimensions?.length; i < len; i++) {
59889
59919
  const dimension = that.totals.column.subTotalsDimensions[i];
59890
59920
  const dimensionIndex = that.columns.indexOf(dimension);
59891
59921
  if (dimensionIndex >= 0) {
59892
59922
  const colTotalKey = colKey.slice(0, dimensionIndex + 1);
59893
- if (this.rowHierarchyType === 'grid') {
59894
- colTotalKey.push(that.totals?.column?.subTotalLabel ?? '小计');
59895
- }
59923
+ colTotalKey.push(that.totals?.column?.subTotalLabel ?? '小计');
59896
59924
  const flatColTotalKey = colTotalKey.join(this.stringJoinChar);
59925
+ if (this.totalRecordsTree?.[flatRowKey]?.[flatColTotalKey]) {
59926
+ this.tree[flatRowKey][flatColTotalKey] = this.totalRecordsTree?.[flatRowKey]?.[flatColTotalKey];
59927
+ return;
59928
+ }
59897
59929
  if (!this.tree[flatRowKey][flatColTotalKey]) {
59898
59930
  this.tree[flatRowKey][flatColTotalKey] = [];
59899
59931
  }
@@ -59914,6 +59946,10 @@
59914
59946
  }
59915
59947
  if (that.totals?.column?.showGrandTotals || this.rows.length === 0) {
59916
59948
  const flatColTotalKey = that.colGrandTotalLabel;
59949
+ if (this.totalRecordsTree?.[flatRowKey]?.[flatColTotalKey]) {
59950
+ this.tree[flatRowKey][flatColTotalKey] = this.totalRecordsTree?.[flatRowKey]?.[flatColTotalKey];
59951
+ return;
59952
+ }
59917
59953
  if (!this.tree[flatRowKey][flatColTotalKey]) {
59918
59954
  this.tree[flatRowKey][flatColTotalKey] = [];
59919
59955
  }
@@ -59938,7 +59974,7 @@
59938
59974
  for (let i = 0, len = that.totals?.row?.subTotalsDimensions?.length; i < len; i++) {
59939
59975
  const dimension = that.totals.row.subTotalsDimensions[i];
59940
59976
  const dimensionIndex = that.rows.indexOf(dimension);
59941
- if (dimensionIndex >= 0) {
59977
+ if (dimensionIndex >= 0 && dimensionIndex < that.rows.length - 1) {
59942
59978
  const rowTotalKey = rowKey.slice(0, dimensionIndex + 1);
59943
59979
  if (this.rowHierarchyType === 'grid') {
59944
59980
  rowTotalKey.push(that.totals?.row?.subTotalLabel ?? '小计');
@@ -59950,19 +59986,19 @@
59950
59986
  }
59951
59987
  if (!this.tree[flatRowTotalKey][flatColKey]) {
59952
59988
  this.tree[flatRowTotalKey][flatColKey] = [];
59953
- for (let i = 0; i < this.indicatorKeys.length; i++) {
59954
- if (!this.tree[flatRowTotalKey][flatColKey][i]) {
59955
- const aggRule = this.getAggregatorRule(this.indicatorKeys[i]);
59956
- this.tree[flatRowTotalKey][flatColKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM](aggRule?.field ?? this.indicatorKeys[i], aggRule?.formatFun ??
59957
- this.indicators?.find((indicator) => {
59958
- if (typeof indicator !== 'string') {
59959
- return indicator.indicatorKey === this.indicatorKeys[i];
59960
- }
59961
- return false;
59962
- })?.format);
59963
- }
59964
- this.tree[flatRowTotalKey][flatColKey][i].push(that.tree[flatRowKey]?.[flatColKey]?.[i]);
59989
+ }
59990
+ for (let i = 0; i < this.indicatorKeys.length; i++) {
59991
+ if (!this.tree[flatRowTotalKey][flatColKey][i]) {
59992
+ const aggRule = this.getAggregatorRule(this.indicatorKeys[i]);
59993
+ this.tree[flatRowTotalKey][flatColKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM](aggRule?.field ?? this.indicatorKeys[i], aggRule?.formatFun ??
59994
+ this.indicators?.find((indicator) => {
59995
+ if (typeof indicator !== 'string') {
59996
+ return indicator.indicatorKey === this.indicatorKeys[i];
59997
+ }
59998
+ return false;
59999
+ })?.format);
59965
60000
  }
60001
+ this.tree[flatRowTotalKey][flatColKey][i].push(that.tree[flatRowKey]?.[flatColKey]?.[i]);
59966
60002
  }
59967
60003
  }
59968
60004
  }
@@ -59999,7 +60035,7 @@
59999
60035
  });
60000
60036
  }
60001
60037
  }
60002
- ArrToTree1(arr, rows, indicators) {
60038
+ ArrToTree1(arr, rows, indicators, isGrandTotal, grandTotalLabel) {
60003
60039
  const result = [];
60004
60040
  const concatStr = this.stringJoinChar;
60005
60041
  const map = new Map();
@@ -60041,6 +60077,9 @@
60041
60077
  });
60042
60078
  }
60043
60079
  arr.forEach(item => addList(item));
60080
+ if (isGrandTotal) {
60081
+ addList([grandTotalLabel]);
60082
+ }
60044
60083
  return result;
60045
60084
  }
60046
60085
  ArrToTree(arr, rows, indicators, subTotalFlags, isGrandTotal, grandTotalLabel, subTotalLabel) {
@@ -60303,7 +60342,7 @@
60303
60342
  }
60304
60343
  return keys;
60305
60344
  }, []) ?? [];
60306
- this.dataset = new Dataset(this.internalProps.dataConfig, rowKeys, columnKeys, indicatorKeys, options.indicators, options.indicatorsAsCol ?? true, options.records, options.rowHierarchyType);
60345
+ 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);
60307
60346
  }
60308
60347
  this.refreshHeader();
60309
60348
  this.pivotSortState = [];
@@ -60401,7 +60440,7 @@
60401
60440
  }
60402
60441
  return keys;
60403
60442
  }, []);
60404
- this.dataset = new Dataset(internalProps.dataConfig, rowKeys, columnKeys, indicatorKeys, options.indicators, options.indicatorsAsCol ?? true, options.records, options.rowHierarchyType);
60443
+ 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);
60405
60444
  }
60406
60445
  this.refreshHeader();
60407
60446
  if (internalProps.releaseList) {
@@ -62393,7 +62432,7 @@
62393
62432
  return new Tag(params ? params.attribute : {});
62394
62433
  }
62395
62434
 
62396
- const version = "0.12.1-alpha.1";
62435
+ const version = "0.12.2";
62397
62436
  function getIcons() {
62398
62437
  return get$1();
62399
62438
  }