e-virt-table 1.1.4 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +4 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +351 -314
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +4 -4
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/Cell.js +65 -19
- package/dist/lib/Cell.js.map +1 -1
- package/dist/lib/Config.d.ts +1 -0
- package/dist/lib/Config.js +6 -0
- package/dist/lib/Config.js.map +1 -1
- package/dist/lib/Database.d.ts +2 -1
- package/dist/lib/Database.js +40 -6
- package/dist/lib/Database.js.map +1 -1
- package/dist/lib/Editor.js +9 -0
- package/dist/lib/Editor.js.map +1 -1
- package/dist/lib/EventTable.d.ts +2 -0
- package/dist/lib/EventTable.js +34 -8
- package/dist/lib/EventTable.js.map +1 -1
- package/dist/lib/types.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -43,13 +43,13 @@ function dt(a, t, e) {
|
|
|
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") {
|
|
@@ -69,7 +69,7 @@ function Ct(a) {
|
|
|
69
69
|
}), st(s, i);
|
|
70
70
|
}, Ct(a);
|
|
71
71
|
}
|
|
72
|
-
var
|
|
72
|
+
var _e = /%[sdj%]/g, jt = function() {
|
|
73
73
|
};
|
|
74
74
|
typeof process < "u" && process.env && process.env.NODE_ENV !== "production" && typeof window < "u" && typeof document < "u" && (jt = function(t, e) {
|
|
75
75
|
typeof console < "u" && console.warn && typeof ASYNC_VALIDATOR_NO_WARNING > "u" && e.every(function(i) {
|
|
@@ -91,7 +91,7 @@ function D(a) {
|
|
|
91
91
|
if (typeof a == "function")
|
|
92
92
|
return a.apply(null, e);
|
|
93
93
|
if (typeof a == "string") {
|
|
94
|
-
var o = a.replace(
|
|
94
|
+
var o = a.replace(_e, function(n) {
|
|
95
95
|
if (n === "%%")
|
|
96
96
|
return "%";
|
|
97
97
|
if (s >= r)
|
|
@@ -149,7 +149,7 @@ function Le(a) {
|
|
|
149
149
|
t.push.apply(t, a[e] || []);
|
|
150
150
|
}), t;
|
|
151
151
|
}
|
|
152
|
-
var
|
|
152
|
+
var kt = /* @__PURE__ */ function(a) {
|
|
153
153
|
ve(t, a);
|
|
154
154
|
function t(e, i) {
|
|
155
155
|
var s;
|
|
@@ -161,7 +161,7 @@ function Ae(a, t, e, i, s) {
|
|
|
161
161
|
if (t.first) {
|
|
162
162
|
var r = new Promise(function(x, g) {
|
|
163
163
|
var p = function(y) {
|
|
164
|
-
return i(y), y.length ? g(new
|
|
164
|
+
return i(y), y.length ? g(new kt(y, bt(y))) : x(s);
|
|
165
165
|
}, u = Le(a);
|
|
166
166
|
Xt(u, e, p);
|
|
167
167
|
});
|
|
@@ -172,7 +172,7 @@ function Ae(a, t, e, i, s) {
|
|
|
172
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(x, g) {
|
|
173
173
|
var p = function(w) {
|
|
174
174
|
if (d.push.apply(d, w), c++, c === h)
|
|
175
|
-
return i(d), d.length ? g(new
|
|
175
|
+
return i(d), d.length ? g(new kt(d, bt(d))) : x(s);
|
|
176
176
|
};
|
|
177
177
|
n.length || (i(d), x(s)), n.forEach(function(u) {
|
|
178
178
|
var w = a[u];
|
|
@@ -194,7 +194,7 @@ function Me(a, t) {
|
|
|
194
194
|
}
|
|
195
195
|
return e;
|
|
196
196
|
}
|
|
197
|
-
function
|
|
197
|
+
function Nt(a, t) {
|
|
198
198
|
return function(e) {
|
|
199
199
|
var i;
|
|
200
200
|
return a.fullFields ? i = Me(t, a.fullFields) : i = t[e.field || a.fullField], Te(e) ? (e.field = e.field || a.fullField, e.fieldValue = i, e) : {
|
|
@@ -204,7 +204,7 @@ function Bt(a, t) {
|
|
|
204
204
|
};
|
|
205
205
|
};
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function Bt(a, t) {
|
|
208
208
|
if (t) {
|
|
209
209
|
for (var e in t)
|
|
210
210
|
if (t.hasOwnProperty(e)) {
|
|
@@ -221,8 +221,8 @@ var Ut = function(t, e, i, s, r, o) {
|
|
|
221
221
|
}, ct, De = function() {
|
|
222
222
|
if (ct)
|
|
223
223
|
return ct;
|
|
224
|
-
var a = "[a-fA-F\\d:]", t = function(
|
|
225
|
-
return
|
|
224
|
+
var a = "[a-fA-F\\d:]", t = function(C) {
|
|
225
|
+
return C && C.includeBoundaries ? "(?:(?<=\\s|^)(?=" + a + ")|(?<=" + a + ")(?=\\s|$))" : "";
|
|
226
226
|
}, e = "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}", i = "[a-fA-F\\d]{1,4}", s = (`
|
|
227
227
|
(?:
|
|
228
228
|
(?:` + i + ":){7}(?:" + i + `|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
|
|
@@ -234,16 +234,16 @@ var Ut = function(t, e, i, s, r, o) {
|
|
|
234
234
|
(?:` + i + ":){1}(?:(?::" + i + "){0,4}:" + e + "|(?::" + i + `){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
|
|
235
235
|
(?::(?:(?::` + i + "){0,5}:" + e + "|(?::" + i + `){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
|
|
236
236
|
)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
|
|
237
|
-
`).replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(), r = new RegExp("(?:^" + e + "$)|(?:^" + s + "$)"), o = new RegExp("^" + e + "$"), n = new RegExp("^" + s + "$"), h = function(
|
|
238
|
-
return
|
|
237
|
+
`).replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(), r = new RegExp("(?:^" + e + "$)|(?:^" + s + "$)"), o = new RegExp("^" + e + "$"), n = new RegExp("^" + s + "$"), h = function(C) {
|
|
238
|
+
return C && C.exact ? r : new RegExp("(?:" + t(C) + e + t(C) + ")|(?:" + t(C) + s + t(C) + ")", "g");
|
|
239
239
|
};
|
|
240
240
|
h.v4 = function(m) {
|
|
241
241
|
return m && m.exact ? o : new RegExp("" + t(m) + e + t(m), "g");
|
|
242
242
|
}, h.v6 = function(m) {
|
|
243
243
|
return m && m.exact ? n : new RegExp("" + t(m) + s + t(m), "g");
|
|
244
244
|
};
|
|
245
|
-
var c = "(?:(?:[a-z]+:)?//)", d = "(?:\\S+(?::\\S*)?@)?", f = h.v4().source, x = h.v6().source, g = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", p = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", u = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", w = "(?::\\d{2,5})?", y = '(?:[/?#][^\\s"]*)?',
|
|
246
|
-
return ct = new RegExp("(?:^" +
|
|
245
|
+
var c = "(?:(?:[a-z]+:)?//)", d = "(?:\\S+(?::\\S*)?@)?", f = h.v4().source, x = h.v6().source, g = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", p = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", u = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", w = "(?::\\d{2,5})?", y = '(?:[/?#][^\\s"]*)?', E = "(?:" + c + "|www\\.)" + d + "(?:localhost|" + f + "|" + x + "|" + g + p + u + ")" + w + y;
|
|
246
|
+
return ct = new RegExp("(?:^" + E + "$)", "i"), ct;
|
|
247
247
|
}, Kt = {
|
|
248
248
|
// http://emailregex.com/
|
|
249
249
|
email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,
|
|
@@ -304,9 +304,9 @@ var Ut = function(t, e, i, s, r, o) {
|
|
|
304
304
|
if (x ? f = "number" : g ? f = "string" : p && (f = "array"), !f)
|
|
305
305
|
return !1;
|
|
306
306
|
p && (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
|
-
}, j = "enum",
|
|
307
|
+
}, j = "enum", ke = 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
|
+
}, Ne = function(t, e, i, s, r) {
|
|
310
310
|
if (t.pattern) {
|
|
311
311
|
if (t.pattern instanceof RegExp)
|
|
312
312
|
t.pattern.lastIndex = 0, t.pattern.test(e) || s.push(D(r.messages.pattern.mismatch, t.fullField, e, t.pattern));
|
|
@@ -315,19 +315,19 @@ var Ut = 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
|
+
}, _ = {
|
|
319
319
|
required: Ut,
|
|
320
320
|
whitespace: He,
|
|
321
321
|
type: Fe,
|
|
322
322
|
range: Xe,
|
|
323
|
-
enum:
|
|
324
|
-
pattern:
|
|
325
|
-
},
|
|
323
|
+
enum: ke,
|
|
324
|
+
pattern: Ne
|
|
325
|
+
}, Be = function(t, e, i, s, r) {
|
|
326
326
|
var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
327
327
|
if (n) {
|
|
328
328
|
if (H(e, "string") && !t.required)
|
|
329
329
|
return i();
|
|
330
|
-
|
|
330
|
+
_.required(t, e, s, o, r, "string"), H(e, "string") || (_.type(t, e, s, o, r), _.range(t, e, s, o, r), _.pattern(t, e, s, o, r), t.whitespace === !0 && _.whitespace(t, e, s, o, r));
|
|
331
331
|
}
|
|
332
332
|
i(o);
|
|
333
333
|
}, Ke = function(t, e, i, s, r) {
|
|
@@ -335,7 +335,7 @@ var Ut = function(t, e, i, s, r, o) {
|
|
|
335
335
|
if (n) {
|
|
336
336
|
if (H(e) && !t.required)
|
|
337
337
|
return i();
|
|
338
|
-
|
|
338
|
+
_.required(t, e, s, o, r), e !== void 0 && _.type(t, e, s, o, r);
|
|
339
339
|
}
|
|
340
340
|
i(o);
|
|
341
341
|
}, Ye = function(t, e, i, s, r) {
|
|
@@ -343,7 +343,7 @@ var Ut = 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
|
+
_.required(t, e, s, o, r), e !== void 0 && (_.type(t, e, s, o, r), _.range(t, e, s, o, r));
|
|
347
347
|
}
|
|
348
348
|
i(o);
|
|
349
349
|
}, Ve = function(t, e, i, s, r) {
|
|
@@ -351,7 +351,7 @@ var Ut = function(t, e, i, s, r, o) {
|
|
|
351
351
|
if (n) {
|
|
352
352
|
if (H(e) && !t.required)
|
|
353
353
|
return i();
|
|
354
|
-
|
|
354
|
+
_.required(t, e, s, o, r), e !== void 0 && _.type(t, e, s, o, r);
|
|
355
355
|
}
|
|
356
356
|
i(o);
|
|
357
357
|
}, We = function(t, e, i, s, r) {
|
|
@@ -359,7 +359,7 @@ var Ut = function(t, e, i, s, r, o) {
|
|
|
359
359
|
if (n) {
|
|
360
360
|
if (H(e) && !t.required)
|
|
361
361
|
return i();
|
|
362
|
-
|
|
362
|
+
_.required(t, e, s, o, r), H(e) || _.type(t, e, s, o, r);
|
|
363
363
|
}
|
|
364
364
|
i(o);
|
|
365
365
|
}, Pe = function(t, e, i, s, r) {
|
|
@@ -367,7 +367,7 @@ var Ut = function(t, e, i, s, r, o) {
|
|
|
367
367
|
if (n) {
|
|
368
368
|
if (H(e) && !t.required)
|
|
369
369
|
return i();
|
|
370
|
-
|
|
370
|
+
_.required(t, e, s, o, r), e !== void 0 && (_.type(t, e, s, o, r), _.range(t, e, s, o, r));
|
|
371
371
|
}
|
|
372
372
|
i(o);
|
|
373
373
|
}, ze = function(t, e, i, s, r) {
|
|
@@ -375,7 +375,7 @@ var Ut = function(t, e, i, s, r, o) {
|
|
|
375
375
|
if (n) {
|
|
376
376
|
if (H(e) && !t.required)
|
|
377
377
|
return i();
|
|
378
|
-
|
|
378
|
+
_.required(t, e, s, o, r), e !== void 0 && (_.type(t, e, s, o, r), _.range(t, e, s, o, r));
|
|
379
379
|
}
|
|
380
380
|
i(o);
|
|
381
381
|
}, $e = function(t, e, i, s, r) {
|
|
@@ -383,7 +383,7 @@ var Ut = function(t, e, i, s, r, o) {
|
|
|
383
383
|
if (n) {
|
|
384
384
|
if (e == null && !t.required)
|
|
385
385
|
return i();
|
|
386
|
-
|
|
386
|
+
_.required(t, e, s, o, r, "array"), e != null && (_.type(t, e, s, o, r), _.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 Ut = function(t, e, i, s, r, o) {
|
|
|
391
391
|
if (n) {
|
|
392
392
|
if (H(e) && !t.required)
|
|
393
393
|
return i();
|
|
394
|
-
|
|
394
|
+
_.required(t, e, s, o, r), e !== void 0 && _.type(t, e, s, o, r);
|
|
395
395
|
}
|
|
396
396
|
i(o);
|
|
397
397
|
}, qe = "enum", je = function(t, e, i, s, r) {
|
|
@@ -399,7 +399,7 @@ var Ut = function(t, e, i, s, r, o) {
|
|
|
399
399
|
if (n) {
|
|
400
400
|
if (H(e) && !t.required)
|
|
401
401
|
return i();
|
|
402
|
-
|
|
402
|
+
_.required(t, e, s, o, r), e !== void 0 && _[qe](t, e, s, o, r);
|
|
403
403
|
}
|
|
404
404
|
i(o);
|
|
405
405
|
}, Ue = function(t, e, i, s, r) {
|
|
@@ -407,7 +407,7 @@ var Ut = 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
|
+
_.required(t, e, s, o, r), H(e, "string") || _.pattern(t, e, s, o, r);
|
|
411
411
|
}
|
|
412
412
|
i(o);
|
|
413
413
|
}, Ze = function(t, e, i, s, r) {
|
|
@@ -415,21 +415,21 @@ var Ut = 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 (_.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), _.type(t, h, s, o, r), h && _.range(t, h.getTime(), s, o, r);
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
423
|
i(o);
|
|
424
424
|
}, Je = function(t, e, i, s, r) {
|
|
425
425
|
var o = [], n = Array.isArray(e) ? "array" : typeof e;
|
|
426
|
-
|
|
426
|
+
_.required(t, e, s, o, r, n), i(o);
|
|
427
427
|
}, yt = 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
|
+
_.required(t, e, s, n, r, o), H(e, o) || _.type(t, e, s, n, r);
|
|
433
433
|
}
|
|
434
434
|
i(n);
|
|
435
435
|
}, Qe = function(t, e, i, s, r) {
|
|
@@ -437,11 +437,11 @@ var Ut = function(t, e, i, s, r, o) {
|
|
|
437
437
|
if (n) {
|
|
438
438
|
if (H(e) && !t.required)
|
|
439
439
|
return i();
|
|
440
|
-
|
|
440
|
+
_.required(t, e, s, o, r);
|
|
441
441
|
}
|
|
442
442
|
i(o);
|
|
443
443
|
}, it = {
|
|
444
|
-
string:
|
|
444
|
+
string: Be,
|
|
445
445
|
method: Ke,
|
|
446
446
|
number: Ye,
|
|
447
447
|
boolean: Ve,
|
|
@@ -528,7 +528,7 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
528
528
|
s.rules[r] = Array.isArray(o) ? o : [o];
|
|
529
529
|
});
|
|
530
530
|
}, t.messages = function(i) {
|
|
531
|
-
return i && (this._messages =
|
|
531
|
+
return i && (this._messages = Bt(vt(), i)), this._messages;
|
|
532
532
|
}, t.validate = function(i, s, r) {
|
|
533
533
|
var o = this;
|
|
534
534
|
s === void 0 && (s = {}), r === void 0 && (r = function() {
|
|
@@ -538,27 +538,27 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
538
538
|
return c && c(null, n), Promise.resolve(n);
|
|
539
539
|
function d(u) {
|
|
540
540
|
var w = [], y = {};
|
|
541
|
-
function C
|
|
542
|
-
if (Array.isArray(
|
|
541
|
+
function E(C) {
|
|
542
|
+
if (Array.isArray(C)) {
|
|
543
543
|
var b;
|
|
544
|
-
w = (b = w).concat.apply(b,
|
|
544
|
+
w = (b = w).concat.apply(b, C);
|
|
545
545
|
} else
|
|
546
|
-
w.push(
|
|
546
|
+
w.push(C);
|
|
547
547
|
}
|
|
548
548
|
for (var m = 0; m < u.length; m++)
|
|
549
|
-
|
|
549
|
+
E(u[m]);
|
|
550
550
|
w.length ? (y = bt(w), c(w, y)) : c(null, n);
|
|
551
551
|
}
|
|
552
552
|
if (h.messages) {
|
|
553
553
|
var f = this.messages();
|
|
554
|
-
f === Rt && (f = vt()),
|
|
554
|
+
f === Rt && (f = vt()), Bt(f, h.messages), h.messages = f;
|
|
555
555
|
} else
|
|
556
556
|
h.messages = this.messages();
|
|
557
557
|
var x = {}, g = h.keys || Object.keys(this.rules);
|
|
558
558
|
g.forEach(function(u) {
|
|
559
559
|
var w = o.rules[u], y = n[u];
|
|
560
|
-
w.forEach(function(
|
|
561
|
-
var m =
|
|
560
|
+
w.forEach(function(E) {
|
|
561
|
+
var m = E;
|
|
562
562
|
typeof m.transform == "function" && (n === i && (n = G({}, n)), y = n[u] = m.transform(y)), typeof m == "function" ? m = {
|
|
563
563
|
validator: m
|
|
564
564
|
} : m = G({}, m), m.validator = o.getValidationMethod(m), m.validator && (m.field = u, m.fullField = m.fullField || u, m.type = o.getType(m), x[u] = x[u] || [], x[u].push({
|
|
@@ -571,36 +571,36 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
571
571
|
});
|
|
572
572
|
var p = {};
|
|
573
573
|
return Ae(x, h, function(u, w) {
|
|
574
|
-
var y = u.rule,
|
|
575
|
-
|
|
576
|
-
function m(
|
|
574
|
+
var y = u.rule, E = (y.type === "object" || y.type === "array") && (typeof y.fields == "object" || typeof y.defaultField == "object");
|
|
575
|
+
E = E && (y.required || !y.required && u.value), y.field = u.field;
|
|
576
|
+
function m(v, O) {
|
|
577
577
|
return G({}, O, {
|
|
578
|
-
fullField: y.fullField + "." +
|
|
579
|
-
fullFields: y.fullFields ? [].concat(y.fullFields, [
|
|
578
|
+
fullField: y.fullField + "." + v,
|
|
579
|
+
fullFields: y.fullFields ? [].concat(y.fullFields, [v]) : [v]
|
|
580
580
|
});
|
|
581
581
|
}
|
|
582
|
-
function
|
|
583
|
-
|
|
584
|
-
var O = Array.isArray(
|
|
582
|
+
function C(v) {
|
|
583
|
+
v === void 0 && (v = []);
|
|
584
|
+
var O = Array.isArray(v) ? v : [v];
|
|
585
585
|
!h.suppressWarning && O.length && a.warning("async-validator:", O), O.length && y.message !== void 0 && (O = [].concat(y.message));
|
|
586
|
-
var L = O.map(
|
|
586
|
+
var L = O.map(Nt(y, n));
|
|
587
587
|
if (h.first && L.length)
|
|
588
588
|
return p[y.field] = 1, w(L);
|
|
589
|
-
if (!
|
|
589
|
+
if (!E)
|
|
590
590
|
w(L);
|
|
591
591
|
else {
|
|
592
592
|
if (y.required && !u.value)
|
|
593
|
-
return y.message !== void 0 ? L = [].concat(y.message).map(
|
|
594
|
-
var
|
|
593
|
+
return y.message !== void 0 ? L = [].concat(y.message).map(Nt(y, n)) : h.error && (L = [h.error(y, D(h.messages.required, y.field))]), w(L);
|
|
594
|
+
var I = {};
|
|
595
595
|
y.defaultField && Object.keys(u.value).map(function(S) {
|
|
596
|
-
|
|
597
|
-
}),
|
|
598
|
-
var
|
|
599
|
-
Object.keys(
|
|
600
|
-
var M =
|
|
601
|
-
|
|
596
|
+
I[S] = y.defaultField;
|
|
597
|
+
}), I = G({}, I, u.rule.fields);
|
|
598
|
+
var R = {};
|
|
599
|
+
Object.keys(I).forEach(function(S) {
|
|
600
|
+
var M = I[S], T = Array.isArray(M) ? M : [M];
|
|
601
|
+
R[S] = T.map(m.bind(null, S));
|
|
602
602
|
});
|
|
603
|
-
var A = new a(
|
|
603
|
+
var A = new a(R);
|
|
604
604
|
A.messages(h.messages), u.rule.options && (u.rule.options.messages = h.messages, u.rule.options.error = h.error), A.validate(u.value, u.rule.options || h, function(S) {
|
|
605
605
|
var M = [];
|
|
606
606
|
L && L.length && M.push.apply(M, L), S && S.length && M.push.apply(M, S), w(M.length ? M : null);
|
|
@@ -609,21 +609,21 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
609
609
|
}
|
|
610
610
|
var b;
|
|
611
611
|
if (y.asyncValidator)
|
|
612
|
-
b = y.asyncValidator(y, u.value,
|
|
612
|
+
b = y.asyncValidator(y, u.value, C, u.source, h);
|
|
613
613
|
else if (y.validator) {
|
|
614
614
|
try {
|
|
615
|
-
b = y.validator(y, u.value,
|
|
616
|
-
} catch (
|
|
617
|
-
console.error == null || console.error(
|
|
618
|
-
throw
|
|
619
|
-
}, 0),
|
|
615
|
+
b = y.validator(y, u.value, C, u.source, h);
|
|
616
|
+
} catch (v) {
|
|
617
|
+
console.error == null || console.error(v), h.suppressValidatorError || setTimeout(function() {
|
|
618
|
+
throw v;
|
|
619
|
+
}, 0), C(v.message);
|
|
620
620
|
}
|
|
621
|
-
b === !0 ?
|
|
621
|
+
b === !0 ? C() : b === !1 ? C(typeof y.message == "function" ? y.message(y.fullField || y.field) : y.message || (y.fullField || y.field) + " fails") : b instanceof Array ? C(b) : b instanceof Error && C(b.message);
|
|
622
622
|
}
|
|
623
623
|
b && b.then && b.then(function() {
|
|
624
|
-
return
|
|
625
|
-
}, function(
|
|
626
|
-
return
|
|
624
|
+
return C();
|
|
625
|
+
}, function(v) {
|
|
626
|
+
return C(v);
|
|
627
627
|
});
|
|
628
628
|
}, function(u) {
|
|
629
629
|
d(u);
|
|
@@ -702,10 +702,10 @@ function te(a = [], t = 1, e = 0) {
|
|
|
702
702
|
};
|
|
703
703
|
});
|
|
704
704
|
}
|
|
705
|
-
function
|
|
705
|
+
function It(a = []) {
|
|
706
706
|
let t = [];
|
|
707
707
|
return a.forEach((e) => {
|
|
708
|
-
e.children ? t = t.concat(
|
|
708
|
+
e.children ? t = t.concat(It(e.children)) : t.push(e);
|
|
709
709
|
}), t;
|
|
710
710
|
}
|
|
711
711
|
const Yt = /^(\r\n|\n\r|\r|\n)/, ei = /^[^\t\r\n]+/, Vt = /^\t/;
|
|
@@ -1048,30 +1048,35 @@ class Tt extends se {
|
|
|
1048
1048
|
STRIPE_COLOR: g
|
|
1049
1049
|
} = this.ctx.config;
|
|
1050
1050
|
if (this.cellType === "footer") {
|
|
1051
|
-
let
|
|
1051
|
+
let b = n, v = o;
|
|
1052
1052
|
if (typeof r == "function") {
|
|
1053
|
-
const
|
|
1053
|
+
const O = r, { backgroundColor: L, color: I } = O({
|
|
1054
1054
|
row: this.row,
|
|
1055
1055
|
rowIndex: this.rowIndex,
|
|
1056
1056
|
colIndex: this.colIndex,
|
|
1057
1057
|
column: this.column,
|
|
1058
1058
|
value: this.getValue()
|
|
1059
1059
|
}) || {};
|
|
1060
|
-
|
|
1060
|
+
L && (b = L), I && (v = I);
|
|
1061
1061
|
}
|
|
1062
|
-
this.drawCellSkyBgColor = "transparent", this.drawCellBgColor =
|
|
1062
|
+
this.drawCellSkyBgColor = "transparent", this.drawCellBgColor = b, this.drawTextColor = v;
|
|
1063
1063
|
return;
|
|
1064
1064
|
}
|
|
1065
1065
|
let p = "transparent";
|
|
1066
1066
|
const u = this.ctx.focusCell, w = this.ctx.hoverCell;
|
|
1067
|
-
|
|
1068
|
-
|
|
1067
|
+
let y = this.rowIndex, E = this.rowIndex;
|
|
1068
|
+
if (this.rowspan !== 1 && (d || h)) {
|
|
1069
|
+
const b = this.getSpanInfo(), { yArr: v } = b;
|
|
1070
|
+
y = v[0], E = v[1];
|
|
1071
|
+
}
|
|
1072
|
+
d && w && (w.rowKey === this.rowKey && (p = f), w.rowIndex >= y && w.rowIndex <= E && (p = f)), h && u && (u.rowKey === this.rowKey && (p = c), u.rowIndex >= y && u.rowIndex <= E && (p = c)), this.drawCellSkyBgColor = p;
|
|
1073
|
+
let m = e, C = o;
|
|
1069
1074
|
if (["index", "index-selection", "selection"].includes(this.type)) {
|
|
1070
1075
|
this.drawCellBgColor = e, this.drawTextColor = o;
|
|
1071
1076
|
return;
|
|
1072
1077
|
}
|
|
1073
|
-
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (
|
|
1074
|
-
const
|
|
1078
|
+
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (m = i, C = o), x && (this.rowIndex % 2 ? m = g : m = e), typeof s == "function") {
|
|
1079
|
+
const b = s, { backgroundColor: v, color: O } = b({
|
|
1075
1080
|
row: this.row,
|
|
1076
1081
|
rowIndex: this.rowIndex,
|
|
1077
1082
|
colIndex: this.colIndex,
|
|
@@ -1079,9 +1084,9 @@ class Tt extends se {
|
|
|
1079
1084
|
isHasChanged: this.isHasChanged,
|
|
1080
1085
|
value: this.getValue()
|
|
1081
1086
|
}) || {};
|
|
1082
|
-
|
|
1087
|
+
v && (m = v), O && (C = O);
|
|
1083
1088
|
}
|
|
1084
|
-
this.drawCellBgColor =
|
|
1089
|
+
this.drawCellBgColor = m, this.drawTextColor = C;
|
|
1085
1090
|
}
|
|
1086
1091
|
updateSelection() {
|
|
1087
1092
|
const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: r, cellType: o, type: n, rowIndex: h, rowKey: c } = this;
|
|
@@ -1092,21 +1097,31 @@ class Tt extends se {
|
|
|
1092
1097
|
}
|
|
1093
1098
|
}
|
|
1094
1099
|
updateHoverIcon() {
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1100
|
+
if (this.ctx.database.getReadonly(this.rowKey, this.key))
|
|
1101
|
+
return;
|
|
1102
|
+
const { BODY_CELL_HOVER_ICON_METHOD: i, CELL_HOVER_ICON_SIZE: s, CELL_PADDING: r, ENABLE_MERGE_CELL_LINK: o } = this.ctx.config;
|
|
1103
|
+
if (typeof i == "function") {
|
|
1104
|
+
const c = i({
|
|
1098
1105
|
row: this.row,
|
|
1099
1106
|
rowIndex: this.rowIndex,
|
|
1100
1107
|
colIndex: this.colIndex,
|
|
1101
1108
|
column: this.column,
|
|
1102
1109
|
value: this.getValue()
|
|
1103
1110
|
});
|
|
1104
|
-
|
|
1111
|
+
c !== void 0 && (this.hoverIconName = c);
|
|
1105
1112
|
}
|
|
1106
|
-
const
|
|
1107
|
-
if (this.hoverIconName && this.ctx.
|
|
1108
|
-
|
|
1109
|
-
this.
|
|
1113
|
+
const { hoverCell: n } = this.ctx;
|
|
1114
|
+
if (this.hoverIconName && !this.ctx.editing && n) {
|
|
1115
|
+
let h = 0, c = 0;
|
|
1116
|
+
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: x } = f, g = x[0], p = x[1];
|
|
1118
|
+
if (n.rowIndex >= g && n.rowIndex <= p) {
|
|
1119
|
+
const { width: u, height: w, offsetTop: y, offsetLeft: E } = f;
|
|
1120
|
+
h = this.drawX - E + u - s - r, c = this.drawY - y + (w - s) / 2;
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
const d = this.ctx.icons.get(this.hoverIconName);
|
|
1124
|
+
this.drawImageX = h, this.drawImageY = c, this.drawImageWidth = s, this.drawImageHeight = s, this.drawImageName = this.hoverIconName, this.drawImageSource = d;
|
|
1110
1125
|
}
|
|
1111
1126
|
}
|
|
1112
1127
|
// 过去跨度配置
|
|
@@ -1228,21 +1243,17 @@ class Tt extends se {
|
|
|
1228
1243
|
return s;
|
|
1229
1244
|
}
|
|
1230
1245
|
drawText() {
|
|
1231
|
-
const { CELL_PADDING: e, BODY_FONT: i } = this.ctx.config, { ellipsis:
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
verticalAlign: this.verticalAlign,
|
|
1243
|
-
color: this.drawTextColor
|
|
1244
|
-
}
|
|
1245
|
-
);
|
|
1246
|
+
const { CELL_PADDING: e, BODY_FONT: i, PLACEHOLDER_COLOR: s } = this.ctx.config, { ellipsis: r } = this.ctx.paint.handleEllipsis(this.text, this.width, e, i);
|
|
1247
|
+
this.ellipsis = r;
|
|
1248
|
+
const { placeholder: o } = this.column;
|
|
1249
|
+
let n = this.displayText, h = this.drawTextColor;
|
|
1250
|
+
return o && ["", null, void 0].includes(this.text) && this.cellType === "body" && (n = o, h = s), this.ctx.paint.drawText(n, this.drawTextX, this.drawTextY, this.visibleWidth, this.visibleHeight, {
|
|
1251
|
+
font: i,
|
|
1252
|
+
padding: e,
|
|
1253
|
+
align: this.align,
|
|
1254
|
+
verticalAlign: this.verticalAlign,
|
|
1255
|
+
color: h
|
|
1256
|
+
});
|
|
1246
1257
|
}
|
|
1247
1258
|
drawImage() {
|
|
1248
1259
|
this.drawImageSource && this.ctx.paint.drawImage(
|
|
@@ -1312,10 +1323,10 @@ class Tt extends se {
|
|
|
1312
1323
|
drawBorder(e) {
|
|
1313
1324
|
const { drawX: i, drawY: s, rowIndex: r, colIndex: o, height: n, width: h } = this;
|
|
1314
1325
|
let c = i, d = s;
|
|
1315
|
-
const { xArr: f, yArr: x, lineDash: g = [], borderWidth: p = 1, borderColor: u, fillColor: w } = e, y = f[0],
|
|
1316
|
-
if (o >= y && o <=
|
|
1317
|
-
const b = o ===
|
|
1318
|
-
this.ctx.paint.drawLine([c +
|
|
1326
|
+
const { xArr: f, yArr: x, lineDash: g = [], borderWidth: p = 1, borderColor: u, fillColor: w } = e, y = f[0], E = f[1], m = x[0], C = x[1];
|
|
1327
|
+
if (o >= y && o <= E && r === m) {
|
|
1328
|
+
const b = o === E ? 1 : 0, v = o === y ? 1 : 0;
|
|
1329
|
+
this.ctx.paint.drawLine([c + v, d + 1, c + h - b, d + 1], {
|
|
1319
1330
|
borderColor: u,
|
|
1320
1331
|
fillColor: w,
|
|
1321
1332
|
borderWidth: p,
|
|
@@ -1324,9 +1335,9 @@ class Tt extends se {
|
|
|
1324
1335
|
lineDash: g
|
|
1325
1336
|
});
|
|
1326
1337
|
}
|
|
1327
|
-
if (o ===
|
|
1328
|
-
const b = r === m ? 1 : 0,
|
|
1329
|
-
this.ctx.paint.drawLine([c + h - 1, d + b, c + h - 1, d + n -
|
|
1338
|
+
if (o === E && r >= m && r <= C) {
|
|
1339
|
+
const b = r === m ? 1 : 0, v = r === C ? 1 : 0;
|
|
1340
|
+
this.ctx.paint.drawLine([c + h - 1, d + b, c + h - 1, d + n - v], {
|
|
1330
1341
|
borderColor: u,
|
|
1331
1342
|
fillColor: w,
|
|
1332
1343
|
borderWidth: p,
|
|
@@ -1335,9 +1346,9 @@ class Tt extends se {
|
|
|
1335
1346
|
lineDash: g
|
|
1336
1347
|
});
|
|
1337
1348
|
}
|
|
1338
|
-
if (o >= y && o <=
|
|
1339
|
-
const b = o ===
|
|
1340
|
-
this.ctx.paint.drawLine([c +
|
|
1349
|
+
if (o >= y && o <= E && r === C) {
|
|
1350
|
+
const b = o === E ? 1 : 0, v = o === y ? 1 : 0;
|
|
1351
|
+
this.ctx.paint.drawLine([c + v, d + n - 1, c + h - b, d + n - 1], {
|
|
1341
1352
|
borderColor: u,
|
|
1342
1353
|
fillColor: w,
|
|
1343
1354
|
borderWidth: p,
|
|
@@ -1346,9 +1357,9 @@ class Tt extends se {
|
|
|
1346
1357
|
lineDash: g
|
|
1347
1358
|
});
|
|
1348
1359
|
}
|
|
1349
|
-
if (o === y && r >= m && r <=
|
|
1350
|
-
const b = r ===
|
|
1351
|
-
this.ctx.paint.drawLine([c + 1, d +
|
|
1360
|
+
if (o === y && r >= m && r <= C) {
|
|
1361
|
+
const b = r === C ? 1 : 0, v = r === m ? 1 : 0;
|
|
1362
|
+
this.ctx.paint.drawLine([c + 1, d + v, c + 1, d + n - b], {
|
|
1352
1363
|
borderColor: u,
|
|
1353
1364
|
fillColor: w,
|
|
1354
1365
|
borderWidth: p,
|
|
@@ -1378,6 +1389,12 @@ class ni {
|
|
|
1378
1389
|
l(this, "validationErrorMap", /* @__PURE__ */ new Map());
|
|
1379
1390
|
l(this, "itemRowKeyMap", /* @__PURE__ */ new WeakMap());
|
|
1380
1391
|
l(this, "bufferData", []);
|
|
1392
|
+
l(this, "bufferCheckState", {
|
|
1393
|
+
buffer: !1,
|
|
1394
|
+
check: !1,
|
|
1395
|
+
indeterminate: !1,
|
|
1396
|
+
selectable: !0
|
|
1397
|
+
});
|
|
1381
1398
|
l(this, "sumHeight", 0);
|
|
1382
1399
|
l(this, "filterMethod");
|
|
1383
1400
|
l(this, "positions", []);
|
|
@@ -1388,7 +1405,7 @@ class ni {
|
|
|
1388
1405
|
init() {
|
|
1389
1406
|
this.clearBufferData(), this.rowKeyMap.clear(), this.checkboxKeyMap.clear(), this.colIndexKeyMap.clear(), this.rowIndexRowKeyMap.clear(), this.originalDataMap.clear(), this.changedDataMap.clear(), this.validationErrorMap.clear(), this.itemRowKeyMap = /* @__PURE__ */ new WeakMap();
|
|
1390
1407
|
const { ROW_KEY: t, ENABLE_RESERVE_SELECTION: e } = this.ctx.config;
|
|
1391
|
-
e && t || this.selectionMap.clear(), this.initData(this.data), this.getData();
|
|
1408
|
+
e && t || this.selectionMap.clear(), this.initData(this.data), this.getData(), this.bufferCheckState.buffer = !1;
|
|
1392
1409
|
}
|
|
1393
1410
|
/**
|
|
1394
1411
|
* 清除缓存数据
|
|
@@ -1413,8 +1430,8 @@ class ni {
|
|
|
1413
1430
|
if (typeof c == "function" && (u = c), d) {
|
|
1414
1431
|
const y = i[d];
|
|
1415
1432
|
if (this.checkboxKeyMap.has(y)) {
|
|
1416
|
-
const
|
|
1417
|
-
|
|
1433
|
+
const E = this.checkboxKeyMap.get(y) || [];
|
|
1434
|
+
E.push(x), this.checkboxKeyMap.set(y, E);
|
|
1418
1435
|
} else
|
|
1419
1436
|
this.checkboxKeyMap.set(y, [x]);
|
|
1420
1437
|
}
|
|
@@ -1838,7 +1855,7 @@ class ni {
|
|
|
1838
1855
|
return;
|
|
1839
1856
|
i.check = !i.check, this.setRowSelectionByCheckboxKey(t, i.check), this.ctx.emit("toggleRowSelection", e);
|
|
1840
1857
|
const s = this.getSelectionRows();
|
|
1841
|
-
this.ctx.emit("selectionChange", s), this.ctx.emit("draw");
|
|
1858
|
+
this.ctx.emit("selectionChange", s), this.bufferCheckState.buffer = !1, this.ctx.emit("draw");
|
|
1842
1859
|
}
|
|
1843
1860
|
/**
|
|
1844
1861
|
* 根据rowKey 设置选中状态
|
|
@@ -1846,11 +1863,7 @@ class ni {
|
|
|
1846
1863
|
*/
|
|
1847
1864
|
setRowSelection(t, e, i = !0) {
|
|
1848
1865
|
const s = this.selectionMap.get(t);
|
|
1849
|
-
|
|
1850
|
-
return;
|
|
1851
|
-
s.check = e, this.setRowSelectionByCheckboxKey(t, s.check);
|
|
1852
|
-
const r = this.getSelectionRows();
|
|
1853
|
-
this.ctx.emit("setRowSelection", r), i && this.ctx.emit("draw");
|
|
1866
|
+
s && (s.check = e, this.setRowSelectionByCheckboxKey(t, s.check), this.ctx.emit("setRowSelection", e, s.row), i && (this.bufferCheckState.buffer = !1, this.ctx.emit("draw")));
|
|
1854
1867
|
}
|
|
1855
1868
|
getSelectionRows() {
|
|
1856
1869
|
let t = [];
|
|
@@ -1890,7 +1903,7 @@ class ni {
|
|
|
1890
1903
|
})), s && this.setRowSelection(i, !0, !1);
|
|
1891
1904
|
});
|
|
1892
1905
|
const t = this.getSelectionRows();
|
|
1893
|
-
this.ctx.emit("toggleAllSelection", t), this.ctx.emit("selectionChange", t), this.ctx.emit("draw");
|
|
1906
|
+
this.ctx.emit("toggleAllSelection", t), this.ctx.emit("selectionChange", t), this.bufferCheckState.buffer = !1, this.ctx.emit("draw");
|
|
1894
1907
|
}
|
|
1895
1908
|
/**
|
|
1896
1909
|
* 清除选中
|
|
@@ -1903,30 +1916,38 @@ class ni {
|
|
|
1903
1916
|
this.setRowSelection(s, !1, !1);
|
|
1904
1917
|
});
|
|
1905
1918
|
const e = this.getSelectionRows();
|
|
1906
|
-
this.ctx.emit("clearSelection"), this.ctx.emit("selectionChange", e), this.ctx.emit("draw");
|
|
1919
|
+
this.ctx.emit("clearSelection"), this.ctx.emit("selectionChange", e), this.bufferCheckState.buffer = !1, this.ctx.emit("draw");
|
|
1907
1920
|
}
|
|
1908
1921
|
/**
|
|
1909
1922
|
* 获取选中状态,表头用
|
|
1910
1923
|
* @param rowKey
|
|
1911
1924
|
*/
|
|
1912
1925
|
getCheckedState() {
|
|
1913
|
-
const t = this.
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
this.rowKeyMap.
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1926
|
+
const { buffer: t, ...e } = this.bufferCheckState;
|
|
1927
|
+
if (t)
|
|
1928
|
+
return e;
|
|
1929
|
+
const i = this.rowKeyMap.size;
|
|
1930
|
+
let s = 0, r = 0;
|
|
1931
|
+
const o = this.selectionMap.size, n = Array.from(this.selectionMap.values()).some((x) => x.check);
|
|
1932
|
+
this.rowKeyMap.forEach((x, g) => {
|
|
1933
|
+
var u;
|
|
1934
|
+
(u = this.selectionMap.get(g)) != null && u.check && (s += 1);
|
|
1935
|
+
let p = x.selectable;
|
|
1936
|
+
typeof p == "function" && (p = p({
|
|
1937
|
+
row: x.item,
|
|
1938
|
+
rowIndex: x.rowIndex
|
|
1939
|
+
})), p && (r += 1);
|
|
1924
1940
|
});
|
|
1925
|
-
const
|
|
1926
|
-
return {
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1941
|
+
const h = o > i && s === 0 && n, c = r && r > s && s > 0 || h, d = r !== 0, f = !!r && r === s;
|
|
1942
|
+
return this.bufferCheckState = {
|
|
1943
|
+
buffer: !0,
|
|
1944
|
+
check: f,
|
|
1945
|
+
indeterminate: c,
|
|
1946
|
+
selectable: d
|
|
1947
|
+
}, {
|
|
1948
|
+
check: f,
|
|
1949
|
+
indeterminate: c,
|
|
1950
|
+
selectable: d
|
|
1930
1951
|
};
|
|
1931
1952
|
}
|
|
1932
1953
|
/**
|
|
@@ -2013,7 +2034,10 @@ class ni {
|
|
|
2013
2034
|
const { DISABLED: i } = this.ctx.config;
|
|
2014
2035
|
if (i)
|
|
2015
2036
|
return !0;
|
|
2016
|
-
const s = this.rowKeyMap.get(t), r = this.headerMap.get(e)
|
|
2037
|
+
const s = this.rowKeyMap.get(t), r = this.headerMap.get(e);
|
|
2038
|
+
if (!s || !r)
|
|
2039
|
+
return !0;
|
|
2040
|
+
const o = s.readonly, n = r.readonly, { BODY_CELL_READONLY_METHOD: h } = this.ctx.config;
|
|
2017
2041
|
if (typeof h == "function" && r) {
|
|
2018
2042
|
const d = h({
|
|
2019
2043
|
row: s.item,
|
|
@@ -2129,42 +2153,42 @@ class ni {
|
|
|
2129
2153
|
}
|
|
2130
2154
|
]
|
|
2131
2155
|
};
|
|
2132
|
-
let w = e, y = e,
|
|
2156
|
+
let w = e, y = e, E = n, m = n, C = [], b = 0, v = 0, O = 0, L = 0;
|
|
2133
2157
|
if (d !== 1 && p) {
|
|
2134
2158
|
L = x;
|
|
2135
|
-
const
|
|
2159
|
+
const I = h.reduce((R, A) => {
|
|
2136
2160
|
const S = this.getItemValue(s, A) ?? "";
|
|
2137
|
-
return `${
|
|
2161
|
+
return `${R}${S}`;
|
|
2138
2162
|
}, "");
|
|
2139
|
-
for (let
|
|
2140
|
-
const A = this.rowIndexRowKeyMap.get(
|
|
2141
|
-
const
|
|
2142
|
-
return `${M}${
|
|
2163
|
+
for (let R = e - 1; R >= 0; R--) {
|
|
2164
|
+
const A = this.rowIndexRowKeyMap.get(R) || "", S = h.reduce((M, T) => {
|
|
2165
|
+
const N = this.getItemValue(A, T) ?? "";
|
|
2166
|
+
return `${M}${N}`;
|
|
2143
2167
|
}, "");
|
|
2144
|
-
if (
|
|
2145
|
-
w =
|
|
2168
|
+
if (I === S)
|
|
2169
|
+
w = R;
|
|
2146
2170
|
else
|
|
2147
2171
|
break;
|
|
2148
2172
|
}
|
|
2149
|
-
for (let
|
|
2150
|
-
const A = this.rowIndexRowKeyMap.get(
|
|
2151
|
-
const
|
|
2152
|
-
return `${M}${
|
|
2173
|
+
for (let R = e; R <= this.ctx.maxRowIndex; R++) {
|
|
2174
|
+
const A = this.rowIndexRowKeyMap.get(R) || "", S = h.reduce((M, T) => {
|
|
2175
|
+
const N = this.getItemValue(A, T) ?? "";
|
|
2176
|
+
return `${M}${N}`;
|
|
2153
2177
|
}, "");
|
|
2154
|
-
if (
|
|
2155
|
-
y =
|
|
2178
|
+
if (I === S)
|
|
2179
|
+
y = R;
|
|
2156
2180
|
else
|
|
2157
2181
|
break;
|
|
2158
2182
|
}
|
|
2159
|
-
for (let
|
|
2160
|
-
const { height: A } = this.positions[
|
|
2183
|
+
for (let R = w; R < e; R++) {
|
|
2184
|
+
const { height: A } = this.positions[R];
|
|
2161
2185
|
b += A;
|
|
2162
2186
|
}
|
|
2163
|
-
for (let
|
|
2164
|
-
const { height: A } = this.positions[
|
|
2187
|
+
for (let R = w; R <= y; R++) {
|
|
2188
|
+
const { height: A } = this.positions[R];
|
|
2165
2189
|
O += A;
|
|
2166
|
-
const S = this.rowIndexRowKeyMap.get(
|
|
2167
|
-
|
|
2190
|
+
const S = this.rowIndexRowKeyMap.get(R) || "", { item: M } = this.rowKeyMap.get(S), T = this.getItemValue(S, i);
|
|
2191
|
+
C.push({
|
|
2168
2192
|
rowKey: S,
|
|
2169
2193
|
key: i,
|
|
2170
2194
|
value: T,
|
|
@@ -2174,54 +2198,54 @@ class ni {
|
|
|
2174
2198
|
}
|
|
2175
2199
|
if (g !== 1 && u) {
|
|
2176
2200
|
O = f;
|
|
2177
|
-
for (let
|
|
2178
|
-
const
|
|
2179
|
-
if (!
|
|
2201
|
+
for (let I = n - 1; I >= 0; I--) {
|
|
2202
|
+
const R = this.getColumnByColIndex(I);
|
|
2203
|
+
if (!R)
|
|
2180
2204
|
break;
|
|
2181
|
-
const A = this.getItemValue(s, i), S = this.getItemValue(s,
|
|
2182
|
-
if (A === S && c.includes(
|
|
2183
|
-
|
|
2205
|
+
const A = this.getItemValue(s, i), S = this.getItemValue(s, R.key);
|
|
2206
|
+
if (A === S && c.includes(R.key))
|
|
2207
|
+
E = I;
|
|
2184
2208
|
else
|
|
2185
2209
|
break;
|
|
2186
2210
|
}
|
|
2187
|
-
for (let
|
|
2188
|
-
const
|
|
2189
|
-
if (!
|
|
2211
|
+
for (let I = n; I <= this.ctx.maxColIndex; I++) {
|
|
2212
|
+
const R = this.getColumnByColIndex(I);
|
|
2213
|
+
if (!R)
|
|
2190
2214
|
break;
|
|
2191
|
-
const A = this.getItemValue(s, i), S = this.getItemValue(s,
|
|
2192
|
-
if (A === S && c.includes(
|
|
2193
|
-
m =
|
|
2215
|
+
const A = this.getItemValue(s, i), S = this.getItemValue(s, R.key);
|
|
2216
|
+
if (A === S && c.includes(R.key))
|
|
2217
|
+
m = I;
|
|
2194
2218
|
else
|
|
2195
2219
|
break;
|
|
2196
2220
|
}
|
|
2197
|
-
for (let
|
|
2198
|
-
const
|
|
2199
|
-
if (!
|
|
2221
|
+
for (let I = E; I < n; I++) {
|
|
2222
|
+
const R = this.getColumnByColIndex(I);
|
|
2223
|
+
if (!R)
|
|
2200
2224
|
break;
|
|
2201
|
-
|
|
2225
|
+
v += R.width || 100;
|
|
2202
2226
|
}
|
|
2203
|
-
for (let
|
|
2204
|
-
const
|
|
2205
|
-
if (!
|
|
2227
|
+
for (let I = E; I <= m; I++) {
|
|
2228
|
+
const R = this.getColumnByColIndex(I);
|
|
2229
|
+
if (!R)
|
|
2206
2230
|
break;
|
|
2207
|
-
L +=
|
|
2231
|
+
L += R.width || 100, C.push({
|
|
2208
2232
|
rowKey: s,
|
|
2209
|
-
key:
|
|
2210
|
-
value: this.getItemValue(s,
|
|
2233
|
+
key: R.key,
|
|
2234
|
+
value: this.getItemValue(s, R.key),
|
|
2211
2235
|
row: r
|
|
2212
2236
|
});
|
|
2213
2237
|
}
|
|
2214
2238
|
}
|
|
2215
2239
|
return {
|
|
2216
|
-
xArr: [
|
|
2240
|
+
xArr: [E, m],
|
|
2217
2241
|
yArr: [w, y],
|
|
2218
2242
|
rowspan: d,
|
|
2219
2243
|
colspan: g,
|
|
2220
2244
|
height: O,
|
|
2221
2245
|
width: L,
|
|
2222
2246
|
offsetTop: b,
|
|
2223
|
-
offsetLeft:
|
|
2224
|
-
dataList:
|
|
2247
|
+
offsetLeft: v,
|
|
2248
|
+
dataList: C
|
|
2225
2249
|
};
|
|
2226
2250
|
}
|
|
2227
2251
|
setLoading(t) {
|
|
@@ -2253,7 +2277,7 @@ class ni {
|
|
|
2253
2277
|
// 获取虚拟单元格
|
|
2254
2278
|
getVirtualBodyCell(t, e) {
|
|
2255
2279
|
const i = this.getColumnByColIndex(e), s = this.getRowForRowIndex(t);
|
|
2256
|
-
return !i || !s ? void 0 : new Tt(this.ctx, t, e, 0, 0, 0, 0, i, s, "body");
|
|
2280
|
+
return !i || !s ? void 0 : new Tt(this.ctx, t, e, 0, 0, 0, 0, i, s.item, "body");
|
|
2257
2281
|
}
|
|
2258
2282
|
getVirtualBodyCellByKey(t, e) {
|
|
2259
2283
|
const i = this.getRowIndexForRowKey(t), s = this.getColIndexForKey(e);
|
|
@@ -2581,6 +2605,7 @@ class Wt {
|
|
|
2581
2605
|
l(this, "WIDTH", 0);
|
|
2582
2606
|
l(this, "RESIZE_MIN_WIDTH", 40);
|
|
2583
2607
|
l(this, "HEIGHT", 0);
|
|
2608
|
+
l(this, "PLACEHOLDER_COLOR", "#CDD0DC");
|
|
2584
2609
|
l(this, "EMPTY_BODY_HEIGHT", 120);
|
|
2585
2610
|
l(this, "EMPTY_CUSTOM_STYLE", {});
|
|
2586
2611
|
l(this, "EMPTY_TEXT", "暂无数据");
|
|
@@ -2979,7 +3004,7 @@ class fi {
|
|
|
2979
3004
|
this.handleHeaderEvent(i, e, this.ctx.header.renderCellHeaders, (s) => {
|
|
2980
3005
|
this.ctx.clickCellHeader = s, this.ctx.emit("cellHeaderClick", s, t), this.selectionClick(s);
|
|
2981
3006
|
}), this.handleBodyEvent(i, e, this.ctx.body.renderRows, (s) => {
|
|
2982
|
-
this.ctx.clickCell = s, this.ctx.emit("cellClick", s, t), this.selectionClick(s), this.treeClick(s);
|
|
3007
|
+
this.ctx.clickCell = s, this.ctx.emit("cellClick", s, t), this.selectionClick(s), this.treeClick(s), this.hoverIconClick(s);
|
|
2983
3008
|
});
|
|
2984
3009
|
}), this.ctx.on("dblclick", (t) => {
|
|
2985
3010
|
if (t.button !== 0 || this.isBusy(t))
|
|
@@ -2999,9 +3024,12 @@ class fi {
|
|
|
2999
3024
|
}), this.handleBodyEvent(r, s, this.ctx.body.renderRows, (o) => {
|
|
3000
3025
|
this.ctx.emit("cellContextMenuClick", o, t);
|
|
3001
3026
|
});
|
|
3027
|
+
}), this.ctx.on("mouseout", (t) => {
|
|
3028
|
+
!this.ctx.containerElement.contains(t.relatedTarget) && this.ctx.hoverCell !== void 0 && (this.ctx.hoverRow = void 0, this.ctx.hoverCell = void 0, this.ctx.emit("draw"));
|
|
3002
3029
|
}), this.ctx.on("mousemove", (t) => {
|
|
3003
3030
|
if (this.isBusy(t))
|
|
3004
3031
|
return;
|
|
3032
|
+
this.ctx.isPointer = !1, this.ctx.stageElement.style.cursor === "pointer" && (this.ctx.stageElement.style.cursor = "default");
|
|
3005
3033
|
const e = this.ctx.getOffset(t).offsetY, i = this.ctx.getOffset(t).offsetX;
|
|
3006
3034
|
this.handleHeaderEvent(i, e, this.ctx.header.renderCellHeaders, (s) => {
|
|
3007
3035
|
this.ctx.emit("cellHeaderMouseenter", s, t), this.ctx.hoverCellHeader && this.ctx.hoverCellHeader !== s && this.ctx.emit("cellHeaderMouseleave", this.ctx.hoverCellHeader, t), this.imageEnterAndLeave(s, t), this.ctx.hoverCellHeader !== s && (this.ctx.hoverCellHeader = s, this.ctx.emit("cellHeaderHoverChange", s));
|
|
@@ -3010,15 +3038,18 @@ class fi {
|
|
|
3010
3038
|
e,
|
|
3011
3039
|
this.ctx.body.renderRows,
|
|
3012
3040
|
(s) => {
|
|
3013
|
-
this.
|
|
3041
|
+
this.selectionEnterAndLeave(s, t), this.visibleHoverCell !== s && (this.ctx.emit("visibleCellMouseleave", s, t), this.visibleHoverCell = s, this.ctx.emit("visibleCellHoverChange", s, t));
|
|
3014
3042
|
},
|
|
3015
3043
|
!0
|
|
3016
3044
|
), this.handleBodyEvent(i, e, this.ctx.body.renderRows, (s) => {
|
|
3017
3045
|
var r;
|
|
3018
|
-
this.ctx.emit("cellMouseenter", s, t), this.ctx.hoverCell && this.ctx.hoverCell !== s && this.ctx.emit("cellMouseleave",
|
|
3046
|
+
this.imageEnterAndLeave(s, t), this.ctx.emit("cellMouseenter", s, t), this.ctx.hoverCell && this.ctx.hoverCell !== s && this.ctx.emit("cellMouseleave", s, t), this.ctx.hoverCell !== s && (((r = this.ctx.hoverCell) == null ? void 0 : r.rowKey) !== s.rowKey && (this.ctx.hoverCell = s, this.ctx.hoverRow = this.ctx.body.renderRows.find((o) => o.rowKey === s.rowKey), this.ctx.emit("rowHoverChange", this.ctx.hoverRow, s, t), this.ctx.emit("drawView")), this.ctx.hoverCell = s, this.ctx.emit("cellHoverChange", s, t));
|
|
3019
3047
|
});
|
|
3020
3048
|
});
|
|
3021
3049
|
}
|
|
3050
|
+
hoverIconClick(t) {
|
|
3051
|
+
t.hoverIconName && this.ctx.isPointer && this.ctx.emit("hoverIconClick", t);
|
|
3052
|
+
}
|
|
3022
3053
|
/**
|
|
3023
3054
|
*选中点击
|
|
3024
3055
|
* @param cell
|
|
@@ -3065,7 +3096,11 @@ class fi {
|
|
|
3065
3096
|
*/
|
|
3066
3097
|
imageEnterAndLeave(t, e) {
|
|
3067
3098
|
const { offsetY: i, offsetX: s } = this.ctx.getOffset(e), r = i, o = s;
|
|
3068
|
-
o > t.drawImageX && o < t.drawImageX + t.drawImageWidth && r > t.drawImageY && r < t.drawImageY + t.drawImageHeight
|
|
3099
|
+
o > t.drawImageX && o < t.drawImageX + t.drawImageWidth && r > t.drawImageY && r < t.drawImageY + t.drawImageHeight && (this.ctx.stageElement.style.cursor = "pointer", this.ctx.isPointer = !0);
|
|
3100
|
+
}
|
|
3101
|
+
selectionEnterAndLeave(t, e) {
|
|
3102
|
+
const { offsetY: i, offsetX: s } = this.ctx.getOffset(e), r = i, o = s;
|
|
3103
|
+
o > t.drawImageX && o < t.drawImageX + t.drawImageWidth && r > t.drawImageY && r < t.drawImageY + t.drawImageHeight && t instanceof Tt && ["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"));
|
|
3069
3104
|
}
|
|
3070
3105
|
isBusy(t) {
|
|
3071
3106
|
const { offsetY: e, offsetX: i } = this.ctx.getOffset(t), s = e, r = i;
|
|
@@ -3579,7 +3614,7 @@ class gi {
|
|
|
3579
3614
|
config: { HEADER_HEIGHT: t, SCROLLER_TRACK_SIZE: e }
|
|
3580
3615
|
} = this.ctx, i = this.ctx.database.getColumns();
|
|
3581
3616
|
this.columns = i, this.allCellHeaders = [], this.leafCellHeaders = [], this.fixedLeftCellHeaders = [], this.fixedRightCellHeaders = [], this.centerCellHeaders = [];
|
|
3582
|
-
const s = Qt(i), r =
|
|
3617
|
+
const s = Qt(i), r = It(i);
|
|
3583
3618
|
this.height = t * s, this.width = r.reduce((f, x) => f + ((x == null ? void 0 : x.width) || 100), 0), this.visibleHeight = this.height;
|
|
3584
3619
|
const o = ti(te(i, s));
|
|
3585
3620
|
this.columnIndex = 0, this.resizeNum = 0, this.render(o, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
|
|
@@ -3682,7 +3717,7 @@ class gi {
|
|
|
3682
3717
|
for (let o = 0; o < i; o++) {
|
|
3683
3718
|
const n = t[o], h = r * (n.rowspan || 0), c = r * (n.level || 0);
|
|
3684
3719
|
let d = n.width || 100;
|
|
3685
|
-
n.children && (d =
|
|
3720
|
+
n.children && (d = It(n.children).reduce((g, p) => g + ((p == null ? void 0 : p.width) || 100), 0));
|
|
3686
3721
|
const f = new re(this.ctx, this.columnIndex, s, c, d, h, n);
|
|
3687
3722
|
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;
|
|
3688
3723
|
}
|
|
@@ -3874,16 +3909,16 @@ class wi {
|
|
|
3874
3909
|
width: this.width,
|
|
3875
3910
|
height: this.data.length ? 0 : h + w
|
|
3876
3911
|
});
|
|
3877
|
-
let
|
|
3878
|
-
|
|
3912
|
+
let E = this.height + e.height + o;
|
|
3913
|
+
E += w;
|
|
3879
3914
|
let m = 0;
|
|
3880
3915
|
this.data.length && d ? (m = window.innerHeight - u - f, m < 0 && (m = 32, console.error(
|
|
3881
3916
|
"There is an error in the height calculation ENABLE_OFFSET_HEIGHT and OFFSET_HEIGHT are invalid"
|
|
3882
|
-
))) : this.data.length && n ? m = n : this.data.length && c &&
|
|
3883
|
-
let
|
|
3884
|
-
r ? this.visibleHeight =
|
|
3885
|
-
const b = window.devicePixelRatio || 1,
|
|
3886
|
-
t.width = Math.floor(
|
|
3917
|
+
))) : this.data.length && n ? m = n : this.data.length && c && E > c ? m = c : m = E, m > 0 && (this.ctx.stageHeight = Math.floor(m), this.ctx.stageElement.style.height = `${this.ctx.stageHeight - 0.5}px`);
|
|
3918
|
+
let C = this.ctx.stageHeight - e.height - o;
|
|
3919
|
+
r ? this.visibleHeight = C - w : this.visibleHeight = C, 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;
|
|
3920
|
+
const b = window.devicePixelRatio || 1, v = this.ctx.stageWidth * b, O = this.ctx.stageHeight * b;
|
|
3921
|
+
t.width = Math.floor(v), t.height = Math.floor(O), this.ctx.canvasElement.setAttribute(
|
|
3887
3922
|
"style",
|
|
3888
3923
|
` height:${this.ctx.stageHeight}px;width:${this.ctx.stageWidth}px;`
|
|
3889
3924
|
), this.ctx.paint.scale(b);
|
|
@@ -4227,14 +4262,14 @@ class yi {
|
|
|
4227
4262
|
SELECTOR_AREA_MAX_X_OFFSET: f,
|
|
4228
4263
|
SELECTOR_AREA_MAX_Y_OFFSET: x
|
|
4229
4264
|
} = this.ctx.config, g = n, p = h || this.ctx.maxColIndex - f, u = c, w = d || this.ctx.maxRowIndex - x;
|
|
4230
|
-
let [y,
|
|
4231
|
-
if (y < g ||
|
|
4265
|
+
let [y, E] = r, [m, C] = o;
|
|
4266
|
+
if (y < g || E > p || m < u || C > w)
|
|
4232
4267
|
return;
|
|
4233
4268
|
if (this.ctx.stageElement.focus(), this.ctx.config.ENABLE_MERGE_CELL_LINK) {
|
|
4234
|
-
const
|
|
4235
|
-
m =
|
|
4269
|
+
const v = this.adjustMergeCells(r, o);
|
|
4270
|
+
m = v.yArr[0], C = v.yArr[1], y = v.xArr[0], E = v.xArr[1], this.ctx.onlyMergeCell = v.onlyMergeCell;
|
|
4236
4271
|
}
|
|
4237
|
-
y ===
|
|
4272
|
+
y === E && m === C ? this.ctx.selectOnlyOne = !0 : this.ctx.selectOnlyOne = !1, r = [Math.max(g, y), Math.min(p, E)], o = [Math.max(u, m), Math.min(w, C)];
|
|
4238
4273
|
const { BEFORE_SET_SELECTOR_METHOD: b } = this.ctx.config;
|
|
4239
4274
|
if (typeof b == "function") {
|
|
4240
4275
|
const O = b({
|
|
@@ -4255,13 +4290,13 @@ class yi {
|
|
|
4255
4290
|
let n = [], h = [];
|
|
4256
4291
|
for (let u = 0; u <= e[1] - e[0]; u++)
|
|
4257
4292
|
for (let w = 0; w <= t[1] - t[0]; w++) {
|
|
4258
|
-
const y = u + e[0],
|
|
4259
|
-
m && ((y === i || y === s) && n.push(m), (
|
|
4293
|
+
const y = u + e[0], E = w + t[0], m = this.ctx.database.getVirtualBodyCell(y, E);
|
|
4294
|
+
m && ((y === i || y === s) && n.push(m), (E === r || E === o) && h.push(m));
|
|
4260
4295
|
}
|
|
4261
4296
|
const c = n.reduce(
|
|
4262
4297
|
(u, w) => {
|
|
4263
|
-
const { yArr: y } = w.getSpanInfo(), [
|
|
4264
|
-
return u.minY = Math.min(u.minY,
|
|
4298
|
+
const { yArr: y } = w.getSpanInfo(), [E, m] = y;
|
|
4299
|
+
return u.minY = Math.min(u.minY, E), u.maxY = Math.max(u.maxY, m), u;
|
|
4265
4300
|
},
|
|
4266
4301
|
{
|
|
4267
4302
|
minY: i,
|
|
@@ -4269,8 +4304,8 @@ class yi {
|
|
|
4269
4304
|
}
|
|
4270
4305
|
), d = h.reduce(
|
|
4271
4306
|
(u, w) => {
|
|
4272
|
-
const { xArr: y } = w.getSpanInfo(), [
|
|
4273
|
-
return u.minX = Math.min(u.minX,
|
|
4307
|
+
const { xArr: y } = w.getSpanInfo(), [E, m] = y;
|
|
4308
|
+
return u.minX = Math.min(u.minX, E), u.maxX = Math.max(u.maxX, m), u;
|
|
4274
4309
|
},
|
|
4275
4310
|
{
|
|
4276
4311
|
minX: r,
|
|
@@ -4473,16 +4508,16 @@ class yi {
|
|
|
4473
4508
|
for (let g = 0; g <= o.length - 1; g++) {
|
|
4474
4509
|
const p = o[g].length;
|
|
4475
4510
|
for (let u = 0; u <= p - 1; u++) {
|
|
4476
|
-
const w = g + e, y = u + i,
|
|
4511
|
+
const w = g + e, y = u + i, E = o[g][u], m = this.ctx.database.getItemValueForRowIndexAndColIndex(
|
|
4477
4512
|
w,
|
|
4478
4513
|
y
|
|
4479
4514
|
);
|
|
4480
4515
|
if (m) {
|
|
4481
|
-
const { rowKey:
|
|
4482
|
-
this.ctx.database.getReadonly(
|
|
4483
|
-
rowKey:
|
|
4516
|
+
const { rowKey: C, key: b } = m;
|
|
4517
|
+
this.ctx.database.getReadonly(C, b) || (s.add(C), d.push({
|
|
4518
|
+
rowKey: C,
|
|
4484
4519
|
key: b,
|
|
4485
|
-
value:
|
|
4520
|
+
value: E,
|
|
4486
4521
|
row: {}
|
|
4487
4522
|
//内部有设置
|
|
4488
4523
|
}));
|
|
@@ -4612,14 +4647,14 @@ class yi {
|
|
|
4612
4647
|
if (!i)
|
|
4613
4648
|
return;
|
|
4614
4649
|
p && this.ctx.onlyMergeCell && i.updateSpanInfo();
|
|
4615
|
-
const { drawX: u, drawY: w, width: y, height:
|
|
4616
|
-
let
|
|
4650
|
+
const { drawX: u, drawY: w, width: y, height: E, fixed: m } = i, C = r - u + 1, b = i.drawX + y - (e - s) + 1;
|
|
4651
|
+
let v = o.height - w, O = E;
|
|
4617
4652
|
O > h.visibleHeight && (O = h.visibleHeight);
|
|
4618
4653
|
let L = 0;
|
|
4619
|
-
x && (g === "top" ?
|
|
4620
|
-
const
|
|
4621
|
-
let
|
|
4622
|
-
b > 0 && !m ?
|
|
4654
|
+
x && (g === "top" ? v = o.height + n.height - w : L = n.visibleHeight);
|
|
4655
|
+
const I = w + O - (t - L - f);
|
|
4656
|
+
let R = c, A = d;
|
|
4657
|
+
b > 0 && !m ? R = Math.floor(c + b) : C > 0 && !m && (R = Math.floor(c - C)), v > 0 ? A = Math.floor(d - v) : I > 0 && (A = Math.floor(d + I)), (Math.abs(c - R) > 2 || Math.abs(d - A) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.setScroll(R, A), this.ctx.emit("adjustBoundaryPosition", i));
|
|
4623
4658
|
}
|
|
4624
4659
|
destroy() {
|
|
4625
4660
|
this.timerX && (clearTimeout(this.timerX), this.timerX = 0), this.timerY && (clearTimeout(this.timerY), this.timerY = 0);
|
|
@@ -4684,13 +4719,13 @@ class mi {
|
|
|
4684
4719
|
SELECTOR_AREA_MAX_X_OFFSET: x,
|
|
4685
4720
|
SELECTOR_AREA_MAX_Y_OFFSET: g
|
|
4686
4721
|
} = this.ctx.config, p = h, u = c || this.ctx.maxColIndex - x, w = d, y = f || this.ctx.maxRowIndex - g;
|
|
4687
|
-
let [
|
|
4688
|
-
if (
|
|
4722
|
+
let [E, m] = o, [C, b] = n;
|
|
4723
|
+
if (E < p || C < w)
|
|
4689
4724
|
return;
|
|
4690
|
-
o = [Math.max(p,
|
|
4691
|
-
const { BEFORE_SET_AUTOFILL_METHOD:
|
|
4692
|
-
if (typeof
|
|
4693
|
-
const L =
|
|
4725
|
+
o = [Math.max(p, E), Math.min(u, m)], n = [Math.max(w, C), Math.min(y, b)];
|
|
4726
|
+
const { BEFORE_SET_AUTOFILL_METHOD: v } = this.ctx.config;
|
|
4727
|
+
if (typeof v == "function") {
|
|
4728
|
+
const L = v({
|
|
4694
4729
|
focusCell: this.ctx.focusCell,
|
|
4695
4730
|
xArr: o,
|
|
4696
4731
|
yArr: n
|
|
@@ -4724,11 +4759,11 @@ class mi {
|
|
|
4724
4759
|
let d = [];
|
|
4725
4760
|
for (let g = 0; g <= h[1] - h[0]; g++)
|
|
4726
4761
|
for (let p = 0; p <= n[1] - n[0]; p++) {
|
|
4727
|
-
const u = p + n[0], w = g + h[0], y = s[g % o][p % r],
|
|
4728
|
-
if (
|
|
4729
|
-
const { rowKey:
|
|
4730
|
-
this.ctx.database.getReadonly(
|
|
4731
|
-
rowKey:
|
|
4762
|
+
const u = p + n[0], w = g + h[0], y = s[g % o][p % r], E = this.ctx.database.getItemValueForRowIndexAndColIndex(w, u), m = `${w}-${u}`;
|
|
4763
|
+
if (E && !i.has(m)) {
|
|
4764
|
+
const { rowKey: C, key: b } = E;
|
|
4765
|
+
this.ctx.database.getReadonly(C, b) || (t.add(C), d.push({
|
|
4766
|
+
rowKey: C,
|
|
4732
4767
|
key: b,
|
|
4733
4768
|
value: y,
|
|
4734
4769
|
row: {}
|
|
@@ -4780,7 +4815,7 @@ const rt = Math.min, U = Math.max, ft = Math.round, z = (a) => ({
|
|
|
4780
4815
|
start: "end",
|
|
4781
4816
|
end: "start"
|
|
4782
4817
|
};
|
|
4783
|
-
function
|
|
4818
|
+
function _t(a, t, e) {
|
|
4784
4819
|
return U(a, rt(t, e));
|
|
4785
4820
|
}
|
|
4786
4821
|
function at(a, t) {
|
|
@@ -4830,7 +4865,7 @@ function Ri(a, t, e) {
|
|
|
4830
4865
|
return [];
|
|
4831
4866
|
}
|
|
4832
4867
|
}
|
|
4833
|
-
function
|
|
4868
|
+
function Ii(a, t, e, i) {
|
|
4834
4869
|
const s = lt(a);
|
|
4835
4870
|
let r = Ri(q(a), e === "start", i);
|
|
4836
4871
|
return s && (r = r.map((o) => o + "-" + s), t && (r = r.concat(r.map(Ot)))), r;
|
|
@@ -4838,7 +4873,7 @@ function _i(a, t, e, i) {
|
|
|
4838
4873
|
function xt(a) {
|
|
4839
4874
|
return a.replace(/left|right|bottom|top/g, (t) => Ei[t]);
|
|
4840
4875
|
}
|
|
4841
|
-
function
|
|
4876
|
+
function _i(a) {
|
|
4842
4877
|
return {
|
|
4843
4878
|
top: 0,
|
|
4844
4879
|
right: 0,
|
|
@@ -4848,7 +4883,7 @@ function Ii(a) {
|
|
|
4848
4883
|
};
|
|
4849
4884
|
}
|
|
4850
4885
|
function ae(a) {
|
|
4851
|
-
return typeof a != "number" ?
|
|
4886
|
+
return typeof a != "number" ? _i(a) : {
|
|
4852
4887
|
top: a,
|
|
4853
4888
|
right: a,
|
|
4854
4889
|
bottom: a,
|
|
@@ -4941,9 +4976,9 @@ const Oi = async (a, t, e) => {
|
|
|
4941
4976
|
name: w,
|
|
4942
4977
|
fn: y
|
|
4943
4978
|
} = n[u], {
|
|
4944
|
-
x:
|
|
4979
|
+
x: E,
|
|
4945
4980
|
y: m,
|
|
4946
|
-
data:
|
|
4981
|
+
data: C,
|
|
4947
4982
|
reset: b
|
|
4948
4983
|
} = await y({
|
|
4949
4984
|
x: d,
|
|
@@ -4959,11 +4994,11 @@ const Oi = async (a, t, e) => {
|
|
|
4959
4994
|
floating: t
|
|
4960
4995
|
}
|
|
4961
4996
|
});
|
|
4962
|
-
d =
|
|
4997
|
+
d = E ?? d, f = m ?? f, g = {
|
|
4963
4998
|
...g,
|
|
4964
4999
|
[w]: {
|
|
4965
5000
|
...g[w],
|
|
4966
|
-
...
|
|
5001
|
+
...C
|
|
4967
5002
|
}
|
|
4968
5003
|
}, b && p <= 50 && (p++, typeof b == "object" && (b.placement && (x = b.placement), b.rects && (c = b.rects === !0 ? await o.getElementRects({
|
|
4969
5004
|
reference: a,
|
|
@@ -5003,12 +5038,12 @@ async function le(a, t) {
|
|
|
5003
5038
|
boundary: c,
|
|
5004
5039
|
rootBoundary: d,
|
|
5005
5040
|
strategy: h
|
|
5006
|
-
})),
|
|
5041
|
+
})), E = f === "floating" ? {
|
|
5007
5042
|
x: i,
|
|
5008
5043
|
y: s,
|
|
5009
5044
|
width: o.floating.width,
|
|
5010
5045
|
height: o.floating.height
|
|
5011
|
-
} : o.reference, m = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(n.floating)),
|
|
5046
|
+
} : o.reference, m = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(n.floating)), C = await (r.isElement == null ? void 0 : r.isElement(m)) ? await (r.getScale == null ? void 0 : r.getScale(m)) || {
|
|
5012
5047
|
x: 1,
|
|
5013
5048
|
y: 1
|
|
5014
5049
|
} : {
|
|
@@ -5016,15 +5051,15 @@ async function le(a, t) {
|
|
|
5016
5051
|
y: 1
|
|
5017
5052
|
}, b = ut(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
5018
5053
|
elements: n,
|
|
5019
|
-
rect:
|
|
5054
|
+
rect: E,
|
|
5020
5055
|
offsetParent: m,
|
|
5021
5056
|
strategy: h
|
|
5022
|
-
}) :
|
|
5057
|
+
}) : E);
|
|
5023
5058
|
return {
|
|
5024
|
-
top: (y.top - b.top + p.top) /
|
|
5025
|
-
bottom: (b.bottom - y.bottom + p.bottom) /
|
|
5026
|
-
left: (y.left - b.left + p.left) /
|
|
5027
|
-
right: (b.right - y.right + p.right) /
|
|
5059
|
+
top: (y.top - b.top + p.top) / C.y,
|
|
5060
|
+
bottom: (b.bottom - y.bottom + p.bottom) / C.y,
|
|
5061
|
+
left: (y.left - b.left + p.left) / C.x,
|
|
5062
|
+
right: (b.right - y.right + p.right) / C.x
|
|
5028
5063
|
};
|
|
5029
5064
|
}
|
|
5030
5065
|
const Si = (a) => ({
|
|
@@ -5048,17 +5083,17 @@ const Si = (a) => ({
|
|
|
5048
5083
|
const f = ae(d), x = {
|
|
5049
5084
|
x: e,
|
|
5050
5085
|
y: i
|
|
5051
|
-
}, g = Ht(s), p = Mt(g), u = await o.getDimensions(c), w = g === "y", y = w ? "top" : "left",
|
|
5052
|
-
let O =
|
|
5053
|
-
(!O || !await (o.isElement == null ? void 0 : o.isElement(
|
|
5054
|
-
const L =
|
|
5086
|
+
}, g = Ht(s), p = Mt(g), u = await o.getDimensions(c), w = g === "y", y = w ? "top" : "left", E = w ? "bottom" : "right", m = w ? "clientHeight" : "clientWidth", C = r.reference[p] + r.reference[g] - x[g] - r.floating[p], b = x[g] - r.reference[g], v = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(c));
|
|
5087
|
+
let O = v ? v[m] : 0;
|
|
5088
|
+
(!O || !await (o.isElement == null ? void 0 : o.isElement(v))) && (O = n.floating[m] || r.floating[p]);
|
|
5089
|
+
const L = C / 2 - b / 2, I = O / 2 - u[p] / 2 - 1, R = rt(f[y], I), A = rt(f[E], I), S = R, M = O - u[p] - A, T = O / 2 - u[p] / 2 + L, N = _t(S, T, M), Y = !h.arrow && lt(s) != null && T !== N && r.reference[p] / 2 - (T < S ? R : A) - u[p] / 2 < 0, B = Y ? T < S ? T - S : T - M : 0;
|
|
5055
5090
|
return {
|
|
5056
|
-
[g]: x[g] +
|
|
5091
|
+
[g]: x[g] + B,
|
|
5057
5092
|
data: {
|
|
5058
|
-
[g]:
|
|
5059
|
-
centerOffset: T -
|
|
5093
|
+
[g]: N,
|
|
5094
|
+
centerOffset: T - N - B,
|
|
5060
5095
|
...Y && {
|
|
5061
|
-
alignmentOffset:
|
|
5096
|
+
alignmentOffset: B
|
|
5062
5097
|
}
|
|
5063
5098
|
},
|
|
5064
5099
|
reset: Y
|
|
@@ -5088,45 +5123,45 @@ const Si = (a) => ({
|
|
|
5088
5123
|
} = at(a, t);
|
|
5089
5124
|
if ((e = r.arrow) != null && e.alignmentOffset)
|
|
5090
5125
|
return {};
|
|
5091
|
-
const y = q(s),
|
|
5092
|
-
!x &&
|
|
5093
|
-
const O = [n, ...b], L = await le(t, w),
|
|
5094
|
-
let
|
|
5095
|
-
if (d &&
|
|
5096
|
-
const T = bi(s, o,
|
|
5097
|
-
|
|
5126
|
+
const y = q(s), E = J(n), m = q(n) === n, C = await (h.isRTL == null ? void 0 : h.isRTL(c.floating)), b = x || (m || !u ? [xt(n)] : vi(n)), v = p !== "none";
|
|
5127
|
+
!x && v && b.push(...Ii(n, u, p, C));
|
|
5128
|
+
const O = [n, ...b], L = await le(t, w), I = [];
|
|
5129
|
+
let R = ((i = r.flip) == null ? void 0 : i.overflows) || [];
|
|
5130
|
+
if (d && I.push(L[y]), f) {
|
|
5131
|
+
const T = bi(s, o, C);
|
|
5132
|
+
I.push(L[T[0]], L[T[1]]);
|
|
5098
5133
|
}
|
|
5099
|
-
if (
|
|
5134
|
+
if (R = [...R, {
|
|
5100
5135
|
placement: s,
|
|
5101
|
-
overflows:
|
|
5102
|
-
}], !
|
|
5136
|
+
overflows: I
|
|
5137
|
+
}], !I.every((T) => T <= 0)) {
|
|
5103
5138
|
var A, S;
|
|
5104
|
-
const T = (((A = r.flip) == null ? void 0 : A.index) || 0) + 1,
|
|
5105
|
-
if (
|
|
5139
|
+
const T = (((A = r.flip) == null ? void 0 : A.index) || 0) + 1, N = O[T];
|
|
5140
|
+
if (N)
|
|
5106
5141
|
return {
|
|
5107
5142
|
data: {
|
|
5108
5143
|
index: T,
|
|
5109
|
-
overflows:
|
|
5144
|
+
overflows: R
|
|
5110
5145
|
},
|
|
5111
5146
|
reset: {
|
|
5112
|
-
placement:
|
|
5147
|
+
placement: N
|
|
5113
5148
|
}
|
|
5114
5149
|
};
|
|
5115
|
-
let Y = (S =
|
|
5150
|
+
let Y = (S = R.filter((B) => B.overflows[0] <= 0).sort((B, W) => B.overflows[1] - W.overflows[1])[0]) == null ? void 0 : S.placement;
|
|
5116
5151
|
if (!Y)
|
|
5117
5152
|
switch (g) {
|
|
5118
5153
|
case "bestFit": {
|
|
5119
5154
|
var M;
|
|
5120
|
-
const
|
|
5121
|
-
if (
|
|
5155
|
+
const B = (M = R.filter((W) => {
|
|
5156
|
+
if (v) {
|
|
5122
5157
|
const P = J(W.placement);
|
|
5123
|
-
return P ===
|
|
5158
|
+
return P === E || // Create a bias to the `y` side axis due to horizontal
|
|
5124
5159
|
// reading directions favoring greater width.
|
|
5125
5160
|
P === "y";
|
|
5126
5161
|
}
|
|
5127
5162
|
return !0;
|
|
5128
5163
|
}).map((W) => [W.placement, W.overflows.filter((P) => P > 0).reduce((P, Ee) => P + Ee, 0)]).sort((W, P) => W[1] - P[1])[0]) == null ? void 0 : M[0];
|
|
5129
|
-
|
|
5164
|
+
B && (Y = B);
|
|
5130
5165
|
break;
|
|
5131
5166
|
}
|
|
5132
5167
|
case "initialPlacement":
|
|
@@ -5209,11 +5244,11 @@ const Ti = function(a) {
|
|
|
5209
5244
|
fn: (w) => {
|
|
5210
5245
|
let {
|
|
5211
5246
|
x: y,
|
|
5212
|
-
y:
|
|
5247
|
+
y: E
|
|
5213
5248
|
} = w;
|
|
5214
5249
|
return {
|
|
5215
5250
|
x: y,
|
|
5216
|
-
y:
|
|
5251
|
+
y: E
|
|
5217
5252
|
};
|
|
5218
5253
|
}
|
|
5219
5254
|
},
|
|
@@ -5224,12 +5259,12 @@ const Ti = function(a) {
|
|
|
5224
5259
|
}, d = await le(t, h), f = J(q(s)), x = ne(f);
|
|
5225
5260
|
let g = c[x], p = c[f];
|
|
5226
5261
|
if (r) {
|
|
5227
|
-
const w = x === "y" ? "top" : "left", y = x === "y" ? "bottom" : "right",
|
|
5228
|
-
g =
|
|
5262
|
+
const w = x === "y" ? "top" : "left", y = x === "y" ? "bottom" : "right", E = g + d[w], m = g - d[y];
|
|
5263
|
+
g = _t(E, g, m);
|
|
5229
5264
|
}
|
|
5230
5265
|
if (o) {
|
|
5231
|
-
const w = f === "y" ? "top" : "left", y = f === "y" ? "bottom" : "right",
|
|
5232
|
-
p =
|
|
5266
|
+
const w = f === "y" ? "top" : "left", y = f === "y" ? "bottom" : "right", E = p + d[w], m = p - d[y];
|
|
5267
|
+
p = _t(E, p, m);
|
|
5233
5268
|
}
|
|
5234
5269
|
const u = n.fn({
|
|
5235
5270
|
...t,
|
|
@@ -5282,7 +5317,7 @@ function ht(a) {
|
|
|
5282
5317
|
overflowX: e,
|
|
5283
5318
|
overflowY: i,
|
|
5284
5319
|
display: s
|
|
5285
|
-
} =
|
|
5320
|
+
} = k(a);
|
|
5286
5321
|
return /auto|scroll|overlay|hidden|clip/.test(t + i + e) && !["inline", "contents"].includes(s);
|
|
5287
5322
|
}
|
|
5288
5323
|
function Hi(a) {
|
|
@@ -5298,7 +5333,7 @@ function wt(a) {
|
|
|
5298
5333
|
});
|
|
5299
5334
|
}
|
|
5300
5335
|
function Dt(a) {
|
|
5301
|
-
const t = Ft(), e = X(a) ?
|
|
5336
|
+
const t = Ft(), e = X(a) ? k(a) : a;
|
|
5302
5337
|
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));
|
|
5303
5338
|
}
|
|
5304
5339
|
function Di(a) {
|
|
@@ -5318,7 +5353,7 @@ function Ft() {
|
|
|
5318
5353
|
function Q(a) {
|
|
5319
5354
|
return ["html", "body", "#document"].includes(tt(a));
|
|
5320
5355
|
}
|
|
5321
|
-
function
|
|
5356
|
+
function k(a) {
|
|
5322
5357
|
return F(a).getComputedStyle(a);
|
|
5323
5358
|
}
|
|
5324
5359
|
function pt(a) {
|
|
@@ -5360,7 +5395,7 @@ function Lt(a) {
|
|
|
5360
5395
|
return a.parent && Object.getPrototypeOf(a.parent) ? a.frameElement : null;
|
|
5361
5396
|
}
|
|
5362
5397
|
function de(a) {
|
|
5363
|
-
const t =
|
|
5398
|
+
const t = k(a);
|
|
5364
5399
|
let e = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
|
|
5365
5400
|
const s = K(a), r = s ? a.offsetWidth : e, o = s ? a.offsetHeight : i, n = ft(e) !== r || ft(i) !== o;
|
|
5366
5401
|
return n && (e = r, i = o), {
|
|
@@ -5409,8 +5444,8 @@ function ot(a, t, e, i) {
|
|
|
5409
5444
|
const x = F(r), g = i && X(i) ? F(i) : i;
|
|
5410
5445
|
let p = x, u = Lt(p);
|
|
5411
5446
|
for (; u && i && g !== p; ) {
|
|
5412
|
-
const w = Z(u), y = u.getBoundingClientRect(),
|
|
5413
|
-
h *= w.x, c *= w.y, d *= w.x, f *= w.y, h += m, c +=
|
|
5447
|
+
const w = Z(u), y = u.getBoundingClientRect(), E = k(u), m = y.left + (u.clientLeft + parseFloat(E.paddingLeft)) * w.x, C = y.top + (u.clientTop + parseFloat(E.paddingTop)) * w.y;
|
|
5448
|
+
h *= w.x, c *= w.y, d *= w.x, f *= w.y, h += m, c += C, p = F(u), u = Lt(p);
|
|
5414
5449
|
}
|
|
5415
5450
|
}
|
|
5416
5451
|
return ut({
|
|
@@ -5420,7 +5455,7 @@ function ot(a, t, e, i) {
|
|
|
5420
5455
|
y: c
|
|
5421
5456
|
});
|
|
5422
5457
|
}
|
|
5423
|
-
function
|
|
5458
|
+
function ki(a) {
|
|
5424
5459
|
let {
|
|
5425
5460
|
elements: t,
|
|
5426
5461
|
rect: e,
|
|
@@ -5446,18 +5481,18 @@ function Ni(a) {
|
|
|
5446
5481
|
y: e.y * c.y - h.scrollTop * c.y + d.y
|
|
5447
5482
|
};
|
|
5448
5483
|
}
|
|
5449
|
-
function
|
|
5484
|
+
function Ni(a) {
|
|
5450
5485
|
return Array.from(a.getClientRects());
|
|
5451
5486
|
}
|
|
5452
5487
|
function At(a, t) {
|
|
5453
5488
|
const e = pt(a).scrollLeft;
|
|
5454
5489
|
return t ? t.left + e : ot(V(a)).left + e;
|
|
5455
5490
|
}
|
|
5456
|
-
function
|
|
5491
|
+
function Bi(a) {
|
|
5457
5492
|
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);
|
|
5458
5493
|
let o = -e.scrollLeft + At(a);
|
|
5459
5494
|
const n = -e.scrollTop;
|
|
5460
|
-
return
|
|
5495
|
+
return k(i).direction === "rtl" && (o += U(t.clientWidth, i.clientWidth) - s), {
|
|
5461
5496
|
width: s,
|
|
5462
5497
|
height: r,
|
|
5463
5498
|
x: o,
|
|
@@ -5493,7 +5528,7 @@ function Gt(a, t, e) {
|
|
|
5493
5528
|
if (t === "viewport")
|
|
5494
5529
|
i = Ki(a, e);
|
|
5495
5530
|
else if (t === "document")
|
|
5496
|
-
i =
|
|
5531
|
+
i = Bi(V(a));
|
|
5497
5532
|
else if (X(t))
|
|
5498
5533
|
i = Yi(t, e);
|
|
5499
5534
|
else {
|
|
@@ -5508,17 +5543,17 @@ function Gt(a, t, e) {
|
|
|
5508
5543
|
}
|
|
5509
5544
|
function ue(a, t) {
|
|
5510
5545
|
const e = $(a);
|
|
5511
|
-
return e === t || !X(e) || Q(e) ? !1 :
|
|
5546
|
+
return e === t || !X(e) || Q(e) ? !1 : k(e).position === "fixed" || ue(e, t);
|
|
5512
5547
|
}
|
|
5513
5548
|
function Vi(a, t) {
|
|
5514
5549
|
const e = t.get(a);
|
|
5515
5550
|
if (e)
|
|
5516
5551
|
return e;
|
|
5517
5552
|
let i = St(a, [], !1).filter((n) => X(n) && tt(n) !== "body"), s = null;
|
|
5518
|
-
const r =
|
|
5553
|
+
const r = k(a).position === "fixed";
|
|
5519
5554
|
let o = r ? $(a) : a;
|
|
5520
5555
|
for (; X(o) && !Q(o); ) {
|
|
5521
|
-
const n =
|
|
5556
|
+
const n = k(o), h = Dt(o);
|
|
5522
5557
|
!h && n.position === "fixed" && (s = null), (r ? !h && !s : !h && n.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || ht(o) && !h && ue(a, o)) ? i = i.filter((d) => d !== o) : s = n, o = $(o);
|
|
5523
5558
|
}
|
|
5524
5559
|
return t.set(a, i), i;
|
|
@@ -5578,10 +5613,10 @@ function zi(a, t, e) {
|
|
|
5578
5613
|
};
|
|
5579
5614
|
}
|
|
5580
5615
|
function mt(a) {
|
|
5581
|
-
return
|
|
5616
|
+
return k(a).position === "static";
|
|
5582
5617
|
}
|
|
5583
5618
|
function qt(a, t) {
|
|
5584
|
-
if (!K(a) ||
|
|
5619
|
+
if (!K(a) || k(a).position === "fixed")
|
|
5585
5620
|
return null;
|
|
5586
5621
|
if (t)
|
|
5587
5622
|
return t(a);
|
|
@@ -5619,15 +5654,15 @@ const $i = async function(a) {
|
|
|
5619
5654
|
};
|
|
5620
5655
|
};
|
|
5621
5656
|
function Gi(a) {
|
|
5622
|
-
return
|
|
5657
|
+
return k(a).direction === "rtl";
|
|
5623
5658
|
}
|
|
5624
5659
|
const qi = {
|
|
5625
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
5660
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: ki,
|
|
5626
5661
|
getDocumentElement: V,
|
|
5627
5662
|
getClippingRect: Wi,
|
|
5628
5663
|
getOffsetParent: ge,
|
|
5629
5664
|
getElementRects: $i,
|
|
5630
|
-
getClientRects:
|
|
5665
|
+
getClientRects: Ni,
|
|
5631
5666
|
getDimensions: Pi,
|
|
5632
5667
|
getScale: Z,
|
|
5633
5668
|
isElement: X,
|
|
@@ -5780,6 +5815,8 @@ class Zi {
|
|
|
5780
5815
|
this.enable && this.doneEdit();
|
|
5781
5816
|
}), this.ctx.on("cellHeaderMousedown", () => {
|
|
5782
5817
|
this.enable && this.doneEdit(), this.cellTarget = null;
|
|
5818
|
+
}), this.ctx.on("hoverIconClick", (t) => {
|
|
5819
|
+
t.editorType !== "none" && this.editCell(t.rowIndex, t.colIndex);
|
|
5783
5820
|
}), this.ctx.on("keydown", (t) => {
|
|
5784
5821
|
if (!this.ctx.isTarget(t))
|
|
5785
5822
|
return;
|
|
@@ -5910,7 +5947,7 @@ class Zi {
|
|
|
5910
5947
|
}
|
|
5911
5948
|
}
|
|
5912
5949
|
startEdit(t = !1) {
|
|
5913
|
-
this.cancel = !1;
|
|
5950
|
+
this.ctx.emit("draw"), this.cancel = !1;
|
|
5914
5951
|
const { ENABLE_EDIT_CLICK_SELECTOR: e } = this.ctx.config;
|
|
5915
5952
|
if (!e)
|
|
5916
5953
|
return;
|