e-virt-table 1.3.7 → 1.3.9
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 +4 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +255 -249
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +4 -4
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/Config.d.ts +0 -2
- package/dist/lib/Config.js +0 -7
- package/dist/lib/Config.js.map +1 -1
- package/dist/lib/Context.d.ts +0 -1
- package/dist/lib/Context.js +0 -6
- package/dist/lib/Context.js.map +1 -1
- package/dist/lib/Database.d.ts +1 -0
- package/dist/lib/Database.js +3 -0
- package/dist/lib/Database.js.map +1 -1
- package/dist/lib/EVirtTable.d.ts +1 -0
- package/dist/lib/EVirtTable.js +10 -11
- package/dist/lib/EVirtTable.js.map +1 -1
- package/dist/lib/Editor.js +14 -14
- package/dist/lib/Editor.js.map +1 -1
- package/dist/lib/EventTable.js +1 -1
- package/dist/lib/EventTable.js.map +1 -1
- package/dist/lib/Header.d.ts +1 -1
- package/dist/lib/Header.js +10 -9
- package/dist/lib/Header.js.map +1 -1
- package/dist/lib/Overlayer.d.ts +2 -1
- package/dist/lib/Overlayer.js +45 -10
- package/dist/lib/Overlayer.js.map +1 -1
- package/dist/lib/Selector.js +3 -8
- package/dist/lib/Selector.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -66,7 +66,7 @@ function zt() {
|
|
|
66
66
|
return (h === "x" ? t : t & 3 | 8).toString(16);
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function yt(h, t) {
|
|
70
70
|
let e = 0, i;
|
|
71
71
|
return function(...s) {
|
|
72
72
|
const o = (/* @__PURE__ */ new Date()).getTime(), r = o - e, a = typeof t == "function" ? t() : t;
|
|
@@ -75,8 +75,8 @@ function J(h, t) {
|
|
|
75
75
|
}, a - r));
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
return h.length ? h.map((t) =>
|
|
78
|
+
function ot(h = []) {
|
|
79
|
+
return h.length ? h.map((t) => ot(t.children) + 1).sort((t, e) => e - t)[0] : 0;
|
|
80
80
|
}
|
|
81
81
|
function ue(h = []) {
|
|
82
82
|
let t = [], e = [], i = [];
|
|
@@ -88,14 +88,14 @@ function ue(h = []) {
|
|
|
88
88
|
...i.sort((s, o) => (s.sort ?? 0) - (o.sort ?? 0))
|
|
89
89
|
];
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function rt(h = [], t = 1, e = 0, i = "") {
|
|
92
92
|
return h.sort((s, o) => (s.sort ?? 0) - (o.sort ?? 0)).map((s) => {
|
|
93
93
|
if (s.children) {
|
|
94
94
|
let o = 0, r = s.fixed;
|
|
95
95
|
s.children.forEach((l) => {
|
|
96
96
|
l.fixed = r;
|
|
97
97
|
});
|
|
98
|
-
const a =
|
|
98
|
+
const a = rt(s.children, t - 1, e + 1, s.key);
|
|
99
99
|
return a && a.forEach((l) => {
|
|
100
100
|
o += l.colspan ?? 0;
|
|
101
101
|
}), {
|
|
@@ -117,10 +117,10 @@ function nt(h = [], t = 1, e = 0, i = "") {
|
|
|
117
117
|
};
|
|
118
118
|
});
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function J(h = []) {
|
|
121
121
|
let t = [];
|
|
122
122
|
return h.forEach((e) => {
|
|
123
|
-
e.children ? t = t.concat(
|
|
123
|
+
e.children ? t = t.concat(J(e.children)) : t.push(e);
|
|
124
124
|
}), t;
|
|
125
125
|
}
|
|
126
126
|
function $t(h) {
|
|
@@ -607,14 +607,14 @@ class bt extends jt {
|
|
|
607
607
|
if (this.cellType === "footer") {
|
|
608
608
|
let _ = c, S = l;
|
|
609
609
|
if (typeof o == "function") {
|
|
610
|
-
const
|
|
610
|
+
const R = o, { backgroundColor: I, color: T, font: O } = R({
|
|
611
611
|
row: this.row,
|
|
612
612
|
rowIndex: this.rowIndex,
|
|
613
613
|
colIndex: this.colIndex,
|
|
614
614
|
column: this.column,
|
|
615
615
|
value: this.getValue()
|
|
616
616
|
}) || {};
|
|
617
|
-
|
|
617
|
+
I && (_ = I), T && (S = T), O && (this.drawTextFont = O);
|
|
618
618
|
}
|
|
619
619
|
this.drawCellSkyBgColor = "transparent", this.drawCellBgColor = _, this.drawTextColor = S;
|
|
620
620
|
return;
|
|
@@ -629,7 +629,7 @@ class bt extends jt {
|
|
|
629
629
|
x && E && (E.rowKey === this.rowKey && (w = u), E.rowIndex >= C && E.rowIndex <= b && (w = u)), d && p && (p.rowKey === this.rowKey && (w = f), p.rowIndex >= C && p.rowIndex <= b && (w = f)), this.drawCellSkyBgColor = w;
|
|
630
630
|
let y = e, v = a;
|
|
631
631
|
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (y = i, v = r), g && (this.rowIndex % 2 ? y = m : y = e), typeof s == "function") {
|
|
632
|
-
const _ = s, { backgroundColor: S, color:
|
|
632
|
+
const _ = s, { backgroundColor: S, color: R, font: I } = _({
|
|
633
633
|
row: this.row,
|
|
634
634
|
rowIndex: this.rowIndex,
|
|
635
635
|
colIndex: this.colIndex,
|
|
@@ -637,7 +637,7 @@ class bt extends jt {
|
|
|
637
637
|
isHasChanged: this.isHasChanged,
|
|
638
638
|
value: this.getValue()
|
|
639
639
|
}) || {};
|
|
640
|
-
S && (y = S),
|
|
640
|
+
S && (y = S), R && (v = R), I && (this.drawTextFont = I);
|
|
641
641
|
}
|
|
642
642
|
this.drawCellBgColor = y, this.drawTextColor = v;
|
|
643
643
|
}
|
|
@@ -1052,7 +1052,7 @@ class ye {
|
|
|
1052
1052
|
// 初始化默认不忽略清空改变值和校验map
|
|
1053
1053
|
init(t = !0) {
|
|
1054
1054
|
this.ctx.paint.clearTextCache(), this.clearBufferData(), this.rowKeyMap.clear(), this.checkboxKeyMap.clear(), this.colIndexKeyMap.clear(), this.rowIndexRowKeyMap.clear(), this.rowKeyRowIndexMap.clear(), this.maxRowHeightMap.clear();
|
|
1055
|
-
const e = this.getColumns(), i =
|
|
1055
|
+
const e = this.getColumns(), i = J(e);
|
|
1056
1056
|
if (this.ctx.hasSelection = i.some((s) => s.type === "selection"), this.ctx.hasTree = i.some((s) => s.type === "tree"), t) {
|
|
1057
1057
|
this.originalDataMap.clear(), this.changedDataMap.clear(), this.validationErrorMap.clear();
|
|
1058
1058
|
const { ROW_KEY: s } = this.ctx.config;
|
|
@@ -2005,38 +2005,38 @@ class ye {
|
|
|
2005
2005
|
let w = e, E = e, p = a, C = a, b = [], y = 0, v = 0, _ = 0, S = 0;
|
|
2006
2006
|
if (d !== 1 && g) {
|
|
2007
2007
|
S = x;
|
|
2008
|
-
const
|
|
2008
|
+
const R = l.reduce((I, T) => {
|
|
2009
2009
|
const O = this.getItemValue(s, T) ?? "";
|
|
2010
|
-
return `${
|
|
2010
|
+
return `${I}${O}`;
|
|
2011
2011
|
}, "");
|
|
2012
|
-
for (let
|
|
2013
|
-
const T = this.rowIndexRowKeyMap.get(
|
|
2012
|
+
for (let I = e - 1; I >= 0; I--) {
|
|
2013
|
+
const T = this.rowIndexRowKeyMap.get(I) || "", O = l.reduce((M, L) => {
|
|
2014
2014
|
const A = this.getItemValue(T, L) ?? "";
|
|
2015
2015
|
return `${M}${A}`;
|
|
2016
2016
|
}, "");
|
|
2017
|
-
if (
|
|
2018
|
-
w =
|
|
2017
|
+
if (R === O)
|
|
2018
|
+
w = I;
|
|
2019
2019
|
else
|
|
2020
2020
|
break;
|
|
2021
2021
|
}
|
|
2022
|
-
for (let
|
|
2023
|
-
const T = this.rowIndexRowKeyMap.get(
|
|
2022
|
+
for (let I = e; I <= this.ctx.maxRowIndex; I++) {
|
|
2023
|
+
const T = this.rowIndexRowKeyMap.get(I) || "", O = l.reduce((M, L) => {
|
|
2024
2024
|
const A = this.getItemValue(T, L) ?? "";
|
|
2025
2025
|
return `${M}${A}`;
|
|
2026
2026
|
}, "");
|
|
2027
|
-
if (
|
|
2028
|
-
E =
|
|
2027
|
+
if (R === O)
|
|
2028
|
+
E = I;
|
|
2029
2029
|
else
|
|
2030
2030
|
break;
|
|
2031
2031
|
}
|
|
2032
|
-
for (let
|
|
2033
|
-
const { height: T } = this.positions[
|
|
2032
|
+
for (let I = w; I < e; I++) {
|
|
2033
|
+
const { height: T } = this.positions[I];
|
|
2034
2034
|
y += T;
|
|
2035
2035
|
}
|
|
2036
|
-
for (let
|
|
2037
|
-
const { height: T } = this.positions[
|
|
2036
|
+
for (let I = w; I <= E; I++) {
|
|
2037
|
+
const { height: T } = this.positions[I];
|
|
2038
2038
|
_ += T;
|
|
2039
|
-
const O = this.rowIndexRowKeyMap.get(
|
|
2039
|
+
const O = this.rowIndexRowKeyMap.get(I) || "", { item: M } = this.rowKeyMap.get(O), L = this.getItemValue(O, i);
|
|
2040
2040
|
b.push({
|
|
2041
2041
|
rowKey: O,
|
|
2042
2042
|
key: i,
|
|
@@ -2047,40 +2047,40 @@ class ye {
|
|
|
2047
2047
|
}
|
|
2048
2048
|
if (u !== 1 && m) {
|
|
2049
2049
|
_ = f;
|
|
2050
|
-
for (let
|
|
2051
|
-
const
|
|
2052
|
-
if (!
|
|
2050
|
+
for (let R = a - 1; R >= 0; R--) {
|
|
2051
|
+
const I = this.getColumnByColIndex(R);
|
|
2052
|
+
if (!I)
|
|
2053
2053
|
break;
|
|
2054
|
-
const T = this.getItemValue(s, i), O = this.getItemValue(s,
|
|
2055
|
-
if (T === O && c.includes(
|
|
2056
|
-
p =
|
|
2054
|
+
const T = this.getItemValue(s, i), O = this.getItemValue(s, I.key);
|
|
2055
|
+
if (T === O && c.includes(I.key))
|
|
2056
|
+
p = R;
|
|
2057
2057
|
else
|
|
2058
2058
|
break;
|
|
2059
2059
|
}
|
|
2060
|
-
for (let
|
|
2061
|
-
const
|
|
2062
|
-
if (!
|
|
2060
|
+
for (let R = a; R <= this.ctx.maxColIndex; R++) {
|
|
2061
|
+
const I = this.getColumnByColIndex(R);
|
|
2062
|
+
if (!I)
|
|
2063
2063
|
break;
|
|
2064
|
-
const T = this.getItemValue(s, i), O = this.getItemValue(s,
|
|
2065
|
-
if (T === O && c.includes(
|
|
2066
|
-
C =
|
|
2064
|
+
const T = this.getItemValue(s, i), O = this.getItemValue(s, I.key);
|
|
2065
|
+
if (T === O && c.includes(I.key))
|
|
2066
|
+
C = R;
|
|
2067
2067
|
else
|
|
2068
2068
|
break;
|
|
2069
2069
|
}
|
|
2070
|
-
for (let
|
|
2071
|
-
const
|
|
2072
|
-
if (!
|
|
2070
|
+
for (let R = p; R < a; R++) {
|
|
2071
|
+
const I = this.getColumnByColIndex(R);
|
|
2072
|
+
if (!I)
|
|
2073
2073
|
break;
|
|
2074
|
-
v +=
|
|
2074
|
+
v += I.width || 100;
|
|
2075
2075
|
}
|
|
2076
|
-
for (let
|
|
2077
|
-
const
|
|
2078
|
-
if (!
|
|
2076
|
+
for (let R = p; R <= C; R++) {
|
|
2077
|
+
const I = this.getColumnByColIndex(R);
|
|
2078
|
+
if (!I)
|
|
2079
2079
|
break;
|
|
2080
|
-
S +=
|
|
2080
|
+
S += I.width || 100, b.push({
|
|
2081
2081
|
rowKey: s,
|
|
2082
|
-
key:
|
|
2083
|
-
value: this.getItemValue(s,
|
|
2082
|
+
key: I.key,
|
|
2083
|
+
value: this.getItemValue(s, I.key),
|
|
2084
2084
|
row: o
|
|
2085
2085
|
});
|
|
2086
2086
|
}
|
|
@@ -2229,6 +2229,9 @@ class ye {
|
|
|
2229
2229
|
let i = {};
|
|
2230
2230
|
return e(t, i), i;
|
|
2231
2231
|
}
|
|
2232
|
+
clearChangeData() {
|
|
2233
|
+
this.changedDataMap.clear();
|
|
2234
|
+
}
|
|
2232
2235
|
}
|
|
2233
2236
|
class be {
|
|
2234
2237
|
constructor(t) {
|
|
@@ -2285,7 +2288,7 @@ class be {
|
|
|
2285
2288
|
this.history = [], this.historyIndex = -1;
|
|
2286
2289
|
}
|
|
2287
2290
|
}
|
|
2288
|
-
class
|
|
2291
|
+
class Re {
|
|
2289
2292
|
constructor(t) {
|
|
2290
2293
|
n(this, "eventTasks", /* @__PURE__ */ new Set());
|
|
2291
2294
|
n(this, "ctx");
|
|
@@ -2367,7 +2370,7 @@ class Ie {
|
|
|
2367
2370
|
}
|
|
2368
2371
|
}
|
|
2369
2372
|
}
|
|
2370
|
-
class
|
|
2373
|
+
class Ie {
|
|
2371
2374
|
constructor() {
|
|
2372
2375
|
n(this, "events", /* @__PURE__ */ new Map());
|
|
2373
2376
|
}
|
|
@@ -2501,7 +2504,7 @@ class ve {
|
|
|
2501
2504
|
* @returns 是否溢出
|
|
2502
2505
|
*/
|
|
2503
2506
|
drawText(t = "", e, i, s, o, r = {}) {
|
|
2504
|
-
var
|
|
2507
|
+
var I;
|
|
2505
2508
|
this.ctx.save();
|
|
2506
2509
|
const {
|
|
2507
2510
|
font: a = "12px Arial",
|
|
@@ -2516,7 +2519,7 @@ class ve {
|
|
|
2516
2519
|
} = r;
|
|
2517
2520
|
if (this.ctx.font = a, this.ctx.fillStyle = c, this.ctx.textAlign = l, ["", null, void 0].includes(t))
|
|
2518
2521
|
return this.ctx.restore(), !1;
|
|
2519
|
-
const E = parseInt(((
|
|
2522
|
+
const E = parseInt(((I = a.match(/\d+/)) == null ? void 0 : I[0]) || "12") * (r.lineHeight || 1.2), p = s - d * 2 - g - m;
|
|
2520
2523
|
let C = !1;
|
|
2521
2524
|
const b = Math.round((o - 2 * d) / E);
|
|
2522
2525
|
let y = this.wrapText(t, p, r.cacheTextKey), v = Math.min(y.length, Math.max(b, 1));
|
|
@@ -2524,23 +2527,23 @@ class ve {
|
|
|
2524
2527
|
let _ = i + d;
|
|
2525
2528
|
const S = Math.round(v * E);
|
|
2526
2529
|
f === "middle" ? _ = i + (o - S) / 2 : f === "bottom" && (_ = i + o - S - d);
|
|
2527
|
-
let
|
|
2528
|
-
l === "center" ?
|
|
2530
|
+
let R = e + d + g;
|
|
2531
|
+
l === "center" ? R = e + s / 2 : l === "right" && (R = e + s - d - m);
|
|
2529
2532
|
for (let T = 0; T < y.length; T++) {
|
|
2530
2533
|
const O = y[T], M = _ + T * E;
|
|
2531
2534
|
if (this.ctx.textBaseline = "top", T === v - 1) {
|
|
2532
2535
|
const A = y.slice(T).join(""), { _text: D, ellipsis: H } = this.handleEllipsis(A, s, d, a);
|
|
2533
|
-
this.ctx.fillText(D,
|
|
2536
|
+
this.ctx.fillText(D, R, M), C = H;
|
|
2534
2537
|
break;
|
|
2535
2538
|
}
|
|
2536
|
-
this.ctx.fillText(O,
|
|
2539
|
+
this.ctx.fillText(O, R, M);
|
|
2537
2540
|
}
|
|
2538
2541
|
if (r.textCallback && y.length) {
|
|
2539
2542
|
const T = y.reduce((D, H) => Math.max(D, this.ctx.measureText(H).width), 0), O = Math.round(T);
|
|
2540
|
-
let M =
|
|
2541
|
-
l === "center" ? (M =
|
|
2543
|
+
let M = R, L = R + O;
|
|
2544
|
+
l === "center" ? (M = R - O / 2, L = R + O / 2) : l === "right" && (M = R - O, L = R);
|
|
2542
2545
|
const A = {
|
|
2543
|
-
x:
|
|
2546
|
+
x: R,
|
|
2544
2547
|
y: _,
|
|
2545
2548
|
width: O,
|
|
2546
2549
|
height: S,
|
|
@@ -2638,8 +2641,6 @@ class Dt {
|
|
|
2638
2641
|
n(this, "_config", {});
|
|
2639
2642
|
/** CSS 类名前缀 */
|
|
2640
2643
|
n(this, "CSS_PREFIX", "e-virt-table");
|
|
2641
|
-
/** 绘制时间 */
|
|
2642
|
-
n(this, "DRAW_TIME_MULTIPLIER", 2);
|
|
2643
2644
|
/** 图标集合 */
|
|
2644
2645
|
n(this, "ICONS", []);
|
|
2645
2646
|
/** 行的唯一标识键 */
|
|
@@ -2992,7 +2993,7 @@ class Dt {
|
|
|
2992
2993
|
}), Object.assign(this, t, this._config);
|
|
2993
2994
|
}
|
|
2994
2995
|
}
|
|
2995
|
-
const qt = '<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>', Nt = '<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>', kt = '<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>',
|
|
2996
|
+
const qt = '<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>', Nt = '<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>', kt = '<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>', _e = Rt.replace('fill="currentColor" p-id="2016"', 'fill="#bec4c7" p-id="2016"'), Se = Rt.replace('fill="currentColor" p-id="2015"', 'fill="#bec4c7" p-id="2015"');
|
|
2996
2997
|
class Te {
|
|
2997
2998
|
constructor(t) {
|
|
2998
2999
|
n(this, "ctx");
|
|
@@ -3083,7 +3084,7 @@ class Te {
|
|
|
3083
3084
|
{
|
|
3084
3085
|
name: "sort-default",
|
|
3085
3086
|
configName: "SORTABLE_ICON_SVG",
|
|
3086
|
-
svg:
|
|
3087
|
+
svg: Rt,
|
|
3087
3088
|
color: "#bec4c7"
|
|
3088
3089
|
}
|
|
3089
3090
|
]);
|
|
@@ -3146,7 +3147,7 @@ class Te {
|
|
|
3146
3147
|
return this.list.find((e) => e.name === t);
|
|
3147
3148
|
}
|
|
3148
3149
|
}
|
|
3149
|
-
class
|
|
3150
|
+
class wt extends jt {
|
|
3150
3151
|
constructor(e, i, s, o, r, a, l) {
|
|
3151
3152
|
super(e, s, o, r, a, "header", l.fixed);
|
|
3152
3153
|
n(this, "align");
|
|
@@ -3449,7 +3450,7 @@ class Oe {
|
|
|
3449
3450
|
!0
|
|
3450
3451
|
), this.handleBodyEvent(i, e, this.ctx.body.renderRows, (s) => {
|
|
3451
3452
|
var o;
|
|
3452
|
-
this.imageEnterAndLeave(s, t), this.ctx.emit("cellMouseenter", s, t), this.ctx.hoverCell && this.ctx.hoverCell !== s && this.ctx.emit("cellMouseleave", s, t), this.ctx.hoverCell !== s && (((o = this.ctx.hoverCell) == null ? void 0 : o.rowKey) !== s.rowKey && (this.ctx.hoverCell = s, this.ctx.hoverRow = this.ctx.body.renderRows.find((r) => r.rowKey === s.rowKey), this.ctx.emit("rowHoverChange", this.ctx.hoverRow, s, t), this.ctx.emit("
|
|
3453
|
+
this.imageEnterAndLeave(s, t), this.ctx.emit("cellMouseenter", s, t), this.ctx.hoverCell && this.ctx.hoverCell !== s && this.ctx.emit("cellMouseleave", s, t), this.ctx.hoverCell !== s && (((o = this.ctx.hoverCell) == null ? void 0 : o.rowKey) !== s.rowKey && (this.ctx.hoverCell = s, this.ctx.hoverRow = this.ctx.body.renderRows.find((r) => r.rowKey === s.rowKey), this.ctx.emit("rowHoverChange", this.ctx.hoverRow, s, t), this.ctx.emit("draw")), this.ctx.hoverCell = s, this.ctx.emit("cellHoverChange", s, t));
|
|
3453
3454
|
}), this.handleFooterEvent(i, e, this.ctx.footer.renderRows, (s) => {
|
|
3454
3455
|
this.ctx.emit("cellFooterMouseenter", s, t), this.ctx.hoverCell && this.ctx.hoverCell !== s && this.ctx.emit("cellFooterMouseleave", s, t), this.ctx.emit("cellFooterHoverChange", s, t);
|
|
3455
3456
|
});
|
|
@@ -3474,7 +3475,7 @@ class Oe {
|
|
|
3474
3475
|
t.drawSelectionImageWidth,
|
|
3475
3476
|
t.drawSelectionImageHeight
|
|
3476
3477
|
))
|
|
3477
|
-
if (t instanceof
|
|
3478
|
+
if (t instanceof wt)
|
|
3478
3479
|
t.drawSelectionImageName === "checkbox-uncheck" || t.drawSelectionImageName === "checkbox-indeterminate" ? this.ctx.database.toggleAllSelection() : t.drawSelectionImageName === "checkbox-check" && this.ctx.database.clearSelection(!0);
|
|
3479
3480
|
else {
|
|
3480
3481
|
if (!this.ctx.database.getRowSelectable(t.rowKey))
|
|
@@ -3539,7 +3540,7 @@ class Oe {
|
|
|
3539
3540
|
*/
|
|
3540
3541
|
imageEnterAndLeave(t, e) {
|
|
3541
3542
|
const { offsetY: i, offsetX: s } = this.ctx.getOffset(e), o = i, r = s;
|
|
3542
|
-
if (t instanceof
|
|
3543
|
+
if (t instanceof wt) {
|
|
3543
3544
|
if (t.drawSelectionImageSource && this.isInsideElement(
|
|
3544
3545
|
r,
|
|
3545
3546
|
o,
|
|
@@ -3789,7 +3790,6 @@ class Le {
|
|
|
3789
3790
|
n(this, "database");
|
|
3790
3791
|
n(this, "history");
|
|
3791
3792
|
n(this, "config");
|
|
3792
|
-
n(this, "drawTime", 0);
|
|
3793
3793
|
const {
|
|
3794
3794
|
containerElement: i,
|
|
3795
3795
|
stageElement: s,
|
|
@@ -3800,7 +3800,7 @@ class Le {
|
|
|
3800
3800
|
loadingElement: c,
|
|
3801
3801
|
contextMenuElement: d
|
|
3802
3802
|
} = t;
|
|
3803
|
-
this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = o, this.overlayerElement = r, this.editorElement = a, this.emptyElement = l, this.loadingElement = c, this.contextMenuElement = d, this.config = new Dt(e.config || {}), this.eventBus = new
|
|
3803
|
+
this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = o, this.overlayerElement = r, this.editorElement = a, this.emptyElement = l, this.loadingElement = c, this.contextMenuElement = d, this.config = new Dt(e.config || {}), this.eventBus = new Ie(), this.eventBrowser = new Re(this), this.eventTable = new Oe(this), this.paint = new ve(this.canvasElement), this.database = new ye(this, e), this.history = new be(this), this.icons = new Te(this);
|
|
3804
3804
|
}
|
|
3805
3805
|
setConfig(t) {
|
|
3806
3806
|
this.config = new Dt(t);
|
|
@@ -4257,28 +4257,32 @@ class He {
|
|
|
4257
4257
|
n(this, "renderFixedCellHeaders", []);
|
|
4258
4258
|
this.ctx = t, this.ctx.on(
|
|
4259
4259
|
"resetHeader",
|
|
4260
|
-
|
|
4260
|
+
yt(() => {
|
|
4261
4261
|
this.init(), this.ctx.clearSelector(), this.ctx.emit("draw");
|
|
4262
4262
|
}, 100)
|
|
4263
4263
|
), this.init(), this.initResizeColumn(), this.initDragColumn();
|
|
4264
4264
|
}
|
|
4265
|
-
init() {
|
|
4265
|
+
init(t = !1) {
|
|
4266
4266
|
const {
|
|
4267
|
-
config: { HEADER_HEIGHT:
|
|
4268
|
-
} = this.ctx
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4267
|
+
config: { HEADER_HEIGHT: e, SCROLLER_TRACK_SIZE: i }
|
|
4268
|
+
} = this.ctx;
|
|
4269
|
+
if (!t) {
|
|
4270
|
+
const f = this.ctx.database.getColumns();
|
|
4271
|
+
this.columns = f;
|
|
4272
|
+
}
|
|
4273
|
+
this.allCellHeaders = [], this.leafCellHeaders = [], this.fixedLeftCellHeaders = [], this.fixedRightCellHeaders = [], this.centerCellHeaders = [], this.visibleHeight = this.height, this.visibleColumns = $t(this.columns);
|
|
4274
|
+
const s = ot(this.visibleColumns), o = J(this.visibleColumns);
|
|
4275
|
+
this.height = e * s, this.width = o.reduce((f, x) => {
|
|
4272
4276
|
const u = x.width || 100, { maxWidth: g, minWidth: m } = x;
|
|
4273
4277
|
return g && u > g ? f + g : m && u < m ? f + m : f + u;
|
|
4274
4278
|
}, 0), this.columnIndex = 0, this.resizeNum = 0;
|
|
4275
|
-
const r = ue(
|
|
4279
|
+
const r = ue(rt(this.visibleColumns, s));
|
|
4276
4280
|
this.render(r, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
|
|
4277
4281
|
const a = this.ctx.containerElement.getBoundingClientRect();
|
|
4278
4282
|
this.resizeNum > 0 ? this.ctx.stageWidth = Math.floor(a.width) : this.ctx.stageWidth = Math.min(
|
|
4279
|
-
Math.floor(this.width +
|
|
4283
|
+
Math.floor(this.width + i),
|
|
4280
4284
|
Math.floor(a.width)
|
|
4281
|
-
), this.ctx.stageElement.style.width = this.ctx.stageWidth + "px", this.visibleWidth = this.ctx.stageWidth -
|
|
4285
|
+
), this.ctx.stageElement.style.width = this.ctx.stageWidth + "px", this.visibleWidth = this.ctx.stageWidth - i;
|
|
4282
4286
|
const l = this.visibleWidth - this.width;
|
|
4283
4287
|
if (this.resizeNum && l > 0) {
|
|
4284
4288
|
const f = Math.floor(l / this.resizeNum * 100) / 100;
|
|
@@ -4287,7 +4291,7 @@ class He {
|
|
|
4287
4291
|
const c = this.fixedLeftCellHeaders.filter((f) => !f.hasChildren);
|
|
4288
4292
|
this.ctx.fixedLeftWidth = c.reduce((f, x) => f + x.width, 0);
|
|
4289
4293
|
const d = this.fixedRightCellHeaders.filter((f) => !f.hasChildren);
|
|
4290
|
-
this.ctx.fixedRightWidth = d.reduce((f, x) => f + x.width,
|
|
4294
|
+
this.ctx.fixedRightWidth = d.reduce((f, x) => f + x.width, i), this.ctx.maxColIndex = this.leafCellHeaders.length - 1, this.ctx.header.x = this.x, this.ctx.header.y = this.y, this.ctx.header.width = this.width, this.ctx.header.height = this.height, this.ctx.header.allCellHeaders = this.allCellHeaders, this.ctx.header.visibleWidth = this.visibleWidth, this.ctx.header.visibleHeight = this.visibleHeight;
|
|
4291
4295
|
}
|
|
4292
4296
|
// 调整表头的宽度
|
|
4293
4297
|
initResizeColumn() {
|
|
@@ -4337,7 +4341,7 @@ class He {
|
|
|
4337
4341
|
if (this.dragingCell && this.dragTarget) {
|
|
4338
4342
|
const t = (c, d = {}) => (c.forEach((f, x) => {
|
|
4339
4343
|
f.children && t(f.children, d), d[f.key] = x;
|
|
4340
|
-
}), d), e = this.ctx.database.getColumns(), i =
|
|
4344
|
+
}), d), e = this.ctx.database.getColumns(), i = rt(e, ot(e)), s = new Ae(i, {
|
|
4341
4345
|
key: "key",
|
|
4342
4346
|
// 节点唯一标识字段(对应我们之前的field)
|
|
4343
4347
|
childrenKey: "children"
|
|
@@ -4389,7 +4393,7 @@ class He {
|
|
|
4389
4393
|
}
|
|
4390
4394
|
});
|
|
4391
4395
|
};
|
|
4392
|
-
i(this.columns)
|
|
4396
|
+
i(this.columns);
|
|
4393
4397
|
let s = 0;
|
|
4394
4398
|
if (this.width < this.visibleWidth) {
|
|
4395
4399
|
const r = this.visibleWidth - this.width;
|
|
@@ -4403,7 +4407,7 @@ class He {
|
|
|
4403
4407
|
width: o,
|
|
4404
4408
|
column: t.column,
|
|
4405
4409
|
columns: this.columns
|
|
4406
|
-
}), this.ctx.database.setCustomHeaderResizableData(t.key, o), this.init(), this.ctx.emit("draw");
|
|
4410
|
+
}), this.ctx.database.setCustomHeaderResizableData(t.key, o), this.init(!0), this.ctx.emit("draw");
|
|
4407
4411
|
}
|
|
4408
4412
|
resizeAllColumn(t) {
|
|
4409
4413
|
if (t === 0) return;
|
|
@@ -4423,7 +4427,7 @@ class He {
|
|
|
4423
4427
|
e.has(r.key) && (r.width = e.get(r.key)), r.children && r.children.length > 0 && s(r.children);
|
|
4424
4428
|
});
|
|
4425
4429
|
};
|
|
4426
|
-
s(this.columns), this.
|
|
4430
|
+
s(this.columns), this.init(!0), this.ctx.emit("draw");
|
|
4427
4431
|
}
|
|
4428
4432
|
getCustomHeader() {
|
|
4429
4433
|
const t = this.ctx.database.getColumns(), e = this.ctx.database.getCustomHeader(), { sortData: i = {} } = e;
|
|
@@ -4431,7 +4435,7 @@ class He {
|
|
|
4431
4435
|
columns: t,
|
|
4432
4436
|
customHeader: e
|
|
4433
4437
|
} : {
|
|
4434
|
-
columns:
|
|
4438
|
+
columns: rt(t, ot(t)),
|
|
4435
4439
|
customHeader: e
|
|
4436
4440
|
};
|
|
4437
4441
|
}
|
|
@@ -4442,8 +4446,8 @@ class He {
|
|
|
4442
4446
|
for (let r = 0; r < i; r++) {
|
|
4443
4447
|
const a = t[r], l = o * (a.rowspan || 0), c = o * (a.level || 0);
|
|
4444
4448
|
let { minWidth: d, maxWidth: f } = a, x = a.width || 100;
|
|
4445
|
-
d && x < d && (x = d), f && x > f && (x = f), a.children && (x =
|
|
4446
|
-
const u = new
|
|
4449
|
+
d && x < d && (x = d), f && x > f && (x = f), a.children && (x = J(a.children).reduce((m, w) => m + ((w == null ? void 0 : w.width) || 100), 0));
|
|
4450
|
+
const u = new wt(this.ctx, this.columnIndex, s, c, x, l, a);
|
|
4447
4451
|
this.ctx.database.setHeader(a.key, u), this.allCellHeaders.push(u), a.children || (this.leafCellHeaders.push(u), u.column.widthFillDisable || this.resizeNum++), a.fixed === "left" ? this.fixedLeftCellHeaders.push(u) : a.fixed === "right" ? this.fixedRightCellHeaders.push(u) : this.centerCellHeaders.push(u), !a.children && this.columnIndex++, a.children && this.render(a.children, s), s += x;
|
|
4448
4452
|
}
|
|
4449
4453
|
}
|
|
@@ -4697,8 +4701,8 @@ class De {
|
|
|
4697
4701
|
width: this.width,
|
|
4698
4702
|
height: this.data.length ? 0 : l + m
|
|
4699
4703
|
});
|
|
4700
|
-
const
|
|
4701
|
-
this.ctx.canvasElement.setAttribute("style", `height:${
|
|
4704
|
+
const R = Math.round(t.width / y * 1e4) / 1e4, I = Math.round(t.height / y * 1e4) / 1e4;
|
|
4705
|
+
this.ctx.canvasElement.setAttribute("style", `height:${I}px;width:${R}px;`), this.ctx.paint.scale(y);
|
|
4702
4706
|
}
|
|
4703
4707
|
// 调整行的高度
|
|
4704
4708
|
initResizeRow() {
|
|
@@ -4945,7 +4949,7 @@ class ke {
|
|
|
4945
4949
|
this.moveFocus(t);
|
|
4946
4950
|
}), this.ctx.on(
|
|
4947
4951
|
"mousemove",
|
|
4948
|
-
|
|
4952
|
+
yt((t) => {
|
|
4949
4953
|
var e, i;
|
|
4950
4954
|
(e = this.ctx.focusCell) != null && e.fixed || (i = this.ctx.focusCellHeader) != null && i.fixed || !this.ctx.dragHeaderIng && this.ctx.selectorMove && this.ctx.startAdjustPosition(t);
|
|
4951
4955
|
}, 100)
|
|
@@ -4966,10 +4970,7 @@ class ke {
|
|
|
4966
4970
|
}
|
|
4967
4971
|
window.getComputedStyle(e.target).userSelect !== "text" && e.preventDefault(), this.isMultipleRow = !1, this.click(e.shiftKey), this.ctx.emit("selectorClick", t);
|
|
4968
4972
|
}), this.ctx.on("mouseup", () => {
|
|
4969
|
-
this.ctx.selectorMove = !1, this.ctx.stopAdjustPosition();
|
|
4970
|
-
const t = setTimeout(() => {
|
|
4971
|
-
this.ctx.adjustPositioning = !1, this.ctx.disableHoverIconClick = !1, clearTimeout(t);
|
|
4972
|
-
}, 0);
|
|
4973
|
+
this.ctx.selectorMove = !1, this.ctx.stopAdjustPosition(), this.ctx.adjustPositioning = !1, this.ctx.disableHoverIconClick = !1;
|
|
4973
4974
|
}), this.ctx.on("cellHeaderHoverChange", (t) => {
|
|
4974
4975
|
this.ctx.mousedown && this.selectCols(t);
|
|
4975
4976
|
}), this.ctx.on("cellHoverChange", (t) => {
|
|
@@ -5308,14 +5309,14 @@ class ke {
|
|
|
5308
5309
|
for (let C = 0; C <= r.length - 1; C++) {
|
|
5309
5310
|
const b = r[C].length;
|
|
5310
5311
|
for (let y = 0; y <= b - 1; y++) {
|
|
5311
|
-
const v = C + e, _ = y + i, S = r[C][y],
|
|
5312
|
+
const v = C + e, _ = y + i, S = r[C][y], R = this.ctx.database.getItemValueForRowIndexAndColIndex(
|
|
5312
5313
|
v,
|
|
5313
5314
|
_
|
|
5314
5315
|
);
|
|
5315
|
-
if (
|
|
5316
|
-
const { rowKey:
|
|
5317
|
-
this.ctx.database.getReadonly(
|
|
5318
|
-
rowKey:
|
|
5316
|
+
if (R) {
|
|
5317
|
+
const { rowKey: I, key: T } = R;
|
|
5318
|
+
this.ctx.database.getReadonly(I, T) || (s.add(I), w.push({
|
|
5319
|
+
rowKey: I,
|
|
5319
5320
|
key: T,
|
|
5320
5321
|
value: S,
|
|
5321
5322
|
row: {}
|
|
@@ -5424,9 +5425,9 @@ class ke {
|
|
|
5424
5425
|
_ > l.visibleHeight && (_ = l.visibleHeight);
|
|
5425
5426
|
let S = 0;
|
|
5426
5427
|
x && (u === "top" ? v = r.height + a.height - w : S = a.visibleHeight);
|
|
5427
|
-
const
|
|
5428
|
-
let
|
|
5429
|
-
y > 0 && !C ?
|
|
5428
|
+
const R = w + _ - (t - S - f);
|
|
5429
|
+
let I = c, T = d;
|
|
5430
|
+
y > 0 && !C ? I = Math.floor(c + y) : b > 0 && !C && (I = Math.floor(c - b)), v > 0 ? T = Math.floor(d - v) : R > 0 && (T = Math.floor(d + R)), (Math.abs(c - I) > 2 || Math.abs(d - T) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.emit("adjustBoundaryPosition", i), this.ctx.setScroll(I, T));
|
|
5430
5431
|
}
|
|
5431
5432
|
destroy() {
|
|
5432
5433
|
}
|
|
@@ -5491,14 +5492,14 @@ class Xe {
|
|
|
5491
5492
|
r = [Math.max(w, b), Math.min(E, y)], a = [Math.max(p, v), Math.min(C, _)];
|
|
5492
5493
|
const { BEFORE_SET_AUTOFILL_METHOD: S } = this.ctx.config;
|
|
5493
5494
|
if (typeof S == "function") {
|
|
5494
|
-
const
|
|
5495
|
+
const I = S({
|
|
5495
5496
|
focusCell: this.ctx.focusCell,
|
|
5496
5497
|
xArr: r,
|
|
5497
5498
|
yArr: a
|
|
5498
5499
|
});
|
|
5499
|
-
if (!
|
|
5500
|
+
if (!I)
|
|
5500
5501
|
return;
|
|
5501
|
-
r =
|
|
5502
|
+
r = I.xArr, a = I.yArr;
|
|
5502
5503
|
}
|
|
5503
5504
|
this.ctx.autofill.xArr = r, this.ctx.autofill.yArr = a, this.ctx.emit("setAutofill", this.ctx.autofill), this.ctx.emit("draw");
|
|
5504
5505
|
}
|
|
@@ -5569,7 +5570,7 @@ class Xe {
|
|
|
5569
5570
|
destroy() {
|
|
5570
5571
|
}
|
|
5571
5572
|
}
|
|
5572
|
-
const j = Math.min, z = Math.max,
|
|
5573
|
+
const j = Math.min, z = Math.max, nt = Math.round, st = Math.floor, Y = (h) => ({
|
|
5573
5574
|
x: h,
|
|
5574
5575
|
y: h
|
|
5575
5576
|
}), Be = {
|
|
@@ -5581,22 +5582,22 @@ const j = Math.min, z = Math.max, at = Math.round, ot = Math.floor, Y = (h) => (
|
|
|
5581
5582
|
start: "end",
|
|
5582
5583
|
end: "start"
|
|
5583
5584
|
};
|
|
5584
|
-
function
|
|
5585
|
+
function mt(h, t, e) {
|
|
5585
5586
|
return z(h, j(t, e));
|
|
5586
5587
|
}
|
|
5587
|
-
function
|
|
5588
|
+
function tt(h, t) {
|
|
5588
5589
|
return typeof h == "function" ? h(t) : h;
|
|
5589
5590
|
}
|
|
5590
5591
|
function $(h) {
|
|
5591
5592
|
return h.split("-")[0];
|
|
5592
5593
|
}
|
|
5593
|
-
function
|
|
5594
|
+
function et(h) {
|
|
5594
5595
|
return h.split("-")[1];
|
|
5595
5596
|
}
|
|
5596
5597
|
function Jt(h) {
|
|
5597
5598
|
return h === "x" ? "y" : "x";
|
|
5598
5599
|
}
|
|
5599
|
-
function
|
|
5600
|
+
function It(h) {
|
|
5600
5601
|
return h === "y" ? "height" : "width";
|
|
5601
5602
|
}
|
|
5602
5603
|
const Ke = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
@@ -5608,15 +5609,15 @@ function vt(h) {
|
|
|
5608
5609
|
}
|
|
5609
5610
|
function Fe(h, t, e) {
|
|
5610
5611
|
e === void 0 && (e = !1);
|
|
5611
|
-
const i =
|
|
5612
|
+
const i = et(h), s = vt(h), o = It(s);
|
|
5612
5613
|
let r = s === "x" ? i === (e ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
|
|
5613
|
-
return t.reference[o] > t.floating[o] && (r =
|
|
5614
|
+
return t.reference[o] > t.floating[o] && (r = at(r)), [r, at(r)];
|
|
5614
5615
|
}
|
|
5615
5616
|
function We(h) {
|
|
5616
|
-
const t =
|
|
5617
|
-
return [
|
|
5617
|
+
const t = at(h);
|
|
5618
|
+
return [Et(h), t, Et(t)];
|
|
5618
5619
|
}
|
|
5619
|
-
function
|
|
5620
|
+
function Et(h) {
|
|
5620
5621
|
return h.replace(/start|end/g, (t) => Ye[t]);
|
|
5621
5622
|
}
|
|
5622
5623
|
const Bt = ["left", "right"], Yt = ["right", "left"], Ve = ["top", "bottom"], Pe = ["bottom", "top"];
|
|
@@ -5633,11 +5634,11 @@ function ze(h, t, e) {
|
|
|
5633
5634
|
}
|
|
5634
5635
|
}
|
|
5635
5636
|
function $e(h, t, e, i) {
|
|
5636
|
-
const s =
|
|
5637
|
+
const s = et(h);
|
|
5637
5638
|
let o = ze($(h), e === "start", i);
|
|
5638
|
-
return s && (o = o.map((r) => r + "-" + s), t && (o = o.concat(o.map(
|
|
5639
|
+
return s && (o = o.map((r) => r + "-" + s), t && (o = o.concat(o.map(Et)))), o;
|
|
5639
5640
|
}
|
|
5640
|
-
function
|
|
5641
|
+
function at(h) {
|
|
5641
5642
|
return h.replace(/left|right|bottom|top/g, (t) => Be[t]);
|
|
5642
5643
|
}
|
|
5643
5644
|
function Ge(h) {
|
|
@@ -5657,7 +5658,7 @@ function Qt(h) {
|
|
|
5657
5658
|
left: h
|
|
5658
5659
|
};
|
|
5659
5660
|
}
|
|
5660
|
-
function
|
|
5661
|
+
function lt(h) {
|
|
5661
5662
|
const {
|
|
5662
5663
|
x: t,
|
|
5663
5664
|
y: e,
|
|
@@ -5680,7 +5681,7 @@ function Kt(h, t, e) {
|
|
|
5680
5681
|
reference: i,
|
|
5681
5682
|
floating: s
|
|
5682
5683
|
} = h;
|
|
5683
|
-
const o = V(t), r = vt(t), a =
|
|
5684
|
+
const o = V(t), r = vt(t), a = It(r), l = $(t), c = o === "y", d = i.x + i.width / 2 - s.width / 2, f = i.y + i.height / 2 - s.height / 2, x = i[a] / 2 - s[a] / 2;
|
|
5684
5685
|
let u;
|
|
5685
5686
|
switch (l) {
|
|
5686
5687
|
case "top":
|
|
@@ -5713,7 +5714,7 @@ function Kt(h, t, e) {
|
|
|
5713
5714
|
y: i.y
|
|
5714
5715
|
};
|
|
5715
5716
|
}
|
|
5716
|
-
switch (
|
|
5717
|
+
switch (et(t)) {
|
|
5717
5718
|
case "start":
|
|
5718
5719
|
u[r] -= x * (e && c ? -1 : 1);
|
|
5719
5720
|
break;
|
|
@@ -5800,7 +5801,7 @@ async function te(h, t) {
|
|
|
5800
5801
|
elementContext: f = "floating",
|
|
5801
5802
|
altBoundary: x = !1,
|
|
5802
5803
|
padding: u = 0
|
|
5803
|
-
} =
|
|
5804
|
+
} = tt(t, h), g = Qt(u), w = a[x ? f === "floating" ? "reference" : "floating" : f], E = lt(await o.getClippingRect({
|
|
5804
5805
|
element: (e = await (o.isElement == null ? void 0 : o.isElement(w))) == null || e ? w : w.contextElement || await (o.getDocumentElement == null ? void 0 : o.getDocumentElement(a.floating)),
|
|
5805
5806
|
boundary: c,
|
|
5806
5807
|
rootBoundary: d,
|
|
@@ -5816,7 +5817,7 @@ async function te(h, t) {
|
|
|
5816
5817
|
} : {
|
|
5817
5818
|
x: 1,
|
|
5818
5819
|
y: 1
|
|
5819
|
-
}, y =
|
|
5820
|
+
}, y = lt(o.convertOffsetParentRelativeRectToViewportRelativeRect ? await o.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
5820
5821
|
elements: a,
|
|
5821
5822
|
rect: p,
|
|
5822
5823
|
offsetParent: C,
|
|
@@ -5844,16 +5845,16 @@ const je = (h) => ({
|
|
|
5844
5845
|
} = t, {
|
|
5845
5846
|
element: c,
|
|
5846
5847
|
padding: d = 0
|
|
5847
|
-
} =
|
|
5848
|
+
} = tt(h, t) || {};
|
|
5848
5849
|
if (c == null)
|
|
5849
5850
|
return {};
|
|
5850
5851
|
const f = Qt(d), x = {
|
|
5851
5852
|
x: e,
|
|
5852
5853
|
y: i
|
|
5853
|
-
}, u = vt(s), g =
|
|
5854
|
+
}, u = vt(s), g = It(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], v = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(c));
|
|
5854
5855
|
let _ = v ? v[C] : 0;
|
|
5855
5856
|
(!_ || !await (r.isElement == null ? void 0 : r.isElement(v))) && (_ = a.floating[C] || o.floating[g]);
|
|
5856
|
-
const S = b / 2 - y / 2,
|
|
5857
|
+
const S = b / 2 - y / 2, R = _ / 2 - m[g] / 2 - 1, I = j(f[E], R), T = j(f[p], R), O = I, M = _ - m[g] - T, L = _ / 2 - m[g] / 2 + S, A = mt(O, L, M), D = !l.arrow && et(s) != null && L !== A && o.reference[g] / 2 - (L < O ? I : T) - m[g] / 2 < 0, H = D ? L < O ? L - O : L - M : 0;
|
|
5857
5858
|
return {
|
|
5858
5859
|
[u]: x[u] + H,
|
|
5859
5860
|
data: {
|
|
@@ -5887,41 +5888,41 @@ const je = (h) => ({
|
|
|
5887
5888
|
fallbackAxisSideDirection: g = "none",
|
|
5888
5889
|
flipAlignment: m = !0,
|
|
5889
5890
|
...w
|
|
5890
|
-
} =
|
|
5891
|
+
} = tt(h, t);
|
|
5891
5892
|
if ((e = o.arrow) != null && e.alignmentOffset)
|
|
5892
5893
|
return {};
|
|
5893
|
-
const E = $(s), p = V(a), C = $(a) === a, b = await (l.isRTL == null ? void 0 : l.isRTL(c.floating)), y = x || (C || !m ? [
|
|
5894
|
+
const E = $(s), p = V(a), C = $(a) === a, b = await (l.isRTL == null ? void 0 : l.isRTL(c.floating)), y = x || (C || !m ? [at(a)] : We(a)), v = g !== "none";
|
|
5894
5895
|
!x && v && y.push(...$e(a, m, g, b));
|
|
5895
|
-
const _ = [a, ...y], S = await te(t, w),
|
|
5896
|
-
let
|
|
5897
|
-
if (d &&
|
|
5896
|
+
const _ = [a, ...y], S = await te(t, w), R = [];
|
|
5897
|
+
let I = ((i = o.flip) == null ? void 0 : i.overflows) || [];
|
|
5898
|
+
if (d && R.push(S[E]), f) {
|
|
5898
5899
|
const L = Fe(s, r, b);
|
|
5899
|
-
|
|
5900
|
+
R.push(S[L[0]], S[L[1]]);
|
|
5900
5901
|
}
|
|
5901
|
-
if (
|
|
5902
|
+
if (I = [...I, {
|
|
5902
5903
|
placement: s,
|
|
5903
|
-
overflows:
|
|
5904
|
-
}], !
|
|
5904
|
+
overflows: R
|
|
5905
|
+
}], !R.every((L) => L <= 0)) {
|
|
5905
5906
|
var T, O;
|
|
5906
5907
|
const L = (((T = o.flip) == null ? void 0 : T.index) || 0) + 1, A = _[L];
|
|
5907
5908
|
if (A && (!(f === "alignment" ? p !== V(A) : !1) || // We leave the current main axis only if every placement on that axis
|
|
5908
5909
|
// overflows the main axis.
|
|
5909
|
-
|
|
5910
|
+
I.every((k) => V(k.placement) === p ? k.overflows[0] > 0 : !0)))
|
|
5910
5911
|
return {
|
|
5911
5912
|
data: {
|
|
5912
5913
|
index: L,
|
|
5913
|
-
overflows:
|
|
5914
|
+
overflows: I
|
|
5914
5915
|
},
|
|
5915
5916
|
reset: {
|
|
5916
5917
|
placement: A
|
|
5917
5918
|
}
|
|
5918
5919
|
};
|
|
5919
|
-
let D = (O =
|
|
5920
|
+
let D = (O = I.filter((H) => H.overflows[0] <= 0).sort((H, k) => H.overflows[1] - k.overflows[1])[0]) == null ? void 0 : O.placement;
|
|
5920
5921
|
if (!D)
|
|
5921
5922
|
switch (u) {
|
|
5922
5923
|
case "bestFit": {
|
|
5923
5924
|
var M;
|
|
5924
|
-
const H = (M =
|
|
5925
|
+
const H = (M = I.filter((k) => {
|
|
5925
5926
|
if (v) {
|
|
5926
5927
|
const W = V(k.placement);
|
|
5927
5928
|
return W === p || // Create a bias to the `y` side axis due to horizontal
|
|
@@ -5953,7 +5954,7 @@ async function Je(h, t) {
|
|
|
5953
5954
|
placement: e,
|
|
5954
5955
|
platform: i,
|
|
5955
5956
|
elements: s
|
|
5956
|
-
} = h, o = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), r = $(e), a =
|
|
5957
|
+
} = h, o = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), r = $(e), a = et(e), l = V(e) === "y", c = Ze.has(r) ? -1 : 1, d = o && l ? -1 : 1, f = tt(t, h);
|
|
5957
5958
|
let {
|
|
5958
5959
|
mainAxis: x,
|
|
5959
5960
|
crossAxis: u,
|
|
@@ -6022,18 +6023,18 @@ const Qe = function(h) {
|
|
|
6022
6023
|
}
|
|
6023
6024
|
},
|
|
6024
6025
|
...l
|
|
6025
|
-
} =
|
|
6026
|
+
} = tt(h, t), c = {
|
|
6026
6027
|
x: e,
|
|
6027
6028
|
y: i
|
|
6028
6029
|
}, d = await te(t, l), f = V($(s)), x = Jt(f);
|
|
6029
6030
|
let u = c[x], g = c[f];
|
|
6030
6031
|
if (o) {
|
|
6031
6032
|
const w = x === "y" ? "top" : "left", E = x === "y" ? "bottom" : "right", p = u + d[w], C = u - d[E];
|
|
6032
|
-
u =
|
|
6033
|
+
u = mt(p, u, C);
|
|
6033
6034
|
}
|
|
6034
6035
|
if (r) {
|
|
6035
6036
|
const w = f === "y" ? "top" : "left", E = f === "y" ? "bottom" : "right", p = g + d[w], C = g - d[E];
|
|
6036
|
-
g =
|
|
6037
|
+
g = mt(p, g, C);
|
|
6037
6038
|
}
|
|
6038
6039
|
const m = a.fn({
|
|
6039
6040
|
...t,
|
|
@@ -6054,7 +6055,7 @@ const Qe = function(h) {
|
|
|
6054
6055
|
}
|
|
6055
6056
|
};
|
|
6056
6057
|
};
|
|
6057
|
-
function
|
|
6058
|
+
function ft() {
|
|
6058
6059
|
return typeof window < "u";
|
|
6059
6060
|
}
|
|
6060
6061
|
function Z(h) {
|
|
@@ -6069,19 +6070,19 @@ function F(h) {
|
|
|
6069
6070
|
return (t = (ee(h) ? h.ownerDocument : h.document) || window.document) == null ? void 0 : t.documentElement;
|
|
6070
6071
|
}
|
|
6071
6072
|
function ee(h) {
|
|
6072
|
-
return
|
|
6073
|
+
return ft() ? h instanceof Node || h instanceof N(h).Node : !1;
|
|
6073
6074
|
}
|
|
6074
6075
|
function X(h) {
|
|
6075
|
-
return
|
|
6076
|
+
return ft() ? h instanceof Element || h instanceof N(h).Element : !1;
|
|
6076
6077
|
}
|
|
6077
6078
|
function K(h) {
|
|
6078
|
-
return
|
|
6079
|
+
return ft() ? h instanceof HTMLElement || h instanceof N(h).HTMLElement : !1;
|
|
6079
6080
|
}
|
|
6080
6081
|
function Ft(h) {
|
|
6081
|
-
return !
|
|
6082
|
+
return !ft() || typeof ShadowRoot > "u" ? !1 : h instanceof ShadowRoot || h instanceof N(h).ShadowRoot;
|
|
6082
6083
|
}
|
|
6083
6084
|
const ei = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
6084
|
-
function
|
|
6085
|
+
function it(h) {
|
|
6085
6086
|
const {
|
|
6086
6087
|
overflow: t,
|
|
6087
6088
|
overflowX: e,
|
|
@@ -6095,7 +6096,7 @@ function si(h) {
|
|
|
6095
6096
|
return ii.has(Z(h));
|
|
6096
6097
|
}
|
|
6097
6098
|
const oi = [":popover-open", ":modal"];
|
|
6098
|
-
function
|
|
6099
|
+
function ut(h) {
|
|
6099
6100
|
return oi.some((t) => {
|
|
6100
6101
|
try {
|
|
6101
6102
|
return h.matches(t);
|
|
@@ -6114,7 +6115,7 @@ function li(h) {
|
|
|
6114
6115
|
for (; K(t) && !q(t); ) {
|
|
6115
6116
|
if (_t(t))
|
|
6116
6117
|
return t;
|
|
6117
|
-
if (
|
|
6118
|
+
if (ut(t))
|
|
6118
6119
|
return null;
|
|
6119
6120
|
t = P(t);
|
|
6120
6121
|
}
|
|
@@ -6130,7 +6131,7 @@ function q(h) {
|
|
|
6130
6131
|
function B(h) {
|
|
6131
6132
|
return N(h).getComputedStyle(h);
|
|
6132
6133
|
}
|
|
6133
|
-
function
|
|
6134
|
+
function xt(h) {
|
|
6134
6135
|
return X(h) ? {
|
|
6135
6136
|
scrollLeft: h.scrollLeft,
|
|
6136
6137
|
scrollTop: h.scrollTop
|
|
@@ -6153,25 +6154,25 @@ function P(h) {
|
|
|
6153
6154
|
}
|
|
6154
6155
|
function ie(h) {
|
|
6155
6156
|
const t = P(h);
|
|
6156
|
-
return q(t) ? h.ownerDocument ? h.ownerDocument.body : h.body : K(t) &&
|
|
6157
|
+
return q(t) ? h.ownerDocument ? h.ownerDocument.body : h.body : K(t) && it(t) ? t : ie(t);
|
|
6157
6158
|
}
|
|
6158
|
-
function
|
|
6159
|
+
function Q(h, t, e) {
|
|
6159
6160
|
var i;
|
|
6160
6161
|
t === void 0 && (t = []), e === void 0 && (e = !0);
|
|
6161
6162
|
const s = ie(h), o = s === ((i = h.ownerDocument) == null ? void 0 : i.body), r = N(s);
|
|
6162
6163
|
if (o) {
|
|
6163
|
-
const a =
|
|
6164
|
-
return t.concat(r, r.visualViewport || [],
|
|
6164
|
+
const a = pt(r);
|
|
6165
|
+
return t.concat(r, r.visualViewport || [], it(s) ? s : [], a && e ? Q(a) : []);
|
|
6165
6166
|
}
|
|
6166
|
-
return t.concat(s,
|
|
6167
|
+
return t.concat(s, Q(s, [], e));
|
|
6167
6168
|
}
|
|
6168
|
-
function
|
|
6169
|
+
function pt(h) {
|
|
6169
6170
|
return h.parent && Object.getPrototypeOf(h.parent) ? h.frameElement : null;
|
|
6170
6171
|
}
|
|
6171
6172
|
function se(h) {
|
|
6172
6173
|
const t = B(h);
|
|
6173
6174
|
let e = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
|
|
6174
|
-
const s = K(h), o = s ? h.offsetWidth : e, r = s ? h.offsetHeight : i, a =
|
|
6175
|
+
const s = K(h), o = s ? h.offsetWidth : e, r = s ? h.offsetHeight : i, a = nt(e) !== o || nt(i) !== r;
|
|
6175
6176
|
return a && (e = o, i = r), {
|
|
6176
6177
|
width: e,
|
|
6177
6178
|
height: i,
|
|
@@ -6190,7 +6191,7 @@ function U(h) {
|
|
|
6190
6191
|
height: s,
|
|
6191
6192
|
$: o
|
|
6192
6193
|
} = se(t);
|
|
6193
|
-
let r = (o ?
|
|
6194
|
+
let r = (o ? nt(e.width) : e.width) / i, a = (o ? nt(e.height) : e.height) / s;
|
|
6194
6195
|
return (!r || !Number.isFinite(r)) && (r = 1), (!a || !Number.isFinite(a)) && (a = 1), {
|
|
6195
6196
|
x: r,
|
|
6196
6197
|
y: a
|
|
@@ -6216,13 +6217,13 @@ function G(h, t, e, i) {
|
|
|
6216
6217
|
let l = (s.left + a.x) / r.x, c = (s.top + a.y) / r.y, d = s.width / r.x, f = s.height / r.y;
|
|
6217
6218
|
if (o) {
|
|
6218
6219
|
const x = N(o), u = i && X(i) ? N(i) : i;
|
|
6219
|
-
let g = x, m =
|
|
6220
|
+
let g = x, m = pt(g);
|
|
6220
6221
|
for (; m && i && u !== g; ) {
|
|
6221
6222
|
const w = U(m), E = m.getBoundingClientRect(), p = B(m), C = E.left + (m.clientLeft + parseFloat(p.paddingLeft)) * w.x, b = E.top + (m.clientTop + parseFloat(p.paddingTop)) * w.y;
|
|
6222
|
-
l *= w.x, c *= w.y, d *= w.x, f *= w.y, l += C, c += b, g = N(m), m =
|
|
6223
|
+
l *= w.x, c *= w.y, d *= w.x, f *= w.y, l += C, c += b, g = N(m), m = pt(g);
|
|
6223
6224
|
}
|
|
6224
6225
|
}
|
|
6225
|
-
return
|
|
6226
|
+
return lt({
|
|
6226
6227
|
width: d,
|
|
6227
6228
|
height: f,
|
|
6228
6229
|
x: l,
|
|
@@ -6230,7 +6231,7 @@ function G(h, t, e, i) {
|
|
|
6230
6231
|
});
|
|
6231
6232
|
}
|
|
6232
6233
|
function Ot(h, t) {
|
|
6233
|
-
const e =
|
|
6234
|
+
const e = xt(h).scrollLeft;
|
|
6234
6235
|
return t ? t.left + e : G(F(h)).left + e;
|
|
6235
6236
|
}
|
|
6236
6237
|
function re(h, t, e) {
|
|
@@ -6251,7 +6252,7 @@ function fi(h) {
|
|
|
6251
6252
|
offsetParent: i,
|
|
6252
6253
|
strategy: s
|
|
6253
6254
|
} = h;
|
|
6254
|
-
const o = s === "fixed", r = F(i), a = t ?
|
|
6255
|
+
const o = s === "fixed", r = F(i), a = t ? ut(t.floating) : !1;
|
|
6255
6256
|
if (i === r || a && o)
|
|
6256
6257
|
return e;
|
|
6257
6258
|
let l = {
|
|
@@ -6259,7 +6260,7 @@ function fi(h) {
|
|
|
6259
6260
|
scrollTop: 0
|
|
6260
6261
|
}, c = Y(1);
|
|
6261
6262
|
const d = Y(0), f = K(i);
|
|
6262
|
-
if ((f || !f && !o) && ((Z(i) !== "body" ||
|
|
6263
|
+
if ((f || !f && !o) && ((Z(i) !== "body" || it(r)) && (l = xt(i)), K(i))) {
|
|
6263
6264
|
const u = G(i);
|
|
6264
6265
|
c = U(i), d.x = u.x + i.clientLeft, d.y = u.y + i.clientTop;
|
|
6265
6266
|
}
|
|
@@ -6275,7 +6276,7 @@ function ui(h) {
|
|
|
6275
6276
|
return Array.from(h.getClientRects());
|
|
6276
6277
|
}
|
|
6277
6278
|
function xi(h) {
|
|
6278
|
-
const t = F(h), e =
|
|
6279
|
+
const t = F(h), e = xt(h), i = h.ownerDocument.body, s = z(t.scrollWidth, t.clientWidth, i.scrollWidth, i.clientWidth), o = z(t.scrollHeight, t.clientHeight, i.scrollHeight, i.clientHeight);
|
|
6279
6280
|
let r = -e.scrollLeft + Ot(h);
|
|
6280
6281
|
const a = -e.scrollTop;
|
|
6281
6282
|
return B(i).direction === "rtl" && (r += z(t.clientWidth, i.clientWidth) - s), {
|
|
@@ -6327,7 +6328,7 @@ function Wt(h, t, e) {
|
|
|
6327
6328
|
height: t.height
|
|
6328
6329
|
};
|
|
6329
6330
|
}
|
|
6330
|
-
return
|
|
6331
|
+
return lt(i);
|
|
6331
6332
|
}
|
|
6332
6333
|
function ne(h, t) {
|
|
6333
6334
|
const e = P(h);
|
|
@@ -6337,12 +6338,12 @@ function Ei(h, t) {
|
|
|
6337
6338
|
const e = t.get(h);
|
|
6338
6339
|
if (e)
|
|
6339
6340
|
return e;
|
|
6340
|
-
let i =
|
|
6341
|
+
let i = Q(h, [], !1).filter((a) => X(a) && Z(a) !== "body"), s = null;
|
|
6341
6342
|
const o = B(h).position === "fixed";
|
|
6342
6343
|
let r = o ? P(h) : h;
|
|
6343
6344
|
for (; X(r) && !q(r); ) {
|
|
6344
6345
|
const a = B(r), l = _t(r);
|
|
6345
|
-
!l && a.position === "fixed" && (s = null), (o ? !l && !s : !l && a.position === "static" && !!s && wi.has(s.position) ||
|
|
6346
|
+
!l && a.position === "fixed" && (s = null), (o ? !l && !s : !l && a.position === "static" && !!s && wi.has(s.position) || it(r) && !l && ne(h, r)) ? i = i.filter((d) => d !== r) : s = a, r = P(r);
|
|
6346
6347
|
}
|
|
6347
6348
|
return t.set(h, i), i;
|
|
6348
6349
|
}
|
|
@@ -6353,7 +6354,7 @@ function pi(h) {
|
|
|
6353
6354
|
rootBoundary: i,
|
|
6354
6355
|
strategy: s
|
|
6355
6356
|
} = h;
|
|
6356
|
-
const r = [...e === "clippingAncestors" ?
|
|
6357
|
+
const r = [...e === "clippingAncestors" ? ut(t) ? [] : Ei(t, this._c) : [].concat(e), i], a = r[0], l = r.reduce((c, d) => {
|
|
6357
6358
|
const f = Wt(t, d, s);
|
|
6358
6359
|
return c.top = z(f.top, c.top), c.right = j(f.right, c.right), c.bottom = j(f.bottom, c.bottom), c.left = z(f.left, c.left), c;
|
|
6359
6360
|
}, Wt(t, a, s));
|
|
@@ -6385,7 +6386,7 @@ function yi(h, t, e) {
|
|
|
6385
6386
|
l.x = Ot(s);
|
|
6386
6387
|
}
|
|
6387
6388
|
if (i || !i && !o)
|
|
6388
|
-
if ((Z(t) !== "body" ||
|
|
6389
|
+
if ((Z(t) !== "body" || it(s)) && (a = xt(t)), i) {
|
|
6389
6390
|
const u = G(t, !0, o, t);
|
|
6390
6391
|
l.x = u.x + t.clientLeft, l.y = u.y + t.clientTop;
|
|
6391
6392
|
} else s && c();
|
|
@@ -6398,7 +6399,7 @@ function yi(h, t, e) {
|
|
|
6398
6399
|
height: r.height
|
|
6399
6400
|
};
|
|
6400
6401
|
}
|
|
6401
|
-
function
|
|
6402
|
+
function gt(h) {
|
|
6402
6403
|
return B(h).position === "static";
|
|
6403
6404
|
}
|
|
6404
6405
|
function Vt(h, t) {
|
|
@@ -6411,21 +6412,21 @@ function Vt(h, t) {
|
|
|
6411
6412
|
}
|
|
6412
6413
|
function ae(h, t) {
|
|
6413
6414
|
const e = N(h);
|
|
6414
|
-
if (
|
|
6415
|
+
if (ut(h))
|
|
6415
6416
|
return e;
|
|
6416
6417
|
if (!K(h)) {
|
|
6417
6418
|
let s = P(h);
|
|
6418
6419
|
for (; s && !q(s); ) {
|
|
6419
|
-
if (X(s) && !
|
|
6420
|
+
if (X(s) && !gt(s))
|
|
6420
6421
|
return s;
|
|
6421
6422
|
s = P(s);
|
|
6422
6423
|
}
|
|
6423
6424
|
return e;
|
|
6424
6425
|
}
|
|
6425
6426
|
let i = Vt(h, t);
|
|
6426
|
-
for (; i && si(i) &&
|
|
6427
|
+
for (; i && si(i) && gt(i); )
|
|
6427
6428
|
i = Vt(i, t);
|
|
6428
|
-
return i && q(i) &&
|
|
6429
|
+
return i && q(i) && gt(i) && !_t(i) ? e : i || li(h) || e;
|
|
6429
6430
|
}
|
|
6430
6431
|
const bi = async function(h) {
|
|
6431
6432
|
const t = this.getOffsetParent || ae, e = this.getDimensions, i = await e(h.floating);
|
|
@@ -6439,10 +6440,10 @@ const bi = async function(h) {
|
|
|
6439
6440
|
}
|
|
6440
6441
|
};
|
|
6441
6442
|
};
|
|
6442
|
-
function
|
|
6443
|
+
function Ri(h) {
|
|
6443
6444
|
return B(h).direction === "rtl";
|
|
6444
6445
|
}
|
|
6445
|
-
const
|
|
6446
|
+
const Ii = {
|
|
6446
6447
|
convertOffsetParentRelativeRectToViewportRelativeRect: fi,
|
|
6447
6448
|
getDocumentElement: F,
|
|
6448
6449
|
getClippingRect: pi,
|
|
@@ -6452,7 +6453,7 @@ const Ri = {
|
|
|
6452
6453
|
getDimensions: Ci,
|
|
6453
6454
|
getScale: U,
|
|
6454
6455
|
isElement: X,
|
|
6455
|
-
isRTL:
|
|
6456
|
+
isRTL: Ri
|
|
6456
6457
|
};
|
|
6457
6458
|
function le(h, t) {
|
|
6458
6459
|
return h.x === t.x && h.y === t.y && h.width === t.width && h.height === t.height;
|
|
@@ -6474,7 +6475,7 @@ function vi(h, t) {
|
|
|
6474
6475
|
} = c;
|
|
6475
6476
|
if (a || t(), !x || !u)
|
|
6476
6477
|
return;
|
|
6477
|
-
const g =
|
|
6478
|
+
const g = st(f), m = st(s.clientWidth - (d + x)), w = st(s.clientHeight - (f + u)), E = st(d), C = {
|
|
6478
6479
|
rootMargin: -g + "px " + -m + "px " + -w + "px " + -E + "px",
|
|
6479
6480
|
threshold: z(0, j(1, l)) || 1
|
|
6480
6481
|
};
|
|
@@ -6503,7 +6504,7 @@ function vi(h, t) {
|
|
|
6503
6504
|
}
|
|
6504
6505
|
return r(!0), o;
|
|
6505
6506
|
}
|
|
6506
|
-
function
|
|
6507
|
+
function Ct(h, t, e, i) {
|
|
6507
6508
|
i === void 0 && (i = {});
|
|
6508
6509
|
const {
|
|
6509
6510
|
ancestorScroll: s = !0,
|
|
@@ -6511,7 +6512,7 @@ function yt(h, t, e, i) {
|
|
|
6511
6512
|
elementResize: r = typeof ResizeObserver == "function",
|
|
6512
6513
|
layoutShift: a = typeof IntersectionObserver == "function",
|
|
6513
6514
|
animationFrame: l = !1
|
|
6514
|
-
} = i, c = Tt(h), d = s || o ? [...c ?
|
|
6515
|
+
} = i, c = Tt(h), d = s || o ? [...c ? Q(c) : [], ...Q(t)] : [];
|
|
6515
6516
|
d.forEach((E) => {
|
|
6516
6517
|
s && E.addEventListener("scroll", e, {
|
|
6517
6518
|
passive: !0
|
|
@@ -6539,9 +6540,9 @@ function yt(h, t, e, i) {
|
|
|
6539
6540
|
}), f == null || f(), (E = u) == null || E.disconnect(), u = null, l && cancelAnimationFrame(g);
|
|
6540
6541
|
};
|
|
6541
6542
|
}
|
|
6542
|
-
const
|
|
6543
|
+
const ct = Qe, ht = ti, Lt = qe, _i = je, dt = (h, t, e) => {
|
|
6543
6544
|
const i = /* @__PURE__ */ new Map(), s = {
|
|
6544
|
-
platform:
|
|
6545
|
+
platform: Ii,
|
|
6545
6546
|
...e
|
|
6546
6547
|
}, o = {
|
|
6547
6548
|
...s.platform,
|
|
@@ -6618,7 +6619,7 @@ let Si = class {
|
|
|
6618
6619
|
return;
|
|
6619
6620
|
this.enable = !0, this.contentEl.style.maxWidth = `${t.overflowTooltipMaxWidth || 500}px`, this.contentEl.style.minWidth = "100px", this.contentEl.style.width = "100%", this.contentEl.style.display = "inline-block", this.contentEl.style.wordBreak = "break-all", this.contentEl.style.lineHeight = "1.5", this.contentEl.innerText = e;
|
|
6620
6621
|
const s = t.drawX + i.x, o = t.drawY + i.y;
|
|
6621
|
-
|
|
6622
|
+
dt({
|
|
6622
6623
|
getBoundingClientRect() {
|
|
6623
6624
|
return {
|
|
6624
6625
|
width: t.visibleWidth,
|
|
@@ -6633,7 +6634,7 @@ let Si = class {
|
|
|
6633
6634
|
}
|
|
6634
6635
|
}, this.floatingEl, {
|
|
6635
6636
|
placement: t.overflowTooltipPlacement,
|
|
6636
|
-
middleware: [
|
|
6637
|
+
middleware: [ht(), Lt(), ct(6), _i({ element: this.arrowEl })]
|
|
6637
6638
|
}).then((a) => {
|
|
6638
6639
|
const { x: l, y: c, placement: d, middlewareData: f } = a;
|
|
6639
6640
|
if (Object.assign(this.floatingEl.style, {
|
|
@@ -6766,7 +6767,7 @@ class Ti {
|
|
|
6766
6767
|
"F12"
|
|
6767
6768
|
].includes(e) || this.startEdit(!0);
|
|
6768
6769
|
}), this.ctx.on("cellMouseup", (t) => {
|
|
6769
|
-
if (this.ctx.
|
|
6770
|
+
if (this.ctx.isPointer || !this.isInSelectorRange(t.rowIndex, t.colIndex))
|
|
6770
6771
|
return;
|
|
6771
6772
|
const { xArr: e, yArr: i } = this.ctx.selector, s = JSON.stringify(e) + JSON.stringify(i);
|
|
6772
6773
|
if (this.selectorArrStr === s && this.cellTarget) {
|
|
@@ -6793,9 +6794,7 @@ class Ti {
|
|
|
6793
6794
|
return !(e < o || e > r || t < a || t > l);
|
|
6794
6795
|
}
|
|
6795
6796
|
initTextEditor() {
|
|
6796
|
-
this.inputEl = document.createElement("textarea"), this.inputEl.setAttribute("rows", "1"), this.inputEl.setAttribute("tabindex", "-1"), this.inputEl.addEventListener("input", this.autoSize.bind(this)), this.inputEl.
|
|
6797
|
-
this.doneEdit();
|
|
6798
|
-
}), this.editorEl = this.ctx.editorElement, this.inputEl.className = "e-virt-table-editor-textarea", this.editorEl.appendChild(this.inputEl), this.ctx.containerElement.appendChild(this.editorEl);
|
|
6797
|
+
this.inputEl = document.createElement("textarea"), this.inputEl.id = "e-virt-table-editor-textarea", this.inputEl.setAttribute("rows", "1"), this.inputEl.setAttribute("tabindex", "-1"), this.inputEl.addEventListener("input", this.autoSize.bind(this)), this.editorEl = this.ctx.editorElement, this.inputEl.className = "e-virt-table-editor-textarea", this.editorEl.appendChild(this.inputEl), this.ctx.containerElement.appendChild(this.editorEl);
|
|
6799
6798
|
}
|
|
6800
6799
|
autoSize() {
|
|
6801
6800
|
this.inputEl.style.height = "auto";
|
|
@@ -6821,7 +6820,7 @@ class Ti {
|
|
|
6821
6820
|
header: d
|
|
6822
6821
|
} = this.ctx;
|
|
6823
6822
|
let f = this.ctx.body.visibleHeight;
|
|
6824
|
-
o > f && (o = f), this.editorEl.style.display = "inline-block", this.editorEl.style.zIndex = "100", this.editorEl.style.left = `${this.drawX - 1}px`, this.editorEl.style.top = `${this.drawY - 1}px`, this.editorEl.style.bottom = "auto", this.editorEl.style.maxHeight = `${f}px`, s === "text" ? (this.inputEl.style.display = "block", this.inputEl.style.minWidth = `${r - 1}px`, this.inputEl.style.minHeight = `${o - 1}px`, this.inputEl.style.maxHeight = `${f}px`, this.inputEl.style.width = `${r - 1}px`, this.inputEl.style.height = "auto", this.inputEl.style.padding = `${c}px`, this.inputEl.value = "", i !== null && (this.inputEl.value = i)) : this.
|
|
6823
|
+
o > f && (o = f), this.editorEl.style.display = "inline-block", this.editorEl.style.zIndex = "100", this.editorEl.style.left = `${this.drawX - 1}px`, this.editorEl.style.top = `${this.drawY - 1}px`, this.editorEl.style.bottom = "auto", this.editorEl.style.maxHeight = `${f}px`, s === "text" ? (this.inputEl.style.display = "inline-block", this.inputEl.style.minWidth = `${r - 1}px`, this.inputEl.style.minHeight = `${o - 1}px`, this.inputEl.style.maxHeight = `${f}px`, this.inputEl.style.width = `${r - 1}px`, this.inputEl.style.height = "auto", this.inputEl.style.padding = `${c}px`, this.inputEl.value = "", i !== null && (this.inputEl.value = i, this.inputEl.focus({ preventScroll: !0 }))) : this.inputEl.style.display = "none", (this.inputEl.scrollHeight > o || this.drawY < d.height) && this.autoSize();
|
|
6825
6824
|
}
|
|
6826
6825
|
doneEditByInput() {
|
|
6827
6826
|
if (this.cellTarget && this.cellTarget.editorType === "text") {
|
|
@@ -6832,13 +6831,13 @@ class Ti {
|
|
|
6832
6831
|
startEdit(t = !1) {
|
|
6833
6832
|
this.cancel = !1;
|
|
6834
6833
|
const { ENABLE_EDIT_CLICK_SELECTOR: e } = this.ctx.config;
|
|
6835
|
-
if (!e)
|
|
6834
|
+
if (!e || this.ctx.adjustPositioning)
|
|
6836
6835
|
return;
|
|
6837
6836
|
const i = this.ctx.focusCell;
|
|
6838
6837
|
if (!i || ["index", "index-selection", "selection"].includes(i.type) || this.enable || !(i.isVerticalVisible() && i.isHorizontalVisible()))
|
|
6839
6838
|
return;
|
|
6840
6839
|
const { rowKey: o, key: r } = i, a = this.ctx.database.getReadonly(o, r);
|
|
6841
|
-
i && !a && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = i, this.startEditByInput(this.cellTarget, t), this.ctx.emit("startEdit", this.cellTarget), this.ctx.emit("
|
|
6840
|
+
i && !a && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = i, this.startEditByInput(this.cellTarget, t), this.ctx.emit("startEdit", this.cellTarget), this.ctx.emit("draw"));
|
|
6842
6841
|
}
|
|
6843
6842
|
editCell(t, e) {
|
|
6844
6843
|
const i = this.ctx.body.renderRows.find((c) => c.rowIndex === t);
|
|
@@ -6852,10 +6851,12 @@ class Ti {
|
|
|
6852
6851
|
if (!o || ["index", "index-selection", "selection"].includes(o.type) || this.enable)
|
|
6853
6852
|
return;
|
|
6854
6853
|
const { rowKey: r, key: a } = o, l = this.ctx.database.getReadonly(r, a);
|
|
6855
|
-
o && !l && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = o, this.startEditByInput(this.cellTarget), this.ctx.emit("startEdit", this.cellTarget), this.ctx.emit("
|
|
6854
|
+
o && !l && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = o, this.startEditByInput(this.cellTarget), this.ctx.emit("startEdit", this.cellTarget), this.ctx.emit("draw"));
|
|
6856
6855
|
}
|
|
6857
6856
|
doneEdit() {
|
|
6858
|
-
this.enable && (this.doneEditByInput(), this.ctx.emit("doneEdit", this.cellTarget), this.enable = !1, this.ctx.editing = !1, this.inputEl.
|
|
6857
|
+
this.enable && (this.doneEditByInput(), this.ctx.emit("doneEdit", this.cellTarget), this.enable = !1, this.ctx.editing = !1, this.inputEl.style.display = "inline-block", this.editorEl.style.zIndex = "-1", setTimeout(() => {
|
|
6858
|
+
this.inputEl.focus({ preventScroll: !0 });
|
|
6859
|
+
}, 0), this.ctx.emit("draw"));
|
|
6859
6860
|
}
|
|
6860
6861
|
clearEditor() {
|
|
6861
6862
|
this.doneEdit(), this.cellTarget = null, this.selectorArrStr = "", this.ctx.clearSelector(), this.ctx.focusCell = void 0, this.ctx.emit("draw");
|
|
@@ -6893,24 +6894,7 @@ class Li {
|
|
|
6893
6894
|
constructor(t) {
|
|
6894
6895
|
n(this, "ctx");
|
|
6895
6896
|
n(this, "observer");
|
|
6896
|
-
this.ctx = t, this.
|
|
6897
|
-
J(() => {
|
|
6898
|
-
const e = this.ctx.overlayerElement.querySelectorAll('[data-auto-height="true"]'), i = /* @__PURE__ */ new Map();
|
|
6899
|
-
e.forEach((r) => {
|
|
6900
|
-
const a = Number(r.getAttribute("data-row-index")), l = Number(r.getAttribute("data-col-index"));
|
|
6901
|
-
if (isNaN(a) || isNaN(l) || !(r instanceof HTMLElement) || r.offsetWidth === 0)
|
|
6902
|
-
return;
|
|
6903
|
-
const c = `${a}_${l}`;
|
|
6904
|
-
i.set(c, Math.round(r.offsetHeight));
|
|
6905
|
-
});
|
|
6906
|
-
const s = this.ctx.database.getOverlayerAutoHeightMap();
|
|
6907
|
-
if (!this.arerMapsEqual(s, i)) {
|
|
6908
|
-
if (this.ctx.database.setOverlayerAutoHeightMap(i), s.size === 0 && i.size === 0)
|
|
6909
|
-
return;
|
|
6910
|
-
this.ctx.emit("draw");
|
|
6911
|
-
}
|
|
6912
|
-
}, 16.67)
|
|
6913
|
-
), this.observer.observe(this.ctx.overlayerElement, { childList: !0, subtree: !0, attributes: !0 });
|
|
6897
|
+
this.ctx = t, this.init();
|
|
6914
6898
|
}
|
|
6915
6899
|
arerMapsEqual(t, e) {
|
|
6916
6900
|
if (t.size !== e.size) return !1;
|
|
@@ -6918,6 +6902,40 @@ class Li {
|
|
|
6918
6902
|
if (!e.has(i) || e.get(i) !== s) return !1;
|
|
6919
6903
|
return !0;
|
|
6920
6904
|
}
|
|
6905
|
+
init() {
|
|
6906
|
+
this.observer = new MutationObserver(
|
|
6907
|
+
yt(() => {
|
|
6908
|
+
const t = this.ctx.overlayerElement.querySelectorAll('[data-auto-height="true"]'), e = /* @__PURE__ */ new Map();
|
|
6909
|
+
t.forEach((o) => {
|
|
6910
|
+
const r = Number(o.getAttribute("data-row-index")), a = Number(o.getAttribute("data-col-index"));
|
|
6911
|
+
if (isNaN(r) || isNaN(a) || !(o instanceof HTMLElement) || o.offsetWidth === 0)
|
|
6912
|
+
return;
|
|
6913
|
+
const l = `${r}_${a}`;
|
|
6914
|
+
e.set(l, Math.round(o.offsetHeight));
|
|
6915
|
+
});
|
|
6916
|
+
const i = this.ctx.database.getOverlayerAutoHeightMap();
|
|
6917
|
+
if (!this.arerMapsEqual(i, e)) {
|
|
6918
|
+
if (this.ctx.database.setOverlayerAutoHeightMap(e), i.size === 0 && e.size === 0)
|
|
6919
|
+
return;
|
|
6920
|
+
this.ctx.emit("draw");
|
|
6921
|
+
}
|
|
6922
|
+
}, 16.67)
|
|
6923
|
+
), this.observer.observe(this.ctx.overlayerElement, { childList: !0, subtree: !0, attributes: !0 }), this.ctx.overlayerElement.getAttribute("data-overlayer") === "default" && this.ctx.on("overlayerChange", (t) => {
|
|
6924
|
+
const e = this.ctx.overlayerElement;
|
|
6925
|
+
e.replaceChildren(), Object.assign(e.style, t.style), t.views.forEach((i) => {
|
|
6926
|
+
const s = document.createElement("div");
|
|
6927
|
+
s.className = i.class, Object.assign(s.style, i.style), i.views.forEach((o) => {
|
|
6928
|
+
const r = document.createElement("div");
|
|
6929
|
+
Object.assign(r.style, o.style), o.cells.forEach((a) => {
|
|
6930
|
+
const l = document.createElement("div");
|
|
6931
|
+
Object.assign(l.style, a.style), Object.keys(a.domDataset).forEach((c) => {
|
|
6932
|
+
l.setAttribute(c, a.domDataset[c]);
|
|
6933
|
+
}), typeof a.render == "function" && a.render(l, a), r.appendChild(l);
|
|
6934
|
+
}), s.appendChild(r);
|
|
6935
|
+
}), e.appendChild(s);
|
|
6936
|
+
});
|
|
6937
|
+
});
|
|
6938
|
+
}
|
|
6921
6939
|
draw() {
|
|
6922
6940
|
const t = this.getContainer();
|
|
6923
6941
|
this.ctx.emit("overlayerChange", t);
|
|
@@ -7196,10 +7214,10 @@ class Pt {
|
|
|
7196
7214
|
async showSubmenu(t, e) {
|
|
7197
7215
|
if (this.activeSubmenus.has(e)) return;
|
|
7198
7216
|
this.activeSubmenus.add(e), e.classList.add("show");
|
|
7199
|
-
const i =
|
|
7200
|
-
const s = this.container.getBoundingClientRect(), o = window.innerWidth, r = e.offsetWidth || 200, a = o - s.right, l = s.left, c = a >= r || a >= l ? "right-start" : "left-start", { x: d, y: f } = await
|
|
7217
|
+
const i = Ct(t, e, async () => {
|
|
7218
|
+
const s = this.container.getBoundingClientRect(), o = window.innerWidth, r = e.offsetWidth || 200, a = o - s.right, l = s.left, c = a >= r || a >= l ? "right-start" : "left-start", { x: d, y: f } = await dt(t, e, {
|
|
7201
7219
|
placement: c,
|
|
7202
|
-
middleware: [
|
|
7220
|
+
middleware: [ct(8), ht({ padding: 8 })]
|
|
7203
7221
|
});
|
|
7204
7222
|
Object.assign(e.style, {
|
|
7205
7223
|
left: `${d}px`,
|
|
@@ -7266,10 +7284,10 @@ class Pt {
|
|
|
7266
7284
|
}),
|
|
7267
7285
|
contextElement: document.body
|
|
7268
7286
|
};
|
|
7269
|
-
|
|
7270
|
-
|
|
7287
|
+
Ct(e, this.container, () => {
|
|
7288
|
+
dt(e, this.container, {
|
|
7271
7289
|
placement: "right-start",
|
|
7272
|
-
middleware: [
|
|
7290
|
+
middleware: [ct(), ht(), Lt()]
|
|
7273
7291
|
}).then(({ x: i, y: s }) => {
|
|
7274
7292
|
this.container && Object.assign(this.container.style, {
|
|
7275
7293
|
left: `${i}px`,
|
|
@@ -7380,19 +7398,19 @@ class Mi {
|
|
|
7380
7398
|
onClick: (C, b) => {
|
|
7381
7399
|
const { xArr: y } = this.ctx.selector, [v, _] = y;
|
|
7382
7400
|
if (b === "fixedLeft" || b === "fixedRight" || b === "fixedNone") {
|
|
7383
|
-
const S = this.ctx.header.allCellHeaders.filter((
|
|
7401
|
+
const S = this.ctx.header.allCellHeaders.filter((R) => R.colIndex >= v && R.colIndex <= _).filter((R) => R.level === 0).filter((R) => !R.column.fixedDisabled).map((R) => R.key);
|
|
7384
7402
|
this.ctx.database.setCustomHeaderFixedData(
|
|
7385
7403
|
S,
|
|
7386
7404
|
b === "fixedLeft" ? "left" : b === "fixedRight" ? "right" : ""
|
|
7387
7405
|
), this.hide();
|
|
7388
7406
|
} else if (b === "hide") {
|
|
7389
|
-
const S = this.ctx.header.leafCellHeaders.filter((
|
|
7407
|
+
const S = this.ctx.header.leafCellHeaders.filter((R) => R.colIndex >= v && R.colIndex <= _).filter((R) => !R.children.length).filter((R) => !R.column.hideDisabled).map((R) => R.key);
|
|
7390
7408
|
S.length > 0 && this.ctx.database.setCustomHeaderHideData(S, !0), this.hide();
|
|
7391
7409
|
} else if (b !== "visible") if (b.startsWith("visible_")) {
|
|
7392
7410
|
const S = b.replace("visible_", "");
|
|
7393
7411
|
this.ctx.database.setCustomHeaderHideData([S], !1), this.currentDOMTreeMenu && this.currentDOMTreeMenu.removeSubMenuItem(b);
|
|
7394
|
-
const
|
|
7395
|
-
|
|
7412
|
+
const R = this.ctx.database.getColumns();
|
|
7413
|
+
J(R).filter((O) => O.hide).length === 0 && this.hide();
|
|
7396
7414
|
} else b === "resetHeader" && (this.ctx.database.resetCustomHeader(), this.hide());
|
|
7397
7415
|
}
|
|
7398
7416
|
}), this.positionMenu(e);
|
|
@@ -7414,10 +7432,10 @@ class Mi {
|
|
|
7414
7432
|
}),
|
|
7415
7433
|
contextElement: document.body
|
|
7416
7434
|
};
|
|
7417
|
-
|
|
7418
|
-
|
|
7435
|
+
Ct(e, this.contextMenuEl, () => {
|
|
7436
|
+
dt(e, this.contextMenuEl, {
|
|
7419
7437
|
placement: "right-start",
|
|
7420
|
-
middleware: [
|
|
7438
|
+
middleware: [ct(), ht(), Lt()]
|
|
7421
7439
|
}).then(({ x: i, y: s }) => {
|
|
7422
7440
|
this.contextMenuEl && Object.assign(this.contextMenuEl.style, {
|
|
7423
7441
|
left: `${i}px`,
|
|
@@ -7505,28 +7523,16 @@ class ki {
|
|
|
7505
7523
|
o,
|
|
7506
7524
|
r
|
|
7507
7525
|
);
|
|
7508
|
-
this.ctx = new Le(a, this.options), this.header = new He(this.ctx), this.footer = new Ne(this.ctx), this.body = new De(this.ctx), this.scroller = new Me(this.ctx), this.selector = new ke(this.ctx), this.autofill = new Xe(this.ctx), this.tooltip = new Si(this.ctx), this.empty = new Oi(this.ctx), this.editor = new Ti(this.ctx), this.overlayer = new Li(this.ctx), this.contextMenu = new Mi(this.ctx), this.loading = new Ai(this.ctx), this.ctx.on(
|
|
7509
|
-
|
|
7510
|
-
|
|
7511
|
-
|
|
7512
|
-
|
|
7513
|
-
},
|
|
7514
|
-
() => this.ctx.drawTime
|
|
7515
|
-
)
|
|
7516
|
-
), this.ctx.on(
|
|
7517
|
-
"drawView",
|
|
7518
|
-
J(
|
|
7519
|
-
() => {
|
|
7520
|
-
this.draw(!0);
|
|
7521
|
-
},
|
|
7522
|
-
() => this.ctx.drawTime
|
|
7523
|
-
)
|
|
7524
|
-
), this.draw();
|
|
7526
|
+
this.ctx = new Le(a, this.options), this.header = new He(this.ctx), this.footer = new Ne(this.ctx), this.body = new De(this.ctx), this.scroller = new Me(this.ctx), this.selector = new ke(this.ctx), this.autofill = new Xe(this.ctx), this.tooltip = new Si(this.ctx), this.empty = new Oi(this.ctx), this.editor = new Ti(this.ctx), this.overlayer = new Li(this.ctx), this.contextMenu = new Mi(this.ctx), this.loading = new Ai(this.ctx), this.ctx.on("draw", () => {
|
|
7527
|
+
this.draw();
|
|
7528
|
+
}), this.ctx.on("drawView", () => {
|
|
7529
|
+
this.draw(!0);
|
|
7530
|
+
}), this.draw();
|
|
7525
7531
|
}
|
|
7526
7532
|
createContainer(t, e, i, s, o) {
|
|
7527
7533
|
t.className = "e-virt-table-container";
|
|
7528
7534
|
const r = document.createElement("div"), a = document.createElement("canvas"), l = e || document.createElement("div");
|
|
7529
|
-
r.className = "e-virt-table-stage", t.tabIndex = 0, a.className = "e-virt-table-canvas", l.className = "e-virt-table-overlayer";
|
|
7535
|
+
r.className = "e-virt-table-stage", t.tabIndex = 0, a.className = "e-virt-table-canvas", l.className = "e-virt-table-overlayer", l.setAttribute("data-overlayer", e ? "custom" : "default");
|
|
7530
7536
|
const c = i || document.createElement("div");
|
|
7531
7537
|
c.className = "e-virt-table-editor";
|
|
7532
7538
|
const d = s, f = o;
|
|
@@ -7542,12 +7548,9 @@ class ki {
|
|
|
7542
7548
|
}
|
|
7543
7549
|
draw(t = !1) {
|
|
7544
7550
|
this.animationFrameId && cancelAnimationFrame(this.animationFrameId), this.animationFrameId = requestAnimationFrame(() => {
|
|
7545
|
-
const e = performance.now();
|
|
7546
7551
|
this.header.update(), this.footer.update(), this.body.update(), this.ctx.paint.clear(), this.body.draw(), this.footer.draw(), this.header.draw(), this.scroller.draw(), t || this.overlayer.draw(), this.animationFrameId2 && cancelAnimationFrame(this.animationFrameId2), this.animationFrameId2 = requestAnimationFrame(() => {
|
|
7547
7552
|
this.body.updateAutoHeight();
|
|
7548
7553
|
});
|
|
7549
|
-
const i = performance.now(), s = Math.round(i - e);
|
|
7550
|
-
this.ctx.drawTime = s * this.ctx.config.DRAW_TIME_MULTIPLIER;
|
|
7551
7554
|
});
|
|
7552
7555
|
}
|
|
7553
7556
|
loadConfig(t) {
|
|
@@ -7790,6 +7793,9 @@ class ki {
|
|
|
7790
7793
|
var e;
|
|
7791
7794
|
return (e = this.ctx.database.getColumnByKey(t)) == null ? void 0 : e.column;
|
|
7792
7795
|
}
|
|
7796
|
+
clearChangeData() {
|
|
7797
|
+
this.ctx.database.clearChangeData(), this.ctx.emit("draw");
|
|
7798
|
+
}
|
|
7793
7799
|
/**
|
|
7794
7800
|
* 销毁
|
|
7795
7801
|
*/
|