@ninebone/table 0.0.127 β†’ 0.0.129

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