@visactor/vtable-gantt 1.22.11-alpha.7 → 1.22.11-alpha.8

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.
@@ -38455,6 +38455,24 @@
38455
38455
  }, delay));
38456
38456
  };
38457
38457
  }
38458
+ function cancellableThrottle(func, delay) {
38459
+ let timer = null,
38460
+ lastArgs = null,
38461
+ context = null;
38462
+ return {
38463
+ throttled: function (...args) {
38464
+ lastArgs = args, context = this, timer || (timer = setTimeout(() => {
38465
+ lastArgs && func.apply(context, lastArgs), timer = null, lastArgs = null, context = null;
38466
+ }, delay));
38467
+ },
38468
+ cancel: () => {
38469
+ timer && (clearTimeout(timer), timer = null, lastArgs = null, context = null);
38470
+ },
38471
+ flush: () => {
38472
+ timer && lastArgs && (clearTimeout(timer), func.apply(context, lastArgs), timer = null, lastArgs = null, context = null);
38473
+ }
38474
+ };
38475
+ }
38458
38476
  function pad(num, totalChars) {
38459
38477
  for (num = `${num}`; num.length < totalChars;) num = "0" + num;
38460
38478
  return num;
@@ -38718,7 +38736,6 @@
38718
38736
  AFTER_UPDATE_CELL_CONTENT_WIDTH: "after_update_cell_content_width",
38719
38737
  AFTER_UPDATE_SELECT_BORDER_HEIGHT: "after_update_select_border_height",
38720
38738
  CHANGE_CELL_VALUE: "change_cell_value",
38721
- CHANGE_CELL_VALUES: "change_cell_values",
38722
38739
  DRAG_FILL_HANDLE_END: "drag_fill_handle_end",
38723
38740
  MOUSEDOWN_FILL_HANDLE: "mousedown_fill_handle",
38724
38741
  DBLCLICK_FILL_HANDLE: "dblclick_fill_handle",
@@ -40851,24 +40868,6 @@
40851
40868
  }
40852
40869
  }
40853
40870
  }
40854
- changeFieldValueByRecordIndex(value, recordIndex, field, table) {
40855
- var _a, _b, _c, _d;
40856
- if (null === field) return;
40857
- if (null == recordIndex) return;
40858
- const rawKey = recordIndex.toString();
40859
- if (!this.beforeChangedRecordsMap.has(rawKey)) {
40860
- const rawRecords = Array.isArray(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.records) ? this.dataSourceObj.records : null,
40861
- originRecord = rawRecords ? Array.isArray(recordIndex) ? getValueFromDeepArray(rawRecords, recordIndex) : rawRecords[recordIndex] : void 0;
40862
- this.beforeChangedRecordsMap.set(rawKey, null !== (_b = cloneDeep(originRecord, void 0, ["vtable_gantt_linkedFrom", "vtable_gantt_linkedTo"])) && void 0 !== _b ? _b : {});
40863
- }
40864
- if ("string" == typeof field || "number" == typeof field) {
40865
- const beforeChangedValue = null === (_c = this.beforeChangedRecordsMap.get(rawKey)) || void 0 === _c ? void 0 : _c[field],
40866
- rawRecords = Array.isArray(null === (_d = this.dataSourceObj) || void 0 === _d ? void 0 : _d.records) ? this.dataSourceObj.records : null,
40867
- record = rawRecords ? Array.isArray(recordIndex) ? getValueFromDeepArray(rawRecords, recordIndex) : rawRecords[recordIndex] : void 0;
40868
- let formatValue = value;
40869
- "number" == typeof beforeChangedValue && isAllDigits(value) && (formatValue = parseFloat(value)), record ? record[field] = formatValue : rawRecords && "number" == typeof recordIndex && (rawRecords[recordIndex] = "Array" === this.addRecordRule ? [] : {}, rawRecords[recordIndex][field] = formatValue);
40870
- }
40871
- }
40872
40871
  cacheBeforeChangedRecord(dataIndex, table) {
40873
40872
  var _a;
40874
40873
  if (!this.beforeChangedRecordsMap.has(dataIndex.toString())) {
@@ -40884,82 +40883,41 @@
40884
40883
  Array.isArray(indexed) || this.records.splice(indexed, 1, record);
40885
40884
  }
40886
40885
  }
40887
- _getRawRecordsArray() {
40886
+ addRecord(record, index) {
40888
40887
  var _a;
40889
- const rawRecords = null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.records;
40890
- return Array.isArray(rawRecords) ? rawRecords : null;
40891
- }
40892
- _hasFilterInEffect() {
40893
- var _a, _b, _c, _d, _e;
40894
- return (null !== (_c = null === (_b = null === (_a = this.dataConfig) || void 0 === _a ? void 0 : _a.filterRules) || void 0 === _b ? void 0 : _b.length) && void 0 !== _c ? _c : 0) >= 1 || (null !== (_e = null === (_d = this.lastFilterRules) || void 0 === _d ? void 0 : _d.length) && void 0 !== _e ? _e : 0) >= 1;
40895
- }
40896
- _normalizeInsertIndex(index, length) {
40897
- return null == index || index > length ? length : index < 0 ? 0 : index;
40898
- }
40899
- _mapViewInsertIndexToRawInsertIndex(rawRecords, viewIndex) {
40900
- if (viewIndex >= this.records.length) return rawRecords.length;
40901
- if (viewIndex <= 0) return 0;
40902
- const prevRecord = this.records[viewIndex - 1],
40903
- rawIndex = rawRecords.indexOf(prevRecord);
40904
- return rawIndex >= 0 ? rawIndex + 1 : rawRecords.length;
40905
- }
40906
- _resetIndexingFromViewRecords() {
40907
- if (this._sourceLength = this.records.length, this.currentIndexedData = Array.from({
40908
- length: this._sourceLength
40909
- }, (_, i) => i), "tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) return this.pagination.totalCount = this._sourceLength, void this.updatePagerData();
40910
- this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
40911
- }
40912
- addRecord(record, index, syncToOriginalRecords = !1) {
40913
- var _a, _b, _c;
40914
- if (!syncToOriginalRecords) {
40915
- if (Array.isArray(this.records)) {
40916
- this.records.splice(index, 0, record), this.adjustBeforeChangedRecordsMap(index, 1), this.currentIndexedData.push(this.currentIndexedData.length), this._sourceLength += 1;
40917
- for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].push(record);
40918
- if ("tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) {
40919
- this.pagination.totalCount = this._sourceLength;
40920
- const {
40921
- perPageCount: perPageCount,
40922
- currentPage: currentPage
40923
- } = this.pagination;
40924
- index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
40925
- } else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
40926
- (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, 1);
40927
- }
40928
- return;
40888
+ if (Array.isArray(this.records)) {
40889
+ this.records.splice(index, 0, record), this.adjustBeforeChangedRecordsMap(index, 1), this.currentIndexedData.push(this.currentIndexedData.length), this._sourceLength += 1;
40890
+ for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].push(record);
40891
+ if ("tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) {
40892
+ this.pagination.totalCount = this._sourceLength;
40893
+ const {
40894
+ perPageCount: perPageCount,
40895
+ currentPage: currentPage
40896
+ } = this.pagination;
40897
+ index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
40898
+ } else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
40899
+ (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, 1);
40929
40900
  }
40930
- const rawRecords = this._getRawRecordsArray();
40931
- if (!rawRecords) return;
40932
- const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length),
40933
- rawInsertIndex = this._hasFilterInEffect() ? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex) : this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
40934
- rawRecords.splice(rawInsertIndex, 0, record), this.beforeChangedRecordsMap.clear(), this.sortedIndexMap.clear(), this.updateFilterRules(null === (_b = this.dataConfig) || void 0 === _b ? void 0 : _b.filterRules), (null === (_c = this.dataSourceObj) || void 0 === _c ? void 0 : _c.added) && this.dataSourceObj.added(rawInsertIndex, 1);
40935
40901
  }
40936
- addRecords(recordArr, index, syncToOriginalRecords = !1) {
40937
- var _a, _b, _c;
40938
- if (!syncToOriginalRecords) {
40939
- if (Array.isArray(this.records)) {
40940
- if (Array.isArray(recordArr)) {
40941
- this.records.splice(index, 0, ...recordArr), this.adjustBeforeChangedRecordsMap(index, recordArr.length);
40942
- for (let i = 0; i < recordArr.length; i++) this.currentIndexedData.push(this.currentIndexedData.length);
40943
- this._sourceLength += recordArr.length;
40944
- for (let i = 0; i < this.fieldAggregators.length; i++) for (let j = 0; j < recordArr.length; j++) this.fieldAggregators[i].push(recordArr[j]);
40945
- }
40946
- if (this.userPagination) {
40947
- this.pagination.totalCount = this._sourceLength;
40948
- const {
40949
- perPageCount: perPageCount,
40950
- currentPage: currentPage
40951
- } = this.pagination;
40952
- index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
40953
- } else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
40954
- (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, recordArr.length);
40902
+ addRecords(recordArr, index) {
40903
+ var _a;
40904
+ if (Array.isArray(this.records)) {
40905
+ if (Array.isArray(recordArr)) {
40906
+ this.records.splice(index, 0, ...recordArr), this.adjustBeforeChangedRecordsMap(index, recordArr.length);
40907
+ for (let i = 0; i < recordArr.length; i++) this.currentIndexedData.push(this.currentIndexedData.length);
40908
+ this._sourceLength += recordArr.length;
40909
+ for (let i = 0; i < this.fieldAggregators.length; i++) for (let j = 0; j < recordArr.length; j++) this.fieldAggregators[i].push(recordArr[j]);
40955
40910
  }
40956
- return;
40911
+ if (this.userPagination) {
40912
+ this.pagination.totalCount = this._sourceLength;
40913
+ const {
40914
+ perPageCount: perPageCount,
40915
+ currentPage: currentPage
40916
+ } = this.pagination;
40917
+ index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
40918
+ } else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
40919
+ (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, recordArr.length);
40957
40920
  }
40958
- const rawRecords = this._getRawRecordsArray();
40959
- if (!rawRecords || !Array.isArray(recordArr) || 0 === recordArr.length) return;
40960
- const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length),
40961
- rawInsertIndex = this._hasFilterInEffect() ? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex) : this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
40962
- rawRecords.splice(rawInsertIndex, 0, ...recordArr), this.beforeChangedRecordsMap.clear(), this.sortedIndexMap.clear(), this.updateFilterRules(null === (_b = this.dataConfig) || void 0 === _b ? void 0 : _b.filterRules), (null === (_c = this.dataSourceObj) || void 0 === _c ? void 0 : _c.added) && this.dataSourceObj.added(rawInsertIndex, recordArr.length);
40963
40921
  }
40964
40922
  addRecordForSorted(record) {
40965
40923
  Array.isArray(this.records) && (this.beforeChangedRecordsMap.clear(), this.records.push(record), this.currentIndexedData.push(this.currentIndexedData.length), this._sourceLength += 1, this.sortedIndexMap.clear(), this.userPagination || (this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength));
@@ -40975,49 +40933,27 @@
40975
40933
  }
40976
40934
  }
40977
40935
  adjustBeforeChangedRecordsMap(insertIndex, insertCount, type = "add") {
40978
- const delta = "add" === type ? insertCount : -insertCount,
40979
- numericKeys = [];
40980
- this.beforeChangedRecordsMap.forEach((_, key) => {
40981
- const numKey = Number(key);
40982
- Number.isInteger(numKey) && numKey.toString() === key && numKey >= insertIndex && numericKeys.push(numKey);
40983
- }), numericKeys.sort((a, b) => "add" === type ? b - a : a - b);
40984
- for (let i = 0; i < numericKeys.length; i++) {
40985
- const key = numericKeys[i],
40986
- record = this.beforeChangedRecordsMap.get(key.toString());
40987
- this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + delta).toString(), record);
40988
- }
40989
- }
40990
- deleteRecords(recordIndexs, syncToOriginalRecords = !1) {
40991
- var _a, _b, _c;
40992
- if (!syncToOriginalRecords) {
40993
- if (Array.isArray(this.records)) {
40994
- const realDeletedRecordIndexs = [],
40995
- recordIndexsMaxToMin = recordIndexs.sort((a, b) => b - a);
40996
- for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
40997
- const recordIndex = recordIndexsMaxToMin[index];
40998
- if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
40999
- this.adjustBeforeChangedRecordsMap(recordIndex, 1, "delete"), realDeletedRecordIndexs.push(recordIndex);
41000
- const deletedRecord = this.records[recordIndex];
41001
- for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].deleteRecord(deletedRecord);
41002
- this.records.splice(recordIndex, 1), this.currentIndexedData.pop(), this._sourceLength -= 1;
41003
- }
41004
- return this.userPagination || (this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength), this.updatePagerData(), (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.deleted) && this.dataSourceObj.deleted(realDeletedRecordIndexs), realDeletedRecordIndexs;
41005
- }
41006
- return [];
41007
- }
41008
- const rawRecords = this._getRawRecordsArray();
41009
- if (!rawRecords || !Array.isArray(this.records)) return [];
41010
- const realDeletedRecordIndexs = [],
41011
- recordIndexsMaxToMin = recordIndexs.slice().sort((a, b) => b - a),
41012
- rawDeletedIndexs = [];
41013
- for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
41014
- const viewIndex = recordIndexsMaxToMin[index];
41015
- if (viewIndex >= this.records.length || viewIndex < 0) continue;
41016
- const deletedRecord = this.records[viewIndex],
41017
- rawIndex = rawRecords.indexOf(deletedRecord);
41018
- rawIndex >= 0 && (rawRecords.splice(rawIndex, 1), rawDeletedIndexs.push(rawIndex)), realDeletedRecordIndexs.push(viewIndex);
40936
+ for (let key = this.beforeChangedRecordsMap.size - 1; key >= insertIndex; key--) {
40937
+ const record = this.beforeChangedRecordsMap.get(key.toString());
40938
+ this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + ("add" === type ? insertCount : -insertCount)).toString(), record);
41019
40939
  }
41020
- return this.beforeChangedRecordsMap.clear(), this.sortedIndexMap.clear(), this.updateFilterRules(null === (_b = this.dataConfig) || void 0 === _b ? void 0 : _b.filterRules), (null === (_c = this.dataSourceObj) || void 0 === _c ? void 0 : _c.deleted) && this.dataSourceObj.deleted(rawDeletedIndexs), realDeletedRecordIndexs;
40940
+ }
40941
+ deleteRecords(recordIndexs) {
40942
+ var _a;
40943
+ if (Array.isArray(this.records)) {
40944
+ const realDeletedRecordIndexs = [],
40945
+ recordIndexsMaxToMin = recordIndexs.sort((a, b) => b - a);
40946
+ for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
40947
+ const recordIndex = recordIndexsMaxToMin[index];
40948
+ if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
40949
+ this.adjustBeforeChangedRecordsMap(recordIndex, 1, "delete"), realDeletedRecordIndexs.push(recordIndex);
40950
+ const deletedRecord = this.records[recordIndex];
40951
+ for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].deleteRecord(deletedRecord);
40952
+ this.records.splice(recordIndex, 1), this.currentIndexedData.pop(), this._sourceLength -= 1;
40953
+ }
40954
+ return this.userPagination || (this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength), this.updatePagerData(), (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.deleted) && this.dataSourceObj.deleted(realDeletedRecordIndexs), realDeletedRecordIndexs;
40955
+ }
40956
+ return [];
41021
40957
  }
41022
40958
  deleteRecordsForSorted(recordIndexs) {
41023
40959
  if (Array.isArray(this.records)) {
@@ -41031,34 +40967,18 @@
41031
40967
  this.sortedIndexMap.clear(), this.userPagination || (this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength), this.beforeChangedRecordsMap.clear();
41032
40968
  }
41033
40969
  }
41034
- updateRecords(records, recordIndexs, syncToOriginalRecords = !1) {
41035
- var _a;
41036
- if (!syncToOriginalRecords) {
41037
- const realDeletedRecordIndexs = [];
41038
- for (let index = 0; index < recordIndexs.length; index++) {
41039
- const recordIndex = recordIndexs[index];
41040
- if (Array.isArray(recordIndex)) this.beforeChangedRecordsMap.delete(recordIndex.toString()), realDeletedRecordIndexs.push(recordIndex), recordIndex.slice(0, -1).reduce((acc, key) => (void 0 === acc[key] && (acc[key] = {}), acc[key].children), this.records)[recordIndex[recordIndex.length - 1]] = records[index];else {
41041
- if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
41042
- this.beforeChangedRecordsMap.delete(recordIndex.toString()), realDeletedRecordIndexs.push(recordIndex);
41043
- for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].updateRecord(this.records[recordIndex], records[index]);
41044
- this.records[recordIndex] = records[index];
41045
- }
41046
- }
41047
- return this.userPagination && this.updatePagerData(), realDeletedRecordIndexs;
41048
- }
41049
- const rawRecords = this._getRawRecordsArray();
41050
- if (!rawRecords || !Array.isArray(this.records)) return [];
41051
- const realUpdatedIndexs = [];
40970
+ updateRecords(records, recordIndexs) {
40971
+ const realDeletedRecordIndexs = [];
41052
40972
  for (let index = 0; index < recordIndexs.length; index++) {
41053
40973
  const recordIndex = recordIndexs[index];
41054
- if (Array.isArray(recordIndex)) this.beforeChangedRecordsMap.delete(recordIndex.toString()), realUpdatedIndexs.push(recordIndex), recordIndex.slice(0, -1).reduce((acc, key) => (void 0 === acc[key] && (acc[key] = {}), acc[key].children), rawRecords)[recordIndex[recordIndex.length - 1]] = records[index];else {
41055
- if (recordIndex >= this.records.length || recordIndex < 0) continue;
41056
- const oldRecord = this.records[recordIndex],
41057
- rawIndex = rawRecords.indexOf(oldRecord);
41058
- rawIndex >= 0 && (rawRecords[rawIndex] = records[index]), realUpdatedIndexs.push(recordIndex);
40974
+ if (Array.isArray(recordIndex)) this.beforeChangedRecordsMap.delete(recordIndex.toString()), realDeletedRecordIndexs.push(recordIndex), recordIndex.slice(0, -1).reduce((acc, key) => (void 0 === acc[key] && (acc[key] = {}), acc[key].children), this.records)[recordIndex[recordIndex.length - 1]] = records[index];else {
40975
+ if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
40976
+ this.beforeChangedRecordsMap.delete(recordIndex.toString()), realDeletedRecordIndexs.push(recordIndex);
40977
+ for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].updateRecord(this.records[recordIndex], records[index]);
40978
+ this.records[recordIndex] = records[index];
41059
40979
  }
41060
40980
  }
41061
- return this.beforeChangedRecordsMap.clear(), this.sortedIndexMap.clear(), this.updateFilterRules(null === (_a = this.dataConfig) || void 0 === _a ? void 0 : _a.filterRules), realUpdatedIndexs;
40981
+ return this.userPagination && this.updatePagerData(), realDeletedRecordIndexs;
41062
40982
  }
41063
40983
  updateRecordsForSorted(records, recordIndexs) {
41064
40984
  for (let index = 0; index < recordIndexs.length; index++) {
@@ -47692,11 +47612,35 @@
47692
47612
  return hoverMode;
47693
47613
  }
47694
47614
 
47615
+ let brushingChartInstance,
47616
+ brushingChartInstanceCellPos = {
47617
+ col: -1,
47618
+ row: -1
47619
+ };
47620
+ function setBrushingChartInstance(chartInstance, col, row) {
47621
+ brushingChartInstance = chartInstance, brushingChartInstanceCellPos = {
47622
+ col: col,
47623
+ row: row
47624
+ };
47625
+ }
47626
+ function clearBrushingChartInstance() {
47627
+ brushingChartInstance = void 0, brushingChartInstanceCellPos = {
47628
+ col: -1,
47629
+ row: -1
47630
+ };
47631
+ }
47632
+ function getBrushingChartInstance() {
47633
+ return brushingChartInstance;
47634
+ }
47635
+ function getBrushingChartInstanceCellPos() {
47636
+ return brushingChartInstanceCellPos;
47637
+ }
47695
47638
  const chartInstanceListColumnByColumnDirection = {};
47696
47639
  const chartInstanceListRowByRowDirection = {};
47640
+ const delayRunDimensionHoverTimer = [];
47697
47641
  function generateChartInstanceListByColumnDirection(col, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
47698
47642
  var _a;
47699
- isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
47643
+ clearDelayRunDimensionHoverTimers(), isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
47700
47644
  const {
47701
47645
  rowStart: rowStart
47702
47646
  } = table.getBodyVisibleRowRange();
@@ -47705,76 +47649,40 @@
47705
47649
  for (let i = rowStart; i <= rowEnd; i++) {
47706
47650
  const cellGroup = table.scenegraph.getCell(col, i),
47707
47651
  chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47708
- chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListColumnByColumnDirection[col][i] || isValid$1(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance), setTimeout(() => {
47709
- var _a, _b, _c, _d, _e, _f;
47652
+ chartInstanceListColumnByColumnDirection[col][i] || isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance);
47653
+ const timer = setTimeout(() => {
47654
+ var _a, _b, _c, _d;
47710
47655
  if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
47711
47656
  const chartDimensionLinkage = table.options.chartDimensionLinkage;
47712
47657
  let isShowTooltip = !isScatter;
47713
- if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, i === rowEnd && isShowTooltip) {
47714
- const heightLimitToShowTooltipForEdgeRow = null !== (_c = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _c ? _c : 0,
47715
- {
47716
- rowEnd: rowEnd1
47717
- } = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
47718
- if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
47719
- const {
47720
- rowEnd: rowEnd2
47721
- } = table.getBodyVisibleRowRange(0, 5);
47722
- isShowTooltip = rowEnd2 !== rowEnd;
47723
- }
47724
- } else if (i === rowStart && isShowTooltip) {
47725
- const heightLimitToShowTooltipForEdgeRow = null !== (_d = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _d ? _d : 0,
47726
- {
47727
- rowStart: rowStart1
47728
- } = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
47729
- if (rowStart1 === rowStart) isShowTooltip = !0;else {
47730
- const {
47731
- rowStart: rowStart2
47732
- } = table.getBodyVisibleRowRange(0, -5);
47733
- isShowTooltip = rowStart2 !== rowStart;
47734
- }
47735
- }
47736
- if (isScatter) table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || null === (_f = (_e = chartInstanceListColumnByColumnDirection[col][i]).showCrosshair) || void 0 === _f || _f.call(_e, axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue);else {
47737
- const bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
47658
+ if (isScatter || "object" != typeof chartDimensionLinkage || (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeRow(i, table)), isScatter) table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || null === (_d = (_c = chartInstanceListColumnByColumnDirection[col][i]).showCrosshair) || void 0 === _d || _d.call(_c, axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue);else {
47659
+ const cellBoundry = table.getCellRelativeRect(col, i),
47660
+ bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
47738
47661
  absolutePositionTop = Math.max(bodyBoundryTop, table.getCellRelativeRect(col, i).top);
47739
47662
  hideTooltip ? (table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || chartInstanceListColumnByColumnDirection[col][i].hideTooltip(), chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
47740
47663
  tooltip: !1,
47741
47664
  showTooltipOption: {
47742
- x: canvasXY.x,
47743
- y: absolutePositionTop,
47665
+ x: canvasXY.x - cellBoundry.left,
47666
+ y: absolutePositionTop - cellBoundry.top,
47744
47667
  activeType: "dimension"
47745
47668
  }
47746
47669
  })) : chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
47747
47670
  tooltip: isShowTooltip,
47748
47671
  showTooltipOption: {
47749
- x: canvasXY.x,
47750
- y: absolutePositionTop,
47672
+ x: canvasXY.x - cellBoundry.left,
47673
+ y: absolutePositionTop - cellBoundry.top,
47751
47674
  activeType: "dimension"
47752
47675
  }
47753
47676
  });
47754
47677
  }
47755
47678
  }
47756
- }, 0), table.scenegraph.updateNextFrame();
47757
- }
47758
- }
47759
- function clearChartInstanceListByColumnDirection(col, excludedRow, table) {
47760
- var _a;
47761
- if (isValid$1(chartInstanceListColumnByColumnDirection[col])) {
47762
- for (const i in chartInstanceListColumnByColumnDirection[col]) {
47763
- if (isValid$1(excludedRow) && Number(i) === excludedRow) continue;
47764
- const cellGroup = table.scenegraph.getCell(col, Number(i)),
47765
- chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47766
- chartNode.addUpdateShapeAndBoundsTag(), isValid$1(chartNode) && (chartNode.deactivate(table, {
47767
- releaseChartInstance: !0,
47768
- releaseColumnChartInstance: !1,
47769
- releaseRowChartInstance: !1
47770
- }), chartInstanceListColumnByColumnDirection[col][i] = null);
47771
- }
47772
- delete chartInstanceListColumnByColumnDirection[col];
47679
+ }, 0);
47680
+ delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
47773
47681
  }
47774
47682
  }
47775
47683
  function generateChartInstanceListByRowDirection(row, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
47776
47684
  var _a;
47777
- isValid$1(chartInstanceListRowByRowDirection[row]) || (chartInstanceListRowByRowDirection[row] = {});
47685
+ clearDelayRunDimensionHoverTimers(), isValid$1(chartInstanceListRowByRowDirection[row]) || (chartInstanceListRowByRowDirection[row] = {});
47778
47686
  const {
47779
47687
  colStart: colStart
47780
47688
  } = table.getBodyVisibleColRange();
@@ -47783,64 +47691,162 @@
47783
47691
  for (let i = colStart; i <= colEnd; i++) {
47784
47692
  const cellGroup = table.scenegraph.getCell(i, row),
47785
47693
  chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47786
- chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListRowByRowDirection[row][i] || isValid$1(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance), setTimeout(() => {
47694
+ chartInstanceListRowByRowDirection[row][i] || isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance);
47695
+ const timer = setTimeout(() => {
47787
47696
  var _a, _b, _c, _d;
47788
47697
  if (null === (_a = chartInstanceListRowByRowDirection[row]) || void 0 === _a ? void 0 : _a[i]) {
47789
47698
  const chartDimensionLinkage = table.options.chartDimensionLinkage;
47790
47699
  let isShowTooltip = !isScatter;
47791
- if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, i === colEnd && isShowTooltip) {
47792
- const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
47793
- {
47794
- colEnd: colEnd1
47795
- } = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
47796
- if (colEnd1 === colEnd) isShowTooltip = !0;else {
47797
- const {
47798
- colEnd: colEnd2
47799
- } = table.getBodyVisibleColRange(0, 5);
47800
- isShowTooltip = colEnd2 !== colEnd;
47801
- }
47802
- } else if (i === colStart && isShowTooltip) {
47803
- const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
47804
- {
47805
- colStart: colStart1
47806
- } = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
47807
- if (colStart1 === colStart) isShowTooltip = !0;else {
47808
- const {
47809
- colStart: colStart2
47810
- } = table.getBodyVisibleColRange(0, -5);
47811
- isShowTooltip = colStart2 !== colStart;
47812
- }
47813
- }
47814
- if (isScatter) table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || null === (_d = (_c = chartInstanceListRowByRowDirection[row][i]).showCrosshair) || void 0 === _d || _d.call(_c, axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue);else {
47815
- const bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
47700
+ if (isScatter || "object" != typeof chartDimensionLinkage || (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeColumn(i, table)), isScatter) table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || null === (_d = (_c = chartInstanceListRowByRowDirection[row][i]).showCrosshair) || void 0 === _d || _d.call(_c, axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue);else {
47701
+ const cellBoundry = table.getCellRelativeRect(i, row),
47702
+ bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
47816
47703
  absolutePositionLeft = Math.max(bodyBoundryLeft, table.getCellRelativeRect(i, row).left);
47817
47704
  hideTooltip ? (table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || chartInstanceListRowByRowDirection[row][i].hideTooltip(), chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
47818
47705
  tooltip: !1,
47819
47706
  showTooltipOption: {
47820
- x: absolutePositionLeft,
47821
- y: canvasXY.y,
47707
+ x: absolutePositionLeft - cellBoundry.left,
47708
+ y: canvasXY.y - cellBoundry.top,
47822
47709
  activeType: "dimension"
47823
47710
  }
47824
47711
  })) : chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
47825
47712
  tooltip: isShowTooltip,
47826
47713
  showTooltipOption: {
47827
- x: absolutePositionLeft,
47828
- y: canvasXY.y,
47714
+ x: absolutePositionLeft - cellBoundry.left,
47715
+ y: canvasXY.y - cellBoundry.top,
47829
47716
  activeType: "dimension"
47830
47717
  }
47831
47718
  });
47832
47719
  }
47833
47720
  }
47834
- }, 0), table.scenegraph.updateNextFrame();
47721
+ }, 0);
47722
+ delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
47835
47723
  }
47836
47724
  }
47837
- function clearChartInstanceListByRowDirection(row, excludedCol, table) {
47725
+ function generateChartInstanceListByViewRange(datum, table, deactivate = !1) {
47726
+ var _a;
47727
+ clearDelayRunDimensionHoverTimers();
47728
+ const {
47729
+ rowStart: rowStart
47730
+ } = table.getBodyVisibleRowRange();
47731
+ let rowEnd = table.getBodyVisibleRowRange().rowEnd;
47732
+ rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
47733
+ const {
47734
+ colStart: colStart
47735
+ } = table.getBodyVisibleColRange();
47736
+ let colEnd = table.getBodyVisibleColRange().colEnd;
47737
+ colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
47738
+ for (let col = colStart; col <= colEnd; col++) {
47739
+ isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
47740
+ for (let i = rowStart; i <= rowEnd; i++) {
47741
+ const cellGroup = table.scenegraph.getCell(col, i),
47742
+ chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47743
+ chartInstanceListColumnByColumnDirection[col][i] || isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance ? chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance : "pie" === chartNode.attribute.spec.type && (chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance));
47744
+ const timer = setTimeout(() => {
47745
+ var _a, _b;
47746
+ if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
47747
+ const chartDimensionLinkage = table.options.chartDimensionLinkage;
47748
+ let isShowTooltip = !0;
47749
+ "object" == typeof chartDimensionLinkage && (deactivate ? (chartInstanceListColumnByColumnDirection[col][i].setHovered(), chartInstanceListColumnByColumnDirection[col][i].hideTooltip()) : (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeRow(i, table), isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeColumn(col, table), chartInstanceListColumnByColumnDirection[col][i].setHovered(datum), isShowTooltip && chartInstanceListColumnByColumnDirection[col][i].showTooltip(datum, {
47750
+ activeType: "mark"
47751
+ })));
47752
+ }
47753
+ }, 0);
47754
+ delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
47755
+ }
47756
+ }
47757
+ }
47758
+ function checkIsShowTooltipForEdgeRow(row, table) {
47759
+ var _a, _b;
47760
+ let isShowTooltip = !0;
47761
+ const {
47762
+ rowStart: rowStart
47763
+ } = table.getBodyVisibleRowRange();
47764
+ let rowEnd = table.getBodyVisibleRowRange().rowEnd;
47765
+ rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
47766
+ const chartDimensionLinkage = table.options.chartDimensionLinkage;
47767
+ if (row === rowEnd && isShowTooltip) {
47768
+ const heightLimitToShowTooltipForEdgeRow = null !== (_a = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _a ? _a : 0,
47769
+ {
47770
+ rowEnd: rowEnd1
47771
+ } = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
47772
+ if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
47773
+ const {
47774
+ rowEnd: rowEnd2
47775
+ } = table.getBodyVisibleRowRange(0, 5);
47776
+ isShowTooltip = rowEnd2 !== rowEnd;
47777
+ }
47778
+ } else if (row === rowStart && isShowTooltip) {
47779
+ const heightLimitToShowTooltipForEdgeRow = null !== (_b = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _b ? _b : 0,
47780
+ {
47781
+ rowStart: rowStart1
47782
+ } = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
47783
+ if (rowStart1 === rowStart) isShowTooltip = !0;else {
47784
+ const {
47785
+ rowStart: rowStart2
47786
+ } = table.getBodyVisibleRowRange(0, -5);
47787
+ isShowTooltip = rowStart2 !== rowStart;
47788
+ }
47789
+ }
47790
+ return isShowTooltip;
47791
+ }
47792
+ function checkIsShowTooltipForEdgeColumn(col, table) {
47793
+ let isShowTooltip = !0;
47794
+ const {
47795
+ colStart: colStart
47796
+ } = table.getBodyVisibleColRange();
47797
+ let colEnd = table.getBodyVisibleColRange().colEnd;
47798
+ colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
47799
+ const chartDimensionLinkage = table.options.chartDimensionLinkage;
47800
+ if (col === colEnd && isShowTooltip) {
47801
+ const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
47802
+ {
47803
+ colEnd: colEnd1
47804
+ } = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
47805
+ if (colEnd1 === colEnd) isShowTooltip = !0;else {
47806
+ const {
47807
+ colEnd: colEnd2
47808
+ } = table.getBodyVisibleColRange(0, 5);
47809
+ isShowTooltip = colEnd2 !== colEnd;
47810
+ }
47811
+ } else if (col === colStart && isShowTooltip) {
47812
+ const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
47813
+ {
47814
+ colStart: colStart1
47815
+ } = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
47816
+ if (colStart1 === colStart) isShowTooltip = !0;else {
47817
+ const {
47818
+ colStart: colStart2
47819
+ } = table.getBodyVisibleColRange(0, -5);
47820
+ isShowTooltip = colStart2 !== colStart;
47821
+ }
47822
+ }
47823
+ return isShowTooltip;
47824
+ }
47825
+ function clearChartInstanceListByColumnDirection(col, excludedRow, table, forceRelease = !1) {
47826
+ var _a;
47827
+ if (isValid$1(chartInstanceListColumnByColumnDirection[col])) {
47828
+ for (const i in chartInstanceListColumnByColumnDirection[col]) {
47829
+ if (isValid$1(excludedRow) && Number(i) === excludedRow) continue;
47830
+ const cellGroup = table.scenegraph.getCell(col, Number(i)),
47831
+ chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47832
+ isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.deactivate(table, {
47833
+ forceRelease: forceRelease,
47834
+ releaseChartInstance: !0,
47835
+ releaseColumnChartInstance: !1,
47836
+ releaseRowChartInstance: !1
47837
+ }), chartInstanceListColumnByColumnDirection[col][i] = null);
47838
+ }
47839
+ delete chartInstanceListColumnByColumnDirection[col];
47840
+ }
47841
+ }
47842
+ function clearChartInstanceListByRowDirection(row, excludedCol, table, forceRelease = !1) {
47838
47843
  var _a;
47839
47844
  if (isValid$1(chartInstanceListRowByRowDirection[row])) for (const i in chartInstanceListRowByRowDirection[row]) {
47840
47845
  if (isValid$1(excludedCol) && Number(i) === excludedCol) continue;
47841
47846
  const cellGroup = table.scenegraph.getCell(Number(i), row),
47842
47847
  chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47843
- chartNode.addUpdateShapeAndBoundsTag(), isValid$1(chartNode) && (chartNode.deactivate(table, {
47848
+ isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.deactivate(table, {
47849
+ forceRelease: forceRelease,
47844
47850
  releaseChartInstance: !0,
47845
47851
  releaseColumnChartInstance: !1,
47846
47852
  releaseRowChartInstance: !1
@@ -47848,6 +47854,19 @@
47848
47854
  }
47849
47855
  delete chartInstanceListRowByRowDirection[row];
47850
47856
  }
47857
+ function clearDelayRunDimensionHoverTimers() {
47858
+ for (const timer of delayRunDimensionHoverTimer) clearTimeout(timer);
47859
+ delayRunDimensionHoverTimer.length = 0;
47860
+ }
47861
+ function clearAllChartInstanceList(table, forceRelease = !1) {
47862
+ clearDelayRunDimensionHoverTimers();
47863
+ for (const col in chartInstanceListColumnByColumnDirection) clearChartInstanceListByColumnDirection(Number(col), void 0, table, forceRelease);
47864
+ for (const row in chartInstanceListRowByRowDirection) clearChartInstanceListByRowDirection(Number(row), void 0, table, forceRelease);
47865
+ }
47866
+ let disabledShowTooltipToAllChartInstances = !1;
47867
+ function isDisabledShowTooltipToAllChartInstances() {
47868
+ return disabledShowTooltipToAllChartInstances;
47869
+ }
47851
47870
 
47852
47871
  function isValidAlignDomain(domain) {
47853
47872
  return 2 === domain.length && isValidNumber$1(domain[0]) && isValidNumber$1(domain[1]) && domain[1] >= domain[0];
@@ -48481,7 +48500,7 @@
48481
48500
  const CHART_NUMBER_TYPE = genNumberType();
48482
48501
  class Chart extends Rect$2 {
48483
48502
  constructor(isShareChartSpec, params) {
48484
- if (super(params), this.type = "chart", this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), this.delayRunDimensionHoverTimer = void 0, this.numberType = CHART_NUMBER_TYPE, this.isShareChartSpec = isShareChartSpec, params.chartInstance) this.chartInstance = params.chartInstance;else {
48503
+ if (super(params), this.type = "chart", this.activeChartInstanceLastViewBox = null, this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), this.delayRunDimensionHoverTimer = void 0, this.numberType = CHART_NUMBER_TYPE, this.isShareChartSpec = isShareChartSpec, params.chartInstance) this.chartInstance = params.chartInstance;else {
48485
48504
  const chartInstance = this.chartInstance = new params.ClassType(params.spec, merge({}, this.attribute.tableChartOption, {
48486
48505
  renderCanvas: params.canvas,
48487
48506
  mode: "node" === this.attribute.mode ? "node" : "desktop-browser",
@@ -48502,7 +48521,7 @@
48502
48521
  }
48503
48522
  }
48504
48523
  activate(table) {
48505
- var _a, _b, _c, _d, _e;
48524
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
48506
48525
  if (this.activeChartInstance) return;
48507
48526
  const {
48508
48527
  col: col,
@@ -48521,7 +48540,7 @@
48521
48540
  y1: y1 - table.scrollTop,
48522
48541
  y2: y2 - table.scrollTop
48523
48542
  });
48524
- null === (_a = this.activeChartInstance) || void 0 === _a || _a.release(), this.attribute.ClassType.globalConfig.uniqueTooltip = !1, this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, merge({}, this.attribute.tableChartOption, {
48543
+ this.attribute.ClassType.globalConfig.uniqueTooltip = !1, this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, merge({}, this.attribute.tableChartOption, {
48525
48544
  renderCanvas: this.attribute.canvas,
48526
48545
  mode: "desktop-browser",
48527
48546
  canvasControled: !1,
@@ -48555,7 +48574,7 @@
48555
48574
  layer.main && drawParams.clear && hoverColor && (context.beginPath(), context.fillStyle = hoverColor, context.rect(viewBox.x1, viewBox.y1, viewBox.x2 - viewBox.x1, viewBox.y2 - viewBox.y1), context.fill());
48556
48575
  }
48557
48576
  },
48558
- componentShowContent: table.options.chartDimensionLinkage && "scatter" !== this.attribute.spec.type ? {
48577
+ componentShowContent: (null === (_a = table.options.chartDimensionLinkage) || void 0 === _a ? void 0 : _a.showTooltip) && "scatter" !== this.attribute.spec.type ? {
48559
48578
  tooltip: {
48560
48579
  dimension: !1,
48561
48580
  mark: !0
@@ -48566,16 +48585,43 @@
48566
48585
  const chartStage = this.activeChartInstance.getStage(),
48567
48586
  matrix = this.globalTransMatrix.clone(),
48568
48587
  stageMatrix = this.stage.window.getViewBoxTransform();
48588
+ let brushChangeThrottle;
48569
48589
  matrix.multiply(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f), chartStage.window.setViewBoxTransform && chartStage.window.setViewBoxTransform(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f), this.activeChartInstance.renderSync(), null === (_c = null === (_b = table.internalProps.layoutMap) || void 0 === _b ? void 0 : _b.updateDataStateToActiveChartInstance) || void 0 === _c || _c.call(_b, this.activeChartInstance), this.activeChartInstance.on("click", params => {
48570
48590
  var _a;
48571
- !1 === (null === (_a = this.attribute.spec.select) || void 0 === _a ? void 0 : _a.enable) ? table.scenegraph.updateChartState(null) : Chart.temp && table.scenegraph.updateChartState(null == params ? void 0 : params.datum);
48591
+ !1 === (null === (_a = this.attribute.spec.select) || void 0 === _a ? void 0 : _a.enable) ? table.scenegraph.updateChartState(null, void 0) : Chart.temp && table.scenegraph.updateChartState(null == params ? void 0 : params.datum, "click");
48592
+ }), (null === (_d = table.options.chartDimensionLinkage) || void 0 === _d ? void 0 : _d.listenBrushChange) && (brushChangeThrottle = cancellableThrottle(table.scenegraph.updateChartState.bind(table.scenegraph), null !== (_f = null === (_e = table.options.chartDimensionLinkage) || void 0 === _e ? void 0 : _e.brushChangeDelay) && void 0 !== _f ? _f : 100), this.activeChartInstance.on("brushChange", params => {
48593
+ var _a;
48594
+ brushChangeThrottle.throttled(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData, "brush");
48595
+ })), this.activeChartInstance.on("brushStart", params => {
48596
+ const brushingChartInstance = getBrushingChartInstance();
48597
+ brushingChartInstance !== this.activeChartInstance && (brushingChartInstance && brushingChartInstance.getChart().getComponentsByKey("brush")[0].clearBrushStateAndMask(), setBrushingChartInstance(this.activeChartInstance, col, row));
48572
48598
  }), this.activeChartInstance.on("brushEnd", params => {
48573
48599
  var _a;
48574
- table.scenegraph.updateChartState(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData), Chart.temp = 0, setTimeout(() => {
48600
+ null == brushChangeThrottle || brushChangeThrottle.cancel(), table.scenegraph.updateChartState(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData, "brush"), Chart.temp = 0, setTimeout(() => {
48575
48601
  Chart.temp = 1;
48576
48602
  }, 0);
48577
- }), table.options.chartDimensionLinkage && this.activeChartInstance.on("dimensionHover", params => {
48603
+ }), (null === (_g = table.options.chartDimensionLinkage) || void 0 === _g ? void 0 : _g.showTooltip) && ("pie" === this.attribute.spec.type && (this.activeChartInstance.on("pointerover", {
48604
+ markName: "pie"
48605
+ }, params => {
48606
+ var _a;
48607
+ const categoryField = this.attribute.spec.categoryField,
48608
+ datum = {
48609
+ [categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
48610
+ };
48611
+ generateChartInstanceListByViewRange(datum, table, !1);
48612
+ }), this.activeChartInstance.on("pointerout", {
48613
+ markName: "pie"
48614
+ }, params => {
48615
+ var _a;
48616
+ const categoryField = this.attribute.spec.categoryField,
48617
+ datum = {
48618
+ [categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
48619
+ };
48620
+ generateChartInstanceListByViewRange(datum, table, !0);
48621
+ })), this.activeChartInstance.on("dimensionHover", params => {
48578
48622
  var _a, _b;
48623
+ if (isDisabledShowTooltipToAllChartInstances()) return;
48624
+ this.activeChartInstance.disableTooltip(!1);
48579
48625
  const dimensionInfo = null == params ? void 0 : params.dimensionInfo[0],
48580
48626
  canvasXY = null === (_a = null == params ? void 0 : params.event) || void 0 === _a ? void 0 : _a.canvas,
48581
48627
  viewport = null === (_b = null == params ? void 0 : params.event) || void 0 === _b ? void 0 : _b.viewport;
@@ -48592,11 +48638,11 @@
48592
48638
  prev_justShowMarkTooltip = this.justShowMarkTooltip;
48593
48639
  params.mark && params.datum && !Array.isArray(params.datum) ? (this.activeChartInstanceHoverOnMark = params.mark, justShowMarkTooltip = !0) : (this.activeChartInstanceHoverOnMark = null, justShowMarkTooltip = !1), this.justShowMarkTooltip = justShowMarkTooltip;
48594
48640
  let delayRunDimensionHover = !1;
48595
- if (!1 !== prev_justShowMarkTooltip && !1 === justShowMarkTooltip ? (this.justShowMarkTooltipTimer = Date.now(), delayRunDimensionHover = !0) : !1 === prev_justShowMarkTooltip && !1 === justShowMarkTooltip ? delayRunDimensionHover = Date.now() - this.justShowMarkTooltipTimer < 100 : (!1 === prev_justShowMarkTooltip && !0 === justShowMarkTooltip || !0 === prev_justShowMarkTooltip && !0 === justShowMarkTooltip) && (delayRunDimensionHover = !1, clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = void 0), "enter" === params.action || "move" === params.action || preMark !== this.activeChartInstanceHoverOnMark) {
48641
+ if (!1 !== prev_justShowMarkTooltip && !1 === justShowMarkTooltip ? (this.justShowMarkTooltipTimer = Date.now(), delayRunDimensionHover = !0) : !1 === prev_justShowMarkTooltip && !1 === justShowMarkTooltip ? delayRunDimensionHover = Date.now() - this.justShowMarkTooltipTimer < 100 : (!1 === prev_justShowMarkTooltip && !0 === justShowMarkTooltip || !0 === prev_justShowMarkTooltip && !0 === justShowMarkTooltip) && (delayRunDimensionHover = !1, this.clearDelayRunDimensionHoverTimer()), "enter" === params.action || "move" === params.action || preMark !== this.activeChartInstanceHoverOnMark) {
48596
48642
  const dimensionValue = dimensionInfo.value,
48597
48643
  indicatorsAsCol = table.options.indicatorsAsCol;
48598
- if (delayRunDimensionHover ? (clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = setTimeout(() => {
48599
- indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1);
48644
+ if (delayRunDimensionHover ? (this.clearDelayRunDimensionHoverTimer(), this.delayRunDimensionHoverTimer = setTimeout(() => {
48645
+ isDisabledShowTooltipToAllChartInstances() || (indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1));
48600
48646
  }, 100)) : indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1), indicatorsAsCol) {
48601
48647
  const series = dimensionInfo.data[0].series,
48602
48648
  width = "histogram" === this.attribute.spec.type || "line" === series.type || "area" === series.type ? 0 : series.getYAxisHelper().getBandwidth(0);
@@ -48637,21 +48683,26 @@
48637
48683
  }
48638
48684
  }
48639
48685
  }
48640
- }), null === (_e = (_d = table)._bindChartEvent) || void 0 === _e || _e.call(_d, this.activeChartInstance);
48686
+ })), null === (_j = (_h = table)._bindChartEvent) || void 0 === _j || _j.call(_h, this.activeChartInstance), isDisabledShowTooltipToAllChartInstances() && this.activeChartInstance.disableTooltip(!0);
48687
+ }
48688
+ clearDelayRunDimensionHoverTimer() {
48689
+ clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = void 0;
48641
48690
  }
48642
48691
  deactivate(table, {
48692
+ forceRelease = !1,
48643
48693
  releaseChartInstance = !0,
48644
48694
  releaseColumnChartInstance = !0,
48645
- releaseRowChartInstance = !0
48695
+ releaseRowChartInstance = !0,
48696
+ releaseAllChartInstance = !1
48646
48697
  } = {}) {
48647
48698
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
48648
- if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = void 0, releaseChartInstance) {
48649
- null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
48699
+ if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), this.clearDelayRunDimensionHoverTimer(), releaseChartInstance) {
48700
+ !forceRelease && getBrushingChartInstance() && getBrushingChartInstance() === this.activeChartInstance || (null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
48650
48701
  x1: -1e3,
48651
48702
  x2: -800,
48652
48703
  y1: -1e3,
48653
48704
  y2: -800
48654
- }, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null;
48705
+ }, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null);
48655
48706
  const {
48656
48707
  col: col,
48657
48708
  row: row
@@ -48664,7 +48715,7 @@
48664
48715
  } = this.parent;
48665
48716
  releaseColumnChartInstance && table.internalProps.layoutMap.isAxisCell(col, table.rowCount - table.bottomFrozenRowCount) && (null === (_h = null === (_g = table.scenegraph.getCell(col, table.rowCount - table.bottomFrozenRowCount).firstChild) || void 0 === _g ? void 0 : _g.hideLabelHoverOnAxis) || void 0 === _h || _h.call(_g)), releaseRowChartInstance && table.internalProps.layoutMap.isAxisCell(table.rowHeaderLevelCount - 1, row) && (null === (_k = null === (_j = table.scenegraph.getCell(table.rowHeaderLevelCount - 1, row).firstChild) || void 0 === _j ? void 0 : _j.hideLabelHoverOnAxis) || void 0 === _k || _k.call(_j));
48666
48717
  }
48667
- releaseColumnChartInstance && clearChartInstanceListByColumnDirection(this.parent.col, "scatter" === this.attribute.spec.type ? this.parent.row : void 0, table), releaseRowChartInstance && clearChartInstanceListByRowDirection(this.parent.row, "scatter" === this.attribute.spec.type ? this.parent.col : void 0, table);
48718
+ releaseAllChartInstance ? clearAllChartInstanceList(table, forceRelease) : (releaseColumnChartInstance && clearChartInstanceListByColumnDirection(this.parent.col, "scatter" === this.attribute.spec.type ? this.parent.row : void 0, table, forceRelease), releaseRowChartInstance && clearChartInstanceListByRowDirection(this.parent.row, "scatter" === this.attribute.spec.type ? this.parent.col : void 0, table, forceRelease));
48668
48719
  }
48669
48720
  updateData(data) {
48670
48721
  this.attribute.data = data;
@@ -48679,13 +48730,14 @@
48679
48730
  y1: y1,
48680
48731
  x2: x2,
48681
48732
  y2: y2
48682
- } = cellGroup.globalAABBBounds;
48683
- return {
48684
- x1: Math.ceil(x1 + padding[3] + table.scrollLeft + (null !== (_b = null === (_a = table.options.viewBox) || void 0 === _a ? void 0 : _a.x1) && void 0 !== _b ? _b : 0)),
48685
- x2: Math.ceil(x1 + cellGroup.attribute.width - padding[1] + table.scrollLeft + (null !== (_d = null === (_c = table.options.viewBox) || void 0 === _c ? void 0 : _c.x1) && void 0 !== _d ? _d : 0)),
48686
- y1: Math.ceil(y1 + padding[0] + table.scrollTop + (null !== (_f = null === (_e = table.options.viewBox) || void 0 === _e ? void 0 : _e.y1) && void 0 !== _f ? _f : 0)),
48687
- y2: Math.ceil(y1 + cellGroup.attribute.height - padding[2] + table.scrollTop + (null !== (_h = null === (_g = table.options.viewBox) || void 0 === _g ? void 0 : _g.y1) && void 0 !== _h ? _h : 0))
48688
- };
48733
+ } = cellGroup.globalAABBBounds,
48734
+ viewBox = {
48735
+ x1: Math.ceil(x1 + padding[3] + table.scrollLeft + (null !== (_b = null === (_a = table.options.viewBox) || void 0 === _a ? void 0 : _a.x1) && void 0 !== _b ? _b : 0)),
48736
+ x2: Math.ceil(x1 + cellGroup.attribute.width - padding[1] + table.scrollLeft + (null !== (_d = null === (_c = table.options.viewBox) || void 0 === _c ? void 0 : _c.x1) && void 0 !== _d ? _d : 0)),
48737
+ y1: Math.ceil(y1 + padding[0] + table.scrollTop + (null !== (_f = null === (_e = table.options.viewBox) || void 0 === _e ? void 0 : _e.y1) && void 0 !== _f ? _f : 0)),
48738
+ y2: Math.ceil(y1 + cellGroup.attribute.height - padding[2] + table.scrollTop + (null !== (_h = null === (_g = table.options.viewBox) || void 0 === _g ? void 0 : _g.y1) && void 0 !== _h ? _h : 0))
48739
+ };
48740
+ return this.activeChartInstance ? this.activeChartInstanceLastViewBox = viewBox : this.activeChartInstanceLastViewBox = null, viewBox;
48689
48741
  }
48690
48742
  }
48691
48743
  function getTableBounds(col, row, table) {
@@ -48900,7 +48952,7 @@
48900
48952
  {
48901
48953
  width = groupAttribute.width,
48902
48954
  height = groupAttribute.height
48903
- } = (chart.getViewBox(), chart.attribute),
48955
+ } = chart.attribute,
48904
48956
  {
48905
48957
  table: table
48906
48958
  } = chart.getRootNode(),
@@ -48928,8 +48980,9 @@
48928
48980
  });
48929
48981
  }
48930
48982
  }
48931
- const viewBox = chart.getViewBox();
48932
- activeChartInstance.updateViewBox({
48983
+ const lastViewBox = chart.activeChartInstanceLastViewBox,
48984
+ viewBox = chart.getViewBox();
48985
+ lastViewBox && viewBox.x1 === lastViewBox.x1 && viewBox.x2 === lastViewBox.x2 && viewBox.y1 === lastViewBox.y1 && viewBox.y2 === lastViewBox.y2 || activeChartInstance.updateViewBox({
48933
48986
  x1: 0,
48934
48987
  x2: viewBox.x2 - viewBox.x1,
48935
48988
  y1: 0,
@@ -52447,9 +52500,10 @@
52447
52500
  });
52448
52501
  }
52449
52502
  }
52450
- function updateChartState(scenegraph, datum) {
52503
+ function updateChartState(scenegraph, datum, selectedDataMode) {
52451
52504
  const table = scenegraph.table;
52452
52505
  if (table.isPivotChart()) {
52506
+ table._selectedDataMode = selectedDataMode;
52453
52507
  const preSelectItemsCount = table._selectedDataItemsInChart.length;
52454
52508
  if ((null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) && 0 === preSelectItemsCount) return;
52455
52509
  const newSelectedDataItemsInChart = [];
@@ -53197,16 +53251,39 @@
53197
53251
  resetResidentHoverIcon(col, row) {
53198
53252
  resetResidentHoverIcon(col, row, this);
53199
53253
  }
53200
- deactivateChart(col, row) {
53201
- var _a, _b, _c;
53202
- if (-1 === col || -1 === row) return;
53254
+ deactivateChart(col, row, forceRelease = !1) {
53255
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
53256
+ if (-1 === col || -1 === row) {
53257
+ if (forceRelease) {
53258
+ const brushingChartInstanceCellPos = getBrushingChartInstanceCellPos(),
53259
+ brushingChartInstance = getBrushingChartInstance();
53260
+ if (brushingChartInstanceCellPos && brushingChartInstance) {
53261
+ const cellGroup = this.getCell(brushingChartInstanceCellPos.col, brushingChartInstanceCellPos.row);
53262
+ (null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.deactivate) && (clearBrushingChartInstance(), null === (_c = null === (_b = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _b ? void 0 : _b.deactivate) || void 0 === _c || _c.call(_b, this.table, {
53263
+ forceRelease: !0,
53264
+ releaseChartInstance: !0,
53265
+ releaseColumnChartInstance: !0,
53266
+ releaseRowChartInstance: !0,
53267
+ releaseAllChartInstance: !0
53268
+ }));
53269
+ }
53270
+ }
53271
+ return;
53272
+ }
53203
53273
  const cellGroup = this.getCell(col, row);
53204
- if (null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.deactivate) {
53274
+ if (null === (_d = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _d ? void 0 : _d.deactivate) {
53275
+ if (forceRelease) return clearBrushingChartInstance(), void (null === (_f = null === (_e = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _e ? void 0 : _e.deactivate) || void 0 === _f || _f.call(_e, this.table, {
53276
+ forceRelease: !0,
53277
+ releaseChartInstance: !0,
53278
+ releaseColumnChartInstance: !0,
53279
+ releaseRowChartInstance: !0,
53280
+ releaseAllChartInstance: !0
53281
+ }));
53205
53282
  const chartType = (null == cellGroup ? void 0 : cellGroup.firstChild).attribute.spec.type;
53206
- null === (_c = null === (_b = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _b ? void 0 : _b.deactivate) || void 0 === _c || _c.call(_b, this.table, this.table.options.chartDimensionLinkage ? {
53207
- releaseChartInstance: "scatter" === chartType ? col !== this.table.stateManager.hover.cellPos.col && row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount : this.table.options.indicatorsAsCol ? row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount : col !== this.table.stateManager.hover.cellPos.col || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount,
53208
- releaseColumnChartInstance: col !== this.table.stateManager.hover.cellPos.col || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount,
53209
- releaseRowChartInstance: row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount
53283
+ null === (_h = null === (_g = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _g ? void 0 : _g.deactivate) || void 0 === _h || _h.call(_g, this.table, (null === (_j = this.table.options.chartDimensionLinkage) || void 0 === _j ? void 0 : _j.showTooltip) ? {
53284
+ releaseChartInstance: "pie" !== chartType && ("scatter" === chartType ? col !== this.table.stateManager.hover.cellPos.col && row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount : this.table.options.indicatorsAsCol ? row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount : col !== this.table.stateManager.hover.cellPos.col || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount),
53285
+ releaseColumnChartInstance: "pie" !== chartType && (col !== this.table.stateManager.hover.cellPos.col || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount),
53286
+ releaseRowChartInstance: "pie" !== chartType && (row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount)
53210
53287
  } : void 0);
53211
53288
  }
53212
53289
  }
@@ -53254,8 +53331,15 @@
53254
53331
  updateChartSizeForResizeRowHeight(row) {
53255
53332
  updateChartSizeForResizeRowHeight(this, row);
53256
53333
  }
53257
- updateChartState(datum) {
53258
- this.table.isPivotChart() && updateChartState(this, datum);
53334
+ updateChartState(datum, selectedDataMode) {
53335
+ var _a, _b;
53336
+ if (this.table.isPivotChart()) {
53337
+ if (null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) {
53338
+ const brushingChartInstance = getBrushingChartInstance();
53339
+ brushingChartInstance && brushingChartInstance.getChart().getComponentsByKey("brush")[0].clearBrushStateAndMask(), null === (_b = null === (_a = this.table.options.chartDimensionLinkage) || void 0 === _a ? void 0 : _a.clearChartState) || void 0 === _b || _b.call(_a);
53340
+ }
53341
+ updateChartState(this, datum, selectedDataMode);
53342
+ }
53259
53343
  }
53260
53344
  updateCheckboxCellState(col, row, checked) {
53261
53345
  var _a, _b;
@@ -56282,7 +56366,7 @@
56282
56366
  }, 0 !== e.button) return;
56283
56367
  const eventArgsSet = getCellEventArgsSet(e);
56284
56368
  if (eventManager.downIcon = void 0, stateManager.interactionState !== InteractionState.default) return;
56285
- if (table.isPivotChart() && "chart" !== (null === (_a = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.target.type) && table.scenegraph.updateChartState(null), (null === (_b = eventArgsSet.eventArgs) || void 0 === _b ? void 0 : _b.target) !== (null === (_c = stateManager.residentHoverIcon) || void 0 === _c ? void 0 : _c.icon) && stateManager.hideMenu(), "chart" === (null === (_d = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _d ? void 0 : _d.target.type)) return;
56369
+ if (table.isPivotChart() && "chart" !== (null === (_a = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.target.type) && (table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0)), (null === (_b = eventArgsSet.eventArgs) || void 0 === _b ? void 0 : _b.target) !== (null === (_c = stateManager.residentHoverIcon) || void 0 === _c ? void 0 : _c.icon) && stateManager.hideMenu(), "chart" === (null === (_d = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _d ? void 0 : _d.target.type)) return;
56286
56370
  const isCompleteEdit = null === (_e = table.editorManager) || void 0 === _e ? void 0 : _e.completeEdit(e.nativeEvent);
56287
56371
  getPromiseValue(isCompleteEdit, isCompleteEdit => {
56288
56372
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
@@ -56310,7 +56394,7 @@
56310
56394
  }
56311
56395
  eventManager.dealTableHover(eventArgsSet);
56312
56396
  } else {
56313
- if (!eventManager.checkCellFillhandle(eventArgsSet) && (eventManager.checkColumnResize(eventArgsSet, !0) || eventManager.checkRowResize(eventArgsSet, !0))) return table.scenegraph.updateChartState(null), void stateManager.updateInteractionState(InteractionState.grabing);
56397
+ if (!eventManager.checkCellFillhandle(eventArgsSet) && (eventManager.checkColumnResize(eventArgsSet, !0) || eventManager.checkRowResize(eventArgsSet, !0))) return table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0), void stateManager.updateInteractionState(InteractionState.grabing);
56314
56398
  if (eventManager.checkColumnMover(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
56315
56399
  if (eventManager.checkCellFillhandle(eventArgsSet, !0) && eventManager.dealFillSelect(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
56316
56400
  eventManager.dealTableSelect(eventArgsSet) && stateManager.updateInteractionState(InteractionState.grabing);
@@ -56462,7 +56546,7 @@
56462
56546
  if (!(null === (_a = table.options.customConfig) || void 0 === _a ? void 0 : _a.selectCellWhenCellEditorNotExists) && !1 === isCompleteEdit) return;
56463
56547
  const hitIcon = (null === (_b = e.target.role) || void 0 === _b ? void 0 : _b.startsWith("icon")) ? e.target : void 0;
56464
56548
  if (eventManager.downIcon = hitIcon, "touch" === e.pointerType || hitIcon || eventManager.checkCellFillhandle(eventArgsSet) || stateManager.columnResize.resizing || !eventManager.checkColumnResize(eventArgsSet, !0)) ;else {
56465
- table.scenegraph.updateChartState(null), stateManager.updateInteractionState(InteractionState.grabing);
56549
+ table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0), stateManager.updateInteractionState(InteractionState.grabing);
56466
56550
  const {
56467
56551
  eventArgs: eventArgs
56468
56552
  } = eventArgsSet;
@@ -56481,7 +56565,7 @@
56481
56565
  if (table.eventManager.isDraging || !target || !target.isDescendantsOf(table.scenegraph.stage) && target.stage !== target || target.isDescendantsOf(table.scenegraph.tableGroup)) table.eventManager.isDraging && stateManager.isSelecting() && stateManager.endSelectCells();else {
56482
56566
  stateManager.updateInteractionState(InteractionState.default), eventManager.dealTableHover();
56483
56567
  const isHasSelected = !!(null === (_a = stateManager.select.ranges) || void 0 === _a ? void 0 : _a.length);
56484
- (null === (_b = table.options.customConfig) || void 0 === _b ? void 0 : _b.cancelSelectCellHook) ? (null === (_c = table.options.customConfig) || void 0 === _c ? void 0 : _c.cancelSelectCellHook(e)) && eventManager.dealTableSelect() : (null === (_e = null === (_d = table.options.select) || void 0 === _d ? void 0 : _d.blankAreaClickDeselect) || void 0 === _e || _e) && eventManager.dealTableSelect(), stateManager.endSelectCells(!0, isHasSelected), stateManager.updateCursor(), table.scenegraph.updateChartState(null);
56568
+ (null === (_b = table.options.customConfig) || void 0 === _b ? void 0 : _b.cancelSelectCellHook) ? (null === (_c = table.options.customConfig) || void 0 === _c ? void 0 : _c.cancelSelectCellHook(e)) && eventManager.dealTableSelect() : (null === (_e = null === (_d = table.options.select) || void 0 === _d ? void 0 : _d.blankAreaClickDeselect) || void 0 === _e || _e) && eventManager.dealTableSelect(), stateManager.endSelectCells(!0, isHasSelected), stateManager.updateCursor(), table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0);
56485
56569
  }
56486
56570
  }), table.scenegraph.stage.addEventListener("pointermove", e => {
56487
56571
  var _a, _b, _c;
@@ -56599,7 +56683,15 @@
56599
56683
  table.stateManager.setCheckedState(col, row, cellInfo.field, e.detail.checked), table.fireListeners(TABLE_EVENT_TYPE.SWITCH_STATE_CHANGE, cellsEvent), table.scenegraph.updateNextFrame();
56600
56684
  }), table.scenegraph.stage.addEventListener("wheel", e => {
56601
56685
  var _a;
56602
- e.path.find(node => "legend" === node.name) || (null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit(), table.eventManager._enableTableScroll && handleWhell(e, stateManager));
56686
+ if (!e.path.find(node => "legend" === node.name)) {
56687
+ null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit();
56688
+ const {
56689
+ cellPos: cellPos
56690
+ } = table.stateManager.hover,
56691
+ prevHoverCellCol = cellPos.col,
56692
+ prevHoverCellRow = cellPos.row;
56693
+ table.scenegraph.deactivateChart(prevHoverCellCol, prevHoverCellRow, !0), table.eventManager._enableTableScroll && handleWhell(e, stateManager);
56694
+ }
56603
56695
  });
56604
56696
  }
56605
56697
  function bindGesture(eventManager) {
@@ -56714,11 +56806,13 @@
56714
56806
  const throttleVerticalWheel = throttle(stateManager.updateVerticalScrollBar, 20),
56715
56807
  throttleHorizontalWheel = throttle(stateManager.updateHorizontalScrollBar, 20);
56716
56808
  scenegraph.component.vScrollBar.addEventListener("scrollDrag", e => {
56717
- scenegraph.table.eventManager.isDown && (scenegraph.table.eventManager.isDraging = !0), stateManager.fastScrolling = !0, stateManager.interactionState !== InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.scrolling);
56809
+ var _a;
56810
+ scenegraph.table.eventManager.isDown && (scenegraph.table.eventManager.isDraging = !0), stateManager.fastScrolling = !0, stateManager.interactionState !== InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.scrolling), scenegraph.table.stateManager.hideMenu(), null === (_a = scenegraph.table.editorManager) || void 0 === _a || _a.completeEdit(), table.scenegraph.deactivateChart(-1, -1, !0);
56718
56811
  const ratio = e.detail.value[0] / (1 - e.detail.value[1] + e.detail.value[0]);
56719
56812
  throttleVerticalWheel(ratio, e);
56720
56813
  }), scenegraph.component.hScrollBar.addEventListener("scrollDrag", e => {
56721
- scenegraph.table.eventManager.isDown && (scenegraph.table.eventManager.isDraging = !0), stateManager.fastScrolling = !0, stateManager.interactionState !== InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.scrolling);
56814
+ var _a;
56815
+ scenegraph.table.eventManager.isDown && (scenegraph.table.eventManager.isDraging = !0), stateManager.fastScrolling = !0, stateManager.interactionState !== InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.scrolling), scenegraph.table.stateManager.hideMenu(), null === (_a = scenegraph.table.editorManager) || void 0 === _a || _a.completeEdit(), table.scenegraph.deactivateChart(-1, -1, !0);
56722
56816
  const ratio = e.detail.value[0] / (1 - e.detail.value[1] + e.detail.value[0]);
56723
56817
  throttleHorizontalWheel(ratio);
56724
56818
  });
@@ -56868,7 +56962,7 @@
56868
56962
  const isHasSelected = !!(null === (_b = stateManager.select.ranges) || void 0 === _b ? void 0 : _b.length);
56869
56963
  eventManager.dealTableSelect(), stateManager.endSelectCells(!0, isHasSelected);
56870
56964
  }
56871
- });
56965
+ }), table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0);
56872
56966
  }
56873
56967
  };
56874
56968
  eventManager.globalEventListeners.push({
@@ -57379,7 +57473,7 @@
57379
57473
  };
57380
57474
  let EventManager$1 = class EventManager {
57381
57475
  constructor(table) {
57382
- this.isDown = !1, this.isDraging = !1, this.globalEventListeners = [], this._enableTableScroll = !0, this.cutWaitPaste = !1, this.clipboardCheckTimer = null, this.cutOperationTime = 0, this.lastClipboardContent = "", this.cutCellRange = null, this.cutRanges = null, this.copySourceRange = null, this.table = table, this.handleTextStickBindId = [], this.inertiaScroll = new InertiaScroll(table.stateManager), "node" === Env.mode || table.options.disableInteraction || (this.bindOuterEvent(), setTimeout(() => {
57476
+ this.isDown = !1, this.isDraging = !1, this.globalEventListeners = [], this._enableTableScroll = !0, this.cutWaitPaste = !1, this.clipboardCheckTimer = null, this.cutOperationTime = 0, this.lastClipboardContent = "", this.cutCellRange = null, this.copySourceRange = null, this.table = table, this.handleTextStickBindId = [], this.inertiaScroll = new InertiaScroll(table.stateManager), "node" === Env.mode || table.options.disableInteraction || (this.bindOuterEvent(), setTimeout(() => {
57383
57477
  this.bindSelfEvent();
57384
57478
  }, 0));
57385
57479
  }
@@ -57681,25 +57775,15 @@
57681
57775
  } catch (error) {}
57682
57776
  }
57683
57777
  handleCut(e) {
57684
- var _a;
57685
57778
  return __awaiter$1(this, void 0, void 0, function* () {
57686
- this.handleCopy(e, !0), this.cutWaitPaste = !0, this.cutCellRange = this.table.getSelectedCellInfos(), this.cutRanges = null === (_a = this.table.stateManager.select.ranges) || void 0 === _a ? void 0 : _a.map(r => ({
57687
- start: {
57688
- col: r.start.col,
57689
- row: r.start.row
57690
- },
57691
- end: {
57692
- col: r.end.col,
57693
- row: r.end.row
57694
- }
57695
- })), this.clipboardCheckTimer && clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = window.setTimeout(() => {
57696
- this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.cutRanges = null, this.clipboardCheckTimer = null);
57779
+ this.handleCopy(e, !0), this.cutWaitPaste = !0, this.cutCellRange = this.table.getSelectedCellInfos(), this.clipboardCheckTimer && clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = window.setTimeout(() => {
57780
+ this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer = null);
57697
57781
  }, 3e4), this.saveClipboardContent();
57698
57782
  });
57699
57783
  }
57700
57784
  handlePaste(e) {
57701
57785
  this.cutWaitPaste ? this.checkClipboardChanged().then(changed => {
57702
- this.executePaste(e), changed || this.clearCutArea(this.table), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.cutRanges = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
57786
+ this.executePaste(e), changed || this.clearCutArea(this.table), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
57703
57787
  }).catch(() => {
57704
57788
  this.executePaste(e), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
57705
57789
  }) : this.executePaste(e);
@@ -57776,9 +57860,9 @@
57776
57860
  }
57777
57861
  clearCutArea(table) {
57778
57862
  try {
57779
- const ranges = this.cutRanges;
57780
- if (!ranges || 0 === ranges.length) return;
57781
- table.changeCellValuesByIds(ranges, "");
57863
+ const selectCells = this.cutCellRange;
57864
+ if (!selectCells || 0 === selectCells.length) return;
57865
+ for (let i = 0; i < selectCells.length; i++) for (let j = 0; j < selectCells[i].length; j++) selectCells[i][j] && table.changeCellValue(selectCells[i][j].col, selectCells[i][j].row, void 0);
57782
57866
  } catch (error) {}
57783
57867
  }
57784
57868
  checkClipboardChanged() {
@@ -59716,15 +59800,6 @@
59716
59800
  constructor(table, customCellStyle, customCellStyleArrangement) {
59717
59801
  this.table = table, this.customCellStyle = customCellStyle, this.customCellStyleArrangement = customCellStyleArrangement;
59718
59802
  }
59719
- clearCustomCellStyleArrangement() {
59720
- this.customCellStyleArrangement = [];
59721
- }
59722
- addCustomCellStyleArrangement(cellPosition, customStyleId) {
59723
- this.customCellStyleArrangement.push({
59724
- cellPosition: cellPosition,
59725
- customStyleId: customStyleId
59726
- });
59727
- }
59728
59803
  getCustomCellStyle(col, row) {
59729
59804
  const customStyleIds = this.getCustomCellStyleIds(col, row);
59730
59805
  if (customStyleIds.length) {
@@ -60030,7 +60105,7 @@
60030
60105
  }
60031
60106
  constructor(container, options = {}) {
60032
60107
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
60033
- if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.7", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
60108
+ if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.8", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
60034
60109
  this.pluginManager = new PluginManager$1(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
60035
60110
  options: options,
60036
60111
  container: container
@@ -63841,16 +63916,15 @@
63841
63916
  step((generator = generator.apply(thisArg, _arguments || [])).next());
63842
63917
  });
63843
63918
  };
63844
- function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
63919
+ function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table) {
63845
63920
  if (workOnEditableCell && table.isHasEditorDefine(col, row) || !1 === workOnEditableCell) {
63846
- const recordShowIndex = table.getRecordShowIndexByCell(col, row),
63847
- recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
63921
+ const recordIndex = table.getRecordShowIndexByCell(col, row),
63848
63922
  {
63849
63923
  field: field
63850
63924
  } = table.internalProps.layoutMap.getBody(col, row),
63851
63925
  beforeChangeValue = table.getCellRawValue(col, row),
63852
63926
  oldValue = table.getCellOriginValue(col, row);
63853
- table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value, recordShowIndex, field, col, row, table);
63927
+ table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value, recordIndex, field, col, row, table);
63854
63928
  const range = table.getCellRange(col, row),
63855
63929
  aggregators = table.internalProps.layoutMap.getAggregatorsByCell(col, row);
63856
63930
  if (aggregators) {
@@ -63873,24 +63947,16 @@
63873
63947
  table.scenegraph.updateRowHeight(row, newHeight - oldHeight);
63874
63948
  }
63875
63949
  const changedValue = table.getCellOriginValue(col, row);
63876
- if (oldValue !== changedValue && triggerEvent) {
63877
- const changeValue = {
63878
- col: col,
63879
- row: row,
63880
- recordIndex: recordIndex,
63881
- field: field,
63882
- rawValue: beforeChangeValue,
63883
- currentValue: oldValue,
63884
- changedValue: changedValue
63885
- };
63886
- table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
63887
- values: [changeValue]
63888
- });
63889
- }
63890
- table.scenegraph.updateNextFrame();
63950
+ oldValue !== changedValue && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
63951
+ col: col,
63952
+ row: row,
63953
+ rawValue: beforeChangeValue,
63954
+ currentValue: oldValue,
63955
+ changedValue: changedValue
63956
+ }), table.scenegraph.updateNextFrame();
63891
63957
  }
63892
63958
  }
63893
- function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
63959
+ function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table) {
63894
63960
  var _a, _b;
63895
63961
  return __awaiter(this, void 0, void 0, function* () {
63896
63962
  const changedCellResults = [];
@@ -63912,7 +63978,6 @@
63912
63978
  oldRowValues.push(oldValue);
63913
63979
  }
63914
63980
  }
63915
- const resultChangeValues = [];
63916
63981
  for (let i = 0; i < values.length && !(startRow + i > table.rowCount - 1); i++) {
63917
63982
  changedCellResults[i] = [], pasteRowEnd = startRow + i;
63918
63983
  const rowValues = values[i];
@@ -63936,34 +64001,25 @@
63936
64001
  if (isCanChange) {
63937
64002
  changedCellResults[i][j] = !0;
63938
64003
  const value = rowValues[j],
63939
- recordShowIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i),
63940
- recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
64004
+ recordIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i),
63941
64005
  {
63942
64006
  field: field
63943
64007
  } = table.internalProps.layoutMap.getBody(startCol + j, startRow + i),
63944
64008
  beforeChangeValue = beforeChangeValues[i][j],
63945
64009
  oldValue = oldValues[i][j];
63946
- table.isHeader(startCol + j, startRow + i) ? table.internalProps.layoutMap.updateColumnTitle(startCol + j, startRow + i, value) : table.dataSource.changeFieldValue(value, recordShowIndex, field, startCol + j, startRow + i, table);
64010
+ table.isHeader(startCol + j, startRow + i) ? table.internalProps.layoutMap.updateColumnTitle(startCol + j, startRow + i, value) : table.dataSource.changeFieldValue(value, recordIndex, field, startCol + j, startRow + i, table);
63947
64011
  const changedValue = table.getCellOriginValue(startCol + j, startRow + i);
63948
- if (oldValue !== changedValue && triggerEvent) {
63949
- const changeValue = {
63950
- col: startCol + j,
63951
- row: startRow + i,
63952
- recordIndex: recordIndex,
63953
- field: field,
63954
- rawValue: beforeChangeValue,
63955
- currentValue: oldValue,
63956
- changedValue: changedValue
63957
- };
63958
- table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
63959
- }
64012
+ oldValue !== changedValue && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
64013
+ col: startCol + j,
64014
+ row: startRow + i,
64015
+ rawValue: beforeChangeValue,
64016
+ currentValue: oldValue,
64017
+ changedValue: changedValue
64018
+ });
63960
64019
  } else changedCellResults[i][j] = !1;
63961
64020
  }
63962
64021
  pasteColEnd = Math.max(pasteColEnd, thisRowPasteColEnd);
63963
64022
  }
63964
- silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
63965
- values: resultChangeValues
63966
- });
63967
64023
  const startRange = table.getCellRange(startCol, startRow),
63968
64024
  range = table.getCellRange(pasteColEnd, pasteRowEnd),
63969
64025
  aggregators = table.internalProps.layoutMap.getAggregatorsByCellRange(startRange.start.col, startRange.start.row, range.end.col, range.end.row);
@@ -63997,58 +64053,6 @@
63997
64053
  return table.scenegraph.updateNextFrame(), changedCellResults;
63998
64054
  });
63999
64055
  }
64000
- function listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
64001
- var _a, _b;
64002
- return __awaiter(this, void 0, void 0, function* () {
64003
- const resultChangeValues = [],
64004
- processed = new Set(),
64005
- nextValue = null != value ? value : "";
64006
- for (let i = 0; i < (null !== (_a = null == ranges ? void 0 : ranges.length) && void 0 !== _a ? _a : 0); i++) {
64007
- const range = ranges[i],
64008
- startCol = Math.min(range.start.col, range.end.col),
64009
- endCol = Math.max(range.start.col, range.end.col),
64010
- startRow = Math.min(range.start.row, range.end.row),
64011
- endRow = Math.max(range.start.row, range.end.row);
64012
- if (startCol > endCol || startRow > endRow) continue;
64013
- const values = [],
64014
- oldValues = [];
64015
- for (let row = startRow; row <= endRow; row++) {
64016
- const rowValues = [],
64017
- rowOldValues = [];
64018
- for (let col = startCol; col <= endCol; col++) rowValues.push(nextValue), rowOldValues.push(table.getCellOriginValue(col, row));
64019
- values.push(rowValues), oldValues.push(rowOldValues);
64020
- }
64021
- const changedCellResults = yield listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, !0);
64022
- for (let r = 0; r < values.length; r++) for (let c = 0; c < values[r].length; c++) {
64023
- const col = startCol + c,
64024
- row = startRow + r,
64025
- key = `${col},${row}`;
64026
- if (processed.has(key)) continue;
64027
- if (processed.add(key), !triggerEvent || !(null === (_b = null == changedCellResults ? void 0 : changedCellResults[r]) || void 0 === _b ? void 0 : _b[c])) continue;
64028
- const oldValue = oldValues[r][c],
64029
- changedValue = table.getCellOriginValue(col, row);
64030
- if (oldValue === changedValue) continue;
64031
- const recordShowIndex = table.getRecordShowIndexByCell(col, row),
64032
- recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
64033
- {
64034
- field: field
64035
- } = table.internalProps.layoutMap.getBody(col, row);
64036
- resultChangeValues.push({
64037
- col: col,
64038
- row: row,
64039
- recordIndex: recordIndex,
64040
- field: field,
64041
- rawValue: oldValue,
64042
- currentValue: oldValue,
64043
- changedValue: changedValue
64044
- });
64045
- }
64046
- }
64047
- !silentChangeCellValuesEvent && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
64048
- values: resultChangeValues
64049
- });
64050
- });
64051
- }
64052
64056
  function getCellUpdateType(col, row, table, oldCellUpdateType) {
64053
64057
  if ("group" === oldCellUpdateType) return oldCellUpdateType;
64054
64058
  if ("sort" === oldCellUpdateType && !table.internalProps.groupBy) return oldCellUpdateType;
@@ -64066,16 +64070,13 @@
64066
64070
  }), table.dataSource.sort(sortState));
64067
64071
  }
64068
64072
  function listTableAddRecord(record, recordIndex, table) {
64069
- var _a, _b, _c, _d, _e, _f;
64073
+ var _a, _b, _c, _d;
64070
64074
  try {
64071
64075
  if (!record) return !1;
64072
- if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).addRecordsForGroup) || void 0 === _b || _b.call(_a, [record], recordIndex), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).addRecordsForTree) || void 0 === _d || _d.call(_c, [record], recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState) {
64073
- !!(null === (_e = table.options) || void 0 === _e ? void 0 : _e.syncRecordOperationsToSourceRecords) ? table.dataSource.addRecord(record, table.dataSource.records.length, !0) : table.dataSource.addRecordForSorted(record), table.stateManager.checkedState.clear(), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();
64074
- } else {
64076
+ if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).addRecordsForGroup) || void 0 === _b || _b.call(_a, [record], recordIndex), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).addRecordsForTree) || void 0 === _d || _d.call(_c, [record], recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState) table.dataSource.addRecordForSorted(record), table.stateManager.checkedState.clear(), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
64075
64077
  (void 0 === recordIndex || recordIndex > table.dataSource.sourceLength) && (recordIndex = table.dataSource.sourceLength);
64076
- const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount,
64077
- syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords);
64078
- if (table.dataSource.addRecord(record, recordIndex, syncToOriginalRecords), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1), syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
64078
+ const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
64079
+ table.dataSource.addRecord(record, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1);
64079
64080
  const oldRowCount = table.rowCount;
64080
64081
  if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
64081
64082
  const newRowCount = table.transpose ? table.colCount : table.rowCount;
@@ -64144,16 +64145,13 @@
64144
64145
  }
64145
64146
  }
64146
64147
  function listTableAddRecords(records, recordIndex, table) {
64147
- var _a, _b, _c, _d, _e, _f;
64148
+ var _a, _b, _c, _d;
64148
64149
  try {
64149
64150
  if (!records || 0 === records.length) return !1;
64150
- if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).addRecordsForGroup) || void 0 === _b || _b.call(_a, records, recordIndex), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).addRecordsForTree) || void 0 === _d || _d.call(_c, records, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState) {
64151
- !!(null === (_e = table.options) || void 0 === _e ? void 0 : _e.syncRecordOperationsToSourceRecords) ? table.dataSource.addRecords(records, table.dataSource.records.length, !0) : table.dataSource.addRecordsForSorted(records), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();
64152
- } else {
64151
+ if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).addRecordsForGroup) || void 0 === _b || _b.call(_a, records, recordIndex), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).addRecordsForTree) || void 0 === _d || _d.call(_c, records, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState) table.dataSource.addRecordsForSorted(records), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
64153
64152
  void 0 === recordIndex || recordIndex > table.dataSource.sourceLength ? recordIndex = table.dataSource.sourceLength : recordIndex < 0 && (recordIndex = 0);
64154
- const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount,
64155
- syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords);
64156
- if (table.dataSource.addRecords(records, recordIndex, syncToOriginalRecords), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length), syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
64153
+ const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
64154
+ table.dataSource.addRecords(records, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length);
64157
64155
  const oldRowCount = table.transpose ? table.colCount : table.rowCount;
64158
64156
  if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
64159
64157
  const newRowCount = table.transpose ? table.colCount : table.rowCount;
@@ -64222,20 +64220,16 @@
64222
64220
  }
64223
64221
  }
64224
64222
  function listTableDeleteRecords(recordIndexs, table) {
64225
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
64223
+ var _a, _b, _c, _d, _e, _f, _g, _h;
64226
64224
  if ((null == recordIndexs ? void 0 : recordIndexs.length) > 0) if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).deleteRecordsForGroup) || void 0 === _b || _b.call(_a, recordIndexs), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) {
64227
64225
  const deletedRecordIndexs = null === (_d = (_c = table.dataSource).deleteRecordsForTree) || void 0 === _d ? void 0 : _d.call(_c, recordIndexs);
64228
64226
  if (0 === deletedRecordIndexs.length) return;
64229
64227
  for (let index = 0; index < deletedRecordIndexs.length; index++) adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);
64230
64228
  table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();
64231
- } else if (table.sortState) {
64232
- !!(null === (_e = table.options) || void 0 === _e ? void 0 : _e.syncRecordOperationsToSourceRecords) ? table.dataSource.deleteRecords(recordIndexs, !0) : table.dataSource.deleteRecordsForSorted(recordIndexs), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();
64233
- } else {
64234
- const syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords),
64235
- deletedRecordIndexs = table.dataSource.deleteRecords(recordIndexs, syncToOriginalRecords);
64229
+ } else if (table.sortState) table.dataSource.deleteRecordsForSorted(recordIndexs), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
64230
+ const deletedRecordIndexs = table.dataSource.deleteRecords(recordIndexs);
64236
64231
  if (0 === deletedRecordIndexs.length) return;
64237
64232
  for (let index = 0; index < deletedRecordIndexs.length; index++) adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);
64238
- if (syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), void table.scenegraph.createSceneGraph();
64239
64233
  const oldRowCount = table.transpose ? table.colCount : table.rowCount;
64240
64234
  table.refreshRowColCount();
64241
64235
  const newRowCount = table.transpose ? table.colCount : table.rowCount,
@@ -64273,7 +64267,7 @@
64273
64267
  col: 0,
64274
64268
  row: row
64275
64269
  });
64276
- null === (_g = table.reactCustomLayout) || void 0 === _g || _g.clearCache(), table.transpose ? table.scenegraph.updateCol(delRows, [], updateRows) : table.scenegraph.updateRow(delRows, [], updateRows), null === (_h = table.reactCustomLayout) || void 0 === _h || _h.updateAllCustomCell();
64270
+ null === (_e = table.reactCustomLayout) || void 0 === _e || _e.clearCache(), table.transpose ? table.scenegraph.updateCol(delRows, [], updateRows) : table.scenegraph.updateRow(delRows, [], updateRows), null === (_f = table.reactCustomLayout) || void 0 === _f || _f.updateAllCustomCell();
64277
64271
  }
64278
64272
  } else {
64279
64273
  const delRows = [],
@@ -64305,19 +64299,15 @@
64305
64299
  col: 0,
64306
64300
  row: row
64307
64301
  });
64308
- null === (_j = table.reactCustomLayout) || void 0 === _j || _j.clearCache(), table.transpose ? table.scenegraph.updateCol(delRows, [], updateRows) : table.scenegraph.updateRow(delRows, [], updateRows), null === (_k = table.reactCustomLayout) || void 0 === _k || _k.updateAllCustomCell();
64302
+ null === (_g = table.reactCustomLayout) || void 0 === _g || _g.clearCache(), table.transpose ? table.scenegraph.updateCol(delRows, [], updateRows) : table.scenegraph.updateRow(delRows, [], updateRows), null === (_h = table.reactCustomLayout) || void 0 === _h || _h.updateAllCustomCell();
64309
64303
  }
64310
64304
  }
64311
64305
  }
64312
64306
  function listTableUpdateRecords(records, recordIndexs, table) {
64313
- var _a, _b, _c, _d, _e, _f;
64314
- if ((null == recordIndexs ? void 0 : recordIndexs.length) > 0) if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).updateRecordsForGroup) || void 0 === _b || _b.call(_a, records, recordIndexs), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).updateRecordsForTree) || void 0 === _d || _d.call(_c, records, recordIndexs), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState) {
64315
- !!(null === (_e = table.options) || void 0 === _e ? void 0 : _e.syncRecordOperationsToSourceRecords) ? table.dataSource.updateRecords(records, recordIndexs, !0) : table.dataSource.updateRecordsForSorted(records, recordIndexs), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();
64316
- } else {
64317
- const syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords),
64318
- updateRecordIndexs = table.dataSource.updateRecords(records, recordIndexs, syncToOriginalRecords);
64307
+ var _a, _b, _c, _d;
64308
+ if ((null == recordIndexs ? void 0 : recordIndexs.length) > 0) if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).updateRecordsForGroup) || void 0 === _b || _b.call(_a, records, recordIndexs), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).updateRecordsForTree) || void 0 === _d || _d.call(_c, records, recordIndexs), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState) table.dataSource.updateRecordsForSorted(records, recordIndexs), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
64309
+ const updateRecordIndexs = table.dataSource.updateRecords(records, recordIndexs);
64319
64310
  if (0 === updateRecordIndexs.length) return;
64320
- if (syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), void table.scenegraph.createSceneGraph();
64321
64311
  const recordIndexsMinToMax = updateRecordIndexs.map(index => table.getBodyRowIndexByRecordIndex(index)).sort((a, b) => a - b);
64322
64312
  if (table.pagination) {
64323
64313
  const {
@@ -65226,165 +65216,43 @@
65226
65216
  }
65227
65217
  return isValid$1(editorDefine);
65228
65218
  }
65229
- changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
65230
- return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
65231
- }
65232
- changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
65233
- return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
65234
- }
65235
- changeCellValuesByIds(ranges, value, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
65236
- return listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
65237
- }
65238
- changeSourceCellValue(recordIndex, field, value) {
65239
- const tableIndex = this.getTableIndexByRecordIndex(recordIndex),
65240
- cellAddr = this.getCellAddrByFieldRecord(field, recordIndex);
65241
- if (tableIndex < 0 || cellAddr.col < 0 || cellAddr.row < 0) return;
65242
- this.dataSource.changeFieldValue(value, tableIndex, field, cellAddr.col, cellAddr.row, this);
65243
- const beforeChangeValue = this.getCellRawValue(cellAddr.col, cellAddr.row),
65244
- oldValue = this.getCellOriginValue(cellAddr.col, cellAddr.row),
65245
- changedValue = this.getCellOriginValue(cellAddr.col, cellAddr.row);
65246
- if (oldValue !== changedValue) {
65247
- const changeValue = {
65248
- col: cellAddr.col,
65249
- row: cellAddr.row,
65250
- recordIndex: recordIndex,
65251
- field: field,
65252
- rawValue: beforeChangeValue,
65253
- currentValue: oldValue,
65254
- changedValue: changedValue
65255
- };
65256
- this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
65257
- values: [changeValue]
65258
- });
65259
- }
65260
- }
65261
- changeCellValueByRecord(recordIndex, field, value, options) {
65262
- var _a, _b, _c, _d, _e;
65263
- const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
65264
- silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
65265
- autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
65266
- records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
65267
- let record, oldValue;
65268
- if (!Array.isArray(records) || "string" != typeof field && "number" != typeof field || (record = Array.isArray(recordIndex) ? getValueFromDeepArray(records, recordIndex) : records[recordIndex], oldValue = null == record ? void 0 : record[field]), this.dataSource.changeFieldValueByRecordIndex(value, recordIndex, field, this), !triggerEvent) return;
65269
- const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
65270
- if (oldValue !== changedValue) {
65271
- const cellAddr = this.getCellAddrByFieldRecord(field, recordIndex),
65272
- changeValue = {
65273
- col: null !== (_d = null == cellAddr ? void 0 : cellAddr.col) && void 0 !== _d ? _d : -1,
65274
- row: null !== (_e = null == cellAddr ? void 0 : cellAddr.row) && void 0 !== _e ? _e : -1,
65275
- recordIndex: recordIndex,
65276
- field: field,
65277
- rawValue: oldValue,
65278
- currentValue: oldValue,
65279
- changedValue: changedValue
65280
- };
65281
- this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
65282
- values: [changeValue]
65283
- });
65284
- }
65285
- autoRefresh && this.refreshAfterSourceChange();
65286
- }
65287
- changeCellValueBySource(recordIndex, field, value, triggerEvent = !0, silentChangeCellValuesEvent) {
65288
- return this.changeCellValueByRecord(recordIndex, field, value, {
65289
- triggerEvent: triggerEvent,
65290
- silentChangeCellValuesEvent: silentChangeCellValuesEvent,
65291
- autoRefresh: !0
65292
- });
65293
- }
65294
- changeCellValuesByRecords(changeValues, options) {
65295
- var _a, _b, _c, _d, _e, _f, _g;
65296
- const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
65297
- silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
65298
- autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
65299
- resultChangeValues = [];
65300
- for (let i = 0; i < changeValues.length; i++) {
65301
- const {
65302
- recordIndex: recordIndex,
65303
- field: field,
65304
- value: value
65305
- } = changeValues[i],
65306
- records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
65307
- let record, oldValue;
65308
- if (!Array.isArray(records) || "string" != typeof field && "number" != typeof field || (record = Array.isArray(recordIndex) ? getValueFromDeepArray(records, recordIndex) : records[recordIndex], oldValue = null == record ? void 0 : record[field]), this.dataSource.changeFieldValueByRecordIndex(value, recordIndex, field, this), triggerEvent) {
65309
- const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
65310
- if (oldValue !== changedValue) {
65311
- const changeValue = {
65312
- col: null !== (_e = null === (_d = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _d ? void 0 : _d.col) && void 0 !== _e ? _e : -1,
65313
- row: null !== (_g = null === (_f = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _f ? void 0 : _f.row) && void 0 !== _g ? _g : -1,
65314
- recordIndex: recordIndex,
65315
- field: field,
65316
- rawValue: oldValue,
65317
- currentValue: oldValue,
65318
- changedValue: changedValue
65319
- };
65320
- this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
65321
- }
65322
- }
65323
- }
65324
- !silentChangeCellValuesEvent && resultChangeValues.length && triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
65325
- values: resultChangeValues
65326
- }), autoRefresh && this.refreshAfterSourceChange();
65327
- }
65328
- changeCellValuesBySource(changeValues, triggerEvent = !0, silentChangeCellValuesEvent) {
65329
- return this.changeCellValuesByRecords(changeValues, {
65330
- triggerEvent: triggerEvent,
65331
- silentChangeCellValuesEvent: silentChangeCellValuesEvent,
65332
- autoRefresh: !0
65333
- });
65219
+ changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0) {
65220
+ return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this);
65334
65221
  }
65335
- refreshAfterSourceChange(options) {
65336
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
65337
- const reapplyFilter = null === (_a = null == options ? void 0 : options.reapplyFilter) || void 0 === _a || _a,
65338
- reapplySort = null === (_b = null == options ? void 0 : options.reapplySort) || void 0 === _b || _b,
65339
- clearRowHeightCache = null === (_c = null == options ? void 0 : options.clearRowHeightCache) || void 0 === _c || _c;
65340
- this.scenegraph.clearCells(), this.sortState && reapplySort && (null === (_e = (_d = this.dataSource).clearSortedIndexMap) || void 0 === _e || _e.call(_d), null === (_g = null === (_f = this.dataSource.sortedIndexMap) || void 0 === _f ? void 0 : _f.clear) || void 0 === _g || _g.call(_f)), reapplyFilter ? this.sortState && reapplySort ? (this.dataSource.updateFilterRulesForSorted(null === (_h = this.dataSource.dataConfig) || void 0 === _h ? void 0 : _h.filterRules), sortRecords(this)) : this.dataSource.updateFilterRules(null === (_j = this.dataSource.dataConfig) || void 0 === _j ? void 0 : _j.filterRules) : this.sortState && reapplySort && sortRecords(this);
65341
- const traverseColumns = columns => {
65342
- var _a, _b, _c, _d;
65343
- for (let i = 0; i < (null !== (_a = null == columns ? void 0 : columns.length) && void 0 !== _a ? _a : 0); i++) {
65344
- const column = columns[i],
65345
- aggregators = null == column ? void 0 : column.vtable_aggregator;
65346
- if (aggregators) if (Array.isArray(aggregators)) for (let j = 0; j < aggregators.length; j++) null === (_c = null === (_b = aggregators[j]) || void 0 === _b ? void 0 : _b.recalculate) || void 0 === _c || _c.call(_b);else null === (_d = null == aggregators ? void 0 : aggregators.recalculate) || void 0 === _d || _d.call(aggregators);
65347
- (null == column ? void 0 : column.columns) && traverseColumns(column.columns);
65348
- }
65349
- };
65350
- traverseColumns(this.internalProps.columns), this.refreshRowColCount(), this.internalProps.layoutMap.clearCellRangeMap(), this.internalProps.useOneRowHeightFillAll = !1, this.stateManager.initCheckedState(this.records), this.scenegraph.createSceneGraph(!clearRowHeightCache), null === (_k = this.internalProps.emptyTip) || void 0 === _k || _k.resetVisible(), this.resize();
65222
+ changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0) {
65223
+ return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this);
65351
65224
  }
65352
- addRecord(record, recordIndex, triggerEvent = !0) {
65225
+ addRecord(record, recordIndex) {
65353
65226
  var _a;
65354
65227
  const success = listTableAddRecord(record, recordIndex, this);
65355
- adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), triggerEvent && success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
65228
+ adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
65356
65229
  records: [record],
65357
65230
  recordIndex: recordIndex,
65358
65231
  recordCount: 1
65359
65232
  });
65360
65233
  }
65361
- addRecords(records, recordIndex, triggerEvent = !0) {
65234
+ addRecords(records, recordIndex) {
65362
65235
  var _a;
65363
65236
  const success = listTableAddRecords(records, recordIndex, this);
65364
- "number" == typeof recordIndex && adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, records), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), triggerEvent && success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
65237
+ "number" == typeof recordIndex && adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, records), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
65365
65238
  records: records,
65366
65239
  recordIndex: recordIndex,
65367
65240
  recordCount: records.length
65368
65241
  });
65369
65242
  }
65370
- deleteRecords(recordIndexs, triggerEvent = !0) {
65243
+ deleteRecords(recordIndexs) {
65371
65244
  var _a;
65372
- const deletedRecords = [];
65373
- (null == recordIndexs ? void 0 : recordIndexs.length) > 0 && recordIndexs.forEach(index => {
65374
- let record = null;
65375
- record = "number" == typeof index ? this.dataSource.get(index) : [], deletedRecords.push(record);
65376
- }), listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
65245
+ listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
65377
65246
  const rowIndexs = [];
65378
65247
  for (let i = 0; i < recordIndexs.length; i++) rowIndexs.push(this.getBodyRowIndexByRecordIndex(recordIndexs[i]) + this.columnHeaderLevelCount);
65379
- triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
65248
+ this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
65380
65249
  recordIndexs: recordIndexs,
65381
- records: deletedRecords,
65382
65250
  rowIndexs: rowIndexs,
65383
65251
  deletedCount: (Array.isArray(recordIndexs[0]), recordIndexs.length)
65384
65252
  });
65385
65253
  }
65386
- updateRecords(records, recordIndexs, triggerEvent = !0) {
65387
- listTableUpdateRecords(records, recordIndexs, this), triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
65254
+ updateRecords(records, recordIndexs) {
65255
+ listTableUpdateRecords(records, recordIndexs, this), this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
65388
65256
  records: records,
65389
65257
  recordIndexs: recordIndexs,
65390
65258
  updateCount: records.length
@@ -76542,7 +76410,7 @@
76542
76410
  PluginManager: PluginManager
76543
76411
  });
76544
76412
 
76545
- const version = "1.22.11-alpha.7";
76413
+ const version = "1.22.11-alpha.8";
76546
76414
 
76547
76415
  exports.Gantt = Gantt;
76548
76416
  exports.TYPES = index$4;