@visactor/vtable 1.23.3-alpha.0 → 1.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/ListTable.d.ts +1 -0
- package/cjs/ListTable.js +182 -24
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotTable.d.ts +1 -0
- package/cjs/PivotTable.js +10 -2
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +9 -0
- package/cjs/core/BaseTable.js +64 -15
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/TABLE_EVENT_TYPE.d.ts +2 -0
- package/cjs/core/TABLE_EVENT_TYPE.js +2 -0
- package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
- package/cjs/core/record-helper.js +83 -13
- package/cjs/core/record-helper.js.map +1 -1
- package/cjs/data/DataSource.js +3 -2
- package/cjs/data/DataSource.js.map +1 -1
- package/cjs/dataset/DataStatistics.js +1 -2
- package/cjs/dataset/dataset.js +6 -1
- package/cjs/dataset/dataset.js.map +1 -1
- package/cjs/edit/edit-manager.js +24 -16
- package/cjs/edit/edit-manager.js.map +1 -1
- package/cjs/event/EventTarget.js +3 -1
- package/cjs/event/EventTarget.js.map +1 -1
- package/cjs/index.d.ts +3 -3
- package/cjs/index.js +51 -12
- package/cjs/index.js.map +1 -1
- package/cjs/layout/cell-range/simple-cell-range.js +14 -4
- package/cjs/layout/cell-range/simple-cell-range.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/init-scenegraph.js +1 -1
- package/cjs/scenegraph/group-creater/init-scenegraph.js.map +1 -1
- package/cjs/state/state.js +14 -11
- package/cjs/state/state.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +5 -0
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/events.d.ts +16 -0
- package/cjs/ts-types/events.js.map +1 -1
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +958 -232
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.d.ts +1 -0
- package/es/ListTable.js +177 -24
- package/es/ListTable.js.map +1 -1
- package/es/PivotTable.d.ts +1 -0
- package/es/PivotTable.js +8 -2
- package/es/PivotTable.js.map +1 -1
- package/es/core/BaseTable.d.ts +9 -0
- package/es/core/BaseTable.js +64 -15
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/TABLE_EVENT_TYPE.d.ts +2 -0
- package/es/core/TABLE_EVENT_TYPE.js +2 -0
- package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
- package/es/core/record-helper.js +83 -12
- package/es/core/record-helper.js.map +1 -1
- package/es/data/DataSource.js +3 -2
- package/es/data/DataSource.js.map +1 -1
- package/es/dataset/DataStatistics.js +1 -2
- package/es/dataset/dataset.js +7 -2
- package/es/dataset/dataset.js.map +1 -1
- package/es/edit/edit-manager.js +22 -16
- package/es/edit/edit-manager.js.map +1 -1
- package/es/event/EventTarget.js +3 -1
- package/es/event/EventTarget.js.map +1 -1
- package/es/index.d.ts +3 -3
- package/es/index.js +5 -3
- package/es/index.js.map +1 -1
- package/es/layout/cell-range/simple-cell-range.js +14 -4
- package/es/layout/cell-range/simple-cell-range.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.js +1 -1
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/init-scenegraph.js +1 -1
- package/es/scenegraph/group-creater/init-scenegraph.js.map +1 -1
- package/es/state/state.js +14 -11
- package/es/state/state.js.map +1 -1
- package/es/ts-types/base-table.d.ts +5 -0
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/events.d.ts +16 -0
- package/es/ts-types/events.js.map +1 -1
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +7 -7
package/dist/vtable.js
CHANGED
|
@@ -627,28 +627,59 @@
|
|
|
627
627
|
}
|
|
628
628
|
addEventListener(type, listener, options) {
|
|
629
629
|
if (!listener) return;
|
|
630
|
+
const capture = this._resolveCapture(options),
|
|
631
|
+
once = this._resolveOnce(options),
|
|
632
|
+
listenerTypeMap = this._getOrCreateListenerTypeMap(type),
|
|
633
|
+
wrappedMap = this._getOrCreateWrappedMap(listenerTypeMap, listener);
|
|
634
|
+
if (wrappedMap.has(capture)) return;
|
|
630
635
|
const wrappedListener = event => {
|
|
631
636
|
const transformedEvent = this._eventListenerTransformer(event);
|
|
632
|
-
"function" == typeof listener ? listener(transformedEvent) : listener.handleEvent && listener.handleEvent(transformedEvent);
|
|
637
|
+
"function" == typeof listener ? listener(transformedEvent) : listener.handleEvent && listener.handleEvent(transformedEvent), once && this._deleteListenerRecord(type, listener, capture);
|
|
633
638
|
};
|
|
634
|
-
|
|
639
|
+
wrappedMap.set(capture, {
|
|
640
|
+
wrappedListener: wrappedListener,
|
|
641
|
+
options: options
|
|
642
|
+
}), this._nativeAddEventListener(type, wrappedListener, options);
|
|
635
643
|
}
|
|
636
644
|
removeEventListener(type, listener, options) {
|
|
637
|
-
var _a;
|
|
645
|
+
var _a, _b;
|
|
638
646
|
if (!listener) return;
|
|
639
|
-
const
|
|
640
|
-
|
|
647
|
+
const capture = this._resolveCapture(options),
|
|
648
|
+
wrappedRecord = null === (_b = null === (_a = this._listenerMap.get(type)) || void 0 === _a ? void 0 : _a.get(listener)) || void 0 === _b ? void 0 : _b.get(capture);
|
|
649
|
+
wrappedRecord && (this._nativeRemoveEventListener(type, wrappedRecord.wrappedListener, capture), this._deleteListenerRecord(type, listener, capture));
|
|
641
650
|
}
|
|
642
651
|
dispatchEvent(event) {
|
|
643
652
|
return this._nativeDispatchEvent(event);
|
|
644
653
|
}
|
|
645
654
|
clearAllEventListeners() {
|
|
646
|
-
this._listenerMap.forEach((
|
|
647
|
-
|
|
648
|
-
|
|
655
|
+
this._listenerMap.forEach((listenerMap, type) => {
|
|
656
|
+
listenerMap.forEach(wrappedMap => {
|
|
657
|
+
wrappedMap.forEach((wrappedRecord, capture) => {
|
|
658
|
+
this._nativeRemoveEventListener(type, wrappedRecord.wrappedListener, capture);
|
|
659
|
+
});
|
|
649
660
|
});
|
|
650
661
|
}), this._listenerMap.clear();
|
|
651
662
|
}
|
|
663
|
+
_resolveCapture(options) {
|
|
664
|
+
return "boolean" == typeof options ? options : !!(null == options ? void 0 : options.capture);
|
|
665
|
+
}
|
|
666
|
+
_resolveOnce(options) {
|
|
667
|
+
return "object" == typeof options && !!(null == options ? void 0 : options.once);
|
|
668
|
+
}
|
|
669
|
+
_getOrCreateListenerTypeMap(type) {
|
|
670
|
+
let listenerTypeMap = this._listenerMap.get(type);
|
|
671
|
+
return listenerTypeMap || (listenerTypeMap = new Map(), this._listenerMap.set(type, listenerTypeMap)), listenerTypeMap;
|
|
672
|
+
}
|
|
673
|
+
_getOrCreateWrappedMap(listenerTypeMap, listener) {
|
|
674
|
+
let wrappedMap = listenerTypeMap.get(listener);
|
|
675
|
+
return wrappedMap || (wrappedMap = new Map(), listenerTypeMap.set(listener, wrappedMap)), wrappedMap;
|
|
676
|
+
}
|
|
677
|
+
_deleteListenerRecord(type, listener, capture) {
|
|
678
|
+
const listenerTypeMap = this._listenerMap.get(type);
|
|
679
|
+
if (!listenerTypeMap) return;
|
|
680
|
+
const wrappedMap = listenerTypeMap.get(listener);
|
|
681
|
+
wrappedMap && (wrappedMap.delete(capture), 0 === wrappedMap.size && listenerTypeMap.delete(listener), 0 === listenerTypeMap.size && this._listenerMap.delete(type));
|
|
682
|
+
}
|
|
652
683
|
_nativeAddEventListener(type, listener, options) {
|
|
653
684
|
throw new Error("_nativeAddEventListener must be implemented by derived classes");
|
|
654
685
|
}
|
|
@@ -1276,13 +1307,13 @@
|
|
|
1276
1307
|
const isDate = value => isType$1(value, "Date");
|
|
1277
1308
|
var isDate$1 = isDate;
|
|
1278
1309
|
|
|
1279
|
-
const isNumber$
|
|
1310
|
+
const isNumber$2 = (value, fuzzy = !1) => {
|
|
1280
1311
|
const type = typeof value;
|
|
1281
1312
|
return fuzzy ? "number" === type : "number" === type || isType$1(value, "Number");
|
|
1282
1313
|
};
|
|
1283
|
-
var isNumber$
|
|
1314
|
+
var isNumber$3 = isNumber$2;
|
|
1284
1315
|
|
|
1285
|
-
const isValidNumber = value => isNumber$
|
|
1316
|
+
const isValidNumber = value => isNumber$3(value) && Number.isFinite(value);
|
|
1286
1317
|
var isValidNumber$1 = isValidNumber;
|
|
1287
1318
|
|
|
1288
1319
|
const isValidUrl = value => new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(value);
|
|
@@ -1328,7 +1359,7 @@
|
|
|
1328
1359
|
if (!isValid$1(value) || "object" != typeof value || ignoreWhen && ignoreWhen(value)) return value;
|
|
1329
1360
|
const isArr = isArray$5(value),
|
|
1330
1361
|
length = value.length;
|
|
1331
|
-
result = isArr ? new Array(length) : "object" == typeof value ? {} : isBoolean$2(value) || isNumber$
|
|
1362
|
+
result = isArr ? new Array(length) : "object" == typeof value ? {} : isBoolean$2(value) || isNumber$3(value) || isString$2(value) ? value : isDate$1(value) ? new Date(+value) : void 0;
|
|
1332
1363
|
const props = isArr ? void 0 : Object.keys(Object(value));
|
|
1333
1364
|
let index = -1;
|
|
1334
1365
|
if (result) for (; ++index < (props || value).length;) {
|
|
@@ -1525,7 +1556,7 @@
|
|
|
1525
1556
|
}(LoggerLevel || (LoggerLevel = {}));
|
|
1526
1557
|
class Logger {
|
|
1527
1558
|
static getInstance(level, method) {
|
|
1528
|
-
return Logger._instance && isNumber$
|
|
1559
|
+
return Logger._instance && isNumber$3(level) ? Logger._instance.level(level) : Logger._instance || (Logger._instance = new Logger(level, method)), Logger._instance;
|
|
1529
1560
|
}
|
|
1530
1561
|
static setInstance(logger) {
|
|
1531
1562
|
return Logger._instance = logger;
|
|
@@ -1773,10 +1804,10 @@
|
|
|
1773
1804
|
return this.x = x, this.y = y, this;
|
|
1774
1805
|
}
|
|
1775
1806
|
add(point) {
|
|
1776
|
-
return isNumber$
|
|
1807
|
+
return isNumber$3(point) ? (this.x += point, void (this.y += point)) : (this.x += point.x, this.y += point.y, this);
|
|
1777
1808
|
}
|
|
1778
1809
|
sub(point) {
|
|
1779
|
-
return isNumber$
|
|
1810
|
+
return isNumber$3(point) ? (this.x -= point, void (this.y -= point)) : (this.x -= point.x, this.y -= point.y, this);
|
|
1780
1811
|
}
|
|
1781
1812
|
multi(point) {
|
|
1782
1813
|
throw new Error("暂不支持");
|
|
@@ -2783,10 +2814,10 @@
|
|
|
2783
2814
|
return ((value = Math.max(0, Math.min(255, Math.round(value) || 0))) < 16 ? "0" : "") + value.toString(16);
|
|
2784
2815
|
}
|
|
2785
2816
|
function rgb(value) {
|
|
2786
|
-
return isNumber$
|
|
2817
|
+
return isNumber$3(value) ? new RGB(value >> 16, value >> 8 & 255, 255 & value, 1) : isArray$5(value) ? new RGB(value[0], value[1], value[2]) : new RGB(255, 255, 255);
|
|
2787
2818
|
}
|
|
2788
2819
|
function rgba(value) {
|
|
2789
|
-
return isNumber$
|
|
2820
|
+
return isNumber$3(value) ? new RGB(value >>> 24, value >>> 16 & 255, value >>> 8 & 255, 255 & value) : isArray$5(value) ? new RGB(value[0], value[1], value[2], value[3]) : new RGB(255, 255, 255, 1);
|
|
2790
2821
|
}
|
|
2791
2822
|
function SRGBToLinear(c) {
|
|
2792
2823
|
return c < .04045 ? .0773993808 * c : Math.pow(.9478672986 * c + .0521327014, 2.4);
|
|
@@ -5600,6 +5631,9 @@
|
|
|
5600
5631
|
function isNotAroundZero(val) {
|
|
5601
5632
|
return val > EPSILON || val < -EPSILON;
|
|
5602
5633
|
}
|
|
5634
|
+
function isNumber$1(data) {
|
|
5635
|
+
return "number" == typeof data && Number.isFinite(data);
|
|
5636
|
+
}
|
|
5603
5637
|
const _v0 = [0, 0],
|
|
5604
5638
|
_v1 = [0, 0],
|
|
5605
5639
|
_v2 = [0, 0];
|
|
@@ -7162,7 +7196,9 @@
|
|
|
7162
7196
|
var _a;
|
|
7163
7197
|
if (event.manager !== this) throw new Error("It is illegal to free an event not managed by this EventManager!");
|
|
7164
7198
|
const constructor = event.constructor;
|
|
7165
|
-
this.eventPool.has(constructor) || this.eventPool.
|
|
7199
|
+
this.eventPool.has(constructor) || (this.eventPool.get(constructor).forEach(e => {
|
|
7200
|
+
e.eventPhase = event.NONE, e.currentTarget = null, e.path = [], e.detailPath = [], e.target = null;
|
|
7201
|
+
}), this.eventPool.set(constructor, [])), null === (_a = this.eventPool.get(constructor)) || void 0 === _a || _a.push(event);
|
|
7166
7202
|
}
|
|
7167
7203
|
notifyListeners(e, type) {
|
|
7168
7204
|
const listeners = e.currentTarget._events[type];
|
|
@@ -7600,13 +7636,13 @@
|
|
|
7600
7636
|
|
|
7601
7637
|
class BaseSymbol {
|
|
7602
7638
|
bounds(size, bounds) {
|
|
7603
|
-
if (isNumber$
|
|
7639
|
+
if (isNumber$3(size)) {
|
|
7604
7640
|
const halfS = size / 2;
|
|
7605
7641
|
bounds.x1 = -halfS, bounds.x2 = halfS, bounds.y1 = -halfS, bounds.y2 = halfS;
|
|
7606
7642
|
} else bounds.x1 = -size[0] / 2, bounds.x2 = size[0] / 2, bounds.y1 = -size[1] / 2, bounds.y2 = size[1] / 2;
|
|
7607
7643
|
}
|
|
7608
7644
|
parseSize(size) {
|
|
7609
|
-
return isNumber$
|
|
7645
|
+
return isNumber$3(size) ? size : Math.min(size[0], size[1]);
|
|
7610
7646
|
}
|
|
7611
7647
|
}
|
|
7612
7648
|
|
|
@@ -8022,10 +8058,10 @@
|
|
|
8022
8058
|
super(...arguments), this.type = "rect", this.pathStr = "M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z";
|
|
8023
8059
|
}
|
|
8024
8060
|
draw(ctx, size, x, y) {
|
|
8025
|
-
return isNumber$
|
|
8061
|
+
return isNumber$3(size) ? rectSize(ctx, size, x, y) : rectSizeArray(ctx, size, x, y);
|
|
8026
8062
|
}
|
|
8027
8063
|
drawWithClipRange(ctx, size, x, y, clipRange, z, cb) {
|
|
8028
|
-
isNumber$
|
|
8064
|
+
isNumber$3(size) && (size = [size, size / 2]);
|
|
8029
8065
|
const drawLength = 2 * (size[0] + size[1]) * clipRange,
|
|
8030
8066
|
points = [{
|
|
8031
8067
|
x: x + size[0] / 2,
|
|
@@ -8057,7 +8093,7 @@
|
|
|
8057
8093
|
return !1;
|
|
8058
8094
|
}
|
|
8059
8095
|
drawOffset(ctx, size, x, y, offset) {
|
|
8060
|
-
return isNumber$
|
|
8096
|
+
return isNumber$3(size) ? rectSize(ctx, size + 2 * offset, x, y) : rectSizeArray(ctx, [size[0] + 2 * offset, size[1] + 2 * offset], x, y);
|
|
8061
8097
|
}
|
|
8062
8098
|
}
|
|
8063
8099
|
var rect = new RectSymbol();
|
|
@@ -8076,7 +8112,7 @@
|
|
|
8076
8112
|
return size = this.parseSize(size), this.drawOffset(ctx, size, x, y, 0, z, cb);
|
|
8077
8113
|
}
|
|
8078
8114
|
parseSize(size) {
|
|
8079
|
-
return isNumber$
|
|
8115
|
+
return isNumber$3(size) ? size : Math.min(size[0], size[1]);
|
|
8080
8116
|
}
|
|
8081
8117
|
drawWithClipRange(ctx, size, x, y, clipRange, z, cb) {
|
|
8082
8118
|
return size = this.parseSize(size), this.isSvg ? !!this.svgCache && (this.svgCache.forEach(item => {
|
|
@@ -8888,10 +8924,10 @@
|
|
|
8888
8924
|
ColorStore.store255 = {}, ColorStore.store1 = {};
|
|
8889
8925
|
|
|
8890
8926
|
function colorArrayToString(color, alphaChannel = !1) {
|
|
8891
|
-
return Array.isArray(color) && isNumber$
|
|
8927
|
+
return Array.isArray(color) && isNumber$3(color[0]) ? alphaChannel ? `rgb(${Math.round(color[0])},${Math.round(color[1])},${Math.round(color[2])},${color[3].toFixed(2)})` : `rgb(${Math.round(color[0])},${Math.round(color[1])},${Math.round(color[2])})` : color;
|
|
8892
8928
|
}
|
|
8893
8929
|
function interpolateColor(from, to, ratio, alphaChannel, cb) {
|
|
8894
|
-
if (Array.isArray(from) && !isNumber$
|
|
8930
|
+
if (Array.isArray(from) && !isNumber$3(from[0]) || Array.isArray(to) && !isNumber$3(to[0])) {
|
|
8895
8931
|
return new Array(4).fill(0).map((_, index) => {
|
|
8896
8932
|
var _a, _b;
|
|
8897
8933
|
return _interpolateColor(isArray$5(from) ? null !== (_a = from[index]) && void 0 !== _a ? _a : from[0] : from, isArray$5(to) ? null !== (_b = to[index]) && void 0 !== _b ? _b : to[0] : to, ratio, alphaChannel);
|
|
@@ -9766,7 +9802,7 @@
|
|
|
9766
9802
|
});
|
|
9767
9803
|
}
|
|
9768
9804
|
release() {
|
|
9769
|
-
this.releaseStatus = "released", this.stopAnimates(), application.graphicService.onRelease(this);
|
|
9805
|
+
this.releaseStatus = "released", this.stopAnimates(), application.graphicService.onRelease(this), super.release();
|
|
9770
9806
|
}
|
|
9771
9807
|
_emitCustomEvent(type, context) {
|
|
9772
9808
|
var _a, _b;
|
|
@@ -10500,12 +10536,12 @@
|
|
|
10500
10536
|
textBaseline: textBaseline
|
|
10501
10537
|
} = attribute;
|
|
10502
10538
|
if (null != attribute.forceBoundsHeight) {
|
|
10503
|
-
const h = isNumber$
|
|
10539
|
+
const h = isNumber$3(attribute.forceBoundsHeight) ? attribute.forceBoundsHeight : attribute.forceBoundsHeight(),
|
|
10504
10540
|
dy = textLayoutOffsetY(textBaseline, h, h);
|
|
10505
10541
|
aabbBounds.set(aabbBounds.x1, dy, aabbBounds.x2, dy + h);
|
|
10506
10542
|
}
|
|
10507
10543
|
if (null != attribute.forceBoundsWidth) {
|
|
10508
|
-
const w = isNumber$
|
|
10544
|
+
const w = isNumber$3(attribute.forceBoundsWidth) ? attribute.forceBoundsWidth : attribute.forceBoundsWidth(),
|
|
10509
10545
|
dx = textDrawOffsetX(textAlign, w);
|
|
10510
10546
|
aabbBounds.set(dx, aabbBounds.y1, dx + w, aabbBounds.y2);
|
|
10511
10547
|
}
|
|
@@ -12437,7 +12473,7 @@
|
|
|
12437
12473
|
}
|
|
12438
12474
|
} else {
|
|
12439
12475
|
const richTextConfig = this.combinedStyleToCharacter(textConfig[i]);
|
|
12440
|
-
if (isNumber$
|
|
12476
|
+
if (isNumber$3(richTextConfig.text) && (richTextConfig.text = `${richTextConfig.text}`), richTextConfig.text && richTextConfig.text.includes("\n")) {
|
|
12441
12477
|
const textParts = richTextConfig.text.split("\n");
|
|
12442
12478
|
for (let j = 0; j < textParts.length; j++) if (0 === j) paragraphs.push(new Paragraph(textParts[j], !1, richTextConfig, ascentDescentMode));else if (textParts[j] || i === textConfig.length - 1) paragraphs.push(new Paragraph(textParts[j], !0, richTextConfig, ascentDescentMode));else {
|
|
12443
12479
|
const nextRichTextConfig = this.combinedStyleToCharacter(textConfig[i + 1]);
|
|
@@ -12628,7 +12664,7 @@
|
|
|
12628
12664
|
} = this.attribute;
|
|
12629
12665
|
if (outerRadius += outerPadding, innerRadius -= innerPadding, 0 === cornerRadius || "0%" === cornerRadius) return 0;
|
|
12630
12666
|
const deltaRadius = Math.abs(outerRadius - innerRadius),
|
|
12631
|
-
parseCR = cornerRadius => Math.min(isNumber$
|
|
12667
|
+
parseCR = cornerRadius => Math.min(isNumber$3(cornerRadius, !0) ? cornerRadius : deltaRadius * parseFloat(cornerRadius) / 100, deltaRadius / 2);
|
|
12632
12668
|
if (isArray$5(cornerRadius)) {
|
|
12633
12669
|
const crList = cornerRadius.map(cr => parseCR(cr) || 0);
|
|
12634
12670
|
return 0 === crList.length ? [crList[0], crList[0], crList[0], crList[0]] : 2 === crList.length ? [crList[0], crList[1], crList[0], crList[1]] : (3 === crList.length && crList.push(0), crList);
|
|
@@ -13419,7 +13455,7 @@
|
|
|
13419
13455
|
const halfPi = pi / 2;
|
|
13420
13456
|
function createRectPath(path, x, y, width, height, rectCornerRadius, roundCorner = !0, edgeCb) {
|
|
13421
13457
|
let cornerRadius;
|
|
13422
|
-
if (Array.isArray(roundCorner) && (edgeCb = roundCorner, roundCorner = !0), width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber$
|
|
13458
|
+
if (Array.isArray(roundCorner) && (edgeCb = roundCorner, roundCorner = !0), width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber$3(rectCornerRadius, !0)) cornerRadius = [rectCornerRadius = abs(rectCornerRadius), rectCornerRadius, rectCornerRadius, rectCornerRadius];else if (Array.isArray(rectCornerRadius)) {
|
|
13423
13459
|
const cornerRadiusArr = rectCornerRadius;
|
|
13424
13460
|
let cr0, cr1;
|
|
13425
13461
|
switch (cornerRadiusArr.length) {
|
|
@@ -17173,12 +17209,12 @@
|
|
|
17173
17209
|
throw new Error("暂不支持");
|
|
17174
17210
|
}
|
|
17175
17211
|
release() {
|
|
17176
|
-
var _a, _b;
|
|
17212
|
+
var _a, _b, _d;
|
|
17177
17213
|
super.release(), this.hooks.beforeRender.unTap("constructor", this.beforeRender), this.hooks.afterRender.unTap("constructor", this.afterRender), this.eventSystem && this.eventSystem.release(), this.layerService.releaseStage(this), this.pluginService.release(), this.forEach(layer => {
|
|
17178
17214
|
layer.release();
|
|
17179
17215
|
}), this.interactiveLayer && (this.interactiveLayer.forEachChildren(item => {
|
|
17180
17216
|
item.setStage && item.setStage(null, null), this.interactiveLayer.removeChild(item);
|
|
17181
|
-
}), this.interactiveLayer.release()), this.window.release(), null === (_a = this._ticker) || void 0 === _a || _a.remTimeline(null == this ? void 0 : this.timeline), null === (_b = this._ticker) || void 0 === _b || _b.removeListener("tick", this.afterTickCb), this.renderService.renderTreeRoots = [];
|
|
17217
|
+
}), this.interactiveLayer.release()), this.window.release(), null === (_a = this._ticker) || void 0 === _a || _a.remTimeline(null == this ? void 0 : this.timeline), null === (_b = this._ticker) || void 0 === _b || _b.removeListener("tick", this.afterTickCb), this.params.ticker || null === (_d = this._ticker) || void 0 === _d || _d.release(), this.renderService.renderTreeRoots = [];
|
|
17182
17218
|
}
|
|
17183
17219
|
setStage(stage) {}
|
|
17184
17220
|
dirty(b, matrix) {
|
|
@@ -17550,6 +17586,77 @@
|
|
|
17550
17586
|
return diffObj;
|
|
17551
17587
|
}
|
|
17552
17588
|
|
|
17589
|
+
function isIdentityMatrix(matrix) {
|
|
17590
|
+
return 1 === matrix.a && 0 === matrix.b && 0 === matrix.c && 1 === matrix.d && 0 === matrix.e && 0 === matrix.f;
|
|
17591
|
+
}
|
|
17592
|
+
function createEventTransformer(containerElement, getMatrix, getRect, transformPoint) {
|
|
17593
|
+
return event => {
|
|
17594
|
+
if (!(event instanceof MouseEvent || event instanceof TouchEvent || event instanceof PointerEvent)) return event;
|
|
17595
|
+
const transformMatrix = getMatrix();
|
|
17596
|
+
if (isIdentityMatrix(transformMatrix)) return event;
|
|
17597
|
+
const containerRect = getRect(),
|
|
17598
|
+
transformedEvent = new event.constructor(event.type, event);
|
|
17599
|
+
if (Object.defineProperties(transformedEvent, {
|
|
17600
|
+
target: {
|
|
17601
|
+
value: event.target
|
|
17602
|
+
},
|
|
17603
|
+
currentTarget: {
|
|
17604
|
+
value: event.currentTarget
|
|
17605
|
+
}
|
|
17606
|
+
}), event instanceof MouseEvent || event instanceof PointerEvent) transformPoint(event.clientX, event.clientY, transformMatrix, containerRect, transformedEvent);else if (event instanceof TouchEvent) {
|
|
17607
|
+
if (event.touches.length > 0) {
|
|
17608
|
+
const touch = transformedEvent.touches[0];
|
|
17609
|
+
transformPoint(touch.clientX, touch.clientY, transformMatrix, containerRect, touch);
|
|
17610
|
+
}
|
|
17611
|
+
if (event.changedTouches.length > 0) {
|
|
17612
|
+
const touch = transformedEvent.changedTouches[0];
|
|
17613
|
+
transformPoint(touch.clientX, touch.clientY, transformMatrix, containerRect, touch);
|
|
17614
|
+
}
|
|
17615
|
+
}
|
|
17616
|
+
return transformedEvent;
|
|
17617
|
+
};
|
|
17618
|
+
}
|
|
17619
|
+
function registerWindowEventTransformer(window, container, getMatrix, getRect, transformPoint) {
|
|
17620
|
+
const transformer = createEventTransformer(container, getMatrix, getRect, transformPoint);
|
|
17621
|
+
window.setEventListenerTransformer(transformer);
|
|
17622
|
+
}
|
|
17623
|
+
function registerGlobalEventTransformer(global, container, getMatrix, getRect, transformPoint) {
|
|
17624
|
+
const transformer = createEventTransformer(container, getMatrix, getRect, transformPoint);
|
|
17625
|
+
global.setEventListenerTransformer(transformer);
|
|
17626
|
+
}
|
|
17627
|
+
function transformPointForCanvas(clientX, clientY, matrix, rect, transformedEvent) {
|
|
17628
|
+
const transformedPoint = {
|
|
17629
|
+
x: clientX,
|
|
17630
|
+
y: clientY
|
|
17631
|
+
};
|
|
17632
|
+
matrix.transformPoint(transformedPoint, transformedPoint), Object.defineProperties(transformedEvent, {
|
|
17633
|
+
_canvasX: {
|
|
17634
|
+
value: transformedPoint.x
|
|
17635
|
+
},
|
|
17636
|
+
_canvasY: {
|
|
17637
|
+
value: transformedPoint.y
|
|
17638
|
+
}
|
|
17639
|
+
});
|
|
17640
|
+
}
|
|
17641
|
+
function mapToCanvasPointForCanvas(nativeEvent) {
|
|
17642
|
+
var _a;
|
|
17643
|
+
if (isNumber$1(nativeEvent._canvasX) && isNumber$1(nativeEvent._canvasY)) return {
|
|
17644
|
+
x: nativeEvent._canvasX,
|
|
17645
|
+
y: nativeEvent._canvasY
|
|
17646
|
+
};
|
|
17647
|
+
if (nativeEvent.changedTouches) {
|
|
17648
|
+
const data = null !== (_a = nativeEvent.changedTouches[0]) && void 0 !== _a ? _a : {};
|
|
17649
|
+
return {
|
|
17650
|
+
x: data._canvasX,
|
|
17651
|
+
y: data._canvasY
|
|
17652
|
+
};
|
|
17653
|
+
}
|
|
17654
|
+
return {
|
|
17655
|
+
x: nativeEvent._canvasX || 0,
|
|
17656
|
+
y: nativeEvent._canvasY || 0
|
|
17657
|
+
};
|
|
17658
|
+
}
|
|
17659
|
+
|
|
17553
17660
|
let loadArcModule = !1;
|
|
17554
17661
|
const arcModule = new ContainerModule(bind => {
|
|
17555
17662
|
loadArcModule || (loadArcModule = !0, bind(DefaultCanvasArcRender).toSelf().inSingletonScope(), bind(ArcRender).to(DefaultCanvasArcRender).inSingletonScope(), bind(GraphicRender).toService(ArcRender), bind(ArcRenderContribution).toService(DefaultBaseInteractiveRenderContribution), bindContributionProvider(bind, ArcRenderContribution));
|
|
@@ -19762,7 +19869,7 @@
|
|
|
19762
19869
|
x += point.x, y += point.y, pickContext.setTransformForCurrent();
|
|
19763
19870
|
} else x = 0, y = 0, onlyTranslate = !1, pickContext.transformFromMatrix(rect.transMatrix, !0);
|
|
19764
19871
|
let picked = !0;
|
|
19765
|
-
if (!onlyTranslate || rect.shadowRoot || isNumber$
|
|
19872
|
+
if (!onlyTranslate || rect.shadowRoot || isNumber$3(cornerRadius, !0) && 0 !== cornerRadius || isArray$5(cornerRadius) && cornerRadius.some(num => 0 !== num)) picked = !1, this.canvasRenderer.drawShape(rect, pickContext, x, y, {}, null, (context, rectAttribute, themeAttribute) => !!picked || (picked = context.isPointInPath(point.x, point.y), picked), (context, rectAttribute, themeAttribute) => {
|
|
19766
19873
|
if (picked) return !0;
|
|
19767
19874
|
const lineWidth = rectAttribute.lineWidth || themeAttribute.lineWidth,
|
|
19768
19875
|
pickStrokeBuffer = rectAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
|
|
@@ -21679,7 +21786,7 @@
|
|
|
21679
21786
|
shapeStyle = __rest$3(shape, ["visible"]);
|
|
21680
21787
|
if (isBoolean$2(shapeVisible)) {
|
|
21681
21788
|
const size = (null == shapeStyle ? void 0 : shapeStyle.size) || 10,
|
|
21682
|
-
maxSize = isNumber$
|
|
21789
|
+
maxSize = isNumber$3(size) ? size : Math.max(size[0], size[1]);
|
|
21683
21790
|
symbol = group.createOrUpdateChild("tag-shape", Object.assign(Object.assign({
|
|
21684
21791
|
symbolType: "circle",
|
|
21685
21792
|
size: size,
|
|
@@ -21719,7 +21826,7 @@
|
|
|
21719
21826
|
}
|
|
21720
21827
|
tagWidth += textWidth;
|
|
21721
21828
|
const size = null !== (_c = shape.size) && void 0 !== _c ? _c : 10,
|
|
21722
|
-
maxSize = isNumber$
|
|
21829
|
+
maxSize = isNumber$3(size) ? size : Math.max(size[0], size[1]);
|
|
21723
21830
|
tagHeight += Math.max(textHeight, shape.visible ? maxSize : 0);
|
|
21724
21831
|
const {
|
|
21725
21832
|
textAlign: textAlign,
|
|
@@ -25178,7 +25285,7 @@
|
|
|
25178
25285
|
growAngleInOverall = (graphic, options, animationParameters) => {
|
|
25179
25286
|
const attrs = graphic.getFinalAttribute();
|
|
25180
25287
|
if (options && "anticlockwise" === options.orient) {
|
|
25181
|
-
const overallValue = isNumber$
|
|
25288
|
+
const overallValue = isNumber$3(options.overall) ? options.overall : 2 * Math.PI;
|
|
25182
25289
|
return {
|
|
25183
25290
|
from: {
|
|
25184
25291
|
startAngle: overallValue,
|
|
@@ -25190,7 +25297,7 @@
|
|
|
25190
25297
|
}
|
|
25191
25298
|
};
|
|
25192
25299
|
}
|
|
25193
|
-
const overallValue = isNumber$
|
|
25300
|
+
const overallValue = isNumber$3(null == options ? void 0 : options.overall) ? options.overall : 0;
|
|
25194
25301
|
return {
|
|
25195
25302
|
from: {
|
|
25196
25303
|
startAngle: overallValue,
|
|
@@ -25227,7 +25334,7 @@
|
|
|
25227
25334
|
growAngleOutOverall = (graphic, options, animationParameters) => {
|
|
25228
25335
|
const attrs = graphic.attribute;
|
|
25229
25336
|
if (options && "anticlockwise" === options.orient) {
|
|
25230
|
-
const overallValue = isNumber$
|
|
25337
|
+
const overallValue = isNumber$3(options.overall) ? options.overall : 2 * Math.PI;
|
|
25231
25338
|
return {
|
|
25232
25339
|
from: {
|
|
25233
25340
|
startAngle: attrs.startAngle,
|
|
@@ -25239,7 +25346,7 @@
|
|
|
25239
25346
|
}
|
|
25240
25347
|
};
|
|
25241
25348
|
}
|
|
25242
|
-
const overallValue = isNumber$
|
|
25349
|
+
const overallValue = isNumber$3(null == options ? void 0 : options.overall) ? options.overall : 0;
|
|
25243
25350
|
return {
|
|
25244
25351
|
from: {
|
|
25245
25352
|
startAngle: attrs.startAngle,
|
|
@@ -25515,7 +25622,7 @@
|
|
|
25515
25622
|
y1 = attrs.y1,
|
|
25516
25623
|
height = attrs.height;
|
|
25517
25624
|
let overallValue;
|
|
25518
|
-
return options && "negative" === options.orient ? isNumber$
|
|
25625
|
+
return options && "negative" === options.orient ? isNumber$3(options.overall) ? overallValue = options.overall : animationParameters.group ? (overallValue = null !== (_c = null !== (_a = animationParameters.groupHeight) && void 0 !== _a ? _a : null === (_b = options.layoutRect) || void 0 === _b ? void 0 : _b.height) && void 0 !== _c ? _c : animationParameters.group.getBounds().height(), animationParameters.groupHeight = overallValue) : overallValue = animationParameters.height : overallValue = isNumber$3(null == options ? void 0 : options.overall) ? options.overall : 0, {
|
|
25519
25626
|
from: {
|
|
25520
25627
|
y: overallValue,
|
|
25521
25628
|
y1: isNil$1(y1) ? void 0 : overallValue,
|
|
@@ -25588,7 +25695,7 @@
|
|
|
25588
25695
|
y1 = attrs.y1,
|
|
25589
25696
|
height = attrs.height;
|
|
25590
25697
|
let overallValue;
|
|
25591
|
-
return options && "negative" === options.orient ? isNumber$
|
|
25698
|
+
return options && "negative" === options.orient ? isNumber$3(options.overall) ? overallValue = options.overall : animationParameters.group ? (overallValue = null !== (_c = null !== (_a = animationParameters.groupHeight) && void 0 !== _a ? _a : null === (_b = options.layoutRect) || void 0 === _b ? void 0 : _b.height) && void 0 !== _c ? _c : animationParameters.group.getBounds().height(), animationParameters.groupHeight = overallValue) : overallValue = animationParameters.height : overallValue = isNumber$3(null == options ? void 0 : options.overall) ? options.overall : 0, {
|
|
25592
25699
|
to: {
|
|
25593
25700
|
y: overallValue,
|
|
25594
25701
|
y1: isNil$1(y1) ? void 0 : overallValue,
|
|
@@ -25834,7 +25941,7 @@
|
|
|
25834
25941
|
},
|
|
25835
25942
|
growRadiusInOverall = (graphic, options, animationParameters) => {
|
|
25836
25943
|
const attrs = graphic.getFinalAttribute(),
|
|
25837
|
-
overallValue = isNumber$
|
|
25944
|
+
overallValue = isNumber$3(null == options ? void 0 : options.overall) ? options.overall : 0;
|
|
25838
25945
|
return {
|
|
25839
25946
|
from: {
|
|
25840
25947
|
innerRadius: overallValue,
|
|
@@ -25870,7 +25977,7 @@
|
|
|
25870
25977
|
},
|
|
25871
25978
|
growRadiusOutOverall = (graphic, options, animationParameters) => {
|
|
25872
25979
|
const attrs = graphic.getFinalAttribute(),
|
|
25873
|
-
overallValue = isNumber$
|
|
25980
|
+
overallValue = isNumber$3(null == options ? void 0 : options.overall) ? options.overall : 0;
|
|
25874
25981
|
return {
|
|
25875
25982
|
from: {
|
|
25876
25983
|
innerRadius: null == attrs ? void 0 : attrs.innerRadius,
|
|
@@ -25959,7 +26066,7 @@
|
|
|
25959
26066
|
x1 = attrs.x1,
|
|
25960
26067
|
width = attrs.width;
|
|
25961
26068
|
let overallValue;
|
|
25962
|
-
return options && "negative" === options.orient ? isNumber$
|
|
26069
|
+
return options && "negative" === options.orient ? isNumber$3(options.overall) ? overallValue = options.overall : animationParameters.group ? (overallValue = null !== (_a = animationParameters.groupWidth) && void 0 !== _a ? _a : animationParameters.group.getBounds().width(), animationParameters.groupWidth = overallValue) : overallValue = animationParameters.width : overallValue = isNumber$3(null == options ? void 0 : options.overall) ? null == options ? void 0 : options.overall : 0, {
|
|
25963
26070
|
from: {
|
|
25964
26071
|
x: overallValue,
|
|
25965
26072
|
x1: isNil$1(x1) ? void 0 : overallValue,
|
|
@@ -26006,7 +26113,7 @@
|
|
|
26006
26113
|
x1 = attrs.x1,
|
|
26007
26114
|
width = attrs.width;
|
|
26008
26115
|
let overallValue;
|
|
26009
|
-
return options && "negative" === options.orient ? isNumber$
|
|
26116
|
+
return options && "negative" === options.orient ? isNumber$3(options.overall) ? overallValue = options.overall : animationParameters.group ? (overallValue = null !== (_a = animationParameters.groupWidth) && void 0 !== _a ? _a : animationParameters.group.getBounds().width(), animationParameters.groupWidth = overallValue) : overallValue = animationParameters.width : overallValue = isNumber$3(null == options ? void 0 : options.overall) ? options.overall : 0, {
|
|
26010
26117
|
to: {
|
|
26011
26118
|
x: overallValue,
|
|
26012
26119
|
x1: isNil$1(x1) ? void 0 : overallValue,
|
|
@@ -30158,7 +30265,7 @@
|
|
|
30158
30265
|
return this._isFixed && !!this._bandwidth;
|
|
30159
30266
|
}
|
|
30160
30267
|
_isBandwidthFixedByUser() {
|
|
30161
|
-
return this._isFixed && this._userBandwidth && isNumber$
|
|
30268
|
+
return this._isFixed && this._userBandwidth && isNumber$3(this._userBandwidth);
|
|
30162
30269
|
}
|
|
30163
30270
|
clone() {
|
|
30164
30271
|
var _a, _b, _c;
|
|
@@ -30422,13 +30529,13 @@
|
|
|
30422
30529
|
}
|
|
30423
30530
|
}
|
|
30424
30531
|
function parseNiceOptions(originalDomain, option) {
|
|
30425
|
-
const hasForceMin = isNumber$
|
|
30426
|
-
hasForceMax = isNumber$
|
|
30532
|
+
const hasForceMin = isNumber$3(option.forceMin),
|
|
30533
|
+
hasForceMax = isNumber$3(option.forceMax);
|
|
30427
30534
|
let niceType = null;
|
|
30428
30535
|
const niceMinMax = [];
|
|
30429
30536
|
let niceDomain = null;
|
|
30430
30537
|
const domainValidator = hasForceMin && hasForceMax ? x => x >= option.forceMin && x <= option.forceMax : hasForceMin ? x => x >= option.forceMin : hasForceMax ? x => x <= option.forceMax : null;
|
|
30431
|
-
return hasForceMin ? niceMinMax[0] = option.forceMin : isNumber$
|
|
30538
|
+
return hasForceMin ? niceMinMax[0] = option.forceMin : isNumber$3(option.min) && option.min <= Math.min(originalDomain[0], originalDomain[originalDomain.length - 1]) && (niceMinMax[0] = option.min), hasForceMax ? niceMinMax[1] = option.forceMax : isNumber$3(option.max) && option.max >= Math.max(originalDomain[0], originalDomain[originalDomain.length - 1]) && (niceMinMax[1] = option.max), isNumber$3(niceMinMax[0]) && isNumber$3(niceMinMax[1]) ? (niceDomain = originalDomain.slice(), niceDomain[0] = niceMinMax[0], niceDomain[niceDomain.length - 1] = niceMinMax[1]) : niceType = isNumber$3(niceMinMax[0]) || isNumber$3(niceMinMax[1]) ? isNumber$3(niceMinMax[0]) ? "max" : "min" : "all", {
|
|
30432
30539
|
niceType: niceType,
|
|
30433
30540
|
niceDomain: niceDomain,
|
|
30434
30541
|
niceMinMax: niceMinMax,
|
|
@@ -31117,8 +31224,8 @@
|
|
|
31117
31224
|
textAlign: "center",
|
|
31118
31225
|
textBaseline: "middle"
|
|
31119
31226
|
}, textStyle), null === (_c = null === (_b = this.stage) || void 0 === _b ? void 0 : _b.getTheme()) || void 0 === _c ? void 0 : _c.text),
|
|
31120
|
-
handlerSizeX = isNumber$
|
|
31121
|
-
handlerSizeY = isNumber$
|
|
31227
|
+
handlerSizeX = isNumber$3(handlerSize) ? handlerSize : handlerSize[0],
|
|
31228
|
+
handlerSizeY = isNumber$3(handlerSize) ? handlerSize : handlerSize[1],
|
|
31122
31229
|
text = graphicCreator.text(Object.assign({
|
|
31123
31230
|
x: isHorizontal ? handlerSizeX / 2 + handlerSpace + maxTextWidth / 2 : 0,
|
|
31124
31231
|
y: isHorizontal ? 0 : handlerSizeY / 2 + handlerSpace + maxTextHeight / 2,
|
|
@@ -32688,7 +32795,7 @@
|
|
|
32688
32795
|
};
|
|
32689
32796
|
}
|
|
32690
32797
|
release(all) {
|
|
32691
|
-
super.release(all), ("browser" === vglobal.env ? vglobal : this.stage).
|
|
32798
|
+
super.release(all), ("browser" === vglobal.env ? vglobal : this.stage).removeEventListener("touchmove", this._handleTouchMove, {
|
|
32692
32799
|
passive: !1
|
|
32693
32800
|
}), this._clearAllDragEvents();
|
|
32694
32801
|
}
|
|
@@ -34893,6 +35000,9 @@
|
|
|
34893
35000
|
listenerData: {}
|
|
34894
35001
|
};
|
|
34895
35002
|
on(type, listener) {
|
|
35003
|
+
if (!this.listenersData) {
|
|
35004
|
+
return undefined;
|
|
35005
|
+
}
|
|
34896
35006
|
const list = this.listenersData.listeners[type] || (this.listenersData.listeners[type] = []);
|
|
34897
35007
|
list.push(listener);
|
|
34898
35008
|
const id = idCount$1++;
|
|
@@ -34900,10 +35010,13 @@
|
|
|
34900
35010
|
type,
|
|
34901
35011
|
listener,
|
|
34902
35012
|
remove: () => {
|
|
35013
|
+
if (!this.listenersData) {
|
|
35014
|
+
return;
|
|
35015
|
+
}
|
|
34903
35016
|
delete this.listenersData.listenerData[id];
|
|
34904
35017
|
const index = list.indexOf(listener);
|
|
34905
35018
|
list.splice(index, 1);
|
|
34906
|
-
if (!this.listenersData.listeners[type].length) {
|
|
35019
|
+
if (this.listenersData.listeners[type] && !this.listenersData.listeners[type].length) {
|
|
34907
35020
|
delete this.listenersData.listeners[type];
|
|
34908
35021
|
}
|
|
34909
35022
|
}
|
|
@@ -36442,6 +36555,8 @@
|
|
|
36442
36555
|
RESIZE_COLUMN_END: 'resize_column_end',
|
|
36443
36556
|
RESIZE_ROW: 'resize_row',
|
|
36444
36557
|
RESIZE_ROW_END: 'resize_row_end',
|
|
36558
|
+
MERGE_CELLS: 'merge_cells',
|
|
36559
|
+
UNMERGE_CELLS: 'unmerge_cells',
|
|
36445
36560
|
CHANGE_HEADER_POSITION_START: 'change_header_position_start',
|
|
36446
36561
|
CHANGE_HEADER_POSITION: 'change_header_position',
|
|
36447
36562
|
CHANGING_HEADER_POSITION: 'changing_header_position',
|
|
@@ -39577,6 +39692,7 @@
|
|
|
39577
39692
|
}
|
|
39578
39693
|
clearFilteredChildren(record) {
|
|
39579
39694
|
record.filteredChildren = undefined;
|
|
39695
|
+
delete record.filteredChildren;
|
|
39580
39696
|
for (let i = 0; i < (record.children?.length ?? 0); i++) {
|
|
39581
39697
|
this.clearFilteredChildren(record.children[i]);
|
|
39582
39698
|
}
|
|
@@ -39784,6 +39900,9 @@
|
|
|
39784
39900
|
if ((this.dataSourceObj?.canChangeOrder)) {
|
|
39785
39901
|
return this.dataSourceObj.canChangeOrder(sourceIndex, targetIndex);
|
|
39786
39902
|
}
|
|
39903
|
+
if (this.lastSortStates?.some(state => state.order === 'asc' || state.order === 'desc')) {
|
|
39904
|
+
return false;
|
|
39905
|
+
}
|
|
39787
39906
|
if (this.hasHierarchyStateExpand) {
|
|
39788
39907
|
let sourceIndexs = this.currentPagerIndexedData[sourceIndex];
|
|
39789
39908
|
let targetIndexs = this.currentPagerIndexedData[targetIndex];
|
|
@@ -40015,10 +40134,10 @@
|
|
|
40015
40134
|
}
|
|
40016
40135
|
function sortRecordIndexs(recordIndexs, sort) {
|
|
40017
40136
|
const result = recordIndexs.sort((a, b) => {
|
|
40018
|
-
if (isNumber$
|
|
40137
|
+
if (isNumber$3(a)) {
|
|
40019
40138
|
a = [a];
|
|
40020
40139
|
}
|
|
40021
|
-
if (isNumber$
|
|
40140
|
+
if (isNumber$3(b)) {
|
|
40022
40141
|
b = [b];
|
|
40023
40142
|
}
|
|
40024
40143
|
const length = Math.max(a.length, b.length);
|
|
@@ -41287,7 +41406,7 @@
|
|
|
41287
41406
|
this._fieldCache = {};
|
|
41288
41407
|
}
|
|
41289
41408
|
getOriginalRecord(index) {
|
|
41290
|
-
if (isNumber$
|
|
41409
|
+
if (isNumber$3(index) && this._recordCache && this._recordCache[index]) {
|
|
41291
41410
|
return this._recordCache[index];
|
|
41292
41411
|
}
|
|
41293
41412
|
return super.getOriginalRecord(index);
|
|
@@ -41305,7 +41424,7 @@
|
|
|
41305
41424
|
return this.beforeChangedRecordsMap?.get(index.toString());
|
|
41306
41425
|
}
|
|
41307
41426
|
}
|
|
41308
|
-
if (isNumber$
|
|
41427
|
+
if (isNumber$3(index) && this._recordCache && this._recordCache[index]) {
|
|
41309
41428
|
return this._recordCache[index];
|
|
41310
41429
|
}
|
|
41311
41430
|
let data;
|
|
@@ -41436,7 +41555,7 @@
|
|
|
41436
41555
|
const recordIndexsMaxToMin = sortRecordIndexs(recordIndexs, -1);
|
|
41437
41556
|
for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
|
|
41438
41557
|
const recordIndex = recordIndexsMaxToMin[index];
|
|
41439
|
-
if (isNumber$
|
|
41558
|
+
if (isNumber$3(recordIndex) && (recordIndex >= this.sourceLength || recordIndex < 0)) {
|
|
41440
41559
|
continue;
|
|
41441
41560
|
}
|
|
41442
41561
|
const originRecordIndex = this.getOriginRecordIndexForGroup(recordIndex);
|
|
@@ -41450,7 +41569,7 @@
|
|
|
41450
41569
|
updateRecordsForGroup(records, recordIndexs) {
|
|
41451
41570
|
for (let index = 0; index < recordIndexs.length; index++) {
|
|
41452
41571
|
const recordIndex = recordIndexs[index];
|
|
41453
|
-
if (isNumber$
|
|
41572
|
+
if (isNumber$3(recordIndex) && (recordIndex >= this.sourceLength || recordIndex < 0)) {
|
|
41454
41573
|
continue;
|
|
41455
41574
|
}
|
|
41456
41575
|
const originRecordIndex = this.getOriginRecordIndexForGroup(recordIndex);
|
|
@@ -41464,7 +41583,7 @@
|
|
|
41464
41583
|
return;
|
|
41465
41584
|
}
|
|
41466
41585
|
this.adjustBeforeChangedRecordsMap(recordIndex, recordArr.length);
|
|
41467
|
-
if (isNumber$
|
|
41586
|
+
if (isNumber$3(recordIndex)) {
|
|
41468
41587
|
this.dataSourceObj.records.splice(recordIndex, 0, ...recordArr);
|
|
41469
41588
|
}
|
|
41470
41589
|
else {
|
|
@@ -41489,11 +41608,11 @@
|
|
|
41489
41608
|
const deletedRecordIndexs = [];
|
|
41490
41609
|
for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
|
|
41491
41610
|
const recordIndex = recordIndexsMaxToMin[index];
|
|
41492
|
-
if (isNumber$
|
|
41611
|
+
if (isNumber$3(recordIndex) && (recordIndex >= this.sourceLength || recordIndex < 0)) {
|
|
41493
41612
|
continue;
|
|
41494
41613
|
}
|
|
41495
41614
|
this.beforeChangedRecordsMap.delete(recordIndex.toString());
|
|
41496
|
-
if (isNumber$
|
|
41615
|
+
if (isNumber$3(recordIndex)) {
|
|
41497
41616
|
this.dataSourceObj.records.splice(recordIndex, 1);
|
|
41498
41617
|
}
|
|
41499
41618
|
else {
|
|
@@ -41513,11 +41632,11 @@
|
|
|
41513
41632
|
for (let index = 0; index < recordIndexs.length; index++) {
|
|
41514
41633
|
const recordIndex = recordIndexs[index];
|
|
41515
41634
|
const record = records[index];
|
|
41516
|
-
if (isNumber$
|
|
41635
|
+
if (isNumber$3(recordIndex) && (recordIndex >= this.sourceLength || recordIndex < 0)) {
|
|
41517
41636
|
continue;
|
|
41518
41637
|
}
|
|
41519
41638
|
this.beforeChangedRecordsMap.delete(recordIndex.toString());
|
|
41520
|
-
if (isNumber$
|
|
41639
|
+
if (isNumber$3(recordIndex)) {
|
|
41521
41640
|
this.dataSourceObj.records.splice(recordIndex, 1, record);
|
|
41522
41641
|
}
|
|
41523
41642
|
else {
|
|
@@ -41533,7 +41652,7 @@
|
|
|
41533
41652
|
adjustBeforeChangedRecordsMap(insertIndex, insertCount, type = 'add') {
|
|
41534
41653
|
if (this.rowHierarchyType === 'tree') {
|
|
41535
41654
|
let insertIndexArr;
|
|
41536
|
-
if (isNumber$
|
|
41655
|
+
if (isNumber$3(insertIndex)) {
|
|
41537
41656
|
insertIndexArr = [insertIndex];
|
|
41538
41657
|
}
|
|
41539
41658
|
else {
|
|
@@ -41583,7 +41702,7 @@
|
|
|
41583
41702
|
let i = 1;
|
|
41584
41703
|
for (; recordIndexLength > parentRecordIndexLength; i++) {
|
|
41585
41704
|
const index = this.dataSource.currentIndexedData[showIndex - i];
|
|
41586
|
-
recordIndexLength = isNumber$
|
|
41705
|
+
recordIndexLength = isNumber$3(index) ? 1 : index.length;
|
|
41587
41706
|
}
|
|
41588
41707
|
return i - 1;
|
|
41589
41708
|
}
|
|
@@ -41806,7 +41925,7 @@
|
|
|
41806
41925
|
}
|
|
41807
41926
|
|
|
41808
41927
|
function getQuadProps(paddingOrigin) {
|
|
41809
|
-
if (isNumber$
|
|
41928
|
+
if (isNumber$3(paddingOrigin) || isString$2(paddingOrigin) || isArray$5(paddingOrigin)) {
|
|
41810
41929
|
let padding = parsePadding(paddingOrigin);
|
|
41811
41930
|
if (typeof padding === 'number' || typeof padding === 'string') {
|
|
41812
41931
|
padding = [padding, padding, padding, padding];
|
|
@@ -42072,7 +42191,7 @@
|
|
|
42072
42191
|
if (isNil$1(v)) {
|
|
42073
42192
|
return false;
|
|
42074
42193
|
}
|
|
42075
|
-
if (isNumber$
|
|
42194
|
+
if (isNumber$3(v)) {
|
|
42076
42195
|
return true;
|
|
42077
42196
|
}
|
|
42078
42197
|
return +v === +v;
|
|
@@ -44410,7 +44529,7 @@
|
|
|
44410
44529
|
? getHierarchyOffset(range.start.col, range.start.row, table)
|
|
44411
44530
|
: getHierarchyOffset(cellGroup.col, cellGroup.row, table);
|
|
44412
44531
|
let _contentOffset = 0;
|
|
44413
|
-
if (isNumber$
|
|
44532
|
+
if (isNumber$3(table.theme._contentOffset)) {
|
|
44414
44533
|
if (textAlign === 'left') {
|
|
44415
44534
|
_contentOffset = table.theme._contentOffset;
|
|
44416
44535
|
}
|
|
@@ -44456,7 +44575,7 @@
|
|
|
44456
44575
|
let textMark;
|
|
44457
44576
|
if (inlineFrontIcons.length === 0 && inlineEndIcons.length === 0) {
|
|
44458
44577
|
let _contentOffset = 0;
|
|
44459
|
-
if (isNumber$
|
|
44578
|
+
if (isNumber$3(table.theme._contentOffset)) {
|
|
44460
44579
|
if (textAlign === 'left') {
|
|
44461
44580
|
_contentOffset = table.theme._contentOffset;
|
|
44462
44581
|
}
|
|
@@ -44643,8 +44762,8 @@
|
|
|
44643
44762
|
iconAttribute.isGif = icon.isGif;
|
|
44644
44763
|
let hierarchyOffset = 0;
|
|
44645
44764
|
if ((!dealWithIconComputeVar || dealWithIconComputeVar?.addedHierarchyOffset === 0) &&
|
|
44646
|
-
isNumber$
|
|
44647
|
-
isNumber$
|
|
44765
|
+
isNumber$3(col) &&
|
|
44766
|
+
isNumber$3(row) &&
|
|
44648
44767
|
table &&
|
|
44649
44768
|
(icon.funcType === IconFuncTypeEnum.collapse ||
|
|
44650
44769
|
icon.funcType === IconFuncTypeEnum.expand ||
|
|
@@ -45617,7 +45736,7 @@
|
|
|
45617
45736
|
}
|
|
45618
45737
|
function updateCell$1(col, row, table, addNew, isShadow, forceFastUpdate) {
|
|
45619
45738
|
const oldCellGroup = table.scenegraph.highPerformanceGetCell(col, row, true);
|
|
45620
|
-
if (oldCellGroup.role !== 'cell' && !addNew) {
|
|
45739
|
+
if (oldCellGroup.role !== 'cell' && oldCellGroup.role !== 'shadow-cell' && !addNew) {
|
|
45621
45740
|
return undefined;
|
|
45622
45741
|
}
|
|
45623
45742
|
const cellLocation = table.getCellLocation(col, row);
|
|
@@ -45840,7 +45959,7 @@
|
|
|
45840
45959
|
const reactGroup = oldCellGroup.getChildByName(CUSTOM_CONTAINER_NAME);
|
|
45841
45960
|
if (reactGroup) {
|
|
45842
45961
|
const { col, row } = reactGroup;
|
|
45843
|
-
if (isNumber$
|
|
45962
|
+
if (isNumber$3(col) && isNumber$3(row)) {
|
|
45844
45963
|
table.reactCustomLayout.removeCustomCell(col, row);
|
|
45845
45964
|
}
|
|
45846
45965
|
}
|
|
@@ -46022,10 +46141,10 @@
|
|
|
46022
46141
|
|
|
46023
46142
|
function isMergeCellGroup(cellGroup) {
|
|
46024
46143
|
if (cellGroup.role === 'cell' &&
|
|
46025
|
-
isNumber$
|
|
46026
|
-
isNumber$
|
|
46027
|
-
isNumber$
|
|
46028
|
-
isNumber$
|
|
46144
|
+
isNumber$3(cellGroup.mergeStartCol) &&
|
|
46145
|
+
isNumber$3(cellGroup.mergeStartRow) &&
|
|
46146
|
+
isNumber$3(cellGroup.mergeEndCol) &&
|
|
46147
|
+
isNumber$3(cellGroup.mergeEndRow)) {
|
|
46029
46148
|
return true;
|
|
46030
46149
|
}
|
|
46031
46150
|
return false;
|
|
@@ -46104,12 +46223,12 @@
|
|
|
46104
46223
|
const cellWidth = table.getColsWidth(col, endCol);
|
|
46105
46224
|
const size = getProp('size', actStyle, col, row, table);
|
|
46106
46225
|
let outerRadius = getProp('outerRadius', actStyle, col, row, table);
|
|
46107
|
-
const circleSize = isNumber$
|
|
46226
|
+
const circleSize = isNumber$3(outerRadius) ? outerRadius * 2 : size;
|
|
46108
46227
|
let maxHeight = 0;
|
|
46109
46228
|
if (autoWrapText) {
|
|
46110
46229
|
const spaceBetweenTextAndIcon = getProp('spaceBetweenTextAndIcon', actStyle, col, row, table);
|
|
46111
46230
|
const maxLineWidth = cellWidth - (padding[1] + padding[3]) - iconWidth - circleSize - spaceBetweenTextAndIcon;
|
|
46112
|
-
if (!isNumber$
|
|
46231
|
+
if (!isNumber$3(outerRadius)) {
|
|
46113
46232
|
outerRadius = Math.round(size / 2);
|
|
46114
46233
|
}
|
|
46115
46234
|
utilRadioMark.setAttributes({
|
|
@@ -46636,7 +46755,7 @@
|
|
|
46636
46755
|
}
|
|
46637
46756
|
else {
|
|
46638
46757
|
const defaultHeight = table.getDefaultRowHeight(row);
|
|
46639
|
-
if (isNumber$
|
|
46758
|
+
if (isNumber$3(defaultHeight)) {
|
|
46640
46759
|
return defaultHeight;
|
|
46641
46760
|
}
|
|
46642
46761
|
}
|
|
@@ -46674,7 +46793,7 @@
|
|
|
46674
46793
|
return maxHeight;
|
|
46675
46794
|
}
|
|
46676
46795
|
const defaultHeight = table.getDefaultRowHeight(row);
|
|
46677
|
-
return isNumber$
|
|
46796
|
+
return isNumber$3(defaultHeight) ? defaultHeight : table.defaultRowHeight;
|
|
46678
46797
|
}
|
|
46679
46798
|
function checkFixedStyleAndNoWrap(table, rowStart) {
|
|
46680
46799
|
const { layoutMap } = table.internalProps;
|
|
@@ -50001,13 +50120,13 @@
|
|
|
50001
50120
|
const chartCellStyle = layout._table._getCellStyle(col, row + 1);
|
|
50002
50121
|
const bodyChartCellPadding = getQuadProps(getProp('padding', chartCellStyle, col, row + 1, layout._table));
|
|
50003
50122
|
const { range, ticks, axisOption, targetTicks, targetRange, index, theme } = axisRange;
|
|
50004
|
-
if (isNumber$
|
|
50123
|
+
if (isNumber$3(axisOption?.min)) {
|
|
50005
50124
|
range.min = axisOption.min;
|
|
50006
50125
|
if (range.min > 0) {
|
|
50007
50126
|
axisOption.zero = false;
|
|
50008
50127
|
}
|
|
50009
50128
|
}
|
|
50010
|
-
if (isNumber$
|
|
50129
|
+
if (isNumber$3(axisOption?.max)) {
|
|
50011
50130
|
range.max = axisOption.max;
|
|
50012
50131
|
if (range.max < 0) {
|
|
50013
50132
|
axisOption.zero = false;
|
|
@@ -50048,7 +50167,7 @@
|
|
|
50048
50167
|
const chartCellStyle = layout._table._getCellStyle(col, row - 1);
|
|
50049
50168
|
const bodyChartCellPadding = getQuadProps(getProp('padding', chartCellStyle, col, row - 1, layout._table));
|
|
50050
50169
|
const { range, ticks, axisOption, index, targetTicks, targetRange, theme } = axisRange;
|
|
50051
|
-
if (isNumber$
|
|
50170
|
+
if (isNumber$3(axisOption?.max)) {
|
|
50052
50171
|
range.max = axisOption.max;
|
|
50053
50172
|
if (range.max < 0) {
|
|
50054
50173
|
axisOption.zero = false;
|
|
@@ -50057,7 +50176,7 @@
|
|
|
50057
50176
|
else if (chartType === 'boxPlot') {
|
|
50058
50177
|
range.max += (range.max - range.min) / 20;
|
|
50059
50178
|
}
|
|
50060
|
-
if (isNumber$
|
|
50179
|
+
if (isNumber$3(axisOption?.min)) {
|
|
50061
50180
|
range.min = axisOption.min;
|
|
50062
50181
|
if (range.min > 0) {
|
|
50063
50182
|
axisOption.zero = false;
|
|
@@ -50149,7 +50268,7 @@
|
|
|
50149
50268
|
const chartCellStyle = layout._table._getCellStyle(col + 1, row);
|
|
50150
50269
|
const bodyChartCellPadding = getQuadProps(getProp('padding', chartCellStyle, col + 1, row, layout._table));
|
|
50151
50270
|
const { range, ticks, axisOption, index, targetTicks, targetRange, theme } = axisRange;
|
|
50152
|
-
if (isNumber$
|
|
50271
|
+
if (isNumber$3(axisOption?.max)) {
|
|
50153
50272
|
range.max = axisOption.max;
|
|
50154
50273
|
if (range.max < 0) {
|
|
50155
50274
|
axisOption.zero = false;
|
|
@@ -50158,7 +50277,7 @@
|
|
|
50158
50277
|
else if (chartType === 'boxPlot') {
|
|
50159
50278
|
range.max += (range.max - range.min) / 20;
|
|
50160
50279
|
}
|
|
50161
|
-
if (isNumber$
|
|
50280
|
+
if (isNumber$3(axisOption?.min)) {
|
|
50162
50281
|
range.min = axisOption.min;
|
|
50163
50282
|
if (range.min > 0) {
|
|
50164
50283
|
axisOption.zero = false;
|
|
@@ -50212,13 +50331,13 @@
|
|
|
50212
50331
|
const chartCellStyle = layout._table._getCellStyle(col - 1, row);
|
|
50213
50332
|
const bodyChartCellPadding = getQuadProps(getProp('padding', chartCellStyle, col - 1, row, layout._table));
|
|
50214
50333
|
const { range, ticks, index, targetTicks, targetRange, theme } = axisRange;
|
|
50215
|
-
if (isNumber$
|
|
50334
|
+
if (isNumber$3(axisOption?.min)) {
|
|
50216
50335
|
range.min = axisOption.min;
|
|
50217
50336
|
if (range.min > 0) {
|
|
50218
50337
|
axisOption.zero = false;
|
|
50219
50338
|
}
|
|
50220
50339
|
}
|
|
50221
|
-
if (isNumber$
|
|
50340
|
+
if (isNumber$3(axisOption?.max)) {
|
|
50222
50341
|
range.max = axisOption.max;
|
|
50223
50342
|
if (range.max < 0) {
|
|
50224
50343
|
axisOption.zero = false;
|
|
@@ -50300,7 +50419,7 @@
|
|
|
50300
50419
|
});
|
|
50301
50420
|
if (axisOption) {
|
|
50302
50421
|
if (axisOption.zero) {
|
|
50303
|
-
if (isNumber$
|
|
50422
|
+
if (isNumber$3(axisOption.range?.min)) {
|
|
50304
50423
|
axisOption.zero = false;
|
|
50305
50424
|
}
|
|
50306
50425
|
}
|
|
@@ -50338,7 +50457,7 @@
|
|
|
50338
50457
|
return axisOption.orient === orient;
|
|
50339
50458
|
}) ?? {};
|
|
50340
50459
|
if (axisOption.zero) {
|
|
50341
|
-
if (isNumber$
|
|
50460
|
+
if (isNumber$3(axisOption.range?.min)) {
|
|
50342
50461
|
axisOption.zero = false;
|
|
50343
50462
|
}
|
|
50344
50463
|
}
|
|
@@ -50636,10 +50755,10 @@
|
|
|
50636
50755
|
range.max = axisRange[1];
|
|
50637
50756
|
}
|
|
50638
50757
|
const ticks = selfTicks;
|
|
50639
|
-
if (isNumber$
|
|
50758
|
+
if (isNumber$3(axisOption?.min)) {
|
|
50640
50759
|
range.min = axisOption.min;
|
|
50641
50760
|
}
|
|
50642
|
-
if (isNumber$
|
|
50761
|
+
if (isNumber$3(axisOption?.max)) {
|
|
50643
50762
|
range.max = axisOption.max;
|
|
50644
50763
|
}
|
|
50645
50764
|
return {
|
|
@@ -53254,7 +53373,7 @@
|
|
|
53254
53373
|
else if (cellType === 'radio') {
|
|
53255
53374
|
const size = getProp('size', actStyle, col, row, table);
|
|
53256
53375
|
const outerRadius = getProp('outerRadius', actStyle, col, row, table);
|
|
53257
|
-
const circleSize = isNumber$
|
|
53376
|
+
const circleSize = isNumber$3(outerRadius) ? outerRadius * 2 : size;
|
|
53258
53377
|
const spaceBetweenTextAndIcon = getProp('spaceBetweenTextAndIcon', actStyle, col, row, table);
|
|
53259
53378
|
if (isArray$5(cellValue)) {
|
|
53260
53379
|
const define = table.getBodyColumnDefine(col, row);
|
|
@@ -53743,7 +53862,7 @@
|
|
|
53743
53862
|
columnGroup.role = 'column';
|
|
53744
53863
|
columnGroup.col = i;
|
|
53745
53864
|
containerGroup.addChild(columnGroup);
|
|
53746
|
-
const { width: default2Width, height: default2Height } = createComplexColumn(columnGroup, col, colWidth, rowStart, rowEnd, table.scenegraph.mergeMap, cellLocation === 'columnHeader' && isNumber$
|
|
53865
|
+
const { width: default2Width, height: default2Height } = createComplexColumn(columnGroup, col, colWidth, rowStart, rowEnd, table.scenegraph.mergeMap, cellLocation === 'columnHeader' && isNumber$3(defaultHeaderRowHeight)
|
|
53747
53866
|
? defaultHeaderRowHeight
|
|
53748
53867
|
: defaultRowHeight, table, rowLimit);
|
|
53749
53868
|
x += default2Width;
|
|
@@ -54699,10 +54818,10 @@
|
|
|
54699
54818
|
}
|
|
54700
54819
|
}
|
|
54701
54820
|
function adjustCellContentVerticalLayout(cellGroup, minTop, maxTop, changedCells, textStickBaseOnAlign, table) {
|
|
54702
|
-
if (isNumber$
|
|
54703
|
-
isNumber$
|
|
54704
|
-
isNumber$
|
|
54705
|
-
isNumber$
|
|
54821
|
+
if (isNumber$3(cellGroup.mergeStartCol) &&
|
|
54822
|
+
isNumber$3(cellGroup.mergeStartRow) &&
|
|
54823
|
+
isNumber$3(cellGroup.mergeEndCol) &&
|
|
54824
|
+
isNumber$3(cellGroup.mergeEndRow)) {
|
|
54706
54825
|
const { colStart, colEnd, rowStart, rowEnd } = getCellMergeRange(cellGroup, table.scenegraph);
|
|
54707
54826
|
for (let col = colStart; col <= colEnd; col++) {
|
|
54708
54827
|
for (let row = rowStart; row <= rowEnd; row++) {
|
|
@@ -54784,10 +54903,10 @@
|
|
|
54784
54903
|
}
|
|
54785
54904
|
}
|
|
54786
54905
|
function adjustCellContentHorizontalLayout(cellGroup, minLeft, maxLeft, changedCells, textStickBaseOnAlign, table) {
|
|
54787
|
-
if (isNumber$
|
|
54788
|
-
isNumber$
|
|
54789
|
-
isNumber$
|
|
54790
|
-
isNumber$
|
|
54906
|
+
if (isNumber$3(cellGroup.mergeStartCol) &&
|
|
54907
|
+
isNumber$3(cellGroup.mergeStartRow) &&
|
|
54908
|
+
isNumber$3(cellGroup.mergeEndCol) &&
|
|
54909
|
+
isNumber$3(cellGroup.mergeEndRow)) {
|
|
54791
54910
|
const { colStart, colEnd, rowStart, rowEnd } = getCellMergeRange(cellGroup, table.scenegraph);
|
|
54792
54911
|
for (let col = colStart; col <= colEnd; col++) {
|
|
54793
54912
|
for (let row = rowStart; row <= rowEnd; row++) {
|
|
@@ -55133,7 +55252,7 @@
|
|
|
55133
55252
|
this.colEnd = endCol;
|
|
55134
55253
|
for (let row = 0; row < this.table.rowCount; row++) {
|
|
55135
55254
|
const cellGroup = this.highPerformanceGetCell(this.currentCol, row);
|
|
55136
|
-
if (cellGroup.role === 'cell' && isNumber$
|
|
55255
|
+
if (cellGroup.role === 'cell' && isNumber$3(cellGroup.mergeStartCol) && cellGroup.mergeStartCol > this.currentCol) {
|
|
55137
55256
|
this.table.scenegraph.updateCellContent(cellGroup.col, cellGroup.row);
|
|
55138
55257
|
}
|
|
55139
55258
|
}
|
|
@@ -56264,7 +56383,7 @@
|
|
|
56264
56383
|
const pos = _getUpdateRowIndex(beforeRow, afterRow, scene);
|
|
56265
56384
|
rowUpdatePos = isValid$1(rowUpdatePos) ? (isValid$1(pos) ? Math.min(rowUpdatePos, pos) : rowUpdatePos) : pos;
|
|
56266
56385
|
}
|
|
56267
|
-
if (isNumber$
|
|
56386
|
+
if (isNumber$3(updateAfter)) {
|
|
56268
56387
|
for (let col = 0; col < Math.max(table.colCount, table.internalProps._oldColCount ?? table.colCount); col++) {
|
|
56269
56388
|
for (let row = updateAfter; row < Math.max(table.rowCount, table.internalProps._oldRowCount ?? table.rowCount); row++) {
|
|
56270
56389
|
const cellGroup = scene.highPerformanceGetCell(col, row, true);
|
|
@@ -56277,9 +56396,9 @@
|
|
|
56277
56396
|
: rowUpdatePos
|
|
56278
56397
|
: updateAfter;
|
|
56279
56398
|
}
|
|
56280
|
-
isNumber$
|
|
56399
|
+
isNumber$3(rowUpdatePos) && (scene.proxy.rowUpdatePos = Math.min(scene.proxy.rowUpdatePos, rowUpdatePos));
|
|
56281
56400
|
if (addRows.length) {
|
|
56282
|
-
if (!isNumber$
|
|
56401
|
+
if (!isNumber$3(updateAfter)) {
|
|
56283
56402
|
const minRow = Math.min(...addRows);
|
|
56284
56403
|
scene.proxy.rowUpdatePos = Math.min(minRow, scene.proxy.rowUpdatePos);
|
|
56285
56404
|
}
|
|
@@ -57659,7 +57778,7 @@
|
|
|
57659
57778
|
const colHeaderGroup = createContainerGroup(0, 0, !scene.table.internalProps.enableTreeStickCell);
|
|
57660
57779
|
colHeaderGroup.role = 'col-header';
|
|
57661
57780
|
scene.colHeaderGroup = colHeaderGroup;
|
|
57662
|
-
const cornerHeaderGroup = createContainerGroup(0, 0, !scene.table.
|
|
57781
|
+
const cornerHeaderGroup = createContainerGroup(0, 0, !scene.table.internalProps.enableTreeStickCell);
|
|
57663
57782
|
cornerHeaderGroup.role = 'corner-header';
|
|
57664
57783
|
scene.cornerHeaderGroup = cornerHeaderGroup;
|
|
57665
57784
|
const rowHeaderGroup = createContainerGroup(0, 0, true);
|
|
@@ -58067,7 +58186,7 @@
|
|
|
58067
58186
|
}
|
|
58068
58187
|
}
|
|
58069
58188
|
});
|
|
58070
|
-
if (isNumber$
|
|
58189
|
+
if (isNumber$3(updateAfter)) {
|
|
58071
58190
|
for (let col = updateAfter; col < Math.max(table.colCount, table.internalProps._oldColCount ?? table.colCount); col++) {
|
|
58072
58191
|
for (let row = 0; row < Math.max(table.rowCount, table.internalProps._oldRowCount ?? table.rowCount); row++) {
|
|
58073
58192
|
const cellGroup = scene.highPerformanceGetCell(col, row, true);
|
|
@@ -58077,7 +58196,7 @@
|
|
|
58077
58196
|
scene.proxy.colUpdatePos = updateAfter;
|
|
58078
58197
|
}
|
|
58079
58198
|
if (addCols.length) {
|
|
58080
|
-
if (!isNumber$
|
|
58199
|
+
if (!isNumber$3(updateAfter)) {
|
|
58081
58200
|
const minCol = Math.min(...addCols);
|
|
58082
58201
|
scene.proxy.colUpdatePos = minCol;
|
|
58083
58202
|
}
|
|
@@ -61608,7 +61727,7 @@
|
|
|
61608
61727
|
if (recordIndex >= 0) {
|
|
61609
61728
|
const dataIndex = state.table.dataSource.getIndexKey(recordIndex);
|
|
61610
61729
|
if (type === 'column') {
|
|
61611
|
-
if (isNumber$
|
|
61730
|
+
if (isNumber$3(indexInCell)) {
|
|
61612
61731
|
state.radioState[field] = {};
|
|
61613
61732
|
state.radioState[field][dataIndex] = indexInCell;
|
|
61614
61733
|
}
|
|
@@ -61620,7 +61739,7 @@
|
|
|
61620
61739
|
if (!state.radioState[field]) {
|
|
61621
61740
|
state.radioState[field] = {};
|
|
61622
61741
|
}
|
|
61623
|
-
if (isNumber$
|
|
61742
|
+
if (isNumber$3(indexInCell)) {
|
|
61624
61743
|
state.radioState[field][dataIndex] = indexInCell;
|
|
61625
61744
|
}
|
|
61626
61745
|
else {
|
|
@@ -61636,14 +61755,14 @@
|
|
|
61636
61755
|
if (isValid$1(field) && cellType === 'radio') {
|
|
61637
61756
|
const dataIndex = table.dataSource.getIndexKey(table.getRecordShowIndexByCell(col, row));
|
|
61638
61757
|
const columnState = table.stateManager.radioState?.[field];
|
|
61639
|
-
if (isNumber$
|
|
61758
|
+
if (isNumber$3(columnState)) {
|
|
61640
61759
|
if (columnState === dataIndex) {
|
|
61641
61760
|
return true;
|
|
61642
61761
|
}
|
|
61643
61762
|
}
|
|
61644
61763
|
else if (isObject$7(columnState)) {
|
|
61645
61764
|
const cellState = columnState[dataIndex];
|
|
61646
|
-
if (isNumber$
|
|
61765
|
+
if (isNumber$3(cellState)) {
|
|
61647
61766
|
return cellState;
|
|
61648
61767
|
}
|
|
61649
61768
|
}
|
|
@@ -61656,7 +61775,7 @@
|
|
|
61656
61775
|
const dataIndex = state.table.dataSource.getIndexKey(recordIndex);
|
|
61657
61776
|
if (type === 'column') {
|
|
61658
61777
|
if (!isValid$1(state.radioState[field]) && isChecked) {
|
|
61659
|
-
if (isNumber$
|
|
61778
|
+
if (isNumber$3(indexInCell)) {
|
|
61660
61779
|
state.radioState[field] = {};
|
|
61661
61780
|
state.radioState[field][dataIndex] = indexInCell;
|
|
61662
61781
|
}
|
|
@@ -61665,23 +61784,23 @@
|
|
|
61665
61784
|
}
|
|
61666
61785
|
return true;
|
|
61667
61786
|
}
|
|
61668
|
-
else if (isNumber$
|
|
61787
|
+
else if (isNumber$3(state.radioState[field]) && !isNumber$3(indexInCell)) {
|
|
61669
61788
|
return state.radioState[field] === dataIndex;
|
|
61670
61789
|
}
|
|
61671
|
-
else if (isNumber$
|
|
61790
|
+
else if (isNumber$3(state.radioState[field]) && isNumber$3(indexInCell)) {
|
|
61672
61791
|
return false;
|
|
61673
61792
|
}
|
|
61674
|
-
else if (isObject$7(state.radioState[field]) && !isNumber$
|
|
61793
|
+
else if (isObject$7(state.radioState[field]) && !isNumber$3(indexInCell)) {
|
|
61675
61794
|
return false;
|
|
61676
61795
|
}
|
|
61677
|
-
else if (isObject$7(state.radioState[field]) && isNumber$
|
|
61796
|
+
else if (isObject$7(state.radioState[field]) && isNumber$3(indexInCell)) {
|
|
61678
61797
|
return state.radioState[field][dataIndex] === indexInCell;
|
|
61679
61798
|
}
|
|
61680
61799
|
}
|
|
61681
61800
|
else if (type === 'cell') {
|
|
61682
61801
|
if (!isValid$1(state.radioState[field]) && isChecked) {
|
|
61683
61802
|
state.radioState[field] = {};
|
|
61684
|
-
if (isNumber$
|
|
61803
|
+
if (isNumber$3(indexInCell)) {
|
|
61685
61804
|
state.radioState[field][dataIndex] = indexInCell;
|
|
61686
61805
|
}
|
|
61687
61806
|
else {
|
|
@@ -61690,7 +61809,7 @@
|
|
|
61690
61809
|
return true;
|
|
61691
61810
|
}
|
|
61692
61811
|
else if (!isValid$1(state.radioState[field]?.[dataIndex]) && isChecked) {
|
|
61693
|
-
if (isNumber$
|
|
61812
|
+
if (isNumber$3(indexInCell)) {
|
|
61694
61813
|
state.radioState[field][dataIndex] = indexInCell;
|
|
61695
61814
|
}
|
|
61696
61815
|
else {
|
|
@@ -61698,16 +61817,16 @@
|
|
|
61698
61817
|
}
|
|
61699
61818
|
return true;
|
|
61700
61819
|
}
|
|
61701
|
-
else if (isBoolean$2(state.radioState[field]?.[dataIndex]) && !isNumber$
|
|
61820
|
+
else if (isBoolean$2(state.radioState[field]?.[dataIndex]) && !isNumber$3(indexInCell)) {
|
|
61702
61821
|
return state.radioState[field][dataIndex];
|
|
61703
61822
|
}
|
|
61704
|
-
else if (isBoolean$2(state.radioState[field]?.[dataIndex]) && isNumber$
|
|
61823
|
+
else if (isBoolean$2(state.radioState[field]?.[dataIndex]) && isNumber$3(indexInCell)) {
|
|
61705
61824
|
return false;
|
|
61706
61825
|
}
|
|
61707
|
-
else if (isNumber$
|
|
61826
|
+
else if (isNumber$3(state.radioState[field]?.[dataIndex]) && !isNumber$3(indexInCell)) {
|
|
61708
61827
|
return false;
|
|
61709
61828
|
}
|
|
61710
|
-
else if (isNumber$
|
|
61829
|
+
else if (isNumber$3(state.radioState[field]?.[dataIndex]) && isNumber$3(indexInCell)) {
|
|
61711
61830
|
return state.radioState[field][dataIndex] === indexInCell;
|
|
61712
61831
|
}
|
|
61713
61832
|
}
|
|
@@ -61719,7 +61838,7 @@
|
|
|
61719
61838
|
if (!cellGoup) {
|
|
61720
61839
|
return;
|
|
61721
61840
|
}
|
|
61722
|
-
if (isNumber$
|
|
61841
|
+
if (isNumber$3(index)) {
|
|
61723
61842
|
const radio = cellGoup.getChildAt(index);
|
|
61724
61843
|
radio?._handlePointerUp();
|
|
61725
61844
|
}
|
|
@@ -62015,7 +62134,7 @@
|
|
|
62015
62134
|
source = table.isPivotTable() ? undefined : table.getRecordIndexByCell(0, sourceIndex);
|
|
62016
62135
|
target = table.isPivotTable() ? undefined : table.getRecordIndexByCell(0, targetIndex);
|
|
62017
62136
|
}
|
|
62018
|
-
if (isNumber$
|
|
62137
|
+
if (isNumber$3(source) && isNumber$3(target)) {
|
|
62019
62138
|
sourceIndex = source;
|
|
62020
62139
|
targetIndex = target;
|
|
62021
62140
|
if (sourceIndex > targetIndex) {
|
|
@@ -62662,7 +62781,7 @@
|
|
|
62662
62781
|
function flatten(cols, parentStartIndex = 0) {
|
|
62663
62782
|
cols.forEach((col) => {
|
|
62664
62783
|
const startIndex = col.startInTotal
|
|
62665
|
-
? col.startInTotal + state.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount ?? 0
|
|
62784
|
+
? col.startInTotal + (state.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount ?? 0)
|
|
62666
62785
|
: parentStartIndex;
|
|
62667
62786
|
if (col.columns) {
|
|
62668
62787
|
flatten(col.columns, startIndex);
|
|
@@ -62685,7 +62804,7 @@
|
|
|
62685
62804
|
prev.push({
|
|
62686
62805
|
field: item.field,
|
|
62687
62806
|
order: item.order,
|
|
62688
|
-
row: column?.startInTotal + this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount ?? 0,
|
|
62807
|
+
row: (column?.startInTotal ?? 0) + (this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount ?? 0),
|
|
62689
62808
|
col: column?.level
|
|
62690
62809
|
});
|
|
62691
62810
|
}
|
|
@@ -62693,7 +62812,7 @@
|
|
|
62693
62812
|
prev.push({
|
|
62694
62813
|
field: item.field,
|
|
62695
62814
|
order: item.order,
|
|
62696
|
-
col: column?.startInTotal + this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount ?? 0,
|
|
62815
|
+
col: (column?.startInTotal ?? 0) + (this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount ?? 0),
|
|
62697
62816
|
row: column?.level
|
|
62698
62817
|
});
|
|
62699
62818
|
}
|
|
@@ -63498,11 +63617,12 @@
|
|
|
63498
63617
|
}
|
|
63499
63618
|
updateSortState(sortState) {
|
|
63500
63619
|
sortState = Array.isArray(sortState) ? sortState : [sortState];
|
|
63620
|
+
const isSame = sortState.length === this.sort.length &&
|
|
63621
|
+
sortState.every((item, index) => item?.field === this.sort[index]?.field && item?.order === this.sort[index]?.order);
|
|
63622
|
+
if (isSame) {
|
|
63623
|
+
return;
|
|
63624
|
+
}
|
|
63501
63625
|
for (let index = 0; index < sortState.length; index++) {
|
|
63502
|
-
if (sortState[index].field === this.sort[index]?.field &&
|
|
63503
|
-
sortState[sortState.length - 1].order === this.sort[index]?.order) {
|
|
63504
|
-
return;
|
|
63505
|
-
}
|
|
63506
63626
|
const oldSortCol = this.table.internalProps.multipleSort ? null : this.sort[index]?.col || null;
|
|
63507
63627
|
const oldSortRow = this.table.internalProps.multipleSort ? null : this.sort[index]?.row || null;
|
|
63508
63628
|
this.sort[index]?.order === 'asc'
|
|
@@ -63546,7 +63666,7 @@
|
|
|
63546
63666
|
row: null,
|
|
63547
63667
|
iconMark: null,
|
|
63548
63668
|
order: null,
|
|
63549
|
-
oldSortCol: column.startInTotal + this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount ?? 0,
|
|
63669
|
+
oldSortCol: (column.startInTotal ?? 0) + (this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount ?? 0),
|
|
63550
63670
|
oldSortRow: column.level,
|
|
63551
63671
|
oldIconMark: null
|
|
63552
63672
|
});
|
|
@@ -65839,7 +65959,7 @@
|
|
|
65839
65959
|
const indexedData = table.dataSource.currentPagerIndexedData;
|
|
65840
65960
|
const titleShowIndex = table.getRecordShowIndexByCell(col, row);
|
|
65841
65961
|
let titleIndex = indexedData[titleShowIndex];
|
|
65842
|
-
if (isNumber$
|
|
65962
|
+
if (isNumber$3(titleIndex)) {
|
|
65843
65963
|
titleIndex = [titleIndex];
|
|
65844
65964
|
}
|
|
65845
65965
|
if (record.vtableMerge || record.children?.length) {
|
|
@@ -65890,7 +66010,7 @@
|
|
|
65890
66010
|
const indexedData = table.dataSource.currentPagerIndexedData;
|
|
65891
66011
|
const titleShowIndex = table.getRecordShowIndexByCell(col, row);
|
|
65892
66012
|
let titleIndex = indexedData[titleShowIndex];
|
|
65893
|
-
if (isNumber$
|
|
66013
|
+
if (isNumber$3(titleIndex)) {
|
|
65894
66014
|
titleIndex = [titleIndex];
|
|
65895
66015
|
}
|
|
65896
66016
|
if (record.vtableMerge || record.children?.length) {
|
|
@@ -65939,7 +66059,7 @@
|
|
|
65939
66059
|
let i = titleShowIndex - 1;
|
|
65940
66060
|
while (parentLength > 0 && i >= 0) {
|
|
65941
66061
|
if ((isArray$5(indexedData[i]) && indexedData[i]?.length === parentLength) ||
|
|
65942
|
-
(parentLength === 1 && isNumber$
|
|
66062
|
+
(parentLength === 1 && isNumber$3(indexedData[i]))) {
|
|
65943
66063
|
const row = table.columnHeaderLevelCount + i;
|
|
65944
66064
|
updateParentCheckboxState(col, row, indexedData[i], table, field);
|
|
65945
66065
|
parentLength--;
|
|
@@ -70857,11 +70977,11 @@
|
|
|
70857
70977
|
let rowInt = row;
|
|
70858
70978
|
let colDecimal;
|
|
70859
70979
|
let rowDecimal;
|
|
70860
|
-
if (isNumber$
|
|
70980
|
+
if (isNumber$3(col) && !isInteger(col)) {
|
|
70861
70981
|
colInt = Math.floor(col);
|
|
70862
70982
|
colDecimal = col - colInt;
|
|
70863
70983
|
}
|
|
70864
|
-
if (isNumber$
|
|
70984
|
+
if (isNumber$3(row) && !isInteger(row)) {
|
|
70865
70985
|
rowInt = Math.floor(row);
|
|
70866
70986
|
rowDecimal = row - rowInt;
|
|
70867
70987
|
}
|
|
@@ -70874,8 +70994,8 @@
|
|
|
70874
70994
|
top += rowDecimal * cellRect.height;
|
|
70875
70995
|
}
|
|
70876
70996
|
const to = {
|
|
70877
|
-
x: isNumber$
|
|
70878
|
-
y: isNumber$
|
|
70997
|
+
x: isNumber$3(col) ? left - this.table.getFrozenColsWidth() : this.table.scrollLeft,
|
|
70998
|
+
y: isNumber$3(row) ? top - this.table.getFrozenRowsHeight() : this.table.scrollTop
|
|
70879
70999
|
};
|
|
70880
71000
|
const duration = !isBoolean$2(animationOption) ? animationOption?.duration ?? 3000 : animationOption ? 3000 : 0;
|
|
70881
71001
|
const easing = !isBoolean$2(animationOption) ? animationOption?.easing ?? 'linear' : animationOption ? 'linear' : '';
|
|
@@ -70975,6 +71095,7 @@
|
|
|
70975
71095
|
class BaseTable extends EventTarget$1 {
|
|
70976
71096
|
internalProps;
|
|
70977
71097
|
showFrozenIcon = true;
|
|
71098
|
+
_scrollToRowCorrectTimer = null;
|
|
70978
71099
|
padding;
|
|
70979
71100
|
globalDropDownMenu;
|
|
70980
71101
|
tableNoFrameWidth;
|
|
@@ -71009,7 +71130,7 @@
|
|
|
71009
71130
|
return TABLE_EVENT_TYPE;
|
|
71010
71131
|
}
|
|
71011
71132
|
options;
|
|
71012
|
-
version = "1.
|
|
71133
|
+
version = "1.24.0";
|
|
71013
71134
|
pagination;
|
|
71014
71135
|
id = `VTable${Date.now()}`;
|
|
71015
71136
|
headerStyleCache;
|
|
@@ -71096,8 +71217,8 @@
|
|
|
71096
71217
|
this.tableNoFrameHeight = 0;
|
|
71097
71218
|
this.contentOffsetX = translateX ?? 0;
|
|
71098
71219
|
this.contentOffsetY = translateY ?? 0;
|
|
71099
|
-
this.canvasWidth = isNumber$
|
|
71100
|
-
this.canvasHeight = isNumber$
|
|
71220
|
+
this.canvasWidth = isNumber$3(canvasWidth) ? canvasWidth : undefined;
|
|
71221
|
+
this.canvasHeight = isNumber$3(canvasHeight) ? canvasHeight : undefined;
|
|
71101
71222
|
this.columnWidthComputeMode = options.columnWidthComputeMode ?? 'normal';
|
|
71102
71223
|
const internalProps = (this.internalProps = {});
|
|
71103
71224
|
showFrozenIcon !== undefined && (this.showFrozenIcon = showFrozenIcon);
|
|
@@ -71124,7 +71245,7 @@
|
|
|
71124
71245
|
}
|
|
71125
71246
|
}
|
|
71126
71247
|
internalProps.handler = new EventHandler();
|
|
71127
|
-
if (isNumber$
|
|
71248
|
+
if (isNumber$3(this.options.resizeTime)) {
|
|
71128
71249
|
internalProps.handler.resizeTime = this.options.resizeTime;
|
|
71129
71250
|
}
|
|
71130
71251
|
internalProps.pixelRatio = pixelRatio;
|
|
@@ -71470,7 +71591,7 @@
|
|
|
71470
71591
|
this.scenegraph.dealWidthBottomFrozen(bottomFrozenRowCount);
|
|
71471
71592
|
}
|
|
71472
71593
|
get defaultRowHeight() {
|
|
71473
|
-
if (isNumber$
|
|
71594
|
+
if (isNumber$3(this.internalProps.defaultRowHeight)) {
|
|
71474
71595
|
return this.internalProps.defaultRowHeight;
|
|
71475
71596
|
}
|
|
71476
71597
|
return 40;
|
|
@@ -71909,7 +72030,7 @@
|
|
|
71909
72030
|
return this.rowHeightsMap.get(row);
|
|
71910
72031
|
}
|
|
71911
72032
|
const defaultHeight = this.getDefaultRowHeight(row);
|
|
71912
|
-
if (isNumber$
|
|
72033
|
+
if (isNumber$3(defaultHeight)) {
|
|
71913
72034
|
return defaultHeight;
|
|
71914
72035
|
}
|
|
71915
72036
|
return this.defaultRowHeight;
|
|
@@ -72600,6 +72721,12 @@
|
|
|
72600
72721
|
dispose() {
|
|
72601
72722
|
this.release();
|
|
72602
72723
|
}
|
|
72724
|
+
clearCorrectTimer() {
|
|
72725
|
+
if (this._scrollToRowCorrectTimer) {
|
|
72726
|
+
clearTimeout(this._scrollToRowCorrectTimer);
|
|
72727
|
+
this._scrollToRowCorrectTimer = null;
|
|
72728
|
+
}
|
|
72729
|
+
}
|
|
72603
72730
|
release() {
|
|
72604
72731
|
this.scenegraph?.component?.vScrollBar?.release();
|
|
72605
72732
|
this.scenegraph?.component?.hScrollBar?.release();
|
|
@@ -72610,6 +72737,7 @@
|
|
|
72610
72737
|
if (this.isReleased) {
|
|
72611
72738
|
return;
|
|
72612
72739
|
}
|
|
72740
|
+
this.clearCorrectTimer();
|
|
72613
72741
|
internalProps.tooltipHandler?.release?.();
|
|
72614
72742
|
internalProps.menuHandler?.release?.();
|
|
72615
72743
|
super.release?.();
|
|
@@ -72699,8 +72827,8 @@
|
|
|
72699
72827
|
this.customRender = customRender;
|
|
72700
72828
|
this.contentOffsetX = translateX ?? 0;
|
|
72701
72829
|
this.contentOffsetY = translateY ?? 0;
|
|
72702
|
-
this.canvasWidth = isNumber$
|
|
72703
|
-
this.canvasHeight = isNumber$
|
|
72830
|
+
this.canvasWidth = isNumber$3(canvasWidth) ? canvasWidth : undefined;
|
|
72831
|
+
this.canvasHeight = isNumber$3(canvasHeight) ? canvasHeight : undefined;
|
|
72704
72832
|
const internalProps = this.internalProps;
|
|
72705
72833
|
if (Env.mode !== 'node' && !options.canvas) {
|
|
72706
72834
|
updateRootElementPadding(internalProps.element, this.padding);
|
|
@@ -73073,6 +73201,86 @@
|
|
|
73073
73201
|
this.stateManager.updateSelectPos(this.colCount - 1, rowIndex, false, isCtrl, false, makeSelectCellVisible, true);
|
|
73074
73202
|
this.stateManager.select.selecting = false;
|
|
73075
73203
|
}
|
|
73204
|
+
changeHeaderPosition(args) {
|
|
73205
|
+
if (!('canMoveHeaderPosition' in this.internalProps.layoutMap) ||
|
|
73206
|
+
this.options.customConfig?.notUpdateInColumnRowMove === true) {
|
|
73207
|
+
return false;
|
|
73208
|
+
}
|
|
73209
|
+
const prevMoving = this.stateManager.columnMove.movingColumnOrRow;
|
|
73210
|
+
this.stateManager.columnMove.movingColumnOrRow = args.movingColumnOrRow;
|
|
73211
|
+
try {
|
|
73212
|
+
if (this.internalProps.layoutMap.canMoveHeaderPosition?.(args.source, args.target) === false) {
|
|
73213
|
+
return false;
|
|
73214
|
+
}
|
|
73215
|
+
const oldSourceMergeInfo = this.getCellRange(args.source.col, args.source.row);
|
|
73216
|
+
const oldTargetMergeInfo = this.getCellRange(args.target.col, args.target.row);
|
|
73217
|
+
const moveContext = this._moveHeaderPosition(args.source, args.target);
|
|
73218
|
+
if (!moveContext || moveContext.targetIndex === moveContext.sourceIndex) {
|
|
73219
|
+
return false;
|
|
73220
|
+
}
|
|
73221
|
+
this.internalProps.useOneRowHeightFillAll = false;
|
|
73222
|
+
this.internalProps.layoutMap.clearCellRangeMap();
|
|
73223
|
+
const sourceMergeInfo = this.getCellRange(args.source.col, args.source.row);
|
|
73224
|
+
const targetMergeInfo = this.getCellRange(args.target.col, args.target.row);
|
|
73225
|
+
const colMin = Math.min(sourceMergeInfo.start.col, targetMergeInfo.start.col, oldSourceMergeInfo.start.col, oldTargetMergeInfo.start.col);
|
|
73226
|
+
const colMax = Math.max(sourceMergeInfo.end.col, targetMergeInfo.end.col, oldSourceMergeInfo.end.col, oldTargetMergeInfo.end.col);
|
|
73227
|
+
const rowMin = Math.min(sourceMergeInfo.start.row, targetMergeInfo.start.row, oldSourceMergeInfo.start.row, oldTargetMergeInfo.start.row);
|
|
73228
|
+
let rowMax = Math.max(sourceMergeInfo.end.row, targetMergeInfo.end.row, oldSourceMergeInfo.end.row, oldTargetMergeInfo.end.row);
|
|
73229
|
+
if (moveContext.moveType === 'row' &&
|
|
73230
|
+
this.internalProps.layoutMap.rowHierarchyType === 'tree') {
|
|
73231
|
+
if (moveContext.targetIndex > moveContext.sourceIndex) {
|
|
73232
|
+
rowMax = rowMax + moveContext.targetSize - 1;
|
|
73233
|
+
}
|
|
73234
|
+
else {
|
|
73235
|
+
rowMax = rowMax + moveContext.sourceSize - 1;
|
|
73236
|
+
}
|
|
73237
|
+
}
|
|
73238
|
+
if (!this.transpose &&
|
|
73239
|
+
(this.isSeriesNumberInBody(args.source.col, args.source.row) || args.movingColumnOrRow === 'row')) {
|
|
73240
|
+
this.changeRecordOrder(moveContext.sourceIndex, moveContext.targetIndex);
|
|
73241
|
+
this.stateManager.changeCheckboxAndRadioOrder(moveContext.sourceIndex, moveContext.targetIndex);
|
|
73242
|
+
}
|
|
73243
|
+
if (moveContext.moveType === 'column') {
|
|
73244
|
+
for (let col = colMin; col <= colMax; col++) {
|
|
73245
|
+
this._clearColRangeWidthsMap(col);
|
|
73246
|
+
}
|
|
73247
|
+
}
|
|
73248
|
+
else {
|
|
73249
|
+
for (let row = rowMin; row <= rowMax; row++) {
|
|
73250
|
+
this._clearRowRangeHeightsMap(row);
|
|
73251
|
+
}
|
|
73252
|
+
}
|
|
73253
|
+
this.clearCellStyleCache();
|
|
73254
|
+
if (this.isSeriesNumberInBody(args.source.col, args.source.row) || args.movingColumnOrRow === 'row') {
|
|
73255
|
+
this.scenegraph.updateHeaderPosition(this.scenegraph.proxy.colStart, this.scenegraph.proxy.colEnd, this.scenegraph.proxy.rowStart, this.scenegraph.proxy.rowEnd, moveContext.moveType);
|
|
73256
|
+
}
|
|
73257
|
+
else if (moveContext.moveType === 'column') {
|
|
73258
|
+
this.scenegraph.updateHeaderPosition(colMin, colMax, 0, -1, moveContext.moveType);
|
|
73259
|
+
}
|
|
73260
|
+
else {
|
|
73261
|
+
this.scenegraph.updateHeaderPosition(0, -1, rowMin, rowMax, moveContext.moveType);
|
|
73262
|
+
}
|
|
73263
|
+
if (this.internalProps.frozenColDragHeaderMode === 'adjustFrozenCount' && this.isListTable()) {
|
|
73264
|
+
if (this.isLeftFrozenColumn(args.target.col) && !this.isLeftFrozenColumn(args.source.col)) {
|
|
73265
|
+
this.frozenColCount += sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1;
|
|
73266
|
+
}
|
|
73267
|
+
else if (this.isLeftFrozenColumn(args.source.col) && !this.isLeftFrozenColumn(args.target.col)) {
|
|
73268
|
+
this.frozenColCount -= sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1;
|
|
73269
|
+
}
|
|
73270
|
+
if (this.isRightFrozenColumn(args.target.col) && !this.isRightFrozenColumn(args.source.col)) {
|
|
73271
|
+
this.rightFrozenColCount += sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1;
|
|
73272
|
+
}
|
|
73273
|
+
else if (this.isRightFrozenColumn(args.source.col) && !this.isRightFrozenColumn(args.target.col)) {
|
|
73274
|
+
this.rightFrozenColCount -= sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1;
|
|
73275
|
+
}
|
|
73276
|
+
}
|
|
73277
|
+
this.scenegraph.updateNextFrame?.();
|
|
73278
|
+
return true;
|
|
73279
|
+
}
|
|
73280
|
+
finally {
|
|
73281
|
+
this.stateManager.columnMove.movingColumnOrRow = prevMoving;
|
|
73282
|
+
}
|
|
73283
|
+
}
|
|
73076
73284
|
get recordsCount() {
|
|
73077
73285
|
return this.records?.length;
|
|
73078
73286
|
}
|
|
@@ -73258,8 +73466,7 @@
|
|
|
73258
73466
|
if (this.internalProps.customMergeCell) {
|
|
73259
73467
|
const customMerge = this.internalProps.customMergeCell(col, row, this);
|
|
73260
73468
|
if (customMerge &&
|
|
73261
|
-
customMerge.range
|
|
73262
|
-
(isValid$1(customMerge.text) || customMerge.customLayout || this.customRender)) {
|
|
73469
|
+
customMerge.range) {
|
|
73263
73470
|
if (customMerge.style) {
|
|
73264
73471
|
const styleClass = this.internalProps.bodyHelper.getStyleClass('text');
|
|
73265
73472
|
const style = customMerge.style;
|
|
@@ -74207,12 +74414,37 @@
|
|
|
74207
74414
|
getGroupTitleLevel(col, row) {
|
|
74208
74415
|
return undefined;
|
|
74209
74416
|
}
|
|
74417
|
+
getTargetScrollTop(row) {
|
|
74418
|
+
const drawRange = this.getDrawRange();
|
|
74419
|
+
const frozenHeight = this.getFrozenRowsHeight();
|
|
74420
|
+
return Math.max(0, Math.min(this.getRowsHeight(0, row - 1) - frozenHeight, this.getAllRowsHeight() - drawRange.height));
|
|
74421
|
+
}
|
|
74422
|
+
_scheduleScrollToRowCorrect(row, delay = 0) {
|
|
74423
|
+
this._scrollToRowCorrectTimer = setTimeout(() => {
|
|
74424
|
+
this.clearCorrectTimer();
|
|
74425
|
+
const targetScrollTop = this.getTargetScrollTop(row);
|
|
74426
|
+
if (targetScrollTop !== this.scrollTop) {
|
|
74427
|
+
this.scrollTop = targetScrollTop;
|
|
74428
|
+
const correctedTargetScrollTop = this.getTargetScrollTop(row);
|
|
74429
|
+
if (correctedTargetScrollTop !== this.scrollTop) {
|
|
74430
|
+
this.scrollTop = correctedTargetScrollTop;
|
|
74431
|
+
}
|
|
74432
|
+
}
|
|
74433
|
+
}, delay);
|
|
74434
|
+
}
|
|
74210
74435
|
scrollToRow(row, animationOption) {
|
|
74436
|
+
const targetRow = Math.min(Math.max(Math.floor(row), 0), this.rowCount - 1);
|
|
74437
|
+
this.clearCorrectTimer();
|
|
74211
74438
|
if (!animationOption) {
|
|
74212
|
-
this.scrollToCell({ row });
|
|
74439
|
+
this.scrollToCell({ row: targetRow });
|
|
74440
|
+
this._scheduleScrollToRowCorrect(targetRow);
|
|
74213
74441
|
return;
|
|
74214
74442
|
}
|
|
74215
|
-
|
|
74443
|
+
const duration = !isBoolean$2(animationOption) ? animationOption?.duration ?? 3000 : 3000;
|
|
74444
|
+
this.animationManager.scrollTo({ row: targetRow }, animationOption);
|
|
74445
|
+
this._scrollToRowCorrectTimer = setTimeout(() => {
|
|
74446
|
+
this.scrollToRow(targetRow, false);
|
|
74447
|
+
}, duration);
|
|
74216
74448
|
}
|
|
74217
74449
|
scrollToCol(col, animationOption) {
|
|
74218
74450
|
if (!animationOption) {
|
|
@@ -74234,8 +74466,8 @@
|
|
|
74234
74466
|
}
|
|
74235
74467
|
if (isValid$1(cellAddr.row) && cellAddr.row >= this.frozenRowCount) {
|
|
74236
74468
|
const frozenHeight = this.getFrozenRowsHeight();
|
|
74237
|
-
const top = this.
|
|
74238
|
-
this.scrollTop = Math.min(top - frozenHeight, this.
|
|
74469
|
+
const top = this.rowHeightsMap.getSumInRange(0, cellAddr.row - 1);
|
|
74470
|
+
this.scrollTop = Math.min(top - frozenHeight, this.rowHeightsMap.getSumInRange(0, this.rowCount - 1) - drawRange.height);
|
|
74239
74471
|
}
|
|
74240
74472
|
this.render();
|
|
74241
74473
|
}
|
|
@@ -75154,13 +75386,13 @@
|
|
|
75154
75386
|
const colPath = layout.getColKeysPath(col, row);
|
|
75155
75387
|
indicatorKeys.forEach((key, index) => {
|
|
75156
75388
|
const { range, targetTicks, targetRange, axisOption, chartType } = getAxisRangeAndTicks(col, row, index, index === 0 ? 'bottom' : 'top', index === 0 ? 'top' : 'bottom', indicatorKeys, colPath, layout);
|
|
75157
|
-
if (isNumber$
|
|
75389
|
+
if (isNumber$3(axisOption?.max)) {
|
|
75158
75390
|
range.max = axisOption.max;
|
|
75159
75391
|
}
|
|
75160
75392
|
else if (chartType === 'boxPlot') {
|
|
75161
75393
|
range.max += (range.max - range.min) / 20;
|
|
75162
75394
|
}
|
|
75163
|
-
if (isNumber$
|
|
75395
|
+
if (isNumber$3(axisOption?.min)) {
|
|
75164
75396
|
range.min = axisOption.min;
|
|
75165
75397
|
}
|
|
75166
75398
|
else if (chartType === 'boxPlot') {
|
|
@@ -75224,13 +75456,13 @@
|
|
|
75224
75456
|
indicatorKeys.forEach((key, index) => {
|
|
75225
75457
|
const { range, targetTicks, targetRange, axisOption } = getAxisRangeAndTicks(col, row, index, index === 0 ? 'left' : 'right', index === 0 ? 'right' : 'left', indicatorKeys, rowPath, layout);
|
|
75226
75458
|
const { chartType } = getAxisOption(col, row, index === 0 ? 'left' : 'right', layout);
|
|
75227
|
-
if (isNumber$
|
|
75459
|
+
if (isNumber$3(axisOption?.max)) {
|
|
75228
75460
|
range.max = axisOption.max;
|
|
75229
75461
|
}
|
|
75230
75462
|
else if (chartType === 'boxPlot') {
|
|
75231
75463
|
range.max += (range.max - range.min) / 20;
|
|
75232
75464
|
}
|
|
75233
|
-
if (isNumber$
|
|
75465
|
+
if (isNumber$3(axisOption?.min)) {
|
|
75234
75466
|
range.min = axisOption.min;
|
|
75235
75467
|
}
|
|
75236
75468
|
else if (chartType === 'boxPlot') {
|
|
@@ -75458,19 +75690,35 @@
|
|
|
75458
75690
|
if (layout.rowHierarchyType !== 'tree') {
|
|
75459
75691
|
return;
|
|
75460
75692
|
}
|
|
75461
|
-
const
|
|
75462
|
-
|
|
75463
|
-
|
|
75464
|
-
|
|
75465
|
-
|
|
75466
|
-
|
|
75467
|
-
}
|
|
75693
|
+
const table = layout._table;
|
|
75694
|
+
const internalProps = table.internalProps || {};
|
|
75695
|
+
const isGroupMode = !!internalProps.groupBy;
|
|
75696
|
+
const cellRecord = table.getCellRawRecord(col, row);
|
|
75697
|
+
if (!cellRecord?.vtableMerge) {
|
|
75698
|
+
return;
|
|
75468
75699
|
}
|
|
75469
|
-
|
|
75470
|
-
|
|
75471
|
-
|
|
75472
|
-
|
|
75473
|
-
|
|
75700
|
+
const treeTitleStartCol = internalProps.groupTitleCheckbox && internalProps.rowSeriesNumber
|
|
75701
|
+
? layout.rowHeaderLevelCount + layout.leftRowSeriesNumberColumnCount
|
|
75702
|
+
: layout.rowHeaderLevelCount;
|
|
75703
|
+
if (col < treeTitleStartCol) {
|
|
75704
|
+
return;
|
|
75705
|
+
}
|
|
75706
|
+
cellRange.start.col = treeTitleStartCol;
|
|
75707
|
+
cellRange.end.col = layout.colCount - 1;
|
|
75708
|
+
cellRange.start.row = cellRange.end.row = row;
|
|
75709
|
+
if (isGroupMode && layout.columnObjects?.length === 1) {
|
|
75710
|
+
const onlyColumn = layout.columnObjects[0];
|
|
75711
|
+
const field = onlyColumn?.field;
|
|
75712
|
+
if (field != null) {
|
|
75713
|
+
let text = cellRecord.vtableMergeName;
|
|
75714
|
+
const groupTitleFieldFormat = internalProps.groupTitleFieldFormat;
|
|
75715
|
+
if (typeof groupTitleFieldFormat === 'function') {
|
|
75716
|
+
text = groupTitleFieldFormat(cellRecord, col, row, table);
|
|
75717
|
+
}
|
|
75718
|
+
const current = cellRecord[field];
|
|
75719
|
+
if (current == null && text != null) {
|
|
75720
|
+
cellRecord[field] = text;
|
|
75721
|
+
}
|
|
75474
75722
|
}
|
|
75475
75723
|
}
|
|
75476
75724
|
}
|
|
@@ -76942,7 +77190,12 @@
|
|
|
76942
77190
|
}
|
|
76943
77191
|
this.table._makeVisibleCell(col, row);
|
|
76944
77192
|
this.editingEditor = editor;
|
|
76945
|
-
const
|
|
77193
|
+
const customMergeText = this.table.getCustomMerge(col, row)?.text;
|
|
77194
|
+
const dataValue = isValid$1(value)
|
|
77195
|
+
? value
|
|
77196
|
+
: isValid$1(customMergeText)
|
|
77197
|
+
? customMergeText
|
|
77198
|
+
: this.table.getCellOriginValue(col, row);
|
|
76946
77199
|
const rect = this.table.getCellRangeRelativeRect(this.table.getCellRange(col, row));
|
|
76947
77200
|
const referencePosition = { rect: { left: rect.left, top: rect.top, width: rect.width, height: rect.height } };
|
|
76948
77201
|
if (col === this.table.colCount - 1) {
|
|
@@ -77000,7 +77253,10 @@
|
|
|
77000
77253
|
if (this.editingEditor.validateValue) {
|
|
77001
77254
|
this.isValidatingValue = true;
|
|
77002
77255
|
const newValue = this.editingEditor.getValue();
|
|
77003
|
-
const
|
|
77256
|
+
const customMergeText = this.table.getCustomMerge(this.editCell.col, this.editCell.row)?.text;
|
|
77257
|
+
const oldValue = isValid$1(customMergeText)
|
|
77258
|
+
? customMergeText
|
|
77259
|
+
: this.table.getCellOriginValue(this.editCell.col, this.editCell.row);
|
|
77004
77260
|
const target = e?.target;
|
|
77005
77261
|
const maybePromiseOrValue = this.editingEditor.validateValue?.(newValue, oldValue, this.editCell, this.table, !!this.table.getElement().contains(target));
|
|
77006
77262
|
if (isPromise(maybePromiseOrValue)) {
|
|
@@ -77024,16 +77280,21 @@
|
|
|
77024
77280
|
doExit() {
|
|
77025
77281
|
const changedValue = this.editingEditor.getValue?.();
|
|
77026
77282
|
const range = this.table.getCellRange(this.editCell.col, this.editCell.row);
|
|
77027
|
-
|
|
77028
|
-
|
|
77029
|
-
|
|
77030
|
-
|
|
77031
|
-
|
|
77283
|
+
this.editingEditor.beforeEnd?.();
|
|
77284
|
+
if (range.isCustom) {
|
|
77285
|
+
this.table.changeCellValue(range.start.col, range.start.row, changedValue);
|
|
77286
|
+
}
|
|
77287
|
+
else {
|
|
77288
|
+
const changedValues = [];
|
|
77289
|
+
for (let row = range.start.row; row <= range.end.row; row++) {
|
|
77290
|
+
const rowChangedValues = [];
|
|
77291
|
+
for (let col = range.start.col; col <= range.end.col; col++) {
|
|
77292
|
+
rowChangedValues.push(changedValue);
|
|
77293
|
+
}
|
|
77294
|
+
changedValues.push(rowChangedValues);
|
|
77032
77295
|
}
|
|
77033
|
-
|
|
77296
|
+
this.table.changeCellValues(range.start.col, range.start.row, changedValues);
|
|
77034
77297
|
}
|
|
77035
|
-
this.editingEditor.beforeEnd?.();
|
|
77036
|
-
this.table.changeCellValues(range.start.col, range.start.row, changedValues);
|
|
77037
77298
|
this.editingEditor.exit && (void 0);
|
|
77038
77299
|
this.editingEditor.exit?.();
|
|
77039
77300
|
this.editingEditor.onEnd?.();
|
|
@@ -77047,6 +77308,8 @@
|
|
|
77047
77308
|
this.editingEditor.onEnd?.();
|
|
77048
77309
|
this.editingEditor = null;
|
|
77049
77310
|
}
|
|
77311
|
+
Object.values(this.cacheLastSelectedCellEditor).forEach((editor) => editor?.onEnd?.());
|
|
77312
|
+
this.cacheLastSelectedCellEditor = {};
|
|
77050
77313
|
}
|
|
77051
77314
|
release() {
|
|
77052
77315
|
this.listenersId.forEach(id => {
|
|
@@ -77100,6 +77363,24 @@
|
|
|
77100
77363
|
return { addRecordRule };
|
|
77101
77364
|
}
|
|
77102
77365
|
|
|
77366
|
+
function refreshCustomMergeCellGroups(table) {
|
|
77367
|
+
if (!Array.isArray(table.options.customMergeCell)) {
|
|
77368
|
+
return;
|
|
77369
|
+
}
|
|
77370
|
+
table.internalProps.customMergeCell = getCustomMergeCellFunc(table.options.customMergeCell);
|
|
77371
|
+
const merges = table.options.customMergeCell;
|
|
77372
|
+
for (let i = 0; i < merges.length; i++) {
|
|
77373
|
+
const r = merges[i]?.range;
|
|
77374
|
+
if (!r?.start) {
|
|
77375
|
+
continue;
|
|
77376
|
+
}
|
|
77377
|
+
for (let col = r.start.col; col <= r.end.col; col++) {
|
|
77378
|
+
for (let row = r.start.row; row <= r.end.row; row++) {
|
|
77379
|
+
table.scenegraph.updateCellContent(col, row);
|
|
77380
|
+
}
|
|
77381
|
+
}
|
|
77382
|
+
}
|
|
77383
|
+
}
|
|
77103
77384
|
function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table, noTriggerChangeCellValuesEvent) {
|
|
77104
77385
|
if ((workOnEditableCell && table.isHasEditorDefine(col, row)) || workOnEditableCell === false) {
|
|
77105
77386
|
const recordShowIndex = table.getRecordShowIndexByCell(col, row);
|
|
@@ -77114,6 +77395,16 @@
|
|
|
77114
77395
|
table.dataSource.changeFieldValue(value, recordShowIndex, field, col, row, table);
|
|
77115
77396
|
}
|
|
77116
77397
|
const range = table.getCellRange(col, row);
|
|
77398
|
+
if (range.isCustom &&
|
|
77399
|
+
range.start.col === col &&
|
|
77400
|
+
range.start.row === row &&
|
|
77401
|
+
Array.isArray(table.options.customMergeCell) &&
|
|
77402
|
+
typeof table.getCellValue === 'function') {
|
|
77403
|
+
const customMerge = table.internalProps?.customMergeCell?.(col, row, table);
|
|
77404
|
+
if (customMerge) {
|
|
77405
|
+
customMerge.text = value;
|
|
77406
|
+
}
|
|
77407
|
+
}
|
|
77117
77408
|
const aggregators = table.internalProps.layoutMap.getAggregatorsByCell(col, row);
|
|
77118
77409
|
if (aggregators) {
|
|
77119
77410
|
if (Array.isArray(aggregators)) {
|
|
@@ -77493,10 +77784,15 @@
|
|
|
77493
77784
|
table.dataSource.addRecord(record, recordIndex, syncToOriginalRecords);
|
|
77494
77785
|
adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1);
|
|
77495
77786
|
if (syncToOriginalRecords) {
|
|
77787
|
+
if (!table.transpose) {
|
|
77788
|
+
const topAggregationCount = table.internalProps.layoutMap.hasAggregationOnTopCount;
|
|
77789
|
+
const insertRowIndex = recordIndex + headerCount + topAggregationCount;
|
|
77790
|
+
table.rowHeightsMap.insert(insertRowIndex);
|
|
77791
|
+
}
|
|
77496
77792
|
table.refreshRowColCount();
|
|
77497
77793
|
table.internalProps.layoutMap.clearCellRangeMap();
|
|
77498
77794
|
table.scenegraph.clearCells();
|
|
77499
|
-
table.scenegraph.createSceneGraph();
|
|
77795
|
+
table.scenegraph.createSceneGraph(true);
|
|
77500
77796
|
return true;
|
|
77501
77797
|
}
|
|
77502
77798
|
const oldRowCount = table.rowCount;
|
|
@@ -77635,10 +77931,17 @@
|
|
|
77635
77931
|
table.dataSource.addRecords(records, recordIndex, syncToOriginalRecords);
|
|
77636
77932
|
adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length);
|
|
77637
77933
|
if (syncToOriginalRecords) {
|
|
77934
|
+
if (!table.transpose) {
|
|
77935
|
+
const topAggregationCount = table.internalProps.layoutMap.hasAggregationOnTopCount;
|
|
77936
|
+
const insertRowIndex = recordIndex + headerCount + topAggregationCount;
|
|
77937
|
+
for (let i = 0; i < records.length; i++) {
|
|
77938
|
+
table.rowHeightsMap.insert(insertRowIndex);
|
|
77939
|
+
}
|
|
77940
|
+
}
|
|
77638
77941
|
table.refreshRowColCount();
|
|
77639
77942
|
table.internalProps.layoutMap.clearCellRangeMap();
|
|
77640
77943
|
table.scenegraph.clearCells();
|
|
77641
|
-
table.scenegraph.createSceneGraph();
|
|
77944
|
+
table.scenegraph.createSceneGraph(true);
|
|
77642
77945
|
return true;
|
|
77643
77946
|
}
|
|
77644
77947
|
const oldRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
@@ -77774,14 +78077,25 @@
|
|
|
77774
78077
|
if (deletedRecordIndexs.length === 0) {
|
|
77775
78078
|
return;
|
|
77776
78079
|
}
|
|
78080
|
+
if (Array.isArray(table.options.customMergeCell)) {
|
|
78081
|
+
table.internalProps.customMergeCell = getCustomMergeCellFunc(table.options.customMergeCell);
|
|
78082
|
+
}
|
|
77777
78083
|
for (let index = 0; index < deletedRecordIndexs.length; index++) {
|
|
77778
78084
|
adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);
|
|
77779
78085
|
}
|
|
77780
78086
|
if (syncToOriginalRecords) {
|
|
78087
|
+
if (!table.transpose) {
|
|
78088
|
+
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
|
|
78089
|
+
const topAggregationCount = table.internalProps.layoutMap.hasAggregationOnTopCount;
|
|
78090
|
+
const sorted = [...deletedRecordIndexs].sort((a, b) => b - a);
|
|
78091
|
+
for (let i = 0; i < sorted.length; i++) {
|
|
78092
|
+
table.rowHeightsMap.delete(sorted[i] + headerCount + topAggregationCount);
|
|
78093
|
+
}
|
|
78094
|
+
}
|
|
77781
78095
|
table.refreshRowColCount();
|
|
77782
78096
|
table.internalProps.layoutMap.clearCellRangeMap();
|
|
77783
78097
|
table.scenegraph.clearCells();
|
|
77784
|
-
table.scenegraph.createSceneGraph();
|
|
78098
|
+
table.scenegraph.createSceneGraph(true);
|
|
77785
78099
|
return;
|
|
77786
78100
|
}
|
|
77787
78101
|
const oldRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
@@ -77838,6 +78152,7 @@
|
|
|
77838
78152
|
? table.scenegraph.updateCol(delRows, [], updateRows)
|
|
77839
78153
|
: table.scenegraph.updateRow(delRows, [], updateRows);
|
|
77840
78154
|
table.reactCustomLayout?.updateAllCustomCell();
|
|
78155
|
+
refreshCustomMergeCellGroups(table);
|
|
77841
78156
|
}
|
|
77842
78157
|
}
|
|
77843
78158
|
}
|
|
@@ -77857,6 +78172,46 @@
|
|
|
77857
78172
|
}
|
|
77858
78173
|
}
|
|
77859
78174
|
const updateRows = [];
|
|
78175
|
+
if (table.internalProps.customMergeCell) {
|
|
78176
|
+
const proxy = table.scenegraph.proxy;
|
|
78177
|
+
recordIndexsMinToMax[0];
|
|
78178
|
+
const deletedIndexNums = recordIndexsMinToMax.map(recordIndex => recordIndex + headerCount + topAggregationCount);
|
|
78179
|
+
const minIndexNum = deletedIndexNums[0];
|
|
78180
|
+
let updateMin = minIndexNum;
|
|
78181
|
+
let updateMax = minIndexNum;
|
|
78182
|
+
if (Array.isArray(table.options.customMergeCell)) {
|
|
78183
|
+
const merges = table.options.customMergeCell;
|
|
78184
|
+
const axis = table.transpose ? 'col' : 'row';
|
|
78185
|
+
merges.forEach(m => {
|
|
78186
|
+
const r = m?.range;
|
|
78187
|
+
if (!r?.start || !r?.end) {
|
|
78188
|
+
return;
|
|
78189
|
+
}
|
|
78190
|
+
for (let i = 0; i < deletedIndexNums.length; i++) {
|
|
78191
|
+
const deleteIndex = deletedIndexNums[i];
|
|
78192
|
+
if (r.end[axis] >= deleteIndex - 1) {
|
|
78193
|
+
updateMin = Math.min(updateMin, r.start[axis]);
|
|
78194
|
+
updateMax = Math.max(updateMax, r.end[axis]);
|
|
78195
|
+
break;
|
|
78196
|
+
}
|
|
78197
|
+
}
|
|
78198
|
+
});
|
|
78199
|
+
}
|
|
78200
|
+
if (table.transpose) {
|
|
78201
|
+
const start = Math.max(updateMin, proxy?.colStart ?? updateMin);
|
|
78202
|
+
const end = Math.min(updateMax, proxy?.colEnd ?? updateMax);
|
|
78203
|
+
for (let col = start; col <= end; col++) {
|
|
78204
|
+
updateRows.push({ col, row: 0 });
|
|
78205
|
+
}
|
|
78206
|
+
}
|
|
78207
|
+
else {
|
|
78208
|
+
const start = Math.max(updateMin, proxy?.rowStart ?? updateMin);
|
|
78209
|
+
const end = Math.min(updateMax, proxy?.rowEnd ?? updateMax);
|
|
78210
|
+
for (let row = start; row <= end; row++) {
|
|
78211
|
+
updateRows.push({ col: 0, row });
|
|
78212
|
+
}
|
|
78213
|
+
}
|
|
78214
|
+
}
|
|
77860
78215
|
for (let row = headerCount; row < headerCount + topAggregationCount; row++) {
|
|
77861
78216
|
if (table.transpose) {
|
|
77862
78217
|
updateRows.push({ col: row, row: 0 });
|
|
@@ -77878,6 +78233,7 @@
|
|
|
77878
78233
|
? table.scenegraph.updateCol(delRows, [], updateRows)
|
|
77879
78234
|
: table.scenegraph.updateRow(delRows, [], updateRows);
|
|
77880
78235
|
table.reactCustomLayout?.updateAllCustomCell();
|
|
78236
|
+
refreshCustomMergeCellGroups(table);
|
|
77881
78237
|
}
|
|
77882
78238
|
}
|
|
77883
78239
|
}
|
|
@@ -77923,7 +78279,7 @@
|
|
|
77923
78279
|
table.refreshRowColCount();
|
|
77924
78280
|
table.internalProps.layoutMap.clearCellRangeMap();
|
|
77925
78281
|
table.scenegraph.clearCells();
|
|
77926
|
-
table.scenegraph.createSceneGraph();
|
|
78282
|
+
table.scenegraph.createSceneGraph(true);
|
|
77927
78283
|
return;
|
|
77928
78284
|
}
|
|
77929
78285
|
const bodyRowIndex = updateRecordIndexs.map((index) => table.getBodyRowIndexByRecordIndex(index));
|
|
@@ -78014,7 +78370,7 @@
|
|
|
78014
78370
|
}
|
|
78015
78371
|
if (table.dataSource.rowHierarchyType === 'tree') {
|
|
78016
78372
|
let toOperateIndexArr;
|
|
78017
|
-
if (isNumber$
|
|
78373
|
+
if (isNumber$3(recordIndex)) {
|
|
78018
78374
|
toOperateIndexArr = [recordIndex];
|
|
78019
78375
|
}
|
|
78020
78376
|
else {
|
|
@@ -78105,7 +78461,7 @@
|
|
|
78105
78461
|
}
|
|
78106
78462
|
if (table.dataSource.rowHierarchyType === 'tree') {
|
|
78107
78463
|
let toOperateIndexArr;
|
|
78108
|
-
if (isNumber$
|
|
78464
|
+
if (isNumber$3(recordIndex)) {
|
|
78109
78465
|
toOperateIndexArr = [recordIndex];
|
|
78110
78466
|
}
|
|
78111
78467
|
else {
|
|
@@ -78375,6 +78731,53 @@
|
|
|
78375
78731
|
}
|
|
78376
78732
|
addColumns(toAddColumns, colIndex, isMaintainArrayData = true) {
|
|
78377
78733
|
const columns = this.options.columns;
|
|
78734
|
+
if (Array.isArray(this.options.customMergeCell) && toAddColumns?.length) {
|
|
78735
|
+
const axis = this.transpose ? 'row' : 'col';
|
|
78736
|
+
let insertIndex = colIndex;
|
|
78737
|
+
if (insertIndex === undefined) {
|
|
78738
|
+
insertIndex = columns.length;
|
|
78739
|
+
}
|
|
78740
|
+
else if (insertIndex < 0) {
|
|
78741
|
+
insertIndex = 0;
|
|
78742
|
+
}
|
|
78743
|
+
else if (insertIndex > columns.length) {
|
|
78744
|
+
insertIndex = columns.length;
|
|
78745
|
+
}
|
|
78746
|
+
const toAddCount = toAddColumns.length;
|
|
78747
|
+
const merges = this.options.customMergeCell.map(m => ({
|
|
78748
|
+
...m,
|
|
78749
|
+
range: { start: { ...m.range.start }, end: { ...m.range.end } }
|
|
78750
|
+
}));
|
|
78751
|
+
for (let i = 0; i < merges.length; i++) {
|
|
78752
|
+
const r = merges[i]?.range;
|
|
78753
|
+
if (!r?.start || !r?.end) {
|
|
78754
|
+
continue;
|
|
78755
|
+
}
|
|
78756
|
+
const start = r.start[axis];
|
|
78757
|
+
const end = r.end[axis];
|
|
78758
|
+
if (end < insertIndex) {
|
|
78759
|
+
continue;
|
|
78760
|
+
}
|
|
78761
|
+
if (start > insertIndex) {
|
|
78762
|
+
r.start[axis] = start + toAddCount;
|
|
78763
|
+
r.end[axis] = end + toAddCount;
|
|
78764
|
+
}
|
|
78765
|
+
else {
|
|
78766
|
+
r.end[axis] = end + toAddCount;
|
|
78767
|
+
}
|
|
78768
|
+
}
|
|
78769
|
+
this.options.customMergeCell = merges.filter((m) => {
|
|
78770
|
+
const r = m?.range;
|
|
78771
|
+
if (!r?.start || !r?.end) {
|
|
78772
|
+
return false;
|
|
78773
|
+
}
|
|
78774
|
+
if (r.end.row < r.start.row || r.end.col < r.start.col) {
|
|
78775
|
+
return false;
|
|
78776
|
+
}
|
|
78777
|
+
return !(r.start.row === r.end.row && r.start.col === r.end.col);
|
|
78778
|
+
});
|
|
78779
|
+
this.internalProps.customMergeCell = getCustomMergeCellFunc(this.options.customMergeCell);
|
|
78780
|
+
}
|
|
78378
78781
|
if (colIndex === undefined) {
|
|
78379
78782
|
colIndex = columns.length;
|
|
78380
78783
|
columns.push(...toAddColumns);
|
|
@@ -78405,6 +78808,21 @@
|
|
|
78405
78808
|
}
|
|
78406
78809
|
}
|
|
78407
78810
|
this.updateColumns(columns, { clearRowHeightCache: false });
|
|
78811
|
+
if (Array.isArray(this.options.customMergeCell)) {
|
|
78812
|
+
this.internalProps.customMergeCell = getCustomMergeCellFunc(this.options.customMergeCell);
|
|
78813
|
+
this.options.customMergeCell.forEach(m => {
|
|
78814
|
+
const r = m?.range;
|
|
78815
|
+
if (!r?.start) {
|
|
78816
|
+
return;
|
|
78817
|
+
}
|
|
78818
|
+
for (let col = r.start.col; col <= r.end.col; col++) {
|
|
78819
|
+
for (let row = r.start.row; row <= r.end.row; row++) {
|
|
78820
|
+
this.scenegraph.updateCellContent(col, row);
|
|
78821
|
+
}
|
|
78822
|
+
}
|
|
78823
|
+
});
|
|
78824
|
+
this.scenegraph.updateNextFrame();
|
|
78825
|
+
}
|
|
78408
78826
|
this.fireListeners(TABLE_EVENT_TYPE.ADD_COLUMN, {
|
|
78409
78827
|
columnIndex: colIndex,
|
|
78410
78828
|
columnCount: toAddColumns.length,
|
|
@@ -78414,6 +78832,65 @@
|
|
|
78414
78832
|
deleteColumns(deleteColIndexs, isMaintainArrayData = true) {
|
|
78415
78833
|
const columns = this.options.columns;
|
|
78416
78834
|
deleteColIndexs.sort((a, b) => b - a);
|
|
78835
|
+
const deletedColumns = deleteColIndexs.map(idx => cloneDeepSpec(columns[idx], ['children']));
|
|
78836
|
+
let deletedRecordValues;
|
|
78837
|
+
if (Array.isArray(this.options.customMergeCell) && deleteColIndexs?.length) {
|
|
78838
|
+
const axis = this.transpose ? 'row' : 'col';
|
|
78839
|
+
const deleteIndexNums = deleteColIndexs
|
|
78840
|
+
.slice()
|
|
78841
|
+
.sort((a, b) => a - b)
|
|
78842
|
+
.map((idx, i) => idx - i);
|
|
78843
|
+
const merges = this.options.customMergeCell.map(m => ({
|
|
78844
|
+
...m,
|
|
78845
|
+
range: {
|
|
78846
|
+
start: { ...m.range.start },
|
|
78847
|
+
end: { ...m.range.end }
|
|
78848
|
+
}
|
|
78849
|
+
}));
|
|
78850
|
+
for (let i = 0; i < deleteIndexNums.length; i++) {
|
|
78851
|
+
const deleteIndex = deleteIndexNums[i];
|
|
78852
|
+
for (let j = 0; j < merges.length; j++) {
|
|
78853
|
+
const r = merges[j]?.range;
|
|
78854
|
+
if (!r?.start || !r?.end) {
|
|
78855
|
+
continue;
|
|
78856
|
+
}
|
|
78857
|
+
const start = r.start[axis];
|
|
78858
|
+
const end = r.end[axis];
|
|
78859
|
+
if (end < deleteIndex) {
|
|
78860
|
+
continue;
|
|
78861
|
+
}
|
|
78862
|
+
if (start > deleteIndex) {
|
|
78863
|
+
r.start[axis] = start - 1;
|
|
78864
|
+
r.end[axis] = end - 1;
|
|
78865
|
+
}
|
|
78866
|
+
else {
|
|
78867
|
+
r.end[axis] = end - 1;
|
|
78868
|
+
}
|
|
78869
|
+
}
|
|
78870
|
+
}
|
|
78871
|
+
this.options.customMergeCell = merges.filter((m) => {
|
|
78872
|
+
const r = m?.range;
|
|
78873
|
+
if (!r?.start || !r?.end) {
|
|
78874
|
+
return false;
|
|
78875
|
+
}
|
|
78876
|
+
if (r.end.row < r.start.row || r.end.col < r.start.col) {
|
|
78877
|
+
return false;
|
|
78878
|
+
}
|
|
78879
|
+
return !(r.start.row === r.end.row && r.start.col === r.end.col);
|
|
78880
|
+
});
|
|
78881
|
+
this.internalProps.customMergeCell = getCustomMergeCellFunc(this.options.customMergeCell);
|
|
78882
|
+
}
|
|
78883
|
+
if (isMaintainArrayData && Array.isArray(this.records) && this.records.length) {
|
|
78884
|
+
deletedRecordValues = this.records.map(record => {
|
|
78885
|
+
if (Array.isArray(record)) {
|
|
78886
|
+
return deleteColIndexs.map(idx => record[idx]);
|
|
78887
|
+
}
|
|
78888
|
+
return [];
|
|
78889
|
+
});
|
|
78890
|
+
if (deletedRecordValues.every(v => v.length === 0)) {
|
|
78891
|
+
deletedRecordValues = undefined;
|
|
78892
|
+
}
|
|
78893
|
+
}
|
|
78417
78894
|
for (let i = 0; i < deleteColIndexs.length; i++) {
|
|
78418
78895
|
columns.splice(deleteColIndexs[i], 1);
|
|
78419
78896
|
this.colWidthsMap.delAndReorder(deleteColIndexs[i]);
|
|
@@ -78446,7 +78923,9 @@
|
|
|
78446
78923
|
this.updateColumns(columns, { clearRowHeightCache: false });
|
|
78447
78924
|
this.fireListeners(TABLE_EVENT_TYPE.DELETE_COLUMN, {
|
|
78448
78925
|
deleteColIndexs: deleteColIndexs,
|
|
78449
|
-
columns
|
|
78926
|
+
columns,
|
|
78927
|
+
deletedColumns,
|
|
78928
|
+
deletedRecordValues
|
|
78450
78929
|
});
|
|
78451
78930
|
}
|
|
78452
78931
|
get columns() {
|
|
@@ -79063,47 +79542,54 @@
|
|
|
79063
79542
|
return undefined;
|
|
79064
79543
|
}
|
|
79065
79544
|
updateSortState(sortState, executeSort = true) {
|
|
79066
|
-
|
|
79067
|
-
|
|
79068
|
-
|
|
79069
|
-
for (let i = 0; i < this.internalProps.sortState.length; i++) {
|
|
79070
|
-
sortState = this.internalProps.sortState?.[i];
|
|
79071
|
-
sortState && (sortState.order = 'normal');
|
|
79072
|
-
}
|
|
79073
|
-
}
|
|
79074
|
-
else {
|
|
79075
|
-
this.internalProps.sortState.order = 'normal';
|
|
79076
|
-
sortState = this.internalProps.sortState;
|
|
79077
|
-
}
|
|
79078
|
-
}
|
|
79079
|
-
}
|
|
79080
|
-
else {
|
|
79545
|
+
const nextSortState = Array.isArray(sortState) ? sortState : sortState ? [sortState] : [];
|
|
79546
|
+
const normalizedSortState = nextSortState.filter(Boolean);
|
|
79547
|
+
if (normalizedSortState.length) {
|
|
79081
79548
|
this.internalProps.sortState = sortState;
|
|
79082
79549
|
}
|
|
79083
|
-
|
|
79084
|
-
|
|
79085
|
-
|
|
79086
|
-
|
|
79087
|
-
|
|
79088
|
-
|
|
79089
|
-
|
|
79090
|
-
|
|
79091
|
-
|
|
79092
|
-
|
|
79093
|
-
|
|
79094
|
-
|
|
79550
|
+
else {
|
|
79551
|
+
this.internalProps.sortState = null;
|
|
79552
|
+
}
|
|
79553
|
+
if (executeSort) {
|
|
79554
|
+
if (normalizedSortState.length) {
|
|
79555
|
+
if (this.internalProps.layoutMap.headerObjects.some(item => item.define.sort !== false)) {
|
|
79556
|
+
this.dataSource.sort(normalizedSortState.map((item) => {
|
|
79557
|
+
const sortFunc = this._getSortFuncFromHeaderOption(this.internalProps.columns, item.field);
|
|
79558
|
+
this.internalProps.layoutMap.headerObjects.find((col) => col && col.field === item.field);
|
|
79559
|
+
return {
|
|
79560
|
+
field: item.field,
|
|
79561
|
+
order: item.order,
|
|
79562
|
+
orderFn: sortFunc ?? defaultOrderFn
|
|
79563
|
+
};
|
|
79564
|
+
}));
|
|
79565
|
+
this.internalProps.layoutMap.clearCellRangeMap();
|
|
79566
|
+
this.internalProps.useOneRowHeightFillAll = false;
|
|
79567
|
+
this.scenegraph.sortCell();
|
|
79568
|
+
}
|
|
79569
|
+
}
|
|
79570
|
+
else {
|
|
79571
|
+
const ds = this.dataSource;
|
|
79572
|
+
const sourceLength = ds?.sourceLength ?? ds?._sourceLength ?? ds?.length ?? 0;
|
|
79573
|
+
if (ds?.sortedIndexMap?.clear) {
|
|
79574
|
+
ds.sortedIndexMap.clear();
|
|
79575
|
+
}
|
|
79576
|
+
if (typeof ds.currentIndexedData !== 'undefined') {
|
|
79577
|
+
ds.currentIndexedData = Array.from({ length: sourceLength }, (_, i) => i);
|
|
79578
|
+
}
|
|
79579
|
+
ds.lastSortStates = [];
|
|
79580
|
+
ds.updatePagination?.(ds.pagination);
|
|
79095
79581
|
this.internalProps.layoutMap.clearCellRangeMap();
|
|
79096
79582
|
this.internalProps.useOneRowHeightFillAll = false;
|
|
79097
79583
|
this.scenegraph.sortCell();
|
|
79098
79584
|
}
|
|
79099
79585
|
}
|
|
79100
|
-
|
|
79101
|
-
this.stateManager.updateSortState(sortState);
|
|
79102
|
-
}
|
|
79586
|
+
this.stateManager.updateSortState(normalizedSortState);
|
|
79103
79587
|
}
|
|
79104
79588
|
updateFilterRules(filterRules, options = { clearRowHeightCache: true }) {
|
|
79105
79589
|
this.scenegraph.clearCells();
|
|
79106
|
-
|
|
79590
|
+
if (options?.clearForceVisibleRecords !== false) {
|
|
79591
|
+
this.dataSource.clearForceVisibleRecords?.();
|
|
79592
|
+
}
|
|
79107
79593
|
if (this.sortState) {
|
|
79108
79594
|
this.dataSource.updateFilterRulesForSorted(filterRules);
|
|
79109
79595
|
sortRecords(this);
|
|
@@ -79507,9 +79993,70 @@
|
|
|
79507
79993
|
this.resize();
|
|
79508
79994
|
}
|
|
79509
79995
|
addRecord(record, recordIndex, triggerEvent = true) {
|
|
79996
|
+
if (Array.isArray(this.options.customMergeCell) && typeof recordIndex === 'number') {
|
|
79997
|
+
const axis = this.transpose ? 'col' : 'row';
|
|
79998
|
+
const headerCount = this.transpose ? this.rowHeaderLevelCount : this.columnHeaderLevelCount;
|
|
79999
|
+
const topAggregationCount = this.internalProps.layoutMap.hasAggregationOnTopCount;
|
|
80000
|
+
let insertIndex = recordIndex;
|
|
80001
|
+
if (insertIndex === undefined || insertIndex > this.dataSource.sourceLength) {
|
|
80002
|
+
insertIndex = this.dataSource.sourceLength;
|
|
80003
|
+
}
|
|
80004
|
+
else if (insertIndex < 0) {
|
|
80005
|
+
insertIndex = 0;
|
|
80006
|
+
}
|
|
80007
|
+
const insertIndexNum = insertIndex + headerCount + topAggregationCount;
|
|
80008
|
+
const merges = this.options.customMergeCell.map(m => ({
|
|
80009
|
+
...m,
|
|
80010
|
+
range: { start: { ...m.range.start }, end: { ...m.range.end } }
|
|
80011
|
+
}));
|
|
80012
|
+
for (let i = 0; i < merges.length; i++) {
|
|
80013
|
+
const r = merges[i]?.range;
|
|
80014
|
+
if (!r?.start || !r?.end) {
|
|
80015
|
+
continue;
|
|
80016
|
+
}
|
|
80017
|
+
const start = r.start[axis];
|
|
80018
|
+
const end = r.end[axis];
|
|
80019
|
+
if (end < insertIndexNum) {
|
|
80020
|
+
continue;
|
|
80021
|
+
}
|
|
80022
|
+
if (start > insertIndexNum) {
|
|
80023
|
+
r.start[axis] = start + 1;
|
|
80024
|
+
r.end[axis] = end + 1;
|
|
80025
|
+
}
|
|
80026
|
+
else {
|
|
80027
|
+
r.end[axis] = end + 1;
|
|
80028
|
+
}
|
|
80029
|
+
}
|
|
80030
|
+
this.options.customMergeCell = merges.filter((m) => {
|
|
80031
|
+
const r = m?.range;
|
|
80032
|
+
if (!r?.start || !r?.end) {
|
|
80033
|
+
return false;
|
|
80034
|
+
}
|
|
80035
|
+
if (r.end.row < r.start.row || r.end.col < r.start.col) {
|
|
80036
|
+
return false;
|
|
80037
|
+
}
|
|
80038
|
+
return !(r.start.row === r.end.row && r.start.col === r.end.col);
|
|
80039
|
+
});
|
|
80040
|
+
this.internalProps.customMergeCell = getCustomMergeCellFunc(this.options.customMergeCell);
|
|
80041
|
+
}
|
|
79510
80042
|
const success = listTableAddRecord(record, recordIndex, this);
|
|
79511
80043
|
adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]);
|
|
79512
80044
|
this.internalProps.emptyTip?.resetVisible();
|
|
80045
|
+
if (success && Array.isArray(this.options.customMergeCell)) {
|
|
80046
|
+
this.internalProps.customMergeCell = getCustomMergeCellFunc(this.options.customMergeCell);
|
|
80047
|
+
this.options.customMergeCell.forEach(m => {
|
|
80048
|
+
const r = m?.range;
|
|
80049
|
+
if (!r?.start) {
|
|
80050
|
+
return;
|
|
80051
|
+
}
|
|
80052
|
+
for (let col = r.start.col; col <= r.end.col; col++) {
|
|
80053
|
+
for (let row = r.start.row; row <= r.end.row; row++) {
|
|
80054
|
+
this.scenegraph.updateCellContent(col, row);
|
|
80055
|
+
}
|
|
80056
|
+
}
|
|
80057
|
+
});
|
|
80058
|
+
this.scenegraph.updateNextFrame();
|
|
80059
|
+
}
|
|
79513
80060
|
if (triggerEvent && success) {
|
|
79514
80061
|
this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
|
|
79515
80062
|
records: [record],
|
|
@@ -79519,11 +80066,73 @@
|
|
|
79519
80066
|
}
|
|
79520
80067
|
}
|
|
79521
80068
|
addRecords(records, recordIndex, triggerEvent = true) {
|
|
80069
|
+
if (Array.isArray(this.options.customMergeCell) && typeof recordIndex === 'number' && records?.length) {
|
|
80070
|
+
const axis = this.transpose ? 'col' : 'row';
|
|
80071
|
+
const headerCount = this.transpose ? this.rowHeaderLevelCount : this.columnHeaderLevelCount;
|
|
80072
|
+
const topAggregationCount = this.internalProps.layoutMap.hasAggregationOnTopCount;
|
|
80073
|
+
let insertIndex = recordIndex;
|
|
80074
|
+
if (insertIndex === undefined || insertIndex > this.dataSource.sourceLength) {
|
|
80075
|
+
insertIndex = this.dataSource.sourceLength;
|
|
80076
|
+
}
|
|
80077
|
+
else if (insertIndex < 0) {
|
|
80078
|
+
insertIndex = 0;
|
|
80079
|
+
}
|
|
80080
|
+
const insertIndexNum = insertIndex + headerCount + topAggregationCount;
|
|
80081
|
+
const toAddCount = records.length;
|
|
80082
|
+
const merges = this.options.customMergeCell.map(m => ({
|
|
80083
|
+
...m,
|
|
80084
|
+
range: { start: { ...m.range.start }, end: { ...m.range.end } }
|
|
80085
|
+
}));
|
|
80086
|
+
for (let i = 0; i < merges.length; i++) {
|
|
80087
|
+
const r = merges[i]?.range;
|
|
80088
|
+
if (!r?.start || !r?.end) {
|
|
80089
|
+
continue;
|
|
80090
|
+
}
|
|
80091
|
+
const start = r.start[axis];
|
|
80092
|
+
const end = r.end[axis];
|
|
80093
|
+
if (end < insertIndexNum) {
|
|
80094
|
+
continue;
|
|
80095
|
+
}
|
|
80096
|
+
if (start > insertIndexNum) {
|
|
80097
|
+
r.start[axis] = start + toAddCount;
|
|
80098
|
+
r.end[axis] = end + toAddCount;
|
|
80099
|
+
}
|
|
80100
|
+
else {
|
|
80101
|
+
r.end[axis] = end + toAddCount;
|
|
80102
|
+
}
|
|
80103
|
+
}
|
|
80104
|
+
this.options.customMergeCell = merges.filter((m) => {
|
|
80105
|
+
const r = m?.range;
|
|
80106
|
+
if (!r?.start || !r?.end) {
|
|
80107
|
+
return false;
|
|
80108
|
+
}
|
|
80109
|
+
if (r.end.row < r.start.row || r.end.col < r.start.col) {
|
|
80110
|
+
return false;
|
|
80111
|
+
}
|
|
80112
|
+
return !(r.start.row === r.end.row && r.start.col === r.end.col);
|
|
80113
|
+
});
|
|
80114
|
+
this.internalProps.customMergeCell = getCustomMergeCellFunc(this.options.customMergeCell);
|
|
80115
|
+
}
|
|
79522
80116
|
const success = listTableAddRecords(records, recordIndex, this);
|
|
79523
80117
|
if (typeof recordIndex === 'number') {
|
|
79524
80118
|
adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, records);
|
|
79525
80119
|
}
|
|
79526
80120
|
this.internalProps.emptyTip?.resetVisible();
|
|
80121
|
+
if (success && Array.isArray(this.options.customMergeCell)) {
|
|
80122
|
+
this.internalProps.customMergeCell = getCustomMergeCellFunc(this.options.customMergeCell);
|
|
80123
|
+
this.options.customMergeCell.forEach(m => {
|
|
80124
|
+
const r = m?.range;
|
|
80125
|
+
if (!r?.start) {
|
|
80126
|
+
return;
|
|
80127
|
+
}
|
|
80128
|
+
for (let col = r.start.col; col <= r.end.col; col++) {
|
|
80129
|
+
for (let row = r.start.row; row <= r.end.row; row++) {
|
|
80130
|
+
this.scenegraph.updateCellContent(col, row);
|
|
80131
|
+
}
|
|
80132
|
+
}
|
|
80133
|
+
});
|
|
80134
|
+
this.scenegraph.updateNextFrame();
|
|
80135
|
+
}
|
|
79527
80136
|
if (triggerEvent && success) {
|
|
79528
80137
|
this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
|
|
79529
80138
|
records,
|
|
@@ -79533,6 +80142,15 @@
|
|
|
79533
80142
|
}
|
|
79534
80143
|
}
|
|
79535
80144
|
deleteRecords(recordIndexs, triggerEvent = true) {
|
|
80145
|
+
const prevMergeRanges = Array.isArray(this.options.customMergeCell)
|
|
80146
|
+
? this.options.customMergeCell
|
|
80147
|
+
.map(m => m?.range)
|
|
80148
|
+
.filter(Boolean)
|
|
80149
|
+
.map((r) => ({
|
|
80150
|
+
start: { ...r.start },
|
|
80151
|
+
end: { ...r.end }
|
|
80152
|
+
}))
|
|
80153
|
+
: [];
|
|
79536
80154
|
const deletedRecords = [];
|
|
79537
80155
|
if (recordIndexs?.length > 0) {
|
|
79538
80156
|
recordIndexs.forEach(index => {
|
|
@@ -79546,6 +80164,47 @@
|
|
|
79546
80164
|
deletedRecords.push(record);
|
|
79547
80165
|
});
|
|
79548
80166
|
}
|
|
80167
|
+
if (Array.isArray(this.options.customMergeCell) && recordIndexs?.length && typeof recordIndexs[0] === 'number') {
|
|
80168
|
+
const axis = this.transpose ? 'col' : 'row';
|
|
80169
|
+
const headerCount = this.transpose ? this.rowHeaderLevelCount : this.columnHeaderLevelCount;
|
|
80170
|
+
const topAggregationCount = this.internalProps.layoutMap.hasAggregationOnTopCount;
|
|
80171
|
+
const deleteIndexNums = recordIndexs
|
|
80172
|
+
.slice()
|
|
80173
|
+
.sort((a, b) => a - b)
|
|
80174
|
+
.map((index, i) => index + headerCount + topAggregationCount - i);
|
|
80175
|
+
const merges = this.options.customMergeCell;
|
|
80176
|
+
for (let i = 0; i < deleteIndexNums.length; i++) {
|
|
80177
|
+
const deleteIndex = deleteIndexNums[i];
|
|
80178
|
+
for (let j = 0; j < merges.length; j++) {
|
|
80179
|
+
const r = merges[j]?.range;
|
|
80180
|
+
if (!r?.start || !r?.end) {
|
|
80181
|
+
continue;
|
|
80182
|
+
}
|
|
80183
|
+
const start = r.start[axis];
|
|
80184
|
+
const end = r.end[axis];
|
|
80185
|
+
if (end < deleteIndex) {
|
|
80186
|
+
continue;
|
|
80187
|
+
}
|
|
80188
|
+
if (start > deleteIndex) {
|
|
80189
|
+
r.start[axis] = start - 1;
|
|
80190
|
+
r.end[axis] = end - 1;
|
|
80191
|
+
}
|
|
80192
|
+
else {
|
|
80193
|
+
r.end[axis] = end - 1;
|
|
80194
|
+
}
|
|
80195
|
+
}
|
|
80196
|
+
}
|
|
80197
|
+
this.options.customMergeCell = merges.filter((m) => {
|
|
80198
|
+
const r = m?.range;
|
|
80199
|
+
if (!r?.start || !r?.end) {
|
|
80200
|
+
return false;
|
|
80201
|
+
}
|
|
80202
|
+
if (r.end.row < r.start.row || r.end.col < r.start.col) {
|
|
80203
|
+
return false;
|
|
80204
|
+
}
|
|
80205
|
+
return !(r.start.row === r.end.row && r.start.col === r.end.col);
|
|
80206
|
+
});
|
|
80207
|
+
}
|
|
79549
80208
|
listTableDeleteRecords(recordIndexs, this);
|
|
79550
80209
|
adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs);
|
|
79551
80210
|
this.internalProps.emptyTip?.resetVisible();
|
|
@@ -79563,6 +80222,46 @@
|
|
|
79563
80222
|
: recordIndexs.length
|
|
79564
80223
|
});
|
|
79565
80224
|
}
|
|
80225
|
+
if (Array.isArray(this.options.customMergeCell)) {
|
|
80226
|
+
this.internalProps.customMergeCell = getCustomMergeCellFunc(this.options.customMergeCell);
|
|
80227
|
+
this.options.customMergeCell.forEach(m => {
|
|
80228
|
+
const r = m?.range;
|
|
80229
|
+
if (!r?.start) {
|
|
80230
|
+
return;
|
|
80231
|
+
}
|
|
80232
|
+
for (let col = r.start.col; col <= r.end.col; col++) {
|
|
80233
|
+
for (let row = r.start.row; row <= r.end.row; row++) {
|
|
80234
|
+
this.scenegraph.updateCellContent(col, row);
|
|
80235
|
+
}
|
|
80236
|
+
}
|
|
80237
|
+
});
|
|
80238
|
+
this.scenegraph.updateNextFrame();
|
|
80239
|
+
setTimeout(() => {
|
|
80240
|
+
if (!this.internalProps || !this.options || !this.scenegraph) {
|
|
80241
|
+
return;
|
|
80242
|
+
}
|
|
80243
|
+
if (Array.isArray(this.options.customMergeCell)) {
|
|
80244
|
+
this.internalProps.customMergeCell = getCustomMergeCellFunc(this.options.customMergeCell);
|
|
80245
|
+
}
|
|
80246
|
+
const refreshRanges = [
|
|
80247
|
+
...prevMergeRanges,
|
|
80248
|
+
...(Array.isArray(this.options.customMergeCell)
|
|
80249
|
+
? this.options.customMergeCell.map(m => m?.range)
|
|
80250
|
+
: [])
|
|
80251
|
+
].filter(Boolean);
|
|
80252
|
+
refreshRanges.forEach(r => {
|
|
80253
|
+
if (!r?.start) {
|
|
80254
|
+
return;
|
|
80255
|
+
}
|
|
80256
|
+
for (let col = r.start.col; col <= r.end.col; col++) {
|
|
80257
|
+
for (let row = r.start.row; row <= r.end.row; row++) {
|
|
80258
|
+
this.scenegraph.updateCellContent(col, row);
|
|
80259
|
+
}
|
|
80260
|
+
}
|
|
80261
|
+
});
|
|
80262
|
+
this.scenegraph.updateNextFrame();
|
|
80263
|
+
}, 0);
|
|
80264
|
+
}
|
|
79566
80265
|
}
|
|
79567
80266
|
updateRecords(records, recordIndexs, triggerEvent = true) {
|
|
79568
80267
|
listTableUpdateRecords(records, recordIndexs, this);
|
|
@@ -79719,6 +80418,7 @@
|
|
|
79719
80418
|
}
|
|
79720
80419
|
}
|
|
79721
80420
|
this.scenegraph.updateNextFrame();
|
|
80421
|
+
this.fireListeners(TABLE_EVENT_TYPE.MERGE_CELLS, { startCol, startRow, endCol, endRow });
|
|
79722
80422
|
}
|
|
79723
80423
|
unmergeCells(startCol, startRow, endCol, endRow) {
|
|
79724
80424
|
if (!this.options.customMergeCell) {
|
|
@@ -79738,6 +80438,7 @@
|
|
|
79738
80438
|
}
|
|
79739
80439
|
}
|
|
79740
80440
|
this.scenegraph.updateNextFrame();
|
|
80441
|
+
this.fireListeners(TABLE_EVENT_TYPE.UNMERGE_CELLS, { startCol, startRow, endCol, endRow });
|
|
79741
80442
|
}
|
|
79742
80443
|
}
|
|
79743
80444
|
|
|
@@ -83515,13 +84216,13 @@
|
|
|
83515
84216
|
const checkedStroke = getProp('checkedStroke', style, col, row, table);
|
|
83516
84217
|
const disableCheckedFill = getProp('disableCheckedFill', style, col, row, table);
|
|
83517
84218
|
const disableCheckedStroke = getProp('disableCheckedStroke', style, col, row, table);
|
|
83518
|
-
if (isNumber$
|
|
84219
|
+
if (isNumber$3(outerRadius)) {
|
|
83519
84220
|
size = outerRadius * 2;
|
|
83520
84221
|
}
|
|
83521
84222
|
else {
|
|
83522
84223
|
outerRadius = Math.round(size / 2);
|
|
83523
84224
|
}
|
|
83524
|
-
if (!isNumber$
|
|
84225
|
+
if (!isNumber$3(innerRadius) || innerRadius < 0) {
|
|
83525
84226
|
innerRadius = Math.round((outerRadius / 7) * 3);
|
|
83526
84227
|
}
|
|
83527
84228
|
const value = table.getCellValue(col, row);
|
|
@@ -84616,7 +85317,7 @@
|
|
|
84616
85317
|
let contentWidth = width;
|
|
84617
85318
|
let contentHeight = height;
|
|
84618
85319
|
let _contentOffset = 0;
|
|
84619
|
-
if (isNumber$
|
|
85320
|
+
if (isNumber$3(table.theme._contentOffset)) {
|
|
84620
85321
|
_contentOffset = table.theme._contentOffset;
|
|
84621
85322
|
}
|
|
84622
85323
|
const percentCompleteBarGroup = new Group$1({
|
|
@@ -85075,10 +85776,10 @@
|
|
|
85075
85776
|
max = domainMax + (domainMax - domainMin) * axisOption.expand.max;
|
|
85076
85777
|
}
|
|
85077
85778
|
}
|
|
85078
|
-
if (isNumber$
|
|
85779
|
+
if (isNumber$3(axisOption?.min)) {
|
|
85079
85780
|
min = axisOption.min;
|
|
85080
85781
|
}
|
|
85081
|
-
if (isNumber$
|
|
85782
|
+
if (isNumber$3(axisOption?.max)) {
|
|
85082
85783
|
max = axisOption.max;
|
|
85083
85784
|
}
|
|
85084
85785
|
let scale;
|
|
@@ -85126,7 +85827,7 @@
|
|
|
85126
85827
|
scaleTicks = scale.forceTicks(target?.targetTicks?.length ?? axisOption?.tick?.forceTickCount);
|
|
85127
85828
|
}
|
|
85128
85829
|
else {
|
|
85129
|
-
scaleTicks = scale.ticks(isNumber$
|
|
85830
|
+
scaleTicks = scale.ticks(isNumber$3(axisOption?.tick?.tickCount) ? axisOption.tick.tickCount : DEFAULT_CONTINUOUS_TICK_COUNT, {
|
|
85130
85831
|
noDecimals: axisOption?.tick?.noDecimals
|
|
85131
85832
|
});
|
|
85132
85833
|
}
|
|
@@ -89653,6 +90354,13 @@
|
|
|
89653
90354
|
}
|
|
89654
90355
|
}
|
|
89655
90356
|
}
|
|
90357
|
+
else if (typeof this.collectValuesBy[field]?.extendRange === 'number') {
|
|
90358
|
+
for (const byKeys in this.collectedValues[field]) {
|
|
90359
|
+
let max = this.collectedValues[field][byKeys].max;
|
|
90360
|
+
max = Math.max(max, this.collectValuesBy[field]?.extendRange);
|
|
90361
|
+
this.collectedValues[field][byKeys].max = max;
|
|
90362
|
+
}
|
|
90363
|
+
}
|
|
89656
90364
|
}
|
|
89657
90365
|
}
|
|
89658
90366
|
processCollectedValuesWithSortBy() {
|
|
@@ -92020,10 +92728,11 @@
|
|
|
92020
92728
|
}
|
|
92021
92729
|
this.dataset.updateSortRules(sortRules);
|
|
92022
92730
|
this._changePivotSortStateBySortRules();
|
|
92731
|
+
this._filterHideIndicatorNode();
|
|
92023
92732
|
const { layoutMap } = this.internalProps;
|
|
92024
92733
|
layoutMap.resetHeaderTree();
|
|
92025
92734
|
this.scenegraph.clearCells();
|
|
92026
|
-
if (isNumber$
|
|
92735
|
+
if (isNumber$3(col) && isNumber$3(row)) {
|
|
92027
92736
|
if (this.isRowHeader(col, row)) {
|
|
92028
92737
|
this.setMinMaxLimitWidth(true);
|
|
92029
92738
|
this.internalProps._widthResizedColMap.clear();
|
|
@@ -92086,6 +92795,15 @@
|
|
|
92086
92795
|
});
|
|
92087
92796
|
}
|
|
92088
92797
|
}
|
|
92798
|
+
_filterHideIndicatorNode() {
|
|
92799
|
+
const options = this.options;
|
|
92800
|
+
if (options.indicatorsAsCol !== false && options.indicators && this.dataset.colHeaderTree) {
|
|
92801
|
+
deleteHideIndicatorNode(this.dataset.colHeaderTree, options.indicators, false, this);
|
|
92802
|
+
}
|
|
92803
|
+
if (options.indicatorsAsCol === false && this.dataset.rowHeaderTree && options.indicators) {
|
|
92804
|
+
deleteHideIndicatorNode(this.dataset.rowHeaderTree, options.indicators, false, this);
|
|
92805
|
+
}
|
|
92806
|
+
}
|
|
92089
92807
|
updatePivotSortState(pivotSortStateConfig) {
|
|
92090
92808
|
this.pivotSortState = pivotSortStateConfig;
|
|
92091
92809
|
}
|
|
@@ -92829,6 +93547,7 @@
|
|
|
92829
93547
|
this.internalProps.dataConfig.filterRules = filterRules;
|
|
92830
93548
|
if (isResetTree) {
|
|
92831
93549
|
this.dataset.updateFilterRules(filterRules, true);
|
|
93550
|
+
this._filterHideIndicatorNode();
|
|
92832
93551
|
this.internalProps.layoutMap.resetHeaderTree();
|
|
92833
93552
|
}
|
|
92834
93553
|
else {
|
|
@@ -93850,7 +94569,7 @@
|
|
|
93850
94569
|
this.render();
|
|
93851
94570
|
}
|
|
93852
94571
|
clearChartCacheImage(col, row) {
|
|
93853
|
-
if (isNumber$
|
|
94572
|
+
if (isNumber$3(col) && isNumber$3(row)) {
|
|
93854
94573
|
clearCellChartCacheImage(col, row, this.scenegraph);
|
|
93855
94574
|
}
|
|
93856
94575
|
else {
|
|
@@ -94772,7 +95491,7 @@
|
|
|
94772
95491
|
}
|
|
94773
95492
|
|
|
94774
95493
|
registerForVrender();
|
|
94775
|
-
const version = "1.
|
|
95494
|
+
const version = "1.24.0";
|
|
94776
95495
|
function getIcons() {
|
|
94777
95496
|
return get$2();
|
|
94778
95497
|
}
|
|
@@ -94785,6 +95504,7 @@
|
|
|
94785
95504
|
exports.CustomLayout = index;
|
|
94786
95505
|
exports.DataStatistics = DataStatistics;
|
|
94787
95506
|
exports.EventTarget = EventTarget$1;
|
|
95507
|
+
exports.Group = Group$2;
|
|
94788
95508
|
exports.Icon = Icon$1;
|
|
94789
95509
|
exports.ListTable = ListTableAll;
|
|
94790
95510
|
exports.ListTableSimple = ListTableSimple;
|
|
@@ -94818,6 +95538,8 @@
|
|
|
94818
95538
|
exports.getTargetCell = getTargetCell;
|
|
94819
95539
|
exports.graphicUtil = graphicUtil;
|
|
94820
95540
|
exports.jsx = jsx;
|
|
95541
|
+
exports.mapToCanvasPointForCanvas = mapToCanvasPointForCanvas;
|
|
95542
|
+
exports.matrixAllocate = matrixAllocate;
|
|
94821
95543
|
exports.pluginsDefinition = index$1;
|
|
94822
95544
|
exports.register = register$1;
|
|
94823
95545
|
exports.registerAnimation = registerAnimation;
|
|
@@ -94826,6 +95548,7 @@
|
|
|
94826
95548
|
exports.registerChartCell = registerChartCell;
|
|
94827
95549
|
exports.registerCheckboxCell = registerCheckboxCell;
|
|
94828
95550
|
exports.registerEmptyTip = registerEmptyTip;
|
|
95551
|
+
exports.registerGlobalEventTransformer = registerGlobalEventTransformer;
|
|
94829
95552
|
exports.registerImageCell = registerImageCell;
|
|
94830
95553
|
exports.registerLegend = registerLegend;
|
|
94831
95554
|
exports.registerMenu = registerMenu;
|
|
@@ -94837,13 +95560,16 @@
|
|
|
94837
95560
|
exports.registerTitle = registerTitle;
|
|
94838
95561
|
exports.registerTooltip = registerTooltip;
|
|
94839
95562
|
exports.registerVideoCell = registerVideoCell;
|
|
95563
|
+
exports.registerWindowEventTransformer = registerWindowEventTransformer;
|
|
94840
95564
|
exports.renderChart = renderChart;
|
|
94841
95565
|
exports.restoreMeasureText = restoreMeasureText;
|
|
94842
95566
|
exports.setCustomAlphabetCharSet = setCustomAlphabetCharSet;
|
|
94843
95567
|
exports.textMeasure = textMeasure;
|
|
94844
95568
|
exports.themes = themes$1;
|
|
94845
95569
|
exports.toBoxArray = toBoxArray$1;
|
|
95570
|
+
exports.transformPointForCanvas = transformPointForCanvas;
|
|
94846
95571
|
exports.updateCell = updateCell$1;
|
|
94847
95572
|
exports.version = version;
|
|
95573
|
+
exports.vglobal = vglobal;
|
|
94848
95574
|
|
|
94849
95575
|
}));
|