@visactor/vtable 1.22.11-alpha.0 → 1.22.11-alpha.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 (137) hide show
  1. package/cjs/ListTable.d.ts +34 -7
  2. package/cjs/ListTable.js +134 -14
  3. package/cjs/ListTable.js.map +1 -1
  4. package/cjs/PivotChart.d.ts +0 -1
  5. package/cjs/PivotChart.js +4 -5
  6. package/cjs/PivotChart.js.map +1 -1
  7. package/cjs/core/BaseTable.js +1 -1
  8. package/cjs/core/BaseTable.js.map +1 -1
  9. package/cjs/core/TABLE_EVENT_TYPE.d.ts +1 -0
  10. package/cjs/core/TABLE_EVENT_TYPE.js +1 -0
  11. package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
  12. package/cjs/core/index.d.ts +1 -0
  13. package/cjs/core/index.js +30 -0
  14. package/cjs/core/index.js.map +1 -0
  15. package/cjs/core/record-helper.d.ts +4 -2
  16. package/cjs/core/record-helper.js +81 -24
  17. package/cjs/core/record-helper.js.map +1 -1
  18. package/cjs/data/DataSource.d.ts +1 -0
  19. package/cjs/data/DataSource.js +25 -3
  20. package/cjs/data/DataSource.js.map +1 -1
  21. package/cjs/dataset/DataStatistics.js +1 -2
  22. package/cjs/dataset/dataset-pivot-table.js +2 -1
  23. package/cjs/event/event.d.ts +2 -1
  24. package/cjs/event/event.js +20 -9
  25. package/cjs/event/event.js.map +1 -1
  26. package/cjs/event/listener/table-group.js +6 -10
  27. package/cjs/event/listener/table-group.js.map +1 -1
  28. package/cjs/header-helper/style.js +1 -2
  29. package/cjs/index.d.ts +1 -1
  30. package/cjs/index.js +1 -1
  31. package/cjs/index.js.map +1 -1
  32. package/cjs/layout/pivot-header-layout.d.ts +0 -6
  33. package/cjs/layout/pivot-header-layout.js +21 -40
  34. package/cjs/layout/pivot-header-layout.js.map +1 -1
  35. package/cjs/layout/row-height-map.js +1 -1
  36. package/cjs/layout/simple-header-layout.js +1 -1
  37. package/cjs/layout/tree-helper.js +1 -1
  38. package/cjs/plugins/custom-cell-style.js +2 -1
  39. package/cjs/plugins/index.js +1 -1
  40. package/cjs/plugins/interface.js +1 -1
  41. package/cjs/plugins/invert-highlight.js +1 -1
  42. package/cjs/plugins/list-tree-stick-cell.js +1 -1
  43. package/cjs/plugins/plugin-manager.js +1 -1
  44. package/cjs/scenegraph/graphic/active-cell-chart-list.d.ts +0 -2
  45. package/cjs/scenegraph/graphic/active-cell-chart-list.js +43 -101
  46. package/cjs/scenegraph/graphic/active-cell-chart-list.js.map +1 -1
  47. package/cjs/scenegraph/graphic/chart.d.ts +1 -8
  48. package/cjs/scenegraph/graphic/chart.js +18 -42
  49. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  50. package/cjs/scenegraph/graphic/contributions/chart-render.js +4 -3
  51. package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  52. package/cjs/scenegraph/refresh-node/update-chart.d.ts +1 -1
  53. package/cjs/scenegraph/refresh-node/update-chart.js +1 -2
  54. package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
  55. package/cjs/scenegraph/scenegraph.d.ts +2 -2
  56. package/cjs/scenegraph/scenegraph.js +8 -14
  57. package/cjs/scenegraph/scenegraph.js.map +1 -1
  58. package/cjs/tools/util.d.ts +0 -5
  59. package/cjs/tools/util.js +4 -22
  60. package/cjs/tools/util.js.map +1 -1
  61. package/cjs/ts-types/base-table.d.ts +2 -2
  62. package/cjs/ts-types/base-table.js.map +1 -1
  63. package/cjs/ts-types/events.d.ts +15 -0
  64. package/cjs/ts-types/events.js.map +1 -1
  65. package/cjs/ts-types/table-engine.d.ts +32 -12
  66. package/cjs/ts-types/table-engine.js.map +1 -1
  67. package/cjs/vrender.js.map +1 -1
  68. package/dist/vtable.js +515 -436
  69. package/dist/vtable.min.js +2 -2
  70. package/es/ListTable.d.ts +34 -7
  71. package/es/ListTable.js +130 -14
  72. package/es/ListTable.js.map +1 -1
  73. package/es/PivotChart.d.ts +0 -1
  74. package/es/PivotChart.js +4 -5
  75. package/es/PivotChart.js.map +1 -1
  76. package/es/core/BaseTable.js +1 -1
  77. package/es/core/BaseTable.js.map +1 -1
  78. package/es/core/TABLE_EVENT_TYPE.d.ts +1 -0
  79. package/es/core/TABLE_EVENT_TYPE.js +1 -0
  80. package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
  81. package/es/core/index.d.ts +1 -0
  82. package/es/core/index.js +2 -0
  83. package/es/core/index.js.map +1 -0
  84. package/es/core/record-helper.d.ts +4 -2
  85. package/es/core/record-helper.js +75 -20
  86. package/es/core/record-helper.js.map +1 -1
  87. package/es/data/DataSource.d.ts +1 -0
  88. package/es/data/DataSource.js +25 -3
  89. package/es/data/DataSource.js.map +1 -1
  90. package/es/dataset/DataStatistics.js +1 -2
  91. package/es/dataset/dataset-pivot-table.js +2 -1
  92. package/es/event/event.d.ts +2 -1
  93. package/es/event/event.js +20 -9
  94. package/es/event/event.js.map +1 -1
  95. package/es/event/listener/table-group.js +6 -9
  96. package/es/event/listener/table-group.js.map +1 -1
  97. package/es/header-helper/style.js +1 -2
  98. package/es/index.d.ts +1 -1
  99. package/es/index.js +1 -1
  100. package/es/index.js.map +1 -1
  101. package/es/layout/pivot-header-layout.d.ts +0 -6
  102. package/es/layout/pivot-header-layout.js +21 -40
  103. package/es/layout/pivot-header-layout.js.map +1 -1
  104. package/es/layout/row-height-map.js +1 -1
  105. package/es/layout/simple-header-layout.js +1 -1
  106. package/es/layout/tree-helper.js +1 -1
  107. package/es/plugins/custom-cell-style.js +2 -1
  108. package/es/plugins/index.js +1 -1
  109. package/es/plugins/interface.js +1 -1
  110. package/es/plugins/invert-highlight.js +1 -1
  111. package/es/plugins/list-tree-stick-cell.js +1 -1
  112. package/es/plugins/plugin-manager.js +1 -1
  113. package/es/scenegraph/graphic/active-cell-chart-list.d.ts +0 -2
  114. package/es/scenegraph/graphic/active-cell-chart-list.js +41 -96
  115. package/es/scenegraph/graphic/active-cell-chart-list.js.map +1 -1
  116. package/es/scenegraph/graphic/chart.d.ts +1 -8
  117. package/es/scenegraph/graphic/chart.js +17 -42
  118. package/es/scenegraph/graphic/chart.js.map +1 -1
  119. package/es/scenegraph/graphic/contributions/chart-render.js +4 -3
  120. package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  121. package/es/scenegraph/refresh-node/update-chart.d.ts +1 -1
  122. package/es/scenegraph/refresh-node/update-chart.js +1 -2
  123. package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
  124. package/es/scenegraph/scenegraph.d.ts +2 -2
  125. package/es/scenegraph/scenegraph.js +8 -14
  126. package/es/scenegraph/scenegraph.js.map +1 -1
  127. package/es/tools/util.d.ts +0 -5
  128. package/es/tools/util.js +0 -18
  129. package/es/tools/util.js.map +1 -1
  130. package/es/ts-types/base-table.d.ts +2 -2
  131. package/es/ts-types/base-table.js.map +1 -1
  132. package/es/ts-types/events.d.ts +15 -0
  133. package/es/ts-types/events.js.map +1 -1
  134. package/es/ts-types/table-engine.d.ts +32 -12
  135. package/es/ts-types/table-engine.js.map +1 -1
  136. package/es/vrender.js.map +1 -1
  137. package/package.json +3 -3
package/dist/vtable.js CHANGED
@@ -36018,47 +36018,6 @@
36018
36018
  }
36019
36019
  };
36020
36020
  }
36021
- function cancellableThrottle(func, delay) {
36022
- let timer = null;
36023
- let lastArgs = null;
36024
- let context = null;
36025
- const throttled = function (...args) {
36026
- lastArgs = args;
36027
- context = this;
36028
- if (!timer) {
36029
- timer = setTimeout(() => {
36030
- if (lastArgs) {
36031
- func.apply(context, lastArgs);
36032
- }
36033
- timer = null;
36034
- lastArgs = null;
36035
- context = null;
36036
- }, delay);
36037
- }
36038
- };
36039
- const cancel = () => {
36040
- if (timer) {
36041
- clearTimeout(timer);
36042
- timer = null;
36043
- lastArgs = null;
36044
- context = null;
36045
- }
36046
- };
36047
- const flush = () => {
36048
- if (timer && lastArgs) {
36049
- clearTimeout(timer);
36050
- func.apply(context, lastArgs);
36051
- timer = null;
36052
- lastArgs = null;
36053
- context = null;
36054
- }
36055
- };
36056
- return {
36057
- throttled,
36058
- cancel,
36059
- flush
36060
- };
36061
- }
36062
36021
  function pad(num, totalChars) {
36063
36022
  const pad = '0';
36064
36023
  num = `${num}`;
@@ -36451,6 +36410,7 @@
36451
36410
  AFTER_UPDATE_CELL_CONTENT_WIDTH: 'after_update_cell_content_width',
36452
36411
  AFTER_UPDATE_SELECT_BORDER_HEIGHT: 'after_update_select_border_height',
36453
36412
  CHANGE_CELL_VALUE: 'change_cell_value',
36413
+ CHANGE_CELL_VALUES: 'change_cell_values',
36454
36414
  DRAG_FILL_HANDLE_END: 'drag_fill_handle_end',
36455
36415
  MOUSEDOWN_FILL_HANDLE: 'mousedown_fill_handle',
36456
36416
  DBLCLICK_FILL_HANDLE: 'dblclick_fill_handle',
@@ -38967,6 +38927,48 @@
38967
38927
  }
38968
38928
  }
38969
38929
  }
38930
+ changeFieldValueByRecordIndex(value, recordIndex, field, table) {
38931
+ if (field === null) {
38932
+ return undefined;
38933
+ }
38934
+ if (recordIndex === undefined || recordIndex === null) {
38935
+ return;
38936
+ }
38937
+ const rawKey = recordIndex.toString();
38938
+ if (!this.beforeChangedRecordsMap.has(rawKey)) {
38939
+ const rawRecords = Array.isArray(this.dataSourceObj?.records)
38940
+ ? this.dataSourceObj.records
38941
+ : null;
38942
+ const originRecord = rawRecords
38943
+ ? Array.isArray(recordIndex)
38944
+ ? getValueFromDeepArray(rawRecords, recordIndex)
38945
+ : rawRecords[recordIndex]
38946
+ : undefined;
38947
+ this.beforeChangedRecordsMap.set(rawKey, cloneDeep(originRecord, undefined, ['vtable_gantt_linkedFrom', 'vtable_gantt_linkedTo']) ?? {});
38948
+ }
38949
+ if (typeof field === 'string' || typeof field === 'number') {
38950
+ const beforeChangedValue = this.beforeChangedRecordsMap.get(rawKey)?.[field];
38951
+ const rawRecords = Array.isArray(this.dataSourceObj?.records)
38952
+ ? this.dataSourceObj.records
38953
+ : null;
38954
+ const record = rawRecords
38955
+ ? Array.isArray(recordIndex)
38956
+ ? getValueFromDeepArray(rawRecords, recordIndex)
38957
+ : rawRecords[recordIndex]
38958
+ : undefined;
38959
+ let formatValue = value;
38960
+ if (typeof beforeChangedValue === 'number' && isAllDigits(value)) {
38961
+ formatValue = parseFloat(value);
38962
+ }
38963
+ if (record) {
38964
+ record[field] = formatValue;
38965
+ }
38966
+ else if (rawRecords && typeof recordIndex === 'number') {
38967
+ rawRecords[recordIndex] = this.addRecordRule === 'Array' ? [] : {};
38968
+ rawRecords[recordIndex][field] = formatValue;
38969
+ }
38970
+ }
38971
+ }
38970
38972
  cacheBeforeChangedRecord(dataIndex, table) {
38971
38973
  if (!this.beforeChangedRecordsMap.has(dataIndex.toString())) {
38972
38974
  const originRecord = this.getOriginalRecord(dataIndex);
@@ -39088,11 +39090,20 @@
39088
39090
  }
39089
39091
  }
39090
39092
  adjustBeforeChangedRecordsMap(insertIndex, insertCount, type = 'add') {
39091
- const length = this.beforeChangedRecordsMap.size;
39092
- for (let key = length - 1; key >= insertIndex; key--) {
39093
+ const delta = type === 'add' ? insertCount : -insertCount;
39094
+ const numericKeys = [];
39095
+ this.beforeChangedRecordsMap.forEach((_, key) => {
39096
+ const numKey = Number(key);
39097
+ if (Number.isInteger(numKey) && numKey.toString() === key && numKey >= insertIndex) {
39098
+ numericKeys.push(numKey);
39099
+ }
39100
+ });
39101
+ numericKeys.sort((a, b) => (type === 'add' ? b - a : a - b));
39102
+ for (let i = 0; i < numericKeys.length; i++) {
39103
+ const key = numericKeys[i];
39093
39104
  const record = this.beforeChangedRecordsMap.get(key.toString());
39094
39105
  this.beforeChangedRecordsMap.delete(key.toString());
39095
- this.beforeChangedRecordsMap.set((key + (type === 'add' ? insertCount : -insertCount)).toString(), record);
39106
+ this.beforeChangedRecordsMap.set((key + delta).toString(), record);
39096
39107
  }
39097
39108
  }
39098
39109
  deleteRecords(recordIndexs) {
@@ -39259,7 +39270,11 @@
39259
39270
  }
39260
39271
  }
39261
39272
  if (!filedMapArray.length) {
39262
- filedMapArray = states.map(() => ({ asc: [], desc: [], normal: [] }));
39273
+ filedMapArray = states.map(() => ({
39274
+ asc: [],
39275
+ desc: [],
39276
+ normal: []
39277
+ }));
39263
39278
  for (let index = 0; index < states.length; index++) {
39264
39279
  this.sortedIndexMap.set(states[index].field, filedMapArray[index]);
39265
39280
  }
@@ -49038,7 +49053,38 @@
49038
49053
  let isShowTooltip = !isScatter;
49039
49054
  if (!isScatter && typeof chartDimensionLinkage === 'object') {
49040
49055
  isShowTooltip = chartDimensionLinkage.showTooltip ?? true;
49041
- isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeRow(i, table);
49056
+ if (i === rowEnd && isShowTooltip) {
49057
+ const heightLimitToShowTooltipForEdgeRow = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow ?? 0;
49058
+ const { rowEnd: rowEnd1 } = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
49059
+ if (rowEnd1 === rowEnd) {
49060
+ isShowTooltip = true;
49061
+ }
49062
+ else {
49063
+ const { rowEnd: rowEnd2 } = table.getBodyVisibleRowRange(0, 5);
49064
+ if (rowEnd2 !== rowEnd) {
49065
+ isShowTooltip = true;
49066
+ }
49067
+ else {
49068
+ isShowTooltip = false;
49069
+ }
49070
+ }
49071
+ }
49072
+ else if (i === rowStart && isShowTooltip) {
49073
+ const heightLimitToShowTooltipForEdgeRow = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow ?? 0;
49074
+ const { rowStart: rowStart1 } = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
49075
+ if (rowStart1 === rowStart) {
49076
+ isShowTooltip = true;
49077
+ }
49078
+ else {
49079
+ const { rowStart: rowStart2 } = table.getBodyVisibleRowRange(0, -5);
49080
+ if (rowStart2 !== rowStart) {
49081
+ isShowTooltip = true;
49082
+ }
49083
+ else {
49084
+ isShowTooltip = false;
49085
+ }
49086
+ }
49087
+ }
49042
49088
  }
49043
49089
  if (isScatter) {
49044
49090
  if (table.stateManager.hover.cellPos.col !== col || table.stateManager.hover.cellPos.row !== i) {
@@ -49051,7 +49097,6 @@
49051
49097
  }
49052
49098
  }
49053
49099
  else {
49054
- const cellBoundry = table.getCellRelativeRect(col, i);
49055
49100
  const bodyBoundryTop = table.frozenRowCount
49056
49101
  ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom
49057
49102
  : 0;
@@ -49062,21 +49107,13 @@
49062
49107
  }
49063
49108
  chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
49064
49109
  tooltip: false,
49065
- showTooltipOption: {
49066
- x: canvasXY.x - cellBoundry.left,
49067
- y: absolutePositionTop - cellBoundry.top,
49068
- activeType: 'dimension'
49069
- }
49110
+ showTooltipOption: { x: canvasXY.x, y: absolutePositionTop, activeType: 'dimension' }
49070
49111
  });
49071
49112
  }
49072
49113
  else {
49073
49114
  chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
49074
49115
  tooltip: isShowTooltip,
49075
- showTooltipOption: {
49076
- x: canvasXY.x - cellBoundry.left,
49077
- y: absolutePositionTop - cellBoundry.top,
49078
- activeType: 'dimension'
49079
- }
49116
+ showTooltipOption: { x: canvasXY.x, y: absolutePositionTop, activeType: 'dimension' }
49080
49117
  });
49081
49118
  }
49082
49119
  }
@@ -49133,7 +49170,38 @@
49133
49170
  let isShowTooltip = !isScatter;
49134
49171
  if (!isScatter && typeof chartDimensionLinkage === 'object') {
49135
49172
  isShowTooltip = chartDimensionLinkage.showTooltip ?? true;
49136
- isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeColumn(i, table);
49173
+ if (i === colEnd && isShowTooltip) {
49174
+ const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn;
49175
+ const { colEnd: colEnd1 } = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
49176
+ if (colEnd1 === colEnd) {
49177
+ isShowTooltip = true;
49178
+ }
49179
+ else {
49180
+ const { colEnd: colEnd2 } = table.getBodyVisibleColRange(0, 5);
49181
+ if (colEnd2 !== colEnd) {
49182
+ isShowTooltip = true;
49183
+ }
49184
+ else {
49185
+ isShowTooltip = false;
49186
+ }
49187
+ }
49188
+ }
49189
+ else if (i === colStart && isShowTooltip) {
49190
+ const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn;
49191
+ const { colStart: colStart1 } = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
49192
+ if (colStart1 === colStart) {
49193
+ isShowTooltip = true;
49194
+ }
49195
+ else {
49196
+ const { colStart: colStart2 } = table.getBodyVisibleColRange(0, -5);
49197
+ if (colStart2 !== colStart) {
49198
+ isShowTooltip = true;
49199
+ }
49200
+ else {
49201
+ isShowTooltip = false;
49202
+ }
49203
+ }
49204
+ }
49137
49205
  }
49138
49206
  if (isScatter) {
49139
49207
  if (table.stateManager.hover.cellPos.col !== i || table.stateManager.hover.cellPos.row !== row) {
@@ -49146,7 +49214,6 @@
49146
49214
  }
49147
49215
  }
49148
49216
  else {
49149
- const cellBoundry = table.getCellRelativeRect(i, row);
49150
49217
  const bodyBoundryLeft = table.frozenColCount
49151
49218
  ? table.getCellRelativeRect(table.frozenColCount - 1, row).right
49152
49219
  : 0;
@@ -49157,21 +49224,13 @@
49157
49224
  }
49158
49225
  chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
49159
49226
  tooltip: false,
49160
- showTooltipOption: {
49161
- x: absolutePositionLeft - cellBoundry.left,
49162
- y: canvasXY.y - cellBoundry.top,
49163
- activeType: 'dimension'
49164
- }
49227
+ showTooltipOption: { x: absolutePositionLeft, y: canvasXY.y, activeType: 'dimension' }
49165
49228
  });
49166
49229
  }
49167
49230
  else {
49168
49231
  chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
49169
49232
  tooltip: isShowTooltip,
49170
- showTooltipOption: {
49171
- x: absolutePositionLeft - cellBoundry.left,
49172
- y: canvasXY.y - cellBoundry.top,
49173
- activeType: 'dimension'
49174
- }
49233
+ showTooltipOption: { x: absolutePositionLeft, y: canvasXY.y, activeType: 'dimension' }
49175
49234
  });
49176
49235
  }
49177
49236
  }
@@ -49180,139 +49239,6 @@
49180
49239
  table.scenegraph.updateNextFrame();
49181
49240
  }
49182
49241
  }
49183
- function generateChartInstanceListByViewRange(datum, table, deactivate = false) {
49184
- const { rowStart } = table.getBodyVisibleRowRange();
49185
- let rowEnd = table.getBodyVisibleRowRange().rowEnd;
49186
- rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
49187
- const { colStart } = table.getBodyVisibleColRange();
49188
- let colEnd = table.getBodyVisibleColRange().colEnd;
49189
- colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
49190
- for (let col = colStart; col <= colEnd; col++) {
49191
- if (!isValid$1(chartInstanceListColumnByColumnDirection[col])) {
49192
- chartInstanceListColumnByColumnDirection[col] = {};
49193
- }
49194
- for (let i = rowStart; i <= rowEnd; i++) {
49195
- const cellGroup = table.scenegraph.getCell(col, i);
49196
- const chartNode = cellGroup?.getChildren()?.[0];
49197
- chartNode.addUpdateShapeAndBoundsTag();
49198
- if (chartInstanceListColumnByColumnDirection[col][i]) ;
49199
- else if (isValid$1(chartNode)) {
49200
- if (chartNode.activeChartInstance) {
49201
- chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance;
49202
- }
49203
- else {
49204
- if (chartNode.attribute.spec.type === 'pie') {
49205
- chartNode.activate(table);
49206
- chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance;
49207
- }
49208
- }
49209
- }
49210
- setTimeout(() => {
49211
- if (chartInstanceListColumnByColumnDirection[col]?.[i]) {
49212
- const chartDimensionLinkage = table.options.chartDimensionLinkage;
49213
- let isShowTooltip = true;
49214
- if (typeof chartDimensionLinkage === 'object') {
49215
- if (deactivate) {
49216
- chartInstanceListColumnByColumnDirection[col][i].setHovered();
49217
- chartInstanceListColumnByColumnDirection[col][i].hideTooltip();
49218
- }
49219
- else {
49220
- isShowTooltip = chartDimensionLinkage.showTooltip ?? true;
49221
- isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeRow(i, table);
49222
- isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeColumn(col, table);
49223
- chartInstanceListColumnByColumnDirection[col][i].setHovered(datum);
49224
- isShowTooltip &&
49225
- chartInstanceListColumnByColumnDirection[col][i].showTooltip(datum, {
49226
- activeType: 'mark'
49227
- });
49228
- }
49229
- }
49230
- }
49231
- }, 0);
49232
- table.scenegraph.updateNextFrame();
49233
- }
49234
- }
49235
- }
49236
- function checkIsShowTooltipForEdgeRow(row, table) {
49237
- let isShowTooltip = true;
49238
- const { rowStart } = table.getBodyVisibleRowRange();
49239
- let rowEnd = table.getBodyVisibleRowRange().rowEnd;
49240
- rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
49241
- const chartDimensionLinkage = table.options.chartDimensionLinkage;
49242
- if (row === rowEnd && isShowTooltip) {
49243
- const heightLimitToShowTooltipForEdgeRow = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow ?? 0;
49244
- const { rowEnd: rowEnd1 } = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
49245
- if (rowEnd1 === rowEnd) {
49246
- isShowTooltip = true;
49247
- }
49248
- else {
49249
- const { rowEnd: rowEnd2 } = table.getBodyVisibleRowRange(0, 5);
49250
- if (rowEnd2 !== rowEnd) {
49251
- isShowTooltip = true;
49252
- }
49253
- else {
49254
- isShowTooltip = false;
49255
- }
49256
- }
49257
- }
49258
- else if (row === rowStart && isShowTooltip) {
49259
- const heightLimitToShowTooltipForEdgeRow = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow ?? 0;
49260
- const { rowStart: rowStart1 } = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
49261
- if (rowStart1 === rowStart) {
49262
- isShowTooltip = true;
49263
- }
49264
- else {
49265
- const { rowStart: rowStart2 } = table.getBodyVisibleRowRange(0, -5);
49266
- if (rowStart2 !== rowStart) {
49267
- isShowTooltip = true;
49268
- }
49269
- else {
49270
- isShowTooltip = false;
49271
- }
49272
- }
49273
- }
49274
- return isShowTooltip;
49275
- }
49276
- function checkIsShowTooltipForEdgeColumn(col, table) {
49277
- let isShowTooltip = true;
49278
- const { colStart } = table.getBodyVisibleColRange();
49279
- let colEnd = table.getBodyVisibleColRange().colEnd;
49280
- colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
49281
- const chartDimensionLinkage = table.options.chartDimensionLinkage;
49282
- if (col === colEnd && isShowTooltip) {
49283
- const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn;
49284
- const { colEnd: colEnd1 } = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
49285
- if (colEnd1 === colEnd) {
49286
- isShowTooltip = true;
49287
- }
49288
- else {
49289
- const { colEnd: colEnd2 } = table.getBodyVisibleColRange(0, 5);
49290
- if (colEnd2 !== colEnd) {
49291
- isShowTooltip = true;
49292
- }
49293
- else {
49294
- isShowTooltip = false;
49295
- }
49296
- }
49297
- }
49298
- else if (col === colStart && isShowTooltip) {
49299
- const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn;
49300
- const { colStart: colStart1 } = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
49301
- if (colStart1 === colStart) {
49302
- isShowTooltip = true;
49303
- }
49304
- else {
49305
- const { colStart: colStart2 } = table.getBodyVisibleColRange(0, -5);
49306
- if (colStart2 !== colStart) {
49307
- isShowTooltip = true;
49308
- }
49309
- else {
49310
- isShowTooltip = false;
49311
- }
49312
- }
49313
- }
49314
- return isShowTooltip;
49315
- }
49316
49242
  function clearChartInstanceListByRowDirection(row, excludedCol, table) {
49317
49243
  if (isValid$1(chartInstanceListRowByRowDirection[row])) {
49318
49244
  for (const i in chartInstanceListRowByRowDirection[row]) {
@@ -49334,14 +49260,6 @@
49334
49260
  }
49335
49261
  delete chartInstanceListRowByRowDirection[row];
49336
49262
  }
49337
- function clearAllChartInstanceList(table) {
49338
- for (const col in chartInstanceListColumnByColumnDirection) {
49339
- clearChartInstanceListByColumnDirection(Number(col), undefined, table);
49340
- }
49341
- for (const row in chartInstanceListRowByRowDirection) {
49342
- clearChartInstanceListByRowDirection(Number(row), undefined, table);
49343
- }
49344
- }
49345
49263
 
49346
49264
  function isValidAlignDomain(domain) {
49347
49265
  return domain.length === 2 && isValidNumber$1(domain[0]) && isValidNumber$1(domain[1]) && domain[1] >= domain[0];
@@ -50301,7 +50219,6 @@
50301
50219
  type = 'chart';
50302
50220
  chartInstance;
50303
50221
  activeChartInstance;
50304
- activeChartInstanceLastViewBox = null;
50305
50222
  activeChartInstanceHoverOnMark = null;
50306
50223
  justShowMarkTooltip = undefined;
50307
50224
  justShowMarkTooltipTimer = Date.now();
@@ -50399,7 +50316,7 @@
50399
50316
  }
50400
50317
  }
50401
50318
  },
50402
- componentShowContent: table.options.chartDimensionLinkage?.showTooltip &&
50319
+ componentShowContent: table.options.chartDimensionLinkage &&
50403
50320
  this.attribute.spec.type !== 'scatter'
50404
50321
  ? {
50405
50322
  tooltip: {
@@ -50420,40 +50337,20 @@
50420
50337
  table.internalProps.layoutMap?.updateDataStateToActiveChartInstance?.(this.activeChartInstance);
50421
50338
  this.activeChartInstance.on('click', (params) => {
50422
50339
  if (this.attribute.spec.select?.enable === false) {
50423
- table.scenegraph.updateChartState(null, undefined);
50340
+ table.scenegraph.updateChartState(null);
50424
50341
  }
50425
50342
  else if (Chart.temp) {
50426
- table.scenegraph.updateChartState(params?.datum, 'click');
50343
+ table.scenegraph.updateChartState(params?.datum);
50427
50344
  }
50428
50345
  });
50429
- let brushChangeThrottle;
50430
- if (table.options.chartDimensionLinkage?.listenBrushChange) {
50431
- brushChangeThrottle = cancellableThrottle(table.scenegraph.updateChartState.bind(table.scenegraph), table.options.chartDimensionLinkage?.brushChangeDelay ?? 100);
50432
- this.activeChartInstance.on('brushChange', (params) => {
50433
- brushChangeThrottle.throttled(params?.value?.inBrushData, 'brush');
50434
- });
50435
- }
50436
50346
  this.activeChartInstance.on('brushEnd', (params) => {
50437
- brushChangeThrottle?.cancel();
50438
- table.scenegraph.updateChartState(params?.value?.inBrushData, 'brush');
50347
+ table.scenegraph.updateChartState(params?.value?.inBrushData);
50439
50348
  Chart.temp = 0;
50440
50349
  setTimeout(() => {
50441
50350
  Chart.temp = 1;
50442
50351
  }, 0);
50443
50352
  });
50444
- if (table.options.chartDimensionLinkage?.showTooltip) {
50445
- if (this.attribute.spec.type === 'pie') {
50446
- this.activeChartInstance.on('pointerover', { markName: 'pie' }, (params) => {
50447
- const categoryField = this.attribute.spec.categoryField;
50448
- const datum = { [categoryField]: params?.datum?.[categoryField] };
50449
- generateChartInstanceListByViewRange(datum, table, false);
50450
- });
50451
- this.activeChartInstance.on('pointerout', { markName: 'pie' }, (params) => {
50452
- const categoryField = this.attribute.spec.categoryField;
50453
- const datum = { [categoryField]: params?.datum?.[categoryField] };
50454
- generateChartInstanceListByViewRange(datum, table, true);
50455
- });
50456
- }
50353
+ if (table.options.chartDimensionLinkage) {
50457
50354
  this.activeChartInstance.on('dimensionHover', (params) => {
50458
50355
  const dimensionInfo = params?.dimensionInfo[0];
50459
50356
  const canvasXY = params?.event?.canvas;
@@ -50591,7 +50488,7 @@
50591
50488
  table._bindChartEvent?.(this.activeChartInstance);
50592
50489
  }
50593
50490
  static temp = 1;
50594
- deactivate(table, { releaseChartInstance = true, releaseColumnChartInstance = true, releaseRowChartInstance = true, releaseAllChartInstance = false } = {}) {
50491
+ deactivate(table, { releaseChartInstance = true, releaseColumnChartInstance = true, releaseRowChartInstance = true } = {}) {
50595
50492
  this.activeChartInstanceHoverOnMark = null;
50596
50493
  this.justShowMarkTooltip = undefined;
50597
50494
  this.justShowMarkTooltipTimer = Date.now();
@@ -50625,16 +50522,11 @@
50625
50522
  table.scenegraph.getCell(table.rowHeaderLevelCount - 1, row).firstChild?.hideLabelHoverOnAxis?.();
50626
50523
  }
50627
50524
  }
50628
- if (releaseAllChartInstance) {
50629
- clearAllChartInstanceList(table);
50525
+ if (releaseColumnChartInstance) {
50526
+ clearChartInstanceListByColumnDirection(this.parent.col, this.attribute.spec.type === 'scatter' ? this.parent.row : undefined, table);
50630
50527
  }
50631
- else {
50632
- if (releaseColumnChartInstance) {
50633
- clearChartInstanceListByColumnDirection(this.parent.col, this.attribute.spec.type === 'scatter' ? this.parent.row : undefined, table);
50634
- }
50635
- if (releaseRowChartInstance) {
50636
- clearChartInstanceListByRowDirection(this.parent.row, this.attribute.spec.type === 'scatter' ? this.parent.col : undefined, table);
50637
- }
50528
+ if (releaseRowChartInstance) {
50529
+ clearChartInstanceListByRowDirection(this.parent.row, this.attribute.spec.type === 'scatter' ? this.parent.col : undefined, table);
50638
50530
  }
50639
50531
  }
50640
50532
  updateData(data) {
@@ -50645,19 +50537,12 @@
50645
50537
  const padding = this.attribute.cellPadding;
50646
50538
  const table = this.stage.table;
50647
50539
  const { x1, y1, x2, y2 } = cellGroup.globalAABBBounds;
50648
- const viewBox = {
50540
+ return {
50649
50541
  x1: Math.ceil(x1 + padding[3] + table.scrollLeft + (table.options.viewBox?.x1 ?? 0)),
50650
50542
  x2: Math.ceil(x1 + cellGroup.attribute.width - padding[1] + table.scrollLeft + (table.options.viewBox?.x1 ?? 0)),
50651
50543
  y1: Math.ceil(y1 + padding[0] + table.scrollTop + (table.options.viewBox?.y1 ?? 0)),
50652
50544
  y2: Math.ceil(y1 + cellGroup.attribute.height - padding[2] + table.scrollTop + (table.options.viewBox?.y1 ?? 0))
50653
50545
  };
50654
- if (this.activeChartInstance) {
50655
- this.activeChartInstanceLastViewBox = viewBox;
50656
- }
50657
- else {
50658
- this.activeChartInstanceLastViewBox = null;
50659
- }
50660
- return viewBox;
50661
50546
  }
50662
50547
  }
50663
50548
  function getTableBounds(col, row, table) {
@@ -50926,6 +50811,7 @@
50926
50811
  drawShape(chart, context, x, y, drawContext, params, fillCb, strokeCb) {
50927
50812
  const groupAttribute = getTheme(chart, params?.theme).group;
50928
50813
  const { dataId, data, spec } = chart.attribute;
50814
+ chart.getViewBox();
50929
50815
  const { width = groupAttribute.width, height = groupAttribute.height } = chart.attribute;
50930
50816
  const { table } = chart.getRootNode();
50931
50817
  const { cacheCanvas, activeChartInstance } = chart;
@@ -50948,20 +50834,13 @@
50948
50834
  activeChartInstance.updateSpecSync(spec, false, { reuse: false, morph: false });
50949
50835
  }
50950
50836
  }
50951
- const lastViewBox = chart.activeChartInstanceLastViewBox;
50952
50837
  const viewBox = chart.getViewBox();
50953
- if (!(lastViewBox &&
50954
- viewBox.x1 === lastViewBox.x1 &&
50955
- viewBox.x2 === lastViewBox.x2 &&
50956
- viewBox.y1 === lastViewBox.y1 &&
50957
- viewBox.y2 === lastViewBox.y2)) {
50958
- activeChartInstance.updateViewBox({
50959
- x1: 0,
50960
- x2: viewBox.x2 - viewBox.x1,
50961
- y1: 0,
50962
- y2: viewBox.y2 - viewBox.y1
50963
- }, false, false);
50964
- }
50838
+ activeChartInstance.updateViewBox({
50839
+ x1: 0,
50840
+ x2: viewBox.x2 - viewBox.x1,
50841
+ y1: 0,
50842
+ y2: viewBox.y2 - viewBox.y1
50843
+ }, false, false);
50965
50844
  const chartStage = activeChartInstance.getStage();
50966
50845
  chartStage.needRender = true;
50967
50846
  const matrix = chart.globalTransMatrix.clone();
@@ -57077,10 +56956,9 @@
57077
56956
  updateTableAxes(scenegraph.rightFrozenGroup, scenegraph.table);
57078
56957
  updateTableAxes(scenegraph.bottomFrozenGroup, scenegraph.table);
57079
56958
  }
57080
- function updateChartState(scenegraph, datum, selectedDataMode) {
56959
+ function updateChartState(scenegraph, datum) {
57081
56960
  const table = scenegraph.table;
57082
56961
  if (table.isPivotChart()) {
57083
- table._selectedDataMode = selectedDataMode;
57084
56962
  const preSelectItemsCount = table._selectedDataItemsInChart.length;
57085
56963
  if ((datum === null || datum === undefined || datum?.length === 0 || Object.keys(datum).length === 0) &&
57086
56964
  preSelectItemsCount === 0) {
@@ -58347,54 +58225,38 @@
58347
58225
  resetResidentHoverIcon(col, row) {
58348
58226
  resetResidentHoverIcon(col, row, this);
58349
58227
  }
58350
- deactivateChart(col, row, forceRelease = false) {
58228
+ deactivateChart(col, row) {
58351
58229
  if (col === -1 || row === -1) {
58352
58230
  return;
58353
58231
  }
58354
58232
  const cellGroup = this.getCell(col, row);
58355
58233
  if (cellGroup?.firstChild?.deactivate) {
58356
- if (forceRelease) {
58357
- cellGroup?.firstChild?.deactivate?.(this.table, {
58358
- releaseChartInstance: true,
58359
- releaseColumnChartInstance: true,
58360
- releaseRowChartInstance: true,
58361
- releaseAllChartInstance: true
58362
- });
58363
- return;
58364
- }
58365
58234
  const chartNode = cellGroup?.firstChild;
58366
58235
  const chartType = chartNode.attribute.spec.type;
58367
- cellGroup?.firstChild?.deactivate?.(this.table, this.table.options.chartDimensionLinkage?.showTooltip
58236
+ cellGroup?.firstChild?.deactivate?.(this.table, this.table.options.chartDimensionLinkage
58368
58237
  ? {
58369
- releaseChartInstance: chartType === 'pie'
58370
- ? false
58371
- : chartType === 'scatter'
58372
- ? (col !== this.table.stateManager.hover.cellPos.col &&
58373
- row !== this.table.stateManager.hover.cellPos.row) ||
58374
- this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount ||
58375
- this.table.stateManager.hover.cellPos.row >
58376
- this.table.rowCount - 1 - this.table.bottomFrozenRowCount ||
58377
- this.table.stateManager.hover.cellPos.col < this.table.frozenColCount ||
58378
- this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount
58379
- : this.table.options.indicatorsAsCol
58380
- ? row !== this.table.stateManager.hover.cellPos.row ||
58381
- this.table.stateManager.hover.cellPos.col < this.table.frozenColCount ||
58382
- this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount
58383
- : col !== this.table.stateManager.hover.cellPos.col ||
58384
- this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount ||
58385
- this.table.stateManager.hover.cellPos.row >
58386
- this.table.rowCount - 1 - this.table.bottomFrozenRowCount,
58387
- releaseColumnChartInstance: chartType === 'pie'
58388
- ? false
58389
- : col !== this.table.stateManager.hover.cellPos.col ||
58238
+ releaseChartInstance: chartType === 'scatter'
58239
+ ? (col !== this.table.stateManager.hover.cellPos.col &&
58240
+ row !== this.table.stateManager.hover.cellPos.row) ||
58390
58241
  this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount ||
58391
58242
  this.table.stateManager.hover.cellPos.row >
58392
- this.table.rowCount - 1 - this.table.bottomFrozenRowCount,
58393
- releaseRowChartInstance: chartType === 'pie'
58394
- ? false
58395
- : row !== this.table.stateManager.hover.cellPos.row ||
58243
+ this.table.rowCount - 1 - this.table.bottomFrozenRowCount ||
58396
58244
  this.table.stateManager.hover.cellPos.col < this.table.frozenColCount ||
58397
58245
  this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount
58246
+ : this.table.options.indicatorsAsCol
58247
+ ? row !== this.table.stateManager.hover.cellPos.row ||
58248
+ this.table.stateManager.hover.cellPos.col < this.table.frozenColCount ||
58249
+ this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount
58250
+ : col !== this.table.stateManager.hover.cellPos.col ||
58251
+ this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount ||
58252
+ this.table.stateManager.hover.cellPos.row >
58253
+ this.table.rowCount - 1 - this.table.bottomFrozenRowCount,
58254
+ releaseColumnChartInstance: col !== this.table.stateManager.hover.cellPos.col ||
58255
+ this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount ||
58256
+ this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount,
58257
+ releaseRowChartInstance: row !== this.table.stateManager.hover.cellPos.row ||
58258
+ this.table.stateManager.hover.cellPos.col < this.table.frozenColCount ||
58259
+ this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount
58398
58260
  }
58399
58261
  : undefined);
58400
58262
  }
@@ -58451,8 +58313,8 @@
58451
58313
  updateChartSizeForResizeRowHeight(row) {
58452
58314
  updateChartSizeForResizeRowHeight(this, row);
58453
58315
  }
58454
- updateChartState(datum, selectedDataMode) {
58455
- this.table.isPivotChart() && updateChartState(this, datum, selectedDataMode);
58316
+ updateChartState(datum) {
58317
+ this.table.isPivotChart() && updateChartState(this, datum);
58456
58318
  }
58457
58319
  updateCheckboxCellState(col, row, checked) {
58458
58320
  if (this.table.transpose) {
@@ -63739,7 +63601,7 @@
63739
63601
  return;
63740
63602
  }
63741
63603
  if (table.isPivotChart() && eventArgsSet?.eventArgs?.target.type !== 'chart') {
63742
- table.scenegraph.updateChartState(null, undefined);
63604
+ table.scenegraph.updateChartState(null);
63743
63605
  }
63744
63606
  if (eventArgsSet.eventArgs?.target !== stateManager.residentHoverIcon?.icon) {
63745
63607
  stateManager.hideMenu();
@@ -63808,7 +63670,7 @@
63808
63670
  else {
63809
63671
  if (!eventManager.checkCellFillhandle(eventArgsSet) &&
63810
63672
  (eventManager.checkColumnResize(eventArgsSet, true) || eventManager.checkRowResize(eventArgsSet, true))) {
63811
- table.scenegraph.updateChartState(null, undefined);
63673
+ table.scenegraph.updateChartState(null);
63812
63674
  stateManager.updateInteractionState(InteractionState.grabing);
63813
63675
  return;
63814
63676
  }
@@ -64053,7 +63915,7 @@
64053
63915
  !eventManager.checkCellFillhandle(eventArgsSet) &&
64054
63916
  !stateManager.columnResize.resizing &&
64055
63917
  eventManager.checkColumnResize(eventArgsSet, true)) {
64056
- table.scenegraph.updateChartState(null, undefined);
63918
+ table.scenegraph.updateChartState(null);
64057
63919
  stateManager.updateInteractionState(InteractionState.grabing);
64058
63920
  const { eventArgs } = eventArgsSet;
64059
63921
  if (!eventArgs?.targetCell) {
@@ -64100,7 +63962,7 @@
64100
63962
  }
64101
63963
  stateManager.endSelectCells(true, isHasSelected);
64102
63964
  stateManager.updateCursor();
64103
- table.scenegraph.updateChartState(null, undefined);
63965
+ table.scenegraph.updateChartState(null);
64104
63966
  }
64105
63967
  else if (table.eventManager.isDraging && stateManager.isSelecting()) {
64106
63968
  stateManager.endSelectCells();
@@ -64291,10 +64153,6 @@
64291
64153
  const legend = e.path.find(node => node.name === 'legend');
64292
64154
  if (!legend) {
64293
64155
  table.editorManager?.completeEdit();
64294
- const { cellPos } = table.stateManager.hover;
64295
- const prevHoverCellCol = cellPos.col;
64296
- const prevHoverCellRow = cellPos.row;
64297
- table.scenegraph.deactivateChart(prevHoverCellCol, prevHoverCellRow, true);
64298
64156
  if (table.eventManager._enableTableScroll) {
64299
64157
  handleWhell(e, stateManager);
64300
64158
  }
@@ -65647,6 +65505,7 @@
65647
65505
  cutOperationTime = 0;
65648
65506
  lastClipboardContent = '';
65649
65507
  cutCellRange = null;
65508
+ cutRanges = null;
65650
65509
  copySourceRange = null;
65651
65510
  constructor(table) {
65652
65511
  this.table = table;
@@ -65774,7 +65633,7 @@
65774
65633
  }
65775
65634
  const shiftMultiSelect = this.table.keyboardOptions?.shiftMultiSelect ?? true;
65776
65635
  const ctrlMultiSelect = this.table.keyboardOptions?.ctrlMultiSelect ?? true;
65777
- this.table.stateManager.updateSelectPos(this.table.stateManager.select.selectInline === 'row' ? this.table.colCount - 1 : eventArgs.col, this.table.stateManager.select.selectInline === 'col' ? this.table.rowCount - 1 : eventArgs.row, eventArgs.event.shiftKey && shiftMultiSelect, (eventArgs.event.ctrlKey || eventArgs.event.metaKey) && ctrlMultiSelect, false, isSelectMoving ? false : (this.table.options.select?.makeSelectCellVisible ?? true));
65636
+ this.table.stateManager.updateSelectPos(this.table.stateManager.select.selectInline === 'row' ? this.table.colCount - 1 : eventArgs.col, this.table.stateManager.select.selectInline === 'col' ? this.table.rowCount - 1 : eventArgs.row, eventArgs.event.shiftKey && shiftMultiSelect, (eventArgs.event.ctrlKey || eventArgs.event.metaKey) && ctrlMultiSelect, false, isSelectMoving ? false : this.table.options.select?.makeSelectCellVisible ?? true);
65778
65637
  return true;
65779
65638
  }
65780
65639
  return false;
@@ -66166,6 +66025,10 @@
66166
66025
  this.handleCopy(e, true);
66167
66026
  this.cutWaitPaste = true;
66168
66027
  this.cutCellRange = this.table.getSelectedCellInfos();
66028
+ this.cutRanges = this.table.stateManager.select.ranges?.map(r => ({
66029
+ start: { col: r.start.col, row: r.start.row },
66030
+ end: { col: r.end.col, row: r.end.row }
66031
+ }));
66169
66032
  if (this.clipboardCheckTimer) {
66170
66033
  clearTimeout(this.clipboardCheckTimer);
66171
66034
  }
@@ -66173,6 +66036,7 @@
66173
66036
  if (this.cutWaitPaste) {
66174
66037
  this.cutWaitPaste = false;
66175
66038
  this.cutCellRange = null;
66039
+ this.cutRanges = null;
66176
66040
  this.clipboardCheckTimer = null;
66177
66041
  }
66178
66042
  }, 30000);
@@ -66192,6 +66056,7 @@
66192
66056
  if (this.cutWaitPaste) {
66193
66057
  this.cutWaitPaste = false;
66194
66058
  this.cutCellRange = null;
66059
+ this.cutRanges = null;
66195
66060
  if (this.clipboardCheckTimer) {
66196
66061
  clearTimeout(this.clipboardCheckTimer);
66197
66062
  this.clipboardCheckTimer = null;
@@ -66307,17 +66172,11 @@
66307
66172
  }
66308
66173
  clearCutArea(table) {
66309
66174
  try {
66310
- const selectCells = this.cutCellRange;
66311
- if (!selectCells || selectCells.length === 0) {
66175
+ const ranges = this.cutRanges;
66176
+ if (!ranges || ranges.length === 0) {
66312
66177
  return;
66313
66178
  }
66314
- for (let i = 0; i < selectCells.length; i++) {
66315
- for (let j = 0; j < selectCells[i].length; j++) {
66316
- if (selectCells[i][j]) {
66317
- table.changeCellValue(selectCells[i][j].col, selectCells[i][j].row, undefined);
66318
- }
66319
- }
66320
- }
66179
+ table.changeCellValuesByIds(ranges, '');
66321
66180
  }
66322
66181
  catch (error) {
66323
66182
  }
@@ -70367,7 +70226,7 @@
70367
70226
  return TABLE_EVENT_TYPE;
70368
70227
  }
70369
70228
  options;
70370
- version = "1.22.11-alpha.0";
70229
+ version = "1.22.11-alpha.2";
70371
70230
  pagination;
70372
70231
  id = `VTable${Date.now()}`;
70373
70232
  headerStyleCache;
@@ -76404,9 +76263,10 @@
76404
76263
  return { addRecordRule };
76405
76264
  }
76406
76265
 
76407
- function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table) {
76266
+ function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
76408
76267
  if ((workOnEditableCell && table.isHasEditorDefine(col, row)) || workOnEditableCell === false) {
76409
- const recordIndex = table.getRecordShowIndexByCell(col, row);
76268
+ const recordShowIndex = table.getRecordShowIndexByCell(col, row);
76269
+ const recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : undefined;
76410
76270
  const { field } = table.internalProps.layoutMap.getBody(col, row);
76411
76271
  const beforeChangeValue = table.getCellRawValue(col, row);
76412
76272
  const oldValue = table.getCellOriginValue(col, row);
@@ -76414,7 +76274,7 @@
76414
76274
  table.internalProps.layoutMap.updateColumnTitle(col, row, value);
76415
76275
  }
76416
76276
  else {
76417
- table.dataSource.changeFieldValue(value, recordIndex, field, col, row, table);
76277
+ table.dataSource.changeFieldValue(value, recordShowIndex, field, col, row, table);
76418
76278
  }
76419
76279
  const range = table.getCellRange(col, row);
76420
76280
  const aggregators = table.internalProps.layoutMap.getAggregatorsByCell(col, row);
@@ -76467,18 +76327,24 @@
76467
76327
  }
76468
76328
  const changedValue = table.getCellOriginValue(col, row);
76469
76329
  if (oldValue !== changedValue && triggerEvent) {
76470
- table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
76330
+ const changeValue = {
76471
76331
  col,
76472
76332
  row,
76333
+ recordIndex,
76334
+ field,
76473
76335
  rawValue: beforeChangeValue,
76474
76336
  currentValue: oldValue,
76475
76337
  changedValue
76476
- });
76338
+ };
76339
+ table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue);
76340
+ if (!silentChangeCellValuesEvent) {
76341
+ table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, { values: [changeValue] });
76342
+ }
76477
76343
  }
76478
76344
  table.scenegraph.updateNextFrame();
76479
76345
  }
76480
76346
  }
76481
- async function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table) {
76347
+ async function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
76482
76348
  const changedCellResults = [];
76483
76349
  let pasteColEnd = startCol;
76484
76350
  let pasteRowEnd = startRow;
@@ -76505,6 +76371,7 @@
76505
76371
  oldRowValues.push(oldValue);
76506
76372
  }
76507
76373
  }
76374
+ const resultChangeValues = [];
76508
76375
  for (let i = 0; i < values.length; i++) {
76509
76376
  if (startRow + i > table.rowCount - 1) {
76510
76377
  break;
@@ -76544,7 +76411,8 @@
76544
76411
  if (isCanChange) {
76545
76412
  changedCellResults[i][j] = true;
76546
76413
  const value = rowValues[j];
76547
- const recordIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i);
76414
+ const recordShowIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i);
76415
+ const recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : undefined;
76548
76416
  const { field } = table.internalProps.layoutMap.getBody(startCol + j, startRow + i);
76549
76417
  const beforeChangeValue = beforeChangeValues[i][j];
76550
76418
  const oldValue = oldValues[i][j];
@@ -76552,17 +76420,21 @@
76552
76420
  table.internalProps.layoutMap.updateColumnTitle(startCol + j, startRow + i, value);
76553
76421
  }
76554
76422
  else {
76555
- table.dataSource.changeFieldValue(value, recordIndex, field, startCol + j, startRow + i, table);
76423
+ table.dataSource.changeFieldValue(value, recordShowIndex, field, startCol + j, startRow + i, table);
76556
76424
  }
76557
76425
  const changedValue = table.getCellOriginValue(startCol + j, startRow + i);
76558
76426
  if (oldValue !== changedValue && triggerEvent) {
76559
- table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
76427
+ const changeValue = {
76560
76428
  col: startCol + j,
76561
76429
  row: startRow + i,
76430
+ recordIndex,
76431
+ field,
76562
76432
  rawValue: beforeChangeValue,
76563
76433
  currentValue: oldValue,
76564
76434
  changedValue
76565
- });
76435
+ };
76436
+ table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue);
76437
+ resultChangeValues.push(changeValue);
76566
76438
  }
76567
76439
  }
76568
76440
  else {
@@ -76571,6 +76443,9 @@
76571
76443
  }
76572
76444
  pasteColEnd = Math.max(pasteColEnd, thisRowPasteColEnd);
76573
76445
  }
76446
+ if (!silentChangeCellValuesEvent) {
76447
+ table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, { values: resultChangeValues });
76448
+ }
76574
76449
  const startRange = table.getCellRange(startCol, startRow);
76575
76450
  const range = table.getCellRange(pasteColEnd, pasteRowEnd);
76576
76451
  const aggregators = table.internalProps.layoutMap.getAggregatorsByCellRange(startRange.start.col, startRange.start.row, range.end.col, range.end.row);
@@ -76643,6 +76518,68 @@
76643
76518
  table.scenegraph.updateNextFrame();
76644
76519
  return changedCellResults;
76645
76520
  }
76521
+ async function listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
76522
+ const resultChangeValues = [];
76523
+ const processed = new Set();
76524
+ const nextValue = (value ?? '');
76525
+ for (let i = 0; i < (ranges?.length ?? 0); i++) {
76526
+ const range = ranges[i];
76527
+ const startCol = Math.min(range.start.col, range.end.col);
76528
+ const endCol = Math.max(range.start.col, range.end.col);
76529
+ const startRow = Math.min(range.start.row, range.end.row);
76530
+ const endRow = Math.max(range.start.row, range.end.row);
76531
+ if (startCol > endCol || startRow > endRow) {
76532
+ continue;
76533
+ }
76534
+ const values = [];
76535
+ const oldValues = [];
76536
+ for (let row = startRow; row <= endRow; row++) {
76537
+ const rowValues = [];
76538
+ const rowOldValues = [];
76539
+ for (let col = startCol; col <= endCol; col++) {
76540
+ rowValues.push(nextValue);
76541
+ rowOldValues.push(table.getCellOriginValue(col, row));
76542
+ }
76543
+ values.push(rowValues);
76544
+ oldValues.push(rowOldValues);
76545
+ }
76546
+ const changedCellResults = await listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, true);
76547
+ for (let r = 0; r < values.length; r++) {
76548
+ for (let c = 0; c < values[r].length; c++) {
76549
+ const col = startCol + c;
76550
+ const row = startRow + r;
76551
+ const key = `${col},${row}`;
76552
+ if (processed.has(key)) {
76553
+ continue;
76554
+ }
76555
+ processed.add(key);
76556
+ if (!triggerEvent || !changedCellResults?.[r]?.[c]) {
76557
+ continue;
76558
+ }
76559
+ const oldValue = oldValues[r][c];
76560
+ const changedValue = table.getCellOriginValue(col, row);
76561
+ if (oldValue === changedValue) {
76562
+ continue;
76563
+ }
76564
+ const recordShowIndex = table.getRecordShowIndexByCell(col, row);
76565
+ const recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : undefined;
76566
+ const { field } = table.internalProps.layoutMap.getBody(col, row);
76567
+ resultChangeValues.push({
76568
+ col,
76569
+ row,
76570
+ recordIndex,
76571
+ field,
76572
+ rawValue: oldValue,
76573
+ currentValue: oldValue,
76574
+ changedValue
76575
+ });
76576
+ }
76577
+ }
76578
+ }
76579
+ if (!silentChangeCellValuesEvent && triggerEvent) {
76580
+ table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, { values: resultChangeValues });
76581
+ }
76582
+ }
76646
76583
  function getCellUpdateType(col, row, table, oldCellUpdateType) {
76647
76584
  if (oldCellUpdateType === 'group') {
76648
76585
  return oldCellUpdateType;
@@ -78493,17 +78430,182 @@
78493
78430
  }
78494
78431
  return isValid$1(editorDefine);
78495
78432
  }
78496
- changeCellValue(col, row, value, workOnEditableCell = false, triggerEvent = true) {
78497
- return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this);
78433
+ changeCellValue(col, row, value, workOnEditableCell = false, triggerEvent = true, silentChangeCellValuesEvent) {
78434
+ return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
78435
+ }
78436
+ changeCellValues(startCol, startRow, values, workOnEditableCell = false, triggerEvent = true, silentChangeCellValuesEvent) {
78437
+ return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
78498
78438
  }
78499
- changeCellValues(startCol, startRow, values, workOnEditableCell = false, triggerEvent = true) {
78500
- return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this);
78439
+ changeCellValuesByIds(ranges, value, workOnEditableCell = false, triggerEvent = true, silentChangeCellValuesEvent) {
78440
+ return listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
78441
+ }
78442
+ changeSourceCellValue(recordIndex, field, value) {
78443
+ const tableIndex = this.getTableIndexByRecordIndex(recordIndex);
78444
+ const cellAddr = this.getCellAddrByFieldRecord(field, recordIndex);
78445
+ if (tableIndex < 0 || cellAddr.col < 0 || cellAddr.row < 0) {
78446
+ return;
78447
+ }
78448
+ this.dataSource.changeFieldValue(value, tableIndex, field, cellAddr.col, cellAddr.row, this);
78449
+ const beforeChangeValue = this.getCellRawValue(cellAddr.col, cellAddr.row);
78450
+ const oldValue = this.getCellOriginValue(cellAddr.col, cellAddr.row);
78451
+ const changedValue = this.getCellOriginValue(cellAddr.col, cellAddr.row);
78452
+ if (oldValue !== changedValue) {
78453
+ const changeValue = {
78454
+ col: cellAddr.col,
78455
+ row: cellAddr.row,
78456
+ recordIndex,
78457
+ field,
78458
+ rawValue: beforeChangeValue,
78459
+ currentValue: oldValue,
78460
+ changedValue
78461
+ };
78462
+ this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue);
78463
+ this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, { values: [changeValue] });
78464
+ }
78465
+ }
78466
+ changeCellValueByRecord(recordIndex, field, value, options) {
78467
+ const triggerEvent = options?.triggerEvent ?? true;
78468
+ const silentChangeCellValuesEvent = options?.silentChangeCellValuesEvent;
78469
+ const autoRefresh = options?.autoRefresh ?? true;
78470
+ const records = this.dataSource.dataSourceObj?.records;
78471
+ let record;
78472
+ let oldValue;
78473
+ if (Array.isArray(records) && (typeof field === 'string' || typeof field === 'number')) {
78474
+ record = Array.isArray(recordIndex) ? getValueFromDeepArray(records, recordIndex) : records[recordIndex];
78475
+ oldValue = record?.[field];
78476
+ }
78477
+ this.dataSource.changeFieldValueByRecordIndex(value, recordIndex, field, this);
78478
+ if (!triggerEvent) {
78479
+ return;
78480
+ }
78481
+ const changedValue = record && (typeof field === 'string' || typeof field === 'number') ? record?.[field] : value;
78482
+ if (oldValue !== changedValue) {
78483
+ const cellAddr = this.getCellAddrByFieldRecord(field, recordIndex);
78484
+ const changeValue = {
78485
+ col: cellAddr?.col ?? -1,
78486
+ row: cellAddr?.row ?? -1,
78487
+ recordIndex,
78488
+ field,
78489
+ rawValue: oldValue,
78490
+ currentValue: oldValue,
78491
+ changedValue
78492
+ };
78493
+ this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue);
78494
+ if (!silentChangeCellValuesEvent) {
78495
+ this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, { values: [changeValue] });
78496
+ }
78497
+ }
78498
+ if (autoRefresh) {
78499
+ this.refreshAfterSourceChange();
78500
+ }
78501
+ }
78502
+ changeCellValueBySource(recordIndex, field, value, triggerEvent = true, silentChangeCellValuesEvent) {
78503
+ return this.changeCellValueByRecord(recordIndex, field, value, {
78504
+ triggerEvent,
78505
+ silentChangeCellValuesEvent,
78506
+ autoRefresh: true
78507
+ });
78508
+ }
78509
+ changeCellValuesByRecords(changeValues, options) {
78510
+ const triggerEvent = options?.triggerEvent ?? true;
78511
+ const silentChangeCellValuesEvent = options?.silentChangeCellValuesEvent;
78512
+ const autoRefresh = options?.autoRefresh ?? true;
78513
+ const resultChangeValues = [];
78514
+ for (let i = 0; i < changeValues.length; i++) {
78515
+ const { recordIndex, field, value } = changeValues[i];
78516
+ const records = this.dataSource.dataSourceObj?.records;
78517
+ let record;
78518
+ let oldValue;
78519
+ if (Array.isArray(records) && (typeof field === 'string' || typeof field === 'number')) {
78520
+ record = Array.isArray(recordIndex) ? getValueFromDeepArray(records, recordIndex) : records[recordIndex];
78521
+ oldValue = record?.[field];
78522
+ }
78523
+ this.dataSource.changeFieldValueByRecordIndex(value, recordIndex, field, this);
78524
+ if (triggerEvent) {
78525
+ const changedValue = record && (typeof field === 'string' || typeof field === 'number') ? record?.[field] : value;
78526
+ if (oldValue !== changedValue) {
78527
+ const changeValue = {
78528
+ col: (this.getCellAddrByFieldRecord(field, recordIndex)?.col ?? -1),
78529
+ row: (this.getCellAddrByFieldRecord(field, recordIndex)?.row ?? -1),
78530
+ recordIndex,
78531
+ field,
78532
+ rawValue: oldValue,
78533
+ currentValue: oldValue,
78534
+ changedValue
78535
+ };
78536
+ this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue);
78537
+ resultChangeValues.push(changeValue);
78538
+ }
78539
+ }
78540
+ }
78541
+ if (!silentChangeCellValuesEvent && resultChangeValues.length && triggerEvent) {
78542
+ this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, { values: resultChangeValues });
78543
+ }
78544
+ if (autoRefresh) {
78545
+ this.refreshAfterSourceChange();
78546
+ }
78547
+ }
78548
+ changeCellValuesBySource(changeValues, triggerEvent = true, silentChangeCellValuesEvent) {
78549
+ return this.changeCellValuesByRecords(changeValues, {
78550
+ triggerEvent,
78551
+ silentChangeCellValuesEvent,
78552
+ autoRefresh: true
78553
+ });
78554
+ }
78555
+ refreshAfterSourceChange(options) {
78556
+ const reapplyFilter = options?.reapplyFilter ?? true;
78557
+ const reapplySort = options?.reapplySort ?? true;
78558
+ const clearRowHeightCache = options?.clearRowHeightCache ?? true;
78559
+ this.scenegraph.clearCells();
78560
+ if (this.sortState && reapplySort) {
78561
+ this.dataSource.clearSortedIndexMap?.();
78562
+ this.dataSource.sortedIndexMap?.clear?.();
78563
+ }
78564
+ if (reapplyFilter) {
78565
+ if (this.sortState && reapplySort) {
78566
+ this.dataSource.updateFilterRulesForSorted(this.dataSource.dataConfig?.filterRules);
78567
+ sortRecords(this);
78568
+ }
78569
+ else {
78570
+ this.dataSource.updateFilterRules(this.dataSource.dataConfig?.filterRules);
78571
+ }
78572
+ }
78573
+ else if (this.sortState && reapplySort) {
78574
+ sortRecords(this);
78575
+ }
78576
+ const traverseColumns = (columns) => {
78577
+ for (let i = 0; i < (columns?.length ?? 0); i++) {
78578
+ const column = columns[i];
78579
+ const aggregators = column?.vtable_aggregator;
78580
+ if (aggregators) {
78581
+ if (Array.isArray(aggregators)) {
78582
+ for (let j = 0; j < aggregators.length; j++) {
78583
+ aggregators[j]?.recalculate?.();
78584
+ }
78585
+ }
78586
+ else {
78587
+ aggregators?.recalculate?.();
78588
+ }
78589
+ }
78590
+ if (column?.columns) {
78591
+ traverseColumns(column.columns);
78592
+ }
78593
+ }
78594
+ };
78595
+ traverseColumns(this.internalProps.columns);
78596
+ this.refreshRowColCount();
78597
+ this.internalProps.layoutMap.clearCellRangeMap();
78598
+ this.internalProps.useOneRowHeightFillAll = false;
78599
+ this.stateManager.initCheckedState(this.records);
78600
+ this.scenegraph.createSceneGraph(!clearRowHeightCache);
78601
+ this.internalProps.emptyTip?.resetVisible();
78602
+ this.resize();
78501
78603
  }
78502
- addRecord(record, recordIndex) {
78604
+ addRecord(record, recordIndex, triggerEvent = true) {
78503
78605
  const success = listTableAddRecord(record, recordIndex, this);
78504
78606
  adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]);
78505
78607
  this.internalProps.emptyTip?.resetVisible();
78506
- if (success) {
78608
+ if (triggerEvent && success) {
78507
78609
  this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
78508
78610
  records: [record],
78509
78611
  recordIndex,
@@ -78511,13 +78613,13 @@
78511
78613
  });
78512
78614
  }
78513
78615
  }
78514
- addRecords(records, recordIndex) {
78616
+ addRecords(records, recordIndex, triggerEvent = true) {
78515
78617
  const success = listTableAddRecords(records, recordIndex, this);
78516
78618
  if (typeof recordIndex === 'number') {
78517
78619
  adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, records);
78518
78620
  }
78519
78621
  this.internalProps.emptyTip?.resetVisible();
78520
- if (success) {
78622
+ if (triggerEvent && success) {
78521
78623
  this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
78522
78624
  records,
78523
78625
  recordIndex,
@@ -78525,7 +78627,20 @@
78525
78627
  });
78526
78628
  }
78527
78629
  }
78528
- deleteRecords(recordIndexs) {
78630
+ deleteRecords(recordIndexs, triggerEvent = true) {
78631
+ const deletedRecords = [];
78632
+ if (recordIndexs?.length > 0) {
78633
+ recordIndexs.forEach(index => {
78634
+ let record = null;
78635
+ if (typeof index === 'number') {
78636
+ record = this.dataSource.get(index);
78637
+ }
78638
+ else {
78639
+ record = [];
78640
+ }
78641
+ deletedRecords.push(record);
78642
+ });
78643
+ }
78529
78644
  listTableDeleteRecords(recordIndexs, this);
78530
78645
  adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs);
78531
78646
  this.internalProps.emptyTip?.resetVisible();
@@ -78533,21 +78648,26 @@
78533
78648
  for (let i = 0; i < recordIndexs.length; i++) {
78534
78649
  rowIndexs.push(this.getBodyRowIndexByRecordIndex(recordIndexs[i]) + this.columnHeaderLevelCount);
78535
78650
  }
78536
- this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
78537
- recordIndexs,
78538
- rowIndexs,
78539
- deletedCount: Array.isArray(recordIndexs[0])
78540
- ? recordIndexs.length
78541
- : recordIndexs.length
78542
- });
78651
+ if (triggerEvent) {
78652
+ this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
78653
+ recordIndexs,
78654
+ records: deletedRecords,
78655
+ rowIndexs,
78656
+ deletedCount: Array.isArray(recordIndexs[0])
78657
+ ? recordIndexs.length
78658
+ : recordIndexs.length
78659
+ });
78660
+ }
78543
78661
  }
78544
- updateRecords(records, recordIndexs) {
78662
+ updateRecords(records, recordIndexs, triggerEvent = true) {
78545
78663
  listTableUpdateRecords(records, recordIndexs, this);
78546
- this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
78547
- records,
78548
- recordIndexs,
78549
- updateCount: records.length
78550
- });
78664
+ if (triggerEvent) {
78665
+ this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
78666
+ records,
78667
+ recordIndexs,
78668
+ updateCount: records.length
78669
+ });
78670
+ }
78551
78671
  }
78552
78672
  _hasCustomRenderOrLayout() {
78553
78673
  const { headerObjects } = this.internalProps.layoutMap;
@@ -87444,93 +87564,53 @@
87444
87564
  return null;
87445
87565
  }
87446
87566
  _generateChartState() {
87447
- const select_filter = (datum) => {
87448
- if (this._table._selectedDataItemsInChart.length >= 1) {
87449
- const match = this._table._selectedDataItemsInChart.find(item => {
87450
- for (const itemKey in item) {
87451
- if (typeof item[itemKey] !== 'object' && item[itemKey] !== datum[itemKey]) {
87452
- return false;
87453
- }
87454
- }
87455
- return true;
87456
- });
87457
- return !!match;
87458
- }
87459
- else if (this._table._selectedDimensionInChart?.length) {
87460
- const match = this._table._selectedDimensionInChart.every(item => {
87461
- if (typeof item.value !== 'object' && datum[item.key] !== item.value) {
87462
- return false;
87463
- }
87464
- return true;
87465
- });
87466
- return !!match;
87467
- }
87468
- return false;
87469
- };
87470
- const selected_reverse = (datum) => {
87471
- if (this._table._selectedDataItemsInChart.length >= 1) {
87472
- const match = this._table._selectedDataItemsInChart.find(item => {
87473
- for (const itemKey in item) {
87474
- if (typeof item[itemKey] !== 'object' && item[itemKey] !== datum[itemKey]) {
87475
- return false;
87476
- }
87477
- }
87478
- return true;
87479
- });
87480
- return !match;
87481
- }
87482
- else if (this._table._selectedDimensionInChart?.length) {
87483
- const match = this._table._selectedDimensionInChart.every(item => {
87484
- if (typeof item.value !== 'object' && datum[item.key] !== item.value) {
87485
- return false;
87486
- }
87487
- return true;
87488
- });
87489
- return !match;
87490
- }
87491
- return false;
87492
- };
87493
87567
  const state = {
87494
87568
  vtable_selected: {
87495
87569
  filter: (datum) => {
87496
- if (this._table.options.chartDimensionLinkage?.selectedStateFilter) {
87497
- return this._table.options.chartDimensionLinkage.selectedStateFilter(datum);
87570
+ if (this._table._selectedDataItemsInChart.length >= 1) {
87571
+ const match = this._table._selectedDataItemsInChart.find(item => {
87572
+ for (const itemKey in item) {
87573
+ if (typeof item[itemKey] !== 'object' && item[itemKey] !== datum[itemKey]) {
87574
+ return false;
87575
+ }
87576
+ }
87577
+ return true;
87578
+ });
87579
+ return !!match;
87498
87580
  }
87499
- if (this._table._selectedDataMode === 'click') {
87500
- return select_filter(datum);
87581
+ else if (this._table._selectedDimensionInChart?.length) {
87582
+ const match = this._table._selectedDimensionInChart.every(item => {
87583
+ if (typeof item.value !== 'object' && datum[item.key] !== item.value) {
87584
+ return false;
87585
+ }
87586
+ return true;
87587
+ });
87588
+ return !!match;
87501
87589
  }
87502
87590
  return false;
87503
87591
  }
87504
87592
  },
87505
87593
  vtable_selected_reverse: {
87506
87594
  filter: (datum) => {
87507
- if (this._table.options.chartDimensionLinkage?.selectedReverseStateFilter) {
87508
- return this._table.options.chartDimensionLinkage.selectedReverseStateFilter(datum);
87509
- }
87510
- if (this._table._selectedDataMode === 'click') {
87511
- return selected_reverse(datum);
87512
- }
87513
- return false;
87514
- }
87515
- },
87516
- inBrush: {
87517
- filter: (datum) => {
87518
- if (this._table.options.chartDimensionLinkage?.inBrushStateFilter) {
87519
- return this._table.options.chartDimensionLinkage.inBrushStateFilter(datum);
87520
- }
87521
- if (this._table._selectedDataMode === 'brush') {
87522
- return select_filter(datum);
87523
- }
87524
- return false;
87525
- }
87526
- },
87527
- outOfBrush: {
87528
- filter: (datum) => {
87529
- if (this._table.options.chartDimensionLinkage?.outOfBrushStateFilter) {
87530
- return this._table.options.chartDimensionLinkage.outOfBrushStateFilter(datum);
87595
+ if (this._table._selectedDataItemsInChart.length >= 1) {
87596
+ const match = this._table._selectedDataItemsInChart.find(item => {
87597
+ for (const itemKey in item) {
87598
+ if (typeof item[itemKey] !== 'object' && item[itemKey] !== datum[itemKey]) {
87599
+ return false;
87600
+ }
87601
+ }
87602
+ return true;
87603
+ });
87604
+ return !match;
87531
87605
  }
87532
- if (this._table._selectedDataMode === 'brush') {
87533
- return selected_reverse(datum);
87606
+ else if (this._table._selectedDimensionInChart?.length) {
87607
+ const match = this._table._selectedDimensionInChart.every(item => {
87608
+ if (typeof item.value !== 'object' && datum[item.key] !== item.value) {
87609
+ return false;
87610
+ }
87611
+ return true;
87612
+ });
87613
+ return !match;
87534
87614
  }
87535
87615
  return false;
87536
87616
  }
@@ -91802,7 +91882,6 @@
91802
91882
  pivotSortState;
91803
91883
  dataset;
91804
91884
  _selectedDataItemsInChart = [];
91805
- _selectedDataMode = 'click';
91806
91885
  _selectedDimensionInChart = [];
91807
91886
  _chartEventMap = {};
91808
91887
  _axes;
@@ -93553,7 +93632,7 @@
93553
93632
  }
93554
93633
 
93555
93634
  registerForVrender();
93556
- const version = "1.22.11-alpha.0";
93635
+ const version = "1.22.11-alpha.2";
93557
93636
  function getIcons() {
93558
93637
  return get$2();
93559
93638
  }