@ninebone/table 0.0.496 → 0.0.498

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.
@@ -44,22 +44,22 @@ const He = class He extends HTMLElement {
44
44
  if (!t(this, B) || !t(this, w) || t(this, j)) return;
45
45
  const e = t(this, w).container, s = e.querySelector("table");
46
46
  if (!s) return;
47
- const r = t(this, w).track, n = t(this, w).thumb, o = t(this, B).querySelector(".ng-container-bottom"), a = e.clientWidth, l = s.scrollWidth;
48
- if (a !== 0 && l > a)
47
+ const r = t(this, w).track, n = t(this, w).thumb, o = t(this, B).querySelector(".ng-container-bottom"), a = e.clientWidth, c = s.scrollWidth;
48
+ if (a !== 0 && c > a)
49
49
  o && (o.style.display = "flex");
50
50
  else {
51
51
  o && (o.style.display = "none");
52
52
  return;
53
53
  }
54
- const c = r.clientWidth;
55
- if (c <= 0) return;
56
- const f = Math.max(Math.min(c * (a / l), c), 20);
54
+ const l = r.clientWidth;
55
+ if (l <= 0) return;
56
+ const f = Math.max(Math.min(l * (a / c), l), 20);
57
57
  n.style.width = `${f}px`;
58
- const u = e.scrollLeft, g = l - a;
59
- let b = 0;
60
- g > 0 && (b = parseInt(u / g * (c - f), 10)), b < 0 && (b = 0);
61
- const m = c - f;
62
- b > m && (b = m), n.style.left = `${b}px`, t(this, w).left.disabled = b === 0, t(this, w).right.disabled = b >= m - 1;
58
+ const u = e.scrollLeft, b = c - a;
59
+ let g = 0;
60
+ b > 0 && (g = parseInt(u / b * (l - f), 10)), g < 0 && (g = 0);
61
+ const m = l - f;
62
+ g > m && (g = m), n.style.left = `${g}px`, t(this, w).left.disabled = g === 0, t(this, w).right.disabled = g >= m - 1;
63
63
  }, "refresh"));
64
64
  d(this, G, /* @__PURE__ */ h((e) => {
65
65
  if (!t(this, w)) return !1;
@@ -68,10 +68,10 @@ const He = class He extends HTMLElement {
68
68
  const n = t(this, w).track.getBoundingClientRect(), o = t(this, w).thumb.clientWidth;
69
69
  let a = e;
70
70
  a < 0 && (a = 0);
71
- const l = n.width - o;
72
- a > l && (a = l), a = parseInt(a, 10), t(this, w).thumb.style.left = `${a}px`, t(this, w).left.disabled = a === 0, t(this, w).right.disabled = a >= l - 1;
73
- const c = s.clientWidth, u = r.scrollWidth - c;
74
- return l > 0 && u > 0 && (s.scrollLeft = a / l * u), a > 0 && a < l - 1;
71
+ const c = n.width - o;
72
+ a > c && (a = c), a = parseInt(a, 10), t(this, w).thumb.style.left = `${a}px`, t(this, w).left.disabled = a === 0, t(this, w).right.disabled = a >= c - 1;
73
+ const l = s.clientWidth, u = r.scrollWidth - l;
74
+ return c > 0 && u > 0 && (s.scrollLeft = a / c * u), a > 0 && a < c - 1;
75
75
  }, "#thumbMoveTo"));
76
76
  d(this, _t, /* @__PURE__ */ h(() => {
77
77
  const e = /* @__PURE__ */ h((r) => {
@@ -102,8 +102,8 @@ const He = class He extends HTMLElement {
102
102
  r.stopPropagation(), r.preventDefault(), y(this, j, !0), this.shiftX = r.clientX - t(this, w).thumb.getBoundingClientRect().left;
103
103
  const n = /* @__PURE__ */ h((a) => {
104
104
  if (!t(this, j)) return;
105
- const l = t(this, w).track.getBoundingClientRect();
106
- t(this, G).call(this, a.clientX - l.left - this.shiftX);
105
+ const c = t(this, w).track.getBoundingClientRect();
106
+ t(this, G).call(this, a.clientX - c.left - this.shiftX);
107
107
  }, "onMouseMove"), o = /* @__PURE__ */ h(() => {
108
108
  y(this, j, !1), s(), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), this.refresh();
109
109
  }, "onMouseUp");
@@ -213,21 +213,21 @@ const Me = class Me extends HTMLElement {
213
213
  d(this, vt, 0);
214
214
  A(this, "refresh", /* @__PURE__ */ h(() => {
215
215
  if (!t(this, F) || !t(this, q)) return;
216
- const e = t(this, q).container, s = t(this, q).track, r = t(this, q).thumb, n = e.clientHeight, a = (t(this, F).data.get() || []).length, l = t(this, ot).getRowHeight(), c = a * l;
217
- if (c <= n) {
216
+ const e = t(this, q).container, s = t(this, q).track, r = t(this, q).thumb, n = e.clientHeight, a = (t(this, F).data.get() || []).length, c = t(this, ot).getRowHeight(), l = a * c;
217
+ if (l <= n) {
218
218
  r.style.display = "none", t(this, q).top.disabled = !0, t(this, q).bottom.disabled = !0;
219
219
  return;
220
220
  } else
221
221
  r.style.display = "block";
222
222
  const f = s.clientHeight;
223
223
  if (f <= 0) return;
224
- const u = Math.max(Math.min(f * (n / c), f), 20);
224
+ const u = Math.max(Math.min(f * (n / l), f), 20);
225
225
  r.style.height = `${u}px`;
226
- const g = e.scrollTop, b = Math.max(c - n, 1);
226
+ const b = e.scrollTop, g = Math.max(l - n, 1);
227
227
  let m = 0;
228
- b > 0 && (m = g / b * (f - u));
228
+ g > 0 && (m = b / g * (f - u));
229
229
  const v = f - u;
230
- m < 0 && (m = 0), m > v && (m = v), r.style.top = `${m}px`, t(this, q).top.disabled = g <= 0, t(this, q).bottom.disabled = g >= b - 1;
230
+ m < 0 && (m = 0), m > v && (m = v), r.style.top = `${m}px`, t(this, q).top.disabled = b <= 0, t(this, q).bottom.disabled = b >= g - 1;
231
231
  }, "refresh"));
232
232
  d(this, Nt, /* @__PURE__ */ h(() => {
233
233
  const e = t(this, q).container, s = /* @__PURE__ */ h(() => {
@@ -241,11 +241,11 @@ const Me = class Me extends HTMLElement {
241
241
  r.stopPropagation(), r.preventDefault(), y(this, J, !0), y(this, xt, r.clientY), y(this, vt, e.scrollTop);
242
242
  const n = /* @__PURE__ */ h((a) => {
243
243
  if (!t(this, J)) return;
244
- const l = t(this, q).track.getBoundingClientRect(), c = t(this, q).thumb.clientHeight, u = l.height - c, g = a.clientY - t(this, xt), b = e.clientHeight, m = s(), v = Math.max(m - b, 1);
244
+ const c = t(this, q).track.getBoundingClientRect(), l = t(this, q).thumb.clientHeight, u = c.height - l, b = a.clientY - t(this, xt), g = e.clientHeight, m = s(), v = Math.max(m - g, 1);
245
245
  if (u > 0 && v > 0) {
246
- const E = g / u * v;
246
+ const E = b / u * v;
247
247
  let x = t(this, vt) + E;
248
- const H = Math.max(0, m - b);
248
+ const H = Math.max(0, m - g);
249
249
  x < 0 && (x = 0), x > H && (x = H), e.scrollTop = x;
250
250
  }
251
251
  this.refresh();
@@ -255,10 +255,10 @@ const Me = class Me extends HTMLElement {
255
255
  document.addEventListener("mousemove", n), document.addEventListener("mouseup", o);
256
256
  }), t(this, q).track.addEventListener("mousedown", (r) => {
257
257
  if (r.button !== 0 || r.target === t(this, q).thumb) return;
258
- const n = t(this, q).track.getBoundingClientRect(), o = t(this, q).thumb.clientHeight, a = r.clientY - n.top - o / 2, c = n.height - o, f = e.clientHeight, u = s(), g = Math.max(u - f, 1);
259
- if (c > 0 && g > 0) {
260
- const b = Math.max(0, Math.min(1, a / c));
261
- e.scrollTop = b * g;
258
+ const n = t(this, q).track.getBoundingClientRect(), o = t(this, q).thumb.clientHeight, a = r.clientY - n.top - o / 2, l = n.height - o, f = e.clientHeight, u = s(), b = Math.max(u - f, 1);
259
+ if (l > 0 && b > 0) {
260
+ const g = Math.max(0, Math.min(1, a / l));
261
+ e.scrollTop = g * b;
262
262
  }
263
263
  this.refresh();
264
264
  }), t(this, q).top.addEventListener("click", () => {
@@ -375,25 +375,25 @@ const $e = class $e {
375
375
  y(this, M, null), t(this, z).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
376
376
  const a = t(this, S).querySelector(o);
377
377
  if (!a) return;
378
- const l = a.querySelector(".ng-part-body table");
379
- if (!l) return;
380
- const c = l.querySelector("tbody.bindable-tbody");
378
+ const c = a.querySelector(".ng-part-body table");
381
379
  if (!c) return;
382
- const u = Array.from(c.querySelectorAll("tr")).map((g) => g.cloneNode(!0));
380
+ const l = c.querySelector("tbody.bindable-tbody");
381
+ if (!l) return;
382
+ const u = Array.from(l.querySelectorAll("tr")).map((b) => b.cloneNode(!0));
383
383
  t(this, z).set(o, u);
384
384
  });
385
385
  const i = t(this, S).querySelector(".ng-container-body .ng-part-body"), e = t(this, S).querySelector(".ng-container-left .ng-part-body"), s = t(this, S).querySelector(".ng-container-right .ng-part-body"), r = t(this, S).querySelector(".ng-container-body .ng-part-header"), n = t(this, S).querySelector(".ng-container-body .ng-part-footer");
386
386
  if (i) {
387
387
  t(this, Bt).call(this, i), t(this, At).call(this), t(this, St).call(this), t(this, lt).call(this, i.scrollTop);
388
388
  let o = !1;
389
- const a = /* @__PURE__ */ h((l, c, f) => {
389
+ const a = /* @__PURE__ */ h((c, l, f) => {
390
390
  var u;
391
- o || (o = !0, i && i.scrollTop !== l && (i.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), r && r.scrollLeft !== c && (r.scrollLeft = c), n && n.scrollLeft !== c && (n.scrollLeft = c), t(this, lt).call(this, l), (u = t(this, S).querySelector("nine-table-vscrollbar")) == null || u.refresh(), o = !1);
391
+ o || (o = !0, i && i.scrollTop !== c && (i.scrollTop = c), e && e.scrollTop !== c && (e.scrollTop = c), s && s.scrollTop !== c && (s.scrollTop = c), r && r.scrollLeft !== l && (r.scrollLeft = l), n && n.scrollLeft !== l && (n.scrollLeft = l), t(this, lt).call(this, c), (u = t(this, S).querySelector("nine-table-vscrollbar")) == null || u.refresh(), o = !1);
392
392
  }, "syncScroll");
393
- [i, e, s].forEach((l) => {
394
- l && l.addEventListener("scroll", () => {
393
+ [i, e, s].forEach((c) => {
394
+ c && c.addEventListener("scroll", () => {
395
395
  t(this, at) || (y(this, at, !0), requestAnimationFrame(() => {
396
- a(l.scrollTop, l.scrollLeft), y(this, at, !1);
396
+ a(c.scrollTop, c.scrollLeft), y(this, at, !1);
397
397
  }));
398
398
  });
399
399
  });
@@ -404,12 +404,11 @@ const $e = class $e {
404
404
  if (!s || s.length === 0) return;
405
405
  const r = i.querySelector(".ng-part-body tbody.bindable-tbody");
406
406
  if (!r) return;
407
- r.querySelectorAll("tr:not(.nodata)").forEach((l) => l.remove());
408
- const n = r.querySelector("tr.nodata"), o = document.createDocumentFragment(), a = s.length;
409
- for (let l = 0; l < t(this, wt); l++)
410
- s.forEach((c, f) => {
411
- const u = c.cloneNode(!0), g = l * a + f;
412
- u.dataset.row = g, o.appendChild(u);
407
+ r.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
408
+ const n = r.querySelector("tr.nodata"), o = document.createDocumentFragment();
409
+ for (let a = 0; a < t(this, wt); a++)
410
+ s.forEach((c) => {
411
+ o.appendChild(c.cloneNode(!0));
413
412
  });
414
413
  n ? n.before(o) : r.appendChild(o);
415
414
  }, "#renderRows"));
@@ -421,18 +420,18 @@ const $e = class $e {
421
420
  if (!e || e.length === 0) return 24;
422
421
  const s = i.querySelector("tbody.bindable-tbody");
423
422
  if (!s) return 24;
424
- s.querySelectorAll("tr:not(.nodata)").forEach((g) => g.remove());
423
+ s.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
425
424
  const r = s.querySelector("tr.nodata"), n = document.createDocumentFragment();
426
- e.forEach((g) => {
427
- n.appendChild(g.cloneNode(!0));
425
+ e.forEach((b) => {
426
+ n.appendChild(b.cloneNode(!0));
428
427
  }), r ? r.before(n) : s.appendChild(n);
429
- const o = t(this, S), a = o.style.display, l = o.style.visibility, c = o.style.position;
428
+ const o = t(this, S), a = o.style.display, c = o.style.visibility, l = o.style.position;
430
429
  (a === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
431
430
  let f = 0;
432
431
  const u = s.querySelectorAll("tr:not(.nodata)");
433
- return u.forEach((g) => {
434
- f += g.offsetHeight || g.getBoundingClientRect().height;
435
- }), u.forEach((g) => g.remove()), o.style.display = a, o.style.visibility = l, o.style.position = c, y(this, M, f > 0 ? f : 24), t(this, Et).call(this), t(this, M);
432
+ return u.forEach((b) => {
433
+ f += b.offsetHeight || b.getBoundingClientRect().height;
434
+ }), u.forEach((b) => b.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l, y(this, M, f > 0 ? f : 24), t(this, Et).call(this), t(this, M);
436
435
  }, "#measureAndCacheHeight"));
437
436
  d(this, St, /* @__PURE__ */ h(() => {
438
437
  const e = (t(this, D).data.get() || []).length, s = t(this, M), r = e * s;
@@ -450,29 +449,29 @@ const $e = class $e {
450
449
  }
451
450
  }, "#updateRowCount"));
452
451
  d(this, zt, /* @__PURE__ */ h(() => {
453
- var a, l, c, f, u, g;
452
+ var a, c, l, f, u, b;
454
453
  const i = t(this, S).querySelector(".ng-container-left .ng-part-body table"), e = t(this, S).querySelector(".ng-container-body .ng-part-body table"), s = t(this, S).querySelector(".ng-container-right .ng-part-body table");
455
454
  if (e) {
456
- const b = i ? Array.from(i.querySelectorAll("tbody tr")) : [], m = Array.from(e.querySelectorAll("tbody tr")), v = s ? Array.from(s.querySelectorAll("tbody tr")) : [], E = Math.max(b.length, m.length, v.length);
455
+ const g = i ? Array.from(i.querySelectorAll("tbody tr")) : [], m = Array.from(e.querySelectorAll("tbody tr")), v = s ? Array.from(s.querySelectorAll("tbody tr")) : [], E = Math.max(g.length, m.length, v.length);
457
456
  for (let x = 0; x < E; x++) {
458
457
  const H = [
459
- ((a = b[x]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
460
- ((l = m[x]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
461
- ((c = v[x]) == null ? void 0 : c.getBoundingClientRect().height) || 0
458
+ ((a = g[x]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
459
+ ((c = m[x]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
460
+ ((l = v[x]) == null ? void 0 : l.getBoundingClientRect().height) || 0
462
461
  ], k = Math.max(...H);
463
- k > 0 && (b[x] && (b[x].style.height = `${k}px`), m[x] && (m[x].style.height = `${k}px`), v[x] && (v[x].style.height = `${k}px`));
462
+ k > 0 && (g[x] && (g[x].style.height = `${k}px`), m[x] && (m[x].style.height = `${k}px`), v[x] && (v[x].style.height = `${k}px`));
464
463
  }
465
464
  }
466
465
  const r = t(this, S).querySelector(".ng-container-left .ng-part-footer table"), n = t(this, S).querySelector(".ng-container-body .ng-part-footer table"), o = t(this, S).querySelector(".ng-container-right .ng-part-footer table");
467
466
  if (n) {
468
- const b = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], m = Array.from(n.querySelectorAll("tfoot tr")), v = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], E = Math.max(b.length, m.length, v.length);
467
+ const g = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], m = Array.from(n.querySelectorAll("tfoot tr")), v = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], E = Math.max(g.length, m.length, v.length);
469
468
  for (let x = 0; x < E; x++) {
470
469
  const H = [
471
- ((f = b[x]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
470
+ ((f = g[x]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
472
471
  ((u = m[x]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
473
- ((g = v[x]) == null ? void 0 : g.getBoundingClientRect().height) || 0
472
+ ((b = v[x]) == null ? void 0 : b.getBoundingClientRect().height) || 0
474
473
  ], k = Math.max(...H);
475
- k > 0 && (b[x] && (b[x].style.height = `${k}px`), m[x] && (m[x].style.height = `${k}px`), v[x] && (v[x].style.height = `${k}px`));
474
+ k > 0 && (g[x] && (g[x].style.height = `${k}px`), m[x] && (m[x].style.height = `${k}px`), v[x] && (v[x].style.height = `${k}px`));
476
475
  }
477
476
  }
478
477
  }, "#syncRowHeights"));
@@ -486,8 +485,8 @@ const $e = class $e {
486
485
  let n = 0;
487
486
  const o = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
488
487
  o && (n += o.offsetHeight), a && (n += a.offsetHeight);
489
- const l = Math.max(r - n, 100);
490
- t(this, Q) !== l && (y(this, Q, l), t(this, Et).call(this), t(this, M) !== null && t(this, At).call(this));
488
+ const c = Math.max(r - n, 100);
489
+ t(this, Q) !== c && (y(this, Q, c), t(this, Et).call(this), t(this, M) !== null && t(this, At).call(this));
491
490
  }
492
491
  }
493
492
  })), t(this, V).observe(t(this, S)));
@@ -500,20 +499,20 @@ const $e = class $e {
500
499
  }, "#renderAllContainers"));
501
500
  d(this, Ee, /* @__PURE__ */ h((i) => {
502
501
  [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
503
- var c;
502
+ var l;
504
503
  const s = t(this, S).querySelector(e);
505
504
  if (!s) return;
506
505
  const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
507
506
  if (!r) return;
508
- const n = Array.from(r.querySelectorAll("tr:not(.nodata)")), o = ((c = t(this, z).get(e)) == null ? void 0 : c.length) || 1, l = (t(this, D).data.get() || []).length;
507
+ const n = Array.from(r.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this, z).get(e)) == null ? void 0 : l.length) || 1, c = (t(this, D).data.get() || []).length;
509
508
  n.forEach((f, u) => {
510
- const g = i + Math.floor(u / o);
511
- if (g >= l) {
509
+ const b = i + Math.floor(u / o);
510
+ if (b >= c) {
512
511
  f.style.display = "none";
513
512
  return;
514
513
  }
515
- const b = t(this, D).data.get(g);
516
- f.style.display = "", t(this, Rt).call(this, f, b, g);
514
+ const g = t(this, D).data.get(b);
515
+ f.style.display = "", t(this, Rt).call(this, f, g, b);
517
516
  });
518
517
  });
519
518
  }, "#adjustBufferRows"));
@@ -521,16 +520,16 @@ const $e = class $e {
521
520
  var u;
522
521
  const e = t(this, M);
523
522
  if (!e || e <= 0) return;
524
- const r = (t(this, D).data.get() || []).length, n = Math.max(0, Math.floor(i / e)), o = n * e, a = ((u = t(this, z).get(".ng-container-body")) == null ? void 0 : u.length) || 1, l = t(this, S).querySelector(".ng-container-body"), c = l == null ? void 0 : l.querySelector(".ng-part-body tbody.bindable-tbody tr:not(.nodata)"), f = c && c.dataset.row !== void 0 ? parseInt(c.dataset.row, 10) : -1;
525
- [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
526
- const b = t(this, S).querySelector(g);
527
- if (!b) return;
528
- const m = b.querySelector(".ng-part-body tbody.bindable-tbody");
523
+ const r = (t(this, D).data.get() || []).length, n = Math.max(0, Math.floor(i / e)), o = n * e, a = ((u = t(this, z).get(".ng-container-body")) == null ? void 0 : u.length) || 1, c = t(this, S).querySelector(".ng-container-body"), l = c == null ? void 0 : c.querySelector(".ng-part-body tbody.bindable-tbody tr:not(.nodata)"), f = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
524
+ [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((b) => {
525
+ const g = t(this, S).querySelector(b);
526
+ if (!g) return;
527
+ const m = g.querySelector(".ng-part-body tbody.bindable-tbody");
529
528
  m && (m.style.transform = `translateY(${o}px)`);
530
- }), P.log("#handleScroll", f, n), f !== n && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
531
- const b = t(this, S).querySelector(g);
532
- if (!b) return;
533
- const m = b.querySelector(".ng-part-body tbody.bindable-tbody");
529
+ }), P.log("#handleScroll", f, n), f !== n && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((b) => {
530
+ const g = t(this, S).querySelector(b);
531
+ if (!g) return;
532
+ const m = g.querySelector(".ng-part-body tbody.bindable-tbody");
534
533
  if (!m) return;
535
534
  Array.from(m.querySelectorAll("tr:not(.nodata)")).forEach((E, x) => {
536
535
  const H = n + Math.floor(x / a);
@@ -565,17 +564,17 @@ const $e = class $e {
565
564
  });
566
565
  }, "#bindRowData"));
567
566
  d(this, Pt, /* @__PURE__ */ h(() => {
568
- var l, c, f;
567
+ var c, l, f;
569
568
  const i = t(this, S).querySelector(".ng-container-left .ng-part-header table"), e = t(this, S).querySelector(".ng-container-body .ng-part-header table"), s = t(this, S).querySelector(".ng-container-right .ng-part-header table");
570
569
  if (!e) return;
571
570
  const r = i ? Array.from(i.querySelectorAll("tr")) : [], n = Array.from(e.querySelectorAll("tr")), o = s ? Array.from(s.querySelectorAll("tr")) : [], a = Math.max(r.length, n.length, o.length);
572
571
  for (let u = 0; u < a; u++) {
573
- const g = [
574
- ((l = r[u]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
575
- ((c = n[u]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
572
+ const b = [
573
+ ((c = r[u]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
574
+ ((l = n[u]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
576
575
  ((f = o[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
577
- ], b = Math.max(...g);
578
- b > 0 && (r[u] && (r[u].style.height = `${b}px`), n[u] && (n[u].style.height = `${b}px`), o[u] && (o[u].style.height = `${b}px`));
576
+ ], g = Math.max(...b);
577
+ g > 0 && (r[u] && (r[u].style.height = `${g}px`), n[u] && (n[u].style.height = `${g}px`), o[u] && (o[u].style.height = `${g}px`));
579
578
  }
580
579
  }, "#syncHeaderHeights"));
581
580
  A(this, "destroy", /* @__PURE__ */ h(() => {
@@ -606,65 +605,65 @@ const jt = class jt {
606
605
  static compile(i) {
607
606
  if (!i) return null;
608
607
  const e = /* @__PURE__ */ h((a) => {
609
- a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((c) => {
610
- const f = c.getAttribute("cell-type") || "renderer";
611
- if (c.children.length > 0 && c.firstElementChild.tagName.includes("-")) return;
608
+ a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
609
+ const f = l.getAttribute("cell-type") || "renderer";
610
+ if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
612
611
  let u = `cell-${f}`;
613
- const g = c.getAttribute("data-bind"), b = c.getAttribute("data-expr"), m = c.getAttribute("maxbyte"), v = c.getAttribute("type");
612
+ const b = l.getAttribute("data-bind"), g = l.getAttribute("data-expr"), m = l.getAttribute("maxbyte"), v = l.getAttribute("type");
614
613
  let E = [];
615
- g && E.push(`data-bind="${g}"`), b && E.push(`data-expr="${b}"`), m && E.push(`maxbyte="${m}"`), v && E.push(`type="${v}"`), c.innerHTML = `<${u} ${E.join(" ")}></${u}>`;
614
+ b && E.push(`data-bind="${b}"`), g && E.push(`data-expr="${g}"`), m && E.push(`maxbyte="${m}"`), v && E.push(`type="${v}"`), l.innerHTML = `<${u} ${E.join(" ")}></${u}>`;
616
615
  });
617
616
  }, "processCellTypes"), s = /* @__PURE__ */ h((a) => {
618
617
  if (!a.querySelector("colgroup")) {
619
- const l = a.querySelector("tbody tr") || a.querySelector("tr"), c = l ? l.querySelectorAll("th, td").length : 1, f = document.createElement("colgroup"), u = Math.max(Math.floor(a.clientWidth / c), 100);
620
- for (let g = 0; g < c; g++) {
621
- const b = document.createElement("col");
622
- b.setAttribute("width", u), f.appendChild(b);
618
+ const c = a.querySelector("tbody tr") || a.querySelector("tr"), l = c ? c.querySelectorAll("th, td").length : 1, f = document.createElement("colgroup"), u = Math.max(Math.floor(a.clientWidth / l), 100);
619
+ for (let b = 0; b < l; b++) {
620
+ const g = document.createElement("col");
621
+ g.setAttribute("width", u), f.appendChild(g);
623
622
  }
624
623
  a.prepend(f);
625
624
  }
626
625
  if (!a.querySelector("thead")) {
627
- const l = document.createElement("thead"), c = a.querySelector("colgroup");
628
- c ? c.after(l) : a.prepend(l);
626
+ const c = document.createElement("thead"), l = a.querySelector("colgroup");
627
+ l ? l.after(c) : a.prepend(c);
629
628
  }
630
629
  a.classList.add("nine-table-element"), a.style.display = "table";
631
- }, "ensureTableStructure"), r = /* @__PURE__ */ h((a, l) => {
632
- const c = Array.from(a.querySelectorAll(l + " tr")), f = Array.from(a.querySelectorAll(l + " th," + l + " td")), u = c.length;
630
+ }, "ensureTableStructure"), r = /* @__PURE__ */ h((a, c) => {
631
+ const l = Array.from(a.querySelectorAll(c + " tr")), f = Array.from(a.querySelectorAll(c + " th," + c + " td")), u = l.length;
633
632
  if (u === 0 || f.length === 0) return;
634
- let g = 0;
633
+ let b = 0;
635
634
  f.forEach((m) => {
636
- g += m.colSpan || 1;
635
+ b += m.colSpan || 1;
637
636
  });
638
- const b = Array.from(Array(u), () => Array(g).fill(null));
639
- c.forEach((m) => {
637
+ const g = Array.from(Array(u), () => Array(b).fill(null));
638
+ l.forEach((m) => {
640
639
  const v = m.sectionRowIndex;
641
640
  let E = 0;
642
641
  Array.from(m.querySelectorAll("th,td")).forEach((x) => {
643
- for (let O = 0; O < b[v].length; O++)
644
- if (b[v][O] === null) {
642
+ for (let O = 0; O < g[v].length; O++)
643
+ if (g[v][O] === null) {
645
644
  E = O;
646
645
  break;
647
646
  }
648
647
  const H = x.rowSpan || 1, k = x.colSpan || 1;
649
648
  for (let O = 0; O < H; O++)
650
649
  for (let yt = 0; yt < k; yt++)
651
- v + O < u && E + yt < g && (b[v + O][E + yt] = O === 0 && yt === 0 ? "1" : "0");
650
+ v + O < u && E + yt < b && (g[v + O][E + yt] = O === 0 && yt === 0 ? "1" : "0");
652
651
  });
653
- }), c.forEach((m) => {
652
+ }), l.forEach((m) => {
654
653
  const v = m.sectionRowIndex;
655
654
  Array.from(m.querySelectorAll("th,td")).forEach((E) => {
656
- for (let x = 0; x < b[v].length; x++)
657
- if (b[v][x] === "1") {
658
- E.dataset.col = x, b[v][x] = "0";
655
+ for (let x = 0; x < g[v].length; x++)
656
+ if (g[v][x] === "1") {
657
+ E.dataset.col = x, g[v][x] = "0";
659
658
  break;
660
659
  }
661
660
  });
662
661
  });
663
662
  }, "resetColIndex"), n = i.cloneNode(!0);
664
- return s(n), e(n), r(n, "thead"), r(n, "tbody"), r(n, "tfoot"), Array.from(n.querySelectorAll("colgroup col")).forEach((a, l) => {
665
- const c = a.getAttribute("fixed");
666
- c && n.querySelectorAll(`thead [data-col="${l}"], tbody [data-col="${l}"], tfoot [data-col="${l}"]`).forEach((f) => {
667
- f.setAttribute("fixed", c);
663
+ return s(n), e(n), r(n, "thead"), r(n, "tbody"), r(n, "tfoot"), Array.from(n.querySelectorAll("colgroup col")).forEach((a, c) => {
664
+ const l = a.getAttribute("fixed");
665
+ l && n.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((f) => {
666
+ f.setAttribute("fixed", l);
668
667
  });
669
668
  }), n;
670
669
  }
@@ -695,10 +694,10 @@ const pt = class pt extends HTMLElement {
695
694
  o.className = "ng-part-header", o.appendChild(t(this, ct).call(this, t(this, tt), r, "header"));
696
695
  const a = document.createElement("div");
697
696
  a.className = "ng-part-body";
698
- const l = document.createElement("div");
699
- l.className = "ng-scroll-content", l.style.position = "relative", l.style.width = "100%", l.appendChild(t(this, ct).call(this, t(this, tt), r, "body"));
700
697
  const c = document.createElement("div");
701
- c.className = "ng-virtual-spacer", c.style.width = "100%", c.style.pointerEvents = "none", l.appendChild(c), a.appendChild(l);
698
+ c.className = "ng-scroll-content", c.style.position = "relative", c.style.width = "100%", c.appendChild(t(this, ct).call(this, t(this, tt), r, "body"));
699
+ const l = document.createElement("div");
700
+ l.className = "ng-virtual-spacer", l.style.width = "100%", l.style.pointerEvents = "none", c.appendChild(l), a.appendChild(c);
702
701
  const f = document.createElement("div");
703
702
  f.className = "ng-part-footer", f.appendChild(t(this, ct).call(this, t(this, tt), r, "footer")), n.appendChild(o), n.appendChild(a), n.appendChild(f);
704
703
  });
@@ -721,19 +720,19 @@ const pt = class pt extends HTMLElement {
721
720
  }, 0));
722
721
  }, "generate"));
723
722
  d(this, ct, /* @__PURE__ */ h((e, s, r) => {
724
- const n = e.cloneNode(!0), o = n.querySelector("thead"), a = n.querySelector("tbody"), l = n.querySelector("tfoot");
723
+ const n = e.cloneNode(!0), o = n.querySelector("thead"), a = n.querySelector("tbody"), c = n.querySelector("tfoot");
725
724
  if (r === "header") {
726
- if (a && a.remove(), l && l.remove(), e.querySelector("tbody")) {
725
+ if (a && a.remove(), c && c.remove(), e.querySelector("tbody")) {
727
726
  const f = document.createElement("tbody");
728
727
  f.className = "fixed-tbody", n.appendChild(f);
729
728
  }
730
- } else r === "body" ? (o && o.remove(), l && l.remove(), a && (a.className = "bindable-tbody")) : r === "footer" && (o && o.remove(), a && a.remove());
731
- return s === "left" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((c) => {
732
- c.getAttribute("fixed") !== "left" && c.remove();
733
- }) : s === "right" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((c) => {
734
- c.getAttribute("fixed") !== "right" && c.remove();
735
- }) : n.querySelectorAll("[fixed=left], [fixed=right]").forEach((c) => {
736
- c.remove();
729
+ } else r === "body" ? (o && o.remove(), c && c.remove(), a && (a.className = "bindable-tbody")) : r === "footer" && (o && o.remove(), a && a.remove());
730
+ return s === "left" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
731
+ l.getAttribute("fixed") !== "left" && l.remove();
732
+ }) : s === "right" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
733
+ l.getAttribute("fixed") !== "right" && l.remove();
734
+ }) : n.querySelectorAll("[fixed=left], [fixed=right]").forEach((l) => {
735
+ l.remove();
737
736
  }), n;
738
737
  }, "#createSplitTable"));
739
738
  A(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, et).getRowHeight(), "getRowHeight"));
@@ -918,32 +917,32 @@ const Ie = class Ie extends HTMLElement {
918
917
  d(this, qt, /* @__PURE__ */ h((e, s = !1) => {
919
918
  const r = /* @__PURE__ */ h(() => {
920
919
  const f = Array.from(this.querySelectorAll("nine-table-sheet"));
921
- Array.from(this.querySelectorAll("nine-splitter")).forEach((b) => b.style.setProperty("display", "none"));
922
- const g = f.filter((b) => b.classList.contains("active"));
923
- g.length < 2 || g.forEach((b) => {
924
- const m = parseInt(b.getAttribute("data-index"), 10), v = this.querySelector(`nine-splitter[data-split-index="${m}"]`), E = f[m + 1];
920
+ Array.from(this.querySelectorAll("nine-splitter")).forEach((g) => g.style.setProperty("display", "none"));
921
+ const b = f.filter((g) => g.classList.contains("active"));
922
+ b.length < 2 || b.forEach((g) => {
923
+ const m = parseInt(g.getAttribute("data-index"), 10), v = this.querySelector(`nine-splitter[data-split-index="${m}"]`), E = f[m + 1];
925
924
  v && E && E.classList.contains("active") && v.style.setProperty("display", "flex");
926
925
  });
927
- }, "updateSplitters"), n = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = n.querySelectorAll(".nine-tab-item"), l = o.querySelectorAll("nine-table-sheet");
926
+ }, "updateSplitters"), n = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = n.querySelectorAll(".nine-tab-item"), c = o.querySelectorAll("nine-table-sheet");
928
927
  if (!a[e]) return;
929
928
  if (!s)
930
929
  a.forEach((f, u) => {
931
930
  f.classList.toggle("active", u === e);
932
- }), l.forEach((f, u) => {
933
- const g = u === e;
934
- f.classList.toggle("active", g), f.style.flex = g ? "1 1 100%" : "";
931
+ }), c.forEach((f, u) => {
932
+ const b = u === e;
933
+ f.classList.toggle("active", b), f.style.flex = b ? "1 1 100%" : "";
935
934
  });
936
935
  else {
937
936
  const f = a[e], u = n.querySelectorAll(".nine-tab-item.active");
938
937
  if (f.classList.contains("active") && u.length <= 1)
939
938
  return;
940
939
  f.classList.toggle("active");
941
- const g = o.querySelector(`nine-table-sheet[data-index="${e}"]`);
942
- g && (g.classList.toggle("active"), g.classList.contains("active") || (g.style.flex = ""));
940
+ const b = o.querySelector(`nine-table-sheet[data-index="${e}"]`);
941
+ b && (b.classList.toggle("active"), b.classList.contains("active") || (b.style.flex = ""));
943
942
  }
944
- const c = o.querySelectorAll("nine-table-sheet.active");
945
- c == null || c.forEach((f) => {
946
- f.style.flex = c.length > 1 ? "1 1 0%" : "1 1 100%";
943
+ const l = o.querySelectorAll("nine-table-sheet.active");
944
+ l == null || l.forEach((f) => {
945
+ f.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
947
946
  }), r();
948
947
  }, "#switchSheet"));
949
948
  }
@@ -965,17 +964,17 @@ const _e = class _e {
965
964
  }).observe(t(this, I));
966
965
  }, "#init"));
967
966
  d(this, kt, /* @__PURE__ */ h(() => {
968
- var l, c;
967
+ var c, l;
969
968
  const i = Array.from(t(this, I).shadowRoot.querySelectorAll("nine-table-sheet.active"));
970
969
  if (i.length === 0) return;
971
- const e = parseInt(t(this, I).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), r = (l = t(this, I).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : l.getBoundingClientRect().height, n = (c = t(this, I).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : c.getBoundingClientRect().height, o = $t.SCROLLBAR_SIZE, a = e * s + r + n + o;
970
+ const e = parseInt(t(this, I).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), r = (c = t(this, I).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, n = (l = t(this, I).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = $t.SCROLLBAR_SIZE, a = e * s + r + n + o;
972
971
  t(this, I).style.height = `${a}px`;
973
972
  }, "#applyAutoHeight"));
974
973
  d(this, Gt, /* @__PURE__ */ h(() => {
975
- const e = Array.from(t(this, I).children).filter((l) => l.tagName === "TABLE"), s = t(this, I).getAttribute("auto-height") === "true", r = e.length, n = e.map((l, c) => {
976
- const u = `<nine-table-sheet class="${c === 0 ? "active" : ""}" data-index="${c}"></nine-table-sheet>`, g = c < r - 1 ? `<nine-splitter class="h" data-split-index="${c}"></nine-splitter>` : "";
977
- return u + g;
978
- }).join(""), o = e.map((l, c) => `<div class="nine-tab-item ${c === 0 ? "active" : ""}" data-index="${c}">Sheet ${c + 1}</div>`).join("");
974
+ const e = Array.from(t(this, I).children).filter((c) => c.tagName === "TABLE"), s = t(this, I).getAttribute("auto-height") === "true", r = e.length, n = e.map((c, l) => {
975
+ const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, b = l < r - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
976
+ return u + b;
977
+ }).join(""), o = e.map((c, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
979
978
  t(this, I).shadowRoot.innerHTML = `
980
979
  <style>
981
980
  :host {
@@ -1068,9 +1067,9 @@ const _e = class _e {
1068
1067
  <nine-table-footer></nine-table-footer>
1069
1068
  `;
1070
1069
  const a = t(this, I).shadowRoot.querySelectorAll("nine-table-sheet");
1071
- a == null || a.forEach((l, c) => {
1072
- e[c] && setTimeout(() => {
1073
- l.generate(e[c]), s && t(this, kt).call(this);
1070
+ a == null || a.forEach((c, l) => {
1071
+ e[l] && setTimeout(() => {
1072
+ c.generate(e[l]), s && t(this, kt).call(this);
1074
1073
  });
1075
1074
  });
1076
1075
  }, "#render"));
@@ -1189,9 +1188,9 @@ const W = class W {
1189
1188
  }), this.resetRecords(), t(this, st).call(this);
1190
1189
  }, "delete"));
1191
1190
  A(this, "setValue", /* @__PURE__ */ h((i, e, s) => {
1192
- var l;
1191
+ var c;
1193
1192
  i = parseInt(i, 10);
1194
- const n = (typeof ((l = t(this, _).fields) == null ? void 0 : l.get) == "function" ? t(this, _).fields.get() : []).indexOf(e);
1193
+ const n = (typeof ((c = t(this, _).fields) == null ? void 0 : c.get) == "function" ? t(this, _).fields.get() : []).indexOf(e);
1195
1194
  if (n < 0) return;
1196
1195
  const o = this.getValidData()[i];
1197
1196
  if (!o) return;
@@ -1210,10 +1209,10 @@ const W = class W {
1210
1209
  var o;
1211
1210
  if (!i) return i;
1212
1211
  const e = !Array.isArray(i), s = e ? [i] : i, r = typeof ((o = t(this, _).fields) == null ? void 0 : o.get) == "function" ? t(this, _).fields.get() : [], n = s.filter((a) => !a.__ng.deleted).map((a) => {
1213
- const l = {};
1214
- return r.forEach((c, f) => {
1215
- l[c] = a.v ? a.v[f] : a[c];
1216
- }), l.__ng = a.__ng, l;
1212
+ const c = {};
1213
+ return r.forEach((l, f) => {
1214
+ c[l] = a.v ? a.v[f] : a[l];
1215
+ }), c.__ng = a.__ng, c;
1217
1216
  });
1218
1217
  return e ? n[0] : n;
1219
1218
  }, "#conv"));
@@ -1307,9 +1306,9 @@ const Oe = class Oe {
1307
1306
  }
1308
1307
  o.split("data.").forEach((a) => {
1309
1308
  if (a.trim() != "") {
1310
- const l = a.search(/[^_A-Za-z0-9]/g);
1311
- let c = "";
1312
- l >= 0 ? c = a.substring(0, l) : o.startsWith("data.") && (c = a.replace("data.", "")), c && t(this, L).push({ name: c, type: "string" });
1309
+ const c = a.search(/[^_A-Za-z0-9]/g);
1310
+ let l = "";
1311
+ c >= 0 ? l = a.substring(0, c) : o.startsWith("data.") && (l = a.replace("data.", "")), l && t(this, L).push({ name: l, type: "string" });
1313
1312
  }
1314
1313
  });
1315
1314
  });
@@ -1432,10 +1431,10 @@ const ze = class ze extends me {
1432
1431
  if (parseInt(s.sectionRowIndex / t(this, C).template.length) > 0)
1433
1432
  for (var o of r) {
1434
1433
  if (o > e) break;
1435
- var a = parseInt(t(this, p).dataset.row), l = a - 1, c = t(this, p).closest("tr").data, f = t(this, C).data.get(l);
1434
+ var a = parseInt(t(this, p).dataset.row), c = a - 1, l = t(this, p).closest("tr").data, f = t(this, C).data.get(c);
1436
1435
  t(this, p).dataset.matrixRow;
1437
- var u = t(this, C).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, p).dataset.matrixRow}"]`), g = u.dataset.expr ? this.getExprValue(u.dataset.expr, c, a) : c[u.dataset.bind], b = u.dataset.expr ? this.getExprValue(u.dataset.expr, f, l) : f[u.dataset.bind];
1438
- if (g != b) {
1436
+ var u = t(this, C).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, p).dataset.matrixRow}"]`), b = u.dataset.expr ? this.getExprValue(u.dataset.expr, l, a) : l[u.dataset.bind], g = u.dataset.expr ? this.getExprValue(u.dataset.expr, f, c) : f[u.dataset.bind];
1437
+ if (b != g) {
1439
1438
  n = !0;
1440
1439
  break;
1441
1440
  }
@@ -1480,7 +1479,8 @@ const ze = class ze extends me {
1480
1479
  return t(this, p).closest("tr").data;
1481
1480
  }
1482
1481
  refresh() {
1483
- return t(this, p).dataset.bind, parseInt(t(this, p).dataset.row), t(this, Ht).data, t(this, p).dataset.row;
1482
+ const e = t(this, p).dataset.bind;
1483
+ return parseInt(t(this, p).dataset.row), t(this, Ht).data[e];
1484
1484
  }
1485
1485
  };
1486
1486
  C = new WeakMap(), Ht = new WeakMap(), p = new WeakMap(), Ae = new WeakMap(), Re = new WeakMap(), qe = new WeakMap(), ke = new WeakMap(), Te = new WeakMap(), h(ze, "CellElement");