@ninebone/table 0.0.209 β†’ 0.0.211

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