@ninebone/table 0.0.259 β†’ 0.0.261

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.
@@ -310,12 +310,12 @@ const Le = class Le {
310
310
  };
311
311
  $ = new WeakMap(), _ = new WeakMap(), A = new WeakMap(), W = new WeakMap(), H = new WeakMap(), I = new WeakMap(), ne = new WeakMap(), re = new WeakMap(), oe = new WeakMap(), le = new WeakMap(), c(Le, "RowManager");
312
312
  let xe = Le;
313
- var E, F, G, U, ae, ce;
313
+ var R, U, G, F, ae, ce;
314
314
  const j = class j extends HTMLElement {
315
315
  constructor() {
316
316
  super();
317
- u(this, E, null);
318
- u(this, F);
317
+ u(this, R, null);
318
+ u(this, U);
319
319
  /**
320
320
  * 🎯 2차원 μ…€ 격자 인덱슀λ₯Ό κ³„μ‚°ν•˜μ—¬ 병합(`rowSpan`/`colSpan`) μ…€μ˜ μ ˆλŒ€ 컬럼 μœ„μΉ˜λ₯Ό λΆ€μ—¬
321
321
  */
@@ -355,7 +355,7 @@ const j = class j extends HTMLElement {
355
355
  /**
356
356
  * 🎯 순수 바닐라 μžλ°”μŠ€ν¬λ¦½νŠΈ(Vanilla JS) 기반의 κΉ”λ”ν•œ #createSplitTable
357
357
  */
358
- u(this, U, /* @__PURE__ */ c((t, s) => {
358
+ u(this, F, /* @__PURE__ */ c((t, s) => {
359
359
  const n = t.cloneNode(!0);
360
360
  return s === "left" ? n.querySelectorAll("col, th, td").forEach((r) => {
361
361
  r.getAttribute("fixed") !== "left" && r.remove();
@@ -383,19 +383,19 @@ const j = class j extends HTMLElement {
383
383
  }, "ensureThead");
384
384
  return h(l), f(l), l.classList.add("nine-table-element"), l;
385
385
  }, "initializeTable"), n = t.cloneNode(!0);
386
- y(this, E, s(n)), e(this, E).style.display = "table", e(this, G).call(this, e(this, E), "thead"), e(this, G).call(this, e(this, E), "tbody"), Array.from(e(this, E).querySelectorAll("colgroup col")).forEach((l, h) => {
386
+ y(this, R, s(n)), e(this, R).style.display = "table", e(this, G).call(this, e(this, R), "thead"), e(this, G).call(this, e(this, R), "tbody"), Array.from(e(this, R).querySelectorAll("colgroup col")).forEach((l, h) => {
387
387
  const f = l.getAttribute("fixed");
388
- f && e(this, E).querySelectorAll(`[data-col="${h}"]`).forEach((g) => {
388
+ f && e(this, R).querySelectorAll(`[data-col="${h}"]`).forEach((g) => {
389
389
  g.setAttribute("fixed", f);
390
390
  });
391
- }), M.log(e(this, E));
391
+ }), M.log(e(this, R));
392
392
  const o = this.querySelector(".ng-container-left"), a = this.querySelector(".ng-container-body"), d = this.querySelector(".ng-container-right");
393
393
  if (a) {
394
- const l = e(this, U).call(this, e(this, E), null);
395
- a.innerHTML = "", a.appendChild(l), M.log(e(this, E)), M.log(l), e(this, F).initialize(e(this, E));
394
+ const l = e(this, F).call(this, e(this, R), null);
395
+ a.innerHTML = "", a.appendChild(l), M.log(e(this, R)), M.log(l), e(this, U).initialize(e(this, R));
396
396
  }
397
397
  if (o) {
398
- const l = e(this, U).call(this, e(this, E), "left");
398
+ const l = e(this, F).call(this, e(this, R), "left");
399
399
  let h = 0;
400
400
  l.querySelectorAll("col").forEach((g) => {
401
401
  const b = parseInt(g.getAttribute("width"), 10);
@@ -405,7 +405,7 @@ const j = class j extends HTMLElement {
405
405
  o.style.flex = `0 0 ${f}px`, o.style.width = `${f}px`;
406
406
  }
407
407
  if (d) {
408
- const l = e(this, U).call(this, e(this, E), "right");
408
+ const l = e(this, F).call(this, e(this, R), "right");
409
409
  let h = 0;
410
410
  l.querySelectorAll("col").forEach((g) => {
411
411
  const b = parseInt(g.getAttribute("width"), 10);
@@ -422,7 +422,7 @@ const j = class j extends HTMLElement {
422
422
  (l = this.querySelector("nine-table-hscrollbar")) == null || l.refresh();
423
423
  }, 0);
424
424
  }, "generate"));
425
- x(this, "getRowHeight", /* @__PURE__ */ c(() => e(this, F).getRowHeight(), "getRowHeight"));
425
+ x(this, "getRowHeight", /* @__PURE__ */ c(() => e(this, U).getRowHeight(), "getRowHeight"));
426
426
  x(this, "scrollToX", /* @__PURE__ */ c((t) => {
427
427
  const s = this.querySelector(".ng-container-body");
428
428
  s && (s.scrollLeft = t);
@@ -446,9 +446,10 @@ const j = class j extends HTMLElement {
446
446
  v > 0 && (o[b] && (o[b].style.height = `${v}px`), a[b] && (a[b].style.height = `${v}px`), d[b] && (d[b].style.height = `${v}px`));
447
447
  }
448
448
  }, "syncRowHeights");
449
- e(this, ce).call(this), requestAnimationFrame(() => {
450
- t();
451
- }), new MutationObserver((s) => {
449
+ e(this, ce).call(this), new ResizeObserver((s) => {
450
+ for (let n of s)
451
+ n.contentRect.height > 0 && t();
452
+ }).observe(this.querySelector(".ng-container-body")), new MutationObserver((s) => {
452
453
  for (const n of s)
453
454
  n.attributeName === "class" && this.classList.contains("active") && t();
454
455
  }).observe(this, { attributes: !0 });
@@ -577,7 +578,7 @@ const j = class j extends HTMLElement {
577
578
  </div>
578
579
  `;
579
580
  }, "#render"));
580
- y(this, F, new xe(this));
581
+ y(this, U, new xe(this));
581
582
  }
582
583
  connectedCallback() {
583
584
  e(this, ae).call(this);
@@ -586,7 +587,7 @@ const j = class j extends HTMLElement {
586
587
  this.innerHTML = "", M.log("NineTableSheet destroyed.");
587
588
  }
588
589
  };
589
- E = new WeakMap(), F = new WeakMap(), G = new WeakMap(), U = new WeakMap(), ae = new WeakMap(), ce = new WeakMap(), c(j, "NineTableSheet"), x(j, "SCROLLBAR_SIZE", 16);
590
+ R = new WeakMap(), U = new WeakMap(), G = new WeakMap(), F = new WeakMap(), ae = new WeakMap(), ce = new WeakMap(), c(j, "NineTableSheet"), x(j, "SCROLLBAR_SIZE", 16);
590
591
  let te = j;
591
592
  customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", te);
592
593
  var he, J;
@@ -640,29 +641,29 @@ const Ce = class Ce extends HTMLElement {
640
641
  he = new WeakMap(), J = new WeakMap(), c(Ce, "NineTableSheets");
641
642
  let ve = Ce;
642
643
  customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", ve);
643
- var R, de, Q, fe;
644
+ var E, de, Q, fe;
644
645
  const _e = class _e {
645
646
  constructor(i) {
646
- u(this, R);
647
+ u(this, E);
647
648
  u(this, de, /* @__PURE__ */ c(() => {
648
649
  e(this, fe).call(this), new ResizeObserver((i) => {
649
650
  for (let t of i)
650
- e(this, R).getAttribute("auto-height") === "true" && e(this, Q).call(this);
651
- }).observe(e(this, R));
651
+ e(this, E).getAttribute("auto-height") === "true" && e(this, Q).call(this);
652
+ }).observe(e(this, E));
652
653
  }, "#init"));
653
654
  u(this, Q, /* @__PURE__ */ c(() => {
654
655
  var d, l;
655
- const i = Array.from(e(this, R).shadowRoot.querySelectorAll("nine-table-sheet.active"));
656
+ const i = Array.from(e(this, E).shadowRoot.querySelectorAll("nine-table-sheet.active"));
656
657
  if (i.length === 0) return;
657
- const t = parseInt(e(this, R).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((h) => h.getRowHeight())), n = (d = e(this, R).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : d.getBoundingClientRect().height, r = (l = e(this, R).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = te.SCROLLBAR_SIZE, a = t * s + n + r + o;
658
- e(this, R).style.height = `${a}px`;
658
+ const t = parseInt(e(this, E).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((h) => h.getRowHeight())), n = (d = e(this, E).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : d.getBoundingClientRect().height, r = (l = e(this, E).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = te.SCROLLBAR_SIZE, a = t * s + n + r + o;
659
+ e(this, E).style.height = `${a}px`;
659
660
  }, "#applyAutoHeight"));
660
661
  u(this, fe, /* @__PURE__ */ c(() => {
661
- const t = Array.from(e(this, R).children).filter((d) => d.tagName === "TABLE"), s = e(this, R).getAttribute("auto-height") === "true", n = t.length, r = t.map((d, l) => {
662
+ const t = Array.from(e(this, E).children).filter((d) => d.tagName === "TABLE"), s = e(this, E).getAttribute("auto-height") === "true", n = t.length, r = t.map((d, l) => {
662
663
  const f = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, g = l < n - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
663
664
  return f + g;
664
665
  }).join(""), o = t.map((d, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
665
- e(this, R).shadowRoot.innerHTML = `
666
+ e(this, E).shadowRoot.innerHTML = `
666
667
  <style>
667
668
  :host {
668
669
  display: flex;
@@ -761,17 +762,17 @@ const _e = class _e {
761
762
  </nine-table-body>
762
763
  <nine-table-footer></nine-table-footer>
763
764
  `;
764
- const a = e(this, R).shadowRoot.querySelectorAll("nine-table-sheet");
765
+ const a = e(this, E).shadowRoot.querySelectorAll("nine-table-sheet");
765
766
  a == null || a.forEach((d, l) => {
766
767
  t[l] && setTimeout(() => {
767
768
  d.generate(t[l]), s && e(this, Q).call(this);
768
769
  });
769
770
  });
770
771
  }, "#render"));
771
- y(this, R, i), e(this, de).call(this);
772
+ y(this, E, i), e(this, de).call(this);
772
773
  }
773
774
  };
774
- R = new WeakMap(), de = new WeakMap(), Q = new WeakMap(), fe = new WeakMap(), c(_e, "LayoutManager");
775
+ E = new WeakMap(), de = new WeakMap(), Q = new WeakMap(), fe = new WeakMap(), c(_e, "LayoutManager");
775
776
  let Se = _e;
776
777
  var z, X;
777
778
  const He = class He {
@@ -795,7 +796,7 @@ const He = class He {
795
796
  }
796
797
  };
797
798
  z = new WeakMap(), X = new WeakMap(), c(He, "ngRow");
798
- let Ee = He;
799
+ let Re = He;
799
800
  var T, w, q, K, ue, O, ge, ee, be, ye, Z;
800
801
  const k = class k {
801
802
  constructor(i, t) {
@@ -940,10 +941,10 @@ x(k, "ROW_STATE", {
940
941
  UPDATE: "UPDATE",
941
942
  DELETE: "DELETE"
942
943
  });
943
- let Re = k;
944
+ let Ee = k;
944
945
  const Ie = class Ie {
945
946
  constructor(i) {
946
- this.owner = i, this.row = new Ee(this), this.data = new Re(i, this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
947
+ this.owner = i, this.row = new Re(this), this.data = new Ee(i, this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
947
948
  var t;
948
949
  (t = this.owner.view) != null && t.redraw && this.owner.view.redraw();
949
950
  }, this.setDataSource = (t) => {