e-virt-table 1.2.1 → 1.2.3

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
@@ -116,13 +116,13 @@ function D(a) {
116
116
  }
117
117
  return a;
118
118
  }
119
- function Se(a) {
119
+ function Le(a) {
120
120
  return a === "string" || a === "url" || a === "hex" || a === "email" || a === "date" || a === "pattern";
121
121
  }
122
122
  function H(a, t) {
123
- return !!(a == null || t === "array" && Array.isArray(a) && !a.length || Se(t) && typeof a == "string" && !a);
123
+ return !!(a == null || t === "array" && Array.isArray(a) && !a.length || Le(t) && typeof a == "string" && !a);
124
124
  }
125
- function Le(a, t, e) {
125
+ function Se(a, t, e) {
126
126
  var i = [], s = 0, r = a.length;
127
127
  function o(n) {
128
128
  i.push.apply(i, n || []), s++, s === r && e(i);
@@ -149,7 +149,7 @@ function Ae(a) {
149
149
  t.push.apply(t, a[e] || []);
150
150
  }), t;
151
151
  }
152
- var Bt = /* @__PURE__ */ function(a) {
152
+ var Ft = /* @__PURE__ */ function(a) {
153
153
  Re(t, a);
154
154
  function t(e, i) {
155
155
  var s;
@@ -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 Ft(m, bt(m))) : x(s);
165
165
  }, u = Ae(a);
166
166
  Xt(u, e, p);
167
167
  });
@@ -172,11 +172,11 @@ 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 Bt(d, bt(d))) : x(s);
175
+ return i(d), d.length ? g(new Ft(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];
179
- o.indexOf(u) !== -1 ? Xt(w, e, p) : Le(w, e, p);
179
+ o.indexOf(u) !== -1 ? Xt(w, e, p) : Se(w, e, p);
180
180
  });
181
181
  });
182
182
  return f.catch(function(x) {
@@ -194,7 +194,7 @@ function He(a, t) {
194
194
  }
195
195
  return e;
196
196
  }
197
- function Ft(a, t) {
197
+ function Bt(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
- }, Be = function(t, e, i, s, r) {
302
+ }, Fe = 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", Fe = function(t, e, i, s, r) {
307
+ }, j = "enum", Be = function(t, e, i, s, r) {
308
308
  t[j] = Array.isArray(t[j]) ? t[j] : [], t[j].indexOf(e) === -1 && s.push(D(r.messages[j], t.fullField, t[j].join(", ")));
309
309
  }, ke = function(t, e, i, s, r) {
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: Be,
323
- enum: Fe,
322
+ range: Fe,
323
+ enum: Be,
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,59 +571,59 @@ 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));
587
- if (h.first && S.length)
588
- return p[y.field] = 1, w(S);
589
- if (!E)
590
- w(S);
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 L = _.map(Bt(m, n));
587
+ if (h.first && L.length)
588
+ return p[m.field] = 1, w(L);
589
+ if (!C)
590
+ w(L);
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 ? L = [].concat(m.message).map(Bt(m, n)) : h.error && (L = [h.error(m, D(h.messages.required, m.field))]), w(L);
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(S) {
596
+ I[S] = m.defaultField;
597
597
  }), I = q({}, I, u.rule.fields);
598
598
  var R = {};
599
- Object.keys(I).forEach(function(L) {
600
- var M = I[L], T = Array.isArray(M) ? M : [M];
601
- R[L] = T.map(m.bind(null, L));
599
+ Object.keys(I).forEach(function(S) {
600
+ var M = I[S], T = Array.isArray(M) ? M : [M];
601
+ R[S] = T.map(y.bind(null, S));
602
602
  });
603
603
  var A = new a(R);
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) {
604
+ A.messages(h.messages), u.rule.options && (u.rule.options.messages = h.messages, u.rule.options.error = h.error), A.validate(u.value, u.rule.options || h, function(S) {
605
605
  var M = [];
606
- S && S.length && M.push.apply(M, S), L && L.length && M.push.apply(M, L), w(M.length ? M : null);
606
+ L && L.length && M.push.apply(M, L), S && S.length && M.push.apply(M, S), w(M.length ? M : null);
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: L, 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
+ L && (E = L), 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,43 +2166,43 @@ 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, L = 0;
2170
2170
  if (d !== 1 && p) {
2171
- S = x;
2171
+ L = x;
2172
2172
  const I = h.reduce((R, A) => {
2173
- const L = this.getItemValue(s, A) ?? "";
2174
- return `${R}${L}`;
2173
+ const S = this.getItemValue(s, A) ?? "";
2174
+ return `${R}${S}`;
2175
2175
  }, "");
2176
2176
  for (let R = e - 1; R >= 0; R--) {
2177
- const A = this.rowIndexRowKeyMap.get(R) || "", L = h.reduce((M, T) => {
2178
- const F = this.getItemValue(A, T) ?? "";
2179
- return `${M}${F}`;
2177
+ const A = this.rowIndexRowKeyMap.get(R) || "", S = h.reduce((M, T) => {
2178
+ const B = this.getItemValue(A, T) ?? "";
2179
+ return `${M}${B}`;
2180
2180
  }, "");
2181
- if (I === L)
2181
+ if (I === S)
2182
2182
  w = R;
2183
2183
  else
2184
2184
  break;
2185
2185
  }
2186
2186
  for (let R = e; R <= this.ctx.maxRowIndex; R++) {
2187
- const A = this.rowIndexRowKeyMap.get(R) || "", L = h.reduce((M, T) => {
2188
- const F = this.getItemValue(A, T) ?? "";
2189
- return `${M}${F}`;
2187
+ const A = this.rowIndexRowKeyMap.get(R) || "", S = h.reduce((M, T) => {
2188
+ const B = this.getItemValue(A, T) ?? "";
2189
+ return `${M}${B}`;
2190
2190
  }, "");
2191
- if (I === L)
2192
- y = R;
2191
+ if (I === S)
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;
2203
- const L = this.rowIndexRowKeyMap.get(R) || "", { item: M } = this.rowKeyMap.get(L), T = this.getItemValue(L, i);
2204
- C.push({
2205
- rowKey: L,
2202
+ _ += A;
2203
+ const S = this.rowIndexRowKeyMap.get(R) || "", { item: M } = this.rowKeyMap.get(S), T = this.getItemValue(S, i);
2204
+ b.push({
2205
+ rowKey: S,
2206
2206
  key: i,
2207
2207
  value: T,
2208
2208
  row: M
@@ -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
- const A = this.getItemValue(s, i), L = this.getItemValue(s, R.key);
2219
- if (A === L && c.includes(R.key))
2220
- E = I;
2218
+ const A = this.getItemValue(s, i), S = this.getItemValue(s, R.key);
2219
+ if (A === S && c.includes(R.key))
2220
+ C = I;
2221
2221
  else
2222
2222
  break;
2223
2223
  }
@@ -2225,23 +2225,23 @@ class ai {
2225
2225
  const R = this.getColumnByColIndex(I);
2226
2226
  if (!R)
2227
2227
  break;
2228
- const A = this.getItemValue(s, i), L = this.getItemValue(s, R.key);
2229
- if (A === L && c.includes(R.key))
2230
- m = I;
2228
+ const A = this.getItemValue(s, i), S = this.getItemValue(s, R.key);
2229
+ if (A === S && c.includes(R.key))
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
+ L += 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,
2258
- width: S,
2259
- offsetTop: b,
2257
+ height: _,
2258
+ width: L,
2259
+ offsetTop: E,
2260
2260
  offsetLeft: v,
2261
- dataList: C
2261
+ dataList: b
2262
2262
  };
2263
2263
  }
2264
2264
  setLoading(t) {
@@ -3935,21 +3935,21 @@ 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);
3949
- const S = this.data.length ? "not-empty" : "empty";
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 L = this.data.length ? "not-empty" : "empty";
3950
3950
  this.ctx.emit("emptyChange", {
3951
- isEmpty: S,
3952
- type: S,
3951
+ isEmpty: L,
3952
+ type: L,
3953
3953
  headerHeight: e.height,
3954
3954
  bodyHeight: this.height,
3955
3955
  footerHeight: u,
@@ -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);
@@ -4244,7 +4244,7 @@ class mi {
4244
4244
  t.preventDefault(), this.isCut = !0, this.copy();
4245
4245
  return;
4246
4246
  }
4247
- if ((t.ctrlKey && t.code === "KeyA" || t.metaKey && t.code === "KeyA") && (t.preventDefault(), this.selectAll()), t.code === "ArrowLeft") {
4247
+ if ((t.ctrlKey && t.code === "KeyA" || t.metaKey && t.code === "KeyA") && (t.preventDefault(), this.selectAll()), t.code === "ArrowLeft" || t.shiftKey && t.code === "Tab") {
4248
4248
  t.preventDefault(), this.moveFocus("LEFT");
4249
4249
  return;
4250
4250
  }
@@ -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, L = 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: L,
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);
4694
- let S = 0;
4695
- x && (g === "top" ? v = o.height + n.height - w : S = n.visibleHeight);
4696
- const I = w + O - (t - S - f);
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);
4704
+ let L = 0;
4705
+ x && (g === "top" ? v = o.height + n.height - w : L = n.visibleHeight);
4706
+ const I = w + _ - (t - L - 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,21 +4769,21 @@ 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
- const S = v({
4779
+ const L = v({
4770
4780
  focusCell: this.ctx.focusCell,
4771
4781
  xArr: o,
4772
4782
  yArr: n
4773
4783
  });
4774
- if (!S)
4784
+ if (!L)
4775
4785
  return;
4776
- o = S.xArr, n = S.yArr;
4786
+ o = L.xArr, n = L.yArr;
4777
4787
  }
4778
4788
  this.ctx.autofill.xArr = o, this.ctx.autofill.yArr = n, this.ctx.emit("setAutofill", this.ctx.autofill), this.ctx.emit("draw");
4779
4789
  }
@@ -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
  }
@@ -4997,7 +5007,7 @@ function $t(a, t, e) {
4997
5007
  }
4998
5008
  return g;
4999
5009
  }
5000
- const Si = async (a, t, e) => {
5010
+ const Li = async (a, t, e) => {
5001
5011
  const {
5002
5012
  placement: i = "bottom",
5003
5013
  strategy: s = "absolute",
@@ -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,36 +5084,36 @@ 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
- const Li = (a) => ({
5116
+ const Si = (a) => ({
5107
5117
  name: "arrow",
5108
5118
  options: a,
5109
5119
  async fn(t) {
@@ -5124,15 +5134,15 @@ 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 L = b / 2 - E / 2, I = _ / 2 - u[p] / 2 - 1, R = rt(f[m], I), A = rt(f[C], I), S = R, M = _ - u[p] - A, T = _ / 2 - u[p] / 2 + L, B = _t(S, T, M), Y = !h.arrow && lt(s) != null && T !== B && r.reference[p] / 2 - (T < S ? R : A) - u[p] / 2 < 0, k = Y ? T < S ? T - S : T - M : 0;
5131
5141
  return {
5132
5142
  [g]: x[g] + k,
5133
5143
  data: {
5134
- [g]: F,
5135
- centerOffset: T - F - k,
5144
+ [g]: B,
5145
+ centerOffset: T - B - k,
5136
5146
  ...Y && {
5137
5147
  alignmentOffset: k
5138
5148
  }
@@ -5164,31 +5174,31 @@ 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], L = 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);
5173
- I.push(S[T[0]], S[T[1]]);
5181
+ if (d && I.push(L[m]), f) {
5182
+ const T = vi(s, o, b);
5183
+ I.push(L[T[0]], L[T[1]]);
5174
5184
  }
5175
5185
  if (R = [...R, {
5176
5186
  placement: s,
5177
5187
  overflows: I
5178
5188
  }], !I.every((T) => T <= 0)) {
5179
- var A, L;
5180
- const T = (((A = r.flip) == null ? void 0 : A.index) || 0) + 1, F = O[T];
5181
- if (F)
5189
+ var A, S;
5190
+ const T = (((A = r.flip) == null ? void 0 : A.index) || 0) + 1, B = _[T];
5191
+ if (B)
5182
5192
  return {
5183
5193
  data: {
5184
5194
  index: T,
5185
5195
  overflows: R
5186
5196
  },
5187
5197
  reset: {
5188
- placement: F
5198
+ placement: B
5189
5199
  }
5190
5200
  };
5191
- 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;
5201
+ let Y = (S = R.filter((k) => k.overflows[0] <= 0).sort((k, W) => k.overflows[1] - W.overflows[1])[0]) == null ? void 0 : S.placement;
5192
5202
  if (!Y)
5193
5203
  switch (g) {
5194
5204
  case "bestFit": {
@@ -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,
@@ -5358,7 +5368,7 @@ function ht(a) {
5358
5368
  overflowX: e,
5359
5369
  overflowY: i,
5360
5370
  display: s
5361
- } = B(a);
5371
+ } = F(a);
5362
5372
  return /auto|scroll|overlay|hidden|clip/.test(t + i + e) && !["inline", "contents"].includes(s);
5363
5373
  }
5364
5374
  function Di(a) {
@@ -5374,7 +5384,7 @@ function wt(a) {
5374
5384
  });
5375
5385
  }
5376
5386
  function Dt(a) {
5377
- const t = Nt(), e = X(a) ? B(a) : a;
5387
+ const t = Nt(), e = X(a) ? F(a) : a;
5378
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));
5379
5389
  }
5380
5390
  function Ni(a) {
@@ -5394,7 +5404,7 @@ function Nt() {
5394
5404
  function Q(a) {
5395
5405
  return ["html", "body", "#document"].includes(tt(a));
5396
5406
  }
5397
- function B(a) {
5407
+ function F(a) {
5398
5408
  return N(a).getComputedStyle(a);
5399
5409
  }
5400
5410
  function pt(a) {
@@ -5422,21 +5432,21 @@ function de(a) {
5422
5432
  const t = $(a);
5423
5433
  return Q(t) ? a.ownerDocument ? a.ownerDocument.body : a.body : K(t) && ht(t) ? t : de(t);
5424
5434
  }
5425
- function St(a, t, e) {
5435
+ function Lt(a, t, e) {
5426
5436
  var i;
5427
5437
  t === void 0 && (t = []), e === void 0 && (e = !0);
5428
5438
  const s = de(a), r = s === ((i = a.ownerDocument) == null ? void 0 : i.body), o = N(s);
5429
5439
  if (r) {
5430
- const n = Lt(o);
5431
- return t.concat(o, o.visualViewport || [], ht(s) ? s : [], n && e ? St(n) : []);
5440
+ const n = St(o);
5441
+ return t.concat(o, o.visualViewport || [], ht(s) ? s : [], n && e ? Lt(n) : []);
5432
5442
  }
5433
- return t.concat(s, St(s, [], e));
5443
+ return t.concat(s, Lt(s, [], e));
5434
5444
  }
5435
- function Lt(a) {
5445
+ function St(a) {
5436
5446
  return a.parent && Object.getPrototypeOf(a.parent) ? a.frameElement : null;
5437
5447
  }
5438
5448
  function fe(a) {
5439
- const t = B(a);
5449
+ const t = F(a);
5440
5450
  let e = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
5441
5451
  const s = K(a), r = s ? a.offsetWidth : e, o = s ? a.offsetHeight : i, n = ft(e) !== r || ft(i) !== o;
5442
5452
  return n && (e = r, i = o), {
@@ -5471,7 +5481,7 @@ function ue(a) {
5471
5481
  y: t.visualViewport.offsetTop
5472
5482
  };
5473
5483
  }
5474
- function Bi(a, t, e) {
5484
+ function Fi(a, t, e) {
5475
5485
  return t === void 0 && (t = !1), !e || t && e !== N(a) ? !1 : t;
5476
5486
  }
5477
5487
  function ot(a, t, e, i) {
@@ -5479,14 +5489,14 @@ function ot(a, t, e, i) {
5479
5489
  const s = a.getBoundingClientRect(), r = xe(a);
5480
5490
  let o = z(1);
5481
5491
  t && (i ? X(i) && (o = Z(i)) : o = Z(a));
5482
- const n = Bi(r, e, i) ? ue(r) : z(0);
5492
+ const n = Fi(r, e, i) ? ue(r) : z(0);
5483
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;
5484
5494
  if (r) {
5485
5495
  const x = N(r), g = i && X(i) ? N(i) : i;
5486
- let p = x, u = Lt(p);
5496
+ let p = x, u = St(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 = F(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 = St(p);
5490
5500
  }
5491
5501
  }
5492
5502
  return ut({
@@ -5496,7 +5506,7 @@ function ot(a, t, e, i) {
5496
5506
  y: c
5497
5507
  });
5498
5508
  }
5499
- function Fi(a) {
5509
+ function Bi(a) {
5500
5510
  let {
5501
5511
  elements: t,
5502
5512
  rect: e,
@@ -5533,7 +5543,7 @@ function Ki(a) {
5533
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);
5534
5544
  let o = -e.scrollLeft + At(a);
5535
5545
  const n = -e.scrollTop;
5536
- return B(i).direction === "rtl" && (o += U(t.clientWidth, i.clientWidth) - s), {
5546
+ return F(i).direction === "rtl" && (o += U(t.clientWidth, i.clientWidth) - s), {
5537
5547
  width: s,
5538
5548
  height: r,
5539
5549
  x: o,
@@ -5584,17 +5594,17 @@ function Gt(a, t, e) {
5584
5594
  }
5585
5595
  function ge(a, t) {
5586
5596
  const e = $(a);
5587
- return e === t || !X(e) || Q(e) ? !1 : B(e).position === "fixed" || ge(e, t);
5597
+ return e === t || !X(e) || Q(e) ? !1 : F(e).position === "fixed" || ge(e, t);
5588
5598
  }
5589
5599
  function Wi(a, t) {
5590
5600
  const e = t.get(a);
5591
5601
  if (e)
5592
5602
  return e;
5593
- let i = St(a, [], !1).filter((n) => X(n) && tt(n) !== "body"), s = null;
5594
- const r = B(a).position === "fixed";
5603
+ let i = Lt(a, [], !1).filter((n) => X(n) && tt(n) !== "body"), s = null;
5604
+ const r = F(a).position === "fixed";
5595
5605
  let o = r ? $(a) : a;
5596
5606
  for (; X(o) && !Q(o); ) {
5597
- const n = B(o), h = Dt(o);
5607
+ const n = F(o), h = Dt(o);
5598
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);
5599
5609
  }
5600
5610
  return t.set(a, i), i;
@@ -5653,11 +5663,11 @@ function $i(a, t, e) {
5653
5663
  height: o.height
5654
5664
  };
5655
5665
  }
5656
- function mt(a) {
5657
- return B(a).position === "static";
5666
+ function yt(a) {
5667
+ return F(a).position === "static";
5658
5668
  }
5659
5669
  function jt(a, t) {
5660
- if (!K(a) || B(a).position === "fixed")
5670
+ if (!K(a) || F(a).position === "fixed")
5661
5671
  return null;
5662
5672
  if (t)
5663
5673
  return t(a);
@@ -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);
@@ -5695,10 +5705,10 @@ const qi = async function(a) {
5695
5705
  };
5696
5706
  };
5697
5707
  function Gi(a) {
5698
- return B(a).direction === "rtl";
5708
+ return F(a).direction === "rtl";
5699
5709
  }
5700
5710
  const ji = {
5701
- convertOffsetParentRelativeRectToViewportRelativeRect: Fi,
5711
+ convertOffsetParentRelativeRectToViewportRelativeRect: Bi,
5702
5712
  getDocumentElement: V,
5703
5713
  getClippingRect: Pi,
5704
5714
  getOffsetParent: we,
@@ -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 = Si, Ee = (a, t, e) => {
5712
5722
  const i = /* @__PURE__ */ new Map(), s = {
5713
5723
  platform: ji,
5714
5724
  ...e
@@ -5716,7 +5726,7 @@ const ji = {
5716
5726
  ...s.platform,
5717
5727
  _c: i
5718
5728
  };
5719
- return Si(a, t, {
5729
+ return Li(a, t, {
5720
5730
  ...s,
5721
5731
  platform: r
5722
5732
  });
@@ -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, {
@@ -5874,6 +5884,14 @@ class Ji {
5874
5884
  ` + d, this.inputEl.selectionStart = this.inputEl.selectionEnd = h + 1, this.autoSize();
5875
5885
  return;
5876
5886
  }
5887
+ if (t.code === "Tab" && this.ctx.editing) {
5888
+ if (t.preventDefault(), this.doneEdit(), t.shiftKey) {
5889
+ this.ctx.emit("setMoveFocus", "LEFT");
5890
+ return;
5891
+ }
5892
+ this.ctx.emit("setMoveFocus", "RIGHT");
5893
+ return;
5894
+ }
5877
5895
  if (t.code === "Enter" && this.ctx.editing) {
5878
5896
  if (t.preventDefault(), this.doneEdit(), t.shiftKey) {
5879
5897
  this.ctx.emit("setMoveFocus", "TOP");
@@ -6133,8 +6151,8 @@ class ts {
6133
6151
  const t = [], e = [], i = [];
6134
6152
  let s = this.ctx.body.renderRows;
6135
6153
  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));
6154
+ w.cells.forEach((m) => {
6155
+ 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
6156
  });
6139
6157
  });
6140
6158
  const {
@@ -6273,7 +6291,7 @@ class es {
6273
6291
  };
6274
6292
  Ee(x, this.contextMenuEl, {
6275
6293
  placement: "right-start",
6276
- middleware: [pe(), ye(), me()]
6294
+ middleware: [pe(), me(), ye()]
6277
6295
  }).then(({ x: g, y: p }) => {
6278
6296
  this.show(g, p);
6279
6297
  });
@@ -6352,7 +6370,7 @@ class rs {
6352
6370
  r,
6353
6371
  o
6354
6372
  );
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", () => {
6373
+ 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
6374
  this.draw();
6357
6375
  }), this.ctx.on("drawView", () => {
6358
6376
  this.draw(!0);