@visactor/vtable 1.22.7-alpha.5 → 1.22.7-alpha.7

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 (89) hide show
  1. package/cjs/ListTable.d.ts +1 -0
  2. package/cjs/ListTable.js +6 -3
  3. package/cjs/ListTable.js.map +1 -1
  4. package/cjs/body-helper/body-helper.js +2 -1
  5. package/cjs/body-helper/style.js +1 -2
  6. package/cjs/core/BaseTable.d.ts +2 -2
  7. package/cjs/core/BaseTable.js +9 -7
  8. package/cjs/core/BaseTable.js.map +1 -1
  9. package/cjs/core/TABLE_EVENT_TYPE.d.ts +2 -0
  10. package/cjs/core/TABLE_EVENT_TYPE.js +3 -1
  11. package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
  12. package/cjs/data/DataSource.d.ts +1 -1
  13. package/cjs/data/DataSource.js +2 -2
  14. package/cjs/data/DataSource.js.map +1 -1
  15. package/cjs/dataset/dataset-pivot-table.js +1 -2
  16. package/cjs/dataset/flatDataToObject.js +2 -1
  17. package/cjs/header-helper/header-helper.js +1 -1
  18. package/cjs/header-helper/style.js +1 -1
  19. package/cjs/index.d.ts +1 -1
  20. package/cjs/index.js +1 -1
  21. package/cjs/index.js.map +1 -1
  22. package/cjs/layout/index.js +1 -2
  23. package/cjs/layout/simple-header-layout.js +1 -1
  24. package/cjs/layout/tree-helper.js +1 -1
  25. package/cjs/plugins/interface.js +2 -1
  26. package/cjs/plugins/invert-highlight.js +1 -1
  27. package/cjs/plugins/list-tree-stick-cell.js +1 -1
  28. package/cjs/plugins/plugin-manager.d.ts +2 -0
  29. package/cjs/plugins/plugin-manager.js +14 -7
  30. package/cjs/plugins/plugin-manager.js.map +1 -1
  31. package/cjs/scenegraph/graphic/active-cell-chart-list.js +45 -63
  32. package/cjs/scenegraph/graphic/active-cell-chart-list.js.map +1 -1
  33. package/cjs/scenegraph/graphic/chart.js +3 -10
  34. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  35. package/cjs/state/state.js +9 -9
  36. package/cjs/state/state.js.map +1 -1
  37. package/cjs/ts-types/base-table.d.ts +2 -2
  38. package/cjs/ts-types/base-table.js.map +1 -1
  39. package/cjs/ts-types/events.d.ts +8 -0
  40. package/cjs/ts-types/events.js.map +1 -1
  41. package/cjs/ts-types/table-engine.d.ts +2 -2
  42. package/cjs/ts-types/table-engine.js.map +1 -1
  43. package/cjs/vrender.js.map +1 -1
  44. package/dist/vtable.js +128 -160
  45. package/dist/vtable.min.js +2 -2
  46. package/es/ListTable.d.ts +1 -0
  47. package/es/ListTable.js +7 -4
  48. package/es/ListTable.js.map +1 -1
  49. package/es/body-helper/body-helper.js +2 -1
  50. package/es/body-helper/style.js +1 -2
  51. package/es/core/BaseTable.d.ts +2 -2
  52. package/es/core/BaseTable.js +9 -7
  53. package/es/core/BaseTable.js.map +1 -1
  54. package/es/core/TABLE_EVENT_TYPE.d.ts +2 -0
  55. package/es/core/TABLE_EVENT_TYPE.js +3 -1
  56. package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
  57. package/es/data/DataSource.d.ts +1 -1
  58. package/es/data/DataSource.js +2 -2
  59. package/es/data/DataSource.js.map +1 -1
  60. package/es/dataset/dataset-pivot-table.js +1 -2
  61. package/es/dataset/flatDataToObject.js +2 -1
  62. package/es/header-helper/header-helper.js +1 -1
  63. package/es/header-helper/style.js +1 -1
  64. package/es/index.d.ts +1 -1
  65. package/es/index.js +1 -1
  66. package/es/index.js.map +1 -1
  67. package/es/layout/index.js +1 -2
  68. package/es/layout/simple-header-layout.js +1 -1
  69. package/es/layout/tree-helper.js +1 -1
  70. package/es/plugins/interface.js +2 -1
  71. package/es/plugins/invert-highlight.js +1 -1
  72. package/es/plugins/list-tree-stick-cell.js +1 -1
  73. package/es/plugins/plugin-manager.d.ts +2 -0
  74. package/es/plugins/plugin-manager.js +14 -7
  75. package/es/plugins/plugin-manager.js.map +1 -1
  76. package/es/scenegraph/graphic/active-cell-chart-list.js +45 -63
  77. package/es/scenegraph/graphic/active-cell-chart-list.js.map +1 -1
  78. package/es/scenegraph/graphic/chart.js +3 -10
  79. package/es/scenegraph/graphic/chart.js.map +1 -1
  80. package/es/state/state.js +9 -9
  81. package/es/state/state.js.map +1 -1
  82. package/es/ts-types/base-table.d.ts +2 -2
  83. package/es/ts-types/base-table.js.map +1 -1
  84. package/es/ts-types/events.d.ts +8 -0
  85. package/es/ts-types/events.js.map +1 -1
  86. package/es/ts-types/table-engine.d.ts +2 -2
  87. package/es/ts-types/table-engine.js.map +1 -1
  88. package/es/vrender.js.map +1 -1
  89. package/package.json +9 -9
package/dist/vtable.js CHANGED
@@ -9498,7 +9498,7 @@
9498
9498
  }
9499
9499
  }]), noAnimateAttrs && this.setAttributesAndPreventAnimate(noAnimateAttrs, !1, {
9500
9500
  type: AttributeUpdateType.STATE
9501
- }), this.finalAttribute && Object.assign(this.finalAttribute, attrs);
9501
+ });
9502
9502
  } else this.stopStateAnimates(), this.setAttributesAndPreventAnimate(attrs, !1, {
9503
9503
  type: AttributeUpdateType.STATE
9504
9504
  }), this.finalAttribute && Object.assign(this.finalAttribute, attrs);
@@ -9524,7 +9524,7 @@
9524
9524
  getNormalAttribute(key) {
9525
9525
  var _a, _b;
9526
9526
  const value = this.attribute[key];
9527
- return this.animates && this.animates.size ? null === (_a = this.finalAttribute) || void 0 === _a ? void 0 : _a[key] : null != value ? value : null === (_b = this.finalAttribute) || void 0 === _b ? void 0 : _b[key];
9527
+ return this.animates ? null === (_a = this.finalAttribute) || void 0 === _a ? void 0 : _a[key] : null != value ? value : null === (_b = this.finalAttribute) || void 0 === _b ? void 0 : _b[key];
9528
9528
  }
9529
9529
  clearStates(hasAnimation) {
9530
9530
  this.hasState() && this.normalAttrs ? (this.currentStates = [], this.applyStateAttrs(this.normalAttrs, this.currentStates, hasAnimation, !0)) : this.currentStates = [], this.normalAttrs = null;
@@ -36463,7 +36463,9 @@
36463
36463
  DELETE_RECORD: 'delete_record',
36464
36464
  UPDATE_RECORD: 'update_record',
36465
36465
  ADD_COLUMN: 'add_column',
36466
- DELETE_COLUMN: 'delete_column'
36466
+ DELETE_COLUMN: 'delete_column',
36467
+ FILTER_MENU_SHOW: 'filter_menu_show',
36468
+ FILTER_MENU_HIDE: 'filter_menu_hide'
36467
36469
  };
36468
36470
 
36469
36471
  const judgeType = (value) => {
@@ -38755,7 +38757,7 @@
38755
38757
  }
38756
38758
  initChildrenNodeHierarchy(indexKey, hierarchyExpandLevel, currentLevel, nodeData) {
38757
38759
  let childTotalLength = 0;
38758
- const nodeLength = nodeData.filteredChildren ? nodeData.filteredChildren.length : nodeData.children?.length ?? 0;
38760
+ const nodeLength = nodeData.filteredChildren ? nodeData.filteredChildren.length : (nodeData.children?.length ?? 0);
38759
38761
  for (let j = 0; j < nodeLength; j++) {
38760
38762
  if (currentLevel <= hierarchyExpandLevel || nodeData.hierarchyState === HierarchyState.expand) {
38761
38763
  childTotalLength += 1;
@@ -39310,10 +39312,13 @@
39310
39312
  this.pagination.totalCount = this._sourceLength;
39311
39313
  }
39312
39314
  }
39313
- updateFilterRules(filterRules) {
39315
+ updateFilterRules(filterRules, onFilterRecordsEnd) {
39314
39316
  this.lastFilterRules = this.dataConfig.filterRules;
39315
39317
  this.dataConfig.filterRules = filterRules;
39316
39318
  this._source = this.processRecords(this.dataSourceObj?.records ?? this.dataSourceObj);
39319
+ if (onFilterRecordsEnd) {
39320
+ this._source = onFilterRecordsEnd(this._source);
39321
+ }
39317
39322
  this._sourceLength = this._source?.length || 0;
39318
39323
  this.currentIndexedData = Array.from({ length: this._sourceLength }, (_, i) => i);
39319
39324
  if (this.userPagination) {
@@ -49026,47 +49031,32 @@
49026
49031
  chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance;
49027
49032
  }
49028
49033
  }
49029
- setTimeout(() => {
49030
- if (chartInstanceListColumnByColumnDirection[col]?.[i]) {
49031
- const chartDimensionLinkage = table.options.chartDimensionLinkage;
49032
- let isShowTooltip = !isScatter;
49033
- if (!isScatter && typeof chartDimensionLinkage === 'object') {
49034
- isShowTooltip = chartDimensionLinkage.showTooltip ?? true;
49035
- if (i === rowEnd && isShowTooltip) {
49036
- const heightLimitToShowTooltipForEdgeRow = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow ?? 0;
49037
- const { rowEnd: rowEnd1 } = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
49038
- if (rowEnd1 === rowEnd) {
49039
- isShowTooltip = true;
49040
- }
49041
- else {
49042
- const { rowEnd: rowEnd2 } = table.getBodyVisibleRowRange(0, 5);
49043
- if (rowEnd2 !== rowEnd) {
49044
- isShowTooltip = true;
49045
- }
49046
- else {
49047
- isShowTooltip = false;
49048
- }
49049
- }
49050
- }
49051
- else if (i === rowStart && isShowTooltip) {
49052
- const heightLimitToShowTooltipForEdgeRow = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow ?? 0;
49053
- const { rowStart: rowStart1 } = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
49054
- if (rowStart1 === rowStart) {
49055
- isShowTooltip = true;
49056
- }
49057
- else {
49058
- const { rowStart: rowStart2 } = table.getBodyVisibleRowRange(0, -5);
49059
- if (rowStart2 !== rowStart) {
49034
+ if (table.stateManager.hover.cellPos.col !== col || table.stateManager.hover.cellPos.row !== i) {
49035
+ setTimeout(() => {
49036
+ if (chartInstanceListColumnByColumnDirection[col]?.[i]) {
49037
+ const absolutePosition = table.getCellRelativeRect(col, i);
49038
+ const chartDimensionLinkage = table.options.chartDimensionLinkage;
49039
+ let isShowTooltip = !isScatter;
49040
+ if (!isScatter && typeof chartDimensionLinkage === 'object') {
49041
+ isShowTooltip = chartDimensionLinkage.showTooltip ?? true;
49042
+ if (i === rowEnd && isShowTooltip) {
49043
+ const heightLimitToShowTooltipForLastRow = chartDimensionLinkage.heightLimitToShowTooltipForLastRow;
49044
+ const { rowEnd: rowEnd1 } = table.getBodyVisibleRowRange(-heightLimitToShowTooltipForLastRow);
49045
+ if (rowEnd1 === rowEnd) {
49060
49046
  isShowTooltip = true;
49061
49047
  }
49062
49048
  else {
49063
- isShowTooltip = false;
49049
+ const { rowEnd: rowEnd2 } = table.getBodyVisibleRowRange(5);
49050
+ if (rowEnd2 !== rowEnd) {
49051
+ isShowTooltip = true;
49052
+ }
49053
+ else {
49054
+ isShowTooltip = false;
49055
+ }
49064
49056
  }
49065
49057
  }
49066
49058
  }
49067
- }
49068
- if (isScatter) {
49069
- if (table.stateManager.hover.cellPos.col !== col || table.stateManager.hover.cellPos.row !== i) {
49059
+ if (isScatter) {
49070
49060
  chartInstanceListColumnByColumnDirection[col][i].showCrosshair?.((axis) => {
49071
49061
  if (axis.layoutOrient === 'left') {
49072
49062
  return positionValueOrYValue;
@@ -49074,30 +49064,24 @@
49074
49064
  return dimensionValueOrXValue;
49075
49065
  });
49076
49066
  }
49077
- }
49078
- else {
49079
- const bodyBoundryTop = table.frozenRowCount
49080
- ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom
49081
- : 0;
49082
- const absolutePositionTop = Math.max(bodyBoundryTop, table.getCellRelativeRect(col, i).top);
49083
- if (hideTooltip) {
49084
- if (table.stateManager.hover.cellPos.col !== col || table.stateManager.hover.cellPos.row !== i) {
49067
+ else {
49068
+ if (hideTooltip) {
49085
49069
  chartInstanceListColumnByColumnDirection[col][i].hideTooltip();
49070
+ chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
49071
+ tooltip: false,
49072
+ showTooltipOption: { x: canvasXY.x, y: absolutePosition.top + 3, activeType: 'dimension' }
49073
+ });
49074
+ }
49075
+ else {
49076
+ chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
49077
+ tooltip: isShowTooltip,
49078
+ showTooltipOption: { x: canvasXY.x, y: absolutePosition.top + 3, activeType: 'dimension' }
49079
+ });
49086
49080
  }
49087
- chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
49088
- tooltip: false,
49089
- showTooltipOption: { x: canvasXY.x, y: absolutePositionTop, activeType: 'dimension' }
49090
- });
49091
- }
49092
- else {
49093
- chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
49094
- tooltip: isShowTooltip,
49095
- showTooltipOption: { x: canvasXY.x, y: absolutePositionTop, activeType: 'dimension' }
49096
- });
49097
49081
  }
49098
49082
  }
49099
- }
49100
- }, 0);
49083
+ }, 0);
49084
+ }
49101
49085
  table.scenegraph.updateNextFrame();
49102
49086
  }
49103
49087
  }
@@ -49143,47 +49127,32 @@
49143
49127
  chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance;
49144
49128
  }
49145
49129
  }
49146
- setTimeout(() => {
49147
- if (chartInstanceListRowByRowDirection[row]?.[i]) {
49148
- const chartDimensionLinkage = table.options.chartDimensionLinkage;
49149
- let isShowTooltip = !isScatter;
49150
- if (!isScatter && typeof chartDimensionLinkage === 'object') {
49151
- isShowTooltip = chartDimensionLinkage.showTooltip ?? true;
49152
- if (i === colEnd && isShowTooltip) {
49153
- const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn;
49154
- const { colEnd: colEnd1 } = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
49155
- if (colEnd1 === colEnd) {
49156
- isShowTooltip = true;
49157
- }
49158
- else {
49159
- const { colEnd: colEnd2 } = table.getBodyVisibleColRange(0, 5);
49160
- if (colEnd2 !== colEnd) {
49161
- isShowTooltip = true;
49162
- }
49163
- else {
49164
- isShowTooltip = false;
49165
- }
49166
- }
49167
- }
49168
- else if (i === colStart && isShowTooltip) {
49169
- const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn;
49170
- const { colStart: colStart1 } = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
49171
- if (colStart1 === colStart) {
49172
- isShowTooltip = true;
49173
- }
49174
- else {
49175
- const { colStart: colStart2 } = table.getBodyVisibleColRange(0, -5);
49176
- if (colStart2 !== colStart) {
49130
+ if (table.stateManager.hover.cellPos.col !== i || table.stateManager.hover.cellPos.row !== row) {
49131
+ setTimeout(() => {
49132
+ if (chartInstanceListRowByRowDirection[row]?.[i]) {
49133
+ const absolutePosition = table.getCellRelativeRect(i, row);
49134
+ const chartDimensionLinkage = table.options.chartDimensionLinkage;
49135
+ let isShowTooltip = !isScatter;
49136
+ if (!isScatter && typeof chartDimensionLinkage === 'object') {
49137
+ isShowTooltip = chartDimensionLinkage.showTooltip ?? true;
49138
+ if (i === colEnd && isShowTooltip) {
49139
+ const widthLimitToShowTooltipForLastColumn = chartDimensionLinkage.widthLimitToShowTooltipForLastColumn;
49140
+ const { colEnd: colEnd1 } = table.getBodyVisibleColRange(-widthLimitToShowTooltipForLastColumn);
49141
+ if (colEnd1 === colEnd) {
49177
49142
  isShowTooltip = true;
49178
49143
  }
49179
49144
  else {
49180
- isShowTooltip = false;
49145
+ const { colEnd: colEnd2 } = table.getBodyVisibleColRange(5);
49146
+ if (colEnd2 !== colEnd) {
49147
+ isShowTooltip = true;
49148
+ }
49149
+ else {
49150
+ isShowTooltip = false;
49151
+ }
49181
49152
  }
49182
49153
  }
49183
49154
  }
49184
- }
49185
- if (isScatter) {
49186
- if (table.stateManager.hover.cellPos.col !== i || table.stateManager.hover.cellPos.row !== row) {
49155
+ if (isScatter) {
49187
49156
  chartInstanceListRowByRowDirection[row][i].showCrosshair?.((axis) => {
49188
49157
  if (axis.layoutOrient === 'left') {
49189
49158
  return positionValueOrYValue;
@@ -49191,30 +49160,24 @@
49191
49160
  return dimensionValueOrXValue;
49192
49161
  });
49193
49162
  }
49194
- }
49195
- else {
49196
- const bodyBoundryLeft = table.frozenColCount
49197
- ? table.getCellRelativeRect(table.frozenColCount - 1, row).right
49198
- : 0;
49199
- const absolutePositionLeft = Math.max(bodyBoundryLeft, table.getCellRelativeRect(i, row).left);
49200
- if (hideTooltip) {
49201
- if (table.stateManager.hover.cellPos.col !== i || table.stateManager.hover.cellPos.row !== row) {
49163
+ else {
49164
+ if (hideTooltip) {
49202
49165
  chartInstanceListRowByRowDirection[row][i].hideTooltip();
49166
+ chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
49167
+ tooltip: false,
49168
+ showTooltipOption: { x: absolutePosition.left + 3, y: canvasXY.y, activeType: 'dimension' }
49169
+ });
49170
+ }
49171
+ else {
49172
+ chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
49173
+ tooltip: isShowTooltip,
49174
+ showTooltipOption: { x: absolutePosition.left + 3, y: canvasXY.y, activeType: 'dimension' }
49175
+ });
49203
49176
  }
49204
- chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
49205
- tooltip: false,
49206
- showTooltipOption: { x: absolutePositionLeft, y: canvasXY.y, activeType: 'dimension' }
49207
- });
49208
- }
49209
- else {
49210
- chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
49211
- tooltip: isShowTooltip,
49212
- showTooltipOption: { x: absolutePositionLeft, y: canvasXY.y, activeType: 'dimension' }
49213
- });
49214
49177
  }
49215
49178
  }
49216
- }
49217
- }, 0);
49179
+ }, 0);
49180
+ }
49218
49181
  table.scenegraph.updateNextFrame();
49219
49182
  }
49220
49183
  }
@@ -50284,17 +50247,7 @@
50284
50247
  context.fill();
50285
50248
  }
50286
50249
  }
50287
- },
50288
- componentShowContent: table.options.chartDimensionLinkage &&
50289
- this.attribute.spec.type !== 'scatter'
50290
- ? {
50291
- tooltip: {
50292
- dimension: false,
50293
- mark: true
50294
- },
50295
- crosshair: false
50296
- }
50297
- : undefined
50250
+ }
50298
50251
  }));
50299
50252
  const chartStage = this.activeChartInstance.getStage();
50300
50253
  const matrix = this.globalTransMatrix.clone();
@@ -50405,7 +50358,10 @@
50405
50358
  }
50406
50359
  if (indicatorsAsCol) {
50407
50360
  const series = dimensionInfo.data[0].series;
50408
- const width = this.attribute.spec.type === 'histogram' || series.type === 'line' || series.type === 'area'
50361
+ const width = this.attribute.spec.type === 'histogram' ||
50362
+ this.attribute.spec.type === 'boxPlot' ||
50363
+ series.type === 'line' ||
50364
+ series.type === 'area'
50409
50365
  ? 0
50410
50366
  : series.getYAxisHelper().getBandwidth(0);
50411
50367
  let y = series.valueToPositionY(dimensionValue);
@@ -50428,7 +50384,10 @@
50428
50384
  }
50429
50385
  else {
50430
50386
  const series = dimensionInfo.data[0].series;
50431
- const width = this.attribute.spec.type === 'histogram' || series.type === 'line' || series.type === 'area'
50387
+ const width = this.attribute.spec.type === 'histogram' ||
50388
+ this.attribute.spec.type === 'boxPlot' ||
50389
+ series.type === 'line' ||
50390
+ series.type === 'area'
50432
50391
  ? 0
50433
50392
  : series.getXAxisHelper().getBandwidth(0);
50434
50393
  let x = series.valueToPositionX(dimensionValue);
@@ -61968,7 +61927,7 @@
61968
61927
  function flatten(cols, parentStartIndex = 0) {
61969
61928
  cols.forEach((col) => {
61970
61929
  const startIndex = col.startInTotal
61971
- ? col.startInTotal + state.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount ?? 0
61930
+ ? (col.startInTotal + state.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount ?? 0)
61972
61931
  : parentStartIndex;
61973
61932
  if (col.columns) {
61974
61933
  flatten(col.columns, startIndex);
@@ -62452,10 +62411,10 @@
62452
62411
  setScrollTop(top, event, triggerEvent = true) {
62453
62412
  const totalHeight = this.table.getAllRowsHeight();
62454
62413
  const sizeTolerance = this.table.options.customConfig?._disableColumnAndRowSizeRound ? 1 : 0;
62455
- top = Math.max(0, Math.min(top, totalHeight - this.table.scenegraph.height - sizeTolerance));
62414
+ top = Math.max(0, Math.min(top, totalHeight - (this.table.scenegraph?.height ?? 0) - sizeTolerance));
62456
62415
  top = Math.ceil(top);
62457
62416
  const oldVerticalBarPos = this.scroll.verticalBarPos;
62458
- const yRatio = top / (totalHeight - this.table.scenegraph.height);
62417
+ const yRatio = top / (totalHeight - (this.table.scenegraph?.height ?? 0));
62459
62418
  if ((oldVerticalBarPos !== top || this.table.options?.customConfig?.scrollEventAlwaysTrigger === true) &&
62460
62419
  triggerEvent) {
62461
62420
  let verticalBarPos = top;
@@ -62476,7 +62435,7 @@
62476
62435
  dy
62477
62436
  });
62478
62437
  if (canScroll.some(value => value === false)) {
62479
- const yRatio = this.scroll.verticalBarPos / (totalHeight - this.table.scenegraph.height);
62438
+ const yRatio = this.scroll.verticalBarPos / (totalHeight - (this.table.scenegraph?.height ?? 0));
62480
62439
  this.table.scenegraph.component.updateVerticalScrollBarPos(yRatio);
62481
62440
  return;
62482
62441
  }
@@ -70068,6 +70027,7 @@
70068
70027
  class PluginManager {
70069
70028
  plugins = new Map();
70070
70029
  table;
70030
+ pluginEventMap = new Map();
70071
70031
  constructor(table, options) {
70072
70032
  this.table = table;
70073
70033
  options.plugins?.map(plugin => {
@@ -70088,29 +70048,35 @@
70088
70048
  return Array.from(this.plugins.values()).find(plugin => plugin.name === name);
70089
70049
  }
70090
70050
  _bindTableEventForPlugin(plugin) {
70091
- plugin.runTime?.forEach(runTime => {
70092
- this.table.on(runTime, (...args) => {
70051
+ plugin.runTime?.forEach((runTime) => {
70052
+ const id = this.table.on(runTime, (...args) => {
70093
70053
  plugin.run?.(...args, runTime, this.table);
70094
70054
  });
70055
+ this.pluginEventMap.set(plugin.id, [...(this.pluginEventMap.get(plugin.id) || []), id]);
70095
70056
  });
70096
70057
  }
70097
- updatePlugins(plugins) {
70058
+ removeOrAddPlugins(plugins) {
70098
70059
  const removedPlugins = Array.from(this.plugins.values()).filter(plugin => !plugins?.some(p => p.id === plugin.id));
70099
70060
  removedPlugins.forEach(plugin => {
70061
+ this.pluginEventMap.get(plugin.id)?.forEach(id => {
70062
+ this.table.off(id);
70063
+ });
70100
70064
  this.release();
70101
70065
  this.plugins.delete(plugin.id);
70102
70066
  });
70103
- this.plugins.forEach(plugin => {
70104
- if (plugin.update) {
70105
- plugin.update();
70106
- }
70107
- });
70108
70067
  const addedPlugins = plugins?.filter(plugin => !this.plugins.has(plugin.id));
70109
70068
  addedPlugins?.forEach(plugin => {
70110
70069
  this.register(plugin);
70111
70070
  this._bindTableEventForPlugin(plugin);
70112
70071
  });
70113
70072
  }
70073
+ updatePlugins(plugins) {
70074
+ plugins?.forEach(plugin => {
70075
+ if (plugin.update) {
70076
+ plugin.update();
70077
+ }
70078
+ });
70079
+ }
70114
70080
  release() {
70115
70081
  this.plugins.forEach(plugin => {
70116
70082
  plugin.release?.(this.table);
@@ -70155,7 +70121,7 @@
70155
70121
  return TABLE_EVENT_TYPE;
70156
70122
  }
70157
70123
  options;
70158
- version = "1.22.7-alpha.5";
70124
+ version = "1.22.7-alpha.7";
70159
70125
  pagination;
70160
70126
  id = `VTable${Date.now()}`;
70161
70127
  headerStyleCache;
@@ -71033,13 +70999,13 @@
71033
70999
  getDefaultColumnWidth(col) {
71034
71000
  if (this.isRowHeader(col, 0) || this.isCornerHeader(col, 0)) {
71035
71001
  return Array.isArray(this.defaultHeaderColWidth)
71036
- ? this.defaultHeaderColWidth[col] ?? this.defaultColWidth
71002
+ ? (this.defaultHeaderColWidth[col] ?? this.defaultColWidth)
71037
71003
  : this.defaultHeaderColWidth;
71038
71004
  }
71039
71005
  else if (this.isRightFrozenColumn(col, this.columnHeaderLevelCount)) {
71040
71006
  if (this.isPivotTable()) {
71041
71007
  return Array.isArray(this.defaultHeaderColWidth)
71042
- ? this.defaultHeaderColWidth[this.rowHeaderLevelCount - this.rightFrozenColCount] ?? this.defaultColWidth
71008
+ ? (this.defaultHeaderColWidth[this.rowHeaderLevelCount - this.rightFrozenColCount] ?? this.defaultColWidth)
71043
71009
  : this.defaultHeaderColWidth;
71044
71010
  }
71045
71011
  return this.defaultColWidth;
@@ -71049,12 +71015,12 @@
71049
71015
  getDefaultRowHeight(row) {
71050
71016
  if (this.isColumnHeader(0, row) || this.isCornerHeader(0, row) || this.isSeriesNumberInHeader(0, row)) {
71051
71017
  return Array.isArray(this.defaultHeaderRowHeight)
71052
- ? this.defaultHeaderRowHeight[row] ?? this.internalProps.defaultRowHeight
71018
+ ? (this.defaultHeaderRowHeight[row] ?? this.internalProps.defaultRowHeight)
71053
71019
  : this.defaultHeaderRowHeight;
71054
71020
  }
71055
71021
  if (this.isBottomFrozenRow(row)) {
71056
71022
  return Array.isArray(this.defaultHeaderRowHeight)
71057
- ? this.defaultHeaderRowHeight[this.columnHeaderLevelCount > 0 ? this.columnHeaderLevelCount - this.bottomFrozenRowCount : 0] ?? this.internalProps.defaultRowHeight
71023
+ ? (this.defaultHeaderRowHeight[this.columnHeaderLevelCount > 0 ? this.columnHeaderLevelCount - this.bottomFrozenRowCount : 0] ?? this.internalProps.defaultRowHeight)
71058
71024
  : this.defaultHeaderRowHeight;
71059
71025
  }
71060
71026
  return this.internalProps.defaultRowHeight;
@@ -71258,14 +71224,14 @@
71258
71224
  this.colContentWidthsMap.put(col, width);
71259
71225
  }
71260
71226
  getAllRowsHeight() {
71261
- if (this.internalProps.rowCount <= 0) {
71227
+ if (!this.internalProps?.rowCount || this.internalProps.rowCount <= 0) {
71262
71228
  return 0;
71263
71229
  }
71264
71230
  const h = this.getRowsHeight(0, this.internalProps.rowCount - 1);
71265
71231
  return h;
71266
71232
  }
71267
71233
  getAllColsWidth() {
71268
- if (this.internalProps.colCount <= 0) {
71234
+ if (!this.internalProps?.colCount || this.internalProps.colCount <= 0) {
71269
71235
  return 0;
71270
71236
  }
71271
71237
  const w = this.getColsWidth(0, this.internalProps.colCount - 1);
@@ -71627,26 +71593,26 @@
71627
71593
  }
71628
71594
  return { rowStart, colStart, rowEnd, colEnd };
71629
71595
  }
71630
- getBodyVisibleRowRange(start_deltaY = 0, end_deltaY = 0) {
71596
+ getBodyVisibleRowRange(deltaY = 0) {
71631
71597
  const { scrollTop } = this;
71632
71598
  const frozenRowsHeight = this.getFrozenRowsHeight();
71633
71599
  const bottomFrozenRowsHeight = this.getBottomFrozenRowsHeight();
71634
- const { row: rowStart } = this.getRowAt(scrollTop + frozenRowsHeight + 1 + start_deltaY);
71600
+ const { row: rowStart } = this.getRowAt(scrollTop + frozenRowsHeight + 1);
71635
71601
  const rowEnd = this.getAllRowsHeight() > this.tableNoFrameHeight
71636
- ? this.getRowAt(scrollTop + this.tableNoFrameHeight - 1 - bottomFrozenRowsHeight + end_deltaY).row
71602
+ ? this.getRowAt(scrollTop + this.tableNoFrameHeight - 1 - bottomFrozenRowsHeight + deltaY).row
71637
71603
  : this.rowCount - 1;
71638
71604
  if (rowEnd < 0) {
71639
71605
  return null;
71640
71606
  }
71641
71607
  return { rowStart, rowEnd };
71642
71608
  }
71643
- getBodyVisibleColRange(start_deltaX = 0, end_deltaX = 0) {
71609
+ getBodyVisibleColRange(deltaX = 0) {
71644
71610
  const { scrollLeft } = this;
71645
71611
  const frozenColsWidth = this.getFrozenColsWidth();
71646
71612
  const rightFrozenColsWidth = this.getRightFrozenColsWidth();
71647
- const { col: colStart } = this.getColAt(scrollLeft + frozenColsWidth + 1 + start_deltaX);
71613
+ const { col: colStart } = this.getColAt(scrollLeft + frozenColsWidth + 1);
71648
71614
  const colEnd = this.getAllColsWidth() > this.tableNoFrameWidth
71649
- ? this.getColAt(scrollLeft + this.tableNoFrameWidth - 1 - rightFrozenColsWidth + end_deltaX).col
71615
+ ? this.getColAt(scrollLeft + this.tableNoFrameWidth - 1 - rightFrozenColsWidth + deltaX).col
71650
71616
  : this.colCount - 1;
71651
71617
  if (colEnd < 0) {
71652
71618
  return null;
@@ -78320,6 +78286,7 @@
78320
78286
  clearRowHeightCache: true
78321
78287
  }) {
78322
78288
  const internalProps = this.internalProps;
78289
+ this.pluginManager.removeOrAddPlugins(options.plugins);
78323
78290
  super.updateOption(options, updateConfig);
78324
78291
  internalProps.frozenColDragHeaderMode =
78325
78292
  options.dragOrder?.frozenColDragHeaderMode ?? options.frozenColDragHeaderMode;
@@ -78779,11 +78746,12 @@
78779
78746
  sortRecords(this);
78780
78747
  }
78781
78748
  else {
78782
- this.dataSource.updateFilterRules(filterRules);
78749
+ this.dataSource.updateFilterRules(filterRules, options?.onFilterRecordsEnd);
78783
78750
  }
78784
78751
  this.refreshRowColCount();
78785
78752
  this.stateManager.initCheckedState(this.records);
78786
78753
  this.scenegraph.createSceneGraph(!!!options?.clearRowHeightCache);
78754
+ this.internalProps.emptyTip?.resetVisible();
78787
78755
  this.resize();
78788
78756
  }
78789
78757
  getFilteredRecords() {
@@ -78815,7 +78783,7 @@
78815
78783
  return state && state[field];
78816
78784
  });
78817
78785
  }
78818
- return new Array(...this.stateManager.checkedState.values());
78786
+ return [...this.stateManager.checkedState.values()];
78819
78787
  }
78820
78788
  getCellCheckboxState(col, row) {
78821
78789
  const define = this.getBodyColumnDefine(col, row);
@@ -78950,8 +78918,8 @@
78950
78918
  getEditor(col, row) {
78951
78919
  const define = this.getBodyColumnDefine(col, row);
78952
78920
  let editorDefine = this.isHeader(col, row)
78953
- ? define?.headerEditor ?? this.options.headerEditor
78954
- : define?.editor ?? this.options.editor;
78921
+ ? (define?.headerEditor ?? this.options.headerEditor)
78922
+ : (define?.editor ?? this.options.editor);
78955
78923
  if (typeof editorDefine === 'function') {
78956
78924
  const arg = {
78957
78925
  col,
@@ -78970,8 +78938,8 @@
78970
78938
  isHasEditorDefine(col, row) {
78971
78939
  const define = this.getBodyColumnDefine(col, row);
78972
78940
  let editorDefine = this.isHeader(col, row)
78973
- ? define?.headerEditor ?? this.options.headerEditor
78974
- : define?.editor ?? this.options.editor;
78941
+ ? (define?.headerEditor ?? this.options.headerEditor)
78942
+ : (define?.editor ?? this.options.editor);
78975
78943
  if (typeof editorDefine === 'function') {
78976
78944
  const arg = {
78977
78945
  col,
@@ -94887,7 +94855,7 @@
94887
94855
  }
94888
94856
 
94889
94857
  registerForVrender();
94890
- const version = "1.22.7-alpha.5";
94858
+ const version = "1.22.7-alpha.7";
94891
94859
  function getIcons() {
94892
94860
  return get$2();
94893
94861
  }