@ninebone/table 0.0.244 β†’ 0.0.246

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,7 +22,7 @@ const qe = class qe extends Pe.constructor {
22
22
  };
23
23
  h(qe, "Trace");
24
24
  let me = qe;
25
- const M = new me();
25
+ const O = new me();
26
26
  var C, B, p, D, N, P, ie, V, se;
27
27
  const ke = class ke extends HTMLElement {
28
28
  constructor() {
@@ -59,7 +59,7 @@ 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`, M.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`, O.log(b), e(this, p).left.disabled = b === 0, e(this, p).right.disabled = b >= w - 1;
63
63
  }, "refresh"));
64
64
  u(this, V, /* @__PURE__ */ h((t) => {
65
65
  if (!e(this, p)) return !1;
@@ -200,13 +200,13 @@ const ke = class ke extends HTMLElement {
200
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 $, _, A, W, I, H, ne, re, oe, le;
203
+ var M, _, A, $, I, H, ne, re, oe, le;
204
204
  const Le = class Le {
205
205
  constructor(i) {
206
- u(this, $);
206
+ u(this, M);
207
207
  u(this, _, []);
208
208
  u(this, A, null);
209
- u(this, W, null);
209
+ u(this, $, 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, $) || !(e(this, $) instanceof HTMLElement) || (y(this, W, new ResizeObserver((i) => {
220
+ !e(this, M) || !(e(this, M) instanceof HTMLElement) || (y(this, $, 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), 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) => {
234
+ y(this, H, f + 20), O.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, W).observe(e(this, $)));
241
+ })), e(this, $).observe(e(this, M)));
242
242
  }, "#initResizeObserver"));
243
243
  // 🎯 ν…œν”Œλ¦Ώ μΆ”μΆœ, 높이 μΈ‘μ •, 초기 λ Œλ”λ§μ„ μˆœμ„œμ— 맞게 λ‚΄λΆ€μ—μ„œ 일괄 처리
244
244
  v(this, "initialize", /* @__PURE__ */ h((i) => {
245
- M.log(i);
246
- const t = e(this, $).querySelector(".ng-container-body"), s = i.querySelector("tbody"), n = Array.from(s.querySelectorAll("tr"));
245
+ O.log(i);
246
+ const t = e(this, M).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,22 +300,22 @@ 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, W) && (e(this, W).disconnect(), y(this, W, null));
303
+ e(this, $) && (e(this, $).disconnect(), y(this, $, null));
304
304
  }, "destroy"));
305
- y(this, $, i), e(this, ne).call(this);
305
+ y(this, M, i), e(this, ne).call(this);
306
306
  }
307
307
  get templateLength() {
308
308
  return e(this, _).length || 1;
309
309
  }
310
310
  };
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");
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");
312
312
  let xe = Le;
313
- var T, F, G, U, ae, ce;
313
+ var T, U, G, F, ae, ce;
314
314
  const j = class j extends HTMLElement {
315
315
  constructor() {
316
316
  super();
317
317
  u(this, T, null);
318
- u(this, F);
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
  * 🎯 원본 ν…Œμ΄λΈ”μ„ λΆ„μ„ν•˜μ—¬ κ³ μ • 컬럼 μ˜μ—­λ³„(left, body, right)둜 μ™„λ²½ν•˜κ²Œ μͺΌκ°œμ§„ ν…Œμ΄λΈ” 생성
357
357
  */
358
- u(this, U, /* @__PURE__ */ h((t, s) => {
358
+ u(this, F, /* @__PURE__ */ h((t, s) => {
359
359
  const n = t.cloneNode(!0), r = n.querySelector("colgroup");
360
360
  if (!r) return n;
361
361
  const o = Array.from(r.querySelectorAll("col")), a = [];
@@ -394,14 +394,14 @@ 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
- }), M.log(e(this, T));
397
+ }), O.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
- const l = e(this, U).call(this, e(this, T), null);
401
- a.innerHTML = "", a.appendChild(l), e(this, F).initialize(e(this, T));
400
+ const l = e(this, F).call(this, e(this, T), null);
401
+ a.innerHTML = "", a.appendChild(l), e(this, U).initialize(e(this, T));
402
402
  }
403
403
  if (o) {
404
- const l = e(this, U).call(this, e(this, T), "left");
404
+ const l = e(this, F).call(this, e(this, T), "left");
405
405
  let c = 0;
406
406
  l.querySelectorAll("col").forEach((g) => {
407
407
  const b = parseInt(g.getAttribute("width"), 10);
@@ -411,7 +411,7 @@ const j = class j extends HTMLElement {
411
411
  o.style.flex = `0 0 ${f}px`, o.style.width = `${f}px`;
412
412
  }
413
413
  if (d) {
414
- const l = e(this, U).call(this, e(this, T), "right");
414
+ const l = e(this, F).call(this, e(this, T), "right");
415
415
  let c = 0;
416
416
  l.querySelectorAll("col").forEach((g) => {
417
417
  const b = parseInt(g.getAttribute("width"), 10);
@@ -428,7 +428,7 @@ const j = class j extends HTMLElement {
428
428
  (l = this.querySelector("nine-table-hscrollbar")) == null || l.refresh();
429
429
  }, 0);
430
430
  }, "generate"));
431
- v(this, "getRowHeight", /* @__PURE__ */ h(() => e(this, F).getRowHeight(), "getRowHeight"));
431
+ v(this, "getRowHeight", /* @__PURE__ */ h(() => e(this, U).getRowHeight(), "getRowHeight"));
432
432
  v(this, "scrollToX", /* @__PURE__ */ h((t) => {
433
433
  const s = this.querySelector(".ng-container-body");
434
434
  s && (s.scrollLeft = t);
@@ -438,27 +438,25 @@ const j = class j extends HTMLElement {
438
438
  s && (s.scrollTop = t);
439
439
  }, "scrollToY"));
440
440
  u(this, ae, /* @__PURE__ */ h(() => {
441
- e(this, ce).call(this), new MutationObserver((t) => {
441
+ new MutationObserver((t) => {
442
442
  const s = /* @__PURE__ */ h(() => {
443
- M.log("111111"), requestAnimationFrame(() => {
444
- var f, g, b;
445
- M.log("22222");
446
- const n = this.querySelector(".ng-container-left table"), r = this.querySelector(".ng-container-body table"), o = this.querySelector(".ng-container-right table");
447
- if (!r) return;
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);
449
- for (let w = 0; w < c; w++) {
450
- const S = [
451
- ((f = a[w]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
452
- ((g = d[w]) == null ? void 0 : g.getBoundingClientRect().height) || 0,
453
- ((b = l[w]) == null ? void 0 : b.getBoundingClientRect().height) || 0
454
- ], E = Math.max(...S);
455
- E > 0 && (a[w] && (a[w].style.height = `${E}px`), d[w] && (d[w].style.height = `${E}px`), l[w] && (l[w].style.height = `${E}px`));
456
- }
457
- });
443
+ var f, g, b;
444
+ O.log(":::::::::::::::");
445
+ const n = this.querySelector(".ng-container-left table"), r = this.querySelector(".ng-container-body table"), o = this.querySelector(".ng-container-right table");
446
+ if (!r) return;
447
+ 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);
448
+ for (let w = 0; w < c; w++) {
449
+ const S = [
450
+ ((f = a[w]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
451
+ ((g = d[w]) == null ? void 0 : g.getBoundingClientRect().height) || 0,
452
+ ((b = l[w]) == null ? void 0 : b.getBoundingClientRect().height) || 0
453
+ ], E = Math.max(...S);
454
+ E > 0 && (a[w] && (a[w].style.height = `${E}px`), d[w] && (d[w].style.height = `${E}px`), l[w] && (l[w].style.height = `${E}px`));
455
+ }
458
456
  }, "syncRowHeights");
459
457
  for (const n of t)
460
458
  n.attributeName === "class" && this.classList.contains("active") && s();
461
- }).observe(this, { attributes: !0 });
459
+ }).observe(this, { attributes: !0 }), e(this, ce).call(this);
462
460
  }, "#init"));
463
461
  u(this, ce, /* @__PURE__ */ h(() => {
464
462
  const t = j.SCROLLBAR_SIZE;
@@ -584,16 +582,16 @@ const j = class j extends HTMLElement {
584
582
  </div>
585
583
  `;
586
584
  }, "#render"));
587
- y(this, F, new xe(this));
585
+ y(this, U, new xe(this));
588
586
  }
589
587
  connectedCallback() {
590
588
  e(this, ae).call(this);
591
589
  }
592
590
  disconnectedCallback() {
593
- this.innerHTML = "", M.log("NineTableSheet destroyed.");
591
+ this.innerHTML = "", O.log("NineTableSheet destroyed.");
594
592
  }
595
593
  };
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);
594
+ T = new WeakMap(), U = new WeakMap(), G = new WeakMap(), F = new WeakMap(), ae = new WeakMap(), ce = new WeakMap(), h(j, "NineTableSheet"), v(j, "SCROLLBAR_SIZE", 16);
597
595
  let te = j;
598
596
  customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", te);
599
597
  var he, J;
@@ -780,13 +778,13 @@ const _e = class _e {
780
778
  };
781
779
  R = new WeakMap(), de = new WeakMap(), Q = new WeakMap(), fe = new WeakMap(), h(_e, "LayoutManager");
782
780
  let Se = _e;
783
- var z, X;
781
+ var W, X;
784
782
  const Ie = class Ie {
785
783
  constructor(i) {
786
- u(this, z);
784
+ u(this, W);
787
785
  u(this, X, -1);
788
- v(this, "count", /* @__PURE__ */ h(() => e(this, z).rawRecords.length, "count"));
789
- y(this, z, i);
786
+ v(this, "count", /* @__PURE__ */ h(() => e(this, W).rawRecords.length, "count"));
787
+ y(this, W, i);
790
788
  }
791
789
  get at() {
792
790
  return e(this, X);
@@ -794,16 +792,16 @@ const Ie = class Ie {
794
792
  set at(i) {
795
793
  var s, n;
796
794
  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;
795
+ const t = ((n = (s = e(this, W).owner).querySelector) == null ? void 0 : n.call(s, ".ng-container-body")) || e(this, W).owner.body;
798
796
  t && !t.querySelector(`tbody.bindable tr[data-row="${e(this, X)}"]`) && setTimeout(() => {
799
797
  var r, o;
800
- (o = (r = e(this, z).owner).scrollTo_V1) == null || o.call(r, e(this, X));
798
+ (o = (r = e(this, W).owner).scrollTo_V1) == null || o.call(r, e(this, X));
801
799
  });
802
800
  }
803
801
  };
804
- z = new WeakMap(), X = new WeakMap(), h(Ie, "ngRow");
802
+ W = new WeakMap(), X = new WeakMap(), h(Ie, "ngRow");
805
803
  let Ee = Ie;
806
- var q, x, k, K, ue, O, ge, ee, be, ye, Z;
804
+ var q, x, k, K, ue, z, ge, ee, be, ye, Z;
807
805
  const L = class L {
808
806
  constructor(i, t) {
809
807
  u(this, q);
@@ -811,15 +809,15 @@ const L = class L {
811
809
  u(this, k, []);
812
810
  u(this, K, []);
813
811
  u(this, ue, 0);
814
- u(this, O, []);
812
+ u(this, z, []);
815
813
  u(this, ge, /* @__PURE__ */ h(() => {
816
- y(this, O, []);
814
+ y(this, z, []);
817
815
  const i = e(this, q).template || [];
818
816
  Array.from(i).forEach((t) => {
819
817
  var s;
820
- e(this, O).push(((s = t.getBoundingClientRect) == null ? void 0 : s.call(t).height) || 24);
818
+ e(this, z).push(((s = t.getBoundingClientRect) == null ? void 0 : s.call(t).height) || 24);
821
819
  }), (e(this, x).rawRecords || []).forEach((t) => {
822
- t.__ng || (t.__ng = e(this, ee).call(this)), t.__ng.height = e(this, O).slice();
820
+ t.__ng || (t.__ng = e(this, ee).call(this)), t.__ng.height = e(this, z).slice();
823
821
  });
824
822
  }, "#initialize"));
825
823
  v(this, "set", /* @__PURE__ */ h((i) => {
@@ -829,10 +827,10 @@ const L = class L {
829
827
  rowState: L.ROW_STATE.EMPTY,
830
828
  deleted: !1,
831
829
  filtered: !1,
832
- height: e(this, O).slice(),
830
+ height: e(this, z).slice(),
833
831
  o: {},
834
832
  c: {},
835
- _: [0, 0, 0, 0, L.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, O).slice(), -1, {}, {}]
833
+ _: [0, 0, 0, 0, L.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, z).slice(), -1, {}, {}]
836
834
  }), "#getDefaultMeta"));
837
835
  v(this, "reset", /* @__PURE__ */ h(() => {
838
836
  y(this, k, []), y(this, K, []);
@@ -939,7 +937,7 @@ const L = class L {
939
937
  return this.length;
940
938
  }
941
939
  };
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"), // 🎯 ν–‰ μƒνƒœ μ •μ˜ μƒμˆ˜λ₯Ό 클래슀 λ‚΄λΆ€λ‘œ λ‚΄μž¬ν™”
940
+ 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"), // 🎯 ν–‰ μƒνƒœ μ •μ˜ μƒμˆ˜λ₯Ό 클래슀 λ‚΄λΆ€λ‘œ λ‚΄μž¬ν™”
943
941
  v(L, "ROW_STATE", {
944
942
  EMPTY: "EMPTY",
945
943
  NORMAL: "NORMAL",
@@ -979,10 +977,10 @@ const Me = class Me extends HTMLElement {
979
977
  this.attachShadow({ mode: "open" }), y(this, Y, new Ae(this));
980
978
  }
981
979
  connectedCallback() {
982
- y(this, pe, new Se(this)), M.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
980
+ y(this, pe, new Se(this)), O.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
983
981
  }
984
982
  disconnectedCallback() {
985
- M.log("NineTable disconnected.");
983
+ O.log("NineTable disconnected.");
986
984
  }
987
985
  // 🎯 μ™ΈλΆ€μ—μ„œ grid.data.set(...) ν˜•νƒœλ‘œ μ ‘κ·Όν•  수 μžˆλ„λ‘ 데이터 λ§€λ‹ˆμ € μ˜€ν”ˆ
988
986
  get data() {