@ninebone/table 0.0.178 β†’ 0.0.180

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,10 +3,10 @@ var Ie = (w) => {
3
3
  throw TypeError(w);
4
4
  };
5
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) => ({
6
+ var l = (w, i) => Me(w, "name", { value: i, configurable: !0 });
7
+ var v = (w, i, t) => ze(w, typeof i != "symbol" ? i + "" : i, t), He = (w, i, t) => i.has(w) || Ie("Cannot " + t);
8
+ var e = (w, i, t) => (He(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) => (He(w, i, "write to private field"), s ? s.call(w, t) : i.set(w, t), t);
9
+ var $e = (w, i, t, s) => ({
10
10
  set _(n) {
11
11
  p(w, i, n, t);
12
12
  },
@@ -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
- const G = new be();
26
- var _, O, y, B, N, D, te, P, ie;
25
+ const F = new be();
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), F.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,113 +292,113 @@ 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
- var L, U, re;
318
- const j = class j extends HTMLElement {
318
+ var L, K, re;
319
+ const G = class G 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, K);
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++) {
330
- const F = document.createElement("col");
331
- F.setAttribute("width", C), x.appendChild(F);
329
+ const f = g.querySelector("tbody tr") || g.querySelector("tr"), S = f ? f.querySelectorAll("th, td").length : 1, x = document.createElement("colgroup"), A = Math.max(Math.floor((g.clientWidth || 600) / S), 100);
330
+ for (let T = 0; T < S; T++) {
331
+ const U = document.createElement("col");
332
+ U.setAttribute("width", A), x.appendChild(U);
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
- 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);
342
+ p(this, L, s(n)), e(this, L).style.display = "table", e(this, K).initTemplate(e(this, L));
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, A) => {
346
+ const T = x.getAttribute("fixed");
347
+ (c ? T !== "left" && T !== "right" : T === d) || S.push(A);
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((A) => {
350
+ const T = A.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, K).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();
388
- }, 0), G.log(`NineTableSheet 3-split initialized with rows: ${this.getRowCount()}`);
387
+ const a = this.querySelector("nine-table-hscrollbar");
388
+ a && typeof a.refresh == "function" && a.refresh();
389
+ }, 0), F.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
- const t = j.SCROLLBAR_SIZE;
400
+ u(this, re, /* @__PURE__ */ l(() => {
401
+ const t = G.SCROLLBAR_SIZE;
401
402
  this.innerHTML = `
402
403
  <style>
403
404
  nine-table-sheet {
@@ -513,68 +514,68 @@ const j = class j extends HTMLElement {
513
514
  </div>
514
515
  `;
515
516
  }, "#render"));
516
- p(this, U, new pe(this));
517
+ p(this, K, new pe(this));
517
518
  }
518
519
  connectedCallback() {
519
520
  e(this, re).call(this);
520
521
  }
521
522
  disconnectedCallback() {
522
- this.innerHTML = "", G.log("NineTableSheet destroyed.");
523
+ this.innerHTML = "", F.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
- let ye = j;
526
+ L = new WeakMap(), K = new WeakMap(), re = new WeakMap(), l(G, "NineTableSheet"), v(G, "SCROLLBAR_SIZE", 16);
527
+ let ye = G;
527
528
  customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", ye);
528
529
  var oe;
529
- const ke = class ke extends HTMLElement {
530
+ const Ce = class Ce 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"));
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 A = parseInt(x.getAttribute("data-index"), 10), T = c.querySelector(`nine-splitter[data-split-index="${A}"]`), U = g[A + 1];
549
+ T && U && U.classList.contains("active") && T.style.setProperty("display", "block");
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,36 +583,38 @@ 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;
586
+ oe = new WeakMap(), l(Ce, "NineTableSheets");
587
+ let we = Ce;
587
588
  customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", we);
588
- var k, J, le, Q, ae;
589
- const Ae = class Ae {
589
+ var C, J, le, Q, ae;
590
+ const ke = class ke {
590
591
  constructor(i) {
591
- f(this, k);
592
- f(this, J, null);
593
- f(this, le, /* @__PURE__ */ a(() => {
594
- const i = e(this, k).host;
592
+ u(this, C);
593
+ u(this, J, null);
594
+ u(this, le, /* @__PURE__ */ l(() => {
595
+ const i = e(this, C).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
- var C;
602
- const t = e(this, k).querySelector("nine-table-sheet.active");
601
+ u(this, Q, /* @__PURE__ */ l((i) => {
602
+ var A;
603
+ const t = e(this, C).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`;
606
- const x = e(this, k).querySelector("nine-table-sheets-body");
605
+ const s = ((A = t.getRowCount) == null ? void 0 : A.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, C).querySelector("nine-table-header"), a = e(this, C).querySelector("nine-table-sheets-footer"), d = b ? b.getBoundingClientRect().height : 40, c = a ? a.getBoundingClientRect().height : 32, g = 16;
606
+ F.log(b, a), F.log(b.getBoundingClientRect().height, a.getBoundingClientRect().height);
607
+ const f = d + c + g, S = r * h + f;
608
+ i.style.height = `${S}px`, i.style.maxHeight = `${n * h + f}px`;
609
+ const x = e(this, C).querySelector("nine-table-sheets-body");
607
610
  x && (x.style.overflowY = s > n ? "auto" : "hidden");
608
611
  }, "#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("");
614
- e(this, k).innerHTML = `
612
+ u(this, ae, /* @__PURE__ */ l(() => {
613
+ const i = e(this, C).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) => {
614
+ 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>` : "";
615
+ return g + f;
616
+ }).join(""), h = s.map((a, d) => `<div class="nine-tab-item ${d === 0 ? "active" : ""}" data-index="${d}">Sheet ${d + 1}</div>`).join("");
617
+ e(this, C).innerHTML = `
615
618
  <style>
616
619
  :host {
617
620
  display: flex;
@@ -644,13 +647,13 @@ const Ae = class Ae {
644
647
  flex-direction: row;
645
648
  }
646
649
  nine-table-sheet {
647
- display: none !important;
650
+ display: none;
648
651
  height: 100%;
649
652
  overflow: auto;
650
- flex: 1 1 ${o > 1 ? `${100 / o}%` : "100%"};
653
+ flex: 1 1 ${r > 1 ? `${100 / r}%` : "100%"};
651
654
  }
652
655
  nine-table-sheet.active {
653
- display: block !important;
656
+ display: block;
654
657
  }
655
658
 
656
659
  nine-table-sheets-body nine-splitter.h {
@@ -708,9 +711,9 @@ const Ae = class Ae {
708
711
  <nine-table-body>
709
712
  <nine-table-summary></nine-table-summary>
710
713
  <nine-table-sheets>
711
- <nine-table-sheets-body>${r}</nine-table-sheets-body>
714
+ <nine-table-sheets-body>${o}</nine-table-sheets-body>
712
715
  <nine-table-sheets-footer>
713
- <div class="nine-tab-bar">${l}</div>
716
+ <div class="nine-tab-bar">${h}</div>
714
717
  <div class="sheets-counter">Total : <span id="row-count">0</span></div>
715
718
  </nine-table-sheets-footer>
716
719
  </nine-table-sheets>
@@ -718,53 +721,53 @@ const Ae = class Ae {
718
721
  </nine-table-body>
719
722
  <nine-table-footer></nine-table-footer>
720
723
  `;
721
- 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);
724
+ const b = e(this, C).querySelectorAll("nine-table-sheet");
725
+ b == null || b.forEach((a, d) => {
726
+ s[d] && setTimeout(() => {
727
+ a.init(s[d]), n && e(this, Q).call(this, i);
725
728
  });
726
729
  });
727
730
  }, "#render"));
728
- p(this, k, i), e(this, ae).call(this), e(this, le).call(this);
731
+ p(this, C, i), e(this, ae).call(this), e(this, le).call(this);
729
732
  }
730
733
  };
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;
734
- const Ce = class Ce {
734
+ C = new WeakMap(), J = new WeakMap(), le = new WeakMap(), Q = new WeakMap(), ae = new WeakMap(), l(ke, "LayoutManager");
735
+ let me = ke;
736
+ var z, X;
737
+ const Ae = class Ae {
735
738
  constructor(i) {
736
- f(this, z);
737
- f(this, V, -1);
738
- v(this, "count", /* @__PURE__ */ a(() => e(this, z).rawRecords.length, "count"));
739
+ u(this, z);
740
+ u(this, X, -1);
741
+ v(this, "count", /* @__PURE__ */ l(() => e(this, z).rawRecords.length, "count"));
739
742
  p(this, z, i);
740
743
  }
741
744
  get at() {
742
- return e(this, V);
745
+ return e(this, X);
743
746
  }
744
747
  set at(i) {
745
748
  var s, n;
746
- p(this, V, parseInt(i, 10));
749
+ p(this, X, parseInt(i, 10));
747
750
  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));
751
+ t && !t.querySelector(`tbody.bindable tr[data-row="${e(this, X)}"]`) && setTimeout(() => {
752
+ var r, o;
753
+ (o = (r = e(this, z).owner).scrollTo_V1) == null || o.call(r, e(this, X));
751
754
  });
752
755
  }
753
756
  };
754
- z = new WeakMap(), V = new WeakMap(), a(Ce, "ngRow");
755
- let ve = Ce;
756
- var E, m, A, K, ce, W, he, ee, de, fe, Z;
757
- const T = class T {
757
+ z = new WeakMap(), X = new WeakMap(), l(Ae, "ngRow");
758
+ let ve = Ae;
759
+ var R, m, k, Z, ce, W, he, ee, de, fe, j;
760
+ const q = class q {
758
761
  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(() => {
762
+ u(this, R);
763
+ u(this, m);
764
+ u(this, k, []);
765
+ u(this, Z, []);
766
+ u(this, ce, 0);
767
+ u(this, W, []);
768
+ u(this, he, /* @__PURE__ */ l(() => {
766
769
  p(this, W, []);
767
- const i = e(this, E).template || [];
770
+ const i = e(this, R).template || [];
768
771
  Array.from(i).forEach((t) => {
769
772
  var s;
770
773
  e(this, W).push(((s = t.getBoundingClientRect) == null ? void 0 : s.call(t).height) || 24);
@@ -772,126 +775,126 @@ const T = class T {
772
775
  t.__ng || (t.__ng = e(this, ee).call(this)), t.__ng.height = e(this, W).slice();
773
776
  });
774
777
  }, "#initialize"));
775
- v(this, "set", /* @__PURE__ */ a((i) => {
778
+ v(this, "set", /* @__PURE__ */ l((i) => {
776
779
  this.clear(), this.add(i, !1);
777
780
  }, "set"));
778
- f(this, ee, /* @__PURE__ */ a(() => ({
779
- rowState: T.ROW_STATE.EMPTY,
781
+ u(this, ee, /* @__PURE__ */ l(() => ({
782
+ rowState: q.ROW_STATE.EMPTY,
780
783
  deleted: !1,
781
784
  filtered: !1,
782
785
  height: e(this, W).slice(),
783
786
  o: {},
784
787
  c: {},
785
- _: [0, 0, 0, 0, T.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, W).slice(), -1, {}, {}]
788
+ _: [0, 0, 0, 0, q.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, W).slice(), -1, {}, {}]
786
789
  }), "#getDefaultMeta"));
787
- v(this, "reset", /* @__PURE__ */ a(() => {
788
- p(this, A, []), p(this, K, []);
790
+ v(this, "reset", /* @__PURE__ */ l(() => {
791
+ p(this, k, []), p(this, Z, []);
789
792
  }, "reset"));
790
- v(this, "clear", /* @__PURE__ */ a(() => {
793
+ v(this, "clear", /* @__PURE__ */ l(() => {
791
794
  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();
795
+ e(this, m).rawRecords = [], p(this, k, []), p(this, Z, []), (i = e(this, m).viewRecords) != null && i.reset && e(this, m).viewRecords.reset();
793
796
  }, "clear"));
794
- f(this, de, /* @__PURE__ */ a((i) => {
797
+ u(this, de, /* @__PURE__ */ l((i) => {
795
798
  var n;
796
799
  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);
800
+ const t = typeof ((n = e(this, R).fields) == null ? void 0 : n.get) == "function" ? e(this, R).fields.get() : Object.keys(i[0] || {}), s = [];
801
+ return i.forEach((r) => {
802
+ const o = { v: [] };
803
+ t.forEach((h) => {
804
+ o.v.push(r[h] !== void 0 && r[h] !== null ? r[h] : "");
805
+ }), s.push(o);
803
806
  }), s;
804
807
  }, "#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;
808
+ u(this, fe, /* @__PURE__ */ l((i) => (Array.isArray(i) || (i = [i]), i.forEach((t) => {
809
+ 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
810
  }), i), "#defaultInsert"));
808
- v(this, "add", /* @__PURE__ */ a((i, t = !0) => {
809
- var o;
811
+ v(this, "add", /* @__PURE__ */ l((i, t = !0) => {
812
+ var r;
810
813
  i === void 0 && (i = {});
811
814
  const s = e(this, de).call(this, i);
812
815
  e(this, m).rawRecords = e(this, m).rawRecords.concat(e(this, fe).call(this, s)), this.resetRecords();
813
816
  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;
817
+ return t || s.forEach((o, h) => {
818
+ const b = e(this, m).rawRecords[n - h];
819
+ b && (b.__ng.rowState = q.ROW_STATE.EMPTY);
820
+ }), (r = e(this, m).viewRecords) != null && r.reset && e(this, m).viewRecords.reset(), n;
818
821
  }, "add"));
819
- v(this, "delete", /* @__PURE__ */ a((i) => {
822
+ v(this, "delete", /* @__PURE__ */ l((i) => {
820
823
  var s;
821
824
  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
- 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
+ Array.isArray(i) ? t = i : typeof i > "u" ? t = [e(this, m).owner.row.at] : t = [parseInt(i, 10)], t.sort((n, r) => r - n).forEach((n) => {
826
+ if (e(this, k)[n]) {
827
+ const r = e(this, k)[n].__ng.rowid;
828
+ e(this, k)[n].__ng.rowState === q.ROW_STATE.INSERT ? e(this, m).rawRecords = e(this, m).rawRecords.filter((o) => o.__ng.rowid !== r) : e(this, m).rawRecords.forEach((o) => {
829
+ o.__ng.rowid === r && (o.__ng.deleted = !0, o.__ng.rowState = q.ROW_STATE.DELETE);
827
830
  });
828
831
  }
829
832
  }), this.resetRecords(), (s = e(this, m).viewRecords) != null && s.reset && e(this, m).viewRecords.reset();
830
833
  }, "delete"));
831
- v(this, "setValue", /* @__PURE__ */ a((i, t, s) => {
834
+ v(this, "setValue", /* @__PURE__ */ l((i, t, s) => {
832
835
  var b;
833
836
  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);
837
+ const r = (typeof ((b = e(this, R).fields) == null ? void 0 : b.get) == "function" ? e(this, R).fields.get() : []).indexOf(t);
838
+ if (r < 0) return;
839
+ const o = this.getValidData()[i];
840
+ if (!o) return;
841
+ const h = o.v[r];
842
+ 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, m).owner.refreshData && e(this, m).owner.refreshData(i);
840
843
  }, "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) => {
844
+ v(this, "resetRecords", /* @__PURE__ */ l(() => {
845
+ p(this, Z, e(this, m).rawRecords.filter((i) => !i.__ng.deleted)), p(this, k, e(this, m).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), e(this, m).rawRecords.forEach((i, t) => {
843
846
  i.__ng.rowidx = t;
844
- }), e(this, A).forEach((i, t) => {
847
+ }), e(this, k).forEach((i, t) => {
845
848
  i.__ng.i = t;
846
849
  });
847
850
  }, "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) => {
851
+ v(this, "getValidData", /* @__PURE__ */ l(() => (e(this, k).length === 0 && e(this, m).rawRecords.length > 0 && this.resetRecords(), e(this, k)), "getValidData"));
852
+ u(this, j, /* @__PURE__ */ l((i) => {
850
853
  var s;
851
854
  if (!i) return i;
852
- const t = typeof ((s = e(this, E).fields) == null ? void 0 : s.get) == "function" ? e(this, E).fields.get() : [];
855
+ const t = typeof ((s = e(this, R).fields) == null ? void 0 : s.get) == "function" ? e(this, R).fields.get() : [];
853
856
  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;
857
+ const r = {};
858
+ return t.forEach((o, h) => {
859
+ r[o] = n.v ? n.v[h] : n[o];
860
+ }), r.__ng = n.__ng, r;
858
861
  }) : i;
859
862
  }, "#conv2"));
860
- v(this, "count", /* @__PURE__ */ a(() => this.getValidData().length, "count"));
861
- v(this, "get", /* @__PURE__ */ a((i, t) => {
862
- var o;
863
+ v(this, "count", /* @__PURE__ */ l(() => this.getValidData().length, "count"));
864
+ v(this, "get", /* @__PURE__ */ l((i, t) => {
865
+ var r;
863
866
  const s = this.getValidData();
864
867
  if (!s || s.length <= 0) return;
865
- if (i == null) return e(this, Z).call(this, s);
868
+ if (i == null) return e(this, j).call(this, s);
866
869
  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() : [];
870
+ const n = typeof ((r = e(this, R).fields) == null ? void 0 : r.get) == "function" ? e(this, R).fields.get() : [];
868
871
  if (t != null) {
869
- const r = n.indexOf(t);
870
- return r >= 0 ? s[i].v[r] : null;
872
+ const o = n.indexOf(t);
873
+ return o >= 0 ? s[i].v[o] : null;
871
874
  }
872
- return e(this, Z).call(this, s[i]);
875
+ return e(this, j).call(this, s[i]);
873
876
  }, "get"));
874
- p(this, E, i), p(this, m, t), e(this, he).call(this);
877
+ p(this, R, i), p(this, m, t), e(this, he).call(this);
875
878
  }
876
879
  get source() {
877
- return e(this, Z).call(this, e(this, m).rawRecords);
880
+ return e(this, j).call(this, e(this, m).rawRecords);
878
881
  }
879
882
  set source(i) {
880
883
  this.clear(), this.add(i, !1);
881
884
  }
882
885
  get nextId() {
883
- return ++He(this, ce)._;
886
+ return ++$e(this, ce)._;
884
887
  }
885
888
  };
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", {
889
+ R = new WeakMap(), m = new WeakMap(), k = new WeakMap(), Z = new WeakMap(), ce = new WeakMap(), W = new WeakMap(), he = new WeakMap(), ee = new WeakMap(), de = new WeakMap(), fe = new WeakMap(), j = new WeakMap(), l(q, "ngData"), // 🎯 ν–‰ μƒνƒœ μ •μ˜ μƒμˆ˜λ₯Ό 클래슀 λ‚΄λΆ€λ‘œ λ‚΄μž¬ν™”
890
+ v(q, "ROW_STATE", {
888
891
  EMPTY: "EMPTY",
889
892
  NORMAL: "NORMAL",
890
893
  INSERT: "INSERT",
891
894
  UPDATE: "UPDATE",
892
895
  DELETE: "DELETE"
893
896
  });
894
- let xe = T;
897
+ let xe = q;
895
898
  const Le = class Le {
896
899
  constructor(i) {
897
900
  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 +903,10 @@ const Le = class Le {
900
903
  }, this.setDataSource = (t) => {
901
904
  this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(t || []);
902
905
  }, this.getRowState = (t) => {
903
- var n, o;
906
+ var n, r;
904
907
  const s = parseInt(t, 10);
905
908
  if (!(s >= this.data.count()))
906
- return (o = (n = this.data.getValidData()[s]) == null ? void 0 : n.__ng) == null ? void 0 : o.rowState;
909
+ return (r = (n = this.data.getValidData()[s]) == null ? void 0 : n.__ng) == null ? void 0 : r.rowState;
907
910
  }, this.getRowPosition = () => this.row.at, this.setRowPosition = (t) => {
908
911
  this.row.at = t;
909
912
  }, 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,22 +914,22 @@ const Le = class Le {
911
914
  }, this.setDataSource([]);
912
915
  }
913
916
  };
914
- a(Le, "ngDataManager");
917
+ l(Le, "ngDataManager");
915
918
  let Se = Le;
916
919
  var Y, ue;
917
920
  const _e = class _e extends HTMLElement {
918
921
  constructor() {
919
922
  super();
920
923
  //#created = false;
921
- f(this, Y);
922
- f(this, ue);
924
+ u(this, Y);
925
+ u(this, ue);
923
926
  this.attachShadow({ mode: "open" }), p(this, Y, new Se(this));
924
927
  }
925
928
  connectedCallback() {
926
- p(this, ue, new me(this.shadowRoot)), G.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
929
+ p(this, ue, new me(this.shadowRoot)), F.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
927
930
  }
928
931
  disconnectedCallback() {
929
- G.log("NineTable disconnected.");
932
+ F.log("NineTable disconnected.");
930
933
  }
931
934
  // 🎯 μ™ΈλΆ€μ—μ„œ grid.data.set(...) ν˜•νƒœλ‘œ μ ‘κ·Όν•  수 μžˆλ„λ‘ 데이터 λ§€λ‹ˆμ € μ˜€ν”ˆ
932
935
  get data() {
@@ -941,7 +944,7 @@ const _e = class _e extends HTMLElement {
941
944
  return e(this, Y);
942
945
  }
943
946
  };
944
- Y = new WeakMap(), ue = new WeakMap(), a(_e, "NineTable");
947
+ Y = new WeakMap(), ue = new WeakMap(), l(_e, "NineTable");
945
948
  let Ee = _e;
946
949
  customElements.get("nine-table") || customElements.define("nine-table", Ee);
947
950
  //# sourceMappingURL=nine-table.js.map