e-virt-table 1.1.9 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -149,7 +149,7 @@ function Ae(a) {
149
149
  t.push.apply(t, a[e] || []);
150
150
  }), t;
151
151
  }
152
- var 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;
@@ -161,7 +161,7 @@ function Te(a, t, e, i, s) {
161
161
  if (t.first) {
162
162
  var r = new Promise(function(x, g) {
163
163
  var p = function(y) {
164
- return i(y), y.length ? g(new Bt(y, bt(y))) : x(s);
164
+ return i(y), y.length ? g(new Ft(y, bt(y))) : x(s);
165
165
  }, u = Ae(a);
166
166
  Xt(u, e, p);
167
167
  });
@@ -172,7 +172,7 @@ function Te(a, t, e, i, s) {
172
172
  var o = t.firstFields === !0 ? Object.keys(a) : t.firstFields || [], n = Object.keys(a), h = n.length, c = 0, d = [], f = new Promise(function(x, g) {
173
173
  var p = function(w) {
174
174
  if (d.push.apply(d, w), c++, c === h)
175
- return i(d), d.length ? g(new 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];
@@ -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) : {
@@ -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) {
@@ -319,8 +319,8 @@ var Zt = function(t, e, i, s, r, 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);
@@ -583,14 +583,14 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
583
583
  v === void 0 && (v = []);
584
584
  var O = Array.isArray(v) ? v : [v];
585
585
  !h.suppressWarning && O.length && a.warning("async-validator:", O), O.length && y.message !== void 0 && (O = [].concat(y.message));
586
- var S = O.map(Ft(y, n));
586
+ var S = O.map(Bt(y, n));
587
587
  if (h.first && S.length)
588
588
  return p[y.field] = 1, w(S);
589
589
  if (!E)
590
590
  w(S);
591
591
  else {
592
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);
593
+ return y.message !== void 0 ? S = [].concat(y.message).map(Bt(y, n)) : h.error && (S = [h.error(y, D(h.messages.required, y.field))]), w(S);
594
594
  var I = {};
595
595
  y.defaultField && Object.keys(u.value).map(function(L) {
596
596
  I[L] = y.defaultField;
@@ -1071,10 +1071,6 @@ class Tt extends re {
1071
1071
  }
1072
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
1073
  let m = e, C = o;
1074
- if (["index", "index-selection", "selection"].includes(this.type)) {
1075
- this.drawCellBgColor = e, this.drawTextColor = o;
1076
- return;
1077
- }
1078
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") {
1079
1075
  const b = s, { backgroundColor: v, color: O } = b({
1080
1076
  row: this.row,
@@ -2179,8 +2175,8 @@ class ai {
2179
2175
  }, "");
2180
2176
  for (let R = e - 1; R >= 0; R--) {
2181
2177
  const A = this.rowIndexRowKeyMap.get(R) || "", L = h.reduce((M, T) => {
2182
- const F = this.getItemValue(A, T) ?? "";
2183
- return `${M}${F}`;
2178
+ const B = this.getItemValue(A, T) ?? "";
2179
+ return `${M}${B}`;
2184
2180
  }, "");
2185
2181
  if (I === L)
2186
2182
  w = R;
@@ -2189,8 +2185,8 @@ class ai {
2189
2185
  }
2190
2186
  for (let R = e; R <= this.ctx.maxRowIndex; R++) {
2191
2187
  const A = this.rowIndexRowKeyMap.get(R) || "", L = h.reduce((M, T) => {
2192
- const F = this.getItemValue(A, T) ?? "";
2193
- return `${M}${F}`;
2188
+ const B = this.getItemValue(A, T) ?? "";
2189
+ return `${M}${B}`;
2194
2190
  }, "");
2195
2191
  if (I === L)
2196
2192
  y = R;
@@ -5125,12 +5121,12 @@ const Li = (a) => ({
5125
5121
  }, g = Ht(s), p = Mt(g), u = await o.getDimensions(c), w = g === "y", y = w ? "top" : "left", E = w ? "bottom" : "right", m = w ? "clientHeight" : "clientWidth", C = r.reference[p] + r.reference[g] - x[g] - r.floating[p], b = x[g] - r.reference[g], v = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(c));
5126
5122
  let O = v ? v[m] : 0;
5127
5123
  (!O || !await (o.isElement == null ? void 0 : o.isElement(v))) && (O = n.floating[m] || r.floating[p]);
5128
- 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;
5124
+ const S = C / 2 - b / 2, I = O / 2 - u[p] / 2 - 1, R = rt(f[y], I), A = rt(f[E], I), L = R, M = O - u[p] - A, T = O / 2 - u[p] / 2 + S, B = _t(L, T, M), Y = !h.arrow && lt(s) != null && T !== B && r.reference[p] / 2 - (T < L ? R : A) - u[p] / 2 < 0, k = Y ? T < L ? T - L : T - M : 0;
5129
5125
  return {
5130
5126
  [g]: x[g] + k,
5131
5127
  data: {
5132
- [g]: F,
5133
- centerOffset: T - F - k,
5128
+ [g]: B,
5129
+ centerOffset: T - B - k,
5134
5130
  ...Y && {
5135
5131
  alignmentOffset: k
5136
5132
  }
@@ -5175,15 +5171,15 @@ const Li = (a) => ({
5175
5171
  overflows: I
5176
5172
  }], !I.every((T) => T <= 0)) {
5177
5173
  var A, L;
5178
- const T = (((A = r.flip) == null ? void 0 : A.index) || 0) + 1, F = O[T];
5179
- if (F)
5174
+ const T = (((A = r.flip) == null ? void 0 : A.index) || 0) + 1, B = O[T];
5175
+ if (B)
5180
5176
  return {
5181
5177
  data: {
5182
5178
  index: T,
5183
5179
  overflows: R
5184
5180
  },
5185
5181
  reset: {
5186
- placement: F
5182
+ placement: B
5187
5183
  }
5188
5184
  };
5189
5185
  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;
@@ -5356,7 +5352,7 @@ function ht(a) {
5356
5352
  overflowX: e,
5357
5353
  overflowY: i,
5358
5354
  display: s
5359
- } = B(a);
5355
+ } = F(a);
5360
5356
  return /auto|scroll|overlay|hidden|clip/.test(t + i + e) && !["inline", "contents"].includes(s);
5361
5357
  }
5362
5358
  function Di(a) {
@@ -5372,7 +5368,7 @@ function wt(a) {
5372
5368
  });
5373
5369
  }
5374
5370
  function Dt(a) {
5375
- const t = Nt(), e = X(a) ? B(a) : a;
5371
+ const t = Nt(), e = X(a) ? F(a) : a;
5376
5372
  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));
5377
5373
  }
5378
5374
  function Ni(a) {
@@ -5392,7 +5388,7 @@ function Nt() {
5392
5388
  function Q(a) {
5393
5389
  return ["html", "body", "#document"].includes(tt(a));
5394
5390
  }
5395
- function B(a) {
5391
+ function F(a) {
5396
5392
  return N(a).getComputedStyle(a);
5397
5393
  }
5398
5394
  function pt(a) {
@@ -5434,7 +5430,7 @@ function Lt(a) {
5434
5430
  return a.parent && Object.getPrototypeOf(a.parent) ? a.frameElement : null;
5435
5431
  }
5436
5432
  function fe(a) {
5437
- const t = B(a);
5433
+ const t = F(a);
5438
5434
  let e = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
5439
5435
  const s = K(a), r = s ? a.offsetWidth : e, o = s ? a.offsetHeight : i, n = ft(e) !== r || ft(i) !== o;
5440
5436
  return n && (e = r, i = o), {
@@ -5469,7 +5465,7 @@ function ue(a) {
5469
5465
  y: t.visualViewport.offsetTop
5470
5466
  };
5471
5467
  }
5472
- function Bi(a, t, e) {
5468
+ function Fi(a, t, e) {
5473
5469
  return t === void 0 && (t = !1), !e || t && e !== N(a) ? !1 : t;
5474
5470
  }
5475
5471
  function ot(a, t, e, i) {
@@ -5477,13 +5473,13 @@ function ot(a, t, e, i) {
5477
5473
  const s = a.getBoundingClientRect(), r = xe(a);
5478
5474
  let o = z(1);
5479
5475
  t && (i ? X(i) && (o = Z(i)) : o = Z(a));
5480
- const n = Bi(r, e, i) ? ue(r) : z(0);
5476
+ const n = Fi(r, e, i) ? ue(r) : z(0);
5481
5477
  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;
5482
5478
  if (r) {
5483
5479
  const x = N(r), g = i && X(i) ? N(i) : i;
5484
5480
  let p = x, u = Lt(p);
5485
5481
  for (; u && i && g !== p; ) {
5486
- 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;
5482
+ const w = Z(u), y = u.getBoundingClientRect(), E = F(u), m = y.left + (u.clientLeft + parseFloat(E.paddingLeft)) * w.x, C = y.top + (u.clientTop + parseFloat(E.paddingTop)) * w.y;
5487
5483
  h *= w.x, c *= w.y, d *= w.x, f *= w.y, h += m, c += C, p = N(u), u = Lt(p);
5488
5484
  }
5489
5485
  }
@@ -5494,7 +5490,7 @@ function ot(a, t, e, i) {
5494
5490
  y: c
5495
5491
  });
5496
5492
  }
5497
- function Fi(a) {
5493
+ function Bi(a) {
5498
5494
  let {
5499
5495
  elements: t,
5500
5496
  rect: e,
@@ -5531,7 +5527,7 @@ function Ki(a) {
5531
5527
  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);
5532
5528
  let o = -e.scrollLeft + At(a);
5533
5529
  const n = -e.scrollTop;
5534
- return B(i).direction === "rtl" && (o += U(t.clientWidth, i.clientWidth) - s), {
5530
+ return F(i).direction === "rtl" && (o += U(t.clientWidth, i.clientWidth) - s), {
5535
5531
  width: s,
5536
5532
  height: r,
5537
5533
  x: o,
@@ -5582,17 +5578,17 @@ function Gt(a, t, e) {
5582
5578
  }
5583
5579
  function ge(a, t) {
5584
5580
  const e = $(a);
5585
- return e === t || !X(e) || Q(e) ? !1 : B(e).position === "fixed" || ge(e, t);
5581
+ return e === t || !X(e) || Q(e) ? !1 : F(e).position === "fixed" || ge(e, t);
5586
5582
  }
5587
5583
  function Wi(a, t) {
5588
5584
  const e = t.get(a);
5589
5585
  if (e)
5590
5586
  return e;
5591
5587
  let i = St(a, [], !1).filter((n) => X(n) && tt(n) !== "body"), s = null;
5592
- const r = B(a).position === "fixed";
5588
+ const r = F(a).position === "fixed";
5593
5589
  let o = r ? $(a) : a;
5594
5590
  for (; X(o) && !Q(o); ) {
5595
- const n = B(o), h = Dt(o);
5591
+ const n = F(o), h = Dt(o);
5596
5592
  !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);
5597
5593
  }
5598
5594
  return t.set(a, i), i;
@@ -5652,10 +5648,10 @@ function $i(a, t, e) {
5652
5648
  };
5653
5649
  }
5654
5650
  function mt(a) {
5655
- return B(a).position === "static";
5651
+ return F(a).position === "static";
5656
5652
  }
5657
5653
  function jt(a, t) {
5658
- if (!K(a) || B(a).position === "fixed")
5654
+ if (!K(a) || F(a).position === "fixed")
5659
5655
  return null;
5660
5656
  if (t)
5661
5657
  return t(a);
@@ -5693,10 +5689,10 @@ const qi = async function(a) {
5693
5689
  };
5694
5690
  };
5695
5691
  function Gi(a) {
5696
- return B(a).direction === "rtl";
5692
+ return F(a).direction === "rtl";
5697
5693
  }
5698
5694
  const ji = {
5699
- convertOffsetParentRelativeRectToViewportRelativeRect: Fi,
5695
+ convertOffsetParentRelativeRectToViewportRelativeRect: Bi,
5700
5696
  getDocumentElement: V,
5701
5697
  getClippingRect: Pi,
5702
5698
  getOffsetParent: we,