@ninebone/table 0.0.208 β†’ 0.0.210

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.
@@ -1,125 +1,125 @@
1
- var Be = Object.defineProperty;
2
- var De = (m) => {
1
+ var He = Object.defineProperty;
2
+ var Ie = (m) => {
3
3
  throw TypeError(m);
4
4
  };
5
- var Ve = (m, i, t) => i in m ? Be(m, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : m[i] = t;
6
- var l = (m, i) => Be(m, "name", { value: i, configurable: !0 });
7
- var v = (m, i, t) => Ve(m, typeof i != "symbol" ? i + "" : i, t), Ne = (m, i, t) => i.has(m) || De("Cannot " + t);
8
- var e = (m, i, t) => (Ne(m, i, "read from private field"), t ? t.call(m) : i.get(m)), h = (m, i, t) => i.has(m) ? De("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(m) : i.set(m, t), f = (m, i, t, s) => (Ne(m, i, "write to private field"), s ? s.call(m, t) : i.set(m, t), t);
9
- var Pe = (m, i, t, s) => ({
5
+ var Oe = (m, i, t) => i in m ? He(m, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : m[i] = t;
6
+ var a = (m, i) => He(m, "name", { value: i, configurable: !0 });
7
+ var v = (m, i, t) => Oe(m, typeof i != "symbol" ? i + "" : i, t), $e = (m, i, t) => i.has(m) || Ie("Cannot " + t);
8
+ var e = (m, i, t) => ($e(m, i, "read from private field"), t ? t.call(m) : i.get(m)), g = (m, i, t) => i.has(m) ? Ie("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(m) : i.set(m, t), p = (m, i, t, s) => ($e(m, i, "write to private field"), s ? s.call(m, t) : i.set(m, t), t);
9
+ var We = (m, i, t, s) => ({
10
10
  set _(n) {
11
- f(m, i, n, t);
11
+ p(m, i, n, t);
12
12
  },
13
13
  get _() {
14
14
  return e(m, i, s);
15
15
  }
16
16
  });
17
- import { trace as Xe } from "@ninebone/util";
18
- const Ce = class Ce extends Xe.constructor {
17
+ import { trace as ze } from "@ninebone/util";
18
+ const Te = class Te extends ze.constructor {
19
19
  constructor() {
20
20
  super(), this.init("nine-table", "green");
21
21
  }
22
22
  };
23
- l(Ce, "Trace");
24
- let Se = Ce;
25
- const re = new Se();
26
- var H, V, p, X, F, Y, le, U, ae;
27
- const Me = class Me extends HTMLElement {
23
+ a(Te, "Trace");
24
+ let pe = Te;
25
+ const Q = new pe();
26
+ var k, z, y, B, D, N, te, P, ie;
27
+ const Ae = class Ae extends HTMLElement {
28
28
  constructor() {
29
29
  super();
30
- h(this, H);
31
- h(this, V, !1);
32
- h(this, p);
33
- h(this, X);
34
- h(this, F);
35
- h(this, Y);
36
- h(this, le, /* @__PURE__ */ l(() => {
37
- if (!e(this, H)) return;
38
- const t = e(this, H).querySelector(".ng-container-body");
39
- t && (f(this, Y, new ResizeObserver(() => {
30
+ g(this, k);
31
+ g(this, z, !1);
32
+ g(this, y);
33
+ g(this, B);
34
+ g(this, D);
35
+ g(this, N);
36
+ g(this, te, /* @__PURE__ */ a(() => {
37
+ if (!e(this, k)) return;
38
+ const t = e(this, k).querySelector(".ng-container-body");
39
+ t && (p(this, N, new ResizeObserver(() => {
40
40
  this.refresh();
41
- })), e(this, Y).observe(t));
41
+ })), e(this, N).observe(t));
42
42
  }, "#observeResize"));
43
- v(this, "refresh", /* @__PURE__ */ l(() => {
44
- if (!e(this, H) || !e(this, p) || e(this, V)) return;
45
- const t = e(this, p).container, s = t.querySelector("table");
43
+ v(this, "refresh", /* @__PURE__ */ a(() => {
44
+ if (!e(this, k) || !e(this, y) || e(this, z)) return;
45
+ const t = e(this, y).container, s = t.querySelector("table");
46
46
  if (!s) return;
47
- const n = e(this, p).track, r = e(this, p).thumb, o = e(this, H).querySelector(".ng-container-bottom"), a = t.clientWidth, d = s.scrollWidth;
48
- if (a !== 0 && d > a)
47
+ const n = e(this, y).track, r = e(this, y).thumb, o = e(this, k).querySelector(".ng-container-bottom"), c = t.clientWidth, f = s.scrollWidth;
48
+ if (c !== 0 && f > c)
49
49
  o && (o.style.display = "flex");
50
50
  else {
51
51
  o && (o.style.display = "none");
52
52
  return;
53
53
  }
54
- const c = n.clientWidth;
55
- if (c <= 0) return;
56
- const u = Math.max(Math.min(c * (a / d), c), 20);
57
- r.style.width = `${u}px`;
58
- let g = 0;
59
- const S = s.style.transform;
60
- if (S && S.includes("translateX")) {
61
- const b = S.match(/translateX\(([-\d.]+)px\)/);
62
- b && b[1] && (g = parseFloat(b[1]));
54
+ const l = n.clientWidth;
55
+ if (l <= 0) return;
56
+ const d = Math.max(Math.min(l * (c / f), l), 20);
57
+ r.style.width = `${d}px`;
58
+ let u = 0;
59
+ const b = s.style.transform;
60
+ if (b && b.includes("translateX")) {
61
+ const x = b.match(/translateX\(([-\d.]+)px\)/);
62
+ x && x[1] && (u = parseFloat(x[1]));
63
63
  } else
64
- g = parseInt(s.style.left || 0, 10);
65
- let x = parseInt(Math.abs(g) * c / d, 10);
66
- x < 0 && (x = 0);
67
- const $ = c - u;
68
- x > $ && (x = $), r.style.left = `${x}px`, e(this, p).left.disabled = x === 0, e(this, p).right.disabled = x >= $ - 1;
64
+ u = parseInt(s.style.left || 0, 10);
65
+ let h = parseInt(Math.abs(u) * l / f, 10);
66
+ h < 0 && (h = 0);
67
+ const S = l - d;
68
+ h > S && (h = S), r.style.left = `${h}px`, e(this, y).left.disabled = h === 0, e(this, y).right.disabled = h >= S - 1;
69
69
  }, "refresh"));
70
- h(this, U, /* @__PURE__ */ l((t) => {
71
- if (!e(this, p)) return !1;
72
- const s = e(this, p).container, n = s.querySelector("table");
70
+ g(this, P, /* @__PURE__ */ a((t) => {
71
+ if (!e(this, y)) return !1;
72
+ const s = e(this, y).container, n = s.querySelector("table");
73
73
  if (!n) return !1;
74
- const r = e(this, p).track.getBoundingClientRect(), o = e(this, p).thumb.clientWidth;
75
- let a = t;
76
- a < 0 && (a = 0);
77
- const d = r.width - o;
78
- a > d && (a = d), a = parseInt(a, 10), e(this, p).thumb.style.left = `${a}px`, e(this, p).left.disabled = a === 0, e(this, p).right.disabled = a >= d - 1;
79
- const c = s.clientWidth, u = n.scrollWidth;
80
- let g = d > 0 ? -a * (u - c) / d : 0;
81
- return -g > u - c && (g = -(u - c)), -g + 5 > u - c && (g = -(u - c)), c >= u && (g = 0), n.style.transform = `translateX(${g}px)`, a > 0 && a < d - 1;
74
+ const r = e(this, y).track.getBoundingClientRect(), o = e(this, y).thumb.clientWidth;
75
+ let c = t;
76
+ c < 0 && (c = 0);
77
+ const f = r.width - o;
78
+ c > f && (c = f), c = parseInt(c, 10), e(this, y).thumb.style.left = `${c}px`, e(this, y).left.disabled = c === 0, e(this, y).right.disabled = c >= f - 1;
79
+ const l = s.clientWidth, d = n.scrollWidth;
80
+ let u = f > 0 ? -c * (d - l) / f : 0;
81
+ return -u > d - l && (u = -(d - l)), -u + 5 > d - l && (u = -(d - l)), l >= d && (u = 0), n.style.transform = `translateX(${u}px)`, c > 0 && c < f - 1;
82
82
  }, "#thumbMoveTo"));
83
- h(this, ae, /* @__PURE__ */ l(() => {
84
- const t = /* @__PURE__ */ l((n) => {
85
- clearInterval(e(this, X)), clearInterval(e(this, F));
86
- const r = parseInt(e(this, p).thumb.style.left || 0, 10);
87
- e(this, U).call(this, r + n), f(this, X, setInterval(() => {
88
- clearInterval(e(this, X)), f(this, F, setInterval(() => {
89
- const o = parseInt(e(this, p).thumb.style.left || 0, 10);
90
- e(this, U).call(this, o + n) || clearInterval(e(this, F));
83
+ g(this, ie, /* @__PURE__ */ a(() => {
84
+ const t = /* @__PURE__ */ a((n) => {
85
+ clearInterval(e(this, B)), clearInterval(e(this, D));
86
+ const r = parseInt(e(this, y).thumb.style.left || 0, 10);
87
+ e(this, P).call(this, r + n), p(this, B, setInterval(() => {
88
+ clearInterval(e(this, B)), p(this, D, setInterval(() => {
89
+ const o = parseInt(e(this, y).thumb.style.left || 0, 10);
90
+ e(this, P).call(this, o + n) || clearInterval(e(this, D));
91
91
  }, 50));
92
92
  }, 500));
93
- }, "delayScroll"), s = /* @__PURE__ */ l(() => {
94
- clearInterval(e(this, X)), clearInterval(e(this, F));
93
+ }, "delayScroll"), s = /* @__PURE__ */ a(() => {
94
+ clearInterval(e(this, B)), clearInterval(e(this, D));
95
95
  }, "clearTimer");
96
96
  ["mouseup", "mouseleave", "touchend"].forEach((n) => {
97
- e(this, p).left.addEventListener(n, s), e(this, p).right.addEventListener(n, s), e(this, p).track.addEventListener(n, s);
98
- }), e(this, p).left.addEventListener("mousedown", (n) => {
97
+ e(this, y).left.addEventListener(n, s), e(this, y).right.addEventListener(n, s), e(this, y).track.addEventListener(n, s);
98
+ }), e(this, y).left.addEventListener("mousedown", (n) => {
99
99
  n.button === 0 && t(-20);
100
- }), e(this, p).right.addEventListener("mousedown", (n) => {
100
+ }), e(this, y).right.addEventListener("mousedown", (n) => {
101
101
  n.button === 0 && t(20);
102
- }), e(this, p).left.addEventListener("touchstart", () => t(-20)), e(this, p).right.addEventListener("touchstart", () => t(20)), e(this, p).track.addEventListener("mousedown", (n) => {
102
+ }), e(this, y).left.addEventListener("touchstart", () => t(-20)), e(this, y).right.addEventListener("touchstart", () => t(20)), e(this, y).track.addEventListener("mousedown", (n) => {
103
103
  if (n.button !== 0) return;
104
104
  n.preventDefault();
105
- const r = e(this, p).track.getBoundingClientRect(), o = e(this, p).thumb.clientWidth;
106
- e(this, U).call(this, n.clientX - r.left - o / 2);
107
- }), e(this, p).thumb.addEventListener("mousedown", (n) => {
105
+ const r = e(this, y).track.getBoundingClientRect(), o = e(this, y).thumb.clientWidth;
106
+ e(this, P).call(this, n.clientX - r.left - o / 2);
107
+ }), e(this, y).thumb.addEventListener("mousedown", (n) => {
108
108
  if (n.button !== 0) return;
109
- n.stopPropagation(), n.preventDefault(), f(this, V, !0), this.shiftX = n.clientX - e(this, p).thumb.getBoundingClientRect().left;
110
- const r = /* @__PURE__ */ l((a) => {
111
- if (!e(this, V)) return;
112
- const d = e(this, p).track.getBoundingClientRect();
113
- e(this, U).call(this, a.clientX - d.left - this.shiftX);
114
- }, "onMouseMove"), o = /* @__PURE__ */ l(() => {
115
- f(this, V, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
109
+ n.stopPropagation(), n.preventDefault(), p(this, z, !0), this.shiftX = n.clientX - e(this, y).thumb.getBoundingClientRect().left;
110
+ const r = /* @__PURE__ */ a((c) => {
111
+ if (!e(this, z)) return;
112
+ const f = e(this, y).track.getBoundingClientRect();
113
+ e(this, P).call(this, c.clientX - f.left - this.shiftX);
114
+ }, "onMouseMove"), o = /* @__PURE__ */ a(() => {
115
+ p(this, z, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
116
116
  }, "onMouseUp");
117
117
  document.addEventListener("mousemove", r), document.addEventListener("mouseup", o);
118
118
  });
119
119
  }, "#init"));
120
120
  }
121
121
  connectedCallback() {
122
- if (f(this, H, this.closest("nine-table-sheet") || this.getRootNode().host), !e(this, H)) return;
122
+ if (p(this, k, this.closest("nine-table-sheet") || this.getRootNode().host), !e(this, k)) return;
123
123
  this.innerHTML = `
124
124
  <style>
125
125
  nine-table-hscrollbar {
@@ -183,47 +183,47 @@ const Me = class Me extends HTMLElement {
183
183
  <div class='ng-scroll-track'><div class='ng-scroll-thumb'></div></div>
184
184
  <button class='ng-scroll-right' disabled><div class='ng-scroll-icon'></div></button>
185
185
  `;
186
- const t = /* @__PURE__ */ l(() => {
187
- const s = e(this, H).querySelector(".ng-container-body");
186
+ const t = /* @__PURE__ */ a(() => {
187
+ const s = e(this, k).querySelector(".ng-container-body");
188
188
  if (!s) {
189
189
  setTimeout(t, 10);
190
190
  return;
191
191
  }
192
- f(this, p, {
192
+ p(this, y, {
193
193
  container: s,
194
194
  track: this.querySelector(".ng-scroll-track"),
195
195
  thumb: this.querySelector(".ng-scroll-thumb"),
196
196
  left: this.querySelector(".ng-scroll-left"),
197
197
  right: this.querySelector(".ng-scroll-right")
198
- }), e(this, ae).call(this), e(this, le).call(this), this.refresh();
198
+ }), e(this, ie).call(this), e(this, te).call(this), this.refresh();
199
199
  }, "initWhenReady");
200
200
  t();
201
201
  }
202
202
  disconnectedCallback() {
203
- e(this, Y) && e(this, Y).disconnect();
203
+ e(this, N) && e(this, N).disconnect();
204
204
  }
205
205
  };
206
- H = new WeakMap(), V = new WeakMap(), p = new WeakMap(), X = new WeakMap(), F = new WeakMap(), Y = new WeakMap(), le = new WeakMap(), U = new WeakMap(), ae = new WeakMap(), l(Me, "NineTableHScrollBar");
207
- let Re = Me;
208
- customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Re);
209
- var K, I, k, D, z, O, ce, he;
210
- const He = class He {
206
+ k = new WeakMap(), z = new WeakMap(), y = new WeakMap(), B = new WeakMap(), D = new WeakMap(), N = new WeakMap(), te = new WeakMap(), P = new WeakMap(), ie = new WeakMap(), a(Ae, "NineTableHScrollBar");
207
+ let ye = Ae;
208
+ customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ye);
209
+ var V, L, E, $, _, M, se, ne;
210
+ const qe = class qe {
211
211
  constructor(i) {
212
- h(this, K);
213
- h(this, I, []);
214
- h(this, k, null);
215
- h(this, D, null);
216
- h(this, z, 0);
217
- h(this, O, 0);
218
- v(this, "getRowHeight", /* @__PURE__ */ l(() => e(this, k), "getRowHeight"));
219
- h(this, ce, /* @__PURE__ */ l(() => {
220
- e(this, he).call(this);
212
+ g(this, V);
213
+ g(this, L, []);
214
+ g(this, E, null);
215
+ g(this, $, null);
216
+ g(this, _, 0);
217
+ g(this, M, 0);
218
+ v(this, "getRowHeight", /* @__PURE__ */ a(() => e(this, E), "getRowHeight"));
219
+ g(this, se, /* @__PURE__ */ a(() => {
220
+ e(this, ne).call(this);
221
221
  }, "#init"));
222
222
  /**
223
223
  * 🎯 뷰포트 크기 λ³€ν™” μ‹œμ μ— 높이 계산 및 ν•„μš”ν•œ ν–‰ 개수 산정·캐싱을 μ™„κ²°
224
224
  */
225
- h(this, he, /* @__PURE__ */ l(() => {
226
- !e(this, K) || !(e(this, K) instanceof HTMLElement) || (f(this, D, new ResizeObserver((i) => {
225
+ g(this, ne, /* @__PURE__ */ a(() => {
226
+ !e(this, V) || !(e(this, V) instanceof HTMLElement) || (p(this, $, new ResizeObserver((i) => {
227
227
  for (const t of i) {
228
228
  const s = t.target;
229
229
  if (!s.classList.contains("active"))
@@ -232,50 +232,50 @@ const He = class He {
232
232
  if (n > 0) {
233
233
  const r = s.clientHeight || s.getBoundingClientRect().height || n;
234
234
  let o = 0;
235
- const a = s.querySelector(".ng-container-body") || s, d = a.querySelector("thead"), c = a.querySelector("tfoot");
236
- d && (o += d.offsetHeight || d.getBoundingClientRect().height), c && (o += c.offsetHeight || c.getBoundingClientRect().height);
237
- const u = Math.max(r - o, 100);
238
- if (e(this, z) !== u && (f(this, z, u), e(this, k) !== null)) {
239
- const g = Math.ceil(e(this, z) / e(this, k));
240
- f(this, O, g + 20), re.log(`[RowManager] Resized. Height: ${e(this, z)}px | Target Rows: ${e(this, O)}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((S) => {
241
- const x = s.querySelector(S);
242
- x && x.querySelector("tbody") && this.renderRows(x);
235
+ const c = s.querySelector(".ng-container-body") || s, f = c.querySelector("thead"), l = c.querySelector("tfoot");
236
+ f && (o += f.offsetHeight || f.getBoundingClientRect().height), l && (o += l.offsetHeight || l.getBoundingClientRect().height);
237
+ const d = Math.max(r - o, 100);
238
+ if (e(this, _) !== d && (p(this, _, d), e(this, E) !== null)) {
239
+ const u = Math.ceil(e(this, _) / e(this, E));
240
+ p(this, M, u + 20), Q.log(`[RowManager] Resized. Height: ${e(this, _)}px | Target Rows: ${e(this, M)}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((b) => {
241
+ const h = s.querySelector(b);
242
+ h && h.querySelector("tbody") && this.renderRows(h);
243
243
  });
244
244
  }
245
245
  }
246
246
  }
247
- })), e(this, D).observe(e(this, K)));
247
+ })), e(this, $).observe(e(this, V)));
248
248
  }, "#initResizeObserver"));
249
- v(this, "initTemplate", /* @__PURE__ */ l((i) => {
249
+ v(this, "initTemplate", /* @__PURE__ */ a((i) => {
250
250
  const t = i.querySelector("tbody.bindable") || i.querySelector("tbody");
251
251
  if (!t) return;
252
252
  const s = Array.from(t.querySelectorAll("tr")).filter((n) => !n.classList.contains("nodata"));
253
- f(this, I, s.map((n) => n.cloneNode(!0))), f(this, k, null), console.log(`[RowManager] Template initialized with ${e(this, I).length} row(s).`);
253
+ p(this, L, s.map((n) => n.cloneNode(!0))), p(this, E, null), console.log(`[RowManager] Template initialized with ${e(this, L).length} row(s).`);
254
254
  }, "initTemplate"));
255
- v(this, "measureAndCacheHeight", /* @__PURE__ */ l((i) => {
256
- if (e(this, k) !== null && e(this, k) > 0)
257
- return e(this, k);
258
- if (e(this, I).length === 0)
255
+ v(this, "measureAndCacheHeight", /* @__PURE__ */ a((i) => {
256
+ if (e(this, E) !== null && e(this, E) > 0)
257
+ return e(this, E);
258
+ if (e(this, L).length === 0)
259
259
  throw new Error("[RowManager] Template TRs are empty.");
260
260
  const t = i.querySelector("tbody.bindable") || i.querySelector("tbody");
261
261
  if (!t) return 24;
262
- t.querySelectorAll("tr:not(.nodata)").forEach((g) => g.remove());
262
+ t.querySelectorAll("tr:not(.nodata)").forEach((u) => u.remove());
263
263
  const s = t.querySelector("tr.nodata"), n = document.createDocumentFragment();
264
- e(this, I).forEach((g) => {
265
- n.appendChild(g.cloneNode(!0));
264
+ e(this, L).forEach((u) => {
265
+ n.appendChild(u.cloneNode(!0));
266
266
  }), s ? s.before(n) : t.appendChild(n);
267
- const r = i.closest("nine-table-sheet"), o = r ? r.style.display : "", a = r ? r.style.visibility : "", d = r ? r.style.position : "";
267
+ const r = i.closest("nine-table-sheet"), o = r ? r.style.display : "", c = r ? r.style.visibility : "", f = r ? r.style.position : "";
268
268
  r && (r.style.display === "none" || window.getComputedStyle(r).display === "none") && (r.style.display = "block", r.style.visibility = "hidden", r.style.position = "absolute");
269
- let c = 0;
270
- if (t.querySelectorAll("tr:not(.nodata)").forEach((g, S) => {
271
- const x = g.offsetHeight || g.getBoundingClientRect().height;
272
- x === 0 ? c += 40 : c += x;
273
- }), r && (r.style.display = o, r.style.visibility = a, r.style.position = d), f(this, k, c), e(this, z) > 0) {
274
- const g = Math.ceil(e(this, z) / e(this, k));
275
- f(this, O, g + 20);
269
+ let l = 0;
270
+ if (t.querySelectorAll("tr:not(.nodata)").forEach((u, b) => {
271
+ const h = u.offsetHeight || u.getBoundingClientRect().height;
272
+ h === 0 ? l += 40 : l += h;
273
+ }), r && (r.style.display = o, r.style.visibility = c, r.style.position = f), p(this, E, l), e(this, _) > 0) {
274
+ const u = Math.ceil(e(this, _) / e(this, E));
275
+ p(this, M, u + 20);
276
276
  } else
277
- f(this, O, 40);
278
- return console.log(`[RowManager] Template Height Cached: ${e(this, k)}px | RowCount: ${e(this, O)}`), e(this, k);
277
+ p(this, M, 40);
278
+ return console.log(`[RowManager] Template Height Cached: ${e(this, E)}px | RowCount: ${e(this, M)}`), e(this, E);
279
279
  }, "measureAndCacheHeight"));
280
280
  /**
281
281
  * 🎯 μΊμ‹œλœ ν–‰ 개수 λ°˜ν™˜ (없을 λ•Œλ§Œ μ΅œμ†Œν•œμ˜ λ°©μ–΄ μ—°μ‚°)
@@ -293,131 +293,137 @@ const He = class He {
293
293
  /**
294
294
  * 🎯 μΊμ‹œλœ ν–‰ 개수λ₯Ό κ³§λ°”λ‘œ κ°€μ Έμ™€μ„œ TR λΌˆλŒ€ μ£Όμž… (쀑볡 계산 제거)
295
295
  */
296
- v(this, "renderRows", /* @__PURE__ */ l((i) => {
297
- if (e(this, I).length === 0) return;
296
+ v(this, "renderRows", /* @__PURE__ */ a((i) => {
297
+ if (e(this, L).length === 0) return;
298
298
  const t = i.querySelector("tbody.bindable") || i.querySelector("tbody");
299
299
  if (!t) return;
300
300
  t.querySelectorAll("tr:not(.nodata)").forEach((o) => o.remove());
301
- const s = t.querySelector("tr.nodata"), n = document.createDocumentFragment(), r = e(this, O);
301
+ const s = t.querySelector("tr.nodata"), n = document.createDocumentFragment(), r = e(this, M);
302
302
  for (let o = 0; o < r; o++)
303
- e(this, I).forEach((a) => {
304
- n.appendChild(a.cloneNode(!0));
303
+ e(this, L).forEach((c) => {
304
+ n.appendChild(c.cloneNode(!0));
305
305
  });
306
306
  s ? s.before(n) : t.appendChild(n), console.log(`[RowManager] Rendered ${r} sets into DOM.`);
307
307
  }, "renderRows"));
308
- v(this, "destroy", /* @__PURE__ */ l(() => {
309
- e(this, D) && (e(this, D).disconnect(), f(this, D, null));
308
+ v(this, "destroy", /* @__PURE__ */ a(() => {
309
+ e(this, $) && (e(this, $).disconnect(), p(this, $, null));
310
310
  }, "destroy"));
311
- f(this, K, i), e(this, ce).call(this);
311
+ p(this, V, i), e(this, se).call(this);
312
312
  }
313
313
  get templateLength() {
314
- return e(this, I).length || 1;
314
+ return e(this, L).length || 1;
315
315
  }
316
316
  };
317
- K = new WeakMap(), I = new WeakMap(), k = new WeakMap(), D = new WeakMap(), z = new WeakMap(), O = new WeakMap(), ce = new WeakMap(), he = new WeakMap(), l(He, "RowManager");
318
- let Ee = He;
319
- var B, Z, de, fe;
320
- const te = class te extends HTMLElement {
317
+ V = new WeakMap(), L = new WeakMap(), E = new WeakMap(), $ = new WeakMap(), _ = new WeakMap(), M = new WeakMap(), se = new WeakMap(), ne = new WeakMap(), a(qe, "RowManager");
318
+ let me = qe;
319
+ var H, X, re, oe;
320
+ const Z = class Z extends HTMLElement {
321
321
  constructor() {
322
322
  super();
323
- h(this, B, null);
324
- h(this, Z);
325
- v(this, "generate", /* @__PURE__ */ l((t) => {
326
- var S, x, $;
323
+ g(this, H, null);
324
+ g(this, X);
325
+ v(this, "generate", /* @__PURE__ */ a((t) => {
327
326
  if (!t) return;
328
- const s = /* @__PURE__ */ l((b) => {
329
- const R = /* @__PURE__ */ l((E) => {
330
- if (E.querySelector("colgroup")) return;
331
- const y = E.querySelector("tbody tr") || E.querySelector("tr"), M = y ? y.querySelectorAll("th, td").length : 1, q = document.createElement("colgroup"), ee = Math.max(Math.floor((E.clientWidth || 600) / M), 100);
332
- for (let W = 0; W < M; W++) {
333
- const xe = document.createElement("col");
334
- xe.setAttribute("width", ee), q.appendChild(xe);
327
+ const s = /* @__PURE__ */ a((l) => {
328
+ const d = /* @__PURE__ */ a((b) => {
329
+ if (b.querySelector("colgroup")) return;
330
+ const h = b.querySelector("tbody tr") || b.querySelector("tr"), S = h ? h.querySelectorAll("th, td").length : 1, x = document.createElement("colgroup"), I = Math.max(Math.floor((b.clientWidth || 600) / S), 100);
331
+ for (let C = 0; C < S; C++) {
332
+ const be = document.createElement("col");
333
+ be.setAttribute("width", I), x.appendChild(be);
335
334
  }
336
- E.prepend(q);
337
- }, "ensureColgroup"), A = /* @__PURE__ */ l((E) => {
338
- if (E.querySelector("thead")) return;
339
- const y = document.createElement("thead"), M = E.querySelector("colgroup");
340
- M ? M.after(y) : E.prepend(y);
335
+ b.prepend(x);
336
+ }, "ensureColgroup"), u = /* @__PURE__ */ a((b) => {
337
+ if (b.querySelector("thead")) return;
338
+ const h = document.createElement("thead"), S = b.querySelector("colgroup");
339
+ S ? S.after(h) : b.prepend(h);
341
340
  }, "ensureThead");
342
- return R(b), A(b), b.classList.add("nine-table-element"), b;
341
+ return d(l), u(l), l.classList.add("nine-table-element"), l;
343
342
  }, "initializeTable"), n = t.cloneNode(!0);
344
- f(this, B, s(n)), e(this, B).style.display = "table", e(this, Z).initTemplate(e(this, B));
345
- const r = this.querySelector(".ng-container-left"), o = this.querySelector(".ng-container-body"), a = this.querySelector(".ng-container-right"), d = /* @__PURE__ */ l((b, R, A = !1) => {
346
- const E = b.cloneNode(!0), y = Array.from(E.querySelectorAll("colgroup col")), M = [];
347
- return y.forEach((q, ee) => {
348
- const W = q.getAttribute("fixed");
349
- (A ? W !== "left" && W !== "right" : W === R) || M.push(ee);
350
- }), M.reverse().forEach((q) => {
351
- y[q] && y[q].remove(), E.querySelectorAll("tr").forEach((ee) => {
352
- const W = ee.querySelectorAll("th, td");
353
- W[q] && W[q].remove();
343
+ p(this, H, s(n)), e(this, H).style.display = "table", e(this, X).initTemplate(e(this, H));
344
+ const r = this.querySelector(".ng-container-left"), o = this.querySelector(".ng-container-body"), c = this.querySelector(".ng-container-right"), f = /* @__PURE__ */ a((l, d, u = !1) => {
345
+ const b = l.cloneNode(!0), h = Array.from(b.querySelectorAll("colgroup col")), S = [];
346
+ return h.forEach((x, I) => {
347
+ const C = x.getAttribute("fixed");
348
+ (u ? C !== "left" && C !== "right" : C === d) || S.push(I);
349
+ }), S.reverse().forEach((x) => {
350
+ h[x] && h[x].remove(), b.querySelectorAll("tr").forEach((I) => {
351
+ const C = I.querySelectorAll("th, td");
352
+ C[x] && C[x].remove();
354
353
  });
355
- }), E;
354
+ }), b;
356
355
  }, "filterTableByFixed");
357
356
  if (o) {
358
- const b = d(e(this, B), null, !0);
359
- o.innerHTML = "", o.appendChild(b), e(this, Z).measureAndCacheHeight(o);
357
+ const l = f(e(this, H), null, !0);
358
+ o.innerHTML = "", o.appendChild(l), e(this, X).measureAndCacheHeight(o);
360
359
  }
361
360
  if (r) {
362
- const b = d(e(this, B), "left", !1);
363
- let R = 0;
364
- b.querySelectorAll("col").forEach((E) => {
365
- const y = parseInt(E.getAttribute("width"), 10);
366
- isNaN(y) || (R += y);
367
- }), r.innerHTML = "", r.appendChild(b);
368
- const A = R > 0 ? R : 0;
369
- r.style.flex = `0 0 ${A}px`, r.style.width = `${A}px`;
361
+ const l = f(e(this, H), "left", !1);
362
+ let d = 0;
363
+ l.querySelectorAll("col").forEach((b) => {
364
+ const h = parseInt(b.getAttribute("width"), 10);
365
+ isNaN(h) || (d += h);
366
+ }), r.innerHTML = "", r.appendChild(l);
367
+ const u = d > 0 ? d : 0;
368
+ r.style.flex = `0 0 ${u}px`, r.style.width = `${u}px`;
370
369
  }
371
- if (a) {
372
- const b = d(e(this, B), "right", !1);
373
- let R = 0;
374
- b.querySelectorAll("col").forEach((E) => {
375
- const y = parseInt(E.getAttribute("width"), 10);
376
- isNaN(y) || (R += y);
377
- }), a.innerHTML = "", a.appendChild(b);
378
- const A = R > 0 ? R : 0;
379
- a.style.flex = `0 0 ${A}px`, a.style.width = `${A}px`;
370
+ if (c) {
371
+ const l = f(e(this, H), "right", !1);
372
+ let d = 0;
373
+ l.querySelectorAll("col").forEach((b) => {
374
+ const h = parseInt(b.getAttribute("width"), 10);
375
+ isNaN(h) || (d += h);
376
+ }), c.innerHTML = "", c.appendChild(l);
377
+ const u = d > 0 ? d : 0;
378
+ c.style.flex = `0 0 ${u}px`, c.style.width = `${u}px`;
380
379
  }
381
380
  o && o.addEventListener("scroll", () => {
382
- var b;
383
- this.querySelector("nine-table-hscrollbar"), (b = this.querySelector("nine-table-hscrollbar")) == null || b.refresh();
384
- });
385
- const c = r == null ? void 0 : r.querySelector("table"), u = o == null ? void 0 : o.querySelector("table"), g = a == null ? void 0 : a.querySelector("table");
386
- if (u) {
387
- const b = c ? Array.from(c.querySelectorAll("tr")) : [], R = Array.from(u.querySelectorAll("tr")), A = g ? Array.from(g.querySelectorAll("tr")) : [], E = Math.max(b.length, R.length, A.length);
388
- for (let y = 0; y < E; y++) {
389
- const M = [
390
- ((S = b[y]) == null ? void 0 : S.getBoundingClientRect().height) || 0,
391
- ((x = R[y]) == null ? void 0 : x.getBoundingClientRect().height) || 0,
392
- (($ = A[y]) == null ? void 0 : $.getBoundingClientRect().height) || 0
393
- ], q = Math.max(...M);
394
- q > 0 && (b[y] && (b[y].style.height = `${q}px`), R[y] && (R[y].style.height = `${q}px`), A[y] && (A[y].style.height = `${q}px`));
395
- }
396
- }
397
- setTimeout(() => {
398
- const b = this.querySelector("nine-table-hscrollbar");
399
- b && typeof b.refresh == "function" && b.refresh();
381
+ var l;
382
+ this.querySelector("nine-table-hscrollbar"), (l = this.querySelector("nine-table-hscrollbar")) == null || l.refresh();
383
+ }), setTimeout(() => {
384
+ const l = this.querySelector("nine-table-hscrollbar");
385
+ l && typeof l.refresh == "function" && l.refresh();
400
386
  }, 0);
401
387
  }, "generate"));
402
- v(this, "getRowHeight", /* @__PURE__ */ l(() => e(this, Z).getRowHeight(), "getRowHeight"));
388
+ v(this, "getRowHeight", /* @__PURE__ */ a(() => e(this, X).getRowHeight(), "getRowHeight"));
403
389
  /**
404
390
  getRowCount = () => {
405
391
  if (!this.#tableElement) return 0;
406
392
  return this.#tableElement.querySelectorAll('tbody tr').length;
407
393
  }; */
408
- v(this, "scrollToX", /* @__PURE__ */ l((t) => {
394
+ v(this, "scrollToX", /* @__PURE__ */ a((t) => {
409
395
  const s = this.querySelector(".ng-container-body");
410
396
  s && (s.scrollLeft = t);
411
397
  }, "scrollToX"));
412
- v(this, "scrollToY", /* @__PURE__ */ l((t) => {
398
+ v(this, "scrollToY", /* @__PURE__ */ a((t) => {
413
399
  const s = this.querySelector(".ng-container-body");
414
400
  s && (s.scrollTop = t);
415
401
  }, "scrollToY"));
416
- h(this, de, /* @__PURE__ */ l(() => {
417
- e(this, fe).call(this);
402
+ g(this, re, /* @__PURE__ */ a(() => {
403
+ e(this, oe).call(this);
404
+ const t = /* @__PURE__ */ a(() => {
405
+ requestAnimationFrame(() => {
406
+ var d, u, b;
407
+ const s = this.querySelector(".ng-container-left table"), n = this.querySelector(".ng-container-body table"), r = this.querySelector(".ng-container-right table");
408
+ if (!n) return;
409
+ const o = s ? Array.from(s.querySelectorAll("tr")) : [], c = Array.from(n.querySelectorAll("tr")), f = r ? Array.from(r.querySelectorAll("tr")) : [], l = Math.max(o.length, c.length, f.length);
410
+ for (let h = 0; h < l; h++) {
411
+ const S = [
412
+ ((d = o[h]) == null ? void 0 : d.getBoundingClientRect().height) || 0,
413
+ ((u = c[h]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
414
+ ((b = f[h]) == null ? void 0 : b.getBoundingClientRect().height) || 0
415
+ ], x = Math.max(...S);
416
+ x > 0 && (o[h] && (o[h].style.height = `${x}px`), c[h] && (c[h].style.height = `${x}px`), f[h] && (f[h].style.height = `${x}px`));
417
+ }
418
+ });
419
+ }, "syncRowHeights");
420
+ new MutationObserver((s) => {
421
+ for (const n of s)
422
+ n.attributeName === "class" && this.classList.contains("active") && t();
423
+ }).observe(this, { attributes: !0 });
418
424
  }, "#init"));
419
- h(this, fe, /* @__PURE__ */ l(() => {
420
- const t = te.SCROLLBAR_SIZE;
425
+ g(this, oe, /* @__PURE__ */ a(() => {
426
+ const t = Z.SCROLLBAR_SIZE;
421
427
  this.innerHTML = `
422
428
  <style>
423
429
  nine-table-sheet {
@@ -532,92 +538,92 @@ const te = class te extends HTMLElement {
532
538
  </div>
533
539
  `;
534
540
  }, "#render"));
535
- f(this, Z, new Ee(this));
541
+ p(this, X, new me(this));
536
542
  }
537
543
  connectedCallback() {
538
- e(this, de).call(this);
544
+ e(this, re).call(this);
539
545
  }
540
546
  disconnectedCallback() {
541
- this.innerHTML = "", re.log("NineTableSheet destroyed.");
547
+ this.innerHTML = "", Q.log("NineTableSheet destroyed.");
542
548
  }
543
549
  };
544
- B = new WeakMap(), Z = new WeakMap(), de = new WeakMap(), fe = new WeakMap(), l(te, "NineTableSheet"), v(te, "SCROLLBAR_SIZE", 16);
545
- let oe = te;
546
- customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", oe);
547
- var ue, ie;
548
- const Ie = class Ie extends HTMLElement {
550
+ H = new WeakMap(), X = new WeakMap(), re = new WeakMap(), oe = new WeakMap(), a(Z, "NineTableSheet"), v(Z, "SCROLLBAR_SIZE", 16);
551
+ let ee = Z;
552
+ customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", ee);
553
+ var le, j;
554
+ const ke = class ke extends HTMLElement {
549
555
  constructor() {
550
556
  super();
551
- h(this, ue, /* @__PURE__ */ l(() => {
557
+ g(this, le, /* @__PURE__ */ a(() => {
552
558
  var t;
553
559
  (t = this.querySelector(".nine-tab-bar")) == null || t.addEventListener("click", (s) => {
554
560
  var o;
555
561
  const n = s.ctrlKey || s.metaKey || s.shiftKey, r = parseInt((o = s.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
556
- e(this, ie).call(this, r, n);
557
- }), e(this, ie).call(this, 0, !1);
562
+ e(this, j).call(this, r, n);
563
+ }), e(this, j).call(this, 0, !1);
558
564
  }, "#init"));
559
- h(this, ie, /* @__PURE__ */ l((t, s = !1) => {
560
- const n = /* @__PURE__ */ l(() => {
561
- const u = Array.from(this.querySelectorAll("nine-table-sheet"));
562
- Array.from(this.querySelectorAll("nine-splitter")).forEach((x) => x.style.setProperty("display", "none"));
563
- const S = u.filter((x) => x.classList.contains("active"));
564
- S.length < 2 || S.forEach((x) => {
565
- const $ = parseInt(x.getAttribute("data-index"), 10), b = this.querySelector(`nine-splitter[data-split-index="${$}"]`), R = u[$ + 1];
566
- b && R && R.classList.contains("active") && b.style.setProperty("display", "flex");
565
+ g(this, j, /* @__PURE__ */ a((t, s = !1) => {
566
+ const n = /* @__PURE__ */ a(() => {
567
+ const d = Array.from(this.querySelectorAll("nine-table-sheet"));
568
+ Array.from(this.querySelectorAll("nine-splitter")).forEach((h) => h.style.setProperty("display", "none"));
569
+ const b = d.filter((h) => h.classList.contains("active"));
570
+ b.length < 2 || b.forEach((h) => {
571
+ const S = parseInt(h.getAttribute("data-index"), 10), x = this.querySelector(`nine-splitter[data-split-index="${S}"]`), I = d[S + 1];
572
+ x && I && I.classList.contains("active") && x.style.setProperty("display", "flex");
567
573
  });
568
- }, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = r.querySelectorAll(".nine-tab-item"), d = o.querySelectorAll("nine-table-sheet");
569
- if (!a[t]) return;
574
+ }, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), c = r.querySelectorAll(".nine-tab-item"), f = o.querySelectorAll("nine-table-sheet");
575
+ if (!c[t]) return;
570
576
  if (!s)
571
- a.forEach((u, g) => {
572
- u.classList.toggle("active", g === t);
573
- }), d.forEach((u, g) => {
574
- const S = g === t;
575
- u.classList.toggle("active", S), u.style.flex = S ? "1 1 100%" : "";
577
+ c.forEach((d, u) => {
578
+ d.classList.toggle("active", u === t);
579
+ }), f.forEach((d, u) => {
580
+ const b = u === t;
581
+ d.classList.toggle("active", b), d.style.flex = b ? "1 1 100%" : "";
576
582
  });
577
583
  else {
578
- const u = a[t], g = r.querySelectorAll(".nine-tab-item.active");
579
- if (u.classList.contains("active") && g.length <= 1)
584
+ const d = c[t], u = r.querySelectorAll(".nine-tab-item.active");
585
+ if (d.classList.contains("active") && u.length <= 1)
580
586
  return;
581
- u.classList.toggle("active");
582
- const S = o.querySelector(`nine-table-sheet[data-index="${t}"]`);
583
- S && (S.classList.toggle("active"), S.classList.contains("active") || (S.style.flex = ""));
587
+ d.classList.toggle("active");
588
+ const b = o.querySelector(`nine-table-sheet[data-index="${t}"]`);
589
+ b && (b.classList.toggle("active"), b.classList.contains("active") || (b.style.flex = ""));
584
590
  }
585
- const c = o.querySelectorAll("nine-table-sheet.active");
586
- c == null || c.forEach((u) => {
587
- u.style.flex = c.length > 1 ? "1 1 0%" : "1 1 100%";
591
+ const l = o.querySelectorAll("nine-table-sheet.active");
592
+ l == null || l.forEach((d) => {
593
+ d.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
588
594
  }), n();
589
595
  }, "#switchSheet"));
590
596
  }
591
597
  connectedCallback() {
592
- e(this, ue).call(this);
598
+ e(this, le).call(this);
593
599
  }
594
600
  };
595
- ue = new WeakMap(), ie = new WeakMap(), l(Ie, "NineTableSheets");
596
- let Te = Ie;
597
- customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", Te);
598
- var T, ge, se, be;
599
- const $e = class $e {
601
+ le = new WeakMap(), j = new WeakMap(), a(ke, "NineTableSheets");
602
+ let we = ke;
603
+ customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", we);
604
+ var R, ae, G, ce;
605
+ const Le = class Le {
600
606
  constructor(i) {
601
- h(this, T);
602
- h(this, ge, /* @__PURE__ */ l(() => {
603
- e(this, be).call(this), new ResizeObserver((i) => {
607
+ g(this, R);
608
+ g(this, ae, /* @__PURE__ */ a(() => {
609
+ e(this, ce).call(this), new ResizeObserver((i) => {
604
610
  for (let t of i)
605
- e(this, T).getAttribute("auto-height") === "true" && e(this, se).call(this);
606
- }).observe(e(this, T));
611
+ e(this, R).getAttribute("auto-height") === "true" && e(this, G).call(this);
612
+ }).observe(e(this, R));
607
613
  }, "#init"));
608
- h(this, se, /* @__PURE__ */ l(() => {
609
- var d, c;
610
- const i = Array.from(e(this, T).shadowRoot.querySelectorAll("nine-table-sheet.active"));
614
+ g(this, G, /* @__PURE__ */ a(() => {
615
+ var f, l;
616
+ const i = Array.from(e(this, R).shadowRoot.querySelectorAll("nine-table-sheet.active"));
611
617
  if (i.length === 0) return;
612
- const t = parseInt(e(this, T).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((u) => u.getRowHeight())), n = (d = e(this, T).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : d.getBoundingClientRect().height, r = (c = e(this, T).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : c.getBoundingClientRect().height, o = oe.SCROLLBAR_SIZE, a = t * s + n + r + o;
613
- e(this, T).style.height = `${a}px`;
618
+ const t = parseInt(e(this, R).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((d) => d.getRowHeight())), n = (f = e(this, R).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : f.getBoundingClientRect().height, r = (l = e(this, R).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = ee.SCROLLBAR_SIZE, c = t * s + n + r + o;
619
+ e(this, R).style.height = `${c}px`;
614
620
  }, "#applyAutoHeight"));
615
- h(this, be, /* @__PURE__ */ l(() => {
616
- const t = Array.from(e(this, T).children).filter((d) => d.tagName === "TABLE"), s = e(this, T).getAttribute("auto-height") === "true", n = t.length, r = t.map((d, c) => {
617
- const g = `<nine-table-sheet class="${c === 0 ? "active" : ""}" data-index="${c}"></nine-table-sheet>`, S = c < n - 1 ? `<nine-splitter class="h" data-split-index="${c}"></nine-splitter>` : "";
618
- return g + S;
619
- }).join(""), o = t.map((d, c) => `<div class="nine-tab-item ${c === 0 ? "active" : ""}" data-index="${c}">Sheet ${c + 1}</div>`).join("");
620
- e(this, T).shadowRoot.innerHTML = `
621
+ g(this, ce, /* @__PURE__ */ a(() => {
622
+ const t = Array.from(e(this, R).children).filter((f) => f.tagName === "TABLE"), s = e(this, R).getAttribute("auto-height") === "true", n = t.length, r = t.map((f, l) => {
623
+ const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, b = l < n - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
624
+ return u + b;
625
+ }).join(""), o = t.map((f, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
626
+ e(this, R).shadowRoot.innerHTML = `
621
627
  <style>
622
628
  :host {
623
629
  display: flex;
@@ -716,189 +722,189 @@ const $e = class $e {
716
722
  </nine-table-body>
717
723
  <nine-table-footer></nine-table-footer>
718
724
  `;
719
- const a = e(this, T).shadowRoot.querySelectorAll("nine-table-sheet");
720
- a == null || a.forEach((d, c) => {
721
- t[c] && setTimeout(() => {
722
- d.generate(t[c]), s && e(this, se).call(this);
725
+ const c = e(this, R).shadowRoot.querySelectorAll("nine-table-sheet");
726
+ c == null || c.forEach((f, l) => {
727
+ t[l] && setTimeout(() => {
728
+ f.generate(t[l]), s && e(this, G).call(this);
723
729
  });
724
730
  });
725
731
  }, "#render"));
726
- f(this, T, i), e(this, ge).call(this);
732
+ p(this, R, i), e(this, ae).call(this);
727
733
  }
728
734
  };
729
- T = new WeakMap(), ge = new WeakMap(), se = new WeakMap(), be = new WeakMap(), l($e, "LayoutManager");
730
- let Ae = $e;
731
- var N, j;
732
- const We = class We {
735
+ R = new WeakMap(), ae = new WeakMap(), G = new WeakMap(), ce = new WeakMap(), a(Le, "LayoutManager");
736
+ let ve = Le;
737
+ var W, F;
738
+ const Ce = class Ce {
733
739
  constructor(i) {
734
- h(this, N);
735
- h(this, j, -1);
736
- v(this, "count", /* @__PURE__ */ l(() => e(this, N).rawRecords.length, "count"));
737
- f(this, N, i);
740
+ g(this, W);
741
+ g(this, F, -1);
742
+ v(this, "count", /* @__PURE__ */ a(() => e(this, W).rawRecords.length, "count"));
743
+ p(this, W, i);
738
744
  }
739
745
  get at() {
740
- return e(this, j);
746
+ return e(this, F);
741
747
  }
742
748
  set at(i) {
743
749
  var s, n;
744
- f(this, j, parseInt(i, 10));
745
- const t = ((n = (s = e(this, N).owner).querySelector) == null ? void 0 : n.call(s, ".ng-container-body")) || e(this, N).owner.body;
746
- t && !t.querySelector(`tbody.bindable tr[data-row="${e(this, j)}"]`) && setTimeout(() => {
750
+ p(this, F, parseInt(i, 10));
751
+ const t = ((n = (s = e(this, W).owner).querySelector) == null ? void 0 : n.call(s, ".ng-container-body")) || e(this, W).owner.body;
752
+ t && !t.querySelector(`tbody.bindable tr[data-row="${e(this, F)}"]`) && setTimeout(() => {
747
753
  var r, o;
748
- (o = (r = e(this, N).owner).scrollTo_V1) == null || o.call(r, e(this, j));
754
+ (o = (r = e(this, W).owner).scrollTo_V1) == null || o.call(r, e(this, F));
749
755
  });
750
756
  }
751
757
  };
752
- N = new WeakMap(), j = new WeakMap(), l(We, "ngRow");
753
- let qe = We;
754
- var L, w, _, J, pe, P, ye, ne, me, we, Q;
755
- const C = class C {
758
+ W = new WeakMap(), F = new WeakMap(), a(Ce, "ngRow");
759
+ let xe = Ce;
760
+ var T, w, A, U, he, O, de, J, fe, ue, K;
761
+ const q = class q {
756
762
  constructor(i, t) {
757
- h(this, L);
758
- h(this, w);
759
- h(this, _, []);
760
- h(this, J, []);
761
- h(this, pe, 0);
762
- h(this, P, []);
763
- h(this, ye, /* @__PURE__ */ l(() => {
764
- f(this, P, []);
765
- const i = e(this, L).template || [];
763
+ g(this, T);
764
+ g(this, w);
765
+ g(this, A, []);
766
+ g(this, U, []);
767
+ g(this, he, 0);
768
+ g(this, O, []);
769
+ g(this, de, /* @__PURE__ */ a(() => {
770
+ p(this, O, []);
771
+ const i = e(this, T).template || [];
766
772
  Array.from(i).forEach((t) => {
767
773
  var s;
768
- e(this, P).push(((s = t.getBoundingClientRect) == null ? void 0 : s.call(t).height) || 24);
774
+ e(this, O).push(((s = t.getBoundingClientRect) == null ? void 0 : s.call(t).height) || 24);
769
775
  }), (e(this, w).rawRecords || []).forEach((t) => {
770
- t.__ng || (t.__ng = e(this, ne).call(this)), t.__ng.height = e(this, P).slice();
776
+ t.__ng || (t.__ng = e(this, J).call(this)), t.__ng.height = e(this, O).slice();
771
777
  });
772
778
  }, "#initialize"));
773
- v(this, "set", /* @__PURE__ */ l((i) => {
779
+ v(this, "set", /* @__PURE__ */ a((i) => {
774
780
  this.clear(), this.add(i, !1);
775
781
  }, "set"));
776
- h(this, ne, /* @__PURE__ */ l(() => ({
777
- rowState: C.ROW_STATE.EMPTY,
782
+ g(this, J, /* @__PURE__ */ a(() => ({
783
+ rowState: q.ROW_STATE.EMPTY,
778
784
  deleted: !1,
779
785
  filtered: !1,
780
- height: e(this, P).slice(),
786
+ height: e(this, O).slice(),
781
787
  o: {},
782
788
  c: {},
783
- _: [0, 0, 0, 0, C.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, P).slice(), -1, {}, {}]
789
+ _: [0, 0, 0, 0, q.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, O).slice(), -1, {}, {}]
784
790
  }), "#getDefaultMeta"));
785
- v(this, "reset", /* @__PURE__ */ l(() => {
786
- f(this, _, []), f(this, J, []);
791
+ v(this, "reset", /* @__PURE__ */ a(() => {
792
+ p(this, A, []), p(this, U, []);
787
793
  }, "reset"));
788
- v(this, "clear", /* @__PURE__ */ l(() => {
794
+ v(this, "clear", /* @__PURE__ */ a(() => {
789
795
  var i;
790
- e(this, w).rawRecords = [], f(this, _, []), f(this, J, []), (i = e(this, w).viewRecords) != null && i.reset && e(this, w).viewRecords.reset();
796
+ e(this, w).rawRecords = [], p(this, A, []), p(this, U, []), (i = e(this, w).viewRecords) != null && i.reset && e(this, w).viewRecords.reset();
791
797
  }, "clear"));
792
- h(this, me, /* @__PURE__ */ l((i) => {
798
+ g(this, fe, /* @__PURE__ */ a((i) => {
793
799
  var n;
794
800
  Array.isArray(i) || (i = [i]);
795
- const t = typeof ((n = e(this, L).fields) == null ? void 0 : n.get) == "function" ? e(this, L).fields.get() : Object.keys(i[0] || {}), s = [];
801
+ const t = typeof ((n = e(this, T).fields) == null ? void 0 : n.get) == "function" ? e(this, T).fields.get() : Object.keys(i[0] || {}), s = [];
796
802
  return i.forEach((r) => {
797
803
  const o = { v: [] };
798
- t.forEach((a) => {
799
- o.v.push(r[a] !== void 0 && r[a] !== null ? r[a] : "");
804
+ t.forEach((c) => {
805
+ o.v.push(r[c] !== void 0 && r[c] !== null ? r[c] : "");
800
806
  }), s.push(o);
801
807
  }), s;
802
808
  }, "#json2Array"));
803
- h(this, we, /* @__PURE__ */ l((i) => (Array.isArray(i) || (i = [i]), i.forEach((t) => {
804
- t.__ng = e(this, ne).call(this), t.__ng.rowid = this.nextId, t.__ng.rowState = C.ROW_STATE.INSERT, t.__ng._[0] = t.__ng.rowid;
809
+ g(this, ue, /* @__PURE__ */ a((i) => (Array.isArray(i) || (i = [i]), i.forEach((t) => {
810
+ t.__ng = e(this, J).call(this), t.__ng.rowid = this.nextId, t.__ng.rowState = q.ROW_STATE.INSERT, t.__ng._[0] = t.__ng.rowid;
805
811
  }), i), "#defaultInsert"));
806
- v(this, "add", /* @__PURE__ */ l((i, t = !0) => {
812
+ v(this, "add", /* @__PURE__ */ a((i, t = !0) => {
807
813
  var r;
808
814
  i === void 0 && (i = {});
809
- const s = e(this, me).call(this, i);
810
- e(this, w).rawRecords = e(this, w).rawRecords.concat(e(this, we).call(this, s)), this.resetRecords();
815
+ const s = e(this, fe).call(this, i);
816
+ e(this, w).rawRecords = e(this, w).rawRecords.concat(e(this, ue).call(this, s)), this.resetRecords();
811
817
  const n = this.count() - 1;
812
- return t || s.forEach((o, a) => {
813
- const d = e(this, w).rawRecords[n - a];
814
- d && (d.__ng.rowState = C.ROW_STATE.EMPTY);
818
+ return t || s.forEach((o, c) => {
819
+ const f = e(this, w).rawRecords[n - c];
820
+ f && (f.__ng.rowState = q.ROW_STATE.EMPTY);
815
821
  }), (r = e(this, w).viewRecords) != null && r.reset && e(this, w).viewRecords.reset(), n;
816
822
  }, "add"));
817
- v(this, "delete", /* @__PURE__ */ l((i) => {
823
+ v(this, "delete", /* @__PURE__ */ a((i) => {
818
824
  var s;
819
825
  let t = [];
820
826
  Array.isArray(i) ? t = i : typeof i > "u" ? t = [e(this, w).owner.row.at] : t = [parseInt(i, 10)], t.sort((n, r) => r - n).forEach((n) => {
821
- if (e(this, _)[n]) {
822
- const r = e(this, _)[n].__ng.rowid;
823
- e(this, _)[n].__ng.rowState === C.ROW_STATE.INSERT ? e(this, w).rawRecords = e(this, w).rawRecords.filter((o) => o.__ng.rowid !== r) : e(this, w).rawRecords.forEach((o) => {
824
- o.__ng.rowid === r && (o.__ng.deleted = !0, o.__ng.rowState = C.ROW_STATE.DELETE);
827
+ if (e(this, A)[n]) {
828
+ const r = e(this, A)[n].__ng.rowid;
829
+ e(this, A)[n].__ng.rowState === q.ROW_STATE.INSERT ? e(this, w).rawRecords = e(this, w).rawRecords.filter((o) => o.__ng.rowid !== r) : e(this, w).rawRecords.forEach((o) => {
830
+ o.__ng.rowid === r && (o.__ng.deleted = !0, o.__ng.rowState = q.ROW_STATE.DELETE);
825
831
  });
826
832
  }
827
833
  }), this.resetRecords(), (s = e(this, w).viewRecords) != null && s.reset && e(this, w).viewRecords.reset();
828
834
  }, "delete"));
829
- v(this, "setValue", /* @__PURE__ */ l((i, t, s) => {
830
- var d;
835
+ v(this, "setValue", /* @__PURE__ */ a((i, t, s) => {
836
+ var f;
831
837
  i = parseInt(i, 10);
832
- const r = (typeof ((d = e(this, L).fields) == null ? void 0 : d.get) == "function" ? e(this, L).fields.get() : []).indexOf(t);
838
+ const r = (typeof ((f = e(this, T).fields) == null ? void 0 : f.get) == "function" ? e(this, T).fields.get() : []).indexOf(t);
833
839
  if (r < 0) return;
834
840
  const o = this.getValidData()[i];
835
841
  if (!o) return;
836
- const a = o.v[r];
837
- a !== s && o.__ng.rowState !== C.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(t) || (o.__ng.o[t] = a), o.__ng.rowState = C.ROW_STATE.UPDATE), o.v[r] = s, e(this, w).owner.refreshData && e(this, w).owner.refreshData(i);
842
+ const c = o.v[r];
843
+ c !== s && o.__ng.rowState !== q.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(t) || (o.__ng.o[t] = c), o.__ng.rowState = q.ROW_STATE.UPDATE), o.v[r] = s, e(this, w).owner.refreshData && e(this, w).owner.refreshData(i);
838
844
  }, "setValue"));
839
- v(this, "resetRecords", /* @__PURE__ */ l(() => {
840
- f(this, J, e(this, w).rawRecords.filter((i) => !i.__ng.deleted)), f(this, _, e(this, w).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), e(this, w).rawRecords.forEach((i, t) => {
845
+ v(this, "resetRecords", /* @__PURE__ */ a(() => {
846
+ p(this, U, e(this, w).rawRecords.filter((i) => !i.__ng.deleted)), p(this, A, e(this, w).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), e(this, w).rawRecords.forEach((i, t) => {
841
847
  i.__ng.rowidx = t;
842
- }), e(this, _).forEach((i, t) => {
848
+ }), e(this, A).forEach((i, t) => {
843
849
  i.__ng.i = t;
844
850
  });
845
851
  }, "resetRecords"));
846
- v(this, "getValidData", /* @__PURE__ */ l(() => (e(this, _).length === 0 && e(this, w).rawRecords.length > 0 && this.resetRecords(), e(this, _)), "getValidData"));
847
- h(this, Q, /* @__PURE__ */ l((i) => {
852
+ v(this, "getValidData", /* @__PURE__ */ a(() => (e(this, A).length === 0 && e(this, w).rawRecords.length > 0 && this.resetRecords(), e(this, A)), "getValidData"));
853
+ g(this, K, /* @__PURE__ */ a((i) => {
848
854
  var s;
849
855
  if (!i) return i;
850
- const t = typeof ((s = e(this, L).fields) == null ? void 0 : s.get) == "function" ? e(this, L).fields.get() : [];
856
+ const t = typeof ((s = e(this, T).fields) == null ? void 0 : s.get) == "function" ? e(this, T).fields.get() : [];
851
857
  return Array.isArray(i) ? i.filter((n) => !n.__ng.deleted).map((n) => {
852
858
  const r = {};
853
- return t.forEach((o, a) => {
854
- r[o] = n.v ? n.v[a] : n[o];
859
+ return t.forEach((o, c) => {
860
+ r[o] = n.v ? n.v[c] : n[o];
855
861
  }), r.__ng = n.__ng, r;
856
862
  }) : i;
857
863
  }, "#conv2"));
858
- v(this, "count", /* @__PURE__ */ l(() => this.getValidData().length, "count"));
859
- v(this, "get", /* @__PURE__ */ l((i, t) => {
864
+ v(this, "count", /* @__PURE__ */ a(() => this.getValidData().length, "count"));
865
+ v(this, "get", /* @__PURE__ */ a((i, t) => {
860
866
  var r;
861
867
  const s = this.getValidData();
862
868
  if (!s || s.length <= 0) return;
863
- if (i == null) return e(this, Q).call(this, s);
869
+ if (i == null) return e(this, K).call(this, s);
864
870
  if (i < 0 || i >= s.length) return null;
865
- const n = typeof ((r = e(this, L).fields) == null ? void 0 : r.get) == "function" ? e(this, L).fields.get() : [];
871
+ const n = typeof ((r = e(this, T).fields) == null ? void 0 : r.get) == "function" ? e(this, T).fields.get() : [];
866
872
  if (t != null) {
867
873
  const o = n.indexOf(t);
868
874
  return o >= 0 ? s[i].v[o] : null;
869
875
  }
870
- return e(this, Q).call(this, s[i]);
876
+ return e(this, K).call(this, s[i]);
871
877
  }, "get"));
872
- f(this, L, i), f(this, w, t), e(this, ye).call(this);
878
+ p(this, T, i), p(this, w, t), e(this, de).call(this);
873
879
  }
874
880
  get source() {
875
- return e(this, Q).call(this, e(this, w).rawRecords);
881
+ return e(this, K).call(this, e(this, w).rawRecords);
876
882
  }
877
883
  set source(i) {
878
884
  this.clear(), this.add(i, !1);
879
885
  }
880
886
  get nextId() {
881
- return ++Pe(this, pe)._;
887
+ return ++We(this, he)._;
882
888
  }
883
889
  get length() {
884
- return e(this, _).length;
890
+ return e(this, A).length;
885
891
  }
886
892
  getRowCount() {
887
893
  return this.length;
888
894
  }
889
895
  };
890
- L = new WeakMap(), w = new WeakMap(), _ = new WeakMap(), J = new WeakMap(), pe = new WeakMap(), P = new WeakMap(), ye = new WeakMap(), ne = new WeakMap(), me = new WeakMap(), we = new WeakMap(), Q = new WeakMap(), l(C, "ngData"), // 🎯 ν–‰ μƒνƒœ μ •μ˜ μƒμˆ˜λ₯Ό 클래슀 λ‚΄λΆ€λ‘œ λ‚΄μž¬ν™”
891
- v(C, "ROW_STATE", {
896
+ T = new WeakMap(), w = new WeakMap(), A = new WeakMap(), U = new WeakMap(), he = new WeakMap(), O = new WeakMap(), de = new WeakMap(), J = new WeakMap(), fe = new WeakMap(), ue = new WeakMap(), K = new WeakMap(), a(q, "ngData"), // 🎯 ν–‰ μƒνƒœ μ •μ˜ μƒμˆ˜λ₯Ό 클래슀 λ‚΄λΆ€λ‘œ λ‚΄μž¬ν™”
897
+ v(q, "ROW_STATE", {
892
898
  EMPTY: "EMPTY",
893
899
  NORMAL: "NORMAL",
894
900
  INSERT: "INSERT",
895
901
  UPDATE: "UPDATE",
896
902
  DELETE: "DELETE"
897
903
  });
898
- let ke = C;
899
- const ze = class ze {
904
+ let Se = q;
905
+ const _e = class _e {
900
906
  constructor(i) {
901
- this.owner = i, this.row = new qe(this), this.data = new ke(i, this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
907
+ this.owner = i, this.row = new xe(this), this.data = new Se(i, this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
902
908
  var t;
903
909
  (t = this.owner.view) != null && t.redraw && this.owner.view.redraw();
904
910
  }, this.setDataSource = (t) => {
@@ -915,37 +921,37 @@ const ze = class ze {
915
921
  }, this.setDataSource([]);
916
922
  }
917
923
  };
918
- l(ze, "ngDataManager");
919
- let Le = ze;
920
- var G, ve;
921
- const Oe = class Oe extends HTMLElement {
924
+ a(_e, "ngDataManager");
925
+ let Re = _e;
926
+ var Y, ge;
927
+ const Me = class Me extends HTMLElement {
922
928
  constructor() {
923
929
  super();
924
930
  //#created = false;
925
- h(this, G);
926
- h(this, ve);
927
- this.attachShadow({ mode: "open" }), f(this, G, new Le(this));
931
+ g(this, Y);
932
+ g(this, ge);
933
+ this.attachShadow({ mode: "open" }), p(this, Y, new Re(this));
928
934
  }
929
935
  connectedCallback() {
930
- f(this, ve, new Ae(this)), re.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
936
+ p(this, ge, new ve(this)), Q.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
931
937
  }
932
938
  disconnectedCallback() {
933
- re.log("NineTable disconnected.");
939
+ Q.log("NineTable disconnected.");
934
940
  }
935
941
  // 🎯 μ™ΈλΆ€μ—μ„œ grid.data.set(...) ν˜•νƒœλ‘œ μ ‘κ·Όν•  수 μžˆλ„λ‘ 데이터 λ§€λ‹ˆμ € μ˜€ν”ˆ
936
942
  get data() {
937
- return e(this, G).data;
943
+ return e(this, Y).data;
938
944
  }
939
945
  // 🎯 ν–‰(row) κ΄€λ ¨ μ œμ–΄ μ ‘κ·Όμž μ˜€ν”ˆ
940
946
  get row() {
941
- return e(this, G).row;
947
+ return e(this, Y).row;
942
948
  }
943
949
  // 🎯 전체 데이터 λ§€λ‹ˆμ € μ ‘κ·Ό ν•„μš”ν•  경우
944
950
  get dataManager() {
945
- return e(this, G);
951
+ return e(this, Y);
946
952
  }
947
953
  };
948
- G = new WeakMap(), ve = new WeakMap(), l(Oe, "NineTable");
949
- let _e = Oe;
950
- customElements.get("nine-table") || customElements.define("nine-table", _e);
954
+ Y = new WeakMap(), ge = new WeakMap(), a(Me, "NineTable");
955
+ let Ee = Me;
956
+ customElements.get("nine-table") || customElements.define("nine-table", Ee);
951
957
  //# sourceMappingURL=nine-table.js.map