e-virt-table 1.3.2 → 1.3.4
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/dist/index.cjs.js +3 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +223 -201
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +3 -3
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/Body.js +5 -2
- package/dist/lib/Body.js.map +1 -1
- package/dist/lib/Config.d.ts +2 -0
- package/dist/lib/Config.js +7 -0
- package/dist/lib/Config.js.map +1 -1
- package/dist/lib/Context.d.ts +1 -0
- package/dist/lib/Context.js +6 -0
- package/dist/lib/Context.js.map +1 -1
- package/dist/lib/Database.js +8 -4
- package/dist/lib/Database.js.map +1 -1
- package/dist/lib/EVirtTable.js +0 -1
- package/dist/lib/EVirtTable.js.map +1 -1
- package/dist/lib/Editor.js +2 -2
- package/dist/lib/Editor.js.map +1 -1
- package/dist/lib/EventTable.js +0 -2
- package/dist/lib/EventTable.js.map +1 -1
- package/dist/lib/Header.js +18 -18
- package/dist/lib/Header.js.map +1 -1
- package/dist/lib/types.d.ts +1 -0
- package/dist/lib/util.js +6 -0
- package/dist/lib/util.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -284,12 +284,16 @@ function ye(h, t) {
|
|
|
284
284
|
function at(h, t = /* @__PURE__ */ new WeakMap()) {
|
|
285
285
|
if (h === null || typeof h != "object") return h;
|
|
286
286
|
if (t.has(h)) return t.get(h);
|
|
287
|
+
if (h instanceof RegExp) {
|
|
288
|
+
const i = new RegExp(h.source, h.flags);
|
|
289
|
+
return i.lastIndex = h.lastIndex, i;
|
|
290
|
+
}
|
|
287
291
|
const e = Array.isArray(h) ? [] : {};
|
|
288
292
|
return t.set(h, e), Reflect.ownKeys(h).forEach((i) => {
|
|
289
293
|
e[i] = at(h[i], t);
|
|
290
294
|
}), e;
|
|
291
295
|
}
|
|
292
|
-
class
|
|
296
|
+
class Zt {
|
|
293
297
|
constructor(t, e, i, s, o, r, a) {
|
|
294
298
|
n(this, "ctx");
|
|
295
299
|
n(this, "x", 0);
|
|
@@ -335,7 +339,7 @@ class jt {
|
|
|
335
339
|
getRightFixedX() {
|
|
336
340
|
}
|
|
337
341
|
}
|
|
338
|
-
class It extends
|
|
342
|
+
class It extends Zt {
|
|
339
343
|
constructor(e, i, s, o, r, a, l, c, d, f = "body") {
|
|
340
344
|
super(e, o, r, a, l, f, c.fixed);
|
|
341
345
|
n(this, "formatter");
|
|
@@ -547,10 +551,10 @@ class It extends jt {
|
|
|
547
551
|
const v = this.ctx.icons.get("expand"), _ = this.ctx.icons.get("shrink");
|
|
548
552
|
o = c ? _ : v, a = c ? "shrink" : "expand";
|
|
549
553
|
}
|
|
550
|
-
let g = m, E = m,
|
|
551
|
-
(this.align === "center" || this.align === "right") && (
|
|
552
|
-
let
|
|
553
|
-
this.type === "selection-tree" ? (
|
|
554
|
+
let g = m, E = m, p = this.drawX;
|
|
555
|
+
(this.align === "center" || this.align === "right") && (p = this.drawX + (this.visibleWidth - g - 2 * e) / 2, this.align = "left");
|
|
556
|
+
let C = p + r + e, b = this.drawY + (this.visibleHeight - E) / 2, y = r + this.drawX + g - 0.5;
|
|
557
|
+
this.type === "selection-tree" ? (C = r + this.drawSelectionImageX + this.drawSelectionImageWidth, y = C + g - e / 2) : this.type === "tree-selection" ? y = C + w + g - e / 2 : y = C + g - e / 2, this.drawTextX = y, this.drawTextWidth = this.drawX + this.visibleWidth - y, !(C + g + e > this.drawX + this.visibleWidth) && (b + E + e > this.drawY + this.visibleHeight || (this.drawTreeImageX = C, this.drawTreeImageY = b, this.drawTreeImageWidth = g, this.drawTreeImageHeight = E, o ? (this.drawTreeImageName = a, this.drawTreeImageSource = o) : (this.drawTreeImageName = "", this.drawTreeImageSource = void 0)));
|
|
554
558
|
}
|
|
555
559
|
drawTreeLine() {
|
|
556
560
|
const { TREE_LINE: e, TREE_INDENT: i = 16, TREE_ICON_SIZE: s = 16, TREE_LINE_COLOR: o = "#e1e6eb" } = this.ctx.config;
|
|
@@ -628,13 +632,13 @@ class It extends jt {
|
|
|
628
632
|
return;
|
|
629
633
|
}
|
|
630
634
|
let g = "transparent";
|
|
631
|
-
const E = this.ctx.hoverCell,
|
|
632
|
-
let
|
|
635
|
+
const E = this.ctx.hoverCell, p = this.ctx.currentCell;
|
|
636
|
+
let C = this.rowIndex, b = this.rowIndex;
|
|
633
637
|
if (this.rowspan !== 1 && (x || d)) {
|
|
634
638
|
const _ = this.getSpanInfo(), { yArr: S } = _;
|
|
635
|
-
|
|
639
|
+
C = S[0], b = S[1];
|
|
636
640
|
}
|
|
637
|
-
x && E && (E.rowKey === this.rowKey && (g = u), E.rowIndex >=
|
|
641
|
+
x && E && (E.rowKey === this.rowKey && (g = u), E.rowIndex >= C && E.rowIndex <= b && (g = u)), d && p && (p.rowKey === this.rowKey && (g = f), p.rowIndex >= C && p.rowIndex <= b && (g = f)), this.drawCellSkyBgColor = g;
|
|
638
642
|
let y = e, v = a;
|
|
639
643
|
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (y = i, v = r), w && (this.rowIndex % 2 ? y = m : y = e), typeof s == "function") {
|
|
640
644
|
const _ = s, { backgroundColor: S, color: I, font: R } = _({
|
|
@@ -659,17 +663,17 @@ class It extends jt {
|
|
|
659
663
|
let w = u, m = this.drawY + (i - f) / 2;
|
|
660
664
|
if (a !== "selection-tree") {
|
|
661
665
|
if (a === "tree-selection") {
|
|
662
|
-
const { TREE_INDENT:
|
|
663
|
-
w = u +
|
|
666
|
+
const { TREE_INDENT: p = 16, TREE_ICON_SIZE: C } = this.ctx.config, b = this.ctx.database.getRowForRowKey(c), { level: y = 0 } = b || {}, v = y * p;
|
|
667
|
+
w = u + C + v;
|
|
664
668
|
}
|
|
665
669
|
}
|
|
666
670
|
let g = this.ctx.icons.get("checkbox-uncheck"), E = "checkbox-uncheck";
|
|
667
671
|
if (a === "selection-tree" || a === "tree-selection") {
|
|
668
|
-
const
|
|
669
|
-
|
|
672
|
+
const p = this.ctx.database.getTreeSelectionState(c);
|
|
673
|
+
p.indeterminate && d ? (g = this.ctx.icons.get("checkbox-indeterminate"), E = "checkbox-indeterminate") : p.checked && d ? (g = this.ctx.icons.get("checkbox-check"), E = "checkbox-check") : !p.checked && d ? (g = this.ctx.icons.get("checkbox-uncheck"), E = "checkbox-uncheck") : (g = this.ctx.icons.get("checkbox-disabled"), E = "checkbox-disabled");
|
|
670
674
|
} else {
|
|
671
|
-
const
|
|
672
|
-
|
|
675
|
+
const p = this.ctx.database.getRowSelection(c);
|
|
676
|
+
p && d ? (g = this.ctx.icons.get("checkbox-check"), E = "checkbox-check") : p && !d ? (g = this.ctx.icons.get("checkbox-check-disabled"), E = "checkbox-check-disabled") : !p && d ? (g = this.ctx.icons.get("checkbox-uncheck"), E = "checkbox-uncheck") : (g = this.ctx.icons.get("checkbox-disabled"), E = "checkbox-disabled");
|
|
673
677
|
}
|
|
674
678
|
w + f + x > this.drawX + this.visibleWidth || m + f + x > this.drawY + this.visibleHeight || (a === "index-selection" ? (this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === l || ["checkbox-disabled", "checkbox-check"].includes(E)) && (this.drawSelectionImageX = w, this.drawSelectionImageY = m, this.drawSelectionImageWidth = f, this.drawSelectionImageHeight = f, this.drawSelectionImageName = E, this.drawSelectionImageSource = g) : (this.drawSelectionImageX = w, this.drawSelectionImageY = m, this.drawSelectionImageWidth = f, this.drawSelectionImageHeight = f, this.drawSelectionImageName = E, this.drawSelectionImageSource = g));
|
|
675
679
|
}
|
|
@@ -693,8 +697,8 @@ class It extends jt {
|
|
|
693
697
|
if (a.rowKey === this.rowKey && (l = this.drawX + this.width - s - o, c = this.drawY + (this.height - s) / 2), this.rowspan !== 1 && r) {
|
|
694
698
|
const f = this.getSpanInfo(), { yArr: x } = f, u = x[0], w = x[1];
|
|
695
699
|
if (a.rowIndex >= u && a.rowIndex <= w) {
|
|
696
|
-
const { width: m, height: g, offsetTop: E, offsetLeft:
|
|
697
|
-
l = this.drawX -
|
|
700
|
+
const { width: m, height: g, offsetTop: E, offsetLeft: p } = f;
|
|
701
|
+
l = this.drawX - p + m - s - o, c = this.drawY - E + (g - s) / 2;
|
|
698
702
|
}
|
|
699
703
|
}
|
|
700
704
|
const d = this.ctx.icons.get(this.hoverIconName);
|
|
@@ -967,9 +971,9 @@ class It extends jt {
|
|
|
967
971
|
drawBorder(e) {
|
|
968
972
|
const { drawX: i, drawY: s, rowIndex: o, colIndex: r, height: a, width: l } = this;
|
|
969
973
|
let c = i, d = s;
|
|
970
|
-
const { xArr: f, yArr: x, lineDash: u = [], borderWidth: w = 1, borderColor: m, fillColor: g } = e, E = f[0],
|
|
971
|
-
if (r >= E && r <=
|
|
972
|
-
const y = r ===
|
|
974
|
+
const { xArr: f, yArr: x, lineDash: u = [], borderWidth: w = 1, borderColor: m, fillColor: g } = e, E = f[0], p = f[1], C = x[0], b = x[1];
|
|
975
|
+
if (r >= E && r <= p && o === C) {
|
|
976
|
+
const y = r === p ? 1 : 0, v = r === E ? 1 : 0;
|
|
973
977
|
this.ctx.paint.drawLine([c + v, d + 1, c + l - y, d + 1], {
|
|
974
978
|
borderColor: m,
|
|
975
979
|
fillColor: g,
|
|
@@ -979,8 +983,8 @@ class It extends jt {
|
|
|
979
983
|
lineDash: u
|
|
980
984
|
});
|
|
981
985
|
}
|
|
982
|
-
if (r ===
|
|
983
|
-
const y = o ===
|
|
986
|
+
if (r === p && o >= C && o <= b) {
|
|
987
|
+
const y = o === C ? 1 : 0, v = o === b ? 1 : 0;
|
|
984
988
|
this.ctx.paint.drawLine([c + l - 1, d + y, c + l - 1, d + a - v], {
|
|
985
989
|
borderColor: m,
|
|
986
990
|
fillColor: g,
|
|
@@ -990,8 +994,8 @@ class It extends jt {
|
|
|
990
994
|
lineDash: u
|
|
991
995
|
});
|
|
992
996
|
}
|
|
993
|
-
if (r >= E && r <=
|
|
994
|
-
const y = r ===
|
|
997
|
+
if (r >= E && r <= p && o === b) {
|
|
998
|
+
const y = r === p ? 1 : 0, v = r === E ? 1 : 0;
|
|
995
999
|
this.ctx.paint.drawLine([c + v, d + a - 1, c + l - y, d + a - 1], {
|
|
996
1000
|
borderColor: m,
|
|
997
1001
|
fillColor: g,
|
|
@@ -1001,8 +1005,8 @@ class It extends jt {
|
|
|
1001
1005
|
lineDash: u
|
|
1002
1006
|
});
|
|
1003
1007
|
}
|
|
1004
|
-
if (r === E && o >=
|
|
1005
|
-
const y = o === b ? 1 : 0, v = o ===
|
|
1008
|
+
if (r === E && o >= C && o <= b) {
|
|
1009
|
+
const y = o === b ? 1 : 0, v = o === C ? 1 : 0;
|
|
1006
1010
|
this.ctx.paint.drawLine([c + 1, d + v, c + 1, d + a - y], {
|
|
1007
1011
|
borderColor: m,
|
|
1008
1012
|
fillColor: g,
|
|
@@ -1081,23 +1085,23 @@ class be {
|
|
|
1081
1085
|
initData(t, e = 0, i = []) {
|
|
1082
1086
|
const s = t.length;
|
|
1083
1087
|
t.forEach((o, r) => {
|
|
1084
|
-
var
|
|
1088
|
+
var p;
|
|
1085
1089
|
const { ROW_KEY: a = "", DEFAULT_EXPAND_ALL: l, CELL_HEIGHT: c, SELECTABLE_METHOD: d, CHECKBOX_KEY: f } = this.ctx.config, x = o[a], u = x != null ? `${x}` : $t();
|
|
1086
1090
|
this.itemRowKeyMap.set(o, u);
|
|
1087
1091
|
const w = o._height || c, m = o._readonly;
|
|
1088
1092
|
let g = !0;
|
|
1089
1093
|
if (typeof d == "function" && (g = d), f) {
|
|
1090
|
-
const
|
|
1091
|
-
if (this.checkboxKeyMap.has(
|
|
1092
|
-
const b = this.checkboxKeyMap.get(
|
|
1093
|
-
b.push(u), this.checkboxKeyMap.set(
|
|
1094
|
+
const C = o[f];
|
|
1095
|
+
if (this.checkboxKeyMap.has(C)) {
|
|
1096
|
+
const b = this.checkboxKeyMap.get(C) || [];
|
|
1097
|
+
b.push(u), this.checkboxKeyMap.set(C, b);
|
|
1094
1098
|
} else
|
|
1095
|
-
this.checkboxKeyMap.set(
|
|
1099
|
+
this.checkboxKeyMap.set(C, [u]);
|
|
1096
1100
|
}
|
|
1097
1101
|
this.selectionMap.set(u, {
|
|
1098
1102
|
key: f ? o[f] : u,
|
|
1099
1103
|
row: o,
|
|
1100
|
-
check: ((
|
|
1104
|
+
check: ((p = this.selectionMap.get(u)) == null ? void 0 : p.check) || !1
|
|
1101
1105
|
});
|
|
1102
1106
|
const E = l || this.expandMap.get(u) || o._expand || !1;
|
|
1103
1107
|
this.expandMap.set(u, E), this.rowKeyMap.set(u, {
|
|
@@ -1416,50 +1420,58 @@ class be {
|
|
|
1416
1420
|
async batchSetItemValue(t, e = !1, i = !0, s = "none") {
|
|
1417
1421
|
let o = [], r = i;
|
|
1418
1422
|
const a = /* @__PURE__ */ new Set();
|
|
1419
|
-
let l = [], c = t.map((
|
|
1420
|
-
const { rowKey:
|
|
1421
|
-
let
|
|
1422
|
-
const C = this.getRowDataItemForRowKey(
|
|
1423
|
-
return (
|
|
1424
|
-
...
|
|
1425
|
-
value:
|
|
1426
|
-
oldValue:
|
|
1423
|
+
let l = [], c = t.map((w) => {
|
|
1424
|
+
const { rowKey: m, key: g } = w;
|
|
1425
|
+
let E = w.value, p = E;
|
|
1426
|
+
const C = this.getRowDataItemForRowKey(m), b = this.getItemValue(m, g), y = this.getVirtualBodyCellByKey(m, g);
|
|
1427
|
+
return (y == null ? void 0 : y.type) === "number" && (["", void 0, null].includes(E) ? p = null : /^-?\d+(\.\d+)?$/.test(`${E}`) ? p = Number(E) : (p = b, l.push({
|
|
1428
|
+
...w,
|
|
1429
|
+
value: p,
|
|
1430
|
+
oldValue: b,
|
|
1427
1431
|
row: C
|
|
1428
1432
|
}))), {
|
|
1429
|
-
...
|
|
1430
|
-
value:
|
|
1431
|
-
oldValue:
|
|
1433
|
+
...w,
|
|
1434
|
+
value: p,
|
|
1435
|
+
oldValue: b,
|
|
1432
1436
|
row: C
|
|
1433
1437
|
};
|
|
1434
1438
|
});
|
|
1435
|
-
if (c = c.filter((
|
|
1436
|
-
const
|
|
1439
|
+
if (c = c.filter((w) => !l.some((m) => w.rowKey === m.rowKey && w.key === m.key)), l.length) {
|
|
1440
|
+
const w = {
|
|
1437
1441
|
code: "ERR_BATCH_SET_NUMBER_VALUE",
|
|
1438
1442
|
message: "Assignment failed, not a numeric type",
|
|
1439
1443
|
data: l
|
|
1440
1444
|
};
|
|
1441
|
-
this.ctx.emit("error",
|
|
1445
|
+
this.ctx.emit("error", w);
|
|
1442
1446
|
}
|
|
1443
|
-
if (c = c.filter((
|
|
1447
|
+
if (c = c.filter((w) => w.oldValue !== w.value), !c.length)
|
|
1444
1448
|
return;
|
|
1445
1449
|
const { BEFORE_VALUE_CHANGE_METHOD: d } = this.ctx.config;
|
|
1446
|
-
s === "none" && typeof d == "function" && (c = await d(c), r = !1), c.forEach((
|
|
1447
|
-
const { value:
|
|
1448
|
-
a.add(
|
|
1449
|
-
rowKey:
|
|
1450
|
-
key:
|
|
1451
|
-
oldValue:
|
|
1452
|
-
newValue:
|
|
1450
|
+
s === "none" && typeof d == "function" && (c = await d(c), r = !1), c.forEach((w) => {
|
|
1451
|
+
const { value: m, rowKey: g, key: E } = w, p = this.getItemValue(g, E);
|
|
1452
|
+
a.add(g), this.setItemValue(g, E, m, !1, !1, !1, r), o.push({
|
|
1453
|
+
rowKey: g,
|
|
1454
|
+
key: E,
|
|
1455
|
+
oldValue: p,
|
|
1456
|
+
newValue: m
|
|
1453
1457
|
});
|
|
1454
1458
|
});
|
|
1455
1459
|
let f = [];
|
|
1456
|
-
a.forEach((
|
|
1457
|
-
f.push(this.ctx.database.getRowDataItemForRowKey(
|
|
1460
|
+
a.forEach((w) => {
|
|
1461
|
+
f.push(this.ctx.database.getRowDataItemForRowKey(w));
|
|
1458
1462
|
});
|
|
1459
|
-
const x = c.map(({ rowKey:
|
|
1463
|
+
const x = c.map(({ rowKey: w, key: m }) => this.getValidator(w, m));
|
|
1460
1464
|
Promise.all(x).then(() => {
|
|
1461
1465
|
this.validationErrorMap.size === 0 && this.changedDataMap.size > 0 && this.ctx.emit("validateChangedData", this.getChangedData());
|
|
1462
|
-
})
|
|
1466
|
+
});
|
|
1467
|
+
const u = c.map((w) => {
|
|
1468
|
+
const m = !!this.getValidationError(w.rowKey, w.key).length;
|
|
1469
|
+
return {
|
|
1470
|
+
...w,
|
|
1471
|
+
errorTip: m
|
|
1472
|
+
};
|
|
1473
|
+
});
|
|
1474
|
+
this.ctx.emit("change", u, f), e && this.ctx.history.pushState({
|
|
1463
1475
|
changeList: o,
|
|
1464
1476
|
scrollX: this.ctx.scrollX,
|
|
1465
1477
|
scrollY: this.ctx.scrollY,
|
|
@@ -1664,19 +1676,19 @@ class be {
|
|
|
1664
1676
|
if (this.ctx.config.TREE_SELECT_MODE === "auto") {
|
|
1665
1677
|
const c = (g) => {
|
|
1666
1678
|
const E = this.getTreeChildren(g);
|
|
1667
|
-
let
|
|
1668
|
-
for (const
|
|
1669
|
-
|
|
1670
|
-
return
|
|
1679
|
+
let p = [];
|
|
1680
|
+
for (const C of E)
|
|
1681
|
+
p.push(C), p.push(...c(C));
|
|
1682
|
+
return p;
|
|
1671
1683
|
}, f = c(t).map((g) => this.selectionMap.get(g)), x = f.filter((g) => g == null ? void 0 : g.check).length, u = f.length, w = x > 0;
|
|
1672
1684
|
r = w && !(x === u), a = s || w, s && u > 0 && x === 0 && (a = !1, r = !1);
|
|
1673
1685
|
} else if (this.ctx.config.TREE_SELECT_MODE === "cautious") {
|
|
1674
1686
|
const c = (g) => {
|
|
1675
1687
|
const E = this.getTreeChildren(g);
|
|
1676
|
-
let
|
|
1677
|
-
for (const
|
|
1678
|
-
|
|
1679
|
-
return
|
|
1688
|
+
let p = [];
|
|
1689
|
+
for (const C of E)
|
|
1690
|
+
p.push(C), p.push(...c(C));
|
|
1691
|
+
return p;
|
|
1680
1692
|
}, f = c(t).map((g) => this.selectionMap.get(g)), x = f.filter((g) => g == null ? void 0 : g.check).length, u = f.length, w = x > 0, m = x === u;
|
|
1681
1693
|
r = w && !m, a = s || m, s && u > 0 && x === 0 && (a = !1, r = !1);
|
|
1682
1694
|
} else this.ctx.config.TREE_SELECT_MODE === "strictly" && (r = !1, a = s);
|
|
@@ -1987,7 +1999,7 @@ class be {
|
|
|
1987
1999
|
}
|
|
1988
2000
|
]
|
|
1989
2001
|
};
|
|
1990
|
-
let g = e, E = e,
|
|
2002
|
+
let g = e, E = e, p = a, C = a, b = [], y = 0, v = 0, _ = 0, S = 0;
|
|
1991
2003
|
if (d !== 1 && w) {
|
|
1992
2004
|
S = x;
|
|
1993
2005
|
const I = l.reduce((R, T) => {
|
|
@@ -2038,7 +2050,7 @@ class be {
|
|
|
2038
2050
|
break;
|
|
2039
2051
|
const T = this.getItemValue(s, i), O = this.getItemValue(s, R.key);
|
|
2040
2052
|
if (T === O && c.includes(R.key))
|
|
2041
|
-
|
|
2053
|
+
p = I;
|
|
2042
2054
|
else
|
|
2043
2055
|
break;
|
|
2044
2056
|
}
|
|
@@ -2048,17 +2060,17 @@ class be {
|
|
|
2048
2060
|
break;
|
|
2049
2061
|
const T = this.getItemValue(s, i), O = this.getItemValue(s, R.key);
|
|
2050
2062
|
if (T === O && c.includes(R.key))
|
|
2051
|
-
|
|
2063
|
+
C = I;
|
|
2052
2064
|
else
|
|
2053
2065
|
break;
|
|
2054
2066
|
}
|
|
2055
|
-
for (let I =
|
|
2067
|
+
for (let I = p; I < a; I++) {
|
|
2056
2068
|
const R = this.getColumnByColIndex(I);
|
|
2057
2069
|
if (!R)
|
|
2058
2070
|
break;
|
|
2059
2071
|
v += R.width || 100;
|
|
2060
2072
|
}
|
|
2061
|
-
for (let I =
|
|
2073
|
+
for (let I = p; I <= C; I++) {
|
|
2062
2074
|
const R = this.getColumnByColIndex(I);
|
|
2063
2075
|
if (!R)
|
|
2064
2076
|
break;
|
|
@@ -2071,7 +2083,7 @@ class be {
|
|
|
2071
2083
|
}
|
|
2072
2084
|
}
|
|
2073
2085
|
return {
|
|
2074
|
-
xArr: [
|
|
2086
|
+
xArr: [p, C],
|
|
2075
2087
|
yArr: [g, E],
|
|
2076
2088
|
rowspan: d,
|
|
2077
2089
|
colspan: u,
|
|
@@ -2171,7 +2183,7 @@ class be {
|
|
|
2171
2183
|
}
|
|
2172
2184
|
}
|
|
2173
2185
|
resetCustomHeader() {
|
|
2174
|
-
this.customHeader = {}, this.columns = this.originalColumns, this.
|
|
2186
|
+
this.customHeader = {}, this.columns = this.originalColumns, this.ctx.emit("resetHeader"), this.ctx.emit("customHeaderChange", this.customHeader);
|
|
2175
2187
|
}
|
|
2176
2188
|
getCustomHeader() {
|
|
2177
2189
|
return this.customHeader;
|
|
@@ -2188,7 +2200,7 @@ class be {
|
|
|
2188
2200
|
i[s] = e;
|
|
2189
2201
|
}), this.setCustomHeader({
|
|
2190
2202
|
hideData: i
|
|
2191
|
-
}), this.
|
|
2203
|
+
}), this.ctx.emit("resetHeader");
|
|
2192
2204
|
}
|
|
2193
2205
|
setCustomHeaderFixedData(t, e) {
|
|
2194
2206
|
let { fixedData: i = {} } = this.customHeader;
|
|
@@ -2196,7 +2208,7 @@ class be {
|
|
|
2196
2208
|
i[s] = e;
|
|
2197
2209
|
}), this.setCustomHeader({
|
|
2198
2210
|
fixedData: i
|
|
2199
|
-
}), this.
|
|
2211
|
+
}), this.ctx.emit("resetHeader");
|
|
2200
2212
|
}
|
|
2201
2213
|
setOriginalColumns(t) {
|
|
2202
2214
|
this.originalColumns = t;
|
|
@@ -2504,10 +2516,10 @@ class _e {
|
|
|
2504
2516
|
} = r;
|
|
2505
2517
|
if (this.ctx.font = a, this.ctx.fillStyle = c, this.ctx.textAlign = l, ["", null, void 0].includes(t))
|
|
2506
2518
|
return this.ctx.restore(), !1;
|
|
2507
|
-
const E = parseInt(((R = a.match(/\d+/)) == null ? void 0 : R[0]) || "12") * (r.lineHeight || 1.2),
|
|
2508
|
-
let
|
|
2519
|
+
const E = parseInt(((R = a.match(/\d+/)) == null ? void 0 : R[0]) || "12") * (r.lineHeight || 1.2), p = s - d * 2 - w - m;
|
|
2520
|
+
let C = !1;
|
|
2509
2521
|
const b = Math.round((o - 2 * d) / E);
|
|
2510
|
-
let y = this.wrapText(t,
|
|
2522
|
+
let y = this.wrapText(t, p, r.cacheTextKey), v = Math.min(y.length, Math.max(b, 1));
|
|
2511
2523
|
x === "auto" && u ? v = y.length : typeof x == "number" && x < v && x !== 1 ? v = x : (x === 1 && (y = [t], v = 1), x === "auto" && b === 1 && (y = [t], v = 1));
|
|
2512
2524
|
let _ = i + d;
|
|
2513
2525
|
const S = Math.round(v * E);
|
|
@@ -2518,7 +2530,7 @@ class _e {
|
|
|
2518
2530
|
const O = y[T], M = _ + T * E;
|
|
2519
2531
|
if (this.ctx.textBaseline = "top", T === v - 1) {
|
|
2520
2532
|
const A = y.slice(T).join(""), { _text: D, ellipsis: H } = this.handleEllipsis(A, s, d, a);
|
|
2521
|
-
this.ctx.fillText(D, I, M),
|
|
2533
|
+
this.ctx.fillText(D, I, M), C = H;
|
|
2522
2534
|
break;
|
|
2523
2535
|
}
|
|
2524
2536
|
this.ctx.fillText(O, I, M);
|
|
@@ -2539,7 +2551,7 @@ class _e {
|
|
|
2539
2551
|
};
|
|
2540
2552
|
r.textCallback(A);
|
|
2541
2553
|
}
|
|
2542
|
-
return this.ctx.restore(),
|
|
2554
|
+
return this.ctx.restore(), C;
|
|
2543
2555
|
}
|
|
2544
2556
|
/**
|
|
2545
2557
|
* 将文本按宽度换行
|
|
@@ -2855,6 +2867,8 @@ class Nt {
|
|
|
2855
2867
|
n(this, "RESIZE_ROW_LINE_COLOR", "#e1e6eb");
|
|
2856
2868
|
/** 列调整线颜色 */
|
|
2857
2869
|
n(this, "RESIZE_COLUMN_LINE_COLOR", "#e1e6eb");
|
|
2870
|
+
/** 启用列调整文本 */
|
|
2871
|
+
n(this, "ENABLE_RESIZE_COLUMN_TEXT", !0);
|
|
2858
2872
|
/** 列调整线颜色 */
|
|
2859
2873
|
n(this, "RESIZE_COLUMN_TEXT_COLOR", "#fff");
|
|
2860
2874
|
/** 列调整线文本背景色 */
|
|
@@ -2972,7 +2986,7 @@ class Nt {
|
|
|
2972
2986
|
}), Object.assign(this, t, this._config);
|
|
2973
2987
|
}
|
|
2974
2988
|
}
|
|
2975
|
-
const
|
|
2989
|
+
const jt = '<svg t="1724122015492" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4237" width="32" height="32"><path d="M401.472 316.992l159.04 217.664L591.488 512l-30.976-22.656-159.04 217.728q-2.24 3.008-3.84 6.464-1.6 3.456-2.496 7.104-0.896 3.648-1.024 7.424-0.192 3.84 0.384 7.552 0.64 3.712 1.92 7.296 1.28 3.52 3.2 6.784 1.984 3.2 4.544 6.016 2.56 2.752 5.632 4.992 3.072 2.24 6.464 3.84 3.456 1.6 7.168 2.496 3.648 0.896 7.424 1.024 3.776 0.192 7.488-0.448 3.776-0.576 7.296-1.856 3.584-1.28 6.784-3.264 3.2-1.92 6.016-4.48 2.816-2.56 5.056-5.632l159.04-217.728q3.584-4.928 5.504-10.752 1.92-5.76 1.92-11.904 0-6.08-1.92-11.904-1.92-5.76-5.504-10.752L463.488 271.68q-2.24-3.072-5.056-5.632-2.752-2.56-6.016-4.48-3.2-1.984-6.784-3.328-3.52-1.28-7.296-1.856-3.712-0.576-7.488-0.448-3.84 0.192-7.424 1.088-3.712 0.896-7.168 2.496-3.392 1.6-6.4 3.84-3.136 2.176-5.696 4.992-2.56 2.752-4.48 6.016-1.984 3.2-3.264 6.784-1.28 3.52-1.92 7.296-0.576 3.712-0.384 7.488 0.128 3.84 1.024 7.488 0.896 3.648 2.496 7.04 1.6 3.456 3.84 6.528z m30.976-61.056q-3.776 0-7.488 0.704-3.712 0.768-7.168 2.24-3.52 1.408-6.656 3.52-3.2 2.112-5.824 4.8-2.688 2.624-4.8 5.76-2.112 3.2-3.52 6.656-1.472 3.52-2.176 7.232-0.768 3.712-0.768 7.488 0 3.776 0.768 7.488 0.704 3.712 2.176 7.232 1.408 3.456 3.52 6.592 2.112 3.2 4.8 5.824 2.688 2.688 5.76 4.8 3.2 2.112 6.72 3.52 3.456 1.472 7.168 2.176 3.712 0.768 7.488 0.768 3.84 0 7.488-0.768 3.712-0.704 7.232-2.176 3.456-1.408 6.592-3.52 3.2-2.112 5.824-4.8 2.688-2.688 4.8-5.76 2.112-3.2 3.52-6.656 1.472-3.52 2.24-7.232 0.704-3.712 0.704-7.488 0-3.84-0.704-7.488-0.768-3.712-2.24-7.232-1.408-3.456-3.52-6.592-2.112-3.2-4.8-5.824-2.624-2.688-5.76-4.8-3.2-2.112-6.656-3.52-3.52-1.472-7.232-2.24Q436.224 256 432.448 256z m0 435.392q-3.776 0-7.488 0.704-3.712 0.768-7.168 2.176-3.52 1.472-6.656 3.584-3.2 2.112-5.824 4.736-2.688 2.688-4.8 5.824-2.112 3.2-3.52 6.656-1.472 3.52-2.176 7.232-0.768 3.712-0.768 7.488 0 3.776 0.768 7.488 0.704 3.712 2.176 7.168 1.408 3.52 3.52 6.656 2.112 3.2 4.8 5.76 2.688 2.752 5.76 4.8 3.2 2.112 6.72 3.584 3.456 1.472 7.168 2.176 3.712 0.768 7.488 0.768 3.84 0 7.488-0.768 3.712-0.704 7.232-2.176 3.456-1.472 6.592-3.584 3.2-2.048 5.824-4.736 2.688-2.688 4.8-5.824 2.112-3.2 3.52-6.656 1.472-3.456 2.24-7.168 0.704-3.712 0.704-7.488 0-3.84-0.704-7.488-0.768-3.712-2.24-7.232-1.408-3.52-3.52-6.656-2.112-3.136-4.8-5.76-2.624-2.688-5.76-4.8-3.2-2.112-6.656-3.584-3.52-1.408-7.232-2.176-3.712-0.704-7.488-0.704z" p-id="4238"></path></svg>', kt = '<svg t="1722595535853" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4551" width="32" height="32"><path d="M640 128H384c-170.496 0-256 85.504-256 256v256c0 170.496 85.504 256 256 256h256c170.496 0 256-85.504 256-256V384c0-170.496-85.504-256-256-256z m67.584 302.592c-2.048 4.608-4.608 8.704-8.192 12.288L506.88 634.88c-3.584 3.584-7.68 6.144-12.288 8.192-4.608 2.048-9.728 3.072-14.848 3.072s-10.24-1.024-14.848-3.072c-4.608-2.048-8.704-4.608-12.288-8.192l-96.256-96.256c-3.584-3.584-6.144-7.68-8.192-12.288-2.048-4.608-3.072-9.728-3.072-14.848 0-2.56 0-5.12 1.024-7.68 0.512-2.56 1.024-5.12 2.048-7.168 1.024-2.56 2.048-4.608 3.584-6.656 1.536-2.048 3.072-4.096 4.608-5.632 1.536-2.048 3.584-3.584 5.632-4.608 2.048-1.536 4.096-2.56 6.656-3.584 2.56-1.024 4.608-1.536 7.168-2.048 2.56-0.512 5.12-0.512 7.68-0.512 5.12 0 10.24 1.024 14.848 3.072 4.608 2.048 8.704 4.608 12.288 8.192l69.12 68.608L645.12 389.12c3.584-3.584 7.68-6.144 12.288-8.192 4.608-2.048 9.728-3.072 14.848-3.072 2.56 0 5.12 0 7.68 0.512s5.12 1.024 7.168 2.048c2.56 1.024 4.608 2.048 6.656 3.584 2.048 1.536 4.096 3.072 5.632 4.608 1.536 1.536 3.584 3.584 4.608 5.632 1.536 2.048 2.56 4.096 3.584 6.656 1.024 2.56 1.536 4.608 2.048 7.168 0.512 2.56 1.024 5.12 1.024 7.68 0 5.12-1.024 10.24-3.072 14.848z" p-id="4552"></path></svg>', Xt = '<svg t="1724122044148" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4551" width="32" height="32"><path d="M707.648 401.28L489.28 560.704l22.656 30.976 22.656-30.976L316.16 401.216q-3.072-2.24-6.464-3.84-3.456-1.536-7.104-2.432-3.712-0.896-7.488-1.088-3.776-0.128-7.488 0.448-3.776 0.64-7.296 1.92-3.584 1.28-6.784 3.2-3.2 1.984-6.016 4.544-2.816 2.56-5.056 5.632-2.176 3.072-3.84 6.464-1.536 3.456-2.432 7.104-0.896 3.712-1.088 7.488-0.128 3.776 0.448 7.488 0.64 3.776 1.92 7.296 1.28 3.584 3.2 6.784 1.984 3.2 4.544 6.016 2.56 2.752 5.632 4.992l218.368 159.552q4.928 3.584 10.752 5.504 5.76 1.92 11.904 1.92 6.08 0 11.904-1.92 5.76-1.92 10.752-5.504l218.368-159.552q3.008-2.24 5.568-4.992 2.56-2.816 4.544-6.016 1.92-3.2 3.264-6.784 1.28-3.52 1.92-7.296 0.576-3.712 0.384-7.488-0.128-3.84-1.024-7.488-0.896-3.648-2.496-7.04-1.6-3.456-3.84-6.528-2.24-3.072-4.992-5.632-2.816-2.56-6.016-4.48-3.2-1.984-6.784-3.328-3.584-1.28-7.296-1.856-3.712-0.64-7.488-0.448-3.84 0.192-7.488 1.088-3.648 0.896-7.04 2.496-3.456 1.536-6.528 3.84z m61.056 30.976q0-3.84-0.768-7.488-0.704-3.712-2.176-7.232-1.472-3.456-3.52-6.656-2.112-3.136-4.8-5.76-2.688-2.688-5.76-4.8-3.2-2.112-6.72-3.584-3.456-1.408-7.168-2.176-3.712-0.704-7.488-0.704-3.84 0-7.488 0.704-3.712 0.768-7.232 2.176-3.456 1.472-6.656 3.584-3.136 2.112-5.76 4.8-2.688 2.624-4.8 5.76-2.112 3.2-3.584 6.656-1.408 3.52-2.176 7.232-0.704 3.712-0.704 7.488 0 3.776 0.704 7.488 0.768 3.712 2.176 7.168 1.472 3.52 3.584 6.656 2.112 3.2 4.8 5.824 2.624 2.688 5.76 4.8 3.2 2.112 6.656 3.52 3.52 1.472 7.232 2.176 3.712 0.768 7.488 0.768 3.776 0 7.488-0.768 3.712-0.704 7.168-2.176 3.52-1.408 6.656-3.52 3.2-2.112 5.824-4.8 2.688-2.688 4.8-5.76 2.048-3.2 3.52-6.72 1.472-3.456 2.176-7.168 0.768-3.712 0.768-7.488z m-436.736 0q0-3.84-0.768-7.488-0.704-3.712-2.176-7.232-1.408-3.456-3.52-6.656-2.112-3.136-4.8-5.76-2.688-2.688-5.76-4.8-3.2-2.112-6.656-3.584-3.52-1.408-7.232-2.176-3.712-0.704-7.488-0.704-3.84 0-7.488 0.704-3.712 0.768-7.232 2.176-3.456 1.472-6.592 3.584-3.2 2.112-5.824 4.8-2.688 2.624-4.8 5.76-2.112 3.2-3.52 6.656-1.472 3.52-2.24 7.232-0.704 3.712-0.704 7.488 0 3.776 0.704 7.488 0.768 3.712 2.24 7.168 1.408 3.52 3.52 6.656 2.112 3.2 4.8 5.824 2.624 2.688 5.76 4.8 3.2 2.112 6.656 3.52 3.52 1.472 7.232 2.176 3.712 0.768 7.488 0.768 3.776 0 7.488-0.768 3.712-0.704 7.232-2.176 3.456-1.408 6.592-3.52 3.2-2.112 5.824-4.8 2.688-2.688 4.8-5.76 2.112-3.2 3.52-6.72 1.472-3.456 2.176-7.168 0.768-3.712 0.768-7.488z" p-id="4552"></path></svg>', Rt = '<svg t="1755138507987" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5079" width="200" height="200"><path d="M512 938.688a42.688 42.688 0 0 1-35.072-18.432l-192-277.312A42.56 42.56 0 0 1 320 576h384a42.752 42.752 0 0 1 35.072 66.944l-192 277.312a42.688 42.688 0 0 1-35.072 18.432" fill="currentColor" p-id="2016"></path><path d="M704 448H320a42.752 42.752 0 0 1-35.072-66.944l192-277.312c16-23.04 54.208-23.04 70.144 0l192 277.312A42.56 42.56 0 0 1 704 448" fill="currentColor" p-id="2015"></path></svg>', Se = Rt.replace('fill="currentColor" p-id="2016"', 'fill="#bec4c7" p-id="2016"'), Te = Rt.replace('fill="currentColor" p-id="2015"', 'fill="#bec4c7" p-id="2015"');
|
|
2976
2990
|
class Oe {
|
|
2977
2991
|
constructor(t) {
|
|
2978
2992
|
n(this, "ctx");
|
|
@@ -2988,7 +3002,7 @@ class Oe {
|
|
|
2988
3002
|
name: "expand",
|
|
2989
3003
|
configName: "EXPAND_ICON_SVG",
|
|
2990
3004
|
configColorName: "EXPAND_ICON_COLOR",
|
|
2991
|
-
svg:
|
|
3005
|
+
svg: jt,
|
|
2992
3006
|
color: "#4E5969"
|
|
2993
3007
|
},
|
|
2994
3008
|
{
|
|
@@ -3126,7 +3140,7 @@ class Oe {
|
|
|
3126
3140
|
return this.list.find((e) => e.name === t);
|
|
3127
3141
|
}
|
|
3128
3142
|
}
|
|
3129
|
-
class Et extends
|
|
3143
|
+
class Et extends Zt {
|
|
3130
3144
|
constructor(e, i, s, o, r, a, l) {
|
|
3131
3145
|
super(e, s, o, r, a, "header", l.fixed);
|
|
3132
3146
|
n(this, "align");
|
|
@@ -3356,9 +3370,9 @@ class Le {
|
|
|
3356
3370
|
return;
|
|
3357
3371
|
const { offsetY: e, offsetX: i } = this.ctx.getOffset(t), s = e, o = i;
|
|
3358
3372
|
this.handleHeaderEvent(o, s, this.ctx.header.renderCellHeaders, (r) => {
|
|
3359
|
-
this.ctx.focusCellHeader = r, this.ctx.focusCell = void 0, this.ctx.emit("cellHeaderMousedown", r, t)
|
|
3373
|
+
this.ctx.focusCellHeader = r, this.ctx.focusCell = void 0, this.ctx.emit("cellHeaderMousedown", r, t);
|
|
3360
3374
|
}), this.handleBodyEvent(o, s, this.ctx.body.renderRows, (r) => {
|
|
3361
|
-
this.ctx.setFocusCell(r), this.ctx.focusCellHeader = void 0, this.ctx.emit("cellMousedown", r, t)
|
|
3375
|
+
this.ctx.setFocusCell(r), this.ctx.focusCellHeader = void 0, this.ctx.emit("cellMousedown", r, t);
|
|
3362
3376
|
});
|
|
3363
3377
|
}), this.ctx.on("mouseup", (t) => {
|
|
3364
3378
|
if (t.button !== 0 || this.isBusy(t))
|
|
@@ -3661,6 +3675,8 @@ class Me {
|
|
|
3661
3675
|
n(this, "isMouseoverTargetContainer", !1);
|
|
3662
3676
|
n(this, "mousedown", !1);
|
|
3663
3677
|
n(this, "isPointer", !1);
|
|
3678
|
+
n(this, "isEmpty", !1);
|
|
3679
|
+
// 是否空数据
|
|
3664
3680
|
n(this, "rowResizing", !1);
|
|
3665
3681
|
// 行调整大小中
|
|
3666
3682
|
n(this, "columnResizing", !1);
|
|
@@ -4321,7 +4337,7 @@ class De {
|
|
|
4321
4337
|
}), o = this.dragTarget.colIndex > this.dragingCell.colIndex ? "before" : "after";
|
|
4322
4338
|
s.treeMove(this.dragTarget.column, this.dragingCell.column, o);
|
|
4323
4339
|
const r = s.getTree(), a = t(r);
|
|
4324
|
-
this.ctx.database.setCustomHeader({ sortData: a }), this.
|
|
4340
|
+
this.ctx.database.setCustomHeader({ sortData: a }), this.init();
|
|
4325
4341
|
const l = {
|
|
4326
4342
|
source: this.dragTarget,
|
|
4327
4343
|
target: this.dragingCell,
|
|
@@ -4379,7 +4395,7 @@ class De {
|
|
|
4379
4395
|
width: o,
|
|
4380
4396
|
column: t.column,
|
|
4381
4397
|
columns: this.columns
|
|
4382
|
-
}), this.ctx.database.setCustomHeaderResizableData(t.key, o), this.
|
|
4398
|
+
}), this.ctx.database.setCustomHeaderResizableData(t.key, o), this.init(), this.ctx.emit("draw");
|
|
4383
4399
|
}
|
|
4384
4400
|
resizeAllColumn(t) {
|
|
4385
4401
|
if (t === 0) return;
|
|
@@ -4427,22 +4443,28 @@ class De {
|
|
|
4427
4443
|
if (this.isResizing && this.resizeTarget) {
|
|
4428
4444
|
const {
|
|
4429
4445
|
stageHeight: t,
|
|
4430
|
-
config: {
|
|
4431
|
-
|
|
4432
|
-
|
|
4446
|
+
config: {
|
|
4447
|
+
RESIZE_COLUMN_LINE_COLOR: e,
|
|
4448
|
+
RESIZE_COLUMN_TEXT_COLOR: i,
|
|
4449
|
+
RESIZE_COLUMN_TEXT_BG_COLOR: s,
|
|
4450
|
+
ENABLE_RESIZE_COLUMN_TEXT: o
|
|
4451
|
+
}
|
|
4452
|
+
} = this.ctx, r = this.resizeTarget.getDrawX(), a = this.resizeTarget.width, l = r + a + this.resizeDiff - 0.5, c = [l - 0.5, 0, l - 0.5, t];
|
|
4453
|
+
if (this.ctx.paint.drawLine(c, {
|
|
4433
4454
|
borderColor: e
|
|
4434
|
-
})
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4455
|
+
}), o) {
|
|
4456
|
+
const f = `${Math.floor(a + this.resizeDiff)}px`, x = 45, u = 24;
|
|
4457
|
+
this.ctx.paint.drawRect(l + x / 2, this.ctx.mouseY - u / 2, x, u, {
|
|
4458
|
+
fillColor: s,
|
|
4459
|
+
borderWidth: 0,
|
|
4460
|
+
borderColor: "transparent"
|
|
4461
|
+
}), this.ctx.paint.drawText(f, l + x / 2, this.ctx.mouseY - u / 2, x, u + 2, {
|
|
4462
|
+
padding: 0,
|
|
4463
|
+
color: i,
|
|
4464
|
+
align: "center",
|
|
4465
|
+
verticalAlign: "middle"
|
|
4466
|
+
});
|
|
4467
|
+
}
|
|
4446
4468
|
}
|
|
4447
4469
|
}
|
|
4448
4470
|
drawDragTip() {
|
|
@@ -4643,13 +4665,13 @@ class Ne {
|
|
|
4643
4665
|
const { data: u, sumHeight: w } = s.getData();
|
|
4644
4666
|
this.height = w, this.data = u, this.width = e.width, this.visibleWidth = this.ctx.stageWidth - r;
|
|
4645
4667
|
const m = this.ctx.footer.height;
|
|
4646
|
-
!this.data.length && !a ? this.height = l : !this.data.length && a && (this.height = a - e.height - m - r);
|
|
4668
|
+
this.ctx.isEmpty = !this.data.length, !this.data.length && !a ? this.height = l : !this.data.length && a && (this.height = a - e.height - m - r);
|
|
4647
4669
|
let g = this.height + e.height + r;
|
|
4648
4670
|
g += m;
|
|
4649
4671
|
let E = g;
|
|
4650
|
-
const
|
|
4651
|
-
if (
|
|
4652
|
-
const O =
|
|
4672
|
+
const p = window.innerHeight, { top: C } = this.containerRect || this.ctx.containerElement.getBoundingClientRect();
|
|
4673
|
+
if (p > C && d && !a) {
|
|
4674
|
+
const O = p - C - f;
|
|
4653
4675
|
O > e.height + r ? E = O : g > c && (E = c);
|
|
4654
4676
|
} else this.data.length && a ? E = a : this.data.length && c && g > c && (E = c);
|
|
4655
4677
|
E > 0 && (this.ctx.stageHeight = Math.floor(E), this.ctx.stageElement.style.height = `${this.ctx.stageHeight}px`);
|
|
@@ -4748,13 +4770,13 @@ class Ne {
|
|
|
4748
4770
|
stageWidth: o,
|
|
4749
4771
|
config: { HEADER_BG_COLOR: r, SCROLLER_TRACK_SIZE: a }
|
|
4750
4772
|
} = this.ctx;
|
|
4751
|
-
if (i > 0 && t !== 0 && this.ctx.paint.drawShadow(this.x, this.y, t, this.height, {
|
|
4773
|
+
if (i > 0 && t !== 0 && !this.ctx.isEmpty && this.ctx.paint.drawShadow(this.x, this.y, t, this.height, {
|
|
4752
4774
|
fillColor: r,
|
|
4753
4775
|
side: "right",
|
|
4754
4776
|
shadowWidth: 4,
|
|
4755
4777
|
colorStart: "rgba(0,0,0,0.1)",
|
|
4756
4778
|
colorEnd: "rgba(0,0,0,0)"
|
|
4757
|
-
}), i < Math.floor(s.width - o - 1) && e !== a) {
|
|
4779
|
+
}), i < Math.floor(s.width - o - 1) && e !== a && !this.ctx.isEmpty) {
|
|
4758
4780
|
const l = s.width - (this.x + this.width) + o - e;
|
|
4759
4781
|
this.ctx.paint.drawShadow(l, this.y, e, this.height, {
|
|
4760
4782
|
fillColor: r,
|
|
@@ -5023,14 +5045,14 @@ class Xe {
|
|
|
5023
5045
|
SELECTOR_AREA_MAX_X_OFFSET: f,
|
|
5024
5046
|
SELECTOR_AREA_MAX_Y_OFFSET: x
|
|
5025
5047
|
} = this.ctx.config, u = a, w = l || this.ctx.maxColIndex - f, m = c, g = d || this.ctx.maxRowIndex - x;
|
|
5026
|
-
let [E,
|
|
5027
|
-
if (E < u ||
|
|
5048
|
+
let [E, p] = o, [C, b] = r;
|
|
5049
|
+
if (E < u || p > w || C < m || b > g)
|
|
5028
5050
|
return;
|
|
5029
5051
|
if (this.ctx.stageElement.focus({ preventScroll: !0 }), this.ctx.config.ENABLE_MERGE_CELL_LINK) {
|
|
5030
5052
|
const v = this.adjustMergeCells(o, r);
|
|
5031
|
-
|
|
5053
|
+
C = v.yArr[0], b = v.yArr[1], E = v.xArr[0], p = v.xArr[1], this.ctx.onlyMergeCell = v.onlyMergeCell;
|
|
5032
5054
|
}
|
|
5033
|
-
E ===
|
|
5055
|
+
E === p && C === b ? this.ctx.selectOnlyOne = !0 : this.ctx.selectOnlyOne = !1, o = [Math.max(u, E), Math.min(w, p)], r = [Math.max(m, C), Math.min(g, b)];
|
|
5034
5056
|
const { BEFORE_SET_SELECTOR_METHOD: y } = this.ctx.config;
|
|
5035
5057
|
if (typeof y == "function") {
|
|
5036
5058
|
const _ = y({
|
|
@@ -5042,7 +5064,7 @@ class Xe {
|
|
|
5042
5064
|
return;
|
|
5043
5065
|
o = _.xArr, r = _.yArr;
|
|
5044
5066
|
}
|
|
5045
|
-
this.ctx.selector.xArr = o, this.ctx.selector.yArr = r, b === this.ctx.maxRowIndex &&
|
|
5067
|
+
this.ctx.selector.xArr = o, this.ctx.selector.yArr = r, b === this.ctx.maxRowIndex && C === 0 ? this.ctx.selectColsIng = !0 : this.ctx.selectColsIng = !1, p === this.ctx.maxColIndex && E === 0 ? this.ctx.selectRowsIng = !0 : this.ctx.selectRowsIng = !1, this.ctx.emit("setSelector", this.ctx.selector), this.ctx.emit("drawView");
|
|
5046
5068
|
}
|
|
5047
5069
|
}
|
|
5048
5070
|
adjustMergeCells(t, e) {
|
|
@@ -5057,13 +5079,13 @@ class Xe {
|
|
|
5057
5079
|
let a = [], l = [];
|
|
5058
5080
|
for (let m = 0; m <= e[1] - e[0]; m++)
|
|
5059
5081
|
for (let g = 0; g <= t[1] - t[0]; g++) {
|
|
5060
|
-
const E = m + e[0],
|
|
5061
|
-
|
|
5082
|
+
const E = m + e[0], p = g + t[0], C = this.ctx.database.getVirtualBodyCell(E, p);
|
|
5083
|
+
C && ((E === i || E === s) && a.push(C), (p === o || p === r) && l.push(C));
|
|
5062
5084
|
}
|
|
5063
5085
|
const c = a.reduce(
|
|
5064
5086
|
(m, g) => {
|
|
5065
|
-
const { yArr: E } = g.getSpanInfo(), [
|
|
5066
|
-
return m.minY = Math.min(m.minY,
|
|
5087
|
+
const { yArr: E } = g.getSpanInfo(), [p, C] = E;
|
|
5088
|
+
return m.minY = Math.min(m.minY, p), m.maxY = Math.max(m.maxY, C), m;
|
|
5067
5089
|
},
|
|
5068
5090
|
{
|
|
5069
5091
|
minY: i,
|
|
@@ -5071,8 +5093,8 @@ class Xe {
|
|
|
5071
5093
|
}
|
|
5072
5094
|
), d = l.reduce(
|
|
5073
5095
|
(m, g) => {
|
|
5074
|
-
const { xArr: E } = g.getSpanInfo(), [
|
|
5075
|
-
return m.minX = Math.min(m.minX,
|
|
5096
|
+
const { xArr: E } = g.getSpanInfo(), [p, C] = E;
|
|
5097
|
+
return m.minX = Math.min(m.minX, p), m.maxX = Math.max(m.maxX, C), m;
|
|
5076
5098
|
},
|
|
5077
5099
|
{
|
|
5078
5100
|
minX: o,
|
|
@@ -5267,18 +5289,18 @@ class Xe {
|
|
|
5267
5289
|
});
|
|
5268
5290
|
const m = r.length === 1 && r[0].length === 1;
|
|
5269
5291
|
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(a, l) && !m) {
|
|
5270
|
-
const
|
|
5292
|
+
const C = {
|
|
5271
5293
|
code: "ERR_MERGED_CELLS_PASTE",
|
|
5272
5294
|
message: "Merged cells cannot span paste data"
|
|
5273
5295
|
};
|
|
5274
|
-
this.ctx.hasEvent("error") ? this.ctx.emit("error",
|
|
5296
|
+
this.ctx.hasEvent("error") ? this.ctx.emit("error", C) : alert(C.message);
|
|
5275
5297
|
return;
|
|
5276
5298
|
}
|
|
5277
5299
|
let g = [];
|
|
5278
|
-
for (let
|
|
5279
|
-
const b = r[
|
|
5300
|
+
for (let C = 0; C <= r.length - 1; C++) {
|
|
5301
|
+
const b = r[C].length;
|
|
5280
5302
|
for (let y = 0; y <= b - 1; y++) {
|
|
5281
|
-
const v =
|
|
5303
|
+
const v = C + e, _ = y + i, S = r[C][y], I = this.ctx.database.getItemValueForRowIndexAndColIndex(
|
|
5282
5304
|
v,
|
|
5283
5305
|
_
|
|
5284
5306
|
);
|
|
@@ -5295,13 +5317,13 @@ class Xe {
|
|
|
5295
5317
|
}
|
|
5296
5318
|
}
|
|
5297
5319
|
if (this.isCut) {
|
|
5298
|
-
const
|
|
5320
|
+
const C = this.clearSelectedData(
|
|
5299
5321
|
this.ctx.selector.xArrCopy,
|
|
5300
5322
|
this.ctx.selector.yArrCopy,
|
|
5301
5323
|
!0
|
|
5302
5324
|
// 忽略设置,只返回数据,用于cut,实现历史回退需要返回两次问题
|
|
5303
5325
|
), b = g.map((y) => `${y.rowKey}-${y.key}`);
|
|
5304
|
-
|
|
5326
|
+
C.forEach((y) => {
|
|
5305
5327
|
b.includes(`${y.rowKey}-${y.key}`) || g.unshift(y);
|
|
5306
5328
|
}), this.isCut = !1;
|
|
5307
5329
|
}
|
|
@@ -5309,21 +5331,21 @@ class Xe {
|
|
|
5309
5331
|
return;
|
|
5310
5332
|
const { BEFORE_PASTE_DATA_METHOD: E } = this.ctx.config;
|
|
5311
5333
|
if (typeof E == "function") {
|
|
5312
|
-
const
|
|
5334
|
+
const C = E, b = g.map((y) => ({
|
|
5313
5335
|
rowKey: y.rowKey,
|
|
5314
5336
|
key: y.key,
|
|
5315
5337
|
value: y.value,
|
|
5316
5338
|
oldValue: this.ctx.database.getItemValue(y.rowKey, y.key),
|
|
5317
5339
|
row: this.ctx.database.getRowDataItemForRowKey(y.rowKey)
|
|
5318
5340
|
}));
|
|
5319
|
-
if (g = await
|
|
5341
|
+
if (g = await C(b, a, l, r), g && !g.length)
|
|
5320
5342
|
return;
|
|
5321
5343
|
}
|
|
5322
5344
|
this.clearCopyLine(), this.ctx.batchSetItemValueByEditor(g, !0);
|
|
5323
|
-
let
|
|
5324
|
-
s.forEach((
|
|
5325
|
-
|
|
5326
|
-
}), this.ctx.emit("pasteChange", g,
|
|
5345
|
+
let p = [];
|
|
5346
|
+
s.forEach((C) => {
|
|
5347
|
+
p.push(this.ctx.database.getRowDataItemForRowKey(C));
|
|
5348
|
+
}), this.ctx.emit("pasteChange", g, p), this.ctx.emit("draw");
|
|
5327
5349
|
}).catch((o) => {
|
|
5328
5350
|
console.error("Failed to get the clipboard content:", o);
|
|
5329
5351
|
});
|
|
@@ -5389,14 +5411,14 @@ class Xe {
|
|
|
5389
5411
|
if (!i)
|
|
5390
5412
|
return;
|
|
5391
5413
|
w && this.ctx.onlyMergeCell && i.updateSpanInfo();
|
|
5392
|
-
const { drawX: m, drawY: g, width: E, height:
|
|
5393
|
-
let v = r.height - g, _ =
|
|
5414
|
+
const { drawX: m, drawY: g, width: E, height: p, fixed: C } = i, b = o - m + 1, y = i.drawX + E - (e - s) + 1;
|
|
5415
|
+
let v = r.height - g, _ = p;
|
|
5394
5416
|
_ > l.visibleHeight && (_ = l.visibleHeight);
|
|
5395
5417
|
let S = 0;
|
|
5396
5418
|
x && (u === "top" ? v = r.height + a.height - g : S = a.visibleHeight);
|
|
5397
5419
|
const I = g + _ - (t - S - f);
|
|
5398
5420
|
let R = c, T = d;
|
|
5399
|
-
y > 0 && !
|
|
5421
|
+
y > 0 && !C ? R = Math.floor(c + y) : b > 0 && !C && (R = Math.floor(c - b)), v > 0 ? T = Math.floor(d - v) : I > 0 && (T = Math.floor(d + I)), (Math.abs(c - R) > 2 || Math.abs(d - T) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.setScroll(R, T), this.ctx.emit("adjustBoundaryPosition", i));
|
|
5400
5422
|
}
|
|
5401
5423
|
destroy() {
|
|
5402
5424
|
}
|
|
@@ -5460,10 +5482,10 @@ class Be {
|
|
|
5460
5482
|
SELECTOR_AREA_MAX_X_OFFSET: x,
|
|
5461
5483
|
SELECTOR_AREA_MAX_Y_OFFSET: u
|
|
5462
5484
|
} = this.ctx.config, w = l, m = c || this.ctx.maxColIndex - x, g = d, E = f || this.ctx.maxRowIndex - u;
|
|
5463
|
-
let [
|
|
5464
|
-
if (
|
|
5485
|
+
let [p, C] = r, [b, y] = a;
|
|
5486
|
+
if (p < w || b < g)
|
|
5465
5487
|
return;
|
|
5466
|
-
r = [Math.max(w,
|
|
5488
|
+
r = [Math.max(w, p), Math.min(m, C)], a = [Math.max(g, b), Math.min(E, y)];
|
|
5467
5489
|
const { BEFORE_SET_AUTOFILL_METHOD: v } = this.ctx.config;
|
|
5468
5490
|
if (typeof v == "function") {
|
|
5469
5491
|
const S = v({
|
|
@@ -5500,9 +5522,9 @@ class Be {
|
|
|
5500
5522
|
let d = [];
|
|
5501
5523
|
for (let u = 0; u <= l[1] - l[0]; u++)
|
|
5502
5524
|
for (let w = 0; w <= a[1] - a[0]; w++) {
|
|
5503
|
-
const m = w + a[0], g = u + l[0], E = s[u % r][w % o],
|
|
5504
|
-
if (
|
|
5505
|
-
const { rowKey: b, key: y } =
|
|
5525
|
+
const m = w + a[0], g = u + l[0], E = s[u % r][w % o], p = this.ctx.database.getItemValueForRowIndexAndColIndex(g, m), C = `${g}-${m}`;
|
|
5526
|
+
if (p && !i.has(C)) {
|
|
5527
|
+
const { rowKey: b, key: y } = p;
|
|
5506
5528
|
this.ctx.database.getReadonly(b, y) || (t.add(b), d.push({
|
|
5507
5529
|
rowKey: b,
|
|
5508
5530
|
key: y,
|
|
@@ -5718,8 +5740,8 @@ const qe = async (h, t, e) => {
|
|
|
5718
5740
|
name: g,
|
|
5719
5741
|
fn: E
|
|
5720
5742
|
} = a[m], {
|
|
5721
|
-
x:
|
|
5722
|
-
y:
|
|
5743
|
+
x: p,
|
|
5744
|
+
y: C,
|
|
5723
5745
|
data: b,
|
|
5724
5746
|
reset: y
|
|
5725
5747
|
} = await E({
|
|
@@ -5736,7 +5758,7 @@ const qe = async (h, t, e) => {
|
|
|
5736
5758
|
floating: t
|
|
5737
5759
|
}
|
|
5738
5760
|
});
|
|
5739
|
-
d =
|
|
5761
|
+
d = p ?? d, f = C ?? f, u = {
|
|
5740
5762
|
...u,
|
|
5741
5763
|
[g]: {
|
|
5742
5764
|
...u[g],
|
|
@@ -5780,12 +5802,12 @@ async function ee(h, t) {
|
|
|
5780
5802
|
boundary: c,
|
|
5781
5803
|
rootBoundary: d,
|
|
5782
5804
|
strategy: l
|
|
5783
|
-
})),
|
|
5805
|
+
})), p = f === "floating" ? {
|
|
5784
5806
|
x: i,
|
|
5785
5807
|
y: s,
|
|
5786
5808
|
width: r.floating.width,
|
|
5787
5809
|
height: r.floating.height
|
|
5788
|
-
} : r.reference,
|
|
5810
|
+
} : r.reference, C = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(a.floating)), b = await (o.isElement == null ? void 0 : o.isElement(C)) ? await (o.getScale == null ? void 0 : o.getScale(C)) || {
|
|
5789
5811
|
x: 1,
|
|
5790
5812
|
y: 1
|
|
5791
5813
|
} : {
|
|
@@ -5793,10 +5815,10 @@ async function ee(h, t) {
|
|
|
5793
5815
|
y: 1
|
|
5794
5816
|
}, y = ht(o.convertOffsetParentRelativeRectToViewportRelativeRect ? await o.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
5795
5817
|
elements: a,
|
|
5796
|
-
rect:
|
|
5797
|
-
offsetParent:
|
|
5818
|
+
rect: p,
|
|
5819
|
+
offsetParent: C,
|
|
5798
5820
|
strategy: l
|
|
5799
|
-
}) :
|
|
5821
|
+
}) : p);
|
|
5800
5822
|
return {
|
|
5801
5823
|
top: (E.top - y.top + w.top) / b.y,
|
|
5802
5824
|
bottom: (y.bottom - E.bottom + w.bottom) / b.y,
|
|
@@ -5804,7 +5826,7 @@ async function ee(h, t) {
|
|
|
5804
5826
|
right: (y.right - E.right + w.right) / b.x
|
|
5805
5827
|
};
|
|
5806
5828
|
}
|
|
5807
|
-
const
|
|
5829
|
+
const Ze = (h) => ({
|
|
5808
5830
|
name: "arrow",
|
|
5809
5831
|
options: h,
|
|
5810
5832
|
async fn(t) {
|
|
@@ -5825,10 +5847,10 @@ const je = (h) => ({
|
|
|
5825
5847
|
const f = te(d), x = {
|
|
5826
5848
|
x: e,
|
|
5827
5849
|
y: i
|
|
5828
|
-
}, u = _t(s), w = vt(u), m = await r.getDimensions(c), g = u === "y", E = g ? "top" : "left",
|
|
5829
|
-
let _ = v ? v[
|
|
5830
|
-
(!_ || !await (r.isElement == null ? void 0 : r.isElement(v))) && (_ = a.floating[
|
|
5831
|
-
const S = b / 2 - y / 2, I = _ / 2 - m[w] / 2 - 1, R = q(f[E], I), T = q(f[
|
|
5850
|
+
}, u = _t(s), w = vt(u), m = await r.getDimensions(c), g = u === "y", E = g ? "top" : "left", p = g ? "bottom" : "right", C = g ? "clientHeight" : "clientWidth", b = o.reference[w] + o.reference[u] - x[u] - o.floating[w], y = x[u] - o.reference[u], v = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(c));
|
|
5851
|
+
let _ = v ? v[C] : 0;
|
|
5852
|
+
(!_ || !await (r.isElement == null ? void 0 : r.isElement(v))) && (_ = a.floating[C] || o.floating[w]);
|
|
5853
|
+
const S = b / 2 - y / 2, I = _ / 2 - m[w] / 2 - 1, R = q(f[E], I), T = q(f[p], I), O = R, M = _ - m[w] - T, L = _ / 2 - m[w] / 2 + S, A = pt(O, L, M), D = !l.arrow && it(s) != null && L !== A && o.reference[w] / 2 - (L < O ? R : T) - m[w] / 2 < 0, H = D ? L < O ? L - O : L - M : 0;
|
|
5832
5854
|
return {
|
|
5833
5855
|
[u]: x[u] + H,
|
|
5834
5856
|
data: {
|
|
@@ -5841,7 +5863,7 @@ const je = (h) => ({
|
|
|
5841
5863
|
reset: D
|
|
5842
5864
|
};
|
|
5843
5865
|
}
|
|
5844
|
-
}),
|
|
5866
|
+
}), je = function(h) {
|
|
5845
5867
|
return h === void 0 && (h = {}), {
|
|
5846
5868
|
name: "flip",
|
|
5847
5869
|
options: h,
|
|
@@ -5865,7 +5887,7 @@ const je = (h) => ({
|
|
|
5865
5887
|
} = et(h, t);
|
|
5866
5888
|
if ((e = o.arrow) != null && e.alignmentOffset)
|
|
5867
5889
|
return {};
|
|
5868
|
-
const E = $(s),
|
|
5890
|
+
const E = $(s), p = V(a), C = $(a) === a, b = await (l.isRTL == null ? void 0 : l.isRTL(c.floating)), y = x || (C || !m ? [ct(a)] : Ve(a)), v = w !== "none";
|
|
5869
5891
|
!x && v && y.push(...Ge(a, m, w, b));
|
|
5870
5892
|
const _ = [a, ...y], S = await ee(t, g), I = [];
|
|
5871
5893
|
let R = ((i = o.flip) == null ? void 0 : i.overflows) || [];
|
|
@@ -5879,9 +5901,9 @@ const je = (h) => ({
|
|
|
5879
5901
|
}], !I.every((L) => L <= 0)) {
|
|
5880
5902
|
var T, O;
|
|
5881
5903
|
const L = (((T = o.flip) == null ? void 0 : T.index) || 0) + 1, A = _[L];
|
|
5882
|
-
if (A && (!(f === "alignment" ?
|
|
5904
|
+
if (A && (!(f === "alignment" ? p !== V(A) : !1) || // We leave the current main axis only if every placement on that axis
|
|
5883
5905
|
// overflows the main axis.
|
|
5884
|
-
R.every((k) => V(k.placement) ===
|
|
5906
|
+
R.every((k) => V(k.placement) === p ? k.overflows[0] > 0 : !0)))
|
|
5885
5907
|
return {
|
|
5886
5908
|
data: {
|
|
5887
5909
|
index: L,
|
|
@@ -5899,7 +5921,7 @@ const je = (h) => ({
|
|
|
5899
5921
|
const H = (M = R.filter((k) => {
|
|
5900
5922
|
if (v) {
|
|
5901
5923
|
const W = V(k.placement);
|
|
5902
|
-
return W ===
|
|
5924
|
+
return W === p || // Create a bias to the `y` side axis due to horizontal
|
|
5903
5925
|
// reading directions favoring greater width.
|
|
5904
5926
|
W === "y";
|
|
5905
5927
|
}
|
|
@@ -5988,11 +6010,11 @@ const ti = function(h) {
|
|
|
5988
6010
|
fn: (g) => {
|
|
5989
6011
|
let {
|
|
5990
6012
|
x: E,
|
|
5991
|
-
y:
|
|
6013
|
+
y: p
|
|
5992
6014
|
} = g;
|
|
5993
6015
|
return {
|
|
5994
6016
|
x: E,
|
|
5995
|
-
y:
|
|
6017
|
+
y: p
|
|
5996
6018
|
};
|
|
5997
6019
|
}
|
|
5998
6020
|
},
|
|
@@ -6003,12 +6025,12 @@ const ti = function(h) {
|
|
|
6003
6025
|
}, d = await ee(t, l), f = V($(s)), x = Qt(f);
|
|
6004
6026
|
let u = c[x], w = c[f];
|
|
6005
6027
|
if (o) {
|
|
6006
|
-
const g = x === "y" ? "top" : "left", E = x === "y" ? "bottom" : "right",
|
|
6007
|
-
u = pt(
|
|
6028
|
+
const g = x === "y" ? "top" : "left", E = x === "y" ? "bottom" : "right", p = u + d[g], C = u - d[E];
|
|
6029
|
+
u = pt(p, u, C);
|
|
6008
6030
|
}
|
|
6009
6031
|
if (r) {
|
|
6010
|
-
const g = f === "y" ? "top" : "left", E = f === "y" ? "bottom" : "right",
|
|
6011
|
-
w = pt(
|
|
6032
|
+
const g = f === "y" ? "top" : "left", E = f === "y" ? "bottom" : "right", p = w + d[g], C = w - d[E];
|
|
6033
|
+
w = pt(p, w, C);
|
|
6012
6034
|
}
|
|
6013
6035
|
const m = a.fn({
|
|
6014
6036
|
...t,
|
|
@@ -6032,7 +6054,7 @@ const ti = function(h) {
|
|
|
6032
6054
|
function xt() {
|
|
6033
6055
|
return typeof window < "u";
|
|
6034
6056
|
}
|
|
6035
|
-
function
|
|
6057
|
+
function j(h) {
|
|
6036
6058
|
return ie(h) ? (h.nodeName || "").toLowerCase() : "#document";
|
|
6037
6059
|
}
|
|
6038
6060
|
function N(h) {
|
|
@@ -6067,7 +6089,7 @@ function st(h) {
|
|
|
6067
6089
|
}
|
|
6068
6090
|
const si = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
6069
6091
|
function oi(h) {
|
|
6070
|
-
return si.has(
|
|
6092
|
+
return si.has(j(h));
|
|
6071
6093
|
}
|
|
6072
6094
|
const ri = [":popover-open", ":modal"];
|
|
6073
6095
|
function gt(h) {
|
|
@@ -6086,7 +6108,7 @@ function St(h) {
|
|
|
6086
6108
|
}
|
|
6087
6109
|
function ci(h) {
|
|
6088
6110
|
let t = P(h);
|
|
6089
|
-
for (; K(t) && !
|
|
6111
|
+
for (; K(t) && !Z(t); ) {
|
|
6090
6112
|
if (St(t))
|
|
6091
6113
|
return t;
|
|
6092
6114
|
if (gt(t))
|
|
@@ -6099,8 +6121,8 @@ function Tt() {
|
|
|
6099
6121
|
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
6100
6122
|
}
|
|
6101
6123
|
const hi = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
6102
|
-
function
|
|
6103
|
-
return hi.has(
|
|
6124
|
+
function Z(h) {
|
|
6125
|
+
return hi.has(j(h));
|
|
6104
6126
|
}
|
|
6105
6127
|
function B(h) {
|
|
6106
6128
|
return N(h).getComputedStyle(h);
|
|
@@ -6115,7 +6137,7 @@ function wt(h) {
|
|
|
6115
6137
|
};
|
|
6116
6138
|
}
|
|
6117
6139
|
function P(h) {
|
|
6118
|
-
if (
|
|
6140
|
+
if (j(h) === "html")
|
|
6119
6141
|
return h;
|
|
6120
6142
|
const t = (
|
|
6121
6143
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
@@ -6128,7 +6150,7 @@ function P(h) {
|
|
|
6128
6150
|
}
|
|
6129
6151
|
function se(h) {
|
|
6130
6152
|
const t = P(h);
|
|
6131
|
-
return
|
|
6153
|
+
return Z(t) ? h.ownerDocument ? h.ownerDocument.body : h.body : K(t) && st(t) ? t : se(t);
|
|
6132
6154
|
}
|
|
6133
6155
|
function tt(h, t, e) {
|
|
6134
6156
|
var i;
|
|
@@ -6193,8 +6215,8 @@ function G(h, t, e, i) {
|
|
|
6193
6215
|
const x = N(o), u = i && X(i) ? N(i) : i;
|
|
6194
6216
|
let w = x, m = yt(w);
|
|
6195
6217
|
for (; m && i && u !== w; ) {
|
|
6196
|
-
const g = U(m), E = m.getBoundingClientRect(),
|
|
6197
|
-
l *= g.x, c *= g.y, d *= g.x, f *= g.y, l +=
|
|
6218
|
+
const g = U(m), E = m.getBoundingClientRect(), p = B(m), C = E.left + (m.clientLeft + parseFloat(p.paddingLeft)) * g.x, b = E.top + (m.clientTop + parseFloat(p.paddingTop)) * g.y;
|
|
6219
|
+
l *= g.x, c *= g.y, d *= g.x, f *= g.y, l += C, c += b, w = N(m), m = yt(w);
|
|
6198
6220
|
}
|
|
6199
6221
|
}
|
|
6200
6222
|
return ht({
|
|
@@ -6234,7 +6256,7 @@ function ui(h) {
|
|
|
6234
6256
|
scrollTop: 0
|
|
6235
6257
|
}, c = Y(1);
|
|
6236
6258
|
const d = Y(0), f = K(i);
|
|
6237
|
-
if ((f || !f && !o) && ((
|
|
6259
|
+
if ((f || !f && !o) && ((j(i) !== "body" || st(r)) && (l = wt(i)), K(i))) {
|
|
6238
6260
|
const u = G(i);
|
|
6239
6261
|
c = U(i), d.x = u.x + i.clientLeft, d.y = u.y + i.clientTop;
|
|
6240
6262
|
}
|
|
@@ -6306,16 +6328,16 @@ function Vt(h, t, e) {
|
|
|
6306
6328
|
}
|
|
6307
6329
|
function ae(h, t) {
|
|
6308
6330
|
const e = P(h);
|
|
6309
|
-
return e === t || !X(e) ||
|
|
6331
|
+
return e === t || !X(e) || Z(e) ? !1 : B(e).position === "fixed" || ae(e, t);
|
|
6310
6332
|
}
|
|
6311
6333
|
function pi(h, t) {
|
|
6312
6334
|
const e = t.get(h);
|
|
6313
6335
|
if (e)
|
|
6314
6336
|
return e;
|
|
6315
|
-
let i = tt(h, [], !1).filter((a) => X(a) &&
|
|
6337
|
+
let i = tt(h, [], !1).filter((a) => X(a) && j(a) !== "body"), s = null;
|
|
6316
6338
|
const o = B(h).position === "fixed";
|
|
6317
6339
|
let r = o ? P(h) : h;
|
|
6318
|
-
for (; X(r) && !
|
|
6340
|
+
for (; X(r) && !Z(r); ) {
|
|
6319
6341
|
const a = B(r), l = St(r);
|
|
6320
6342
|
!l && a.position === "fixed" && (s = null), (o ? !l && !s : !l && a.position === "static" && !!s && mi.has(s.position) || st(r) && !l && ae(h, r)) ? i = i.filter((d) => d !== r) : s = a, r = P(r);
|
|
6321
6343
|
}
|
|
@@ -6360,7 +6382,7 @@ function bi(h, t, e) {
|
|
|
6360
6382
|
l.x = Lt(s);
|
|
6361
6383
|
}
|
|
6362
6384
|
if (i || !i && !o)
|
|
6363
|
-
if ((
|
|
6385
|
+
if ((j(t) !== "body" || st(s)) && (a = wt(t)), i) {
|
|
6364
6386
|
const u = G(t, !0, o, t);
|
|
6365
6387
|
l.x = u.x + t.clientLeft, l.y = u.y + t.clientTop;
|
|
6366
6388
|
} else s && c();
|
|
@@ -6390,7 +6412,7 @@ function le(h, t) {
|
|
|
6390
6412
|
return e;
|
|
6391
6413
|
if (!K(h)) {
|
|
6392
6414
|
let s = P(h);
|
|
6393
|
-
for (; s && !
|
|
6415
|
+
for (; s && !Z(s); ) {
|
|
6394
6416
|
if (X(s) && !mt(s))
|
|
6395
6417
|
return s;
|
|
6396
6418
|
s = P(s);
|
|
@@ -6400,7 +6422,7 @@ function le(h, t) {
|
|
|
6400
6422
|
let i = Pt(h, t);
|
|
6401
6423
|
for (; i && oi(i) && mt(i); )
|
|
6402
6424
|
i = Pt(i, t);
|
|
6403
|
-
return i &&
|
|
6425
|
+
return i && Z(i) && mt(i) && !St(i) ? e : i || ci(h) || e;
|
|
6404
6426
|
}
|
|
6405
6427
|
const Ii = async function(h) {
|
|
6406
6428
|
const t = this.getOffsetParent || le, e = this.getDimensions, i = await e(h.floating);
|
|
@@ -6449,7 +6471,7 @@ function _i(h, t) {
|
|
|
6449
6471
|
} = c;
|
|
6450
6472
|
if (a || t(), !x || !u)
|
|
6451
6473
|
return;
|
|
6452
|
-
const w = ot(f), m = ot(s.clientWidth - (d + x)), g = ot(s.clientHeight - (f + u)), E = ot(d),
|
|
6474
|
+
const w = ot(f), m = ot(s.clientWidth - (d + x)), g = ot(s.clientHeight - (f + u)), E = ot(d), C = {
|
|
6453
6475
|
rootMargin: -w + "px " + -m + "px " + -g + "px " + -E + "px",
|
|
6454
6476
|
threshold: z(0, q(1, l)) || 1
|
|
6455
6477
|
};
|
|
@@ -6467,12 +6489,12 @@ function _i(h, t) {
|
|
|
6467
6489
|
}
|
|
6468
6490
|
try {
|
|
6469
6491
|
e = new IntersectionObserver(y, {
|
|
6470
|
-
...
|
|
6492
|
+
...C,
|
|
6471
6493
|
// Handle <iframe>s
|
|
6472
6494
|
root: s.ownerDocument
|
|
6473
6495
|
});
|
|
6474
6496
|
} catch {
|
|
6475
|
-
e = new IntersectionObserver(y,
|
|
6497
|
+
e = new IntersectionObserver(y, C);
|
|
6476
6498
|
}
|
|
6477
6499
|
e.observe(h);
|
|
6478
6500
|
}
|
|
@@ -6495,10 +6517,10 @@ function bt(h, t, e, i) {
|
|
|
6495
6517
|
const f = c && a ? _i(c, e) : null;
|
|
6496
6518
|
let x = -1, u = null;
|
|
6497
6519
|
r && (u = new ResizeObserver((E) => {
|
|
6498
|
-
let [
|
|
6499
|
-
|
|
6500
|
-
var
|
|
6501
|
-
(
|
|
6520
|
+
let [p] = E;
|
|
6521
|
+
p && p.target === c && u && (u.unobserve(t), cancelAnimationFrame(x), x = requestAnimationFrame(() => {
|
|
6522
|
+
var C;
|
|
6523
|
+
(C = u) == null || C.observe(t);
|
|
6502
6524
|
})), e();
|
|
6503
6525
|
}), c && !l && u.observe(c), u.observe(t));
|
|
6504
6526
|
let w, m = l ? G(h) : null;
|
|
@@ -6509,12 +6531,12 @@ function bt(h, t, e, i) {
|
|
|
6509
6531
|
}
|
|
6510
6532
|
return e(), () => {
|
|
6511
6533
|
var E;
|
|
6512
|
-
d.forEach((
|
|
6513
|
-
s &&
|
|
6534
|
+
d.forEach((p) => {
|
|
6535
|
+
s && p.removeEventListener("scroll", e), o && p.removeEventListener("resize", e);
|
|
6514
6536
|
}), f == null || f(), (E = u) == null || E.disconnect(), u = null, l && cancelAnimationFrame(w);
|
|
6515
6537
|
};
|
|
6516
6538
|
}
|
|
6517
|
-
const dt = ti, ft = ei, Mt =
|
|
6539
|
+
const dt = ti, ft = ei, Mt = je, Si = Ze, ut = (h, t, e) => {
|
|
6518
6540
|
const i = /* @__PURE__ */ new Map(), s = {
|
|
6519
6541
|
platform: vi,
|
|
6520
6542
|
...e
|
|
@@ -6818,7 +6840,7 @@ class Oi {
|
|
|
6818
6840
|
if (a === "none")
|
|
6819
6841
|
return;
|
|
6820
6842
|
const l = this.ctx.database.getReadonly(o, r);
|
|
6821
|
-
i && !l && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = i, this.startEditByInput(this.cellTarget, t), this.ctx.emit("startEdit", this.cellTarget));
|
|
6843
|
+
i && !l && (this.ctx.emit("drawView"), this.enable = !0, this.ctx.editing = !0, this.cellTarget = i, this.startEditByInput(this.cellTarget, t), this.ctx.emit("startEdit", this.cellTarget));
|
|
6822
6844
|
}
|
|
6823
6845
|
editCell(t, e) {
|
|
6824
6846
|
const i = this.ctx.body.renderRows.find((c) => c.rowIndex === t);
|
|
@@ -7122,7 +7144,7 @@ class zt {
|
|
|
7122
7144
|
const o = this.createElement("span", "menu-item-text");
|
|
7123
7145
|
if (o.textContent = t.label, s.appendChild(o), i.appendChild(s), (r = t.children) != null && r.length) {
|
|
7124
7146
|
const a = this.createElement("span", "e-virt-table-menu-arrow");
|
|
7125
|
-
a.innerHTML =
|
|
7147
|
+
a.innerHTML = jt, i.appendChild(a);
|
|
7126
7148
|
const l = this.createSubmenu(t.children);
|
|
7127
7149
|
i._submenu = l, this.container.appendChild(l);
|
|
7128
7150
|
}
|
|
@@ -7352,12 +7374,12 @@ class Ai {
|
|
|
7352
7374
|
e.preventDefault();
|
|
7353
7375
|
const { xArr: x } = this.ctx.selector, [u, w] = x, { colIndex: m } = t;
|
|
7354
7376
|
m >= u && m <= w || (this.ctx.focusCellHeader = t, this.ctx.emit("selectCols", t)), this.currentDOMTreeMenu && this.currentDOMTreeMenu.destroy();
|
|
7355
|
-
const E = this.ctx.database.getColumns(),
|
|
7356
|
-
...
|
|
7377
|
+
const E = this.ctx.database.getColumns(), p = f.map((C) => C.value === "visible" ? {
|
|
7378
|
+
...C,
|
|
7357
7379
|
children: this.filterColumns(E)
|
|
7358
|
-
} :
|
|
7359
|
-
this.ctx.contextMenuIng = !0, this.currentDOMTreeMenu = new zt(this.contextMenuEl,
|
|
7360
|
-
onClick: (
|
|
7380
|
+
} : C);
|
|
7381
|
+
this.ctx.contextMenuIng = !0, this.currentDOMTreeMenu = new zt(this.contextMenuEl, p, {
|
|
7382
|
+
onClick: (C, b) => {
|
|
7361
7383
|
const { xArr: y } = this.ctx.selector, [v, _] = y;
|
|
7362
7384
|
if (b === "fixedLeft" || b === "fixedRight" || b === "fixedNone") {
|
|
7363
7385
|
const S = this.ctx.header.allCellHeaders.filter((I) => I.colIndex >= v && I.colIndex <= _).filter((I) => I.level === 0).filter((I) => !I.column.fixedDisabled).map((I) => I.key);
|
|
@@ -7543,7 +7565,7 @@ class Xi {
|
|
|
7543
7565
|
this.ctx.database.setFooterData(t), this.ctx.emit("draw");
|
|
7544
7566
|
}
|
|
7545
7567
|
setCustomHeader(t, e = !0) {
|
|
7546
|
-
this.ctx.database.setCustomHeader(t, e), this.
|
|
7568
|
+
this.ctx.database.setCustomHeader(t, e), this.header.init(), this.ctx.emit("draw");
|
|
7547
7569
|
}
|
|
7548
7570
|
getCustomHeader() {
|
|
7549
7571
|
return this.header.getCustomHeader();
|