e-virt-table 0.0.19 → 0.0.20
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 +6 -8
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +681 -727
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +6 -8
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/Editor.js +17 -70
- package/dist/lib/Editor.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(':root{--e-virt-table-color-white: #fff;--e-virt-table-color-black: #000000;--e-virt-table-color-primary: rgb(82, 146, 247);--e-virt-table-text-color-primary: "#333";--e-virt-table-text-color-regular: "#666";--e-virt-table-text-color-secondary: "#999";--e-virt-table-box-shadow: 0 2px 12px 0 #0000001a;--e-virt-table-editor-bg-color: #fff}.e-virt-table-editor{position:absolute;top:-10000px;left:-10000px;text-align:left;line-height:0;z-index:100;overflow:hidden;background-color:var(--e-virt-table-editor-bg-color);border:2px solid var(--e-virt-table-color-primary);box-sizing:border-box;box-shadow:var(--e-virt-table-box-shadow);pointer-events:auto;display:flex;align-items:center}.e-virt-table-context-menu{position:absolute;font-size:14px;color:var(--e-virt-table-text-color-regular);background-color:var(--e-virt-table-color-white);border-radius:4px;border:1px solid #e4e7ed;box-shadow:var(--e-virt-table-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}.e-virt-table-context-menu-item:hover{color:var(--e-virt-table-color-primary);background-color:#f5f7fa}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(':root{--e-virt-table-color-white: #fff;--e-virt-table-color-black: #000000;--e-virt-table-color-primary: rgb(82, 146, 247);--e-virt-table-text-color-primary: "#333";--e-virt-table-text-color-regular: "#666";--e-virt-table-text-color-secondary: "#999";--e-virt-table-box-shadow: 0 2px 12px 0 #0000001a;--e-virt-table-editor-bg-color: #fff}.e-virt-table-editor{position:absolute;top:-10000px;left:-10000px;text-align:left;line-height:0;z-index:100;overflow:hidden;background-color:var(--e-virt-table-editor-bg-color);border:2px solid var(--e-virt-table-color-primary);box-sizing:border-box;box-shadow:var(--e-virt-table-box-shadow);pointer-events:auto;display:flex;align-items:center}.e-virt-table-editor-textarea{width:100%;box-sizing:border-box;padding:8px;outline:none;font-weight:400;font-size:12px;color:inherit;white-space:normal;word-wrap:break-word;word-break:break-all;line-height:18px;margin:0;border:none;background:var(--e-virt-table-color-white);overflow:hidden;cursor:text}.e-virt-table-context-menu{position:absolute;font-size:14px;color:var(--e-virt-table-text-color-regular);background-color:var(--e-virt-table-color-white);border-radius:4px;border:1px solid #e4e7ed;box-shadow:var(--e-virt-table-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}.e-virt-table-context-menu-item:hover{color:var(--e-virt-table-color-primary);background-color:#f5f7fa}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
2
|
var me = Object.defineProperty;
|
|
3
3
|
var Ee = (a, t, e) => t in a ? me(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
|
|
4
4
|
var c = (a, t, e) => Ee(a, typeof t != "symbol" ? t + "" : t, e);
|
|
@@ -36,11 +36,11 @@ function be() {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
function dt(a, t, e) {
|
|
39
|
-
return be() ? dt = Reflect.construct.bind() : dt = function(s,
|
|
39
|
+
return be() ? dt = Reflect.construct.bind() : dt = function(s, r, o) {
|
|
40
40
|
var n = [null];
|
|
41
|
-
n.push.apply(n,
|
|
41
|
+
n.push.apply(n, r);
|
|
42
42
|
var l = Function.bind.apply(s, n), h = new l();
|
|
43
|
-
return
|
|
43
|
+
return o && st(h, o.prototype), h;
|
|
44
44
|
}, dt.apply(null, arguments);
|
|
45
45
|
}
|
|
46
46
|
function ve(a) {
|
|
@@ -87,14 +87,14 @@ function bt(a) {
|
|
|
87
87
|
function M(a) {
|
|
88
88
|
for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), i = 1; i < t; i++)
|
|
89
89
|
e[i - 1] = arguments[i];
|
|
90
|
-
var s = 0,
|
|
90
|
+
var s = 0, r = e.length;
|
|
91
91
|
if (typeof a == "function")
|
|
92
92
|
return a.apply(null, e);
|
|
93
93
|
if (typeof a == "string") {
|
|
94
|
-
var
|
|
94
|
+
var o = a.replace(Re, function(n) {
|
|
95
95
|
if (n === "%%")
|
|
96
96
|
return "%";
|
|
97
|
-
if (s >=
|
|
97
|
+
if (s >= r)
|
|
98
98
|
return n;
|
|
99
99
|
switch (n) {
|
|
100
100
|
case "%s":
|
|
@@ -112,7 +112,7 @@ function M(a) {
|
|
|
112
112
|
return n;
|
|
113
113
|
}
|
|
114
114
|
});
|
|
115
|
-
return
|
|
115
|
+
return o;
|
|
116
116
|
}
|
|
117
117
|
return a;
|
|
118
118
|
}
|
|
@@ -123,25 +123,25 @@ function _(a, t) {
|
|
|
123
123
|
return !!(a == null || t === "array" && Array.isArray(a) && !a.length || _e(t) && typeof a == "string" && !a);
|
|
124
124
|
}
|
|
125
125
|
function Ie(a, t, e) {
|
|
126
|
-
var i = [], s = 0,
|
|
127
|
-
function
|
|
128
|
-
i.push.apply(i, n || []), s++, s ===
|
|
126
|
+
var i = [], s = 0, r = a.length;
|
|
127
|
+
function o(n) {
|
|
128
|
+
i.push.apply(i, n || []), s++, s === r && e(i);
|
|
129
129
|
}
|
|
130
130
|
a.forEach(function(n) {
|
|
131
|
-
t(n,
|
|
131
|
+
t(n, o);
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
134
|
function Ft(a, t, e) {
|
|
135
135
|
var i = 0, s = a.length;
|
|
136
|
-
function o
|
|
137
|
-
if (
|
|
138
|
-
e(
|
|
136
|
+
function r(o) {
|
|
137
|
+
if (o && o.length) {
|
|
138
|
+
e(o);
|
|
139
139
|
return;
|
|
140
140
|
}
|
|
141
141
|
var n = i;
|
|
142
|
-
i = i + 1, n < s ? t(a[n],
|
|
142
|
+
i = i + 1, n < s ? t(a[n], r) : e([]);
|
|
143
143
|
}
|
|
144
|
-
|
|
144
|
+
r([]);
|
|
145
145
|
}
|
|
146
146
|
function Oe(a) {
|
|
147
147
|
var t = [];
|
|
@@ -159,24 +159,24 @@ var kt = /* @__PURE__ */ function(a) {
|
|
|
159
159
|
}(/* @__PURE__ */ Ct(Error));
|
|
160
160
|
function Se(a, t, e, i, s) {
|
|
161
161
|
if (t.first) {
|
|
162
|
-
var
|
|
162
|
+
var r = new Promise(function(x, u) {
|
|
163
163
|
var p = function(y) {
|
|
164
164
|
return i(y), y.length ? u(new kt(y, bt(y))) : x(s);
|
|
165
165
|
}, g = Oe(a);
|
|
166
166
|
Ft(g, e, p);
|
|
167
167
|
});
|
|
168
|
-
return
|
|
168
|
+
return r.catch(function(x) {
|
|
169
169
|
return x;
|
|
170
|
-
}),
|
|
170
|
+
}), r;
|
|
171
171
|
}
|
|
172
|
-
var
|
|
172
|
+
var o = t.firstFields === !0 ? Object.keys(a) : t.firstFields || [], n = Object.keys(a), l = n.length, h = 0, f = [], d = new Promise(function(x, u) {
|
|
173
173
|
var p = function(w) {
|
|
174
174
|
if (f.push.apply(f, w), h++, h === l)
|
|
175
175
|
return i(f), f.length ? u(new kt(f, bt(f))) : x(s);
|
|
176
176
|
};
|
|
177
177
|
n.length || (i(f), x(s)), n.forEach(function(g) {
|
|
178
178
|
var w = a[g];
|
|
179
|
-
|
|
179
|
+
o.indexOf(g) !== -1 ? Ft(w, e, p) : Ie(w, e, p);
|
|
180
180
|
});
|
|
181
181
|
});
|
|
182
182
|
return d.catch(function(x) {
|
|
@@ -214,10 +214,10 @@ function Yt(a, t) {
|
|
|
214
214
|
}
|
|
215
215
|
return a;
|
|
216
216
|
}
|
|
217
|
-
var Ut = function(t, e, i, s,
|
|
218
|
-
t.required && (!i.hasOwnProperty(t.field) || _(e,
|
|
219
|
-
}, Le = function(t, e, i, s,
|
|
220
|
-
(/^\s+$/.test(e) || e === "") && s.push(M(
|
|
217
|
+
var Ut = function(t, e, i, s, r, o) {
|
|
218
|
+
t.required && (!i.hasOwnProperty(t.field) || _(e, o || t.type)) && s.push(M(r.messages.required, t.fullField));
|
|
219
|
+
}, Le = function(t, e, i, s, r) {
|
|
220
|
+
(/^\s+$/.test(e) || e === "") && s.push(M(r.messages.whitespace, t.fullField));
|
|
221
221
|
}, ht, Me = function() {
|
|
222
222
|
if (ht)
|
|
223
223
|
return ht;
|
|
@@ -234,11 +234,11 @@ var Ut = function(t, e, i, s, o, r) {
|
|
|
234
234
|
(?:` + i + ":){1}(?:(?::" + i + "){0,4}:" + e + "|(?::" + i + `){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
|
|
235
235
|
(?::(?:(?::` + i + "){0,5}:" + e + "|(?::" + i + `){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
|
|
236
236
|
)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
|
|
237
|
-
`).replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(),
|
|
238
|
-
return E && E.exact ?
|
|
237
|
+
`).replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(), r = new RegExp("(?:^" + e + "$)|(?:^" + s + "$)"), o = new RegExp("^" + e + "$"), n = new RegExp("^" + s + "$"), l = function(E) {
|
|
238
|
+
return E && E.exact ? r : new RegExp("(?:" + t(E) + e + t(E) + ")|(?:" + t(E) + s + t(E) + ")", "g");
|
|
239
239
|
};
|
|
240
240
|
l.v4 = function(m) {
|
|
241
|
-
return m && m.exact ?
|
|
241
|
+
return m && m.exact ? o : new RegExp("" + t(m) + e + t(m), "g");
|
|
242
242
|
}, l.v6 = function(m) {
|
|
243
243
|
return m && m.exact ? n : new RegExp("" + t(m) + s + t(m), "g");
|
|
244
244
|
};
|
|
@@ -292,27 +292,27 @@ var Ut = function(t, e, i, s, o, r) {
|
|
|
292
292
|
hex: function(t) {
|
|
293
293
|
return typeof t == "string" && !!t.match(Kt.hex);
|
|
294
294
|
}
|
|
295
|
-
}, He = function(t, e, i, s,
|
|
295
|
+
}, He = function(t, e, i, s, r) {
|
|
296
296
|
if (t.required && e === void 0) {
|
|
297
|
-
Ut(t, e, i, s,
|
|
297
|
+
Ut(t, e, i, s, r);
|
|
298
298
|
return;
|
|
299
299
|
}
|
|
300
|
-
var
|
|
301
|
-
|
|
302
|
-
}, De = function(t, e, i, s,
|
|
303
|
-
var
|
|
300
|
+
var o = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"], n = t.type;
|
|
301
|
+
o.indexOf(n) > -1 ? et[n](e) || s.push(M(r.messages.types[n], t.fullField, t.type)) : n && typeof e !== t.type && s.push(M(r.messages.types[n], t.fullField, t.type));
|
|
302
|
+
}, De = function(t, e, i, s, r) {
|
|
303
|
+
var o = typeof t.len == "number", n = typeof t.min == "number", l = typeof t.max == "number", h = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, f = e, d = null, x = typeof e == "number", u = typeof e == "string", p = Array.isArray(e);
|
|
304
304
|
if (x ? d = "number" : u ? d = "string" : p && (d = "array"), !d)
|
|
305
305
|
return !1;
|
|
306
|
-
p && (f = e.length), u && (f = e.replace(h, "_").length),
|
|
307
|
-
}, j = "enum", Xe = function(t, e, i, s,
|
|
308
|
-
t[j] = Array.isArray(t[j]) ? t[j] : [], t[j].indexOf(e) === -1 && s.push(M(
|
|
309
|
-
}, Fe = function(t, e, i, s,
|
|
306
|
+
p && (f = e.length), u && (f = e.replace(h, "_").length), o ? f !== t.len && s.push(M(r.messages[d].len, t.fullField, t.len)) : n && !l && f < t.min ? s.push(M(r.messages[d].min, t.fullField, t.min)) : l && !n && f > t.max ? s.push(M(r.messages[d].max, t.fullField, t.max)) : n && l && (f < t.min || f > t.max) && s.push(M(r.messages[d].range, t.fullField, t.min, t.max));
|
|
307
|
+
}, j = "enum", Xe = function(t, e, i, s, r) {
|
|
308
|
+
t[j] = Array.isArray(t[j]) ? t[j] : [], t[j].indexOf(e) === -1 && s.push(M(r.messages[j], t.fullField, t[j].join(", ")));
|
|
309
|
+
}, Fe = function(t, e, i, s, r) {
|
|
310
310
|
if (t.pattern) {
|
|
311
311
|
if (t.pattern instanceof RegExp)
|
|
312
|
-
t.pattern.lastIndex = 0, t.pattern.test(e) || s.push(M(
|
|
312
|
+
t.pattern.lastIndex = 0, t.pattern.test(e) || s.push(M(r.messages.pattern.mismatch, t.fullField, e, t.pattern));
|
|
313
313
|
else if (typeof t.pattern == "string") {
|
|
314
|
-
var
|
|
315
|
-
|
|
314
|
+
var o = new RegExp(t.pattern);
|
|
315
|
+
o.test(e) || s.push(M(r.messages.pattern.mismatch, t.fullField, e, t.pattern));
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
}, v = {
|
|
@@ -322,124 +322,124 @@ var Ut = function(t, e, i, s, o, r) {
|
|
|
322
322
|
range: De,
|
|
323
323
|
enum: Xe,
|
|
324
324
|
pattern: Fe
|
|
325
|
-
}, ke = function(t, e, i, s,
|
|
326
|
-
var
|
|
325
|
+
}, ke = function(t, e, i, s, r) {
|
|
326
|
+
var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
327
327
|
if (n) {
|
|
328
328
|
if (_(e, "string") && !t.required)
|
|
329
329
|
return i();
|
|
330
|
-
v.required(t, e, s,
|
|
330
|
+
v.required(t, e, s, o, r, "string"), _(e, "string") || (v.type(t, e, s, o, r), v.range(t, e, s, o, r), v.pattern(t, e, s, o, r), t.whitespace === !0 && v.whitespace(t, e, s, o, r));
|
|
331
331
|
}
|
|
332
|
-
i(
|
|
333
|
-
}, Ne = function(t, e, i, s,
|
|
334
|
-
var
|
|
332
|
+
i(o);
|
|
333
|
+
}, Ne = function(t, e, i, s, r) {
|
|
334
|
+
var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
335
335
|
if (n) {
|
|
336
336
|
if (_(e) && !t.required)
|
|
337
337
|
return i();
|
|
338
|
-
v.required(t, e, s,
|
|
338
|
+
v.required(t, e, s, o, r), e !== void 0 && v.type(t, e, s, o, r);
|
|
339
339
|
}
|
|
340
|
-
i(
|
|
341
|
-
}, Ye = function(t, e, i, s,
|
|
342
|
-
var
|
|
340
|
+
i(o);
|
|
341
|
+
}, Ye = function(t, e, i, s, r) {
|
|
342
|
+
var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
343
343
|
if (n) {
|
|
344
344
|
if (e === "" && (e = void 0), _(e) && !t.required)
|
|
345
345
|
return i();
|
|
346
|
-
v.required(t, e, s,
|
|
346
|
+
v.required(t, e, s, o, r), e !== void 0 && (v.type(t, e, s, o, r), v.range(t, e, s, o, r));
|
|
347
347
|
}
|
|
348
|
-
i(
|
|
349
|
-
}, Ke = function(t, e, i, s,
|
|
350
|
-
var
|
|
348
|
+
i(o);
|
|
349
|
+
}, Ke = function(t, e, i, s, r) {
|
|
350
|
+
var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
351
351
|
if (n) {
|
|
352
352
|
if (_(e) && !t.required)
|
|
353
353
|
return i();
|
|
354
|
-
v.required(t, e, s,
|
|
354
|
+
v.required(t, e, s, o, r), e !== void 0 && v.type(t, e, s, o, r);
|
|
355
355
|
}
|
|
356
|
-
i(
|
|
357
|
-
}, Be = function(t, e, i, s,
|
|
358
|
-
var
|
|
356
|
+
i(o);
|
|
357
|
+
}, Be = function(t, e, i, s, r) {
|
|
358
|
+
var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
359
359
|
if (n) {
|
|
360
360
|
if (_(e) && !t.required)
|
|
361
361
|
return i();
|
|
362
|
-
v.required(t, e, s,
|
|
362
|
+
v.required(t, e, s, o, r), _(e) || v.type(t, e, s, o, r);
|
|
363
363
|
}
|
|
364
|
-
i(
|
|
365
|
-
}, We = function(t, e, i, s,
|
|
366
|
-
var
|
|
364
|
+
i(o);
|
|
365
|
+
}, We = function(t, e, i, s, r) {
|
|
366
|
+
var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
367
367
|
if (n) {
|
|
368
368
|
if (_(e) && !t.required)
|
|
369
369
|
return i();
|
|
370
|
-
v.required(t, e, s,
|
|
370
|
+
v.required(t, e, s, o, r), e !== void 0 && (v.type(t, e, s, o, r), v.range(t, e, s, o, r));
|
|
371
371
|
}
|
|
372
|
-
i(
|
|
373
|
-
}, Pe = function(t, e, i, s,
|
|
374
|
-
var
|
|
372
|
+
i(o);
|
|
373
|
+
}, Pe = function(t, e, i, s, r) {
|
|
374
|
+
var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
375
375
|
if (n) {
|
|
376
376
|
if (_(e) && !t.required)
|
|
377
377
|
return i();
|
|
378
|
-
v.required(t, e, s,
|
|
378
|
+
v.required(t, e, s, o, r), e !== void 0 && (v.type(t, e, s, o, r), v.range(t, e, s, o, r));
|
|
379
379
|
}
|
|
380
|
-
i(
|
|
381
|
-
},
|
|
382
|
-
var
|
|
380
|
+
i(o);
|
|
381
|
+
}, Ve = function(t, e, i, s, r) {
|
|
382
|
+
var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
383
383
|
if (n) {
|
|
384
384
|
if (e == null && !t.required)
|
|
385
385
|
return i();
|
|
386
|
-
v.required(t, e, s,
|
|
386
|
+
v.required(t, e, s, o, r, "array"), e != null && (v.type(t, e, s, o, r), v.range(t, e, s, o, r));
|
|
387
387
|
}
|
|
388
|
-
i(
|
|
389
|
-
},
|
|
390
|
-
var
|
|
388
|
+
i(o);
|
|
389
|
+
}, ze = function(t, e, i, s, r) {
|
|
390
|
+
var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
391
391
|
if (n) {
|
|
392
392
|
if (_(e) && !t.required)
|
|
393
393
|
return i();
|
|
394
|
-
v.required(t, e, s,
|
|
394
|
+
v.required(t, e, s, o, r), e !== void 0 && v.type(t, e, s, o, r);
|
|
395
395
|
}
|
|
396
|
-
i(
|
|
397
|
-
}, $e = "enum", qe = function(t, e, i, s,
|
|
398
|
-
var
|
|
396
|
+
i(o);
|
|
397
|
+
}, $e = "enum", qe = function(t, e, i, s, r) {
|
|
398
|
+
var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
399
399
|
if (n) {
|
|
400
400
|
if (_(e) && !t.required)
|
|
401
401
|
return i();
|
|
402
|
-
v.required(t, e, s,
|
|
402
|
+
v.required(t, e, s, o, r), e !== void 0 && v[$e](t, e, s, o, r);
|
|
403
403
|
}
|
|
404
|
-
i(
|
|
405
|
-
}, Ge = function(t, e, i, s,
|
|
406
|
-
var
|
|
404
|
+
i(o);
|
|
405
|
+
}, Ge = function(t, e, i, s, r) {
|
|
406
|
+
var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
407
407
|
if (n) {
|
|
408
408
|
if (_(e, "string") && !t.required)
|
|
409
409
|
return i();
|
|
410
|
-
v.required(t, e, s,
|
|
410
|
+
v.required(t, e, s, o, r), _(e, "string") || v.pattern(t, e, s, o, r);
|
|
411
411
|
}
|
|
412
|
-
i(
|
|
413
|
-
}, je = function(t, e, i, s,
|
|
414
|
-
var
|
|
412
|
+
i(o);
|
|
413
|
+
}, je = function(t, e, i, s, r) {
|
|
414
|
+
var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
415
415
|
if (n) {
|
|
416
416
|
if (_(e, "date") && !t.required)
|
|
417
417
|
return i();
|
|
418
|
-
if (v.required(t, e, s,
|
|
418
|
+
if (v.required(t, e, s, o, r), !_(e, "date")) {
|
|
419
419
|
var l;
|
|
420
|
-
e instanceof Date ? l = e : l = new Date(e), v.type(t, l, s,
|
|
420
|
+
e instanceof Date ? l = e : l = new Date(e), v.type(t, l, s, o, r), l && v.range(t, l.getTime(), s, o, r);
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
|
-
i(
|
|
424
|
-
}, Ue = function(t, e, i, s,
|
|
425
|
-
var
|
|
426
|
-
v.required(t, e, s,
|
|
427
|
-
}, yt = function(t, e, i, s,
|
|
428
|
-
var
|
|
423
|
+
i(o);
|
|
424
|
+
}, Ue = function(t, e, i, s, r) {
|
|
425
|
+
var o = [], n = Array.isArray(e) ? "array" : typeof e;
|
|
426
|
+
v.required(t, e, s, o, r, n), i(o);
|
|
427
|
+
}, yt = function(t, e, i, s, r) {
|
|
428
|
+
var o = t.type, n = [], l = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
429
429
|
if (l) {
|
|
430
|
-
if (_(e,
|
|
430
|
+
if (_(e, o) && !t.required)
|
|
431
431
|
return i();
|
|
432
|
-
v.required(t, e, s, n,
|
|
432
|
+
v.required(t, e, s, n, r, o), _(e, o) || v.type(t, e, s, n, r);
|
|
433
433
|
}
|
|
434
434
|
i(n);
|
|
435
|
-
}, Ze = function(t, e, i, s,
|
|
436
|
-
var
|
|
435
|
+
}, Ze = function(t, e, i, s, r) {
|
|
436
|
+
var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
437
437
|
if (n) {
|
|
438
438
|
if (_(e) && !t.required)
|
|
439
439
|
return i();
|
|
440
|
-
v.required(t, e, s,
|
|
440
|
+
v.required(t, e, s, o, r);
|
|
441
441
|
}
|
|
442
|
-
i(
|
|
442
|
+
i(o);
|
|
443
443
|
}, it = {
|
|
444
444
|
string: ke,
|
|
445
445
|
method: Ne,
|
|
@@ -448,8 +448,8 @@ var Ut = function(t, e, i, s, o, r) {
|
|
|
448
448
|
regexp: Be,
|
|
449
449
|
integer: We,
|
|
450
450
|
float: Pe,
|
|
451
|
-
array:
|
|
452
|
-
object:
|
|
451
|
+
array: Ve,
|
|
452
|
+
object: ze,
|
|
453
453
|
enum: qe,
|
|
454
454
|
pattern: Ge,
|
|
455
455
|
date: je,
|
|
@@ -523,17 +523,17 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
523
523
|
throw new Error("Cannot configure a schema with no rules");
|
|
524
524
|
if (typeof i != "object" || Array.isArray(i))
|
|
525
525
|
throw new Error("Rules must be an object");
|
|
526
|
-
this.rules = {}, Object.keys(i).forEach(function(
|
|
527
|
-
var
|
|
528
|
-
s.rules[
|
|
526
|
+
this.rules = {}, Object.keys(i).forEach(function(r) {
|
|
527
|
+
var o = i[r];
|
|
528
|
+
s.rules[r] = Array.isArray(o) ? o : [o];
|
|
529
529
|
});
|
|
530
530
|
}, t.messages = function(i) {
|
|
531
531
|
return i && (this._messages = Yt(vt(), i)), this._messages;
|
|
532
|
-
}, t.validate = function(i, s,
|
|
533
|
-
var
|
|
534
|
-
s === void 0 && (s = {}),
|
|
532
|
+
}, t.validate = function(i, s, r) {
|
|
533
|
+
var o = this;
|
|
534
|
+
s === void 0 && (s = {}), r === void 0 && (r = function() {
|
|
535
535
|
});
|
|
536
|
-
var n = i, l = s, h =
|
|
536
|
+
var n = i, l = s, h = r;
|
|
537
537
|
if (typeof l == "function" && (h = l, l = {}), !this.rules || Object.keys(this.rules).length === 0)
|
|
538
538
|
return h && h(null, n), Promise.resolve(n);
|
|
539
539
|
function f(g) {
|
|
@@ -556,12 +556,12 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
556
556
|
l.messages = this.messages();
|
|
557
557
|
var x = {}, u = l.keys || Object.keys(this.rules);
|
|
558
558
|
u.forEach(function(g) {
|
|
559
|
-
var w =
|
|
559
|
+
var w = o.rules[g], y = n[g];
|
|
560
560
|
w.forEach(function(C) {
|
|
561
561
|
var m = C;
|
|
562
562
|
typeof m.transform == "function" && (n === i && (n = $({}, n)), y = n[g] = m.transform(y)), typeof m == "function" ? m = {
|
|
563
563
|
validator: m
|
|
564
|
-
} : m = $({}, m), m.validator =
|
|
564
|
+
} : m = $({}, m), m.validator = o.getValidationMethod(m), m.validator && (m.field = g, m.fullField = m.fullField || g, m.type = o.getType(m), x[g] = x[g] || [], x[g].push({
|
|
565
565
|
rule: m,
|
|
566
566
|
value: y,
|
|
567
567
|
source: n,
|
|
@@ -635,8 +635,8 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
635
635
|
}, t.getValidationMethod = function(i) {
|
|
636
636
|
if (typeof i.validator == "function")
|
|
637
637
|
return i.validator;
|
|
638
|
-
var s = Object.keys(i),
|
|
639
|
-
return
|
|
638
|
+
var s = Object.keys(i), r = s.indexOf("message");
|
|
639
|
+
return r !== -1 && s.splice(r, 1), s.length === 1 && s[0] === "required" ? it.required : it[this.getType(i)] || void 0;
|
|
640
640
|
}, a;
|
|
641
641
|
}();
|
|
642
642
|
nt.register = function(t, e) {
|
|
@@ -656,10 +656,10 @@ function Lt() {
|
|
|
656
656
|
function Zt(a, t) {
|
|
657
657
|
let e = 0, i;
|
|
658
658
|
return function(...s) {
|
|
659
|
-
const
|
|
660
|
-
!e ||
|
|
659
|
+
const r = (/* @__PURE__ */ new Date()).getTime(), o = r - e;
|
|
660
|
+
!e || o >= t ? (a.apply(this, s), e = r) : i || (i = setTimeout(() => {
|
|
661
661
|
a.apply(this, s), e = (/* @__PURE__ */ new Date()).getTime(), i = void 0;
|
|
662
|
-
}, t -
|
|
662
|
+
}, t - o));
|
|
663
663
|
};
|
|
664
664
|
}
|
|
665
665
|
function Jt(a) {
|
|
@@ -670,20 +670,20 @@ function Je(a = []) {
|
|
|
670
670
|
return a.forEach((s) => {
|
|
671
671
|
s.fixed === "left" ? t.push(s) : s.fixed === "right" ? i.push(s) : e.push(s);
|
|
672
672
|
}), [
|
|
673
|
-
...t.sort((s,
|
|
674
|
-
...e.sort((s,
|
|
675
|
-
...i.sort((s,
|
|
673
|
+
...t.sort((s, r) => s.sort - r.sort),
|
|
674
|
+
...e.sort((s, r) => s.sort - r.sort),
|
|
675
|
+
...i.sort((s, r) => s.sort - r.sort)
|
|
676
676
|
];
|
|
677
677
|
}
|
|
678
678
|
function Qt(a = [], t = 1, e = 0) {
|
|
679
679
|
return a.map((i) => {
|
|
680
680
|
if (i.children) {
|
|
681
|
-
let s = 0,
|
|
681
|
+
let s = 0, r = i.fixed;
|
|
682
682
|
i.children.forEach((n) => {
|
|
683
|
-
n.fixed =
|
|
683
|
+
n.fixed = r;
|
|
684
684
|
});
|
|
685
|
-
const
|
|
686
|
-
return
|
|
685
|
+
const o = Qt(i.children, t - 1, e + 1);
|
|
686
|
+
return o && o.forEach((n) => {
|
|
687
687
|
s += n.colspan;
|
|
688
688
|
}), {
|
|
689
689
|
...i,
|
|
@@ -691,7 +691,7 @@ function Qt(a = [], t = 1, e = 0) {
|
|
|
691
691
|
level: e,
|
|
692
692
|
rowspan: 1,
|
|
693
693
|
colspan: s,
|
|
694
|
-
children:
|
|
694
|
+
children: o
|
|
695
695
|
};
|
|
696
696
|
}
|
|
697
697
|
return {
|
|
@@ -720,32 +720,32 @@ function ti(a) {
|
|
|
720
720
|
else if (a.match(Bt))
|
|
721
721
|
a = a.replace(Bt, ""), e = 0, i += 1, t[i] = [""];
|
|
722
722
|
else {
|
|
723
|
-
let
|
|
723
|
+
let r = "";
|
|
724
724
|
if (a.startsWith('"')) {
|
|
725
|
-
let
|
|
725
|
+
let o = 0, n = !0;
|
|
726
726
|
for (; n; ) {
|
|
727
727
|
const l = a.slice(0, 1);
|
|
728
|
-
l === '"' && (
|
|
728
|
+
l === '"' && (o += 1), r += l, a = a.slice(1), (a.length === 0 || a.match(/^[\t\r\n]/) && o % 2 === 0) && (n = !1);
|
|
729
729
|
}
|
|
730
|
-
|
|
730
|
+
r = r.replace(/^"/, "").replace(/"$/, "").replace(/["]*/g, (l) => new Array(Math.floor(l.length / 2)).fill('"').join(""));
|
|
731
731
|
} else {
|
|
732
|
-
const
|
|
733
|
-
|
|
732
|
+
const o = a.match(Qe);
|
|
733
|
+
r = o ? o[0] : "", a = a.slice(r.length);
|
|
734
734
|
}
|
|
735
|
-
t[i][e] =
|
|
735
|
+
t[i][e] = r;
|
|
736
736
|
}
|
|
737
737
|
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;
|
|
738
738
|
}
|
|
739
739
|
function ei(a) {
|
|
740
|
-
let t, e, i, s,
|
|
740
|
+
let t, e, i, s, r = "", o;
|
|
741
741
|
for (t = 0, e = a.length; t < e; t += 1) {
|
|
742
742
|
for (s = a[t].length, i = 0; i < s; i += 1)
|
|
743
|
-
i > 0 && (
|
|
744
|
-
`) > -1 ?
|
|
745
|
-
t !== e - 1 && (
|
|
743
|
+
i > 0 && (r += " "), o = a[t][i], typeof o == "string" ? o.indexOf(`
|
|
744
|
+
`) > -1 ? r += `"${o.replace(/"/g, '""')}"` : r += o : o == null ? r += "" : r += o;
|
|
745
|
+
t !== e - 1 && (r += `
|
|
746
746
|
`);
|
|
747
747
|
}
|
|
748
|
-
return
|
|
748
|
+
return r;
|
|
749
749
|
}
|
|
750
750
|
class ii {
|
|
751
751
|
//虚拟滚动位置
|
|
@@ -769,8 +769,8 @@ class ii {
|
|
|
769
769
|
c(this, "filterMethod");
|
|
770
770
|
c(this, "positions", []);
|
|
771
771
|
this.ctx = t;
|
|
772
|
-
const { data: i = [], columns: s = [], footerData:
|
|
773
|
-
this.data = i, this.footerData =
|
|
772
|
+
const { data: i = [], columns: s = [], footerData: r = [] } = e;
|
|
773
|
+
this.data = i, this.footerData = r, this.columns = s, this.setLoading(!0), this.init();
|
|
774
774
|
}
|
|
775
775
|
init() {
|
|
776
776
|
this.clearBufferData(), this.rowKeyMap.clear(), this.checkboxKeyMap.clear(), this.colIndexKeyMap.clear(), this.rowIndexRowKeyMap.clear(), this.originalDataMap.clear(), this.changedDataMap.clear(), this.validationErrorMap.clear(), this.itemRowKeyMap = /* @__PURE__ */ new WeakMap(), this.initData(this.data);
|
|
@@ -788,9 +788,9 @@ class ii {
|
|
|
788
788
|
*/
|
|
789
789
|
initData(t, e = 0) {
|
|
790
790
|
t.forEach((i, s) => {
|
|
791
|
-
let
|
|
792
|
-
Array.isArray(i.children) && (
|
|
793
|
-
const { ROW_KEY:
|
|
791
|
+
let r = !1;
|
|
792
|
+
Array.isArray(i.children) && (r = !0, this.initData(i.children, e + 1));
|
|
793
|
+
const { ROW_KEY: o = "", DEFAULT_EXPAND_ALL: n, CELL_HEIGHT: l, SELECTABLE_METHOD: h, CHECKBOX_KEY: f } = this.ctx.config, d = i[o], x = d ?? Lt();
|
|
794
794
|
this.itemRowKeyMap.set(i, x);
|
|
795
795
|
const u = i._height || l, p = i._readonly;
|
|
796
796
|
let g = !0;
|
|
@@ -812,7 +812,7 @@ class ii {
|
|
|
812
812
|
selectable: g,
|
|
813
813
|
expand: n,
|
|
814
814
|
expandLazy: !1,
|
|
815
|
-
hasChildren:
|
|
815
|
+
hasChildren: r,
|
|
816
816
|
expandLoading: !1,
|
|
817
817
|
item: i
|
|
818
818
|
});
|
|
@@ -843,8 +843,8 @@ class ii {
|
|
|
843
843
|
filterColumns(t) {
|
|
844
844
|
return t.reduce((e, i) => {
|
|
845
845
|
if (!(typeof i.hide == "function" ? i.hide() : i.hide)) {
|
|
846
|
-
const
|
|
847
|
-
|
|
846
|
+
const r = { ...i };
|
|
847
|
+
r.children && Array.isArray(r.children) && (r.children = this.filterColumns(r.children)), e.push(r);
|
|
848
848
|
}
|
|
849
849
|
return e;
|
|
850
850
|
}, []);
|
|
@@ -871,15 +871,15 @@ class ii {
|
|
|
871
871
|
};
|
|
872
872
|
let t = [], e = 0;
|
|
873
873
|
this.sumHeight = 0, this.positions = [];
|
|
874
|
-
const i = (
|
|
875
|
-
|
|
876
|
-
t.push(
|
|
877
|
-
const n = this.itemRowKeyMap.get(
|
|
874
|
+
const i = (r) => {
|
|
875
|
+
r.forEach((o) => {
|
|
876
|
+
t.push(o);
|
|
877
|
+
const n = this.itemRowKeyMap.get(o), { expand: l, hasChildren: h, height: f } = this.rowKeyMap.get(n), d = this.sumHeight;
|
|
878
878
|
this.sumHeight += f, this.rowIndexRowKeyMap.set(e, n), this.positions.push({
|
|
879
879
|
top: d,
|
|
880
880
|
height: f,
|
|
881
881
|
bottom: this.sumHeight
|
|
882
|
-
}), e += 1, l && h && i(
|
|
882
|
+
}), e += 1, l && h && i(o.children);
|
|
883
883
|
});
|
|
884
884
|
};
|
|
885
885
|
this.rowIndexRowKeyMap.clear();
|
|
@@ -975,11 +975,11 @@ class ii {
|
|
|
975
975
|
getItemValueForRowIndexAndColIndex(t, e) {
|
|
976
976
|
if (!(this.rowIndexRowKeyMap.has(t) && this.colIndexKeyMap.get(e)))
|
|
977
977
|
return null;
|
|
978
|
-
const s = this.rowIndexRowKeyMap.get(t),
|
|
978
|
+
const s = this.rowIndexRowKeyMap.get(t), r = this.colIndexKeyMap.get(e);
|
|
979
979
|
return {
|
|
980
980
|
rowKey: s,
|
|
981
|
-
key:
|
|
982
|
-
value: this.getItemValue(s,
|
|
981
|
+
key: r,
|
|
982
|
+
value: this.getItemValue(s, r)
|
|
983
983
|
};
|
|
984
984
|
}
|
|
985
985
|
/**
|
|
@@ -1010,8 +1010,8 @@ class ii {
|
|
|
1010
1010
|
newValue: x
|
|
1011
1011
|
});
|
|
1012
1012
|
});
|
|
1013
|
-
let
|
|
1014
|
-
const
|
|
1013
|
+
let r = [];
|
|
1014
|
+
const o = i.map((n) => {
|
|
1015
1015
|
const l = this.ctx.database.getRowDataItemForRowKey(n.rowKey);
|
|
1016
1016
|
return {
|
|
1017
1017
|
rowKey: n.rowKey,
|
|
@@ -1021,8 +1021,8 @@ class ii {
|
|
|
1021
1021
|
};
|
|
1022
1022
|
});
|
|
1023
1023
|
return s.forEach((n) => {
|
|
1024
|
-
|
|
1025
|
-
}), this.ctx.emit("change",
|
|
1024
|
+
r.push(this.ctx.database.getRowDataItemForRowKey(n));
|
|
1025
|
+
}), this.ctx.emit("change", o, r), e && this.ctx.history.pushState({
|
|
1026
1026
|
changeList: i,
|
|
1027
1027
|
scrollX: this.ctx.scrollX,
|
|
1028
1028
|
scrollY: this.ctx.scrollY,
|
|
@@ -1039,7 +1039,7 @@ class ii {
|
|
|
1039
1039
|
* @param isEditor 是否是编辑器
|
|
1040
1040
|
* @returns
|
|
1041
1041
|
*/
|
|
1042
|
-
setItemValue(t, e, i, s = !1,
|
|
1042
|
+
setItemValue(t, e, i, s = !1, r = !1, o = !1) {
|
|
1043
1043
|
if (!this.rowKeyMap.has(t))
|
|
1044
1044
|
return {};
|
|
1045
1045
|
const { item: n } = this.rowKeyMap.get(t);
|
|
@@ -1051,7 +1051,7 @@ class ii {
|
|
|
1051
1051
|
};
|
|
1052
1052
|
n[e] !== null && typeof n[e] == "object" && (l = JSON.parse(JSON.stringify(n[e])));
|
|
1053
1053
|
const h = `${t}_${e}`;
|
|
1054
|
-
if (this.originalDataMap.has(h) || this.originalDataMap.set(h, l), this.changedDataMap.set(h, i), n[e] = i,
|
|
1054
|
+
if (this.originalDataMap.has(h) || this.originalDataMap.set(h, l), this.changedDataMap.set(h, i), n[e] = i, o) {
|
|
1055
1055
|
const f = this.ctx.database.getRowDataItemForRowKey(t), d = {
|
|
1056
1056
|
rowKey: t,
|
|
1057
1057
|
key: e,
|
|
@@ -1086,7 +1086,7 @@ class ii {
|
|
|
1086
1086
|
newValue: i
|
|
1087
1087
|
}
|
|
1088
1088
|
]
|
|
1089
|
-
}),
|
|
1089
|
+
}), r && this.ctx.emit("draw"), {
|
|
1090
1090
|
oldValue: l,
|
|
1091
1091
|
newValue: i
|
|
1092
1092
|
};
|
|
@@ -1112,8 +1112,8 @@ class ii {
|
|
|
1112
1112
|
if (i) {
|
|
1113
1113
|
if (!this.rowKeyMap.has(t))
|
|
1114
1114
|
return !1;
|
|
1115
|
-
const { item: s } = this.rowKeyMap.get(t),
|
|
1116
|
-
this.checkboxKeyMap.has(
|
|
1115
|
+
const { item: s } = this.rowKeyMap.get(t), r = s[i];
|
|
1116
|
+
this.checkboxKeyMap.has(r) && this.checkboxKeyMap.get(r).forEach((n) => {
|
|
1117
1117
|
const l = this.rowKeyMap.get(n);
|
|
1118
1118
|
l.check = e;
|
|
1119
1119
|
});
|
|
@@ -1200,12 +1200,12 @@ class ii {
|
|
|
1200
1200
|
*/
|
|
1201
1201
|
getCheckedState() {
|
|
1202
1202
|
let t = 0, e = 0;
|
|
1203
|
-
this.rowKeyMap.forEach((
|
|
1204
|
-
|
|
1205
|
-
const n =
|
|
1203
|
+
this.rowKeyMap.forEach((o) => {
|
|
1204
|
+
o.check && (t += 1);
|
|
1205
|
+
const n = o.selectable;
|
|
1206
1206
|
typeof n == "function" ? n({
|
|
1207
|
-
row:
|
|
1208
|
-
rowIndex:
|
|
1207
|
+
row: o.item,
|
|
1208
|
+
rowIndex: o.rowIndex
|
|
1209
1209
|
}) && (e += 1) : n && (e += 1);
|
|
1210
1210
|
});
|
|
1211
1211
|
const i = e && e > t && t > 0;
|
|
@@ -1230,12 +1230,12 @@ class ii {
|
|
|
1230
1230
|
getChangedData() {
|
|
1231
1231
|
let t = [];
|
|
1232
1232
|
return this.changedDataMap.forEach((e, i) => {
|
|
1233
|
-
const s = this.originalDataMap.get(i),
|
|
1233
|
+
const s = this.originalDataMap.get(i), r = i.split("_")[0], o = i.split("_")[1];
|
|
1234
1234
|
s !== e && t.push({
|
|
1235
|
-
rowKey:
|
|
1236
|
-
colKey:
|
|
1235
|
+
rowKey: r,
|
|
1236
|
+
colKey: o,
|
|
1237
1237
|
originalValue: s,
|
|
1238
|
-
row: this.rowKeyMap.get(
|
|
1238
|
+
row: this.rowKeyMap.get(r),
|
|
1239
1239
|
value: e
|
|
1240
1240
|
});
|
|
1241
1241
|
}), t;
|
|
@@ -1243,8 +1243,8 @@ class ii {
|
|
|
1243
1243
|
getChangedRows() {
|
|
1244
1244
|
const t = /* @__PURE__ */ new Set();
|
|
1245
1245
|
this.changedDataMap.forEach((i, s) => {
|
|
1246
|
-
const
|
|
1247
|
-
|
|
1246
|
+
const r = this.originalDataMap.get(s), o = s.split("_")[0];
|
|
1247
|
+
r !== i && t.add(o);
|
|
1248
1248
|
});
|
|
1249
1249
|
let e = [];
|
|
1250
1250
|
return t.forEach((i) => {
|
|
@@ -1261,8 +1261,8 @@ class ii {
|
|
|
1261
1261
|
const i = `${t}_${e}`;
|
|
1262
1262
|
if (!this.changedDataMap.has(i))
|
|
1263
1263
|
return !1;
|
|
1264
|
-
const s = this.originalDataMap.get(i),
|
|
1265
|
-
return s !==
|
|
1264
|
+
const s = this.originalDataMap.get(i), r = this.changedDataMap.get(i);
|
|
1265
|
+
return s !== r;
|
|
1266
1266
|
}
|
|
1267
1267
|
getPositionForRowIndex(t) {
|
|
1268
1268
|
return t < this.positions.length ? this.positions[t] : {
|
|
@@ -1275,7 +1275,7 @@ class ii {
|
|
|
1275
1275
|
return t ? (this.headerMap.set(t, e), !0) : !1;
|
|
1276
1276
|
}
|
|
1277
1277
|
getReadonly(t, e) {
|
|
1278
|
-
const i = this.rowKeyMap.get(t), s = this.headerMap.get(e),
|
|
1278
|
+
const i = this.rowKeyMap.get(t), s = this.headerMap.get(e), r = i == null ? void 0 : i.readonly, o = s == null ? void 0 : s.readonly, { CELL_READONLY_METHOD: n } = this.ctx.config;
|
|
1279
1279
|
if (typeof n == "function") {
|
|
1280
1280
|
const h = n({
|
|
1281
1281
|
row: i.item,
|
|
@@ -1287,20 +1287,20 @@ class ii {
|
|
|
1287
1287
|
if (h !== void 0)
|
|
1288
1288
|
return h;
|
|
1289
1289
|
}
|
|
1290
|
-
return
|
|
1290
|
+
return o || r;
|
|
1291
1291
|
}
|
|
1292
1292
|
clearValidate() {
|
|
1293
1293
|
this.validationErrorMap.clear();
|
|
1294
1294
|
}
|
|
1295
1295
|
getValidator(t, e) {
|
|
1296
1296
|
return new Promise((i) => {
|
|
1297
|
-
const s = this.rowKeyMap.get(t),
|
|
1297
|
+
const s = this.rowKeyMap.get(t), r = this.headerMap.get(e), { CELL_RULES_METHOD: o } = this.ctx.config, n = r.column;
|
|
1298
1298
|
let l = n.rules;
|
|
1299
|
-
if (typeof
|
|
1300
|
-
const f =
|
|
1299
|
+
if (typeof o == "function") {
|
|
1300
|
+
const f = o({
|
|
1301
1301
|
row: s.item,
|
|
1302
1302
|
rowIndex: s.rowIndex,
|
|
1303
|
-
colIndex:
|
|
1303
|
+
colIndex: r.colIndex,
|
|
1304
1304
|
column: n,
|
|
1305
1305
|
value: this.getItemValue(t, e)
|
|
1306
1306
|
});
|
|
@@ -1314,7 +1314,7 @@ class ii {
|
|
|
1314
1314
|
row: s.item,
|
|
1315
1315
|
column: n,
|
|
1316
1316
|
rowIndex: s.rowIndex,
|
|
1317
|
-
colIndex:
|
|
1317
|
+
colIndex: r.colIndex
|
|
1318
1318
|
}));
|
|
1319
1319
|
h[e] = x;
|
|
1320
1320
|
} else
|
|
@@ -1323,7 +1323,7 @@ class ii {
|
|
|
1323
1323
|
row: s.item,
|
|
1324
1324
|
column: n,
|
|
1325
1325
|
rowIndex: s.rowIndex,
|
|
1326
|
-
colIndex:
|
|
1326
|
+
colIndex: r.colIndex
|
|
1327
1327
|
};
|
|
1328
1328
|
new nt(h).validate(f).then(() => {
|
|
1329
1329
|
this.setValidationError(t, e, []), i([]);
|
|
@@ -1344,8 +1344,8 @@ class ii {
|
|
|
1344
1344
|
getHeightByRowIndexRowSpan(t, e) {
|
|
1345
1345
|
let i = 0;
|
|
1346
1346
|
for (let s = 0; s < e; s++) {
|
|
1347
|
-
const
|
|
1348
|
-
|
|
1347
|
+
const r = this.positions[t + s];
|
|
1348
|
+
r && (i += r.height);
|
|
1349
1349
|
}
|
|
1350
1350
|
return i;
|
|
1351
1351
|
}
|
|
@@ -1356,12 +1356,12 @@ class ii {
|
|
|
1356
1356
|
return this.loading;
|
|
1357
1357
|
}
|
|
1358
1358
|
setValidationErrorByRowIndex(t, e, i) {
|
|
1359
|
-
const
|
|
1359
|
+
const r = `${this.rowIndexRowKeyMap.get(t)}_${e}`, o = [
|
|
1360
1360
|
{
|
|
1361
1361
|
message: i
|
|
1362
1362
|
}
|
|
1363
1363
|
];
|
|
1364
|
-
this.validationErrorMap.set(
|
|
1364
|
+
this.validationErrorMap.set(r, o);
|
|
1365
1365
|
}
|
|
1366
1366
|
setValidationError(t, e, i) {
|
|
1367
1367
|
const s = `${t}_${e}`;
|
|
@@ -1399,10 +1399,10 @@ class si {
|
|
|
1399
1399
|
backState() {
|
|
1400
1400
|
if (this.historyIndex >= 0) {
|
|
1401
1401
|
const { changeList: t, scrollX: e, scrollY: i } = this.history[this.historyIndex], s = t.map(
|
|
1402
|
-
(
|
|
1403
|
-
rowKey:
|
|
1404
|
-
key:
|
|
1405
|
-
value:
|
|
1402
|
+
(r) => ({
|
|
1403
|
+
rowKey: r.rowKey,
|
|
1404
|
+
key: r.key,
|
|
1405
|
+
value: r.oldValue,
|
|
1406
1406
|
row: {}
|
|
1407
1407
|
})
|
|
1408
1408
|
);
|
|
@@ -1553,9 +1553,9 @@ class ni {
|
|
|
1553
1553
|
* @param {number} shadowWidth - 阴影的宽度
|
|
1554
1554
|
* @param {string} color - 阴影的颜色
|
|
1555
1555
|
*/
|
|
1556
|
-
drawShadow(t, e, i, s,
|
|
1557
|
-
const { fillColor:
|
|
1558
|
-
this.ctx.save(),
|
|
1556
|
+
drawShadow(t, e, i, s, r) {
|
|
1557
|
+
const { fillColor: o, side: n, shadowWidth: l, colorStart: h, colorEnd: f } = r;
|
|
1558
|
+
this.ctx.save(), o && (this.ctx.fillStyle = o, this.ctx.fillRect(t, e, i, s));
|
|
1559
1559
|
let d;
|
|
1560
1560
|
switch (n) {
|
|
1561
1561
|
case "left":
|
|
@@ -1592,21 +1592,21 @@ class ni {
|
|
|
1592
1592
|
this.ctx.save();
|
|
1593
1593
|
const { borderColor: i = "black", borderWidth: s = 1 } = e;
|
|
1594
1594
|
this.ctx.beginPath(), this.ctx.moveTo(t[0] + 0.5, t[1] + 0.5);
|
|
1595
|
-
for (let
|
|
1596
|
-
this.ctx.lineTo(t[
|
|
1595
|
+
for (let r = 2; r < t.length; r += 2)
|
|
1596
|
+
this.ctx.lineTo(t[r] + 0.5, t[r + 1] + 0.5);
|
|
1597
1597
|
this.ctx.strokeStyle = i, this.ctx.lineWidth = s, e.lineDash && (this.ctx.lineDashOffset = 4, this.ctx.setLineDash(e.lineDash)), e.fillColor && (this.ctx.fillStyle = e.fillColor, this.ctx.fill()), e.borderColor && (this.ctx.strokeStyle = e.borderColor), this.ctx.stroke(), this.ctx.closePath(), this.ctx.restore();
|
|
1598
1598
|
}
|
|
1599
|
-
drawImage(t, e, i, s,
|
|
1600
|
-
this.ctx.save(), this.ctx.drawImage(t, e, i, s,
|
|
1599
|
+
drawImage(t, e, i, s, r) {
|
|
1600
|
+
this.ctx.save(), this.ctx.drawImage(t, e, i, s, r), this.ctx.restore();
|
|
1601
1601
|
}
|
|
1602
|
-
drawRect(t, e, i, s, { borderWidth:
|
|
1603
|
-
if (this.ctx.save(), this.ctx.beginPath(), n !== void 0 && (this.ctx.fillStyle = n),
|
|
1602
|
+
drawRect(t, e, i, s, { borderWidth: r = 1, borderColor: o, fillColor: n, radius: l = 0 } = {}) {
|
|
1603
|
+
if (this.ctx.save(), this.ctx.beginPath(), n !== void 0 && (this.ctx.fillStyle = n), o !== void 0 && (this.ctx.lineWidth = r, this.ctx.strokeStyle = o), l === 0)
|
|
1604
1604
|
this.ctx.rect(t + 0.5, e + 0.5, i, s);
|
|
1605
1605
|
else {
|
|
1606
1606
|
const [h, f, d, x] = typeof l == "number" ? [l, l, l, l] : l;
|
|
1607
1607
|
this.ctx.moveTo(t + h, e), this.ctx.arcTo(t + i, e, t + i, e + f, f), this.ctx.arcTo(t + i, e + s, t + i - d, e + s, d), this.ctx.arcTo(t, e + s, t, e + s - x, x), this.ctx.arcTo(t, e, t + h, e, h);
|
|
1608
1608
|
}
|
|
1609
|
-
n !== void 0 && this.ctx.fill(),
|
|
1609
|
+
n !== void 0 && this.ctx.fill(), o !== void 0 && this.ctx.stroke(), this.ctx.restore();
|
|
1610
1610
|
}
|
|
1611
1611
|
/**
|
|
1612
1612
|
* 画文本
|
|
@@ -1618,7 +1618,7 @@ class ni {
|
|
|
1618
1618
|
* @param options
|
|
1619
1619
|
* @returns 是否溢出
|
|
1620
1620
|
*/
|
|
1621
|
-
drawText(t = "", e, i, s,
|
|
1621
|
+
drawText(t = "", e, i, s, r, o = {}) {
|
|
1622
1622
|
this.ctx.save();
|
|
1623
1623
|
const {
|
|
1624
1624
|
font: n = "12px Arial",
|
|
@@ -1626,34 +1626,34 @@ class ni {
|
|
|
1626
1626
|
color: h = "#495060",
|
|
1627
1627
|
padding: f = 0,
|
|
1628
1628
|
verticalAlign: d = "middle"
|
|
1629
|
-
} =
|
|
1629
|
+
} = o;
|
|
1630
1630
|
this.ctx.font = n, this.ctx.fillStyle = h, this.ctx.textBaseline = d, this.ctx.textAlign = l;
|
|
1631
1631
|
let x = 0;
|
|
1632
|
-
d === "top" ? x = i + f : d === "bottom" ? x = i +
|
|
1632
|
+
d === "top" ? x = i + f : d === "bottom" ? x = i + r - f : x = i + (r + f) / 2;
|
|
1633
1633
|
let u = 0;
|
|
1634
1634
|
l === "left" ? u = e + f : l === "right" ? u = e + s - f : u = e + s / 2;
|
|
1635
1635
|
const { _text: p, ellipsis: g } = this.handleEllipsis(t, s, f);
|
|
1636
1636
|
return this.ctx.fillText(p, u, x), this.ctx.restore(), g;
|
|
1637
1637
|
}
|
|
1638
1638
|
handleEllipsis(t, e, i = 0) {
|
|
1639
|
-
let s = !1,
|
|
1639
|
+
let s = !1, r = t;
|
|
1640
1640
|
if (t == null || t === "")
|
|
1641
1641
|
return {
|
|
1642
1642
|
_text: "",
|
|
1643
1643
|
ellipsis: s
|
|
1644
1644
|
};
|
|
1645
|
-
const
|
|
1646
|
-
if (n && n +
|
|
1645
|
+
const o = this.ctx.measureText("...").width, n = this.ctx.measureText(t).width;
|
|
1646
|
+
if (n && n + o >= e - i * 2) {
|
|
1647
1647
|
s = !0;
|
|
1648
1648
|
let l = 0;
|
|
1649
1649
|
for (let h = 0; h < t.length; h++)
|
|
1650
|
-
if (l += this.ctx.measureText(t[h]).width, l >= e - i * 2 -
|
|
1651
|
-
|
|
1650
|
+
if (l += this.ctx.measureText(t[h]).width, l >= e - i * 2 - o) {
|
|
1651
|
+
r = t.slice(0, h) + "...";
|
|
1652
1652
|
break;
|
|
1653
1653
|
}
|
|
1654
1654
|
}
|
|
1655
1655
|
return {
|
|
1656
|
-
_text:
|
|
1656
|
+
_text: r,
|
|
1657
1657
|
ellipsis: s
|
|
1658
1658
|
};
|
|
1659
1659
|
}
|
|
@@ -1863,35 +1863,35 @@ class ai {
|
|
|
1863
1863
|
const i = this.list[e];
|
|
1864
1864
|
let s = i.color;
|
|
1865
1865
|
if (i.configColorName) {
|
|
1866
|
-
const
|
|
1867
|
-
|
|
1866
|
+
const o = this.ctx.config[i.configColorName];
|
|
1867
|
+
o && (s = o);
|
|
1868
1868
|
}
|
|
1869
|
-
const
|
|
1870
|
-
this.icons.set(i.name,
|
|
1869
|
+
const r = this.createImageFromSVG(i.svg, s).then((o) => {
|
|
1870
|
+
this.icons.set(i.name, o);
|
|
1871
1871
|
});
|
|
1872
|
-
t.push(
|
|
1872
|
+
t.push(r);
|
|
1873
1873
|
}
|
|
1874
1874
|
for (let e = 0; e < this.ctx.config.ICONS.length; e++) {
|
|
1875
1875
|
const i = this.ctx.config.ICONS[e];
|
|
1876
1876
|
let s = i.color;
|
|
1877
|
-
const
|
|
1878
|
-
this.icons.set(i.name,
|
|
1877
|
+
const r = this.createImageFromSVG(i.svg, s).then((o) => {
|
|
1878
|
+
this.icons.set(i.name, o);
|
|
1879
1879
|
});
|
|
1880
|
-
t.push(
|
|
1880
|
+
t.push(r);
|
|
1881
1881
|
}
|
|
1882
1882
|
await Promise.all(t), this.ctx.emit("draw");
|
|
1883
1883
|
}
|
|
1884
1884
|
async createImageFromSVG(t, e) {
|
|
1885
|
-
const
|
|
1886
|
-
e &&
|
|
1885
|
+
const r = new DOMParser().parseFromString(t, "image/svg+xml").documentElement;
|
|
1886
|
+
e && r.querySelectorAll("*").forEach((h) => {
|
|
1887
1887
|
h.setAttribute("fill", e);
|
|
1888
1888
|
});
|
|
1889
|
-
const
|
|
1889
|
+
const o = new Image(), n = new Blob([new XMLSerializer().serializeToString(r)], {
|
|
1890
1890
|
type: "image/svg+xml"
|
|
1891
1891
|
}), l = URL.createObjectURL(n);
|
|
1892
|
-
return
|
|
1893
|
-
|
|
1894
|
-
h(
|
|
1892
|
+
return o.src = l, new Promise((h, f) => {
|
|
1893
|
+
o.onerror = () => f(new Error("Failed to load image")), o.onload = () => {
|
|
1894
|
+
h(o);
|
|
1895
1895
|
};
|
|
1896
1896
|
});
|
|
1897
1897
|
}
|
|
@@ -1900,7 +1900,7 @@ class ai {
|
|
|
1900
1900
|
}
|
|
1901
1901
|
}
|
|
1902
1902
|
class te {
|
|
1903
|
-
constructor(t, e, i, s,
|
|
1903
|
+
constructor(t, e, i, s, r, o, n) {
|
|
1904
1904
|
c(this, "ctx");
|
|
1905
1905
|
c(this, "x", 0);
|
|
1906
1906
|
c(this, "y", 0);
|
|
@@ -1908,13 +1908,13 @@ class te {
|
|
|
1908
1908
|
c(this, "height", 0);
|
|
1909
1909
|
c(this, "fixed");
|
|
1910
1910
|
c(this, "cellType");
|
|
1911
|
-
this.ctx = t, this.x = e, this.y = i, this.width = s, this.height =
|
|
1911
|
+
this.ctx = t, this.x = e, this.y = i, this.width = s, this.height = r, this.fixed = o, this.cellType = n;
|
|
1912
1912
|
}
|
|
1913
1913
|
isHorizontalVisible() {
|
|
1914
1914
|
if (this.fixed)
|
|
1915
1915
|
return !0;
|
|
1916
|
-
const { target: t, fixedLeftWidth: e, scrollX: i, fixedRightWidth: s } = this.ctx,
|
|
1917
|
-
return !(this.x + this.width - e - i <= 0 || this.x - i >=
|
|
1916
|
+
const { target: t, fixedLeftWidth: e, scrollX: i, fixedRightWidth: s } = this.ctx, r = t.width;
|
|
1917
|
+
return !(this.x + this.width - e - i <= 0 || this.x - i >= r - s);
|
|
1918
1918
|
}
|
|
1919
1919
|
isVerticalVisible() {
|
|
1920
1920
|
const { target: t, scrollY: e } = this.ctx, i = t.height;
|
|
@@ -1937,8 +1937,8 @@ class te {
|
|
|
1937
1937
|
}
|
|
1938
1938
|
}
|
|
1939
1939
|
class ee extends te {
|
|
1940
|
-
constructor(e, i, s,
|
|
1941
|
-
super(e,
|
|
1940
|
+
constructor(e, i, s, r, o, n, l, h, f, d = "body") {
|
|
1941
|
+
super(e, r, o, n, l, h.fixed, d);
|
|
1942
1942
|
c(this, "formatter");
|
|
1943
1943
|
c(this, "hoverIconName", "");
|
|
1944
1944
|
c(this, "operation", !1);
|
|
@@ -2002,7 +2002,7 @@ class ee extends te {
|
|
|
2002
2002
|
return;
|
|
2003
2003
|
const { SPAN_METHOD: e } = this.ctx.config;
|
|
2004
2004
|
if (typeof e == "function") {
|
|
2005
|
-
const i = e, { colspan: s = 1, rowspan:
|
|
2005
|
+
const i = e, { colspan: s = 1, rowspan: r = 1 } = i({
|
|
2006
2006
|
row: this.row,
|
|
2007
2007
|
rowIndex: this.rowIndex,
|
|
2008
2008
|
colIndex: this.colIndex,
|
|
@@ -2014,7 +2014,7 @@ class ee extends te {
|
|
|
2014
2014
|
visibleLeafColumns: this.ctx.header.visibleLeafColumns,
|
|
2015
2015
|
rows: this.ctx.body.data
|
|
2016
2016
|
}) || {};
|
|
2017
|
-
this.colspan = s, this.rowspan =
|
|
2017
|
+
this.colspan = s, this.rowspan = r, this.visibleWidth = this.getWidthByColIndexColSpan(this.colIndex, this.colspan), this.visibleHeight = this.ctx.database.getHeightByRowIndexRowSpan(this.rowIndex, this.rowspan);
|
|
2018
2018
|
}
|
|
2019
2019
|
}
|
|
2020
2020
|
updateType() {
|
|
@@ -2076,20 +2076,20 @@ class ee extends te {
|
|
|
2076
2076
|
}
|
|
2077
2077
|
updateTree() {
|
|
2078
2078
|
const { CELL_PADDING: e = 0 } = this.ctx.config, { rowKey: i, cellType: s } = this;
|
|
2079
|
-
let
|
|
2079
|
+
let r, o = 0, n = "";
|
|
2080
2080
|
if (this.type === "tree" && s === "body") {
|
|
2081
2081
|
const l = this.ctx.database.getRowForRowKey(i), { expand: h = !1, hasChildren: f = !1, expandLoading: d = !1, level: x = 0 } = l || {};
|
|
2082
2082
|
if (d) {
|
|
2083
2083
|
const u = this.ctx.icons.get("loading");
|
|
2084
|
-
n = "loading",
|
|
2084
|
+
n = "loading", r = u, o = x * 8;
|
|
2085
2085
|
} else if (f) {
|
|
2086
2086
|
const u = this.ctx.icons.get("expand"), p = this.ctx.icons.get("shrink");
|
|
2087
|
-
|
|
2087
|
+
r = h ? p : u, n = h ? "shrink" : "expand", o = x * 8;
|
|
2088
2088
|
} else
|
|
2089
|
-
|
|
2090
|
-
if (
|
|
2091
|
-
let u = 20, p = 20, g = this.drawX +
|
|
2092
|
-
this.ctx.paint.drawImage(
|
|
2089
|
+
o = x * 8;
|
|
2090
|
+
if (r) {
|
|
2091
|
+
let u = 20, p = 20, g = this.drawX + o + e, w = this.drawY + (this.visibleHeight - p) / 2 + 2;
|
|
2092
|
+
this.ctx.paint.drawImage(r, g, w, u, p), this.drawImageX = g, this.drawImageY = w, this.drawImageWidth = u, this.drawImageHeight = p, this.drawImageName = n, this.drawImageSource = r, this.align = "left", this.drawTextX = o + this.drawX + u + 0.5;
|
|
2093
2093
|
}
|
|
2094
2094
|
}
|
|
2095
2095
|
}
|
|
@@ -2098,8 +2098,8 @@ class ee extends te {
|
|
|
2098
2098
|
BODY_BG_COLOR: e,
|
|
2099
2099
|
EDIT_BG_COLOR: i,
|
|
2100
2100
|
BODY_CELL_STYLE_METHOD: s,
|
|
2101
|
-
FOOTER_CELL_STYLE_METHOD:
|
|
2102
|
-
READONLY_TEXT_COLOR:
|
|
2101
|
+
FOOTER_CELL_STYLE_METHOD: r,
|
|
2102
|
+
READONLY_TEXT_COLOR: o,
|
|
2103
2103
|
FOOTER_BG_COLOR: n,
|
|
2104
2104
|
HIGHLIGHT_SELECTED_ROW: l,
|
|
2105
2105
|
HIGHLIGHT_SELECTED_ROW_COLOR: h,
|
|
@@ -2107,9 +2107,9 @@ class ee extends te {
|
|
|
2107
2107
|
HIGHLIGHT_HOVER_ROW_COLOR: d
|
|
2108
2108
|
} = this.ctx.config;
|
|
2109
2109
|
if (this.cellType === "footer") {
|
|
2110
|
-
let y = n, C =
|
|
2111
|
-
if (typeof
|
|
2112
|
-
const m =
|
|
2110
|
+
let y = n, C = o;
|
|
2111
|
+
if (typeof r == "function") {
|
|
2112
|
+
const m = r, { backgroundColor: E, color: b } = m({
|
|
2113
2113
|
row: this.row,
|
|
2114
2114
|
rowIndex: this.rowIndex,
|
|
2115
2115
|
colIndex: this.colIndex,
|
|
@@ -2124,12 +2124,12 @@ class ee extends te {
|
|
|
2124
2124
|
let x = "transparent";
|
|
2125
2125
|
const u = this.ctx.focusCell, p = this.ctx.hoverCell;
|
|
2126
2126
|
f && (p == null ? void 0 : p.rowKey) === this.rowKey && (x = d), l && (u == null ? void 0 : u.rowKey) === this.rowKey && (x = h), this.drawCellSkyBgColor = x;
|
|
2127
|
-
let g = e, w =
|
|
2127
|
+
let g = e, w = o;
|
|
2128
2128
|
if (["index", "index-selection", "selection"].includes(this.type)) {
|
|
2129
|
-
this.drawCellBgColor = e, this.drawTextColor =
|
|
2129
|
+
this.drawCellBgColor = e, this.drawTextColor = o;
|
|
2130
2130
|
return;
|
|
2131
2131
|
}
|
|
2132
|
-
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (g = i, w =
|
|
2132
|
+
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (g = i, w = o), typeof s == "function") {
|
|
2133
2133
|
const y = s, { backgroundColor: C, color: m } = y({
|
|
2134
2134
|
row: this.row,
|
|
2135
2135
|
rowIndex: this.rowIndex,
|
|
@@ -2142,8 +2142,8 @@ class ee extends te {
|
|
|
2142
2142
|
this.drawCellBgColor = g, this.drawTextColor = w;
|
|
2143
2143
|
}
|
|
2144
2144
|
updateSelection() {
|
|
2145
|
-
const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan:
|
|
2146
|
-
if (!(s === 0 ||
|
|
2145
|
+
const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: r, cellType: o, type: n, rowIndex: l, rowKey: h } = this;
|
|
2146
|
+
if (!(s === 0 || r === 0) && o !== "footer" && ["index-selection", "selection"].includes(n)) {
|
|
2147
2147
|
const f = this.ctx.database.getRowSelection(h), d = this.ctx.database.getRowSelectable(h), { CHECKBOX_SIZE: x = 0 } = this.ctx.config, u = this.drawX + (e - x) / 2, p = this.drawY + (i - x) / 2;
|
|
2148
2148
|
let g = this.ctx.icons.get("checkbox-uncheck"), w = "checkbox-uncheck";
|
|
2149
2149
|
f && d ? (g = this.ctx.icons.get("checkbox-check"), w = "checkbox-check") : f && d ? (g = this.ctx.icons.get("checkbox-check-disabled"), w = "checkbox-check-disabled") : !f && d ? (g = this.ctx.icons.get("checkbox-uncheck"), w = "checkbox-uncheck") : (g = this.ctx.icons.get("checkbox-disabled"), w = "checkbox-disabled"), g && n == "index-selection" ? (this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === l || ["checkbox-disabled", "checkbox-check"].includes(w)) && (this.drawImageX = u, this.drawImageY = p, this.drawImageWidth = x, this.drawImageHeight = x, this.drawImageName = w, this.drawImageSource = g) : g && n === "selection" && (this.drawImageX = u, this.drawImageY = p, this.drawImageWidth = x, this.drawImageHeight = x, this.drawImageName = w, this.drawImageSource = g);
|
|
@@ -2161,10 +2161,10 @@ class ee extends te {
|
|
|
2161
2161
|
});
|
|
2162
2162
|
l !== void 0 && (this.hoverIconName = l);
|
|
2163
2163
|
}
|
|
2164
|
-
const
|
|
2164
|
+
const r = this.drawX + this.width - i - s, o = this.drawY + (this.height - i) / 2;
|
|
2165
2165
|
if (this.hoverIconName && this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === this.rowIndex) {
|
|
2166
2166
|
const n = this.ctx.icons.get(this.hoverIconName);
|
|
2167
|
-
this.drawImageX =
|
|
2167
|
+
this.drawImageX = r, this.drawImageY = o, this.drawImageWidth = i, this.drawImageHeight = i, this.drawImageName = this.hoverIconName, this.drawImageSource = n;
|
|
2168
2168
|
}
|
|
2169
2169
|
}
|
|
2170
2170
|
/**
|
|
@@ -2220,11 +2220,11 @@ class ee extends te {
|
|
|
2220
2220
|
const {
|
|
2221
2221
|
paint: e,
|
|
2222
2222
|
config: { BORDER_COLOR: i }
|
|
2223
|
-
} = this.ctx, { drawX: s, drawY:
|
|
2224
|
-
e.drawRect(s,
|
|
2223
|
+
} = this.ctx, { drawX: s, drawY: r } = this;
|
|
2224
|
+
e.drawRect(s, r, this.visibleWidth, this.visibleHeight, {
|
|
2225
2225
|
borderColor: i,
|
|
2226
2226
|
fillColor: this.drawCellBgColor
|
|
2227
|
-
}), e.drawRect(s,
|
|
2227
|
+
}), e.drawRect(s, r, this.width, this.height, {
|
|
2228
2228
|
borderColor: "transparent",
|
|
2229
2229
|
borderWidth: 1,
|
|
2230
2230
|
fillColor: this.drawCellSkyBgColor
|
|
@@ -2238,9 +2238,9 @@ class ee extends te {
|
|
|
2238
2238
|
if (i === 0)
|
|
2239
2239
|
return 0;
|
|
2240
2240
|
let s = 0;
|
|
2241
|
-
for (let
|
|
2242
|
-
const
|
|
2243
|
-
s +=
|
|
2241
|
+
for (let r = e; r < e + i; r++) {
|
|
2242
|
+
const o = this.ctx.header.leafCellHeaders[r];
|
|
2243
|
+
s += o.width;
|
|
2244
2244
|
}
|
|
2245
2245
|
return s;
|
|
2246
2246
|
}
|
|
@@ -2276,7 +2276,7 @@ class ee extends te {
|
|
|
2276
2276
|
const { SELECT_BORDER_COLOR: e, ENABLE_AUTOFILL: i, ENABLE_SELECTOR: s } = this.ctx.config;
|
|
2277
2277
|
if (!s || !i)
|
|
2278
2278
|
return;
|
|
2279
|
-
const { xArr:
|
|
2279
|
+
const { xArr: r, yArr: o } = this.ctx.selector, n = r[1], l = o[1], { colIndex: h, rowIndex: f, drawX: d, drawY: x } = this;
|
|
2280
2280
|
h === n && f === l && this.ctx.paint.drawRect(d + this.width - 6, x + this.height - 6, 6, 6, {
|
|
2281
2281
|
borderColor: "#fff",
|
|
2282
2282
|
fillColor: e
|
|
@@ -2288,10 +2288,10 @@ class ee extends te {
|
|
|
2288
2288
|
const { ENABLE_SELECTOR: e } = this.ctx.config;
|
|
2289
2289
|
if (!e)
|
|
2290
2290
|
return;
|
|
2291
|
-
const { xArr: i, yArr: s, xArrCopy:
|
|
2291
|
+
const { xArr: i, yArr: s, xArrCopy: r, yArrCopy: o } = this.ctx.selector;
|
|
2292
2292
|
this.drawBorder({
|
|
2293
|
-
xArr:
|
|
2294
|
-
yArr:
|
|
2293
|
+
xArr: r,
|
|
2294
|
+
yArr: o,
|
|
2295
2295
|
borderColor: this.ctx.config.SELECT_BORDER_COLOR || "rgb(82,146,247)",
|
|
2296
2296
|
fillColor: this.ctx.config.SELECT_AREA_COLOR || "rgba(82,146,247,0.1)",
|
|
2297
2297
|
borderWidth: 1,
|
|
@@ -2314,13 +2314,13 @@ class ee extends te {
|
|
|
2314
2314
|
drawErrorTip() {
|
|
2315
2315
|
if (this.cellType === "footer" || !this.message)
|
|
2316
2316
|
return;
|
|
2317
|
-
const { ERROR_TIP_ICON_SIZE: e, ERROR_TIP_COLOR: i } = this.ctx.config, { width: s } = this,
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2317
|
+
const { ERROR_TIP_ICON_SIZE: e, ERROR_TIP_COLOR: i } = this.ctx.config, { width: s } = this, r = this.drawX, o = this.drawY, n = [
|
|
2318
|
+
r + s - e - 0.5,
|
|
2319
|
+
o,
|
|
2320
|
+
r + s - 0.5,
|
|
2321
|
+
o,
|
|
2322
|
+
r + s - 0.5,
|
|
2323
|
+
o + e
|
|
2324
2324
|
];
|
|
2325
2325
|
this.ctx.paint.drawLine(n, {
|
|
2326
2326
|
borderColor: i,
|
|
@@ -2331,32 +2331,32 @@ class ee extends te {
|
|
|
2331
2331
|
});
|
|
2332
2332
|
}
|
|
2333
2333
|
drawBorder(e) {
|
|
2334
|
-
const { drawX: i, drawY: s, width:
|
|
2334
|
+
const { drawX: i, drawY: s, width: r, rowIndex: o, colIndex: n } = this, l = i + 0.5;
|
|
2335
2335
|
let h = s + 0.5, f = this.height;
|
|
2336
|
-
|
|
2336
|
+
o === 0 && (h = this.y + 1, f = f - 1);
|
|
2337
2337
|
const { xArr: d, yArr: x, lineDash: u = [], borderWidth: p = 1, borderColor: g, fillColor: w } = e, y = d[0], C = d[1], m = x[0], E = x[1];
|
|
2338
|
-
n >= y && n <= C &&
|
|
2338
|
+
n >= y && n <= C && o === m && this.ctx.paint.drawLine([l, h, l + r - 2, h], {
|
|
2339
2339
|
borderColor: g,
|
|
2340
2340
|
fillColor: w,
|
|
2341
2341
|
borderWidth: p,
|
|
2342
2342
|
lineCap: "round",
|
|
2343
2343
|
lineJoin: "round",
|
|
2344
2344
|
lineDash: u
|
|
2345
|
-
}), n >= y && n <= C &&
|
|
2345
|
+
}), n >= y && n <= C && o === E && this.ctx.paint.drawLine([l, h + f - 1.5, l + r, h + f - 1.5], {
|
|
2346
2346
|
borderColor: g,
|
|
2347
2347
|
fillColor: w,
|
|
2348
2348
|
borderWidth: p,
|
|
2349
2349
|
lineCap: "round",
|
|
2350
2350
|
lineJoin: "round",
|
|
2351
2351
|
lineDash: u
|
|
2352
|
-
}), n === y &&
|
|
2352
|
+
}), n === y && o >= m && o <= E && this.ctx.paint.drawLine([l, h, l, h + f - 1], {
|
|
2353
2353
|
borderColor: g,
|
|
2354
2354
|
fillColor: w,
|
|
2355
2355
|
borderWidth: p,
|
|
2356
2356
|
lineCap: "round",
|
|
2357
2357
|
lineJoin: "round",
|
|
2358
2358
|
lineDash: u
|
|
2359
|
-
}), n === C &&
|
|
2359
|
+
}), n === C && o >= m && o <= E && this.ctx.paint.drawLine([l + r - 1, h, l + r - 1, h + f - 1], {
|
|
2360
2360
|
borderColor: g,
|
|
2361
2361
|
fillColor: w,
|
|
2362
2362
|
borderWidth: p,
|
|
@@ -2367,8 +2367,8 @@ class ee extends te {
|
|
|
2367
2367
|
}
|
|
2368
2368
|
}
|
|
2369
2369
|
class ie extends te {
|
|
2370
|
-
constructor(e, i, s,
|
|
2371
|
-
super(e, s,
|
|
2370
|
+
constructor(e, i, s, r, o, n, l) {
|
|
2371
|
+
super(e, s, r, o, n, l.fixed, "header");
|
|
2372
2372
|
c(this, "align");
|
|
2373
2373
|
c(this, "verticalAlign", "middle");
|
|
2374
2374
|
c(this, "fixed");
|
|
@@ -2402,7 +2402,7 @@ class ie extends te {
|
|
|
2402
2402
|
c(this, "drawImageHeight", 0);
|
|
2403
2403
|
c(this, "drawImageName", "");
|
|
2404
2404
|
c(this, "drawImageSource");
|
|
2405
|
-
this.ctx = e, this.x = s, this.y =
|
|
2405
|
+
this.ctx = e, this.x = s, this.y = r, this.width = o, this.height = n, this.colIndex = i, this.key = l.key, this.type = l.type, this.editorType = l.editorType || "text", this.align = l.align || "center", this.verticalAlign = l.verticalAlign || "middle", this.fixed = l.fixed, this.level = l.level, this.operation = l.operation || !1, this.text = l.title, this.column = l, this.colspan = l.colspan, this.widthFillDisable = l.widthFillDisable, this.rowspan = l.rowspan, this.rules = l.rules, this.readonly = l.readonly, this.required = l.required, this.rowKey = Lt(), this.hasChildren = l.children && l.children.length > 0 || !1, this.render = l.renderHeader;
|
|
2406
2406
|
}
|
|
2407
2407
|
/**
|
|
2408
2408
|
* 是否可见,覆盖基类方法,表头是跟y滚动条没有关系的所以不需要加滚动参数
|
|
@@ -2420,15 +2420,15 @@ class ie extends te {
|
|
|
2420
2420
|
}
|
|
2421
2421
|
updateContainer() {
|
|
2422
2422
|
const { HEADER_CELL_STYLE_METHOD: e, HEADER_BG_COLOR: i, HEADER_TEXT_COLOR: s } = this.ctx.config;
|
|
2423
|
-
let
|
|
2423
|
+
let r = i, o = s;
|
|
2424
2424
|
if (typeof e == "function") {
|
|
2425
2425
|
const n = e, { backgroundColor: l, color: h } = n({
|
|
2426
2426
|
colIndex: this.colIndex,
|
|
2427
2427
|
column: this.column
|
|
2428
2428
|
}) || {};
|
|
2429
|
-
l && (
|
|
2429
|
+
l && (r = l), h && (o = h);
|
|
2430
2430
|
}
|
|
2431
|
-
this.drawCellBgColor =
|
|
2431
|
+
this.drawCellBgColor = r, this.drawTextColor = o;
|
|
2432
2432
|
}
|
|
2433
2433
|
update() {
|
|
2434
2434
|
this.updateContainer(), this.displayText = this.getText(), this.drawX = this.getDrawX(), this.drawY = this.getDrawY(), this.updateStyle();
|
|
@@ -2436,13 +2436,13 @@ class ie extends te {
|
|
|
2436
2436
|
draw() {
|
|
2437
2437
|
const {
|
|
2438
2438
|
paint: e,
|
|
2439
|
-
config: { BORDER_COLOR: i, CELL_PADDING: s, HEADER_FONT:
|
|
2440
|
-
} = this.ctx, { drawX:
|
|
2441
|
-
e.drawRect(
|
|
2439
|
+
config: { BORDER_COLOR: i, CELL_PADDING: s, HEADER_FONT: r }
|
|
2440
|
+
} = this.ctx, { drawX: o, drawY: n, displayText: l } = this;
|
|
2441
|
+
e.drawRect(o, n, this.width, this.height, {
|
|
2442
2442
|
borderColor: i,
|
|
2443
2443
|
fillColor: this.drawCellBgColor
|
|
2444
|
-
}), e.drawText(l,
|
|
2445
|
-
font:
|
|
2444
|
+
}), e.drawText(l, o, n, this.width, this.height, {
|
|
2445
|
+
font: r,
|
|
2446
2446
|
padding: s,
|
|
2447
2447
|
color: this.drawTextColor,
|
|
2448
2448
|
align: this.align,
|
|
@@ -2452,9 +2452,9 @@ class ie extends te {
|
|
|
2452
2452
|
drawSelection() {
|
|
2453
2453
|
const { width: e, height: i, type: s } = this;
|
|
2454
2454
|
if (["index-selection", "selection"].includes(s)) {
|
|
2455
|
-
const { indeterminate:
|
|
2455
|
+
const { indeterminate: r, check: o, selectable: n } = this.ctx.database.getCheckedState(), { CHECKBOX_SIZE: l = 0 } = this.ctx.config, h = this.drawX + (e - l) / 2, f = this.drawY + (i - l) / 2;
|
|
2456
2456
|
let d = this.ctx.icons.get("checkbox-uncheck"), x = "checkbox-uncheck";
|
|
2457
|
-
|
|
2457
|
+
r ? (d = this.ctx.icons.get("checkbox-indeterminate"), x = "checkbox-indeterminate") : o && n ? (d = this.ctx.icons.get("checkbox-check"), x = "checkbox-check") : o && n ? (d = this.ctx.icons.get("checkbox-check-disabled"), x = "checkbox-check-disabled") : !o && n ? (d = this.ctx.icons.get("checkbox-uncheck"), x = "checkbox-uncheck") : (d = this.ctx.icons.get("checkbox-disabled"), x = "checkbox-disabled"), d && (this.drawImageX = h, this.drawImageY = f, this.drawImageWidth = l, this.drawImageHeight = l, this.drawImageName = x, this.drawImageSource = d, this.ctx.paint.drawImage(
|
|
2458
2458
|
this.drawImageSource,
|
|
2459
2459
|
this.drawImageX,
|
|
2460
2460
|
this.drawImageY,
|
|
@@ -2496,16 +2496,16 @@ class ci {
|
|
|
2496
2496
|
if (t.button !== 0 || this.isBusy(t))
|
|
2497
2497
|
return;
|
|
2498
2498
|
const e = t.offsetY, i = t.offsetX, s = this.ctx.header.renderCellHeaders;
|
|
2499
|
-
for (const
|
|
2500
|
-
const n =
|
|
2501
|
-
if (i > n && i < n +
|
|
2502
|
-
this.ctx.focusCellHeader =
|
|
2499
|
+
for (const o of s) {
|
|
2500
|
+
const n = o.getDrawX(), l = o.getDrawY();
|
|
2501
|
+
if (i > n && i < n + o.width && e > l && e < l + o.height) {
|
|
2502
|
+
this.ctx.focusCellHeader = o, this.ctx.emit("cellHeaderMousedown", o, t);
|
|
2503
2503
|
return;
|
|
2504
2504
|
}
|
|
2505
2505
|
}
|
|
2506
|
-
const
|
|
2507
|
-
for (const
|
|
2508
|
-
const n =
|
|
2506
|
+
const r = this.ctx.body.renderRows;
|
|
2507
|
+
for (const o of r) {
|
|
2508
|
+
const n = o.fixedCells.concat(o.noFixedCells);
|
|
2509
2509
|
for (const l of n) {
|
|
2510
2510
|
const h = l.getDrawX(), f = l.getDrawY();
|
|
2511
2511
|
if (i > h && i < h + l.width && e > f && e < f + l.height) {
|
|
@@ -2518,16 +2518,16 @@ class ci {
|
|
|
2518
2518
|
if (t.button !== 0 || this.isBusy(t))
|
|
2519
2519
|
return;
|
|
2520
2520
|
const e = t.offsetY, i = t.offsetX, s = this.ctx.header.renderCellHeaders;
|
|
2521
|
-
for (const
|
|
2522
|
-
const n =
|
|
2523
|
-
if (i > n && i < n +
|
|
2524
|
-
this.ctx.clickCellHeader =
|
|
2521
|
+
for (const o of s) {
|
|
2522
|
+
const n = o.getDrawX(), l = o.getDrawY();
|
|
2523
|
+
if (i > n && i < n + o.width && e > l && e < l + o.height) {
|
|
2524
|
+
this.ctx.clickCellHeader = o, this.ctx.emit("cellHeaderClick", o, t), this.selectionClick(o);
|
|
2525
2525
|
return;
|
|
2526
2526
|
}
|
|
2527
2527
|
}
|
|
2528
|
-
const
|
|
2529
|
-
for (const
|
|
2530
|
-
const n =
|
|
2528
|
+
const r = this.ctx.body.renderRows;
|
|
2529
|
+
for (const o of r) {
|
|
2530
|
+
const n = o.fixedCells.concat(o.noFixedCells);
|
|
2531
2531
|
for (const l of n) {
|
|
2532
2532
|
const h = l.getDrawX(), f = l.getDrawY();
|
|
2533
2533
|
if (i > h && i < h + l.width && e > f && e < f + l.height) {
|
|
@@ -2540,16 +2540,16 @@ class ci {
|
|
|
2540
2540
|
if (this.isBusy(t))
|
|
2541
2541
|
return;
|
|
2542
2542
|
const e = t.offsetY, i = t.offsetX, s = this.ctx.header.renderCellHeaders;
|
|
2543
|
-
for (const
|
|
2544
|
-
const n =
|
|
2545
|
-
if (i > n && i < n +
|
|
2546
|
-
this.ctx.emit("cellHeaderContextMenuClick",
|
|
2543
|
+
for (const o of s) {
|
|
2544
|
+
const n = o.getDrawX(), l = o.getDrawY();
|
|
2545
|
+
if (i > n && i < n + o.width && e > l && e < l + o.height) {
|
|
2546
|
+
this.ctx.emit("cellHeaderContextMenuClick", o, t);
|
|
2547
2547
|
return;
|
|
2548
2548
|
}
|
|
2549
2549
|
}
|
|
2550
|
-
const
|
|
2551
|
-
for (const
|
|
2552
|
-
const n =
|
|
2550
|
+
const r = this.ctx.body.renderRows;
|
|
2551
|
+
for (const o of r) {
|
|
2552
|
+
const n = o.fixedCells.concat(o.noFixedCells);
|
|
2553
2553
|
for (const l of n) {
|
|
2554
2554
|
const h = l.getDrawX(), f = l.getDrawY();
|
|
2555
2555
|
if (i > h && i < h + l.width && e > f && e < f + l.height) {
|
|
@@ -2559,7 +2559,7 @@ class ci {
|
|
|
2559
2559
|
}
|
|
2560
2560
|
}
|
|
2561
2561
|
}), this.ctx.on("mousemove", (t) => {
|
|
2562
|
-
var
|
|
2562
|
+
var o;
|
|
2563
2563
|
if (this.isBusy(t))
|
|
2564
2564
|
return;
|
|
2565
2565
|
const e = t.offsetY, i = t.offsetX, s = this.ctx.header.renderCellHeaders;
|
|
@@ -2572,14 +2572,14 @@ class ci {
|
|
|
2572
2572
|
return;
|
|
2573
2573
|
}
|
|
2574
2574
|
}
|
|
2575
|
-
const
|
|
2576
|
-
for (const n of
|
|
2575
|
+
const r = this.ctx.body.renderRows;
|
|
2576
|
+
for (const n of r) {
|
|
2577
2577
|
const l = n.fixedCells.concat(n.noFixedCells);
|
|
2578
2578
|
for (const h of l) {
|
|
2579
2579
|
const f = h.getDrawX(), d = h.getDrawY();
|
|
2580
2580
|
if (i > f && i < f + h.visibleWidth && e > d && e < d + h.visibleHeight && (this.imageEnterAndLeave(h, t), this.visibleHoverCell !== h && (this.ctx.emit("visibleCellMouseleave", h, t), this.visibleHoverCell = h, this.ctx.emit("visibleCellHoverChange", h, t))), i > f && i < f + h.width && e > d && e < d + h.height) {
|
|
2581
2581
|
if (this.ctx.emit("cellMouseenter", h, t), this.ctx.hoverCell && this.ctx.hoverCell !== h && this.ctx.emit("cellMouseleave", this.ctx.hoverCell, t), this.ctx.hoverCell === h) return;
|
|
2582
|
-
((
|
|
2582
|
+
((o = this.ctx.hoverCell) == null ? void 0 : o.rowKey) !== h.rowKey && (this.ctx.hoverCell = h, this.ctx.hoverRow = this.ctx.body.renderRows.find((x) => x.rowKey === h.rowKey), this.ctx.emit("rowHoverChange", this.ctx.hoverRow, h, t), this.ctx.emit("draw")), this.ctx.hoverCell = h, this.ctx.emit("cellHoverChange", h, t);
|
|
2583
2583
|
return;
|
|
2584
2584
|
}
|
|
2585
2585
|
}
|
|
@@ -2606,9 +2606,9 @@ class ci {
|
|
|
2606
2606
|
*/
|
|
2607
2607
|
treeClick(t) {
|
|
2608
2608
|
if (t.type === "tree" && this.ctx.isPointer) {
|
|
2609
|
-
const e = this.ctx.database.getRowForRowKey(t.rowKey), { expand: i = !1, expandLazy: s = !1 } = e || {}, { EXPAND_LAZY:
|
|
2610
|
-
if (
|
|
2611
|
-
typeof
|
|
2609
|
+
const e = this.ctx.database.getRowForRowKey(t.rowKey), { expand: i = !1, expandLazy: s = !1 } = e || {}, { EXPAND_LAZY: r, EXPAND_LAZY_METHOD: o } = this.ctx.config;
|
|
2610
|
+
if (r && o && !i && !s)
|
|
2611
|
+
typeof o == "function" && (this.ctx.database.expandLoading(t.rowKey, !0), o({
|
|
2612
2612
|
row: t.row,
|
|
2613
2613
|
rowIndex: t.rowIndex,
|
|
2614
2614
|
colIndex: t.colIndex,
|
|
@@ -2768,13 +2768,13 @@ class li {
|
|
|
2768
2768
|
getSelectedData() {
|
|
2769
2769
|
const t = [], e = this.selector.yArr, i = this.selector.xArr;
|
|
2770
2770
|
let s = "";
|
|
2771
|
-
for (let
|
|
2772
|
-
const
|
|
2771
|
+
for (let r = 0; r <= e[1] - e[0]; r++) {
|
|
2772
|
+
const o = [];
|
|
2773
2773
|
for (let n = 0; n <= i[1] - i[0]; n++) {
|
|
2774
|
-
const l =
|
|
2775
|
-
f &&
|
|
2774
|
+
const l = r + e[0], h = n + i[0], f = this.database.getItemValueForRowIndexAndColIndex(l, h);
|
|
2775
|
+
f && o.push(f.value);
|
|
2776
2776
|
}
|
|
2777
|
-
s += `${
|
|
2777
|
+
s += `${o.join(" ")}\r`, t.push(o);
|
|
2778
2778
|
}
|
|
2779
2779
|
return s = s ? s.replace(/\r$/, "") : " ", {
|
|
2780
2780
|
xArr: i,
|
|
@@ -2787,9 +2787,9 @@ class li {
|
|
|
2787
2787
|
let i = Math.floor(t);
|
|
2788
2788
|
const s = this.body.width - this.body.visibleWidth;
|
|
2789
2789
|
i < 0 ? i = 0 : i > s && (i = s);
|
|
2790
|
-
let
|
|
2791
|
-
const
|
|
2792
|
-
|
|
2790
|
+
let r = Math.floor(e);
|
|
2791
|
+
const o = this.body.height - this.body.visibleHeight - this.footer.height;
|
|
2792
|
+
r < 0 ? r = 0 : r > o && (r = o), this.emit("setScroll", i, r);
|
|
2793
2793
|
}
|
|
2794
2794
|
setScrollX(t) {
|
|
2795
2795
|
let e = Math.floor(t);
|
|
@@ -2825,7 +2825,7 @@ class li {
|
|
|
2825
2825
|
this.eventTable.destroy(), this.eventBrowser.destroy(), this.eventBus.destroy();
|
|
2826
2826
|
}
|
|
2827
2827
|
}
|
|
2828
|
-
class
|
|
2828
|
+
class Vt {
|
|
2829
2829
|
constructor(t, e) {
|
|
2830
2830
|
c(this, "ctx");
|
|
2831
2831
|
c(this, "type");
|
|
@@ -2860,13 +2860,13 @@ class zt {
|
|
|
2860
2860
|
return;
|
|
2861
2861
|
if (this.ctx.target.style.cursor === "row-resize" || this.ctx.target.style.cursor === "col-resize")
|
|
2862
2862
|
return !0;
|
|
2863
|
-
const { offsetX: e, offsetY: i, clientX: s, clientY:
|
|
2864
|
-
if (!(s == this.clientX &&
|
|
2863
|
+
const { offsetX: e, offsetY: i, clientX: s, clientY: r } = t;
|
|
2864
|
+
if (!(s == this.clientX && r == this.clientY)) {
|
|
2865
2865
|
if (this.isOnScrollbar(e, i))
|
|
2866
|
-
this.clientX = s, this.clientY =
|
|
2866
|
+
this.clientX = s, this.clientY = r, this.isDragging = !0, this.ctx.scrollerMove = !0, this.isFocus = !0, this.dragStart = this.scroll;
|
|
2867
2867
|
else if (this.isOnTrack(e, i)) {
|
|
2868
|
-
let
|
|
2869
|
-
this.type === "vertical" ?
|
|
2868
|
+
let o = 0;
|
|
2869
|
+
this.type === "vertical" ? o = (i - this.ctx.header.height - this.barHeight / 2) / (this.visibleDistance - this.barHeight) * this.distance : o = (e - this.barWidth / 2) / (this.visibleDistance - this.barWidth) * this.distance, this.scroll = Math.max(0, Math.min(o, this.distance));
|
|
2870
2870
|
}
|
|
2871
2871
|
}
|
|
2872
2872
|
}
|
|
@@ -2874,16 +2874,16 @@ class zt {
|
|
|
2874
2874
|
this.isDragging = !1, this.isFocus = !1, this.clientX = 0, this.clientY = 0;
|
|
2875
2875
|
}
|
|
2876
2876
|
onMouseMove(t) {
|
|
2877
|
-
const { offsetX: e, offsetY: i, clientX: s, clientY:
|
|
2878
|
-
if (this.isOnScrollbar(e, i) && t.target === this.ctx.target ? this.isFocus = !0 : this.isFocus = !1, s == this.clientX &&
|
|
2879
|
-
let
|
|
2880
|
-
if (this.type === "horizontal" ?
|
|
2877
|
+
const { offsetX: e, offsetY: i, clientX: s, clientY: r } = t;
|
|
2878
|
+
if (this.isOnScrollbar(e, i) && t.target === this.ctx.target ? this.isFocus = !0 : this.isFocus = !1, s == this.clientX && r == this.clientY) return;
|
|
2879
|
+
let o = 0;
|
|
2880
|
+
if (this.type === "horizontal" ? o = s - this.clientX : o = r - this.clientY, this.isDragging && o !== 0) {
|
|
2881
2881
|
let n = 0;
|
|
2882
|
-
this.type === "vertical" ? n = this.dragStart +
|
|
2882
|
+
this.type === "vertical" ? n = this.dragStart + o / (this.visibleDistance - this.barHeight) * this.distance : n = this.dragStart + o / (this.visibleDistance - this.barWidth) * this.distance, this.scroll = Math.max(0, Math.min(n, this.distance));
|
|
2883
2883
|
}
|
|
2884
2884
|
}
|
|
2885
|
-
isPointInElement(t, e, i, s,
|
|
2886
|
-
return t >= i && t <= i +
|
|
2885
|
+
isPointInElement(t, e, i, s, r, o) {
|
|
2886
|
+
return t >= i && t <= i + r && e >= s && e <= s + o;
|
|
2887
2887
|
}
|
|
2888
2888
|
isOnScrollbar(t, e) {
|
|
2889
2889
|
return this.isPointInElement(t, e, this.barX, this.barY, this.barWidth, this.barHeight);
|
|
@@ -2900,19 +2900,19 @@ class zt {
|
|
|
2900
2900
|
body: t,
|
|
2901
2901
|
header: e,
|
|
2902
2902
|
config: { SCROLLER_TRACK_SIZE: i = 0, SCROLLER_SIZE: s = 0 }
|
|
2903
|
-
} = this.ctx,
|
|
2903
|
+
} = this.ctx, r = this.ctx.target.width + 1, o = this.ctx.target.height, n = e.height, l = e.width, h = t.height, f = this.ctx.footer.height;
|
|
2904
2904
|
if (this.type === "vertical") {
|
|
2905
|
-
this.visibleDistance =
|
|
2905
|
+
this.visibleDistance = o - i - n, this.distance = h - this.visibleDistance + f, this.trackX = r - i, this.trackY = 0, this.splitPoints = [this.trackX, n, this.trackX + i, n], this.trackWidth = i, this.trackHeight = o, this.barX = this.trackX + (i - s) / 2, this.barWidth = s;
|
|
2906
2906
|
const d = this.distance ? this.visibleDistance / h : 0;
|
|
2907
2907
|
let x = Math.floor(d * this.visibleDistance);
|
|
2908
2908
|
x < 30 ? x = 30 : x > this.visibleDistance && (x = 0), this.barHeight = x, this.barY = n + this.scroll / this.distance * (this.visibleDistance - this.barHeight), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
|
|
2909
2909
|
} else {
|
|
2910
|
-
this.visibleDistance =
|
|
2911
|
-
o - i,
|
|
2910
|
+
this.visibleDistance = r - i, this.distance = l - this.visibleDistance, this.splitPoints = [
|
|
2912
2911
|
r - i,
|
|
2913
2912
|
o - i,
|
|
2914
|
-
r
|
|
2915
|
-
|
|
2913
|
+
r - i,
|
|
2914
|
+
o
|
|
2915
|
+
], this.trackX = 0, this.trackY = o - i, this.trackWidth = r, this.trackHeight = i;
|
|
2916
2916
|
const d = this.distance ? this.visibleDistance / l : 0;
|
|
2917
2917
|
let x = Math.floor(d * this.visibleDistance);
|
|
2918
2918
|
this.barY = this.trackY + 0.5 + (i - s) / 2, x < 30 ? x = 30 : x >= this.visibleDistance && (x = 0), this.barWidth = x, this.barHeight = s, this.barX = this.scroll / this.distance * (this.visibleDistance - this.barWidth), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
|
|
@@ -2939,7 +2939,7 @@ class hi {
|
|
|
2939
2939
|
c(this, "ctx");
|
|
2940
2940
|
c(this, "verticalScrollbar");
|
|
2941
2941
|
c(this, "horizontalScrollbar");
|
|
2942
|
-
this.ctx = t, this.verticalScrollbar = new
|
|
2942
|
+
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("setScroll", (e, i) => {
|
|
2943
2943
|
this.setScroll(e, i);
|
|
2944
2944
|
}), this.ctx.on("setScrollX", (e) => {
|
|
2945
2945
|
this.setScrollX(e);
|
|
@@ -2986,8 +2986,8 @@ class hi {
|
|
|
2986
2986
|
s > e.visibleHeight && this.setScrollY(s - e.visibleHeight / 2);
|
|
2987
2987
|
}
|
|
2988
2988
|
scrollToRowKey(t) {
|
|
2989
|
-
const { body: e, database: i } = this.ctx, s = i.getRowIndexForRowKey(t), { top:
|
|
2990
|
-
this.setScrollY(
|
|
2989
|
+
const { body: e, database: i } = this.ctx, s = i.getRowIndexForRowKey(t), { top: r } = i.getPositionForRowIndex(s);
|
|
2990
|
+
this.setScrollY(r - e.visibleHeight / 2);
|
|
2991
2991
|
}
|
|
2992
2992
|
}
|
|
2993
2993
|
class di {
|
|
@@ -3039,10 +3039,10 @@ class di {
|
|
|
3039
3039
|
config: { HEADER_HEIGHT: t, SCROLLER_TRACK_SIZE: e }
|
|
3040
3040
|
} = this.ctx, i = this.ctx.database.getColumns();
|
|
3041
3041
|
this.columns = i, this.allCellHeaders = [], this.leafCellHeaders = [], this.fixedLeftCellHeaders = [], this.fixedRightCellHeaders = [], this.centerCellHeaders = [];
|
|
3042
|
-
const s = Jt(i),
|
|
3043
|
-
this.height = t * s, this.width =
|
|
3044
|
-
const
|
|
3045
|
-
this.columnIndex = 0, this.resizeNum = 0, this.render(
|
|
3042
|
+
const s = Jt(i), r = _t(i);
|
|
3043
|
+
this.height = t * s, this.width = r.reduce((d, x) => d + ((x == null ? void 0 : x.width) || 100), 0), this.visibleHeight = this.height;
|
|
3044
|
+
const o = Je(Qt(i, s));
|
|
3045
|
+
this.columnIndex = 0, this.resizeNum = 0, this.render(o, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
|
|
3046
3046
|
const n = this.ctx.targetContainer.getBoundingClientRect();
|
|
3047
3047
|
this.resizeNum > 0 ? this.ctx.target.width = n.width : this.ctx.target.width = this.width + e - 1, this.visibleWidth = this.ctx.target.width - e;
|
|
3048
3048
|
const l = this.visibleWidth - this.width;
|
|
@@ -3071,36 +3071,36 @@ class di {
|
|
|
3071
3071
|
config: { RESIZE_COLUMN_MIN_WIDTH: s }
|
|
3072
3072
|
} = this.ctx;
|
|
3073
3073
|
if (this.isResizing && this.resizeTarget) {
|
|
3074
|
-
const
|
|
3075
|
-
let
|
|
3076
|
-
|
|
3074
|
+
const r = this.resizeTarget.width;
|
|
3075
|
+
let o = e.clientX - this.clientX;
|
|
3076
|
+
o + r < s && (o = -(r - s)), this.resizeDiff = o, this.ctx.emit("draw");
|
|
3077
3077
|
} else {
|
|
3078
3078
|
if (this.resizeTarget = null, this.isMouseDown)
|
|
3079
3079
|
return;
|
|
3080
3080
|
this.ctx.target.style.cursor === "col-resize" && (this.ctx.target.style.cursor = "default");
|
|
3081
|
-
const
|
|
3082
|
-
for (const
|
|
3083
|
-
const n = e.layerX, l =
|
|
3084
|
-
n > l +
|
|
3085
|
-
|
|
3081
|
+
const r = [...this.renderFixedCellHeaders, ...this.renderCenterCellHeaders];
|
|
3082
|
+
for (const o of r) {
|
|
3083
|
+
const n = e.layerX, l = o.getDrawX();
|
|
3084
|
+
n > l + o.width - 5 && n < l + o.width + 4 && n < i.width - 4 && // 视窗中最后一列不允许调整宽
|
|
3085
|
+
o.colspan <= 1 && e.target instanceof HTMLCanvasElement && this.ctx.isTarget(e.target) && e.layerY <= this.height && (this.ctx.target.style.cursor = "col-resize", this.resizeTarget = o);
|
|
3086
3086
|
}
|
|
3087
3087
|
}
|
|
3088
3088
|
}));
|
|
3089
3089
|
}
|
|
3090
3090
|
resizeColumn(t, e) {
|
|
3091
|
-
const i = (
|
|
3092
|
-
|
|
3093
|
-
if (
|
|
3094
|
-
const n =
|
|
3095
|
-
|
|
3091
|
+
const i = (r) => {
|
|
3092
|
+
r.forEach((o) => {
|
|
3093
|
+
if (o.children && o.children.length > 0 && i(o.children), o.key === t.key) {
|
|
3094
|
+
const n = o.width || 100;
|
|
3095
|
+
o.width = n + e;
|
|
3096
3096
|
}
|
|
3097
3097
|
});
|
|
3098
3098
|
};
|
|
3099
3099
|
i(this.columns), this.ctx.database.setColumns(this.columns), this.init(), this.ctx.emit("draw");
|
|
3100
3100
|
let s = 0;
|
|
3101
3101
|
if (this.width < this.visibleWidth) {
|
|
3102
|
-
const
|
|
3103
|
-
s = Math.floor(
|
|
3102
|
+
const r = this.visibleWidth - this.width;
|
|
3103
|
+
s = Math.floor(r / this.resizeNum * 100) / 100, this.resizeAllColumn(s), this.ctx.emit("draw");
|
|
3104
3104
|
}
|
|
3105
3105
|
this.ctx.emit("resizeColumnChange", {
|
|
3106
3106
|
colIndex: t.colIndex,
|
|
@@ -3115,18 +3115,18 @@ class di {
|
|
|
3115
3115
|
if (t === 0) return;
|
|
3116
3116
|
const e = /* @__PURE__ */ new Map();
|
|
3117
3117
|
let i = !0;
|
|
3118
|
-
for (const
|
|
3119
|
-
if (
|
|
3120
|
-
e.set(
|
|
3118
|
+
for (const r of this.allCellHeaders)
|
|
3119
|
+
if (r.widthFillDisable)
|
|
3120
|
+
e.set(r.key, r.width);
|
|
3121
3121
|
else {
|
|
3122
|
-
const
|
|
3123
|
-
e.set(
|
|
3122
|
+
const o = r.width + t * r.colspan;
|
|
3123
|
+
e.set(r.key, o), o < this.ctx.config.RESIZE_COLUMN_MIN_WIDTH && (i = !1);
|
|
3124
3124
|
}
|
|
3125
3125
|
if (!i)
|
|
3126
3126
|
return;
|
|
3127
|
-
const s = (
|
|
3128
|
-
|
|
3129
|
-
e.has(
|
|
3127
|
+
const s = (r) => {
|
|
3128
|
+
r.forEach((o) => {
|
|
3129
|
+
e.has(o.key) && (o.width = e.get(o.key)), o.children && o.children.length > 0 && s(o.children);
|
|
3130
3130
|
});
|
|
3131
3131
|
};
|
|
3132
3132
|
s(this.columns), this.ctx.database.setColumns(this.columns), this.init();
|
|
@@ -3134,9 +3134,9 @@ class di {
|
|
|
3134
3134
|
render(t, e) {
|
|
3135
3135
|
const i = t.length;
|
|
3136
3136
|
let s = e;
|
|
3137
|
-
const { HEADER_HEIGHT:
|
|
3138
|
-
for (let
|
|
3139
|
-
const n = t[
|
|
3137
|
+
const { HEADER_HEIGHT: r = 0 } = this.ctx.config;
|
|
3138
|
+
for (let o = 0; o < i; o++) {
|
|
3139
|
+
const n = t[o], l = r * (n.rowspan || 1), h = r * n.level;
|
|
3140
3140
|
let f = n.width || 100;
|
|
3141
3141
|
n.children && (f = _t(n.children).reduce((u, p) => u + ((p == null ? void 0 : p.width) || 100), 0));
|
|
3142
3142
|
const d = new ie(this.ctx, this.columnIndex, s, h, f, l, n);
|
|
@@ -3148,8 +3148,8 @@ class di {
|
|
|
3148
3148
|
const {
|
|
3149
3149
|
target: t,
|
|
3150
3150
|
config: { RESIZE_COLUMN_LINE_COLOR: e }
|
|
3151
|
-
} = this.ctx, i = this.resizeTarget.getDrawX(), s = this.resizeTarget.width,
|
|
3152
|
-
this.ctx.paint.drawLine(
|
|
3151
|
+
} = this.ctx, i = this.resizeTarget.getDrawX(), s = this.resizeTarget.width, r = i + s + this.resizeDiff - 0.5, o = [r + 0.5, 0, r + 0.5, t.height];
|
|
3152
|
+
this.ctx.paint.drawLine(o, {
|
|
3153
3153
|
borderColor: e,
|
|
3154
3154
|
borderWidth: 1
|
|
3155
3155
|
});
|
|
@@ -3161,19 +3161,19 @@ class di {
|
|
|
3161
3161
|
fixedRightWidth: e,
|
|
3162
3162
|
scrollX: i,
|
|
3163
3163
|
header: s,
|
|
3164
|
-
target:
|
|
3165
|
-
config: { HEADER_BG_COLOR:
|
|
3164
|
+
target: r,
|
|
3165
|
+
config: { HEADER_BG_COLOR: o, SCROLLER_TRACK_SIZE: n }
|
|
3166
3166
|
} = this.ctx;
|
|
3167
3167
|
if (i > 0 && t !== 0 && this.ctx.paint.drawShadow(this.x, this.y, t, this.height, {
|
|
3168
|
-
fillColor:
|
|
3168
|
+
fillColor: o,
|
|
3169
3169
|
side: "right",
|
|
3170
3170
|
shadowWidth: 4,
|
|
3171
3171
|
colorStart: "rgba(0,0,0,0.1)",
|
|
3172
3172
|
colorEnd: "rgba(0,0,0,0)"
|
|
3173
3173
|
}), i < Math.floor(s.width - s.visibleWidth - 1) && e !== n) {
|
|
3174
|
-
const l = s.width - (this.x + this.width) +
|
|
3174
|
+
const l = s.width - (this.x + this.width) + r.width - e;
|
|
3175
3175
|
this.ctx.paint.drawShadow(l + 1, this.y, e, this.height, {
|
|
3176
|
-
fillColor:
|
|
3176
|
+
fillColor: o,
|
|
3177
3177
|
side: "left",
|
|
3178
3178
|
shadowWidth: 4,
|
|
3179
3179
|
colorStart: "rgba(0,0,0,0)",
|
|
@@ -3189,7 +3189,7 @@ class di {
|
|
|
3189
3189
|
i.push(s), s.hasChildren || t.push(s);
|
|
3190
3190
|
}), this.fixedRightCellHeaders.forEach((s) => {
|
|
3191
3191
|
i.push(s), s.hasChildren || t.push(s);
|
|
3192
|
-
}), this.renderCenterCellHeaders = e, this.renderFixedCellHeaders = i, this.renderLeafCellHeaders = t.sort((s,
|
|
3192
|
+
}), this.renderCenterCellHeaders = e, this.renderFixedCellHeaders = i, this.renderLeafCellHeaders = t.sort((s, r) => s.x - r.x), this.visibleLeafColumns = this.renderLeafCellHeaders.map((s) => s.column), this.ctx.header.visibleLeafColumns = this.visibleLeafColumns, this.ctx.header.leafCellHeaders = this.leafCellHeaders, this.ctx.header.renderLeafCellHeaders = this.renderLeafCellHeaders, this.ctx.header.renderCellHeaders = this.renderFixedCellHeaders.concat(this.renderCenterCellHeaders);
|
|
3193
3193
|
}
|
|
3194
3194
|
draw() {
|
|
3195
3195
|
this.renderCenterCellHeaders.forEach((t) => {
|
|
@@ -3200,7 +3200,7 @@ class di {
|
|
|
3200
3200
|
}
|
|
3201
3201
|
}
|
|
3202
3202
|
class se {
|
|
3203
|
-
constructor(t, e, i = 0, s = 0,
|
|
3203
|
+
constructor(t, e, i = 0, s = 0, r = 0, o = 0, n, l = "body") {
|
|
3204
3204
|
c(this, "ctx");
|
|
3205
3205
|
c(this, "x", 0);
|
|
3206
3206
|
c(this, "y", 0);
|
|
@@ -3213,24 +3213,24 @@ class se {
|
|
|
3213
3213
|
c(this, "rowKey", "");
|
|
3214
3214
|
c(this, "rowType", "body");
|
|
3215
3215
|
c(this, "data");
|
|
3216
|
-
this.ctx = t, this.x = i, this.y = s, this.width =
|
|
3216
|
+
this.ctx = t, this.x = i, this.y = s, this.width = r, this.height = o, this.rowIndex = e, this.rowKey = t.database.getRowKeyForRowIndex(e), this.rowType = l, this.data = n, this.update();
|
|
3217
3217
|
}
|
|
3218
3218
|
update() {
|
|
3219
3219
|
const { header: t } = this.ctx, e = [], i = [], s = [];
|
|
3220
|
-
t.renderLeafCellHeaders.forEach((
|
|
3221
|
-
const
|
|
3220
|
+
t.renderLeafCellHeaders.forEach((r) => {
|
|
3221
|
+
const o = new ee(
|
|
3222
3222
|
this.ctx,
|
|
3223
3223
|
this.rowIndex,
|
|
3224
|
-
|
|
3225
|
-
|
|
3224
|
+
r.colIndex,
|
|
3225
|
+
r.x,
|
|
3226
3226
|
this.y,
|
|
3227
|
-
|
|
3227
|
+
r.width,
|
|
3228
3228
|
this.height,
|
|
3229
|
-
|
|
3229
|
+
r.column,
|
|
3230
3230
|
this.data,
|
|
3231
3231
|
this.rowType
|
|
3232
3232
|
);
|
|
3233
|
-
|
|
3233
|
+
o.fixed ? i.push(o) : s.push(o), e.push(o);
|
|
3234
3234
|
}), this.cells = e, this.fixedCells = i, this.noFixedCells = s;
|
|
3235
3235
|
}
|
|
3236
3236
|
drawCenter() {
|
|
@@ -3284,8 +3284,8 @@ class fi {
|
|
|
3284
3284
|
database: i,
|
|
3285
3285
|
config: {
|
|
3286
3286
|
FOOTER_FIXED: s,
|
|
3287
|
-
SCROLLER_TRACK_SIZE:
|
|
3288
|
-
BORDER_COLOR:
|
|
3287
|
+
SCROLLER_TRACK_SIZE: r = 0,
|
|
3288
|
+
BORDER_COLOR: o,
|
|
3289
3289
|
BORDER_RADIUS: n,
|
|
3290
3290
|
HEIGHT: l,
|
|
3291
3291
|
EMPTY_BODY_HEIGHT: h = 0,
|
|
@@ -3300,7 +3300,7 @@ class fi {
|
|
|
3300
3300
|
const { data: u, sumHeight: p } = i.getData();
|
|
3301
3301
|
this.height = p, this.data = u;
|
|
3302
3302
|
const { top: g } = t.getBoundingClientRect();
|
|
3303
|
-
this.width = e.width, this.visibleWidth = t.width -
|
|
3303
|
+
this.width = e.width, this.visibleWidth = t.width - r;
|
|
3304
3304
|
const w = this.ctx.footer.height;
|
|
3305
3305
|
this.data.length || (this.height = h);
|
|
3306
3306
|
const y = this.data.length ? "not-empty" : "empty";
|
|
@@ -3313,16 +3313,16 @@ class fi {
|
|
|
3313
3313
|
width: this.width,
|
|
3314
3314
|
height: this.data.length ? 0 : h + w
|
|
3315
3315
|
});
|
|
3316
|
-
let C = this.height + e.height +
|
|
3316
|
+
let C = this.height + e.height + r;
|
|
3317
3317
|
C += w;
|
|
3318
3318
|
let m = 0;
|
|
3319
3319
|
this.data.length && d ? (m = window.innerHeight - g - x, m < 0 && (m = 32, console.error(
|
|
3320
3320
|
"There is an error in the height calculation ENABLE_OFFSET_HEIGHT and OFFSET_HEIGHT are invalid"
|
|
3321
3321
|
))) : this.data.length && l ? m = l : this.data.length && f && C > f ? m = f : m = C, m > 0 && (this.ctx.target.height = m);
|
|
3322
|
-
let E = t.height - e.height -
|
|
3322
|
+
let E = t.height - e.height - r;
|
|
3323
3323
|
s ? this.visibleHeight = E - w : this.visibleHeight = E, 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 = u, this.ctx.target.setAttribute(
|
|
3324
3324
|
"style",
|
|
3325
|
-
`outline: none; position: relative; border-radius: ${n}px; border: 1px solid ${
|
|
3325
|
+
`outline: none; position: relative; border-radius: ${n}px; border: 1px solid ${o}; height:${this.ctx.target.height}px;width:${this.ctx.target.width - 1}px;`
|
|
3326
3326
|
);
|
|
3327
3327
|
}
|
|
3328
3328
|
// 调整行的高度
|
|
@@ -3338,14 +3338,14 @@ class fi {
|
|
|
3338
3338
|
this.ctx.isTarget(e.target) && (this.clientY = e.clientY, this.resizeTarget ? (this.isResizing = !0, this.ctx.rowResizing = !0) : (this.isResizing = !1, this.ctx.rowResizing = !1), this.isMouseDown = !0);
|
|
3339
3339
|
}), this.ctx.on("mousemove", (e) => {
|
|
3340
3340
|
if (this.ctx.editing) return;
|
|
3341
|
-
const i = e.offsetY, s = e.offsetX,
|
|
3342
|
-
target:
|
|
3341
|
+
const i = e.offsetY, s = e.offsetX, r = e.clientY, {
|
|
3342
|
+
target: o,
|
|
3343
3343
|
scrollY: n,
|
|
3344
3344
|
config: { RESIZE_ROW_MIN_HEIGHT: l = 0 }
|
|
3345
3345
|
} = this.ctx;
|
|
3346
3346
|
if (this.isResizing && this.resizeTarget) {
|
|
3347
3347
|
const h = this.resizeTarget.height;
|
|
3348
|
-
let f =
|
|
3348
|
+
let f = r - this.clientY;
|
|
3349
3349
|
f + h < l && (f = -(h - l)), this.resizeDiff = f, this.ctx.emit("draw");
|
|
3350
3350
|
} else {
|
|
3351
3351
|
if (this.resizeTarget = null, this.isMouseDown || this.ctx.target.style.cursor === "crosshair")
|
|
@@ -3353,7 +3353,7 @@ class fi {
|
|
|
3353
3353
|
this.ctx.target.style.cursor === "row-resize" && (this.ctx.target.style.cursor = "default");
|
|
3354
3354
|
for (let h = 0; h < this.renderRows.length; h++) {
|
|
3355
3355
|
const f = this.renderRows[h];
|
|
3356
|
-
if (i > f.y - n + f.height - 1.5 && i < f.y - n + f.height + 1.5 && i <
|
|
3356
|
+
if (i > f.y - n + f.height - 1.5 && i < f.y - n + f.height + 1.5 && i < o.height - 4)
|
|
3357
3357
|
for (let x = 0; x < f.cells.length; x++) {
|
|
3358
3358
|
const u = f.cells[x];
|
|
3359
3359
|
s > u.drawX + 10 && s < u.drawX + u.width - 10 && u.rowspan === 1 && (this.ctx.target.style.cursor = "row-resize", this.resizeTarget = f);
|
|
@@ -3363,13 +3363,13 @@ class fi {
|
|
|
3363
3363
|
}));
|
|
3364
3364
|
}
|
|
3365
3365
|
resizeRow(t, e) {
|
|
3366
|
-
const { rowIndex: i, height: s, rowKey:
|
|
3366
|
+
const { rowIndex: i, height: s, rowKey: r, data: o } = t;
|
|
3367
3367
|
this.ctx.database.setRowHeight(i, s + e), this.init(), this.ctx.emit("draw"), this.ctx.emit("resizeRowChange", {
|
|
3368
3368
|
rowIndex: i,
|
|
3369
3369
|
oldHeight: s,
|
|
3370
3370
|
height: s + e,
|
|
3371
|
-
rowKey:
|
|
3372
|
-
row:
|
|
3371
|
+
rowKey: r,
|
|
3372
|
+
row: o,
|
|
3373
3373
|
data: this.data
|
|
3374
3374
|
});
|
|
3375
3375
|
}
|
|
@@ -3379,7 +3379,7 @@ class fi {
|
|
|
3379
3379
|
target: t,
|
|
3380
3380
|
scrollY: e,
|
|
3381
3381
|
config: { RESIZE_ROW_LINE_COLOR: i }
|
|
3382
|
-
} = this.ctx, s = this.resizeTarget.y - e,
|
|
3382
|
+
} = this.ctx, s = this.resizeTarget.y - e, r = this.resizeTarget.height, o = s + r + this.resizeDiff - 0.5, n = [0, o + 0.5, t.width, o + 0.5];
|
|
3383
3383
|
this.ctx.paint.drawLine(n, {
|
|
3384
3384
|
borderColor: i,
|
|
3385
3385
|
borderWidth: 1
|
|
@@ -3392,19 +3392,19 @@ class fi {
|
|
|
3392
3392
|
fixedRightWidth: e,
|
|
3393
3393
|
scrollX: i,
|
|
3394
3394
|
header: s,
|
|
3395
|
-
target:
|
|
3396
|
-
config: { HEADER_BG_COLOR:
|
|
3395
|
+
target: r,
|
|
3396
|
+
config: { HEADER_BG_COLOR: o, SCROLLER_TRACK_SIZE: n }
|
|
3397
3397
|
} = this.ctx;
|
|
3398
3398
|
if (i > 0 && t !== 0 && this.ctx.paint.drawShadow(this.x, this.y, t, this.height, {
|
|
3399
|
-
fillColor:
|
|
3399
|
+
fillColor: o,
|
|
3400
3400
|
side: "right",
|
|
3401
3401
|
shadowWidth: 4,
|
|
3402
3402
|
colorStart: "rgba(0,0,0,0.1)",
|
|
3403
3403
|
colorEnd: "rgba(0,0,0,0)"
|
|
3404
3404
|
}), i < Math.floor(s.width - s.visibleWidth - 1) && e !== n) {
|
|
3405
|
-
const l = s.width - (this.x + this.width) +
|
|
3405
|
+
const l = s.width - (this.x + this.width) + r.width - e;
|
|
3406
3406
|
this.ctx.paint.drawShadow(l + 1, this.y, e, this.height, {
|
|
3407
|
-
fillColor:
|
|
3407
|
+
fillColor: o,
|
|
3408
3408
|
side: "left",
|
|
3409
3409
|
shadowWidth: 4,
|
|
3410
3410
|
colorStart: "rgba(0,0,0,0)",
|
|
@@ -3413,22 +3413,22 @@ class fi {
|
|
|
3413
3413
|
}
|
|
3414
3414
|
}
|
|
3415
3415
|
binarySearch(t, e) {
|
|
3416
|
-
let i = 0, s = t.length - 1,
|
|
3416
|
+
let i = 0, s = t.length - 1, r = -1;
|
|
3417
3417
|
for (; i <= s; ) {
|
|
3418
|
-
let
|
|
3418
|
+
let o = Math.floor((i + s) / 2), n = t[o].bottom;
|
|
3419
3419
|
if (n === e)
|
|
3420
|
-
return
|
|
3421
|
-
n < e ? i =
|
|
3420
|
+
return o;
|
|
3421
|
+
n < e ? i = o + 1 : (r = o, s = o - 1);
|
|
3422
3422
|
}
|
|
3423
|
-
return
|
|
3423
|
+
return r;
|
|
3424
3424
|
}
|
|
3425
3425
|
update() {
|
|
3426
3426
|
this.init();
|
|
3427
|
-
const { header: t, database: e, scrollY: i } = this.ctx, s = i, { data:
|
|
3428
|
-
this.ctx.maxRowIndex =
|
|
3429
|
-
const n = this.binarySearch(
|
|
3430
|
-
let l = this.binarySearch(
|
|
3431
|
-
l === -1 && (l =
|
|
3427
|
+
const { header: t, database: e, scrollY: i } = this.ctx, s = i, { data: r, positions: o } = e.getData();
|
|
3428
|
+
this.ctx.maxRowIndex = r.length - 1;
|
|
3429
|
+
const n = this.binarySearch(o, s);
|
|
3430
|
+
let l = this.binarySearch(o, s + this.visibleHeight);
|
|
3431
|
+
l === -1 && (l = r.length), this.headIndex = Math.max(0, n), this.tailIndex = Math.min(this.ctx.maxRowIndex, l + 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;
|
|
3432
3432
|
const h = [];
|
|
3433
3433
|
for (let f = 0; f < this.visibleRows.length; f++) {
|
|
3434
3434
|
const d = this.headIndex + f, x = this.visibleRows[f], { height: u, top: p } = this.ctx.database.getPositionForRowIndex(d), g = new se(this.ctx, d, 0, p + this.y, t.width, u, x);
|
|
@@ -3462,9 +3462,9 @@ class xi {
|
|
|
3462
3462
|
const {
|
|
3463
3463
|
header: t,
|
|
3464
3464
|
body: e,
|
|
3465
|
-
config: { CELL_FOOTER_HEIGHT: i, FOOTER_FIXED: s, SCROLLER_TRACK_SIZE:
|
|
3465
|
+
config: { CELL_FOOTER_HEIGHT: i, FOOTER_FIXED: s, SCROLLER_TRACK_SIZE: r }
|
|
3466
3466
|
} = this.ctx;
|
|
3467
|
-
this.width = t.width, this.visibleWidth = t.visibleWidth, this.height = this.data.reduce((
|
|
3467
|
+
this.width = t.width, this.visibleWidth = t.visibleWidth, this.height = this.data.reduce((o) => o + i, 0), this.visibleHeight = this.height, s ? this.y = this.ctx.target.height - this.height - r : this.y = e.y + e.height, this.ctx.footer.x = this.x, this.ctx.footer.y = this.y, this.ctx.footer.height = this.height, this.ctx.footer.width = this.width, this.ctx.footer.visibleWidth = this.visibleWidth, this.ctx.footer.visibleHeight = this.visibleHeight;
|
|
3468
3468
|
}
|
|
3469
3469
|
drawFiexShadow() {
|
|
3470
3470
|
const {
|
|
@@ -3472,20 +3472,20 @@ class xi {
|
|
|
3472
3472
|
fixedRightWidth: e,
|
|
3473
3473
|
scrollX: i,
|
|
3474
3474
|
header: s,
|
|
3475
|
-
target:
|
|
3476
|
-
config: { HEADER_BG_COLOR:
|
|
3475
|
+
target: r,
|
|
3476
|
+
config: { HEADER_BG_COLOR: o, SCROLLER_TRACK_SIZE: n }
|
|
3477
3477
|
} = this.ctx;
|
|
3478
3478
|
let l = this.y;
|
|
3479
3479
|
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, {
|
|
3480
|
-
fillColor:
|
|
3480
|
+
fillColor: o,
|
|
3481
3481
|
side: "right",
|
|
3482
3482
|
shadowWidth: 4,
|
|
3483
3483
|
colorStart: "rgba(0,0,0,0.1)",
|
|
3484
3484
|
colorEnd: "rgba(0,0,0,0)"
|
|
3485
3485
|
}), i < Math.floor(s.width - s.visibleWidth - 1) && e !== n) {
|
|
3486
|
-
const h = s.width - (this.x + this.width) +
|
|
3486
|
+
const h = s.width - (this.x + this.width) + r.width - e;
|
|
3487
3487
|
this.ctx.paint.drawShadow(h + 1, l, e, this.height, {
|
|
3488
|
-
fillColor:
|
|
3488
|
+
fillColor: o,
|
|
3489
3489
|
side: "left",
|
|
3490
3490
|
shadowWidth: 4,
|
|
3491
3491
|
colorStart: "rgba(0,0,0,0)",
|
|
@@ -3498,10 +3498,10 @@ class xi {
|
|
|
3498
3498
|
const { CELL_FOOTER_HEIGHT: t } = this.ctx.config;
|
|
3499
3499
|
let e = this.y;
|
|
3500
3500
|
const i = [];
|
|
3501
|
-
this.data.forEach((s,
|
|
3502
|
-
const
|
|
3501
|
+
this.data.forEach((s, r) => {
|
|
3502
|
+
const o = new se(
|
|
3503
3503
|
this.ctx,
|
|
3504
|
-
|
|
3504
|
+
r,
|
|
3505
3505
|
0,
|
|
3506
3506
|
e,
|
|
3507
3507
|
this.width,
|
|
@@ -3509,7 +3509,7 @@ class xi {
|
|
|
3509
3509
|
s,
|
|
3510
3510
|
"footer"
|
|
3511
3511
|
);
|
|
3512
|
-
e += t, i.push(
|
|
3512
|
+
e += t, i.push(o);
|
|
3513
3513
|
}), this.renderRows = i, this.ctx.footer.renderRows = this.renderRows;
|
|
3514
3514
|
}
|
|
3515
3515
|
draw() {
|
|
@@ -3612,16 +3612,16 @@ class ui {
|
|
|
3612
3612
|
}
|
|
3613
3613
|
setSelector(t, e) {
|
|
3614
3614
|
const { ENABLE_SELECTOR_SPAN_COL: i, ENABLE_SELECTOR_SPAN_ROW: s } = this.ctx.config;
|
|
3615
|
-
let
|
|
3615
|
+
let r = t, o = e;
|
|
3616
3616
|
if (!s) {
|
|
3617
|
-
const [n] = r;
|
|
3618
|
-
r = [n, n];
|
|
3619
|
-
}
|
|
3620
|
-
if (!i) {
|
|
3621
3617
|
const [n] = o;
|
|
3622
3618
|
o = [n, n];
|
|
3623
3619
|
}
|
|
3624
|
-
if (
|
|
3620
|
+
if (!i) {
|
|
3621
|
+
const [n] = r;
|
|
3622
|
+
r = [n, n];
|
|
3623
|
+
}
|
|
3624
|
+
if (JSON.stringify(this.ctx.selector.xArr) !== JSON.stringify(r) || JSON.stringify(this.ctx.selector.yArr) !== JSON.stringify(o)) {
|
|
3625
3625
|
this.ctx.mousedown && (this.ctx.selectorMove = !0), this.ctx.selector.enable = !0;
|
|
3626
3626
|
const {
|
|
3627
3627
|
SELECTOR_AREA_MIN_X: n,
|
|
@@ -3631,7 +3631,7 @@ class ui {
|
|
|
3631
3631
|
SELECTOR_AREA_MAX_X_OFFSET: d,
|
|
3632
3632
|
SELECTOR_AREA_MAX_Y_OFFSET: x
|
|
3633
3633
|
} = this.ctx.config, u = n, p = l || this.ctx.maxColIndex - d, g = h, w = f || this.ctx.maxRowIndex - x;
|
|
3634
|
-
let [y, C] =
|
|
3634
|
+
let [y, C] = r, [m, E] = o;
|
|
3635
3635
|
if (y < u || C > p || m < g || E > w)
|
|
3636
3636
|
return;
|
|
3637
3637
|
this.ctx.selector.xArr = [Math.max(u, y), Math.min(p, C)], this.ctx.selector.yArr = [Math.max(g, m), Math.min(w, E)], this.ctx.emit("setSelector", this.ctx.selector), this.ctx.emit("draw");
|
|
@@ -3644,18 +3644,18 @@ class ui {
|
|
|
3644
3644
|
this.selectAll();
|
|
3645
3645
|
return;
|
|
3646
3646
|
}
|
|
3647
|
-
const { SELECTOR_AREA_MIN_Y: e, SELECTOR_AREA_MAX_Y: i, SELECTOR_AREA_MAX_Y_OFFSET: s } = this.ctx.config,
|
|
3647
|
+
const { SELECTOR_AREA_MIN_Y: e, SELECTOR_AREA_MAX_Y: i, SELECTOR_AREA_MAX_Y_OFFSET: s } = this.ctx.config, r = e, o = i || this.ctx.maxRowIndex - s;
|
|
3648
3648
|
if (this.ctx.mousedown && this.ctx.focusCellHeader) {
|
|
3649
3649
|
const { colIndex: n } = this.ctx.focusCellHeader;
|
|
3650
3650
|
if (this.ctx.clearSelector(), t.colIndex >= n) {
|
|
3651
|
-
const l = [n, t.colIndex + t.colspan - 1], h = [
|
|
3651
|
+
const l = [n, t.colIndex + t.colspan - 1], h = [r, o];
|
|
3652
3652
|
this.setSelector(l, h);
|
|
3653
3653
|
} else {
|
|
3654
|
-
const l = [t.colIndex, n], h = [
|
|
3654
|
+
const l = [t.colIndex, n], h = [r, o];
|
|
3655
3655
|
this.setSelector(l, h);
|
|
3656
3656
|
}
|
|
3657
3657
|
} else {
|
|
3658
|
-
const n = [t.colIndex, t.colIndex + t.colspan - 1], l = [
|
|
3658
|
+
const n = [t.colIndex, t.colIndex + t.colspan - 1], l = [r, o];
|
|
3659
3659
|
this.setSelector(n, l);
|
|
3660
3660
|
}
|
|
3661
3661
|
}
|
|
@@ -3667,30 +3667,30 @@ class ui {
|
|
|
3667
3667
|
const {
|
|
3668
3668
|
SELECTOR_AREA_MIN_X: i,
|
|
3669
3669
|
SELECTOR_AREA_MAX_X: s,
|
|
3670
|
-
SELECTOR_AREA_MIN_Y:
|
|
3671
|
-
SELECTOR_AREA_MAX_Y:
|
|
3670
|
+
SELECTOR_AREA_MIN_Y: r,
|
|
3671
|
+
SELECTOR_AREA_MAX_Y: o,
|
|
3672
3672
|
SELECTOR_AREA_MAX_X_OFFSET: n,
|
|
3673
3673
|
SELECTOR_AREA_MAX_Y_OFFSET: l
|
|
3674
|
-
} = this.ctx.config, h = i, f = s || this.ctx.maxColIndex - n, d =
|
|
3674
|
+
} = this.ctx.config, h = i, f = s || this.ctx.maxColIndex - n, d = r, x = o || this.ctx.maxRowIndex - l, u = [h, f], p = [d, x];
|
|
3675
3675
|
this.setSelector(u, p);
|
|
3676
3676
|
}
|
|
3677
3677
|
}
|
|
3678
3678
|
selectRows(t, e = !0) {
|
|
3679
3679
|
if (this.ctx.config.ENABLE_SELECTOR_SINGLE || !this.ctx.config.ENABLE_SELECTOR_ALL_COLS || this.ctx.autofillMove || this.ctx.editing)
|
|
3680
3680
|
return;
|
|
3681
|
-
const { SELECTOR_AREA_MIN_X: i, SELECTOR_AREA_MAX_X: s, SELECTOR_AREA_MAX_X_OFFSET:
|
|
3681
|
+
const { SELECTOR_AREA_MIN_X: i, SELECTOR_AREA_MAX_X: s, SELECTOR_AREA_MAX_X_OFFSET: r } = this.ctx.config, o = s || this.ctx.maxColIndex - r, n = i;
|
|
3682
3682
|
if (e) {
|
|
3683
3683
|
this.ctx.setFocusCell(t);
|
|
3684
|
-
const l = [n,
|
|
3684
|
+
const l = [n, o], h = [t.rowIndex, t.rowIndex];
|
|
3685
3685
|
this.setSelector(l, h);
|
|
3686
3686
|
}
|
|
3687
3687
|
if (this.ctx.focusCell && this.ctx.mousedown) {
|
|
3688
3688
|
const { rowIndex: l } = this.ctx.focusCell;
|
|
3689
3689
|
if (t.rowIndex >= l) {
|
|
3690
|
-
const h = [n,
|
|
3690
|
+
const h = [n, o], f = [l, t.rowIndex];
|
|
3691
3691
|
this.setSelector(h, f);
|
|
3692
3692
|
} else {
|
|
3693
|
-
const h = [n,
|
|
3693
|
+
const h = [n, o], f = [t.rowIndex, l];
|
|
3694
3694
|
this.setSelector(h, f);
|
|
3695
3695
|
}
|
|
3696
3696
|
}
|
|
@@ -3700,7 +3700,7 @@ class ui {
|
|
|
3700
3700
|
return;
|
|
3701
3701
|
const { mousedown: t, focusCell: e, hoverCell: i } = this.ctx;
|
|
3702
3702
|
if (t && e && i) {
|
|
3703
|
-
const { rowIndex: s, colIndex:
|
|
3703
|
+
const { rowIndex: s, colIndex: r } = e, o = Math.min(i.colIndex, r), n = Math.max(i.colIndex, r), l = Math.min(i.rowIndex, s), h = Math.max(i.rowIndex, s), f = [o, n], d = [l, h];
|
|
3704
3704
|
this.setSelector(f, d);
|
|
3705
3705
|
}
|
|
3706
3706
|
}
|
|
@@ -3708,12 +3708,12 @@ class ui {
|
|
|
3708
3708
|
const { focusCell: e, clickCell: i } = this.ctx;
|
|
3709
3709
|
if (e && this.isInSettingRange(e.rowIndex, e.colIndex))
|
|
3710
3710
|
if (this.ctx.selector.enable = !0, i && t) {
|
|
3711
|
-
const { colIndex: s, rowIndex:
|
|
3711
|
+
const { colIndex: s, rowIndex: r } = i, { colIndex: o, rowIndex: n } = e, l = Math.min(o, s), h = Math.max(o, s), f = Math.min(n, r), d = Math.max(n, r), x = [l, h], u = [f, d];
|
|
3712
3712
|
this.setSelector(x, u);
|
|
3713
3713
|
} else {
|
|
3714
3714
|
this.ctx.emit("cellSelectedClick", e);
|
|
3715
|
-
const s = [e.colIndex, e.colIndex],
|
|
3716
|
-
this.setSelector(s,
|
|
3715
|
+
const s = [e.colIndex, e.colIndex], r = [e.rowIndex, e.rowIndex];
|
|
3716
|
+
this.setSelector(s, r), this.adjustBoundaryPosition();
|
|
3717
3717
|
}
|
|
3718
3718
|
}
|
|
3719
3719
|
clearCopyLine() {
|
|
@@ -3726,8 +3726,8 @@ class ui {
|
|
|
3726
3726
|
* @returns
|
|
3727
3727
|
*/
|
|
3728
3728
|
getCell(t, e) {
|
|
3729
|
-
const i = this.ctx.body.renderRows.find((
|
|
3730
|
-
return i == null ? void 0 : i.cells.find((
|
|
3729
|
+
const i = this.ctx.body.renderRows.find((r) => r.rowIndex === t);
|
|
3730
|
+
return i == null ? void 0 : i.cells.find((r) => r.colIndex === e);
|
|
3731
3731
|
}
|
|
3732
3732
|
/**
|
|
3733
3733
|
* 复制
|
|
@@ -3743,13 +3743,13 @@ class ui {
|
|
|
3743
3743
|
}
|
|
3744
3744
|
clearSelectedData(t, e, i = !1) {
|
|
3745
3745
|
let s = [];
|
|
3746
|
-
const
|
|
3746
|
+
const r = /* @__PURE__ */ new Set();
|
|
3747
3747
|
for (let n = 0; n <= e[1] - e[0]; n++)
|
|
3748
3748
|
for (let l = 0; l <= t[1] - t[0]; l++) {
|
|
3749
3749
|
const h = n + e[0], f = l + t[0], d = this.ctx.database.getItemValueForRowIndexAndColIndex(h, f);
|
|
3750
3750
|
if (d) {
|
|
3751
3751
|
const { rowKey: x, key: u } = d;
|
|
3752
|
-
this.ctx.database.getReadonly(x, u) || (
|
|
3752
|
+
this.ctx.database.getReadonly(x, u) || (r.add(x), s.push({
|
|
3753
3753
|
rowKey: x,
|
|
3754
3754
|
key: u,
|
|
3755
3755
|
value: null,
|
|
@@ -3763,10 +3763,10 @@ class ui {
|
|
|
3763
3763
|
if (i)
|
|
3764
3764
|
return s;
|
|
3765
3765
|
this.ctx.database.batchSetItemValue(s, !0);
|
|
3766
|
-
let
|
|
3767
|
-
return
|
|
3768
|
-
|
|
3769
|
-
}), this.ctx.emit("clearSelectedDataChange", s,
|
|
3766
|
+
let o = [];
|
|
3767
|
+
return r.forEach((n) => {
|
|
3768
|
+
o.push(this.ctx.database.getRowDataItemForRowKey(n));
|
|
3769
|
+
}), this.ctx.emit("clearSelectedDataChange", s, o), this.ctx.emit("draw"), s;
|
|
3770
3770
|
}
|
|
3771
3771
|
paste() {
|
|
3772
3772
|
if (!navigator.clipboard) {
|
|
@@ -3776,12 +3776,12 @@ class ui {
|
|
|
3776
3776
|
const { ENABLE_PASTER: t } = this.ctx.config;
|
|
3777
3777
|
if (this.ctx.selector.enable && t) {
|
|
3778
3778
|
const e = this.ctx.selector.yArr[0], i = this.ctx.selector.xArr[0], s = /* @__PURE__ */ new Set();
|
|
3779
|
-
navigator.clipboard.readText().then((
|
|
3780
|
-
let
|
|
3781
|
-
for (let h = 0; h <=
|
|
3782
|
-
const f =
|
|
3779
|
+
navigator.clipboard.readText().then((r) => {
|
|
3780
|
+
let o = ti(r), n = [];
|
|
3781
|
+
for (let h = 0; h <= o.length - 1; h++) {
|
|
3782
|
+
const f = o[h].length;
|
|
3783
3783
|
for (let d = 0; d <= f - 1; d++) {
|
|
3784
|
-
const x = h + e, u = d + i, p =
|
|
3784
|
+
const x = h + e, u = d + i, p = o[h][d], g = this.ctx.database.getItemValueForRowIndexAndColIndex(
|
|
3785
3785
|
x,
|
|
3786
3786
|
u
|
|
3787
3787
|
);
|
|
@@ -3815,8 +3815,8 @@ class ui {
|
|
|
3815
3815
|
s.forEach((h) => {
|
|
3816
3816
|
l.push(this.ctx.database.getRowDataItemForRowKey(h));
|
|
3817
3817
|
}), this.ctx.emit("pasteChange", n, l), this.clearCopyLine(), this.ctx.emit("draw");
|
|
3818
|
-
}).catch((
|
|
3819
|
-
console.error("获取剪贴板内容失败:",
|
|
3818
|
+
}).catch((r) => {
|
|
3819
|
+
console.error("获取剪贴板内容失败:", r);
|
|
3820
3820
|
});
|
|
3821
3821
|
}
|
|
3822
3822
|
}
|
|
@@ -3830,13 +3830,13 @@ class ui {
|
|
|
3830
3830
|
if (!e)
|
|
3831
3831
|
return;
|
|
3832
3832
|
let { colIndex: i = 0, rowIndex: s = 0 } = e;
|
|
3833
|
-
const
|
|
3833
|
+
const r = 0, o = 0, n = this.ctx.maxColIndex, l = this.ctx.maxRowIndex;
|
|
3834
3834
|
switch (t) {
|
|
3835
3835
|
case "LEFT":
|
|
3836
|
-
i >
|
|
3836
|
+
i > r && i--;
|
|
3837
3837
|
break;
|
|
3838
3838
|
case "TOP":
|
|
3839
|
-
s >
|
|
3839
|
+
s > o && s--;
|
|
3840
3840
|
break;
|
|
3841
3841
|
case "RIGHT":
|
|
3842
3842
|
i < n && i++;
|
|
@@ -3856,11 +3856,11 @@ class ui {
|
|
|
3856
3856
|
const {
|
|
3857
3857
|
SELECTOR_AREA_MIN_X: i,
|
|
3858
3858
|
SELECTOR_AREA_MAX_X: s,
|
|
3859
|
-
SELECTOR_AREA_MIN_Y:
|
|
3860
|
-
SELECTOR_AREA_MAX_Y:
|
|
3859
|
+
SELECTOR_AREA_MIN_Y: r,
|
|
3860
|
+
SELECTOR_AREA_MAX_Y: o,
|
|
3861
3861
|
SELECTOR_AREA_MAX_X_OFFSET: n,
|
|
3862
3862
|
SELECTOR_AREA_MAX_Y_OFFSET: l
|
|
3863
|
-
} = this.ctx.config, h = i, f = s || this.ctx.maxColIndex - n, d =
|
|
3863
|
+
} = this.ctx.config, h = i, f = s || this.ctx.maxColIndex - n, d = r, x = o || this.ctx.maxRowIndex - l;
|
|
3864
3864
|
return !(e < h || e > f || t < d || t > x);
|
|
3865
3865
|
}
|
|
3866
3866
|
/**
|
|
@@ -3868,8 +3868,8 @@ class ui {
|
|
|
3868
3868
|
*/
|
|
3869
3869
|
startAdjustPosition(t) {
|
|
3870
3870
|
const { offsetX: e, offsetY: i } = t;
|
|
3871
|
-
let s = "",
|
|
3872
|
-
if (e < 0 ? s = "left" : e > this.ctx.body.visibleWidth && (s = "right"), i < this.ctx.header.visibleHeight ?
|
|
3871
|
+
let s = "", r = "";
|
|
3872
|
+
if (e < 0 ? s = "left" : e > this.ctx.body.visibleWidth && (s = "right"), i < this.ctx.header.visibleHeight ? r = "top" : i > this.ctx.header.visibleHeight + this.ctx.body.visibleHeight && (r = "bottom"), s && this.adjustPositionX !== s) {
|
|
3873
3873
|
this.adjustPositionX = s;
|
|
3874
3874
|
let n = 10 * (s === "left" ? -1 : 1);
|
|
3875
3875
|
this.timerX && (clearInterval(this.timerX), this.timerX = 0), this.timerX = setInterval(() => {
|
|
@@ -3878,9 +3878,9 @@ class ui {
|
|
|
3878
3878
|
(h < 0 || h > this.ctx.body.width) && (clearInterval(this.timerX), this.timerX = 0), this.ctx.setScrollX(h);
|
|
3879
3879
|
}, 100);
|
|
3880
3880
|
}
|
|
3881
|
-
if (
|
|
3882
|
-
this.adjustPositionY =
|
|
3883
|
-
let n = 10 * (
|
|
3881
|
+
if (r && this.adjustPositionY !== r) {
|
|
3882
|
+
this.adjustPositionY = r;
|
|
3883
|
+
let n = 10 * (r === "top" ? -1 : 1);
|
|
3884
3884
|
this.timerY && (clearInterval(this.timerY), this.timerY = 0), this.timerY = setInterval(() => {
|
|
3885
3885
|
n *= 1.5;
|
|
3886
3886
|
const { scrollY: l } = this.ctx, h = l + n;
|
|
@@ -3892,13 +3892,13 @@ class ui {
|
|
|
3892
3892
|
* 调整滚动条位置,让焦点单元格始终出现在可视区域内
|
|
3893
3893
|
*/
|
|
3894
3894
|
adjustBoundaryPosition() {
|
|
3895
|
-
const { target: t, focusCell: e, fixedRightWidth: i, fixedLeftWidth: s, header:
|
|
3895
|
+
const { target: t, focusCell: e, fixedRightWidth: i, fixedLeftWidth: s, header: r, footer: o, scrollX: n, scrollY: l } = this.ctx;
|
|
3896
3896
|
if (!e)
|
|
3897
3897
|
return;
|
|
3898
3898
|
const { SCROLLER_TRACK_SIZE: h = 0, FOOTER_FIXED: f } = this.ctx.config;
|
|
3899
3899
|
let d = 0;
|
|
3900
|
-
f && (d =
|
|
3901
|
-
const x = s - e.drawX + 1, u = e.drawX + e.width - (t.width - i) + 1, p =
|
|
3900
|
+
f && (d = o.visibleHeight);
|
|
3901
|
+
const x = s - e.drawX + 1, u = e.drawX + e.width - (t.width - i) + 1, p = r.height - e.drawY, g = e.drawY + e.height - (t.height - d - h);
|
|
3902
3902
|
u > 0 && !e.fixed ? this.ctx.setScrollX(n + u) : x > 0 && !e.fixed && this.ctx.setScrollX(n - x), p > 0 ? this.ctx.setScrollY(l - p) : g > 0 && this.ctx.setScrollY(l + g);
|
|
3903
3903
|
}
|
|
3904
3904
|
destroy() {
|
|
@@ -3913,8 +3913,8 @@ class gi {
|
|
|
3913
3913
|
init() {
|
|
3914
3914
|
this.ctx.on("cellMouseenter", (t, e) => {
|
|
3915
3915
|
this.ctx.target.style.cursor === "crosshair" && (this.ctx.target.style.cursor = "default");
|
|
3916
|
-
const { xArr: i, yArr: s } = this.ctx.selector,
|
|
3917
|
-
if (this.ctx.config.ENABLE_AUTOFILL && n ===
|
|
3916
|
+
const { xArr: i, yArr: s } = this.ctx.selector, r = i[1], o = s[1], { colIndex: n, rowIndex: l, drawX: h, drawY: f, width: d, height: x } = t;
|
|
3917
|
+
if (this.ctx.config.ENABLE_AUTOFILL && n === r && l === o) {
|
|
3918
3918
|
const p = h + d - 6, g = f + x - 6;
|
|
3919
3919
|
e.offsetX > p && e.offsetY > g && (this.ctx.target.style.cursor = "crosshair");
|
|
3920
3920
|
}
|
|
@@ -3942,19 +3942,19 @@ class gi {
|
|
|
3942
3942
|
this.isAutofillIng() && this.autofillData(), this.ctx.autofill.enable = !1, this.ctx.autofillMove = !1, this.ctx.autofill.xArr = [-1, -1], this.ctx.autofill.yArr = [-1, -1];
|
|
3943
3943
|
}
|
|
3944
3944
|
setAutofill(t, e) {
|
|
3945
|
-
const { ENABLE_AUTOFILL: i, ENABLE_SELECTOR_SPAN_COL: s, ENABLE_SELECTOR_SPAN_ROW:
|
|
3945
|
+
const { ENABLE_AUTOFILL: i, ENABLE_SELECTOR_SPAN_COL: s, ENABLE_SELECTOR_SPAN_ROW: r } = this.ctx.config;
|
|
3946
3946
|
if (!i)
|
|
3947
3947
|
return;
|
|
3948
|
-
let
|
|
3949
|
-
if (!
|
|
3948
|
+
let o = t, n = e;
|
|
3949
|
+
if (!r) {
|
|
3950
3950
|
const [l] = n;
|
|
3951
3951
|
n = [l, l];
|
|
3952
3952
|
}
|
|
3953
3953
|
if (!s) {
|
|
3954
|
-
const [l] =
|
|
3955
|
-
|
|
3954
|
+
const [l] = o;
|
|
3955
|
+
o = [l, l];
|
|
3956
3956
|
}
|
|
3957
|
-
if (JSON.stringify(this.ctx.autofill.xArr) !== JSON.stringify(
|
|
3957
|
+
if (JSON.stringify(this.ctx.autofill.xArr) !== JSON.stringify(o) || JSON.stringify(this.ctx.autofill.yArr) !== JSON.stringify(n)) {
|
|
3958
3958
|
const {
|
|
3959
3959
|
SELECTOR_AREA_MIN_X: l,
|
|
3960
3960
|
SELECTOR_AREA_MAX_X: h,
|
|
@@ -3963,7 +3963,7 @@ class gi {
|
|
|
3963
3963
|
SELECTOR_AREA_MAX_X_OFFSET: x,
|
|
3964
3964
|
SELECTOR_AREA_MAX_Y_OFFSET: u
|
|
3965
3965
|
} = this.ctx.config, p = l, g = h || this.ctx.maxColIndex - x, w = f, y = d || this.ctx.maxRowIndex - u;
|
|
3966
|
-
let [C, m] =
|
|
3966
|
+
let [C, m] = o, [E, b] = n;
|
|
3967
3967
|
if (C < p || E < w)
|
|
3968
3968
|
return;
|
|
3969
3969
|
this.ctx.autofill.xArr = [Math.max(p, C), Math.min(g, m)], this.ctx.autofill.yArr = [Math.max(w, E), Math.min(y, b)], this.ctx.emit("setAutofill", this.ctx.autofill), this.ctx.emit("draw");
|
|
@@ -3979,11 +3979,11 @@ class gi {
|
|
|
3979
3979
|
const u = d + e.yArr[0], p = x + e.xArr[0];
|
|
3980
3980
|
i.set(`${u}-${p}`, !0);
|
|
3981
3981
|
}
|
|
3982
|
-
const { value: s } = e,
|
|
3982
|
+
const { value: s } = e, r = s[0].length, o = s.length, n = this.ctx.autofill.xArr, l = this.ctx.autofill.yArr;
|
|
3983
3983
|
let h = [];
|
|
3984
3984
|
for (let d = 0; d <= l[1] - l[0]; d++)
|
|
3985
3985
|
for (let x = 0; x <= n[1] - n[0]; x++) {
|
|
3986
|
-
const u = x + n[0], p = d + l[0], g = s[d %
|
|
3986
|
+
const u = x + n[0], p = d + l[0], g = s[d % o][x % r], w = this.ctx.database.getItemValueForRowIndexAndColIndex(p, u), y = `${p}-${u}`;
|
|
3987
3987
|
if (w && !i.has(y)) {
|
|
3988
3988
|
const { rowKey: C, key: m } = w;
|
|
3989
3989
|
this.ctx.database.getReadonly(C, m) || (t.add(C), h.push({
|
|
@@ -4007,14 +4007,14 @@ class gi {
|
|
|
4007
4007
|
return;
|
|
4008
4008
|
const { selector: e, autofill: i } = this.ctx;
|
|
4009
4009
|
if (this.ctx.mousedown && e.enable && i.enable) {
|
|
4010
|
-
const { rowIndex: s, colIndex:
|
|
4011
|
-
s >= e.yArr[0] && s <= e.yArr[1] ?
|
|
4010
|
+
const { rowIndex: s, colIndex: r } = t, o = e.xArr.slice(), n = e.yArr.slice();
|
|
4011
|
+
s >= e.yArr[0] && s <= e.yArr[1] ? r > e.xArr[1] ? o.splice(1, 1, r) : r < e.xArr[0] && o.splice(0, 1, r) : s > e.yArr[1] ? n.splice(1, 1, s) : s < e.yArr[0] && n.splice(0, 1, s), this.setAutofill(o, n);
|
|
4012
4012
|
}
|
|
4013
4013
|
}
|
|
4014
4014
|
destroy() {
|
|
4015
4015
|
}
|
|
4016
4016
|
}
|
|
4017
|
-
const rt = Math.min, U = Math.max, ft = Math.round,
|
|
4017
|
+
const rt = Math.min, U = Math.max, ft = Math.round, V = (a) => ({
|
|
4018
4018
|
x: a,
|
|
4019
4019
|
y: a
|
|
4020
4020
|
}), wi = {
|
|
@@ -4052,9 +4052,9 @@ function Ht(a) {
|
|
|
4052
4052
|
}
|
|
4053
4053
|
function yi(a, t, e) {
|
|
4054
4054
|
e === void 0 && (e = !1);
|
|
4055
|
-
const i = ct(a), s = Ht(a),
|
|
4056
|
-
let
|
|
4057
|
-
return t.reference[
|
|
4055
|
+
const i = ct(a), s = Ht(a), r = Mt(s);
|
|
4056
|
+
let o = s === "x" ? i === (e ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
|
|
4057
|
+
return t.reference[r] > t.floating[r] && (o = xt(o)), [o, xt(o)];
|
|
4058
4058
|
}
|
|
4059
4059
|
function mi(a) {
|
|
4060
4060
|
const t = xt(a);
|
|
@@ -4064,22 +4064,22 @@ function Ot(a) {
|
|
|
4064
4064
|
return a.replace(/start|end/g, (t) => pi[t]);
|
|
4065
4065
|
}
|
|
4066
4066
|
function Ei(a, t, e) {
|
|
4067
|
-
const i = ["left", "right"], s = ["right", "left"],
|
|
4067
|
+
const i = ["left", "right"], s = ["right", "left"], r = ["top", "bottom"], o = ["bottom", "top"];
|
|
4068
4068
|
switch (a) {
|
|
4069
4069
|
case "top":
|
|
4070
4070
|
case "bottom":
|
|
4071
4071
|
return e ? t ? s : i : t ? i : s;
|
|
4072
4072
|
case "left":
|
|
4073
4073
|
case "right":
|
|
4074
|
-
return t ?
|
|
4074
|
+
return t ? r : o;
|
|
4075
4075
|
default:
|
|
4076
4076
|
return [];
|
|
4077
4077
|
}
|
|
4078
4078
|
}
|
|
4079
4079
|
function Ci(a, t, e, i) {
|
|
4080
4080
|
const s = ct(a);
|
|
4081
|
-
let
|
|
4082
|
-
return s && (
|
|
4081
|
+
let r = Ei(q(a), e === "start", i);
|
|
4082
|
+
return s && (r = r.map((o) => o + "-" + s), t && (r = r.concat(r.map(Ot)))), r;
|
|
4083
4083
|
}
|
|
4084
4084
|
function xt(a) {
|
|
4085
4085
|
return a.replace(/left|right|bottom|top/g, (t) => wi[t]);
|
|
@@ -4119,12 +4119,12 @@ function ut(a) {
|
|
|
4119
4119
|
y: e
|
|
4120
4120
|
};
|
|
4121
4121
|
}
|
|
4122
|
-
function
|
|
4122
|
+
function zt(a, t, e) {
|
|
4123
4123
|
let {
|
|
4124
4124
|
reference: i,
|
|
4125
4125
|
floating: s
|
|
4126
4126
|
} = a;
|
|
4127
|
-
const
|
|
4127
|
+
const r = J(t), o = Ht(t), n = Mt(o), l = q(t), h = r === "y", f = i.x + i.width / 2 - s.width / 2, d = i.y + i.height / 2 - s.height / 2, x = i[n] / 2 - s[n] / 2;
|
|
4128
4128
|
let u;
|
|
4129
4129
|
switch (l) {
|
|
4130
4130
|
case "top":
|
|
@@ -4159,10 +4159,10 @@ function Vt(a, t, e) {
|
|
|
4159
4159
|
}
|
|
4160
4160
|
switch (ct(t)) {
|
|
4161
4161
|
case "start":
|
|
4162
|
-
u[
|
|
4162
|
+
u[o] -= x * (e && h ? -1 : 1);
|
|
4163
4163
|
break;
|
|
4164
4164
|
case "end":
|
|
4165
|
-
u[
|
|
4165
|
+
u[o] += x * (e && h ? -1 : 1);
|
|
4166
4166
|
break;
|
|
4167
4167
|
}
|
|
4168
4168
|
return u;
|
|
@@ -4171,17 +4171,17 @@ const vi = async (a, t, e) => {
|
|
|
4171
4171
|
const {
|
|
4172
4172
|
placement: i = "bottom",
|
|
4173
4173
|
strategy: s = "absolute",
|
|
4174
|
-
middleware:
|
|
4175
|
-
platform:
|
|
4176
|
-
} = e, n =
|
|
4177
|
-
let h = await
|
|
4174
|
+
middleware: r = [],
|
|
4175
|
+
platform: o
|
|
4176
|
+
} = e, n = r.filter(Boolean), l = await (o.isRTL == null ? void 0 : o.isRTL(t));
|
|
4177
|
+
let h = await o.getElementRects({
|
|
4178
4178
|
reference: a,
|
|
4179
4179
|
floating: t,
|
|
4180
4180
|
strategy: s
|
|
4181
4181
|
}), {
|
|
4182
4182
|
x: f,
|
|
4183
4183
|
y: d
|
|
4184
|
-
} =
|
|
4184
|
+
} = zt(h, i, l), x = i, u = {}, p = 0;
|
|
4185
4185
|
for (let g = 0; g < n.length; g++) {
|
|
4186
4186
|
const {
|
|
4187
4187
|
name: w,
|
|
@@ -4199,7 +4199,7 @@ const vi = async (a, t, e) => {
|
|
|
4199
4199
|
strategy: s,
|
|
4200
4200
|
middlewareData: u,
|
|
4201
4201
|
rects: h,
|
|
4202
|
-
platform:
|
|
4202
|
+
platform: o,
|
|
4203
4203
|
elements: {
|
|
4204
4204
|
reference: a,
|
|
4205
4205
|
floating: t
|
|
@@ -4211,14 +4211,14 @@ const vi = async (a, t, e) => {
|
|
|
4211
4211
|
...u[w],
|
|
4212
4212
|
...E
|
|
4213
4213
|
}
|
|
4214
|
-
}, b && p <= 50 && (p++, typeof b == "object" && (b.placement && (x = b.placement), b.rects && (h = b.rects === !0 ? await
|
|
4214
|
+
}, b && p <= 50 && (p++, typeof b == "object" && (b.placement && (x = b.placement), b.rects && (h = b.rects === !0 ? await o.getElementRects({
|
|
4215
4215
|
reference: a,
|
|
4216
4216
|
floating: t,
|
|
4217
4217
|
strategy: s
|
|
4218
4218
|
}) : b.rects), {
|
|
4219
4219
|
x: f,
|
|
4220
4220
|
y: d
|
|
4221
|
-
} =
|
|
4221
|
+
} = zt(h, x, l)), g = -1);
|
|
4222
4222
|
}
|
|
4223
4223
|
return {
|
|
4224
4224
|
x: f,
|
|
@@ -4234,8 +4234,8 @@ async function ne(a, t) {
|
|
|
4234
4234
|
const {
|
|
4235
4235
|
x: i,
|
|
4236
4236
|
y: s,
|
|
4237
|
-
platform:
|
|
4238
|
-
rects:
|
|
4237
|
+
platform: r,
|
|
4238
|
+
rects: o,
|
|
4239
4239
|
elements: n,
|
|
4240
4240
|
strategy: l
|
|
4241
4241
|
} = a, {
|
|
@@ -4244,23 +4244,23 @@ async function ne(a, t) {
|
|
|
4244
4244
|
elementContext: d = "floating",
|
|
4245
4245
|
altBoundary: x = !1,
|
|
4246
4246
|
padding: u = 0
|
|
4247
|
-
} = at(t, a), p = oe(u), w = n[x ? d === "floating" ? "reference" : "floating" : d], y = ut(await
|
|
4248
|
-
element: (e = await (
|
|
4247
|
+
} = at(t, a), p = oe(u), w = n[x ? d === "floating" ? "reference" : "floating" : d], y = ut(await r.getClippingRect({
|
|
4248
|
+
element: (e = await (r.isElement == null ? void 0 : r.isElement(w))) == null || e ? w : w.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(n.floating)),
|
|
4249
4249
|
boundary: h,
|
|
4250
4250
|
rootBoundary: f,
|
|
4251
4251
|
strategy: l
|
|
4252
4252
|
})), C = d === "floating" ? {
|
|
4253
4253
|
x: i,
|
|
4254
4254
|
y: s,
|
|
4255
|
-
width:
|
|
4256
|
-
height:
|
|
4257
|
-
} :
|
|
4255
|
+
width: o.floating.width,
|
|
4256
|
+
height: o.floating.height
|
|
4257
|
+
} : o.reference, m = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(n.floating)), E = await (r.isElement == null ? void 0 : r.isElement(m)) ? await (r.getScale == null ? void 0 : r.getScale(m)) || {
|
|
4258
4258
|
x: 1,
|
|
4259
4259
|
y: 1
|
|
4260
4260
|
} : {
|
|
4261
4261
|
x: 1,
|
|
4262
4262
|
y: 1
|
|
4263
|
-
}, b = ut(
|
|
4263
|
+
}, b = ut(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
4264
4264
|
elements: n,
|
|
4265
4265
|
rect: C,
|
|
4266
4266
|
offsetParent: m,
|
|
@@ -4281,8 +4281,8 @@ const Ri = (a) => ({
|
|
|
4281
4281
|
x: e,
|
|
4282
4282
|
y: i,
|
|
4283
4283
|
placement: s,
|
|
4284
|
-
rects:
|
|
4285
|
-
platform:
|
|
4284
|
+
rects: r,
|
|
4285
|
+
platform: o,
|
|
4286
4286
|
elements: n,
|
|
4287
4287
|
middlewareData: l
|
|
4288
4288
|
} = t, {
|
|
@@ -4294,10 +4294,10 @@ const Ri = (a) => ({
|
|
|
4294
4294
|
const d = oe(f), x = {
|
|
4295
4295
|
x: e,
|
|
4296
4296
|
y: i
|
|
4297
|
-
}, u = Ht(s), p = Mt(u), g = await
|
|
4297
|
+
}, u = Ht(s), p = Mt(u), g = await o.getDimensions(h), w = u === "y", y = w ? "top" : "left", C = w ? "bottom" : "right", m = w ? "clientHeight" : "clientWidth", E = r.reference[p] + r.reference[u] - x[u] - r.floating[p], b = x[u] - r.reference[u], R = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(h));
|
|
4298
4298
|
let T = R ? R[m] : 0;
|
|
4299
|
-
(!T || !await (
|
|
4300
|
-
const A = E / 2 - b / 2, L = T / 2 - g[p] / 2 - 1, D = rt(d[y], L), B = rt(d[C], L), I = D, S = T - g[p] - B, O = T / 2 - g[p] / 2 + A, G = It(I, O, S), Y = !l.arrow && ct(s) != null && O !== G &&
|
|
4299
|
+
(!T || !await (o.isElement == null ? void 0 : o.isElement(R))) && (T = n.floating[m] || r.floating[p]);
|
|
4300
|
+
const A = E / 2 - b / 2, L = T / 2 - g[p] / 2 - 1, D = rt(d[y], L), B = rt(d[C], L), I = D, S = T - g[p] - B, O = T / 2 - g[p] / 2 + A, G = It(I, O, S), Y = !l.arrow && ct(s) != null && O !== G && r.reference[p] / 2 - (O < I ? D : B) - g[p] / 2 < 0, k = Y ? O < I ? O - I : O - S : 0;
|
|
4301
4301
|
return {
|
|
4302
4302
|
[u]: x[u] + k,
|
|
4303
4303
|
data: {
|
|
@@ -4318,8 +4318,8 @@ const Ri = (a) => ({
|
|
|
4318
4318
|
var e, i;
|
|
4319
4319
|
const {
|
|
4320
4320
|
placement: s,
|
|
4321
|
-
middlewareData:
|
|
4322
|
-
rects:
|
|
4321
|
+
middlewareData: r,
|
|
4322
|
+
rects: o,
|
|
4323
4323
|
initialPlacement: n,
|
|
4324
4324
|
platform: l,
|
|
4325
4325
|
elements: h
|
|
@@ -4332,14 +4332,14 @@ const Ri = (a) => ({
|
|
|
4332
4332
|
flipAlignment: g = !0,
|
|
4333
4333
|
...w
|
|
4334
4334
|
} = at(a, t);
|
|
4335
|
-
if ((e =
|
|
4335
|
+
if ((e = r.arrow) != null && e.alignmentOffset)
|
|
4336
4336
|
return {};
|
|
4337
4337
|
const y = q(s), C = J(n), m = q(n) === n, E = await (l.isRTL == null ? void 0 : l.isRTL(h.floating)), b = x || (m || !g ? [xt(n)] : mi(n)), R = p !== "none";
|
|
4338
4338
|
!x && R && b.push(...Ci(n, g, p, E));
|
|
4339
4339
|
const T = [n, ...b], A = await ne(t, w), L = [];
|
|
4340
|
-
let D = ((i =
|
|
4340
|
+
let D = ((i = r.flip) == null ? void 0 : i.overflows) || [];
|
|
4341
4341
|
if (f && L.push(A[y]), d) {
|
|
4342
|
-
const O = yi(s,
|
|
4342
|
+
const O = yi(s, o, E);
|
|
4343
4343
|
L.push(A[O[0]], A[O[1]]);
|
|
4344
4344
|
}
|
|
4345
4345
|
if (D = [...D, {
|
|
@@ -4347,7 +4347,7 @@ const Ri = (a) => ({
|
|
|
4347
4347
|
overflows: L
|
|
4348
4348
|
}], !L.every((O) => O <= 0)) {
|
|
4349
4349
|
var B, I;
|
|
4350
|
-
const O = (((B =
|
|
4350
|
+
const O = (((B = r.flip) == null ? void 0 : B.index) || 0) + 1, G = T[O];
|
|
4351
4351
|
if (G)
|
|
4352
4352
|
return {
|
|
4353
4353
|
data: {
|
|
@@ -4395,7 +4395,7 @@ async function Ii(a, t) {
|
|
|
4395
4395
|
placement: e,
|
|
4396
4396
|
platform: i,
|
|
4397
4397
|
elements: s
|
|
4398
|
-
} = a,
|
|
4398
|
+
} = a, r = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), o = q(e), n = ct(e), l = J(e) === "y", h = ["left", "top"].includes(o) ? -1 : 1, f = r && l ? -1 : 1, d = at(t, a);
|
|
4399
4399
|
let {
|
|
4400
4400
|
mainAxis: x,
|
|
4401
4401
|
crossAxis: u,
|
|
@@ -4425,16 +4425,16 @@ const Oi = function(a) {
|
|
|
4425
4425
|
var e, i;
|
|
4426
4426
|
const {
|
|
4427
4427
|
x: s,
|
|
4428
|
-
y:
|
|
4429
|
-
placement:
|
|
4428
|
+
y: r,
|
|
4429
|
+
placement: o,
|
|
4430
4430
|
middlewareData: n
|
|
4431
4431
|
} = t, l = await Ii(t, a);
|
|
4432
|
-
return
|
|
4432
|
+
return o === ((e = n.offset) == null ? void 0 : e.placement) && (i = n.arrow) != null && i.alignmentOffset ? {} : {
|
|
4433
4433
|
x: s + l.x,
|
|
4434
|
-
y:
|
|
4434
|
+
y: r + l.y,
|
|
4435
4435
|
data: {
|
|
4436
4436
|
...l,
|
|
4437
|
-
placement:
|
|
4437
|
+
placement: o
|
|
4438
4438
|
}
|
|
4439
4439
|
};
|
|
4440
4440
|
}
|
|
@@ -4449,8 +4449,8 @@ const Oi = function(a) {
|
|
|
4449
4449
|
y: i,
|
|
4450
4450
|
placement: s
|
|
4451
4451
|
} = t, {
|
|
4452
|
-
mainAxis:
|
|
4453
|
-
crossAxis:
|
|
4452
|
+
mainAxis: r = !0,
|
|
4453
|
+
crossAxis: o = !1,
|
|
4454
4454
|
limiter: n = {
|
|
4455
4455
|
fn: (w) => {
|
|
4456
4456
|
let {
|
|
@@ -4469,11 +4469,11 @@ const Oi = function(a) {
|
|
|
4469
4469
|
y: i
|
|
4470
4470
|
}, f = await ne(t, l), d = J(q(s)), x = re(d);
|
|
4471
4471
|
let u = h[x], p = h[d];
|
|
4472
|
-
if (
|
|
4472
|
+
if (r) {
|
|
4473
4473
|
const w = x === "y" ? "top" : "left", y = x === "y" ? "bottom" : "right", C = u + f[w], m = u - f[y];
|
|
4474
4474
|
u = It(C, u, m);
|
|
4475
4475
|
}
|
|
4476
|
-
if (
|
|
4476
|
+
if (o) {
|
|
4477
4477
|
const w = d === "y" ? "top" : "left", y = d === "y" ? "bottom" : "right", C = p + f[w], m = p - f[y];
|
|
4478
4478
|
p = It(C, p, m);
|
|
4479
4479
|
}
|
|
@@ -4488,8 +4488,8 @@ const Oi = function(a) {
|
|
|
4488
4488
|
x: g.x - e,
|
|
4489
4489
|
y: g.y - i,
|
|
4490
4490
|
enabled: {
|
|
4491
|
-
[x]:
|
|
4492
|
-
[d]:
|
|
4491
|
+
[x]: r,
|
|
4492
|
+
[d]: o
|
|
4493
4493
|
}
|
|
4494
4494
|
}
|
|
4495
4495
|
};
|
|
@@ -4548,13 +4548,13 @@ function Dt(a) {
|
|
|
4548
4548
|
return e.transform !== "none" || e.perspective !== "none" || (e.containerType ? e.containerType !== "normal" : !1) || !t && (e.backdropFilter ? e.backdropFilter !== "none" : !1) || !t && (e.filter ? e.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((i) => (e.willChange || "").includes(i)) || ["paint", "layout", "strict", "content"].some((i) => (e.contain || "").includes(i));
|
|
4549
4549
|
}
|
|
4550
4550
|
function Ai(a) {
|
|
4551
|
-
let t =
|
|
4551
|
+
let t = z(a);
|
|
4552
4552
|
for (; N(t) && !Q(t); ) {
|
|
4553
4553
|
if (Dt(t))
|
|
4554
4554
|
return t;
|
|
4555
4555
|
if (wt(t))
|
|
4556
4556
|
return null;
|
|
4557
|
-
t =
|
|
4557
|
+
t = z(t);
|
|
4558
4558
|
}
|
|
4559
4559
|
return null;
|
|
4560
4560
|
}
|
|
@@ -4576,7 +4576,7 @@ function pt(a) {
|
|
|
4576
4576
|
scrollTop: a.scrollY
|
|
4577
4577
|
};
|
|
4578
4578
|
}
|
|
4579
|
-
function
|
|
4579
|
+
function z(a) {
|
|
4580
4580
|
if (tt(a) === "html")
|
|
4581
4581
|
return a;
|
|
4582
4582
|
const t = (
|
|
@@ -4589,16 +4589,16 @@ function V(a) {
|
|
|
4589
4589
|
return $t(t) ? t.host : t;
|
|
4590
4590
|
}
|
|
4591
4591
|
function ce(a) {
|
|
4592
|
-
const t =
|
|
4592
|
+
const t = z(a);
|
|
4593
4593
|
return Q(t) ? a.ownerDocument ? a.ownerDocument.body : a.body : N(t) && lt(t) ? t : ce(t);
|
|
4594
4594
|
}
|
|
4595
4595
|
function St(a, t, e) {
|
|
4596
4596
|
var i;
|
|
4597
4597
|
t === void 0 && (t = []), e === void 0 && (e = !0);
|
|
4598
|
-
const s = ce(a),
|
|
4599
|
-
if (
|
|
4600
|
-
const n = Tt(
|
|
4601
|
-
return t.concat(
|
|
4598
|
+
const s = ce(a), r = s === ((i = a.ownerDocument) == null ? void 0 : i.body), o = H(s);
|
|
4599
|
+
if (r) {
|
|
4600
|
+
const n = Tt(o);
|
|
4601
|
+
return t.concat(o, o.visualViewport || [], lt(s) ? s : [], n && e ? St(n) : []);
|
|
4602
4602
|
}
|
|
4603
4603
|
return t.concat(s, St(s, [], e));
|
|
4604
4604
|
}
|
|
@@ -4608,8 +4608,8 @@ function Tt(a) {
|
|
|
4608
4608
|
function le(a) {
|
|
4609
4609
|
const t = F(a);
|
|
4610
4610
|
let e = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
|
|
4611
|
-
const s = N(a),
|
|
4612
|
-
return n && (e =
|
|
4611
|
+
const s = N(a), r = s ? a.offsetWidth : e, o = s ? a.offsetHeight : i, n = ft(e) !== r || ft(i) !== o;
|
|
4612
|
+
return n && (e = r, i = o), {
|
|
4613
4613
|
width: e,
|
|
4614
4614
|
height: i,
|
|
4615
4615
|
$: n
|
|
@@ -4621,19 +4621,19 @@ function he(a) {
|
|
|
4621
4621
|
function Z(a) {
|
|
4622
4622
|
const t = he(a);
|
|
4623
4623
|
if (!N(t))
|
|
4624
|
-
return
|
|
4624
|
+
return V(1);
|
|
4625
4625
|
const e = t.getBoundingClientRect(), {
|
|
4626
4626
|
width: i,
|
|
4627
4627
|
height: s,
|
|
4628
|
-
$:
|
|
4628
|
+
$: r
|
|
4629
4629
|
} = le(t);
|
|
4630
|
-
let
|
|
4631
|
-
return (!
|
|
4632
|
-
x:
|
|
4630
|
+
let o = (r ? ft(e.width) : e.width) / i, n = (r ? ft(e.height) : e.height) / s;
|
|
4631
|
+
return (!o || !Number.isFinite(o)) && (o = 1), (!n || !Number.isFinite(n)) && (n = 1), {
|
|
4632
|
+
x: o,
|
|
4633
4633
|
y: n
|
|
4634
4634
|
};
|
|
4635
4635
|
}
|
|
4636
|
-
const Li = /* @__PURE__ */
|
|
4636
|
+
const Li = /* @__PURE__ */ V(0);
|
|
4637
4637
|
function de(a) {
|
|
4638
4638
|
const t = H(a);
|
|
4639
4639
|
return !Xt() || !t.visualViewport ? Li : {
|
|
@@ -4646,13 +4646,13 @@ function Mi(a, t, e) {
|
|
|
4646
4646
|
}
|
|
4647
4647
|
function ot(a, t, e, i) {
|
|
4648
4648
|
t === void 0 && (t = !1), e === void 0 && (e = !1);
|
|
4649
|
-
const s = a.getBoundingClientRect(),
|
|
4650
|
-
let
|
|
4651
|
-
t && (i ? X(i) && (
|
|
4652
|
-
const n = Mi(
|
|
4653
|
-
let l = (s.left + n.x) /
|
|
4654
|
-
if (
|
|
4655
|
-
const x = H(
|
|
4649
|
+
const s = a.getBoundingClientRect(), r = he(a);
|
|
4650
|
+
let o = V(1);
|
|
4651
|
+
t && (i ? X(i) && (o = Z(i)) : o = Z(a));
|
|
4652
|
+
const n = Mi(r, e, i) ? de(r) : V(0);
|
|
4653
|
+
let l = (s.left + n.x) / o.x, h = (s.top + n.y) / o.y, f = s.width / o.x, d = s.height / o.y;
|
|
4654
|
+
if (r) {
|
|
4655
|
+
const x = H(r), u = i && X(i) ? H(i) : i;
|
|
4656
4656
|
let p = x, g = Tt(p);
|
|
4657
4657
|
for (; g && i && u !== p; ) {
|
|
4658
4658
|
const w = Z(g), y = g.getBoundingClientRect(), C = F(g), m = y.left + (g.clientLeft + parseFloat(C.paddingLeft)) * w.x, E = y.top + (g.clientTop + parseFloat(C.paddingTop)) * w.y;
|
|
@@ -4673,15 +4673,15 @@ function Hi(a) {
|
|
|
4673
4673
|
offsetParent: i,
|
|
4674
4674
|
strategy: s
|
|
4675
4675
|
} = a;
|
|
4676
|
-
const
|
|
4677
|
-
if (i ===
|
|
4676
|
+
const r = s === "fixed", o = K(i), n = t ? wt(t.floating) : !1;
|
|
4677
|
+
if (i === o || n && r)
|
|
4678
4678
|
return e;
|
|
4679
4679
|
let l = {
|
|
4680
4680
|
scrollLeft: 0,
|
|
4681
4681
|
scrollTop: 0
|
|
4682
|
-
}, h =
|
|
4683
|
-
const f =
|
|
4684
|
-
if ((d || !d && !
|
|
4682
|
+
}, h = V(1);
|
|
4683
|
+
const f = V(0), d = N(i);
|
|
4684
|
+
if ((d || !d && !r) && ((tt(i) !== "body" || lt(o)) && (l = pt(i)), N(i))) {
|
|
4685
4685
|
const x = ot(i);
|
|
4686
4686
|
h = Z(i), f.x = x.x + i.clientLeft, f.y = x.y + i.clientTop;
|
|
4687
4687
|
}
|
|
@@ -4700,35 +4700,35 @@ function At(a, t) {
|
|
|
4700
4700
|
return t ? t.left + e : ot(K(a)).left + e;
|
|
4701
4701
|
}
|
|
4702
4702
|
function Xi(a) {
|
|
4703
|
-
const t = K(a), e = pt(a), i = a.ownerDocument.body, s = U(t.scrollWidth, t.clientWidth, i.scrollWidth, i.clientWidth),
|
|
4704
|
-
let
|
|
4703
|
+
const t = K(a), e = pt(a), i = a.ownerDocument.body, s = U(t.scrollWidth, t.clientWidth, i.scrollWidth, i.clientWidth), r = U(t.scrollHeight, t.clientHeight, i.scrollHeight, i.clientHeight);
|
|
4704
|
+
let o = -e.scrollLeft + At(a);
|
|
4705
4705
|
const n = -e.scrollTop;
|
|
4706
|
-
return F(i).direction === "rtl" && (
|
|
4706
|
+
return F(i).direction === "rtl" && (o += U(t.clientWidth, i.clientWidth) - s), {
|
|
4707
4707
|
width: s,
|
|
4708
|
-
height:
|
|
4709
|
-
x:
|
|
4708
|
+
height: r,
|
|
4709
|
+
x: o,
|
|
4710
4710
|
y: n
|
|
4711
4711
|
};
|
|
4712
4712
|
}
|
|
4713
4713
|
function Fi(a, t) {
|
|
4714
4714
|
const e = H(a), i = K(a), s = e.visualViewport;
|
|
4715
|
-
let
|
|
4715
|
+
let r = i.clientWidth, o = i.clientHeight, n = 0, l = 0;
|
|
4716
4716
|
if (s) {
|
|
4717
|
-
|
|
4717
|
+
r = s.width, o = s.height;
|
|
4718
4718
|
const h = Xt();
|
|
4719
4719
|
(!h || h && t === "fixed") && (n = s.offsetLeft, l = s.offsetTop);
|
|
4720
4720
|
}
|
|
4721
4721
|
return {
|
|
4722
|
-
width:
|
|
4723
|
-
height:
|
|
4722
|
+
width: r,
|
|
4723
|
+
height: o,
|
|
4724
4724
|
x: n,
|
|
4725
4725
|
y: l
|
|
4726
4726
|
};
|
|
4727
4727
|
}
|
|
4728
4728
|
function ki(a, t) {
|
|
4729
|
-
const e = ot(a, !0, t === "fixed"), i = e.top + a.clientTop, s = e.left + a.clientLeft,
|
|
4729
|
+
const e = ot(a, !0, t === "fixed"), i = e.top + a.clientTop, s = e.left + a.clientLeft, r = N(a) ? Z(a) : V(1), o = a.clientWidth * r.x, n = a.clientHeight * r.y, l = s * r.x, h = i * r.y;
|
|
4730
4730
|
return {
|
|
4731
|
-
width:
|
|
4731
|
+
width: o,
|
|
4732
4732
|
height: n,
|
|
4733
4733
|
x: l,
|
|
4734
4734
|
y: h
|
|
@@ -4753,7 +4753,7 @@ function qt(a, t, e) {
|
|
|
4753
4753
|
return ut(i);
|
|
4754
4754
|
}
|
|
4755
4755
|
function fe(a, t) {
|
|
4756
|
-
const e =
|
|
4756
|
+
const e = z(a);
|
|
4757
4757
|
return e === t || !X(e) || Q(e) ? !1 : F(e).position === "fixed" || fe(e, t);
|
|
4758
4758
|
}
|
|
4759
4759
|
function Ni(a, t) {
|
|
@@ -4761,11 +4761,11 @@ function Ni(a, t) {
|
|
|
4761
4761
|
if (e)
|
|
4762
4762
|
return e;
|
|
4763
4763
|
let i = St(a, [], !1).filter((n) => X(n) && tt(n) !== "body"), s = null;
|
|
4764
|
-
const
|
|
4765
|
-
let
|
|
4766
|
-
for (; X(
|
|
4767
|
-
const n = F(
|
|
4768
|
-
!l && n.position === "fixed" && (s = null), (
|
|
4764
|
+
const r = F(a).position === "fixed";
|
|
4765
|
+
let o = r ? z(a) : a;
|
|
4766
|
+
for (; X(o) && !Q(o); ) {
|
|
4767
|
+
const n = F(o), l = Dt(o);
|
|
4768
|
+
!l && n.position === "fixed" && (s = null), (r ? !l && !s : !l && n.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || lt(o) && !l && fe(a, o)) ? i = i.filter((f) => f !== o) : s = n, o = z(o);
|
|
4769
4769
|
}
|
|
4770
4770
|
return t.set(a, i), i;
|
|
4771
4771
|
}
|
|
@@ -4776,7 +4776,7 @@ function Yi(a) {
|
|
|
4776
4776
|
rootBoundary: i,
|
|
4777
4777
|
strategy: s
|
|
4778
4778
|
} = a;
|
|
4779
|
-
const
|
|
4779
|
+
const o = [...e === "clippingAncestors" ? wt(t) ? [] : Ni(t, this._c) : [].concat(e), i], n = o[0], l = o.reduce((h, f) => {
|
|
4780
4780
|
const d = qt(t, f, s);
|
|
4781
4781
|
return h.top = U(d.top, h.top), h.right = rt(d.right, h.right), h.bottom = rt(d.bottom, h.bottom), h.left = U(d.left, h.left), h;
|
|
4782
4782
|
}, qt(t, n, s));
|
|
@@ -4798,29 +4798,29 @@ function Ki(a) {
|
|
|
4798
4798
|
};
|
|
4799
4799
|
}
|
|
4800
4800
|
function Bi(a, t, e) {
|
|
4801
|
-
const i = N(t), s = K(t),
|
|
4801
|
+
const i = N(t), s = K(t), r = e === "fixed", o = ot(a, !0, r, t);
|
|
4802
4802
|
let n = {
|
|
4803
4803
|
scrollLeft: 0,
|
|
4804
4804
|
scrollTop: 0
|
|
4805
4805
|
};
|
|
4806
|
-
const l =
|
|
4807
|
-
if (i || !i && !
|
|
4806
|
+
const l = V(0);
|
|
4807
|
+
if (i || !i && !r)
|
|
4808
4808
|
if ((tt(t) !== "body" || lt(s)) && (n = pt(t)), i) {
|
|
4809
|
-
const u = ot(t, !0,
|
|
4809
|
+
const u = ot(t, !0, r, t);
|
|
4810
4810
|
l.x = u.x + t.clientLeft, l.y = u.y + t.clientTop;
|
|
4811
4811
|
} else s && (l.x = At(s));
|
|
4812
4812
|
let h = 0, f = 0;
|
|
4813
|
-
if (s && !i && !
|
|
4813
|
+
if (s && !i && !r) {
|
|
4814
4814
|
const u = s.getBoundingClientRect();
|
|
4815
4815
|
f = u.top + n.scrollTop, h = u.left + n.scrollLeft - // RTL <body> scrollbar.
|
|
4816
4816
|
At(s, u);
|
|
4817
4817
|
}
|
|
4818
|
-
const d =
|
|
4818
|
+
const d = o.left + n.scrollLeft - l.x - h, x = o.top + n.scrollTop - l.y - f;
|
|
4819
4819
|
return {
|
|
4820
4820
|
x: d,
|
|
4821
4821
|
y: x,
|
|
4822
|
-
width:
|
|
4823
|
-
height:
|
|
4822
|
+
width: o.width,
|
|
4823
|
+
height: o.height
|
|
4824
4824
|
};
|
|
4825
4825
|
}
|
|
4826
4826
|
function mt(a) {
|
|
@@ -4839,11 +4839,11 @@ function xe(a, t) {
|
|
|
4839
4839
|
if (wt(a))
|
|
4840
4840
|
return e;
|
|
4841
4841
|
if (!N(a)) {
|
|
4842
|
-
let s =
|
|
4842
|
+
let s = z(a);
|
|
4843
4843
|
for (; s && !Q(s); ) {
|
|
4844
4844
|
if (X(s) && !mt(s))
|
|
4845
4845
|
return s;
|
|
4846
|
-
s =
|
|
4846
|
+
s = z(s);
|
|
4847
4847
|
}
|
|
4848
4848
|
return e;
|
|
4849
4849
|
}
|
|
@@ -4867,7 +4867,7 @@ const Wi = async function(a) {
|
|
|
4867
4867
|
function Pi(a) {
|
|
4868
4868
|
return F(a).direction === "rtl";
|
|
4869
4869
|
}
|
|
4870
|
-
const
|
|
4870
|
+
const Vi = {
|
|
4871
4871
|
convertOffsetParentRelativeRectToViewportRelativeRect: Hi,
|
|
4872
4872
|
getDocumentElement: K,
|
|
4873
4873
|
getClippingRect: Yi,
|
|
@@ -4878,17 +4878,17 @@ const zi = {
|
|
|
4878
4878
|
getScale: Z,
|
|
4879
4879
|
isElement: X,
|
|
4880
4880
|
isRTL: Pi
|
|
4881
|
-
}, ue = Oi, ge = Si, we = _i,
|
|
4881
|
+
}, ue = Oi, ge = Si, we = _i, zi = Ri, pe = (a, t, e) => {
|
|
4882
4882
|
const i = /* @__PURE__ */ new Map(), s = {
|
|
4883
|
-
platform:
|
|
4883
|
+
platform: Vi,
|
|
4884
4884
|
...e
|
|
4885
|
-
},
|
|
4885
|
+
}, r = {
|
|
4886
4886
|
...s.platform,
|
|
4887
4887
|
_c: i
|
|
4888
4888
|
};
|
|
4889
4889
|
return vi(a, t, {
|
|
4890
4890
|
...s,
|
|
4891
|
-
platform:
|
|
4891
|
+
platform: r
|
|
4892
4892
|
});
|
|
4893
4893
|
};
|
|
4894
4894
|
let $i = class {
|
|
@@ -4899,8 +4899,8 @@ let $i = class {
|
|
|
4899
4899
|
c(this, "floatingEl");
|
|
4900
4900
|
c(this, "arrowEl");
|
|
4901
4901
|
this.ctx = t;
|
|
4902
|
-
const { TOOLTIP_BG_COLOR: e, TOOLTIP_TEXT_COLOR: i, TOOLTIP_ZINDEX: s, TOOLTIP_CUSTOM_STYLE:
|
|
4903
|
-
this.contentEl = document.createElement("div"), this.arrowEl = document.createElement("div"), this.floatingEl = document.createElement("div"), this.floatingEl.className = `${
|
|
4902
|
+
const { TOOLTIP_BG_COLOR: e, TOOLTIP_TEXT_COLOR: i, TOOLTIP_ZINDEX: s, TOOLTIP_CUSTOM_STYLE: r, CSS_PREFIX: o } = this.ctx.config;
|
|
4903
|
+
this.contentEl = document.createElement("div"), this.arrowEl = document.createElement("div"), this.floatingEl = document.createElement("div"), this.floatingEl.className = `${o}-tooltip`, this.contentEl.className = `${o}-tooltip-content`, this.arrowEl.className = `${o}-tooltip-arrow`;
|
|
4904
4904
|
const n = {
|
|
4905
4905
|
display: "none",
|
|
4906
4906
|
position: "absolute",
|
|
@@ -4911,7 +4911,7 @@ let $i = class {
|
|
|
4911
4911
|
padding: "8px",
|
|
4912
4912
|
borderRadius: "4px",
|
|
4913
4913
|
fontSize: "12px",
|
|
4914
|
-
...
|
|
4914
|
+
...r
|
|
4915
4915
|
}, l = {
|
|
4916
4916
|
position: "absolute",
|
|
4917
4917
|
width: "10px",
|
|
@@ -4945,23 +4945,23 @@ let $i = class {
|
|
|
4945
4945
|
if (!i)
|
|
4946
4946
|
return;
|
|
4947
4947
|
this.enable = !0, this.contentEl.style.maxWidth = `${t.overflowTooltipMaxWidth || 500}px`, 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;
|
|
4948
|
-
const s = t.drawX + i.x,
|
|
4948
|
+
const s = t.drawX + i.x, r = t.drawY + i.y;
|
|
4949
4949
|
pe({
|
|
4950
4950
|
getBoundingClientRect() {
|
|
4951
4951
|
return {
|
|
4952
4952
|
width: t.visibleWidth,
|
|
4953
4953
|
height: t.visibleHeight,
|
|
4954
4954
|
x: s,
|
|
4955
|
-
y:
|
|
4955
|
+
y: r,
|
|
4956
4956
|
left: s,
|
|
4957
4957
|
right: s + t.visibleWidth,
|
|
4958
|
-
top:
|
|
4959
|
-
bottom:
|
|
4958
|
+
top: r,
|
|
4959
|
+
bottom: r + t.visibleHeight
|
|
4960
4960
|
};
|
|
4961
4961
|
}
|
|
4962
4962
|
}, this.floatingEl, {
|
|
4963
4963
|
placement: t.overflowTooltipPlacement,
|
|
4964
|
-
middleware: [ge(), we(), ue(6),
|
|
4964
|
+
middleware: [ge(), we(), ue(6), zi({ element: this.arrowEl })]
|
|
4965
4965
|
}).then((n) => {
|
|
4966
4966
|
const { x: l, y: h, placement: f, middlewareData: d } = n;
|
|
4967
4967
|
if (Object.assign(this.floatingEl.style, {
|
|
@@ -5015,8 +5015,8 @@ class qi {
|
|
|
5015
5015
|
}), this.ctx.on("cellHeaderMousedown", () => {
|
|
5016
5016
|
this.enable && this.doneEdit(), this.cellTarget = null;
|
|
5017
5017
|
}), this.ctx.on("keydown", (t) => {
|
|
5018
|
-
const e = t.key, i = t.ctrlKey, s = t.altKey,
|
|
5019
|
-
if (!(i || s ||
|
|
5018
|
+
const e = t.key, i = t.ctrlKey, s = t.altKey, r = t.shiftKey, o = t.metaKey;
|
|
5019
|
+
if (!(i || s || r || o || [
|
|
5020
5020
|
// "Enter",
|
|
5021
5021
|
"Escape",
|
|
5022
5022
|
"Tab",
|
|
@@ -5056,83 +5056,37 @@ class qi {
|
|
|
5056
5056
|
});
|
|
5057
5057
|
}
|
|
5058
5058
|
initTextEditor() {
|
|
5059
|
-
|
|
5060
|
-
this.inputEl = document.createElement("div"), this.inputEl.addEventListener("keydown", (r) => {
|
|
5059
|
+
this.inputEl = document.createElement("textarea"), this.inputEl.addEventListener("keydown", (t) => {
|
|
5061
5060
|
if (this.enable) {
|
|
5062
|
-
if ((
|
|
5063
|
-
|
|
5064
|
-
const
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
if (h.startContainer === n && h.startOffset === n.childNodes.length)
|
|
5068
|
-
n.textContent += `
|
|
5069
|
-
|
|
5070
|
-
`, l.selectAllChildren(this.inputEl), l.collapseToEnd();
|
|
5071
|
-
else {
|
|
5072
|
-
const d = document.createTextNode(`
|
|
5073
|
-
`);
|
|
5074
|
-
h.insertNode(d), h.setStartAfter(d), h.collapse(!1), l.removeAllRanges(), l.addRange(h);
|
|
5075
|
-
}
|
|
5061
|
+
if ((t.altKey || t.metaKey) && t.code === "Enter") {
|
|
5062
|
+
t.preventDefault();
|
|
5063
|
+
const e = this.inputEl.selectionStart, i = this.inputEl.value.substring(0, e), s = this.inputEl.value.substring(e);
|
|
5064
|
+
this.inputEl.value = i + `
|
|
5065
|
+
` + s, this.inputEl.selectionStart = this.inputEl.selectionEnd = e + 1;
|
|
5076
5066
|
return;
|
|
5077
5067
|
}
|
|
5078
|
-
(
|
|
5068
|
+
(t.code === "Escape" || t.code === "Enter") && (t.preventDefault(), this.inputEl.blur());
|
|
5079
5069
|
}
|
|
5080
5070
|
}), this.inputEl.addEventListener("blur", () => {
|
|
5081
5071
|
this.doneEdit();
|
|
5082
|
-
}), this.editorEl = document.createElement("div"), this.editorEl.className =
|
|
5083
|
-
const i = {
|
|
5084
|
-
position: "absolute",
|
|
5085
|
-
top: "-10000px",
|
|
5086
|
-
left: "-10000px",
|
|
5087
|
-
textAlign: "left",
|
|
5088
|
-
lineHeight: "0",
|
|
5089
|
-
zIndex: 100,
|
|
5090
|
-
overflow: "hidden",
|
|
5091
|
-
backgroundColor: "#fff",
|
|
5092
|
-
border: `2px solid ${e}`,
|
|
5093
|
-
boxSizing: "border-box",
|
|
5094
|
-
boxShadow: "rgba(0, 0, 0, 0.2) 0px 6px 16px",
|
|
5095
|
-
pointerEvents: "auto",
|
|
5096
|
-
display: "flex",
|
|
5097
|
-
alignItems: "center"
|
|
5098
|
-
};
|
|
5099
|
-
Object.assign(this.editorEl.style, i);
|
|
5100
|
-
const s = {
|
|
5101
|
-
width: "100%",
|
|
5102
|
-
boxSizing: "border-box",
|
|
5103
|
-
padding: "8px",
|
|
5104
|
-
outline: "none",
|
|
5105
|
-
fontWeight: "400",
|
|
5106
|
-
fontSize: "12px",
|
|
5107
|
-
color: "inherit",
|
|
5108
|
-
whiteSpace: "normal",
|
|
5109
|
-
wordWrap: "break-word",
|
|
5110
|
-
wordBreak: "break-all",
|
|
5111
|
-
lineHeight: "18px",
|
|
5112
|
-
margin: "0",
|
|
5113
|
-
background: "#fff",
|
|
5114
|
-
cursor: "text"
|
|
5115
|
-
};
|
|
5116
|
-
Object.assign(this.inputEl.style, s);
|
|
5117
|
-
const o = navigator.userAgent.toLowerCase().includes("firefox");
|
|
5118
|
-
this.inputEl.contentEditable = o ? "true" : "plaintext-only", this.editorEl.appendChild(this.inputEl), this.ctx.targetContainer.appendChild(this.editorEl);
|
|
5072
|
+
}), this.editorEl = document.createElement("div"), this.editorEl.className = "e-virt-table-editor", this.inputEl.className = "e-virt-table-editor-textarea", this.editorEl.appendChild(this.inputEl), this.ctx.targetContainer.appendChild(this.editorEl);
|
|
5119
5073
|
}
|
|
5120
5074
|
startEditByInput(t) {
|
|
5121
5075
|
if (t.editorType !== "text")
|
|
5122
5076
|
return;
|
|
5123
5077
|
const e = t.getValue(), { width: i } = t, s = t.getDrawX();
|
|
5124
|
-
let
|
|
5125
|
-
t.height > this.ctx.body.visibleHeight && (
|
|
5078
|
+
let r = t.getDrawY(), { height: o } = t;
|
|
5079
|
+
t.height > this.ctx.body.visibleHeight && (o = this.ctx.body.visibleHeight, r = this.ctx.header.visibleHeight);
|
|
5126
5080
|
const { CELL_PADDING: n } = this.ctx.config;
|
|
5127
|
-
this.editorEl.style.left = `${s}px`, this.editorEl.style.top = `${
|
|
5081
|
+
this.editorEl.style.left = `${s}px`, this.editorEl.style.top = `${r}px`, this.inputEl.style.minWidth = `${i - 1}px`, this.inputEl.style.minHeight = `${o - 1}px`, this.inputEl.style.width = `${i - 1}px`, this.inputEl.style.height = `${o - 1}px`, this.inputEl.style.padding = `${n}px`, e !== null && (this.inputEl.value = e);
|
|
5128
5082
|
const l = window.getSelection();
|
|
5129
|
-
l == null || l.selectAllChildren(this.inputEl), l == null || l.collapseToEnd();
|
|
5083
|
+
l == null || l.selectAllChildren(this.inputEl), l == null || l.collapseToEnd(), this.inputEl.focus();
|
|
5130
5084
|
}
|
|
5131
5085
|
doneEditByInput() {
|
|
5132
5086
|
if (!this.cellTarget || this.cellTarget.editorType !== "text")
|
|
5133
5087
|
return;
|
|
5134
|
-
const { rowKey: t, key: e } = this.cellTarget, i = this.cellTarget.getValue(), s = this.inputEl.
|
|
5135
|
-
s !== i && !(s === "" && i === null) && this.ctx.database.setItemValue(t, e, s, !0, !0, !0), this.inputEl.
|
|
5088
|
+
const { rowKey: t, key: e } = this.cellTarget, i = this.cellTarget.getValue(), s = this.inputEl.value;
|
|
5089
|
+
s !== i && !(s === "" && i === null) && this.ctx.database.setItemValue(t, e, s, !0, !0, !0), this.inputEl.value = "", this.editorEl.style.left = "-10000px", this.editorEl.style.top = "-10000px";
|
|
5136
5090
|
}
|
|
5137
5091
|
startEdit() {
|
|
5138
5092
|
const { ENABLE_EDIT_CLICK_SELECTOR: t } = this.ctx.config;
|
|
@@ -5141,8 +5095,8 @@ class qi {
|
|
|
5141
5095
|
const e = this.ctx.focusCell;
|
|
5142
5096
|
if (!e || ["index", "index-selection", "selection"].includes(e.type) || this.enable)
|
|
5143
5097
|
return;
|
|
5144
|
-
const { rowKey: i, key: s } = e,
|
|
5145
|
-
e && !
|
|
5098
|
+
const { rowKey: i, key: s } = e, r = this.ctx.database.getReadonly(i, s);
|
|
5099
|
+
e && !r && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = e, this.startEditByInput(this.cellTarget), this.ctx.emit("startEdit", this.cellTarget));
|
|
5146
5100
|
}
|
|
5147
5101
|
editCell(t, e) {
|
|
5148
5102
|
const i = this.ctx.body.renderRows.find((h) => h.rowIndex === t);
|
|
@@ -5152,11 +5106,11 @@ class qi {
|
|
|
5152
5106
|
if (!s)
|
|
5153
5107
|
return;
|
|
5154
5108
|
this.ctx.emit("setSelectorCell", s);
|
|
5155
|
-
const
|
|
5156
|
-
if (!
|
|
5109
|
+
const r = this.ctx.focusCell;
|
|
5110
|
+
if (!r || ["index", "index-selection", "selection"].includes(r.type) || this.enable)
|
|
5157
5111
|
return;
|
|
5158
|
-
const { rowKey:
|
|
5159
|
-
|
|
5112
|
+
const { rowKey: o, key: n } = r, l = this.ctx.database.getReadonly(o, n);
|
|
5113
|
+
r && !l && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = r, this.startEditByInput(this.cellTarget), this.ctx.emit("startEdit", this.cellTarget));
|
|
5160
5114
|
}
|
|
5161
5115
|
doneEdit() {
|
|
5162
5116
|
this.enable && this.cellTarget && (this.ctx.emit("doneEdit", this.cellTarget), this.doneEditByInput(), this.enable = !1, this.ctx.target.focus(), this.ctx.editing = !1, this.cellTarget = null, this.ctx.emit("draw"));
|
|
@@ -5169,12 +5123,12 @@ class Gi {
|
|
|
5169
5123
|
c(this, "ctx");
|
|
5170
5124
|
c(this, "emptyEl");
|
|
5171
5125
|
this.ctx = t;
|
|
5172
|
-
const { EMPTY_TEXT: e, EMPTY_CUSTOM: i, EMPTY_CUSTOM_STYLE: s, CSS_PREFIX:
|
|
5173
|
-
this.emptyEl = document.createElement("div"), this.emptyEl.className = `${
|
|
5126
|
+
const { EMPTY_TEXT: e, EMPTY_CUSTOM: i, EMPTY_CUSTOM_STYLE: s, CSS_PREFIX: r } = this.ctx.config;
|
|
5127
|
+
this.emptyEl = document.createElement("div"), this.emptyEl.className = `${r}-empty`, this.emptyEl.style.display = "none", this.emptyEl.innerText = e, this.ctx.targetContainer.appendChild(this.emptyEl), this.ctx.on("emptyChange", ({ type: o, headerHeight: n, bodyHeight: l, footerHeight: h }) => {
|
|
5174
5128
|
if (i)
|
|
5175
5129
|
return;
|
|
5176
5130
|
const f = n + (l + h) / 2, d = {
|
|
5177
|
-
display:
|
|
5131
|
+
display: o === "empty" ? "block" : "none",
|
|
5178
5132
|
position: "absolute",
|
|
5179
5133
|
fontSize: "14px",
|
|
5180
5134
|
color: "#666",
|
|
@@ -5200,15 +5154,15 @@ class ji {
|
|
|
5200
5154
|
let i = !1, s = this.getHeader();
|
|
5201
5155
|
e.top < 0 && e.top < -this.ctx.header.visibleHeight && e.top > -this.ctx.body.visibleHeight ? i = !0 : i = !1;
|
|
5202
5156
|
const {
|
|
5203
|
-
config: { CSS_PREFIX:
|
|
5204
|
-
} = this.ctx, { visibleWidth:
|
|
5157
|
+
config: { CSS_PREFIX: r }
|
|
5158
|
+
} = this.ctx, { visibleWidth: o } = this.ctx.body, n = {
|
|
5205
5159
|
type: "header-sticky",
|
|
5206
|
-
class: `${
|
|
5160
|
+
class: `${r}-overlayer-header-sticky`,
|
|
5207
5161
|
style: {
|
|
5208
5162
|
position: "sticky",
|
|
5209
5163
|
top: "0px",
|
|
5210
5164
|
"z-index": 10,
|
|
5211
|
-
width: `${
|
|
5165
|
+
width: `${o}px`,
|
|
5212
5166
|
display: i ? "block" : "none"
|
|
5213
5167
|
},
|
|
5214
5168
|
views: s.views
|
|
@@ -5230,10 +5184,10 @@ class ji {
|
|
|
5230
5184
|
const {
|
|
5231
5185
|
target: t,
|
|
5232
5186
|
config: { SCROLLER_TRACK_SIZE: e }
|
|
5233
|
-
} = this.ctx, i = t.width - e, s = t.height - e,
|
|
5234
|
-
let l = [
|
|
5187
|
+
} = this.ctx, i = t.width - e, s = t.height - e, r = this.getHeader(), o = this.getBody(), n = this.getFooter();
|
|
5188
|
+
let l = [r, o, n];
|
|
5235
5189
|
const { FOOTER_FIXED: h } = this.ctx.config;
|
|
5236
|
-
return h || (l = [
|
|
5190
|
+
return h || (l = [r, o]), {
|
|
5237
5191
|
style: {
|
|
5238
5192
|
position: "absolute",
|
|
5239
5193
|
left: "0px",
|
|
@@ -5251,7 +5205,7 @@ class ji {
|
|
|
5251
5205
|
fixedLeftWidth: t,
|
|
5252
5206
|
fixedRightWidth: e,
|
|
5253
5207
|
config: { SCROLLER_TRACK_SIZE: i, CSS_PREFIX: s }
|
|
5254
|
-
} = this.ctx, { visibleWidth:
|
|
5208
|
+
} = this.ctx, { visibleWidth: r, visibleHeight: o, renderCellHeaders: n } = this.ctx.header;
|
|
5255
5209
|
let l = [], h = [], f = [];
|
|
5256
5210
|
n.forEach((w) => {
|
|
5257
5211
|
w.render && (w.fixed === "left" ? h.push(w) : w.fixed === "right" ? f.push(w) : l.push(w));
|
|
@@ -5264,7 +5218,7 @@ class ji {
|
|
|
5264
5218
|
left: "0px",
|
|
5265
5219
|
overflow: "hidden",
|
|
5266
5220
|
width: `${t}px`,
|
|
5267
|
-
height: `${
|
|
5221
|
+
height: `${o}px`
|
|
5268
5222
|
},
|
|
5269
5223
|
cells: h
|
|
5270
5224
|
}, u = {
|
|
@@ -5274,8 +5228,8 @@ class ji {
|
|
|
5274
5228
|
top: "0px",
|
|
5275
5229
|
left: `${t}px`,
|
|
5276
5230
|
overflow: "hidden",
|
|
5277
|
-
width: `${
|
|
5278
|
-
height: `${
|
|
5231
|
+
width: `${r - t - d + 1}px`,
|
|
5232
|
+
height: `${o}px`
|
|
5279
5233
|
},
|
|
5280
5234
|
cells: l
|
|
5281
5235
|
}, p = {
|
|
@@ -5286,7 +5240,7 @@ class ji {
|
|
|
5286
5240
|
right: "0px",
|
|
5287
5241
|
overflow: "hidden",
|
|
5288
5242
|
width: `${d + 1}px`,
|
|
5289
|
-
height: `${
|
|
5243
|
+
height: `${o}px`
|
|
5290
5244
|
},
|
|
5291
5245
|
cells: f
|
|
5292
5246
|
};
|
|
@@ -5296,8 +5250,8 @@ class ji {
|
|
|
5296
5250
|
style: {
|
|
5297
5251
|
position: "relative",
|
|
5298
5252
|
overflow: "hidden",
|
|
5299
|
-
width: `${
|
|
5300
|
-
height: `${
|
|
5253
|
+
width: `${r}px`,
|
|
5254
|
+
height: `${o}px`
|
|
5301
5255
|
},
|
|
5302
5256
|
views: [x, u, p]
|
|
5303
5257
|
};
|
|
@@ -5311,17 +5265,17 @@ class ji {
|
|
|
5311
5265
|
});
|
|
5312
5266
|
});
|
|
5313
5267
|
const {
|
|
5314
|
-
fixedLeftWidth:
|
|
5315
|
-
fixedRightWidth:
|
|
5268
|
+
fixedLeftWidth: r,
|
|
5269
|
+
fixedRightWidth: o,
|
|
5316
5270
|
config: { SCROLLER_TRACK_SIZE: n, CSS_PREFIX: l }
|
|
5317
|
-
} = this.ctx, { visibleWidth: h, visibleHeight: f } = this.ctx.body, d =
|
|
5271
|
+
} = this.ctx, { visibleWidth: h, visibleHeight: f } = this.ctx.body, d = o - n, x = {
|
|
5318
5272
|
key: "left",
|
|
5319
5273
|
style: {
|
|
5320
5274
|
position: "absolute",
|
|
5321
5275
|
top: `${0.5}px`,
|
|
5322
5276
|
left: `${0.5}px`,
|
|
5323
5277
|
overflow: "hidden",
|
|
5324
|
-
width: `${
|
|
5278
|
+
width: `${r}px`,
|
|
5325
5279
|
height: `${f}px`
|
|
5326
5280
|
},
|
|
5327
5281
|
cells: e
|
|
@@ -5330,9 +5284,9 @@ class ji {
|
|
|
5330
5284
|
style: {
|
|
5331
5285
|
position: "absolute",
|
|
5332
5286
|
top: `${0.5}px`,
|
|
5333
|
-
left: `${
|
|
5287
|
+
left: `${r + 0.5}px`,
|
|
5334
5288
|
overflow: "hidden",
|
|
5335
|
-
width: `${h -
|
|
5289
|
+
width: `${h - r - d}px`,
|
|
5336
5290
|
height: `${f}px`
|
|
5337
5291
|
},
|
|
5338
5292
|
cells: t
|
|
@@ -5369,9 +5323,9 @@ class ji {
|
|
|
5369
5323
|
});
|
|
5370
5324
|
const {
|
|
5371
5325
|
fixedLeftWidth: s,
|
|
5372
|
-
fixedRightWidth:
|
|
5373
|
-
config: { SCROLLER_TRACK_SIZE:
|
|
5374
|
-
} = this.ctx, { visibleWidth: l, visibleHeight: h } = this.ctx.footer, f =
|
|
5326
|
+
fixedRightWidth: r,
|
|
5327
|
+
config: { SCROLLER_TRACK_SIZE: o, CSS_PREFIX: n }
|
|
5328
|
+
} = this.ctx, { visibleWidth: l, visibleHeight: h } = this.ctx.footer, f = r - o, d = {
|
|
5375
5329
|
key: "left",
|
|
5376
5330
|
style: {
|
|
5377
5331
|
position: "absolute",
|
|
@@ -5428,8 +5382,8 @@ class Ui {
|
|
|
5428
5382
|
this.ctx.on("cellContextMenuClick", (t, e) => {
|
|
5429
5383
|
if (!this.ctx.config.ENABLE_CONTEXT_MENU) return;
|
|
5430
5384
|
e.preventDefault();
|
|
5431
|
-
const { xArr: i, yArr: s } = this.ctx.selector, [
|
|
5432
|
-
h >= n && h <= l && f >=
|
|
5385
|
+
const { xArr: i, yArr: s } = this.ctx.selector, [r, o] = i, [n, l] = s, { rowIndex: h, colIndex: f } = t;
|
|
5386
|
+
h >= n && h <= l && f >= r && f <= o || this.ctx.emit("setSelectorCell", t, e);
|
|
5433
5387
|
const x = {
|
|
5434
5388
|
getBoundingClientRect: () => ({
|
|
5435
5389
|
width: 0,
|
|
@@ -5552,14 +5506,14 @@ class Qi {
|
|
|
5552
5506
|
editCell(t, e) {
|
|
5553
5507
|
this.editor.editCell(t, e);
|
|
5554
5508
|
}
|
|
5555
|
-
setItemValue(t, e, i, s = !0,
|
|
5556
|
-
this.ctx.database.setItemValue(t, e, i, s,
|
|
5509
|
+
setItemValue(t, e, i, s = !0, r = !0, o = !1) {
|
|
5510
|
+
this.ctx.database.setItemValue(t, e, i, s, r, o);
|
|
5557
5511
|
}
|
|
5558
5512
|
batchSetItemValue(t, e = !0, i = !0) {
|
|
5559
5513
|
this.ctx.database.batchSetItemValue(t, e), i && this.ctx.emit("draw");
|
|
5560
5514
|
}
|
|
5561
|
-
setItemValueByEditor(t, e, i, s = !0,
|
|
5562
|
-
this.ctx.database.setItemValue(t, e, i, s,
|
|
5515
|
+
setItemValueByEditor(t, e, i, s = !0, r = !0) {
|
|
5516
|
+
this.ctx.database.setItemValue(t, e, i, s, r, !0), this.editor.doneEdit();
|
|
5563
5517
|
}
|
|
5564
5518
|
doLayout() {
|
|
5565
5519
|
this.ctx.emit("draw");
|
|
@@ -5580,9 +5534,9 @@ class Qi {
|
|
|
5580
5534
|
e(s);
|
|
5581
5535
|
} catch (s) {
|
|
5582
5536
|
if (t && Array.isArray(s) && s.length) {
|
|
5583
|
-
const [
|
|
5584
|
-
if (Array.isArray(
|
|
5585
|
-
const [
|
|
5537
|
+
const [r] = s;
|
|
5538
|
+
if (Array.isArray(r) && r.length) {
|
|
5539
|
+
const [o] = r, { rowKey: n, key: l } = o;
|
|
5586
5540
|
this.scrollToRowkey(n), this.scrollToColkey(l);
|
|
5587
5541
|
}
|
|
5588
5542
|
}
|
|
@@ -5592,8 +5546,8 @@ class Qi {
|
|
|
5592
5546
|
}
|
|
5593
5547
|
setValidations(t) {
|
|
5594
5548
|
if (t.forEach((e) => {
|
|
5595
|
-
const { rowIndex: i, key: s, message:
|
|
5596
|
-
this.ctx.database.setValidationErrorByRowIndex(i, s,
|
|
5549
|
+
const { rowIndex: i, key: s, message: r } = e;
|
|
5550
|
+
this.ctx.database.setValidationErrorByRowIndex(i, s, r);
|
|
5597
5551
|
}), t && Array.isArray(t) && t.length) {
|
|
5598
5552
|
const [e] = t;
|
|
5599
5553
|
if (e && e.rowIndex >= 0 && e.key) {
|
|
@@ -5605,13 +5559,13 @@ class Qi {
|
|
|
5605
5559
|
getValidations() {
|
|
5606
5560
|
return new Promise(async (t, e) => {
|
|
5607
5561
|
const i = this.ctx.database.getAllRowsData(), s = this.ctx.header.leafCellHeaders;
|
|
5608
|
-
let
|
|
5609
|
-
for (let
|
|
5562
|
+
let r = [];
|
|
5563
|
+
for (let o = 0; o < i.length; o++)
|
|
5610
5564
|
for (let n = 0; n < s.length; n++) {
|
|
5611
|
-
const l = this.ctx.database.getRowKeyByItem(i[
|
|
5612
|
-
Array.isArray(d) && d.length &&
|
|
5565
|
+
const l = this.ctx.database.getRowKeyByItem(i[o]), f = s[n].key, d = await this.ctx.database.getValidator(l, f);
|
|
5566
|
+
Array.isArray(d) && d.length && r.push(d);
|
|
5613
5567
|
}
|
|
5614
|
-
|
|
5568
|
+
r.length ? (e(r), this.ctx.emit("draw")) : (t([]), this.ctx.emit("draw"));
|
|
5615
5569
|
});
|
|
5616
5570
|
}
|
|
5617
5571
|
scrollTo(t, e) {
|