@ninebone/table 0.0.318 β†’ 0.0.319

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.
@@ -244,9 +244,9 @@ const Ut = class Ut extends HTMLElement {
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, m = e.querySelector("table");
246
246
  tt.log(m), tt.log(m.scrollHeight);
247
- const T = m.scrollHeight - b;
248
- if (f > 0 && T > 0) {
249
- const O = u / f * T;
247
+ const q = m.scrollHeight - b;
248
+ if (f > 0 && q > 0) {
249
+ const O = u / f * q;
250
250
  e.scrollTop = t(this, st) + O;
251
251
  }
252
252
  this.refresh();
@@ -354,7 +354,7 @@ const Ut = class Ut extends HTMLElement {
354
354
  Y = new WeakMap(), I = new WeakMap(), S = new WeakMap(), it = new WeakMap(), st = new WeakMap(), ut = new WeakMap(), c(Ut, "NineTableVScrollBar");
355
355
  let $t = Ut;
356
356
  customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", $t);
357
- var bt, K;
357
+ var bt, 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, bt).call(o, e), t(r = H, K).call(r, e, "thead"), t(n = H, K).call(n, e, "tbody"), t(l = H, K).call(l, e, "tfoot"), Array.from(e.querySelectorAll("colgroup col")).forEach((a, d) => {
372
+ return t(o = H, bt).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
- bt = new WeakMap(), K = new WeakMap(), c(H, "TableCompiler"), h(H, bt, /* @__PURE__ */ c((i) => {
380
+ bt = new WeakMap(), F = new WeakMap(), c(H, "TableCompiler"), h(H, bt, /* @__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++) {
@@ -391,7 +391,7 @@ bt = new WeakMap(), K = new WeakMap(), c(H, "TableCompiler"), h(H, bt, /* @__PUR
391
391
  s ? s.after(e) : i.prepend(e);
392
392
  }
393
393
  i.classList.add("nine-table-element"), i.style.display = "table";
394
- }, "#ensureTableStructure")), h(H, K, /* @__PURE__ */ c((i, e) => {
394
+ }, "#ensureTableStructure")), h(H, F, /* @__PURE__ */ c((i, e) => {
395
395
  const s = Array.from(i.querySelectorAll(e + " tr")), o = Array.from(i.querySelectorAll(e + " th," + e + " td")), r = s.length;
396
396
  if (r === 0 || o.length === 0) return;
397
397
  let n = 0;
@@ -410,8 +410,8 @@ bt = new WeakMap(), K = new WeakMap(), c(H, "TableCompiler"), h(H, bt, /* @__PUR
410
410
  }
411
411
  const b = u.rowSpan || 1, m = u.colSpan || 1;
412
412
  for (let E = 0; E < b; E++)
413
- for (let T = 0; T < m; T++)
414
- d + E < r && f + T < n && (l[d + E][f + T] = E === 0 && T === 0 ? "1" : "0");
413
+ for (let q = 0; q < m; q++)
414
+ d + E < r && f + q < n && (l[d + E][f + q] = E === 0 && q === 0 ? "1" : "0");
415
415
  });
416
416
  }), s.forEach((a) => {
417
417
  const d = a.sectionRowIndex;
@@ -425,19 +425,19 @@ bt = new WeakMap(), K = new WeakMap(), c(H, "TableCompiler"), h(H, bt, /* @__PUR
425
425
  });
426
426
  }, "#resetColIndex"));
427
427
  let Wt = H;
428
- var p, _, R, $, V, j, gt, yt, nt, ot, pt, mt, rt, F, xt;
429
- const Kt = class Kt {
428
+ var p, _, R, $, V, K, gt, yt, nt, ot, pt, mt, rt, j, xt;
429
+ const Ft = class Ft {
430
430
  constructor(i) {
431
431
  h(this, p);
432
432
  h(this, _, /* @__PURE__ */ new Map());
433
433
  h(this, R, null);
434
434
  h(this, $, null);
435
435
  h(this, V, 0);
436
- h(this, j, 40);
436
+ h(this, K, 40);
437
437
  w(this, "refresh", /* @__PURE__ */ c(() => {
438
438
  var e;
439
439
  const i = t(this, p).querySelector(".ng-container-body");
440
- i && (t(this, nt).call(this), t(this, F).call(this, i.scrollTop), (e = t(this, p).querySelector("nine-table-vscrollbar")) == null || e.refresh());
440
+ i && (t(this, nt).call(this), t(this, j).call(this, i.scrollTop), (e = t(this, p).querySelector("nine-table-vscrollbar")) == null || e.refresh());
441
441
  }, "refresh"));
442
442
  w(this, "initialize", /* @__PURE__ */ c(() => {
443
443
  g(this, R, null), t(this, _).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
@@ -452,11 +452,11 @@ const Kt = class Kt {
452
452
  });
453
453
  const i = t(this, p).querySelector(".ng-container-body"), e = t(this, p).querySelector(".ng-container-left"), s = t(this, p).querySelector(".ng-container-right");
454
454
  if (i) {
455
- t(this, yt).call(this, i), t(this, rt).call(this), t(this, nt).call(this), t(this, F).call(this, i.scrollTop);
455
+ t(this, yt).call(this, i), t(this, rt).call(this), t(this, nt).call(this), t(this, j).call(this, i.scrollTop);
456
456
  let o = i.scrollTop;
457
457
  const r = /* @__PURE__ */ c((n) => {
458
458
  var l;
459
- e && e.scrollTop !== n && (e.scrollTop = n), s && s.scrollTop !== n && (s.scrollTop = n), t(this, F).call(this, n), (l = t(this, p).querySelector("nine-table-vscrollbar")) == null || l.refresh();
459
+ e && e.scrollTop !== n && (e.scrollTop = n), s && s.scrollTop !== n && (s.scrollTop = n), t(this, j).call(this, n), (l = t(this, p).querySelector("nine-table-vscrollbar")) == null || l.refresh();
460
460
  }, "syncScroll");
461
461
  i.addEventListener("scroll", () => {
462
462
  const n = i.scrollTop;
@@ -471,7 +471,7 @@ const Kt = class Kt {
471
471
  if (!o) return;
472
472
  o.querySelectorAll("tr:not(.nodata)").forEach((l) => l.remove());
473
473
  const r = o.querySelector("tr.nodata"), n = document.createDocumentFragment();
474
- for (let l = 0; l < t(this, j); l++)
474
+ for (let l = 0; l < t(this, K); l++)
475
475
  s.forEach((a) => {
476
476
  n.appendChild(a.cloneNode(!0));
477
477
  });
@@ -509,9 +509,9 @@ const Kt = class Kt {
509
509
  h(this, ot, /* @__PURE__ */ c(() => {
510
510
  if (t(this, V) > 0 && t(this, R) > 0) {
511
511
  const i = Math.ceil(t(this, V) / t(this, R));
512
- g(this, j, i + 20);
512
+ g(this, K, i + 20);
513
513
  } else
514
- g(this, j, 40);
514
+ g(this, K, 40);
515
515
  }, "#updateRowCount"));
516
516
  h(this, pt, /* @__PURE__ */ c(() => {
517
517
  var a, d, f;
@@ -549,7 +549,7 @@ const Kt = class Kt {
549
549
  e && e.querySelector("tbody.bindable-tbody") && t(this, gt).call(this, e, i);
550
550
  }), t(this, pt).call(this);
551
551
  }, "#renderAllContainers"));
552
- h(this, F, /* @__PURE__ */ c((i) => {
552
+ h(this, j, /* @__PURE__ */ c((i) => {
553
553
  var r;
554
554
  const e = t(this, R);
555
555
  if (!e || e <= 0) return;
@@ -560,8 +560,8 @@ const Kt = class Kt {
560
560
  const a = l.querySelector("tbody.bindable-tbody");
561
561
  if (!a) return;
562
562
  Array.from(a.querySelectorAll("tr:not(.nodata)")).forEach((f, u) => {
563
- var E, T, O, Qt;
564
- const b = s + Math.floor(u / o), m = (typeof t(this, p).getData == "function" ? t(this, p).getData(b) : null) ?? (typeof ((E = t(this, p).data) == null ? void 0 : E.get) == "function" ? t(this, p).data.get(b) : null) ?? ((O = (T = t(this, p).dataManager) == null ? void 0 : T.rawRecords) == null ? void 0 : O[b]) ?? ((Qt = t(this, p).data) == null ? void 0 : Qt[b]) ?? { _index: b };
563
+ var E, q, O, Qt;
564
+ const b = s + Math.floor(u / o), m = (typeof t(this, p).getData == "function" ? t(this, p).getData(b) : null) ?? (typeof ((E = t(this, p).data) == null ? void 0 : E.get) == "function" ? t(this, p).data.get(b) : null) ?? ((O = (q = t(this, p).dataManager) == null ? void 0 : q.rawRecords) == null ? void 0 : O[b]) ?? ((Qt = t(this, p).data) == null ? void 0 : Qt[b]) ?? { _index: b };
565
565
  f.style.display = "", t(this, xt).call(this, f, m, b);
566
566
  });
567
567
  });
@@ -585,8 +585,8 @@ const Kt = class Kt {
585
585
  return ((e = t(this, _).get(i)) == null ? void 0 : e.length) || 1;
586
586
  }
587
587
  };
588
- p = new WeakMap(), _ = new WeakMap(), R = new WeakMap(), $ = new WeakMap(), V = new WeakMap(), j = new WeakMap(), gt = new WeakMap(), yt = new WeakMap(), nt = new WeakMap(), ot = new WeakMap(), pt = new WeakMap(), mt = new WeakMap(), rt = new WeakMap(), F = new WeakMap(), xt = new WeakMap(), c(Kt, "RowManager");
589
- let zt = Kt;
588
+ p = new WeakMap(), _ = new WeakMap(), R = new WeakMap(), $ = new WeakMap(), V = new WeakMap(), K = new WeakMap(), gt = new WeakMap(), yt = new WeakMap(), nt = new WeakMap(), ot = new WeakMap(), pt = new WeakMap(), mt = new WeakMap(), rt = new WeakMap(), j = new WeakMap(), xt = new WeakMap(), c(Ft, "RowManager");
589
+ let zt = Ft;
590
590
  var Z, G, vt, wt, St, Et, Rt;
591
591
  const et = class et extends HTMLElement {
592
592
  constructor() {
@@ -617,16 +617,16 @@ const et = class et extends HTMLElement {
617
617
  });
618
618
  }, "#updateContainerWidths"));
619
619
  w(this, "generate", /* @__PURE__ */ c((e) => {
620
- var o;
621
- if (!e) return;
622
- g(this, Z, Wt.compile(e)), t(this, Z).style.display = "table", t(this, vt).call(this), t(this, wt).call(this);
623
- const s = ((o = this.querySelector("thead")) == null ? void 0 : o.getBoundingClientRect().height) || 30;
624
- this.querySelectorAll("tbody.fixed-tbody").forEach((r) => {
625
- r.style.top = `${s}px`;
620
+ e && (g(this, Z, Wt.compile(e)), t(this, Z).style.display = "table", t(this, vt).call(this), t(this, wt).call(this), requestAnimationFrame(() => {
621
+ var o;
622
+ const s = (o = this.querySelector("thead")) == null ? void 0 : o.getBoundingClientRect().height;
623
+ this.querySelectorAll("tbody.fixed-tbody").forEach((r) => {
624
+ r.style.top = `${s}px`;
625
+ });
626
626
  }), t(this, G).initialize(), setTimeout(() => {
627
- var r;
628
- (r = this.querySelector("nine-table-hscrollbar")) == null || r.refresh();
629
- }, 0);
627
+ var s;
628
+ (s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
629
+ }, 0));
630
630
  }, "generate"));
631
631
  /**
632
632
  * 🎯 λ§ˆμŠ€ν„° ν…Œμ΄λΈ”μ„ 기반으둜 νŠΉμ • fixed νƒ€μž… μ˜μ—­λ§Œ λ‚¨κΈ°λŠ” λΆ„ν•  헬퍼
@@ -820,7 +820,7 @@ Z = new WeakMap(), G = new WeakMap(), vt = new WeakMap(), wt = new WeakMap(), St
820
820
  let ht = et;
821
821
  customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", ht);
822
822
  var kt, lt;
823
- const jt = class jt extends HTMLElement {
823
+ const Kt = class Kt extends HTMLElement {
824
824
  constructor() {
825
825
  super();
826
826
  h(this, kt, /* @__PURE__ */ c(() => {
@@ -837,8 +837,8 @@ const jt = class jt extends HTMLElement {
837
837
  Array.from(this.querySelectorAll("nine-splitter")).forEach((m) => m.style.setProperty("display", "none"));
838
838
  const b = f.filter((m) => m.classList.contains("active"));
839
839
  b.length < 2 || b.forEach((m) => {
840
- const E = parseInt(m.getAttribute("data-index"), 10), T = this.querySelector(`nine-splitter[data-split-index="${E}"]`), O = f[E + 1];
841
- T && O && O.classList.contains("active") && T.style.setProperty("display", "flex");
840
+ const E = parseInt(m.getAttribute("data-index"), 10), q = this.querySelector(`nine-splitter[data-split-index="${E}"]`), O = f[E + 1];
841
+ q && O && O.classList.contains("active") && q.style.setProperty("display", "flex");
842
842
  });
843
843
  }, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), n = this.querySelector("nine-table-sheets-body"), l = r.querySelectorAll(".nine-tab-item"), a = n.querySelectorAll("nine-table-sheet");
844
844
  if (!l[e]) return;
@@ -867,15 +867,15 @@ const jt = class jt extends HTMLElement {
867
867
  t(this, kt).call(this);
868
868
  }
869
869
  };
870
- kt = new WeakMap(), lt = new WeakMap(), c(jt, "NineTableSheets");
871
- let Ot = jt;
870
+ kt = new WeakMap(), lt = new WeakMap(), c(Kt, "NineTableSheets");
871
+ let Ot = Kt;
872
872
  customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", Ot);
873
- var k, Tt, ct, qt;
874
- const Ft = class Ft {
873
+ var k, qt, ct, Tt;
874
+ const jt = class jt {
875
875
  constructor(i) {
876
876
  h(this, k);
877
- h(this, Tt, /* @__PURE__ */ c(() => {
878
- t(this, qt).call(this), new ResizeObserver((i) => {
877
+ h(this, qt, /* @__PURE__ */ c(() => {
878
+ t(this, Tt).call(this), new ResizeObserver((i) => {
879
879
  for (let e of i)
880
880
  t(this, k).getAttribute("auto-height") === "true" && t(this, ct).call(this);
881
881
  }).observe(t(this, k));
@@ -887,7 +887,7 @@ const Ft = class Ft {
887
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 = ht.SCROLLBAR_SIZE, l = e * s + o + r + n;
888
888
  t(this, k).style.height = `${l}px`;
889
889
  }, "#applyAutoHeight"));
890
- h(this, qt, /* @__PURE__ */ c(() => {
890
+ h(this, Tt, /* @__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,11 +998,11 @@ const Ft = class Ft {
998
998
  });
999
999
  });
1000
1000
  }, "#render"));
1001
- g(this, k, i), t(this, Tt).call(this);
1001
+ g(this, k, i), t(this, qt).call(this);
1002
1002
  }
1003
1003
  };
1004
- k = new WeakMap(), Tt = new WeakMap(), ct = new WeakMap(), qt = new WeakMap(), c(Ft, "LayoutManager");
1005
- let Dt = Ft;
1004
+ k = new WeakMap(), qt = new WeakMap(), ct = new WeakMap(), Tt = new WeakMap(), c(jt, "LayoutManager");
1005
+ let Dt = jt;
1006
1006
  var W, X;
1007
1007
  const Zt = class Zt {
1008
1008
  constructor(i) {
@@ -1026,10 +1026,10 @@ const Zt = class Zt {
1026
1026
  };
1027
1027
  W = new WeakMap(), X = new WeakMap(), c(Zt, "ngRow");
1028
1028
  let Bt = Zt;
1029
- var q, v, A, J, At, z, Lt, at, Ht, Ct, Q;
1029
+ var T, v, A, J, At, z, Lt, at, Ht, Ct, Q;
1030
1030
  const L = class L {
1031
1031
  constructor(i, e) {
1032
- h(this, q);
1032
+ h(this, T);
1033
1033
  h(this, v);
1034
1034
  h(this, A, []);
1035
1035
  h(this, J, []);
@@ -1037,7 +1037,7 @@ const L = class L {
1037
1037
  h(this, z, []);
1038
1038
  h(this, Lt, /* @__PURE__ */ c(() => {
1039
1039
  g(this, z, []);
1040
- const i = t(this, q).template || [];
1040
+ const i = t(this, T).template || [];
1041
1041
  Array.from(i).forEach((e) => {
1042
1042
  var s;
1043
1043
  t(this, z).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
@@ -1067,7 +1067,7 @@ const L = class L {
1067
1067
  h(this, Ht, /* @__PURE__ */ c((i) => {
1068
1068
  var o;
1069
1069
  Array.isArray(i) || (i = [i]);
1070
- const e = typeof ((o = t(this, q).fields) == null ? void 0 : o.get) == "function" ? t(this, q).fields.get() : Object.keys(i[0] || {}), s = [];
1070
+ const e = typeof ((o = t(this, T).fields) == null ? void 0 : o.get) == "function" ? t(this, T).fields.get() : Object.keys(i[0] || {}), s = [];
1071
1071
  return i.forEach((r) => {
1072
1072
  const n = { v: [] };
1073
1073
  e.forEach((l) => {
@@ -1104,7 +1104,7 @@ const L = class L {
1104
1104
  w(this, "setValue", /* @__PURE__ */ c((i, e, s) => {
1105
1105
  var a;
1106
1106
  i = parseInt(i, 10);
1107
- const r = (typeof ((a = t(this, q).fields) == null ? void 0 : a.get) == "function" ? t(this, q).fields.get() : []).indexOf(e);
1107
+ const r = (typeof ((a = t(this, T).fields) == null ? void 0 : a.get) == "function" ? t(this, T).fields.get() : []).indexOf(e);
1108
1108
  if (r < 0) return;
1109
1109
  const n = this.getValidData()[i];
1110
1110
  if (!n) return;
@@ -1122,7 +1122,7 @@ const L = class L {
1122
1122
  h(this, Q, /* @__PURE__ */ c((i) => {
1123
1123
  var s;
1124
1124
  if (!i) return i;
1125
- const e = typeof ((s = t(this, q).fields) == null ? void 0 : s.get) == "function" ? t(this, q).fields.get() : [];
1125
+ const e = typeof ((s = t(this, T).fields) == null ? void 0 : s.get) == "function" ? t(this, T).fields.get() : [];
1126
1126
  return Array.isArray(i) ? i.filter((o) => !o.__ng.deleted).map((o) => {
1127
1127
  const r = {};
1128
1128
  return e.forEach((n, l) => {
@@ -1137,14 +1137,14 @@ const L = class L {
1137
1137
  if (!s || s.length <= 0) return;
1138
1138
  if (i == null) return t(this, Q).call(this, s);
1139
1139
  if (i < 0 || i >= s.length) return null;
1140
- const o = typeof ((r = t(this, q).fields) == null ? void 0 : r.get) == "function" ? t(this, q).fields.get() : [];
1140
+ const o = typeof ((r = t(this, T).fields) == null ? void 0 : r.get) == "function" ? t(this, T).fields.get() : [];
1141
1141
  if (e != null) {
1142
1142
  const n = o.indexOf(e);
1143
1143
  return n >= 0 ? s[i].v[n] : null;
1144
1144
  }
1145
1145
  return t(this, Q).call(this, s[i]);
1146
1146
  }, "get"));
1147
- g(this, q, i), g(this, v, e), t(this, Lt).call(this);
1147
+ g(this, T, i), g(this, v, e), t(this, Lt).call(this);
1148
1148
  }
1149
1149
  get source() {
1150
1150
  return t(this, Q).call(this, t(this, v).rawRecords);
@@ -1162,7 +1162,7 @@ const L = class L {
1162
1162
  return this.length;
1163
1163
  }
1164
1164
  };
1165
- q = new WeakMap(), v = new WeakMap(), A = new WeakMap(), J = new WeakMap(), At = new WeakMap(), z = new WeakMap(), Lt = new WeakMap(), at = new WeakMap(), Ht = new WeakMap(), Ct = new WeakMap(), Q = new WeakMap(), c(L, "ngData"), // 🎯 ν–‰ μƒνƒœ μ •μ˜ μƒμˆ˜λ₯Ό 클래슀 λ‚΄λΆ€λ‘œ λ‚΄μž¬ν™”
1165
+ T = new WeakMap(), v = new WeakMap(), A = new WeakMap(), J = new WeakMap(), At = new WeakMap(), z = new WeakMap(), Lt = new WeakMap(), at = new WeakMap(), Ht = new WeakMap(), Ct = new WeakMap(), Q = new WeakMap(), c(L, "ngData"), // 🎯 ν–‰ μƒνƒœ μ •μ˜ μƒμˆ˜λ₯Ό 클래슀 λ‚΄λΆ€λ‘œ λ‚΄μž¬ν™”
1166
1166
  w(L, "ROW_STATE", {
1167
1167
  EMPTY: "EMPTY",
1168
1168
  NORMAL: "NORMAL",