@ninebone/table 0.0.129 β†’ 0.0.131

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,51 +1,51 @@
1
- var Le = Object.defineProperty;
2
- var _e = (w) => {
1
+ var _e = Object.defineProperty;
2
+ var Me = (w) => {
3
3
  throw TypeError(w);
4
4
  };
5
- var $e = (w, s, t) => s in w ? Le(w, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : w[s] = t;
6
- var c = (w, s) => Le(w, "name", { value: s, configurable: !0 });
7
- var v = (w, s, t) => $e(w, typeof s != "symbol" ? s + "" : s, t), He = (w, s, t) => s.has(w) || _e("Cannot " + t);
8
- var e = (w, s, t) => (He(w, s, "read from private field"), t ? t.call(w) : s.get(w)), f = (w, s, t) => s.has(w) ? _e("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(w) : s.set(w, t), p = (w, s, t, i) => (He(w, s, "write to private field"), i ? i.call(w, t) : s.set(w, t), t);
9
- var Me = (w, s, t, i) => ({
5
+ var $e = (w, i, t) => i in w ? _e(w, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : w[i] = t;
6
+ var c = (w, i) => _e(w, "name", { value: i, configurable: !0 });
7
+ var v = (w, i, t) => $e(w, typeof i != "symbol" ? i + "" : i, t), Ie = (w, i, t) => i.has(w) || Me("Cannot " + t);
8
+ var e = (w, i, t) => (Ie(w, i, "read from private field"), t ? t.call(w) : i.get(w)), u = (w, i, t) => i.has(w) ? Me("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(w) : i.set(w, t), p = (w, i, t, s) => (Ie(w, i, "write to private field"), s ? s.call(w, t) : i.set(w, t), t);
9
+ var He = (w, i, t, s) => ({
10
10
  set _(n) {
11
- p(w, s, n, t);
11
+ p(w, i, n, t);
12
12
  },
13
13
  get _() {
14
- return e(w, s, i);
14
+ return e(w, i, s);
15
15
  }
16
16
  });
17
- import { trace as Ie } from "@ninebone/util";
18
- const Re = class Re extends Ie.constructor {
17
+ import { trace as We } from "@ninebone/util";
18
+ const Re = class Re extends We.constructor {
19
19
  constructor() {
20
20
  super(), this.init("nine-table", "green");
21
21
  }
22
22
  };
23
23
  c(Re, "Trace");
24
- let fe = Re;
25
- const X = new fe();
26
- var H, B, y, O, D, N, Q, P, ee;
27
- const Se = class Se extends HTMLElement {
24
+ let ue = Re;
25
+ const Z = new ue();
26
+ var M, B, y, D, N, P, ee, X, te;
27
+ const Ee = class Ee extends HTMLElement {
28
28
  constructor() {
29
29
  super();
30
- f(this, H);
31
- f(this, B, !1);
32
- f(this, y);
33
- f(this, O);
34
- f(this, D);
35
- f(this, N);
36
- f(this, Q, /* @__PURE__ */ c(() => {
37
- if (!e(this, H)) return;
38
- const t = e(this, H).querySelector(".ng-container-body");
39
- t && (p(this, N, new ResizeObserver(() => {
30
+ u(this, M);
31
+ u(this, B, !1);
32
+ u(this, y);
33
+ u(this, D);
34
+ u(this, N);
35
+ u(this, P);
36
+ u(this, ee, /* @__PURE__ */ c(() => {
37
+ if (!e(this, M)) return;
38
+ const t = e(this, M).querySelector(".ng-container-body");
39
+ t && (p(this, P, new ResizeObserver(() => {
40
40
  this.refresh();
41
- })), e(this, N).observe(t));
41
+ })), e(this, P).observe(t));
42
42
  }, "#observeResize"));
43
43
  v(this, "refresh", /* @__PURE__ */ c(() => {
44
- if (!e(this, H) || !e(this, y) || e(this, B)) return;
45
- const t = e(this, y).container, i = t.querySelector("table");
46
- if (!i) return;
47
- const n = e(this, y).track, o = e(this, y).thumb, r = e(this, H).querySelector(".ng-container-bottom"), l = t.clientWidth, h = i.scrollWidth;
48
- if (l !== 0 && h > l)
44
+ if (!e(this, M) || !e(this, y) || e(this, B)) return;
45
+ const t = e(this, y).container, s = t.querySelector("table");
46
+ if (!s) return;
47
+ const n = e(this, y).track, o = e(this, y).thumb, r = e(this, M).querySelector(".ng-container-bottom"), l = t.clientWidth, f = s.scrollWidth;
48
+ if (l !== 0 && f > l)
49
49
  r && (r.style.display = "flex");
50
50
  else {
51
51
  r && (r.style.display = "none");
@@ -53,48 +53,48 @@ const Se = class Se extends HTMLElement {
53
53
  }
54
54
  const a = n.clientWidth;
55
55
  if (a <= 0) return;
56
- const u = Math.max(Math.min(a * (l / h), a), 20);
57
- o.style.width = `${u}px`;
58
- let d = 0;
59
- const g = i.style.transform;
56
+ const b = Math.max(Math.min(a * (l / f), a), 20);
57
+ o.style.width = `${b}px`;
58
+ let h = 0;
59
+ const g = s.style.transform;
60
60
  if (g && g.includes("translateX")) {
61
- const R = g.match(/translateX\(([-\d.]+)px\)/);
62
- R && R[1] && (d = parseFloat(R[1]));
61
+ const x = g.match(/translateX\(([-\d.]+)px\)/);
62
+ x && x[1] && (h = parseFloat(x[1]));
63
63
  } else
64
- d = parseInt(i.style.left || 0, 10);
65
- let b = parseInt(Math.abs(d) * a / h, 10);
66
- b < 0 && (b = 0);
67
- const x = a - u;
68
- b > x && (b = x), o.style.left = `${b}px`, e(this, y).left.disabled = b === 0, e(this, y).right.disabled = b >= x - 1;
64
+ h = parseInt(s.style.left || 0, 10);
65
+ let d = parseInt(Math.abs(h) * a / f, 10);
66
+ d < 0 && (d = 0);
67
+ const S = a - b;
68
+ d > S && (d = S), o.style.left = `${d}px`, e(this, y).left.disabled = d === 0, e(this, y).right.disabled = d >= S - 1;
69
69
  }, "refresh"));
70
- f(this, P, /* @__PURE__ */ c((t) => {
70
+ u(this, X, /* @__PURE__ */ c((t) => {
71
71
  if (!e(this, y)) return !1;
72
- const i = e(this, y).container, n = i.querySelector("table");
72
+ const s = e(this, y).container, n = s.querySelector("table");
73
73
  if (!n) return !1;
74
74
  const o = e(this, y).track.getBoundingClientRect(), r = e(this, y).thumb.clientWidth;
75
75
  let l = t;
76
76
  l < 0 && (l = 0);
77
- const h = o.width - r;
78
- 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;
79
- const a = i.clientWidth, u = n.scrollWidth;
80
- let d = h > 0 ? -l * (u - a) / h : 0;
81
- return -d > u - a && (d = -(u - a)), -d + 5 > u - a && (d = -(u - a)), a >= u && (d = 0), n.style.transform = `translateX(${d}px)`, l > 0 && l < h - 1;
77
+ const f = o.width - r;
78
+ l > f && (l = f), 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 >= f - 1;
79
+ const a = s.clientWidth, b = n.scrollWidth;
80
+ let h = f > 0 ? -l * (b - a) / f : 0;
81
+ return -h > b - a && (h = -(b - a)), -h + 5 > b - a && (h = -(b - a)), a >= b && (h = 0), n.style.transform = `translateX(${h}px)`, l > 0 && l < f - 1;
82
82
  }, "#thumbMoveTo"));
83
- f(this, ee, /* @__PURE__ */ c(() => {
83
+ u(this, te, /* @__PURE__ */ c(() => {
84
84
  const t = /* @__PURE__ */ c((n) => {
85
- clearInterval(e(this, O)), clearInterval(e(this, D));
85
+ clearInterval(e(this, D)), clearInterval(e(this, N));
86
86
  const o = parseInt(e(this, y).thumb.style.left || 0, 10);
87
- e(this, P).call(this, o + n), p(this, O, setInterval(() => {
88
- clearInterval(e(this, O)), p(this, D, setInterval(() => {
87
+ e(this, X).call(this, o + n), p(this, D, setInterval(() => {
88
+ clearInterval(e(this, D)), p(this, N, setInterval(() => {
89
89
  const r = parseInt(e(this, y).thumb.style.left || 0, 10);
90
- e(this, P).call(this, r + n) || clearInterval(e(this, D));
90
+ e(this, X).call(this, r + n) || clearInterval(e(this, N));
91
91
  }, 50));
92
92
  }, 500));
93
- }, "delayScroll"), i = /* @__PURE__ */ c(() => {
94
- clearInterval(e(this, O)), clearInterval(e(this, D));
93
+ }, "delayScroll"), s = /* @__PURE__ */ c(() => {
94
+ clearInterval(e(this, D)), clearInterval(e(this, N));
95
95
  }, "clearTimer");
96
96
  ["mouseup", "mouseleave", "touchend"].forEach((n) => {
97
- e(this, y).left.addEventListener(n, i), e(this, y).right.addEventListener(n, i), e(this, y).track.addEventListener(n, i);
97
+ e(this, y).left.addEventListener(n, s), e(this, y).right.addEventListener(n, s), e(this, y).track.addEventListener(n, s);
98
98
  }), e(this, y).left.addEventListener("mousedown", (n) => {
99
99
  n.button === 0 && t(-20);
100
100
  }), e(this, y).right.addEventListener("mousedown", (n) => {
@@ -103,23 +103,23 @@ const Se = class Se extends HTMLElement {
103
103
  if (n.button !== 0) return;
104
104
  n.preventDefault();
105
105
  const o = e(this, y).track.getBoundingClientRect(), r = e(this, y).thumb.clientWidth;
106
- e(this, P).call(this, n.clientX - o.left - r / 2);
106
+ e(this, X).call(this, n.clientX - o.left - r / 2);
107
107
  }), e(this, y).thumb.addEventListener("mousedown", (n) => {
108
108
  if (n.button !== 0) return;
109
109
  n.stopPropagation(), n.preventDefault(), p(this, B, !0), this.shiftX = n.clientX - e(this, y).thumb.getBoundingClientRect().left;
110
110
  const o = /* @__PURE__ */ c((l) => {
111
111
  if (!e(this, B)) return;
112
- const h = e(this, y).track.getBoundingClientRect();
113
- e(this, P).call(this, l.clientX - h.left - this.shiftX);
112
+ const f = e(this, y).track.getBoundingClientRect();
113
+ e(this, X).call(this, l.clientX - f.left - this.shiftX);
114
114
  }, "onMouseMove"), r = /* @__PURE__ */ c(() => {
115
- p(this, B, !1), i(), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", r), this.refresh();
115
+ p(this, B, !1), s(), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", r), this.refresh();
116
116
  }, "onMouseUp");
117
117
  document.addEventListener("mousemove", o), document.addEventListener("mouseup", r);
118
118
  });
119
119
  }, "#init"));
120
120
  }
121
121
  connectedCallback() {
122
- if (p(this, H, this.closest("nine-table-sheet") || this.getRootNode().host), !e(this, H)) return;
122
+ if (p(this, M, this.closest("nine-table-sheet") || this.getRootNode().host), !e(this, M)) return;
123
123
  this.innerHTML = `
124
124
  <style>
125
125
  nine-table-hscrollbar {
@@ -184,210 +184,209 @@ const Se = class Se extends HTMLElement {
184
184
  <button class='ng-scroll-right' disabled><div class='ng-scroll-icon'></div></button>
185
185
  `;
186
186
  const t = /* @__PURE__ */ c(() => {
187
- const i = e(this, H).querySelector(".ng-container-body");
188
- if (!i) {
187
+ const s = e(this, M).querySelector(".ng-container-body");
188
+ if (!s) {
189
189
  setTimeout(t, 10);
190
190
  return;
191
191
  }
192
192
  p(this, y, {
193
- container: i,
193
+ container: s,
194
194
  track: this.querySelector(".ng-scroll-track"),
195
195
  thumb: this.querySelector(".ng-scroll-thumb"),
196
196
  left: this.querySelector(".ng-scroll-left"),
197
197
  right: this.querySelector(".ng-scroll-right")
198
- }), e(this, ee).call(this), e(this, Q).call(this), this.refresh();
198
+ }), e(this, te).call(this), e(this, ee).call(this), this.refresh();
199
199
  }, "initWhenReady");
200
200
  t();
201
201
  }
202
202
  disconnectedCallback() {
203
- e(this, N) && e(this, N).disconnect();
203
+ e(this, P) && e(this, P).disconnect();
204
204
  }
205
205
  };
206
- H = new WeakMap(), B = new WeakMap(), y = new WeakMap(), O = new WeakMap(), D = new WeakMap(), N = new WeakMap(), Q = new WeakMap(), P = new WeakMap(), ee = new WeakMap(), c(Se, "NineTableHScrollBar");
207
- let ue = Se;
208
- customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ue);
209
- var $, M, A, I, Y, te;
210
- const Ee = class Ee {
211
- // 🎯 λ¦¬μ‚¬μ΄μ¦ˆ μ΄λ²€νŠΈμ—μ„œ 미리 κ³„μ‚°λœ μ •ν™•ν•œ 뷰포트 높이
212
- constructor(s) {
213
- f(this, $);
214
- f(this, M, []);
215
- f(this, A, null);
216
- f(this, I, null);
217
- f(this, Y, 0);
206
+ M = new WeakMap(), B = new WeakMap(), y = new WeakMap(), D = new WeakMap(), N = new WeakMap(), P = new WeakMap(), ee = new WeakMap(), X = new WeakMap(), te = new WeakMap(), c(Ee, "NineTableHScrollBar");
207
+ let be = Ee;
208
+ customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", be);
209
+ var V, I, q, $, H, A, ie;
210
+ const Te = class Te {
211
+ constructor(i) {
212
+ u(this, V);
213
+ u(this, I, []);
214
+ u(this, q, null);
215
+ u(this, $, null);
216
+ u(this, H, 0);
217
+ u(this, A, 0);
218
218
  /**
219
- * 🎯 뷰포트 크기 λ³€ν™” μ‹œμ (Resize)에 μ •ν™•ν•œ μ‹œνŠΈ 높이와 헀더/ν‘Έν„° μ œμ™Έ 높이λ₯Ό 미리 계산
219
+ * 🎯 뷰포트 크기 λ³€ν™” μ‹œμ μ— 높이 계산 및 ν•„μš”ν•œ ν–‰ 개수 산정·캐싱을 μ™„κ²°
220
220
  */
221
- f(this, te, /* @__PURE__ */ c(() => {
222
- !e(this, $) || !(e(this, $) instanceof HTMLElement) || (p(this, I, new ResizeObserver((s) => {
223
- for (const t of s) {
224
- const i = t.target;
225
- if (!i.classList.contains("active"))
221
+ u(this, ie, /* @__PURE__ */ c(() => {
222
+ !e(this, V) || !(e(this, V) instanceof HTMLElement) || (p(this, $, new ResizeObserver((i) => {
223
+ for (const t of i) {
224
+ const s = t.target;
225
+ if (!s.classList.contains("active"))
226
226
  continue;
227
227
  const n = t.contentRect.height || (t.borderBoxSize && t.borderBoxSize[0] ? t.borderBoxSize[0].blockSize : 0);
228
- if (X.log(i, n), n > 0) {
229
- let o = i.clientHeight || i.getBoundingClientRect().height || n, r = 0;
230
- const l = i.querySelector(".ng-container-body") || i, h = l.querySelector("thead"), a = l.querySelector("tfoot");
231
- h && (r += h.offsetHeight || h.getBoundingClientRect().height), a && (r += a.offsetHeight || a.getBoundingClientRect().height), p(this, Y, Math.max(o - r, 100)), X.log(`[RowManager] Active Sheet Height Updated: ${e(this, Y)}px (Total: ${o}, Header/Footer: ${r})`);
228
+ if (n > 0) {
229
+ const o = s.clientHeight || s.getBoundingClientRect().height || n;
230
+ let r = 0;
231
+ const l = s.querySelector(".ng-container-body") || s, f = l.querySelector("thead"), a = l.querySelector("tfoot");
232
+ f && (r += f.offsetHeight || f.getBoundingClientRect().height), a && (r += a.offsetHeight || a.getBoundingClientRect().height);
233
+ const b = Math.max(o - r, 100);
234
+ if (e(this, H) !== b && (p(this, H, b), e(this, q) !== null)) {
235
+ const h = Math.ceil(e(this, H) / e(this, q));
236
+ p(this, A, h + 20), Z.log(`[RowManager] Resized. Height: ${e(this, H)}px | Target Rows: ${e(this, A)}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
237
+ const d = s.querySelector(g);
238
+ d && d.querySelector("tbody") && this.renderRows(d);
239
+ });
240
+ }
232
241
  }
233
242
  }
234
- })), e(this, I).observe(e(this, $)));
243
+ })), e(this, $).observe(e(this, V)));
235
244
  }, "#initResizeObserver"));
236
- v(this, "initTemplate", /* @__PURE__ */ c((s) => {
237
- const t = s.querySelector("tbody.bindable") || s.querySelector("tbody");
245
+ v(this, "initTemplate", /* @__PURE__ */ c((i) => {
246
+ const t = i.querySelector("tbody.bindable") || i.querySelector("tbody");
238
247
  if (!t) return;
239
- const i = Array.from(t.querySelectorAll("tr")).filter((n) => !n.classList.contains("nodata"));
240
- p(this, M, i.map((n) => n.cloneNode(!0))), p(this, A, null), console.log(`[RowManager] Template initialized with ${e(this, M).length} row(s).`);
248
+ const s = Array.from(t.querySelectorAll("tr")).filter((n) => !n.classList.contains("nodata"));
249
+ p(this, I, s.map((n) => n.cloneNode(!0))), p(this, q, null), console.log(`[RowManager] Template initialized with ${e(this, I).length} row(s).`);
241
250
  }, "initTemplate"));
242
- v(this, "measureAndCacheHeight", /* @__PURE__ */ c((s) => {
243
- if (e(this, A) !== null)
244
- return e(this, A);
245
- if (e(this, M).length === 0)
251
+ v(this, "measureAndCacheHeight", /* @__PURE__ */ c((i) => {
252
+ if (e(this, q) !== null)
253
+ return e(this, q);
254
+ if (e(this, I).length === 0)
246
255
  throw new Error("[RowManager] Template TRs are empty.");
247
- const t = s.querySelector("tbody.bindable") || s.querySelector("tbody");
256
+ const t = i.querySelector("tbody.bindable") || i.querySelector("tbody");
248
257
  if (!t) return 24;
249
258
  t.querySelectorAll("tr:not(.nodata)").forEach((l) => l.remove());
250
- const i = t.querySelector("tr.nodata"), n = document.createDocumentFragment();
251
- e(this, M).forEach((l) => {
259
+ const s = t.querySelector("tr.nodata"), n = document.createDocumentFragment();
260
+ e(this, I).forEach((l) => {
252
261
  n.appendChild(l.cloneNode(!0));
253
- }), i ? i.before(n) : t.appendChild(n);
262
+ }), s ? s.before(n) : t.appendChild(n);
254
263
  let o = 0;
255
- return t.querySelectorAll("tr:not(.nodata)").forEach((l, h) => {
264
+ if (t.querySelectorAll("tr:not(.nodata)").forEach((l, f) => {
256
265
  const a = l.offsetHeight;
257
266
  if (a === 0)
258
- throw new Error(`[RowManager] Rendered TR[${h}] height is 0. Check CSS styles.`);
259
- o += a, X.log(`[RowManager] Measured TR[${h}] height: ${a}px`);
260
- }), p(this, A, o), console.log(`[RowManager] Template Height Cached Successfully: ${e(this, A)}px`), e(this, A);
267
+ throw new Error(`[RowManager] Rendered TR[${f}] height is 0. Check CSS styles.`);
268
+ o += a;
269
+ }), p(this, q, o), e(this, H) > 0) {
270
+ const l = Math.ceil(e(this, H) / e(this, q));
271
+ p(this, A, l + 20);
272
+ }
273
+ return console.log(`[RowManager] Template Height Cached: ${e(this, q)}px | RowCount: ${e(this, A)}`), e(this, q);
261
274
  }, "measureAndCacheHeight"));
262
275
  /**
263
- * 🎯 λ¦¬μ‚¬μ΄μ¦ˆ μ΄λ²€νŠΈμ—μ„œ 미리 κ³„μ‚°λœ μ •ν™•ν•œ 뷰포트 높이 기반으둜 ν–‰ 갯수 μ‚°μ •
276
+ * 🎯 μΊμ‹œλœ ν–‰ 개수 λ°˜ν™˜ (없을 λ•Œλ§Œ μ΅œμ†Œν•œμ˜ λ°©μ–΄ μ—°μ‚°)
264
277
  */
265
- v(this, "calculateRequiredRowCount", /* @__PURE__ */ c((s) => {
266
- let t = e(this, Y);
267
- if (!t || t === 0) {
268
- const l = e(this, $).closest("nine-table-body") || e(this, $), h = l.clientHeight || l.getBoundingClientRect().height || l.offsetHeight || 400;
269
- let a = 0;
270
- const u = s.querySelector("thead"), d = s.querySelector("tfoot");
271
- u && (a += u.offsetHeight || u.getBoundingClientRect().height), d && (a += d.offsetHeight || d.getBoundingClientRect().height), t = Math.max(h - a, 100);
272
- }
273
- const i = e(this, A) !== null ? e(this, A) : this.measureAndCacheHeight(s), r = Math.ceil(t / i) + 20;
274
- return console.log(`[RowManager] Resize-Calculated Viewport Height: ${t}px | Template Height: ${i}px | Target Rows: ${r}`), r;
275
- }, "calculateRequiredRowCount"));
276
- v(this, "renderRows", /* @__PURE__ */ c((s, t = null) => {
277
- if (e(this, M).length === 0) return;
278
- const i = s.querySelector("tbody.bindable") || s.querySelector("tbody");
279
- if (!i) return;
280
- i.querySelectorAll("tr:not(.nodata)").forEach((l) => l.remove());
281
- const n = i.querySelector("tr.nodata"), o = document.createDocumentFragment(), r = t !== null ? t : this.calculateRequiredRowCount(s);
282
- console.log(`[RowManager] Rendering ${r} row sets into container...`);
278
+ v(this, "calculateRequiredRowCount", /* @__PURE__ */ c((i) => e(this, A) > 0 ? e(this, A) : (this.measureAndCacheHeight(i), e(this, A) || 40), "calculateRequiredRowCount"));
279
+ /**
280
+ * 🎯 μΊμ‹œλœ ν–‰ 개수λ₯Ό κ³§λ°”λ‘œ κ°€μ Έμ™€μ„œ TR λΌˆλŒ€ μ£Όμž… (쀑볡 계산 제거)
281
+ */
282
+ v(this, "renderRows", /* @__PURE__ */ c((i, t = null) => {
283
+ if (e(this, I).length === 0) return;
284
+ const s = i.querySelector("tbody.bindable") || i.querySelector("tbody");
285
+ if (!s) return;
286
+ s.querySelectorAll("tr:not(.nodata)").forEach((l) => l.remove());
287
+ const n = s.querySelector("tr.nodata"), o = document.createDocumentFragment(), r = e(this, A);
288
+ Z.log(r);
283
289
  for (let l = 0; l < r; l++)
284
- e(this, M).forEach((h) => {
285
- o.appendChild(h.cloneNode(!0));
290
+ e(this, I).forEach((f) => {
291
+ o.appendChild(f.cloneNode(!0));
286
292
  });
287
- n ? n.before(o) : i.appendChild(o), console.log(`[RowManager] Successfully rendered. Total DOM tr count: ${i.querySelectorAll("tr:not(.nodata)").length}`);
293
+ n ? n.before(o) : s.appendChild(o), console.log(`[RowManager] Rendered ${r} sets into DOM.`);
288
294
  }, "renderRows"));
289
- /**
290
- * 🎯 μ»΄ν¬λ„ŒνŠΈ μ†Œλ©Έ μ‹œ Observer ν•΄μ œ
291
- */
292
295
  v(this, "destroy", /* @__PURE__ */ c(() => {
293
- e(this, I) && (e(this, I).disconnect(), p(this, I, null));
296
+ e(this, $) && (e(this, $).disconnect(), p(this, $, null));
294
297
  }, "destroy"));
295
- p(this, $, s), e(this, te).call(this);
298
+ p(this, V, i), e(this, ie).call(this);
296
299
  }
297
300
  get templateLength() {
298
- return e(this, M).length || 1;
301
+ return e(this, I).length || 1;
299
302
  }
300
303
  };
301
- $ = new WeakMap(), M = new WeakMap(), A = new WeakMap(), I = new WeakMap(), Y = new WeakMap(), te = new WeakMap(), c(Ee, "RowManager");
302
- let ge = Ee;
303
- var k, L, se;
304
- const K = class K extends HTMLElement {
304
+ V = new WeakMap(), I = new WeakMap(), q = new WeakMap(), $ = new WeakMap(), H = new WeakMap(), A = new WeakMap(), ie = new WeakMap(), c(Te, "RowManager");
305
+ let ge = Te;
306
+ var L, W, se;
307
+ const j = class j extends HTMLElement {
305
308
  constructor() {
306
309
  super();
307
- f(this, k, null);
308
- f(this, L);
310
+ u(this, L, null);
311
+ u(this, W);
309
312
  v(this, "init", /* @__PURE__ */ c((t) => {
310
313
  if (!t) return;
311
- const i = /* @__PURE__ */ c((a) => {
312
- const u = /* @__PURE__ */ c((g) => {
314
+ const s = /* @__PURE__ */ c((a) => {
315
+ const b = /* @__PURE__ */ c((g) => {
313
316
  if (g.querySelector("colgroup")) return;
314
- const b = g.querySelector("tbody tr") || g.querySelector("tr"), x = b ? b.querySelectorAll("th, td").length : 1, R = document.createElement("colgroup"), C = Math.max(Math.floor((g.clientWidth || 600) / x), 100);
315
- for (let E = 0; E < x; E++) {
316
- const de = document.createElement("col");
317
- de.setAttribute("width", C), R.appendChild(de);
317
+ const d = g.querySelector("tbody tr") || g.querySelector("tr"), S = d ? d.querySelectorAll("th, td").length : 1, x = document.createElement("colgroup"), k = Math.max(Math.floor((g.clientWidth || 600) / S), 100);
318
+ for (let E = 0; E < S; E++) {
319
+ const fe = document.createElement("col");
320
+ fe.setAttribute("width", k), x.appendChild(fe);
318
321
  }
319
- g.prepend(R);
320
- }, "ensureColgroup"), d = /* @__PURE__ */ c((g) => {
322
+ g.prepend(x);
323
+ }, "ensureColgroup"), h = /* @__PURE__ */ c((g) => {
321
324
  if (g.querySelector("thead")) return;
322
- const b = document.createElement("thead"), x = g.querySelector("colgroup");
323
- x ? x.after(b) : g.prepend(b);
325
+ const d = document.createElement("thead"), S = g.querySelector("colgroup");
326
+ S ? S.after(d) : g.prepend(d);
324
327
  }, "ensureThead");
325
- return u(a), d(a), a.classList.add("nine-table-element"), a;
328
+ return b(a), h(a), a.classList.add("nine-table-element"), a;
326
329
  }, "initializeTable"), n = t.cloneNode(!0);
327
- p(this, k, i(n)), e(this, k).style.display = "table", e(this, L).initTemplate(e(this, k));
328
- const o = this.querySelector(".ng-container-left"), r = this.querySelector(".ng-container-body"), l = this.querySelector(".ng-container-right"), h = /* @__PURE__ */ c((a, u, d = !1) => {
329
- const g = a.cloneNode(!0), b = Array.from(g.querySelectorAll("colgroup col")), x = [];
330
- return b.forEach((R, C) => {
331
- const E = R.getAttribute("fixed");
332
- (d ? !E || E === "" : E === u) || x.push(C);
333
- }), x.reverse().forEach((R) => {
334
- b[R] && b[R].remove(), g.querySelectorAll("tr").forEach((C) => {
335
- const E = C.querySelectorAll("th, td");
336
- E[R] && E[R].remove();
330
+ p(this, L, s(n)), e(this, L).style.display = "table", e(this, W).initTemplate(e(this, L));
331
+ const o = this.querySelector(".ng-container-left"), r = this.querySelector(".ng-container-body"), l = this.querySelector(".ng-container-right"), f = /* @__PURE__ */ c((a, b, h = !1) => {
332
+ const g = a.cloneNode(!0), d = Array.from(g.querySelectorAll("colgroup col")), S = [];
333
+ return d.forEach((x, k) => {
334
+ const E = x.getAttribute("fixed");
335
+ (h ? !E || E === "" : E === b) || S.push(k);
336
+ }), S.reverse().forEach((x) => {
337
+ d[x] && d[x].remove(), g.querySelectorAll("tr").forEach((k) => {
338
+ const E = k.querySelectorAll("th, td");
339
+ E[x] && E[x].remove();
337
340
  });
338
341
  }), g;
339
342
  }, "filterTableByFixed");
340
343
  if (r) {
341
- const a = h(e(this, k), null, !0);
342
- r.innerHTML = "", r.appendChild(a), e(this, L).measureAndCacheHeight(r), e(this, L).renderRows(r);
344
+ const a = f(e(this, L), null, !0);
345
+ r.innerHTML = "", r.appendChild(a), e(this, W).measureAndCacheHeight(r);
343
346
  }
344
347
  if (o) {
345
- const a = h(e(this, k), "left", !1);
346
- let u = 0;
347
- a.querySelectorAll("col").forEach((b) => {
348
- const x = parseInt(b.getAttribute("width"), 10);
349
- isNaN(x) || (u += x);
350
- }), o.innerHTML = "", o.appendChild(a);
351
- const d = e(this, L).calculateRequiredRowCount(o);
352
- e(this, L).renderRows(o, d);
353
- const g = u > 0 ? u : 0;
354
- o.style.flex = `0 0 ${g}px`, o.style.width = `${g}px`;
348
+ const a = f(e(this, L), "left", !1);
349
+ let b = 0;
350
+ a.querySelectorAll("col").forEach((g) => {
351
+ const d = parseInt(g.getAttribute("width"), 10);
352
+ isNaN(d) || (b += d);
353
+ }), o.innerHTML = "", o.appendChild(a), e(this, W).calculateRequiredRowCount(o);
354
+ const h = b > 0 ? b : 0;
355
+ o.style.flex = `0 0 ${h}px`, o.style.width = `${h}px`;
355
356
  }
356
357
  if (l) {
357
- const a = h(e(this, k), "right", !1);
358
- let u = 0;
359
- a.querySelectorAll("col").forEach((b) => {
360
- const x = parseInt(b.getAttribute("width"), 10);
361
- isNaN(x) || (u += x);
362
- }), l.innerHTML = "", l.appendChild(a);
363
- const d = e(this, L).calculateRequiredRowCount(l);
364
- e(this, L).renderRows(l, d);
365
- const g = u > 0 ? u : 0;
366
- l.style.flex = `0 0 ${g}px`, l.style.width = `${g}px`;
358
+ const a = f(e(this, L), "right", !1);
359
+ let b = 0;
360
+ a.querySelectorAll("col").forEach((g) => {
361
+ const d = parseInt(g.getAttribute("width"), 10);
362
+ isNaN(d) || (b += d);
363
+ }), l.innerHTML = "", l.appendChild(a), e(this, W).calculateRequiredRowCount(l);
364
+ const h = b > 0 ? b : 0;
365
+ l.style.flex = `0 0 ${h}px`, l.style.width = `${h}px`;
367
366
  }
368
367
  if (r) {
369
368
  const a = this.getRowCount();
370
369
  r.style.overflowY = a > 10 ? "auto" : "hidden", r.addEventListener("scroll", () => {
371
- const u = this.querySelector("nine-table-hscrollbar");
372
- u && typeof u.refresh == "function" && u.refresh();
370
+ const b = this.querySelector("nine-table-hscrollbar");
371
+ b && typeof b.refresh == "function" && b.refresh();
373
372
  });
374
373
  }
375
374
  setTimeout(() => {
376
375
  const a = this.querySelector("nine-table-hscrollbar");
377
376
  a && typeof a.refresh == "function" && a.refresh();
378
- }, 0), X.log(`NineTableSheet 3-split initialized with rows: ${this.getRowCount()}`);
377
+ }, 0), Z.log(`NineTableSheet 3-split initialized with rows: ${this.getRowCount()}`);
379
378
  }, "init"));
380
- v(this, "getRowCount", /* @__PURE__ */ c(() => e(this, k) ? e(this, k).querySelectorAll("tbody tr").length : 0, "getRowCount"));
379
+ v(this, "getRowCount", /* @__PURE__ */ c(() => e(this, L) ? e(this, L).querySelectorAll("tbody tr").length : 0, "getRowCount"));
381
380
  v(this, "scrollToX", /* @__PURE__ */ c((t) => {
382
- const i = this.querySelector(".ng-container-body");
383
- i && (i.scrollLeft = t);
381
+ const s = this.querySelector(".ng-container-body");
382
+ s && (s.scrollLeft = t);
384
383
  }, "scrollToX"));
385
384
  v(this, "scrollToY", /* @__PURE__ */ c((t) => {
386
- const i = this.querySelector(".ng-container-body");
387
- i && (i.scrollTop = t);
385
+ const s = this.querySelector(".ng-container-body");
386
+ s && (s.scrollTop = t);
388
387
  }, "scrollToY"));
389
- f(this, se, /* @__PURE__ */ c(() => {
390
- const t = K.SCROLLBAR_SIZE;
388
+ u(this, se, /* @__PURE__ */ c(() => {
389
+ const t = j.SCROLLBAR_SIZE;
391
390
  this.innerHTML = `
392
391
  <style>
393
392
  nine-table-sheet {
@@ -503,104 +502,104 @@ const K = class K extends HTMLElement {
503
502
  </div>
504
503
  `;
505
504
  }, "#render"));
506
- p(this, L, new ge(this));
505
+ p(this, W, new ge(this));
507
506
  }
508
507
  connectedCallback() {
509
508
  e(this, se).call(this);
510
509
  }
511
510
  disconnectedCallback() {
512
- this.innerHTML = "", X.log("NineTableSheet destroyed.");
511
+ this.innerHTML = "", Z.log("NineTableSheet destroyed.");
513
512
  }
514
513
  };
515
- k = new WeakMap(), L = new WeakMap(), se = new WeakMap(), c(K, "NineTableSheet"), v(K, "SCROLLBAR_SIZE", 16);
516
- let be = K;
517
- customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", be);
518
- var ie;
519
- const Te = class Te extends HTMLElement {
514
+ L = new WeakMap(), W = new WeakMap(), se = new WeakMap(), c(j, "NineTableSheet"), v(j, "SCROLLBAR_SIZE", 16);
515
+ let pe = j;
516
+ customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", pe);
517
+ var ne;
518
+ const qe = class qe extends HTMLElement {
520
519
  constructor() {
521
520
  super();
522
- f(this, ie, /* @__PURE__ */ c(() => {
521
+ u(this, ne, /* @__PURE__ */ c(() => {
523
522
  const t = this.querySelector(".nine-tab-bar");
524
- t && (t.addEventListener("click", (i) => {
525
- const n = i.target.closest(".nine-tab-item");
523
+ t && (t.addEventListener("click", (s) => {
524
+ const n = s.target.closest(".nine-tab-item");
526
525
  if (!n) return;
527
- const o = i.ctrlKey || i.metaKey || i.shiftKey, r = parseInt(n.dataset.index, 10);
526
+ const o = s.ctrlKey || s.metaKey || s.shiftKey, r = parseInt(n.dataset.index, 10);
528
527
  this.switchSheet(r, o);
529
528
  }), this.switchSheet(0, !1));
530
529
  }, "#init"));
531
- v(this, "switchSheet", /* @__PURE__ */ c((t, i = !1) => {
530
+ v(this, "switchSheet", /* @__PURE__ */ c((t, s = !1) => {
532
531
  const n = /* @__PURE__ */ c(() => {
533
- const d = this.querySelector("nine-table-sheets-body");
534
- d.querySelectorAll("nine-splitter").forEach((b) => {
535
- const x = parseInt(b.dataset.splitIndex, 10), R = d.querySelector(`nine-table-sheet[data-index="${x - 1}"]`), C = d.querySelector(`nine-table-sheet[data-index="${x}"]`);
536
- R && C && R.classList.contains("active") && C.classList.contains("active") ? b.classList.add("active") : b.classList.remove("active");
532
+ const h = this.querySelector("nine-table-sheets-body");
533
+ h.querySelectorAll("nine-splitter").forEach((d) => {
534
+ const S = parseInt(d.dataset.splitIndex, 10), x = h.querySelector(`nine-table-sheet[data-index="${S - 1}"]`), k = h.querySelector(`nine-table-sheet[data-index="${S}"]`);
535
+ x && k && x.classList.contains("active") && k.classList.contains("active") ? d.classList.add("active") : d.classList.remove("active");
537
536
  });
538
- }, "updateSplitters"), o = this.querySelector(".nine-tab-bar"), r = this.querySelector("nine-table-sheets-body"), l = o.querySelectorAll(".nine-tab-item"), h = r.querySelectorAll("nine-table-sheet");
537
+ }, "updateSplitters"), o = this.querySelector(".nine-tab-bar"), r = this.querySelector("nine-table-sheets-body"), l = o.querySelectorAll(".nine-tab-item"), f = r.querySelectorAll("nine-table-sheet");
539
538
  if (!l[t]) return;
540
- if (!i)
541
- l.forEach((d, g) => {
542
- d.classList.toggle("active", g === t);
543
- const b = r.querySelector(`nine-table-sheet[data-index="${g}"]`);
544
- b && (b.style.flex = "");
545
- }), h.forEach((d, g) => {
546
- d.classList.toggle("active", g === t);
539
+ if (!s)
540
+ l.forEach((h, g) => {
541
+ h.classList.toggle("active", g === t);
542
+ const d = r.querySelector(`nine-table-sheet[data-index="${g}"]`);
543
+ d && (d.style.flex = "");
544
+ }), f.forEach((h, g) => {
545
+ h.classList.toggle("active", g === t);
547
546
  });
548
547
  else {
549
- const d = l[t], g = o.querySelectorAll(".nine-tab-item.active");
550
- if (d.classList.contains("active") && g.length <= 1)
548
+ const h = l[t], g = o.querySelectorAll(".nine-tab-item.active");
549
+ if (h.classList.contains("active") && g.length <= 1)
551
550
  return;
552
- d.classList.toggle("active");
553
- const b = r.querySelector(`nine-table-sheet[data-index="${t}"]`);
554
- b && (b.classList.toggle("active"), b.classList.contains("active") || (b.style.flex = ""));
551
+ h.classList.toggle("active");
552
+ const d = r.querySelector(`nine-table-sheet[data-index="${t}"]`);
553
+ d && (d.classList.toggle("active"), d.classList.contains("active") || (d.style.flex = ""));
555
554
  }
556
555
  const a = Array.from(r.querySelectorAll("nine-table-sheet.active"));
557
556
  if (a.length > 1) {
558
- const d = 1 / a.length;
557
+ const h = 1 / a.length;
559
558
  a.forEach((g) => {
560
- (!g.style.flex || g.style.flex === "1 1 100%") && (g.style.flex = `${d} ${d} 0px`);
559
+ (!g.style.flex || g.style.flex === "1 1 100%") && (g.style.flex = `${h} ${h} 0px`);
561
560
  });
562
561
  } else
563
- a.forEach((d) => {
564
- d.style.flex = "1 1 100%";
562
+ a.forEach((h) => {
563
+ h.style.flex = "1 1 100%";
565
564
  });
566
565
  n();
567
- const u = r.querySelector("nine-table-sheet.active");
568
- if (u && typeof u.getRowCount == "function") {
569
- const d = this.querySelector("#row-count");
570
- d && (d.textContent = u.getRowCount().toLocaleString());
566
+ const b = r.querySelector("nine-table-sheet.active");
567
+ if (b && typeof b.getRowCount == "function") {
568
+ const h = this.querySelector("#row-count");
569
+ h && (h.textContent = b.getRowCount().toLocaleString());
571
570
  }
572
571
  }, "switchSheet"));
573
572
  }
574
573
  connectedCallback() {
575
- e(this, ie).call(this);
574
+ e(this, ne).call(this);
576
575
  }
577
576
  };
578
- ie = new WeakMap(), c(Te, "NineTableSheets");
579
- let pe = Te;
580
- customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", pe);
581
- var _, j, ne, G, re;
582
- const qe = class qe {
583
- constructor(s) {
584
- f(this, _);
585
- f(this, j, null);
586
- f(this, ne, /* @__PURE__ */ c(() => {
587
- const s = e(this, _).host;
588
- s && (p(this, j, new ResizeObserver((t) => {
589
- for (let i of t)
590
- s.getAttribute("auto-height") === "true" && e(this, G).call(this, s);
591
- })), e(this, j).observe(s));
577
+ ne = new WeakMap(), c(qe, "NineTableSheets");
578
+ let ye = qe;
579
+ customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", ye);
580
+ var _, G, re, J, oe;
581
+ const Ce = class Ce {
582
+ constructor(i) {
583
+ u(this, _);
584
+ u(this, G, null);
585
+ u(this, re, /* @__PURE__ */ c(() => {
586
+ const i = e(this, _).host;
587
+ i && (p(this, G, new ResizeObserver((t) => {
588
+ for (let s of t)
589
+ i.getAttribute("auto-height") === "true" && e(this, J).call(this, i);
590
+ })), e(this, G).observe(i));
592
591
  }, "#observeResize"));
593
- f(this, G, /* @__PURE__ */ c((s) => {
594
- var C, E;
595
- const t = (C = s.shadowRoot) == null ? void 0 : C.querySelector("nine-table-sheet.active");
592
+ u(this, J, /* @__PURE__ */ c((i) => {
593
+ var k, E;
594
+ const t = (k = i.shadowRoot) == null ? void 0 : k.querySelector("nine-table-sheet.active");
596
595
  if (!t) return;
597
- const i = ((E = t.getRowCount) == null ? void 0 : E.call(t)) || 0, n = parseInt(s.getAttribute("max-display-row"), 10) || 10, o = Math.min(i, n), r = t.querySelector("tbody tr") || t.querySelector("tr"), l = r ? r.getBoundingClientRect().height : 32, h = e(this, _).querySelector("nine-table-header"), a = e(this, _).querySelector("nine-table-sheets-footer"), u = h ? h.getBoundingClientRect().height : 40, d = a ? a.getBoundingClientRect().height : 32, b = u + d + 16, x = o * l + b;
598
- s.style.height = `${x}px`, s.style.maxHeight = `${n * l + b}px`;
599
- const R = e(this, _).querySelector("nine-table-sheets-body");
600
- R && (R.style.overflowY = i > n ? "auto" : "hidden");
596
+ const s = ((E = t.getRowCount) == null ? void 0 : E.call(t)) || 0, n = parseInt(i.getAttribute("max-display-row"), 10) || 10, o = Math.min(s, n), r = t.querySelector("tbody tr") || t.querySelector("tr"), l = r ? r.getBoundingClientRect().height : 32, f = e(this, _).querySelector("nine-table-header"), a = e(this, _).querySelector("nine-table-sheets-footer"), b = f ? f.getBoundingClientRect().height : 40, h = a ? a.getBoundingClientRect().height : 32, d = b + h + 16, S = o * l + d;
597
+ i.style.height = `${S}px`, i.style.maxHeight = `${n * l + d}px`;
598
+ const x = e(this, _).querySelector("nine-table-sheets-body");
599
+ x && (x.style.overflowY = s > n ? "auto" : "hidden");
601
600
  }, "#applyAutoHeight"));
602
- f(this, re, /* @__PURE__ */ c(() => {
603
- const s = e(this, _).host, i = Array.from(s.children).filter((h) => h.tagName === "TABLE"), n = s.getAttribute("auto-height") === "true", o = i.map((h, a) => `<nine-table-sheet class="${a === 0 ? "active" : ""}" data-index="${a}"></nine-table-sheet>`).join(""), r = i.map((h, a) => `<div class="nine-tab-item ${a === 0 ? "active" : ""}" data-index="${a}">Sheet ${a + 1}</div>`).join("");
601
+ u(this, oe, /* @__PURE__ */ c(() => {
602
+ const i = e(this, _).host, s = Array.from(i.children).filter((f) => f.tagName === "TABLE"), n = i.getAttribute("auto-height") === "true", o = s.map((f, a) => `<nine-table-sheet class="${a === 0 ? "active" : ""}" data-index="${a}"></nine-table-sheet>`).join(""), r = s.map((f, a) => `<div class="nine-tab-item ${a === 0 ? "active" : ""}" data-index="${a}">Sheet ${a + 1}</div>`).join("");
604
603
  e(this, _).innerHTML = `
605
604
  <style>
606
605
  :host {
@@ -700,171 +699,171 @@ const qe = class qe {
700
699
  <nine-table-footer></nine-table-footer>
701
700
  `;
702
701
  const l = e(this, _).querySelectorAll("nine-table-sheet");
703
- l == null || l.forEach((h, a) => {
704
- i[a] && setTimeout(() => {
705
- h.init(i[a]), n && e(this, G).call(this, s);
702
+ l == null || l.forEach((f, a) => {
703
+ s[a] && setTimeout(() => {
704
+ f.init(s[a]), n && e(this, J).call(this, i);
706
705
  });
707
706
  });
708
707
  }, "#render"));
709
- p(this, _, s), e(this, re).call(this), e(this, ne).call(this);
708
+ p(this, _, i), e(this, oe).call(this), e(this, re).call(this);
710
709
  }
711
710
  };
712
- _ = new WeakMap(), j = new WeakMap(), ne = new WeakMap(), G = new WeakMap(), re = new WeakMap(), c(qe, "LayoutManager");
713
- let ye = qe;
714
- var W, F;
715
- const Ce = class Ce {
716
- constructor(s) {
717
- f(this, W);
718
- f(this, F, -1);
719
- v(this, "count", /* @__PURE__ */ c(() => e(this, W).rawRecords.length, "count"));
720
- p(this, W, s);
711
+ _ = new WeakMap(), G = new WeakMap(), re = new WeakMap(), J = new WeakMap(), oe = new WeakMap(), c(Ce, "LayoutManager");
712
+ let we = Ce;
713
+ var z, Y;
714
+ const ke = class ke {
715
+ constructor(i) {
716
+ u(this, z);
717
+ u(this, Y, -1);
718
+ v(this, "count", /* @__PURE__ */ c(() => e(this, z).rawRecords.length, "count"));
719
+ p(this, z, i);
721
720
  }
722
721
  get at() {
723
- return e(this, F);
722
+ return e(this, Y);
724
723
  }
725
- set at(s) {
726
- var i, n;
727
- p(this, F, parseInt(s, 10));
728
- const t = ((n = (i = e(this, W).owner).querySelector) == null ? void 0 : n.call(i, ".ng-container-body")) || e(this, W).owner.body;
729
- t && !t.querySelector(`tbody.bindable tr[data-row="${e(this, F)}"]`) && setTimeout(() => {
724
+ set at(i) {
725
+ var s, n;
726
+ p(this, Y, parseInt(i, 10));
727
+ const t = ((n = (s = e(this, z).owner).querySelector) == null ? void 0 : n.call(s, ".ng-container-body")) || e(this, z).owner.body;
728
+ t && !t.querySelector(`tbody.bindable tr[data-row="${e(this, Y)}"]`) && setTimeout(() => {
730
729
  var o, r;
731
- (r = (o = e(this, W).owner).scrollTo_V1) == null || r.call(o, e(this, F));
730
+ (r = (o = e(this, z).owner).scrollTo_V1) == null || r.call(o, e(this, Y));
732
731
  });
733
732
  }
734
733
  };
735
- W = new WeakMap(), F = new WeakMap(), c(Ce, "ngRow");
736
- let we = Ce;
737
- var S, m, q, U, oe, z, le, J, ae, ce, Z;
734
+ z = new WeakMap(), Y = new WeakMap(), c(ke, "ngRow");
735
+ let me = ke;
736
+ var R, m, C, U, le, O, ae, Q, ce, he, K;
738
737
  const T = class T {
739
- constructor(s, t) {
740
- f(this, S);
741
- f(this, m);
742
- f(this, q, []);
743
- f(this, U, []);
744
- f(this, oe, 0);
745
- f(this, z, []);
746
- f(this, le, /* @__PURE__ */ c(() => {
747
- p(this, z, []);
748
- const s = e(this, S).template || [];
749
- Array.from(s).forEach((t) => {
750
- var i;
751
- e(this, z).push(((i = t.getBoundingClientRect) == null ? void 0 : i.call(t).height) || 24);
738
+ constructor(i, t) {
739
+ u(this, R);
740
+ u(this, m);
741
+ u(this, C, []);
742
+ u(this, U, []);
743
+ u(this, le, 0);
744
+ u(this, O, []);
745
+ u(this, ae, /* @__PURE__ */ c(() => {
746
+ p(this, O, []);
747
+ const i = e(this, R).template || [];
748
+ Array.from(i).forEach((t) => {
749
+ var s;
750
+ e(this, O).push(((s = t.getBoundingClientRect) == null ? void 0 : s.call(t).height) || 24);
752
751
  }), (e(this, m).rawRecords || []).forEach((t) => {
753
- t.__ng || (t.__ng = e(this, J).call(this)), t.__ng.height = e(this, z).slice();
752
+ t.__ng || (t.__ng = e(this, Q).call(this)), t.__ng.height = e(this, O).slice();
754
753
  });
755
754
  }, "#initialize"));
756
- v(this, "set", /* @__PURE__ */ c((s) => {
757
- this.clear(), this.add(s, !1);
755
+ v(this, "set", /* @__PURE__ */ c((i) => {
756
+ this.clear(), this.add(i, !1);
758
757
  }, "set"));
759
- f(this, J, /* @__PURE__ */ c(() => ({
758
+ u(this, Q, /* @__PURE__ */ c(() => ({
760
759
  rowState: T.ROW_STATE.EMPTY,
761
760
  deleted: !1,
762
761
  filtered: !1,
763
- height: e(this, z).slice(),
762
+ height: e(this, O).slice(),
764
763
  o: {},
765
764
  c: {},
766
- _: [0, 0, 0, 0, T.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, z).slice(), -1, {}, {}]
765
+ _: [0, 0, 0, 0, T.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, O).slice(), -1, {}, {}]
767
766
  }), "#getDefaultMeta"));
768
767
  v(this, "reset", /* @__PURE__ */ c(() => {
769
- p(this, q, []), p(this, U, []);
768
+ p(this, C, []), p(this, U, []);
770
769
  }, "reset"));
771
770
  v(this, "clear", /* @__PURE__ */ c(() => {
772
- var s;
773
- e(this, m).rawRecords = [], p(this, q, []), p(this, U, []), (s = e(this, m).viewRecords) != null && s.reset && e(this, m).viewRecords.reset();
771
+ var i;
772
+ e(this, m).rawRecords = [], p(this, C, []), p(this, U, []), (i = e(this, m).viewRecords) != null && i.reset && e(this, m).viewRecords.reset();
774
773
  }, "clear"));
775
- f(this, ae, /* @__PURE__ */ c((s) => {
774
+ u(this, ce, /* @__PURE__ */ c((i) => {
776
775
  var n;
777
- Array.isArray(s) || (s = [s]);
778
- const t = typeof ((n = e(this, S).fields) == null ? void 0 : n.get) == "function" ? e(this, S).fields.get() : Object.keys(s[0] || {}), i = [];
779
- return s.forEach((o) => {
776
+ Array.isArray(i) || (i = [i]);
777
+ const t = typeof ((n = e(this, R).fields) == null ? void 0 : n.get) == "function" ? e(this, R).fields.get() : Object.keys(i[0] || {}), s = [];
778
+ return i.forEach((o) => {
780
779
  const r = { v: [] };
781
780
  t.forEach((l) => {
782
781
  r.v.push(o[l] !== void 0 && o[l] !== null ? o[l] : "");
783
- }), i.push(r);
784
- }), i;
782
+ }), s.push(r);
783
+ }), s;
785
784
  }, "#json2Array"));
786
- f(this, ce, /* @__PURE__ */ c((s) => (Array.isArray(s) || (s = [s]), s.forEach((t) => {
787
- t.__ng = e(this, J).call(this), t.__ng.rowid = this.nextId, t.__ng.rowState = T.ROW_STATE.INSERT, t.__ng._[0] = t.__ng.rowid;
788
- }), s), "#defaultInsert"));
789
- v(this, "add", /* @__PURE__ */ c((s, t = !0) => {
785
+ u(this, he, /* @__PURE__ */ c((i) => (Array.isArray(i) || (i = [i]), i.forEach((t) => {
786
+ t.__ng = e(this, Q).call(this), t.__ng.rowid = this.nextId, t.__ng.rowState = T.ROW_STATE.INSERT, t.__ng._[0] = t.__ng.rowid;
787
+ }), i), "#defaultInsert"));
788
+ v(this, "add", /* @__PURE__ */ c((i, t = !0) => {
790
789
  var o;
791
- s === void 0 && (s = {});
792
- const i = e(this, ae).call(this, s);
793
- e(this, m).rawRecords = e(this, m).rawRecords.concat(e(this, ce).call(this, i)), this.resetRecords();
790
+ i === void 0 && (i = {});
791
+ const s = e(this, ce).call(this, i);
792
+ e(this, m).rawRecords = e(this, m).rawRecords.concat(e(this, he).call(this, s)), this.resetRecords();
794
793
  const n = this.count() - 1;
795
- return t || i.forEach((r, l) => {
796
- const h = e(this, m).rawRecords[n - l];
797
- h && (h.__ng.rowState = T.ROW_STATE.EMPTY);
794
+ return t || s.forEach((r, l) => {
795
+ const f = e(this, m).rawRecords[n - l];
796
+ f && (f.__ng.rowState = T.ROW_STATE.EMPTY);
798
797
  }), (o = e(this, m).viewRecords) != null && o.reset && e(this, m).viewRecords.reset(), n;
799
798
  }, "add"));
800
- v(this, "delete", /* @__PURE__ */ c((s) => {
801
- var i;
799
+ v(this, "delete", /* @__PURE__ */ c((i) => {
800
+ var s;
802
801
  let t = [];
803
- Array.isArray(s) ? t = s : typeof s > "u" ? t = [e(this, m).owner.row.at] : t = [parseInt(s, 10)], t.sort((n, o) => o - n).forEach((n) => {
804
- if (e(this, q)[n]) {
805
- const o = e(this, q)[n].__ng.rowid;
806
- e(this, q)[n].__ng.rowState === T.ROW_STATE.INSERT ? e(this, m).rawRecords = e(this, m).rawRecords.filter((r) => r.__ng.rowid !== o) : e(this, m).rawRecords.forEach((r) => {
802
+ Array.isArray(i) ? t = i : typeof i > "u" ? t = [e(this, m).owner.row.at] : t = [parseInt(i, 10)], t.sort((n, o) => o - n).forEach((n) => {
803
+ if (e(this, C)[n]) {
804
+ const o = e(this, C)[n].__ng.rowid;
805
+ e(this, C)[n].__ng.rowState === T.ROW_STATE.INSERT ? e(this, m).rawRecords = e(this, m).rawRecords.filter((r) => r.__ng.rowid !== o) : e(this, m).rawRecords.forEach((r) => {
807
806
  r.__ng.rowid === o && (r.__ng.deleted = !0, r.__ng.rowState = T.ROW_STATE.DELETE);
808
807
  });
809
808
  }
810
- }), this.resetRecords(), (i = e(this, m).viewRecords) != null && i.reset && e(this, m).viewRecords.reset();
809
+ }), this.resetRecords(), (s = e(this, m).viewRecords) != null && s.reset && e(this, m).viewRecords.reset();
811
810
  }, "delete"));
812
- v(this, "setValue", /* @__PURE__ */ c((s, t, i) => {
813
- var h;
814
- s = parseInt(s, 10);
815
- const o = (typeof ((h = e(this, S).fields) == null ? void 0 : h.get) == "function" ? e(this, S).fields.get() : []).indexOf(t);
811
+ v(this, "setValue", /* @__PURE__ */ c((i, t, s) => {
812
+ var f;
813
+ i = parseInt(i, 10);
814
+ const o = (typeof ((f = e(this, R).fields) == null ? void 0 : f.get) == "function" ? e(this, R).fields.get() : []).indexOf(t);
816
815
  if (o < 0) return;
817
- const r = this.getValidData()[s];
816
+ const r = this.getValidData()[i];
818
817
  if (!r) return;
819
818
  const l = r.v[o];
820
- l !== i && r.__ng.rowState !== T.ROW_STATE.INSERT && (r.__ng.o.hasOwnProperty(t) || (r.__ng.o[t] = l), r.__ng.rowState = T.ROW_STATE.UPDATE), r.v[o] = i, e(this, m).owner.refreshData && e(this, m).owner.refreshData(s);
819
+ l !== s && r.__ng.rowState !== T.ROW_STATE.INSERT && (r.__ng.o.hasOwnProperty(t) || (r.__ng.o[t] = l), r.__ng.rowState = T.ROW_STATE.UPDATE), r.v[o] = s, e(this, m).owner.refreshData && e(this, m).owner.refreshData(i);
821
820
  }, "setValue"));
822
821
  v(this, "resetRecords", /* @__PURE__ */ c(() => {
823
- p(this, U, e(this, m).rawRecords.filter((s) => !s.__ng.deleted)), p(this, q, e(this, m).rawRecords.filter((s) => !s.__ng.deleted && !s.__ng.filtered)), e(this, m).rawRecords.forEach((s, t) => {
824
- s.__ng.rowidx = t;
825
- }), e(this, q).forEach((s, t) => {
826
- s.__ng.i = t;
822
+ p(this, U, e(this, m).rawRecords.filter((i) => !i.__ng.deleted)), p(this, C, e(this, m).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), e(this, m).rawRecords.forEach((i, t) => {
823
+ i.__ng.rowidx = t;
824
+ }), e(this, C).forEach((i, t) => {
825
+ i.__ng.i = t;
827
826
  });
828
827
  }, "resetRecords"));
829
- v(this, "getValidData", /* @__PURE__ */ c(() => (e(this, q).length === 0 && e(this, m).rawRecords.length > 0 && this.resetRecords(), e(this, q)), "getValidData"));
830
- f(this, Z, /* @__PURE__ */ c((s) => {
831
- var i;
832
- if (!s) return s;
833
- const t = typeof ((i = e(this, S).fields) == null ? void 0 : i.get) == "function" ? e(this, S).fields.get() : [];
834
- return Array.isArray(s) ? s.filter((n) => !n.__ng.deleted).map((n) => {
828
+ v(this, "getValidData", /* @__PURE__ */ c(() => (e(this, C).length === 0 && e(this, m).rawRecords.length > 0 && this.resetRecords(), e(this, C)), "getValidData"));
829
+ u(this, K, /* @__PURE__ */ c((i) => {
830
+ var s;
831
+ if (!i) return i;
832
+ const t = typeof ((s = e(this, R).fields) == null ? void 0 : s.get) == "function" ? e(this, R).fields.get() : [];
833
+ return Array.isArray(i) ? i.filter((n) => !n.__ng.deleted).map((n) => {
835
834
  const o = {};
836
835
  return t.forEach((r, l) => {
837
836
  o[r] = n.v ? n.v[l] : n[r];
838
837
  }), o.__ng = n.__ng, o;
839
- }) : s;
838
+ }) : i;
840
839
  }, "#conv2"));
841
840
  v(this, "count", /* @__PURE__ */ c(() => this.getValidData().length, "count"));
842
- v(this, "get", /* @__PURE__ */ c((s, t) => {
841
+ v(this, "get", /* @__PURE__ */ c((i, t) => {
843
842
  var o;
844
- const i = this.getValidData();
845
- if (!i || i.length <= 0) return;
846
- if (s == null) return e(this, Z).call(this, i);
847
- if (s < 0 || s >= i.length) return null;
848
- const n = typeof ((o = e(this, S).fields) == null ? void 0 : o.get) == "function" ? e(this, S).fields.get() : [];
843
+ const s = this.getValidData();
844
+ if (!s || s.length <= 0) return;
845
+ if (i == null) return e(this, K).call(this, s);
846
+ if (i < 0 || i >= s.length) return null;
847
+ const n = typeof ((o = e(this, R).fields) == null ? void 0 : o.get) == "function" ? e(this, R).fields.get() : [];
849
848
  if (t != null) {
850
849
  const r = n.indexOf(t);
851
- return r >= 0 ? i[s].v[r] : null;
850
+ return r >= 0 ? s[i].v[r] : null;
852
851
  }
853
- return e(this, Z).call(this, i[s]);
852
+ return e(this, K).call(this, s[i]);
854
853
  }, "get"));
855
- p(this, S, s), p(this, m, t), e(this, le).call(this);
854
+ p(this, R, i), p(this, m, t), e(this, ae).call(this);
856
855
  }
857
856
  get source() {
858
- return e(this, Z).call(this, e(this, m).rawRecords);
857
+ return e(this, K).call(this, e(this, m).rawRecords);
859
858
  }
860
- set source(s) {
861
- this.clear(), this.add(s, !1);
859
+ set source(i) {
860
+ this.clear(), this.add(i, !1);
862
861
  }
863
862
  get nextId() {
864
- return ++Me(this, oe)._;
863
+ return ++He(this, le)._;
865
864
  }
866
865
  };
867
- S = new WeakMap(), m = new WeakMap(), q = new WeakMap(), U = new WeakMap(), oe = new WeakMap(), z = new WeakMap(), le = new WeakMap(), J = new WeakMap(), ae = new WeakMap(), ce = new WeakMap(), Z = new WeakMap(), c(T, "ngData"), // 🎯 ν–‰ μƒνƒœ μ •μ˜ μƒμˆ˜λ₯Ό 클래슀 λ‚΄λΆ€λ‘œ λ‚΄μž¬ν™”
866
+ R = new WeakMap(), m = new WeakMap(), C = new WeakMap(), U = new WeakMap(), le = new WeakMap(), O = new WeakMap(), ae = new WeakMap(), Q = new WeakMap(), ce = new WeakMap(), he = new WeakMap(), K = new WeakMap(), c(T, "ngData"), // 🎯 ν–‰ μƒνƒœ μ •μ˜ μƒμˆ˜λ₯Ό 클래슀 λ‚΄λΆ€λ‘œ λ‚΄μž¬ν™”
868
867
  v(T, "ROW_STATE", {
869
868
  EMPTY: "EMPTY",
870
869
  NORMAL: "NORMAL",
@@ -872,57 +871,57 @@ v(T, "ROW_STATE", {
872
871
  UPDATE: "UPDATE",
873
872
  DELETE: "DELETE"
874
873
  });
875
- let me = T;
874
+ let ve = T;
876
875
  const Ae = class Ae {
877
- constructor(s) {
878
- this.owner = s, this.row = new we(this), this.data = new me(s, this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
876
+ constructor(i) {
877
+ this.owner = i, this.row = new me(this), this.data = new ve(i, this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
879
878
  var t;
880
879
  (t = this.owner.view) != null && t.redraw && this.owner.view.redraw();
881
880
  }, this.setDataSource = (t) => {
882
881
  this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(t || []);
883
882
  }, this.getRowState = (t) => {
884
883
  var n, o;
885
- const i = parseInt(t, 10);
886
- if (!(i >= this.data.count()))
887
- return (o = (n = this.data.getValidData()[i]) == null ? void 0 : n.__ng) == null ? void 0 : o.rowState;
884
+ const s = parseInt(t, 10);
885
+ if (!(s >= this.data.count()))
886
+ return (o = (n = this.data.getValidData()[s]) == null ? void 0 : n.__ng) == null ? void 0 : o.rowState;
888
887
  }, this.getRowPosition = () => this.row.at, this.setRowPosition = (t) => {
889
888
  this.row.at = t;
890
- }, this.scrollTo_V1 = (t) => (t < 0 && (t = 0), t >= this.rawRecords.length && (t = this.rawRecords.length - 1), this.viewRecords.rawIndex = t, this.viewRecords.reset && this.viewRecords.reset(), !(t <= 0 || t >= this.rawRecords.length - 1)), this.getColumn = (t, i) => this.data.get(t, i), this.setColumn = (t, i, n) => {
891
- t = parseInt(t, 10), this.data.setValue(t, i, n);
889
+ }, this.scrollTo_V1 = (t) => (t < 0 && (t = 0), t >= this.rawRecords.length && (t = this.rawRecords.length - 1), this.viewRecords.rawIndex = t, this.viewRecords.reset && this.viewRecords.reset(), !(t <= 0 || t >= this.rawRecords.length - 1)), this.getColumn = (t, s) => this.data.get(t, s), this.setColumn = (t, s, n) => {
890
+ t = parseInt(t, 10), this.data.setValue(t, s, n);
892
891
  }, this.setDataSource([]);
893
892
  }
894
893
  };
895
894
  c(Ae, "ngDataManager");
896
- let ve = Ae;
897
- var V, he;
898
- const ke = class ke extends HTMLElement {
895
+ let xe = Ae;
896
+ var F, de;
897
+ const Le = class Le extends HTMLElement {
899
898
  constructor() {
900
899
  super();
901
900
  //#created = false;
902
- f(this, V);
903
- f(this, he);
904
- this.attachShadow({ mode: "open" }), p(this, V, new ve(this));
901
+ u(this, F);
902
+ u(this, de);
903
+ this.attachShadow({ mode: "open" }), p(this, F, new xe(this));
905
904
  }
906
905
  connectedCallback() {
907
- p(this, he, new ye(this.shadowRoot)), X.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
906
+ p(this, de, new we(this.shadowRoot)), Z.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
908
907
  }
909
908
  disconnectedCallback() {
910
- X.log("NineTable disconnected.");
909
+ Z.log("NineTable disconnected.");
911
910
  }
912
911
  // 🎯 μ™ΈλΆ€μ—μ„œ grid.data.set(...) ν˜•νƒœλ‘œ μ ‘κ·Όν•  수 μžˆλ„λ‘ 데이터 λ§€λ‹ˆμ € μ˜€ν”ˆ
913
912
  get data() {
914
- return e(this, V).data;
913
+ return e(this, F).data;
915
914
  }
916
915
  // 🎯 ν–‰(row) κ΄€λ ¨ μ œμ–΄ μ ‘κ·Όμž μ˜€ν”ˆ
917
916
  get row() {
918
- return e(this, V).row;
917
+ return e(this, F).row;
919
918
  }
920
919
  // 🎯 전체 데이터 λ§€λ‹ˆμ € μ ‘κ·Ό ν•„μš”ν•  경우
921
920
  get dataManager() {
922
- return e(this, V);
921
+ return e(this, F);
923
922
  }
924
923
  };
925
- V = new WeakMap(), he = new WeakMap(), c(ke, "NineTable");
926
- let xe = ke;
927
- customElements.get("nine-table") || customElements.define("nine-table", xe);
924
+ F = new WeakMap(), de = new WeakMap(), c(Le, "NineTable");
925
+ let Se = Le;
926
+ customElements.get("nine-table") || customElements.define("nine-table", Se);
928
927
  //# sourceMappingURL=nine-table.js.map