@visactor/vtable 1.7.8-alpha.5 → 1.7.9-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/ListTable.js +12 -8
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotTable.js +3 -3
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/core/BaseTable.js +1 -1
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/record-helper.js +83 -10
- package/cjs/core/record-helper.js.map +1 -1
- package/cjs/core/tableHelper.d.ts +2 -0
- package/cjs/core/tableHelper.js +26 -3
- package/cjs/core/tableHelper.js.map +1 -1
- package/cjs/data/CachedDataSource.d.ts +3 -3
- package/cjs/data/CachedDataSource.js +4 -4
- package/cjs/data/CachedDataSource.js.map +1 -1
- package/cjs/data/DataSource.d.ts +3 -3
- package/cjs/data/DataSource.js +28 -21
- package/cjs/data/DataSource.js.map +1 -1
- package/cjs/dataset/DataStatistics.js +2 -1
- package/cjs/dataset/dataset-pivot-table.js +2 -0
- package/cjs/dataset/dataset-pivot-table.js.map +1 -1
- package/cjs/dataset/dataset.d.ts +20 -2
- package/cjs/dataset/dataset.js +268 -163
- package/cjs/dataset/dataset.js.map +1 -1
- package/cjs/dataset/statistics-helper.d.ts +22 -0
- package/cjs/dataset/statistics-helper.js +114 -8
- package/cjs/dataset/statistics-helper.js.map +1 -1
- package/cjs/edit/edit-manager.js +1 -0
- package/cjs/edit/edit-manager.js.map +1 -1
- package/cjs/event/listener/table-group.js +1 -0
- package/cjs/event/listener/table-group.js.map +1 -1
- package/cjs/header-helper/header-helper.js +3 -3
- package/cjs/header-helper/header-helper.js.map +1 -1
- package/cjs/icons.js +2 -2
- package/cjs/icons.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/layout/layout-helper.js +3 -4
- package/cjs/layout/layout-helper.js.map +1 -1
- package/cjs/layout/row-height-map.js +1 -1
- package/cjs/layout/simple-header-layout.d.ts +3 -4
- package/cjs/layout/simple-header-layout.js +16 -26
- package/cjs/layout/simple-header-layout.js.map +1 -1
- package/cjs/layout/tree-helper.js +2 -2
- package/cjs/plugins/custom-cell-style.js +2 -1
- package/cjs/plugins/icons.js +1 -1
- package/cjs/plugins/list-tree-stick-cell.js +1 -1
- package/cjs/plugins/themes.js +1 -1
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +25 -10
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/cjs/scenegraph/layout/frozen.js +3 -3
- package/cjs/scenegraph/layout/frozen.js.map +1 -1
- package/cjs/scenegraph/utils/text-measure.js +1 -1
- package/cjs/scenegraph/utils/text-measure.js.map +1 -1
- package/cjs/state/state.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +1 -0
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +1060 -417
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.js +10 -10
- package/es/ListTable.js.map +1 -1
- package/es/PivotTable.js +3 -3
- package/es/PivotTable.js.map +1 -1
- package/es/core/BaseTable.js +1 -1
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/record-helper.js +83 -10
- package/es/core/record-helper.js.map +1 -1
- package/es/core/tableHelper.d.ts +2 -0
- package/es/core/tableHelper.js +23 -1
- package/es/core/tableHelper.js.map +1 -1
- package/es/data/CachedDataSource.d.ts +3 -3
- package/es/data/CachedDataSource.js +4 -4
- package/es/data/CachedDataSource.js.map +1 -1
- package/es/data/DataSource.d.ts +3 -3
- package/es/data/DataSource.js +28 -21
- package/es/data/DataSource.js.map +1 -1
- package/es/dataset/DataStatistics.js +2 -1
- package/es/dataset/dataset-pivot-table.js +2 -0
- package/es/dataset/dataset-pivot-table.js.map +1 -1
- package/es/dataset/dataset.d.ts +20 -2
- package/es/dataset/dataset.js +268 -164
- package/es/dataset/dataset.js.map +1 -1
- package/es/dataset/statistics-helper.d.ts +22 -0
- package/es/dataset/statistics-helper.js +114 -8
- package/es/dataset/statistics-helper.js.map +1 -1
- package/es/edit/edit-manager.js +1 -0
- package/es/edit/edit-manager.js.map +1 -1
- package/es/event/listener/table-group.js +1 -0
- package/es/event/listener/table-group.js.map +1 -1
- package/es/header-helper/header-helper.js +3 -3
- package/es/header-helper/header-helper.js.map +1 -1
- package/es/icons.js +2 -2
- package/es/icons.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/layout/layout-helper.js +3 -4
- package/es/layout/layout-helper.js.map +1 -1
- package/es/layout/row-height-map.js +1 -1
- package/es/layout/simple-header-layout.d.ts +3 -4
- package/es/layout/simple-header-layout.js +16 -26
- package/es/layout/simple-header-layout.js.map +1 -1
- package/es/layout/tree-helper.js +1 -1
- package/es/plugins/custom-cell-style.js +2 -1
- package/es/plugins/icons.js +1 -1
- package/es/plugins/list-tree-stick-cell.js +1 -1
- package/es/plugins/themes.js +1 -1
- package/es/scenegraph/graphic/contributions/group-contribution-render.js +25 -10
- package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/es/scenegraph/layout/frozen.js +3 -3
- package/es/scenegraph/layout/frozen.js.map +1 -1
- package/es/scenegraph/utils/text-measure.js +2 -2
- package/es/scenegraph/utils/text-measure.js.map +1 -1
- package/es/state/state.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +1 -0
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +2 -2
package/dist/vtable.js
CHANGED
|
@@ -28900,6 +28900,28 @@
|
|
|
28900
28900
|
this.records.push(record);
|
|
28901
28901
|
}
|
|
28902
28902
|
}
|
|
28903
|
+
this.clearCacheValue();
|
|
28904
|
+
}
|
|
28905
|
+
deleteRecord(record) {
|
|
28906
|
+
if (record) {
|
|
28907
|
+
if (this.isRecord && this.records) {
|
|
28908
|
+
this.records = this.records.filter(item => item !== record);
|
|
28909
|
+
}
|
|
28910
|
+
}
|
|
28911
|
+
this.clearCacheValue();
|
|
28912
|
+
}
|
|
28913
|
+
updateRecord(oldRecord, newRecord) {
|
|
28914
|
+
if (oldRecord && newRecord) {
|
|
28915
|
+
if (this.isRecord && this.records) {
|
|
28916
|
+
this.records = this.records.map(item => {
|
|
28917
|
+
if (item === oldRecord) {
|
|
28918
|
+
return newRecord;
|
|
28919
|
+
}
|
|
28920
|
+
return item;
|
|
28921
|
+
});
|
|
28922
|
+
}
|
|
28923
|
+
this.clearCacheValue();
|
|
28924
|
+
}
|
|
28903
28925
|
}
|
|
28904
28926
|
value() {
|
|
28905
28927
|
return this.records;
|
|
@@ -28923,6 +28945,34 @@
|
|
|
28923
28945
|
this.fieldValue = record[this.field];
|
|
28924
28946
|
}
|
|
28925
28947
|
}
|
|
28948
|
+
this.clearCacheValue();
|
|
28949
|
+
}
|
|
28950
|
+
deleteRecord(record) {
|
|
28951
|
+
if (record) {
|
|
28952
|
+
if (this.isRecord && this.records) {
|
|
28953
|
+
this.records = this.records.filter(item => item !== record);
|
|
28954
|
+
}
|
|
28955
|
+
if (this.field && this.records.length) {
|
|
28956
|
+
this.fieldValue = this.records[this.records.length - 1][this.field];
|
|
28957
|
+
}
|
|
28958
|
+
}
|
|
28959
|
+
this.clearCacheValue();
|
|
28960
|
+
}
|
|
28961
|
+
updateRecord(oldRecord, newRecord) {
|
|
28962
|
+
if (oldRecord && newRecord) {
|
|
28963
|
+
if (this.isRecord && this.records) {
|
|
28964
|
+
this.records = this.records.map(item => {
|
|
28965
|
+
if (item === oldRecord) {
|
|
28966
|
+
return newRecord;
|
|
28967
|
+
}
|
|
28968
|
+
return item;
|
|
28969
|
+
});
|
|
28970
|
+
}
|
|
28971
|
+
if (this.field && this.records.length) {
|
|
28972
|
+
this.fieldValue = this.records[this.records.length - 1][this.field];
|
|
28973
|
+
}
|
|
28974
|
+
this.clearCacheValue();
|
|
28975
|
+
}
|
|
28926
28976
|
}
|
|
28927
28977
|
value() {
|
|
28928
28978
|
return this.fieldValue;
|
|
@@ -28958,6 +29008,34 @@
|
|
|
28958
29008
|
this.values.push(record[this.field]);
|
|
28959
29009
|
}
|
|
28960
29010
|
}
|
|
29011
|
+
this.clearCacheValue();
|
|
29012
|
+
}
|
|
29013
|
+
updateRecord(oldRecord, newRecord) {
|
|
29014
|
+
if (oldRecord && newRecord) {
|
|
29015
|
+
if (this.isRecord && this.records) {
|
|
29016
|
+
this.records = this.records.map(item => {
|
|
29017
|
+
if (item === oldRecord) {
|
|
29018
|
+
return newRecord;
|
|
29019
|
+
}
|
|
29020
|
+
return item;
|
|
29021
|
+
});
|
|
29022
|
+
}
|
|
29023
|
+
if (this.field && this.records.length) {
|
|
29024
|
+
this.values = this.records.map(item => item[this.field]);
|
|
29025
|
+
}
|
|
29026
|
+
this.clearCacheValue();
|
|
29027
|
+
}
|
|
29028
|
+
}
|
|
29029
|
+
deleteRecord(record) {
|
|
29030
|
+
if (record) {
|
|
29031
|
+
if (this.isRecord && this.records) {
|
|
29032
|
+
this.records = this.records.filter(item => item !== record);
|
|
29033
|
+
}
|
|
29034
|
+
if (this.field && this.records.length) {
|
|
29035
|
+
this.values = this.records.map(item => item[this.field]);
|
|
29036
|
+
}
|
|
29037
|
+
}
|
|
29038
|
+
this.clearCacheValue();
|
|
28961
29039
|
}
|
|
28962
29040
|
value() {
|
|
28963
29041
|
if (!this.fieldValue) {
|
|
@@ -28994,6 +29072,28 @@
|
|
|
28994
29072
|
this.records.push(record);
|
|
28995
29073
|
}
|
|
28996
29074
|
}
|
|
29075
|
+
this.clearCacheValue();
|
|
29076
|
+
}
|
|
29077
|
+
deleteRecord(record) {
|
|
29078
|
+
if (record) {
|
|
29079
|
+
if (this.isRecord && this.records) {
|
|
29080
|
+
this.records = this.records.filter(item => item !== record);
|
|
29081
|
+
}
|
|
29082
|
+
}
|
|
29083
|
+
this.clearCacheValue();
|
|
29084
|
+
}
|
|
29085
|
+
updateRecord(oldRecord, newRecord) {
|
|
29086
|
+
if (oldRecord && newRecord) {
|
|
29087
|
+
if (this.isRecord && this.records) {
|
|
29088
|
+
this.records = this.records.map(item => {
|
|
29089
|
+
if (item === oldRecord) {
|
|
29090
|
+
return newRecord;
|
|
29091
|
+
}
|
|
29092
|
+
return item;
|
|
29093
|
+
});
|
|
29094
|
+
}
|
|
29095
|
+
this.clearCacheValue();
|
|
29096
|
+
}
|
|
28997
29097
|
}
|
|
28998
29098
|
value() {
|
|
28999
29099
|
if (!this.fieldValue) {
|
|
@@ -29054,6 +29154,90 @@
|
|
|
29054
29154
|
}
|
|
29055
29155
|
}
|
|
29056
29156
|
}
|
|
29157
|
+
this.clearCacheValue();
|
|
29158
|
+
}
|
|
29159
|
+
deleteRecord(record) {
|
|
29160
|
+
if (record) {
|
|
29161
|
+
if (this.isRecord && this.records) {
|
|
29162
|
+
this.records = this.records.filter(item => item !== record);
|
|
29163
|
+
}
|
|
29164
|
+
if (record.className === 'Aggregator') {
|
|
29165
|
+
const value = record.value();
|
|
29166
|
+
this.sum -= value ?? 0;
|
|
29167
|
+
if (this.needSplitPositiveAndNegativeForSum) {
|
|
29168
|
+
if (value > 0) {
|
|
29169
|
+
this.positiveSum -= value;
|
|
29170
|
+
}
|
|
29171
|
+
else if (value < 0) {
|
|
29172
|
+
this.nagetiveSum -= value;
|
|
29173
|
+
}
|
|
29174
|
+
}
|
|
29175
|
+
}
|
|
29176
|
+
else if (this.field && !isNaN(parseFloat(record[this.field]))) {
|
|
29177
|
+
const value = parseFloat(record[this.field]);
|
|
29178
|
+
this.sum -= value;
|
|
29179
|
+
if (this.needSplitPositiveAndNegativeForSum) {
|
|
29180
|
+
if (value > 0) {
|
|
29181
|
+
this.positiveSum -= value;
|
|
29182
|
+
}
|
|
29183
|
+
else if (value < 0) {
|
|
29184
|
+
this.nagetiveSum -= value;
|
|
29185
|
+
}
|
|
29186
|
+
}
|
|
29187
|
+
}
|
|
29188
|
+
}
|
|
29189
|
+
this.clearCacheValue();
|
|
29190
|
+
}
|
|
29191
|
+
updateRecord(oldRecord, newRecord) {
|
|
29192
|
+
if (oldRecord && newRecord) {
|
|
29193
|
+
if (this.isRecord && this.records) {
|
|
29194
|
+
this.records = this.records.map(item => {
|
|
29195
|
+
if (item === oldRecord) {
|
|
29196
|
+
return newRecord;
|
|
29197
|
+
}
|
|
29198
|
+
return item;
|
|
29199
|
+
});
|
|
29200
|
+
}
|
|
29201
|
+
if (oldRecord.className === 'Aggregator') {
|
|
29202
|
+
const oldValue = oldRecord.value();
|
|
29203
|
+
const newValue = newRecord.value();
|
|
29204
|
+
this.sum += newValue - oldValue;
|
|
29205
|
+
if (this.needSplitPositiveAndNegativeForSum) {
|
|
29206
|
+
if (oldValue > 0) {
|
|
29207
|
+
this.positiveSum -= oldValue;
|
|
29208
|
+
}
|
|
29209
|
+
else if (oldValue < 0) {
|
|
29210
|
+
this.nagetiveSum -= oldValue;
|
|
29211
|
+
}
|
|
29212
|
+
if (newValue > 0) {
|
|
29213
|
+
this.positiveSum += newValue;
|
|
29214
|
+
}
|
|
29215
|
+
else if (newValue < 0) {
|
|
29216
|
+
this.nagetiveSum += newValue;
|
|
29217
|
+
}
|
|
29218
|
+
}
|
|
29219
|
+
}
|
|
29220
|
+
else if (this.field && !isNaN(parseFloat(oldRecord[this.field]))) {
|
|
29221
|
+
const oldValue = parseFloat(oldRecord[this.field]);
|
|
29222
|
+
const newValue = parseFloat(newRecord[this.field]);
|
|
29223
|
+
this.sum += newValue - oldValue;
|
|
29224
|
+
if (this.needSplitPositiveAndNegativeForSum) {
|
|
29225
|
+
if (oldValue > 0) {
|
|
29226
|
+
this.positiveSum -= oldValue;
|
|
29227
|
+
}
|
|
29228
|
+
else if (oldValue < 0) {
|
|
29229
|
+
this.nagetiveSum -= oldValue;
|
|
29230
|
+
}
|
|
29231
|
+
if (newValue > 0) {
|
|
29232
|
+
this.positiveSum += newValue;
|
|
29233
|
+
}
|
|
29234
|
+
else if (newValue < 0) {
|
|
29235
|
+
this.nagetiveSum += newValue;
|
|
29236
|
+
}
|
|
29237
|
+
}
|
|
29238
|
+
}
|
|
29239
|
+
this.clearCacheValue();
|
|
29240
|
+
}
|
|
29057
29241
|
}
|
|
29058
29242
|
value() {
|
|
29059
29243
|
return this.records?.length >= 1 ? this.sum : undefined;
|
|
@@ -29123,6 +29307,36 @@
|
|
|
29123
29307
|
this.count++;
|
|
29124
29308
|
}
|
|
29125
29309
|
}
|
|
29310
|
+
this.clearCacheValue();
|
|
29311
|
+
}
|
|
29312
|
+
deleteRecord(record) {
|
|
29313
|
+
if (record) {
|
|
29314
|
+
if (this.isRecord && this.records) {
|
|
29315
|
+
this.records = this.records.filter(item => item !== record);
|
|
29316
|
+
}
|
|
29317
|
+
if (record.className === 'Aggregator') {
|
|
29318
|
+
this.count -= record.value();
|
|
29319
|
+
}
|
|
29320
|
+
else {
|
|
29321
|
+
this.count--;
|
|
29322
|
+
}
|
|
29323
|
+
}
|
|
29324
|
+
this.clearCacheValue();
|
|
29325
|
+
}
|
|
29326
|
+
updateRecord(oldRecord, newRecord) {
|
|
29327
|
+
if (oldRecord && newRecord) {
|
|
29328
|
+
if (this.isRecord && this.records) {
|
|
29329
|
+
this.records = this.records.map(item => {
|
|
29330
|
+
if (item === oldRecord) {
|
|
29331
|
+
return newRecord;
|
|
29332
|
+
}
|
|
29333
|
+
return item;
|
|
29334
|
+
});
|
|
29335
|
+
}
|
|
29336
|
+
if (oldRecord.className === 'Aggregator') {
|
|
29337
|
+
this.count += newRecord.value() - oldRecord.value();
|
|
29338
|
+
}
|
|
29339
|
+
}
|
|
29126
29340
|
}
|
|
29127
29341
|
value() {
|
|
29128
29342
|
return this.count;
|
|
@@ -29170,6 +29384,43 @@
|
|
|
29170
29384
|
this.count++;
|
|
29171
29385
|
}
|
|
29172
29386
|
}
|
|
29387
|
+
this.clearCacheValue();
|
|
29388
|
+
}
|
|
29389
|
+
deleteRecord(record) {
|
|
29390
|
+
if (record) {
|
|
29391
|
+
if (this.isRecord && this.records) {
|
|
29392
|
+
this.records = this.records.filter(item => item !== record);
|
|
29393
|
+
}
|
|
29394
|
+
if (record.className === 'Aggregator' && record.type === AggregationType.AVG) {
|
|
29395
|
+
this.sum -= record.sum;
|
|
29396
|
+
this.count -= record.count;
|
|
29397
|
+
}
|
|
29398
|
+
else if (this.field && !isNaN(parseFloat(record[this.field]))) {
|
|
29399
|
+
this.sum -= parseFloat(record[this.field]);
|
|
29400
|
+
this.count--;
|
|
29401
|
+
}
|
|
29402
|
+
}
|
|
29403
|
+
this.clearCacheValue();
|
|
29404
|
+
}
|
|
29405
|
+
updateRecord(oldRecord, newRecord) {
|
|
29406
|
+
if (oldRecord && newRecord) {
|
|
29407
|
+
if (this.isRecord && this.records) {
|
|
29408
|
+
this.records = this.records.map(item => {
|
|
29409
|
+
if (item === oldRecord) {
|
|
29410
|
+
return newRecord;
|
|
29411
|
+
}
|
|
29412
|
+
return item;
|
|
29413
|
+
});
|
|
29414
|
+
}
|
|
29415
|
+
if (oldRecord.className === 'Aggregator' && oldRecord.type === AggregationType.AVG) {
|
|
29416
|
+
this.sum += newRecord.sum - oldRecord.sum;
|
|
29417
|
+
this.count += newRecord.count - oldRecord.count;
|
|
29418
|
+
}
|
|
29419
|
+
else if (this.field && !isNaN(parseFloat(oldRecord[this.field]))) {
|
|
29420
|
+
this.sum += parseFloat(newRecord[this.field]) - parseFloat(oldRecord[this.field]);
|
|
29421
|
+
}
|
|
29422
|
+
this.clearCacheValue();
|
|
29423
|
+
}
|
|
29173
29424
|
}
|
|
29174
29425
|
value() {
|
|
29175
29426
|
return this.records?.length >= 1 ? this.sum / this.count : undefined;
|
|
@@ -29224,6 +29475,28 @@
|
|
|
29224
29475
|
this.max = parseFloat(record[this.field]) > this.max ? parseFloat(record[this.field]) : this.max;
|
|
29225
29476
|
}
|
|
29226
29477
|
}
|
|
29478
|
+
this.clearCacheValue();
|
|
29479
|
+
}
|
|
29480
|
+
deleteRecord(record) {
|
|
29481
|
+
if (record) {
|
|
29482
|
+
if (this.isRecord && this.records) {
|
|
29483
|
+
this.records = this.records.filter(item => item !== record);
|
|
29484
|
+
}
|
|
29485
|
+
this.recalculate();
|
|
29486
|
+
}
|
|
29487
|
+
}
|
|
29488
|
+
updateRecord(oldRecord, newRecord) {
|
|
29489
|
+
if (oldRecord && newRecord) {
|
|
29490
|
+
if (this.isRecord && this.records) {
|
|
29491
|
+
this.records = this.records.map(item => {
|
|
29492
|
+
if (item === oldRecord) {
|
|
29493
|
+
return newRecord;
|
|
29494
|
+
}
|
|
29495
|
+
return item;
|
|
29496
|
+
});
|
|
29497
|
+
}
|
|
29498
|
+
this.recalculate();
|
|
29499
|
+
}
|
|
29227
29500
|
}
|
|
29228
29501
|
value() {
|
|
29229
29502
|
return this.records?.length >= 1 ? this.max : undefined;
|
|
@@ -29277,6 +29550,28 @@
|
|
|
29277
29550
|
this.min = record[this.field] < this.min ? record[this.field] : this.min;
|
|
29278
29551
|
}
|
|
29279
29552
|
}
|
|
29553
|
+
this.clearCacheValue();
|
|
29554
|
+
}
|
|
29555
|
+
deleteRecord(record) {
|
|
29556
|
+
if (record) {
|
|
29557
|
+
if (this.isRecord && this.records) {
|
|
29558
|
+
this.records = this.records.filter(item => item !== record);
|
|
29559
|
+
}
|
|
29560
|
+
this.recalculate();
|
|
29561
|
+
}
|
|
29562
|
+
}
|
|
29563
|
+
updateRecord(oldRecord, newRecord) {
|
|
29564
|
+
if (oldRecord && newRecord) {
|
|
29565
|
+
if (this.isRecord && this.records) {
|
|
29566
|
+
this.records = this.records.map(item => {
|
|
29567
|
+
if (item === oldRecord) {
|
|
29568
|
+
return newRecord;
|
|
29569
|
+
}
|
|
29570
|
+
return item;
|
|
29571
|
+
});
|
|
29572
|
+
}
|
|
29573
|
+
this.recalculate();
|
|
29574
|
+
}
|
|
29280
29575
|
}
|
|
29281
29576
|
value() {
|
|
29282
29577
|
return this.records?.length >= 1 ? this.min : undefined;
|
|
@@ -29530,15 +29825,15 @@
|
|
|
29530
29825
|
registedAggregators = {};
|
|
29531
29826
|
rowHierarchyType;
|
|
29532
29827
|
fieldAggregators = [];
|
|
29533
|
-
|
|
29828
|
+
columns;
|
|
29534
29829
|
lastFilterRules;
|
|
29535
|
-
constructor(dataSourceObj, dataConfig, pagination,
|
|
29830
|
+
constructor(dataSourceObj, dataConfig, pagination, columns, rowHierarchyType, hierarchyExpandLevel) {
|
|
29536
29831
|
super();
|
|
29537
29832
|
this.registerAggregators();
|
|
29538
29833
|
this.dataSourceObj = dataSourceObj;
|
|
29539
29834
|
this.dataConfig = dataConfig;
|
|
29540
29835
|
this._get = dataSourceObj?.get;
|
|
29541
|
-
this.
|
|
29836
|
+
this.columns = columns;
|
|
29542
29837
|
this._source = dataSourceObj?.records ? this.processRecords(dataSourceObj?.records) : dataSourceObj;
|
|
29543
29838
|
this._sourceLength = this._source?.length || 0;
|
|
29544
29839
|
this.sortedIndexMap = new Map();
|
|
@@ -29600,9 +29895,9 @@
|
|
|
29600
29895
|
this.registerAggregator(AggregationType.CUSTOM, CustomAggregator);
|
|
29601
29896
|
}
|
|
29602
29897
|
_generateFieldAggragations() {
|
|
29603
|
-
const columnObjs = this.
|
|
29898
|
+
const columnObjs = this.columns;
|
|
29604
29899
|
for (let i = 0; i < columnObjs?.length; i++) {
|
|
29605
|
-
columnObjs[i].
|
|
29900
|
+
delete columnObjs[i].vtable_aggregator;
|
|
29606
29901
|
const field = columnObjs[i].field;
|
|
29607
29902
|
const aggragation = columnObjs[i].aggregation;
|
|
29608
29903
|
if (!aggragation) {
|
|
@@ -29618,10 +29913,10 @@
|
|
|
29618
29913
|
aggregationFun: item.aggregationFun
|
|
29619
29914
|
});
|
|
29620
29915
|
this.fieldAggregators.push(aggregator);
|
|
29621
|
-
if (!columnObjs[i].
|
|
29622
|
-
columnObjs[i].
|
|
29916
|
+
if (!columnObjs[i].vtable_aggregator) {
|
|
29917
|
+
columnObjs[i].vtable_aggregator = [];
|
|
29623
29918
|
}
|
|
29624
|
-
columnObjs[i].
|
|
29919
|
+
columnObjs[i].vtable_aggregator.push(aggregator);
|
|
29625
29920
|
}
|
|
29626
29921
|
}
|
|
29627
29922
|
else {
|
|
@@ -29632,7 +29927,7 @@
|
|
|
29632
29927
|
aggregationFun: aggragation.aggregationFun
|
|
29633
29928
|
});
|
|
29634
29929
|
this.fieldAggregators.push(aggregator);
|
|
29635
|
-
columnObjs[i].
|
|
29930
|
+
columnObjs[i].vtable_aggregator = aggregator;
|
|
29636
29931
|
}
|
|
29637
29932
|
}
|
|
29638
29933
|
}
|
|
@@ -29710,6 +30005,9 @@
|
|
|
29710
30005
|
if (childNodeData.hierarchyState === HierarchyState.expand) {
|
|
29711
30006
|
childTotalLength += this.initChildrenNodeHierarchy(childIndexKey, hierarchyExpandLevel, currentLevel + 1, childNodeData);
|
|
29712
30007
|
}
|
|
30008
|
+
if (childNodeData.children === true) {
|
|
30009
|
+
!childNodeData.hierarchyState && (childNodeData.hierarchyState = HierarchyState.collapse);
|
|
30010
|
+
}
|
|
29713
30011
|
}
|
|
29714
30012
|
return childTotalLength;
|
|
29715
30013
|
}
|
|
@@ -29921,6 +30219,9 @@
|
|
|
29921
30219
|
this.adjustBeforeChangedRecordsMap(index, 1);
|
|
29922
30220
|
this.currentIndexedData.push(this.currentIndexedData.length);
|
|
29923
30221
|
this._sourceLength += 1;
|
|
30222
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) {
|
|
30223
|
+
this.fieldAggregators[i].push(record);
|
|
30224
|
+
}
|
|
29924
30225
|
if (this.rowHierarchyType === 'tree') {
|
|
29925
30226
|
this.initTreeHierarchyState();
|
|
29926
30227
|
}
|
|
@@ -29952,6 +30253,11 @@
|
|
|
29952
30253
|
this.currentIndexedData.push(this.currentIndexedData.length);
|
|
29953
30254
|
}
|
|
29954
30255
|
this._sourceLength += recordArr.length;
|
|
30256
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) {
|
|
30257
|
+
for (let j = 0; j < recordArr.length; j++) {
|
|
30258
|
+
this.fieldAggregators[i].push(recordArr[j]);
|
|
30259
|
+
}
|
|
30260
|
+
}
|
|
29955
30261
|
}
|
|
29956
30262
|
if (this.userPagination) {
|
|
29957
30263
|
this.pagination.totalCount = this._sourceLength;
|
|
@@ -30021,6 +30327,10 @@
|
|
|
30021
30327
|
}
|
|
30022
30328
|
delete this.beforeChangedRecordsMap[recordIndex];
|
|
30023
30329
|
realDeletedRecordIndexs.push(recordIndex);
|
|
30330
|
+
const deletedRecord = this.records[recordIndex];
|
|
30331
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) {
|
|
30332
|
+
this.fieldAggregators[i].deleteRecord(deletedRecord);
|
|
30333
|
+
}
|
|
30024
30334
|
this.records.splice(recordIndex, 1);
|
|
30025
30335
|
this.currentIndexedData.pop();
|
|
30026
30336
|
this._sourceLength -= 1;
|
|
@@ -30069,6 +30379,9 @@
|
|
|
30069
30379
|
}
|
|
30070
30380
|
delete this.beforeChangedRecordsMap[recordIndex];
|
|
30071
30381
|
realDeletedRecordIndexs.push(recordIndex);
|
|
30382
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) {
|
|
30383
|
+
this.fieldAggregators[i].updateRecord(this.records[recordIndex], records[index]);
|
|
30384
|
+
}
|
|
30072
30385
|
this.records[recordIndex] = records[index];
|
|
30073
30386
|
}
|
|
30074
30387
|
if (this.userPagination) {
|
|
@@ -30093,8 +30406,8 @@
|
|
|
30093
30406
|
}
|
|
30094
30407
|
sort(states) {
|
|
30095
30408
|
states = (Array.isArray(states) ? states : [states]).filter(state => {
|
|
30096
|
-
|
|
30097
|
-
return column?.
|
|
30409
|
+
const column = this.columns.find(obj => obj.field === state.field);
|
|
30410
|
+
return column?.sort !== false && state.order !== 'normal';
|
|
30098
30411
|
});
|
|
30099
30412
|
this.lastSortStates = states;
|
|
30100
30413
|
let filedMapArray = states.map(state => this.sortedIndexMap.get(state?.field) || { asc: [], desc: [], normal: [] });
|
|
@@ -30527,20 +30840,20 @@
|
|
|
30527
30840
|
static get EVENT_TYPE() {
|
|
30528
30841
|
return DataSource.EVENT_TYPE;
|
|
30529
30842
|
}
|
|
30530
|
-
static ofArray(array, dataConfig, pagination,
|
|
30843
|
+
static ofArray(array, dataConfig, pagination, columns, rowHierarchyType, hierarchyExpandLevel) {
|
|
30531
30844
|
return new CachedDataSource({
|
|
30532
30845
|
get: (index) => {
|
|
30533
30846
|
return array[index];
|
|
30534
30847
|
},
|
|
30535
30848
|
length: array.length,
|
|
30536
30849
|
records: array
|
|
30537
|
-
}, dataConfig, pagination,
|
|
30850
|
+
}, dataConfig, pagination, columns, rowHierarchyType, hierarchyExpandLevel);
|
|
30538
30851
|
}
|
|
30539
|
-
constructor(opt, dataConfig, pagination,
|
|
30852
|
+
constructor(opt, dataConfig, pagination, columns, rowHierarchyType, hierarchyExpandLevel) {
|
|
30540
30853
|
if (isArray$1(dataConfig?.groupByRules)) {
|
|
30541
30854
|
rowHierarchyType = 'tree';
|
|
30542
30855
|
}
|
|
30543
|
-
super(opt, dataConfig, pagination,
|
|
30856
|
+
super(opt, dataConfig, pagination, columns, rowHierarchyType, hierarchyExpandLevel);
|
|
30544
30857
|
this._recordCache = [];
|
|
30545
30858
|
this._fieldCache = {};
|
|
30546
30859
|
}
|
|
@@ -31212,7 +31525,7 @@
|
|
|
31212
31525
|
function _setRecords(table, records = []) {
|
|
31213
31526
|
_dealWithUpdateDataSource(table, () => {
|
|
31214
31527
|
table.internalProps.records = records;
|
|
31215
|
-
const newDataSource = (table.internalProps.dataSource = CachedDataSource.ofArray(records, table.internalProps.dataConfig, table.pagination, table.internalProps.
|
|
31528
|
+
const newDataSource = (table.internalProps.dataSource = CachedDataSource.ofArray(records, table.internalProps.dataConfig, table.pagination, table.internalProps.columns, table.internalProps.layoutMap.rowHierarchyType, getHierarchyExpandLevel(table)));
|
|
31216
31529
|
table.addReleaseObj(newDataSource);
|
|
31217
31530
|
});
|
|
31218
31531
|
}
|
|
@@ -31516,6 +31829,36 @@
|
|
|
31516
31829
|
}
|
|
31517
31830
|
return undefined;
|
|
31518
31831
|
}
|
|
31832
|
+
function generateAggregationForColumn(table) {
|
|
31833
|
+
for (let col = 0; col < table.internalProps.columns.length; col++) {
|
|
31834
|
+
const colDef = table.internalProps.columns[col];
|
|
31835
|
+
if (colDef.aggregation) ;
|
|
31836
|
+
else if (table.options.aggregation) {
|
|
31837
|
+
let aggregation;
|
|
31838
|
+
if (typeof table.options.aggregation === 'function') {
|
|
31839
|
+
aggregation = table.options.aggregation({
|
|
31840
|
+
col: col,
|
|
31841
|
+
field: colDef.field
|
|
31842
|
+
});
|
|
31843
|
+
}
|
|
31844
|
+
else {
|
|
31845
|
+
aggregation = table.options.aggregation;
|
|
31846
|
+
}
|
|
31847
|
+
if (aggregation) {
|
|
31848
|
+
if (Array.isArray(aggregation)) {
|
|
31849
|
+
const aggregations = [];
|
|
31850
|
+
aggregation.forEach(item => {
|
|
31851
|
+
aggregations.push(Object.assign({ showOnTop: false }, item));
|
|
31852
|
+
});
|
|
31853
|
+
colDef.aggregation = aggregations;
|
|
31854
|
+
}
|
|
31855
|
+
else {
|
|
31856
|
+
colDef.aggregation = Object.assign({ showOnTop: false }, aggregation);
|
|
31857
|
+
}
|
|
31858
|
+
}
|
|
31859
|
+
}
|
|
31860
|
+
}
|
|
31861
|
+
}
|
|
31519
31862
|
|
|
31520
31863
|
let Icon$1 = class Icon extends Image$2 {
|
|
31521
31864
|
role;
|
|
@@ -32248,9 +32591,9 @@
|
|
|
32248
32591
|
return {
|
|
32249
32592
|
type: 'svg',
|
|
32250
32593
|
svg: '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">' +
|
|
32251
|
-
' <path d="M4.6665 9H11.3332L7.99984 13.1667L4.6665 9Z" fill="#
|
|
32252
|
-
'<path d="M11.3335 7L4.66683 7L8.00016 2.83333L11.3335 7Z" fill="#
|
|
32253
|
-
'
|
|
32594
|
+
' <path d="M4.6665 9H11.3332L7.99984 13.1667L4.6665 9Z" fill="#416EFF"/>' +
|
|
32595
|
+
'<path d="M11.3335 7L4.66683 7L8.00016 2.83333L11.3335 7Z" fill="#282F38" fill-opacity="0.35"/>' +
|
|
32596
|
+
'</svg> ',
|
|
32254
32597
|
width: 16,
|
|
32255
32598
|
height: 16,
|
|
32256
32599
|
funcType: IconFuncTypeEnum.sort,
|
|
@@ -32269,9 +32612,9 @@
|
|
|
32269
32612
|
return {
|
|
32270
32613
|
type: 'svg',
|
|
32271
32614
|
svg: '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">' +
|
|
32272
|
-
' <path d="M4.6665 9H11.3332L7.99984 13.1667L4.6665 9Z" fill="#
|
|
32273
|
-
'<path d="M11.3335 7L4.66683 7L8.00016 2.83333L11.3335 7Z" fill="#
|
|
32274
|
-
'</svg>
|
|
32615
|
+
' <path d="M4.6665 9H11.3332L7.99984 13.1667L4.6665 9Z" fill="#282F38" fill-opacity="0.35"/>' +
|
|
32616
|
+
'<path d="M11.3335 7L4.66683 7L8.00016 2.83333L11.3335 7Z" fill="#416EFF"/>' +
|
|
32617
|
+
' </svg>',
|
|
32275
32618
|
width: 16,
|
|
32276
32619
|
height: 16,
|
|
32277
32620
|
funcType: IconFuncTypeEnum.sort,
|
|
@@ -34657,7 +35000,7 @@
|
|
|
34657
35000
|
fontSize: DefaultTextStyle.fontSize
|
|
34658
35001
|
},
|
|
34659
35002
|
getTextBounds: useNaiveCanvas ? undefined : getTextBounds,
|
|
34660
|
-
specialCharSet: `{}()//&-/: .,@%'"
|
|
35003
|
+
specialCharSet: `{}()//&-/: .,@%'"~…=——${TextMeasure.ALPHABET_CHAR_SET}${TextMeasure.ALPHABET_CHAR_SET.toUpperCase()}0123456789${customAlphabetCharSet}`,
|
|
34661
35004
|
...(option ?? {})
|
|
34662
35005
|
}, textSpec);
|
|
34663
35006
|
};
|
|
@@ -38298,6 +38641,16 @@
|
|
|
38298
38641
|
if (bottomRight) {
|
|
38299
38642
|
x = Math.floor(x) - 0.5;
|
|
38300
38643
|
y = Math.floor(y) - 0.5;
|
|
38644
|
+
if (group.role === 'cell') {
|
|
38645
|
+
const col = group.col;
|
|
38646
|
+
const row = group.row;
|
|
38647
|
+
if (col === 0) {
|
|
38648
|
+
x += 1;
|
|
38649
|
+
}
|
|
38650
|
+
if (row === 0) {
|
|
38651
|
+
y += 1;
|
|
38652
|
+
}
|
|
38653
|
+
}
|
|
38301
38654
|
}
|
|
38302
38655
|
else {
|
|
38303
38656
|
x = Math.floor(x) + 0.5;
|
|
@@ -38574,6 +38927,16 @@
|
|
|
38574
38927
|
if (bottomRight) {
|
|
38575
38928
|
x = Math.floor(x) - 0.5;
|
|
38576
38929
|
y = Math.floor(y) - 0.5;
|
|
38930
|
+
if (group.role === 'cell') {
|
|
38931
|
+
const col = group.col;
|
|
38932
|
+
const row = group.row;
|
|
38933
|
+
if (col === 0) {
|
|
38934
|
+
x += 1;
|
|
38935
|
+
}
|
|
38936
|
+
if (row === 0) {
|
|
38937
|
+
y += 1;
|
|
38938
|
+
}
|
|
38939
|
+
}
|
|
38577
38940
|
}
|
|
38578
38941
|
else {
|
|
38579
38942
|
x = Math.floor(x) + 0.5;
|
|
@@ -38668,6 +39031,16 @@
|
|
|
38668
39031
|
if (bottomRight) {
|
|
38669
39032
|
x = Math.floor(x) - 0.5;
|
|
38670
39033
|
y = Math.floor(y) - 0.5;
|
|
39034
|
+
if (group.role === 'cell') {
|
|
39035
|
+
const col = group.col;
|
|
39036
|
+
const row = group.row;
|
|
39037
|
+
if (col === 0) {
|
|
39038
|
+
x += 1;
|
|
39039
|
+
}
|
|
39040
|
+
if (row === 0) {
|
|
39041
|
+
y += 1;
|
|
39042
|
+
}
|
|
39043
|
+
}
|
|
38671
39044
|
}
|
|
38672
39045
|
else {
|
|
38673
39046
|
x = Math.floor(x) + 0.5;
|
|
@@ -38824,6 +39197,9 @@
|
|
|
38824
39197
|
}
|
|
38825
39198
|
function getCellSizeForDraw(group, width, height, bottomRight) {
|
|
38826
39199
|
const table = group.stage.table;
|
|
39200
|
+
if (!table) {
|
|
39201
|
+
return { width, height };
|
|
39202
|
+
}
|
|
38827
39203
|
if (group.role === 'cell') {
|
|
38828
39204
|
let col = group.col;
|
|
38829
39205
|
let row = group.row;
|
|
@@ -38832,24 +39208,30 @@
|
|
|
38832
39208
|
col = mergeInfo.end.col;
|
|
38833
39209
|
row = mergeInfo.end.row;
|
|
38834
39210
|
}
|
|
38835
|
-
if (
|
|
39211
|
+
if (col === table.colCount - 1 && !bottomRight) {
|
|
39212
|
+
width -= 1;
|
|
39213
|
+
}
|
|
39214
|
+
else if (col === table.frozenColCount - 1 && table.scrollLeft && !bottomRight) {
|
|
38836
39215
|
width -= 1;
|
|
38837
39216
|
}
|
|
38838
|
-
else if (
|
|
39217
|
+
else if (col === 0 && bottomRight) {
|
|
38839
39218
|
width -= 1;
|
|
38840
39219
|
}
|
|
38841
|
-
if (
|
|
39220
|
+
if (row === table.rowCount - 1 && !bottomRight) {
|
|
38842
39221
|
height -= 1;
|
|
38843
39222
|
}
|
|
38844
|
-
else if (
|
|
39223
|
+
else if (row === table.frozenRowCount - 1 && table.scrollTop && !bottomRight) {
|
|
39224
|
+
height -= 1;
|
|
39225
|
+
}
|
|
39226
|
+
else if (row === 0 && bottomRight) {
|
|
38845
39227
|
height -= 1;
|
|
38846
39228
|
}
|
|
38847
39229
|
}
|
|
38848
39230
|
else if (group.role === 'corner-frozen') {
|
|
38849
|
-
if (table
|
|
39231
|
+
if (table.scrollLeft && !bottomRight) {
|
|
38850
39232
|
width -= 1;
|
|
38851
39233
|
}
|
|
38852
|
-
if (table
|
|
39234
|
+
if (table.scrollTop && !bottomRight) {
|
|
38853
39235
|
height -= 1;
|
|
38854
39236
|
}
|
|
38855
39237
|
}
|
|
@@ -42899,7 +43281,7 @@
|
|
|
42899
43281
|
});
|
|
42900
43282
|
scene.frozenColCount = scene.table.frozenColCount;
|
|
42901
43283
|
scene.frozenRowCount = scene.colHeaderGroup.firstChild?.childrenCount ?? 0;
|
|
42902
|
-
scene.proxy.colStart = scene.table.frozenColCount;
|
|
43284
|
+
scene.proxy.colStart = scene.bodyGroup.firstChild?.col ?? scene.table.frozenColCount;
|
|
42903
43285
|
scene.bodyGroup.setAttribute('x', scene.rowHeaderGroup.attribute.width);
|
|
42904
43286
|
scene.colHeaderGroup.setAttribute('x', scene.cornerHeaderGroup.attribute.width);
|
|
42905
43287
|
scene.updateContainer();
|
|
@@ -48067,12 +48449,17 @@
|
|
|
48067
48449
|
updateSortState(sortState) {
|
|
48068
48450
|
sortState = Array.isArray(sortState) ? sortState : [sortState];
|
|
48069
48451
|
for (let index = 0; index < sortState.length; index++) {
|
|
48070
|
-
if (
|
|
48452
|
+
if (sortState[index].field === this.sort[index]?.field &&
|
|
48453
|
+
sortState[sortState.length - 1].order === this.sort[index]?.order) {
|
|
48071
48454
|
return;
|
|
48072
48455
|
}
|
|
48073
48456
|
const oldSortCol = this.table.internalProps.multipleSort ? null : this.sort[index]?.col || null;
|
|
48074
48457
|
const oldSortRow = this.table.internalProps.multipleSort ? null : this.sort[index]?.row || null;
|
|
48075
|
-
this.sort[index]?.order === 'asc'
|
|
48458
|
+
this.sort[index]?.order === 'asc'
|
|
48459
|
+
? 'sort_downward'
|
|
48460
|
+
: this.sort[index]?.order === 'desc'
|
|
48461
|
+
? 'sort_upward'
|
|
48462
|
+
: 'sort_normal';
|
|
48076
48463
|
this.setSortState(sortState);
|
|
48077
48464
|
const cellAddress = this.table.internalProps.layoutMap.getHeaderCellAddressByField(sortState[index].field);
|
|
48078
48465
|
this.sort[index].col = cellAddress.col;
|
|
@@ -48973,6 +49360,9 @@
|
|
|
48973
49360
|
}
|
|
48974
49361
|
});
|
|
48975
49362
|
table.scenegraph.tableGroup.addEventListener('pointertap', (e) => {
|
|
49363
|
+
if (table.stateManager.columnResize.resizing) {
|
|
49364
|
+
return;
|
|
49365
|
+
}
|
|
48976
49366
|
const eventArgsSet = getCellEventArgsSet(e);
|
|
48977
49367
|
if (!eventManager.touchMove &&
|
|
48978
49368
|
e.button === 0 &&
|
|
@@ -52042,7 +52432,7 @@
|
|
|
52042
52432
|
if (order) {
|
|
52043
52433
|
order = order.toUpperCase();
|
|
52044
52434
|
}
|
|
52045
|
-
const sortIcon = order === 'ASC' ? this.
|
|
52435
|
+
const sortIcon = order === 'ASC' ? this.upIcon : order === 'DESC' ? this.downIcon : this.normalIcon;
|
|
52046
52436
|
if (sortIcon) {
|
|
52047
52437
|
icons.push(sortIcon);
|
|
52048
52438
|
}
|
|
@@ -52161,7 +52551,7 @@
|
|
|
52161
52551
|
return frozen;
|
|
52162
52552
|
}
|
|
52163
52553
|
getSortIcon(order, _table, col, row) {
|
|
52164
|
-
const icon = order === 'asc' ? this.
|
|
52554
|
+
const icon = order === 'asc' ? this.upIcon : order === 'desc' ? this.downIcon : this.normalIcon;
|
|
52165
52555
|
const headerC = _table.getHeaderDefine(col, row);
|
|
52166
52556
|
if (!headerC ||
|
|
52167
52557
|
headerC.showSort === false ||
|
|
@@ -52179,7 +52569,7 @@
|
|
|
52179
52569
|
(headerC.columns && headerC.columns.length > 0)) {
|
|
52180
52570
|
return null;
|
|
52181
52571
|
}
|
|
52182
|
-
const icon = order?.toUpperCase() === 'ASC' ? this.
|
|
52572
|
+
const icon = order?.toUpperCase() === 'ASC' ? this.upIcon : order?.toUpperCase() === 'DESC' ? this.downIcon : this.normalIcon;
|
|
52183
52573
|
return icon;
|
|
52184
52574
|
}
|
|
52185
52575
|
getDropDownStateIcons(_table, col, row) {
|
|
@@ -53319,9 +53709,9 @@
|
|
|
53319
53709
|
const column = columnObjects[i];
|
|
53320
53710
|
if (column?.aggregation) {
|
|
53321
53711
|
if (Array.isArray(column?.aggregation)) {
|
|
53322
|
-
count = Math.max(count, column.aggregation.filter(item => item.showOnTop
|
|
53712
|
+
count = Math.max(count, column.aggregation.filter(item => item.showOnTop).length);
|
|
53323
53713
|
}
|
|
53324
|
-
else if (column.aggregation.showOnTop
|
|
53714
|
+
else if (column.aggregation.showOnTop) {
|
|
53325
53715
|
count = Math.max(count, 1);
|
|
53326
53716
|
}
|
|
53327
53717
|
}
|
|
@@ -53335,9 +53725,9 @@
|
|
|
53335
53725
|
const column = columnObjects[i];
|
|
53336
53726
|
if (column?.aggregation) {
|
|
53337
53727
|
if (Array.isArray(column?.aggregation)) {
|
|
53338
|
-
count = Math.max(count, column.aggregation.filter(item => item.showOnTop
|
|
53728
|
+
count = Math.max(count, column.aggregation.filter(item => !item.showOnTop).length);
|
|
53339
53729
|
}
|
|
53340
|
-
else if (column.aggregation.showOnTop
|
|
53730
|
+
else if (!column.aggregation.showOnTop) {
|
|
53341
53731
|
count = Math.max(count, 1);
|
|
53342
53732
|
}
|
|
53343
53733
|
}
|
|
@@ -54781,7 +55171,7 @@
|
|
|
54781
55171
|
return TABLE_EVENT_TYPE;
|
|
54782
55172
|
}
|
|
54783
55173
|
options;
|
|
54784
|
-
version = "1.7.
|
|
55174
|
+
version = "1.7.9-alpha.0";
|
|
54785
55175
|
pagination;
|
|
54786
55176
|
id = `VTable${Date.now()}`;
|
|
54787
55177
|
headerStyleCache;
|
|
@@ -58896,25 +59286,25 @@
|
|
|
58896
59286
|
return this._hasAggregationOnBottomCount;
|
|
58897
59287
|
}
|
|
58898
59288
|
getAggregatorsByCell(col, row) {
|
|
58899
|
-
const column = this.
|
|
58900
|
-
const aggregators = column.
|
|
59289
|
+
const column = this.getColumnDefine(col, row);
|
|
59290
|
+
const aggregators = column.vtable_aggregator;
|
|
58901
59291
|
return aggregators;
|
|
58902
59292
|
}
|
|
58903
59293
|
getAggregatorsByCellRange(startCol, startRow, endCol, endRow) {
|
|
58904
59294
|
let aggregators = [];
|
|
58905
59295
|
if (this.transpose) {
|
|
58906
59296
|
for (let i = startRow; i <= endRow; i++) {
|
|
58907
|
-
const column = this.
|
|
58908
|
-
if (column.
|
|
58909
|
-
aggregators = aggregators.concat(Array.isArray(column.
|
|
59297
|
+
const column = this.getColumnDefine(startCol, i);
|
|
59298
|
+
if (column.vtable_aggregator) {
|
|
59299
|
+
aggregators = aggregators.concat(Array.isArray(column.vtable_aggregator) ? column.vtable_aggregator : [column.vtable_aggregator]);
|
|
58910
59300
|
}
|
|
58911
59301
|
}
|
|
58912
59302
|
}
|
|
58913
59303
|
else {
|
|
58914
59304
|
for (let i = startCol; i <= endCol; i++) {
|
|
58915
|
-
const column = this.
|
|
58916
|
-
if (column.
|
|
58917
|
-
aggregators = aggregators.concat(Array.isArray(column.
|
|
59305
|
+
const column = this.getColumnDefine(i, startRow);
|
|
59306
|
+
if (column.vtable_aggregator) {
|
|
59307
|
+
aggregators = aggregators.concat(Array.isArray(column.vtable_aggregator) ? column.vtable_aggregator : [column.vtable_aggregator]);
|
|
58918
59308
|
}
|
|
58919
59309
|
}
|
|
58920
59310
|
return aggregators;
|
|
@@ -58922,8 +59312,8 @@
|
|
|
58922
59312
|
return [];
|
|
58923
59313
|
}
|
|
58924
59314
|
getAggregatorOnTop(col, row) {
|
|
58925
|
-
const column = this.
|
|
58926
|
-
const aggregators = column.
|
|
59315
|
+
const column = this.getColumnDefine(col, row);
|
|
59316
|
+
const aggregators = column.vtable_aggregator;
|
|
58927
59317
|
const aggregation = column.aggregation;
|
|
58928
59318
|
if (Array.isArray(aggregation)) {
|
|
58929
59319
|
const topAggregationIndexs = aggregation.reduce((indexs, agg, index) => {
|
|
@@ -58947,12 +59337,12 @@
|
|
|
58947
59337
|
return null;
|
|
58948
59338
|
}
|
|
58949
59339
|
getAggregatorOnBottom(col, row) {
|
|
58950
|
-
const column = this.
|
|
58951
|
-
const aggregators = column.
|
|
59340
|
+
const column = this.getColumnDefine(col, row);
|
|
59341
|
+
const aggregators = column.vtable_aggregator;
|
|
58952
59342
|
const aggregation = column.aggregation;
|
|
58953
59343
|
if (Array.isArray(aggregation)) {
|
|
58954
59344
|
const bottomAggregationIndexs = aggregation.reduce((indexs, agg, index) => {
|
|
58955
|
-
if (agg.showOnTop
|
|
59345
|
+
if (!agg.showOnTop) {
|
|
58956
59346
|
indexs.push(index);
|
|
58957
59347
|
}
|
|
58958
59348
|
return indexs;
|
|
@@ -58964,10 +59354,10 @@
|
|
|
58964
59354
|
return bottomAggregators[row - (this.rowCount - this.hasAggregationOnBottomCount)];
|
|
58965
59355
|
}
|
|
58966
59356
|
if (this.transpose && col - (this.colCount - this.hasAggregationOnBottomCount) === 0) {
|
|
58967
|
-
return aggregation?.showOnTop
|
|
59357
|
+
return !aggregation?.showOnTop ? aggregators : null;
|
|
58968
59358
|
}
|
|
58969
59359
|
else if (!this.transpose && row - (this.rowCount - this.hasAggregationOnBottomCount) === 0) {
|
|
58970
|
-
return aggregation?.showOnTop
|
|
59360
|
+
return !aggregation?.showOnTop ? aggregators : null;
|
|
58971
59361
|
}
|
|
58972
59362
|
return null;
|
|
58973
59363
|
}
|
|
@@ -58977,8 +59367,8 @@
|
|
|
58977
59367
|
const bottomCount = this.hasAggregationOnBottomCount;
|
|
58978
59368
|
if (this.transpose) {
|
|
58979
59369
|
for (let row = startRow; row <= endRow; row++) {
|
|
58980
|
-
const column = this.
|
|
58981
|
-
if (column.
|
|
59370
|
+
const column = this.getColumnDefine(startCol, row);
|
|
59371
|
+
if (column.vtable_aggregator) {
|
|
58982
59372
|
for (let i = 0; i < topCount; i++) {
|
|
58983
59373
|
cellAddrs.push({ col: this.headerLevelCount + i, row });
|
|
58984
59374
|
}
|
|
@@ -58990,8 +59380,8 @@
|
|
|
58990
59380
|
}
|
|
58991
59381
|
else {
|
|
58992
59382
|
for (let col = startCol; col <= endCol; col++) {
|
|
58993
|
-
const column = this.
|
|
58994
|
-
if (column.
|
|
59383
|
+
const column = this.getColumnDefine(col, startRow);
|
|
59384
|
+
if (column.vtable_aggregator) {
|
|
58995
59385
|
for (let i = 0; i < topCount; i++) {
|
|
58996
59386
|
cellAddrs.push({ col, row: this.headerLevelCount + i });
|
|
58997
59387
|
}
|
|
@@ -59457,7 +59847,7 @@
|
|
|
59457
59847
|
define: hd,
|
|
59458
59848
|
columnWidthComputeMode: hd.columnWidthComputeMode,
|
|
59459
59849
|
disableColumnResize: hd?.disableColumnResize,
|
|
59460
|
-
aggregation:
|
|
59850
|
+
aggregation: hd.aggregation,
|
|
59461
59851
|
isChildNode: row >= 1
|
|
59462
59852
|
};
|
|
59463
59853
|
this._columnsIncludeHided.push(colDef);
|
|
@@ -59471,35 +59861,6 @@
|
|
|
59471
59861
|
});
|
|
59472
59862
|
return results;
|
|
59473
59863
|
}
|
|
59474
|
-
_getAggregationForColumn(colDef, col) {
|
|
59475
|
-
let aggregation;
|
|
59476
|
-
if (colDef.aggregation) {
|
|
59477
|
-
aggregation = colDef.aggregation;
|
|
59478
|
-
}
|
|
59479
|
-
else if (this._table.options.aggregation) {
|
|
59480
|
-
if (typeof this._table.options.aggregation === 'function') {
|
|
59481
|
-
aggregation = this._table.options.aggregation({
|
|
59482
|
-
col: col,
|
|
59483
|
-
field: colDef.field
|
|
59484
|
-
});
|
|
59485
|
-
}
|
|
59486
|
-
else {
|
|
59487
|
-
aggregation = this._table.options.aggregation;
|
|
59488
|
-
}
|
|
59489
|
-
}
|
|
59490
|
-
if (aggregation) {
|
|
59491
|
-
if (Array.isArray(aggregation)) {
|
|
59492
|
-
return aggregation.map(item => {
|
|
59493
|
-
if (!isValid$1(item.showOnTop)) {
|
|
59494
|
-
item.showOnTop = false;
|
|
59495
|
-
}
|
|
59496
|
-
return item;
|
|
59497
|
-
});
|
|
59498
|
-
}
|
|
59499
|
-
return Object.assign({ showOnTop: false }, aggregation);
|
|
59500
|
-
}
|
|
59501
|
-
return null;
|
|
59502
|
-
}
|
|
59503
59864
|
_newRow(row, hideColumnsSubHeader = false) {
|
|
59504
59865
|
if (this._headerCellIds[row]) {
|
|
59505
59866
|
const prev = this._headerCellIds[row - 1];
|
|
@@ -59579,8 +59940,8 @@
|
|
|
59579
59940
|
else if (this.transpose &&
|
|
59580
59941
|
this.isSeriesNumberInBody(target.col, target.row) &&
|
|
59581
59942
|
this.isSeriesNumberInBody(source.col, source.row)) {
|
|
59582
|
-
if (this.
|
|
59583
|
-
this.
|
|
59943
|
+
if (this.getBody(source.col + this.leftRowSeriesNumberColumnCount, source.row).isChildNode &&
|
|
59944
|
+
this.getBody(target.col + this.leftRowSeriesNumberColumnCount, target.row).isChildNode) {
|
|
59584
59945
|
source.col = source.col + this.leftRowSeriesNumberColumnCount + this.rowHeaderLevelCount - 1;
|
|
59585
59946
|
target.col = target.col + this.leftRowSeriesNumberColumnCount + this.rowHeaderLevelCount - 1;
|
|
59586
59947
|
}
|
|
@@ -59785,15 +60146,15 @@
|
|
|
59785
60146
|
}, []);
|
|
59786
60147
|
return result;
|
|
59787
60148
|
}
|
|
59788
|
-
|
|
60149
|
+
getColumnDefine(col, row) {
|
|
59789
60150
|
if (col >= 0) {
|
|
59790
60151
|
if (col < this.leftRowSeriesNumberColumnCount) {
|
|
59791
|
-
return this.leftRowSeriesNumberColumn[col];
|
|
60152
|
+
return this.leftRowSeriesNumberColumn[col].define;
|
|
59792
60153
|
}
|
|
59793
60154
|
if (this.transpose) {
|
|
59794
|
-
return this._columns[row];
|
|
60155
|
+
return this._columns[row].define;
|
|
59795
60156
|
}
|
|
59796
|
-
return this._columns[col - this.leftRowSeriesNumberColumnCount];
|
|
60157
|
+
return this._columns[col - this.leftRowSeriesNumberColumnCount].define;
|
|
59797
60158
|
}
|
|
59798
60159
|
return undefined;
|
|
59799
60160
|
}
|
|
@@ -59831,6 +60192,9 @@
|
|
|
59831
60192
|
});
|
|
59832
60193
|
}
|
|
59833
60194
|
startEditCell(col, row, value) {
|
|
60195
|
+
if (this.editingEditor) {
|
|
60196
|
+
return;
|
|
60197
|
+
}
|
|
59834
60198
|
const editor = this.table.getEditor(col, row);
|
|
59835
60199
|
if (editor) {
|
|
59836
60200
|
if (this.table.internalProps.layoutMap?.isAggregation?.(col, row)) {
|
|
@@ -60260,6 +60624,14 @@
|
|
|
60260
60624
|
addRows.push({ col: 0, row });
|
|
60261
60625
|
}
|
|
60262
60626
|
}
|
|
60627
|
+
const topAggregationCount = table.internalProps.layoutMap.hasAggregationOnTopCount;
|
|
60628
|
+
const bottomAggregationCount = table.internalProps.layoutMap.hasAggregationOnBottomCount;
|
|
60629
|
+
for (let row = headerCount; row < headerCount + topAggregationCount; row++) {
|
|
60630
|
+
if (table.transpose) ;
|
|
60631
|
+
}
|
|
60632
|
+
for (let row = (table.transpose ? table.colCount : table.rowCount) - bottomAggregationCount; row < (table.transpose ? table.colCount : table.rowCount); row++) {
|
|
60633
|
+
if (table.transpose) ;
|
|
60634
|
+
}
|
|
60263
60635
|
table.transpose ? table.scenegraph.updateCol([], addRows, []) : table.scenegraph.updateRow([], addRows, []);
|
|
60264
60636
|
}
|
|
60265
60637
|
}
|
|
@@ -60346,7 +60718,28 @@
|
|
|
60346
60718
|
addRows.push({ col: 0, row });
|
|
60347
60719
|
}
|
|
60348
60720
|
}
|
|
60349
|
-
|
|
60721
|
+
const topAggregationCount = table.internalProps.layoutMap.hasAggregationOnTopCount;
|
|
60722
|
+
const bottomAggregationCount = table.internalProps.layoutMap.hasAggregationOnBottomCount;
|
|
60723
|
+
const updateRows = [];
|
|
60724
|
+
for (let row = headerCount; row < headerCount + topAggregationCount; row++) {
|
|
60725
|
+
if (table.transpose) {
|
|
60726
|
+
updateRows.push({ col: row, row: 0 });
|
|
60727
|
+
}
|
|
60728
|
+
else {
|
|
60729
|
+
updateRows.push({ col: 0, row });
|
|
60730
|
+
}
|
|
60731
|
+
}
|
|
60732
|
+
for (let row = (table.transpose ? table.colCount : table.rowCount) - bottomAggregationCount; row < (table.transpose ? table.colCount : table.rowCount); row++) {
|
|
60733
|
+
if (table.transpose) {
|
|
60734
|
+
updateRows.push({ col: row, row: 0 });
|
|
60735
|
+
}
|
|
60736
|
+
else {
|
|
60737
|
+
updateRows.push({ col: 0, row });
|
|
60738
|
+
}
|
|
60739
|
+
}
|
|
60740
|
+
table.transpose
|
|
60741
|
+
? table.scenegraph.updateCol([], addRows, updateRows)
|
|
60742
|
+
: table.scenegraph.updateRow([], addRows, updateRows);
|
|
60350
60743
|
}
|
|
60351
60744
|
}
|
|
60352
60745
|
}
|
|
@@ -60386,9 +60779,12 @@
|
|
|
60386
60779
|
table.scenegraph.createSceneGraph();
|
|
60387
60780
|
}
|
|
60388
60781
|
else {
|
|
60782
|
+
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
|
|
60783
|
+
const topAggregationCount = table.internalProps.layoutMap.hasAggregationOnTopCount;
|
|
60389
60784
|
const minRowNum = minRecordIndex -
|
|
60390
60785
|
(endIndex - perPageCount) +
|
|
60391
|
-
(table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount)
|
|
60786
|
+
(table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount) +
|
|
60787
|
+
topAggregationCount;
|
|
60392
60788
|
const updateRows = [];
|
|
60393
60789
|
const delRows = [];
|
|
60394
60790
|
for (let row = minRowNum; row < newRowCount; row++) {
|
|
@@ -60399,6 +60795,14 @@
|
|
|
60399
60795
|
updateRows.push({ col: 0, row });
|
|
60400
60796
|
}
|
|
60401
60797
|
}
|
|
60798
|
+
for (let row = headerCount; row < headerCount + topAggregationCount; row++) {
|
|
60799
|
+
if (table.transpose) {
|
|
60800
|
+
updateRows.push({ col: row, row: 0 });
|
|
60801
|
+
}
|
|
60802
|
+
else {
|
|
60803
|
+
updateRows.push({ col: 0, row });
|
|
60804
|
+
}
|
|
60805
|
+
}
|
|
60402
60806
|
if (newRowCount < oldRowCount) {
|
|
60403
60807
|
for (let row = newRowCount; row < oldRowCount; row++) {
|
|
60404
60808
|
if (table.transpose) {
|
|
@@ -60417,9 +60821,12 @@
|
|
|
60417
60821
|
}
|
|
60418
60822
|
else {
|
|
60419
60823
|
const delRows = [];
|
|
60824
|
+
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
|
|
60825
|
+
const topAggregationCount = table.internalProps.layoutMap.hasAggregationOnTopCount;
|
|
60826
|
+
const bottomAggregationCount = table.internalProps.layoutMap.hasAggregationOnBottomCount;
|
|
60420
60827
|
for (let index = 0; index < recordIndexsMinToMax.length; index++) {
|
|
60421
60828
|
const recordIndex = recordIndexsMinToMax[index];
|
|
60422
|
-
const rowNum = recordIndex +
|
|
60829
|
+
const rowNum = recordIndex + headerCount + topAggregationCount;
|
|
60423
60830
|
if (table.transpose) {
|
|
60424
60831
|
delRows.push({ col: rowNum, row: 0 });
|
|
60425
60832
|
}
|
|
@@ -60427,7 +60834,26 @@
|
|
|
60427
60834
|
delRows.push({ col: 0, row: rowNum });
|
|
60428
60835
|
}
|
|
60429
60836
|
}
|
|
60430
|
-
|
|
60837
|
+
const updateRows = [];
|
|
60838
|
+
for (let row = headerCount; row < headerCount + topAggregationCount; row++) {
|
|
60839
|
+
if (table.transpose) {
|
|
60840
|
+
updateRows.push({ col: row, row: 0 });
|
|
60841
|
+
}
|
|
60842
|
+
else {
|
|
60843
|
+
updateRows.push({ col: 0, row });
|
|
60844
|
+
}
|
|
60845
|
+
}
|
|
60846
|
+
for (let row = (table.transpose ? table.colCount : table.rowCount) - bottomAggregationCount; row < (table.transpose ? table.colCount : table.rowCount); row++) {
|
|
60847
|
+
if (table.transpose) {
|
|
60848
|
+
updateRows.push({ col: row, row: 0 });
|
|
60849
|
+
}
|
|
60850
|
+
else {
|
|
60851
|
+
updateRows.push({ col: 0, row });
|
|
60852
|
+
}
|
|
60853
|
+
}
|
|
60854
|
+
table.transpose
|
|
60855
|
+
? table.scenegraph.updateCol(delRows, [], updateRows)
|
|
60856
|
+
: table.scenegraph.updateRow(delRows, [], updateRows);
|
|
60431
60857
|
}
|
|
60432
60858
|
}
|
|
60433
60859
|
}
|
|
@@ -60456,6 +60882,8 @@
|
|
|
60456
60882
|
const recordIndexsMinToMax = updateRecordIndexs.sort((a, b) => a - b);
|
|
60457
60883
|
if (table.pagination) {
|
|
60458
60884
|
const { perPageCount, currentPage } = table.pagination;
|
|
60885
|
+
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
|
|
60886
|
+
const topAggregationCount = table.internalProps.layoutMap.hasAggregationOnTopCount;
|
|
60459
60887
|
const startIndex = perPageCount * (currentPage || 0);
|
|
60460
60888
|
const endIndex = startIndex + perPageCount;
|
|
60461
60889
|
const updateRows = [];
|
|
@@ -60464,7 +60892,8 @@
|
|
|
60464
60892
|
if (recordIndex < endIndex && recordIndex >= endIndex - perPageCount) {
|
|
60465
60893
|
const rowNum = recordIndex -
|
|
60466
60894
|
(endIndex - perPageCount) +
|
|
60467
|
-
(table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount)
|
|
60895
|
+
(table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount) +
|
|
60896
|
+
topAggregationCount;
|
|
60468
60897
|
updateRows.push(rowNum);
|
|
60469
60898
|
}
|
|
60470
60899
|
}
|
|
@@ -60479,6 +60908,14 @@
|
|
|
60479
60908
|
updateRowCells.push({ col: 0, row: updateRow });
|
|
60480
60909
|
}
|
|
60481
60910
|
}
|
|
60911
|
+
for (let row = headerCount; row < headerCount + topAggregationCount; row++) {
|
|
60912
|
+
if (table.transpose) {
|
|
60913
|
+
updateRowCells.push({ col: row, row: 0 });
|
|
60914
|
+
}
|
|
60915
|
+
else {
|
|
60916
|
+
updateRowCells.push({ col: 0, row });
|
|
60917
|
+
}
|
|
60918
|
+
}
|
|
60482
60919
|
table.transpose
|
|
60483
60920
|
? table.scenegraph.updateCol([], [], updateRowCells)
|
|
60484
60921
|
: table.scenegraph.updateRow([], [], updateRowCells);
|
|
@@ -60486,9 +60923,12 @@
|
|
|
60486
60923
|
}
|
|
60487
60924
|
else {
|
|
60488
60925
|
const updateRows = [];
|
|
60926
|
+
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
|
|
60927
|
+
const topAggregationCount = table.internalProps.layoutMap.hasAggregationOnTopCount;
|
|
60928
|
+
const bottomAggregationCount = table.internalProps.layoutMap.hasAggregationOnBottomCount;
|
|
60489
60929
|
for (let index = 0; index < recordIndexsMinToMax.length; index++) {
|
|
60490
60930
|
const recordIndex = recordIndexsMinToMax[index];
|
|
60491
|
-
const rowNum = recordIndex +
|
|
60931
|
+
const rowNum = recordIndex + headerCount + topAggregationCount;
|
|
60492
60932
|
if (table.transpose) {
|
|
60493
60933
|
updateRows.push({ col: rowNum, row: 0 });
|
|
60494
60934
|
}
|
|
@@ -60496,6 +60936,22 @@
|
|
|
60496
60936
|
updateRows.push({ col: 0, row: rowNum });
|
|
60497
60937
|
}
|
|
60498
60938
|
}
|
|
60939
|
+
for (let row = headerCount; row < headerCount + topAggregationCount; row++) {
|
|
60940
|
+
if (table.transpose) {
|
|
60941
|
+
updateRows.push({ col: row, row: 0 });
|
|
60942
|
+
}
|
|
60943
|
+
else {
|
|
60944
|
+
updateRows.push({ col: 0, row });
|
|
60945
|
+
}
|
|
60946
|
+
}
|
|
60947
|
+
for (let row = (table.transpose ? table.colCount : table.rowCount) - bottomAggregationCount; row < (table.transpose ? table.colCount : table.rowCount); row++) {
|
|
60948
|
+
if (table.transpose) {
|
|
60949
|
+
updateRows.push({ col: row, row: 0 });
|
|
60950
|
+
}
|
|
60951
|
+
else {
|
|
60952
|
+
updateRows.push({ col: 0, row });
|
|
60953
|
+
}
|
|
60954
|
+
}
|
|
60499
60955
|
table.transpose
|
|
60500
60956
|
? table.scenegraph.updateCol([], [], updateRows)
|
|
60501
60957
|
: table.scenegraph.updateRow([], [], updateRows);
|
|
@@ -60533,6 +60989,7 @@
|
|
|
60533
60989
|
: options.header
|
|
60534
60990
|
? cloneDeepSpec(options.header, ['children'])
|
|
60535
60991
|
: [];
|
|
60992
|
+
generateAggregationForColumn(this);
|
|
60536
60993
|
internalProps.enableTreeNodeMerge = options.enableTreeNodeMerge ?? isValid$1(options.groupBy) ?? false;
|
|
60537
60994
|
this.internalProps.headerHelper.setTableColumnsEditor();
|
|
60538
60995
|
this.showHeader = options.showHeader ?? true;
|
|
@@ -60595,6 +61052,7 @@
|
|
|
60595
61052
|
updateColumns(columns) {
|
|
60596
61053
|
const oldHoverState = { col: this.stateManager.hover.cellPos.col, row: this.stateManager.hover.cellPos.row };
|
|
60597
61054
|
this.internalProps.columns = cloneDeepSpec(columns, ['children']);
|
|
61055
|
+
generateAggregationForColumn(this);
|
|
60598
61056
|
this.options.columns = columns;
|
|
60599
61057
|
this.internalProps.headerHelper.setTableColumnsEditor();
|
|
60600
61058
|
this._hasAutoImageColumn = undefined;
|
|
@@ -60617,6 +61075,7 @@
|
|
|
60617
61075
|
}
|
|
60618
61076
|
set header(header) {
|
|
60619
61077
|
this.internalProps.columns = header;
|
|
61078
|
+
generateAggregationForColumn(this);
|
|
60620
61079
|
this.options.header = header;
|
|
60621
61080
|
this.refreshHeader();
|
|
60622
61081
|
this.internalProps.useOneRowHeightFillAll = false;
|
|
@@ -60800,6 +61259,7 @@
|
|
|
60800
61259
|
: options.header
|
|
60801
61260
|
? cloneDeepSpec(options.header, ['children'])
|
|
60802
61261
|
: [];
|
|
61262
|
+
generateAggregationForColumn(this);
|
|
60803
61263
|
internalProps.enableTreeNodeMerge = options.enableTreeNodeMerge ?? isValid$1(options.groupBy) ?? false;
|
|
60804
61264
|
this.internalProps.headerHelper.setTableColumnsEditor();
|
|
60805
61265
|
this.transpose = options.transpose ?? false;
|
|
@@ -69341,13 +69801,17 @@
|
|
|
69341
69801
|
indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;
|
|
69342
69802
|
customRowTree;
|
|
69343
69803
|
customColTree;
|
|
69804
|
+
customRowTreeDimensionPaths;
|
|
69805
|
+
customColTreeDimensionPaths;
|
|
69344
69806
|
colHeaderTree;
|
|
69345
69807
|
rowHeaderTree;
|
|
69346
69808
|
rowHierarchyType;
|
|
69347
69809
|
indicators;
|
|
69348
69810
|
indicatorsAsCol;
|
|
69349
69811
|
totalRecordsTree = {};
|
|
69350
|
-
|
|
69812
|
+
hasExtensionRowTree;
|
|
69813
|
+
parseCustomTreeToMatchRecords;
|
|
69814
|
+
constructor(dataConfig, rows, columns, indicatorKeys, indicators, indicatorsAsCol, records, rowHierarchyType, customColTree, customRowTree, needSplitPositiveAndNegative, hasExtensionRowTree, parseCustomTreeToMatchRecords) {
|
|
69351
69815
|
this.registerAggregators();
|
|
69352
69816
|
this.dataConfig = dataConfig;
|
|
69353
69817
|
this.filterRules = this.dataConfig?.filterRules;
|
|
@@ -69381,6 +69845,14 @@
|
|
|
69381
69845
|
this.indicators = indicators;
|
|
69382
69846
|
this.customColTree = customColTree;
|
|
69383
69847
|
this.customRowTree = customRowTree;
|
|
69848
|
+
this.hasExtensionRowTree = hasExtensionRowTree;
|
|
69849
|
+
this.parseCustomTreeToMatchRecords = parseCustomTreeToMatchRecords;
|
|
69850
|
+
if (this.parseCustomTreeToMatchRecords) {
|
|
69851
|
+
this.customColTreeDimensionPaths = this.customTreeToDimensionPathArr(this.customColTree, 'col');
|
|
69852
|
+
if (!this.hasExtensionRowTree) {
|
|
69853
|
+
this.customRowTreeDimensionPaths = this.customTreeToDimensionPathArr(this.customRowTree, 'row');
|
|
69854
|
+
}
|
|
69855
|
+
}
|
|
69384
69856
|
this.colGrandTotalLabel = this.totals?.column?.grandTotalLabel ?? '总计';
|
|
69385
69857
|
this.colSubTotalLabel = this.totals?.column?.subTotalLabel ?? '小计';
|
|
69386
69858
|
this.rowGrandTotalLabel = this.totals?.row?.grandTotalLabel ?? '总计';
|
|
@@ -69665,217 +70137,291 @@
|
|
|
69665
70137
|
}
|
|
69666
70138
|
}
|
|
69667
70139
|
}
|
|
69668
|
-
const colKey = [];
|
|
69669
|
-
const rowKey = [];
|
|
69670
70140
|
let isToTalRecord = false;
|
|
69671
|
-
|
|
69672
|
-
|
|
69673
|
-
|
|
69674
|
-
|
|
69675
|
-
|
|
69676
|
-
|
|
69677
|
-
|
|
69678
|
-
|
|
69679
|
-
|
|
69680
|
-
|
|
69681
|
-
|
|
69682
|
-
|
|
69683
|
-
|
|
69684
|
-
|
|
69685
|
-
|
|
69686
|
-
|
|
69687
|
-
|
|
69688
|
-
|
|
69689
|
-
|
|
69690
|
-
|
|
70141
|
+
const colKeys = [];
|
|
70142
|
+
const rowKeys = [];
|
|
70143
|
+
if (this.parseCustomTreeToMatchRecords &&
|
|
70144
|
+
!this.dataConfig?.isPivotChart &&
|
|
70145
|
+
this.customRowTree?.length &&
|
|
70146
|
+
!assignedIndicatorKey &&
|
|
70147
|
+
!this.hasExtensionRowTree) {
|
|
70148
|
+
const rowTreePath = this.getFieldMatchRowDimensionPaths(record);
|
|
70149
|
+
if (rowTreePath.length > 0) {
|
|
70150
|
+
for (let i = 0, len = rowTreePath.length; i < len; i++) {
|
|
70151
|
+
const rowPath = rowTreePath[i];
|
|
70152
|
+
const rowKey = [];
|
|
70153
|
+
let indicatorKey;
|
|
70154
|
+
for (let j = 0, len1 = rowPath.length; j < len1; j++) {
|
|
70155
|
+
if (isValid$1(rowPath[j].indicatorKey)) {
|
|
70156
|
+
indicatorKey = rowPath[j].indicatorKey;
|
|
70157
|
+
}
|
|
70158
|
+
else {
|
|
70159
|
+
rowKey.push(rowPath[j].value);
|
|
70160
|
+
}
|
|
69691
70161
|
}
|
|
69692
|
-
|
|
69693
|
-
break;
|
|
70162
|
+
rowKeys.push({ rowKey, indicatorKey });
|
|
69694
70163
|
}
|
|
69695
70164
|
}
|
|
69696
70165
|
}
|
|
69697
|
-
|
|
69698
|
-
const
|
|
69699
|
-
|
|
69700
|
-
|
|
69701
|
-
|
|
69702
|
-
|
|
69703
|
-
|
|
69704
|
-
|
|
69705
|
-
|
|
69706
|
-
|
|
69707
|
-
|
|
69708
|
-
|
|
69709
|
-
|
|
69710
|
-
|
|
69711
|
-
|
|
69712
|
-
|
|
69713
|
-
|
|
69714
|
-
|
|
69715
|
-
|
|
69716
|
-
|
|
69717
|
-
|
|
70166
|
+
else {
|
|
70167
|
+
const rowKey = [];
|
|
70168
|
+
rowKeys.push({ rowKey, indicatorKey: assignedIndicatorKey });
|
|
70169
|
+
for (let l = 0, len1 = this.rows.length; l < len1; l++) {
|
|
70170
|
+
const rowAttr = this.rows[l];
|
|
70171
|
+
if (rowAttr in record) {
|
|
70172
|
+
this.rowsHasValue[l] = true;
|
|
70173
|
+
rowKey.push(record[rowAttr]);
|
|
70174
|
+
}
|
|
70175
|
+
else if (rowAttr !== IndicatorDimensionKeyPlaceholder) {
|
|
70176
|
+
if (this.dataConfig?.totals?.row?.showGrandTotals &&
|
|
70177
|
+
l === 0 &&
|
|
70178
|
+
!this.rows.find((rk) => {
|
|
70179
|
+
return rk in record;
|
|
70180
|
+
})) {
|
|
70181
|
+
rowKey.push(this.rowGrandTotalLabel);
|
|
70182
|
+
isToTalRecord = true;
|
|
70183
|
+
break;
|
|
70184
|
+
}
|
|
70185
|
+
else if (this.dataConfig?.totals?.row?.subTotalsDimensions &&
|
|
70186
|
+
this.dataConfig?.totals?.row?.subTotalsDimensions.indexOf(this.rows[l - 1]) >= 0) {
|
|
70187
|
+
if (this.rowHierarchyType === 'grid') {
|
|
70188
|
+
rowKey.push(this.rowSubTotalLabel);
|
|
70189
|
+
}
|
|
70190
|
+
isToTalRecord = true;
|
|
70191
|
+
break;
|
|
70192
|
+
}
|
|
69718
70193
|
}
|
|
69719
70194
|
}
|
|
69720
70195
|
}
|
|
69721
|
-
|
|
69722
|
-
|
|
69723
|
-
|
|
69724
|
-
|
|
69725
|
-
|
|
69726
|
-
|
|
69727
|
-
if (
|
|
69728
|
-
|
|
69729
|
-
|
|
69730
|
-
|
|
69731
|
-
|
|
69732
|
-
|
|
69733
|
-
|
|
69734
|
-
|
|
69735
|
-
|
|
69736
|
-
|
|
69737
|
-
|
|
69738
|
-
|
|
69739
|
-
formatFun: this.indicators?.find((indicator) => {
|
|
69740
|
-
if (typeof indicator !== 'string') {
|
|
69741
|
-
return indicator.indicatorKey === toComputeIndicatorKeys[i];
|
|
69742
|
-
}
|
|
69743
|
-
return false;
|
|
69744
|
-
})?.format,
|
|
69745
|
-
calculateFun: calculatedFieldRule?.calculateFun,
|
|
69746
|
-
dependAggregators: this.totalRecordsTree[flatRowKey][flatColKey],
|
|
69747
|
-
dependIndicatorKeys: calculatedFieldRule?.dependIndicatorKeys
|
|
69748
|
-
});
|
|
69749
|
-
}
|
|
69750
|
-
toComputeIndicatorKeys[i] in record && this.totalRecordsTree[flatRowKey]?.[flatColKey]?.[i].push(record);
|
|
69751
|
-
}
|
|
69752
|
-
else {
|
|
69753
|
-
const aggRule = this.getAggregatorRule(toComputeIndicatorKeys[i]);
|
|
69754
|
-
if (!this.totalRecordsTree[flatRowKey]?.[flatColKey]?.[i]) {
|
|
69755
|
-
this.totalRecordsTree[flatRowKey][flatColKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM]({
|
|
69756
|
-
key: toComputeIndicatorKeys[i],
|
|
69757
|
-
dimension: aggRule?.field ?? toComputeIndicatorKeys[i],
|
|
69758
|
-
formatFun: aggRule?.formatFun ??
|
|
69759
|
-
this.indicators?.find((indicator) => {
|
|
69760
|
-
if (typeof indicator !== 'string') {
|
|
69761
|
-
return indicator.indicatorKey === toComputeIndicatorKeys[i];
|
|
69762
|
-
}
|
|
69763
|
-
return false;
|
|
69764
|
-
})?.format
|
|
69765
|
-
});
|
|
70196
|
+
if (this.parseCustomTreeToMatchRecords &&
|
|
70197
|
+
!this.dataConfig?.isPivotChart &&
|
|
70198
|
+
this.customColTree?.length &&
|
|
70199
|
+
!assignedIndicatorKey &&
|
|
70200
|
+
!this.hasExtensionRowTree) {
|
|
70201
|
+
const colTreePath = this.getFieldMatchColDimensionPaths(record);
|
|
70202
|
+
if (colTreePath.length > 0) {
|
|
70203
|
+
for (let i = 0, len = colTreePath.length; i < len; i++) {
|
|
70204
|
+
const colPath = colTreePath[i];
|
|
70205
|
+
const colKey = [];
|
|
70206
|
+
let indicatorKey;
|
|
70207
|
+
for (let j = 0, len1 = colPath.length; j < len1; j++) {
|
|
70208
|
+
if (isValid$1(colPath[j].indicatorKey)) {
|
|
70209
|
+
indicatorKey = colPath[j].indicatorKey;
|
|
70210
|
+
}
|
|
70211
|
+
else {
|
|
70212
|
+
colKey.push(colPath[j].value);
|
|
70213
|
+
}
|
|
69766
70214
|
}
|
|
69767
|
-
|
|
70215
|
+
colKeys.push({ colKey: colKey, indicatorKey });
|
|
69768
70216
|
}
|
|
69769
70217
|
}
|
|
69770
|
-
return;
|
|
69771
70218
|
}
|
|
69772
|
-
|
|
69773
|
-
|
|
69774
|
-
|
|
69775
|
-
|
|
70219
|
+
else {
|
|
70220
|
+
const colKey = [];
|
|
70221
|
+
colKeys.push({ colKey, indicatorKey: assignedIndicatorKey });
|
|
70222
|
+
for (let n = 0, len2 = this.columns.length; n < len2; n++) {
|
|
70223
|
+
const colAttr = this.columns[n];
|
|
70224
|
+
if (colAttr in record) {
|
|
70225
|
+
this.columnsHasValue[n] = true;
|
|
70226
|
+
colKey.push(record[colAttr]);
|
|
70227
|
+
}
|
|
70228
|
+
else if (colAttr !== IndicatorDimensionKeyPlaceholder) {
|
|
70229
|
+
if (this.dataConfig?.totals?.column?.showGrandTotals &&
|
|
70230
|
+
n === 0 &&
|
|
70231
|
+
!this.columns.find((ck) => {
|
|
70232
|
+
return ck in record;
|
|
70233
|
+
})) {
|
|
70234
|
+
colKey.push(this.colGrandTotalLabel);
|
|
70235
|
+
isToTalRecord = true;
|
|
70236
|
+
break;
|
|
70237
|
+
}
|
|
70238
|
+
else if (this.dataConfig?.totals?.column?.subTotalsDimensions &&
|
|
70239
|
+
this.dataConfig?.totals?.column?.subTotalsDimensions.indexOf(this.columns[n - 1]) >= 0) {
|
|
70240
|
+
colKey.push(this.colSubTotalLabel);
|
|
70241
|
+
isToTalRecord = true;
|
|
70242
|
+
break;
|
|
70243
|
+
}
|
|
70244
|
+
}
|
|
69776
70245
|
}
|
|
69777
70246
|
}
|
|
69778
|
-
|
|
69779
|
-
|
|
69780
|
-
|
|
69781
|
-
|
|
70247
|
+
for (let row_i = 0; row_i < rowKeys.length; row_i++) {
|
|
70248
|
+
const rowKey = rowKeys[row_i].rowKey;
|
|
70249
|
+
let assignedIndicatorKey_value;
|
|
70250
|
+
if (!this.indicatorsAsCol) {
|
|
70251
|
+
assignedIndicatorKey_value = rowKeys[row_i].indicatorKey;
|
|
69782
70252
|
}
|
|
69783
|
-
|
|
69784
|
-
|
|
69785
|
-
|
|
69786
|
-
|
|
69787
|
-
|
|
69788
|
-
|
|
69789
|
-
|
|
69790
|
-
|
|
69791
|
-
|
|
69792
|
-
|
|
69793
|
-
|
|
69794
|
-
|
|
69795
|
-
|
|
69796
|
-
|
|
69797
|
-
|
|
69798
|
-
|
|
69799
|
-
|
|
69800
|
-
|
|
69801
|
-
|
|
70253
|
+
for (let col_j = 0; col_j < colKeys.length; col_j++) {
|
|
70254
|
+
const colKey = colKeys[col_j].colKey;
|
|
70255
|
+
if (this.indicatorsAsCol) {
|
|
70256
|
+
assignedIndicatorKey_value = colKeys[col_j].indicatorKey;
|
|
70257
|
+
}
|
|
70258
|
+
const flatRowKey = rowKey.join(this.stringJoinChar);
|
|
70259
|
+
const flatColKey = colKey.join(this.stringJoinChar);
|
|
70260
|
+
if (isToTalRecord) {
|
|
70261
|
+
if (!this.totalRecordsTree[flatRowKey]) {
|
|
70262
|
+
this.totalRecordsTree[flatRowKey] = {};
|
|
70263
|
+
}
|
|
70264
|
+
if (!this.totalRecordsTree[flatRowKey][flatColKey]) {
|
|
70265
|
+
this.totalRecordsTree[flatRowKey][flatColKey] = [];
|
|
70266
|
+
}
|
|
70267
|
+
const toComputeIndicatorKeys = this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;
|
|
70268
|
+
for (let i = 0; i < toComputeIndicatorKeys.length; i++) {
|
|
70269
|
+
if (this.calculatedFiledKeys.indexOf(toComputeIndicatorKeys[i]) >= 0) {
|
|
70270
|
+
const calculatedFieldRule = this.calculatedFieldRules?.find(rule => rule.key === toComputeIndicatorKeys[i]);
|
|
70271
|
+
if (!this.totalRecordsTree[flatRowKey]?.[flatColKey]?.[i]) {
|
|
70272
|
+
this.totalRecordsTree[flatRowKey][flatColKey][i] = new this.aggregators[AggregationType.RECALCULATE]({
|
|
70273
|
+
key: toComputeIndicatorKeys[i],
|
|
70274
|
+
dimension: toComputeIndicatorKeys[i],
|
|
70275
|
+
isRecord: true,
|
|
70276
|
+
formatFun: this.indicators?.find((indicator) => {
|
|
70277
|
+
if (typeof indicator !== 'string') {
|
|
70278
|
+
return indicator.indicatorKey === toComputeIndicatorKeys[i];
|
|
70279
|
+
}
|
|
70280
|
+
return false;
|
|
70281
|
+
})?.format,
|
|
70282
|
+
calculateFun: calculatedFieldRule?.calculateFun,
|
|
70283
|
+
dependAggregators: this.totalRecordsTree[flatRowKey][flatColKey],
|
|
70284
|
+
dependIndicatorKeys: calculatedFieldRule?.dependIndicatorKeys
|
|
70285
|
+
});
|
|
69802
70286
|
}
|
|
69803
|
-
|
|
69804
|
-
}
|
|
69805
|
-
|
|
69806
|
-
|
|
69807
|
-
|
|
69808
|
-
|
|
70287
|
+
toComputeIndicatorKeys[i] in record && this.totalRecordsTree[flatRowKey]?.[flatColKey]?.[i].push(record);
|
|
70288
|
+
}
|
|
70289
|
+
else {
|
|
70290
|
+
const aggRule = this.getAggregatorRule(toComputeIndicatorKeys[i]);
|
|
70291
|
+
if (!this.totalRecordsTree[flatRowKey]?.[flatColKey]?.[i]) {
|
|
70292
|
+
this.totalRecordsTree[flatRowKey][flatColKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM]({
|
|
70293
|
+
key: toComputeIndicatorKeys[i],
|
|
70294
|
+
dimension: aggRule?.field ?? toComputeIndicatorKeys[i],
|
|
70295
|
+
formatFun: aggRule?.formatFun ??
|
|
70296
|
+
this.indicators?.find((indicator) => {
|
|
70297
|
+
if (typeof indicator !== 'string') {
|
|
70298
|
+
return indicator.indicatorKey === toComputeIndicatorKeys[i];
|
|
70299
|
+
}
|
|
70300
|
+
return false;
|
|
70301
|
+
})?.format
|
|
70302
|
+
});
|
|
70303
|
+
}
|
|
70304
|
+
toComputeIndicatorKeys[i] in record && this.totalRecordsTree[flatRowKey]?.[flatColKey]?.[i].push(record);
|
|
70305
|
+
}
|
|
70306
|
+
}
|
|
70307
|
+
return;
|
|
69809
70308
|
}
|
|
69810
|
-
|
|
69811
|
-
|
|
69812
|
-
|
|
69813
|
-
|
|
69814
|
-
let needAddToAggregator = false;
|
|
69815
|
-
if (assignedIndicatorKey) {
|
|
69816
|
-
toComputeIndicatorKeys[i] === assignedIndicatorKey && (needAddToAggregator = true);
|
|
69817
|
-
}
|
|
69818
|
-
else if (aggRule?.field) {
|
|
69819
|
-
if (typeof aggRule?.field === 'string') {
|
|
69820
|
-
aggRule?.field in record && (needAddToAggregator = true);
|
|
70309
|
+
if (rowKey.length !== 0) {
|
|
70310
|
+
if (!this.rowFlatKeys[flatRowKey]) {
|
|
70311
|
+
this.rowKeys.push(rowKey);
|
|
70312
|
+
this.rowFlatKeys[flatRowKey] = 1;
|
|
69821
70313
|
}
|
|
69822
|
-
|
|
69823
|
-
|
|
69824
|
-
|
|
69825
|
-
|
|
69826
|
-
|
|
70314
|
+
}
|
|
70315
|
+
if (colKey.length !== 0) {
|
|
70316
|
+
if (!this.colFlatKeys[flatColKey]) {
|
|
70317
|
+
this.colKeys.push(colKey);
|
|
70318
|
+
this.colFlatKeys[flatColKey] = 1;
|
|
69827
70319
|
}
|
|
69828
70320
|
}
|
|
69829
|
-
|
|
69830
|
-
|
|
69831
|
-
}
|
|
69832
|
-
if (!this.tree[flatRowKey]?.[flatColKey]?.[i] && needAddToAggregator) {
|
|
69833
|
-
this.tree[flatRowKey][flatColKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM]({
|
|
69834
|
-
key: toComputeIndicatorKeys[i],
|
|
69835
|
-
dimension: aggRule?.field ?? toComputeIndicatorKeys[i],
|
|
69836
|
-
formatFun: aggRule?.formatFun ??
|
|
69837
|
-
this.indicators?.find((indicator) => {
|
|
69838
|
-
if (typeof indicator !== 'string') {
|
|
69839
|
-
return indicator.indicatorKey === toComputeIndicatorKeys[i];
|
|
69840
|
-
}
|
|
69841
|
-
return false;
|
|
69842
|
-
})?.format
|
|
69843
|
-
});
|
|
70321
|
+
if (!this.tree[flatRowKey]) {
|
|
70322
|
+
this.tree[flatRowKey] = {};
|
|
69844
70323
|
}
|
|
69845
|
-
if (
|
|
69846
|
-
this.tree[flatRowKey]
|
|
69847
|
-
}
|
|
69848
|
-
|
|
69849
|
-
|
|
69850
|
-
|
|
69851
|
-
|
|
69852
|
-
|
|
69853
|
-
|
|
69854
|
-
|
|
69855
|
-
|
|
69856
|
-
|
|
69857
|
-
|
|
69858
|
-
}),
|
|
69859
|
-
min: new this.aggregators[AggregationType.MIN]({
|
|
69860
|
-
key: this.indicatorKeys[i],
|
|
69861
|
-
dimension: this.indicatorKeys[i]
|
|
69862
|
-
}),
|
|
69863
|
-
total: new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM]({
|
|
69864
|
-
key: this.indicatorKeys[i],
|
|
69865
|
-
dimension: aggRule?.field ?? this.indicatorKeys[i],
|
|
69866
|
-
formatFun: aggRule?.formatFun ??
|
|
69867
|
-
this.indicators?.find((indicator) => {
|
|
70324
|
+
if (!this.tree[flatRowKey]?.[flatColKey]) {
|
|
70325
|
+
this.tree[flatRowKey][flatColKey] = [];
|
|
70326
|
+
}
|
|
70327
|
+
const toComputeIndicatorKeys = this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;
|
|
70328
|
+
for (let i = 0; i < toComputeIndicatorKeys.length; i++) {
|
|
70329
|
+
if (this.calculatedFiledKeys.indexOf(toComputeIndicatorKeys[i]) >= 0) {
|
|
70330
|
+
const calculatedFieldRule = this.calculatedFieldRules?.find(rule => rule.key === toComputeIndicatorKeys[i]);
|
|
70331
|
+
if (!this.tree[flatRowKey]?.[flatColKey]?.[i]) {
|
|
70332
|
+
this.tree[flatRowKey][flatColKey][i] = new this.aggregators[AggregationType.RECALCULATE]({
|
|
70333
|
+
key: toComputeIndicatorKeys[i],
|
|
70334
|
+
dimension: toComputeIndicatorKeys[i],
|
|
70335
|
+
isRecord: true,
|
|
70336
|
+
formatFun: this.indicators?.find((indicator) => {
|
|
69868
70337
|
if (typeof indicator !== 'string') {
|
|
69869
|
-
return indicator.indicatorKey ===
|
|
70338
|
+
return indicator.indicatorKey === toComputeIndicatorKeys[i];
|
|
69870
70339
|
}
|
|
69871
70340
|
return false;
|
|
69872
|
-
})?.format
|
|
69873
|
-
|
|
69874
|
-
|
|
70341
|
+
})?.format,
|
|
70342
|
+
calculateFun: calculatedFieldRule?.calculateFun,
|
|
70343
|
+
dependAggregators: this.tree[flatRowKey][flatColKey],
|
|
70344
|
+
dependIndicatorKeys: calculatedFieldRule?.dependIndicatorKeys
|
|
70345
|
+
});
|
|
70346
|
+
}
|
|
70347
|
+
this.tree[flatRowKey]?.[flatColKey]?.[i].push(record);
|
|
70348
|
+
}
|
|
70349
|
+
else {
|
|
70350
|
+
const aggRule = this.getAggregatorRule(toComputeIndicatorKeys[i]);
|
|
70351
|
+
let needAddToAggregator = false;
|
|
70352
|
+
if (assignedIndicatorKey_value) {
|
|
70353
|
+
if (assignedIndicatorKey === assignedIndicatorKey_value) {
|
|
70354
|
+
toComputeIndicatorKeys[i] === assignedIndicatorKey_value && (needAddToAggregator = true);
|
|
70355
|
+
}
|
|
70356
|
+
else {
|
|
70357
|
+
toComputeIndicatorKeys[i] === assignedIndicatorKey_value &&
|
|
70358
|
+
toComputeIndicatorKeys[i] in record &&
|
|
70359
|
+
(needAddToAggregator = true);
|
|
70360
|
+
}
|
|
70361
|
+
}
|
|
70362
|
+
else if (aggRule?.field) {
|
|
70363
|
+
if (typeof aggRule?.field === 'string') {
|
|
70364
|
+
aggRule?.field in record && (needAddToAggregator = true);
|
|
70365
|
+
}
|
|
70366
|
+
else {
|
|
70367
|
+
const isPush = aggRule?.field.find((field) => {
|
|
70368
|
+
return field in record;
|
|
70369
|
+
});
|
|
70370
|
+
isPush && (needAddToAggregator = true);
|
|
70371
|
+
}
|
|
70372
|
+
}
|
|
70373
|
+
else {
|
|
70374
|
+
toComputeIndicatorKeys[i] in record && (needAddToAggregator = true);
|
|
70375
|
+
}
|
|
70376
|
+
if (!this.tree[flatRowKey]?.[flatColKey]?.[i] && needAddToAggregator) {
|
|
70377
|
+
this.tree[flatRowKey][flatColKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM]({
|
|
70378
|
+
key: toComputeIndicatorKeys[i],
|
|
70379
|
+
dimension: aggRule?.field ?? toComputeIndicatorKeys[i],
|
|
70380
|
+
formatFun: aggRule?.formatFun ??
|
|
70381
|
+
this.indicators?.find((indicator) => {
|
|
70382
|
+
if (typeof indicator !== 'string') {
|
|
70383
|
+
return indicator.indicatorKey === toComputeIndicatorKeys[i];
|
|
70384
|
+
}
|
|
70385
|
+
return false;
|
|
70386
|
+
})?.format
|
|
70387
|
+
});
|
|
70388
|
+
}
|
|
70389
|
+
if (needAddToAggregator) {
|
|
70390
|
+
this.tree[flatRowKey]?.[flatColKey]?.[i].push(record);
|
|
70391
|
+
}
|
|
70392
|
+
}
|
|
70393
|
+
}
|
|
70394
|
+
if (this.mappingRules) {
|
|
70395
|
+
for (let i = 0; i < this.indicatorKeys.length; i++) {
|
|
70396
|
+
if (!this.indicatorStatistics[i]) {
|
|
70397
|
+
const aggRule = this.getAggregatorRule(this.indicatorKeys[i]);
|
|
70398
|
+
this.indicatorStatistics[i] = {
|
|
70399
|
+
max: new this.aggregators[AggregationType.MAX]({
|
|
70400
|
+
key: this.indicatorKeys[i],
|
|
70401
|
+
dimension: this.indicatorKeys[i]
|
|
70402
|
+
}),
|
|
70403
|
+
min: new this.aggregators[AggregationType.MIN]({
|
|
70404
|
+
key: this.indicatorKeys[i],
|
|
70405
|
+
dimension: this.indicatorKeys[i]
|
|
70406
|
+
}),
|
|
70407
|
+
total: new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM]({
|
|
70408
|
+
key: this.indicatorKeys[i],
|
|
70409
|
+
dimension: aggRule?.field ?? this.indicatorKeys[i],
|
|
70410
|
+
formatFun: aggRule?.formatFun ??
|
|
70411
|
+
this.indicators?.find((indicator) => {
|
|
70412
|
+
if (typeof indicator !== 'string') {
|
|
70413
|
+
return indicator.indicatorKey === this.indicatorKeys[i];
|
|
70414
|
+
}
|
|
70415
|
+
return false;
|
|
70416
|
+
})?.format
|
|
70417
|
+
})
|
|
70418
|
+
};
|
|
70419
|
+
}
|
|
70420
|
+
this.indicatorStatistics[i].max.push(this.tree[flatRowKey]?.[flatColKey]?.[i].value());
|
|
70421
|
+
this.indicatorStatistics[i].min.push(this.tree[flatRowKey]?.[flatColKey]?.[i].value());
|
|
70422
|
+
this.indicatorStatistics[i].total.push(record);
|
|
70423
|
+
}
|
|
69875
70424
|
}
|
|
69876
|
-
this.indicatorStatistics[i].max.push(this.tree[flatRowKey]?.[flatColKey]?.[i].value());
|
|
69877
|
-
this.indicatorStatistics[i].min.push(this.tree[flatRowKey]?.[flatColKey]?.[i].value());
|
|
69878
|
-
this.indicatorStatistics[i].total.push(record);
|
|
69879
70425
|
}
|
|
69880
70426
|
}
|
|
69881
70427
|
}
|
|
@@ -69913,7 +70459,7 @@
|
|
|
69913
70459
|
for (const treeRowKey in this.tree) {
|
|
69914
70460
|
for (const treeColKey in this.tree[treeRowKey]) {
|
|
69915
70461
|
for (let i = 0; i < this.tree[treeRowKey][treeColKey].length; i++) {
|
|
69916
|
-
this.tree[treeRowKey][treeColKey][i]
|
|
70462
|
+
this.tree[treeRowKey][treeColKey][i]?.reset();
|
|
69917
70463
|
}
|
|
69918
70464
|
}
|
|
69919
70465
|
}
|
|
@@ -69978,6 +70524,10 @@
|
|
|
69978
70524
|
},
|
|
69979
70525
|
push() {
|
|
69980
70526
|
},
|
|
70527
|
+
deleteRecord() {
|
|
70528
|
+
},
|
|
70529
|
+
updateRecord() {
|
|
70530
|
+
},
|
|
69981
70531
|
clearCacheValue() {
|
|
69982
70532
|
},
|
|
69983
70533
|
reset() {
|
|
@@ -69991,6 +70541,10 @@
|
|
|
69991
70541
|
className: '',
|
|
69992
70542
|
push() {
|
|
69993
70543
|
},
|
|
70544
|
+
deleteRecord() {
|
|
70545
|
+
},
|
|
70546
|
+
updateRecord() {
|
|
70547
|
+
},
|
|
69994
70548
|
recalculate() {
|
|
69995
70549
|
},
|
|
69996
70550
|
formatValue() {
|
|
@@ -70008,6 +70562,10 @@
|
|
|
70008
70562
|
className: '',
|
|
70009
70563
|
push() {
|
|
70010
70564
|
},
|
|
70565
|
+
deleteRecord() {
|
|
70566
|
+
},
|
|
70567
|
+
updateRecord() {
|
|
70568
|
+
},
|
|
70011
70569
|
recalculate() {
|
|
70012
70570
|
},
|
|
70013
70571
|
value() {
|
|
@@ -70124,136 +70682,139 @@
|
|
|
70124
70682
|
}
|
|
70125
70683
|
totalStatistics() {
|
|
70126
70684
|
const that = this;
|
|
70127
|
-
|
|
70128
|
-
(
|
|
70129
|
-
|
|
70130
|
-
|
|
70131
|
-
const rowTotalKeys = [];
|
|
70132
|
-
const colCompute = (flatRowKey, flatColKey) => {
|
|
70133
|
-
if (this.totalRecordsTree?.[flatRowKey]?.[flatColKey]) {
|
|
70134
|
-
this.tree[flatRowKey][flatColKey] = this.totalRecordsTree?.[flatRowKey]?.[flatColKey];
|
|
70135
|
-
return;
|
|
70685
|
+
const colCompute = (flatRowKey, flatColKey) => {
|
|
70686
|
+
if (this.totalRecordsTree?.[flatRowKey]?.[flatColKey]) {
|
|
70687
|
+
if (!this.tree[flatRowKey]) {
|
|
70688
|
+
this.tree[flatRowKey] = {};
|
|
70136
70689
|
}
|
|
70137
|
-
|
|
70138
|
-
|
|
70139
|
-
|
|
70140
|
-
|
|
70141
|
-
|
|
70142
|
-
|
|
70143
|
-
|
|
70144
|
-
|
|
70145
|
-
|
|
70146
|
-
|
|
70147
|
-
|
|
70148
|
-
|
|
70149
|
-
|
|
70150
|
-
|
|
70151
|
-
|
|
70152
|
-
|
|
70153
|
-
|
|
70690
|
+
this.tree[flatRowKey][flatColKey] = this.totalRecordsTree?.[flatRowKey]?.[flatColKey];
|
|
70691
|
+
return;
|
|
70692
|
+
}
|
|
70693
|
+
const colKey = flatColKey.split(this.stringJoinChar);
|
|
70694
|
+
if (that.totals?.column?.subTotalsDimensions &&
|
|
70695
|
+
that.totals?.column?.subTotalsDimensions?.length > 0 &&
|
|
70696
|
+
that.totals.column.showSubTotals !== false) {
|
|
70697
|
+
for (let i = 0, len = that.totals?.column?.subTotalsDimensions?.length; i < len; i++) {
|
|
70698
|
+
const dimension = that.totals.column.subTotalsDimensions[i];
|
|
70699
|
+
const dimensionIndex = that.columns.indexOf(dimension);
|
|
70700
|
+
if (dimensionIndex >= 0) {
|
|
70701
|
+
const colTotalKey = colKey.slice(0, dimensionIndex + 1);
|
|
70702
|
+
colTotalKey.push(that.colSubTotalLabel);
|
|
70703
|
+
const flatColTotalKey = colTotalKey.join(this.stringJoinChar);
|
|
70704
|
+
if (this.totalRecordsTree?.[flatRowKey]?.[flatColTotalKey]) {
|
|
70705
|
+
this.tree[flatRowKey][flatColTotalKey] = this.totalRecordsTree?.[flatRowKey]?.[flatColTotalKey];
|
|
70706
|
+
return;
|
|
70707
|
+
}
|
|
70708
|
+
if (!this.tree[flatRowKey][flatColTotalKey]) {
|
|
70709
|
+
this.tree[flatRowKey][flatColTotalKey] = [];
|
|
70710
|
+
}
|
|
70711
|
+
const toComputeIndicatorKeys = this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;
|
|
70712
|
+
for (let i = 0; i < toComputeIndicatorKeys.length; i++) {
|
|
70713
|
+
if (this.calculatedFiledKeys.indexOf(toComputeIndicatorKeys[i]) >= 0) {
|
|
70714
|
+
const calculatedFieldRule = this.calculatedFieldRules?.find(rule => rule.key === toComputeIndicatorKeys[i]);
|
|
70715
|
+
if (!this.tree[flatRowKey]?.[flatColTotalKey]?.[i]) {
|
|
70716
|
+
this.tree[flatRowKey][flatColTotalKey][i] = new this.aggregators[AggregationType.RECALCULATE]({
|
|
70717
|
+
key: toComputeIndicatorKeys[i],
|
|
70718
|
+
dimension: toComputeIndicatorKeys[i],
|
|
70719
|
+
isRecord: true,
|
|
70720
|
+
formatFun: this.indicators?.find((indicator) => {
|
|
70721
|
+
if (typeof indicator !== 'string') {
|
|
70722
|
+
return indicator.indicatorKey === toComputeIndicatorKeys[i];
|
|
70723
|
+
}
|
|
70724
|
+
return false;
|
|
70725
|
+
})?.format,
|
|
70726
|
+
calculateFun: calculatedFieldRule?.calculateFun,
|
|
70727
|
+
dependAggregators: this.tree[flatRowKey][flatColTotalKey],
|
|
70728
|
+
dependIndicatorKeys: calculatedFieldRule?.dependIndicatorKeys
|
|
70729
|
+
});
|
|
70730
|
+
}
|
|
70731
|
+
if (flatColTotalKey !== flatColKey) {
|
|
70732
|
+
this.tree[flatRowKey][flatColTotalKey][i].push(that.tree[flatRowKey]?.[flatColKey]?.[i]);
|
|
70733
|
+
}
|
|
70154
70734
|
}
|
|
70155
|
-
|
|
70156
|
-
|
|
70157
|
-
|
|
70158
|
-
|
|
70159
|
-
|
|
70160
|
-
|
|
70161
|
-
|
|
70162
|
-
|
|
70163
|
-
isRecord: true,
|
|
70164
|
-
formatFun: this.indicators?.find((indicator) => {
|
|
70735
|
+
else {
|
|
70736
|
+
if (!this.tree[flatRowKey][flatColTotalKey][i]) {
|
|
70737
|
+
const aggRule = this.getAggregatorRule(toComputeIndicatorKeys[i]);
|
|
70738
|
+
this.tree[flatRowKey][flatColTotalKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM]({
|
|
70739
|
+
key: toComputeIndicatorKeys[i],
|
|
70740
|
+
dimension: aggRule?.field ?? toComputeIndicatorKeys[i],
|
|
70741
|
+
formatFun: aggRule?.formatFun ??
|
|
70742
|
+
this.indicators?.find((indicator) => {
|
|
70165
70743
|
if (typeof indicator !== 'string') {
|
|
70166
70744
|
return indicator.indicatorKey === toComputeIndicatorKeys[i];
|
|
70167
70745
|
}
|
|
70168
70746
|
return false;
|
|
70169
|
-
})?.format
|
|
70170
|
-
|
|
70171
|
-
dependAggregators: this.tree[flatRowKey][flatColTotalKey],
|
|
70172
|
-
dependIndicatorKeys: calculatedFieldRule?.dependIndicatorKeys
|
|
70173
|
-
});
|
|
70174
|
-
}
|
|
70175
|
-
if (flatColTotalKey !== flatColKey) {
|
|
70176
|
-
this.tree[flatRowKey][flatColTotalKey][i].push(that.tree[flatRowKey]?.[flatColKey]?.[i]);
|
|
70177
|
-
}
|
|
70747
|
+
})?.format
|
|
70748
|
+
});
|
|
70178
70749
|
}
|
|
70179
|
-
|
|
70180
|
-
|
|
70181
|
-
const aggRule = this.getAggregatorRule(toComputeIndicatorKeys[i]);
|
|
70182
|
-
this.tree[flatRowKey][flatColTotalKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM]({
|
|
70183
|
-
key: toComputeIndicatorKeys[i],
|
|
70184
|
-
dimension: aggRule?.field ?? toComputeIndicatorKeys[i],
|
|
70185
|
-
formatFun: aggRule?.formatFun ??
|
|
70186
|
-
this.indicators?.find((indicator) => {
|
|
70187
|
-
if (typeof indicator !== 'string') {
|
|
70188
|
-
return indicator.indicatorKey === toComputeIndicatorKeys[i];
|
|
70189
|
-
}
|
|
70190
|
-
return false;
|
|
70191
|
-
})?.format
|
|
70192
|
-
});
|
|
70193
|
-
}
|
|
70194
|
-
if (flatColTotalKey !== flatColKey) {
|
|
70195
|
-
this.tree[flatRowKey][flatColTotalKey][i].push(that.tree[flatRowKey]?.[flatColKey]?.[i]);
|
|
70196
|
-
}
|
|
70750
|
+
if (flatColTotalKey !== flatColKey) {
|
|
70751
|
+
this.tree[flatRowKey][flatColTotalKey][i].push(that.tree[flatRowKey]?.[flatColKey]?.[i]);
|
|
70197
70752
|
}
|
|
70198
70753
|
}
|
|
70199
70754
|
}
|
|
70200
70755
|
}
|
|
70201
70756
|
}
|
|
70202
|
-
|
|
70203
|
-
|
|
70204
|
-
|
|
70205
|
-
|
|
70206
|
-
|
|
70207
|
-
|
|
70208
|
-
|
|
70209
|
-
|
|
70757
|
+
}
|
|
70758
|
+
if (that.totals?.column?.showGrandTotals || this.rows.length === 0) {
|
|
70759
|
+
const flatColTotalKey = that.colGrandTotalLabel;
|
|
70760
|
+
if (this.totalRecordsTree?.[flatRowKey]?.[flatColTotalKey]) {
|
|
70761
|
+
this.tree[flatRowKey][flatColTotalKey] = this.totalRecordsTree?.[flatRowKey]?.[flatColTotalKey];
|
|
70762
|
+
return;
|
|
70763
|
+
}
|
|
70764
|
+
if (!this.tree[flatRowKey][flatColTotalKey]) {
|
|
70765
|
+
this.tree[flatRowKey][flatColTotalKey] = [];
|
|
70766
|
+
}
|
|
70767
|
+
const toComputeIndicatorKeys = this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;
|
|
70768
|
+
for (let i = 0; i < toComputeIndicatorKeys.length; i++) {
|
|
70769
|
+
if (this.calculatedFiledKeys.indexOf(toComputeIndicatorKeys[i]) >= 0) {
|
|
70770
|
+
const calculatedFieldRule = this.calculatedFieldRules?.find(rule => rule.key === toComputeIndicatorKeys[i]);
|
|
70771
|
+
if (!this.tree[flatRowKey]?.[flatColTotalKey]?.[i]) {
|
|
70772
|
+
this.tree[flatRowKey][flatColTotalKey][i] = new this.aggregators[AggregationType.RECALCULATE]({
|
|
70773
|
+
key: toComputeIndicatorKeys[i],
|
|
70774
|
+
dimension: toComputeIndicatorKeys[i],
|
|
70775
|
+
isRecord: true,
|
|
70776
|
+
formatFun: this.indicators?.find((indicator) => {
|
|
70777
|
+
if (typeof indicator !== 'string') {
|
|
70778
|
+
return indicator.indicatorKey === toComputeIndicatorKeys[i];
|
|
70779
|
+
}
|
|
70780
|
+
return false;
|
|
70781
|
+
})?.format,
|
|
70782
|
+
calculateFun: calculatedFieldRule?.calculateFun,
|
|
70783
|
+
dependAggregators: this.tree[flatRowKey][flatColTotalKey],
|
|
70784
|
+
dependIndicatorKeys: calculatedFieldRule?.dependIndicatorKeys
|
|
70785
|
+
});
|
|
70786
|
+
}
|
|
70787
|
+
if (flatColTotalKey !== flatColKey) {
|
|
70788
|
+
this.tree[flatRowKey][flatColTotalKey][i].push(that.tree[flatRowKey]?.[flatColKey]?.[i]);
|
|
70789
|
+
}
|
|
70210
70790
|
}
|
|
70211
|
-
|
|
70212
|
-
|
|
70213
|
-
|
|
70214
|
-
|
|
70215
|
-
|
|
70216
|
-
|
|
70217
|
-
|
|
70218
|
-
|
|
70219
|
-
isRecord: true,
|
|
70220
|
-
formatFun: this.indicators?.find((indicator) => {
|
|
70791
|
+
else {
|
|
70792
|
+
if (!this.tree[flatRowKey][flatColTotalKey][i]) {
|
|
70793
|
+
const aggRule = this.getAggregatorRule(toComputeIndicatorKeys[i]);
|
|
70794
|
+
this.tree[flatRowKey][flatColTotalKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM]({
|
|
70795
|
+
key: toComputeIndicatorKeys[i],
|
|
70796
|
+
dimension: aggRule?.field ?? toComputeIndicatorKeys[i],
|
|
70797
|
+
formatFun: aggRule?.formatFun ??
|
|
70798
|
+
this.indicators?.find((indicator) => {
|
|
70221
70799
|
if (typeof indicator !== 'string') {
|
|
70222
70800
|
return indicator.indicatorKey === toComputeIndicatorKeys[i];
|
|
70223
70801
|
}
|
|
70224
70802
|
return false;
|
|
70225
|
-
})?.format
|
|
70226
|
-
|
|
70227
|
-
dependAggregators: this.tree[flatRowKey][flatColTotalKey],
|
|
70228
|
-
dependIndicatorKeys: calculatedFieldRule?.dependIndicatorKeys
|
|
70229
|
-
});
|
|
70230
|
-
}
|
|
70231
|
-
if (flatColTotalKey !== flatColKey) {
|
|
70232
|
-
this.tree[flatRowKey][flatColTotalKey][i].push(that.tree[flatRowKey]?.[flatColKey]?.[i]);
|
|
70233
|
-
}
|
|
70803
|
+
})?.format
|
|
70804
|
+
});
|
|
70234
70805
|
}
|
|
70235
|
-
|
|
70236
|
-
|
|
70237
|
-
const aggRule = this.getAggregatorRule(toComputeIndicatorKeys[i]);
|
|
70238
|
-
this.tree[flatRowKey][flatColTotalKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM]({
|
|
70239
|
-
key: toComputeIndicatorKeys[i],
|
|
70240
|
-
dimension: aggRule?.field ?? toComputeIndicatorKeys[i],
|
|
70241
|
-
formatFun: aggRule?.formatFun ??
|
|
70242
|
-
this.indicators?.find((indicator) => {
|
|
70243
|
-
if (typeof indicator !== 'string') {
|
|
70244
|
-
return indicator.indicatorKey === toComputeIndicatorKeys[i];
|
|
70245
|
-
}
|
|
70246
|
-
return false;
|
|
70247
|
-
})?.format
|
|
70248
|
-
});
|
|
70249
|
-
}
|
|
70250
|
-
if (flatColTotalKey !== flatColKey) {
|
|
70251
|
-
this.tree[flatRowKey][flatColTotalKey][i].push(that.tree[flatRowKey]?.[flatColKey]?.[i]);
|
|
70252
|
-
}
|
|
70806
|
+
if (flatColTotalKey !== flatColKey) {
|
|
70807
|
+
this.tree[flatRowKey][flatColTotalKey][i].push(that.tree[flatRowKey]?.[flatColKey]?.[i]);
|
|
70253
70808
|
}
|
|
70254
70809
|
}
|
|
70255
70810
|
}
|
|
70256
|
-
}
|
|
70811
|
+
}
|
|
70812
|
+
};
|
|
70813
|
+
if ((that?.totals?.column?.subTotalsDimensions && that?.totals?.column?.subTotalsDimensions?.length >= 1) ||
|
|
70814
|
+
(that?.totals?.row?.subTotalsDimensions && that?.totals?.row?.subTotalsDimensions?.length >= 1) ||
|
|
70815
|
+
that?.totals?.column?.showGrandTotals ||
|
|
70816
|
+
that?.totals?.row?.showGrandTotals) {
|
|
70817
|
+
const rowTotalKeys = [];
|
|
70257
70818
|
Object.keys(that.tree).forEach(flatRowKey => {
|
|
70258
70819
|
const rowKey = flatRowKey.split(this.stringJoinChar);
|
|
70259
70820
|
Object.keys(that.tree[flatRowKey]).forEach(flatColKey => {
|
|
@@ -70376,6 +70937,11 @@
|
|
|
70376
70937
|
});
|
|
70377
70938
|
});
|
|
70378
70939
|
}
|
|
70940
|
+
for (const flatRowKey in that.totalRecordsTree) {
|
|
70941
|
+
for (const flatColKey in that.totalRecordsTree[flatRowKey]) {
|
|
70942
|
+
colCompute(flatRowKey, flatColKey);
|
|
70943
|
+
}
|
|
70944
|
+
}
|
|
70379
70945
|
}
|
|
70380
70946
|
ArrToTree1(arr, rows, indicators, isGrandTotal, grandTotalLabel) {
|
|
70381
70947
|
const result = [];
|
|
@@ -70532,20 +71098,6 @@
|
|
|
70532
71098
|
}
|
|
70533
71099
|
return result;
|
|
70534
71100
|
}
|
|
70535
|
-
TreeToArr(tree) {
|
|
70536
|
-
const result = [];
|
|
70537
|
-
function getPath(node, arr) {
|
|
70538
|
-
arr.push(node.id);
|
|
70539
|
-
if (node.children.length > 0) {
|
|
70540
|
-
node.children?.forEach((childItem) => getPath(childItem, [...arr]));
|
|
70541
|
-
}
|
|
70542
|
-
else {
|
|
70543
|
-
result.push(arr);
|
|
70544
|
-
}
|
|
70545
|
-
}
|
|
70546
|
-
tree.forEach((treeNode) => getPath(treeNode, []));
|
|
70547
|
-
return result;
|
|
70548
|
-
}
|
|
70549
71101
|
cacheDeminsionCollectedValues() {
|
|
70550
71102
|
for (const key in this.collectValuesBy) {
|
|
70551
71103
|
if (this.collectValuesBy[key].type === 'xField' || this.collectValuesBy[key].type === 'yField') {
|
|
@@ -70586,8 +71138,8 @@
|
|
|
70586
71138
|
this.changedTree[flatRowKey][flatColKey] = [];
|
|
70587
71139
|
this.changedTree[flatRowKey][flatColKey][indicatorIndex] = newValue;
|
|
70588
71140
|
}
|
|
70589
|
-
const cellAggregator = this.tree[flatRowKey][flatColKey][indicatorIndex];
|
|
70590
|
-
if (cellAggregator
|
|
71141
|
+
const cellAggregator = this.tree[flatRowKey]?.[flatColKey]?.[indicatorIndex];
|
|
71142
|
+
if (cellAggregator?.records.length === 1) {
|
|
70591
71143
|
cellAggregator.records[0][this.indicatorKeys[indicatorIndex]] = newValue;
|
|
70592
71144
|
}
|
|
70593
71145
|
}
|
|
@@ -70623,6 +71175,11 @@
|
|
|
70623
71175
|
this.processRecords();
|
|
70624
71176
|
}
|
|
70625
71177
|
}
|
|
71178
|
+
_rowTreeHasChanged() {
|
|
71179
|
+
if (!this.hasExtensionRowTree) {
|
|
71180
|
+
this.customRowTreeDimensionPaths = this.customTreeToDimensionPathArr(this.customRowTree, 'row');
|
|
71181
|
+
}
|
|
71182
|
+
}
|
|
70626
71183
|
changeDataConfig(dataConfig) {
|
|
70627
71184
|
this.rows = dataConfig.rows;
|
|
70628
71185
|
this.columns = dataConfig.columns;
|
|
@@ -70636,6 +71193,91 @@
|
|
|
70636
71193
|
this.records.push(records);
|
|
70637
71194
|
}
|
|
70638
71195
|
}
|
|
71196
|
+
customTreeToDimensionPathArr(tree, type) {
|
|
71197
|
+
const result = [];
|
|
71198
|
+
const that = this;
|
|
71199
|
+
function getPath(node, arr) {
|
|
71200
|
+
if (!node.virtual) {
|
|
71201
|
+
if (arr[arr.length - 1]?.childKeys &&
|
|
71202
|
+
node.dimensionKey &&
|
|
71203
|
+
arr[arr.length - 1].childKeys.indexOf(node.dimensionKey) === -1 &&
|
|
71204
|
+
node.dimensionKey !== arr[arr.length - 1].dimensionKey) {
|
|
71205
|
+
arr[arr.length - 1].childKeys.push(node.dimensionKey);
|
|
71206
|
+
}
|
|
71207
|
+
arr.push({
|
|
71208
|
+
dimensionKey: isValid$1(node.indicatorKey) ? undefined : node.dimensionKey,
|
|
71209
|
+
value: node.value,
|
|
71210
|
+
indicatorKey: node.indicatorKey,
|
|
71211
|
+
virtual: node.virtual
|
|
71212
|
+
});
|
|
71213
|
+
}
|
|
71214
|
+
if (node.children?.length > 0) {
|
|
71215
|
+
if (that.rowHierarchyType === 'tree' && type === 'row') {
|
|
71216
|
+
arr[arr.length - 1].childKeys = [];
|
|
71217
|
+
result.push([...arr]);
|
|
71218
|
+
}
|
|
71219
|
+
node.children?.forEach((childItem) => getPath(childItem, [...arr]));
|
|
71220
|
+
}
|
|
71221
|
+
else {
|
|
71222
|
+
result.push(arr);
|
|
71223
|
+
}
|
|
71224
|
+
}
|
|
71225
|
+
tree?.forEach((treeNode) => getPath(treeNode, []));
|
|
71226
|
+
return result;
|
|
71227
|
+
}
|
|
71228
|
+
getFieldMatchColDimensionPaths(record) {
|
|
71229
|
+
const fieldMatchDimensionPaths = [];
|
|
71230
|
+
for (let i = 0; i < this.customColTreeDimensionPaths?.length ?? 0; i++) {
|
|
71231
|
+
const dimensionPath = this.customColTreeDimensionPaths[i];
|
|
71232
|
+
let isMatch = true;
|
|
71233
|
+
for (let j = 0; j < dimensionPath.length; j++) {
|
|
71234
|
+
const dimension = dimensionPath[j];
|
|
71235
|
+
if ((dimension.dimensionKey && record[dimension.dimensionKey] !== dimension.value) ||
|
|
71236
|
+
(dimension.indicatorKey && record[dimension.indicatorKey] === undefined)) {
|
|
71237
|
+
isMatch = false;
|
|
71238
|
+
break;
|
|
71239
|
+
}
|
|
71240
|
+
}
|
|
71241
|
+
if (isMatch) {
|
|
71242
|
+
fieldMatchDimensionPaths.push(dimensionPath);
|
|
71243
|
+
}
|
|
71244
|
+
}
|
|
71245
|
+
return fieldMatchDimensionPaths;
|
|
71246
|
+
}
|
|
71247
|
+
getFieldMatchRowDimensionPaths(record) {
|
|
71248
|
+
const fieldMatchDimensionPaths = [];
|
|
71249
|
+
for (let i = 0; i < this.customRowTreeDimensionPaths?.length ?? 0; i++) {
|
|
71250
|
+
const dimensionPath = this.customRowTreeDimensionPaths[i];
|
|
71251
|
+
let isMatch = true;
|
|
71252
|
+
for (let j = 0; j < dimensionPath.length; j++) {
|
|
71253
|
+
const dimension = dimensionPath[j];
|
|
71254
|
+
if ((dimension.dimensionKey && record[dimension.dimensionKey] !== dimension.value) ||
|
|
71255
|
+
(dimension.indicatorKey && record[dimension.indicatorKey] === undefined)) {
|
|
71256
|
+
isMatch = false;
|
|
71257
|
+
break;
|
|
71258
|
+
}
|
|
71259
|
+
if (dimension.childKeys && j === dimensionPath.length - 1) {
|
|
71260
|
+
if (dimension.childKeys.length > 0 && dimension.childKeys.find(key => isValid$1(record[key]))) {
|
|
71261
|
+
isMatch = false;
|
|
71262
|
+
break;
|
|
71263
|
+
}
|
|
71264
|
+
}
|
|
71265
|
+
}
|
|
71266
|
+
if (isMatch) {
|
|
71267
|
+
if (!this.indicatorsAsCol && this.rowHierarchyType === 'tree') {
|
|
71268
|
+
if (!dimensionPath.find(path => {
|
|
71269
|
+
return path.indicatorKey;
|
|
71270
|
+
})) {
|
|
71271
|
+
isMatch = false;
|
|
71272
|
+
}
|
|
71273
|
+
}
|
|
71274
|
+
}
|
|
71275
|
+
if (isMatch) {
|
|
71276
|
+
fieldMatchDimensionPaths.push(dimensionPath);
|
|
71277
|
+
}
|
|
71278
|
+
}
|
|
71279
|
+
return fieldMatchDimensionPaths;
|
|
71280
|
+
}
|
|
70639
71281
|
}
|
|
70640
71282
|
function arraySortByAnotherArray(array, sortArray) {
|
|
70641
71283
|
return array.sort((a, b) => {
|
|
@@ -70715,7 +71357,7 @@
|
|
|
70715
71357
|
const keysResults = parseColKeyRowKeyForPivotTable(this, options);
|
|
70716
71358
|
const { rowKeys, columnKeys, indicatorKeys } = keysResults;
|
|
70717
71359
|
let { columnDimensionTree, rowDimensionTree } = keysResults;
|
|
70718
|
-
this.dataset = new Dataset(this.internalProps.dataConfig, rowKeys, columnKeys, indicatorKeys, this.internalProps.indicators, options.indicatorsAsCol ?? true, options.records, options.rowHierarchyType, this.internalProps.columnTree, this.internalProps.rowTree);
|
|
71360
|
+
this.dataset = new Dataset(this.internalProps.dataConfig, rowKeys, columnKeys, indicatorKeys, this.internalProps.indicators, options.indicatorsAsCol ?? true, options.records, options.rowHierarchyType, this.internalProps.columnTree, this.internalProps.rowTree, false, !!options.extensionRows, !!options.parseCustomTreeToMatchRecords);
|
|
70719
71361
|
if (!options.columnTree) {
|
|
70720
71362
|
if (options.indicatorsAsCol !== false) {
|
|
70721
71363
|
this.dataset.colHeaderTree = supplementIndicatorNodesForCustomTree(this.dataset.colHeaderTree, options.indicators);
|
|
@@ -70856,7 +71498,7 @@
|
|
|
70856
71498
|
const keysResults = parseColKeyRowKeyForPivotTable(this, options);
|
|
70857
71499
|
const { rowKeys, columnKeys, indicatorKeys } = keysResults;
|
|
70858
71500
|
let { columnDimensionTree, rowDimensionTree } = keysResults;
|
|
70859
|
-
this.dataset = new Dataset(internalProps.dataConfig, rowKeys, columnKeys, indicatorKeys, this.internalProps.indicators, options.indicatorsAsCol ?? true, records, options.rowHierarchyType, this.internalProps.columnTree, this.internalProps.rowTree);
|
|
71501
|
+
this.dataset = new Dataset(internalProps.dataConfig, rowKeys, columnKeys, indicatorKeys, this.internalProps.indicators, options.indicatorsAsCol ?? true, records, options.rowHierarchyType, this.internalProps.columnTree, this.internalProps.rowTree, false, !!options.extensionRows, !!options.parseCustomTreeToMatchRecords);
|
|
70860
71502
|
if (!options.columnTree) {
|
|
70861
71503
|
if (options.indicatorsAsCol !== false) {
|
|
70862
71504
|
this.dataset.colHeaderTree = supplementIndicatorNodesForCustomTree(this.dataset.colHeaderTree, options.indicators);
|
|
@@ -72062,6 +72704,7 @@
|
|
|
72062
72704
|
const headerTreeNode = this.internalProps.layoutMap.getHeadNode(col, row);
|
|
72063
72705
|
headerTreeNode.children = children;
|
|
72064
72706
|
this._refreshHierarchyState(col, row, () => {
|
|
72707
|
+
this.dataset._rowTreeHasChanged();
|
|
72065
72708
|
this.dataset.changeDataConfig({
|
|
72066
72709
|
rows: this.internalProps.layoutMap.fullRowDimensionKeys,
|
|
72067
72710
|
columns: this.internalProps.layoutMap.colDimensionKeys
|
|
@@ -73728,7 +74371,7 @@
|
|
|
73728
74371
|
}
|
|
73729
74372
|
|
|
73730
74373
|
registerForVrender();
|
|
73731
|
-
const version = "1.7.
|
|
74374
|
+
const version = "1.7.9-alpha.0";
|
|
73732
74375
|
function getIcons() {
|
|
73733
74376
|
return get$2();
|
|
73734
74377
|
}
|