@ninebone/table 0.0.129 β†’ 0.0.130

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 j = 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,208 @@ 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), j.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);
283
288
  for (let l = 0; l < r; l++)
284
- e(this, M).forEach((h) => {
285
- o.appendChild(h.cloneNode(!0));
289
+ e(this, I).forEach((f) => {
290
+ o.appendChild(f.cloneNode(!0));
286
291
  });
287
- n ? n.before(o) : i.appendChild(o), console.log(`[RowManager] Successfully rendered. Total DOM tr count: ${i.querySelectorAll("tr:not(.nodata)").length}`);
292
+ n ? n.before(o) : s.appendChild(o), console.log(`[RowManager] Rendered ${r} sets into DOM.`);
288
293
  }, "renderRows"));
289
- /**
290
- * 🎯 μ»΄ν¬λ„ŒνŠΈ μ†Œλ©Έ μ‹œ Observer ν•΄μ œ
291
- */
292
294
  v(this, "destroy", /* @__PURE__ */ c(() => {
293
- e(this, I) && (e(this, I).disconnect(), p(this, I, null));
295
+ e(this, $) && (e(this, $).disconnect(), p(this, $, null));
294
296
  }, "destroy"));
295
- p(this, $, s), e(this, te).call(this);
297
+ p(this, V, i), e(this, ie).call(this);
296
298
  }
297
299
  get templateLength() {
298
- return e(this, M).length || 1;
300
+ return e(this, I).length || 1;
299
301
  }
300
302
  };
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 {
303
+ V = new WeakMap(), I = new WeakMap(), q = new WeakMap(), $ = new WeakMap(), H = new WeakMap(), A = new WeakMap(), ie = new WeakMap(), c(Te, "RowManager");
304
+ let ge = Te;
305
+ var L, W, se;
306
+ const Z = class Z extends HTMLElement {
305
307
  constructor() {
306
308
  super();
307
- f(this, k, null);
308
- f(this, L);
309
+ u(this, L, null);
310
+ u(this, W);
309
311
  v(this, "init", /* @__PURE__ */ c((t) => {
310
312
  if (!t) return;
311
- const i = /* @__PURE__ */ c((a) => {
312
- const u = /* @__PURE__ */ c((g) => {
313
+ const s = /* @__PURE__ */ c((a) => {
314
+ const b = /* @__PURE__ */ c((g) => {
313
315
  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);
316
+ 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);
317
+ for (let E = 0; E < S; E++) {
318
+ const fe = document.createElement("col");
319
+ fe.setAttribute("width", k), x.appendChild(fe);
318
320
  }
319
- g.prepend(R);
320
- }, "ensureColgroup"), d = /* @__PURE__ */ c((g) => {
321
+ g.prepend(x);
322
+ }, "ensureColgroup"), h = /* @__PURE__ */ c((g) => {
321
323
  if (g.querySelector("thead")) return;
322
- const b = document.createElement("thead"), x = g.querySelector("colgroup");
323
- x ? x.after(b) : g.prepend(b);
324
+ const d = document.createElement("thead"), S = g.querySelector("colgroup");
325
+ S ? S.after(d) : g.prepend(d);
324
326
  }, "ensureThead");
325
- return u(a), d(a), a.classList.add("nine-table-element"), a;
327
+ return b(a), h(a), a.classList.add("nine-table-element"), a;
326
328
  }, "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();
329
+ p(this, L, s(n)), e(this, L).style.display = "table", e(this, W).initTemplate(e(this, L));
330
+ 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) => {
331
+ const g = a.cloneNode(!0), d = Array.from(g.querySelectorAll("colgroup col")), S = [];
332
+ return d.forEach((x, k) => {
333
+ const E = x.getAttribute("fixed");
334
+ (h ? !E || E === "" : E === b) || S.push(k);
335
+ }), S.reverse().forEach((x) => {
336
+ d[x] && d[x].remove(), g.querySelectorAll("tr").forEach((k) => {
337
+ const E = k.querySelectorAll("th, td");
338
+ E[x] && E[x].remove();
337
339
  });
338
340
  }), g;
339
341
  }, "filterTableByFixed");
340
342
  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);
343
+ const a = f(e(this, L), null, !0);
344
+ r.innerHTML = "", r.appendChild(a), e(this, W).measureAndCacheHeight(r);
343
345
  }
344
346
  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`;
347
+ const a = f(e(this, L), "left", !1);
348
+ let b = 0;
349
+ a.querySelectorAll("col").forEach((g) => {
350
+ const d = parseInt(g.getAttribute("width"), 10);
351
+ isNaN(d) || (b += d);
352
+ }), o.innerHTML = "", o.appendChild(a), e(this, W).calculateRequiredRowCount(o);
353
+ const h = b > 0 ? b : 0;
354
+ o.style.flex = `0 0 ${h}px`, o.style.width = `${h}px`;
355
355
  }
356
356
  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`;
357
+ const a = f(e(this, L), "right", !1);
358
+ let b = 0;
359
+ a.querySelectorAll("col").forEach((g) => {
360
+ const d = parseInt(g.getAttribute("width"), 10);
361
+ isNaN(d) || (b += d);
362
+ }), l.innerHTML = "", l.appendChild(a), e(this, W).calculateRequiredRowCount(l);
363
+ const h = b > 0 ? b : 0;
364
+ l.style.flex = `0 0 ${h}px`, l.style.width = `${h}px`;
367
365
  }
368
366
  if (r) {
369
367
  const a = this.getRowCount();
370
368
  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();
369
+ const b = this.querySelector("nine-table-hscrollbar");
370
+ b && typeof b.refresh == "function" && b.refresh();
373
371
  });
374
372
  }
375
373
  setTimeout(() => {
376
374
  const a = this.querySelector("nine-table-hscrollbar");
377
375
  a && typeof a.refresh == "function" && a.refresh();
378
- }, 0), X.log(`NineTableSheet 3-split initialized with rows: ${this.getRowCount()}`);
376
+ }, 0), j.log(`NineTableSheet 3-split initialized with rows: ${this.getRowCount()}`);
379
377
  }, "init"));
380
- v(this, "getRowCount", /* @__PURE__ */ c(() => e(this, k) ? e(this, k).querySelectorAll("tbody tr").length : 0, "getRowCount"));
378
+ v(this, "getRowCount", /* @__PURE__ */ c(() => e(this, L) ? e(this, L).querySelectorAll("tbody tr").length : 0, "getRowCount"));
381
379
  v(this, "scrollToX", /* @__PURE__ */ c((t) => {
382
- const i = this.querySelector(".ng-container-body");
383
- i && (i.scrollLeft = t);
380
+ const s = this.querySelector(".ng-container-body");
381
+ s && (s.scrollLeft = t);
384
382
  }, "scrollToX"));
385
383
  v(this, "scrollToY", /* @__PURE__ */ c((t) => {
386
- const i = this.querySelector(".ng-container-body");
387
- i && (i.scrollTop = t);
384
+ const s = this.querySelector(".ng-container-body");
385
+ s && (s.scrollTop = t);
388
386
  }, "scrollToY"));
389
- f(this, se, /* @__PURE__ */ c(() => {
390
- const t = K.SCROLLBAR_SIZE;
387
+ u(this, se, /* @__PURE__ */ c(() => {
388
+ const t = Z.SCROLLBAR_SIZE;
391
389
  this.innerHTML = `
392
390
  <style>
393
391
  nine-table-sheet {
@@ -503,104 +501,104 @@ const K = class K extends HTMLElement {
503
501
  </div>
504
502
  `;
505
503
  }, "#render"));
506
- p(this, L, new ge(this));
504
+ p(this, W, new ge(this));
507
505
  }
508
506
  connectedCallback() {
509
507
  e(this, se).call(this);
510
508
  }
511
509
  disconnectedCallback() {
512
- this.innerHTML = "", X.log("NineTableSheet destroyed.");
510
+ this.innerHTML = "", j.log("NineTableSheet destroyed.");
513
511
  }
514
512
  };
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 {
513
+ L = new WeakMap(), W = new WeakMap(), se = new WeakMap(), c(Z, "NineTableSheet"), v(Z, "SCROLLBAR_SIZE", 16);
514
+ let pe = Z;
515
+ customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", pe);
516
+ var ne;
517
+ const qe = class qe extends HTMLElement {
520
518
  constructor() {
521
519
  super();
522
- f(this, ie, /* @__PURE__ */ c(() => {
520
+ u(this, ne, /* @__PURE__ */ c(() => {
523
521
  const t = this.querySelector(".nine-tab-bar");
524
- t && (t.addEventListener("click", (i) => {
525
- const n = i.target.closest(".nine-tab-item");
522
+ t && (t.addEventListener("click", (s) => {
523
+ const n = s.target.closest(".nine-tab-item");
526
524
  if (!n) return;
527
- const o = i.ctrlKey || i.metaKey || i.shiftKey, r = parseInt(n.dataset.index, 10);
525
+ const o = s.ctrlKey || s.metaKey || s.shiftKey, r = parseInt(n.dataset.index, 10);
528
526
  this.switchSheet(r, o);
529
527
  }), this.switchSheet(0, !1));
530
528
  }, "#init"));
531
- v(this, "switchSheet", /* @__PURE__ */ c((t, i = !1) => {
529
+ v(this, "switchSheet", /* @__PURE__ */ c((t, s = !1) => {
532
530
  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");
531
+ const h = this.querySelector("nine-table-sheets-body");
532
+ h.querySelectorAll("nine-splitter").forEach((d) => {
533
+ 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}"]`);
534
+ x && k && x.classList.contains("active") && k.classList.contains("active") ? d.classList.add("active") : d.classList.remove("active");
537
535
  });
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");
536
+ }, "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
537
  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);
538
+ if (!s)
539
+ l.forEach((h, g) => {
540
+ h.classList.toggle("active", g === t);
541
+ const d = r.querySelector(`nine-table-sheet[data-index="${g}"]`);
542
+ d && (d.style.flex = "");
543
+ }), f.forEach((h, g) => {
544
+ h.classList.toggle("active", g === t);
547
545
  });
548
546
  else {
549
- const d = l[t], g = o.querySelectorAll(".nine-tab-item.active");
550
- if (d.classList.contains("active") && g.length <= 1)
547
+ const h = l[t], g = o.querySelectorAll(".nine-tab-item.active");
548
+ if (h.classList.contains("active") && g.length <= 1)
551
549
  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 = ""));
550
+ h.classList.toggle("active");
551
+ const d = r.querySelector(`nine-table-sheet[data-index="${t}"]`);
552
+ d && (d.classList.toggle("active"), d.classList.contains("active") || (d.style.flex = ""));
555
553
  }
556
554
  const a = Array.from(r.querySelectorAll("nine-table-sheet.active"));
557
555
  if (a.length > 1) {
558
- const d = 1 / a.length;
556
+ const h = 1 / a.length;
559
557
  a.forEach((g) => {
560
- (!g.style.flex || g.style.flex === "1 1 100%") && (g.style.flex = `${d} ${d} 0px`);
558
+ (!g.style.flex || g.style.flex === "1 1 100%") && (g.style.flex = `${h} ${h} 0px`);
561
559
  });
562
560
  } else
563
- a.forEach((d) => {
564
- d.style.flex = "1 1 100%";
561
+ a.forEach((h) => {
562
+ h.style.flex = "1 1 100%";
565
563
  });
566
564
  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());
565
+ const b = r.querySelector("nine-table-sheet.active");
566
+ if (b && typeof b.getRowCount == "function") {
567
+ const h = this.querySelector("#row-count");
568
+ h && (h.textContent = b.getRowCount().toLocaleString());
571
569
  }
572
570
  }, "switchSheet"));
573
571
  }
574
572
  connectedCallback() {
575
- e(this, ie).call(this);
573
+ e(this, ne).call(this);
576
574
  }
577
575
  };
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));
576
+ ne = new WeakMap(), c(qe, "NineTableSheets");
577
+ let ye = qe;
578
+ customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", ye);
579
+ var _, G, re, J, oe;
580
+ const Ce = class Ce {
581
+ constructor(i) {
582
+ u(this, _);
583
+ u(this, G, null);
584
+ u(this, re, /* @__PURE__ */ c(() => {
585
+ const i = e(this, _).host;
586
+ i && (p(this, G, new ResizeObserver((t) => {
587
+ for (let s of t)
588
+ i.getAttribute("auto-height") === "true" && e(this, J).call(this, i);
589
+ })), e(this, G).observe(i));
592
590
  }, "#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");
591
+ u(this, J, /* @__PURE__ */ c((i) => {
592
+ var k, E;
593
+ const t = (k = i.shadowRoot) == null ? void 0 : k.querySelector("nine-table-sheet.active");
596
594
  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");
595
+ 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;
596
+ i.style.height = `${S}px`, i.style.maxHeight = `${n * l + d}px`;
597
+ const x = e(this, _).querySelector("nine-table-sheets-body");
598
+ x && (x.style.overflowY = s > n ? "auto" : "hidden");
601
599
  }, "#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("");
600
+ u(this, oe, /* @__PURE__ */ c(() => {
601
+ 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
602
  e(this, _).innerHTML = `
605
603
  <style>
606
604
  :host {
@@ -700,171 +698,171 @@ const qe = class qe {
700
698
  <nine-table-footer></nine-table-footer>
701
699
  `;
702
700
  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);
701
+ l == null || l.forEach((f, a) => {
702
+ s[a] && setTimeout(() => {
703
+ f.init(s[a]), n && e(this, J).call(this, i);
706
704
  });
707
705
  });
708
706
  }, "#render"));
709
- p(this, _, s), e(this, re).call(this), e(this, ne).call(this);
707
+ p(this, _, i), e(this, oe).call(this), e(this, re).call(this);
710
708
  }
711
709
  };
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);
710
+ _ = new WeakMap(), G = new WeakMap(), re = new WeakMap(), J = new WeakMap(), oe = new WeakMap(), c(Ce, "LayoutManager");
711
+ let we = Ce;
712
+ var z, Y;
713
+ const ke = class ke {
714
+ constructor(i) {
715
+ u(this, z);
716
+ u(this, Y, -1);
717
+ v(this, "count", /* @__PURE__ */ c(() => e(this, z).rawRecords.length, "count"));
718
+ p(this, z, i);
721
719
  }
722
720
  get at() {
723
- return e(this, F);
721
+ return e(this, Y);
724
722
  }
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(() => {
723
+ set at(i) {
724
+ var s, n;
725
+ p(this, Y, parseInt(i, 10));
726
+ const t = ((n = (s = e(this, z).owner).querySelector) == null ? void 0 : n.call(s, ".ng-container-body")) || e(this, z).owner.body;
727
+ t && !t.querySelector(`tbody.bindable tr[data-row="${e(this, Y)}"]`) && setTimeout(() => {
730
728
  var o, r;
731
- (r = (o = e(this, W).owner).scrollTo_V1) == null || r.call(o, e(this, F));
729
+ (r = (o = e(this, z).owner).scrollTo_V1) == null || r.call(o, e(this, Y));
732
730
  });
733
731
  }
734
732
  };
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;
733
+ z = new WeakMap(), Y = new WeakMap(), c(ke, "ngRow");
734
+ let me = ke;
735
+ var R, m, C, U, le, O, ae, Q, ce, he, K;
738
736
  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);
737
+ constructor(i, t) {
738
+ u(this, R);
739
+ u(this, m);
740
+ u(this, C, []);
741
+ u(this, U, []);
742
+ u(this, le, 0);
743
+ u(this, O, []);
744
+ u(this, ae, /* @__PURE__ */ c(() => {
745
+ p(this, O, []);
746
+ const i = e(this, R).template || [];
747
+ Array.from(i).forEach((t) => {
748
+ var s;
749
+ e(this, O).push(((s = t.getBoundingClientRect) == null ? void 0 : s.call(t).height) || 24);
752
750
  }), (e(this, m).rawRecords || []).forEach((t) => {
753
- t.__ng || (t.__ng = e(this, J).call(this)), t.__ng.height = e(this, z).slice();
751
+ t.__ng || (t.__ng = e(this, Q).call(this)), t.__ng.height = e(this, O).slice();
754
752
  });
755
753
  }, "#initialize"));
756
- v(this, "set", /* @__PURE__ */ c((s) => {
757
- this.clear(), this.add(s, !1);
754
+ v(this, "set", /* @__PURE__ */ c((i) => {
755
+ this.clear(), this.add(i, !1);
758
756
  }, "set"));
759
- f(this, J, /* @__PURE__ */ c(() => ({
757
+ u(this, Q, /* @__PURE__ */ c(() => ({
760
758
  rowState: T.ROW_STATE.EMPTY,
761
759
  deleted: !1,
762
760
  filtered: !1,
763
- height: e(this, z).slice(),
761
+ height: e(this, O).slice(),
764
762
  o: {},
765
763
  c: {},
766
- _: [0, 0, 0, 0, T.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, z).slice(), -1, {}, {}]
764
+ _: [0, 0, 0, 0, T.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, O).slice(), -1, {}, {}]
767
765
  }), "#getDefaultMeta"));
768
766
  v(this, "reset", /* @__PURE__ */ c(() => {
769
- p(this, q, []), p(this, U, []);
767
+ p(this, C, []), p(this, U, []);
770
768
  }, "reset"));
771
769
  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();
770
+ var i;
771
+ e(this, m).rawRecords = [], p(this, C, []), p(this, U, []), (i = e(this, m).viewRecords) != null && i.reset && e(this, m).viewRecords.reset();
774
772
  }, "clear"));
775
- f(this, ae, /* @__PURE__ */ c((s) => {
773
+ u(this, ce, /* @__PURE__ */ c((i) => {
776
774
  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) => {
775
+ Array.isArray(i) || (i = [i]);
776
+ const t = typeof ((n = e(this, R).fields) == null ? void 0 : n.get) == "function" ? e(this, R).fields.get() : Object.keys(i[0] || {}), s = [];
777
+ return i.forEach((o) => {
780
778
  const r = { v: [] };
781
779
  t.forEach((l) => {
782
780
  r.v.push(o[l] !== void 0 && o[l] !== null ? o[l] : "");
783
- }), i.push(r);
784
- }), i;
781
+ }), s.push(r);
782
+ }), s;
785
783
  }, "#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) => {
784
+ u(this, he, /* @__PURE__ */ c((i) => (Array.isArray(i) || (i = [i]), i.forEach((t) => {
785
+ 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;
786
+ }), i), "#defaultInsert"));
787
+ v(this, "add", /* @__PURE__ */ c((i, t = !0) => {
790
788
  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();
789
+ i === void 0 && (i = {});
790
+ const s = e(this, ce).call(this, i);
791
+ e(this, m).rawRecords = e(this, m).rawRecords.concat(e(this, he).call(this, s)), this.resetRecords();
794
792
  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);
793
+ return t || s.forEach((r, l) => {
794
+ const f = e(this, m).rawRecords[n - l];
795
+ f && (f.__ng.rowState = T.ROW_STATE.EMPTY);
798
796
  }), (o = e(this, m).viewRecords) != null && o.reset && e(this, m).viewRecords.reset(), n;
799
797
  }, "add"));
800
- v(this, "delete", /* @__PURE__ */ c((s) => {
801
- var i;
798
+ v(this, "delete", /* @__PURE__ */ c((i) => {
799
+ var s;
802
800
  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) => {
801
+ 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) => {
802
+ if (e(this, C)[n]) {
803
+ const o = e(this, C)[n].__ng.rowid;
804
+ 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
805
  r.__ng.rowid === o && (r.__ng.deleted = !0, r.__ng.rowState = T.ROW_STATE.DELETE);
808
806
  });
809
807
  }
810
- }), this.resetRecords(), (i = e(this, m).viewRecords) != null && i.reset && e(this, m).viewRecords.reset();
808
+ }), this.resetRecords(), (s = e(this, m).viewRecords) != null && s.reset && e(this, m).viewRecords.reset();
811
809
  }, "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);
810
+ v(this, "setValue", /* @__PURE__ */ c((i, t, s) => {
811
+ var f;
812
+ i = parseInt(i, 10);
813
+ const o = (typeof ((f = e(this, R).fields) == null ? void 0 : f.get) == "function" ? e(this, R).fields.get() : []).indexOf(t);
816
814
  if (o < 0) return;
817
- const r = this.getValidData()[s];
815
+ const r = this.getValidData()[i];
818
816
  if (!r) return;
819
817
  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);
818
+ 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
819
  }, "setValue"));
822
820
  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;
821
+ 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) => {
822
+ i.__ng.rowidx = t;
823
+ }), e(this, C).forEach((i, t) => {
824
+ i.__ng.i = t;
827
825
  });
828
826
  }, "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) => {
827
+ v(this, "getValidData", /* @__PURE__ */ c(() => (e(this, C).length === 0 && e(this, m).rawRecords.length > 0 && this.resetRecords(), e(this, C)), "getValidData"));
828
+ u(this, K, /* @__PURE__ */ c((i) => {
829
+ var s;
830
+ if (!i) return i;
831
+ const t = typeof ((s = e(this, R).fields) == null ? void 0 : s.get) == "function" ? e(this, R).fields.get() : [];
832
+ return Array.isArray(i) ? i.filter((n) => !n.__ng.deleted).map((n) => {
835
833
  const o = {};
836
834
  return t.forEach((r, l) => {
837
835
  o[r] = n.v ? n.v[l] : n[r];
838
836
  }), o.__ng = n.__ng, o;
839
- }) : s;
837
+ }) : i;
840
838
  }, "#conv2"));
841
839
  v(this, "count", /* @__PURE__ */ c(() => this.getValidData().length, "count"));
842
- v(this, "get", /* @__PURE__ */ c((s, t) => {
840
+ v(this, "get", /* @__PURE__ */ c((i, t) => {
843
841
  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() : [];
842
+ const s = this.getValidData();
843
+ if (!s || s.length <= 0) return;
844
+ if (i == null) return e(this, K).call(this, s);
845
+ if (i < 0 || i >= s.length) return null;
846
+ const n = typeof ((o = e(this, R).fields) == null ? void 0 : o.get) == "function" ? e(this, R).fields.get() : [];
849
847
  if (t != null) {
850
848
  const r = n.indexOf(t);
851
- return r >= 0 ? i[s].v[r] : null;
849
+ return r >= 0 ? s[i].v[r] : null;
852
850
  }
853
- return e(this, Z).call(this, i[s]);
851
+ return e(this, K).call(this, s[i]);
854
852
  }, "get"));
855
- p(this, S, s), p(this, m, t), e(this, le).call(this);
853
+ p(this, R, i), p(this, m, t), e(this, ae).call(this);
856
854
  }
857
855
  get source() {
858
- return e(this, Z).call(this, e(this, m).rawRecords);
856
+ return e(this, K).call(this, e(this, m).rawRecords);
859
857
  }
860
- set source(s) {
861
- this.clear(), this.add(s, !1);
858
+ set source(i) {
859
+ this.clear(), this.add(i, !1);
862
860
  }
863
861
  get nextId() {
864
- return ++Me(this, oe)._;
862
+ return ++He(this, le)._;
865
863
  }
866
864
  };
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"), // 🎯 ν–‰ μƒνƒœ μ •μ˜ μƒμˆ˜λ₯Ό 클래슀 λ‚΄λΆ€λ‘œ λ‚΄μž¬ν™”
865
+ 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
866
  v(T, "ROW_STATE", {
869
867
  EMPTY: "EMPTY",
870
868
  NORMAL: "NORMAL",
@@ -872,57 +870,57 @@ v(T, "ROW_STATE", {
872
870
  UPDATE: "UPDATE",
873
871
  DELETE: "DELETE"
874
872
  });
875
- let me = T;
873
+ let ve = T;
876
874
  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 = () => {
875
+ constructor(i) {
876
+ 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
877
  var t;
880
878
  (t = this.owner.view) != null && t.redraw && this.owner.view.redraw();
881
879
  }, this.setDataSource = (t) => {
882
880
  this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(t || []);
883
881
  }, this.getRowState = (t) => {
884
882
  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;
883
+ const s = parseInt(t, 10);
884
+ if (!(s >= this.data.count()))
885
+ return (o = (n = this.data.getValidData()[s]) == null ? void 0 : n.__ng) == null ? void 0 : o.rowState;
888
886
  }, this.getRowPosition = () => this.row.at, this.setRowPosition = (t) => {
889
887
  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);
888
+ }, 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) => {
889
+ t = parseInt(t, 10), this.data.setValue(t, s, n);
892
890
  }, this.setDataSource([]);
893
891
  }
894
892
  };
895
893
  c(Ae, "ngDataManager");
896
- let ve = Ae;
897
- var V, he;
898
- const ke = class ke extends HTMLElement {
894
+ let xe = Ae;
895
+ var F, de;
896
+ const Le = class Le extends HTMLElement {
899
897
  constructor() {
900
898
  super();
901
899
  //#created = false;
902
- f(this, V);
903
- f(this, he);
904
- this.attachShadow({ mode: "open" }), p(this, V, new ve(this));
900
+ u(this, F);
901
+ u(this, de);
902
+ this.attachShadow({ mode: "open" }), p(this, F, new xe(this));
905
903
  }
906
904
  connectedCallback() {
907
- p(this, he, new ye(this.shadowRoot)), X.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
905
+ p(this, de, new we(this.shadowRoot)), j.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
908
906
  }
909
907
  disconnectedCallback() {
910
- X.log("NineTable disconnected.");
908
+ j.log("NineTable disconnected.");
911
909
  }
912
910
  // 🎯 μ™ΈλΆ€μ—μ„œ grid.data.set(...) ν˜•νƒœλ‘œ μ ‘κ·Όν•  수 μžˆλ„λ‘ 데이터 λ§€λ‹ˆμ € μ˜€ν”ˆ
913
911
  get data() {
914
- return e(this, V).data;
912
+ return e(this, F).data;
915
913
  }
916
914
  // 🎯 ν–‰(row) κ΄€λ ¨ μ œμ–΄ μ ‘κ·Όμž μ˜€ν”ˆ
917
915
  get row() {
918
- return e(this, V).row;
916
+ return e(this, F).row;
919
917
  }
920
918
  // 🎯 전체 데이터 λ§€λ‹ˆμ € μ ‘κ·Ό ν•„μš”ν•  경우
921
919
  get dataManager() {
922
- return e(this, V);
920
+ return e(this, F);
923
921
  }
924
922
  };
925
- V = new WeakMap(), he = new WeakMap(), c(ke, "NineTable");
926
- let xe = ke;
927
- customElements.get("nine-table") || customElements.define("nine-table", xe);
923
+ F = new WeakMap(), de = new WeakMap(), c(Le, "NineTable");
924
+ let Se = Le;
925
+ customElements.get("nine-table") || customElements.define("nine-table", Se);
928
926
  //# sourceMappingURL=nine-table.js.map