@ninebone/table 0.0.681 β†’ 0.0.683

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 He = class He extends Ke.constructor {
22
22
  };
23
23
  h(He, "Trace");
24
24
  let oe = He;
25
- const T = new oe();
25
+ const R = new oe();
26
26
  var z, j, S, X, K, Z, _t, G, Nt;
27
27
  const $e = class $e extends HTMLElement {
28
28
  constructor() {
@@ -230,7 +230,7 @@ const Me = class Me extends HTMLElement {
230
230
  g < 0 && (g = 0), g > v && (g = v), r.style.top = `${g}px`, t(this, k).top.disabled = u <= 0, t(this, k).bottom.disabled = u >= b - 1;
231
231
  }, "refresh"));
232
232
  d(this, Wt, /* @__PURE__ */ h(() => {
233
- T.log("nine-table-vscrollbar.#init");
233
+ R.log("nine-table-vscrollbar.#init");
234
234
  const e = t(this, k).container, s = /* @__PURE__ */ h(() => {
235
235
  const n = (t(this, F).data.get() || []).length, o = t(this, at).getRowHeight();
236
236
  return n * o;
@@ -371,12 +371,12 @@ const Ie = class Ie {
371
371
  d(this, Ot, 3);
372
372
  E(this, "refresh", /* @__PURE__ */ h(() => {
373
373
  var e;
374
- T.log("rowManager.refresh");
374
+ R.log("rowManager.refresh");
375
375
  const i = t(this, x).querySelector(".ng-container-body .ng-part-body");
376
376
  i && (t(this, St).call(this), t(this, Et).call(this), t(this, lt).call(this, i.scrollTop), (e = t(this, x).querySelector("nine-table-vscrollbar")) == null || e.refresh());
377
377
  }, "refresh"));
378
378
  E(this, "initialize", /* @__PURE__ */ h(() => {
379
- T.log("rowManager.initialize"), y(this, Q, {
379
+ R.log("rowManager.initialize"), y(this, Q, {
380
380
  scrollTables: t(this, x).querySelectorAll(".ng-part-body table"),
381
381
  firstTr: t(this, x).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
382
382
  }), y(this, M, null), t(this, D).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
@@ -390,7 +390,7 @@ const Ie = class Ie {
390
390
  t(this, D).set(o, u);
391
391
  });
392
392
  const i = t(this, x).querySelector(".ng-container-body .ng-part-body"), e = t(this, x).querySelector(".ng-container-left .ng-part-body"), s = t(this, x).querySelector(".ng-container-right .ng-part-body"), r = t(this, x).querySelector(".ng-container-body .ng-part-header"), n = t(this, x).querySelector(".ng-container-body .ng-part-footer");
393
- if (i) {
393
+ if (R.log(i), i) {
394
394
  t(this, St).call(this), t(this, qt).call(this), t(this, Et).call(this), t(this, lt).call(this, i.scrollTop);
395
395
  let o = !1;
396
396
  const a = /* @__PURE__ */ h((c) => {
@@ -407,7 +407,7 @@ const Ie = class Ie {
407
407
  }
408
408
  }, "initialize"));
409
409
  d(this, Bt, /* @__PURE__ */ h((i, e) => {
410
- T.log("rowManager.#renderRows");
410
+ R.log("rowManager.#renderRows");
411
411
  const s = t(this, D).get(e);
412
412
  if (!s || s.length === 0) return;
413
413
  const r = i.querySelector(".ng-part-body tbody.bindable-tbody");
@@ -424,11 +424,11 @@ const Ie = class Ie {
424
424
  if (t(this, M) !== null && t(this, M) > 0)
425
425
  return t(this, M);
426
426
  const i = t(this, x).querySelector(".ng-container-body .ng-part-body");
427
- T.log("rowManager.#measureAndCacheHeight");
427
+ R.log("rowManager.#measureAndCacheHeight");
428
428
  const e = t(this, D).get(".ng-container-body");
429
429
  if (!e || e.length === 0) throw new Error("invalid dom");
430
430
  const s = i.querySelector("tbody.bindable-tbody");
431
- if (T.log(s), !s) throw new Error("invalid dom");
431
+ if (R.log(s), !s) throw new Error("invalid dom");
432
432
  s.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
433
433
  const r = s.querySelector("tr.nodata"), n = document.createDocumentFragment();
434
434
  e.forEach((b) => {
@@ -449,9 +449,9 @@ const Ie = class Ie {
449
449
  return y(this, M, f), t(this, At).call(this), t(this, M);
450
450
  }, "#measureAndCacheHeight"));
451
451
  d(this, Et, /* @__PURE__ */ h(() => {
452
- T.log("rowManager.#updateVirtualScrollHeight");
452
+ R.log("rowManager.#updateVirtualScrollHeight");
453
453
  const e = (t(this, P).data.get() || []).length, s = t(this, M), r = e * s;
454
- T.log("πŸ” [VirtualHeight]", { totalCount: e, rowHeight: s, totalVirtualHeight: r }), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
454
+ R.log("πŸ” [VirtualHeight]", { totalCount: e, rowHeight: s, totalVirtualHeight: r }), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
455
455
  const o = t(this, x).querySelector(n);
456
456
  if (!o) return;
457
457
  const a = o.querySelector(".ng-part-body .ng-virtual-spacer");
@@ -474,8 +474,8 @@ const Ie = class Ie {
474
474
  ((a = g[m]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
475
475
  ((c = v[m]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
476
476
  ((l = w[m]) == null ? void 0 : l.getBoundingClientRect().height) || 0
477
- ], R = Math.max(...W);
478
- R > 0 && (g[m] && (g[m].style.height = `${R}px`), v[m] && (v[m].style.height = `${R}px`), w[m] && (w[m].style.height = `${R}px`));
477
+ ], T = Math.max(...W);
478
+ T > 0 && (g[m] && (g[m].style.height = `${T}px`), v[m] && (v[m].style.height = `${T}px`), w[m] && (w[m].style.height = `${T}px`));
479
479
  }
480
480
  }
481
481
  const r = t(this, x).querySelector(".ng-container-left .ng-part-footer table"), n = t(this, x).querySelector(".ng-container-body .ng-part-footer table"), o = t(this, x).querySelector(".ng-container-right .ng-part-footer table");
@@ -486,8 +486,8 @@ const Ie = class Ie {
486
486
  ((f = g[m]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
487
487
  ((u = v[m]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
488
488
  ((b = w[m]) == null ? void 0 : b.getBoundingClientRect().height) || 0
489
- ], R = Math.max(...W);
490
- R > 0 && (g[m] && (g[m].style.height = `${R}px`), v[m] && (v[m].style.height = `${R}px`), w[m] && (w[m].style.height = `${R}px`));
489
+ ], T = Math.max(...W);
490
+ T > 0 && (g[m] && (g[m].style.height = `${T}px`), v[m] && (v[m].style.height = `${T}px`), w[m] && (w[m].style.height = `${T}px`));
491
491
  }
492
492
  }
493
493
  }, "#syncRowHeights"));
@@ -508,7 +508,7 @@ const Ie = class Ie {
508
508
  })), t(this, V).observe(t(this, x)));
509
509
  }, "#initResizeObserver"));
510
510
  d(this, qt, /* @__PURE__ */ h(() => {
511
- T.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
511
+ R.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
512
512
  const e = t(this, x).querySelector(i);
513
513
  e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Bt).call(this, e, i);
514
514
  }), t(this, Pt).call(this), t(this, zt).call(this);
@@ -534,32 +534,32 @@ const Ie = class Ie {
534
534
  }, "#adjustBufferRows"));
535
535
  d(this, lt, /* @__PURE__ */ h((i) => {
536
536
  var u, b;
537
- T.log("rowManager.#handleScroll()", t(this, M));
537
+ R.log("rowManager.#handleScroll()", t(this, M));
538
538
  const e = t(this, M);
539
539
  if (!e || e <= 0) return;
540
540
  const s = t(this, P).data.length;
541
541
  if (s === 0) return;
542
542
  const r = ((u = t(this, D).get(".ng-container-body")) == null ? void 0 : u.length) || 1, n = t(this, x).querySelector(".ng-container-body .ng-part-body");
543
- T.log("bodyContainer.clientHeight", n.clientHeight);
543
+ R.log("bodyContainer.clientHeight", n.clientHeight);
544
544
  const o = Math.max(0, s - Math.floor(n.clientHeight / e)), a = Math.min(o, Math.max(0, Math.floor(i / e)));
545
545
  let c = Math.floor(a * e);
546
- T.log(`πŸ“œ [Scroll Calc] maxStartIndex: ${o}, startIndex: ${a}, offsetY: ${c}`), a === o && T.log(`πŸ“œ [Scroll Inspect] scrollTop: ${i}, rowHeight: ${e}, maxStartIndex: ${o}, startIndex: ${a}, offsetY: ${c}`);
546
+ R.log(`πŸ“œ [Scroll Calc] maxStartIndex: ${o}, startIndex: ${a}, offsetY: ${c}`), a === o && R.log(`πŸ“œ [Scroll Inspect] scrollTop: ${i}, rowHeight: ${e}, maxStartIndex: ${o}, startIndex: ${a}, offsetY: ${c}`);
547
547
  const l = t(this, Q).firstTr, f = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
548
548
  (b = t(this, Q)) == null || b.scrollTables.forEach((g) => {
549
549
  g.style.transform = `translate3d(0, ${c}px, 0)`;
550
- }), f !== a && (T.log(`πŸ”„ [Row Bind Trigger] currentStartIndex(${f}) !== startIndex(${a})`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
550
+ }), f !== a && (R.log(`πŸ”„ [Row Bind Trigger] currentStartIndex(${f}) !== startIndex(${a})`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
551
551
  const v = t(this, x).querySelector(g);
552
552
  if (!v) return;
553
553
  const w = v.querySelector(".ng-part-body tbody.bindable-tbody");
554
554
  if (!w) return;
555
555
  Array.from(w.querySelectorAll("tr:not(.nodata)")).forEach((m, W) => {
556
- const R = a + Math.floor(W / r);
557
- if (R >= s) {
556
+ const T = a + Math.floor(W / r);
557
+ if (T >= s) {
558
558
  m.style.display = "none";
559
559
  return;
560
560
  }
561
- const O = t(this, P).data.get(R);
562
- m.style.display = "", t(this, Rt).call(this, m, O, R);
561
+ const O = t(this, P).data.get(T);
562
+ m.style.display = "", t(this, Rt).call(this, m, O, T);
563
563
  });
564
564
  }));
565
565
  }, "#handleScroll"));
@@ -586,7 +586,7 @@ const Ie = class Ie {
586
586
  }, "#bindRowData"));
587
587
  d(this, Pt, /* @__PURE__ */ h(() => {
588
588
  var c, l, f;
589
- T.log("rowManager.#syncHeaderHeights");
589
+ R.log("rowManager.#syncHeaderHeights");
590
590
  const i = t(this, x).querySelector(".ng-container-left .ng-part-header table"), e = t(this, x).querySelector(".ng-container-body .ng-part-header table"), s = t(this, x).querySelector(".ng-container-right .ng-part-header table");
591
591
  if (!e) return;
592
592
  const r = i ? Array.from(i.querySelectorAll("tr")) : [], n = Array.from(e.querySelectorAll("tr")), o = s ? Array.from(s.querySelectorAll("tr")) : [], a = Math.max(r.length, n.length, o.length);
@@ -666,9 +666,9 @@ const jt = class jt {
666
666
  A = O;
667
667
  break;
668
668
  }
669
- const W = m.rowSpan || 1, R = m.colSpan || 1;
669
+ const W = m.rowSpan || 1, T = m.colSpan || 1;
670
670
  for (let O = 0; O < W; O++)
671
- for (let yt = 0; yt < R; yt++)
671
+ for (let yt = 0; yt < T; yt++)
672
672
  w + O < u && A + yt < b && (g[w + O][A + yt] = O === 0 && yt === 0 ? "1" : "0");
673
673
  });
674
674
  }), l.forEach((v) => {
@@ -701,10 +701,10 @@ const pt = class pt extends HTMLElement {
701
701
  d(this, et, null);
702
702
  d(this, st);
703
703
  E(this, "invalidate", /* @__PURE__ */ h(() => {
704
- T.log("sheet.invalidate()"), t(this, st).refresh();
704
+ R.log("sheet.invalidate()"), t(this, st).refresh();
705
705
  }, "invalidate"));
706
706
  E(this, "generate", /* @__PURE__ */ h((e) => {
707
- if (T.log("sheet.generate()"), !e) return;
707
+ if (R.log("sheet.generate()"), !e) return;
708
708
  y(this, et, he.compile(e)), t(this, Vt).call(this), t(this, Yt).call(this);
709
709
  const s = this.querySelector(".ng-container-body .ng-part-header"), r = this.querySelector(".ng-container-body .ng-part-footer"), n = this.querySelector(".ng-nodata-overlay");
710
710
  s && n && (n.style.top = `${s.offsetHeight}px`), r && n && (n.style.bottom = `${r.offsetHeight}px`), t(this, st).initialize(), setTimeout(() => {
@@ -958,7 +958,7 @@ const pt = class pt extends HTMLElement {
958
958
  t(this, Ut).call(this);
959
959
  }
960
960
  disconnectedCallback() {
961
- this.innerHTML = "", T.log("NineTableSheet destroyed.");
961
+ this.innerHTML = "", R.log("NineTableSheet destroyed.");
962
962
  }
963
963
  };
964
964
  Ft = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), ct = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(), h(pt, "NineTableSheet"), E(pt, "SCROLLBAR_SIZE", 16);
@@ -1381,11 +1381,11 @@ const Be = class Be {
1381
1381
  }), y(this, H, Array.from(i, ([e, s]) => ({ name: e, type: s }))), y(this, H, t(this, H).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, H).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
1382
1382
  }, "#adjust"));
1383
1383
  d(this, se, /* @__PURE__ */ h(() => {
1384
- y(this, H, []), T.log(t(this, gt).querySelectorAll("table"));
1384
+ y(this, H, []), R.log(t(this, gt).querySelectorAll("table"));
1385
1385
  const i = Array.from(t(this, gt).querySelectorAll("table"));
1386
1386
  if (!(!i || i.length === 0)) {
1387
1387
  for (const e of i)
1388
- T.log(e), $("[data-bind]", e).each((s, r) => {
1388
+ R.log(e), $("[data-bind]", e).each((s, r) => {
1389
1389
  const n = r.dataset.bind, o = r.getAttribute("data-type") || "string";
1390
1390
  n && t(this, H).push({ name: n, type: o });
1391
1391
  }), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
@@ -1444,7 +1444,7 @@ const ze = class ze extends HTMLElement {
1444
1444
  d(this, nt);
1445
1445
  d(this, ie);
1446
1446
  d(this, re, /* @__PURE__ */ h(() => {
1447
- this.fields = new ye(this), y(this, ie, new fe(this)), T.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
1447
+ this.fields = new ye(this), y(this, ie, new fe(this)), R.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
1448
1448
  }, "#init"));
1449
1449
  this.attachShadow({ mode: "open" }), y(this, nt, new be(this));
1450
1450
  }
@@ -1452,7 +1452,7 @@ const ze = class ze extends HTMLElement {
1452
1452
  t(this, re).call(this);
1453
1453
  }
1454
1454
  disconnectedCallback() {
1455
- T.log("NineTable disconnected.");
1455
+ R.log("NineTable disconnected.");
1456
1456
  }
1457
1457
  // 🎯 μ™ΈλΆ€μ—μ„œ grid.data.set(...) ν˜•νƒœλ‘œ μ ‘κ·Όν•  수 μžˆλ„λ‘ 데이터 λ§€λ‹ˆμ € μ˜€ν”ˆ
1458
1458
  get data() {
@@ -1520,8 +1520,8 @@ const De = class De extends me {
1520
1520
  if (e && (e = parseInt(e)), e && !isNaN(e)) {
1521
1521
  var s = t(this, p).closest("tr"), r = [];
1522
1522
  $("th,td", s).each((m, W) => {
1523
- var R = ninegrid.j.querySelectorAll(W).attr("suppress");
1524
- R && W.dataset.row && (R = parseInt(R), !isNaN(R) && R <= e && r.push(R));
1523
+ var T = ninegrid.j.querySelectorAll(W).attr("suppress");
1524
+ T && W.dataset.row && (T = parseInt(T), !isNaN(T) && T <= e && r.push(T));
1525
1525
  }), r.sort();
1526
1526
  var n = !1;
1527
1527
  if (parseInt(s.sectionRowIndex / t(this, L).template.length) > 0)