@ninebone/table 0.0.242 β†’ 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 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 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, ie, /* @__PURE__ */ a(() => {
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__ */ 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, 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"), 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,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 * (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`, 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__ */ a((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
- 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) => {
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__ */ a(() => {
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__ */ a((c) => {
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(() => {
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__ */ 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;
@@ -194,30 +194,30 @@ const ke = class ke extends HTMLElement {
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(), ie = new WeakMap(), V = new WeakMap(), se = new WeakMap(), a(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 $, _, E, W, H, M, ne, re, oe, le;
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, _, []);
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, 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
214
  e(this, re).call(this);
215
215
  }, "#init"));
216
216
  /**
217
217
  * 🎯 뷰포트 크기 λ³€ν™” μ‹œμ μ— 높이 계산 및 ν•„μš”ν•œ ν–‰ 개수 산정·캐싱을 μ™„κ²°
218
218
  */
219
- d(this, re, /* @__PURE__ */ a(() => {
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,50 +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 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), 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
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__ */ a((i) => {
245
- j.log(i);
246
- const t = e(this, $).querySelector(".ng-container-body"), s = i.querySelector("tbody"), n = Array.from(s.querySelectorAll("tr"));
247
- y(this, _, n.map((r) => r.cloneNode(!0))), y(this, E, null), e(this, oe).call(this, t);
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);
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,92 +287,140 @@ 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(() => {
303
- 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));
304
304
  }, "destroy"));
305
- y(this, $, i), e(this, ne).call(this);
305
+ y(this, M, i), e(this, ne).call(this);
306
306
  }
307
307
  get templateLength() {
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
+ 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;
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
+ }), 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));
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,30 @@ 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(() => {
442
+ const s = /* @__PURE__ */ h(() => {
400
443
  requestAnimationFrame(() => {
401
- var u, g, b;
444
+ var f, g, b;
402
445
  const n = this.querySelector(".ng-container-left table"), r = this.querySelector(".ng-container-body table"), o = this.querySelector(".ng-container-right table");
403
446
  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`));
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`));
412
455
  }
413
456
  });
414
457
  }, "syncRowHeights");
@@ -416,8 +459,8 @@ const G = class G extends HTMLElement {
416
459
  n.attributeName === "class" && this.classList.contains("active") && s();
417
460
  }).observe(this, { attributes: !0 });
418
461
  }, "#init"));
419
- d(this, ce, /* @__PURE__ */ a(() => {
420
- const t = G.SCROLLBAR_SIZE;
462
+ u(this, ce, /* @__PURE__ */ h(() => {
463
+ const t = j.SCROLLBAR_SIZE;
421
464
  this.innerHTML = `
422
465
  <style>
423
466
  nine-table-sheet {
@@ -454,7 +497,6 @@ const G = class G extends HTMLElement {
454
497
  flex-shrink: 0;
455
498
  }
456
499
 
457
- /* 🎯 μ»¨ν…Œμ΄λ„ˆ 자체 μŠ€ν¬λ‘€λ°” 생성을 막고 μ™ΈλΆ€ μ»€μŠ€ν…€ μŠ€ν¬λ‘€λ°” μ œμ–΄μ— 의쑴 */
458
500
  nine-table-sheet .ng-container-body {
459
501
  display: flex;
460
502
  flex-direction: column;
@@ -464,18 +506,17 @@ const G = class G extends HTMLElement {
464
506
  background: #ffffff;
465
507
  position: relative;
466
508
 
467
- /* μ›Ήν‚· λΈŒλΌμš°μ €(Chrome, Safari) μŠ€ν¬λ‘€λ°” 투λͺ…ν™” */
468
509
  &::-webkit-scrollbar {
469
510
  display: none;
470
511
  height: 0px;
471
512
  }
472
513
 
473
- /* νŒŒμ΄μ–΄ν­μŠ€ μŠ€ν¬λ‘€λ°” 숨기기 */
474
514
  scrollbar-width: none;
475
515
  }
476
516
 
477
517
  nine-table-sheet .ng-container-right {
478
518
  display: flex;
519
+ flex-init: 0;
479
520
  flex-direction: column;
480
521
  overflow: hidden;
481
522
  background: #ffffff;
@@ -542,23 +583,23 @@ const G = class G extends HTMLElement {
542
583
  </div>
543
584
  `;
544
585
  }, "#render"));
545
- y(this, U, new ve(this));
586
+ y(this, F, new xe(this));
546
587
  }
547
588
  connectedCallback() {
548
589
  e(this, ae).call(this);
549
590
  }
550
591
  disconnectedCallback() {
551
- this.innerHTML = "", j.log("NineTableSheet destroyed.");
592
+ this.innerHTML = "", Y.log("NineTableSheet destroyed.");
552
593
  }
553
594
  };
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;
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;
556
597
  customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", te);
557
598
  var he, J;
558
599
  const Ce = class Ce extends HTMLElement {
559
600
  constructor() {
560
601
  super();
561
- d(this, he, /* @__PURE__ */ a(() => {
602
+ u(this, he, /* @__PURE__ */ h(() => {
562
603
  var t;
563
604
  (t = this.querySelector(".nine-tab-bar")) == null || t.addEventListener("click", (s) => {
564
605
  var o;
@@ -566,35 +607,35 @@ const Ce = class Ce extends HTMLElement {
566
607
  e(this, J).call(this, r, n);
567
608
  }), e(this, J).call(this, 0, !1);
568
609
  }, "#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"));
610
+ u(this, J, /* @__PURE__ */ h((t, s = !1) => {
611
+ const n = /* @__PURE__ */ h(() => {
612
+ const c = Array.from(this.querySelectorAll("nine-table-sheet"));
572
613
  Array.from(this.querySelectorAll("nine-splitter")).forEach((b) => b.style.setProperty("display", "none"));
573
- const g = h.filter((b) => b.classList.contains("active"));
614
+ const g = c.filter((b) => b.classList.contains("active"));
574
615
  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");
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");
577
618
  });
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;
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");
620
+ if (!a[t]) return;
580
621
  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%" : "";
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%" : "";
586
627
  });
587
628
  else {
588
- const h = c[t], u = r.querySelectorAll(".nine-tab-item.active");
589
- 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)
590
631
  return;
591
- h.classList.toggle("active");
632
+ c.classList.toggle("active");
592
633
  const g = o.querySelector(`nine-table-sheet[data-index="${t}"]`);
593
634
  g && (g.classList.toggle("active"), g.classList.contains("active") || (g.style.flex = ""));
594
635
  }
595
636
  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%";
637
+ l == null || l.forEach((c) => {
638
+ c.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
598
639
  }), n();
599
640
  }, "#switchSheet"));
600
641
  }
@@ -602,32 +643,32 @@ const Ce = class Ce extends HTMLElement {
602
643
  e(this, he).call(this);
603
644
  }
604
645
  };
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;
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;
609
650
  const _e = class _e {
610
651
  constructor(i) {
611
- d(this, S);
612
- d(this, de, /* @__PURE__ */ a(() => {
652
+ u(this, R);
653
+ u(this, de, /* @__PURE__ */ h(() => {
613
654
  e(this, fe).call(this), new ResizeObserver((i) => {
614
655
  for (let t of i)
615
- e(this, S).getAttribute("auto-height") === "true" && e(this, Q).call(this);
616
- }).observe(e(this, S));
656
+ e(this, R).getAttribute("auto-height") === "true" && e(this, Q).call(this);
657
+ }).observe(e(this, R));
617
658
  }, "#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"));
659
+ u(this, Q, /* @__PURE__ */ h(() => {
660
+ var d, l;
661
+ const i = Array.from(e(this, R).shadowRoot.querySelectorAll("nine-table-sheet.active"));
621
662
  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`;
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`;
624
665
  }, "#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 = `
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 = `
631
672
  <style>
632
673
  :host {
633
674
  display: flex;
@@ -726,189 +767,189 @@ const _e = class _e {
726
767
  </nine-table-body>
727
768
  <nine-table-footer></nine-table-footer>
728
769
  `;
729
- const c = e(this, S).shadowRoot.querySelectorAll("nine-table-sheet");
730
- c == null || c.forEach((f, l) => {
770
+ const a = e(this, R).shadowRoot.querySelectorAll("nine-table-sheet");
771
+ a == null || a.forEach((d, l) => {
731
772
  t[l] && setTimeout(() => {
732
- f.generate(t[l]), s && e(this, Q).call(this);
773
+ d.generate(t[l]), s && e(this, Q).call(this);
733
774
  });
734
775
  });
735
776
  }, "#render"));
736
- y(this, S, i), e(this, de).call(this);
777
+ y(this, R, i), e(this, de).call(this);
737
778
  }
738
779
  };
739
- S = new WeakMap(), de = new WeakMap(), Q = new WeakMap(), fe = new WeakMap(), a(_e, "LayoutManager");
780
+ R = new WeakMap(), de = new WeakMap(), Q = new WeakMap(), fe = new WeakMap(), h(_e, "LayoutManager");
740
781
  let Se = _e;
741
- var z, X;
742
- const He = class He {
782
+ var W, V;
783
+ const Ie = class Ie {
743
784
  constructor(i) {
744
- d(this, z);
745
- d(this, X, -1);
746
- x(this, "count", /* @__PURE__ */ a(() => e(this, z).rawRecords.length, "count"));
747
- 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);
748
789
  }
749
790
  get at() {
750
- return e(this, X);
791
+ return e(this, V);
751
792
  }
752
793
  set at(i) {
753
794
  var s, n;
754
- y(this, X, parseInt(i, 10));
755
- const t = ((n = (s = e(this, z).owner).querySelector) == null ? void 0 : n.call(s, ".ng-container-body")) || e(this, z).owner.body;
756
- 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(() => {
757
798
  var r, o;
758
- (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));
759
800
  });
760
801
  }
761
802
  };
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 {
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 {
766
807
  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(() => {
774
- y(this, O, []);
775
- const i = e(this, A).template || [];
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, []);
816
+ const i = e(this, q).template || [];
776
817
  Array.from(i).forEach((t) => {
777
818
  var s;
778
- e(this, O).push(((s = t.getBoundingClientRect) == null ? void 0 : s.call(t).height) || 24);
779
- }), (e(this, v).rawRecords || []).forEach((t) => {
780
- t.__ng || (t.__ng = e(this, ee).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();
781
822
  });
782
823
  }, "#initialize"));
783
- x(this, "set", /* @__PURE__ */ a((i) => {
824
+ v(this, "set", /* @__PURE__ */ h((i) => {
784
825
  this.clear(), this.add(i, !1);
785
826
  }, "set"));
786
- d(this, ee, /* @__PURE__ */ a(() => ({
787
- rowState: k.ROW_STATE.EMPTY,
827
+ u(this, ee, /* @__PURE__ */ h(() => ({
828
+ rowState: L.ROW_STATE.EMPTY,
788
829
  deleted: !1,
789
830
  filtered: !1,
790
- height: e(this, O).slice(),
831
+ height: e(this, z).slice(),
791
832
  o: {},
792
833
  c: {},
793
- _: [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, {}, {}]
794
835
  }), "#getDefaultMeta"));
795
- x(this, "reset", /* @__PURE__ */ a(() => {
796
- y(this, q, []), y(this, K, []);
836
+ v(this, "reset", /* @__PURE__ */ h(() => {
837
+ y(this, k, []), y(this, K, []);
797
838
  }, "reset"));
798
- x(this, "clear", /* @__PURE__ */ a(() => {
839
+ v(this, "clear", /* @__PURE__ */ h(() => {
799
840
  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();
841
+ e(this, x).rawRecords = [], y(this, k, []), y(this, K, []), (i = e(this, x).viewRecords) != null && i.reset && e(this, x).viewRecords.reset();
801
842
  }, "clear"));
802
- d(this, be, /* @__PURE__ */ a((i) => {
843
+ u(this, be, /* @__PURE__ */ h((i) => {
803
844
  var n;
804
845
  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 = [];
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 = [];
806
847
  return i.forEach((r) => {
807
848
  const o = { v: [] };
808
- t.forEach((c) => {
809
- o.v.push(r[c] !== void 0 && r[c] !== null ? r[c] : "");
849
+ t.forEach((a) => {
850
+ o.v.push(r[a] !== void 0 && r[a] !== null ? r[a] : "");
810
851
  }), s.push(o);
811
852
  }), s;
812
853
  }, "#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;
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;
815
856
  }), i), "#defaultInsert"));
816
- x(this, "add", /* @__PURE__ */ a((i, t = !0) => {
857
+ v(this, "add", /* @__PURE__ */ h((i, t = !0) => {
817
858
  var r;
818
859
  i === void 0 && (i = {});
819
860
  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();
861
+ e(this, x).rawRecords = e(this, x).rawRecords.concat(e(this, ye).call(this, s)), this.resetRecords();
821
862
  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;
863
+ return t || s.forEach((o, a) => {
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;
826
867
  }, "add"));
827
- x(this, "delete", /* @__PURE__ */ a((i) => {
868
+ v(this, "delete", /* @__PURE__ */ h((i) => {
828
869
  var s;
829
870
  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);
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);
835
876
  });
836
877
  }
837
- }), 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();
838
879
  }, "delete"));
839
- x(this, "setValue", /* @__PURE__ */ a((i, t, s) => {
840
- var f;
880
+ v(this, "setValue", /* @__PURE__ */ h((i, t, s) => {
881
+ var d;
841
882
  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);
883
+ const r = (typeof ((d = e(this, q).fields) == null ? void 0 : d.get) == "function" ? e(this, q).fields.get() : []).indexOf(t);
843
884
  if (r < 0) return;
844
885
  const o = this.getValidData()[i];
845
886
  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);
887
+ const a = o.v[r];
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);
848
889
  }, "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) => {
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) => {
851
892
  i.__ng.rowidx = t;
852
- }), e(this, q).forEach((i, t) => {
893
+ }), e(this, k).forEach((i, t) => {
853
894
  i.__ng.i = t;
854
895
  });
855
896
  }, "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) => {
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) => {
858
899
  var s;
859
900
  if (!i) return i;
860
- const t = typeof ((s = e(this, A).fields) == null ? void 0 : s.get) == "function" ? e(this, A).fields.get() : [];
901
+ const t = typeof ((s = e(this, q).fields) == null ? void 0 : s.get) == "function" ? e(this, q).fields.get() : [];
861
902
  return Array.isArray(i) ? i.filter((n) => !n.__ng.deleted).map((n) => {
862
903
  const r = {};
863
- return t.forEach((o, c) => {
864
- r[o] = n.v ? n.v[c] : n[o];
904
+ return t.forEach((o, a) => {
905
+ r[o] = n.v ? n.v[a] : n[o];
865
906
  }), r.__ng = n.__ng, r;
866
907
  }) : i;
867
908
  }, "#conv2"));
868
- x(this, "count", /* @__PURE__ */ a(() => this.getValidData().length, "count"));
869
- x(this, "get", /* @__PURE__ */ a((i, t) => {
909
+ v(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
910
+ v(this, "get", /* @__PURE__ */ h((i, t) => {
870
911
  var r;
871
912
  const s = this.getValidData();
872
913
  if (!s || s.length <= 0) return;
873
914
  if (i == null) return e(this, Z).call(this, s);
874
915
  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() : [];
916
+ const n = typeof ((r = e(this, q).fields) == null ? void 0 : r.get) == "function" ? e(this, q).fields.get() : [];
876
917
  if (t != null) {
877
918
  const o = n.indexOf(t);
878
919
  return o >= 0 ? s[i].v[o] : null;
879
920
  }
880
921
  return e(this, Z).call(this, s[i]);
881
922
  }, "get"));
882
- y(this, A, i), y(this, v, t), e(this, ge).call(this);
923
+ y(this, q, i), y(this, x, t), e(this, ge).call(this);
883
924
  }
884
925
  get source() {
885
- return e(this, Z).call(this, e(this, v).rawRecords);
926
+ return e(this, Z).call(this, e(this, x).rawRecords);
886
927
  }
887
928
  set source(i) {
888
929
  this.clear(), this.add(i, !1);
889
930
  }
890
931
  get nextId() {
891
- return ++Oe(this, ue)._;
932
+ return ++De(this, ue)._;
892
933
  }
893
934
  get length() {
894
- return e(this, q).length;
935
+ return e(this, k).length;
895
936
  }
896
937
  getRowCount() {
897
938
  return this.length;
898
939
  }
899
940
  };
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", {
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", {
902
943
  EMPTY: "EMPTY",
903
944
  NORMAL: "NORMAL",
904
945
  INSERT: "INSERT",
905
946
  UPDATE: "UPDATE",
906
947
  DELETE: "DELETE"
907
948
  });
908
- let Ee = k;
909
- const Me = class Me {
949
+ let Re = L;
950
+ const He = class He {
910
951
  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 = () => {
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 = () => {
912
953
  var t;
913
954
  (t = this.owner.view) != null && t.redraw && this.owner.view.redraw();
914
955
  }, this.setDataSource = (t) => {
@@ -925,37 +966,37 @@ const Me = class Me {
925
966
  }, this.setDataSource([]);
926
967
  }
927
968
  };
928
- a(Me, "ngDataManager");
929
- let Te = Me;
930
- var F, pe;
931
- 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 {
932
973
  constructor() {
933
974
  super();
934
975
  //#created = false;
935
- d(this, F);
936
- d(this, pe);
937
- 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));
938
979
  }
939
980
  connectedCallback() {
940
- y(this, pe, new Se(this)), j.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 } }));
941
982
  }
942
983
  disconnectedCallback() {
943
- j.log("NineTable disconnected.");
984
+ Y.log("NineTable disconnected.");
944
985
  }
945
986
  // 🎯 μ™ΈλΆ€μ—μ„œ grid.data.set(...) ν˜•νƒœλ‘œ μ ‘κ·Όν•  수 μžˆλ„λ‘ 데이터 λ§€λ‹ˆμ € μ˜€ν”ˆ
946
987
  get data() {
947
- return e(this, F).data;
988
+ return e(this, X).data;
948
989
  }
949
990
  // 🎯 ν–‰(row) κ΄€λ ¨ μ œμ–΄ μ ‘κ·Όμž μ˜€ν”ˆ
950
991
  get row() {
951
- return e(this, F).row;
992
+ return e(this, X).row;
952
993
  }
953
994
  // 🎯 전체 데이터 λ§€λ‹ˆμ € μ ‘κ·Ό ν•„μš”ν•  경우
954
995
  get dataManager() {
955
- return e(this, F);
996
+ return e(this, X);
956
997
  }
957
998
  };
958
- F = new WeakMap(), pe = new WeakMap(), a(Ie, "NineTable");
959
- let Ae = Ie;
960
- customElements.get("nine-table") || customElements.define("nine-table", Ae);
999
+ X = new WeakMap(), pe = new WeakMap(), h(Me, "NineTable");
1000
+ let Te = Me;
1001
+ customElements.get("nine-table") || customElements.define("nine-table", Te);
961
1002
  //# sourceMappingURL=nine-table.js.map