e-virt-table 1.2.0 → 1.2.2

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.es.js CHANGED
@@ -149,7 +149,7 @@ function Ae(a) {
149
149
  t.push.apply(t, a[e] || []);
150
150
  }), t;
151
151
  }
152
- var Ft = /* @__PURE__ */ function(a) {
152
+ var Bt = /* @__PURE__ */ function(a) {
153
153
  Re(t, a);
154
154
  function t(e, i) {
155
155
  var s;
@@ -160,8 +160,8 @@ var Ft = /* @__PURE__ */ function(a) {
160
160
  function Te(a, t, e, i, s) {
161
161
  if (t.first) {
162
162
  var r = new Promise(function(x, g) {
163
- var p = function(y) {
164
- return i(y), y.length ? g(new Ft(y, bt(y))) : x(s);
163
+ var p = function(m) {
164
+ return i(m), m.length ? g(new Bt(m, bt(m))) : x(s);
165
165
  }, u = Ae(a);
166
166
  Xt(u, e, p);
167
167
  });
@@ -172,7 +172,7 @@ function Te(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 Ft(d, bt(d))) : x(s);
175
+ return i(d), d.length ? g(new Bt(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 He(a, t) {
194
194
  }
195
195
  return e;
196
196
  }
197
- function Bt(a, t) {
197
+ function Ft(a, t) {
198
198
  return function(e) {
199
199
  var i;
200
200
  return a.fullFields ? i = He(t, a.fullFields) : i = t[e.field || a.fullField], Me(e) ? (e.field = e.field || a.fullField, e.fieldValue = i, e) : {
@@ -221,8 +221,8 @@ var Zt = function(t, e, i, s, r, o) {
221
221
  }, ct, Ne = function() {
222
222
  if (ct)
223
223
  return ct;
224
- var a = "[a-fA-F\\d:]", t = function(C) {
225
- return C && C.includeBoundaries ? "(?:(?<=\\s|^)(?=" + a + ")|(?<=" + a + ")(?=\\s|$))" : "";
224
+ var a = "[a-fA-F\\d:]", t = function(b) {
225
+ return b && b.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 Zt = 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(C) {
238
- return C && C.exact ? r : new RegExp("(?:" + t(C) + e + t(C) + ")|(?:" + t(C) + s + t(C) + ")", "g");
237
+ `).replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(), r = new RegExp("(?:^" + e + "$)|(?:^" + s + "$)"), o = new RegExp("^" + e + "$"), n = new RegExp("^" + s + "$"), h = function(b) {
238
+ return b && b.exact ? r : new RegExp("(?:" + t(b) + e + t(b) + ")|(?:" + t(b) + s + t(b) + ")", "g");
239
239
  };
240
- h.v4 = function(m) {
241
- return m && m.exact ? o : new RegExp("" + t(m) + e + t(m), "g");
242
- }, h.v6 = function(m) {
243
- return m && m.exact ? n : new RegExp("" + t(m) + s + t(m), "g");
240
+ h.v4 = function(y) {
241
+ return y && y.exact ? o : new RegExp("" + t(y) + e + t(y), "g");
242
+ }, h.v6 = function(y) {
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, 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;
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})?", m = '(?:[/?#][^\\s"]*)?', C = "(?:" + c + "|www\\.)" + d + "(?:localhost|" + f + "|" + x + "|" + g + p + u + ")" + w + m;
246
+ return ct = new RegExp("(?:^" + C + "$)", "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,}))$/,
@@ -299,12 +299,12 @@ var Zt = function(t, e, i, s, r, o) {
299
299
  }
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
- }, Fe = function(t, e, i, s, r) {
302
+ }, Be = function(t, e, i, s, r) {
303
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, x = typeof e == "number", g = typeof e == "string", p = Array.isArray(e);
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", Be = function(t, e, i, s, r) {
307
+ }, j = "enum", Fe = 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) {
310
310
  if (t.pattern) {
@@ -315,19 +315,19 @@ 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
+ }, O = {
319
319
  required: Zt,
320
320
  whitespace: De,
321
321
  type: Xe,
322
- range: Fe,
323
- enum: Be,
322
+ range: Be,
323
+ enum: Fe,
324
324
  pattern: ke
325
325
  }, Ke = 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
- _.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));
330
+ O.required(t, e, s, o, r, "string"), H(e, "string") || (O.type(t, e, s, o, r), O.range(t, e, s, o, r), O.pattern(t, e, s, o, r), t.whitespace === !0 && O.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
- _.required(t, e, s, o, r), e !== void 0 && _.type(t, e, s, o, r);
338
+ O.required(t, e, s, o, r), e !== void 0 && O.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
- _.required(t, e, s, o, r), e !== void 0 && (_.type(t, e, s, o, r), _.range(t, e, s, o, r));
346
+ O.required(t, e, s, o, r), e !== void 0 && (O.type(t, e, s, o, r), O.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
- _.required(t, e, s, o, r), e !== void 0 && _.type(t, e, s, o, r);
354
+ O.required(t, e, s, o, r), e !== void 0 && O.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
- _.required(t, e, s, o, r), H(e) || _.type(t, e, s, o, r);
362
+ O.required(t, e, s, o, r), H(e) || O.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
- _.required(t, e, s, o, r), e !== void 0 && (_.type(t, e, s, o, r), _.range(t, e, s, o, r));
370
+ O.required(t, e, s, o, r), e !== void 0 && (O.type(t, e, s, o, r), O.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
- _.required(t, e, s, o, r), e !== void 0 && (_.type(t, e, s, o, r), _.range(t, e, s, o, r));
378
+ O.required(t, e, s, o, r), e !== void 0 && (O.type(t, e, s, o, r), O.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
- _.required(t, e, s, o, r, "array"), e != null && (_.type(t, e, s, o, r), _.range(t, e, s, o, r));
386
+ O.required(t, e, s, o, r, "array"), e != null && (O.type(t, e, s, o, r), O.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
- _.required(t, e, s, o, r), e !== void 0 && _.type(t, e, s, o, r);
394
+ O.required(t, e, s, o, r), e !== void 0 && O.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
- _.required(t, e, s, o, r), e !== void 0 && _[je](t, e, s, o, r);
402
+ O.required(t, e, s, o, r), e !== void 0 && O[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
- _.required(t, e, s, o, r), H(e, "string") || _.pattern(t, e, s, o, r);
410
+ O.required(t, e, s, o, r), H(e, "string") || O.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 (_.required(t, e, s, o, r), !H(e, "date")) {
418
+ if (O.required(t, e, s, o, r), !H(e, "date")) {
419
419
  var h;
420
- e instanceof Date ? h = e : h = new Date(e), _.type(t, h, s, o, r), h && _.range(t, h.getTime(), s, o, r);
420
+ e instanceof Date ? h = e : h = new Date(e), O.type(t, h, s, o, r), h && O.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
- _.required(t, e, s, o, r, n), i(o);
427
- }, yt = function(t, e, i, s, r) {
426
+ O.required(t, e, s, o, r, n), i(o);
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
- _.required(t, e, s, n, r, o), H(e, o) || _.type(t, e, s, n, r);
432
+ O.required(t, e, s, n, r, o), H(e, o) || O.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
- _.required(t, e, s, o, r);
440
+ O.required(t, e, s, o, r);
441
441
  }
442
442
  i(o);
443
443
  }, it = {
@@ -453,9 +453,9 @@ var Zt = function(t, e, i, s, r, o) {
453
453
  enum: Ue,
454
454
  pattern: Ze,
455
455
  date: Je,
456
- url: yt,
457
- hex: yt,
458
- email: yt,
456
+ url: mt,
457
+ hex: mt,
458
+ email: mt,
459
459
  required: Qe,
460
460
  any: ti
461
461
  };
@@ -537,17 +537,17 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
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
539
  function d(u) {
540
- var w = [], y = {};
541
- function E(C) {
542
- if (Array.isArray(C)) {
543
- var b;
544
- w = (b = w).concat.apply(b, C);
540
+ var w = [], m = {};
541
+ function C(b) {
542
+ if (Array.isArray(b)) {
543
+ var E;
544
+ w = (E = w).concat.apply(E, b);
545
545
  } else
546
- w.push(C);
546
+ w.push(b);
547
547
  }
548
- for (var m = 0; m < u.length; m++)
549
- E(u[m]);
550
- w.length ? (y = bt(w), c(w, y)) : c(null, n);
548
+ for (var y = 0; y < u.length; y++)
549
+ C(u[y]);
550
+ w.length ? (m = bt(w), c(w, m)) : c(null, n);
551
551
  }
552
552
  if (h.messages) {
553
553
  var f = this.messages();
@@ -556,14 +556,14 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
556
556
  h.messages = this.messages();
557
557
  var x = {}, g = h.keys || Object.keys(this.rules);
558
558
  g.forEach(function(u) {
559
- var w = o.rules[u], y = n[u];
560
- w.forEach(function(E) {
561
- var m = E;
562
- typeof m.transform == "function" && (n === i && (n = q({}, n)), y = n[u] = m.transform(y)), typeof m == "function" ? m = {
563
- validator: m
564
- } : m = q({}, 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({
565
- rule: m,
566
- value: y,
559
+ var w = o.rules[u], m = n[u];
560
+ w.forEach(function(C) {
561
+ var y = C;
562
+ typeof y.transform == "function" && (n === i && (n = q({}, n)), m = n[u] = y.transform(m)), typeof y == "function" ? y = {
563
+ validator: y
564
+ } : y = q({}, y), y.validator = o.getValidationMethod(y), y.validator && (y.field = u, y.fullField = y.fullField || u, y.type = o.getType(y), x[u] = x[u] || [], x[u].push({
565
+ rule: y,
566
+ value: m,
567
567
  source: n,
568
568
  field: u
569
569
  }));
@@ -571,34 +571,34 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
571
571
  });
572
572
  var p = {};
573
573
  return Te(x, h, function(u, w) {
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
- return q({}, O, {
578
- fullField: y.fullField + "." + v,
579
- fullFields: y.fullFields ? [].concat(y.fullFields, [v]) : [v]
574
+ var m = u.rule, C = (m.type === "object" || m.type === "array") && (typeof m.fields == "object" || typeof m.defaultField == "object");
575
+ C = C && (m.required || !m.required && u.value), m.field = u.field;
576
+ function y(v, _) {
577
+ return q({}, _, {
578
+ fullField: m.fullField + "." + v,
579
+ fullFields: m.fullFields ? [].concat(m.fullFields, [v]) : [v]
580
580
  });
581
581
  }
582
- function C(v) {
582
+ function b(v) {
583
583
  v === void 0 && (v = []);
584
- var O = Array.isArray(v) ? v : [v];
585
- !h.suppressWarning && O.length && a.warning("async-validator:", O), O.length && y.message !== void 0 && (O = [].concat(y.message));
586
- var S = O.map(Bt(y, n));
584
+ var _ = Array.isArray(v) ? v : [v];
585
+ !h.suppressWarning && _.length && a.warning("async-validator:", _), _.length && m.message !== void 0 && (_ = [].concat(m.message));
586
+ var S = _.map(Ft(m, n));
587
587
  if (h.first && S.length)
588
- return p[y.field] = 1, w(S);
589
- if (!E)
588
+ return p[m.field] = 1, w(S);
589
+ if (!C)
590
590
  w(S);
591
591
  else {
592
- if (y.required && !u.value)
593
- return y.message !== void 0 ? S = [].concat(y.message).map(Bt(y, n)) : h.error && (S = [h.error(y, D(h.messages.required, y.field))]), w(S);
592
+ if (m.required && !u.value)
593
+ return m.message !== void 0 ? S = [].concat(m.message).map(Ft(m, n)) : h.error && (S = [h.error(m, D(h.messages.required, m.field))]), w(S);
594
594
  var I = {};
595
- y.defaultField && Object.keys(u.value).map(function(L) {
596
- I[L] = y.defaultField;
595
+ m.defaultField && Object.keys(u.value).map(function(L) {
596
+ I[L] = m.defaultField;
597
597
  }), I = q({}, I, u.rule.fields);
598
598
  var R = {};
599
599
  Object.keys(I).forEach(function(L) {
600
600
  var M = I[L], T = Array.isArray(M) ? M : [M];
601
- R[L] = T.map(m.bind(null, L));
601
+ R[L] = T.map(y.bind(null, L));
602
602
  });
603
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(L) {
@@ -607,23 +607,23 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
607
607
  });
608
608
  }
609
609
  }
610
- var b;
611
- if (y.asyncValidator)
612
- b = y.asyncValidator(y, u.value, C, u.source, h);
613
- else if (y.validator) {
610
+ var E;
611
+ if (m.asyncValidator)
612
+ E = m.asyncValidator(m, u.value, b, u.source, h);
613
+ else if (m.validator) {
614
614
  try {
615
- b = y.validator(y, u.value, C, u.source, h);
615
+ E = m.validator(m, u.value, b, u.source, h);
616
616
  } catch (v) {
617
617
  console.error == null || console.error(v), h.suppressValidatorError || setTimeout(function() {
618
618
  throw v;
619
- }, 0), C(v.message);
619
+ }, 0), b(v.message);
620
620
  }
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);
621
+ E === !0 ? b() : E === !1 ? b(typeof m.message == "function" ? m.message(m.fullField || m.field) : m.message || (m.fullField || m.field) + " fails") : E instanceof Array ? b(E) : E instanceof Error && b(E.message);
622
622
  }
623
- b && b.then && b.then(function() {
624
- return C();
623
+ E && E.then && E.then(function() {
624
+ return b();
625
625
  }, function(v) {
626
- return C(v);
626
+ return b(v);
627
627
  });
628
628
  }, function(u) {
629
629
  d(u);
@@ -1048,31 +1048,31 @@ class Tt extends re {
1048
1048
  STRIPE_COLOR: g
1049
1049
  } = this.ctx.config;
1050
1050
  if (this.cellType === "footer") {
1051
- let b = n, v = o;
1051
+ let E = n, v = o;
1052
1052
  if (typeof r == "function") {
1053
- const O = r, { backgroundColor: S, color: I } = O({
1053
+ const _ = r, { backgroundColor: S, color: I } = _({
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
- S && (b = S), I && (v = I);
1060
+ S && (E = S), I && (v = I);
1061
1061
  }
1062
- this.drawCellSkyBgColor = "transparent", this.drawCellBgColor = b, this.drawTextColor = v;
1062
+ this.drawCellSkyBgColor = "transparent", this.drawCellBgColor = E, 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
- let y = this.rowIndex, E = this.rowIndex;
1067
+ let m = this.rowIndex, C = this.rowIndex;
1068
1068
  if (this.rowspan !== 1 && (d || h)) {
1069
- const b = this.getSpanInfo(), { yArr: v } = b;
1070
- y = v[0], E = v[1];
1069
+ const E = this.getSpanInfo(), { yArr: v } = E;
1070
+ m = v[0], C = v[1];
1071
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;
1074
- if (this.ctx.database.getReadonly(this.rowKey, this.key) || (m = i, C = o), x && (this.rowIndex % 2 ? m = g : m = e), typeof s == "function") {
1075
- const b = s, { backgroundColor: v, color: O } = b({
1072
+ d && w && (w.rowKey === this.rowKey && (p = f), w.rowIndex >= m && w.rowIndex <= C && (p = f)), h && u && (u.rowKey === this.rowKey && (p = c), u.rowIndex >= m && u.rowIndex <= C && (p = c)), this.drawCellSkyBgColor = p;
1073
+ let y = e, b = o;
1074
+ if (this.ctx.database.getReadonly(this.rowKey, this.key) || (y = i, b = o), x && (this.rowIndex % 2 ? y = g : y = e), typeof s == "function") {
1075
+ const E = s, { backgroundColor: v, color: _ } = E({
1076
1076
  row: this.row,
1077
1077
  rowIndex: this.rowIndex,
1078
1078
  colIndex: this.colIndex,
@@ -1080,9 +1080,9 @@ class Tt extends re {
1080
1080
  isHasChanged: this.isHasChanged,
1081
1081
  value: this.getValue()
1082
1082
  }) || {};
1083
- v && (m = v), O && (C = O);
1083
+ v && (y = v), _ && (b = _);
1084
1084
  }
1085
- this.drawCellBgColor = m, this.drawTextColor = C;
1085
+ this.drawCellBgColor = y, this.drawTextColor = b;
1086
1086
  }
1087
1087
  updateSelection() {
1088
1088
  const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: r, cellType: o, type: n, rowIndex: h, rowKey: c } = this;
@@ -1112,8 +1112,8 @@ class Tt extends re {
1112
1112
  if (n.rowKey === this.rowKey && (h = this.drawX + this.width - s - r, c = this.drawY + (this.height - s) / 2), this.rowspan !== 1 && o) {
1113
1113
  const f = this.getSpanInfo(), { yArr: x } = f, g = x[0], p = x[1];
1114
1114
  if (n.rowIndex >= g && n.rowIndex <= p) {
1115
- const { width: u, height: w, offsetTop: y, offsetLeft: E } = f;
1116
- h = this.drawX - E + u - s - r, c = this.drawY - y + (w - s) / 2;
1115
+ const { width: u, height: w, offsetTop: m, offsetLeft: C } = f;
1116
+ h = this.drawX - C + u - s - r, c = this.drawY - m + (w - s) / 2;
1117
1117
  }
1118
1118
  }
1119
1119
  const d = this.ctx.icons.get(this.hoverIconName);
@@ -1336,10 +1336,10 @@ class Tt extends re {
1336
1336
  drawBorder(e) {
1337
1337
  const { drawX: i, drawY: s, rowIndex: r, colIndex: o, height: n, width: h } = this;
1338
1338
  let c = i, d = s;
1339
- 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];
1340
- if (o >= y && o <= E && r === m) {
1341
- const b = o === E ? 1 : 0, v = o === y ? 1 : 0;
1342
- this.ctx.paint.drawLine([c + v, d + 1, c + h - b, d + 1], {
1339
+ const { xArr: f, yArr: x, lineDash: g = [], borderWidth: p = 1, borderColor: u, fillColor: w } = e, m = f[0], C = f[1], y = x[0], b = x[1];
1340
+ if (o >= m && o <= C && r === y) {
1341
+ const E = o === C ? 1 : 0, v = o === m ? 1 : 0;
1342
+ this.ctx.paint.drawLine([c + v, d + 1, c + h - E, d + 1], {
1343
1343
  borderColor: u,
1344
1344
  fillColor: w,
1345
1345
  borderWidth: p,
@@ -1348,9 +1348,9 @@ class Tt extends re {
1348
1348
  lineDash: g
1349
1349
  });
1350
1350
  }
1351
- if (o === E && r >= m && r <= C) {
1352
- const b = r === m ? 1 : 0, v = r === C ? 1 : 0;
1353
- this.ctx.paint.drawLine([c + h - 1, d + b, c + h - 1, d + n - v], {
1351
+ if (o === C && r >= y && r <= b) {
1352
+ const E = r === y ? 1 : 0, v = r === b ? 1 : 0;
1353
+ this.ctx.paint.drawLine([c + h - 1, d + E, c + h - 1, d + n - v], {
1354
1354
  borderColor: u,
1355
1355
  fillColor: w,
1356
1356
  borderWidth: p,
@@ -1359,9 +1359,9 @@ class Tt extends re {
1359
1359
  lineDash: g
1360
1360
  });
1361
1361
  }
1362
- if (o >= y && o <= E && r === C) {
1363
- const b = o === E ? 1 : 0, v = o === y ? 1 : 0;
1364
- this.ctx.paint.drawLine([c + v, d + n - 1, c + h - b, d + n - 1], {
1362
+ if (o >= m && o <= C && r === b) {
1363
+ const E = o === C ? 1 : 0, v = o === m ? 1 : 0;
1364
+ this.ctx.paint.drawLine([c + v, d + n - 1, c + h - E, d + n - 1], {
1365
1365
  borderColor: u,
1366
1366
  fillColor: w,
1367
1367
  borderWidth: p,
@@ -1370,9 +1370,9 @@ class Tt extends re {
1370
1370
  lineDash: g
1371
1371
  });
1372
1372
  }
1373
- if (o === y && r >= m && r <= C) {
1374
- const b = r === C ? 1 : 0, v = r === m ? 1 : 0;
1375
- this.ctx.paint.drawLine([c + 1, d + v, c + 1, d + n - b], {
1373
+ if (o === m && r >= y && r <= b) {
1374
+ const E = r === b ? 1 : 0, v = r === y ? 1 : 0;
1375
+ this.ctx.paint.drawLine([c + 1, d + v, c + 1, d + n - E], {
1376
1376
  borderColor: u,
1377
1377
  fillColor: w,
1378
1378
  borderWidth: p,
@@ -1441,12 +1441,12 @@ class ai {
1441
1441
  const g = i._height || h, p = i._readonly;
1442
1442
  let u = !0;
1443
1443
  if (typeof c == "function" && (u = c), d) {
1444
- const y = i[d];
1445
- if (this.checkboxKeyMap.has(y)) {
1446
- const E = this.checkboxKeyMap.get(y) || [];
1447
- E.push(x), this.checkboxKeyMap.set(y, E);
1444
+ const m = i[d];
1445
+ if (this.checkboxKeyMap.has(m)) {
1446
+ const C = this.checkboxKeyMap.get(m) || [];
1447
+ C.push(x), this.checkboxKeyMap.set(m, C);
1448
1448
  } else
1449
- this.checkboxKeyMap.set(y, [x]);
1449
+ this.checkboxKeyMap.set(m, [x]);
1450
1450
  }
1451
1451
  this.selectionMap.set(x, {
1452
1452
  key: d ? i[d] : x,
@@ -1673,8 +1673,8 @@ class ai {
1673
1673
  let r = [], o = t.map((d) => {
1674
1674
  const { rowKey: f, key: x } = d;
1675
1675
  let g = d.value, p = g;
1676
- const u = this.getRowDataItemForRowKey(f), w = this.getItemValue(f, x), y = this.getVirtualBodyCellByKey(f, x);
1677
- return (y == null ? void 0 : y.type) === "number" && (["", void 0, null].includes(g) ? p = null : /^-?\d+(\.\d+)?$/.test(`${g}`) ? p = Number(g) : (p = w, r.push({
1676
+ const u = this.getRowDataItemForRowKey(f), w = this.getItemValue(f, x), m = this.getVirtualBodyCellByKey(f, x);
1677
+ return (m == null ? void 0 : m.type) === "number" && (["", void 0, null].includes(g) ? p = null : /^-?\d+(\.\d+)?$/.test(`${g}`) ? p = Number(g) : (p = w, r.push({
1678
1678
  ...d,
1679
1679
  value: p,
1680
1680
  oldValue: w,
@@ -1775,7 +1775,7 @@ class ai {
1775
1775
  };
1776
1776
  const { BEFORE_VALUE_CHANGE_METHOD: p } = this.ctx.config;
1777
1777
  if (typeof p == "function") {
1778
- const y = await p([
1778
+ const m = await p([
1779
1779
  {
1780
1780
  rowKey: t,
1781
1781
  key: e,
@@ -1784,7 +1784,7 @@ class ai {
1784
1784
  row: x
1785
1785
  }
1786
1786
  ]);
1787
- y && y.length && (c = y[0].value);
1787
+ m && m.length && (c = m[0].value);
1788
1788
  }
1789
1789
  this.changedDataMap.set(d, c), n[e] = c;
1790
1790
  const u = {
@@ -2166,7 +2166,7 @@ class ai {
2166
2166
  }
2167
2167
  ]
2168
2168
  };
2169
- let w = e, y = e, E = n, m = n, C = [], b = 0, v = 0, O = 0, S = 0;
2169
+ let w = e, m = e, C = n, y = n, b = [], E = 0, v = 0, _ = 0, S = 0;
2170
2170
  if (d !== 1 && p) {
2171
2171
  S = x;
2172
2172
  const I = h.reduce((R, A) => {
@@ -2175,8 +2175,8 @@ class ai {
2175
2175
  }, "");
2176
2176
  for (let R = e - 1; R >= 0; R--) {
2177
2177
  const A = this.rowIndexRowKeyMap.get(R) || "", L = h.reduce((M, T) => {
2178
- const B = this.getItemValue(A, T) ?? "";
2179
- return `${M}${B}`;
2178
+ const F = this.getItemValue(A, T) ?? "";
2179
+ return `${M}${F}`;
2180
2180
  }, "");
2181
2181
  if (I === L)
2182
2182
  w = R;
@@ -2185,23 +2185,23 @@ class ai {
2185
2185
  }
2186
2186
  for (let R = e; R <= this.ctx.maxRowIndex; R++) {
2187
2187
  const A = this.rowIndexRowKeyMap.get(R) || "", L = h.reduce((M, T) => {
2188
- const B = this.getItemValue(A, T) ?? "";
2189
- return `${M}${B}`;
2188
+ const F = this.getItemValue(A, T) ?? "";
2189
+ return `${M}${F}`;
2190
2190
  }, "");
2191
2191
  if (I === L)
2192
- y = R;
2192
+ m = R;
2193
2193
  else
2194
2194
  break;
2195
2195
  }
2196
2196
  for (let R = w; R < e; R++) {
2197
2197
  const { height: A } = this.positions[R];
2198
- b += A;
2198
+ E += A;
2199
2199
  }
2200
- for (let R = w; R <= y; R++) {
2200
+ for (let R = w; R <= m; R++) {
2201
2201
  const { height: A } = this.positions[R];
2202
- O += A;
2202
+ _ += A;
2203
2203
  const L = this.rowIndexRowKeyMap.get(R) || "", { item: M } = this.rowKeyMap.get(L), T = this.getItemValue(L, i);
2204
- C.push({
2204
+ b.push({
2205
2205
  rowKey: L,
2206
2206
  key: i,
2207
2207
  value: T,
@@ -2210,14 +2210,14 @@ class ai {
2210
2210
  }
2211
2211
  }
2212
2212
  if (g !== 1 && u) {
2213
- O = f;
2213
+ _ = f;
2214
2214
  for (let I = n - 1; I >= 0; I--) {
2215
2215
  const R = this.getColumnByColIndex(I);
2216
2216
  if (!R)
2217
2217
  break;
2218
2218
  const A = this.getItemValue(s, i), L = this.getItemValue(s, R.key);
2219
2219
  if (A === L && c.includes(R.key))
2220
- E = I;
2220
+ C = I;
2221
2221
  else
2222
2222
  break;
2223
2223
  }
@@ -2227,21 +2227,21 @@ class ai {
2227
2227
  break;
2228
2228
  const A = this.getItemValue(s, i), L = this.getItemValue(s, R.key);
2229
2229
  if (A === L && c.includes(R.key))
2230
- m = I;
2230
+ y = I;
2231
2231
  else
2232
2232
  break;
2233
2233
  }
2234
- for (let I = E; I < n; I++) {
2234
+ for (let I = C; I < n; I++) {
2235
2235
  const R = this.getColumnByColIndex(I);
2236
2236
  if (!R)
2237
2237
  break;
2238
2238
  v += R.width || 100;
2239
2239
  }
2240
- for (let I = E; I <= m; I++) {
2240
+ for (let I = C; I <= y; I++) {
2241
2241
  const R = this.getColumnByColIndex(I);
2242
2242
  if (!R)
2243
2243
  break;
2244
- S += R.width || 100, C.push({
2244
+ S += R.width || 100, b.push({
2245
2245
  rowKey: s,
2246
2246
  key: R.key,
2247
2247
  value: this.getItemValue(s, R.key),
@@ -2250,15 +2250,15 @@ class ai {
2250
2250
  }
2251
2251
  }
2252
2252
  return {
2253
- xArr: [E, m],
2254
- yArr: [w, y],
2253
+ xArr: [C, y],
2254
+ yArr: [w, m],
2255
2255
  rowspan: d,
2256
2256
  colspan: g,
2257
- height: O,
2257
+ height: _,
2258
2258
  width: S,
2259
- offsetTop: b,
2259
+ offsetTop: E,
2260
2260
  offsetLeft: v,
2261
- dataList: C
2261
+ dataList: b
2262
2262
  };
2263
2263
  }
2264
2264
  setLoading(t) {
@@ -2372,7 +2372,7 @@ class hi {
2372
2372
  this.ctx = t, this.init();
2373
2373
  }
2374
2374
  init() {
2375
- this.bind(window, "resize", this.handleResize.bind(this)), this.bind(window, "mouseup", this.handleMouseUp.bind(this)), this.bind(window, "mousemove", this.handleMousemove.bind(this)), this.bind(window, "blur", this.handleOutsideMousedown.bind(this)), this.bind(window, "mousedown", this.handleOutsideMousedown.bind(this)), this.bind(this.ctx.stageElement, "click", this.handleClick.bind(this)), this.bind(window, "keydown", this.handleKeydown.bind(this)), this.bind(this.ctx.stageElement, "wheel", this.handleWheel.bind(this)), this.bind(this.ctx.stageElement, "touchstart", this.handleTouchstart.bind(this)), this.bind(this.ctx.stageElement, "touchend", this.handleTouchend.bind(this)), this.bind(this.ctx.stageElement, "touchmove", this.handleTouchmove.bind(this)), this.bind(this.ctx.stageElement, "contextmenu", this.handleContextMenu.bind(this)), this.bind(this.ctx.stageElement, "mousedown", this.handleMouseDown.bind(this)), this.bind(this.ctx.stageElement, "dblclick", this.handleDblclick.bind(this)), this.bind(this.ctx.stageElement, "mouseover", this.handleMouseover.bind(this)), this.bind(this.ctx.stageElement, "mouseout", this.handleMouseout.bind(this));
2375
+ this.bind(window, "resize", this.handleResize.bind(this)), this.bind(window, "mouseup", this.handleMouseUp.bind(this)), this.bind(window, "mousemove", this.handleMousemove.bind(this)), this.bind(window, "blur", this.handleOutsideMousedown.bind(this)), this.bind(window, "mousedown", this.handleOutsideMousedown.bind(this)), this.bind(this.ctx.stageElement, "click", this.handleClick.bind(this)), this.bind(window, "keydown", this.handleKeydown.bind(this)), this.bind(this.ctx.stageElement, "wheel", this.handleWheel.bind(this), { passive: !1 }), this.bind(this.ctx.stageElement, "touchstart", this.handleTouchstart.bind(this), { passive: !1 }), this.bind(this.ctx.stageElement, "touchend", this.handleTouchend.bind(this)), this.bind(this.ctx.stageElement, "touchmove", this.handleTouchmove.bind(this), { passive: !1 }), this.bind(this.ctx.stageElement, "contextmenu", this.handleContextMenu.bind(this)), this.bind(this.ctx.stageElement, "mousedown", this.handleMouseDown.bind(this)), this.bind(this.ctx.stageElement, "dblclick", this.handleDblclick.bind(this)), this.bind(this.ctx.stageElement, "mouseover", this.handleMouseover.bind(this)), this.bind(this.ctx.stageElement, "mouseout", this.handleMouseout.bind(this));
2376
2376
  }
2377
2377
  destroy() {
2378
2378
  this.eventTasks.forEach((t, e) => {
@@ -2854,24 +2854,30 @@ class fi {
2854
2854
  for (let e = 0; e < this.ctx.config.ICONS.length; e++) {
2855
2855
  const i = this.ctx.config.ICONS[e];
2856
2856
  let s = i.color;
2857
- const r = this.createImageFromSVG(i.svg, s).then((o) => {
2857
+ const r = this.createImageFromSVG(i.svg, s, i.isBlob).then((o) => {
2858
2858
  this.icons.set(i.name, o);
2859
2859
  });
2860
2860
  t.push(r);
2861
2861
  }
2862
2862
  await Promise.all(t), this.ctx.emit("draw");
2863
2863
  }
2864
- async createImageFromSVG(t, e) {
2865
- const r = new DOMParser().parseFromString(t, "image/svg+xml").documentElement;
2866
- e && r.querySelectorAll("*").forEach((c) => {
2864
+ async createImageFromSVG(t, e, i = !1) {
2865
+ const o = new DOMParser().parseFromString(t, "image/svg+xml").documentElement;
2866
+ e && o.querySelectorAll("*").forEach((c) => {
2867
2867
  c.setAttribute("fill", e);
2868
2868
  });
2869
- const o = new Image(), n = new Blob([new XMLSerializer().serializeToString(r)], {
2870
- type: "image/svg+xml"
2871
- }), h = URL.createObjectURL(n);
2872
- return o.src = h, new Promise((c, d) => {
2873
- o.onerror = () => d(new Error("Failed to load image")), o.onload = () => {
2874
- c(o);
2869
+ const n = new Image();
2870
+ let h = "";
2871
+ if (i) {
2872
+ const c = new Blob([new XMLSerializer().serializeToString(o)], {
2873
+ type: "image/svg+xml"
2874
+ });
2875
+ h = URL.createObjectURL(c);
2876
+ } else
2877
+ h = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(new XMLSerializer().serializeToString(o));
2878
+ return n.src = h, new Promise((c, d) => {
2879
+ n.onerror = () => d(new Error("Failed to load image")), n.onload = () => {
2880
+ c(n);
2875
2881
  };
2876
2882
  });
2877
2883
  }
@@ -3927,32 +3933,32 @@ class pi {
3927
3933
  this.height = p, this.data = g, this.width = e.width, this.visibleWidth = this.ctx.stageWidth - o;
3928
3934
  const u = this.ctx.footer.height;
3929
3935
  !this.data.length && !n ? this.height = h : !this.data.length && n && (this.height = n - e.height - u - o);
3930
- const w = this.data.length ? "not-empty" : "empty";
3936
+ let w = this.height + e.height + o;
3937
+ w += u;
3938
+ let m = w;
3939
+ const C = window.innerHeight, { top: y } = this.containerRect || this.ctx.containerElement.getBoundingClientRect();
3940
+ if (C > y && d && !n) {
3941
+ const R = C - y - f;
3942
+ R > e.height + o ? m = R : w > c && (m = c);
3943
+ } else this.data.length && n ? m = n : this.data.length && c && w > c && (m = c);
3944
+ m > 0 && (this.ctx.stageHeight = Math.floor(m), this.ctx.stageElement.style.height = `${this.ctx.stageHeight - 0.5}px`);
3945
+ let b = this.ctx.stageHeight - e.height - o;
3946
+ r ? this.visibleHeight = b - u : 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;
3947
+ const E = window.devicePixelRatio || 1, v = this.ctx.stageWidth * E, _ = this.ctx.stageHeight * E;
3948
+ t.width = Math.floor(v), t.height = Math.floor(_);
3949
+ const S = this.data.length ? "not-empty" : "empty";
3931
3950
  this.ctx.emit("emptyChange", {
3932
- isEmpty: w,
3933
- type: w,
3951
+ isEmpty: S,
3952
+ type: S,
3934
3953
  headerHeight: e.height,
3935
3954
  bodyHeight: this.height,
3936
3955
  footerHeight: u,
3937
3956
  width: this.width,
3938
3957
  height: this.data.length ? 0 : h + u
3939
- });
3940
- let y = this.height + e.height + o;
3941
- y += u;
3942
- let E = y;
3943
- const m = window.innerHeight, { top: C } = this.containerRect || this.ctx.containerElement.getBoundingClientRect();
3944
- if (this.data.length && m > C && d && !n) {
3945
- const R = m - C - f;
3946
- R > e.height + o ? E = R : y > c && (E = c);
3947
- } else this.data.length && n ? E = n : this.data.length && c && y > c && (E = c);
3948
- E > 0 && (this.ctx.stageHeight = Math.floor(E), this.ctx.stageElement.style.height = `${this.ctx.stageHeight - 0.5}px`);
3949
- let b = this.ctx.stageHeight - e.height - o;
3950
- r ? this.visibleHeight = b - u : this.visibleHeight = b, 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;
3951
- const v = window.devicePixelRatio || 1, O = this.ctx.stageWidth * v, S = this.ctx.stageHeight * v;
3952
- t.width = Math.floor(O), t.height = Math.floor(S), this.ctx.canvasElement.setAttribute(
3958
+ }), this.ctx.canvasElement.setAttribute(
3953
3959
  "style",
3954
3960
  ` height:${this.ctx.stageHeight}px;width:${this.ctx.stageWidth}px;`
3955
- ), this.ctx.paint.scale(v);
3961
+ ), this.ctx.paint.scale(E);
3956
3962
  }
3957
3963
  // 调整行的高度
3958
3964
  initResizeRow() {
@@ -4095,7 +4101,7 @@ class pi {
4095
4101
  }), this.drawTipLine();
4096
4102
  }
4097
4103
  }
4098
- class yi {
4104
+ class mi {
4099
4105
  constructor(t) {
4100
4106
  l(this, "ctx");
4101
4107
  l(this, "renderRows", []);
@@ -4176,7 +4182,7 @@ class yi {
4176
4182
  }), this.drawTopLine();
4177
4183
  }
4178
4184
  }
4179
- class mi {
4185
+ class yi {
4180
4186
  // 垂直滚动定时器
4181
4187
  constructor(t) {
4182
4188
  l(this, "isCut", !1);
@@ -4297,24 +4303,24 @@ class mi {
4297
4303
  SELECTOR_AREA_MAX_X_OFFSET: f,
4298
4304
  SELECTOR_AREA_MAX_Y_OFFSET: x
4299
4305
  } = this.ctx.config, g = n, p = h || this.ctx.maxColIndex - f, u = c, w = d || this.ctx.maxRowIndex - x;
4300
- let [y, E] = r, [m, C] = o;
4301
- if (y < g || E > p || m < u || C > w)
4306
+ let [m, C] = r, [y, b] = o;
4307
+ if (m < g || C > p || y < u || b > w)
4302
4308
  return;
4303
4309
  if (this.ctx.stageElement.focus({ preventScroll: !0 }), this.ctx.config.ENABLE_MERGE_CELL_LINK) {
4304
4310
  const v = this.adjustMergeCells(r, o);
4305
- m = v.yArr[0], C = v.yArr[1], y = v.xArr[0], E = v.xArr[1], this.ctx.onlyMergeCell = v.onlyMergeCell;
4311
+ y = v.yArr[0], b = v.yArr[1], m = v.xArr[0], C = v.xArr[1], this.ctx.onlyMergeCell = v.onlyMergeCell;
4306
4312
  }
4307
- 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)];
4308
- const { BEFORE_SET_SELECTOR_METHOD: b } = this.ctx.config;
4309
- if (typeof b == "function") {
4310
- const O = b({
4313
+ m === C && y === b ? this.ctx.selectOnlyOne = !0 : this.ctx.selectOnlyOne = !1, r = [Math.max(g, m), Math.min(p, C)], o = [Math.max(u, y), Math.min(w, b)];
4314
+ const { BEFORE_SET_SELECTOR_METHOD: E } = this.ctx.config;
4315
+ if (typeof E == "function") {
4316
+ const _ = E({
4311
4317
  focusCell: this.ctx.focusCell,
4312
4318
  xArr: r,
4313
4319
  yArr: o
4314
4320
  });
4315
- if (!O)
4321
+ if (!_)
4316
4322
  return;
4317
- r = O.xArr, o = O.yArr;
4323
+ r = _.xArr, o = _.yArr;
4318
4324
  }
4319
4325
  this.ctx.selector.xArr = r, this.ctx.selector.yArr = o, this.ctx.emit("setSelector", this.ctx.selector), this.ctx.emit("drawView");
4320
4326
  }
@@ -4325,13 +4331,13 @@ class mi {
4325
4331
  let n = [], h = [];
4326
4332
  for (let u = 0; u <= e[1] - e[0]; u++)
4327
4333
  for (let w = 0; w <= t[1] - t[0]; w++) {
4328
- const y = u + e[0], E = w + t[0], m = this.ctx.database.getVirtualBodyCell(y, E);
4329
- m && ((y === i || y === s) && n.push(m), (E === r || E === o) && h.push(m));
4334
+ const m = u + e[0], C = w + t[0], y = this.ctx.database.getVirtualBodyCell(m, C);
4335
+ y && ((m === i || m === s) && n.push(y), (C === r || C === o) && h.push(y));
4330
4336
  }
4331
4337
  const c = n.reduce(
4332
4338
  (u, w) => {
4333
- const { yArr: y } = w.getSpanInfo(), [E, m] = y;
4334
- return u.minY = Math.min(u.minY, E), u.maxY = Math.max(u.maxY, m), u;
4339
+ const { yArr: m } = w.getSpanInfo(), [C, y] = m;
4340
+ return u.minY = Math.min(u.minY, C), u.maxY = Math.max(u.maxY, y), u;
4335
4341
  },
4336
4342
  {
4337
4343
  minY: i,
@@ -4339,8 +4345,8 @@ class mi {
4339
4345
  }
4340
4346
  ), d = h.reduce(
4341
4347
  (u, w) => {
4342
- const { xArr: y } = w.getSpanInfo(), [E, m] = y;
4343
- return u.minX = Math.min(u.minX, E), u.maxX = Math.max(u.maxX, m), u;
4348
+ const { xArr: m } = w.getSpanInfo(), [C, y] = m;
4349
+ return u.minX = Math.min(u.minX, C), u.maxX = Math.max(u.maxX, y), u;
4344
4350
  },
4345
4351
  {
4346
4352
  minX: r,
@@ -4530,29 +4536,39 @@ class mi {
4530
4536
  const e = this.ctx.selector.yArr[0], i = this.ctx.selector.xArr[0], s = /* @__PURE__ */ new Set();
4531
4537
  navigator.clipboard.readText().then(async (r) => {
4532
4538
  let o = si(r);
4533
- const n = [i, i + o[0].length - 1], h = [e, e + o.length - 1], c = o.length === 1 && o[0].length === 1;
4534
- if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(n, h) && !c) {
4535
- const g = {
4539
+ const n = [i, i + o[0].length - 1], h = [e, e + o.length - 1], [c, d] = h, [f, x] = n, g = d - this.ctx.maxRowIndex, p = x - this.ctx.maxColIndex;
4540
+ (g > 0 || p > 0) && this.ctx.emit("onPastedDataOverflow", {
4541
+ maxY: d,
4542
+ maxX: x,
4543
+ minY: c,
4544
+ minX: f,
4545
+ overflowRowCount: g,
4546
+ overflowColCount: p,
4547
+ textArr: o
4548
+ });
4549
+ const u = o.length === 1 && o[0].length === 1;
4550
+ if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(n, h) && !u) {
4551
+ const y = {
4536
4552
  code: "ERR_MERGED_CELLS_PASTE",
4537
4553
  message: "Merged cells cannot span paste data"
4538
4554
  };
4539
- this.ctx.hasEvent("error") ? this.ctx.emit("error", g) : alert(g.message);
4555
+ this.ctx.hasEvent("error") ? this.ctx.emit("error", y) : alert(y.message);
4540
4556
  return;
4541
4557
  }
4542
- let d = [];
4543
- for (let g = 0; g <= o.length - 1; g++) {
4544
- const p = o[g].length;
4545
- for (let u = 0; u <= p - 1; u++) {
4546
- const w = g + e, y = u + i, E = o[g][u], m = this.ctx.database.getItemValueForRowIndexAndColIndex(
4547
- w,
4548
- y
4558
+ let w = [];
4559
+ for (let y = 0; y <= o.length - 1; y++) {
4560
+ const b = o[y].length;
4561
+ for (let E = 0; E <= b - 1; E++) {
4562
+ const v = y + e, _ = E + i, S = o[y][E], I = this.ctx.database.getItemValueForRowIndexAndColIndex(
4563
+ v,
4564
+ _
4549
4565
  );
4550
- if (m) {
4551
- const { rowKey: C, key: b } = m;
4552
- this.ctx.database.getReadonly(C, b) || (s.add(C), d.push({
4553
- rowKey: C,
4554
- key: b,
4555
- value: E,
4566
+ if (I) {
4567
+ const { rowKey: R, key: A } = I;
4568
+ this.ctx.database.getReadonly(R, A) || (s.add(R), w.push({
4569
+ rowKey: R,
4570
+ key: A,
4571
+ value: S,
4556
4572
  row: {}
4557
4573
  //内部有设置
4558
4574
  }));
@@ -4560,35 +4576,35 @@ class mi {
4560
4576
  }
4561
4577
  }
4562
4578
  if (this.isCut) {
4563
- const g = this.clearSelectedData(
4579
+ const y = this.clearSelectedData(
4564
4580
  this.ctx.selector.xArrCopy,
4565
4581
  this.ctx.selector.yArrCopy,
4566
4582
  !0
4567
4583
  // 忽略设置,只返回数据,用于cut,实现历史回退需要返回两次问题
4568
- ), p = d.map((u) => `${u.rowKey}-${u.key}`);
4569
- g.forEach((u) => {
4570
- p.includes(`${u.rowKey}-${u.key}`) || d.unshift(u);
4584
+ ), b = w.map((E) => `${E.rowKey}-${E.key}`);
4585
+ y.forEach((E) => {
4586
+ b.includes(`${E.rowKey}-${E.key}`) || w.unshift(E);
4571
4587
  }), this.isCut = !1;
4572
4588
  }
4573
- if (!d.length)
4589
+ if (!w.length)
4574
4590
  return;
4575
- const { BEFORE_PASTE_DATA_METHOD: f } = this.ctx.config;
4576
- if (typeof f == "function") {
4577
- const g = f, p = d.map((u) => ({
4578
- rowKey: u.rowKey,
4579
- key: u.key,
4580
- value: u.value,
4581
- oldValue: this.ctx.database.getItemValue(u.rowKey, u.key),
4582
- row: this.ctx.database.getRowDataItemForRowKey(u.rowKey)
4591
+ const { BEFORE_PASTE_DATA_METHOD: m } = this.ctx.config;
4592
+ if (typeof m == "function") {
4593
+ const y = m, b = w.map((E) => ({
4594
+ rowKey: E.rowKey,
4595
+ key: E.key,
4596
+ value: E.value,
4597
+ oldValue: this.ctx.database.getItemValue(E.rowKey, E.key),
4598
+ row: this.ctx.database.getRowDataItemForRowKey(E.rowKey)
4583
4599
  }));
4584
- if (d = await g(p, n, h), d && !d.length)
4600
+ if (w = await y(b, n, h, o), w && !w.length)
4585
4601
  return;
4586
4602
  }
4587
- this.clearCopyLine(), this.ctx.batchSetItemValueByEditor(d, !0);
4588
- let x = [];
4589
- s.forEach((g) => {
4590
- x.push(this.ctx.database.getRowDataItemForRowKey(g));
4591
- }), this.ctx.emit("pasteChange", d, x);
4603
+ this.clearCopyLine(), this.ctx.batchSetItemValueByEditor(w, !0);
4604
+ let C = [];
4605
+ s.forEach((y) => {
4606
+ C.push(this.ctx.database.getRowDataItemForRowKey(y));
4607
+ }), this.ctx.emit("pasteChange", w, C);
4592
4608
  }).catch((r) => {
4593
4609
  console.error("Failed to get the clipboard content:", r);
4594
4610
  });
@@ -4682,14 +4698,14 @@ class mi {
4682
4698
  if (!i)
4683
4699
  return;
4684
4700
  p && this.ctx.onlyMergeCell && i.updateSpanInfo();
4685
- const { drawX: u, drawY: w, width: y, height: E, fixed: m } = i, C = r - u + 1, b = i.drawX + y - (e - s) + 1;
4686
- let v = o.height - w, O = E;
4687
- O > h.visibleHeight && (O = h.visibleHeight);
4701
+ const { drawX: u, drawY: w, width: m, height: C, fixed: y } = i, b = r - u + 1, E = i.drawX + m - (e - s) + 1;
4702
+ let v = o.height - w, _ = C;
4703
+ _ > h.visibleHeight && (_ = h.visibleHeight);
4688
4704
  let S = 0;
4689
4705
  x && (g === "top" ? v = o.height + n.height - w : S = n.visibleHeight);
4690
- const I = w + O - (t - S - f);
4706
+ const I = w + _ - (t - S - f);
4691
4707
  let R = c, A = d;
4692
- 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));
4708
+ E > 0 && !y ? R = Math.floor(c + E) : b > 0 && !y && (R = Math.floor(c - b)), 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));
4693
4709
  }
4694
4710
  destroy() {
4695
4711
  this.timerX && (clearTimeout(this.timerX), this.timerX = 0), this.timerY && (clearTimeout(this.timerY), this.timerY = 0);
@@ -4753,11 +4769,11 @@ class Ei {
4753
4769
  SELECTOR_AREA_MAX_Y: f,
4754
4770
  SELECTOR_AREA_MAX_X_OFFSET: x,
4755
4771
  SELECTOR_AREA_MAX_Y_OFFSET: g
4756
- } = this.ctx.config, p = h, u = c || this.ctx.maxColIndex - x, w = d, y = f || this.ctx.maxRowIndex - g;
4757
- let [E, m] = o, [C, b] = n;
4758
- if (E < p || C < w)
4772
+ } = this.ctx.config, p = h, u = c || this.ctx.maxColIndex - x, w = d, m = f || this.ctx.maxRowIndex - g;
4773
+ let [C, y] = o, [b, E] = n;
4774
+ if (C < p || b < w)
4759
4775
  return;
4760
- o = [Math.max(p, E), Math.min(u, m)], n = [Math.max(w, C), Math.min(y, b)];
4776
+ o = [Math.max(p, C), Math.min(u, y)], n = [Math.max(w, b), Math.min(m, E)];
4761
4777
  const { BEFORE_SET_AUTOFILL_METHOD: v } = this.ctx.config;
4762
4778
  if (typeof v == "function") {
4763
4779
  const S = v({
@@ -4794,13 +4810,13 @@ class Ei {
4794
4810
  let d = [];
4795
4811
  for (let g = 0; g <= h[1] - h[0]; g++)
4796
4812
  for (let p = 0; p <= n[1] - n[0]; p++) {
4797
- 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}`;
4798
- if (E && !i.has(m)) {
4799
- const { rowKey: C, key: b } = E;
4800
- this.ctx.database.getReadonly(C, b) || (t.add(C), d.push({
4801
- rowKey: C,
4802
- key: b,
4803
- value: y,
4813
+ const u = p + n[0], w = g + h[0], m = s[g % o][p % r], C = this.ctx.database.getItemValueForRowIndexAndColIndex(w, u), y = `${w}-${u}`;
4814
+ if (C && !i.has(y)) {
4815
+ const { rowKey: b, key: E } = C;
4816
+ this.ctx.database.getReadonly(b, E) || (t.add(b), d.push({
4817
+ rowKey: b,
4818
+ key: E,
4819
+ value: m,
4804
4820
  row: {}
4805
4821
  }));
4806
4822
  }
@@ -5009,13 +5025,13 @@ const Si = async (a, t, e) => {
5009
5025
  for (let u = 0; u < n.length; u++) {
5010
5026
  const {
5011
5027
  name: w,
5012
- fn: y
5028
+ fn: m
5013
5029
  } = n[u], {
5014
- x: E,
5015
- y: m,
5016
- data: C,
5017
- reset: b
5018
- } = await y({
5030
+ x: C,
5031
+ y,
5032
+ data: b,
5033
+ reset: E
5034
+ } = await m({
5019
5035
  x: d,
5020
5036
  y: f,
5021
5037
  initialPlacement: i,
@@ -5029,17 +5045,17 @@ const Si = async (a, t, e) => {
5029
5045
  floating: t
5030
5046
  }
5031
5047
  });
5032
- d = E ?? d, f = m ?? f, g = {
5048
+ d = C ?? d, f = y ?? f, g = {
5033
5049
  ...g,
5034
5050
  [w]: {
5035
5051
  ...g[w],
5036
- ...C
5052
+ ...b
5037
5053
  }
5038
- }, b && p <= 50 && (p++, typeof b == "object" && (b.placement && (x = b.placement), b.rects && (c = b.rects === !0 ? await o.getElementRects({
5054
+ }, E && p <= 50 && (p++, typeof E == "object" && (E.placement && (x = E.placement), E.rects && (c = E.rects === !0 ? await o.getElementRects({
5039
5055
  reference: a,
5040
5056
  floating: t,
5041
5057
  strategy: s
5042
- }) : b.rects), {
5058
+ }) : E.rects), {
5043
5059
  x: d,
5044
5060
  y: f
5045
5061
  } = $t(c, x, h)), u = -1);
@@ -5068,33 +5084,33 @@ async function he(a, t) {
5068
5084
  elementContext: f = "floating",
5069
5085
  altBoundary: x = !1,
5070
5086
  padding: g = 0
5071
- } = at(t, a), p = le(g), w = n[x ? f === "floating" ? "reference" : "floating" : f], y = ut(await r.getClippingRect({
5087
+ } = at(t, a), p = le(g), w = n[x ? f === "floating" ? "reference" : "floating" : f], m = ut(await r.getClippingRect({
5072
5088
  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)),
5073
5089
  boundary: c,
5074
5090
  rootBoundary: d,
5075
5091
  strategy: h
5076
- })), E = f === "floating" ? {
5092
+ })), C = f === "floating" ? {
5077
5093
  x: i,
5078
5094
  y: s,
5079
5095
  width: o.floating.width,
5080
5096
  height: o.floating.height
5081
- } : 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)) || {
5097
+ } : o.reference, y = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(n.floating)), b = await (r.isElement == null ? void 0 : r.isElement(y)) ? await (r.getScale == null ? void 0 : r.getScale(y)) || {
5082
5098
  x: 1,
5083
5099
  y: 1
5084
5100
  } : {
5085
5101
  x: 1,
5086
5102
  y: 1
5087
- }, b = ut(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
5103
+ }, E = ut(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
5088
5104
  elements: n,
5089
- rect: E,
5090
- offsetParent: m,
5105
+ rect: C,
5106
+ offsetParent: y,
5091
5107
  strategy: h
5092
- }) : E);
5108
+ }) : C);
5093
5109
  return {
5094
- top: (y.top - b.top + p.top) / C.y,
5095
- bottom: (b.bottom - y.bottom + p.bottom) / C.y,
5096
- left: (y.left - b.left + p.left) / C.x,
5097
- right: (b.right - y.right + p.right) / C.x
5110
+ top: (m.top - E.top + p.top) / b.y,
5111
+ bottom: (E.bottom - m.bottom + p.bottom) / b.y,
5112
+ left: (m.left - E.left + p.left) / b.x,
5113
+ right: (E.right - m.right + p.right) / b.x
5098
5114
  };
5099
5115
  }
5100
5116
  const Li = (a) => ({
@@ -5118,15 +5134,15 @@ const Li = (a) => ({
5118
5134
  const f = le(d), x = {
5119
5135
  x: e,
5120
5136
  y: i
5121
- }, 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));
5122
- let O = v ? v[m] : 0;
5123
- (!O || !await (o.isElement == null ? void 0 : o.isElement(v))) && (O = n.floating[m] || r.floating[p]);
5124
- const S = C / 2 - b / 2, I = O / 2 - u[p] / 2 - 1, R = rt(f[y], I), A = rt(f[E], I), L = R, M = O - u[p] - A, T = O / 2 - u[p] / 2 + S, B = _t(L, T, M), Y = !h.arrow && lt(s) != null && T !== B && r.reference[p] / 2 - (T < L ? R : A) - u[p] / 2 < 0, k = Y ? T < L ? T - L : T - M : 0;
5137
+ }, g = Ht(s), p = Mt(g), u = await o.getDimensions(c), w = g === "y", m = w ? "top" : "left", C = w ? "bottom" : "right", y = w ? "clientHeight" : "clientWidth", b = r.reference[p] + r.reference[g] - x[g] - r.floating[p], E = x[g] - r.reference[g], v = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(c));
5138
+ let _ = v ? v[y] : 0;
5139
+ (!_ || !await (o.isElement == null ? void 0 : o.isElement(v))) && (_ = n.floating[y] || r.floating[p]);
5140
+ const S = b / 2 - E / 2, I = _ / 2 - u[p] / 2 - 1, R = rt(f[m], I), A = rt(f[C], I), L = R, M = _ - u[p] - A, T = _ / 2 - u[p] / 2 + S, F = _t(L, T, M), Y = !h.arrow && lt(s) != null && T !== F && r.reference[p] / 2 - (T < L ? R : A) - u[p] / 2 < 0, k = Y ? T < L ? T - L : T - M : 0;
5125
5141
  return {
5126
5142
  [g]: x[g] + k,
5127
5143
  data: {
5128
- [g]: B,
5129
- centerOffset: T - B - k,
5144
+ [g]: F,
5145
+ centerOffset: T - F - k,
5130
5146
  ...Y && {
5131
5147
  alignmentOffset: k
5132
5148
  }
@@ -5158,12 +5174,12 @@ const Li = (a) => ({
5158
5174
  } = at(a, t);
5159
5175
  if ((e = r.arrow) != null && e.alignmentOffset)
5160
5176
  return {};
5161
- const y = G(s), E = J(n), m = G(n) === n, C = await (h.isRTL == null ? void 0 : h.isRTL(c.floating)), b = x || (m || !u ? [xt(n)] : Ri(n)), v = p !== "none";
5162
- !x && v && b.push(..._i(n, u, p, C));
5163
- const O = [n, ...b], S = await he(t, w), I = [];
5177
+ const m = G(s), C = J(n), y = G(n) === n, b = await (h.isRTL == null ? void 0 : h.isRTL(c.floating)), E = x || (y || !u ? [xt(n)] : Ri(n)), v = p !== "none";
5178
+ !x && v && E.push(..._i(n, u, p, b));
5179
+ const _ = [n, ...E], S = await he(t, w), I = [];
5164
5180
  let R = ((i = r.flip) == null ? void 0 : i.overflows) || [];
5165
- if (d && I.push(S[y]), f) {
5166
- const T = vi(s, o, C);
5181
+ if (d && I.push(S[m]), f) {
5182
+ const T = vi(s, o, b);
5167
5183
  I.push(S[T[0]], S[T[1]]);
5168
5184
  }
5169
5185
  if (R = [...R, {
@@ -5171,15 +5187,15 @@ const Li = (a) => ({
5171
5187
  overflows: I
5172
5188
  }], !I.every((T) => T <= 0)) {
5173
5189
  var A, L;
5174
- const T = (((A = r.flip) == null ? void 0 : A.index) || 0) + 1, B = O[T];
5175
- if (B)
5190
+ const T = (((A = r.flip) == null ? void 0 : A.index) || 0) + 1, F = _[T];
5191
+ if (F)
5176
5192
  return {
5177
5193
  data: {
5178
5194
  index: T,
5179
5195
  overflows: R
5180
5196
  },
5181
5197
  reset: {
5182
- placement: B
5198
+ placement: F
5183
5199
  }
5184
5200
  };
5185
5201
  let Y = (L = R.filter((k) => k.overflows[0] <= 0).sort((k, W) => k.overflows[1] - W.overflows[1])[0]) == null ? void 0 : L.placement;
@@ -5190,7 +5206,7 @@ const Li = (a) => ({
5190
5206
  const k = (M = R.filter((W) => {
5191
5207
  if (v) {
5192
5208
  const P = J(W.placement);
5193
- return P === E || // Create a bias to the `y` side axis due to horizontal
5209
+ return P === C || // Create a bias to the `y` side axis due to horizontal
5194
5210
  // reading directions favoring greater width.
5195
5211
  P === "y";
5196
5212
  }
@@ -5278,12 +5294,12 @@ const Mi = function(a) {
5278
5294
  limiter: n = {
5279
5295
  fn: (w) => {
5280
5296
  let {
5281
- x: y,
5282
- y: E
5297
+ x: m,
5298
+ y: C
5283
5299
  } = w;
5284
5300
  return {
5285
- x: y,
5286
- y: E
5301
+ x: m,
5302
+ y: C
5287
5303
  };
5288
5304
  }
5289
5305
  },
@@ -5294,12 +5310,12 @@ const Mi = function(a) {
5294
5310
  }, d = await he(t, h), f = J(G(s)), x = ae(f);
5295
5311
  let g = c[x], p = c[f];
5296
5312
  if (r) {
5297
- const w = x === "y" ? "top" : "left", y = x === "y" ? "bottom" : "right", E = g + d[w], m = g - d[y];
5298
- g = _t(E, g, m);
5313
+ const w = x === "y" ? "top" : "left", m = x === "y" ? "bottom" : "right", C = g + d[w], y = g - d[m];
5314
+ g = _t(C, g, y);
5299
5315
  }
5300
5316
  if (o) {
5301
- const w = f === "y" ? "top" : "left", y = f === "y" ? "bottom" : "right", E = p + d[w], m = p - d[y];
5302
- p = _t(E, p, m);
5317
+ const w = f === "y" ? "top" : "left", m = f === "y" ? "bottom" : "right", C = p + d[w], y = p - d[m];
5318
+ p = _t(C, p, y);
5303
5319
  }
5304
5320
  const u = n.fn({
5305
5321
  ...t,
@@ -5352,7 +5368,7 @@ function ht(a) {
5352
5368
  overflowX: e,
5353
5369
  overflowY: i,
5354
5370
  display: s
5355
- } = F(a);
5371
+ } = B(a);
5356
5372
  return /auto|scroll|overlay|hidden|clip/.test(t + i + e) && !["inline", "contents"].includes(s);
5357
5373
  }
5358
5374
  function Di(a) {
@@ -5368,7 +5384,7 @@ function wt(a) {
5368
5384
  });
5369
5385
  }
5370
5386
  function Dt(a) {
5371
- const t = Nt(), e = X(a) ? F(a) : a;
5387
+ const t = Nt(), e = X(a) ? B(a) : a;
5372
5388
  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));
5373
5389
  }
5374
5390
  function Ni(a) {
@@ -5388,7 +5404,7 @@ function Nt() {
5388
5404
  function Q(a) {
5389
5405
  return ["html", "body", "#document"].includes(tt(a));
5390
5406
  }
5391
- function F(a) {
5407
+ function B(a) {
5392
5408
  return N(a).getComputedStyle(a);
5393
5409
  }
5394
5410
  function pt(a) {
@@ -5430,7 +5446,7 @@ function Lt(a) {
5430
5446
  return a.parent && Object.getPrototypeOf(a.parent) ? a.frameElement : null;
5431
5447
  }
5432
5448
  function fe(a) {
5433
- const t = F(a);
5449
+ const t = B(a);
5434
5450
  let e = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
5435
5451
  const s = K(a), r = s ? a.offsetWidth : e, o = s ? a.offsetHeight : i, n = ft(e) !== r || ft(i) !== o;
5436
5452
  return n && (e = r, i = o), {
@@ -5465,7 +5481,7 @@ function ue(a) {
5465
5481
  y: t.visualViewport.offsetTop
5466
5482
  };
5467
5483
  }
5468
- function Fi(a, t, e) {
5484
+ function Bi(a, t, e) {
5469
5485
  return t === void 0 && (t = !1), !e || t && e !== N(a) ? !1 : t;
5470
5486
  }
5471
5487
  function ot(a, t, e, i) {
@@ -5473,14 +5489,14 @@ function ot(a, t, e, i) {
5473
5489
  const s = a.getBoundingClientRect(), r = xe(a);
5474
5490
  let o = z(1);
5475
5491
  t && (i ? X(i) && (o = Z(i)) : o = Z(a));
5476
- const n = Fi(r, e, i) ? ue(r) : z(0);
5492
+ const n = Bi(r, e, i) ? ue(r) : z(0);
5477
5493
  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;
5478
5494
  if (r) {
5479
5495
  const x = N(r), g = i && X(i) ? N(i) : i;
5480
5496
  let p = x, u = Lt(p);
5481
5497
  for (; u && i && g !== p; ) {
5482
- const w = Z(u), y = u.getBoundingClientRect(), E = F(u), m = y.left + (u.clientLeft + parseFloat(E.paddingLeft)) * w.x, C = y.top + (u.clientTop + parseFloat(E.paddingTop)) * w.y;
5483
- h *= w.x, c *= w.y, d *= w.x, f *= w.y, h += m, c += C, p = N(u), u = Lt(p);
5498
+ const w = Z(u), m = u.getBoundingClientRect(), C = B(u), y = m.left + (u.clientLeft + parseFloat(C.paddingLeft)) * w.x, b = m.top + (u.clientTop + parseFloat(C.paddingTop)) * w.y;
5499
+ h *= w.x, c *= w.y, d *= w.x, f *= w.y, h += y, c += b, p = N(u), u = Lt(p);
5484
5500
  }
5485
5501
  }
5486
5502
  return ut({
@@ -5490,7 +5506,7 @@ function ot(a, t, e, i) {
5490
5506
  y: c
5491
5507
  });
5492
5508
  }
5493
- function Bi(a) {
5509
+ function Fi(a) {
5494
5510
  let {
5495
5511
  elements: t,
5496
5512
  rect: e,
@@ -5527,7 +5543,7 @@ function Ki(a) {
5527
5543
  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);
5528
5544
  let o = -e.scrollLeft + At(a);
5529
5545
  const n = -e.scrollTop;
5530
- return F(i).direction === "rtl" && (o += U(t.clientWidth, i.clientWidth) - s), {
5546
+ return B(i).direction === "rtl" && (o += U(t.clientWidth, i.clientWidth) - s), {
5531
5547
  width: s,
5532
5548
  height: r,
5533
5549
  x: o,
@@ -5578,17 +5594,17 @@ function Gt(a, t, e) {
5578
5594
  }
5579
5595
  function ge(a, t) {
5580
5596
  const e = $(a);
5581
- return e === t || !X(e) || Q(e) ? !1 : F(e).position === "fixed" || ge(e, t);
5597
+ return e === t || !X(e) || Q(e) ? !1 : B(e).position === "fixed" || ge(e, t);
5582
5598
  }
5583
5599
  function Wi(a, t) {
5584
5600
  const e = t.get(a);
5585
5601
  if (e)
5586
5602
  return e;
5587
5603
  let i = St(a, [], !1).filter((n) => X(n) && tt(n) !== "body"), s = null;
5588
- const r = F(a).position === "fixed";
5604
+ const r = B(a).position === "fixed";
5589
5605
  let o = r ? $(a) : a;
5590
5606
  for (; X(o) && !Q(o); ) {
5591
- const n = F(o), h = Dt(o);
5607
+ const n = B(o), h = Dt(o);
5592
5608
  !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);
5593
5609
  }
5594
5610
  return t.set(a, i), i;
@@ -5647,11 +5663,11 @@ function $i(a, t, e) {
5647
5663
  height: o.height
5648
5664
  };
5649
5665
  }
5650
- function mt(a) {
5651
- return F(a).position === "static";
5666
+ function yt(a) {
5667
+ return B(a).position === "static";
5652
5668
  }
5653
5669
  function jt(a, t) {
5654
- if (!K(a) || F(a).position === "fixed")
5670
+ if (!K(a) || B(a).position === "fixed")
5655
5671
  return null;
5656
5672
  if (t)
5657
5673
  return t(a);
@@ -5665,16 +5681,16 @@ function we(a, t) {
5665
5681
  if (!K(a)) {
5666
5682
  let s = $(a);
5667
5683
  for (; s && !Q(s); ) {
5668
- if (X(s) && !mt(s))
5684
+ if (X(s) && !yt(s))
5669
5685
  return s;
5670
5686
  s = $(s);
5671
5687
  }
5672
5688
  return e;
5673
5689
  }
5674
5690
  let i = jt(a, t);
5675
- for (; i && Di(i) && mt(i); )
5691
+ for (; i && Di(i) && yt(i); )
5676
5692
  i = jt(i, t);
5677
- return i && Q(i) && mt(i) && !Dt(i) ? e : i || Ni(a) || e;
5693
+ return i && Q(i) && yt(i) && !Dt(i) ? e : i || Ni(a) || e;
5678
5694
  }
5679
5695
  const qi = async function(a) {
5680
5696
  const t = this.getOffsetParent || we, e = this.getDimensions, i = await e(a.floating);
@@ -5689,10 +5705,10 @@ const qi = async function(a) {
5689
5705
  };
5690
5706
  };
5691
5707
  function Gi(a) {
5692
- return F(a).direction === "rtl";
5708
+ return B(a).direction === "rtl";
5693
5709
  }
5694
5710
  const ji = {
5695
- convertOffsetParentRelativeRectToViewportRelativeRect: Bi,
5711
+ convertOffsetParentRelativeRectToViewportRelativeRect: Fi,
5696
5712
  getDocumentElement: V,
5697
5713
  getClippingRect: Pi,
5698
5714
  getOffsetParent: we,
@@ -5702,7 +5718,7 @@ const ji = {
5702
5718
  getScale: Z,
5703
5719
  isElement: X,
5704
5720
  isRTL: Gi
5705
- }, pe = Mi, ye = Hi, me = Ai, Ui = Li, Ee = (a, t, e) => {
5721
+ }, pe = Mi, me = Hi, ye = Ai, Ui = Li, Ee = (a, t, e) => {
5706
5722
  const i = /* @__PURE__ */ new Map(), s = {
5707
5723
  platform: ji,
5708
5724
  ...e
@@ -5787,7 +5803,7 @@ let Zi = class {
5787
5803
  }
5788
5804
  }, this.floatingEl, {
5789
5805
  placement: t.overflowTooltipPlacement,
5790
- middleware: [ye(), me(), pe(6), Ui({ element: this.arrowEl })]
5806
+ middleware: [me(), ye(), pe(6), Ui({ element: this.arrowEl })]
5791
5807
  }).then((n) => {
5792
5808
  const { x: h, y: c, placement: d, middlewareData: f } = n;
5793
5809
  if (Object.assign(this.floatingEl.style, {
@@ -6127,8 +6143,8 @@ class ts {
6127
6143
  const t = [], e = [], i = [];
6128
6144
  let s = this.ctx.body.renderRows;
6129
6145
  this.ctx.config.FOOTER_FIXED || (s = s.concat(this.ctx.footer.renderRows)), s.forEach((w) => {
6130
- w.cells.forEach((y) => {
6131
- y.cellType === "footer" && (y.render = y.renderFooter), y.render && (y.fixed === "left" ? e.push(y) : y.fixed === "right" ? i.push(y) : t.push(y));
6146
+ w.cells.forEach((m) => {
6147
+ m.cellType === "footer" && (m.render = m.renderFooter), m.render && (m.fixed === "left" ? e.push(m) : m.fixed === "right" ? i.push(m) : t.push(m));
6132
6148
  });
6133
6149
  });
6134
6150
  const {
@@ -6267,7 +6283,7 @@ class es {
6267
6283
  };
6268
6284
  Ee(x, this.contextMenuEl, {
6269
6285
  placement: "right-start",
6270
- middleware: [pe(), ye(), me()]
6286
+ middleware: [pe(), me(), ye()]
6271
6287
  }).then(({ x: g, y: p }) => {
6272
6288
  this.show(g, p);
6273
6289
  });
@@ -6346,7 +6362,7 @@ class rs {
6346
6362
  r,
6347
6363
  o
6348
6364
  );
6349
- this.ctx = new ui(n, this.options), this.header = new wi(this.ctx), this.footer = new yi(this.ctx), this.body = new pi(this.ctx), this.scroller = new gi(this.ctx), this.selector = new mi(this.ctx), this.autofill = new Ei(this.ctx), this.tooltip = new Zi(this.ctx), this.empty = new Qi(this.ctx), this.editor = new Ji(this.ctx), this.overlayer = new ts(this.ctx), this.contextMenu = new es(this.ctx), this.ctx.on("draw", () => {
6365
+ this.ctx = new ui(n, this.options), this.header = new wi(this.ctx), this.footer = new mi(this.ctx), this.body = new pi(this.ctx), this.scroller = new gi(this.ctx), this.selector = new yi(this.ctx), this.autofill = new Ei(this.ctx), this.tooltip = new Zi(this.ctx), this.empty = new Qi(this.ctx), this.editor = new Ji(this.ctx), this.overlayer = new ts(this.ctx), this.contextMenu = new es(this.ctx), this.ctx.on("draw", () => {
6350
6366
  this.draw();
6351
6367
  }), this.ctx.on("drawView", () => {
6352
6368
  this.draw(!0);
@@ -6399,7 +6415,7 @@ class rs {
6399
6415
  this.ctx.off(t, e);
6400
6416
  }
6401
6417
  filterMethod(t) {
6402
- this.ctx.setScrollY(0), this.ctx.setScrollX(0), this.ctx.database.init(), this.header.init(), this.ctx.database.setFilterMethod(t), this.ctx.emit("draw");
6418
+ this.scrollTo(0, 0), this.ctx.database.setFilterMethod(t), this.ctx.database.init(), this.ctx.emit("draw");
6403
6419
  }
6404
6420
  editCell(t, e) {
6405
6421
  this.editor.editCell(t, e);