@ninebone/table 0.0.779 → 0.0.780

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.
@@ -53,13 +53,13 @@ const es = class es extends HTMLElement {
53
53
  }
54
54
  const l = r.clientWidth;
55
55
  if (l <= 0) return;
56
- const u = Math.max(Math.min(l * (a / c), l), 20);
57
- i.style.width = `${u}px`;
56
+ const g = Math.max(Math.min(l * (a / c), l), 20);
57
+ i.style.width = `${g}px`;
58
58
  const f = e.scrollLeft, b = c - a;
59
- let g = 0;
60
- b > 0 && (g = parseInt(f / b * (l - u), 10)), g < 0 && (g = 0);
61
- const p = l - u;
62
- g > p && (g = p), i.style.left = `${g}px`, t(this, E).left.disabled = g === 0, t(this, E).right.disabled = g >= p - 1;
59
+ let u = 0;
60
+ b > 0 && (u = parseInt(f / b * (l - g), 10)), u < 0 && (u = 0);
61
+ const p = l - g;
62
+ u > p && (u = p), i.style.left = `${u}px`, t(this, E).left.disabled = u === 0, t(this, E).right.disabled = u >= p - 1;
63
63
  }, "refresh"));
64
64
  d(this, nt, /* @__PURE__ */ h((e) => {
65
65
  if (!t(this, E)) return !1;
@@ -221,14 +221,14 @@ const ss = class ss extends HTMLElement {
221
221
  this.style.display = "flex";
222
222
  const l = s.clientHeight;
223
223
  if (l <= 0) return;
224
- const u = Math.max(Math.min(l * (i / c), l), 20);
225
- r.style.height = `${u}px`;
224
+ const g = Math.max(Math.min(l * (i / c), l), 20);
225
+ r.style.height = `${g}px`;
226
226
  const f = e.scrollTop, b = Math.max(c - i, 1);
227
227
  S.log(e, f, b);
228
- let g = 0;
229
- b > 0 && (g = f / b * (l - u));
230
- const p = l - u;
231
- g < 0 && (g = 0), g > p && (g = p), r.style.top = `${g}px`, t(this, k).top.disabled = f <= 0, t(this, k).bottom.disabled = f >= b - 1;
228
+ let u = 0;
229
+ b > 0 && (u = f / b * (l - g));
230
+ const p = l - g;
231
+ u < 0 && (u = 0), u > p && (u = p), r.style.top = `${u}px`, t(this, k).top.disabled = f <= 0, t(this, k).bottom.disabled = f >= b - 1;
232
232
  }, "refresh"));
233
233
  d(this, te, /* @__PURE__ */ h(() => {
234
234
  S.log("nine-table-vscrollbar.#init");
@@ -241,11 +241,11 @@ const ss = class ss extends HTMLElement {
241
241
  r.stopPropagation(), r.preventDefault(), y(this, yt, !0), y(this, kt, r.clientY), y(this, It, e.scrollTop);
242
242
  const i = /* @__PURE__ */ h((a) => {
243
243
  if (!t(this, yt)) return;
244
- const c = t(this, k).track.getBoundingClientRect(), l = t(this, k).thumb.clientHeight, f = c.height - l, b = a.clientY - t(this, kt), g = e.clientHeight, p = s(), x = Math.max(p - g, 1);
244
+ const c = t(this, k).track.getBoundingClientRect(), l = t(this, k).thumb.clientHeight, f = c.height - l, b = a.clientY - t(this, kt), u = e.clientHeight, p = s(), x = Math.max(p - u, 1);
245
245
  if (f > 0 && x > 0) {
246
246
  const w = b / f * x;
247
247
  let m = t(this, It) + w;
248
- const T = Math.max(0, p - g);
248
+ const T = Math.max(0, p - u);
249
249
  m < 0 && (m = 0), m > T && (m = T), e.scrollTop = m;
250
250
  }
251
251
  this.refresh();
@@ -255,10 +255,10 @@ const ss = class ss extends HTMLElement {
255
255
  document.addEventListener("mousemove", i), document.addEventListener("mouseup", o);
256
256
  }), t(this, k).track.addEventListener("mousedown", (r) => {
257
257
  if (r.button !== 0 || r.target === t(this, k).thumb) return;
258
- const i = t(this, k).track.getBoundingClientRect(), o = t(this, k).thumb.clientHeight, a = r.clientY - i.top - o / 2, l = i.height - o, u = e.clientHeight, f = s(), b = Math.max(f - u, 1);
258
+ const i = t(this, k).track.getBoundingClientRect(), o = t(this, k).thumb.clientHeight, a = r.clientY - i.top - o / 2, l = i.height - o, g = e.clientHeight, f = s(), b = Math.max(f - g, 1);
259
259
  if (l > 0 && b > 0) {
260
- const g = Math.max(0, Math.min(1, a / l));
261
- e.scrollTop = g * b;
260
+ const u = Math.max(0, Math.min(1, a / l));
261
+ e.scrollTop = u * b;
262
262
  }
263
263
  this.refresh();
264
264
  }), t(this, k).top.addEventListener("click", () => {
@@ -385,7 +385,7 @@ const ns = class ns {
385
385
  if (!o) return;
386
386
  const a = o.querySelector("tbody.bindable-tbody");
387
387
  if (!a) return;
388
- const l = Array.from(a.querySelectorAll("tr")).map((u) => u.cloneNode(!0));
388
+ const l = Array.from(a.querySelectorAll("tr")).map((g) => g.cloneNode(!0));
389
389
  t(this, Y).set(r, l);
390
390
  });
391
391
  const n = t(this, R).querySelector(".ng-container-body .ng-part-body"), e = t(this, R).querySelector(".ng-container-left .ng-part-body"), s = t(this, R).querySelector(".ng-container-right .ng-part-body");
@@ -396,10 +396,8 @@ const ns = class ns {
396
396
  var f;
397
397
  if (r) return;
398
398
  r = !0;
399
- const a = o.scrollTop, c = o.scrollLeft;
400
- S.log(`🖱️ [Scroll Event] source: ${o.className}, scrollTop: ${a}, scrollLeft: ${c}`);
401
- const l = t(this, R).querySelector(".ng-container-body .ng-part-header"), u = t(this, R).querySelector(".ng-container-left .ng-part-header");
402
- t(this, R).querySelector(".ng-container-right .ng-part-header"), S.log(`헤더 상태 확인 -> bodyHeader.scrollLeft: ${l == null ? void 0 : l.scrollLeft}, leftHeader: ${u == null ? void 0 : u.scrollLeft}`), n && n.scrollTop !== a && (n.scrollTop = a), e && e.scrollTop !== a && (e.scrollTop = a), s && s.scrollTop !== a && (s.scrollTop = a), t(this, mt).call(this, a), (f = t(this, R).querySelector("nine-table-vscrollbar")) == null || f.refresh(), r = !1;
399
+ const a = o.scrollTop, c = o.scrollLeft, l = t(this, R).querySelector(".ng-container-body .ng-part-header"), g = t(this, R).querySelector(".ng-container-left .ng-part-body");
400
+ S.log(`🔍 [Scroll] source: ${o.className.trim()} | scrollLeft: ${c} | bodyHeader.scrollLeft: ${l == null ? void 0 : l.scrollLeft} | leftContainer.scrollLeft: ${g == null ? void 0 : g.scrollLeft}`), n && n.scrollTop !== a && (n.scrollTop = a), g && g.scrollTop !== a && (g.scrollTop = a), s && s.scrollTop !== a && (s.scrollTop = a), t(this, mt).call(this, a), (f = t(this, R).querySelector("nine-table-vscrollbar")) == null || f.refresh(), r = !1;
403
401
  }, "handleContainerScroll");
404
402
  [n, e, s].forEach((o) => {
405
403
  o == null || o.addEventListener("scroll", (a) => {
@@ -438,16 +436,16 @@ const ns = class ns {
438
436
  }), r ? r.before(i) : s.appendChild(i);
439
437
  const o = t(this, R), a = o.style.display, c = o.style.visibility, l = o.style.position;
440
438
  (a === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
441
- let u = 0;
439
+ let g = 0;
442
440
  const f = s.querySelectorAll("tr");
443
441
  return f.forEach((b) => {
444
- let g = b.offsetHeight || b.getBoundingClientRect().height;
445
- if (g === 0) {
442
+ let u = b.offsetHeight || b.getBoundingClientRect().height;
443
+ if (u === 0) {
446
444
  const p = window.getComputedStyle(b);
447
- g = parseFloat(p.height) || parseFloat(p.minHeight) || 0;
445
+ u = parseFloat(p.height) || parseFloat(p.minHeight) || 0;
448
446
  }
449
- u += g;
450
- }), f.forEach((b) => b.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l, u <= 0 ? -1 : (y(this, O, u), t(this, Ht).call(this), t(this, O));
447
+ g += u;
448
+ }), f.forEach((b) => b.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l, g <= 0 ? -1 : (y(this, O, g), t(this, Ht).call(this), t(this, O));
451
449
  }, "#measureAndCacheHeight"));
452
450
  d(this, $t, /* @__PURE__ */ h(() => {
453
451
  S.log("rowManager.#updateVirtualScrollHeight");
@@ -466,29 +464,29 @@ const ns = class ns {
466
464
  }
467
465
  }, "#updateRowCount"));
468
466
  d(this, ne, /* @__PURE__ */ h(() => {
469
- var a, c, l, u, f, b;
467
+ var a, c, l, g, f, b;
470
468
  const n = t(this, R).querySelector(".ng-container-left .ng-part-body table"), e = t(this, R).querySelector(".ng-container-body .ng-part-body table"), s = t(this, R).querySelector(".ng-container-right .ng-part-body table");
471
469
  if (e) {
472
- const g = n ? Array.from(n.querySelectorAll("tbody tr")) : [], p = Array.from(e.querySelectorAll("tbody tr")), x = s ? Array.from(s.querySelectorAll("tbody tr")) : [], w = Math.max(g.length, p.length, x.length);
470
+ const u = n ? Array.from(n.querySelectorAll("tbody tr")) : [], p = Array.from(e.querySelectorAll("tbody tr")), x = s ? Array.from(s.querySelectorAll("tbody tr")) : [], w = Math.max(u.length, p.length, x.length);
473
471
  for (let m = 0; m < w; m++) {
474
472
  const T = [
475
- ((a = g[m]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
473
+ ((a = u[m]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
476
474
  ((c = p[m]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
477
475
  ((l = x[m]) == null ? void 0 : l.getBoundingClientRect().height) || 0
478
476
  ], A = Math.max(...T);
479
- A > 0 && (g[m] && (g[m].style.height = `${A}px`), p[m] && (p[m].style.height = `${A}px`), x[m] && (x[m].style.height = `${A}px`));
477
+ A > 0 && (u[m] && (u[m].style.height = `${A}px`), p[m] && (p[m].style.height = `${A}px`), x[m] && (x[m].style.height = `${A}px`));
480
478
  }
481
479
  }
482
480
  const r = t(this, R).querySelector(".ng-container-left .ng-part-footer table"), i = t(this, R).querySelector(".ng-container-body .ng-part-footer table"), o = t(this, R).querySelector(".ng-container-right .ng-part-footer table");
483
481
  if (i) {
484
- const g = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], p = Array.from(i.querySelectorAll("tfoot tr")), x = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], w = Math.max(g.length, p.length, x.length);
482
+ const u = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], p = Array.from(i.querySelectorAll("tfoot tr")), x = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], w = Math.max(u.length, p.length, x.length);
485
483
  for (let m = 0; m < w; m++) {
486
484
  const T = [
487
- ((u = g[m]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
485
+ ((g = u[m]) == null ? void 0 : g.getBoundingClientRect().height) || 0,
488
486
  ((f = p[m]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
489
487
  ((b = x[m]) == null ? void 0 : b.getBoundingClientRect().height) || 0
490
488
  ], A = Math.max(...T);
491
- A > 0 && (g[m] && (g[m].style.height = `${A}px`), p[m] && (p[m].style.height = `${A}px`), x[m] && (x[m].style.height = `${A}px`));
489
+ A > 0 && (u[m] && (u[m].style.height = `${A}px`), p[m] && (p[m].style.height = `${A}px`), x[m] && (x[m].style.height = `${A}px`));
492
490
  }
493
491
  }
494
492
  }, "#syncRowHeights"));
@@ -522,14 +520,14 @@ const ns = class ns {
522
520
  const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
523
521
  if (!r) return;
524
522
  const i = Array.from(r.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this, Y).get(e)) == null ? void 0 : l.length) || 1, c = (t(this, U).data.get() || []).length;
525
- i.forEach((u, f) => {
523
+ i.forEach((g, f) => {
526
524
  const b = n + Math.floor(f / o);
527
525
  if (b >= c) {
528
- u.style.visibility = "hidden";
526
+ g.style.visibility = "hidden";
529
527
  return;
530
528
  }
531
- const g = t(this, U).data.get(b);
532
- u.style.display = "", t(this, _t).call(this, u, g, b);
529
+ const u = t(this, U).data.get(b);
530
+ g.style.display = "", t(this, _t).call(this, g, u, b);
533
531
  });
534
532
  });
535
533
  }, "#adjustBufferRows"));
@@ -544,11 +542,11 @@ const ns = class ns {
544
542
  const o = Math.max(0, s - Math.floor(i.clientHeight / e)), a = Math.min(o, Math.max(0, Math.floor(n / e)));
545
543
  let c = Math.floor(a * e);
546
544
  S.log(`📜 [Scroll Calc] maxStartIndex: ${o}, startIndex: ${a}, offsetY: ${c}`), a === o && S.log(`📜 [Scroll Inspect] scrollTop: ${n}, rowHeight: ${e}, maxStartIndex: ${o}, startIndex: ${a}, offsetY: ${c}`);
547
- const l = t(this, it).firstTr, u = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
548
- (b = t(this, it)) == null || b.scrollTables.forEach((g) => {
549
- g.style.transform = `translate3d(0, ${c}px, 0)`;
550
- }), u !== a && (S.log(`🔄 [Row Bind Trigger] currentStartIndex(${u}) !== startIndex(${a})`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
551
- const p = t(this, R).querySelector(g);
545
+ const l = t(this, it).firstTr, g = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
546
+ (b = t(this, it)) == null || b.scrollTables.forEach((u) => {
547
+ u.style.transform = `translate3d(0, ${c}px, 0)`;
548
+ }), g !== a && (S.log(`🔄 [Row Bind Trigger] currentStartIndex(${g}) !== startIndex(${a})`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((u) => {
549
+ const p = t(this, R).querySelector(u);
552
550
  if (!p) return;
553
551
  const x = p.querySelector(".ng-part-body tbody.bindable-tbody");
554
552
  if (!x) return;
@@ -585,7 +583,7 @@ const ns = class ns {
585
583
  });
586
584
  }, "#bindRowData"));
587
585
  d(this, oe, /* @__PURE__ */ h(() => {
588
- var c, l, u;
586
+ var c, l, g;
589
587
  S.log("rowManager.#syncHeaderHeights");
590
588
  const n = t(this, R).querySelector(".ng-container-left .ng-part-header table"), e = t(this, R).querySelector(".ng-container-body .ng-part-header table"), s = t(this, R).querySelector(".ng-container-right .ng-part-header table");
591
589
  if (!e) return;
@@ -594,9 +592,9 @@ const ns = class ns {
594
592
  const b = [
595
593
  ((c = r[f]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
596
594
  ((l = i[f]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
597
- ((u = o[f]) == null ? void 0 : u.getBoundingClientRect().height) || 0
598
- ], g = Math.max(...b);
599
- g > 0 && (r[f] && (r[f].style.height = `${g}px`), i[f] && (i[f].style.height = `${g}px`), o[f] && (o[f].style.height = `${g}px`));
595
+ ((g = o[f]) == null ? void 0 : g.getBoundingClientRect().height) || 0
596
+ ], u = Math.max(...b);
597
+ u > 0 && (r[f] && (r[f].style.height = `${u}px`), i[f] && (i[f].style.height = `${u}px`), o[f] && (o[f].style.height = `${u}px`));
600
598
  }
601
599
  }, "#syncHeaderHeights"));
602
600
  q(this, "destroy", /* @__PURE__ */ h(() => {
@@ -628,23 +626,23 @@ const ie = class ie {
628
626
  if (!n) return null;
629
627
  const e = /* @__PURE__ */ h((a) => {
630
628
  a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
631
- const u = l.getAttribute("cell-type") || "renderer";
629
+ const g = l.getAttribute("cell-type") || "renderer";
632
630
  if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
633
- let f = `cell-${u}`;
634
- const b = l.getAttribute("data-bind"), g = l.getAttribute("data-expr"), p = l.getAttribute("maxbyte"), x = l.getAttribute("type");
631
+ let f = `cell-${g}`;
632
+ const b = l.getAttribute("data-bind"), u = l.getAttribute("data-expr"), p = l.getAttribute("maxbyte"), x = l.getAttribute("type");
635
633
  let w = [];
636
- b && w.push(`data-bind="${b}"`), g && w.push(`data-expr="${g}"`), p && w.push(`maxbyte="${p}"`), x && w.push(`type="${x}"`), l.innerHTML = `<${f} ${w.join(" ")}></${f}>`;
634
+ b && w.push(`data-bind="${b}"`), u && w.push(`data-expr="${u}"`), p && w.push(`maxbyte="${p}"`), x && w.push(`type="${x}"`), l.innerHTML = `<${f} ${w.join(" ")}></${f}>`;
637
635
  }), a.querySelectorAll("tbody td, tfoot td").forEach((l) => {
638
636
  l.setAttribute("tabindex", "0");
639
637
  });
640
638
  }, "processCellTypes"), s = /* @__PURE__ */ h((a) => {
641
639
  if (!a.querySelector("colgroup")) {
642
- const c = a.querySelector("tbody tr") || a.querySelector("tr"), l = c ? c.querySelectorAll("th, td").length : 1, u = document.createElement("colgroup"), f = Math.max(Math.floor(a.clientWidth / l), 100);
640
+ const c = a.querySelector("tbody tr") || a.querySelector("tr"), l = c ? c.querySelectorAll("th, td").length : 1, g = document.createElement("colgroup"), f = Math.max(Math.floor(a.clientWidth / l), 100);
643
641
  for (let b = 0; b < l; b++) {
644
- const g = document.createElement("col");
645
- g.setAttribute("width", f), u.appendChild(g);
642
+ const u = document.createElement("col");
643
+ u.setAttribute("width", f), g.appendChild(u);
646
644
  }
647
- a.prepend(u);
645
+ a.prepend(g);
648
646
  }
649
647
  if (!a.querySelector("thead")) {
650
648
  const c = document.createElement("thead"), l = a.querySelector("colgroup");
@@ -652,33 +650,33 @@ const ie = class ie {
652
650
  }
653
651
  a.classList.add("nine-table-element");
654
652
  }, "ensureTableStructure"), r = /* @__PURE__ */ h((a, c) => {
655
- const l = Array.from(a.querySelectorAll(c + " tr")), u = Array.from(a.querySelectorAll(c + " th," + c + " td")), f = l.length;
656
- if (f === 0 || u.length === 0) return;
653
+ const l = Array.from(a.querySelectorAll(c + " tr")), g = Array.from(a.querySelectorAll(c + " th," + c + " td")), f = l.length;
654
+ if (f === 0 || g.length === 0) return;
657
655
  let b = 0;
658
- u.forEach((p) => {
656
+ g.forEach((p) => {
659
657
  b += p.colSpan || 1;
660
658
  });
661
- const g = Array.from(Array(f), () => Array(b).fill(null));
659
+ const u = Array.from(Array(f), () => Array(b).fill(null));
662
660
  l.forEach((p) => {
663
661
  const x = p.sectionRowIndex;
664
662
  let w = 0;
665
663
  Array.from(p.querySelectorAll("th,td")).forEach((m) => {
666
- for (let M = 0; M < g[x].length; M++)
667
- if (g[x][M] === null) {
664
+ for (let M = 0; M < u[x].length; M++)
665
+ if (u[x][M] === null) {
668
666
  w = M;
669
667
  break;
670
668
  }
671
669
  const T = m.rowSpan || 1, A = m.colSpan || 1;
672
670
  for (let M = 0; M < T; M++)
673
671
  for (let B = 0; B < A; B++)
674
- x + M < f && w + B < b && (g[x + M][w + B] = M === 0 && B === 0 ? "1" : "0");
672
+ x + M < f && w + B < b && (u[x + M][w + B] = M === 0 && B === 0 ? "1" : "0");
675
673
  });
676
674
  }), l.forEach((p) => {
677
675
  const x = p.sectionRowIndex;
678
676
  Array.from(p.querySelectorAll("th,td")).forEach((w) => {
679
- for (let m = 0; m < g[x].length; m++)
680
- if (g[x][m] === "1") {
681
- w.dataset.col = m, g[x][m] = "0";
677
+ for (let m = 0; m < u[x].length; m++)
678
+ if (u[x][m] === "1") {
679
+ w.dataset.col = m, u[x][m] = "0";
682
680
  break;
683
681
  }
684
682
  });
@@ -686,8 +684,8 @@ const ie = class ie {
686
684
  }, "resetColIndex"), i = n.cloneNode(!0);
687
685
  return s(i), e(i), r(i, "thead"), r(i, "tbody"), r(i, "tfoot"), Array.from(i.querySelectorAll("colgroup col")).forEach((a, c) => {
688
686
  const l = a.getAttribute("fixed");
689
- l && i.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((u) => {
690
- u.setAttribute("fixed", l);
687
+ l && i.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((g) => {
688
+ g.setAttribute("fixed", l);
691
689
  });
692
690
  }), i;
693
691
  }
@@ -719,11 +717,11 @@ const rs = class rs {
719
717
  i.forEach((a) => {
720
718
  a.querySelectorAll("tbody tr").forEach((c) => {
721
719
  const { matrixRow: l } = V(this, K, qt).call(this, c);
722
- l < 0 || c.querySelectorAll("td, th").forEach((u) => {
723
- const f = parseInt(u.dataset.col, 10);
720
+ l < 0 || c.querySelectorAll("td, th").forEach((g) => {
721
+ const f = parseInt(g.dataset.col, 10);
724
722
  if (isNaN(f)) return;
725
- const b = parseInt(u.rowSpan || 1, 10), g = parseInt(u.colSpan || 1, 10), p = l + b - 1, x = f + g - 1;
726
- p >= n && l <= s && x >= e && f <= r && (o++, u.classList.add("selected"), S.log(u, n, e, s, r), l <= n && u.classList.add("selected-top"), p >= s && u.classList.add("selected-bottom"), f <= e && u.classList.add("selected-left"), x >= r && u.classList.add("selected-right"));
723
+ const b = parseInt(g.rowSpan || 1, 10), u = parseInt(g.colSpan || 1, 10), p = l + b - 1, x = f + u - 1;
724
+ p >= n && l <= s && x >= e && f <= r && (o++, g.classList.add("selected"), S.log(g, n, e, s, r), l <= n && g.classList.add("selected-top"), p >= s && g.classList.add("selected-bottom"), f <= e && g.classList.add("selected-left"), x >= r && g.classList.add("selected-right"));
727
725
  });
728
726
  });
729
727
  }), S.log(`✨ [CellSelection.render] Total rendered cells marked: ${o}`);
@@ -742,19 +740,19 @@ const rs = class rs {
742
740
  const l = t(this, N).querySelectorAll(
743
741
  ".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
744
742
  );
745
- let u = !0, f = 0;
746
- for (; u && f < 5; )
747
- u = !1, f++, l.forEach((b) => {
748
- b.querySelectorAll("tbody tr").forEach((g) => {
749
- if (g.classList.contains("nodata")) return;
750
- const { matrixRow: p } = V(this, K, qt).call(this, g);
751
- p < 0 || g.querySelectorAll("td, th").forEach((x) => {
743
+ let g = !0, f = 0;
744
+ for (; g && f < 5; )
745
+ g = !1, f++, l.forEach((b) => {
746
+ b.querySelectorAll("tbody tr").forEach((u) => {
747
+ if (u.classList.contains("nodata")) return;
748
+ const { matrixRow: p } = V(this, K, qt).call(this, u);
749
+ p < 0 || u.querySelectorAll("td, th").forEach((x) => {
752
750
  const w = parseInt(x.dataset.col, 10);
753
751
  if (isNaN(w)) return;
754
752
  const m = parseInt(x.rowSpan || 1, 10), T = parseInt(x.colSpan || 1, 10), A = p + m - 1, M = w + T - 1;
755
753
  if (A >= i && p <= o && M >= a && w <= c) {
756
754
  const z = Math.min(i, p), Gt = Math.max(o, A), bs = Math.min(a, w), ps = Math.max(c, M);
757
- (z !== i || Gt !== o || bs !== a || ps !== c) && (i = z, o = Gt, a = bs, c = ps, u = !0);
755
+ (z !== i || Gt !== o || bs !== a || ps !== c) && (i = z, o = Gt, a = bs, c = ps, g = !0);
758
756
  }
759
757
  });
760
758
  });
@@ -788,24 +786,24 @@ N = new WeakMap(), X = new WeakMap(), K = new WeakSet(), qt = /* @__PURE__ */ h(
788
786
  let a = i, c = o;
789
787
  const l = /* @__PURE__ */ h((f) => {
790
788
  const b = document.elementFromPoint(f.clientX, f.clientY);
791
- let g = b == null ? void 0 : b.closest("td, th");
792
- if (!g || !t(this, N).contains(g)) {
789
+ let u = b == null ? void 0 : b.closest("td, th");
790
+ if (!u || !t(this, N).contains(u)) {
793
791
  const m = t(this, N).querySelectorAll(".ng-part-body tbody tr:not(.nodata) td, .ng-part-body tbody tr:not(.nodata) th");
794
792
  for (const T of m) {
795
793
  const A = T.getBoundingClientRect();
796
794
  if (f.clientX >= A.left && f.clientX <= A.right && f.clientY >= A.top && f.clientY <= A.bottom) {
797
- g = T;
795
+ u = T;
798
796
  break;
799
797
  }
800
798
  }
801
799
  }
802
- if (!g || g.dataset.row === void 0 || g.dataset.col === void 0 || g.closest("tr").classList.contains("nodata")) return;
803
- const p = g.closest("tr"), { matrixRow: x } = V(this, K, qt).call(this, p), w = parseInt(g.dataset.col, 10);
800
+ if (!u || u.dataset.row === void 0 || u.dataset.col === void 0 || u.closest("tr").classList.contains("nodata")) return;
801
+ const p = u.closest("tr"), { matrixRow: x } = V(this, K, qt).call(this, p), w = parseInt(u.dataset.col, 10);
804
802
  x < 0 || a === x && c === w || (a = x, c = w, this.setRange(i, o, x, w));
805
- }, "onMouseMove"), u = /* @__PURE__ */ h(() => {
806
- S.log("🖱️ [MouseUp] Drag ended."), t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "", document.removeEventListener("mousemove", l), document.removeEventListener("mouseup", u);
803
+ }, "onMouseMove"), g = /* @__PURE__ */ h(() => {
804
+ S.log("🖱️ [MouseUp] Drag ended."), t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "", document.removeEventListener("mousemove", l), document.removeEventListener("mouseup", g);
807
805
  }, "onMouseUp");
808
- document.addEventListener("mousemove", l), document.addEventListener("mouseup", u);
806
+ document.addEventListener("mousemove", l), document.addEventListener("mouseup", g);
809
807
  });
810
808
  }, "#initEvents"), h(rs, "CellSelection");
811
809
  let Le = rs;
@@ -859,21 +857,21 @@ const os = class os {
859
857
  return e.forEach((r) => {
860
858
  const i = Array.from(r.querySelectorAll("tbody tr:not(.nodata)"));
861
859
  for (const o of i) {
862
- const a = parseInt(o.dataset.row, 10), c = i.filter((p) => parseInt(p.dataset.row, 10) === a), l = c.length > 0 ? c.length : 1, u = c.indexOf(o), f = a * l + (u >= 0 ? u : 0);
860
+ const a = parseInt(o.dataset.row, 10), c = i.filter((p) => parseInt(p.dataset.row, 10) === a), l = c.length > 0 ? c.length : 1, g = c.indexOf(o), f = a * l + (g >= 0 ? g : 0);
863
861
  if (f === n) {
864
862
  s.push(o);
865
863
  break;
866
864
  }
867
865
  const b = Array.from(o.querySelectorAll("td"));
868
- let g = !1;
866
+ let u = !1;
869
867
  for (const p of b) {
870
868
  const x = parseInt(p.rowSpan || 1, 10);
871
869
  if (x > 1 && n >= f && n < f + x) {
872
- s.push(o), g = !0;
870
+ s.push(o), u = !0;
873
871
  break;
874
872
  }
875
873
  }
876
- if (g) break;
874
+ if (u) break;
877
875
  }
878
876
  }), s;
879
877
  }, "#findTargetTrsByMatrix"));
@@ -885,7 +883,7 @@ const os = class os {
885
883
  for (const a of i) {
886
884
  const c = Array.from(a.querySelectorAll("tbody tr:not(.nodata)"));
887
885
  for (const l of c) {
888
- const u = parseInt(l.dataset.row, 10), f = c.filter((w) => parseInt(w.dataset.row, 10) === u), b = f.length > 0 ? f.length : 1, g = f.indexOf(l), p = u * b + (g >= 0 ? g : 0), x = Array.from(l.querySelectorAll("td"));
886
+ const g = parseInt(l.dataset.row, 10), f = c.filter((w) => parseInt(w.dataset.row, 10) === g), b = f.length > 0 ? f.length : 1, u = f.indexOf(l), p = g * b + (u >= 0 ? u : 0), x = Array.from(l.querySelectorAll("td"));
889
887
  for (const w of x) {
890
888
  const m = parseInt(w.dataset.col, 10), T = parseInt(w.colSpan || 1, 10), A = parseInt(w.rowSpan || 1, 10);
891
889
  if (!isNaN(m) && s >= m && s < m + T && o >= p && o < p + A && window.getComputedStyle(w).display !== "none")
@@ -908,8 +906,8 @@ const os = class os {
908
906
  y(this, ae, e), y(this, le, s);
909
907
  const r = n.closest("tr"), i = r == null ? void 0 : r.closest("tbody");
910
908
  if (i) {
911
- const a = Array.from(i.querySelectorAll("tr:not(.nodata)")).filter((f) => parseInt(f.dataset.row, 10) === e), c = a.length > 0 ? a.length : 1, l = a.indexOf(r), u = e * c + (l >= 0 ? l : 0);
912
- t(this, F).selection.setRange(u, s, u, s);
909
+ const a = Array.from(i.querySelectorAll("tr:not(.nodata)")).filter((f) => parseInt(f.dataset.row, 10) === e), c = a.length > 0 ? a.length : 1, l = a.indexOf(r), g = e * c + (l >= 0 ? l : 0);
910
+ t(this, F).selection.setRange(g, s, g, s);
913
911
  }
914
912
  }
915
913
  }
@@ -918,27 +916,27 @@ const os = class os {
918
916
  if (!t(this, lt)) return;
919
917
  const e = t(this, lt), s = e.closest("tr"), r = parseInt(e.dataset.row, 10), i = parseInt(e.dataset.col, 10), o = s == null ? void 0 : s.closest("tbody");
920
918
  if (!o) return;
921
- const c = Array.from(o.querySelectorAll("tr:not(.nodata)")).filter((B) => parseInt(B.dataset.row, 10) === r), l = c.length > 0 ? c.length : 1, u = c.indexOf(s), f = r * l + (u >= 0 ? u : 0);
922
- let b = f, g = i;
919
+ const c = Array.from(o.querySelectorAll("tr:not(.nodata)")).filter((B) => parseInt(B.dataset.row, 10) === r), l = c.length > 0 ? c.length : 1, g = c.indexOf(s), f = r * l + (g >= 0 ? g : 0);
920
+ let b = f, u = i;
923
921
  switch (n.code) {
924
922
  case "Tab":
925
923
  if (n.preventDefault(), n.shiftKey) {
926
- if (g = t(this, Bt).call(this, f, i), g < 0 && f > 0) {
924
+ if (u = t(this, Bt).call(this, f, i), u < 0 && f > 0) {
927
925
  b = f - 1;
928
926
  const B = t(this, ct).call(this, b), z = t(this, Ot).call(this, B);
929
- g = z ? parseInt(z.dataset.col, 10) : 0;
927
+ u = z ? parseInt(z.dataset.col, 10) : 0;
930
928
  }
931
929
  } else {
932
- g = t(this, Dt).call(this, f, i);
930
+ u = t(this, Dt).call(this, f, i);
933
931
  const B = t(this, ct).call(this, f), z = t(this, Ot).call(this, B), Gt = z ? parseInt(z.dataset.col, 10) + parseInt(z.colSpan || 1, 10) : 0;
934
- g >= Gt && (b = f + 1, g = 0);
932
+ u >= Gt && (b = f + 1, u = 0);
935
933
  }
936
934
  break;
937
935
  case "ArrowRight":
938
- g = t(this, Dt).call(this, f, i);
936
+ u = t(this, Dt).call(this, f, i);
939
937
  break;
940
938
  case "ArrowLeft":
941
- g = t(this, Bt).call(this, f, i);
939
+ u = t(this, Bt).call(this, f, i);
942
940
  break;
943
941
  case "ArrowDown":
944
942
  n.preventDefault(), b = f + (e.rowSpan || 1);
@@ -948,13 +946,13 @@ const os = class os {
948
946
  break;
949
947
  }
950
948
  const p = Math.floor(b / l), x = b % l;
951
- let w = t(this, Wt).call(this, p, x, g, b);
949
+ let w = t(this, Wt).call(this, p, x, u, b);
952
950
  if (w)
953
951
  this.currentCell = w, V(this, pt, $e).call(this, w);
954
952
  else if (p !== r && p >= 0) {
955
953
  const B = ((T = (m = t(this, F)).getRowHeight) == null ? void 0 : T.call(m)) || 40;
956
954
  (M = (A = t(this, F)).scrollToY) == null || M.call(A, p * B), setTimeout(() => {
957
- const z = t(this, Wt).call(this, p, x, g, b);
955
+ const z = t(this, Wt).call(this, p, x, u, b);
958
956
  z && (this.currentCell = z, V(this, pt, $e).call(this, z));
959
957
  }, 0);
960
958
  }
@@ -1022,8 +1020,8 @@ const Ct = class Ct extends HTMLElement {
1022
1020
  const i = e.cloneNode(!0), o = i.querySelector("thead"), a = i.querySelector("tbody"), c = i.querySelector("tfoot");
1023
1021
  if (r === "header") {
1024
1022
  if (a && a.remove(), c && c.remove(), e.querySelector("tbody")) {
1025
- const u = document.createElement("tbody");
1026
- u.className = "fixed-tbody", i.appendChild(u);
1023
+ const g = document.createElement("tbody");
1024
+ g.className = "fixed-tbody", i.appendChild(g);
1027
1025
  }
1028
1026
  } else r === "body" ? (o && o.remove(), c && c.remove(), a && (a.className = "bindable-tbody")) : r === "footer" && (o && o.remove(), a && a.remove());
1029
1027
  return s === "left" ? i.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
@@ -1280,33 +1278,33 @@ const is = class is extends HTMLElement {
1280
1278
  }, "#init"));
1281
1279
  d(this, Ft, /* @__PURE__ */ h((e, s = !1) => {
1282
1280
  const r = /* @__PURE__ */ h(() => {
1283
- const u = Array.from(this.querySelectorAll("nine-table-sheet"));
1284
- Array.from(this.querySelectorAll("nine-splitter")).forEach((g) => g.style.setProperty("display", "none"));
1285
- const b = u.filter((g) => g.classList.contains("active"));
1286
- b.length < 2 || b.forEach((g) => {
1287
- const p = parseInt(g.getAttribute("data-index"), 10), x = this.querySelector(`nine-splitter[data-split-index="${p}"]`), w = u[p + 1];
1281
+ const g = Array.from(this.querySelectorAll("nine-table-sheet"));
1282
+ Array.from(this.querySelectorAll("nine-splitter")).forEach((u) => u.style.setProperty("display", "none"));
1283
+ const b = g.filter((u) => u.classList.contains("active"));
1284
+ b.length < 2 || b.forEach((u) => {
1285
+ const p = parseInt(u.getAttribute("data-index"), 10), x = this.querySelector(`nine-splitter[data-split-index="${p}"]`), w = g[p + 1];
1288
1286
  x && w && w.classList.contains("active") && x.style.setProperty("display", "flex");
1289
1287
  });
1290
1288
  }, "updateSplitters"), i = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = i.querySelectorAll(".nine-tab-item"), c = o.querySelectorAll("nine-table-sheet");
1291
1289
  if (!a[e]) return;
1292
1290
  if (!s)
1293
- a.forEach((u, f) => {
1294
- u.classList.toggle("active", f === e);
1295
- }), c.forEach((u, f) => {
1291
+ a.forEach((g, f) => {
1292
+ g.classList.toggle("active", f === e);
1293
+ }), c.forEach((g, f) => {
1296
1294
  const b = f === e;
1297
- u.classList.toggle("active", b), u.style.flex = b ? "1 1 100%" : "";
1295
+ g.classList.toggle("active", b), g.style.flex = b ? "1 1 100%" : "";
1298
1296
  });
1299
1297
  else {
1300
- const u = a[e], f = i.querySelectorAll(".nine-tab-item.active");
1301
- if (u.classList.contains("active") && f.length <= 1)
1298
+ const g = a[e], f = i.querySelectorAll(".nine-tab-item.active");
1299
+ if (g.classList.contains("active") && f.length <= 1)
1302
1300
  return;
1303
- u.classList.toggle("active");
1301
+ g.classList.toggle("active");
1304
1302
  const b = o.querySelector(`nine-table-sheet[data-index="${e}"]`);
1305
1303
  b && (b.classList.toggle("active"), b.classList.contains("active") || (b.style.flex = ""));
1306
1304
  }
1307
1305
  const l = o.querySelectorAll("nine-table-sheet.active");
1308
- l == null || l.forEach((u) => {
1309
- u.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
1306
+ l == null || l.forEach((g) => {
1307
+ g.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
1310
1308
  }), r();
1311
1309
  }, "#switchSheet"));
1312
1310
  }
@@ -1331,7 +1329,7 @@ const as = class as {
1331
1329
  var c, l;
1332
1330
  const n = Array.from(t(this, _).shadowRoot.querySelectorAll("nine-table-sheet.active"));
1333
1331
  if (n.length === 0) return;
1334
- const e = parseInt(t(this, _).getAttribute("max-display-row"), 10) || 10, s = Math.max(...n.map((u) => u.getRowHeight())), r = (c = t(this, _).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, i = (l = t(this, _).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = Zt.SCROLLBAR_SIZE, a = e * s + r + i + o;
1332
+ const e = parseInt(t(this, _).getAttribute("max-display-row"), 10) || 10, s = Math.max(...n.map((g) => g.getRowHeight())), r = (c = t(this, _).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, i = (l = t(this, _).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = Zt.SCROLLBAR_SIZE, a = e * s + r + i + o;
1335
1333
  t(this, _).style.height = `${a}px`;
1336
1334
  }, "#applyAutoHeight"));
1337
1335
  d(this, pe, /* @__PURE__ */ h(() => {
@@ -1605,8 +1603,8 @@ const P = class P {
1605
1603
  if (!n) return n;
1606
1604
  const e = !Array.isArray(n), s = e ? [n] : n, r = typeof ((o = t(this, D).fields) == null ? void 0 : o.get) == "function" ? t(this, D).fields.get() : [], i = s.filter((a) => !a.__ng.deleted).map((a) => {
1607
1605
  const c = {};
1608
- return r.forEach((l, u) => {
1609
- c[l] = a.v ? a.v[u] : a[l];
1606
+ return r.forEach((l, g) => {
1607
+ c[l] = a.v ? a.v[g] : a[l];
1610
1608
  }), c.__ng = a.__ng, c;
1611
1609
  });
1612
1610
  return e ? i[0] : i;
@@ -1829,10 +1827,10 @@ const fs = class fs extends ze {
1829
1827
  if (parseInt(s.sectionRowIndex / t(this, L).template.length) > 0)
1830
1828
  for (var o of r) {
1831
1829
  if (o > e) break;
1832
- var a = parseInt(t(this, v).dataset.row), c = a - 1, l = t(this, v).closest("tr").data, u = t(this, L).data.get(c);
1830
+ var a = parseInt(t(this, v).dataset.row), c = a - 1, l = t(this, v).closest("tr").data, g = t(this, L).data.get(c);
1833
1831
  t(this, v).dataset.matrixRow;
1834
- var f = t(this, L).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, v).dataset.matrixRow}"]`), b = f.dataset.expr ? this.getExprValue(f.dataset.expr, l, a) : l[f.dataset.bind], g = f.dataset.expr ? this.getExprValue(f.dataset.expr, u, c) : u[f.dataset.bind];
1835
- if (b != g) {
1832
+ var f = t(this, L).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, v).dataset.matrixRow}"]`), b = f.dataset.expr ? this.getExprValue(f.dataset.expr, l, a) : l[f.dataset.bind], u = f.dataset.expr ? this.getExprValue(f.dataset.expr, g, c) : g[f.dataset.bind];
1833
+ if (b != u) {
1836
1834
  i = !0;
1837
1835
  break;
1838
1836
  }