@ninebone/table 0.0.266 β†’ 0.0.268

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