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