@ninebone/table 0.0.157 β†’ 0.0.159

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,7 +3,7 @@ var Me = (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 });
6
+ var a = (m, s) => $e(m, "name", { value: s, configurable: !0 });
7
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
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);
9
9
  var He = (m, s, t, i) => ({
@@ -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,7 +203,7 @@ 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
209
  var X, _, q, I, M, H, se, ie;
@@ -215,13 +215,13 @@ const qe = class qe {
215
215
  u(this, I, null);
216
216
  u(this, M, 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(() => {
224
+ u(this, ie, /* @__PURE__ */ a(() => {
225
225
  !e(this, X) || !(e(this, X) instanceof HTMLElement) || (p(this, I, new ResizeObserver((s) => {
226
226
  for (const t of s) {
227
227
  const i = t.target;
@@ -231,13 +231,13 @@ 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
237
  if (e(this, M) !== h && (p(this, M, h), e(this, q) !== null)) {
238
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);
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((g) => {
240
+ const f = i.querySelector(g);
241
241
  f && f.querySelector("tbody") && this.renderRows(f);
242
242
  });
243
243
  }
@@ -245,33 +245,33 @@ const qe = class qe {
245
245
  }
246
246
  })), e(this, I).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
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);
273
+ const l = Math.ceil(e(this, M) / 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,19 +291,19 @@ 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(() => {
306
+ v(this, "destroy", /* @__PURE__ */ a(() => {
307
307
  e(this, I) && (e(this, I).disconnect(), p(this, I, null));
308
308
  }, "destroy"));
309
309
  p(this, X, s), e(this, se).call(this);
@@ -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(), I = new WeakMap(), M = 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,40 @@ 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
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"));
616
+ if (t.filter((o) => o.classList.contains("active")).length < 2) {
617
+ i.forEach((o) => o.style.setProperty("display", "none", "important"));
618
618
  return;
619
619
  }
620
- i.forEach((n) => {
621
- n.style.setProperty("display", "block", "important");
620
+ i.forEach((o, r) => {
621
+ const l = t[r], b = t[r + 1];
622
+ l && b && l.classList.contains("active") && b.classList.contains("active") ? o.style.setProperty("display", "block", "important") : o.style.setProperty("display", "none", "important");
622
623
  });
623
624
  }, "updateSplitters"));
624
- u(this, le, /* @__PURE__ */ l(() => {
625
+ u(this, le, /* @__PURE__ */ a(() => {
625
626
  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("");
627
+ 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>` : "";
628
+ return g + f;
629
+ }).join(""), l = i.map((c, h) => `<div class="nine-tab-item ${h === 0 ? "active" : ""}" data-index="${h}">Sheet ${h + 1}</div>`).join("");
629
630
  e(this, E).innerHTML = `
630
631
  <style>
631
632
  :host {
@@ -726,7 +727,7 @@ const Ae = class Ae {
726
727
  <nine-table-sheets>
727
728
  <nine-table-sheets-body>${r}</nine-table-sheets-body>
728
729
  <nine-table-sheets-footer>
729
- <div class="nine-tab-bar">${a}</div>
730
+ <div class="nine-tab-bar">${l}</div>
730
731
  <div class="sheets-counter">Total : <span id="row-count">0</span></div>
731
732
  </nine-table-sheets-footer>
732
733
  </nine-table-sheets>
@@ -734,8 +735,8 @@ const Ae = class Ae {
734
735
  </nine-table-body>
735
736
  <nine-table-footer></nine-table-footer>
736
737
  `;
737
- const g = e(this, E).querySelectorAll("nine-table-sheet");
738
- g == null || g.forEach((c, h) => {
738
+ const b = e(this, E).querySelectorAll("nine-table-sheet");
739
+ b == null || b.forEach((c, h) => {
739
740
  i[h] && setTimeout(() => {
740
741
  c.init(i[h]), n && e(this, J).call(this, s), this.updateSplitters();
741
742
  });
@@ -744,14 +745,14 @@ const Ae = class Ae {
744
745
  p(this, E, s), e(this, le).call(this), e(this, oe).call(this);
745
746
  }
746
747
  };
747
- E = new WeakMap(), G = new WeakMap(), oe = new WeakMap(), J = new WeakMap(), le = new WeakMap(), l(Ae, "LayoutManager");
748
+ E = new WeakMap(), G = new WeakMap(), oe = new WeakMap(), J = new WeakMap(), le = new WeakMap(), a(Ae, "LayoutManager");
748
749
  let we = Ae;
749
750
  var z, V;
750
751
  const Ce = class Ce {
751
752
  constructor(s) {
752
753
  u(this, z);
753
754
  u(this, V, -1);
754
- v(this, "count", /* @__PURE__ */ l(() => e(this, z).rawRecords.length, "count"));
755
+ v(this, "count", /* @__PURE__ */ a(() => e(this, z).rawRecords.length, "count"));
755
756
  p(this, z, s);
756
757
  }
757
758
  get at() {
@@ -767,7 +768,7 @@ const Ce = class Ce {
767
768
  });
768
769
  }
769
770
  };
770
- z = new WeakMap(), V = new WeakMap(), l(Ce, "ngRow");
771
+ z = new WeakMap(), V = new WeakMap(), a(Ce, "ngRow");
771
772
  let ve = Ce;
772
773
  var R, w, k, U, ae, W, ce, Q, he, de, K;
773
774
  const T = class T {
@@ -778,7 +779,7 @@ const T = class T {
778
779
  u(this, U, []);
779
780
  u(this, ae, 0);
780
781
  u(this, W, []);
781
- u(this, ce, /* @__PURE__ */ l(() => {
782
+ u(this, ce, /* @__PURE__ */ a(() => {
782
783
  p(this, W, []);
783
784
  const s = e(this, R).template || [];
784
785
  Array.from(s).forEach((t) => {
@@ -788,10 +789,10 @@ const T = class T {
788
789
  t.__ng || (t.__ng = e(this, Q).call(this)), t.__ng.height = e(this, W).slice();
789
790
  });
790
791
  }, "#initialize"));
791
- v(this, "set", /* @__PURE__ */ l((s) => {
792
+ v(this, "set", /* @__PURE__ */ a((s) => {
792
793
  this.clear(), this.add(s, !1);
793
794
  }, "set"));
794
- u(this, Q, /* @__PURE__ */ l(() => ({
795
+ u(this, Q, /* @__PURE__ */ a(() => ({
795
796
  rowState: T.ROW_STATE.EMPTY,
796
797
  deleted: !1,
797
798
  filtered: !1,
@@ -800,39 +801,39 @@ const T = class T {
800
801
  c: {},
801
802
  _: [0, 0, 0, 0, T.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, W).slice(), -1, {}, {}]
802
803
  }), "#getDefaultMeta"));
803
- v(this, "reset", /* @__PURE__ */ l(() => {
804
+ v(this, "reset", /* @__PURE__ */ a(() => {
804
805
  p(this, k, []), p(this, U, []);
805
806
  }, "reset"));
806
- v(this, "clear", /* @__PURE__ */ l(() => {
807
+ v(this, "clear", /* @__PURE__ */ a(() => {
807
808
  var s;
808
809
  e(this, w).rawRecords = [], p(this, k, []), p(this, U, []), (s = e(this, w).viewRecords) != null && s.reset && e(this, w).viewRecords.reset();
809
810
  }, "clear"));
810
- u(this, he, /* @__PURE__ */ l((s) => {
811
+ u(this, he, /* @__PURE__ */ a((s) => {
811
812
  var n;
812
813
  Array.isArray(s) || (s = [s]);
813
814
  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
815
  return s.forEach((o) => {
815
816
  const r = { v: [] };
816
- t.forEach((a) => {
817
- r.v.push(o[a] !== void 0 && o[a] !== null ? o[a] : "");
817
+ t.forEach((l) => {
818
+ r.v.push(o[l] !== void 0 && o[l] !== null ? o[l] : "");
818
819
  }), i.push(r);
819
820
  }), i;
820
821
  }, "#json2Array"));
821
- u(this, de, /* @__PURE__ */ l((s) => (Array.isArray(s) || (s = [s]), s.forEach((t) => {
822
+ u(this, de, /* @__PURE__ */ a((s) => (Array.isArray(s) || (s = [s]), s.forEach((t) => {
822
823
  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
824
  }), s), "#defaultInsert"));
824
- v(this, "add", /* @__PURE__ */ l((s, t = !0) => {
825
+ v(this, "add", /* @__PURE__ */ a((s, t = !0) => {
825
826
  var o;
826
827
  s === void 0 && (s = {});
827
828
  const i = e(this, he).call(this, s);
828
829
  e(this, w).rawRecords = e(this, w).rawRecords.concat(e(this, de).call(this, i)), this.resetRecords();
829
830
  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);
831
+ return t || i.forEach((r, l) => {
832
+ const b = e(this, w).rawRecords[n - l];
833
+ b && (b.__ng.rowState = T.ROW_STATE.EMPTY);
833
834
  }), (o = e(this, w).viewRecords) != null && o.reset && e(this, w).viewRecords.reset(), n;
834
835
  }, "add"));
835
- v(this, "delete", /* @__PURE__ */ l((s) => {
836
+ v(this, "delete", /* @__PURE__ */ a((s) => {
836
837
  var i;
837
838
  let t = [];
838
839
  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 +845,37 @@ const T = class T {
844
845
  }
845
846
  }), this.resetRecords(), (i = e(this, w).viewRecords) != null && i.reset && e(this, w).viewRecords.reset();
846
847
  }, "delete"));
847
- v(this, "setValue", /* @__PURE__ */ l((s, t, i) => {
848
- var g;
848
+ v(this, "setValue", /* @__PURE__ */ a((s, t, i) => {
849
+ var b;
849
850
  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);
851
+ const o = (typeof ((b = e(this, R).fields) == null ? void 0 : b.get) == "function" ? e(this, R).fields.get() : []).indexOf(t);
851
852
  if (o < 0) return;
852
853
  const r = this.getValidData()[s];
853
854
  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);
855
+ const l = r.v[o];
856
+ 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
857
  }, "setValue"));
857
- v(this, "resetRecords", /* @__PURE__ */ l(() => {
858
+ v(this, "resetRecords", /* @__PURE__ */ a(() => {
858
859
  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
860
  s.__ng.rowidx = t;
860
861
  }), e(this, k).forEach((s, t) => {
861
862
  s.__ng.i = t;
862
863
  });
863
864
  }, "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) => {
865
+ v(this, "getValidData", /* @__PURE__ */ a(() => (e(this, k).length === 0 && e(this, w).rawRecords.length > 0 && this.resetRecords(), e(this, k)), "getValidData"));
866
+ u(this, K, /* @__PURE__ */ a((s) => {
866
867
  var i;
867
868
  if (!s) return s;
868
869
  const t = typeof ((i = e(this, R).fields) == null ? void 0 : i.get) == "function" ? e(this, R).fields.get() : [];
869
870
  return Array.isArray(s) ? s.filter((n) => !n.__ng.deleted).map((n) => {
870
871
  const o = {};
871
- return t.forEach((r, a) => {
872
- o[r] = n.v ? n.v[a] : n[r];
872
+ return t.forEach((r, l) => {
873
+ o[r] = n.v ? n.v[l] : n[r];
873
874
  }), o.__ng = n.__ng, o;
874
875
  }) : s;
875
876
  }, "#conv2"));
876
- v(this, "count", /* @__PURE__ */ l(() => this.getValidData().length, "count"));
877
- v(this, "get", /* @__PURE__ */ l((s, t) => {
877
+ v(this, "count", /* @__PURE__ */ a(() => this.getValidData().length, "count"));
878
+ v(this, "get", /* @__PURE__ */ a((s, t) => {
878
879
  var o;
879
880
  const i = this.getValidData();
880
881
  if (!i || i.length <= 0) return;
@@ -899,7 +900,7 @@ const T = class T {
899
900
  return ++He(this, ae)._;
900
901
  }
901
902
  };
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"), // 🎯 ν–‰ μƒνƒœ μ •μ˜ μƒμˆ˜λ₯Ό 클래슀 λ‚΄λΆ€λ‘œ λ‚΄μž¬ν™”
903
+ 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
904
  v(T, "ROW_STATE", {
904
905
  EMPTY: "EMPTY",
905
906
  NORMAL: "NORMAL",
@@ -927,7 +928,7 @@ const Le = class Le {
927
928
  }, this.setDataSource([]);
928
929
  }
929
930
  };
930
- l(Le, "ngDataManager");
931
+ a(Le, "ngDataManager");
931
932
  let Se = Le;
932
933
  var Y, fe;
933
934
  const _e = class _e extends HTMLElement {
@@ -957,7 +958,7 @@ const _e = class _e extends HTMLElement {
957
958
  return e(this, Y);
958
959
  }
959
960
  };
960
- Y = new WeakMap(), fe = new WeakMap(), l(_e, "NineTable");
961
+ Y = new WeakMap(), fe = new WeakMap(), a(_e, "NineTable");
961
962
  let Ee = _e;
962
963
  customElements.get("nine-table") || customElements.define("nine-table", Ee);
963
964
  //# sourceMappingURL=nine-table.js.map