@visactor/vtable-sheet 1.25.1-alpha.1 → 1.26.1-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -264,4 +264,5 @@ function createFormulaDetectionOptions(sheetDefine, options, vtableSheet) {
264
264
  };
265
265
  }
266
266
 
267
- exports.getTablePlugins = getTablePlugins, exports.createFormulaDetectionOptions = createFormulaDetectionOptions;
267
+ exports.getTablePlugins = getTablePlugins, exports.createFormulaDetectionOptions = createFormulaDetectionOptions;
268
+ //# sourceMappingURL=table-plugins.js.map
@@ -72,5 +72,4 @@ class VTableSheetEventBus {
72
72
  }
73
73
  }
74
74
 
75
- exports.VTableSheetEventBus = VTableSheetEventBus;
76
- //# sourceMappingURL=vtable-sheet-event-bus.js.map
75
+ exports.VTableSheetEventBus = VTableSheetEventBus;
@@ -142,4 +142,5 @@ class CellHighlightManager {
142
142
  }
143
143
  }
144
144
 
145
- exports.CellHighlightManager = CellHighlightManager;
145
+ exports.CellHighlightManager = CellHighlightManager;
146
+ //# sourceMappingURL=cell-highlight-manager.js.map
@@ -74,5 +74,4 @@ Object.defineProperty(exports, "CrossSheetFormulaHandler", {
74
74
  get: function() {
75
75
  return cross_sheet_formula_handler_1.CrossSheetFormulaHandler;
76
76
  }
77
- });
78
- //# sourceMappingURL=index.js.map
77
+ });
package/cjs/index.d.ts CHANGED
@@ -2,5 +2,5 @@ import VTableSheet from './components/vtable-sheet';
2
2
  import type { ISheetDefine, IVTableSheetOptions, IVTableSheetUpdateOptions } from './ts-types';
3
3
  import * as TYPES from './ts-types';
4
4
  import * as VTable from './vtable';
5
- export declare const version = "1.25.1-alpha.1";
5
+ export declare const version = "1.26.1-alpha.0";
6
6
  export { VTableSheet, TYPES, VTable, ISheetDefine, IVTableSheetOptions, IVTableSheetUpdateOptions };
package/cjs/index.js CHANGED
@@ -47,4 +47,4 @@ exports.VTable = VTable;
47
47
 
48
48
  const style_manager_1 = require("./styles/style-manager");
49
49
 
50
- exports.version = "1.25.1-alpha.1", (0, style_manager_1.importStyles)();
50
+ exports.version = "1.26.1-alpha.0", (0, style_manager_1.importStyles)();
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6EAAoD;AAW3C,sBAXF,sBAAW,CAWE;AATpB,kDAAoC;AASd,sBAAK;AAR3B,iDAAmC;AAQN,wBAAM;AAPnC,0DAAsD;AACzC,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,IAAA,4BAAY,GAAE,CAAC","file":"index.js","sourcesContent":["import VTableSheet from './components/vtable-sheet';\nimport type { ISheetDefine, IVTableSheetOptions, IVTableSheetUpdateOptions } from './ts-types';\nimport * as TYPES from './ts-types';\nimport * as VTable from './vtable';\nimport { importStyles } from './styles/style-manager';\nexport const version = \"1.25.1-alpha.1\";\n// 导入样式\nimportStyles();\n/**\n * @namespace VTableSheet\n */\nexport { VTableSheet, TYPES, VTable, ISheetDefine, IVTableSheetOptions, IVTableSheetUpdateOptions };\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6EAAoD;AAW3C,sBAXF,sBAAW,CAWE;AATpB,kDAAoC;AASd,sBAAK;AAR3B,iDAAmC;AAQN,wBAAM;AAPnC,0DAAsD;AACzC,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,IAAA,4BAAY,GAAE,CAAC","file":"index.js","sourcesContent":["import VTableSheet from './components/vtable-sheet';\nimport type { ISheetDefine, IVTableSheetOptions, IVTableSheetUpdateOptions } from './ts-types';\nimport * as TYPES from './ts-types';\nimport * as VTable from './vtable';\nimport { importStyles } from './styles/style-manager';\nexport const version = \"1.26.1-alpha.0\";\n// 导入样式\nimportStyles();\n/**\n * @namespace VTableSheet\n */\nexport { VTableSheet, TYPES, VTable, ISheetDefine, IVTableSheetOptions, IVTableSheetUpdateOptions };\n"]}
@@ -4940,6 +4940,20 @@
4940
4940
  function crossProduct(dir1, dir2) {
4941
4941
  return dir1[0] * dir2[1] - dir1[1] * dir2[0];
4942
4942
  }
4943
+ function fixPrecision$1(num, precision = 10) {
4944
+ return Math.round(num * precision) / precision;
4945
+ }
4946
+ function getDecimalPlaces(n) {
4947
+ const dStr = n.toString().split(/[eE]/),
4948
+ s = (dStr[0].split(".")[1] || "").length - (+dStr[1] || 0);
4949
+ return s > 0 ? s : 0;
4950
+ }
4951
+ function precisionAdd(a, b) {
4952
+ return fixPrecision$1(a + b, 10 ** Math.max(getDecimalPlaces(a), getDecimalPlaces(b)));
4953
+ }
4954
+ function precisionSub(a, b) {
4955
+ return fixPrecision$1(a - b, 10 ** Math.max(getDecimalPlaces(a), getDecimalPlaces(b)));
4956
+ }
4943
4957
 
4944
4958
  class Point {
4945
4959
  constructor(x = 0, y = 0, x1, y1) {
@@ -37697,42 +37711,54 @@
37697
37711
  if (record) if (this.isRecord && this.records && (record.isAggregator ? this.records.push(...record.records) : this.records.push(record)), record.isAggregator && this.children) {
37698
37712
  this.children.push(record);
37699
37713
  const value = record.value();
37700
- this.sum += null != value ? value : 0, this.needSplitPositiveAndNegativeForSum && (value > 0 ? this.positiveSum += value : value < 0 && (this.nagetiveSum += value));
37714
+ this.sum = precisionAdd(this.sum, null != value ? value : 0), this.needSplitPositiveAndNegativeForSum && (value > 0 ? this.positiveSum = precisionAdd(this.positiveSum, value) : value < 0 && (this.nagetiveSum = precisionAdd(this.nagetiveSum, value)));
37701
37715
  } else if (this.field && !isNaN(parseFloat(record[this.field]))) {
37702
37716
  const value = parseFloat(record[this.field]);
37703
- this.sum += value, this.needSplitPositiveAndNegativeForSum && (value > 0 ? this.positiveSum += value : value < 0 && (this.nagetiveSum += value));
37717
+ this.sum = precisionAdd(this.sum, value), this.needSplitPositiveAndNegativeForSum && (value > 0 ? this.positiveSum = precisionAdd(this.positiveSum, value) : value < 0 && (this.nagetiveSum = precisionAdd(this.nagetiveSum, value)));
37704
37718
  }
37705
37719
  this.clearCacheValue();
37706
37720
  }
37707
37721
  deleteRecord(record) {
37708
- if (record) if (this.isRecord && this.records && (this.records = this.records.filter(item => item !== record)), record.isAggregator && this.children) {
37709
- this.children = this.children.filter(item => item !== record);
37710
- const value = record.value();
37711
- this.sum -= null != value ? value : 0, this.needSplitPositiveAndNegativeForSum && (value > 0 ? this.positiveSum -= value : value < 0 && (this.nagetiveSum -= value));
37712
- } else if (this.field && !isNaN(parseFloat(record[this.field]))) {
37713
- const value = parseFloat(record[this.field]);
37714
- this.sum -= value, this.needSplitPositiveAndNegativeForSum && (value > 0 ? this.positiveSum -= value : value < 0 && (this.nagetiveSum -= value));
37722
+ if (record) {
37723
+ if (this.isRecord && this.records) {
37724
+ const index = this.records.indexOf(record);
37725
+ -1 !== index && this.records.splice(index, 1);
37726
+ }
37727
+ if (record.isAggregator && this.children) {
37728
+ const index = this.children.indexOf(record);
37729
+ -1 !== index && this.children.splice(index, 1);
37730
+ const value = record.value();
37731
+ this.sum = precisionSub(this.sum, null != value ? value : 0), this.needSplitPositiveAndNegativeForSum && (value > 0 ? this.positiveSum = precisionSub(this.positiveSum, value) : value < 0 && (this.nagetiveSum = precisionSub(this.nagetiveSum, value)));
37732
+ } else if (this.field && !isNaN(parseFloat(record[this.field]))) {
37733
+ const value = parseFloat(record[this.field]);
37734
+ this.sum = precisionSub(this.sum, value), this.needSplitPositiveAndNegativeForSum && (value > 0 ? this.positiveSum = precisionSub(this.positiveSum, value) : value < 0 && (this.nagetiveSum = precisionSub(this.nagetiveSum, value)));
37735
+ }
37715
37736
  }
37716
37737
  this.clearCacheValue();
37717
37738
  }
37718
37739
  updateRecord(oldRecord, newRecord) {
37719
37740
  if (oldRecord && newRecord) {
37720
- if (this.isRecord && this.records && (this.records = this.records.map(item => item === oldRecord ? newRecord : item)), oldRecord.isAggregator && this.children) {
37721
- const oldValue = oldRecord.value();
37722
- this.children = this.children.filter(item => item !== oldRecord);
37741
+ if (this.isRecord && this.records) {
37742
+ const index = this.records.indexOf(oldRecord);
37743
+ -1 !== index && (this.records[index] = newRecord);
37744
+ }
37745
+ if (oldRecord.isAggregator && this.children) {
37746
+ const oldValue = oldRecord.value(),
37747
+ index = this.children.indexOf(oldRecord);
37748
+ -1 !== index && (this.children[index] = newRecord);
37723
37749
  const newValue = newRecord.value();
37724
- this.children.push(newRecord), this.sum += newValue - oldValue, this.needSplitPositiveAndNegativeForSum && (oldValue > 0 ? this.positiveSum -= oldValue : oldValue < 0 && (this.nagetiveSum -= oldValue), newValue > 0 ? this.positiveSum += newValue : newValue < 0 && (this.nagetiveSum += newValue));
37750
+ this.sum = precisionAdd(this.sum, precisionSub(newValue, oldValue)), this.needSplitPositiveAndNegativeForSum && (oldValue > 0 ? this.positiveSum = precisionSub(this.positiveSum, oldValue) : oldValue < 0 && (this.nagetiveSum = precisionSub(this.nagetiveSum, oldValue)), newValue > 0 ? this.positiveSum = precisionAdd(this.positiveSum, newValue) : newValue < 0 && (this.nagetiveSum = precisionAdd(this.nagetiveSum, newValue)));
37725
37751
  } else if (this.field && !isNaN(parseFloat(oldRecord[this.field]))) {
37726
37752
  const oldValue = parseFloat(oldRecord[this.field]),
37727
37753
  newValue = parseFloat(newRecord[this.field]);
37728
- this.sum += newValue - oldValue, this.needSplitPositiveAndNegativeForSum && (oldValue > 0 ? this.positiveSum -= oldValue : oldValue < 0 && (this.nagetiveSum -= oldValue), newValue > 0 ? this.positiveSum += newValue : newValue < 0 && (this.nagetiveSum += newValue));
37754
+ this.sum = precisionAdd(this.sum, precisionSub(newValue, oldValue)), this.needSplitPositiveAndNegativeForSum && (oldValue > 0 ? this.positiveSum = precisionSub(this.positiveSum, oldValue) : oldValue < 0 && (this.nagetiveSum = precisionSub(this.nagetiveSum, oldValue)), newValue > 0 ? this.positiveSum = precisionAdd(this.positiveSum, newValue) : newValue < 0 && (this.nagetiveSum = precisionAdd(this.nagetiveSum, newValue)));
37729
37755
  }
37730
37756
  this.clearCacheValue();
37731
37757
  }
37732
37758
  }
37733
37759
  value() {
37734
- var _a, _b;
37735
- return null !== (_a = this.changedValue) && void 0 !== _a ? _a : (null === (_b = this.records) || void 0 === _b ? void 0 : _b.length) >= 1 ? this.sum : void 0;
37760
+ var _a;
37761
+ return null !== (_a = this.changedValue) && void 0 !== _a ? _a : this.records && this.records.length >= 1 || !1 === this.isRecord ? this.sum : void 0;
37736
37762
  }
37737
37763
  positiveValue() {
37738
37764
  return this.positiveSum;
@@ -37748,16 +37774,16 @@
37748
37774
  const child = this.children[i];
37749
37775
  if (child.isAggregator) {
37750
37776
  const value = child.value();
37751
- this.sum += null != value ? value : 0, this.needSplitPositiveAndNegativeForSum && (value > 0 ? this.positiveSum += value : value < 0 && (this.nagetiveSum += value));
37777
+ this.sum = precisionAdd(this.sum, null != value ? value : 0), this.needSplitPositiveAndNegativeForSum && (value > 0 ? this.positiveSum = precisionAdd(this.positiveSum, value) : value < 0 && (this.nagetiveSum = precisionAdd(this.nagetiveSum, value)));
37752
37778
  }
37753
37779
  } else if (this.records) for (let i = 0; i < this.records.length; i++) {
37754
37780
  const record = this.records[i];
37755
37781
  if (record.isAggregator) {
37756
37782
  const value = record.value();
37757
- this.sum += null != value ? value : 0, this.needSplitPositiveAndNegativeForSum && (value > 0 ? this.positiveSum += value : value < 0 && (this.nagetiveSum += value));
37783
+ this.sum = precisionAdd(this.sum, null != value ? value : 0), this.needSplitPositiveAndNegativeForSum && (value > 0 ? this.positiveSum = precisionAdd(this.positiveSum, value) : value < 0 && (this.nagetiveSum = precisionAdd(this.nagetiveSum, value)));
37758
37784
  } else if (this.field && !isNaN(parseFloat(record[this.field]))) {
37759
37785
  const value = parseFloat(record[this.field]);
37760
- this.sum += value, this.needSplitPositiveAndNegativeForSum && (value > 0 ? this.positiveSum += value : value < 0 && (this.nagetiveSum += value));
37786
+ this.sum = precisionAdd(this.sum, value), this.needSplitPositiveAndNegativeForSum && (value > 0 ? this.positiveSum = precisionAdd(this.positiveSum, value) : value < 0 && (this.nagetiveSum = precisionAdd(this.nagetiveSum, value)));
37761
37787
  }
37762
37788
  }
37763
37789
  }
@@ -37800,17 +37826,43 @@
37800
37826
  super(...arguments), this.type = AggregationType.AVG, this.sum = 0, this.count = 0;
37801
37827
  }
37802
37828
  push(record) {
37803
- record && (this.isRecord && this.records && (record.isAggregator ? this.records.push(...record.records) : this.records.push(record)), record.isAggregator && record.type === AggregationType.AVG ? (this.children && this.children.push(record), this.sum += record.sum, this.count += record.count) : this.field && !isNaN(parseFloat(record[this.field])) && (this.sum += parseFloat(record[this.field]), this.count++)), this.clearCacheValue();
37829
+ record && (this.isRecord && this.records && (record.isAggregator ? this.records.push(...record.records) : this.records.push(record)), record.isAggregator && record.type === AggregationType.AVG ? (this.children && this.children.push(record), this.sum = precisionAdd(this.sum, record.sum), this.count += record.count) : this.field && !isNaN(parseFloat(record[this.field])) && (this.sum = precisionAdd(this.sum, parseFloat(record[this.field])), this.count++)), this.clearCacheValue();
37804
37830
  }
37805
37831
  deleteRecord(record) {
37806
- record && (this.isRecord && this.records && (this.records = this.records.filter(item => item !== record)), record.isAggregator && record.type === AggregationType.AVG ? (this.children && (this.children = this.children.filter(item => item !== record)), this.sum -= record.sum, this.count -= record.count) : this.field && !isNaN(parseFloat(record[this.field])) && (this.sum -= parseFloat(record[this.field]), this.count--)), this.clearCacheValue();
37832
+ if (record) {
37833
+ if (this.isRecord && this.records) {
37834
+ const index = this.records.indexOf(record);
37835
+ -1 !== index && this.records.splice(index, 1);
37836
+ }
37837
+ if (record.isAggregator && record.type === AggregationType.AVG) {
37838
+ if (this.children) {
37839
+ const index = this.children.indexOf(record);
37840
+ -1 !== index && this.children.splice(index, 1);
37841
+ }
37842
+ this.sum = precisionSub(this.sum, record.sum), this.count -= record.count;
37843
+ } else this.field && !isNaN(parseFloat(record[this.field])) && (this.sum = precisionSub(this.sum, parseFloat(record[this.field])), this.count--);
37844
+ }
37845
+ this.clearCacheValue();
37807
37846
  }
37808
37847
  updateRecord(oldRecord, newRecord) {
37809
- oldRecord && newRecord && (this.isRecord && this.records && (this.records = this.records.map(item => item === oldRecord ? newRecord : item)), oldRecord.isAggregator && oldRecord.type === AggregationType.AVG ? (this.children && newRecord.isAggregator && (this.children = this.children.map(item => item === oldRecord ? newRecord : item)), this.sum += newRecord.sum - oldRecord.sum, this.count += newRecord.count - oldRecord.count) : this.field && !isNaN(parseFloat(oldRecord[this.field])) && (this.sum += parseFloat(newRecord[this.field]) - parseFloat(oldRecord[this.field])), this.clearCacheValue());
37848
+ if (oldRecord && newRecord) {
37849
+ if (this.isRecord && this.records) {
37850
+ const index = this.records.indexOf(oldRecord);
37851
+ -1 !== index && (this.records[index] = newRecord);
37852
+ }
37853
+ if (oldRecord.isAggregator && oldRecord.type === AggregationType.AVG) {
37854
+ if (this.children && newRecord.isAggregator) {
37855
+ const index = this.children.indexOf(oldRecord);
37856
+ -1 !== index && (this.children[index] = newRecord);
37857
+ }
37858
+ this.sum = precisionAdd(this.sum, precisionSub(newRecord.sum, oldRecord.sum)), this.count += newRecord.count - oldRecord.count;
37859
+ } else this.field && !isNaN(parseFloat(oldRecord[this.field])) && (this.sum = precisionAdd(this.sum, precisionSub(parseFloat(newRecord[this.field]), parseFloat(oldRecord[this.field]))));
37860
+ this.clearCacheValue();
37861
+ }
37810
37862
  }
37811
37863
  value() {
37812
- var _a, _b;
37813
- return null !== (_a = this.changedValue) && void 0 !== _a ? _a : (null === (_b = this.records) || void 0 === _b ? void 0 : _b.length) >= 1 ? this.sum / this.count : void 0;
37864
+ var _a;
37865
+ return null !== (_a = this.changedValue) && void 0 !== _a ? _a : this.records && this.records.length >= 1 || !1 === this.isRecord && this.count > 0 ? this.sum / this.count : void 0;
37814
37866
  }
37815
37867
  reset() {
37816
37868
  this.changedValue = void 0, this.children = [], this.records = [], this.sum = 0, this.count = 0;
@@ -37820,11 +37872,11 @@
37820
37872
  const child = this.children[i];
37821
37873
  if (child.isAggregator && child.type === AggregationType.AVG) {
37822
37874
  const childValue = child.value();
37823
- this.sum += childValue * child.count, this.count += child.count;
37875
+ this.sum = precisionAdd(this.sum, childValue * child.count), this.count += child.count;
37824
37876
  }
37825
37877
  } else if (this.records) for (let i = 0; i < this.records.length; i++) {
37826
37878
  const record = this.records[i];
37827
- record.isAggregator && record.type === AggregationType.AVG ? (this.sum += record.sum, this.count += record.count) : this.field && !isNaN(parseFloat(record[this.field])) && (this.sum += parseFloat(record[this.field]), this.count++);
37879
+ record.isAggregator && record.type === AggregationType.AVG ? (this.sum = precisionAdd(this.sum, record.sum), this.count += record.count) : this.field && !isNaN(parseFloat(record[this.field])) && (this.sum = precisionAdd(this.sum, parseFloat(record[this.field])), this.count++);
37828
37880
  }
37829
37881
  }
37830
37882
  }
@@ -45599,15 +45651,17 @@
45599
45651
  } else if ("sparkline" === type) {
45600
45652
  cellGroup = Factory.getFunction("createSparkLineCellGroup")(null, columnGroup, 0, y, col, row, cellWidth, cellHeight, padding, table, cellTheme, isAsync);
45601
45653
  } else if ("checkbox" === type) {
45602
- const isAggregation = "isAggregation" in table.internalProps.layoutMap && table.internalProps.layoutMap.isAggregation(col, row),
45603
- isSeriesNumber = table.internalProps.layoutMap.isSeriesNumber(col, row);
45604
- if (isAggregation && isSeriesNumber) {
45654
+ if ("isAggregation" in table.internalProps.layoutMap && table.internalProps.layoutMap.isAggregation(col, row)) {
45605
45655
  cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, !1, void 0, !0, cellTheme, range, isAsync);
45606
45656
  } else {
45607
45657
  cellGroup = Factory.getFunction("createCheckboxCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync, !1);
45608
45658
  }
45609
45659
  } else if ("radio" === type) {
45610
- cellGroup = Factory.getFunction("createRadioCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, table, cellTheme, define, range);
45660
+ if ("isAggregation" in table.internalProps.layoutMap && table.internalProps.layoutMap.isAggregation(col, row)) {
45661
+ cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, !1, void 0, !0, cellTheme, range, isAsync);
45662
+ } else {
45663
+ cellGroup = Factory.getFunction("createRadioCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, table, cellTheme, define, range);
45664
+ }
45611
45665
  } else if ("switch" === type) {
45612
45666
  cellGroup = Factory.getFunction("createSwitchCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync);
45613
45667
  } else if ("button" === type) {
@@ -54788,6 +54842,7 @@
54788
54842
  } else if (-1 === cellPos.col || -1 === cellPos.row || -1 !== col && -1 !== row) {
54789
54843
  if (interactionState !== InteractionState.default || table.eventManager.isDraging || table.stateManager.isResizeCol()) {
54790
54844
  if ((interactionState === InteractionState.grabing || table.eventManager.isDraging) && !table.stateManager.isResizeCol()) {
54845
+ if (col >= 0 && row >= 0 && isCellDisableSelect(table, col, row)) return void scenegraph.updateNextFrame();
54791
54846
  let extendSelectRange = !isValid$2(skipBodyMerge) || !skipBodyMerge;
54792
54847
  -1 === cellPos.col && (cellPos.col = col), -1 === cellPos.row && (cellPos.row = row), cellPos.col = col, cellPos.row = row;
54793
54848
  const currentRange = state.select.ranges[state.select.ranges.length - 1];
@@ -55983,8 +56038,11 @@
55983
56038
  updateOptionSetState() {
55984
56039
  this._updateOptionSetState(), this.setHoverState(), this.setSelectState(), this.setFrozenState();
55985
56040
  }
56041
+ endResizeIfResizing() {
56042
+ this.columnResize.resizing && (this.table.scenegraph.component.hideResizeCol(), this.columnResize.resizing = !1), this.rowResize.resizing && (this.table.scenegraph.component.hideResizeRow(), this.rowResize.resizing = !1), this.interactionState === InteractionState.grabing && (this.interactionState = InteractionState.default);
56043
+ }
55986
56044
  _updateOptionSetState() {
55987
- this.interactionState = InteractionState.default, this.hoverIcon = {
56045
+ this.endResizeIfResizing(), this.interactionState = InteractionState.default, this.hoverIcon = {
55988
56046
  col: -1,
55989
56047
  row: -1,
55990
56048
  icon: null
@@ -57113,6 +57171,7 @@
57113
57171
  }
57114
57172
 
57115
57173
  function bindTableGroupListener(eventManager) {
57174
+ var _a, _b, _c;
57116
57175
  const table = eventManager.table,
57117
57176
  stateManager = table.stateManager,
57118
57177
  getEventArgsSet = e => getCellEventArgsSetWithTable(e, table);
@@ -57229,7 +57288,13 @@
57229
57288
  event: e.nativeEvent
57230
57289
  });
57231
57290
  }), table.scenegraph.tableGroup.addEventListener("pointerleave", e => {
57232
- stateManager.isResizeCol() || stateManager.isResizeRow() || stateManager.isMoveCol() || stateManager.isSelecting() || (stateManager.updateInteractionState(InteractionState.default), stateManager.updateCursor()), (table.theme.scrollStyle.horizontalVisible && "focus" === table.theme.scrollStyle.horizontalVisible || !table.theme.scrollStyle.horizontalVisible && "focus" === table.theme.scrollStyle.visible) && stateManager.hideHorizontalScrollBar(), (table.theme.scrollStyle.verticalVisible && "focus" === table.theme.scrollStyle.verticalVisible || !table.theme.scrollStyle.verticalVisible && "focus" === table.theme.scrollStyle.visible) && stateManager.hideVerticalScrollBar(), table.hasListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL) && -1 !== table.stateManager.hover.cellPos.col && -1 !== table.stateManager.hover.cellPos.row && table.fireListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL, {
57291
+ var _a, _b, _c;
57292
+ stateManager.isResizeCol() || stateManager.isResizeRow() || stateManager.isMoveCol() || stateManager.isSelecting() || (stateManager.updateInteractionState(InteractionState.default), stateManager.updateCursor());
57293
+ const scrollStyle = table.theme.scrollStyle,
57294
+ horizontalVisible = null !== (_a = null == scrollStyle ? void 0 : scrollStyle.horizontalVisible) && void 0 !== _a ? _a : null == scrollStyle ? void 0 : scrollStyle.visible,
57295
+ verticalVisible = null !== (_b = null == scrollStyle ? void 0 : scrollStyle.verticalVisible) && void 0 !== _b ? _b : null == scrollStyle ? void 0 : scrollStyle.visible,
57296
+ barToSide = null !== (_c = null == scrollStyle ? void 0 : scrollStyle.barToSide) && void 0 !== _c && _c;
57297
+ barToSide || "focus" !== horizontalVisible || stateManager.hideHorizontalScrollBar(), barToSide || "focus" !== verticalVisible || stateManager.hideVerticalScrollBar(), table.hasListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL) && -1 !== table.stateManager.hover.cellPos.col && -1 !== table.stateManager.hover.cellPos.row && table.fireListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL, {
57233
57298
  col: table.stateManager.hover.cellPos.col,
57234
57299
  row: table.stateManager.hover.cellPos.row,
57235
57300
  cellRange: table.getCellRangeRelativeRect({
@@ -57458,7 +57523,29 @@
57458
57523
  const isHasSelected = !!(null === (_a = stateManager.select.ranges) || void 0 === _a ? void 0 : _a.length);
57459
57524
  (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);
57460
57525
  }
57461
- }), table.scenegraph.stage.addEventListener("pointermove", e => {
57526
+ });
57527
+ const scrollStyle = table.theme.scrollStyle,
57528
+ barToSide = null !== (_a = null == scrollStyle ? void 0 : scrollStyle.barToSide) && void 0 !== _a && _a,
57529
+ horizontalVisible = null !== (_b = null == scrollStyle ? void 0 : scrollStyle.horizontalVisible) && void 0 !== _b ? _b : null == scrollStyle ? void 0 : scrollStyle.visible,
57530
+ verticalVisible = null !== (_c = null == scrollStyle ? void 0 : scrollStyle.verticalVisible) && void 0 !== _c ? _c : null == scrollStyle ? void 0 : scrollStyle.visible,
57531
+ shouldShowScrollOnCanvasHover = barToSide && "focus" === horizontalVisible,
57532
+ shouldShowVScrollOnCanvasHover = barToSide && "focus" === verticalVisible;
57533
+ (shouldShowScrollOnCanvasHover || shouldShowVScrollOnCanvasHover) && (table.scenegraph.stage.addEventListener("pointerenter", e => {
57534
+ var _a, _b, _c;
57535
+ const target = e.target;
57536
+ if (target === table.scenegraph.stage || (null === (_a = null == target ? void 0 : target.isDescendantsOf) || void 0 === _a ? void 0 : _a.call(target, table.scenegraph.stage))) {
57537
+ if (shouldShowScrollOnCanvasHover) {
57538
+ const relativeX = e.x - table.tableX,
57539
+ target = table.options.scrollFrozenCols && (null === (_b = table.getFrozenColsOffset) || void 0 === _b ? void 0 : _b.call(table)) > 0 && relativeX >= 0 && relativeX < table.getFrozenColsWidth() ? "frozen" : table.options.scrollRightFrozenCols && (null === (_c = table.getRightFrozenColsOffset) || void 0 === _c ? void 0 : _c.call(table)) > 0 && relativeX > table.tableNoFrameWidth - table.getRightFrozenColsWidth() ? "rightFrozen" : "body";
57540
+ stateManager.showHorizontalScrollBar(!1, target);
57541
+ }
57542
+ shouldShowVScrollOnCanvasHover && stateManager.showVerticalScrollBar();
57543
+ }
57544
+ }), table.scenegraph.stage.addEventListener("pointerleave", e => {
57545
+ var _a;
57546
+ const relatedTarget = e.relatedTarget;
57547
+ (!relatedTarget || relatedTarget !== table.scenegraph.stage && !(null === (_a = relatedTarget.isDescendantsOf) || void 0 === _a ? void 0 : _a.call(relatedTarget, table.scenegraph.stage))) && (shouldShowScrollOnCanvasHover && stateManager.hideHorizontalScrollBar(), shouldShowVScrollOnCanvasHover && stateManager.hideVerticalScrollBar());
57548
+ })), table.scenegraph.stage.addEventListener("pointermove", e => {
57462
57549
  var _a, _b, _c;
57463
57550
  const eventArgsSet = getCellEventArgsSetWithTable(e, table);
57464
57551
  null !== (_c = null === (_b = null === (_a = e.target) || void 0 === _a ? void 0 : _a.isDescendantsOf) || void 0 === _b ? void 0 : _b.call(_a, table.scenegraph.tableGroup)) && void 0 !== _c && _c && (stateManager.isResizeCol() || eventManager.checkColumnResize(eventArgsSet) ? table.stateManager.select && eventManager.checkCellFillhandle(eventArgsSet) ? stateManager.updateCursor("crosshair") : stateManager.updateCursor("col-resize") : stateManager.isResizeRow() || eventManager.checkRowResize(eventArgsSet) ? table.stateManager.select && eventManager.checkCellFillhandle(eventArgsSet) ? stateManager.updateCursor("crosshair") : stateManager.updateCursor("row-resize") : stateManager.isMoveCol() || stateManager.updateCursor());
@@ -58017,7 +58104,10 @@
58017
58104
  right || left || (x > table.tableNoFrameWidth - table.getRightFrozenColsWidth() && x < table.tableNoFrameWidth || x > 0 && x < table.getFrozenColsWidth() ? (selectX = x, considerFrozenX = !0) : selectX = table.scrollLeft + frozenOffset + x), bottom || top || (y > table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() && y < table.tableNoFrameHeight || y > 0 && y < table.getFrozenRowsHeight() ? (selectY = y, considerFrozenY = !0) : selectY = table.scrollTop + y), table.stateManager.updateInteractionState(InteractionState.grabing);
58018
58105
  const targetCol = table.getTargetColAtConsiderRightFrozen(selectX, considerFrozenX),
58019
58106
  targetRow = table.getTargetRowAtConsiderBottomFrozen(selectY, considerFrozenY);
58020
- !(null === (_c = table.options.select) || void 0 === _c ? void 0 : _c.disableDragSelect) && isValid$2(targetCol) && isValid$2(targetRow) && table.stateManager.updateSelectPos("row" === table.stateManager.select.selectInline ? table.colCount - 1 : targetCol.col, "col" === table.stateManager.select.selectInline ? table.rowCount - 1 : targetRow.row, !1, !1, !1, !1);
58107
+ if (!(null === (_c = table.options.select) || void 0 === _c ? void 0 : _c.disableDragSelect) && isValid$2(targetCol) && isValid$2(targetRow)) {
58108
+ if (isCellDisableSelect(table, targetCol.col, targetRow.row)) return;
58109
+ table.stateManager.updateSelectPos("row" === table.stateManager.select.selectInline ? table.colCount - 1 : targetCol.col, "col" === table.stateManager.select.selectInline ? table.rowCount - 1 : targetRow.row, !1, !1, !1, !1);
58110
+ }
58021
58111
  });
58022
58112
  } else table.eventManager.inertiaScroll.isInertiaScrolling() ? table.eventManager.inertiaScroll.endInertia() : table.eventManager.scrollYSpeed = 0;
58023
58113
  }
@@ -60093,6 +60183,7 @@
60093
60183
  switch (headerType) {
60094
60184
  case "text":
60095
60185
  case "link":
60186
+ default:
60096
60187
  return TextHeaderStyle;
60097
60188
  case "image":
60098
60189
  case "video":
@@ -61139,7 +61230,7 @@
61139
61230
  }
61140
61231
  constructor(container, options = {}) {
61141
61232
  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;
61142
- if (super(), this.showFrozenIcon = !0, this._scrollToRowCorrectTimer = null, this._tableBorderWidth_left = 0, this._tableBorderWidth_right = 0, this._tableBorderWidth_top = 0, this._tableBorderWidth_bottom = 0, this.version = "1.25.1-alpha.1", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "undefined" != typeof window) {
61233
+ if (super(), this.showFrozenIcon = !0, this._scrollToRowCorrectTimer = null, this._tableBorderWidth_left = 0, this._tableBorderWidth_right = 0, this._tableBorderWidth_top = 0, this._tableBorderWidth_bottom = 0, this.version = "1.26.1-alpha.0", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "undefined" != typeof window) {
61143
61234
  const g = window;
61144
61235
  g[this.id] = this;
61145
61236
  const registry = g.__vtable__ || (g.__vtable__ = {
@@ -62544,9 +62635,13 @@
62544
62635
  }
62545
62636
  getCellType(col, row) {
62546
62637
  let cellType;
62547
- return this.isSeriesNumberInHeader(col, row) ? this.internalProps.layoutMap.getSeriesNumberHeader(col, row).cellType : (cellType = this.isHeader(col, row) ? this.internalProps.layoutMap.getHeader(col, row).headerType : this.internalProps.layoutMap.getBody(col, row).cellType, getProp("cellType", {
62638
+ if (this.isSeriesNumberInHeader(col, row)) {
62639
+ const seriesHeaderCellType = this.internalProps.layoutMap.getSeriesNumberHeader(col, row).cellType;
62640
+ return "radio" === seriesHeaderCellType ? "text" : seriesHeaderCellType;
62641
+ }
62642
+ return cellType = this.isHeader(col, row) ? this.internalProps.layoutMap.getHeader(col, row).headerType : this.internalProps.layoutMap.getBody(col, row).cellType, getProp("cellType", {
62548
62643
  cellType: cellType
62549
- }, col, row, this));
62644
+ }, col, row, this);
62550
62645
  }
62551
62646
  getHeaderField(col, row) {
62552
62647
  return this.internalProps.layoutMap.getHeaderField(col, row);
@@ -66542,7 +66637,7 @@
66542
66637
  setRecords(records, option) {
66543
66638
  var _a, _b, _c, _d, _e;
66544
66639
  let sort;
66545
- clearChartRenderQueue(), null === (_a = this.internalProps.dataSource) || void 0 === _a || _a.release(), this.internalProps.releaseList = null === (_b = this.internalProps.releaseList) || void 0 === _b ? void 0 : _b.filter(item => !item.dataSourceObj), this.internalProps.dataSource = null, Array.isArray(option) || (null == option ? void 0 : option.order) ? sort = option : option ? sort = option.sortState : null === option && (sort = null);
66640
+ this.stateManager.endResizeIfResizing(), clearChartRenderQueue(), null === (_a = this.internalProps.dataSource) || void 0 === _a || _a.release(), this.internalProps.releaseList = null === (_b = this.internalProps.releaseList) || void 0 === _b ? void 0 : _b.filter(item => !item.dataSourceObj), this.internalProps.dataSource = null, Array.isArray(option) || (null == option ? void 0 : option.order) ? sort = option : option ? sort = option.sortState : null === option && (sort = null);
66546
66641
  "undefined" != typeof window && window.performance.now();
66547
66642
  const oldHoverState = {
66548
66643
  col: this.stateManager.hover.cellPos.col,
@@ -83677,7 +83772,7 @@
83677
83772
  function getCellMatrix(table) {
83678
83773
  return {
83679
83774
  getValue: (row, col) => {
83680
- const value = table.getCellValue(col, row);
83775
+ const value = table.getCellOriginValue(col, row);
83681
83776
  return "number" != typeof value && isNaN(Number(value)) ? {
83682
83777
  v: value || "",
83683
83778
  t: CellValueType.STRING
@@ -95729,7 +95824,7 @@
95729
95824
  importStyle();
95730
95825
  }
95731
95826
 
95732
- const version = "1.25.1-alpha.1";
95827
+ const version = "1.26.1-alpha.0";
95733
95828
  importStyles();
95734
95829
 
95735
95830
  exports.TYPES = index;