@ninebone/table 0.0.158 β†’ 0.0.160

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,11 +1,11 @@
1
1
  var $e = Object.defineProperty;
2
- var Me = (m) => {
2
+ var Ie = (m) => {
3
3
  throw TypeError(m);
4
4
  };
5
5
  var ze = (m, s, t) => s in m ? $e(m, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : m[s] = t;
6
- var l = (m, s) => $e(m, "name", { value: s, configurable: !0 });
7
- var v = (m, s, t) => ze(m, typeof s != "symbol" ? s + "" : s, t), Ie = (m, s, t) => s.has(m) || Me("Cannot " + t);
8
- var e = (m, s, t) => (Ie(m, s, "read from private field"), t ? t.call(m) : s.get(m)), u = (m, s, t) => s.has(m) ? Me("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(m) : s.set(m, t), p = (m, s, t, i) => (Ie(m, s, "write to private field"), i ? i.call(m, t) : s.set(m, t), t);
6
+ var a = (m, s) => $e(m, "name", { value: s, configurable: !0 });
7
+ var v = (m, s, t) => ze(m, typeof s != "symbol" ? s + "" : s, t), Me = (m, s, t) => s.has(m) || Ie("Cannot " + t);
8
+ var e = (m, s, t) => (Me(m, s, "read from private field"), t ? t.call(m) : s.get(m)), u = (m, s, t) => s.has(m) ? Ie("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(m) : s.set(m, t), p = (m, s, t, i) => (Me(m, s, "write to private field"), i ? i.call(m, t) : s.set(m, t), t);
9
9
  var He = (m, s, t, i) => ({
10
10
  set _(n) {
11
11
  p(m, s, n, t);
@@ -20,7 +20,7 @@ const Re = class Re extends We.constructor {
20
20
  super(), this.init("nine-table", "green");
21
21
  }
22
22
  };
23
- l(Re, "Trace");
23
+ a(Re, "Trace");
24
24
  let be = Re;
25
25
  const j = new be();
26
26
  var L, O, y, B, D, N, ee, P, te;
@@ -33,19 +33,19 @@ const Te = class Te extends HTMLElement {
33
33
  u(this, B);
34
34
  u(this, D);
35
35
  u(this, N);
36
- u(this, ee, /* @__PURE__ */ l(() => {
36
+ u(this, ee, /* @__PURE__ */ a(() => {
37
37
  if (!e(this, L)) return;
38
38
  const t = e(this, L).querySelector(".ng-container-body");
39
39
  t && (p(this, N, new ResizeObserver(() => {
40
40
  this.refresh();
41
41
  })), e(this, N).observe(t));
42
42
  }, "#observeResize"));
43
- v(this, "refresh", /* @__PURE__ */ l(() => {
43
+ v(this, "refresh", /* @__PURE__ */ a(() => {
44
44
  if (!e(this, L) || !e(this, y) || e(this, O)) return;
45
45
  const t = e(this, y).container, i = t.querySelector("table");
46
46
  if (!i) return;
47
- const n = e(this, y).track, o = e(this, y).thumb, r = e(this, L).querySelector(".ng-container-bottom"), a = t.clientWidth, g = i.scrollWidth;
48
- if (a !== 0 && g > a)
47
+ const n = e(this, y).track, o = e(this, y).thumb, r = e(this, L).querySelector(".ng-container-bottom"), l = t.clientWidth, b = i.scrollWidth;
48
+ if (l !== 0 && b > l)
49
49
  r && (r.style.display = "flex");
50
50
  else {
51
51
  r && (r.style.display = "none");
@@ -53,35 +53,35 @@ const Te = class Te extends HTMLElement {
53
53
  }
54
54
  const c = n.clientWidth;
55
55
  if (c <= 0) return;
56
- const h = Math.max(Math.min(c * (a / g), c), 20);
56
+ const h = Math.max(Math.min(c * (l / b), c), 20);
57
57
  o.style.width = `${h}px`;
58
58
  let d = 0;
59
- const b = i.style.transform;
60
- if (b && b.includes("translateX")) {
61
- const x = b.match(/translateX\(([-\d.]+)px\)/);
59
+ const g = i.style.transform;
60
+ if (g && g.includes("translateX")) {
61
+ const x = g.match(/translateX\(([-\d.]+)px\)/);
62
62
  x && x[1] && (d = parseFloat(x[1]));
63
63
  } else
64
64
  d = parseInt(i.style.left || 0, 10);
65
- let f = parseInt(Math.abs(d) * c / g, 10);
65
+ let f = parseInt(Math.abs(d) * c / b, 10);
66
66
  f < 0 && (f = 0);
67
67
  const S = c - h;
68
68
  f > S && (f = S), o.style.left = `${f}px`, e(this, y).left.disabled = f === 0, e(this, y).right.disabled = f >= S - 1;
69
69
  }, "refresh"));
70
- u(this, P, /* @__PURE__ */ l((t) => {
70
+ u(this, P, /* @__PURE__ */ a((t) => {
71
71
  if (!e(this, y)) return !1;
72
72
  const i = e(this, y).container, n = i.querySelector("table");
73
73
  if (!n) return !1;
74
74
  const o = e(this, y).track.getBoundingClientRect(), r = e(this, y).thumb.clientWidth;
75
- let a = t;
76
- a < 0 && (a = 0);
77
- const g = o.width - r;
78
- a > g && (a = g), a = parseInt(a, 10), e(this, y).thumb.style.left = `${a}px`, e(this, y).left.disabled = a === 0, e(this, y).right.disabled = a >= g - 1;
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
79
  const c = i.clientWidth, h = n.scrollWidth;
80
- let d = g > 0 ? -a * (h - c) / g : 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)`, a > 0 && a < g - 1;
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;
82
82
  }, "#thumbMoveTo"));
83
- u(this, te, /* @__PURE__ */ l(() => {
84
- const t = /* @__PURE__ */ l((n) => {
83
+ u(this, te, /* @__PURE__ */ a(() => {
84
+ const t = /* @__PURE__ */ a((n) => {
85
85
  clearInterval(e(this, B)), clearInterval(e(this, D));
86
86
  const o = parseInt(e(this, y).thumb.style.left || 0, 10);
87
87
  e(this, P).call(this, o + n), p(this, B, setInterval(() => {
@@ -90,7 +90,7 @@ const Te = class Te extends HTMLElement {
90
90
  e(this, P).call(this, r + n) || clearInterval(e(this, D));
91
91
  }, 50));
92
92
  }, 500));
93
- }, "delayScroll"), i = /* @__PURE__ */ l(() => {
93
+ }, "delayScroll"), i = /* @__PURE__ */ a(() => {
94
94
  clearInterval(e(this, B)), clearInterval(e(this, D));
95
95
  }, "clearTimer");
96
96
  ["mouseup", "mouseleave", "touchend"].forEach((n) => {
@@ -107,11 +107,11 @@ const Te = class Te extends HTMLElement {
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__ */ l((a) => {
110
+ const o = /* @__PURE__ */ a((l) => {
111
111
  if (!e(this, O)) return;
112
- const g = e(this, y).track.getBoundingClientRect();
113
- e(this, P).call(this, a.clientX - g.left - this.shiftX);
114
- }, "onMouseMove"), r = /* @__PURE__ */ l(() => {
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
115
  p(this, O, !1), i(), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", r), this.refresh();
116
116
  }, "onMouseUp");
117
117
  document.addEventListener("mousemove", o), document.addEventListener("mouseup", r);
@@ -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__ */ l(() => {
186
+ const t = /* @__PURE__ */ a(() => {
187
187
  const i = e(this, L).querySelector(".ng-container-body");
188
188
  if (!i) {
189
189
  setTimeout(t, 10);
@@ -203,26 +203,26 @@ const Te = class Te extends HTMLElement {
203
203
  e(this, N) && e(this, N).disconnect();
204
204
  }
205
205
  };
206
- L = new WeakMap(), O = new WeakMap(), y = new WeakMap(), B = new WeakMap(), D = new WeakMap(), N = new WeakMap(), ee = new WeakMap(), P = new WeakMap(), te = new WeakMap(), l(Te, "NineTableHScrollBar");
206
+ L = new WeakMap(), O = new WeakMap(), y = new WeakMap(), B = new WeakMap(), D = new WeakMap(), N = new WeakMap(), ee = new WeakMap(), P = new WeakMap(), te = new WeakMap(), a(Te, "NineTableHScrollBar");
207
207
  let ge = Te;
208
208
  customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ge);
209
- var X, _, q, I, M, H, se, ie;
209
+ var X, _, q, M, I, H, se, ie;
210
210
  const qe = class qe {
211
211
  constructor(s) {
212
212
  u(this, X);
213
213
  u(this, _, []);
214
214
  u(this, q, null);
215
- u(this, I, null);
216
- u(this, M, 0);
215
+ u(this, M, null);
216
+ u(this, I, 0);
217
217
  u(this, H, 0);
218
- u(this, se, /* @__PURE__ */ l(() => {
218
+ u(this, se, /* @__PURE__ */ a(() => {
219
219
  e(this, ie).call(this);
220
220
  }, "#init"));
221
221
  /**
222
222
  * 🎯 뷰포트 크기 λ³€ν™” μ‹œμ μ— 높이 계산 및 ν•„μš”ν•œ ν–‰ 개수 산정·캐싱을 μ™„κ²°
223
223
  */
224
- u(this, ie, /* @__PURE__ */ l(() => {
225
- !e(this, X) || !(e(this, X) instanceof HTMLElement) || (p(this, I, new ResizeObserver((s) => {
224
+ u(this, ie, /* @__PURE__ */ a(() => {
225
+ !e(this, X) || !(e(this, X) instanceof HTMLElement) || (p(this, M, new ResizeObserver((s) => {
226
226
  for (const t of s) {
227
227
  const i = t.target;
228
228
  if (!i.classList.contains("active"))
@@ -231,47 +231,47 @@ const qe = class qe {
231
231
  if (n > 0) {
232
232
  const o = i.clientHeight || i.getBoundingClientRect().height || n;
233
233
  let r = 0;
234
- const a = i.querySelector(".ng-container-body") || i, g = a.querySelector("thead"), c = a.querySelector("tfoot");
235
- g && (r += g.offsetHeight || g.getBoundingClientRect().height), c && (r += c.offsetHeight || c.getBoundingClientRect().height);
234
+ const l = i.querySelector(".ng-container-body") || i, b = l.querySelector("thead"), c = l.querySelector("tfoot");
235
+ b && (r += b.offsetHeight || b.getBoundingClientRect().height), c && (r += c.offsetHeight || c.getBoundingClientRect().height);
236
236
  const h = Math.max(o - r, 100);
237
- if (e(this, M) !== h && (p(this, M, h), e(this, q) !== null)) {
238
- const d = Math.ceil(e(this, M) / e(this, q));
239
- p(this, H, d + 20), j.log(`[RowManager] Resized. Height: ${e(this, M)}px | Target Rows: ${e(this, H)}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((b) => {
240
- const f = i.querySelector(b);
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), j.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 = i.querySelector(g);
241
241
  f && f.querySelector("tbody") && this.renderRows(f);
242
242
  });
243
243
  }
244
244
  }
245
245
  }
246
- })), e(this, I).observe(e(this, X)));
246
+ })), e(this, M).observe(e(this, X)));
247
247
  }, "#initResizeObserver"));
248
- v(this, "initTemplate", /* @__PURE__ */ l((s) => {
248
+ v(this, "initTemplate", /* @__PURE__ */ a((s) => {
249
249
  const t = s.querySelector("tbody.bindable") || s.querySelector("tbody");
250
250
  if (!t) return;
251
251
  const i = Array.from(t.querySelectorAll("tr")).filter((n) => !n.classList.contains("nodata"));
252
252
  p(this, _, i.map((n) => n.cloneNode(!0))), p(this, q, null), console.log(`[RowManager] Template initialized with ${e(this, _).length} row(s).`);
253
253
  }, "initTemplate"));
254
- v(this, "measureAndCacheHeight", /* @__PURE__ */ l((s) => {
254
+ v(this, "measureAndCacheHeight", /* @__PURE__ */ a((s) => {
255
255
  if (e(this, q) !== null)
256
256
  return e(this, q);
257
257
  if (e(this, _).length === 0)
258
258
  throw new Error("[RowManager] Template TRs are empty.");
259
259
  const t = s.querySelector("tbody.bindable") || s.querySelector("tbody");
260
260
  if (!t) return 24;
261
- t.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
261
+ t.querySelectorAll("tr:not(.nodata)").forEach((l) => l.remove());
262
262
  const i = t.querySelector("tr.nodata"), n = document.createDocumentFragment();
263
- e(this, _).forEach((a) => {
264
- n.appendChild(a.cloneNode(!0));
263
+ e(this, _).forEach((l) => {
264
+ n.appendChild(l.cloneNode(!0));
265
265
  }), i ? i.before(n) : t.appendChild(n);
266
266
  let o = 0;
267
- if (t.querySelectorAll("tr:not(.nodata)").forEach((a, g) => {
268
- const c = a.offsetHeight;
267
+ if (t.querySelectorAll("tr:not(.nodata)").forEach((l, b) => {
268
+ const c = l.offsetHeight;
269
269
  if (c === 0)
270
- throw new Error(`[RowManager] Rendered TR[${g}] height is 0. Check CSS styles.`);
270
+ throw new Error(`[RowManager] Rendered TR[${b}] height is 0. Check CSS styles.`);
271
271
  o += c;
272
- }), p(this, q, o), e(this, M) > 0) {
273
- const a = Math.ceil(e(this, M) / e(this, q));
274
- p(this, H, a + 20);
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
275
  }
276
276
  return console.log(`[RowManager] Template Height Cached: ${e(this, q)}px | RowCount: ${e(this, H)}`), e(this, q);
277
277
  }, "measureAndCacheHeight"));
@@ -291,20 +291,20 @@ const qe = class qe {
291
291
  /**
292
292
  * 🎯 μΊμ‹œλœ ν–‰ 개수λ₯Ό κ³§λ°”λ‘œ κ°€μ Έμ™€μ„œ TR λΌˆλŒ€ μ£Όμž… (쀑볡 계산 제거)
293
293
  */
294
- v(this, "renderRows", /* @__PURE__ */ l((s) => {
294
+ v(this, "renderRows", /* @__PURE__ */ a((s) => {
295
295
  if (e(this, _).length === 0) return;
296
296
  const t = s.querySelector("tbody.bindable") || s.querySelector("tbody");
297
297
  if (!t) return;
298
298
  t.querySelectorAll("tr:not(.nodata)").forEach((r) => r.remove());
299
299
  const i = t.querySelector("tr.nodata"), n = document.createDocumentFragment(), o = e(this, H);
300
300
  for (let r = 0; r < o; r++)
301
- e(this, _).forEach((a) => {
302
- n.appendChild(a.cloneNode(!0));
301
+ e(this, _).forEach((l) => {
302
+ n.appendChild(l.cloneNode(!0));
303
303
  });
304
304
  i ? i.before(n) : t.appendChild(n), console.log(`[RowManager] Rendered ${o} sets into DOM.`);
305
305
  }, "renderRows"));
306
- v(this, "destroy", /* @__PURE__ */ l(() => {
307
- e(this, I) && (e(this, I).disconnect(), p(this, I, null));
306
+ v(this, "destroy", /* @__PURE__ */ a(() => {
307
+ e(this, M) && (e(this, M).disconnect(), p(this, M, null));
308
308
  }, "destroy"));
309
309
  p(this, X, s), e(this, se).call(this);
310
310
  }
@@ -312,7 +312,7 @@ const qe = class qe {
312
312
  return e(this, _).length || 1;
313
313
  }
314
314
  };
315
- X = new WeakMap(), _ = new WeakMap(), q = new WeakMap(), I = new WeakMap(), M = new WeakMap(), H = new WeakMap(), se = new WeakMap(), ie = new WeakMap(), l(qe, "RowManager");
315
+ X = new WeakMap(), _ = new WeakMap(), q = new WeakMap(), M = new WeakMap(), I = new WeakMap(), H = new WeakMap(), se = new WeakMap(), ie = new WeakMap(), a(qe, "RowManager");
316
316
  let pe = qe;
317
317
  var C, F, ne;
318
318
  const Z = class Z extends HTMLElement {
@@ -320,60 +320,60 @@ const Z = class Z extends HTMLElement {
320
320
  super();
321
321
  u(this, C, null);
322
322
  u(this, F);
323
- v(this, "init", /* @__PURE__ */ l((t) => {
323
+ v(this, "init", /* @__PURE__ */ a((t) => {
324
324
  if (!t) return;
325
- const i = /* @__PURE__ */ l((c) => {
326
- const h = /* @__PURE__ */ l((b) => {
327
- if (b.querySelector("colgroup")) return;
328
- const f = b.querySelector("tbody tr") || b.querySelector("tr"), S = f ? f.querySelectorAll("th, td").length : 1, x = document.createElement("colgroup"), A = Math.max(Math.floor((b.clientWidth || 600) / S), 100);
325
+ const i = /* @__PURE__ */ a((c) => {
326
+ const h = /* @__PURE__ */ a((g) => {
327
+ if (g.querySelector("colgroup")) return;
328
+ 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);
329
329
  for (let $ = 0; $ < S; $++) {
330
330
  const ue = document.createElement("col");
331
331
  ue.setAttribute("width", A), x.appendChild(ue);
332
332
  }
333
- b.prepend(x);
334
- }, "ensureColgroup"), d = /* @__PURE__ */ l((b) => {
335
- if (b.querySelector("thead")) return;
336
- const f = document.createElement("thead"), S = b.querySelector("colgroup");
337
- S ? S.after(f) : b.prepend(f);
333
+ g.prepend(x);
334
+ }, "ensureColgroup"), d = /* @__PURE__ */ a((g) => {
335
+ if (g.querySelector("thead")) return;
336
+ const f = document.createElement("thead"), S = g.querySelector("colgroup");
337
+ S ? S.after(f) : g.prepend(f);
338
338
  }, "ensureThead");
339
339
  return h(c), d(c), c.classList.add("nine-table-element"), c;
340
340
  }, "initializeTable"), n = t.cloneNode(!0);
341
341
  p(this, C, i(n)), e(this, C).style.display = "table", e(this, F).initTemplate(e(this, C));
342
- const o = this.querySelector(".ng-container-left"), r = this.querySelector(".ng-container-body"), a = this.querySelector(".ng-container-right"), g = /* @__PURE__ */ l((c, h, d = !1) => {
343
- const b = c.cloneNode(!0), f = Array.from(b.querySelectorAll("colgroup col")), S = [];
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), f = Array.from(g.querySelectorAll("colgroup col")), S = [];
344
344
  return f.forEach((x, A) => {
345
345
  const $ = x.getAttribute("fixed");
346
346
  (d ? !$ || $ === "" : $ === h) || S.push(A);
347
347
  }), S.reverse().forEach((x) => {
348
- f[x] && f[x].remove(), b.querySelectorAll("tr").forEach((A) => {
348
+ f[x] && f[x].remove(), g.querySelectorAll("tr").forEach((A) => {
349
349
  const $ = A.querySelectorAll("th, td");
350
350
  $[x] && $[x].remove();
351
351
  });
352
- }), b;
352
+ }), g;
353
353
  }, "filterTableByFixed");
354
354
  if (r) {
355
- const c = g(e(this, C), null, !0);
355
+ const c = b(e(this, C), null, !0);
356
356
  r.innerHTML = "", r.appendChild(c), e(this, F).measureAndCacheHeight(r);
357
357
  }
358
358
  if (o) {
359
- const c = g(e(this, C), "left", !1);
359
+ const c = b(e(this, C), "left", !1);
360
360
  let h = 0;
361
- c.querySelectorAll("col").forEach((b) => {
362
- const f = parseInt(b.getAttribute("width"), 10);
361
+ c.querySelectorAll("col").forEach((g) => {
362
+ const f = parseInt(g.getAttribute("width"), 10);
363
363
  isNaN(f) || (h += f);
364
364
  }), o.innerHTML = "", o.appendChild(c);
365
365
  const d = h > 0 ? h : 0;
366
366
  o.style.flex = `0 0 ${d}px`, o.style.width = `${d}px`;
367
367
  }
368
- if (a) {
369
- const c = g(e(this, C), "right", !1);
368
+ if (l) {
369
+ const c = b(e(this, C), "right", !1);
370
370
  let h = 0;
371
- c.querySelectorAll("col").forEach((b) => {
372
- const f = parseInt(b.getAttribute("width"), 10);
371
+ c.querySelectorAll("col").forEach((g) => {
372
+ const f = parseInt(g.getAttribute("width"), 10);
373
373
  isNaN(f) || (h += f);
374
- }), a.innerHTML = "", a.appendChild(c);
374
+ }), l.innerHTML = "", l.appendChild(c);
375
375
  const d = h > 0 ? h : 0;
376
- a.style.flex = `0 0 ${d}px`, a.style.width = `${d}px`;
376
+ l.style.flex = `0 0 ${d}px`, l.style.width = `${d}px`;
377
377
  }
378
378
  if (r) {
379
379
  const c = this.getRowCount();
@@ -387,16 +387,16 @@ const Z = class Z extends HTMLElement {
387
387
  c && typeof c.refresh == "function" && c.refresh();
388
388
  }, 0), j.log(`NineTableSheet 3-split initialized with rows: ${this.getRowCount()}`);
389
389
  }, "init"));
390
- v(this, "getRowCount", /* @__PURE__ */ l(() => e(this, C) ? e(this, C).querySelectorAll("tbody tr").length : 0, "getRowCount"));
391
- v(this, "scrollToX", /* @__PURE__ */ l((t) => {
390
+ v(this, "getRowCount", /* @__PURE__ */ a(() => e(this, C) ? e(this, C).querySelectorAll("tbody tr").length : 0, "getRowCount"));
391
+ v(this, "scrollToX", /* @__PURE__ */ a((t) => {
392
392
  const i = this.querySelector(".ng-container-body");
393
393
  i && (i.scrollLeft = t);
394
394
  }, "scrollToX"));
395
- v(this, "scrollToY", /* @__PURE__ */ l((t) => {
395
+ v(this, "scrollToY", /* @__PURE__ */ a((t) => {
396
396
  const i = this.querySelector(".ng-container-body");
397
397
  i && (i.scrollTop = t);
398
398
  }, "scrollToY"));
399
- u(this, ne, /* @__PURE__ */ l(() => {
399
+ u(this, ne, /* @__PURE__ */ a(() => {
400
400
  const t = Z.SCROLLBAR_SIZE;
401
401
  this.innerHTML = `
402
402
  <style>
@@ -522,14 +522,14 @@ const Z = class Z extends HTMLElement {
522
522
  this.innerHTML = "", j.log("NineTableSheet destroyed.");
523
523
  }
524
524
  };
525
- C = new WeakMap(), F = new WeakMap(), ne = new WeakMap(), l(Z, "NineTableSheet"), v(Z, "SCROLLBAR_SIZE", 16);
525
+ C = new WeakMap(), F = new WeakMap(), ne = new WeakMap(), a(Z, "NineTableSheet"), v(Z, "SCROLLBAR_SIZE", 16);
526
526
  let ye = Z;
527
527
  customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", ye);
528
528
  var re;
529
529
  const ke = class ke extends HTMLElement {
530
530
  constructor() {
531
531
  super();
532
- u(this, re, /* @__PURE__ */ l(() => {
532
+ u(this, re, /* @__PURE__ */ a(() => {
533
533
  const t = this.querySelector(".nine-tab-bar");
534
534
  t && (t.addEventListener("click", (i) => {
535
535
  const n = i.target.closest(".nine-tab-item");
@@ -538,26 +538,26 @@ const ke = class ke extends HTMLElement {
538
538
  this.switchSheet(r, o);
539
539
  }), this.switchSheet(0, !1));
540
540
  }, "#init"));
541
- v(this, "switchSheet", /* @__PURE__ */ l((t, i = !1) => {
542
- const n = /* @__PURE__ */ l(() => {
541
+ v(this, "switchSheet", /* @__PURE__ */ a((t, i = !1) => {
542
+ const n = /* @__PURE__ */ a(() => {
543
543
  const d = this.querySelector("nine-table-sheets-body");
544
544
  d.querySelectorAll("nine-splitter").forEach((f) => {
545
545
  const S = parseInt(f.dataset.splitIndex, 10), x = d.querySelector(`nine-table-sheet[data-index="${S - 1}"]`), A = d.querySelector(`nine-table-sheet[data-index="${S}"]`);
546
546
  x && A && x.classList.contains("active") && A.classList.contains("active") ? f.classList.add("active") : f.classList.remove("active");
547
547
  });
548
- }, "updateSplitters"), o = this.querySelector(".nine-tab-bar"), r = this.querySelector("nine-table-sheets-body"), a = o.querySelectorAll(".nine-tab-item"), g = r.querySelectorAll("nine-table-sheet");
549
- if (!a[t]) return;
548
+ }, "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");
549
+ if (!l[t]) return;
550
550
  if (!i)
551
- a.forEach((d, b) => {
552
- d.classList.toggle("active", b === t);
553
- const f = r.querySelector(`nine-table-sheet[data-index="${b}"]`);
551
+ l.forEach((d, g) => {
552
+ d.classList.toggle("active", g === t);
553
+ const f = r.querySelector(`nine-table-sheet[data-index="${g}"]`);
554
554
  f && (f.style.flex = "");
555
- }), g.forEach((d, b) => {
556
- d.classList.toggle("active", b === t);
555
+ }), b.forEach((d, g) => {
556
+ d.classList.toggle("active", g === t);
557
557
  });
558
558
  else {
559
- const d = a[t], b = o.querySelectorAll(".nine-tab-item.active");
560
- if (d.classList.contains("active") && b.length <= 1)
559
+ const d = l[t], g = o.querySelectorAll(".nine-tab-item.active");
560
+ if (d.classList.contains("active") && g.length <= 1)
561
561
  return;
562
562
  d.classList.toggle("active");
563
563
  const f = r.querySelector(`nine-table-sheet[data-index="${t}"]`);
@@ -566,8 +566,8 @@ const ke = class ke extends HTMLElement {
566
566
  const c = Array.from(r.querySelectorAll("nine-table-sheet.active"));
567
567
  if (c.length > 1) {
568
568
  const d = 1 / c.length;
569
- c.forEach((b) => {
570
- (!b.style.flex || b.style.flex === "1 1 100%") && (b.style.flex = `${d} ${d} 0px`);
569
+ c.forEach((g) => {
570
+ (!g.style.flex || g.style.flex === "1 1 100%") && (g.style.flex = `${d} ${d} 0px`);
571
571
  });
572
572
  } else
573
573
  c.forEach((d) => {
@@ -585,7 +585,7 @@ const ke = class ke extends HTMLElement {
585
585
  e(this, re).call(this);
586
586
  }
587
587
  };
588
- re = new WeakMap(), l(ke, "NineTableSheets");
588
+ re = new WeakMap(), a(ke, "NineTableSheets");
589
589
  let me = ke;
590
590
  customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", me);
591
591
  var E, G, oe, J, le;
@@ -593,39 +593,38 @@ const Ae = class Ae {
593
593
  constructor(s) {
594
594
  u(this, E);
595
595
  u(this, G, null);
596
- u(this, oe, /* @__PURE__ */ l(() => {
596
+ u(this, oe, /* @__PURE__ */ a(() => {
597
597
  const s = e(this, E).host;
598
598
  s && (p(this, G, new ResizeObserver((t) => {
599
599
  for (let i of t)
600
600
  s.getAttribute("auto-height") === "true" && e(this, J).call(this, s);
601
601
  })), e(this, G).observe(s));
602
602
  }, "#observeResize"));
603
- u(this, J, /* @__PURE__ */ l((s) => {
603
+ u(this, J, /* @__PURE__ */ a((s) => {
604
604
  var A;
605
605
  const t = e(this, E).querySelector("nine-table-sheet.active");
606
606
  if (!t) return;
607
- const i = ((A = t.getRowCount) == null ? void 0 : A.call(t)) || 0, n = parseInt(s.getAttribute("max-display-row"), 10) || 10, o = Math.min(i, n), r = t.querySelector("tbody tr") || t.querySelector("tr"), a = r ? r.getBoundingClientRect().height : 32, g = e(this, E).querySelector("nine-table-header"), c = e(this, E).querySelector("nine-table-sheets-footer"), h = g ? g.getBoundingClientRect().height : 40, d = c ? c.getBoundingClientRect().height : 32, f = h + d + 16, S = o * a + f;
608
- s.style.height = `${S}px`, s.style.maxHeight = `${n * a + f}px`;
607
+ const i = ((A = t.getRowCount) == null ? void 0 : A.call(t)) || 0, n = parseInt(s.getAttribute("max-display-row"), 10) || 10, o = Math.min(i, n), r = t.querySelector("tbody tr") || t.querySelector("tr"), l = r ? r.getBoundingClientRect().height : 32, b = e(this, E).querySelector("nine-table-header"), c = e(this, E).querySelector("nine-table-sheets-footer"), h = b ? b.getBoundingClientRect().height : 40, d = c ? c.getBoundingClientRect().height : 32, f = h + d + 16, S = o * l + f;
608
+ s.style.height = `${S}px`, s.style.maxHeight = `${n * l + f}px`;
609
609
  const x = e(this, E).querySelector("nine-table-sheets-body");
610
610
  x && (x.style.overflowY = i > n ? "auto" : "hidden");
611
611
  }, "#applyAutoHeight"));
612
- v(this, "updateSplitters", /* @__PURE__ */ l(() => {
612
+ v(this, "updateSplitters", /* @__PURE__ */ a(() => {
613
613
  const s = e(this, E).querySelector("nine-table-sheets-body");
614
614
  if (!s) return;
615
- const t = Array.from(s.querySelectorAll("nine-table-sheet")), i = Array.from(s.querySelectorAll("nine-splitter.h"));
616
- if (t.length <= 1) {
617
- i.forEach((n) => n.style.setProperty("display", "none", "important"));
618
- return;
619
- }
620
- i.forEach((n) => {
621
- n.style.setProperty("display", "block", "important");
615
+ const t = Array.from(s.querySelectorAll("nine-table-sheet"));
616
+ Array.from(s.querySelectorAll("nine-splitter.h")).forEach((o) => o.style.setProperty("display", "none", "important"));
617
+ const n = t.filter((o) => o.classList.contains("active"));
618
+ n.length < 2 || n.forEach((o) => {
619
+ const r = parseInt(o.getAttribute("data-index"), 10), l = s.querySelector(`nine-splitter.h[data-split-index="${r}"]`), b = t[r + 1];
620
+ l && b && b.classList.contains("active") && l.style.setProperty("display", "block", "important");
622
621
  });
623
622
  }, "updateSplitters"));
624
- u(this, le, /* @__PURE__ */ l(() => {
623
+ u(this, le, /* @__PURE__ */ a(() => {
625
624
  const s = e(this, E).host, i = Array.from(s.children).filter((c) => c.tagName === "TABLE"), n = s.getAttribute("auto-height") === "true", o = i.length, r = i.map((c, h) => {
626
- const b = `<nine-table-sheet class="${h === 0 ? "active" : ""}" data-index="${h}"></nine-table-sheet>`, f = h < o - 1 ? `<nine-splitter class="h" data-split-index="${h}"></nine-splitter>` : "";
627
- return b + f;
628
- }).join(""), a = i.map((c, h) => `<div class="nine-tab-item ${h === 0 ? "active" : ""}" data-index="${h}">Sheet ${h + 1}</div>`).join("");
625
+ const g = `<nine-table-sheet class="${h === 0 ? "active" : ""}" data-index="${h}"></nine-table-sheet>`, f = h < o - 1 ? `<nine-splitter class="h" data-split-index="${h}"></nine-splitter>` : "";
626
+ return g + f;
627
+ }).join(""), l = i.map((c, h) => `<div class="nine-tab-item ${h === 0 ? "active" : ""}" data-index="${h}">Sheet ${h + 1}</div>`).join("");
629
628
  e(this, E).innerHTML = `
630
629
  <style>
631
630
  :host {
@@ -726,7 +725,7 @@ const Ae = class Ae {
726
725
  <nine-table-sheets>
727
726
  <nine-table-sheets-body>${r}</nine-table-sheets-body>
728
727
  <nine-table-sheets-footer>
729
- <div class="nine-tab-bar">${a}</div>
728
+ <div class="nine-tab-bar">${l}</div>
730
729
  <div class="sheets-counter">Total : <span id="row-count">0</span></div>
731
730
  </nine-table-sheets-footer>
732
731
  </nine-table-sheets>
@@ -734,8 +733,8 @@ const Ae = class Ae {
734
733
  </nine-table-body>
735
734
  <nine-table-footer></nine-table-footer>
736
735
  `;
737
- const g = e(this, E).querySelectorAll("nine-table-sheet");
738
- g == null || g.forEach((c, h) => {
736
+ const b = e(this, E).querySelectorAll("nine-table-sheet");
737
+ b == null || b.forEach((c, h) => {
739
738
  i[h] && setTimeout(() => {
740
739
  c.init(i[h]), n && e(this, J).call(this, s), this.updateSplitters();
741
740
  });
@@ -744,14 +743,14 @@ const Ae = class Ae {
744
743
  p(this, E, s), e(this, le).call(this), e(this, oe).call(this);
745
744
  }
746
745
  };
747
- E = new WeakMap(), G = new WeakMap(), oe = new WeakMap(), J = new WeakMap(), le = new WeakMap(), l(Ae, "LayoutManager");
746
+ E = new WeakMap(), G = new WeakMap(), oe = new WeakMap(), J = new WeakMap(), le = new WeakMap(), a(Ae, "LayoutManager");
748
747
  let we = Ae;
749
748
  var z, V;
750
749
  const Ce = class Ce {
751
750
  constructor(s) {
752
751
  u(this, z);
753
752
  u(this, V, -1);
754
- v(this, "count", /* @__PURE__ */ l(() => e(this, z).rawRecords.length, "count"));
753
+ v(this, "count", /* @__PURE__ */ a(() => e(this, z).rawRecords.length, "count"));
755
754
  p(this, z, s);
756
755
  }
757
756
  get at() {
@@ -767,7 +766,7 @@ const Ce = class Ce {
767
766
  });
768
767
  }
769
768
  };
770
- z = new WeakMap(), V = new WeakMap(), l(Ce, "ngRow");
769
+ z = new WeakMap(), V = new WeakMap(), a(Ce, "ngRow");
771
770
  let ve = Ce;
772
771
  var R, w, k, U, ae, W, ce, Q, he, de, K;
773
772
  const T = class T {
@@ -778,7 +777,7 @@ const T = class T {
778
777
  u(this, U, []);
779
778
  u(this, ae, 0);
780
779
  u(this, W, []);
781
- u(this, ce, /* @__PURE__ */ l(() => {
780
+ u(this, ce, /* @__PURE__ */ a(() => {
782
781
  p(this, W, []);
783
782
  const s = e(this, R).template || [];
784
783
  Array.from(s).forEach((t) => {
@@ -788,10 +787,10 @@ const T = class T {
788
787
  t.__ng || (t.__ng = e(this, Q).call(this)), t.__ng.height = e(this, W).slice();
789
788
  });
790
789
  }, "#initialize"));
791
- v(this, "set", /* @__PURE__ */ l((s) => {
790
+ v(this, "set", /* @__PURE__ */ a((s) => {
792
791
  this.clear(), this.add(s, !1);
793
792
  }, "set"));
794
- u(this, Q, /* @__PURE__ */ l(() => ({
793
+ u(this, Q, /* @__PURE__ */ a(() => ({
795
794
  rowState: T.ROW_STATE.EMPTY,
796
795
  deleted: !1,
797
796
  filtered: !1,
@@ -800,39 +799,39 @@ const T = class T {
800
799
  c: {},
801
800
  _: [0, 0, 0, 0, T.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, W).slice(), -1, {}, {}]
802
801
  }), "#getDefaultMeta"));
803
- v(this, "reset", /* @__PURE__ */ l(() => {
802
+ v(this, "reset", /* @__PURE__ */ a(() => {
804
803
  p(this, k, []), p(this, U, []);
805
804
  }, "reset"));
806
- v(this, "clear", /* @__PURE__ */ l(() => {
805
+ v(this, "clear", /* @__PURE__ */ a(() => {
807
806
  var s;
808
807
  e(this, w).rawRecords = [], p(this, k, []), p(this, U, []), (s = e(this, w).viewRecords) != null && s.reset && e(this, w).viewRecords.reset();
809
808
  }, "clear"));
810
- u(this, he, /* @__PURE__ */ l((s) => {
809
+ u(this, he, /* @__PURE__ */ a((s) => {
811
810
  var n;
812
811
  Array.isArray(s) || (s = [s]);
813
812
  const t = typeof ((n = e(this, R).fields) == null ? void 0 : n.get) == "function" ? e(this, R).fields.get() : Object.keys(s[0] || {}), i = [];
814
813
  return s.forEach((o) => {
815
814
  const r = { v: [] };
816
- t.forEach((a) => {
817
- r.v.push(o[a] !== void 0 && o[a] !== null ? o[a] : "");
815
+ t.forEach((l) => {
816
+ r.v.push(o[l] !== void 0 && o[l] !== null ? o[l] : "");
818
817
  }), i.push(r);
819
818
  }), i;
820
819
  }, "#json2Array"));
821
- u(this, de, /* @__PURE__ */ l((s) => (Array.isArray(s) || (s = [s]), s.forEach((t) => {
820
+ u(this, de, /* @__PURE__ */ a((s) => (Array.isArray(s) || (s = [s]), s.forEach((t) => {
822
821
  t.__ng = e(this, Q).call(this), t.__ng.rowid = this.nextId, t.__ng.rowState = T.ROW_STATE.INSERT, t.__ng._[0] = t.__ng.rowid;
823
822
  }), s), "#defaultInsert"));
824
- v(this, "add", /* @__PURE__ */ l((s, t = !0) => {
823
+ v(this, "add", /* @__PURE__ */ a((s, t = !0) => {
825
824
  var o;
826
825
  s === void 0 && (s = {});
827
826
  const i = e(this, he).call(this, s);
828
827
  e(this, w).rawRecords = e(this, w).rawRecords.concat(e(this, de).call(this, i)), this.resetRecords();
829
828
  const n = this.count() - 1;
830
- return t || i.forEach((r, a) => {
831
- const g = e(this, w).rawRecords[n - a];
832
- g && (g.__ng.rowState = T.ROW_STATE.EMPTY);
829
+ return t || i.forEach((r, l) => {
830
+ const b = e(this, w).rawRecords[n - l];
831
+ b && (b.__ng.rowState = T.ROW_STATE.EMPTY);
833
832
  }), (o = e(this, w).viewRecords) != null && o.reset && e(this, w).viewRecords.reset(), n;
834
833
  }, "add"));
835
- v(this, "delete", /* @__PURE__ */ l((s) => {
834
+ v(this, "delete", /* @__PURE__ */ a((s) => {
836
835
  var i;
837
836
  let t = [];
838
837
  Array.isArray(s) ? t = s : typeof s > "u" ? t = [e(this, w).owner.row.at] : t = [parseInt(s, 10)], t.sort((n, o) => o - n).forEach((n) => {
@@ -844,37 +843,37 @@ const T = class T {
844
843
  }
845
844
  }), this.resetRecords(), (i = e(this, w).viewRecords) != null && i.reset && e(this, w).viewRecords.reset();
846
845
  }, "delete"));
847
- v(this, "setValue", /* @__PURE__ */ l((s, t, i) => {
848
- var g;
846
+ v(this, "setValue", /* @__PURE__ */ a((s, t, i) => {
847
+ var b;
849
848
  s = parseInt(s, 10);
850
- const o = (typeof ((g = e(this, R).fields) == null ? void 0 : g.get) == "function" ? e(this, R).fields.get() : []).indexOf(t);
849
+ const o = (typeof ((b = e(this, R).fields) == null ? void 0 : b.get) == "function" ? e(this, R).fields.get() : []).indexOf(t);
851
850
  if (o < 0) return;
852
851
  const r = this.getValidData()[s];
853
852
  if (!r) return;
854
- const a = r.v[o];
855
- a !== i && r.__ng.rowState !== T.ROW_STATE.INSERT && (r.__ng.o.hasOwnProperty(t) || (r.__ng.o[t] = a), r.__ng.rowState = T.ROW_STATE.UPDATE), r.v[o] = i, e(this, w).owner.refreshData && e(this, w).owner.refreshData(s);
853
+ const l = r.v[o];
854
+ l !== i && r.__ng.rowState !== T.ROW_STATE.INSERT && (r.__ng.o.hasOwnProperty(t) || (r.__ng.o[t] = l), r.__ng.rowState = T.ROW_STATE.UPDATE), r.v[o] = i, e(this, w).owner.refreshData && e(this, w).owner.refreshData(s);
856
855
  }, "setValue"));
857
- v(this, "resetRecords", /* @__PURE__ */ l(() => {
856
+ v(this, "resetRecords", /* @__PURE__ */ a(() => {
858
857
  p(this, U, e(this, w).rawRecords.filter((s) => !s.__ng.deleted)), p(this, k, e(this, w).rawRecords.filter((s) => !s.__ng.deleted && !s.__ng.filtered)), e(this, w).rawRecords.forEach((s, t) => {
859
858
  s.__ng.rowidx = t;
860
859
  }), e(this, k).forEach((s, t) => {
861
860
  s.__ng.i = t;
862
861
  });
863
862
  }, "resetRecords"));
864
- v(this, "getValidData", /* @__PURE__ */ l(() => (e(this, k).length === 0 && e(this, w).rawRecords.length > 0 && this.resetRecords(), e(this, k)), "getValidData"));
865
- u(this, K, /* @__PURE__ */ l((s) => {
863
+ v(this, "getValidData", /* @__PURE__ */ a(() => (e(this, k).length === 0 && e(this, w).rawRecords.length > 0 && this.resetRecords(), e(this, k)), "getValidData"));
864
+ u(this, K, /* @__PURE__ */ a((s) => {
866
865
  var i;
867
866
  if (!s) return s;
868
867
  const t = typeof ((i = e(this, R).fields) == null ? void 0 : i.get) == "function" ? e(this, R).fields.get() : [];
869
868
  return Array.isArray(s) ? s.filter((n) => !n.__ng.deleted).map((n) => {
870
869
  const o = {};
871
- return t.forEach((r, a) => {
872
- o[r] = n.v ? n.v[a] : n[r];
870
+ return t.forEach((r, l) => {
871
+ o[r] = n.v ? n.v[l] : n[r];
873
872
  }), o.__ng = n.__ng, o;
874
873
  }) : s;
875
874
  }, "#conv2"));
876
- v(this, "count", /* @__PURE__ */ l(() => this.getValidData().length, "count"));
877
- v(this, "get", /* @__PURE__ */ l((s, t) => {
875
+ v(this, "count", /* @__PURE__ */ a(() => this.getValidData().length, "count"));
876
+ v(this, "get", /* @__PURE__ */ a((s, t) => {
878
877
  var o;
879
878
  const i = this.getValidData();
880
879
  if (!i || i.length <= 0) return;
@@ -899,7 +898,7 @@ const T = class T {
899
898
  return ++He(this, ae)._;
900
899
  }
901
900
  };
902
- R = new WeakMap(), w = new WeakMap(), k = new WeakMap(), U = new WeakMap(), ae = new WeakMap(), W = new WeakMap(), ce = new WeakMap(), Q = new WeakMap(), he = new WeakMap(), de = new WeakMap(), K = new WeakMap(), l(T, "ngData"), // 🎯 ν–‰ μƒνƒœ μ •μ˜ μƒμˆ˜λ₯Ό 클래슀 λ‚΄λΆ€λ‘œ λ‚΄μž¬ν™”
901
+ R = new WeakMap(), w = new WeakMap(), k = new WeakMap(), U = new WeakMap(), ae = new WeakMap(), W = new WeakMap(), ce = new WeakMap(), Q = new WeakMap(), he = new WeakMap(), de = new WeakMap(), K = new WeakMap(), a(T, "ngData"), // 🎯 ν–‰ μƒνƒœ μ •μ˜ μƒμˆ˜λ₯Ό 클래슀 λ‚΄λΆ€λ‘œ λ‚΄μž¬ν™”
903
902
  v(T, "ROW_STATE", {
904
903
  EMPTY: "EMPTY",
905
904
  NORMAL: "NORMAL",
@@ -927,7 +926,7 @@ const Le = class Le {
927
926
  }, this.setDataSource([]);
928
927
  }
929
928
  };
930
- l(Le, "ngDataManager");
929
+ a(Le, "ngDataManager");
931
930
  let Se = Le;
932
931
  var Y, fe;
933
932
  const _e = class _e extends HTMLElement {
@@ -957,7 +956,7 @@ const _e = class _e extends HTMLElement {
957
956
  return e(this, Y);
958
957
  }
959
958
  };
960
- Y = new WeakMap(), fe = new WeakMap(), l(_e, "NineTable");
959
+ Y = new WeakMap(), fe = new WeakMap(), a(_e, "NineTable");
961
960
  let Ee = _e;
962
961
  customElements.get("nine-table") || customElements.define("nine-table", Ee);
963
962
  //# sourceMappingURL=nine-table.js.map