@ninebone/table 0.0.241 β†’ 0.0.243

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