@visactor/vtable 1.3.3-alpha.2 → 1.3.3

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 (71) hide show
  1. package/cjs/core/BaseTable.d.ts +5 -25
  2. package/cjs/core/BaseTable.js +1 -1
  3. package/cjs/core/BaseTable.js.map +1 -1
  4. package/cjs/data/DataSource.d.ts +1 -6
  5. package/cjs/data/DataSource.js +2 -12
  6. package/cjs/data/DataSource.js.map +1 -1
  7. package/cjs/dataset/dataset.d.ts +2 -15
  8. package/cjs/dataset/dataset.js +67 -170
  9. package/cjs/dataset/dataset.js.map +1 -1
  10. package/cjs/dataset/statistics-helper.d.ts +3 -43
  11. package/cjs/dataset/statistics-helper.js +26 -61
  12. package/cjs/dataset/statistics-helper.js.map +1 -1
  13. package/cjs/index.d.ts +1 -1
  14. package/cjs/index.js +2 -2
  15. package/cjs/index.js.map +1 -1
  16. package/cjs/scenegraph/group-creater/progress/proxy.d.ts +3 -2
  17. package/cjs/scenegraph/group-creater/progress/proxy.js +10 -10
  18. package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
  19. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.d.ts +2 -1
  20. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +2 -3
  21. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  22. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.d.ts +3 -2
  23. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +15 -14
  24. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
  25. package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.js +7 -5
  26. package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -1
  27. package/cjs/ts-types/base-table.d.ts +5 -25
  28. package/cjs/ts-types/base-table.js.map +1 -1
  29. package/cjs/ts-types/new-data-set.d.ts +1 -9
  30. package/cjs/ts-types/new-data-set.js +1 -1
  31. package/cjs/ts-types/new-data-set.js.map +1 -1
  32. package/cjs/ts-types/table-engine.d.ts +12 -0
  33. package/cjs/ts-types/table-engine.js.map +1 -1
  34. package/cjs/vrender.js.map +1 -1
  35. package/dist/vtable.js +211 -445
  36. package/dist/vtable.min.js +2 -2
  37. package/es/core/BaseTable.d.ts +5 -25
  38. package/es/core/BaseTable.js +1 -1
  39. package/es/core/BaseTable.js.map +1 -1
  40. package/es/data/DataSource.d.ts +1 -6
  41. package/es/data/DataSource.js +2 -12
  42. package/es/data/DataSource.js.map +1 -1
  43. package/es/dataset/dataset.d.ts +2 -15
  44. package/es/dataset/dataset.js +68 -170
  45. package/es/dataset/dataset.js.map +1 -1
  46. package/es/dataset/statistics-helper.d.ts +3 -43
  47. package/es/dataset/statistics-helper.js +23 -55
  48. package/es/dataset/statistics-helper.js.map +1 -1
  49. package/es/index.d.ts +1 -1
  50. package/es/index.js +1 -1
  51. package/es/index.js.map +1 -1
  52. package/es/scenegraph/group-creater/progress/proxy.d.ts +3 -2
  53. package/es/scenegraph/group-creater/progress/proxy.js +10 -10
  54. package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
  55. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.d.ts +2 -1
  56. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +2 -3
  57. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  58. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.d.ts +3 -2
  59. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +15 -13
  60. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
  61. package/es/scenegraph/group-creater/progress/update-position/update-auto-row.js +7 -5
  62. package/es/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -1
  63. package/es/ts-types/base-table.d.ts +5 -25
  64. package/es/ts-types/base-table.js.map +1 -1
  65. package/es/ts-types/new-data-set.d.ts +1 -9
  66. package/es/ts-types/new-data-set.js +1 -1
  67. package/es/ts-types/new-data-set.js.map +1 -1
  68. package/es/ts-types/table-engine.d.ts +12 -0
  69. package/es/ts-types/table-engine.js.map +1 -1
  70. package/es/vrender.js.map +1 -1
  71. package/package.json +5 -5
package/dist/vtable.js CHANGED
@@ -21976,7 +21976,6 @@
21976
21976
  AggregationType["AVG"] = "AVG";
21977
21977
  AggregationType["COUNT"] = "COUNT";
21978
21978
  AggregationType["CUSTOM"] = "CUSTOM";
21979
- AggregationType["RECALCULATE"] = "RECALCULATE";
21980
21979
  })(AggregationType || (AggregationType = {}));
21981
21980
  var SortType;
21982
21981
  (function (SortType) {
@@ -32872,15 +32871,13 @@
32872
32871
  isRecord = true;
32873
32872
  records = [];
32874
32873
  type;
32875
- key;
32876
32874
  field;
32877
32875
  formatFun;
32878
32876
  _formatedValue;
32879
- constructor(config) {
32880
- this.key = config.key;
32881
- this.field = config.dimension;
32882
- this.formatFun = config.formatFun;
32883
- this.isRecord = config.isRecord ?? this.isRecord;
32877
+ constructor(dimension, formatFun, isRecord) {
32878
+ this.field = dimension;
32879
+ this.formatFun = formatFun;
32880
+ this.isRecord = isRecord ?? this.isRecord;
32884
32881
  }
32885
32882
  clearCacheValue() {
32886
32883
  this._formatedValue = undefined;
@@ -32904,7 +32901,7 @@
32904
32901
  type = AggregationType.RECORD;
32905
32902
  isRecord = true;
32906
32903
  push(record) {
32907
- if (record && this.isRecord && this.records) {
32904
+ if (this.isRecord && this.records) {
32908
32905
  if (record.className === 'Aggregator') {
32909
32906
  this.records.push(...record.records);
32910
32907
  }
@@ -32927,13 +32924,11 @@
32927
32924
  isRecord = true;
32928
32925
  fieldValue;
32929
32926
  push(record) {
32930
- if (record) {
32931
- if (this.isRecord) {
32932
- this.records = [record];
32933
- }
32934
- if (this.field) {
32935
- this.fieldValue = record[this.field];
32936
- }
32927
+ if (this.isRecord) {
32928
+ this.records = [record];
32929
+ }
32930
+ if (this.field) {
32931
+ this.fieldValue = record[this.field];
32937
32932
  }
32938
32933
  }
32939
32934
  value() {
@@ -32952,53 +32947,12 @@
32952
32947
  aggregationFun;
32953
32948
  values = [];
32954
32949
  fieldValue;
32955
- constructor(config) {
32956
- super(config);
32957
- this.aggregationFun = config.aggregationFun;
32958
- }
32959
- push(record) {
32960
- if (record) {
32961
- if (this.isRecord && this.records) {
32962
- if (record.className === 'Aggregator') {
32963
- this.records.push(...record.records);
32964
- }
32965
- else {
32966
- this.records.push(record);
32967
- }
32968
- }
32969
- if (this.field) {
32970
- this.values.push(record[this.field]);
32971
- }
32972
- }
32973
- }
32974
- value() {
32975
- if (!this.fieldValue) {
32976
- this.fieldValue = this.aggregationFun?.(this.values, this.records, this.field);
32977
- }
32978
- return this.fieldValue;
32979
- }
32980
- reset() {
32981
- this.records = [];
32982
- this.fieldValue = undefined;
32983
- }
32984
- recalculate() {
32985
- }
32986
- }
32987
- class RecalculateAggregator extends Aggregator {
32988
- type = AggregationType.RECALCULATE;
32989
- isRecord = true;
32990
- calculateFun;
32991
- fieldValue;
32992
- dependAggregators;
32993
- dependIndicatorKeys;
32994
- constructor(config) {
32995
- super(config);
32996
- this.calculateFun = config.calculateFun;
32997
- this.dependAggregators = config.dependAggregators;
32998
- this.dependIndicatorKeys = config.dependIndicatorKeys;
32950
+ constructor(dimension, formatFun, isRecord, aggregationFun) {
32951
+ super(dimension, formatFun, isRecord);
32952
+ this.aggregationFun = aggregationFun;
32999
32953
  }
33000
32954
  push(record) {
33001
- if (record && this.isRecord && this.records) {
32955
+ if (this.isRecord && this.records) {
33002
32956
  if (record.className === 'Aggregator') {
33003
32957
  this.records.push(...record.records);
33004
32958
  }
@@ -33006,11 +32960,13 @@
33006
32960
  this.records.push(record);
33007
32961
  }
33008
32962
  }
32963
+ if (this.field) {
32964
+ this.values.push(record[this.field]);
32965
+ }
33009
32966
  }
33010
32967
  value() {
33011
32968
  if (!this.fieldValue) {
33012
- const aggregatorValue = _getDependAggregatorValues(this.dependAggregators, this.dependIndicatorKeys);
33013
- this.fieldValue = this.calculateFun?.(aggregatorValue, this.records, this.field);
32969
+ this.fieldValue = this.aggregationFun?.(this.values, this.records, this.field);
33014
32970
  }
33015
32971
  return this.fieldValue;
33016
32972
  }
@@ -33027,42 +32983,40 @@
33027
32983
  positiveSum = 0;
33028
32984
  nagetiveSum = 0;
33029
32985
  needSplitPositiveAndNegativeForSum = false;
33030
- constructor(config) {
33031
- super(config);
33032
- this.needSplitPositiveAndNegativeForSum = config.needSplitPositiveAndNegative ?? false;
32986
+ constructor(dimension, formatFun, isRecord, needSplitPositiveAndNegative) {
32987
+ super(dimension, formatFun, isRecord);
32988
+ this.needSplitPositiveAndNegativeForSum = needSplitPositiveAndNegative ?? false;
33033
32989
  }
33034
32990
  push(record) {
33035
- if (record) {
33036
- if (this.isRecord && this.records) {
33037
- if (record.className === 'Aggregator') {
33038
- this.records.push(...record.records);
32991
+ if (this.isRecord && this.records) {
32992
+ if (record.className === 'Aggregator') {
32993
+ this.records.push(...record.records);
32994
+ }
32995
+ else {
32996
+ this.records.push(record);
32997
+ }
32998
+ }
32999
+ if (record.className === 'Aggregator') {
33000
+ const value = record.value();
33001
+ this.sum += value;
33002
+ if (this.needSplitPositiveAndNegativeForSum) {
33003
+ if (value > 0) {
33004
+ this.positiveSum += value;
33039
33005
  }
33040
- else {
33041
- this.records.push(record);
33006
+ else if (value < 0) {
33007
+ this.nagetiveSum += value;
33042
33008
  }
33043
33009
  }
33044
- if (record.className === 'Aggregator') {
33045
- const value = record.value();
33046
- this.sum += value;
33047
- if (this.needSplitPositiveAndNegativeForSum) {
33048
- if (value > 0) {
33049
- this.positiveSum += value;
33050
- }
33051
- else if (value < 0) {
33052
- this.nagetiveSum += value;
33053
- }
33010
+ }
33011
+ else if (this.field && !isNaN(parseFloat(record[this.field]))) {
33012
+ const value = parseFloat(record[this.field]);
33013
+ this.sum += value;
33014
+ if (this.needSplitPositiveAndNegativeForSum) {
33015
+ if (value > 0) {
33016
+ this.positiveSum += value;
33054
33017
  }
33055
- }
33056
- else if (this.field && !isNaN(parseFloat(record[this.field]))) {
33057
- const value = parseFloat(record[this.field]);
33058
- this.sum += value;
33059
- if (this.needSplitPositiveAndNegativeForSum) {
33060
- if (value > 0) {
33061
- this.positiveSum += value;
33062
- }
33063
- else if (value < 0) {
33064
- this.nagetiveSum += value;
33065
- }
33018
+ else if (value < 0) {
33019
+ this.nagetiveSum += value;
33066
33020
  }
33067
33021
  }
33068
33022
  }
@@ -33118,22 +33072,20 @@
33118
33072
  type = AggregationType.COUNT;
33119
33073
  count = 0;
33120
33074
  push(record) {
33121
- if (record) {
33122
- if (this.isRecord && this.records) {
33123
- if (record.className === 'Aggregator') {
33124
- this.records.push(...record.records);
33125
- }
33126
- else {
33127
- this.records.push(record);
33128
- }
33129
- }
33075
+ if (this.isRecord && this.records) {
33130
33076
  if (record.className === 'Aggregator') {
33131
- this.count += record.value();
33077
+ this.records.push(...record.records);
33132
33078
  }
33133
33079
  else {
33134
- this.count++;
33080
+ this.records.push(record);
33135
33081
  }
33136
33082
  }
33083
+ if (record.className === 'Aggregator') {
33084
+ this.count += record.value();
33085
+ }
33086
+ else {
33087
+ this.count++;
33088
+ }
33137
33089
  }
33138
33090
  value() {
33139
33091
  return this.count;
@@ -33163,24 +33115,22 @@
33163
33115
  sum = 0;
33164
33116
  count = 0;
33165
33117
  push(record) {
33166
- if (record) {
33167
- if (this.isRecord && this.records) {
33168
- if (record.className === 'Aggregator') {
33169
- this.records.push(...record.records);
33170
- }
33171
- else {
33172
- this.records.push(record);
33173
- }
33174
- }
33175
- if (record.className === 'Aggregator' && record.type === AggregationType.AVG) {
33176
- this.sum += record.sum;
33177
- this.count += record.count;
33118
+ if (this.isRecord && this.records) {
33119
+ if (record.className === 'Aggregator') {
33120
+ this.records.push(...record.records);
33178
33121
  }
33179
- else if (this.field && !isNaN(parseFloat(record[this.field]))) {
33180
- this.sum += parseFloat(record[this.field]);
33181
- this.count++;
33122
+ else {
33123
+ this.records.push(record);
33182
33124
  }
33183
33125
  }
33126
+ if (record.className === 'Aggregator' && record.type === AggregationType.AVG) {
33127
+ this.sum += record.sum;
33128
+ this.count += record.count;
33129
+ }
33130
+ else if (this.field && !isNaN(parseFloat(record[this.field]))) {
33131
+ this.sum += parseFloat(record[this.field]);
33132
+ this.count++;
33133
+ }
33184
33134
  }
33185
33135
  value() {
33186
33136
  return this.sum / this.count;
@@ -33213,28 +33163,26 @@
33213
33163
  type = AggregationType.MAX;
33214
33164
  max = Number.MIN_SAFE_INTEGER;
33215
33165
  push(record) {
33216
- if (record) {
33217
- if (this.isRecord && this.records) {
33218
- if (record.className === 'Aggregator') {
33219
- this.records.push(...record.records);
33220
- }
33221
- else {
33222
- this.records.push(record);
33223
- }
33224
- }
33166
+ if (this.isRecord && this.records) {
33225
33167
  if (record.className === 'Aggregator') {
33226
- this.max = record.max > this.max ? record.max : this.max;
33227
- }
33228
- else if (typeof record === 'number') {
33229
- this.max = record > this.max ? record : this.max;
33230
- }
33231
- else if (this.field && typeof record[this.field] === 'number') {
33232
- this.max = record[this.field] > this.max ? record[this.field] : this.max;
33168
+ this.records.push(...record.records);
33233
33169
  }
33234
- else if (this.field && !isNaN(record[this.field])) {
33235
- this.max = parseFloat(record[this.field]) > this.max ? parseFloat(record[this.field]) : this.max;
33170
+ else {
33171
+ this.records.push(record);
33236
33172
  }
33237
33173
  }
33174
+ if (record.className === 'Aggregator') {
33175
+ this.max = record.max > this.max ? record.max : this.max;
33176
+ }
33177
+ else if (typeof record === 'number') {
33178
+ this.max = record > this.max ? record : this.max;
33179
+ }
33180
+ else if (this.field && typeof record[this.field] === 'number') {
33181
+ this.max = record[this.field] > this.max ? record[this.field] : this.max;
33182
+ }
33183
+ else if (this.field && !isNaN(record[this.field])) {
33184
+ this.max = parseFloat(record[this.field]) > this.max ? parseFloat(record[this.field]) : this.max;
33185
+ }
33238
33186
  }
33239
33187
  value() {
33240
33188
  return this.max;
@@ -33269,25 +33217,23 @@
33269
33217
  type = AggregationType.MIN;
33270
33218
  min = Number.MAX_SAFE_INTEGER;
33271
33219
  push(record) {
33272
- if (record) {
33273
- if (this.isRecord && this.records) {
33274
- if (record.className === 'Aggregator') {
33275
- this.records.push(...record.records);
33276
- }
33277
- else {
33278
- this.records.push(record);
33279
- }
33280
- }
33220
+ if (this.isRecord && this.records) {
33281
33221
  if (record.className === 'Aggregator') {
33282
- this.min = record.min < this.min ? record.min : this.min;
33283
- }
33284
- else if (typeof record === 'number') {
33285
- this.min = record < this.min ? record : this.min;
33222
+ this.records.push(...record.records);
33286
33223
  }
33287
- else if (this.field && typeof record[this.field] === 'number') {
33288
- this.min = record[this.field] < this.min ? record[this.field] : this.min;
33224
+ else {
33225
+ this.records.push(record);
33289
33226
  }
33290
33227
  }
33228
+ if (record.className === 'Aggregator') {
33229
+ this.min = record.min < this.min ? record.min : this.min;
33230
+ }
33231
+ else if (typeof record === 'number') {
33232
+ this.min = record < this.min ? record : this.min;
33233
+ }
33234
+ else if (this.field && typeof record[this.field] === 'number') {
33235
+ this.min = record[this.field] < this.min ? record[this.field] : this.min;
33236
+ }
33291
33237
  }
33292
33238
  value() {
33293
33239
  return this.min;
@@ -33433,16 +33379,6 @@
33433
33379
  return naturalSort(a, b);
33434
33380
  };
33435
33381
  }
33436
- function _getDependAggregatorValues(aggregators, dependIndicatorKeys) {
33437
- const dependAggregatorValues = {};
33438
- for (let m = 0; m < dependIndicatorKeys?.length; m++) {
33439
- const aggrator = aggregators.find(aggrator => aggrator.key === dependIndicatorKeys[m]);
33440
- if (aggrator) {
33441
- dependAggregatorValues[aggrator.key] = aggrator?.value();
33442
- }
33443
- }
33444
- return dependAggregatorValues;
33445
- }
33446
33382
 
33447
33383
  function isFieldAssessor(field) {
33448
33384
  if (obj.isObject(field)) {
@@ -33608,12 +33544,7 @@
33608
33544
  if (Array.isArray(aggragation)) {
33609
33545
  for (let j = 0; j < aggragation.length; j++) {
33610
33546
  const item = aggragation[j];
33611
- const aggregator = new this.registedAggregators[item.aggregationType]({
33612
- dimension: field,
33613
- formatFun: item.formatFun,
33614
- isRecord: true,
33615
- aggregationFun: item.aggregationFun
33616
- });
33547
+ const aggregator = new this.registedAggregators[item.aggregationType](field, item.formatFun, true, item.aggregationFun);
33617
33548
  this.fieldAggregators.push(aggregator);
33618
33549
  if (!columnObjs[i].aggregator) {
33619
33550
  columnObjs[i].aggregator = [];
@@ -33622,12 +33553,7 @@
33622
33553
  }
33623
33554
  }
33624
33555
  else {
33625
- const aggregator = new this.registedAggregators[aggragation.aggregationType]({
33626
- dimension: field,
33627
- formatFun: aggragation.formatFun,
33628
- isRecord: true,
33629
- aggregationFun: aggragation.aggregationFun
33630
- });
33556
+ const aggregator = new this.registedAggregators[aggragation.aggregationType](field, aggragation.formatFun, true, aggragation.aggregationFun);
33631
33557
  this.fieldAggregators.push(aggregator);
33632
33558
  columnObjs[i].aggregator = aggregator;
33633
33559
  }
@@ -45555,14 +45481,12 @@
45555
45481
  }
45556
45482
  }
45557
45483
 
45558
- async function dynamicSetX(x, isEnd, proxy) {
45559
- const screenLeft = proxy.table.getTargetColAt(x + proxy.table.scenegraph.rowHeaderGroup.attribute.width);
45484
+ async function dynamicSetX(x, screenLeft, isEnd, proxy) {
45560
45485
  if (!screenLeft) {
45561
45486
  return;
45562
45487
  }
45563
45488
  const screenLeftCol = screenLeft.col;
45564
45489
  const screenLeftX = screenLeft.left;
45565
- proxy.screenLeftCol = screenLeftCol;
45566
45490
  let deltaCol;
45567
45491
  if (isEnd) {
45568
45492
  deltaCol = proxy.bodyRightCol - proxy.colEnd;
@@ -45770,7 +45694,7 @@
45770
45694
  for (let col = colStart; col <= colEnd; col++) {
45771
45695
  for (let row = rowStart; row <= rowEnd; row++) {
45772
45696
  const cellGroup = table.scenegraph.highPerformanceGetCell(col, row, true);
45773
- if (!cellGroup.row) {
45697
+ if (cellGroup.role !== 'cell' || !cellGroup.row) {
45774
45698
  continue;
45775
45699
  }
45776
45700
  let y;
@@ -45781,7 +45705,7 @@
45781
45705
  const baseCellGroup = table.scenegraph.highPerformanceGetCell(col, rowEnd + 1, true);
45782
45706
  y = baseCellGroup.attribute.y;
45783
45707
  if (isValid$1(y)) {
45784
- for (let r = rowStart; r <= rowEnd; r++) {
45708
+ for (let r = row; r <= rowEnd; r++) {
45785
45709
  y -= table.getRowHeight(r);
45786
45710
  }
45787
45711
  }
@@ -45799,7 +45723,7 @@
45799
45723
  for (let col = colStart; col <= colEnd; col++) {
45800
45724
  for (let row = rowEnd; row >= rowStart; row--) {
45801
45725
  const cellGroup = table.scenegraph.highPerformanceGetCell(col, row, true);
45802
- if (!cellGroup.row) {
45726
+ if (cellGroup.role !== 'cell' || !cellGroup.row) {
45803
45727
  continue;
45804
45728
  }
45805
45729
  let y;
@@ -45809,14 +45733,17 @@
45809
45733
  else if (part) {
45810
45734
  const baseCellGroup = table.scenegraph.highPerformanceGetCell(col, rowStart - 1, true);
45811
45735
  y = baseCellGroup.attribute.y;
45812
- for (let r = rowStart - 1; r < rowEnd; r++) {
45813
- y += table.getRowHeight(r);
45736
+ for (let r = rowStart - 1; r < row; r++) {
45737
+ const height = table.getRowHeight(r);
45738
+ y += height;
45814
45739
  }
45815
45740
  }
45816
45741
  else {
45817
45742
  y = table.getRowsHeight(table.columnHeaderLevelCount, cellGroup.row - 1);
45818
45743
  }
45819
- cellGroup.setAttribute('y', y);
45744
+ if (isValid$1(y)) {
45745
+ cellGroup.setAttribute('y', y);
45746
+ }
45820
45747
  }
45821
45748
  }
45822
45749
  }
@@ -45827,14 +45754,12 @@
45827
45754
  table.scenegraph.proxy.yLimitBottom = totalHeight - totalBodyHeight / 2;
45828
45755
  }
45829
45756
 
45830
- async function dynamicSetY(y, isEnd, proxy) {
45831
- const screenTop = proxy.table.getTargetRowAt(y + proxy.table.scenegraph.colHeaderGroup.attribute.height);
45757
+ async function dynamicSetY(y, screenTop, isEnd, proxy) {
45832
45758
  if (!screenTop) {
45833
45759
  return;
45834
45760
  }
45835
45761
  const screenTopRow = screenTop.row;
45836
45762
  const screenTopY = screenTop.top;
45837
- proxy.screenTopRow = screenTopRow;
45838
45763
  let deltaRow;
45839
45764
  if (isEnd) {
45840
45765
  deltaRow = proxy.bodyBottomRow - proxy.rowEnd;
@@ -45906,7 +45831,7 @@
45906
45831
  updatePartRowPosition(startRow, endRow, direction, proxy);
45907
45832
  proxy.rowStart = direction === 'up' ? proxy.rowStart + count : proxy.rowStart - count;
45908
45833
  proxy.rowEnd = direction === 'up' ? proxy.rowEnd + count : proxy.rowEnd - count;
45909
- updateRowContent(syncTopRow, syncBottomRow, proxy, true);
45834
+ const sync = updateRowContent(syncTopRow, syncBottomRow, proxy, true);
45910
45835
  if (proxy.table.heightMode === 'autoHeight') {
45911
45836
  updateAutoRow(proxy.bodyLeftCol, proxy.bodyRightCol, syncTopRow, syncBottomRow, proxy.table, distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up', true);
45912
45837
  updateAutoRow(0, proxy.table.frozenColCount - 1, syncTopRow, syncBottomRow, proxy.table, distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up', true);
@@ -45915,7 +45840,7 @@
45915
45840
  proxy.currentRow = direction === 'up' ? proxy.currentRow + count : proxy.currentRow - count;
45916
45841
  proxy.totalRow = Math.max(0, Math.min(proxy.bodyBottomRow, direction === 'up' ? proxy.totalRow + count : proxy.totalRow - count));
45917
45842
  proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2);
45918
- if (proxy.table.heightMode === 'autoHeight') {
45843
+ if (proxy.table.heightMode === 'autoHeight' && sync) {
45919
45844
  proxy.rowUpdatePos = Math.min(proxy.rowUpdatePos, proxy.rowEnd + 1);
45920
45845
  }
45921
45846
  else {
@@ -45923,9 +45848,7 @@
45923
45848
  }
45924
45849
  proxy.rowUpdateDirection = direction;
45925
45850
  proxy.table.scenegraph.updateNextFrame();
45926
- if (proxy.table.heightMode !== 'autoHeight') {
45927
- await proxy.progress();
45928
- }
45851
+ await proxy.progress();
45929
45852
  }
45930
45853
  else {
45931
45854
  const distStartRow = direction === 'up' ? proxy.rowStart + count : proxy.rowStart - count;
@@ -45945,7 +45868,7 @@
45945
45868
  updateAllRowPosition(distStartRowY, count, direction, proxy);
45946
45869
  proxy.rowStart = distStartRow;
45947
45870
  proxy.rowEnd = distEndRow;
45948
- updateRowContent(syncTopRow, syncBottomRow, proxy, true);
45871
+ const sync = updateRowContent(syncTopRow, syncBottomRow, proxy, true);
45949
45872
  if (proxy.table.heightMode === 'autoHeight') {
45950
45873
  updateAutoRow(proxy.bodyLeftCol, proxy.bodyRightCol, syncTopRow, syncBottomRow, proxy.table, distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up');
45951
45874
  updateAutoRow(0, proxy.table.frozenColCount - 1, syncTopRow, syncBottomRow, proxy.table, distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up');
@@ -45954,7 +45877,7 @@
45954
45877
  proxy.currentRow = direction === 'up' ? proxy.currentRow + count : proxy.currentRow - count;
45955
45878
  proxy.totalRow = Math.max(0, Math.min(proxy.bodyBottomRow, direction === 'up' ? proxy.totalRow + count : proxy.totalRow - count));
45956
45879
  proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2);
45957
- if (proxy.table.heightMode === 'autoHeight') {
45880
+ if (proxy.table.heightMode === 'autoHeight' && sync) {
45958
45881
  proxy.rowUpdatePos = proxy.rowEnd + 1;
45959
45882
  }
45960
45883
  else {
@@ -45962,9 +45885,7 @@
45962
45885
  }
45963
45886
  proxy.rowUpdateDirection = distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up';
45964
45887
  proxy.table.scenegraph.updateNextFrame();
45965
- if (proxy.table.heightMode !== 'autoHeight') {
45966
- await proxy.progress();
45967
- }
45888
+ await proxy.progress();
45968
45889
  }
45969
45890
  }
45970
45891
  function updatePartRowPosition(startRow, endRow, direction, proxy) {
@@ -46050,10 +45971,14 @@
46050
45971
  }
46051
45972
  let leftCol = proxy.bodyLeftCol;
46052
45973
  let rightCol = proxy.bodyRightCol;
45974
+ let sync = true;
46053
45975
  if (async) {
46054
45976
  const screenLeftCol = proxy.screenLeftCol;
46055
45977
  leftCol = Math.max(proxy.bodyLeftCol, screenLeftCol - proxy.screenColCount * 1);
46056
45978
  rightCol = Math.min(proxy.bodyRightCol, screenLeftCol + proxy.screenColCount * 2);
45979
+ if (leftCol !== proxy.bodyLeftCol || rightCol !== proxy.bodyRightCol) {
45980
+ sync = false;
45981
+ }
46057
45982
  }
46058
45983
  for (let col = leftCol; col <= rightCol; col++) {
46059
45984
  for (let row = syncTopRow; row <= syncBottomRow; row++) {
@@ -46062,6 +45987,7 @@
46062
45987
  }
46063
45988
  }
46064
45989
  proxy.table.scenegraph.updateNextFrame();
45990
+ return sync;
46065
45991
  }
46066
45992
 
46067
45993
  async function sortVertical(proxy) {
@@ -46682,6 +46608,10 @@
46682
46608
  async setY(y, isEnd = false) {
46683
46609
  const yLimitTop = this.table.getRowsHeight(this.bodyTopRow, this.bodyTopRow + (this.rowEnd - this.rowStart + 1)) / 2;
46684
46610
  const yLimitBottom = this.table.getAllRowsHeight() - yLimitTop;
46611
+ const screenTop = this.table.getTargetRowAt(y + this.table.scenegraph.colHeaderGroup.attribute.height);
46612
+ if (screenTop) {
46613
+ this.screenTopRow = screenTop.row;
46614
+ }
46685
46615
  if (y < yLimitTop && this.rowStart === this.bodyTopRow) {
46686
46616
  this.updateDeltaY(y);
46687
46617
  this.updateBody(y - this.deltaY);
@@ -46697,12 +46627,16 @@
46697
46627
  this.updateBody(y - this.deltaY);
46698
46628
  }
46699
46629
  else {
46700
- this.dynamicSetY(y, isEnd);
46630
+ this.dynamicSetY(y, screenTop, isEnd);
46701
46631
  }
46702
46632
  }
46703
46633
  async setX(x, isEnd = false) {
46704
46634
  const xLimitLeft = this.table.getColsWidth(this.bodyLeftCol, this.bodyLeftCol + (this.colEnd - this.colStart + 1)) / 2;
46705
46635
  const xLimitRight = this.table.getAllColsWidth() - xLimitLeft;
46636
+ const screenLeft = this.table.getTargetColAt(x + this.table.scenegraph.rowHeaderGroup.attribute.width);
46637
+ if (screenLeft) {
46638
+ this.screenLeftCol = screenLeft.col;
46639
+ }
46706
46640
  if (x < xLimitLeft && this.colStart === this.bodyLeftCol) {
46707
46641
  this.updateDeltaX(x);
46708
46642
  this.table.scenegraph.setBodyAndColHeaderX(-x + this.deltaX);
@@ -46717,14 +46651,14 @@
46717
46651
  this.table.scenegraph.setBodyAndColHeaderX(-x + this.deltaX);
46718
46652
  }
46719
46653
  else {
46720
- this.dynamicSetX(x, isEnd);
46654
+ this.dynamicSetX(x, screenLeft, isEnd);
46721
46655
  }
46722
46656
  }
46723
- async dynamicSetY(y, isEnd = false) {
46724
- dynamicSetY(y, isEnd, this);
46657
+ async dynamicSetY(y, screenTop, isEnd = false) {
46658
+ dynamicSetY(y, screenTop, isEnd, this);
46725
46659
  }
46726
- async dynamicSetX(x, isEnd = false) {
46727
- dynamicSetX(x, isEnd, this);
46660
+ async dynamicSetX(x, screenLeft, isEnd = false) {
46661
+ dynamicSetX(x, screenLeft, isEnd, this);
46728
46662
  }
46729
46663
  updateBody(y) {
46730
46664
  this.table.scenegraph.setBodyAndRowHeaderY(-y);
@@ -59340,7 +59274,7 @@
59340
59274
  return TABLE_EVENT_TYPE;
59341
59275
  }
59342
59276
  options;
59343
- version = "1.3.3-alpha.2";
59277
+ version = "1.3.3";
59344
59278
  pagination;
59345
59279
  id = `VTable${Date.now()}`;
59346
59280
  headerStyleCache;
@@ -68578,9 +68512,6 @@
68578
68512
  aggregationRules;
68579
68513
  derivedFieldRules;
68580
68514
  mappingRules;
68581
- calculatedFieldRules;
68582
- calculatedFiledKeys;
68583
- calculatedFieldDependIndicatorKeys;
68584
68515
  totals;
68585
68516
  indicatorStatistics = [];
68586
68517
  aggregators = {};
@@ -68600,7 +68531,6 @@
68600
68531
  columns;
68601
68532
  columnsHasValue;
68602
68533
  indicatorKeys;
68603
- indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;
68604
68534
  customRowTree;
68605
68535
  customColTree;
68606
68536
  colHeaderTree;
@@ -68617,27 +68547,10 @@
68617
68547
  this.aggregationRules = this.dataConfig?.aggregationRules;
68618
68548
  this.derivedFieldRules = this.dataConfig?.derivedFieldRules;
68619
68549
  this.mappingRules = this.dataConfig?.mappingRules;
68620
- this.calculatedFieldRules = this.dataConfig?.calculatedFieldRules;
68621
- this.calculatedFiledKeys = this.calculatedFieldRules?.map(rule => rule.key) ?? [];
68622
- this.calculatedFieldDependIndicatorKeys =
68623
- this.calculatedFieldRules?.reduce((arr, rule) => {
68624
- for (let i = 0; i < rule.dependIndicatorKeys.length; i++) {
68625
- if (arr.indexOf(rule.dependIndicatorKeys[i]) === -1) {
68626
- arr.push(rule.dependIndicatorKeys[i]);
68627
- }
68628
- }
68629
- return arr;
68630
- }, []) ?? [];
68631
68550
  this.totals = this.dataConfig?.totals;
68632
68551
  this.rows = rows;
68633
68552
  this.columns = columns;
68634
68553
  this.indicatorKeys = indicatorKeys;
68635
- this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys = [...indicatorKeys];
68636
- for (let m = 0; m < this.calculatedFieldDependIndicatorKeys.length; m++) {
68637
- if (this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys.indexOf(this.calculatedFieldDependIndicatorKeys[m]) === -1) {
68638
- this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys.push(this.calculatedFieldDependIndicatorKeys[m]);
68639
- }
68640
- }
68641
68554
  this.indicatorsAsCol = indicatorsAsCol;
68642
68555
  this.indicators = indicators;
68643
68556
  this.customColTree = customColTree;
@@ -68735,7 +68648,6 @@
68735
68648
  this.registerAggregator(AggregationType.MIN, MinAggregator);
68736
68649
  this.registerAggregator(AggregationType.AVG, AvgAggregator);
68737
68650
  this.registerAggregator(AggregationType.NONE, NoneAggregator);
68738
- this.registerAggregator(AggregationType.RECALCULATE, RecalculateAggregator);
68739
68651
  }
68740
68652
  processCollectedValuesWithSumBy() {
68741
68653
  for (const field in this.collectedValues) {
@@ -68887,12 +68799,7 @@
68887
68799
  .sumBy.map(byField => record[byField])
68888
68800
  .join(this.stringJoinChar);
68889
68801
  if (!this.collectedValues[field][collectKeys][sumByKeys]) {
68890
- this.collectedValues[field][collectKeys][sumByKeys] = new this.aggregators[AggregationType.SUM]({
68891
- key: field,
68892
- dimension: field,
68893
- isRecord: undefined,
68894
- needSplitPositiveAndNegative: this.needSplitPositiveAndNegative
68895
- });
68802
+ this.collectedValues[field][collectKeys][sumByKeys] = new this.aggregators[AggregationType.SUM](field, undefined, undefined, this.needSplitPositiveAndNegative);
68896
68803
  }
68897
68804
  this.collectedValues[field][collectKeys][sumByKeys].push(record);
68898
68805
  }
@@ -68978,17 +68885,13 @@
68978
68885
  for (let i = 0; i < this.indicatorKeys.length; i++) {
68979
68886
  const aggRule = this.getAggregatorRule(this.indicatorKeys[i]);
68980
68887
  if (!this.totalRecordsTree[flatRowKey]?.[flatColKey]?.[i]) {
68981
- this.totalRecordsTree[flatRowKey][flatColKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM]({
68982
- key: this.indicatorKeys[i],
68983
- dimension: aggRule?.field ?? this.indicatorKeys[i],
68984
- formatFun: aggRule?.formatFun ??
68985
- this.indicators?.find((indicator) => {
68986
- if (typeof indicator !== 'string') {
68987
- return indicator.indicatorKey === this.indicatorKeys[i];
68988
- }
68989
- return false;
68990
- })?.format
68991
- });
68888
+ this.totalRecordsTree[flatRowKey][flatColKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM](aggRule?.field ?? this.indicatorKeys[i], aggRule?.formatFun ??
68889
+ this.indicators?.find((indicator) => {
68890
+ if (typeof indicator !== 'string') {
68891
+ return indicator.indicatorKey === this.indicatorKeys[i];
68892
+ }
68893
+ return false;
68894
+ })?.format);
68992
68895
  }
68993
68896
  this.indicatorKeys[i] in record && this.totalRecordsTree[flatRowKey]?.[flatColKey]?.[i].push(record);
68994
68897
  }
@@ -69006,39 +68909,18 @@
69006
68909
  this.colFlatKeys[flatColKey] = 1;
69007
68910
  }
69008
68911
  }
69009
- if (!this.tree[flatRowKey]) {
69010
- this.tree[flatRowKey] = {};
69011
- }
69012
- if (!this.tree[flatRowKey]?.[flatColKey]) {
69013
- this.tree[flatRowKey][flatColKey] = [];
69014
- }
69015
- const toComputeIndicatorKeys = this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;
69016
- for (let i = 0; i < toComputeIndicatorKeys.length; i++) {
69017
- if (this.calculatedFiledKeys.indexOf(toComputeIndicatorKeys[i]) >= 0) {
69018
- const calculatedFieldRule = this.calculatedFieldRules?.find(rule => rule.key === toComputeIndicatorKeys[i]);
69019
- if (!this.tree[flatRowKey]?.[flatColKey]?.[i]) {
69020
- this.tree[flatRowKey][flatColKey][i] = new this.aggregators[AggregationType.RECALCULATE]({
69021
- key: toComputeIndicatorKeys[i],
69022
- dimension: toComputeIndicatorKeys[i],
69023
- isRecord: true,
69024
- formatFun: this.indicators?.find((indicator) => {
69025
- if (typeof indicator !== 'string') {
69026
- return indicator.indicatorKey === toComputeIndicatorKeys[i];
69027
- }
69028
- return false;
69029
- })?.format,
69030
- calculateFun: calculatedFieldRule?.calculateFun,
69031
- dependAggregators: this.tree[flatRowKey][flatColKey],
69032
- dependIndicatorKeys: calculatedFieldRule?.dependIndicatorKeys
69033
- });
69034
- }
69035
- this.tree[flatRowKey]?.[flatColKey]?.[i].push(record);
68912
+ {
68913
+ if (!this.tree[flatRowKey]) {
68914
+ this.tree[flatRowKey] = {};
69036
68915
  }
69037
- else {
69038
- const aggRule = this.getAggregatorRule(toComputeIndicatorKeys[i]);
68916
+ if (!this.tree[flatRowKey]?.[flatColKey]) {
68917
+ this.tree[flatRowKey][flatColKey] = [];
68918
+ }
68919
+ for (let i = 0; i < this.indicatorKeys.length; i++) {
68920
+ const aggRule = this.getAggregatorRule(this.indicatorKeys[i]);
69039
68921
  let needAddToAggregator = false;
69040
68922
  if (assignedIndicatorKey) {
69041
- toComputeIndicatorKeys[i] === assignedIndicatorKey && (needAddToAggregator = true);
68923
+ this.indicatorKeys[i] === assignedIndicatorKey && (needAddToAggregator = true);
69042
68924
  }
69043
68925
  else if (aggRule?.field) {
69044
68926
  if (typeof aggRule?.field === 'string') {
@@ -69052,20 +68934,16 @@
69052
68934
  }
69053
68935
  }
69054
68936
  else {
69055
- toComputeIndicatorKeys[i] in record && (needAddToAggregator = true);
68937
+ this.indicatorKeys[i] in record && (needAddToAggregator = true);
69056
68938
  }
69057
68939
  if (!this.tree[flatRowKey]?.[flatColKey]?.[i] && needAddToAggregator) {
69058
- this.tree[flatRowKey][flatColKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM]({
69059
- key: toComputeIndicatorKeys[i],
69060
- dimension: aggRule?.field ?? toComputeIndicatorKeys[i],
69061
- formatFun: aggRule?.formatFun ??
69062
- this.indicators?.find((indicator) => {
69063
- if (typeof indicator !== 'string') {
69064
- return indicator.indicatorKey === toComputeIndicatorKeys[i];
69065
- }
69066
- return false;
69067
- })?.format
69068
- });
68940
+ this.tree[flatRowKey][flatColKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM](aggRule?.field ?? this.indicatorKeys[i], aggRule?.formatFun ??
68941
+ this.indicators?.find((indicator) => {
68942
+ if (typeof indicator !== 'string') {
68943
+ return indicator.indicatorKey === this.indicatorKeys[i];
68944
+ }
68945
+ return false;
68946
+ })?.format);
69069
68947
  }
69070
68948
  if (needAddToAggregator) {
69071
68949
  this.tree[flatRowKey]?.[flatColKey]?.[i].push(record);
@@ -69077,25 +68955,15 @@
69077
68955
  if (!this.indicatorStatistics[i]) {
69078
68956
  const aggRule = this.getAggregatorRule(this.indicatorKeys[i]);
69079
68957
  this.indicatorStatistics[i] = {
69080
- max: new this.aggregators[AggregationType.MAX]({
69081
- key: this.indicatorKeys[i],
69082
- dimension: this.indicatorKeys[i]
69083
- }),
69084
- min: new this.aggregators[AggregationType.MIN]({
69085
- key: this.indicatorKeys[i],
69086
- dimension: this.indicatorKeys[i]
69087
- }),
69088
- total: new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM]({
69089
- key: this.indicatorKeys[i],
69090
- dimension: aggRule?.field ?? this.indicatorKeys[i],
69091
- formatFun: aggRule?.formatFun ??
69092
- this.indicators?.find((indicator) => {
69093
- if (typeof indicator !== 'string') {
69094
- return indicator.indicatorKey === this.indicatorKeys[i];
69095
- }
69096
- return false;
69097
- })?.format
69098
- })
68958
+ max: new this.aggregators[AggregationType.MAX](this.indicatorKeys[i]),
68959
+ min: new this.aggregators[AggregationType.MIN](this.indicatorKeys[i]),
68960
+ total: new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM](aggRule?.field ?? this.indicatorKeys[i], aggRule?.formatFun ??
68961
+ this.indicators?.find((indicator) => {
68962
+ if (typeof indicator !== 'string') {
68963
+ return indicator.indicatorKey === this.indicatorKeys[i];
68964
+ }
68965
+ return false;
68966
+ })?.format)
69099
68967
  };
69100
68968
  }
69101
68969
  this.indicatorStatistics[i].max.push(this.tree[flatRowKey]?.[flatColKey]?.[i].value());
@@ -69390,45 +69258,18 @@
69390
69258
  if (!this.tree[flatRowKey][flatColTotalKey]) {
69391
69259
  this.tree[flatRowKey][flatColTotalKey] = [];
69392
69260
  }
69393
- const toComputeIndicatorKeys = this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;
69394
- for (let i = 0; i < toComputeIndicatorKeys.length; i++) {
69395
- if (this.calculatedFiledKeys.indexOf(toComputeIndicatorKeys[i]) >= 0) {
69396
- const calculatedFieldRule = this.calculatedFieldRules?.find(rule => rule.key === toComputeIndicatorKeys[i]);
69397
- if (!this.tree[flatRowKey]?.[flatColTotalKey]?.[i]) {
69398
- this.tree[flatRowKey][flatColTotalKey][i] = new this.aggregators[AggregationType.RECALCULATE]({
69399
- key: toComputeIndicatorKeys[i],
69400
- dimension: toComputeIndicatorKeys[i],
69401
- isRecord: true,
69402
- formatFun: this.indicators?.find((indicator) => {
69403
- if (typeof indicator !== 'string') {
69404
- return indicator.indicatorKey === toComputeIndicatorKeys[i];
69405
- }
69406
- return false;
69407
- })?.format,
69408
- calculateFun: calculatedFieldRule?.calculateFun,
69409
- dependAggregators: this.tree[flatRowKey][flatColTotalKey],
69410
- dependIndicatorKeys: calculatedFieldRule?.dependIndicatorKeys
69411
- });
69412
- }
69413
- this.tree[flatRowKey][flatColTotalKey][i].push(that.tree[flatRowKey]?.[flatColKey]?.[i]);
69414
- }
69415
- else {
69416
- if (!this.tree[flatRowKey][flatColTotalKey][i]) {
69417
- const aggRule = this.getAggregatorRule(toComputeIndicatorKeys[i]);
69418
- this.tree[flatRowKey][flatColTotalKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM]({
69419
- key: toComputeIndicatorKeys[i],
69420
- dimension: aggRule?.field ?? toComputeIndicatorKeys[i],
69421
- formatFun: aggRule?.formatFun ??
69422
- this.indicators?.find((indicator) => {
69423
- if (typeof indicator !== 'string') {
69424
- return indicator.indicatorKey === toComputeIndicatorKeys[i];
69425
- }
69426
- return false;
69427
- })?.format
69428
- });
69429
- }
69430
- this.tree[flatRowKey][flatColTotalKey][i].push(that.tree[flatRowKey]?.[flatColKey]?.[i]);
69261
+ for (let i = 0; i < this.indicatorKeys.length; i++) {
69262
+ if (!this.tree[flatRowKey][flatColTotalKey][i]) {
69263
+ const aggRule = this.getAggregatorRule(this.indicatorKeys[i]);
69264
+ this.tree[flatRowKey][flatColTotalKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM](aggRule?.field ?? this.indicatorKeys[i], aggRule?.formatFun ??
69265
+ this.indicators?.find((indicator) => {
69266
+ if (typeof indicator !== 'string') {
69267
+ return indicator.indicatorKey === this.indicatorKeys[i];
69268
+ }
69269
+ return false;
69270
+ })?.format);
69431
69271
  }
69272
+ this.tree[flatRowKey][flatColTotalKey][i].push(that.tree[flatRowKey]?.[flatColKey]?.[i]);
69432
69273
  }
69433
69274
  }
69434
69275
  }
@@ -69442,45 +69283,18 @@
69442
69283
  if (!this.tree[flatRowKey][flatColTotalKey]) {
69443
69284
  this.tree[flatRowKey][flatColTotalKey] = [];
69444
69285
  }
69445
- const toComputeIndicatorKeys = this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;
69446
- for (let i = 0; i < toComputeIndicatorKeys.length; i++) {
69447
- if (this.calculatedFiledKeys.indexOf(toComputeIndicatorKeys[i]) >= 0) {
69448
- const calculatedFieldRule = this.calculatedFieldRules?.find(rule => rule.key === toComputeIndicatorKeys[i]);
69449
- if (!this.tree[flatRowKey]?.[flatColTotalKey]?.[i]) {
69450
- this.tree[flatRowKey][flatColTotalKey][i] = new this.aggregators[AggregationType.RECALCULATE]({
69451
- key: toComputeIndicatorKeys[i],
69452
- dimension: toComputeIndicatorKeys[i],
69453
- isRecord: true,
69454
- formatFun: this.indicators?.find((indicator) => {
69455
- if (typeof indicator !== 'string') {
69456
- return indicator.indicatorKey === toComputeIndicatorKeys[i];
69457
- }
69458
- return false;
69459
- })?.format,
69460
- calculateFun: calculatedFieldRule?.calculateFun,
69461
- dependAggregators: this.tree[flatRowKey][flatColTotalKey],
69462
- dependIndicatorKeys: calculatedFieldRule?.dependIndicatorKeys
69463
- });
69464
- }
69465
- this.tree[flatRowKey][flatColTotalKey][i].push(that.tree[flatRowKey]?.[flatColKey]?.[i]);
69466
- }
69467
- else {
69468
- if (!this.tree[flatRowKey][flatColTotalKey][i]) {
69469
- const aggRule = this.getAggregatorRule(toComputeIndicatorKeys[i]);
69470
- this.tree[flatRowKey][flatColTotalKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM]({
69471
- key: toComputeIndicatorKeys[i],
69472
- dimension: aggRule?.field ?? toComputeIndicatorKeys[i],
69473
- formatFun: aggRule?.formatFun ??
69474
- this.indicators?.find((indicator) => {
69475
- if (typeof indicator !== 'string') {
69476
- return indicator.indicatorKey === toComputeIndicatorKeys[i];
69477
- }
69478
- return false;
69479
- })?.format
69480
- });
69481
- }
69482
- this.tree[flatRowKey][flatColTotalKey][i].push(that.tree[flatRowKey]?.[flatColKey]?.[i]);
69286
+ for (let i = 0; i < this.indicatorKeys.length; i++) {
69287
+ if (!this.tree[flatRowKey][flatColTotalKey][i]) {
69288
+ const aggRule = this.getAggregatorRule(this.indicatorKeys[i]);
69289
+ this.tree[flatRowKey][flatColTotalKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM](aggRule?.field ?? this.indicatorKeys[i], aggRule?.formatFun ??
69290
+ this.indicators?.find((indicator) => {
69291
+ if (typeof indicator !== 'string') {
69292
+ return indicator.indicatorKey === this.indicatorKeys[i];
69293
+ }
69294
+ return false;
69295
+ })?.format);
69483
69296
  }
69297
+ this.tree[flatRowKey][flatColTotalKey][i].push(that.tree[flatRowKey]?.[flatColKey]?.[i]);
69484
69298
  }
69485
69299
  }
69486
69300
  };
@@ -69504,40 +69318,16 @@
69504
69318
  if (!this.tree[flatRowTotalKey][flatColKey]) {
69505
69319
  this.tree[flatRowTotalKey][flatColKey] = [];
69506
69320
  }
69507
- const toComputeIndicatorKeys = this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;
69508
- for (let i = 0; i < toComputeIndicatorKeys.length; i++) {
69321
+ for (let i = 0; i < this.indicatorKeys.length; i++) {
69509
69322
  if (!this.tree[flatRowTotalKey][flatColKey][i]) {
69510
- if (this.calculatedFiledKeys.indexOf(toComputeIndicatorKeys[i]) >= 0) {
69511
- const calculatedFieldRule = this.calculatedFieldRules?.find(rule => rule.key === toComputeIndicatorKeys[i]);
69512
- this.tree[flatRowTotalKey][flatColKey][i] = new this.aggregators[AggregationType.RECALCULATE]({
69513
- key: toComputeIndicatorKeys[i],
69514
- dimension: toComputeIndicatorKeys[i],
69515
- isRecord: true,
69516
- formatFun: this.indicators?.find((indicator) => {
69517
- if (typeof indicator !== 'string') {
69518
- return indicator.indicatorKey === toComputeIndicatorKeys[i];
69519
- }
69520
- return false;
69521
- })?.format,
69522
- calculateFun: calculatedFieldRule?.calculateFun,
69523
- dependAggregators: this.tree[flatRowTotalKey][flatColKey],
69524
- dependIndicatorKeys: calculatedFieldRule?.dependIndicatorKeys
69525
- });
69526
- }
69527
- else {
69528
- const aggRule = this.getAggregatorRule(toComputeIndicatorKeys[i]);
69529
- this.tree[flatRowTotalKey][flatColKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM]({
69530
- key: toComputeIndicatorKeys[i],
69531
- dimension: aggRule?.field ?? toComputeIndicatorKeys[i],
69532
- formatFun: aggRule?.formatFun ??
69533
- this.indicators?.find((indicator) => {
69534
- if (typeof indicator !== 'string') {
69535
- return indicator.indicatorKey === toComputeIndicatorKeys[i];
69536
- }
69537
- return false;
69538
- })?.format
69539
- });
69540
- }
69323
+ const aggRule = this.getAggregatorRule(this.indicatorKeys[i]);
69324
+ this.tree[flatRowTotalKey][flatColKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM](aggRule?.field ?? this.indicatorKeys[i], aggRule?.formatFun ??
69325
+ this.indicators?.find((indicator) => {
69326
+ if (typeof indicator !== 'string') {
69327
+ return indicator.indicatorKey === this.indicatorKeys[i];
69328
+ }
69329
+ return false;
69330
+ })?.format);
69541
69331
  }
69542
69332
  this.tree[flatRowTotalKey][flatColKey][i].push(that.tree[flatRowKey]?.[flatColKey]?.[i]);
69543
69333
  }
@@ -69553,40 +69343,16 @@
69553
69343
  if (!this.tree[flatRowTotalKey][flatColKey]) {
69554
69344
  this.tree[flatRowTotalKey][flatColKey] = [];
69555
69345
  }
69556
- const toComputeIndicatorKeys = this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;
69557
- for (let i = 0; i < toComputeIndicatorKeys.length; i++) {
69346
+ for (let i = 0; i < this.indicatorKeys.length; i++) {
69558
69347
  if (!this.tree[flatRowTotalKey][flatColKey][i]) {
69559
- if (this.calculatedFiledKeys.indexOf(toComputeIndicatorKeys[i]) >= 0) {
69560
- const calculatedFieldRule = this.calculatedFieldRules?.find(rule => rule.key === toComputeIndicatorKeys[i]);
69561
- this.tree[flatRowTotalKey][flatColKey][i] = new this.aggregators[AggregationType.RECALCULATE]({
69562
- key: toComputeIndicatorKeys[i],
69563
- dimension: toComputeIndicatorKeys[i],
69564
- isRecord: true,
69565
- formatFun: this.indicators?.find((indicator) => {
69566
- if (typeof indicator !== 'string') {
69567
- return indicator.indicatorKey === toComputeIndicatorKeys[i];
69568
- }
69569
- return false;
69570
- })?.format,
69571
- calculateFun: calculatedFieldRule?.calculateFun,
69572
- dependAggregators: this.tree[flatRowTotalKey][flatColKey],
69573
- dependIndicatorKeys: calculatedFieldRule?.dependIndicatorKeys
69574
- });
69575
- }
69576
- else {
69577
- const aggRule = this.getAggregatorRule(toComputeIndicatorKeys[i]);
69578
- this.tree[flatRowTotalKey][flatColKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM]({
69579
- key: toComputeIndicatorKeys[i],
69580
- dimension: aggRule?.field ?? toComputeIndicatorKeys[i],
69581
- formatFun: aggRule?.formatFun ??
69582
- this.indicators?.find((indicator) => {
69583
- if (typeof indicator !== 'string') {
69584
- return indicator.indicatorKey === toComputeIndicatorKeys[i];
69585
- }
69586
- return false;
69587
- })?.format
69588
- });
69589
- }
69348
+ const aggRule = this.getAggregatorRule(this.indicatorKeys[i]);
69349
+ this.tree[flatRowTotalKey][flatColKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM](aggRule?.field ?? this.indicatorKeys[i], aggRule?.formatFun ??
69350
+ this.indicators?.find((indicator) => {
69351
+ if (typeof indicator !== 'string') {
69352
+ return indicator.indicatorKey === this.indicatorKeys[i];
69353
+ }
69354
+ return false;
69355
+ })?.format);
69590
69356
  }
69591
69357
  this.tree[flatRowTotalKey][flatColKey][i].push(that.tree[flatRowKey]?.[flatColKey]?.[i]);
69592
69358
  }
@@ -72796,7 +72562,7 @@
72796
72562
  }
72797
72563
 
72798
72564
  registerForVrender();
72799
- const version = "1.3.3-alpha.2";
72565
+ const version = "1.3.3";
72800
72566
  function getIcons() {
72801
72567
  return get$2();
72802
72568
  }