@ninebone/table 0.0.177 β†’ 0.0.179

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