@ninebone/table 0.0.274 β†’ 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 a = (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,38 +14,38 @@ 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
- a(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__ */ a(() => {
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__ */ a(() => {
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, h = s.scrollWidth;
48
- if (l !== 0 && h > l)
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
+ if (l !== 0 && d > l)
49
49
  o && (o.style.display = "flex");
50
50
  else {
51
51
  o && (o.style.display = "none");
@@ -53,60 +53,60 @@ const _e = class _e extends HTMLElement {
53
53
  }
54
54
  const c = n.clientWidth;
55
55
  if (c <= 0) return;
56
- const d = Math.max(Math.min(c * (l / h), c), 20);
57
- r.style.width = `${d}px`;
58
- const u = t.scrollLeft, b = h - l;
59
- let w = 0;
60
- b > 0 && (w = parseInt(u / b * (c - d), 10)), w < 0 && (w = 0);
61
- const x = c - d;
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;
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__ */ a((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
- const h = r.width - o;
72
- l > h && (l = h), 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 >= h - 1;
73
- const c = s.clientWidth, d = n.scrollWidth;
74
- let u = h > 0 ? -l * (d - c) / h : 0;
75
- return -u > d - c && (u = -(d - c)), -u + 5 > d - c && (u = -(d - c)), c >= d && (u = 0), n.style.transform = `translateX(${u}px)`, l > 0 && l < h - 1;
71
+ const d = r.width - o;
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__ */ a(() => {
77
+ h(this, oe, /* @__PURE__ */ a(() => {
78
78
  const t = /* @__PURE__ */ a((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));
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
87
  }, "delayScroll"), s = /* @__PURE__ */ a(() => {
88
- clearInterval(e(this, B)), clearInterval(e(this, D));
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;
103
+ n.stopPropagation(), n.preventDefault(), g(this, W, !0), this.shiftX = n.clientX - e(this, b).thumb.getBoundingClientRect().left;
104
104
  const r = /* @__PURE__ */ a((l) => {
105
- if (!e(this, z)) return;
106
- const h = e(this, y).track.getBoundingClientRect();
107
- e(this, P).call(this, l.clientX - h.left - this.shiftX);
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
108
  }, "onMouseMove"), o = /* @__PURE__ */ a(() => {
109
- g(this, z, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
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
  });
@@ -183,140 +183,134 @@ const _e = class _e extends HTMLElement {
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(), a(_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__ */ a(() => e(this, R), "getRowHeight"));
213
- f(this, re, /* @__PURE__ */ a(() => {
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__ */ a(() => {
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, h = l.querySelector("thead"), c = l.querySelector("tfoot");
230
- h && (o += h.offsetHeight || h.getBoundingClientRect().height), c && (o += c.offsetHeight || c.getBoundingClientRect().height);
231
- const d = Math.max(r - o, 100);
232
- if (e(this, C) !== d && (g(this, C, d), 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__ */ a((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__ */ a((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 : "", h = 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");
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");
263
240
  let c = 0;
264
- const d = t.querySelectorAll("tr:not(.nodata)");
265
- if (d.forEach((u, b) => {
241
+ const f = t.querySelectorAll("tr:not(.nodata)");
242
+ return f.forEach((u) => {
266
243
  c += u.offsetHeight || u.getBoundingClientRect().height;
267
- }), d.forEach((u) => u.remove()), r && (r.style.display = o, r.style.visibility = l, r.style.position = h), g(this, R, c), 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);
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__ */ a((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__ */ a(() => {
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;
309
303
  }
310
304
  };
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(), a(He, "RowManager");
312
- let Se = He;
313
- var ce, G;
314
- const k = class k {
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 {
315
309
  /**
316
310
  * 🎯 λ ˆμ΄μ•„μ›ƒ λ‚΄μ˜ μ—¬λŸ¬ rawTables 배열을 μΌκ΄„λ‘œ λ°›μ•„ 단일 λ§ˆμŠ€ν„° ν…œν”Œλ¦ΏμœΌλ‘œ 사전 μ»΄νŒŒμΌν•©λ‹ˆλ‹€.
317
311
  */
318
312
  static compileAll(i) {
319
- return Array.isArray(i) ? i.map((t) => k.compile(t)) : [];
313
+ return Array.isArray(i) ? i.map((t) => L.compile(t)) : [];
320
314
  }
321
315
  /**
322
316
  * 🎯 단일 원본 ν…Œμ΄λΈ”μ„ λ°›μ•„ κΈ°λ³Έ ꡬ쑰 보정 및 2차원 격자 인덱슀 사전 λΆ€μ—¬ μ™„λ£Œλœ λ§ˆμŠ€ν„° ν…Œμ΄λΈ” λ°˜ν™˜
@@ -325,15 +319,15 @@ const k = class k {
325
319
  var n, r, o;
326
320
  if (!i) return null;
327
321
  const t = i.cloneNode(!0);
328
- return e(n = k, ce).call(n, t), e(r = k, G).call(r, t, "thead"), e(o = k, G).call(o, t, "tbody"), Array.from(t.querySelectorAll("colgroup col")).forEach((l, h) => {
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) => {
329
323
  const c = l.getAttribute("fixed");
330
- c && t.querySelectorAll(`[data-col="${h}"]`).forEach((d) => {
331
- d.setAttribute("fixed", c);
324
+ c && t.querySelectorAll(`[data-col="${d}"]`).forEach((f) => {
325
+ f.setAttribute("fixed", c);
332
326
  });
333
327
  }), t;
334
328
  }
335
329
  };
336
- ce = new WeakMap(), G = new WeakMap(), a(k, "TableCompiler"), f(k, ce, /* @__PURE__ */ a((i) => {
330
+ he = new WeakMap(), Q = new WeakMap(), a(L, "TableCompiler"), h(L, he, /* @__PURE__ */ a((i) => {
337
331
  if (!i.querySelector("colgroup")) {
338
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);
339
333
  for (let o = 0; o < s; o++) {
@@ -347,86 +341,86 @@ ce = new WeakMap(), G = new WeakMap(), a(k, "TableCompiler"), f(k, ce, /* @__PUR
347
341
  s ? s.after(t) : i.prepend(t);
348
342
  }
349
343
  i.classList.add("nine-table-element"), i.style.display = "table";
350
- }, "#ensureTableStructure")), f(k, G, /* @__PURE__ */ a((i, t) => {
344
+ }, "#ensureTableStructure")), h(L, Q, /* @__PURE__ */ a((i, t) => {
351
345
  const s = Array.from(i.querySelectorAll(t + " tr")), n = Array.from(i.querySelectorAll(t + " th," + t + " td")), r = s.length;
352
346
  if (r === 0 || n.length === 0) return;
353
347
  let o = 0;
354
- n.forEach((h) => {
355
- o += h.colSpan || 1;
348
+ n.forEach((d) => {
349
+ o += d.colSpan || 1;
356
350
  });
357
351
  const l = Array.from(Array(r), () => Array(o).fill(null));
358
- s.forEach((h) => {
359
- const c = h.sectionRowIndex;
360
- let d = 0;
361
- Array.from(h.querySelectorAll("th,td")).forEach((u) => {
362
- for (let x = 0; x < l[c].length; x++)
363
- if (l[c][x] === null) {
364
- d = x;
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;
365
359
  break;
366
360
  }
367
- const b = u.rowSpan || 1, w = u.colSpan || 1;
368
- for (let x = 0; x < b; x++)
369
- for (let I = 0; I < w; I++)
370
- c + x < r && d + I < o && (l[c + x][d + I] = x === 0 && I === 0 ? "1" : "0");
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");
371
365
  });
372
- }), s.forEach((h) => {
373
- const c = h.sectionRowIndex;
374
- Array.from(h.querySelectorAll("th,td")).forEach((d) => {
366
+ }), s.forEach((d) => {
367
+ const c = d.sectionRowIndex;
368
+ Array.from(d.querySelectorAll("th,td")).forEach((f) => {
375
369
  for (let u = 0; u < l[c].length; u++)
376
370
  if (l[c][u] === "1") {
377
- d.dataset.col = u, l[c][u] = "0";
371
+ f.dataset.col = u, l[c][u] = "0";
378
372
  break;
379
373
  }
380
374
  });
381
375
  });
382
376
  }, "#resetColIndex"));
383
- let Re = k;
384
- var H, Y, U, J, he, de;
385
- const j = class j extends HTMLElement {
377
+ let Re = L;
378
+ var _, Y, F, ee, de, fe;
379
+ const Z = class Z extends HTMLElement {
386
380
  constructor() {
387
381
  super();
388
- f(this, H, null);
389
- f(this, Y);
390
- v(this, "generate", /* @__PURE__ */ a((t) => {
382
+ h(this, _, null);
383
+ h(this, Y);
384
+ x(this, "generate", /* @__PURE__ */ a((t) => {
391
385
  if (!t) return;
392
- g(this, H, Re.compile(t)), e(this, H).style.display = "table";
386
+ g(this, _, Re.compile(t)), e(this, _).style.display = "table";
393
387
  const s = this.querySelector(".ng-container-left"), n = this.querySelector(".ng-container-body"), r = this.querySelector(".ng-container-right");
394
388
  if (n) {
395
- const o = e(this, U).call(this, e(this, H), null);
396
- 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, _));
397
391
  }
398
392
  if (s) {
399
- const o = e(this, U).call(this, e(this, H), "left");
393
+ const o = e(this, F).call(this, e(this, _), "left");
400
394
  let l = 0;
401
395
  o.querySelectorAll("col").forEach((c) => {
402
- const d = parseInt(c.getAttribute("width"), 10);
403
- isNaN(d) || (l += d);
396
+ const f = parseInt(c.getAttribute("width"), 10);
397
+ isNaN(f) || (l += f);
404
398
  }), s.innerHTML = "", s.appendChild(o);
405
- const h = l > 0 ? l : 0;
406
- s.style.flex = `0 0 ${h}px`, s.style.width = `${h}px`;
399
+ const d = l > 0 ? l : 0;
400
+ s.style.flex = `0 0 ${d}px`, s.style.width = `${d}px`;
407
401
  }
408
402
  if (r) {
409
- const o = e(this, U).call(this, e(this, H), "right");
403
+ const o = e(this, F).call(this, e(this, _), "right");
410
404
  let l = 0;
411
405
  o.querySelectorAll("col").forEach((c) => {
412
- const d = parseInt(c.getAttribute("width"), 10);
413
- isNaN(d) || (l += d);
406
+ const f = parseInt(c.getAttribute("width"), 10);
407
+ isNaN(f) || (l += f);
414
408
  }), r.innerHTML = "", r.appendChild(o);
415
- const h = l > 0 ? l : 0;
416
- r.style.flex = `0 0 ${h}px`, r.style.width = `${h}px`;
409
+ const d = l > 0 ? l : 0;
410
+ r.style.flex = `0 0 ${d}px`, r.style.width = `${d}px`;
417
411
  }
418
412
  n && n.addEventListener("scroll", () => {
419
413
  var o;
420
414
  (o = this.querySelector("nine-table-hscrollbar")) == null || o.refresh();
421
415
  }), setTimeout(() => {
422
416
  var o;
423
- e(this, J).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();
424
418
  }, 0);
425
419
  }, "generate"));
426
420
  /**
427
421
  * 🎯 λ§ˆμŠ€ν„° ν…Œμ΄λΈ”μ„ 기반으둜 νŠΉμ • fixed νƒ€μž… μ˜μ—­λ§Œ λ‚¨κΈ°λŠ” λΆ„ν•  헬퍼
428
422
  */
429
- f(this, U, /* @__PURE__ */ a((t, s) => {
423
+ h(this, F, /* @__PURE__ */ a((t, s) => {
430
424
  const n = t.cloneNode(!0);
431
425
  return s === "left" ? n.querySelectorAll("col, th, td").forEach((r) => {
432
426
  r.getAttribute("fixed") !== "left" && r.remove();
@@ -436,37 +430,37 @@ const j = class j extends HTMLElement {
436
430
  r.remove();
437
431
  }), n;
438
432
  }, "#createSplitTable"));
439
- v(this, "getRowHeight", /* @__PURE__ */ a(() => e(this, Y).getRowHeight(), "getRowHeight"));
440
- v(this, "scrollToX", /* @__PURE__ */ a((t) => {
433
+ x(this, "getRowHeight", /* @__PURE__ */ a(() => e(this, Y).getRowHeight(), "getRowHeight"));
434
+ x(this, "scrollToX", /* @__PURE__ */ a((t) => {
441
435
  const s = this.querySelector(".ng-container-body");
442
436
  s && (s.scrollLeft = t);
443
437
  }, "scrollToX"));
444
- v(this, "scrollToY", /* @__PURE__ */ a((t) => {
438
+ x(this, "scrollToY", /* @__PURE__ */ a((t) => {
445
439
  const s = this.querySelector(".ng-container-body");
446
440
  s && (s.scrollTop = t);
447
441
  }, "scrollToY"));
448
- f(this, J, /* @__PURE__ */ a(() => {
449
- var c, d, u;
442
+ h(this, ee, /* @__PURE__ */ a(() => {
443
+ var c, f, u;
450
444
  const t = this.querySelector(".ng-container-left table"), s = this.querySelector(".ng-container-body table"), n = this.querySelector(".ng-container-right table");
451
445
  if (!s) return;
452
- const r = t ? Array.from(t.querySelectorAll("tr")) : [], o = Array.from(s.querySelectorAll("tr")), l = n ? Array.from(n.querySelectorAll("tr")) : [], h = Math.max(r.length, o.length, l.length);
453
- for (let b = 0; b < h; b++) {
454
- const w = [
455
- ((c = r[b]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
456
- ((d = o[b]) == null ? void 0 : d.getBoundingClientRect().height) || 0,
457
- ((u = l[b]) == null ? void 0 : u.getBoundingClientRect().height) || 0
458
- ], x = Math.max(...w);
459
- 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`));
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);
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`));
460
454
  }
461
455
  }, "#syncRowHeights"));
462
- f(this, he, /* @__PURE__ */ a(() => {
463
- e(this, de).call(this), new MutationObserver((t) => {
456
+ h(this, de, /* @__PURE__ */ a(() => {
457
+ e(this, fe).call(this), new MutationObserver((t) => {
464
458
  for (const s of t)
465
- s.attributeName === "class" && this.classList.contains("active") && e(this, J).call(this);
459
+ s.attributeName === "class" && this.classList.contains("active") && e(this, ee).call(this);
466
460
  }).observe(this, { attributes: !0 });
467
461
  }, "#init"));
468
- f(this, de, /* @__PURE__ */ a(() => {
469
- const t = j.SCROLLBAR_SIZE;
462
+ h(this, fe, /* @__PURE__ */ a(() => {
463
+ const t = Z.SCROLLBAR_SIZE;
470
464
  this.innerHTML = `
471
465
  <style>
472
466
  nine-table-sheet {
@@ -589,91 +583,91 @@ const j = class j extends HTMLElement {
589
583
  </div>
590
584
  `;
591
585
  }, "#render"));
592
- g(this, Y, new Se(this));
586
+ g(this, Y, new Ee(this));
593
587
  }
594
588
  connectedCallback() {
595
- e(this, he).call(this);
589
+ e(this, de).call(this);
596
590
  }
597
591
  disconnectedCallback() {
598
- this.innerHTML = "", Z.log("NineTableSheet destroyed.");
592
+ this.innerHTML = "", j.log("NineTableSheet destroyed.");
599
593
  }
600
594
  };
601
- H = new WeakMap(), Y = new WeakMap(), U = new WeakMap(), J = new WeakMap(), he = new WeakMap(), de = new WeakMap(), a(j, "NineTableSheet"), v(j, "SCROLLBAR_SIZE", 16);
602
- let ie = j;
603
- customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", ie);
604
- var fe, Q;
605
- 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 {
606
600
  constructor() {
607
601
  super();
608
- f(this, fe, /* @__PURE__ */ a(() => {
602
+ h(this, ue, /* @__PURE__ */ a(() => {
609
603
  var t;
610
604
  (t = this.querySelector(".nine-tab-bar")) == null || t.addEventListener("click", (s) => {
611
605
  var o;
612
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);
613
- e(this, Q).call(this, r, n);
614
- }), e(this, Q).call(this, 0, !1);
607
+ e(this, te).call(this, r, n);
608
+ }), e(this, te).call(this, 0, !1);
615
609
  }, "#init"));
616
- f(this, Q, /* @__PURE__ */ a((t, s = !1) => {
610
+ h(this, te, /* @__PURE__ */ a((t, s = !1) => {
617
611
  const n = /* @__PURE__ */ a(() => {
618
- const d = Array.from(this.querySelectorAll("nine-table-sheet"));
619
- Array.from(this.querySelectorAll("nine-splitter")).forEach((w) => w.style.setProperty("display", "none"));
620
- const b = d.filter((w) => w.classList.contains("active"));
621
- b.length < 2 || b.forEach((w) => {
622
- const x = parseInt(w.getAttribute("data-index"), 10), I = this.querySelector(`nine-splitter[data-split-index="${x}"]`), ze = d[x + 1];
623
- I && ze && ze.classList.contains("active") && I.style.setProperty("display", "flex");
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");
624
618
  });
625
- }, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), l = r.querySelectorAll(".nine-tab-item"), h = o.querySelectorAll("nine-table-sheet");
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");
626
620
  if (!l[t]) return;
627
621
  if (!s)
628
- l.forEach((d, u) => {
629
- d.classList.toggle("active", u === t);
630
- }), h.forEach((d, u) => {
631
- const b = u === t;
632
- d.classList.toggle("active", b), d.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%" : "";
633
627
  });
634
628
  else {
635
- const d = l[t], u = r.querySelectorAll(".nine-tab-item.active");
636
- if (d.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)
637
631
  return;
638
- d.classList.toggle("active");
639
- const b = o.querySelector(`nine-table-sheet[data-index="${t}"]`);
640
- 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 = ""));
641
635
  }
642
636
  const c = o.querySelectorAll("nine-table-sheet.active");
643
- c == null || c.forEach((d) => {
644
- d.style.flex = c.length > 1 ? "1 1 0%" : "1 1 100%";
637
+ c == null || c.forEach((f) => {
638
+ f.style.flex = c.length > 1 ? "1 1 0%" : "1 1 100%";
645
639
  }), n();
646
640
  }, "#switchSheet"));
647
641
  }
648
642
  connectedCallback() {
649
- e(this, fe).call(this);
643
+ e(this, ue).call(this);
650
644
  }
651
645
  };
652
- fe = new WeakMap(), Q = new WeakMap(), a(Ie, "NineTableSheets");
653
- let Ee = Ie;
654
- customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", Ee);
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__ */ a(() => {
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__ */ a(() => {
666
- var h, c;
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((d) => d.getRowHeight())), n = (h = e(this, S).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : h.getBoundingClientRect().height, r = (c = e(this, S).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : c.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__ */ a(() => {
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, c) => {
674
- const u = `<nine-table-sheet class="${c === 0 ? "active" : ""}" data-index="${c}"></nine-table-sheet>`, b = c < n - 1 ? `<nine-splitter class="h" data-split-index="${c}"></nine-splitter>` : "";
675
- return u + b;
676
- }).join(""), o = t.map((h, c) => `<div class="nine-tab-item ${c === 0 ? "active" : ""}" data-index="${c}">Sheet ${c + 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 {
@@ -774,24 +768,24 @@ const Me = class Me {
774
768
  <nine-table-footer></nine-table-footer>
775
769
  `;
776
770
  const l = e(this, S).shadowRoot.querySelectorAll("nine-table-sheet");
777
- l == null || l.forEach((h, c) => {
771
+ l == null || l.forEach((d, c) => {
778
772
  t[c] && setTimeout(() => {
779
- h.generate(t[c]), s && e(this, ee).call(this);
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(), a(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__ */ a(() => 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(), a($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__ */ a(() => {
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__ */ a((i) => {
824
+ x(this, "set", /* @__PURE__ */ a((i) => {
831
825
  this.clear(), this.add(i, !1);
832
826
  }, "set"));
833
- f(this, te, /* @__PURE__ */ a(() => ({
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__ */ a(() => {
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__ */ a(() => {
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__ */ a((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__ */ a((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__ */ a((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
- const h = e(this, m).rawRecords[n - l];
871
- h && (h.__ng.rowState = q.ROW_STATE.EMPTY);
864
+ const d = e(this, m).rawRecords[n - l];
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__ */ a((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__ */ a((i, t, s) => {
887
- var h;
880
+ x(this, "setValue", /* @__PURE__ */ a((i, t, s) => {
881
+ var d;
888
882
  i = parseInt(i, 10);
889
- const r = (typeof ((h = e(this, E).fields) == null ? void 0 : h.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__ */ a(() => {
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__ */ a(() => (e(this, A).length === 0 && e(this, m).rawRecords.length > 0 && this.resetRecords(), e(this, A)), "getValidData"));
904
- f(this, K, /* @__PURE__ */ a((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__ */ a(() => this.getValidData().length, "count"));
916
- v(this, "get", /* @__PURE__ */ a((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(), a(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
- a(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(), a(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