@ninebone/table 0.0.625 β†’ 0.0.627

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
  c(He, "Trace");
24
24
  let oe = He;
25
- const M = new oe();
25
+ const H = new oe();
26
26
  var B, j, w, X, K, Z, It, G, _t;
27
27
  const Me = class Me extends HTMLElement {
28
28
  constructor() {
@@ -230,7 +230,7 @@ const $e = class $e extends HTMLElement {
230
230
  m < 0 && (m = 0), m > x && (m = x), r.style.top = `${m}px`, t(this, T).top.disabled = g <= 0, t(this, T).bottom.disabled = g >= b - 1;
231
231
  }, "refresh"));
232
232
  d(this, Nt, /* @__PURE__ */ c(() => {
233
- M.log("nine-table-vscrollbar.#init");
233
+ H.log("nine-table-vscrollbar.#init");
234
234
  const e = t(this, T).container, s = /* @__PURE__ */ c(() => {
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, Wt, 3);
372
372
  A(this, "refresh", /* @__PURE__ */ c(() => {
373
373
  var e;
374
- M.log("rowManager.refresh");
374
+ H.log("rowManager.refresh");
375
375
  const i = t(this, S).querySelector(".ng-container-body .ng-part-body");
376
376
  i && (t(this, St).call(this), t(this, lt).call(this, i.scrollTop), (e = t(this, S).querySelector("nine-table-vscrollbar")) == null || e.refresh());
377
377
  }, "refresh"));
378
378
  A(this, "initialize", /* @__PURE__ */ c(() => {
379
- M.log("rowManager.initialize"), y(this, Q, {
379
+ H.log("rowManager.initialize"), y(this, Q, {
380
380
  scrollTables: t(this, S).querySelectorAll(".ng-part-body table"),
381
381
  firstTr: t(this, S).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
382
382
  }), y(this, _, null), t(this, D).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
@@ -407,7 +407,7 @@ const Ie = class Ie {
407
407
  }
408
408
  }, "initialize"));
409
409
  d(this, Ot, /* @__PURE__ */ c((i, e) => {
410
- M.log("rowManager.#renderRows");
410
+ H.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");
@@ -421,13 +421,13 @@ const Ie = class Ie {
421
421
  n ? n.before(o) : r.appendChild(o), e === ".ng-container-body" && (t(this, Q).firstTr = r.querySelector("tr:not(.nodata)"));
422
422
  }, "#renderRows"));
423
423
  d(this, zt, /* @__PURE__ */ c((i) => {
424
- if (M.log("rowManager.#measureAndCacheHeight"), t(this, _) !== null && t(this, _) > 0)
424
+ if (H.log("rowManager.#measureAndCacheHeight"), t(this, _) !== null && t(this, _) > 0)
425
425
  return t(this, _);
426
- M.log("#measureAndCacheHeight");
426
+ H.log("#measureAndCacheHeight");
427
427
  const e = t(this, D).get(".ng-container-body");
428
428
  if (!e || e.length === 0) throw new Error("invalid dom");
429
429
  const s = i.querySelector("tbody.bindable-tbody");
430
- if (M.log(s), !s) throw new Error("invalid dom");
430
+ if (H.log(s), !s) throw new Error("invalid dom");
431
431
  s.querySelectorAll("tr:not(.nodata)").forEach((g) => g.remove());
432
432
  const r = s.querySelector("tr.nodata"), n = document.createDocumentFragment();
433
433
  e.forEach((g) => {
@@ -439,12 +439,12 @@ const Ie = class Ie {
439
439
  const u = s.querySelectorAll("tr:not(.nodata)");
440
440
  return u.forEach((g) => {
441
441
  f += g.offsetHeight || g.getBoundingClientRect().height;
442
- }), u.forEach((g) => g.remove()), o.style.display = a, o.style.visibility = h, o.style.position = l, y(this, _, f > 0 ? f : 24), t(this, Et).call(this), t(this, _);
442
+ }), u.forEach((g) => g.remove()), o.style.display = a, o.style.visibility = h, o.style.position = l, H.log("totalHeight", f), y(this, _, f > 0 ? f : 24), t(this, Et).call(this), t(this, _);
443
443
  }, "#measureAndCacheHeight"));
444
444
  d(this, St, /* @__PURE__ */ c(() => {
445
- M.log("rowManager.#updateVirtualScrollHeight");
445
+ H.log("rowManager.#updateVirtualScrollHeight");
446
446
  const e = (t(this, P).data.get() || []).length, s = t(this, _), r = e * s;
447
- M.log("πŸ” [VirtualHeight]", { totalCount: e, rowHeight: s, totalVirtualHeight: r }), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
447
+ H.log("πŸ” [VirtualHeight]", { totalCount: e, rowHeight: s, totalVirtualHeight: r }), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
448
448
  const o = t(this, S).querySelector(n);
449
449
  if (!o) return;
450
450
  const a = o.querySelector(".ng-part-body .ng-virtual-spacer");
@@ -501,7 +501,7 @@ const Ie = class Ie {
501
501
  })), t(this, V).observe(t(this, S)));
502
502
  }, "#initResizeObserver"));
503
503
  d(this, At, /* @__PURE__ */ c(() => {
504
- M.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
504
+ H.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
505
505
  const e = t(this, S).querySelector(i);
506
506
  e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Ot).call(this, e, i);
507
507
  }), t(this, Pt).call(this), t(this, Bt).call(this);
@@ -573,7 +573,7 @@ const Ie = class Ie {
573
573
  }, "#bindRowData"));
574
574
  d(this, Pt, /* @__PURE__ */ c(() => {
575
575
  var h, l, f;
576
- M.log("rowManager.#syncHeaderHeights");
576
+ H.log("rowManager.#syncHeaderHeights");
577
577
  const i = t(this, S).querySelector(".ng-container-left .ng-part-header table"), e = t(this, S).querySelector(".ng-container-body .ng-part-header table"), s = t(this, S).querySelector(".ng-container-right .ng-part-header table");
578
578
  if (!e) return;
579
579
  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);
@@ -943,7 +943,7 @@ const pt = class pt extends HTMLElement {
943
943
  t(this, Ut).call(this);
944
944
  }
945
945
  disconnectedCallback() {
946
- this.innerHTML = "", M.log("NineTableSheet destroyed.");
946
+ this.innerHTML = "", H.log("NineTableSheet destroyed.");
947
947
  }
948
948
  };
949
949
  Ft = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), ct = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(), c(pt, "NineTableSheet"), A(pt, "SCROLLBAR_SIZE", 16);
@@ -1000,29 +1000,29 @@ const _e = class _e extends HTMLElement {
1000
1000
  Kt = new WeakMap(), Rt = new WeakMap(), c(_e, "NineTableSheets");
1001
1001
  let de = _e;
1002
1002
  customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", de);
1003
- var H, Zt, Tt, Gt;
1003
+ var M, Zt, Tt, Gt;
1004
1004
  const Ne = class Ne {
1005
1005
  constructor(i) {
1006
- d(this, H);
1006
+ d(this, M);
1007
1007
  d(this, Zt, /* @__PURE__ */ c(() => {
1008
1008
  t(this, Gt).call(this), new ResizeObserver((i) => {
1009
1009
  for (let e of i)
1010
- t(this, H).getAttribute("auto-height") === "true" && t(this, Tt).call(this);
1011
- }).observe(t(this, H));
1010
+ t(this, M).getAttribute("auto-height") === "true" && t(this, Tt).call(this);
1011
+ }).observe(t(this, M));
1012
1012
  }, "#init"));
1013
1013
  d(this, Tt, /* @__PURE__ */ c(() => {
1014
1014
  var h, l;
1015
- const i = Array.from(t(this, H).shadowRoot.querySelectorAll("nine-table-sheet.active"));
1015
+ const i = Array.from(t(this, M).shadowRoot.querySelectorAll("nine-table-sheet.active"));
1016
1016
  if (i.length === 0) return;
1017
- const e = parseInt(t(this, H).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), r = (h = t(this, H).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : h.getBoundingClientRect().height, n = (l = t(this, H).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = $t.SCROLLBAR_SIZE, a = e * s + r + n + o;
1018
- t(this, H).style.height = `${a}px`;
1017
+ const e = parseInt(t(this, M).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), r = (h = t(this, M).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : h.getBoundingClientRect().height, n = (l = t(this, M).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = $t.SCROLLBAR_SIZE, a = e * s + r + n + o;
1018
+ t(this, M).style.height = `${a}px`;
1019
1019
  }, "#applyAutoHeight"));
1020
1020
  d(this, Gt, /* @__PURE__ */ c(() => {
1021
- const e = Array.from(t(this, H).children).filter((h) => h.tagName === "TABLE"), s = t(this, H).getAttribute("auto-height") === "true", r = e.length, n = e.map((h, l) => {
1021
+ const e = Array.from(t(this, M).children).filter((h) => h.tagName === "TABLE"), s = t(this, M).getAttribute("auto-height") === "true", r = e.length, n = e.map((h, l) => {
1022
1022
  const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, g = l < r - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
1023
1023
  return u + g;
1024
1024
  }).join(""), o = e.map((h, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
1025
- t(this, H).shadowRoot.innerHTML = `
1025
+ t(this, M).shadowRoot.innerHTML = `
1026
1026
  <style>
1027
1027
  :host {
1028
1028
  display: flex;
@@ -1142,18 +1142,18 @@ const Ne = class Ne {
1142
1142
  <nine-table-analysis></nine-table-analysis>
1143
1143
  </nine-table-body>
1144
1144
  <nine-table-footer></nine-table-footer>
1145
- `, t(this, H).shadowRoot.querySelector("nine-table-sheets").classList.add("nodata");
1146
- const a = t(this, H).shadowRoot.querySelectorAll("nine-table-sheet");
1145
+ `, t(this, M).shadowRoot.querySelector("nine-table-sheets").classList.add("nodata");
1146
+ const a = t(this, M).shadowRoot.querySelectorAll("nine-table-sheet");
1147
1147
  a == null || a.forEach((h, l) => {
1148
1148
  e[l] && setTimeout(() => {
1149
1149
  h.generate(e[l]), s && t(this, Tt).call(this);
1150
1150
  });
1151
1151
  });
1152
1152
  }, "#render"));
1153
- y(this, H, i), t(this, Zt).call(this);
1153
+ y(this, M, i), t(this, Zt).call(this);
1154
1154
  }
1155
1155
  };
1156
- H = new WeakMap(), Zt = new WeakMap(), Tt = new WeakMap(), Gt = new WeakMap(), c(Ne, "LayoutManager");
1156
+ M = new WeakMap(), Zt = new WeakMap(), Tt = new WeakMap(), Gt = new WeakMap(), c(Ne, "LayoutManager");
1157
1157
  let fe = Ne;
1158
1158
  var kt, ht;
1159
1159
  const We = class We {
@@ -1366,11 +1366,11 @@ const ze = class ze {
1366
1366
  }), y(this, L, Array.from(i, ([e, s]) => ({ name: e, type: s }))), y(this, L, t(this, L).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, L).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
1367
1367
  }, "#adjust"));
1368
1368
  d(this, se, /* @__PURE__ */ c(() => {
1369
- y(this, L, []), M.log(t(this, ut).querySelectorAll("table"));
1369
+ y(this, L, []), H.log(t(this, ut).querySelectorAll("table"));
1370
1370
  const i = Array.from(t(this, ut).querySelectorAll("table"));
1371
1371
  if (!(!i || i.length === 0)) {
1372
1372
  for (const e of i)
1373
- M.log(e), $("[data-bind]", e).each((s, r) => {
1373
+ H.log(e), $("[data-bind]", e).each((s, r) => {
1374
1374
  const n = r.dataset.bind, o = r.getAttribute("data-type") || "string";
1375
1375
  n && t(this, L).push({ name: n, type: o });
1376
1376
  }), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
@@ -1429,7 +1429,7 @@ const Be = class Be extends HTMLElement {
1429
1429
  d(this, nt);
1430
1430
  d(this, ie);
1431
1431
  d(this, re, /* @__PURE__ */ c(() => {
1432
- this.fields = new ye(this), y(this, ie, new fe(this)), M.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
1432
+ this.fields = new ye(this), y(this, ie, new fe(this)), H.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
1433
1433
  }, "#init"));
1434
1434
  this.attachShadow({ mode: "open" }), y(this, nt, new be(this));
1435
1435
  }
@@ -1437,7 +1437,7 @@ const Be = class Be extends HTMLElement {
1437
1437
  t(this, re).call(this);
1438
1438
  }
1439
1439
  disconnectedCallback() {
1440
- M.log("NineTable disconnected.");
1440
+ H.log("NineTable disconnected.");
1441
1441
  }
1442
1442
  // 🎯 μ™ΈλΆ€μ—μ„œ grid.data.set(...) ν˜•νƒœλ‘œ μ ‘κ·Όν•  수 μžˆλ„λ‘ 데이터 λ§€λ‹ˆμ € μ˜€ν”ˆ
1443
1443
  get data() {