@visactor/vtable 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.
Files changed (93) hide show
  1. package/cjs/ListTable.js +2 -1
  2. package/cjs/ListTable.js.map +1 -1
  3. package/cjs/PivotChart.js +3 -2
  4. package/cjs/PivotChart.js.map +1 -1
  5. package/cjs/PivotTable.js +85 -13
  6. package/cjs/PivotTable.js.map +1 -1
  7. package/cjs/core/BaseTable.js +8 -5
  8. package/cjs/core/BaseTable.js.map +1 -1
  9. package/cjs/core/FouseInput.js +2 -1
  10. package/cjs/data/DataSource.js +2 -1
  11. package/cjs/edit/edit-manager.js +0 -1
  12. package/cjs/event/listener/container-dom.js +5 -2
  13. package/cjs/event/listener/container-dom.js.map +1 -1
  14. package/cjs/event/listener/table-group.js +24 -3
  15. package/cjs/event/listener/table-group.js.map +1 -1
  16. package/cjs/header-helper/header-helper.js +1 -0
  17. package/cjs/header-helper/header-helper.js.map +1 -1
  18. package/cjs/header-helper/style.js +1 -2
  19. package/cjs/index.d.ts +1 -1
  20. package/cjs/index.js +1 -1
  21. package/cjs/index.js.map +1 -1
  22. package/cjs/layout/index.js +1 -1
  23. package/cjs/layout/layout-helper.js +2 -1
  24. package/cjs/layout/pivot-header-layout.js +1 -1
  25. package/cjs/layout/row-height-map.js +1 -1
  26. package/cjs/layout/simple-header-layout.js +1 -1
  27. package/cjs/layout/tree-helper.js +1 -1
  28. package/cjs/plugins/index.js +1 -1
  29. package/cjs/plugins/interface.js +1 -1
  30. package/cjs/plugins/invert-highlight.js +1 -1
  31. package/cjs/plugins/list-tree-stick-cell.js +1 -1
  32. package/cjs/plugins/plugin-manager.js +1 -1
  33. package/cjs/scenegraph/group-creater/cell-helper.js +6 -3
  34. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  35. package/cjs/scenegraph/scenegraph.js +1 -1
  36. package/cjs/state/select/update-position.js +2 -1
  37. package/cjs/state/select/update-position.js.map +1 -1
  38. package/cjs/state/state.d.ts +1 -0
  39. package/cjs/state/state.js +7 -1
  40. package/cjs/state/state.js.map +1 -1
  41. package/cjs/ts-types/dataset/aggregation.js +94 -39
  42. package/cjs/ts-types/dataset/aggregation.js.map +1 -1
  43. package/cjs/ts-types/icon.d.ts +2 -2
  44. package/cjs/ts-types/icon.js.map +1 -1
  45. package/cjs/vrender.js.map +1 -1
  46. package/dist/vtable.js +293 -87
  47. package/dist/vtable.min.js +1 -1
  48. package/es/ListTable.js +1 -1
  49. package/es/ListTable.js.map +1 -1
  50. package/es/PivotChart.js +2 -2
  51. package/es/PivotChart.js.map +1 -1
  52. package/es/PivotTable.js +85 -13
  53. package/es/PivotTable.js.map +1 -1
  54. package/es/core/BaseTable.js +8 -5
  55. package/es/core/BaseTable.js.map +1 -1
  56. package/es/core/FouseInput.js +2 -1
  57. package/es/data/DataSource.js +2 -1
  58. package/es/edit/edit-manager.js +1 -2
  59. package/es/event/listener/container-dom.js +4 -1
  60. package/es/event/listener/container-dom.js.map +1 -1
  61. package/es/event/listener/table-group.js +24 -3
  62. package/es/event/listener/table-group.js.map +1 -1
  63. package/es/header-helper/header-helper.js +1 -0
  64. package/es/header-helper/header-helper.js.map +1 -1
  65. package/es/header-helper/style.js +1 -2
  66. package/es/index.d.ts +1 -1
  67. package/es/index.js +1 -1
  68. package/es/index.js.map +1 -1
  69. package/es/layout/index.js +1 -1
  70. package/es/layout/layout-helper.js +2 -1
  71. package/es/layout/pivot-header-layout.js +1 -1
  72. package/es/layout/row-height-map.js +1 -1
  73. package/es/layout/simple-header-layout.js +1 -1
  74. package/es/layout/tree-helper.js +1 -1
  75. package/es/plugins/index.js +1 -1
  76. package/es/plugins/interface.js +1 -1
  77. package/es/plugins/invert-highlight.js +1 -1
  78. package/es/plugins/list-tree-stick-cell.js +1 -1
  79. package/es/plugins/plugin-manager.js +1 -1
  80. package/es/scenegraph/group-creater/cell-helper.js +6 -3
  81. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  82. package/es/scenegraph/scenegraph.js +1 -1
  83. package/es/state/select/update-position.js +3 -0
  84. package/es/state/select/update-position.js.map +1 -1
  85. package/es/state/state.d.ts +1 -0
  86. package/es/state/state.js +6 -1
  87. package/es/state/state.js.map +1 -1
  88. package/es/ts-types/dataset/aggregation.js +68 -38
  89. package/es/ts-types/dataset/aggregation.js.map +1 -1
  90. package/es/ts-types/icon.d.ts +2 -2
  91. package/es/ts-types/icon.js.map +1 -1
  92. package/es/vrender.js.map +1 -1
  93. package/package.json +6 -5
package/dist/vtable.js CHANGED
@@ -1789,6 +1789,20 @@
1789
1789
  function crossProduct(dir1, dir2) {
1790
1790
  return dir1[0] * dir2[1] - dir1[1] * dir2[0];
1791
1791
  }
1792
+ function fixPrecision$1(num, precision = 10) {
1793
+ return Math.round(num * precision) / precision;
1794
+ }
1795
+ function getDecimalPlaces(n) {
1796
+ const dStr = n.toString().split(/[eE]/),
1797
+ s = (dStr[0].split(".")[1] || "").length - (+dStr[1] || 0);
1798
+ return s > 0 ? s : 0;
1799
+ }
1800
+ function precisionAdd(a, b) {
1801
+ return fixPrecision$1(a + b, 10 ** Math.max(getDecimalPlaces(a), getDecimalPlaces(b)));
1802
+ }
1803
+ function precisionSub(a, b) {
1804
+ return fixPrecision$1(a - b, 10 ** Math.max(getDecimalPlaces(a), getDecimalPlaces(b)));
1805
+ }
1792
1806
 
1793
1807
  class Point {
1794
1808
  constructor(x = 0, y = 0, x1, y1) {
@@ -34217,25 +34231,25 @@
34217
34231
  if (record.isAggregator && this.children) {
34218
34232
  this.children.push(record);
34219
34233
  const value = record.value();
34220
- this.sum += value ?? 0;
34234
+ this.sum = precisionAdd(this.sum, value ?? 0);
34221
34235
  if (this.needSplitPositiveAndNegativeForSum) {
34222
34236
  if (value > 0) {
34223
- this.positiveSum += value;
34237
+ this.positiveSum = precisionAdd(this.positiveSum, value);
34224
34238
  }
34225
34239
  else if (value < 0) {
34226
- this.nagetiveSum += value;
34240
+ this.nagetiveSum = precisionAdd(this.nagetiveSum, value);
34227
34241
  }
34228
34242
  }
34229
34243
  }
34230
34244
  else if (this.field && !isNaN(parseFloat(record[this.field]))) {
34231
34245
  const value = parseFloat(record[this.field]);
34232
- this.sum += value;
34246
+ this.sum = precisionAdd(this.sum, value);
34233
34247
  if (this.needSplitPositiveAndNegativeForSum) {
34234
34248
  if (value > 0) {
34235
- this.positiveSum += value;
34249
+ this.positiveSum = precisionAdd(this.positiveSum, value);
34236
34250
  }
34237
34251
  else if (value < 0) {
34238
- this.nagetiveSum += value;
34252
+ this.nagetiveSum = precisionAdd(this.nagetiveSum, value);
34239
34253
  }
34240
34254
  }
34241
34255
  }
@@ -34245,30 +34259,36 @@
34245
34259
  deleteRecord(record) {
34246
34260
  if (record) {
34247
34261
  if (this.isRecord && this.records) {
34248
- this.records = this.records.filter(item => item !== record);
34262
+ const index = this.records.indexOf(record);
34263
+ if (index !== -1) {
34264
+ this.records.splice(index, 1);
34265
+ }
34249
34266
  }
34250
34267
  if (record.isAggregator && this.children) {
34251
- this.children = this.children.filter(item => item !== record);
34268
+ const index = this.children.indexOf(record);
34269
+ if (index !== -1) {
34270
+ this.children.splice(index, 1);
34271
+ }
34252
34272
  const value = record.value();
34253
- this.sum -= value ?? 0;
34273
+ this.sum = precisionSub(this.sum, value ?? 0);
34254
34274
  if (this.needSplitPositiveAndNegativeForSum) {
34255
34275
  if (value > 0) {
34256
- this.positiveSum -= value;
34276
+ this.positiveSum = precisionSub(this.positiveSum, value);
34257
34277
  }
34258
34278
  else if (value < 0) {
34259
- this.nagetiveSum -= value;
34279
+ this.nagetiveSum = precisionSub(this.nagetiveSum, value);
34260
34280
  }
34261
34281
  }
34262
34282
  }
34263
34283
  else if (this.field && !isNaN(parseFloat(record[this.field]))) {
34264
34284
  const value = parseFloat(record[this.field]);
34265
- this.sum -= value;
34285
+ this.sum = precisionSub(this.sum, value);
34266
34286
  if (this.needSplitPositiveAndNegativeForSum) {
34267
34287
  if (value > 0) {
34268
- this.positiveSum -= value;
34288
+ this.positiveSum = precisionSub(this.positiveSum, value);
34269
34289
  }
34270
34290
  else if (value < 0) {
34271
- this.nagetiveSum -= value;
34291
+ this.nagetiveSum = precisionSub(this.nagetiveSum, value);
34272
34292
  }
34273
34293
  }
34274
34294
  }
@@ -34278,50 +34298,50 @@
34278
34298
  updateRecord(oldRecord, newRecord) {
34279
34299
  if (oldRecord && newRecord) {
34280
34300
  if (this.isRecord && this.records) {
34281
- this.records = this.records.map(item => {
34282
- if (item === oldRecord) {
34283
- return newRecord;
34284
- }
34285
- return item;
34286
- });
34301
+ const index = this.records.indexOf(oldRecord);
34302
+ if (index !== -1) {
34303
+ this.records[index] = newRecord;
34304
+ }
34287
34305
  }
34288
34306
  if (oldRecord.isAggregator && this.children) {
34289
34307
  const oldValue = oldRecord.value();
34290
- this.children = this.children.filter(item => item !== oldRecord);
34308
+ const index = this.children.indexOf(oldRecord);
34309
+ if (index !== -1) {
34310
+ this.children[index] = newRecord;
34311
+ }
34291
34312
  const newValue = newRecord.value();
34292
- this.children.push(newRecord);
34293
- this.sum += newValue - oldValue;
34313
+ this.sum = precisionAdd(this.sum, precisionSub(newValue, oldValue));
34294
34314
  if (this.needSplitPositiveAndNegativeForSum) {
34295
34315
  if (oldValue > 0) {
34296
- this.positiveSum -= oldValue;
34316
+ this.positiveSum = precisionSub(this.positiveSum, oldValue);
34297
34317
  }
34298
34318
  else if (oldValue < 0) {
34299
- this.nagetiveSum -= oldValue;
34319
+ this.nagetiveSum = precisionSub(this.nagetiveSum, oldValue);
34300
34320
  }
34301
34321
  if (newValue > 0) {
34302
- this.positiveSum += newValue;
34322
+ this.positiveSum = precisionAdd(this.positiveSum, newValue);
34303
34323
  }
34304
34324
  else if (newValue < 0) {
34305
- this.nagetiveSum += newValue;
34325
+ this.nagetiveSum = precisionAdd(this.nagetiveSum, newValue);
34306
34326
  }
34307
34327
  }
34308
34328
  }
34309
34329
  else if (this.field && !isNaN(parseFloat(oldRecord[this.field]))) {
34310
34330
  const oldValue = parseFloat(oldRecord[this.field]);
34311
34331
  const newValue = parseFloat(newRecord[this.field]);
34312
- this.sum += newValue - oldValue;
34332
+ this.sum = precisionAdd(this.sum, precisionSub(newValue, oldValue));
34313
34333
  if (this.needSplitPositiveAndNegativeForSum) {
34314
34334
  if (oldValue > 0) {
34315
- this.positiveSum -= oldValue;
34335
+ this.positiveSum = precisionSub(this.positiveSum, oldValue);
34316
34336
  }
34317
34337
  else if (oldValue < 0) {
34318
- this.nagetiveSum -= oldValue;
34338
+ this.nagetiveSum = precisionSub(this.nagetiveSum, oldValue);
34319
34339
  }
34320
34340
  if (newValue > 0) {
34321
- this.positiveSum += newValue;
34341
+ this.positiveSum = precisionAdd(this.positiveSum, newValue);
34322
34342
  }
34323
34343
  else if (newValue < 0) {
34324
- this.nagetiveSum += newValue;
34344
+ this.nagetiveSum = precisionAdd(this.nagetiveSum, newValue);
34325
34345
  }
34326
34346
  }
34327
34347
  }
@@ -34329,7 +34349,8 @@
34329
34349
  }
34330
34350
  }
34331
34351
  value() {
34332
- return this.changedValue ?? (this.records?.length >= 1 ? this.sum : undefined);
34352
+ return (this.changedValue ??
34353
+ (this.records && this.records.length >= 1 ? this.sum : this.isRecord === false ? this.sum : undefined));
34333
34354
  }
34334
34355
  positiveValue() {
34335
34356
  return this.positiveSum;
@@ -34350,13 +34371,13 @@
34350
34371
  const child = this.children[i];
34351
34372
  if (child.isAggregator) {
34352
34373
  const value = child.value();
34353
- this.sum += value ?? 0;
34374
+ this.sum = precisionAdd(this.sum, value ?? 0);
34354
34375
  if (this.needSplitPositiveAndNegativeForSum) {
34355
34376
  if (value > 0) {
34356
- this.positiveSum += value;
34377
+ this.positiveSum = precisionAdd(this.positiveSum, value);
34357
34378
  }
34358
34379
  else if (value < 0) {
34359
- this.nagetiveSum += value;
34380
+ this.nagetiveSum = precisionAdd(this.nagetiveSum, value);
34360
34381
  }
34361
34382
  }
34362
34383
  }
@@ -34367,25 +34388,25 @@
34367
34388
  const record = this.records[i];
34368
34389
  if (record.isAggregator) {
34369
34390
  const value = record.value();
34370
- this.sum += value ?? 0;
34391
+ this.sum = precisionAdd(this.sum, value ?? 0);
34371
34392
  if (this.needSplitPositiveAndNegativeForSum) {
34372
34393
  if (value > 0) {
34373
- this.positiveSum += value;
34394
+ this.positiveSum = precisionAdd(this.positiveSum, value);
34374
34395
  }
34375
34396
  else if (value < 0) {
34376
- this.nagetiveSum += value;
34397
+ this.nagetiveSum = precisionAdd(this.nagetiveSum, value);
34377
34398
  }
34378
34399
  }
34379
34400
  }
34380
34401
  else if (this.field && !isNaN(parseFloat(record[this.field]))) {
34381
34402
  const value = parseFloat(record[this.field]);
34382
- this.sum += value;
34403
+ this.sum = precisionAdd(this.sum, value);
34383
34404
  if (this.needSplitPositiveAndNegativeForSum) {
34384
34405
  if (value > 0) {
34385
- this.positiveSum += value;
34406
+ this.positiveSum = precisionAdd(this.positiveSum, value);
34386
34407
  }
34387
34408
  else if (value < 0) {
34388
- this.nagetiveSum += value;
34409
+ this.nagetiveSum = precisionAdd(this.nagetiveSum, value);
34389
34410
  }
34390
34411
  }
34391
34412
  }
@@ -34513,11 +34534,11 @@
34513
34534
  if (this.children) {
34514
34535
  this.children.push(record);
34515
34536
  }
34516
- this.sum += record.sum;
34537
+ this.sum = precisionAdd(this.sum, record.sum);
34517
34538
  this.count += record.count;
34518
34539
  }
34519
34540
  else if (this.field && !isNaN(parseFloat(record[this.field]))) {
34520
- this.sum += parseFloat(record[this.field]);
34541
+ this.sum = precisionAdd(this.sum, parseFloat(record[this.field]));
34521
34542
  this.count++;
34522
34543
  }
34523
34544
  }
@@ -34526,17 +34547,23 @@
34526
34547
  deleteRecord(record) {
34527
34548
  if (record) {
34528
34549
  if (this.isRecord && this.records) {
34529
- this.records = this.records.filter(item => item !== record);
34550
+ const index = this.records.indexOf(record);
34551
+ if (index !== -1) {
34552
+ this.records.splice(index, 1);
34553
+ }
34530
34554
  }
34531
34555
  if (record.isAggregator && record.type === AggregationType.AVG) {
34532
34556
  if (this.children) {
34533
- this.children = this.children.filter(item => item !== record);
34557
+ const index = this.children.indexOf(record);
34558
+ if (index !== -1) {
34559
+ this.children.splice(index, 1);
34560
+ }
34534
34561
  }
34535
- this.sum -= record.sum;
34562
+ this.sum = precisionSub(this.sum, record.sum);
34536
34563
  this.count -= record.count;
34537
34564
  }
34538
34565
  else if (this.field && !isNaN(parseFloat(record[this.field]))) {
34539
- this.sum -= parseFloat(record[this.field]);
34566
+ this.sum = precisionSub(this.sum, parseFloat(record[this.field]));
34540
34567
  this.count--;
34541
34568
  }
34542
34569
  }
@@ -34545,33 +34572,34 @@
34545
34572
  updateRecord(oldRecord, newRecord) {
34546
34573
  if (oldRecord && newRecord) {
34547
34574
  if (this.isRecord && this.records) {
34548
- this.records = this.records.map(item => {
34549
- if (item === oldRecord) {
34550
- return newRecord;
34551
- }
34552
- return item;
34553
- });
34575
+ const index = this.records.indexOf(oldRecord);
34576
+ if (index !== -1) {
34577
+ this.records[index] = newRecord;
34578
+ }
34554
34579
  }
34555
34580
  if (oldRecord.isAggregator && oldRecord.type === AggregationType.AVG) {
34556
34581
  if (this.children && newRecord.isAggregator) {
34557
- this.children = this.children.map(item => {
34558
- if (item === oldRecord) {
34559
- return newRecord;
34560
- }
34561
- return item;
34562
- });
34582
+ const index = this.children.indexOf(oldRecord);
34583
+ if (index !== -1) {
34584
+ this.children[index] = newRecord;
34585
+ }
34563
34586
  }
34564
- this.sum += newRecord.sum - oldRecord.sum;
34587
+ this.sum = precisionAdd(this.sum, precisionSub(newRecord.sum, oldRecord.sum));
34565
34588
  this.count += newRecord.count - oldRecord.count;
34566
34589
  }
34567
34590
  else if (this.field && !isNaN(parseFloat(oldRecord[this.field]))) {
34568
- this.sum += parseFloat(newRecord[this.field]) - parseFloat(oldRecord[this.field]);
34591
+ this.sum = precisionAdd(this.sum, precisionSub(parseFloat(newRecord[this.field]), parseFloat(oldRecord[this.field])));
34569
34592
  }
34570
34593
  this.clearCacheValue();
34571
34594
  }
34572
34595
  }
34573
34596
  value() {
34574
- return this.changedValue ?? (this.records?.length >= 1 ? this.sum / this.count : undefined);
34597
+ return (this.changedValue ??
34598
+ (this.records && this.records.length >= 1
34599
+ ? this.sum / this.count
34600
+ : this.isRecord === false && this.count > 0
34601
+ ? this.sum / this.count
34602
+ : undefined));
34575
34603
  }
34576
34604
  reset() {
34577
34605
  this.changedValue = undefined;
@@ -34589,7 +34617,7 @@
34589
34617
  const child = this.children[i];
34590
34618
  if (child.isAggregator && child.type === AggregationType.AVG) {
34591
34619
  const childValue = child.value();
34592
- this.sum += childValue * child.count;
34620
+ this.sum = precisionAdd(this.sum, childValue * child.count);
34593
34621
  this.count += child.count;
34594
34622
  }
34595
34623
  }
@@ -34598,11 +34626,11 @@
34598
34626
  for (let i = 0; i < this.records.length; i++) {
34599
34627
  const record = this.records[i];
34600
34628
  if (record.isAggregator && record.type === AggregationType.AVG) {
34601
- this.sum += record.sum;
34629
+ this.sum = precisionAdd(this.sum, record.sum);
34602
34630
  this.count += record.count;
34603
34631
  }
34604
34632
  else if (this.field && !isNaN(parseFloat(record[this.field]))) {
34605
- this.sum += parseFloat(record[this.field]);
34633
+ this.sum = precisionAdd(this.sum, parseFloat(record[this.field]));
34606
34634
  this.count++;
34607
34635
  }
34608
34636
  }
@@ -45727,8 +45755,7 @@
45727
45755
  }
45728
45756
  else if (type === 'checkbox') {
45729
45757
  const isAggregation = 'isAggregation' in table.internalProps.layoutMap && table.internalProps.layoutMap.isAggregation(col, row);
45730
- const isSeriesNumber = table.internalProps.layoutMap.isSeriesNumber(col, row);
45731
- if (isAggregation && isSeriesNumber) {
45758
+ if (isAggregation) {
45732
45759
  const createTextCellGroup = Factory.getFunction('createTextCellGroup');
45733
45760
  cellGroup = createTextCellGroup(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, false, undefined, true, cellTheme, range, isAsync);
45734
45761
  }
@@ -45738,8 +45765,15 @@
45738
45765
  }
45739
45766
  }
45740
45767
  else if (type === 'radio') {
45741
- const createRadioCellGroup = Factory.getFunction('createRadioCellGroup');
45742
- cellGroup = createRadioCellGroup(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, table, cellTheme, define, range);
45768
+ const isAggregation = 'isAggregation' in table.internalProps.layoutMap && table.internalProps.layoutMap.isAggregation(col, row);
45769
+ if (isAggregation) {
45770
+ const createTextCellGroup = Factory.getFunction('createTextCellGroup');
45771
+ cellGroup = createTextCellGroup(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, false, undefined, true, cellTheme, range, isAsync);
45772
+ }
45773
+ else {
45774
+ const createRadioCellGroup = Factory.getFunction('createRadioCellGroup');
45775
+ cellGroup = createRadioCellGroup(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, table, cellTheme, define, range);
45776
+ }
45743
45777
  }
45744
45778
  else if (type === 'switch') {
45745
45779
  const createSwitchCellGroup = Factory.getFunction('createSwitchCellGroup');
@@ -61176,6 +61210,10 @@
61176
61210
  }
61177
61211
  else if ((interactionState === InteractionState.grabing || table.eventManager.isDraging) &&
61178
61212
  !table.stateManager.isResizeCol()) {
61213
+ if (col >= 0 && row >= 0 && isCellDisableSelect(table, col, row)) {
61214
+ scenegraph.updateNextFrame();
61215
+ return;
61216
+ }
61179
61217
  let extendSelectRange = isValid$1(skipBodyMerge) ? !skipBodyMerge : true;
61180
61218
  if (cellPos.col === -1) {
61181
61219
  cellPos.col = col;
@@ -62917,7 +62955,21 @@
62917
62955
  this.setSelectState();
62918
62956
  this.setFrozenState();
62919
62957
  }
62958
+ endResizeIfResizing() {
62959
+ if (this.columnResize.resizing) {
62960
+ this.table.scenegraph.component.hideResizeCol();
62961
+ this.columnResize.resizing = false;
62962
+ }
62963
+ if (this.rowResize.resizing) {
62964
+ this.table.scenegraph.component.hideResizeRow();
62965
+ this.rowResize.resizing = false;
62966
+ }
62967
+ if (this.interactionState === InteractionState.grabing) {
62968
+ this.interactionState = InteractionState.default;
62969
+ }
62970
+ }
62920
62971
  _updateOptionSetState() {
62972
+ this.endResizeIfResizing();
62921
62973
  this.interactionState = InteractionState.default;
62922
62974
  this.hoverIcon = {
62923
62975
  col: -1,
@@ -64883,12 +64935,14 @@
64883
64935
  stateManager.updateInteractionState(InteractionState.default);
64884
64936
  stateManager.updateCursor();
64885
64937
  }
64886
- if ((table.theme.scrollStyle.horizontalVisible && table.theme.scrollStyle.horizontalVisible === 'focus') ||
64887
- (!table.theme.scrollStyle.horizontalVisible && table.theme.scrollStyle.visible === 'focus')) {
64938
+ const scrollStyle = table.theme.scrollStyle;
64939
+ const horizontalVisible = scrollStyle?.horizontalVisible ?? scrollStyle?.visible;
64940
+ const verticalVisible = scrollStyle?.verticalVisible ?? scrollStyle?.visible;
64941
+ const barToSide = scrollStyle?.barToSide ?? false;
64942
+ if (!barToSide && horizontalVisible === 'focus') {
64888
64943
  stateManager.hideHorizontalScrollBar();
64889
64944
  }
64890
- if ((table.theme.scrollStyle.verticalVisible && table.theme.scrollStyle.verticalVisible === 'focus') ||
64891
- (!table.theme.scrollStyle.verticalVisible && table.theme.scrollStyle.visible === 'focus')) {
64945
+ if (!barToSide && verticalVisible === 'focus') {
64892
64946
  stateManager.hideVerticalScrollBar();
64893
64947
  }
64894
64948
  if (table.hasListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL)) {
@@ -65304,6 +65358,52 @@
65304
65358
  stateManager.endSelectCells();
65305
65359
  }
65306
65360
  });
65361
+ const scrollStyle = table.theme.scrollStyle;
65362
+ const barToSide = scrollStyle?.barToSide ?? false;
65363
+ const horizontalVisible = scrollStyle?.horizontalVisible ?? scrollStyle?.visible;
65364
+ const verticalVisible = scrollStyle?.verticalVisible ?? scrollStyle?.visible;
65365
+ const shouldShowScrollOnCanvasHover = barToSide && horizontalVisible === 'focus';
65366
+ const shouldShowVScrollOnCanvasHover = barToSide && verticalVisible === 'focus';
65367
+ if (shouldShowScrollOnCanvasHover || shouldShowVScrollOnCanvasHover) {
65368
+ table.scenegraph.stage.addEventListener('pointerenter', (e) => {
65369
+ const target = e.target;
65370
+ const isEventFromCurrentTableCanvas = target === table.scenegraph.stage || target?.isDescendantsOf?.(table.scenegraph.stage);
65371
+ if (!isEventFromCurrentTableCanvas) {
65372
+ return;
65373
+ }
65374
+ if (shouldShowScrollOnCanvasHover) {
65375
+ const relativeX = e.x - table.tableX;
65376
+ const target = table.options.scrollFrozenCols &&
65377
+ table.getFrozenColsOffset?.() > 0 &&
65378
+ relativeX >= 0 &&
65379
+ relativeX < table.getFrozenColsWidth()
65380
+ ? 'frozen'
65381
+ : table.options.scrollRightFrozenCols &&
65382
+ table.getRightFrozenColsOffset?.() > 0 &&
65383
+ relativeX > table.tableNoFrameWidth - table.getRightFrozenColsWidth()
65384
+ ? 'rightFrozen'
65385
+ : 'body';
65386
+ stateManager.showHorizontalScrollBar(false, target);
65387
+ }
65388
+ if (shouldShowVScrollOnCanvasHover) {
65389
+ stateManager.showVerticalScrollBar();
65390
+ }
65391
+ });
65392
+ table.scenegraph.stage.addEventListener('pointerleave', (e) => {
65393
+ const relatedTarget = e.relatedTarget;
65394
+ const isLeavingCanvas = !relatedTarget ||
65395
+ (relatedTarget !== table.scenegraph.stage && !relatedTarget.isDescendantsOf?.(table.scenegraph.stage));
65396
+ if (!isLeavingCanvas) {
65397
+ return;
65398
+ }
65399
+ if (shouldShowScrollOnCanvasHover) {
65400
+ stateManager.hideHorizontalScrollBar();
65401
+ }
65402
+ if (shouldShowVScrollOnCanvasHover) {
65403
+ stateManager.hideVerticalScrollBar();
65404
+ }
65405
+ });
65406
+ }
65307
65407
  table.scenegraph.stage.addEventListener('pointermove', (e) => {
65308
65408
  const eventArgsSet = getCellEventArgsSetWithTable(e, table);
65309
65409
  const isEventFromCurrentTable = e.target?.isDescendantsOf?.(table.scenegraph.tableGroup) ?? false;
@@ -66389,6 +66489,9 @@
66389
66489
  const targetCol = table.getTargetColAtConsiderRightFrozen(selectX, considerFrozenX);
66390
66490
  const targetRow = table.getTargetRowAtConsiderBottomFrozen(selectY, considerFrozenY);
66391
66491
  if (!table.options.select?.disableDragSelect && isValid$1(targetCol) && isValid$1(targetRow)) {
66492
+ if (isCellDisableSelect(table, targetCol.col, targetRow.row)) {
66493
+ return;
66494
+ }
66392
66495
  table.stateManager.updateSelectPos(table.stateManager.select.selectInline === 'row' ? table.colCount - 1 : targetCol.col, table.stateManager.select.selectInline === 'col' ? table.rowCount - 1 : targetRow.row, false, false, false, false);
66393
66496
  }
66394
66497
  });
@@ -69627,6 +69730,8 @@
69627
69730
  return TextHeaderStyle;
69628
69731
  case 'checkbox':
69629
69732
  return CheckboxStyle;
69733
+ default:
69734
+ return TextHeaderStyle;
69630
69735
  }
69631
69736
  }
69632
69737
  setTableColumnsEditor() {
@@ -71857,7 +71962,7 @@
71857
71962
  return TABLE_EVENT_TYPE;
71858
71963
  }
71859
71964
  options;
71860
- version = "1.25.1-alpha.1";
71965
+ version = "1.26.1-alpha.0";
71861
71966
  pagination;
71862
71967
  id = `VTable${Date.now()}`;
71863
71968
  headerStyleCache;
@@ -74206,7 +74311,8 @@
74206
74311
  getCellType(col, row) {
74207
74312
  let cellType;
74208
74313
  if (this.isSeriesNumberInHeader(col, row)) {
74209
- return this.internalProps.layoutMap.getSeriesNumberHeader(col, row).cellType;
74314
+ const seriesHeaderCellType = this.internalProps.layoutMap.getSeriesNumberHeader(col, row).cellType;
74315
+ return seriesHeaderCellType === 'radio' ? 'text' : seriesHeaderCellType;
74210
74316
  }
74211
74317
  else if (this.isHeader(col, row)) {
74212
74318
  cellType = this.internalProps.layoutMap.getHeader(col, row).headerType;
@@ -80507,6 +80613,7 @@
80507
80613
  this.setCellCheckboxState(col, row, checked);
80508
80614
  }
80509
80615
  setRecords(records, option) {
80616
+ this.stateManager.endResizeIfResizing();
80510
80617
  clearChartRenderQueue();
80511
80618
  this.internalProps.dataSource?.release();
80512
80619
  this.internalProps.releaseList = this.internalProps.releaseList?.filter((item) => !item.dataSourceObj);
@@ -93602,6 +93709,7 @@
93602
93709
  for (let i = 0; i < sortRules.length; i++) {
93603
93710
  const sortRule = sortRules[i];
93604
93711
  const dimensions = [];
93712
+ const sortType = sortRule.sortType ? sortRule.sortType.toUpperCase() : 'ASC';
93605
93713
  if (sortRule.sortByIndicator &&
93606
93714
  sortRule.sortField ===
93607
93715
  (this.dataset.indicatorsAsCol
@@ -93618,19 +93726,58 @@
93618
93726
  value: this.internalProps.layoutMap.getIndicatorInfo(sortRule.sortByIndicator)?.title ??
93619
93727
  sortRule.sortByIndicator
93620
93728
  });
93729
+ this.pivotSortState.push({
93730
+ dimensions,
93731
+ order: SortType[sortType]
93732
+ });
93621
93733
  }
93622
93734
  else {
93623
- dimensions.push({
93624
- dimensionKey: sortRule.sortField,
93625
- isPivotCorner: true,
93626
- value: sortRule.sortField
93627
- });
93735
+ const sortField = sortRule.sortField;
93736
+ const rowIndex = this.dataset.rows.indexOf(sortField);
93737
+ const colIndex = this.dataset.columns.indexOf(sortField);
93738
+ let pushed = false;
93739
+ if (rowIndex >= 0) {
93740
+ const rowDimensions = [];
93741
+ for (let k = 0; k <= rowIndex; k++) {
93742
+ rowDimensions.push({
93743
+ dimensionKey: this.dataset.rows[k],
93744
+ isPivotCorner: true,
93745
+ value: this.dataset.rows[k]
93746
+ });
93747
+ }
93748
+ this.pivotSortState.push({
93749
+ dimensions: rowDimensions,
93750
+ order: SortType[sortType]
93751
+ });
93752
+ pushed = true;
93753
+ }
93754
+ if (colIndex >= 0) {
93755
+ const colDimensions = [];
93756
+ for (let k = 0; k <= colIndex; k++) {
93757
+ colDimensions.push({
93758
+ dimensionKey: this.dataset.columns[k],
93759
+ isPivotCorner: true,
93760
+ value: this.dataset.columns[k]
93761
+ });
93762
+ }
93763
+ this.pivotSortState.push({
93764
+ dimensions: colDimensions,
93765
+ order: SortType[sortType]
93766
+ });
93767
+ pushed = true;
93768
+ }
93769
+ if (!pushed) {
93770
+ dimensions.push({
93771
+ dimensionKey: sortField,
93772
+ isPivotCorner: true,
93773
+ value: sortField
93774
+ });
93775
+ this.pivotSortState.push({
93776
+ dimensions,
93777
+ order: SortType[sortType]
93778
+ });
93779
+ }
93628
93780
  }
93629
- const sortType = sortRule.sortType ? sortRule.sortType.toUpperCase() : 'ASC';
93630
- this.pivotSortState.push({
93631
- dimensions,
93632
- order: SortType[sortType]
93633
- });
93634
93781
  }
93635
93782
  }
93636
93783
  _filterHideIndicatorNode() {
@@ -93745,6 +93892,63 @@
93745
93892
  for (let i = 0; i < this.pivotSortState.length; i++) {
93746
93893
  const pivotState = this.pivotSortState[i];
93747
93894
  const dimensions = pivotState.dimensions;
93895
+ if (this.isCornerHeader(col, row)) {
93896
+ const layoutMap = this.internalProps.layoutMap;
93897
+ const header = layoutMap.getHeader(col, row);
93898
+ if (header && header.pivotInfo && dimensions && dimensions.length > 0) {
93899
+ let cellPathKeys = [];
93900
+ const leftSnCount = layoutMap.leftRowSeriesNumberColumnCount ?? 0;
93901
+ if (layoutMap.cornerSetting.titleOnDimension === 'row') {
93902
+ const dimIndex = col - leftSnCount;
93903
+ cellPathKeys = layoutMap.rowDimensionKeys.slice(0, dimIndex + 1);
93904
+ }
93905
+ else if (layoutMap.cornerSetting.titleOnDimension === 'column') {
93906
+ const dimIndex = row;
93907
+ cellPathKeys = layoutMap.colDimensionKeys.slice(0, dimIndex + 1);
93908
+ }
93909
+ else if (layoutMap.cornerSetting.titleOnDimension === 'all') {
93910
+ if (layoutMap.indicatorsAsCol) {
93911
+ let indicatorAtIndex = layoutMap.colDimensionKeys.indexOf(layoutMap.indicatorDimensionKey);
93912
+ if (indicatorAtIndex === -1) {
93913
+ indicatorAtIndex = layoutMap.columnHeaderLevelCount - 1;
93914
+ }
93915
+ if (row === indicatorAtIndex) {
93916
+ const dimIndex = col - leftSnCount;
93917
+ cellPathKeys = layoutMap.rowDimensionKeys.slice(0, dimIndex + 1);
93918
+ }
93919
+ else {
93920
+ const dimIndex = row;
93921
+ cellPathKeys = layoutMap.colDimensionKeys.slice(0, dimIndex + 1);
93922
+ }
93923
+ }
93924
+ else {
93925
+ let indicatorAtIndex = layoutMap.rowDimensionKeys.indexOf(layoutMap.indicatorDimensionKey);
93926
+ if (indicatorAtIndex === -1) {
93927
+ indicatorAtIndex = layoutMap.rowHeaderLevelCount - 1;
93928
+ }
93929
+ if (col - leftSnCount === indicatorAtIndex) {
93930
+ const dimIndex = row;
93931
+ cellPathKeys = layoutMap.colDimensionKeys.slice(0, dimIndex + 1);
93932
+ }
93933
+ else {
93934
+ const dimIndex = col - leftSnCount;
93935
+ cellPathKeys = layoutMap.rowDimensionKeys.slice(0, dimIndex + 1);
93936
+ }
93937
+ }
93938
+ }
93939
+ if (cellPathKeys.length > 0 && dimensions.length === cellPathKeys.length) {
93940
+ const isMatch = dimensions.every((dim, idx) => {
93941
+ const isCorner = dim.isPivotCorner || (!isValid$1(dim.isPivotCorner) && dim.dimensionKey && !dim.value);
93942
+ const keyMatch = dim.dimensionKey === cellPathKeys[idx] || dim.value === cellPathKeys[idx];
93943
+ return isCorner && keyMatch;
93944
+ });
93945
+ if (isMatch) {
93946
+ return pivotState.order;
93947
+ }
93948
+ }
93949
+ }
93950
+ continue;
93951
+ }
93748
93952
  const cell = this.getCellAddressByHeaderPaths(dimensions);
93749
93953
  const order = pivotState.order;
93750
93954
  if (cell && cellInRange(cellRange, cell.col, cell.row)) {
@@ -93921,6 +94125,7 @@
93921
94125
  return result;
93922
94126
  }
93923
94127
  setRecords(records) {
94128
+ this.stateManager.endResizeIfResizing();
93924
94129
  clearChartRenderQueue();
93925
94130
  const oldHoverState = { col: this.stateManager.hover.cellPos.col, row: this.stateManager.hover.cellPos.row };
93926
94131
  this.options.records = this.internalProps.records = records;
@@ -95647,6 +95852,7 @@
95647
95852
  return undefined;
95648
95853
  }
95649
95854
  setRecords(records) {
95855
+ this.stateManager.endResizeIfResizing();
95650
95856
  this.internalProps.layoutMap.release();
95651
95857
  clearChartRenderQueue();
95652
95858
  this.scenegraph.updateChartState(null, undefined);
@@ -96329,7 +96535,7 @@
96329
96535
  }
96330
96536
 
96331
96537
  registerForVrender();
96332
- const version = "1.25.1-alpha.1";
96538
+ const version = "1.26.1-alpha.0";
96333
96539
  function getIcons() {
96334
96540
  return get$2();
96335
96541
  }