@visactor/vtable 1.7.5-alpha.0 → 1.7.5
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-pivot-table.d.ts +1 -1
- package/cjs/dataset/dataset-pivot-table.js +10 -45
- package/cjs/dataset/dataset-pivot-table.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/dataset/statistics-helper.js +1 -1
- package/cjs/dataset/statistics-helper.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/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 +1 -0
- 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/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 +3 -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 +416 -214
- 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-pivot-table.d.ts +1 -1
- package/es/dataset/dataset-pivot-table.js +9 -44
- package/es/dataset/dataset-pivot-table.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/dataset/statistics-helper.js +1 -1
- package/es/dataset/statistics-helper.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/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 +1 -0
- 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/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 +3 -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 +4 -4
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];
|
|
@@ -29046,7 +29053,7 @@
|
|
|
29046
29053
|
}
|
|
29047
29054
|
}
|
|
29048
29055
|
value() {
|
|
29049
|
-
return this.records?.length >= 1 ? this.sum :
|
|
29056
|
+
return this.records?.length >= 1 ? this.sum : undefined;
|
|
29050
29057
|
}
|
|
29051
29058
|
positiveValue() {
|
|
29052
29059
|
return this.positiveSum;
|
|
@@ -29506,9 +29513,7 @@
|
|
|
29506
29513
|
_sourceLength;
|
|
29507
29514
|
_source;
|
|
29508
29515
|
sortedIndexMap;
|
|
29509
|
-
|
|
29510
|
-
lastOrderFn;
|
|
29511
|
-
lastOrderField;
|
|
29516
|
+
lastSortStates;
|
|
29512
29517
|
currentIndexedData = [];
|
|
29513
29518
|
userPagination;
|
|
29514
29519
|
pagination;
|
|
@@ -29827,14 +29832,15 @@
|
|
|
29827
29832
|
const children = nodeData.filteredChildren ? nodeData.filteredChildren : nodeData.children;
|
|
29828
29833
|
if (children) {
|
|
29829
29834
|
const subNodeSortedIndexArray = Array.from({ length: children.length }, (_, i) => i);
|
|
29830
|
-
this.
|
|
29831
|
-
|
|
29832
|
-
|
|
29833
|
-
|
|
29834
|
-
|
|
29835
|
-
|
|
29836
|
-
|
|
29837
|
-
}
|
|
29835
|
+
this.lastSortStates?.forEach(state => {
|
|
29836
|
+
if (state.order !== 'normal') {
|
|
29837
|
+
sort(index => isValid$1(subNodeSortedIndexArray[index])
|
|
29838
|
+
? subNodeSortedIndexArray[index]
|
|
29839
|
+
: (subNodeSortedIndexArray[index] = index), (index, rel) => {
|
|
29840
|
+
subNodeSortedIndexArray[index] = rel;
|
|
29841
|
+
}, children.length, state.orderFn, state.order, index => this.getOriginalField(Array.isArray(indexKey) ? indexKey.concat([index]) : [indexKey, index], state.field));
|
|
29842
|
+
}
|
|
29843
|
+
});
|
|
29838
29844
|
for (let i = 0; i < subNodeSortedIndexArray.length; i++) {
|
|
29839
29845
|
childrenLength += 1;
|
|
29840
29846
|
const childIndex = Array.isArray(indexKey)
|
|
@@ -30082,16 +30088,19 @@
|
|
|
30082
30088
|
}
|
|
30083
30089
|
this.sortedIndexMap.clear();
|
|
30084
30090
|
}
|
|
30085
|
-
sort(
|
|
30086
|
-
|
|
30087
|
-
|
|
30088
|
-
|
|
30089
|
-
|
|
30090
|
-
this.
|
|
30091
|
-
let
|
|
30092
|
-
let orderedData;
|
|
30093
|
-
if (
|
|
30094
|
-
orderedData =
|
|
30091
|
+
sort(states) {
|
|
30092
|
+
states = (Array.isArray(states) ? states : [states]).filter(state => {
|
|
30093
|
+
let column = this.layoutColumnObjects.find(obj => obj.field == state.field);
|
|
30094
|
+
return column?.define?.sort !== false && state.order !== 'normal';
|
|
30095
|
+
});
|
|
30096
|
+
this.lastSortStates = states;
|
|
30097
|
+
let filedMapArray = states.map(state => this.sortedIndexMap.get(state?.field) || { asc: [], desc: [], normal: [] });
|
|
30098
|
+
let orderedData = null;
|
|
30099
|
+
if (filedMapArray.length > 0) {
|
|
30100
|
+
orderedData = states.reduce((data, state, index) => {
|
|
30101
|
+
const currentData = filedMapArray[index]?.[state.order];
|
|
30102
|
+
return currentData && currentData.length > 0 ? currentData : data;
|
|
30103
|
+
}, null);
|
|
30095
30104
|
if (orderedData && orderedData.length > 0) {
|
|
30096
30105
|
this.currentIndexedData = orderedData;
|
|
30097
30106
|
this.updatePagerData();
|
|
@@ -30099,21 +30108,22 @@
|
|
|
30099
30108
|
return;
|
|
30100
30109
|
}
|
|
30101
30110
|
}
|
|
30102
|
-
const sortedIndexArray =
|
|
30103
|
-
|
|
30104
|
-
|
|
30105
|
-
|
|
30106
|
-
|
|
30107
|
-
|
|
30108
|
-
|
|
30109
|
-
|
|
30110
|
-
|
|
30111
|
-
|
|
30112
|
-
|
|
30111
|
+
const sortedIndexArray = Array.from({ length: this._sourceLength }, (_, i) => i);
|
|
30112
|
+
sortedIndexArray.sort((indexA, indexB) => {
|
|
30113
|
+
return states.reduce((result, state) => {
|
|
30114
|
+
if (result !== 0) {
|
|
30115
|
+
return result;
|
|
30116
|
+
}
|
|
30117
|
+
const orderFn = state.orderFn ||
|
|
30118
|
+
(state.order !== 'desc'
|
|
30119
|
+
? (v1, v2) => (v1 === v2 ? 0 : v1 > v2 ? 1 : -1)
|
|
30120
|
+
: (v1, v2) => (v1 === v2 ? 0 : v1 < v2 ? 1 : -1));
|
|
30121
|
+
return orderFn(this.getOriginalField(indexA, state.field), this.getOriginalField(indexB, state.field), state.order);
|
|
30122
|
+
}, 0);
|
|
30123
|
+
});
|
|
30113
30124
|
this.currentIndexedData = sortedIndexArray;
|
|
30114
30125
|
if (this.hierarchyExpandLevel) {
|
|
30115
30126
|
let nodeLength = sortedIndexArray.length;
|
|
30116
|
-
window.performance.now();
|
|
30117
30127
|
for (let i = 0; i < nodeLength; i++) {
|
|
30118
30128
|
const record = this.getOriginalRecord(sortedIndexArray[i]);
|
|
30119
30129
|
const subNodeLength = this.pushChildrenNode(sortedIndexArray[i], record.hierarchyState, this.getOriginalRecord(sortedIndexArray[i]));
|
|
@@ -30121,11 +30131,16 @@
|
|
|
30121
30131
|
i += subNodeLength;
|
|
30122
30132
|
}
|
|
30123
30133
|
}
|
|
30124
|
-
if (!
|
|
30125
|
-
|
|
30126
|
-
|
|
30134
|
+
if (!filedMapArray.length) {
|
|
30135
|
+
filedMapArray = states.map(() => ({ asc: [], desc: [], normal: [] }));
|
|
30136
|
+
for (let index = 0; index < states.length; index++) {
|
|
30137
|
+
this.sortedIndexMap.set(states[index].field, filedMapArray[index]);
|
|
30138
|
+
}
|
|
30127
30139
|
}
|
|
30128
|
-
|
|
30140
|
+
states.forEach((state, index) => {
|
|
30141
|
+
const mapItem = filedMapArray[index];
|
|
30142
|
+
mapItem[state.order] = sortedIndexArray.slice();
|
|
30143
|
+
});
|
|
30129
30144
|
this.updatePagerData();
|
|
30130
30145
|
this.fireListeners(EVENT_TYPE$1.CHANGE_ORDER, null);
|
|
30131
30146
|
}
|
|
@@ -30187,22 +30202,27 @@
|
|
|
30187
30202
|
}
|
|
30188
30203
|
}
|
|
30189
30204
|
clearSortedIndexMap() {
|
|
30190
|
-
if (this.
|
|
30205
|
+
if (this.lastSortStates && this.lastSortStates.length > 0) {
|
|
30191
30206
|
this.sortedIndexMap.forEach((sortMap, key) => {
|
|
30192
|
-
|
|
30207
|
+
const isFieldInRules = this.lastSortStates.some(state => state.field === key);
|
|
30208
|
+
if (!isFieldInRules) {
|
|
30193
30209
|
this.sortedIndexMap.delete(key);
|
|
30194
30210
|
}
|
|
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
30211
|
else {
|
|
30204
|
-
|
|
30205
|
-
|
|
30212
|
+
this.lastSortStates.forEach(state => {
|
|
30213
|
+
if (state.order === 'asc') {
|
|
30214
|
+
sortMap.desc = [];
|
|
30215
|
+
sortMap.normal = [];
|
|
30216
|
+
}
|
|
30217
|
+
else if (state.order === 'desc') {
|
|
30218
|
+
sortMap.asc = [];
|
|
30219
|
+
sortMap.normal = [];
|
|
30220
|
+
}
|
|
30221
|
+
else {
|
|
30222
|
+
sortMap.asc = [];
|
|
30223
|
+
sortMap.desc = [];
|
|
30224
|
+
}
|
|
30225
|
+
});
|
|
30206
30226
|
}
|
|
30207
30227
|
});
|
|
30208
30228
|
}
|
|
@@ -30363,7 +30383,7 @@
|
|
|
30363
30383
|
return true;
|
|
30364
30384
|
}
|
|
30365
30385
|
reorderRecord(sourceIndex, targetIndex) {
|
|
30366
|
-
if (this.
|
|
30386
|
+
if (this.lastSortStates?.some(state => state.order === 'asc' || state.order === 'desc')) {
|
|
30367
30387
|
return;
|
|
30368
30388
|
}
|
|
30369
30389
|
else if (this.isCanExchangeOrder(sourceIndex, targetIndex)) {
|
|
@@ -30558,7 +30578,7 @@
|
|
|
30558
30578
|
_setFieldCache(this._fieldCache, index, field, value);
|
|
30559
30579
|
}
|
|
30560
30580
|
recordPromiseCallBack(index, record) {
|
|
30561
|
-
this._recordCache[index] = record;
|
|
30581
|
+
this._recordCache && (this._recordCache[index] = record);
|
|
30562
30582
|
}
|
|
30563
30583
|
get records() {
|
|
30564
30584
|
return Array.isArray(this._recordCache) && this._recordCache.length > 0 ? this._recordCache : super.records;
|
|
@@ -30615,11 +30635,14 @@
|
|
|
30615
30635
|
this.initTreeHierarchyState();
|
|
30616
30636
|
this.updatePagerData();
|
|
30617
30637
|
}
|
|
30618
|
-
addRecordsForGroup(recordArr) {
|
|
30638
|
+
addRecordsForGroup(recordArr, recordIndex) {
|
|
30619
30639
|
if (!isArray$1(recordArr) || recordArr.length === 0) {
|
|
30620
30640
|
return;
|
|
30621
30641
|
}
|
|
30622
|
-
this.dataSourceObj.records
|
|
30642
|
+
if (recordIndex === undefined || recordIndex > this.dataSourceObj.records) {
|
|
30643
|
+
recordIndex = this.dataSourceObj.records;
|
|
30644
|
+
}
|
|
30645
|
+
this.dataSourceObj.records.splice(recordIndex, 0, ...recordArr);
|
|
30623
30646
|
this.updateGroup();
|
|
30624
30647
|
}
|
|
30625
30648
|
deleteRecordsForGroup(recordIndexs) {
|
|
@@ -34013,11 +34036,14 @@
|
|
|
34013
34036
|
|
|
34014
34037
|
function createCell(type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme, range, customResult) {
|
|
34015
34038
|
let isAsync = false;
|
|
34039
|
+
let cellGroup;
|
|
34016
34040
|
if (isPromise(value)) {
|
|
34041
|
+
if (table.scenegraph.highPerformanceGetCell(col, row).role !== 'cell') {
|
|
34042
|
+
return cellGroup;
|
|
34043
|
+
}
|
|
34017
34044
|
value = table.getCellValue(col, row);
|
|
34018
34045
|
isAsync = true;
|
|
34019
34046
|
}
|
|
34020
|
-
let cellGroup;
|
|
34021
34047
|
if (type === 'text' || type === 'link' || customResult) {
|
|
34022
34048
|
if (type === 'link') {
|
|
34023
34049
|
const cellValue = value;
|
|
@@ -34071,7 +34097,7 @@
|
|
|
34071
34097
|
const axisConfig = table.internalProps.layoutMap.getAxisConfigInPivotChart(col, row);
|
|
34072
34098
|
if (axisConfig) {
|
|
34073
34099
|
const CartesianAxis = Factory.getComponent('axis');
|
|
34074
|
-
const axis = new CartesianAxis(axisConfig, cellGroup.attribute.width, cellGroup.attribute.height, padding, table);
|
|
34100
|
+
const axis = new CartesianAxis(axisConfig, cellGroup.attribute.width, cellGroup.attribute.height, axisConfig.__vtablePadding ?? padding, table);
|
|
34075
34101
|
cellGroup.clear();
|
|
34076
34102
|
cellGroup.appendChild(axis.component);
|
|
34077
34103
|
axis.overlap();
|
|
@@ -34137,6 +34163,7 @@
|
|
|
34137
34163
|
let cellTheme;
|
|
34138
34164
|
let customStyle;
|
|
34139
34165
|
let customResult;
|
|
34166
|
+
let isCustomMerge = false;
|
|
34140
34167
|
if (table.internalProps.customMergeCell) {
|
|
34141
34168
|
const customMerge = table.getCustomMerge(col, row);
|
|
34142
34169
|
if (customMerge) {
|
|
@@ -34152,6 +34179,7 @@
|
|
|
34152
34179
|
if (customLayout || customRender) {
|
|
34153
34180
|
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
34181
|
}
|
|
34182
|
+
isCustomMerge = true;
|
|
34155
34183
|
}
|
|
34156
34184
|
}
|
|
34157
34185
|
let colForDefine = col;
|
|
@@ -34171,10 +34199,10 @@
|
|
|
34171
34199
|
range = table.getCellRange(col, row);
|
|
34172
34200
|
isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;
|
|
34173
34201
|
}
|
|
34174
|
-
let
|
|
34202
|
+
let isVtableMerge = false;
|
|
34175
34203
|
if (table.internalProps.enableTreeNodeMerge && isMerge) {
|
|
34176
34204
|
const { vtableMergeName, vtableMerge } = table.getCellRawRecord(range.start.col, range.start.row);
|
|
34177
|
-
|
|
34205
|
+
isVtableMerge = vtableMerge;
|
|
34178
34206
|
if (vtableMerge) {
|
|
34179
34207
|
mayHaveIcon = true;
|
|
34180
34208
|
if (table.options.groupTitleCustomLayout) {
|
|
@@ -34270,7 +34298,7 @@
|
|
|
34270
34298
|
if (!addNew && oldCellGroup.role === 'empty') {
|
|
34271
34299
|
return undefined;
|
|
34272
34300
|
}
|
|
34273
|
-
const type =
|
|
34301
|
+
const type = isVtableMerge || isCustomMerge
|
|
34274
34302
|
? 'text'
|
|
34275
34303
|
: table.isHeader(col, row)
|
|
34276
34304
|
? table._getHeaderLayoutMap(col, row).headerType
|
|
@@ -35438,8 +35466,9 @@
|
|
|
35438
35466
|
}
|
|
35439
35467
|
cell.needUpdateHeight = false;
|
|
35440
35468
|
cell.setAttribute('height', distHeight);
|
|
35441
|
-
const
|
|
35442
|
-
const
|
|
35469
|
+
const isVtableMerge = scene.table.getCellRawRecord(col, row)?.vtableMerge;
|
|
35470
|
+
const isCustomMerge = !!scene.table.getCustomMerge(col, row);
|
|
35471
|
+
const type = isVtableMerge || isCustomMerge
|
|
35443
35472
|
? 'text'
|
|
35444
35473
|
: scene.table.isHeader(col, row)
|
|
35445
35474
|
? scene.table._getHeaderLayoutMap(col, row).headerType
|
|
@@ -35779,8 +35808,9 @@
|
|
|
35779
35808
|
return false;
|
|
35780
35809
|
}
|
|
35781
35810
|
const autoRowHeight = scene.table.isAutoRowHeight(row);
|
|
35782
|
-
const
|
|
35783
|
-
const
|
|
35811
|
+
const isVtableMerge = scene.table.getCellRawRecord(col, row)?.vtableMerge;
|
|
35812
|
+
const isCustomMerge = !!scene.table.getCustomMerge(col, row);
|
|
35813
|
+
const type = isVtableMerge || isCustomMerge
|
|
35784
35814
|
? 'text'
|
|
35785
35815
|
: scene.table.isHeader(col, row)
|
|
35786
35816
|
? scene.table._getHeaderLayoutMap(col, row).headerType
|
|
@@ -35822,7 +35852,7 @@
|
|
|
35822
35852
|
const padding = getQuadProps(getProp('padding', cellStyle, col, row, scene.table));
|
|
35823
35853
|
if (axisConfig) {
|
|
35824
35854
|
const CartesianAxis = Factory.getComponent('axis');
|
|
35825
|
-
const axis = new CartesianAxis(axisConfig, cellGroup.attribute.width, cellGroup.attribute.height, padding, scene.table);
|
|
35855
|
+
const axis = new CartesianAxis(axisConfig, cellGroup.attribute.width, cellGroup.attribute.height, axisConfig.__vtablePadding ?? padding, scene.table);
|
|
35826
35856
|
cellGroup.clear();
|
|
35827
35857
|
cellGroup.appendChild(axis.component);
|
|
35828
35858
|
axis.overlap();
|
|
@@ -37340,6 +37370,9 @@
|
|
|
37340
37370
|
}
|
|
37341
37371
|
}
|
|
37342
37372
|
function updateFrameBorder(group, frameTheme, strokeArray) {
|
|
37373
|
+
if (!frameTheme) {
|
|
37374
|
+
return;
|
|
37375
|
+
}
|
|
37343
37376
|
const { borderColor } = frameTheme;
|
|
37344
37377
|
group.border?.setAttribute('stroke', getStroke(borderColor, strokeArray));
|
|
37345
37378
|
}
|
|
@@ -39769,6 +39802,7 @@
|
|
|
39769
39802
|
let isMerge;
|
|
39770
39803
|
let customStyle;
|
|
39771
39804
|
let customResult;
|
|
39805
|
+
let isCustomMerge = false;
|
|
39772
39806
|
if (table.internalProps.customMergeCell) {
|
|
39773
39807
|
const customMerge = table.getCustomMerge(col, row);
|
|
39774
39808
|
if (customMerge) {
|
|
@@ -39786,6 +39820,7 @@
|
|
|
39786
39820
|
if (customLayout || customRender) {
|
|
39787
39821
|
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
39822
|
}
|
|
39823
|
+
isCustomMerge = true;
|
|
39789
39824
|
}
|
|
39790
39825
|
}
|
|
39791
39826
|
let colForDefine = col;
|
|
@@ -39814,10 +39849,10 @@
|
|
|
39814
39849
|
cellHeight = mergeSize.cellHeight;
|
|
39815
39850
|
}
|
|
39816
39851
|
}
|
|
39817
|
-
let
|
|
39852
|
+
let isVtableMerge = false;
|
|
39818
39853
|
if (table.internalProps.enableTreeNodeMerge && isMerge) {
|
|
39819
39854
|
const { vtableMergeName, vtableMerge } = table.getCellRawRecord(range.start.col, range.start.row);
|
|
39820
|
-
|
|
39855
|
+
isVtableMerge = vtableMerge;
|
|
39821
39856
|
if (vtableMerge) {
|
|
39822
39857
|
mayHaveIcon = true;
|
|
39823
39858
|
if (table.options.groupTitleCustomLayout) {
|
|
@@ -39845,7 +39880,7 @@
|
|
|
39845
39880
|
if (cellLocation !== 'body' && !cellTheme.group.fill) {
|
|
39846
39881
|
cellTheme.group.fill = '#fff';
|
|
39847
39882
|
}
|
|
39848
|
-
const type =
|
|
39883
|
+
const type = isVtableMerge || isCustomMerge
|
|
39849
39884
|
? 'text'
|
|
39850
39885
|
: (table.isHeader(col, row)
|
|
39851
39886
|
? table._getHeaderLayoutMap(col, row).headerType
|
|
@@ -43208,7 +43243,7 @@
|
|
|
43208
43243
|
const cellStyle = table._getCellStyle(cell.col, cell.row);
|
|
43209
43244
|
const padding = getQuadProps(getProp('padding', cellStyle, cell.col, cell.row, table));
|
|
43210
43245
|
const CartesianAxis = Factory.getComponent('axis');
|
|
43211
|
-
const axis = new CartesianAxis(axisConfig, cell.attribute.width, cell.attribute.height, padding, table);
|
|
43246
|
+
const axis = new CartesianAxis(axisConfig, cell.attribute.width, cell.attribute.height, axisConfig.__vtablePadding ?? padding, table);
|
|
43212
43247
|
cell.clear();
|
|
43213
43248
|
cell.appendChild(axis.component);
|
|
43214
43249
|
axis.overlap();
|
|
@@ -43456,7 +43491,7 @@
|
|
|
43456
43491
|
}
|
|
43457
43492
|
else {
|
|
43458
43493
|
let oldIconMark;
|
|
43459
|
-
oldSortCell
|
|
43494
|
+
traverseObject(oldSortCell, 'children', (mark) => {
|
|
43460
43495
|
if (mark.attribute.funcType === 'sort') {
|
|
43461
43496
|
oldIconMark = mark;
|
|
43462
43497
|
return true;
|
|
@@ -43480,7 +43515,8 @@
|
|
|
43480
43515
|
}
|
|
43481
43516
|
return false;
|
|
43482
43517
|
}
|
|
43483
|
-
function updateSortIcon(
|
|
43518
|
+
function updateSortIcon(options) {
|
|
43519
|
+
const { col, row, iconMark, order, oldSortCol, oldSortRow, oldIconMark, scene } = options;
|
|
43484
43520
|
const icon = scene.table.internalProps.headerHelper.getSortIcon(order, scene.table, col, row);
|
|
43485
43521
|
if (iconMark) {
|
|
43486
43522
|
updateIcon(iconMark, icon, col, row, scene);
|
|
@@ -44334,8 +44370,9 @@
|
|
|
44334
44370
|
setIconHoverStyle(icon, col, row, cellGroup) {
|
|
44335
44371
|
setIconHoverStyle(icon, col, row, cellGroup, this);
|
|
44336
44372
|
}
|
|
44337
|
-
updateSortIcon(
|
|
44338
|
-
|
|
44373
|
+
updateSortIcon(options) {
|
|
44374
|
+
const { col, row, iconMark, order, oldSortCol, oldSortRow, oldIconMark } = options;
|
|
44375
|
+
updateSortIcon({ col, row, iconMark, order, oldSortCol, oldSortRow, oldIconMark, scene: this });
|
|
44339
44376
|
}
|
|
44340
44377
|
updateFrozenIcon(col, oldFrozenCol) {
|
|
44341
44378
|
updateFrozenIcon(this);
|
|
@@ -45063,8 +45100,8 @@
|
|
|
45063
45100
|
this.updateNextFrame();
|
|
45064
45101
|
}
|
|
45065
45102
|
updateCellContentWhileResize(col, row) {
|
|
45066
|
-
const
|
|
45067
|
-
const type =
|
|
45103
|
+
const isVtableMerge = this.table.getCellRawRecord(col, row)?.vtableMerge;
|
|
45104
|
+
const type = isVtableMerge
|
|
45068
45105
|
? 'text'
|
|
45069
45106
|
: this.table.isHeader(col, row)
|
|
45070
45107
|
? this.table._getHeaderLayoutMap(col, row).headerType
|
|
@@ -45603,10 +45640,28 @@
|
|
|
45603
45640
|
if (sortEventReturns.includes(false)) {
|
|
45604
45641
|
return;
|
|
45605
45642
|
}
|
|
45606
|
-
|
|
45607
|
-
table.
|
|
45643
|
+
let isArraySortState = false;
|
|
45644
|
+
let sortState = table.internalProps.sortState
|
|
45645
|
+
? Array.isArray(table.internalProps.sortState) && (isArraySortState = true)
|
|
45646
|
+
? table.internalProps.sortState
|
|
45647
|
+
: [table.internalProps.sortState]
|
|
45648
|
+
: [];
|
|
45649
|
+
if (Array.isArray(sortState)) {
|
|
45650
|
+
const index = sortState.findIndex(item => item.field === tableState.field);
|
|
45651
|
+
if (index >= 0) {
|
|
45652
|
+
sortState[index] = tableState;
|
|
45653
|
+
}
|
|
45654
|
+
else {
|
|
45655
|
+
sortState.push(tableState);
|
|
45656
|
+
}
|
|
45657
|
+
}
|
|
45658
|
+
sortState = sortState.filter(item => item.order !== 'normal');
|
|
45659
|
+
sortState = table.internalProps.multipleSort && (isArraySortState = true) ? sortState : sortState.splice(-1);
|
|
45660
|
+
sortState = isArraySortState && sortState.length ? sortState : sortState[0];
|
|
45661
|
+
table.internalProps.sortState = sortState;
|
|
45662
|
+
table.stateManager.setSortState(sortState);
|
|
45608
45663
|
if (headerC?.sort) {
|
|
45609
|
-
executeSort(
|
|
45664
|
+
executeSort(sortState, table);
|
|
45610
45665
|
}
|
|
45611
45666
|
table.internalProps.useOneRowHeightFillAll = false;
|
|
45612
45667
|
table.internalProps.layoutMap.clearCellRangeMap();
|
|
@@ -45616,20 +45671,15 @@
|
|
|
45616
45671
|
table.stateManager.endSelectCells(true, isHasSelected);
|
|
45617
45672
|
}
|
|
45618
45673
|
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
|
-
}
|
|
45674
|
+
newState = Array.isArray(newState) || !newState ? newState : [newState];
|
|
45675
|
+
table.dataSource.sort((newState || []).map(item => {
|
|
45676
|
+
const hd = table.internalProps.layoutMap.headerObjects.find((col) => col && col.field === item.field);
|
|
45677
|
+
return {
|
|
45678
|
+
field: item.field,
|
|
45679
|
+
order: item.order || 'asc',
|
|
45680
|
+
orderFn: typeof hd?.define?.sort === 'function' ? hd?.define?.sort : defaultOrderFn
|
|
45681
|
+
};
|
|
45682
|
+
}));
|
|
45633
45683
|
}
|
|
45634
45684
|
function isTarget(col, row, range1Col, range1Row, table) {
|
|
45635
45685
|
return table._getLayoutCellId(col, row) === table._getLayoutCellId(range1Col, range1Row);
|
|
@@ -47031,11 +47081,13 @@
|
|
|
47031
47081
|
highlightIndex: -1,
|
|
47032
47082
|
dropDownMenuHighlight: []
|
|
47033
47083
|
};
|
|
47034
|
-
this.sort =
|
|
47035
|
-
|
|
47036
|
-
|
|
47037
|
-
|
|
47038
|
-
|
|
47084
|
+
this.sort = [
|
|
47085
|
+
{
|
|
47086
|
+
col: -1,
|
|
47087
|
+
row: -1,
|
|
47088
|
+
order: 'normal'
|
|
47089
|
+
}
|
|
47090
|
+
];
|
|
47039
47091
|
this.frozen = {
|
|
47040
47092
|
col: -1
|
|
47041
47093
|
};
|
|
@@ -47108,11 +47160,13 @@
|
|
|
47108
47160
|
highlightIndex: -1,
|
|
47109
47161
|
dropDownMenuHighlight: []
|
|
47110
47162
|
};
|
|
47111
|
-
this.sort =
|
|
47112
|
-
|
|
47113
|
-
|
|
47114
|
-
|
|
47115
|
-
|
|
47163
|
+
this.sort = [
|
|
47164
|
+
{
|
|
47165
|
+
col: -1,
|
|
47166
|
+
row: -1,
|
|
47167
|
+
order: 'normal'
|
|
47168
|
+
}
|
|
47169
|
+
];
|
|
47116
47170
|
this.frozen = {
|
|
47117
47171
|
col: -1
|
|
47118
47172
|
};
|
|
@@ -47201,8 +47255,38 @@
|
|
|
47201
47255
|
return seled;
|
|
47202
47256
|
}
|
|
47203
47257
|
setSortState(sortState) {
|
|
47204
|
-
|
|
47205
|
-
|
|
47258
|
+
sortState = !sortState || Array.isArray(sortState) ? sortState : [sortState];
|
|
47259
|
+
function flattenColumns(columns) {
|
|
47260
|
+
const result = [];
|
|
47261
|
+
function flatten(cols, parentStartIndex = 0) {
|
|
47262
|
+
cols.forEach((col) => {
|
|
47263
|
+
const startIndex = col.startInTotal ?? parentStartIndex;
|
|
47264
|
+
if (col.columns) {
|
|
47265
|
+
flatten(col.columns, startIndex);
|
|
47266
|
+
}
|
|
47267
|
+
else {
|
|
47268
|
+
result.push({
|
|
47269
|
+
...col,
|
|
47270
|
+
startIndex
|
|
47271
|
+
});
|
|
47272
|
+
}
|
|
47273
|
+
});
|
|
47274
|
+
}
|
|
47275
|
+
flatten(columns);
|
|
47276
|
+
return result;
|
|
47277
|
+
}
|
|
47278
|
+
const sort = sortState &&
|
|
47279
|
+
sortState.reduce((prev, item) => {
|
|
47280
|
+
const column = flattenColumns(this.table.internalProps.columns)?.find(column => column?.field === item?.field);
|
|
47281
|
+
prev.push({
|
|
47282
|
+
field: item.field,
|
|
47283
|
+
order: item.order,
|
|
47284
|
+
col: column.startInTotal,
|
|
47285
|
+
row: column.level
|
|
47286
|
+
});
|
|
47287
|
+
return prev;
|
|
47288
|
+
}, []);
|
|
47289
|
+
this.sort = sort || [];
|
|
47206
47290
|
}
|
|
47207
47291
|
setFrozenState() {
|
|
47208
47292
|
this.frozen.col = this.table.frozenColCount - 1;
|
|
@@ -47787,28 +47871,92 @@
|
|
|
47787
47871
|
});
|
|
47788
47872
|
return;
|
|
47789
47873
|
}
|
|
47790
|
-
const
|
|
47791
|
-
const
|
|
47874
|
+
const previousSort = [...this.sort];
|
|
47875
|
+
const previousSortItem = this.table.internalProps.multipleSort || !previousSort.length ? null : this.sort[this.sort.length - 1];
|
|
47792
47876
|
dealSort(col, row, this.table, event);
|
|
47793
|
-
this.sort.col
|
|
47794
|
-
this.
|
|
47795
|
-
this.table.
|
|
47796
|
-
|
|
47877
|
+
const currentSortItem = this.sort.find(item => item.col === col && item.row === row);
|
|
47878
|
+
const oldSortCol = this.table.internalProps.multipleSort || !previousSortItem ? null : previousSortItem.col;
|
|
47879
|
+
const oldSortRow = this.table.internalProps.multipleSort || !previousSortItem ? null : previousSortItem.row;
|
|
47880
|
+
const currentSortItemIndex = previousSort.findIndex(item => item.col === col && item.row === row);
|
|
47881
|
+
if (currentSortItemIndex >= 0) {
|
|
47882
|
+
previousSort.splice(currentSortItemIndex, 1);
|
|
47883
|
+
}
|
|
47884
|
+
this.table.scenegraph.updateSortIcon({
|
|
47885
|
+
col: col,
|
|
47886
|
+
row: row,
|
|
47887
|
+
iconMark,
|
|
47888
|
+
order: currentSortItem?.order,
|
|
47889
|
+
oldSortCol,
|
|
47890
|
+
oldSortRow,
|
|
47891
|
+
oldIconMark: previousSortItem?.icon
|
|
47892
|
+
});
|
|
47893
|
+
if (currentSortItem) {
|
|
47894
|
+
currentSortItem.icon = iconMark;
|
|
47895
|
+
}
|
|
47896
|
+
if (!this.table.internalProps.multipleSort) {
|
|
47897
|
+
previousSort.forEach((sortItem) => {
|
|
47898
|
+
this.table.scenegraph.updateSortIcon({
|
|
47899
|
+
col: null,
|
|
47900
|
+
row: null,
|
|
47901
|
+
iconMark: null,
|
|
47902
|
+
order: 'normal',
|
|
47903
|
+
oldSortCol: sortItem.col,
|
|
47904
|
+
oldSortRow: sortItem.row,
|
|
47905
|
+
oldIconMark: null
|
|
47906
|
+
});
|
|
47907
|
+
});
|
|
47908
|
+
}
|
|
47797
47909
|
}
|
|
47798
47910
|
updateSortState(sortState) {
|
|
47799
|
-
|
|
47800
|
-
|
|
47911
|
+
sortState = Array.isArray(sortState) ? sortState : [sortState];
|
|
47912
|
+
for (let index = 0; index < sortState.length; index++) {
|
|
47913
|
+
if ((sortState[index].field === this.sort[index]?.field) && (sortState[sortState.length - 1].order === this.sort[index]?.order)) {
|
|
47914
|
+
return;
|
|
47915
|
+
}
|
|
47916
|
+
const oldSortCol = this.table.internalProps.multipleSort ? null : this.sort[index]?.col || null;
|
|
47917
|
+
const oldSortRow = this.table.internalProps.multipleSort ? null : this.sort[index]?.row || null;
|
|
47918
|
+
this.sort[index]?.order === 'asc' ? 'sort_downward' : this.sort[index]?.order === 'desc' ? 'sort_upward' : 'sort_normal';
|
|
47919
|
+
this.setSortState(sortState);
|
|
47920
|
+
const cellAddress = this.table.internalProps.layoutMap.getHeaderCellAddressByField(sortState[index].field);
|
|
47921
|
+
this.sort[index].col = cellAddress.col;
|
|
47922
|
+
this.sort[index].row = cellAddress.row;
|
|
47923
|
+
const cellGroup = this.table.scenegraph.getCell(this.sort[index].col, this.sort[index].row);
|
|
47924
|
+
let iconMark;
|
|
47925
|
+
traverseObject(cellGroup, 'children', (mark) => {
|
|
47926
|
+
if (mark.attribute.funcType === 'sort') {
|
|
47927
|
+
iconMark = mark;
|
|
47928
|
+
return true;
|
|
47929
|
+
}
|
|
47930
|
+
return false;
|
|
47931
|
+
});
|
|
47932
|
+
this.table.scenegraph.updateSortIcon({
|
|
47933
|
+
col: this.sort[index].col,
|
|
47934
|
+
row: this.sort[index].row,
|
|
47935
|
+
iconMark,
|
|
47936
|
+
order: this.sort[index].order,
|
|
47937
|
+
oldSortCol,
|
|
47938
|
+
oldSortRow,
|
|
47939
|
+
oldIconMark: this.sort[index]?.icon
|
|
47940
|
+
});
|
|
47941
|
+
}
|
|
47942
|
+
const normalHeaders = [];
|
|
47943
|
+
this.table.internalProps.layoutMap.columnTree.tree.children.forEach((item) => {
|
|
47944
|
+
if (!sortState.some((state) => state.field === item.field)) {
|
|
47945
|
+
normalHeaders.push(item);
|
|
47946
|
+
}
|
|
47947
|
+
});
|
|
47948
|
+
for (let index = 0; index < normalHeaders.length; index++) {
|
|
47949
|
+
const column = normalHeaders[index];
|
|
47950
|
+
this.table.scenegraph.updateSortIcon({
|
|
47951
|
+
col: null,
|
|
47952
|
+
row: null,
|
|
47953
|
+
iconMark: null,
|
|
47954
|
+
order: null,
|
|
47955
|
+
oldSortCol: column.startInTotal,
|
|
47956
|
+
oldSortRow: column.level,
|
|
47957
|
+
oldIconMark: null
|
|
47958
|
+
});
|
|
47801
47959
|
}
|
|
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
47960
|
}
|
|
47813
47961
|
triggerFreeze(col, row, iconMark) {
|
|
47814
47962
|
if (this.table.isPivotTable() || this.table.transpose) {
|
|
@@ -48091,7 +48239,7 @@
|
|
|
48091
48239
|
state.showVerticalScrollBar(true);
|
|
48092
48240
|
}
|
|
48093
48241
|
isWheelEvent && state.resetInteractionState();
|
|
48094
|
-
if (event.nativeEvent
|
|
48242
|
+
if (event.nativeEvent?.cancelable &&
|
|
48095
48243
|
(state.table.internalProps.overscrollBehavior === 'none' ||
|
|
48096
48244
|
(Math.abs(deltaY) >= Math.abs(deltaX) && deltaY !== 0 && isVerticalScrollable(deltaY, state)) ||
|
|
48097
48245
|
(Math.abs(deltaY) <= Math.abs(deltaX) && deltaX !== 0 && isHorizontalScrollable(deltaX, state)))) {
|
|
@@ -48224,7 +48372,8 @@
|
|
|
48224
48372
|
}
|
|
48225
48373
|
return;
|
|
48226
48374
|
}
|
|
48227
|
-
else if (table.
|
|
48375
|
+
else if (!table.options.select?.disableDragSelect &&
|
|
48376
|
+
table.eventManager.isDraging &&
|
|
48228
48377
|
stateManager.isSelecting() &&
|
|
48229
48378
|
!table.editorManager?.editingEditor) {
|
|
48230
48379
|
eventManager.dealTableSelect(eventArgsSet, true);
|
|
@@ -48439,20 +48588,31 @@
|
|
|
48439
48588
|
}
|
|
48440
48589
|
}
|
|
48441
48590
|
}
|
|
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
48591
|
});
|
|
48592
|
+
const globalPointerupCallback = (e) => {
|
|
48593
|
+
const target = e.target;
|
|
48594
|
+
if (!table.getElement().contains(target)) {
|
|
48595
|
+
const isCompleteEdit = table.editorManager?.completeEdit(e);
|
|
48596
|
+
getPromiseValue(isCompleteEdit, isCompleteEdit => {
|
|
48597
|
+
if (isCompleteEdit === false) {
|
|
48598
|
+
return;
|
|
48599
|
+
}
|
|
48600
|
+
stateManager.updateInteractionState(InteractionState.default);
|
|
48601
|
+
eventManager.dealTableHover();
|
|
48602
|
+
if (table.options.select?.outsideClickDeselect) {
|
|
48603
|
+
const isHasSelected = !!stateManager.select.ranges?.length;
|
|
48604
|
+
eventManager.dealTableSelect();
|
|
48605
|
+
stateManager.endSelectCells(true, isHasSelected);
|
|
48606
|
+
}
|
|
48607
|
+
});
|
|
48608
|
+
}
|
|
48609
|
+
};
|
|
48610
|
+
eventManager.globalEventListeners.push({
|
|
48611
|
+
name: 'pointerup',
|
|
48612
|
+
env: 'document',
|
|
48613
|
+
callback: globalPointerupCallback
|
|
48614
|
+
});
|
|
48615
|
+
vglobal.addEventListener('pointerup', globalPointerupCallback);
|
|
48456
48616
|
table.scenegraph.tableGroup.addEventListener('pointerdown', (e) => {
|
|
48457
48617
|
if (table.hasListeners(TABLE_EVENT_TYPE.MOUSEDOWN_TABLE)) {
|
|
48458
48618
|
table.fireListeners(TABLE_EVENT_TYPE.MOUSEDOWN_TABLE, {
|
|
@@ -48476,6 +48636,9 @@
|
|
|
48476
48636
|
if (eventArgsSet.eventArgs?.target !== stateManager.residentHoverIcon?.icon) {
|
|
48477
48637
|
stateManager.hideMenu();
|
|
48478
48638
|
}
|
|
48639
|
+
if (eventArgsSet?.eventArgs?.target.type === 'chart') {
|
|
48640
|
+
return;
|
|
48641
|
+
}
|
|
48479
48642
|
const isCompleteEdit = table.editorManager?.completeEdit(e.nativeEvent);
|
|
48480
48643
|
getPromiseValue(isCompleteEdit, isCompleteEdit => {
|
|
48481
48644
|
if (isCompleteEdit === false) {
|
|
@@ -50642,7 +50805,7 @@
|
|
|
50642
50805
|
iconPropKeys.forEach(k => {
|
|
50643
50806
|
if (typeof iconOpt[k] !== 'undefined') {
|
|
50644
50807
|
const f = this._table.getFieldData(iconOpt[k], col, row);
|
|
50645
|
-
if (f
|
|
50808
|
+
if (isValid$1(f)) {
|
|
50646
50809
|
retIcon[k] = f;
|
|
50647
50810
|
}
|
|
50648
50811
|
else if (!this._table._hasField?.(iconOpt[k], col, row)) {
|
|
@@ -53708,6 +53871,8 @@
|
|
|
53708
53871
|
if (!axisRange) {
|
|
53709
53872
|
return;
|
|
53710
53873
|
}
|
|
53874
|
+
const chartCellStyle = layout._table._getCellStyle(col, row + 1);
|
|
53875
|
+
const padding = getQuadProps(getProp('padding', chartCellStyle, col, row + 1, layout._table));
|
|
53711
53876
|
const { range, ticks, axisOption, isZeroAlign, theme } = axisRange;
|
|
53712
53877
|
if (isZeroAlign) {
|
|
53713
53878
|
const subAxisRange = getRange$1('bottom', col, row + 1, col, layout.columnHeaderLevelCount - 1, col, row, 0, layout);
|
|
@@ -53741,7 +53906,8 @@
|
|
|
53741
53906
|
flush: true
|
|
53742
53907
|
},
|
|
53743
53908
|
__ticksForVTable: ticks,
|
|
53744
|
-
__vtableChartTheme: theme
|
|
53909
|
+
__vtableChartTheme: theme,
|
|
53910
|
+
__vtablePadding: padding
|
|
53745
53911
|
});
|
|
53746
53912
|
}
|
|
53747
53913
|
else if (row === layout.rowCount - layout.bottomFrozenRowCount &&
|
|
@@ -53759,6 +53925,8 @@
|
|
|
53759
53925
|
if (!axisRange) {
|
|
53760
53926
|
return;
|
|
53761
53927
|
}
|
|
53928
|
+
const chartCellStyle = layout._table._getCellStyle(col, row - 1);
|
|
53929
|
+
const padding = getQuadProps(getProp('padding', chartCellStyle, col, row - 1, layout._table));
|
|
53762
53930
|
const { range, ticks, axisOption, isZeroAlign, theme } = axisRange;
|
|
53763
53931
|
if (isZeroAlign) {
|
|
53764
53932
|
const subAxisRange = getRange$1('top', col, row - 1, col, row, col, row, 1, layout);
|
|
@@ -53796,7 +53964,8 @@
|
|
|
53796
53964
|
flush: true
|
|
53797
53965
|
},
|
|
53798
53966
|
__ticksForVTable: ticks,
|
|
53799
|
-
__vtableChartTheme: theme
|
|
53967
|
+
__vtableChartTheme: theme,
|
|
53968
|
+
__vtablePadding: padding
|
|
53800
53969
|
});
|
|
53801
53970
|
}
|
|
53802
53971
|
else if (col === layout.rowHeaderLevelCount - 1 &&
|
|
@@ -53813,6 +53982,8 @@
|
|
|
53813
53982
|
if (axisOption?.visible === false) {
|
|
53814
53983
|
return;
|
|
53815
53984
|
}
|
|
53985
|
+
const chartCellStyle = layout._table._getCellStyle(col + 1, row);
|
|
53986
|
+
const padding = getQuadProps(getProp('padding', chartCellStyle, col + 1, row, layout._table));
|
|
53816
53987
|
const spec = layout.getRawChartSpec(col + 1, row);
|
|
53817
53988
|
return merge({
|
|
53818
53989
|
domain: axisOption?.type === 'linear' ? undefined : Array.from(domain),
|
|
@@ -53824,7 +53995,8 @@
|
|
|
53824
53995
|
orient: 'left',
|
|
53825
53996
|
type: axisOption?.type ?? 'band',
|
|
53826
53997
|
__vtableChartTheme: theme,
|
|
53827
|
-
inverse: transformInverse(axisOption, (spec?.direction ?? (chartType === 'scatter' ? 'vertical' : 'horizontal')) === "horizontal")
|
|
53998
|
+
inverse: transformInverse(axisOption, (spec?.direction ?? (chartType === 'scatter' ? 'vertical' : 'horizontal')) === "horizontal"),
|
|
53999
|
+
__vtablePadding: padding
|
|
53828
54000
|
});
|
|
53829
54001
|
}
|
|
53830
54002
|
}
|
|
@@ -53844,6 +54016,8 @@
|
|
|
53844
54016
|
if (!axisRange) {
|
|
53845
54017
|
return;
|
|
53846
54018
|
}
|
|
54019
|
+
const chartCellStyle = layout._table._getCellStyle(col + 1, row);
|
|
54020
|
+
const padding = getQuadProps(getProp('padding', chartCellStyle, col + 1, row, layout._table));
|
|
53847
54021
|
const { range, ticks, axisOption, isZeroAlign, theme } = axisRange;
|
|
53848
54022
|
if (isZeroAlign) {
|
|
53849
54023
|
const subAxisRange = getRange$1('right', col + 1, row, col, row, col, row, 1, layout);
|
|
@@ -53882,7 +54056,8 @@
|
|
|
53882
54056
|
flush: true
|
|
53883
54057
|
},
|
|
53884
54058
|
__ticksForVTable: ticks,
|
|
53885
|
-
__vtableChartTheme: theme
|
|
54059
|
+
__vtableChartTheme: theme,
|
|
54060
|
+
__vtablePadding: padding
|
|
53886
54061
|
});
|
|
53887
54062
|
}
|
|
53888
54063
|
else if (col === layout.colCount - layout.rightFrozenColCount &&
|
|
@@ -53892,6 +54067,8 @@
|
|
|
53892
54067
|
if (!axisRange) {
|
|
53893
54068
|
return;
|
|
53894
54069
|
}
|
|
54070
|
+
const chartCellStyle = layout._table._getCellStyle(col - 1, row);
|
|
54071
|
+
const padding = getQuadProps(getProp('padding', chartCellStyle, col - 1, row, layout._table));
|
|
53895
54072
|
const { range, ticks, axisOption, isZeroAlign, theme } = axisRange;
|
|
53896
54073
|
if (isZeroAlign) {
|
|
53897
54074
|
const subAxisRange = getRange$1('left', col - 1, row, layout.rowHeaderLevelCount - 1, row, col, row, 0, layout);
|
|
@@ -53928,7 +54105,8 @@
|
|
|
53928
54105
|
flush: true
|
|
53929
54106
|
},
|
|
53930
54107
|
__ticksForVTable: ticks,
|
|
53931
|
-
__vtableChartTheme: theme
|
|
54108
|
+
__vtableChartTheme: theme,
|
|
54109
|
+
__vtablePadding: padding
|
|
53932
54110
|
});
|
|
53933
54111
|
}
|
|
53934
54112
|
else if (row === layout.rowCount - layout.bottomFrozenRowCount &&
|
|
@@ -53945,13 +54123,16 @@
|
|
|
53945
54123
|
if (axisOption?.visible === false) {
|
|
53946
54124
|
return;
|
|
53947
54125
|
}
|
|
54126
|
+
const chartCellStyle = layout._table._getCellStyle(col, row - 1);
|
|
54127
|
+
const padding = getQuadProps(getProp('padding', chartCellStyle, col, row - 1, layout._table));
|
|
53948
54128
|
return merge({
|
|
53949
54129
|
domain: axisOption?.type === 'linear' ? undefined : Array.from(domain),
|
|
53950
54130
|
range: axisOption?.type === 'linear' ? domain : undefined
|
|
53951
54131
|
}, axisOption, {
|
|
53952
54132
|
orient: 'bottom',
|
|
53953
54133
|
type: axisOption?.type ?? 'band',
|
|
53954
|
-
__vtableChartTheme: theme
|
|
54134
|
+
__vtableChartTheme: theme,
|
|
54135
|
+
__vtablePadding: padding
|
|
53955
54136
|
});
|
|
53956
54137
|
}
|
|
53957
54138
|
}
|
|
@@ -54107,7 +54288,9 @@
|
|
|
54107
54288
|
range.max = range.max > 0 ? 1 : 0;
|
|
54108
54289
|
}
|
|
54109
54290
|
const getAxisDomainRangeAndLabels = Factory.getFunction('getAxisDomainRangeAndLabels');
|
|
54110
|
-
const { range: niceRange, ticks } = getAxisDomainRangeAndLabels(range.min, range.max, axisOption, isZeroAlign,
|
|
54291
|
+
const { range: niceRange, ticks } = getAxisDomainRangeAndLabels(range.min, range.max, axisOption, isZeroAlign, position === 'bottom' || position === 'top'
|
|
54292
|
+
? layout._table.getColWidth(col) || layout._table.tableNoFrameWidth
|
|
54293
|
+
: layout._table.getRowHeight(row) || layout._table.tableNoFrameHeight);
|
|
54111
54294
|
range.min = !isNaN(niceRange[0]) ? niceRange[0] : 0;
|
|
54112
54295
|
range.max = !isNaN(niceRange[1]) ? niceRange[1] : 1;
|
|
54113
54296
|
if (isNumber$2(axisOption?.min)) {
|
|
@@ -54441,7 +54624,7 @@
|
|
|
54441
54624
|
return TABLE_EVENT_TYPE;
|
|
54442
54625
|
}
|
|
54443
54626
|
options;
|
|
54444
|
-
version = "1.7.5
|
|
54627
|
+
version = "1.7.5";
|
|
54445
54628
|
pagination;
|
|
54446
54629
|
id = `VTable${Date.now()}`;
|
|
54447
54630
|
headerStyleCache;
|
|
@@ -56269,7 +56452,7 @@
|
|
|
56269
56452
|
return undefined;
|
|
56270
56453
|
}
|
|
56271
56454
|
_hasField(field, col, row) {
|
|
56272
|
-
if (field
|
|
56455
|
+
if (field === null) {
|
|
56273
56456
|
return false;
|
|
56274
56457
|
}
|
|
56275
56458
|
const table = this;
|
|
@@ -56398,17 +56581,19 @@
|
|
|
56398
56581
|
icons = this.internalProps.headerHelper.getIcons(col, row);
|
|
56399
56582
|
}
|
|
56400
56583
|
else if (this.internalProps.layoutMap.isSeriesNumber(col, row)) {
|
|
56401
|
-
|
|
56402
|
-
?.
|
|
56403
|
-
|
|
56404
|
-
|
|
56584
|
+
if (!this.options.groupBy || !this.getCellRawRecord(col, row)?.vtableMerge) {
|
|
56585
|
+
const dragOrder = this.internalProps.layoutMap.getSeriesNumberBody(col, row)?.define
|
|
56586
|
+
?.dragOrder;
|
|
56587
|
+
if (dragOrder) {
|
|
56588
|
+
icons = this.internalProps.rowSeriesNumberHelper.getIcons(col, row);
|
|
56589
|
+
}
|
|
56405
56590
|
}
|
|
56406
56591
|
const cellValue = this.getCellValue(col, row);
|
|
56407
56592
|
const dataValue = this.getCellOriginValue(col, row);
|
|
56408
56593
|
const ctx = this.internalProps.context;
|
|
56409
56594
|
const cellIcon = this.internalProps.bodyHelper.getIcons(col, row, cellValue, dataValue, ctx);
|
|
56410
56595
|
if (icons?.length > 0) {
|
|
56411
|
-
icons = icons.concat();
|
|
56596
|
+
icons = icons.concat(cellIcon);
|
|
56412
56597
|
}
|
|
56413
56598
|
else if (cellIcon?.length > 0) {
|
|
56414
56599
|
icons = cellIcon;
|
|
@@ -58076,7 +58261,9 @@
|
|
|
58076
58261
|
}
|
|
58077
58262
|
if (axisOption?.nice) {
|
|
58078
58263
|
const getAxisDomainRangeAndLabels = Factory.getFunction('getAxisDomainRangeAndLabels');
|
|
58079
|
-
const { range: axisRange } = getAxisDomainRangeAndLabels(range.min, range.max, axisOption, isZeroAlign,
|
|
58264
|
+
const { range: axisRange } = getAxisDomainRangeAndLabels(range.min, range.max, axisOption, isZeroAlign, position === 'bottom' || position === 'top'
|
|
58265
|
+
? layout._table.getColWidth(col) || layout._table.tableNoFrameWidth
|
|
58266
|
+
: layout._table.getRowHeight(row) || layout._table.tableNoFrameHeight);
|
|
58080
58267
|
range.min = axisRange[0];
|
|
58081
58268
|
range.max = axisRange[1];
|
|
58082
58269
|
}
|
|
@@ -59819,27 +60006,19 @@
|
|
|
59819
60006
|
return cellUpdateType;
|
|
59820
60007
|
}
|
|
59821
60008
|
function sortRecords(table) {
|
|
59822
|
-
|
|
59823
|
-
|
|
59824
|
-
|
|
59825
|
-
|
|
59826
|
-
|
|
59827
|
-
|
|
59828
|
-
|
|
59829
|
-
|
|
59830
|
-
else {
|
|
59831
|
-
({ order, field } = table.sortState);
|
|
59832
|
-
}
|
|
59833
|
-
if (order && field && order !== 'normal') {
|
|
59834
|
-
const sortFunc = table._getSortFuncFromHeaderOption(undefined, field);
|
|
59835
|
-
const hd = table.internalProps.layoutMap.headerObjects.find((col) => col && col.field === field);
|
|
59836
|
-
hd && table.dataSource.sort(hd.field, order, sortFunc ?? defaultOrderFn);
|
|
59837
|
-
}
|
|
60009
|
+
let sortState = table.sortState;
|
|
60010
|
+
sortState = !sortState || Array.isArray(sortState) ? sortState : [sortState];
|
|
60011
|
+
if (sortState) {
|
|
60012
|
+
sortState = sortState.map(item => {
|
|
60013
|
+
item.orderFn = table._getSortFuncFromHeaderOption(undefined, item.field) ?? defaultOrderFn;
|
|
60014
|
+
return item;
|
|
60015
|
+
});
|
|
60016
|
+
table.dataSource.sort(sortState);
|
|
59838
60017
|
}
|
|
59839
60018
|
}
|
|
59840
60019
|
function listTableAddRecord(record, recordIndex, table) {
|
|
59841
60020
|
if (table.options.groupBy) {
|
|
59842
|
-
table.dataSource.addRecordsForGroup?.([record]);
|
|
60021
|
+
table.dataSource.addRecordsForGroup?.([record], recordIndex);
|
|
59843
60022
|
table.refreshRowColCount();
|
|
59844
60023
|
table.internalProps.layoutMap.clearCellRangeMap();
|
|
59845
60024
|
table.scenegraph.clearCells();
|
|
@@ -59922,7 +60101,7 @@
|
|
|
59922
60101
|
}
|
|
59923
60102
|
function listTableAddRecords(records, recordIndex, table) {
|
|
59924
60103
|
if (table.options.groupBy) {
|
|
59925
|
-
table.dataSource.addRecordsForGroup?.(records);
|
|
60104
|
+
table.dataSource.addRecordsForGroup?.(records, recordIndex);
|
|
59926
60105
|
table.refreshRowColCount();
|
|
59927
60106
|
table.internalProps.layoutMap.clearCellRangeMap();
|
|
59928
60107
|
table.scenegraph.clearCells();
|
|
@@ -60182,6 +60361,7 @@
|
|
|
60182
60361
|
internalProps.frozenColDragHeaderMode = options.frozenColDragHeaderMode;
|
|
60183
60362
|
this.pagination = options.pagination;
|
|
60184
60363
|
internalProps.sortState = options.sortState;
|
|
60364
|
+
internalProps.multipleSort = !!options.multipleSort;
|
|
60185
60365
|
internalProps.dataConfig = options.groupBy ? getGroupByDataConfig(options.groupBy) : {};
|
|
60186
60366
|
internalProps.columns = options.columns
|
|
60187
60367
|
? cloneDeepSpec(options.columns, ['children'])
|
|
@@ -60308,6 +60488,14 @@
|
|
|
60308
60488
|
const { title } = table.internalProps.layoutMap.getSeriesNumberHeader(col, row);
|
|
60309
60489
|
return title;
|
|
60310
60490
|
}
|
|
60491
|
+
if (this.options.groupBy) {
|
|
60492
|
+
const { vtableMerge } = table.getCellRawRecord(col, row);
|
|
60493
|
+
if (vtableMerge) {
|
|
60494
|
+
return '';
|
|
60495
|
+
}
|
|
60496
|
+
const indexs = this.dataSource.currentIndexedData[row - this.columnHeaderLevelCount];
|
|
60497
|
+
return indexs[indexs.length - 1] + 1;
|
|
60498
|
+
}
|
|
60311
60499
|
const { format } = table.internalProps.layoutMap.getSeriesNumberBody(col, row);
|
|
60312
60500
|
return typeof format === 'function' ? format(col, row, this) : row - this.columnHeaderLevelCount + 1;
|
|
60313
60501
|
}
|
|
@@ -60778,8 +60966,10 @@
|
|
|
60778
60966
|
if (!sortState) {
|
|
60779
60967
|
if (this.internalProps.sortState) {
|
|
60780
60968
|
if (Array.isArray(this.internalProps.sortState)) {
|
|
60781
|
-
|
|
60782
|
-
|
|
60969
|
+
for (let i = 0; i < this.internalProps.sortState.length; i++) {
|
|
60970
|
+
sortState = this.internalProps.sortState?.[i];
|
|
60971
|
+
sortState && (sortState.order = 'normal');
|
|
60972
|
+
}
|
|
60783
60973
|
}
|
|
60784
60974
|
else {
|
|
60785
60975
|
this.internalProps.sortState.order = 'normal';
|
|
@@ -60790,27 +60980,24 @@
|
|
|
60790
60980
|
else {
|
|
60791
60981
|
this.internalProps.sortState = sortState;
|
|
60792
60982
|
}
|
|
60793
|
-
|
|
60794
|
-
|
|
60795
|
-
|
|
60796
|
-
|
|
60797
|
-
|
|
60798
|
-
|
|
60799
|
-
|
|
60800
|
-
|
|
60801
|
-
|
|
60802
|
-
|
|
60803
|
-
|
|
60804
|
-
|
|
60805
|
-
const hd = this.internalProps.layoutMap.headerObjects.find((col) => col && col.field === field);
|
|
60806
|
-
if (hd && hd.define.sort !== false) {
|
|
60807
|
-
this.dataSource.sort(hd.field, order, sortFunc);
|
|
60983
|
+
sortState = Array.isArray(sortState) ? sortState : [sortState];
|
|
60984
|
+
if (sortState.some((item) => item.field) && executeSort) {
|
|
60985
|
+
if (this.internalProps.layoutMap.headerObjects.some(item => item.define.sort !== false)) {
|
|
60986
|
+
this.dataSource.sort(sortState.map((item) => {
|
|
60987
|
+
const sortFunc = this._getSortFuncFromHeaderOption(this.internalProps.columns, item.field);
|
|
60988
|
+
this.internalProps.layoutMap.headerObjects.find((col) => col && col.field === item.field);
|
|
60989
|
+
return {
|
|
60990
|
+
field: item.field,
|
|
60991
|
+
order: item.order,
|
|
60992
|
+
orderFn: sortFunc
|
|
60993
|
+
};
|
|
60994
|
+
}));
|
|
60808
60995
|
this.internalProps.layoutMap.clearCellRangeMap();
|
|
60809
60996
|
this.internalProps.useOneRowHeightFillAll = false;
|
|
60810
60997
|
this.scenegraph.sortCell();
|
|
60811
60998
|
}
|
|
60812
60999
|
}
|
|
60813
|
-
if (sortState) {
|
|
61000
|
+
if (sortState.length) {
|
|
60814
61001
|
this.stateManager.updateSortState(sortState);
|
|
60815
61002
|
}
|
|
60816
61003
|
}
|
|
@@ -60884,27 +61071,24 @@
|
|
|
60884
61071
|
const oldHoverState = { col: this.stateManager.hover.cellPos.col, row: this.stateManager.hover.cellPos.row };
|
|
60885
61072
|
this.scenegraph.clearCells();
|
|
60886
61073
|
if (sort !== undefined) {
|
|
60887
|
-
this.internalProps.sortState = sort;
|
|
61074
|
+
this.internalProps.sortState = this.internalProps.multipleSort ? (Array.isArray(sort) ? sort : [sort]) : sort;
|
|
60888
61075
|
this.stateManager.setSortState(this.sortState);
|
|
60889
61076
|
}
|
|
60890
61077
|
if (records) {
|
|
60891
61078
|
_setRecords(this, records);
|
|
60892
61079
|
if (this.sortState) {
|
|
60893
|
-
|
|
60894
|
-
|
|
60895
|
-
|
|
60896
|
-
|
|
60897
|
-
|
|
60898
|
-
|
|
60899
|
-
|
|
60900
|
-
|
|
60901
|
-
|
|
60902
|
-
|
|
60903
|
-
|
|
60904
|
-
|
|
60905
|
-
const hd = this.internalProps.layoutMap.headerObjectsIncludeHided.find((col) => col && col.field === field);
|
|
60906
|
-
if (hd && hd.define.sort !== false) {
|
|
60907
|
-
this.dataSource.sort(hd.field, order, sortFunc ?? defaultOrderFn);
|
|
61080
|
+
const sortState = Array.isArray(this.sortState) ? this.sortState : [this.sortState];
|
|
61081
|
+
if (sortState.some((item) => item.order && item.field && item.order !== 'normal')) {
|
|
61082
|
+
if (this.internalProps.layoutMap.headerObjectsIncludeHided.some(item => item.define.sort !== false)) {
|
|
61083
|
+
this.dataSource.sort(sortState.map((item) => {
|
|
61084
|
+
const sortFunc = this._getSortFuncFromHeaderOption(undefined, item.field);
|
|
61085
|
+
this.internalProps.layoutMap.headerObjectsIncludeHided.find((col) => col && col.field === item.field);
|
|
61086
|
+
return {
|
|
61087
|
+
field: item.field,
|
|
61088
|
+
order: item.order || 'asc',
|
|
61089
|
+
orderFn: sortFunc ?? defaultOrderFn
|
|
61090
|
+
};
|
|
61091
|
+
}));
|
|
60908
61092
|
}
|
|
60909
61093
|
}
|
|
60910
61094
|
}
|
|
@@ -61516,7 +61700,9 @@
|
|
|
61516
61700
|
tickData;
|
|
61517
61701
|
scale;
|
|
61518
61702
|
component;
|
|
61703
|
+
padding;
|
|
61519
61704
|
constructor(option, width, height, padding, table) {
|
|
61705
|
+
this.padding = padding;
|
|
61520
61706
|
this.table = table;
|
|
61521
61707
|
this.orient = option.orient ?? 'left';
|
|
61522
61708
|
this.type = option.type ?? 'band';
|
|
@@ -61525,13 +61711,13 @@
|
|
|
61525
61711
|
const innerOffsetTop = 0;
|
|
61526
61712
|
const innerOffsetBottom = 0;
|
|
61527
61713
|
this.width = width;
|
|
61528
|
-
this.height = height - padding[2] - innerOffsetBottom;
|
|
61714
|
+
this.height = height - padding[0] - padding[2] - innerOffsetBottom;
|
|
61529
61715
|
this.y = padding[0] + innerOffsetTop;
|
|
61530
61716
|
}
|
|
61531
61717
|
else if (this.orient === 'top' || this.orient === 'bottom') {
|
|
61532
61718
|
const innerOffsetLeft = 0;
|
|
61533
61719
|
const innerOffsetRight = 0;
|
|
61534
|
-
this.width = width - padding[1] - innerOffsetRight;
|
|
61720
|
+
this.width = width - padding[1] - padding[3] - innerOffsetRight;
|
|
61535
61721
|
this.height = height;
|
|
61536
61722
|
this.x = padding[3] + innerOffsetLeft;
|
|
61537
61723
|
}
|
|
@@ -61609,19 +61795,19 @@
|
|
|
61609
61795
|
this.component = new LineAxis(merge({
|
|
61610
61796
|
disableTriggerEvent: this.table.options.disableInteraction
|
|
61611
61797
|
}, axisStylrAttrs, attrs));
|
|
61612
|
-
this.component.setAttributes(this.setLayoutStartPosition({ x:
|
|
61798
|
+
this.component.setAttributes(this.setLayoutStartPosition({ x: this.x, y: this.y }));
|
|
61613
61799
|
this.component.originAxis = this;
|
|
61614
61800
|
}
|
|
61615
61801
|
resize(width, height) {
|
|
61616
|
-
this.width = width;
|
|
61617
|
-
this.height = height;
|
|
61802
|
+
this.width = width - (this.orient === 'top' || this.orient === 'bottom' ? this.padding[1] + this.padding[3] : 0);
|
|
61803
|
+
this.height = height - (this.orient === 'left' || this.orient === 'right' ? this.padding[2] + this.padding[0] : 0);
|
|
61618
61804
|
this.updateScaleRange();
|
|
61619
61805
|
this.computeData();
|
|
61620
61806
|
const axisStylrAttrs = getAxisAttributes(this.option);
|
|
61621
61807
|
const attrs = this.getUpdateAttribute();
|
|
61622
61808
|
attrs.verticalFactor = this.orient === 'top' || this.orient === 'right' ? -1 : 1;
|
|
61623
61809
|
this.component.setAttributes(merge({}, axisStylrAttrs, attrs));
|
|
61624
|
-
this.component.setAttributes(this.setLayoutStartPosition({ x:
|
|
61810
|
+
this.component.setAttributes(this.setLayoutStartPosition({ x: this.x, y: this.y }));
|
|
61625
61811
|
this.overlap();
|
|
61626
61812
|
}
|
|
61627
61813
|
overlap() {
|
|
@@ -61651,7 +61837,7 @@
|
|
|
61651
61837
|
}
|
|
61652
61838
|
const size = this.orient === 'top' || this.orient === 'bottom' ? height : width;
|
|
61653
61839
|
const attrs = {
|
|
61654
|
-
start: { x:
|
|
61840
|
+
start: { x: 0, y: 0 },
|
|
61655
61841
|
end,
|
|
61656
61842
|
title: {
|
|
61657
61843
|
text: this.option.title.text,
|
|
@@ -64694,7 +64880,7 @@
|
|
|
64694
64880
|
for (let i = 0; i < domain.length; i++) {
|
|
64695
64881
|
let valid = false;
|
|
64696
64882
|
for (let j = 0; j < values.length; j++) {
|
|
64697
|
-
if (domain[i]
|
|
64883
|
+
if (domain[i] === values[j]) {
|
|
64698
64884
|
const data = dataValue[j];
|
|
64699
64885
|
if (!isValid$1(data[xField]) || !isValid$1(data[yField])) {
|
|
64700
64886
|
break;
|
|
@@ -68948,6 +69134,7 @@
|
|
|
68948
69134
|
class Dataset {
|
|
68949
69135
|
dataConfig;
|
|
68950
69136
|
records;
|
|
69137
|
+
filteredRecords;
|
|
68951
69138
|
tree = {};
|
|
68952
69139
|
changedTree = {};
|
|
68953
69140
|
colFlatKeys = {};
|
|
@@ -69205,18 +69392,29 @@
|
|
|
69205
69392
|
isNeedFilter = true;
|
|
69206
69393
|
}
|
|
69207
69394
|
if (Array.isArray(this.records)) {
|
|
69395
|
+
if (!this.filteredRecords) {
|
|
69396
|
+
this.filteredRecords = [];
|
|
69397
|
+
}
|
|
69208
69398
|
for (let i = 0, len = this.records.length; i < len; i++) {
|
|
69209
69399
|
const record = this.records[i];
|
|
69210
69400
|
if (!isNeedFilter || this.filterRecord(record)) {
|
|
69401
|
+
this.filteredRecords.push(record);
|
|
69211
69402
|
this.processRecord(record);
|
|
69212
69403
|
}
|
|
69213
69404
|
}
|
|
69214
69405
|
}
|
|
69215
69406
|
else {
|
|
69407
|
+
if (!this.filteredRecords) {
|
|
69408
|
+
this.filteredRecords = {};
|
|
69409
|
+
}
|
|
69216
69410
|
for (const key in this.records) {
|
|
69217
69411
|
for (let i = 0, len = this.records[key].length; i < len; i++) {
|
|
69218
69412
|
const record = this.records[key][i];
|
|
69219
69413
|
if (!isNeedFilter || this.filterRecord(record)) {
|
|
69414
|
+
if (!this.filteredRecords[key]) {
|
|
69415
|
+
this.filteredRecords[key] = [];
|
|
69416
|
+
}
|
|
69417
|
+
this.filteredRecords[key].push(record);
|
|
69220
69418
|
this.processRecord(record, key);
|
|
69221
69419
|
}
|
|
69222
69420
|
}
|
|
@@ -69542,6 +69740,7 @@
|
|
|
69542
69740
|
}
|
|
69543
69741
|
updateFilterRules(filterRules, isResetTree = false) {
|
|
69544
69742
|
this.filterRules = filterRules;
|
|
69743
|
+
this.filteredRecords = undefined;
|
|
69545
69744
|
if (isResetTree) {
|
|
69546
69745
|
this.tree = {};
|
|
69547
69746
|
}
|
|
@@ -71711,6 +71910,9 @@
|
|
|
71711
71910
|
this.dataset.updateFilterRules(filterRules);
|
|
71712
71911
|
this.renderWithRecreateCells();
|
|
71713
71912
|
}
|
|
71913
|
+
getFilteredRecords() {
|
|
71914
|
+
return this.dataset?.filterRules;
|
|
71915
|
+
}
|
|
71714
71916
|
}
|
|
71715
71917
|
|
|
71716
71918
|
registerAxis();
|
|
@@ -73361,7 +73563,7 @@
|
|
|
73361
73563
|
}
|
|
73362
73564
|
|
|
73363
73565
|
registerForVrender();
|
|
73364
|
-
const version = "1.7.5
|
|
73566
|
+
const version = "1.7.5";
|
|
73365
73567
|
function getIcons() {
|
|
73366
73568
|
return get$2();
|
|
73367
73569
|
}
|