@ninebone/table 0.0.272 β†’ 0.0.274

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,119 +1,119 @@
1
- var Pe = Object.defineProperty;
2
- var Ve = (w) => {
3
- throw TypeError(w);
1
+ var Be = Object.defineProperty;
2
+ var De = (p) => {
3
+ throw TypeError(p);
4
4
  };
5
- var Ue = (w, i, t) => i in w ? Pe(w, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : w[i] = t;
6
- var h = (w, i) => Pe(w, "name", { value: i, configurable: !0 });
7
- var S = (w, i, t) => Ue(w, typeof i != "symbol" ? i + "" : i, t), Xe = (w, i, t) => i.has(w) || Ve("Cannot " + t);
8
- var e = (w, i, t) => (Xe(w, i, "read from private field"), t ? t.call(w) : i.get(w)), g = (w, i, t) => i.has(w) ? Ve("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(w) : i.set(w, t), y = (w, i, t, s) => (Xe(w, i, "write to private field"), s ? s.call(w, t) : i.set(w, t), t);
9
- var Ye = (w, i, t, s) => ({
10
- set _(r) {
11
- y(w, i, r, t);
5
+ var Ve = (p, i, t) => i in p ? Be(p, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : p[i] = t;
6
+ var a = (p, i) => Be(p, "name", { value: i, configurable: !0 });
7
+ var v = (p, i, t) => Ve(p, typeof i != "symbol" ? i + "" : i, t), Ne = (p, i, t) => i.has(p) || De("Cannot " + t);
8
+ var e = (p, i, t) => (Ne(p, i, "read from private field"), t ? t.call(p) : i.get(p)), f = (p, i, t) => i.has(p) ? De("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(p) : i.set(p, t), g = (p, i, t, s) => (Ne(p, i, "write to private field"), s ? s.call(p, t) : i.set(p, t), t);
9
+ var Pe = (p, i, t, s) => ({
10
+ set _(n) {
11
+ g(p, i, n, t);
12
12
  },
13
13
  get _() {
14
- return e(w, i, s);
14
+ return e(p, i, s);
15
15
  }
16
16
  });
17
- import { trace as Fe } from "@ninebone/util";
18
- const Ie = class Ie extends Fe.constructor {
17
+ import { trace as Xe } from "@ninebone/util";
18
+ const Ce = class Ce extends Xe.constructor {
19
19
  constructor() {
20
20
  super(), this.init("nine-table", "green");
21
21
  }
22
22
  };
23
- h(Ie, "Trace");
24
- let Se = Ie;
25
- const L = new Se();
26
- var _, D, p, N, P, V, ne, X, oe;
27
- const Me = class Me extends HTMLElement {
23
+ a(Ce, "Trace");
24
+ let xe = Ce;
25
+ const Z = new xe();
26
+ var T, z, y, B, D, N, se, P, ne;
27
+ const _e = class _e extends HTMLElement {
28
28
  constructor() {
29
29
  super();
30
- g(this, _);
31
- g(this, D, !1);
32
- g(this, p);
33
- g(this, N);
34
- g(this, P);
35
- g(this, V);
36
- g(this, ne, /* @__PURE__ */ h(() => {
37
- if (!e(this, _)) return;
38
- const t = e(this, _).querySelector(".ng-container-body");
39
- t && (y(this, V, new ResizeObserver(() => {
30
+ f(this, T);
31
+ f(this, z, !1);
32
+ f(this, y);
33
+ f(this, B);
34
+ f(this, D);
35
+ f(this, N);
36
+ f(this, se, /* @__PURE__ */ a(() => {
37
+ if (!e(this, T)) return;
38
+ const t = e(this, T).querySelector(".ng-container-body");
39
+ t && (g(this, N, new ResizeObserver(() => {
40
40
  this.refresh();
41
- })), e(this, V).observe(t));
41
+ })), e(this, N).observe(t));
42
42
  }, "#observeResize"));
43
- S(this, "refresh", /* @__PURE__ */ h(() => {
44
- if (!e(this, _) || !e(this, p) || e(this, D)) return;
45
- const t = e(this, p).container, s = t.querySelector("table");
43
+ v(this, "refresh", /* @__PURE__ */ a(() => {
44
+ if (!e(this, T) || !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 r = e(this, p).track, n = e(this, p).thumb, o = e(this, _).querySelector(".ng-container-bottom"), c = t.clientWidth, u = s.scrollWidth;
48
- if (c !== 0 && u > c)
47
+ const n = e(this, y).track, r = e(this, y).thumb, o = e(this, T).querySelector(".ng-container-bottom"), l = t.clientWidth, h = s.scrollWidth;
48
+ if (l !== 0 && h > l)
49
49
  o && (o.style.display = "flex");
50
50
  else {
51
51
  o && (o.style.display = "none");
52
52
  return;
53
53
  }
54
- const l = r.clientWidth;
55
- if (l <= 0) return;
56
- const a = Math.max(Math.min(l * (c / u), l), 20);
57
- n.style.width = `${a}px`;
58
- const d = t.scrollLeft, f = u - c;
59
- let b = 0;
60
- f > 0 && (b = parseInt(d / f * (l - a), 10)), b < 0 && (b = 0);
61
- const m = l - a;
62
- b > m && (b = m), n.style.left = `${b}px`, L.log(b), e(this, p).left.disabled = b === 0, e(this, p).right.disabled = b >= m - 1;
54
+ const c = n.clientWidth;
55
+ if (c <= 0) return;
56
+ const d = Math.max(Math.min(c * (l / h), c), 20);
57
+ r.style.width = `${d}px`;
58
+ const u = t.scrollLeft, b = h - l;
59
+ let w = 0;
60
+ b > 0 && (w = parseInt(u / b * (c - d), 10)), w < 0 && (w = 0);
61
+ const x = c - d;
62
+ w > x && (w = x), r.style.left = `${w}px`, Z.log(w), e(this, y).left.disabled = w === 0, e(this, y).right.disabled = w >= x - 1;
63
63
  }, "refresh"));
64
- g(this, X, /* @__PURE__ */ h((t) => {
65
- if (!e(this, p)) return !1;
66
- const s = e(this, p).container, r = s.querySelector("table");
67
- if (!r) return !1;
68
- const n = e(this, p).track.getBoundingClientRect(), o = e(this, p).thumb.clientWidth;
69
- let c = t;
70
- c < 0 && (c = 0);
71
- const u = n.width - o;
72
- c > u && (c = u), c = parseInt(c, 10), e(this, p).thumb.style.left = `${c}px`, e(this, p).left.disabled = c === 0, e(this, p).right.disabled = c >= u - 1;
73
- const l = s.clientWidth, a = r.scrollWidth;
74
- let d = u > 0 ? -c * (a - l) / u : 0;
75
- return -d > a - l && (d = -(a - l)), -d + 5 > a - l && (d = -(a - l)), l >= a && (d = 0), r.style.transform = `translateX(${d}px)`, c > 0 && c < u - 1;
64
+ f(this, P, /* @__PURE__ */ a((t) => {
65
+ if (!e(this, y)) return !1;
66
+ const s = e(this, y).container, n = s.querySelector("table");
67
+ if (!n) return !1;
68
+ const r = e(this, y).track.getBoundingClientRect(), o = e(this, y).thumb.clientWidth;
69
+ let l = t;
70
+ l < 0 && (l = 0);
71
+ const h = r.width - o;
72
+ l > h && (l = h), l = parseInt(l, 10), e(this, y).thumb.style.left = `${l}px`, e(this, y).left.disabled = l === 0, e(this, y).right.disabled = l >= h - 1;
73
+ const c = s.clientWidth, d = n.scrollWidth;
74
+ let u = h > 0 ? -l * (d - c) / h : 0;
75
+ return -u > d - c && (u = -(d - c)), -u + 5 > d - c && (u = -(d - c)), c >= d && (u = 0), n.style.transform = `translateX(${u}px)`, l > 0 && l < h - 1;
76
76
  }, "#thumbMoveTo"));
77
- g(this, oe, /* @__PURE__ */ h(() => {
78
- const t = /* @__PURE__ */ h((r) => {
79
- clearInterval(e(this, N)), clearInterval(e(this, P));
80
- const n = parseInt(e(this, p).thumb.style.left || 0, 10);
81
- e(this, X).call(this, n + r), y(this, N, setInterval(() => {
82
- clearInterval(e(this, N)), y(this, P, setInterval(() => {
83
- const o = parseInt(e(this, p).thumb.style.left || 0, 10);
84
- e(this, X).call(this, o + r) || clearInterval(e(this, P));
77
+ f(this, ne, /* @__PURE__ */ a(() => {
78
+ const t = /* @__PURE__ */ a((n) => {
79
+ clearInterval(e(this, B)), clearInterval(e(this, D));
80
+ const r = parseInt(e(this, y).thumb.style.left || 0, 10);
81
+ e(this, P).call(this, r + n), g(this, B, setInterval(() => {
82
+ clearInterval(e(this, B)), g(this, D, setInterval(() => {
83
+ const o = parseInt(e(this, y).thumb.style.left || 0, 10);
84
+ e(this, P).call(this, o + n) || clearInterval(e(this, D));
85
85
  }, 50));
86
86
  }, 500));
87
- }, "delayScroll"), s = /* @__PURE__ */ h(() => {
88
- clearInterval(e(this, N)), clearInterval(e(this, P));
87
+ }, "delayScroll"), s = /* @__PURE__ */ a(() => {
88
+ clearInterval(e(this, B)), clearInterval(e(this, D));
89
89
  }, "clearTimer");
90
- ["mouseup", "mouseleave", "touchend"].forEach((r) => {
91
- e(this, p).left.addEventListener(r, s), e(this, p).right.addEventListener(r, s), e(this, p).track.addEventListener(r, s);
92
- }), e(this, p).left.addEventListener("mousedown", (r) => {
93
- r.button === 0 && t(-20);
94
- }), e(this, p).right.addEventListener("mousedown", (r) => {
95
- r.button === 0 && t(20);
96
- }), e(this, p).left.addEventListener("touchstart", () => t(-20)), e(this, p).right.addEventListener("touchstart", () => t(20)), e(this, p).track.addEventListener("mousedown", (r) => {
97
- if (r.button !== 0) return;
98
- r.preventDefault();
99
- const n = e(this, p).track.getBoundingClientRect(), o = e(this, p).thumb.clientWidth;
100
- e(this, X).call(this, r.clientX - n.left - o / 2);
101
- }), e(this, p).thumb.addEventListener("mousedown", (r) => {
102
- if (r.button !== 0) return;
103
- r.stopPropagation(), r.preventDefault(), y(this, D, !0), this.shiftX = r.clientX - e(this, p).thumb.getBoundingClientRect().left;
104
- const n = /* @__PURE__ */ h((c) => {
105
- if (!e(this, D)) return;
106
- const u = e(this, p).track.getBoundingClientRect();
107
- e(this, X).call(this, c.clientX - u.left - this.shiftX);
108
- }, "onMouseMove"), o = /* @__PURE__ */ h(() => {
109
- y(this, D, !1), s(), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), this.refresh();
90
+ ["mouseup", "mouseleave", "touchend"].forEach((n) => {
91
+ e(this, y).left.addEventListener(n, s), e(this, y).right.addEventListener(n, s), e(this, y).track.addEventListener(n, s);
92
+ }), e(this, y).left.addEventListener("mousedown", (n) => {
93
+ n.button === 0 && t(-20);
94
+ }), e(this, y).right.addEventListener("mousedown", (n) => {
95
+ n.button === 0 && t(20);
96
+ }), e(this, y).left.addEventListener("touchstart", () => t(-20)), e(this, y).right.addEventListener("touchstart", () => t(20)), e(this, y).track.addEventListener("mousedown", (n) => {
97
+ if (n.button !== 0) return;
98
+ n.preventDefault();
99
+ const r = e(this, y).track.getBoundingClientRect(), o = e(this, y).thumb.clientWidth;
100
+ e(this, P).call(this, n.clientX - r.left - o / 2);
101
+ }), e(this, y).thumb.addEventListener("mousedown", (n) => {
102
+ if (n.button !== 0) return;
103
+ n.stopPropagation(), n.preventDefault(), g(this, z, !0), this.shiftX = n.clientX - e(this, y).thumb.getBoundingClientRect().left;
104
+ const r = /* @__PURE__ */ a((l) => {
105
+ if (!e(this, z)) return;
106
+ const h = e(this, y).track.getBoundingClientRect();
107
+ e(this, P).call(this, l.clientX - h.left - this.shiftX);
108
+ }, "onMouseMove"), o = /* @__PURE__ */ a(() => {
109
+ g(this, z, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
110
110
  }, "onMouseUp");
111
- document.addEventListener("mousemove", n), document.addEventListener("mouseup", o);
111
+ document.addEventListener("mousemove", r), document.addEventListener("mouseup", o);
112
112
  });
113
113
  }, "#init"));
114
114
  }
115
115
  connectedCallback() {
116
- if (y(this, _, this.closest("nine-table-sheet") || this.getRootNode().host), !e(this, _)) return;
116
+ if (g(this, T, this.closest("nine-table-sheet") || this.getRootNode().host), !e(this, T)) return;
117
117
  this.innerHTML = `
118
118
  <style>
119
119
  nine-table-hscrollbar {
@@ -177,99 +177,99 @@ const Me = class Me extends HTMLElement {
177
177
  <div class='ng-scroll-track'><div class='ng-scroll-thumb'></div></div>
178
178
  <button class='ng-scroll-right' disabled><div class='ng-scroll-icon'></div></button>
179
179
  `;
180
- const t = /* @__PURE__ */ h(() => {
181
- const s = e(this, _).querySelector(".ng-container-body");
180
+ const t = /* @__PURE__ */ a(() => {
181
+ const s = e(this, T).querySelector(".ng-container-body");
182
182
  if (!s) {
183
183
  setTimeout(t, 10);
184
184
  return;
185
185
  }
186
- y(this, p, {
186
+ g(this, y, {
187
187
  container: s,
188
188
  track: this.querySelector(".ng-scroll-track"),
189
189
  thumb: this.querySelector(".ng-scroll-thumb"),
190
190
  left: this.querySelector(".ng-scroll-left"),
191
191
  right: this.querySelector(".ng-scroll-right")
192
- }), e(this, oe).call(this), e(this, ne).call(this), this.refresh();
192
+ }), e(this, ne).call(this), e(this, se).call(this), this.refresh();
193
193
  }, "initWhenReady");
194
194
  t();
195
195
  }
196
196
  disconnectedCallback() {
197
- e(this, V) && e(this, V).disconnect();
197
+ e(this, N) && e(this, N).disconnect();
198
198
  }
199
199
  };
200
- _ = new WeakMap(), D = new WeakMap(), p = new WeakMap(), N = new WeakMap(), P = new WeakMap(), V = new WeakMap(), ne = new WeakMap(), X = new WeakMap(), oe = new WeakMap(), h(Me, "NineTableHScrollBar");
201
- let Ee = Me;
202
- customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Ee);
203
- var W, M, A, z, H, $, le, ae, ce, he;
200
+ T = new WeakMap(), z = new WeakMap(), y = new WeakMap(), B = new WeakMap(), D = new WeakMap(), N = new WeakMap(), se = new WeakMap(), P = new WeakMap(), ne = new WeakMap(), a(_e, "NineTableHScrollBar");
201
+ let ve = _e;
202
+ customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ve);
203
+ var M, L, R, $, C, _, re, oe, le, ae;
204
204
  const He = class He {
205
205
  constructor(i) {
206
- g(this, W);
207
- g(this, M, []);
208
- g(this, A, null);
209
- g(this, z, null);
210
- g(this, H, 0);
211
- g(this, $, 0);
212
- S(this, "getRowHeight", /* @__PURE__ */ h(() => e(this, A), "getRowHeight"));
213
- g(this, le, /* @__PURE__ */ h(() => {
214
- e(this, ae).call(this);
206
+ f(this, M);
207
+ f(this, L, []);
208
+ f(this, R, null);
209
+ f(this, $, null);
210
+ f(this, C, 0);
211
+ f(this, _, 0);
212
+ v(this, "getRowHeight", /* @__PURE__ */ a(() => e(this, R), "getRowHeight"));
213
+ f(this, re, /* @__PURE__ */ a(() => {
214
+ e(this, oe).call(this);
215
215
  }, "#init"));
216
216
  /**
217
217
  * 🎯 뷰포트 크기 λ³€ν™” μ‹œμ μ— 높이 계산 및 ν•„μš”ν•œ ν–‰ 개수 산정·캐싱을 μ™„κ²°
218
218
  */
219
- g(this, ae, /* @__PURE__ */ h(() => {
220
- !e(this, W) || !(e(this, W) instanceof HTMLElement) || (y(this, z, new ResizeObserver((i) => {
219
+ f(this, oe, /* @__PURE__ */ a(() => {
220
+ !e(this, M) || !(e(this, M) instanceof HTMLElement) || (g(this, $, new ResizeObserver((i) => {
221
221
  for (const t of i) {
222
222
  const s = t.target;
223
223
  if (!s.classList.contains("active"))
224
224
  continue;
225
- const r = t.contentRect.height || (t.borderBoxSize && t.borderBoxSize[0] ? t.borderBoxSize[0].blockSize : 0);
226
- if (r > 0) {
227
- const n = s.clientHeight || s.getBoundingClientRect().height || r;
225
+ const n = t.contentRect.height || (t.borderBoxSize && t.borderBoxSize[0] ? t.borderBoxSize[0].blockSize : 0);
226
+ if (n > 0) {
227
+ const r = s.clientHeight || s.getBoundingClientRect().height || n;
228
228
  let o = 0;
229
- const c = s.querySelector(".ng-container-body") || s, u = c.querySelector("thead"), l = c.querySelector("tfoot");
230
- u && (o += u.offsetHeight || u.getBoundingClientRect().height), l && (o += l.offsetHeight || l.getBoundingClientRect().height);
231
- const a = Math.max(n - o, 100);
232
- if (e(this, H) !== a && (y(this, H, a), e(this, A) !== null)) {
233
- const d = Math.ceil(e(this, H) / e(this, A));
234
- y(this, $, d + 20), L.log(`[RowManager] Resized. Height: ${e(this, H)}px | Target Rows: ${e(this, $)}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((f) => {
235
- const b = s.querySelector(f);
236
- b && b.querySelector("tbody") && e(this, he).call(this, b);
229
+ const l = s.querySelector(".ng-container-body") || s, h = l.querySelector("thead"), c = l.querySelector("tfoot");
230
+ h && (o += h.offsetHeight || h.getBoundingClientRect().height), c && (o += c.offsetHeight || c.getBoundingClientRect().height);
231
+ const d = Math.max(r - o, 100);
232
+ if (e(this, C) !== d && (g(this, C, d), e(this, R) !== null)) {
233
+ const u = Math.ceil(e(this, C) / e(this, R));
234
+ g(this, _, u + 20), Z.log(`[RowManager] Resized. Height: ${e(this, C)}px | Target Rows: ${e(this, _)}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((b) => {
235
+ const w = s.querySelector(b);
236
+ w && w.querySelector("tbody") && e(this, ae).call(this, w);
237
237
  });
238
238
  }
239
239
  }
240
240
  }
241
- })), e(this, z).observe(e(this, W)));
241
+ })), e(this, $).observe(e(this, M)));
242
242
  }, "#initResizeObserver"));
243
243
  // 🎯 ν…œν”Œλ¦Ώ μΆ”μΆœ, 높이 μΈ‘μ •, 초기 λ Œλ”λ§μ„ μˆœμ„œμ— 맞게 λ‚΄λΆ€μ—μ„œ 일괄 처리
244
- S(this, "initialize", /* @__PURE__ */ h((i) => {
245
- L.log(i);
246
- const t = e(this, W).querySelector(".ng-container-body"), s = i.querySelector("tbody"), r = Array.from(s.querySelectorAll("tr"));
247
- y(this, M, r.map((n) => n.cloneNode(!0))), y(this, A, null), e(this, ce).call(this, t);
244
+ v(this, "initialize", /* @__PURE__ */ a((i) => {
245
+ Z.log(i);
246
+ const t = e(this, M).querySelector(".ng-container-body"), s = i.querySelector("tbody"), n = Array.from(s.querySelectorAll("tr"));
247
+ g(this, L, n.map((r) => r.cloneNode(!0))), g(this, R, null), e(this, le).call(this, t);
248
248
  }, "initialize"));
249
- g(this, ce, /* @__PURE__ */ h((i) => {
250
- if (e(this, A) !== null && e(this, A) > 0)
251
- return e(this, A);
252
- if (e(this, M).length === 0)
249
+ f(this, le, /* @__PURE__ */ a((i) => {
250
+ if (e(this, R) !== null && e(this, R) > 0)
251
+ return e(this, R);
252
+ if (e(this, L).length === 0)
253
253
  throw new Error("[RowManager] Template TRs are empty.");
254
254
  const t = i.querySelector("tbody.bindable") || i.querySelector("tbody");
255
255
  if (!t) return 24;
256
- t.querySelectorAll("tr:not(.nodata)").forEach((d) => d.remove());
257
- const s = t.querySelector("tr.nodata"), r = document.createDocumentFragment();
258
- e(this, M).forEach((d) => {
259
- r.appendChild(d.cloneNode(!0));
260
- }), s ? s.before(r) : t.appendChild(r);
261
- const n = i.closest("nine-table-sheet"), o = n ? n.style.display : "", c = n ? n.style.visibility : "", u = n ? n.style.position : "";
262
- n && (n.style.display === "none" || window.getComputedStyle(n).display === "none") && (n.style.display = "block", n.style.visibility = "hidden", n.style.position = "absolute");
263
- let l = 0;
264
- const a = t.querySelectorAll("tr:not(.nodata)");
265
- if (a.forEach((d, f) => {
266
- l += d.offsetHeight || d.getBoundingClientRect().height;
267
- }), a.forEach((d) => d.remove()), n && (n.style.display = o, n.style.visibility = c, n.style.position = u), y(this, A, l), e(this, H) > 0) {
268
- const d = Math.ceil(e(this, H) / e(this, A));
269
- y(this, $, d + 20);
256
+ t.querySelectorAll("tr:not(.nodata)").forEach((u) => u.remove());
257
+ const s = t.querySelector("tr.nodata"), n = document.createDocumentFragment();
258
+ e(this, L).forEach((u) => {
259
+ n.appendChild(u.cloneNode(!0));
260
+ }), s ? s.before(n) : t.appendChild(n);
261
+ const r = i.closest("nine-table-sheet"), o = r ? r.style.display : "", l = r ? r.style.visibility : "", h = r ? r.style.position : "";
262
+ r && (r.style.display === "none" || window.getComputedStyle(r).display === "none") && (r.style.display = "block", r.style.visibility = "hidden", r.style.position = "absolute");
263
+ let c = 0;
264
+ const d = t.querySelectorAll("tr:not(.nodata)");
265
+ if (d.forEach((u, b) => {
266
+ c += u.offsetHeight || u.getBoundingClientRect().height;
267
+ }), d.forEach((u) => u.remove()), r && (r.style.display = o, r.style.visibility = l, r.style.position = h), g(this, R, c), e(this, C) > 0) {
268
+ const u = Math.ceil(e(this, C) / e(this, R));
269
+ g(this, _, u + 20);
270
270
  } else
271
- y(this, $, 40);
272
- return console.log(`[RowManager] Template Height Cached: ${e(this, A)}px | RowCount: ${e(this, $)}`), e(this, A);
271
+ g(this, _, 40);
272
+ return console.log(`[RowManager] Template Height Cached: ${e(this, R)}px | RowCount: ${e(this, _)}`), e(this, R);
273
273
  }, "#measureAndCacheHeight"));
274
274
  /**
275
275
  * 🎯 μΊμ‹œλœ ν–‰ 개수 λ°˜ν™˜ (없을 λ•Œλ§Œ μ΅œμ†Œν•œμ˜ λ°©μ–΄ μ—°μ‚°)
@@ -287,172 +287,186 @@ const He = class He {
287
287
  /**
288
288
  * 🎯 μΊμ‹œλœ ν–‰ 개수λ₯Ό κ³§λ°”λ‘œ κ°€μ Έμ™€μ„œ TR λΌˆλŒ€ μ£Όμž… (쀑볡 계산 제거)
289
289
  */
290
- g(this, he, /* @__PURE__ */ h((i) => {
291
- if (e(this, M).length === 0) return;
290
+ f(this, ae, /* @__PURE__ */ a((i) => {
291
+ if (e(this, L).length === 0) return;
292
292
  const t = i.querySelector("tbody.bindable") || i.querySelector("tbody");
293
293
  if (!t) return;
294
294
  t.querySelectorAll("tr:not(.nodata)").forEach((o) => o.remove());
295
- const s = t.querySelector("tr.nodata"), r = document.createDocumentFragment(), n = e(this, $);
296
- for (let o = 0; o < n; o++)
297
- e(this, M).forEach((c) => {
298
- r.appendChild(c.cloneNode(!0));
295
+ const s = t.querySelector("tr.nodata"), n = document.createDocumentFragment(), r = e(this, _);
296
+ for (let o = 0; o < r; o++)
297
+ e(this, L).forEach((l) => {
298
+ n.appendChild(l.cloneNode(!0));
299
299
  });
300
- s ? s.before(r) : t.appendChild(r), console.log(`[RowManager] Rendered ${n} sets into DOM.`);
300
+ s ? s.before(n) : t.appendChild(n), console.log(`[RowManager] Rendered ${r} sets into DOM.`);
301
301
  }, "#renderRows"));
302
- S(this, "destroy", /* @__PURE__ */ h(() => {
303
- e(this, z) && (e(this, z).disconnect(), y(this, z, null));
302
+ v(this, "destroy", /* @__PURE__ */ a(() => {
303
+ e(this, $) && (e(this, $).disconnect(), g(this, $, null));
304
304
  }, "destroy"));
305
- y(this, W, i), e(this, le).call(this);
305
+ g(this, M, i), e(this, re).call(this);
306
306
  }
307
307
  get templateLength() {
308
- return e(this, M).length || 1;
308
+ return e(this, L).length || 1;
309
309
  }
310
310
  };
311
- W = new WeakMap(), M = new WeakMap(), A = new WeakMap(), z = new WeakMap(), H = new WeakMap(), $ = new WeakMap(), le = new WeakMap(), ae = new WeakMap(), ce = new WeakMap(), he = new WeakMap(), h(He, "RowManager");
312
- let Re = He;
313
- var E, F, J, K, Q, de, fe;
314
- const G = class G extends HTMLElement {
311
+ M = new WeakMap(), L = new WeakMap(), R = new WeakMap(), $ = new WeakMap(), C = new WeakMap(), _ = new WeakMap(), re = new WeakMap(), oe = new WeakMap(), le = new WeakMap(), ae = new WeakMap(), a(He, "RowManager");
312
+ let Se = He;
313
+ var ce, G;
314
+ const k = class k {
315
+ /**
316
+ * 🎯 λ ˆμ΄μ•„μ›ƒ λ‚΄μ˜ μ—¬λŸ¬ rawTables 배열을 μΌκ΄„λ‘œ λ°›μ•„ 단일 λ§ˆμŠ€ν„° ν…œν”Œλ¦ΏμœΌλ‘œ 사전 μ»΄νŒŒμΌν•©λ‹ˆλ‹€.
317
+ */
318
+ static compileAll(i) {
319
+ return Array.isArray(i) ? i.map((t) => k.compile(t)) : [];
320
+ }
321
+ /**
322
+ * 🎯 단일 원본 ν…Œμ΄λΈ”μ„ λ°›μ•„ κΈ°λ³Έ ꡬ쑰 보정 및 2차원 격자 인덱슀 사전 λΆ€μ—¬ μ™„λ£Œλœ λ§ˆμŠ€ν„° ν…Œμ΄λΈ” λ°˜ν™˜
323
+ */
324
+ static compile(i) {
325
+ var n, r, o;
326
+ if (!i) return null;
327
+ const t = i.cloneNode(!0);
328
+ return e(n = k, ce).call(n, t), e(r = k, G).call(r, t, "thead"), e(o = k, G).call(o, t, "tbody"), Array.from(t.querySelectorAll("colgroup col")).forEach((l, h) => {
329
+ const c = l.getAttribute("fixed");
330
+ c && t.querySelectorAll(`[data-col="${h}"]`).forEach((d) => {
331
+ d.setAttribute("fixed", c);
332
+ });
333
+ }), t;
334
+ }
335
+ };
336
+ ce = new WeakMap(), G = new WeakMap(), a(k, "TableCompiler"), f(k, ce, /* @__PURE__ */ a((i) => {
337
+ if (!i.querySelector("colgroup")) {
338
+ const t = i.querySelector("tbody tr") || i.querySelector("tr"), s = t ? t.querySelectorAll("th, td").length : 1, n = document.createElement("colgroup"), r = Math.max(Math.floor(i.clientWidth / s), 100);
339
+ for (let o = 0; o < s; o++) {
340
+ const l = document.createElement("col");
341
+ l.setAttribute("width", r), n.appendChild(l);
342
+ }
343
+ i.prepend(n);
344
+ }
345
+ if (!i.querySelector("thead")) {
346
+ const t = document.createElement("thead"), s = i.querySelector("colgroup");
347
+ s ? s.after(t) : i.prepend(t);
348
+ }
349
+ i.classList.add("nine-table-element"), i.style.display = "table";
350
+ }, "#ensureTableStructure")), f(k, G, /* @__PURE__ */ a((i, t) => {
351
+ const s = Array.from(i.querySelectorAll(t + " tr")), n = Array.from(i.querySelectorAll(t + " th," + t + " td")), r = s.length;
352
+ if (r === 0 || n.length === 0) return;
353
+ let o = 0;
354
+ n.forEach((h) => {
355
+ o += h.colSpan || 1;
356
+ });
357
+ const l = Array.from(Array(r), () => Array(o).fill(null));
358
+ s.forEach((h) => {
359
+ const c = h.sectionRowIndex;
360
+ let d = 0;
361
+ Array.from(h.querySelectorAll("th,td")).forEach((u) => {
362
+ for (let x = 0; x < l[c].length; x++)
363
+ if (l[c][x] === null) {
364
+ d = x;
365
+ break;
366
+ }
367
+ const b = u.rowSpan || 1, w = u.colSpan || 1;
368
+ for (let x = 0; x < b; x++)
369
+ for (let I = 0; I < w; I++)
370
+ c + x < r && d + I < o && (l[c + x][d + I] = x === 0 && I === 0 ? "1" : "0");
371
+ });
372
+ }), s.forEach((h) => {
373
+ const c = h.sectionRowIndex;
374
+ Array.from(h.querySelectorAll("th,td")).forEach((d) => {
375
+ for (let u = 0; u < l[c].length; u++)
376
+ if (l[c][u] === "1") {
377
+ d.dataset.col = u, l[c][u] = "0";
378
+ break;
379
+ }
380
+ });
381
+ });
382
+ }, "#resetColIndex"));
383
+ let Re = k;
384
+ var H, Y, U, J, he, de;
385
+ const j = class j extends HTMLElement {
315
386
  constructor() {
316
387
  super();
317
- g(this, E, null);
318
- g(this, F);
319
- /**
320
- * 🎯 2차원 μ…€ 격자 인덱슀λ₯Ό κ³„μ‚°ν•˜μ—¬ 병합(`rowSpan`/`colSpan`) μ…€μ˜ μ ˆλŒ€ 컬럼 μœ„μΉ˜λ₯Ό λΆ€μ—¬
321
- */
322
- g(this, J, /* @__PURE__ */ h((t, s) => {
323
- const r = Array.from(t.querySelectorAll(s + " tr")), n = Array.from(t.querySelectorAll(s + " th," + s + " td")), o = r.length;
324
- if (o === 0 || n.length === 0) return;
325
- let c = 0;
326
- n.forEach((l) => {
327
- c += l.colSpan || 1;
328
- });
329
- const u = Array.from(Array(o), () => Array(c).fill(null));
330
- r.forEach((l) => {
331
- const a = l.sectionRowIndex;
332
- let d = 0;
333
- Array.from(l.querySelectorAll("th,td")).forEach((f) => {
334
- for (let v = 0; v < u[a].length; v++)
335
- if (u[a][v] === null) {
336
- d = v;
337
- break;
338
- }
339
- const b = f.rowSpan || 1, m = f.colSpan || 1;
340
- for (let v = 0; v < b; v++)
341
- for (let C = 0; C < m; C++)
342
- a + v < o && d + C < c && (u[a + v][d + C] = v === 0 && C === 0 ? "1" : "0");
343
- });
344
- }), r.forEach((l) => {
345
- const a = l.sectionRowIndex;
346
- Array.from(l.querySelectorAll("th,td")).forEach((d) => {
347
- for (let f = 0; f < u[a].length; f++)
348
- if (u[a][f] === "1") {
349
- d.dataset.col = f, u[a][f] = "0";
350
- break;
351
- }
352
- });
353
- });
354
- }, "#resetColIndex"));
355
- /**
356
- * 🎯 순수 바닐라 μžλ°”μŠ€ν¬λ¦½νŠΈ(Vanilla JS) 기반의 κΉ”λ”ν•œ #createSplitTable
357
- */
358
- g(this, K, /* @__PURE__ */ h((t, s) => {
359
- const r = t.cloneNode(!0);
360
- return s === "left" ? r.querySelectorAll("col, th, td").forEach((n) => {
361
- n.getAttribute("fixed") !== "left" && n.remove();
362
- }) : s === "right" ? r.querySelectorAll("col, th, td").forEach((n) => {
363
- n.getAttribute("fixed") !== "right" && n.remove();
364
- }) : r.querySelectorAll("[fixed=left], [fixed=right]").forEach((n) => {
365
- n.remove();
366
- }), r;
367
- }, "#createSplitTable"));
368
- S(this, "generate", /* @__PURE__ */ h((t) => {
388
+ f(this, H, null);
389
+ f(this, Y);
390
+ v(this, "generate", /* @__PURE__ */ a((t) => {
369
391
  if (!t) return;
370
- const s = /* @__PURE__ */ h((l) => {
371
- const a = /* @__PURE__ */ h((f) => {
372
- if (f.querySelector("colgroup")) return;
373
- const b = f.querySelector("tbody tr") || f.querySelector("tr"), m = b ? b.querySelectorAll("th, td").length : 1, v = document.createElement("colgroup"), C = Math.max(Math.floor(f.clientWidth / m), 100);
374
- for (let De = 0; De < m; De++) {
375
- const Ne = document.createElement("col");
376
- Ne.setAttribute("width", C), v.appendChild(Ne);
377
- }
378
- f.prepend(v);
379
- }, "ensureColgroup"), d = /* @__PURE__ */ h((f) => {
380
- if (f.querySelector("thead")) return;
381
- const b = document.createElement("thead"), m = f.querySelector("colgroup");
382
- m ? m.after(b) : f.prepend(b);
383
- }, "ensureThead");
384
- return a(l), d(l), l.classList.add("nine-table-element"), l;
385
- }, "initializeTable"), r = t.cloneNode(!0);
386
- y(this, E, s(r)), e(this, E).style.display = "table", e(this, J).call(this, e(this, E), "thead"), e(this, J).call(this, e(this, E), "tbody"), Array.from(e(this, E).querySelectorAll("colgroup col")).forEach((l, a) => {
387
- const d = l.getAttribute("fixed");
388
- d && e(this, E).querySelectorAll(`[data-col="${a}"]`).forEach((f) => {
389
- f.setAttribute("fixed", d);
390
- });
391
- }), L.log(e(this, E));
392
- const o = this.querySelector(".ng-container-left"), c = this.querySelector(".ng-container-body"), u = this.querySelector(".ng-container-right");
393
- if (c) {
394
- const l = e(this, K).call(this, e(this, E), null);
395
- c.innerHTML = "", c.appendChild(l), L.log(e(this, E)), L.log(l), e(this, F).initialize(e(this, E));
392
+ g(this, H, Re.compile(t)), e(this, H).style.display = "table";
393
+ const s = this.querySelector(".ng-container-left"), n = this.querySelector(".ng-container-body"), r = this.querySelector(".ng-container-right");
394
+ if (n) {
395
+ const o = e(this, U).call(this, e(this, H), null);
396
+ n.innerHTML = "", n.appendChild(o), e(this, Y).initialize(e(this, H));
396
397
  }
397
- if (o) {
398
- const l = e(this, K).call(this, e(this, E), "left");
399
- let a = 0;
400
- l.querySelectorAll("col").forEach((f) => {
401
- const b = parseInt(f.getAttribute("width"), 10);
402
- isNaN(b) || (a += b);
403
- }), o.innerHTML = "", o.appendChild(l);
404
- const d = a > 0 ? a : 0;
405
- o.style.flex = `0 0 ${d}px`, o.style.width = `${d}px`;
398
+ if (s) {
399
+ const o = e(this, U).call(this, e(this, H), "left");
400
+ let l = 0;
401
+ o.querySelectorAll("col").forEach((c) => {
402
+ const d = parseInt(c.getAttribute("width"), 10);
403
+ isNaN(d) || (l += d);
404
+ }), s.innerHTML = "", s.appendChild(o);
405
+ const h = l > 0 ? l : 0;
406
+ s.style.flex = `0 0 ${h}px`, s.style.width = `${h}px`;
406
407
  }
407
- if (u) {
408
- const l = e(this, K).call(this, e(this, E), "right");
409
- let a = 0;
410
- l.querySelectorAll("col").forEach((f) => {
411
- const b = parseInt(f.getAttribute("width"), 10);
412
- isNaN(b) || (a += b);
413
- }), u.innerHTML = "", u.appendChild(l);
414
- const d = a > 0 ? a : 0;
415
- u.style.flex = `0 0 ${d}px`, u.style.width = `${d}px`;
408
+ if (r) {
409
+ const o = e(this, U).call(this, e(this, H), "right");
410
+ let l = 0;
411
+ o.querySelectorAll("col").forEach((c) => {
412
+ const d = parseInt(c.getAttribute("width"), 10);
413
+ isNaN(d) || (l += d);
414
+ }), r.innerHTML = "", r.appendChild(o);
415
+ const h = l > 0 ? l : 0;
416
+ r.style.flex = `0 0 ${h}px`, r.style.width = `${h}px`;
416
417
  }
417
- c && c.addEventListener("scroll", () => {
418
- var l;
419
- (l = this.querySelector("nine-table-hscrollbar")) == null || l.refresh();
418
+ n && n.addEventListener("scroll", () => {
419
+ var o;
420
+ (o = this.querySelector("nine-table-hscrollbar")) == null || o.refresh();
420
421
  }), setTimeout(() => {
421
- var l;
422
- e(this, Q).call(this), (l = this.querySelector("nine-table-hscrollbar")) == null || l.refresh();
422
+ var o;
423
+ e(this, J).call(this), (o = this.querySelector("nine-table-hscrollbar")) == null || o.refresh();
423
424
  }, 0);
424
425
  }, "generate"));
425
- S(this, "getRowHeight", /* @__PURE__ */ h(() => e(this, F).getRowHeight(), "getRowHeight"));
426
- S(this, "scrollToX", /* @__PURE__ */ h((t) => {
426
+ /**
427
+ * 🎯 λ§ˆμŠ€ν„° ν…Œμ΄λΈ”μ„ 기반으둜 νŠΉμ • fixed νƒ€μž… μ˜μ—­λ§Œ λ‚¨κΈ°λŠ” λΆ„ν•  헬퍼
428
+ */
429
+ f(this, U, /* @__PURE__ */ a((t, s) => {
430
+ const n = t.cloneNode(!0);
431
+ return s === "left" ? n.querySelectorAll("col, th, td").forEach((r) => {
432
+ r.getAttribute("fixed") !== "left" && r.remove();
433
+ }) : s === "right" ? n.querySelectorAll("col, th, td").forEach((r) => {
434
+ r.getAttribute("fixed") !== "right" && r.remove();
435
+ }) : n.querySelectorAll("[fixed=left], [fixed=right]").forEach((r) => {
436
+ r.remove();
437
+ }), n;
438
+ }, "#createSplitTable"));
439
+ v(this, "getRowHeight", /* @__PURE__ */ a(() => e(this, Y).getRowHeight(), "getRowHeight"));
440
+ v(this, "scrollToX", /* @__PURE__ */ a((t) => {
427
441
  const s = this.querySelector(".ng-container-body");
428
442
  s && (s.scrollLeft = t);
429
443
  }, "scrollToX"));
430
- S(this, "scrollToY", /* @__PURE__ */ h((t) => {
444
+ v(this, "scrollToY", /* @__PURE__ */ a((t) => {
431
445
  const s = this.querySelector(".ng-container-body");
432
446
  s && (s.scrollTop = t);
433
447
  }, "scrollToY"));
434
- g(this, Q, /* @__PURE__ */ h(() => {
435
- var l, a, d;
436
- const t = this.querySelector(".ng-container-left table"), s = this.querySelector(".ng-container-body table"), r = this.querySelector(".ng-container-right table");
448
+ f(this, J, /* @__PURE__ */ a(() => {
449
+ var c, d, u;
450
+ const t = this.querySelector(".ng-container-left table"), s = this.querySelector(".ng-container-body table"), n = this.querySelector(".ng-container-right table");
437
451
  if (!s) return;
438
- const n = t ? Array.from(t.querySelectorAll("tr")) : [], o = Array.from(s.querySelectorAll("tr")), c = r ? Array.from(r.querySelectorAll("tr")) : [], u = Math.max(n.length, o.length, c.length);
439
- for (let f = 0; f < u; f++) {
440
- const b = [
441
- ((l = n[f]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
442
- ((a = o[f]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
443
- ((d = c[f]) == null ? void 0 : d.getBoundingClientRect().height) || 0
444
- ], m = Math.max(...b);
445
- m > 0 && (n[f] && (n[f].style.height = `${m}px`), o[f] && (o[f].style.height = `${m}px`), c[f] && (c[f].style.height = `${m}px`));
452
+ const r = t ? Array.from(t.querySelectorAll("tr")) : [], o = Array.from(s.querySelectorAll("tr")), l = n ? Array.from(n.querySelectorAll("tr")) : [], h = Math.max(r.length, o.length, l.length);
453
+ for (let b = 0; b < h; b++) {
454
+ const w = [
455
+ ((c = r[b]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
456
+ ((d = o[b]) == null ? void 0 : d.getBoundingClientRect().height) || 0,
457
+ ((u = l[b]) == null ? void 0 : u.getBoundingClientRect().height) || 0
458
+ ], x = Math.max(...w);
459
+ x > 0 && (r[b] && (r[b].style.height = `${x}px`), o[b] && (o[b].style.height = `${x}px`), l[b] && (l[b].style.height = `${x}px`));
446
460
  }
447
461
  }, "#syncRowHeights"));
448
- g(this, de, /* @__PURE__ */ h(() => {
449
- e(this, fe).call(this), new MutationObserver((t) => {
462
+ f(this, he, /* @__PURE__ */ a(() => {
463
+ e(this, de).call(this), new MutationObserver((t) => {
450
464
  for (const s of t)
451
- s.attributeName === "class" && this.classList.contains("active") && e(this, Q).call(this);
465
+ s.attributeName === "class" && this.classList.contains("active") && e(this, J).call(this);
452
466
  }).observe(this, { attributes: !0 });
453
467
  }, "#init"));
454
- g(this, fe, /* @__PURE__ */ h(() => {
455
- const t = G.SCROLLBAR_SIZE;
468
+ f(this, de, /* @__PURE__ */ a(() => {
469
+ const t = j.SCROLLBAR_SIZE;
456
470
  this.innerHTML = `
457
471
  <style>
458
472
  nine-table-sheet {
@@ -575,163 +589,92 @@ const G = class G extends HTMLElement {
575
589
  </div>
576
590
  `;
577
591
  }, "#render"));
578
- y(this, F, new Re(this));
592
+ g(this, Y, new Se(this));
579
593
  }
580
594
  connectedCallback() {
581
- e(this, de).call(this);
595
+ e(this, he).call(this);
582
596
  }
583
597
  disconnectedCallback() {
584
- this.innerHTML = "", L.log("NineTableSheet destroyed.");
598
+ this.innerHTML = "", Z.log("NineTableSheet destroyed.");
585
599
  }
586
600
  };
587
- E = new WeakMap(), F = new WeakMap(), J = new WeakMap(), K = new WeakMap(), Q = new WeakMap(), de = new WeakMap(), fe = new WeakMap(), h(G, "NineTableSheet"), S(G, "SCROLLBAR_SIZE", 16);
588
- let re = G;
589
- customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", re);
590
- var ue, ee;
591
- const $e = class $e extends HTMLElement {
601
+ H = new WeakMap(), Y = new WeakMap(), U = new WeakMap(), J = new WeakMap(), he = new WeakMap(), de = new WeakMap(), a(j, "NineTableSheet"), v(j, "SCROLLBAR_SIZE", 16);
602
+ let ie = j;
603
+ customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", ie);
604
+ var fe, Q;
605
+ const Ie = class Ie extends HTMLElement {
592
606
  constructor() {
593
607
  super();
594
- g(this, ue, /* @__PURE__ */ h(() => {
608
+ f(this, fe, /* @__PURE__ */ a(() => {
595
609
  var t;
596
610
  (t = this.querySelector(".nine-tab-bar")) == null || t.addEventListener("click", (s) => {
597
611
  var o;
598
- const r = s.ctrlKey || s.metaKey || s.shiftKey, n = parseInt((o = s.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
599
- e(this, ee).call(this, n, r);
600
- }), e(this, ee).call(this, 0, !1);
612
+ const n = s.ctrlKey || s.metaKey || s.shiftKey, r = parseInt((o = s.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
613
+ e(this, Q).call(this, r, n);
614
+ }), e(this, Q).call(this, 0, !1);
601
615
  }, "#init"));
602
- g(this, ee, /* @__PURE__ */ h((t, s = !1) => {
603
- const r = /* @__PURE__ */ h(() => {
604
- const a = Array.from(this.querySelectorAll("nine-table-sheet"));
605
- Array.from(this.querySelectorAll("nine-splitter")).forEach((b) => b.style.setProperty("display", "none"));
606
- const f = a.filter((b) => b.classList.contains("active"));
607
- f.length < 2 || f.forEach((b) => {
608
- const m = parseInt(b.getAttribute("data-index"), 10), v = this.querySelector(`nine-splitter[data-split-index="${m}"]`), C = a[m + 1];
609
- v && C && C.classList.contains("active") && v.style.setProperty("display", "flex");
616
+ f(this, Q, /* @__PURE__ */ a((t, s = !1) => {
617
+ const n = /* @__PURE__ */ a(() => {
618
+ const d = Array.from(this.querySelectorAll("nine-table-sheet"));
619
+ Array.from(this.querySelectorAll("nine-splitter")).forEach((w) => w.style.setProperty("display", "none"));
620
+ const b = d.filter((w) => w.classList.contains("active"));
621
+ b.length < 2 || b.forEach((w) => {
622
+ const x = parseInt(w.getAttribute("data-index"), 10), I = this.querySelector(`nine-splitter[data-split-index="${x}"]`), ze = d[x + 1];
623
+ I && ze && ze.classList.contains("active") && I.style.setProperty("display", "flex");
610
624
  });
611
- }, "updateSplitters"), n = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), c = n.querySelectorAll(".nine-tab-item"), u = o.querySelectorAll("nine-table-sheet");
612
- if (!c[t]) return;
625
+ }, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), l = r.querySelectorAll(".nine-tab-item"), h = o.querySelectorAll("nine-table-sheet");
626
+ if (!l[t]) return;
613
627
  if (!s)
614
- c.forEach((a, d) => {
615
- a.classList.toggle("active", d === t);
616
- }), u.forEach((a, d) => {
617
- const f = d === t;
618
- a.classList.toggle("active", f), a.style.flex = f ? "1 1 100%" : "";
628
+ l.forEach((d, u) => {
629
+ d.classList.toggle("active", u === t);
630
+ }), h.forEach((d, u) => {
631
+ const b = u === t;
632
+ d.classList.toggle("active", b), d.style.flex = b ? "1 1 100%" : "";
619
633
  });
620
634
  else {
621
- const a = c[t], d = n.querySelectorAll(".nine-tab-item.active");
622
- if (a.classList.contains("active") && d.length <= 1)
635
+ const d = l[t], u = r.querySelectorAll(".nine-tab-item.active");
636
+ if (d.classList.contains("active") && u.length <= 1)
623
637
  return;
624
- a.classList.toggle("active");
625
- const f = o.querySelector(`nine-table-sheet[data-index="${t}"]`);
626
- f && (f.classList.toggle("active"), f.classList.contains("active") || (f.style.flex = ""));
638
+ d.classList.toggle("active");
639
+ const b = o.querySelector(`nine-table-sheet[data-index="${t}"]`);
640
+ b && (b.classList.toggle("active"), b.classList.contains("active") || (b.style.flex = ""));
627
641
  }
628
- const l = o.querySelectorAll("nine-table-sheet.active");
629
- l == null || l.forEach((a) => {
630
- a.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
631
- }), r();
642
+ const c = o.querySelectorAll("nine-table-sheet.active");
643
+ c == null || c.forEach((d) => {
644
+ d.style.flex = c.length > 1 ? "1 1 0%" : "1 1 100%";
645
+ }), n();
632
646
  }, "#switchSheet"));
633
647
  }
634
648
  connectedCallback() {
635
- e(this, ue).call(this);
649
+ e(this, fe).call(this);
636
650
  }
637
651
  };
638
- ue = new WeakMap(), ee = new WeakMap(), h($e, "NineTableSheets");
639
- let Ae = $e;
640
- customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", Ae);
641
- var ge, te;
642
- const I = class I {
643
- /**
644
- * 🎯 λ ˆμ΄μ•„μ›ƒ λ‚΄μ˜ μ—¬λŸ¬ rawTables 배열을 μΌκ΄„λ‘œ λ°›μ•„ 단일 λ§ˆμŠ€ν„° ν…œν”Œλ¦ΏμœΌλ‘œ 사전 μ»΄νŒŒμΌν•©λ‹ˆλ‹€.
645
- */
646
- static compileAll(i) {
647
- return Array.isArray(i) ? i.map((t) => I.compile(t)) : [];
648
- }
649
- /**
650
- * 🎯 단일 원본 ν…Œμ΄λΈ”μ„ λ°›μ•„ κΈ°λ³Έ ꡬ쑰 보정 및 2차원 격자 인덱슀 사전 λΆ€μ—¬ μ™„λ£Œλœ λ§ˆμŠ€ν„° ν…Œμ΄λΈ” λ°˜ν™˜
651
- */
652
- static compile(i) {
653
- var r, n, o;
654
- if (!i) return null;
655
- const t = i.cloneNode(!0);
656
- return e(r = I, ge).call(r, t), e(n = I, te).call(n, t, "thead"), e(o = I, te).call(o, t, "tbody"), Array.from(t.querySelectorAll("colgroup col")).forEach((c, u) => {
657
- const l = c.getAttribute("fixed");
658
- l && t.querySelectorAll(`[data-col="${u}"]`).forEach((a) => {
659
- a.setAttribute("fixed", l);
660
- });
661
- }), t;
662
- }
663
- };
664
- ge = new WeakMap(), te = new WeakMap(), h(I, "TableCompiler"), g(I, ge, /* @__PURE__ */ h((i) => {
665
- if (!i.querySelector("colgroup")) {
666
- const t = i.querySelector("tbody tr") || i.querySelector("tr"), s = t ? t.querySelectorAll("th, td").length : 1, r = document.createElement("colgroup"), n = Math.max(Math.floor(i.clientWidth / s), 100);
667
- for (let o = 0; o < s; o++) {
668
- const c = document.createElement("col");
669
- c.setAttribute("width", n), r.appendChild(c);
670
- }
671
- i.prepend(r);
672
- }
673
- if (!i.querySelector("thead")) {
674
- const t = document.createElement("thead"), s = i.querySelector("colgroup");
675
- s ? s.after(t) : i.prepend(t);
676
- }
677
- i.classList.add("nine-table-element"), i.style.display = "table";
678
- }, "#ensureTableStructure")), g(I, te, /* @__PURE__ */ h((i, t) => {
679
- const s = Array.from(i.querySelectorAll(t + " tr")), r = Array.from(i.querySelectorAll(t + " th," + t + " td")), n = s.length;
680
- if (n === 0 || r.length === 0) return;
681
- let o = 0;
682
- r.forEach((u) => {
683
- o += u.colSpan || 1;
684
- });
685
- const c = Array.from(Array(n), () => Array(o).fill(null));
686
- s.forEach((u) => {
687
- const l = u.sectionRowIndex;
688
- let a = 0;
689
- Array.from(u.querySelectorAll("th,td")).forEach((d) => {
690
- for (let m = 0; m < c[l].length; m++)
691
- if (c[l][m] === null) {
692
- a = m;
693
- break;
694
- }
695
- const f = d.rowSpan || 1, b = d.colSpan || 1;
696
- for (let m = 0; m < f; m++)
697
- for (let v = 0; v < b; v++)
698
- l + m < n && a + v < o && (c[l + m][a + v] = m === 0 && v === 0 ? "1" : "0");
699
- });
700
- }), s.forEach((u) => {
701
- const l = u.sectionRowIndex;
702
- Array.from(u.querySelectorAll("th,td")).forEach((a) => {
703
- for (let d = 0; d < c[l].length; d++)
704
- if (c[l][d] === "1") {
705
- a.dataset.col = d, c[l][d] = "0";
706
- break;
707
- }
708
- });
709
- });
710
- }, "#resetColIndex"));
711
- let qe = I;
712
- var R, be, ie, ye;
713
- const We = class We {
652
+ fe = new WeakMap(), Q = new WeakMap(), a(Ie, "NineTableSheets");
653
+ let Ee = Ie;
654
+ customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", Ee);
655
+ var S, ue, ee, ge;
656
+ const Me = class Me {
714
657
  constructor(i) {
715
- g(this, R);
716
- g(this, be, /* @__PURE__ */ h(() => {
717
- e(this, ye).call(this), new ResizeObserver((i) => {
658
+ f(this, S);
659
+ f(this, ue, /* @__PURE__ */ a(() => {
660
+ e(this, ge).call(this), new ResizeObserver((i) => {
718
661
  for (let t of i)
719
- e(this, R).getAttribute("auto-height") === "true" && e(this, ie).call(this);
720
- }).observe(e(this, R));
662
+ e(this, S).getAttribute("auto-height") === "true" && e(this, ee).call(this);
663
+ }).observe(e(this, S));
721
664
  }, "#init"));
722
- g(this, ie, /* @__PURE__ */ h(() => {
723
- var u, l;
724
- const i = Array.from(e(this, R).shadowRoot.querySelectorAll("nine-table-sheet.active"));
665
+ f(this, ee, /* @__PURE__ */ a(() => {
666
+ var h, c;
667
+ const i = Array.from(e(this, S).shadowRoot.querySelectorAll("nine-table-sheet.active"));
725
668
  if (i.length === 0) return;
726
- const t = parseInt(e(this, R).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((a) => a.getRowHeight())), r = (u = e(this, R).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : u.getBoundingClientRect().height, n = (l = e(this, R).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = re.SCROLLBAR_SIZE, c = t * s + r + n + o;
727
- e(this, R).style.height = `${c}px`;
669
+ const t = parseInt(e(this, S).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((d) => d.getRowHeight())), n = (h = e(this, S).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : h.getBoundingClientRect().height, r = (c = e(this, S).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : c.getBoundingClientRect().height, o = ie.SCROLLBAR_SIZE, l = t * s + n + r + o;
670
+ e(this, S).style.height = `${l}px`;
728
671
  }, "#applyAutoHeight"));
729
- g(this, ye, /* @__PURE__ */ h(() => {
730
- const t = Array.from(e(this, R).children).filter((l) => l.tagName === "TABLE"), s = e(this, R).getAttribute("auto-height") === "true", r = t.length, n = t.map((l, a) => {
731
- const f = `<nine-table-sheet class="${a === 0 ? "active" : ""}" data-index="${a}"></nine-table-sheet>`, b = a < r - 1 ? `<nine-splitter class="h" data-split-index="${a}"></nine-splitter>` : "";
732
- return f + b;
733
- }).join(""), o = t.map((l, a) => `<div class="nine-tab-item ${a === 0 ? "active" : ""}" data-index="${a}">Sheet ${a + 1}</div>`).join("");
734
- e(this, R).shadowRoot.innerHTML = `
672
+ f(this, ge, /* @__PURE__ */ a(() => {
673
+ const t = Array.from(e(this, S).children).filter((h) => h.tagName === "TABLE"), s = e(this, S).getAttribute("auto-height") === "true", n = t.length, r = t.map((h, c) => {
674
+ const u = `<nine-table-sheet class="${c === 0 ? "active" : ""}" data-index="${c}"></nine-table-sheet>`, b = c < n - 1 ? `<nine-splitter class="h" data-split-index="${c}"></nine-splitter>` : "";
675
+ return u + b;
676
+ }).join(""), o = t.map((h, c) => `<div class="nine-tab-item ${c === 0 ? "active" : ""}" data-index="${c}">Sheet ${c + 1}</div>`).join("");
677
+ e(this, S).shadowRoot.innerHTML = `
735
678
  <style>
736
679
  :host {
737
680
  display: flex;
@@ -820,7 +763,7 @@ const We = class We {
820
763
  <nine-table-body>
821
764
  <nine-table-summary></nine-table-summary>
822
765
  <nine-table-sheets>
823
- <nine-table-sheets-body>${n}</nine-table-sheets-body>
766
+ <nine-table-sheets-body>${r}</nine-table-sheets-body>
824
767
  <nine-table-sheets-footer>
825
768
  <div class="nine-tab-bar">${o}</div>
826
769
  <div class="sheets-counter">Total : <span id="row-count">0</span></div>
@@ -830,236 +773,236 @@ const We = class We {
830
773
  </nine-table-body>
831
774
  <nine-table-footer></nine-table-footer>
832
775
  `;
833
- const c = e(this, R).shadowRoot.querySelectorAll("nine-table-sheet"), u = qe.compileAll(t);
834
- L.log("==================="), L.log(u[0]), L.log("==================="), c == null || c.forEach((l, a) => {
835
- t[a] && setTimeout(() => {
836
- l.generate(t[a]), s && e(this, ie).call(this);
776
+ const l = e(this, S).shadowRoot.querySelectorAll("nine-table-sheet");
777
+ l == null || l.forEach((h, c) => {
778
+ t[c] && setTimeout(() => {
779
+ h.generate(t[c]), s && e(this, ee).call(this);
837
780
  });
838
781
  });
839
782
  }, "#render"));
840
- y(this, R, i), e(this, be).call(this);
783
+ g(this, S, i), e(this, ue).call(this);
841
784
  }
842
785
  };
843
- R = new WeakMap(), be = new WeakMap(), ie = new WeakMap(), ye = new WeakMap(), h(We, "LayoutManager");
844
- let Te = We;
845
- var O, Y;
846
- const ze = class ze {
786
+ S = new WeakMap(), ue = new WeakMap(), ee = new WeakMap(), ge = new WeakMap(), a(Me, "LayoutManager");
787
+ let Ae = Me;
788
+ var W, V;
789
+ const $e = class $e {
847
790
  constructor(i) {
848
- g(this, O);
849
- g(this, Y, -1);
850
- S(this, "count", /* @__PURE__ */ h(() => e(this, O).rawRecords.length, "count"));
851
- y(this, O, i);
791
+ f(this, W);
792
+ f(this, V, -1);
793
+ v(this, "count", /* @__PURE__ */ a(() => e(this, W).rawRecords.length, "count"));
794
+ g(this, W, i);
852
795
  }
853
796
  get at() {
854
- return e(this, Y);
797
+ return e(this, V);
855
798
  }
856
799
  set at(i) {
857
- var s, r;
858
- y(this, Y, parseInt(i, 10));
859
- const t = ((r = (s = e(this, O).owner).querySelector) == null ? void 0 : r.call(s, ".ng-container-body")) || e(this, O).owner.body;
860
- t && !t.querySelector(`tbody.bindable tr[data-row="${e(this, Y)}"]`) && setTimeout(() => {
861
- var n, o;
862
- (o = (n = e(this, O).owner).scrollTo_V1) == null || o.call(n, e(this, Y));
800
+ var s, n;
801
+ g(this, V, parseInt(i, 10));
802
+ const t = ((n = (s = e(this, W).owner).querySelector) == null ? void 0 : n.call(s, ".ng-container-body")) || e(this, W).owner.body;
803
+ t && !t.querySelector(`tbody.bindable tr[data-row="${e(this, V)}"]`) && setTimeout(() => {
804
+ var r, o;
805
+ (o = (r = e(this, W).owner).scrollTo_V1) == null || o.call(r, e(this, V));
863
806
  });
864
807
  }
865
808
  };
866
- O = new WeakMap(), Y = new WeakMap(), h(ze, "ngRow");
867
- let ke = ze;
868
- var q, x, T, Z, pe, B, me, se, we, xe, j;
869
- const k = class k {
809
+ W = new WeakMap(), V = new WeakMap(), a($e, "ngRow");
810
+ let qe = $e;
811
+ var E, m, A, F, be, O, ye, te, pe, me, K;
812
+ const q = class q {
870
813
  constructor(i, t) {
871
- g(this, q);
872
- g(this, x);
873
- g(this, T, []);
874
- g(this, Z, []);
875
- g(this, pe, 0);
876
- g(this, B, []);
877
- g(this, me, /* @__PURE__ */ h(() => {
878
- y(this, B, []);
879
- const i = e(this, q).template || [];
814
+ f(this, E);
815
+ f(this, m);
816
+ f(this, A, []);
817
+ f(this, F, []);
818
+ f(this, be, 0);
819
+ f(this, O, []);
820
+ f(this, ye, /* @__PURE__ */ a(() => {
821
+ g(this, O, []);
822
+ const i = e(this, E).template || [];
880
823
  Array.from(i).forEach((t) => {
881
824
  var s;
882
- e(this, B).push(((s = t.getBoundingClientRect) == null ? void 0 : s.call(t).height) || 24);
883
- }), (e(this, x).rawRecords || []).forEach((t) => {
884
- t.__ng || (t.__ng = e(this, se).call(this)), t.__ng.height = e(this, B).slice();
825
+ e(this, O).push(((s = t.getBoundingClientRect) == null ? void 0 : s.call(t).height) || 24);
826
+ }), (e(this, m).rawRecords || []).forEach((t) => {
827
+ t.__ng || (t.__ng = e(this, te).call(this)), t.__ng.height = e(this, O).slice();
885
828
  });
886
829
  }, "#initialize"));
887
- S(this, "set", /* @__PURE__ */ h((i) => {
830
+ v(this, "set", /* @__PURE__ */ a((i) => {
888
831
  this.clear(), this.add(i, !1);
889
832
  }, "set"));
890
- g(this, se, /* @__PURE__ */ h(() => ({
891
- rowState: k.ROW_STATE.EMPTY,
833
+ f(this, te, /* @__PURE__ */ a(() => ({
834
+ rowState: q.ROW_STATE.EMPTY,
892
835
  deleted: !1,
893
836
  filtered: !1,
894
- height: e(this, B).slice(),
837
+ height: e(this, O).slice(),
895
838
  o: {},
896
839
  c: {},
897
- _: [0, 0, 0, 0, k.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, B).slice(), -1, {}, {}]
840
+ _: [0, 0, 0, 0, q.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, O).slice(), -1, {}, {}]
898
841
  }), "#getDefaultMeta"));
899
- S(this, "reset", /* @__PURE__ */ h(() => {
900
- y(this, T, []), y(this, Z, []);
842
+ v(this, "reset", /* @__PURE__ */ a(() => {
843
+ g(this, A, []), g(this, F, []);
901
844
  }, "reset"));
902
- S(this, "clear", /* @__PURE__ */ h(() => {
845
+ v(this, "clear", /* @__PURE__ */ a(() => {
903
846
  var i;
904
- e(this, x).rawRecords = [], y(this, T, []), y(this, Z, []), (i = e(this, x).viewRecords) != null && i.reset && e(this, x).viewRecords.reset();
847
+ e(this, m).rawRecords = [], g(this, A, []), g(this, F, []), (i = e(this, m).viewRecords) != null && i.reset && e(this, m).viewRecords.reset();
905
848
  }, "clear"));
906
- g(this, we, /* @__PURE__ */ h((i) => {
907
- var r;
849
+ f(this, pe, /* @__PURE__ */ a((i) => {
850
+ var n;
908
851
  Array.isArray(i) || (i = [i]);
909
- const t = typeof ((r = e(this, q).fields) == null ? void 0 : r.get) == "function" ? e(this, q).fields.get() : Object.keys(i[0] || {}), s = [];
910
- return i.forEach((n) => {
852
+ const t = typeof ((n = e(this, E).fields) == null ? void 0 : n.get) == "function" ? e(this, E).fields.get() : Object.keys(i[0] || {}), s = [];
853
+ return i.forEach((r) => {
911
854
  const o = { v: [] };
912
- t.forEach((c) => {
913
- o.v.push(n[c] !== void 0 && n[c] !== null ? n[c] : "");
855
+ t.forEach((l) => {
856
+ o.v.push(r[l] !== void 0 && r[l] !== null ? r[l] : "");
914
857
  }), s.push(o);
915
858
  }), s;
916
859
  }, "#json2Array"));
917
- g(this, xe, /* @__PURE__ */ h((i) => (Array.isArray(i) || (i = [i]), i.forEach((t) => {
918
- t.__ng = e(this, se).call(this), t.__ng.rowid = this.nextId, t.__ng.rowState = k.ROW_STATE.INSERT, t.__ng._[0] = t.__ng.rowid;
860
+ f(this, me, /* @__PURE__ */ a((i) => (Array.isArray(i) || (i = [i]), i.forEach((t) => {
861
+ t.__ng = e(this, te).call(this), t.__ng.rowid = this.nextId, t.__ng.rowState = q.ROW_STATE.INSERT, t.__ng._[0] = t.__ng.rowid;
919
862
  }), i), "#defaultInsert"));
920
- S(this, "add", /* @__PURE__ */ h((i, t = !0) => {
921
- var n;
863
+ v(this, "add", /* @__PURE__ */ a((i, t = !0) => {
864
+ var r;
922
865
  i === void 0 && (i = {});
923
- const s = e(this, we).call(this, i);
924
- e(this, x).rawRecords = e(this, x).rawRecords.concat(e(this, xe).call(this, s)), this.resetRecords();
925
- const r = this.count() - 1;
926
- return t || s.forEach((o, c) => {
927
- const u = e(this, x).rawRecords[r - c];
928
- u && (u.__ng.rowState = k.ROW_STATE.EMPTY);
929
- }), (n = e(this, x).viewRecords) != null && n.reset && e(this, x).viewRecords.reset(), r;
866
+ const s = e(this, pe).call(this, i);
867
+ e(this, m).rawRecords = e(this, m).rawRecords.concat(e(this, me).call(this, s)), this.resetRecords();
868
+ const n = this.count() - 1;
869
+ return t || s.forEach((o, l) => {
870
+ const h = e(this, m).rawRecords[n - l];
871
+ h && (h.__ng.rowState = q.ROW_STATE.EMPTY);
872
+ }), (r = e(this, m).viewRecords) != null && r.reset && e(this, m).viewRecords.reset(), n;
930
873
  }, "add"));
931
- S(this, "delete", /* @__PURE__ */ h((i) => {
874
+ v(this, "delete", /* @__PURE__ */ a((i) => {
932
875
  var s;
933
876
  let t = [];
934
- Array.isArray(i) ? t = i : typeof i > "u" ? t = [e(this, x).owner.row.at] : t = [parseInt(i, 10)], t.sort((r, n) => n - r).forEach((r) => {
935
- if (e(this, T)[r]) {
936
- const n = e(this, T)[r].__ng.rowid;
937
- e(this, T)[r].__ng.rowState === k.ROW_STATE.INSERT ? e(this, x).rawRecords = e(this, x).rawRecords.filter((o) => o.__ng.rowid !== n) : e(this, x).rawRecords.forEach((o) => {
938
- o.__ng.rowid === n && (o.__ng.deleted = !0, o.__ng.rowState = k.ROW_STATE.DELETE);
877
+ Array.isArray(i) ? t = i : typeof i > "u" ? t = [e(this, m).owner.row.at] : t = [parseInt(i, 10)], t.sort((n, r) => r - n).forEach((n) => {
878
+ if (e(this, A)[n]) {
879
+ const r = e(this, A)[n].__ng.rowid;
880
+ e(this, A)[n].__ng.rowState === q.ROW_STATE.INSERT ? e(this, m).rawRecords = e(this, m).rawRecords.filter((o) => o.__ng.rowid !== r) : e(this, m).rawRecords.forEach((o) => {
881
+ o.__ng.rowid === r && (o.__ng.deleted = !0, o.__ng.rowState = q.ROW_STATE.DELETE);
939
882
  });
940
883
  }
941
- }), this.resetRecords(), (s = e(this, x).viewRecords) != null && s.reset && e(this, x).viewRecords.reset();
884
+ }), this.resetRecords(), (s = e(this, m).viewRecords) != null && s.reset && e(this, m).viewRecords.reset();
942
885
  }, "delete"));
943
- S(this, "setValue", /* @__PURE__ */ h((i, t, s) => {
944
- var u;
886
+ v(this, "setValue", /* @__PURE__ */ a((i, t, s) => {
887
+ var h;
945
888
  i = parseInt(i, 10);
946
- const n = (typeof ((u = e(this, q).fields) == null ? void 0 : u.get) == "function" ? e(this, q).fields.get() : []).indexOf(t);
947
- if (n < 0) return;
889
+ const r = (typeof ((h = e(this, E).fields) == null ? void 0 : h.get) == "function" ? e(this, E).fields.get() : []).indexOf(t);
890
+ if (r < 0) return;
948
891
  const o = this.getValidData()[i];
949
892
  if (!o) return;
950
- const c = o.v[n];
951
- c !== s && o.__ng.rowState !== k.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(t) || (o.__ng.o[t] = c), o.__ng.rowState = k.ROW_STATE.UPDATE), o.v[n] = s, e(this, x).owner.refreshData && e(this, x).owner.refreshData(i);
893
+ const l = o.v[r];
894
+ l !== s && o.__ng.rowState !== q.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(t) || (o.__ng.o[t] = l), o.__ng.rowState = q.ROW_STATE.UPDATE), o.v[r] = s, e(this, m).owner.refreshData && e(this, m).owner.refreshData(i);
952
895
  }, "setValue"));
953
- S(this, "resetRecords", /* @__PURE__ */ h(() => {
954
- y(this, Z, e(this, x).rawRecords.filter((i) => !i.__ng.deleted)), y(this, T, e(this, x).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), e(this, x).rawRecords.forEach((i, t) => {
896
+ v(this, "resetRecords", /* @__PURE__ */ a(() => {
897
+ g(this, F, e(this, m).rawRecords.filter((i) => !i.__ng.deleted)), g(this, A, e(this, m).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), e(this, m).rawRecords.forEach((i, t) => {
955
898
  i.__ng.rowidx = t;
956
- }), e(this, T).forEach((i, t) => {
899
+ }), e(this, A).forEach((i, t) => {
957
900
  i.__ng.i = t;
958
901
  });
959
902
  }, "resetRecords"));
960
- S(this, "getValidData", /* @__PURE__ */ h(() => (e(this, T).length === 0 && e(this, x).rawRecords.length > 0 && this.resetRecords(), e(this, T)), "getValidData"));
961
- g(this, j, /* @__PURE__ */ h((i) => {
903
+ v(this, "getValidData", /* @__PURE__ */ a(() => (e(this, A).length === 0 && e(this, m).rawRecords.length > 0 && this.resetRecords(), e(this, A)), "getValidData"));
904
+ f(this, K, /* @__PURE__ */ a((i) => {
962
905
  var s;
963
906
  if (!i) return i;
964
- const t = typeof ((s = e(this, q).fields) == null ? void 0 : s.get) == "function" ? e(this, q).fields.get() : [];
965
- return Array.isArray(i) ? i.filter((r) => !r.__ng.deleted).map((r) => {
966
- const n = {};
967
- return t.forEach((o, c) => {
968
- n[o] = r.v ? r.v[c] : r[o];
969
- }), n.__ng = r.__ng, n;
907
+ const t = typeof ((s = e(this, E).fields) == null ? void 0 : s.get) == "function" ? e(this, E).fields.get() : [];
908
+ return Array.isArray(i) ? i.filter((n) => !n.__ng.deleted).map((n) => {
909
+ const r = {};
910
+ return t.forEach((o, l) => {
911
+ r[o] = n.v ? n.v[l] : n[o];
912
+ }), r.__ng = n.__ng, r;
970
913
  }) : i;
971
914
  }, "#conv2"));
972
- S(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
973
- S(this, "get", /* @__PURE__ */ h((i, t) => {
974
- var n;
915
+ v(this, "count", /* @__PURE__ */ a(() => this.getValidData().length, "count"));
916
+ v(this, "get", /* @__PURE__ */ a((i, t) => {
917
+ var r;
975
918
  const s = this.getValidData();
976
919
  if (!s || s.length <= 0) return;
977
- if (i == null) return e(this, j).call(this, s);
920
+ if (i == null) return e(this, K).call(this, s);
978
921
  if (i < 0 || i >= s.length) return null;
979
- const r = typeof ((n = e(this, q).fields) == null ? void 0 : n.get) == "function" ? e(this, q).fields.get() : [];
922
+ const n = typeof ((r = e(this, E).fields) == null ? void 0 : r.get) == "function" ? e(this, E).fields.get() : [];
980
923
  if (t != null) {
981
- const o = r.indexOf(t);
924
+ const o = n.indexOf(t);
982
925
  return o >= 0 ? s[i].v[o] : null;
983
926
  }
984
- return e(this, j).call(this, s[i]);
927
+ return e(this, K).call(this, s[i]);
985
928
  }, "get"));
986
- y(this, q, i), y(this, x, t), e(this, me).call(this);
929
+ g(this, E, i), g(this, m, t), e(this, ye).call(this);
987
930
  }
988
931
  get source() {
989
- return e(this, j).call(this, e(this, x).rawRecords);
932
+ return e(this, K).call(this, e(this, m).rawRecords);
990
933
  }
991
934
  set source(i) {
992
935
  this.clear(), this.add(i, !1);
993
936
  }
994
937
  get nextId() {
995
- return ++Ye(this, pe)._;
938
+ return ++Pe(this, be)._;
996
939
  }
997
940
  get length() {
998
- return e(this, T).length;
941
+ return e(this, A).length;
999
942
  }
1000
943
  getRowCount() {
1001
944
  return this.length;
1002
945
  }
1003
946
  };
1004
- q = new WeakMap(), x = new WeakMap(), T = new WeakMap(), Z = new WeakMap(), pe = new WeakMap(), B = new WeakMap(), me = new WeakMap(), se = new WeakMap(), we = new WeakMap(), xe = new WeakMap(), j = new WeakMap(), h(k, "ngData"), // 🎯 ν–‰ μƒνƒœ μ •μ˜ μƒμˆ˜λ₯Ό 클래슀 λ‚΄λΆ€λ‘œ λ‚΄μž¬ν™”
1005
- S(k, "ROW_STATE", {
947
+ E = new WeakMap(), m = new WeakMap(), A = new WeakMap(), F = new WeakMap(), be = new WeakMap(), O = new WeakMap(), ye = new WeakMap(), te = new WeakMap(), pe = new WeakMap(), me = new WeakMap(), K = new WeakMap(), a(q, "ngData"), // 🎯 ν–‰ μƒνƒœ μ •μ˜ μƒμˆ˜λ₯Ό 클래슀 λ‚΄λΆ€λ‘œ λ‚΄μž¬ν™”
948
+ v(q, "ROW_STATE", {
1006
949
  EMPTY: "EMPTY",
1007
950
  NORMAL: "NORMAL",
1008
951
  INSERT: "INSERT",
1009
952
  UPDATE: "UPDATE",
1010
953
  DELETE: "DELETE"
1011
954
  });
1012
- let Le = k;
1013
- const Oe = class Oe {
955
+ let Te = q;
956
+ const We = class We {
1014
957
  constructor(i) {
1015
- this.owner = i, this.row = new ke(this), this.data = new Le(i, this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
958
+ this.owner = i, this.row = new qe(this), this.data = new Te(i, this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
1016
959
  var t;
1017
960
  (t = this.owner.view) != null && t.redraw && this.owner.view.redraw();
1018
961
  }, this.setDataSource = (t) => {
1019
962
  this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(t || []);
1020
963
  }, this.getRowState = (t) => {
1021
- var r, n;
964
+ var n, r;
1022
965
  const s = parseInt(t, 10);
1023
966
  if (!(s >= this.data.count()))
1024
- return (n = (r = this.data.getValidData()[s]) == null ? void 0 : r.__ng) == null ? void 0 : n.rowState;
967
+ return (r = (n = this.data.getValidData()[s]) == null ? void 0 : n.__ng) == null ? void 0 : r.rowState;
1025
968
  }, this.getRowPosition = () => this.row.at, this.setRowPosition = (t) => {
1026
969
  this.row.at = t;
1027
- }, this.scrollTo_V1 = (t) => (t < 0 && (t = 0), t >= this.rawRecords.length && (t = this.rawRecords.length - 1), this.viewRecords.rawIndex = t, this.viewRecords.reset && this.viewRecords.reset(), !(t <= 0 || t >= this.rawRecords.length - 1)), this.getColumn = (t, s) => this.data.get(t, s), this.setColumn = (t, s, r) => {
1028
- t = parseInt(t, 10), this.data.setValue(t, s, r);
970
+ }, this.scrollTo_V1 = (t) => (t < 0 && (t = 0), t >= this.rawRecords.length && (t = this.rawRecords.length - 1), this.viewRecords.rawIndex = t, this.viewRecords.reset && this.viewRecords.reset(), !(t <= 0 || t >= this.rawRecords.length - 1)), this.getColumn = (t, s) => this.data.get(t, s), this.setColumn = (t, s, n) => {
971
+ t = parseInt(t, 10), this.data.setValue(t, s, n);
1029
972
  }, this.setDataSource([]);
1030
973
  }
1031
974
  };
1032
- h(Oe, "ngDataManager");
1033
- let Ce = Oe;
1034
- var U, ve;
1035
- const Be = class Be extends HTMLElement {
975
+ a(We, "ngDataManager");
976
+ let ke = We;
977
+ var X, we;
978
+ const Oe = class Oe extends HTMLElement {
1036
979
  constructor() {
1037
980
  super();
1038
981
  //#created = false;
1039
- g(this, U);
1040
- g(this, ve);
1041
- this.attachShadow({ mode: "open" }), y(this, U, new Ce(this));
982
+ f(this, X);
983
+ f(this, we);
984
+ this.attachShadow({ mode: "open" }), g(this, X, new ke(this));
1042
985
  }
1043
986
  connectedCallback() {
1044
- y(this, ve, new Te(this)), L.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
987
+ g(this, we, new Ae(this)), Z.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
1045
988
  }
1046
989
  disconnectedCallback() {
1047
- L.log("NineTable disconnected.");
990
+ Z.log("NineTable disconnected.");
1048
991
  }
1049
992
  // 🎯 μ™ΈλΆ€μ—μ„œ grid.data.set(...) ν˜•νƒœλ‘œ μ ‘κ·Όν•  수 μžˆλ„λ‘ 데이터 λ§€λ‹ˆμ € μ˜€ν”ˆ
1050
993
  get data() {
1051
- return e(this, U).data;
994
+ return e(this, X).data;
1052
995
  }
1053
996
  // 🎯 ν–‰(row) κ΄€λ ¨ μ œμ–΄ μ ‘κ·Όμž μ˜€ν”ˆ
1054
997
  get row() {
1055
- return e(this, U).row;
998
+ return e(this, X).row;
1056
999
  }
1057
1000
  // 🎯 전체 데이터 λ§€λ‹ˆμ € μ ‘κ·Ό ν•„μš”ν•  경우
1058
1001
  get dataManager() {
1059
- return e(this, U);
1002
+ return e(this, X);
1060
1003
  }
1061
1004
  };
1062
- U = new WeakMap(), ve = new WeakMap(), h(Be, "NineTable");
1063
- let _e = Be;
1064
- customElements.get("nine-table") || customElements.define("nine-table", _e);
1005
+ X = new WeakMap(), we = new WeakMap(), a(Oe, "NineTable");
1006
+ let Le = Oe;
1007
+ customElements.get("nine-table") || customElements.define("nine-table", Le);
1065
1008
  //# sourceMappingURL=nine-table.js.map