@ninebone/table 0.0.254 β†’ 0.0.256

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.
@@ -4,8 +4,8 @@ var Oe = (m) => {
4
4
  };
5
5
  var Ne = (m, i, t) => i in m ? ze(m, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : m[i] = t;
6
6
  var h = (m, i) => ze(m, "name", { value: i, configurable: !0 });
7
- var x = (m, i, t) => Ne(m, typeof i != "symbol" ? i + "" : i, t), Be = (m, i, t) => i.has(m) || Oe("Cannot " + t);
8
- var e = (m, i, t) => (Be(m, i, "read from private field"), t ? t.call(m) : i.get(m)), u = (m, i, t) => i.has(m) ? Oe("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(m) : i.set(m, t), y = (m, i, t, s) => (Be(m, i, "write to private field"), s ? s.call(m, t) : i.set(m, t), t);
7
+ var v = (m, i, t) => Ne(m, typeof i != "symbol" ? i + "" : i, t), Be = (m, i, t) => i.has(m) || Oe("Cannot " + t);
8
+ var e = (m, i, t) => (Be(m, i, "read from private field"), t ? t.call(m) : i.get(m)), b = (m, i, t) => i.has(m) ? Oe("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(m) : i.set(m, t), y = (m, i, t, s) => (Be(m, i, "write to private field"), s ? s.call(m, t) : i.set(m, t), t);
9
9
  var De = (m, i, t, s) => ({
10
10
  set _(n) {
11
11
  y(m, i, n, t);
@@ -27,25 +27,25 @@ var C, O, p, B, D, N, ie, P, se;
27
27
  const ke = class ke extends HTMLElement {
28
28
  constructor() {
29
29
  super();
30
- u(this, C);
31
- u(this, O, !1);
32
- u(this, p);
33
- u(this, B);
34
- u(this, D);
35
- u(this, N);
36
- u(this, ie, /* @__PURE__ */ h(() => {
30
+ b(this, C);
31
+ b(this, O, !1);
32
+ b(this, p);
33
+ b(this, B);
34
+ b(this, D);
35
+ b(this, N);
36
+ b(this, ie, /* @__PURE__ */ h(() => {
37
37
  if (!e(this, C)) return;
38
38
  const t = e(this, C).querySelector(".ng-container-body");
39
39
  t && (y(this, N, new ResizeObserver(() => {
40
40
  this.refresh();
41
41
  })), e(this, N).observe(t));
42
42
  }, "#observeResize"));
43
- x(this, "refresh", /* @__PURE__ */ h(() => {
43
+ v(this, "refresh", /* @__PURE__ */ h(() => {
44
44
  if (!e(this, C) || !e(this, p) || e(this, O)) return;
45
45
  const t = e(this, p).container, s = t.querySelector("table");
46
46
  if (!s) return;
47
- const n = e(this, p).track, r = e(this, p).thumb, o = e(this, C).querySelector(".ng-container-bottom"), a = t.clientWidth, d = s.scrollWidth;
48
- if (a !== 0 && d > a)
47
+ const n = e(this, p).track, r = e(this, p).thumb, o = e(this, C).querySelector(".ng-container-bottom"), c = t.clientWidth, d = s.scrollWidth;
48
+ if (c !== 0 && d > c)
49
49
  o && (o.style.display = "flex");
50
50
  else {
51
51
  o && (o.style.display = "none");
@@ -53,28 +53,28 @@ const ke = class ke extends HTMLElement {
53
53
  }
54
54
  const l = n.clientWidth;
55
55
  if (l <= 0) return;
56
- const c = Math.max(Math.min(l * (a / d), l), 20);
57
- r.style.width = `${c}px`;
58
- const f = t.scrollLeft, g = d - a;
59
- let b = 0;
60
- g > 0 && (b = parseInt(f / g * (l - c), 10)), b < 0 && (b = 0);
61
- const S = l - c;
62
- b > S && (b = S), r.style.left = `${b}px`, Y.log(b), e(this, p).left.disabled = b === 0, e(this, p).right.disabled = b >= S - 1;
56
+ const a = Math.max(Math.min(l * (c / d), l), 20);
57
+ r.style.width = `${a}px`;
58
+ const f = t.scrollLeft, u = d - c;
59
+ let g = 0;
60
+ u > 0 && (g = parseInt(f / u * (l - a), 10)), g < 0 && (g = 0);
61
+ const S = l - a;
62
+ g > S && (g = S), r.style.left = `${g}px`, Y.log(g), e(this, p).left.disabled = g === 0, e(this, p).right.disabled = g >= S - 1;
63
63
  }, "refresh"));
64
- u(this, P, /* @__PURE__ */ h((t) => {
64
+ b(this, P, /* @__PURE__ */ h((t) => {
65
65
  if (!e(this, p)) return !1;
66
66
  const s = e(this, p).container, n = s.querySelector("table");
67
67
  if (!n) return !1;
68
68
  const r = e(this, p).track.getBoundingClientRect(), o = e(this, p).thumb.clientWidth;
69
- let a = t;
70
- a < 0 && (a = 0);
69
+ let c = t;
70
+ c < 0 && (c = 0);
71
71
  const d = r.width - o;
72
- a > d && (a = d), a = parseInt(a, 10), e(this, p).thumb.style.left = `${a}px`, e(this, p).left.disabled = a === 0, e(this, p).right.disabled = a >= d - 1;
73
- const l = s.clientWidth, c = n.scrollWidth;
74
- let f = d > 0 ? -a * (c - l) / d : 0;
75
- return -f > c - l && (f = -(c - l)), -f + 5 > c - l && (f = -(c - l)), l >= c && (f = 0), n.style.transform = `translateX(${f}px)`, a > 0 && a < d - 1;
72
+ c > d && (c = d), c = parseInt(c, 10), e(this, p).thumb.style.left = `${c}px`, e(this, p).left.disabled = c === 0, e(this, p).right.disabled = c >= d - 1;
73
+ const l = s.clientWidth, a = n.scrollWidth;
74
+ let f = d > 0 ? -c * (a - l) / d : 0;
75
+ return -f > a - l && (f = -(a - l)), -f + 5 > a - l && (f = -(a - l)), l >= a && (f = 0), n.style.transform = `translateX(${f}px)`, c > 0 && c < d - 1;
76
76
  }, "#thumbMoveTo"));
77
- u(this, se, /* @__PURE__ */ h(() => {
77
+ b(this, se, /* @__PURE__ */ h(() => {
78
78
  const t = /* @__PURE__ */ h((n) => {
79
79
  clearInterval(e(this, B)), clearInterval(e(this, D));
80
80
  const r = parseInt(e(this, p).thumb.style.left || 0, 10);
@@ -101,10 +101,10 @@ const ke = class ke extends HTMLElement {
101
101
  }), e(this, p).thumb.addEventListener("mousedown", (n) => {
102
102
  if (n.button !== 0) return;
103
103
  n.stopPropagation(), n.preventDefault(), y(this, O, !0), this.shiftX = n.clientX - e(this, p).thumb.getBoundingClientRect().left;
104
- const r = /* @__PURE__ */ h((a) => {
104
+ const r = /* @__PURE__ */ h((c) => {
105
105
  if (!e(this, O)) return;
106
106
  const d = e(this, p).track.getBoundingClientRect();
107
- e(this, P).call(this, a.clientX - d.left - this.shiftX);
107
+ e(this, P).call(this, c.clientX - d.left - this.shiftX);
108
108
  }, "onMouseMove"), o = /* @__PURE__ */ h(() => {
109
109
  y(this, O, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
110
110
  }, "onMouseUp");
@@ -203,20 +203,20 @@ customElements.get("nine-table-hscrollbar") || customElements.define("nine-table
203
203
  var M, _, R, $, I, H, ne, re, oe, le;
204
204
  const Le = class Le {
205
205
  constructor(i) {
206
- u(this, M);
207
- u(this, _, []);
208
- u(this, R, null);
209
- u(this, $, null);
210
- u(this, I, 0);
211
- u(this, H, 0);
212
- x(this, "getRowHeight", /* @__PURE__ */ h(() => e(this, R), "getRowHeight"));
213
- u(this, ne, /* @__PURE__ */ h(() => {
206
+ b(this, M);
207
+ b(this, _, []);
208
+ b(this, R, null);
209
+ b(this, $, null);
210
+ b(this, I, 0);
211
+ b(this, H, 0);
212
+ v(this, "getRowHeight", /* @__PURE__ */ h(() => e(this, R), "getRowHeight"));
213
+ b(this, ne, /* @__PURE__ */ h(() => {
214
214
  e(this, re).call(this);
215
215
  }, "#init"));
216
216
  /**
217
217
  * 🎯 뷰포트 크기 λ³€ν™” μ‹œμ μ— 높이 계산 및 ν•„μš”ν•œ ν–‰ 개수 산정·캐싱을 μ™„κ²°
218
218
  */
219
- u(this, re, /* @__PURE__ */ h(() => {
219
+ b(this, re, /* @__PURE__ */ h(() => {
220
220
  !e(this, M) || !(e(this, M) instanceof HTMLElement) || (y(this, $, new ResizeObserver((i) => {
221
221
  for (const t of i) {
222
222
  const s = t.target;
@@ -226,14 +226,14 @@ const Le = class Le {
226
226
  if (n > 0) {
227
227
  const r = s.clientHeight || s.getBoundingClientRect().height || n;
228
228
  let o = 0;
229
- const a = s.querySelector(".ng-container-body") || s, d = a.querySelector("thead"), l = a.querySelector("tfoot");
229
+ const c = s.querySelector(".ng-container-body") || s, d = c.querySelector("thead"), l = c.querySelector("tfoot");
230
230
  d && (o += d.offsetHeight || d.getBoundingClientRect().height), l && (o += l.offsetHeight || l.getBoundingClientRect().height);
231
- const c = Math.max(r - o, 100);
232
- if (e(this, I) !== c && (y(this, I, c), e(this, R) !== null)) {
231
+ const a = Math.max(r - o, 100);
232
+ if (e(this, I) !== a && (y(this, I, a), e(this, R) !== null)) {
233
233
  const f = Math.ceil(e(this, I) / e(this, R));
234
- y(this, H, f + 20), Y.log(`[RowManager] Resized. Height: ${e(this, I)}px | Target Rows: ${e(this, H)}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
235
- const b = s.querySelector(g);
236
- b && b.querySelector("tbody") && e(this, le).call(this, b);
234
+ y(this, H, f + 20), Y.log(`[RowManager] Resized. Height: ${e(this, I)}px | Target Rows: ${e(this, H)}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((u) => {
235
+ const g = s.querySelector(u);
236
+ g && g.querySelector("tbody") && e(this, le).call(this, g);
237
237
  });
238
238
  }
239
239
  }
@@ -241,12 +241,12 @@ const Le = class Le {
241
241
  })), e(this, $).observe(e(this, M)));
242
242
  }, "#initResizeObserver"));
243
243
  // 🎯 ν…œν”Œλ¦Ώ μΆ”μΆœ, 높이 μΈ‘μ •, 초기 λ Œλ”λ§μ„ μˆœμ„œμ— 맞게 λ‚΄λΆ€μ—μ„œ 일괄 처리
244
- x(this, "initialize", /* @__PURE__ */ h((i) => {
244
+ v(this, "initialize", /* @__PURE__ */ h((i) => {
245
245
  Y.log(i);
246
246
  const t = e(this, M).querySelector(".ng-container-body"), s = i.querySelector("tbody"), n = Array.from(s.querySelectorAll("tr"));
247
247
  y(this, _, n.map((r) => r.cloneNode(!0))), y(this, R, null), e(this, oe).call(this, t);
248
248
  }, "initialize"));
249
- u(this, oe, /* @__PURE__ */ h((i) => {
249
+ b(this, oe, /* @__PURE__ */ h((i) => {
250
250
  if (e(this, R) !== null && e(this, R) > 0)
251
251
  return e(this, R);
252
252
  if (e(this, _).length === 0)
@@ -258,13 +258,13 @@ const Le = class Le {
258
258
  e(this, _).forEach((f) => {
259
259
  n.appendChild(f.cloneNode(!0));
260
260
  }), s ? s.before(n) : t.appendChild(n);
261
- const r = i.closest("nine-table-sheet"), o = r ? r.style.display : "", a = r ? r.style.visibility : "", d = r ? r.style.position : "";
261
+ const r = i.closest("nine-table-sheet"), o = r ? r.style.display : "", c = r ? r.style.visibility : "", d = r ? r.style.position : "";
262
262
  r && (r.style.display === "none" || window.getComputedStyle(r).display === "none") && (r.style.display = "block", r.style.visibility = "hidden", r.style.position = "absolute");
263
263
  let l = 0;
264
- const c = t.querySelectorAll("tr:not(.nodata)");
265
- if (c.forEach((f, g) => {
264
+ const a = t.querySelectorAll("tr:not(.nodata)");
265
+ if (a.forEach((f, u) => {
266
266
  l += f.offsetHeight || f.getBoundingClientRect().height;
267
- }), c.forEach((f) => f.remove()), r && (r.style.display = o, r.style.visibility = a, r.style.position = d), y(this, R, l), e(this, I) > 0) {
267
+ }), a.forEach((f) => f.remove()), r && (r.style.display = o, r.style.visibility = c, r.style.position = d), y(this, R, l), e(this, I) > 0) {
268
268
  const f = Math.ceil(e(this, I) / e(this, R));
269
269
  y(this, H, f + 20);
270
270
  } else
@@ -287,19 +287,19 @@ const Le = class Le {
287
287
  /**
288
288
  * 🎯 μΊμ‹œλœ ν–‰ 개수λ₯Ό κ³§λ°”λ‘œ κ°€μ Έμ™€μ„œ TR λΌˆλŒ€ μ£Όμž… (쀑볡 계산 제거)
289
289
  */
290
- u(this, le, /* @__PURE__ */ h((i) => {
290
+ b(this, le, /* @__PURE__ */ h((i) => {
291
291
  if (e(this, _).length === 0) return;
292
292
  const t = i.querySelector("tbody.bindable") || i.querySelector("tbody");
293
293
  if (!t) return;
294
294
  t.querySelectorAll("tr:not(.nodata)").forEach((o) => o.remove());
295
295
  const s = t.querySelector("tr.nodata"), n = document.createDocumentFragment(), r = e(this, H);
296
296
  for (let o = 0; o < r; o++)
297
- e(this, _).forEach((a) => {
298
- n.appendChild(a.cloneNode(!0));
297
+ e(this, _).forEach((c) => {
298
+ n.appendChild(c.cloneNode(!0));
299
299
  });
300
300
  s ? s.before(n) : t.appendChild(n), console.log(`[RowManager] Rendered ${r} sets into DOM.`);
301
301
  }, "#renderRows"));
302
- x(this, "destroy", /* @__PURE__ */ h(() => {
302
+ v(this, "destroy", /* @__PURE__ */ h(() => {
303
303
  e(this, $) && (e(this, $).disconnect(), y(this, $, null));
304
304
  }, "destroy"));
305
305
  y(this, M, i), e(this, ne).call(this);
@@ -314,39 +314,39 @@ var A, F, G, U, ae, ce;
314
314
  const j = class j extends HTMLElement {
315
315
  constructor() {
316
316
  super();
317
- u(this, A, null);
318
- u(this, F);
317
+ b(this, A, null);
318
+ b(this, F);
319
319
  /**
320
320
  * 🎯 2차원 μ…€ 격자 인덱슀λ₯Ό κ³„μ‚°ν•˜μ—¬ 병합(`rowSpan`/`colSpan`) μ…€μ˜ μ ˆλŒ€ 컬럼 μœ„μΉ˜λ₯Ό λΆ€μ—¬
321
321
  */
322
- u(this, G, /* @__PURE__ */ h((t, s) => {
322
+ b(this, G, /* @__PURE__ */ h((t, s) => {
323
323
  const n = Array.from(t.querySelectorAll(s + " tr")), r = Array.from(t.querySelectorAll(s + " th," + s + " td")), o = n.length;
324
324
  if (o === 0 || r.length === 0) return;
325
- let a = 0;
325
+ let c = 0;
326
326
  r.forEach((l) => {
327
- a += l.colSpan || 1;
327
+ c += l.colSpan || 1;
328
328
  });
329
- const d = Array.from(Array(o), () => Array(a).fill(null));
329
+ const d = Array.from(Array(o), () => Array(c).fill(null));
330
330
  n.forEach((l) => {
331
- const c = l.sectionRowIndex;
331
+ const a = l.sectionRowIndex;
332
332
  let f = 0;
333
- Array.from(l.querySelectorAll("th,td")).forEach((g) => {
334
- for (let v = 0; v < d[c].length; v++)
335
- if (d[c][v] === null) {
336
- f = v;
333
+ Array.from(l.querySelectorAll("th,td")).forEach((u) => {
334
+ for (let x = 0; x < d[a].length; x++)
335
+ if (d[a][x] === null) {
336
+ f = x;
337
337
  break;
338
338
  }
339
- const b = g.rowSpan || 1, S = g.colSpan || 1;
340
- for (let v = 0; v < b; v++)
339
+ const g = u.rowSpan || 1, S = u.colSpan || 1;
340
+ for (let x = 0; x < g; x++)
341
341
  for (let L = 0; L < S; L++)
342
- c + v < o && f + L < a && (d[c + v][f + L] = v === 0 && L === 0 ? "1" : "0");
342
+ a + x < o && f + L < c && (d[a + x][f + L] = x === 0 && L === 0 ? "1" : "0");
343
343
  });
344
344
  }), n.forEach((l) => {
345
- const c = l.sectionRowIndex;
345
+ const a = l.sectionRowIndex;
346
346
  Array.from(l.querySelectorAll("th,td")).forEach((f) => {
347
- for (let g = 0; g < d[c].length; g++)
348
- if (d[c][g] === "1") {
349
- f.dataset.col = g, d[c][g] = "0";
347
+ for (let u = 0; u < d[a].length; u++)
348
+ if (d[a][u] === "1") {
349
+ f.dataset.col = u, d[a][u] = "0";
350
350
  break;
351
351
  }
352
352
  });
@@ -355,72 +355,74 @@ const j = class j extends HTMLElement {
355
355
  /**
356
356
  * 🎯 원본 ν…Œμ΄λΈ”μ„ λΆ„μ„ν•˜μ—¬ κ³ μ • 컬럼 μ˜μ—­λ³„(left, body, right)둜 μ™„λ²½ν•˜κ²Œ μͺΌκ°œμ§„ ν…Œμ΄λΈ” 생성
357
357
  */
358
- u(this, U, /* @__PURE__ */ h((t, s) => {
358
+ b(this, U, /* @__PURE__ */ h((t, s) => {
359
359
  const n = t.cloneNode(!0), r = n.querySelector("colgroup");
360
360
  if (!r) return n;
361
- const o = Array.from(r.querySelectorAll("col")), a = [];
361
+ const o = Array.from(r.querySelectorAll("col")), c = [];
362
362
  return o.forEach((d, l) => {
363
- const c = d.getAttribute("fixed");
363
+ const a = d.getAttribute("fixed");
364
364
  let f = !1;
365
- s === "left" ? f = c === "left" : s === "right" ? f = c === "right" : f = c !== "left" && c !== "right", f || a.push(l);
366
- }), a.reverse().forEach((d) => {
365
+ s === "left" ? f = a === "left" : s === "right" ? f = a === "right" : f = a !== "left" && a !== "right", f || c.push(l);
366
+ }), c.reverse().forEach((d) => {
367
367
  o[d] && o[d].remove(), n.querySelectorAll("tr").forEach((l) => {
368
- Array.from(l.querySelectorAll("th, td")).forEach((f) => {
369
- parseInt(f.dataset.col, 10) === d && f.remove();
368
+ let a = 0;
369
+ Array.from(l.querySelectorAll("th, td")).forEach((u) => {
370
+ const g = u.colSpan || 1, S = a, x = a + g - 1;
371
+ d >= S && d <= x && (g === 1 ? u.remove() : u.colSpan = g - 1), a += g;
370
372
  });
371
373
  });
372
374
  }), n;
373
375
  }, "#createSplitTable"));
374
- x(this, "generate", /* @__PURE__ */ h((t) => {
376
+ v(this, "generate", /* @__PURE__ */ h((t) => {
375
377
  if (!t) return;
376
378
  const s = /* @__PURE__ */ h((l) => {
377
- const c = /* @__PURE__ */ h((g) => {
378
- if (g.querySelector("colgroup")) return;
379
- const b = g.querySelector("tbody tr") || g.querySelector("tr"), S = b ? b.querySelectorAll("th, td").length : 1, v = document.createElement("colgroup"), L = Math.max(Math.floor(g.clientWidth / S), 100);
379
+ const a = /* @__PURE__ */ h((u) => {
380
+ if (u.querySelector("colgroup")) return;
381
+ const g = u.querySelector("tbody tr") || u.querySelector("tr"), S = g ? g.querySelectorAll("th, td").length : 1, x = document.createElement("colgroup"), L = Math.max(Math.floor(u.clientWidth / S), 100);
380
382
  for (let $e = 0; $e < S; $e++) {
381
383
  const We = document.createElement("col");
382
- We.setAttribute("width", L), v.appendChild(We);
384
+ We.setAttribute("width", L), x.appendChild(We);
383
385
  }
384
- g.prepend(v);
385
- }, "ensureColgroup"), f = /* @__PURE__ */ h((g) => {
386
- if (g.querySelector("thead")) return;
387
- const b = document.createElement("thead"), S = g.querySelector("colgroup");
388
- S ? S.after(b) : g.prepend(b);
386
+ u.prepend(x);
387
+ }, "ensureColgroup"), f = /* @__PURE__ */ h((u) => {
388
+ if (u.querySelector("thead")) return;
389
+ const g = document.createElement("thead"), S = u.querySelector("colgroup");
390
+ S ? S.after(g) : u.prepend(g);
389
391
  }, "ensureThead");
390
- return c(l), f(l), l.classList.add("nine-table-element"), l;
392
+ return a(l), f(l), l.classList.add("nine-table-element"), l;
391
393
  }, "initializeTable"), n = t.cloneNode(!0);
392
- y(this, A, s(n)), e(this, A).style.display = "table", e(this, G).call(this, e(this, A), "thead"), e(this, G).call(this, e(this, A), "tbody"), Array.from(e(this, A).querySelectorAll("colgroup col")).forEach((l, c) => {
394
+ y(this, A, s(n)), e(this, A).style.display = "table", e(this, G).call(this, e(this, A), "thead"), e(this, G).call(this, e(this, A), "tbody"), Array.from(e(this, A).querySelectorAll("colgroup col")).forEach((l, a) => {
393
395
  const f = l.getAttribute("fixed");
394
- f && e(this, A).querySelectorAll(`[data-col="${c}"]`).forEach((g) => {
395
- g.setAttribute("fixed", f);
396
+ f && e(this, A).querySelectorAll(`[data-col="${a}"]`).forEach((u) => {
397
+ u.setAttribute("fixed", f);
396
398
  });
397
399
  }), Y.log(e(this, A));
398
- const o = this.querySelector(".ng-container-left"), a = this.querySelector(".ng-container-body"), d = this.querySelector(".ng-container-right");
399
- if (a) {
400
+ const o = this.querySelector(".ng-container-left"), c = this.querySelector(".ng-container-body"), d = this.querySelector(".ng-container-right");
401
+ if (c) {
400
402
  const l = e(this, U).call(this, e(this, A), null);
401
- a.innerHTML = "", a.appendChild(l), e(this, F).initialize(e(this, A));
403
+ c.innerHTML = "", c.appendChild(l), e(this, F).initialize(e(this, A));
402
404
  }
403
405
  if (o) {
404
406
  const l = e(this, U).call(this, e(this, A), "left");
405
- let c = 0;
406
- l.querySelectorAll("col").forEach((g) => {
407
- const b = parseInt(g.getAttribute("width"), 10);
408
- isNaN(b) || (c += b);
407
+ let a = 0;
408
+ l.querySelectorAll("col").forEach((u) => {
409
+ const g = parseInt(u.getAttribute("width"), 10);
410
+ isNaN(g) || (a += g);
409
411
  }), o.innerHTML = "", o.appendChild(l);
410
- const f = c > 0 ? c : 0;
412
+ const f = a > 0 ? a : 0;
411
413
  o.style.flex = `0 0 ${f}px`, o.style.width = `${f}px`;
412
414
  }
413
415
  if (d) {
414
416
  const l = e(this, U).call(this, e(this, A), "right");
415
- let c = 0;
416
- l.querySelectorAll("col").forEach((g) => {
417
- const b = parseInt(g.getAttribute("width"), 10);
418
- isNaN(b) || (c += b);
417
+ let a = 0;
418
+ l.querySelectorAll("col").forEach((u) => {
419
+ const g = parseInt(u.getAttribute("width"), 10);
420
+ isNaN(g) || (a += g);
419
421
  }), d.innerHTML = "", d.appendChild(l);
420
- const f = c > 0 ? c : 0;
422
+ const f = a > 0 ? a : 0;
421
423
  d.style.flex = `0 0 ${f}px`, d.style.width = `${f}px`;
422
424
  }
423
- a && a.addEventListener("scroll", () => {
425
+ c && c.addEventListener("scroll", () => {
424
426
  var l;
425
427
  (l = this.querySelector("nine-table-hscrollbar")) == null || l.refresh();
426
428
  }), setTimeout(() => {
@@ -428,28 +430,28 @@ const j = class j extends HTMLElement {
428
430
  (l = this.querySelector("nine-table-hscrollbar")) == null || l.refresh();
429
431
  }, 0);
430
432
  }, "generate"));
431
- x(this, "getRowHeight", /* @__PURE__ */ h(() => e(this, F).getRowHeight(), "getRowHeight"));
432
- x(this, "scrollToX", /* @__PURE__ */ h((t) => {
433
+ v(this, "getRowHeight", /* @__PURE__ */ h(() => e(this, F).getRowHeight(), "getRowHeight"));
434
+ v(this, "scrollToX", /* @__PURE__ */ h((t) => {
433
435
  const s = this.querySelector(".ng-container-body");
434
436
  s && (s.scrollLeft = t);
435
437
  }, "scrollToX"));
436
- x(this, "scrollToY", /* @__PURE__ */ h((t) => {
438
+ v(this, "scrollToY", /* @__PURE__ */ h((t) => {
437
439
  const s = this.querySelector(".ng-container-body");
438
440
  s && (s.scrollTop = t);
439
441
  }, "scrollToY"));
440
- u(this, ae, /* @__PURE__ */ h(() => {
442
+ b(this, ae, /* @__PURE__ */ h(() => {
441
443
  const t = /* @__PURE__ */ h(() => {
442
- var c, f, g;
444
+ var a, f, u;
443
445
  const s = this.querySelector(".ng-container-left table"), n = this.querySelector(".ng-container-body table"), r = this.querySelector(".ng-container-right table");
444
446
  if (!n) return;
445
- const o = s ? Array.from(s.querySelectorAll("tr")) : [], a = Array.from(n.querySelectorAll("tr")), d = r ? Array.from(r.querySelectorAll("tr")) : [], l = Math.max(o.length, a.length, d.length);
446
- for (let b = 0; b < l; b++) {
447
+ const o = s ? Array.from(s.querySelectorAll("tr")) : [], c = Array.from(n.querySelectorAll("tr")), d = r ? Array.from(r.querySelectorAll("tr")) : [], l = Math.max(o.length, c.length, d.length);
448
+ for (let g = 0; g < l; g++) {
447
449
  const S = [
448
- ((c = o[b]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
449
- ((f = a[b]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
450
- ((g = d[b]) == null ? void 0 : g.getBoundingClientRect().height) || 0
451
- ], v = Math.max(...S);
452
- v > 0 && (o[b] && (o[b].style.height = `${v}px`), a[b] && (a[b].style.height = `${v}px`), d[b] && (d[b].style.height = `${v}px`));
450
+ ((a = o[g]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
451
+ ((f = c[g]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
452
+ ((u = d[g]) == null ? void 0 : u.getBoundingClientRect().height) || 0
453
+ ], x = Math.max(...S);
454
+ x > 0 && (o[g] && (o[g].style.height = `${x}px`), c[g] && (c[g].style.height = `${x}px`), d[g] && (d[g].style.height = `${x}px`));
453
455
  }
454
456
  }, "syncRowHeights");
455
457
  e(this, ce).call(this), requestAnimationFrame(() => {
@@ -459,7 +461,7 @@ const j = class j extends HTMLElement {
459
461
  n.attributeName === "class" && this.classList.contains("active") && t();
460
462
  }).observe(this, { attributes: !0 });
461
463
  }, "#init"));
462
- u(this, ce, /* @__PURE__ */ h(() => {
464
+ b(this, ce, /* @__PURE__ */ h(() => {
463
465
  const t = j.SCROLLBAR_SIZE;
464
466
  this.innerHTML = `
465
467
  <style>
@@ -592,14 +594,14 @@ const j = class j extends HTMLElement {
592
594
  this.innerHTML = "", Y.log("NineTableSheet destroyed.");
593
595
  }
594
596
  };
595
- A = new WeakMap(), F = new WeakMap(), G = new WeakMap(), U = new WeakMap(), ae = new WeakMap(), ce = new WeakMap(), h(j, "NineTableSheet"), x(j, "SCROLLBAR_SIZE", 16);
597
+ A = new WeakMap(), F = new WeakMap(), G = new WeakMap(), U = new WeakMap(), ae = new WeakMap(), ce = new WeakMap(), h(j, "NineTableSheet"), v(j, "SCROLLBAR_SIZE", 16);
596
598
  let te = j;
597
599
  customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", te);
598
600
  var he, J;
599
601
  const Ce = class Ce extends HTMLElement {
600
602
  constructor() {
601
603
  super();
602
- u(this, he, /* @__PURE__ */ h(() => {
604
+ b(this, he, /* @__PURE__ */ h(() => {
603
605
  var t;
604
606
  (t = this.querySelector(".nine-tab-bar")) == null || t.addEventListener("click", (s) => {
605
607
  var o;
@@ -607,35 +609,35 @@ const Ce = class Ce extends HTMLElement {
607
609
  e(this, J).call(this, r, n);
608
610
  }), e(this, J).call(this, 0, !1);
609
611
  }, "#init"));
610
- u(this, J, /* @__PURE__ */ h((t, s = !1) => {
612
+ b(this, J, /* @__PURE__ */ h((t, s = !1) => {
611
613
  const n = /* @__PURE__ */ h(() => {
612
- const c = Array.from(this.querySelectorAll("nine-table-sheet"));
613
- Array.from(this.querySelectorAll("nine-splitter")).forEach((b) => b.style.setProperty("display", "none"));
614
- const g = c.filter((b) => b.classList.contains("active"));
615
- g.length < 2 || g.forEach((b) => {
616
- const S = parseInt(b.getAttribute("data-index"), 10), v = this.querySelector(`nine-splitter[data-split-index="${S}"]`), L = c[S + 1];
617
- v && L && L.classList.contains("active") && v.style.setProperty("display", "flex");
614
+ const a = Array.from(this.querySelectorAll("nine-table-sheet"));
615
+ Array.from(this.querySelectorAll("nine-splitter")).forEach((g) => g.style.setProperty("display", "none"));
616
+ const u = a.filter((g) => g.classList.contains("active"));
617
+ u.length < 2 || u.forEach((g) => {
618
+ const S = parseInt(g.getAttribute("data-index"), 10), x = this.querySelector(`nine-splitter[data-split-index="${S}"]`), L = a[S + 1];
619
+ x && L && L.classList.contains("active") && x.style.setProperty("display", "flex");
618
620
  });
619
- }, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = r.querySelectorAll(".nine-tab-item"), d = o.querySelectorAll("nine-table-sheet");
620
- if (!a[t]) return;
621
+ }, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), c = r.querySelectorAll(".nine-tab-item"), d = o.querySelectorAll("nine-table-sheet");
622
+ if (!c[t]) return;
621
623
  if (!s)
622
- a.forEach((c, f) => {
623
- c.classList.toggle("active", f === t);
624
- }), d.forEach((c, f) => {
625
- const g = f === t;
626
- c.classList.toggle("active", g), c.style.flex = g ? "1 1 100%" : "";
624
+ c.forEach((a, f) => {
625
+ a.classList.toggle("active", f === t);
626
+ }), d.forEach((a, f) => {
627
+ const u = f === t;
628
+ a.classList.toggle("active", u), a.style.flex = u ? "1 1 100%" : "";
627
629
  });
628
630
  else {
629
- const c = a[t], f = r.querySelectorAll(".nine-tab-item.active");
630
- if (c.classList.contains("active") && f.length <= 1)
631
+ const a = c[t], f = r.querySelectorAll(".nine-tab-item.active");
632
+ if (a.classList.contains("active") && f.length <= 1)
631
633
  return;
632
- c.classList.toggle("active");
633
- const g = o.querySelector(`nine-table-sheet[data-index="${t}"]`);
634
- g && (g.classList.toggle("active"), g.classList.contains("active") || (g.style.flex = ""));
634
+ a.classList.toggle("active");
635
+ const u = o.querySelector(`nine-table-sheet[data-index="${t}"]`);
636
+ u && (u.classList.toggle("active"), u.classList.contains("active") || (u.style.flex = ""));
635
637
  }
636
638
  const l = o.querySelectorAll("nine-table-sheet.active");
637
- l == null || l.forEach((c) => {
638
- c.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
639
+ l == null || l.forEach((a) => {
640
+ a.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
639
641
  }), n();
640
642
  }, "#switchSheet"));
641
643
  }
@@ -649,24 +651,24 @@ customElements.get("nine-table-sheets") || customElements.define("nine-table-she
649
651
  var E, de, Q, fe;
650
652
  const _e = class _e {
651
653
  constructor(i) {
652
- u(this, E);
653
- u(this, de, /* @__PURE__ */ h(() => {
654
+ b(this, E);
655
+ b(this, de, /* @__PURE__ */ h(() => {
654
656
  e(this, fe).call(this), new ResizeObserver((i) => {
655
657
  for (let t of i)
656
658
  e(this, E).getAttribute("auto-height") === "true" && e(this, Q).call(this);
657
659
  }).observe(e(this, E));
658
660
  }, "#init"));
659
- u(this, Q, /* @__PURE__ */ h(() => {
661
+ b(this, Q, /* @__PURE__ */ h(() => {
660
662
  var d, l;
661
663
  const i = Array.from(e(this, E).shadowRoot.querySelectorAll("nine-table-sheet.active"));
662
664
  if (i.length === 0) return;
663
- const t = parseInt(e(this, E).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((c) => c.getRowHeight())), n = (d = e(this, E).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : d.getBoundingClientRect().height, r = (l = e(this, E).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = te.SCROLLBAR_SIZE, a = t * s + n + r + o;
664
- e(this, E).style.height = `${a}px`;
665
+ const t = parseInt(e(this, E).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((a) => a.getRowHeight())), n = (d = e(this, E).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : d.getBoundingClientRect().height, r = (l = e(this, E).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = te.SCROLLBAR_SIZE, c = t * s + n + r + o;
666
+ e(this, E).style.height = `${c}px`;
665
667
  }, "#applyAutoHeight"));
666
- u(this, fe, /* @__PURE__ */ h(() => {
668
+ b(this, fe, /* @__PURE__ */ h(() => {
667
669
  const t = Array.from(e(this, E).children).filter((d) => d.tagName === "TABLE"), s = e(this, E).getAttribute("auto-height") === "true", n = t.length, r = t.map((d, l) => {
668
- const f = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, g = l < n - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
669
- return f + g;
670
+ const f = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, u = l < n - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
671
+ return f + u;
670
672
  }).join(""), o = t.map((d, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
671
673
  e(this, E).shadowRoot.innerHTML = `
672
674
  <style>
@@ -767,8 +769,8 @@ const _e = class _e {
767
769
  </nine-table-body>
768
770
  <nine-table-footer></nine-table-footer>
769
771
  `;
770
- const a = e(this, E).shadowRoot.querySelectorAll("nine-table-sheet");
771
- a == null || a.forEach((d, l) => {
772
+ const c = e(this, E).shadowRoot.querySelectorAll("nine-table-sheet");
773
+ c == null || c.forEach((d, l) => {
772
774
  t[l] && setTimeout(() => {
773
775
  d.generate(t[l]), s && e(this, Q).call(this);
774
776
  });
@@ -782,9 +784,9 @@ let Se = _e;
782
784
  var W, V;
783
785
  const Ie = class Ie {
784
786
  constructor(i) {
785
- u(this, W);
786
- u(this, V, -1);
787
- x(this, "count", /* @__PURE__ */ h(() => e(this, W).rawRecords.length, "count"));
787
+ b(this, W);
788
+ b(this, V, -1);
789
+ v(this, "count", /* @__PURE__ */ h(() => e(this, W).rawRecords.length, "count"));
788
790
  y(this, W, i);
789
791
  }
790
792
  get at() {
@@ -805,13 +807,13 @@ let Ee = Ie;
805
807
  var T, w, q, K, ue, z, ge, ee, be, ye, Z;
806
808
  const k = class k {
807
809
  constructor(i, t) {
808
- u(this, T);
809
- u(this, w);
810
- u(this, q, []);
811
- u(this, K, []);
812
- u(this, ue, 0);
813
- u(this, z, []);
814
- u(this, ge, /* @__PURE__ */ h(() => {
810
+ b(this, T);
811
+ b(this, w);
812
+ b(this, q, []);
813
+ b(this, K, []);
814
+ b(this, ue, 0);
815
+ b(this, z, []);
816
+ b(this, ge, /* @__PURE__ */ h(() => {
815
817
  y(this, z, []);
816
818
  const i = e(this, T).template || [];
817
819
  Array.from(i).forEach((t) => {
@@ -821,10 +823,10 @@ const k = class k {
821
823
  t.__ng || (t.__ng = e(this, ee).call(this)), t.__ng.height = e(this, z).slice();
822
824
  });
823
825
  }, "#initialize"));
824
- x(this, "set", /* @__PURE__ */ h((i) => {
826
+ v(this, "set", /* @__PURE__ */ h((i) => {
825
827
  this.clear(), this.add(i, !1);
826
828
  }, "set"));
827
- u(this, ee, /* @__PURE__ */ h(() => ({
829
+ b(this, ee, /* @__PURE__ */ h(() => ({
828
830
  rowState: k.ROW_STATE.EMPTY,
829
831
  deleted: !1,
830
832
  filtered: !1,
@@ -833,39 +835,39 @@ const k = class k {
833
835
  c: {},
834
836
  _: [0, 0, 0, 0, k.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, z).slice(), -1, {}, {}]
835
837
  }), "#getDefaultMeta"));
836
- x(this, "reset", /* @__PURE__ */ h(() => {
838
+ v(this, "reset", /* @__PURE__ */ h(() => {
837
839
  y(this, q, []), y(this, K, []);
838
840
  }, "reset"));
839
- x(this, "clear", /* @__PURE__ */ h(() => {
841
+ v(this, "clear", /* @__PURE__ */ h(() => {
840
842
  var i;
841
843
  e(this, w).rawRecords = [], y(this, q, []), y(this, K, []), (i = e(this, w).viewRecords) != null && i.reset && e(this, w).viewRecords.reset();
842
844
  }, "clear"));
843
- u(this, be, /* @__PURE__ */ h((i) => {
845
+ b(this, be, /* @__PURE__ */ h((i) => {
844
846
  var n;
845
847
  Array.isArray(i) || (i = [i]);
846
848
  const t = typeof ((n = e(this, T).fields) == null ? void 0 : n.get) == "function" ? e(this, T).fields.get() : Object.keys(i[0] || {}), s = [];
847
849
  return i.forEach((r) => {
848
850
  const o = { v: [] };
849
- t.forEach((a) => {
850
- o.v.push(r[a] !== void 0 && r[a] !== null ? r[a] : "");
851
+ t.forEach((c) => {
852
+ o.v.push(r[c] !== void 0 && r[c] !== null ? r[c] : "");
851
853
  }), s.push(o);
852
854
  }), s;
853
855
  }, "#json2Array"));
854
- u(this, ye, /* @__PURE__ */ h((i) => (Array.isArray(i) || (i = [i]), i.forEach((t) => {
856
+ b(this, ye, /* @__PURE__ */ h((i) => (Array.isArray(i) || (i = [i]), i.forEach((t) => {
855
857
  t.__ng = e(this, ee).call(this), t.__ng.rowid = this.nextId, t.__ng.rowState = k.ROW_STATE.INSERT, t.__ng._[0] = t.__ng.rowid;
856
858
  }), i), "#defaultInsert"));
857
- x(this, "add", /* @__PURE__ */ h((i, t = !0) => {
859
+ v(this, "add", /* @__PURE__ */ h((i, t = !0) => {
858
860
  var r;
859
861
  i === void 0 && (i = {});
860
862
  const s = e(this, be).call(this, i);
861
863
  e(this, w).rawRecords = e(this, w).rawRecords.concat(e(this, ye).call(this, s)), this.resetRecords();
862
864
  const n = this.count() - 1;
863
- return t || s.forEach((o, a) => {
864
- const d = e(this, w).rawRecords[n - a];
865
+ return t || s.forEach((o, c) => {
866
+ const d = e(this, w).rawRecords[n - c];
865
867
  d && (d.__ng.rowState = k.ROW_STATE.EMPTY);
866
868
  }), (r = e(this, w).viewRecords) != null && r.reset && e(this, w).viewRecords.reset(), n;
867
869
  }, "add"));
868
- x(this, "delete", /* @__PURE__ */ h((i) => {
870
+ v(this, "delete", /* @__PURE__ */ h((i) => {
869
871
  var s;
870
872
  let t = [];
871
873
  Array.isArray(i) ? t = i : typeof i > "u" ? t = [e(this, w).owner.row.at] : t = [parseInt(i, 10)], t.sort((n, r) => r - n).forEach((n) => {
@@ -877,37 +879,37 @@ const k = class k {
877
879
  }
878
880
  }), this.resetRecords(), (s = e(this, w).viewRecords) != null && s.reset && e(this, w).viewRecords.reset();
879
881
  }, "delete"));
880
- x(this, "setValue", /* @__PURE__ */ h((i, t, s) => {
882
+ v(this, "setValue", /* @__PURE__ */ h((i, t, s) => {
881
883
  var d;
882
884
  i = parseInt(i, 10);
883
885
  const r = (typeof ((d = e(this, T).fields) == null ? void 0 : d.get) == "function" ? e(this, T).fields.get() : []).indexOf(t);
884
886
  if (r < 0) return;
885
887
  const o = this.getValidData()[i];
886
888
  if (!o) return;
887
- const a = o.v[r];
888
- a !== s && o.__ng.rowState !== k.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(t) || (o.__ng.o[t] = a), o.__ng.rowState = k.ROW_STATE.UPDATE), o.v[r] = s, e(this, w).owner.refreshData && e(this, w).owner.refreshData(i);
889
+ const c = o.v[r];
890
+ c !== s && o.__ng.rowState !== k.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(t) || (o.__ng.o[t] = c), o.__ng.rowState = k.ROW_STATE.UPDATE), o.v[r] = s, e(this, w).owner.refreshData && e(this, w).owner.refreshData(i);
889
891
  }, "setValue"));
890
- x(this, "resetRecords", /* @__PURE__ */ h(() => {
892
+ v(this, "resetRecords", /* @__PURE__ */ h(() => {
891
893
  y(this, K, e(this, w).rawRecords.filter((i) => !i.__ng.deleted)), y(this, q, e(this, w).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), e(this, w).rawRecords.forEach((i, t) => {
892
894
  i.__ng.rowidx = t;
893
895
  }), e(this, q).forEach((i, t) => {
894
896
  i.__ng.i = t;
895
897
  });
896
898
  }, "resetRecords"));
897
- x(this, "getValidData", /* @__PURE__ */ h(() => (e(this, q).length === 0 && e(this, w).rawRecords.length > 0 && this.resetRecords(), e(this, q)), "getValidData"));
898
- u(this, Z, /* @__PURE__ */ h((i) => {
899
+ v(this, "getValidData", /* @__PURE__ */ h(() => (e(this, q).length === 0 && e(this, w).rawRecords.length > 0 && this.resetRecords(), e(this, q)), "getValidData"));
900
+ b(this, Z, /* @__PURE__ */ h((i) => {
899
901
  var s;
900
902
  if (!i) return i;
901
903
  const t = typeof ((s = e(this, T).fields) == null ? void 0 : s.get) == "function" ? e(this, T).fields.get() : [];
902
904
  return Array.isArray(i) ? i.filter((n) => !n.__ng.deleted).map((n) => {
903
905
  const r = {};
904
- return t.forEach((o, a) => {
905
- r[o] = n.v ? n.v[a] : n[o];
906
+ return t.forEach((o, c) => {
907
+ r[o] = n.v ? n.v[c] : n[o];
906
908
  }), r.__ng = n.__ng, r;
907
909
  }) : i;
908
910
  }, "#conv2"));
909
- x(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
910
- x(this, "get", /* @__PURE__ */ h((i, t) => {
911
+ v(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
912
+ v(this, "get", /* @__PURE__ */ h((i, t) => {
911
913
  var r;
912
914
  const s = this.getValidData();
913
915
  if (!s || s.length <= 0) return;
@@ -939,7 +941,7 @@ const k = class k {
939
941
  }
940
942
  };
941
943
  T = new WeakMap(), w = new WeakMap(), q = new WeakMap(), K = new WeakMap(), ue = new WeakMap(), z = new WeakMap(), ge = new WeakMap(), ee = new WeakMap(), be = new WeakMap(), ye = new WeakMap(), Z = new WeakMap(), h(k, "ngData"), // 🎯 ν–‰ μƒνƒœ μ •μ˜ μƒμˆ˜λ₯Ό 클래슀 λ‚΄λΆ€λ‘œ λ‚΄μž¬ν™”
942
- x(k, "ROW_STATE", {
944
+ v(k, "ROW_STATE", {
943
945
  EMPTY: "EMPTY",
944
946
  NORMAL: "NORMAL",
945
947
  INSERT: "INSERT",
@@ -973,8 +975,8 @@ const Me = class Me extends HTMLElement {
973
975
  constructor() {
974
976
  super();
975
977
  //#created = false;
976
- u(this, X);
977
- u(this, pe);
978
+ b(this, X);
979
+ b(this, pe);
978
980
  this.attachShadow({ mode: "open" }), y(this, X, new Ae(this));
979
981
  }
980
982
  connectedCallback() {