@ninebone/table 0.0.794 → 0.0.796

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.
@@ -44,43 +44,43 @@ const es = class es extends HTMLElement {
44
44
  if (!t(this, j) || !t(this, E) || t(this, G)) return;
45
45
  const e = t(this, E).container, s = e.querySelector("table");
46
46
  if (!s) return;
47
- const r = t(this, E).track, i = t(this, E).thumb, o = t(this, j).querySelector(".ng-container-bottom"), a = e.clientWidth, c = s.scrollWidth;
48
- if (a !== 0 && c > a)
49
- o && (o.style.display = "flex");
47
+ const r = t(this, E).track, o = t(this, E).thumb, i = t(this, j).querySelector(".ng-container-bottom"), a = e.clientWidth, l = s.scrollWidth;
48
+ if (a !== 0 && l > a)
49
+ i && (i.style.display = "flex");
50
50
  else {
51
- o && (o.style.display = "none");
51
+ i && (i.style.display = "none");
52
52
  return;
53
53
  }
54
- const l = r.clientWidth;
55
- if (l <= 0) return;
56
- const g = Math.max(Math.min(l * (a / c), l), 20);
57
- i.style.width = `${g}px`;
58
- const f = e.scrollLeft, b = c - a;
59
- let u = 0;
60
- b > 0 && (u = parseInt(f / b * (l - g), 10)), u < 0 && (u = 0);
61
- const p = l - g;
62
- u > p && (u = p), i.style.left = `${u}px`, t(this, E).left.disabled = u === 0, t(this, E).right.disabled = u >= p - 1;
54
+ const c = r.clientWidth;
55
+ if (c <= 0) return;
56
+ const u = Math.max(Math.min(c * (a / l), c), 20);
57
+ o.style.width = `${u}px`;
58
+ const f = e.scrollLeft, b = l - a;
59
+ let g = 0;
60
+ b > 0 && (g = parseInt(f / b * (c - u), 10)), g < 0 && (g = 0);
61
+ const p = c - u;
62
+ g > p && (g = p), o.style.left = `${g}px`, t(this, E).left.disabled = g === 0, t(this, E).right.disabled = g >= p - 1;
63
63
  }, "refresh"));
64
64
  d(this, nt, /* @__PURE__ */ h((e) => {
65
65
  if (!t(this, E)) return !1;
66
66
  const s = t(this, E).container, r = s.querySelector("table");
67
67
  if (!r) return !1;
68
- const i = t(this, E).track.getBoundingClientRect(), o = t(this, E).thumb.clientWidth;
68
+ const o = t(this, E).track.getBoundingClientRect(), i = t(this, E).thumb.clientWidth;
69
69
  let a = e;
70
70
  a < 0 && (a = 0);
71
- const c = i.width - o;
72
- a > c && (a = c), a = parseInt(a, 10), t(this, E).thumb.style.left = `${a}px`, S.log("1111=========="), t(this, E).left.disabled = a === 0, t(this, E).right.disabled = a >= c - 1;
73
- const l = s.clientWidth, f = r.scrollWidth - l;
74
- return c > 0 && f > 0 && (s.scrollLeft = a / c * f), a > 0 && a < c - 1;
71
+ const l = o.width - i;
72
+ a > l && (a = l), a = parseInt(a, 10), t(this, E).thumb.style.left = `${a}px`, S.log("1111=========="), t(this, E).left.disabled = a === 0, t(this, E).right.disabled = a >= l - 1;
73
+ const c = s.clientWidth, f = r.scrollWidth - c;
74
+ return l > 0 && f > 0 && (s.scrollLeft = a / l * f), a > 0 && a < l - 1;
75
75
  }, "#thumbMoveTo"));
76
76
  d(this, Qt, /* @__PURE__ */ h(() => {
77
77
  const e = /* @__PURE__ */ h((r) => {
78
78
  clearInterval(t(this, tt)), clearInterval(t(this, et));
79
- const i = parseInt(t(this, E).thumb.style.left || 0, 10);
80
- t(this, nt).call(this, i + r), y(this, tt, setInterval(() => {
79
+ const o = parseInt(t(this, E).thumb.style.left || 0, 10);
80
+ t(this, nt).call(this, o + r), y(this, tt, setInterval(() => {
81
81
  clearInterval(t(this, tt)), y(this, et, setInterval(() => {
82
- const o = parseInt(t(this, E).thumb.style.left || 0, 10);
83
- t(this, nt).call(this, o + r) || clearInterval(t(this, et));
82
+ const i = parseInt(t(this, E).thumb.style.left || 0, 10);
83
+ t(this, nt).call(this, i + r) || clearInterval(t(this, et));
84
84
  }, 50));
85
85
  }, 500));
86
86
  }, "delayScroll"), s = /* @__PURE__ */ h(() => {
@@ -95,19 +95,19 @@ const es = class es extends HTMLElement {
95
95
  }), t(this, E).left.addEventListener("touchstart", () => e(-20)), t(this, E).right.addEventListener("touchstart", () => e(20)), t(this, E).track.addEventListener("mousedown", (r) => {
96
96
  if (r.button !== 0) return;
97
97
  r.preventDefault();
98
- const i = t(this, E).track.getBoundingClientRect(), o = t(this, E).thumb.clientWidth;
99
- t(this, nt).call(this, r.clientX - i.left - o / 2);
98
+ const o = t(this, E).track.getBoundingClientRect(), i = t(this, E).thumb.clientWidth;
99
+ t(this, nt).call(this, r.clientX - o.left - i / 2);
100
100
  }), t(this, E).thumb.addEventListener("mousedown", (r) => {
101
101
  if (r.button !== 0) return;
102
102
  r.stopPropagation(), r.preventDefault(), y(this, G, !0), this.shiftX = r.clientX - t(this, E).thumb.getBoundingClientRect().left;
103
- const i = /* @__PURE__ */ h((a) => {
103
+ const o = /* @__PURE__ */ h((a) => {
104
104
  if (!t(this, G)) return;
105
- const c = t(this, E).track.getBoundingClientRect();
106
- t(this, nt).call(this, a.clientX - c.left - this.shiftX);
107
- }, "onMouseMove"), o = /* @__PURE__ */ h(() => {
108
- y(this, G, !1), s(), document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", o), this.refresh();
105
+ const l = t(this, E).track.getBoundingClientRect();
106
+ t(this, nt).call(this, a.clientX - l.left - this.shiftX);
107
+ }, "onMouseMove"), i = /* @__PURE__ */ h(() => {
108
+ y(this, G, !1), s(), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", i), this.refresh();
109
109
  }, "onMouseUp");
110
- document.addEventListener("mousemove", i), document.addEventListener("mouseup", o);
110
+ document.addEventListener("mousemove", o), document.addEventListener("mouseup", i);
111
111
  });
112
112
  }, "#init"));
113
113
  }
@@ -213,52 +213,52 @@ const ss = class ss extends HTMLElement {
213
213
  d(this, It, 0);
214
214
  q(this, "refresh", /* @__PURE__ */ h(() => {
215
215
  if (S.log("vscrollbar.refresh"), !t(this, rt) || !t(this, k)) return;
216
- const e = t(this, k).container, s = t(this, k).track, r = t(this, k).thumb, i = e.clientHeight, o = t(this, rt).data.length, a = t(this, ot).getRowHeight(), c = o * a;
217
- if (c <= i || o === 0) {
216
+ const e = t(this, k).container, s = t(this, k).track, r = t(this, k).thumb, o = e.clientHeight, i = t(this, rt).data.length, a = t(this, ot).getRowHeight(), l = i * a;
217
+ if (l <= o || i === 0) {
218
218
  this.style.display = "none";
219
219
  return;
220
220
  } else
221
221
  this.style.display = "flex";
222
- const l = s.clientHeight;
223
- if (l <= 0) return;
224
- const g = Math.max(Math.min(l * (i / c), l), 20);
225
- r.style.height = `${g}px`;
226
- const f = e.scrollTop, b = Math.max(c - i, 1);
222
+ const c = s.clientHeight;
223
+ if (c <= 0) return;
224
+ const u = Math.max(Math.min(c * (o / l), c), 20);
225
+ r.style.height = `${u}px`;
226
+ const f = e.scrollTop, b = Math.max(l - o, 1);
227
227
  S.log(e, f, b);
228
- let u = 0;
229
- b > 0 && (u = f / b * (l - g));
230
- const p = l - g;
231
- u < 0 && (u = 0), u > p && (u = p), r.style.top = `${u}px`, t(this, k).top.disabled = f <= 0, t(this, k).bottom.disabled = f >= b - 1;
228
+ let g = 0;
229
+ b > 0 && (g = f / b * (c - u));
230
+ const p = c - u;
231
+ g < 0 && (g = 0), g > p && (g = p), r.style.top = `${g}px`, t(this, k).top.disabled = f <= 0, t(this, k).bottom.disabled = f >= b - 1;
232
232
  }, "refresh"));
233
233
  d(this, te, /* @__PURE__ */ h(() => {
234
234
  S.log("nine-table-vscrollbar.#init");
235
235
  const e = t(this, k).container, s = /* @__PURE__ */ h(() => {
236
- const i = (t(this, rt).data.get() || []).length, o = t(this, ot).getRowHeight();
237
- return i * o;
236
+ const o = (t(this, rt).data.get() || []).length, i = t(this, ot).getRowHeight();
237
+ return o * i;
238
238
  }, "getContentHeight");
239
239
  t(this, k).thumb.addEventListener("mousedown", (r) => {
240
240
  if (r.button !== 0) return;
241
241
  r.stopPropagation(), r.preventDefault(), y(this, yt, !0), y(this, kt, r.clientY), y(this, It, e.scrollTop);
242
- const i = /* @__PURE__ */ h((a) => {
242
+ const o = /* @__PURE__ */ h((a) => {
243
243
  if (!t(this, yt)) return;
244
- const c = t(this, k).track.getBoundingClientRect(), l = t(this, k).thumb.clientHeight, f = c.height - l, b = a.clientY - t(this, kt), u = e.clientHeight, p = s(), x = Math.max(p - u, 1);
244
+ const l = t(this, k).track.getBoundingClientRect(), c = t(this, k).thumb.clientHeight, f = l.height - c, b = a.clientY - t(this, kt), g = e.clientHeight, p = s(), x = Math.max(p - g, 1);
245
245
  if (f > 0 && x > 0) {
246
246
  const w = b / f * x;
247
247
  let m = t(this, It) + w;
248
- const T = Math.max(0, p - u);
248
+ const T = Math.max(0, p - g);
249
249
  m < 0 && (m = 0), m > T && (m = T), e.scrollTop = m;
250
250
  }
251
251
  this.refresh();
252
- }, "onMouseMove"), o = /* @__PURE__ */ h(() => {
253
- y(this, yt, !1), document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", o), this.refresh();
252
+ }, "onMouseMove"), i = /* @__PURE__ */ h(() => {
253
+ y(this, yt, !1), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", i), this.refresh();
254
254
  }, "onMouseUp");
255
- document.addEventListener("mousemove", i), document.addEventListener("mouseup", o);
255
+ document.addEventListener("mousemove", o), document.addEventListener("mouseup", i);
256
256
  }), t(this, k).track.addEventListener("mousedown", (r) => {
257
257
  if (r.button !== 0 || r.target === t(this, k).thumb) return;
258
- const i = t(this, k).track.getBoundingClientRect(), o = t(this, k).thumb.clientHeight, a = r.clientY - i.top - o / 2, l = i.height - o, g = e.clientHeight, f = s(), b = Math.max(f - g, 1);
259
- if (l > 0 && b > 0) {
260
- const u = Math.max(0, Math.min(1, a / l));
261
- e.scrollTop = u * b;
258
+ const o = t(this, k).track.getBoundingClientRect(), i = t(this, k).thumb.clientHeight, a = r.clientY - o.top - i / 2, c = o.height - i, u = e.clientHeight, f = s(), b = Math.max(f - u, 1);
259
+ if (c > 0 && b > 0) {
260
+ const g = Math.max(0, Math.min(1, a / c));
261
+ e.scrollTop = g * b;
262
262
  }
263
263
  this.refresh();
264
264
  }), t(this, k).top.addEventListener("click", () => {
@@ -379,30 +379,30 @@ const ns = class ns {
379
379
  scrollTables: t(this, A).querySelectorAll(".ng-part-body table"),
380
380
  firstTr: t(this, A).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
381
381
  }), y(this, O, null), t(this, Y).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
382
- const a = t(this, A).querySelector(o);
382
+ const i = t(this, A).querySelector(o);
383
+ if (!i) return;
384
+ const a = i.querySelector(".ng-part-body table");
383
385
  if (!a) return;
384
- const c = a.querySelector(".ng-part-body table");
385
- if (!c) return;
386
- const l = c.querySelector("tbody.bindable-tbody");
386
+ const l = a.querySelector("tbody.bindable-tbody");
387
387
  if (!l) return;
388
- const f = Array.from(l.querySelectorAll("tr")).map((b) => b.cloneNode(!0));
389
- t(this, Y).set(o, f);
388
+ const u = Array.from(l.querySelectorAll("tr")).map((f) => f.cloneNode(!0));
389
+ t(this, Y).set(o, u);
390
390
  });
391
- const n = t(this, A).querySelector(".ng-container-body .ng-part-body"), e = t(this, A).querySelector(".ng-container-left .ng-part-body"), s = t(this, A).querySelector(".ng-container-right .ng-part-body"), r = t(this, A).querySelector(".ng-container-body .ng-part-header"), i = t(this, A).querySelector(".ng-container-body .ng-part-footer");
392
- if (n) {
391
+ const n = t(this, A).querySelector(".ng-container-body .ng-part-body"), e = t(this, A).querySelector(".ng-container-left .ng-part-body"), s = t(this, A).querySelector(".ng-container-right .ng-part-body"), r = t(this, A).querySelector(".ng-container-body .ng-part-header");
392
+ if (t(this, A).querySelector(".ng-container-body .ng-part-footer"), n) {
393
393
  t(this, Mt).call(this), t(this, Nt).call(this), t(this, Ht).call(this), t(this, mt).call(this, n.scrollTop);
394
394
  let o = !1;
395
395
  n.scrollTop, n.scrollLeft;
396
- const a = /* @__PURE__ */ h((c) => {
397
- var f;
396
+ const i = /* @__PURE__ */ h((a) => {
397
+ var c;
398
398
  if (o) return;
399
399
  o = !0;
400
- const l = c.scrollTop, g = c.scrollLeft;
401
- n && n.scrollTop !== l && (n.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), g != 0 && r && r.scrollLeft !== g && (r.scrollLeft = g), S.log("======", r.scrollLeft, g), i && i.scrollLeft !== g && (i.scrollLeft = g), t(this, mt).call(this, l), (f = t(this, A).querySelector("nine-table-vscrollbar")) == null || f.refresh(), o = !1;
400
+ const l = a.scrollTop;
401
+ a.scrollLeft, S.log("======", r.scrollLeft), n && n.scrollTop !== l && (n.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), t(this, mt).call(this, l), (c = t(this, A).querySelector("nine-table-vscrollbar")) == null || c.refresh(), o = !1;
402
402
  }, "handleContainerScroll");
403
- [n, e, s].forEach((c) => {
404
- c == null || c.addEventListener("scroll", (l) => {
405
- S.log(l), S.log("rowManager.scroll event"), a(c);
403
+ [n, e, s].forEach((a) => {
404
+ a == null || a.addEventListener("scroll", (l) => {
405
+ S.log(l), S.log("rowManager.scroll event"), i(a);
406
406
  });
407
407
  });
408
408
  }
@@ -414,12 +414,12 @@ const ns = class ns {
414
414
  const r = n.querySelector(".ng-part-body tbody.bindable-tbody");
415
415
  if (!r) return;
416
416
  r.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
417
- const i = r.querySelector("tr.nodata"), o = document.createDocumentFragment();
417
+ const o = r.querySelector("tr.nodata"), i = document.createDocumentFragment();
418
418
  for (let a = 0; a < t(this, Lt); a++)
419
- s.forEach((c) => {
420
- o.appendChild(c.cloneNode(!0));
419
+ s.forEach((l) => {
420
+ i.appendChild(l.cloneNode(!0));
421
421
  });
422
- i ? i.before(o) : r.appendChild(o), e === ".ng-container-body" && (t(this, it).firstTr = r.querySelector("tr:not(.nodata)"));
422
+ o ? o.before(i) : r.appendChild(i), e === ".ng-container-body" && (t(this, it).firstTr = r.querySelector("tr:not(.nodata)"));
423
423
  }, "#renderRows"));
424
424
  d(this, Mt, /* @__PURE__ */ h(() => {
425
425
  if (t(this, O) !== null && t(this, O) > 0)
@@ -431,30 +431,30 @@ const ns = class ns {
431
431
  const s = n.querySelector("tbody.bindable-tbody");
432
432
  if (S.log(s), !s) throw new Error("invalid dom");
433
433
  s.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
434
- const r = s.querySelector("tr.nodata"), i = document.createDocumentFragment();
434
+ const r = s.querySelector("tr.nodata"), o = document.createDocumentFragment();
435
435
  e.forEach((b) => {
436
- i.appendChild(b.cloneNode(!0));
437
- }), r ? r.before(i) : s.appendChild(i);
438
- const o = t(this, A), a = o.style.display, c = o.style.visibility, l = o.style.position;
439
- (a === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
440
- let g = 0;
436
+ o.appendChild(b.cloneNode(!0));
437
+ }), r ? r.before(o) : s.appendChild(o);
438
+ const i = t(this, A), a = i.style.display, l = i.style.visibility, c = i.style.position;
439
+ (a === "none" || window.getComputedStyle(i).display === "none") && (i.style.display = "block", i.style.visibility = "hidden", i.style.position = "absolute");
440
+ let u = 0;
441
441
  const f = s.querySelectorAll("tr");
442
442
  return f.forEach((b) => {
443
- let u = b.offsetHeight || b.getBoundingClientRect().height;
444
- if (u === 0) {
443
+ let g = b.offsetHeight || b.getBoundingClientRect().height;
444
+ if (g === 0) {
445
445
  const p = window.getComputedStyle(b);
446
- u = parseFloat(p.height) || parseFloat(p.minHeight) || 0;
446
+ g = parseFloat(p.height) || parseFloat(p.minHeight) || 0;
447
447
  }
448
- g += u;
449
- }), f.forEach((b) => b.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l, g <= 0 ? -1 : (y(this, O, g), t(this, $t).call(this), t(this, O));
448
+ u += g;
449
+ }), f.forEach((b) => b.remove()), i.style.display = a, i.style.visibility = l, i.style.position = c, u <= 0 ? -1 : (y(this, O, u), t(this, $t).call(this), t(this, O));
450
450
  }, "#measureAndCacheHeight"));
451
451
  d(this, Ht, /* @__PURE__ */ h(() => {
452
452
  S.log("rowManager.#updateVirtualScrollHeight");
453
453
  const e = (t(this, U).data.get() || []).length, s = t(this, O), r = e * s;
454
- S.log("🔍 [VirtualHeight]", { totalCount: e, rowHeight: s, totalVirtualHeight: r }), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
455
- const o = t(this, A).querySelector(i);
456
- if (!o) return;
457
- const a = o.querySelector(".ng-part-body .ng-virtual-spacer");
454
+ S.log("🔍 [VirtualHeight]", { totalCount: e, rowHeight: s, totalVirtualHeight: r }), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
455
+ const i = t(this, A).querySelector(o);
456
+ if (!i) return;
457
+ const a = i.querySelector(".ng-part-body .ng-virtual-spacer");
458
458
  a && (a.style.height = `${r}px`);
459
459
  });
460
460
  }, "#updateVirtualScrollHeight"));
@@ -465,29 +465,29 @@ const ns = class ns {
465
465
  }
466
466
  }, "#updateRowCount"));
467
467
  d(this, ne, /* @__PURE__ */ h(() => {
468
- var a, c, l, g, f, b;
468
+ var a, l, c, u, f, b;
469
469
  const n = t(this, A).querySelector(".ng-container-left .ng-part-body table"), e = t(this, A).querySelector(".ng-container-body .ng-part-body table"), s = t(this, A).querySelector(".ng-container-right .ng-part-body table");
470
470
  if (e) {
471
- const u = n ? Array.from(n.querySelectorAll("tbody tr")) : [], p = Array.from(e.querySelectorAll("tbody tr")), x = s ? Array.from(s.querySelectorAll("tbody tr")) : [], w = Math.max(u.length, p.length, x.length);
471
+ const g = n ? Array.from(n.querySelectorAll("tbody tr")) : [], p = Array.from(e.querySelectorAll("tbody tr")), x = s ? Array.from(s.querySelectorAll("tbody tr")) : [], w = Math.max(g.length, p.length, x.length);
472
472
  for (let m = 0; m < w; m++) {
473
473
  const T = [
474
- ((a = u[m]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
475
- ((c = p[m]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
476
- ((l = x[m]) == null ? void 0 : l.getBoundingClientRect().height) || 0
474
+ ((a = g[m]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
475
+ ((l = p[m]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
476
+ ((c = x[m]) == null ? void 0 : c.getBoundingClientRect().height) || 0
477
477
  ], R = Math.max(...T);
478
- R > 0 && (u[m] && (u[m].style.height = `${R}px`), p[m] && (p[m].style.height = `${R}px`), x[m] && (x[m].style.height = `${R}px`));
478
+ R > 0 && (g[m] && (g[m].style.height = `${R}px`), p[m] && (p[m].style.height = `${R}px`), x[m] && (x[m].style.height = `${R}px`));
479
479
  }
480
480
  }
481
- const r = t(this, A).querySelector(".ng-container-left .ng-part-footer table"), i = t(this, A).querySelector(".ng-container-body .ng-part-footer table"), o = t(this, A).querySelector(".ng-container-right .ng-part-footer table");
482
- if (i) {
483
- const u = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], p = Array.from(i.querySelectorAll("tfoot tr")), x = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], w = Math.max(u.length, p.length, x.length);
481
+ const r = t(this, A).querySelector(".ng-container-left .ng-part-footer table"), o = t(this, A).querySelector(".ng-container-body .ng-part-footer table"), i = t(this, A).querySelector(".ng-container-right .ng-part-footer table");
482
+ if (o) {
483
+ const g = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], p = Array.from(o.querySelectorAll("tfoot tr")), x = i ? Array.from(i.querySelectorAll("tfoot tr")) : [], w = Math.max(g.length, p.length, x.length);
484
484
  for (let m = 0; m < w; m++) {
485
485
  const T = [
486
- ((g = u[m]) == null ? void 0 : g.getBoundingClientRect().height) || 0,
486
+ ((u = g[m]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
487
487
  ((f = p[m]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
488
488
  ((b = x[m]) == null ? void 0 : b.getBoundingClientRect().height) || 0
489
489
  ], R = Math.max(...T);
490
- R > 0 && (u[m] && (u[m].style.height = `${R}px`), p[m] && (p[m].style.height = `${R}px`), x[m] && (x[m].style.height = `${R}px`));
490
+ R > 0 && (g[m] && (g[m].style.height = `${R}px`), p[m] && (p[m].style.height = `${R}px`), x[m] && (x[m].style.height = `${R}px`));
491
491
  }
492
492
  }
493
493
  }, "#syncRowHeights"));
@@ -498,11 +498,11 @@ const ns = class ns {
498
498
  if (!s.classList.contains("active")) continue;
499
499
  const r = e.contentRect.height;
500
500
  if (r > 0) {
501
- let i = 0;
502
- const o = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
503
- o && (i += o.offsetHeight), a && (i += a.offsetHeight);
504
- const c = Math.max(r - i, 100);
505
- t(this, at) !== c && (y(this, at, c), t(this, $t).call(this), t(this, O) !== null && (t(this, Nt).call(this), this.refresh()));
501
+ let o = 0;
502
+ const i = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
503
+ i && (o += i.offsetHeight), a && (o += a.offsetHeight);
504
+ const l = Math.max(r - o, 100);
505
+ t(this, at) !== l && (y(this, at, l), t(this, $t).call(this), t(this, O) !== null && (t(this, Nt).call(this), this.refresh()));
506
506
  }
507
507
  }
508
508
  })), t(this, Z).observe(t(this, A)));
@@ -515,20 +515,20 @@ const ns = class ns {
515
515
  }, "#renderAllContainers"));
516
516
  d(this, Ue, /* @__PURE__ */ h((n) => {
517
517
  [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
518
- var l;
518
+ var c;
519
519
  const s = t(this, A).querySelector(e);
520
520
  if (!s) return;
521
521
  const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
522
522
  if (!r) return;
523
- const i = Array.from(r.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this, Y).get(e)) == null ? void 0 : l.length) || 1, c = (t(this, U).data.get() || []).length;
524
- i.forEach((g, f) => {
525
- const b = n + Math.floor(f / o);
526
- if (b >= c) {
527
- g.style.visibility = "hidden";
523
+ const o = Array.from(r.querySelectorAll("tr:not(.nodata)")), i = ((c = t(this, Y).get(e)) == null ? void 0 : c.length) || 1, l = (t(this, U).data.get() || []).length;
524
+ o.forEach((u, f) => {
525
+ const b = n + Math.floor(f / i);
526
+ if (b >= l) {
527
+ u.style.visibility = "hidden";
528
528
  return;
529
529
  }
530
- const u = t(this, U).data.get(b);
531
- g.style.display = "", t(this, _t).call(this, g, u, b);
530
+ const g = t(this, U).data.get(b);
531
+ u.style.display = "", t(this, _t).call(this, u, g, b);
532
532
  });
533
533
  });
534
534
  }, "#adjustBufferRows"));
@@ -538,16 +538,16 @@ const ns = class ns {
538
538
  if (!e || e <= 0) return;
539
539
  const s = t(this, U).data.length;
540
540
  if (s === 0) return;
541
- const r = ((f = t(this, Y).get(".ng-container-body")) == null ? void 0 : f.length) || 1, i = t(this, A).querySelector(".ng-container-body .ng-part-body");
542
- S.log("bodyContainer.clientHeight", i.clientHeight);
543
- const o = Math.max(0, s - Math.floor(i.clientHeight / e)), a = Math.min(o, Math.max(0, Math.floor(n / e)));
544
- let c = Math.floor(a * e);
545
- S.log(`📜 [Scroll Calc] maxStartIndex: ${o}, startIndex: ${a}, offsetY: ${c}`), a === o && S.log(`📜 [Scroll Inspect] scrollTop: ${n}, rowHeight: ${e}, maxStartIndex: ${o}, startIndex: ${a}, offsetY: ${c}`);
546
- const l = t(this, it).firstTr, g = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
547
- (b = t(this, it)) == null || b.scrollTables.forEach((u) => {
548
- u.style.transform = `translate3d(0, ${c}px, 0)`;
549
- }), g !== a && (S.log(`🔄 [Row Bind Trigger] currentStartIndex(${g}) !== startIndex(${a})`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((u) => {
550
- const p = t(this, A).querySelector(u);
541
+ const r = ((f = t(this, Y).get(".ng-container-body")) == null ? void 0 : f.length) || 1, o = t(this, A).querySelector(".ng-container-body .ng-part-body");
542
+ S.log("bodyContainer.clientHeight", o.clientHeight);
543
+ const i = Math.max(0, s - Math.floor(o.clientHeight / e)), a = Math.min(i, Math.max(0, Math.floor(n / e)));
544
+ let l = Math.floor(a * e);
545
+ S.log(`📜 [Scroll Calc] maxStartIndex: ${i}, startIndex: ${a}, offsetY: ${l}`), a === i && S.log(`📜 [Scroll Inspect] scrollTop: ${n}, rowHeight: ${e}, maxStartIndex: ${i}, startIndex: ${a}, offsetY: ${l}`);
546
+ const c = t(this, it).firstTr, u = c && c.dataset.row !== void 0 ? parseInt(c.dataset.row, 10) : -1;
547
+ (b = t(this, it)) == null || b.scrollTables.forEach((g) => {
548
+ g.style.transform = `translate3d(0, ${l}px, 0)`;
549
+ }), u !== a && (S.log(`🔄 [Row Bind Trigger] currentStartIndex(${u}) !== startIndex(${a})`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
550
+ const p = t(this, A).querySelector(g);
551
551
  if (!p) return;
552
552
  const x = p.querySelector(".ng-part-body tbody.bindable-tbody");
553
553
  if (!x) return;
@@ -577,25 +577,25 @@ const ns = class ns {
577
577
  });
578
578
  }; */
579
579
  d(this, _t, /* @__PURE__ */ h((n, e, s) => {
580
- n.dataset.row = s, n.data = e, Array.from(n.cells).forEach((r, i) => {
580
+ n.dataset.row = s, n.data = e, Array.from(n.cells).forEach((r, o) => {
581
581
  r.dataset.row = s;
582
- const o = Array.from(r.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
583
- o && typeof o.refresh == "function" && o.refresh();
582
+ const i = Array.from(r.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
583
+ i && typeof i.refresh == "function" && i.refresh();
584
584
  });
585
585
  }, "#bindRowData"));
586
586
  d(this, oe, /* @__PURE__ */ h(() => {
587
- var c, l, g;
587
+ var l, c, u;
588
588
  S.log("rowManager.#syncHeaderHeights");
589
589
  const n = t(this, A).querySelector(".ng-container-left .ng-part-header table"), e = t(this, A).querySelector(".ng-container-body .ng-part-header table"), s = t(this, A).querySelector(".ng-container-right .ng-part-header table");
590
590
  if (!e) return;
591
- const r = n ? Array.from(n.querySelectorAll("tr")) : [], i = Array.from(e.querySelectorAll("tr")), o = s ? Array.from(s.querySelectorAll("tr")) : [], a = Math.max(r.length, i.length, o.length);
591
+ const r = n ? Array.from(n.querySelectorAll("tr")) : [], o = Array.from(e.querySelectorAll("tr")), i = s ? Array.from(s.querySelectorAll("tr")) : [], a = Math.max(r.length, o.length, i.length);
592
592
  for (let f = 0; f < a; f++) {
593
593
  const b = [
594
- ((c = r[f]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
595
- ((l = i[f]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
596
- ((g = o[f]) == null ? void 0 : g.getBoundingClientRect().height) || 0
597
- ], u = Math.max(...b);
598
- u > 0 && (r[f] && (r[f].style.height = `${u}px`), i[f] && (i[f].style.height = `${u}px`), o[f] && (o[f].style.height = `${u}px`));
594
+ ((l = r[f]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
595
+ ((c = o[f]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
596
+ ((u = i[f]) == null ? void 0 : u.getBoundingClientRect().height) || 0
597
+ ], g = Math.max(...b);
598
+ g > 0 && (r[f] && (r[f].style.height = `${g}px`), o[f] && (o[f].style.height = `${g}px`), i[f] && (i[f].style.height = `${g}px`));
599
599
  }
600
600
  }, "#syncHeaderHeights"));
601
601
  q(this, "destroy", /* @__PURE__ */ h(() => {
@@ -626,69 +626,69 @@ const ie = class ie {
626
626
  static compile(n) {
627
627
  if (!n) return null;
628
628
  const e = /* @__PURE__ */ h((a) => {
629
- a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
630
- const g = l.getAttribute("cell-type") || "renderer";
631
- if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
632
- let f = `cell-${g}`;
633
- const b = l.getAttribute("data-bind"), u = l.getAttribute("data-expr"), p = l.getAttribute("maxbyte"), x = l.getAttribute("type");
629
+ a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((c) => {
630
+ const u = c.getAttribute("cell-type") || "renderer";
631
+ if (c.children.length > 0 && c.firstElementChild.tagName.includes("-")) return;
632
+ let f = `cell-${u}`;
633
+ const b = c.getAttribute("data-bind"), g = c.getAttribute("data-expr"), p = c.getAttribute("maxbyte"), x = c.getAttribute("type");
634
634
  let w = [];
635
- b && w.push(`data-bind="${b}"`), u && w.push(`data-expr="${u}"`), p && w.push(`maxbyte="${p}"`), x && w.push(`type="${x}"`), l.innerHTML = `<${f} ${w.join(" ")}></${f}>`;
636
- }), a.querySelectorAll("tbody td, tfoot td").forEach((l) => {
637
- l.setAttribute("tabindex", "0");
635
+ b && w.push(`data-bind="${b}"`), g && w.push(`data-expr="${g}"`), p && w.push(`maxbyte="${p}"`), x && w.push(`type="${x}"`), c.innerHTML = `<${f} ${w.join(" ")}></${f}>`;
636
+ }), a.querySelectorAll("tbody td, tfoot td").forEach((c) => {
637
+ c.setAttribute("tabindex", "0");
638
638
  });
639
639
  }, "processCellTypes"), s = /* @__PURE__ */ h((a) => {
640
640
  if (!a.querySelector("colgroup")) {
641
- const c = a.querySelector("tbody tr") || a.querySelector("tr"), l = c ? c.querySelectorAll("th, td").length : 1, g = document.createElement("colgroup"), f = Math.max(Math.floor(a.clientWidth / l), 100);
642
- for (let b = 0; b < l; b++) {
643
- const u = document.createElement("col");
644
- u.setAttribute("width", f), g.appendChild(u);
641
+ const l = a.querySelector("tbody tr") || a.querySelector("tr"), c = l ? l.querySelectorAll("th, td").length : 1, u = document.createElement("colgroup"), f = Math.max(Math.floor(a.clientWidth / c), 100);
642
+ for (let b = 0; b < c; b++) {
643
+ const g = document.createElement("col");
644
+ g.setAttribute("width", f), u.appendChild(g);
645
645
  }
646
- a.prepend(g);
646
+ a.prepend(u);
647
647
  }
648
648
  if (!a.querySelector("thead")) {
649
- const c = document.createElement("thead"), l = a.querySelector("colgroup");
650
- l ? l.after(c) : a.prepend(c);
649
+ const l = document.createElement("thead"), c = a.querySelector("colgroup");
650
+ c ? c.after(l) : a.prepend(l);
651
651
  }
652
652
  a.classList.add("nine-table-element");
653
- }, "ensureTableStructure"), r = /* @__PURE__ */ h((a, c) => {
654
- const l = Array.from(a.querySelectorAll(c + " tr")), g = Array.from(a.querySelectorAll(c + " th," + c + " td")), f = l.length;
655
- if (f === 0 || g.length === 0) return;
653
+ }, "ensureTableStructure"), r = /* @__PURE__ */ h((a, l) => {
654
+ const c = Array.from(a.querySelectorAll(l + " tr")), u = Array.from(a.querySelectorAll(l + " th," + l + " td")), f = c.length;
655
+ if (f === 0 || u.length === 0) return;
656
656
  let b = 0;
657
- g.forEach((p) => {
657
+ u.forEach((p) => {
658
658
  b += p.colSpan || 1;
659
659
  });
660
- const u = Array.from(Array(f), () => Array(b).fill(null));
661
- l.forEach((p) => {
660
+ const g = Array.from(Array(f), () => Array(b).fill(null));
661
+ c.forEach((p) => {
662
662
  const x = p.sectionRowIndex;
663
663
  let w = 0;
664
664
  Array.from(p.querySelectorAll("th,td")).forEach((m) => {
665
- for (let M = 0; M < u[x].length; M++)
666
- if (u[x][M] === null) {
665
+ for (let M = 0; M < g[x].length; M++)
666
+ if (g[x][M] === null) {
667
667
  w = M;
668
668
  break;
669
669
  }
670
670
  const T = m.rowSpan || 1, R = m.colSpan || 1;
671
671
  for (let M = 0; M < T; M++)
672
672
  for (let B = 0; B < R; B++)
673
- x + M < f && w + B < b && (u[x + M][w + B] = M === 0 && B === 0 ? "1" : "0");
673
+ x + M < f && w + B < b && (g[x + M][w + B] = M === 0 && B === 0 ? "1" : "0");
674
674
  });
675
- }), l.forEach((p) => {
675
+ }), c.forEach((p) => {
676
676
  const x = p.sectionRowIndex;
677
677
  Array.from(p.querySelectorAll("th,td")).forEach((w) => {
678
- for (let m = 0; m < u[x].length; m++)
679
- if (u[x][m] === "1") {
680
- w.dataset.col = m, u[x][m] = "0";
678
+ for (let m = 0; m < g[x].length; m++)
679
+ if (g[x][m] === "1") {
680
+ w.dataset.col = m, g[x][m] = "0";
681
681
  break;
682
682
  }
683
683
  });
684
684
  });
685
- }, "resetColIndex"), i = n.cloneNode(!0);
686
- return s(i), e(i), r(i, "thead"), r(i, "tbody"), r(i, "tfoot"), Array.from(i.querySelectorAll("colgroup col")).forEach((a, c) => {
687
- const l = a.getAttribute("fixed");
688
- l && i.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((g) => {
689
- g.setAttribute("fixed", l);
685
+ }, "resetColIndex"), o = n.cloneNode(!0);
686
+ return s(o), e(o), r(o, "thead"), r(o, "tbody"), r(o, "tfoot"), Array.from(o.querySelectorAll("colgroup col")).forEach((a, l) => {
687
+ const c = a.getAttribute("fixed");
688
+ c && o.querySelectorAll(`thead [data-col="${l}"], tbody [data-col="${l}"], tfoot [data-col="${l}"]`).forEach((u) => {
689
+ u.setAttribute("fixed", c);
690
690
  });
691
- }), i;
691
+ }), o;
692
692
  }
693
693
  // 🎯 [추가] td/th에 선언된 cell-type 속성을 읽어 커스텀 태그로 자동 감싸기
694
694
  };
@@ -703,29 +703,29 @@ const rs = class rs {
703
703
  q(this, "render", /* @__PURE__ */ h(() => {
704
704
  const { startRow: n, startCol: e, endRow: s, endCol: r } = t(this, X);
705
705
  S.log("🎨 [CellSelection.render] Rendering range ->", t(this, X));
706
- const i = t(this, N).querySelectorAll(
706
+ const o = t(this, N).querySelectorAll(
707
707
  ".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
708
708
  );
709
- if (i.forEach((a) => {
710
- a.querySelectorAll(".selected, .selected-top, .selected-bottom, .selected-left, .selected-right").forEach((c) => {
711
- c.classList.remove("selected", "selected-top", "selected-bottom", "selected-left", "selected-right");
709
+ if (o.forEach((a) => {
710
+ a.querySelectorAll(".selected, .selected-top, .selected-bottom, .selected-left, .selected-right").forEach((l) => {
711
+ l.classList.remove("selected", "selected-top", "selected-bottom", "selected-left", "selected-right");
712
712
  });
713
713
  }), n < 0 || e < 0) {
714
714
  S.log("⚠️ [CellSelection.render] Range is invalid (< 0), skipping render.");
715
715
  return;
716
716
  }
717
- let o = 0;
718
- i.forEach((a) => {
719
- a.querySelectorAll("tbody tr").forEach((c) => {
720
- const { matrixRow: l } = V(this, K, qt).call(this, c);
721
- l < 0 || c.querySelectorAll("td, th").forEach((g) => {
722
- const f = parseInt(g.dataset.col, 10);
717
+ let i = 0;
718
+ o.forEach((a) => {
719
+ a.querySelectorAll("tbody tr").forEach((l) => {
720
+ const { matrixRow: c } = V(this, K, qt).call(this, l);
721
+ c < 0 || l.querySelectorAll("td, th").forEach((u) => {
722
+ const f = parseInt(u.dataset.col, 10);
723
723
  if (isNaN(f)) return;
724
- const b = parseInt(g.rowSpan || 1, 10), u = parseInt(g.colSpan || 1, 10), p = l + b - 1, x = f + u - 1;
725
- p >= n && l <= s && x >= e && f <= r && (o++, g.classList.add("selected"), S.log(g, n, e, s, r), l <= n && g.classList.add("selected-top"), p >= s && g.classList.add("selected-bottom"), f <= e && g.classList.add("selected-left"), x >= r && g.classList.add("selected-right"));
724
+ const b = parseInt(u.rowSpan || 1, 10), g = parseInt(u.colSpan || 1, 10), p = c + b - 1, x = f + g - 1;
725
+ p >= n && c <= s && x >= e && f <= r && (i++, u.classList.add("selected"), S.log(u, n, e, s, r), c <= n && u.classList.add("selected-top"), p >= s && u.classList.add("selected-bottom"), f <= e && u.classList.add("selected-left"), x >= r && u.classList.add("selected-right"));
726
726
  });
727
727
  });
728
- }), S.log(`✨ [CellSelection.render] Total rendered cells marked: ${o}`);
728
+ }), S.log(`✨ [CellSelection.render] Total rendered cells marked: ${i}`);
729
729
  }, "render"));
730
730
  y(this, N, n), V(this, K, ws).call(this), t(this, N).querySelectorAll(
731
731
  ".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
@@ -737,36 +737,36 @@ const rs = class rs {
737
737
  }
738
738
  setRange(n, e, s, r) {
739
739
  S.log(`🔍 [CellSelection.setRange] Input -> startRow: ${n}, startCol: ${e}, endRow: ${s}, endCol: ${r}`);
740
- let i = Math.min(n, s), o = Math.max(n, s), a = Math.min(e, r), c = Math.max(e, r);
741
- const l = t(this, N).querySelectorAll(
740
+ let o = Math.min(n, s), i = Math.max(n, s), a = Math.min(e, r), l = Math.max(e, r);
741
+ const c = t(this, N).querySelectorAll(
742
742
  ".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
743
743
  );
744
- let g = !0, f = 0;
745
- for (; g && f < 5; )
746
- g = !1, f++, l.forEach((b) => {
747
- b.querySelectorAll("tbody tr").forEach((u) => {
748
- if (u.classList.contains("nodata")) return;
749
- const { matrixRow: p } = V(this, K, qt).call(this, u);
750
- p < 0 || u.querySelectorAll("td, th").forEach((x) => {
744
+ let u = !0, f = 0;
745
+ for (; u && f < 5; )
746
+ u = !1, f++, c.forEach((b) => {
747
+ b.querySelectorAll("tbody tr").forEach((g) => {
748
+ if (g.classList.contains("nodata")) return;
749
+ const { matrixRow: p } = V(this, K, qt).call(this, g);
750
+ p < 0 || g.querySelectorAll("td, th").forEach((x) => {
751
751
  const w = parseInt(x.dataset.col, 10);
752
752
  if (isNaN(w)) return;
753
753
  const m = parseInt(x.rowSpan || 1, 10), T = parseInt(x.colSpan || 1, 10), R = p + m - 1, M = w + T - 1;
754
- if (R >= i && p <= o && M >= a && w <= c) {
755
- const z = Math.min(i, p), Gt = Math.max(o, R), bs = Math.min(a, w), ps = Math.max(c, M);
756
- (z !== i || Gt !== o || bs !== a || ps !== c) && (i = z, o = Gt, a = bs, c = ps, g = !0);
754
+ if (R >= o && p <= i && M >= a && w <= l) {
755
+ const z = Math.min(o, p), Gt = Math.max(i, R), bs = Math.min(a, w), ps = Math.max(l, M);
756
+ (z !== o || Gt !== i || bs !== a || ps !== l) && (o = z, i = Gt, a = bs, l = ps, u = !0);
757
757
  }
758
758
  });
759
759
  });
760
760
  });
761
- y(this, X, { startRow: i, startCol: a, endRow: o, endCol: c }), S.log("📦 [CellSelection.setRange] Final Range ->", t(this, X)), this.render();
761
+ y(this, X, { startRow: o, startCol: a, endRow: i, endCol: l }), S.log("📦 [CellSelection.setRange] Final Range ->", t(this, X)), this.render();
762
762
  }
763
763
  };
764
764
  N = new WeakMap(), X = new WeakMap(), K = new WeakSet(), qt = /* @__PURE__ */ h(function(n) {
765
765
  if (!n || n.classList.contains("nodata")) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
766
766
  const e = parseInt(n.dataset.row, 10);
767
767
  if (isNaN(e)) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
768
- const s = n.closest("tbody"), i = Array.from(s.querySelectorAll("tr:not(.nodata)")).filter((l) => parseInt(l.dataset.row, 10) === e), o = i.indexOf(n), a = i.length > 0 ? i.length : 1, c = e * a + (o >= 0 ? o : n.sectionRowIndex % a);
769
- return { dataRow: e, subRowIndex: o, matrixRow: c };
768
+ const s = n.closest("tbody"), o = Array.from(s.querySelectorAll("tr:not(.nodata)")).filter((c) => parseInt(c.dataset.row, 10) === e), i = o.indexOf(n), a = o.length > 0 ? o.length : 1, l = e * a + (i >= 0 ? i : n.sectionRowIndex % a);
769
+ return { dataRow: e, subRowIndex: i, matrixRow: l };
770
770
  }, "#getMatrixRow"), ws = /* @__PURE__ */ h(function() {
771
771
  const n = t(this, N).querySelector(".ng-container-top");
772
772
  if (!n) {
@@ -778,33 +778,33 @@ N = new WeakMap(), X = new WeakMap(), K = new WeakSet(), qt = /* @__PURE__ */ h(
778
778
  const s = e.target.closest("td, th");
779
779
  if (!s || s.dataset.row === void 0 || s.dataset.col === void 0 || s.closest("tr").classList.contains("nodata")) return;
780
780
  t(this, N).style.userSelect = "none", t(this, N).style.webkitUserSelect = "none";
781
- const r = s.closest("tr"), { matrixRow: i } = V(this, K, qt).call(this, r), o = parseInt(s.dataset.col, 10);
782
- if (i < 0) {
781
+ const r = s.closest("tr"), { matrixRow: o } = V(this, K, qt).call(this, r), i = parseInt(s.dataset.col, 10);
782
+ if (o < 0) {
783
783
  t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "";
784
784
  return;
785
785
  }
786
- S.log(`🖱️ [MouseDown Success] startRow: ${i}, startCol: ${o}`), t(this, N).navigation.currentCell = s;
787
- let a = i, c = o;
788
- const l = /* @__PURE__ */ h((f) => {
786
+ S.log(`🖱️ [MouseDown Success] startRow: ${o}, startCol: ${i}`), t(this, N).navigation.currentCell = s;
787
+ let a = o, l = i;
788
+ const c = /* @__PURE__ */ h((f) => {
789
789
  const b = document.elementFromPoint(f.clientX, f.clientY);
790
- let u = b == null ? void 0 : b.closest("td, th");
791
- if (!u || !t(this, N).contains(u)) {
790
+ let g = b == null ? void 0 : b.closest("td, th");
791
+ if (!g || !t(this, N).contains(g)) {
792
792
  const m = t(this, N).querySelectorAll(".ng-part-body tbody tr:not(.nodata) td, .ng-part-body tbody tr:not(.nodata) th");
793
793
  for (const T of m) {
794
794
  const R = T.getBoundingClientRect();
795
795
  if (f.clientX >= R.left && f.clientX <= R.right && f.clientY >= R.top && f.clientY <= R.bottom) {
796
- u = T;
796
+ g = T;
797
797
  break;
798
798
  }
799
799
  }
800
800
  }
801
- if (!u || u.dataset.row === void 0 || u.dataset.col === void 0 || u.closest("tr").classList.contains("nodata")) return;
802
- const p = u.closest("tr"), { matrixRow: x } = V(this, K, qt).call(this, p), w = parseInt(u.dataset.col, 10);
803
- x < 0 || a === x && c === w || (a = x, c = w, this.setRange(i, o, x, w));
804
- }, "onMouseMove"), g = /* @__PURE__ */ h(() => {
805
- S.log("🖱️ [MouseUp] Drag ended."), t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "", document.removeEventListener("mousemove", l), document.removeEventListener("mouseup", g);
801
+ if (!g || g.dataset.row === void 0 || g.dataset.col === void 0 || g.closest("tr").classList.contains("nodata")) return;
802
+ const p = g.closest("tr"), { matrixRow: x } = V(this, K, qt).call(this, p), w = parseInt(g.dataset.col, 10);
803
+ x < 0 || a === x && l === w || (a = x, l = w, this.setRange(o, i, x, w));
804
+ }, "onMouseMove"), u = /* @__PURE__ */ h(() => {
805
+ S.log("🖱️ [MouseUp] Drag ended."), t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "", document.removeEventListener("mousemove", c), document.removeEventListener("mouseup", u);
806
806
  }, "onMouseUp");
807
- document.addEventListener("mousemove", l), document.addEventListener("mouseup", g);
807
+ document.addEventListener("mousemove", c), document.addEventListener("mouseup", u);
808
808
  });
809
809
  }, "#initEvents"), h(rs, "CellSelection");
810
810
  let Le = rs;
@@ -824,12 +824,12 @@ const os = class os {
824
824
  const s = t(this, ct).call(this, n);
825
825
  if (s.length === 0) return e + 1;
826
826
  let r = e + 1;
827
- const i = [];
828
- s.forEach((o) => i.push(...Array.from(o.querySelectorAll("td")))), i.sort((o, a) => parseInt(o.dataset.col, 10) - parseInt(a.dataset.col, 10));
829
- for (const o of i) {
830
- const a = parseInt(o.dataset.col, 10), c = parseInt(o.colSpan || 1, 10);
831
- if (e >= a && e < a + c) {
832
- r = a + c;
827
+ const o = [];
828
+ s.forEach((i) => o.push(...Array.from(i.querySelectorAll("td")))), o.sort((i, a) => parseInt(i.dataset.col, 10) - parseInt(a.dataset.col, 10));
829
+ for (const i of o) {
830
+ const a = parseInt(i.dataset.col, 10), l = parseInt(i.colSpan || 1, 10);
831
+ if (e >= a && e < a + l) {
832
+ r = a + l;
833
833
  break;
834
834
  }
835
835
  }
@@ -839,10 +839,10 @@ const os = class os {
839
839
  const s = t(this, ct).call(this, n);
840
840
  if (s.length === 0) return Math.max(0, e - 1);
841
841
  let r = -1;
842
- const i = [];
843
- s.forEach((o) => i.push(...Array.from(o.querySelectorAll("td")))), i.sort((o, a) => parseInt(o.dataset.col, 10) - parseInt(a.dataset.col, 10));
844
- for (const o of i) {
845
- const a = parseInt(o.dataset.col, 10);
842
+ const o = [];
843
+ s.forEach((i) => o.push(...Array.from(i.querySelectorAll("td")))), o.sort((i, a) => parseInt(i.dataset.col, 10) - parseInt(a.dataset.col, 10));
844
+ for (const i of o) {
845
+ const a = parseInt(i.dataset.col, 10);
846
846
  if (a < e)
847
847
  r = a;
848
848
  else
@@ -856,38 +856,38 @@ const os = class os {
856
856
  ".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
857
857
  ), s = [];
858
858
  return e.forEach((r) => {
859
- const i = Array.from(r.querySelectorAll("tbody tr:not(.nodata)"));
860
- for (const o of i) {
861
- const a = parseInt(o.dataset.row, 10), c = i.filter((p) => parseInt(p.dataset.row, 10) === a), l = c.length > 0 ? c.length : 1, g = c.indexOf(o), f = a * l + (g >= 0 ? g : 0);
859
+ const o = Array.from(r.querySelectorAll("tbody tr:not(.nodata)"));
860
+ for (const i of o) {
861
+ const a = parseInt(i.dataset.row, 10), l = o.filter((p) => parseInt(p.dataset.row, 10) === a), c = l.length > 0 ? l.length : 1, u = l.indexOf(i), f = a * c + (u >= 0 ? u : 0);
862
862
  if (f === n) {
863
- s.push(o);
863
+ s.push(i);
864
864
  break;
865
865
  }
866
- const b = Array.from(o.querySelectorAll("td"));
867
- let u = !1;
866
+ const b = Array.from(i.querySelectorAll("td"));
867
+ let g = !1;
868
868
  for (const p of b) {
869
869
  const x = parseInt(p.rowSpan || 1, 10);
870
870
  if (x > 1 && n >= f && n < f + x) {
871
- s.push(o), u = !0;
871
+ s.push(i), g = !0;
872
872
  break;
873
873
  }
874
874
  }
875
- if (u) break;
875
+ if (g) break;
876
876
  }
877
877
  }), s;
878
878
  }, "#findTargetTrsByMatrix"));
879
879
  // 🎯 rowSpan 및 colSpan 경계를 모두 충족하는 셀을 3분할 전체 영역에서 탐색
880
880
  d(this, Wt, /* @__PURE__ */ h((n, e, s, r) => {
881
- const i = t(this, F).querySelectorAll(
881
+ const o = t(this, F).querySelectorAll(
882
882
  ".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
883
- ), o = r !== void 0 ? r : n * 1 + e;
884
- for (const a of i) {
885
- const c = Array.from(a.querySelectorAll("tbody tr:not(.nodata)"));
886
- for (const l of c) {
887
- const g = parseInt(l.dataset.row, 10), f = c.filter((w) => parseInt(w.dataset.row, 10) === g), b = f.length > 0 ? f.length : 1, u = f.indexOf(l), p = g * b + (u >= 0 ? u : 0), x = Array.from(l.querySelectorAll("td"));
883
+ ), i = r !== void 0 ? r : n * 1 + e;
884
+ for (const a of o) {
885
+ const l = Array.from(a.querySelectorAll("tbody tr:not(.nodata)"));
886
+ for (const c of l) {
887
+ const u = parseInt(c.dataset.row, 10), f = l.filter((w) => parseInt(w.dataset.row, 10) === u), b = f.length > 0 ? f.length : 1, g = f.indexOf(c), p = u * b + (g >= 0 ? g : 0), x = Array.from(c.querySelectorAll("td"));
888
888
  for (const w of x) {
889
889
  const m = parseInt(w.dataset.col, 10), T = parseInt(w.colSpan || 1, 10), R = parseInt(w.rowSpan || 1, 10);
890
- if (!isNaN(m) && s >= m && s < m + T && o >= p && o < p + R && window.getComputedStyle(w).display !== "none")
890
+ if (!isNaN(m) && s >= m && s < m + T && i >= p && i < p + R && window.getComputedStyle(w).display !== "none")
891
891
  return w;
892
892
  }
893
893
  }
@@ -905,39 +905,39 @@ const os = class os {
905
905
  const e = parseInt(n.dataset.row, 10), s = parseInt(n.dataset.col, 10);
906
906
  if (!isNaN(e) && !isNaN(s)) {
907
907
  y(this, ae, e), y(this, le, s);
908
- const r = n.closest("tr"), i = r == null ? void 0 : r.closest("tbody");
909
- if (i) {
910
- const a = Array.from(i.querySelectorAll("tr:not(.nodata)")).filter((f) => parseInt(f.dataset.row, 10) === e), c = a.length > 0 ? a.length : 1, l = a.indexOf(r), g = e * c + (l >= 0 ? l : 0);
911
- t(this, F).selection.setRange(g, s, g, s);
908
+ const r = n.closest("tr"), o = r == null ? void 0 : r.closest("tbody");
909
+ if (o) {
910
+ const a = Array.from(o.querySelectorAll("tr:not(.nodata)")).filter((f) => parseInt(f.dataset.row, 10) === e), l = a.length > 0 ? a.length : 1, c = a.indexOf(r), u = e * l + (c >= 0 ? c : 0);
911
+ t(this, F).selection.setRange(u, s, u, s);
912
912
  }
913
913
  }
914
914
  }
915
915
  moveCell(n) {
916
916
  var m, T, R, M;
917
917
  if (!t(this, lt)) return;
918
- const e = t(this, lt), s = e.closest("tr"), r = parseInt(e.dataset.row, 10), i = parseInt(e.dataset.col, 10), o = s == null ? void 0 : s.closest("tbody");
919
- if (!o) return;
920
- const c = Array.from(o.querySelectorAll("tr:not(.nodata)")).filter((B) => parseInt(B.dataset.row, 10) === r), l = c.length > 0 ? c.length : 1, g = c.indexOf(s), f = r * l + (g >= 0 ? g : 0);
921
- let b = f, u = i;
918
+ const e = t(this, lt), s = e.closest("tr"), r = parseInt(e.dataset.row, 10), o = parseInt(e.dataset.col, 10), i = s == null ? void 0 : s.closest("tbody");
919
+ if (!i) return;
920
+ const l = Array.from(i.querySelectorAll("tr:not(.nodata)")).filter((B) => parseInt(B.dataset.row, 10) === r), c = l.length > 0 ? l.length : 1, u = l.indexOf(s), f = r * c + (u >= 0 ? u : 0);
921
+ let b = f, g = o;
922
922
  switch (n.code) {
923
923
  case "Tab":
924
924
  if (n.preventDefault(), n.shiftKey) {
925
- if (u = t(this, Bt).call(this, f, i), u < 0 && f > 0) {
925
+ if (g = t(this, Bt).call(this, f, o), g < 0 && f > 0) {
926
926
  b = f - 1;
927
927
  const B = t(this, ct).call(this, b), z = t(this, Ot).call(this, B);
928
- u = z ? parseInt(z.dataset.col, 10) : 0;
928
+ g = z ? parseInt(z.dataset.col, 10) : 0;
929
929
  }
930
930
  } else {
931
- u = t(this, Dt).call(this, f, i);
931
+ g = t(this, Dt).call(this, f, o);
932
932
  const B = t(this, ct).call(this, f), z = t(this, Ot).call(this, B), Gt = z ? parseInt(z.dataset.col, 10) + parseInt(z.colSpan || 1, 10) : 0;
933
- u >= Gt && (b = f + 1, u = 0);
933
+ g >= Gt && (b = f + 1, g = 0);
934
934
  }
935
935
  break;
936
936
  case "ArrowRight":
937
- u = t(this, Dt).call(this, f, i);
937
+ g = t(this, Dt).call(this, f, o);
938
938
  break;
939
939
  case "ArrowLeft":
940
- u = t(this, Bt).call(this, f, i);
940
+ g = t(this, Bt).call(this, f, o);
941
941
  break;
942
942
  case "ArrowDown":
943
943
  n.preventDefault(), b = f + (e.rowSpan || 1);
@@ -946,14 +946,14 @@ const os = class os {
946
946
  n.preventDefault(), b = Math.max(0, f - (e.rowSpan || 1));
947
947
  break;
948
948
  }
949
- const p = Math.floor(b / l), x = b % l;
950
- let w = t(this, Wt).call(this, p, x, u, b);
949
+ const p = Math.floor(b / c), x = b % c;
950
+ let w = t(this, Wt).call(this, p, x, g, b);
951
951
  if (w)
952
952
  this.currentCell = w, V(this, pt, He).call(this, w);
953
953
  else if (p !== r && p >= 0) {
954
954
  const B = ((T = (m = t(this, F)).getRowHeight) == null ? void 0 : T.call(m)) || 40;
955
955
  (M = (R = t(this, F)).scrollToY) == null || M.call(R, p * B), setTimeout(() => {
956
- const z = t(this, Wt).call(this, p, x, u, b);
956
+ const z = t(this, Wt).call(this, p, x, g, b);
957
957
  z && (this.currentCell = z, V(this, pt, He).call(this, z));
958
958
  }, 0);
959
959
  }
@@ -986,10 +986,10 @@ const Ct = class Ct extends HTMLElement {
986
986
  q(this, "generate", /* @__PURE__ */ h((e) => {
987
987
  if (S.log("sheet.generate()"), !e) return;
988
988
  y(this, ht, Ie.compile(e)), t(this, he).call(this), t(this, de).call(this);
989
- const s = this.querySelector(".ng-container-body .ng-part-header"), r = this.querySelector(".ng-container-body .ng-part-footer"), i = this.querySelector(".ng-nodata-overlay");
990
- s && i && (i.style.top = `${s.offsetHeight}px`), r && i && (i.style.bottom = `${r.offsetHeight}px`), t(this, dt).initialize(), setTimeout(() => {
991
- var o;
992
- (o = this.querySelector("nine-table-hscrollbar")) == null || o.refresh();
989
+ const s = this.querySelector(".ng-container-body .ng-part-header"), r = this.querySelector(".ng-container-body .ng-part-footer"), o = this.querySelector(".ng-nodata-overlay");
990
+ s && o && (o.style.top = `${s.offsetHeight}px`), r && o && (o.style.bottom = `${r.offsetHeight}px`), t(this, dt).initialize(), setTimeout(() => {
991
+ var i;
992
+ (i = this.querySelector("nine-table-hscrollbar")) == null || i.refresh();
993
993
  }, 0);
994
994
  }, "generate"));
995
995
  d(this, he, /* @__PURE__ */ h(() => {
@@ -998,40 +998,40 @@ const Ct = class Ct extends HTMLElement {
998
998
  { selector: ".ng-container-left", type: "left" },
999
999
  { selector: ".ng-container-right", type: "right" }
1000
1000
  ].forEach(({ selector: s, type: r }) => {
1001
- var i, o, a;
1002
- (i = this.querySelector(`${s} .ng-part-header`)) == null || i.appendChild(t(this, xt).call(this, t(this, ht), r, "header")), (o = this.querySelector(`${s} .ng-virtual-spacer`)) == null || o.before(t(this, xt).call(this, t(this, ht), r, "body")), (a = this.querySelector(`${s} .ng-part-footer`)) == null || a.appendChild(t(this, xt).call(this, t(this, ht), r, "footer"));
1001
+ var o, i, a;
1002
+ (o = this.querySelector(`${s} .ng-part-header`)) == null || o.appendChild(t(this, xt).call(this, t(this, ht), r, "header")), (i = this.querySelector(`${s} .ng-virtual-spacer`)) == null || i.before(t(this, xt).call(this, t(this, ht), r, "body")), (a = this.querySelector(`${s} .ng-part-footer`)) == null || a.appendChild(t(this, xt).call(this, t(this, ht), r, "footer"));
1003
1003
  });
1004
1004
  }, "#renderSplitContainers"));
1005
1005
  d(this, de, /* @__PURE__ */ h(() => {
1006
1006
  ["left", "right", "body"].forEach((e) => {
1007
1007
  const s = this.querySelector(`.ng-container-${e}`), r = s == null ? void 0 : s.querySelectorAll("table");
1008
1008
  if (!s || !r || r.length === 0) return;
1009
- let i = 0;
1010
- r[0].querySelectorAll("col").forEach((o) => {
1011
- const a = parseInt(o.getAttribute("width"), 10);
1012
- isNaN(a) || (i += a);
1013
- }), e === "body" ? (s.style.flex = "1", r.forEach((o) => {
1014
- o.style.width = `${i}px`, o.style.minWidth = `${i}px`;
1015
- })) : (s.style.flex = `0 0 ${i}px`, s.style.width = `${i}px`, r.forEach((o) => {
1016
- o.style.width = `${i}px`, o.style.minWidth = `${i}px`;
1009
+ let o = 0;
1010
+ r[0].querySelectorAll("col").forEach((i) => {
1011
+ const a = parseInt(i.getAttribute("width"), 10);
1012
+ isNaN(a) || (o += a);
1013
+ }), e === "body" ? (s.style.flex = "1", r.forEach((i) => {
1014
+ i.style.width = `${o}px`, i.style.minWidth = `${o}px`;
1015
+ })) : (s.style.flex = `0 0 ${o}px`, s.style.width = `${o}px`, r.forEach((i) => {
1016
+ i.style.width = `${o}px`, i.style.minWidth = `${o}px`;
1017
1017
  }));
1018
1018
  });
1019
1019
  }, "#updateContainerWidths"));
1020
1020
  d(this, xt, /* @__PURE__ */ h((e, s, r) => {
1021
- const i = e.cloneNode(!0), o = i.querySelector("thead"), a = i.querySelector("tbody"), c = i.querySelector("tfoot");
1021
+ const o = e.cloneNode(!0), i = o.querySelector("thead"), a = o.querySelector("tbody"), l = o.querySelector("tfoot");
1022
1022
  if (r === "header") {
1023
- if (a && a.remove(), c && c.remove(), e.querySelector("tbody")) {
1024
- const g = document.createElement("tbody");
1025
- g.className = "fixed-tbody", i.appendChild(g);
1023
+ if (a && a.remove(), l && l.remove(), e.querySelector("tbody")) {
1024
+ const u = document.createElement("tbody");
1025
+ u.className = "fixed-tbody", o.appendChild(u);
1026
1026
  }
1027
- } else r === "body" ? (o && o.remove(), c && c.remove(), a && (a.className = "bindable-tbody")) : r === "footer" && (o && o.remove(), a && a.remove());
1028
- return s === "left" ? i.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
1029
- l.getAttribute("fixed") !== "left" && l.remove();
1030
- }) : s === "right" ? i.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
1031
- l.getAttribute("fixed") !== "right" && l.remove();
1032
- }) : i.querySelectorAll("[fixed=left], [fixed=right]").forEach((l) => {
1033
- l.remove();
1034
- }), i;
1027
+ } else r === "body" ? (i && i.remove(), l && l.remove(), a && (a.className = "bindable-tbody")) : r === "footer" && (i && i.remove(), a && a.remove());
1028
+ return s === "left" ? o.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((c) => {
1029
+ c.getAttribute("fixed") !== "left" && c.remove();
1030
+ }) : s === "right" ? o.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((c) => {
1031
+ c.getAttribute("fixed") !== "right" && c.remove();
1032
+ }) : o.querySelectorAll("[fixed=left], [fixed=right]").forEach((c) => {
1033
+ c.remove();
1034
+ }), o;
1035
1035
  }, "#createSplitTable"));
1036
1036
  q(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, dt).getRowHeight(), "getRowHeight"));
1037
1037
  q(this, "scrollToX", /* @__PURE__ */ h((e) => {
@@ -1272,40 +1272,40 @@ const is = class is extends HTMLElement {
1272
1272
  d(this, ue, /* @__PURE__ */ h(() => {
1273
1273
  var e;
1274
1274
  (e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
1275
- var o;
1276
- const r = s.ctrlKey || s.metaKey || s.shiftKey, i = parseInt((o = s.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
1277
- t(this, Ft).call(this, i, r);
1275
+ var i;
1276
+ const r = s.ctrlKey || s.metaKey || s.shiftKey, o = parseInt((i = s.target.closest(".nine-tab-item")) == null ? void 0 : i.dataset.index, 10);
1277
+ t(this, Ft).call(this, o, r);
1278
1278
  }), t(this, Ft).call(this, 0, !1);
1279
1279
  }, "#init"));
1280
1280
  d(this, Ft, /* @__PURE__ */ h((e, s = !1) => {
1281
1281
  const r = /* @__PURE__ */ h(() => {
1282
- const g = Array.from(this.querySelectorAll("nine-table-sheet"));
1283
- Array.from(this.querySelectorAll("nine-splitter")).forEach((u) => u.style.setProperty("display", "none"));
1284
- const b = g.filter((u) => u.classList.contains("active"));
1285
- b.length < 2 || b.forEach((u) => {
1286
- const p = parseInt(u.getAttribute("data-index"), 10), x = this.querySelector(`nine-splitter[data-split-index="${p}"]`), w = g[p + 1];
1282
+ const u = Array.from(this.querySelectorAll("nine-table-sheet"));
1283
+ Array.from(this.querySelectorAll("nine-splitter")).forEach((g) => g.style.setProperty("display", "none"));
1284
+ const b = u.filter((g) => g.classList.contains("active"));
1285
+ b.length < 2 || b.forEach((g) => {
1286
+ const p = parseInt(g.getAttribute("data-index"), 10), x = this.querySelector(`nine-splitter[data-split-index="${p}"]`), w = u[p + 1];
1287
1287
  x && w && w.classList.contains("active") && x.style.setProperty("display", "flex");
1288
1288
  });
1289
- }, "updateSplitters"), i = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = i.querySelectorAll(".nine-tab-item"), c = o.querySelectorAll("nine-table-sheet");
1289
+ }, "updateSplitters"), o = this.querySelector(".nine-tab-bar"), i = this.querySelector("nine-table-sheets-body"), a = o.querySelectorAll(".nine-tab-item"), l = i.querySelectorAll("nine-table-sheet");
1290
1290
  if (!a[e]) return;
1291
1291
  if (!s)
1292
- a.forEach((g, f) => {
1293
- g.classList.toggle("active", f === e);
1294
- }), c.forEach((g, f) => {
1292
+ a.forEach((u, f) => {
1293
+ u.classList.toggle("active", f === e);
1294
+ }), l.forEach((u, f) => {
1295
1295
  const b = f === e;
1296
- g.classList.toggle("active", b), g.style.flex = b ? "1 1 100%" : "";
1296
+ u.classList.toggle("active", b), u.style.flex = b ? "1 1 100%" : "";
1297
1297
  });
1298
1298
  else {
1299
- const g = a[e], f = i.querySelectorAll(".nine-tab-item.active");
1300
- if (g.classList.contains("active") && f.length <= 1)
1299
+ const u = a[e], f = o.querySelectorAll(".nine-tab-item.active");
1300
+ if (u.classList.contains("active") && f.length <= 1)
1301
1301
  return;
1302
- g.classList.toggle("active");
1303
- const b = o.querySelector(`nine-table-sheet[data-index="${e}"]`);
1302
+ u.classList.toggle("active");
1303
+ const b = i.querySelector(`nine-table-sheet[data-index="${e}"]`);
1304
1304
  b && (b.classList.toggle("active"), b.classList.contains("active") || (b.style.flex = ""));
1305
1305
  }
1306
- const l = o.querySelectorAll("nine-table-sheet.active");
1307
- l == null || l.forEach((g) => {
1308
- g.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
1306
+ const c = i.querySelectorAll("nine-table-sheet.active");
1307
+ c == null || c.forEach((u) => {
1308
+ u.style.flex = c.length > 1 ? "1 1 0%" : "1 1 100%";
1309
1309
  }), r();
1310
1310
  }, "#switchSheet"));
1311
1311
  }
@@ -1327,17 +1327,17 @@ const as = class as {
1327
1327
  }).observe(t(this, _));
1328
1328
  }, "#init"));
1329
1329
  d(this, jt, /* @__PURE__ */ h(() => {
1330
- var c, l;
1330
+ var l, c;
1331
1331
  const n = Array.from(t(this, _).shadowRoot.querySelectorAll("nine-table-sheet.active"));
1332
1332
  if (n.length === 0) return;
1333
- const e = parseInt(t(this, _).getAttribute("max-display-row"), 10) || 10, s = Math.max(...n.map((g) => g.getRowHeight())), r = (c = t(this, _).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, i = (l = t(this, _).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = Zt.SCROLLBAR_SIZE, a = e * s + r + i + o;
1333
+ const e = parseInt(t(this, _).getAttribute("max-display-row"), 10) || 10, s = Math.max(...n.map((u) => u.getRowHeight())), r = (l = t(this, _).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : l.getBoundingClientRect().height, o = (c = t(this, _).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : c.getBoundingClientRect().height, i = Zt.SCROLLBAR_SIZE, a = e * s + r + o + i;
1334
1334
  t(this, _).style.height = `${a}px`;
1335
1335
  }, "#applyAutoHeight"));
1336
1336
  d(this, pe, /* @__PURE__ */ h(() => {
1337
- const e = Array.from(t(this, _).children).filter((c) => c.tagName === "TABLE"), s = t(this, _).getAttribute("auto-height") === "true", r = e.length, i = e.map((c, l) => {
1338
- const f = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, b = l < r - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
1337
+ const e = Array.from(t(this, _).children).filter((l) => l.tagName === "TABLE"), s = t(this, _).getAttribute("auto-height") === "true", r = e.length, o = e.map((l, c) => {
1338
+ const f = `<nine-table-sheet class="${c === 0 ? "active" : ""}" data-index="${c}"></nine-table-sheet>`, b = c < r - 1 ? `<nine-splitter class="h" data-split-index="${c}"></nine-splitter>` : "";
1339
1339
  return f + b;
1340
- }).join(""), o = e.map((c, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
1340
+ }).join(""), i = e.map((l, c) => `<div class="nine-tab-item ${c === 0 ? "active" : ""}" data-index="${c}">Sheet ${c + 1}</div>`).join("");
1341
1341
  t(this, _).shadowRoot.innerHTML = `
1342
1342
  <style>
1343
1343
  :host {
@@ -1449,9 +1449,9 @@ const as = class as {
1449
1449
  <nine-table-body>
1450
1450
  <nine-table-summary></nine-table-summary>
1451
1451
  <nine-table-sheets>
1452
- <nine-table-sheets-body>${i}</nine-table-sheets-body>
1452
+ <nine-table-sheets-body>${o}</nine-table-sheets-body>
1453
1453
  <nine-table-sheets-footer>
1454
- <div class="nine-tab-bar">${o}</div>
1454
+ <div class="nine-tab-bar">${i}</div>
1455
1455
  <div class="sheets-counter">Total : <span id="row-count">0</span></div>
1456
1456
  </nine-table-sheets-footer>
1457
1457
  </nine-table-sheets>
@@ -1460,9 +1460,9 @@ const as = class as {
1460
1460
  <nine-table-footer></nine-table-footer>
1461
1461
  `, t(this, _).shadowRoot.querySelector("nine-table-sheets").classList.add("nodata");
1462
1462
  const a = t(this, _).shadowRoot.querySelectorAll("nine-table-sheet");
1463
- a == null || a.forEach((c, l) => {
1464
- e[l] && setTimeout(() => {
1465
- c.generate(e[l]), s && t(this, jt).call(this);
1463
+ a == null || a.forEach((l, c) => {
1464
+ e[c] && setTimeout(() => {
1465
+ l.generate(e[c]), s && t(this, jt).call(this);
1466
1466
  });
1467
1467
  });
1468
1468
  }, "#render"));
@@ -1515,15 +1515,15 @@ const P = class P {
1515
1515
  });
1516
1516
  }, "#invalidate"));
1517
1517
  q(this, "get", /* @__PURE__ */ h((n, e) => {
1518
- var i;
1518
+ var o;
1519
1519
  const s = this.getValidData();
1520
1520
  if (!s || s.length <= 0) return;
1521
1521
  if (n == null) return t(this, St).call(this, s);
1522
1522
  if (n < 0 || n >= s.length) return null;
1523
- const r = typeof ((i = t(this, D).fields) == null ? void 0 : i.get) == "function" ? t(this, D).fields.get() : [];
1523
+ const r = typeof ((o = t(this, D).fields) == null ? void 0 : o.get) == "function" ? t(this, D).fields.get() : [];
1524
1524
  if (e != null) {
1525
- const o = r.indexOf(e);
1526
- return o >= 0 ? s[n].v[o] : null;
1525
+ const i = r.indexOf(e);
1526
+ return i >= 0 ? s[n].v[i] : null;
1527
1527
  }
1528
1528
  return t(this, St).call(this, s[n]);
1529
1529
  }, "get"));
@@ -1550,11 +1550,11 @@ const P = class P {
1550
1550
  var r;
1551
1551
  Array.isArray(n) || (n = [n]);
1552
1552
  const e = typeof ((r = t(this, D).fields) == null ? void 0 : r.get) == "function" ? t(this, D).fields.get() : Object.keys(n[0] || {}), s = [];
1553
- return n.forEach((i) => {
1554
- const o = { v: [] };
1553
+ return n.forEach((o) => {
1554
+ const i = { v: [] };
1555
1555
  e.forEach((a) => {
1556
- o.v.push(i[a] !== void 0 && i[a] !== null ? i[a] : "");
1557
- }), s.push(o);
1556
+ i.v.push(o[a] !== void 0 && o[a] !== null ? o[a] : "");
1557
+ }), s.push(i);
1558
1558
  }), s;
1559
1559
  }, "#json2Array"));
1560
1560
  d(this, we, /* @__PURE__ */ h((n) => (Array.isArray(n) || (n = [n]), n.forEach((e) => {
@@ -1565,8 +1565,8 @@ const P = class P {
1565
1565
  const s = t(this, xe).call(this, n);
1566
1566
  t(this, I).rawRecords = t(this, I).rawRecords.concat(t(this, we).call(this, s)), this.resetRecords();
1567
1567
  const r = this.count() - 1;
1568
- return e || s.forEach((i, o) => {
1569
- const a = t(this, I).rawRecords[r - o];
1568
+ return e || s.forEach((o, i) => {
1569
+ const a = t(this, I).rawRecords[r - i];
1570
1570
  a && (a.__ng.rowState = P.ROW_STATE.EMPTY);
1571
1571
  }), t(this, ft).call(this), r;
1572
1572
  }, "add"));
@@ -1575,21 +1575,21 @@ const P = class P {
1575
1575
  Array.isArray(n) ? e = n : typeof n > "u" ? e = [t(this, I).host.row.at] : e = [parseInt(n, 10)], e.sort((s, r) => r - s).forEach((s) => {
1576
1576
  if (t(this, W)[s]) {
1577
1577
  const r = t(this, W)[s].__ng.rowid;
1578
- t(this, W)[s].__ng.rowState === P.ROW_STATE.INSERT ? t(this, I).rawRecords = t(this, I).rawRecords.filter((i) => i.__ng.rowid !== r) : t(this, I).rawRecords.forEach((i) => {
1579
- i.__ng.rowid === r && (i.__ng.deleted = !0, i.__ng.rowState = P.ROW_STATE.DELETE);
1578
+ t(this, W)[s].__ng.rowState === P.ROW_STATE.INSERT ? t(this, I).rawRecords = t(this, I).rawRecords.filter((o) => o.__ng.rowid !== r) : t(this, I).rawRecords.forEach((o) => {
1579
+ o.__ng.rowid === r && (o.__ng.deleted = !0, o.__ng.rowState = P.ROW_STATE.DELETE);
1580
1580
  });
1581
1581
  }
1582
1582
  }), this.resetRecords(), t(this, ft).call(this);
1583
1583
  }, "delete"));
1584
1584
  q(this, "setValue", /* @__PURE__ */ h((n, e, s) => {
1585
- var c;
1585
+ var l;
1586
1586
  n = parseInt(n, 10);
1587
- const i = (typeof ((c = t(this, D).fields) == null ? void 0 : c.get) == "function" ? t(this, D).fields.get() : []).indexOf(e);
1588
- if (i < 0) return;
1589
- const o = this.getValidData()[n];
1590
- if (!o) return;
1591
- const a = o.v[i];
1592
- a !== s && o.__ng.rowState !== P.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = a), o.__ng.rowState = P.ROW_STATE.UPDATE), o.v[i] = s;
1587
+ const o = (typeof ((l = t(this, D).fields) == null ? void 0 : l.get) == "function" ? t(this, D).fields.get() : []).indexOf(e);
1588
+ if (o < 0) return;
1589
+ const i = this.getValidData()[n];
1590
+ if (!i) return;
1591
+ const a = i.v[o];
1592
+ a !== s && i.__ng.rowState !== P.ROW_STATE.INSERT && (i.__ng.o.hasOwnProperty(e) || (i.__ng.o[e] = a), i.__ng.rowState = P.ROW_STATE.UPDATE), i.v[o] = s;
1593
1593
  }, "setValue"));
1594
1594
  q(this, "resetRecords", /* @__PURE__ */ h(() => {
1595
1595
  y(this, vt, t(this, I).rawRecords.filter((n) => !n.__ng.deleted)), y(this, W, t(this, I).rawRecords.filter((n) => !n.__ng.deleted && !n.__ng.filtered)), t(this, I).rawRecords.forEach((n, e) => {
@@ -1600,15 +1600,15 @@ const P = class P {
1600
1600
  }, "resetRecords"));
1601
1601
  q(this, "getValidData", /* @__PURE__ */ h(() => (t(this, W).length === 0 && t(this, I).rawRecords.length > 0 && this.resetRecords(), t(this, W)), "getValidData"));
1602
1602
  d(this, St, /* @__PURE__ */ h((n) => {
1603
- var o;
1603
+ var i;
1604
1604
  if (!n) return n;
1605
- const e = !Array.isArray(n), s = e ? [n] : n, r = typeof ((o = t(this, D).fields) == null ? void 0 : o.get) == "function" ? t(this, D).fields.get() : [], i = s.filter((a) => !a.__ng.deleted).map((a) => {
1606
- const c = {};
1607
- return r.forEach((l, g) => {
1608
- c[l] = a.v ? a.v[g] : a[l];
1609
- }), c.__ng = a.__ng, c;
1605
+ const e = !Array.isArray(n), s = e ? [n] : n, r = typeof ((i = t(this, D).fields) == null ? void 0 : i.get) == "function" ? t(this, D).fields.get() : [], o = s.filter((a) => !a.__ng.deleted).map((a) => {
1606
+ const l = {};
1607
+ return r.forEach((c, u) => {
1608
+ l[c] = a.v ? a.v[u] : a[c];
1609
+ }), l.__ng = a.__ng, l;
1610
1610
  });
1611
- return e ? i[0] : i;
1611
+ return e ? o[0] : o;
1612
1612
  }, "#conv"));
1613
1613
  q(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
1614
1614
  y(this, D, n), y(this, I, e), t(this, me).call(this);
@@ -1651,10 +1651,10 @@ const cs = class cs {
1651
1651
  }, this.setDataSource = (e) => {
1652
1652
  this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
1653
1653
  }, this.getRowState = (e) => {
1654
- var r, i;
1654
+ var r, o;
1655
1655
  const s = parseInt(e, 10);
1656
1656
  if (!(s >= this.data.count()))
1657
- return (i = (r = this.data.getValidData()[s]) == null ? void 0 : r.__ng) == null ? void 0 : i.rowState;
1657
+ return (o = (r = this.data.getValidData()[s]) == null ? void 0 : r.__ng) == null ? void 0 : o.rowState;
1658
1658
  }, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
1659
1659
  this.row.at = e;
1660
1660
  }, this.scrollTo_V1 = (e) => (e < 0 && (e = 0), e >= this.rawRecords.length && (e = this.rawRecords.length - 1), this.viewRecords.rawIndex = e, this.viewRecords.reset && this.viewRecords.reset(), !(e <= 0 || e >= this.rawRecords.length - 1)), this.getColumn = (e, s) => this.data.get(e, s), this.setColumn = (e, s, r) => {
@@ -1687,25 +1687,25 @@ const hs = class hs {
1687
1687
  if (!(!n || n.length === 0)) {
1688
1688
  for (const e of n)
1689
1689
  S.log(e), $("[data-bind]", e).each((s, r) => {
1690
- const i = r.dataset.bind, o = r.getAttribute("data-type") || "string";
1691
- i && t(this, H).push({ name: i, type: o });
1690
+ const o = r.dataset.bind, i = r.getAttribute("data-type") || "string";
1691
+ o && t(this, H).push({ name: o, type: i });
1692
1692
  }), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
1693
- $(`[${s}]`, e).each((r, i) => {
1694
- var o = i.getAttribute(s);
1695
- if (o.indexOf("data.") < 0) {
1696
- const a = o.search(/[(]/g);
1693
+ $(`[${s}]`, e).each((r, o) => {
1694
+ var i = o.getAttribute(s);
1695
+ if (i.indexOf("data.") < 0) {
1696
+ const a = i.search(/[(]/g);
1697
1697
  if (a > 0)
1698
1698
  try {
1699
- o = String(window[o.substring(0, a).trim()]);
1699
+ i = String(window[i.substring(0, a).trim()]);
1700
1700
  } catch {
1701
- o = "";
1701
+ i = "";
1702
1702
  }
1703
1703
  }
1704
- o.split("data.").forEach((a) => {
1704
+ i.split("data.").forEach((a) => {
1705
1705
  if (a.trim() != "") {
1706
- const c = a.search(/[^_A-Za-z0-9]/g);
1707
- let l = "";
1708
- c >= 0 ? l = a.substring(0, c) : o.startsWith("data.") && (l = a.replace("data.", "")), l && t(this, H).push({ name: l, type: "string" });
1706
+ const l = a.search(/[^_A-Za-z0-9]/g);
1707
+ let c = "";
1708
+ l >= 0 ? c = a.substring(0, l) : i.startsWith("data.") && (c = a.replace("data.", "")), c && t(this, H).push({ name: c, type: "string" });
1709
1709
  }
1710
1710
  });
1711
1711
  });
@@ -1824,32 +1824,32 @@ const fs = class fs extends ze {
1824
1824
  var R = ninegrid.j.querySelectorAll(T).attr("suppress");
1825
1825
  R && T.dataset.row && (R = parseInt(R), !isNaN(R) && R <= e && r.push(R));
1826
1826
  }), r.sort();
1827
- var i = !1;
1827
+ var o = !1;
1828
1828
  if (parseInt(s.sectionRowIndex / t(this, L).template.length) > 0)
1829
- for (var o of r) {
1830
- if (o > e) break;
1831
- var a = parseInt(t(this, v).dataset.row), c = a - 1, l = t(this, v).closest("tr").data, g = t(this, L).data.get(c);
1829
+ for (var i of r) {
1830
+ if (i > e) break;
1831
+ var a = parseInt(t(this, v).dataset.row), l = a - 1, c = t(this, v).closest("tr").data, u = t(this, L).data.get(l);
1832
1832
  t(this, v).dataset.matrixRow;
1833
- var f = t(this, L).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, v).dataset.matrixRow}"]`), b = f.dataset.expr ? this.getExprValue(f.dataset.expr, l, a) : l[f.dataset.bind], u = f.dataset.expr ? this.getExprValue(f.dataset.expr, g, c) : g[f.dataset.bind];
1834
- if (b != u) {
1835
- i = !0;
1833
+ var f = t(this, L).body.querySelector(`tbody.bindable [suppress="${i}"][data-matrix-row="${t(this, v).dataset.matrixRow}"]`), b = f.dataset.expr ? this.getExprValue(f.dataset.expr, c, a) : c[f.dataset.bind], g = f.dataset.expr ? this.getExprValue(f.dataset.expr, u, l) : u[f.dataset.bind];
1834
+ if (b != g) {
1835
+ o = !0;
1836
1836
  break;
1837
1837
  }
1838
1838
  }
1839
1839
  else
1840
- i = !0;
1841
- i ? ninegrid.j.querySelectorAll(t(this, v)).removeClass("suppress") : ninegrid.j.querySelectorAll(t(this, v)).addClass("suppress"), ninegrid.j.querySelectorAll(t(this, v)).hasClass("hidden") || (i ? ninegrid.j.querySelectorAll(t(this, v)).removeClass("hidden") : ninegrid.j.querySelectorAll(t(this, v)).addClass("hidden"));
1840
+ o = !0;
1841
+ o ? ninegrid.j.querySelectorAll(t(this, v)).removeClass("suppress") : ninegrid.j.querySelectorAll(t(this, v)).addClass("suppress"), ninegrid.j.querySelectorAll(t(this, v)).hasClass("hidden") || (o ? ninegrid.j.querySelectorAll(t(this, v)).removeClass("hidden") : ninegrid.j.querySelectorAll(t(this, v)).addClass("hidden"));
1842
1842
  var p = parseInt(t(this, v).dataset.matrixRow), x = p - 1, w = t(this, L).body.querySelector(`tbody.bindable [data-col="${t(this, v).dataset.col}"][data-matrix-row="${x}"]`);
1843
1843
  $(w).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this, v)).hasClass("suppress") ? ninegrid.j.querySelectorAll(w).removeClass("last-none-suppress").addClass("last-suppress") : !$(w).hasClass("suppress") && ninegrid.j.querySelectorAll(t(this, v)).hasClass("suppress") ? ninegrid.j.querySelectorAll(w).removeClass("last-suppress").addClass("last-none-suppress") : ninegrid.j.querySelectorAll(w).removeClass("last-none-suppress").removeClass("last-suppress");
1844
1844
  }
1845
1845
  }
1846
1846
  }, "#resetSuppress"));
1847
- q(this, "getExprValue", /* @__PURE__ */ h((e, s, r, i) => {
1847
+ q(this, "getExprValue", /* @__PURE__ */ h((e, s, r, o) => {
1848
1848
  if (typeof e < "u")
1849
1849
  try {
1850
1850
  r = parseInt(r);
1851
- const o = e.replace("()", "");
1852
- return t(this, L)[o] ? t(this, L)[o].call(this, s, r, t(this, v)) : t(this, L).exprFunction(e).call(this, s, r, t(this, L).data);
1851
+ const i = e.replace("()", "");
1852
+ return t(this, L)[i] ? t(this, L)[i].call(this, s, r, t(this, v)) : t(this, L).exprFunction(e).call(this, s, r, t(this, L).data);
1853
1853
  } catch {
1854
1854
  return ["NG-COMBO"].includes(this.tagName) ? "" : e;
1855
1855
  }
@@ -1942,8 +1942,8 @@ const us = class us extends Fe {
1942
1942
  d(this, Qe, /* @__PURE__ */ h((e) => {
1943
1943
  if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
1944
1944
  if (t(this, bt) == "number") {
1945
- let i = [];
1946
- if (t(this, Q) && Number(t(this, Q)) > 0 && i.push("."), t(this, Et) && Number(t(this, Et)) >= 0 && i.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !i.includes(e.key) && e.preventDefault(), t(this, Q) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
1945
+ let o = [];
1946
+ if (t(this, Q) && Number(t(this, Q)) > 0 && o.push("."), t(this, Et) && Number(t(this, Et)) >= 0 && o.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !o.includes(e.key) && e.preventDefault(), t(this, Q) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
1947
1947
  var s = e.target.value, r = s.indexOf(".");
1948
1948
  if (r >= 0) {
1949
1949
  var s = s.substr(r + 1, s.length);