@ninebone/table 0.0.273 β†’ 0.0.275

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