@ninebone/table 0.0.326 β†’ 0.0.329

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.
@@ -1,12 +1,12 @@
1
- var ie = Object.defineProperty;
2
- var se = (x) => {
1
+ var se = Object.defineProperty;
2
+ var ne = (x) => {
3
3
  throw TypeError(x);
4
4
  };
5
- var re = (x, i, e) => i in x ? ie(x, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : x[i] = e;
6
- var c = (x, i) => ie(x, "name", { value: i, configurable: !0 });
7
- var w = (x, i, e) => re(x, typeof i != "symbol" ? i + "" : i, e), ne = (x, i, e) => i.has(x) || se("Cannot " + e);
8
- var t = (x, i, e) => (ne(x, i, "read from private field"), e ? e.call(x) : i.get(x)), h = (x, i, e) => i.has(x) ? se("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(x) : i.set(x, e), g = (x, i, e, s) => (ne(x, i, "write to private field"), s ? s.call(x, e) : i.set(x, e), e);
9
- var oe = (x, i, e, s) => ({
5
+ var le = (x, i, e) => i in x ? se(x, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : x[i] = e;
6
+ var c = (x, i) => se(x, "name", { value: i, configurable: !0 });
7
+ var w = (x, i, e) => le(x, typeof i != "symbol" ? i + "" : i, e), oe = (x, i, e) => i.has(x) || ne("Cannot " + e);
8
+ var t = (x, i, e) => (oe(x, i, "read from private field"), e ? e.call(x) : i.get(x)), h = (x, i, e) => i.has(x) ? ne("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(x) : i.set(x, e), g = (x, i, e, s) => (oe(x, i, "write to private field"), s ? s.call(x, e) : i.set(x, e), e);
9
+ var re = (x, i, e, s) => ({
10
10
  set _(o) {
11
11
  g(x, i, o, e);
12
12
  },
@@ -14,17 +14,17 @@ var oe = (x, i, e, s) => ({
14
14
  return t(x, i, s);
15
15
  }
16
16
  });
17
- import { trace as le } from "@ninebone/util";
18
- const Ut = class Ut extends le.constructor {
17
+ import { trace as ce } from "@ninebone/util";
18
+ const Ft = class Ft extends ce.constructor {
19
19
  constructor() {
20
20
  super(), this.init("nine-table", "green");
21
21
  }
22
22
  };
23
- c(Ut, "Trace");
24
- let $t = Ut;
25
- const tt = new $t();
26
- var C, M, y, D, N, B, ft, P, ut;
27
- const Ft = class Ft extends HTMLElement {
23
+ c(Ft, "Trace");
24
+ let Wt = Ft;
25
+ const z = new Wt();
26
+ var C, M, y, D, N, B, ut, P, bt;
27
+ const Kt = class Kt extends HTMLElement {
28
28
  constructor() {
29
29
  super();
30
30
  h(this, C);
@@ -33,7 +33,7 @@ const Ft = class Ft extends HTMLElement {
33
33
  h(this, D);
34
34
  h(this, N);
35
35
  h(this, B);
36
- h(this, ft, /* @__PURE__ */ c(() => {
36
+ h(this, ut, /* @__PURE__ */ c(() => {
37
37
  if (!t(this, C)) return;
38
38
  const e = t(this, C).querySelector(".ng-container-body");
39
39
  e && (g(this, B, new ResizeObserver(() => {
@@ -59,7 +59,7 @@ const Ft = class Ft extends HTMLElement {
59
59
  let p = 0;
60
60
  b > 0 && (p = parseInt(u / b * (d - f), 10)), p < 0 && (p = 0);
61
61
  const E = d - f;
62
- p > E && (p = E), r.style.left = `${p}px`, tt.log(p), t(this, y).left.disabled = p === 0, t(this, y).right.disabled = p >= E - 1;
62
+ p > E && (p = E), r.style.left = `${p}px`, z.log(p), t(this, y).left.disabled = p === 0, t(this, y).right.disabled = p >= E - 1;
63
63
  }, "refresh"));
64
64
  h(this, P, /* @__PURE__ */ c((e) => {
65
65
  if (!t(this, y)) return !1;
@@ -73,7 +73,7 @@ const Ft = class Ft extends HTMLElement {
73
73
  const d = s.clientWidth, u = o.scrollWidth - d;
74
74
  return a > 0 && u > 0 && (s.scrollLeft = l / a * u), l > 0 && l < a - 1;
75
75
  }, "#thumbMoveTo"));
76
- h(this, ut, /* @__PURE__ */ c(() => {
76
+ h(this, bt, /* @__PURE__ */ c(() => {
77
77
  const e = /* @__PURE__ */ c((o) => {
78
78
  clearInterval(t(this, D)), clearInterval(t(this, N));
79
79
  const r = parseInt(t(this, y).thumb.style.left || 0, 10);
@@ -190,7 +190,7 @@ const Ft = class Ft extends HTMLElement {
190
190
  right: this.querySelector(".ng-scroll-right")
191
191
  }), s.addEventListener("scroll", () => {
192
192
  t(this, M) || this.refresh();
193
- }), t(this, ut).call(this), t(this, ft).call(this), this.refresh();
193
+ }), t(this, bt).call(this), t(this, ut).call(this), this.refresh();
194
194
  }, "initWhenReady");
195
195
  e();
196
196
  }
@@ -198,11 +198,11 @@ const Ft = class Ft extends HTMLElement {
198
198
  t(this, B) && t(this, B).disconnect();
199
199
  }
200
200
  };
201
- C = new WeakMap(), M = new WeakMap(), y = new WeakMap(), D = new WeakMap(), N = new WeakMap(), B = new WeakMap(), ft = new WeakMap(), P = new WeakMap(), ut = new WeakMap(), c(Ft, "NineTableHScrollBar");
202
- let Wt = Ft;
203
- customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Wt);
204
- var Y, I, S, it, st, bt;
205
- const Kt = class Kt extends HTMLElement {
201
+ C = new WeakMap(), M = new WeakMap(), y = new WeakMap(), D = new WeakMap(), N = new WeakMap(), B = new WeakMap(), ut = new WeakMap(), P = new WeakMap(), bt = new WeakMap(), c(Kt, "NineTableHScrollBar");
202
+ let zt = Kt;
203
+ customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", zt);
204
+ var Y, I, S, it, st, gt;
205
+ const jt = class jt extends HTMLElement {
206
206
  constructor() {
207
207
  super();
208
208
  h(this, Y);
@@ -233,7 +233,7 @@ const Kt = class Kt extends HTMLElement {
233
233
  const p = a - d;
234
234
  b < 0 && (b = 0), b > p && (b = p), r.style.top = `${b}px`, t(this, S).top.disabled = f <= 0, t(this, S).bottom.disabled = f >= u - 1;
235
235
  }, "refresh"));
236
- h(this, bt, /* @__PURE__ */ c(() => {
236
+ h(this, gt, /* @__PURE__ */ c(() => {
237
237
  const e = t(this, S).container;
238
238
  e.addEventListener("scroll", () => {
239
239
  t(this, I) || this.refresh();
@@ -243,7 +243,7 @@ const Kt = class Kt extends HTMLElement {
243
243
  const o = /* @__PURE__ */ c((n) => {
244
244
  if (!t(this, I)) return;
245
245
  const l = t(this, S).track.getBoundingClientRect(), a = t(this, S).thumb.clientHeight, f = l.height - a, u = n.clientY - t(this, it), b = e.clientHeight, p = e.querySelector("table");
246
- tt.log(p), tt.log(p.scrollHeight);
246
+ z.log(p), z.log(p.scrollHeight);
247
247
  const q = p.scrollHeight - b;
248
248
  if (f > 0 && q > 0) {
249
249
  const O = u / f * q;
@@ -346,15 +346,15 @@ const Kt = class Kt extends HTMLElement {
346
346
  thumb: this.querySelector(".ng-scroll-thumb"),
347
347
  top: this.querySelector(".ng-scroll-top"),
348
348
  bottom: this.querySelector(".ng-scroll-bottom")
349
- }), t(this, bt).call(this), this.refresh();
349
+ }), t(this, gt).call(this), this.refresh();
350
350
  }, "initWhenReady");
351
351
  e();
352
352
  }
353
353
  };
354
- Y = new WeakMap(), I = new WeakMap(), S = new WeakMap(), it = new WeakMap(), st = new WeakMap(), bt = new WeakMap(), c(Kt, "NineTableVScrollBar");
355
- let zt = Kt;
356
- customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", zt);
357
- var gt, F;
354
+ Y = new WeakMap(), I = new WeakMap(), S = new WeakMap(), it = new WeakMap(), st = new WeakMap(), gt = new WeakMap(), c(jt, "NineTableVScrollBar");
355
+ let Ot = jt;
356
+ customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Ot);
357
+ var yt, F;
358
358
  const H = class H {
359
359
  /**
360
360
  * 🎯 λ ˆμ΄μ•„μ›ƒ λ‚΄μ˜ μ—¬λŸ¬ rawTables 배열을 μΌκ΄„λ‘œ λ°›μ•„ 단일 λ§ˆμŠ€ν„° ν…œν”Œλ¦ΏμœΌλ‘œ 사전 μ»΄νŒŒμΌν•©λ‹ˆλ‹€.
@@ -369,7 +369,7 @@ const H = class H {
369
369
  var o, r, n, l;
370
370
  if (!i) return null;
371
371
  const e = i.cloneNode(!0);
372
- return t(o = H, gt).call(o, e), t(r = H, F).call(r, e, "thead"), t(n = H, F).call(n, e, "tbody"), t(l = H, F).call(l, e, "tfoot"), Array.from(e.querySelectorAll("colgroup col")).forEach((a, d) => {
372
+ return t(o = H, yt).call(o, e), t(r = H, F).call(r, e, "thead"), t(n = H, F).call(n, e, "tbody"), t(l = H, F).call(l, e, "tfoot"), Array.from(e.querySelectorAll("colgroup col")).forEach((a, d) => {
373
373
  const f = a.getAttribute("fixed");
374
374
  f && e.querySelectorAll(`thead [data-col="${d}"], tbody [data-col="${d}"], tfoot [data-col="${d}"]`).forEach((u) => {
375
375
  u.setAttribute("fixed", f);
@@ -377,7 +377,7 @@ const H = class H {
377
377
  }), e;
378
378
  }
379
379
  };
380
- gt = new WeakMap(), F = new WeakMap(), c(H, "TableCompiler"), h(H, gt, /* @__PURE__ */ c((i) => {
380
+ yt = new WeakMap(), F = new WeakMap(), c(H, "TableCompiler"), h(H, yt, /* @__PURE__ */ c((i) => {
381
381
  if (!i.querySelector("colgroup")) {
382
382
  const e = i.querySelector("tbody tr") || i.querySelector("tr"), s = e ? e.querySelectorAll("th, td").length : 1, o = document.createElement("colgroup"), r = Math.max(Math.floor(i.clientWidth / s), 100);
383
383
  for (let n = 0; n < s; n++) {
@@ -424,9 +424,9 @@ gt = new WeakMap(), F = new WeakMap(), c(H, "TableCompiler"), h(H, gt, /* @__PUR
424
424
  });
425
425
  });
426
426
  }, "#resetColIndex"));
427
- let Ot = H;
428
- var nt, m, _, R, $, V, K, yt, pt, ot, rt, mt, xt, lt, j, vt;
429
- const jt = class jt {
427
+ let Dt = H;
428
+ var nt, m, _, R, $, V, K, pt, mt, ot, rt, xt, vt, lt, j, wt;
429
+ const Zt = class Zt {
430
430
  constructor(i) {
431
431
  h(this, nt);
432
432
  h(this, m);
@@ -453,7 +453,7 @@ const jt = class jt {
453
453
  });
454
454
  const i = t(this, m).querySelector(".ng-container-body"), e = t(this, m).querySelector(".ng-container-left"), s = t(this, m).querySelector(".ng-container-right");
455
455
  if (i) {
456
- t(this, pt).call(this, i), t(this, lt).call(this), t(this, ot).call(this), t(this, j).call(this, i.scrollTop);
456
+ t(this, mt).call(this, i), t(this, lt).call(this), t(this, ot).call(this), t(this, j).call(this, i.scrollTop);
457
457
  let o = i.scrollTop;
458
458
  const r = /* @__PURE__ */ c((n) => {
459
459
  var l;
@@ -465,7 +465,7 @@ const jt = class jt {
465
465
  });
466
466
  }
467
467
  }, "initialize"));
468
- h(this, yt, /* @__PURE__ */ c((i, e) => {
468
+ h(this, pt, /* @__PURE__ */ c((i, e) => {
469
469
  const s = t(this, _).get(e);
470
470
  if (!s || s.length === 0) return;
471
471
  const o = i.querySelector("tbody.bindable-tbody");
@@ -478,7 +478,7 @@ const jt = class jt {
478
478
  });
479
479
  r ? r.before(n) : o.appendChild(n);
480
480
  }, "#renderRows"));
481
- h(this, pt, /* @__PURE__ */ c((i) => {
481
+ h(this, mt, /* @__PURE__ */ c((i) => {
482
482
  if (t(this, R) !== null && t(this, R) > 0)
483
483
  return t(this, R);
484
484
  const e = t(this, _).get(".ng-container-body");
@@ -501,7 +501,7 @@ const jt = class jt {
501
501
  h(this, ot, /* @__PURE__ */ c(() => {
502
502
  if (!t(this, m).querySelector(".ng-container-body")) return;
503
503
  const e = t(this, nt).data.get() || [];
504
- console.trace(e);
504
+ z.log(e);
505
505
  const s = e.length > 0 ? e.length : 100, o = t(this, R), r = s * o;
506
506
  [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
507
507
  const l = t(this, m).querySelector(n), a = l == null ? void 0 : l.querySelector("table");
@@ -515,7 +515,7 @@ const jt = class jt {
515
515
  } else
516
516
  g(this, K, 40);
517
517
  }, "#updateRowCount"));
518
- h(this, mt, /* @__PURE__ */ c(() => {
518
+ h(this, xt, /* @__PURE__ */ c(() => {
519
519
  var a, d, f;
520
520
  const i = t(this, m).querySelector(".ng-container-left table"), e = t(this, m).querySelector(".ng-container-body table"), s = t(this, m).querySelector(".ng-container-right table");
521
521
  if (!e) return;
@@ -529,7 +529,7 @@ const jt = class jt {
529
529
  p > 0 && (o[u] && (o[u].style.height = `${p}px`), r[u] && (r[u].style.height = `${p}px`), n[u] && (n[u].style.height = `${p}px`));
530
530
  }
531
531
  }, "#syncRowHeights"));
532
- h(this, xt, /* @__PURE__ */ c(() => {
532
+ h(this, vt, /* @__PURE__ */ c(() => {
533
533
  !t(this, m) || !(t(this, m) instanceof HTMLElement) || (g(this, $, new ResizeObserver((i) => {
534
534
  for (const e of i) {
535
535
  const s = e.target;
@@ -548,8 +548,8 @@ const jt = class jt {
548
548
  h(this, lt, /* @__PURE__ */ c(() => {
549
549
  [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
550
550
  const e = t(this, m).querySelector(i);
551
- e && e.querySelector("tbody.bindable-tbody") && t(this, yt).call(this, e, i);
552
- }), t(this, mt).call(this);
551
+ e && e.querySelector("tbody.bindable-tbody") && t(this, pt).call(this, e, i);
552
+ }), t(this, xt).call(this);
553
553
  }, "#renderAllContainers"));
554
554
  h(this, j, /* @__PURE__ */ c((i) => {
555
555
  var r;
@@ -562,13 +562,13 @@ const jt = class jt {
562
562
  const a = l.querySelector("tbody.bindable-tbody");
563
563
  if (!a) return;
564
564
  Array.from(a.querySelectorAll("tr:not(.nodata)")).forEach((f, u) => {
565
- var E, q, O, ee;
566
- const b = s + Math.floor(u / o), p = (typeof t(this, m).getData == "function" ? t(this, m).getData(b) : null) ?? (typeof ((E = t(this, m).data) == null ? void 0 : E.get) == "function" ? t(this, m).data.get(b) : null) ?? ((O = (q = t(this, m).dataManager) == null ? void 0 : q.rawRecords) == null ? void 0 : O[b]) ?? ((ee = t(this, m).data) == null ? void 0 : ee[b]) ?? { _index: b };
567
- f.style.display = "", t(this, vt).call(this, f, p, b);
565
+ var E, q, O, ie;
566
+ const b = s + Math.floor(u / o), p = (typeof t(this, m).getData == "function" ? t(this, m).getData(b) : null) ?? (typeof ((E = t(this, m).data) == null ? void 0 : E.get) == "function" ? t(this, m).data.get(b) : null) ?? ((O = (q = t(this, m).dataManager) == null ? void 0 : q.rawRecords) == null ? void 0 : O[b]) ?? ((ie = t(this, m).data) == null ? void 0 : ie[b]) ?? { _index: b };
567
+ f.style.display = "", t(this, wt).call(this, f, p, b);
568
568
  });
569
569
  });
570
570
  }, "#handleScroll"));
571
- h(this, vt, /* @__PURE__ */ c((i, e, s) => {
571
+ h(this, wt, /* @__PURE__ */ c((i, e, s) => {
572
572
  i.dataset.row = s, Array.from(i.cells).forEach((o, r) => {
573
573
  const n = o.dataset.bind;
574
574
  n && e && e[n] !== void 0 ? o.textContent = e[n] : o.textContent = e ? e[Object.keys(e)[r]] ?? `R${s}C${r}` : `ν–‰ ${s + 1}`, o.dataset.row = s;
@@ -577,7 +577,7 @@ const jt = class jt {
577
577
  w(this, "destroy", /* @__PURE__ */ c(() => {
578
578
  t(this, $) && (t(this, $).disconnect(), g(this, $, null));
579
579
  }, "destroy"));
580
- g(this, nt, i.getRootNode().host), g(this, m, i), t(this, xt).call(this);
580
+ g(this, nt, i.getRootNode().host), g(this, m, i), t(this, vt).call(this);
581
581
  }
582
582
  getRowHeight() {
583
583
  return t(this, R);
@@ -587,16 +587,16 @@ const jt = class jt {
587
587
  return ((e = t(this, _).get(i)) == null ? void 0 : e.length) || 1;
588
588
  }
589
589
  };
590
- nt = new WeakMap(), m = new WeakMap(), _ = new WeakMap(), R = new WeakMap(), $ = new WeakMap(), V = new WeakMap(), K = new WeakMap(), yt = new WeakMap(), pt = new WeakMap(), ot = new WeakMap(), rt = new WeakMap(), mt = new WeakMap(), xt = new WeakMap(), lt = new WeakMap(), j = new WeakMap(), vt = new WeakMap(), c(jt, "RowManager");
591
- let Dt = jt;
592
- var wt, Z, G, St, Et, Rt, kt, qt;
590
+ nt = new WeakMap(), m = new WeakMap(), _ = new WeakMap(), R = new WeakMap(), $ = new WeakMap(), V = new WeakMap(), K = new WeakMap(), pt = new WeakMap(), mt = new WeakMap(), ot = new WeakMap(), rt = new WeakMap(), xt = new WeakMap(), vt = new WeakMap(), lt = new WeakMap(), j = new WeakMap(), wt = new WeakMap(), c(Zt, "RowManager");
591
+ let Nt = Zt;
592
+ var St, Z, G, Et, Rt, kt, qt, Tt;
593
593
  const et = class et extends HTMLElement {
594
594
  constructor() {
595
595
  super();
596
- h(this, wt);
596
+ h(this, St);
597
597
  h(this, Z, null);
598
598
  h(this, G);
599
- h(this, St, /* @__PURE__ */ c(() => {
599
+ h(this, Et, /* @__PURE__ */ c(() => {
600
600
  [
601
601
  { selector: ".ng-container-body", type: null },
602
602
  { selector: ".ng-container-left", type: "left" },
@@ -604,11 +604,11 @@ const et = class et extends HTMLElement {
604
604
  ].forEach(({ selector: s, type: o }) => {
605
605
  const r = this.querySelector(s);
606
606
  if (!r) return;
607
- const n = t(this, Rt).call(this, t(this, Z), o);
607
+ const n = t(this, kt).call(this, t(this, Z), o);
608
608
  r.innerHTML = "", r.appendChild(n);
609
609
  });
610
610
  }, "#renderSplitContainers"));
611
- h(this, Et, /* @__PURE__ */ c(() => {
611
+ h(this, Rt, /* @__PURE__ */ c(() => {
612
612
  ["left", "right"].forEach((e) => {
613
613
  const s = this.querySelector(`.ng-container-${e}`), o = s == null ? void 0 : s.querySelector("table");
614
614
  if (!s || !o) return;
@@ -620,7 +620,7 @@ const et = class et extends HTMLElement {
620
620
  });
621
621
  }, "#updateContainerWidths"));
622
622
  w(this, "generate", /* @__PURE__ */ c((e) => {
623
- e && (g(this, Z, Ot.compile(e)), t(this, Z).style.display = "table", t(this, St).call(this), t(this, Et).call(this), requestAnimationFrame(() => {
623
+ e && (g(this, Z, Dt.compile(e)), t(this, Z).style.display = "table", t(this, Et).call(this), t(this, Rt).call(this), requestAnimationFrame(() => {
624
624
  var o;
625
625
  const s = (o = this.querySelector("thead")) == null ? void 0 : o.getBoundingClientRect().height;
626
626
  this.querySelectorAll("tbody.fixed-tbody").forEach((r) => {
@@ -634,7 +634,7 @@ const et = class et extends HTMLElement {
634
634
  /**
635
635
  * 🎯 λ§ˆμŠ€ν„° ν…Œμ΄λΈ”μ„ 기반으둜 νŠΉμ • fixed νƒ€μž… μ˜μ—­λ§Œ λ‚¨κΈ°λŠ” λΆ„ν•  헬퍼
636
636
  */
637
- h(this, Rt, /* @__PURE__ */ c((e, s) => {
637
+ h(this, kt, /* @__PURE__ */ c((e, s) => {
638
638
  const o = e.cloneNode(!0), r = o.querySelector("tbody");
639
639
  if (r) {
640
640
  const n = document.createElement("tbody");
@@ -657,10 +657,10 @@ const et = class et extends HTMLElement {
657
657
  const s = this.querySelector(".ng-container-body");
658
658
  s && (s.scrollTop = e);
659
659
  }, "scrollToY"));
660
- h(this, kt, /* @__PURE__ */ c(() => {
661
- t(this, qt).call(this);
662
- }, "#init"));
663
660
  h(this, qt, /* @__PURE__ */ c(() => {
661
+ t(this, Tt).call(this);
662
+ }, "#init"));
663
+ h(this, Tt, /* @__PURE__ */ c(() => {
664
664
  const e = et.SCROLLBAR_SIZE;
665
665
  this.innerHTML = `
666
666
  <style>
@@ -807,23 +807,23 @@ const et = class et extends HTMLElement {
807
807
  </div>
808
808
  `;
809
809
  }, "#render"));
810
- g(this, G, new Dt(this)), g(this, wt, this.getRootNode().host);
810
+ g(this, G, new Nt(this)), g(this, St, this.getRootNode().host);
811
811
  }
812
812
  connectedCallback() {
813
- t(this, kt).call(this);
813
+ t(this, qt).call(this);
814
814
  }
815
815
  disconnectedCallback() {
816
- this.innerHTML = "", tt.log("NineTableSheet destroyed.");
816
+ this.innerHTML = "", z.log("NineTableSheet destroyed.");
817
817
  }
818
818
  };
819
- wt = new WeakMap(), Z = new WeakMap(), G = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), Rt = new WeakMap(), kt = new WeakMap(), qt = new WeakMap(), c(et, "NineTableSheet"), w(et, "SCROLLBAR_SIZE", 16);
820
- let dt = et;
821
- customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", dt);
822
- var Tt, ct;
823
- const Zt = class Zt extends HTMLElement {
819
+ St = new WeakMap(), Z = new WeakMap(), G = new WeakMap(), Et = new WeakMap(), Rt = new WeakMap(), kt = new WeakMap(), qt = new WeakMap(), Tt = new WeakMap(), c(et, "NineTableSheet"), w(et, "SCROLLBAR_SIZE", 16);
820
+ let ft = et;
821
+ customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", ft);
822
+ var At, ct;
823
+ const Gt = class Gt extends HTMLElement {
824
824
  constructor() {
825
825
  super();
826
- h(this, Tt, /* @__PURE__ */ c(() => {
826
+ h(this, At, /* @__PURE__ */ c(() => {
827
827
  var e;
828
828
  (e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
829
829
  var n;
@@ -864,18 +864,18 @@ const Zt = class Zt extends HTMLElement {
864
864
  }, "#switchSheet"));
865
865
  }
866
866
  connectedCallback() {
867
- t(this, Tt).call(this);
867
+ t(this, At).call(this);
868
868
  }
869
869
  };
870
- Tt = new WeakMap(), ct = new WeakMap(), c(Zt, "NineTableSheets");
871
- let Nt = Zt;
872
- customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", Nt);
873
- var k, At, at, Lt;
874
- const Gt = class Gt {
870
+ At = new WeakMap(), ct = new WeakMap(), c(Gt, "NineTableSheets");
871
+ let Bt = Gt;
872
+ customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", Bt);
873
+ var k, Lt, at, Ht;
874
+ const Jt = class Jt {
875
875
  constructor(i) {
876
876
  h(this, k);
877
- h(this, At, /* @__PURE__ */ c(() => {
878
- t(this, Lt).call(this), new ResizeObserver((i) => {
877
+ h(this, Lt, /* @__PURE__ */ c(() => {
878
+ t(this, Ht).call(this), new ResizeObserver((i) => {
879
879
  for (let e of i)
880
880
  t(this, k).getAttribute("auto-height") === "true" && t(this, at).call(this);
881
881
  }).observe(t(this, k));
@@ -884,10 +884,10 @@ const Gt = class Gt {
884
884
  var a, d;
885
885
  const i = Array.from(t(this, k).shadowRoot.querySelectorAll("nine-table-sheet.active"));
886
886
  if (i.length === 0) return;
887
- const e = parseInt(t(this, k).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), o = (a = t(this, k).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : a.getBoundingClientRect().height, r = (d = t(this, k).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : d.getBoundingClientRect().height, n = dt.SCROLLBAR_SIZE, l = e * s + o + r + n;
887
+ const e = parseInt(t(this, k).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), o = (a = t(this, k).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : a.getBoundingClientRect().height, r = (d = t(this, k).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : d.getBoundingClientRect().height, n = ft.SCROLLBAR_SIZE, l = e * s + o + r + n;
888
888
  t(this, k).style.height = `${l}px`;
889
889
  }, "#applyAutoHeight"));
890
- h(this, Lt, /* @__PURE__ */ c(() => {
890
+ h(this, Ht, /* @__PURE__ */ c(() => {
891
891
  const e = Array.from(t(this, k).children).filter((a) => a.tagName === "TABLE"), s = t(this, k).getAttribute("auto-height") === "true", o = e.length, r = e.map((a, d) => {
892
892
  const u = `<nine-table-sheet class="${d === 0 ? "active" : ""}" data-index="${d}"></nine-table-sheet>`, b = d < o - 1 ? `<nine-splitter class="h" data-split-index="${d}"></nine-splitter>` : "";
893
893
  return u + b;
@@ -998,73 +998,68 @@ const Gt = class Gt {
998
998
  });
999
999
  });
1000
1000
  }, "#render"));
1001
- g(this, k, i), t(this, At).call(this);
1001
+ g(this, k, i), t(this, Lt).call(this);
1002
1002
  }
1003
1003
  };
1004
- k = new WeakMap(), At = new WeakMap(), at = new WeakMap(), Lt = new WeakMap(), c(Gt, "LayoutManager");
1005
- let Bt = Gt;
1006
- var W, X;
1007
- const Jt = class Jt {
1004
+ k = new WeakMap(), Lt = new WeakMap(), at = new WeakMap(), Ht = new WeakMap(), c(Jt, "LayoutManager");
1005
+ let Pt = Jt;
1006
+ var ht, J;
1007
+ const Qt = class Qt {
1008
1008
  constructor(i) {
1009
- h(this, W);
1010
- h(this, X, -1);
1011
- w(this, "count", /* @__PURE__ */ c(() => t(this, W).rawRecords.length, "count"));
1012
- g(this, W, i);
1009
+ h(this, ht);
1010
+ h(this, J, -1);
1011
+ w(this, "count", /* @__PURE__ */ c(() => t(this, ht).rawRecords.length, "count"));
1012
+ g(this, ht, i);
1013
1013
  }
1014
1014
  get at() {
1015
- return t(this, X);
1015
+ return t(this, J);
1016
1016
  }
1017
1017
  set at(i) {
1018
- var s, o;
1019
- g(this, X, parseInt(i, 10));
1020
- const e = ((o = (s = t(this, W).owner).querySelector) == null ? void 0 : o.call(s, ".ng-container-body")) || t(this, W).owner.body;
1021
- e && !e.querySelector(`tbody.bindable tr[data-row="${t(this, X)}"]`) && setTimeout(() => {
1022
- var r, n;
1023
- (n = (r = t(this, W).owner).scrollTo_V1) == null || n.call(r, t(this, X));
1018
+ g(this, J, parseInt(i, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, J)}"]`) && setTimeout(() => {
1024
1019
  });
1025
1020
  }
1026
1021
  };
1027
- W = new WeakMap(), X = new WeakMap(), c(Jt, "ngRow");
1028
- let Pt = Jt;
1029
- var T, v, A, J, Ht, z, Ct, ht, _t, Mt, Q;
1022
+ ht = new WeakMap(), J = new WeakMap(), c(Qt, "ngRow");
1023
+ let Yt = Qt;
1024
+ var T, v, A, Q, Ct, W, _t, dt, Mt, It, tt;
1030
1025
  const L = class L {
1031
1026
  constructor(i, e) {
1032
1027
  h(this, T);
1033
1028
  h(this, v);
1034
1029
  h(this, A, []);
1035
- h(this, J, []);
1036
- h(this, Ht, 0);
1037
- h(this, z, []);
1038
- h(this, Ct, /* @__PURE__ */ c(() => {
1039
- g(this, z, []);
1030
+ h(this, Q, []);
1031
+ h(this, Ct, 0);
1032
+ h(this, W, []);
1033
+ h(this, _t, /* @__PURE__ */ c(() => {
1034
+ g(this, W, []);
1040
1035
  const i = t(this, T).template || [];
1041
1036
  Array.from(i).forEach((e) => {
1042
1037
  var s;
1043
- t(this, z).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
1038
+ t(this, W).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
1044
1039
  }), (t(this, v).rawRecords || []).forEach((e) => {
1045
- e.__ng || (e.__ng = t(this, ht).call(this)), e.__ng.height = t(this, z).slice();
1040
+ e.__ng || (e.__ng = t(this, dt).call(this)), e.__ng.height = t(this, W).slice();
1046
1041
  });
1047
1042
  }, "#initialize"));
1048
1043
  w(this, "set", /* @__PURE__ */ c((i) => {
1049
- this.clear(), this.add(i, !1);
1044
+ this.clear(), this.add(i, !1), z.log();
1050
1045
  }, "set"));
1051
- h(this, ht, /* @__PURE__ */ c(() => ({
1046
+ h(this, dt, /* @__PURE__ */ c(() => ({
1052
1047
  rowState: L.ROW_STATE.EMPTY,
1053
1048
  deleted: !1,
1054
1049
  filtered: !1,
1055
- height: t(this, z).slice(),
1050
+ height: t(this, W).slice(),
1056
1051
  o: {},
1057
1052
  c: {},
1058
- _: [0, 0, 0, 0, L.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, z).slice(), -1, {}, {}]
1053
+ _: [0, 0, 0, 0, L.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, W).slice(), -1, {}, {}]
1059
1054
  }), "#getDefaultMeta"));
1060
1055
  w(this, "reset", /* @__PURE__ */ c(() => {
1061
- g(this, A, []), g(this, J, []);
1056
+ g(this, A, []), g(this, Q, []);
1062
1057
  }, "reset"));
1063
1058
  w(this, "clear", /* @__PURE__ */ c(() => {
1064
1059
  var i;
1065
- t(this, v).rawRecords = [], g(this, A, []), g(this, J, []), (i = t(this, v).viewRecords) != null && i.reset && t(this, v).viewRecords.reset();
1060
+ t(this, v).rawRecords = [], g(this, A, []), g(this, Q, []), (i = t(this, v).viewRecords) != null && i.reset && t(this, v).viewRecords.reset();
1066
1061
  }, "clear"));
1067
- h(this, _t, /* @__PURE__ */ c((i) => {
1062
+ h(this, Mt, /* @__PURE__ */ c((i) => {
1068
1063
  var o;
1069
1064
  Array.isArray(i) || (i = [i]);
1070
1065
  const e = typeof ((o = t(this, T).fields) == null ? void 0 : o.get) == "function" ? t(this, T).fields.get() : Object.keys(i[0] || {}), s = [];
@@ -1075,14 +1070,14 @@ const L = class L {
1075
1070
  }), s.push(n);
1076
1071
  }), s;
1077
1072
  }, "#json2Array"));
1078
- h(this, Mt, /* @__PURE__ */ c((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
1079
- e.__ng = t(this, ht).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = L.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
1073
+ h(this, It, /* @__PURE__ */ c((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
1074
+ e.__ng = t(this, dt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = L.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
1080
1075
  }), i), "#defaultInsert"));
1081
1076
  w(this, "add", /* @__PURE__ */ c((i, e = !0) => {
1082
1077
  var r;
1083
1078
  i === void 0 && (i = {});
1084
- const s = t(this, _t).call(this, i);
1085
- t(this, v).rawRecords = t(this, v).rawRecords.concat(t(this, Mt).call(this, s)), this.resetRecords();
1079
+ const s = t(this, Mt).call(this, i);
1080
+ t(this, v).rawRecords = t(this, v).rawRecords.concat(t(this, It).call(this, s)), this.resetRecords();
1086
1081
  const o = this.count() - 1;
1087
1082
  return e || s.forEach((n, l) => {
1088
1083
  const a = t(this, v).rawRecords[o - l];
@@ -1092,7 +1087,7 @@ const L = class L {
1092
1087
  w(this, "delete", /* @__PURE__ */ c((i) => {
1093
1088
  var s;
1094
1089
  let e = [];
1095
- Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this, v).owner.row.at] : e = [parseInt(i, 10)], e.sort((o, r) => r - o).forEach((o) => {
1090
+ Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this, v).host.row.at] : e = [parseInt(i, 10)], e.sort((o, r) => r - o).forEach((o) => {
1096
1091
  if (t(this, A)[o]) {
1097
1092
  const r = t(this, A)[o].__ng.rowid;
1098
1093
  t(this, A)[o].__ng.rowState === L.ROW_STATE.INSERT ? t(this, v).rawRecords = t(this, v).rawRecords.filter((n) => n.__ng.rowid !== r) : t(this, v).rawRecords.forEach((n) => {
@@ -1109,17 +1104,17 @@ const L = class L {
1109
1104
  const n = this.getValidData()[i];
1110
1105
  if (!n) return;
1111
1106
  const l = n.v[r];
1112
- l !== s && n.__ng.rowState !== L.ROW_STATE.INSERT && (n.__ng.o.hasOwnProperty(e) || (n.__ng.o[e] = l), n.__ng.rowState = L.ROW_STATE.UPDATE), n.v[r] = s, t(this, v).owner.refreshData && t(this, v).owner.refreshData(i);
1107
+ l !== s && n.__ng.rowState !== L.ROW_STATE.INSERT && (n.__ng.o.hasOwnProperty(e) || (n.__ng.o[e] = l), n.__ng.rowState = L.ROW_STATE.UPDATE), n.v[r] = s;
1113
1108
  }, "setValue"));
1114
1109
  w(this, "resetRecords", /* @__PURE__ */ c(() => {
1115
- g(this, J, t(this, v).rawRecords.filter((i) => !i.__ng.deleted)), g(this, A, t(this, v).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, v).rawRecords.forEach((i, e) => {
1110
+ g(this, Q, t(this, v).rawRecords.filter((i) => !i.__ng.deleted)), g(this, A, t(this, v).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, v).rawRecords.forEach((i, e) => {
1116
1111
  i.__ng.rowidx = e;
1117
1112
  }), t(this, A).forEach((i, e) => {
1118
1113
  i.__ng.i = e;
1119
1114
  });
1120
1115
  }, "resetRecords"));
1121
1116
  w(this, "getValidData", /* @__PURE__ */ c(() => (t(this, A).length === 0 && t(this, v).rawRecords.length > 0 && this.resetRecords(), t(this, A)), "getValidData"));
1122
- h(this, Q, /* @__PURE__ */ c((i) => {
1117
+ h(this, tt, /* @__PURE__ */ c((i) => {
1123
1118
  var s;
1124
1119
  if (!i) return i;
1125
1120
  const e = typeof ((s = t(this, T).fields) == null ? void 0 : s.get) == "function" ? t(this, T).fields.get() : [];
@@ -1135,25 +1130,25 @@ const L = class L {
1135
1130
  var r;
1136
1131
  const s = this.getValidData();
1137
1132
  if (!s || s.length <= 0) return;
1138
- if (i == null) return t(this, Q).call(this, s);
1133
+ if (i == null) return t(this, tt).call(this, s);
1139
1134
  if (i < 0 || i >= s.length) return null;
1140
1135
  const o = typeof ((r = t(this, T).fields) == null ? void 0 : r.get) == "function" ? t(this, T).fields.get() : [];
1141
1136
  if (e != null) {
1142
1137
  const n = o.indexOf(e);
1143
1138
  return n >= 0 ? s[i].v[n] : null;
1144
1139
  }
1145
- return t(this, Q).call(this, s[i]);
1140
+ return t(this, tt).call(this, s[i]);
1146
1141
  }, "get"));
1147
- g(this, T, i), g(this, v, e), t(this, Ct).call(this);
1142
+ g(this, T, i), g(this, v, e), t(this, _t).call(this);
1148
1143
  }
1149
1144
  get source() {
1150
- return t(this, Q).call(this, t(this, v).rawRecords);
1145
+ return t(this, tt).call(this, t(this, v).rawRecords);
1151
1146
  }
1152
1147
  set source(i) {
1153
1148
  this.clear(), this.add(i, !1);
1154
1149
  }
1155
1150
  get nextId() {
1156
- return ++oe(this, Ht)._;
1151
+ return ++re(this, Ct)._;
1157
1152
  }
1158
1153
  get length() {
1159
1154
  return t(this, A).length;
@@ -1162,7 +1157,7 @@ const L = class L {
1162
1157
  return this.length;
1163
1158
  }
1164
1159
  };
1165
- T = new WeakMap(), v = new WeakMap(), A = new WeakMap(), J = new WeakMap(), Ht = new WeakMap(), z = new WeakMap(), Ct = new WeakMap(), ht = new WeakMap(), _t = new WeakMap(), Mt = new WeakMap(), Q = new WeakMap(), c(L, "ngData"), // 🎯 ν–‰ μƒνƒœ μ •μ˜ μƒμˆ˜λ₯Ό 클래슀 λ‚΄λΆ€λ‘œ λ‚΄μž¬ν™”
1160
+ T = new WeakMap(), v = new WeakMap(), A = new WeakMap(), Q = new WeakMap(), Ct = new WeakMap(), W = new WeakMap(), _t = new WeakMap(), dt = new WeakMap(), Mt = new WeakMap(), It = new WeakMap(), tt = new WeakMap(), c(L, "ngData"), // 🎯 ν–‰ μƒνƒœ μ •μ˜ μƒμˆ˜λ₯Ό 클래슀 λ‚΄λΆ€λ‘œ λ‚΄μž¬ν™”
1166
1161
  w(L, "ROW_STATE", {
1167
1162
  EMPTY: "EMPTY",
1168
1163
  NORMAL: "NORMAL",
@@ -1170,12 +1165,14 @@ w(L, "ROW_STATE", {
1170
1165
  UPDATE: "UPDATE",
1171
1166
  DELETE: "DELETE"
1172
1167
  });
1173
- let Yt = L;
1174
- const Qt = class Qt {
1168
+ let Vt = L;
1169
+ var X;
1170
+ const te = class te {
1175
1171
  constructor(i) {
1176
- this.owner = i, this.row = new Pt(this), this.data = new Yt(i, this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
1172
+ h(this, X);
1173
+ g(this, X, i), this.row = new Yt(this), this.data = new Vt(t(this, X), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
1177
1174
  var e;
1178
- (e = this.owner.view) != null && e.redraw && this.owner.view.redraw();
1175
+ (e = t(this, X).view) != null && e.redraw && t(this, X).view.redraw();
1179
1176
  }, this.setDataSource = (e) => {
1180
1177
  this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
1181
1178
  }, this.getRowState = (e) => {
@@ -1190,22 +1187,22 @@ const Qt = class Qt {
1190
1187
  }, this.setDataSource([]);
1191
1188
  }
1192
1189
  };
1193
- c(Qt, "ngDataManager");
1194
- let Vt = Qt;
1195
- var U, It;
1196
- const te = class te extends HTMLElement {
1190
+ X = new WeakMap(), c(te, "ngDataManager");
1191
+ let Xt = te;
1192
+ var U, $t;
1193
+ const ee = class ee extends HTMLElement {
1197
1194
  constructor() {
1198
1195
  super();
1199
1196
  //#created = false;
1200
1197
  h(this, U);
1201
- h(this, It);
1202
- this.attachShadow({ mode: "open" }), g(this, U, new Vt(this));
1198
+ h(this, $t);
1199
+ this.attachShadow({ mode: "open" }), g(this, U, new Xt(this));
1203
1200
  }
1204
1201
  connectedCallback() {
1205
- g(this, It, new Bt(this)), tt.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
1202
+ g(this, $t, new Pt(this)), z.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
1206
1203
  }
1207
1204
  disconnectedCallback() {
1208
- tt.log("NineTable disconnected.");
1205
+ z.log("NineTable disconnected.");
1209
1206
  }
1210
1207
  // 🎯 μ™ΈλΆ€μ—μ„œ grid.data.set(...) ν˜•νƒœλ‘œ μ ‘κ·Όν•  수 μžˆλ„λ‘ 데이터 λ§€λ‹ˆμ € μ˜€ν”ˆ
1211
1208
  get data() {
@@ -1220,7 +1217,7 @@ const te = class te extends HTMLElement {
1220
1217
  return t(this, U);
1221
1218
  }
1222
1219
  };
1223
- U = new WeakMap(), It = new WeakMap(), c(te, "NineTable");
1224
- let Xt = te;
1225
- customElements.get("nine-table") || customElements.define("nine-table", Xt);
1220
+ U = new WeakMap(), $t = new WeakMap(), c(ee, "NineTable");
1221
+ let Ut = ee;
1222
+ customElements.get("nine-table") || customElements.define("nine-table", Ut);
1226
1223
  //# sourceMappingURL=nine-table.js.map