e-virt-table 1.2.31 → 1.2.32
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 +5 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +994 -958
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +5 -5
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/Body.js +15 -4
- package/dist/lib/Body.js.map +1 -1
- package/dist/lib/Cell.js +1 -1
- package/dist/lib/Cell.js.map +1 -1
- package/dist/lib/CellHeader.js +5 -2
- package/dist/lib/CellHeader.js.map +1 -1
- package/dist/lib/Config.d.ts +21 -0
- package/dist/lib/Config.js +71 -0
- package/dist/lib/Config.js.map +1 -1
- package/dist/lib/Context.d.ts +3 -0
- package/dist/lib/Context.js +14 -1
- package/dist/lib/Context.js.map +1 -1
- package/dist/lib/Database.d.ts +0 -3
- package/dist/lib/Database.js +0 -15
- package/dist/lib/Database.js.map +1 -1
- package/dist/lib/EVirtTable.d.ts +1 -0
- package/dist/lib/EVirtTable.js +16 -1
- package/dist/lib/EVirtTable.js.map +1 -1
- package/dist/lib/EventTable.js +3 -0
- package/dist/lib/EventTable.js.map +1 -1
- package/dist/lib/Header.js +9 -4
- package/dist/lib/Header.js.map +1 -1
- package/dist/lib/Icons.d.ts +8 -0
- package/dist/lib/Icons.js +17 -17
- package/dist/lib/Icons.js.map +1 -1
- package/dist/lib/Loading.d.ts +9 -0
- package/dist/lib/Loading.js +50 -0
- package/dist/lib/Loading.js.map +1 -0
- package/dist/lib/Paint.js +5 -1
- package/dist/lib/Paint.js.map +1 -1
- package/dist/lib/types.d.ts +2 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var n = (c, t, e) =>
|
|
5
|
-
class
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(":root{--evt-header-font: 12px normal Arial;--evt-body-font: 12px normal Arial;--evt-color-white: #fff;--evt-color-black: #000000;--evt-color-primary: rgb(82, 146, 247);--evt-text-color-primary: #333;--evt-text-color-regular: #666;--evt-text-color-secondary: #999;--evt-box-shadow: 0 2px 12px 0 #0000001a;--evt-editor-bg-color: #fff;--evt-editor-text-color: #333;--evt-border-color: #e1e6eb;--evt-stripe-color: #fafafa;--evt-placeholder-color: #cdd0dc;--evt-header-bg-color: #f8faff;--evt-body-bg-color: #fff;--evt-header-text-color: #1d2129;--evt-body-text-color: #4e5969;--evt-footer-text-color: #4e5969;--evt-loading-icon-color: #4e5969;--evt-expand-icon-color: #4e5969;--evt-shrink-icon-color: #4e5969;--evt-error-tip-icon-color: red;--evt-required-color: #F56C6C;--evt-cell-hover-icon-bg-color: #fff;--evt-cell-hover-icon-border-color: #dde0ea;--evt-scroller-color: #dee0e3;--evt-scroller-track-color: #fff;--evt-scroller-focus-color: #bbbec4;--evt-select-border-color: var(--evt-color-primary);--evt-select-area-color: rgba(82, 146, 247, .1);--evt-select-row-col-bg-color: transparent;--evt-autofill-point-border-color: #fff;--evt-edit-bg-color: #fcf6ed;--evt-checkbox-color: var(--evt-color-primary);--evt-checkbox-uncheck-color: #dde0ea;--evt-checkbox-disabled-color: #f1f2f4;--evt-checkbox-check-disabled-color: #dde0ea;--evt-icon-edit-color: #4e5969;--evt-icon-select-color: #4e5969;--evt-readonly-color: #fff;--evt-readonly-text-color: var(--evt-body-text-color);--evt-error-tip-color: #ed3f14;--evt-footer-bg-color: #fafafa;--evt-highlight-hover-row-color: rgba(186, 203, 231, .1);--evt-highlight-selected-row-color: rgba(82, 146, 247, .1);--evt-tooltip-bg-color: #303133;--evt-tooltip-text-color: #fff;--evt-resize-row-line-color: #e1e6eb;--evt-resize-column-line-color: #e1e6eb;--evt-tree-line-color: #e1e6eb;--evt-sort-icon-color: rgb(82, 146, 247)}.dark{--evt-border-color: #363637;--evt-header-bg-color: #141414;--evt-body-bg-color: #141414;--evt-header-text-color: #a3a6ad;--evt-scroller-color: #414243;--evt-scroller-track-color: #141414;--evt-scroller-focus-color: #a3a6ad;--evt-edit-bg-color: #141414;--evt-readonly-text-color: #cfd3dc;--evt-footer-bg-color: #262727;--evt-autofill-point-border-color: #fff;--evt-editor-bg-color: #434343;--evt-editor-text-color: #cfd3dc}.e-virt-table-container{position:relative;outline:none}.e-virt-table-stage{position:relative;overflow:hidden;outline:none;box-sizing:border-box;z-index:10;border-radius:8px;border:1px solid var(--evt-border-color)}.e-virt-table-canvas{position:absolute;left:0;top:0;box-sizing:border-box;border:none;outline:none;z-index:10}.e-virt-table-editor{position:absolute;top:-10000px;left:-10000px;text-align:left;height:auto;line-height:0;z-index:100;overflow:hidden;background-color:var(--evt-editor-bg-color);border:2px solid var(--evt-color-primary);box-sizing:border-box;box-shadow:var(--evt-box-shadow);display:flex;align-items:center}.e-virt-table-overlayer{position:absolute;left:0;top:0;overflow:hidden;z-index:100;pointer-events:none}.e-virt-table-editor-textarea{width:100%;box-sizing:border-box;outline:none;font-weight:400;padding:8px;font-size:12px;color:inherit;white-space:pre-wrap;word-wrap:break-word;word-break:break-all;line-height:1.5;margin:0;border:none;vertical-align:middle;background:var(--evt-editor-bg-color);color:var(--evt-editor-text-color);overflow-y:auto;resize:none}.e-virt-table-context-menu{position:absolute;font-size:14px;color:var(--evt-text-color-regular);background-color:var(--evt-color-white);border-radius:4px;border:1px solid #e4e7ed;box-shadow:var(--evt-box-shadow);width:fit-content;padding:6px 0;z-index:9999;left:-99999px;top:-99999px}.e-virt-table-context-menu-item{cursor:pointer;padding:8px 24px;color:var(--evt-text-color-regular)}.e-virt-table-context-menu-item:hover{color:var(--evt-color-primary);background-color:#f5f7fa}.e-virt-table-loading{display:none;position:absolute;left:0;top:0;right:0;bottom:0;width:100%;height:100%;z-index:2000;background-color:#fff6;display:flex;align-items:center;justify-content:center}.e-virt-table-loading-spinner{opacity:1;display:flex;flex-direction:column;align-items:center;justify-content:center}.e-virt-table-loading-spinner svg{color:var(--evt-text-color-regular);animation:rotate 1s linear infinite}@keyframes rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.e-virt-table-loading-text{margin:0;font-size:12px;color:var(--evt-text-color-regular)}")),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
|
+
var oe = Object.defineProperty;
|
|
3
|
+
var re = (c, t, e) => t in c ? oe(c, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[t] = e;
|
|
4
|
+
var n = (c, t, e) => re(c, typeof t != "symbol" ? t + "" : t, e);
|
|
5
|
+
class ne {
|
|
6
6
|
constructor(t) {
|
|
7
7
|
n(this, "rules");
|
|
8
8
|
this.rules = t;
|
|
9
9
|
}
|
|
10
10
|
validate(t) {
|
|
11
|
-
const e = [], { column: i, row: s, key: o, rowKey: r, colIndex: a, rowIndex:
|
|
11
|
+
const e = [], { column: i, row: s, key: o, rowKey: r, colIndex: a, rowIndex: l, value: h, field: d, fieldValue: f } = t;
|
|
12
12
|
Array.isArray(this.rules) || (this.rules = [this.rules]);
|
|
13
13
|
for (const u of this.rules) {
|
|
14
14
|
if (u.validator) {
|
|
15
15
|
const x = {
|
|
16
16
|
field: d,
|
|
17
17
|
fieldValue: f,
|
|
18
|
-
value:
|
|
18
|
+
value: h,
|
|
19
19
|
column: i,
|
|
20
20
|
colIndex: a,
|
|
21
|
-
rowIndex:
|
|
21
|
+
rowIndex: l,
|
|
22
22
|
row: s,
|
|
23
23
|
key: o,
|
|
24
24
|
rowKey: r,
|
|
25
25
|
...u
|
|
26
26
|
};
|
|
27
|
-
u.validator(x,
|
|
27
|
+
u.validator(x, h, (w) => {
|
|
28
28
|
w && e.push({
|
|
29
29
|
...x,
|
|
30
30
|
message: w
|
|
31
31
|
});
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
if (!u.required && (
|
|
34
|
+
if (!u.required && (h == null || h === ""))
|
|
35
35
|
return e;
|
|
36
|
-
u.pattern && !u.pattern.test(
|
|
37
|
-
value:
|
|
36
|
+
u.pattern && !u.pattern.test(h) && e.push({
|
|
37
|
+
value: h,
|
|
38
38
|
column: i,
|
|
39
39
|
row: s,
|
|
40
40
|
key: o,
|
|
41
41
|
rowKey: r,
|
|
42
42
|
colIndex: a,
|
|
43
|
-
rowIndex:
|
|
43
|
+
rowIndex: l,
|
|
44
44
|
field: d,
|
|
45
45
|
fieldValue: f,
|
|
46
46
|
message: u.message || `${o} is pattern validation error`
|
|
47
|
-
}), u.required && (
|
|
48
|
-
value:
|
|
47
|
+
}), u.required && (h == null || h === "") && e.push({
|
|
48
|
+
value: h,
|
|
49
49
|
column: i,
|
|
50
50
|
row: s,
|
|
51
51
|
key: o,
|
|
52
52
|
rowKey: r,
|
|
53
53
|
colIndex: a,
|
|
54
|
-
rowIndex:
|
|
54
|
+
rowIndex: l,
|
|
55
55
|
field: d,
|
|
56
56
|
fieldValue: f,
|
|
57
57
|
message: u.message || `${o} is required`
|
|
@@ -60,13 +60,13 @@ class re {
|
|
|
60
60
|
return e;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function Dt() {
|
|
64
64
|
return "xxxxxxxxxxxxxxxxxx".replace(/[x]/g, function(c) {
|
|
65
65
|
const t = Math.random() * 16 | 0;
|
|
66
66
|
return (c === "x" ? t : t & 3 | 8).toString(16);
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function j(c, 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,10 +75,10 @@ function Z(c, t) {
|
|
|
75
75
|
}, a - r));
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
return c.length ? c.map((t) =>
|
|
78
|
+
function Nt(c = []) {
|
|
79
|
+
return c.length ? c.map((t) => Nt(t.children) + 1).sort((t, e) => e - t)[0] : 0;
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function ae(c = []) {
|
|
82
82
|
let t = [], e = [], i = [];
|
|
83
83
|
return c.forEach((s) => {
|
|
84
84
|
s.fixed === "left" ? t.push(s) : s.fixed === "right" ? i.push(s) : e.push(s);
|
|
@@ -88,14 +88,14 @@ function ne(c = []) {
|
|
|
88
88
|
...i.sort((s, o) => (s.sort ?? 0) - (o.sort ?? 0))
|
|
89
89
|
];
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function kt(c = [], t = 1, e = 0) {
|
|
92
92
|
return c.map((i) => {
|
|
93
93
|
if (i.children) {
|
|
94
94
|
let s = 0, o = i.fixed;
|
|
95
95
|
i.children.forEach((a) => {
|
|
96
96
|
a.fixed = o;
|
|
97
97
|
});
|
|
98
|
-
const r =
|
|
98
|
+
const r = kt(i.children, t - 1, e + 1);
|
|
99
99
|
return r && r.forEach((a) => {
|
|
100
100
|
s += a.colspan ?? 0;
|
|
101
101
|
}), {
|
|
@@ -121,7 +121,7 @@ function it(c = []) {
|
|
|
121
121
|
e.children ? t = t.concat(it(e.children)) : t.push(e);
|
|
122
122
|
}), t;
|
|
123
123
|
}
|
|
124
|
-
const Ct = /^(\r\n|\n\r|\r|\n)/,
|
|
124
|
+
const Ct = /^(\r\n|\n\r|\r|\n)/, le = /^[^\t\r\n]+/, bt = /^\t/;
|
|
125
125
|
function he(c) {
|
|
126
126
|
let t = [[""]];
|
|
127
127
|
if (c.length === 0)
|
|
@@ -137,19 +137,19 @@ function he(c) {
|
|
|
137
137
|
if (c.startsWith('"')) {
|
|
138
138
|
let r = 0, a = !0;
|
|
139
139
|
for (; a; ) {
|
|
140
|
-
const
|
|
141
|
-
|
|
140
|
+
const l = c.slice(0, 1);
|
|
141
|
+
l === '"' && (r += 1), o += l, c = c.slice(1), (c.length === 0 || c.match(/^[\t\r\n]/) && r % 2 === 0) && (a = !1);
|
|
142
142
|
}
|
|
143
|
-
o = o.replace(/^"/, "").replace(/"$/, "").replace(/["]*/g, (
|
|
143
|
+
o = o.replace(/^"/, "").replace(/"$/, "").replace(/["]*/g, (l) => new Array(Math.floor(l.length / 2)).fill('"').join(""));
|
|
144
144
|
} else {
|
|
145
|
-
const r = c.match(
|
|
145
|
+
const r = c.match(le);
|
|
146
146
|
o = r ? r[0] : "", c = c.slice(o.length);
|
|
147
147
|
}
|
|
148
148
|
t[i][e] = o;
|
|
149
149
|
}
|
|
150
150
|
return Array.isArray(t) && t.length > 1 && t[t.length - 1].length === 1 && t[t.length - 1][0] === "" && (t = t.slice(0, t.length - 1)), t;
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function ce(c) {
|
|
153
153
|
let t, e, i, s, o = "", r;
|
|
154
154
|
for (t = 0, e = c.length; t < e; t += 1) {
|
|
155
155
|
for (s = c[t].length, i = 0; i < s; i += 1)
|
|
@@ -160,27 +160,27 @@ function le(c) {
|
|
|
160
160
|
}
|
|
161
161
|
return o;
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function Xt(c, t, e = []) {
|
|
164
164
|
let i = 0;
|
|
165
165
|
const s = [];
|
|
166
166
|
return c.forEach((o, r) => {
|
|
167
167
|
if (r === 0)
|
|
168
168
|
s.push(1);
|
|
169
169
|
else {
|
|
170
|
-
const a = e.reduce((
|
|
171
|
-
a ===
|
|
170
|
+
const a = e.reduce((h, d) => `${h}${o[d] ?? ""}`, "") || o[t], l = e.reduce((h, d) => `${h}${c[r - 1][d] ?? ""}`, "") || c[r - 1][t];
|
|
171
|
+
a === l ? (s[i] += 1, s.push(0)) : (s.push(1), i = r);
|
|
172
172
|
}
|
|
173
173
|
}), s;
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function Yt(c, t) {
|
|
176
176
|
let e = "", i = "";
|
|
177
177
|
const s = {};
|
|
178
178
|
return t.forEach((o, r) => {
|
|
179
179
|
r === 0 ? (e = o.key, i = o.key, s[o.key] = 1) : c[o.key] === c[e] ? (s[o.key] = 0, s[i] += 1) : (s[o.key] = 1, e = o.key, i = o.key);
|
|
180
180
|
}), s;
|
|
181
181
|
}
|
|
182
|
-
function
|
|
183
|
-
const { visibleRows: i, rowIndex: s, headIndex: o } = c, r =
|
|
182
|
+
function de(c, t, e = []) {
|
|
183
|
+
const { visibleRows: i, rowIndex: s, headIndex: o } = c, r = Xt(i, t, e);
|
|
184
184
|
return r[s - o] === 0 ? {
|
|
185
185
|
rowspan: 0,
|
|
186
186
|
colspan: 0,
|
|
@@ -193,10 +193,10 @@ function ce(c, t, e = []) {
|
|
|
193
193
|
mergeRow: !0
|
|
194
194
|
};
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function fe(c, t = []) {
|
|
197
197
|
const { column: e, row: i, visibleLeafColumns: s } = c, o = s.filter((r) => t.includes(r.key));
|
|
198
198
|
if (t.includes(e.key)) {
|
|
199
|
-
const r =
|
|
199
|
+
const r = Yt(i, o);
|
|
200
200
|
return r[e.key] === 0 ? {
|
|
201
201
|
rowspan: 0,
|
|
202
202
|
colspan: 0,
|
|
@@ -210,7 +210,7 @@ function de(c, t = []) {
|
|
|
210
210
|
};
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
|
-
function
|
|
213
|
+
function xe(c, t = document.documentElement) {
|
|
214
214
|
const e = c.startsWith("--") ? c : `--${c}`;
|
|
215
215
|
return getComputedStyle(t).getPropertyValue(e).trim();
|
|
216
216
|
}
|
|
@@ -252,27 +252,27 @@ function Rt(c) {
|
|
|
252
252
|
if (o) {
|
|
253
253
|
const r = o.slice(1).map(Number);
|
|
254
254
|
if (s.source.includes("YYYY-MM-DD") || s.source.includes("YYYY/MM/DD") || s.source.includes("YYYY.MM.DD")) {
|
|
255
|
-
const [a,
|
|
256
|
-
return new Date(a,
|
|
255
|
+
const [a, l, h, d = 0, f = 0, u = 0] = r;
|
|
256
|
+
return new Date(a, l - 1, h, d, f, u);
|
|
257
257
|
} else if (s.source.includes("DD-MM-YYYY") || s.source.includes("DD/MM/YYYY") || s.source.includes("DD.MM.YYYY")) {
|
|
258
|
-
const [a,
|
|
259
|
-
return new Date(
|
|
258
|
+
const [a, l, h, d = 0, f = 0, u = 0] = r;
|
|
259
|
+
return new Date(h, l - 1, a, d, f, u);
|
|
260
260
|
} else if (s.source.includes("MM-DD-YYYY") || s.source.includes("MM/DD/YYYY") || s.source.includes("MM.DD.YYYY")) {
|
|
261
|
-
const [a,
|
|
262
|
-
return new Date(
|
|
261
|
+
const [a, l, h, d = 0, f = 0, u = 0] = r;
|
|
262
|
+
return new Date(h, a - 1, l, d, f, u);
|
|
263
263
|
} else if (s.source.includes("YYYYMMDD")) {
|
|
264
|
-
const [a,
|
|
265
|
-
return new Date(a,
|
|
264
|
+
const [a, l, h] = r;
|
|
265
|
+
return new Date(a, l - 1, h);
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
269
|
return /* @__PURE__ */ new Date(NaN);
|
|
270
270
|
}
|
|
271
|
-
function
|
|
271
|
+
function ue(c, t) {
|
|
272
272
|
const e = Rt(c), i = Rt(t);
|
|
273
273
|
return isNaN(e.getTime()) && isNaN(i.getTime()) ? 0 : isNaN(e.getTime()) ? -1 : isNaN(i.getTime()) ? 1 : e.getTime() - i.getTime();
|
|
274
274
|
}
|
|
275
|
-
class
|
|
275
|
+
class Bt {
|
|
276
276
|
constructor(t, e, i, s, o, r, a) {
|
|
277
277
|
n(this, "ctx");
|
|
278
278
|
n(this, "x", 0);
|
|
@@ -318,9 +318,9 @@ class Yt {
|
|
|
318
318
|
getRightFixedX() {
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
|
-
class ut extends
|
|
322
|
-
constructor(e, i, s, o, r, a,
|
|
323
|
-
super(e, o, r, a,
|
|
321
|
+
class ut extends Bt {
|
|
322
|
+
constructor(e, i, s, o, r, a, l, h, d, f = "body") {
|
|
323
|
+
super(e, o, r, a, l, f, h.fixed);
|
|
324
324
|
n(this, "formatter");
|
|
325
325
|
n(this, "formatterFooter");
|
|
326
326
|
n(this, "hoverIconName", "");
|
|
@@ -401,7 +401,7 @@ class ut extends Yt {
|
|
|
401
401
|
n(this, "overflowTooltipMaxWidth", 500);
|
|
402
402
|
n(this, "overflowTooltipPlacement", "top");
|
|
403
403
|
n(this, "maxLineClamp", "auto");
|
|
404
|
-
this.visibleWidth = this.width, this.visibleHeight = this.height, this.colIndex = s, this.rowIndex = i, this.key =
|
|
404
|
+
this.visibleWidth = this.width, this.visibleHeight = this.height, this.colIndex = s, this.rowIndex = i, this.key = h.key, this.type = h.type || "", this.editorType = h.editorType || "text", this.selectorCellValueType = h.selectorCellValueType || this.ctx.config.SELECTOR_CELL_VALUE_TYPE || "value", this.editorProps = h.editorProps || {}, this.cellType = f, this.align = h.align || this.ctx.config.COLUMNS_ALIGN, this.verticalAlign = h.verticalAlign || this.ctx.config.COLUMNS_VERTICAL_ALIGN, this.fixed = h.fixed, this.level = h.level || 0, this.operation = h.operation || !1, this.column = h, this.rules = h.rules || [], this.row = d, this.rowKey = this.cellType === "body" ? this.ctx.database.getRowKeyForRowIndex(i) : `${this.cellType}_${this.rowIndex}`, this.value = this.getValue(), this.render = h.render, this.overflowTooltipShow = h.overflowTooltipShow !== !1, this.autoRowHeight = h.autoRowHeight !== void 0 ? h.autoRowHeight : this.ctx.config.AUTO_ROW_HEIGHT, this.overflowTooltipMaxWidth = h.overflowTooltipMaxWidth || 500, this.overflowTooltipPlacement = h.overflowTooltipPlacement || "top", this.renderFooter = h.renderFooter, this.hoverIconName = h.hoverIconName, this.formatter = h.formatter, this.formatterFooter = h.formatterFooter, this.maxLineClamp = h.maxLineClamp || "auto", this.update();
|
|
405
405
|
}
|
|
406
406
|
setWidthHeight(e, i) {
|
|
407
407
|
this.width = e, this.height = i;
|
|
@@ -427,8 +427,8 @@ class ut extends Yt {
|
|
|
427
427
|
rowspan: o = 1,
|
|
428
428
|
relationRowKeys: r,
|
|
429
429
|
relationColKeys: a,
|
|
430
|
-
mergeRow:
|
|
431
|
-
mergeCol:
|
|
430
|
+
mergeRow: l = !1,
|
|
431
|
+
mergeCol: h = !1
|
|
432
432
|
} = i({
|
|
433
433
|
row: this.row,
|
|
434
434
|
rowIndex: this.rowIndex,
|
|
@@ -441,7 +441,7 @@ class ut extends Yt {
|
|
|
441
441
|
visibleLeafColumns: this.ctx.header.visibleLeafColumns,
|
|
442
442
|
rows: this.ctx.body.data
|
|
443
443
|
}) || {};
|
|
444
|
-
Array.isArray(r) && r.length > 0 ? this.relationRowKeys = r : this.relationRowKeys = [this.key], Array.isArray(a) && a.length > 0 ? this.relationColKeys = a : this.relationColKeys = [this.key], this.mergeCol =
|
|
444
|
+
Array.isArray(r) && r.length > 0 ? this.relationRowKeys = r : this.relationRowKeys = [this.key], Array.isArray(a) && a.length > 0 ? this.relationColKeys = a : this.relationColKeys = [this.key], this.mergeCol = h, this.mergeRow = l, this.colspan = s, this.rowspan = o, this.visibleWidth = this.getWidthByColIndexColSpan(this.colIndex, this.colspan), this.visibleHeight = this.ctx.database.getHeightByRowIndexRowSpan(this.rowIndex, this.rowspan);
|
|
445
445
|
}
|
|
446
446
|
}
|
|
447
447
|
updateSpanInfo() {
|
|
@@ -519,31 +519,31 @@ class ut extends Yt {
|
|
|
519
519
|
let o, r = 0, a = "";
|
|
520
520
|
if (!(["tree", "selection-tree", "tree-selection"].includes(this.type) && s === "body"))
|
|
521
521
|
return;
|
|
522
|
-
const
|
|
523
|
-
this.rowExpand =
|
|
524
|
-
const { TREE_INDENT: x = 16, CHECKBOX_SIZE: w, TREE_ICON_SIZE:
|
|
522
|
+
const l = this.ctx.database.getRowForRowKey(i), { expand: h = !1, hasChildren: d = !1, expandLoading: f = !1, level: u = 0 } = l || {};
|
|
523
|
+
this.rowExpand = h, this.rowHasChildren = d;
|
|
524
|
+
const { TREE_INDENT: x = 16, CHECKBOX_SIZE: w, TREE_ICON_SIZE: E } = this.ctx.config;
|
|
525
525
|
if (r = u * x, f) {
|
|
526
526
|
const I = this.ctx.icons.get("loading");
|
|
527
527
|
a = "loading", o = I;
|
|
528
528
|
} else if (d) {
|
|
529
|
-
const I = this.ctx.icons.get("expand"),
|
|
530
|
-
o =
|
|
529
|
+
const I = this.ctx.icons.get("expand"), _ = this.ctx.icons.get("shrink");
|
|
530
|
+
o = h ? _ : I, a = h ? "shrink" : "expand";
|
|
531
531
|
}
|
|
532
|
-
let g =
|
|
532
|
+
let g = E, m = E, y = this.drawX;
|
|
533
533
|
(this.align === "center" || this.align === "right") && (y = this.drawX + (this.visibleWidth - g - 2 * e) / 2, this.align = "left");
|
|
534
|
-
let
|
|
535
|
-
this.type === "selection-tree" ? (
|
|
534
|
+
let p = y + r + e, R = this.drawY + (this.visibleHeight - m) / 2, C = r + this.drawX + g - 0.5;
|
|
535
|
+
this.type === "selection-tree" ? (p = r + this.drawSelectionImageX + this.drawSelectionImageWidth, C = p + g - e / 2) : this.type === "tree-selection" ? C = p + w + g - e / 2 : C = p + g - e / 2, this.drawTextX = C, this.drawTextWidth = this.drawX + this.visibleWidth - C, !(p + g + e > this.drawX + this.visibleWidth) && (R + m + e > this.drawY + this.visibleHeight || (this.drawTreeImageX = p, this.drawTreeImageY = R, this.drawTreeImageWidth = g, this.drawTreeImageHeight = m, o ? (this.drawTreeImageName = a, this.drawTreeImageSource = o) : (this.drawTreeImageName = "", this.drawTreeImageSource = void 0)));
|
|
536
536
|
}
|
|
537
537
|
drawTreeLine() {
|
|
538
538
|
const { TREE_LINE: e, TREE_INDENT: i = 16, TREE_ICON_SIZE: s = 16, TREE_LINE_COLOR: o = "#e1e6eb" } = this.ctx.config;
|
|
539
539
|
if (!e || this.cellType !== "body" || !["tree", "selection-tree", "tree-selection"].includes(this.type) || this.rowspan === 0 || this.colspan === 0) return;
|
|
540
|
-
const r = this.ctx.database.getRowForRowKey(this.rowKey) || {}, a = r.level ?? 0,
|
|
540
|
+
const r = this.ctx.database.getRowForRowKey(this.rowKey) || {}, a = r.level ?? 0, l = this.drawTreeImageX + this.drawTreeImageWidth / 2, h = this.drawTreeImageY + this.drawTreeImageHeight / 2;
|
|
541
541
|
let d = this.drawTreeImageX - a * i;
|
|
542
542
|
const f = Array.isArray(r.parentRowKeys) ? r.parentRowKeys : [];
|
|
543
543
|
if (a > 0) {
|
|
544
544
|
for (let g = 0; g < a - 1; g += 1) {
|
|
545
|
-
const
|
|
546
|
-
if (!!(
|
|
545
|
+
const m = f[g + 1];
|
|
546
|
+
if (!!(m ? this.ctx.database.getRowForRowKey(m) || {} : {}).isLastChild) continue;
|
|
547
547
|
const R = Math.round(this.drawTreeImageX - (a - g) * i + s / 2);
|
|
548
548
|
this.ctx.paint.drawLine([R, this.drawY, R, this.drawY + this.visibleHeight], {
|
|
549
549
|
borderColor: o,
|
|
@@ -552,15 +552,15 @@ class ut extends Yt {
|
|
|
552
552
|
lineDashOffset: 0
|
|
553
553
|
});
|
|
554
554
|
}
|
|
555
|
-
const u = Math.round(this.drawTreeImageX - i + s / 2), w = !!r.isLastChild ?
|
|
555
|
+
const u = Math.round(this.drawTreeImageX - i + s / 2), w = !!r.isLastChild ? h : this.drawY + this.visibleHeight;
|
|
556
556
|
this.ctx.paint.drawLine([u, this.drawY, u, w], {
|
|
557
557
|
borderColor: o,
|
|
558
558
|
borderWidth: 1,
|
|
559
559
|
lineDash: [4, 4],
|
|
560
560
|
lineDashOffset: 0
|
|
561
561
|
});
|
|
562
|
-
const
|
|
563
|
-
this.ctx.paint.drawLine([
|
|
562
|
+
const E = Math.round(d + (a - 1) * i + s / 2);
|
|
563
|
+
this.ctx.paint.drawLine([E, h, l, h], {
|
|
564
564
|
borderColor: o,
|
|
565
565
|
borderWidth: 1,
|
|
566
566
|
lineDash: [4, 4],
|
|
@@ -569,7 +569,7 @@ class ut extends Yt {
|
|
|
569
569
|
}
|
|
570
570
|
if (r.hasChildren && r.expand) {
|
|
571
571
|
const u = this.drawTreeImageY + this.drawTreeImageHeight, x = this.drawY + this.visibleHeight;
|
|
572
|
-
this.ctx.paint.drawLine([
|
|
572
|
+
this.ctx.paint.drawLine([l, u, l, x], {
|
|
573
573
|
borderColor: o,
|
|
574
574
|
borderWidth: 1,
|
|
575
575
|
lineDash: [4, 4],
|
|
@@ -585,41 +585,41 @@ class ut extends Yt {
|
|
|
585
585
|
FOOTER_CELL_STYLE_METHOD: o,
|
|
586
586
|
READONLY_TEXT_COLOR: r,
|
|
587
587
|
BODY_TEXT_COLOR: a,
|
|
588
|
-
FOOTER_TEXT_COLOR:
|
|
589
|
-
FOOTER_BG_COLOR:
|
|
588
|
+
FOOTER_TEXT_COLOR: l,
|
|
589
|
+
FOOTER_BG_COLOR: h,
|
|
590
590
|
HIGHLIGHT_SELECTED_ROW: d,
|
|
591
591
|
HIGHLIGHT_SELECTED_ROW_COLOR: f,
|
|
592
592
|
HIGHLIGHT_HOVER_ROW: u,
|
|
593
593
|
HIGHLIGHT_HOVER_ROW_COLOR: x,
|
|
594
594
|
STRIPE: w,
|
|
595
|
-
STRIPE_COLOR:
|
|
595
|
+
STRIPE_COLOR: E
|
|
596
596
|
} = this.ctx.config;
|
|
597
597
|
if (this.cellType === "footer") {
|
|
598
|
-
let
|
|
598
|
+
let _ = h, v = l;
|
|
599
599
|
if (typeof o == "function") {
|
|
600
|
-
const
|
|
600
|
+
const S = o, { backgroundColor: b, color: O } = S({
|
|
601
601
|
row: this.row,
|
|
602
602
|
rowIndex: this.rowIndex,
|
|
603
603
|
colIndex: this.colIndex,
|
|
604
604
|
column: this.column,
|
|
605
605
|
value: this.getValue()
|
|
606
606
|
}) || {};
|
|
607
|
-
b && (
|
|
607
|
+
b && (_ = b), O && (v = O);
|
|
608
608
|
}
|
|
609
|
-
this.drawCellSkyBgColor = "transparent", this.drawCellBgColor =
|
|
609
|
+
this.drawCellSkyBgColor = "transparent", this.drawCellBgColor = _, this.drawTextColor = v;
|
|
610
610
|
return;
|
|
611
611
|
}
|
|
612
612
|
let g = "transparent";
|
|
613
|
-
const
|
|
614
|
-
let
|
|
613
|
+
const m = this.ctx.hoverCell, y = this.ctx.currentCell;
|
|
614
|
+
let p = this.rowIndex, R = this.rowIndex;
|
|
615
615
|
if (this.rowspan !== 1 && (u || d)) {
|
|
616
|
-
const
|
|
617
|
-
|
|
616
|
+
const _ = this.getSpanInfo(), { yArr: v } = _;
|
|
617
|
+
p = v[0], R = v[1];
|
|
618
618
|
}
|
|
619
|
-
u &&
|
|
619
|
+
u && m && (m.rowKey === this.rowKey && (g = x), m.rowIndex >= p && m.rowIndex <= R && (g = x)), d && y && (y.rowKey === this.rowKey && (g = f), y.rowIndex >= p && y.rowIndex <= R && (g = f)), this.drawCellSkyBgColor = g;
|
|
620
620
|
let C = e, I = a;
|
|
621
|
-
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (C = i, I = r), w && (this.rowIndex % 2 ? C =
|
|
622
|
-
const
|
|
621
|
+
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (C = i, I = r), w && (this.rowIndex % 2 ? C = E : C = e), typeof s == "function") {
|
|
622
|
+
const _ = s, { backgroundColor: v, color: S } = _({
|
|
623
623
|
row: this.row,
|
|
624
624
|
rowIndex: this.rowIndex,
|
|
625
625
|
colIndex: this.colIndex,
|
|
@@ -627,60 +627,60 @@ class ut extends Yt {
|
|
|
627
627
|
isHasChanged: this.isHasChanged,
|
|
628
628
|
value: this.getValue()
|
|
629
629
|
}) || {};
|
|
630
|
-
|
|
630
|
+
v && (C = v), S && (I = S);
|
|
631
631
|
}
|
|
632
632
|
this.drawCellBgColor = C, this.drawTextColor = I;
|
|
633
633
|
}
|
|
634
634
|
updateSelection() {
|
|
635
|
-
const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: o, cellType: r, type: a, rowIndex:
|
|
635
|
+
const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: o, cellType: r, type: a, rowIndex: l, rowKey: h } = this;
|
|
636
636
|
if (s === 0 || o === 0 || r === "footer" || !["index-selection", "selection", "selection-tree", "tree-selection"].includes(a))
|
|
637
637
|
return;
|
|
638
|
-
const d = this.ctx.database.getRowSelectable(
|
|
638
|
+
const d = this.ctx.database.getRowSelectable(h), { CHECKBOX_SIZE: f = 0, CELL_PADDING: u } = this.ctx.config;
|
|
639
639
|
let x = this.drawX + u;
|
|
640
640
|
(this.align === "center" || this.align === "right") && (x = this.drawX + (e - f) / 2);
|
|
641
|
-
let w = x,
|
|
641
|
+
let w = x, E = this.drawY + (i - f) / 2;
|
|
642
642
|
if (a !== "selection-tree") {
|
|
643
643
|
if (a === "tree-selection") {
|
|
644
|
-
const { TREE_INDENT: y = 16, TREE_ICON_SIZE:
|
|
645
|
-
w = x +
|
|
644
|
+
const { TREE_INDENT: y = 16, TREE_ICON_SIZE: p } = this.ctx.config, R = this.ctx.database.getRowForRowKey(h), { level: C = 0 } = R || {}, I = C * y;
|
|
645
|
+
w = x + p + I;
|
|
646
646
|
}
|
|
647
647
|
}
|
|
648
|
-
let g = this.ctx.icons.get("checkbox-uncheck"),
|
|
648
|
+
let g = this.ctx.icons.get("checkbox-uncheck"), m = "checkbox-uncheck";
|
|
649
649
|
if (a === "selection-tree" || a === "tree-selection") {
|
|
650
|
-
const y = this.ctx.database.getTreeSelectionState(
|
|
651
|
-
y.indeterminate && d ? (g = this.ctx.icons.get("checkbox-indeterminate"),
|
|
650
|
+
const y = this.ctx.database.getTreeSelectionState(h);
|
|
651
|
+
y.indeterminate && d ? (g = this.ctx.icons.get("checkbox-indeterminate"), m = "checkbox-indeterminate") : y.checked && d ? (g = this.ctx.icons.get("checkbox-check"), m = "checkbox-check") : !y.checked && d ? (g = this.ctx.icons.get("checkbox-uncheck"), m = "checkbox-uncheck") : (g = this.ctx.icons.get("checkbox-disabled"), m = "checkbox-disabled");
|
|
652
652
|
} else {
|
|
653
|
-
const y = this.ctx.database.getRowSelection(
|
|
654
|
-
y && d ? (g = this.ctx.icons.get("checkbox-check"),
|
|
653
|
+
const y = this.ctx.database.getRowSelection(h);
|
|
654
|
+
y && d ? (g = this.ctx.icons.get("checkbox-check"), m = "checkbox-check") : y && !d ? (g = this.ctx.icons.get("checkbox-check-disabled"), m = "checkbox-check-disabled") : !y && d ? (g = this.ctx.icons.get("checkbox-uncheck"), m = "checkbox-uncheck") : (g = this.ctx.icons.get("checkbox-disabled"), m = "checkbox-disabled");
|
|
655
655
|
}
|
|
656
|
-
w + f + u > this.drawX + this.visibleWidth ||
|
|
656
|
+
w + f + u > this.drawX + this.visibleWidth || E + f + u > this.drawY + this.visibleHeight || (a === "index-selection" ? (this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === l || ["checkbox-disabled", "checkbox-check"].includes(m)) && (this.drawSelectionImageX = w, this.drawSelectionImageY = E, this.drawSelectionImageWidth = f, this.drawSelectionImageHeight = f, this.drawSelectionImageName = m, this.drawSelectionImageSource = g) : (this.drawSelectionImageX = w, this.drawSelectionImageY = E, this.drawSelectionImageWidth = f, this.drawSelectionImageHeight = f, this.drawSelectionImageName = m, this.drawSelectionImageSource = g));
|
|
657
657
|
}
|
|
658
658
|
updateHoverIcon() {
|
|
659
659
|
if (this.ctx.database.getReadonly(this.rowKey, this.key))
|
|
660
660
|
return;
|
|
661
661
|
const { BODY_CELL_HOVER_ICON_METHOD: i, CELL_HOVER_ICON_SIZE: s, CELL_PADDING: o, ENABLE_MERGE_CELL_LINK: r } = this.ctx.config;
|
|
662
662
|
if (typeof i == "function") {
|
|
663
|
-
const
|
|
663
|
+
const h = i({
|
|
664
664
|
row: this.row,
|
|
665
665
|
rowIndex: this.rowIndex,
|
|
666
666
|
colIndex: this.colIndex,
|
|
667
667
|
column: this.column,
|
|
668
668
|
value: this.getValue()
|
|
669
669
|
});
|
|
670
|
-
|
|
670
|
+
h !== void 0 && (this.hoverIconName = h);
|
|
671
671
|
}
|
|
672
672
|
const { hoverCell: a } = this.ctx;
|
|
673
673
|
if (this.hoverIconName && !this.ctx.editing && a) {
|
|
674
|
-
let
|
|
675
|
-
if (a.rowKey === this.rowKey && (
|
|
674
|
+
let l = 0, h = 0;
|
|
675
|
+
if (a.rowKey === this.rowKey && (l = this.drawX + this.width - s - o, h = this.drawY + (this.height - s) / 2), this.rowspan !== 1 && r) {
|
|
676
676
|
const f = this.getSpanInfo(), { yArr: u } = f, x = u[0], w = u[1];
|
|
677
677
|
if (a.rowIndex >= x && a.rowIndex <= w) {
|
|
678
|
-
const { width:
|
|
679
|
-
|
|
678
|
+
const { width: E, height: g, offsetTop: m, offsetLeft: y } = f;
|
|
679
|
+
l = this.drawX - y + E - s - o, h = this.drawY - m + (g - s) / 2;
|
|
680
680
|
}
|
|
681
681
|
}
|
|
682
682
|
const d = this.ctx.icons.get(this.hoverIconName);
|
|
683
|
-
this.drawHoverImageX =
|
|
683
|
+
this.drawHoverImageX = l, this.drawHoverImageY = h, this.drawHoverImageWidth = s, this.drawHoverImageHeight = s, this.drawHoverImageName = this.hoverIconName, this.drawHoverImageSource = d;
|
|
684
684
|
}
|
|
685
685
|
}
|
|
686
686
|
/**
|
|
@@ -803,10 +803,10 @@ class ut extends Yt {
|
|
|
803
803
|
const { SELECT_BORDER_COLOR: e, ENABLE_AUTOFILL: i, ENABLE_SELECTOR: s, AUTOFILL_POINT_BORDER_COLOR: o } = this.ctx.config;
|
|
804
804
|
if (!s || !i || this.ctx.editing)
|
|
805
805
|
return;
|
|
806
|
-
const { xArr: r, yArr: a } = this.ctx.selector,
|
|
807
|
-
if (d ===
|
|
808
|
-
const
|
|
809
|
-
this.ctx.paint.drawRect(u + this.width -
|
|
806
|
+
const { xArr: r, yArr: a } = this.ctx.selector, l = r[1], h = a[1], { colIndex: d, rowIndex: f, drawX: u, drawY: x } = this;
|
|
807
|
+
if (d === l && f === h) {
|
|
808
|
+
const E = d === this.ctx.maxColIndex || f === this.ctx.maxRowIndex || d === this.ctx.lastCenterColIndex ? 6 : 4;
|
|
809
|
+
this.ctx.paint.drawRect(u + this.width - E, x + this.height - E, 6, 6, {
|
|
810
810
|
borderColor: o,
|
|
811
811
|
fillColor: e
|
|
812
812
|
});
|
|
@@ -831,8 +831,8 @@ class ut extends Yt {
|
|
|
831
831
|
}
|
|
832
832
|
drawText() {
|
|
833
833
|
const { CELL_PADDING: e, BODY_FONT: i, PLACEHOLDER_COLOR: s, CELL_LINE_HEIGHT: o } = this.ctx.config, { placeholder: r } = this.column;
|
|
834
|
-
let a = this.displayText,
|
|
835
|
-
if (!this.ctx.database.getReadonly(this.rowKey, this.key) && r && ["", null, void 0].includes(this.text) && this.cellType === "body" && !(this.rowspan === 0 || this.colspan === 0) && (a = r,
|
|
834
|
+
let a = this.displayText, l = this.drawTextColor;
|
|
835
|
+
if (!this.ctx.database.getReadonly(this.rowKey, this.key) && r && ["", null, void 0].includes(this.text) && this.cellType === "body" && !(this.rowspan === 0 || this.colspan === 0) && (a = r, l = s), ["", null, void 0].includes(a))
|
|
836
836
|
return !1;
|
|
837
837
|
typeof a != "string" && (a = `${a}`);
|
|
838
838
|
const d = `${a}_${this.drawTextWidth}`;
|
|
@@ -847,7 +847,7 @@ class ut extends Yt {
|
|
|
847
847
|
padding: e,
|
|
848
848
|
align: this.align,
|
|
849
849
|
verticalAlign: this.verticalAlign,
|
|
850
|
-
color:
|
|
850
|
+
color: l,
|
|
851
851
|
autoRowHeight: this.autoRowHeight,
|
|
852
852
|
lineHeight: o,
|
|
853
853
|
maxLineClamp: this.maxLineClamp,
|
|
@@ -918,11 +918,11 @@ class ut extends Yt {
|
|
|
918
918
|
fillColor: "transparent",
|
|
919
919
|
borderWidth: 1
|
|
920
920
|
});
|
|
921
|
-
const [a,
|
|
922
|
-
!(a ===
|
|
921
|
+
const [a, l] = i, [h, d] = s;
|
|
922
|
+
!(a === l && h === d) && this.colIndex >= a && this.colIndex <= l && this.rowIndex >= h && this.rowIndex <= d && this.ctx.paint.drawRect(this.drawX, this.drawY, this.width, this.height, {
|
|
923
923
|
borderColor: "transparent",
|
|
924
924
|
fillColor: this.ctx.config.SELECT_AREA_COLOR || "rgba(82,146,247,0.1)"
|
|
925
|
-
}), this.operation && this.rowIndex >=
|
|
925
|
+
}), this.operation && this.rowIndex >= h && this.rowIndex <= d && this.ctx.paint.drawRect(this.drawX, this.drawY, this.visibleWidth, this.visibleHeight, {
|
|
926
926
|
borderColor: "transparent",
|
|
927
927
|
fillColor: this.ctx.config.SELECT_ROW_COL_BG_COLOR || "transparent"
|
|
928
928
|
});
|
|
@@ -947,13 +947,13 @@ class ut extends Yt {
|
|
|
947
947
|
});
|
|
948
948
|
}
|
|
949
949
|
drawBorder(e) {
|
|
950
|
-
const { drawX: i, drawY: s, rowIndex: o, colIndex: r, height: a, width:
|
|
951
|
-
let
|
|
952
|
-
const { xArr: f, yArr: u, lineDash: x = [], borderWidth: w = 1, borderColor:
|
|
953
|
-
if (r >=
|
|
954
|
-
const C = r === y ? 1 : 0, I = r ===
|
|
955
|
-
this.ctx.paint.drawLine([
|
|
956
|
-
borderColor:
|
|
950
|
+
const { drawX: i, drawY: s, rowIndex: o, colIndex: r, height: a, width: l } = this;
|
|
951
|
+
let h = i, d = s;
|
|
952
|
+
const { xArr: f, yArr: u, lineDash: x = [], borderWidth: w = 1, borderColor: E, fillColor: g } = e, m = f[0], y = f[1], p = u[0], R = u[1];
|
|
953
|
+
if (r >= m && r <= y && o === p) {
|
|
954
|
+
const C = r === y ? 1 : 0, I = r === m ? 1 : 0;
|
|
955
|
+
this.ctx.paint.drawLine([h + I, d + 1, h + l - C, d + 1], {
|
|
956
|
+
borderColor: E,
|
|
957
957
|
fillColor: g,
|
|
958
958
|
borderWidth: w,
|
|
959
959
|
lineCap: "round",
|
|
@@ -961,10 +961,10 @@ class ut extends Yt {
|
|
|
961
961
|
lineDash: x
|
|
962
962
|
});
|
|
963
963
|
}
|
|
964
|
-
if (r === y && o >=
|
|
965
|
-
const C = o ===
|
|
966
|
-
this.ctx.paint.drawLine([
|
|
967
|
-
borderColor:
|
|
964
|
+
if (r === y && o >= p && o <= R) {
|
|
965
|
+
const C = o === p ? 1 : 0, I = o === R ? 1 : 0;
|
|
966
|
+
this.ctx.paint.drawLine([h + l - 1, d + C, h + l - 1, d + a - I], {
|
|
967
|
+
borderColor: E,
|
|
968
968
|
fillColor: g,
|
|
969
969
|
borderWidth: w,
|
|
970
970
|
lineCap: "round",
|
|
@@ -972,10 +972,10 @@ class ut extends Yt {
|
|
|
972
972
|
lineDash: x
|
|
973
973
|
});
|
|
974
974
|
}
|
|
975
|
-
if (r >=
|
|
976
|
-
const C = r === y ? 1 : 0, I = r ===
|
|
977
|
-
this.ctx.paint.drawLine([
|
|
978
|
-
borderColor:
|
|
975
|
+
if (r >= m && r <= y && o === R) {
|
|
976
|
+
const C = r === y ? 1 : 0, I = r === m ? 1 : 0;
|
|
977
|
+
this.ctx.paint.drawLine([h + I, d + a - 1, h + l - C, d + a - 1], {
|
|
978
|
+
borderColor: E,
|
|
979
979
|
fillColor: g,
|
|
980
980
|
borderWidth: w,
|
|
981
981
|
lineCap: "round",
|
|
@@ -983,10 +983,10 @@ class ut extends Yt {
|
|
|
983
983
|
lineDash: x
|
|
984
984
|
});
|
|
985
985
|
}
|
|
986
|
-
if (r ===
|
|
987
|
-
const C = o === R ? 1 : 0, I = o ===
|
|
988
|
-
this.ctx.paint.drawLine([
|
|
989
|
-
borderColor:
|
|
986
|
+
if (r === m && o >= p && o <= R) {
|
|
987
|
+
const C = o === R ? 1 : 0, I = o === p ? 1 : 0;
|
|
988
|
+
this.ctx.paint.drawLine([h + 1, d + I, h + 1, d + a - C], {
|
|
989
|
+
borderColor: E,
|
|
990
990
|
fillColor: g,
|
|
991
991
|
borderWidth: w,
|
|
992
992
|
lineCap: "round",
|
|
@@ -996,9 +996,8 @@ class ut extends Yt {
|
|
|
996
996
|
}
|
|
997
997
|
}
|
|
998
998
|
}
|
|
999
|
-
class
|
|
999
|
+
class ge {
|
|
1000
1000
|
constructor(t, e) {
|
|
1001
|
-
n(this, "loading", !1);
|
|
1002
1001
|
n(this, "ctx");
|
|
1003
1002
|
n(this, "data");
|
|
1004
1003
|
n(this, "columns");
|
|
@@ -1030,7 +1029,7 @@ class ue {
|
|
|
1030
1029
|
n(this, "sortState", /* @__PURE__ */ new Map());
|
|
1031
1030
|
this.ctx = t;
|
|
1032
1031
|
const { data: i = [], columns: s = [], footerData: o = [] } = e;
|
|
1033
|
-
this.data = i, this.footerData = o, this.columns = s, this.
|
|
1032
|
+
this.data = i, this.footerData = o, this.columns = s, this.init();
|
|
1034
1033
|
}
|
|
1035
1034
|
// 初始化默认不忽略清空改变值和校验map
|
|
1036
1035
|
init(t = !0) {
|
|
@@ -1058,26 +1057,26 @@ class ue {
|
|
|
1058
1057
|
const s = t.length;
|
|
1059
1058
|
t.forEach((o, r) => {
|
|
1060
1059
|
var y;
|
|
1061
|
-
const { ROW_KEY: a = "", DEFAULT_EXPAND_ALL:
|
|
1060
|
+
const { ROW_KEY: a = "", DEFAULT_EXPAND_ALL: l, CELL_HEIGHT: h, SELECTABLE_METHOD: d, CHECKBOX_KEY: f } = this.ctx.config, u = o[a], x = u != null ? `${u}` : Dt();
|
|
1062
1061
|
this.itemRowKeyMap.set(o, x);
|
|
1063
|
-
const w = o._height ||
|
|
1062
|
+
const w = o._height || h, E = o._readonly;
|
|
1064
1063
|
let g = !0;
|
|
1065
1064
|
if (typeof d == "function" && (g = d), f) {
|
|
1066
|
-
const
|
|
1067
|
-
if (this.checkboxKeyMap.has(
|
|
1068
|
-
const R = this.checkboxKeyMap.get(
|
|
1069
|
-
R.push(x), this.checkboxKeyMap.set(
|
|
1065
|
+
const p = o[f];
|
|
1066
|
+
if (this.checkboxKeyMap.has(p)) {
|
|
1067
|
+
const R = this.checkboxKeyMap.get(p) || [];
|
|
1068
|
+
R.push(x), this.checkboxKeyMap.set(p, R);
|
|
1070
1069
|
} else
|
|
1071
|
-
this.checkboxKeyMap.set(
|
|
1070
|
+
this.checkboxKeyMap.set(p, [x]);
|
|
1072
1071
|
}
|
|
1073
1072
|
this.selectionMap.set(x, {
|
|
1074
1073
|
key: f ? o[f] : x,
|
|
1075
1074
|
row: o,
|
|
1076
1075
|
check: ((y = this.selectionMap.get(x)) == null ? void 0 : y.check) || !1
|
|
1077
1076
|
});
|
|
1078
|
-
const
|
|
1079
|
-
this.expandMap.set(x,
|
|
1080
|
-
readonly:
|
|
1077
|
+
const m = l || this.expandMap.get(x) || o._expand || !1;
|
|
1078
|
+
this.expandMap.set(x, m), this.rowKeyMap.set(x, {
|
|
1079
|
+
readonly: E,
|
|
1081
1080
|
index: r,
|
|
1082
1081
|
rowIndex: r,
|
|
1083
1082
|
level: e,
|
|
@@ -1085,7 +1084,7 @@ class ue {
|
|
|
1085
1084
|
calculatedHeight: -1,
|
|
1086
1085
|
check: !1,
|
|
1087
1086
|
selectable: g,
|
|
1088
|
-
expand:
|
|
1087
|
+
expand: m,
|
|
1089
1088
|
expandLazy: !1,
|
|
1090
1089
|
hasChildren: o._hasChildren || (Array.isArray(o.children) ? o.children.length > 0 : !1),
|
|
1091
1090
|
expandLoading: !1,
|
|
@@ -1157,7 +1156,7 @@ class ue {
|
|
|
1157
1156
|
this.columns = t, this.clearBufferData();
|
|
1158
1157
|
}
|
|
1159
1158
|
setData(t) {
|
|
1160
|
-
this.data = t, this.
|
|
1159
|
+
this.data = t, this.init();
|
|
1161
1160
|
}
|
|
1162
1161
|
/**
|
|
1163
1162
|
* 统一转化数据,给画body使用,包括过滤树状等,统一入口
|
|
@@ -1175,13 +1174,13 @@ class ue {
|
|
|
1175
1174
|
const i = (o) => {
|
|
1176
1175
|
o.forEach((r) => {
|
|
1177
1176
|
t.push(r);
|
|
1178
|
-
const a = this.itemRowKeyMap.get(r), { expand:
|
|
1177
|
+
const a = this.itemRowKeyMap.get(r), { expand: l, hasChildren: h, height: d, calculatedHeight: f } = this.rowKeyMap.get(a), u = this.sumHeight, x = Math.max(f, d);
|
|
1179
1178
|
this.sumHeight += x, this.rowIndexRowKeyMap.set(e, a), this.rowKeyRowIndexMap.set(a, e), this.positions.push({
|
|
1180
1179
|
top: u,
|
|
1181
1180
|
height: x,
|
|
1182
1181
|
bottom: this.sumHeight,
|
|
1183
1182
|
calculatedHeight: f
|
|
1184
|
-
}), e += 1,
|
|
1183
|
+
}), e += 1, l && h && i(r.children);
|
|
1185
1184
|
});
|
|
1186
1185
|
};
|
|
1187
1186
|
this.rowIndexRowKeyMap.clear(), this.rowKeyRowIndexMap.clear();
|
|
@@ -1258,18 +1257,18 @@ class ue {
|
|
|
1258
1257
|
*/
|
|
1259
1258
|
applySingleColumnSort(t, e, i, s) {
|
|
1260
1259
|
return t.sort((o, r) => {
|
|
1261
|
-
const a = o[e],
|
|
1262
|
-
let
|
|
1260
|
+
const a = o[e], l = r[e];
|
|
1261
|
+
let h = 0;
|
|
1263
1262
|
if (typeof s == "function")
|
|
1264
|
-
|
|
1263
|
+
h = s(o, r);
|
|
1265
1264
|
else if (s === "number") {
|
|
1266
|
-
const d = Number(a) || 0, f = Number(
|
|
1267
|
-
|
|
1265
|
+
const d = Number(a) || 0, f = Number(l) || 0;
|
|
1266
|
+
h = d - f;
|
|
1268
1267
|
} else if (s === "string") {
|
|
1269
|
-
const d = String(a || ""), f = String(
|
|
1270
|
-
|
|
1271
|
-
} else s === "date" && (
|
|
1272
|
-
return i === "asc" ?
|
|
1268
|
+
const d = String(a || ""), f = String(l || "");
|
|
1269
|
+
h = d.localeCompare(f);
|
|
1270
|
+
} else s === "date" && (h = ue(a, l));
|
|
1271
|
+
return i === "asc" ? h : -h;
|
|
1273
1272
|
});
|
|
1274
1273
|
}
|
|
1275
1274
|
/**
|
|
@@ -1381,39 +1380,39 @@ class ue {
|
|
|
1381
1380
|
async batchSetItemValue(t, e = !1, i = !0, s = "none") {
|
|
1382
1381
|
let o = [], r = i;
|
|
1383
1382
|
const a = /* @__PURE__ */ new Set();
|
|
1384
|
-
let
|
|
1385
|
-
const { rowKey: w, key:
|
|
1386
|
-
let g = x.value,
|
|
1387
|
-
const y = this.getRowDataItemForRowKey(w),
|
|
1388
|
-
return (R == null ? void 0 : R.type) === "number" && (["", void 0, null].includes(g) ?
|
|
1383
|
+
let l = [], h = t.map((x) => {
|
|
1384
|
+
const { rowKey: w, key: E } = x;
|
|
1385
|
+
let g = x.value, m = g;
|
|
1386
|
+
const y = this.getRowDataItemForRowKey(w), p = this.getItemValue(w, E), R = this.getVirtualBodyCellByKey(w, E);
|
|
1387
|
+
return (R == null ? void 0 : R.type) === "number" && (["", void 0, null].includes(g) ? m = null : /^-?\d+(\.\d+)?$/.test(`${g}`) ? m = Number(g) : (m = p, l.push({
|
|
1389
1388
|
...x,
|
|
1390
|
-
value:
|
|
1391
|
-
oldValue:
|
|
1389
|
+
value: m,
|
|
1390
|
+
oldValue: p,
|
|
1392
1391
|
row: y
|
|
1393
1392
|
}))), {
|
|
1394
1393
|
...x,
|
|
1395
|
-
value:
|
|
1396
|
-
oldValue:
|
|
1394
|
+
value: m,
|
|
1395
|
+
oldValue: p,
|
|
1397
1396
|
row: y
|
|
1398
1397
|
};
|
|
1399
1398
|
});
|
|
1400
|
-
if (
|
|
1399
|
+
if (h = h.filter((x) => !l.some((w) => x.rowKey === w.rowKey && x.key === w.key)), l.length) {
|
|
1401
1400
|
const x = {
|
|
1402
1401
|
code: "ERR_BATCH_SET_NUMBER_VALUE",
|
|
1403
1402
|
message: "Assignment failed, not a numeric type",
|
|
1404
|
-
data:
|
|
1403
|
+
data: l
|
|
1405
1404
|
};
|
|
1406
1405
|
this.ctx.emit("error", x);
|
|
1407
1406
|
}
|
|
1408
|
-
if (
|
|
1407
|
+
if (h = h.filter((x) => x.oldValue !== x.value), !h.length)
|
|
1409
1408
|
return;
|
|
1410
1409
|
const { BEFORE_VALUE_CHANGE_METHOD: d } = this.ctx.config;
|
|
1411
|
-
s === "none" && typeof d == "function" && (
|
|
1412
|
-
const { value: w, rowKey:
|
|
1413
|
-
a.add(
|
|
1414
|
-
rowKey:
|
|
1410
|
+
s === "none" && typeof d == "function" && (h = await d(h), r = !1), h.forEach((x) => {
|
|
1411
|
+
const { value: w, rowKey: E, key: g } = x, m = this.getItemValue(E, g);
|
|
1412
|
+
a.add(E), this.setItemValue(E, g, w, !1, !1, !1, r), o.push({
|
|
1413
|
+
rowKey: E,
|
|
1415
1414
|
key: g,
|
|
1416
|
-
oldValue:
|
|
1415
|
+
oldValue: m,
|
|
1417
1416
|
newValue: w
|
|
1418
1417
|
});
|
|
1419
1418
|
});
|
|
@@ -1421,10 +1420,10 @@ class ue {
|
|
|
1421
1420
|
a.forEach((x) => {
|
|
1422
1421
|
f.push(this.ctx.database.getRowDataItemForRowKey(x));
|
|
1423
1422
|
});
|
|
1424
|
-
const u =
|
|
1423
|
+
const u = h.map(({ rowKey: x, key: w }) => this.getValidator(x, w));
|
|
1425
1424
|
Promise.all(u).then(() => {
|
|
1426
1425
|
this.validationErrorMap.size === 0 && this.changedDataMap.size > 0 && this.ctx.emit("validateChangedData", this.getChangedData());
|
|
1427
|
-
}), this.ctx.emit("change",
|
|
1426
|
+
}), this.ctx.emit("change", h, f), e && this.ctx.history.pushState({
|
|
1428
1427
|
changeList: o,
|
|
1429
1428
|
scrollX: this.ctx.scrollX,
|
|
1430
1429
|
scrollY: this.ctx.scrollY,
|
|
@@ -1445,16 +1444,16 @@ class ue {
|
|
|
1445
1444
|
async setItemValue(t, e, i, s = !1, o = !1, r = !1, a = !0) {
|
|
1446
1445
|
if (!this.rowKeyMap.has(t))
|
|
1447
1446
|
return {};
|
|
1448
|
-
const { item:
|
|
1449
|
-
let
|
|
1447
|
+
const { item: l } = this.rowKeyMap.get(t);
|
|
1448
|
+
let h = l[e], d = i;
|
|
1450
1449
|
if (a && this.ctx.database.getReadonly(t, e))
|
|
1451
1450
|
return {
|
|
1452
|
-
oldValue:
|
|
1453
|
-
newValue:
|
|
1451
|
+
oldValue: h,
|
|
1452
|
+
newValue: h
|
|
1454
1453
|
};
|
|
1455
|
-
|
|
1454
|
+
l[e] !== null && typeof l[e] == "object" && (h = JSON.parse(JSON.stringify(l[e])));
|
|
1456
1455
|
const f = `${t}_${e}`;
|
|
1457
|
-
this.originalDataMap.has(f) || this.originalDataMap.set(f,
|
|
1456
|
+
this.originalDataMap.has(f) || this.originalDataMap.set(f, h);
|
|
1458
1457
|
const u = this.originalDataMap.get(f), x = this.getRowDataItemForRowKey(t);
|
|
1459
1458
|
if (r) {
|
|
1460
1459
|
const w = this.getVirtualBodyCellByKey(t, e);
|
|
@@ -1464,7 +1463,7 @@ class ue {
|
|
|
1464
1463
|
else if (/^-?\d+(\.\d+)?$/.test(`${i}`))
|
|
1465
1464
|
d = Number(i);
|
|
1466
1465
|
else {
|
|
1467
|
-
d =
|
|
1466
|
+
d = h;
|
|
1468
1467
|
const g = {
|
|
1469
1468
|
code: "ERR_SET_NUMBER_VALUE",
|
|
1470
1469
|
message: "Assignment failed, not a numeric type",
|
|
@@ -1473,46 +1472,46 @@ class ue {
|
|
|
1473
1472
|
rowKey: t,
|
|
1474
1473
|
key: e,
|
|
1475
1474
|
value: d,
|
|
1476
|
-
oldValue:
|
|
1475
|
+
oldValue: h,
|
|
1477
1476
|
row: x
|
|
1478
1477
|
}
|
|
1479
1478
|
]
|
|
1480
1479
|
};
|
|
1481
1480
|
this.ctx.emit("error", g);
|
|
1482
1481
|
}
|
|
1483
|
-
if (d ===
|
|
1482
|
+
if (d === h)
|
|
1484
1483
|
return {
|
|
1485
|
-
oldValue:
|
|
1486
|
-
newValue:
|
|
1484
|
+
oldValue: h,
|
|
1485
|
+
newValue: h
|
|
1487
1486
|
};
|
|
1488
|
-
let
|
|
1487
|
+
let E = [
|
|
1489
1488
|
{
|
|
1490
1489
|
rowKey: t,
|
|
1491
1490
|
key: e,
|
|
1492
1491
|
value: d,
|
|
1493
|
-
oldValue:
|
|
1492
|
+
oldValue: h,
|
|
1494
1493
|
row: x
|
|
1495
1494
|
}
|
|
1496
1495
|
];
|
|
1497
|
-
this.batchSetItemValue(
|
|
1496
|
+
this.batchSetItemValue(E, s, !1), this.ctx.emit("editChange", {
|
|
1498
1497
|
rowKey: t,
|
|
1499
1498
|
key: e,
|
|
1500
|
-
oldValue:
|
|
1499
|
+
oldValue: h,
|
|
1501
1500
|
value: d,
|
|
1502
1501
|
originalValue: u,
|
|
1503
1502
|
row: x
|
|
1504
1503
|
});
|
|
1505
1504
|
} else
|
|
1506
|
-
this.changedDataMap.set(f, d),
|
|
1505
|
+
this.changedDataMap.set(f, d), l[e] = d;
|
|
1507
1506
|
return this.ctx.hasEvent("iterationChange") && this.ctx.emit("iterationChange", {
|
|
1508
1507
|
rowKey: t,
|
|
1509
1508
|
key: e,
|
|
1510
|
-
oldValue:
|
|
1509
|
+
oldValue: h,
|
|
1511
1510
|
value: d,
|
|
1512
1511
|
originalValue: this.originalDataMap.get(f),
|
|
1513
1512
|
row: x
|
|
1514
1513
|
}), o && this.ctx.emit("draw"), {
|
|
1515
|
-
oldValue:
|
|
1514
|
+
oldValue: h,
|
|
1516
1515
|
newValue: d
|
|
1517
1516
|
};
|
|
1518
1517
|
}
|
|
@@ -1539,8 +1538,8 @@ class ue {
|
|
|
1539
1538
|
return !1;
|
|
1540
1539
|
const { item: s } = this.rowKeyMap.get(t), o = s[i];
|
|
1541
1540
|
this.checkboxKeyMap.has(o) && (this.checkboxKeyMap.get(o) || []).forEach((a) => {
|
|
1542
|
-
const
|
|
1543
|
-
|
|
1541
|
+
const l = this.selectionMap.get(a);
|
|
1542
|
+
l && (l.check = e);
|
|
1544
1543
|
});
|
|
1545
1544
|
}
|
|
1546
1545
|
}
|
|
@@ -1586,11 +1585,11 @@ class ue {
|
|
|
1586
1585
|
const e = this.getTreeParent(t);
|
|
1587
1586
|
if (!e)
|
|
1588
1587
|
return;
|
|
1589
|
-
const s = this.getTreeChildren(e).map((
|
|
1588
|
+
const s = this.getTreeChildren(e).map((h) => this.selectionMap.get(h)), o = s.filter((h) => h == null ? void 0 : h.check).length, r = s.length;
|
|
1590
1589
|
let a = !1;
|
|
1591
1590
|
r > 0 && (o === 0 ? a = !1 : o === r || this.ctx.config.TREE_SELECT_MODE === "auto" ? a = !0 : this.ctx.config.TREE_SELECT_MODE === "cautious" && (a = !1));
|
|
1592
|
-
const
|
|
1593
|
-
|
|
1591
|
+
const l = this.selectionMap.get(e);
|
|
1592
|
+
l && l.check !== a && (l.check = a, this.setRowSelectionByCheckboxKey(e, a), this.updateParentTreeSelection(e));
|
|
1594
1593
|
}
|
|
1595
1594
|
/**
|
|
1596
1595
|
* 根据rowKey 设置选中状态
|
|
@@ -1623,23 +1622,23 @@ class ue {
|
|
|
1623
1622
|
return { checked: s, indeterminate: !1 };
|
|
1624
1623
|
let r = !1, a = s;
|
|
1625
1624
|
if (this.ctx.config.TREE_SELECT_MODE === "auto") {
|
|
1626
|
-
const
|
|
1627
|
-
const
|
|
1625
|
+
const h = (g) => {
|
|
1626
|
+
const m = this.getTreeChildren(g);
|
|
1628
1627
|
let y = [];
|
|
1629
|
-
for (const
|
|
1630
|
-
y.push(
|
|
1628
|
+
for (const p of m)
|
|
1629
|
+
y.push(p), y.push(...h(p));
|
|
1631
1630
|
return y;
|
|
1632
|
-
}, f =
|
|
1631
|
+
}, f = h(t).map((g) => this.selectionMap.get(g)), u = f.filter((g) => g == null ? void 0 : g.check).length, x = f.length, w = u > 0;
|
|
1633
1632
|
r = w && !(u === x), a = s || w, s && x > 0 && u === 0 && (a = !1, r = !1);
|
|
1634
1633
|
} else if (this.ctx.config.TREE_SELECT_MODE === "cautious") {
|
|
1635
|
-
const
|
|
1636
|
-
const
|
|
1634
|
+
const h = (g) => {
|
|
1635
|
+
const m = this.getTreeChildren(g);
|
|
1637
1636
|
let y = [];
|
|
1638
|
-
for (const
|
|
1639
|
-
y.push(
|
|
1637
|
+
for (const p of m)
|
|
1638
|
+
y.push(p), y.push(...h(p));
|
|
1640
1639
|
return y;
|
|
1641
|
-
}, f =
|
|
1642
|
-
r = w && !
|
|
1640
|
+
}, f = h(t).map((g) => this.selectionMap.get(g)), u = f.filter((g) => g == null ? void 0 : g.check).length, x = f.length, w = u > 0, E = u === x;
|
|
1641
|
+
r = w && !E, a = s || E, s && x > 0 && u === 0 && (a = !1, r = !1);
|
|
1643
1642
|
} else this.ctx.config.TREE_SELECT_MODE === "strictly" && (r = !1, a = s);
|
|
1644
1643
|
return { checked: a, indeterminate: r };
|
|
1645
1644
|
}
|
|
@@ -1665,9 +1664,9 @@ class ue {
|
|
|
1665
1664
|
for (const a of o.children) {
|
|
1666
1665
|
if (this.getRowKeyByItem(a) === s)
|
|
1667
1666
|
return r;
|
|
1668
|
-
const
|
|
1669
|
-
if (
|
|
1670
|
-
return
|
|
1667
|
+
const h = e(o.children, s);
|
|
1668
|
+
if (h)
|
|
1669
|
+
return h;
|
|
1671
1670
|
}
|
|
1672
1671
|
}
|
|
1673
1672
|
return null;
|
|
@@ -1742,23 +1741,23 @@ class ue {
|
|
|
1742
1741
|
let s = 0, o = 0;
|
|
1743
1742
|
const r = this.selectionMap.size, a = Array.from(this.selectionMap.values()).some((u) => u.check);
|
|
1744
1743
|
this.rowKeyMap.forEach((u, x) => {
|
|
1745
|
-
var
|
|
1746
|
-
(
|
|
1744
|
+
var E;
|
|
1745
|
+
(E = this.selectionMap.get(x)) != null && E.check && (s += 1);
|
|
1747
1746
|
let w = u.selectable;
|
|
1748
1747
|
typeof w == "function" && (w = w({
|
|
1749
1748
|
row: u.item,
|
|
1750
1749
|
rowIndex: u.rowIndex
|
|
1751
1750
|
})), w && (o += 1);
|
|
1752
1751
|
});
|
|
1753
|
-
const
|
|
1752
|
+
const l = r > i && s === 0 && a, h = o && o > s && s > 0 || l, d = o !== 0, f = !!o && o === s;
|
|
1754
1753
|
return this.bufferCheckState = {
|
|
1755
1754
|
buffer: !0,
|
|
1756
1755
|
check: f,
|
|
1757
|
-
indeterminate:
|
|
1756
|
+
indeterminate: h,
|
|
1758
1757
|
selectable: d
|
|
1759
1758
|
}, {
|
|
1760
1759
|
check: f,
|
|
1761
|
-
indeterminate:
|
|
1760
|
+
indeterminate: h,
|
|
1762
1761
|
selectable: d
|
|
1763
1762
|
};
|
|
1764
1763
|
}
|
|
@@ -1850,9 +1849,9 @@ class ue {
|
|
|
1850
1849
|
const s = this.rowKeyMap.get(t), o = this.headerMap.get(e);
|
|
1851
1850
|
if (!s || !o)
|
|
1852
1851
|
return !0;
|
|
1853
|
-
const r = s.readonly, a = o.readonly, { BODY_CELL_READONLY_METHOD:
|
|
1854
|
-
if (typeof
|
|
1855
|
-
const d =
|
|
1852
|
+
const r = s.readonly, a = o.readonly, { BODY_CELL_READONLY_METHOD: l } = this.ctx.config;
|
|
1853
|
+
if (typeof l == "function" && o) {
|
|
1854
|
+
const d = l({
|
|
1856
1855
|
row: s.item,
|
|
1857
1856
|
rowIndex: s.rowIndex,
|
|
1858
1857
|
colIndex: o.colIndex,
|
|
@@ -1876,7 +1875,7 @@ class ue {
|
|
|
1876
1875
|
if (o === void 0)
|
|
1877
1876
|
return i([]);
|
|
1878
1877
|
const a = o.column;
|
|
1879
|
-
let
|
|
1878
|
+
let l = a.rules;
|
|
1880
1879
|
if (typeof r == "function") {
|
|
1881
1880
|
const d = r({
|
|
1882
1881
|
row: s.item,
|
|
@@ -1885,10 +1884,10 @@ class ue {
|
|
|
1885
1884
|
column: a,
|
|
1886
1885
|
value: this.getItemValue(t, e)
|
|
1887
1886
|
});
|
|
1888
|
-
d && (
|
|
1887
|
+
d && (l = d);
|
|
1889
1888
|
}
|
|
1890
|
-
if (
|
|
1891
|
-
const
|
|
1889
|
+
if (l) {
|
|
1890
|
+
const h = {
|
|
1892
1891
|
row: s.item,
|
|
1893
1892
|
rowIndex: s.rowIndex,
|
|
1894
1893
|
colIndex: o.colIndex,
|
|
@@ -1898,7 +1897,7 @@ class ue {
|
|
|
1898
1897
|
value: this.getItemValue(t, e),
|
|
1899
1898
|
field: e,
|
|
1900
1899
|
fieldValue: this.getItemValue(t, e)
|
|
1901
|
-
}, f = new
|
|
1900
|
+
}, f = new ne(l).validate(h);
|
|
1902
1901
|
this.setValidationError(t, e, f), i(f);
|
|
1903
1902
|
} else
|
|
1904
1903
|
this.clearValidationError(t, e), i([]);
|
|
@@ -1920,14 +1919,14 @@ class ue {
|
|
|
1920
1919
|
row: o,
|
|
1921
1920
|
value: r,
|
|
1922
1921
|
colIndex: a,
|
|
1923
|
-
relationRowKeys:
|
|
1924
|
-
relationColKeys:
|
|
1922
|
+
relationRowKeys: l,
|
|
1923
|
+
relationColKeys: h,
|
|
1925
1924
|
rowspan: d,
|
|
1926
1925
|
height: f,
|
|
1927
1926
|
width: u,
|
|
1928
1927
|
colspan: x,
|
|
1929
1928
|
mergeRow: w,
|
|
1930
|
-
mergeCol:
|
|
1929
|
+
mergeCol: E
|
|
1931
1930
|
} = t;
|
|
1932
1931
|
if (d === 1 && x === 1)
|
|
1933
1932
|
return {
|
|
@@ -1948,30 +1947,30 @@ class ue {
|
|
|
1948
1947
|
}
|
|
1949
1948
|
]
|
|
1950
1949
|
};
|
|
1951
|
-
let g = e,
|
|
1950
|
+
let g = e, m = e, y = a, p = a, R = [], C = 0, I = 0, _ = 0, v = 0;
|
|
1952
1951
|
if (d !== 1 && w) {
|
|
1953
|
-
|
|
1954
|
-
const
|
|
1952
|
+
v = u;
|
|
1953
|
+
const S = l.reduce((b, O) => {
|
|
1955
1954
|
const T = this.getItemValue(s, O) ?? "";
|
|
1956
1955
|
return `${b}${T}`;
|
|
1957
1956
|
}, "");
|
|
1958
1957
|
for (let b = e - 1; b >= 0; b--) {
|
|
1959
|
-
const O = this.rowIndexRowKeyMap.get(b) || "", T =
|
|
1958
|
+
const O = this.rowIndexRowKeyMap.get(b) || "", T = l.reduce((M, L) => {
|
|
1960
1959
|
const A = this.getItemValue(O, L) ?? "";
|
|
1961
1960
|
return `${M}${A}`;
|
|
1962
1961
|
}, "");
|
|
1963
|
-
if (
|
|
1962
|
+
if (S === T)
|
|
1964
1963
|
g = b;
|
|
1965
1964
|
else
|
|
1966
1965
|
break;
|
|
1967
1966
|
}
|
|
1968
1967
|
for (let b = e; b <= this.ctx.maxRowIndex; b++) {
|
|
1969
|
-
const O = this.rowIndexRowKeyMap.get(b) || "", T =
|
|
1968
|
+
const O = this.rowIndexRowKeyMap.get(b) || "", T = l.reduce((M, L) => {
|
|
1970
1969
|
const A = this.getItemValue(O, L) ?? "";
|
|
1971
1970
|
return `${M}${A}`;
|
|
1972
1971
|
}, "");
|
|
1973
|
-
if (
|
|
1974
|
-
|
|
1972
|
+
if (S === T)
|
|
1973
|
+
m = b;
|
|
1975
1974
|
else
|
|
1976
1975
|
break;
|
|
1977
1976
|
}
|
|
@@ -1979,9 +1978,9 @@ class ue {
|
|
|
1979
1978
|
const { height: O } = this.positions[b];
|
|
1980
1979
|
C += O;
|
|
1981
1980
|
}
|
|
1982
|
-
for (let b = g; b <=
|
|
1981
|
+
for (let b = g; b <= m; b++) {
|
|
1983
1982
|
const { height: O } = this.positions[b];
|
|
1984
|
-
|
|
1983
|
+
_ += O;
|
|
1985
1984
|
const T = this.rowIndexRowKeyMap.get(b) || "", { item: M } = this.rowKeyMap.get(T), L = this.getItemValue(T, i);
|
|
1986
1985
|
R.push({
|
|
1987
1986
|
rowKey: T,
|
|
@@ -1991,39 +1990,39 @@ class ue {
|
|
|
1991
1990
|
});
|
|
1992
1991
|
}
|
|
1993
1992
|
}
|
|
1994
|
-
if (x !== 1 &&
|
|
1995
|
-
|
|
1996
|
-
for (let
|
|
1997
|
-
const b = this.getColumnByColIndex(
|
|
1993
|
+
if (x !== 1 && E) {
|
|
1994
|
+
_ = f;
|
|
1995
|
+
for (let S = a - 1; S >= 0; S--) {
|
|
1996
|
+
const b = this.getColumnByColIndex(S);
|
|
1998
1997
|
if (!b)
|
|
1999
1998
|
break;
|
|
2000
1999
|
const O = this.getItemValue(s, i), T = this.getItemValue(s, b.key);
|
|
2001
|
-
if (O === T &&
|
|
2002
|
-
y =
|
|
2000
|
+
if (O === T && h.includes(b.key))
|
|
2001
|
+
y = S;
|
|
2003
2002
|
else
|
|
2004
2003
|
break;
|
|
2005
2004
|
}
|
|
2006
|
-
for (let
|
|
2007
|
-
const b = this.getColumnByColIndex(
|
|
2005
|
+
for (let S = a; S <= this.ctx.maxColIndex; S++) {
|
|
2006
|
+
const b = this.getColumnByColIndex(S);
|
|
2008
2007
|
if (!b)
|
|
2009
2008
|
break;
|
|
2010
2009
|
const O = this.getItemValue(s, i), T = this.getItemValue(s, b.key);
|
|
2011
|
-
if (O === T &&
|
|
2012
|
-
|
|
2010
|
+
if (O === T && h.includes(b.key))
|
|
2011
|
+
p = S;
|
|
2013
2012
|
else
|
|
2014
2013
|
break;
|
|
2015
2014
|
}
|
|
2016
|
-
for (let
|
|
2017
|
-
const b = this.getColumnByColIndex(
|
|
2015
|
+
for (let S = y; S < a; S++) {
|
|
2016
|
+
const b = this.getColumnByColIndex(S);
|
|
2018
2017
|
if (!b)
|
|
2019
2018
|
break;
|
|
2020
2019
|
I += b.width || 100;
|
|
2021
2020
|
}
|
|
2022
|
-
for (let
|
|
2023
|
-
const b = this.getColumnByColIndex(
|
|
2021
|
+
for (let S = y; S <= p; S++) {
|
|
2022
|
+
const b = this.getColumnByColIndex(S);
|
|
2024
2023
|
if (!b)
|
|
2025
2024
|
break;
|
|
2026
|
-
|
|
2025
|
+
v += b.width || 100, R.push({
|
|
2027
2026
|
rowKey: s,
|
|
2028
2027
|
key: b.key,
|
|
2029
2028
|
value: this.getItemValue(s, b.key),
|
|
@@ -2032,28 +2031,22 @@ class ue {
|
|
|
2032
2031
|
}
|
|
2033
2032
|
}
|
|
2034
2033
|
return {
|
|
2035
|
-
xArr: [y,
|
|
2036
|
-
yArr: [g,
|
|
2034
|
+
xArr: [y, p],
|
|
2035
|
+
yArr: [g, m],
|
|
2037
2036
|
rowspan: d,
|
|
2038
2037
|
colspan: x,
|
|
2039
|
-
height:
|
|
2040
|
-
width:
|
|
2038
|
+
height: _,
|
|
2039
|
+
width: v,
|
|
2041
2040
|
offsetTop: C,
|
|
2042
2041
|
offsetLeft: I,
|
|
2043
2042
|
dataList: R
|
|
2044
2043
|
};
|
|
2045
2044
|
}
|
|
2046
|
-
setLoading(t) {
|
|
2047
|
-
this.loading = t, this.ctx.emit("loadingChange", t);
|
|
2048
|
-
}
|
|
2049
|
-
getLoading() {
|
|
2050
|
-
return this.loading;
|
|
2051
|
-
}
|
|
2052
2045
|
setValidationErrorByRowIndex(t, e, i) {
|
|
2053
2046
|
const s = this.rowIndexRowKeyMap.get(t), o = `${s}_${e}`, r = this.getRowForRowIndex(t), a = this.getColumnByKey(e);
|
|
2054
2047
|
if (!s || !a || !r)
|
|
2055
2048
|
return;
|
|
2056
|
-
const
|
|
2049
|
+
const l = this.getItemValue(s, e), h = [
|
|
2057
2050
|
{
|
|
2058
2051
|
key: e,
|
|
2059
2052
|
rowKey: s,
|
|
@@ -2061,13 +2054,13 @@ class ue {
|
|
|
2061
2054
|
colIndex: a.colIndex,
|
|
2062
2055
|
column: a.column,
|
|
2063
2056
|
row: r,
|
|
2064
|
-
value:
|
|
2057
|
+
value: l,
|
|
2065
2058
|
message: i,
|
|
2066
2059
|
field: e,
|
|
2067
|
-
fieldValue:
|
|
2060
|
+
fieldValue: l
|
|
2068
2061
|
}
|
|
2069
2062
|
];
|
|
2070
|
-
this.validationErrorMap.set(o,
|
|
2063
|
+
this.validationErrorMap.set(o, h);
|
|
2071
2064
|
}
|
|
2072
2065
|
setValidationError(t, e, i) {
|
|
2073
2066
|
const s = `${t}_${e}`;
|
|
@@ -2129,7 +2122,7 @@ class ue {
|
|
|
2129
2122
|
return this.overlayerAutoHeightMap.get(i) || 0;
|
|
2130
2123
|
}
|
|
2131
2124
|
}
|
|
2132
|
-
class
|
|
2125
|
+
class we {
|
|
2133
2126
|
constructor(t) {
|
|
2134
2127
|
n(this, "ctx");
|
|
2135
2128
|
n(this, "history", []);
|
|
@@ -2184,7 +2177,7 @@ class ge {
|
|
|
2184
2177
|
this.history = [], this.historyIndex = -1;
|
|
2185
2178
|
}
|
|
2186
2179
|
}
|
|
2187
|
-
class
|
|
2180
|
+
class Ee {
|
|
2188
2181
|
constructor(t) {
|
|
2189
2182
|
n(this, "eventTasks", /* @__PURE__ */ new Map());
|
|
2190
2183
|
n(this, "ctx");
|
|
@@ -2338,21 +2331,21 @@ class pe {
|
|
|
2338
2331
|
* @param {string} color - 阴影的颜色
|
|
2339
2332
|
*/
|
|
2340
2333
|
drawShadow(t, e, i, s, o) {
|
|
2341
|
-
const { fillColor: r, side: a, shadowWidth:
|
|
2334
|
+
const { fillColor: r, side: a, shadowWidth: l, colorStart: h, colorEnd: d } = o;
|
|
2342
2335
|
this.ctx.save(), r && (this.ctx.fillStyle = r, this.ctx.fillRect(t, e, i, s));
|
|
2343
2336
|
let f;
|
|
2344
2337
|
switch (a) {
|
|
2345
2338
|
case "left":
|
|
2346
|
-
f = this.ctx.createLinearGradient(t -
|
|
2339
|
+
f = this.ctx.createLinearGradient(t - l, e, t, e), f.addColorStop(0, h), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t - l, e, l, s);
|
|
2347
2340
|
break;
|
|
2348
2341
|
case "right":
|
|
2349
|
-
f = this.ctx.createLinearGradient(t + i, e, t + i +
|
|
2342
|
+
f = this.ctx.createLinearGradient(t + i, e, t + i + l, e), f.addColorStop(0, h), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t + i, e, l, s);
|
|
2350
2343
|
break;
|
|
2351
2344
|
case "top":
|
|
2352
|
-
f = this.ctx.createLinearGradient(t, e -
|
|
2345
|
+
f = this.ctx.createLinearGradient(t, e - l, t, e), f.addColorStop(0, h), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t, e - l, i, l);
|
|
2353
2346
|
break;
|
|
2354
2347
|
case "bottom":
|
|
2355
|
-
f = this.ctx.createLinearGradient(t, e + s, t, e + s +
|
|
2348
|
+
f = this.ctx.createLinearGradient(t, e + s, t, e + s + l), f.addColorStop(0, h), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t, e + s, i, l);
|
|
2356
2349
|
break;
|
|
2357
2350
|
default:
|
|
2358
2351
|
console.error("Invalid side specified for shadow");
|
|
@@ -2374,12 +2367,12 @@ class pe {
|
|
|
2374
2367
|
drawImage(t, e, i, s, o) {
|
|
2375
2368
|
this.ctx.save(), this.ctx.drawImage(t, e, i, s, o), this.ctx.restore();
|
|
2376
2369
|
}
|
|
2377
|
-
drawRect(t, e, i, s, { borderWidth: o = 1, borderColor: r, fillColor: a, radius:
|
|
2378
|
-
if (this.ctx.save(), this.ctx.beginPath(), a !== void 0 && (this.ctx.fillStyle = a), r !== void 0 && (this.ctx.lineWidth = o, this.ctx.strokeStyle = r),
|
|
2370
|
+
drawRect(t, e, i, s, { borderWidth: o = 1, borderColor: r, fillColor: a, radius: l = 0 } = {}) {
|
|
2371
|
+
if (this.ctx.save(), this.ctx.beginPath(), a !== void 0 && (this.ctx.fillStyle = a), r !== void 0 && (this.ctx.lineWidth = o, this.ctx.strokeStyle = r), l === 0)
|
|
2379
2372
|
this.ctx.rect(t - 0.5, e - 0.5, i, s);
|
|
2380
2373
|
else {
|
|
2381
|
-
const [
|
|
2382
|
-
this.ctx.moveTo(t +
|
|
2374
|
+
const [h, d, f, u] = typeof l == "number" ? [l, l, l, l] : l;
|
|
2375
|
+
this.ctx.moveTo(t + h, e), this.ctx.arcTo(t + i, e, t + i, e + d, d), this.ctx.arcTo(t + i, e + s, t + i - f, e + s, f), this.ctx.arcTo(t, e + s, t, e + s - u, u), this.ctx.arcTo(t, e, t + h, e, h);
|
|
2383
2376
|
}
|
|
2384
2377
|
a !== void 0 && this.ctx.fill(), r !== void 0 && this.ctx.stroke(), this.ctx.restore();
|
|
2385
2378
|
}
|
|
@@ -2398,31 +2391,32 @@ class pe {
|
|
|
2398
2391
|
this.ctx.save();
|
|
2399
2392
|
const {
|
|
2400
2393
|
font: a = "12px Arial",
|
|
2401
|
-
align:
|
|
2402
|
-
color:
|
|
2394
|
+
align: l = "center",
|
|
2395
|
+
color: h = "#495060",
|
|
2403
2396
|
padding: d = 0,
|
|
2404
2397
|
verticalAlign: f = "middle",
|
|
2405
2398
|
maxLineClamp: u = 1,
|
|
2406
2399
|
autoRowHeight: x = !1,
|
|
2407
2400
|
offsetLeft: w = 0,
|
|
2408
|
-
offsetRight:
|
|
2401
|
+
offsetRight: E = 0
|
|
2409
2402
|
} = r;
|
|
2410
|
-
this.ctx.font = a, this.ctx.fillStyle =
|
|
2411
|
-
|
|
2403
|
+
if (this.ctx.font = a, this.ctx.fillStyle = h, this.ctx.textAlign = l, ["", null, void 0].includes(t))
|
|
2404
|
+
return this.ctx.restore(), !1;
|
|
2405
|
+
const m = parseInt(((O = a.match(/\d+/)) == null ? void 0 : O[0]) || "12") * (r.lineHeight || 1.2), y = s - d * 2 - w - E, p = this.ctx.measureText("...").width;
|
|
2412
2406
|
let R = !1;
|
|
2413
|
-
if (s <=
|
|
2407
|
+
if (s <= p + d * 2 + w + E)
|
|
2414
2408
|
return this.ctx.restore(), R = !0, R;
|
|
2415
|
-
const C = Math.round((o - 2 * d) /
|
|
2416
|
-
let I = this.wrapText(t, y, r.cacheTextKey),
|
|
2417
|
-
u === "auto" && x ?
|
|
2418
|
-
let
|
|
2419
|
-
const
|
|
2420
|
-
f === "middle" ?
|
|
2409
|
+
const C = Math.round((o - 2 * d) / m);
|
|
2410
|
+
let I = this.wrapText(t, y, r.cacheTextKey), _ = Math.min(I.length, Math.max(C, 1));
|
|
2411
|
+
u === "auto" && x ? _ = I.length : typeof u == "number" && u < _ ? _ = u : (u === 1 && !x && (I = [t], _ = 1), u === "auto" && C === 1 && (I = [t], _ = 1));
|
|
2412
|
+
let v = i + d;
|
|
2413
|
+
const S = Math.round(_ * m);
|
|
2414
|
+
f === "middle" ? v = i + (o - S) / 2 : f === "bottom" && (v = i + o - S - d);
|
|
2421
2415
|
let b = e + d + w;
|
|
2422
|
-
|
|
2416
|
+
l === "center" ? b = e + s / 2 : l === "right" && (b = e + s - d - E);
|
|
2423
2417
|
for (let T = 0; T < I.length; T++) {
|
|
2424
|
-
const M = I[T], L =
|
|
2425
|
-
if (this.ctx.textBaseline = "top", T ===
|
|
2418
|
+
const M = I[T], L = v + T * m;
|
|
2419
|
+
if (this.ctx.textBaseline = "top", T === _ - 1) {
|
|
2426
2420
|
const { _text: A, ellipsis: D } = this.handleEllipsis(M, s, d, a);
|
|
2427
2421
|
this.ctx.fillText(A, b, L), R = D;
|
|
2428
2422
|
break;
|
|
@@ -2432,16 +2426,16 @@ class pe {
|
|
|
2432
2426
|
if (r.textCallback && I.length) {
|
|
2433
2427
|
const T = Math.round(this.ctx.measureText(I[0]).width);
|
|
2434
2428
|
let M = b, L = b + T;
|
|
2435
|
-
|
|
2429
|
+
l === "center" ? (M = b - T / 2, L = b + T / 2) : l === "right" && (M = b - T, L = b);
|
|
2436
2430
|
const A = {
|
|
2437
2431
|
x: b,
|
|
2438
|
-
y:
|
|
2432
|
+
y: v,
|
|
2439
2433
|
width: T,
|
|
2440
|
-
height:
|
|
2434
|
+
height: S,
|
|
2441
2435
|
left: M,
|
|
2442
2436
|
right: L,
|
|
2443
|
-
top:
|
|
2444
|
-
bottom:
|
|
2437
|
+
top: v,
|
|
2438
|
+
bottom: v + S
|
|
2445
2439
|
};
|
|
2446
2440
|
r.textCallback(A);
|
|
2447
2441
|
}
|
|
@@ -2464,19 +2458,19 @@ class pe {
|
|
|
2464
2458
|
s.push("");
|
|
2465
2459
|
continue;
|
|
2466
2460
|
}
|
|
2467
|
-
const
|
|
2468
|
-
let
|
|
2469
|
-
for (const d of
|
|
2470
|
-
const f =
|
|
2471
|
-
this.ctx.measureText(f).width <= e ?
|
|
2461
|
+
const l = a.split("");
|
|
2462
|
+
let h = "";
|
|
2463
|
+
for (const d of l) {
|
|
2464
|
+
const f = h + d;
|
|
2465
|
+
this.ctx.measureText(f).width <= e ? h = f : h ? (s.push(h), h = d) : (s.push(d), h = "");
|
|
2472
2466
|
}
|
|
2473
|
-
|
|
2467
|
+
h && s.push(h);
|
|
2474
2468
|
}
|
|
2475
2469
|
if (s.length >= 1) {
|
|
2476
|
-
const a = s[s.length - 1], { ellipsis:
|
|
2477
|
-
if (
|
|
2478
|
-
const
|
|
2479
|
-
s[s.length - 1] =
|
|
2470
|
+
const a = s[s.length - 1], { ellipsis: l } = this.handleEllipsis(a, e, 0, this.ctx.font);
|
|
2471
|
+
if (l) {
|
|
2472
|
+
const h = a.slice(0, -1);
|
|
2473
|
+
s[s.length - 1] = h, s.push(a.slice(-1));
|
|
2480
2474
|
}
|
|
2481
2475
|
}
|
|
2482
2476
|
const r = s.length > 0 ? s : [""];
|
|
@@ -2490,19 +2484,19 @@ class pe {
|
|
|
2490
2484
|
* @returns 计算出的高度
|
|
2491
2485
|
*/
|
|
2492
2486
|
calculateTextHeight(t = "", e, i = {}) {
|
|
2493
|
-
var
|
|
2487
|
+
var E;
|
|
2494
2488
|
const {
|
|
2495
2489
|
font: s = "12px Arial",
|
|
2496
2490
|
padding: o = 0,
|
|
2497
2491
|
align: r = "center",
|
|
2498
2492
|
color: a = "#495060",
|
|
2499
|
-
maxLineClamp:
|
|
2500
|
-
cacheTextKey:
|
|
2493
|
+
maxLineClamp: l = 1,
|
|
2494
|
+
cacheTextKey: h = ""
|
|
2501
2495
|
} = i;
|
|
2502
2496
|
this.ctx.save(), this.ctx.font = s, this.ctx.fillStyle = a, this.ctx.textAlign = r;
|
|
2503
|
-
const d = parseInt(((
|
|
2497
|
+
const d = parseInt(((E = s.match(/\d+/)) == null ? void 0 : E[0]) || "12"), f = d * (i.lineHeight || 1.2), u = e - o * 2, x = this.wrapText(t, u, h);
|
|
2504
2498
|
let w = 1;
|
|
2505
|
-
return
|
|
2499
|
+
return l === "auto" ? w = x.length : x.length > l ? w = l : w = x.length, this.ctx.restore(), Math.max(Math.floor(w * f + o * 2), Math.floor(d + o * 2));
|
|
2506
2500
|
}
|
|
2507
2501
|
handleEllipsis(t, e, i = 0, s = "12px Arial") {
|
|
2508
2502
|
this.ctx.save();
|
|
@@ -2518,12 +2512,12 @@ class pe {
|
|
|
2518
2512
|
_text: "",
|
|
2519
2513
|
ellipsis: !0
|
|
2520
2514
|
};
|
|
2521
|
-
const
|
|
2522
|
-
if (
|
|
2515
|
+
const l = this.ctx.measureText(t).width, h = e - i * 2;
|
|
2516
|
+
if (l && l + a >= h) {
|
|
2523
2517
|
o = !0;
|
|
2524
2518
|
let d = 0;
|
|
2525
2519
|
for (let f = 0; f < t.length; f++)
|
|
2526
|
-
if (d += this.ctx.measureText(t[f]).width, d >=
|
|
2520
|
+
if (d += this.ctx.measureText(t[f]).width, d >= h - a) {
|
|
2527
2521
|
r = t.slice(0, f) + "...", o = !0;
|
|
2528
2522
|
break;
|
|
2529
2523
|
}
|
|
@@ -2573,6 +2567,8 @@ class It {
|
|
|
2573
2567
|
n(this, "EMPTY_CUSTOM_STYLE", {});
|
|
2574
2568
|
/** 空数据文本 */
|
|
2575
2569
|
n(this, "EMPTY_TEXT", "暂无数据");
|
|
2570
|
+
/** 加载文本 */
|
|
2571
|
+
n(this, "LOADING_TEXT", "加载中...");
|
|
2576
2572
|
/** 最大高度,为 0 表示自适应高度根据 HEIGHT */
|
|
2577
2573
|
n(this, "MAX_HEIGHT", 1e3);
|
|
2578
2574
|
/** 区域边框圆角 */
|
|
@@ -2591,6 +2587,8 @@ class It {
|
|
|
2591
2587
|
n(this, "BODY_BG_COLOR", "#FFF");
|
|
2592
2588
|
/** 表头文本颜色 */
|
|
2593
2589
|
n(this, "HEADER_TEXT_COLOR", "#1D2129");
|
|
2590
|
+
/** 必填*颜色 */
|
|
2591
|
+
n(this, "REQUIRED_COLOR", "#F56C6C");
|
|
2594
2592
|
/** body文本颜色 */
|
|
2595
2593
|
n(this, "BODY_TEXT_COLOR", "#4E5969");
|
|
2596
2594
|
/** footer文本颜色 */
|
|
@@ -2605,6 +2603,7 @@ class It {
|
|
|
2605
2603
|
n(this, "SHRINK_ICON_SVG", "");
|
|
2606
2604
|
/** 展开图标颜色 */
|
|
2607
2605
|
n(this, "EXPAND_ICON_COLOR", "#4E5969");
|
|
2606
|
+
/** 收缩图标颜色 */
|
|
2608
2607
|
n(this, "SHRINK_ICON_COLOR", "#4E5969");
|
|
2609
2608
|
/** 错误提示颜色 */
|
|
2610
2609
|
n(this, "ERROR_TIP_ICON_COLOR", "red");
|
|
@@ -2658,12 +2657,28 @@ class It {
|
|
|
2658
2657
|
n(this, "CHECKBOX_SIZE", 20);
|
|
2659
2658
|
/** 选择框禁用图标 */
|
|
2660
2659
|
n(this, "CHECKBOX_DISABLED_SVG", "");
|
|
2660
|
+
/** 选择框禁用图标颜色 */
|
|
2661
|
+
n(this, "CHECKBOX_DISABLED_COLOR", "#F1F2F4");
|
|
2661
2662
|
/** 选择框选中图标 */
|
|
2662
2663
|
n(this, "CHECKBOX_CHECK_SVG", "");
|
|
2663
2664
|
/** 选择框未中图标 */
|
|
2664
2665
|
n(this, "CHECKBOX_UNCHECK_SVG", "");
|
|
2666
|
+
/** 选择框未中图标颜色 */
|
|
2667
|
+
n(this, "CHECKBOX_UNCHECK_COLOR", "#DDE0EA");
|
|
2665
2668
|
/** 选择框半选中图标 */
|
|
2666
2669
|
n(this, "CHECKBOX_INDETERMINATE_SVG", "");
|
|
2670
|
+
/** 选择框选中禁用图标 */
|
|
2671
|
+
n(this, "CHECKBOX_CHECK_DISABLED_SVG", "");
|
|
2672
|
+
/** 选择框选中禁用图标颜色 */
|
|
2673
|
+
n(this, "CHECKBOX_CHECK_DISABLED_COLOR", "#DDE0EA");
|
|
2674
|
+
/** 编辑图标 */
|
|
2675
|
+
n(this, "ICON_EDIT_SVG", "");
|
|
2676
|
+
/** 编辑图标颜色 */
|
|
2677
|
+
n(this, "ICON_EDIT_COLOR", "#4E5969");
|
|
2678
|
+
/** 选择图标 */
|
|
2679
|
+
n(this, "ICON_SELECT_SVG", "");
|
|
2680
|
+
/** 选择图标颜色 */
|
|
2681
|
+
n(this, "ICON_SELECT_COLOR", "#4E5969");
|
|
2667
2682
|
/** 启用严格排序,即不支持多列排序 */
|
|
2668
2683
|
n(this, "SORT_STRICTLY", !0);
|
|
2669
2684
|
/** 排序升序图标 */
|
|
@@ -2836,14 +2851,14 @@ class It {
|
|
|
2836
2851
|
let t = {};
|
|
2837
2852
|
Object.keys(this).forEach((e) => {
|
|
2838
2853
|
if (e.endsWith("_COLOR") || e.endsWith("_FONT")) {
|
|
2839
|
-
const i = `--evt-${e.toLocaleLowerCase().replace(/_/g, "-")}`, s =
|
|
2854
|
+
const i = `--evt-${e.toLocaleLowerCase().replace(/_/g, "-")}`, s = xe(i);
|
|
2840
2855
|
s && (t[e] = s);
|
|
2841
2856
|
}
|
|
2842
2857
|
}), Object.assign(this, t, this._config);
|
|
2843
2858
|
}
|
|
2844
2859
|
}
|
|
2845
|
-
const
|
|
2846
|
-
class
|
|
2860
|
+
const St = '<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>', _t = '<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>', gt = '<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>', ye = gt.replace('fill="currentColor" p-id="2016"', 'fill="#bec4c7" p-id="2016"'), Ce = gt.replace('fill="currentColor" p-id="2015"', 'fill="#bec4c7" p-id="2015"');
|
|
2861
|
+
class be {
|
|
2847
2862
|
constructor(t) {
|
|
2848
2863
|
n(this, "ctx");
|
|
2849
2864
|
n(this, "list", [
|
|
@@ -2863,29 +2878,23 @@ class Ce {
|
|
|
2863
2878
|
},
|
|
2864
2879
|
{
|
|
2865
2880
|
name: "shrink",
|
|
2866
|
-
configName: "
|
|
2881
|
+
configName: "SHRINK_ICON_SVG",
|
|
2867
2882
|
configColorName: "SHRINK_ICON_COLOR",
|
|
2868
|
-
svg:
|
|
2883
|
+
svg: _t,
|
|
2869
2884
|
color: "#4E5969"
|
|
2870
2885
|
},
|
|
2871
2886
|
{
|
|
2872
2887
|
name: "checkbox-uncheck",
|
|
2873
2888
|
configName: "CHECKBOX_UNCHECK_SVG",
|
|
2874
|
-
|
|
2889
|
+
configColorName: "CHECKBOX_UNCHECK_COLOR",
|
|
2890
|
+
svg: '<svg t="1722595639920" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4708" width="32" height="32"><path d="M128 640V384a256 256 0 0 1 256-256h256a256 256 0 0 1 256 256v256a256 256 0 0 1-256 256H384a256 256 0 0 1-256-256z m64 0q0 79.552 56.256 135.744Q304.448 832 384 832h256q79.552 0 135.744-56.256Q832 719.552 832 640V384q0-79.552-56.256-135.744Q719.552 192 640 192H384q-79.552 0-135.744 56.256Q192 304.448 192 384v256z" p-id="4709"></path></svg>',
|
|
2875
2891
|
color: ""
|
|
2876
2892
|
},
|
|
2877
2893
|
{
|
|
2878
2894
|
name: "checkbox-check",
|
|
2879
2895
|
configName: "CHECKBOX_CHECK_SVG",
|
|
2880
2896
|
configColorName: "CHECKBOX_COLOR",
|
|
2881
|
-
svg:
|
|
2882
|
-
color: "rgb(82,146,247)"
|
|
2883
|
-
},
|
|
2884
|
-
{
|
|
2885
|
-
name: "checkbox-hover",
|
|
2886
|
-
configName: "CHECKBOX_UNCHECK_SVG",
|
|
2887
|
-
configColorName: "CHECKBOX_COLOR",
|
|
2888
|
-
svg: '<svg t="1722595639920" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4708" width="32" height="32"><path d="M128 640V384a256 256 0 0 1 256-256h256a256 256 0 0 1 256 256v256a256 256 0 0 1-256 256H384a256 256 0 0 1-256-256z m64 0q0 79.552 56.256 135.744Q304.448 832 384 832h256q79.552 0 135.744-56.256Q832 719.552 832 640V384q0-79.552-56.256-135.744Q719.552 192 640 192H384q-79.552 0-135.744 56.256Q192 304.448 192 384v256z" fill="#DDE0EA" p-id="4709"></path></svg>',
|
|
2897
|
+
svg: St,
|
|
2889
2898
|
color: "rgb(82,146,247)"
|
|
2890
2899
|
},
|
|
2891
2900
|
{
|
|
@@ -2897,41 +2906,43 @@ class Ce {
|
|
|
2897
2906
|
},
|
|
2898
2907
|
{
|
|
2899
2908
|
name: "checkbox-check-disabled",
|
|
2900
|
-
configName: "
|
|
2901
|
-
svg:
|
|
2909
|
+
configName: "CHECKBOX_CHECK_DISABLED_SVG",
|
|
2910
|
+
svg: St,
|
|
2902
2911
|
color: "#DDE0EA"
|
|
2903
2912
|
},
|
|
2904
2913
|
{
|
|
2905
2914
|
name: "checkbox-disabled",
|
|
2906
2915
|
configName: "CHECKBOX_DISABLED_SVG",
|
|
2907
|
-
|
|
2908
|
-
|
|
2916
|
+
configColorName: "CHECKBOX_DISABLED_COLOR",
|
|
2917
|
+
svg: '<svg t="1722595946663" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4865" width="32" height="32"><path d="M128 640V384a256 256 0 0 1 256-256h256a256 256 0 0 1 256 256v256a256 256 0 0 1-256 256H384a256 256 0 0 1-256-256z" p-id="4866"></path><path d="M128 640V384a256 256 0 0 1 256-256h256a256 256 0 0 1 256 256v256a256 256 0 0 1-256 256H384a256 256 0 0 1-256-256z m64 0q0 79.552 56.256 135.744Q304.448 832 384 832h256q79.552 0 135.744-56.256Q832 719.552 832 640V384q0-79.552-56.256-135.744Q719.552 192 640 192H384q-79.552 0-135.744 56.256Q192 304.448 192 384v256z" fill="#DDE0EA" p-id="4867"></path></svg>',
|
|
2918
|
+
color: "#F1F2F4"
|
|
2909
2919
|
},
|
|
2910
2920
|
{
|
|
2911
2921
|
name: "icon-edit",
|
|
2912
|
-
configName: "
|
|
2922
|
+
configName: "ICON_EDIT_SVG",
|
|
2923
|
+
configColorName: "ICON_EDIT_COLOR",
|
|
2913
2924
|
svg: '<svg t="1744798692576" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6606" width="200" height="200"><path d="M855.296 894.528H168.768v-76.8h686.528v76.8z m38.4-38.4q0 3.84-0.768 7.488-0.704 3.712-2.176 7.232-1.472 3.52-3.52 6.656-2.112 3.136-4.8 5.76-2.688 2.688-5.824 4.8-3.2 2.112-6.656 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.52-1.472-6.656-3.584-3.136-2.112-5.76-4.736-2.688-2.688-4.8-5.824-2.112-3.2-3.584-6.656-1.408-3.52-2.176-7.232-0.704-3.648-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.136 4.736-5.76 2.688-2.752 5.824-4.8 3.2-2.112 6.656-3.584 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.472 6.656 3.584 3.2 2.048 5.76 4.736 2.752 2.688 4.864 5.824 2.048 3.2 3.52 6.656 1.472 3.456 2.176 7.168 0.768 3.712 0.768 7.488z m-686.528 0q0 3.84-0.768 7.488-0.704 3.712-2.176 7.232-1.472 3.52-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.736-2.688-2.688-4.8-5.824-2.112-3.2-3.584-6.656-1.408-3.52-2.176-7.232-0.704-3.648-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.136 4.736-5.76 2.688-2.752 5.824-4.8 3.2-2.112 6.656-3.584 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.472 6.656 3.584 3.2 2.048 5.824 4.736 2.688 2.688 4.8 5.824 2.048 3.2 3.52 6.656 1.472 3.456 2.176 7.168 0.768 3.712 0.768 7.488zM652.032 211.2l-369.92 370.368v89.344h90.048l369.664-369.856L652.032 211.2z m-54.4-54.272q22.528-22.528 54.4-22.528 31.808 0 54.336 22.528l89.792 89.856q22.464 22.464 22.464 54.272t-22.464 54.272l-369.664 369.856q-22.464 22.528-54.336 22.528H282.24q-31.808 0-54.336-22.528-22.464-22.464-22.464-54.272V581.568q0-31.808 22.4-54.272l369.92-370.368z" p-id="6607"></path></svg>',
|
|
2914
2925
|
color: "#4E5969"
|
|
2915
2926
|
},
|
|
2916
2927
|
{
|
|
2917
2928
|
name: "icon-select",
|
|
2918
|
-
configName: "
|
|
2919
|
-
configColorName: "
|
|
2920
|
-
svg:
|
|
2929
|
+
configName: "ICON_SELECT_SVG",
|
|
2930
|
+
configColorName: "ICON_SELECT_COLOR",
|
|
2931
|
+
svg: _t,
|
|
2921
2932
|
color: "#4E5969"
|
|
2922
2933
|
},
|
|
2923
2934
|
{
|
|
2924
2935
|
name: "sort-asc",
|
|
2925
2936
|
configName: "SORT_ASC_ICON_SVG",
|
|
2926
2937
|
configColorName: "SORT_ICON_COLOR",
|
|
2927
|
-
svg:
|
|
2938
|
+
svg: ye,
|
|
2928
2939
|
color: "rgb(82,146,247)"
|
|
2929
2940
|
},
|
|
2930
2941
|
{
|
|
2931
2942
|
name: "sort-desc",
|
|
2932
2943
|
configName: "SORT_DESC_ICON_SVG",
|
|
2933
2944
|
configColorName: "SORT_ICON_COLOR",
|
|
2934
|
-
svg:
|
|
2945
|
+
svg: Ce,
|
|
2935
2946
|
color: "rgb(82,146,247)"
|
|
2936
2947
|
},
|
|
2937
2948
|
{
|
|
@@ -2974,32 +2985,35 @@ class Ce {
|
|
|
2974
2985
|
}
|
|
2975
2986
|
async createImageFromSVG(t, e, i = !1) {
|
|
2976
2987
|
const r = new DOMParser().parseFromString(t, "image/svg+xml").documentElement;
|
|
2977
|
-
e && r.querySelectorAll("*").forEach((
|
|
2978
|
-
const d =
|
|
2979
|
-
(d === "currentColor" || d === null) &&
|
|
2988
|
+
e && r.querySelectorAll("*").forEach((h) => {
|
|
2989
|
+
const d = h.getAttribute("fill");
|
|
2990
|
+
(d === "currentColor" || d === null) && h.setAttribute("fill", e);
|
|
2980
2991
|
});
|
|
2981
2992
|
const a = new Image();
|
|
2982
|
-
let
|
|
2993
|
+
let l = "";
|
|
2983
2994
|
if (i) {
|
|
2984
|
-
const
|
|
2995
|
+
const h = new Blob([new XMLSerializer().serializeToString(r)], {
|
|
2985
2996
|
type: "image/svg+xml"
|
|
2986
2997
|
});
|
|
2987
|
-
|
|
2998
|
+
l = URL.createObjectURL(h);
|
|
2988
2999
|
} else
|
|
2989
|
-
|
|
2990
|
-
return a.src =
|
|
3000
|
+
l = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(new XMLSerializer().serializeToString(r));
|
|
3001
|
+
return a.src = l, new Promise((h, d) => {
|
|
2991
3002
|
a.onerror = () => d(new Error("Failed to load image:" + t)), a.onload = () => {
|
|
2992
|
-
|
|
3003
|
+
h(a);
|
|
2993
3004
|
};
|
|
2994
3005
|
});
|
|
2995
3006
|
}
|
|
2996
3007
|
get(t) {
|
|
2997
3008
|
return this.icons.get(t);
|
|
2998
3009
|
}
|
|
3010
|
+
getSvg(t) {
|
|
3011
|
+
return this.list.find((e) => e.name === t);
|
|
3012
|
+
}
|
|
2999
3013
|
}
|
|
3000
|
-
class ct extends
|
|
3001
|
-
constructor(e, i, s, o, r, a,
|
|
3002
|
-
super(e, s, o, r, a, "header",
|
|
3014
|
+
class ct extends Bt {
|
|
3015
|
+
constructor(e, i, s, o, r, a, l) {
|
|
3016
|
+
super(e, s, o, r, a, "header", l.fixed);
|
|
3003
3017
|
n(this, "align");
|
|
3004
3018
|
n(this, "hideHeaderSelection", !1);
|
|
3005
3019
|
n(this, "verticalAlign", "middle");
|
|
@@ -3057,7 +3071,7 @@ class ct extends Yt {
|
|
|
3057
3071
|
n(this, "drawSortImageHeight", 0);
|
|
3058
3072
|
n(this, "drawSortImageName", "");
|
|
3059
3073
|
n(this, "drawSortImageSource");
|
|
3060
|
-
this.ctx = e, this.x = s, this.y = o, this.width = r, this.height = a, this.visibleWidth = r, this.visibleHeight = a, this.colIndex = i, this.key =
|
|
3074
|
+
this.ctx = e, this.x = s, this.y = o, this.width = r, this.height = a, this.visibleWidth = r, this.visibleHeight = a, this.colIndex = i, this.key = l.key, this.minWidth = l.minWidth, this.maxWidth = l.maxWidth, this.type = l.type || "", this.editorType = l.editorType || "text", this.hideHeaderSelection = l.hideHeaderSelection || !1, this.align = l.headerAlign || l.align || this.ctx.config.COLUMNS_ALIGN, this.verticalAlign = l.headerVerticalAlign || l.verticalAlign || this.ctx.config.COLUMNS_VERTICAL_ALIGN, this.fixed = l.fixed, this.level = l.level || 0, this.operation = l.operation || !1, this.text = l.title, this.column = l, this.colspan = l.colspan || 1, this.widthFillDisable = l.widthFillDisable || !1, this.rowspan = l.rowspan || 1, this.rules = l.rules, this.readonly = l.readonly || !1, this.required = l.required || !1, this.sortIconName = l.sortIconName || "sort-default", this.sortAscIconName = l.sortAscIconName || "sort-asc", this.sortDescIconName = l.sortDescIconName || "sort-desc", this.rowKey = Dt(), this.overflowTooltipShow = l.overflowTooltipHeaderShow !== !1, this.hasChildren = l.children && l.children.length > 0 || !1, this.render = l.renderHeader;
|
|
3061
3075
|
}
|
|
3062
3076
|
/**
|
|
3063
3077
|
* 是否可见,覆盖基类方法,表头是跟y滚动条没有关系的所以不需要加滚动参数
|
|
@@ -3077,11 +3091,11 @@ class ct extends Yt {
|
|
|
3077
3091
|
const { HEADER_CELL_STYLE_METHOD: e, HEADER_BG_COLOR: i, HEADER_TEXT_COLOR: s } = this.ctx.config;
|
|
3078
3092
|
let o = i, r = s;
|
|
3079
3093
|
if (typeof e == "function") {
|
|
3080
|
-
const a = e, { backgroundColor:
|
|
3094
|
+
const a = e, { backgroundColor: l, color: h } = a({
|
|
3081
3095
|
colIndex: this.colIndex,
|
|
3082
3096
|
column: this.column
|
|
3083
3097
|
}) || {};
|
|
3084
|
-
|
|
3098
|
+
l && (o = l), h && (r = h);
|
|
3085
3099
|
}
|
|
3086
3100
|
this.drawCellBgColor = o, this.drawTextColor = r;
|
|
3087
3101
|
}
|
|
@@ -3104,8 +3118,8 @@ class ct extends Yt {
|
|
|
3104
3118
|
drawText() {
|
|
3105
3119
|
const {
|
|
3106
3120
|
paint: e,
|
|
3107
|
-
config: { HEADER_FONT: i, CELL_PADDING: s }
|
|
3108
|
-
} = this.ctx,
|
|
3121
|
+
config: { HEADER_FONT: i, CELL_PADDING: s, REQUIRED_COLOR: o }
|
|
3122
|
+
} = this.ctx, r = `${this.displayText}_${this.drawTextWidth}`;
|
|
3109
3123
|
this.ellipsis = e.drawText(
|
|
3110
3124
|
this.displayText,
|
|
3111
3125
|
this.drawTextX,
|
|
@@ -3123,22 +3137,15 @@ class ct extends Yt {
|
|
|
3123
3137
|
// 排序图标占位
|
|
3124
3138
|
offsetLeft: this.required ? 12 : 0,
|
|
3125
3139
|
// 必填星号占位
|
|
3126
|
-
cacheTextKey:
|
|
3127
|
-
textCallback: (
|
|
3128
|
-
this.column.sortBy && (this.drawSortImageX =
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
color: "red",
|
|
3136
|
-
font: "18px Arial",
|
|
3137
|
-
align: "center",
|
|
3138
|
-
verticalAlign: "middle",
|
|
3139
|
-
padding: 0
|
|
3140
|
-
}
|
|
3141
|
-
);
|
|
3140
|
+
cacheTextKey: r,
|
|
3141
|
+
textCallback: (a) => {
|
|
3142
|
+
this.column.sortBy && (this.drawSortImageX = a.right + 4, this.drawSortImageY = a.top + (a.height - 16) / 2), this.required && e.drawText("*", a.left - 18, a.top + (a.height - 12) / 2, 24, 24, {
|
|
3143
|
+
color: o,
|
|
3144
|
+
font: "18px Arial",
|
|
3145
|
+
align: "center",
|
|
3146
|
+
verticalAlign: "middle",
|
|
3147
|
+
padding: 0
|
|
3148
|
+
});
|
|
3142
3149
|
}
|
|
3143
3150
|
}
|
|
3144
3151
|
);
|
|
@@ -3156,10 +3163,10 @@ class ct extends Yt {
|
|
|
3156
3163
|
drawSelection() {
|
|
3157
3164
|
if (!this.hideHeaderSelection && ["index-selection", "selection", "selection-tree", "tree-selection"].includes(this.type)) {
|
|
3158
3165
|
const { indeterminate: e, check: i, selectable: s } = this.ctx.database.getCheckedState(), { CHECKBOX_SIZE: o = 0, CELL_PADDING: r } = this.ctx.config;
|
|
3159
|
-
let a = this.drawX + (this.width - o) / 2,
|
|
3160
|
-
this.drawTextX = a + o - r / 2, this.drawTextWidth = this.drawX + this.visibleWidth - this.drawTextX, (this.align === "left" || this.align === "right") && (a = this.drawX + r, this.drawTextX = a + o - r / 2, this.drawTextWidth = this.drawX + this.visibleWidth - this.drawTextX), this.verticalAlign === "top" ?
|
|
3161
|
-
let
|
|
3162
|
-
e ? (
|
|
3166
|
+
let a = this.drawX + (this.width - o) / 2, l = this.drawY + (this.height - o) / 2;
|
|
3167
|
+
this.drawTextX = a + o - r / 2, this.drawTextWidth = this.drawX + this.visibleWidth - this.drawTextX, (this.align === "left" || this.align === "right") && (a = this.drawX + r, this.drawTextX = a + o - r / 2, this.drawTextWidth = this.drawX + this.visibleWidth - this.drawTextX), this.verticalAlign === "top" ? l = this.drawY + r / 2 : this.verticalAlign === "bottom" && (l = this.drawY + this.height - o - r / 2);
|
|
3168
|
+
let h = this.ctx.icons.get("checkbox-uncheck"), d = "checkbox-uncheck";
|
|
3169
|
+
e ? (h = this.ctx.icons.get("checkbox-indeterminate"), d = "checkbox-indeterminate") : i && s ? (h = this.ctx.icons.get("checkbox-check"), d = "checkbox-check") : i && !s ? (h = this.ctx.icons.get("checkbox-check-disabled"), d = "checkbox-check-disabled") : !i && s ? (h = this.ctx.icons.get("checkbox-uncheck"), d = "checkbox-uncheck") : (h = this.ctx.icons.get("checkbox-disabled"), d = "checkbox-disabled"), h && (this.drawSelectionImageX = a, this.drawSelectionImageY = l, this.drawSelectionImageWidth = o, this.drawSelectionImageHeight = o, this.drawSelectionImageName = d, this.drawSelectionImageSource = h, this.ctx.paint.drawImage(
|
|
3163
3170
|
this.drawSelectionImageSource,
|
|
3164
3171
|
this.drawSelectionImageX,
|
|
3165
3172
|
this.drawSelectionImageY,
|
|
@@ -3185,7 +3192,7 @@ class ct extends Yt {
|
|
|
3185
3192
|
));
|
|
3186
3193
|
}
|
|
3187
3194
|
getText() {
|
|
3188
|
-
return this.render ? "" : `${this.text}`;
|
|
3195
|
+
return this.render || ["", null, void 0].includes(this.text) ? "" : `${this.text}`;
|
|
3189
3196
|
}
|
|
3190
3197
|
/**
|
|
3191
3198
|
* 获取样式
|
|
@@ -3204,7 +3211,7 @@ class ct extends Yt {
|
|
|
3204
3211
|
};
|
|
3205
3212
|
}
|
|
3206
3213
|
}
|
|
3207
|
-
class
|
|
3214
|
+
class Re {
|
|
3208
3215
|
constructor(t) {
|
|
3209
3216
|
n(this, "ctx");
|
|
3210
3217
|
n(this, "visibleHoverCell");
|
|
@@ -3348,8 +3355,8 @@ class be {
|
|
|
3348
3355
|
t.drawTreeImageHeight
|
|
3349
3356
|
))
|
|
3350
3357
|
return;
|
|
3351
|
-
const
|
|
3352
|
-
if (f && u && !
|
|
3358
|
+
const l = this.ctx.database.getRowForRowKey(t.rowKey), { expand: h = !1, expandLazy: d = !1 } = l || {}, { EXPAND_LAZY: f, EXPAND_LAZY_METHOD: u } = this.ctx.config;
|
|
3359
|
+
if (f && u && !h && !d)
|
|
3353
3360
|
typeof u == "function" && (this.ctx.database.expandLoading(t.rowKey, !0), u({
|
|
3354
3361
|
row: t.row,
|
|
3355
3362
|
rowIndex: t.rowIndex,
|
|
@@ -3378,8 +3385,8 @@ class be {
|
|
|
3378
3385
|
))
|
|
3379
3386
|
return;
|
|
3380
3387
|
const a = this.ctx.database.getSortState(t.key);
|
|
3381
|
-
let
|
|
3382
|
-
a.direction === "none" ?
|
|
3388
|
+
let l;
|
|
3389
|
+
a.direction === "none" ? l = "asc" : a.direction === "asc" ? l = "desc" : l = "none", this.ctx.database.setSortState(t.key, l);
|
|
3383
3390
|
}
|
|
3384
3391
|
/**
|
|
3385
3392
|
* 图标进入和离开事件,包括选中,展开,提示图标等
|
|
@@ -3453,7 +3460,7 @@ class be {
|
|
|
3453
3460
|
}
|
|
3454
3461
|
isBusy(t) {
|
|
3455
3462
|
const { offsetY: e, offsetX: i } = this.ctx.getOffset(t), s = e, o = i;
|
|
3456
|
-
if (!this.ctx.isTarget(t) || this.ctx.stageElement.style.cursor === "row-resize" || this.ctx.stageElement.style.cursor === "col-resize" || this.ctx.columnResizing || this.ctx.rowResizing)
|
|
3463
|
+
if (this.ctx.loading || !this.ctx.isTarget(t) || this.ctx.stageElement.style.cursor === "row-resize" || this.ctx.stageElement.style.cursor === "col-resize" || this.ctx.columnResizing || this.ctx.rowResizing)
|
|
3457
3464
|
return !0;
|
|
3458
3465
|
const { SCROLLER_TRACK_SIZE: r } = this.ctx.config;
|
|
3459
3466
|
return !!(this.ctx.scrollerMove || this.ctx.scrollerFocus || s > this.ctx.stageHeight - r || o > this.ctx.stageWidth - r);
|
|
@@ -3462,15 +3469,15 @@ class be {
|
|
|
3462
3469
|
if (this.isInsideBody(e))
|
|
3463
3470
|
for (const r of i) {
|
|
3464
3471
|
const a = r.fixedCells.concat(r.noFixedCells);
|
|
3465
|
-
for (const
|
|
3466
|
-
const
|
|
3472
|
+
for (const l of a) {
|
|
3473
|
+
const h = l.getDrawX(), d = l.getDrawY();
|
|
3467
3474
|
if (o) {
|
|
3468
|
-
if (t >
|
|
3469
|
-
s(
|
|
3475
|
+
if (t > h && t < h + l.visibleWidth && e > d && e < d + l.visibleHeight) {
|
|
3476
|
+
s(l);
|
|
3470
3477
|
return;
|
|
3471
3478
|
}
|
|
3472
|
-
} else if (t >
|
|
3473
|
-
s(
|
|
3479
|
+
} else if (t > h && t < h + l.width && e > d && e < d + l.height) {
|
|
3480
|
+
s(l);
|
|
3474
3481
|
return;
|
|
3475
3482
|
}
|
|
3476
3483
|
}
|
|
@@ -3492,7 +3499,7 @@ class be {
|
|
|
3492
3499
|
this.resizeObserver.unobserve(this.ctx.stageElement), this.mutationObserver.disconnect();
|
|
3493
3500
|
}
|
|
3494
3501
|
}
|
|
3495
|
-
class
|
|
3502
|
+
class Ie {
|
|
3496
3503
|
constructor(t, e) {
|
|
3497
3504
|
n(this, "eventBus");
|
|
3498
3505
|
n(this, "eventBrowser");
|
|
@@ -3504,6 +3511,7 @@ class Re {
|
|
|
3504
3511
|
n(this, "editorElement");
|
|
3505
3512
|
n(this, "emptyElement");
|
|
3506
3513
|
n(this, "contextMenuElement");
|
|
3514
|
+
n(this, "loadingElement");
|
|
3507
3515
|
n(this, "stageWidth", 0);
|
|
3508
3516
|
n(this, "stageHeight", 0);
|
|
3509
3517
|
n(this, "paint");
|
|
@@ -3528,6 +3536,8 @@ class Re {
|
|
|
3528
3536
|
// 调整位置中
|
|
3529
3537
|
n(this, "editing", !1);
|
|
3530
3538
|
// 编辑中
|
|
3539
|
+
n(this, "loading", !1);
|
|
3540
|
+
// 加载中
|
|
3531
3541
|
n(this, "onlyMergeCell", !1);
|
|
3532
3542
|
// 只有合并单元格
|
|
3533
3543
|
n(this, "selectOnlyOne", !1);
|
|
@@ -3610,10 +3620,11 @@ class Re {
|
|
|
3610
3620
|
canvasElement: o,
|
|
3611
3621
|
overlayerElement: r,
|
|
3612
3622
|
editorElement: a,
|
|
3613
|
-
emptyElement:
|
|
3614
|
-
|
|
3623
|
+
emptyElement: l,
|
|
3624
|
+
loadingElement: h,
|
|
3625
|
+
contextMenuElement: d
|
|
3615
3626
|
} = t;
|
|
3616
|
-
this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = o, this.overlayerElement = r, this.editorElement = a, this.emptyElement = h, this.contextMenuElement =
|
|
3627
|
+
this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = o, this.overlayerElement = r, this.editorElement = a, this.emptyElement = l, this.loadingElement = h, this.contextMenuElement = d, this.config = new It(e.config || {}), this.eventBus = new me(), this.eventBrowser = new Ee(this), this.eventTable = new Re(this), this.paint = new pe(this.canvasElement), this.database = new ge(this, e), this.history = new we(this), this.icons = new be(this);
|
|
3617
3628
|
}
|
|
3618
3629
|
setConfig(t) {
|
|
3619
3630
|
this.config = new It(t);
|
|
@@ -3622,8 +3633,8 @@ class Re {
|
|
|
3622
3633
|
if (this.config.ENABLE_MERGE_CELL_LINK) {
|
|
3623
3634
|
const a = this.database.getVirtualBodyCellByKey(t, e);
|
|
3624
3635
|
if (a && (a.mergeRow || a.mergeCol)) {
|
|
3625
|
-
const { dataList:
|
|
3626
|
-
this.database.batchSetItemValue(
|
|
3636
|
+
const { dataList: l } = a.getSpanInfo(), h = l.map((d) => ({ ...d, value: i }));
|
|
3637
|
+
this.database.batchSetItemValue(h, s, r);
|
|
3627
3638
|
return;
|
|
3628
3639
|
}
|
|
3629
3640
|
}
|
|
@@ -3635,9 +3646,9 @@ class Re {
|
|
|
3635
3646
|
t.forEach((o) => {
|
|
3636
3647
|
const r = this.database.getRowIndexForRowKey(o.rowKey), a = this.database.getColIndexForKey(o.key);
|
|
3637
3648
|
if (r === void 0 || a === void 0) return;
|
|
3638
|
-
const
|
|
3639
|
-
if (
|
|
3640
|
-
const { dataList:
|
|
3649
|
+
const l = this.database.getVirtualBodyCell(r, a);
|
|
3650
|
+
if (l) {
|
|
3651
|
+
const { dataList: h } = l.getSpanInfo(), d = h.map((f) => ({ ...f, value: o.value }));
|
|
3641
3652
|
s.push(...d);
|
|
3642
3653
|
}
|
|
3643
3654
|
}), this.database.batchSetItemValue(s, e, i);
|
|
@@ -3682,7 +3693,7 @@ class Re {
|
|
|
3682
3693
|
for (let o = 0; o <= e[1] - e[0]; o++) {
|
|
3683
3694
|
const r = [];
|
|
3684
3695
|
for (let a = 0; a <= i[1] - i[0]; a++) {
|
|
3685
|
-
const
|
|
3696
|
+
const l = o + e[0], h = a + i[0], d = this.database.getVirtualBodyCell(l, h);
|
|
3686
3697
|
d && (d.selectorCellValueType === "displayText" ? r.push(d.displayText) : r.push(d.getValue()));
|
|
3687
3698
|
}
|
|
3688
3699
|
s += `${r.join(" ")}\r`, t.push(r);
|
|
@@ -3741,7 +3752,7 @@ class Re {
|
|
|
3741
3752
|
this.eventTable.destroy(), this.eventBrowser.destroy(), this.eventBus.destroy();
|
|
3742
3753
|
}
|
|
3743
3754
|
}
|
|
3744
|
-
class
|
|
3755
|
+
class vt {
|
|
3745
3756
|
constructor(t, e) {
|
|
3746
3757
|
n(this, "ctx");
|
|
3747
3758
|
n(this, "type");
|
|
@@ -3803,8 +3814,8 @@ class St {
|
|
|
3803
3814
|
if (this.isOnScrollbar(e, i) && t.target === this.ctx.canvasElement ? this.isFocus = !0 : this.isFocus = !1, r === 0 || s == this.clientX && o == this.clientY) return;
|
|
3804
3815
|
let a = 0;
|
|
3805
3816
|
if (this.type === "horizontal" ? a = s - this.clientX : a = o - this.clientY, this.isDragging && a !== 0) {
|
|
3806
|
-
let
|
|
3807
|
-
this.type === "vertical" ?
|
|
3817
|
+
let l = 0;
|
|
3818
|
+
this.type === "vertical" ? l = this.dragStart + a / (this.visibleDistance - this.barHeight) * this.distance : l = this.dragStart + a / (this.visibleDistance - this.barWidth) * this.distance, this.scroll = Math.max(0, Math.min(l, this.distance));
|
|
3808
3819
|
}
|
|
3809
3820
|
}
|
|
3810
3821
|
isPointInElement(t, e, i, s, o, r) {
|
|
@@ -3830,23 +3841,23 @@ class St {
|
|
|
3830
3841
|
stageHeight: i,
|
|
3831
3842
|
stageWidth: s,
|
|
3832
3843
|
config: { SCROLLER_TRACK_SIZE: o = 0, SCROLLER_SIZE: r = 0, BORDER: a }
|
|
3833
|
-
} = this.ctx,
|
|
3844
|
+
} = this.ctx, l = s, h = i, d = e.height, f = e.width, u = t.height, x = this.ctx.footer.height;
|
|
3834
3845
|
if (this.type === "vertical") {
|
|
3835
|
-
this.visibleDistance =
|
|
3846
|
+
this.visibleDistance = h - o - d, this.distance = u - this.visibleDistance + x, this.trackX = l - o, this.trackY = 0, this.splitPoints = [this.trackX, d, this.trackX + o, d], this.trackWidth = o, this.trackHeight = h, this.barX = this.trackX - 1 + (o - r) / 2, this.barWidth = r;
|
|
3836
3847
|
const w = this.distance ? this.visibleDistance / (u + x) : 0;
|
|
3837
|
-
let
|
|
3838
|
-
|
|
3848
|
+
let E = Math.floor(w * this.visibleDistance);
|
|
3849
|
+
E < 30 ? E = 30 : E > this.visibleDistance && (E = 0), this.barHeight = E, this.barY = d + this.scroll / this.distance * (this.visibleDistance - this.barHeight), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
|
|
3839
3850
|
} else {
|
|
3840
|
-
this.visibleDistance =
|
|
3841
|
-
h - o,
|
|
3851
|
+
this.visibleDistance = l - o, this.distance = f - this.visibleDistance, this.splitPoints = [
|
|
3842
3852
|
l - o,
|
|
3843
3853
|
h - o,
|
|
3844
|
-
l
|
|
3854
|
+
l - o,
|
|
3855
|
+
h
|
|
3845
3856
|
];
|
|
3846
3857
|
const w = a ? 0 : 0.5;
|
|
3847
|
-
this.trackX = 0, this.trackY =
|
|
3848
|
-
const
|
|
3849
|
-
let g = Math.floor(
|
|
3858
|
+
this.trackX = 0, this.trackY = h - o + w, this.trackWidth = l, this.trackHeight = o;
|
|
3859
|
+
const E = this.distance ? this.visibleDistance / f : 0;
|
|
3860
|
+
let g = Math.floor(E * this.visibleDistance);
|
|
3850
3861
|
this.barY = this.trackY - 1 + (o - r) / 2, g < 30 ? g = 30 : g >= this.visibleDistance && (g = 0), this.barWidth = g, this.barHeight = r, this.barX = this.scroll / this.distance * (this.visibleDistance - this.barWidth), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
|
|
3851
3862
|
}
|
|
3852
3863
|
}
|
|
@@ -3868,12 +3879,12 @@ class St {
|
|
|
3868
3879
|
}), this.ctx.scrollerFocus = this.isFocus;
|
|
3869
3880
|
}
|
|
3870
3881
|
}
|
|
3871
|
-
class
|
|
3882
|
+
class Se {
|
|
3872
3883
|
constructor(t) {
|
|
3873
3884
|
n(this, "ctx");
|
|
3874
3885
|
n(this, "verticalScrollbar");
|
|
3875
3886
|
n(this, "horizontalScrollbar");
|
|
3876
|
-
this.ctx = t, this.verticalScrollbar = new
|
|
3887
|
+
this.ctx = t, this.verticalScrollbar = new vt(t, "vertical"), this.horizontalScrollbar = new vt(t, "horizontal"), this.ctx.on("wheel", (e) => this.onWheel(e)), this.ctx.on("mousedown", (e) => this.onMouseDown(e)), this.ctx.on("mousemove", (e) => this.onMouseMove(e)), this.ctx.on("mouseup", () => this.onMouseUp()), this.ctx.on("touchmove", (e) => this.onTouchmove(e)), this.ctx.on("touchstart", (e) => {
|
|
3877
3888
|
this.onTouchstart(e);
|
|
3878
3889
|
}), this.ctx.on("setScroll", (e, i) => {
|
|
3879
3890
|
this.setScroll(e, i);
|
|
@@ -3935,7 +3946,7 @@ class Ie {
|
|
|
3935
3946
|
this.setScrollY(o - e.visibleHeight / 2);
|
|
3936
3947
|
}
|
|
3937
3948
|
}
|
|
3938
|
-
class
|
|
3949
|
+
class _e {
|
|
3939
3950
|
constructor(t) {
|
|
3940
3951
|
n(this, "ctx");
|
|
3941
3952
|
// 上下文
|
|
@@ -3974,7 +3985,7 @@ class ve {
|
|
|
3974
3985
|
n(this, "renderFixedCellHeaders", []);
|
|
3975
3986
|
this.ctx = t, this.ctx.on(
|
|
3976
3987
|
"resetHeader",
|
|
3977
|
-
|
|
3988
|
+
j(() => {
|
|
3978
3989
|
this.init(), this.ctx.emit("draw");
|
|
3979
3990
|
}, 100)
|
|
3980
3991
|
), this.init(), this.initResizeColumn();
|
|
@@ -3984,60 +3995,57 @@ class ve {
|
|
|
3984
3995
|
config: { HEADER_HEIGHT: t, SCROLLER_TRACK_SIZE: e }
|
|
3985
3996
|
} = this.ctx, i = this.ctx.database.getColumns();
|
|
3986
3997
|
this.columns = i, this.allCellHeaders = [], this.leafCellHeaders = [], this.fixedLeftCellHeaders = [], this.fixedRightCellHeaders = [], this.centerCellHeaders = [];
|
|
3987
|
-
const s =
|
|
3998
|
+
const s = Nt(i), o = it(i);
|
|
3988
3999
|
this.height = t * s, this.width = o.reduce((f, u) => {
|
|
3989
|
-
const x = u.width || 100, { maxWidth: w, minWidth:
|
|
3990
|
-
return w && x > w ? f + w :
|
|
4000
|
+
const x = u.width || 100, { maxWidth: w, minWidth: E } = u;
|
|
4001
|
+
return w && x > w ? f + w : E && x < E ? f + E : f + x;
|
|
3991
4002
|
}, 0), this.visibleHeight = this.height;
|
|
3992
|
-
const r =
|
|
4003
|
+
const r = ae(kt(i, s));
|
|
3993
4004
|
this.columnIndex = 0, this.resizeNum = 0, this.render(r, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
|
|
3994
4005
|
const a = this.ctx.containerElement.getBoundingClientRect();
|
|
3995
4006
|
this.resizeNum > 0 ? this.ctx.stageWidth = Math.floor(a.width) : this.ctx.stageWidth = Math.floor(this.width + e), this.ctx.stageElement.style.width = this.ctx.stageWidth + "px", this.visibleWidth = this.ctx.stageWidth - e;
|
|
3996
|
-
const
|
|
3997
|
-
if (this.resizeNum &&
|
|
3998
|
-
const f = Math.floor(
|
|
4007
|
+
const l = this.visibleWidth - this.width;
|
|
4008
|
+
if (this.resizeNum && l > 0) {
|
|
4009
|
+
const f = Math.floor(l / this.resizeNum * 100) / 100;
|
|
3999
4010
|
this.resizeAllColumn(f);
|
|
4000
4011
|
}
|
|
4001
|
-
const
|
|
4002
|
-
this.ctx.fixedLeftWidth =
|
|
4012
|
+
const h = this.fixedLeftCellHeaders.filter((f) => !f.hasChildren);
|
|
4013
|
+
this.ctx.fixedLeftWidth = h.reduce((f, u) => f + u.width, 0);
|
|
4003
4014
|
const d = this.fixedRightCellHeaders.filter((f) => !f.hasChildren);
|
|
4004
4015
|
this.ctx.fixedRightWidth = d.reduce((f, u) => f + u.width, e), 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.visibleWidth = this.visibleWidth, this.ctx.header.visibleHeight = this.visibleHeight;
|
|
4005
4016
|
}
|
|
4006
4017
|
// 调整表头的宽度
|
|
4007
4018
|
initResizeColumn() {
|
|
4008
|
-
|
|
4009
|
-
config
|
|
4010
|
-
} = this.ctx;
|
|
4011
|
-
t && (this.ctx.on("mousedown", (e) => {
|
|
4012
|
-
this.ctx.isTarget(e) && (this.clientX = e.clientX, this.resizeTarget ? (this.isResizing = !0, this.ctx.columnResizing = !0) : this.isResizing = !1, this.isMouseDown = !0);
|
|
4019
|
+
this.ctx.on("mousedown", (t) => {
|
|
4020
|
+
this.ctx.config.ENABLE_RESIZE_COLUMN && this.ctx.isTarget(t) && (this.clientX = t.clientX, this.resizeTarget ? (this.isResizing = !0, this.ctx.columnResizing = !0) : this.isResizing = !1, this.isMouseDown = !0);
|
|
4013
4021
|
}), this.ctx.on("mouseup", () => {
|
|
4014
|
-
this.isMouseDown = !1, this.resizeDiff !== 0 && this.resizeTarget && this.resizeColumn(this.resizeTarget, this.resizeDiff), this.resizeTarget = null, this.isResizing = !1, this.isMouseDown = !1, this.ctx.columnResizing = !1, this.clientX = 0, this.resizeDiff = 0;
|
|
4015
|
-
}), this.ctx.on("mousemove", (
|
|
4016
|
-
if (this.ctx.editing) return;
|
|
4022
|
+
this.ctx.config.ENABLE_RESIZE_COLUMN && (this.isMouseDown = !1, this.resizeDiff !== 0 && this.resizeTarget && this.resizeColumn(this.resizeTarget, this.resizeDiff), this.resizeTarget = null, this.isResizing = !1, this.isMouseDown = !1, this.ctx.columnResizing = !1, this.clientX = 0, this.resizeDiff = 0);
|
|
4023
|
+
}), this.ctx.on("mousemove", (t) => {
|
|
4024
|
+
if (!this.ctx.config.ENABLE_RESIZE_COLUMN || this.ctx.editing) return;
|
|
4017
4025
|
const {
|
|
4018
|
-
stageWidth:
|
|
4019
|
-
config: { RESIZE_COLUMN_MIN_WIDTH:
|
|
4026
|
+
stageWidth: e,
|
|
4027
|
+
config: { RESIZE_COLUMN_MIN_WIDTH: i }
|
|
4020
4028
|
} = this.ctx;
|
|
4021
4029
|
if (this.isResizing && this.resizeTarget) {
|
|
4022
|
-
const
|
|
4023
|
-
let
|
|
4024
|
-
|
|
4030
|
+
const s = this.resizeTarget.width, o = this.resizeTarget.minWidth, r = this.resizeTarget.maxWidth;
|
|
4031
|
+
let a = t.clientX - this.clientX;
|
|
4032
|
+
a + s < i && (a = -(s - i)), o && a + s < o && (a = -(s - o)), r && a + s > r && (a = r - s), this.resizeDiff = a, this.ctx.emit("draw");
|
|
4025
4033
|
} else {
|
|
4026
4034
|
if (this.resizeTarget = null, this.isMouseDown)
|
|
4027
4035
|
return;
|
|
4028
|
-
if (
|
|
4036
|
+
if (t.offsetX < 0 || t.offsetX > this.visibleWidth) {
|
|
4029
4037
|
this.ctx.stageElement.style.cursor === "col-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
4030
4038
|
return;
|
|
4031
4039
|
}
|
|
4032
4040
|
this.ctx.stageElement.style.cursor === "col-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
4033
|
-
const
|
|
4034
|
-
for (const
|
|
4035
|
-
const { offsetX:
|
|
4036
|
-
l >
|
|
4037
|
-
|
|
4041
|
+
const s = [...this.renderFixedCellHeaders, ...this.renderCenterCellHeaders];
|
|
4042
|
+
for (const o of s) {
|
|
4043
|
+
const { offsetX: r, offsetY: a } = this.ctx.getOffset(t), l = r, h = o.getDrawX();
|
|
4044
|
+
l > h + o.width - 5 && l < h + o.width + 4 && l < e - 4 && // 视窗中最后一列不允许调整宽
|
|
4045
|
+
o.colspan <= 1 && this.ctx.isTarget(t) && a <= this.height && (this.ctx.stageElement.style.cursor = "col-resize", this.resizeTarget = o);
|
|
4038
4046
|
}
|
|
4039
4047
|
}
|
|
4040
|
-
})
|
|
4048
|
+
});
|
|
4041
4049
|
}
|
|
4042
4050
|
resizeColumn(t, e) {
|
|
4043
4051
|
const i = (o) => {
|
|
@@ -4088,10 +4096,10 @@ class ve {
|
|
|
4088
4096
|
let s = e;
|
|
4089
4097
|
const { HEADER_HEIGHT: o = 0 } = this.ctx.config;
|
|
4090
4098
|
for (let r = 0; r < i; r++) {
|
|
4091
|
-
const a = t[r],
|
|
4099
|
+
const a = t[r], l = o * (a.rowspan || 0), h = o * (a.level || 0);
|
|
4092
4100
|
let { minWidth: d, maxWidth: f } = a, u = a.width || 100;
|
|
4093
|
-
d && u < d && (u = d), f && u > f && (u = f), a.children && (u = it(a.children).reduce((
|
|
4094
|
-
const x = new ct(this.ctx, this.columnIndex, s,
|
|
4101
|
+
d && u < d && (u = d), f && u > f && (u = f), a.children && (u = it(a.children).reduce((E, g) => E + ((g == null ? void 0 : g.width) || 100), 0));
|
|
4102
|
+
const x = new ct(this.ctx, this.columnIndex, s, h, u, l, a);
|
|
4095
4103
|
this.ctx.database.setHeader(a.key, x), this.allCellHeaders.push(x), a.children || (this.leafCellHeaders.push(x), x.column.widthFillDisable || this.resizeNum++), a.fixed === "left" ? this.fixedLeftCellHeaders.push(x) : a.fixed === "right" ? this.fixedRightCellHeaders.push(x) : this.centerCellHeaders.push(x), !a.children && this.columnIndex++, a.children && this.render(a.children, s), s += u;
|
|
4096
4104
|
}
|
|
4097
4105
|
}
|
|
@@ -4123,8 +4131,8 @@ class ve {
|
|
|
4123
4131
|
colorStart: "rgba(0,0,0,0.1)",
|
|
4124
4132
|
colorEnd: "rgba(0,0,0,0)"
|
|
4125
4133
|
}), i < Math.floor(s.width - o - 1) && e !== a) {
|
|
4126
|
-
const
|
|
4127
|
-
this.ctx.paint.drawShadow(
|
|
4134
|
+
const l = s.width - (this.x + this.width) + o - e;
|
|
4135
|
+
this.ctx.paint.drawShadow(l, this.y, e, this.height, {
|
|
4128
4136
|
fillColor: r,
|
|
4129
4137
|
side: "left",
|
|
4130
4138
|
shadowWidth: 4,
|
|
@@ -4165,8 +4173,8 @@ class ve {
|
|
|
4165
4173
|
}), this.drawTipLine(), this.drawBottomLine();
|
|
4166
4174
|
}
|
|
4167
4175
|
}
|
|
4168
|
-
class
|
|
4169
|
-
constructor(t, e, i = 0, s = 0, o = 0, r = 0, a,
|
|
4176
|
+
class Kt {
|
|
4177
|
+
constructor(t, e, i = 0, s = 0, o = 0, r = 0, a, l = "body") {
|
|
4170
4178
|
n(this, "ctx");
|
|
4171
4179
|
n(this, "x", 0);
|
|
4172
4180
|
n(this, "y", 0);
|
|
@@ -4181,7 +4189,7 @@ class Bt {
|
|
|
4181
4189
|
n(this, "rowType", "body");
|
|
4182
4190
|
n(this, "data");
|
|
4183
4191
|
n(this, "calculatedHeight", -1);
|
|
4184
|
-
this.ctx = t, this.x = i, this.y = s, this.width = o, this.height = r, this.rowIndex = e, this.rowKey = t.database.getRowKeyForRowIndex(e) || "", this.rowType =
|
|
4192
|
+
this.ctx = t, this.x = i, this.y = s, this.width = o, this.height = r, this.rowIndex = e, this.rowKey = t.database.getRowKeyForRowIndex(e) || "", this.rowType = l, this.data = a, this.update();
|
|
4185
4193
|
}
|
|
4186
4194
|
update() {
|
|
4187
4195
|
const { header: t } = this.ctx, e = [], i = [], s = [], o = [];
|
|
@@ -4226,7 +4234,7 @@ class Bt {
|
|
|
4226
4234
|
});
|
|
4227
4235
|
}
|
|
4228
4236
|
}
|
|
4229
|
-
class
|
|
4237
|
+
class ve {
|
|
4230
4238
|
constructor(t) {
|
|
4231
4239
|
n(this, "resizeTarget", null);
|
|
4232
4240
|
//调整行大小的目标
|
|
@@ -4263,8 +4271,8 @@ class Se {
|
|
|
4263
4271
|
FOOTER_FIXED: o,
|
|
4264
4272
|
SCROLLER_TRACK_SIZE: r = 0,
|
|
4265
4273
|
HEIGHT: a,
|
|
4266
|
-
EMPTY_BODY_HEIGHT:
|
|
4267
|
-
MAX_HEIGHT:
|
|
4274
|
+
EMPTY_BODY_HEIGHT: l = 0,
|
|
4275
|
+
MAX_HEIGHT: h = 0,
|
|
4268
4276
|
ENABLE_OFFSET_HEIGHT: d = 0,
|
|
4269
4277
|
OFFSET_HEIGHT: f = 0,
|
|
4270
4278
|
FOOTER_POSITION: u
|
|
@@ -4275,81 +4283,78 @@ class Se {
|
|
|
4275
4283
|
this.x = 0, u === "top" && o ? this.y = e.height + i.height : this.y = e.height;
|
|
4276
4284
|
const { data: x, sumHeight: w } = s.getData();
|
|
4277
4285
|
this.height = w, this.data = x, this.width = e.width, this.visibleWidth = this.ctx.stageWidth - r;
|
|
4278
|
-
const
|
|
4279
|
-
!this.data.length && !a ? this.height =
|
|
4286
|
+
const E = this.ctx.footer.height;
|
|
4287
|
+
!this.data.length && !a ? this.height = l : !this.data.length && a && (this.height = a - e.height - E - r);
|
|
4280
4288
|
let g = this.height + e.height + r;
|
|
4281
|
-
g +=
|
|
4282
|
-
let
|
|
4283
|
-
const y = window.innerHeight, { top:
|
|
4284
|
-
if (y >
|
|
4285
|
-
const T = y -
|
|
4286
|
-
T > e.height + r ?
|
|
4287
|
-
} else this.data.length && a ?
|
|
4288
|
-
|
|
4289
|
+
g += E;
|
|
4290
|
+
let m = g;
|
|
4291
|
+
const y = window.innerHeight, { top: p } = this.containerRect || this.ctx.containerElement.getBoundingClientRect();
|
|
4292
|
+
if (y > p && d && !a) {
|
|
4293
|
+
const T = y - p - f;
|
|
4294
|
+
T > e.height + r ? m = T : g > h && (m = h);
|
|
4295
|
+
} else this.data.length && a ? m = a : this.data.length && h && g > h && (m = h);
|
|
4296
|
+
m > 0 && (this.ctx.stageHeight = Math.floor(m), this.ctx.stageElement.style.height = `${this.ctx.stageHeight}px`);
|
|
4289
4297
|
let R = this.ctx.stageHeight - e.height - r;
|
|
4290
|
-
o ? this.visibleHeight = R -
|
|
4291
|
-
const C = window.devicePixelRatio || 1, I = this.ctx.stageWidth * C,
|
|
4292
|
-
t.width = Math.round(I), t.height = Math.round(
|
|
4293
|
-
const
|
|
4298
|
+
o ? this.visibleHeight = R - E : this.visibleHeight = R, this.data.length || (this.height = this.visibleHeight), this.ctx.body.x = this.x, this.ctx.body.y = this.y, this.ctx.body.width = this.width, this.ctx.body.height = this.height, this.ctx.body.visibleWidth = this.visibleWidth, this.ctx.body.visibleHeight = this.visibleHeight, this.ctx.body.data = x;
|
|
4299
|
+
const C = window.devicePixelRatio || 1, I = this.ctx.stageWidth * C, _ = this.ctx.stageHeight * C;
|
|
4300
|
+
t.width = Math.round(I), t.height = Math.round(_);
|
|
4301
|
+
const v = this.data.length ? "not-empty" : "empty";
|
|
4294
4302
|
this.ctx.emit("emptyChange", {
|
|
4295
|
-
isEmpty:
|
|
4296
|
-
type:
|
|
4303
|
+
isEmpty: v,
|
|
4304
|
+
type: v,
|
|
4297
4305
|
headerHeight: e.height,
|
|
4298
4306
|
bodyHeight: this.height,
|
|
4299
|
-
footerHeight:
|
|
4307
|
+
footerHeight: E,
|
|
4300
4308
|
width: this.width,
|
|
4301
|
-
height: this.data.length ? 0 :
|
|
4309
|
+
height: this.data.length ? 0 : l + E
|
|
4302
4310
|
});
|
|
4303
|
-
const
|
|
4304
|
-
this.ctx.canvasElement.setAttribute("style", `height:${b}px;width:${
|
|
4311
|
+
const S = Math.round(t.width / C * 1e4) / 1e4, b = Math.round(t.height / C * 1e4) / 1e4;
|
|
4312
|
+
this.ctx.canvasElement.setAttribute("style", `height:${b}px;width:${S}px;`), this.ctx.paint.scale(C);
|
|
4305
4313
|
}
|
|
4306
4314
|
// 调整行的高度
|
|
4307
4315
|
initResizeRow() {
|
|
4308
|
-
|
|
4309
|
-
config
|
|
4310
|
-
} = this.ctx;
|
|
4311
|
-
t && (this.ctx.on("resize", () => {
|
|
4312
|
-
this.containerRect = this.ctx.containerElement.getBoundingClientRect();
|
|
4316
|
+
this.ctx.on("resize", () => {
|
|
4317
|
+
this.ctx.config.ENABLE_RESIZE_ROW && (this.containerRect = this.ctx.containerElement.getBoundingClientRect());
|
|
4313
4318
|
}), this.ctx.on("resizeObserver", () => {
|
|
4314
|
-
this.containerRect = this.ctx.containerElement.getBoundingClientRect();
|
|
4319
|
+
this.ctx.config.ENABLE_RESIZE_ROW && (this.containerRect = this.ctx.containerElement.getBoundingClientRect());
|
|
4315
4320
|
}), this.ctx.on("mouseup", () => {
|
|
4316
|
-
this.isMouseDown = !1, this.resizeDiff !== 0 && this.resizeTarget && this.resizeRow(this.resizeTarget, this.resizeDiff), this.resizeTarget = null, this.resizeDiff = 0, this.isResizing = !1, setTimeout(() => {
|
|
4321
|
+
this.ctx.config.ENABLE_RESIZE_ROW && (this.isMouseDown = !1, this.resizeDiff !== 0 && this.resizeTarget && this.resizeRow(this.resizeTarget, this.resizeDiff), this.resizeTarget = null, this.resizeDiff = 0, this.isResizing = !1, setTimeout(() => {
|
|
4317
4322
|
this.ctx.rowResizing = !1;
|
|
4318
|
-
}, 0), this.clientY = 0;
|
|
4319
|
-
}), this.ctx.on("mousedown", (
|
|
4320
|
-
this.ctx.isTarget(
|
|
4321
|
-
}), this.ctx.on("mousemove", (
|
|
4322
|
-
if (this.ctx.editing) return;
|
|
4323
|
-
const { offsetY:
|
|
4324
|
-
stageHeight:
|
|
4323
|
+
}, 0), this.clientY = 0);
|
|
4324
|
+
}), this.ctx.on("mousedown", (t) => {
|
|
4325
|
+
this.ctx.config.ENABLE_RESIZE_ROW && this.ctx.isTarget(t) && (this.clientY = t.clientY, this.resizeTarget ? (this.isResizing = !0, this.ctx.rowResizing = !0) : (this.isResizing = !1, this.ctx.rowResizing = !1), this.isMouseDown = !0);
|
|
4326
|
+
}), this.ctx.on("mousemove", (t) => {
|
|
4327
|
+
if (!this.ctx.config.ENABLE_RESIZE_ROW || this.ctx.editing) return;
|
|
4328
|
+
const { offsetY: e, offsetX: i } = this.ctx.getOffset(t), s = e, o = i, r = t.clientY, {
|
|
4329
|
+
stageHeight: a,
|
|
4325
4330
|
scrollY: l,
|
|
4326
|
-
config: { RESIZE_ROW_MIN_HEIGHT:
|
|
4331
|
+
config: { RESIZE_ROW_MIN_HEIGHT: h = 0 }
|
|
4327
4332
|
} = this.ctx;
|
|
4328
4333
|
if (this.isResizing && this.resizeTarget) {
|
|
4329
|
-
const
|
|
4330
|
-
let
|
|
4331
|
-
const { calculatedHeight:
|
|
4332
|
-
|
|
4334
|
+
const d = this.resizeTarget.height;
|
|
4335
|
+
let f = r - this.clientY;
|
|
4336
|
+
const { calculatedHeight: u } = this.resizeTarget, x = u === -1 ? h : u;
|
|
4337
|
+
f + d < x && (f = -(d - x)), this.resizeDiff = f, this.ctx.emit("draw");
|
|
4333
4338
|
} else {
|
|
4334
4339
|
if (this.resizeTarget = null, this.isMouseDown)
|
|
4335
4340
|
return;
|
|
4336
|
-
if (
|
|
4341
|
+
if (o < 0 || o > this.ctx.body.visibleWidth || s < 0 || s > this.ctx.header.visibleHeight + this.ctx.body.visibleHeight) {
|
|
4337
4342
|
this.ctx.stageElement.style.cursor === "row-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
4338
4343
|
return;
|
|
4339
4344
|
}
|
|
4340
4345
|
if (this.ctx.stageElement.style.cursor === "crosshair")
|
|
4341
4346
|
return;
|
|
4342
4347
|
this.ctx.stageElement.style.cursor === "row-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
4343
|
-
for (let
|
|
4344
|
-
const
|
|
4345
|
-
if (
|
|
4346
|
-
for (let
|
|
4347
|
-
const
|
|
4348
|
-
|
|
4348
|
+
for (let d = 0; d < this.renderRows.length; d++) {
|
|
4349
|
+
const f = this.renderRows[d];
|
|
4350
|
+
if (s > f.y - l + f.height - 1.5 && s < f.y - l + f.height + 1.5 && s < a - 4)
|
|
4351
|
+
for (let x = 0; x < f.cells.length; x++) {
|
|
4352
|
+
const w = f.cells[x];
|
|
4353
|
+
o > w.drawX + 10 && o < w.drawX + w.width - 10 && w.rowspan === 1 && (this.ctx.stageElement.style.cursor = "row-resize", this.resizeTarget = f);
|
|
4349
4354
|
}
|
|
4350
4355
|
}
|
|
4351
4356
|
}
|
|
4352
|
-
})
|
|
4357
|
+
});
|
|
4353
4358
|
}
|
|
4354
4359
|
resizeRow(t, e) {
|
|
4355
4360
|
const { rowIndex: i, height: s, rowKey: o, data: r } = t;
|
|
@@ -4391,8 +4396,8 @@ class Se {
|
|
|
4391
4396
|
colorStart: "rgba(0,0,0,0.1)",
|
|
4392
4397
|
colorEnd: "rgba(0,0,0,0)"
|
|
4393
4398
|
}), i < Math.floor(s.width - o - 1) && e !== a) {
|
|
4394
|
-
const
|
|
4395
|
-
this.ctx.paint.drawShadow(
|
|
4399
|
+
const l = s.width - (this.x + this.width) + o - e;
|
|
4400
|
+
this.ctx.paint.drawShadow(l, this.y, e, this.height, {
|
|
4396
4401
|
fillColor: r,
|
|
4397
4402
|
side: "left",
|
|
4398
4403
|
shadowWidth: 4,
|
|
@@ -4420,15 +4425,15 @@ class Se {
|
|
|
4420
4425
|
config: { CELL_HEIGHT: s }
|
|
4421
4426
|
} = this.ctx, o = i, { data: r, positions: a } = e.getData();
|
|
4422
4427
|
this.ctx.maxRowIndex = r.length - 1;
|
|
4423
|
-
let
|
|
4424
|
-
if (
|
|
4428
|
+
let l = this.binarySearch(a, o), h = this.binarySearch(a, o + this.visibleHeight);
|
|
4429
|
+
if (h === -1 && (h = this.ctx.maxRowIndex), l === -1 && h === this.ctx.maxRowIndex) {
|
|
4425
4430
|
const f = Math.floor(this.visibleHeight / s);
|
|
4426
|
-
|
|
4431
|
+
l = this.ctx.maxRowIndex - f;
|
|
4427
4432
|
}
|
|
4428
|
-
this.headIndex = Math.max(0,
|
|
4433
|
+
this.headIndex = Math.max(0, l), this.tailIndex = Math.min(this.ctx.maxRowIndex, h + 1), this.visibleRows = r.slice(this.headIndex, this.tailIndex + 1), this.ctx.body.headIndex = this.headIndex, this.ctx.body.tailIndex = this.tailIndex, this.ctx.body.visibleRows = this.visibleRows;
|
|
4429
4434
|
const d = [];
|
|
4430
4435
|
for (let f = 0; f < this.visibleRows.length; f++) {
|
|
4431
|
-
const u = this.headIndex + f, x = this.visibleRows[f], { height: w, top:
|
|
4436
|
+
const u = this.headIndex + f, x = this.visibleRows[f], { height: w, top: E } = this.ctx.database.getPositionForRowIndex(u), g = new Kt(this.ctx, u, 0, E + this.y, t.width, w, x);
|
|
4432
4437
|
d.push(g);
|
|
4433
4438
|
}
|
|
4434
4439
|
this.renderRows = d, this.ctx.body.renderRows = d;
|
|
@@ -4458,7 +4463,7 @@ class Se {
|
|
|
4458
4463
|
}), this.drawTipLine();
|
|
4459
4464
|
}
|
|
4460
4465
|
}
|
|
4461
|
-
class
|
|
4466
|
+
class Te {
|
|
4462
4467
|
constructor(t) {
|
|
4463
4468
|
n(this, "ctx");
|
|
4464
4469
|
n(this, "renderRows", []);
|
|
@@ -4489,16 +4494,16 @@ class _e {
|
|
|
4489
4494
|
stageWidth: o,
|
|
4490
4495
|
config: { HEADER_BG_COLOR: r, SCROLLER_TRACK_SIZE: a }
|
|
4491
4496
|
} = this.ctx;
|
|
4492
|
-
let
|
|
4493
|
-
if (this.ctx.config.FOOTER_FIXED || (
|
|
4497
|
+
let l = this.y;
|
|
4498
|
+
if (this.ctx.config.FOOTER_FIXED || (l = this.y - this.ctx.scrollY), i > 0 && t !== 0 && this.ctx.paint.drawShadow(this.x, l, t, this.height, {
|
|
4494
4499
|
fillColor: r,
|
|
4495
4500
|
side: "right",
|
|
4496
4501
|
shadowWidth: 4,
|
|
4497
4502
|
colorStart: "rgba(0,0,0,0.1)",
|
|
4498
4503
|
colorEnd: "rgba(0,0,0,0)"
|
|
4499
4504
|
}), i < Math.floor(s.width - o - 1) && e !== a) {
|
|
4500
|
-
const
|
|
4501
|
-
this.ctx.paint.drawShadow(
|
|
4505
|
+
const h = s.width - (this.x + this.width) + o - e;
|
|
4506
|
+
this.ctx.paint.drawShadow(h, l, e, this.height, {
|
|
4502
4507
|
fillColor: r,
|
|
4503
4508
|
side: "left",
|
|
4504
4509
|
shadowWidth: 4,
|
|
@@ -4513,7 +4518,7 @@ class _e {
|
|
|
4513
4518
|
let e = this.y;
|
|
4514
4519
|
const i = [];
|
|
4515
4520
|
this.data.forEach((s, o) => {
|
|
4516
|
-
const r = new
|
|
4521
|
+
const r = new Kt(this.ctx, o, 0, e, this.width, t, s, "footer");
|
|
4517
4522
|
e += t, i.push(r);
|
|
4518
4523
|
}), this.renderRows = i, this.ctx.footer.renderRows = this.renderRows;
|
|
4519
4524
|
}
|
|
@@ -4539,7 +4544,7 @@ class _e {
|
|
|
4539
4544
|
}), this.drawTopLine();
|
|
4540
4545
|
}
|
|
4541
4546
|
}
|
|
4542
|
-
class
|
|
4547
|
+
class Oe {
|
|
4543
4548
|
// 垂直滚动定时器
|
|
4544
4549
|
constructor(t) {
|
|
4545
4550
|
n(this, "isCut", !1);
|
|
@@ -4558,7 +4563,7 @@ class Te {
|
|
|
4558
4563
|
this.moveFocus(t);
|
|
4559
4564
|
}), this.ctx.on(
|
|
4560
4565
|
"mousemove",
|
|
4561
|
-
|
|
4566
|
+
j((t) => {
|
|
4562
4567
|
const { offsetY: e, offsetX: i } = this.ctx.getOffset(t), s = this.ctx.isTarget(t) && i > 0 && i < this.ctx.body.visibleWidth && e > this.ctx.header.visibleHeight && e < this.ctx.header.visibleHeight + this.ctx.body.visibleHeight;
|
|
4563
4568
|
(this.ctx.selectorMove || this.ctx.autofillMove) && (!s && !this.mousedownHeader ? this.startAdjustPosition(t) : this.stopAdjustPosition());
|
|
4564
4569
|
}, 100)
|
|
@@ -4656,30 +4661,30 @@ class Te {
|
|
|
4656
4661
|
this.ctx.mousedown && (this.ctx.selectorMove = !0), this.ctx.selector.enable = !0;
|
|
4657
4662
|
const {
|
|
4658
4663
|
SELECTOR_AREA_MIN_X: a,
|
|
4659
|
-
SELECTOR_AREA_MAX_X:
|
|
4660
|
-
SELECTOR_AREA_MIN_Y:
|
|
4664
|
+
SELECTOR_AREA_MAX_X: l,
|
|
4665
|
+
SELECTOR_AREA_MIN_Y: h,
|
|
4661
4666
|
SELECTOR_AREA_MAX_Y: d,
|
|
4662
4667
|
SELECTOR_AREA_MAX_X_OFFSET: f,
|
|
4663
4668
|
SELECTOR_AREA_MAX_Y_OFFSET: u
|
|
4664
|
-
} = this.ctx.config, x = a, w =
|
|
4665
|
-
let [
|
|
4666
|
-
if (
|
|
4669
|
+
} = this.ctx.config, x = a, w = l || this.ctx.maxColIndex - f, E = h, g = d || this.ctx.maxRowIndex - u;
|
|
4670
|
+
let [m, y] = o, [p, R] = r;
|
|
4671
|
+
if (m < x || y > w || p < E || R > g)
|
|
4667
4672
|
return;
|
|
4668
4673
|
if (this.ctx.stageElement.focus({ preventScroll: !0 }), this.ctx.config.ENABLE_MERGE_CELL_LINK) {
|
|
4669
4674
|
const I = this.adjustMergeCells(o, r);
|
|
4670
|
-
|
|
4675
|
+
p = I.yArr[0], R = I.yArr[1], m = I.xArr[0], y = I.xArr[1], this.ctx.onlyMergeCell = I.onlyMergeCell;
|
|
4671
4676
|
}
|
|
4672
|
-
|
|
4677
|
+
m === y && p === R ? this.ctx.selectOnlyOne = !0 : this.ctx.selectOnlyOne = !1, o = [Math.max(x, m), Math.min(w, y)], r = [Math.max(E, p), Math.min(g, R)];
|
|
4673
4678
|
const { BEFORE_SET_SELECTOR_METHOD: C } = this.ctx.config;
|
|
4674
4679
|
if (typeof C == "function") {
|
|
4675
|
-
const
|
|
4680
|
+
const _ = C({
|
|
4676
4681
|
focusCell: this.ctx.focusCell,
|
|
4677
4682
|
xArr: o,
|
|
4678
4683
|
yArr: r
|
|
4679
4684
|
});
|
|
4680
|
-
if (!
|
|
4685
|
+
if (!_)
|
|
4681
4686
|
return;
|
|
4682
|
-
o =
|
|
4687
|
+
o = _.xArr, r = _.yArr;
|
|
4683
4688
|
}
|
|
4684
4689
|
this.ctx.selector.xArr = o, this.ctx.selector.yArr = r, this.ctx.emit("setSelector", this.ctx.selector), this.ctx.emit("drawView");
|
|
4685
4690
|
}
|
|
@@ -4687,35 +4692,35 @@ class Te {
|
|
|
4687
4692
|
adjustMergeCells(t, e) {
|
|
4688
4693
|
var w;
|
|
4689
4694
|
const [i, s] = e, [o, r] = t;
|
|
4690
|
-
let a = [],
|
|
4691
|
-
for (let
|
|
4695
|
+
let a = [], l = [];
|
|
4696
|
+
for (let E = 0; E <= e[1] - e[0]; E++)
|
|
4692
4697
|
for (let g = 0; g <= t[1] - t[0]; g++) {
|
|
4693
|
-
const
|
|
4694
|
-
|
|
4698
|
+
const m = E + e[0], y = g + t[0], p = this.ctx.database.getVirtualBodyCell(m, y);
|
|
4699
|
+
p && ((m === i || m === s) && a.push(p), (y === o || y === r) && l.push(p));
|
|
4695
4700
|
}
|
|
4696
|
-
const
|
|
4697
|
-
(
|
|
4698
|
-
const { yArr:
|
|
4699
|
-
return
|
|
4701
|
+
const h = a.reduce(
|
|
4702
|
+
(E, g) => {
|
|
4703
|
+
const { yArr: m } = g.getSpanInfo(), [y, p] = m;
|
|
4704
|
+
return E.minY = Math.min(E.minY, y), E.maxY = Math.max(E.maxY, p), E;
|
|
4700
4705
|
},
|
|
4701
4706
|
{
|
|
4702
4707
|
minY: i,
|
|
4703
4708
|
maxY: s
|
|
4704
4709
|
}
|
|
4705
|
-
), d =
|
|
4706
|
-
(
|
|
4707
|
-
const { xArr:
|
|
4708
|
-
return
|
|
4710
|
+
), d = l.reduce(
|
|
4711
|
+
(E, g) => {
|
|
4712
|
+
const { xArr: m } = g.getSpanInfo(), [y, p] = m;
|
|
4713
|
+
return E.minX = Math.min(E.minX, y), E.maxX = Math.max(E.maxX, p), E;
|
|
4709
4714
|
},
|
|
4710
4715
|
{
|
|
4711
4716
|
minX: o,
|
|
4712
4717
|
maxX: r
|
|
4713
4718
|
}
|
|
4714
|
-
), f = [d.minX, d.maxX], u = [
|
|
4719
|
+
), f = [d.minX, d.maxX], u = [h.minY, h.maxY];
|
|
4715
4720
|
let x = !1;
|
|
4716
|
-
if (d.minX !== d.maxX ||
|
|
4717
|
-
const
|
|
4718
|
-
x = (g && JSON.stringify(g.xArr) + JSON.stringify(g.yArr)) ===
|
|
4721
|
+
if (d.minX !== d.maxX || h.minY !== h.maxY) {
|
|
4722
|
+
const E = JSON.stringify(f) + JSON.stringify(u), g = (w = this.ctx.focusCell) == null ? void 0 : w.getSpanInfo();
|
|
4723
|
+
x = (g && JSON.stringify(g.xArr) + JSON.stringify(g.yArr)) === E;
|
|
4719
4724
|
}
|
|
4720
4725
|
return {
|
|
4721
4726
|
xArr: f,
|
|
@@ -4734,15 +4739,15 @@ class Te {
|
|
|
4734
4739
|
if (this.ctx.mousedown && this.ctx.focusCellHeader) {
|
|
4735
4740
|
const { colIndex: a } = this.ctx.focusCellHeader;
|
|
4736
4741
|
if (this.ctx.clearSelector(), t.colIndex >= a) {
|
|
4737
|
-
const
|
|
4738
|
-
this.setSelector(
|
|
4742
|
+
const l = [a, t.colIndex + t.colspan - 1], h = [o, r];
|
|
4743
|
+
this.setSelector(l, h);
|
|
4739
4744
|
} else {
|
|
4740
|
-
const
|
|
4741
|
-
this.setSelector(
|
|
4745
|
+
const l = [t.colIndex, a], h = [o, r];
|
|
4746
|
+
this.setSelector(l, h);
|
|
4742
4747
|
}
|
|
4743
4748
|
} else {
|
|
4744
|
-
const a = [t.colIndex, t.colIndex + t.colspan - 1],
|
|
4745
|
-
this.setSelector(a,
|
|
4749
|
+
const a = [t.colIndex, t.colIndex + t.colspan - 1], l = [o, r];
|
|
4750
|
+
this.setSelector(a, l);
|
|
4746
4751
|
}
|
|
4747
4752
|
}
|
|
4748
4753
|
selectAll() {
|
|
@@ -4756,8 +4761,8 @@ class Te {
|
|
|
4756
4761
|
SELECTOR_AREA_MIN_Y: o,
|
|
4757
4762
|
SELECTOR_AREA_MAX_Y: r,
|
|
4758
4763
|
SELECTOR_AREA_MAX_X_OFFSET: a,
|
|
4759
|
-
SELECTOR_AREA_MAX_Y_OFFSET:
|
|
4760
|
-
} = this.ctx.config,
|
|
4764
|
+
SELECTOR_AREA_MAX_Y_OFFSET: l
|
|
4765
|
+
} = this.ctx.config, h = i, d = s || this.ctx.maxColIndex - a, f = o, u = r || this.ctx.maxRowIndex - l, x = [h, d], w = [f, u];
|
|
4761
4766
|
this.setSelector(x, w);
|
|
4762
4767
|
}
|
|
4763
4768
|
}
|
|
@@ -4767,17 +4772,17 @@ class Te {
|
|
|
4767
4772
|
const { SELECTOR_AREA_MIN_X: i, SELECTOR_AREA_MAX_X: s, SELECTOR_AREA_MAX_X_OFFSET: o } = this.ctx.config, r = s || this.ctx.maxColIndex - o, a = i;
|
|
4768
4773
|
if (e) {
|
|
4769
4774
|
this.ctx.setFocusCell(t);
|
|
4770
|
-
const
|
|
4771
|
-
this.setSelector(
|
|
4775
|
+
const l = [a, r], h = [t.rowIndex, t.rowIndex];
|
|
4776
|
+
this.setSelector(l, h);
|
|
4772
4777
|
}
|
|
4773
4778
|
if (this.ctx.focusCell && this.ctx.mousedown) {
|
|
4774
|
-
const { rowIndex:
|
|
4775
|
-
if (t.rowIndex >=
|
|
4776
|
-
const
|
|
4777
|
-
this.setSelector(
|
|
4779
|
+
const { rowIndex: l } = this.ctx.focusCell;
|
|
4780
|
+
if (t.rowIndex >= l) {
|
|
4781
|
+
const h = [a, r], d = [l, t.rowIndex];
|
|
4782
|
+
this.setSelector(h, d);
|
|
4778
4783
|
} else {
|
|
4779
|
-
const
|
|
4780
|
-
this.setSelector(
|
|
4784
|
+
const h = [a, r], d = [t.rowIndex, l];
|
|
4785
|
+
this.setSelector(h, d);
|
|
4781
4786
|
}
|
|
4782
4787
|
}
|
|
4783
4788
|
}
|
|
@@ -4786,7 +4791,7 @@ class Te {
|
|
|
4786
4791
|
return;
|
|
4787
4792
|
const { mousedown: t, focusCell: e, hoverCell: i } = this.ctx;
|
|
4788
4793
|
if (t && e && i) {
|
|
4789
|
-
const { rowIndex: s, colIndex: o } = e, r = Math.min(i.colIndex, o), a = Math.max(i.colIndex, o),
|
|
4794
|
+
const { rowIndex: s, colIndex: o } = e, r = Math.min(i.colIndex, o), a = Math.max(i.colIndex, o), l = Math.min(i.rowIndex, s), h = Math.max(i.rowIndex, s), d = [r, a], f = [l, h];
|
|
4790
4795
|
this.setSelector(d, f);
|
|
4791
4796
|
}
|
|
4792
4797
|
}
|
|
@@ -4796,7 +4801,7 @@ class Te {
|
|
|
4796
4801
|
if (this.ctx.selector.enable = !0, i && t) {
|
|
4797
4802
|
if (this.ctx.config.ENABLE_SELECTOR_SINGLE)
|
|
4798
4803
|
return;
|
|
4799
|
-
const { colIndex: s, rowIndex: o } = i, { colIndex: r, rowIndex: a } = e,
|
|
4804
|
+
const { colIndex: s, rowIndex: o } = i, { colIndex: r, rowIndex: a } = e, l = Math.min(r, s), h = Math.max(r, s), d = Math.min(a, o), f = Math.max(a, o), u = [l, h], x = [d, f];
|
|
4800
4805
|
this.setSelector(u, x);
|
|
4801
4806
|
} else {
|
|
4802
4807
|
this.ctx.emit("cellSelectedClick", e);
|
|
@@ -4849,7 +4854,7 @@ class Te {
|
|
|
4849
4854
|
return;
|
|
4850
4855
|
t = a.data;
|
|
4851
4856
|
}
|
|
4852
|
-
const o =
|
|
4857
|
+
const o = ce(t);
|
|
4853
4858
|
navigator.clipboard ? navigator.clipboard.writeText(o).then(() => {
|
|
4854
4859
|
this.ctx.selector.xArrCopy = this.ctx.selector.xArr.slice(), this.ctx.selector.yArrCopy = this.ctx.selector.yArr.slice(), this.ctx.emit("copyChange", {
|
|
4855
4860
|
xArr: this.ctx.selector.xArrCopy,
|
|
@@ -4861,9 +4866,9 @@ class Te {
|
|
|
4861
4866
|
clearSelectedData(t, e, i = !1, s = null) {
|
|
4862
4867
|
let o = [];
|
|
4863
4868
|
const r = /* @__PURE__ */ new Set();
|
|
4864
|
-
for (let
|
|
4865
|
-
for (let
|
|
4866
|
-
const d =
|
|
4869
|
+
for (let l = 0; l <= e[1] - e[0]; l++)
|
|
4870
|
+
for (let h = 0; h <= t[1] - t[0]; h++) {
|
|
4871
|
+
const d = l + e[0], f = h + t[0], u = this.ctx.database.getItemValueForRowIndexAndColIndex(d, f);
|
|
4867
4872
|
if (u) {
|
|
4868
4873
|
const { rowKey: x, key: w } = u;
|
|
4869
4874
|
this.ctx.database.getReadonly(x, w) || (r.add(x), o.push({
|
|
@@ -4881,8 +4886,8 @@ class Te {
|
|
|
4881
4886
|
return o;
|
|
4882
4887
|
this.ctx.database.batchSetItemValue(o, !0);
|
|
4883
4888
|
let a = [];
|
|
4884
|
-
return r.forEach((
|
|
4885
|
-
a.push(this.ctx.database.getRowDataItemForRowKey(
|
|
4889
|
+
return r.forEach((l) => {
|
|
4890
|
+
a.push(this.ctx.database.getRowDataItemForRowKey(l));
|
|
4886
4891
|
}), this.ctx.emit("clearSelectedDataChange", o, a), o;
|
|
4887
4892
|
}
|
|
4888
4893
|
paste() {
|
|
@@ -4895,39 +4900,39 @@ class Te {
|
|
|
4895
4900
|
const e = this.ctx.selector.yArr[0], i = this.ctx.selector.xArr[0], s = /* @__PURE__ */ new Set();
|
|
4896
4901
|
navigator.clipboard.readText().then(async (o) => {
|
|
4897
4902
|
let r = he(o);
|
|
4898
|
-
const a = [i, i + r[0].length - 1],
|
|
4903
|
+
const a = [i, i + r[0].length - 1], l = [e, e + r.length - 1], [h, d] = l, [f, u] = a, x = d - this.ctx.maxRowIndex, w = u - this.ctx.maxColIndex;
|
|
4899
4904
|
(x > 0 || w > 0) && this.ctx.emit("onPastedDataOverflow", {
|
|
4900
4905
|
maxY: d,
|
|
4901
4906
|
maxX: u,
|
|
4902
|
-
minY:
|
|
4907
|
+
minY: h,
|
|
4903
4908
|
minX: f,
|
|
4904
4909
|
overflowRowCount: x,
|
|
4905
4910
|
overflowColCount: w,
|
|
4906
4911
|
textArr: r
|
|
4907
4912
|
});
|
|
4908
|
-
const
|
|
4909
|
-
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(a,
|
|
4910
|
-
const
|
|
4913
|
+
const E = r.length === 1 && r[0].length === 1;
|
|
4914
|
+
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(a, l) && !E) {
|
|
4915
|
+
const p = {
|
|
4911
4916
|
code: "ERR_MERGED_CELLS_PASTE",
|
|
4912
4917
|
message: "Merged cells cannot span paste data"
|
|
4913
4918
|
};
|
|
4914
|
-
this.ctx.hasEvent("error") ? this.ctx.emit("error",
|
|
4919
|
+
this.ctx.hasEvent("error") ? this.ctx.emit("error", p) : alert(p.message);
|
|
4915
4920
|
return;
|
|
4916
4921
|
}
|
|
4917
4922
|
let g = [];
|
|
4918
|
-
for (let
|
|
4919
|
-
const R = r[
|
|
4923
|
+
for (let p = 0; p <= r.length - 1; p++) {
|
|
4924
|
+
const R = r[p].length;
|
|
4920
4925
|
for (let C = 0; C <= R - 1; C++) {
|
|
4921
|
-
const I =
|
|
4926
|
+
const I = p + e, _ = C + i, v = r[p][C], S = this.ctx.database.getItemValueForRowIndexAndColIndex(
|
|
4922
4927
|
I,
|
|
4923
|
-
|
|
4928
|
+
_
|
|
4924
4929
|
);
|
|
4925
|
-
if (
|
|
4926
|
-
const { rowKey: b, key: O } =
|
|
4930
|
+
if (S) {
|
|
4931
|
+
const { rowKey: b, key: O } = S;
|
|
4927
4932
|
this.ctx.database.getReadonly(b, O) || (s.add(b), g.push({
|
|
4928
4933
|
rowKey: b,
|
|
4929
4934
|
key: O,
|
|
4930
|
-
value:
|
|
4935
|
+
value: v,
|
|
4931
4936
|
row: {}
|
|
4932
4937
|
//内部有设置
|
|
4933
4938
|
}));
|
|
@@ -4935,34 +4940,34 @@ class Te {
|
|
|
4935
4940
|
}
|
|
4936
4941
|
}
|
|
4937
4942
|
if (this.isCut) {
|
|
4938
|
-
const
|
|
4943
|
+
const p = this.clearSelectedData(
|
|
4939
4944
|
this.ctx.selector.xArrCopy,
|
|
4940
4945
|
this.ctx.selector.yArrCopy,
|
|
4941
4946
|
!0
|
|
4942
4947
|
// 忽略设置,只返回数据,用于cut,实现历史回退需要返回两次问题
|
|
4943
4948
|
), R = g.map((C) => `${C.rowKey}-${C.key}`);
|
|
4944
|
-
|
|
4949
|
+
p.forEach((C) => {
|
|
4945
4950
|
R.includes(`${C.rowKey}-${C.key}`) || g.unshift(C);
|
|
4946
4951
|
}), this.isCut = !1;
|
|
4947
4952
|
}
|
|
4948
4953
|
if (!g.length)
|
|
4949
4954
|
return;
|
|
4950
|
-
const { BEFORE_PASTE_DATA_METHOD:
|
|
4951
|
-
if (typeof
|
|
4952
|
-
const
|
|
4955
|
+
const { BEFORE_PASTE_DATA_METHOD: m } = this.ctx.config;
|
|
4956
|
+
if (typeof m == "function") {
|
|
4957
|
+
const p = m, R = g.map((C) => ({
|
|
4953
4958
|
rowKey: C.rowKey,
|
|
4954
4959
|
key: C.key,
|
|
4955
4960
|
value: C.value,
|
|
4956
4961
|
oldValue: this.ctx.database.getItemValue(C.rowKey, C.key),
|
|
4957
4962
|
row: this.ctx.database.getRowDataItemForRowKey(C.rowKey)
|
|
4958
4963
|
}));
|
|
4959
|
-
if (g = await
|
|
4964
|
+
if (g = await p(R, a, l, r), g && !g.length)
|
|
4960
4965
|
return;
|
|
4961
4966
|
}
|
|
4962
4967
|
this.clearCopyLine(), this.ctx.batchSetItemValueByEditor(g, !0);
|
|
4963
4968
|
let y = [];
|
|
4964
|
-
s.forEach((
|
|
4965
|
-
y.push(this.ctx.database.getRowDataItemForRowKey(
|
|
4969
|
+
s.forEach((p) => {
|
|
4970
|
+
y.push(this.ctx.database.getRowDataItemForRowKey(p));
|
|
4966
4971
|
}), this.ctx.emit("pasteChange", g, y), this.ctx.emit("draw");
|
|
4967
4972
|
}).catch((o) => {
|
|
4968
4973
|
console.error("Failed to get the clipboard content:", o);
|
|
@@ -4979,7 +4984,7 @@ class Te {
|
|
|
4979
4984
|
if (!e)
|
|
4980
4985
|
return;
|
|
4981
4986
|
let { colIndex: i = 0, rowIndex: s = 0 } = e;
|
|
4982
|
-
const o = 0, r = 0, a = this.ctx.maxColIndex,
|
|
4987
|
+
const o = 0, r = 0, a = this.ctx.maxColIndex, l = this.ctx.maxRowIndex;
|
|
4983
4988
|
switch (t) {
|
|
4984
4989
|
case "LEFT":
|
|
4985
4990
|
i > o && i--;
|
|
@@ -4991,11 +4996,11 @@ class Te {
|
|
|
4991
4996
|
i < a && i++;
|
|
4992
4997
|
break;
|
|
4993
4998
|
case "BOTTOM":
|
|
4994
|
-
s <
|
|
4999
|
+
s < l && s++;
|
|
4995
5000
|
break;
|
|
4996
5001
|
}
|
|
4997
|
-
const
|
|
4998
|
-
f && (f.operation || this.isInSettingRange(f.rowIndex, f.colIndex) && (this.ctx.setFocusCell(f), this.setSelector(
|
|
5002
|
+
const h = [i, i], d = [s, s], f = this.getCell(s, i);
|
|
5003
|
+
f && (f.operation || this.isInSettingRange(f.rowIndex, f.colIndex) && (this.ctx.setFocusCell(f), this.setSelector(h, d), this.adjustBoundaryPosition(), this.ctx.emit("moveFocus", f), this.ctx.emit("draw")));
|
|
4999
5004
|
}
|
|
5000
5005
|
stopAdjustPosition() {
|
|
5001
5006
|
this.adjustPositionX = "", this.adjustPositionY = "", this.timerX && (clearInterval(this.timerX), this.timerX = 0), this.timerY && (clearInterval(this.timerY), this.timerY = 0);
|
|
@@ -5008,9 +5013,9 @@ class Te {
|
|
|
5008
5013
|
SELECTOR_AREA_MIN_Y: o,
|
|
5009
5014
|
SELECTOR_AREA_MAX_Y: r,
|
|
5010
5015
|
SELECTOR_AREA_MAX_X_OFFSET: a,
|
|
5011
|
-
SELECTOR_AREA_MAX_Y_OFFSET:
|
|
5012
|
-
} = this.ctx.config,
|
|
5013
|
-
return !(e <
|
|
5016
|
+
SELECTOR_AREA_MAX_Y_OFFSET: l
|
|
5017
|
+
} = this.ctx.config, h = i, d = s || this.ctx.maxColIndex - a, f = o, u = r || this.ctx.maxRowIndex - l;
|
|
5018
|
+
return !(e < h || e > d || t < f || t > u);
|
|
5014
5019
|
}
|
|
5015
5020
|
/**
|
|
5016
5021
|
* 调整滚动条位置,让到达边界时自动滚动
|
|
@@ -5023,8 +5028,8 @@ class Te {
|
|
|
5023
5028
|
let a = 10 * (s === "left" ? -1 : 1);
|
|
5024
5029
|
this.timerX && (clearInterval(this.timerX), this.timerX = 0), this.timerX = setInterval(() => {
|
|
5025
5030
|
a *= 1.5;
|
|
5026
|
-
const { scrollX:
|
|
5027
|
-
(
|
|
5031
|
+
const { scrollX: l } = this.ctx, h = l + a;
|
|
5032
|
+
(h < 0 || h > this.ctx.body.width) && (clearInterval(this.timerX), this.timerX = 0), this.ctx.setScrollX(h);
|
|
5028
5033
|
}, 100);
|
|
5029
5034
|
}
|
|
5030
5035
|
if (o && this.adjustPositionY !== o) {
|
|
@@ -5032,8 +5037,8 @@ class Te {
|
|
|
5032
5037
|
let a = 10 * (o === "top" ? -1 : 1);
|
|
5033
5038
|
this.timerY && (clearInterval(this.timerY), this.timerY = 0), this.timerY = setInterval(() => {
|
|
5034
5039
|
a *= 1.5;
|
|
5035
|
-
const { scrollY:
|
|
5036
|
-
(
|
|
5040
|
+
const { scrollY: l } = this.ctx, h = l + a;
|
|
5041
|
+
(h < 0 || h > this.ctx.body.height) && (clearInterval(this.timerY), this.timerY = 0), this.ctx.setScrollY(h);
|
|
5037
5042
|
}, 100);
|
|
5038
5043
|
}
|
|
5039
5044
|
}
|
|
@@ -5049,28 +5054,28 @@ class Te {
|
|
|
5049
5054
|
fixedLeftWidth: o,
|
|
5050
5055
|
header: r,
|
|
5051
5056
|
footer: a,
|
|
5052
|
-
body:
|
|
5053
|
-
scrollX:
|
|
5057
|
+
body: l,
|
|
5058
|
+
scrollX: h,
|
|
5054
5059
|
scrollY: d,
|
|
5055
5060
|
config: { SCROLLER_TRACK_SIZE: f, FOOTER_FIXED: u, FOOTER_POSITION: x, ENABLE_MERGE_CELL_LINK: w }
|
|
5056
5061
|
} = this.ctx;
|
|
5057
5062
|
if (!i)
|
|
5058
5063
|
return;
|
|
5059
5064
|
w && this.ctx.onlyMergeCell && i.updateSpanInfo();
|
|
5060
|
-
const { drawX:
|
|
5061
|
-
let I = r.height - g,
|
|
5062
|
-
|
|
5063
|
-
let
|
|
5064
|
-
u && (x === "top" ? I = r.height + a.height - g :
|
|
5065
|
-
const
|
|
5066
|
-
let b =
|
|
5067
|
-
C > 0 && !
|
|
5065
|
+
const { drawX: E, drawY: g, width: m, height: y, fixed: p } = i, R = o - E + 1, C = i.drawX + m - (e - s) + 1;
|
|
5066
|
+
let I = r.height - g, _ = y;
|
|
5067
|
+
_ > l.visibleHeight && (_ = l.visibleHeight);
|
|
5068
|
+
let v = 0;
|
|
5069
|
+
u && (x === "top" ? I = r.height + a.height - g : v = a.visibleHeight);
|
|
5070
|
+
const S = g + _ - (t - v - f);
|
|
5071
|
+
let b = h, O = d;
|
|
5072
|
+
C > 0 && !p ? b = Math.floor(h + C) : R > 0 && !p && (b = Math.floor(h - R)), I > 0 ? O = Math.floor(d - I) : S > 0 && (O = Math.floor(d + S)), (Math.abs(h - b) > 2 || Math.abs(d - O) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.setScroll(b, O), this.ctx.emit("adjustBoundaryPosition", i));
|
|
5068
5073
|
}
|
|
5069
5074
|
destroy() {
|
|
5070
5075
|
this.timerX && (clearTimeout(this.timerX), this.timerX = 0), this.timerY && (clearTimeout(this.timerY), this.timerY = 0);
|
|
5071
5076
|
}
|
|
5072
5077
|
}
|
|
5073
|
-
class
|
|
5078
|
+
class Le {
|
|
5074
5079
|
constructor(t) {
|
|
5075
5080
|
n(this, "ctx");
|
|
5076
5081
|
n(this, "maxColRowCell");
|
|
@@ -5080,7 +5085,7 @@ class Oe {
|
|
|
5080
5085
|
this.ctx.on("mousemove", (t) => {
|
|
5081
5086
|
if (this.ctx.stageElement.style.cursor === "crosshair" && (this.ctx.stageElement.style.cursor = "default"), this.ctx.editing || !this.ctx.focusCell || !this.maxColRowCell)
|
|
5082
5087
|
return;
|
|
5083
|
-
const { offsetX: e, offsetY: i } = this.ctx.getOffset(t), { colIndex: s, rowIndex: o, drawX: r, drawY: a, width:
|
|
5088
|
+
const { offsetX: e, offsetY: i } = this.ctx.getOffset(t), { colIndex: s, rowIndex: o, drawX: r, drawY: a, width: l, height: h } = this.maxColRowCell, d = 6, f = s === this.ctx.maxColIndex || o === this.ctx.maxRowIndex ? 0 : 2, u = r + l - d + f, x = a + h - d + f;
|
|
5084
5089
|
e > u && i > x && e < u + d && i < x + d && (this.ctx.stageElement.style.cursor = "crosshair");
|
|
5085
5090
|
}), this.ctx.on("cellMouseenter", (t) => {
|
|
5086
5091
|
const { xArr: e, yArr: i } = this.ctx.selector, s = e[1], o = i[1], { colIndex: r, rowIndex: a } = t;
|
|
@@ -5113,36 +5118,36 @@ class Oe {
|
|
|
5113
5118
|
return;
|
|
5114
5119
|
let r = t, a = e;
|
|
5115
5120
|
if (!o) {
|
|
5116
|
-
const [
|
|
5117
|
-
a = [
|
|
5121
|
+
const [l] = a;
|
|
5122
|
+
a = [l, l];
|
|
5118
5123
|
}
|
|
5119
5124
|
if (!s) {
|
|
5120
|
-
const [
|
|
5121
|
-
r = [
|
|
5125
|
+
const [l] = r;
|
|
5126
|
+
r = [l, l];
|
|
5122
5127
|
}
|
|
5123
5128
|
if (JSON.stringify(this.ctx.autofill.xArr) !== JSON.stringify(r) || JSON.stringify(this.ctx.autofill.yArr) !== JSON.stringify(a)) {
|
|
5124
5129
|
const {
|
|
5125
|
-
SELECTOR_AREA_MIN_X:
|
|
5126
|
-
SELECTOR_AREA_MAX_X:
|
|
5130
|
+
SELECTOR_AREA_MIN_X: l,
|
|
5131
|
+
SELECTOR_AREA_MAX_X: h,
|
|
5127
5132
|
SELECTOR_AREA_MIN_Y: d,
|
|
5128
5133
|
SELECTOR_AREA_MAX_Y: f,
|
|
5129
5134
|
SELECTOR_AREA_MAX_X_OFFSET: u,
|
|
5130
5135
|
SELECTOR_AREA_MAX_Y_OFFSET: x
|
|
5131
|
-
} = this.ctx.config, w =
|
|
5132
|
-
let [y,
|
|
5136
|
+
} = this.ctx.config, w = l, E = h || this.ctx.maxColIndex - u, g = d, m = f || this.ctx.maxRowIndex - x;
|
|
5137
|
+
let [y, p] = r, [R, C] = a;
|
|
5133
5138
|
if (y < w || R < g)
|
|
5134
5139
|
return;
|
|
5135
|
-
r = [Math.max(w, y), Math.min(
|
|
5140
|
+
r = [Math.max(w, y), Math.min(E, p)], a = [Math.max(g, R), Math.min(m, C)];
|
|
5136
5141
|
const { BEFORE_SET_AUTOFILL_METHOD: I } = this.ctx.config;
|
|
5137
5142
|
if (typeof I == "function") {
|
|
5138
|
-
const
|
|
5143
|
+
const v = I({
|
|
5139
5144
|
focusCell: this.ctx.focusCell,
|
|
5140
5145
|
xArr: r,
|
|
5141
5146
|
yArr: a
|
|
5142
5147
|
});
|
|
5143
|
-
if (!
|
|
5148
|
+
if (!v)
|
|
5144
5149
|
return;
|
|
5145
|
-
r =
|
|
5150
|
+
r = v.xArr, a = v.yArr;
|
|
5146
5151
|
}
|
|
5147
5152
|
this.ctx.autofill.xArr = r, this.ctx.autofill.yArr = a, this.ctx.emit("setAutofill", this.ctx.autofill), this.ctx.emit("draw");
|
|
5148
5153
|
}
|
|
@@ -5154,11 +5159,11 @@ class Oe {
|
|
|
5154
5159
|
const t = /* @__PURE__ */ new Set(), e = this.ctx.getSelectedData(), i = /* @__PURE__ */ new Map();
|
|
5155
5160
|
for (let x = 0; x <= e.yArr[1] - e.yArr[0]; x++)
|
|
5156
5161
|
for (let w = 0; w <= e.xArr[1] - e.xArr[0]; w++) {
|
|
5157
|
-
const
|
|
5158
|
-
i.set(`${
|
|
5162
|
+
const E = x + e.yArr[0], g = w + e.xArr[0];
|
|
5163
|
+
i.set(`${E}-${g}`, !0);
|
|
5159
5164
|
}
|
|
5160
|
-
const { value: s } = e, o = s[0].length, r = s.length, a = this.ctx.autofill.xArr,
|
|
5161
|
-
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(a,
|
|
5165
|
+
const { value: s } = e, o = s[0].length, r = s.length, a = this.ctx.autofill.xArr, l = this.ctx.autofill.yArr, h = o === 1 && r === 1;
|
|
5166
|
+
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(a, l) && !h) {
|
|
5162
5167
|
const x = {
|
|
5163
5168
|
code: "ERR_MERGED_CELLS_AUTOFILL",
|
|
5164
5169
|
message: "Merged cells cannot span autofill data"
|
|
@@ -5167,15 +5172,15 @@ class Oe {
|
|
|
5167
5172
|
return;
|
|
5168
5173
|
}
|
|
5169
5174
|
let d = [];
|
|
5170
|
-
for (let x = 0; x <=
|
|
5175
|
+
for (let x = 0; x <= l[1] - l[0]; x++)
|
|
5171
5176
|
for (let w = 0; w <= a[1] - a[0]; w++) {
|
|
5172
|
-
const
|
|
5173
|
-
if (y && !i.has(
|
|
5177
|
+
const E = w + a[0], g = x + l[0], m = s[x % r][w % o], y = this.ctx.database.getItemValueForRowIndexAndColIndex(g, E), p = `${g}-${E}`;
|
|
5178
|
+
if (y && !i.has(p)) {
|
|
5174
5179
|
const { rowKey: R, key: C } = y;
|
|
5175
5180
|
this.ctx.database.getReadonly(R, C) || (t.add(R), d.push({
|
|
5176
5181
|
rowKey: R,
|
|
5177
5182
|
key: C,
|
|
5178
|
-
value:
|
|
5183
|
+
value: m,
|
|
5179
5184
|
row: {}
|
|
5180
5185
|
}));
|
|
5181
5186
|
}
|
|
@@ -5185,14 +5190,14 @@ class Oe {
|
|
|
5185
5190
|
this.ctx.selector.xArr = this.ctx.autofill.xArr, this.ctx.selector.yArr = this.ctx.autofill.yArr;
|
|
5186
5191
|
const { BEFORE_AUTOFILL_DATA_METHOD: f } = this.ctx.config;
|
|
5187
5192
|
if (typeof f == "function") {
|
|
5188
|
-
const x = f, w = d.map((
|
|
5189
|
-
rowKey:
|
|
5190
|
-
key:
|
|
5191
|
-
value:
|
|
5192
|
-
oldValue: this.ctx.database.getItemValue(
|
|
5193
|
-
row: this.ctx.database.getRowDataItemForRowKey(
|
|
5193
|
+
const x = f, w = d.map((E) => ({
|
|
5194
|
+
rowKey: E.rowKey,
|
|
5195
|
+
key: E.key,
|
|
5196
|
+
value: E.value,
|
|
5197
|
+
oldValue: this.ctx.database.getItemValue(E.rowKey, E.key),
|
|
5198
|
+
row: this.ctx.database.getRowDataItemForRowKey(E.rowKey)
|
|
5194
5199
|
}));
|
|
5195
|
-
if (d = await x(w, a,
|
|
5200
|
+
if (d = await x(w, a, l), d && !d.length)
|
|
5196
5201
|
return;
|
|
5197
5202
|
}
|
|
5198
5203
|
this.ctx.batchSetItemValueByEditor(d, !0);
|
|
@@ -5213,20 +5218,20 @@ class Oe {
|
|
|
5213
5218
|
destroy() {
|
|
5214
5219
|
}
|
|
5215
5220
|
}
|
|
5216
|
-
const
|
|
5221
|
+
const q = Math.min, $ = Math.max, st = Math.round, B = (c) => ({
|
|
5217
5222
|
x: c,
|
|
5218
5223
|
y: c
|
|
5219
|
-
}),
|
|
5224
|
+
}), Me = {
|
|
5220
5225
|
left: "right",
|
|
5221
5226
|
right: "left",
|
|
5222
5227
|
bottom: "top",
|
|
5223
5228
|
top: "bottom"
|
|
5224
|
-
},
|
|
5229
|
+
}, Ae = {
|
|
5225
5230
|
start: "end",
|
|
5226
5231
|
end: "start"
|
|
5227
5232
|
};
|
|
5228
5233
|
function dt(c, t, e) {
|
|
5229
|
-
return $(c,
|
|
5234
|
+
return $(c, q(t, e));
|
|
5230
5235
|
}
|
|
5231
5236
|
function Q(c, t) {
|
|
5232
5237
|
return typeof c == "function" ? c(t) : c;
|
|
@@ -5237,54 +5242,54 @@ function z(c) {
|
|
|
5237
5242
|
function tt(c) {
|
|
5238
5243
|
return c.split("-")[1];
|
|
5239
5244
|
}
|
|
5240
|
-
function
|
|
5245
|
+
function Wt(c) {
|
|
5241
5246
|
return c === "x" ? "y" : "x";
|
|
5242
5247
|
}
|
|
5243
5248
|
function wt(c) {
|
|
5244
5249
|
return c === "y" ? "height" : "width";
|
|
5245
5250
|
}
|
|
5246
|
-
const
|
|
5251
|
+
const He = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
5247
5252
|
function V(c) {
|
|
5248
|
-
return
|
|
5253
|
+
return He.has(z(c)) ? "y" : "x";
|
|
5249
5254
|
}
|
|
5250
|
-
function
|
|
5251
|
-
return
|
|
5255
|
+
function Et(c) {
|
|
5256
|
+
return Wt(V(c));
|
|
5252
5257
|
}
|
|
5253
|
-
function
|
|
5258
|
+
function De(c, t, e) {
|
|
5254
5259
|
e === void 0 && (e = !1);
|
|
5255
|
-
const i = tt(c), s =
|
|
5260
|
+
const i = tt(c), s = Et(c), o = wt(s);
|
|
5256
5261
|
let r = s === "x" ? i === (e ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
|
|
5257
5262
|
return t.reference[o] > t.floating[o] && (r = ot(r)), [r, ot(r)];
|
|
5258
5263
|
}
|
|
5259
|
-
function
|
|
5264
|
+
function Ne(c) {
|
|
5260
5265
|
const t = ot(c);
|
|
5261
5266
|
return [ft(c), t, ft(t)];
|
|
5262
5267
|
}
|
|
5263
5268
|
function ft(c) {
|
|
5264
|
-
return c.replace(/start|end/g, (t) =>
|
|
5269
|
+
return c.replace(/start|end/g, (t) => Ae[t]);
|
|
5265
5270
|
}
|
|
5266
|
-
const
|
|
5267
|
-
function
|
|
5271
|
+
const Tt = ["left", "right"], Ot = ["right", "left"], ke = ["top", "bottom"], Xe = ["bottom", "top"];
|
|
5272
|
+
function Ye(c, t, e) {
|
|
5268
5273
|
switch (c) {
|
|
5269
5274
|
case "top":
|
|
5270
5275
|
case "bottom":
|
|
5271
|
-
return e ? t ?
|
|
5276
|
+
return e ? t ? Ot : Tt : t ? Tt : Ot;
|
|
5272
5277
|
case "left":
|
|
5273
5278
|
case "right":
|
|
5274
|
-
return t ?
|
|
5279
|
+
return t ? ke : Xe;
|
|
5275
5280
|
default:
|
|
5276
5281
|
return [];
|
|
5277
5282
|
}
|
|
5278
5283
|
}
|
|
5279
|
-
function
|
|
5284
|
+
function Be(c, t, e, i) {
|
|
5280
5285
|
const s = tt(c);
|
|
5281
|
-
let o =
|
|
5286
|
+
let o = Ye(z(c), e === "start", i);
|
|
5282
5287
|
return s && (o = o.map((r) => r + "-" + s), t && (o = o.concat(o.map(ft)))), o;
|
|
5283
5288
|
}
|
|
5284
5289
|
function ot(c) {
|
|
5285
|
-
return c.replace(/left|right|bottom|top/g, (t) =>
|
|
5290
|
+
return c.replace(/left|right|bottom|top/g, (t) => Me[t]);
|
|
5286
5291
|
}
|
|
5287
|
-
function
|
|
5292
|
+
function Ke(c) {
|
|
5288
5293
|
return {
|
|
5289
5294
|
top: 0,
|
|
5290
5295
|
right: 0,
|
|
@@ -5293,8 +5298,8 @@ function Be(c) {
|
|
|
5293
5298
|
...c
|
|
5294
5299
|
};
|
|
5295
5300
|
}
|
|
5296
|
-
function
|
|
5297
|
-
return typeof c != "number" ?
|
|
5301
|
+
function Ft(c) {
|
|
5302
|
+
return typeof c != "number" ? Ke(c) : {
|
|
5298
5303
|
top: c,
|
|
5299
5304
|
right: c,
|
|
5300
5305
|
bottom: c,
|
|
@@ -5319,14 +5324,14 @@ function rt(c) {
|
|
|
5319
5324
|
y: e
|
|
5320
5325
|
};
|
|
5321
5326
|
}
|
|
5322
|
-
function
|
|
5327
|
+
function Lt(c, t, e) {
|
|
5323
5328
|
let {
|
|
5324
5329
|
reference: i,
|
|
5325
5330
|
floating: s
|
|
5326
5331
|
} = c;
|
|
5327
|
-
const o = V(t), r =
|
|
5332
|
+
const o = V(t), r = Et(t), a = wt(r), l = z(t), h = o === "y", d = i.x + i.width / 2 - s.width / 2, f = i.y + i.height / 2 - s.height / 2, u = i[a] / 2 - s[a] / 2;
|
|
5328
5333
|
let x;
|
|
5329
|
-
switch (
|
|
5334
|
+
switch (l) {
|
|
5330
5335
|
case "top":
|
|
5331
5336
|
x = {
|
|
5332
5337
|
x: d,
|
|
@@ -5359,66 +5364,66 @@ function Ot(c, t, e) {
|
|
|
5359
5364
|
}
|
|
5360
5365
|
switch (tt(t)) {
|
|
5361
5366
|
case "start":
|
|
5362
|
-
x[r] -= u * (e &&
|
|
5367
|
+
x[r] -= u * (e && h ? -1 : 1);
|
|
5363
5368
|
break;
|
|
5364
5369
|
case "end":
|
|
5365
|
-
x[r] += u * (e &&
|
|
5370
|
+
x[r] += u * (e && h ? -1 : 1);
|
|
5366
5371
|
break;
|
|
5367
5372
|
}
|
|
5368
5373
|
return x;
|
|
5369
5374
|
}
|
|
5370
|
-
const
|
|
5375
|
+
const We = async (c, t, e) => {
|
|
5371
5376
|
const {
|
|
5372
5377
|
placement: i = "bottom",
|
|
5373
5378
|
strategy: s = "absolute",
|
|
5374
5379
|
middleware: o = [],
|
|
5375
5380
|
platform: r
|
|
5376
|
-
} = e, a = o.filter(Boolean),
|
|
5377
|
-
let
|
|
5381
|
+
} = e, a = o.filter(Boolean), l = await (r.isRTL == null ? void 0 : r.isRTL(t));
|
|
5382
|
+
let h = await r.getElementRects({
|
|
5378
5383
|
reference: c,
|
|
5379
5384
|
floating: t,
|
|
5380
5385
|
strategy: s
|
|
5381
5386
|
}), {
|
|
5382
5387
|
x: d,
|
|
5383
5388
|
y: f
|
|
5384
|
-
} =
|
|
5385
|
-
for (let
|
|
5389
|
+
} = Lt(h, i, l), u = i, x = {}, w = 0;
|
|
5390
|
+
for (let E = 0; E < a.length; E++) {
|
|
5386
5391
|
const {
|
|
5387
5392
|
name: g,
|
|
5388
|
-
fn:
|
|
5389
|
-
} = a[
|
|
5393
|
+
fn: m
|
|
5394
|
+
} = a[E], {
|
|
5390
5395
|
x: y,
|
|
5391
|
-
y:
|
|
5396
|
+
y: p,
|
|
5392
5397
|
data: R,
|
|
5393
5398
|
reset: C
|
|
5394
|
-
} = await
|
|
5399
|
+
} = await m({
|
|
5395
5400
|
x: d,
|
|
5396
5401
|
y: f,
|
|
5397
5402
|
initialPlacement: i,
|
|
5398
5403
|
placement: u,
|
|
5399
5404
|
strategy: s,
|
|
5400
5405
|
middlewareData: x,
|
|
5401
|
-
rects:
|
|
5406
|
+
rects: h,
|
|
5402
5407
|
platform: r,
|
|
5403
5408
|
elements: {
|
|
5404
5409
|
reference: c,
|
|
5405
5410
|
floating: t
|
|
5406
5411
|
}
|
|
5407
5412
|
});
|
|
5408
|
-
d = y ?? d, f =
|
|
5413
|
+
d = y ?? d, f = p ?? f, x = {
|
|
5409
5414
|
...x,
|
|
5410
5415
|
[g]: {
|
|
5411
5416
|
...x[g],
|
|
5412
5417
|
...R
|
|
5413
5418
|
}
|
|
5414
|
-
}, C && w <= 50 && (w++, typeof C == "object" && (C.placement && (u = C.placement), C.rects && (
|
|
5419
|
+
}, C && w <= 50 && (w++, typeof C == "object" && (C.placement && (u = C.placement), C.rects && (h = C.rects === !0 ? await r.getElementRects({
|
|
5415
5420
|
reference: c,
|
|
5416
5421
|
floating: t,
|
|
5417
5422
|
strategy: s
|
|
5418
5423
|
}) : C.rects), {
|
|
5419
5424
|
x: d,
|
|
5420
5425
|
y: f
|
|
5421
|
-
} =
|
|
5426
|
+
} = Lt(h, u, l)), E = -1);
|
|
5422
5427
|
}
|
|
5423
5428
|
return {
|
|
5424
5429
|
x: d,
|
|
@@ -5428,7 +5433,7 @@ const Ke = async (c, t, e) => {
|
|
|
5428
5433
|
middlewareData: x
|
|
5429
5434
|
};
|
|
5430
5435
|
};
|
|
5431
|
-
async function
|
|
5436
|
+
async function Vt(c, t) {
|
|
5432
5437
|
var e;
|
|
5433
5438
|
t === void 0 && (t = {});
|
|
5434
5439
|
const {
|
|
@@ -5437,24 +5442,24 @@ async function Ft(c, t) {
|
|
|
5437
5442
|
platform: o,
|
|
5438
5443
|
rects: r,
|
|
5439
5444
|
elements: a,
|
|
5440
|
-
strategy:
|
|
5445
|
+
strategy: l
|
|
5441
5446
|
} = c, {
|
|
5442
|
-
boundary:
|
|
5447
|
+
boundary: h = "clippingAncestors",
|
|
5443
5448
|
rootBoundary: d = "viewport",
|
|
5444
5449
|
elementContext: f = "floating",
|
|
5445
5450
|
altBoundary: u = !1,
|
|
5446
5451
|
padding: x = 0
|
|
5447
|
-
} = Q(t, c), w =
|
|
5452
|
+
} = Q(t, c), w = Ft(x), g = a[u ? f === "floating" ? "reference" : "floating" : f], m = rt(await o.getClippingRect({
|
|
5448
5453
|
element: (e = await (o.isElement == null ? void 0 : o.isElement(g))) == null || e ? g : g.contextElement || await (o.getDocumentElement == null ? void 0 : o.getDocumentElement(a.floating)),
|
|
5449
|
-
boundary:
|
|
5454
|
+
boundary: h,
|
|
5450
5455
|
rootBoundary: d,
|
|
5451
|
-
strategy:
|
|
5456
|
+
strategy: l
|
|
5452
5457
|
})), y = f === "floating" ? {
|
|
5453
5458
|
x: i,
|
|
5454
5459
|
y: s,
|
|
5455
5460
|
width: r.floating.width,
|
|
5456
5461
|
height: r.floating.height
|
|
5457
|
-
} : r.reference,
|
|
5462
|
+
} : r.reference, p = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(a.floating)), R = await (o.isElement == null ? void 0 : o.isElement(p)) ? await (o.getScale == null ? void 0 : o.getScale(p)) || {
|
|
5458
5463
|
x: 1,
|
|
5459
5464
|
y: 1
|
|
5460
5465
|
} : {
|
|
@@ -5463,17 +5468,17 @@ async function Ft(c, t) {
|
|
|
5463
5468
|
}, C = rt(o.convertOffsetParentRelativeRectToViewportRelativeRect ? await o.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
5464
5469
|
elements: a,
|
|
5465
5470
|
rect: y,
|
|
5466
|
-
offsetParent:
|
|
5467
|
-
strategy:
|
|
5471
|
+
offsetParent: p,
|
|
5472
|
+
strategy: l
|
|
5468
5473
|
}) : y);
|
|
5469
5474
|
return {
|
|
5470
|
-
top: (
|
|
5471
|
-
bottom: (C.bottom -
|
|
5472
|
-
left: (
|
|
5473
|
-
right: (C.right -
|
|
5475
|
+
top: (m.top - C.top + w.top) / R.y,
|
|
5476
|
+
bottom: (C.bottom - m.bottom + w.bottom) / R.y,
|
|
5477
|
+
left: (m.left - C.left + w.left) / R.x,
|
|
5478
|
+
right: (C.right - m.right + w.right) / R.x
|
|
5474
5479
|
};
|
|
5475
5480
|
}
|
|
5476
|
-
const
|
|
5481
|
+
const Fe = (c) => ({
|
|
5477
5482
|
name: "arrow",
|
|
5478
5483
|
options: c,
|
|
5479
5484
|
async fn(t) {
|
|
@@ -5484,20 +5489,20 @@ const We = (c) => ({
|
|
|
5484
5489
|
rects: o,
|
|
5485
5490
|
platform: r,
|
|
5486
5491
|
elements: a,
|
|
5487
|
-
middlewareData:
|
|
5492
|
+
middlewareData: l
|
|
5488
5493
|
} = t, {
|
|
5489
|
-
element:
|
|
5494
|
+
element: h,
|
|
5490
5495
|
padding: d = 0
|
|
5491
5496
|
} = Q(c, t) || {};
|
|
5492
|
-
if (
|
|
5497
|
+
if (h == null)
|
|
5493
5498
|
return {};
|
|
5494
|
-
const f =
|
|
5499
|
+
const f = Ft(d), u = {
|
|
5495
5500
|
x: e,
|
|
5496
5501
|
y: i
|
|
5497
|
-
}, x =
|
|
5498
|
-
let
|
|
5499
|
-
(!
|
|
5500
|
-
const
|
|
5502
|
+
}, x = Et(s), w = wt(x), E = await r.getDimensions(h), g = x === "y", m = g ? "top" : "left", y = g ? "bottom" : "right", p = g ? "clientHeight" : "clientWidth", R = o.reference[w] + o.reference[x] - u[x] - o.floating[w], C = u[x] - o.reference[x], I = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(h));
|
|
5503
|
+
let _ = I ? I[p] : 0;
|
|
5504
|
+
(!_ || !await (r.isElement == null ? void 0 : r.isElement(I))) && (_ = a.floating[p] || o.floating[w]);
|
|
5505
|
+
const v = R / 2 - C / 2, S = _ / 2 - E[w] / 2 - 1, b = q(f[m], S), O = q(f[y], S), T = b, M = _ - E[w] - O, L = _ / 2 - E[w] / 2 + v, A = dt(T, L, M), D = !l.arrow && tt(s) != null && L !== A && o.reference[w] / 2 - (L < T ? b : O) - E[w] / 2 < 0, N = D ? L < T ? L - T : L - M : 0;
|
|
5501
5506
|
return {
|
|
5502
5507
|
[x]: u[x] + N,
|
|
5503
5508
|
data: {
|
|
@@ -5510,7 +5515,7 @@ const We = (c) => ({
|
|
|
5510
5515
|
reset: D
|
|
5511
5516
|
};
|
|
5512
5517
|
}
|
|
5513
|
-
}),
|
|
5518
|
+
}), Ve = function(c) {
|
|
5514
5519
|
return c === void 0 && (c = {}), {
|
|
5515
5520
|
name: "flip",
|
|
5516
5521
|
options: c,
|
|
@@ -5521,33 +5526,33 @@ const We = (c) => ({
|
|
|
5521
5526
|
middlewareData: o,
|
|
5522
5527
|
rects: r,
|
|
5523
5528
|
initialPlacement: a,
|
|
5524
|
-
platform:
|
|
5525
|
-
elements:
|
|
5529
|
+
platform: l,
|
|
5530
|
+
elements: h
|
|
5526
5531
|
} = t, {
|
|
5527
5532
|
mainAxis: d = !0,
|
|
5528
5533
|
crossAxis: f = !0,
|
|
5529
5534
|
fallbackPlacements: u,
|
|
5530
5535
|
fallbackStrategy: x = "bestFit",
|
|
5531
5536
|
fallbackAxisSideDirection: w = "none",
|
|
5532
|
-
flipAlignment:
|
|
5537
|
+
flipAlignment: E = !0,
|
|
5533
5538
|
...g
|
|
5534
5539
|
} = Q(c, t);
|
|
5535
5540
|
if ((e = o.arrow) != null && e.alignmentOffset)
|
|
5536
5541
|
return {};
|
|
5537
|
-
const
|
|
5538
|
-
!u && I && C.push(...
|
|
5539
|
-
const
|
|
5542
|
+
const m = z(s), y = V(a), p = z(a) === a, R = await (l.isRTL == null ? void 0 : l.isRTL(h.floating)), C = u || (p || !E ? [ot(a)] : Ne(a)), I = w !== "none";
|
|
5543
|
+
!u && I && C.push(...Be(a, E, w, R));
|
|
5544
|
+
const _ = [a, ...C], v = await Vt(t, g), S = [];
|
|
5540
5545
|
let b = ((i = o.flip) == null ? void 0 : i.overflows) || [];
|
|
5541
|
-
if (d &&
|
|
5542
|
-
const L =
|
|
5543
|
-
|
|
5546
|
+
if (d && S.push(v[m]), f) {
|
|
5547
|
+
const L = De(s, r, R);
|
|
5548
|
+
S.push(v[L[0]], v[L[1]]);
|
|
5544
5549
|
}
|
|
5545
5550
|
if (b = [...b, {
|
|
5546
5551
|
placement: s,
|
|
5547
|
-
overflows:
|
|
5548
|
-
}], !
|
|
5552
|
+
overflows: S
|
|
5553
|
+
}], !S.every((L) => L <= 0)) {
|
|
5549
5554
|
var O, T;
|
|
5550
|
-
const L = (((O = o.flip) == null ? void 0 : O.index) || 0) + 1, A =
|
|
5555
|
+
const L = (((O = o.flip) == null ? void 0 : O.index) || 0) + 1, A = _[L];
|
|
5551
5556
|
if (A && (!(f === "alignment" ? y !== V(A) : !1) || // We leave the current main axis only if every placement on that axis
|
|
5552
5557
|
// overflows the main axis.
|
|
5553
5558
|
b.every((k) => V(k.placement) === y ? k.overflows[0] > 0 : !0)))
|
|
@@ -5573,7 +5578,7 @@ const We = (c) => ({
|
|
|
5573
5578
|
F === "y";
|
|
5574
5579
|
}
|
|
5575
5580
|
return !0;
|
|
5576
|
-
}).map((k) => [k.placement, k.overflows.filter((F) => F > 0).reduce((F,
|
|
5581
|
+
}).map((k) => [k.placement, k.overflows.filter((F) => F > 0).reduce((F, se) => F + se, 0)]).sort((k, F) => k[1] - F[1])[0]) == null ? void 0 : M[0];
|
|
5577
5582
|
N && (D = N);
|
|
5578
5583
|
break;
|
|
5579
5584
|
}
|
|
@@ -5591,13 +5596,13 @@ const We = (c) => ({
|
|
|
5591
5596
|
return {};
|
|
5592
5597
|
}
|
|
5593
5598
|
};
|
|
5594
|
-
},
|
|
5595
|
-
async function
|
|
5599
|
+
}, Pe = /* @__PURE__ */ new Set(["left", "top"]);
|
|
5600
|
+
async function ze(c, t) {
|
|
5596
5601
|
const {
|
|
5597
5602
|
placement: e,
|
|
5598
5603
|
platform: i,
|
|
5599
5604
|
elements: s
|
|
5600
|
-
} = c, o = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), r = z(e), a = tt(e),
|
|
5605
|
+
} = c, o = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), r = z(e), a = tt(e), l = V(e) === "y", h = Pe.has(r) ? -1 : 1, d = o && l ? -1 : 1, f = Q(t, c);
|
|
5601
5606
|
let {
|
|
5602
5607
|
mainAxis: u,
|
|
5603
5608
|
crossAxis: x,
|
|
@@ -5611,15 +5616,15 @@ async function Pe(c, t) {
|
|
|
5611
5616
|
crossAxis: f.crossAxis || 0,
|
|
5612
5617
|
alignmentAxis: f.alignmentAxis
|
|
5613
5618
|
};
|
|
5614
|
-
return a && typeof w == "number" && (x = a === "end" ? w * -1 : w),
|
|
5619
|
+
return a && typeof w == "number" && (x = a === "end" ? w * -1 : w), l ? {
|
|
5615
5620
|
x: x * d,
|
|
5616
|
-
y: u *
|
|
5621
|
+
y: u * h
|
|
5617
5622
|
} : {
|
|
5618
|
-
x: u *
|
|
5623
|
+
x: u * h,
|
|
5619
5624
|
y: x * d
|
|
5620
5625
|
};
|
|
5621
5626
|
}
|
|
5622
|
-
const
|
|
5627
|
+
const $e = function(c) {
|
|
5623
5628
|
return c === void 0 && (c = 0), {
|
|
5624
5629
|
name: "offset",
|
|
5625
5630
|
options: c,
|
|
@@ -5630,18 +5635,18 @@ const ze = function(c) {
|
|
|
5630
5635
|
y: o,
|
|
5631
5636
|
placement: r,
|
|
5632
5637
|
middlewareData: a
|
|
5633
|
-
} = t,
|
|
5638
|
+
} = t, l = await ze(t, c);
|
|
5634
5639
|
return r === ((e = a.offset) == null ? void 0 : e.placement) && (i = a.arrow) != null && i.alignmentOffset ? {} : {
|
|
5635
|
-
x: s +
|
|
5636
|
-
y: o +
|
|
5640
|
+
x: s + l.x,
|
|
5641
|
+
y: o + l.y,
|
|
5637
5642
|
data: {
|
|
5638
|
-
...
|
|
5643
|
+
...l,
|
|
5639
5644
|
placement: r
|
|
5640
5645
|
}
|
|
5641
5646
|
};
|
|
5642
5647
|
}
|
|
5643
5648
|
};
|
|
5644
|
-
},
|
|
5649
|
+
}, Ge = function(c) {
|
|
5645
5650
|
return c === void 0 && (c = {}), {
|
|
5646
5651
|
name: "shift",
|
|
5647
5652
|
options: c,
|
|
@@ -5656,39 +5661,39 @@ const ze = function(c) {
|
|
|
5656
5661
|
limiter: a = {
|
|
5657
5662
|
fn: (g) => {
|
|
5658
5663
|
let {
|
|
5659
|
-
x:
|
|
5664
|
+
x: m,
|
|
5660
5665
|
y
|
|
5661
5666
|
} = g;
|
|
5662
5667
|
return {
|
|
5663
|
-
x:
|
|
5668
|
+
x: m,
|
|
5664
5669
|
y
|
|
5665
5670
|
};
|
|
5666
5671
|
}
|
|
5667
5672
|
},
|
|
5668
|
-
...
|
|
5669
|
-
} = Q(c, t),
|
|
5673
|
+
...l
|
|
5674
|
+
} = Q(c, t), h = {
|
|
5670
5675
|
x: e,
|
|
5671
5676
|
y: i
|
|
5672
|
-
}, d = await
|
|
5673
|
-
let x =
|
|
5677
|
+
}, d = await Vt(t, l), f = V(z(s)), u = Wt(f);
|
|
5678
|
+
let x = h[u], w = h[f];
|
|
5674
5679
|
if (o) {
|
|
5675
|
-
const g = u === "y" ? "top" : "left",
|
|
5676
|
-
x = dt(y, x,
|
|
5680
|
+
const g = u === "y" ? "top" : "left", m = u === "y" ? "bottom" : "right", y = x + d[g], p = x - d[m];
|
|
5681
|
+
x = dt(y, x, p);
|
|
5677
5682
|
}
|
|
5678
5683
|
if (r) {
|
|
5679
|
-
const g = f === "y" ? "top" : "left",
|
|
5680
|
-
w = dt(y, w,
|
|
5684
|
+
const g = f === "y" ? "top" : "left", m = f === "y" ? "bottom" : "right", y = w + d[g], p = w - d[m];
|
|
5685
|
+
w = dt(y, w, p);
|
|
5681
5686
|
}
|
|
5682
|
-
const
|
|
5687
|
+
const E = a.fn({
|
|
5683
5688
|
...t,
|
|
5684
5689
|
[u]: x,
|
|
5685
5690
|
[f]: w
|
|
5686
5691
|
});
|
|
5687
5692
|
return {
|
|
5688
|
-
...
|
|
5693
|
+
...E,
|
|
5689
5694
|
data: {
|
|
5690
|
-
x:
|
|
5691
|
-
y:
|
|
5695
|
+
x: E.x - e,
|
|
5696
|
+
y: E.y - i,
|
|
5692
5697
|
enabled: {
|
|
5693
5698
|
[u]: o,
|
|
5694
5699
|
[f]: r
|
|
@@ -5701,8 +5706,8 @@ const ze = function(c) {
|
|
|
5701
5706
|
function nt() {
|
|
5702
5707
|
return typeof window < "u";
|
|
5703
5708
|
}
|
|
5704
|
-
function
|
|
5705
|
-
return
|
|
5709
|
+
function Z(c) {
|
|
5710
|
+
return Pt(c) ? (c.nodeName || "").toLowerCase() : "#document";
|
|
5706
5711
|
}
|
|
5707
5712
|
function H(c) {
|
|
5708
5713
|
var t;
|
|
@@ -5710,9 +5715,9 @@ function H(c) {
|
|
|
5710
5715
|
}
|
|
5711
5716
|
function W(c) {
|
|
5712
5717
|
var t;
|
|
5713
|
-
return (t = (
|
|
5718
|
+
return (t = (Pt(c) ? c.ownerDocument : c.document) || window.document) == null ? void 0 : t.documentElement;
|
|
5714
5719
|
}
|
|
5715
|
-
function
|
|
5720
|
+
function Pt(c) {
|
|
5716
5721
|
return nt() ? c instanceof Node || c instanceof H(c).Node : !1;
|
|
5717
5722
|
}
|
|
5718
5723
|
function X(c) {
|
|
@@ -5721,10 +5726,10 @@ function X(c) {
|
|
|
5721
5726
|
function K(c) {
|
|
5722
5727
|
return nt() ? c instanceof HTMLElement || c instanceof H(c).HTMLElement : !1;
|
|
5723
5728
|
}
|
|
5724
|
-
function
|
|
5729
|
+
function Mt(c) {
|
|
5725
5730
|
return !nt() || typeof ShadowRoot > "u" ? !1 : c instanceof ShadowRoot || c instanceof H(c).ShadowRoot;
|
|
5726
5731
|
}
|
|
5727
|
-
const
|
|
5732
|
+
const Ue = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
5728
5733
|
function et(c) {
|
|
5729
5734
|
const {
|
|
5730
5735
|
overflow: t,
|
|
@@ -5732,15 +5737,15 @@ function et(c) {
|
|
|
5732
5737
|
overflowY: i,
|
|
5733
5738
|
display: s
|
|
5734
5739
|
} = Y(c);
|
|
5735
|
-
return /auto|scroll|overlay|hidden|clip/.test(t + i + e) && !
|
|
5740
|
+
return /auto|scroll|overlay|hidden|clip/.test(t + i + e) && !Ue.has(s);
|
|
5736
5741
|
}
|
|
5737
|
-
const
|
|
5738
|
-
function
|
|
5739
|
-
return
|
|
5742
|
+
const Ze = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
5743
|
+
function je(c) {
|
|
5744
|
+
return Ze.has(Z(c));
|
|
5740
5745
|
}
|
|
5741
|
-
const
|
|
5746
|
+
const qe = [":popover-open", ":modal"];
|
|
5742
5747
|
function at(c) {
|
|
5743
|
-
return
|
|
5748
|
+
return qe.some((t) => {
|
|
5744
5749
|
try {
|
|
5745
5750
|
return c.matches(t);
|
|
5746
5751
|
} catch {
|
|
@@ -5748,15 +5753,15 @@ function at(c) {
|
|
|
5748
5753
|
}
|
|
5749
5754
|
});
|
|
5750
5755
|
}
|
|
5751
|
-
const
|
|
5752
|
-
function
|
|
5753
|
-
const t =
|
|
5754
|
-
return
|
|
5756
|
+
const Je = ["transform", "translate", "scale", "rotate", "perspective"], Qe = ["transform", "translate", "scale", "rotate", "perspective", "filter"], ti = ["paint", "layout", "strict", "content"];
|
|
5757
|
+
function mt(c) {
|
|
5758
|
+
const t = pt(), e = X(c) ? Y(c) : c;
|
|
5759
|
+
return Je.some((i) => e[i] ? e[i] !== "none" : !1) || (e.containerType ? e.containerType !== "normal" : !1) || !t && (e.backdropFilter ? e.backdropFilter !== "none" : !1) || !t && (e.filter ? e.filter !== "none" : !1) || Qe.some((i) => (e.willChange || "").includes(i)) || ti.some((i) => (e.contain || "").includes(i));
|
|
5755
5760
|
}
|
|
5756
|
-
function
|
|
5761
|
+
function ei(c) {
|
|
5757
5762
|
let t = P(c);
|
|
5758
5763
|
for (; K(t) && !U(t); ) {
|
|
5759
|
-
if (
|
|
5764
|
+
if (mt(t))
|
|
5760
5765
|
return t;
|
|
5761
5766
|
if (at(t))
|
|
5762
5767
|
return null;
|
|
@@ -5764,17 +5769,17 @@ function ti(c) {
|
|
|
5764
5769
|
}
|
|
5765
5770
|
return null;
|
|
5766
5771
|
}
|
|
5767
|
-
function
|
|
5772
|
+
function pt() {
|
|
5768
5773
|
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
5769
5774
|
}
|
|
5770
|
-
const
|
|
5775
|
+
const ii = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
5771
5776
|
function U(c) {
|
|
5772
|
-
return
|
|
5777
|
+
return ii.has(Z(c));
|
|
5773
5778
|
}
|
|
5774
5779
|
function Y(c) {
|
|
5775
5780
|
return H(c).getComputedStyle(c);
|
|
5776
5781
|
}
|
|
5777
|
-
function
|
|
5782
|
+
function lt(c) {
|
|
5778
5783
|
return X(c) ? {
|
|
5779
5784
|
scrollLeft: c.scrollLeft,
|
|
5780
5785
|
scrollTop: c.scrollTop
|
|
@@ -5784,31 +5789,31 @@ function ht(c) {
|
|
|
5784
5789
|
};
|
|
5785
5790
|
}
|
|
5786
5791
|
function P(c) {
|
|
5787
|
-
if (
|
|
5792
|
+
if (Z(c) === "html")
|
|
5788
5793
|
return c;
|
|
5789
5794
|
const t = (
|
|
5790
5795
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
5791
5796
|
c.assignedSlot || // DOM Element detected.
|
|
5792
5797
|
c.parentNode || // ShadowRoot detected.
|
|
5793
|
-
|
|
5798
|
+
Mt(c) && c.host || // Fallback.
|
|
5794
5799
|
W(c)
|
|
5795
5800
|
);
|
|
5796
|
-
return
|
|
5801
|
+
return Mt(t) ? t.host : t;
|
|
5797
5802
|
}
|
|
5798
|
-
function
|
|
5803
|
+
function zt(c) {
|
|
5799
5804
|
const t = P(c);
|
|
5800
|
-
return U(t) ? c.ownerDocument ? c.ownerDocument.body : c.body : K(t) && et(t) ? t :
|
|
5805
|
+
return U(t) ? c.ownerDocument ? c.ownerDocument.body : c.body : K(t) && et(t) ? t : zt(t);
|
|
5801
5806
|
}
|
|
5802
|
-
function
|
|
5807
|
+
function $t(c, t, e) {
|
|
5803
5808
|
var i;
|
|
5804
5809
|
t === void 0 && (t = []);
|
|
5805
|
-
const s =
|
|
5806
|
-
return o ? (xt(r), t.concat(r, r.visualViewport || [], et(s) ? s : [], [])) : t.concat(s,
|
|
5810
|
+
const s = zt(c), o = s === ((i = c.ownerDocument) == null ? void 0 : i.body), r = H(s);
|
|
5811
|
+
return o ? (xt(r), t.concat(r, r.visualViewport || [], et(s) ? s : [], [])) : t.concat(s, $t(s, []));
|
|
5807
5812
|
}
|
|
5808
5813
|
function xt(c) {
|
|
5809
5814
|
return c.parent && Object.getPrototypeOf(c.parent) ? c.frameElement : null;
|
|
5810
5815
|
}
|
|
5811
|
-
function
|
|
5816
|
+
function Gt(c) {
|
|
5812
5817
|
const t = Y(c);
|
|
5813
5818
|
let e = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
|
|
5814
5819
|
const s = K(c), o = s ? c.offsetWidth : e, r = s ? c.offsetHeight : i, a = st(e) !== o || st(i) !== r;
|
|
@@ -5818,62 +5823,62 @@ function $t(c) {
|
|
|
5818
5823
|
$: a
|
|
5819
5824
|
};
|
|
5820
5825
|
}
|
|
5821
|
-
function
|
|
5826
|
+
function Ut(c) {
|
|
5822
5827
|
return X(c) ? c : c.contextElement;
|
|
5823
5828
|
}
|
|
5824
5829
|
function G(c) {
|
|
5825
|
-
const t =
|
|
5830
|
+
const t = Ut(c);
|
|
5826
5831
|
if (!K(t))
|
|
5827
5832
|
return B(1);
|
|
5828
5833
|
const e = t.getBoundingClientRect(), {
|
|
5829
5834
|
width: i,
|
|
5830
5835
|
height: s,
|
|
5831
5836
|
$: o
|
|
5832
|
-
} =
|
|
5837
|
+
} = Gt(t);
|
|
5833
5838
|
let r = (o ? st(e.width) : e.width) / i, a = (o ? st(e.height) : e.height) / s;
|
|
5834
5839
|
return (!r || !Number.isFinite(r)) && (r = 1), (!a || !Number.isFinite(a)) && (a = 1), {
|
|
5835
5840
|
x: r,
|
|
5836
5841
|
y: a
|
|
5837
5842
|
};
|
|
5838
5843
|
}
|
|
5839
|
-
const
|
|
5840
|
-
function
|
|
5844
|
+
const si = /* @__PURE__ */ B(0);
|
|
5845
|
+
function Zt(c) {
|
|
5841
5846
|
const t = H(c);
|
|
5842
|
-
return !
|
|
5847
|
+
return !pt() || !t.visualViewport ? si : {
|
|
5843
5848
|
x: t.visualViewport.offsetLeft,
|
|
5844
5849
|
y: t.visualViewport.offsetTop
|
|
5845
5850
|
};
|
|
5846
5851
|
}
|
|
5847
|
-
function
|
|
5852
|
+
function oi(c, t, e) {
|
|
5848
5853
|
return t === void 0 && (t = !1), !e || t && e !== H(c) ? !1 : t;
|
|
5849
5854
|
}
|
|
5850
5855
|
function J(c, t, e, i) {
|
|
5851
5856
|
t === void 0 && (t = !1), e === void 0 && (e = !1);
|
|
5852
|
-
const s = c.getBoundingClientRect(), o =
|
|
5857
|
+
const s = c.getBoundingClientRect(), o = Ut(c);
|
|
5853
5858
|
let r = B(1);
|
|
5854
5859
|
t && (i ? X(i) && (r = G(i)) : r = G(c));
|
|
5855
|
-
const a =
|
|
5856
|
-
let
|
|
5860
|
+
const a = oi(o, e, i) ? Zt(o) : B(0);
|
|
5861
|
+
let l = (s.left + a.x) / r.x, h = (s.top + a.y) / r.y, d = s.width / r.x, f = s.height / r.y;
|
|
5857
5862
|
if (o) {
|
|
5858
5863
|
const u = H(o), x = i && X(i) ? H(i) : i;
|
|
5859
|
-
let w = u,
|
|
5860
|
-
for (;
|
|
5861
|
-
const g = G(
|
|
5862
|
-
|
|
5864
|
+
let w = u, E = xt(w);
|
|
5865
|
+
for (; E && i && x !== w; ) {
|
|
5866
|
+
const g = G(E), m = E.getBoundingClientRect(), y = Y(E), p = m.left + (E.clientLeft + parseFloat(y.paddingLeft)) * g.x, R = m.top + (E.clientTop + parseFloat(y.paddingTop)) * g.y;
|
|
5867
|
+
l *= g.x, h *= g.y, d *= g.x, f *= g.y, l += p, h += R, w = H(E), E = xt(w);
|
|
5863
5868
|
}
|
|
5864
5869
|
}
|
|
5865
5870
|
return rt({
|
|
5866
5871
|
width: d,
|
|
5867
5872
|
height: f,
|
|
5868
|
-
x:
|
|
5869
|
-
y:
|
|
5873
|
+
x: l,
|
|
5874
|
+
y: h
|
|
5870
5875
|
});
|
|
5871
5876
|
}
|
|
5872
5877
|
function yt(c, t) {
|
|
5873
|
-
const e =
|
|
5878
|
+
const e = lt(c).scrollLeft;
|
|
5874
5879
|
return t ? t.left + e : J(W(c)).left + e;
|
|
5875
5880
|
}
|
|
5876
|
-
function
|
|
5881
|
+
function jt(c, t, e) {
|
|
5877
5882
|
e === void 0 && (e = !1);
|
|
5878
5883
|
const i = c.getBoundingClientRect(), s = i.left + t.scrollLeft - (e ? 0 : (
|
|
5879
5884
|
// RTL <body> scrollbar.
|
|
@@ -5884,7 +5889,7 @@ function qt(c, t, e) {
|
|
|
5884
5889
|
y: o
|
|
5885
5890
|
};
|
|
5886
5891
|
}
|
|
5887
|
-
function
|
|
5892
|
+
function ri(c) {
|
|
5888
5893
|
let {
|
|
5889
5894
|
elements: t,
|
|
5890
5895
|
rect: e,
|
|
@@ -5894,28 +5899,28 @@ function oi(c) {
|
|
|
5894
5899
|
const o = s === "fixed", r = W(i), a = t ? at(t.floating) : !1;
|
|
5895
5900
|
if (i === r || a && o)
|
|
5896
5901
|
return e;
|
|
5897
|
-
let
|
|
5902
|
+
let l = {
|
|
5898
5903
|
scrollLeft: 0,
|
|
5899
5904
|
scrollTop: 0
|
|
5900
|
-
},
|
|
5905
|
+
}, h = B(1);
|
|
5901
5906
|
const d = B(0), f = K(i);
|
|
5902
|
-
if ((f || !f && !o) && ((
|
|
5907
|
+
if ((f || !f && !o) && ((Z(i) !== "body" || et(r)) && (l = lt(i)), K(i))) {
|
|
5903
5908
|
const x = J(i);
|
|
5904
|
-
|
|
5909
|
+
h = G(i), d.x = x.x + i.clientLeft, d.y = x.y + i.clientTop;
|
|
5905
5910
|
}
|
|
5906
|
-
const u = r && !f && !o ?
|
|
5911
|
+
const u = r && !f && !o ? jt(r, l, !0) : B(0);
|
|
5907
5912
|
return {
|
|
5908
|
-
width: e.width *
|
|
5909
|
-
height: e.height *
|
|
5910
|
-
x: e.x *
|
|
5911
|
-
y: e.y *
|
|
5913
|
+
width: e.width * h.x,
|
|
5914
|
+
height: e.height * h.y,
|
|
5915
|
+
x: e.x * h.x - l.scrollLeft * h.x + d.x + u.x,
|
|
5916
|
+
y: e.y * h.y - l.scrollTop * h.y + d.y + u.y
|
|
5912
5917
|
};
|
|
5913
5918
|
}
|
|
5914
|
-
function
|
|
5919
|
+
function ni(c) {
|
|
5915
5920
|
return Array.from(c.getClientRects());
|
|
5916
5921
|
}
|
|
5917
|
-
function
|
|
5918
|
-
const t = W(c), e =
|
|
5922
|
+
function ai(c) {
|
|
5923
|
+
const t = W(c), e = lt(c), i = c.ownerDocument.body, s = $(t.scrollWidth, t.clientWidth, i.scrollWidth, i.clientWidth), o = $(t.scrollHeight, t.clientHeight, i.scrollHeight, i.clientHeight);
|
|
5919
5924
|
let r = -e.scrollLeft + yt(c);
|
|
5920
5925
|
const a = -e.scrollTop;
|
|
5921
5926
|
return Y(i).direction === "rtl" && (r += $(t.clientWidth, i.clientWidth) - s), {
|
|
@@ -5925,41 +5930,41 @@ function ni(c) {
|
|
|
5925
5930
|
y: a
|
|
5926
5931
|
};
|
|
5927
5932
|
}
|
|
5928
|
-
function
|
|
5933
|
+
function li(c, t) {
|
|
5929
5934
|
const e = H(c), i = W(c), s = e.visualViewport;
|
|
5930
|
-
let o = i.clientWidth, r = i.clientHeight, a = 0,
|
|
5935
|
+
let o = i.clientWidth, r = i.clientHeight, a = 0, l = 0;
|
|
5931
5936
|
if (s) {
|
|
5932
5937
|
o = s.width, r = s.height;
|
|
5933
|
-
const
|
|
5934
|
-
(!
|
|
5938
|
+
const h = pt();
|
|
5939
|
+
(!h || h && t === "fixed") && (a = s.offsetLeft, l = s.offsetTop);
|
|
5935
5940
|
}
|
|
5936
5941
|
return {
|
|
5937
5942
|
width: o,
|
|
5938
5943
|
height: r,
|
|
5939
5944
|
x: a,
|
|
5940
|
-
y:
|
|
5945
|
+
y: l
|
|
5941
5946
|
};
|
|
5942
5947
|
}
|
|
5943
5948
|
const hi = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
5944
|
-
function
|
|
5945
|
-
const e = J(c, !0, t === "fixed"), i = e.top + c.clientTop, s = e.left + c.clientLeft, o = K(c) ? G(c) : B(1), r = c.clientWidth * o.x, a = c.clientHeight * o.y,
|
|
5949
|
+
function ci(c, t) {
|
|
5950
|
+
const e = J(c, !0, t === "fixed"), i = e.top + c.clientTop, s = e.left + c.clientLeft, o = K(c) ? G(c) : B(1), r = c.clientWidth * o.x, a = c.clientHeight * o.y, l = s * o.x, h = i * o.y;
|
|
5946
5951
|
return {
|
|
5947
5952
|
width: r,
|
|
5948
5953
|
height: a,
|
|
5949
|
-
x:
|
|
5950
|
-
y:
|
|
5954
|
+
x: l,
|
|
5955
|
+
y: h
|
|
5951
5956
|
};
|
|
5952
5957
|
}
|
|
5953
|
-
function
|
|
5958
|
+
function At(c, t, e) {
|
|
5954
5959
|
let i;
|
|
5955
5960
|
if (t === "viewport")
|
|
5956
|
-
i =
|
|
5961
|
+
i = li(c, e);
|
|
5957
5962
|
else if (t === "document")
|
|
5958
|
-
i =
|
|
5963
|
+
i = ai(W(c));
|
|
5959
5964
|
else if (X(t))
|
|
5960
|
-
i =
|
|
5965
|
+
i = ci(t, e);
|
|
5961
5966
|
else {
|
|
5962
|
-
const s =
|
|
5967
|
+
const s = Zt(c);
|
|
5963
5968
|
i = {
|
|
5964
5969
|
x: t.x - s.x,
|
|
5965
5970
|
y: t.y - s.y,
|
|
@@ -5969,68 +5974,68 @@ function Mt(c, t, e) {
|
|
|
5969
5974
|
}
|
|
5970
5975
|
return rt(i);
|
|
5971
5976
|
}
|
|
5972
|
-
function
|
|
5977
|
+
function qt(c, t) {
|
|
5973
5978
|
const e = P(c);
|
|
5974
|
-
return e === t || !X(e) || U(e) ? !1 : Y(e).position === "fixed" ||
|
|
5979
|
+
return e === t || !X(e) || U(e) ? !1 : Y(e).position === "fixed" || qt(e, t);
|
|
5975
5980
|
}
|
|
5976
|
-
function
|
|
5981
|
+
function di(c, t) {
|
|
5977
5982
|
const e = t.get(c);
|
|
5978
5983
|
if (e)
|
|
5979
5984
|
return e;
|
|
5980
|
-
let i =
|
|
5985
|
+
let i = $t(c, []).filter((a) => X(a) && Z(a) !== "body"), s = null;
|
|
5981
5986
|
const o = Y(c).position === "fixed";
|
|
5982
5987
|
let r = o ? P(c) : c;
|
|
5983
5988
|
for (; X(r) && !U(r); ) {
|
|
5984
|
-
const a = Y(r),
|
|
5985
|
-
!
|
|
5989
|
+
const a = Y(r), l = mt(r);
|
|
5990
|
+
!l && a.position === "fixed" && (s = null), (o ? !l && !s : !l && a.position === "static" && !!s && hi.has(s.position) || et(r) && !l && qt(c, r)) ? i = i.filter((d) => d !== r) : s = a, r = P(r);
|
|
5986
5991
|
}
|
|
5987
5992
|
return t.set(c, i), i;
|
|
5988
5993
|
}
|
|
5989
|
-
function
|
|
5994
|
+
function fi(c) {
|
|
5990
5995
|
let {
|
|
5991
5996
|
element: t,
|
|
5992
5997
|
boundary: e,
|
|
5993
5998
|
rootBoundary: i,
|
|
5994
5999
|
strategy: s
|
|
5995
6000
|
} = c;
|
|
5996
|
-
const r = [...e === "clippingAncestors" ? at(t) ? [] :
|
|
5997
|
-
const f =
|
|
5998
|
-
return
|
|
5999
|
-
},
|
|
6001
|
+
const r = [...e === "clippingAncestors" ? at(t) ? [] : di(t, this._c) : [].concat(e), i], a = r[0], l = r.reduce((h, d) => {
|
|
6002
|
+
const f = At(t, d, s);
|
|
6003
|
+
return h.top = $(f.top, h.top), h.right = q(f.right, h.right), h.bottom = q(f.bottom, h.bottom), h.left = $(f.left, h.left), h;
|
|
6004
|
+
}, At(t, a, s));
|
|
6000
6005
|
return {
|
|
6001
|
-
width:
|
|
6002
|
-
height:
|
|
6003
|
-
x:
|
|
6004
|
-
y:
|
|
6006
|
+
width: l.right - l.left,
|
|
6007
|
+
height: l.bottom - l.top,
|
|
6008
|
+
x: l.left,
|
|
6009
|
+
y: l.top
|
|
6005
6010
|
};
|
|
6006
6011
|
}
|
|
6007
|
-
function
|
|
6012
|
+
function xi(c) {
|
|
6008
6013
|
const {
|
|
6009
6014
|
width: t,
|
|
6010
6015
|
height: e
|
|
6011
|
-
} =
|
|
6016
|
+
} = Gt(c);
|
|
6012
6017
|
return {
|
|
6013
6018
|
width: t,
|
|
6014
6019
|
height: e
|
|
6015
6020
|
};
|
|
6016
6021
|
}
|
|
6017
|
-
function
|
|
6022
|
+
function ui(c, t, e) {
|
|
6018
6023
|
const i = K(t), s = W(t), o = e === "fixed", r = J(c, !0, o, t);
|
|
6019
6024
|
let a = {
|
|
6020
6025
|
scrollLeft: 0,
|
|
6021
6026
|
scrollTop: 0
|
|
6022
6027
|
};
|
|
6023
|
-
const
|
|
6024
|
-
function
|
|
6025
|
-
|
|
6028
|
+
const l = B(0);
|
|
6029
|
+
function h() {
|
|
6030
|
+
l.x = yt(s);
|
|
6026
6031
|
}
|
|
6027
6032
|
if (i || !i && !o)
|
|
6028
|
-
if ((
|
|
6033
|
+
if ((Z(t) !== "body" || et(s)) && (a = lt(t)), i) {
|
|
6029
6034
|
const x = J(t, !0, o, t);
|
|
6030
|
-
|
|
6031
|
-
} else s &&
|
|
6032
|
-
o && !i && s &&
|
|
6033
|
-
const d = s && !i && !o ?
|
|
6035
|
+
l.x = x.x + t.clientLeft, l.y = x.y + t.clientTop;
|
|
6036
|
+
} else s && h();
|
|
6037
|
+
o && !i && s && h();
|
|
6038
|
+
const d = s && !i && !o ? jt(s, a) : B(0), f = r.left + a.scrollLeft - l.x - d.x, u = r.top + a.scrollTop - l.y - d.y;
|
|
6034
6039
|
return {
|
|
6035
6040
|
x: f,
|
|
6036
6041
|
y: u,
|
|
@@ -6038,10 +6043,10 @@ function xi(c, t, e) {
|
|
|
6038
6043
|
height: r.height
|
|
6039
6044
|
};
|
|
6040
6045
|
}
|
|
6041
|
-
function
|
|
6046
|
+
function ht(c) {
|
|
6042
6047
|
return Y(c).position === "static";
|
|
6043
6048
|
}
|
|
6044
|
-
function
|
|
6049
|
+
function Ht(c, t) {
|
|
6045
6050
|
if (!K(c) || Y(c).position === "fixed")
|
|
6046
6051
|
return null;
|
|
6047
6052
|
if (t)
|
|
@@ -6049,28 +6054,28 @@ function At(c, t) {
|
|
|
6049
6054
|
let e = c.offsetParent;
|
|
6050
6055
|
return W(c) === e && (e = e.ownerDocument.body), e;
|
|
6051
6056
|
}
|
|
6052
|
-
function
|
|
6057
|
+
function Jt(c, t) {
|
|
6053
6058
|
const e = H(c);
|
|
6054
6059
|
if (at(c))
|
|
6055
6060
|
return e;
|
|
6056
6061
|
if (!K(c)) {
|
|
6057
6062
|
let s = P(c);
|
|
6058
6063
|
for (; s && !U(s); ) {
|
|
6059
|
-
if (X(s) && !
|
|
6064
|
+
if (X(s) && !ht(s))
|
|
6060
6065
|
return s;
|
|
6061
6066
|
s = P(s);
|
|
6062
6067
|
}
|
|
6063
6068
|
return e;
|
|
6064
6069
|
}
|
|
6065
|
-
let i =
|
|
6066
|
-
for (; i &&
|
|
6067
|
-
i =
|
|
6068
|
-
return i && U(i) &&
|
|
6070
|
+
let i = Ht(c, t);
|
|
6071
|
+
for (; i && je(i) && ht(i); )
|
|
6072
|
+
i = Ht(i, t);
|
|
6073
|
+
return i && U(i) && ht(i) && !mt(i) ? e : i || ei(c) || e;
|
|
6069
6074
|
}
|
|
6070
|
-
const
|
|
6071
|
-
const t = this.getOffsetParent ||
|
|
6075
|
+
const gi = async function(c) {
|
|
6076
|
+
const t = this.getOffsetParent || Jt, e = this.getDimensions, i = await e(c.floating);
|
|
6072
6077
|
return {
|
|
6073
|
-
reference:
|
|
6078
|
+
reference: ui(c.reference, await t(c.floating), c.strategy),
|
|
6074
6079
|
floating: {
|
|
6075
6080
|
x: 0,
|
|
6076
6081
|
y: 0,
|
|
@@ -6079,29 +6084,29 @@ const ui = async function(c) {
|
|
|
6079
6084
|
}
|
|
6080
6085
|
};
|
|
6081
6086
|
};
|
|
6082
|
-
function
|
|
6087
|
+
function wi(c) {
|
|
6083
6088
|
return Y(c).direction === "rtl";
|
|
6084
6089
|
}
|
|
6085
|
-
const
|
|
6086
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
6090
|
+
const Ei = {
|
|
6091
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: ri,
|
|
6087
6092
|
getDocumentElement: W,
|
|
6088
|
-
getClippingRect:
|
|
6089
|
-
getOffsetParent:
|
|
6090
|
-
getElementRects:
|
|
6091
|
-
getClientRects:
|
|
6092
|
-
getDimensions:
|
|
6093
|
+
getClippingRect: fi,
|
|
6094
|
+
getOffsetParent: Jt,
|
|
6095
|
+
getElementRects: gi,
|
|
6096
|
+
getClientRects: ni,
|
|
6097
|
+
getDimensions: xi,
|
|
6093
6098
|
getScale: G,
|
|
6094
6099
|
isElement: X,
|
|
6095
|
-
isRTL:
|
|
6096
|
-
},
|
|
6100
|
+
isRTL: wi
|
|
6101
|
+
}, Qt = $e, te = Ge, ee = Ve, mi = Fe, ie = (c, t, e) => {
|
|
6097
6102
|
const i = /* @__PURE__ */ new Map(), s = {
|
|
6098
|
-
platform:
|
|
6103
|
+
platform: Ei,
|
|
6099
6104
|
...e
|
|
6100
6105
|
}, o = {
|
|
6101
6106
|
...s.platform,
|
|
6102
6107
|
_c: i
|
|
6103
6108
|
};
|
|
6104
|
-
return
|
|
6109
|
+
return We(c, t, {
|
|
6105
6110
|
...s,
|
|
6106
6111
|
platform: o
|
|
6107
6112
|
});
|
|
@@ -6127,7 +6132,7 @@ let pi = class {
|
|
|
6127
6132
|
borderRadius: "4px",
|
|
6128
6133
|
fontSize: "12px",
|
|
6129
6134
|
...o
|
|
6130
|
-
},
|
|
6135
|
+
}, l = {
|
|
6131
6136
|
position: "absolute",
|
|
6132
6137
|
width: "10px",
|
|
6133
6138
|
height: "10px",
|
|
@@ -6136,7 +6141,7 @@ let pi = class {
|
|
|
6136
6141
|
transform: "rotate(45deg)",
|
|
6137
6142
|
zIndex: a.zIndex
|
|
6138
6143
|
};
|
|
6139
|
-
Object.assign(this.arrowEl.style,
|
|
6144
|
+
Object.assign(this.arrowEl.style, l), Object.assign(this.floatingEl.style, a), this.floatingEl.appendChild(this.contentEl), this.floatingEl.appendChild(this.arrowEl), this.ctx.containerElement.appendChild(this.floatingEl), this.init();
|
|
6140
6145
|
}
|
|
6141
6146
|
init() {
|
|
6142
6147
|
this.floatingEl.addEventListener("mouseleave", () => {
|
|
@@ -6168,7 +6173,7 @@ let pi = class {
|
|
|
6168
6173
|
return;
|
|
6169
6174
|
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;
|
|
6170
6175
|
const s = t.drawX + i.x, o = t.drawY + i.y;
|
|
6171
|
-
|
|
6176
|
+
ie({
|
|
6172
6177
|
getBoundingClientRect() {
|
|
6173
6178
|
return {
|
|
6174
6179
|
width: t.visibleWidth,
|
|
@@ -6183,12 +6188,12 @@ let pi = class {
|
|
|
6183
6188
|
}
|
|
6184
6189
|
}, this.floatingEl, {
|
|
6185
6190
|
placement: t.overflowTooltipPlacement,
|
|
6186
|
-
middleware: [
|
|
6191
|
+
middleware: [te(), ee(), Qt(6), mi({ element: this.arrowEl })]
|
|
6187
6192
|
}).then((a) => {
|
|
6188
|
-
const { x:
|
|
6193
|
+
const { x: l, y: h, placement: d, middlewareData: f } = a;
|
|
6189
6194
|
if (Object.assign(this.floatingEl.style, {
|
|
6190
|
-
top: `${
|
|
6191
|
-
left: `${
|
|
6195
|
+
top: `${h}px`,
|
|
6196
|
+
left: `${l}px`
|
|
6192
6197
|
}), f.arrow) {
|
|
6193
6198
|
const u = f.arrow;
|
|
6194
6199
|
["left", "left-start", "left-end"].includes(d) ? Object.assign(this.arrowEl.style, {
|
|
@@ -6222,7 +6227,7 @@ let pi = class {
|
|
|
6222
6227
|
this.contentEl.remove(), this.arrowEl.remove(), this.floatingEl.remove();
|
|
6223
6228
|
}
|
|
6224
6229
|
};
|
|
6225
|
-
class
|
|
6230
|
+
class yi {
|
|
6226
6231
|
constructor(t) {
|
|
6227
6232
|
n(this, "editorEl");
|
|
6228
6233
|
n(this, "inputEl");
|
|
@@ -6253,15 +6258,15 @@ class Ei {
|
|
|
6253
6258
|
return;
|
|
6254
6259
|
if (t.code === "Escape" && this.ctx.editing) {
|
|
6255
6260
|
this.cancel = !0;
|
|
6256
|
-
const { focusCell:
|
|
6257
|
-
|
|
6261
|
+
const { focusCell: l } = this.ctx;
|
|
6262
|
+
l && (this.ctx.emit("setSelectorCell", l), this.cellTarget = l), this.doneEdit();
|
|
6258
6263
|
return;
|
|
6259
6264
|
}
|
|
6260
6265
|
if ((t.altKey || t.metaKey) && t.code === "Enter" && this.ctx.editing && this.inputEl) {
|
|
6261
6266
|
t.preventDefault();
|
|
6262
|
-
const
|
|
6263
|
-
this.inputEl.value =
|
|
6264
|
-
` + d, this.inputEl.selectionStart = this.inputEl.selectionEnd =
|
|
6267
|
+
const l = this.inputEl.selectionStart, h = this.inputEl.value.substring(0, l), d = this.inputEl.value.substring(l);
|
|
6268
|
+
this.inputEl.value = h + `
|
|
6269
|
+
` + d, this.inputEl.selectionStart = this.inputEl.selectionEnd = l + 1, this.autoSize();
|
|
6265
6270
|
return;
|
|
6266
6271
|
}
|
|
6267
6272
|
if (t.code === "Tab" && this.ctx.editing) {
|
|
@@ -6337,8 +6342,8 @@ class Ei {
|
|
|
6337
6342
|
});
|
|
6338
6343
|
}
|
|
6339
6344
|
isInSelectorRange(t, e) {
|
|
6340
|
-
const { xArr: i, yArr: s } = this.ctx.selector, [o, r] = i, [a,
|
|
6341
|
-
return !(e < o || e > r || t < a || t >
|
|
6345
|
+
const { xArr: i, yArr: s } = this.ctx.selector, [o, r] = i, [a, l] = s;
|
|
6346
|
+
return !(e < o || e > r || t < a || t > l);
|
|
6342
6347
|
}
|
|
6343
6348
|
initTextEditor() {
|
|
6344
6349
|
this.inputEl = document.createElement("textarea"), this.inputEl.setAttribute("rows", "1"), this.inputEl.addEventListener("input", this.autoSize.bind(this)), this.inputEl.addEventListener("blur", () => {
|
|
@@ -6360,15 +6365,15 @@ class Ei {
|
|
|
6360
6365
|
startEditByInput(t, e = !1) {
|
|
6361
6366
|
const i = e ? null : t.getValue(), { editorType: s } = t;
|
|
6362
6367
|
t.update(), this.ctx.config.ENABLE_MERGE_CELL_LINK && t.updateSpanInfo();
|
|
6363
|
-
let { height: o, width: r, drawY: a, drawX:
|
|
6364
|
-
this.drawX =
|
|
6368
|
+
let { height: o, width: r, drawY: a, drawX: l } = t;
|
|
6369
|
+
this.drawX = l, this.drawY = a;
|
|
6365
6370
|
const {
|
|
6366
|
-
config: { CELL_PADDING:
|
|
6371
|
+
config: { CELL_PADDING: h },
|
|
6367
6372
|
header: d
|
|
6368
6373
|
} = this.ctx;
|
|
6369
6374
|
let f = this.ctx.body.visibleHeight;
|
|
6370
6375
|
if (o > f && (o = f), this.editorEl.style.display = "inline-block", 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") {
|
|
6371
|
-
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 = `${
|
|
6376
|
+
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 = `${h}px`, i !== null && (this.inputEl.value = i), this.inputEl.focus({ preventScroll: !0 });
|
|
6372
6377
|
const u = this.inputEl.value.length;
|
|
6373
6378
|
this.inputEl.setSelectionRange(u, u);
|
|
6374
6379
|
} else
|
|
@@ -6392,22 +6397,22 @@ class Ei {
|
|
|
6392
6397
|
const { rowKey: o, key: r, editorType: a } = i;
|
|
6393
6398
|
if (a === "none")
|
|
6394
6399
|
return;
|
|
6395
|
-
const
|
|
6396
|
-
i && !
|
|
6400
|
+
const l = this.ctx.database.getReadonly(o, r);
|
|
6401
|
+
i && !l && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = i, this.startEditByInput(this.cellTarget, t), this.ctx.emit("startEdit", this.cellTarget));
|
|
6397
6402
|
}
|
|
6398
6403
|
editCell(t, e) {
|
|
6399
|
-
const i = this.ctx.body.renderRows.find((
|
|
6404
|
+
const i = this.ctx.body.renderRows.find((h) => h.rowIndex === t);
|
|
6400
6405
|
if (!i)
|
|
6401
6406
|
return;
|
|
6402
|
-
const s = i.cells.find((
|
|
6407
|
+
const s = i.cells.find((h) => h.colIndex === e);
|
|
6403
6408
|
if (!s)
|
|
6404
6409
|
return;
|
|
6405
6410
|
this.ctx.emit("setSelectorCell", s);
|
|
6406
6411
|
const o = this.ctx.focusCell;
|
|
6407
6412
|
if (!o || ["index", "index-selection", "selection"].includes(o.type) || this.enable)
|
|
6408
6413
|
return;
|
|
6409
|
-
const { rowKey: r, key: a } = o,
|
|
6410
|
-
o && !
|
|
6414
|
+
const { rowKey: r, key: a } = o, l = this.ctx.database.getReadonly(r, a);
|
|
6415
|
+
o && !l && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = o, this.startEditByInput(this.cellTarget), this.ctx.emit("startEdit", this.cellTarget));
|
|
6411
6416
|
}
|
|
6412
6417
|
doneEdit() {
|
|
6413
6418
|
this.enable && (this.doneEditByInput(), this.ctx.emit("doneEdit", this.cellTarget), this.enable = !1, this.ctx.editing = !1, this.ctx.containerElement.focus({ preventScroll: !0 }), this.editorEl.style.display = "none", this.ctx.emit("draw"));
|
|
@@ -6420,43 +6425,43 @@ class Ei {
|
|
|
6420
6425
|
(t = this.editorEl) == null || t.remove();
|
|
6421
6426
|
}
|
|
6422
6427
|
}
|
|
6423
|
-
class
|
|
6428
|
+
let Ci = class {
|
|
6424
6429
|
constructor(t) {
|
|
6425
6430
|
n(this, "ctx");
|
|
6426
6431
|
n(this, "emptyEl");
|
|
6427
6432
|
this.ctx = t;
|
|
6428
6433
|
const { EMPTY_TEXT: e, EMPTY_CUSTOM_STYLE: i } = this.ctx.config;
|
|
6429
6434
|
this.ctx.emptyElement ? this.emptyEl = this.ctx.emptyElement : (this.emptyEl = document.createElement("div"), this.emptyEl.innerText = e), this.emptyEl.className = "e-virt-table-empty", this.emptyEl.style.display = "none", this.ctx.containerElement.appendChild(this.emptyEl), this.ctx.on("emptyChange", ({ type: s, headerHeight: o, bodyHeight: r, footerHeight: a }) => {
|
|
6430
|
-
const
|
|
6435
|
+
const l = o + (r + a) / 2, h = {
|
|
6431
6436
|
display: s === "empty" ? "block" : "none",
|
|
6432
6437
|
position: "absolute",
|
|
6433
6438
|
fontSize: "14px",
|
|
6434
6439
|
color: "#666",
|
|
6435
6440
|
left: "50%",
|
|
6436
|
-
top: `${
|
|
6441
|
+
top: `${l}px`,
|
|
6437
6442
|
transform: "translate(-50%, -50%)",
|
|
6438
6443
|
...i
|
|
6439
6444
|
};
|
|
6440
|
-
Object.assign(this.emptyEl.style,
|
|
6445
|
+
Object.assign(this.emptyEl.style, h);
|
|
6441
6446
|
});
|
|
6442
6447
|
}
|
|
6443
6448
|
destroy() {
|
|
6444
6449
|
this.emptyEl.remove();
|
|
6445
6450
|
}
|
|
6446
|
-
}
|
|
6447
|
-
class
|
|
6451
|
+
};
|
|
6452
|
+
class bi {
|
|
6448
6453
|
constructor(t) {
|
|
6449
6454
|
n(this, "ctx");
|
|
6450
6455
|
n(this, "observer");
|
|
6451
6456
|
this.ctx = t, this.observer = new MutationObserver(
|
|
6452
|
-
|
|
6457
|
+
j(() => {
|
|
6453
6458
|
const e = this.ctx.overlayerElement.querySelectorAll('[data-auto-height="true"]'), i = /* @__PURE__ */ new Map();
|
|
6454
6459
|
e.forEach((r) => {
|
|
6455
|
-
const a = Number(r.getAttribute("data-row-index")),
|
|
6456
|
-
if (isNaN(a) || isNaN(
|
|
6460
|
+
const a = Number(r.getAttribute("data-row-index")), l = Number(r.getAttribute("data-col-index"));
|
|
6461
|
+
if (isNaN(a) || isNaN(l) || !(r instanceof HTMLElement) || r.offsetWidth === 0)
|
|
6457
6462
|
return;
|
|
6458
|
-
const
|
|
6459
|
-
i.set(
|
|
6463
|
+
const h = `${a}_${l}`;
|
|
6464
|
+
i.set(h, Math.round(r.offsetHeight));
|
|
6460
6465
|
});
|
|
6461
6466
|
const s = this.ctx.database.getOverlayerAutoHeightMap();
|
|
6462
6467
|
if (!this.arerMapsEqual(s, i)) {
|
|
@@ -6497,9 +6502,9 @@ class Ci {
|
|
|
6497
6502
|
fixedRightWidth: e,
|
|
6498
6503
|
config: { SCROLLER_TRACK_SIZE: i, CSS_PREFIX: s }
|
|
6499
6504
|
} = this.ctx, { visibleWidth: o, visibleHeight: r, renderCellHeaders: a } = this.ctx.header;
|
|
6500
|
-
let
|
|
6505
|
+
let l = [], h = [], d = [];
|
|
6501
6506
|
a.forEach((g) => {
|
|
6502
|
-
g.render && (g.fixed === "left" ?
|
|
6507
|
+
g.render && (g.fixed === "left" ? h.push(g) : g.fixed === "right" ? d.push(g) : l.push(g));
|
|
6503
6508
|
});
|
|
6504
6509
|
const f = e - i, u = {
|
|
6505
6510
|
key: "left",
|
|
@@ -6511,7 +6516,7 @@ class Ci {
|
|
|
6511
6516
|
width: `${t}px`,
|
|
6512
6517
|
height: `${r}px`
|
|
6513
6518
|
},
|
|
6514
|
-
cells:
|
|
6519
|
+
cells: h
|
|
6515
6520
|
}, x = {
|
|
6516
6521
|
key: "center",
|
|
6517
6522
|
style: {
|
|
@@ -6522,7 +6527,7 @@ class Ci {
|
|
|
6522
6527
|
width: `${o - t - f + 1}px`,
|
|
6523
6528
|
height: `${r}px`
|
|
6524
6529
|
},
|
|
6525
|
-
cells:
|
|
6530
|
+
cells: l
|
|
6526
6531
|
}, w = {
|
|
6527
6532
|
key: "right",
|
|
6528
6533
|
style: {
|
|
@@ -6551,15 +6556,15 @@ class Ci {
|
|
|
6551
6556
|
const t = [], e = [], i = [];
|
|
6552
6557
|
let s = this.ctx.body.renderRows;
|
|
6553
6558
|
this.ctx.config.FOOTER_FIXED || (s = s.concat(this.ctx.footer.renderRows)), s.forEach((g) => {
|
|
6554
|
-
g.cells.forEach((
|
|
6555
|
-
|
|
6559
|
+
g.cells.forEach((m) => {
|
|
6560
|
+
m.cellType === "footer" && (m.render = m.renderFooter), m.render && (m.fixed === "left" ? e.push(m) : m.fixed === "right" ? i.push(m) : t.push(m));
|
|
6556
6561
|
});
|
|
6557
6562
|
});
|
|
6558
6563
|
const {
|
|
6559
6564
|
fixedLeftWidth: o,
|
|
6560
6565
|
fixedRightWidth: r,
|
|
6561
|
-
config: { SCROLLER_TRACK_SIZE: a, CSS_PREFIX:
|
|
6562
|
-
} = this.ctx, { visibleWidth:
|
|
6566
|
+
config: { SCROLLER_TRACK_SIZE: a, CSS_PREFIX: l }
|
|
6567
|
+
} = this.ctx, { visibleWidth: h, visibleHeight: d } = this.ctx.body, f = r - a, u = {
|
|
6563
6568
|
key: "left",
|
|
6564
6569
|
style: {
|
|
6565
6570
|
position: "absolute",
|
|
@@ -6577,7 +6582,7 @@ class Ci {
|
|
|
6577
6582
|
top: `${0.5}px`,
|
|
6578
6583
|
left: `${o - 0.5}px`,
|
|
6579
6584
|
overflow: "hidden",
|
|
6580
|
-
width: `${
|
|
6585
|
+
width: `${h - o - f}px`,
|
|
6581
6586
|
height: `${d}px`
|
|
6582
6587
|
},
|
|
6583
6588
|
cells: t
|
|
@@ -6595,11 +6600,11 @@ class Ci {
|
|
|
6595
6600
|
};
|
|
6596
6601
|
return {
|
|
6597
6602
|
type: "body",
|
|
6598
|
-
class: `${
|
|
6603
|
+
class: `${l}-overlayer-body`,
|
|
6599
6604
|
style: {
|
|
6600
6605
|
position: "relative",
|
|
6601
6606
|
overflow: "hidden",
|
|
6602
|
-
width: `${
|
|
6607
|
+
width: `${h}px`,
|
|
6603
6608
|
height: `${d}px`
|
|
6604
6609
|
},
|
|
6605
6610
|
views: [u, x, w]
|
|
@@ -6607,8 +6612,8 @@ class Ci {
|
|
|
6607
6612
|
}
|
|
6608
6613
|
getFooter() {
|
|
6609
6614
|
const t = [], e = [], i = [];
|
|
6610
|
-
this.ctx.footer.renderRows.forEach((
|
|
6611
|
-
|
|
6615
|
+
this.ctx.footer.renderRows.forEach((E) => {
|
|
6616
|
+
E.cells.forEach((g) => {
|
|
6612
6617
|
g.cellType === "footer" && g.renderFooter && (g.render = g.renderFooter, g.fixed === "left" ? e.push(g) : g.fixed === "right" ? i.push(g) : t.push(g));
|
|
6613
6618
|
});
|
|
6614
6619
|
});
|
|
@@ -6616,7 +6621,7 @@ class Ci {
|
|
|
6616
6621
|
fixedLeftWidth: s,
|
|
6617
6622
|
fixedRightWidth: o,
|
|
6618
6623
|
config: { SCROLLER_TRACK_SIZE: r, CSS_PREFIX: a }
|
|
6619
|
-
} = this.ctx, { visibleWidth:
|
|
6624
|
+
} = this.ctx, { visibleWidth: l, visibleHeight: h } = this.ctx.footer, d = o - r, f = {
|
|
6620
6625
|
key: "left",
|
|
6621
6626
|
style: {
|
|
6622
6627
|
position: "absolute",
|
|
@@ -6624,7 +6629,7 @@ class Ci {
|
|
|
6624
6629
|
left: `${0.5}px`,
|
|
6625
6630
|
overflow: "hidden",
|
|
6626
6631
|
width: `${s}px`,
|
|
6627
|
-
height: `${
|
|
6632
|
+
height: `${h}px`
|
|
6628
6633
|
},
|
|
6629
6634
|
cells: e
|
|
6630
6635
|
}, u = {
|
|
@@ -6634,8 +6639,8 @@ class Ci {
|
|
|
6634
6639
|
top: `${0.5}px`,
|
|
6635
6640
|
left: `${s - 0.5}px`,
|
|
6636
6641
|
overflow: "hidden",
|
|
6637
|
-
width: `${
|
|
6638
|
-
height: `${
|
|
6642
|
+
width: `${l - s - d}px`,
|
|
6643
|
+
height: `${h}px`
|
|
6639
6644
|
},
|
|
6640
6645
|
cells: t
|
|
6641
6646
|
}, x = {
|
|
@@ -6646,7 +6651,7 @@ class Ci {
|
|
|
6646
6651
|
right: `${0.5}px`,
|
|
6647
6652
|
overflow: "hidden",
|
|
6648
6653
|
width: `${d}px`,
|
|
6649
|
-
height: `${
|
|
6654
|
+
height: `${h}px`
|
|
6650
6655
|
},
|
|
6651
6656
|
cells: i
|
|
6652
6657
|
};
|
|
@@ -6656,14 +6661,14 @@ class Ci {
|
|
|
6656
6661
|
style: {
|
|
6657
6662
|
position: "relative",
|
|
6658
6663
|
overflow: "hidden",
|
|
6659
|
-
width: `${
|
|
6660
|
-
height: `${
|
|
6664
|
+
width: `${l}px`,
|
|
6665
|
+
height: `${h}px`
|
|
6661
6666
|
},
|
|
6662
6667
|
views: [f, u, x]
|
|
6663
6668
|
};
|
|
6664
6669
|
}
|
|
6665
6670
|
}
|
|
6666
|
-
class
|
|
6671
|
+
class Ri {
|
|
6667
6672
|
constructor(t) {
|
|
6668
6673
|
n(this, "ctx");
|
|
6669
6674
|
n(this, "contextMenuEl");
|
|
@@ -6674,8 +6679,8 @@ class bi {
|
|
|
6674
6679
|
this.ctx.on("cellContextMenuClick", (t, e) => {
|
|
6675
6680
|
if (!this.ctx.config.ENABLE_CONTEXT_MENU) return;
|
|
6676
6681
|
e.preventDefault();
|
|
6677
|
-
const { xArr: i, yArr: s } = this.ctx.selector, [o, r] = i, [a,
|
|
6678
|
-
|
|
6682
|
+
const { xArr: i, yArr: s } = this.ctx.selector, [o, r] = i, [a, l] = s, { rowIndex: h, colIndex: d } = t;
|
|
6683
|
+
h >= a && h <= l && d >= o && d <= r || this.ctx.emit("setSelectorCell", t, e);
|
|
6679
6684
|
const u = {
|
|
6680
6685
|
getBoundingClientRect: () => ({
|
|
6681
6686
|
width: 0,
|
|
@@ -6689,9 +6694,9 @@ class bi {
|
|
|
6689
6694
|
}),
|
|
6690
6695
|
contextElement: document.body
|
|
6691
6696
|
};
|
|
6692
|
-
|
|
6697
|
+
ie(u, this.contextMenuEl, {
|
|
6693
6698
|
placement: "right-start",
|
|
6694
|
-
middleware: [
|
|
6699
|
+
middleware: [Qt(), te(), ee()]
|
|
6695
6700
|
}).then(({ x, y: w }) => {
|
|
6696
6701
|
this.show(x, w);
|
|
6697
6702
|
});
|
|
@@ -6749,7 +6754,37 @@ class bi {
|
|
|
6749
6754
|
this.contextMenuEl.remove();
|
|
6750
6755
|
}
|
|
6751
6756
|
}
|
|
6752
|
-
class
|
|
6757
|
+
class Ii {
|
|
6758
|
+
constructor(t) {
|
|
6759
|
+
n(this, "ctx");
|
|
6760
|
+
n(this, "loadingEl");
|
|
6761
|
+
if (this.ctx = t, this.ctx.loadingElement)
|
|
6762
|
+
this.loadingEl = this.ctx.loadingElement;
|
|
6763
|
+
else {
|
|
6764
|
+
this.loadingEl = document.createElement("div");
|
|
6765
|
+
const e = document.createElement("div");
|
|
6766
|
+
e.className = "e-virt-table-loading-spinner";
|
|
6767
|
+
const i = this.ctx.icons.getSvg("loading");
|
|
6768
|
+
if (i) {
|
|
6769
|
+
const a = new DOMParser().parseFromString(i.svg, "image/svg+xml").documentElement;
|
|
6770
|
+
e.appendChild(a);
|
|
6771
|
+
}
|
|
6772
|
+
const s = document.createElement("p");
|
|
6773
|
+
s.className = "e-virt-table-loading-text", s.innerText = this.ctx.config.LOADING_TEXT, e.appendChild(s), this.loadingEl.appendChild(e);
|
|
6774
|
+
}
|
|
6775
|
+
this.loadingEl.className = "e-virt-table-loading", this.loadingEl.style.display = "none", this.ctx.containerElement.appendChild(this.loadingEl);
|
|
6776
|
+
}
|
|
6777
|
+
show() {
|
|
6778
|
+
this.loadingEl.style.display = "flex";
|
|
6779
|
+
}
|
|
6780
|
+
hide() {
|
|
6781
|
+
this.loadingEl.style.display = "none";
|
|
6782
|
+
}
|
|
6783
|
+
destroy() {
|
|
6784
|
+
this.loadingEl.remove();
|
|
6785
|
+
}
|
|
6786
|
+
}
|
|
6787
|
+
class Ti {
|
|
6753
6788
|
constructor(t, e) {
|
|
6754
6789
|
n(this, "options");
|
|
6755
6790
|
n(this, "scroller");
|
|
@@ -6763,6 +6798,7 @@ class vi {
|
|
|
6763
6798
|
n(this, "empty");
|
|
6764
6799
|
n(this, "overlayer");
|
|
6765
6800
|
n(this, "contextMenu");
|
|
6801
|
+
n(this, "loading");
|
|
6766
6802
|
n(this, "ctx");
|
|
6767
6803
|
this.options = e;
|
|
6768
6804
|
const { overlayerElement: i, editorElement: s, emptyElement: o, contextMenuElement: r } = this.options, a = this.createContainer(
|
|
@@ -6772,9 +6808,9 @@ class vi {
|
|
|
6772
6808
|
o,
|
|
6773
6809
|
r
|
|
6774
6810
|
);
|
|
6775
|
-
this.ctx = new
|
|
6811
|
+
this.ctx = new Ie(a, this.options), this.header = new _e(this.ctx), this.footer = new Te(this.ctx), this.body = new ve(this.ctx), this.scroller = new Se(this.ctx), this.selector = new Oe(this.ctx), this.autofill = new Le(this.ctx), this.tooltip = new pi(this.ctx), this.empty = new Ci(this.ctx), this.editor = new yi(this.ctx), this.overlayer = new bi(this.ctx), this.contextMenu = new Ri(this.ctx), this.loading = new Ii(this.ctx), this.ctx.on(
|
|
6776
6812
|
"draw",
|
|
6777
|
-
|
|
6813
|
+
j(
|
|
6778
6814
|
() => {
|
|
6779
6815
|
this.draw();
|
|
6780
6816
|
},
|
|
@@ -6782,7 +6818,7 @@ class vi {
|
|
|
6782
6818
|
)
|
|
6783
6819
|
), this.ctx.on(
|
|
6784
6820
|
"drawView",
|
|
6785
|
-
|
|
6821
|
+
j(
|
|
6786
6822
|
() => {
|
|
6787
6823
|
this.draw(!0);
|
|
6788
6824
|
},
|
|
@@ -6792,17 +6828,17 @@ class vi {
|
|
|
6792
6828
|
}
|
|
6793
6829
|
createContainer(t, e, i, s, o) {
|
|
6794
6830
|
t.className = "e-virt-table-container";
|
|
6795
|
-
const r = document.createElement("div"), a = document.createElement("canvas"),
|
|
6796
|
-
r.className = "e-virt-table-stage", t.tabIndex = 0, a.className = "e-virt-table-canvas",
|
|
6797
|
-
const
|
|
6798
|
-
|
|
6831
|
+
const r = document.createElement("div"), a = document.createElement("canvas"), l = e || document.createElement("div");
|
|
6832
|
+
r.className = "e-virt-table-stage", t.tabIndex = 0, a.className = "e-virt-table-canvas", l.className = "e-virt-table-overlayer";
|
|
6833
|
+
const h = i || document.createElement("div");
|
|
6834
|
+
h.className = "e-virt-table-editor";
|
|
6799
6835
|
const d = s, f = o;
|
|
6800
|
-
return r.appendChild(a), r.appendChild(
|
|
6836
|
+
return r.appendChild(a), r.appendChild(l), t.appendChild(r), {
|
|
6801
6837
|
containerElement: t,
|
|
6802
6838
|
stageElement: r,
|
|
6803
6839
|
canvasElement: a,
|
|
6804
|
-
overlayerElement:
|
|
6805
|
-
editorElement:
|
|
6840
|
+
overlayerElement: l,
|
|
6841
|
+
editorElement: h,
|
|
6806
6842
|
emptyElement: d,
|
|
6807
6843
|
contextMenuElement: f
|
|
6808
6844
|
};
|
|
@@ -6830,7 +6866,7 @@ class vi {
|
|
|
6830
6866
|
this.ctx.database.setFooterData(t), this.ctx.emit("draw");
|
|
6831
6867
|
}
|
|
6832
6868
|
setLoading(t) {
|
|
6833
|
-
this.ctx.
|
|
6869
|
+
this.ctx.loading = t, t ? this.loading.show() : this.loading.hide();
|
|
6834
6870
|
}
|
|
6835
6871
|
on(t, e) {
|
|
6836
6872
|
this.ctx.on(t, e);
|
|
@@ -6894,15 +6930,15 @@ class vi {
|
|
|
6894
6930
|
return new Promise(async (i, s) => {
|
|
6895
6931
|
let o = [];
|
|
6896
6932
|
for (let r = 0; r < t.length; r++) {
|
|
6897
|
-
const { rowKey: a, key:
|
|
6898
|
-
Array.isArray(
|
|
6933
|
+
const { rowKey: a, key: l } = t[r], h = await this.ctx.database.getValidator(a, l);
|
|
6934
|
+
Array.isArray(h) && h.length && o.push(h);
|
|
6899
6935
|
}
|
|
6900
6936
|
if (o.length) {
|
|
6901
6937
|
if (s(o), e) {
|
|
6902
6938
|
const [r] = o;
|
|
6903
6939
|
if (Array.isArray(r) && r.length) {
|
|
6904
|
-
const [a] = r, { rowKey:
|
|
6905
|
-
this.scrollToRowkey(
|
|
6940
|
+
const [a] = r, { rowKey: l, key: h } = a;
|
|
6941
|
+
this.scrollToRowkey(l), this.scrollToColkey(h);
|
|
6906
6942
|
}
|
|
6907
6943
|
}
|
|
6908
6944
|
this.ctx.emit("draw");
|
|
@@ -6919,12 +6955,12 @@ class vi {
|
|
|
6919
6955
|
if (t && Array.isArray(s) && s.length) {
|
|
6920
6956
|
const [o] = s;
|
|
6921
6957
|
if (Array.isArray(o) && o.length) {
|
|
6922
|
-
const [r] = o, { rowKey: a, key:
|
|
6923
|
-
if (
|
|
6924
|
-
const { parentRowKeys: d = [] } =
|
|
6958
|
+
const [r] = o, { rowKey: a, key: l } = r, h = this.ctx.database.getRowForRowKey(a);
|
|
6959
|
+
if (h) {
|
|
6960
|
+
const { parentRowKeys: d = [] } = h;
|
|
6925
6961
|
d && d.length && this.setExpandRowKeys(d, !0);
|
|
6926
6962
|
}
|
|
6927
|
-
this.scrollToRowkey(a), this.scrollToColkey(
|
|
6963
|
+
this.scrollToRowkey(a), this.scrollToColkey(l);
|
|
6928
6964
|
}
|
|
6929
6965
|
}
|
|
6930
6966
|
i(s);
|
|
@@ -6949,7 +6985,7 @@ class vi {
|
|
|
6949
6985
|
let o = [];
|
|
6950
6986
|
for (let r = 0; r < i.length; r++)
|
|
6951
6987
|
for (let a = 0; a < s.length; a++) {
|
|
6952
|
-
const
|
|
6988
|
+
const l = this.ctx.database.getRowKeyByItem(i[r]), d = s[a].key, f = await this.ctx.database.getValidator(l, d);
|
|
6953
6989
|
Array.isArray(f) && f.length && o.push(f);
|
|
6954
6990
|
}
|
|
6955
6991
|
o.length ? (e(o), this.ctx.emit("draw")) : (t([]), this.ctx.emit("draw"));
|
|
@@ -7032,10 +7068,10 @@ class vi {
|
|
|
7032
7068
|
}
|
|
7033
7069
|
getUtils() {
|
|
7034
7070
|
return {
|
|
7035
|
-
mergeColCell:
|
|
7036
|
-
mergeRowCell:
|
|
7037
|
-
getSpanArrByRow:
|
|
7038
|
-
getSpanObjByColumn:
|
|
7071
|
+
mergeColCell: fe,
|
|
7072
|
+
mergeRowCell: de,
|
|
7073
|
+
getSpanArrByRow: Xt,
|
|
7074
|
+
getSpanObjByColumn: Yt
|
|
7039
7075
|
};
|
|
7040
7076
|
}
|
|
7041
7077
|
getColumnByKey(t) {
|
|
@@ -7046,10 +7082,10 @@ class vi {
|
|
|
7046
7082
|
* 销毁
|
|
7047
7083
|
*/
|
|
7048
7084
|
destroy() {
|
|
7049
|
-
this.overlayer.destroy(), this.empty.destroy(), this.editor.destroy(), this.tooltip.destroy(), this.selector.destroy(), this.autofill.destroy(), this.contextMenu.destroy(), this.ctx.destroy(), this.ctx.containerElement.remove();
|
|
7085
|
+
this.overlayer.destroy(), this.empty.destroy(), this.editor.destroy(), this.tooltip.destroy(), this.selector.destroy(), this.autofill.destroy(), this.contextMenu.destroy(), this.loading.destroy(), this.ctx.destroy(), this.ctx.containerElement.remove();
|
|
7050
7086
|
}
|
|
7051
7087
|
}
|
|
7052
7088
|
export {
|
|
7053
|
-
|
|
7089
|
+
Ti as default
|
|
7054
7090
|
};
|
|
7055
7091
|
//# sourceMappingURL=index.es.js.map
|