@visactor/vtable 0.19.2-alpha.2 → 0.20.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.d.ts +12 -2
- package/cjs/ListTable.js +81 -24
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotChart.d.ts +2 -1
- package/cjs/PivotChart.js +5 -1
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/PivotTable.d.ts +5 -2
- package/cjs/PivotTable.js +13 -5
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/body-helper/body-helper.js +1 -0
- package/cjs/body-helper/body-helper.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +2 -2
- package/cjs/core/BaseTable.js +22 -18
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/tableHelper.d.ts +2 -2
- package/cjs/core/tableHelper.js +4 -6
- package/cjs/core/tableHelper.js.map +1 -1
- package/cjs/data/CachedDataSource.d.ts +4 -3
- package/cjs/data/CachedDataSource.js +5 -4
- package/cjs/data/CachedDataSource.js.map +1 -1
- package/cjs/data/DataSource.d.ts +22 -3
- package/cjs/data/DataSource.js +93 -7
- package/cjs/data/DataSource.js.map +1 -1
- package/cjs/dataset/dataset-pivot-table.d.ts +3 -3
- package/cjs/dataset/dataset-pivot-table.js +1 -0
- package/cjs/dataset/dataset-pivot-table.js.map +1 -1
- package/cjs/dataset/dataset.d.ts +3 -3
- package/cjs/dataset/dataset.js +3 -0
- package/cjs/dataset/dataset.js.map +1 -1
- package/cjs/dataset/statistics-helper.d.ts +24 -3
- package/cjs/dataset/statistics-helper.js +75 -9
- package/cjs/dataset/statistics-helper.js.map +1 -1
- package/cjs/edit/edit-manager.js +5 -4
- package/cjs/edit/edit-manager.js.map +1 -1
- package/cjs/event/listener/table-group.js +14 -4
- package/cjs/event/listener/table-group.js.map +1 -1
- package/cjs/event/media-click.js +2 -1
- package/cjs/event/scroll.js +0 -1
- package/cjs/event/sparkline-event.js +1 -1
- package/cjs/event/sparkline-event.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/chart-helper/get-chart-spec.d.ts +1 -0
- package/cjs/layout/chart-helper/get-chart-spec.js +34 -9
- package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
- package/cjs/layout/layout-helper.d.ts +4 -63
- package/cjs/layout/layout-helper.js +25 -247
- package/cjs/layout/layout-helper.js.map +1 -1
- package/cjs/layout/pivot-header-layout.d.ts +6 -3
- package/cjs/layout/pivot-header-layout.js +26 -15
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/layout/row-height-map.js +2 -1
- package/cjs/layout/row-height-map.js.map +1 -1
- package/cjs/layout/simple-header-layout.d.ts +25 -2
- package/cjs/layout/simple-header-layout.js +130 -18
- package/cjs/layout/simple-header-layout.js.map +1 -1
- package/cjs/layout/tree-helper.d.ts +63 -0
- package/cjs/layout/tree-helper.js +259 -0
- package/cjs/layout/tree-helper.js.map +1 -0
- package/cjs/scenegraph/graphic/chart.d.ts +2 -1
- package/cjs/scenegraph/graphic/chart.js +21 -18
- package/cjs/scenegraph/graphic/chart.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +4 -1
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render.js +2 -2
- package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js +19 -8
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.d.ts +1 -1
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +2 -2
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/image-cell.d.ts +1 -1
- package/cjs/scenegraph/group-creater/cell-type/image-cell.js +9 -5
- package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/video-cell.js +1 -1
- package/cjs/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/column-helper.js +5 -5
- package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/sort-vertical.js +5 -2
- package/cjs/scenegraph/group-creater/progress/update-position/sort-vertical.js.map +1 -1
- package/cjs/scenegraph/scenegraph.js +24 -11
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/style/frame-border.js +7 -4
- package/cjs/scenegraph/style/frame-border.js.map +1 -1
- package/cjs/state/hover/is-cell-hover.js +1 -1
- package/cjs/state/hover/is-cell-hover.js.map +1 -1
- package/cjs/state/sort/index.js +2 -5
- package/cjs/state/sort/index.js.map +1 -1
- package/cjs/state/state.d.ts +0 -1
- package/cjs/state/state.js +3 -4
- package/cjs/state/state.js.map +1 -1
- package/cjs/themes/theme.js +3 -0
- package/cjs/themes/theme.js.map +1 -1
- package/cjs/tools/get-data-path/create-dataset.js.map +1 -1
- package/cjs/tools/isx.d.ts +1 -1
- package/cjs/tools/util.d.ts +1 -1
- package/cjs/ts-types/base-table.d.ts +6 -5
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/list-table/define/basic-define.d.ts +2 -0
- package/cjs/ts-types/list-table/define/basic-define.js.map +1 -1
- package/cjs/ts-types/list-table/layout-map/api.d.ts +5 -4
- package/cjs/ts-types/list-table/layout-map/api.js.map +1 -1
- package/cjs/ts-types/new-data-set.d.ts +27 -6
- package/cjs/ts-types/new-data-set.js +1 -1
- package/cjs/ts-types/new-data-set.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +17 -5
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/ts-types/theme.d.ts +1 -0
- package/cjs/ts-types/theme.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +1306 -544
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.d.ts +12 -2
- package/es/ListTable.js +81 -24
- package/es/ListTable.js.map +1 -1
- package/es/PivotChart.d.ts +2 -1
- package/es/PivotChart.js +5 -1
- package/es/PivotChart.js.map +1 -1
- package/es/PivotTable.d.ts +5 -2
- package/es/PivotTable.js +13 -5
- package/es/PivotTable.js.map +1 -1
- package/es/body-helper/body-helper.js +1 -0
- package/es/body-helper/body-helper.js.map +1 -1
- package/es/core/BaseTable.d.ts +2 -2
- package/es/core/BaseTable.js +22 -18
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/tableHelper.d.ts +2 -2
- package/es/core/tableHelper.js +4 -6
- package/es/core/tableHelper.js.map +1 -1
- package/es/data/CachedDataSource.d.ts +4 -3
- package/es/data/CachedDataSource.js +5 -4
- package/es/data/CachedDataSource.js.map +1 -1
- package/es/data/DataSource.d.ts +22 -3
- package/es/data/DataSource.js +91 -7
- package/es/data/DataSource.js.map +1 -1
- package/es/dataset/dataset-pivot-table.d.ts +3 -3
- package/es/dataset/dataset-pivot-table.js +1 -0
- package/es/dataset/dataset-pivot-table.js.map +1 -1
- package/es/dataset/dataset.d.ts +3 -3
- package/es/dataset/dataset.js +3 -0
- package/es/dataset/dataset.js.map +1 -1
- package/es/dataset/statistics-helper.d.ts +24 -3
- package/es/dataset/statistics-helper.js +72 -8
- package/es/dataset/statistics-helper.js.map +1 -1
- package/es/edit/edit-manager.js +5 -4
- package/es/edit/edit-manager.js.map +1 -1
- package/es/event/listener/table-group.js +14 -4
- package/es/event/listener/table-group.js.map +1 -1
- package/es/event/media-click.js +2 -1
- package/es/event/scroll.js +1 -2
- package/es/event/sparkline-event.js +1 -1
- package/es/event/sparkline-event.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/chart-helper/get-chart-spec.d.ts +1 -0
- package/es/layout/chart-helper/get-chart-spec.js +29 -4
- package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
- package/es/layout/layout-helper.d.ts +4 -63
- package/es/layout/layout-helper.js +19 -246
- package/es/layout/layout-helper.js.map +1 -1
- package/es/layout/pivot-header-layout.d.ts +6 -3
- package/es/layout/pivot-header-layout.js +17 -6
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/layout/row-height-map.js +2 -1
- package/es/layout/row-height-map.js.map +1 -1
- package/es/layout/simple-header-layout.d.ts +25 -2
- package/es/layout/simple-header-layout.js +130 -17
- package/es/layout/simple-header-layout.js.map +1 -1
- package/es/layout/tree-helper.d.ts +63 -0
- package/es/layout/tree-helper.js +256 -0
- package/es/layout/tree-helper.js.map +1 -0
- package/es/scenegraph/graphic/chart.d.ts +2 -1
- package/es/scenegraph/graphic/chart.js +21 -17
- package/es/scenegraph/graphic/chart.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render-helper.js +4 -1
- package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render.js +2 -2
- package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.js +20 -7
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/chart-cell.d.ts +1 -1
- package/es/scenegraph/group-creater/cell-type/chart-cell.js +2 -2
- package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/image-cell.d.ts +1 -1
- package/es/scenegraph/group-creater/cell-type/image-cell.js +9 -5
- package/es/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/video-cell.js +1 -1
- package/es/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
- package/es/scenegraph/group-creater/column-helper.js +5 -5
- package/es/scenegraph/group-creater/column-helper.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/sort-vertical.js +6 -3
- package/es/scenegraph/group-creater/progress/update-position/sort-vertical.js.map +1 -1
- package/es/scenegraph/scenegraph.js +24 -11
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/style/frame-border.js +7 -4
- package/es/scenegraph/style/frame-border.js.map +1 -1
- package/es/state/hover/is-cell-hover.js +1 -1
- package/es/state/hover/is-cell-hover.js.map +1 -1
- package/es/state/sort/index.js +2 -5
- package/es/state/sort/index.js.map +1 -1
- package/es/state/state.d.ts +0 -1
- package/es/state/state.js +3 -4
- package/es/state/state.js.map +1 -1
- package/es/themes/theme.js +3 -0
- package/es/themes/theme.js.map +1 -1
- package/es/tools/get-data-path/create-dataset.js.map +1 -1
- package/es/tools/isx.d.ts +1 -1
- package/es/tools/util.d.ts +1 -1
- package/es/ts-types/base-table.d.ts +6 -5
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/list-table/define/basic-define.d.ts +2 -0
- package/es/ts-types/list-table/define/basic-define.js.map +1 -1
- package/es/ts-types/list-table/layout-map/api.d.ts +5 -4
- package/es/ts-types/list-table/layout-map/api.js.map +1 -1
- package/es/ts-types/new-data-set.d.ts +27 -6
- package/es/ts-types/new-data-set.js +1 -1
- package/es/ts-types/new-data-set.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +17 -5
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/ts-types/theme.d.ts +1 -0
- package/es/ts-types/theme.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +3 -3
- package/cjs/data/FilterDataSource.d.ts +0 -1
- package/cjs/data/FilterDataSource.js +0 -1
- package/cjs/data/FilterDataSource.js.map +0 -1
- package/es/data/FilterDataSource.d.ts +0 -1
- package/es/data/FilterDataSource.js +0 -1
- package/es/data/FilterDataSource.js.map +0 -1
package/dist/vtable.js
CHANGED
|
@@ -21455,6 +21455,7 @@
|
|
|
21455
21455
|
AggregationType["MAX"] = "MAX";
|
|
21456
21456
|
AggregationType["AVG"] = "AVG";
|
|
21457
21457
|
AggregationType["COUNT"] = "COUNT";
|
|
21458
|
+
AggregationType["CUSTOM"] = "CUSTOM";
|
|
21458
21459
|
})(AggregationType || (AggregationType = {}));
|
|
21459
21460
|
var SortType;
|
|
21460
21461
|
(function (SortType) {
|
|
@@ -23984,6 +23985,9 @@
|
|
|
23984
23985
|
get borderLineDash() {
|
|
23985
23986
|
return frameStyle.borderLineDash;
|
|
23986
23987
|
},
|
|
23988
|
+
get innerBorder() {
|
|
23989
|
+
return frameStyle.innerBorder;
|
|
23990
|
+
},
|
|
23987
23991
|
get shadowBlur() {
|
|
23988
23992
|
return frameStyle.shadowBlur;
|
|
23989
23993
|
},
|
|
@@ -30942,6 +30946,506 @@
|
|
|
30942
30946
|
return true;
|
|
30943
30947
|
}
|
|
30944
30948
|
|
|
30949
|
+
class Aggregator {
|
|
30950
|
+
className = 'Aggregator';
|
|
30951
|
+
isRecord = true;
|
|
30952
|
+
records = [];
|
|
30953
|
+
type;
|
|
30954
|
+
field;
|
|
30955
|
+
formatFun;
|
|
30956
|
+
_formatedValue;
|
|
30957
|
+
constructor(dimension, formatFun, isRecord) {
|
|
30958
|
+
this.field = dimension;
|
|
30959
|
+
this.formatFun = formatFun;
|
|
30960
|
+
this.isRecord = isRecord ?? this.isRecord;
|
|
30961
|
+
}
|
|
30962
|
+
clearCacheValue() {
|
|
30963
|
+
this._formatedValue = undefined;
|
|
30964
|
+
}
|
|
30965
|
+
formatValue(col, row, table) {
|
|
30966
|
+
if (!this._formatedValue) {
|
|
30967
|
+
if (this.formatFun) {
|
|
30968
|
+
this._formatedValue = this.formatFun(this.value(), col, row, table);
|
|
30969
|
+
}
|
|
30970
|
+
else {
|
|
30971
|
+
this._formatedValue = this.value();
|
|
30972
|
+
}
|
|
30973
|
+
}
|
|
30974
|
+
return this._formatedValue;
|
|
30975
|
+
}
|
|
30976
|
+
reset() {
|
|
30977
|
+
this.records = [];
|
|
30978
|
+
}
|
|
30979
|
+
}
|
|
30980
|
+
class RecordAggregator extends Aggregator {
|
|
30981
|
+
type = AggregationType.RECORD;
|
|
30982
|
+
isRecord = true;
|
|
30983
|
+
push(record) {
|
|
30984
|
+
if (this.isRecord) {
|
|
30985
|
+
if (record.className === 'Aggregator') {
|
|
30986
|
+
this.records.push(...record.records);
|
|
30987
|
+
}
|
|
30988
|
+
else {
|
|
30989
|
+
this.records.push(record);
|
|
30990
|
+
}
|
|
30991
|
+
}
|
|
30992
|
+
}
|
|
30993
|
+
value() {
|
|
30994
|
+
return this.records;
|
|
30995
|
+
}
|
|
30996
|
+
reset() {
|
|
30997
|
+
this.records = [];
|
|
30998
|
+
}
|
|
30999
|
+
recalculate() {
|
|
31000
|
+
}
|
|
31001
|
+
}
|
|
31002
|
+
class NoneAggregator extends Aggregator {
|
|
31003
|
+
type = AggregationType.NONE;
|
|
31004
|
+
isRecord = true;
|
|
31005
|
+
fieldValue;
|
|
31006
|
+
push(record) {
|
|
31007
|
+
if (this.isRecord) {
|
|
31008
|
+
this.records = [record];
|
|
31009
|
+
}
|
|
31010
|
+
this.fieldValue = record[this.field];
|
|
31011
|
+
}
|
|
31012
|
+
value() {
|
|
31013
|
+
return this.fieldValue;
|
|
31014
|
+
}
|
|
31015
|
+
reset() {
|
|
31016
|
+
this.records = [];
|
|
31017
|
+
this.fieldValue = undefined;
|
|
31018
|
+
}
|
|
31019
|
+
recalculate() {
|
|
31020
|
+
}
|
|
31021
|
+
}
|
|
31022
|
+
class CustomAggregator extends Aggregator {
|
|
31023
|
+
type = AggregationType.CUSTOM;
|
|
31024
|
+
isRecord = true;
|
|
31025
|
+
aggregationFun;
|
|
31026
|
+
values = [];
|
|
31027
|
+
fieldValue;
|
|
31028
|
+
constructor(dimension, formatFun, isRecord, aggregationFun) {
|
|
31029
|
+
super(dimension, formatFun, isRecord);
|
|
31030
|
+
this.aggregationFun = aggregationFun;
|
|
31031
|
+
}
|
|
31032
|
+
push(record) {
|
|
31033
|
+
if (this.isRecord) {
|
|
31034
|
+
if (record.className === 'Aggregator') {
|
|
31035
|
+
this.records.push(...record.records);
|
|
31036
|
+
}
|
|
31037
|
+
else {
|
|
31038
|
+
this.records.push(record);
|
|
31039
|
+
}
|
|
31040
|
+
}
|
|
31041
|
+
this.values.push(record[this.field]);
|
|
31042
|
+
}
|
|
31043
|
+
value() {
|
|
31044
|
+
if (!this.fieldValue) {
|
|
31045
|
+
this.fieldValue = this.aggregationFun?.(this.values, this.records, this.field);
|
|
31046
|
+
}
|
|
31047
|
+
return this.fieldValue;
|
|
31048
|
+
}
|
|
31049
|
+
reset() {
|
|
31050
|
+
this.records = [];
|
|
31051
|
+
this.fieldValue = undefined;
|
|
31052
|
+
}
|
|
31053
|
+
recalculate() {
|
|
31054
|
+
}
|
|
31055
|
+
}
|
|
31056
|
+
class SumAggregator extends Aggregator {
|
|
31057
|
+
type = AggregationType.SUM;
|
|
31058
|
+
sum = 0;
|
|
31059
|
+
positiveSum = 0;
|
|
31060
|
+
nagetiveSum = 0;
|
|
31061
|
+
needSplitPositiveAndNegativeForSum = false;
|
|
31062
|
+
constructor(dimension, formatFun, isRecord, needSplitPositiveAndNegative) {
|
|
31063
|
+
super(dimension, formatFun, isRecord);
|
|
31064
|
+
this.needSplitPositiveAndNegativeForSum = needSplitPositiveAndNegative ?? false;
|
|
31065
|
+
}
|
|
31066
|
+
push(record) {
|
|
31067
|
+
if (this.isRecord) {
|
|
31068
|
+
if (record.className === 'Aggregator') {
|
|
31069
|
+
this.records.push(...record.records);
|
|
31070
|
+
}
|
|
31071
|
+
else {
|
|
31072
|
+
this.records.push(record);
|
|
31073
|
+
}
|
|
31074
|
+
}
|
|
31075
|
+
if (record.className === 'Aggregator') {
|
|
31076
|
+
const value = record.value();
|
|
31077
|
+
this.sum += value;
|
|
31078
|
+
if (this.needSplitPositiveAndNegativeForSum) {
|
|
31079
|
+
if (value > 0) {
|
|
31080
|
+
this.positiveSum += value;
|
|
31081
|
+
}
|
|
31082
|
+
else if (value < 0) {
|
|
31083
|
+
this.nagetiveSum += value;
|
|
31084
|
+
}
|
|
31085
|
+
}
|
|
31086
|
+
}
|
|
31087
|
+
else if (!isNaN(parseFloat(record[this.field]))) {
|
|
31088
|
+
const value = parseFloat(record[this.field]);
|
|
31089
|
+
this.sum += value;
|
|
31090
|
+
if (this.needSplitPositiveAndNegativeForSum) {
|
|
31091
|
+
if (value > 0) {
|
|
31092
|
+
this.positiveSum += value;
|
|
31093
|
+
}
|
|
31094
|
+
else if (value < 0) {
|
|
31095
|
+
this.nagetiveSum += value;
|
|
31096
|
+
}
|
|
31097
|
+
}
|
|
31098
|
+
}
|
|
31099
|
+
}
|
|
31100
|
+
value() {
|
|
31101
|
+
return this.sum;
|
|
31102
|
+
}
|
|
31103
|
+
positiveValue() {
|
|
31104
|
+
return this.positiveSum;
|
|
31105
|
+
}
|
|
31106
|
+
negativeValue() {
|
|
31107
|
+
return this.nagetiveSum;
|
|
31108
|
+
}
|
|
31109
|
+
reset() {
|
|
31110
|
+
this.records = [];
|
|
31111
|
+
this.sum = 0;
|
|
31112
|
+
}
|
|
31113
|
+
recalculate() {
|
|
31114
|
+
this.sum = 0;
|
|
31115
|
+
this._formatedValue = undefined;
|
|
31116
|
+
for (let i = 0; i < this.records.length; i++) {
|
|
31117
|
+
const record = this.records[i];
|
|
31118
|
+
if (record.className === 'Aggregator') {
|
|
31119
|
+
const value = record.value();
|
|
31120
|
+
this.sum += value;
|
|
31121
|
+
if (this.needSplitPositiveAndNegativeForSum) {
|
|
31122
|
+
if (value > 0) {
|
|
31123
|
+
this.positiveSum += value;
|
|
31124
|
+
}
|
|
31125
|
+
else if (value < 0) {
|
|
31126
|
+
this.nagetiveSum += value;
|
|
31127
|
+
}
|
|
31128
|
+
}
|
|
31129
|
+
}
|
|
31130
|
+
else if (!isNaN(parseFloat(record[this.field]))) {
|
|
31131
|
+
const value = parseFloat(record[this.field]);
|
|
31132
|
+
this.sum += value;
|
|
31133
|
+
if (this.needSplitPositiveAndNegativeForSum) {
|
|
31134
|
+
if (value > 0) {
|
|
31135
|
+
this.positiveSum += value;
|
|
31136
|
+
}
|
|
31137
|
+
else if (value < 0) {
|
|
31138
|
+
this.nagetiveSum += value;
|
|
31139
|
+
}
|
|
31140
|
+
}
|
|
31141
|
+
}
|
|
31142
|
+
}
|
|
31143
|
+
}
|
|
31144
|
+
}
|
|
31145
|
+
class CountAggregator extends Aggregator {
|
|
31146
|
+
type = AggregationType.COUNT;
|
|
31147
|
+
count = 0;
|
|
31148
|
+
push(record) {
|
|
31149
|
+
if (this.isRecord) {
|
|
31150
|
+
if (record.className === 'Aggregator') {
|
|
31151
|
+
this.records.push(...record.records);
|
|
31152
|
+
}
|
|
31153
|
+
else {
|
|
31154
|
+
this.records.push(record);
|
|
31155
|
+
}
|
|
31156
|
+
}
|
|
31157
|
+
if (record.className === 'Aggregator') {
|
|
31158
|
+
this.count += record.value();
|
|
31159
|
+
}
|
|
31160
|
+
else {
|
|
31161
|
+
this.count++;
|
|
31162
|
+
}
|
|
31163
|
+
}
|
|
31164
|
+
value() {
|
|
31165
|
+
return this.count;
|
|
31166
|
+
}
|
|
31167
|
+
reset() {
|
|
31168
|
+
this.records = [];
|
|
31169
|
+
this.count = 0;
|
|
31170
|
+
}
|
|
31171
|
+
recalculate() {
|
|
31172
|
+
this.count = 0;
|
|
31173
|
+
this._formatedValue = undefined;
|
|
31174
|
+
for (let i = 0; i < this.records.length; i++) {
|
|
31175
|
+
const record = this.records[i];
|
|
31176
|
+
if (record.className === 'Aggregator') {
|
|
31177
|
+
this.count += record.value();
|
|
31178
|
+
}
|
|
31179
|
+
else {
|
|
31180
|
+
this.count++;
|
|
31181
|
+
}
|
|
31182
|
+
}
|
|
31183
|
+
}
|
|
31184
|
+
}
|
|
31185
|
+
class AvgAggregator extends Aggregator {
|
|
31186
|
+
type = AggregationType.AVG;
|
|
31187
|
+
sum = 0;
|
|
31188
|
+
count = 0;
|
|
31189
|
+
push(record) {
|
|
31190
|
+
if (this.isRecord) {
|
|
31191
|
+
if (record.className === 'Aggregator') {
|
|
31192
|
+
this.records.push(...record.records);
|
|
31193
|
+
}
|
|
31194
|
+
else {
|
|
31195
|
+
this.records.push(record);
|
|
31196
|
+
}
|
|
31197
|
+
}
|
|
31198
|
+
if (record.className === 'Aggregator' && record.type === AggregationType.AVG) {
|
|
31199
|
+
this.sum += record.sum;
|
|
31200
|
+
this.count += record.count;
|
|
31201
|
+
}
|
|
31202
|
+
else if (!isNaN(parseFloat(record[this.field]))) {
|
|
31203
|
+
this.sum += parseFloat(record[this.field]);
|
|
31204
|
+
this.count++;
|
|
31205
|
+
}
|
|
31206
|
+
}
|
|
31207
|
+
value() {
|
|
31208
|
+
return this.sum / this.count;
|
|
31209
|
+
}
|
|
31210
|
+
reset() {
|
|
31211
|
+
this.records = [];
|
|
31212
|
+
this.sum = 0;
|
|
31213
|
+
this.count = 0;
|
|
31214
|
+
}
|
|
31215
|
+
recalculate() {
|
|
31216
|
+
this.sum = 0;
|
|
31217
|
+
this.count = 0;
|
|
31218
|
+
this._formatedValue = undefined;
|
|
31219
|
+
for (let i = 0; i < this.records.length; i++) {
|
|
31220
|
+
const record = this.records[i];
|
|
31221
|
+
if (record.className === 'Aggregator' && record.type === AggregationType.AVG) {
|
|
31222
|
+
this.sum += record.sum;
|
|
31223
|
+
this.count += record.count;
|
|
31224
|
+
}
|
|
31225
|
+
else if (!isNaN(parseFloat(record[this.field]))) {
|
|
31226
|
+
this.sum += parseFloat(record[this.field]);
|
|
31227
|
+
this.count++;
|
|
31228
|
+
}
|
|
31229
|
+
}
|
|
31230
|
+
}
|
|
31231
|
+
}
|
|
31232
|
+
class MaxAggregator extends Aggregator {
|
|
31233
|
+
type = AggregationType.MAX;
|
|
31234
|
+
max = Number.MIN_SAFE_INTEGER;
|
|
31235
|
+
push(record) {
|
|
31236
|
+
if (this.isRecord) {
|
|
31237
|
+
if (record.className === 'Aggregator') {
|
|
31238
|
+
this.records.push(...record.records);
|
|
31239
|
+
}
|
|
31240
|
+
else {
|
|
31241
|
+
this.records.push(record);
|
|
31242
|
+
}
|
|
31243
|
+
}
|
|
31244
|
+
if (record.className === 'Aggregator') {
|
|
31245
|
+
this.max = record.max > this.max ? record.max : this.max;
|
|
31246
|
+
}
|
|
31247
|
+
else if (typeof record === 'number') {
|
|
31248
|
+
this.max = record > this.max ? record : this.max;
|
|
31249
|
+
}
|
|
31250
|
+
else if (typeof record[this.field] === 'number') {
|
|
31251
|
+
this.max = record[this.field] > this.max ? record[this.field] : this.max;
|
|
31252
|
+
}
|
|
31253
|
+
else if (!isNaN(record[this.field])) {
|
|
31254
|
+
this.max = parseFloat(record[this.field]) > this.max ? parseFloat(record[this.field]) : this.max;
|
|
31255
|
+
}
|
|
31256
|
+
}
|
|
31257
|
+
value() {
|
|
31258
|
+
return this.max;
|
|
31259
|
+
}
|
|
31260
|
+
reset() {
|
|
31261
|
+
this.records = [];
|
|
31262
|
+
this.max = Number.MIN_SAFE_INTEGER;
|
|
31263
|
+
}
|
|
31264
|
+
recalculate() {
|
|
31265
|
+
this.max = Number.MIN_SAFE_INTEGER;
|
|
31266
|
+
this._formatedValue = undefined;
|
|
31267
|
+
for (let i = 0; i < this.records.length; i++) {
|
|
31268
|
+
const record = this.records[i];
|
|
31269
|
+
if (record.className === 'Aggregator') {
|
|
31270
|
+
this.max = record.max > this.max ? record.max : this.max;
|
|
31271
|
+
}
|
|
31272
|
+
else if (typeof record === 'number') {
|
|
31273
|
+
this.max = record > this.max ? record : this.max;
|
|
31274
|
+
}
|
|
31275
|
+
else if (typeof record[this.field] === 'number') {
|
|
31276
|
+
this.max = record[this.field] > this.max ? record[this.field] : this.max;
|
|
31277
|
+
}
|
|
31278
|
+
else if (!isNaN(record[this.field])) {
|
|
31279
|
+
this.max = parseFloat(record[this.field]) > this.max ? parseFloat(record[this.field]) : this.max;
|
|
31280
|
+
}
|
|
31281
|
+
}
|
|
31282
|
+
}
|
|
31283
|
+
}
|
|
31284
|
+
class MinAggregator extends Aggregator {
|
|
31285
|
+
type = AggregationType.MIN;
|
|
31286
|
+
min = Number.MAX_SAFE_INTEGER;
|
|
31287
|
+
push(record) {
|
|
31288
|
+
if (this.isRecord) {
|
|
31289
|
+
if (record.className === 'Aggregator') {
|
|
31290
|
+
this.records.push(...record.records);
|
|
31291
|
+
}
|
|
31292
|
+
else {
|
|
31293
|
+
this.records.push(record);
|
|
31294
|
+
}
|
|
31295
|
+
}
|
|
31296
|
+
if (record.className === 'Aggregator') {
|
|
31297
|
+
this.min = record.min < this.min ? record.min : this.min;
|
|
31298
|
+
}
|
|
31299
|
+
else if (typeof record === 'number') {
|
|
31300
|
+
this.min = record < this.min ? record : this.min;
|
|
31301
|
+
}
|
|
31302
|
+
else if (typeof record[this.field] === 'number') {
|
|
31303
|
+
this.min = record[this.field] < this.min ? record[this.field] : this.min;
|
|
31304
|
+
}
|
|
31305
|
+
}
|
|
31306
|
+
value() {
|
|
31307
|
+
return this.min;
|
|
31308
|
+
}
|
|
31309
|
+
reset() {
|
|
31310
|
+
this.records = [];
|
|
31311
|
+
this.min = Number.MAX_SAFE_INTEGER;
|
|
31312
|
+
}
|
|
31313
|
+
recalculate() {
|
|
31314
|
+
this.min = Number.MAX_SAFE_INTEGER;
|
|
31315
|
+
this._formatedValue = undefined;
|
|
31316
|
+
for (let i = 0; i < this.records.length; i++) {
|
|
31317
|
+
const record = this.records[i];
|
|
31318
|
+
if (record.className === 'Aggregator') {
|
|
31319
|
+
this.min = record.min < this.min ? record.min : this.min;
|
|
31320
|
+
}
|
|
31321
|
+
else if (typeof record === 'number') {
|
|
31322
|
+
this.min = record < this.min ? record : this.min;
|
|
31323
|
+
}
|
|
31324
|
+
else if (typeof record[this.field] === 'number') {
|
|
31325
|
+
this.min = record[this.field] < this.min ? record[this.field] : this.min;
|
|
31326
|
+
}
|
|
31327
|
+
}
|
|
31328
|
+
}
|
|
31329
|
+
}
|
|
31330
|
+
function typeSort(a, b) {
|
|
31331
|
+
if (a && b) {
|
|
31332
|
+
return a.toString().localeCompare(b.toString(), 'zh');
|
|
31333
|
+
}
|
|
31334
|
+
if (a) {
|
|
31335
|
+
return 1;
|
|
31336
|
+
}
|
|
31337
|
+
return -1;
|
|
31338
|
+
}
|
|
31339
|
+
function naturalSort(as, bs) {
|
|
31340
|
+
const rx = /(\d+)|(\D+)/g;
|
|
31341
|
+
const rd = /\d/;
|
|
31342
|
+
const rz = /^0/;
|
|
31343
|
+
let a;
|
|
31344
|
+
let a1;
|
|
31345
|
+
let b;
|
|
31346
|
+
let b1;
|
|
31347
|
+
let nas = 0;
|
|
31348
|
+
let nbs = 0;
|
|
31349
|
+
if (bs !== null && as === null) {
|
|
31350
|
+
return -1;
|
|
31351
|
+
}
|
|
31352
|
+
if (as !== null && bs === null) {
|
|
31353
|
+
return 1;
|
|
31354
|
+
}
|
|
31355
|
+
if (typeof as === 'number' && isNaN(as)) {
|
|
31356
|
+
return -1;
|
|
31357
|
+
}
|
|
31358
|
+
if (typeof bs === 'number' && isNaN(bs)) {
|
|
31359
|
+
return 1;
|
|
31360
|
+
}
|
|
31361
|
+
nas = +as;
|
|
31362
|
+
nbs = +bs;
|
|
31363
|
+
if (nas < nbs) {
|
|
31364
|
+
return -1;
|
|
31365
|
+
}
|
|
31366
|
+
if (nas > nbs) {
|
|
31367
|
+
return 1;
|
|
31368
|
+
}
|
|
31369
|
+
if (typeof as === 'number' && typeof bs !== 'number') {
|
|
31370
|
+
return -1;
|
|
31371
|
+
}
|
|
31372
|
+
if (typeof bs === 'number' && typeof as !== 'number') {
|
|
31373
|
+
return 1;
|
|
31374
|
+
}
|
|
31375
|
+
if (typeof as === 'number' && typeof bs === 'number') {
|
|
31376
|
+
return 0;
|
|
31377
|
+
}
|
|
31378
|
+
if (isNaN(nbs) && !isNaN(nas)) {
|
|
31379
|
+
return -1;
|
|
31380
|
+
}
|
|
31381
|
+
if (isNaN(nas) && !isNaN(nbs)) {
|
|
31382
|
+
return 1;
|
|
31383
|
+
}
|
|
31384
|
+
a = String(as);
|
|
31385
|
+
b = String(bs);
|
|
31386
|
+
if (a === b) {
|
|
31387
|
+
return 0;
|
|
31388
|
+
}
|
|
31389
|
+
if (!(rd.test(a) && rd.test(b))) {
|
|
31390
|
+
return a > b ? 1 : -1;
|
|
31391
|
+
}
|
|
31392
|
+
a = a.match(rx);
|
|
31393
|
+
b = b.match(rx);
|
|
31394
|
+
while (a.length && b.length) {
|
|
31395
|
+
a1 = a.shift();
|
|
31396
|
+
b1 = b.shift();
|
|
31397
|
+
if (a1 !== b1) {
|
|
31398
|
+
if (rd.test(a1) && rd.test(b1)) {
|
|
31399
|
+
return a1.replace(rz, '.0') - b1.replace(rz, '.0');
|
|
31400
|
+
}
|
|
31401
|
+
return a1 > b1 ? 1 : -1;
|
|
31402
|
+
}
|
|
31403
|
+
}
|
|
31404
|
+
return a.length - b.length;
|
|
31405
|
+
}
|
|
31406
|
+
function sortBy(order) {
|
|
31407
|
+
let x;
|
|
31408
|
+
const mapping = {};
|
|
31409
|
+
const lowercase_mapping = {};
|
|
31410
|
+
for (let i = 0; i < order.length; i++) {
|
|
31411
|
+
x = order[i];
|
|
31412
|
+
mapping[x] = i;
|
|
31413
|
+
if (typeof x === 'string') {
|
|
31414
|
+
lowercase_mapping[x.toLowerCase()] = i;
|
|
31415
|
+
}
|
|
31416
|
+
}
|
|
31417
|
+
return function (a, b) {
|
|
31418
|
+
if (mapping[a] !== null && mapping[a] !== undefined && mapping[b] !== null && mapping[b] !== undefined) {
|
|
31419
|
+
return mapping[a] - mapping[b];
|
|
31420
|
+
}
|
|
31421
|
+
else if (mapping[a] !== null && mapping[a] !== undefined) {
|
|
31422
|
+
return -1;
|
|
31423
|
+
}
|
|
31424
|
+
else if (mapping[b] !== null && mapping[b] !== undefined) {
|
|
31425
|
+
return 1;
|
|
31426
|
+
}
|
|
31427
|
+
else if (lowercase_mapping[a] !== null &&
|
|
31428
|
+
mapping[a] !== undefined &&
|
|
31429
|
+
lowercase_mapping[b] !== null &&
|
|
31430
|
+
mapping[b] !== undefined) {
|
|
31431
|
+
return lowercase_mapping[a] - lowercase_mapping[b];
|
|
31432
|
+
}
|
|
31433
|
+
else if (lowercase_mapping[a] === null ||
|
|
31434
|
+
mapping[a] === undefined ||
|
|
31435
|
+
lowercase_mapping[b] === null ||
|
|
31436
|
+
mapping[b] === undefined) {
|
|
31437
|
+
return 0;
|
|
31438
|
+
}
|
|
31439
|
+
else if (lowercase_mapping[a] !== null && mapping[a] !== undefined) {
|
|
31440
|
+
return -1;
|
|
31441
|
+
}
|
|
31442
|
+
else if (lowercase_mapping[b] !== null && mapping[b] !== undefined) {
|
|
31443
|
+
return 1;
|
|
31444
|
+
}
|
|
31445
|
+
return naturalSort(a, b);
|
|
31446
|
+
};
|
|
31447
|
+
}
|
|
31448
|
+
|
|
30945
31449
|
function isFieldAssessor(field) {
|
|
30946
31450
|
if (obj.isObject(field)) {
|
|
30947
31451
|
const a = field;
|
|
@@ -31003,6 +31507,8 @@
|
|
|
31003
31507
|
return isValid$1(mapIndex) ? mapIndex : index;
|
|
31004
31508
|
}
|
|
31005
31509
|
class DataSource extends EventTarget$1 {
|
|
31510
|
+
dataConfig;
|
|
31511
|
+
dataSourceObj;
|
|
31006
31512
|
_get;
|
|
31007
31513
|
_sourceLength;
|
|
31008
31514
|
_source;
|
|
@@ -31020,11 +31526,18 @@
|
|
|
31020
31526
|
}
|
|
31021
31527
|
treeDataHierarchyState = new Map();
|
|
31022
31528
|
beforeChangedRecordsMap = [];
|
|
31023
|
-
|
|
31529
|
+
registedAggregators = {};
|
|
31530
|
+
fieldAggregators = [];
|
|
31531
|
+
layoutColumnObjects = [];
|
|
31532
|
+
constructor(dataSourceObj, dataConfig, pagination, columnObjs, hierarchyExpandLevel) {
|
|
31024
31533
|
super();
|
|
31025
|
-
this.
|
|
31026
|
-
this.
|
|
31027
|
-
this.
|
|
31534
|
+
this.registerAggregators();
|
|
31535
|
+
this.dataSourceObj = dataSourceObj;
|
|
31536
|
+
this.dataConfig = dataConfig;
|
|
31537
|
+
this._get = dataSourceObj?.get.bind(dataSourceObj) || undefined;
|
|
31538
|
+
this.layoutColumnObjects = columnObjs;
|
|
31539
|
+
this._source = this.processRecords(dataSourceObj?.source ?? dataSourceObj);
|
|
31540
|
+
this._sourceLength = this._source?.length || 0;
|
|
31028
31541
|
this.sortedIndexMap = new Map();
|
|
31029
31542
|
this._currentPagerIndexedData = [];
|
|
31030
31543
|
this.userPagination = pagination;
|
|
@@ -31058,6 +31571,76 @@
|
|
|
31058
31571
|
}
|
|
31059
31572
|
this.updatePagerData();
|
|
31060
31573
|
}
|
|
31574
|
+
registerAggregator(type, aggregator) {
|
|
31575
|
+
this.registedAggregators[type] = aggregator;
|
|
31576
|
+
}
|
|
31577
|
+
registerAggregators() {
|
|
31578
|
+
this.registerAggregator(AggregationType.RECORD, RecordAggregator);
|
|
31579
|
+
this.registerAggregator(AggregationType.SUM, SumAggregator);
|
|
31580
|
+
this.registerAggregator(AggregationType.COUNT, CountAggregator);
|
|
31581
|
+
this.registerAggregator(AggregationType.MAX, MaxAggregator);
|
|
31582
|
+
this.registerAggregator(AggregationType.MIN, MinAggregator);
|
|
31583
|
+
this.registerAggregator(AggregationType.AVG, AvgAggregator);
|
|
31584
|
+
this.registerAggregator(AggregationType.NONE, NoneAggregator);
|
|
31585
|
+
this.registerAggregator(AggregationType.CUSTOM, CustomAggregator);
|
|
31586
|
+
}
|
|
31587
|
+
_generateFieldAggragations() {
|
|
31588
|
+
const columnObjs = this.layoutColumnObjects;
|
|
31589
|
+
for (let i = 0; i < columnObjs?.length; i++) {
|
|
31590
|
+
columnObjs[i].aggregator = null;
|
|
31591
|
+
const field = columnObjs[i].field;
|
|
31592
|
+
const aggragation = columnObjs[i].aggregation;
|
|
31593
|
+
if (!aggragation) {
|
|
31594
|
+
continue;
|
|
31595
|
+
}
|
|
31596
|
+
if (Array.isArray(aggragation)) {
|
|
31597
|
+
for (let j = 0; j < aggragation.length; j++) {
|
|
31598
|
+
const item = aggragation[j];
|
|
31599
|
+
const aggregator = new this.registedAggregators[item.aggregationType](field, item.formatFun, true, item.aggregationFun);
|
|
31600
|
+
this.fieldAggregators.push(aggregator);
|
|
31601
|
+
if (!columnObjs[i].aggregator) {
|
|
31602
|
+
columnObjs[i].aggregator = [];
|
|
31603
|
+
}
|
|
31604
|
+
columnObjs[i].aggregator.push(aggregator);
|
|
31605
|
+
}
|
|
31606
|
+
}
|
|
31607
|
+
else {
|
|
31608
|
+
const aggregator = new this.registedAggregators[aggragation.aggregationType](field, aggragation.formatFun, true, aggragation.aggregationFun);
|
|
31609
|
+
this.fieldAggregators.push(aggregator);
|
|
31610
|
+
columnObjs[i].aggregator = aggregator;
|
|
31611
|
+
}
|
|
31612
|
+
}
|
|
31613
|
+
}
|
|
31614
|
+
processRecords(records) {
|
|
31615
|
+
this._generateFieldAggragations();
|
|
31616
|
+
const filteredRecords = [];
|
|
31617
|
+
const isHasAggregation = this.fieldAggregators.length >= 1;
|
|
31618
|
+
const isHasFilterRule = this.dataConfig?.filterRules?.length >= 1;
|
|
31619
|
+
if (isHasFilterRule || isHasAggregation) {
|
|
31620
|
+
for (let i = 0, len = records.length; i < len; i++) {
|
|
31621
|
+
const record = records[i];
|
|
31622
|
+
if (isHasFilterRule) {
|
|
31623
|
+
if (this.filterRecord(record)) {
|
|
31624
|
+
filteredRecords.push(record);
|
|
31625
|
+
isHasAggregation && this.processRecord(record);
|
|
31626
|
+
}
|
|
31627
|
+
}
|
|
31628
|
+
else if (isHasAggregation) {
|
|
31629
|
+
this.processRecord(record);
|
|
31630
|
+
}
|
|
31631
|
+
}
|
|
31632
|
+
if (isHasFilterRule) {
|
|
31633
|
+
return filteredRecords;
|
|
31634
|
+
}
|
|
31635
|
+
}
|
|
31636
|
+
return records;
|
|
31637
|
+
}
|
|
31638
|
+
processRecord(record) {
|
|
31639
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) {
|
|
31640
|
+
const aggregator = this.fieldAggregators[i];
|
|
31641
|
+
aggregator.push(record);
|
|
31642
|
+
}
|
|
31643
|
+
}
|
|
31061
31644
|
initChildrenNodeHierarchy(indexKey, hierarchyExpandLevel, currentLevel, nodeData) {
|
|
31062
31645
|
if (currentLevel > hierarchyExpandLevel) {
|
|
31063
31646
|
return 0;
|
|
@@ -31419,6 +32002,49 @@
|
|
|
31419
32002
|
this.updatePagerData();
|
|
31420
32003
|
this.fireListeners(EVENT_TYPE.CHANGE_ORDER, null);
|
|
31421
32004
|
}
|
|
32005
|
+
filterRecord(record) {
|
|
32006
|
+
let isReserved = true;
|
|
32007
|
+
for (let i = 0; i < this.dataConfig.filterRules.length; i++) {
|
|
32008
|
+
const filterRule = this.dataConfig?.filterRules[i];
|
|
32009
|
+
if (filterRule.filterKey) {
|
|
32010
|
+
const filterValue = record[filterRule.filterKey];
|
|
32011
|
+
if (filterRule.filteredValues.indexOf(filterValue) === -1) {
|
|
32012
|
+
isReserved = false;
|
|
32013
|
+
break;
|
|
32014
|
+
}
|
|
32015
|
+
}
|
|
32016
|
+
else if (!filterRule.filterFunc?.(record)) {
|
|
32017
|
+
isReserved = false;
|
|
32018
|
+
break;
|
|
32019
|
+
}
|
|
32020
|
+
}
|
|
32021
|
+
return isReserved;
|
|
32022
|
+
}
|
|
32023
|
+
updateFilterRulesForSorted(filterRules) {
|
|
32024
|
+
this.dataConfig.filterRules = filterRules;
|
|
32025
|
+
this._source = this.processRecords(this.dataSourceObj?.source ?? this.dataSourceObj);
|
|
32026
|
+
this._sourceLength = this._source?.length || 0;
|
|
32027
|
+
this.sortedIndexMap.clear();
|
|
32028
|
+
this.currentIndexedData = Array.from({ length: this._sourceLength }, (_, i) => i);
|
|
32029
|
+
if (!this.userPagination) {
|
|
32030
|
+
this.pagination.perPageCount = this._sourceLength;
|
|
32031
|
+
this.pagination.totalCount = this._sourceLength;
|
|
32032
|
+
}
|
|
32033
|
+
}
|
|
32034
|
+
updateFilterRules(filterRules) {
|
|
32035
|
+
this.dataConfig.filterRules = filterRules;
|
|
32036
|
+
this._source = this.processRecords(this.dataSourceObj?.source ?? this.dataSourceObj);
|
|
32037
|
+
this._sourceLength = this._source?.length || 0;
|
|
32038
|
+
this.currentIndexedData = Array.from({ length: this._sourceLength }, (_, i) => i);
|
|
32039
|
+
if (this.userPagination) {
|
|
32040
|
+
this.updatePagerData();
|
|
32041
|
+
}
|
|
32042
|
+
else {
|
|
32043
|
+
this.pagination.perPageCount = this._sourceLength;
|
|
32044
|
+
this.pagination.totalCount = this._sourceLength;
|
|
32045
|
+
this.updatePagerData();
|
|
32046
|
+
}
|
|
32047
|
+
}
|
|
31422
32048
|
clearSortedIndexMap() {
|
|
31423
32049
|
if (this.lastOrderField && this.lastOrder) {
|
|
31424
32050
|
this.sortedIndexMap.forEach((sortMap, key) => {
|
|
@@ -31479,6 +32105,9 @@
|
|
|
31479
32105
|
this.currentPagerIndexedData.length = 0;
|
|
31480
32106
|
}
|
|
31481
32107
|
getOriginalRecord(dataIndex) {
|
|
32108
|
+
if (this.dataConfig?.filterRules) {
|
|
32109
|
+
return this.source[dataIndex];
|
|
32110
|
+
}
|
|
31482
32111
|
return getValue(this._get(dataIndex), (val) => {
|
|
31483
32112
|
this.recordPromiseCallBack(dataIndex, val);
|
|
31484
32113
|
});
|
|
@@ -31540,7 +32169,7 @@
|
|
|
31540
32169
|
static get EVENT_TYPE() {
|
|
31541
32170
|
return DataSource.EVENT_TYPE;
|
|
31542
32171
|
}
|
|
31543
|
-
static ofArray(array, pagination, hierarchyExpandLevel) {
|
|
32172
|
+
static ofArray(array, dataConfig, pagination, columnObjs, hierarchyExpandLevel) {
|
|
31544
32173
|
return new CachedDataSource({
|
|
31545
32174
|
get: (index) => {
|
|
31546
32175
|
if (Array.isArray(index)) {
|
|
@@ -31550,10 +32179,10 @@
|
|
|
31550
32179
|
},
|
|
31551
32180
|
length: array.length,
|
|
31552
32181
|
source: array
|
|
31553
|
-
}, pagination, hierarchyExpandLevel);
|
|
32182
|
+
}, dataConfig, pagination, columnObjs, hierarchyExpandLevel);
|
|
31554
32183
|
}
|
|
31555
|
-
constructor(opt, pagination, hierarchyExpandLevel) {
|
|
31556
|
-
super(opt, pagination, hierarchyExpandLevel);
|
|
32184
|
+
constructor(opt, dataConfig, pagination, columnObjs, hierarchyExpandLevel) {
|
|
32185
|
+
super(opt, dataConfig, pagination, columnObjs, hierarchyExpandLevel);
|
|
31557
32186
|
this._recordCache = {};
|
|
31558
32187
|
this._fieldCache = {};
|
|
31559
32188
|
}
|
|
@@ -32073,7 +32702,7 @@
|
|
|
32073
32702
|
_dealWithUpdateDataSource(table, () => {
|
|
32074
32703
|
const data = records;
|
|
32075
32704
|
table.internalProps.records = records;
|
|
32076
|
-
const newDataSource = (table.internalProps.dataSource = CachedDataSource.ofArray(data, table.pagination, table.options.hierarchyExpandLevel ?? (table._hasHierarchyTreeHeader?.() ? 1 : undefined)));
|
|
32705
|
+
const newDataSource = (table.internalProps.dataSource = CachedDataSource.ofArray(data, table.internalProps.dataConfig, table.pagination, table.internalProps.layoutMap.columnObjects, table.options.hierarchyExpandLevel ?? (table._hasHierarchyTreeHeader?.() ? 1 : undefined)));
|
|
32077
32706
|
table.addReleaseObj(newDataSource);
|
|
32078
32707
|
});
|
|
32079
32708
|
}
|
|
@@ -32263,24 +32892,17 @@
|
|
|
32263
32892
|
if (table.sortState) {
|
|
32264
32893
|
let order;
|
|
32265
32894
|
let field;
|
|
32266
|
-
let fieldKey;
|
|
32267
32895
|
if (Array.isArray(table.sortState)) {
|
|
32268
32896
|
if (table.sortState.length !== 0) {
|
|
32269
|
-
({ order, field
|
|
32897
|
+
({ order, field } = table.sortState?.[0]);
|
|
32270
32898
|
}
|
|
32271
32899
|
}
|
|
32272
32900
|
else {
|
|
32273
|
-
({ order, field
|
|
32901
|
+
({ order, field } = table.sortState);
|
|
32274
32902
|
}
|
|
32275
32903
|
if (order && field && order !== 'normal') {
|
|
32276
|
-
const sortFunc = table._getSortFuncFromHeaderOption(undefined, field
|
|
32277
|
-
|
|
32278
|
-
if (fieldKey) {
|
|
32279
|
-
hd = table.internalProps.layoutMap.headerObjects.find((col) => col && col.fieldKey === fieldKey);
|
|
32280
|
-
}
|
|
32281
|
-
else {
|
|
32282
|
-
hd = table.internalProps.layoutMap.headerObjects.find((col) => col && col.field === field);
|
|
32283
|
-
}
|
|
32904
|
+
const sortFunc = table._getSortFuncFromHeaderOption(undefined, field);
|
|
32905
|
+
const hd = table.internalProps.layoutMap.headerObjects.find((col) => col && col.field === field);
|
|
32284
32906
|
table.dataSource.sort(hd.field, order, sortFunc ?? defaultOrderFn);
|
|
32285
32907
|
}
|
|
32286
32908
|
}
|
|
@@ -32599,11 +33221,13 @@
|
|
|
32599
33221
|
activeChartInstance;
|
|
32600
33222
|
active;
|
|
32601
33223
|
cacheCanvas;
|
|
32602
|
-
|
|
33224
|
+
isShareChartSpec;
|
|
33225
|
+
constructor(isShareChartSpec, params) {
|
|
32603
33226
|
super(params);
|
|
32604
33227
|
this.numberType = CHART_NUMBER_TYPE;
|
|
33228
|
+
this.isShareChartSpec = isShareChartSpec;
|
|
32605
33229
|
if (!params.chartInstance) {
|
|
32606
|
-
|
|
33230
|
+
const chartInstance = new params.ClassType(params.spec, {
|
|
32607
33231
|
renderCanvas: params.canvas,
|
|
32608
33232
|
mode: this.attribute.mode === 'node' ? 'node' : 'desktop-browser',
|
|
32609
33233
|
modeParams: this.attribute.modeParams,
|
|
@@ -32614,7 +33238,8 @@
|
|
|
32614
33238
|
animation: false,
|
|
32615
33239
|
autoFit: false
|
|
32616
33240
|
});
|
|
32617
|
-
|
|
33241
|
+
chartInstance.renderSync();
|
|
33242
|
+
params.chartInstance = this.chartInstance = chartInstance;
|
|
32618
33243
|
}
|
|
32619
33244
|
else {
|
|
32620
33245
|
this.chartInstance = params.chartInstance;
|
|
@@ -32739,7 +33364,7 @@
|
|
|
32739
33364
|
return extend(builtin, chartTypes);
|
|
32740
33365
|
}
|
|
32741
33366
|
|
|
32742
|
-
function createChartCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, width, height, padding, dataValue, chartModule, chartSpec, chartInstance, dataId, table, cellTheme) {
|
|
33367
|
+
function createChartCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, width, height, padding, dataValue, chartModule, chartSpec, chartInstance, dataId, table, cellTheme, isShareChartSpec) {
|
|
32743
33368
|
const registerCharts = get$2();
|
|
32744
33369
|
const ClassType = registerCharts[chartModule];
|
|
32745
33370
|
const headerStyle = table._getCellStyle(col, row);
|
|
@@ -32770,7 +33395,7 @@
|
|
|
32770
33395
|
columnGroup?.addCellGroup(cellGroup);
|
|
32771
33396
|
}
|
|
32772
33397
|
cellGroup.AABBBounds.width();
|
|
32773
|
-
const chartGroup = new Chart({
|
|
33398
|
+
const chartGroup = new Chart(isShareChartSpec, {
|
|
32774
33399
|
stroke: false,
|
|
32775
33400
|
x: padding[3],
|
|
32776
33401
|
y: padding[0],
|
|
@@ -33174,7 +33799,9 @@
|
|
|
33174
33799
|
if (image.resources &&
|
|
33175
33800
|
image.resources.has(image.attribute.image) &&
|
|
33176
33801
|
image.resources.get(image.attribute.image).state === 'success') {
|
|
33177
|
-
|
|
33802
|
+
setTimeout(() => {
|
|
33803
|
+
updateAutoSizingAndKeepAspectRatio(imageAutoSizing, keepAspectRatio, padding, textAlign, textBaseline, image, cellGroup, table);
|
|
33804
|
+
}, 0);
|
|
33178
33805
|
}
|
|
33179
33806
|
else {
|
|
33180
33807
|
image.successCallback = () => {
|
|
@@ -33202,11 +33829,10 @@
|
|
|
33202
33829
|
cellGroup.appendChild(image);
|
|
33203
33830
|
return cellGroup;
|
|
33204
33831
|
}
|
|
33205
|
-
function _adjustWidthHeight(col, row, width, height, scene, padding) {
|
|
33832
|
+
function _adjustWidthHeight(col, row, width, height, scene, padding, cellGroup) {
|
|
33206
33833
|
let needInvalidate = false;
|
|
33207
33834
|
let targetWidth = null;
|
|
33208
33835
|
let targetHeight = null;
|
|
33209
|
-
const cellGroup = scene.getCell(col, row, true);
|
|
33210
33836
|
const { width: cellWidth, height: cellHeight, isMerge } = getCellRange(cellGroup, scene.table);
|
|
33211
33837
|
if (cellWidth < width + padding[1] + padding[3]) {
|
|
33212
33838
|
targetWidth = width + padding[1] + padding[3];
|
|
@@ -33244,6 +33870,9 @@
|
|
|
33244
33870
|
}
|
|
33245
33871
|
function updateImageCellContentWhileResize(cellGroup, col, row, table) {
|
|
33246
33872
|
const image = cellGroup.getChildByName('image');
|
|
33873
|
+
if (!image) {
|
|
33874
|
+
return;
|
|
33875
|
+
}
|
|
33247
33876
|
const originImage = (typeof image.attribute.image !== 'string' && image.attribute.image) ||
|
|
33248
33877
|
image.resources?.get(image.attribute.image).data;
|
|
33249
33878
|
if (!originImage) {
|
|
@@ -33326,7 +33955,7 @@
|
|
|
33326
33955
|
const originImage = image.resources.get(image.attribute.image).data;
|
|
33327
33956
|
const { col, row } = cellGroup;
|
|
33328
33957
|
if (imageAutoSizing && !isDamagePic(image)) {
|
|
33329
|
-
_adjustWidthHeight(col, row, originImage.width, originImage.height, table.scenegraph, padding);
|
|
33958
|
+
_adjustWidthHeight(col, row, originImage.width, originImage.height, table.scenegraph, padding, cellGroup);
|
|
33330
33959
|
}
|
|
33331
33960
|
if (keepAspectRatio || isDamagePic(image)) {
|
|
33332
33961
|
const { width: cellWidth, height: cellHeight, isMerge } = getCellRange(cellGroup, table);
|
|
@@ -34794,7 +35423,7 @@
|
|
|
34794
35423
|
const video = document.createElement('video');
|
|
34795
35424
|
video.addEventListener('loadeddata', () => {
|
|
34796
35425
|
if (imageAutoSizing) {
|
|
34797
|
-
_adjustWidthHeight(col, row, video.videoWidth, video.videoHeight, table.scenegraph, padding);
|
|
35426
|
+
_adjustWidthHeight(col, row, video.videoWidth, video.videoHeight, table.scenegraph, padding, cellGroup);
|
|
34798
35427
|
}
|
|
34799
35428
|
const width = cellGroup.attribute.width;
|
|
34800
35429
|
const height = cellGroup.attribute.height;
|
|
@@ -35120,9 +35749,7 @@
|
|
|
35120
35749
|
}
|
|
35121
35750
|
else if (type === 'chart') {
|
|
35122
35751
|
const chartInstance = table.internalProps.layoutMap.getChartInstance(col, row);
|
|
35123
|
-
cellGroup = createChartCellGroup(null, columnGroup, 0, y, col, row, cellWidth, cellHeight, padding, value, define.chartModule, table.
|
|
35124
|
-
? table.internalProps.layoutMap.getChartSpec(col, row)
|
|
35125
|
-
: define.chartSpec, chartInstance, table.internalProps.layoutMap?.getChartDataId(col, row) ?? 'data', table, cellTheme);
|
|
35752
|
+
cellGroup = createChartCellGroup(null, columnGroup, 0, y, col, row, cellWidth, cellHeight, padding, value, define.chartModule, table.internalProps.layoutMap.getChartSpec(col, row), chartInstance, table.internalProps.layoutMap.getChartDataId(col, row) ?? 'data', table, cellTheme, table.internalProps.layoutMap.isShareChartSpec(col, row));
|
|
35126
35753
|
}
|
|
35127
35754
|
else if (type === 'progressbar') {
|
|
35128
35755
|
const style = table._getCellStyle(col, row);
|
|
@@ -35240,9 +35867,8 @@
|
|
|
35240
35867
|
dx: hierarchyOffset,
|
|
35241
35868
|
x
|
|
35242
35869
|
};
|
|
35243
|
-
const oldText = textMark.attribute.text;
|
|
35244
35870
|
textMark.setAttributes(cellTheme.text ? Object.assign({}, cellTheme.text, attribute) : attribute);
|
|
35245
|
-
if (
|
|
35871
|
+
if (textMark.attribute.text) {
|
|
35246
35872
|
const textBaseline = cellTheme.text.textBaseline;
|
|
35247
35873
|
const height = cellHeight - (padding[0] + padding[2]);
|
|
35248
35874
|
let y = 0;
|
|
@@ -35270,8 +35896,8 @@
|
|
|
35270
35896
|
: table.getBodyColumnType(col, row);
|
|
35271
35897
|
const mayHaveIcon = cellLocation !== 'body' ? true : !!define?.icon || !!define?.tree;
|
|
35272
35898
|
const padding = cellTheme._vtable.padding;
|
|
35273
|
-
const textAlign = cellTheme.
|
|
35274
|
-
const textBaseline = cellTheme.
|
|
35899
|
+
const textAlign = cellTheme.text.textAlign;
|
|
35900
|
+
const textBaseline = cellTheme.text.textBaseline;
|
|
35275
35901
|
let newCellGroup;
|
|
35276
35902
|
let bgColorFunc;
|
|
35277
35903
|
if (table.internalProps?.dataConfig?.mappingRules && !table.isHeader(col, row)) {
|
|
@@ -35301,13 +35927,11 @@
|
|
|
35301
35927
|
newCellGroup = updateCellContent(type, value, define, table, col, row, bgColorFunc, cellWidth, cellHeight, oldCellGroup, padding, textAlign, textBaseline, mayHaveIcon, addNew, cellTheme, range, customResult);
|
|
35302
35928
|
}
|
|
35303
35929
|
if (isMerge) {
|
|
35304
|
-
const rangeHeight = table.getRowHeight(row);
|
|
35305
|
-
const rangeWidth = table.getColWidth(col);
|
|
35306
35930
|
const { width: contentWidth } = newCellGroup.attribute;
|
|
35307
35931
|
const { height: contentHeight } = newCellGroup.attribute;
|
|
35308
35932
|
newCellGroup.contentWidth = contentWidth;
|
|
35309
35933
|
newCellGroup.contentHeight = contentHeight;
|
|
35310
|
-
|
|
35934
|
+
dealWithMergeCellSize(range, cellWidth, cellHeight, padding, textAlign, textBaseline, table);
|
|
35311
35935
|
}
|
|
35312
35936
|
return newCellGroup;
|
|
35313
35937
|
}
|
|
@@ -35346,6 +35970,24 @@
|
|
|
35346
35970
|
}
|
|
35347
35971
|
return false;
|
|
35348
35972
|
}
|
|
35973
|
+
function dealWithMergeCellSize(range, cellWidth, cellHeight, padding, textAlign, textBaseline, table) {
|
|
35974
|
+
for (let col = range.start.col; col <= range.end.col; col++) {
|
|
35975
|
+
for (let row = range.start.row; row <= range.end.row; row++) {
|
|
35976
|
+
const cellGroup = table.scenegraph.getCell(col, row, true);
|
|
35977
|
+
if (range.start.row !== range.end.row) {
|
|
35978
|
+
updateCellContentHeight(cellGroup, cellHeight, cellHeight, table.heightMode === 'autoHeight', padding, textAlign, textBaseline);
|
|
35979
|
+
}
|
|
35980
|
+
if (range.start.col !== range.end.col) {
|
|
35981
|
+
updateCellContentWidth(cellGroup, cellWidth, cellHeight, 0, table.heightMode === 'autoHeight', padding, textAlign, textBaseline, table.scenegraph);
|
|
35982
|
+
}
|
|
35983
|
+
cellGroup.contentWidth = cellWidth;
|
|
35984
|
+
cellGroup.contentHeight = cellHeight;
|
|
35985
|
+
const rangeHeight = table.getRowHeight(row);
|
|
35986
|
+
const rangeWidth = table.getColWidth(col);
|
|
35987
|
+
resizeCellGroup(cellGroup, rangeWidth, rangeHeight, range, table);
|
|
35988
|
+
}
|
|
35989
|
+
}
|
|
35990
|
+
}
|
|
35349
35991
|
|
|
35350
35992
|
function createComplexColumn(columnGroup, col, colWidth, rowStart, rowEnd, mergeMap, defaultRowHeight, table, cellLocation, rowLimit) {
|
|
35351
35993
|
let padding;
|
|
@@ -35374,7 +36016,8 @@
|
|
|
35374
36016
|
range = customMergeRange;
|
|
35375
36017
|
isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;
|
|
35376
36018
|
if (isMerge) {
|
|
35377
|
-
const
|
|
36019
|
+
const needUpdateRange = rowStart > range.start.row;
|
|
36020
|
+
const mergeSize = dealMerge(range, mergeMap, table, needUpdateRange);
|
|
35378
36021
|
cellWidth = mergeSize.cellWidth;
|
|
35379
36022
|
cellHeight = mergeSize.cellHeight;
|
|
35380
36023
|
}
|
|
@@ -35399,7 +36042,8 @@
|
|
|
35399
36042
|
range = table.getCellRange(col, row);
|
|
35400
36043
|
isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;
|
|
35401
36044
|
if (isMerge) {
|
|
35402
|
-
const
|
|
36045
|
+
const needUpdateRange = rowStart > range.start.row;
|
|
36046
|
+
const mergeSize = dealMerge(range, mergeMap, table, needUpdateRange);
|
|
35403
36047
|
cellWidth = mergeSize.cellWidth;
|
|
35404
36048
|
cellHeight = mergeSize.cellHeight;
|
|
35405
36049
|
}
|
|
@@ -35500,11 +36144,11 @@
|
|
|
35500
36144
|
heightChange
|
|
35501
36145
|
};
|
|
35502
36146
|
}
|
|
35503
|
-
function dealMerge(range, mergeMap, table) {
|
|
36147
|
+
function dealMerge(range, mergeMap, table, forceUpdate) {
|
|
35504
36148
|
let cellWidth = 0;
|
|
35505
36149
|
let cellHeight = 0;
|
|
35506
36150
|
const mergeResult = mergeMap.get(`${range.start.col},${range.start.row};${range.end.col},${range.end.row}`);
|
|
35507
|
-
if (!mergeResult) {
|
|
36151
|
+
if (!mergeResult || forceUpdate) {
|
|
35508
36152
|
for (let col = range.start.col; col <= range.end.col; col++) {
|
|
35509
36153
|
cellWidth += table.getColWidth(col);
|
|
35510
36154
|
}
|
|
@@ -38923,10 +39567,18 @@
|
|
|
38923
39567
|
rectAttributes.y = borderTop / 2;
|
|
38924
39568
|
rectAttributes.pickable = false;
|
|
38925
39569
|
if (isTableGroup) {
|
|
38926
|
-
|
|
38927
|
-
|
|
38928
|
-
|
|
38929
|
-
|
|
39570
|
+
if (frameTheme.innerBorder) {
|
|
39571
|
+
rectAttributes.x = group.attribute.x + borderLeft / 2;
|
|
39572
|
+
rectAttributes.y = group.attribute.y + borderTop / 2;
|
|
39573
|
+
rectAttributes.width = group.attribute.width - borderLeft / 2 - borderRight / 2;
|
|
39574
|
+
rectAttributes.height = group.attribute.height - borderTop / 2 - borderBottom / 2;
|
|
39575
|
+
}
|
|
39576
|
+
else {
|
|
39577
|
+
rectAttributes.x = group.attribute.x - borderLeft / 2;
|
|
39578
|
+
rectAttributes.y = group.attribute.y - borderTop / 2;
|
|
39579
|
+
rectAttributes.width = group.attribute.width + borderLeft / 2 + borderRight / 2;
|
|
39580
|
+
rectAttributes.height = group.attribute.height + borderTop / 2 + borderBottom / 2;
|
|
39581
|
+
}
|
|
38930
39582
|
let shadowRect;
|
|
38931
39583
|
let borderRect;
|
|
38932
39584
|
if (hasShadow) {
|
|
@@ -38956,7 +39608,12 @@
|
|
|
38956
39608
|
borderRect = createRect(rectAttributes);
|
|
38957
39609
|
borderRect.name = 'table-border-rect';
|
|
38958
39610
|
}
|
|
38959
|
-
|
|
39611
|
+
if (frameTheme.innerBorder && !hasShadow) {
|
|
39612
|
+
group.parent.insertAfter(borderRect, group);
|
|
39613
|
+
}
|
|
39614
|
+
else {
|
|
39615
|
+
group.parent.insertBefore(borderRect, group);
|
|
39616
|
+
}
|
|
38960
39617
|
group.border = borderRect;
|
|
38961
39618
|
}
|
|
38962
39619
|
else {
|
|
@@ -39205,6 +39862,11 @@
|
|
|
39205
39862
|
const { viewWidth, viewHeight } = stage;
|
|
39206
39863
|
if (viewWidth < cacheCanvasSizeLimit && viewHeight < cacheCanvasSizeLimit) {
|
|
39207
39864
|
chart.cacheCanvas = stage.toCanvas();
|
|
39865
|
+
if (!chart.isShareChartSpec) {
|
|
39866
|
+
chart.chartInstance?.release();
|
|
39867
|
+
chart.chartInstance = null;
|
|
39868
|
+
chart.setAttribute('chartInstance', null);
|
|
39869
|
+
}
|
|
39208
39870
|
return;
|
|
39209
39871
|
}
|
|
39210
39872
|
const rows = Math.ceil(viewHeight / cacheCanvasSizeLimit);
|
|
@@ -39242,7 +39904,7 @@
|
|
|
39242
39904
|
const { dataId, data, spec } = chart.attribute;
|
|
39243
39905
|
chart.getViewBox();
|
|
39244
39906
|
const { width = groupAttribute.width, height = groupAttribute.height } = chart.attribute;
|
|
39245
|
-
const {
|
|
39907
|
+
const { active, cacheCanvas, activeChartInstance } = chart;
|
|
39246
39908
|
if (!active && cacheCanvas) {
|
|
39247
39909
|
if (isArray$1(cacheCanvas)) {
|
|
39248
39910
|
cacheCanvas.forEach(singleCacheCanvas => {
|
|
@@ -39272,7 +39934,7 @@
|
|
|
39272
39934
|
: data ?? [],
|
|
39273
39935
|
fields: series?.data?.fields
|
|
39274
39936
|
});
|
|
39275
|
-
if (!
|
|
39937
|
+
if (!activeChartInstance.updateFullDataSync) {
|
|
39276
39938
|
activeChartInstance.updateDataSync(dataIdStr, dataIdAndField
|
|
39277
39939
|
? data?.filter((item) => {
|
|
39278
39940
|
return item.hasOwnProperty(dataIdAndField);
|
|
@@ -39426,10 +40088,20 @@
|
|
|
39426
40088
|
hoverMode = 'cellBgColor';
|
|
39427
40089
|
}
|
|
39428
40090
|
else if (highlightScope === HighlightScope.column && cellPos.col === col) {
|
|
39429
|
-
|
|
40091
|
+
if (cellPos.col === col && cellPos.row === row) {
|
|
40092
|
+
hoverMode = 'cellBgColor';
|
|
40093
|
+
}
|
|
40094
|
+
else {
|
|
40095
|
+
hoverMode = 'inlineColumnBgColor';
|
|
40096
|
+
}
|
|
39430
40097
|
}
|
|
39431
40098
|
else if (highlightScope === HighlightScope.row && cellPos.row === row) {
|
|
39432
|
-
|
|
40099
|
+
if (cellPos.col === col && cellPos.row === row) {
|
|
40100
|
+
hoverMode = 'cellBgColor';
|
|
40101
|
+
}
|
|
40102
|
+
else {
|
|
40103
|
+
hoverMode = 'inlineRowBgColor';
|
|
40104
|
+
}
|
|
39433
40105
|
}
|
|
39434
40106
|
else if (highlightScope === HighlightScope.cross) {
|
|
39435
40107
|
if (cellPos.col === col && cellPos.row === row) {
|
|
@@ -41223,7 +41895,12 @@
|
|
|
41223
41895
|
syncTopRow = Math.max(proxy.bodyTopRow, proxy.screenTopRow - proxy.screenRowCount * 1);
|
|
41224
41896
|
syncBottomRow = Math.min(proxy.bodyBottomRow, proxy.screenTopRow + proxy.screenRowCount * 2);
|
|
41225
41897
|
}
|
|
41898
|
+
const oldBodyHeight = proxy.table.getAllRowsHeight();
|
|
41226
41899
|
computeRowsHeight(proxy.table, syncTopRow, syncBottomRow);
|
|
41900
|
+
const newBodyHeight = proxy.table.getAllRowsHeight();
|
|
41901
|
+
if (oldBodyHeight !== newBodyHeight) {
|
|
41902
|
+
proxy.table.scenegraph.updateContainerHeight(proxy.table.frozenRowCount, newBodyHeight - oldBodyHeight);
|
|
41903
|
+
}
|
|
41227
41904
|
updateRowContent(syncTopRow, syncBottomRow, proxy);
|
|
41228
41905
|
if (proxy.table.heightMode === 'autoHeight') {
|
|
41229
41906
|
updateAutoRow(proxy.bodyLeftCol, proxy.bodyRightCol, syncTopRow, syncBottomRow, proxy.table, proxy.rowEnd > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up');
|
|
@@ -44222,7 +44899,7 @@
|
|
|
44222
44899
|
initSceneGraph(this);
|
|
44223
44900
|
}
|
|
44224
44901
|
clearCells() {
|
|
44225
|
-
if (this.table.isPivotChart() || this.table.
|
|
44902
|
+
if (this.table.isPivotChart() || this.table._hasCustomRenderOrLayout()) {
|
|
44226
44903
|
this.stage.pluginService.findPluginsByName('poptipForText').forEach(plugin => {
|
|
44227
44904
|
plugin.deactivate(this.stage.pluginService);
|
|
44228
44905
|
});
|
|
@@ -44322,7 +44999,7 @@
|
|
|
44322
44999
|
this.component.updateStyle();
|
|
44323
45000
|
}
|
|
44324
45001
|
createSceneGraph() {
|
|
44325
|
-
if (this.table.isPivotChart() || this.table.
|
|
45002
|
+
if (this.table.isPivotChart() || this.table._hasCustomRenderOrLayout()) {
|
|
44326
45003
|
this.stage.pluginService.autoEnablePlugins.getContributions().forEach((p) => {
|
|
44327
45004
|
if (p.name === 'poptipForText') {
|
|
44328
45005
|
this.stage.pluginService.register(p);
|
|
@@ -44661,26 +45338,52 @@
|
|
|
44661
45338
|
Math.max(this.leftBottomCornerGroup.attribute.height, this.bottomFrozenGroup.attribute.height, this.rightBottomCornerGroup.attribute.height, 0))
|
|
44662
45339
|
});
|
|
44663
45340
|
if (this.tableGroup.border && this.tableGroup.border.type === 'rect') {
|
|
44664
|
-
this.
|
|
44665
|
-
|
|
44666
|
-
|
|
44667
|
-
|
|
44668
|
-
|
|
44669
|
-
|
|
45341
|
+
if (this.table.theme.frameStyle?.innerBorder) {
|
|
45342
|
+
this.tableGroup.border.setAttributes({
|
|
45343
|
+
x: this.table.tableX + this.tableGroup.border.attribute.lineWidth / 2,
|
|
45344
|
+
y: this.table.tableY + this.tableGroup.border.attribute.lineWidth / 2,
|
|
45345
|
+
width: this.tableGroup.attribute.width - this.tableGroup.border.attribute.lineWidth,
|
|
45346
|
+
height: this.tableGroup.attribute.height - this.tableGroup.border.attribute.lineWidth
|
|
45347
|
+
});
|
|
45348
|
+
}
|
|
45349
|
+
else {
|
|
45350
|
+
this.tableGroup.border.setAttributes({
|
|
45351
|
+
x: this.table.tableX - this.tableGroup.border.attribute.lineWidth / 2,
|
|
45352
|
+
y: this.table.tableY - this.tableGroup.border.attribute.lineWidth / 2,
|
|
45353
|
+
width: this.tableGroup.attribute.width + this.tableGroup.border.attribute.lineWidth,
|
|
45354
|
+
height: this.tableGroup.attribute.height + this.tableGroup.border.attribute.lineWidth
|
|
45355
|
+
});
|
|
45356
|
+
}
|
|
44670
45357
|
}
|
|
44671
45358
|
else if (this.tableGroup.border && this.tableGroup.border.type === 'group') {
|
|
44672
|
-
this.
|
|
44673
|
-
|
|
44674
|
-
|
|
44675
|
-
|
|
44676
|
-
|
|
44677
|
-
|
|
44678
|
-
|
|
44679
|
-
|
|
44680
|
-
|
|
44681
|
-
|
|
44682
|
-
|
|
44683
|
-
|
|
45359
|
+
if (this.table.theme.frameStyle?.innerBorder) {
|
|
45360
|
+
this.tableGroup.border.setAttributes({
|
|
45361
|
+
x: this.table.tableX + this.tableGroup.border.attribute.lineWidth / 2,
|
|
45362
|
+
y: this.table.tableY + this.tableGroup.border.attribute.lineWidth / 2,
|
|
45363
|
+
width: this.tableGroup.attribute.width - this.tableGroup.border.attribute.lineWidth,
|
|
45364
|
+
height: this.tableGroup.attribute.height - this.tableGroup.border.attribute.lineWidth
|
|
45365
|
+
});
|
|
45366
|
+
this.tableGroup.border.firstChild?.setAttributes({
|
|
45367
|
+
x: 0,
|
|
45368
|
+
y: 0,
|
|
45369
|
+
width: this.tableGroup.attribute.width - this.tableGroup.border.attribute.lineWidth,
|
|
45370
|
+
height: this.tableGroup.attribute.height - this.tableGroup.border.attribute.lineWidth
|
|
45371
|
+
});
|
|
45372
|
+
}
|
|
45373
|
+
else {
|
|
45374
|
+
this.tableGroup.border.setAttributes({
|
|
45375
|
+
x: this.table.tableX - this.tableGroup.border.attribute.lineWidth / 2,
|
|
45376
|
+
y: this.table.tableY - this.tableGroup.border.attribute.lineWidth / 2,
|
|
45377
|
+
width: this.tableGroup.attribute.width + this.tableGroup.border.attribute.lineWidth,
|
|
45378
|
+
height: this.tableGroup.attribute.height + this.tableGroup.border.attribute.lineWidth
|
|
45379
|
+
});
|
|
45380
|
+
this.tableGroup.border.firstChild?.setAttributes({
|
|
45381
|
+
x: this.tableGroup.border.attribute.lineWidth / 2,
|
|
45382
|
+
y: this.tableGroup.border.attribute.lineWidth / 2,
|
|
45383
|
+
width: this.tableGroup.attribute.width,
|
|
45384
|
+
height: this.tableGroup.attribute.height
|
|
45385
|
+
});
|
|
45386
|
+
}
|
|
44684
45387
|
}
|
|
44685
45388
|
if (this.table.bottomFrozenRowCount > 0) {
|
|
44686
45389
|
this.bottomFrozenGroup.setAttribute('y', this.tableGroup.attribute.height - this.bottomFrozenGroup.attribute.height);
|
|
@@ -45036,11 +45739,7 @@
|
|
|
45036
45739
|
updateContainer() {
|
|
45037
45740
|
this.updateContainerAttrWidthAndX();
|
|
45038
45741
|
this.updateTableSize();
|
|
45039
|
-
const oldHorizontalBarPos = this.table.stateManager.scroll.horizontalBarPos;
|
|
45040
|
-
const oldVerticalBarPos = this.table.stateManager.scroll.verticalBarPos;
|
|
45041
45742
|
this.component.updateScrollBar();
|
|
45042
|
-
this.table.stateManager.setScrollLeft(oldHorizontalBarPos);
|
|
45043
|
-
this.table.stateManager.setScrollTop(oldVerticalBarPos);
|
|
45044
45743
|
this.updateNextFrame();
|
|
45045
45744
|
}
|
|
45046
45745
|
updateCellContentWhileResize(col, row) {
|
|
@@ -45488,7 +46187,6 @@
|
|
|
45488
46187
|
}
|
|
45489
46188
|
else if (headerC?.sort) {
|
|
45490
46189
|
tableState = {
|
|
45491
|
-
fieldKey: table.getHeaderFieldKey(col, row),
|
|
45492
46190
|
field: table.getHeaderField(col, row),
|
|
45493
46191
|
order: 'asc'
|
|
45494
46192
|
};
|
|
@@ -45496,7 +46194,6 @@
|
|
|
45496
46194
|
else if (isTargetCell && headerC?.showSort) ;
|
|
45497
46195
|
else {
|
|
45498
46196
|
tableState = {
|
|
45499
|
-
fieldKey: table.getHeaderFieldKey(col, row),
|
|
45500
46197
|
field: table.getHeaderField(col, row),
|
|
45501
46198
|
order: 'normal'
|
|
45502
46199
|
};
|
|
@@ -45515,13 +46212,7 @@
|
|
|
45515
46212
|
table.stateManager.updateSelectPos(-1, -1);
|
|
45516
46213
|
}
|
|
45517
46214
|
function executeSort(newState, table, headerDefine) {
|
|
45518
|
-
|
|
45519
|
-
if (newState.fieldKey) {
|
|
45520
|
-
hd = table.internalProps.layoutMap.headerObjects.find((col) => col && col.fieldKey === newState.fieldKey);
|
|
45521
|
-
}
|
|
45522
|
-
else {
|
|
45523
|
-
hd = table.internalProps.layoutMap.headerObjects.find((col) => col && col.field === newState.field);
|
|
45524
|
-
}
|
|
46215
|
+
const hd = table.internalProps.layoutMap.headerObjects.find((col) => col && col.field === newState.field);
|
|
45525
46216
|
if (!hd) {
|
|
45526
46217
|
return;
|
|
45527
46218
|
}
|
|
@@ -46410,7 +47101,6 @@
|
|
|
46410
47101
|
}
|
|
46411
47102
|
setSortState(sortState) {
|
|
46412
47103
|
this.sort.field = sortState?.field;
|
|
46413
|
-
this.sort.fieldKey = sortState?.fieldKey;
|
|
46414
47104
|
this.sort.order = sortState?.order;
|
|
46415
47105
|
}
|
|
46416
47106
|
setFrozenState() {
|
|
@@ -46764,7 +47454,15 @@
|
|
|
46764
47454
|
this.menu.dropDownMenuHighlight = cells;
|
|
46765
47455
|
for (let i = 0; i < cells.length; i++) {
|
|
46766
47456
|
const { col, row } = cells[i];
|
|
46767
|
-
this.table.
|
|
47457
|
+
const range = this.table.getCellRange(col, row);
|
|
47458
|
+
if (!range) {
|
|
47459
|
+
continue;
|
|
47460
|
+
}
|
|
47461
|
+
for (let col = range.start.col; col <= range.end.col; col++) {
|
|
47462
|
+
for (let row = range.start.row; row <= range.end.row; row++) {
|
|
47463
|
+
this.table.scenegraph.updateCellContent(col, row);
|
|
47464
|
+
}
|
|
47465
|
+
}
|
|
46768
47466
|
}
|
|
46769
47467
|
}
|
|
46770
47468
|
dropDownMenuIsHighlight(colNow, rowNow, index) {
|
|
@@ -47195,7 +47893,7 @@
|
|
|
47195
47893
|
else {
|
|
47196
47894
|
const layoutMap = table.internalProps.layoutMap;
|
|
47197
47895
|
hasSparkLine = layoutMap.columnObjects.some(column => {
|
|
47198
|
-
return column.cellType === 'sparkline';
|
|
47896
|
+
return column.cellType === 'sparkline' || typeof column.cellType === 'function';
|
|
47199
47897
|
});
|
|
47200
47898
|
}
|
|
47201
47899
|
if (!hasSparkLine) {
|
|
@@ -47311,10 +48009,10 @@
|
|
|
47311
48009
|
}
|
|
47312
48010
|
const cellGoup = e.path.find(node => node.role === 'cell');
|
|
47313
48011
|
if (table.hasListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL)) {
|
|
47314
|
-
if (
|
|
47315
|
-
table.stateManager.hover.cellPos.col !== -1 &&
|
|
48012
|
+
if (table.stateManager.hover.cellPos.col !== -1 &&
|
|
47316
48013
|
table.stateManager.hover.cellPos.row !== -1 &&
|
|
47317
|
-
(cellGoup
|
|
48014
|
+
(cellGoup?.col !== table.stateManager.hover.cellPos.col ||
|
|
48015
|
+
cellGoup?.row !== table.stateManager.hover.cellPos.row)) {
|
|
47318
48016
|
table.fireListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL, {
|
|
47319
48017
|
col: table.stateManager.hover.cellPos.col,
|
|
47320
48018
|
row: table.stateManager.hover.cellPos.row,
|
|
@@ -47416,6 +48114,21 @@
|
|
|
47416
48114
|
stateManager.updateInteractionState(InteractionState.default);
|
|
47417
48115
|
stateManager.updateCursor();
|
|
47418
48116
|
}
|
|
48117
|
+
if (table.hasListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL)) {
|
|
48118
|
+
if (table.stateManager.hover.cellPos.col !== -1 && table.stateManager.hover.cellPos.row !== -1) {
|
|
48119
|
+
table.fireListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL, {
|
|
48120
|
+
col: table.stateManager.hover.cellPos.col,
|
|
48121
|
+
row: table.stateManager.hover.cellPos.row,
|
|
48122
|
+
cellRange: table.getCellRangeRelativeRect({
|
|
48123
|
+
col: table.stateManager.hover.cellPos.col,
|
|
48124
|
+
row: table.stateManager.hover.cellPos.row
|
|
48125
|
+
}),
|
|
48126
|
+
scaleRatio: table.canvas.getBoundingClientRect().width / table.canvas.offsetWidth,
|
|
48127
|
+
event: e.nativeEvent,
|
|
48128
|
+
target: undefined
|
|
48129
|
+
});
|
|
48130
|
+
}
|
|
48131
|
+
}
|
|
47419
48132
|
eventManager.dealTableHover();
|
|
47420
48133
|
const target = e.target;
|
|
47421
48134
|
if (target && !target.isDescendantsOf(table.scenegraph.tableGroup)) {
|
|
@@ -47745,15 +48458,15 @@
|
|
|
47745
48458
|
};
|
|
47746
48459
|
if (table.isHeader(col, row)) {
|
|
47747
48460
|
table.stateManager.setHeaderCheckedState(cellInfo.field, e.detail.checked);
|
|
47748
|
-
const
|
|
47749
|
-
if (
|
|
48461
|
+
const cellType = table.getCellType(col, row);
|
|
48462
|
+
if (cellType === 'checkbox') {
|
|
47750
48463
|
table.scenegraph.updateCheckboxCellState(col, row, e.detail.checked);
|
|
47751
48464
|
}
|
|
47752
48465
|
}
|
|
47753
48466
|
else {
|
|
47754
48467
|
table.stateManager.setCheckedState(col, row, cellInfo.field, e.detail.checked);
|
|
47755
|
-
const
|
|
47756
|
-
if (
|
|
48468
|
+
const cellType = table.getCellType(col, row);
|
|
48469
|
+
if (cellType === 'checkbox') {
|
|
47757
48470
|
const oldHeaderCheckedState = table.stateManager.headerCheckedState[cellInfo.field];
|
|
47758
48471
|
const newHeaderCheckedState = table.stateManager.updateHeaderCheckedState(cellInfo.field);
|
|
47759
48472
|
if (oldHeaderCheckedState !== newHeaderCheckedState) {
|
|
@@ -48930,6 +49643,7 @@
|
|
|
48930
49643
|
case 'checkbox':
|
|
48931
49644
|
return CheckboxStyle$1;
|
|
48932
49645
|
}
|
|
49646
|
+
return TextStyle;
|
|
48933
49647
|
}
|
|
48934
49648
|
getCellIconFromRecordValue(icon, col, row) {
|
|
48935
49649
|
if (Array.isArray(icon)) {
|
|
@@ -51494,6 +52208,7 @@
|
|
|
51494
52208
|
return this.data.size;
|
|
51495
52209
|
}
|
|
51496
52210
|
clear() {
|
|
52211
|
+
this._keys = [];
|
|
51497
52212
|
this.data.clear();
|
|
51498
52213
|
this.cumulativeSum.clear();
|
|
51499
52214
|
this.difference.clear();
|
|
@@ -51738,7 +52453,7 @@
|
|
|
51738
52453
|
return TABLE_EVENT_TYPE;
|
|
51739
52454
|
}
|
|
51740
52455
|
options;
|
|
51741
|
-
version = "0.
|
|
52456
|
+
version = "0.20.0";
|
|
51742
52457
|
pagination;
|
|
51743
52458
|
id = `VTable${Date.now()}`;
|
|
51744
52459
|
headerStyleCache;
|
|
@@ -52151,12 +52866,20 @@
|
|
|
52151
52866
|
if (this.internalProps.theme?.frameStyle) {
|
|
52152
52867
|
const lineWidths = toBoxArray(this.internalProps.theme.frameStyle?.borderLineWidth ?? [null]);
|
|
52153
52868
|
const shadowWidths = toBoxArray(this.internalProps.theme.frameStyle?.shadowBlur ?? [0]);
|
|
52154
|
-
this.
|
|
52155
|
-
|
|
52156
|
-
|
|
52157
|
-
width - (
|
|
52158
|
-
|
|
52159
|
-
|
|
52869
|
+
if (this.theme.frameStyle?.innerBorder) {
|
|
52870
|
+
this.tableX = 0;
|
|
52871
|
+
this.tableY = 0;
|
|
52872
|
+
this.tableNoFrameWidth = width - (shadowWidths[1] ?? 0);
|
|
52873
|
+
this.tableNoFrameHeight = height - (shadowWidths[2] ?? 0);
|
|
52874
|
+
}
|
|
52875
|
+
else {
|
|
52876
|
+
this.tableX = (lineWidths[3] ?? 0) + (shadowWidths[3] ?? 0);
|
|
52877
|
+
this.tableY = (lineWidths[0] ?? 0) + (shadowWidths[0] ?? 0);
|
|
52878
|
+
this.tableNoFrameWidth =
|
|
52879
|
+
width - ((lineWidths[1] ?? 0) + (shadowWidths[1] ?? 0)) - ((lineWidths[3] ?? 0) + (shadowWidths[3] ?? 0));
|
|
52880
|
+
this.tableNoFrameHeight =
|
|
52881
|
+
height - ((lineWidths[0] ?? 0) + (shadowWidths[0] ?? 0)) - ((lineWidths[2] ?? 0) + (shadowWidths[2] ?? 0));
|
|
52882
|
+
}
|
|
52160
52883
|
}
|
|
52161
52884
|
}
|
|
52162
52885
|
get rowHierarchyType() {
|
|
@@ -53130,6 +53853,9 @@
|
|
|
53130
53853
|
this.setScrollTop(scrollTop);
|
|
53131
53854
|
this.setScrollLeft(scrollLeft);
|
|
53132
53855
|
}
|
|
53856
|
+
get recordsCount() {
|
|
53857
|
+
return this.records?.length;
|
|
53858
|
+
}
|
|
53133
53859
|
get allowFrozenColCount() {
|
|
53134
53860
|
return this.internalProps.allowFrozenColCount;
|
|
53135
53861
|
}
|
|
@@ -53213,9 +53939,6 @@
|
|
|
53213
53939
|
getHeaderField(col, row) {
|
|
53214
53940
|
return this.internalProps.layoutMap.getHeaderField(col, row);
|
|
53215
53941
|
}
|
|
53216
|
-
getHeaderFieldKey(col, row) {
|
|
53217
|
-
return this.internalProps.layoutMap.getHeaderFieldKey(col, row);
|
|
53218
|
-
}
|
|
53219
53942
|
getHeaderDefine(col, row) {
|
|
53220
53943
|
const hd = this.internalProps.layoutMap.getHeader(col, row);
|
|
53221
53944
|
return hd?.define;
|
|
@@ -53265,13 +53988,7 @@
|
|
|
53265
53988
|
}
|
|
53266
53989
|
_getHeaderCellBySortState(sortState) {
|
|
53267
53990
|
const { layoutMap } = this.internalProps;
|
|
53268
|
-
|
|
53269
|
-
if (sortState.fieldKey) {
|
|
53270
|
-
hd = layoutMap.headerObjects.find((col) => col && col.fieldKey === sortState.fieldKey);
|
|
53271
|
-
}
|
|
53272
|
-
else {
|
|
53273
|
-
hd = layoutMap.headerObjects.find((col) => col && col.field === sortState.field);
|
|
53274
|
-
}
|
|
53991
|
+
const hd = layoutMap.headerObjects.find((col) => col && col.field === sortState.field);
|
|
53275
53992
|
if (hd) {
|
|
53276
53993
|
const headercell = layoutMap.getHeaderCellAdressById(hd.id);
|
|
53277
53994
|
return headercell;
|
|
@@ -53285,7 +54002,7 @@
|
|
|
53285
54002
|
return customMerge.range;
|
|
53286
54003
|
}
|
|
53287
54004
|
}
|
|
53288
|
-
return this.internalProps.layoutMap
|
|
54005
|
+
return this.internalProps.layoutMap?.getCellRange(col, row);
|
|
53289
54006
|
}
|
|
53290
54007
|
hasCustomMerge() {
|
|
53291
54008
|
return !!this.internalProps.customMergeCell;
|
|
@@ -53378,7 +54095,7 @@
|
|
|
53378
54095
|
field: this.getHeaderField(col, row),
|
|
53379
54096
|
cellHeaderPaths: this.internalProps.layoutMap.getCellHeaderPaths(col, row),
|
|
53380
54097
|
title: colDef?.title,
|
|
53381
|
-
cellType:
|
|
54098
|
+
cellType: this.getCellType(col, row),
|
|
53382
54099
|
originData: this.getCellOriginRecord(col, row),
|
|
53383
54100
|
cellRange: this.getCellRangeRelativeRect({ col, row }),
|
|
53384
54101
|
value: this.getCellValue(col, row),
|
|
@@ -53495,12 +54212,13 @@
|
|
|
53495
54212
|
return cacheStyle;
|
|
53496
54213
|
}
|
|
53497
54214
|
let cacheKey;
|
|
54215
|
+
const cellType = this.getCellType(col, row);
|
|
53498
54216
|
if ((this.isListTable() && !this.transpose) ||
|
|
53499
54217
|
(this.isPivotTable() && this.internalProps.layoutMap.indicatorsAsCol)) {
|
|
53500
|
-
cacheKey = col;
|
|
54218
|
+
cacheKey = col + cellType;
|
|
53501
54219
|
}
|
|
53502
54220
|
else {
|
|
53503
|
-
cacheKey = row;
|
|
54221
|
+
cacheKey = row + cellType;
|
|
53504
54222
|
}
|
|
53505
54223
|
let cacheStyle;
|
|
53506
54224
|
if (layoutMap.isBottomFrozenRow(row)) {
|
|
@@ -53513,7 +54231,7 @@
|
|
|
53513
54231
|
return cacheStyle;
|
|
53514
54232
|
}
|
|
53515
54233
|
const column = layoutMap.getBody(col, row);
|
|
53516
|
-
const styleClass = this.internalProps.bodyHelper.getStyleClass(
|
|
54234
|
+
const styleClass = this.internalProps.bodyHelper.getStyleClass(this.getCellType(col, row));
|
|
53517
54235
|
const style = column?.style;
|
|
53518
54236
|
cacheStyle = of$2(style, layoutMap.isBottomFrozenRow(row) && this.theme.bottomFrozenStyle
|
|
53519
54237
|
? this.theme.bottomFrozenStyle
|
|
@@ -54248,8 +54966,36 @@
|
|
|
54248
54966
|
indicatorObj = layout.columnObjects.find(indicator => indicator.indicatorKey === indicatorKey);
|
|
54249
54967
|
}
|
|
54250
54968
|
const chartSpec = indicatorObj?.chartSpec;
|
|
54969
|
+
if (typeof chartSpec === 'function') {
|
|
54970
|
+
const arg = {
|
|
54971
|
+
col,
|
|
54972
|
+
row,
|
|
54973
|
+
dataValue: layout._table.getCellOriginValue(col, row) || '',
|
|
54974
|
+
value: layout._table.getCellValue(col, row) || '',
|
|
54975
|
+
rect: layout._table.getCellRangeRelativeRect(layout._table.getCellRange(col, row)),
|
|
54976
|
+
table: layout._table
|
|
54977
|
+
};
|
|
54978
|
+
return chartSpec(arg);
|
|
54979
|
+
}
|
|
54251
54980
|
return chartSpec;
|
|
54252
54981
|
}
|
|
54982
|
+
function isShareChartSpec(col, row, layout) {
|
|
54983
|
+
const paths = layout.getCellHeaderPaths(col, row);
|
|
54984
|
+
let indicatorObj;
|
|
54985
|
+
if (layout.indicatorsAsCol) {
|
|
54986
|
+
const indicatorKey = paths.colHeaderPaths.find(colPath => colPath.indicatorKey)?.indicatorKey;
|
|
54987
|
+
indicatorObj = layout.columnObjects.find(indicator => indicator.indicatorKey === indicatorKey);
|
|
54988
|
+
}
|
|
54989
|
+
else {
|
|
54990
|
+
const indicatorKey = paths.rowHeaderPaths.find(rowPath => rowPath.indicatorKey)?.indicatorKey;
|
|
54991
|
+
indicatorObj = layout.columnObjects.find(indicator => indicator.indicatorKey === indicatorKey);
|
|
54992
|
+
}
|
|
54993
|
+
const chartSpec = indicatorObj?.chartSpec;
|
|
54994
|
+
if (typeof chartSpec === 'function') {
|
|
54995
|
+
return false;
|
|
54996
|
+
}
|
|
54997
|
+
return true;
|
|
54998
|
+
}
|
|
54253
54999
|
function checkHasCartesianChart(layout) {
|
|
54254
55000
|
let isHasCartesianChart = false;
|
|
54255
55001
|
for (let i = 0; i < layout.indicatorsDefine.length; i++) {
|
|
@@ -54309,16 +55055,19 @@
|
|
|
54309
55055
|
function getChartSpec(col, row, layout) {
|
|
54310
55056
|
let chartSpec = layout.getRawChartSpec(col, row);
|
|
54311
55057
|
if (chartSpec) {
|
|
54312
|
-
|
|
54313
|
-
|
|
54314
|
-
|
|
54315
|
-
chartSpec.series
|
|
54316
|
-
serie
|
|
54317
|
-
|
|
55058
|
+
if (layout._table.isPivotChart()) {
|
|
55059
|
+
chartSpec = cloneDeep(chartSpec);
|
|
55060
|
+
chartSpec.sortDataByAxis = true;
|
|
55061
|
+
if (isArray$1(chartSpec.series)) {
|
|
55062
|
+
chartSpec.series.forEach((serie) => {
|
|
55063
|
+
serie.sortDataByAxis = true;
|
|
55064
|
+
});
|
|
55065
|
+
}
|
|
55066
|
+
chartSpec.axes = layout.getChartAxes(col, row);
|
|
55067
|
+
chartSpec.padding = 0;
|
|
55068
|
+
chartSpec.dataZoom = [];
|
|
55069
|
+
return chartSpec;
|
|
54318
55070
|
}
|
|
54319
|
-
chartSpec.axes = layout.getChartAxes(col, row);
|
|
54320
|
-
chartSpec.padding = 0;
|
|
54321
|
-
chartSpec.dataZoom = [];
|
|
54322
55071
|
return chartSpec;
|
|
54323
55072
|
}
|
|
54324
55073
|
return null;
|
|
@@ -54504,6 +55253,49 @@
|
|
|
54504
55253
|
return isHasChart;
|
|
54505
55254
|
}
|
|
54506
55255
|
|
|
55256
|
+
function checkHasAggregation(layoutMap) {
|
|
55257
|
+
const columnObjects = layoutMap.columnObjects;
|
|
55258
|
+
for (let i = 0; i < columnObjects.length; i++) {
|
|
55259
|
+
const column = columnObjects[i];
|
|
55260
|
+
if (column?.aggregation) {
|
|
55261
|
+
return true;
|
|
55262
|
+
}
|
|
55263
|
+
}
|
|
55264
|
+
return false;
|
|
55265
|
+
}
|
|
55266
|
+
function checkHasAggregationOnTop(layoutMap) {
|
|
55267
|
+
const columnObjects = layoutMap.columnObjects;
|
|
55268
|
+
let count = 0;
|
|
55269
|
+
for (let i = 0; i < columnObjects.length; i++) {
|
|
55270
|
+
const column = columnObjects[i];
|
|
55271
|
+
if (column?.aggregation) {
|
|
55272
|
+
if (Array.isArray(column?.aggregation)) {
|
|
55273
|
+
count = Math.max(count, column.aggregation.filter(item => item.showOnTop === true).length);
|
|
55274
|
+
}
|
|
55275
|
+
else if (column.aggregation.showOnTop === true) {
|
|
55276
|
+
count = Math.max(count, 1);
|
|
55277
|
+
}
|
|
55278
|
+
}
|
|
55279
|
+
}
|
|
55280
|
+
return count;
|
|
55281
|
+
}
|
|
55282
|
+
function checkHasAggregationOnBottom(layoutMap) {
|
|
55283
|
+
const columnObjects = layoutMap.columnObjects;
|
|
55284
|
+
let count = 0;
|
|
55285
|
+
for (let i = 0; i < columnObjects.length; i++) {
|
|
55286
|
+
const column = columnObjects[i];
|
|
55287
|
+
if (column?.aggregation) {
|
|
55288
|
+
if (Array.isArray(column?.aggregation)) {
|
|
55289
|
+
count = Math.max(count, column.aggregation.filter(item => item.showOnTop === false).length);
|
|
55290
|
+
}
|
|
55291
|
+
else if (column.aggregation.showOnTop === false) {
|
|
55292
|
+
count = Math.max(count, 1);
|
|
55293
|
+
}
|
|
55294
|
+
}
|
|
55295
|
+
}
|
|
55296
|
+
return count;
|
|
55297
|
+
}
|
|
55298
|
+
|
|
54507
55299
|
class DimensionTree {
|
|
54508
55300
|
sharedVar;
|
|
54509
55301
|
sizeIncludeParent = false;
|
|
@@ -54929,6 +55721,9 @@
|
|
|
54929
55721
|
_showHeader = true;
|
|
54930
55722
|
_recordsCount = 0;
|
|
54931
55723
|
_table;
|
|
55724
|
+
_hasAggregation = false;
|
|
55725
|
+
_hasAggregationOnTopCount = 0;
|
|
55726
|
+
_hasAggregationOnBottomCount = 0;
|
|
54932
55727
|
_cellRangeMap;
|
|
54933
55728
|
constructor(table, columns, showHeader, hierarchyIndent) {
|
|
54934
55729
|
this._cellRangeMap = new Map();
|
|
@@ -54943,6 +55738,9 @@
|
|
|
54943
55738
|
o[e.id] = e;
|
|
54944
55739
|
return o;
|
|
54945
55740
|
}, {});
|
|
55741
|
+
this._hasAggregation = checkHasAggregation(this);
|
|
55742
|
+
this._hasAggregationOnBottomCount = checkHasAggregationOnBottom(this);
|
|
55743
|
+
this._hasAggregationOnTopCount = checkHasAggregationOnTop(this);
|
|
54946
55744
|
}
|
|
54947
55745
|
get transpose() {
|
|
54948
55746
|
return this._transpose;
|
|
@@ -54965,6 +55763,153 @@
|
|
|
54965
55763
|
}
|
|
54966
55764
|
return false;
|
|
54967
55765
|
}
|
|
55766
|
+
isAggregation(col, row) {
|
|
55767
|
+
if (this.hasAggregation) {
|
|
55768
|
+
if (this.hasAggregationOnBottomCount) {
|
|
55769
|
+
if (this.transpose) {
|
|
55770
|
+
if (col >= this.colCount - this.hasAggregationOnBottomCount) {
|
|
55771
|
+
return true;
|
|
55772
|
+
}
|
|
55773
|
+
}
|
|
55774
|
+
else {
|
|
55775
|
+
if (row >= this.rowCount - this.hasAggregationOnBottomCount) {
|
|
55776
|
+
return true;
|
|
55777
|
+
}
|
|
55778
|
+
}
|
|
55779
|
+
}
|
|
55780
|
+
if (this.hasAggregationOnTopCount) {
|
|
55781
|
+
if (this.transpose) {
|
|
55782
|
+
if (col >= this.rowHeaderLevelCount && col < this.rowHeaderLevelCount + this.hasAggregationOnTopCount) {
|
|
55783
|
+
return true;
|
|
55784
|
+
}
|
|
55785
|
+
}
|
|
55786
|
+
else {
|
|
55787
|
+
if (row >= this.columnHeaderLevelCount && row < this.columnHeaderLevelCount + this.hasAggregationOnTopCount) {
|
|
55788
|
+
return true;
|
|
55789
|
+
}
|
|
55790
|
+
}
|
|
55791
|
+
}
|
|
55792
|
+
}
|
|
55793
|
+
return false;
|
|
55794
|
+
}
|
|
55795
|
+
isTopAggregation(col, row) {
|
|
55796
|
+
if (this.hasAggregationOnTopCount) {
|
|
55797
|
+
if (this.transpose) {
|
|
55798
|
+
if (col >= this.rowHeaderLevelCount && col < this.rowHeaderLevelCount + this.hasAggregationOnTopCount) {
|
|
55799
|
+
return true;
|
|
55800
|
+
}
|
|
55801
|
+
}
|
|
55802
|
+
else {
|
|
55803
|
+
if (row >= this.columnHeaderLevelCount && row < this.columnHeaderLevelCount + this.hasAggregationOnTopCount) {
|
|
55804
|
+
return true;
|
|
55805
|
+
}
|
|
55806
|
+
}
|
|
55807
|
+
}
|
|
55808
|
+
return false;
|
|
55809
|
+
}
|
|
55810
|
+
isBottomAggregation(col, row) {
|
|
55811
|
+
if (this.hasAggregationOnBottomCount) {
|
|
55812
|
+
if (this.transpose) {
|
|
55813
|
+
if (col >= this.colCount - this.hasAggregationOnBottomCount) {
|
|
55814
|
+
return true;
|
|
55815
|
+
}
|
|
55816
|
+
}
|
|
55817
|
+
else {
|
|
55818
|
+
if (row >= this.rowCount - this.hasAggregationOnBottomCount) {
|
|
55819
|
+
return true;
|
|
55820
|
+
}
|
|
55821
|
+
}
|
|
55822
|
+
}
|
|
55823
|
+
return false;
|
|
55824
|
+
}
|
|
55825
|
+
get hasAggregation() {
|
|
55826
|
+
return this._hasAggregation;
|
|
55827
|
+
}
|
|
55828
|
+
get hasAggregationOnTopCount() {
|
|
55829
|
+
return this._hasAggregationOnTopCount;
|
|
55830
|
+
}
|
|
55831
|
+
get hasAggregationOnBottomCount() {
|
|
55832
|
+
return this._hasAggregationOnBottomCount;
|
|
55833
|
+
}
|
|
55834
|
+
getAggregators(col, row) {
|
|
55835
|
+
const column = this.getBody(col, row);
|
|
55836
|
+
const aggregators = column.aggregator;
|
|
55837
|
+
return aggregators;
|
|
55838
|
+
}
|
|
55839
|
+
getAggregatorOnTop(col, row) {
|
|
55840
|
+
const column = this.getBody(col, row);
|
|
55841
|
+
const aggregators = column.aggregator;
|
|
55842
|
+
const aggregation = column.aggregation;
|
|
55843
|
+
if (Array.isArray(aggregation)) {
|
|
55844
|
+
const topAggregationIndexs = aggregation.reduce((indexs, agg, index) => {
|
|
55845
|
+
if (agg.showOnTop) {
|
|
55846
|
+
indexs.push(index);
|
|
55847
|
+
}
|
|
55848
|
+
return indexs;
|
|
55849
|
+
}, []);
|
|
55850
|
+
const topAggregators = topAggregationIndexs.map(index => aggregators[index]);
|
|
55851
|
+
if (this.transpose) {
|
|
55852
|
+
return topAggregators[col - this.rowHeaderLevelCount];
|
|
55853
|
+
}
|
|
55854
|
+
return topAggregators[row - this.columnHeaderLevelCount];
|
|
55855
|
+
}
|
|
55856
|
+
if (this.transpose && col - this.rowHeaderLevelCount === 0) {
|
|
55857
|
+
return aggregation?.showOnTop ? aggregators : null;
|
|
55858
|
+
}
|
|
55859
|
+
else if (!this.transpose && row - this.columnHeaderLevelCount === 0) {
|
|
55860
|
+
return aggregation?.showOnTop ? aggregators : null;
|
|
55861
|
+
}
|
|
55862
|
+
return null;
|
|
55863
|
+
}
|
|
55864
|
+
getAggregatorOnBottom(col, row) {
|
|
55865
|
+
const column = this.getBody(col, row);
|
|
55866
|
+
const aggregators = column.aggregator;
|
|
55867
|
+
const aggregation = column.aggregation;
|
|
55868
|
+
if (Array.isArray(aggregation)) {
|
|
55869
|
+
const bottomAggregationIndexs = aggregation.reduce((indexs, agg, index) => {
|
|
55870
|
+
if (agg.showOnTop === false) {
|
|
55871
|
+
indexs.push(index);
|
|
55872
|
+
}
|
|
55873
|
+
return indexs;
|
|
55874
|
+
}, []);
|
|
55875
|
+
const bottomAggregators = bottomAggregationIndexs.map(index => aggregators[index]);
|
|
55876
|
+
if (this.transpose) {
|
|
55877
|
+
return bottomAggregators[col - (this.colCount - this.hasAggregationOnBottomCount)];
|
|
55878
|
+
}
|
|
55879
|
+
return bottomAggregators[row - (this.rowCount - this.hasAggregationOnBottomCount)];
|
|
55880
|
+
}
|
|
55881
|
+
if (this.transpose && col - (this.colCount - this.hasAggregationOnBottomCount) === 0) {
|
|
55882
|
+
return aggregation?.showOnTop === false ? aggregators : null;
|
|
55883
|
+
}
|
|
55884
|
+
else if (!this.transpose && row - (this.rowCount - this.hasAggregationOnBottomCount) === 0) {
|
|
55885
|
+
return aggregation?.showOnTop === false ? aggregators : null;
|
|
55886
|
+
}
|
|
55887
|
+
return null;
|
|
55888
|
+
}
|
|
55889
|
+
getCellAddressHasAggregator(col, row) {
|
|
55890
|
+
const cellAddrs = [];
|
|
55891
|
+
if (this.transpose) {
|
|
55892
|
+
const topCount = this.hasAggregationOnTopCount;
|
|
55893
|
+
for (let i = 0; i < topCount; i++) {
|
|
55894
|
+
cellAddrs.push({ col: this.headerLevelCount + i, row });
|
|
55895
|
+
}
|
|
55896
|
+
const bottomCount = this.hasAggregationOnBottomCount;
|
|
55897
|
+
for (let i = 0; i < bottomCount; i++) {
|
|
55898
|
+
cellAddrs.push({ col: this.rowCount - bottomCount + i, row });
|
|
55899
|
+
}
|
|
55900
|
+
}
|
|
55901
|
+
else {
|
|
55902
|
+
const topCount = this.hasAggregationOnTopCount;
|
|
55903
|
+
for (let i = 0; i < topCount; i++) {
|
|
55904
|
+
cellAddrs.push({ col, row: this.headerLevelCount + i });
|
|
55905
|
+
}
|
|
55906
|
+
const bottomCount = this.hasAggregationOnBottomCount;
|
|
55907
|
+
for (let i = 0; i < bottomCount; i++) {
|
|
55908
|
+
cellAddrs.push({ col, row: this.rowCount - bottomCount + i });
|
|
55909
|
+
}
|
|
55910
|
+
}
|
|
55911
|
+
return cellAddrs;
|
|
55912
|
+
}
|
|
54968
55913
|
getCellLocation(col, row) {
|
|
54969
55914
|
if (this.isHeader(col, row)) {
|
|
54970
55915
|
if (this.transpose) {
|
|
@@ -55234,11 +56179,6 @@
|
|
|
55234
56179
|
const id = this.getCellId(col, row);
|
|
55235
56180
|
return this._headerObjectMap[id];
|
|
55236
56181
|
}
|
|
55237
|
-
getHeaderFieldKey(col, row) {
|
|
55238
|
-
const id = this.getCellId(col, row);
|
|
55239
|
-
return (this._headerObjectMap[id]?.fieldKey ||
|
|
55240
|
-
(this.transpose ? this._columns[row]?.fieldKey : this._columns[col]?.fieldKey));
|
|
55241
|
-
}
|
|
55242
56182
|
getHeaderField(col, row) {
|
|
55243
56183
|
const id = this.getCellId(col, row);
|
|
55244
56184
|
return (this._headerObjectMap[id]?.field ||
|
|
@@ -55446,19 +56386,21 @@
|
|
|
55446
56386
|
range1.end.row === range2.end.row);
|
|
55447
56387
|
}
|
|
55448
56388
|
getRecordIndexByCell(col, row) {
|
|
56389
|
+
const skipRowCount = this.hasAggregationOnTopCount ? this.headerLevelCount + 1 : this.headerLevelCount;
|
|
55449
56390
|
if (this.transpose) {
|
|
55450
|
-
if (col <
|
|
56391
|
+
if (col < skipRowCount) {
|
|
55451
56392
|
return -1;
|
|
55452
56393
|
}
|
|
55453
|
-
return col -
|
|
56394
|
+
return col - skipRowCount;
|
|
55454
56395
|
}
|
|
55455
|
-
if (row <
|
|
56396
|
+
if (row < skipRowCount) {
|
|
55456
56397
|
return -1;
|
|
55457
56398
|
}
|
|
55458
|
-
return row -
|
|
56399
|
+
return row - skipRowCount;
|
|
55459
56400
|
}
|
|
55460
56401
|
getRecordStartRowByRecordIndex(index) {
|
|
55461
|
-
|
|
56402
|
+
const skipRowCount = this.hasAggregationOnTopCount ? this.headerLevelCount + 1 : this.headerLevelCount;
|
|
56403
|
+
return skipRowCount + index;
|
|
55462
56404
|
}
|
|
55463
56405
|
_addHeaders(row, column, roots, hideColumnsSubHeader) {
|
|
55464
56406
|
const results = [];
|
|
@@ -55471,8 +56413,6 @@
|
|
|
55471
56413
|
title: hd.title ?? hd.caption,
|
|
55472
56414
|
headerIcon: hd.headerIcon,
|
|
55473
56415
|
field: hd.field,
|
|
55474
|
-
fieldKey: hd?.fieldKey,
|
|
55475
|
-
fieldFormat: hd.fieldFormat,
|
|
55476
56416
|
style: hd.headerStyle,
|
|
55477
56417
|
headerType: hd.headerType ?? 'text',
|
|
55478
56418
|
dropDownMenu: hd.dropDownMenu,
|
|
@@ -55497,7 +56437,6 @@
|
|
|
55497
56437
|
this._columns.push({
|
|
55498
56438
|
id: this.seqId++,
|
|
55499
56439
|
field: colDef.field,
|
|
55500
|
-
fieldKey: colDef.fieldKey,
|
|
55501
56440
|
fieldFormat: colDef.fieldFormat,
|
|
55502
56441
|
width: colDef.width,
|
|
55503
56442
|
minWidth: colDef.minWidth,
|
|
@@ -55510,7 +56449,8 @@
|
|
|
55510
56449
|
style: colDef.style,
|
|
55511
56450
|
define: colDef,
|
|
55512
56451
|
columnWidthComputeMode: colDef.columnWidthComputeMode,
|
|
55513
|
-
disableColumnResize: colDef?.disableColumnResize
|
|
56452
|
+
disableColumnResize: colDef?.disableColumnResize,
|
|
56453
|
+
aggregation: this._getAggregationForColumn(colDef, col)
|
|
55514
56454
|
});
|
|
55515
56455
|
for (let r = row + 1; r < this._headerCellIds.length; r++) {
|
|
55516
56456
|
this._headerCellIds[r][col] = id;
|
|
@@ -55519,6 +56459,35 @@
|
|
|
55519
56459
|
});
|
|
55520
56460
|
return results;
|
|
55521
56461
|
}
|
|
56462
|
+
_getAggregationForColumn(colDef, col) {
|
|
56463
|
+
let aggregation;
|
|
56464
|
+
if (colDef.aggregation) {
|
|
56465
|
+
aggregation = colDef.aggregation;
|
|
56466
|
+
}
|
|
56467
|
+
else if (this._table.options.aggregation) {
|
|
56468
|
+
if (typeof this._table.options.aggregation === 'function') {
|
|
56469
|
+
aggregation = this._table.options.aggregation({
|
|
56470
|
+
col: col,
|
|
56471
|
+
field: colDef.field
|
|
56472
|
+
});
|
|
56473
|
+
}
|
|
56474
|
+
else {
|
|
56475
|
+
aggregation = this._table.options.aggregation;
|
|
56476
|
+
}
|
|
56477
|
+
}
|
|
56478
|
+
if (aggregation) {
|
|
56479
|
+
if (Array.isArray(aggregation)) {
|
|
56480
|
+
return aggregation.map(item => {
|
|
56481
|
+
if (!isValid$1(item.showOnTop)) {
|
|
56482
|
+
item.showOnTop = false;
|
|
56483
|
+
}
|
|
56484
|
+
return item;
|
|
56485
|
+
});
|
|
56486
|
+
}
|
|
56487
|
+
return Object.assign({ showOnTop: false }, aggregation);
|
|
56488
|
+
}
|
|
56489
|
+
return null;
|
|
56490
|
+
}
|
|
55522
56491
|
_newRow(row, hideColumnsSubHeader = false) {
|
|
55523
56492
|
if (this._headerCellIds[row]) {
|
|
55524
56493
|
const prev = this._headerCellIds[row - 1];
|
|
@@ -55679,6 +56648,9 @@
|
|
|
55679
56648
|
}
|
|
55680
56649
|
setChartInstance(_col, _row, chartInstance) {
|
|
55681
56650
|
const columnObj = this.transpose ? this._columns[_row] : this._columns[_col];
|
|
56651
|
+
if (typeof columnObj.chartSpec === 'function') {
|
|
56652
|
+
return;
|
|
56653
|
+
}
|
|
55682
56654
|
columnObj.chartInstance = chartInstance;
|
|
55683
56655
|
}
|
|
55684
56656
|
getChartInstance(_col, _row) {
|
|
@@ -55700,9 +56672,32 @@
|
|
|
55700
56672
|
getChartAxes(col, row) {
|
|
55701
56673
|
return [];
|
|
55702
56674
|
}
|
|
56675
|
+
isShareChartSpec(col, row) {
|
|
56676
|
+
const body = this.getBody(col, row);
|
|
56677
|
+
const chartSpec = body?.chartSpec;
|
|
56678
|
+
if (typeof chartSpec === 'function') {
|
|
56679
|
+
return false;
|
|
56680
|
+
}
|
|
56681
|
+
return true;
|
|
56682
|
+
}
|
|
56683
|
+
getChartSpec(col, row) {
|
|
56684
|
+
return this.getRawChartSpec(col, row);
|
|
56685
|
+
}
|
|
55703
56686
|
getRawChartSpec(col, row) {
|
|
55704
56687
|
const body = this.getBody(col, row);
|
|
55705
|
-
|
|
56688
|
+
const chartSpec = body?.chartSpec;
|
|
56689
|
+
if (typeof chartSpec === 'function') {
|
|
56690
|
+
const arg = {
|
|
56691
|
+
col,
|
|
56692
|
+
row,
|
|
56693
|
+
dataValue: this._table.getCellOriginValue(col, row) || '',
|
|
56694
|
+
value: this._table.getCellValue(col, row) || '',
|
|
56695
|
+
rect: this._table.getCellRangeRelativeRect(this._table.getCellRange(col, row)),
|
|
56696
|
+
table: this._table
|
|
56697
|
+
};
|
|
56698
|
+
return chartSpec(arg);
|
|
56699
|
+
}
|
|
56700
|
+
return chartSpec;
|
|
55706
56701
|
}
|
|
55707
56702
|
getChartDataId(col, row) {
|
|
55708
56703
|
return getChartDataId(col, row, this);
|
|
@@ -55722,6 +56717,15 @@
|
|
|
55722
56717
|
define.title = title;
|
|
55723
56718
|
define.define.title = title;
|
|
55724
56719
|
}
|
|
56720
|
+
getColumnByField(field) {
|
|
56721
|
+
const result = this.columnObjects?.reduce((pre, cur, index) => {
|
|
56722
|
+
if (cur.field === field) {
|
|
56723
|
+
pre.push({ col: index, columnDefine: cur });
|
|
56724
|
+
}
|
|
56725
|
+
return pre;
|
|
56726
|
+
}, []);
|
|
56727
|
+
return result;
|
|
56728
|
+
}
|
|
55725
56729
|
}
|
|
55726
56730
|
|
|
55727
56731
|
class Title {
|
|
@@ -55908,6 +56912,9 @@
|
|
|
55908
56912
|
return;
|
|
55909
56913
|
}
|
|
55910
56914
|
}
|
|
56915
|
+
if (this.table.internalProps.layoutMap?.isAggregation?.(col, row)) {
|
|
56916
|
+
return;
|
|
56917
|
+
}
|
|
55911
56918
|
this.editingEditor = editor;
|
|
55912
56919
|
this.editCell = { col, row };
|
|
55913
56920
|
const dataValue = this.table.getCellOriginValue(col, row);
|
|
@@ -55984,6 +56991,7 @@
|
|
|
55984
56991
|
internalProps.frozenColDragHeaderMode = options.frozenColDragHeaderMode;
|
|
55985
56992
|
this.pagination = options.pagination;
|
|
55986
56993
|
internalProps.sortState = options.sortState;
|
|
56994
|
+
internalProps.dataConfig = {};
|
|
55987
56995
|
internalProps.columns = options.columns
|
|
55988
56996
|
? cloneDeep(options.columns)
|
|
55989
56997
|
: options.header
|
|
@@ -56029,6 +57037,12 @@
|
|
|
56029
57037
|
get sortState() {
|
|
56030
57038
|
return this.internalProps.sortState;
|
|
56031
57039
|
}
|
|
57040
|
+
get records() {
|
|
57041
|
+
return this.dataSource.source;
|
|
57042
|
+
}
|
|
57043
|
+
get recordsCount() {
|
|
57044
|
+
return this.dataSource.source.length;
|
|
57045
|
+
}
|
|
56032
57046
|
updateColumns(columns) {
|
|
56033
57047
|
const oldHoverState = { col: this.stateManager.hover.cellPos.col, row: this.stateManager.hover.cellPos.row };
|
|
56034
57048
|
this.internalProps.columns = cloneDeep(columns);
|
|
@@ -56089,6 +57103,16 @@
|
|
|
56089
57103
|
const { title } = table.internalProps.layoutMap.getHeader(col, row);
|
|
56090
57104
|
return typeof title === 'function' ? title() : title;
|
|
56091
57105
|
}
|
|
57106
|
+
else if (table.internalProps.layoutMap.isAggregation(col, row)) {
|
|
57107
|
+
if (table.internalProps.layoutMap.isTopAggregation(col, row)) {
|
|
57108
|
+
const aggregator = table.internalProps.layoutMap.getAggregatorOnTop(col, row);
|
|
57109
|
+
return aggregator?.formatValue ? aggregator.formatValue(col, row, this) : '';
|
|
57110
|
+
}
|
|
57111
|
+
else if (table.internalProps.layoutMap.isBottomAggregation(col, row)) {
|
|
57112
|
+
const aggregator = table.internalProps.layoutMap.getAggregatorOnBottom(col, row);
|
|
57113
|
+
return aggregator?.formatValue ? aggregator.formatValue(col, row, this) : '';
|
|
57114
|
+
}
|
|
57115
|
+
}
|
|
56092
57116
|
const { field, fieldFormat } = table.internalProps.layoutMap.getBody(col, row);
|
|
56093
57117
|
return table.getFieldData(fieldFormat || field, col, row);
|
|
56094
57118
|
}
|
|
@@ -56101,6 +57125,16 @@
|
|
|
56101
57125
|
const { title } = table.internalProps.layoutMap.getHeader(col, row);
|
|
56102
57126
|
return typeof title === 'function' ? title() : title;
|
|
56103
57127
|
}
|
|
57128
|
+
else if (table.internalProps.layoutMap.isAggregation(col, row)) {
|
|
57129
|
+
if (table.internalProps.layoutMap.isTopAggregation(col, row)) {
|
|
57130
|
+
const aggregator = table.internalProps.layoutMap.getAggregatorOnTop(col, row);
|
|
57131
|
+
return aggregator?.value();
|
|
57132
|
+
}
|
|
57133
|
+
else if (table.internalProps.layoutMap.isBottomAggregation(col, row)) {
|
|
57134
|
+
const aggregator = table.internalProps.layoutMap.getAggregatorOnBottom(col, row);
|
|
57135
|
+
return aggregator?.value();
|
|
57136
|
+
}
|
|
57137
|
+
}
|
|
56104
57138
|
const { field } = table.internalProps.layoutMap.getBody(col, row);
|
|
56105
57139
|
return table.getFieldData(field, col, row);
|
|
56106
57140
|
}
|
|
@@ -56173,6 +57207,7 @@
|
|
|
56173
57207
|
super.updateOption(options);
|
|
56174
57208
|
internalProps.frozenColDragHeaderMode = options.frozenColDragHeaderMode;
|
|
56175
57209
|
this.pagination = options.pagination;
|
|
57210
|
+
internalProps.dataConfig = {};
|
|
56176
57211
|
this.showHeader = options.showHeader ?? true;
|
|
56177
57212
|
internalProps.columns = options.columns
|
|
56178
57213
|
? cloneDeep(options.columns)
|
|
@@ -56252,11 +57287,13 @@
|
|
|
56252
57287
|
if (!layoutMap) {
|
|
56253
57288
|
return;
|
|
56254
57289
|
}
|
|
56255
|
-
layoutMap.recordsCount =
|
|
57290
|
+
layoutMap.recordsCount =
|
|
57291
|
+
(table.internalProps.dataSource?.length ?? 0) +
|
|
57292
|
+
layoutMap.hasAggregationOnTopCount +
|
|
57293
|
+
layoutMap.hasAggregationOnBottomCount;
|
|
56256
57294
|
if (table.transpose) {
|
|
56257
57295
|
table.rowCount = layoutMap.rowCount ?? 0;
|
|
56258
|
-
table.colCount =
|
|
56259
|
-
(table.internalProps.dataSource?.length ?? 0) * layoutMap.bodyRowSpanCount + layoutMap.headerLevelCount;
|
|
57296
|
+
table.colCount = layoutMap.recordsCount * layoutMap.bodyRowSpanCount + layoutMap.headerLevelCount;
|
|
56260
57297
|
table.frozenRowCount = 0;
|
|
56261
57298
|
this.internalProps.frozenColCount = layoutMap.headerLevelCount ?? 0;
|
|
56262
57299
|
if (table.bottomFrozenRowCount !== (this.options.bottomFrozenRowCount ?? 0)) {
|
|
@@ -56268,8 +57305,7 @@
|
|
|
56268
57305
|
}
|
|
56269
57306
|
else {
|
|
56270
57307
|
table.colCount = layoutMap.colCount ?? 0;
|
|
56271
|
-
table.rowCount =
|
|
56272
|
-
(table.internalProps.dataSource?.length ?? 0) * layoutMap.bodyRowSpanCount + layoutMap.headerLevelCount;
|
|
57308
|
+
table.rowCount = layoutMap.recordsCount * layoutMap.bodyRowSpanCount + layoutMap.headerLevelCount;
|
|
56273
57309
|
this.internalProps.frozenColCount = this.options.frozenColCount ?? 0;
|
|
56274
57310
|
table.frozenRowCount = layoutMap.headerLevelCount;
|
|
56275
57311
|
if (table.bottomFrozenRowCount !== (this.options.bottomFrozenRowCount ?? 0)) {
|
|
@@ -56517,22 +57553,15 @@
|
|
|
56517
57553
|
}
|
|
56518
57554
|
let order;
|
|
56519
57555
|
let field;
|
|
56520
|
-
let fieldKey;
|
|
56521
57556
|
if (Array.isArray(this.internalProps.sortState)) {
|
|
56522
|
-
({ order, field
|
|
57557
|
+
({ order, field } = this.internalProps.sortState?.[0]);
|
|
56523
57558
|
}
|
|
56524
57559
|
else {
|
|
56525
|
-
({ order, field
|
|
57560
|
+
({ order, field } = this.internalProps.sortState);
|
|
56526
57561
|
}
|
|
56527
57562
|
if (field && executeSort) {
|
|
56528
|
-
const sortFunc = this._getSortFuncFromHeaderOption(this.internalProps.columns, field
|
|
56529
|
-
|
|
56530
|
-
if (fieldKey) {
|
|
56531
|
-
hd = this.internalProps.layoutMap.headerObjects.find((col) => col && col.fieldKey === fieldKey);
|
|
56532
|
-
}
|
|
56533
|
-
else {
|
|
56534
|
-
hd = this.internalProps.layoutMap.headerObjects.find((col) => col && col.field === field);
|
|
56535
|
-
}
|
|
57563
|
+
const sortFunc = this._getSortFuncFromHeaderOption(this.internalProps.columns, field);
|
|
57564
|
+
const hd = this.internalProps.layoutMap.headerObjects.find((col) => col && col.field === field);
|
|
56536
57565
|
if (hd.define.sort !== false) {
|
|
56537
57566
|
this.dataSource.sort(hd.field, order, sortFunc);
|
|
56538
57567
|
this.internalProps.layoutMap.clearCellRangeMap();
|
|
@@ -56541,6 +57570,19 @@
|
|
|
56541
57570
|
}
|
|
56542
57571
|
this.stateManager.updateSortState(sortState);
|
|
56543
57572
|
}
|
|
57573
|
+
updateFilterRules(filterRules) {
|
|
57574
|
+
this.scenegraph.clearCells();
|
|
57575
|
+
this.internalProps.dataConfig.filterRules = filterRules;
|
|
57576
|
+
if (this.sortState) {
|
|
57577
|
+
this.dataSource.updateFilterRulesForSorted(filterRules);
|
|
57578
|
+
sortRecords(this);
|
|
57579
|
+
}
|
|
57580
|
+
else {
|
|
57581
|
+
this.dataSource.updateFilterRules(filterRules);
|
|
57582
|
+
}
|
|
57583
|
+
this.refreshRowColCount();
|
|
57584
|
+
this.scenegraph.createSceneGraph();
|
|
57585
|
+
}
|
|
56544
57586
|
getCheckboxState(field) {
|
|
56545
57587
|
if (this.stateManager.checkedState.length < this.rowCount - this.columnHeaderLevelCount) {
|
|
56546
57588
|
this.stateManager.initLeftRecordsCheckState(this.records);
|
|
@@ -56555,7 +57597,7 @@
|
|
|
56555
57597
|
getCellCheckboxState(col, row) {
|
|
56556
57598
|
const define = this.getBodyColumnDefine(col, row);
|
|
56557
57599
|
const field = define?.field;
|
|
56558
|
-
const cellType =
|
|
57600
|
+
const cellType = this.getCellType(col, row);
|
|
56559
57601
|
if (isValid$1(field) && cellType === 'checkbox') {
|
|
56560
57602
|
const dataIndex = this.dataSource.getIndexKey(this.getRecordShowIndexByCell(col, row));
|
|
56561
57603
|
return this.stateManager.checkedState[dataIndex][field];
|
|
@@ -56575,24 +57617,17 @@
|
|
|
56575
57617
|
if (this.sortState) {
|
|
56576
57618
|
let order;
|
|
56577
57619
|
let field;
|
|
56578
|
-
let fieldKey;
|
|
56579
57620
|
if (Array.isArray(this.sortState)) {
|
|
56580
57621
|
if (this.sortState.length !== 0) {
|
|
56581
|
-
({ order, field
|
|
57622
|
+
({ order, field } = this.sortState?.[0]);
|
|
56582
57623
|
}
|
|
56583
57624
|
}
|
|
56584
57625
|
else {
|
|
56585
|
-
({ order, field
|
|
57626
|
+
({ order, field } = this.sortState);
|
|
56586
57627
|
}
|
|
56587
57628
|
if (order && field && order !== 'normal') {
|
|
56588
|
-
const sortFunc = this._getSortFuncFromHeaderOption(undefined, field
|
|
56589
|
-
|
|
56590
|
-
if (fieldKey) {
|
|
56591
|
-
hd = this.internalProps.layoutMap.headerObjects.find((col) => col && col.fieldKey === fieldKey);
|
|
56592
|
-
}
|
|
56593
|
-
else {
|
|
56594
|
-
hd = this.internalProps.layoutMap.headerObjects.find((col) => col && col.field === field);
|
|
56595
|
-
}
|
|
57629
|
+
const sortFunc = this._getSortFuncFromHeaderOption(undefined, field);
|
|
57630
|
+
const hd = this.internalProps.layoutMap.headerObjects.find((col) => col && col.field === field);
|
|
56596
57631
|
if (hd.define.sort !== false) {
|
|
56597
57632
|
this.dataSource.sort(hd.field, order, sortFunc ?? defaultOrderFn);
|
|
56598
57633
|
}
|
|
@@ -56666,6 +57701,26 @@
|
|
|
56666
57701
|
else {
|
|
56667
57702
|
this.dataSource.changeFieldValue(value, recordIndex, field, col, row, this);
|
|
56668
57703
|
}
|
|
57704
|
+
const aggregators = this.internalProps.layoutMap.getAggregators(col, row);
|
|
57705
|
+
if (aggregators) {
|
|
57706
|
+
if (Array.isArray(aggregators)) {
|
|
57707
|
+
for (let i = 0; i < aggregators?.length; i++) {
|
|
57708
|
+
aggregators[i].recalculate();
|
|
57709
|
+
}
|
|
57710
|
+
}
|
|
57711
|
+
else {
|
|
57712
|
+
aggregators.recalculate();
|
|
57713
|
+
}
|
|
57714
|
+
const aggregatorCells = this.internalProps.layoutMap.getCellAddressHasAggregator(col, row);
|
|
57715
|
+
for (let i = 0; i < aggregatorCells.length; i++) {
|
|
57716
|
+
const range = this.getCellRange(aggregatorCells[i].col, aggregatorCells[i].row);
|
|
57717
|
+
for (let sCol = range.start.col; sCol <= range.end.col; sCol++) {
|
|
57718
|
+
for (let sRow = range.start.row; sRow <= range.end.row; sRow++) {
|
|
57719
|
+
this.scenegraph.updateCellContent(sCol, sRow);
|
|
57720
|
+
}
|
|
57721
|
+
}
|
|
57722
|
+
}
|
|
57723
|
+
}
|
|
56669
57724
|
const range = this.getCellRange(col, row);
|
|
56670
57725
|
for (let sCol = range.start.col; sCol <= range.end.col; sCol++) {
|
|
56671
57726
|
for (let sRow = range.start.row; sRow <= range.end.row; sRow++) {
|
|
@@ -57069,7 +58124,7 @@
|
|
|
57069
58124
|
}
|
|
57070
58125
|
}
|
|
57071
58126
|
}
|
|
57072
|
-
|
|
58127
|
+
_hasCustomRenderOrLayout() {
|
|
57073
58128
|
const { headerObjects } = this.internalProps.layoutMap;
|
|
57074
58129
|
if (this.options.customRender) {
|
|
57075
58130
|
return true;
|
|
@@ -57085,6 +58140,37 @@
|
|
|
57085
58140
|
}
|
|
57086
58141
|
return false;
|
|
57087
58142
|
}
|
|
58143
|
+
getAggregateValuesByField(field) {
|
|
58144
|
+
const columns = this.internalProps.layoutMap.getColumnByField(field);
|
|
58145
|
+
const results = [];
|
|
58146
|
+
for (let i = 0; i < columns.length; i++) {
|
|
58147
|
+
const aggregator = columns[i].columnDefine.aggregator;
|
|
58148
|
+
delete columns[i].columnDefine;
|
|
58149
|
+
if (aggregator) {
|
|
58150
|
+
const columnAggregateValue = {
|
|
58151
|
+
col: columns[i].col,
|
|
58152
|
+
aggregateValue: null
|
|
58153
|
+
};
|
|
58154
|
+
columnAggregateValue.aggregateValue = [];
|
|
58155
|
+
if (Array.isArray(aggregator)) {
|
|
58156
|
+
for (let j = 0; j < aggregator.length; j++) {
|
|
58157
|
+
columnAggregateValue.aggregateValue.push({
|
|
58158
|
+
aggregationType: aggregator[j].type,
|
|
58159
|
+
value: aggregator[j].value()
|
|
58160
|
+
});
|
|
58161
|
+
}
|
|
58162
|
+
}
|
|
58163
|
+
else {
|
|
58164
|
+
columnAggregateValue.aggregateValue.push({
|
|
58165
|
+
aggregationType: aggregator.type,
|
|
58166
|
+
value: aggregator.value()
|
|
58167
|
+
});
|
|
58168
|
+
}
|
|
58169
|
+
results.push(columnAggregateValue);
|
|
58170
|
+
}
|
|
58171
|
+
}
|
|
58172
|
+
return results;
|
|
58173
|
+
}
|
|
57088
58174
|
}
|
|
57089
58175
|
|
|
57090
58176
|
const defaultDimension = { startInTotal: 0, level: 0 };
|
|
@@ -58802,6 +59888,9 @@
|
|
|
58802
59888
|
const indicatorKey = paths.rowHeaderPaths.find(rowPath => rowPath.indicatorKey)?.indicatorKey;
|
|
58803
59889
|
indicatorObj = this._indicators?.find(indicator => indicator.indicatorKey === indicatorKey);
|
|
58804
59890
|
}
|
|
59891
|
+
if (typeof indicatorObj?.chartSpec === 'function') {
|
|
59892
|
+
return;
|
|
59893
|
+
}
|
|
58805
59894
|
indicatorObj && (indicatorObj.chartInstance = chartInstance);
|
|
58806
59895
|
}
|
|
58807
59896
|
getChartInstance(_col, _row) {
|
|
@@ -58884,6 +59973,12 @@
|
|
|
58884
59973
|
getRawChartSpec(col, row) {
|
|
58885
59974
|
return getRawChartSpec(col, row, this);
|
|
58886
59975
|
}
|
|
59976
|
+
getChartSpec(col, row) {
|
|
59977
|
+
return getChartSpec(col, row, this);
|
|
59978
|
+
}
|
|
59979
|
+
isShareChartSpec(col, row) {
|
|
59980
|
+
return isShareChartSpec(col, row, this);
|
|
59981
|
+
}
|
|
58887
59982
|
getChartDataId(col, row) {
|
|
58888
59983
|
return getChartDataId(col, row, this);
|
|
58889
59984
|
}
|
|
@@ -58994,9 +60089,6 @@
|
|
|
58994
60089
|
}
|
|
58995
60090
|
return null;
|
|
58996
60091
|
}
|
|
58997
|
-
getChartSpec(col, row) {
|
|
58998
|
-
return getChartSpec(col, row, this);
|
|
58999
|
-
}
|
|
59000
60092
|
_generateChartState() {
|
|
59001
60093
|
const state = {
|
|
59002
60094
|
vtable_selected: {
|
|
@@ -59233,12 +60325,23 @@
|
|
|
59233
60325
|
});
|
|
59234
60326
|
return indicatorInfo;
|
|
59235
60327
|
}
|
|
60328
|
+
getLayoutColumnTree() {
|
|
60329
|
+
const tree = [];
|
|
60330
|
+
const children = this.columnDimensionTree.tree.children;
|
|
60331
|
+
generateLayoutTree(tree, children);
|
|
60332
|
+
return tree;
|
|
60333
|
+
}
|
|
59236
60334
|
getLayoutRowTree() {
|
|
59237
60335
|
const tree = [];
|
|
59238
60336
|
const children = this.rowDimensionTree.tree.children;
|
|
59239
60337
|
generateLayoutTree(tree, children);
|
|
59240
60338
|
return tree;
|
|
59241
60339
|
}
|
|
60340
|
+
getLayoutColumnTreeCount() {
|
|
60341
|
+
const children = this.columnDimensionTree.tree.children;
|
|
60342
|
+
const mainTreeCount = countLayoutTree(children, this.rowHierarchyType === 'tree');
|
|
60343
|
+
return mainTreeCount;
|
|
60344
|
+
}
|
|
59242
60345
|
getLayoutRowTreeCount() {
|
|
59243
60346
|
const children = this.rowDimensionTree.tree.children;
|
|
59244
60347
|
const mainTreeCount = countLayoutTree(children, this.rowHierarchyType === 'tree');
|
|
@@ -59457,371 +60560,6 @@
|
|
|
59457
60560
|
}
|
|
59458
60561
|
}
|
|
59459
60562
|
|
|
59460
|
-
class Aggregator {
|
|
59461
|
-
className = 'Aggregator';
|
|
59462
|
-
isRecord = true;
|
|
59463
|
-
records = [];
|
|
59464
|
-
type;
|
|
59465
|
-
field;
|
|
59466
|
-
formatFun;
|
|
59467
|
-
_formatedValue;
|
|
59468
|
-
needSplitPositiveAndNegativeForSum = false;
|
|
59469
|
-
constructor(dimension, formatFun, isRecord, needSplitPositiveAndNegative) {
|
|
59470
|
-
this.field = dimension;
|
|
59471
|
-
this.needSplitPositiveAndNegativeForSum = needSplitPositiveAndNegative ?? false;
|
|
59472
|
-
this.formatFun = formatFun;
|
|
59473
|
-
this.isRecord = isRecord ?? this.isRecord;
|
|
59474
|
-
}
|
|
59475
|
-
clearCacheValue() {
|
|
59476
|
-
this._formatedValue = undefined;
|
|
59477
|
-
}
|
|
59478
|
-
formatValue(col, row, table) {
|
|
59479
|
-
if (!this._formatedValue) {
|
|
59480
|
-
if (this.formatFun) {
|
|
59481
|
-
this._formatedValue = this.formatFun(this.value(), col, row, table);
|
|
59482
|
-
}
|
|
59483
|
-
else {
|
|
59484
|
-
this._formatedValue = this.value();
|
|
59485
|
-
}
|
|
59486
|
-
}
|
|
59487
|
-
return this._formatedValue;
|
|
59488
|
-
}
|
|
59489
|
-
reset() {
|
|
59490
|
-
this.records = [];
|
|
59491
|
-
}
|
|
59492
|
-
}
|
|
59493
|
-
class RecordAggregator extends Aggregator {
|
|
59494
|
-
type = AggregationType.RECORD;
|
|
59495
|
-
isRecord = true;
|
|
59496
|
-
push(record) {
|
|
59497
|
-
if (this.isRecord) {
|
|
59498
|
-
if (record.className === 'Aggregator') {
|
|
59499
|
-
this.records.push(...record.records);
|
|
59500
|
-
}
|
|
59501
|
-
else {
|
|
59502
|
-
this.records.push(record);
|
|
59503
|
-
}
|
|
59504
|
-
}
|
|
59505
|
-
}
|
|
59506
|
-
value() {
|
|
59507
|
-
return this.records;
|
|
59508
|
-
}
|
|
59509
|
-
reset() {
|
|
59510
|
-
this.records = [];
|
|
59511
|
-
}
|
|
59512
|
-
}
|
|
59513
|
-
class NoneAggregator extends Aggregator {
|
|
59514
|
-
type = AggregationType.NONE;
|
|
59515
|
-
isRecord = true;
|
|
59516
|
-
fieldValue;
|
|
59517
|
-
push(record) {
|
|
59518
|
-
if (this.isRecord) {
|
|
59519
|
-
this.records = [record];
|
|
59520
|
-
}
|
|
59521
|
-
this.fieldValue = record[this.field];
|
|
59522
|
-
}
|
|
59523
|
-
value() {
|
|
59524
|
-
return this.fieldValue;
|
|
59525
|
-
}
|
|
59526
|
-
reset() {
|
|
59527
|
-
this.records = [];
|
|
59528
|
-
this.fieldValue = undefined;
|
|
59529
|
-
}
|
|
59530
|
-
}
|
|
59531
|
-
class SumAggregator extends Aggregator {
|
|
59532
|
-
type = AggregationType.SUM;
|
|
59533
|
-
sum = 0;
|
|
59534
|
-
positiveSum = 0;
|
|
59535
|
-
nagetiveSum = 0;
|
|
59536
|
-
push(record) {
|
|
59537
|
-
if (this.isRecord) {
|
|
59538
|
-
if (record.className === 'Aggregator') {
|
|
59539
|
-
this.records.push(...record.records);
|
|
59540
|
-
}
|
|
59541
|
-
else {
|
|
59542
|
-
this.records.push(record);
|
|
59543
|
-
}
|
|
59544
|
-
}
|
|
59545
|
-
if (record.className === 'Aggregator') {
|
|
59546
|
-
const value = record.value();
|
|
59547
|
-
this.sum += value;
|
|
59548
|
-
if (this.needSplitPositiveAndNegativeForSum) {
|
|
59549
|
-
if (value > 0) {
|
|
59550
|
-
this.positiveSum += value;
|
|
59551
|
-
}
|
|
59552
|
-
else if (value < 0) {
|
|
59553
|
-
this.nagetiveSum += value;
|
|
59554
|
-
}
|
|
59555
|
-
}
|
|
59556
|
-
}
|
|
59557
|
-
else if (!isNaN(parseFloat(record[this.field]))) {
|
|
59558
|
-
const value = parseFloat(record[this.field]);
|
|
59559
|
-
this.sum += value;
|
|
59560
|
-
if (this.needSplitPositiveAndNegativeForSum) {
|
|
59561
|
-
if (value > 0) {
|
|
59562
|
-
this.positiveSum += value;
|
|
59563
|
-
}
|
|
59564
|
-
else if (value < 0) {
|
|
59565
|
-
this.nagetiveSum += value;
|
|
59566
|
-
}
|
|
59567
|
-
}
|
|
59568
|
-
}
|
|
59569
|
-
}
|
|
59570
|
-
value() {
|
|
59571
|
-
return this.sum;
|
|
59572
|
-
}
|
|
59573
|
-
positiveValue() {
|
|
59574
|
-
return this.positiveSum;
|
|
59575
|
-
}
|
|
59576
|
-
negativeValue() {
|
|
59577
|
-
return this.nagetiveSum;
|
|
59578
|
-
}
|
|
59579
|
-
reset() {
|
|
59580
|
-
this.records = [];
|
|
59581
|
-
this.sum = 0;
|
|
59582
|
-
}
|
|
59583
|
-
}
|
|
59584
|
-
class CountAggregator extends Aggregator {
|
|
59585
|
-
type = AggregationType.COUNT;
|
|
59586
|
-
count = 0;
|
|
59587
|
-
push(record) {
|
|
59588
|
-
if (this.isRecord) {
|
|
59589
|
-
if (record.className === 'Aggregator') {
|
|
59590
|
-
this.records.push(...record.records);
|
|
59591
|
-
}
|
|
59592
|
-
else {
|
|
59593
|
-
this.records.push(record);
|
|
59594
|
-
}
|
|
59595
|
-
}
|
|
59596
|
-
if (record.className === 'Aggregator') {
|
|
59597
|
-
this.count += record.value();
|
|
59598
|
-
}
|
|
59599
|
-
else {
|
|
59600
|
-
this.count++;
|
|
59601
|
-
}
|
|
59602
|
-
}
|
|
59603
|
-
value() {
|
|
59604
|
-
return this.count;
|
|
59605
|
-
}
|
|
59606
|
-
reset() {
|
|
59607
|
-
this.records = [];
|
|
59608
|
-
this.count = 0;
|
|
59609
|
-
}
|
|
59610
|
-
}
|
|
59611
|
-
class AvgAggregator extends Aggregator {
|
|
59612
|
-
type = AggregationType.AVG;
|
|
59613
|
-
sum = 0;
|
|
59614
|
-
count = 0;
|
|
59615
|
-
push(record) {
|
|
59616
|
-
if (this.isRecord) {
|
|
59617
|
-
if (record.className === 'Aggregator') {
|
|
59618
|
-
this.records.push(...record.records);
|
|
59619
|
-
}
|
|
59620
|
-
else {
|
|
59621
|
-
this.records.push(record);
|
|
59622
|
-
}
|
|
59623
|
-
}
|
|
59624
|
-
if (record.className === 'Aggregator' && record.type === AggregationType.AVG) {
|
|
59625
|
-
this.sum += record.sum;
|
|
59626
|
-
this.count += record.count;
|
|
59627
|
-
}
|
|
59628
|
-
else if (!isNaN(parseFloat(record[this.field]))) {
|
|
59629
|
-
this.sum += parseFloat(record[this.field]);
|
|
59630
|
-
this.count++;
|
|
59631
|
-
}
|
|
59632
|
-
}
|
|
59633
|
-
value() {
|
|
59634
|
-
return this.sum / this.count;
|
|
59635
|
-
}
|
|
59636
|
-
reset() {
|
|
59637
|
-
this.records = [];
|
|
59638
|
-
this.sum = 0;
|
|
59639
|
-
this.count = 0;
|
|
59640
|
-
}
|
|
59641
|
-
}
|
|
59642
|
-
class MaxAggregator extends Aggregator {
|
|
59643
|
-
type = AggregationType.MAX;
|
|
59644
|
-
max = Number.MIN_SAFE_INTEGER;
|
|
59645
|
-
push(record) {
|
|
59646
|
-
if (this.isRecord) {
|
|
59647
|
-
if (record.className === 'Aggregator') {
|
|
59648
|
-
this.records.push(...record.records);
|
|
59649
|
-
}
|
|
59650
|
-
else {
|
|
59651
|
-
this.records.push(record);
|
|
59652
|
-
}
|
|
59653
|
-
}
|
|
59654
|
-
if (record.className === 'Aggregator') {
|
|
59655
|
-
this.max = record.max > this.max ? record.max : this.max;
|
|
59656
|
-
}
|
|
59657
|
-
else if (typeof record === 'number') {
|
|
59658
|
-
this.max = record > this.max ? record : this.max;
|
|
59659
|
-
}
|
|
59660
|
-
else if (typeof record[this.field] === 'number') {
|
|
59661
|
-
this.max = record[this.field] > this.max ? record[this.field] : this.max;
|
|
59662
|
-
}
|
|
59663
|
-
else if (!isNaN(record[this.field])) {
|
|
59664
|
-
this.max = parseFloat(record[this.field]) > this.max ? parseFloat(record[this.field]) : this.max;
|
|
59665
|
-
}
|
|
59666
|
-
}
|
|
59667
|
-
value() {
|
|
59668
|
-
return this.max;
|
|
59669
|
-
}
|
|
59670
|
-
reset() {
|
|
59671
|
-
this.records = [];
|
|
59672
|
-
this.max = Number.MIN_SAFE_INTEGER;
|
|
59673
|
-
}
|
|
59674
|
-
}
|
|
59675
|
-
class MinAggregator extends Aggregator {
|
|
59676
|
-
type = AggregationType.MIN;
|
|
59677
|
-
min = Number.MAX_SAFE_INTEGER;
|
|
59678
|
-
isRecord = false;
|
|
59679
|
-
push(record) {
|
|
59680
|
-
if (this.isRecord) {
|
|
59681
|
-
if (record.className === 'Aggregator') {
|
|
59682
|
-
this.records.push(...record.records);
|
|
59683
|
-
}
|
|
59684
|
-
else {
|
|
59685
|
-
this.records.push(record);
|
|
59686
|
-
}
|
|
59687
|
-
}
|
|
59688
|
-
if (record.className === 'Aggregator') {
|
|
59689
|
-
this.min = record.min < this.min ? record.min : this.min;
|
|
59690
|
-
}
|
|
59691
|
-
else if (typeof record === 'number') {
|
|
59692
|
-
this.min = record < this.min ? record : this.min;
|
|
59693
|
-
}
|
|
59694
|
-
else if (typeof record[this.field] === 'number') {
|
|
59695
|
-
this.min = record[this.field] < this.min ? record[this.field] : this.min;
|
|
59696
|
-
}
|
|
59697
|
-
}
|
|
59698
|
-
value() {
|
|
59699
|
-
return this.min;
|
|
59700
|
-
}
|
|
59701
|
-
reset() {
|
|
59702
|
-
this.records = [];
|
|
59703
|
-
this.min = Number.MAX_SAFE_INTEGER;
|
|
59704
|
-
}
|
|
59705
|
-
}
|
|
59706
|
-
function typeSort(a, b) {
|
|
59707
|
-
if (a && b) {
|
|
59708
|
-
return a.toString().localeCompare(b.toString(), 'zh');
|
|
59709
|
-
}
|
|
59710
|
-
if (a) {
|
|
59711
|
-
return 1;
|
|
59712
|
-
}
|
|
59713
|
-
return -1;
|
|
59714
|
-
}
|
|
59715
|
-
function naturalSort(as, bs) {
|
|
59716
|
-
const rx = /(\d+)|(\D+)/g;
|
|
59717
|
-
const rd = /\d/;
|
|
59718
|
-
const rz = /^0/;
|
|
59719
|
-
let a;
|
|
59720
|
-
let a1;
|
|
59721
|
-
let b;
|
|
59722
|
-
let b1;
|
|
59723
|
-
let nas = 0;
|
|
59724
|
-
let nbs = 0;
|
|
59725
|
-
if (bs !== null && as === null) {
|
|
59726
|
-
return -1;
|
|
59727
|
-
}
|
|
59728
|
-
if (as !== null && bs === null) {
|
|
59729
|
-
return 1;
|
|
59730
|
-
}
|
|
59731
|
-
if (typeof as === 'number' && isNaN(as)) {
|
|
59732
|
-
return -1;
|
|
59733
|
-
}
|
|
59734
|
-
if (typeof bs === 'number' && isNaN(bs)) {
|
|
59735
|
-
return 1;
|
|
59736
|
-
}
|
|
59737
|
-
nas = +as;
|
|
59738
|
-
nbs = +bs;
|
|
59739
|
-
if (nas < nbs) {
|
|
59740
|
-
return -1;
|
|
59741
|
-
}
|
|
59742
|
-
if (nas > nbs) {
|
|
59743
|
-
return 1;
|
|
59744
|
-
}
|
|
59745
|
-
if (typeof as === 'number' && typeof bs !== 'number') {
|
|
59746
|
-
return -1;
|
|
59747
|
-
}
|
|
59748
|
-
if (typeof bs === 'number' && typeof as !== 'number') {
|
|
59749
|
-
return 1;
|
|
59750
|
-
}
|
|
59751
|
-
if (typeof as === 'number' && typeof bs === 'number') {
|
|
59752
|
-
return 0;
|
|
59753
|
-
}
|
|
59754
|
-
if (isNaN(nbs) && !isNaN(nas)) {
|
|
59755
|
-
return -1;
|
|
59756
|
-
}
|
|
59757
|
-
if (isNaN(nas) && !isNaN(nbs)) {
|
|
59758
|
-
return 1;
|
|
59759
|
-
}
|
|
59760
|
-
a = String(as);
|
|
59761
|
-
b = String(bs);
|
|
59762
|
-
if (a === b) {
|
|
59763
|
-
return 0;
|
|
59764
|
-
}
|
|
59765
|
-
if (!(rd.test(a) && rd.test(b))) {
|
|
59766
|
-
return a > b ? 1 : -1;
|
|
59767
|
-
}
|
|
59768
|
-
a = a.match(rx);
|
|
59769
|
-
b = b.match(rx);
|
|
59770
|
-
while (a.length && b.length) {
|
|
59771
|
-
a1 = a.shift();
|
|
59772
|
-
b1 = b.shift();
|
|
59773
|
-
if (a1 !== b1) {
|
|
59774
|
-
if (rd.test(a1) && rd.test(b1)) {
|
|
59775
|
-
return a1.replace(rz, '.0') - b1.replace(rz, '.0');
|
|
59776
|
-
}
|
|
59777
|
-
return a1 > b1 ? 1 : -1;
|
|
59778
|
-
}
|
|
59779
|
-
}
|
|
59780
|
-
return a.length - b.length;
|
|
59781
|
-
}
|
|
59782
|
-
function sortBy(order) {
|
|
59783
|
-
let x;
|
|
59784
|
-
const mapping = {};
|
|
59785
|
-
const lowercase_mapping = {};
|
|
59786
|
-
for (let i = 0; i < order.length; i++) {
|
|
59787
|
-
x = order[i];
|
|
59788
|
-
mapping[x] = i;
|
|
59789
|
-
if (typeof x === 'string') {
|
|
59790
|
-
lowercase_mapping[x.toLowerCase()] = i;
|
|
59791
|
-
}
|
|
59792
|
-
}
|
|
59793
|
-
return function (a, b) {
|
|
59794
|
-
if (mapping[a] !== null && mapping[a] !== undefined && mapping[b] !== null && mapping[b] !== undefined) {
|
|
59795
|
-
return mapping[a] - mapping[b];
|
|
59796
|
-
}
|
|
59797
|
-
else if (mapping[a] !== null && mapping[a] !== undefined) {
|
|
59798
|
-
return -1;
|
|
59799
|
-
}
|
|
59800
|
-
else if (mapping[b] !== null && mapping[b] !== undefined) {
|
|
59801
|
-
return 1;
|
|
59802
|
-
}
|
|
59803
|
-
else if (lowercase_mapping[a] !== null &&
|
|
59804
|
-
mapping[a] !== undefined &&
|
|
59805
|
-
lowercase_mapping[b] !== null &&
|
|
59806
|
-
mapping[b] !== undefined) {
|
|
59807
|
-
return lowercase_mapping[a] - lowercase_mapping[b];
|
|
59808
|
-
}
|
|
59809
|
-
else if (lowercase_mapping[a] === null ||
|
|
59810
|
-
mapping[a] === undefined ||
|
|
59811
|
-
lowercase_mapping[b] === null ||
|
|
59812
|
-
mapping[b] === undefined) {
|
|
59813
|
-
return 0;
|
|
59814
|
-
}
|
|
59815
|
-
else if (lowercase_mapping[a] !== null && mapping[a] !== undefined) {
|
|
59816
|
-
return -1;
|
|
59817
|
-
}
|
|
59818
|
-
else if (lowercase_mapping[b] !== null && mapping[b] !== undefined) {
|
|
59819
|
-
return 1;
|
|
59820
|
-
}
|
|
59821
|
-
return naturalSort(a, b);
|
|
59822
|
-
};
|
|
59823
|
-
}
|
|
59824
|
-
|
|
59825
60563
|
class Dataset {
|
|
59826
60564
|
dataConfig;
|
|
59827
60565
|
records;
|
|
@@ -60337,6 +61075,8 @@
|
|
|
60337
61075
|
formatFun: agg.formatFun,
|
|
60338
61076
|
records: agg.records,
|
|
60339
61077
|
className: '',
|
|
61078
|
+
recalculate() {
|
|
61079
|
+
},
|
|
60340
61080
|
push() {
|
|
60341
61081
|
},
|
|
60342
61082
|
clearCacheValue() {
|
|
@@ -60352,6 +61092,8 @@
|
|
|
60352
61092
|
className: '',
|
|
60353
61093
|
push() {
|
|
60354
61094
|
},
|
|
61095
|
+
recalculate() {
|
|
61096
|
+
},
|
|
60355
61097
|
formatValue() {
|
|
60356
61098
|
return changeValue;
|
|
60357
61099
|
},
|
|
@@ -60367,6 +61109,8 @@
|
|
|
60367
61109
|
className: '',
|
|
60368
61110
|
push() {
|
|
60369
61111
|
},
|
|
61112
|
+
recalculate() {
|
|
61113
|
+
},
|
|
60370
61114
|
value() {
|
|
60371
61115
|
return null;
|
|
60372
61116
|
},
|
|
@@ -60916,10 +61660,12 @@
|
|
|
60916
61660
|
this.pagination = options.pagination;
|
|
60917
61661
|
this.internalProps.columnResizeType = options.columnResizeType ?? 'column';
|
|
60918
61662
|
this.internalProps.dataConfig = cloneDeep(options.dataConfig);
|
|
60919
|
-
this.internalProps.enableDataAnalysis = options.enableDataAnalysis;
|
|
60920
61663
|
if (!options.rowTree && !options.columnTree) {
|
|
60921
61664
|
this.internalProps.enableDataAnalysis = true;
|
|
60922
61665
|
}
|
|
61666
|
+
else {
|
|
61667
|
+
this.internalProps.enableDataAnalysis = false;
|
|
61668
|
+
}
|
|
60923
61669
|
const records = this.internalProps.records;
|
|
60924
61670
|
if (this.internalProps.enableDataAnalysis && (options.rows || options.columns)) {
|
|
60925
61671
|
const rowKeys = options.rows?.reduce((keys, rowObj) => {
|
|
@@ -60997,6 +61743,9 @@
|
|
|
60997
61743
|
isPivotChart() {
|
|
60998
61744
|
return false;
|
|
60999
61745
|
}
|
|
61746
|
+
get recordsCount() {
|
|
61747
|
+
return this.records?.length;
|
|
61748
|
+
}
|
|
61000
61749
|
_canResizeColumn(col, row) {
|
|
61001
61750
|
const ifCan = super._canResizeColumn(col, row);
|
|
61002
61751
|
if (ifCan) {
|
|
@@ -61029,10 +61778,12 @@
|
|
|
61029
61778
|
this.pagination = options.pagination;
|
|
61030
61779
|
internalProps.columnResizeType = options.columnResizeType ?? 'column';
|
|
61031
61780
|
internalProps.dataConfig = cloneDeep(options.dataConfig);
|
|
61032
|
-
internalProps.enableDataAnalysis = options.enableDataAnalysis;
|
|
61033
61781
|
if (!options.rowTree && !options.columnTree) {
|
|
61034
61782
|
internalProps.enableDataAnalysis = true;
|
|
61035
61783
|
}
|
|
61784
|
+
else {
|
|
61785
|
+
internalProps.enableDataAnalysis = false;
|
|
61786
|
+
}
|
|
61036
61787
|
if (options?.rowHierarchyType === 'tree' &&
|
|
61037
61788
|
this.internalProps.layoutMap.rowHierarchyType === 'tree' &&
|
|
61038
61789
|
this.internalProps.layoutMap.rowExpandLevel === options?.rowExpandLevel) {
|
|
@@ -61526,6 +62277,14 @@
|
|
|
61526
62277
|
getHierarchyState(col, row) {
|
|
61527
62278
|
return this._getHeaderLayoutMap(col, row)?.hierarchyState;
|
|
61528
62279
|
}
|
|
62280
|
+
getLayoutColumnTree() {
|
|
62281
|
+
const layoutMap = this.internalProps.layoutMap;
|
|
62282
|
+
return layoutMap.getLayoutColumnTree();
|
|
62283
|
+
}
|
|
62284
|
+
getLayoutColumnTreeCount() {
|
|
62285
|
+
const layoutMap = this.internalProps.layoutMap;
|
|
62286
|
+
return layoutMap.getLayoutColumnTreeCount();
|
|
62287
|
+
}
|
|
61529
62288
|
getLayoutRowTree() {
|
|
61530
62289
|
const layoutMap = this.internalProps.layoutMap;
|
|
61531
62290
|
return layoutMap.getLayoutRowTree();
|
|
@@ -61744,7 +62503,7 @@
|
|
|
61744
62503
|
this.records[rowIndex][colIndex] = newValue;
|
|
61745
62504
|
}
|
|
61746
62505
|
}
|
|
61747
|
-
|
|
62506
|
+
_hasCustomRenderOrLayout() {
|
|
61748
62507
|
if (this.options.customRender) {
|
|
61749
62508
|
return true;
|
|
61750
62509
|
}
|
|
@@ -61860,6 +62619,9 @@
|
|
|
61860
62619
|
get pivotChartAxes() {
|
|
61861
62620
|
return this._axes;
|
|
61862
62621
|
}
|
|
62622
|
+
get recordsCount() {
|
|
62623
|
+
return this.records?.length;
|
|
62624
|
+
}
|
|
61863
62625
|
isListTable() {
|
|
61864
62626
|
return false;
|
|
61865
62627
|
}
|
|
@@ -62631,7 +63393,7 @@
|
|
|
62631
63393
|
}
|
|
62632
63394
|
this.eventManager.updateEventBinder();
|
|
62633
63395
|
}
|
|
62634
|
-
|
|
63396
|
+
_hasCustomRenderOrLayout() {
|
|
62635
63397
|
if (this.options.customRender) {
|
|
62636
63398
|
return true;
|
|
62637
63399
|
}
|
|
@@ -63169,7 +63931,7 @@
|
|
|
63169
63931
|
}
|
|
63170
63932
|
|
|
63171
63933
|
registerForVrender();
|
|
63172
|
-
const version = "0.
|
|
63934
|
+
const version = "0.20.0";
|
|
63173
63935
|
function getIcons() {
|
|
63174
63936
|
return get$1();
|
|
63175
63937
|
}
|