e-virt-table 1.2.1 → 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
@@ -160,8 +160,8 @@ var Bt = /* @__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 Bt(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
  });
@@ -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,}))$/,
@@ -315,7 +315,7 @@ 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,
@@ -327,7 +327,7 @@ var Zt = function(t, e, i, s, r, o) {
327
327
  if (n) {
328
328
  if (H(e, "string") && !t.required)
329
329
  return i();
330
- _.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(Ft(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(Ft(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) => {
@@ -2189,19 +2189,19 @@ class ai {
2189
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) {
@@ -3935,17 +3935,17 @@ class pi {
3935
3935
  !this.data.length && !n ? this.height = h : !this.data.length && n && (this.height = n - e.height - u - o);
3936
3936
  let w = this.height + e.height + o;
3937
3937
  w += u;
3938
- let y = w;
3939
- const E = window.innerHeight, { top: m } = this.containerRect || this.ctx.containerElement.getBoundingClientRect();
3940
- if (E > m && d && !n) {
3941
- const R = E - m - f;
3942
- R > e.height + o ? y = R : w > c && (y = c);
3943
- } else this.data.length && n ? y = n : this.data.length && c && w > c && (y = c);
3944
- y > 0 && (this.ctx.stageHeight = Math.floor(y), this.ctx.stageElement.style.height = `${this.ctx.stageHeight - 0.5}px`);
3945
- let C = this.ctx.stageHeight - e.height - o;
3946
- r ? this.visibleHeight = C - u : this.visibleHeight = C, 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 b = window.devicePixelRatio || 1, v = this.ctx.stageWidth * b, O = this.ctx.stageHeight * b;
3948
- t.width = Math.floor(v), t.height = Math.floor(O);
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
3949
  const S = this.data.length ? "not-empty" : "empty";
3950
3950
  this.ctx.emit("emptyChange", {
3951
3951
  isEmpty: S,
@@ -3958,7 +3958,7 @@ class pi {
3958
3958
  }), this.ctx.canvasElement.setAttribute(
3959
3959
  "style",
3960
3960
  ` height:${this.ctx.stageHeight}px;width:${this.ctx.stageWidth}px;`
3961
- ), this.ctx.paint.scale(b);
3961
+ ), this.ctx.paint.scale(E);
3962
3962
  }
3963
3963
  // 调整行的高度
3964
3964
  initResizeRow() {
@@ -4101,7 +4101,7 @@ class pi {
4101
4101
  }), this.drawTipLine();
4102
4102
  }
4103
4103
  }
4104
- class yi {
4104
+ class mi {
4105
4105
  constructor(t) {
4106
4106
  l(this, "ctx");
4107
4107
  l(this, "renderRows", []);
@@ -4182,7 +4182,7 @@ class yi {
4182
4182
  }), this.drawTopLine();
4183
4183
  }
4184
4184
  }
4185
- class mi {
4185
+ class yi {
4186
4186
  // 垂直滚动定时器
4187
4187
  constructor(t) {
4188
4188
  l(this, "isCut", !1);
@@ -4303,24 +4303,24 @@ class mi {
4303
4303
  SELECTOR_AREA_MAX_X_OFFSET: f,
4304
4304
  SELECTOR_AREA_MAX_Y_OFFSET: x
4305
4305
  } = this.ctx.config, g = n, p = h || this.ctx.maxColIndex - f, u = c, w = d || this.ctx.maxRowIndex - x;
4306
- let [y, E] = r, [m, C] = o;
4307
- 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)
4308
4308
  return;
4309
4309
  if (this.ctx.stageElement.focus({ preventScroll: !0 }), this.ctx.config.ENABLE_MERGE_CELL_LINK) {
4310
4310
  const v = this.adjustMergeCells(r, o);
4311
- 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;
4312
4312
  }
4313
- 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)];
4314
- const { BEFORE_SET_SELECTOR_METHOD: b } = this.ctx.config;
4315
- if (typeof b == "function") {
4316
- 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({
4317
4317
  focusCell: this.ctx.focusCell,
4318
4318
  xArr: r,
4319
4319
  yArr: o
4320
4320
  });
4321
- if (!O)
4321
+ if (!_)
4322
4322
  return;
4323
- r = O.xArr, o = O.yArr;
4323
+ r = _.xArr, o = _.yArr;
4324
4324
  }
4325
4325
  this.ctx.selector.xArr = r, this.ctx.selector.yArr = o, this.ctx.emit("setSelector", this.ctx.selector), this.ctx.emit("drawView");
4326
4326
  }
@@ -4331,13 +4331,13 @@ class mi {
4331
4331
  let n = [], h = [];
4332
4332
  for (let u = 0; u <= e[1] - e[0]; u++)
4333
4333
  for (let w = 0; w <= t[1] - t[0]; w++) {
4334
- const y = u + e[0], E = w + t[0], m = this.ctx.database.getVirtualBodyCell(y, E);
4335
- 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));
4336
4336
  }
4337
4337
  const c = n.reduce(
4338
4338
  (u, w) => {
4339
- const { yArr: y } = w.getSpanInfo(), [E, m] = y;
4340
- 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;
4341
4341
  },
4342
4342
  {
4343
4343
  minY: i,
@@ -4345,8 +4345,8 @@ class mi {
4345
4345
  }
4346
4346
  ), d = h.reduce(
4347
4347
  (u, w) => {
4348
- const { xArr: y } = w.getSpanInfo(), [E, m] = y;
4349
- 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;
4350
4350
  },
4351
4351
  {
4352
4352
  minX: r,
@@ -4536,29 +4536,39 @@ class mi {
4536
4536
  const e = this.ctx.selector.yArr[0], i = this.ctx.selector.xArr[0], s = /* @__PURE__ */ new Set();
4537
4537
  navigator.clipboard.readText().then(async (r) => {
4538
4538
  let o = si(r);
4539
- const n = [i, i + o[0].length - 1], h = [e, e + o.length - 1], c = o.length === 1 && o[0].length === 1;
4540
- if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(n, h) && !c) {
4541
- 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 = {
4542
4552
  code: "ERR_MERGED_CELLS_PASTE",
4543
4553
  message: "Merged cells cannot span paste data"
4544
4554
  };
4545
- 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);
4546
4556
  return;
4547
4557
  }
4548
- let d = [];
4549
- for (let g = 0; g <= o.length - 1; g++) {
4550
- const p = o[g].length;
4551
- for (let u = 0; u <= p - 1; u++) {
4552
- const w = g + e, y = u + i, E = o[g][u], m = this.ctx.database.getItemValueForRowIndexAndColIndex(
4553
- w,
4554
- 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
+ _
4555
4565
  );
4556
- if (m) {
4557
- const { rowKey: C, key: b } = m;
4558
- this.ctx.database.getReadonly(C, b) || (s.add(C), d.push({
4559
- rowKey: C,
4560
- key: b,
4561
- 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,
4562
4572
  row: {}
4563
4573
  //内部有设置
4564
4574
  }));
@@ -4566,35 +4576,35 @@ class mi {
4566
4576
  }
4567
4577
  }
4568
4578
  if (this.isCut) {
4569
- const g = this.clearSelectedData(
4579
+ const y = this.clearSelectedData(
4570
4580
  this.ctx.selector.xArrCopy,
4571
4581
  this.ctx.selector.yArrCopy,
4572
4582
  !0
4573
4583
  // 忽略设置,只返回数据,用于cut,实现历史回退需要返回两次问题
4574
- ), p = d.map((u) => `${u.rowKey}-${u.key}`);
4575
- g.forEach((u) => {
4576
- 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);
4577
4587
  }), this.isCut = !1;
4578
4588
  }
4579
- if (!d.length)
4589
+ if (!w.length)
4580
4590
  return;
4581
- const { BEFORE_PASTE_DATA_METHOD: f } = this.ctx.config;
4582
- if (typeof f == "function") {
4583
- const g = f, p = d.map((u) => ({
4584
- rowKey: u.rowKey,
4585
- key: u.key,
4586
- value: u.value,
4587
- oldValue: this.ctx.database.getItemValue(u.rowKey, u.key),
4588
- 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)
4589
4599
  }));
4590
- if (d = await g(p, n, h), d && !d.length)
4600
+ if (w = await y(b, n, h, o), w && !w.length)
4591
4601
  return;
4592
4602
  }
4593
- this.clearCopyLine(), this.ctx.batchSetItemValueByEditor(d, !0);
4594
- let x = [];
4595
- s.forEach((g) => {
4596
- x.push(this.ctx.database.getRowDataItemForRowKey(g));
4597
- }), 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);
4598
4608
  }).catch((r) => {
4599
4609
  console.error("Failed to get the clipboard content:", r);
4600
4610
  });
@@ -4688,14 +4698,14 @@ class mi {
4688
4698
  if (!i)
4689
4699
  return;
4690
4700
  p && this.ctx.onlyMergeCell && i.updateSpanInfo();
4691
- const { drawX: u, drawY: w, width: y, height: E, fixed: m } = i, C = r - u + 1, b = i.drawX + y - (e - s) + 1;
4692
- let v = o.height - w, O = E;
4693
- 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);
4694
4704
  let S = 0;
4695
4705
  x && (g === "top" ? v = o.height + n.height - w : S = n.visibleHeight);
4696
- const I = w + O - (t - S - f);
4706
+ const I = w + _ - (t - S - f);
4697
4707
  let R = c, A = d;
4698
- 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));
4699
4709
  }
4700
4710
  destroy() {
4701
4711
  this.timerX && (clearTimeout(this.timerX), this.timerX = 0), this.timerY && (clearTimeout(this.timerY), this.timerY = 0);
@@ -4759,11 +4769,11 @@ class Ei {
4759
4769
  SELECTOR_AREA_MAX_Y: f,
4760
4770
  SELECTOR_AREA_MAX_X_OFFSET: x,
4761
4771
  SELECTOR_AREA_MAX_Y_OFFSET: g
4762
- } = this.ctx.config, p = h, u = c || this.ctx.maxColIndex - x, w = d, y = f || this.ctx.maxRowIndex - g;
4763
- let [E, m] = o, [C, b] = n;
4764
- 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)
4765
4775
  return;
4766
- 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)];
4767
4777
  const { BEFORE_SET_AUTOFILL_METHOD: v } = this.ctx.config;
4768
4778
  if (typeof v == "function") {
4769
4779
  const S = v({
@@ -4800,13 +4810,13 @@ class Ei {
4800
4810
  let d = [];
4801
4811
  for (let g = 0; g <= h[1] - h[0]; g++)
4802
4812
  for (let p = 0; p <= n[1] - n[0]; p++) {
4803
- 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}`;
4804
- if (E && !i.has(m)) {
4805
- const { rowKey: C, key: b } = E;
4806
- this.ctx.database.getReadonly(C, b) || (t.add(C), d.push({
4807
- rowKey: C,
4808
- key: b,
4809
- 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,
4810
4820
  row: {}
4811
4821
  }));
4812
4822
  }
@@ -5015,13 +5025,13 @@ const Si = async (a, t, e) => {
5015
5025
  for (let u = 0; u < n.length; u++) {
5016
5026
  const {
5017
5027
  name: w,
5018
- fn: y
5028
+ fn: m
5019
5029
  } = n[u], {
5020
- x: E,
5021
- y: m,
5022
- data: C,
5023
- reset: b
5024
- } = await y({
5030
+ x: C,
5031
+ y,
5032
+ data: b,
5033
+ reset: E
5034
+ } = await m({
5025
5035
  x: d,
5026
5036
  y: f,
5027
5037
  initialPlacement: i,
@@ -5035,17 +5045,17 @@ const Si = async (a, t, e) => {
5035
5045
  floating: t
5036
5046
  }
5037
5047
  });
5038
- d = E ?? d, f = m ?? f, g = {
5048
+ d = C ?? d, f = y ?? f, g = {
5039
5049
  ...g,
5040
5050
  [w]: {
5041
5051
  ...g[w],
5042
- ...C
5052
+ ...b
5043
5053
  }
5044
- }, 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({
5045
5055
  reference: a,
5046
5056
  floating: t,
5047
5057
  strategy: s
5048
- }) : b.rects), {
5058
+ }) : E.rects), {
5049
5059
  x: d,
5050
5060
  y: f
5051
5061
  } = $t(c, x, h)), u = -1);
@@ -5074,33 +5084,33 @@ async function he(a, t) {
5074
5084
  elementContext: f = "floating",
5075
5085
  altBoundary: x = !1,
5076
5086
  padding: g = 0
5077
- } = 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({
5078
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)),
5079
5089
  boundary: c,
5080
5090
  rootBoundary: d,
5081
5091
  strategy: h
5082
- })), E = f === "floating" ? {
5092
+ })), C = f === "floating" ? {
5083
5093
  x: i,
5084
5094
  y: s,
5085
5095
  width: o.floating.width,
5086
5096
  height: o.floating.height
5087
- } : 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)) || {
5088
5098
  x: 1,
5089
5099
  y: 1
5090
5100
  } : {
5091
5101
  x: 1,
5092
5102
  y: 1
5093
- }, b = ut(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
5103
+ }, E = ut(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
5094
5104
  elements: n,
5095
- rect: E,
5096
- offsetParent: m,
5105
+ rect: C,
5106
+ offsetParent: y,
5097
5107
  strategy: h
5098
- }) : E);
5108
+ }) : C);
5099
5109
  return {
5100
- top: (y.top - b.top + p.top) / C.y,
5101
- bottom: (b.bottom - y.bottom + p.bottom) / C.y,
5102
- left: (y.left - b.left + p.left) / C.x,
5103
- 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
5104
5114
  };
5105
5115
  }
5106
5116
  const Li = (a) => ({
@@ -5124,10 +5134,10 @@ const Li = (a) => ({
5124
5134
  const f = le(d), x = {
5125
5135
  x: e,
5126
5136
  y: i
5127
- }, 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));
5128
- let O = v ? v[m] : 0;
5129
- (!O || !await (o.isElement == null ? void 0 : o.isElement(v))) && (O = n.floating[m] || r.floating[p]);
5130
- 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, 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;
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;
5131
5141
  return {
5132
5142
  [g]: x[g] + k,
5133
5143
  data: {
@@ -5164,12 +5174,12 @@ const Li = (a) => ({
5164
5174
  } = at(a, t);
5165
5175
  if ((e = r.arrow) != null && e.alignmentOffset)
5166
5176
  return {};
5167
- 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";
5168
- !x && v && b.push(..._i(n, u, p, C));
5169
- 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 = [];
5170
5180
  let R = ((i = r.flip) == null ? void 0 : i.overflows) || [];
5171
- if (d && I.push(S[y]), f) {
5172
- const T = vi(s, o, C);
5181
+ if (d && I.push(S[m]), f) {
5182
+ const T = vi(s, o, b);
5173
5183
  I.push(S[T[0]], S[T[1]]);
5174
5184
  }
5175
5185
  if (R = [...R, {
@@ -5177,7 +5187,7 @@ const Li = (a) => ({
5177
5187
  overflows: I
5178
5188
  }], !I.every((T) => T <= 0)) {
5179
5189
  var A, L;
5180
- const T = (((A = r.flip) == null ? void 0 : A.index) || 0) + 1, F = O[T];
5190
+ const T = (((A = r.flip) == null ? void 0 : A.index) || 0) + 1, F = _[T];
5181
5191
  if (F)
5182
5192
  return {
5183
5193
  data: {
@@ -5196,7 +5206,7 @@ const Li = (a) => ({
5196
5206
  const k = (M = R.filter((W) => {
5197
5207
  if (v) {
5198
5208
  const P = J(W.placement);
5199
- 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
5200
5210
  // reading directions favoring greater width.
5201
5211
  P === "y";
5202
5212
  }
@@ -5284,12 +5294,12 @@ const Mi = function(a) {
5284
5294
  limiter: n = {
5285
5295
  fn: (w) => {
5286
5296
  let {
5287
- x: y,
5288
- y: E
5297
+ x: m,
5298
+ y: C
5289
5299
  } = w;
5290
5300
  return {
5291
- x: y,
5292
- y: E
5301
+ x: m,
5302
+ y: C
5293
5303
  };
5294
5304
  }
5295
5305
  },
@@ -5300,12 +5310,12 @@ const Mi = function(a) {
5300
5310
  }, d = await he(t, h), f = J(G(s)), x = ae(f);
5301
5311
  let g = c[x], p = c[f];
5302
5312
  if (r) {
5303
- const w = x === "y" ? "top" : "left", y = x === "y" ? "bottom" : "right", E = g + d[w], m = g - d[y];
5304
- 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);
5305
5315
  }
5306
5316
  if (o) {
5307
- const w = f === "y" ? "top" : "left", y = f === "y" ? "bottom" : "right", E = p + d[w], m = p - d[y];
5308
- 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);
5309
5319
  }
5310
5320
  const u = n.fn({
5311
5321
  ...t,
@@ -5485,8 +5495,8 @@ function ot(a, t, e, i) {
5485
5495
  const x = N(r), g = i && X(i) ? N(i) : i;
5486
5496
  let p = x, u = Lt(p);
5487
5497
  for (; u && i && g !== p; ) {
5488
- const w = Z(u), y = u.getBoundingClientRect(), E = B(u), m = y.left + (u.clientLeft + parseFloat(E.paddingLeft)) * w.x, C = y.top + (u.clientTop + parseFloat(E.paddingTop)) * w.y;
5489
- 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);
5490
5500
  }
5491
5501
  }
5492
5502
  return ut({
@@ -5653,7 +5663,7 @@ function $i(a, t, e) {
5653
5663
  height: o.height
5654
5664
  };
5655
5665
  }
5656
- function mt(a) {
5666
+ function yt(a) {
5657
5667
  return B(a).position === "static";
5658
5668
  }
5659
5669
  function jt(a, t) {
@@ -5671,16 +5681,16 @@ function we(a, t) {
5671
5681
  if (!K(a)) {
5672
5682
  let s = $(a);
5673
5683
  for (; s && !Q(s); ) {
5674
- if (X(s) && !mt(s))
5684
+ if (X(s) && !yt(s))
5675
5685
  return s;
5676
5686
  s = $(s);
5677
5687
  }
5678
5688
  return e;
5679
5689
  }
5680
5690
  let i = jt(a, t);
5681
- for (; i && Di(i) && mt(i); )
5691
+ for (; i && Di(i) && yt(i); )
5682
5692
  i = jt(i, t);
5683
- 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;
5684
5694
  }
5685
5695
  const qi = async function(a) {
5686
5696
  const t = this.getOffsetParent || we, e = this.getDimensions, i = await e(a.floating);
@@ -5708,7 +5718,7 @@ const ji = {
5708
5718
  getScale: Z,
5709
5719
  isElement: X,
5710
5720
  isRTL: Gi
5711
- }, 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) => {
5712
5722
  const i = /* @__PURE__ */ new Map(), s = {
5713
5723
  platform: ji,
5714
5724
  ...e
@@ -5793,7 +5803,7 @@ let Zi = class {
5793
5803
  }
5794
5804
  }, this.floatingEl, {
5795
5805
  placement: t.overflowTooltipPlacement,
5796
- middleware: [ye(), me(), pe(6), Ui({ element: this.arrowEl })]
5806
+ middleware: [me(), ye(), pe(6), Ui({ element: this.arrowEl })]
5797
5807
  }).then((n) => {
5798
5808
  const { x: h, y: c, placement: d, middlewareData: f } = n;
5799
5809
  if (Object.assign(this.floatingEl.style, {
@@ -6133,8 +6143,8 @@ class ts {
6133
6143
  const t = [], e = [], i = [];
6134
6144
  let s = this.ctx.body.renderRows;
6135
6145
  this.ctx.config.FOOTER_FIXED || (s = s.concat(this.ctx.footer.renderRows)), s.forEach((w) => {
6136
- w.cells.forEach((y) => {
6137
- 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));
6138
6148
  });
6139
6149
  });
6140
6150
  const {
@@ -6273,7 +6283,7 @@ class es {
6273
6283
  };
6274
6284
  Ee(x, this.contextMenuEl, {
6275
6285
  placement: "right-start",
6276
- middleware: [pe(), ye(), me()]
6286
+ middleware: [pe(), me(), ye()]
6277
6287
  }).then(({ x: g, y: p }) => {
6278
6288
  this.show(g, p);
6279
6289
  });
@@ -6352,7 +6362,7 @@ class rs {
6352
6362
  r,
6353
6363
  o
6354
6364
  );
6355
- 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", () => {
6356
6366
  this.draw();
6357
6367
  }), this.ctx.on("drawView", () => {
6358
6368
  this.draw(!0);