@ninebone/table 0.0.242 β†’ 0.0.244

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,51 +1,51 @@
1
- var $e = Object.defineProperty;
2
- var We = (w) => {
3
- throw TypeError(w);
1
+ var ze = Object.defineProperty;
2
+ var Oe = (m) => {
3
+ throw TypeError(m);
4
4
  };
5
- var Be = (w, i, t) => i in w ? $e(w, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : w[i] = t;
6
- var a = (w, i) => $e(w, "name", { value: i, configurable: !0 });
7
- var x = (w, i, t) => Be(w, typeof i != "symbol" ? i + "" : i, t), ze = (w, i, t) => i.has(w) || We("Cannot " + t);
8
- var e = (w, i, t) => (ze(w, i, "read from private field"), t ? t.call(w) : i.get(w)), d = (w, i, t) => i.has(w) ? We("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(w) : i.set(w, t), y = (w, i, t, s) => (ze(w, i, "write to private field"), s ? s.call(w, t) : i.set(w, t), t);
9
- var Oe = (w, i, t, s) => ({
5
+ var Ne = (m, i, t) => i in m ? ze(m, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : m[i] = t;
6
+ var h = (m, i) => ze(m, "name", { value: i, configurable: !0 });
7
+ var v = (m, i, t) => Ne(m, typeof i != "symbol" ? i + "" : i, t), Be = (m, i, t) => i.has(m) || Oe("Cannot " + t);
8
+ var e = (m, i, t) => (Be(m, i, "read from private field"), t ? t.call(m) : i.get(m)), u = (m, i, t) => i.has(m) ? Oe("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(m) : i.set(m, t), y = (m, i, t, s) => (Be(m, i, "write to private field"), s ? s.call(m, t) : i.set(m, t), t);
9
+ var De = (m, i, t, s) => ({
10
10
  set _(n) {
11
- y(w, i, n, t);
11
+ y(m, i, n, t);
12
12
  },
13
13
  get _() {
14
- return e(w, i, s);
14
+ return e(m, i, s);
15
15
  }
16
16
  });
17
- import { trace as De } from "@ninebone/util";
18
- const qe = class qe extends De.constructor {
17
+ import { trace as Pe } from "@ninebone/util";
18
+ const qe = class qe extends Pe.constructor {
19
19
  constructor() {
20
20
  super(), this.init("nine-table", "green");
21
21
  }
22
22
  };
23
- a(qe, "Trace");
23
+ h(qe, "Trace");
24
24
  let me = qe;
25
- const j = new me();
26
- var L, B, p, D, N, P, ie, V, se;
25
+ const M = new me();
26
+ var C, B, p, D, N, P, ie, V, se;
27
27
  const ke = class ke extends HTMLElement {
28
28
  constructor() {
29
29
  super();
30
- d(this, L);
31
- d(this, B, !1);
32
- d(this, p);
33
- d(this, D);
34
- d(this, N);
35
- d(this, P);
36
- d(this, ie, /* @__PURE__ */ a(() => {
37
- if (!e(this, L)) return;
38
- const t = e(this, L).querySelector(".ng-container-body");
30
+ u(this, C);
31
+ u(this, B, !1);
32
+ u(this, p);
33
+ u(this, D);
34
+ u(this, N);
35
+ u(this, P);
36
+ u(this, ie, /* @__PURE__ */ h(() => {
37
+ if (!e(this, C)) return;
38
+ const t = e(this, C).querySelector(".ng-container-body");
39
39
  t && (y(this, P, new ResizeObserver(() => {
40
40
  this.refresh();
41
41
  })), e(this, P).observe(t));
42
42
  }, "#observeResize"));
43
- x(this, "refresh", /* @__PURE__ */ a(() => {
44
- if (!e(this, L) || !e(this, p) || e(this, B)) return;
43
+ v(this, "refresh", /* @__PURE__ */ h(() => {
44
+ if (!e(this, C) || !e(this, p) || e(this, B)) return;
45
45
  const t = e(this, p).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, L).querySelector(".ng-container-bottom"), c = t.clientWidth, f = s.scrollWidth;
48
- if (c !== 0 && f > c)
47
+ const n = e(this, p).track, r = e(this, p).thumb, o = e(this, C).querySelector(".ng-container-bottom"), a = t.clientWidth, d = s.scrollWidth;
48
+ if (a !== 0 && d > a)
49
49
  o && (o.style.display = "flex");
50
50
  else {
51
51
  o && (o.style.display = "none");
@@ -53,29 +53,29 @@ const ke = class ke extends HTMLElement {
53
53
  }
54
54
  const l = n.clientWidth;
55
55
  if (l <= 0) return;
56
- const h = Math.max(Math.min(l * (c / f), l), 20);
57
- r.style.width = `${h}px`;
58
- const u = t.scrollLeft, g = f - c;
56
+ const c = Math.max(Math.min(l * (a / d), l), 20);
57
+ r.style.width = `${c}px`;
58
+ const f = t.scrollLeft, g = d - a;
59
59
  let b = 0;
60
- g > 0 && (b = parseInt(u / g * (l - h), 10)), b < 0 && (b = 0);
61
- const m = l - h;
62
- b > m && (b = m), r.style.left = `${b}px`, j.log(b), e(this, p).left.disabled = b === 0, e(this, p).right.disabled = b >= m - 1;
60
+ g > 0 && (b = parseInt(f / g * (l - c), 10)), b < 0 && (b = 0);
61
+ const w = l - c;
62
+ b > w && (b = w), r.style.left = `${b}px`, M.log(b), e(this, p).left.disabled = b === 0, e(this, p).right.disabled = b >= w - 1;
63
63
  }, "refresh"));
64
- d(this, V, /* @__PURE__ */ a((t) => {
64
+ u(this, V, /* @__PURE__ */ h((t) => {
65
65
  if (!e(this, p)) return !1;
66
66
  const s = e(this, p).container, n = s.querySelector("table");
67
67
  if (!n) return !1;
68
68
  const r = e(this, p).track.getBoundingClientRect(), o = e(this, p).thumb.clientWidth;
69
- let c = t;
70
- c < 0 && (c = 0);
71
- const f = r.width - o;
72
- c > f && (c = f), 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 >= f - 1;
73
- const l = s.clientWidth, h = n.scrollWidth;
74
- let u = f > 0 ? -c * (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)`, c > 0 && c < f - 1;
69
+ let a = t;
70
+ a < 0 && (a = 0);
71
+ const d = r.width - o;
72
+ a > d && (a = d), a = parseInt(a, 10), e(this, p).thumb.style.left = `${a}px`, e(this, p).left.disabled = a === 0, e(this, p).right.disabled = a >= d - 1;
73
+ const l = s.clientWidth, c = n.scrollWidth;
74
+ let f = d > 0 ? -a * (c - l) / d : 0;
75
+ return -f > c - l && (f = -(c - l)), -f + 5 > c - l && (f = -(c - l)), l >= c && (f = 0), n.style.transform = `translateX(${f}px)`, a > 0 && a < d - 1;
76
76
  }, "#thumbMoveTo"));
77
- d(this, se, /* @__PURE__ */ a(() => {
78
- const t = /* @__PURE__ */ a((n) => {
77
+ u(this, se, /* @__PURE__ */ h(() => {
78
+ const t = /* @__PURE__ */ h((n) => {
79
79
  clearInterval(e(this, D)), clearInterval(e(this, N));
80
80
  const r = parseInt(e(this, p).thumb.style.left || 0, 10);
81
81
  e(this, V).call(this, r + n), y(this, D, setInterval(() => {
@@ -84,7 +84,7 @@ const ke = class ke extends HTMLElement {
84
84
  e(this, V).call(this, o + n) || clearInterval(e(this, N));
85
85
  }, 50));
86
86
  }, 500));
87
- }, "delayScroll"), s = /* @__PURE__ */ a(() => {
87
+ }, "delayScroll"), s = /* @__PURE__ */ h(() => {
88
88
  clearInterval(e(this, D)), clearInterval(e(this, N));
89
89
  }, "clearTimer");
90
90
  ["mouseup", "mouseleave", "touchend"].forEach((n) => {
@@ -101,11 +101,11 @@ const ke = class ke extends HTMLElement {
101
101
  }), e(this, p).thumb.addEventListener("mousedown", (n) => {
102
102
  if (n.button !== 0) return;
103
103
  n.stopPropagation(), n.preventDefault(), y(this, B, !0), this.shiftX = n.clientX - e(this, p).thumb.getBoundingClientRect().left;
104
- const r = /* @__PURE__ */ a((c) => {
104
+ const r = /* @__PURE__ */ h((a) => {
105
105
  if (!e(this, B)) return;
106
- const f = e(this, p).track.getBoundingClientRect();
107
- e(this, V).call(this, c.clientX - f.left - this.shiftX);
108
- }, "onMouseMove"), o = /* @__PURE__ */ a(() => {
106
+ const d = e(this, p).track.getBoundingClientRect();
107
+ e(this, V).call(this, a.clientX - d.left - this.shiftX);
108
+ }, "onMouseMove"), o = /* @__PURE__ */ h(() => {
109
109
  y(this, B, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
110
110
  }, "onMouseUp");
111
111
  document.addEventListener("mousemove", r), document.addEventListener("mouseup", o);
@@ -113,7 +113,7 @@ const ke = class ke extends HTMLElement {
113
113
  }, "#init"));
114
114
  }
115
115
  connectedCallback() {
116
- if (y(this, L, this.closest("nine-table-sheet") || this.getRootNode().host), !e(this, L)) return;
116
+ if (y(this, C, this.closest("nine-table-sheet") || this.getRootNode().host), !e(this, C)) return;
117
117
  this.innerHTML = `
118
118
  <style>
119
119
  nine-table-hscrollbar {
@@ -177,8 +177,8 @@ const ke = class ke 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__ */ a(() => {
181
- const s = e(this, L).querySelector(".ng-container-body");
180
+ const t = /* @__PURE__ */ h(() => {
181
+ const s = e(this, C).querySelector(".ng-container-body");
182
182
  if (!s) {
183
183
  setTimeout(t, 10);
184
184
  return;
@@ -197,26 +197,26 @@ const ke = class ke extends HTMLElement {
197
197
  e(this, P) && e(this, P).disconnect();
198
198
  }
199
199
  };
200
- L = new WeakMap(), B = new WeakMap(), p = new WeakMap(), D = new WeakMap(), N = new WeakMap(), P = new WeakMap(), ie = new WeakMap(), V = new WeakMap(), se = new WeakMap(), a(ke, "NineTableHScrollBar");
200
+ C = new WeakMap(), B = new WeakMap(), p = new WeakMap(), D = new WeakMap(), N = new WeakMap(), P = new WeakMap(), ie = new WeakMap(), V = new WeakMap(), se = new WeakMap(), h(ke, "NineTableHScrollBar");
201
201
  let we = ke;
202
202
  customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", we);
203
- var $, _, E, W, H, M, ne, re, oe, le;
203
+ var $, _, A, W, I, H, ne, re, oe, le;
204
204
  const Le = class Le {
205
205
  constructor(i) {
206
- d(this, $);
207
- d(this, _, []);
208
- d(this, E, null);
209
- d(this, W, null);
210
- d(this, H, 0);
211
- d(this, M, 0);
212
- x(this, "getRowHeight", /* @__PURE__ */ a(() => e(this, E), "getRowHeight"));
213
- d(this, ne, /* @__PURE__ */ a(() => {
206
+ u(this, $);
207
+ u(this, _, []);
208
+ u(this, A, null);
209
+ u(this, W, null);
210
+ u(this, I, 0);
211
+ u(this, H, 0);
212
+ v(this, "getRowHeight", /* @__PURE__ */ h(() => e(this, A), "getRowHeight"));
213
+ u(this, ne, /* @__PURE__ */ h(() => {
214
214
  e(this, re).call(this);
215
215
  }, "#init"));
216
216
  /**
217
217
  * 🎯 뷰포트 크기 λ³€ν™” μ‹œμ μ— 높이 계산 및 ν•„μš”ν•œ ν–‰ 개수 산정·캐싱을 μ™„κ²°
218
218
  */
219
- d(this, re, /* @__PURE__ */ a(() => {
219
+ u(this, re, /* @__PURE__ */ h(() => {
220
220
  !e(this, $) || !(e(this, $) instanceof HTMLElement) || (y(this, W, new ResizeObserver((i) => {
221
221
  for (const t of i) {
222
222
  const s = t.target;
@@ -226,12 +226,12 @@ const Le = class Le {
226
226
  if (n > 0) {
227
227
  const r = s.clientHeight || s.getBoundingClientRect().height || n;
228
228
  let o = 0;
229
- const c = s.querySelector(".ng-container-body") || s, f = c.querySelector("thead"), l = c.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, E) !== null)) {
233
- const u = Math.ceil(e(this, H) / e(this, E));
234
- y(this, M, u + 20), j.log(`[RowManager] Resized. Height: ${e(this, H)}px | Target Rows: ${e(this, M)}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
229
+ const a = s.querySelector(".ng-container-body") || s, d = a.querySelector("thead"), l = a.querySelector("tfoot");
230
+ d && (o += d.offsetHeight || d.getBoundingClientRect().height), l && (o += l.offsetHeight || l.getBoundingClientRect().height);
231
+ const c = Math.max(r - o, 100);
232
+ if (e(this, I) !== c && (y(this, I, c), e(this, A) !== null)) {
233
+ const f = Math.ceil(e(this, I) / e(this, A));
234
+ y(this, H, f + 20), M.log(`[RowManager] Resized. Height: ${e(this, I)}px | Target Rows: ${e(this, H)}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
235
235
  const b = s.querySelector(g);
236
236
  b && b.querySelector("tbody") && e(this, le).call(this, b);
237
237
  });
@@ -241,35 +241,35 @@ const Le = class Le {
241
241
  })), e(this, W).observe(e(this, $)));
242
242
  }, "#initResizeObserver"));
243
243
  // 🎯 ν…œν”Œλ¦Ώ μΆ”μΆœ, 높이 μΈ‘μ •, 초기 λ Œλ”λ§μ„ μˆœμ„œμ— 맞게 λ‚΄λΆ€μ—μ„œ 일괄 처리
244
- x(this, "initialize", /* @__PURE__ */ a((i) => {
245
- j.log(i);
244
+ v(this, "initialize", /* @__PURE__ */ h((i) => {
245
+ M.log(i);
246
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, E, null), e(this, oe).call(this, t);
247
+ y(this, _, n.map((r) => r.cloneNode(!0))), y(this, A, null), e(this, oe).call(this, t);
248
248
  }, "initialize"));
249
- d(this, oe, /* @__PURE__ */ a((i) => {
250
- if (e(this, E) !== null && e(this, E) > 0)
251
- return e(this, E);
249
+ u(this, oe, /* @__PURE__ */ h((i) => {
250
+ if (e(this, A) !== null && e(this, A) > 0)
251
+ return e(this, A);
252
252
  if (e(this, _).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());
256
+ t.querySelectorAll("tr:not(.nodata)").forEach((f) => f.remove());
257
257
  const s = t.querySelector("tr.nodata"), n = document.createDocumentFragment();
258
- e(this, _).forEach((u) => {
259
- n.appendChild(u.cloneNode(!0));
258
+ e(this, _).forEach((f) => {
259
+ n.appendChild(f.cloneNode(!0));
260
260
  }), s ? s.before(n) : t.appendChild(n);
261
- const r = i.closest("nine-table-sheet"), o = r ? r.style.display : "", c = r ? r.style.visibility : "", f = r ? r.style.position : "";
261
+ const r = i.closest("nine-table-sheet"), o = r ? r.style.display : "", a = r ? r.style.visibility : "", d = r ? r.style.position : "";
262
262
  r && (r.style.display === "none" || window.getComputedStyle(r).display === "none") && (r.style.display = "block", r.style.visibility = "hidden", r.style.position = "absolute");
263
263
  let l = 0;
264
- const h = t.querySelectorAll("tr:not(.nodata)");
265
- if (h.forEach((u, g) => {
266
- l += u.offsetHeight || u.getBoundingClientRect().height;
267
- }), h.forEach((u) => u.remove()), r && (r.style.display = o, r.style.visibility = c, r.style.position = f), y(this, E, l), e(this, H) > 0) {
268
- const u = Math.ceil(e(this, H) / e(this, E));
269
- y(this, M, u + 20);
264
+ const c = t.querySelectorAll("tr:not(.nodata)");
265
+ if (c.forEach((f, g) => {
266
+ l += f.offsetHeight || f.getBoundingClientRect().height;
267
+ }), c.forEach((f) => f.remove()), r && (r.style.display = o, r.style.visibility = a, r.style.position = d), y(this, A, l), e(this, I) > 0) {
268
+ const f = Math.ceil(e(this, I) / e(this, A));
269
+ y(this, H, f + 20);
270
270
  } else
271
- y(this, M, 40);
272
- return console.log(`[RowManager] Template Height Cached: ${e(this, E)}px | RowCount: ${e(this, M)}`), e(this, E);
271
+ y(this, H, 40);
272
+ return console.log(`[RowManager] Template Height Cached: ${e(this, A)}px | RowCount: ${e(this, H)}`), e(this, A);
273
273
  }, "#measureAndCacheHeight"));
274
274
  /**
275
275
  * 🎯 μΊμ‹œλœ ν–‰ 개수 λ°˜ν™˜ (없을 λ•Œλ§Œ μ΅œμ†Œν•œμ˜ λ°©μ–΄ μ—°μ‚°)
@@ -287,19 +287,19 @@ const Le = class Le {
287
287
  /**
288
288
  * 🎯 μΊμ‹œλœ ν–‰ 개수λ₯Ό κ³§λ°”λ‘œ κ°€μ Έμ™€μ„œ TR λΌˆλŒ€ μ£Όμž… (쀑볡 계산 제거)
289
289
  */
290
- d(this, le, /* @__PURE__ */ a((i) => {
290
+ u(this, le, /* @__PURE__ */ h((i) => {
291
291
  if (e(this, _).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, M);
295
+ const s = t.querySelector("tr.nodata"), n = document.createDocumentFragment(), r = e(this, H);
296
296
  for (let o = 0; o < r; o++)
297
- e(this, _).forEach((c) => {
298
- n.appendChild(c.cloneNode(!0));
297
+ e(this, _).forEach((a) => {
298
+ n.appendChild(a.cloneNode(!0));
299
299
  });
300
300
  s ? s.before(n) : t.appendChild(n), console.log(`[RowManager] Rendered ${r} sets into DOM.`);
301
301
  }, "#renderRows"));
302
- x(this, "destroy", /* @__PURE__ */ a(() => {
302
+ v(this, "destroy", /* @__PURE__ */ h(() => {
303
303
  e(this, W) && (e(this, W).disconnect(), y(this, W, null));
304
304
  }, "destroy"));
305
305
  y(this, $, i), e(this, ne).call(this);
@@ -308,71 +308,119 @@ const Le = class Le {
308
308
  return e(this, _).length || 1;
309
309
  }
310
310
  };
311
- $ = new WeakMap(), _ = new WeakMap(), E = new WeakMap(), W = new WeakMap(), H = new WeakMap(), M = new WeakMap(), ne = new WeakMap(), re = new WeakMap(), oe = new WeakMap(), le = new WeakMap(), a(Le, "RowManager");
312
- let ve = Le;
313
- var I, U, ae, ce;
314
- const G = class G extends HTMLElement {
311
+ $ = new WeakMap(), _ = new WeakMap(), A = new WeakMap(), W = new WeakMap(), I = new WeakMap(), H = new WeakMap(), ne = new WeakMap(), re = new WeakMap(), oe = new WeakMap(), le = new WeakMap(), h(Le, "RowManager");
312
+ let xe = Le;
313
+ var T, F, G, U, ae, ce;
314
+ const j = class j extends HTMLElement {
315
315
  constructor() {
316
316
  super();
317
- d(this, I, null);
318
- d(this, U);
319
- x(this, "generate", /* @__PURE__ */ a((t) => {
317
+ u(this, T, null);
318
+ u(this, F);
319
+ /**
320
+ * 🎯 2차원 μ…€ 격자 인덱슀λ₯Ό κ³„μ‚°ν•˜μ—¬ 병합(`rowSpan`/`colSpan`) μ…€μ˜ μ ˆλŒ€ 컬럼 μœ„μΉ˜λ₯Ό λΆ€μ—¬
321
+ */
322
+ u(this, G, /* @__PURE__ */ h((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 d = Array.from(Array(o), () => Array(a).fill(null));
330
+ n.forEach((l) => {
331
+ const c = l.sectionRowIndex;
332
+ let f = 0;
333
+ Array.from(l.querySelectorAll("th,td")).forEach((g) => {
334
+ for (let S = 0; S < d[c].length; S++)
335
+ if (d[c][S] === null) {
336
+ f = S;
337
+ break;
338
+ }
339
+ const b = g.rowSpan || 1, w = g.colSpan || 1;
340
+ for (let S = 0; S < b; S++)
341
+ for (let E = 0; E < w; E++)
342
+ c + S < o && f + E < a && (d[c + S][f + E] = S === 0 && E === 0 ? "1" : "0");
343
+ });
344
+ }), n.forEach((l) => {
345
+ const c = l.sectionRowIndex;
346
+ Array.from(l.querySelectorAll("th,td")).forEach((f) => {
347
+ for (let g = 0; g < d[c].length; g++)
348
+ if (d[c][g] === "1") {
349
+ f.dataset.col = g, d[c][g] = "0";
350
+ break;
351
+ }
352
+ });
353
+ });
354
+ }, "#resetColIndex"));
355
+ /**
356
+ * 🎯 원본 ν…Œμ΄λΈ”μ„ λΆ„μ„ν•˜μ—¬ κ³ μ • 컬럼 μ˜μ—­λ³„(left, body, right)둜 μ™„λ²½ν•˜κ²Œ μͺΌκ°œμ§„ ν…Œμ΄λΈ” 생성
357
+ */
358
+ u(this, U, /* @__PURE__ */ h((t, s) => {
359
+ const n = t.cloneNode(!0), r = n.querySelector("colgroup");
360
+ if (!r) return n;
361
+ const o = Array.from(r.querySelectorAll("col")), a = [];
362
+ return o.forEach((d, l) => {
363
+ const c = d.getAttribute("fixed");
364
+ let f = !1;
365
+ s === "left" ? f = c === "left" : s === "right" ? f = c === "right" : f = c !== "left" && c !== "right", f || a.push(l);
366
+ }), a.reverse().forEach((d) => {
367
+ o[d] && o[d].remove(), n.querySelectorAll("tr").forEach((l) => {
368
+ Array.from(l.querySelectorAll("th, td")).forEach((f) => {
369
+ parseInt(f.dataset.col, 10) === d && f.remove();
370
+ });
371
+ });
372
+ }), n;
373
+ }, "#createSplitTable"));
374
+ v(this, "generate", /* @__PURE__ */ h((t) => {
320
375
  if (!t) return;
321
- const s = /* @__PURE__ */ a((l) => {
322
- const h = /* @__PURE__ */ a((g) => {
376
+ const s = /* @__PURE__ */ h((l) => {
377
+ const c = /* @__PURE__ */ h((g) => {
323
378
  if (g.querySelector("colgroup")) return;
324
- const b = g.querySelector("tbody tr") || g.querySelector("tr"), m = b ? b.querySelectorAll("th, td").length : 1, R = document.createElement("colgroup"), T = Math.max(Math.floor(g.clientWidth / m), 100);
325
- for (let C = 0; C < m; C++) {
326
- const Y = document.createElement("col");
327
- Y.setAttribute("width", T), R.appendChild(Y);
379
+ const b = g.querySelector("tbody tr") || g.querySelector("tr"), w = b ? b.querySelectorAll("th, td").length : 1, S = document.createElement("colgroup"), E = Math.max(Math.floor(g.clientWidth / w), 100);
380
+ for (let $e = 0; $e < w; $e++) {
381
+ const We = document.createElement("col");
382
+ We.setAttribute("width", E), S.appendChild(We);
328
383
  }
329
- g.prepend(R);
330
- }, "ensureColgroup"), u = /* @__PURE__ */ a((g) => {
384
+ g.prepend(S);
385
+ }, "ensureColgroup"), f = /* @__PURE__ */ h((g) => {
331
386
  if (g.querySelector("thead")) return;
332
- const b = document.createElement("thead"), m = g.querySelector("colgroup");
333
- m ? m.after(b) : g.prepend(b);
387
+ const b = document.createElement("thead"), w = g.querySelector("colgroup");
388
+ w ? w.after(b) : g.prepend(b);
334
389
  }, "ensureThead");
335
- return h(l), u(l), l.classList.add("nine-table-element"), l;
390
+ return c(l), f(l), l.classList.add("nine-table-element"), l;
336
391
  }, "initializeTable"), n = t.cloneNode(!0);
337
- y(this, I, s(n)), e(this, I).style.display = "table";
338
- const r = this.querySelector(".ng-container-left"), o = this.querySelector(".ng-container-body"), c = this.querySelector(".ng-container-right"), f = /* @__PURE__ */ a((l, h, u = !1) => {
339
- const g = l.cloneNode(!0), b = Array.from(g.querySelectorAll("colgroup col")), m = [];
340
- return b.forEach((R, T) => {
341
- const C = R.getAttribute("fixed");
342
- let Y = !1;
343
- u ? Y = C !== "left" && C !== "right" : Y = C === h, Y || m.push(T);
344
- }), m.reverse().forEach((R) => {
345
- b[R] && b[R].remove(), g.querySelectorAll("tr").forEach((T) => {
346
- const C = T.querySelectorAll("th, td");
347
- C[R] && C[R].remove();
348
- });
349
- }), g;
350
- }, "filterTableByFixed");
351
- if (o) {
352
- const l = f(e(this, I), null, !0);
353
- o.innerHTML = "", o.appendChild(l), e(this, U).initialize(e(this, I));
392
+ y(this, T, s(n)), e(this, T).style.display = "table", e(this, G).call(this, e(this, T), "thead"), e(this, G).call(this, e(this, T), "tbody"), Array.from(e(this, T).querySelectorAll("colgroup col")).forEach((l, c) => {
393
+ const f = l.getAttribute("fixed");
394
+ f && e(this, T).querySelectorAll(`[data-col="${c}"]`).forEach((g) => {
395
+ g.setAttribute("fixed", f);
396
+ });
397
+ }), M.log(e(this, T));
398
+ const o = this.querySelector(".ng-container-left"), a = this.querySelector(".ng-container-body"), d = this.querySelector(".ng-container-right");
399
+ if (a) {
400
+ const l = e(this, U).call(this, e(this, T), null);
401
+ a.innerHTML = "", a.appendChild(l), e(this, F).initialize(e(this, T));
354
402
  }
355
- if (r) {
356
- const l = f(e(this, I), "left", !1);
357
- let h = 0;
403
+ if (o) {
404
+ const l = e(this, U).call(this, e(this, T), "left");
405
+ let c = 0;
358
406
  l.querySelectorAll("col").forEach((g) => {
359
407
  const b = parseInt(g.getAttribute("width"), 10);
360
- isNaN(b) || (h += b);
361
- }), r.innerHTML = "", r.appendChild(l);
362
- const u = h > 0 ? h : 0;
363
- r.style.flex = `0 0 ${u}px`, r.style.width = `${u}px`;
408
+ isNaN(b) || (c += b);
409
+ }), o.innerHTML = "", o.appendChild(l);
410
+ const f = c > 0 ? c : 0;
411
+ o.style.flex = `0 0 ${f}px`, o.style.width = `${f}px`;
364
412
  }
365
- if (c) {
366
- const l = f(e(this, I), "right", !1);
367
- let h = 0;
413
+ if (d) {
414
+ const l = e(this, U).call(this, e(this, T), "right");
415
+ let c = 0;
368
416
  l.querySelectorAll("col").forEach((g) => {
369
417
  const b = parseInt(g.getAttribute("width"), 10);
370
- isNaN(b) || (h += b);
371
- }), c.innerHTML = "", c.appendChild(l);
372
- const u = h > 0 ? h : 0;
373
- c.style.flex = `0 0 ${u}px`, c.style.width = `${u}px`;
418
+ isNaN(b) || (c += b);
419
+ }), d.innerHTML = "", d.appendChild(l);
420
+ const f = c > 0 ? c : 0;
421
+ d.style.flex = `0 0 ${f}px`, d.style.width = `${f}px`;
374
422
  }
375
- o && o.addEventListener("scroll", () => {
423
+ a && a.addEventListener("scroll", () => {
376
424
  var l;
377
425
  (l = this.querySelector("nine-table-hscrollbar")) == null || l.refresh();
378
426
  }), setTimeout(() => {
@@ -380,35 +428,31 @@ const G = class G extends HTMLElement {
380
428
  (l = this.querySelector("nine-table-hscrollbar")) == null || l.refresh();
381
429
  }, 0);
382
430
  }, "generate"));
383
- x(this, "getRowHeight", /* @__PURE__ */ a(() => e(this, U).getRowHeight(), "getRowHeight"));
384
- /**
385
- getRowCount = () => {
386
- if (!this.#tableElement) return 0;
387
- return this.#tableElement.querySelectorAll('tbody tr').length;
388
- }; */
389
- x(this, "scrollToX", /* @__PURE__ */ a((t) => {
431
+ v(this, "getRowHeight", /* @__PURE__ */ h(() => e(this, F).getRowHeight(), "getRowHeight"));
432
+ v(this, "scrollToX", /* @__PURE__ */ h((t) => {
390
433
  const s = this.querySelector(".ng-container-body");
391
434
  s && (s.scrollLeft = t);
392
435
  }, "scrollToX"));
393
- x(this, "scrollToY", /* @__PURE__ */ a((t) => {
436
+ v(this, "scrollToY", /* @__PURE__ */ h((t) => {
394
437
  const s = this.querySelector(".ng-container-body");
395
438
  s && (s.scrollTop = t);
396
439
  }, "scrollToY"));
397
- d(this, ae, /* @__PURE__ */ a(() => {
440
+ u(this, ae, /* @__PURE__ */ h(() => {
398
441
  e(this, ce).call(this), new MutationObserver((t) => {
399
- const s = /* @__PURE__ */ a(() => {
400
- requestAnimationFrame(() => {
401
- var u, g, b;
442
+ const s = /* @__PURE__ */ h(() => {
443
+ M.log("111111"), requestAnimationFrame(() => {
444
+ var f, g, b;
445
+ M.log("22222");
402
446
  const n = this.querySelector(".ng-container-left table"), r = this.querySelector(".ng-container-body table"), o = this.querySelector(".ng-container-right table");
403
447
  if (!r) return;
404
- const c = n ? Array.from(n.querySelectorAll("tr")) : [], f = Array.from(r.querySelectorAll("tr")), l = o ? Array.from(o.querySelectorAll("tr")) : [], h = Math.max(c.length, f.length, l.length);
405
- for (let m = 0; m < h; m++) {
406
- const R = [
407
- ((u = c[m]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
408
- ((g = f[m]) == null ? void 0 : g.getBoundingClientRect().height) || 0,
409
- ((b = l[m]) == null ? void 0 : b.getBoundingClientRect().height) || 0
410
- ], T = Math.max(...R);
411
- T > 0 && (c[m] && (c[m].style.height = `${T}px`), f[m] && (f[m].style.height = `${T}px`), l[m] && (l[m].style.height = `${T}px`));
448
+ const a = n ? Array.from(n.querySelectorAll("tr")) : [], d = Array.from(r.querySelectorAll("tr")), l = o ? Array.from(o.querySelectorAll("tr")) : [], c = Math.max(a.length, d.length, l.length);
449
+ for (let w = 0; w < c; w++) {
450
+ const S = [
451
+ ((f = a[w]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
452
+ ((g = d[w]) == null ? void 0 : g.getBoundingClientRect().height) || 0,
453
+ ((b = l[w]) == null ? void 0 : b.getBoundingClientRect().height) || 0
454
+ ], E = Math.max(...S);
455
+ E > 0 && (a[w] && (a[w].style.height = `${E}px`), d[w] && (d[w].style.height = `${E}px`), l[w] && (l[w].style.height = `${E}px`));
412
456
  }
413
457
  });
414
458
  }, "syncRowHeights");
@@ -416,8 +460,8 @@ const G = class G extends HTMLElement {
416
460
  n.attributeName === "class" && this.classList.contains("active") && s();
417
461
  }).observe(this, { attributes: !0 });
418
462
  }, "#init"));
419
- d(this, ce, /* @__PURE__ */ a(() => {
420
- const t = G.SCROLLBAR_SIZE;
463
+ u(this, ce, /* @__PURE__ */ h(() => {
464
+ const t = j.SCROLLBAR_SIZE;
421
465
  this.innerHTML = `
422
466
  <style>
423
467
  nine-table-sheet {
@@ -454,7 +498,6 @@ const G = class G extends HTMLElement {
454
498
  flex-shrink: 0;
455
499
  }
456
500
 
457
- /* 🎯 μ»¨ν…Œμ΄λ„ˆ 자체 μŠ€ν¬λ‘€λ°” 생성을 막고 μ™ΈλΆ€ μ»€μŠ€ν…€ μŠ€ν¬λ‘€λ°” μ œμ–΄μ— 의쑴 */
458
501
  nine-table-sheet .ng-container-body {
459
502
  display: flex;
460
503
  flex-direction: column;
@@ -464,18 +507,17 @@ const G = class G extends HTMLElement {
464
507
  background: #ffffff;
465
508
  position: relative;
466
509
 
467
- /* μ›Ήν‚· λΈŒλΌμš°μ €(Chrome, Safari) μŠ€ν¬λ‘€λ°” 투λͺ…ν™” */
468
510
  &::-webkit-scrollbar {
469
511
  display: none;
470
512
  height: 0px;
471
513
  }
472
514
 
473
- /* νŒŒμ΄μ–΄ν­μŠ€ μŠ€ν¬λ‘€λ°” 숨기기 */
474
515
  scrollbar-width: none;
475
516
  }
476
517
 
477
518
  nine-table-sheet .ng-container-right {
478
519
  display: flex;
520
+ flex-init: 0;
479
521
  flex-direction: column;
480
522
  overflow: hidden;
481
523
  background: #ffffff;
@@ -542,23 +584,23 @@ const G = class G extends HTMLElement {
542
584
  </div>
543
585
  `;
544
586
  }, "#render"));
545
- y(this, U, new ve(this));
587
+ y(this, F, new xe(this));
546
588
  }
547
589
  connectedCallback() {
548
590
  e(this, ae).call(this);
549
591
  }
550
592
  disconnectedCallback() {
551
- this.innerHTML = "", j.log("NineTableSheet destroyed.");
593
+ this.innerHTML = "", M.log("NineTableSheet destroyed.");
552
594
  }
553
595
  };
554
- I = new WeakMap(), U = new WeakMap(), ae = new WeakMap(), ce = new WeakMap(), a(G, "NineTableSheet"), x(G, "SCROLLBAR_SIZE", 16);
555
- let te = G;
596
+ T = new WeakMap(), F = new WeakMap(), G = new WeakMap(), U = new WeakMap(), ae = new WeakMap(), ce = new WeakMap(), h(j, "NineTableSheet"), v(j, "SCROLLBAR_SIZE", 16);
597
+ let te = j;
556
598
  customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", te);
557
599
  var he, J;
558
600
  const Ce = class Ce extends HTMLElement {
559
601
  constructor() {
560
602
  super();
561
- d(this, he, /* @__PURE__ */ a(() => {
603
+ u(this, he, /* @__PURE__ */ h(() => {
562
604
  var t;
563
605
  (t = this.querySelector(".nine-tab-bar")) == null || t.addEventListener("click", (s) => {
564
606
  var o;
@@ -566,35 +608,35 @@ const Ce = class Ce extends HTMLElement {
566
608
  e(this, J).call(this, r, n);
567
609
  }), e(this, J).call(this, 0, !1);
568
610
  }, "#init"));
569
- d(this, J, /* @__PURE__ */ a((t, s = !1) => {
570
- const n = /* @__PURE__ */ a(() => {
571
- const h = Array.from(this.querySelectorAll("nine-table-sheet"));
611
+ u(this, J, /* @__PURE__ */ h((t, s = !1) => {
612
+ const n = /* @__PURE__ */ h(() => {
613
+ const c = Array.from(this.querySelectorAll("nine-table-sheet"));
572
614
  Array.from(this.querySelectorAll("nine-splitter")).forEach((b) => b.style.setProperty("display", "none"));
573
- const g = h.filter((b) => b.classList.contains("active"));
615
+ const g = c.filter((b) => b.classList.contains("active"));
574
616
  g.length < 2 || g.forEach((b) => {
575
- const m = parseInt(b.getAttribute("data-index"), 10), R = this.querySelector(`nine-splitter[data-split-index="${m}"]`), T = h[m + 1];
576
- R && T && T.classList.contains("active") && R.style.setProperty("display", "flex");
617
+ const w = parseInt(b.getAttribute("data-index"), 10), S = this.querySelector(`nine-splitter[data-split-index="${w}"]`), E = c[w + 1];
618
+ S && E && E.classList.contains("active") && S.style.setProperty("display", "flex");
577
619
  });
578
- }, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), c = r.querySelectorAll(".nine-tab-item"), f = o.querySelectorAll("nine-table-sheet");
579
- if (!c[t]) return;
620
+ }, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = r.querySelectorAll(".nine-tab-item"), d = o.querySelectorAll("nine-table-sheet");
621
+ if (!a[t]) return;
580
622
  if (!s)
581
- c.forEach((h, u) => {
582
- h.classList.toggle("active", u === t);
583
- }), f.forEach((h, u) => {
584
- const g = u === t;
585
- h.classList.toggle("active", g), h.style.flex = g ? "1 1 100%" : "";
623
+ a.forEach((c, f) => {
624
+ c.classList.toggle("active", f === t);
625
+ }), d.forEach((c, f) => {
626
+ const g = f === t;
627
+ c.classList.toggle("active", g), c.style.flex = g ? "1 1 100%" : "";
586
628
  });
587
629
  else {
588
- const h = c[t], u = r.querySelectorAll(".nine-tab-item.active");
589
- if (h.classList.contains("active") && u.length <= 1)
630
+ const c = a[t], f = r.querySelectorAll(".nine-tab-item.active");
631
+ if (c.classList.contains("active") && f.length <= 1)
590
632
  return;
591
- h.classList.toggle("active");
633
+ c.classList.toggle("active");
592
634
  const g = o.querySelector(`nine-table-sheet[data-index="${t}"]`);
593
635
  g && (g.classList.toggle("active"), g.classList.contains("active") || (g.style.flex = ""));
594
636
  }
595
637
  const l = o.querySelectorAll("nine-table-sheet.active");
596
- l == null || l.forEach((h) => {
597
- h.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
638
+ l == null || l.forEach((c) => {
639
+ c.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
598
640
  }), n();
599
641
  }, "#switchSheet"));
600
642
  }
@@ -602,32 +644,32 @@ const Ce = class Ce extends HTMLElement {
602
644
  e(this, he).call(this);
603
645
  }
604
646
  };
605
- he = new WeakMap(), J = new WeakMap(), a(Ce, "NineTableSheets");
606
- let xe = Ce;
607
- customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", xe);
608
- var S, de, Q, fe;
647
+ he = new WeakMap(), J = new WeakMap(), h(Ce, "NineTableSheets");
648
+ let ve = Ce;
649
+ customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", ve);
650
+ var R, de, Q, fe;
609
651
  const _e = class _e {
610
652
  constructor(i) {
611
- d(this, S);
612
- d(this, de, /* @__PURE__ */ a(() => {
653
+ u(this, R);
654
+ u(this, de, /* @__PURE__ */ h(() => {
613
655
  e(this, fe).call(this), new ResizeObserver((i) => {
614
656
  for (let t of i)
615
- e(this, S).getAttribute("auto-height") === "true" && e(this, Q).call(this);
616
- }).observe(e(this, S));
657
+ e(this, R).getAttribute("auto-height") === "true" && e(this, Q).call(this);
658
+ }).observe(e(this, R));
617
659
  }, "#init"));
618
- d(this, Q, /* @__PURE__ */ a(() => {
619
- var f, l;
620
- const i = Array.from(e(this, S).shadowRoot.querySelectorAll("nine-table-sheet.active"));
660
+ u(this, Q, /* @__PURE__ */ h(() => {
661
+ var d, l;
662
+ const i = Array.from(e(this, R).shadowRoot.querySelectorAll("nine-table-sheet.active"));
621
663
  if (i.length === 0) return;
622
- const t = parseInt(e(this, S).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((h) => h.getRowHeight())), n = (f = e(this, S).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : f.getBoundingClientRect().height, r = (l = e(this, S).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = te.SCROLLBAR_SIZE, c = t * s + n + r + o;
623
- e(this, S).style.height = `${c}px`;
664
+ const t = parseInt(e(this, R).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((c) => c.getRowHeight())), n = (d = e(this, R).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : d.getBoundingClientRect().height, r = (l = e(this, R).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = te.SCROLLBAR_SIZE, a = t * s + n + r + o;
665
+ e(this, R).style.height = `${a}px`;
624
666
  }, "#applyAutoHeight"));
625
- d(this, fe, /* @__PURE__ */ a(() => {
626
- const t = Array.from(e(this, S).children).filter((f) => f.tagName === "TABLE"), s = e(this, S).getAttribute("auto-height") === "true", n = t.length, r = t.map((f, l) => {
627
- const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, g = l < n - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
628
- return u + g;
629
- }).join(""), o = t.map((f, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
630
- e(this, S).shadowRoot.innerHTML = `
667
+ u(this, fe, /* @__PURE__ */ h(() => {
668
+ const t = Array.from(e(this, R).children).filter((d) => d.tagName === "TABLE"), s = e(this, R).getAttribute("auto-height") === "true", n = t.length, r = t.map((d, l) => {
669
+ const f = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, g = l < n - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
670
+ return f + g;
671
+ }).join(""), o = t.map((d, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
672
+ e(this, R).shadowRoot.innerHTML = `
631
673
  <style>
632
674
  :host {
633
675
  display: flex;
@@ -726,24 +768,24 @@ const _e = class _e {
726
768
  </nine-table-body>
727
769
  <nine-table-footer></nine-table-footer>
728
770
  `;
729
- const c = e(this, S).shadowRoot.querySelectorAll("nine-table-sheet");
730
- c == null || c.forEach((f, l) => {
771
+ const a = e(this, R).shadowRoot.querySelectorAll("nine-table-sheet");
772
+ a == null || a.forEach((d, l) => {
731
773
  t[l] && setTimeout(() => {
732
- f.generate(t[l]), s && e(this, Q).call(this);
774
+ d.generate(t[l]), s && e(this, Q).call(this);
733
775
  });
734
776
  });
735
777
  }, "#render"));
736
- y(this, S, i), e(this, de).call(this);
778
+ y(this, R, i), e(this, de).call(this);
737
779
  }
738
780
  };
739
- S = new WeakMap(), de = new WeakMap(), Q = new WeakMap(), fe = new WeakMap(), a(_e, "LayoutManager");
781
+ R = new WeakMap(), de = new WeakMap(), Q = new WeakMap(), fe = new WeakMap(), h(_e, "LayoutManager");
740
782
  let Se = _e;
741
783
  var z, X;
742
- const He = class He {
784
+ const Ie = class Ie {
743
785
  constructor(i) {
744
- d(this, z);
745
- d(this, X, -1);
746
- x(this, "count", /* @__PURE__ */ a(() => e(this, z).rawRecords.length, "count"));
786
+ u(this, z);
787
+ u(this, X, -1);
788
+ v(this, "count", /* @__PURE__ */ h(() => e(this, z).rawRecords.length, "count"));
747
789
  y(this, z, i);
748
790
  }
749
791
  get at() {
@@ -759,156 +801,156 @@ const He = class He {
759
801
  });
760
802
  }
761
803
  };
762
- z = new WeakMap(), X = new WeakMap(), a(He, "ngRow");
763
- let Re = He;
764
- var A, v, q, K, ue, O, ge, ee, be, ye, Z;
765
- const k = class k {
804
+ z = new WeakMap(), X = new WeakMap(), h(Ie, "ngRow");
805
+ let Ee = Ie;
806
+ var q, x, k, K, ue, O, ge, ee, be, ye, Z;
807
+ const L = class L {
766
808
  constructor(i, t) {
767
- d(this, A);
768
- d(this, v);
769
- d(this, q, []);
770
- d(this, K, []);
771
- d(this, ue, 0);
772
- d(this, O, []);
773
- d(this, ge, /* @__PURE__ */ a(() => {
809
+ u(this, q);
810
+ u(this, x);
811
+ u(this, k, []);
812
+ u(this, K, []);
813
+ u(this, ue, 0);
814
+ u(this, O, []);
815
+ u(this, ge, /* @__PURE__ */ h(() => {
774
816
  y(this, O, []);
775
- const i = e(this, A).template || [];
817
+ const i = e(this, q).template || [];
776
818
  Array.from(i).forEach((t) => {
777
819
  var s;
778
820
  e(this, O).push(((s = t.getBoundingClientRect) == null ? void 0 : s.call(t).height) || 24);
779
- }), (e(this, v).rawRecords || []).forEach((t) => {
821
+ }), (e(this, x).rawRecords || []).forEach((t) => {
780
822
  t.__ng || (t.__ng = e(this, ee).call(this)), t.__ng.height = e(this, O).slice();
781
823
  });
782
824
  }, "#initialize"));
783
- x(this, "set", /* @__PURE__ */ a((i) => {
825
+ v(this, "set", /* @__PURE__ */ h((i) => {
784
826
  this.clear(), this.add(i, !1);
785
827
  }, "set"));
786
- d(this, ee, /* @__PURE__ */ a(() => ({
787
- rowState: k.ROW_STATE.EMPTY,
828
+ u(this, ee, /* @__PURE__ */ h(() => ({
829
+ rowState: L.ROW_STATE.EMPTY,
788
830
  deleted: !1,
789
831
  filtered: !1,
790
832
  height: e(this, O).slice(),
791
833
  o: {},
792
834
  c: {},
793
- _: [0, 0, 0, 0, k.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, O).slice(), -1, {}, {}]
835
+ _: [0, 0, 0, 0, L.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, O).slice(), -1, {}, {}]
794
836
  }), "#getDefaultMeta"));
795
- x(this, "reset", /* @__PURE__ */ a(() => {
796
- y(this, q, []), y(this, K, []);
837
+ v(this, "reset", /* @__PURE__ */ h(() => {
838
+ y(this, k, []), y(this, K, []);
797
839
  }, "reset"));
798
- x(this, "clear", /* @__PURE__ */ a(() => {
840
+ v(this, "clear", /* @__PURE__ */ h(() => {
799
841
  var i;
800
- e(this, v).rawRecords = [], y(this, q, []), y(this, K, []), (i = e(this, v).viewRecords) != null && i.reset && e(this, v).viewRecords.reset();
842
+ e(this, x).rawRecords = [], y(this, k, []), y(this, K, []), (i = e(this, x).viewRecords) != null && i.reset && e(this, x).viewRecords.reset();
801
843
  }, "clear"));
802
- d(this, be, /* @__PURE__ */ a((i) => {
844
+ u(this, be, /* @__PURE__ */ h((i) => {
803
845
  var n;
804
846
  Array.isArray(i) || (i = [i]);
805
- const t = typeof ((n = e(this, A).fields) == null ? void 0 : n.get) == "function" ? e(this, A).fields.get() : Object.keys(i[0] || {}), s = [];
847
+ const t = typeof ((n = e(this, q).fields) == null ? void 0 : n.get) == "function" ? e(this, q).fields.get() : Object.keys(i[0] || {}), s = [];
806
848
  return i.forEach((r) => {
807
849
  const o = { v: [] };
808
- t.forEach((c) => {
809
- o.v.push(r[c] !== void 0 && r[c] !== null ? r[c] : "");
850
+ t.forEach((a) => {
851
+ o.v.push(r[a] !== void 0 && r[a] !== null ? r[a] : "");
810
852
  }), s.push(o);
811
853
  }), s;
812
854
  }, "#json2Array"));
813
- d(this, ye, /* @__PURE__ */ a((i) => (Array.isArray(i) || (i = [i]), i.forEach((t) => {
814
- t.__ng = e(this, ee).call(this), t.__ng.rowid = this.nextId, t.__ng.rowState = k.ROW_STATE.INSERT, t.__ng._[0] = t.__ng.rowid;
855
+ u(this, ye, /* @__PURE__ */ h((i) => (Array.isArray(i) || (i = [i]), i.forEach((t) => {
856
+ t.__ng = e(this, ee).call(this), t.__ng.rowid = this.nextId, t.__ng.rowState = L.ROW_STATE.INSERT, t.__ng._[0] = t.__ng.rowid;
815
857
  }), i), "#defaultInsert"));
816
- x(this, "add", /* @__PURE__ */ a((i, t = !0) => {
858
+ v(this, "add", /* @__PURE__ */ h((i, t = !0) => {
817
859
  var r;
818
860
  i === void 0 && (i = {});
819
861
  const s = e(this, be).call(this, i);
820
- e(this, v).rawRecords = e(this, v).rawRecords.concat(e(this, ye).call(this, s)), this.resetRecords();
862
+ e(this, x).rawRecords = e(this, x).rawRecords.concat(e(this, ye).call(this, s)), this.resetRecords();
821
863
  const n = this.count() - 1;
822
- return t || s.forEach((o, c) => {
823
- const f = e(this, v).rawRecords[n - c];
824
- f && (f.__ng.rowState = k.ROW_STATE.EMPTY);
825
- }), (r = e(this, v).viewRecords) != null && r.reset && e(this, v).viewRecords.reset(), n;
864
+ return t || s.forEach((o, a) => {
865
+ const d = e(this, x).rawRecords[n - a];
866
+ d && (d.__ng.rowState = L.ROW_STATE.EMPTY);
867
+ }), (r = e(this, x).viewRecords) != null && r.reset && e(this, x).viewRecords.reset(), n;
826
868
  }, "add"));
827
- x(this, "delete", /* @__PURE__ */ a((i) => {
869
+ v(this, "delete", /* @__PURE__ */ h((i) => {
828
870
  var s;
829
871
  let t = [];
830
- Array.isArray(i) ? t = i : typeof i > "u" ? t = [e(this, v).owner.row.at] : t = [parseInt(i, 10)], t.sort((n, r) => r - n).forEach((n) => {
831
- if (e(this, q)[n]) {
832
- const r = e(this, q)[n].__ng.rowid;
833
- e(this, q)[n].__ng.rowState === k.ROW_STATE.INSERT ? e(this, v).rawRecords = e(this, v).rawRecords.filter((o) => o.__ng.rowid !== r) : e(this, v).rawRecords.forEach((o) => {
834
- o.__ng.rowid === r && (o.__ng.deleted = !0, o.__ng.rowState = k.ROW_STATE.DELETE);
872
+ Array.isArray(i) ? t = i : typeof i > "u" ? t = [e(this, x).owner.row.at] : t = [parseInt(i, 10)], t.sort((n, r) => r - n).forEach((n) => {
873
+ if (e(this, k)[n]) {
874
+ const r = e(this, k)[n].__ng.rowid;
875
+ e(this, k)[n].__ng.rowState === L.ROW_STATE.INSERT ? e(this, x).rawRecords = e(this, x).rawRecords.filter((o) => o.__ng.rowid !== r) : e(this, x).rawRecords.forEach((o) => {
876
+ o.__ng.rowid === r && (o.__ng.deleted = !0, o.__ng.rowState = L.ROW_STATE.DELETE);
835
877
  });
836
878
  }
837
- }), this.resetRecords(), (s = e(this, v).viewRecords) != null && s.reset && e(this, v).viewRecords.reset();
879
+ }), this.resetRecords(), (s = e(this, x).viewRecords) != null && s.reset && e(this, x).viewRecords.reset();
838
880
  }, "delete"));
839
- x(this, "setValue", /* @__PURE__ */ a((i, t, s) => {
840
- var f;
881
+ v(this, "setValue", /* @__PURE__ */ h((i, t, s) => {
882
+ var d;
841
883
  i = parseInt(i, 10);
842
- const r = (typeof ((f = e(this, A).fields) == null ? void 0 : f.get) == "function" ? e(this, A).fields.get() : []).indexOf(t);
884
+ const r = (typeof ((d = e(this, q).fields) == null ? void 0 : d.get) == "function" ? e(this, q).fields.get() : []).indexOf(t);
843
885
  if (r < 0) return;
844
886
  const o = this.getValidData()[i];
845
887
  if (!o) return;
846
- const c = o.v[r];
847
- 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[r] = s, e(this, v).owner.refreshData && e(this, v).owner.refreshData(i);
888
+ const a = o.v[r];
889
+ a !== s && o.__ng.rowState !== L.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(t) || (o.__ng.o[t] = a), o.__ng.rowState = L.ROW_STATE.UPDATE), o.v[r] = s, e(this, x).owner.refreshData && e(this, x).owner.refreshData(i);
848
890
  }, "setValue"));
849
- x(this, "resetRecords", /* @__PURE__ */ a(() => {
850
- y(this, K, e(this, v).rawRecords.filter((i) => !i.__ng.deleted)), y(this, q, e(this, v).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), e(this, v).rawRecords.forEach((i, t) => {
891
+ v(this, "resetRecords", /* @__PURE__ */ h(() => {
892
+ y(this, K, 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) => {
851
893
  i.__ng.rowidx = t;
852
- }), e(this, q).forEach((i, t) => {
894
+ }), e(this, k).forEach((i, t) => {
853
895
  i.__ng.i = t;
854
896
  });
855
897
  }, "resetRecords"));
856
- x(this, "getValidData", /* @__PURE__ */ a(() => (e(this, q).length === 0 && e(this, v).rawRecords.length > 0 && this.resetRecords(), e(this, q)), "getValidData"));
857
- d(this, Z, /* @__PURE__ */ a((i) => {
898
+ v(this, "getValidData", /* @__PURE__ */ h(() => (e(this, k).length === 0 && e(this, x).rawRecords.length > 0 && this.resetRecords(), e(this, k)), "getValidData"));
899
+ u(this, Z, /* @__PURE__ */ h((i) => {
858
900
  var s;
859
901
  if (!i) return i;
860
- const t = typeof ((s = e(this, A).fields) == null ? void 0 : s.get) == "function" ? e(this, A).fields.get() : [];
902
+ const t = typeof ((s = e(this, q).fields) == null ? void 0 : s.get) == "function" ? e(this, q).fields.get() : [];
861
903
  return Array.isArray(i) ? i.filter((n) => !n.__ng.deleted).map((n) => {
862
904
  const r = {};
863
- return t.forEach((o, c) => {
864
- r[o] = n.v ? n.v[c] : n[o];
905
+ return t.forEach((o, a) => {
906
+ r[o] = n.v ? n.v[a] : n[o];
865
907
  }), r.__ng = n.__ng, r;
866
908
  }) : i;
867
909
  }, "#conv2"));
868
- x(this, "count", /* @__PURE__ */ a(() => this.getValidData().length, "count"));
869
- x(this, "get", /* @__PURE__ */ a((i, t) => {
910
+ v(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
911
+ v(this, "get", /* @__PURE__ */ h((i, t) => {
870
912
  var r;
871
913
  const s = this.getValidData();
872
914
  if (!s || s.length <= 0) return;
873
915
  if (i == null) return e(this, Z).call(this, s);
874
916
  if (i < 0 || i >= s.length) return null;
875
- const n = typeof ((r = e(this, A).fields) == null ? void 0 : r.get) == "function" ? e(this, A).fields.get() : [];
917
+ const n = typeof ((r = e(this, q).fields) == null ? void 0 : r.get) == "function" ? e(this, q).fields.get() : [];
876
918
  if (t != null) {
877
919
  const o = n.indexOf(t);
878
920
  return o >= 0 ? s[i].v[o] : null;
879
921
  }
880
922
  return e(this, Z).call(this, s[i]);
881
923
  }, "get"));
882
- y(this, A, i), y(this, v, t), e(this, ge).call(this);
924
+ y(this, q, i), y(this, x, t), e(this, ge).call(this);
883
925
  }
884
926
  get source() {
885
- return e(this, Z).call(this, e(this, v).rawRecords);
927
+ return e(this, Z).call(this, e(this, x).rawRecords);
886
928
  }
887
929
  set source(i) {
888
930
  this.clear(), this.add(i, !1);
889
931
  }
890
932
  get nextId() {
891
- return ++Oe(this, ue)._;
933
+ return ++De(this, ue)._;
892
934
  }
893
935
  get length() {
894
- return e(this, q).length;
936
+ return e(this, k).length;
895
937
  }
896
938
  getRowCount() {
897
939
  return this.length;
898
940
  }
899
941
  };
900
- A = new WeakMap(), v = new WeakMap(), q = new WeakMap(), K = new WeakMap(), ue = new WeakMap(), O = new WeakMap(), ge = new WeakMap(), ee = new WeakMap(), be = new WeakMap(), ye = new WeakMap(), Z = new WeakMap(), a(k, "ngData"), // 🎯 ν–‰ μƒνƒœ μ •μ˜ μƒμˆ˜λ₯Ό 클래슀 λ‚΄λΆ€λ‘œ λ‚΄μž¬ν™”
901
- x(k, "ROW_STATE", {
942
+ q = new WeakMap(), x = new WeakMap(), k = new WeakMap(), K = new WeakMap(), ue = new WeakMap(), O = new WeakMap(), ge = new WeakMap(), ee = new WeakMap(), be = new WeakMap(), ye = new WeakMap(), Z = new WeakMap(), h(L, "ngData"), // 🎯 ν–‰ μƒνƒœ μ •μ˜ μƒμˆ˜λ₯Ό 클래슀 λ‚΄λΆ€λ‘œ λ‚΄μž¬ν™”
943
+ v(L, "ROW_STATE", {
902
944
  EMPTY: "EMPTY",
903
945
  NORMAL: "NORMAL",
904
946
  INSERT: "INSERT",
905
947
  UPDATE: "UPDATE",
906
948
  DELETE: "DELETE"
907
949
  });
908
- let Ee = k;
909
- const Me = class Me {
950
+ let Re = L;
951
+ const He = class He {
910
952
  constructor(i) {
911
- this.owner = i, this.row = new Re(this), this.data = new Ee(i, this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
953
+ this.owner = i, this.row = new Ee(this), this.data = new Re(i, this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
912
954
  var t;
913
955
  (t = this.owner.view) != null && t.redraw && this.owner.view.redraw();
914
956
  }, this.setDataSource = (t) => {
@@ -925,37 +967,37 @@ const Me = class Me {
925
967
  }, this.setDataSource([]);
926
968
  }
927
969
  };
928
- a(Me, "ngDataManager");
929
- let Te = Me;
930
- var F, pe;
931
- const Ie = class Ie extends HTMLElement {
970
+ h(He, "ngDataManager");
971
+ let Ae = He;
972
+ var Y, pe;
973
+ const Me = class Me extends HTMLElement {
932
974
  constructor() {
933
975
  super();
934
976
  //#created = false;
935
- d(this, F);
936
- d(this, pe);
937
- this.attachShadow({ mode: "open" }), y(this, F, new Te(this));
977
+ u(this, Y);
978
+ u(this, pe);
979
+ this.attachShadow({ mode: "open" }), y(this, Y, new Ae(this));
938
980
  }
939
981
  connectedCallback() {
940
- y(this, pe, new Se(this)), j.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
982
+ y(this, pe, new Se(this)), M.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
941
983
  }
942
984
  disconnectedCallback() {
943
- j.log("NineTable disconnected.");
985
+ M.log("NineTable disconnected.");
944
986
  }
945
987
  // 🎯 μ™ΈλΆ€μ—μ„œ grid.data.set(...) ν˜•νƒœλ‘œ μ ‘κ·Όν•  수 μžˆλ„λ‘ 데이터 λ§€λ‹ˆμ € μ˜€ν”ˆ
946
988
  get data() {
947
- return e(this, F).data;
989
+ return e(this, Y).data;
948
990
  }
949
991
  // 🎯 ν–‰(row) κ΄€λ ¨ μ œμ–΄ μ ‘κ·Όμž μ˜€ν”ˆ
950
992
  get row() {
951
- return e(this, F).row;
993
+ return e(this, Y).row;
952
994
  }
953
995
  // 🎯 전체 데이터 λ§€λ‹ˆμ € μ ‘κ·Ό ν•„μš”ν•  경우
954
996
  get dataManager() {
955
- return e(this, F);
997
+ return e(this, Y);
956
998
  }
957
999
  };
958
- F = new WeakMap(), pe = new WeakMap(), a(Ie, "NineTable");
959
- let Ae = Ie;
960
- customElements.get("nine-table") || customElements.define("nine-table", Ae);
1000
+ Y = new WeakMap(), pe = new WeakMap(), h(Me, "NineTable");
1001
+ let Te = Me;
1002
+ customElements.get("nine-table") || customElements.define("nine-table", Te);
961
1003
  //# sourceMappingURL=nine-table.js.map