@ninebone/table 0.0.234 β†’ 0.0.236

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.
@@ -23,25 +23,25 @@ const qe = class qe extends De.constructor {
23
23
  a(qe, "Trace");
24
24
  let me = qe;
25
25
  const G = new me();
26
- var L, z, p, O, B, D, se, N, ne;
26
+ var L, B, p, D, N, P, ie, V, se;
27
27
  const ke = class ke extends HTMLElement {
28
28
  constructor() {
29
29
  super();
30
30
  d(this, L);
31
- d(this, z, !1);
31
+ d(this, B, !1);
32
32
  d(this, p);
33
- d(this, O);
34
- d(this, B);
35
33
  d(this, D);
36
- d(this, se, /* @__PURE__ */ a(() => {
34
+ d(this, N);
35
+ d(this, P);
36
+ d(this, ie, /* @__PURE__ */ a(() => {
37
37
  if (!e(this, L)) return;
38
38
  const t = e(this, L).querySelector(".ng-container-body");
39
- t && (y(this, D, new ResizeObserver(() => {
39
+ t && (y(this, P, new ResizeObserver(() => {
40
40
  this.refresh();
41
- })), e(this, D).observe(t));
41
+ })), e(this, P).observe(t));
42
42
  }, "#observeResize"));
43
43
  x(this, "refresh", /* @__PURE__ */ a(() => {
44
- if (!e(this, L) || !e(this, p) || e(this, z)) return;
44
+ if (!e(this, L) || !e(this, p) || e(this, B)) return;
45
45
  const t = e(this, p).container, s = t.querySelector("table");
46
46
  if (!s) return;
47
47
  const n = e(this, p).track, r = e(this, p).thumb, o = e(this, L).querySelector(".ng-container-bottom"), c = t.clientWidth, f = s.scrollWidth;
@@ -61,7 +61,7 @@ const ke = class ke extends HTMLElement {
61
61
  const m = l - h;
62
62
  b > m && (b = m), r.style.left = `${b}px`, G.log(b), e(this, p).left.disabled = b === 0, e(this, p).right.disabled = b >= m - 1;
63
63
  }, "refresh"));
64
- d(this, N, /* @__PURE__ */ a((t) => {
64
+ d(this, V, /* @__PURE__ */ a((t) => {
65
65
  if (!e(this, p)) return !1;
66
66
  const s = e(this, p).container, n = s.querySelector("table");
67
67
  if (!n) return !1;
@@ -74,18 +74,18 @@ const ke = class ke extends HTMLElement {
74
74
  let u = f > 0 ? -c * (h - l) / f : 0;
75
75
  return -u > h - l && (u = -(h - l)), -u + 5 > h - l && (u = -(h - l)), l >= h && (u = 0), n.style.transform = `translateX(${u}px)`, c > 0 && c < f - 1;
76
76
  }, "#thumbMoveTo"));
77
- d(this, ne, /* @__PURE__ */ a(() => {
77
+ d(this, se, /* @__PURE__ */ a(() => {
78
78
  const t = /* @__PURE__ */ a((n) => {
79
- clearInterval(e(this, O)), clearInterval(e(this, B));
79
+ clearInterval(e(this, D)), clearInterval(e(this, N));
80
80
  const r = parseInt(e(this, p).thumb.style.left || 0, 10);
81
- e(this, N).call(this, r + n), y(this, O, setInterval(() => {
82
- clearInterval(e(this, O)), y(this, B, setInterval(() => {
81
+ e(this, V).call(this, r + n), y(this, D, setInterval(() => {
82
+ clearInterval(e(this, D)), y(this, N, setInterval(() => {
83
83
  const o = parseInt(e(this, p).thumb.style.left || 0, 10);
84
- e(this, N).call(this, o + n) || clearInterval(e(this, B));
84
+ e(this, V).call(this, o + n) || clearInterval(e(this, N));
85
85
  }, 50));
86
86
  }, 500));
87
87
  }, "delayScroll"), s = /* @__PURE__ */ a(() => {
88
- clearInterval(e(this, O)), clearInterval(e(this, B));
88
+ clearInterval(e(this, D)), clearInterval(e(this, N));
89
89
  }, "clearTimer");
90
90
  ["mouseup", "mouseleave", "touchend"].forEach((n) => {
91
91
  e(this, p).left.addEventListener(n, s), e(this, p).right.addEventListener(n, s), e(this, p).track.addEventListener(n, s);
@@ -97,16 +97,16 @@ const ke = class ke extends HTMLElement {
97
97
  if (n.button !== 0) return;
98
98
  n.preventDefault();
99
99
  const r = e(this, p).track.getBoundingClientRect(), o = e(this, p).thumb.clientWidth;
100
- e(this, N).call(this, n.clientX - r.left - o / 2);
100
+ e(this, V).call(this, n.clientX - r.left - o / 2);
101
101
  }), e(this, p).thumb.addEventListener("mousedown", (n) => {
102
102
  if (n.button !== 0) return;
103
- n.stopPropagation(), n.preventDefault(), y(this, z, !0), this.shiftX = n.clientX - e(this, p).thumb.getBoundingClientRect().left;
103
+ n.stopPropagation(), n.preventDefault(), y(this, B, !0), this.shiftX = n.clientX - e(this, p).thumb.getBoundingClientRect().left;
104
104
  const r = /* @__PURE__ */ a((c) => {
105
- if (!e(this, z)) return;
105
+ if (!e(this, B)) return;
106
106
  const f = e(this, p).track.getBoundingClientRect();
107
- e(this, N).call(this, c.clientX - f.left - this.shiftX);
107
+ e(this, V).call(this, c.clientX - f.left - this.shiftX);
108
108
  }, "onMouseMove"), o = /* @__PURE__ */ a(() => {
109
- y(this, z, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
109
+ y(this, B, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
110
110
  }, "onMouseUp");
111
111
  document.addEventListener("mousemove", r), document.addEventListener("mouseup", o);
112
112
  });
@@ -189,35 +189,35 @@ const ke = class ke extends HTMLElement {
189
189
  thumb: this.querySelector(".ng-scroll-thumb"),
190
190
  left: this.querySelector(".ng-scroll-left"),
191
191
  right: this.querySelector(".ng-scroll-right")
192
- }), e(this, ne).call(this), e(this, se).call(this), this.refresh();
192
+ }), e(this, se).call(this), e(this, ie).call(this), this.refresh();
193
193
  }, "initWhenReady");
194
194
  t();
195
195
  }
196
196
  disconnectedCallback() {
197
- e(this, D) && e(this, D).disconnect();
197
+ e(this, P) && e(this, P).disconnect();
198
198
  }
199
199
  };
200
- L = new WeakMap(), z = new WeakMap(), p = new WeakMap(), O = new WeakMap(), B = new WeakMap(), D = new WeakMap(), se = new WeakMap(), N = new WeakMap(), ne = new WeakMap(), a(ke, "NineTableHScrollBar");
200
+ L = new WeakMap(), B = new WeakMap(), p = new WeakMap(), D = new WeakMap(), N = new WeakMap(), P = new WeakMap(), ie = new WeakMap(), V = new WeakMap(), se = new WeakMap(), a(ke, "NineTableHScrollBar");
201
201
  let we = ke;
202
202
  customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", we);
203
- var P, _, E, V, H, M, re, oe, le, J;
203
+ var $, _, E, W, H, M, ne, re, oe, le;
204
204
  const Le = class Le {
205
205
  constructor(i) {
206
- d(this, P);
206
+ d(this, $);
207
207
  d(this, _, []);
208
208
  d(this, E, null);
209
- d(this, V, null);
209
+ d(this, W, null);
210
210
  d(this, H, 0);
211
211
  d(this, M, 0);
212
212
  x(this, "getRowHeight", /* @__PURE__ */ a(() => e(this, E), "getRowHeight"));
213
- d(this, re, /* @__PURE__ */ a(() => {
214
- e(this, oe).call(this);
213
+ d(this, ne, /* @__PURE__ */ a(() => {
214
+ e(this, re).call(this);
215
215
  }, "#init"));
216
216
  /**
217
217
  * 🎯 뷰포트 크기 λ³€ν™” μ‹œμ μ— 높이 계산 및 ν•„μš”ν•œ ν–‰ 개수 산정·캐싱을 μ™„κ²°
218
218
  */
219
- d(this, oe, /* @__PURE__ */ a(() => {
220
- !e(this, P) || !(e(this, P) instanceof HTMLElement) || y(this, V, new ResizeObserver((i) => {
219
+ d(this, re, /* @__PURE__ */ a(() => {
220
+ !e(this, $) || !(e(this, $) instanceof HTMLElement) || (y(this, W, new ResizeObserver((i) => {
221
221
  for (const t of i) {
222
222
  const s = t.target;
223
223
  if (!s.classList.contains("active"))
@@ -233,19 +233,19 @@ const Le = class Le {
233
233
  const u = Math.ceil(e(this, H) / e(this, E));
234
234
  y(this, M, u + 20), G.log(`[RowManager] Resized. Height: ${e(this, H)}px | Target Rows: ${e(this, M)}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
235
235
  const b = s.querySelector(g);
236
- b && b.querySelector("tbody") && e(this, J).call(this, b);
236
+ b && b.querySelector("tbody") && e(this, le).call(this, b);
237
237
  });
238
238
  }
239
239
  }
240
240
  }
241
- }));
241
+ })), e(this, W).observe(e(this, $)));
242
242
  }, "#initResizeObserver"));
243
243
  // 🎯 ν…œν”Œλ¦Ώ μΆ”μΆœ, 높이 μΈ‘μ •, 초기 λ Œλ”λ§μ„ μˆœμ„œμ— 맞게 λ‚΄λΆ€μ—μ„œ 일괄 처리
244
244
  x(this, "initialize", /* @__PURE__ */ a((i) => {
245
- const t = e(this, P).querySelector(".ng-container-body"), s = i.querySelector("tbody"), n = Array.from(s.querySelectorAll("tr"));
246
- y(this, _, n.map((r) => r.cloneNode(!0))), y(this, E, null), e(this, le).call(this, t), e(this, J).call(this, t);
245
+ const t = e(this, $).querySelector(".ng-container-body"), s = i.querySelector("tbody"), n = Array.from(s.querySelectorAll("tr"));
246
+ y(this, _, n.map((r) => r.cloneNode(!0))), y(this, E, null), e(this, oe).call(this, t);
247
247
  }, "initialize"));
248
- d(this, le, /* @__PURE__ */ a((i) => {
248
+ d(this, oe, /* @__PURE__ */ a((i) => {
249
249
  if (e(this, E) !== null && e(this, E) > 0)
250
250
  return e(this, E);
251
251
  if (e(this, _).length === 0)
@@ -285,7 +285,7 @@ const Le = class Le {
285
285
  /**
286
286
  * 🎯 μΊμ‹œλœ ν–‰ 개수λ₯Ό κ³§λ°”λ‘œ κ°€μ Έμ™€μ„œ TR λΌˆλŒ€ μ£Όμž… (쀑볡 계산 제거)
287
287
  */
288
- d(this, J, /* @__PURE__ */ a((i) => {
288
+ d(this, le, /* @__PURE__ */ a((i) => {
289
289
  if (e(this, _).length === 0) return;
290
290
  const t = i.querySelector("tbody.bindable") || i.querySelector("tbody");
291
291
  if (!t) return;
@@ -298,15 +298,15 @@ const Le = class Le {
298
298
  s ? s.before(n) : t.appendChild(n), console.log(`[RowManager] Rendered ${r} sets into DOM.`);
299
299
  }, "#renderRows"));
300
300
  x(this, "destroy", /* @__PURE__ */ a(() => {
301
- e(this, V) && (e(this, V).disconnect(), y(this, V, null));
301
+ e(this, W) && (e(this, W).disconnect(), y(this, W, null));
302
302
  }, "destroy"));
303
- y(this, P, i), e(this, re).call(this);
303
+ y(this, $, i), e(this, ne).call(this);
304
304
  }
305
305
  get templateLength() {
306
306
  return e(this, _).length || 1;
307
307
  }
308
308
  };
309
- P = new WeakMap(), _ = new WeakMap(), E = new WeakMap(), V = new WeakMap(), H = new WeakMap(), M = new WeakMap(), re = new WeakMap(), oe = new WeakMap(), le = new WeakMap(), J = new WeakMap(), a(Le, "RowManager");
309
+ $ = new WeakMap(), _ = new WeakMap(), E = new WeakMap(), W = new WeakMap(), H = new WeakMap(), M = new WeakMap(), ne = new WeakMap(), re = new WeakMap(), oe = new WeakMap(), le = new WeakMap(), a(Le, "RowManager");
310
310
  let ve = Le;
311
311
  var I, U, ae, ce;
312
312
  const j = class j extends HTMLElement {
@@ -550,9 +550,9 @@ const j = class j extends HTMLElement {
550
550
  }
551
551
  };
552
552
  I = new WeakMap(), U = new WeakMap(), ae = new WeakMap(), ce = new WeakMap(), a(j, "NineTableSheet"), x(j, "SCROLLBAR_SIZE", 16);
553
- let ie = j;
554
- customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", ie);
555
- var he, Q;
553
+ let te = j;
554
+ customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", te);
555
+ var he, J;
556
556
  const Ce = class Ce extends HTMLElement {
557
557
  constructor() {
558
558
  super();
@@ -561,10 +561,10 @@ const Ce = class Ce extends HTMLElement {
561
561
  (t = this.querySelector(".nine-tab-bar")) == null || t.addEventListener("click", (s) => {
562
562
  var o;
563
563
  const n = s.ctrlKey || s.metaKey || s.shiftKey, r = parseInt((o = s.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
564
- e(this, Q).call(this, r, n);
565
- }), e(this, Q).call(this, 0, !1);
564
+ e(this, J).call(this, r, n);
565
+ }), e(this, J).call(this, 0, !1);
566
566
  }, "#init"));
567
- d(this, Q, /* @__PURE__ */ a((t, s = !1) => {
567
+ d(this, J, /* @__PURE__ */ a((t, s = !1) => {
568
568
  const n = /* @__PURE__ */ a(() => {
569
569
  const h = Array.from(this.querySelectorAll("nine-table-sheet"));
570
570
  Array.from(this.querySelectorAll("nine-splitter")).forEach((b) => b.style.setProperty("display", "none"));
@@ -600,24 +600,24 @@ const Ce = class Ce extends HTMLElement {
600
600
  e(this, he).call(this);
601
601
  }
602
602
  };
603
- he = new WeakMap(), Q = new WeakMap(), a(Ce, "NineTableSheets");
603
+ he = new WeakMap(), J = new WeakMap(), a(Ce, "NineTableSheets");
604
604
  let xe = Ce;
605
605
  customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", xe);
606
- var S, de, ee, fe;
606
+ var S, de, Q, fe;
607
607
  const _e = class _e {
608
608
  constructor(i) {
609
609
  d(this, S);
610
610
  d(this, de, /* @__PURE__ */ a(() => {
611
611
  e(this, fe).call(this), new ResizeObserver((i) => {
612
612
  for (let t of i)
613
- e(this, S).getAttribute("auto-height") === "true" && e(this, ee).call(this);
613
+ e(this, S).getAttribute("auto-height") === "true" && e(this, Q).call(this);
614
614
  }).observe(e(this, S));
615
615
  }, "#init"));
616
- d(this, ee, /* @__PURE__ */ a(() => {
616
+ d(this, Q, /* @__PURE__ */ a(() => {
617
617
  var f, l;
618
618
  const i = Array.from(e(this, S).shadowRoot.querySelectorAll("nine-table-sheet.active"));
619
619
  if (i.length === 0) return;
620
- const t = parseInt(e(this, S).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((h) => h.getRowHeight())), n = (f = e(this, S).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : f.getBoundingClientRect().height, r = (l = e(this, S).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = ie.SCROLLBAR_SIZE, c = t * s + n + r + o;
620
+ const t = parseInt(e(this, S).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((h) => h.getRowHeight())), n = (f = e(this, S).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : f.getBoundingClientRect().height, r = (l = e(this, S).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = te.SCROLLBAR_SIZE, c = t * s + n + r + o;
621
621
  e(this, S).style.height = `${c}px`;
622
622
  }, "#applyAutoHeight"));
623
623
  d(this, fe, /* @__PURE__ */ a(() => {
@@ -727,22 +727,22 @@ const _e = class _e {
727
727
  const c = e(this, S).shadowRoot.querySelectorAll("nine-table-sheet");
728
728
  c == null || c.forEach((f, l) => {
729
729
  t[l] && setTimeout(() => {
730
- f.generate(t[l]), s && e(this, ee).call(this);
730
+ f.generate(t[l]), s && e(this, Q).call(this);
731
731
  });
732
732
  });
733
733
  }, "#render"));
734
734
  y(this, S, i), e(this, de).call(this);
735
735
  }
736
736
  };
737
- S = new WeakMap(), de = new WeakMap(), ee = new WeakMap(), fe = new WeakMap(), a(_e, "LayoutManager");
737
+ S = new WeakMap(), de = new WeakMap(), Q = new WeakMap(), fe = new WeakMap(), a(_e, "LayoutManager");
738
738
  let Se = _e;
739
- var $, X;
739
+ var z, X;
740
740
  const He = class He {
741
741
  constructor(i) {
742
- d(this, $);
742
+ d(this, z);
743
743
  d(this, X, -1);
744
- x(this, "count", /* @__PURE__ */ a(() => e(this, $).rawRecords.length, "count"));
745
- y(this, $, i);
744
+ x(this, "count", /* @__PURE__ */ a(() => e(this, z).rawRecords.length, "count"));
745
+ y(this, z, i);
746
746
  }
747
747
  get at() {
748
748
  return e(this, X);
@@ -750,16 +750,16 @@ const He = class He {
750
750
  set at(i) {
751
751
  var s, n;
752
752
  y(this, X, parseInt(i, 10));
753
- const t = ((n = (s = e(this, $).owner).querySelector) == null ? void 0 : n.call(s, ".ng-container-body")) || e(this, $).owner.body;
753
+ const t = ((n = (s = e(this, z).owner).querySelector) == null ? void 0 : n.call(s, ".ng-container-body")) || e(this, z).owner.body;
754
754
  t && !t.querySelector(`tbody.bindable tr[data-row="${e(this, X)}"]`) && setTimeout(() => {
755
755
  var r, o;
756
- (o = (r = e(this, $).owner).scrollTo_V1) == null || o.call(r, e(this, X));
756
+ (o = (r = e(this, z).owner).scrollTo_V1) == null || o.call(r, e(this, X));
757
757
  });
758
758
  }
759
759
  };
760
- $ = new WeakMap(), X = new WeakMap(), a(He, "ngRow");
760
+ z = new WeakMap(), X = new WeakMap(), a(He, "ngRow");
761
761
  let Re = He;
762
- var A, v, q, K, ue, W, ge, te, be, ye, Z;
762
+ var A, v, q, K, ue, O, ge, ee, be, ye, Z;
763
763
  const k = class k {
764
764
  constructor(i, t) {
765
765
  d(this, A);
@@ -767,28 +767,28 @@ const k = class k {
767
767
  d(this, q, []);
768
768
  d(this, K, []);
769
769
  d(this, ue, 0);
770
- d(this, W, []);
770
+ d(this, O, []);
771
771
  d(this, ge, /* @__PURE__ */ a(() => {
772
- y(this, W, []);
772
+ y(this, O, []);
773
773
  const i = e(this, A).template || [];
774
774
  Array.from(i).forEach((t) => {
775
775
  var s;
776
- e(this, W).push(((s = t.getBoundingClientRect) == null ? void 0 : s.call(t).height) || 24);
776
+ e(this, O).push(((s = t.getBoundingClientRect) == null ? void 0 : s.call(t).height) || 24);
777
777
  }), (e(this, v).rawRecords || []).forEach((t) => {
778
- t.__ng || (t.__ng = e(this, te).call(this)), t.__ng.height = e(this, W).slice();
778
+ t.__ng || (t.__ng = e(this, ee).call(this)), t.__ng.height = e(this, O).slice();
779
779
  });
780
780
  }, "#initialize"));
781
781
  x(this, "set", /* @__PURE__ */ a((i) => {
782
782
  this.clear(), this.add(i, !1);
783
783
  }, "set"));
784
- d(this, te, /* @__PURE__ */ a(() => ({
784
+ d(this, ee, /* @__PURE__ */ a(() => ({
785
785
  rowState: k.ROW_STATE.EMPTY,
786
786
  deleted: !1,
787
787
  filtered: !1,
788
- height: e(this, W).slice(),
788
+ height: e(this, O).slice(),
789
789
  o: {},
790
790
  c: {},
791
- _: [0, 0, 0, 0, k.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, W).slice(), -1, {}, {}]
791
+ _: [0, 0, 0, 0, k.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, O).slice(), -1, {}, {}]
792
792
  }), "#getDefaultMeta"));
793
793
  x(this, "reset", /* @__PURE__ */ a(() => {
794
794
  y(this, q, []), y(this, K, []);
@@ -809,7 +809,7 @@ const k = class k {
809
809
  }), s;
810
810
  }, "#json2Array"));
811
811
  d(this, ye, /* @__PURE__ */ a((i) => (Array.isArray(i) || (i = [i]), i.forEach((t) => {
812
- t.__ng = e(this, te).call(this), t.__ng.rowid = this.nextId, t.__ng.rowState = k.ROW_STATE.INSERT, t.__ng._[0] = t.__ng.rowid;
812
+ t.__ng = e(this, ee).call(this), t.__ng.rowid = this.nextId, t.__ng.rowState = k.ROW_STATE.INSERT, t.__ng._[0] = t.__ng.rowid;
813
813
  }), i), "#defaultInsert"));
814
814
  x(this, "add", /* @__PURE__ */ a((i, t = !0) => {
815
815
  var r;
@@ -895,7 +895,7 @@ const k = class k {
895
895
  return this.length;
896
896
  }
897
897
  };
898
- A = new WeakMap(), v = new WeakMap(), q = new WeakMap(), K = new WeakMap(), ue = new WeakMap(), W = new WeakMap(), ge = new WeakMap(), te = new WeakMap(), be = new WeakMap(), ye = new WeakMap(), Z = new WeakMap(), a(k, "ngData"), // 🎯 ν–‰ μƒνƒœ μ •μ˜ μƒμˆ˜λ₯Ό 클래슀 λ‚΄λΆ€λ‘œ λ‚΄μž¬ν™”
898
+ A = new WeakMap(), v = new WeakMap(), q = new WeakMap(), K = new WeakMap(), ue = new WeakMap(), O = new WeakMap(), ge = new WeakMap(), ee = new WeakMap(), be = new WeakMap(), ye = new WeakMap(), Z = new WeakMap(), a(k, "ngData"), // 🎯 ν–‰ μƒνƒœ μ •μ˜ μƒμˆ˜λ₯Ό 클래슀 λ‚΄λΆ€λ‘œ λ‚΄μž¬ν™”
899
899
  x(k, "ROW_STATE", {
900
900
  EMPTY: "EMPTY",
901
901
  NORMAL: "NORMAL",