@ninebone/table 0.0.612 → 0.0.614

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.
@@ -201,24 +201,24 @@ const Me = class Me extends HTMLElement {
201
201
  B = new WeakMap(), j = new WeakMap(), w = new WeakMap(), X = new WeakMap(), K = new WeakMap(), Z = new WeakMap(), It = new WeakMap(), G = new WeakMap(), _t = new WeakMap(), c(Me, "NineTableHScrollBar");
202
202
  let ae = Me;
203
203
  customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ae);
204
- var F, at, J, R, vt, xt, Nt;
204
+ var F, at, J, T, vt, xt, Nt;
205
205
  const $e = class $e extends HTMLElement {
206
206
  constructor() {
207
207
  super();
208
208
  d(this, F);
209
209
  d(this, at);
210
210
  d(this, J, !1);
211
- d(this, R);
211
+ d(this, T);
212
212
  d(this, vt, 0);
213
213
  d(this, xt, 0);
214
214
  E(this, "refresh", /* @__PURE__ */ c(() => {
215
- if (!t(this, F) || !t(this, R)) return;
216
- const e = t(this, R).container, s = t(this, R).track, r = t(this, R).thumb, n = e.clientHeight, a = (t(this, F).data.get() || []).length, h = t(this, at).getRowHeight(), l = a * h;
217
- if (l <= n) {
218
- r.style.display = "none", t(this, R).top.disabled = !0, t(this, R).bottom.disabled = !0;
215
+ if (!t(this, F) || !t(this, T)) return;
216
+ const e = t(this, T).container, s = t(this, T).track, r = t(this, T).thumb, n = e.clientHeight, a = (t(this, F).data.get() || []).length, h = t(this, at).getRowHeight(), l = a * h;
217
+ if (l <= n || a === 0) {
218
+ this.style.display = "none";
219
219
  return;
220
220
  } else
221
- r.style.display = "block";
221
+ this.style.display = "flex";
222
222
  const f = s.clientHeight;
223
223
  if (f <= 0) return;
224
224
  const u = Math.max(Math.min(f * (n / l), f), 20);
@@ -227,22 +227,22 @@ const $e = class $e extends HTMLElement {
227
227
  let m = 0;
228
228
  b > 0 && (m = g / b * (f - u));
229
229
  const x = f - u;
230
- m < 0 && (m = 0), m > x && (m = x), r.style.top = `${m}px`, t(this, R).top.disabled = g <= 0, t(this, R).bottom.disabled = g >= b - 1;
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
233
  W.log("nine-table-vscrollbar.#init");
234
- const e = t(this, R).container, s = /* @__PURE__ */ c(() => {
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;
237
237
  }, "getContentHeight");
238
238
  e.addEventListener("scroll", () => {
239
239
  t(this, J) || this.refresh();
240
- }), t(this, R).thumb.addEventListener("mousedown", (r) => {
240
+ }), t(this, T).thumb.addEventListener("mousedown", (r) => {
241
241
  if (r.button !== 0) return;
242
242
  r.stopPropagation(), r.preventDefault(), y(this, J, !0), y(this, vt, r.clientY), y(this, xt, e.scrollTop);
243
243
  const n = /* @__PURE__ */ c((a) => {
244
244
  if (!t(this, J)) return;
245
- const h = t(this, R).track.getBoundingClientRect(), l = t(this, R).thumb.clientHeight, u = h.height - l, g = a.clientY - t(this, vt), b = e.clientHeight, m = s(), x = Math.max(m - b, 1);
245
+ const h = t(this, T).track.getBoundingClientRect(), l = t(this, T).thumb.clientHeight, u = h.height - l, g = a.clientY - t(this, vt), b = e.clientHeight, m = s(), x = Math.max(m - b, 1);
246
246
  if (u > 0 && x > 0) {
247
247
  const A = g / u * x;
248
248
  let v = t(this, xt) + A;
@@ -254,17 +254,17 @@ const $e = class $e extends HTMLElement {
254
254
  y(this, J, !1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), this.refresh();
255
255
  }, "onMouseUp");
256
256
  document.addEventListener("mousemove", n), document.addEventListener("mouseup", o);
257
- }), t(this, R).track.addEventListener("mousedown", (r) => {
258
- if (r.button !== 0 || r.target === t(this, R).thumb) return;
259
- const n = t(this, R).track.getBoundingClientRect(), o = t(this, R).thumb.clientHeight, a = r.clientY - n.top - o / 2, l = n.height - o, f = e.clientHeight, u = s(), g = Math.max(u - f, 1);
257
+ }), t(this, T).track.addEventListener("mousedown", (r) => {
258
+ if (r.button !== 0 || r.target === t(this, T).thumb) return;
259
+ const n = t(this, T).track.getBoundingClientRect(), o = t(this, T).thumb.clientHeight, a = r.clientY - n.top - o / 2, l = n.height - o, f = e.clientHeight, u = s(), g = Math.max(u - f, 1);
260
260
  if (l > 0 && g > 0) {
261
261
  const b = Math.max(0, Math.min(1, a / l));
262
262
  e.scrollTop = b * g;
263
263
  }
264
264
  this.refresh();
265
- }), t(this, R).top.addEventListener("click", () => {
265
+ }), t(this, T).top.addEventListener("click", () => {
266
266
  e.scrollTop -= 40;
267
- }), t(this, R).bottom.addEventListener("click", () => {
267
+ }), t(this, T).bottom.addEventListener("click", () => {
268
268
  e.scrollTop += 40;
269
269
  });
270
270
  }, "#init"));
@@ -340,7 +340,7 @@ const $e = class $e extends HTMLElement {
340
340
  setTimeout(e, 10);
341
341
  return;
342
342
  }
343
- y(this, R, {
343
+ y(this, T, {
344
344
  container: s,
345
345
  track: this.querySelector(".ng-scroll-track"),
346
346
  thumb: this.querySelector(".ng-scroll-thumb"),
@@ -351,7 +351,7 @@ const $e = class $e extends HTMLElement {
351
351
  e();
352
352
  }
353
353
  };
354
- F = new WeakMap(), at = new WeakMap(), J = new WeakMap(), R = new WeakMap(), vt = new WeakMap(), xt = new WeakMap(), Nt = new WeakMap(), c($e, "NineTableVScrollBar");
354
+ F = new WeakMap(), at = new WeakMap(), J = new WeakMap(), T = new WeakMap(), vt = new WeakMap(), xt = new WeakMap(), Nt = new WeakMap(), c($e, "NineTableVScrollBar");
355
355
  let le = $e;
356
356
  customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", le);
357
357
  var P, S, Q, D, I, V, tt, wt, Se, Ae, Wt, Ot, zt, St, At, Bt, Dt, Et, Ee, lt, qt, Pt;
@@ -467,8 +467,8 @@ const Ie = class Ie {
467
467
  ((a = b[v]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
468
468
  ((h = m[v]) == null ? void 0 : h.getBoundingClientRect().height) || 0,
469
469
  ((l = x[v]) == null ? void 0 : l.getBoundingClientRect().height) || 0
470
- ], T = Math.max(...M);
471
- T > 0 && (b[v] && (b[v].style.height = `${T}px`), m[v] && (m[v].style.height = `${T}px`), x[v] && (x[v].style.height = `${T}px`));
470
+ ], R = Math.max(...M);
471
+ R > 0 && (b[v] && (b[v].style.height = `${R}px`), m[v] && (m[v].style.height = `${R}px`), x[v] && (x[v].style.height = `${R}px`));
472
472
  }
473
473
  }
474
474
  const r = t(this, S).querySelector(".ng-container-left .ng-part-footer table"), n = t(this, S).querySelector(".ng-container-body .ng-part-footer table"), o = t(this, S).querySelector(".ng-container-right .ng-part-footer table");
@@ -479,8 +479,8 @@ const Ie = class Ie {
479
479
  ((f = b[v]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
480
480
  ((u = m[v]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
481
481
  ((g = x[v]) == null ? void 0 : g.getBoundingClientRect().height) || 0
482
- ], T = Math.max(...M);
483
- T > 0 && (b[v] && (b[v].style.height = `${T}px`), m[v] && (m[v].style.height = `${T}px`), x[v] && (x[v].style.height = `${T}px`));
482
+ ], R = Math.max(...M);
483
+ R > 0 && (b[v] && (b[v].style.height = `${R}px`), m[v] && (m[v].style.height = `${R}px`), x[v] && (x[v].style.height = `${R}px`));
484
484
  }
485
485
  }
486
486
  }, "#syncRowHeights"));
@@ -545,8 +545,8 @@ const Ie = class Ie {
545
545
  A.style.display = "none";
546
546
  return;
547
547
  }
548
- const T = t(this, P).data.get(M);
549
- A.style.display = "", t(this, qt).call(this, A, T, M);
548
+ const R = t(this, P).data.get(M);
549
+ A.style.display = "", t(this, qt).call(this, A, R, M);
550
550
  });
551
551
  });
552
552
  }, "#handleScroll"));
@@ -653,9 +653,9 @@ const jt = class jt {
653
653
  A = z;
654
654
  break;
655
655
  }
656
- const M = v.rowSpan || 1, T = v.colSpan || 1;
656
+ const M = v.rowSpan || 1, R = v.colSpan || 1;
657
657
  for (let z = 0; z < M; z++)
658
- for (let yt = 0; yt < T; yt++)
658
+ for (let yt = 0; yt < R; yt++)
659
659
  x + z < u && A + yt < g && (b[x + z][A + yt] = z === 0 && yt === 0 ? "1" : "0");
660
660
  });
661
661
  }), l.forEach((m) => {
@@ -714,14 +714,10 @@ const pt = class pt extends HTMLElement {
714
714
  E(this, "generate", /* @__PURE__ */ c((e) => {
715
715
  if (!e) return;
716
716
  y(this, et, he.compile(e)), t(this, Vt).call(this), t(this, Yt).call(this);
717
- const s = this.querySelector(".ng-container-body .ng-part-header"), r = this.querySelector(".ng-nodata-overlay");
718
- if (s && r) {
719
- const n = s.offsetHeight;
720
- r.style.top = `${n}px`, r.style.height = `calc(100% - ${n}px)`;
721
- }
722
- t(this, st).initialize(), setTimeout(() => {
723
- var n;
724
- (n = this.querySelector("nine-table-hscrollbar")) == null || n.refresh();
717
+ 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");
718
+ s && n && (n.style.top = `${s.offsetHeight}px`), r && n && (n.style.bottom = `${r.offsetHeight}px`), t(this, st).initialize(), setTimeout(() => {
719
+ var o;
720
+ (o = this.querySelector("nine-table-hscrollbar")) == null || o.refresh();
725
721
  }, 0);
726
722
  }, "generate"));
727
723
  d(this, ct, /* @__PURE__ */ c((e, s, r) => {
@@ -1107,9 +1103,8 @@ const Ne = class Ne {
1107
1103
  position: absolute;
1108
1104
  left: 0;
1109
1105
  right: 0;
1110
- bottom: 0;
1111
1106
  background: #ffffff;
1112
- z-index: 10;
1107
+ z-index: 0;
1113
1108
  align-items: center;
1114
1109
  justify-content: center;
1115
1110
  font-size: 12px;
@@ -1510,8 +1505,8 @@ const De = class De extends me {
1510
1505
  if (e && (e = parseInt(e)), e && !isNaN(e)) {
1511
1506
  var s = t(this, p).closest("tr"), r = [];
1512
1507
  $("th,td", s).each((v, M) => {
1513
- var T = ninegrid.j.querySelectorAll(M).attr("suppress");
1514
- T && M.dataset.row && (T = parseInt(T), !isNaN(T) && T <= e && r.push(T));
1508
+ var R = ninegrid.j.querySelectorAll(M).attr("suppress");
1509
+ R && M.dataset.row && (R = parseInt(R), !isNaN(R) && R <= e && r.push(R));
1515
1510
  }), r.sort();
1516
1511
  var n = !1;
1517
1512
  if (parseInt(s.sectionRowIndex / t(this, C).template.length) > 0)