@ninebone/table 0.0.243 β†’ 0.0.245

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.
@@ -22,26 +22,26 @@ const qe = class qe extends Pe.constructor {
22
22
  };
23
23
  h(qe, "Trace");
24
24
  let me = qe;
25
- const Y = new me();
26
- var C, O, p, B, D, N, ie, P, se;
25
+ const M = new me();
26
+ var C, B, p, D, N, P, ie, V, se;
27
27
  const ke = class ke extends HTMLElement {
28
28
  constructor() {
29
29
  super();
30
30
  u(this, C);
31
- u(this, O, !1);
31
+ u(this, B, !1);
32
32
  u(this, p);
33
- u(this, B);
34
33
  u(this, D);
35
34
  u(this, N);
35
+ u(this, P);
36
36
  u(this, ie, /* @__PURE__ */ h(() => {
37
37
  if (!e(this, C)) return;
38
38
  const t = e(this, C).querySelector(".ng-container-body");
39
- t && (y(this, N, new ResizeObserver(() => {
39
+ t && (y(this, P, new ResizeObserver(() => {
40
40
  this.refresh();
41
- })), e(this, N).observe(t));
41
+ })), e(this, P).observe(t));
42
42
  }, "#observeResize"));
43
43
  v(this, "refresh", /* @__PURE__ */ h(() => {
44
- if (!e(this, C) || !e(this, p) || e(this, O)) return;
44
+ if (!e(this, C) || !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, C).querySelector(".ng-container-bottom"), a = t.clientWidth, d = s.scrollWidth;
@@ -59,9 +59,9 @@ const ke = class ke extends HTMLElement {
59
59
  let b = 0;
60
60
  g > 0 && (b = parseInt(f / g * (l - c), 10)), b < 0 && (b = 0);
61
61
  const w = l - c;
62
- b > w && (b = w), r.style.left = `${b}px`, Y.log(b), e(this, p).left.disabled = b === 0, e(this, p).right.disabled = b >= w - 1;
62
+ b > w && (b = w), r.style.left = `${b}px`, M.log(b), e(this, p).left.disabled = b === 0, e(this, p).right.disabled = b >= w - 1;
63
63
  }, "refresh"));
64
- u(this, P, /* @__PURE__ */ h((t) => {
64
+ u(this, V, /* @__PURE__ */ h((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;
@@ -76,16 +76,16 @@ const ke = class ke extends HTMLElement {
76
76
  }, "#thumbMoveTo"));
77
77
  u(this, se, /* @__PURE__ */ h(() => {
78
78
  const t = /* @__PURE__ */ h((n) => {
79
- clearInterval(e(this, B)), clearInterval(e(this, D));
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, P).call(this, r + n), y(this, B, setInterval(() => {
82
- clearInterval(e(this, B)), y(this, D, 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, P).call(this, o + n) || clearInterval(e(this, D));
84
+ e(this, V).call(this, o + n) || clearInterval(e(this, N));
85
85
  }, 50));
86
86
  }, 500));
87
87
  }, "delayScroll"), s = /* @__PURE__ */ h(() => {
88
- clearInterval(e(this, B)), clearInterval(e(this, D));
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, P).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, O, !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__ */ h((a) => {
105
- if (!e(this, O)) return;
105
+ if (!e(this, B)) return;
106
106
  const d = e(this, p).track.getBoundingClientRect();
107
- e(this, P).call(this, a.clientX - d.left - this.shiftX);
107
+ e(this, V).call(this, a.clientX - d.left - this.shiftX);
108
108
  }, "onMouseMove"), o = /* @__PURE__ */ h(() => {
109
- y(this, O, !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
  });
@@ -194,19 +194,19 @@ const ke = class ke extends HTMLElement {
194
194
  t();
195
195
  }
196
196
  disconnectedCallback() {
197
- e(this, N) && e(this, N).disconnect();
197
+ e(this, P) && e(this, P).disconnect();
198
198
  }
199
199
  };
200
- C = new WeakMap(), O = new WeakMap(), p = new WeakMap(), B = new WeakMap(), D = new WeakMap(), N = new WeakMap(), ie = new WeakMap(), P = new WeakMap(), se = new WeakMap(), h(ke, "NineTableHScrollBar");
200
+ C = 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(), h(ke, "NineTableHScrollBar");
201
201
  let we = ke;
202
202
  customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", we);
203
- var M, _, A, $, I, H, ne, re, oe, le;
203
+ var $, _, A, W, I, H, ne, re, oe, le;
204
204
  const Le = class Le {
205
205
  constructor(i) {
206
- u(this, M);
206
+ u(this, $);
207
207
  u(this, _, []);
208
208
  u(this, A, null);
209
- u(this, $, null);
209
+ u(this, W, null);
210
210
  u(this, I, 0);
211
211
  u(this, H, 0);
212
212
  v(this, "getRowHeight", /* @__PURE__ */ h(() => e(this, A), "getRowHeight"));
@@ -217,7 +217,7 @@ const Le = class Le {
217
217
  * 🎯 뷰포트 크기 λ³€ν™” μ‹œμ μ— 높이 계산 및 ν•„μš”ν•œ ν–‰ 개수 산정·캐싱을 μ™„κ²°
218
218
  */
219
219
  u(this, re, /* @__PURE__ */ h(() => {
220
- !e(this, M) || !(e(this, M) instanceof HTMLElement) || (y(this, $, new ResizeObserver((i) => {
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"))
@@ -231,19 +231,19 @@ const Le = class Le {
231
231
  const c = Math.max(r - o, 100);
232
232
  if (e(this, I) !== c && (y(this, I, c), e(this, A) !== null)) {
233
233
  const f = Math.ceil(e(this, I) / e(this, A));
234
- y(this, H, f + 20), Y.log(`[RowManager] Resized. Height: ${e(this, I)}px | Target Rows: ${e(this, H)}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
234
+ y(this, H, f + 20), M.log(`[RowManager] Resized. Height: ${e(this, I)}px | Target Rows: ${e(this, H)}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
235
235
  const b = s.querySelector(g);
236
236
  b && b.querySelector("tbody") && e(this, le).call(this, b);
237
237
  });
238
238
  }
239
239
  }
240
240
  }
241
- })), e(this, $).observe(e(this, M)));
241
+ })), e(this, W).observe(e(this, $)));
242
242
  }, "#initResizeObserver"));
243
243
  // 🎯 ν…œν”Œλ¦Ώ μΆ”μΆœ, 높이 μΈ‘μ •, 초기 λ Œλ”λ§μ„ μˆœμ„œμ— 맞게 λ‚΄λΆ€μ—μ„œ 일괄 처리
244
244
  v(this, "initialize", /* @__PURE__ */ h((i) => {
245
- Y.log(i);
246
- const t = e(this, M).querySelector(".ng-container-body"), s = i.querySelector("tbody"), n = Array.from(s.querySelectorAll("tr"));
245
+ M.log(i);
246
+ const t = e(this, $).querySelector(".ng-container-body"), s = i.querySelector("tbody"), n = Array.from(s.querySelectorAll("tr"));
247
247
  y(this, _, n.map((r) => r.cloneNode(!0))), y(this, A, null), e(this, oe).call(this, t);
248
248
  }, "initialize"));
249
249
  u(this, oe, /* @__PURE__ */ h((i) => {
@@ -300,15 +300,15 @@ const Le = class Le {
300
300
  s ? s.before(n) : t.appendChild(n), console.log(`[RowManager] Rendered ${r} sets into DOM.`);
301
301
  }, "#renderRows"));
302
302
  v(this, "destroy", /* @__PURE__ */ h(() => {
303
- e(this, $) && (e(this, $).disconnect(), y(this, $, null));
303
+ e(this, W) && (e(this, W).disconnect(), y(this, W, null));
304
304
  }, "destroy"));
305
- y(this, M, i), e(this, ne).call(this);
305
+ y(this, $, i), e(this, ne).call(this);
306
306
  }
307
307
  get templateLength() {
308
308
  return e(this, _).length || 1;
309
309
  }
310
310
  };
311
- M = new WeakMap(), _ = new WeakMap(), A = new WeakMap(), $ = new WeakMap(), I = new WeakMap(), H = new WeakMap(), ne = new WeakMap(), re = new WeakMap(), oe = new WeakMap(), le = new WeakMap(), h(Le, "RowManager");
311
+ $ = new WeakMap(), _ = new WeakMap(), A = new WeakMap(), W = new WeakMap(), I = new WeakMap(), H = new WeakMap(), ne = new WeakMap(), re = new WeakMap(), oe = new WeakMap(), le = new WeakMap(), h(Le, "RowManager");
312
312
  let xe = Le;
313
313
  var T, F, G, U, ae, ce;
314
314
  const j = class j extends HTMLElement {
@@ -394,7 +394,7 @@ const j = class j extends HTMLElement {
394
394
  f && e(this, T).querySelectorAll(`[data-col="${c}"]`).forEach((g) => {
395
395
  g.setAttribute("fixed", f);
396
396
  });
397
- }), Y.log(e(this, T));
397
+ }), M.log(e(this, T));
398
398
  const o = this.querySelector(".ng-container-left"), a = this.querySelector(".ng-container-body"), d = this.querySelector(".ng-container-right");
399
399
  if (a) {
400
400
  const l = e(this, U).call(this, e(this, T), null);
@@ -440,8 +440,9 @@ const j = class j extends HTMLElement {
440
440
  u(this, ae, /* @__PURE__ */ h(() => {
441
441
  e(this, ce).call(this), new MutationObserver((t) => {
442
442
  const s = /* @__PURE__ */ h(() => {
443
- requestAnimationFrame(() => {
443
+ M.log("111111"), requestAnimationFrame(() => {
444
444
  var f, g, b;
445
+ M.log("22222");
445
446
  const n = this.querySelector(".ng-container-left table"), r = this.querySelector(".ng-container-body table"), o = this.querySelector(".ng-container-right table");
446
447
  if (!r) return;
447
448
  const a = n ? Array.from(n.querySelectorAll("tr")) : [], d = Array.from(r.querySelectorAll("tr")), l = o ? Array.from(o.querySelectorAll("tr")) : [], c = Math.max(a.length, d.length, l.length);
@@ -589,7 +590,7 @@ const j = class j extends HTMLElement {
589
590
  e(this, ae).call(this);
590
591
  }
591
592
  disconnectedCallback() {
592
- this.innerHTML = "", Y.log("NineTableSheet destroyed.");
593
+ this.innerHTML = "", M.log("NineTableSheet destroyed.");
593
594
  }
594
595
  };
595
596
  T = new WeakMap(), F = new WeakMap(), G = new WeakMap(), U = new WeakMap(), ae = new WeakMap(), ce = new WeakMap(), h(j, "NineTableSheet"), v(j, "SCROLLBAR_SIZE", 16);
@@ -779,30 +780,30 @@ const _e = class _e {
779
780
  };
780
781
  R = new WeakMap(), de = new WeakMap(), Q = new WeakMap(), fe = new WeakMap(), h(_e, "LayoutManager");
781
782
  let Se = _e;
782
- var W, V;
783
+ var z, X;
783
784
  const Ie = class Ie {
784
785
  constructor(i) {
785
- u(this, W);
786
- u(this, V, -1);
787
- v(this, "count", /* @__PURE__ */ h(() => e(this, W).rawRecords.length, "count"));
788
- y(this, W, i);
786
+ u(this, z);
787
+ u(this, X, -1);
788
+ v(this, "count", /* @__PURE__ */ h(() => e(this, z).rawRecords.length, "count"));
789
+ y(this, z, i);
789
790
  }
790
791
  get at() {
791
- return e(this, V);
792
+ return e(this, X);
792
793
  }
793
794
  set at(i) {
794
795
  var s, n;
795
- y(this, V, parseInt(i, 10));
796
- const t = ((n = (s = e(this, W).owner).querySelector) == null ? void 0 : n.call(s, ".ng-container-body")) || e(this, W).owner.body;
797
- t && !t.querySelector(`tbody.bindable tr[data-row="${e(this, V)}"]`) && setTimeout(() => {
796
+ y(this, X, parseInt(i, 10));
797
+ const t = ((n = (s = e(this, z).owner).querySelector) == null ? void 0 : n.call(s, ".ng-container-body")) || e(this, z).owner.body;
798
+ t && !t.querySelector(`tbody.bindable tr[data-row="${e(this, X)}"]`) && setTimeout(() => {
798
799
  var r, o;
799
- (o = (r = e(this, W).owner).scrollTo_V1) == null || o.call(r, e(this, V));
800
+ (o = (r = e(this, z).owner).scrollTo_V1) == null || o.call(r, e(this, X));
800
801
  });
801
802
  }
802
803
  };
803
- W = new WeakMap(), V = new WeakMap(), h(Ie, "ngRow");
804
+ z = new WeakMap(), X = new WeakMap(), h(Ie, "ngRow");
804
805
  let Ee = Ie;
805
- var q, x, k, K, ue, z, ge, ee, be, ye, Z;
806
+ var q, x, k, K, ue, O, ge, ee, be, ye, Z;
806
807
  const L = class L {
807
808
  constructor(i, t) {
808
809
  u(this, q);
@@ -810,15 +811,15 @@ const L = class L {
810
811
  u(this, k, []);
811
812
  u(this, K, []);
812
813
  u(this, ue, 0);
813
- u(this, z, []);
814
+ u(this, O, []);
814
815
  u(this, ge, /* @__PURE__ */ h(() => {
815
- y(this, z, []);
816
+ y(this, O, []);
816
817
  const i = e(this, q).template || [];
817
818
  Array.from(i).forEach((t) => {
818
819
  var s;
819
- e(this, z).push(((s = t.getBoundingClientRect) == null ? void 0 : s.call(t).height) || 24);
820
+ e(this, O).push(((s = t.getBoundingClientRect) == null ? void 0 : s.call(t).height) || 24);
820
821
  }), (e(this, x).rawRecords || []).forEach((t) => {
821
- t.__ng || (t.__ng = e(this, ee).call(this)), t.__ng.height = e(this, z).slice();
822
+ t.__ng || (t.__ng = e(this, ee).call(this)), t.__ng.height = e(this, O).slice();
822
823
  });
823
824
  }, "#initialize"));
824
825
  v(this, "set", /* @__PURE__ */ h((i) => {
@@ -828,10 +829,10 @@ const L = class L {
828
829
  rowState: L.ROW_STATE.EMPTY,
829
830
  deleted: !1,
830
831
  filtered: !1,
831
- height: e(this, z).slice(),
832
+ height: e(this, O).slice(),
832
833
  o: {},
833
834
  c: {},
834
- _: [0, 0, 0, 0, L.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, z).slice(), -1, {}, {}]
835
+ _: [0, 0, 0, 0, L.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, O).slice(), -1, {}, {}]
835
836
  }), "#getDefaultMeta"));
836
837
  v(this, "reset", /* @__PURE__ */ h(() => {
837
838
  y(this, k, []), y(this, K, []);
@@ -938,7 +939,7 @@ const L = class L {
938
939
  return this.length;
939
940
  }
940
941
  };
941
- q = new WeakMap(), x = new WeakMap(), k = new WeakMap(), K = new WeakMap(), ue = new WeakMap(), z = new WeakMap(), ge = new WeakMap(), ee = new WeakMap(), be = new WeakMap(), ye = new WeakMap(), Z = new WeakMap(), h(L, "ngData"), // 🎯 ν–‰ μƒνƒœ μ •μ˜ μƒμˆ˜λ₯Ό 클래슀 λ‚΄λΆ€λ‘œ λ‚΄μž¬ν™”
942
+ q = new WeakMap(), x = new WeakMap(), k = 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(), h(L, "ngData"), // 🎯 ν–‰ μƒνƒœ μ •μ˜ μƒμˆ˜λ₯Ό 클래슀 λ‚΄λΆ€λ‘œ λ‚΄μž¬ν™”
942
943
  v(L, "ROW_STATE", {
943
944
  EMPTY: "EMPTY",
944
945
  NORMAL: "NORMAL",
@@ -968,35 +969,35 @@ const He = class He {
968
969
  };
969
970
  h(He, "ngDataManager");
970
971
  let Ae = He;
971
- var X, pe;
972
+ var Y, pe;
972
973
  const Me = class Me extends HTMLElement {
973
974
  constructor() {
974
975
  super();
975
976
  //#created = false;
976
- u(this, X);
977
+ u(this, Y);
977
978
  u(this, pe);
978
- this.attachShadow({ mode: "open" }), y(this, X, new Ae(this));
979
+ this.attachShadow({ mode: "open" }), y(this, Y, new Ae(this));
979
980
  }
980
981
  connectedCallback() {
981
- y(this, pe, new Se(this)), Y.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
982
+ y(this, pe, new Se(this)), M.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
982
983
  }
983
984
  disconnectedCallback() {
984
- Y.log("NineTable disconnected.");
985
+ M.log("NineTable disconnected.");
985
986
  }
986
987
  // 🎯 μ™ΈλΆ€μ—μ„œ grid.data.set(...) ν˜•νƒœλ‘œ μ ‘κ·Όν•  수 μžˆλ„λ‘ 데이터 λ§€λ‹ˆμ € μ˜€ν”ˆ
987
988
  get data() {
988
- return e(this, X).data;
989
+ return e(this, Y).data;
989
990
  }
990
991
  // 🎯 ν–‰(row) κ΄€λ ¨ μ œμ–΄ μ ‘κ·Όμž μ˜€ν”ˆ
991
992
  get row() {
992
- return e(this, X).row;
993
+ return e(this, Y).row;
993
994
  }
994
995
  // 🎯 전체 데이터 λ§€λ‹ˆμ € μ ‘κ·Ό ν•„μš”ν•  경우
995
996
  get dataManager() {
996
- return e(this, X);
997
+ return e(this, Y);
997
998
  }
998
999
  };
999
- X = new WeakMap(), pe = new WeakMap(), h(Me, "NineTable");
1000
+ Y = new WeakMap(), pe = new WeakMap(), h(Me, "NineTable");
1000
1001
  let Te = Me;
1001
1002
  customElements.get("nine-table") || customElements.define("nine-table", Te);
1002
1003
  //# sourceMappingURL=nine-table.js.map