@ninebone/table 0.0.352 → 0.0.353

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.
@@ -425,13 +425,13 @@ wt = new WeakMap(), G = new WeakMap(), a(C, "TableCompiler"), h(C, wt, /* @__PUR
425
425
  });
426
426
  }, "#resetColIndex"));
427
427
  let Xt = C;
428
- var X, w, M, A, z, U, J, St, Et, at, ct, Rt, At, ht, Q, kt;
428
+ var X, w, M, k, z, U, J, St, Et, at, ct, Rt, At, ht, Q, kt;
429
429
  const se = class se {
430
430
  constructor(i) {
431
431
  h(this, X);
432
432
  h(this, w);
433
433
  h(this, M, /* @__PURE__ */ new Map());
434
- h(this, A, null);
434
+ h(this, k, null);
435
435
  h(this, z, null);
436
436
  h(this, U, 0);
437
437
  h(this, J, 40);
@@ -441,7 +441,7 @@ const se = class se {
441
441
  i && (t(this, at).call(this), t(this, Q).call(this, i.scrollTop), (e = t(this, w).querySelector("nine-table-vscrollbar")) == null || e.refresh());
442
442
  }, "refresh"));
443
443
  x(this, "initialize", /* @__PURE__ */ a(() => {
444
- b(this, A, null), t(this, M).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
444
+ b(this, k, null), t(this, M).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
445
445
  const r = t(this, w).querySelector(o);
446
446
  if (!r) return;
447
447
  const n = r.querySelector("table");
@@ -479,8 +479,8 @@ const se = class se {
479
479
  r ? r.before(n) : o.appendChild(n);
480
480
  }, "#renderRows"));
481
481
  h(this, Et, /* @__PURE__ */ a((i) => {
482
- if (t(this, A) !== null && t(this, A) > 0)
483
- return t(this, A);
482
+ if (t(this, k) !== null && t(this, k) > 0)
483
+ return t(this, k);
484
484
  const e = t(this, M).get(".ng-container-body");
485
485
  if (!e || e.length === 0) return 24;
486
486
  const s = i.querySelector("tbody.bindable-tbody") || i.querySelector("tbody.bindable-tbody:last-of-type");
@@ -496,19 +496,19 @@ const se = class se {
496
496
  const u = s.querySelectorAll("tr:not(.nodata)");
497
497
  return u.forEach((g) => {
498
498
  f += g.offsetHeight || g.getBoundingClientRect().height;
499
- }), u.forEach((g) => g.remove()), n.style.display = l, n.style.visibility = c, n.style.position = d, b(this, A, f > 0 ? f : 24), t(this, ct).call(this), t(this, A);
499
+ }), u.forEach((g) => g.remove()), n.style.display = l, n.style.visibility = c, n.style.position = d, b(this, k, f > 0 ? f : 24), t(this, ct).call(this), t(this, k);
500
500
  }, "#measureAndCacheHeight"));
501
501
  h(this, at, /* @__PURE__ */ a(() => {
502
502
  if (!t(this, w).querySelector(".ng-container-body")) return;
503
- const e = t(this, X).data.get() || [], s = e.length > 0 ? e.length : 100, o = t(this, A), r = s * o;
503
+ const e = t(this, X).data.get() || [], s = e.length > 0 ? e.length : 100, o = t(this, k), r = s * o;
504
504
  [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
505
505
  const l = t(this, w).querySelector(n), c = l == null ? void 0 : l.querySelector("table");
506
506
  c && (c.style.height = `${r}px`);
507
507
  });
508
508
  }, "#updateVirtualScrollHeight"));
509
509
  h(this, ct, /* @__PURE__ */ a(() => {
510
- if (t(this, U) > 0 && t(this, A) > 0) {
511
- const i = Math.ceil(t(this, U) / t(this, A));
510
+ if (t(this, U) > 0 && t(this, k) > 0) {
511
+ const i = Math.ceil(t(this, U) / t(this, k));
512
512
  b(this, J, i + 20);
513
513
  } else
514
514
  b(this, J, 40);
@@ -538,7 +538,7 @@ const se = class se {
538
538
  const n = s.querySelector("thead");
539
539
  n && (r += n.offsetHeight || n.getBoundingClientRect().height);
540
540
  const l = Math.max(o - r, 100);
541
- t(this, U) !== l && (b(this, U, l), t(this, ct).call(this), t(this, A) !== null && t(this, ht).call(this));
541
+ t(this, U) !== l && (b(this, U, l), t(this, ct).call(this), t(this, k) !== null && t(this, ht).call(this));
542
542
  }
543
543
  }
544
544
  })), t(this, z).observe(t(this, w)));
@@ -551,7 +551,7 @@ const se = class se {
551
551
  }, "#renderAllContainers"));
552
552
  h(this, Q, /* @__PURE__ */ a((i) => {
553
553
  var r;
554
- const e = t(this, A);
554
+ const e = t(this, k);
555
555
  if (!e || e <= 0) return;
556
556
  const s = Math.max(0, Math.floor(i / e)), o = ((r = t(this, M).get(".ng-container-body")) == null ? void 0 : r.length) || 1;
557
557
  [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
@@ -577,14 +577,14 @@ const se = class se {
577
577
  b(this, X, i.getRootNode().host), b(this, w, i), t(this, At).call(this);
578
578
  }
579
579
  getRowHeight() {
580
- return t(this, A);
580
+ return t(this, k);
581
581
  }
582
582
  templateLength(i = ".ng-container-body") {
583
583
  var e;
584
584
  return ((e = t(this, M).get(i)) == null ? void 0 : e.length) || 1;
585
585
  }
586
586
  };
587
- X = new WeakMap(), w = new WeakMap(), M = new WeakMap(), A = new WeakMap(), z = new WeakMap(), U = new WeakMap(), J = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), at = new WeakMap(), ct = new WeakMap(), Rt = new WeakMap(), At = new WeakMap(), ht = new WeakMap(), Q = new WeakMap(), kt = new WeakMap(), a(se, "RowManager");
587
+ X = new WeakMap(), w = new WeakMap(), M = new WeakMap(), k = new WeakMap(), z = new WeakMap(), U = new WeakMap(), J = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), at = new WeakMap(), ct = new WeakMap(), Rt = new WeakMap(), At = new WeakMap(), ht = new WeakMap(), Q = new WeakMap(), kt = new WeakMap(), a(se, "RowManager");
588
588
  let Ut = se;
589
589
  var qt, tt, j, Tt, Lt, Ht, Ct, _t;
590
590
  const ot = class ot extends HTMLElement {
@@ -947,29 +947,29 @@ const oe = class oe {
947
947
  };
948
948
  et = new WeakMap(), R = new WeakMap(), ft = new WeakMap(), It = new WeakMap(), a(oe, "ngFields");
949
949
  let Ft = oe;
950
- var k, $t, ut, Wt;
950
+ var A, $t, ut, Wt;
951
951
  const re = class re {
952
952
  constructor(i) {
953
- h(this, k);
953
+ h(this, A);
954
954
  h(this, $t, /* @__PURE__ */ a(() => {
955
- t(this, Wt).call(this), new ResizeObserver((i) => {
955
+ t(this, A).fields = new Ft(t(this, A)), t(this, Wt).call(this), new ResizeObserver((i) => {
956
956
  for (let e of i)
957
- t(this, k).getAttribute("auto-height") === "true" && t(this, ut).call(this);
958
- }).observe(t(this, k));
957
+ t(this, A).getAttribute("auto-height") === "true" && t(this, ut).call(this);
958
+ }).observe(t(this, A));
959
959
  }, "#init"));
960
960
  h(this, ut, /* @__PURE__ */ a(() => {
961
961
  var c, d;
962
- const i = Array.from(t(this, k).shadowRoot.querySelectorAll("nine-table-sheet.active"));
962
+ const i = Array.from(t(this, A).shadowRoot.querySelectorAll("nine-table-sheet.active"));
963
963
  if (i.length === 0) return;
964
- const e = parseInt(t(this, k).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), o = (c = t(this, k).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, r = (d = t(this, k).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : d.getBoundingClientRect().height, n = pt.SCROLLBAR_SIZE, l = e * s + o + r + n;
965
- t(this, k).style.height = `${l}px`;
964
+ const e = parseInt(t(this, A).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), o = (c = t(this, A).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, r = (d = t(this, A).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : d.getBoundingClientRect().height, n = pt.SCROLLBAR_SIZE, l = e * s + o + r + n;
965
+ t(this, A).style.height = `${l}px`;
966
966
  }, "#applyAutoHeight"));
967
967
  h(this, Wt, /* @__PURE__ */ a(() => {
968
- const e = Array.from(t(this, k).children).filter((c) => c.tagName === "TABLE"), s = t(this, k).getAttribute("auto-height") === "true", o = e.length, r = e.map((c, d) => {
968
+ const e = Array.from(t(this, A).children).filter((c) => c.tagName === "TABLE"), s = t(this, A).getAttribute("auto-height") === "true", o = e.length, r = e.map((c, d) => {
969
969
  const u = `<nine-table-sheet class="${d === 0 ? "active" : ""}" data-index="${d}"></nine-table-sheet>`, g = d < o - 1 ? `<nine-splitter class="h" data-split-index="${d}"></nine-splitter>` : "";
970
970
  return u + g;
971
971
  }).join(""), n = e.map((c, d) => `<div class="nine-tab-item ${d === 0 ? "active" : ""}" data-index="${d}">Sheet ${d + 1}</div>`).join("");
972
- t(this, k).shadowRoot.innerHTML = `
972
+ t(this, A).shadowRoot.innerHTML = `
973
973
  <style>
974
974
  :host {
975
975
  display: flex;
@@ -1068,17 +1068,17 @@ const re = class re {
1068
1068
  </nine-table-body>
1069
1069
  <nine-table-footer></nine-table-footer>
1070
1070
  `;
1071
- const l = t(this, k).shadowRoot.querySelectorAll("nine-table-sheet");
1071
+ const l = t(this, A).shadowRoot.querySelectorAll("nine-table-sheet");
1072
1072
  l == null || l.forEach((c, d) => {
1073
1073
  e[d] && setTimeout(() => {
1074
1074
  c.generate(e[d]), s && t(this, ut).call(this);
1075
1075
  });
1076
1076
  });
1077
1077
  }, "#render"));
1078
- b(this, k, i), t(this, $t).call(this);
1078
+ b(this, A, i), t(this, $t).call(this);
1079
1079
  }
1080
1080
  };
1081
- k = new WeakMap(), $t = new WeakMap(), ut = new WeakMap(), Wt = new WeakMap(), a(re, "LayoutManager");
1081
+ A = new WeakMap(), $t = new WeakMap(), ut = new WeakMap(), Wt = new WeakMap(), a(re, "LayoutManager");
1082
1082
  let Kt = re;
1083
1083
  var bt, it;
1084
1084
  const le = class le {
@@ -1276,7 +1276,7 @@ const ce = class ce extends HTMLElement {
1276
1276
  //#created = false;
1277
1277
  h(this, Z);
1278
1278
  h(this, Bt);
1279
- this.fields = new Ft(this), this.attachShadow({ mode: "open" }), b(this, Z, new Jt(this));
1279
+ this.attachShadow({ mode: "open" }), b(this, Z, new Jt(this));
1280
1280
  }
1281
1281
  connectedCallback() {
1282
1282
  b(this, Bt, new Kt(this)), I.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));