@visactor/vtable 1.7.5-alpha.1 → 1.7.6
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 +2 -2
- package/cjs/ListTable.js +34 -22
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotTable.d.ts +1 -0
- package/cjs/PivotTable.js +4 -0
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/body-helper/body-helper.js +2 -2
- package/cjs/body-helper/body-helper.js.map +1 -1
- package/cjs/components/axis/axis.d.ts +1 -0
- package/cjs/components/axis/axis.js +14 -10
- package/cjs/components/axis/axis.js.map +1 -1
- package/cjs/core/BaseTable.js +7 -5
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/record-helper.js +9 -11
- package/cjs/core/record-helper.js.map +1 -1
- package/cjs/data/CachedDataSource.d.ts +1 -1
- package/cjs/data/CachedDataSource.js +4 -4
- package/cjs/data/CachedDataSource.js.map +1 -1
- package/cjs/data/DataSource.d.ts +3 -5
- package/cjs/data/DataSource.js +49 -30
- package/cjs/data/DataSource.js.map +1 -1
- package/cjs/dataset/dataset.d.ts +1 -0
- package/cjs/dataset/dataset.js +15 -7
- package/cjs/dataset/dataset.js.map +1 -1
- package/cjs/event/EventHandler.js +1 -1
- package/cjs/event/EventHandler.js.map +1 -1
- package/cjs/event/listener/table-group.js +37 -25
- package/cjs/event/listener/table-group.js.map +1 -1
- package/cjs/event/scroll.js +2 -1
- package/cjs/event/scroll.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-axis-config.js +26 -13
- package/cjs/layout/chart-helper/get-axis-config.js.map +1 -1
- package/cjs/layout/chart-helper/get-chart-spec.js +1 -1
- package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
- package/cjs/layout/pivot-header-layout.js +15 -12
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/layout/tree-helper.js +10 -4
- package/cjs/layout/tree-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js +14 -10
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js +1 -1
- package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/column-helper.js +6 -5
- package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
- package/cjs/scenegraph/icon/icon-update.d.ts +10 -1
- package/cjs/scenegraph/icon/icon-update.js +4 -4
- package/cjs/scenegraph/icon/icon-update.js.map +1 -1
- package/cjs/scenegraph/layout/update-height.js +1 -1
- package/cjs/scenegraph/layout/update-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-width.js +5 -5
- package/cjs/scenegraph/layout/update-width.js.map +1 -1
- package/cjs/scenegraph/refresh-node/update-chart.js +2 -1
- package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +9 -1
- package/cjs/scenegraph/scenegraph.js +12 -2
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/style/frame-border.js +6 -5
- package/cjs/scenegraph/style/frame-border.js.map +1 -1
- package/cjs/state/sort/index.js +17 -6
- package/cjs/state/sort/index.js.map +1 -1
- package/cjs/state/state.d.ts +4 -4
- package/cjs/state/state.js +87 -17
- package/cjs/state/state.js.map +1 -1
- package/cjs/themes/theme.d.ts +2 -1
- package/cjs/themes/theme.js +10 -7
- package/cjs/themes/theme.js.map +1 -1
- package/cjs/tools/util.d.ts +1 -0
- package/cjs/tools/util.js +7 -2
- package/cjs/tools/util.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +1 -0
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +5 -1
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/vrender.js +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +437 -227
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.d.ts +2 -2
- package/es/ListTable.js +33 -20
- package/es/ListTable.js.map +1 -1
- package/es/PivotTable.d.ts +1 -0
- package/es/PivotTable.js +4 -0
- package/es/PivotTable.js.map +1 -1
- package/es/body-helper/body-helper.js +3 -1
- package/es/body-helper/body-helper.js.map +1 -1
- package/es/components/axis/axis.d.ts +1 -0
- package/es/components/axis/axis.js +14 -10
- package/es/components/axis/axis.js.map +1 -1
- package/es/core/BaseTable.js +7 -5
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/record-helper.js +9 -11
- package/es/core/record-helper.js.map +1 -1
- package/es/data/CachedDataSource.d.ts +1 -1
- package/es/data/CachedDataSource.js +4 -4
- package/es/data/CachedDataSource.js.map +1 -1
- package/es/data/DataSource.d.ts +3 -5
- package/es/data/DataSource.js +49 -28
- package/es/data/DataSource.js.map +1 -1
- package/es/dataset/dataset.d.ts +1 -0
- package/es/dataset/dataset.js +15 -7
- package/es/dataset/dataset.js.map +1 -1
- package/es/event/EventHandler.js +1 -1
- package/es/event/EventHandler.js.map +1 -1
- package/es/event/listener/table-group.js +38 -26
- package/es/event/listener/table-group.js.map +1 -1
- package/es/event/scroll.js +2 -1
- package/es/event/scroll.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-axis-config.js +23 -12
- package/es/layout/chart-helper/get-axis-config.js.map +1 -1
- package/es/layout/chart-helper/get-chart-spec.js +1 -1
- package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
- package/es/layout/pivot-header-layout.js +14 -12
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/layout/tree-helper.js +10 -4
- package/es/layout/tree-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.js +14 -9
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/spark-line-cell.js +1 -1
- package/es/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
- package/es/scenegraph/group-creater/column-helper.js +6 -5
- package/es/scenegraph/group-creater/column-helper.js.map +1 -1
- package/es/scenegraph/icon/icon-update.d.ts +10 -1
- package/es/scenegraph/icon/icon-update.js +5 -3
- package/es/scenegraph/icon/icon-update.js.map +1 -1
- package/es/scenegraph/layout/update-height.js +1 -1
- package/es/scenegraph/layout/update-height.js.map +1 -1
- package/es/scenegraph/layout/update-width.js +5 -5
- package/es/scenegraph/layout/update-width.js.map +1 -1
- package/es/scenegraph/refresh-node/update-chart.js +2 -1
- package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
- package/es/scenegraph/scenegraph.d.ts +9 -1
- package/es/scenegraph/scenegraph.js +12 -2
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/style/frame-border.js +4 -3
- package/es/scenegraph/style/frame-border.js.map +1 -1
- package/es/state/sort/index.js +17 -6
- package/es/state/sort/index.js.map +1 -1
- package/es/state/state.d.ts +4 -4
- package/es/state/state.js +88 -16
- package/es/state/state.js.map +1 -1
- package/es/themes/theme.d.ts +2 -1
- package/es/themes/theme.js +10 -7
- package/es/themes/theme.js.map +1 -1
- package/es/tools/util.d.ts +1 -0
- package/es/tools/util.js +4 -0
- package/es/tools/util.js.map +1 -1
- package/es/ts-types/base-table.d.ts +1 -0
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +5 -1
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/vrender.js +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +6 -6
package/dist/vtable.js
CHANGED
|
@@ -25564,6 +25564,7 @@
|
|
|
25564
25564
|
registerText();
|
|
25565
25565
|
registerFlexLayoutPlugin();
|
|
25566
25566
|
loadPoptip();
|
|
25567
|
+
registerFlexLayoutPlugin();
|
|
25567
25568
|
}
|
|
25568
25569
|
|
|
25569
25570
|
var InteractionState;
|
|
@@ -26647,6 +26648,12 @@
|
|
|
26647
26648
|
}
|
|
26648
26649
|
return false;
|
|
26649
26650
|
}
|
|
26651
|
+
function traverseObject(obj, childrenProperty, callback) {
|
|
26652
|
+
callback(obj);
|
|
26653
|
+
if (obj?.[childrenProperty] && Array.isArray(obj?.[childrenProperty])) {
|
|
26654
|
+
obj[childrenProperty].forEach((child) => traverseObject(child, childrenProperty, callback));
|
|
26655
|
+
}
|
|
26656
|
+
}
|
|
26650
26657
|
|
|
26651
26658
|
const isNode = typeof window === 'undefined' || typeof window.window === 'undefined';
|
|
26652
26659
|
let arrayFind;
|
|
@@ -27174,7 +27181,7 @@
|
|
|
27174
27181
|
if (Env.mode === 'node') {
|
|
27175
27182
|
return;
|
|
27176
27183
|
}
|
|
27177
|
-
if (id
|
|
27184
|
+
if (id === null) {
|
|
27178
27185
|
return;
|
|
27179
27186
|
}
|
|
27180
27187
|
const obj = this.listeners?.[id];
|
|
@@ -28017,6 +28024,9 @@
|
|
|
28017
28024
|
getExtendTheme() {
|
|
28018
28025
|
return this.internalTheme.obj;
|
|
28019
28026
|
}
|
|
28027
|
+
clearBodyStyleCache() {
|
|
28028
|
+
this._body = null;
|
|
28029
|
+
}
|
|
28020
28030
|
get font() {
|
|
28021
28031
|
const { obj, superTheme } = this.internalTheme;
|
|
28022
28032
|
return getProp$1(obj, superTheme, ['font'], ['bodyStyle', 'font']);
|
|
@@ -28175,14 +28185,6 @@
|
|
|
28175
28185
|
}
|
|
28176
28186
|
return this._defaultStyle;
|
|
28177
28187
|
}
|
|
28178
|
-
get headerStyle() {
|
|
28179
|
-
if (!this._header) {
|
|
28180
|
-
const { obj, superTheme } = this.internalTheme;
|
|
28181
|
-
const header = ingoreNoneValueMerge({}, this.defaultStyle, superTheme.headerStyle, obj.headerStyle);
|
|
28182
|
-
this._header = this.getStyle(header);
|
|
28183
|
-
}
|
|
28184
|
-
return this._header;
|
|
28185
|
-
}
|
|
28186
28188
|
get cornerHeaderStyle() {
|
|
28187
28189
|
if (!this._cornerHeader) {
|
|
28188
28190
|
const { obj, superTheme } = this.internalTheme;
|
|
@@ -28254,6 +28256,14 @@
|
|
|
28254
28256
|
}
|
|
28255
28257
|
return this._rowHeader;
|
|
28256
28258
|
}
|
|
28259
|
+
get headerStyle() {
|
|
28260
|
+
if (!this._header) {
|
|
28261
|
+
const { obj, superTheme } = this.internalTheme;
|
|
28262
|
+
const header = ingoreNoneValueMerge({}, this.defaultStyle, superTheme.headerStyle, obj.headerStyle);
|
|
28263
|
+
this._header = this.getStyle(header);
|
|
28264
|
+
}
|
|
28265
|
+
return this._header;
|
|
28266
|
+
}
|
|
28257
28267
|
get bodyStyle() {
|
|
28258
28268
|
if (!this._body) {
|
|
28259
28269
|
const { obj, superTheme } = this.internalTheme;
|
|
@@ -29506,9 +29516,7 @@
|
|
|
29506
29516
|
_sourceLength;
|
|
29507
29517
|
_source;
|
|
29508
29518
|
sortedIndexMap;
|
|
29509
|
-
|
|
29510
|
-
lastOrderFn;
|
|
29511
|
-
lastOrderField;
|
|
29519
|
+
lastSortStates;
|
|
29512
29520
|
currentIndexedData = [];
|
|
29513
29521
|
userPagination;
|
|
29514
29522
|
pagination;
|
|
@@ -29827,14 +29835,15 @@
|
|
|
29827
29835
|
const children = nodeData.filteredChildren ? nodeData.filteredChildren : nodeData.children;
|
|
29828
29836
|
if (children) {
|
|
29829
29837
|
const subNodeSortedIndexArray = Array.from({ length: children.length }, (_, i) => i);
|
|
29830
|
-
this.
|
|
29831
|
-
|
|
29832
|
-
|
|
29833
|
-
|
|
29834
|
-
|
|
29835
|
-
|
|
29836
|
-
|
|
29837
|
-
}
|
|
29838
|
+
this.lastSortStates?.forEach(state => {
|
|
29839
|
+
if (state.order !== 'normal') {
|
|
29840
|
+
sort(index => isValid$1(subNodeSortedIndexArray[index])
|
|
29841
|
+
? subNodeSortedIndexArray[index]
|
|
29842
|
+
: (subNodeSortedIndexArray[index] = index), (index, rel) => {
|
|
29843
|
+
subNodeSortedIndexArray[index] = rel;
|
|
29844
|
+
}, children.length, state.orderFn, state.order, index => this.getOriginalField(Array.isArray(indexKey) ? indexKey.concat([index]) : [indexKey, index], state.field));
|
|
29845
|
+
}
|
|
29846
|
+
});
|
|
29838
29847
|
for (let i = 0; i < subNodeSortedIndexArray.length; i++) {
|
|
29839
29848
|
childrenLength += 1;
|
|
29840
29849
|
const childIndex = Array.isArray(indexKey)
|
|
@@ -30082,16 +30091,19 @@
|
|
|
30082
30091
|
}
|
|
30083
30092
|
this.sortedIndexMap.clear();
|
|
30084
30093
|
}
|
|
30085
|
-
sort(
|
|
30086
|
-
|
|
30087
|
-
|
|
30088
|
-
|
|
30089
|
-
|
|
30090
|
-
this.
|
|
30091
|
-
let
|
|
30092
|
-
let orderedData;
|
|
30093
|
-
if (
|
|
30094
|
-
orderedData =
|
|
30094
|
+
sort(states) {
|
|
30095
|
+
states = (Array.isArray(states) ? states : [states]).filter(state => {
|
|
30096
|
+
let column = this.layoutColumnObjects.find(obj => obj.field == state.field);
|
|
30097
|
+
return column?.define?.sort !== false && state.order !== 'normal';
|
|
30098
|
+
});
|
|
30099
|
+
this.lastSortStates = states;
|
|
30100
|
+
let filedMapArray = states.map(state => this.sortedIndexMap.get(state?.field) || { asc: [], desc: [], normal: [] });
|
|
30101
|
+
let orderedData = null;
|
|
30102
|
+
if (filedMapArray.length > 0) {
|
|
30103
|
+
orderedData = states.reduce((data, state, index) => {
|
|
30104
|
+
const currentData = filedMapArray[index]?.[state.order];
|
|
30105
|
+
return currentData && currentData.length > 0 ? currentData : data;
|
|
30106
|
+
}, null);
|
|
30095
30107
|
if (orderedData && orderedData.length > 0) {
|
|
30096
30108
|
this.currentIndexedData = orderedData;
|
|
30097
30109
|
this.updatePagerData();
|
|
@@ -30099,21 +30111,22 @@
|
|
|
30099
30111
|
return;
|
|
30100
30112
|
}
|
|
30101
30113
|
}
|
|
30102
|
-
const sortedIndexArray =
|
|
30103
|
-
|
|
30104
|
-
|
|
30105
|
-
|
|
30106
|
-
|
|
30107
|
-
|
|
30108
|
-
|
|
30109
|
-
|
|
30110
|
-
|
|
30111
|
-
|
|
30112
|
-
|
|
30114
|
+
const sortedIndexArray = Array.from({ length: this._sourceLength }, (_, i) => i);
|
|
30115
|
+
sortedIndexArray.sort((indexA, indexB) => {
|
|
30116
|
+
return states.reduce((result, state) => {
|
|
30117
|
+
if (result !== 0) {
|
|
30118
|
+
return result;
|
|
30119
|
+
}
|
|
30120
|
+
const orderFn = state.orderFn ||
|
|
30121
|
+
(state.order !== 'desc'
|
|
30122
|
+
? (v1, v2) => (v1 === v2 ? 0 : v1 > v2 ? 1 : -1)
|
|
30123
|
+
: (v1, v2) => (v1 === v2 ? 0 : v1 < v2 ? 1 : -1));
|
|
30124
|
+
return orderFn(this.getOriginalField(indexA, state.field), this.getOriginalField(indexB, state.field), state.order);
|
|
30125
|
+
}, 0);
|
|
30126
|
+
});
|
|
30113
30127
|
this.currentIndexedData = sortedIndexArray;
|
|
30114
30128
|
if (this.hierarchyExpandLevel) {
|
|
30115
30129
|
let nodeLength = sortedIndexArray.length;
|
|
30116
|
-
window.performance.now();
|
|
30117
30130
|
for (let i = 0; i < nodeLength; i++) {
|
|
30118
30131
|
const record = this.getOriginalRecord(sortedIndexArray[i]);
|
|
30119
30132
|
const subNodeLength = this.pushChildrenNode(sortedIndexArray[i], record.hierarchyState, this.getOriginalRecord(sortedIndexArray[i]));
|
|
@@ -30121,11 +30134,16 @@
|
|
|
30121
30134
|
i += subNodeLength;
|
|
30122
30135
|
}
|
|
30123
30136
|
}
|
|
30124
|
-
if (!
|
|
30125
|
-
|
|
30126
|
-
|
|
30137
|
+
if (!filedMapArray.length) {
|
|
30138
|
+
filedMapArray = states.map(() => ({ asc: [], desc: [], normal: [] }));
|
|
30139
|
+
for (let index = 0; index < states.length; index++) {
|
|
30140
|
+
this.sortedIndexMap.set(states[index].field, filedMapArray[index]);
|
|
30141
|
+
}
|
|
30127
30142
|
}
|
|
30128
|
-
|
|
30143
|
+
states.forEach((state, index) => {
|
|
30144
|
+
const mapItem = filedMapArray[index];
|
|
30145
|
+
mapItem[state.order] = sortedIndexArray.slice();
|
|
30146
|
+
});
|
|
30129
30147
|
this.updatePagerData();
|
|
30130
30148
|
this.fireListeners(EVENT_TYPE$1.CHANGE_ORDER, null);
|
|
30131
30149
|
}
|
|
@@ -30187,22 +30205,27 @@
|
|
|
30187
30205
|
}
|
|
30188
30206
|
}
|
|
30189
30207
|
clearSortedIndexMap() {
|
|
30190
|
-
if (this.
|
|
30208
|
+
if (this.lastSortStates && this.lastSortStates.length > 0) {
|
|
30191
30209
|
this.sortedIndexMap.forEach((sortMap, key) => {
|
|
30192
|
-
|
|
30210
|
+
const isFieldInRules = this.lastSortStates.some(state => state.field === key);
|
|
30211
|
+
if (!isFieldInRules) {
|
|
30193
30212
|
this.sortedIndexMap.delete(key);
|
|
30194
30213
|
}
|
|
30195
|
-
else if (this.lastOrder === 'asc') {
|
|
30196
|
-
sortMap.desc = [];
|
|
30197
|
-
sortMap.normal = [];
|
|
30198
|
-
}
|
|
30199
|
-
else if (this.lastOrder === 'desc') {
|
|
30200
|
-
sortMap.asc = [];
|
|
30201
|
-
sortMap.normal = [];
|
|
30202
|
-
}
|
|
30203
30214
|
else {
|
|
30204
|
-
|
|
30205
|
-
|
|
30215
|
+
this.lastSortStates.forEach(state => {
|
|
30216
|
+
if (state.order === 'asc') {
|
|
30217
|
+
sortMap.desc = [];
|
|
30218
|
+
sortMap.normal = [];
|
|
30219
|
+
}
|
|
30220
|
+
else if (state.order === 'desc') {
|
|
30221
|
+
sortMap.asc = [];
|
|
30222
|
+
sortMap.normal = [];
|
|
30223
|
+
}
|
|
30224
|
+
else {
|
|
30225
|
+
sortMap.asc = [];
|
|
30226
|
+
sortMap.desc = [];
|
|
30227
|
+
}
|
|
30228
|
+
});
|
|
30206
30229
|
}
|
|
30207
30230
|
});
|
|
30208
30231
|
}
|
|
@@ -30363,7 +30386,7 @@
|
|
|
30363
30386
|
return true;
|
|
30364
30387
|
}
|
|
30365
30388
|
reorderRecord(sourceIndex, targetIndex) {
|
|
30366
|
-
if (this.
|
|
30389
|
+
if (this.lastSortStates?.some(state => state.order === 'asc' || state.order === 'desc')) {
|
|
30367
30390
|
return;
|
|
30368
30391
|
}
|
|
30369
30392
|
else if (this.isCanExchangeOrder(sourceIndex, targetIndex)) {
|
|
@@ -30558,7 +30581,7 @@
|
|
|
30558
30581
|
_setFieldCache(this._fieldCache, index, field, value);
|
|
30559
30582
|
}
|
|
30560
30583
|
recordPromiseCallBack(index, record) {
|
|
30561
|
-
this._recordCache[index] = record;
|
|
30584
|
+
this._recordCache && (this._recordCache[index] = record);
|
|
30562
30585
|
}
|
|
30563
30586
|
get records() {
|
|
30564
30587
|
return Array.isArray(this._recordCache) && this._recordCache.length > 0 ? this._recordCache : super.records;
|
|
@@ -30615,11 +30638,14 @@
|
|
|
30615
30638
|
this.initTreeHierarchyState();
|
|
30616
30639
|
this.updatePagerData();
|
|
30617
30640
|
}
|
|
30618
|
-
addRecordsForGroup(recordArr) {
|
|
30641
|
+
addRecordsForGroup(recordArr, recordIndex) {
|
|
30619
30642
|
if (!isArray$1(recordArr) || recordArr.length === 0) {
|
|
30620
30643
|
return;
|
|
30621
30644
|
}
|
|
30622
|
-
this.dataSourceObj.records
|
|
30645
|
+
if (recordIndex === undefined || recordIndex > this.dataSourceObj.records) {
|
|
30646
|
+
recordIndex = this.dataSourceObj.records;
|
|
30647
|
+
}
|
|
30648
|
+
this.dataSourceObj.records.splice(recordIndex, 0, ...recordArr);
|
|
30623
30649
|
this.updateGroup();
|
|
30624
30650
|
}
|
|
30625
30651
|
deleteRecordsForGroup(recordIndexs) {
|
|
@@ -34013,11 +34039,14 @@
|
|
|
34013
34039
|
|
|
34014
34040
|
function createCell(type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme, range, customResult) {
|
|
34015
34041
|
let isAsync = false;
|
|
34042
|
+
let cellGroup;
|
|
34016
34043
|
if (isPromise(value)) {
|
|
34044
|
+
if (table.scenegraph.highPerformanceGetCell(col, row).role !== 'cell') {
|
|
34045
|
+
return cellGroup;
|
|
34046
|
+
}
|
|
34017
34047
|
value = table.getCellValue(col, row);
|
|
34018
34048
|
isAsync = true;
|
|
34019
34049
|
}
|
|
34020
|
-
let cellGroup;
|
|
34021
34050
|
if (type === 'text' || type === 'link' || customResult) {
|
|
34022
34051
|
if (type === 'link') {
|
|
34023
34052
|
const cellValue = value;
|
|
@@ -34071,7 +34100,7 @@
|
|
|
34071
34100
|
const axisConfig = table.internalProps.layoutMap.getAxisConfigInPivotChart(col, row);
|
|
34072
34101
|
if (axisConfig) {
|
|
34073
34102
|
const CartesianAxis = Factory.getComponent('axis');
|
|
34074
|
-
const axis = new CartesianAxis(axisConfig, cellGroup.attribute.width, cellGroup.attribute.height, padding, table);
|
|
34103
|
+
const axis = new CartesianAxis(axisConfig, cellGroup.attribute.width, cellGroup.attribute.height, axisConfig.__vtablePadding ?? padding, table);
|
|
34075
34104
|
cellGroup.clear();
|
|
34076
34105
|
cellGroup.appendChild(axis.component);
|
|
34077
34106
|
axis.overlap();
|
|
@@ -34137,6 +34166,7 @@
|
|
|
34137
34166
|
let cellTheme;
|
|
34138
34167
|
let customStyle;
|
|
34139
34168
|
let customResult;
|
|
34169
|
+
let isCustomMerge = false;
|
|
34140
34170
|
if (table.internalProps.customMergeCell) {
|
|
34141
34171
|
const customMerge = table.getCustomMerge(col, row);
|
|
34142
34172
|
if (customMerge) {
|
|
@@ -34152,6 +34182,7 @@
|
|
|
34152
34182
|
if (customLayout || customRender) {
|
|
34153
34183
|
customResult = dealWithCustom(customLayout, customRender, customMergeRange.start.col, customMergeRange.start.row, table.getColsWidth(customMergeRange.start.col, customMergeRange.end.col), table.getRowsHeight(customMergeRange.start.row, customMergeRange.end.row), false, table.isAutoRowHeight(row), [0, 0, 0, 0], range, table);
|
|
34154
34184
|
}
|
|
34185
|
+
isCustomMerge = true;
|
|
34155
34186
|
}
|
|
34156
34187
|
}
|
|
34157
34188
|
let colForDefine = col;
|
|
@@ -34171,10 +34202,10 @@
|
|
|
34171
34202
|
range = table.getCellRange(col, row);
|
|
34172
34203
|
isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;
|
|
34173
34204
|
}
|
|
34174
|
-
let
|
|
34205
|
+
let isVtableMerge = false;
|
|
34175
34206
|
if (table.internalProps.enableTreeNodeMerge && isMerge) {
|
|
34176
34207
|
const { vtableMergeName, vtableMerge } = table.getCellRawRecord(range.start.col, range.start.row);
|
|
34177
|
-
|
|
34208
|
+
isVtableMerge = vtableMerge;
|
|
34178
34209
|
if (vtableMerge) {
|
|
34179
34210
|
mayHaveIcon = true;
|
|
34180
34211
|
if (table.options.groupTitleCustomLayout) {
|
|
@@ -34270,7 +34301,7 @@
|
|
|
34270
34301
|
if (!addNew && oldCellGroup.role === 'empty') {
|
|
34271
34302
|
return undefined;
|
|
34272
34303
|
}
|
|
34273
|
-
const type =
|
|
34304
|
+
const type = isVtableMerge || isCustomMerge
|
|
34274
34305
|
? 'text'
|
|
34275
34306
|
: table.isHeader(col, row)
|
|
34276
34307
|
? table._getHeaderLayoutMap(col, row).headerType
|
|
@@ -35438,8 +35469,9 @@
|
|
|
35438
35469
|
}
|
|
35439
35470
|
cell.needUpdateHeight = false;
|
|
35440
35471
|
cell.setAttribute('height', distHeight);
|
|
35441
|
-
const
|
|
35442
|
-
const
|
|
35472
|
+
const isVtableMerge = scene.table.getCellRawRecord(col, row)?.vtableMerge;
|
|
35473
|
+
const isCustomMerge = !!scene.table.getCustomMerge(col, row);
|
|
35474
|
+
const type = isVtableMerge || isCustomMerge
|
|
35443
35475
|
? 'text'
|
|
35444
35476
|
: scene.table.isHeader(col, row)
|
|
35445
35477
|
? scene.table._getHeaderLayoutMap(col, row).headerType
|
|
@@ -35779,8 +35811,9 @@
|
|
|
35779
35811
|
return false;
|
|
35780
35812
|
}
|
|
35781
35813
|
const autoRowHeight = scene.table.isAutoRowHeight(row);
|
|
35782
|
-
const
|
|
35783
|
-
const
|
|
35814
|
+
const isVtableMerge = scene.table.getCellRawRecord(col, row)?.vtableMerge;
|
|
35815
|
+
const isCustomMerge = !!scene.table.getCustomMerge(col, row);
|
|
35816
|
+
const type = isVtableMerge || isCustomMerge
|
|
35784
35817
|
? 'text'
|
|
35785
35818
|
: scene.table.isHeader(col, row)
|
|
35786
35819
|
? scene.table._getHeaderLayoutMap(col, row).headerType
|
|
@@ -35822,7 +35855,7 @@
|
|
|
35822
35855
|
const padding = getQuadProps(getProp('padding', cellStyle, col, row, scene.table));
|
|
35823
35856
|
if (axisConfig) {
|
|
35824
35857
|
const CartesianAxis = Factory.getComponent('axis');
|
|
35825
|
-
const axis = new CartesianAxis(axisConfig, cellGroup.attribute.width, cellGroup.attribute.height, padding, scene.table);
|
|
35858
|
+
const axis = new CartesianAxis(axisConfig, cellGroup.attribute.width, cellGroup.attribute.height, axisConfig.__vtablePadding ?? padding, scene.table);
|
|
35826
35859
|
cellGroup.clear();
|
|
35827
35860
|
cellGroup.appendChild(axis.component);
|
|
35828
35861
|
axis.overlap();
|
|
@@ -37216,7 +37249,7 @@
|
|
|
37216
37249
|
if (borderLineWidth) {
|
|
37217
37250
|
rectAttributes.stroke = true;
|
|
37218
37251
|
rectAttributes.fill = false;
|
|
37219
|
-
rectAttributes.stroke = getStroke(borderColor, strokeArray, borderLineWidth);
|
|
37252
|
+
rectAttributes.stroke = getStroke(borderColor ?? '#E1E4E8', strokeArray, borderLineWidth);
|
|
37220
37253
|
rectAttributes.lineWidth = borderLineWidth;
|
|
37221
37254
|
borderLineDash && (rectAttributes.lineDash = borderLineDash);
|
|
37222
37255
|
rectAttributes.lineCap = 'butt';
|
|
@@ -37340,6 +37373,9 @@
|
|
|
37340
37373
|
}
|
|
37341
37374
|
}
|
|
37342
37375
|
function updateFrameBorder(group, frameTheme, strokeArray) {
|
|
37376
|
+
if (!frameTheme) {
|
|
37377
|
+
return;
|
|
37378
|
+
}
|
|
37343
37379
|
const { borderColor } = frameTheme;
|
|
37344
37380
|
group.border?.setAttribute('stroke', getStroke(borderColor, strokeArray));
|
|
37345
37381
|
}
|
|
@@ -39769,6 +39805,7 @@
|
|
|
39769
39805
|
let isMerge;
|
|
39770
39806
|
let customStyle;
|
|
39771
39807
|
let customResult;
|
|
39808
|
+
let isCustomMerge = false;
|
|
39772
39809
|
if (table.internalProps.customMergeCell) {
|
|
39773
39810
|
const customMerge = table.getCustomMerge(col, row);
|
|
39774
39811
|
if (customMerge) {
|
|
@@ -39786,6 +39823,7 @@
|
|
|
39786
39823
|
if (customLayout || customRender) {
|
|
39787
39824
|
customResult = dealWithCustom(customLayout, customRender, customMergeRange.start.col, customMergeRange.start.row, table.getColsWidth(customMergeRange.start.col, customMergeRange.end.col), table.getRowsHeight(customMergeRange.start.row, customMergeRange.end.row), false, table.isAutoRowHeight(row), [0, 0, 0, 0], range, table);
|
|
39788
39825
|
}
|
|
39826
|
+
isCustomMerge = true;
|
|
39789
39827
|
}
|
|
39790
39828
|
}
|
|
39791
39829
|
let colForDefine = col;
|
|
@@ -39814,10 +39852,10 @@
|
|
|
39814
39852
|
cellHeight = mergeSize.cellHeight;
|
|
39815
39853
|
}
|
|
39816
39854
|
}
|
|
39817
|
-
let
|
|
39855
|
+
let isVtableMerge = false;
|
|
39818
39856
|
if (table.internalProps.enableTreeNodeMerge && isMerge) {
|
|
39819
39857
|
const { vtableMergeName, vtableMerge } = table.getCellRawRecord(range.start.col, range.start.row);
|
|
39820
|
-
|
|
39858
|
+
isVtableMerge = vtableMerge;
|
|
39821
39859
|
if (vtableMerge) {
|
|
39822
39860
|
mayHaveIcon = true;
|
|
39823
39861
|
if (table.options.groupTitleCustomLayout) {
|
|
@@ -39845,7 +39883,7 @@
|
|
|
39845
39883
|
if (cellLocation !== 'body' && !cellTheme.group.fill) {
|
|
39846
39884
|
cellTheme.group.fill = '#fff';
|
|
39847
39885
|
}
|
|
39848
|
-
const type =
|
|
39886
|
+
const type = isVtableMerge || isCustomMerge
|
|
39849
39887
|
? 'text'
|
|
39850
39888
|
: (table.isHeader(col, row)
|
|
39851
39889
|
? table._getHeaderLayoutMap(col, row).headerType
|
|
@@ -43208,7 +43246,7 @@
|
|
|
43208
43246
|
const cellStyle = table._getCellStyle(cell.col, cell.row);
|
|
43209
43247
|
const padding = getQuadProps(getProp('padding', cellStyle, cell.col, cell.row, table));
|
|
43210
43248
|
const CartesianAxis = Factory.getComponent('axis');
|
|
43211
|
-
const axis = new CartesianAxis(axisConfig, cell.attribute.width, cell.attribute.height, padding, table);
|
|
43249
|
+
const axis = new CartesianAxis(axisConfig, cell.attribute.width, cell.attribute.height, axisConfig.__vtablePadding ?? padding, table);
|
|
43212
43250
|
cell.clear();
|
|
43213
43251
|
cell.appendChild(axis.component);
|
|
43214
43252
|
axis.overlap();
|
|
@@ -43456,7 +43494,7 @@
|
|
|
43456
43494
|
}
|
|
43457
43495
|
else {
|
|
43458
43496
|
let oldIconMark;
|
|
43459
|
-
oldSortCell
|
|
43497
|
+
traverseObject(oldSortCell, 'children', (mark) => {
|
|
43460
43498
|
if (mark.attribute.funcType === 'sort') {
|
|
43461
43499
|
oldIconMark = mark;
|
|
43462
43500
|
return true;
|
|
@@ -43480,7 +43518,8 @@
|
|
|
43480
43518
|
}
|
|
43481
43519
|
return false;
|
|
43482
43520
|
}
|
|
43483
|
-
function updateSortIcon(
|
|
43521
|
+
function updateSortIcon(options) {
|
|
43522
|
+
const { col, row, iconMark, order, oldSortCol, oldSortRow, oldIconMark, scene } = options;
|
|
43484
43523
|
const icon = scene.table.internalProps.headerHelper.getSortIcon(order, scene.table, col, row);
|
|
43485
43524
|
if (iconMark) {
|
|
43486
43525
|
updateIcon(iconMark, icon, col, row, scene);
|
|
@@ -44334,8 +44373,9 @@
|
|
|
44334
44373
|
setIconHoverStyle(icon, col, row, cellGroup) {
|
|
44335
44374
|
setIconHoverStyle(icon, col, row, cellGroup, this);
|
|
44336
44375
|
}
|
|
44337
|
-
updateSortIcon(
|
|
44338
|
-
|
|
44376
|
+
updateSortIcon(options) {
|
|
44377
|
+
const { col, row, iconMark, order, oldSortCol, oldSortRow, oldIconMark } = options;
|
|
44378
|
+
updateSortIcon({ col, row, iconMark, order, oldSortCol, oldSortRow, oldIconMark, scene: this });
|
|
44339
44379
|
}
|
|
44340
44380
|
updateFrozenIcon(col, oldFrozenCol) {
|
|
44341
44381
|
updateFrozenIcon(this);
|
|
@@ -45063,8 +45103,8 @@
|
|
|
45063
45103
|
this.updateNextFrame();
|
|
45064
45104
|
}
|
|
45065
45105
|
updateCellContentWhileResize(col, row) {
|
|
45066
|
-
const
|
|
45067
|
-
const type =
|
|
45106
|
+
const isVtableMerge = this.table.getCellRawRecord(col, row)?.vtableMerge;
|
|
45107
|
+
const type = isVtableMerge
|
|
45068
45108
|
? 'text'
|
|
45069
45109
|
: this.table.isHeader(col, row)
|
|
45070
45110
|
? this.table._getHeaderLayoutMap(col, row).headerType
|
|
@@ -45603,10 +45643,28 @@
|
|
|
45603
45643
|
if (sortEventReturns.includes(false)) {
|
|
45604
45644
|
return;
|
|
45605
45645
|
}
|
|
45606
|
-
|
|
45607
|
-
table.
|
|
45646
|
+
let isArraySortState = false;
|
|
45647
|
+
let sortState = table.internalProps.sortState
|
|
45648
|
+
? Array.isArray(table.internalProps.sortState) && (isArraySortState = true)
|
|
45649
|
+
? table.internalProps.sortState
|
|
45650
|
+
: [table.internalProps.sortState]
|
|
45651
|
+
: [];
|
|
45652
|
+
if (Array.isArray(sortState)) {
|
|
45653
|
+
const index = sortState.findIndex(item => item.field === tableState.field);
|
|
45654
|
+
if (index >= 0) {
|
|
45655
|
+
sortState[index] = tableState;
|
|
45656
|
+
}
|
|
45657
|
+
else {
|
|
45658
|
+
sortState.push(tableState);
|
|
45659
|
+
}
|
|
45660
|
+
}
|
|
45661
|
+
sortState = sortState.filter(item => item.order !== 'normal');
|
|
45662
|
+
sortState = table.internalProps.multipleSort && (isArraySortState = true) ? sortState : sortState.splice(-1);
|
|
45663
|
+
sortState = isArraySortState && sortState.length ? sortState : sortState[0];
|
|
45664
|
+
table.internalProps.sortState = sortState;
|
|
45665
|
+
table.stateManager.setSortState(sortState);
|
|
45608
45666
|
if (headerC?.sort) {
|
|
45609
|
-
executeSort(
|
|
45667
|
+
executeSort(sortState, table);
|
|
45610
45668
|
}
|
|
45611
45669
|
table.internalProps.useOneRowHeightFillAll = false;
|
|
45612
45670
|
table.internalProps.layoutMap.clearCellRangeMap();
|
|
@@ -45616,20 +45674,15 @@
|
|
|
45616
45674
|
table.stateManager.endSelectCells(true, isHasSelected);
|
|
45617
45675
|
}
|
|
45618
45676
|
function executeSort(newState, table, headerDefine) {
|
|
45619
|
-
|
|
45620
|
-
|
|
45621
|
-
|
|
45622
|
-
|
|
45623
|
-
|
|
45624
|
-
|
|
45625
|
-
|
|
45626
|
-
|
|
45627
|
-
|
|
45628
|
-
table.dataSource.sort(field, newState.order || 'asc', headerDefine.sort);
|
|
45629
|
-
}
|
|
45630
|
-
else {
|
|
45631
|
-
table.dataSource.sort(field, newState.order || 'asc', defaultOrderFn);
|
|
45632
|
-
}
|
|
45677
|
+
newState = Array.isArray(newState) || !newState ? newState : [newState];
|
|
45678
|
+
table.dataSource.sort((newState || []).map(item => {
|
|
45679
|
+
const hd = table.internalProps.layoutMap.headerObjects.find((col) => col && col.field === item.field);
|
|
45680
|
+
return {
|
|
45681
|
+
field: item.field,
|
|
45682
|
+
order: item.order || 'asc',
|
|
45683
|
+
orderFn: typeof hd?.define?.sort === 'function' ? hd?.define?.sort : defaultOrderFn
|
|
45684
|
+
};
|
|
45685
|
+
}));
|
|
45633
45686
|
}
|
|
45634
45687
|
function isTarget(col, row, range1Col, range1Row, table) {
|
|
45635
45688
|
return table._getLayoutCellId(col, row) === table._getLayoutCellId(range1Col, range1Row);
|
|
@@ -47031,11 +47084,13 @@
|
|
|
47031
47084
|
highlightIndex: -1,
|
|
47032
47085
|
dropDownMenuHighlight: []
|
|
47033
47086
|
};
|
|
47034
|
-
this.sort =
|
|
47035
|
-
|
|
47036
|
-
|
|
47037
|
-
|
|
47038
|
-
|
|
47087
|
+
this.sort = [
|
|
47088
|
+
{
|
|
47089
|
+
col: -1,
|
|
47090
|
+
row: -1,
|
|
47091
|
+
order: 'normal'
|
|
47092
|
+
}
|
|
47093
|
+
];
|
|
47039
47094
|
this.frozen = {
|
|
47040
47095
|
col: -1
|
|
47041
47096
|
};
|
|
@@ -47108,11 +47163,13 @@
|
|
|
47108
47163
|
highlightIndex: -1,
|
|
47109
47164
|
dropDownMenuHighlight: []
|
|
47110
47165
|
};
|
|
47111
|
-
this.sort =
|
|
47112
|
-
|
|
47113
|
-
|
|
47114
|
-
|
|
47115
|
-
|
|
47166
|
+
this.sort = [
|
|
47167
|
+
{
|
|
47168
|
+
col: -1,
|
|
47169
|
+
row: -1,
|
|
47170
|
+
order: 'normal'
|
|
47171
|
+
}
|
|
47172
|
+
];
|
|
47116
47173
|
this.frozen = {
|
|
47117
47174
|
col: -1
|
|
47118
47175
|
};
|
|
@@ -47201,8 +47258,38 @@
|
|
|
47201
47258
|
return seled;
|
|
47202
47259
|
}
|
|
47203
47260
|
setSortState(sortState) {
|
|
47204
|
-
|
|
47205
|
-
|
|
47261
|
+
sortState = !sortState || Array.isArray(sortState) ? sortState : [sortState];
|
|
47262
|
+
function flattenColumns(columns) {
|
|
47263
|
+
const result = [];
|
|
47264
|
+
function flatten(cols, parentStartIndex = 0) {
|
|
47265
|
+
cols.forEach((col) => {
|
|
47266
|
+
const startIndex = col.startInTotal ?? parentStartIndex;
|
|
47267
|
+
if (col.columns) {
|
|
47268
|
+
flatten(col.columns, startIndex);
|
|
47269
|
+
}
|
|
47270
|
+
else {
|
|
47271
|
+
result.push({
|
|
47272
|
+
...col,
|
|
47273
|
+
startIndex
|
|
47274
|
+
});
|
|
47275
|
+
}
|
|
47276
|
+
});
|
|
47277
|
+
}
|
|
47278
|
+
flatten(columns);
|
|
47279
|
+
return result;
|
|
47280
|
+
}
|
|
47281
|
+
const sort = sortState &&
|
|
47282
|
+
sortState.reduce((prev, item) => {
|
|
47283
|
+
const column = flattenColumns(this.table.internalProps.columns)?.find(column => column?.field === item?.field);
|
|
47284
|
+
prev.push({
|
|
47285
|
+
field: item.field,
|
|
47286
|
+
order: item.order,
|
|
47287
|
+
col: column.startInTotal,
|
|
47288
|
+
row: column.level
|
|
47289
|
+
});
|
|
47290
|
+
return prev;
|
|
47291
|
+
}, []);
|
|
47292
|
+
this.sort = sort || [];
|
|
47206
47293
|
}
|
|
47207
47294
|
setFrozenState() {
|
|
47208
47295
|
this.frozen.col = this.table.frozenColCount - 1;
|
|
@@ -47787,28 +47874,92 @@
|
|
|
47787
47874
|
});
|
|
47788
47875
|
return;
|
|
47789
47876
|
}
|
|
47790
|
-
const
|
|
47791
|
-
const
|
|
47877
|
+
const previousSort = [...this.sort];
|
|
47878
|
+
const previousSortItem = this.table.internalProps.multipleSort || !previousSort.length ? null : this.sort[this.sort.length - 1];
|
|
47792
47879
|
dealSort(col, row, this.table, event);
|
|
47793
|
-
this.sort.col
|
|
47794
|
-
this.
|
|
47795
|
-
this.table.
|
|
47796
|
-
|
|
47880
|
+
const currentSortItem = this.sort.find(item => item.col === col && item.row === row);
|
|
47881
|
+
const oldSortCol = this.table.internalProps.multipleSort || !previousSortItem ? null : previousSortItem.col;
|
|
47882
|
+
const oldSortRow = this.table.internalProps.multipleSort || !previousSortItem ? null : previousSortItem.row;
|
|
47883
|
+
const currentSortItemIndex = previousSort.findIndex(item => item.col === col && item.row === row);
|
|
47884
|
+
if (currentSortItemIndex >= 0) {
|
|
47885
|
+
previousSort.splice(currentSortItemIndex, 1);
|
|
47886
|
+
}
|
|
47887
|
+
this.table.scenegraph.updateSortIcon({
|
|
47888
|
+
col: col,
|
|
47889
|
+
row: row,
|
|
47890
|
+
iconMark,
|
|
47891
|
+
order: currentSortItem?.order,
|
|
47892
|
+
oldSortCol,
|
|
47893
|
+
oldSortRow,
|
|
47894
|
+
oldIconMark: previousSortItem?.icon
|
|
47895
|
+
});
|
|
47896
|
+
if (currentSortItem) {
|
|
47897
|
+
currentSortItem.icon = iconMark;
|
|
47898
|
+
}
|
|
47899
|
+
if (!this.table.internalProps.multipleSort) {
|
|
47900
|
+
previousSort.forEach((sortItem) => {
|
|
47901
|
+
this.table.scenegraph.updateSortIcon({
|
|
47902
|
+
col: null,
|
|
47903
|
+
row: null,
|
|
47904
|
+
iconMark: null,
|
|
47905
|
+
order: 'normal',
|
|
47906
|
+
oldSortCol: sortItem.col,
|
|
47907
|
+
oldSortRow: sortItem.row,
|
|
47908
|
+
oldIconMark: null
|
|
47909
|
+
});
|
|
47910
|
+
});
|
|
47911
|
+
}
|
|
47797
47912
|
}
|
|
47798
47913
|
updateSortState(sortState) {
|
|
47799
|
-
|
|
47800
|
-
|
|
47914
|
+
sortState = Array.isArray(sortState) ? sortState : [sortState];
|
|
47915
|
+
for (let index = 0; index < sortState.length; index++) {
|
|
47916
|
+
if ((sortState[index].field === this.sort[index]?.field) && (sortState[sortState.length - 1].order === this.sort[index]?.order)) {
|
|
47917
|
+
return;
|
|
47918
|
+
}
|
|
47919
|
+
const oldSortCol = this.table.internalProps.multipleSort ? null : this.sort[index]?.col || null;
|
|
47920
|
+
const oldSortRow = this.table.internalProps.multipleSort ? null : this.sort[index]?.row || null;
|
|
47921
|
+
this.sort[index]?.order === 'asc' ? 'sort_downward' : this.sort[index]?.order === 'desc' ? 'sort_upward' : 'sort_normal';
|
|
47922
|
+
this.setSortState(sortState);
|
|
47923
|
+
const cellAddress = this.table.internalProps.layoutMap.getHeaderCellAddressByField(sortState[index].field);
|
|
47924
|
+
this.sort[index].col = cellAddress.col;
|
|
47925
|
+
this.sort[index].row = cellAddress.row;
|
|
47926
|
+
const cellGroup = this.table.scenegraph.getCell(this.sort[index].col, this.sort[index].row);
|
|
47927
|
+
let iconMark;
|
|
47928
|
+
traverseObject(cellGroup, 'children', (mark) => {
|
|
47929
|
+
if (mark.attribute.funcType === 'sort') {
|
|
47930
|
+
iconMark = mark;
|
|
47931
|
+
return true;
|
|
47932
|
+
}
|
|
47933
|
+
return false;
|
|
47934
|
+
});
|
|
47935
|
+
this.table.scenegraph.updateSortIcon({
|
|
47936
|
+
col: this.sort[index].col,
|
|
47937
|
+
row: this.sort[index].row,
|
|
47938
|
+
iconMark,
|
|
47939
|
+
order: this.sort[index].order,
|
|
47940
|
+
oldSortCol,
|
|
47941
|
+
oldSortRow,
|
|
47942
|
+
oldIconMark: this.sort[index]?.icon
|
|
47943
|
+
});
|
|
47944
|
+
}
|
|
47945
|
+
const normalHeaders = [];
|
|
47946
|
+
this.table.internalProps.layoutMap.columnTree.tree.children.forEach((item) => {
|
|
47947
|
+
if (!sortState.some((state) => state.field === item.field)) {
|
|
47948
|
+
normalHeaders.push(item);
|
|
47949
|
+
}
|
|
47950
|
+
});
|
|
47951
|
+
for (let index = 0; index < normalHeaders.length; index++) {
|
|
47952
|
+
const column = normalHeaders[index];
|
|
47953
|
+
this.table.scenegraph.updateSortIcon({
|
|
47954
|
+
col: null,
|
|
47955
|
+
row: null,
|
|
47956
|
+
iconMark: null,
|
|
47957
|
+
order: null,
|
|
47958
|
+
oldSortCol: column.startInTotal,
|
|
47959
|
+
oldSortRow: column.level,
|
|
47960
|
+
oldIconMark: null
|
|
47961
|
+
});
|
|
47801
47962
|
}
|
|
47802
|
-
const oldSortCol = this.sort.col;
|
|
47803
|
-
const oldSortRow = this.sort.row;
|
|
47804
|
-
const name = this.sort.order === 'asc' ? 'sort_downward' : this.sort.order === 'desc' ? 'sort_upward' : 'sort_normal';
|
|
47805
|
-
this.setSortState(sortState);
|
|
47806
|
-
const cellAddress = this.table.internalProps.layoutMap.getHeaderCellAddressByField(sortState.field);
|
|
47807
|
-
this.sort.col = cellAddress.col;
|
|
47808
|
-
this.sort.row = cellAddress.row;
|
|
47809
|
-
const cellGroup = this.table.scenegraph.getCell(this.sort.col, this.sort.row);
|
|
47810
|
-
const iconMark = cellGroup.getChildByName(name, true);
|
|
47811
|
-
this.table.scenegraph.updateSortIcon(this.sort.col, this.sort.row, iconMark, this.sort.order, oldSortCol, oldSortRow, this.sort.icon);
|
|
47812
47963
|
}
|
|
47813
47964
|
triggerFreeze(col, row, iconMark) {
|
|
47814
47965
|
if (this.table.isPivotTable() || this.table.transpose) {
|
|
@@ -48091,7 +48242,7 @@
|
|
|
48091
48242
|
state.showVerticalScrollBar(true);
|
|
48092
48243
|
}
|
|
48093
48244
|
isWheelEvent && state.resetInteractionState();
|
|
48094
|
-
if (event.nativeEvent
|
|
48245
|
+
if (event.nativeEvent?.cancelable &&
|
|
48095
48246
|
(state.table.internalProps.overscrollBehavior === 'none' ||
|
|
48096
48247
|
(Math.abs(deltaY) >= Math.abs(deltaX) && deltaY !== 0 && isVerticalScrollable(deltaY, state)) ||
|
|
48097
48248
|
(Math.abs(deltaY) <= Math.abs(deltaX) && deltaX !== 0 && isHorizontalScrollable(deltaX, state)))) {
|
|
@@ -48224,7 +48375,8 @@
|
|
|
48224
48375
|
}
|
|
48225
48376
|
return;
|
|
48226
48377
|
}
|
|
48227
|
-
else if (table.
|
|
48378
|
+
else if (!table.options.select?.disableDragSelect &&
|
|
48379
|
+
table.eventManager.isDraging &&
|
|
48228
48380
|
stateManager.isSelecting() &&
|
|
48229
48381
|
!table.editorManager?.editingEditor) {
|
|
48230
48382
|
eventManager.dealTableSelect(eventArgsSet, true);
|
|
@@ -48439,20 +48591,31 @@
|
|
|
48439
48591
|
}
|
|
48440
48592
|
}
|
|
48441
48593
|
}
|
|
48442
|
-
const isCompleteEdit = table.editorManager?.completeEdit(e.nativeEvent);
|
|
48443
|
-
getPromiseValue(isCompleteEdit, isCompleteEdit => {
|
|
48444
|
-
if (isCompleteEdit === false) {
|
|
48445
|
-
return;
|
|
48446
|
-
}
|
|
48447
|
-
stateManager.updateInteractionState(InteractionState.default);
|
|
48448
|
-
eventManager.dealTableHover();
|
|
48449
|
-
if (table.options.select?.outsideClickDeselect) {
|
|
48450
|
-
const isHasSelected = !!stateManager.select.ranges?.length;
|
|
48451
|
-
eventManager.dealTableSelect();
|
|
48452
|
-
stateManager.endSelectCells(true, isHasSelected);
|
|
48453
|
-
}
|
|
48454
|
-
});
|
|
48455
48594
|
});
|
|
48595
|
+
const globalPointerupCallback = (e) => {
|
|
48596
|
+
const target = e.target;
|
|
48597
|
+
if (!table.getElement().contains(target)) {
|
|
48598
|
+
const isCompleteEdit = table.editorManager?.completeEdit(e);
|
|
48599
|
+
getPromiseValue(isCompleteEdit, isCompleteEdit => {
|
|
48600
|
+
if (isCompleteEdit === false) {
|
|
48601
|
+
return;
|
|
48602
|
+
}
|
|
48603
|
+
stateManager.updateInteractionState(InteractionState.default);
|
|
48604
|
+
eventManager.dealTableHover();
|
|
48605
|
+
if (table.options.select?.outsideClickDeselect) {
|
|
48606
|
+
const isHasSelected = !!stateManager.select.ranges?.length;
|
|
48607
|
+
eventManager.dealTableSelect();
|
|
48608
|
+
stateManager.endSelectCells(true, isHasSelected);
|
|
48609
|
+
}
|
|
48610
|
+
});
|
|
48611
|
+
}
|
|
48612
|
+
};
|
|
48613
|
+
eventManager.globalEventListeners.push({
|
|
48614
|
+
name: 'pointerup',
|
|
48615
|
+
env: 'document',
|
|
48616
|
+
callback: globalPointerupCallback
|
|
48617
|
+
});
|
|
48618
|
+
vglobal.addEventListener('pointerup', globalPointerupCallback);
|
|
48456
48619
|
table.scenegraph.tableGroup.addEventListener('pointerdown', (e) => {
|
|
48457
48620
|
if (table.hasListeners(TABLE_EVENT_TYPE.MOUSEDOWN_TABLE)) {
|
|
48458
48621
|
table.fireListeners(TABLE_EVENT_TYPE.MOUSEDOWN_TABLE, {
|
|
@@ -48476,6 +48639,9 @@
|
|
|
48476
48639
|
if (eventArgsSet.eventArgs?.target !== stateManager.residentHoverIcon?.icon) {
|
|
48477
48640
|
stateManager.hideMenu();
|
|
48478
48641
|
}
|
|
48642
|
+
if (eventArgsSet?.eventArgs?.target.type === 'chart') {
|
|
48643
|
+
return;
|
|
48644
|
+
}
|
|
48479
48645
|
const isCompleteEdit = table.editorManager?.completeEdit(e.nativeEvent);
|
|
48480
48646
|
getPromiseValue(isCompleteEdit, isCompleteEdit => {
|
|
48481
48647
|
if (isCompleteEdit === false) {
|
|
@@ -50642,7 +50808,7 @@
|
|
|
50642
50808
|
iconPropKeys.forEach(k => {
|
|
50643
50809
|
if (typeof iconOpt[k] !== 'undefined') {
|
|
50644
50810
|
const f = this._table.getFieldData(iconOpt[k], col, row);
|
|
50645
|
-
if (f
|
|
50811
|
+
if (isValid$1(f)) {
|
|
50646
50812
|
retIcon[k] = f;
|
|
50647
50813
|
}
|
|
50648
50814
|
else if (!this._table._hasField?.(iconOpt[k], col, row)) {
|
|
@@ -52736,7 +52902,8 @@
|
|
|
52736
52902
|
value: node.value,
|
|
52737
52903
|
hierarchyState: node.hierarchyState,
|
|
52738
52904
|
children: undefined,
|
|
52739
|
-
virtual: node.virtual ?? false
|
|
52905
|
+
virtual: node.virtual ?? false,
|
|
52906
|
+
levelSpan: node.levelSpan ?? 1
|
|
52740
52907
|
};
|
|
52741
52908
|
tree.push(diemnsonNode);
|
|
52742
52909
|
if (node.children) {
|
|
@@ -52846,6 +53013,9 @@
|
|
|
52846
53013
|
for (let i = 1; i < hd.levelSpan; i++) {
|
|
52847
53014
|
if (!_headerCellIds[row + i]) {
|
|
52848
53015
|
_headerCellIds[row + i] = [];
|
|
53016
|
+
for (let col = 0; col < layoutMap.colIndex; col++) {
|
|
53017
|
+
_headerCellIds[row + i][col] = _headerCellIds[row][col];
|
|
53018
|
+
}
|
|
52849
53019
|
}
|
|
52850
53020
|
_headerCellIds[row + i][layoutMap.colIndex] = id;
|
|
52851
53021
|
}
|
|
@@ -53704,6 +53874,8 @@
|
|
|
53704
53874
|
if (!axisRange) {
|
|
53705
53875
|
return;
|
|
53706
53876
|
}
|
|
53877
|
+
const chartCellStyle = layout._table._getCellStyle(col, row + 1);
|
|
53878
|
+
const padding = getQuadProps(getProp('padding', chartCellStyle, col, row + 1, layout._table));
|
|
53707
53879
|
const { range, ticks, axisOption, isZeroAlign, theme } = axisRange;
|
|
53708
53880
|
if (isZeroAlign) {
|
|
53709
53881
|
const subAxisRange = getRange$1('bottom', col, row + 1, col, layout.columnHeaderLevelCount - 1, col, row, 0, layout);
|
|
@@ -53737,7 +53909,8 @@
|
|
|
53737
53909
|
flush: true
|
|
53738
53910
|
},
|
|
53739
53911
|
__ticksForVTable: ticks,
|
|
53740
|
-
__vtableChartTheme: theme
|
|
53912
|
+
__vtableChartTheme: theme,
|
|
53913
|
+
__vtablePadding: padding
|
|
53741
53914
|
});
|
|
53742
53915
|
}
|
|
53743
53916
|
else if (row === layout.rowCount - layout.bottomFrozenRowCount &&
|
|
@@ -53755,6 +53928,8 @@
|
|
|
53755
53928
|
if (!axisRange) {
|
|
53756
53929
|
return;
|
|
53757
53930
|
}
|
|
53931
|
+
const chartCellStyle = layout._table._getCellStyle(col, row - 1);
|
|
53932
|
+
const padding = getQuadProps(getProp('padding', chartCellStyle, col, row - 1, layout._table));
|
|
53758
53933
|
const { range, ticks, axisOption, isZeroAlign, theme } = axisRange;
|
|
53759
53934
|
if (isZeroAlign) {
|
|
53760
53935
|
const subAxisRange = getRange$1('top', col, row - 1, col, row, col, row, 1, layout);
|
|
@@ -53792,7 +53967,8 @@
|
|
|
53792
53967
|
flush: true
|
|
53793
53968
|
},
|
|
53794
53969
|
__ticksForVTable: ticks,
|
|
53795
|
-
__vtableChartTheme: theme
|
|
53970
|
+
__vtableChartTheme: theme,
|
|
53971
|
+
__vtablePadding: padding
|
|
53796
53972
|
});
|
|
53797
53973
|
}
|
|
53798
53974
|
else if (col === layout.rowHeaderLevelCount - 1 &&
|
|
@@ -53809,6 +53985,8 @@
|
|
|
53809
53985
|
if (axisOption?.visible === false) {
|
|
53810
53986
|
return;
|
|
53811
53987
|
}
|
|
53988
|
+
const chartCellStyle = layout._table._getCellStyle(col + 1, row);
|
|
53989
|
+
const padding = getQuadProps(getProp('padding', chartCellStyle, col + 1, row, layout._table));
|
|
53812
53990
|
const spec = layout.getRawChartSpec(col + 1, row);
|
|
53813
53991
|
return merge({
|
|
53814
53992
|
domain: axisOption?.type === 'linear' ? undefined : Array.from(domain),
|
|
@@ -53820,7 +53998,8 @@
|
|
|
53820
53998
|
orient: 'left',
|
|
53821
53999
|
type: axisOption?.type ?? 'band',
|
|
53822
54000
|
__vtableChartTheme: theme,
|
|
53823
|
-
inverse: transformInverse(axisOption, (spec?.direction ?? (chartType === 'scatter' ? 'vertical' : 'horizontal')) === "horizontal")
|
|
54001
|
+
inverse: transformInverse(axisOption, (spec?.direction ?? (chartType === 'scatter' ? 'vertical' : 'horizontal')) === "horizontal"),
|
|
54002
|
+
__vtablePadding: padding
|
|
53824
54003
|
});
|
|
53825
54004
|
}
|
|
53826
54005
|
}
|
|
@@ -53840,6 +54019,8 @@
|
|
|
53840
54019
|
if (!axisRange) {
|
|
53841
54020
|
return;
|
|
53842
54021
|
}
|
|
54022
|
+
const chartCellStyle = layout._table._getCellStyle(col + 1, row);
|
|
54023
|
+
const padding = getQuadProps(getProp('padding', chartCellStyle, col + 1, row, layout._table));
|
|
53843
54024
|
const { range, ticks, axisOption, isZeroAlign, theme } = axisRange;
|
|
53844
54025
|
if (isZeroAlign) {
|
|
53845
54026
|
const subAxisRange = getRange$1('right', col + 1, row, col, row, col, row, 1, layout);
|
|
@@ -53878,7 +54059,8 @@
|
|
|
53878
54059
|
flush: true
|
|
53879
54060
|
},
|
|
53880
54061
|
__ticksForVTable: ticks,
|
|
53881
|
-
__vtableChartTheme: theme
|
|
54062
|
+
__vtableChartTheme: theme,
|
|
54063
|
+
__vtablePadding: padding
|
|
53882
54064
|
});
|
|
53883
54065
|
}
|
|
53884
54066
|
else if (col === layout.colCount - layout.rightFrozenColCount &&
|
|
@@ -53888,6 +54070,8 @@
|
|
|
53888
54070
|
if (!axisRange) {
|
|
53889
54071
|
return;
|
|
53890
54072
|
}
|
|
54073
|
+
const chartCellStyle = layout._table._getCellStyle(col - 1, row);
|
|
54074
|
+
const padding = getQuadProps(getProp('padding', chartCellStyle, col - 1, row, layout._table));
|
|
53891
54075
|
const { range, ticks, axisOption, isZeroAlign, theme } = axisRange;
|
|
53892
54076
|
if (isZeroAlign) {
|
|
53893
54077
|
const subAxisRange = getRange$1('left', col - 1, row, layout.rowHeaderLevelCount - 1, row, col, row, 0, layout);
|
|
@@ -53924,7 +54108,8 @@
|
|
|
53924
54108
|
flush: true
|
|
53925
54109
|
},
|
|
53926
54110
|
__ticksForVTable: ticks,
|
|
53927
|
-
__vtableChartTheme: theme
|
|
54111
|
+
__vtableChartTheme: theme,
|
|
54112
|
+
__vtablePadding: padding
|
|
53928
54113
|
});
|
|
53929
54114
|
}
|
|
53930
54115
|
else if (row === layout.rowCount - layout.bottomFrozenRowCount &&
|
|
@@ -53941,13 +54126,16 @@
|
|
|
53941
54126
|
if (axisOption?.visible === false) {
|
|
53942
54127
|
return;
|
|
53943
54128
|
}
|
|
54129
|
+
const chartCellStyle = layout._table._getCellStyle(col, row - 1);
|
|
54130
|
+
const padding = getQuadProps(getProp('padding', chartCellStyle, col, row - 1, layout._table));
|
|
53944
54131
|
return merge({
|
|
53945
54132
|
domain: axisOption?.type === 'linear' ? undefined : Array.from(domain),
|
|
53946
54133
|
range: axisOption?.type === 'linear' ? domain : undefined
|
|
53947
54134
|
}, axisOption, {
|
|
53948
54135
|
orient: 'bottom',
|
|
53949
54136
|
type: axisOption?.type ?? 'band',
|
|
53950
|
-
__vtableChartTheme: theme
|
|
54137
|
+
__vtableChartTheme: theme,
|
|
54138
|
+
__vtablePadding: padding
|
|
53951
54139
|
});
|
|
53952
54140
|
}
|
|
53953
54141
|
}
|
|
@@ -54103,7 +54291,9 @@
|
|
|
54103
54291
|
range.max = range.max > 0 ? 1 : 0;
|
|
54104
54292
|
}
|
|
54105
54293
|
const getAxisDomainRangeAndLabels = Factory.getFunction('getAxisDomainRangeAndLabels');
|
|
54106
|
-
const { range: niceRange, ticks } = getAxisDomainRangeAndLabels(range.min, range.max, axisOption, isZeroAlign,
|
|
54294
|
+
const { range: niceRange, ticks } = getAxisDomainRangeAndLabels(range.min, range.max, axisOption, isZeroAlign, position === 'bottom' || position === 'top'
|
|
54295
|
+
? layout._table.getColWidth(col) || layout._table.tableNoFrameWidth
|
|
54296
|
+
: layout._table.getRowHeight(row) || layout._table.tableNoFrameHeight);
|
|
54107
54297
|
range.min = !isNaN(niceRange[0]) ? niceRange[0] : 0;
|
|
54108
54298
|
range.max = !isNaN(niceRange[1]) ? niceRange[1] : 1;
|
|
54109
54299
|
if (isNumber$2(axisOption?.min)) {
|
|
@@ -54437,7 +54627,7 @@
|
|
|
54437
54627
|
return TABLE_EVENT_TYPE;
|
|
54438
54628
|
}
|
|
54439
54629
|
options;
|
|
54440
|
-
version = "1.7.
|
|
54630
|
+
version = "1.7.6";
|
|
54441
54631
|
pagination;
|
|
54442
54632
|
id = `VTable${Date.now()}`;
|
|
54443
54633
|
headerStyleCache;
|
|
@@ -56265,7 +56455,7 @@
|
|
|
56265
56455
|
return undefined;
|
|
56266
56456
|
}
|
|
56267
56457
|
_hasField(field, col, row) {
|
|
56268
|
-
if (field
|
|
56458
|
+
if (field === null) {
|
|
56269
56459
|
return false;
|
|
56270
56460
|
}
|
|
56271
56461
|
const table = this;
|
|
@@ -56394,17 +56584,19 @@
|
|
|
56394
56584
|
icons = this.internalProps.headerHelper.getIcons(col, row);
|
|
56395
56585
|
}
|
|
56396
56586
|
else if (this.internalProps.layoutMap.isSeriesNumber(col, row)) {
|
|
56397
|
-
|
|
56398
|
-
?.
|
|
56399
|
-
|
|
56400
|
-
|
|
56587
|
+
if (!this.options.groupBy || !this.getCellRawRecord(col, row)?.vtableMerge) {
|
|
56588
|
+
const dragOrder = this.internalProps.layoutMap.getSeriesNumberBody(col, row)?.define
|
|
56589
|
+
?.dragOrder;
|
|
56590
|
+
if (dragOrder) {
|
|
56591
|
+
icons = this.internalProps.rowSeriesNumberHelper.getIcons(col, row);
|
|
56592
|
+
}
|
|
56401
56593
|
}
|
|
56402
56594
|
const cellValue = this.getCellValue(col, row);
|
|
56403
56595
|
const dataValue = this.getCellOriginValue(col, row);
|
|
56404
56596
|
const ctx = this.internalProps.context;
|
|
56405
56597
|
const cellIcon = this.internalProps.bodyHelper.getIcons(col, row, cellValue, dataValue, ctx);
|
|
56406
56598
|
if (icons?.length > 0) {
|
|
56407
|
-
icons = icons.concat();
|
|
56599
|
+
icons = icons.concat(cellIcon);
|
|
56408
56600
|
}
|
|
56409
56601
|
else if (cellIcon?.length > 0) {
|
|
56410
56602
|
icons = cellIcon;
|
|
@@ -58072,7 +58264,9 @@
|
|
|
58072
58264
|
}
|
|
58073
58265
|
if (axisOption?.nice) {
|
|
58074
58266
|
const getAxisDomainRangeAndLabels = Factory.getFunction('getAxisDomainRangeAndLabels');
|
|
58075
|
-
const { range: axisRange } = getAxisDomainRangeAndLabels(range.min, range.max, axisOption, isZeroAlign,
|
|
58267
|
+
const { range: axisRange } = getAxisDomainRangeAndLabels(range.min, range.max, axisOption, isZeroAlign, position === 'bottom' || position === 'top'
|
|
58268
|
+
? layout._table.getColWidth(col) || layout._table.tableNoFrameWidth
|
|
58269
|
+
: layout._table.getRowHeight(row) || layout._table.tableNoFrameHeight);
|
|
58076
58270
|
range.min = axisRange[0];
|
|
58077
58271
|
range.max = axisRange[1];
|
|
58078
58272
|
}
|
|
@@ -59815,27 +60009,19 @@
|
|
|
59815
60009
|
return cellUpdateType;
|
|
59816
60010
|
}
|
|
59817
60011
|
function sortRecords(table) {
|
|
59818
|
-
|
|
59819
|
-
|
|
59820
|
-
|
|
59821
|
-
|
|
59822
|
-
|
|
59823
|
-
|
|
59824
|
-
|
|
59825
|
-
|
|
59826
|
-
else {
|
|
59827
|
-
({ order, field } = table.sortState);
|
|
59828
|
-
}
|
|
59829
|
-
if (order && field && order !== 'normal') {
|
|
59830
|
-
const sortFunc = table._getSortFuncFromHeaderOption(undefined, field);
|
|
59831
|
-
const hd = table.internalProps.layoutMap.headerObjects.find((col) => col && col.field === field);
|
|
59832
|
-
hd && table.dataSource.sort(hd.field, order, sortFunc ?? defaultOrderFn);
|
|
59833
|
-
}
|
|
60012
|
+
let sortState = table.sortState;
|
|
60013
|
+
sortState = !sortState || Array.isArray(sortState) ? sortState : [sortState];
|
|
60014
|
+
if (sortState) {
|
|
60015
|
+
sortState = sortState.map(item => {
|
|
60016
|
+
item.orderFn = table._getSortFuncFromHeaderOption(undefined, item.field) ?? defaultOrderFn;
|
|
60017
|
+
return item;
|
|
60018
|
+
});
|
|
60019
|
+
table.dataSource.sort(sortState);
|
|
59834
60020
|
}
|
|
59835
60021
|
}
|
|
59836
60022
|
function listTableAddRecord(record, recordIndex, table) {
|
|
59837
60023
|
if (table.options.groupBy) {
|
|
59838
|
-
table.dataSource.addRecordsForGroup?.([record]);
|
|
60024
|
+
table.dataSource.addRecordsForGroup?.([record], recordIndex);
|
|
59839
60025
|
table.refreshRowColCount();
|
|
59840
60026
|
table.internalProps.layoutMap.clearCellRangeMap();
|
|
59841
60027
|
table.scenegraph.clearCells();
|
|
@@ -59918,7 +60104,7 @@
|
|
|
59918
60104
|
}
|
|
59919
60105
|
function listTableAddRecords(records, recordIndex, table) {
|
|
59920
60106
|
if (table.options.groupBy) {
|
|
59921
|
-
table.dataSource.addRecordsForGroup?.(records);
|
|
60107
|
+
table.dataSource.addRecordsForGroup?.(records, recordIndex);
|
|
59922
60108
|
table.refreshRowColCount();
|
|
59923
60109
|
table.internalProps.layoutMap.clearCellRangeMap();
|
|
59924
60110
|
table.scenegraph.clearCells();
|
|
@@ -60178,6 +60364,7 @@
|
|
|
60178
60364
|
internalProps.frozenColDragHeaderMode = options.frozenColDragHeaderMode;
|
|
60179
60365
|
this.pagination = options.pagination;
|
|
60180
60366
|
internalProps.sortState = options.sortState;
|
|
60367
|
+
internalProps.multipleSort = !!options.multipleSort;
|
|
60181
60368
|
internalProps.dataConfig = options.groupBy ? getGroupByDataConfig(options.groupBy) : {};
|
|
60182
60369
|
internalProps.columns = options.columns
|
|
60183
60370
|
? cloneDeepSpec(options.columns, ['children'])
|
|
@@ -60304,6 +60491,14 @@
|
|
|
60304
60491
|
const { title } = table.internalProps.layoutMap.getSeriesNumberHeader(col, row);
|
|
60305
60492
|
return title;
|
|
60306
60493
|
}
|
|
60494
|
+
if (this.options.groupBy) {
|
|
60495
|
+
const { vtableMerge } = table.getCellRawRecord(col, row);
|
|
60496
|
+
if (vtableMerge) {
|
|
60497
|
+
return '';
|
|
60498
|
+
}
|
|
60499
|
+
const indexs = this.dataSource.currentIndexedData[row - this.columnHeaderLevelCount];
|
|
60500
|
+
return indexs[indexs.length - 1] + 1;
|
|
60501
|
+
}
|
|
60307
60502
|
const { format } = table.internalProps.layoutMap.getSeriesNumberBody(col, row);
|
|
60308
60503
|
return typeof format === 'function' ? format(col, row, this) : row - this.columnHeaderLevelCount + 1;
|
|
60309
60504
|
}
|
|
@@ -60774,8 +60969,10 @@
|
|
|
60774
60969
|
if (!sortState) {
|
|
60775
60970
|
if (this.internalProps.sortState) {
|
|
60776
60971
|
if (Array.isArray(this.internalProps.sortState)) {
|
|
60777
|
-
|
|
60778
|
-
|
|
60972
|
+
for (let i = 0; i < this.internalProps.sortState.length; i++) {
|
|
60973
|
+
sortState = this.internalProps.sortState?.[i];
|
|
60974
|
+
sortState && (sortState.order = 'normal');
|
|
60975
|
+
}
|
|
60779
60976
|
}
|
|
60780
60977
|
else {
|
|
60781
60978
|
this.internalProps.sortState.order = 'normal';
|
|
@@ -60786,27 +60983,24 @@
|
|
|
60786
60983
|
else {
|
|
60787
60984
|
this.internalProps.sortState = sortState;
|
|
60788
60985
|
}
|
|
60789
|
-
|
|
60790
|
-
|
|
60791
|
-
|
|
60792
|
-
|
|
60793
|
-
|
|
60794
|
-
|
|
60795
|
-
|
|
60796
|
-
|
|
60797
|
-
|
|
60798
|
-
|
|
60799
|
-
|
|
60800
|
-
|
|
60801
|
-
const hd = this.internalProps.layoutMap.headerObjects.find((col) => col && col.field === field);
|
|
60802
|
-
if (hd && hd.define.sort !== false) {
|
|
60803
|
-
this.dataSource.sort(hd.field, order, sortFunc);
|
|
60986
|
+
sortState = Array.isArray(sortState) ? sortState : [sortState];
|
|
60987
|
+
if (sortState.some((item) => item.field) && executeSort) {
|
|
60988
|
+
if (this.internalProps.layoutMap.headerObjects.some(item => item.define.sort !== false)) {
|
|
60989
|
+
this.dataSource.sort(sortState.map((item) => {
|
|
60990
|
+
const sortFunc = this._getSortFuncFromHeaderOption(this.internalProps.columns, item.field);
|
|
60991
|
+
this.internalProps.layoutMap.headerObjects.find((col) => col && col.field === item.field);
|
|
60992
|
+
return {
|
|
60993
|
+
field: item.field,
|
|
60994
|
+
order: item.order,
|
|
60995
|
+
orderFn: sortFunc
|
|
60996
|
+
};
|
|
60997
|
+
}));
|
|
60804
60998
|
this.internalProps.layoutMap.clearCellRangeMap();
|
|
60805
60999
|
this.internalProps.useOneRowHeightFillAll = false;
|
|
60806
61000
|
this.scenegraph.sortCell();
|
|
60807
61001
|
}
|
|
60808
61002
|
}
|
|
60809
|
-
if (sortState) {
|
|
61003
|
+
if (sortState.length) {
|
|
60810
61004
|
this.stateManager.updateSortState(sortState);
|
|
60811
61005
|
}
|
|
60812
61006
|
}
|
|
@@ -60880,27 +61074,24 @@
|
|
|
60880
61074
|
const oldHoverState = { col: this.stateManager.hover.cellPos.col, row: this.stateManager.hover.cellPos.row };
|
|
60881
61075
|
this.scenegraph.clearCells();
|
|
60882
61076
|
if (sort !== undefined) {
|
|
60883
|
-
this.internalProps.sortState = sort;
|
|
61077
|
+
this.internalProps.sortState = this.internalProps.multipleSort ? (Array.isArray(sort) ? sort : [sort]) : sort;
|
|
60884
61078
|
this.stateManager.setSortState(this.sortState);
|
|
60885
61079
|
}
|
|
60886
61080
|
if (records) {
|
|
60887
61081
|
_setRecords(this, records);
|
|
60888
61082
|
if (this.sortState) {
|
|
60889
|
-
|
|
60890
|
-
|
|
60891
|
-
|
|
60892
|
-
|
|
60893
|
-
|
|
60894
|
-
|
|
60895
|
-
|
|
60896
|
-
|
|
60897
|
-
|
|
60898
|
-
|
|
60899
|
-
|
|
60900
|
-
|
|
60901
|
-
const hd = this.internalProps.layoutMap.headerObjectsIncludeHided.find((col) => col && col.field === field);
|
|
60902
|
-
if (hd && hd.define.sort !== false) {
|
|
60903
|
-
this.dataSource.sort(hd.field, order, sortFunc ?? defaultOrderFn);
|
|
61083
|
+
const sortState = Array.isArray(this.sortState) ? this.sortState : [this.sortState];
|
|
61084
|
+
if (sortState.some((item) => item.order && item.field && item.order !== 'normal')) {
|
|
61085
|
+
if (this.internalProps.layoutMap.headerObjectsIncludeHided.some(item => item.define.sort !== false)) {
|
|
61086
|
+
this.dataSource.sort(sortState.map((item) => {
|
|
61087
|
+
const sortFunc = this._getSortFuncFromHeaderOption(undefined, item.field);
|
|
61088
|
+
this.internalProps.layoutMap.headerObjectsIncludeHided.find((col) => col && col.field === item.field);
|
|
61089
|
+
return {
|
|
61090
|
+
field: item.field,
|
|
61091
|
+
order: item.order || 'asc',
|
|
61092
|
+
orderFn: sortFunc ?? defaultOrderFn
|
|
61093
|
+
};
|
|
61094
|
+
}));
|
|
60904
61095
|
}
|
|
60905
61096
|
}
|
|
60906
61097
|
}
|
|
@@ -61512,7 +61703,9 @@
|
|
|
61512
61703
|
tickData;
|
|
61513
61704
|
scale;
|
|
61514
61705
|
component;
|
|
61706
|
+
padding;
|
|
61515
61707
|
constructor(option, width, height, padding, table) {
|
|
61708
|
+
this.padding = padding;
|
|
61516
61709
|
this.table = table;
|
|
61517
61710
|
this.orient = option.orient ?? 'left';
|
|
61518
61711
|
this.type = option.type ?? 'band';
|
|
@@ -61521,13 +61714,13 @@
|
|
|
61521
61714
|
const innerOffsetTop = 0;
|
|
61522
61715
|
const innerOffsetBottom = 0;
|
|
61523
61716
|
this.width = width;
|
|
61524
|
-
this.height = height - padding[2] - innerOffsetBottom;
|
|
61717
|
+
this.height = height - padding[0] - padding[2] - innerOffsetBottom;
|
|
61525
61718
|
this.y = padding[0] + innerOffsetTop;
|
|
61526
61719
|
}
|
|
61527
61720
|
else if (this.orient === 'top' || this.orient === 'bottom') {
|
|
61528
61721
|
const innerOffsetLeft = 0;
|
|
61529
61722
|
const innerOffsetRight = 0;
|
|
61530
|
-
this.width = width - padding[1] - innerOffsetRight;
|
|
61723
|
+
this.width = width - padding[1] - padding[3] - innerOffsetRight;
|
|
61531
61724
|
this.height = height;
|
|
61532
61725
|
this.x = padding[3] + innerOffsetLeft;
|
|
61533
61726
|
}
|
|
@@ -61605,19 +61798,19 @@
|
|
|
61605
61798
|
this.component = new LineAxis(merge({
|
|
61606
61799
|
disableTriggerEvent: this.table.options.disableInteraction
|
|
61607
61800
|
}, axisStylrAttrs, attrs));
|
|
61608
|
-
this.component.setAttributes(this.setLayoutStartPosition({ x:
|
|
61801
|
+
this.component.setAttributes(this.setLayoutStartPosition({ x: this.x, y: this.y }));
|
|
61609
61802
|
this.component.originAxis = this;
|
|
61610
61803
|
}
|
|
61611
61804
|
resize(width, height) {
|
|
61612
|
-
this.width = width;
|
|
61613
|
-
this.height = height;
|
|
61805
|
+
this.width = width - (this.orient === 'top' || this.orient === 'bottom' ? this.padding[1] + this.padding[3] : 0);
|
|
61806
|
+
this.height = height - (this.orient === 'left' || this.orient === 'right' ? this.padding[2] + this.padding[0] : 0);
|
|
61614
61807
|
this.updateScaleRange();
|
|
61615
61808
|
this.computeData();
|
|
61616
61809
|
const axisStylrAttrs = getAxisAttributes(this.option);
|
|
61617
61810
|
const attrs = this.getUpdateAttribute();
|
|
61618
61811
|
attrs.verticalFactor = this.orient === 'top' || this.orient === 'right' ? -1 : 1;
|
|
61619
61812
|
this.component.setAttributes(merge({}, axisStylrAttrs, attrs));
|
|
61620
|
-
this.component.setAttributes(this.setLayoutStartPosition({ x:
|
|
61813
|
+
this.component.setAttributes(this.setLayoutStartPosition({ x: this.x, y: this.y }));
|
|
61621
61814
|
this.overlap();
|
|
61622
61815
|
}
|
|
61623
61816
|
overlap() {
|
|
@@ -61647,7 +61840,7 @@
|
|
|
61647
61840
|
}
|
|
61648
61841
|
const size = this.orient === 'top' || this.orient === 'bottom' ? height : width;
|
|
61649
61842
|
const attrs = {
|
|
61650
|
-
start: { x:
|
|
61843
|
+
start: { x: 0, y: 0 },
|
|
61651
61844
|
end,
|
|
61652
61845
|
title: {
|
|
61653
61846
|
text: this.option.title.text,
|
|
@@ -64690,7 +64883,7 @@
|
|
|
64690
64883
|
for (let i = 0; i < domain.length; i++) {
|
|
64691
64884
|
let valid = false;
|
|
64692
64885
|
for (let j = 0; j < values.length; j++) {
|
|
64693
|
-
if (domain[i]
|
|
64886
|
+
if (domain[i] === values[j]) {
|
|
64694
64887
|
const data = dataValue[j];
|
|
64695
64888
|
if (!isValid$1(data[xField]) || !isValid$1(data[yField])) {
|
|
64696
64889
|
break;
|
|
@@ -66524,7 +66717,8 @@
|
|
|
66524
66717
|
});
|
|
66525
66718
|
}
|
|
66526
66719
|
else {
|
|
66527
|
-
this.
|
|
66720
|
+
const rowDimensionKeys = this.rowDimensionTree.dimensionKeysIncludeVirtual.valueArr();
|
|
66721
|
+
rowDimensionKeys.forEach((objKey, index) => {
|
|
66528
66722
|
const dimension = this.rowsDefine?.find(dimension => typeof dimension === 'string' ? false : dimension.dimensionKey === objKey);
|
|
66529
66723
|
dimension &&
|
|
66530
66724
|
(returnWidths[index + (this.rowHeaderTitle ? 1 : 0) + this.leftRowSeriesNumberColumnCount] = {
|
|
@@ -67460,7 +67654,7 @@
|
|
|
67460
67654
|
let colDimension;
|
|
67461
67655
|
for (let i = 0; i < dimensions.length; i++) {
|
|
67462
67656
|
const highlightDimension = dimensions[i];
|
|
67463
|
-
if ((highlightDimension.isPivotCorner || !highlightDimension.value) &&
|
|
67657
|
+
if ((highlightDimension.isPivotCorner || !isValid$1(highlightDimension.value)) &&
|
|
67464
67658
|
i === dimensions.length - 1) {
|
|
67465
67659
|
if (this?.cornerSetting?.titleOnDimension === 'row') {
|
|
67466
67660
|
let col = 0;
|
|
@@ -67875,7 +68069,7 @@
|
|
|
67875
68069
|
dimension.value === rowDimension.value) ||
|
|
67876
68070
|
(isValid$1(rowDimension.indicatorKey) &&
|
|
67877
68071
|
dimension.indicatorKey === rowDimension.indicatorKey &&
|
|
67878
|
-
(!rowDimension.value || dimension.value === rowDimension.value))) {
|
|
68072
|
+
(!isValid$1(rowDimension.value) || dimension.value === rowDimension.value))) {
|
|
67879
68073
|
rowArr = dimension.children;
|
|
67880
68074
|
if (needLowestLevel && (!rowArr || rowArr.some(row => row.dimensionKey === 'axis'))) {
|
|
67881
68075
|
rowDimensionFinded = dimension;
|
|
@@ -68083,7 +68277,7 @@
|
|
|
68083
68277
|
}
|
|
68084
68278
|
for (let i = 0; i < dimensions.length; i++) {
|
|
68085
68279
|
const highlightDimension = dimensions[i];
|
|
68086
|
-
if ((highlightDimension.isPivotCorner || !highlightDimension.value) &&
|
|
68280
|
+
if ((highlightDimension.isPivotCorner || !isValid$1(highlightDimension.value)) &&
|
|
68087
68281
|
i === dimensions.length - 1) {
|
|
68088
68282
|
return undefined;
|
|
68089
68283
|
}
|
|
@@ -68943,6 +69137,7 @@
|
|
|
68943
69137
|
class Dataset {
|
|
68944
69138
|
dataConfig;
|
|
68945
69139
|
records;
|
|
69140
|
+
filteredRecords;
|
|
68946
69141
|
tree = {};
|
|
68947
69142
|
changedTree = {};
|
|
68948
69143
|
colFlatKeys = {};
|
|
@@ -69200,18 +69395,29 @@
|
|
|
69200
69395
|
isNeedFilter = true;
|
|
69201
69396
|
}
|
|
69202
69397
|
if (Array.isArray(this.records)) {
|
|
69398
|
+
if (!this.filteredRecords) {
|
|
69399
|
+
this.filteredRecords = [];
|
|
69400
|
+
}
|
|
69203
69401
|
for (let i = 0, len = this.records.length; i < len; i++) {
|
|
69204
69402
|
const record = this.records[i];
|
|
69205
69403
|
if (!isNeedFilter || this.filterRecord(record)) {
|
|
69404
|
+
this.filteredRecords.push(record);
|
|
69206
69405
|
this.processRecord(record);
|
|
69207
69406
|
}
|
|
69208
69407
|
}
|
|
69209
69408
|
}
|
|
69210
69409
|
else {
|
|
69410
|
+
if (!this.filteredRecords) {
|
|
69411
|
+
this.filteredRecords = {};
|
|
69412
|
+
}
|
|
69211
69413
|
for (const key in this.records) {
|
|
69212
69414
|
for (let i = 0, len = this.records[key].length; i < len; i++) {
|
|
69213
69415
|
const record = this.records[key][i];
|
|
69214
69416
|
if (!isNeedFilter || this.filterRecord(record)) {
|
|
69417
|
+
if (!this.filteredRecords[key]) {
|
|
69418
|
+
this.filteredRecords[key] = [];
|
|
69419
|
+
}
|
|
69420
|
+
this.filteredRecords[key].push(record);
|
|
69215
69421
|
this.processRecord(record, key);
|
|
69216
69422
|
}
|
|
69217
69423
|
}
|
|
@@ -69537,6 +69743,7 @@
|
|
|
69537
69743
|
}
|
|
69538
69744
|
updateFilterRules(filterRules, isResetTree = false) {
|
|
69539
69745
|
this.filterRules = filterRules;
|
|
69746
|
+
this.filteredRecords = undefined;
|
|
69540
69747
|
if (isResetTree) {
|
|
69541
69748
|
this.tree = {};
|
|
69542
69749
|
}
|
|
@@ -71706,6 +71913,9 @@
|
|
|
71706
71913
|
this.dataset.updateFilterRules(filterRules);
|
|
71707
71914
|
this.renderWithRecreateCells();
|
|
71708
71915
|
}
|
|
71916
|
+
getFilteredRecords() {
|
|
71917
|
+
return this.dataset?.filterRules;
|
|
71918
|
+
}
|
|
71709
71919
|
}
|
|
71710
71920
|
|
|
71711
71921
|
registerAxis();
|
|
@@ -73356,7 +73566,7 @@
|
|
|
73356
73566
|
}
|
|
73357
73567
|
|
|
73358
73568
|
registerForVrender();
|
|
73359
|
-
const version = "1.7.
|
|
73569
|
+
const version = "1.7.6";
|
|
73360
73570
|
function getIcons() {
|
|
73361
73571
|
return get$2();
|
|
73362
73572
|
}
|