e-virt-table 1.2.8 → 1.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +5 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +587 -580
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +5 -5
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/Body.js +5 -3
- package/dist/lib/Body.js.map +1 -1
- package/dist/lib/Cell.js +3 -3
- package/dist/lib/Cell.js.map +1 -1
- package/dist/lib/Config.d.ts +2 -0
- package/dist/lib/Config.js +16 -3
- package/dist/lib/Config.js.map +1 -1
- package/dist/lib/Paint.js +1 -0
- package/dist/lib/Paint.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 o=document.createElement("style");o.appendChild(document.createTextNode(
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode(":root{--evt-header-font: 12px normal Arial;--evt-body-font: 12px normal Arial;--evt-color-white: #fff;--evt-color-black: #000000;--evt-color-primary: rgb(82, 146, 247);--evt-text-color-primary: #333;--evt-text-color-regular: #666;--evt-text-color-secondary: #999;--evt-box-shadow: 0 2px 12px 0 #0000001a;--evt-editor-bg-color: #fff;--evt-editor-text-color: #333;--evt-border-color: #e1e6eb;--evt-stripe-color: #fafafa;--evt-placeholder-color: #cdd0dc;--evt-header-bg-color: #f8faff;--evt-body-bg-color: #fff;--evt-header-text-color: #1d2129;--evt-body-text-color: #4e5969;--evt-footer-text-color: #4e5969;--evt-loading-icon-color: #4e5969;--evt-expand-icon-color: #4e5969;--evt-shrink-icon-color: #4e5969;--evt-error-tip-icon-color: red;--evt-cell-hover-icon-bg-color: #fff;--evt-cell-hover-icon-border-color: #dde0ea;--evt-scroller-color: #dee0e3;--evt-scroller-track-color: #fff;--evt-scroller-focus-color: #bbbec4;--evt-select-border-color: var(--evt-color-primary);--evt-select-area-color: rgba(82, 146, 247, .1);--evt-select-row-col-bg-color: transparent;--evt-autofill-point-border-color: #fff;--evt-edit-bg-color: #fcf6ed;--evt-checkbox-color: var(--evt-color-primary);--evt-readonly-color: #fff;--evt-readonly-text-color: var(--evt-body-text-color);--evt-error-tip-color: #ed3f14;--evt-footer-bg-color: #fafafa;--evt-highlight-hover-row-color: rgba(186, 203, 231, .1);--evt-highlight-selected-row-color: rgba(82, 146, 247, .1);--evt-tooltip-bg-color: #303133;--evt-tooltip-text-color: #fff;--evt-resize-row-line-color: #e1e6eb;--evt-resize-column-line-color: #e1e6eb}.dark{--evt-border-color: #363637;--evt-header-bg-color: #141414;--evt-body-bg-color: #141414;--evt-header-text-color: #a3a6ad;--evt-scroller-color: #414243;--evt-scroller-track-color: #141414;--evt-scroller-focus-color: #a3a6ad;--evt-edit-bg-color: #141414;--evt-readonly-text-color: #cfd3dc;--evt-footer-bg-color: #262727;--evt-autofill-point-border-color: #fff;--evt-editor-bg-color: #434343;--evt-editor-text-color: #cfd3dc}.e-virt-table-container{position:relative;outline:none}.e-virt-table-stage{position:relative;overflow:hidden;outline:none;box-sizing:border-box;z-index:10;border-radius:8px;border:1px solid var(--evt-border-color)}.e-virt-table-canvas{position:absolute;left:0;top:0;box-sizing:border-box;border:none;outline:none;z-index:10}.e-virt-table-editor{position:absolute;top:-10000px;left:-10000px;text-align:left;height:auto;line-height:0;z-index:100;overflow:hidden;background-color:var(--evt-editor-bg-color);border:2px solid var(--evt-color-primary);box-sizing:border-box;box-shadow:var(--evt-box-shadow);display:flex;align-items:center}.e-virt-table-overlayer{position:absolute;left:0;top:0;overflow:hidden;z-index:100;pointer-events:none}.e-virt-table-editor-textarea{width:100%;box-sizing:border-box;outline:none;font-weight:400;padding:8px;font-size:12px;color:inherit;white-space:pre-wrap;word-wrap:break-word;word-break:break-all;line-height:1.5;margin:0;border:none;vertical-align:middle;background:var(--evt-editor-bg-color);color:var(--evt-editor-text-color);overflow-y:auto;resize:none}.e-virt-table-context-menu{position:absolute;font-size:14px;color:var(--evt-text-color-regular);background-color:var(--evt-color-white);border-radius:4px;border:1px solid #e4e7ed;box-shadow:var(--evt-box-shadow);width:fit-content;padding:6px 0;z-index:9999;left:-99999px;top:-99999px}.e-virt-table-context-menu-item{cursor:pointer;padding:8px 24px;color:var(--evt-text-color-regular)}.e-virt-table-context-menu-item:hover{color:var(--evt-color-primary);background-color:#f5f7fa}")),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
2
|
var be = Object.defineProperty;
|
|
3
3
|
var ve = (a, t, e) => t in a ? be(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
|
|
4
4
|
var l = (a, t, e) => ve(a, typeof t != "symbol" ? t + "" : t, e);
|
|
@@ -25,7 +25,7 @@ function st(a, t) {
|
|
|
25
25
|
return i.__proto__ = s, i;
|
|
26
26
|
}, st(a, t);
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function _e() {
|
|
29
29
|
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
|
|
30
30
|
if (typeof Proxy == "function") return !0;
|
|
31
31
|
try {
|
|
@@ -36,20 +36,20 @@ function Ie() {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
function dt(a, t, e) {
|
|
39
|
-
return
|
|
39
|
+
return _e() ? dt = Reflect.construct.bind() : dt = function(s, r, o) {
|
|
40
40
|
var n = [null];
|
|
41
41
|
n.push.apply(n, r);
|
|
42
42
|
var h = Function.bind.apply(s, n), c = new h();
|
|
43
43
|
return o && st(c, o.prototype), c;
|
|
44
44
|
}, dt.apply(null, arguments);
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function Ie(a) {
|
|
47
47
|
return Function.toString.call(a).indexOf("[native code]") !== -1;
|
|
48
48
|
}
|
|
49
49
|
function Ct(a) {
|
|
50
50
|
var t = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
51
51
|
return Ct = function(i) {
|
|
52
|
-
if (i === null || !
|
|
52
|
+
if (i === null || !Ie(i)) return i;
|
|
53
53
|
if (typeof i != "function")
|
|
54
54
|
throw new TypeError("Super expression must either be null or a function");
|
|
55
55
|
if (typeof t < "u") {
|
|
@@ -131,7 +131,7 @@ function Se(a, t, e) {
|
|
|
131
131
|
t(n, o);
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function Nt(a, t, e) {
|
|
135
135
|
var i = 0, s = a.length;
|
|
136
136
|
function r(o) {
|
|
137
137
|
if (o && o.length) {
|
|
@@ -143,7 +143,7 @@ function Xt(a, t, e) {
|
|
|
143
143
|
}
|
|
144
144
|
r([]);
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function Te(a) {
|
|
147
147
|
var t = [];
|
|
148
148
|
return Object.keys(a).forEach(function(e) {
|
|
149
149
|
t.push.apply(t, a[e] || []);
|
|
@@ -157,30 +157,30 @@ var Ft = /* @__PURE__ */ function(a) {
|
|
|
157
157
|
}
|
|
158
158
|
return t;
|
|
159
159
|
}(/* @__PURE__ */ Ct(Error));
|
|
160
|
-
function
|
|
160
|
+
function Ae(a, t, e, i, s) {
|
|
161
161
|
if (t.first) {
|
|
162
|
-
var r = new Promise(function(
|
|
163
|
-
var
|
|
164
|
-
return i(
|
|
165
|
-
},
|
|
166
|
-
|
|
162
|
+
var r = new Promise(function(u, g) {
|
|
163
|
+
var m = function(p) {
|
|
164
|
+
return i(p), p.length ? g(new Ft(p, bt(p))) : u(s);
|
|
165
|
+
}, x = Te(a);
|
|
166
|
+
Nt(x, e, m);
|
|
167
167
|
});
|
|
168
|
-
return r.catch(function(
|
|
169
|
-
return
|
|
168
|
+
return r.catch(function(u) {
|
|
169
|
+
return u;
|
|
170
170
|
}), r;
|
|
171
171
|
}
|
|
172
|
-
var o = t.firstFields === !0 ? Object.keys(a) : t.firstFields || [], n = Object.keys(a), h = n.length, c = 0, d = [], f = new Promise(function(
|
|
173
|
-
var
|
|
172
|
+
var o = t.firstFields === !0 ? Object.keys(a) : t.firstFields || [], n = Object.keys(a), h = n.length, c = 0, d = [], f = new Promise(function(u, g) {
|
|
173
|
+
var m = function(w) {
|
|
174
174
|
if (d.push.apply(d, w), c++, c === h)
|
|
175
|
-
return i(d), d.length ? g(new Ft(d, bt(d))) :
|
|
175
|
+
return i(d), d.length ? g(new Ft(d, bt(d))) : u(s);
|
|
176
176
|
};
|
|
177
|
-
n.length || (i(d),
|
|
178
|
-
var w = a[
|
|
179
|
-
o.indexOf(
|
|
177
|
+
n.length || (i(d), u(s)), n.forEach(function(x) {
|
|
178
|
+
var w = a[x];
|
|
179
|
+
o.indexOf(x) !== -1 ? Nt(w, e, m) : Se(w, e, m);
|
|
180
180
|
});
|
|
181
181
|
});
|
|
182
|
-
return f.catch(function(
|
|
183
|
-
return
|
|
182
|
+
return f.catch(function(u) {
|
|
183
|
+
return u;
|
|
184
184
|
}), f;
|
|
185
185
|
}
|
|
186
186
|
function Me(a) {
|
|
@@ -218,7 +218,7 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
218
218
|
t.required && (!i.hasOwnProperty(t.field) || H(e, o || t.type)) && s.push(D(r.messages.required, t.fullField));
|
|
219
219
|
}, De = function(t, e, i, s, r) {
|
|
220
220
|
(/^\s+$/.test(e) || e === "") && s.push(D(r.messages.whitespace, t.fullField));
|
|
221
|
-
}, ct,
|
|
221
|
+
}, ct, Xe = function() {
|
|
222
222
|
if (ct)
|
|
223
223
|
return ct;
|
|
224
224
|
var a = "[a-fA-F\\d:]", t = function(b) {
|
|
@@ -242,7 +242,7 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
242
242
|
}, h.v6 = function(y) {
|
|
243
243
|
return y && y.exact ? n : new RegExp("" + t(y) + s + t(y), "g");
|
|
244
244
|
};
|
|
245
|
-
var c = "(?:(?:[a-z]+:)?//)", d = "(?:\\S+(?::\\S*)?@)?", f = h.v4().source,
|
|
245
|
+
var c = "(?:(?:[a-z]+:)?//)", d = "(?:\\S+(?::\\S*)?@)?", f = h.v4().source, u = h.v6().source, g = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", m = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", x = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", w = "(?::\\d{2,5})?", p = '(?:[/?#][^\\s"]*)?', C = "(?:" + c + "|www\\.)" + d + "(?:localhost|" + f + "|" + u + "|" + g + m + x + ")" + w + p;
|
|
246
246
|
return ct = new RegExp("(?:^" + C + "$)", "i"), ct;
|
|
247
247
|
}, Kt = {
|
|
248
248
|
// http://emailregex.com/
|
|
@@ -287,12 +287,12 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
287
287
|
return typeof t == "string" && t.length <= 320 && !!t.match(Kt.email);
|
|
288
288
|
},
|
|
289
289
|
url: function(t) {
|
|
290
|
-
return typeof t == "string" && t.length <= 2048 && !!t.match(
|
|
290
|
+
return typeof t == "string" && t.length <= 2048 && !!t.match(Xe());
|
|
291
291
|
},
|
|
292
292
|
hex: function(t) {
|
|
293
293
|
return typeof t == "string" && !!t.match(Kt.hex);
|
|
294
294
|
}
|
|
295
|
-
},
|
|
295
|
+
}, Ne = function(t, e, i, s, r) {
|
|
296
296
|
if (t.required && e === void 0) {
|
|
297
297
|
Zt(t, e, i, s, r);
|
|
298
298
|
return;
|
|
@@ -300,10 +300,10 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
300
300
|
var o = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"], n = t.type;
|
|
301
301
|
o.indexOf(n) > -1 ? et[n](e) || s.push(D(r.messages.types[n], t.fullField, t.type)) : n && typeof e !== t.type && s.push(D(r.messages.types[n], t.fullField, t.type));
|
|
302
302
|
}, Fe = function(t, e, i, s, r) {
|
|
303
|
-
var o = typeof t.len == "number", n = typeof t.min == "number", h = typeof t.max == "number", c = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, d = e, f = null,
|
|
304
|
-
if (
|
|
303
|
+
var o = typeof t.len == "number", n = typeof t.min == "number", h = typeof t.max == "number", c = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, d = e, f = null, u = typeof e == "number", g = typeof e == "string", m = Array.isArray(e);
|
|
304
|
+
if (u ? f = "number" : g ? f = "string" : m && (f = "array"), !f)
|
|
305
305
|
return !1;
|
|
306
|
-
|
|
306
|
+
m && (d = e.length), g && (d = e.replace(c, "_").length), o ? d !== t.len && s.push(D(r.messages[f].len, t.fullField, t.len)) : n && !h && d < t.min ? s.push(D(r.messages[f].min, t.fullField, t.min)) : h && !n && d > t.max ? s.push(D(r.messages[f].max, t.fullField, t.max)) : n && h && (d < t.min || d > t.max) && s.push(D(r.messages[f].range, t.fullField, t.min, t.max));
|
|
307
307
|
}, j = "enum", Be = function(t, e, i, s, r) {
|
|
308
308
|
t[j] = Array.isArray(t[j]) ? t[j] : [], t[j].indexOf(e) === -1 && s.push(D(r.messages[j], t.fullField, t[j].join(", ")));
|
|
309
309
|
}, ke = function(t, e, i, s, r) {
|
|
@@ -315,10 +315,10 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
315
315
|
o.test(e) || s.push(D(r.messages.pattern.mismatch, t.fullField, e, t.pattern));
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
|
-
},
|
|
318
|
+
}, L = {
|
|
319
319
|
required: Zt,
|
|
320
320
|
whitespace: De,
|
|
321
|
-
type:
|
|
321
|
+
type: Ne,
|
|
322
322
|
range: Fe,
|
|
323
323
|
enum: Be,
|
|
324
324
|
pattern: ke
|
|
@@ -327,7 +327,7 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
327
327
|
if (n) {
|
|
328
328
|
if (H(e, "string") && !t.required)
|
|
329
329
|
return i();
|
|
330
|
-
|
|
330
|
+
L.required(t, e, s, o, r, "string"), H(e, "string") || (L.type(t, e, s, o, r), L.range(t, e, s, o, r), L.pattern(t, e, s, o, r), t.whitespace === !0 && L.whitespace(t, e, s, o, r));
|
|
331
331
|
}
|
|
332
332
|
i(o);
|
|
333
333
|
}, Ye = function(t, e, i, s, r) {
|
|
@@ -335,7 +335,7 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
335
335
|
if (n) {
|
|
336
336
|
if (H(e) && !t.required)
|
|
337
337
|
return i();
|
|
338
|
-
|
|
338
|
+
L.required(t, e, s, o, r), e !== void 0 && L.type(t, e, s, o, r);
|
|
339
339
|
}
|
|
340
340
|
i(o);
|
|
341
341
|
}, Ve = function(t, e, i, s, r) {
|
|
@@ -343,7 +343,7 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
343
343
|
if (n) {
|
|
344
344
|
if (e === "" && (e = void 0), H(e) && !t.required)
|
|
345
345
|
return i();
|
|
346
|
-
|
|
346
|
+
L.required(t, e, s, o, r), e !== void 0 && (L.type(t, e, s, o, r), L.range(t, e, s, o, r));
|
|
347
347
|
}
|
|
348
348
|
i(o);
|
|
349
349
|
}, We = function(t, e, i, s, r) {
|
|
@@ -351,7 +351,7 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
351
351
|
if (n) {
|
|
352
352
|
if (H(e) && !t.required)
|
|
353
353
|
return i();
|
|
354
|
-
|
|
354
|
+
L.required(t, e, s, o, r), e !== void 0 && L.type(t, e, s, o, r);
|
|
355
355
|
}
|
|
356
356
|
i(o);
|
|
357
357
|
}, Pe = function(t, e, i, s, r) {
|
|
@@ -359,7 +359,7 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
359
359
|
if (n) {
|
|
360
360
|
if (H(e) && !t.required)
|
|
361
361
|
return i();
|
|
362
|
-
|
|
362
|
+
L.required(t, e, s, o, r), H(e) || L.type(t, e, s, o, r);
|
|
363
363
|
}
|
|
364
364
|
i(o);
|
|
365
365
|
}, ze = function(t, e, i, s, r) {
|
|
@@ -367,7 +367,7 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
367
367
|
if (n) {
|
|
368
368
|
if (H(e) && !t.required)
|
|
369
369
|
return i();
|
|
370
|
-
|
|
370
|
+
L.required(t, e, s, o, r), e !== void 0 && (L.type(t, e, s, o, r), L.range(t, e, s, o, r));
|
|
371
371
|
}
|
|
372
372
|
i(o);
|
|
373
373
|
}, $e = function(t, e, i, s, r) {
|
|
@@ -375,7 +375,7 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
375
375
|
if (n) {
|
|
376
376
|
if (H(e) && !t.required)
|
|
377
377
|
return i();
|
|
378
|
-
|
|
378
|
+
L.required(t, e, s, o, r), e !== void 0 && (L.type(t, e, s, o, r), L.range(t, e, s, o, r));
|
|
379
379
|
}
|
|
380
380
|
i(o);
|
|
381
381
|
}, qe = function(t, e, i, s, r) {
|
|
@@ -383,7 +383,7 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
383
383
|
if (n) {
|
|
384
384
|
if (e == null && !t.required)
|
|
385
385
|
return i();
|
|
386
|
-
|
|
386
|
+
L.required(t, e, s, o, r, "array"), e != null && (L.type(t, e, s, o, r), L.range(t, e, s, o, r));
|
|
387
387
|
}
|
|
388
388
|
i(o);
|
|
389
389
|
}, Ge = function(t, e, i, s, r) {
|
|
@@ -391,7 +391,7 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
391
391
|
if (n) {
|
|
392
392
|
if (H(e) && !t.required)
|
|
393
393
|
return i();
|
|
394
|
-
|
|
394
|
+
L.required(t, e, s, o, r), e !== void 0 && L.type(t, e, s, o, r);
|
|
395
395
|
}
|
|
396
396
|
i(o);
|
|
397
397
|
}, je = "enum", Ue = function(t, e, i, s, r) {
|
|
@@ -399,7 +399,7 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
399
399
|
if (n) {
|
|
400
400
|
if (H(e) && !t.required)
|
|
401
401
|
return i();
|
|
402
|
-
|
|
402
|
+
L.required(t, e, s, o, r), e !== void 0 && L[je](t, e, s, o, r);
|
|
403
403
|
}
|
|
404
404
|
i(o);
|
|
405
405
|
}, Ze = function(t, e, i, s, r) {
|
|
@@ -407,7 +407,7 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
407
407
|
if (n) {
|
|
408
408
|
if (H(e, "string") && !t.required)
|
|
409
409
|
return i();
|
|
410
|
-
|
|
410
|
+
L.required(t, e, s, o, r), H(e, "string") || L.pattern(t, e, s, o, r);
|
|
411
411
|
}
|
|
412
412
|
i(o);
|
|
413
413
|
}, Je = function(t, e, i, s, r) {
|
|
@@ -415,21 +415,21 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
415
415
|
if (n) {
|
|
416
416
|
if (H(e, "date") && !t.required)
|
|
417
417
|
return i();
|
|
418
|
-
if (
|
|
418
|
+
if (L.required(t, e, s, o, r), !H(e, "date")) {
|
|
419
419
|
var h;
|
|
420
|
-
e instanceof Date ? h = e : h = new Date(e),
|
|
420
|
+
e instanceof Date ? h = e : h = new Date(e), L.type(t, h, s, o, r), h && L.range(t, h.getTime(), s, o, r);
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
423
|
i(o);
|
|
424
424
|
}, Qe = function(t, e, i, s, r) {
|
|
425
425
|
var o = [], n = Array.isArray(e) ? "array" : typeof e;
|
|
426
|
-
|
|
426
|
+
L.required(t, e, s, o, r, n), i(o);
|
|
427
427
|
}, mt = function(t, e, i, s, r) {
|
|
428
428
|
var o = t.type, n = [], h = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
429
429
|
if (h) {
|
|
430
430
|
if (H(e, o) && !t.required)
|
|
431
431
|
return i();
|
|
432
|
-
|
|
432
|
+
L.required(t, e, s, n, r, o), H(e, o) || L.type(t, e, s, n, r);
|
|
433
433
|
}
|
|
434
434
|
i(n);
|
|
435
435
|
}, ti = function(t, e, i, s, r) {
|
|
@@ -437,7 +437,7 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
437
437
|
if (n) {
|
|
438
438
|
if (H(e) && !t.required)
|
|
439
439
|
return i();
|
|
440
|
-
|
|
440
|
+
L.required(t, e, s, o, r);
|
|
441
441
|
}
|
|
442
442
|
i(o);
|
|
443
443
|
}, it = {
|
|
@@ -536,8 +536,8 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
536
536
|
var n = i, h = s, c = r;
|
|
537
537
|
if (typeof h == "function" && (c = h, h = {}), !this.rules || Object.keys(this.rules).length === 0)
|
|
538
538
|
return c && c(null, n), Promise.resolve(n);
|
|
539
|
-
function d(
|
|
540
|
-
var w = [],
|
|
539
|
+
function d(x) {
|
|
540
|
+
var w = [], p = {};
|
|
541
541
|
function C(b) {
|
|
542
542
|
if (Array.isArray(b)) {
|
|
543
543
|
var E;
|
|
@@ -545,88 +545,88 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
545
545
|
} else
|
|
546
546
|
w.push(b);
|
|
547
547
|
}
|
|
548
|
-
for (var y = 0; y <
|
|
549
|
-
C(
|
|
550
|
-
w.length ? (
|
|
548
|
+
for (var y = 0; y < x.length; y++)
|
|
549
|
+
C(x[y]);
|
|
550
|
+
w.length ? (p = bt(w), c(w, p)) : c(null, n);
|
|
551
551
|
}
|
|
552
552
|
if (h.messages) {
|
|
553
553
|
var f = this.messages();
|
|
554
554
|
f === Rt && (f = vt()), kt(f, h.messages), h.messages = f;
|
|
555
555
|
} else
|
|
556
556
|
h.messages = this.messages();
|
|
557
|
-
var
|
|
558
|
-
g.forEach(function(
|
|
559
|
-
var w = o.rules[
|
|
557
|
+
var u = {}, g = h.keys || Object.keys(this.rules);
|
|
558
|
+
g.forEach(function(x) {
|
|
559
|
+
var w = o.rules[x], p = n[x];
|
|
560
560
|
w.forEach(function(C) {
|
|
561
561
|
var y = C;
|
|
562
|
-
typeof y.transform == "function" && (n === i && (n = q({}, n)),
|
|
562
|
+
typeof y.transform == "function" && (n === i && (n = q({}, n)), p = n[x] = y.transform(p)), typeof y == "function" ? y = {
|
|
563
563
|
validator: y
|
|
564
|
-
} : y = q({}, y), y.validator = o.getValidationMethod(y), y.validator && (y.field =
|
|
564
|
+
} : y = q({}, y), y.validator = o.getValidationMethod(y), y.validator && (y.field = x, y.fullField = y.fullField || x, y.type = o.getType(y), u[x] = u[x] || [], u[x].push({
|
|
565
565
|
rule: y,
|
|
566
|
-
value:
|
|
566
|
+
value: p,
|
|
567
567
|
source: n,
|
|
568
|
-
field:
|
|
568
|
+
field: x
|
|
569
569
|
}));
|
|
570
570
|
});
|
|
571
571
|
});
|
|
572
|
-
var
|
|
573
|
-
return
|
|
574
|
-
var
|
|
575
|
-
C = C && (
|
|
576
|
-
function y(
|
|
577
|
-
return q({},
|
|
578
|
-
fullField:
|
|
579
|
-
fullFields:
|
|
572
|
+
var m = {};
|
|
573
|
+
return Ae(u, h, function(x, w) {
|
|
574
|
+
var p = x.rule, C = (p.type === "object" || p.type === "array") && (typeof p.fields == "object" || typeof p.defaultField == "object");
|
|
575
|
+
C = C && (p.required || !p.required && x.value), p.field = x.field;
|
|
576
|
+
function y(R, O) {
|
|
577
|
+
return q({}, O, {
|
|
578
|
+
fullField: p.fullField + "." + R,
|
|
579
|
+
fullFields: p.fullFields ? [].concat(p.fullFields, [R]) : [R]
|
|
580
580
|
});
|
|
581
581
|
}
|
|
582
|
-
function b(
|
|
583
|
-
|
|
584
|
-
var
|
|
585
|
-
!h.suppressWarning &&
|
|
586
|
-
var
|
|
587
|
-
if (h.first &&
|
|
588
|
-
return p
|
|
582
|
+
function b(R) {
|
|
583
|
+
R === void 0 && (R = []);
|
|
584
|
+
var O = Array.isArray(R) ? R : [R];
|
|
585
|
+
!h.suppressWarning && O.length && a.warning("async-validator:", O), O.length && p.message !== void 0 && (O = [].concat(p.message));
|
|
586
|
+
var I = O.map(Bt(p, n));
|
|
587
|
+
if (h.first && I.length)
|
|
588
|
+
return m[p.field] = 1, w(I);
|
|
589
589
|
if (!C)
|
|
590
|
-
w(
|
|
590
|
+
w(I);
|
|
591
591
|
else {
|
|
592
|
-
if (
|
|
593
|
-
return
|
|
594
|
-
var
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
}),
|
|
598
|
-
var
|
|
599
|
-
Object.keys(
|
|
600
|
-
var M =
|
|
601
|
-
|
|
592
|
+
if (p.required && !x.value)
|
|
593
|
+
return p.message !== void 0 ? I = [].concat(p.message).map(Bt(p, n)) : h.error && (I = [h.error(p, D(h.messages.required, p.field))]), w(I);
|
|
594
|
+
var _ = {};
|
|
595
|
+
p.defaultField && Object.keys(x.value).map(function(T) {
|
|
596
|
+
_[T] = p.defaultField;
|
|
597
|
+
}), _ = q({}, _, x.rule.fields);
|
|
598
|
+
var v = {};
|
|
599
|
+
Object.keys(_).forEach(function(T) {
|
|
600
|
+
var M = _[T], A = Array.isArray(M) ? M : [M];
|
|
601
|
+
v[T] = A.map(y.bind(null, T));
|
|
602
602
|
});
|
|
603
|
-
var
|
|
604
|
-
|
|
603
|
+
var S = new a(v);
|
|
604
|
+
S.messages(h.messages), x.rule.options && (x.rule.options.messages = h.messages, x.rule.options.error = h.error), S.validate(x.value, x.rule.options || h, function(T) {
|
|
605
605
|
var M = [];
|
|
606
|
-
|
|
606
|
+
I && I.length && M.push.apply(M, I), T && T.length && M.push.apply(M, T), w(M.length ? M : null);
|
|
607
607
|
});
|
|
608
608
|
}
|
|
609
609
|
}
|
|
610
610
|
var E;
|
|
611
|
-
if (
|
|
612
|
-
E =
|
|
613
|
-
else if (
|
|
611
|
+
if (p.asyncValidator)
|
|
612
|
+
E = p.asyncValidator(p, x.value, b, x.source, h);
|
|
613
|
+
else if (p.validator) {
|
|
614
614
|
try {
|
|
615
|
-
E =
|
|
616
|
-
} catch (
|
|
617
|
-
console.error == null || console.error(
|
|
618
|
-
throw
|
|
619
|
-
}, 0), b(
|
|
615
|
+
E = p.validator(p, x.value, b, x.source, h);
|
|
616
|
+
} catch (R) {
|
|
617
|
+
console.error == null || console.error(R), h.suppressValidatorError || setTimeout(function() {
|
|
618
|
+
throw R;
|
|
619
|
+
}, 0), b(R.message);
|
|
620
620
|
}
|
|
621
|
-
E === !0 ? b() : E === !1 ? b(typeof
|
|
621
|
+
E === !0 ? b() : E === !1 ? b(typeof p.message == "function" ? p.message(p.fullField || p.field) : p.message || (p.fullField || p.field) + " fails") : E instanceof Array ? b(E) : E instanceof Error && b(E.message);
|
|
622
622
|
}
|
|
623
623
|
E && E.then && E.then(function() {
|
|
624
624
|
return b();
|
|
625
|
-
}, function(
|
|
626
|
-
return b(
|
|
625
|
+
}, function(R) {
|
|
626
|
+
return b(R);
|
|
627
627
|
});
|
|
628
|
-
}, function(
|
|
629
|
-
d(
|
|
628
|
+
}, function(x) {
|
|
629
|
+
d(x);
|
|
630
630
|
}, n);
|
|
631
631
|
}, t.getType = function(i) {
|
|
632
632
|
if (i.type === void 0 && i.pattern instanceof RegExp && (i.type = "pattern"), typeof i.validator != "function" && i.type && !it.hasOwnProperty(i.type))
|
|
@@ -702,10 +702,10 @@ function ee(a = [], t = 1, e = 0) {
|
|
|
702
702
|
};
|
|
703
703
|
});
|
|
704
704
|
}
|
|
705
|
-
function
|
|
705
|
+
function _t(a = []) {
|
|
706
706
|
let t = [];
|
|
707
707
|
return a.forEach((e) => {
|
|
708
|
-
e.children ? t = t.concat(
|
|
708
|
+
e.children ? t = t.concat(_t(e.children)) : t.push(e);
|
|
709
709
|
}), t;
|
|
710
710
|
}
|
|
711
711
|
const Yt = /^(\r\n|\n\r|\r|\n)/, ii = /^[^\t\r\n]+/, Vt = /^\t/;
|
|
@@ -847,7 +847,7 @@ class re {
|
|
|
847
847
|
getRightFixedX() {
|
|
848
848
|
}
|
|
849
849
|
}
|
|
850
|
-
class
|
|
850
|
+
class At extends re {
|
|
851
851
|
constructor(e, i, s, r, o, n, h, c, d, f = "body") {
|
|
852
852
|
super(e, r, o, n, h, f, c.fixed);
|
|
853
853
|
l(this, "formatter");
|
|
@@ -1019,19 +1019,19 @@ class Tt extends re {
|
|
|
1019
1019
|
const { CELL_PADDING: e = 0 } = this.ctx.config, { rowKey: i, cellType: s } = this;
|
|
1020
1020
|
let r, o = 0, n = "";
|
|
1021
1021
|
if (this.type === "tree" && s === "body") {
|
|
1022
|
-
const h = this.ctx.database.getRowForRowKey(i), { expand: c = !1, hasChildren: d = !1, expandLoading: f = !1, level:
|
|
1022
|
+
const h = this.ctx.database.getRowForRowKey(i), { expand: c = !1, hasChildren: d = !1, expandLoading: f = !1, level: u = 0 } = h || {};
|
|
1023
1023
|
if (this.rowExpand = c, this.rowHasChildren = d, f) {
|
|
1024
|
-
const
|
|
1025
|
-
n = "loading", r =
|
|
1024
|
+
const x = this.ctx.icons.get("loading");
|
|
1025
|
+
n = "loading", r = x, o = u * 8;
|
|
1026
1026
|
} else if (d) {
|
|
1027
|
-
const
|
|
1028
|
-
r = c ? w :
|
|
1027
|
+
const x = this.ctx.icons.get("expand"), w = this.ctx.icons.get("shrink");
|
|
1028
|
+
r = c ? w : x, n = c ? "shrink" : "expand", o = u * 8;
|
|
1029
1029
|
} else
|
|
1030
|
-
o =
|
|
1031
|
-
let g = 20,
|
|
1030
|
+
o = u * 8;
|
|
1031
|
+
let g = 20, m = 20;
|
|
1032
1032
|
if (r) {
|
|
1033
|
-
let
|
|
1034
|
-
this.ctx.paint.drawImage(r,
|
|
1033
|
+
let x = this.drawX + o + e, w = this.drawY + (this.visibleHeight - m) / 2;
|
|
1034
|
+
this.ctx.paint.drawImage(r, x, w, g, m), this.drawImageX = x, this.drawImageY = w, this.drawImageWidth = g, this.drawImageHeight = m, this.drawImageName = n, this.drawImageSource = r;
|
|
1035
1035
|
}
|
|
1036
1036
|
this.align = "left", this.drawTextX = o + this.drawX + g - 0.5;
|
|
1037
1037
|
}
|
|
@@ -1043,40 +1043,42 @@ class Tt extends re {
|
|
|
1043
1043
|
BODY_CELL_STYLE_METHOD: s,
|
|
1044
1044
|
FOOTER_CELL_STYLE_METHOD: r,
|
|
1045
1045
|
READONLY_TEXT_COLOR: o,
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1046
|
+
BODY_TEXT_COLOR: n,
|
|
1047
|
+
FOOTER_TEXT_COLOR: h,
|
|
1048
|
+
FOOTER_BG_COLOR: c,
|
|
1049
|
+
HIGHLIGHT_SELECTED_ROW: d,
|
|
1050
|
+
HIGHLIGHT_SELECTED_ROW_COLOR: f,
|
|
1051
|
+
HIGHLIGHT_HOVER_ROW: u,
|
|
1052
|
+
HIGHLIGHT_HOVER_ROW_COLOR: g,
|
|
1053
|
+
STRIPE: m,
|
|
1054
|
+
STRIPE_COLOR: x
|
|
1053
1055
|
} = this.ctx.config;
|
|
1054
1056
|
if (this.cellType === "footer") {
|
|
1055
|
-
let
|
|
1057
|
+
let O = c, I = h;
|
|
1056
1058
|
if (typeof r == "function") {
|
|
1057
|
-
const _ = r, { backgroundColor:
|
|
1059
|
+
const _ = r, { backgroundColor: v, color: S } = _({
|
|
1058
1060
|
row: this.row,
|
|
1059
1061
|
rowIndex: this.rowIndex,
|
|
1060
1062
|
colIndex: this.colIndex,
|
|
1061
1063
|
column: this.column,
|
|
1062
1064
|
value: this.getValue()
|
|
1063
1065
|
}) || {};
|
|
1064
|
-
|
|
1066
|
+
v && (O = v), S && (I = S);
|
|
1065
1067
|
}
|
|
1066
|
-
this.drawCellSkyBgColor = "transparent", this.drawCellBgColor =
|
|
1068
|
+
this.drawCellSkyBgColor = "transparent", this.drawCellBgColor = O, this.drawTextColor = I;
|
|
1067
1069
|
return;
|
|
1068
1070
|
}
|
|
1069
|
-
let
|
|
1070
|
-
const
|
|
1071
|
-
let
|
|
1072
|
-
if (this.rowspan !== 1 && (
|
|
1073
|
-
const
|
|
1074
|
-
|
|
1071
|
+
let w = "transparent";
|
|
1072
|
+
const p = this.ctx.focusCell, C = this.ctx.hoverCell;
|
|
1073
|
+
let y = this.rowIndex, b = this.rowIndex;
|
|
1074
|
+
if (this.rowspan !== 1 && (u || d)) {
|
|
1075
|
+
const O = this.getSpanInfo(), { yArr: I } = O;
|
|
1076
|
+
y = I[0], b = I[1];
|
|
1075
1077
|
}
|
|
1076
|
-
|
|
1077
|
-
let
|
|
1078
|
-
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (
|
|
1079
|
-
const
|
|
1078
|
+
u && C && (C.rowKey === this.rowKey && (w = g), C.rowIndex >= y && C.rowIndex <= b && (w = g)), d && p && (p.rowKey === this.rowKey && (w = f), p.rowIndex >= y && p.rowIndex <= b && (w = f)), this.drawCellSkyBgColor = w;
|
|
1079
|
+
let E = e, R = n;
|
|
1080
|
+
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (E = i, R = o), m && (this.rowIndex % 2 ? E = x : E = e), typeof s == "function") {
|
|
1081
|
+
const O = s, { backgroundColor: I, color: _ } = O({
|
|
1080
1082
|
row: this.row,
|
|
1081
1083
|
rowIndex: this.rowIndex,
|
|
1082
1084
|
colIndex: this.colIndex,
|
|
@@ -1084,16 +1086,16 @@ class Tt extends re {
|
|
|
1084
1086
|
isHasChanged: this.isHasChanged,
|
|
1085
1087
|
value: this.getValue()
|
|
1086
1088
|
}) || {};
|
|
1087
|
-
|
|
1089
|
+
I && (E = I), _ && (R = _);
|
|
1088
1090
|
}
|
|
1089
|
-
this.drawCellBgColor =
|
|
1091
|
+
this.drawCellBgColor = E, this.drawTextColor = R;
|
|
1090
1092
|
}
|
|
1091
1093
|
updateSelection() {
|
|
1092
1094
|
const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: r, cellType: o, type: n, rowIndex: h, rowKey: c } = this;
|
|
1093
1095
|
if (!(s === 0 || r === 0) && o !== "footer" && ["index-selection", "selection"].includes(n)) {
|
|
1094
|
-
const d = this.ctx.database.getRowSelection(c), f = this.ctx.database.getRowSelectable(c), { CHECKBOX_SIZE:
|
|
1095
|
-
let
|
|
1096
|
-
d && f ? (
|
|
1096
|
+
const d = this.ctx.database.getRowSelection(c), f = this.ctx.database.getRowSelectable(c), { CHECKBOX_SIZE: u = 0 } = this.ctx.config, g = this.drawX + (e - u) / 2, m = this.drawY + (i - u) / 2;
|
|
1097
|
+
let x = this.ctx.icons.get("checkbox-uncheck"), w = "checkbox-uncheck";
|
|
1098
|
+
d && f ? (x = this.ctx.icons.get("checkbox-check"), w = "checkbox-check") : d && f ? (x = this.ctx.icons.get("checkbox-check-disabled"), w = "checkbox-check-disabled") : !d && f ? (x = this.ctx.icons.get("checkbox-uncheck"), w = "checkbox-uncheck") : (x = this.ctx.icons.get("checkbox-disabled"), w = "checkbox-disabled"), x && n == "index-selection" ? (this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === h || ["checkbox-disabled", "checkbox-check"].includes(w)) && (this.drawImageX = g, this.drawImageY = m, this.drawImageWidth = u, this.drawImageHeight = u, this.drawImageName = w, this.drawImageSource = x) : x && n === "selection" && (this.drawImageX = g, this.drawImageY = m, this.drawImageWidth = u, this.drawImageHeight = u, this.drawImageName = w, this.drawImageSource = x);
|
|
1097
1099
|
}
|
|
1098
1100
|
}
|
|
1099
1101
|
updateHoverIcon() {
|
|
@@ -1114,10 +1116,10 @@ class Tt extends re {
|
|
|
1114
1116
|
if (this.hoverIconName && !this.ctx.editing && n) {
|
|
1115
1117
|
let h = 0, c = 0;
|
|
1116
1118
|
if (n.rowKey === this.rowKey && (h = this.drawX + this.width - s - r, c = this.drawY + (this.height - s) / 2), this.rowspan !== 1 && o) {
|
|
1117
|
-
const f = this.getSpanInfo(), { yArr:
|
|
1118
|
-
if (n.rowIndex >= g && n.rowIndex <=
|
|
1119
|
-
const { width:
|
|
1120
|
-
h = this.drawX - C +
|
|
1119
|
+
const f = this.getSpanInfo(), { yArr: u } = f, g = u[0], m = u[1];
|
|
1120
|
+
if (n.rowIndex >= g && n.rowIndex <= m) {
|
|
1121
|
+
const { width: x, height: w, offsetTop: p, offsetLeft: C } = f;
|
|
1122
|
+
h = this.drawX - C + x - s - r, c = this.drawY - p + (w - s) / 2;
|
|
1121
1123
|
}
|
|
1122
1124
|
}
|
|
1123
1125
|
const d = this.ctx.icons.get(this.hoverIconName);
|
|
@@ -1216,10 +1218,10 @@ class Tt extends re {
|
|
|
1216
1218
|
const { SELECT_BORDER_COLOR: e, ENABLE_AUTOFILL: i, ENABLE_SELECTOR: s, AUTOFILL_POINT_BORDER_COLOR: r } = this.ctx.config;
|
|
1217
1219
|
if (!s || !i || this.ctx.editing)
|
|
1218
1220
|
return;
|
|
1219
|
-
const { xArr: o, yArr: n } = this.ctx.selector, h = o[1], c = n[1], { colIndex: d, rowIndex: f, drawX:
|
|
1221
|
+
const { xArr: o, yArr: n } = this.ctx.selector, h = o[1], c = n[1], { colIndex: d, rowIndex: f, drawX: u, drawY: g } = this;
|
|
1220
1222
|
if (d === h && f === c) {
|
|
1221
|
-
const
|
|
1222
|
-
this.ctx.paint.drawRect(
|
|
1223
|
+
const x = d === this.ctx.maxColIndex || f === this.ctx.maxRowIndex || d === this.ctx.lastCenterColIndex ? 6 : 4;
|
|
1224
|
+
this.ctx.paint.drawRect(u + this.width - x, g + this.height - x, 6, 6, {
|
|
1223
1225
|
borderColor: r,
|
|
1224
1226
|
fillColor: e
|
|
1225
1227
|
});
|
|
@@ -1346,46 +1348,46 @@ class Tt extends re {
|
|
|
1346
1348
|
drawBorder(e) {
|
|
1347
1349
|
const { drawX: i, drawY: s, rowIndex: r, colIndex: o, height: n, width: h } = this;
|
|
1348
1350
|
let c = i, d = s;
|
|
1349
|
-
const { xArr: f, yArr:
|
|
1350
|
-
if (o >=
|
|
1351
|
-
const E = o === C ? 1 : 0,
|
|
1352
|
-
this.ctx.paint.drawLine([c +
|
|
1353
|
-
borderColor:
|
|
1351
|
+
const { xArr: f, yArr: u, lineDash: g = [], borderWidth: m = 1, borderColor: x, fillColor: w } = e, p = f[0], C = f[1], y = u[0], b = u[1];
|
|
1352
|
+
if (o >= p && o <= C && r === y) {
|
|
1353
|
+
const E = o === C ? 1 : 0, R = o === p ? 1 : 0;
|
|
1354
|
+
this.ctx.paint.drawLine([c + R, d + 1, c + h - E, d + 1], {
|
|
1355
|
+
borderColor: x,
|
|
1354
1356
|
fillColor: w,
|
|
1355
|
-
borderWidth:
|
|
1357
|
+
borderWidth: m,
|
|
1356
1358
|
lineCap: "round",
|
|
1357
1359
|
lineJoin: "round",
|
|
1358
1360
|
lineDash: g
|
|
1359
1361
|
});
|
|
1360
1362
|
}
|
|
1361
1363
|
if (o === C && r >= y && r <= b) {
|
|
1362
|
-
const E = r === y ? 1 : 0,
|
|
1363
|
-
this.ctx.paint.drawLine([c + h - 1, d + E, c + h - 1, d + n -
|
|
1364
|
-
borderColor:
|
|
1364
|
+
const E = r === y ? 1 : 0, R = r === b ? 1 : 0;
|
|
1365
|
+
this.ctx.paint.drawLine([c + h - 1, d + E, c + h - 1, d + n - R], {
|
|
1366
|
+
borderColor: x,
|
|
1365
1367
|
fillColor: w,
|
|
1366
|
-
borderWidth:
|
|
1368
|
+
borderWidth: m,
|
|
1367
1369
|
lineCap: "round",
|
|
1368
1370
|
lineJoin: "round",
|
|
1369
1371
|
lineDash: g
|
|
1370
1372
|
});
|
|
1371
1373
|
}
|
|
1372
|
-
if (o >=
|
|
1373
|
-
const E = o === C ? 1 : 0,
|
|
1374
|
-
this.ctx.paint.drawLine([c +
|
|
1375
|
-
borderColor:
|
|
1374
|
+
if (o >= p && o <= C && r === b) {
|
|
1375
|
+
const E = o === C ? 1 : 0, R = o === p ? 1 : 0;
|
|
1376
|
+
this.ctx.paint.drawLine([c + R, d + n - 1, c + h - E, d + n - 1], {
|
|
1377
|
+
borderColor: x,
|
|
1376
1378
|
fillColor: w,
|
|
1377
|
-
borderWidth:
|
|
1379
|
+
borderWidth: m,
|
|
1378
1380
|
lineCap: "round",
|
|
1379
1381
|
lineJoin: "round",
|
|
1380
1382
|
lineDash: g
|
|
1381
1383
|
});
|
|
1382
1384
|
}
|
|
1383
|
-
if (o ===
|
|
1384
|
-
const E = r === b ? 1 : 0,
|
|
1385
|
-
this.ctx.paint.drawLine([c + 1, d +
|
|
1386
|
-
borderColor:
|
|
1385
|
+
if (o === p && r >= y && r <= b) {
|
|
1386
|
+
const E = r === b ? 1 : 0, R = r === y ? 1 : 0;
|
|
1387
|
+
this.ctx.paint.drawLine([c + 1, d + R, c + 1, d + n - E], {
|
|
1388
|
+
borderColor: x,
|
|
1387
1389
|
fillColor: w,
|
|
1388
|
-
borderWidth:
|
|
1390
|
+
borderWidth: m,
|
|
1389
1391
|
lineCap: "round",
|
|
1390
1392
|
lineJoin: "round",
|
|
1391
1393
|
lineDash: g
|
|
@@ -1447,30 +1449,30 @@ class li {
|
|
|
1447
1449
|
var w;
|
|
1448
1450
|
let r = i._hasChildren || !1;
|
|
1449
1451
|
Array.isArray(i.children) && i.children.length && (r = !0, this.initData(i.children, e + 1));
|
|
1450
|
-
const { ROW_KEY: o = "", DEFAULT_EXPAND_ALL: n, CELL_HEIGHT: h, SELECTABLE_METHOD: c, CHECKBOX_KEY: d } = this.ctx.config, f = i[o],
|
|
1451
|
-
this.itemRowKeyMap.set(i,
|
|
1452
|
-
const g = i._height || h,
|
|
1453
|
-
let
|
|
1454
|
-
if (typeof c == "function" && (
|
|
1455
|
-
const
|
|
1456
|
-
if (this.checkboxKeyMap.has(
|
|
1457
|
-
const C = this.checkboxKeyMap.get(
|
|
1458
|
-
C.push(
|
|
1452
|
+
const { ROW_KEY: o = "", DEFAULT_EXPAND_ALL: n, CELL_HEIGHT: h, SELECTABLE_METHOD: c, CHECKBOX_KEY: d } = this.ctx.config, f = i[o], u = f != null ? `${f}` : Jt();
|
|
1453
|
+
this.itemRowKeyMap.set(i, u);
|
|
1454
|
+
const g = i._height || h, m = i._readonly;
|
|
1455
|
+
let x = !0;
|
|
1456
|
+
if (typeof c == "function" && (x = c), d) {
|
|
1457
|
+
const p = i[d];
|
|
1458
|
+
if (this.checkboxKeyMap.has(p)) {
|
|
1459
|
+
const C = this.checkboxKeyMap.get(p) || [];
|
|
1460
|
+
C.push(u), this.checkboxKeyMap.set(p, C);
|
|
1459
1461
|
} else
|
|
1460
|
-
this.checkboxKeyMap.set(
|
|
1462
|
+
this.checkboxKeyMap.set(p, [u]);
|
|
1461
1463
|
}
|
|
1462
|
-
this.selectionMap.set(
|
|
1463
|
-
key: d ? i[d] :
|
|
1464
|
+
this.selectionMap.set(u, {
|
|
1465
|
+
key: d ? i[d] : u,
|
|
1464
1466
|
row: i,
|
|
1465
|
-
check: ((w = this.selectionMap.get(
|
|
1466
|
-
}), this.rowKeyMap.set(
|
|
1467
|
-
readonly:
|
|
1467
|
+
check: ((w = this.selectionMap.get(u)) == null ? void 0 : w.check) || !1
|
|
1468
|
+
}), this.rowKeyMap.set(u, {
|
|
1469
|
+
readonly: m,
|
|
1468
1470
|
index: s,
|
|
1469
1471
|
rowIndex: s,
|
|
1470
1472
|
level: e,
|
|
1471
1473
|
height: g,
|
|
1472
1474
|
check: !1,
|
|
1473
|
-
selectable:
|
|
1475
|
+
selectable: x,
|
|
1474
1476
|
expand: n,
|
|
1475
1477
|
expandLazy: !1,
|
|
1476
1478
|
hasChildren: r,
|
|
@@ -1682,19 +1684,19 @@ class li {
|
|
|
1682
1684
|
let i = [];
|
|
1683
1685
|
const s = /* @__PURE__ */ new Set();
|
|
1684
1686
|
let r = [], o = t.map((d) => {
|
|
1685
|
-
const { rowKey: f, key:
|
|
1686
|
-
let g = d.value,
|
|
1687
|
-
const
|
|
1688
|
-
return (
|
|
1687
|
+
const { rowKey: f, key: u } = d;
|
|
1688
|
+
let g = d.value, m = g;
|
|
1689
|
+
const x = this.getRowDataItemForRowKey(f), w = this.getItemValue(f, u), p = this.getVirtualBodyCellByKey(f, u);
|
|
1690
|
+
return (p == null ? void 0 : p.type) === "number" && (["", void 0, null].includes(g) ? m = null : /^-?\d+(\.\d+)?$/.test(`${g}`) ? m = Number(g) : (m = w, r.push({
|
|
1689
1691
|
...d,
|
|
1690
|
-
value:
|
|
1692
|
+
value: m,
|
|
1691
1693
|
oldValue: w,
|
|
1692
|
-
row:
|
|
1694
|
+
row: x
|
|
1693
1695
|
}))), {
|
|
1694
1696
|
...d,
|
|
1695
|
-
value:
|
|
1697
|
+
value: m,
|
|
1696
1698
|
oldValue: w,
|
|
1697
|
-
row:
|
|
1699
|
+
row: x
|
|
1698
1700
|
};
|
|
1699
1701
|
});
|
|
1700
1702
|
if (o = o.filter((d) => !r.some((f) => d.rowKey === f.rowKey && d.key === f.key)), r.length) {
|
|
@@ -1709,11 +1711,11 @@ class li {
|
|
|
1709
1711
|
return;
|
|
1710
1712
|
const { BEFORE_VALUE_CHANGE_METHOD: n } = this.ctx.config;
|
|
1711
1713
|
typeof n == "function" && (o = await n(o)), o.forEach((d) => {
|
|
1712
|
-
const { value: f, rowKey:
|
|
1713
|
-
s.add(
|
|
1714
|
-
rowKey:
|
|
1714
|
+
const { value: f, rowKey: u, key: g, oldValue: m } = d;
|
|
1715
|
+
s.add(u), this.setItemValue(u, g, f), i.push({
|
|
1716
|
+
rowKey: u,
|
|
1715
1717
|
key: g,
|
|
1716
|
-
oldValue:
|
|
1718
|
+
oldValue: m,
|
|
1717
1719
|
newValue: f
|
|
1718
1720
|
});
|
|
1719
1721
|
});
|
|
@@ -1754,7 +1756,7 @@ class li {
|
|
|
1754
1756
|
n[e] !== null && typeof n[e] == "object" && (h = JSON.parse(JSON.stringify(n[e])));
|
|
1755
1757
|
const d = `${t}_${e}`;
|
|
1756
1758
|
this.originalDataMap.has(d) || this.originalDataMap.set(d, h);
|
|
1757
|
-
const f = this.originalDataMap.get(d),
|
|
1759
|
+
const f = this.originalDataMap.get(d), u = this.getRowDataItemForRowKey(t);
|
|
1758
1760
|
if (o) {
|
|
1759
1761
|
const g = this.getVirtualBodyCellByKey(t, e);
|
|
1760
1762
|
if ((g == null ? void 0 : g.type) === "number")
|
|
@@ -1773,7 +1775,7 @@ class li {
|
|
|
1773
1775
|
key: e,
|
|
1774
1776
|
value: c,
|
|
1775
1777
|
oldValue: h,
|
|
1776
|
-
row:
|
|
1778
|
+
row: u
|
|
1777
1779
|
}
|
|
1778
1780
|
]
|
|
1779
1781
|
};
|
|
@@ -1784,36 +1786,36 @@ class li {
|
|
|
1784
1786
|
oldValue: h,
|
|
1785
1787
|
newValue: h
|
|
1786
1788
|
};
|
|
1787
|
-
const { BEFORE_VALUE_CHANGE_METHOD:
|
|
1788
|
-
if (typeof
|
|
1789
|
-
const
|
|
1789
|
+
const { BEFORE_VALUE_CHANGE_METHOD: m } = this.ctx.config;
|
|
1790
|
+
if (typeof m == "function") {
|
|
1791
|
+
const p = await m([
|
|
1790
1792
|
{
|
|
1791
1793
|
rowKey: t,
|
|
1792
1794
|
key: e,
|
|
1793
1795
|
value: c,
|
|
1794
1796
|
oldValue: n[e],
|
|
1795
|
-
row:
|
|
1797
|
+
row: u
|
|
1796
1798
|
}
|
|
1797
1799
|
]);
|
|
1798
|
-
|
|
1800
|
+
p && p.length && (c = p[0].value);
|
|
1799
1801
|
}
|
|
1800
1802
|
this.changedDataMap.set(d, c), n[e] = c;
|
|
1801
|
-
const
|
|
1803
|
+
const x = {
|
|
1802
1804
|
rowKey: t,
|
|
1803
1805
|
key: e,
|
|
1804
1806
|
oldValue: h,
|
|
1805
1807
|
value: c,
|
|
1806
|
-
row:
|
|
1808
|
+
row: u
|
|
1807
1809
|
};
|
|
1808
1810
|
this.getValidator(t, e).then(() => {
|
|
1809
1811
|
this.validationErrorMap.size === 0 && this.changedDataMap.size > 0 && this.ctx.emit("validateChangedData", this.getChangedData());
|
|
1810
|
-
}), this.ctx.emit("change", [
|
|
1812
|
+
}), this.ctx.emit("change", [x], [u]), this.ctx.emit("editChange", {
|
|
1811
1813
|
rowKey: t,
|
|
1812
1814
|
key: e,
|
|
1813
1815
|
oldValue: h,
|
|
1814
1816
|
value: c,
|
|
1815
1817
|
originalValue: f,
|
|
1816
|
-
row:
|
|
1818
|
+
row: u
|
|
1817
1819
|
});
|
|
1818
1820
|
} else
|
|
1819
1821
|
this.changedDataMap.set(d, c), n[e] = c;
|
|
@@ -1823,7 +1825,7 @@ class li {
|
|
|
1823
1825
|
oldValue: h,
|
|
1824
1826
|
value: c,
|
|
1825
1827
|
originalValue: this.originalDataMap.get(d),
|
|
1826
|
-
row:
|
|
1828
|
+
row: u
|
|
1827
1829
|
}), s && this.ctx.history.pushState({
|
|
1828
1830
|
type: "single",
|
|
1829
1831
|
scrollX: this.ctx.scrollX,
|
|
@@ -1952,15 +1954,15 @@ class li {
|
|
|
1952
1954
|
return e;
|
|
1953
1955
|
const i = this.rowKeyMap.size;
|
|
1954
1956
|
let s = 0, r = 0;
|
|
1955
|
-
const o = this.selectionMap.size, n = Array.from(this.selectionMap.values()).some((
|
|
1956
|
-
this.rowKeyMap.forEach((
|
|
1957
|
-
var
|
|
1958
|
-
(
|
|
1959
|
-
let
|
|
1960
|
-
typeof
|
|
1961
|
-
row:
|
|
1962
|
-
rowIndex:
|
|
1963
|
-
})),
|
|
1957
|
+
const o = this.selectionMap.size, n = Array.from(this.selectionMap.values()).some((u) => u.check);
|
|
1958
|
+
this.rowKeyMap.forEach((u, g) => {
|
|
1959
|
+
var x;
|
|
1960
|
+
(x = this.selectionMap.get(g)) != null && x.check && (s += 1);
|
|
1961
|
+
let m = u.selectable;
|
|
1962
|
+
typeof m == "function" && (m = m({
|
|
1963
|
+
row: u.item,
|
|
1964
|
+
rowIndex: u.rowIndex
|
|
1965
|
+
})), m && (r += 1);
|
|
1964
1966
|
});
|
|
1965
1967
|
const h = o > i && s === 0 && n, c = r && r > s && s > 0 || h, d = r !== 0, f = !!r && r === s;
|
|
1966
1968
|
return this.bufferCheckState = {
|
|
@@ -2101,14 +2103,14 @@ class li {
|
|
|
2101
2103
|
if (h) {
|
|
2102
2104
|
let c = {}, d = {};
|
|
2103
2105
|
if (d[e] = this.getItemValue(t, e), Array.isArray(h)) {
|
|
2104
|
-
const
|
|
2106
|
+
const u = h.map((g) => ({
|
|
2105
2107
|
...g,
|
|
2106
2108
|
row: s.item,
|
|
2107
2109
|
column: n,
|
|
2108
2110
|
rowIndex: s.rowIndex,
|
|
2109
2111
|
colIndex: r.colIndex
|
|
2110
2112
|
}));
|
|
2111
|
-
c[e] =
|
|
2113
|
+
c[e] = u;
|
|
2112
2114
|
} else
|
|
2113
2115
|
c[e] = {
|
|
2114
2116
|
...h,
|
|
@@ -2119,9 +2121,9 @@ class li {
|
|
|
2119
2121
|
};
|
|
2120
2122
|
new nt(c).validate(d).then(() => {
|
|
2121
2123
|
this.clearValidationError(t, e), i([]);
|
|
2122
|
-
}).catch(({ errors:
|
|
2123
|
-
const g =
|
|
2124
|
-
...
|
|
2124
|
+
}).catch(({ errors: u }) => {
|
|
2125
|
+
const g = u.map((m) => ({
|
|
2126
|
+
...m,
|
|
2125
2127
|
column: n,
|
|
2126
2128
|
key: e,
|
|
2127
2129
|
row: s.item,
|
|
@@ -2153,10 +2155,10 @@ class li {
|
|
|
2153
2155
|
relationColKeys: c,
|
|
2154
2156
|
rowspan: d,
|
|
2155
2157
|
height: f,
|
|
2156
|
-
width:
|
|
2158
|
+
width: u,
|
|
2157
2159
|
colspan: g,
|
|
2158
|
-
mergeRow:
|
|
2159
|
-
mergeCol:
|
|
2160
|
+
mergeRow: m,
|
|
2161
|
+
mergeCol: x
|
|
2160
2162
|
} = t;
|
|
2161
2163
|
if (d === 1 && g === 1)
|
|
2162
2164
|
return {
|
|
@@ -2165,7 +2167,7 @@ class li {
|
|
|
2165
2167
|
rowspan: d,
|
|
2166
2168
|
colspan: g,
|
|
2167
2169
|
height: f,
|
|
2168
|
-
width:
|
|
2170
|
+
width: u,
|
|
2169
2171
|
offsetTop: 0,
|
|
2170
2172
|
offsetLeft: 0,
|
|
2171
2173
|
dataList: [
|
|
@@ -2177,98 +2179,98 @@ class li {
|
|
|
2177
2179
|
}
|
|
2178
2180
|
]
|
|
2179
2181
|
};
|
|
2180
|
-
let w = e,
|
|
2181
|
-
if (d !== 1 &&
|
|
2182
|
-
|
|
2183
|
-
const
|
|
2184
|
-
const
|
|
2185
|
-
return `${
|
|
2182
|
+
let w = e, p = e, C = n, y = n, b = [], E = 0, R = 0, O = 0, I = 0;
|
|
2183
|
+
if (d !== 1 && m) {
|
|
2184
|
+
I = u;
|
|
2185
|
+
const _ = h.reduce((v, S) => {
|
|
2186
|
+
const T = this.getItemValue(s, S) ?? "";
|
|
2187
|
+
return `${v}${T}`;
|
|
2186
2188
|
}, "");
|
|
2187
|
-
for (let
|
|
2188
|
-
const
|
|
2189
|
-
const B = this.getItemValue(
|
|
2189
|
+
for (let v = e - 1; v >= 0; v--) {
|
|
2190
|
+
const S = this.rowIndexRowKeyMap.get(v) || "", T = h.reduce((M, A) => {
|
|
2191
|
+
const B = this.getItemValue(S, A) ?? "";
|
|
2190
2192
|
return `${M}${B}`;
|
|
2191
2193
|
}, "");
|
|
2192
|
-
if (
|
|
2193
|
-
w =
|
|
2194
|
+
if (_ === T)
|
|
2195
|
+
w = v;
|
|
2194
2196
|
else
|
|
2195
2197
|
break;
|
|
2196
2198
|
}
|
|
2197
|
-
for (let
|
|
2198
|
-
const
|
|
2199
|
-
const B = this.getItemValue(
|
|
2199
|
+
for (let v = e; v <= this.ctx.maxRowIndex; v++) {
|
|
2200
|
+
const S = this.rowIndexRowKeyMap.get(v) || "", T = h.reduce((M, A) => {
|
|
2201
|
+
const B = this.getItemValue(S, A) ?? "";
|
|
2200
2202
|
return `${M}${B}`;
|
|
2201
2203
|
}, "");
|
|
2202
|
-
if (
|
|
2203
|
-
|
|
2204
|
+
if (_ === T)
|
|
2205
|
+
p = v;
|
|
2204
2206
|
else
|
|
2205
2207
|
break;
|
|
2206
2208
|
}
|
|
2207
|
-
for (let
|
|
2208
|
-
const { height:
|
|
2209
|
-
E +=
|
|
2209
|
+
for (let v = w; v < e; v++) {
|
|
2210
|
+
const { height: S } = this.positions[v];
|
|
2211
|
+
E += S;
|
|
2210
2212
|
}
|
|
2211
|
-
for (let
|
|
2212
|
-
const { height:
|
|
2213
|
-
|
|
2214
|
-
const
|
|
2213
|
+
for (let v = w; v <= p; v++) {
|
|
2214
|
+
const { height: S } = this.positions[v];
|
|
2215
|
+
O += S;
|
|
2216
|
+
const T = this.rowIndexRowKeyMap.get(v) || "", { item: M } = this.rowKeyMap.get(T), A = this.getItemValue(T, i);
|
|
2215
2217
|
b.push({
|
|
2216
|
-
rowKey:
|
|
2218
|
+
rowKey: T,
|
|
2217
2219
|
key: i,
|
|
2218
|
-
value:
|
|
2220
|
+
value: A,
|
|
2219
2221
|
row: M
|
|
2220
2222
|
});
|
|
2221
2223
|
}
|
|
2222
2224
|
}
|
|
2223
|
-
if (g !== 1 &&
|
|
2224
|
-
|
|
2225
|
-
for (let
|
|
2226
|
-
const
|
|
2227
|
-
if (!
|
|
2225
|
+
if (g !== 1 && x) {
|
|
2226
|
+
O = f;
|
|
2227
|
+
for (let _ = n - 1; _ >= 0; _--) {
|
|
2228
|
+
const v = this.getColumnByColIndex(_);
|
|
2229
|
+
if (!v)
|
|
2228
2230
|
break;
|
|
2229
|
-
const
|
|
2230
|
-
if (
|
|
2231
|
-
C =
|
|
2231
|
+
const S = this.getItemValue(s, i), T = this.getItemValue(s, v.key);
|
|
2232
|
+
if (S === T && c.includes(v.key))
|
|
2233
|
+
C = _;
|
|
2232
2234
|
else
|
|
2233
2235
|
break;
|
|
2234
2236
|
}
|
|
2235
|
-
for (let
|
|
2236
|
-
const
|
|
2237
|
-
if (!
|
|
2237
|
+
for (let _ = n; _ <= this.ctx.maxColIndex; _++) {
|
|
2238
|
+
const v = this.getColumnByColIndex(_);
|
|
2239
|
+
if (!v)
|
|
2238
2240
|
break;
|
|
2239
|
-
const
|
|
2240
|
-
if (
|
|
2241
|
-
y =
|
|
2241
|
+
const S = this.getItemValue(s, i), T = this.getItemValue(s, v.key);
|
|
2242
|
+
if (S === T && c.includes(v.key))
|
|
2243
|
+
y = _;
|
|
2242
2244
|
else
|
|
2243
2245
|
break;
|
|
2244
2246
|
}
|
|
2245
|
-
for (let
|
|
2246
|
-
const
|
|
2247
|
-
if (!
|
|
2247
|
+
for (let _ = C; _ < n; _++) {
|
|
2248
|
+
const v = this.getColumnByColIndex(_);
|
|
2249
|
+
if (!v)
|
|
2248
2250
|
break;
|
|
2249
|
-
|
|
2251
|
+
R += v.width || 100;
|
|
2250
2252
|
}
|
|
2251
|
-
for (let
|
|
2252
|
-
const
|
|
2253
|
-
if (!
|
|
2253
|
+
for (let _ = C; _ <= y; _++) {
|
|
2254
|
+
const v = this.getColumnByColIndex(_);
|
|
2255
|
+
if (!v)
|
|
2254
2256
|
break;
|
|
2255
|
-
|
|
2257
|
+
I += v.width || 100, b.push({
|
|
2256
2258
|
rowKey: s,
|
|
2257
|
-
key:
|
|
2258
|
-
value: this.getItemValue(s,
|
|
2259
|
+
key: v.key,
|
|
2260
|
+
value: this.getItemValue(s, v.key),
|
|
2259
2261
|
row: r
|
|
2260
2262
|
});
|
|
2261
2263
|
}
|
|
2262
2264
|
}
|
|
2263
2265
|
return {
|
|
2264
2266
|
xArr: [C, y],
|
|
2265
|
-
yArr: [w,
|
|
2267
|
+
yArr: [w, p],
|
|
2266
2268
|
rowspan: d,
|
|
2267
2269
|
colspan: g,
|
|
2268
|
-
height:
|
|
2269
|
-
width:
|
|
2270
|
+
height: O,
|
|
2271
|
+
width: I,
|
|
2270
2272
|
offsetTop: E,
|
|
2271
|
-
offsetLeft:
|
|
2273
|
+
offsetLeft: R,
|
|
2272
2274
|
dataList: b
|
|
2273
2275
|
};
|
|
2274
2276
|
}
|
|
@@ -2301,7 +2303,7 @@ class li {
|
|
|
2301
2303
|
// 获取虚拟单元格
|
|
2302
2304
|
getVirtualBodyCell(t, e) {
|
|
2303
2305
|
const i = this.getColumnByColIndex(e), s = this.getRowForRowIndex(t);
|
|
2304
|
-
return !i || !s ? void 0 : new
|
|
2306
|
+
return !i || !s ? void 0 : new At(this.ctx, t, e, 0, 0, 0, 0, i, s.item, "body");
|
|
2305
2307
|
}
|
|
2306
2308
|
getVirtualBodyCellByKey(t, e) {
|
|
2307
2309
|
const i = this.getRowIndexForRowKey(t), s = this.getColIndexForKey(e);
|
|
@@ -2489,7 +2491,7 @@ class fi {
|
|
|
2489
2491
|
this.ctx = e;
|
|
2490
2492
|
}
|
|
2491
2493
|
scale(t) {
|
|
2492
|
-
this.ctx.scale(t, t);
|
|
2494
|
+
this.ctx.setTransform(1, 0, 0, 1, 0, 0), this.ctx.scale(t, t);
|
|
2493
2495
|
}
|
|
2494
2496
|
save() {
|
|
2495
2497
|
this.ctx.save();
|
|
@@ -2556,8 +2558,8 @@ class fi {
|
|
|
2556
2558
|
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), h === 0)
|
|
2557
2559
|
this.ctx.rect(t - 0.5, e - 0.5, i, s);
|
|
2558
2560
|
else {
|
|
2559
|
-
const [c, d, f,
|
|
2560
|
-
this.ctx.moveTo(t + c, e), this.ctx.arcTo(t + i, e, t + i, e + d, d), this.ctx.arcTo(t + i, e + s, t + i - f, e + s, f), this.ctx.arcTo(t, e + s, t, e + s -
|
|
2561
|
+
const [c, d, f, u] = typeof h == "number" ? [h, h, h, h] : h;
|
|
2562
|
+
this.ctx.moveTo(t + c, e), this.ctx.arcTo(t + i, e, t + i, e + d, d), this.ctx.arcTo(t + i, e + s, t + i - f, e + s, f), this.ctx.arcTo(t, e + s, t, e + s - u, u), this.ctx.arcTo(t, e, t + c, e, c);
|
|
2561
2563
|
}
|
|
2562
2564
|
n !== void 0 && this.ctx.fill(), o !== void 0 && this.ctx.stroke(), this.ctx.restore();
|
|
2563
2565
|
}
|
|
@@ -2581,12 +2583,12 @@ class fi {
|
|
|
2581
2583
|
verticalAlign: f = "middle"
|
|
2582
2584
|
} = o;
|
|
2583
2585
|
this.ctx.font = n, this.ctx.fillStyle = c, this.ctx.textBaseline = f, this.ctx.textAlign = h;
|
|
2584
|
-
let
|
|
2585
|
-
f === "top" ?
|
|
2586
|
+
let u = 0;
|
|
2587
|
+
f === "top" ? u = i + d : f === "bottom" ? u = i + r - d : u = i + (r + 1) / 2;
|
|
2586
2588
|
let g = 0;
|
|
2587
2589
|
h === "left" ? g = e + d : h === "right" ? g = e + s - d : g = e + s / 2;
|
|
2588
|
-
const { _text:
|
|
2589
|
-
return this.ctx.fillText(
|
|
2590
|
+
const { _text: m, ellipsis: x } = this.handleEllipsis(t, s, d, n);
|
|
2591
|
+
return this.ctx.fillText(m, g, u), this.ctx.restore(), x;
|
|
2590
2592
|
}
|
|
2591
2593
|
handleEllipsis(t, e, i = 0, s = "12px Arial") {
|
|
2592
2594
|
let r = !1, o = t;
|
|
@@ -2646,6 +2648,8 @@ class Wt {
|
|
|
2646
2648
|
l(this, "HEADER_BG_COLOR", "#F8FAFF");
|
|
2647
2649
|
l(this, "BODY_BG_COLOR", "#FFF");
|
|
2648
2650
|
l(this, "HEADER_TEXT_COLOR", "#1D2129");
|
|
2651
|
+
l(this, "BODY_TEXT_COLOR", "#4E5969");
|
|
2652
|
+
l(this, "FOOTER_TEXT_COLOR", "#4E5969");
|
|
2649
2653
|
l(this, "LOADING_ICON_SVG", "");
|
|
2650
2654
|
l(this, "LOADING_ICON_COLOR", "#4E5969");
|
|
2651
2655
|
l(this, "EXPAND_ICON_SVG", "");
|
|
@@ -2765,16 +2769,17 @@ class Wt {
|
|
|
2765
2769
|
}
|
|
2766
2770
|
// 同步css 样式变量
|
|
2767
2771
|
updateCssVar() {
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
+
let t = {};
|
|
2773
|
+
Object.keys(this).forEach((e) => {
|
|
2774
|
+
if (e.endsWith("_COLOR") || e.endsWith("_FONT")) {
|
|
2775
|
+
const i = `--evt-${e.toLocaleLowerCase().replace(/_/g, "-")}`, s = ai(i);
|
|
2776
|
+
t[e] = s;
|
|
2772
2777
|
}
|
|
2773
|
-
}), Object.assign(this, this._config);
|
|
2778
|
+
}), Object.assign(this, t, this._config);
|
|
2774
2779
|
}
|
|
2775
2780
|
}
|
|
2776
2781
|
const Pt = '<svg t="1724122044148" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4551" width="32" height="32"><path d="M707.648 401.28L489.28 560.704l22.656 30.976 22.656-30.976L316.16 401.216q-3.072-2.24-6.464-3.84-3.456-1.536-7.104-2.432-3.712-0.896-7.488-1.088-3.776-0.128-7.488 0.448-3.776 0.64-7.296 1.92-3.584 1.28-6.784 3.2-3.2 1.984-6.016 4.544-2.816 2.56-5.056 5.632-2.176 3.072-3.84 6.464-1.536 3.456-2.432 7.104-0.896 3.712-1.088 7.488-0.128 3.776 0.448 7.488 0.64 3.776 1.92 7.296 1.28 3.584 3.2 6.784 1.984 3.2 4.544 6.016 2.56 2.752 5.632 4.992l218.368 159.552q4.928 3.584 10.752 5.504 5.76 1.92 11.904 1.92 6.08 0 11.904-1.92 5.76-1.92 10.752-5.504l218.368-159.552q3.008-2.24 5.568-4.992 2.56-2.816 4.544-6.016 1.92-3.2 3.264-6.784 1.28-3.52 1.92-7.296 0.576-3.712 0.384-7.488-0.128-3.84-1.024-7.488-0.896-3.648-2.496-7.04-1.6-3.456-3.84-6.528-2.24-3.072-4.992-5.632-2.816-2.56-6.016-4.48-3.2-1.984-6.784-3.328-3.584-1.28-7.296-1.856-3.712-0.64-7.488-0.448-3.84 0.192-7.488 1.088-3.648 0.896-7.04 2.496-3.456 1.536-6.528 3.84z m61.056 30.976q0-3.84-0.768-7.488-0.704-3.712-2.176-7.232-1.472-3.456-3.52-6.656-2.112-3.136-4.8-5.76-2.688-2.688-5.76-4.8-3.2-2.112-6.72-3.584-3.456-1.408-7.168-2.176-3.712-0.704-7.488-0.704-3.84 0-7.488 0.704-3.712 0.768-7.232 2.176-3.456 1.472-6.656 3.584-3.136 2.112-5.76 4.8-2.688 2.624-4.8 5.76-2.112 3.2-3.584 6.656-1.408 3.52-2.176 7.232-0.704 3.712-0.704 7.488 0 3.776 0.704 7.488 0.768 3.712 2.176 7.168 1.472 3.52 3.584 6.656 2.112 3.2 4.8 5.824 2.624 2.688 5.76 4.8 3.2 2.112 6.656 3.52 3.52 1.472 7.232 2.176 3.712 0.768 7.488 0.768 3.776 0 7.488-0.768 3.712-0.704 7.168-2.176 3.52-1.408 6.656-3.52 3.2-2.112 5.824-4.8 2.688-2.688 4.8-5.76 2.048-3.2 3.52-6.72 1.472-3.456 2.176-7.168 0.768-3.712 0.768-7.488z m-436.736 0q0-3.84-0.768-7.488-0.704-3.712-2.176-7.232-1.408-3.456-3.52-6.656-2.112-3.136-4.8-5.76-2.688-2.688-5.76-4.8-3.2-2.112-6.656-3.584-3.52-1.408-7.232-2.176-3.712-0.704-7.488-0.704-3.84 0-7.488 0.704-3.712 0.768-7.232 2.176-3.456 1.472-6.592 3.584-3.2 2.112-5.824 4.8-2.688 2.624-4.8 5.76-2.112 3.2-3.52 6.656-1.472 3.52-2.24 7.232-0.704 3.712-0.704 7.488 0 3.776 0.704 7.488 0.768 3.712 2.24 7.168 1.408 3.52 3.52 6.656 2.112 3.2 4.8 5.824 2.624 2.688 5.76 4.8 3.2 2.112 6.656 3.52 3.52 1.472 7.232 2.176 3.712 0.768 7.488 0.768 3.776 0 7.488-0.768 3.712-0.704 7.232-2.176 3.456-1.408 6.592-3.52 3.2-2.112 5.824-4.8 2.688-2.688 4.8-5.76 2.112-3.2 3.52-6.72 1.472-3.456 2.176-7.168 0.768-3.712 0.768-7.488z" p-id="4552"></path></svg>';
|
|
2777
|
-
class
|
|
2782
|
+
class ui {
|
|
2778
2783
|
constructor(t) {
|
|
2779
2784
|
l(this, "ctx");
|
|
2780
2785
|
l(this, "list", [
|
|
@@ -3005,8 +3010,8 @@ class oe extends re {
|
|
|
3005
3010
|
const { width: e, height: i, type: s } = this;
|
|
3006
3011
|
if (["index-selection", "selection"].includes(s)) {
|
|
3007
3012
|
const { indeterminate: r, check: o, selectable: n } = this.ctx.database.getCheckedState(), { CHECKBOX_SIZE: h = 0 } = this.ctx.config, c = this.drawX + (e - h) / 2, d = this.drawY + (i - h) / 2;
|
|
3008
|
-
let f = this.ctx.icons.get("checkbox-uncheck"),
|
|
3009
|
-
r ? (f = this.ctx.icons.get("checkbox-indeterminate"),
|
|
3013
|
+
let f = this.ctx.icons.get("checkbox-uncheck"), u = "checkbox-uncheck";
|
|
3014
|
+
r ? (f = this.ctx.icons.get("checkbox-indeterminate"), u = "checkbox-indeterminate") : o && n ? (f = this.ctx.icons.get("checkbox-check"), u = "checkbox-check") : o && n ? (f = this.ctx.icons.get("checkbox-check-disabled"), u = "checkbox-check-disabled") : !o && n ? (f = this.ctx.icons.get("checkbox-uncheck"), u = "checkbox-uncheck") : (f = this.ctx.icons.get("checkbox-disabled"), u = "checkbox-disabled"), f && (this.drawImageX = c, this.drawImageY = d, this.drawImageWidth = h, this.drawImageHeight = h, this.drawImageName = u, this.drawImageSource = f, this.ctx.paint.drawImage(
|
|
3010
3015
|
this.drawImageSource,
|
|
3011
3016
|
this.drawImageX,
|
|
3012
3017
|
this.drawImageY,
|
|
@@ -3035,7 +3040,7 @@ class oe extends re {
|
|
|
3035
3040
|
};
|
|
3036
3041
|
}
|
|
3037
3042
|
}
|
|
3038
|
-
class
|
|
3043
|
+
class xi {
|
|
3039
3044
|
constructor(t) {
|
|
3040
3045
|
l(this, "ctx");
|
|
3041
3046
|
l(this, "visibleHoverCell");
|
|
@@ -3165,7 +3170,7 @@ class ui {
|
|
|
3165
3170
|
}
|
|
3166
3171
|
selectionEnterAndLeave(t, e) {
|
|
3167
3172
|
const { offsetY: i, offsetX: s } = this.ctx.getOffset(e), r = i, o = s;
|
|
3168
|
-
o > t.drawImageX && o < t.drawImageX + t.drawImageWidth && r > t.drawImageY && r < t.drawImageY + t.drawImageHeight && t instanceof
|
|
3173
|
+
o > t.drawImageX && o < t.drawImageX + t.drawImageWidth && r > t.drawImageY && r < t.drawImageY + t.drawImageHeight && t instanceof At && ["selection", "index-selection"].includes(t.type) && (this.ctx.stageElement.style.cursor = "pointer", this.ctx.isPointer = !0, this.ctx.database.getRowSelectable(t.rowKey) || (this.ctx.stageElement.style.cursor = "not-allowed"));
|
|
3169
3174
|
}
|
|
3170
3175
|
isBusy(t) {
|
|
3171
3176
|
const { offsetY: e, offsetX: i } = this.ctx.getOffset(t), s = e, r = i;
|
|
@@ -3322,7 +3327,7 @@ class gi {
|
|
|
3322
3327
|
emptyElement: h,
|
|
3323
3328
|
contextMenuElement: c
|
|
3324
3329
|
} = t;
|
|
3325
|
-
this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = r, this.overlayerElement = o, this.editorElement = n, this.emptyElement = h, this.contextMenuElement = c, this.config = new Wt(e.config || {}), this.eventBus = new di(), this.eventBrowser = new ci(this), this.eventTable = new
|
|
3330
|
+
this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = r, this.overlayerElement = o, this.editorElement = n, this.emptyElement = h, this.contextMenuElement = c, this.config = new Wt(e.config || {}), this.eventBus = new di(), this.eventBrowser = new ci(this), this.eventTable = new xi(this), this.paint = new fi(this.canvasElement), this.database = new li(this, e), this.history = new hi(this), this.icons = new ui(this);
|
|
3326
3331
|
}
|
|
3327
3332
|
setConfig(t) {
|
|
3328
3333
|
this.config = new Wt(t);
|
|
@@ -3528,12 +3533,12 @@ class zt {
|
|
|
3528
3533
|
stageHeight: i,
|
|
3529
3534
|
stageWidth: s,
|
|
3530
3535
|
config: { SCROLLER_TRACK_SIZE: r = 0, SCROLLER_SIZE: o = 0, BORDER: n }
|
|
3531
|
-
} = this.ctx, h = s, c = i, d = e.height, f = e.width,
|
|
3536
|
+
} = this.ctx, h = s, c = i, d = e.height, f = e.width, u = t.height, g = this.ctx.footer.height;
|
|
3532
3537
|
if (this.type === "vertical") {
|
|
3533
|
-
this.visibleDistance = c - r - d, this.distance =
|
|
3534
|
-
const
|
|
3535
|
-
let
|
|
3536
|
-
|
|
3538
|
+
this.visibleDistance = c - r - d, this.distance = u - this.visibleDistance + g, this.trackX = h - r, this.trackY = 0, this.splitPoints = [this.trackX, d, this.trackX + r, d], this.trackWidth = r, this.trackHeight = c, this.barX = this.trackX - 1 + (r - o) / 2, this.barWidth = o;
|
|
3539
|
+
const m = this.distance ? this.visibleDistance / (u + g) : 0;
|
|
3540
|
+
let x = Math.floor(m * this.visibleDistance);
|
|
3541
|
+
x < 30 ? x = 30 : x > this.visibleDistance && (x = 0), this.barHeight = x, this.barY = d + this.scroll / this.distance * (this.visibleDistance - this.barHeight), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
|
|
3537
3542
|
} else {
|
|
3538
3543
|
this.visibleDistance = h - r, this.distance = f - this.visibleDistance, this.splitPoints = [
|
|
3539
3544
|
h - r,
|
|
@@ -3541,10 +3546,10 @@ class zt {
|
|
|
3541
3546
|
h - r,
|
|
3542
3547
|
c
|
|
3543
3548
|
];
|
|
3544
|
-
const
|
|
3545
|
-
this.trackX = 0, this.trackY = c - r +
|
|
3546
|
-
const
|
|
3547
|
-
let w = Math.floor(
|
|
3549
|
+
const m = n ? 0 : 0.5;
|
|
3550
|
+
this.trackX = 0, this.trackY = c - r + m, this.trackWidth = h, this.trackHeight = r;
|
|
3551
|
+
const x = this.distance ? this.visibleDistance / f : 0;
|
|
3552
|
+
let w = Math.floor(x * this.visibleDistance);
|
|
3548
3553
|
this.barY = this.trackY - 1 + (r - o) / 2, w < 30 ? w = 30 : w >= this.visibleDistance && (w = 0), this.barWidth = w, this.barHeight = o, this.barX = this.scroll / this.distance * (this.visibleDistance - this.barWidth), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
|
|
3549
3554
|
}
|
|
3550
3555
|
}
|
|
@@ -3682,8 +3687,8 @@ class pi {
|
|
|
3682
3687
|
config: { HEADER_HEIGHT: t, SCROLLER_TRACK_SIZE: e }
|
|
3683
3688
|
} = this.ctx, i = this.ctx.database.getColumns();
|
|
3684
3689
|
this.columns = i, this.allCellHeaders = [], this.leafCellHeaders = [], this.fixedLeftCellHeaders = [], this.fixedRightCellHeaders = [], this.centerCellHeaders = [];
|
|
3685
|
-
const s = te(i), r =
|
|
3686
|
-
this.height = t * s, this.width = r.reduce((f,
|
|
3690
|
+
const s = te(i), r = _t(i);
|
|
3691
|
+
this.height = t * s, this.width = r.reduce((f, u) => f + ((u == null ? void 0 : u.width) || 100), 0), this.visibleHeight = this.height;
|
|
3687
3692
|
const o = ei(ee(i, s));
|
|
3688
3693
|
this.columnIndex = 0, this.resizeNum = 0, this.render(o, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
|
|
3689
3694
|
const n = this.ctx.containerElement.getBoundingClientRect();
|
|
@@ -3694,9 +3699,9 @@ class pi {
|
|
|
3694
3699
|
this.resizeAllColumn(f);
|
|
3695
3700
|
}
|
|
3696
3701
|
const c = this.fixedLeftCellHeaders.filter((f) => !f.hasChildren);
|
|
3697
|
-
this.ctx.fixedLeftWidth = c.reduce((f,
|
|
3702
|
+
this.ctx.fixedLeftWidth = c.reduce((f, u) => f + u.width, 0);
|
|
3698
3703
|
const d = this.fixedRightCellHeaders.filter((f) => !f.hasChildren);
|
|
3699
|
-
this.ctx.fixedRightWidth = d.reduce((f,
|
|
3704
|
+
this.ctx.fixedRightWidth = d.reduce((f, u) => f + u.width, e), this.ctx.maxColIndex = this.leafCellHeaders.length - 1, this.ctx.header.x = this.x, this.ctx.header.y = this.y, this.ctx.header.width = this.width, this.ctx.header.height = this.height, this.ctx.header.visibleWidth = this.visibleWidth, this.ctx.header.visibleHeight = this.visibleHeight;
|
|
3700
3705
|
}
|
|
3701
3706
|
// 调整表头的宽度
|
|
3702
3707
|
initResizeColumn() {
|
|
@@ -3785,7 +3790,7 @@ class pi {
|
|
|
3785
3790
|
for (let o = 0; o < i; o++) {
|
|
3786
3791
|
const n = t[o], h = r * (n.rowspan || 0), c = r * (n.level || 0);
|
|
3787
3792
|
let d = n.width || 100;
|
|
3788
|
-
n.children && (d =
|
|
3793
|
+
n.children && (d = _t(n.children).reduce((g, m) => g + ((m == null ? void 0 : m.width) || 100), 0));
|
|
3789
3794
|
const f = new oe(this.ctx, this.columnIndex, s, c, d, h, n);
|
|
3790
3795
|
this.ctx.database.setHeader(n.key, f), this.allCellHeaders.push(f), n.children || (this.leafCellHeaders.push(f), f.column.widthFillDisable || this.resizeNum++), n.fixed === "left" ? this.fixedLeftCellHeaders.push(f) : n.fixed === "right" ? this.fixedRightCellHeaders.push(f) : this.centerCellHeaders.push(f), !n.children && this.columnIndex++, n.children && this.render(n.children, s), s += d;
|
|
3791
3796
|
}
|
|
@@ -3879,7 +3884,7 @@ class ne {
|
|
|
3879
3884
|
update() {
|
|
3880
3885
|
const { header: t } = this.ctx, e = [], i = [], s = [];
|
|
3881
3886
|
t.renderLeafCellHeaders.forEach((r) => {
|
|
3882
|
-
const o = new
|
|
3887
|
+
const o = new At(
|
|
3883
3888
|
this.ctx,
|
|
3884
3889
|
this.rowIndex,
|
|
3885
3890
|
r.colIndex,
|
|
@@ -3956,41 +3961,43 @@ class mi {
|
|
|
3956
3961
|
MAX_HEIGHT: c = 0,
|
|
3957
3962
|
ENABLE_OFFSET_HEIGHT: d = 0,
|
|
3958
3963
|
OFFSET_HEIGHT: f = 0,
|
|
3959
|
-
FOOTER_POSITION:
|
|
3964
|
+
FOOTER_POSITION: u
|
|
3960
3965
|
}
|
|
3961
3966
|
} = this.ctx;
|
|
3962
3967
|
if (!e.width)
|
|
3963
3968
|
return;
|
|
3964
|
-
this.x = 0,
|
|
3965
|
-
const { data: g, sumHeight:
|
|
3966
|
-
this.height =
|
|
3967
|
-
const
|
|
3968
|
-
!this.data.length && !n ? this.height = h : !this.data.length && n && (this.height = n - e.height -
|
|
3969
|
+
this.x = 0, u === "top" && r ? this.y = e.height + i.height : this.y = e.height;
|
|
3970
|
+
const { data: g, sumHeight: m } = s.getData();
|
|
3971
|
+
this.height = m, this.data = g, this.width = e.width, this.visibleWidth = this.ctx.stageWidth - o;
|
|
3972
|
+
const x = this.ctx.footer.height;
|
|
3973
|
+
!this.data.length && !n ? this.height = h : !this.data.length && n && (this.height = n - e.height - x - o);
|
|
3969
3974
|
let w = this.height + e.height + o;
|
|
3970
|
-
w +=
|
|
3971
|
-
let
|
|
3975
|
+
w += x;
|
|
3976
|
+
let p = w;
|
|
3972
3977
|
const C = window.innerHeight, { top: y } = this.containerRect || this.ctx.containerElement.getBoundingClientRect();
|
|
3973
3978
|
if (C > y && d && !n) {
|
|
3974
|
-
const
|
|
3975
|
-
|
|
3976
|
-
} else this.data.length && n ?
|
|
3977
|
-
|
|
3979
|
+
const T = C - y - f;
|
|
3980
|
+
T > e.height + o ? p = T : w > c && (p = c);
|
|
3981
|
+
} else this.data.length && n ? p = n : this.data.length && c && w > c && (p = c);
|
|
3982
|
+
p > 0 && (this.ctx.stageHeight = Math.floor(p), this.ctx.stageElement.style.height = `${this.ctx.stageHeight - 0.5}px`);
|
|
3978
3983
|
let b = this.ctx.stageHeight - e.height - o;
|
|
3979
|
-
r ? this.visibleHeight = b -
|
|
3980
|
-
const E = window.devicePixelRatio || 1,
|
|
3981
|
-
t.width = Math.
|
|
3982
|
-
const
|
|
3984
|
+
r ? this.visibleHeight = b - x : this.visibleHeight = b, this.data.length || (this.height = this.visibleHeight), this.ctx.body.x = this.x, this.ctx.body.y = this.y, this.ctx.body.width = this.width, this.ctx.body.height = this.height, this.ctx.body.visibleWidth = this.visibleWidth, this.ctx.body.visibleHeight = this.visibleHeight, this.ctx.body.data = g;
|
|
3985
|
+
const E = window.devicePixelRatio || 1, R = this.ctx.stageWidth * E, O = this.ctx.stageHeight * E;
|
|
3986
|
+
t.width = Math.round(R), t.height = Math.round(O);
|
|
3987
|
+
const I = this.data.length ? "not-empty" : "empty";
|
|
3983
3988
|
this.ctx.emit("emptyChange", {
|
|
3984
|
-
isEmpty:
|
|
3985
|
-
type:
|
|
3989
|
+
isEmpty: I,
|
|
3990
|
+
type: I,
|
|
3986
3991
|
headerHeight: e.height,
|
|
3987
3992
|
bodyHeight: this.height,
|
|
3988
|
-
footerHeight:
|
|
3993
|
+
footerHeight: x,
|
|
3989
3994
|
width: this.width,
|
|
3990
|
-
height: this.data.length ? 0 : h +
|
|
3991
|
-
})
|
|
3995
|
+
height: this.data.length ? 0 : h + x
|
|
3996
|
+
});
|
|
3997
|
+
const _ = Math.round(t.width / E * 1e4) / 1e4, v = Math.round(t.height / E * 1e4) / 1e4;
|
|
3998
|
+
this.ctx.canvasElement.setAttribute(
|
|
3992
3999
|
"style",
|
|
3993
|
-
`
|
|
4000
|
+
`height:${v}px;width:${_}px;`
|
|
3994
4001
|
), this.ctx.paint.scale(E);
|
|
3995
4002
|
}
|
|
3996
4003
|
// 调整行的高度
|
|
@@ -4017,8 +4024,8 @@ class mi {
|
|
|
4017
4024
|
} = this.ctx;
|
|
4018
4025
|
if (this.isResizing && this.resizeTarget) {
|
|
4019
4026
|
const f = this.resizeTarget.height;
|
|
4020
|
-
let
|
|
4021
|
-
|
|
4027
|
+
let u = n - this.clientY;
|
|
4028
|
+
u + f < d && (u = -(f - d)), this.resizeDiff = u, this.ctx.emit("draw");
|
|
4022
4029
|
} else {
|
|
4023
4030
|
if (this.resizeTarget = null, this.isMouseDown)
|
|
4024
4031
|
return;
|
|
@@ -4030,11 +4037,11 @@ class mi {
|
|
|
4030
4037
|
return;
|
|
4031
4038
|
this.ctx.stageElement.style.cursor === "row-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
4032
4039
|
for (let f = 0; f < this.renderRows.length; f++) {
|
|
4033
|
-
const
|
|
4034
|
-
if (r >
|
|
4035
|
-
for (let
|
|
4036
|
-
const
|
|
4037
|
-
o >
|
|
4040
|
+
const u = this.renderRows[f];
|
|
4041
|
+
if (r > u.y - c + u.height - 1.5 && r < u.y - c + u.height + 1.5 && r < h - 4)
|
|
4042
|
+
for (let m = 0; m < u.cells.length; m++) {
|
|
4043
|
+
const x = u.cells[m];
|
|
4044
|
+
o > x.drawX + 10 && o < x.drawX + x.width - 10 && x.rowspan === 1 && (this.ctx.stageElement.style.cursor = "row-resize", this.resizeTarget = u);
|
|
4038
4045
|
}
|
|
4039
4046
|
}
|
|
4040
4047
|
}
|
|
@@ -4117,7 +4124,7 @@ class mi {
|
|
|
4117
4124
|
this.headIndex = Math.max(0, h), this.tailIndex = Math.min(this.ctx.maxRowIndex, c + 1), this.visibleRows = o.slice(this.headIndex, this.tailIndex + 1), this.ctx.body.headIndex = this.headIndex, this.ctx.body.tailIndex = this.tailIndex, this.ctx.body.visibleRows = this.visibleRows;
|
|
4118
4125
|
const d = [];
|
|
4119
4126
|
for (let f = 0; f < this.visibleRows.length; f++) {
|
|
4120
|
-
const
|
|
4127
|
+
const u = this.headIndex + f, g = this.visibleRows[f], { height: m, top: x } = this.ctx.database.getPositionForRowIndex(u), w = new ne(this.ctx, u, 0, x + this.y, t.width, m, g);
|
|
4121
4128
|
d.push(w);
|
|
4122
4129
|
}
|
|
4123
4130
|
this.renderRows = d, this.ctx.body.renderRows = d;
|
|
@@ -4334,66 +4341,66 @@ class Ei {
|
|
|
4334
4341
|
SELECTOR_AREA_MIN_Y: c,
|
|
4335
4342
|
SELECTOR_AREA_MAX_Y: d,
|
|
4336
4343
|
SELECTOR_AREA_MAX_X_OFFSET: f,
|
|
4337
|
-
SELECTOR_AREA_MAX_Y_OFFSET:
|
|
4338
|
-
} = this.ctx.config, g = n,
|
|
4339
|
-
let [
|
|
4340
|
-
if (
|
|
4344
|
+
SELECTOR_AREA_MAX_Y_OFFSET: u
|
|
4345
|
+
} = this.ctx.config, g = n, m = h || this.ctx.maxColIndex - f, x = c, w = d || this.ctx.maxRowIndex - u;
|
|
4346
|
+
let [p, C] = r, [y, b] = o;
|
|
4347
|
+
if (p < g || C > m || y < x || b > w)
|
|
4341
4348
|
return;
|
|
4342
4349
|
if (this.ctx.stageElement.focus({ preventScroll: !0 }), this.ctx.config.ENABLE_MERGE_CELL_LINK) {
|
|
4343
|
-
const
|
|
4344
|
-
y =
|
|
4350
|
+
const R = this.adjustMergeCells(r, o);
|
|
4351
|
+
y = R.yArr[0], b = R.yArr[1], p = R.xArr[0], C = R.xArr[1], this.ctx.onlyMergeCell = R.onlyMergeCell;
|
|
4345
4352
|
}
|
|
4346
|
-
|
|
4353
|
+
p === C && y === b ? this.ctx.selectOnlyOne = !0 : this.ctx.selectOnlyOne = !1, r = [Math.max(g, p), Math.min(m, C)], o = [Math.max(x, y), Math.min(w, b)];
|
|
4347
4354
|
const { BEFORE_SET_SELECTOR_METHOD: E } = this.ctx.config;
|
|
4348
4355
|
if (typeof E == "function") {
|
|
4349
|
-
const
|
|
4356
|
+
const O = E({
|
|
4350
4357
|
focusCell: this.ctx.focusCell,
|
|
4351
4358
|
xArr: r,
|
|
4352
4359
|
yArr: o
|
|
4353
4360
|
});
|
|
4354
|
-
if (!
|
|
4361
|
+
if (!O)
|
|
4355
4362
|
return;
|
|
4356
|
-
r =
|
|
4363
|
+
r = O.xArr, o = O.yArr;
|
|
4357
4364
|
}
|
|
4358
4365
|
this.ctx.selector.xArr = r, this.ctx.selector.yArr = o, this.ctx.emit("setSelector", this.ctx.selector), this.ctx.emit("drawView");
|
|
4359
4366
|
}
|
|
4360
4367
|
}
|
|
4361
4368
|
adjustMergeCells(t, e) {
|
|
4362
|
-
var
|
|
4369
|
+
var m;
|
|
4363
4370
|
const [i, s] = e, [r, o] = t;
|
|
4364
4371
|
let n = [], h = [];
|
|
4365
|
-
for (let
|
|
4372
|
+
for (let x = 0; x <= e[1] - e[0]; x++)
|
|
4366
4373
|
for (let w = 0; w <= t[1] - t[0]; w++) {
|
|
4367
|
-
const
|
|
4368
|
-
y && ((
|
|
4374
|
+
const p = x + e[0], C = w + t[0], y = this.ctx.database.getVirtualBodyCell(p, C);
|
|
4375
|
+
y && ((p === i || p === s) && n.push(y), (C === r || C === o) && h.push(y));
|
|
4369
4376
|
}
|
|
4370
4377
|
const c = n.reduce(
|
|
4371
|
-
(
|
|
4372
|
-
const { yArr:
|
|
4373
|
-
return
|
|
4378
|
+
(x, w) => {
|
|
4379
|
+
const { yArr: p } = w.getSpanInfo(), [C, y] = p;
|
|
4380
|
+
return x.minY = Math.min(x.minY, C), x.maxY = Math.max(x.maxY, y), x;
|
|
4374
4381
|
},
|
|
4375
4382
|
{
|
|
4376
4383
|
minY: i,
|
|
4377
4384
|
maxY: s
|
|
4378
4385
|
}
|
|
4379
4386
|
), d = h.reduce(
|
|
4380
|
-
(
|
|
4381
|
-
const { xArr:
|
|
4382
|
-
return
|
|
4387
|
+
(x, w) => {
|
|
4388
|
+
const { xArr: p } = w.getSpanInfo(), [C, y] = p;
|
|
4389
|
+
return x.minX = Math.min(x.minX, C), x.maxX = Math.max(x.maxX, y), x;
|
|
4383
4390
|
},
|
|
4384
4391
|
{
|
|
4385
4392
|
minX: r,
|
|
4386
4393
|
maxX: o
|
|
4387
4394
|
}
|
|
4388
|
-
), f = [d.minX, d.maxX],
|
|
4395
|
+
), f = [d.minX, d.maxX], u = [c.minY, c.maxY];
|
|
4389
4396
|
let g = !1;
|
|
4390
4397
|
if (d.minX !== d.maxX || c.minY !== c.maxY) {
|
|
4391
|
-
const
|
|
4392
|
-
g = (w && JSON.stringify(w.xArr) + JSON.stringify(w.yArr)) ===
|
|
4398
|
+
const x = JSON.stringify(f) + JSON.stringify(u), w = (m = this.ctx.focusCell) == null ? void 0 : m.getSpanInfo();
|
|
4399
|
+
g = (w && JSON.stringify(w.xArr) + JSON.stringify(w.yArr)) === x;
|
|
4393
4400
|
}
|
|
4394
4401
|
return {
|
|
4395
4402
|
xArr: f,
|
|
4396
|
-
yArr:
|
|
4403
|
+
yArr: u,
|
|
4397
4404
|
onlyMergeCell: g
|
|
4398
4405
|
};
|
|
4399
4406
|
}
|
|
@@ -4431,8 +4438,8 @@ class Ei {
|
|
|
4431
4438
|
SELECTOR_AREA_MAX_Y: o,
|
|
4432
4439
|
SELECTOR_AREA_MAX_X_OFFSET: n,
|
|
4433
4440
|
SELECTOR_AREA_MAX_Y_OFFSET: h
|
|
4434
|
-
} = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - n, f = r,
|
|
4435
|
-
this.setSelector(g,
|
|
4441
|
+
} = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - n, f = r, u = o || this.ctx.maxRowIndex - h, g = [c, d], m = [f, u];
|
|
4442
|
+
this.setSelector(g, m);
|
|
4436
4443
|
}
|
|
4437
4444
|
}
|
|
4438
4445
|
selectRows(t, e = !0) {
|
|
@@ -4470,8 +4477,8 @@ class Ei {
|
|
|
4470
4477
|
if (this.ctx.selector.enable = !0, i && t) {
|
|
4471
4478
|
if (this.ctx.config.ENABLE_SELECTOR_SINGLE)
|
|
4472
4479
|
return;
|
|
4473
|
-
const { colIndex: s, rowIndex: r } = i, { colIndex: o, rowIndex: n } = e, h = Math.min(o, s), c = Math.max(o, s), d = Math.min(n, r), f = Math.max(n, r),
|
|
4474
|
-
this.setSelector(
|
|
4480
|
+
const { colIndex: s, rowIndex: r } = i, { colIndex: o, rowIndex: n } = e, h = Math.min(o, s), c = Math.max(o, s), d = Math.min(n, r), f = Math.max(n, r), u = [h, c], g = [d, f];
|
|
4481
|
+
this.setSelector(u, g);
|
|
4475
4482
|
} else {
|
|
4476
4483
|
this.ctx.emit("cellSelectedClick", e);
|
|
4477
4484
|
const s = [e.colIndex, e.colIndex], r = [e.rowIndex, e.rowIndex];
|
|
@@ -4539,9 +4546,9 @@ class Ei {
|
|
|
4539
4546
|
for (let h = 0; h <= t[1] - t[0]; h++) {
|
|
4540
4547
|
const c = n + e[0], d = h + t[0], f = this.ctx.database.getItemValueForRowIndexAndColIndex(c, d);
|
|
4541
4548
|
if (f) {
|
|
4542
|
-
const { rowKey:
|
|
4543
|
-
this.ctx.database.getReadonly(
|
|
4544
|
-
rowKey:
|
|
4549
|
+
const { rowKey: u, key: g } = f;
|
|
4550
|
+
this.ctx.database.getReadonly(u, g) || (r.add(u), s.push({
|
|
4551
|
+
rowKey: u,
|
|
4545
4552
|
key: g,
|
|
4546
4553
|
value: null,
|
|
4547
4554
|
row: {}
|
|
@@ -4569,18 +4576,18 @@ class Ei {
|
|
|
4569
4576
|
const e = this.ctx.selector.yArr[0], i = this.ctx.selector.xArr[0], s = /* @__PURE__ */ new Set();
|
|
4570
4577
|
navigator.clipboard.readText().then(async (r) => {
|
|
4571
4578
|
let o = si(r);
|
|
4572
|
-
const n = [i, i + o[0].length - 1], h = [e, e + o.length - 1], [c, d] = h, [f,
|
|
4573
|
-
(g > 0 ||
|
|
4579
|
+
const n = [i, i + o[0].length - 1], h = [e, e + o.length - 1], [c, d] = h, [f, u] = n, g = d - this.ctx.maxRowIndex, m = u - this.ctx.maxColIndex;
|
|
4580
|
+
(g > 0 || m > 0) && this.ctx.emit("onPastedDataOverflow", {
|
|
4574
4581
|
maxY: d,
|
|
4575
|
-
maxX:
|
|
4582
|
+
maxX: u,
|
|
4576
4583
|
minY: c,
|
|
4577
4584
|
minX: f,
|
|
4578
4585
|
overflowRowCount: g,
|
|
4579
|
-
overflowColCount:
|
|
4586
|
+
overflowColCount: m,
|
|
4580
4587
|
textArr: o
|
|
4581
4588
|
});
|
|
4582
|
-
const
|
|
4583
|
-
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(n, h) && !
|
|
4589
|
+
const x = o.length === 1 && o[0].length === 1;
|
|
4590
|
+
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(n, h) && !x) {
|
|
4584
4591
|
const y = {
|
|
4585
4592
|
code: "ERR_MERGED_CELLS_PASTE",
|
|
4586
4593
|
message: "Merged cells cannot span paste data"
|
|
@@ -4592,16 +4599,16 @@ class Ei {
|
|
|
4592
4599
|
for (let y = 0; y <= o.length - 1; y++) {
|
|
4593
4600
|
const b = o[y].length;
|
|
4594
4601
|
for (let E = 0; E <= b - 1; E++) {
|
|
4595
|
-
const
|
|
4596
|
-
|
|
4597
|
-
|
|
4602
|
+
const R = y + e, O = E + i, I = o[y][E], _ = this.ctx.database.getItemValueForRowIndexAndColIndex(
|
|
4603
|
+
R,
|
|
4604
|
+
O
|
|
4598
4605
|
);
|
|
4599
|
-
if (
|
|
4600
|
-
const { rowKey:
|
|
4601
|
-
this.ctx.database.getReadonly(
|
|
4602
|
-
rowKey:
|
|
4603
|
-
key:
|
|
4604
|
-
value:
|
|
4606
|
+
if (_) {
|
|
4607
|
+
const { rowKey: v, key: S } = _;
|
|
4608
|
+
this.ctx.database.getReadonly(v, S) || (s.add(v), w.push({
|
|
4609
|
+
rowKey: v,
|
|
4610
|
+
key: S,
|
|
4611
|
+
value: I,
|
|
4605
4612
|
row: {}
|
|
4606
4613
|
//内部有设置
|
|
4607
4614
|
}));
|
|
@@ -4621,9 +4628,9 @@ class Ei {
|
|
|
4621
4628
|
}
|
|
4622
4629
|
if (!w.length)
|
|
4623
4630
|
return;
|
|
4624
|
-
const { BEFORE_PASTE_DATA_METHOD:
|
|
4625
|
-
if (typeof
|
|
4626
|
-
const y =
|
|
4631
|
+
const { BEFORE_PASTE_DATA_METHOD: p } = this.ctx.config;
|
|
4632
|
+
if (typeof p == "function") {
|
|
4633
|
+
const y = p, b = w.map((E) => ({
|
|
4627
4634
|
rowKey: E.rowKey,
|
|
4628
4635
|
key: E.key,
|
|
4629
4636
|
value: E.value,
|
|
@@ -4683,8 +4690,8 @@ class Ei {
|
|
|
4683
4690
|
SELECTOR_AREA_MAX_Y: o,
|
|
4684
4691
|
SELECTOR_AREA_MAX_X_OFFSET: n,
|
|
4685
4692
|
SELECTOR_AREA_MAX_Y_OFFSET: h
|
|
4686
|
-
} = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - n, f = r,
|
|
4687
|
-
return !(e < c || e > d || t < f || t >
|
|
4693
|
+
} = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - n, f = r, u = o || this.ctx.maxRowIndex - h;
|
|
4694
|
+
return !(e < c || e > d || t < f || t > u);
|
|
4688
4695
|
}
|
|
4689
4696
|
/**
|
|
4690
4697
|
* 调整滚动条位置,让到达边界时自动滚动
|
|
@@ -4726,19 +4733,19 @@ class Ei {
|
|
|
4726
4733
|
body: h,
|
|
4727
4734
|
scrollX: c,
|
|
4728
4735
|
scrollY: d,
|
|
4729
|
-
config: { SCROLLER_TRACK_SIZE: f, FOOTER_FIXED:
|
|
4736
|
+
config: { SCROLLER_TRACK_SIZE: f, FOOTER_FIXED: u, FOOTER_POSITION: g, ENABLE_MERGE_CELL_LINK: m }
|
|
4730
4737
|
} = this.ctx;
|
|
4731
4738
|
if (!i)
|
|
4732
4739
|
return;
|
|
4733
|
-
|
|
4734
|
-
const { drawX:
|
|
4735
|
-
let
|
|
4736
|
-
|
|
4737
|
-
let
|
|
4738
|
-
|
|
4739
|
-
const
|
|
4740
|
-
let
|
|
4741
|
-
E > 0 && !y ?
|
|
4740
|
+
m && this.ctx.onlyMergeCell && i.updateSpanInfo();
|
|
4741
|
+
const { drawX: x, drawY: w, width: p, height: C, fixed: y } = i, b = r - x + 1, E = i.drawX + p - (e - s) + 1;
|
|
4742
|
+
let R = o.height - w, O = C;
|
|
4743
|
+
O > h.visibleHeight && (O = h.visibleHeight);
|
|
4744
|
+
let I = 0;
|
|
4745
|
+
u && (g === "top" ? R = o.height + n.height - w : I = n.visibleHeight);
|
|
4746
|
+
const _ = w + O - (t - I - f);
|
|
4747
|
+
let v = c, S = d;
|
|
4748
|
+
E > 0 && !y ? v = Math.floor(c + E) : b > 0 && !y && (v = Math.floor(c - b)), R > 0 ? S = Math.floor(d - R) : _ > 0 && (S = Math.floor(d + _)), (Math.abs(c - v) > 2 || Math.abs(d - S) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.setScroll(v, S), this.ctx.emit("adjustBoundaryPosition", i));
|
|
4742
4749
|
}
|
|
4743
4750
|
destroy() {
|
|
4744
4751
|
this.timerX && (clearTimeout(this.timerX), this.timerX = 0), this.timerY && (clearTimeout(this.timerY), this.timerY = 0);
|
|
@@ -4754,8 +4761,8 @@ class Ci {
|
|
|
4754
4761
|
this.ctx.on("mousemove", (t) => {
|
|
4755
4762
|
if (this.ctx.stageElement.style.cursor === "crosshair" && (this.ctx.stageElement.style.cursor = "default"), this.ctx.editing || !this.ctx.focusCell || !this.maxColRowCell)
|
|
4756
4763
|
return;
|
|
4757
|
-
const { offsetX: e, offsetY: i } = this.ctx.getOffset(t), { colIndex: s, rowIndex: r, drawX: o, drawY: n, width: h, height: c } = this.maxColRowCell, d = 6, f = s === this.ctx.maxColIndex || r === this.ctx.maxRowIndex ? 0 : 2,
|
|
4758
|
-
e >
|
|
4764
|
+
const { offsetX: e, offsetY: i } = this.ctx.getOffset(t), { colIndex: s, rowIndex: r, drawX: o, drawY: n, width: h, height: c } = this.maxColRowCell, d = 6, f = s === this.ctx.maxColIndex || r === this.ctx.maxRowIndex ? 0 : 2, u = o + h - d + f, g = n + c - d + f;
|
|
4765
|
+
e > u && i > g && e < u + d && i < g + d && (this.ctx.stageElement.style.cursor = "crosshair");
|
|
4759
4766
|
}), this.ctx.on("cellMouseenter", (t) => {
|
|
4760
4767
|
const { xArr: e, yArr: i } = this.ctx.selector, s = e[1], r = i[1], { colIndex: o, rowIndex: n } = t;
|
|
4761
4768
|
this.ctx.config.ENABLE_AUTOFILL && o === s && n === r && (this.maxColRowCell = t), this.mouseenter(t);
|
|
@@ -4800,23 +4807,23 @@ class Ci {
|
|
|
4800
4807
|
SELECTOR_AREA_MAX_X: c,
|
|
4801
4808
|
SELECTOR_AREA_MIN_Y: d,
|
|
4802
4809
|
SELECTOR_AREA_MAX_Y: f,
|
|
4803
|
-
SELECTOR_AREA_MAX_X_OFFSET:
|
|
4810
|
+
SELECTOR_AREA_MAX_X_OFFSET: u,
|
|
4804
4811
|
SELECTOR_AREA_MAX_Y_OFFSET: g
|
|
4805
|
-
} = this.ctx.config,
|
|
4812
|
+
} = this.ctx.config, m = h, x = c || this.ctx.maxColIndex - u, w = d, p = f || this.ctx.maxRowIndex - g;
|
|
4806
4813
|
let [C, y] = o, [b, E] = n;
|
|
4807
|
-
if (C <
|
|
4814
|
+
if (C < m || b < w)
|
|
4808
4815
|
return;
|
|
4809
|
-
o = [Math.max(
|
|
4810
|
-
const { BEFORE_SET_AUTOFILL_METHOD:
|
|
4811
|
-
if (typeof
|
|
4812
|
-
const
|
|
4816
|
+
o = [Math.max(m, C), Math.min(x, y)], n = [Math.max(w, b), Math.min(p, E)];
|
|
4817
|
+
const { BEFORE_SET_AUTOFILL_METHOD: R } = this.ctx.config;
|
|
4818
|
+
if (typeof R == "function") {
|
|
4819
|
+
const I = R({
|
|
4813
4820
|
focusCell: this.ctx.focusCell,
|
|
4814
4821
|
xArr: o,
|
|
4815
4822
|
yArr: n
|
|
4816
4823
|
});
|
|
4817
|
-
if (!
|
|
4824
|
+
if (!I)
|
|
4818
4825
|
return;
|
|
4819
|
-
o =
|
|
4826
|
+
o = I.xArr, n = I.yArr;
|
|
4820
4827
|
}
|
|
4821
4828
|
this.ctx.autofill.xArr = o, this.ctx.autofill.yArr = n, this.ctx.emit("setAutofill", this.ctx.autofill), this.ctx.emit("draw");
|
|
4822
4829
|
}
|
|
@@ -4827,9 +4834,9 @@ class Ci {
|
|
|
4827
4834
|
async autofillData() {
|
|
4828
4835
|
const t = /* @__PURE__ */ new Set(), e = this.ctx.getSelectedData(), i = /* @__PURE__ */ new Map();
|
|
4829
4836
|
for (let g = 0; g <= e.yArr[1] - e.yArr[0]; g++)
|
|
4830
|
-
for (let
|
|
4831
|
-
const
|
|
4832
|
-
i.set(`${
|
|
4837
|
+
for (let m = 0; m <= e.xArr[1] - e.xArr[0]; m++) {
|
|
4838
|
+
const x = g + e.yArr[0], w = m + e.xArr[0];
|
|
4839
|
+
i.set(`${x}-${w}`, !0);
|
|
4833
4840
|
}
|
|
4834
4841
|
const { value: s } = e, r = s[0].length, o = s.length, n = this.ctx.autofill.xArr, h = this.ctx.autofill.yArr, c = r === 1 && o === 1;
|
|
4835
4842
|
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(n, h) && !c) {
|
|
@@ -4842,14 +4849,14 @@ class Ci {
|
|
|
4842
4849
|
}
|
|
4843
4850
|
let d = [];
|
|
4844
4851
|
for (let g = 0; g <= h[1] - h[0]; g++)
|
|
4845
|
-
for (let
|
|
4846
|
-
const
|
|
4852
|
+
for (let m = 0; m <= n[1] - n[0]; m++) {
|
|
4853
|
+
const x = m + n[0], w = g + h[0], p = s[g % o][m % r], C = this.ctx.database.getItemValueForRowIndexAndColIndex(w, x), y = `${w}-${x}`;
|
|
4847
4854
|
if (C && !i.has(y)) {
|
|
4848
4855
|
const { rowKey: b, key: E } = C;
|
|
4849
4856
|
this.ctx.database.getReadonly(b, E) || (t.add(b), d.push({
|
|
4850
4857
|
rowKey: b,
|
|
4851
4858
|
key: E,
|
|
4852
|
-
value:
|
|
4859
|
+
value: p,
|
|
4853
4860
|
row: {}
|
|
4854
4861
|
}));
|
|
4855
4862
|
}
|
|
@@ -4859,21 +4866,21 @@ class Ci {
|
|
|
4859
4866
|
this.ctx.selector.xArr = this.ctx.autofill.xArr, this.ctx.selector.yArr = this.ctx.autofill.yArr;
|
|
4860
4867
|
const { BEFORE_AUTOFILL_DATA_METHOD: f } = this.ctx.config;
|
|
4861
4868
|
if (typeof f == "function") {
|
|
4862
|
-
const g = f,
|
|
4863
|
-
rowKey:
|
|
4864
|
-
key:
|
|
4865
|
-
value:
|
|
4866
|
-
oldValue: this.ctx.database.getItemValue(
|
|
4867
|
-
row: this.ctx.database.getRowDataItemForRowKey(
|
|
4869
|
+
const g = f, m = d.map((x) => ({
|
|
4870
|
+
rowKey: x.rowKey,
|
|
4871
|
+
key: x.key,
|
|
4872
|
+
value: x.value,
|
|
4873
|
+
oldValue: this.ctx.database.getItemValue(x.rowKey, x.key),
|
|
4874
|
+
row: this.ctx.database.getRowDataItemForRowKey(x.rowKey)
|
|
4868
4875
|
}));
|
|
4869
|
-
if (d = await g(
|
|
4876
|
+
if (d = await g(m, n, h), d && !d.length)
|
|
4870
4877
|
return;
|
|
4871
4878
|
}
|
|
4872
4879
|
this.ctx.batchSetItemValueByEditor(d, !0);
|
|
4873
|
-
let
|
|
4880
|
+
let u = [];
|
|
4874
4881
|
t.forEach((g) => {
|
|
4875
|
-
|
|
4876
|
-
}), this.ctx.emit("autofillChange", d,
|
|
4882
|
+
u.push(this.ctx.database.getRowDataItemForRowKey(g));
|
|
4883
|
+
}), this.ctx.emit("autofillChange", d, u);
|
|
4877
4884
|
}
|
|
4878
4885
|
mouseenter(t) {
|
|
4879
4886
|
if (["index", "selection", "index-selection"].includes(t.type))
|
|
@@ -4899,7 +4906,7 @@ const rt = Math.min, U = Math.max, ft = Math.round, z = (a) => ({
|
|
|
4899
4906
|
start: "end",
|
|
4900
4907
|
end: "start"
|
|
4901
4908
|
};
|
|
4902
|
-
function
|
|
4909
|
+
function It(a, t, e) {
|
|
4903
4910
|
return U(a, rt(t, e));
|
|
4904
4911
|
}
|
|
4905
4912
|
function at(a, t) {
|
|
@@ -4927,16 +4934,16 @@ function Ri(a, t, e) {
|
|
|
4927
4934
|
e === void 0 && (e = !1);
|
|
4928
4935
|
const i = lt(a), s = Ht(a), r = Mt(s);
|
|
4929
4936
|
let o = s === "x" ? i === (e ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
|
|
4930
|
-
return t.reference[r] > t.floating[r] && (o =
|
|
4937
|
+
return t.reference[r] > t.floating[r] && (o = ut(o)), [o, ut(o)];
|
|
4931
4938
|
}
|
|
4932
|
-
function
|
|
4933
|
-
const t =
|
|
4939
|
+
function _i(a) {
|
|
4940
|
+
const t = ut(a);
|
|
4934
4941
|
return [Ot(a), t, Ot(t)];
|
|
4935
4942
|
}
|
|
4936
4943
|
function Ot(a) {
|
|
4937
4944
|
return a.replace(/start|end/g, (t) => vi[t]);
|
|
4938
4945
|
}
|
|
4939
|
-
function
|
|
4946
|
+
function Ii(a, t, e) {
|
|
4940
4947
|
const i = ["left", "right"], s = ["right", "left"], r = ["top", "bottom"], o = ["bottom", "top"];
|
|
4941
4948
|
switch (a) {
|
|
4942
4949
|
case "top":
|
|
@@ -4951,10 +4958,10 @@ function _i(a, t, e) {
|
|
|
4951
4958
|
}
|
|
4952
4959
|
function Oi(a, t, e, i) {
|
|
4953
4960
|
const s = lt(a);
|
|
4954
|
-
let r =
|
|
4961
|
+
let r = Ii(G(a), e === "start", i);
|
|
4955
4962
|
return s && (r = r.map((o) => o + "-" + s), t && (r = r.concat(r.map(Ot)))), r;
|
|
4956
4963
|
}
|
|
4957
|
-
function
|
|
4964
|
+
function ut(a) {
|
|
4958
4965
|
return a.replace(/left|right|bottom|top/g, (t) => bi[t]);
|
|
4959
4966
|
}
|
|
4960
4967
|
function Li(a) {
|
|
@@ -4974,7 +4981,7 @@ function le(a) {
|
|
|
4974
4981
|
left: a
|
|
4975
4982
|
};
|
|
4976
4983
|
}
|
|
4977
|
-
function
|
|
4984
|
+
function xt(a) {
|
|
4978
4985
|
const {
|
|
4979
4986
|
x: t,
|
|
4980
4987
|
y: e,
|
|
@@ -4997,7 +5004,7 @@ function $t(a, t, e) {
|
|
|
4997
5004
|
reference: i,
|
|
4998
5005
|
floating: s
|
|
4999
5006
|
} = a;
|
|
5000
|
-
const r = J(t), o = Ht(t), n = Mt(o), h = G(t), c = r === "y", d = i.x + i.width / 2 - s.width / 2, f = i.y + i.height / 2 - s.height / 2,
|
|
5007
|
+
const r = J(t), o = Ht(t), n = Mt(o), h = G(t), c = r === "y", d = i.x + i.width / 2 - s.width / 2, f = i.y + i.height / 2 - s.height / 2, u = i[n] / 2 - s[n] / 2;
|
|
5001
5008
|
let g;
|
|
5002
5009
|
switch (h) {
|
|
5003
5010
|
case "top":
|
|
@@ -5032,10 +5039,10 @@ function $t(a, t, e) {
|
|
|
5032
5039
|
}
|
|
5033
5040
|
switch (lt(t)) {
|
|
5034
5041
|
case "start":
|
|
5035
|
-
g[o] -=
|
|
5042
|
+
g[o] -= u * (e && c ? -1 : 1);
|
|
5036
5043
|
break;
|
|
5037
5044
|
case "end":
|
|
5038
|
-
g[o] +=
|
|
5045
|
+
g[o] += u * (e && c ? -1 : 1);
|
|
5039
5046
|
break;
|
|
5040
5047
|
}
|
|
5041
5048
|
return g;
|
|
@@ -5054,21 +5061,21 @@ const Si = async (a, t, e) => {
|
|
|
5054
5061
|
}), {
|
|
5055
5062
|
x: d,
|
|
5056
5063
|
y: f
|
|
5057
|
-
} = $t(c, i, h),
|
|
5058
|
-
for (let
|
|
5064
|
+
} = $t(c, i, h), u = i, g = {}, m = 0;
|
|
5065
|
+
for (let x = 0; x < n.length; x++) {
|
|
5059
5066
|
const {
|
|
5060
5067
|
name: w,
|
|
5061
|
-
fn:
|
|
5062
|
-
} = n[
|
|
5068
|
+
fn: p
|
|
5069
|
+
} = n[x], {
|
|
5063
5070
|
x: C,
|
|
5064
5071
|
y,
|
|
5065
5072
|
data: b,
|
|
5066
5073
|
reset: E
|
|
5067
|
-
} = await
|
|
5074
|
+
} = await p({
|
|
5068
5075
|
x: d,
|
|
5069
5076
|
y: f,
|
|
5070
5077
|
initialPlacement: i,
|
|
5071
|
-
placement:
|
|
5078
|
+
placement: u,
|
|
5072
5079
|
strategy: s,
|
|
5073
5080
|
middlewareData: g,
|
|
5074
5081
|
rects: c,
|
|
@@ -5084,19 +5091,19 @@ const Si = async (a, t, e) => {
|
|
|
5084
5091
|
...g[w],
|
|
5085
5092
|
...b
|
|
5086
5093
|
}
|
|
5087
|
-
}, E &&
|
|
5094
|
+
}, E && m <= 50 && (m++, typeof E == "object" && (E.placement && (u = E.placement), E.rects && (c = E.rects === !0 ? await o.getElementRects({
|
|
5088
5095
|
reference: a,
|
|
5089
5096
|
floating: t,
|
|
5090
5097
|
strategy: s
|
|
5091
5098
|
}) : E.rects), {
|
|
5092
5099
|
x: d,
|
|
5093
5100
|
y: f
|
|
5094
|
-
} = $t(c,
|
|
5101
|
+
} = $t(c, u, h)), x = -1);
|
|
5095
5102
|
}
|
|
5096
5103
|
return {
|
|
5097
5104
|
x: d,
|
|
5098
5105
|
y: f,
|
|
5099
|
-
placement:
|
|
5106
|
+
placement: u,
|
|
5100
5107
|
strategy: s,
|
|
5101
5108
|
middlewareData: g
|
|
5102
5109
|
};
|
|
@@ -5115,9 +5122,9 @@ async function he(a, t) {
|
|
|
5115
5122
|
boundary: c = "clippingAncestors",
|
|
5116
5123
|
rootBoundary: d = "viewport",
|
|
5117
5124
|
elementContext: f = "floating",
|
|
5118
|
-
altBoundary:
|
|
5125
|
+
altBoundary: u = !1,
|
|
5119
5126
|
padding: g = 0
|
|
5120
|
-
} = at(t, a),
|
|
5127
|
+
} = at(t, a), m = le(g), w = n[u ? f === "floating" ? "reference" : "floating" : f], p = xt(await r.getClippingRect({
|
|
5121
5128
|
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)),
|
|
5122
5129
|
boundary: c,
|
|
5123
5130
|
rootBoundary: d,
|
|
@@ -5133,20 +5140,20 @@ async function he(a, t) {
|
|
|
5133
5140
|
} : {
|
|
5134
5141
|
x: 1,
|
|
5135
5142
|
y: 1
|
|
5136
|
-
}, E =
|
|
5143
|
+
}, E = xt(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
5137
5144
|
elements: n,
|
|
5138
5145
|
rect: C,
|
|
5139
5146
|
offsetParent: y,
|
|
5140
5147
|
strategy: h
|
|
5141
5148
|
}) : C);
|
|
5142
5149
|
return {
|
|
5143
|
-
top: (
|
|
5144
|
-
bottom: (E.bottom -
|
|
5145
|
-
left: (
|
|
5146
|
-
right: (E.right -
|
|
5150
|
+
top: (p.top - E.top + m.top) / b.y,
|
|
5151
|
+
bottom: (E.bottom - p.bottom + m.bottom) / b.y,
|
|
5152
|
+
left: (p.left - E.left + m.left) / b.x,
|
|
5153
|
+
right: (E.right - p.right + m.right) / b.x
|
|
5147
5154
|
};
|
|
5148
5155
|
}
|
|
5149
|
-
const
|
|
5156
|
+
const Ti = (a) => ({
|
|
5150
5157
|
name: "arrow",
|
|
5151
5158
|
options: a,
|
|
5152
5159
|
async fn(t) {
|
|
@@ -5164,18 +5171,18 @@ const Ai = (a) => ({
|
|
|
5164
5171
|
} = at(a, t) || {};
|
|
5165
5172
|
if (c == null)
|
|
5166
5173
|
return {};
|
|
5167
|
-
const f = le(d),
|
|
5174
|
+
const f = le(d), u = {
|
|
5168
5175
|
x: e,
|
|
5169
5176
|
y: i
|
|
5170
|
-
}, g = Ht(s),
|
|
5171
|
-
let
|
|
5172
|
-
(!
|
|
5173
|
-
const
|
|
5177
|
+
}, g = Ht(s), m = Mt(g), x = await o.getDimensions(c), w = g === "y", p = w ? "top" : "left", C = w ? "bottom" : "right", y = w ? "clientHeight" : "clientWidth", b = r.reference[m] + r.reference[g] - u[g] - r.floating[m], E = u[g] - r.reference[g], R = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(c));
|
|
5178
|
+
let O = R ? R[y] : 0;
|
|
5179
|
+
(!O || !await (o.isElement == null ? void 0 : o.isElement(R))) && (O = n.floating[y] || r.floating[m]);
|
|
5180
|
+
const I = b / 2 - E / 2, _ = O / 2 - x[m] / 2 - 1, v = rt(f[p], _), S = rt(f[C], _), T = v, M = O - x[m] - S, A = O / 2 - x[m] / 2 + I, B = It(T, A, M), Y = !h.arrow && lt(s) != null && A !== B && r.reference[m] / 2 - (A < T ? v : S) - x[m] / 2 < 0, k = Y ? A < T ? A - T : A - M : 0;
|
|
5174
5181
|
return {
|
|
5175
|
-
[g]:
|
|
5182
|
+
[g]: u[g] + k,
|
|
5176
5183
|
data: {
|
|
5177
5184
|
[g]: B,
|
|
5178
|
-
centerOffset:
|
|
5185
|
+
centerOffset: A - B - k,
|
|
5179
5186
|
...Y && {
|
|
5180
5187
|
alignmentOffset: k
|
|
5181
5188
|
}
|
|
@@ -5183,7 +5190,7 @@ const Ai = (a) => ({
|
|
|
5183
5190
|
reset: Y
|
|
5184
5191
|
};
|
|
5185
5192
|
}
|
|
5186
|
-
}),
|
|
5193
|
+
}), Ai = function(a) {
|
|
5187
5194
|
return a === void 0 && (a = {}), {
|
|
5188
5195
|
name: "flip",
|
|
5189
5196
|
options: a,
|
|
@@ -5199,45 +5206,45 @@ const Ai = (a) => ({
|
|
|
5199
5206
|
} = t, {
|
|
5200
5207
|
mainAxis: d = !0,
|
|
5201
5208
|
crossAxis: f = !0,
|
|
5202
|
-
fallbackPlacements:
|
|
5209
|
+
fallbackPlacements: u,
|
|
5203
5210
|
fallbackStrategy: g = "bestFit",
|
|
5204
|
-
fallbackAxisSideDirection:
|
|
5205
|
-
flipAlignment:
|
|
5211
|
+
fallbackAxisSideDirection: m = "none",
|
|
5212
|
+
flipAlignment: x = !0,
|
|
5206
5213
|
...w
|
|
5207
5214
|
} = at(a, t);
|
|
5208
5215
|
if ((e = r.arrow) != null && e.alignmentOffset)
|
|
5209
5216
|
return {};
|
|
5210
|
-
const
|
|
5211
|
-
!
|
|
5212
|
-
const
|
|
5213
|
-
let
|
|
5214
|
-
if (d &&
|
|
5215
|
-
const
|
|
5216
|
-
|
|
5217
|
+
const p = G(s), C = J(n), y = G(n) === n, b = await (h.isRTL == null ? void 0 : h.isRTL(c.floating)), E = u || (y || !x ? [ut(n)] : _i(n)), R = m !== "none";
|
|
5218
|
+
!u && R && E.push(...Oi(n, x, m, b));
|
|
5219
|
+
const O = [n, ...E], I = await he(t, w), _ = [];
|
|
5220
|
+
let v = ((i = r.flip) == null ? void 0 : i.overflows) || [];
|
|
5221
|
+
if (d && _.push(I[p]), f) {
|
|
5222
|
+
const A = Ri(s, o, b);
|
|
5223
|
+
_.push(I[A[0]], I[A[1]]);
|
|
5217
5224
|
}
|
|
5218
|
-
if (
|
|
5225
|
+
if (v = [...v, {
|
|
5219
5226
|
placement: s,
|
|
5220
|
-
overflows:
|
|
5221
|
-
}], !
|
|
5222
|
-
var
|
|
5223
|
-
const
|
|
5227
|
+
overflows: _
|
|
5228
|
+
}], !_.every((A) => A <= 0)) {
|
|
5229
|
+
var S, T;
|
|
5230
|
+
const A = (((S = r.flip) == null ? void 0 : S.index) || 0) + 1, B = O[A];
|
|
5224
5231
|
if (B)
|
|
5225
5232
|
return {
|
|
5226
5233
|
data: {
|
|
5227
|
-
index:
|
|
5228
|
-
overflows:
|
|
5234
|
+
index: A,
|
|
5235
|
+
overflows: v
|
|
5229
5236
|
},
|
|
5230
5237
|
reset: {
|
|
5231
5238
|
placement: B
|
|
5232
5239
|
}
|
|
5233
5240
|
};
|
|
5234
|
-
let Y = (
|
|
5241
|
+
let Y = (T = v.filter((k) => k.overflows[0] <= 0).sort((k, W) => k.overflows[1] - W.overflows[1])[0]) == null ? void 0 : T.placement;
|
|
5235
5242
|
if (!Y)
|
|
5236
5243
|
switch (g) {
|
|
5237
5244
|
case "bestFit": {
|
|
5238
5245
|
var M;
|
|
5239
|
-
const k = (M =
|
|
5240
|
-
if (
|
|
5246
|
+
const k = (M = v.filter((W) => {
|
|
5247
|
+
if (R) {
|
|
5241
5248
|
const P = J(W.placement);
|
|
5242
5249
|
return P === C || // Create a bias to the `y` side axis due to horizontal
|
|
5243
5250
|
// reading directions favoring greater width.
|
|
@@ -5270,9 +5277,9 @@ async function Mi(a, t) {
|
|
|
5270
5277
|
elements: s
|
|
5271
5278
|
} = a, r = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), o = G(e), n = lt(e), h = J(e) === "y", c = ["left", "top"].includes(o) ? -1 : 1, d = r && h ? -1 : 1, f = at(t, a);
|
|
5272
5279
|
let {
|
|
5273
|
-
mainAxis:
|
|
5280
|
+
mainAxis: u,
|
|
5274
5281
|
crossAxis: g,
|
|
5275
|
-
alignmentAxis:
|
|
5282
|
+
alignmentAxis: m
|
|
5276
5283
|
} = typeof f == "number" ? {
|
|
5277
5284
|
mainAxis: f,
|
|
5278
5285
|
crossAxis: 0,
|
|
@@ -5282,11 +5289,11 @@ async function Mi(a, t) {
|
|
|
5282
5289
|
crossAxis: f.crossAxis || 0,
|
|
5283
5290
|
alignmentAxis: f.alignmentAxis
|
|
5284
5291
|
};
|
|
5285
|
-
return n && typeof
|
|
5292
|
+
return n && typeof m == "number" && (g = n === "end" ? m * -1 : m), h ? {
|
|
5286
5293
|
x: g * d,
|
|
5287
|
-
y:
|
|
5294
|
+
y: u * c
|
|
5288
5295
|
} : {
|
|
5289
|
-
x:
|
|
5296
|
+
x: u * c,
|
|
5290
5297
|
y: g * d
|
|
5291
5298
|
};
|
|
5292
5299
|
}
|
|
@@ -5327,11 +5334,11 @@ const Hi = function(a) {
|
|
|
5327
5334
|
limiter: n = {
|
|
5328
5335
|
fn: (w) => {
|
|
5329
5336
|
let {
|
|
5330
|
-
x:
|
|
5337
|
+
x: p,
|
|
5331
5338
|
y: C
|
|
5332
5339
|
} = w;
|
|
5333
5340
|
return {
|
|
5334
|
-
x:
|
|
5341
|
+
x: p,
|
|
5335
5342
|
y: C
|
|
5336
5343
|
};
|
|
5337
5344
|
}
|
|
@@ -5340,28 +5347,28 @@ const Hi = function(a) {
|
|
|
5340
5347
|
} = at(a, t), c = {
|
|
5341
5348
|
x: e,
|
|
5342
5349
|
y: i
|
|
5343
|
-
}, d = await he(t, h), f = J(G(s)),
|
|
5344
|
-
let g = c[
|
|
5350
|
+
}, d = await he(t, h), f = J(G(s)), u = ae(f);
|
|
5351
|
+
let g = c[u], m = c[f];
|
|
5345
5352
|
if (r) {
|
|
5346
|
-
const w =
|
|
5347
|
-
g =
|
|
5353
|
+
const w = u === "y" ? "top" : "left", p = u === "y" ? "bottom" : "right", C = g + d[w], y = g - d[p];
|
|
5354
|
+
g = It(C, g, y);
|
|
5348
5355
|
}
|
|
5349
5356
|
if (o) {
|
|
5350
|
-
const w = f === "y" ? "top" : "left",
|
|
5351
|
-
|
|
5357
|
+
const w = f === "y" ? "top" : "left", p = f === "y" ? "bottom" : "right", C = m + d[w], y = m - d[p];
|
|
5358
|
+
m = It(C, m, y);
|
|
5352
5359
|
}
|
|
5353
|
-
const
|
|
5360
|
+
const x = n.fn({
|
|
5354
5361
|
...t,
|
|
5355
|
-
[
|
|
5356
|
-
[f]:
|
|
5362
|
+
[u]: g,
|
|
5363
|
+
[f]: m
|
|
5357
5364
|
});
|
|
5358
5365
|
return {
|
|
5359
|
-
...
|
|
5366
|
+
...x,
|
|
5360
5367
|
data: {
|
|
5361
|
-
x:
|
|
5362
|
-
y:
|
|
5368
|
+
x: x.x - e,
|
|
5369
|
+
y: x.y - i,
|
|
5363
5370
|
enabled: {
|
|
5364
|
-
[
|
|
5371
|
+
[u]: r,
|
|
5365
5372
|
[f]: o
|
|
5366
5373
|
}
|
|
5367
5374
|
}
|
|
@@ -5375,7 +5382,7 @@ function gt() {
|
|
|
5375
5382
|
function tt(a) {
|
|
5376
5383
|
return ce(a) ? (a.nodeName || "").toLowerCase() : "#document";
|
|
5377
5384
|
}
|
|
5378
|
-
function
|
|
5385
|
+
function X(a) {
|
|
5379
5386
|
var t;
|
|
5380
5387
|
return (a == null || (t = a.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
5381
5388
|
}
|
|
@@ -5384,16 +5391,16 @@ function V(a) {
|
|
|
5384
5391
|
return (t = (ce(a) ? a.ownerDocument : a.document) || window.document) == null ? void 0 : t.documentElement;
|
|
5385
5392
|
}
|
|
5386
5393
|
function ce(a) {
|
|
5387
|
-
return gt() ? a instanceof Node || a instanceof
|
|
5394
|
+
return gt() ? a instanceof Node || a instanceof X(a).Node : !1;
|
|
5388
5395
|
}
|
|
5389
|
-
function
|
|
5390
|
-
return gt() ? a instanceof Element || a instanceof
|
|
5396
|
+
function N(a) {
|
|
5397
|
+
return gt() ? a instanceof Element || a instanceof X(a).Element : !1;
|
|
5391
5398
|
}
|
|
5392
5399
|
function K(a) {
|
|
5393
|
-
return gt() ? a instanceof HTMLElement || a instanceof
|
|
5400
|
+
return gt() ? a instanceof HTMLElement || a instanceof X(a).HTMLElement : !1;
|
|
5394
5401
|
}
|
|
5395
5402
|
function qt(a) {
|
|
5396
|
-
return !gt() || typeof ShadowRoot > "u" ? !1 : a instanceof ShadowRoot || a instanceof
|
|
5403
|
+
return !gt() || typeof ShadowRoot > "u" ? !1 : a instanceof ShadowRoot || a instanceof X(a).ShadowRoot;
|
|
5397
5404
|
}
|
|
5398
5405
|
function ht(a) {
|
|
5399
5406
|
const {
|
|
@@ -5404,7 +5411,7 @@ function ht(a) {
|
|
|
5404
5411
|
} = F(a);
|
|
5405
5412
|
return /auto|scroll|overlay|hidden|clip/.test(t + i + e) && !["inline", "contents"].includes(s);
|
|
5406
5413
|
}
|
|
5407
|
-
function
|
|
5414
|
+
function Xi(a) {
|
|
5408
5415
|
return ["table", "td", "th"].includes(tt(a));
|
|
5409
5416
|
}
|
|
5410
5417
|
function wt(a) {
|
|
@@ -5417,10 +5424,10 @@ function wt(a) {
|
|
|
5417
5424
|
});
|
|
5418
5425
|
}
|
|
5419
5426
|
function Dt(a) {
|
|
5420
|
-
const t =
|
|
5427
|
+
const t = Xt(), e = N(a) ? F(a) : a;
|
|
5421
5428
|
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));
|
|
5422
5429
|
}
|
|
5423
|
-
function
|
|
5430
|
+
function Ni(a) {
|
|
5424
5431
|
let t = $(a);
|
|
5425
5432
|
for (; K(t) && !Q(t); ) {
|
|
5426
5433
|
if (Dt(t))
|
|
@@ -5431,17 +5438,17 @@ function Xi(a) {
|
|
|
5431
5438
|
}
|
|
5432
5439
|
return null;
|
|
5433
5440
|
}
|
|
5434
|
-
function
|
|
5441
|
+
function Xt() {
|
|
5435
5442
|
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
5436
5443
|
}
|
|
5437
5444
|
function Q(a) {
|
|
5438
5445
|
return ["html", "body", "#document"].includes(tt(a));
|
|
5439
5446
|
}
|
|
5440
5447
|
function F(a) {
|
|
5441
|
-
return
|
|
5448
|
+
return X(a).getComputedStyle(a);
|
|
5442
5449
|
}
|
|
5443
5450
|
function pt(a) {
|
|
5444
|
-
return
|
|
5451
|
+
return N(a) ? {
|
|
5445
5452
|
scrollLeft: a.scrollLeft,
|
|
5446
5453
|
scrollTop: a.scrollTop
|
|
5447
5454
|
} : {
|
|
@@ -5468,7 +5475,7 @@ function de(a) {
|
|
|
5468
5475
|
function Lt(a, t, e) {
|
|
5469
5476
|
var i;
|
|
5470
5477
|
t === void 0 && (t = []), e === void 0 && (e = !0);
|
|
5471
|
-
const s = de(a), r = s === ((i = a.ownerDocument) == null ? void 0 : i.body), o =
|
|
5478
|
+
const s = de(a), r = s === ((i = a.ownerDocument) == null ? void 0 : i.body), o = X(s);
|
|
5472
5479
|
if (r) {
|
|
5473
5480
|
const n = St(o);
|
|
5474
5481
|
return t.concat(o, o.visualViewport || [], ht(s) ? s : [], n && e ? Lt(n) : []);
|
|
@@ -5488,11 +5495,11 @@ function fe(a) {
|
|
|
5488
5495
|
$: n
|
|
5489
5496
|
};
|
|
5490
5497
|
}
|
|
5491
|
-
function
|
|
5492
|
-
return
|
|
5498
|
+
function ue(a) {
|
|
5499
|
+
return N(a) ? a : a.contextElement;
|
|
5493
5500
|
}
|
|
5494
5501
|
function Z(a) {
|
|
5495
|
-
const t =
|
|
5502
|
+
const t = ue(a);
|
|
5496
5503
|
if (!K(t))
|
|
5497
5504
|
return z(1);
|
|
5498
5505
|
const e = t.getBoundingClientRect(), {
|
|
@@ -5507,32 +5514,32 @@ function Z(a) {
|
|
|
5507
5514
|
};
|
|
5508
5515
|
}
|
|
5509
5516
|
const Fi = /* @__PURE__ */ z(0);
|
|
5510
|
-
function
|
|
5511
|
-
const t =
|
|
5512
|
-
return !
|
|
5517
|
+
function xe(a) {
|
|
5518
|
+
const t = X(a);
|
|
5519
|
+
return !Xt() || !t.visualViewport ? Fi : {
|
|
5513
5520
|
x: t.visualViewport.offsetLeft,
|
|
5514
5521
|
y: t.visualViewport.offsetTop
|
|
5515
5522
|
};
|
|
5516
5523
|
}
|
|
5517
5524
|
function Bi(a, t, e) {
|
|
5518
|
-
return t === void 0 && (t = !1), !e || t && e !==
|
|
5525
|
+
return t === void 0 && (t = !1), !e || t && e !== X(a) ? !1 : t;
|
|
5519
5526
|
}
|
|
5520
5527
|
function ot(a, t, e, i) {
|
|
5521
5528
|
t === void 0 && (t = !1), e === void 0 && (e = !1);
|
|
5522
|
-
const s = a.getBoundingClientRect(), r =
|
|
5529
|
+
const s = a.getBoundingClientRect(), r = ue(a);
|
|
5523
5530
|
let o = z(1);
|
|
5524
|
-
t && (i ?
|
|
5525
|
-
const n = Bi(r, e, i) ?
|
|
5531
|
+
t && (i ? N(i) && (o = Z(i)) : o = Z(a));
|
|
5532
|
+
const n = Bi(r, e, i) ? xe(r) : z(0);
|
|
5526
5533
|
let h = (s.left + n.x) / o.x, c = (s.top + n.y) / o.y, d = s.width / o.x, f = s.height / o.y;
|
|
5527
5534
|
if (r) {
|
|
5528
|
-
const
|
|
5529
|
-
let
|
|
5530
|
-
for (;
|
|
5531
|
-
const w = Z(
|
|
5532
|
-
h *= w.x, c *= w.y, d *= w.x, f *= w.y, h += y, c += b,
|
|
5535
|
+
const u = X(r), g = i && N(i) ? X(i) : i;
|
|
5536
|
+
let m = u, x = St(m);
|
|
5537
|
+
for (; x && i && g !== m; ) {
|
|
5538
|
+
const w = Z(x), p = x.getBoundingClientRect(), C = F(x), y = p.left + (x.clientLeft + parseFloat(C.paddingLeft)) * w.x, b = p.top + (x.clientTop + parseFloat(C.paddingTop)) * w.y;
|
|
5539
|
+
h *= w.x, c *= w.y, d *= w.x, f *= w.y, h += y, c += b, m = X(x), x = St(m);
|
|
5533
5540
|
}
|
|
5534
5541
|
}
|
|
5535
|
-
return
|
|
5542
|
+
return xt({
|
|
5536
5543
|
width: d,
|
|
5537
5544
|
height: f,
|
|
5538
5545
|
x: h,
|
|
@@ -5555,8 +5562,8 @@ function ki(a) {
|
|
|
5555
5562
|
}, c = z(1);
|
|
5556
5563
|
const d = z(0), f = K(i);
|
|
5557
5564
|
if ((f || !f && !r) && ((tt(i) !== "body" || ht(o)) && (h = pt(i)), K(i))) {
|
|
5558
|
-
const
|
|
5559
|
-
c = Z(i), d.x =
|
|
5565
|
+
const u = ot(i);
|
|
5566
|
+
c = Z(i), d.x = u.x + i.clientLeft, d.y = u.y + i.clientTop;
|
|
5560
5567
|
}
|
|
5561
5568
|
return {
|
|
5562
5569
|
width: e.width * c.x,
|
|
@@ -5568,13 +5575,13 @@ function ki(a) {
|
|
|
5568
5575
|
function Ki(a) {
|
|
5569
5576
|
return Array.from(a.getClientRects());
|
|
5570
5577
|
}
|
|
5571
|
-
function
|
|
5578
|
+
function Tt(a, t) {
|
|
5572
5579
|
const e = pt(a).scrollLeft;
|
|
5573
5580
|
return t ? t.left + e : ot(V(a)).left + e;
|
|
5574
5581
|
}
|
|
5575
5582
|
function Yi(a) {
|
|
5576
5583
|
const t = V(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);
|
|
5577
|
-
let o = -e.scrollLeft +
|
|
5584
|
+
let o = -e.scrollLeft + Tt(a);
|
|
5578
5585
|
const n = -e.scrollTop;
|
|
5579
5586
|
return F(i).direction === "rtl" && (o += U(t.clientWidth, i.clientWidth) - s), {
|
|
5580
5587
|
width: s,
|
|
@@ -5584,11 +5591,11 @@ function Yi(a) {
|
|
|
5584
5591
|
};
|
|
5585
5592
|
}
|
|
5586
5593
|
function Vi(a, t) {
|
|
5587
|
-
const e =
|
|
5594
|
+
const e = X(a), i = V(a), s = e.visualViewport;
|
|
5588
5595
|
let r = i.clientWidth, o = i.clientHeight, n = 0, h = 0;
|
|
5589
5596
|
if (s) {
|
|
5590
5597
|
r = s.width, o = s.height;
|
|
5591
|
-
const c =
|
|
5598
|
+
const c = Xt();
|
|
5592
5599
|
(!c || c && t === "fixed") && (n = s.offsetLeft, h = s.offsetTop);
|
|
5593
5600
|
}
|
|
5594
5601
|
return {
|
|
@@ -5613,30 +5620,30 @@ function Gt(a, t, e) {
|
|
|
5613
5620
|
i = Vi(a, e);
|
|
5614
5621
|
else if (t === "document")
|
|
5615
5622
|
i = Yi(V(a));
|
|
5616
|
-
else if (
|
|
5623
|
+
else if (N(t))
|
|
5617
5624
|
i = Wi(t, e);
|
|
5618
5625
|
else {
|
|
5619
|
-
const s =
|
|
5626
|
+
const s = xe(a);
|
|
5620
5627
|
i = {
|
|
5621
5628
|
...t,
|
|
5622
5629
|
x: t.x - s.x,
|
|
5623
5630
|
y: t.y - s.y
|
|
5624
5631
|
};
|
|
5625
5632
|
}
|
|
5626
|
-
return
|
|
5633
|
+
return xt(i);
|
|
5627
5634
|
}
|
|
5628
5635
|
function ge(a, t) {
|
|
5629
5636
|
const e = $(a);
|
|
5630
|
-
return e === t || !
|
|
5637
|
+
return e === t || !N(e) || Q(e) ? !1 : F(e).position === "fixed" || ge(e, t);
|
|
5631
5638
|
}
|
|
5632
5639
|
function Pi(a, t) {
|
|
5633
5640
|
const e = t.get(a);
|
|
5634
5641
|
if (e)
|
|
5635
5642
|
return e;
|
|
5636
|
-
let i = Lt(a, [], !1).filter((n) =>
|
|
5643
|
+
let i = Lt(a, [], !1).filter((n) => N(n) && tt(n) !== "body"), s = null;
|
|
5637
5644
|
const r = F(a).position === "fixed";
|
|
5638
5645
|
let o = r ? $(a) : a;
|
|
5639
|
-
for (;
|
|
5646
|
+
for (; N(o) && !Q(o); ) {
|
|
5640
5647
|
const n = F(o), h = Dt(o);
|
|
5641
5648
|
!h && n.position === "fixed" && (s = null), (r ? !h && !s : !h && n.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || ht(o) && !h && ge(a, o)) ? i = i.filter((d) => d !== o) : s = n, o = $(o);
|
|
5642
5649
|
}
|
|
@@ -5681,17 +5688,17 @@ function qi(a, t, e) {
|
|
|
5681
5688
|
if ((tt(t) !== "body" || ht(s)) && (n = pt(t)), i) {
|
|
5682
5689
|
const g = ot(t, !0, r, t);
|
|
5683
5690
|
h.x = g.x + t.clientLeft, h.y = g.y + t.clientTop;
|
|
5684
|
-
} else s && (h.x =
|
|
5691
|
+
} else s && (h.x = Tt(s));
|
|
5685
5692
|
let c = 0, d = 0;
|
|
5686
5693
|
if (s && !i && !r) {
|
|
5687
5694
|
const g = s.getBoundingClientRect();
|
|
5688
5695
|
d = g.top + n.scrollTop, c = g.left + n.scrollLeft - // RTL <body> scrollbar.
|
|
5689
|
-
|
|
5696
|
+
Tt(s, g);
|
|
5690
5697
|
}
|
|
5691
|
-
const f = o.left + n.scrollLeft - h.x - c,
|
|
5698
|
+
const f = o.left + n.scrollLeft - h.x - c, u = o.top + n.scrollTop - h.y - d;
|
|
5692
5699
|
return {
|
|
5693
5700
|
x: f,
|
|
5694
|
-
y:
|
|
5701
|
+
y: u,
|
|
5695
5702
|
width: o.width,
|
|
5696
5703
|
height: o.height
|
|
5697
5704
|
};
|
|
@@ -5708,22 +5715,22 @@ function jt(a, t) {
|
|
|
5708
5715
|
return V(a) === e && (e = e.ownerDocument.body), e;
|
|
5709
5716
|
}
|
|
5710
5717
|
function we(a, t) {
|
|
5711
|
-
const e =
|
|
5718
|
+
const e = X(a);
|
|
5712
5719
|
if (wt(a))
|
|
5713
5720
|
return e;
|
|
5714
5721
|
if (!K(a)) {
|
|
5715
5722
|
let s = $(a);
|
|
5716
5723
|
for (; s && !Q(s); ) {
|
|
5717
|
-
if (
|
|
5724
|
+
if (N(s) && !yt(s))
|
|
5718
5725
|
return s;
|
|
5719
5726
|
s = $(s);
|
|
5720
5727
|
}
|
|
5721
5728
|
return e;
|
|
5722
5729
|
}
|
|
5723
5730
|
let i = jt(a, t);
|
|
5724
|
-
for (; i &&
|
|
5731
|
+
for (; i && Xi(i) && yt(i); )
|
|
5725
5732
|
i = jt(i, t);
|
|
5726
|
-
return i && Q(i) && yt(i) && !Dt(i) ? e : i ||
|
|
5733
|
+
return i && Q(i) && yt(i) && !Dt(i) ? e : i || Ni(a) || e;
|
|
5727
5734
|
}
|
|
5728
5735
|
const Gi = async function(a) {
|
|
5729
5736
|
const t = this.getOffsetParent || we, e = this.getDimensions, i = await e(a.floating);
|
|
@@ -5749,9 +5756,9 @@ const Ui = {
|
|
|
5749
5756
|
getClientRects: Ki,
|
|
5750
5757
|
getDimensions: $i,
|
|
5751
5758
|
getScale: Z,
|
|
5752
|
-
isElement:
|
|
5759
|
+
isElement: N,
|
|
5753
5760
|
isRTL: ji
|
|
5754
|
-
}, pe = Hi, me = Di, ye =
|
|
5761
|
+
}, pe = Hi, me = Di, ye = Ai, Zi = Ti, Ee = (a, t, e) => {
|
|
5755
5762
|
const i = /* @__PURE__ */ new Map(), s = {
|
|
5756
5763
|
platform: Ui,
|
|
5757
5764
|
...e
|
|
@@ -5843,26 +5850,26 @@ let Ji = class {
|
|
|
5843
5850
|
top: `${c}px`,
|
|
5844
5851
|
left: `${h}px`
|
|
5845
5852
|
}), f.arrow) {
|
|
5846
|
-
const
|
|
5853
|
+
const u = f.arrow;
|
|
5847
5854
|
["left", "left-start", "left-end"].includes(d) ? Object.assign(this.arrowEl.style, {
|
|
5848
|
-
top: `${
|
|
5855
|
+
top: `${u.y}px`,
|
|
5849
5856
|
bottom: "",
|
|
5850
5857
|
left: "",
|
|
5851
5858
|
right: "-5px"
|
|
5852
5859
|
}) : ["right", "right-start", "right-end"].includes(d) ? Object.assign(this.arrowEl.style, {
|
|
5853
|
-
top: `${
|
|
5860
|
+
top: `${u.y}px`,
|
|
5854
5861
|
bottom: "",
|
|
5855
5862
|
left: "-5px",
|
|
5856
5863
|
right: ""
|
|
5857
5864
|
}) : ["bottom", "bottom-start", "bottom-end"].includes(d) ? Object.assign(this.arrowEl.style, {
|
|
5858
5865
|
top: "-5px",
|
|
5859
5866
|
bottom: "",
|
|
5860
|
-
left: `${
|
|
5867
|
+
left: `${u.x}px`,
|
|
5861
5868
|
right: ""
|
|
5862
5869
|
}) : ["top", "top-start", "top-end"].includes(d) && Object.assign(this.arrowEl.style, {
|
|
5863
5870
|
top: "",
|
|
5864
5871
|
bottom: "-5px",
|
|
5865
|
-
left: `${
|
|
5872
|
+
left: `${u.x}px`,
|
|
5866
5873
|
right: ""
|
|
5867
5874
|
});
|
|
5868
5875
|
}
|
|
@@ -6026,8 +6033,8 @@ class Qi {
|
|
|
6026
6033
|
let f = this.ctx.body.visibleHeight;
|
|
6027
6034
|
if (r > f && (r = f), this.editorEl.style.display = "inline-block", this.editorEl.style.left = `${this.drawX - 1}px`, this.editorEl.style.top = `${this.drawY - 1}px`, this.editorEl.style.bottom = "auto", this.editorEl.style.maxHeight = `${f}px`, s === "text") {
|
|
6028
6035
|
this.inputEl.style.display = "block", this.inputEl.style.minWidth = `${o - 1}px`, this.inputEl.style.minHeight = `${r - 1}px`, this.inputEl.style.maxHeight = `${f}px`, this.inputEl.style.width = `${o - 1}px`, this.inputEl.style.height = "auto", this.inputEl.style.padding = `${c}px`, i !== null && (this.inputEl.value = i), this.inputEl.focus({ preventScroll: !0 });
|
|
6029
|
-
const
|
|
6030
|
-
this.inputEl.setSelectionRange(
|
|
6036
|
+
const u = this.inputEl.value.length;
|
|
6037
|
+
this.inputEl.setSelectionRange(u, u);
|
|
6031
6038
|
} else
|
|
6032
6039
|
this.inputEl.style.display = "none";
|
|
6033
6040
|
(this.inputEl.scrollHeight > r || this.drawY < d.height) && this.autoSize();
|
|
@@ -6134,7 +6141,7 @@ class es {
|
|
|
6134
6141
|
n.forEach((w) => {
|
|
6135
6142
|
w.render && (w.fixed === "left" ? c.push(w) : w.fixed === "right" ? d.push(w) : h.push(w));
|
|
6136
6143
|
});
|
|
6137
|
-
const f = e - i,
|
|
6144
|
+
const f = e - i, u = {
|
|
6138
6145
|
key: "left",
|
|
6139
6146
|
style: {
|
|
6140
6147
|
position: "absolute",
|
|
@@ -6156,7 +6163,7 @@ class es {
|
|
|
6156
6163
|
height: `${o}px`
|
|
6157
6164
|
},
|
|
6158
6165
|
cells: h
|
|
6159
|
-
},
|
|
6166
|
+
}, m = {
|
|
6160
6167
|
key: "right",
|
|
6161
6168
|
style: {
|
|
6162
6169
|
position: "absolute",
|
|
@@ -6177,22 +6184,22 @@ class es {
|
|
|
6177
6184
|
width: `${r}px`,
|
|
6178
6185
|
height: `${o}px`
|
|
6179
6186
|
},
|
|
6180
|
-
views: [
|
|
6187
|
+
views: [u, g, m]
|
|
6181
6188
|
};
|
|
6182
6189
|
}
|
|
6183
6190
|
getBody() {
|
|
6184
6191
|
const t = [], e = [], i = [];
|
|
6185
6192
|
let s = this.ctx.body.renderRows;
|
|
6186
6193
|
this.ctx.config.FOOTER_FIXED || (s = s.concat(this.ctx.footer.renderRows)), s.forEach((w) => {
|
|
6187
|
-
w.cells.forEach((
|
|
6188
|
-
|
|
6194
|
+
w.cells.forEach((p) => {
|
|
6195
|
+
p.cellType === "footer" && (p.render = p.renderFooter), p.render && (p.fixed === "left" ? e.push(p) : p.fixed === "right" ? i.push(p) : t.push(p));
|
|
6189
6196
|
});
|
|
6190
6197
|
});
|
|
6191
6198
|
const {
|
|
6192
6199
|
fixedLeftWidth: r,
|
|
6193
6200
|
fixedRightWidth: o,
|
|
6194
6201
|
config: { SCROLLER_TRACK_SIZE: n, CSS_PREFIX: h }
|
|
6195
|
-
} = this.ctx, { visibleWidth: c, visibleHeight: d } = this.ctx.body, f = o - n,
|
|
6202
|
+
} = this.ctx, { visibleWidth: c, visibleHeight: d } = this.ctx.body, f = o - n, u = {
|
|
6196
6203
|
key: "left",
|
|
6197
6204
|
style: {
|
|
6198
6205
|
position: "absolute",
|
|
@@ -6214,7 +6221,7 @@ class es {
|
|
|
6214
6221
|
height: `${d}px`
|
|
6215
6222
|
},
|
|
6216
6223
|
cells: t
|
|
6217
|
-
},
|
|
6224
|
+
}, m = {
|
|
6218
6225
|
key: "right",
|
|
6219
6226
|
style: {
|
|
6220
6227
|
position: "absolute",
|
|
@@ -6235,13 +6242,13 @@ class es {
|
|
|
6235
6242
|
width: `${c}px`,
|
|
6236
6243
|
height: `${d}px`
|
|
6237
6244
|
},
|
|
6238
|
-
views: [
|
|
6245
|
+
views: [u, g, m]
|
|
6239
6246
|
};
|
|
6240
6247
|
}
|
|
6241
6248
|
getFooter() {
|
|
6242
6249
|
const t = [], e = [], i = [];
|
|
6243
|
-
this.ctx.footer.renderRows.forEach((
|
|
6244
|
-
|
|
6250
|
+
this.ctx.footer.renderRows.forEach((x) => {
|
|
6251
|
+
x.cells.forEach((w) => {
|
|
6245
6252
|
w.cellType === "footer" && w.renderFooter && (w.render = w.renderFooter, w.fixed === "left" ? e.push(w) : w.fixed === "right" ? i.push(w) : t.push(w));
|
|
6246
6253
|
});
|
|
6247
6254
|
});
|
|
@@ -6260,7 +6267,7 @@ class es {
|
|
|
6260
6267
|
height: `${c}px`
|
|
6261
6268
|
},
|
|
6262
6269
|
cells: e
|
|
6263
|
-
},
|
|
6270
|
+
}, u = {
|
|
6264
6271
|
key: "center",
|
|
6265
6272
|
style: {
|
|
6266
6273
|
position: "absolute",
|
|
@@ -6292,7 +6299,7 @@ class es {
|
|
|
6292
6299
|
width: `${h}px`,
|
|
6293
6300
|
height: `${c}px`
|
|
6294
6301
|
},
|
|
6295
|
-
views: [f,
|
|
6302
|
+
views: [f, u, g]
|
|
6296
6303
|
};
|
|
6297
6304
|
}
|
|
6298
6305
|
}
|
|
@@ -6309,7 +6316,7 @@ class is {
|
|
|
6309
6316
|
e.preventDefault();
|
|
6310
6317
|
const { xArr: i, yArr: s } = this.ctx.selector, [r, o] = i, [n, h] = s, { rowIndex: c, colIndex: d } = t;
|
|
6311
6318
|
c >= n && c <= h && d >= r && d <= o || this.ctx.emit("setSelectorCell", t, e);
|
|
6312
|
-
const
|
|
6319
|
+
const u = {
|
|
6313
6320
|
getBoundingClientRect: () => ({
|
|
6314
6321
|
width: 0,
|
|
6315
6322
|
height: 0,
|
|
@@ -6322,11 +6329,11 @@ class is {
|
|
|
6322
6329
|
}),
|
|
6323
6330
|
contextElement: document.body
|
|
6324
6331
|
};
|
|
6325
|
-
Ee(
|
|
6332
|
+
Ee(u, this.contextMenuEl, {
|
|
6326
6333
|
placement: "right-start",
|
|
6327
6334
|
middleware: [pe(), me(), ye()]
|
|
6328
|
-
}).then(({ x: g, y:
|
|
6329
|
-
this.show(g,
|
|
6335
|
+
}).then(({ x: g, y: m }) => {
|
|
6336
|
+
this.show(g, m);
|
|
6330
6337
|
});
|
|
6331
6338
|
}), this.ctx.on("click", this.hide.bind(this)), this.ctx.on("onScroll", this.hide.bind(this)), this.ctx.on("resize", this.hide.bind(this));
|
|
6332
6339
|
}
|