e-virt-table 1.3.12 → 1.3.13
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 +143 -142
- 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/Database.js +2 -1
- package/dist/lib/Database.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -539,10 +539,10 @@ class vt extends qt {
|
|
|
539
539
|
const R = this.ctx.icons.get("expand"), S = this.ctx.icons.get("shrink");
|
|
540
540
|
o = c ? S : R, a = c ? "shrink" : "expand";
|
|
541
541
|
}
|
|
542
|
-
let w = m, E = m,
|
|
543
|
-
(this.align === "center" || this.align === "right") && (
|
|
544
|
-
let
|
|
545
|
-
this.type === "selection-tree" ? (
|
|
542
|
+
let w = m, E = m, p = this.drawX;
|
|
543
|
+
(this.align === "center" || this.align === "right") && (p = this.drawX + (this.visibleWidth - w - 2 * e) / 2, this.align = "left");
|
|
544
|
+
let C = p + r + e, b = this.drawY + (this.visibleHeight - E) / 2, y = r + this.drawX + w - 0.5;
|
|
545
|
+
this.type === "selection-tree" ? (C = r + this.drawSelectionImageX + this.drawSelectionImageWidth, y = C + w - e / 2) : this.type === "tree-selection" ? y = C + g + w - e / 2 : y = C + w - e / 2, this.drawTextX = y, this.drawTextWidth = this.drawX + this.visibleWidth - y, !(C + w + e > this.drawX + this.visibleWidth) && (b + E + e > this.drawY + this.visibleHeight || (this.drawTreeImageX = C, this.drawTreeImageY = b, this.drawTreeImageWidth = w, this.drawTreeImageHeight = E, o ? (this.drawTreeImageName = a, this.drawTreeImageSource = o) : (this.drawTreeImageName = "", this.drawTreeImageSource = void 0)));
|
|
546
546
|
}
|
|
547
547
|
drawTreeLine() {
|
|
548
548
|
const { TREE_LINE: e, TREE_INDENT: i = 16, TREE_ICON_SIZE: s = 16, TREE_LINE_COLOR: o = "#e1e6eb" } = this.ctx.config;
|
|
@@ -621,13 +621,13 @@ class vt extends qt {
|
|
|
621
621
|
return;
|
|
622
622
|
}
|
|
623
623
|
let E = "transparent";
|
|
624
|
-
const
|
|
624
|
+
const p = this.ctx.hoverCell, C = this.ctx.currentCell;
|
|
625
625
|
let b = this.rowIndex, y = this.rowIndex;
|
|
626
626
|
if (this.rowspan !== 1 && (x || d)) {
|
|
627
627
|
const _ = this.getSpanInfo(), { yArr: T } = _;
|
|
628
628
|
b = T[0], y = T[1];
|
|
629
629
|
}
|
|
630
|
-
x &&
|
|
630
|
+
x && p && (p.rowKey === this.rowKey && (E = u), p.rowIndex >= b && p.rowIndex <= y && (E = u)), d && C && (C.rowKey === this.rowKey && (E = f), C.rowIndex >= b && C.rowIndex <= y && (E = f)), this.drawCellSkyBgColor = E;
|
|
631
631
|
let R = e, S = a;
|
|
632
632
|
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (R = i, S = r), g && (this.rowIndex % 2 ? R = m : R = e), typeof s == "function") {
|
|
633
633
|
const _ = s, { backgroundColor: T, color: M, font: L } = _({
|
|
@@ -653,17 +653,17 @@ class vt extends qt {
|
|
|
653
653
|
let g = u, m = this.drawY + (i - f) / 2;
|
|
654
654
|
if (a !== "selection-tree") {
|
|
655
655
|
if (a === "tree-selection") {
|
|
656
|
-
const { TREE_INDENT:
|
|
657
|
-
g = u +
|
|
656
|
+
const { TREE_INDENT: p = 16, TREE_ICON_SIZE: C } = this.ctx.config, b = this.ctx.database.getRowForRowKey(c), { level: y = 0 } = b || {}, R = y * p;
|
|
657
|
+
g = u + C + R;
|
|
658
658
|
}
|
|
659
659
|
}
|
|
660
660
|
let w = this.ctx.icons.get("checkbox-uncheck"), E = "checkbox-uncheck";
|
|
661
661
|
if (a === "selection-tree" || a === "tree-selection") {
|
|
662
|
-
const
|
|
663
|
-
|
|
662
|
+
const p = this.ctx.database.getTreeSelectionState(c);
|
|
663
|
+
p.indeterminate && d ? (w = this.ctx.icons.get("checkbox-indeterminate"), E = "checkbox-indeterminate") : p.checked && d ? (w = this.ctx.icons.get("checkbox-check"), E = "checkbox-check") : !p.checked && d ? (w = this.ctx.icons.get("checkbox-uncheck"), E = "checkbox-uncheck") : (w = this.ctx.icons.get("checkbox-disabled"), E = "checkbox-disabled");
|
|
664
664
|
} else {
|
|
665
|
-
const
|
|
666
|
-
|
|
665
|
+
const p = this.ctx.database.getRowSelection(c);
|
|
666
|
+
p && d ? (w = this.ctx.icons.get("checkbox-check"), E = "checkbox-check") : p && !d ? (w = this.ctx.icons.get("checkbox-check-disabled"), E = "checkbox-check-disabled") : !p && d ? (w = this.ctx.icons.get("checkbox-uncheck"), E = "checkbox-uncheck") : (w = this.ctx.icons.get("checkbox-disabled"), E = "checkbox-disabled");
|
|
667
667
|
}
|
|
668
668
|
g + 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 = g, this.drawSelectionImageY = m, this.drawSelectionImageWidth = f, this.drawSelectionImageHeight = f, this.drawSelectionImageName = E, this.drawSelectionImageSource = w) : (this.drawSelectionImageX = g, this.drawSelectionImageY = m, this.drawSelectionImageWidth = f, this.drawSelectionImageHeight = f, this.drawSelectionImageName = E, this.drawSelectionImageSource = w));
|
|
669
669
|
}
|
|
@@ -687,8 +687,8 @@ class vt extends qt {
|
|
|
687
687
|
if (a.rowKey === this.rowKey && (l = this.drawX + this.width - s - o, c = this.drawY + (this.height - s) / 2), this.rowspan !== 1 && r) {
|
|
688
688
|
const f = this.getSpanInfo(), { yArr: x } = f, u = x[0], g = x[1];
|
|
689
689
|
if (a.rowIndex >= u && a.rowIndex <= g) {
|
|
690
|
-
const { width: m, height: w, offsetTop: E, offsetLeft:
|
|
691
|
-
l = this.drawX -
|
|
690
|
+
const { width: m, height: w, offsetTop: E, offsetLeft: p } = f;
|
|
691
|
+
l = this.drawX - p + m - s - o, c = this.drawY - E + (w - s) / 2;
|
|
692
692
|
}
|
|
693
693
|
}
|
|
694
694
|
const d = this.ctx.icons.get(this.hoverIconName);
|
|
@@ -961,9 +961,9 @@ class vt extends qt {
|
|
|
961
961
|
drawBorder(e) {
|
|
962
962
|
const { drawX: i, drawY: s, rowIndex: o, colIndex: r, height: a, width: l } = this;
|
|
963
963
|
let c = i, d = s;
|
|
964
|
-
const { xArr: f, yArr: x, lineDash: u = [], borderWidth: g = 1, borderColor: m, fillColor: w } = e, E = f[0],
|
|
965
|
-
if (r >= E && r <=
|
|
966
|
-
const y = r ===
|
|
964
|
+
const { xArr: f, yArr: x, lineDash: u = [], borderWidth: g = 1, borderColor: m, fillColor: w } = e, E = f[0], p = f[1], C = x[0], b = x[1];
|
|
965
|
+
if (r >= E && r <= p && o === C) {
|
|
966
|
+
const y = r === p ? 1 : 0, R = r === E ? 1 : 0;
|
|
967
967
|
this.ctx.paint.drawLine([c + R, d + 1, c + l - y, d + 1], {
|
|
968
968
|
borderColor: m,
|
|
969
969
|
fillColor: w,
|
|
@@ -973,8 +973,8 @@ class vt extends qt {
|
|
|
973
973
|
lineDash: u
|
|
974
974
|
});
|
|
975
975
|
}
|
|
976
|
-
if (r ===
|
|
977
|
-
const y = o ===
|
|
976
|
+
if (r === p && o >= C && o <= b) {
|
|
977
|
+
const y = o === C ? 1 : 0, R = o === b ? 1 : 0;
|
|
978
978
|
this.ctx.paint.drawLine([c + l - 1, d + y, c + l - 1, d + a - R], {
|
|
979
979
|
borderColor: m,
|
|
980
980
|
fillColor: w,
|
|
@@ -984,8 +984,8 @@ class vt extends qt {
|
|
|
984
984
|
lineDash: u
|
|
985
985
|
});
|
|
986
986
|
}
|
|
987
|
-
if (r >= E && r <=
|
|
988
|
-
const y = r ===
|
|
987
|
+
if (r >= E && r <= p && o === b) {
|
|
988
|
+
const y = r === p ? 1 : 0, R = r === E ? 1 : 0;
|
|
989
989
|
this.ctx.paint.drawLine([c + R, d + a - 1, c + l - y, d + a - 1], {
|
|
990
990
|
borderColor: m,
|
|
991
991
|
fillColor: w,
|
|
@@ -995,8 +995,8 @@ class vt extends qt {
|
|
|
995
995
|
lineDash: u
|
|
996
996
|
});
|
|
997
997
|
}
|
|
998
|
-
if (r === E && o >=
|
|
999
|
-
const y = o === b ? 1 : 0, R = o ===
|
|
998
|
+
if (r === E && o >= C && o <= b) {
|
|
999
|
+
const y = o === b ? 1 : 0, R = o === C ? 1 : 0;
|
|
1000
1000
|
this.ctx.paint.drawLine([c + 1, d + R, c + 1, d + a - y], {
|
|
1001
1001
|
borderColor: m,
|
|
1002
1002
|
fillColor: w,
|
|
@@ -1083,7 +1083,7 @@ class be {
|
|
|
1083
1083
|
TREE_CHILDREN_KEY: d
|
|
1084
1084
|
} = this.ctx.config;
|
|
1085
1085
|
t.forEach((f, x) => {
|
|
1086
|
-
var
|
|
1086
|
+
var C;
|
|
1087
1087
|
d !== "children" && (f.children = f[d]);
|
|
1088
1088
|
const u = f[o], g = u != null ? `${u}` : $t();
|
|
1089
1089
|
this.itemRowKeyMap.set(f, g);
|
|
@@ -1100,10 +1100,10 @@ class be {
|
|
|
1100
1100
|
this.selectionMap.set(g, {
|
|
1101
1101
|
key: c ? f[c] : g,
|
|
1102
1102
|
row: f,
|
|
1103
|
-
check: ((
|
|
1103
|
+
check: ((C = this.selectionMap.get(g)) == null ? void 0 : C.check) || !1
|
|
1104
1104
|
});
|
|
1105
|
-
const
|
|
1106
|
-
this.expandMap.set(g,
|
|
1105
|
+
const p = r || this.expandMap.get(g) || f._expand || !1;
|
|
1106
|
+
this.expandMap.set(g, p), this.rowKeyMap.set(g, {
|
|
1107
1107
|
readonly: w,
|
|
1108
1108
|
index: x,
|
|
1109
1109
|
rowIndex: x,
|
|
@@ -1112,7 +1112,7 @@ class be {
|
|
|
1112
1112
|
calculatedHeight: -1,
|
|
1113
1113
|
check: !1,
|
|
1114
1114
|
selectable: E,
|
|
1115
|
-
expand:
|
|
1115
|
+
expand: p,
|
|
1116
1116
|
expandLazy: !1,
|
|
1117
1117
|
hasChildren: f._hasChildren || (Array.isArray(f.children) ? f.children.length > 0 : !1),
|
|
1118
1118
|
expandLoading: !1,
|
|
@@ -1179,19 +1179,20 @@ class be {
|
|
|
1179
1179
|
}
|
|
1180
1180
|
generateColumns(t) {
|
|
1181
1181
|
const e = (i) => i.map((s) => {
|
|
1182
|
-
var
|
|
1182
|
+
var c, d, f, x, u, g, m, w;
|
|
1183
1183
|
const o = s.children && Array.isArray(s.children) ? e(s.children) : void 0, r = {
|
|
1184
|
-
hide: (
|
|
1185
|
-
fixed: (
|
|
1186
|
-
sort: (
|
|
1187
|
-
width: (
|
|
1184
|
+
hide: (d = (c = this.customHeader) == null ? void 0 : c.hideData) == null ? void 0 : d[s.key],
|
|
1185
|
+
fixed: (x = (f = this.customHeader) == null ? void 0 : f.fixedData) == null ? void 0 : x[s.key],
|
|
1186
|
+
sort: (g = (u = this.customHeader) == null ? void 0 : u.sortData) == null ? void 0 : g[s.key],
|
|
1187
|
+
width: (w = (m = this.customHeader) == null ? void 0 : m.resizableData) == null ? void 0 : w[s.key]
|
|
1188
1188
|
}, a = {};
|
|
1189
|
-
for (const [
|
|
1190
|
-
|
|
1189
|
+
for (const [E, p] of Object.entries(r))
|
|
1190
|
+
p !== void 0 && (a[E] = p);
|
|
1191
|
+
const l = o && o.every((E) => E.hide);
|
|
1191
1192
|
return {
|
|
1192
1193
|
...s,
|
|
1193
1194
|
children: o,
|
|
1194
|
-
hide: typeof s.hide == "function" ? s.hide(s) : s.hide,
|
|
1195
|
+
hide: l || (typeof s.hide == "function" ? s.hide(s) : s.hide),
|
|
1195
1196
|
...a
|
|
1196
1197
|
};
|
|
1197
1198
|
});
|
|
@@ -1435,18 +1436,18 @@ class be {
|
|
|
1435
1436
|
const a = /* @__PURE__ */ new Set();
|
|
1436
1437
|
let l = [], c = t.map((g) => {
|
|
1437
1438
|
const { rowKey: m, key: w } = g;
|
|
1438
|
-
let E = g.value,
|
|
1439
|
-
const
|
|
1440
|
-
return (y == null ? void 0 : y.type) === "number" && (["", void 0, null].includes(E) ?
|
|
1439
|
+
let E = g.value, p = E;
|
|
1440
|
+
const C = this.getRowDataItemForRowKey(m), b = this.getItemValue(m, w), y = this.getVirtualBodyCellByKey(m, w);
|
|
1441
|
+
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({
|
|
1441
1442
|
...g,
|
|
1442
|
-
value:
|
|
1443
|
+
value: p,
|
|
1443
1444
|
oldValue: b,
|
|
1444
|
-
row:
|
|
1445
|
+
row: C
|
|
1445
1446
|
}))), {
|
|
1446
1447
|
...g,
|
|
1447
|
-
value:
|
|
1448
|
+
value: p,
|
|
1448
1449
|
oldValue: b,
|
|
1449
|
-
row:
|
|
1450
|
+
row: C
|
|
1450
1451
|
};
|
|
1451
1452
|
});
|
|
1452
1453
|
if (c = c.filter((g) => !l.some((m) => g.rowKey === m.rowKey && g.key === m.key)), l.length) {
|
|
@@ -1461,11 +1462,11 @@ class be {
|
|
|
1461
1462
|
return;
|
|
1462
1463
|
const { BEFORE_VALUE_CHANGE_METHOD: d } = this.ctx.config;
|
|
1463
1464
|
s === "none" && typeof d == "function" && (c = await d(c), r = !1), c.forEach((g) => {
|
|
1464
|
-
const { value: m, rowKey: w, key: E } = g,
|
|
1465
|
+
const { value: m, rowKey: w, key: E } = g, p = this.getItemValue(w, E);
|
|
1465
1466
|
a.add(w), this.setItemValue(w, E, m, !1, !1, !1, r), o.push({
|
|
1466
1467
|
rowKey: w,
|
|
1467
1468
|
key: E,
|
|
1468
|
-
oldValue:
|
|
1469
|
+
oldValue: p,
|
|
1469
1470
|
newValue: m
|
|
1470
1471
|
});
|
|
1471
1472
|
});
|
|
@@ -1689,19 +1690,19 @@ class be {
|
|
|
1689
1690
|
if (this.ctx.config.TREE_SELECT_MODE === "auto") {
|
|
1690
1691
|
const c = (w) => {
|
|
1691
1692
|
const E = this.getTreeChildren(w);
|
|
1692
|
-
let
|
|
1693
|
-
for (const
|
|
1694
|
-
|
|
1695
|
-
return
|
|
1693
|
+
let p = [];
|
|
1694
|
+
for (const C of E)
|
|
1695
|
+
p.push(C), p.push(...c(C));
|
|
1696
|
+
return p;
|
|
1696
1697
|
}, f = c(t).map((w) => this.selectionMap.get(w)), x = f.filter((w) => w == null ? void 0 : w.check).length, u = f.length, g = x > 0;
|
|
1697
1698
|
r = g && !(x === u), a = s || g, s && u > 0 && x === 0 && (a = !1, r = !1);
|
|
1698
1699
|
} else if (this.ctx.config.TREE_SELECT_MODE === "cautious") {
|
|
1699
1700
|
const c = (w) => {
|
|
1700
1701
|
const E = this.getTreeChildren(w);
|
|
1701
|
-
let
|
|
1702
|
-
for (const
|
|
1703
|
-
|
|
1704
|
-
return
|
|
1702
|
+
let p = [];
|
|
1703
|
+
for (const C of E)
|
|
1704
|
+
p.push(C), p.push(...c(C));
|
|
1705
|
+
return p;
|
|
1705
1706
|
}, f = c(t).map((w) => this.selectionMap.get(w)), x = f.filter((w) => w == null ? void 0 : w.check).length, u = f.length, g = x > 0, m = x === u;
|
|
1706
1707
|
r = g && !m, a = s || m, s && u > 0 && x === 0 && (a = !1, r = !1);
|
|
1707
1708
|
} else this.ctx.config.TREE_SELECT_MODE === "strictly" && (r = !1, a = s);
|
|
@@ -2012,7 +2013,7 @@ class be {
|
|
|
2012
2013
|
}
|
|
2013
2014
|
]
|
|
2014
2015
|
};
|
|
2015
|
-
let w = e, E = e,
|
|
2016
|
+
let w = e, E = e, p = a, C = a, b = [], y = 0, R = 0, S = 0, O = 0;
|
|
2016
2017
|
if (d !== 1 && g) {
|
|
2017
2018
|
O = x;
|
|
2018
2019
|
const v = l.reduce((I, _) => {
|
|
@@ -2063,7 +2064,7 @@ class be {
|
|
|
2063
2064
|
break;
|
|
2064
2065
|
const _ = this.getItemValue(s, i), T = this.getItemValue(s, I.key);
|
|
2065
2066
|
if (_ === T && c.includes(I.key))
|
|
2066
|
-
|
|
2067
|
+
p = v;
|
|
2067
2068
|
else
|
|
2068
2069
|
break;
|
|
2069
2070
|
}
|
|
@@ -2073,17 +2074,17 @@ class be {
|
|
|
2073
2074
|
break;
|
|
2074
2075
|
const _ = this.getItemValue(s, i), T = this.getItemValue(s, I.key);
|
|
2075
2076
|
if (_ === T && c.includes(I.key))
|
|
2076
|
-
|
|
2077
|
+
C = v;
|
|
2077
2078
|
else
|
|
2078
2079
|
break;
|
|
2079
2080
|
}
|
|
2080
|
-
for (let v =
|
|
2081
|
+
for (let v = p; v < a; v++) {
|
|
2081
2082
|
const I = this.getColumnByColIndex(v);
|
|
2082
2083
|
if (!I)
|
|
2083
2084
|
break;
|
|
2084
2085
|
R += I.width || 100;
|
|
2085
2086
|
}
|
|
2086
|
-
for (let v =
|
|
2087
|
+
for (let v = p; v <= C; v++) {
|
|
2087
2088
|
const I = this.getColumnByColIndex(v);
|
|
2088
2089
|
if (!I)
|
|
2089
2090
|
break;
|
|
@@ -2096,7 +2097,7 @@ class be {
|
|
|
2096
2097
|
}
|
|
2097
2098
|
}
|
|
2098
2099
|
return {
|
|
2099
|
-
xArr: [
|
|
2100
|
+
xArr: [p, C],
|
|
2100
2101
|
yArr: [w, E],
|
|
2101
2102
|
rowspan: d,
|
|
2102
2103
|
colspan: u,
|
|
@@ -2529,10 +2530,10 @@ class _e {
|
|
|
2529
2530
|
} = r;
|
|
2530
2531
|
if (this.ctx.font = a, this.ctx.fillStyle = c, this.ctx.textAlign = l, ["", null, void 0].includes(t))
|
|
2531
2532
|
return this.ctx.restore(), !1;
|
|
2532
|
-
const E = parseInt(((I = a.match(/\d+/)) == null ? void 0 : I[0]) || "12") * (r.lineHeight || 1.2),
|
|
2533
|
-
let
|
|
2533
|
+
const E = parseInt(((I = a.match(/\d+/)) == null ? void 0 : I[0]) || "12") * (r.lineHeight || 1.2), p = s - d * 2 - g - m;
|
|
2534
|
+
let C = !1;
|
|
2534
2535
|
const b = Math.round((o - 2 * d) / E);
|
|
2535
|
-
let y = this.wrapText(t,
|
|
2536
|
+
let y = this.wrapText(t, p, r.cacheTextKey), R = Math.min(y.length, Math.max(b, 1));
|
|
2536
2537
|
x === "auto" && u ? R = y.length : typeof x == "number" && x < R && x !== 1 ? R = x : (x === 1 && (y = [t], R = 1), x === "auto" && b === 1 && (y = [t], R = 1));
|
|
2537
2538
|
let S = i + d;
|
|
2538
2539
|
const O = Math.round(R * E);
|
|
@@ -2543,7 +2544,7 @@ class _e {
|
|
|
2543
2544
|
const T = y[_], M = S + _ * E;
|
|
2544
2545
|
if (this.ctx.textBaseline = "top", _ === R - 1) {
|
|
2545
2546
|
const A = y.slice(_).join(""), { _text: H, ellipsis: D } = this.handleEllipsis(A, s, d, a);
|
|
2546
|
-
this.ctx.fillText(H, v, M),
|
|
2547
|
+
this.ctx.fillText(H, v, M), C = D;
|
|
2547
2548
|
break;
|
|
2548
2549
|
}
|
|
2549
2550
|
this.ctx.fillText(T, v, M);
|
|
@@ -2564,7 +2565,7 @@ class _e {
|
|
|
2564
2565
|
};
|
|
2565
2566
|
r.textCallback(A);
|
|
2566
2567
|
}
|
|
2567
|
-
return this.ctx.restore(),
|
|
2568
|
+
return this.ctx.restore(), C;
|
|
2568
2569
|
}
|
|
2569
2570
|
/**
|
|
2570
2571
|
* 将文本按宽度换行
|
|
@@ -4711,9 +4712,9 @@ class Ne {
|
|
|
4711
4712
|
let w = this.height + e.height + r;
|
|
4712
4713
|
w += m;
|
|
4713
4714
|
let E = w;
|
|
4714
|
-
const
|
|
4715
|
-
if (
|
|
4716
|
-
const T =
|
|
4715
|
+
const p = window.innerHeight, { top: C } = this.containerRect || this.ctx.containerElement.getBoundingClientRect();
|
|
4716
|
+
if (p > C && d && !a) {
|
|
4717
|
+
const T = p - C - f;
|
|
4717
4718
|
T > e.height + r ? E = T : w > c && (E = c);
|
|
4718
4719
|
} else this.data.length && a ? E = a : this.data.length && c && w > c && (E = c);
|
|
4719
4720
|
E > 0 && (this.ctx.stageHeight = Math.floor(E), this.ctx.stageElement.style.height = `${this.ctx.stageHeight}px`);
|
|
@@ -5084,14 +5085,14 @@ class Be {
|
|
|
5084
5085
|
SELECTOR_AREA_MAX_X_OFFSET: f,
|
|
5085
5086
|
SELECTOR_AREA_MAX_Y_OFFSET: x
|
|
5086
5087
|
} = this.ctx.config, u = a, g = l || this.ctx.maxColIndex - f, m = c, w = d || this.ctx.maxRowIndex - x;
|
|
5087
|
-
let [E,
|
|
5088
|
-
if (E < u ||
|
|
5088
|
+
let [E, p] = o, [C, b] = r;
|
|
5089
|
+
if (E < u || p > g || C < m || b > w)
|
|
5089
5090
|
return;
|
|
5090
5091
|
if (this.ctx.config.ENABLE_MERGE_CELL_LINK) {
|
|
5091
5092
|
const R = this.adjustMergeCells(o, r);
|
|
5092
|
-
|
|
5093
|
+
C = R.yArr[0], b = R.yArr[1], E = R.xArr[0], p = R.xArr[1], this.ctx.onlyMergeCell = R.onlyMergeCell;
|
|
5093
5094
|
}
|
|
5094
|
-
E ===
|
|
5095
|
+
E === p && C === b ? this.ctx.selectOnlyOne = !0 : this.ctx.selectOnlyOne = !1, o = [Math.max(u, E), Math.min(g, p)], r = [Math.max(m, C), Math.min(w, b)];
|
|
5095
5096
|
const { BEFORE_SET_SELECTOR_METHOD: y } = this.ctx.config;
|
|
5096
5097
|
if (typeof y == "function") {
|
|
5097
5098
|
const S = y({
|
|
@@ -5103,7 +5104,7 @@ class Be {
|
|
|
5103
5104
|
return;
|
|
5104
5105
|
o = S.xArr, r = S.yArr;
|
|
5105
5106
|
}
|
|
5106
|
-
this.ctx.selector.xArr = o, this.ctx.selector.yArr = r, b === this.ctx.maxRowIndex &&
|
|
5107
|
+
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");
|
|
5107
5108
|
}
|
|
5108
5109
|
}
|
|
5109
5110
|
adjustMergeCells(t, e) {
|
|
@@ -5118,13 +5119,13 @@ class Be {
|
|
|
5118
5119
|
let a = [], l = [];
|
|
5119
5120
|
for (let m = 0; m <= e[1] - e[0]; m++)
|
|
5120
5121
|
for (let w = 0; w <= t[1] - t[0]; w++) {
|
|
5121
|
-
const E = m + e[0],
|
|
5122
|
-
|
|
5122
|
+
const E = m + e[0], p = w + t[0], C = this.ctx.database.getVirtualBodyCell(E, p);
|
|
5123
|
+
C && ((E === i || E === s) && a.push(C), (p === o || p === r) && l.push(C));
|
|
5123
5124
|
}
|
|
5124
5125
|
const c = a.reduce(
|
|
5125
5126
|
(m, w) => {
|
|
5126
|
-
const { yArr: E } = w.getSpanInfo(), [
|
|
5127
|
-
return m.minY = Math.min(m.minY,
|
|
5127
|
+
const { yArr: E } = w.getSpanInfo(), [p, C] = E;
|
|
5128
|
+
return m.minY = Math.min(m.minY, p), m.maxY = Math.max(m.maxY, C), m;
|
|
5128
5129
|
},
|
|
5129
5130
|
{
|
|
5130
5131
|
minY: i,
|
|
@@ -5132,8 +5133,8 @@ class Be {
|
|
|
5132
5133
|
}
|
|
5133
5134
|
), d = l.reduce(
|
|
5134
5135
|
(m, w) => {
|
|
5135
|
-
const { xArr: E } = w.getSpanInfo(), [
|
|
5136
|
-
return m.minX = Math.min(m.minX,
|
|
5136
|
+
const { xArr: E } = w.getSpanInfo(), [p, C] = E;
|
|
5137
|
+
return m.minX = Math.min(m.minX, p), m.maxX = Math.max(m.maxX, C), m;
|
|
5137
5138
|
},
|
|
5138
5139
|
{
|
|
5139
5140
|
minX: o,
|
|
@@ -5328,18 +5329,18 @@ class Be {
|
|
|
5328
5329
|
});
|
|
5329
5330
|
const m = r.length === 1 && r[0].length === 1;
|
|
5330
5331
|
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(a, l) && !m) {
|
|
5331
|
-
const
|
|
5332
|
+
const C = {
|
|
5332
5333
|
code: "ERR_MERGED_CELLS_PASTE",
|
|
5333
5334
|
message: "Merged cells cannot span paste data"
|
|
5334
5335
|
};
|
|
5335
|
-
this.ctx.hasEvent("error") ? this.ctx.emit("error",
|
|
5336
|
+
this.ctx.hasEvent("error") ? this.ctx.emit("error", C) : alert(C.message);
|
|
5336
5337
|
return;
|
|
5337
5338
|
}
|
|
5338
5339
|
let w = [];
|
|
5339
|
-
for (let
|
|
5340
|
-
const b = r[
|
|
5340
|
+
for (let C = 0; C <= r.length - 1; C++) {
|
|
5341
|
+
const b = r[C].length;
|
|
5341
5342
|
for (let y = 0; y <= b - 1; y++) {
|
|
5342
|
-
const R =
|
|
5343
|
+
const R = C + e, S = y + i, O = r[C][y], v = this.ctx.database.getItemValueForRowIndexAndColIndex(
|
|
5343
5344
|
R,
|
|
5344
5345
|
S
|
|
5345
5346
|
);
|
|
@@ -5356,13 +5357,13 @@ class Be {
|
|
|
5356
5357
|
}
|
|
5357
5358
|
}
|
|
5358
5359
|
if (this.isCut) {
|
|
5359
|
-
const
|
|
5360
|
+
const C = this.clearSelectedData(
|
|
5360
5361
|
this.ctx.selector.xArrCopy,
|
|
5361
5362
|
this.ctx.selector.yArrCopy,
|
|
5362
5363
|
!0
|
|
5363
5364
|
// 忽略设置,只返回数据,用于cut,实现历史回退需要返回两次问题
|
|
5364
5365
|
), b = w.map((y) => `${y.rowKey}-${y.key}`);
|
|
5365
|
-
|
|
5366
|
+
C.forEach((y) => {
|
|
5366
5367
|
b.includes(`${y.rowKey}-${y.key}`) || w.unshift(y);
|
|
5367
5368
|
}), this.isCut = !1;
|
|
5368
5369
|
}
|
|
@@ -5370,21 +5371,21 @@ class Be {
|
|
|
5370
5371
|
return;
|
|
5371
5372
|
const { BEFORE_PASTE_DATA_METHOD: E } = this.ctx.config;
|
|
5372
5373
|
if (typeof E == "function") {
|
|
5373
|
-
const
|
|
5374
|
+
const C = E, b = w.map((y) => ({
|
|
5374
5375
|
rowKey: y.rowKey,
|
|
5375
5376
|
key: y.key,
|
|
5376
5377
|
value: y.value,
|
|
5377
5378
|
oldValue: this.ctx.database.getItemValue(y.rowKey, y.key),
|
|
5378
5379
|
row: this.ctx.database.getRowDataItemForRowKey(y.rowKey)
|
|
5379
5380
|
}));
|
|
5380
|
-
if (w = await
|
|
5381
|
+
if (w = await C(b, a, l, r), w && !w.length)
|
|
5381
5382
|
return;
|
|
5382
5383
|
}
|
|
5383
5384
|
this.clearCopyLine(), this.ctx.batchSetItemValueByEditor(w, !0);
|
|
5384
|
-
let
|
|
5385
|
-
s.forEach((
|
|
5386
|
-
|
|
5387
|
-
}), this.ctx.emit("pasteChange", w,
|
|
5385
|
+
let p = [];
|
|
5386
|
+
s.forEach((C) => {
|
|
5387
|
+
p.push(this.ctx.database.getRowDataItemForRowKey(C));
|
|
5388
|
+
}), this.ctx.emit("pasteChange", w, p), this.ctx.emit("draw");
|
|
5388
5389
|
}).catch((o) => {
|
|
5389
5390
|
console.error("Failed to get the clipboard content:", o);
|
|
5390
5391
|
});
|
|
@@ -5450,14 +5451,14 @@ class Be {
|
|
|
5450
5451
|
if (!i)
|
|
5451
5452
|
return;
|
|
5452
5453
|
g && this.ctx.onlyMergeCell && i.updateSpanInfo();
|
|
5453
|
-
const { drawX: m, drawY: w, width: E, height:
|
|
5454
|
-
let R = r.height - w, S =
|
|
5454
|
+
const { drawX: m, drawY: w, width: E, height: p, fixed: C } = i, b = o - m + 1, y = i.drawX + E - (e - s) + 1;
|
|
5455
|
+
let R = r.height - w, S = p;
|
|
5455
5456
|
S > l.visibleHeight && (S = l.visibleHeight);
|
|
5456
5457
|
let O = 0;
|
|
5457
5458
|
x && (u === "top" ? R = r.height + a.height - w : O = a.visibleHeight);
|
|
5458
5459
|
const v = w + S - (t - O - f);
|
|
5459
5460
|
let I = c, _ = d;
|
|
5460
|
-
y > 0 && !
|
|
5461
|
+
y > 0 && !C ? I = Math.floor(c + y) : b > 0 && !C && (I = Math.floor(c - b)), R > 0 ? _ = Math.floor(d - R) : v > 0 && (_ = Math.floor(d + v)), (Math.abs(c - I) > 2 || Math.abs(d - _) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.emit("adjustBoundaryPosition", i), this.ctx.setScroll(I, _));
|
|
5461
5462
|
}
|
|
5462
5463
|
destroy() {
|
|
5463
5464
|
}
|
|
@@ -5515,11 +5516,11 @@ class Xe {
|
|
|
5515
5516
|
SELECTOR_AREA_MAX_Y: u,
|
|
5516
5517
|
SELECTOR_AREA_MAX_X_OFFSET: g,
|
|
5517
5518
|
SELECTOR_AREA_MAX_Y_OFFSET: m
|
|
5518
|
-
} = this.ctx.config, w = d, E = f || this.ctx.maxColIndex - g,
|
|
5519
|
+
} = this.ctx.config, w = d, E = f || this.ctx.maxColIndex - g, p = x, C = u || this.ctx.maxRowIndex - m;
|
|
5519
5520
|
let [b, y] = r, [R, S] = a;
|
|
5520
|
-
if (b < w || R <
|
|
5521
|
+
if (b < w || R < p)
|
|
5521
5522
|
return;
|
|
5522
|
-
r = [Math.max(w, b), Math.min(E, y)], a = [Math.max(
|
|
5523
|
+
r = [Math.max(w, b), Math.min(E, y)], a = [Math.max(p, R), Math.min(C, S)];
|
|
5523
5524
|
const { BEFORE_SET_AUTOFILL_METHOD: O } = this.ctx.config;
|
|
5524
5525
|
if (typeof O == "function") {
|
|
5525
5526
|
const I = O({
|
|
@@ -5556,9 +5557,9 @@ class Xe {
|
|
|
5556
5557
|
let d = [];
|
|
5557
5558
|
for (let u = 0; u <= l[1] - l[0]; u++)
|
|
5558
5559
|
for (let g = 0; g <= a[1] - a[0]; g++) {
|
|
5559
|
-
const m = g + a[0], w = u + l[0], E = s[u % r][g % o],
|
|
5560
|
-
if (
|
|
5561
|
-
const { rowKey: b, key: y } =
|
|
5560
|
+
const m = g + a[0], w = u + l[0], E = s[u % r][g % o], p = this.ctx.database.getItemValueForRowIndexAndColIndex(w, m), C = `${w}-${m}`;
|
|
5561
|
+
if (p && !i.has(C)) {
|
|
5562
|
+
const { rowKey: b, key: y } = p;
|
|
5562
5563
|
this.ctx.database.getReadonly(b, y) || (t.add(b), d.push({
|
|
5563
5564
|
rowKey: b,
|
|
5564
5565
|
key: y,
|
|
@@ -5774,8 +5775,8 @@ const je = async (h, t, e) => {
|
|
|
5774
5775
|
name: w,
|
|
5775
5776
|
fn: E
|
|
5776
5777
|
} = a[m], {
|
|
5777
|
-
x:
|
|
5778
|
-
y:
|
|
5778
|
+
x: p,
|
|
5779
|
+
y: C,
|
|
5779
5780
|
data: b,
|
|
5780
5781
|
reset: y
|
|
5781
5782
|
} = await E({
|
|
@@ -5792,7 +5793,7 @@ const je = async (h, t, e) => {
|
|
|
5792
5793
|
floating: t
|
|
5793
5794
|
}
|
|
5794
5795
|
});
|
|
5795
|
-
d =
|
|
5796
|
+
d = p ?? d, f = C ?? f, u = {
|
|
5796
5797
|
...u,
|
|
5797
5798
|
[w]: {
|
|
5798
5799
|
...u[w],
|
|
@@ -5836,12 +5837,12 @@ async function ee(h, t) {
|
|
|
5836
5837
|
boundary: c,
|
|
5837
5838
|
rootBoundary: d,
|
|
5838
5839
|
strategy: l
|
|
5839
|
-
})),
|
|
5840
|
+
})), p = f === "floating" ? {
|
|
5840
5841
|
x: i,
|
|
5841
5842
|
y: s,
|
|
5842
5843
|
width: r.floating.width,
|
|
5843
5844
|
height: r.floating.height
|
|
5844
|
-
} : r.reference,
|
|
5845
|
+
} : 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)) || {
|
|
5845
5846
|
x: 1,
|
|
5846
5847
|
y: 1
|
|
5847
5848
|
} : {
|
|
@@ -5849,10 +5850,10 @@ async function ee(h, t) {
|
|
|
5849
5850
|
y: 1
|
|
5850
5851
|
}, y = ct(o.convertOffsetParentRelativeRectToViewportRelativeRect ? await o.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
5851
5852
|
elements: a,
|
|
5852
|
-
rect:
|
|
5853
|
-
offsetParent:
|
|
5853
|
+
rect: p,
|
|
5854
|
+
offsetParent: C,
|
|
5854
5855
|
strategy: l
|
|
5855
|
-
}) :
|
|
5856
|
+
}) : p);
|
|
5856
5857
|
return {
|
|
5857
5858
|
top: (E.top - y.top + g.top) / b.y,
|
|
5858
5859
|
bottom: (y.bottom - E.bottom + g.bottom) / b.y,
|
|
@@ -5881,10 +5882,10 @@ const qe = (h) => ({
|
|
|
5881
5882
|
const f = te(d), x = {
|
|
5882
5883
|
x: e,
|
|
5883
5884
|
y: i
|
|
5884
|
-
}, u = _t(s), g = Rt(u), m = await r.getDimensions(c), w = u === "y", E = w ? "top" : "left",
|
|
5885
|
-
let S = R ? R[
|
|
5886
|
-
(!S || !await (r.isElement == null ? void 0 : r.isElement(R))) && (S = a.floating[
|
|
5887
|
-
const O = b / 2 - y / 2, v = S / 2 - m[g] / 2 - 1, I = j(f[E], v), _ = j(f[
|
|
5885
|
+
}, u = _t(s), g = Rt(u), m = await r.getDimensions(c), w = u === "y", E = w ? "top" : "left", p = w ? "bottom" : "right", C = w ? "clientHeight" : "clientWidth", b = o.reference[g] + o.reference[u] - x[u] - o.floating[g], y = x[u] - o.reference[u], R = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(c));
|
|
5886
|
+
let S = R ? R[C] : 0;
|
|
5887
|
+
(!S || !await (r.isElement == null ? void 0 : r.isElement(R))) && (S = a.floating[C] || o.floating[g]);
|
|
5888
|
+
const O = b / 2 - y / 2, v = S / 2 - m[g] / 2 - 1, I = j(f[E], v), _ = j(f[p], v), T = I, M = S - m[g] - _, L = S / 2 - m[g] / 2 + O, A = Et(T, L, M), H = !l.arrow && et(s) != null && L !== A && o.reference[g] / 2 - (L < T ? I : _) - m[g] / 2 < 0, D = H ? L < T ? L - T : L - M : 0;
|
|
5888
5889
|
return {
|
|
5889
5890
|
[u]: x[u] + D,
|
|
5890
5891
|
data: {
|
|
@@ -5921,7 +5922,7 @@ const qe = (h) => ({
|
|
|
5921
5922
|
} = tt(h, t);
|
|
5922
5923
|
if ((e = o.arrow) != null && e.alignmentOffset)
|
|
5923
5924
|
return {};
|
|
5924
|
-
const E = $(s),
|
|
5925
|
+
const E = $(s), p = V(a), C = $(a) === a, b = await (l.isRTL == null ? void 0 : l.isRTL(c.floating)), y = x || (C || !m ? [lt(a)] : Ve(a)), R = g !== "none";
|
|
5925
5926
|
!x && R && y.push(...Ge(a, m, g, b));
|
|
5926
5927
|
const S = [a, ...y], O = await ee(t, w), v = [];
|
|
5927
5928
|
let I = ((i = o.flip) == null ? void 0 : i.overflows) || [];
|
|
@@ -5935,9 +5936,9 @@ const qe = (h) => ({
|
|
|
5935
5936
|
}], !v.every((L) => L <= 0)) {
|
|
5936
5937
|
var _, T;
|
|
5937
5938
|
const L = (((_ = o.flip) == null ? void 0 : _.index) || 0) + 1, A = S[L];
|
|
5938
|
-
if (A && (!(f === "alignment" ?
|
|
5939
|
+
if (A && (!(f === "alignment" ? p !== V(A) : !1) || // We leave the current main axis only if every placement on that axis
|
|
5939
5940
|
// overflows the main axis.
|
|
5940
|
-
I.every((k) => V(k.placement) ===
|
|
5941
|
+
I.every((k) => V(k.placement) === p ? k.overflows[0] > 0 : !0)))
|
|
5941
5942
|
return {
|
|
5942
5943
|
data: {
|
|
5943
5944
|
index: L,
|
|
@@ -5955,7 +5956,7 @@ const qe = (h) => ({
|
|
|
5955
5956
|
const D = (M = I.filter((k) => {
|
|
5956
5957
|
if (R) {
|
|
5957
5958
|
const W = V(k.placement);
|
|
5958
|
-
return W ===
|
|
5959
|
+
return W === p || // Create a bias to the `y` side axis due to horizontal
|
|
5959
5960
|
// reading directions favoring greater width.
|
|
5960
5961
|
W === "y";
|
|
5961
5962
|
}
|
|
@@ -6044,11 +6045,11 @@ const ti = function(h) {
|
|
|
6044
6045
|
fn: (w) => {
|
|
6045
6046
|
let {
|
|
6046
6047
|
x: E,
|
|
6047
|
-
y:
|
|
6048
|
+
y: p
|
|
6048
6049
|
} = w;
|
|
6049
6050
|
return {
|
|
6050
6051
|
x: E,
|
|
6051
|
-
y:
|
|
6052
|
+
y: p
|
|
6052
6053
|
};
|
|
6053
6054
|
}
|
|
6054
6055
|
},
|
|
@@ -6059,12 +6060,12 @@ const ti = function(h) {
|
|
|
6059
6060
|
}, d = await ee(t, l), f = V($(s)), x = Qt(f);
|
|
6060
6061
|
let u = c[x], g = c[f];
|
|
6061
6062
|
if (o) {
|
|
6062
|
-
const w = x === "y" ? "top" : "left", E = x === "y" ? "bottom" : "right",
|
|
6063
|
-
u = Et(
|
|
6063
|
+
const w = x === "y" ? "top" : "left", E = x === "y" ? "bottom" : "right", p = u + d[w], C = u - d[E];
|
|
6064
|
+
u = Et(p, u, C);
|
|
6064
6065
|
}
|
|
6065
6066
|
if (r) {
|
|
6066
|
-
const w = f === "y" ? "top" : "left", E = f === "y" ? "bottom" : "right",
|
|
6067
|
-
g = Et(
|
|
6067
|
+
const w = f === "y" ? "top" : "left", E = f === "y" ? "bottom" : "right", p = g + d[w], C = g - d[E];
|
|
6068
|
+
g = Et(p, g, C);
|
|
6068
6069
|
}
|
|
6069
6070
|
const m = a.fn({
|
|
6070
6071
|
...t,
|
|
@@ -6249,8 +6250,8 @@ function G(h, t, e, i) {
|
|
|
6249
6250
|
const x = N(o), u = i && B(i) ? N(i) : i;
|
|
6250
6251
|
let g = x, m = Ct(g);
|
|
6251
6252
|
for (; m && i && u !== g; ) {
|
|
6252
|
-
const w = U(m), E = m.getBoundingClientRect(),
|
|
6253
|
-
l *= w.x, c *= w.y, d *= w.x, f *= w.y, l +=
|
|
6253
|
+
const w = U(m), E = m.getBoundingClientRect(), p = X(m), C = E.left + (m.clientLeft + parseFloat(p.paddingLeft)) * w.x, b = E.top + (m.clientTop + parseFloat(p.paddingTop)) * w.y;
|
|
6254
|
+
l *= w.x, c *= w.y, d *= w.x, f *= w.y, l += C, c += b, g = N(m), m = Ct(g);
|
|
6254
6255
|
}
|
|
6255
6256
|
}
|
|
6256
6257
|
return ct({
|
|
@@ -6505,7 +6506,7 @@ function _i(h, t) {
|
|
|
6505
6506
|
} = c;
|
|
6506
6507
|
if (a || t(), !x || !u)
|
|
6507
6508
|
return;
|
|
6508
|
-
const g = st(f), m = st(s.clientWidth - (d + x)), w = st(s.clientHeight - (f + u)), E = st(d),
|
|
6509
|
+
const g = st(f), m = st(s.clientWidth - (d + x)), w = st(s.clientHeight - (f + u)), E = st(d), C = {
|
|
6509
6510
|
rootMargin: -g + "px " + -m + "px " + -w + "px " + -E + "px",
|
|
6510
6511
|
threshold: z(0, j(1, l)) || 1
|
|
6511
6512
|
};
|
|
@@ -6523,12 +6524,12 @@ function _i(h, t) {
|
|
|
6523
6524
|
}
|
|
6524
6525
|
try {
|
|
6525
6526
|
e = new IntersectionObserver(y, {
|
|
6526
|
-
...
|
|
6527
|
+
...C,
|
|
6527
6528
|
// Handle <iframe>s
|
|
6528
6529
|
root: s.ownerDocument
|
|
6529
6530
|
});
|
|
6530
6531
|
} catch {
|
|
6531
|
-
e = new IntersectionObserver(y,
|
|
6532
|
+
e = new IntersectionObserver(y, C);
|
|
6532
6533
|
}
|
|
6533
6534
|
e.observe(h);
|
|
6534
6535
|
}
|
|
@@ -6551,10 +6552,10 @@ function yt(h, t, e, i) {
|
|
|
6551
6552
|
const f = c && a ? _i(c, e) : null;
|
|
6552
6553
|
let x = -1, u = null;
|
|
6553
6554
|
r && (u = new ResizeObserver((E) => {
|
|
6554
|
-
let [
|
|
6555
|
-
|
|
6556
|
-
var
|
|
6557
|
-
(
|
|
6555
|
+
let [p] = E;
|
|
6556
|
+
p && p.target === c && u && (u.unobserve(t), cancelAnimationFrame(x), x = requestAnimationFrame(() => {
|
|
6557
|
+
var C;
|
|
6558
|
+
(C = u) == null || C.observe(t);
|
|
6558
6559
|
})), e();
|
|
6559
6560
|
}), c && !l && u.observe(c), u.observe(t));
|
|
6560
6561
|
let g, m = l ? G(h) : null;
|
|
@@ -6565,8 +6566,8 @@ function yt(h, t, e, i) {
|
|
|
6565
6566
|
}
|
|
6566
6567
|
return e(), () => {
|
|
6567
6568
|
var E;
|
|
6568
|
-
d.forEach((
|
|
6569
|
-
s &&
|
|
6569
|
+
d.forEach((p) => {
|
|
6570
|
+
s && p.removeEventListener("scroll", e), o && p.removeEventListener("resize", e);
|
|
6570
6571
|
}), f == null || f(), (E = u) == null || E.disconnect(), u = null, l && cancelAnimationFrame(g);
|
|
6571
6572
|
};
|
|
6572
6573
|
}
|
|
@@ -7420,12 +7421,12 @@ class Ai {
|
|
|
7420
7421
|
e.preventDefault();
|
|
7421
7422
|
const { xArr: x } = this.ctx.selector, [u, g] = x, { colIndex: m } = t;
|
|
7422
7423
|
m >= u && m <= g || (this.ctx.focusCellHeader = t, this.ctx.emit("selectCols", t)), this.currentDOMTreeMenu && this.currentDOMTreeMenu.destroy();
|
|
7423
|
-
const E = this.ctx.database.getColumns(),
|
|
7424
|
-
...
|
|
7424
|
+
const E = this.ctx.database.getColumns(), p = f.map((C) => C.value === "visible" ? {
|
|
7425
|
+
...C,
|
|
7425
7426
|
children: this.filterColumns(E)
|
|
7426
|
-
} :
|
|
7427
|
-
this.ctx.contextMenuIng = !0, this.currentDOMTreeMenu = new zt(this.contextMenuEl,
|
|
7428
|
-
onClick: (
|
|
7427
|
+
} : C);
|
|
7428
|
+
this.ctx.contextMenuIng = !0, this.currentDOMTreeMenu = new zt(this.contextMenuEl, p, {
|
|
7429
|
+
onClick: (C, b) => {
|
|
7429
7430
|
const { xArr: y } = this.ctx.selector, [R, S] = y;
|
|
7430
7431
|
if (b === "fixedLeft" || b === "fixedRight" || b === "fixedNone") {
|
|
7431
7432
|
const O = this.ctx.header.allCellHeaders.filter((v) => v.colIndex >= R && v.colIndex <= S).filter((v) => v.level === 0).filter((v) => !v.column.fixedDisabled).map((v) => v.key);
|
|
@@ -7437,12 +7438,12 @@ class Ai {
|
|
|
7437
7438
|
const O = this.ctx.header.leafCellHeaders.filter((v) => v.colIndex >= R && v.colIndex <= S).filter((v) => !v.children.length).filter((v) => !v.column.hideDisabled).map((v) => v.key);
|
|
7438
7439
|
O.length > 0 && this.ctx.database.setCustomHeaderHideData(O, !0), this.hide();
|
|
7439
7440
|
} else if (b !== "visible") if (b.startsWith("visible_")) {
|
|
7440
|
-
if (!
|
|
7441
|
-
if (
|
|
7442
|
-
const _ = this.getLeafKeys(
|
|
7441
|
+
if (!C.key) return;
|
|
7442
|
+
if (C.children) {
|
|
7443
|
+
const _ = this.getLeafKeys(C.children);
|
|
7443
7444
|
this.ctx.database.setCustomHeaderHideData(_, !1);
|
|
7444
7445
|
} else
|
|
7445
|
-
this.ctx.database.setCustomHeaderHideData([
|
|
7446
|
+
this.ctx.database.setCustomHeaderHideData([C.key], !1);
|
|
7446
7447
|
this.currentDOMTreeMenu && this.currentDOMTreeMenu.removeSubMenuItem(b);
|
|
7447
7448
|
const O = this.ctx.database.getColumns();
|
|
7448
7449
|
J(O).filter((_) => _.hide).length === 0 && this.hide();
|