@visactor/vtable 1.3.3-alpha.3 → 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 (75) 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 +72 -187
  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/layout/tree-helper.js +1 -0
  17. package/cjs/plugins/themes.js +1 -2
  18. package/cjs/scenegraph/group-creater/progress/proxy.d.ts +3 -2
  19. package/cjs/scenegraph/group-creater/progress/proxy.js +10 -10
  20. package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
  21. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.d.ts +2 -1
  22. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +2 -3
  23. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  24. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.d.ts +3 -2
  25. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +15 -14
  26. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
  27. package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.js +7 -5
  28. package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -1
  29. package/cjs/ts-types/base-table.d.ts +5 -25
  30. package/cjs/ts-types/base-table.js.map +1 -1
  31. package/cjs/ts-types/new-data-set.d.ts +1 -9
  32. package/cjs/ts-types/new-data-set.js +1 -1
  33. package/cjs/ts-types/new-data-set.js.map +1 -1
  34. package/cjs/ts-types/table-engine.d.ts +12 -0
  35. package/cjs/ts-types/table-engine.js.map +1 -1
  36. package/cjs/vrender.js.map +1 -1
  37. package/dist/vtable.js +217 -478
  38. package/dist/vtable.min.js +2 -2
  39. package/es/core/BaseTable.d.ts +5 -25
  40. package/es/core/BaseTable.js +1 -1
  41. package/es/core/BaseTable.js.map +1 -1
  42. package/es/data/DataSource.d.ts +1 -6
  43. package/es/data/DataSource.js +2 -12
  44. package/es/data/DataSource.js.map +1 -1
  45. package/es/dataset/dataset.d.ts +2 -15
  46. package/es/dataset/dataset.js +73 -187
  47. package/es/dataset/dataset.js.map +1 -1
  48. package/es/dataset/statistics-helper.d.ts +3 -43
  49. package/es/dataset/statistics-helper.js +23 -55
  50. package/es/dataset/statistics-helper.js.map +1 -1
  51. package/es/index.d.ts +1 -1
  52. package/es/index.js +1 -1
  53. package/es/index.js.map +1 -1
  54. package/es/layout/tree-helper.js +2 -1
  55. package/es/plugins/themes.js +1 -2
  56. package/es/scenegraph/group-creater/progress/proxy.d.ts +3 -2
  57. package/es/scenegraph/group-creater/progress/proxy.js +10 -10
  58. package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
  59. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.d.ts +2 -1
  60. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +2 -3
  61. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  62. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.d.ts +3 -2
  63. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +15 -13
  64. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
  65. package/es/scenegraph/group-creater/progress/update-position/update-auto-row.js +7 -5
  66. package/es/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -1
  67. package/es/ts-types/base-table.d.ts +5 -25
  68. package/es/ts-types/base-table.js.map +1 -1
  69. package/es/ts-types/new-data-set.d.ts +1 -9
  70. package/es/ts-types/new-data-set.js +1 -1
  71. package/es/ts-types/new-data-set.js.map +1 -1
  72. package/es/ts-types/table-engine.d.ts +12 -0
  73. package/es/ts-types/table-engine.js.map +1 -1
  74. package/es/vrender.js.map +1 -1
  75. 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.3";
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
  }
@@ -68975,45 +68882,18 @@
68975
68882
  if (!this.totalRecordsTree[flatRowKey][flatColKey]) {
68976
68883
  this.totalRecordsTree[flatRowKey][flatColKey] = [];
68977
68884
  }
68978
- const toComputeIndicatorKeys = this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;
68979
- for (let i = 0; i < toComputeIndicatorKeys.length; i++) {
68980
- if (this.calculatedFiledKeys.indexOf(toComputeIndicatorKeys[i]) >= 0) {
68981
- const calculatedFieldRule = this.calculatedFieldRules?.find(rule => rule.key === toComputeIndicatorKeys[i]);
68982
- if (!this.totalRecordsTree[flatRowKey]?.[flatColKey]?.[i]) {
68983
- this.totalRecordsTree[flatRowKey][flatColKey][i] = new this.aggregators[AggregationType.RECALCULATE]({
68984
- key: toComputeIndicatorKeys[i],
68985
- dimension: toComputeIndicatorKeys[i],
68986
- isRecord: true,
68987
- formatFun: this.indicators?.find((indicator) => {
68988
- if (typeof indicator !== 'string') {
68989
- return indicator.indicatorKey === toComputeIndicatorKeys[i];
68990
- }
68991
- return false;
68992
- })?.format,
68993
- calculateFun: calculatedFieldRule?.calculateFun,
68994
- dependAggregators: this.totalRecordsTree[flatRowKey][flatColKey],
68995
- dependIndicatorKeys: calculatedFieldRule?.dependIndicatorKeys
68996
- });
68997
- }
68998
- toComputeIndicatorKeys[i] in record && this.totalRecordsTree[flatRowKey]?.[flatColKey]?.[i].push(record);
68999
- }
69000
- else {
69001
- const aggRule = this.getAggregatorRule(toComputeIndicatorKeys[i]);
69002
- if (!this.totalRecordsTree[flatRowKey]?.[flatColKey]?.[i]) {
69003
- this.totalRecordsTree[flatRowKey][flatColKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM]({
69004
- key: toComputeIndicatorKeys[i],
69005
- dimension: aggRule?.field ?? toComputeIndicatorKeys[i],
69006
- formatFun: aggRule?.formatFun ??
69007
- this.indicators?.find((indicator) => {
69008
- if (typeof indicator !== 'string') {
69009
- return indicator.indicatorKey === toComputeIndicatorKeys[i];
69010
- }
69011
- return false;
69012
- })?.format
69013
- });
69014
- }
69015
- toComputeIndicatorKeys[i] in record && this.totalRecordsTree[flatRowKey]?.[flatColKey]?.[i].push(record);
68885
+ for (let i = 0; i < this.indicatorKeys.length; i++) {
68886
+ const aggRule = this.getAggregatorRule(this.indicatorKeys[i]);
68887
+ if (!this.totalRecordsTree[flatRowKey]?.[flatColKey]?.[i]) {
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);
69016
68895
  }
68896
+ this.indicatorKeys[i] in record && this.totalRecordsTree[flatRowKey]?.[flatColKey]?.[i].push(record);
69017
68897
  }
69018
68898
  return;
69019
68899
  }
@@ -69029,39 +68909,18 @@
69029
68909
  this.colFlatKeys[flatColKey] = 1;
69030
68910
  }
69031
68911
  }
69032
- if (!this.tree[flatRowKey]) {
69033
- this.tree[flatRowKey] = {};
69034
- }
69035
- if (!this.tree[flatRowKey]?.[flatColKey]) {
69036
- this.tree[flatRowKey][flatColKey] = [];
69037
- }
69038
- const toComputeIndicatorKeys = this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;
69039
- for (let i = 0; i < toComputeIndicatorKeys.length; i++) {
69040
- if (this.calculatedFiledKeys.indexOf(toComputeIndicatorKeys[i]) >= 0) {
69041
- const calculatedFieldRule = this.calculatedFieldRules?.find(rule => rule.key === toComputeIndicatorKeys[i]);
69042
- if (!this.tree[flatRowKey]?.[flatColKey]?.[i]) {
69043
- this.tree[flatRowKey][flatColKey][i] = new this.aggregators[AggregationType.RECALCULATE]({
69044
- key: toComputeIndicatorKeys[i],
69045
- dimension: toComputeIndicatorKeys[i],
69046
- isRecord: true,
69047
- formatFun: this.indicators?.find((indicator) => {
69048
- if (typeof indicator !== 'string') {
69049
- return indicator.indicatorKey === toComputeIndicatorKeys[i];
69050
- }
69051
- return false;
69052
- })?.format,
69053
- calculateFun: calculatedFieldRule?.calculateFun,
69054
- dependAggregators: this.tree[flatRowKey][flatColKey],
69055
- dependIndicatorKeys: calculatedFieldRule?.dependIndicatorKeys
69056
- });
69057
- }
69058
- this.tree[flatRowKey]?.[flatColKey]?.[i].push(record);
68912
+ {
68913
+ if (!this.tree[flatRowKey]) {
68914
+ this.tree[flatRowKey] = {};
69059
68915
  }
69060
- else {
69061
- 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]);
69062
68921
  let needAddToAggregator = false;
69063
68922
  if (assignedIndicatorKey) {
69064
- toComputeIndicatorKeys[i] === assignedIndicatorKey && (needAddToAggregator = true);
68923
+ this.indicatorKeys[i] === assignedIndicatorKey && (needAddToAggregator = true);
69065
68924
  }
69066
68925
  else if (aggRule?.field) {
69067
68926
  if (typeof aggRule?.field === 'string') {
@@ -69075,20 +68934,16 @@
69075
68934
  }
69076
68935
  }
69077
68936
  else {
69078
- toComputeIndicatorKeys[i] in record && (needAddToAggregator = true);
68937
+ this.indicatorKeys[i] in record && (needAddToAggregator = true);
69079
68938
  }
69080
68939
  if (!this.tree[flatRowKey]?.[flatColKey]?.[i] && needAddToAggregator) {
69081
- this.tree[flatRowKey][flatColKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM]({
69082
- key: toComputeIndicatorKeys[i],
69083
- dimension: aggRule?.field ?? toComputeIndicatorKeys[i],
69084
- formatFun: aggRule?.formatFun ??
69085
- this.indicators?.find((indicator) => {
69086
- if (typeof indicator !== 'string') {
69087
- return indicator.indicatorKey === toComputeIndicatorKeys[i];
69088
- }
69089
- return false;
69090
- })?.format
69091
- });
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);
69092
68947
  }
69093
68948
  if (needAddToAggregator) {
69094
68949
  this.tree[flatRowKey]?.[flatColKey]?.[i].push(record);
@@ -69100,25 +68955,15 @@
69100
68955
  if (!this.indicatorStatistics[i]) {
69101
68956
  const aggRule = this.getAggregatorRule(this.indicatorKeys[i]);
69102
68957
  this.indicatorStatistics[i] = {
69103
- max: new this.aggregators[AggregationType.MAX]({
69104
- key: this.indicatorKeys[i],
69105
- dimension: this.indicatorKeys[i]
69106
- }),
69107
- min: new this.aggregators[AggregationType.MIN]({
69108
- key: this.indicatorKeys[i],
69109
- dimension: this.indicatorKeys[i]
69110
- }),
69111
- total: new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM]({
69112
- key: this.indicatorKeys[i],
69113
- dimension: aggRule?.field ?? this.indicatorKeys[i],
69114
- formatFun: aggRule?.formatFun ??
69115
- this.indicators?.find((indicator) => {
69116
- if (typeof indicator !== 'string') {
69117
- return indicator.indicatorKey === this.indicatorKeys[i];
69118
- }
69119
- return false;
69120
- })?.format
69121
- })
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)
69122
68967
  };
69123
68968
  }
69124
68969
  this.indicatorStatistics[i].max.push(this.tree[flatRowKey]?.[flatColKey]?.[i].value());
@@ -69398,9 +69243,7 @@
69398
69243
  return;
69399
69244
  }
69400
69245
  const colKey = flatColKey.split(this.stringJoinChar);
69401
- if (that.totals?.column?.subTotalsDimensions &&
69402
- that.totals?.column?.subTotalsDimensions?.length > 0 &&
69403
- that.totals.column.showSubTotals !== false) {
69246
+ if (that.totals?.column?.subTotalsDimensions) {
69404
69247
  for (let i = 0, len = that.totals?.column?.subTotalsDimensions?.length; i < len; i++) {
69405
69248
  const dimension = that.totals.column.subTotalsDimensions[i];
69406
69249
  const dimensionIndex = that.columns.indexOf(dimension);
@@ -69415,45 +69258,18 @@
69415
69258
  if (!this.tree[flatRowKey][flatColTotalKey]) {
69416
69259
  this.tree[flatRowKey][flatColTotalKey] = [];
69417
69260
  }
69418
- const toComputeIndicatorKeys = this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;
69419
- for (let i = 0; i < toComputeIndicatorKeys.length; i++) {
69420
- if (this.calculatedFiledKeys.indexOf(toComputeIndicatorKeys[i]) >= 0) {
69421
- const calculatedFieldRule = this.calculatedFieldRules?.find(rule => rule.key === toComputeIndicatorKeys[i]);
69422
- if (!this.tree[flatRowKey]?.[flatColTotalKey]?.[i]) {
69423
- this.tree[flatRowKey][flatColTotalKey][i] = new this.aggregators[AggregationType.RECALCULATE]({
69424
- key: toComputeIndicatorKeys[i],
69425
- dimension: toComputeIndicatorKeys[i],
69426
- isRecord: true,
69427
- formatFun: this.indicators?.find((indicator) => {
69428
- if (typeof indicator !== 'string') {
69429
- return indicator.indicatorKey === toComputeIndicatorKeys[i];
69430
- }
69431
- return false;
69432
- })?.format,
69433
- calculateFun: calculatedFieldRule?.calculateFun,
69434
- dependAggregators: this.tree[flatRowKey][flatColTotalKey],
69435
- dependIndicatorKeys: calculatedFieldRule?.dependIndicatorKeys
69436
- });
69437
- }
69438
- this.tree[flatRowKey][flatColTotalKey][i].push(that.tree[flatRowKey]?.[flatColKey]?.[i]);
69439
- }
69440
- else {
69441
- if (!this.tree[flatRowKey][flatColTotalKey][i]) {
69442
- const aggRule = this.getAggregatorRule(toComputeIndicatorKeys[i]);
69443
- this.tree[flatRowKey][flatColTotalKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM]({
69444
- key: toComputeIndicatorKeys[i],
69445
- dimension: aggRule?.field ?? toComputeIndicatorKeys[i],
69446
- formatFun: aggRule?.formatFun ??
69447
- this.indicators?.find((indicator) => {
69448
- if (typeof indicator !== 'string') {
69449
- return indicator.indicatorKey === toComputeIndicatorKeys[i];
69450
- }
69451
- return false;
69452
- })?.format
69453
- });
69454
- }
69455
- 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);
69456
69271
  }
69272
+ this.tree[flatRowKey][flatColTotalKey][i].push(that.tree[flatRowKey]?.[flatColKey]?.[i]);
69457
69273
  }
69458
69274
  }
69459
69275
  }
@@ -69467,54 +69283,25 @@
69467
69283
  if (!this.tree[flatRowKey][flatColTotalKey]) {
69468
69284
  this.tree[flatRowKey][flatColTotalKey] = [];
69469
69285
  }
69470
- const toComputeIndicatorKeys = this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;
69471
- for (let i = 0; i < toComputeIndicatorKeys.length; i++) {
69472
- if (this.calculatedFiledKeys.indexOf(toComputeIndicatorKeys[i]) >= 0) {
69473
- const calculatedFieldRule = this.calculatedFieldRules?.find(rule => rule.key === toComputeIndicatorKeys[i]);
69474
- if (!this.tree[flatRowKey]?.[flatColTotalKey]?.[i]) {
69475
- this.tree[flatRowKey][flatColTotalKey][i] = new this.aggregators[AggregationType.RECALCULATE]({
69476
- key: toComputeIndicatorKeys[i],
69477
- dimension: toComputeIndicatorKeys[i],
69478
- isRecord: true,
69479
- formatFun: this.indicators?.find((indicator) => {
69480
- if (typeof indicator !== 'string') {
69481
- return indicator.indicatorKey === toComputeIndicatorKeys[i];
69482
- }
69483
- return false;
69484
- })?.format,
69485
- calculateFun: calculatedFieldRule?.calculateFun,
69486
- dependAggregators: this.tree[flatRowKey][flatColTotalKey],
69487
- dependIndicatorKeys: calculatedFieldRule?.dependIndicatorKeys
69488
- });
69489
- }
69490
- this.tree[flatRowKey][flatColTotalKey][i].push(that.tree[flatRowKey]?.[flatColKey]?.[i]);
69491
- }
69492
- else {
69493
- if (!this.tree[flatRowKey][flatColTotalKey][i]) {
69494
- const aggRule = this.getAggregatorRule(toComputeIndicatorKeys[i]);
69495
- this.tree[flatRowKey][flatColTotalKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM]({
69496
- key: toComputeIndicatorKeys[i],
69497
- dimension: aggRule?.field ?? toComputeIndicatorKeys[i],
69498
- formatFun: aggRule?.formatFun ??
69499
- this.indicators?.find((indicator) => {
69500
- if (typeof indicator !== 'string') {
69501
- return indicator.indicatorKey === toComputeIndicatorKeys[i];
69502
- }
69503
- return false;
69504
- })?.format
69505
- });
69506
- }
69507
- 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);
69508
69296
  }
69297
+ this.tree[flatRowKey][flatColTotalKey][i].push(that.tree[flatRowKey]?.[flatColKey]?.[i]);
69509
69298
  }
69510
69299
  }
69511
69300
  };
69512
69301
  Object.keys(that.tree).forEach(flatRowKey => {
69513
69302
  const rowKey = flatRowKey.split(this.stringJoinChar);
69514
69303
  Object.keys(that.tree[flatRowKey]).forEach(flatColKey => {
69515
- if (that.totals?.row?.subTotalsDimensions &&
69516
- that.totals?.row?.subTotalsDimensions?.length > 0 &&
69517
- that.totals.row.showSubTotals !== false) {
69304
+ if (that.totals?.row?.subTotalsDimensions) {
69518
69305
  for (let i = 0, len = that.totals?.row?.subTotalsDimensions?.length; i < len; i++) {
69519
69306
  const dimension = that.totals.row.subTotalsDimensions[i];
69520
69307
  const dimensionIndex = that.rows.indexOf(dimension);
@@ -69531,40 +69318,16 @@
69531
69318
  if (!this.tree[flatRowTotalKey][flatColKey]) {
69532
69319
  this.tree[flatRowTotalKey][flatColKey] = [];
69533
69320
  }
69534
- const toComputeIndicatorKeys = this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;
69535
- for (let i = 0; i < toComputeIndicatorKeys.length; i++) {
69321
+ for (let i = 0; i < this.indicatorKeys.length; i++) {
69536
69322
  if (!this.tree[flatRowTotalKey][flatColKey][i]) {
69537
- if (this.calculatedFiledKeys.indexOf(toComputeIndicatorKeys[i]) >= 0) {
69538
- const calculatedFieldRule = this.calculatedFieldRules?.find(rule => rule.key === toComputeIndicatorKeys[i]);
69539
- this.tree[flatRowTotalKey][flatColKey][i] = new this.aggregators[AggregationType.RECALCULATE]({
69540
- key: toComputeIndicatorKeys[i],
69541
- dimension: toComputeIndicatorKeys[i],
69542
- isRecord: true,
69543
- formatFun: this.indicators?.find((indicator) => {
69544
- if (typeof indicator !== 'string') {
69545
- return indicator.indicatorKey === toComputeIndicatorKeys[i];
69546
- }
69547
- return false;
69548
- })?.format,
69549
- calculateFun: calculatedFieldRule?.calculateFun,
69550
- dependAggregators: this.tree[flatRowTotalKey][flatColKey],
69551
- dependIndicatorKeys: calculatedFieldRule?.dependIndicatorKeys
69552
- });
69553
- }
69554
- else {
69555
- const aggRule = this.getAggregatorRule(toComputeIndicatorKeys[i]);
69556
- this.tree[flatRowTotalKey][flatColKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM]({
69557
- key: toComputeIndicatorKeys[i],
69558
- dimension: aggRule?.field ?? toComputeIndicatorKeys[i],
69559
- formatFun: aggRule?.formatFun ??
69560
- this.indicators?.find((indicator) => {
69561
- if (typeof indicator !== 'string') {
69562
- return indicator.indicatorKey === toComputeIndicatorKeys[i];
69563
- }
69564
- return false;
69565
- })?.format
69566
- });
69567
- }
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);
69568
69331
  }
69569
69332
  this.tree[flatRowTotalKey][flatColKey][i].push(that.tree[flatRowKey]?.[flatColKey]?.[i]);
69570
69333
  }
@@ -69580,40 +69343,16 @@
69580
69343
  if (!this.tree[flatRowTotalKey][flatColKey]) {
69581
69344
  this.tree[flatRowTotalKey][flatColKey] = [];
69582
69345
  }
69583
- const toComputeIndicatorKeys = this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;
69584
- for (let i = 0; i < toComputeIndicatorKeys.length; i++) {
69346
+ for (let i = 0; i < this.indicatorKeys.length; i++) {
69585
69347
  if (!this.tree[flatRowTotalKey][flatColKey][i]) {
69586
- if (this.calculatedFiledKeys.indexOf(toComputeIndicatorKeys[i]) >= 0) {
69587
- const calculatedFieldRule = this.calculatedFieldRules?.find(rule => rule.key === toComputeIndicatorKeys[i]);
69588
- this.tree[flatRowTotalKey][flatColKey][i] = new this.aggregators[AggregationType.RECALCULATE]({
69589
- key: toComputeIndicatorKeys[i],
69590
- dimension: toComputeIndicatorKeys[i],
69591
- isRecord: true,
69592
- formatFun: this.indicators?.find((indicator) => {
69593
- if (typeof indicator !== 'string') {
69594
- return indicator.indicatorKey === toComputeIndicatorKeys[i];
69595
- }
69596
- return false;
69597
- })?.format,
69598
- calculateFun: calculatedFieldRule?.calculateFun,
69599
- dependAggregators: this.tree[flatRowTotalKey][flatColKey],
69600
- dependIndicatorKeys: calculatedFieldRule?.dependIndicatorKeys
69601
- });
69602
- }
69603
- else {
69604
- const aggRule = this.getAggregatorRule(toComputeIndicatorKeys[i]);
69605
- this.tree[flatRowTotalKey][flatColKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM]({
69606
- key: toComputeIndicatorKeys[i],
69607
- dimension: aggRule?.field ?? toComputeIndicatorKeys[i],
69608
- formatFun: aggRule?.formatFun ??
69609
- this.indicators?.find((indicator) => {
69610
- if (typeof indicator !== 'string') {
69611
- return indicator.indicatorKey === toComputeIndicatorKeys[i];
69612
- }
69613
- return false;
69614
- })?.format
69615
- });
69616
- }
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);
69617
69356
  }
69618
69357
  this.tree[flatRowTotalKey][flatColKey][i].push(that.tree[flatRowKey]?.[flatColKey]?.[i]);
69619
69358
  }
@@ -72823,7 +72562,7 @@
72823
72562
  }
72824
72563
 
72825
72564
  registerForVrender();
72826
- const version = "1.3.3-alpha.3";
72565
+ const version = "1.3.3";
72827
72566
  function getIcons() {
72828
72567
  return get$2();
72829
72568
  }