@ninebone/table 0.0.829 → 0.0.831

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,51 +1,51 @@
1
- var ms = Object.defineProperty;
2
- var xs = (T) => {
3
- throw TypeError(T);
1
+ var xs = Object.defineProperty;
2
+ var ws = (C) => {
3
+ throw TypeError(C);
4
4
  };
5
- var Rs = (T, r, e) => r in T ? ms(T, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : T[r] = e;
6
- var h = (T, r) => ms(T, "name", { value: r, configurable: !0 });
7
- var E = (T, r, e) => Rs(T, typeof r != "symbol" ? r + "" : r, e), qe = (T, r, e) => r.has(T) || xs("Cannot " + e);
8
- var t = (T, r, e) => (qe(T, r, "read from private field"), e ? e.call(T) : r.get(T)), d = (T, r, e) => r.has(T) ? xs("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(T) : r.set(T, e), y = (T, r, e, s) => (qe(T, r, "write to private field"), s ? s.call(T, e) : r.set(T, e), e), Y = (T, r, e) => (qe(T, r, "access private method"), e);
9
- var ws = (T, r, e, s) => ({
5
+ var As = (C, s, e) => s in C ? xs(C, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : C[s] = e;
6
+ var d = (C, s) => xs(C, "name", { value: s, configurable: !0 });
7
+ var q = (C, s, e) => As(C, typeof s != "symbol" ? s + "" : s, e), Ee = (C, s, e) => s.has(C) || ws("Cannot " + e);
8
+ var t = (C, s, e) => (Ee(C, s, "read from private field"), e ? e.call(C) : s.get(C)), h = (C, s, e) => s.has(C) ? ws("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(C) : s.set(C, e), p = (C, s, e, r) => (Ee(C, s, "write to private field"), r ? r.call(C, e) : s.set(C, e), e), j = (C, s, e) => (Ee(C, s, "access private method"), e);
9
+ var vs = (C, s, e, r) => ({
10
10
  set _(n) {
11
- y(T, r, n, e);
11
+ p(C, s, n, e);
12
12
  },
13
13
  get _() {
14
- return t(T, r, s);
14
+ return t(C, s, r);
15
15
  }
16
16
  });
17
- import { trace as As } from "@ninebone/util";
18
- const es = class es extends As.constructor {
17
+ import { trace as Es } from "@ninebone/util";
18
+ const ts = class ts extends Es.constructor {
19
19
  constructor() {
20
20
  super(), this.init("nine-table", "green");
21
21
  }
22
22
  };
23
- h(es, "Trace");
24
- let Te = es;
25
- const q = new Te();
26
- var j, G, A, tt, et, st, Zt, rt, Jt;
27
- const ss = class ss extends HTMLElement {
23
+ d(ts, "Trace");
24
+ let qe = ts;
25
+ const T = new qe();
26
+ var P, X, A, J, Q, tt, Gt, et, Zt;
27
+ const es = class es extends HTMLElement {
28
28
  constructor() {
29
29
  super();
30
- d(this, j);
31
- d(this, G, !1);
32
- d(this, A);
33
- d(this, tt);
34
- d(this, et);
35
- d(this, st);
36
- d(this, Zt, /* @__PURE__ */ h(() => {
37
- if (!t(this, j)) return;
38
- const e = t(this, j).querySelector(".ng-container-body .ng-part-body");
39
- e && (y(this, st, new ResizeObserver(() => {
30
+ h(this, P);
31
+ h(this, X, !1);
32
+ h(this, A);
33
+ h(this, J);
34
+ h(this, Q);
35
+ h(this, tt);
36
+ h(this, Gt, /* @__PURE__ */ d(() => {
37
+ if (!t(this, P)) return;
38
+ const e = t(this, P).querySelector(".ng-container-body .ng-part-body");
39
+ e && (p(this, tt, new ResizeObserver(() => {
40
40
  this.refresh();
41
- })), t(this, st).observe(e));
41
+ })), t(this, tt).observe(e));
42
42
  }, "#observeResize"));
43
- E(this, "refresh", /* @__PURE__ */ h(() => {
44
- if (!t(this, j) || !t(this, A) || t(this, G)) return;
45
- const e = t(this, A).container, s = e.querySelector("table");
46
- if (!s) return;
47
- const n = t(this, A).track, i = t(this, A).thumb, o = t(this, j).querySelector(".ng-container-bottom"), a = e.clientWidth, c = s.scrollWidth;
48
- if (a !== 0 && c > a)
43
+ q(this, "refresh", /* @__PURE__ */ d(() => {
44
+ if (!t(this, P) || !t(this, A) || t(this, X)) return;
45
+ const e = t(this, A).container, r = e.querySelector("table");
46
+ if (!r) return;
47
+ const n = t(this, A).track, a = t(this, A).thumb, o = t(this, P).querySelector(".ng-container-bottom"), i = e.clientWidth, c = r.scrollWidth;
48
+ if (i !== 0 && c > i)
49
49
  o && (o.style.display = "flex");
50
50
  else {
51
51
  o && (o.style.display = "none");
@@ -53,41 +53,41 @@ const ss = class ss extends HTMLElement {
53
53
  }
54
54
  const l = n.clientWidth;
55
55
  if (l <= 0) return;
56
- const g = Math.max(Math.min(l * (a / c), l), 20);
57
- i.style.width = `${g}px`;
58
- const f = e.scrollLeft, b = c - a;
59
- let u = 0;
60
- b > 0 && (u = parseInt(f / b * (l - g), 10)), u < 0 && (u = 0);
61
- const p = l - g;
62
- u > p && (u = p), i.style.left = `${u}px`, t(this, A).left.disabled = u === 0, t(this, A).right.disabled = u >= p - 1;
56
+ const f = Math.max(Math.min(l * (i / c), l), 20);
57
+ a.style.width = `${f}px`;
58
+ const u = e.scrollLeft, b = c - i;
59
+ let g = 0;
60
+ b > 0 && (g = parseInt(u / b * (l - f), 10)), g < 0 && (g = 0);
61
+ const y = l - f;
62
+ g > y && (g = y), a.style.left = `${g}px`, t(this, A).left.disabled = g === 0, t(this, A).right.disabled = g >= y - 1;
63
63
  }, "refresh"));
64
- d(this, rt, /* @__PURE__ */ h((e) => {
64
+ h(this, et, /* @__PURE__ */ d((e) => {
65
65
  if (!t(this, A)) return !1;
66
- const s = t(this, A).container, n = s.querySelector("table");
66
+ const r = t(this, A).container, n = r.querySelector("table");
67
67
  if (!n) return !1;
68
- const i = t(this, A).track.getBoundingClientRect(), o = t(this, A).thumb.clientWidth;
69
- let a = e;
70
- a < 0 && (a = 0);
71
- const c = i.width - o;
72
- a > c && (a = c), a = parseInt(a, 10), t(this, A).thumb.style.left = `${a}px`, q.log("1111=========="), t(this, A).left.disabled = a === 0, t(this, A).right.disabled = a >= c - 1;
73
- const l = s.clientWidth, f = n.scrollWidth - l;
74
- return c > 0 && f > 0 && (s.scrollLeft = a / c * f), a > 0 && a < c - 1;
68
+ const a = t(this, A).track.getBoundingClientRect(), o = t(this, A).thumb.clientWidth;
69
+ let i = e;
70
+ i < 0 && (i = 0);
71
+ const c = a.width - o;
72
+ i > c && (i = c), i = parseInt(i, 10), t(this, A).thumb.style.left = `${i}px`, T.log("1111=========="), t(this, A).left.disabled = i === 0, t(this, A).right.disabled = i >= c - 1;
73
+ const l = r.clientWidth, u = n.scrollWidth - l;
74
+ return c > 0 && u > 0 && (r.scrollLeft = i / c * u), i > 0 && i < c - 1;
75
75
  }, "#thumbMoveTo"));
76
- d(this, Jt, /* @__PURE__ */ h(() => {
77
- const e = /* @__PURE__ */ h((n) => {
78
- clearInterval(t(this, tt)), clearInterval(t(this, et));
79
- const i = parseInt(t(this, A).thumb.style.left || 0, 10);
80
- t(this, rt).call(this, i + n), y(this, tt, setInterval(() => {
81
- clearInterval(t(this, tt)), y(this, et, setInterval(() => {
76
+ h(this, Zt, /* @__PURE__ */ d(() => {
77
+ const e = /* @__PURE__ */ d((n) => {
78
+ clearInterval(t(this, J)), clearInterval(t(this, Q));
79
+ const a = parseInt(t(this, A).thumb.style.left || 0, 10);
80
+ t(this, et).call(this, a + n), p(this, J, setInterval(() => {
81
+ clearInterval(t(this, J)), p(this, Q, setInterval(() => {
82
82
  const o = parseInt(t(this, A).thumb.style.left || 0, 10);
83
- t(this, rt).call(this, o + n) || clearInterval(t(this, et));
83
+ t(this, et).call(this, o + n) || clearInterval(t(this, Q));
84
84
  }, 50));
85
85
  }, 500));
86
- }, "delayScroll"), s = /* @__PURE__ */ h(() => {
87
- clearInterval(t(this, tt)), clearInterval(t(this, et));
86
+ }, "delayScroll"), r = /* @__PURE__ */ d(() => {
87
+ clearInterval(t(this, J)), clearInterval(t(this, Q));
88
88
  }, "clearTimer");
89
89
  ["mouseup", "mouseleave", "touchend"].forEach((n) => {
90
- t(this, A).left.addEventListener(n, s), t(this, A).right.addEventListener(n, s), t(this, A).track.addEventListener(n, s);
90
+ t(this, A).left.addEventListener(n, r), t(this, A).right.addEventListener(n, r), t(this, A).track.addEventListener(n, r);
91
91
  }), t(this, A).left.addEventListener("mousedown", (n) => {
92
92
  n.button === 0 && e(-20);
93
93
  }), t(this, A).right.addEventListener("mousedown", (n) => {
@@ -95,24 +95,24 @@ const ss = class ss extends HTMLElement {
95
95
  }), t(this, A).left.addEventListener("touchstart", () => e(-20)), t(this, A).right.addEventListener("touchstart", () => e(20)), t(this, A).track.addEventListener("mousedown", (n) => {
96
96
  if (n.button !== 0) return;
97
97
  n.preventDefault();
98
- const i = t(this, A).track.getBoundingClientRect(), o = t(this, A).thumb.clientWidth;
99
- t(this, rt).call(this, n.clientX - i.left - o / 2);
98
+ const a = t(this, A).track.getBoundingClientRect(), o = t(this, A).thumb.clientWidth;
99
+ t(this, et).call(this, n.clientX - a.left - o / 2);
100
100
  }), t(this, A).thumb.addEventListener("mousedown", (n) => {
101
101
  if (n.button !== 0) return;
102
- n.stopPropagation(), n.preventDefault(), y(this, G, !0), this.shiftX = n.clientX - t(this, A).thumb.getBoundingClientRect().left;
103
- const i = /* @__PURE__ */ h((a) => {
104
- if (!t(this, G)) return;
102
+ n.stopPropagation(), n.preventDefault(), p(this, X, !0), this.shiftX = n.clientX - t(this, A).thumb.getBoundingClientRect().left;
103
+ const a = /* @__PURE__ */ d((i) => {
104
+ if (!t(this, X)) return;
105
105
  const c = t(this, A).track.getBoundingClientRect();
106
- t(this, rt).call(this, a.clientX - c.left - this.shiftX);
107
- }, "onMouseMove"), o = /* @__PURE__ */ h(() => {
108
- y(this, G, !1), s(), document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", o), this.refresh();
106
+ t(this, et).call(this, i.clientX - c.left - this.shiftX);
107
+ }, "onMouseMove"), o = /* @__PURE__ */ d(() => {
108
+ p(this, X, !1), r(), document.removeEventListener("mousemove", a), document.removeEventListener("mouseup", o), this.refresh();
109
109
  }, "onMouseUp");
110
- document.addEventListener("mousemove", i), document.addEventListener("mouseup", o);
110
+ document.addEventListener("mousemove", a), document.addEventListener("mouseup", o);
111
111
  });
112
112
  }, "#init"));
113
113
  }
114
114
  connectedCallback() {
115
- if (y(this, j, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, j)) return;
115
+ if (p(this, P, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, P)) return;
116
116
  this.innerHTML = `
117
117
  <style>
118
118
  nine-table-hscrollbar {
@@ -176,88 +176,88 @@ const ss = class ss extends HTMLElement {
176
176
  <div class='ng-scroll-track'><div class='ng-scroll-thumb'></div></div>
177
177
  <button class='ng-scroll-right' disabled><div class='ng-scroll-icon'></div></button>
178
178
  `;
179
- const e = /* @__PURE__ */ h(() => {
180
- const s = t(this, j).querySelector(".ng-container-body .ng-part-body");
181
- if (!s) {
179
+ const e = /* @__PURE__ */ d(() => {
180
+ const r = t(this, P).querySelector(".ng-container-body .ng-part-body");
181
+ if (!r) {
182
182
  setTimeout(e, 10);
183
183
  return;
184
184
  }
185
- y(this, A, {
186
- container: s,
185
+ p(this, A, {
186
+ container: r,
187
187
  track: this.querySelector(".ng-scroll-track"),
188
188
  thumb: this.querySelector(".ng-scroll-thumb"),
189
189
  left: this.querySelector(".ng-scroll-left"),
190
190
  right: this.querySelector(".ng-scroll-right")
191
- }), s.addEventListener("scroll", () => {
192
- t(this, G) || this.refresh();
193
- }), t(this, Jt).call(this), t(this, Zt).call(this), this.refresh();
191
+ }), r.addEventListener("scroll", () => {
192
+ t(this, X) || this.refresh();
193
+ }), t(this, Zt).call(this), t(this, Gt).call(this), this.refresh();
194
194
  }, "initWhenReady");
195
195
  e();
196
196
  }
197
197
  disconnectedCallback() {
198
- t(this, st) && t(this, st).disconnect();
198
+ t(this, tt) && t(this, tt).disconnect();
199
199
  }
200
200
  };
201
- j = new WeakMap(), G = new WeakMap(), A = new WeakMap(), tt = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Zt = new WeakMap(), rt = new WeakMap(), Jt = new WeakMap(), h(ss, "NineTableHScrollBar");
202
- let Ce = ss;
203
- customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Ce);
204
- var nt, ot, yt, k, kt, Lt, Qt;
205
- const rs = class rs extends HTMLElement {
201
+ P = new WeakMap(), X = new WeakMap(), A = new WeakMap(), J = new WeakMap(), Q = new WeakMap(), tt = new WeakMap(), Gt = new WeakMap(), et = new WeakMap(), Zt = new WeakMap(), d(es, "NineTableHScrollBar");
202
+ let Te = es;
203
+ customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Te);
204
+ var st, rt, pt, k, Ct, kt, Jt;
205
+ const ss = class ss extends HTMLElement {
206
206
  constructor() {
207
207
  super();
208
- d(this, nt);
209
- d(this, ot);
210
- d(this, yt, !1);
211
- d(this, k);
212
- d(this, kt, 0);
213
- d(this, Lt, 0);
214
- E(this, "refresh", /* @__PURE__ */ h(() => {
215
- if (!t(this, nt) || !t(this, k)) return;
216
- const e = t(this, k).container, s = t(this, k).track, n = t(this, k).thumb, i = e.clientHeight, o = t(this, nt).data.length, a = t(this, ot).getRowHeight(), c = o * a;
217
- if (c <= i || o === 0) {
208
+ h(this, st);
209
+ h(this, rt);
210
+ h(this, pt, !1);
211
+ h(this, k);
212
+ h(this, Ct, 0);
213
+ h(this, kt, 0);
214
+ q(this, "refresh", /* @__PURE__ */ d(() => {
215
+ if (!t(this, st) || !t(this, k)) return;
216
+ const e = t(this, k).container, r = t(this, k).track, n = t(this, k).thumb, a = e.clientHeight, o = t(this, st).data.length, i = t(this, rt).getRowHeight(), c = o * i;
217
+ if (c <= a || o === 0) {
218
218
  this.style.display = "none";
219
219
  return;
220
220
  } else
221
221
  this.style.display = "flex";
222
- const l = s.clientHeight;
222
+ const l = r.clientHeight;
223
223
  if (l <= 0) return;
224
- const g = Math.max(Math.min(l * (i / c), l), 20);
225
- n.style.height = `${g}px`;
226
- const f = e.scrollTop, b = Math.max(c - i, 1);
227
- let u = 0;
228
- b > 0 && (u = f / b * (l - g));
229
- const p = l - g;
230
- u < 0 && (u = 0), u > p && (u = p), n.style.top = `${u}px`, t(this, k).top.disabled = f <= 0, t(this, k).bottom.disabled = f >= b - 1;
224
+ const f = Math.max(Math.min(l * (a / c), l), 20);
225
+ n.style.height = `${f}px`;
226
+ const u = e.scrollTop, b = Math.max(c - a, 1);
227
+ let g = 0;
228
+ b > 0 && (g = u / b * (l - f));
229
+ const y = l - f;
230
+ g < 0 && (g = 0), g > y && (g = y), n.style.top = `${g}px`, t(this, k).top.disabled = u <= 0, t(this, k).bottom.disabled = u >= b - 1;
231
231
  }, "refresh"));
232
- d(this, Qt, /* @__PURE__ */ h(() => {
233
- q.log("nine-table-vscrollbar.#init");
234
- const e = t(this, k).container, s = /* @__PURE__ */ h(() => {
235
- const i = (t(this, nt).data.get() || []).length, o = t(this, ot).getRowHeight();
236
- return i * o;
232
+ h(this, Jt, /* @__PURE__ */ d(() => {
233
+ T.log("nine-table-vscrollbar.#init");
234
+ const e = t(this, k).container, r = /* @__PURE__ */ d(() => {
235
+ const a = (t(this, st).data.get() || []).length, o = t(this, rt).getRowHeight();
236
+ return a * o;
237
237
  }, "getContentHeight");
238
238
  t(this, k).thumb.addEventListener("mousedown", (n) => {
239
239
  if (n.button !== 0) return;
240
- n.stopPropagation(), n.preventDefault(), y(this, yt, !0), y(this, kt, n.clientY), y(this, Lt, e.scrollTop);
241
- const i = /* @__PURE__ */ h((a) => {
242
- if (!t(this, yt)) return;
243
- const c = t(this, k).track.getBoundingClientRect(), l = t(this, k).thumb.clientHeight, f = c.height - l, b = a.clientY - t(this, kt), u = e.clientHeight, p = s(), m = Math.max(p - u, 1);
244
- if (f > 0 && m > 0) {
245
- const w = b / f * m;
246
- let x = t(this, Lt) + w;
247
- const C = Math.max(0, p - u);
248
- x < 0 && (x = 0), x > C && (x = C), e.scrollTop = x;
240
+ n.stopPropagation(), n.preventDefault(), p(this, pt, !0), p(this, Ct, n.clientY), p(this, kt, e.scrollTop);
241
+ const a = /* @__PURE__ */ d((i) => {
242
+ if (!t(this, pt)) return;
243
+ const c = t(this, k).track.getBoundingClientRect(), l = t(this, k).thumb.clientHeight, u = c.height - l, b = i.clientY - t(this, Ct), g = e.clientHeight, y = r(), x = Math.max(y - g, 1);
244
+ if (u > 0 && x > 0) {
245
+ const w = b / u * x;
246
+ let m = t(this, kt) + w;
247
+ const E = Math.max(0, y - g);
248
+ m < 0 && (m = 0), m > E && (m = E), e.scrollTop = m;
249
249
  }
250
250
  this.refresh();
251
- }, "onMouseMove"), o = /* @__PURE__ */ h(() => {
252
- y(this, yt, !1), document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", o), this.refresh();
251
+ }, "onMouseMove"), o = /* @__PURE__ */ d(() => {
252
+ p(this, pt, !1), document.removeEventListener("mousemove", a), document.removeEventListener("mouseup", o), this.refresh();
253
253
  }, "onMouseUp");
254
- document.addEventListener("mousemove", i), document.addEventListener("mouseup", o);
254
+ document.addEventListener("mousemove", a), document.addEventListener("mouseup", o);
255
255
  }), t(this, k).track.addEventListener("mousedown", (n) => {
256
256
  if (n.button !== 0 || n.target === t(this, k).thumb) return;
257
- const i = t(this, k).track.getBoundingClientRect(), o = t(this, k).thumb.clientHeight, a = n.clientY - i.top - o / 2, l = i.height - o, g = e.clientHeight, f = s(), b = Math.max(f - g, 1);
257
+ const a = t(this, k).track.getBoundingClientRect(), o = t(this, k).thumb.clientHeight, i = n.clientY - a.top - o / 2, l = a.height - o, f = e.clientHeight, u = r(), b = Math.max(u - f, 1);
258
258
  if (l > 0 && b > 0) {
259
- const u = Math.max(0, Math.min(1, a / l));
260
- e.scrollTop = u * b;
259
+ const g = Math.max(0, Math.min(1, i / l));
260
+ e.scrollTop = g * b;
261
261
  }
262
262
  this.refresh();
263
263
  }), t(this, k).top.addEventListener("click", () => {
@@ -268,7 +268,7 @@ const rs = class rs extends HTMLElement {
268
268
  }, "#init"));
269
269
  }
270
270
  connectedCallback() {
271
- y(this, nt, this.getRootNode().host), y(this, ot, this.closest("nine-table-sheet")), this.innerHTML = `
271
+ p(this, st, this.getRootNode().host), p(this, rt, this.closest("nine-table-sheet")), this.innerHTML = `
272
272
  <style>
273
273
  nine-table-vscrollbar {
274
274
  display: flex;
@@ -332,217 +332,217 @@ const rs = class rs extends HTMLElement {
332
332
  <div class='ng-scroll-track'><div class='ng-scroll-thumb'></div></div>
333
333
  <button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
334
334
  `;
335
- const e = /* @__PURE__ */ h(() => {
336
- const s = t(this, ot).querySelector(".ng-container-body .ng-part-body");
337
- if (!s) {
335
+ const e = /* @__PURE__ */ d(() => {
336
+ const r = t(this, rt).querySelector(".ng-container-body .ng-part-body");
337
+ if (!r) {
338
338
  setTimeout(e, 10);
339
339
  return;
340
340
  }
341
- y(this, k, {
342
- container: s,
341
+ p(this, k, {
342
+ container: r,
343
343
  track: this.querySelector(".ng-scroll-track"),
344
344
  thumb: this.querySelector(".ng-scroll-thumb"),
345
345
  top: this.querySelector(".ng-scroll-top"),
346
346
  bottom: this.querySelector(".ng-scroll-bottom")
347
- }), t(this, Qt).call(this), this.refresh();
347
+ }), t(this, Jt).call(this), this.refresh();
348
348
  }, "initWhenReady");
349
349
  e();
350
350
  }
351
351
  };
352
- nt = new WeakMap(), ot = new WeakMap(), yt = new WeakMap(), k = new WeakMap(), kt = new WeakMap(), Lt = new WeakMap(), Qt = new WeakMap(), h(rs, "NineTableVScrollBar");
353
- let ke = rs;
354
- customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", ke);
355
- var it, R, at, U, O, Z, lt, It, Ye, Ue, te, Xe, ee, se, Mt, Ht, $t, re, ne, Nt, mt, oe, ie;
356
- const ns = class ns {
357
- constructor(r) {
358
- d(this, it);
359
- d(this, R);
360
- d(this, at);
361
- d(this, U, /* @__PURE__ */ new Map());
362
- d(this, O, null);
363
- d(this, Z, null);
364
- d(this, lt, 0);
365
- d(this, It, 40);
366
- d(this, Ye, !1);
367
- d(this, Ue, !1);
352
+ st = new WeakMap(), rt = new WeakMap(), pt = new WeakMap(), k = new WeakMap(), Ct = new WeakMap(), kt = new WeakMap(), Jt = new WeakMap(), d(ss, "NineTableVScrollBar");
353
+ let Ce = ss;
354
+ customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Ce);
355
+ var nt, R, ot, V, O, K, it, Lt, Ve, Ye, Qt, Ue, te, ee, It, Mt, Ht, se, re, $t, yt, ne, oe;
356
+ const rs = class rs {
357
+ constructor(s) {
358
+ h(this, nt);
359
+ h(this, R);
360
+ h(this, ot);
361
+ h(this, V, /* @__PURE__ */ new Map());
362
+ h(this, O, null);
363
+ h(this, K, null);
364
+ h(this, it, 0);
365
+ h(this, Lt, 40);
366
+ h(this, Ve, !1);
367
+ h(this, Ye, !1);
368
368
  //#ticking = false; // 🎯 고속 스크롤 스로틀링용 플래그
369
- d(this, te, 3);
370
- d(this, Xe, 3);
371
- d(this, ee, 0);
372
- E(this, "refresh", /* @__PURE__ */ h(() => {
369
+ h(this, Qt, 3);
370
+ h(this, Ue, 3);
371
+ h(this, te, 0);
372
+ q(this, "refresh", /* @__PURE__ */ d(() => {
373
373
  var e;
374
- q.log("rowManager.refresh");
375
- const r = t(this, R).querySelector(".ng-container-body .ng-part-body");
376
- r && (t(this, Mt).call(this), t(this, Ht).call(this), t(this, mt).call(this, r.scrollTop), (e = t(this, R).querySelector("nine-table-vscrollbar")) == null || e.refresh());
374
+ T.log("rowManager.refresh");
375
+ const s = t(this, R).querySelector(".ng-container-body .ng-part-body");
376
+ s && (t(this, It).call(this), t(this, Mt).call(this), t(this, yt).call(this, s.scrollTop), (e = t(this, R).querySelector("nine-table-vscrollbar")) == null || e.refresh());
377
377
  }, "refresh"));
378
- E(this, "initialize", /* @__PURE__ */ h(() => {
379
- q.log("rowManager.initialize"), y(this, at, {
378
+ q(this, "initialize", /* @__PURE__ */ d(() => {
379
+ T.log("rowManager.initialize"), p(this, ot, {
380
380
  scrollTables: t(this, R).querySelectorAll(".ng-part-body table"),
381
381
  firstTr: t(this, R).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
382
- }), y(this, O, null), t(this, U).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
383
- const a = t(this, R).querySelector(o);
384
- if (!a) return;
385
- const c = a.querySelector(".ng-part-body table");
382
+ }), p(this, O, null), t(this, V).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
383
+ const i = t(this, R).querySelector(o);
384
+ if (!i) return;
385
+ const c = i.querySelector(".ng-part-body table");
386
386
  if (!c) return;
387
387
  const l = c.querySelector("tbody.bindable-tbody");
388
388
  if (!l) return;
389
- const f = Array.from(l.querySelectorAll("tr")).map((b) => b.cloneNode(!0));
390
- t(this, U).set(o, f);
389
+ const u = Array.from(l.querySelectorAll("tr")).map((b) => b.cloneNode(!0));
390
+ t(this, V).set(o, u);
391
391
  });
392
- const r = t(this, R).querySelector(".ng-container-body .ng-part-body"), e = t(this, R).querySelector(".ng-container-left .ng-part-body"), s = t(this, R).querySelector(".ng-container-right .ng-part-body"), n = t(this, R).querySelector(".ng-container-body .ng-part-header"), i = t(this, R).querySelector(".ng-container-body .ng-part-footer");
393
- if (r) {
394
- t(this, Mt).call(this), t(this, Nt).call(this), t(this, Ht).call(this), t(this, mt).call(this, r.scrollTop);
392
+ const s = t(this, R).querySelector(".ng-container-body .ng-part-body"), e = t(this, R).querySelector(".ng-container-left .ng-part-body"), r = t(this, R).querySelector(".ng-container-right .ng-part-body"), n = t(this, R).querySelector(".ng-container-body .ng-part-header"), a = t(this, R).querySelector(".ng-container-body .ng-part-footer");
393
+ if (s) {
394
+ t(this, It).call(this), t(this, $t).call(this), t(this, Mt).call(this), t(this, yt).call(this, s.scrollTop);
395
395
  let o = !1;
396
- y(this, ee, r.scrollLeft);
397
- const a = /* @__PURE__ */ h((c) => {
398
- var f;
396
+ p(this, te, s.scrollLeft);
397
+ const i = /* @__PURE__ */ d((c) => {
398
+ var u;
399
399
  if (o) return;
400
400
  o = !0;
401
- const l = c.scrollTop, g = c.scrollLeft;
402
- r && r.scrollTop !== l && (r.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), n && n.scrollLeft !== g && (n.scrollLeft = g), i && i.scrollLeft !== g && (i.scrollLeft = g), t(this, mt).call(this, l), (f = t(this, R).querySelector("nine-table-vscrollbar")) == null || f.refresh(), o = !1;
401
+ const l = c.scrollTop, f = c.scrollLeft;
402
+ s && s.scrollTop !== l && (s.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), r && r.scrollTop !== l && (r.scrollTop = l), n && n.scrollLeft !== f && (n.scrollLeft = f), a && a.scrollLeft !== f && (a.scrollLeft = f), t(this, yt).call(this, l), (u = t(this, R).querySelector("nine-table-vscrollbar")) == null || u.refresh(), o = !1;
403
403
  }, "handleContainerScroll");
404
- r == null || r.addEventListener("scroll", (c) => {
405
- a(r);
406
- }), [e, s].forEach((c) => {
404
+ s == null || s.addEventListener("scroll", (c) => {
405
+ i(s);
406
+ }), [e, r].forEach((c) => {
407
407
  c == null || c.addEventListener("scroll", (l) => {
408
408
  if (o) return;
409
409
  o = !0;
410
- const g = c.scrollTop;
411
- r && r.scrollTop !== g && (r.scrollTop = g), o = !1;
410
+ const f = c.scrollTop;
411
+ s && s.scrollTop !== f && (s.scrollTop = f), o = !1;
412
412
  });
413
413
  });
414
414
  }
415
415
  }, "initialize"));
416
- d(this, se, /* @__PURE__ */ h((r, e) => {
417
- q.log("rowManager.#renderRows");
418
- const s = t(this, U).get(e);
419
- if (!s || s.length === 0) return;
420
- const n = r.querySelector(".ng-part-body tbody.bindable-tbody");
416
+ h(this, ee, /* @__PURE__ */ d((s, e) => {
417
+ T.log("rowManager.#renderRows");
418
+ const r = t(this, V).get(e);
419
+ if (!r || r.length === 0) return;
420
+ const n = s.querySelector(".ng-part-body tbody.bindable-tbody");
421
421
  if (!n) return;
422
- n.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
423
- const i = n.querySelector("tr.nodata"), o = document.createDocumentFragment();
424
- for (let a = 0; a < t(this, It); a++)
425
- s.forEach((c) => {
422
+ n.querySelectorAll("tr:not(.nodata)").forEach((i) => i.remove());
423
+ const a = n.querySelector("tr.nodata"), o = document.createDocumentFragment();
424
+ for (let i = 0; i < t(this, Lt); i++)
425
+ r.forEach((c) => {
426
426
  o.appendChild(c.cloneNode(!0));
427
427
  });
428
- i ? i.before(o) : n.appendChild(o), e === ".ng-container-body" && (t(this, at).firstTr = n.querySelector("tr:not(.nodata)"));
428
+ a ? a.before(o) : n.appendChild(o), e === ".ng-container-body" && (t(this, ot).firstTr = n.querySelector("tr:not(.nodata)"));
429
429
  }, "#renderRows"));
430
- d(this, Mt, /* @__PURE__ */ h(() => {
430
+ h(this, It, /* @__PURE__ */ d(() => {
431
431
  if (t(this, O) !== null && t(this, O) > 0)
432
432
  return t(this, O);
433
- const r = t(this, R).querySelector(".ng-container-body .ng-part-body");
434
- q.log("rowManager.#measureAndCacheHeight");
435
- const e = t(this, U).get(".ng-container-body");
433
+ const s = t(this, R).querySelector(".ng-container-body .ng-part-body");
434
+ T.log("rowManager.#measureAndCacheHeight");
435
+ const e = t(this, V).get(".ng-container-body");
436
436
  if (!e || e.length === 0) throw new Error("invalid dom");
437
- const s = r.querySelector("tbody.bindable-tbody");
438
- if (!s) throw new Error("invalid dom");
439
- s.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
440
- const n = s.querySelector("tr.nodata"), i = document.createDocumentFragment();
437
+ const r = s.querySelector("tbody.bindable-tbody");
438
+ if (!r) throw new Error("invalid dom");
439
+ r.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
440
+ const n = r.querySelector("tr.nodata"), a = document.createDocumentFragment();
441
441
  e.forEach((b) => {
442
- i.appendChild(b.cloneNode(!0));
443
- }), n ? n.before(i) : s.appendChild(i);
444
- const o = t(this, R), a = o.style.display, c = o.style.visibility, l = o.style.position;
445
- (a === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
446
- let g = 0;
447
- const f = s.querySelectorAll("tr");
448
- return f.forEach((b) => {
449
- let u = b.offsetHeight || b.getBoundingClientRect().height;
450
- if (u === 0) {
451
- const p = window.getComputedStyle(b);
452
- u = parseFloat(p.height) || parseFloat(p.minHeight) || 0;
442
+ a.appendChild(b.cloneNode(!0));
443
+ }), n ? n.before(a) : r.appendChild(a);
444
+ const o = t(this, R), i = o.style.display, c = o.style.visibility, l = o.style.position;
445
+ (i === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
446
+ let f = 0;
447
+ const u = r.querySelectorAll("tr");
448
+ return u.forEach((b) => {
449
+ let g = b.offsetHeight || b.getBoundingClientRect().height;
450
+ if (g === 0) {
451
+ const y = window.getComputedStyle(b);
452
+ g = parseFloat(y.height) || parseFloat(y.minHeight) || 0;
453
453
  }
454
- g += u;
455
- }), f.forEach((b) => b.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l, g <= 0 ? -1 : (y(this, O, g), t(this, $t).call(this), t(this, O));
454
+ f += g;
455
+ }), u.forEach((b) => b.remove()), o.style.display = i, o.style.visibility = c, o.style.position = l, f <= 0 ? -1 : (p(this, O, f), t(this, Ht).call(this), t(this, O));
456
456
  }, "#measureAndCacheHeight"));
457
- d(this, Ht, /* @__PURE__ */ h(() => {
458
- q.log("rowManager.#updateVirtualScrollHeight");
459
- const e = (t(this, it).data.get() || []).length, s = t(this, O), n = e * s;
460
- [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
461
- const o = t(this, R).querySelector(i);
457
+ h(this, Mt, /* @__PURE__ */ d(() => {
458
+ T.log("rowManager.#updateVirtualScrollHeight");
459
+ const e = (t(this, nt).data.get() || []).length, r = t(this, O), n = e * r;
460
+ [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((a) => {
461
+ const o = t(this, R).querySelector(a);
462
462
  if (!o) return;
463
- const a = o.querySelector(".ng-part-body .ng-virtual-spacer");
464
- a && (a.style.height = `${n}px`);
463
+ const i = o.querySelector(".ng-part-body .ng-virtual-spacer");
464
+ i && (i.style.height = `${n}px`);
465
465
  });
466
466
  }, "#updateVirtualScrollHeight"));
467
- d(this, $t, /* @__PURE__ */ h(() => {
468
- if (t(this, lt) > 0 && t(this, O) > 0) {
469
- const r = Math.ceil(t(this, lt) / t(this, O));
470
- y(this, It, r + t(this, te));
467
+ h(this, Ht, /* @__PURE__ */ d(() => {
468
+ if (t(this, it) > 0 && t(this, O) > 0) {
469
+ const s = Math.ceil(t(this, it) / t(this, O));
470
+ p(this, Lt, s + t(this, Qt));
471
471
  }
472
472
  }, "#updateRowCount"));
473
- d(this, re, /* @__PURE__ */ h(() => {
474
- var a, c, l, g, f, b;
475
- const r = t(this, R).querySelector(".ng-container-left .ng-part-body table"), e = t(this, R).querySelector(".ng-container-body .ng-part-body table"), s = t(this, R).querySelector(".ng-container-right .ng-part-body table");
473
+ h(this, se, /* @__PURE__ */ d(() => {
474
+ var i, c, l, f, u, b;
475
+ const s = t(this, R).querySelector(".ng-container-left .ng-part-body table"), e = t(this, R).querySelector(".ng-container-body .ng-part-body table"), r = t(this, R).querySelector(".ng-container-right .ng-part-body table");
476
476
  if (e) {
477
- const u = r ? Array.from(r.querySelectorAll("tbody tr")) : [], p = Array.from(e.querySelectorAll("tbody tr")), m = s ? Array.from(s.querySelectorAll("tbody tr")) : [], w = Math.max(u.length, p.length, m.length);
478
- for (let x = 0; x < w; x++) {
479
- const C = [
480
- ((a = u[x]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
481
- ((c = p[x]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
482
- ((l = m[x]) == null ? void 0 : l.getBoundingClientRect().height) || 0
483
- ], S = Math.max(...C);
484
- S > 0 && (u[x] && (u[x].style.height = `${S}px`), p[x] && (p[x].style.height = `${S}px`), m[x] && (m[x].style.height = `${S}px`));
477
+ const g = s ? Array.from(s.querySelectorAll("tbody tr")) : [], y = Array.from(e.querySelectorAll("tbody tr")), x = r ? Array.from(r.querySelectorAll("tbody tr")) : [], w = Math.max(g.length, y.length, x.length);
478
+ for (let m = 0; m < w; m++) {
479
+ const E = [
480
+ ((i = g[m]) == null ? void 0 : i.getBoundingClientRect().height) || 0,
481
+ ((c = y[m]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
482
+ ((l = x[m]) == null ? void 0 : l.getBoundingClientRect().height) || 0
483
+ ], S = Math.max(...E);
484
+ S > 0 && (g[m] && (g[m].style.height = `${S}px`), y[m] && (y[m].style.height = `${S}px`), x[m] && (x[m].style.height = `${S}px`));
485
485
  }
486
486
  }
487
- const n = t(this, R).querySelector(".ng-container-left .ng-part-footer table"), i = t(this, R).querySelector(".ng-container-body .ng-part-footer table"), o = t(this, R).querySelector(".ng-container-right .ng-part-footer table");
488
- if (i) {
489
- const u = n ? Array.from(n.querySelectorAll("tfoot tr")) : [], p = Array.from(i.querySelectorAll("tfoot tr")), m = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], w = Math.max(u.length, p.length, m.length);
490
- for (let x = 0; x < w; x++) {
491
- const C = [
492
- ((g = u[x]) == null ? void 0 : g.getBoundingClientRect().height) || 0,
493
- ((f = p[x]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
494
- ((b = m[x]) == null ? void 0 : b.getBoundingClientRect().height) || 0
495
- ], S = Math.max(...C);
496
- S > 0 && (u[x] && (u[x].style.height = `${S}px`), p[x] && (p[x].style.height = `${S}px`), m[x] && (m[x].style.height = `${S}px`));
487
+ const n = t(this, R).querySelector(".ng-container-left .ng-part-footer table"), a = t(this, R).querySelector(".ng-container-body .ng-part-footer table"), o = t(this, R).querySelector(".ng-container-right .ng-part-footer table");
488
+ if (a) {
489
+ const g = n ? Array.from(n.querySelectorAll("tfoot tr")) : [], y = Array.from(a.querySelectorAll("tfoot tr")), x = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], w = Math.max(g.length, y.length, x.length);
490
+ for (let m = 0; m < w; m++) {
491
+ const E = [
492
+ ((f = g[m]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
493
+ ((u = y[m]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
494
+ ((b = x[m]) == null ? void 0 : b.getBoundingClientRect().height) || 0
495
+ ], S = Math.max(...E);
496
+ S > 0 && (g[m] && (g[m].style.height = `${S}px`), y[m] && (y[m].style.height = `${S}px`), x[m] && (x[m].style.height = `${S}px`));
497
497
  }
498
498
  }
499
499
  }, "#syncRowHeights"));
500
- d(this, ne, /* @__PURE__ */ h(() => {
501
- !t(this, R) || !(t(this, R) instanceof HTMLElement) || (y(this, Z, new ResizeObserver((r) => {
502
- for (const e of r) {
503
- const s = e.target;
504
- if (!s.classList.contains("active")) continue;
500
+ h(this, re, /* @__PURE__ */ d(() => {
501
+ !t(this, R) || !(t(this, R) instanceof HTMLElement) || (p(this, K, new ResizeObserver((s) => {
502
+ for (const e of s) {
503
+ const r = e.target;
504
+ if (!r.classList.contains("active")) continue;
505
505
  const n = e.contentRect.height;
506
506
  if (n > 0) {
507
- let i = 0;
508
- const o = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
509
- o && (i += o.offsetHeight), a && (i += a.offsetHeight);
510
- const c = Math.max(n - i, 100);
511
- t(this, lt) !== c && (y(this, lt, c), t(this, $t).call(this), t(this, O) !== null && (t(this, Nt).call(this), this.refresh()));
507
+ let a = 0;
508
+ const o = r.querySelector(".ng-part-header"), i = r.querySelector(".ng-part-footer");
509
+ o && (a += o.offsetHeight), i && (a += i.offsetHeight);
510
+ const c = Math.max(n - a, 100);
511
+ t(this, it) !== c && (p(this, it, c), t(this, Ht).call(this), t(this, O) !== null && (t(this, $t).call(this), this.refresh()));
512
512
  }
513
513
  }
514
- })), t(this, Z).observe(t(this, R)));
514
+ })), t(this, K).observe(t(this, R)));
515
515
  }, "#initResizeObserver"));
516
- d(this, Nt, /* @__PURE__ */ h(() => {
517
- q.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((r) => {
518
- const e = t(this, R).querySelector(r);
519
- e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, se).call(this, e, r);
520
- }), t(this, ie).call(this), t(this, re).call(this);
516
+ h(this, $t, /* @__PURE__ */ d(() => {
517
+ T.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((s) => {
518
+ const e = t(this, R).querySelector(s);
519
+ e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, ee).call(this, e, s);
520
+ }), t(this, oe).call(this), t(this, se).call(this);
521
521
  }, "#renderAllContainers"));
522
- d(this, mt, /* @__PURE__ */ h((r) => {
523
- var f, b;
522
+ h(this, yt, /* @__PURE__ */ d((s) => {
523
+ var u, b;
524
524
  const e = t(this, O);
525
525
  if (!e || e <= 0) return;
526
- const s = t(this, it).data.length;
527
- if (s === 0) return;
528
- const n = ((f = t(this, U).get(".ng-container-body")) == null ? void 0 : f.length) || 1, i = t(this, R).querySelector(".ng-container-body .ng-part-body"), o = Math.max(0, s - Math.floor(i.clientHeight / e)), a = Math.min(o, Math.max(0, Math.floor(r / e)));
529
- let c = Math.floor(a * e);
530
- const l = t(this, at).firstTr, g = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
531
- (b = t(this, at)) == null || b.scrollTables.forEach((u) => {
532
- u.style.transform = `translate3d(0, ${c}px, 0)`;
533
- }), g !== a && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((u) => {
534
- const p = t(this, R).querySelector(u);
535
- if (!p) return;
536
- const m = p.querySelector(".ng-part-body tbody.bindable-tbody");
537
- if (!m) return;
538
- Array.from(m.querySelectorAll("tr:not(.nodata)")).forEach((x, C) => {
539
- const S = a + Math.floor(C / n);
540
- if (S >= s) {
541
- x.style.display = "none";
526
+ const r = t(this, nt).data.length;
527
+ if (r === 0) return;
528
+ const n = ((u = t(this, V).get(".ng-container-body")) == null ? void 0 : u.length) || 1, a = t(this, R).querySelector(".ng-container-body .ng-part-body"), o = Math.max(0, r - Math.floor(a.clientHeight / e)), i = Math.min(o, Math.max(0, Math.floor(s / e)));
529
+ let c = Math.floor(i * e);
530
+ const l = t(this, ot).firstTr, f = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
531
+ (b = t(this, ot)) == null || b.scrollTables.forEach((g) => {
532
+ g.style.transform = `translate3d(0, ${c}px, 0)`;
533
+ }), f !== i && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
534
+ const y = t(this, R).querySelector(g);
535
+ if (!y) return;
536
+ const x = y.querySelector(".ng-part-body tbody.bindable-tbody");
537
+ if (!x) return;
538
+ Array.from(x.querySelectorAll("tr:not(.nodata)")).forEach((m, E) => {
539
+ const S = i + Math.floor(E / n);
540
+ if (S >= r) {
541
+ m.style.display = "none";
542
542
  return;
543
543
  }
544
- const M = t(this, it).data.get(S);
545
- x.style.display = "", t(this, oe).call(this, x, M, S);
544
+ const _ = t(this, nt).data.get(S);
545
+ m.style.display = "", t(this, ne).call(this, m, _, S);
546
546
  });
547
547
  });
548
548
  }, "#handleScroll"));
@@ -560,481 +560,480 @@ const ns = class ns {
560
560
  cell.dataset.row = dataIndex;
561
561
  });
562
562
  }; */
563
- d(this, oe, /* @__PURE__ */ h((r, e, s) => {
564
- r.dataset.row = s, r.data = e, Array.from(r.cells).forEach((n, i) => {
565
- n.dataset.row = s;
566
- const o = Array.from(n.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
563
+ h(this, ne, /* @__PURE__ */ d((s, e, r) => {
564
+ s.dataset.row = r, s.data = e, Array.from(s.cells).forEach((n, a) => {
565
+ n.dataset.row = r;
566
+ const o = Array.from(n.children).find((i) => i.tagName.toLowerCase().startsWith("cell-") || typeof i.refresh == "function");
567
567
  o && typeof o.refresh == "function" && o.refresh();
568
568
  });
569
569
  }, "#bindRowData"));
570
- d(this, ie, /* @__PURE__ */ h(() => {
571
- var c, l, g;
572
- q.log("rowManager.#syncHeaderHeights");
573
- const r = t(this, R).querySelector(".ng-container-left .ng-part-header table"), e = t(this, R).querySelector(".ng-container-body .ng-part-header table"), s = t(this, R).querySelector(".ng-container-right .ng-part-header table");
570
+ h(this, oe, /* @__PURE__ */ d(() => {
571
+ var c, l, f;
572
+ T.log("rowManager.#syncHeaderHeights");
573
+ const s = t(this, R).querySelector(".ng-container-left .ng-part-header table"), e = t(this, R).querySelector(".ng-container-body .ng-part-header table"), r = t(this, R).querySelector(".ng-container-right .ng-part-header table");
574
574
  if (!e) return;
575
- const n = r ? Array.from(r.querySelectorAll("tr")) : [], i = Array.from(e.querySelectorAll("tr")), o = s ? Array.from(s.querySelectorAll("tr")) : [], a = Math.max(n.length, i.length, o.length);
576
- for (let f = 0; f < a; f++) {
575
+ const n = s ? Array.from(s.querySelectorAll("tr")) : [], a = Array.from(e.querySelectorAll("tr")), o = r ? Array.from(r.querySelectorAll("tr")) : [], i = Math.max(n.length, a.length, o.length);
576
+ for (let u = 0; u < i; u++) {
577
577
  const b = [
578
- ((c = n[f]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
579
- ((l = i[f]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
580
- ((g = o[f]) == null ? void 0 : g.getBoundingClientRect().height) || 0
581
- ], u = Math.max(...b);
582
- u > 0 && (n[f] && (n[f].style.height = `${u}px`), i[f] && (i[f].style.height = `${u}px`), o[f] && (o[f].style.height = `${u}px`));
578
+ ((c = n[u]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
579
+ ((l = a[u]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
580
+ ((f = o[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
581
+ ], g = Math.max(...b);
582
+ g > 0 && (n[u] && (n[u].style.height = `${g}px`), a[u] && (a[u].style.height = `${g}px`), o[u] && (o[u].style.height = `${g}px`));
583
583
  }
584
584
  }, "#syncHeaderHeights"));
585
- E(this, "destroy", /* @__PURE__ */ h(() => {
586
- t(this, Z) && (t(this, Z).disconnect(), y(this, Z, null));
585
+ q(this, "destroy", /* @__PURE__ */ d(() => {
586
+ t(this, K) && (t(this, K).disconnect(), p(this, K, null));
587
587
  }, "destroy"));
588
- y(this, it, r.getRootNode().host), y(this, R, r), t(this, ne).call(this);
588
+ p(this, nt, s.getRootNode().host), p(this, R, s), t(this, re).call(this);
589
589
  }
590
590
  getRowHeight() {
591
591
  return t(this, O);
592
592
  }
593
- templateLength(r = ".ng-container-body") {
593
+ templateLength(s = ".ng-container-body") {
594
594
  var e;
595
- return ((e = t(this, U).get(r)) == null ? void 0 : e.length) || 1;
595
+ return ((e = t(this, V).get(s)) == null ? void 0 : e.length) || 1;
596
596
  }
597
597
  };
598
- it = new WeakMap(), R = new WeakMap(), at = new WeakMap(), U = new WeakMap(), O = new WeakMap(), Z = new WeakMap(), lt = new WeakMap(), It = new WeakMap(), Ye = new WeakMap(), Ue = new WeakMap(), te = new WeakMap(), Xe = new WeakMap(), ee = new WeakMap(), se = new WeakMap(), Mt = new WeakMap(), Ht = new WeakMap(), $t = new WeakMap(), re = new WeakMap(), ne = new WeakMap(), Nt = new WeakMap(), mt = new WeakMap(), oe = new WeakMap(), ie = new WeakMap(), h(ns, "RowManager");
599
- let Le = ns;
600
- const ae = class ae {
598
+ nt = new WeakMap(), R = new WeakMap(), ot = new WeakMap(), V = new WeakMap(), O = new WeakMap(), K = new WeakMap(), it = new WeakMap(), Lt = new WeakMap(), Ve = new WeakMap(), Ye = new WeakMap(), Qt = new WeakMap(), Ue = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), It = new WeakMap(), Mt = new WeakMap(), Ht = new WeakMap(), se = new WeakMap(), re = new WeakMap(), $t = new WeakMap(), yt = new WeakMap(), ne = new WeakMap(), oe = new WeakMap(), d(rs, "RowManager");
599
+ let ke = rs;
600
+ const ie = class ie {
601
601
  /**
602
602
  * 🎯 레이아웃 내의 여러 rawTables 배열을 일괄로 받아 단일 마스터 템플릿으로 사전 컴파일합니다.
603
603
  */
604
- static compileAll(r) {
605
- return Array.isArray(r) ? r.map((e) => ae.compile(e)) : [];
604
+ static compileAll(s) {
605
+ return Array.isArray(s) ? s.map((e) => ie.compile(e)) : [];
606
606
  }
607
607
  /**
608
608
  * 🎯 단일 원본 테이블을 받아 기본 구조 보정 및 2차원 격자 인덱스 사전 부여 완료된 마스터 테이블 반환
609
609
  */
610
- static compile(r) {
611
- if (!r) return null;
612
- const e = /* @__PURE__ */ h((a) => {
613
- a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
614
- const g = l.getAttribute("cell-type") || "renderer";
610
+ static compile(s) {
611
+ if (!s) return null;
612
+ const e = /* @__PURE__ */ d((i) => {
613
+ i.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
614
+ const f = l.getAttribute("cell-type") || "renderer";
615
615
  if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
616
- let f = `cell-${g}`;
617
- const b = l.getAttribute("data-bind"), u = l.getAttribute("data-expr"), p = l.getAttribute("maxbyte"), m = l.getAttribute("type");
616
+ let u = `cell-${f}`;
617
+ const b = l.getAttribute("data-bind"), g = l.getAttribute("data-expr"), y = l.getAttribute("maxbyte"), x = l.getAttribute("type");
618
618
  let w = [];
619
- b && w.push(`data-bind="${b}"`), u && w.push(`data-expr="${u}"`), p && w.push(`maxbyte="${p}"`), m && w.push(`type="${m}"`), l.innerHTML = `<${f} ${w.join(" ")}></${f}>`;
620
- }), a.querySelectorAll("tbody td, tfoot td").forEach((l) => {
619
+ b && w.push(`data-bind="${b}"`), g && w.push(`data-expr="${g}"`), y && w.push(`maxbyte="${y}"`), x && w.push(`type="${x}"`), l.innerHTML = `<${u} ${w.join(" ")}></${u}>`;
620
+ }), i.querySelectorAll("tbody td, tfoot td").forEach((l) => {
621
621
  l.setAttribute("tabindex", "0");
622
622
  });
623
- }, "processCellTypes"), s = /* @__PURE__ */ h((a) => {
624
- if (!a.querySelector("colgroup")) {
625
- const c = a.querySelector("tbody tr") || a.querySelector("tr"), l = c ? c.querySelectorAll("th, td").length : 1, g = document.createElement("colgroup"), f = Math.max(Math.floor(a.clientWidth / l), 100);
623
+ }, "processCellTypes"), r = /* @__PURE__ */ d((i) => {
624
+ if (!i.querySelector("colgroup")) {
625
+ const c = i.querySelector("tbody tr") || i.querySelector("tr"), l = c ? c.querySelectorAll("th, td").length : 1, f = document.createElement("colgroup"), u = Math.max(Math.floor(i.clientWidth / l), 100);
626
626
  for (let b = 0; b < l; b++) {
627
- const u = document.createElement("col");
628
- u.setAttribute("width", f), g.appendChild(u);
627
+ const g = document.createElement("col");
628
+ g.setAttribute("width", u), f.appendChild(g);
629
629
  }
630
- a.prepend(g);
630
+ i.prepend(f);
631
631
  }
632
- if (!a.querySelector("thead")) {
633
- const c = document.createElement("thead"), l = a.querySelector("colgroup");
634
- l ? l.after(c) : a.prepend(c);
632
+ if (!i.querySelector("thead")) {
633
+ const c = document.createElement("thead"), l = i.querySelector("colgroup");
634
+ l ? l.after(c) : i.prepend(c);
635
635
  }
636
- a.classList.add("nine-table-element");
637
- }, "ensureTableStructure"), n = /* @__PURE__ */ h((a, c) => {
638
- const l = Array.from(a.querySelectorAll(c + " tr")), g = Array.from(a.querySelectorAll(c + " th," + c + " td")), f = l.length;
639
- if (f === 0 || g.length === 0) return;
636
+ i.classList.add("nine-table-element");
637
+ }, "ensureTableStructure"), n = /* @__PURE__ */ d((i, c) => {
638
+ const l = Array.from(i.querySelectorAll(c + " tr")), f = Array.from(i.querySelectorAll(c + " th," + c + " td")), u = l.length;
639
+ if (u === 0 || f.length === 0) return;
640
640
  let b = 0;
641
- g.forEach((p) => {
642
- b += p.colSpan || 1;
641
+ f.forEach((y) => {
642
+ b += y.colSpan || 1;
643
643
  });
644
- const u = Array.from(Array(f), () => Array(b).fill(null));
645
- l.forEach((p) => {
646
- const m = p.sectionRowIndex;
644
+ const g = Array.from(Array(u), () => Array(b).fill(null));
645
+ l.forEach((y) => {
646
+ const x = y.sectionRowIndex;
647
647
  let w = 0;
648
- p.dataset.subrowIndex = m, Array.from(p.querySelectorAll("th,td")).forEach((x) => {
649
- for (let M = 0; M < u[m].length; M++)
650
- if (u[m][M] === null) {
651
- w = M;
648
+ y.dataset.subrow = x, Array.from(y.querySelectorAll("th,td")).forEach((m) => {
649
+ for (let _ = 0; _ < g[x].length; _++)
650
+ if (g[x][_] === null) {
651
+ w = _;
652
652
  break;
653
653
  }
654
- const C = x.rowSpan || 1, S = x.colSpan || 1;
655
- for (let M = 0; M < C; M++)
656
- for (let W = 0; W < S; W++)
657
- m + M < f && w + W < b && (u[m + M][w + W] = M === 0 && W === 0 ? "1" : "0");
654
+ const E = m.rowSpan || 1, S = m.colSpan || 1;
655
+ for (let _ = 0; _ < E; _++)
656
+ for (let bt = 0; bt < S; bt++)
657
+ x + _ < u && w + bt < b && (g[x + _][w + bt] = _ === 0 && bt === 0 ? "1" : "0");
658
658
  });
659
- }), l.forEach((p) => {
660
- const m = p.sectionRowIndex;
661
- Array.from(p.querySelectorAll("th,td")).forEach((w) => {
662
- for (let x = 0; x < u[m].length; x++)
663
- if (u[m][x] === "1") {
664
- w.dataset.col = x, u[m][x] = "0";
659
+ }), l.forEach((y) => {
660
+ const x = y.sectionRowIndex;
661
+ Array.from(y.querySelectorAll("th,td")).forEach((w) => {
662
+ for (let m = 0; m < g[x].length; m++)
663
+ if (g[x][m] === "1") {
664
+ w.dataset.col = m, g[x][m] = "0";
665
665
  break;
666
666
  }
667
667
  });
668
668
  });
669
- }, "resetColIndex"), i = r.cloneNode(!0);
670
- return s(i), e(i), n(i, "thead"), n(i, "tbody"), n(i, "tfoot"), Array.from(i.querySelectorAll("colgroup col")).forEach((a, c) => {
671
- const l = a.getAttribute("fixed");
672
- l && i.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((g) => {
673
- g.setAttribute("fixed", l);
669
+ }, "resetColIndex"), a = s.cloneNode(!0);
670
+ return r(a), e(a), n(a, "thead"), n(a, "tbody"), n(a, "tfoot"), Array.from(a.querySelectorAll("colgroup col")).forEach((i, c) => {
671
+ const l = i.getAttribute("fixed");
672
+ l && a.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((f) => {
673
+ f.setAttribute("fixed", l);
674
674
  });
675
- }), i;
675
+ }), a;
676
676
  }
677
677
  // 🎯 [추가] td/th에 선언된 cell-type 속성을 읽어 커스텀 태그로 자동 감싸기
678
678
  };
679
- h(ae, "TableCompiler");
680
- let Ie = ae;
681
- var N, X, K, qt, vs;
682
- const os = class os {
683
- constructor(r) {
684
- d(this, K);
685
- d(this, N);
686
- d(this, X, { startRow: -1, startCol: -1, endRow: -1, endCol: -1 });
687
- E(this, "render", /* @__PURE__ */ h(() => {
688
- const { startRow: r, startCol: e, endRow: s, endCol: n } = t(this, X);
689
- q.log("🎨 [CellSelection.render] Rendering range ->", t(this, X));
690
- const i = t(this, N).querySelectorAll(
679
+ d(ie, "TableCompiler");
680
+ let Le = ie;
681
+ var H, Y, U, Et, Ss;
682
+ const ns = class ns {
683
+ constructor(s) {
684
+ h(this, U);
685
+ h(this, H);
686
+ h(this, Y, { startRow: -1, startCol: -1, endRow: -1, endCol: -1 });
687
+ q(this, "render", /* @__PURE__ */ d(() => {
688
+ const { startRow: s, startCol: e, endRow: r, endCol: n } = t(this, Y);
689
+ T.log("🎨 [CellSelection.render] Rendering range ->", t(this, Y));
690
+ const a = t(this, H).querySelectorAll(
691
691
  ".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
692
692
  );
693
- if (i.forEach((a) => {
694
- a.querySelectorAll(".selected, .selected-top, .selected-bottom, .selected-left, .selected-right").forEach((c) => {
693
+ if (a.forEach((i) => {
694
+ i.querySelectorAll(".selected, .selected-top, .selected-bottom, .selected-left, .selected-right").forEach((c) => {
695
695
  c.classList.remove("selected", "selected-top", "selected-bottom", "selected-left", "selected-right");
696
696
  });
697
- }), r < 0 || e < 0) {
698
- q.log("⚠️ [CellSelection.render] Range is invalid (< 0), skipping render.");
697
+ }), s < 0 || e < 0) {
698
+ T.log("⚠️ [CellSelection.render] Range is invalid (< 0), skipping render.");
699
699
  return;
700
700
  }
701
701
  let o = 0;
702
- i.forEach((a) => {
703
- a.querySelectorAll("tbody tr").forEach((c) => {
704
- const { matrixRow: l } = Y(this, K, qt).call(this, c);
705
- l < 0 || c.querySelectorAll("td, th").forEach((g) => {
706
- const f = parseInt(g.dataset.col, 10);
707
- if (isNaN(f)) return;
708
- const b = parseInt(g.rowSpan || 1, 10), u = parseInt(g.colSpan || 1, 10), p = l + b - 1, m = f + u - 1;
709
- p >= r && l <= s && m >= e && f <= n && (o++, g.classList.add("selected"), q.log(g, r, e, s, n), l <= r && g.classList.add("selected-top"), p >= s && g.classList.add("selected-bottom"), f <= e && g.classList.add("selected-left"), m >= n && g.classList.add("selected-right"));
702
+ a.forEach((i) => {
703
+ i.querySelectorAll("tbody tr").forEach((c) => {
704
+ const { matrixRow: l } = j(this, U, Et).call(this, c);
705
+ l < 0 || c.querySelectorAll("td, th").forEach((f) => {
706
+ const u = parseInt(f.dataset.col, 10);
707
+ if (isNaN(u)) return;
708
+ const b = parseInt(f.rowSpan || 1, 10), g = parseInt(f.colSpan || 1, 10), y = l + b - 1, x = u + g - 1;
709
+ y >= s && l <= r && x >= e && u <= n && (o++, f.classList.add("selected"), T.log(f, s, e, r, n), l <= s && f.classList.add("selected-top"), y >= r && f.classList.add("selected-bottom"), u <= e && f.classList.add("selected-left"), x >= n && f.classList.add("selected-right"));
710
710
  });
711
711
  });
712
- }), q.log(`✨ [CellSelection.render] Total rendered cells marked: ${o}`);
712
+ }), T.log(`✨ [CellSelection.render] Total rendered cells marked: ${o}`);
713
713
  }, "render"));
714
- y(this, N, r), Y(this, K, vs).call(this), t(this, N).querySelectorAll(
714
+ p(this, H, s), j(this, U, Ss).call(this), t(this, H).querySelectorAll(
715
715
  ".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
716
- ).forEach((s) => {
717
- s.addEventListener("scroll", () => {
718
- t(this, X).startRow >= 0 && t(this, X).startCol >= 0 && this.render();
716
+ ).forEach((r) => {
717
+ r.addEventListener("scroll", () => {
718
+ t(this, Y).startRow >= 0 && t(this, Y).startCol >= 0 && this.render();
719
719
  });
720
- }), q.log("🎯 [CellSelection] Initialized");
720
+ }), T.log("🎯 [CellSelection] Initialized");
721
721
  }
722
- setRange(r, e, s, n) {
723
- q.log(`🔍 [CellSelection.setRange] Input -> startRow: ${r}, startCol: ${e}, endRow: ${s}, endCol: ${n}`);
724
- let i = Math.min(r, s), o = Math.max(r, s), a = Math.min(e, n), c = Math.max(e, n);
725
- const l = t(this, N).querySelectorAll(
722
+ setRange(s, e, r, n) {
723
+ T.log(`🔍 [CellSelection.setRange] Input -> startRow: ${s}, startCol: ${e}, endRow: ${r}, endCol: ${n}`);
724
+ let a = Math.min(s, r), o = Math.max(s, r), i = Math.min(e, n), c = Math.max(e, n);
725
+ const l = t(this, H).querySelectorAll(
726
726
  ".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
727
727
  );
728
- let g = !0, f = 0;
729
- for (; g && f < 5; )
730
- g = !1, f++, l.forEach((b) => {
731
- b.querySelectorAll("tbody tr").forEach((u) => {
732
- if (u.classList.contains("nodata")) return;
733
- const { matrixRow: p } = Y(this, K, qt).call(this, u);
734
- p < 0 || u.querySelectorAll("td, th").forEach((m) => {
735
- const w = parseInt(m.dataset.col, 10);
728
+ let f = !0, u = 0;
729
+ for (; f && u < 5; )
730
+ f = !1, u++, l.forEach((b) => {
731
+ b.querySelectorAll("tbody tr").forEach((g) => {
732
+ if (g.classList.contains("nodata")) return;
733
+ const { matrixRow: y } = j(this, U, Et).call(this, g);
734
+ y < 0 || g.querySelectorAll("td, th").forEach((x) => {
735
+ const w = parseInt(x.dataset.col, 10);
736
736
  if (isNaN(w)) return;
737
- const x = parseInt(m.rowSpan || 1, 10), C = parseInt(m.colSpan || 1, 10), S = p + x - 1, M = w + C - 1;
738
- if (S >= i && p <= o && M >= a && w <= c) {
739
- const B = Math.min(i, p), Kt = Math.max(o, S), ps = Math.min(a, w), ys = Math.max(c, M);
740
- (B !== i || Kt !== o || ps !== a || ys !== c) && (i = B, o = Kt, a = ps, c = ys, g = !0);
737
+ const m = parseInt(x.rowSpan || 1, 10), E = parseInt(x.colSpan || 1, 10), S = y + m - 1, _ = w + E - 1;
738
+ if (S >= a && y <= o && _ >= i && w <= c) {
739
+ const bs = Math.min(a, y), ps = Math.max(o, S), ys = Math.min(i, w), ms = Math.max(c, _);
740
+ (bs !== a || ps !== o || ys !== i || ms !== c) && (a = bs, o = ps, i = ys, c = ms, f = !0);
741
741
  }
742
742
  });
743
743
  });
744
744
  });
745
- y(this, X, { startRow: i, startCol: a, endRow: o, endCol: c }), q.log("📦 [CellSelection.setRange] Final Range ->", t(this, X)), this.render();
745
+ p(this, Y, { startRow: a, startCol: i, endRow: o, endCol: c }), T.log("📦 [CellSelection.setRange] Final Range ->", t(this, Y)), this.render();
746
746
  }
747
747
  };
748
- N = new WeakMap(), X = new WeakMap(), K = new WeakSet(), qt = /* @__PURE__ */ h(function(r) {
749
- if (!r || r.classList.contains("nodata")) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
750
- const e = parseInt(r.dataset.row, 10);
748
+ H = new WeakMap(), Y = new WeakMap(), U = new WeakSet(), Et = /* @__PURE__ */ d(function(s) {
749
+ if (!s || s.classList.contains("nodata")) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
750
+ const e = parseInt(s.dataset.row, 10);
751
751
  if (isNaN(e)) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
752
- const s = r.closest("tbody"), i = Array.from(s.querySelectorAll("tr:not(.nodata)")).filter((l) => parseInt(l.dataset.row, 10) === e), o = i.indexOf(r), a = i.length > 0 ? i.length : 1, c = e * a + (o >= 0 ? o : r.sectionRowIndex % a);
752
+ const r = s.closest("tbody"), a = Array.from(r.querySelectorAll("tr:not(.nodata)")).filter((l) => parseInt(l.dataset.row, 10) === e), o = a.indexOf(s), i = a.length > 0 ? a.length : 1, c = e * i + (o >= 0 ? o : s.sectionRowIndex % i);
753
753
  return { dataRow: e, subRowIndex: o, matrixRow: c };
754
- }, "#getMatrixRow"), vs = /* @__PURE__ */ h(function() {
755
- const r = t(this, N).querySelector(".ng-container-top");
756
- if (!r) {
757
- q.log("❌ [CellSelection] .ng-container-top not found!");
754
+ }, "#getMatrixRow"), Ss = /* @__PURE__ */ d(function() {
755
+ const s = t(this, H).querySelector(".ng-container-top");
756
+ if (!s) {
757
+ T.log("❌ [CellSelection] .ng-container-top not found!");
758
758
  return;
759
759
  }
760
- r.addEventListener("mousedown", (e) => {
760
+ s.addEventListener("mousedown", (e) => {
761
761
  if (e.button !== 0) return;
762
- const s = e.target.closest("td, th");
763
- if (!s || s.dataset.row === void 0 || s.dataset.col === void 0 || s.closest("tr").classList.contains("nodata")) return;
764
- t(this, N).style.userSelect = "none", t(this, N).style.webkitUserSelect = "none";
765
- const n = s.closest("tr"), { matrixRow: i } = Y(this, K, qt).call(this, n), o = parseInt(s.dataset.col, 10);
766
- if (i < 0) {
767
- t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "";
762
+ const r = e.target.closest("td, th");
763
+ if (!r || r.dataset.row === void 0 || r.dataset.col === void 0 || r.closest("tr").classList.contains("nodata")) return;
764
+ t(this, H).style.userSelect = "none", t(this, H).style.webkitUserSelect = "none";
765
+ const n = r.closest("tr"), { matrixRow: a } = j(this, U, Et).call(this, n), o = parseInt(r.dataset.col, 10);
766
+ if (a < 0) {
767
+ t(this, H).style.userSelect = "", t(this, H).style.webkitUserSelect = "";
768
768
  return;
769
769
  }
770
- q.log(`🖱️ [MouseDown Success] startRow: ${i}, startCol: ${o}`), t(this, N).navigation.currentCell = s;
771
- let a = i, c = o;
772
- const l = /* @__PURE__ */ h((f) => {
773
- const b = document.elementFromPoint(f.clientX, f.clientY);
774
- let u = b == null ? void 0 : b.closest("td, th");
775
- if (!u || !t(this, N).contains(u)) {
776
- const x = t(this, N).querySelectorAll(".ng-part-body tbody tr:not(.nodata) td, .ng-part-body tbody tr:not(.nodata) th");
777
- for (const C of x) {
778
- const S = C.getBoundingClientRect();
779
- if (f.clientX >= S.left && f.clientX <= S.right && f.clientY >= S.top && f.clientY <= S.bottom) {
780
- u = C;
770
+ T.log(`🖱️ [MouseDown Success] startRow: ${a}, startCol: ${o}`), t(this, H).navigation.currentCell = r;
771
+ let i = a, c = o;
772
+ const l = /* @__PURE__ */ d((u) => {
773
+ const b = document.elementFromPoint(u.clientX, u.clientY);
774
+ let g = b == null ? void 0 : b.closest("td, th");
775
+ if (!g || !t(this, H).contains(g)) {
776
+ const m = t(this, H).querySelectorAll(".ng-part-body tbody tr:not(.nodata) td, .ng-part-body tbody tr:not(.nodata) th");
777
+ for (const E of m) {
778
+ const S = E.getBoundingClientRect();
779
+ if (u.clientX >= S.left && u.clientX <= S.right && u.clientY >= S.top && u.clientY <= S.bottom) {
780
+ g = E;
781
781
  break;
782
782
  }
783
783
  }
784
784
  }
785
- if (!u || u.dataset.row === void 0 || u.dataset.col === void 0 || u.closest("tr").classList.contains("nodata")) return;
786
- const p = u.closest("tr"), { matrixRow: m } = Y(this, K, qt).call(this, p), w = parseInt(u.dataset.col, 10);
787
- m < 0 || a === m && c === w || (a = m, c = w, this.setRange(i, o, m, w));
788
- }, "onMouseMove"), g = /* @__PURE__ */ h(() => {
789
- q.log("🖱️ [MouseUp] Drag ended."), t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "", document.removeEventListener("mousemove", l), document.removeEventListener("mouseup", g);
785
+ if (!g || g.dataset.row === void 0 || g.dataset.col === void 0 || g.closest("tr").classList.contains("nodata")) return;
786
+ const y = g.closest("tr"), { matrixRow: x } = j(this, U, Et).call(this, y), w = parseInt(g.dataset.col, 10);
787
+ x < 0 || i === x && c === w || (i = x, c = w, this.setRange(a, o, x, w));
788
+ }, "onMouseMove"), f = /* @__PURE__ */ d(() => {
789
+ T.log("🖱️ [MouseUp] Drag ended."), t(this, H).style.userSelect = "", t(this, H).style.webkitUserSelect = "", document.removeEventListener("mousemove", l), document.removeEventListener("mouseup", f);
790
790
  }, "onMouseUp");
791
- document.addEventListener("mousemove", l), document.addEventListener("mouseup", g);
791
+ document.addEventListener("mousemove", l), document.addEventListener("mouseup", f);
792
792
  });
793
- }, "#initEvents"), h(os, "CellSelection");
794
- let Me = os;
795
- var F, ct, le, ce, pt, $e, _t, Ot, Dt, ht, Wt, Ss;
796
- const is = class is {
797
- constructor(r) {
798
- d(this, pt);
799
- d(this, F);
800
- d(this, ct, null);
801
- d(this, le, -1);
802
- d(this, ce, -1);
803
- d(this, _t, /* @__PURE__ */ h((r) => {
793
+ }, "#initEvents"), d(ns, "CellSelection");
794
+ let Ie = ns;
795
+ var B, at, Nt, ae, le, gt, He, _t, Ot, Dt, lt, Wt, Rs;
796
+ const os = class os {
797
+ constructor(s) {
798
+ h(this, gt);
799
+ h(this, B);
800
+ h(this, at, null);
801
+ h(this, Nt, null);
802
+ h(this, ae, -1);
803
+ h(this, le, -1);
804
+ h(this, _t, /* @__PURE__ */ d((s) => {
804
805
  const e = [];
805
- return r.forEach((s) => e.push(...Array.from(s.querySelectorAll("td")))), e.length === 0 ? null : (e.sort((s, n) => parseInt(s.dataset.col, 10) - parseInt(n.dataset.col, 10)), e[e.length - 1]);
806
+ return s.forEach((r) => e.push(...Array.from(r.querySelectorAll("td")))), e.length === 0 ? null : (e.sort((r, n) => parseInt(r.dataset.col, 10) - parseInt(n.dataset.col, 10)), e[e.length - 1]);
806
807
  }, "#getMaxColCell"));
807
- d(this, Ot, /* @__PURE__ */ h((r, e) => {
808
- const s = t(this, ht).call(this, r);
809
- if (s.length === 0) return e + 1;
808
+ h(this, Ot, /* @__PURE__ */ d((s, e) => {
809
+ const r = t(this, lt).call(this, s);
810
+ if (r.length === 0) return e + 1;
810
811
  let n = e + 1;
811
- const i = [];
812
- s.forEach((o) => i.push(...Array.from(o.querySelectorAll("td")))), i.sort((o, a) => parseInt(o.dataset.col, 10) - parseInt(a.dataset.col, 10));
813
- for (const o of i) {
814
- const a = parseInt(o.dataset.col, 10), c = parseInt(o.colSpan || 1, 10);
815
- if (e >= a && e < a + c) {
816
- n = a + c;
812
+ const a = [];
813
+ r.forEach((o) => a.push(...Array.from(o.querySelectorAll("td")))), a.sort((o, i) => parseInt(o.dataset.col, 10) - parseInt(i.dataset.col, 10));
814
+ for (const o of a) {
815
+ const i = parseInt(o.dataset.col, 10), c = parseInt(o.colSpan || 1, 10);
816
+ if (e >= i && e < i + c) {
817
+ n = i + c;
817
818
  break;
818
819
  }
819
820
  }
820
821
  return n;
821
822
  }, "#getNextCol"));
822
- d(this, Dt, /* @__PURE__ */ h((r, e) => {
823
- const s = t(this, ht).call(this, r);
824
- if (s.length === 0) return Math.max(0, e - 1);
823
+ h(this, Dt, /* @__PURE__ */ d((s, e) => {
824
+ const r = t(this, lt).call(this, s);
825
+ if (r.length === 0) return Math.max(0, e - 1);
825
826
  let n = -1;
826
- const i = [];
827
- s.forEach((o) => i.push(...Array.from(o.querySelectorAll("td")))), i.sort((o, a) => parseInt(o.dataset.col, 10) - parseInt(a.dataset.col, 10));
828
- for (const o of i) {
829
- const a = parseInt(o.dataset.col, 10);
830
- if (a < e)
831
- n = a;
827
+ const a = [];
828
+ r.forEach((o) => a.push(...Array.from(o.querySelectorAll("td")))), a.sort((o, i) => parseInt(o.dataset.col, 10) - parseInt(i.dataset.col, 10));
829
+ for (const o of a) {
830
+ const i = parseInt(o.dataset.col, 10);
831
+ if (i < e)
832
+ n = i;
832
833
  else
833
834
  break;
834
835
  }
835
836
  return n;
836
837
  }, "#getPreviousCol"));
837
838
  // 🎯 레거시의 병합 셀(rowSpan) 블록 포용 탐색 로직 이식
838
- d(this, ht, /* @__PURE__ */ h((r) => {
839
- const e = t(this, F).querySelectorAll(
839
+ h(this, lt, /* @__PURE__ */ d((s) => {
840
+ const e = t(this, B).querySelectorAll(
840
841
  ".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
841
- ), s = [];
842
+ ), r = [];
842
843
  return e.forEach((n) => {
843
- const i = Array.from(n.querySelectorAll("tbody tr:not(.nodata)"));
844
- for (const o of i) {
845
- const a = parseInt(o.dataset.row, 10), c = i.filter((p) => parseInt(p.dataset.row, 10) === a), l = c.length > 0 ? c.length : 1, g = c.indexOf(o), f = a * l + (g >= 0 ? g : 0);
846
- if (f === r) {
847
- s.push(o);
844
+ const a = Array.from(n.querySelectorAll("tbody tr:not(.nodata)"));
845
+ for (const o of a) {
846
+ const i = parseInt(o.dataset.row, 10), c = a.filter((y) => parseInt(y.dataset.row, 10) === i), l = c.length > 0 ? c.length : 1, f = c.indexOf(o), u = i * l + (f >= 0 ? f : 0);
847
+ if (u === s) {
848
+ r.push(o);
848
849
  break;
849
850
  }
850
851
  const b = Array.from(o.querySelectorAll("td"));
851
- let u = !1;
852
- for (const p of b) {
853
- const m = parseInt(p.rowSpan || 1, 10);
854
- if (m > 1 && r >= f && r < f + m) {
855
- s.push(o), u = !0;
852
+ let g = !1;
853
+ for (const y of b) {
854
+ const x = parseInt(y.rowSpan || 1, 10);
855
+ if (x > 1 && s >= u && s < u + x) {
856
+ r.push(o), g = !0;
856
857
  break;
857
858
  }
858
859
  }
859
- if (u) break;
860
+ if (g) break;
860
861
  }
861
- }), s;
862
+ }), r;
862
863
  }, "#findTargetTrsByMatrix"));
863
864
  // 🎯 rowSpan 및 colSpan 경계를 모두 충족하는 셀을 3분할 전체 영역에서 탐색
864
- d(this, Wt, /* @__PURE__ */ h((r, e, s, n) => {
865
- const i = t(this, F).querySelectorAll(
865
+ h(this, Wt, /* @__PURE__ */ d((s, e, r, n) => {
866
+ const a = t(this, B).querySelectorAll(
866
867
  ".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
867
- ), o = n !== void 0 ? n : r * 1 + e;
868
- for (const a of i) {
869
- const c = Array.from(a.querySelectorAll("tbody tr:not(.nodata)"));
868
+ ), o = n !== void 0 ? n : s * 1 + e;
869
+ for (const i of a) {
870
+ const c = Array.from(i.querySelectorAll("tbody tr:not(.nodata)"));
870
871
  for (const l of c) {
871
- const g = parseInt(l.dataset.row, 10), f = c.filter((w) => parseInt(w.dataset.row, 10) === g), b = f.length > 0 ? f.length : 1, u = f.indexOf(l), p = g * b + (u >= 0 ? u : 0), m = Array.from(l.querySelectorAll("td"));
872
- for (const w of m) {
873
- const x = parseInt(w.dataset.col, 10), C = parseInt(w.colSpan || 1, 10), S = parseInt(w.rowSpan || 1, 10);
874
- if (!isNaN(x) && s >= x && s < x + C && o >= p && o < p + S && window.getComputedStyle(w).display !== "none")
872
+ const f = parseInt(l.dataset.row, 10), u = c.filter((w) => parseInt(w.dataset.row, 10) === f), b = u.length > 0 ? u.length : 1, g = u.indexOf(l), y = f * b + (g >= 0 ? g : 0), x = Array.from(l.querySelectorAll("td"));
873
+ for (const w of x) {
874
+ const m = parseInt(w.dataset.col, 10), E = parseInt(w.colSpan || 1, 10), S = parseInt(w.rowSpan || 1, 10);
875
+ if (!isNaN(m) && r >= m && r < m + E && o >= y && o < y + S && window.getComputedStyle(w).display !== "none")
875
876
  return w;
876
877
  }
877
878
  }
878
879
  }
879
880
  return null;
880
881
  }, "#getNearElement"));
881
- y(this, F, r), Y(this, pt, Ss).call(this), q.log("🎯 [CellNavigation] Initialized");
882
+ p(this, B, s), j(this, gt, Rs).call(this), T.log("🎯 [CellNavigation] Initialized");
882
883
  }
883
884
  get currentCell() {
884
- return t(this, ct);
885
- }
886
- set currentCell(r) {
887
- if (!r) return;
888
- y(this, ct, r), r.focus({ preventScroll: !0 });
889
- const e = parseInt(r.dataset.row, 10), s = parseInt(r.dataset.col, 10);
890
- if (!isNaN(e) && !isNaN(s)) {
891
- y(this, le, e), y(this, ce, s);
892
- const n = r.closest("tr"), i = n == null ? void 0 : n.closest("tbody");
893
- if (i) {
894
- const a = Array.from(i.querySelectorAll("tr:not(.nodata)")).filter((f) => parseInt(f.dataset.row, 10) === e), c = a.length > 0 ? a.length : 1, l = a.indexOf(n), g = e * c + (l >= 0 ? l : 0);
895
- t(this, F).selection.setRange(g, s, g, s);
885
+ return t(this, at);
886
+ }
887
+ set currentCell(s) {
888
+ if (!s) return;
889
+ p(this, at, s), s.focus({ preventScroll: !0 }), p(this, Nt, s.closest("tr"));
890
+ const e = parseInt(s.dataset.row, 10), r = parseInt(s.dataset.col, 10);
891
+ if (!isNaN(e) && !isNaN(r)) {
892
+ p(this, ae, e), p(this, le, r);
893
+ const n = s.closest("tr"), a = n == null ? void 0 : n.closest("tbody");
894
+ if (a) {
895
+ const i = Array.from(a.querySelectorAll("tr:not(.nodata)")).filter((u) => parseInt(u.dataset.row, 10) === e), c = i.length > 0 ? i.length : 1, l = i.indexOf(n), f = e * c + (l >= 0 ? l : 0);
896
+ t(this, B).selection.setRange(f, r, f, r);
896
897
  }
897
898
  }
898
899
  }
899
- moveCell(r) {
900
- var x, C, S, M;
901
- if (!t(this, ct)) return;
902
- const e = t(this, ct), s = e.closest("tr"), n = parseInt(e.dataset.row, 10), i = parseInt(e.dataset.col, 10), o = s == null ? void 0 : s.closest("tbody");
903
- if (!o) return;
904
- const c = Array.from(o.querySelectorAll("tr")).filter((W) => parseInt(W.dataset.row, 10) === n), l = t(this, F).templateLength, g = c.indexOf(s), f = n * l + (g >= 0 ? g : 0);
905
- let b = f, u = i;
906
- switch (r.code) {
900
+ moveCell(s) {
901
+ var g, y, x, w;
902
+ if (!t(this, at)) return;
903
+ const e = t(this, at), r = parseInt(e.dataset.row, 10), n = parseInt(e.dataset.col, 10), a = t(this, B).templateLength, o = t(this, Nt).dataset.subrow, i = r * a + (o >= 0 ? o : 0);
904
+ let c = i, l = n;
905
+ switch (s.code) {
907
906
  case "Tab":
908
- if (r.preventDefault(), r.shiftKey) {
909
- if (u = t(this, Dt).call(this, f, i), u < 0 && f > 0) {
910
- b = f - 1;
911
- const W = t(this, ht).call(this, b), B = t(this, _t).call(this, W);
912
- u = B ? parseInt(B.dataset.col, 10) : 0;
907
+ if (s.preventDefault(), s.shiftKey) {
908
+ if (l = t(this, Dt).call(this, i, n), l < 0 && i > 0) {
909
+ c = i - 1;
910
+ const m = t(this, lt).call(this, c), E = t(this, _t).call(this, m);
911
+ l = E ? parseInt(E.dataset.col, 10) : 0;
913
912
  }
914
913
  } else {
915
- u = t(this, Ot).call(this, f, i);
916
- const W = t(this, ht).call(this, f), B = t(this, _t).call(this, W), Kt = B ? parseInt(B.dataset.col, 10) + parseInt(B.colSpan || 1, 10) : 0;
917
- u >= Kt && (b = f + 1, u = 0);
914
+ l = t(this, Ot).call(this, i, n);
915
+ const m = t(this, lt).call(this, i), E = t(this, _t).call(this, m), S = E ? parseInt(E.dataset.col, 10) + parseInt(E.colSpan || 1, 10) : 0;
916
+ l >= S && (c = i + 1, l = 0);
918
917
  }
919
918
  break;
920
919
  case "ArrowRight":
921
- u = t(this, Ot).call(this, f, i);
920
+ l = t(this, Ot).call(this, i, n);
922
921
  break;
923
922
  case "ArrowLeft":
924
- u = t(this, Dt).call(this, f, i);
923
+ l = t(this, Dt).call(this, i, n);
925
924
  break;
926
925
  case "ArrowDown":
927
- r.preventDefault(), b = f + (e.rowSpan || 1), q.log("templateLength", l, "matrixRow:", f, "nextMatrixRow", b), q.log(s), q.log(s == null ? void 0 : s.dataset);
926
+ s.preventDefault(), c = i + (e.rowSpan || 1), T.log("templateLength", a, "matrixRow:", i, "nextMatrixRow", c);
928
927
  break;
929
928
  case "ArrowUp":
930
- r.preventDefault(), b = Math.max(0, f - (e.rowSpan || 1));
929
+ s.preventDefault(), c = Math.max(0, i - (e.rowSpan || 1));
931
930
  break;
932
931
  }
933
- const p = Math.floor(b / l), m = b % l;
934
- let w = t(this, Wt).call(this, p, m, u, b);
935
- if (q.log(w, p, m, u, b), w)
936
- this.currentCell = w, Y(this, pt, $e).call(this, w);
937
- else if (p !== n && p >= 0) {
938
- const W = ((C = (x = t(this, F)).getRowHeight) == null ? void 0 : C.call(x)) || 40;
939
- (M = (S = t(this, F)).scrollToY) == null || M.call(S, p * W), setTimeout(() => {
940
- const B = t(this, Wt).call(this, p, m, u, b);
941
- B && (this.currentCell = B, Y(this, pt, $e).call(this, B));
932
+ const f = Math.floor(c / a), u = c % a;
933
+ let b = t(this, Wt).call(this, f, u, l, c);
934
+ if (T.log(b, f, u, l, c), b)
935
+ this.currentCell = b, j(this, gt, He).call(this, b);
936
+ else if (f !== r && f >= 0) {
937
+ const m = ((y = (g = t(this, B)).getRowHeight) == null ? void 0 : y.call(g)) || 40;
938
+ (w = (x = t(this, B)).scrollToY) == null || w.call(x, f * m), setTimeout(() => {
939
+ const E = t(this, Wt).call(this, f, u, l, c);
940
+ E && (this.currentCell = E, j(this, gt, He).call(this, E));
942
941
  }, 0);
943
942
  }
944
943
  }
945
944
  };
946
- F = new WeakMap(), ct = new WeakMap(), le = new WeakMap(), ce = new WeakMap(), pt = new WeakSet(), // 🎯 셀이 보이지 않는 영역에 있을 때 컨테이너 스크롤을 동기화하는 함수
947
- $e = /* @__PURE__ */ h(function(r) {
948
- const e = t(this, F).querySelector(".ng-container-body .ng-part-body");
945
+ B = new WeakMap(), at = new WeakMap(), Nt = new WeakMap(), ae = new WeakMap(), le = new WeakMap(), gt = new WeakSet(), // 🎯 셀이 보이지 않는 영역에 있을 때 컨테이너 스크롤을 동기화하는 함수
946
+ He = /* @__PURE__ */ d(function(s) {
947
+ const e = t(this, B).querySelector(".ng-container-body .ng-part-body");
949
948
  if (!e) return;
950
- const s = r.getBoundingClientRect(), n = e.getBoundingClientRect();
951
- s.top < n.top ? e.scrollTop -= n.top - s.top : s.bottom > n.bottom && (e.scrollTop += s.bottom - n.bottom), s.left < n.left ? e.scrollLeft -= n.left - s.left : s.right > n.right && (e.scrollLeft += s.right - n.right);
952
- }, "#ensureCellVisible"), _t = new WeakMap(), Ot = new WeakMap(), Dt = new WeakMap(), ht = new WeakMap(), Wt = new WeakMap(), Ss = /* @__PURE__ */ h(function() {
953
- t(this, F).addEventListener("keydown", (r) => {
954
- ["Tab", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(r.code) && this.moveCell(r);
949
+ const r = s.getBoundingClientRect(), n = e.getBoundingClientRect();
950
+ r.top < n.top ? e.scrollTop -= n.top - r.top : r.bottom > n.bottom && (e.scrollTop += r.bottom - n.bottom), r.left < n.left ? e.scrollLeft -= n.left - r.left : r.right > n.right && (e.scrollLeft += r.right - n.right);
951
+ }, "#ensureCellVisible"), _t = new WeakMap(), Ot = new WeakMap(), Dt = new WeakMap(), lt = new WeakMap(), Wt = new WeakMap(), Rs = /* @__PURE__ */ d(function() {
952
+ t(this, B).addEventListener("keydown", (s) => {
953
+ ["Tab", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(s.code) && this.moveCell(s);
955
954
  });
956
- }, "#initEvents"), h(is, "CellNavigation");
957
- let He = is;
958
- var he, dt, zt, Bt, V, de, fe, xt, ue, ge;
959
- const Tt = class Tt extends HTMLElement {
955
+ }, "#initEvents"), d(os, "CellNavigation");
956
+ let Me = os;
957
+ var ce, ct, zt, Bt, F, he, de, mt, fe, ue;
958
+ const qt = class qt extends HTMLElement {
960
959
  constructor() {
961
960
  super();
962
- d(this, he);
963
- d(this, dt);
964
- d(this, zt);
965
- d(this, Bt);
966
- d(this, V, {
961
+ h(this, ce);
962
+ h(this, ct);
963
+ h(this, zt);
964
+ h(this, Bt);
965
+ h(this, F, {
967
966
  table: null
968
967
  });
969
- E(this, "invalidate", /* @__PURE__ */ h(() => {
970
- q.log("sheet.invalidate()"), t(this, dt).refresh();
968
+ q(this, "invalidate", /* @__PURE__ */ d(() => {
969
+ T.log("sheet.invalidate()"), t(this, ct).refresh();
971
970
  }, "invalidate"));
972
- E(this, "generate", /* @__PURE__ */ h((e) => {
973
- if (q.log("sheet.generate()"), !e) return;
974
- t(this, V).table = Ie.compile(e), t(this, V).tbody = {
975
- tr: t(this, V).table.querySelectorAll("tbody tr")
976
- }, t(this, de).call(this), t(this, fe).call(this);
977
- const s = this.querySelector(".ng-container-body .ng-part-header"), n = this.querySelector(".ng-container-body .ng-part-footer"), i = this.querySelector(".ng-nodata-overlay");
978
- s && i && (i.style.top = `${s.offsetHeight}px`), n && i && (i.style.bottom = `${n.offsetHeight}px`), t(this, dt).initialize(), setTimeout(() => {
971
+ q(this, "generate", /* @__PURE__ */ d((e) => {
972
+ if (T.log("sheet.generate()"), !e) return;
973
+ t(this, F).table = Le.compile(e), t(this, F).tbody = {
974
+ tr: t(this, F).table.querySelectorAll("tbody tr")
975
+ }, t(this, he).call(this), t(this, de).call(this);
976
+ const r = this.querySelector(".ng-container-body .ng-part-header"), n = this.querySelector(".ng-container-body .ng-part-footer"), a = this.querySelector(".ng-nodata-overlay");
977
+ r && a && (a.style.top = `${r.offsetHeight}px`), n && a && (a.style.bottom = `${n.offsetHeight}px`), t(this, ct).initialize(), setTimeout(() => {
979
978
  var o;
980
979
  (o = this.querySelector("nine-table-hscrollbar")) == null || o.refresh();
981
980
  }, 0);
982
981
  }, "generate"));
983
- d(this, de, /* @__PURE__ */ h(() => {
982
+ h(this, he, /* @__PURE__ */ d(() => {
984
983
  [
985
984
  { selector: ".ng-container-body", type: null },
986
985
  { selector: ".ng-container-left", type: "left" },
987
986
  { selector: ".ng-container-right", type: "right" }
988
- ].forEach(({ selector: s, type: n }) => {
989
- var i, o, a;
990
- (i = this.querySelector(`${s} .ng-part-header`)) == null || i.appendChild(t(this, xt).call(this, t(this, V).table, n, "header")), (o = this.querySelector(`${s} .ng-virtual-spacer`)) == null || o.before(t(this, xt).call(this, t(this, V).table, n, "body")), (a = this.querySelector(`${s} .ng-part-footer`)) == null || a.appendChild(t(this, xt).call(this, t(this, V).table, n, "footer"));
987
+ ].forEach(({ selector: r, type: n }) => {
988
+ var a, o, i;
989
+ (a = this.querySelector(`${r} .ng-part-header`)) == null || a.appendChild(t(this, mt).call(this, t(this, F).table, n, "header")), (o = this.querySelector(`${r} .ng-virtual-spacer`)) == null || o.before(t(this, mt).call(this, t(this, F).table, n, "body")), (i = this.querySelector(`${r} .ng-part-footer`)) == null || i.appendChild(t(this, mt).call(this, t(this, F).table, n, "footer"));
991
990
  });
992
991
  }, "#renderSplitContainers"));
993
- d(this, fe, /* @__PURE__ */ h(() => {
992
+ h(this, de, /* @__PURE__ */ d(() => {
994
993
  ["left", "right", "body"].forEach((e) => {
995
- const s = this.querySelector(`.ng-container-${e}`), n = s == null ? void 0 : s.querySelectorAll("table");
996
- if (!s || !n || n.length === 0) return;
997
- let i = 0;
994
+ const r = this.querySelector(`.ng-container-${e}`), n = r == null ? void 0 : r.querySelectorAll("table");
995
+ if (!r || !n || n.length === 0) return;
996
+ let a = 0;
998
997
  n[0].querySelectorAll("col").forEach((o) => {
999
- const a = parseInt(o.getAttribute("width"), 10);
1000
- isNaN(a) || (i += a);
1001
- }), e === "body" ? (s.style.flex = "1", n.forEach((o) => {
1002
- o.style.width = `${i}px`, o.style.minWidth = `${i}px`;
1003
- })) : (s.style.flex = `0 0 ${i}px`, s.style.width = `${i}px`, n.forEach((o) => {
1004
- o.style.width = `${i}px`, o.style.minWidth = `${i}px`;
998
+ const i = parseInt(o.getAttribute("width"), 10);
999
+ isNaN(i) || (a += i);
1000
+ }), e === "body" ? (r.style.flex = "1", n.forEach((o) => {
1001
+ o.style.width = `${a}px`, o.style.minWidth = `${a}px`;
1002
+ })) : (r.style.flex = `0 0 ${a}px`, r.style.width = `${a}px`, n.forEach((o) => {
1003
+ o.style.width = `${a}px`, o.style.minWidth = `${a}px`;
1005
1004
  }));
1006
1005
  });
1007
1006
  }, "#updateContainerWidths"));
1008
- d(this, xt, /* @__PURE__ */ h((e, s, n) => {
1009
- const i = e.cloneNode(!0), o = i.querySelector("thead"), a = i.querySelector("tbody"), c = i.querySelector("tfoot");
1007
+ h(this, mt, /* @__PURE__ */ d((e, r, n) => {
1008
+ const a = e.cloneNode(!0), o = a.querySelector("thead"), i = a.querySelector("tbody"), c = a.querySelector("tfoot");
1010
1009
  if (n === "header") {
1011
- if (a && a.remove(), c && c.remove(), e.querySelector("tbody")) {
1012
- const g = document.createElement("tbody");
1013
- g.className = "fixed-tbody", i.appendChild(g);
1010
+ if (i && i.remove(), c && c.remove(), e.querySelector("tbody")) {
1011
+ const f = document.createElement("tbody");
1012
+ f.className = "fixed-tbody", a.appendChild(f);
1014
1013
  }
1015
- } else n === "body" ? (o && o.remove(), c && c.remove(), a && (a.className = "bindable-tbody")) : n === "footer" && (o && o.remove(), a && a.remove());
1016
- return s === "left" ? i.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
1014
+ } else n === "body" ? (o && o.remove(), c && c.remove(), i && (i.className = "bindable-tbody")) : n === "footer" && (o && o.remove(), i && i.remove());
1015
+ return r === "left" ? a.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
1017
1016
  l.getAttribute("fixed") !== "left" && l.remove();
1018
- }) : s === "right" ? i.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
1017
+ }) : r === "right" ? a.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
1019
1018
  l.getAttribute("fixed") !== "right" && l.remove();
1020
- }) : i.querySelectorAll("[fixed=left], [fixed=right]").forEach((l) => {
1019
+ }) : a.querySelectorAll("[fixed=left], [fixed=right]").forEach((l) => {
1021
1020
  l.remove();
1022
- }), i;
1021
+ }), a;
1023
1022
  }, "#createSplitTable"));
1024
- E(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, dt).getRowHeight(), "getRowHeight"));
1025
- E(this, "scrollToX", /* @__PURE__ */ h((e) => {
1026
- const s = this.querySelector(".ng-container-body .ng-part-body");
1027
- s && (s.scrollLeft = e);
1023
+ q(this, "getRowHeight", /* @__PURE__ */ d(() => t(this, ct).getRowHeight(), "getRowHeight"));
1024
+ q(this, "scrollToX", /* @__PURE__ */ d((e) => {
1025
+ const r = this.querySelector(".ng-container-body .ng-part-body");
1026
+ r && (r.scrollLeft = e);
1028
1027
  }, "scrollToX"));
1029
- E(this, "scrollToY", /* @__PURE__ */ h((e) => {
1030
- const s = this.querySelector(".ng-container-body .ng-part-body");
1031
- s && (s.scrollTop = e);
1028
+ q(this, "scrollToY", /* @__PURE__ */ d((e) => {
1029
+ const r = this.querySelector(".ng-container-body .ng-part-body");
1030
+ r && (r.scrollTop = e);
1032
1031
  }, "scrollToY"));
1033
- d(this, ue, /* @__PURE__ */ h(() => {
1034
- t(this, ge).call(this), y(this, zt, new Me(this)), y(this, Bt, new He(this));
1032
+ h(this, fe, /* @__PURE__ */ d(() => {
1033
+ t(this, ue).call(this), p(this, zt, new Ie(this)), p(this, Bt, new Me(this));
1035
1034
  }, "#init"));
1036
- d(this, ge, /* @__PURE__ */ h(() => {
1037
- const e = Tt.SCROLLBAR_SIZE;
1035
+ h(this, ue, /* @__PURE__ */ d(() => {
1036
+ const e = qt.SCROLLBAR_SIZE;
1038
1037
  this.innerHTML = `
1039
1038
  <style>
1040
1039
  nine-table-sheet {
@@ -1235,108 +1234,108 @@ const Tt = class Tt extends HTMLElement {
1235
1234
  </div>
1236
1235
  `;
1237
1236
  }, "#render"));
1238
- y(this, dt, new Le(this)), y(this, he, this.getRootNode().host);
1237
+ p(this, ct, new ke(this)), p(this, ce, this.getRootNode().host);
1239
1238
  }
1240
1239
  connectedCallback() {
1241
- t(this, ue).call(this);
1240
+ t(this, fe).call(this);
1242
1241
  }
1243
1242
  get selection() {
1244
1243
  return t(this, zt);
1245
1244
  }
1246
1245
  get templateLength() {
1247
- return t(this, V).tbody.tr.length;
1246
+ return t(this, F).tbody.tr.length;
1248
1247
  }
1249
1248
  get navigation() {
1250
1249
  return t(this, Bt);
1251
1250
  }
1252
1251
  disconnectedCallback() {
1253
- this.innerHTML = "", q.log("NineTableSheet destroyed.");
1252
+ this.innerHTML = "", T.log("NineTableSheet destroyed.");
1254
1253
  }
1255
1254
  };
1256
- he = new WeakMap(), dt = new WeakMap(), zt = new WeakMap(), Bt = new WeakMap(), V = new WeakMap(), de = new WeakMap(), fe = new WeakMap(), xt = new WeakMap(), ue = new WeakMap(), ge = new WeakMap(), h(Tt, "NineTableSheet"), E(Tt, "SCROLLBAR_SIZE", 16);
1257
- let Gt = Tt;
1258
- customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", Gt);
1259
- var be, Pt;
1260
- const as = class as extends HTMLElement {
1255
+ ce = new WeakMap(), ct = new WeakMap(), zt = new WeakMap(), Bt = new WeakMap(), F = new WeakMap(), he = new WeakMap(), de = new WeakMap(), mt = new WeakMap(), fe = new WeakMap(), ue = new WeakMap(), d(qt, "NineTableSheet"), q(qt, "SCROLLBAR_SIZE", 16);
1256
+ let Kt = qt;
1257
+ customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", Kt);
1258
+ var ge, Pt;
1259
+ const is = class is extends HTMLElement {
1261
1260
  constructor() {
1262
1261
  super();
1263
- d(this, be, /* @__PURE__ */ h(() => {
1262
+ h(this, ge, /* @__PURE__ */ d(() => {
1264
1263
  var e;
1265
- (e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
1264
+ (e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (r) => {
1266
1265
  var o;
1267
- const n = s.ctrlKey || s.metaKey || s.shiftKey, i = parseInt((o = s.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
1268
- t(this, Pt).call(this, i, n);
1266
+ const n = r.ctrlKey || r.metaKey || r.shiftKey, a = parseInt((o = r.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
1267
+ t(this, Pt).call(this, a, n);
1269
1268
  }), t(this, Pt).call(this, 0, !1);
1270
1269
  }, "#init"));
1271
- d(this, Pt, /* @__PURE__ */ h((e, s = !1) => {
1272
- const n = /* @__PURE__ */ h(() => {
1273
- const g = Array.from(this.querySelectorAll("nine-table-sheet"));
1274
- Array.from(this.querySelectorAll("nine-splitter")).forEach((u) => u.style.setProperty("display", "none"));
1275
- const b = g.filter((u) => u.classList.contains("active"));
1276
- b.length < 2 || b.forEach((u) => {
1277
- const p = parseInt(u.getAttribute("data-index"), 10), m = this.querySelector(`nine-splitter[data-split-index="${p}"]`), w = g[p + 1];
1278
- m && w && w.classList.contains("active") && m.style.setProperty("display", "flex");
1270
+ h(this, Pt, /* @__PURE__ */ d((e, r = !1) => {
1271
+ const n = /* @__PURE__ */ d(() => {
1272
+ const f = Array.from(this.querySelectorAll("nine-table-sheet"));
1273
+ Array.from(this.querySelectorAll("nine-splitter")).forEach((g) => g.style.setProperty("display", "none"));
1274
+ const b = f.filter((g) => g.classList.contains("active"));
1275
+ b.length < 2 || b.forEach((g) => {
1276
+ const y = parseInt(g.getAttribute("data-index"), 10), x = this.querySelector(`nine-splitter[data-split-index="${y}"]`), w = f[y + 1];
1277
+ x && w && w.classList.contains("active") && x.style.setProperty("display", "flex");
1279
1278
  });
1280
- }, "updateSplitters"), i = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = i.querySelectorAll(".nine-tab-item"), c = o.querySelectorAll("nine-table-sheet");
1281
- if (!a[e]) return;
1282
- if (!s)
1283
- a.forEach((g, f) => {
1284
- g.classList.toggle("active", f === e);
1285
- }), c.forEach((g, f) => {
1286
- const b = f === e;
1287
- g.classList.toggle("active", b), g.style.flex = b ? "1 1 100%" : "";
1279
+ }, "updateSplitters"), a = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), i = a.querySelectorAll(".nine-tab-item"), c = o.querySelectorAll("nine-table-sheet");
1280
+ if (!i[e]) return;
1281
+ if (!r)
1282
+ i.forEach((f, u) => {
1283
+ f.classList.toggle("active", u === e);
1284
+ }), c.forEach((f, u) => {
1285
+ const b = u === e;
1286
+ f.classList.toggle("active", b), f.style.flex = b ? "1 1 100%" : "";
1288
1287
  });
1289
1288
  else {
1290
- const g = a[e], f = i.querySelectorAll(".nine-tab-item.active");
1291
- if (g.classList.contains("active") && f.length <= 1)
1289
+ const f = i[e], u = a.querySelectorAll(".nine-tab-item.active");
1290
+ if (f.classList.contains("active") && u.length <= 1)
1292
1291
  return;
1293
- g.classList.toggle("active");
1292
+ f.classList.toggle("active");
1294
1293
  const b = o.querySelector(`nine-table-sheet[data-index="${e}"]`);
1295
1294
  b && (b.classList.toggle("active"), b.classList.contains("active") || (b.style.flex = ""));
1296
1295
  }
1297
1296
  const l = o.querySelectorAll("nine-table-sheet.active");
1298
- l == null || l.forEach((g) => {
1299
- g.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
1297
+ l == null || l.forEach((f) => {
1298
+ f.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
1300
1299
  }), n();
1301
1300
  }, "#switchSheet"));
1302
1301
  }
1303
1302
  connectedCallback() {
1304
- t(this, be).call(this);
1303
+ t(this, ge).call(this);
1305
1304
  }
1306
1305
  };
1307
- be = new WeakMap(), Pt = new WeakMap(), h(as, "NineTableSheets");
1308
- let Ne = as;
1309
- customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", Ne);
1310
- var _, pe, Ft, ye;
1311
- const ls = class ls {
1312
- constructor(r) {
1313
- d(this, _);
1314
- d(this, pe, /* @__PURE__ */ h(() => {
1315
- t(this, ye).call(this), new ResizeObserver((r) => {
1316
- for (let e of r)
1317
- t(this, _).getAttribute("auto-height") === "true" && t(this, Ft).call(this);
1318
- }).observe(t(this, _));
1306
+ ge = new WeakMap(), Pt = new WeakMap(), d(is, "NineTableSheets");
1307
+ let $e = is;
1308
+ customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", $e);
1309
+ var N, be, Ft, pe;
1310
+ const as = class as {
1311
+ constructor(s) {
1312
+ h(this, N);
1313
+ h(this, be, /* @__PURE__ */ d(() => {
1314
+ t(this, pe).call(this), new ResizeObserver((s) => {
1315
+ for (let e of s)
1316
+ t(this, N).getAttribute("auto-height") === "true" && t(this, Ft).call(this);
1317
+ }).observe(t(this, N));
1319
1318
  }, "#init"));
1320
- d(this, Ft, /* @__PURE__ */ h(() => {
1319
+ h(this, Ft, /* @__PURE__ */ d(() => {
1321
1320
  var c, l;
1322
- const r = Array.from(t(this, _).shadowRoot.querySelectorAll("nine-table-sheet.active"));
1323
- if (r.length === 0) return;
1324
- const e = parseInt(t(this, _).getAttribute("max-display-row"), 10) || 10, s = Math.max(...r.map((g) => g.getRowHeight())), n = (c = t(this, _).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, i = (l = t(this, _).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = Gt.SCROLLBAR_SIZE, a = e * s + n + i + o;
1325
- t(this, _).style.height = `${a}px`;
1321
+ const s = Array.from(t(this, N).shadowRoot.querySelectorAll("nine-table-sheet.active"));
1322
+ if (s.length === 0) return;
1323
+ const e = parseInt(t(this, N).getAttribute("max-display-row"), 10) || 10, r = Math.max(...s.map((f) => f.getRowHeight())), n = (c = t(this, N).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, a = (l = t(this, N).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = Kt.SCROLLBAR_SIZE, i = e * r + n + a + o;
1324
+ t(this, N).style.height = `${i}px`;
1326
1325
  }, "#applyAutoHeight"));
1327
- d(this, ye, /* @__PURE__ */ h(() => {
1328
- const e = Array.from(t(this, _).children).filter((c) => c.tagName === "TABLE"), s = t(this, _).getAttribute("auto-height") === "true", n = e.length, i = e.map((c, l) => {
1329
- const f = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, b = l < n - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
1330
- return f + b;
1326
+ h(this, pe, /* @__PURE__ */ d(() => {
1327
+ const e = Array.from(t(this, N).children).filter((c) => c.tagName === "TABLE"), r = t(this, N).getAttribute("auto-height") === "true", n = e.length, a = e.map((c, l) => {
1328
+ const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, b = l < n - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
1329
+ return u + b;
1331
1330
  }).join(""), o = e.map((c, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
1332
- t(this, _).shadowRoot.innerHTML = `
1331
+ t(this, N).shadowRoot.innerHTML = `
1333
1332
  <style>
1334
1333
  :host {
1335
1334
  display: flex;
1336
1335
  flex-direction: column;
1337
1336
  position: relative;
1338
1337
  overflow: hidden;
1339
- height: ${s ? "auto" : "100%"};
1338
+ height: ${r ? "auto" : "100%"};
1340
1339
  background: #fff;
1341
1340
  }
1342
1341
 
@@ -1440,7 +1439,7 @@ const ls = class ls {
1440
1439
  <nine-table-body>
1441
1440
  <nine-table-summary></nine-table-summary>
1442
1441
  <nine-table-sheets>
1443
- <nine-table-sheets-body>${i}</nine-table-sheets-body>
1442
+ <nine-table-sheets-body>${a}</nine-table-sheets-body>
1444
1443
  <nine-table-sheets-footer>
1445
1444
  <div class="nine-tab-bar">${o}</div>
1446
1445
  <div class="sheets-counter">Total : <span id="row-count">0</span></div>
@@ -1449,254 +1448,254 @@ const ls = class ls {
1449
1448
  <nine-table-analysis></nine-table-analysis>
1450
1449
  </nine-table-body>
1451
1450
  <nine-table-footer></nine-table-footer>
1452
- `, t(this, _).shadowRoot.querySelector("nine-table-sheets").classList.add("nodata");
1453
- const a = t(this, _).shadowRoot.querySelectorAll("nine-table-sheet");
1454
- a == null || a.forEach((c, l) => {
1451
+ `, t(this, N).shadowRoot.querySelector("nine-table-sheets").classList.add("nodata");
1452
+ const i = t(this, N).shadowRoot.querySelectorAll("nine-table-sheet");
1453
+ i == null || i.forEach((c, l) => {
1455
1454
  e[l] && setTimeout(() => {
1456
- c.generate(e[l]), s && t(this, Ft).call(this);
1455
+ c.generate(e[l]), r && t(this, Ft).call(this);
1457
1456
  });
1458
1457
  });
1459
1458
  }, "#render"));
1460
- y(this, _, r), t(this, pe).call(this);
1459
+ p(this, N, s), t(this, be).call(this);
1461
1460
  }
1462
1461
  };
1463
- _ = new WeakMap(), pe = new WeakMap(), Ft = new WeakMap(), ye = new WeakMap(), h(ls, "LayoutManager");
1464
- let _e = ls;
1465
- var jt, wt;
1466
- const cs = class cs {
1467
- constructor(r) {
1468
- d(this, jt);
1469
- d(this, wt, -1);
1470
- E(this, "count", /* @__PURE__ */ h(() => t(this, jt).rawRecords.length, "count"));
1471
- y(this, jt, r);
1462
+ N = new WeakMap(), be = new WeakMap(), Ft = new WeakMap(), pe = new WeakMap(), d(as, "LayoutManager");
1463
+ let Ne = as;
1464
+ var jt, xt;
1465
+ const ls = class ls {
1466
+ constructor(s) {
1467
+ h(this, jt);
1468
+ h(this, xt, -1);
1469
+ q(this, "count", /* @__PURE__ */ d(() => t(this, jt).rawRecords.length, "count"));
1470
+ p(this, jt, s);
1472
1471
  }
1473
1472
  get at() {
1474
- return t(this, wt);
1473
+ return t(this, xt);
1475
1474
  }
1476
- set at(r) {
1477
- y(this, wt, parseInt(r, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, wt)}"]`) && setTimeout(() => {
1475
+ set at(s) {
1476
+ p(this, xt, parseInt(s, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, xt)}"]`) && setTimeout(() => {
1478
1477
  });
1479
1478
  }
1480
1479
  };
1481
- jt = new WeakMap(), wt = new WeakMap(), h(cs, "ngRow");
1482
- let Oe = cs;
1483
- var D, L, z, vt, me, J, xe, ft, Vt, we, ve, St;
1484
- const P = class P {
1485
- constructor(r, e) {
1486
- d(this, D);
1487
- d(this, L);
1488
- d(this, z, []);
1489
- d(this, vt, []);
1490
- d(this, me, 0);
1491
- d(this, J, []);
1492
- d(this, xe, /* @__PURE__ */ h(() => {
1493
- y(this, J, []);
1494
- const r = t(this, D).template || [];
1495
- Array.from(r).forEach((e) => {
1496
- var s;
1497
- t(this, J).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
1480
+ jt = new WeakMap(), xt = new WeakMap(), d(ls, "ngRow");
1481
+ let _e = ls;
1482
+ var D, L, W, wt, ye, G, me, ht, Vt, xe, we, vt;
1483
+ const z = class z {
1484
+ constructor(s, e) {
1485
+ h(this, D);
1486
+ h(this, L);
1487
+ h(this, W, []);
1488
+ h(this, wt, []);
1489
+ h(this, ye, 0);
1490
+ h(this, G, []);
1491
+ h(this, me, /* @__PURE__ */ d(() => {
1492
+ p(this, G, []);
1493
+ const s = t(this, D).template || [];
1494
+ Array.from(s).forEach((e) => {
1495
+ var r;
1496
+ t(this, G).push(((r = e.getBoundingClientRect) == null ? void 0 : r.call(e).height) || 24);
1498
1497
  }), (t(this, L).rawRecords || []).forEach((e) => {
1499
- e.__ng || (e.__ng = t(this, Vt).call(this)), e.__ng.height = t(this, J).slice();
1498
+ e.__ng || (e.__ng = t(this, Vt).call(this)), e.__ng.height = t(this, G).slice();
1500
1499
  });
1501
1500
  }, "#initialize"));
1502
- d(this, ft, /* @__PURE__ */ h(() => {
1503
- const r = t(this, D).shadowRoot.querySelector("nine-table-sheets");
1504
- r == null || r.classList.toggle("nodata", this.length === 0), t(this, D).shadowRoot.querySelectorAll("nine-table-sheet").forEach((e) => {
1501
+ h(this, ht, /* @__PURE__ */ d(() => {
1502
+ const s = t(this, D).shadowRoot.querySelector("nine-table-sheets");
1503
+ s == null || s.classList.toggle("nodata", this.length === 0), t(this, D).shadowRoot.querySelectorAll("nine-table-sheet").forEach((e) => {
1505
1504
  e.invalidate();
1506
1505
  });
1507
1506
  }, "#invalidate"));
1508
- E(this, "get", /* @__PURE__ */ h((r, e) => {
1509
- var i;
1510
- const s = this.getValidData();
1511
- if (!s || s.length <= 0) return;
1512
- if (r == null) return t(this, St).call(this, s);
1513
- if (r < 0 || r >= s.length) return null;
1514
- const n = typeof ((i = t(this, D).fields) == null ? void 0 : i.get) == "function" ? t(this, D).fields.get() : [];
1507
+ q(this, "get", /* @__PURE__ */ d((s, e) => {
1508
+ var a;
1509
+ const r = this.getValidData();
1510
+ if (!r || r.length <= 0) return;
1511
+ if (s == null) return t(this, vt).call(this, r);
1512
+ if (s < 0 || s >= r.length) return null;
1513
+ const n = typeof ((a = t(this, D).fields) == null ? void 0 : a.get) == "function" ? t(this, D).fields.get() : [];
1515
1514
  if (e != null) {
1516
1515
  const o = n.indexOf(e);
1517
- return o >= 0 ? s[r].v[o] : null;
1516
+ return o >= 0 ? r[s].v[o] : null;
1518
1517
  }
1519
- return t(this, St).call(this, s[r]);
1518
+ return t(this, vt).call(this, r[s]);
1520
1519
  }, "get"));
1521
- E(this, "set", /* @__PURE__ */ h((r) => {
1522
- this.clear(), this.add(r, !1), t(this, ft).call(this);
1520
+ q(this, "set", /* @__PURE__ */ d((s) => {
1521
+ this.clear(), this.add(s, !1), t(this, ht).call(this);
1523
1522
  }, "set"));
1524
- d(this, Vt, /* @__PURE__ */ h(() => ({
1525
- rowState: P.ROW_STATE.EMPTY,
1523
+ h(this, Vt, /* @__PURE__ */ d(() => ({
1524
+ rowState: z.ROW_STATE.EMPTY,
1526
1525
  deleted: !1,
1527
1526
  filtered: !1,
1528
- height: t(this, J).slice(),
1527
+ height: t(this, G).slice(),
1529
1528
  o: {},
1530
1529
  c: {},
1531
- _: [0, 0, 0, 0, P.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, J).slice(), -1, {}, {}]
1530
+ _: [0, 0, 0, 0, z.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, G).slice(), -1, {}, {}]
1532
1531
  }), "#getDefaultMeta"));
1533
- E(this, "reset", /* @__PURE__ */ h(() => {
1534
- y(this, z, []), y(this, vt, []), t(this, ft).call(this);
1532
+ q(this, "reset", /* @__PURE__ */ d(() => {
1533
+ p(this, W, []), p(this, wt, []), t(this, ht).call(this);
1535
1534
  }, "reset"));
1536
- E(this, "clear", /* @__PURE__ */ h(() => {
1537
- var r;
1538
- t(this, L).rawRecords = [], y(this, z, []), y(this, vt, []), (r = t(this, L).viewRecords) != null && r.reset && t(this, L).viewRecords.reset();
1535
+ q(this, "clear", /* @__PURE__ */ d(() => {
1536
+ var s;
1537
+ t(this, L).rawRecords = [], p(this, W, []), p(this, wt, []), (s = t(this, L).viewRecords) != null && s.reset && t(this, L).viewRecords.reset();
1539
1538
  }, "clear"));
1540
- d(this, we, /* @__PURE__ */ h((r) => {
1539
+ h(this, xe, /* @__PURE__ */ d((s) => {
1541
1540
  var n;
1542
- Array.isArray(r) || (r = [r]);
1543
- const e = typeof ((n = t(this, D).fields) == null ? void 0 : n.get) == "function" ? t(this, D).fields.get() : Object.keys(r[0] || {}), s = [];
1544
- return r.forEach((i) => {
1541
+ Array.isArray(s) || (s = [s]);
1542
+ const e = typeof ((n = t(this, D).fields) == null ? void 0 : n.get) == "function" ? t(this, D).fields.get() : Object.keys(s[0] || {}), r = [];
1543
+ return s.forEach((a) => {
1545
1544
  const o = { v: [] };
1546
- e.forEach((a) => {
1547
- o.v.push(i[a] !== void 0 && i[a] !== null ? i[a] : "");
1548
- }), s.push(o);
1549
- }), s;
1545
+ e.forEach((i) => {
1546
+ o.v.push(a[i] !== void 0 && a[i] !== null ? a[i] : "");
1547
+ }), r.push(o);
1548
+ }), r;
1550
1549
  }, "#json2Array"));
1551
- d(this, ve, /* @__PURE__ */ h((r) => (Array.isArray(r) || (r = [r]), r.forEach((e) => {
1552
- e.__ng = t(this, Vt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = P.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
1553
- }), r), "#defaultInsert"));
1554
- E(this, "add", /* @__PURE__ */ h((r, e = !0) => {
1555
- r === void 0 && (r = {});
1556
- const s = t(this, we).call(this, r);
1557
- t(this, L).rawRecords = t(this, L).rawRecords.concat(t(this, ve).call(this, s)), this.resetRecords();
1550
+ h(this, we, /* @__PURE__ */ d((s) => (Array.isArray(s) || (s = [s]), s.forEach((e) => {
1551
+ e.__ng = t(this, Vt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = z.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
1552
+ }), s), "#defaultInsert"));
1553
+ q(this, "add", /* @__PURE__ */ d((s, e = !0) => {
1554
+ s === void 0 && (s = {});
1555
+ const r = t(this, xe).call(this, s);
1556
+ t(this, L).rawRecords = t(this, L).rawRecords.concat(t(this, we).call(this, r)), this.resetRecords();
1558
1557
  const n = this.count() - 1;
1559
- return e || s.forEach((i, o) => {
1560
- const a = t(this, L).rawRecords[n - o];
1561
- a && (a.__ng.rowState = P.ROW_STATE.EMPTY);
1562
- }), t(this, ft).call(this), n;
1558
+ return e || r.forEach((a, o) => {
1559
+ const i = t(this, L).rawRecords[n - o];
1560
+ i && (i.__ng.rowState = z.ROW_STATE.EMPTY);
1561
+ }), t(this, ht).call(this), n;
1563
1562
  }, "add"));
1564
- E(this, "delete", /* @__PURE__ */ h((r) => {
1563
+ q(this, "delete", /* @__PURE__ */ d((s) => {
1565
1564
  let e = [];
1566
- Array.isArray(r) ? e = r : typeof r > "u" ? e = [t(this, L).host.row.at] : e = [parseInt(r, 10)], e.sort((s, n) => n - s).forEach((s) => {
1567
- if (t(this, z)[s]) {
1568
- const n = t(this, z)[s].__ng.rowid;
1569
- t(this, z)[s].__ng.rowState === P.ROW_STATE.INSERT ? t(this, L).rawRecords = t(this, L).rawRecords.filter((i) => i.__ng.rowid !== n) : t(this, L).rawRecords.forEach((i) => {
1570
- i.__ng.rowid === n && (i.__ng.deleted = !0, i.__ng.rowState = P.ROW_STATE.DELETE);
1565
+ Array.isArray(s) ? e = s : typeof s > "u" ? e = [t(this, L).host.row.at] : e = [parseInt(s, 10)], e.sort((r, n) => n - r).forEach((r) => {
1566
+ if (t(this, W)[r]) {
1567
+ const n = t(this, W)[r].__ng.rowid;
1568
+ t(this, W)[r].__ng.rowState === z.ROW_STATE.INSERT ? t(this, L).rawRecords = t(this, L).rawRecords.filter((a) => a.__ng.rowid !== n) : t(this, L).rawRecords.forEach((a) => {
1569
+ a.__ng.rowid === n && (a.__ng.deleted = !0, a.__ng.rowState = z.ROW_STATE.DELETE);
1571
1570
  });
1572
1571
  }
1573
- }), this.resetRecords(), t(this, ft).call(this);
1572
+ }), this.resetRecords(), t(this, ht).call(this);
1574
1573
  }, "delete"));
1575
- E(this, "setValue", /* @__PURE__ */ h((r, e, s) => {
1574
+ q(this, "setValue", /* @__PURE__ */ d((s, e, r) => {
1576
1575
  var c;
1577
- r = parseInt(r, 10);
1578
- const i = (typeof ((c = t(this, D).fields) == null ? void 0 : c.get) == "function" ? t(this, D).fields.get() : []).indexOf(e);
1579
- if (i < 0) return;
1580
- const o = this.getValidData()[r];
1576
+ s = parseInt(s, 10);
1577
+ const a = (typeof ((c = t(this, D).fields) == null ? void 0 : c.get) == "function" ? t(this, D).fields.get() : []).indexOf(e);
1578
+ if (a < 0) return;
1579
+ const o = this.getValidData()[s];
1581
1580
  if (!o) return;
1582
- const a = o.v[i];
1583
- a !== s && o.__ng.rowState !== P.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = a), o.__ng.rowState = P.ROW_STATE.UPDATE), o.v[i] = s;
1581
+ const i = o.v[a];
1582
+ i !== r && o.__ng.rowState !== z.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = i), o.__ng.rowState = z.ROW_STATE.UPDATE), o.v[a] = r;
1584
1583
  }, "setValue"));
1585
- E(this, "resetRecords", /* @__PURE__ */ h(() => {
1586
- y(this, vt, t(this, L).rawRecords.filter((r) => !r.__ng.deleted)), y(this, z, t(this, L).rawRecords.filter((r) => !r.__ng.deleted && !r.__ng.filtered)), t(this, L).rawRecords.forEach((r, e) => {
1587
- r.__ng.rowidx = e;
1588
- }), t(this, z).forEach((r, e) => {
1589
- r.__ng.i = e;
1584
+ q(this, "resetRecords", /* @__PURE__ */ d(() => {
1585
+ p(this, wt, t(this, L).rawRecords.filter((s) => !s.__ng.deleted)), p(this, W, t(this, L).rawRecords.filter((s) => !s.__ng.deleted && !s.__ng.filtered)), t(this, L).rawRecords.forEach((s, e) => {
1586
+ s.__ng.rowidx = e;
1587
+ }), t(this, W).forEach((s, e) => {
1588
+ s.__ng.i = e;
1590
1589
  });
1591
1590
  }, "resetRecords"));
1592
- E(this, "getValidData", /* @__PURE__ */ h(() => (t(this, z).length === 0 && t(this, L).rawRecords.length > 0 && this.resetRecords(), t(this, z)), "getValidData"));
1593
- d(this, St, /* @__PURE__ */ h((r) => {
1591
+ q(this, "getValidData", /* @__PURE__ */ d(() => (t(this, W).length === 0 && t(this, L).rawRecords.length > 0 && this.resetRecords(), t(this, W)), "getValidData"));
1592
+ h(this, vt, /* @__PURE__ */ d((s) => {
1594
1593
  var o;
1595
- if (!r) return r;
1596
- const e = !Array.isArray(r), s = e ? [r] : r, n = typeof ((o = t(this, D).fields) == null ? void 0 : o.get) == "function" ? t(this, D).fields.get() : [], i = s.filter((a) => !a.__ng.deleted).map((a) => {
1594
+ if (!s) return s;
1595
+ const e = !Array.isArray(s), r = e ? [s] : s, n = typeof ((o = t(this, D).fields) == null ? void 0 : o.get) == "function" ? t(this, D).fields.get() : [], a = r.filter((i) => !i.__ng.deleted).map((i) => {
1597
1596
  const c = {};
1598
- return n.forEach((l, g) => {
1599
- c[l] = a.v ? a.v[g] : a[l];
1600
- }), c.__ng = a.__ng, c;
1597
+ return n.forEach((l, f) => {
1598
+ c[l] = i.v ? i.v[f] : i[l];
1599
+ }), c.__ng = i.__ng, c;
1601
1600
  });
1602
- return e ? i[0] : i;
1601
+ return e ? a[0] : a;
1603
1602
  }, "#conv"));
1604
- E(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
1605
- y(this, D, r), y(this, L, e), t(this, xe).call(this);
1603
+ q(this, "count", /* @__PURE__ */ d(() => this.getValidData().length, "count"));
1604
+ p(this, D, s), p(this, L, e), t(this, me).call(this);
1606
1605
  }
1607
1606
  get source() {
1608
- return t(this, St).call(this, t(this, L).rawRecords);
1607
+ return t(this, vt).call(this, t(this, L).rawRecords);
1609
1608
  }
1610
- set source(r) {
1611
- this.clear(), this.add(r, !1);
1609
+ set source(s) {
1610
+ this.clear(), this.add(s, !1);
1612
1611
  }
1613
1612
  get nextId() {
1614
- return ++ws(this, me)._;
1613
+ return ++vs(this, ye)._;
1615
1614
  }
1616
1615
  get count() {
1617
- return t(this, z).length;
1616
+ return t(this, W).length;
1618
1617
  }
1619
1618
  get length() {
1620
- return t(this, z).length;
1619
+ return t(this, W).length;
1621
1620
  }
1622
1621
  getRowCount() {
1623
1622
  return this.length;
1624
1623
  }
1625
1624
  };
1626
- D = new WeakMap(), L = new WeakMap(), z = new WeakMap(), vt = new WeakMap(), me = new WeakMap(), J = new WeakMap(), xe = new WeakMap(), ft = new WeakMap(), Vt = new WeakMap(), we = new WeakMap(), ve = new WeakMap(), St = new WeakMap(), h(P, "ngData"), // 🎯 행 상태 정의 상수를 클래스 내부로 내재화
1627
- E(P, "ROW_STATE", {
1625
+ D = new WeakMap(), L = new WeakMap(), W = new WeakMap(), wt = new WeakMap(), ye = new WeakMap(), G = new WeakMap(), me = new WeakMap(), ht = new WeakMap(), Vt = new WeakMap(), xe = new WeakMap(), we = new WeakMap(), vt = new WeakMap(), d(z, "ngData"), // 🎯 행 상태 정의 상수를 클래스 내부로 내재화
1626
+ q(z, "ROW_STATE", {
1628
1627
  EMPTY: "EMPTY",
1629
1628
  NORMAL: "NORMAL",
1630
1629
  INSERT: "INSERT",
1631
1630
  UPDATE: "UPDATE",
1632
1631
  DELETE: "DELETE"
1633
1632
  });
1634
- let De = P;
1635
- var ut;
1636
- const hs = class hs {
1637
- constructor(r) {
1638
- d(this, ut);
1639
- y(this, ut, r), this.row = new Oe(this), this.data = new De(t(this, ut), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
1633
+ let Oe = z;
1634
+ var dt;
1635
+ const cs = class cs {
1636
+ constructor(s) {
1637
+ h(this, dt);
1638
+ p(this, dt, s), this.row = new _e(this), this.data = new Oe(t(this, dt), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
1640
1639
  var e;
1641
- (e = t(this, ut).view) != null && e.redraw && t(this, ut).view.redraw();
1640
+ (e = t(this, dt).view) != null && e.redraw && t(this, dt).view.redraw();
1642
1641
  }, this.setDataSource = (e) => {
1643
1642
  this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
1644
1643
  }, this.getRowState = (e) => {
1645
- var n, i;
1646
- const s = parseInt(e, 10);
1647
- if (!(s >= this.data.count()))
1648
- return (i = (n = this.data.getValidData()[s]) == null ? void 0 : n.__ng) == null ? void 0 : i.rowState;
1644
+ var n, a;
1645
+ const r = parseInt(e, 10);
1646
+ if (!(r >= this.data.count()))
1647
+ return (a = (n = this.data.getValidData()[r]) == null ? void 0 : n.__ng) == null ? void 0 : a.rowState;
1649
1648
  }, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
1650
1649
  this.row.at = e;
1651
- }, this.scrollTo_V1 = (e) => (e < 0 && (e = 0), e >= this.rawRecords.length && (e = this.rawRecords.length - 1), this.viewRecords.rawIndex = e, this.viewRecords.reset && this.viewRecords.reset(), !(e <= 0 || e >= this.rawRecords.length - 1)), this.getColumn = (e, s) => this.data.get(e, s), this.setColumn = (e, s, n) => {
1652
- e = parseInt(e, 10), this.data.setValue(e, s, n);
1650
+ }, this.scrollTo_V1 = (e) => (e < 0 && (e = 0), e >= this.rawRecords.length && (e = this.rawRecords.length - 1), this.viewRecords.rawIndex = e, this.viewRecords.reset && this.viewRecords.reset(), !(e <= 0 || e >= this.rawRecords.length - 1)), this.getColumn = (e, r) => this.data.get(e, r), this.setColumn = (e, r, n) => {
1651
+ e = parseInt(e, 10), this.data.setValue(e, r, n);
1653
1652
  }, this.setDataSource([]);
1654
1653
  }
1655
1654
  };
1656
- ut = new WeakMap(), h(hs, "ngDataManager");
1657
- let We = hs;
1658
- var Rt, H, Yt, Se;
1659
- const ds = class ds {
1655
+ dt = new WeakMap(), d(cs, "ngDataManager");
1656
+ let De = cs;
1657
+ var St, M, Yt, ve;
1658
+ const hs = class hs {
1660
1659
  // 🎯 이제 { name: string, type: string } 객체들의 배열로 관리합니다.
1661
- constructor(r) {
1662
- d(this, Rt);
1663
- d(this, H, []);
1664
- E(this, "add", /* @__PURE__ */ h((r, e = "string") => {
1665
- r.forEach((s) => {
1666
- t(this, H).some((n) => n.name === s) || t(this, H).push({ name: s, type: e });
1660
+ constructor(s) {
1661
+ h(this, St);
1662
+ h(this, M, []);
1663
+ q(this, "add", /* @__PURE__ */ d((s, e = "string") => {
1664
+ s.forEach((r) => {
1665
+ t(this, M).some((n) => n.name === r) || t(this, M).push({ name: r, type: e });
1667
1666
  }), t(this, Yt).call(this);
1668
1667
  }, "add"));
1669
- d(this, Yt, /* @__PURE__ */ h(() => {
1670
- const r = /* @__PURE__ */ new Map();
1671
- t(this, H).forEach((e) => {
1672
- r.set(e.name, e.type);
1673
- }), y(this, H, Array.from(r, ([e, s]) => ({ name: e, type: s }))), y(this, H, t(this, H).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, H).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
1668
+ h(this, Yt, /* @__PURE__ */ d(() => {
1669
+ const s = /* @__PURE__ */ new Map();
1670
+ t(this, M).forEach((e) => {
1671
+ s.set(e.name, e.type);
1672
+ }), p(this, M, Array.from(s, ([e, r]) => ({ name: e, type: r }))), p(this, M, t(this, M).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, M).sort((e, r) => e.name.length < r.name.length ? 1 : -1);
1674
1673
  }, "#adjust"));
1675
- d(this, Se, /* @__PURE__ */ h(() => {
1676
- y(this, H, []), q.log(t(this, Rt).querySelectorAll("table"));
1677
- const r = Array.from(t(this, Rt).querySelectorAll("table"));
1678
- if (!(!r || r.length === 0)) {
1679
- for (const e of r)
1680
- q.log(e), $("[data-bind]", e).each((s, n) => {
1681
- const i = n.dataset.bind, o = n.getAttribute("data-type") || "string";
1682
- i && t(this, H).push({ name: i, type: o });
1683
- }), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
1684
- $(`[${s}]`, e).each((n, i) => {
1685
- var o = i.getAttribute(s);
1674
+ h(this, ve, /* @__PURE__ */ d(() => {
1675
+ p(this, M, []), T.log(t(this, St).querySelectorAll("table"));
1676
+ const s = Array.from(t(this, St).querySelectorAll("table"));
1677
+ if (!(!s || s.length === 0)) {
1678
+ for (const e of s)
1679
+ T.log(e), $("[data-bind]", e).each((r, n) => {
1680
+ const a = n.dataset.bind, o = n.getAttribute("data-type") || "string";
1681
+ a && t(this, M).push({ name: a, type: o });
1682
+ }), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((r) => {
1683
+ $(`[${r}]`, e).each((n, a) => {
1684
+ var o = a.getAttribute(r);
1686
1685
  if (o.indexOf("data.") < 0) {
1687
- const a = o.search(/[(]/g);
1688
- if (a > 0)
1686
+ const i = o.search(/[(]/g);
1687
+ if (i > 0)
1689
1688
  try {
1690
- o = String(window[o.substring(0, a).trim()]);
1689
+ o = String(window[o.substring(0, i).trim()]);
1691
1690
  } catch {
1692
1691
  o = "";
1693
1692
  }
1694
1693
  }
1695
- o.split("data.").forEach((a) => {
1696
- if (a.trim() != "") {
1697
- const c = a.search(/[^_A-Za-z0-9]/g);
1694
+ o.split("data.").forEach((i) => {
1695
+ if (i.trim() != "") {
1696
+ const c = i.search(/[^_A-Za-z0-9]/g);
1698
1697
  let l = "";
1699
- c >= 0 ? l = a.substring(0, c) : o.startsWith("data.") && (l = a.replace("data.", "")), l && t(this, H).push({ name: l, type: "string" });
1698
+ c >= 0 ? l = i.substring(0, c) : o.startsWith("data.") && (l = i.replace("data.", "")), l && t(this, M).push({ name: l, type: "string" });
1700
1699
  }
1701
1700
  });
1702
1701
  });
@@ -1704,65 +1703,65 @@ const ds = class ds {
1704
1703
  t(this, Yt).call(this);
1705
1704
  }
1706
1705
  }, "#init"));
1707
- y(this, Rt, r), t(this, Se).call(this);
1706
+ p(this, St, s), t(this, ve).call(this);
1708
1707
  }
1709
1708
  // 🎯 기존에 필드 이름만 쓰던 곳들과의 호환을 위해 이름 배열만 리턴하는 메서드 유지
1710
1709
  get() {
1711
- return t(this, H).map((r) => r.name);
1710
+ return t(this, M).map((s) => s.name);
1712
1711
  }
1713
1712
  // 🎯 내부 객체 통째로 얻기
1714
1713
  getFields() {
1715
- return t(this, H);
1714
+ return t(this, M);
1716
1715
  }
1717
1716
  // 🎯 특정 필드의 데이터 타입 조회
1718
- getType(r) {
1719
- const e = t(this, H).find((s) => s.name === r);
1717
+ getType(s) {
1718
+ const e = t(this, M).find((r) => r.name === s);
1720
1719
  return e ? e.type : "string";
1721
1720
  }
1722
- indexOf(r) {
1723
- return t(this, H).findIndex((e) => e.name === r);
1721
+ indexOf(s) {
1722
+ return t(this, M).findIndex((e) => e.name === s);
1724
1723
  }
1725
- includes(r) {
1726
- return t(this, H).some((e) => e.name === r);
1724
+ includes(s) {
1725
+ return t(this, M).some((e) => e.name === s);
1727
1726
  }
1728
1727
  };
1729
- Rt = new WeakMap(), H = new WeakMap(), Yt = new WeakMap(), Se = new WeakMap(), h(ds, "ngFields");
1730
- let ze = ds;
1731
- var gt, Re, Ae;
1732
- const fs = class fs extends HTMLElement {
1728
+ St = new WeakMap(), M = new WeakMap(), Yt = new WeakMap(), ve = new WeakMap(), d(hs, "ngFields");
1729
+ let We = hs;
1730
+ var ft, Se, Re;
1731
+ const ds = class ds extends HTMLElement {
1733
1732
  constructor() {
1734
1733
  super();
1735
1734
  //#created = false;
1736
- d(this, gt);
1737
- d(this, Re);
1738
- d(this, Ae, /* @__PURE__ */ h(() => {
1739
- this.fields = new ze(this), y(this, Re, new _e(this)), q.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
1735
+ h(this, ft);
1736
+ h(this, Se);
1737
+ h(this, Re, /* @__PURE__ */ d(() => {
1738
+ this.fields = new We(this), p(this, Se, new Ne(this)), T.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
1740
1739
  }, "#init"));
1741
- this.attachShadow({ mode: "open" }), y(this, gt, new We(this));
1740
+ this.attachShadow({ mode: "open" }), p(this, ft, new De(this));
1742
1741
  }
1743
1742
  connectedCallback() {
1744
- t(this, Ae).call(this);
1743
+ t(this, Re).call(this);
1745
1744
  }
1746
1745
  disconnectedCallback() {
1747
- q.log("NineTable disconnected.");
1746
+ T.log("NineTable disconnected.");
1748
1747
  }
1749
1748
  // 🎯 외부에서 grid.data.set(...) 형태로 접근할 수 있도록 데이터 매니저 오픈
1750
1749
  get data() {
1751
- return t(this, gt).data;
1750
+ return t(this, ft).data;
1752
1751
  }
1753
1752
  // 🎯 행(row) 관련 제어 접근자 오픈
1754
1753
  get row() {
1755
- return t(this, gt).row;
1754
+ return t(this, ft).row;
1756
1755
  }
1757
1756
  // 🎯 전체 데이터 매니저 접근 필요할 경우
1758
1757
  get dataManager() {
1759
- return t(this, gt);
1758
+ return t(this, ft);
1760
1759
  }
1761
1760
  };
1762
- gt = new WeakMap(), Re = new WeakMap(), Ae = new WeakMap(), h(fs, "NineTable");
1763
- let Be = fs;
1764
- customElements.get("nine-table") || customElements.define("nine-table", Be);
1765
- const Ct = class Ct extends HTMLElement {
1761
+ ft = new WeakMap(), Se = new WeakMap(), Re = new WeakMap(), d(ds, "NineTable");
1762
+ let ze = ds;
1763
+ customElements.get("nine-table") || customElements.define("nine-table", ze);
1764
+ const Tt = class Tt extends HTMLElement {
1766
1765
  // 👈 커스텀 스타일용 캐시 추가
1767
1766
  constructor() {
1768
1767
  super();
@@ -1773,31 +1772,31 @@ const Ct = class Ct extends HTMLElement {
1773
1772
  connectedCallback() {
1774
1773
  }
1775
1774
  };
1776
- h(Ct, "BasicCellElement"), E(Ct, "_styleCache", /* @__PURE__ */ new Map()), E(Ct, "_customStyleCache", /* @__PURE__ */ new Map());
1777
- let Pe = Ct;
1778
- var I, Ut, v, Ke, Ge, Ze, Je, Qe;
1779
- const us = class us extends Pe {
1775
+ d(Tt, "BasicCellElement"), q(Tt, "_styleCache", /* @__PURE__ */ new Map()), q(Tt, "_customStyleCache", /* @__PURE__ */ new Map());
1776
+ let Be = Tt;
1777
+ var I, Ut, v, Xe, Ke, Ge, Ze, Je;
1778
+ const fs = class fs extends Be {
1780
1779
  constructor() {
1781
1780
  super();
1782
- d(this, I);
1783
- d(this, Ut);
1784
- d(this, v);
1785
- d(this, Ke);
1786
- d(this, Ge);
1787
- d(this, Ze);
1788
- d(this, Je);
1789
- E(this, "getDisplayText", /* @__PURE__ */ h((e) => {
1781
+ h(this, I);
1782
+ h(this, Ut);
1783
+ h(this, v);
1784
+ h(this, Xe);
1785
+ h(this, Ke);
1786
+ h(this, Ge);
1787
+ h(this, Ze);
1788
+ q(this, "getDisplayText", /* @__PURE__ */ d((e) => {
1790
1789
  if (t(this, v))
1791
1790
  if (t(this, v).closest("tbody")) {
1792
- const s = t(this, v).closest("tr").data, n = parseInt(t(this, v).dataset.row);
1793
- if (!s) return "";
1791
+ const r = t(this, v).closest("tr").data, n = parseInt(t(this, v).dataset.row);
1792
+ if (!r) return "";
1794
1793
  if (ninegrid.isNull(t(this, v).dataset.expr)) {
1795
1794
  if (!ninegrid.isNull(t(this, v).dataset.bind))
1796
- return s[t(this, v).dataset.bind] || ninegrid.nvl(e, "");
1795
+ return r[t(this, v).dataset.bind] || ninegrid.nvl(e, "");
1797
1796
  } else try {
1798
- return this.getExprValue(t(this, v).dataset.expr, s, n, t(this, v));
1797
+ return this.getExprValue(t(this, v).dataset.expr, r, n, t(this, v));
1799
1798
  } catch {
1800
- console.error(t(this, v).dataset.expr, s, t(this, v).dataset.row);
1799
+ console.error(t(this, v).dataset.expr, r, t(this, v).dataset.row);
1801
1800
  }
1802
1801
  return ninegrid.nvl(e, "");
1803
1802
  } else
@@ -1806,41 +1805,41 @@ const us = class us extends Pe {
1806
1805
  } catch {
1807
1806
  }
1808
1807
  }, "getDisplayText"));
1809
- d(this, Qe, /* @__PURE__ */ h(() => {
1808
+ h(this, Je, /* @__PURE__ */ d(() => {
1810
1809
  if (!(!t(this, I) || !t(this, I).template || !t(this, v).closest("tbody.bindable"))) {
1811
1810
  var e = ninegrid.j.querySelectorAll(t(this, v)).attr("suppress");
1812
1811
  if (e && (e = parseInt(e)), e && !isNaN(e)) {
1813
- var s = t(this, v).closest("tr"), n = [];
1814
- $("th,td", s).each((x, C) => {
1815
- var S = ninegrid.j.querySelectorAll(C).attr("suppress");
1816
- S && C.dataset.row && (S = parseInt(S), !isNaN(S) && S <= e && n.push(S));
1812
+ var r = t(this, v).closest("tr"), n = [];
1813
+ $("th,td", r).each((m, E) => {
1814
+ var S = ninegrid.j.querySelectorAll(E).attr("suppress");
1815
+ S && E.dataset.row && (S = parseInt(S), !isNaN(S) && S <= e && n.push(S));
1817
1816
  }), n.sort();
1818
- var i = !1;
1819
- if (parseInt(s.sectionRowIndex / t(this, I).template.length) > 0)
1817
+ var a = !1;
1818
+ if (parseInt(r.sectionRowIndex / t(this, I).template.length) > 0)
1820
1819
  for (var o of n) {
1821
1820
  if (o > e) break;
1822
- var a = parseInt(t(this, v).dataset.row), c = a - 1, l = t(this, v).closest("tr").data, g = t(this, I).data.get(c);
1821
+ var i = parseInt(t(this, v).dataset.row), c = i - 1, l = t(this, v).closest("tr").data, f = t(this, I).data.get(c);
1823
1822
  t(this, v).dataset.matrixRow;
1824
- var f = t(this, I).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, v).dataset.matrixRow}"]`), b = f.dataset.expr ? this.getExprValue(f.dataset.expr, l, a) : l[f.dataset.bind], u = f.dataset.expr ? this.getExprValue(f.dataset.expr, g, c) : g[f.dataset.bind];
1825
- if (b != u) {
1826
- i = !0;
1823
+ var u = t(this, I).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, v).dataset.matrixRow}"]`), b = u.dataset.expr ? this.getExprValue(u.dataset.expr, l, i) : l[u.dataset.bind], g = u.dataset.expr ? this.getExprValue(u.dataset.expr, f, c) : f[u.dataset.bind];
1824
+ if (b != g) {
1825
+ a = !0;
1827
1826
  break;
1828
1827
  }
1829
1828
  }
1830
1829
  else
1831
- i = !0;
1832
- i ? ninegrid.j.querySelectorAll(t(this, v)).removeClass("suppress") : ninegrid.j.querySelectorAll(t(this, v)).addClass("suppress"), ninegrid.j.querySelectorAll(t(this, v)).hasClass("hidden") || (i ? ninegrid.j.querySelectorAll(t(this, v)).removeClass("hidden") : ninegrid.j.querySelectorAll(t(this, v)).addClass("hidden"));
1833
- var p = parseInt(t(this, v).dataset.matrixRow), m = p - 1, w = t(this, I).body.querySelector(`tbody.bindable [data-col="${t(this, v).dataset.col}"][data-matrix-row="${m}"]`);
1830
+ a = !0;
1831
+ a ? ninegrid.j.querySelectorAll(t(this, v)).removeClass("suppress") : ninegrid.j.querySelectorAll(t(this, v)).addClass("suppress"), ninegrid.j.querySelectorAll(t(this, v)).hasClass("hidden") || (a ? ninegrid.j.querySelectorAll(t(this, v)).removeClass("hidden") : ninegrid.j.querySelectorAll(t(this, v)).addClass("hidden"));
1832
+ var y = parseInt(t(this, v).dataset.matrixRow), x = y - 1, w = t(this, I).body.querySelector(`tbody.bindable [data-col="${t(this, v).dataset.col}"][data-matrix-row="${x}"]`);
1834
1833
  $(w).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this, v)).hasClass("suppress") ? ninegrid.j.querySelectorAll(w).removeClass("last-none-suppress").addClass("last-suppress") : !$(w).hasClass("suppress") && ninegrid.j.querySelectorAll(t(this, v)).hasClass("suppress") ? ninegrid.j.querySelectorAll(w).removeClass("last-suppress").addClass("last-none-suppress") : ninegrid.j.querySelectorAll(w).removeClass("last-none-suppress").removeClass("last-suppress");
1835
1834
  }
1836
1835
  }
1837
1836
  }, "#resetSuppress"));
1838
- E(this, "getExprValue", /* @__PURE__ */ h((e, s, n, i) => {
1837
+ q(this, "getExprValue", /* @__PURE__ */ d((e, r, n, a) => {
1839
1838
  if (typeof e < "u")
1840
1839
  try {
1841
1840
  n = parseInt(n);
1842
1841
  const o = e.replace("()", "");
1843
- return t(this, I)[o] ? t(this, I)[o].call(this, s, n, t(this, v)) : t(this, I).exprFunction(e).call(this, s, n, t(this, I).data);
1842
+ return t(this, I)[o] ? t(this, I)[o].call(this, r, n, t(this, v)) : t(this, I).exprFunction(e).call(this, r, n, t(this, I).data);
1844
1843
  } catch {
1845
1844
  return ["NG-COMBO"].includes(this.tagName) ? "" : e;
1846
1845
  }
@@ -1849,16 +1848,16 @@ const us = class us extends Pe {
1849
1848
  }, "getExprValue"));
1850
1849
  }
1851
1850
  connectedCallback() {
1852
- super.connectedCallback(), y(this, I, this.getRootNode().host), y(this, v, this.closest("th,td")), y(this, Ut, t(this, v).closest("tr"));
1851
+ super.connectedCallback(), p(this, I, this.getRootNode().host), p(this, v, this.closest("th,td")), p(this, Ut, t(this, v).closest("tr"));
1853
1852
  }
1854
1853
  get value() {
1855
1854
  var e = !t(this, I) || !t(this, I).dataManager || !t(this, v) || !t(this, v).dataset || !t(this, v).dataset.row || !t(this, v).dataset.bind ? "" : t(this, v).closest("tr").data[t(this, v).dataset.bind];
1856
1855
  return e ?? "";
1857
1856
  }
1858
1857
  set value(e) {
1859
- var s = parseInt(t(this, v).dataset.row);
1858
+ var r = parseInt(t(this, v).dataset.row);
1860
1859
  const n = this.getAttribute("update-row-state") != "false";
1861
- s < 0 ? t(this, I).data.setValueNF(parseInt(t(this, v).dataset.index), t(this, v).dataset.bind, e, n) : t(this, I).data.setValue(s, t(this, v).dataset.bind, e, n);
1860
+ r < 0 ? t(this, I).data.setValueNF(parseInt(t(this, v).dataset.index), t(this, v).dataset.bind, e, n) : t(this, I).data.setValue(r, t(this, v).dataset.bind, e, n);
1862
1861
  }
1863
1862
  get row() {
1864
1863
  return parseInt(t(this, v).dataset.row);
@@ -1871,9 +1870,9 @@ const us = class us extends Pe {
1871
1870
  return parseInt(t(this, v).dataset.row), t(this, Ut).data[e];
1872
1871
  }
1873
1872
  };
1874
- I = new WeakMap(), Ut = new WeakMap(), v = new WeakMap(), Ke = new WeakMap(), Ge = new WeakMap(), Ze = new WeakMap(), Je = new WeakMap(), Qe = new WeakMap(), h(us, "CellElement");
1875
- let Fe = us;
1876
- const gs = class gs extends Fe {
1873
+ I = new WeakMap(), Ut = new WeakMap(), v = new WeakMap(), Xe = new WeakMap(), Ke = new WeakMap(), Ge = new WeakMap(), Ze = new WeakMap(), Je = new WeakMap(), d(fs, "CellElement");
1874
+ let Pe = fs;
1875
+ const us = class us extends Pe {
1877
1876
  constructor() {
1878
1877
  super();
1879
1878
  }
@@ -1884,19 +1883,19 @@ const gs = class gs extends Fe {
1884
1883
  return super.refresh();
1885
1884
  }
1886
1885
  };
1887
- h(gs, "EditableCellElement");
1888
- let je = gs;
1889
- var Xt, bt, At, Et, Ee, Q, ts;
1890
- const bs = class bs extends je {
1886
+ d(us, "EditableCellElement");
1887
+ let Fe = us;
1888
+ var Xt, ut, Rt, At, Ae, Z, Qe;
1889
+ const gs = class gs extends Fe {
1891
1890
  constructor() {
1892
1891
  super();
1893
- d(this, Xt);
1894
- d(this, bt);
1895
- d(this, At);
1896
- d(this, Et);
1897
- d(this, Ee);
1898
- d(this, Q);
1899
- E(this, "refresh", /* @__PURE__ */ h(() => {
1892
+ h(this, Xt);
1893
+ h(this, ut);
1894
+ h(this, Rt);
1895
+ h(this, At);
1896
+ h(this, Ae);
1897
+ h(this, Z);
1898
+ q(this, "refresh", /* @__PURE__ */ d(() => {
1900
1899
  const e = super.refresh();
1901
1900
  t(this, Xt).value = e;
1902
1901
  }, "refresh"));
@@ -1930,36 +1929,36 @@ const bs = class bs extends je {
1930
1929
  if (!v) this.reset();
1931
1930
  };
1932
1931
  */
1933
- d(this, ts, /* @__PURE__ */ h((e) => {
1932
+ h(this, Qe, /* @__PURE__ */ d((e) => {
1934
1933
  if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
1935
- if (t(this, bt) == "number") {
1936
- let i = [];
1937
- if (t(this, Q) && Number(t(this, Q)) > 0 && i.push("."), t(this, Et) && Number(t(this, Et)) >= 0 && i.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !i.includes(e.key) && e.preventDefault(), t(this, Q) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
1938
- var s = e.target.value, n = s.indexOf(".");
1934
+ if (t(this, ut) == "number") {
1935
+ let a = [];
1936
+ if (t(this, Z) && Number(t(this, Z)) > 0 && a.push("."), t(this, At) && Number(t(this, At)) >= 0 && a.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !a.includes(e.key) && e.preventDefault(), t(this, Z) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
1937
+ var r = e.target.value, n = r.indexOf(".");
1939
1938
  if (n >= 0) {
1940
- var s = s.substr(n + 1, s.length);
1941
- s.length >= Number(t(this, Q)) && e.preventDefault();
1939
+ var r = r.substr(n + 1, r.length);
1940
+ r.length >= Number(t(this, Z)) && e.preventDefault();
1942
1941
  }
1943
1942
  }
1944
1943
  }
1945
- t(this, At) && ninegrid.getByteLength(e.target.value) >= Number(t(this, At)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
1944
+ t(this, Rt) && ninegrid.getByteLength(e.target.value) >= Number(t(this, Rt)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
1946
1945
  }
1947
1946
  }, "#onKeyDown"));
1948
- if (this.applyBaseStyle(), y(this, bt, this.getAttribute("type") || "text"), y(this, At, this.getAttribute("maxbyte")), y(this, Et, this.getAttribute("min")), y(this, Ee, this.getAttribute("max")), y(this, Q, this.getAttribute("scale")), !["text", "number"].includes(t(this, bt))) throw `invalid type : ${t(this, bt)}`;
1947
+ if (this.applyBaseStyle(), p(this, ut, this.getAttribute("type") || "text"), p(this, Rt, this.getAttribute("maxbyte")), p(this, At, this.getAttribute("min")), p(this, Ae, this.getAttribute("max")), p(this, Z, this.getAttribute("scale")), !["text", "number"].includes(t(this, ut))) throw `invalid type : ${t(this, ut)}`;
1949
1948
  }
1950
1949
  connectedCallback() {
1951
- for (var e = [], s = 0; s < this.attributes.length; s++)
1952
- ["type", "maxlength", "maxbyte", "min", "max", "step", "scale", "text-align"].includes(this.attributes[s].name) && e.push(`${this.attributes[s].name}="${this.attributes[s].value}"`);
1950
+ for (var e = [], r = 0; r < this.attributes.length; r++)
1951
+ ["type", "maxlength", "maxbyte", "min", "max", "step", "scale", "text-align"].includes(this.attributes[r].name) && e.push(`${this.attributes[r].name}="${this.attributes[r].value}"`);
1953
1952
  this.innerHTML = `
1954
1953
  <input type="text"
1955
1954
  ${e.join(" ")}
1956
1955
  ondragstart="return false;"
1957
1956
  >
1958
- `, super.connectedCallback(), y(this, Xt, this.querySelector("input"));
1957
+ `, super.connectedCallback(), p(this, Xt, this.querySelector("input"));
1959
1958
  }
1960
1959
  };
1961
- Xt = new WeakMap(), bt = new WeakMap(), At = new WeakMap(), Et = new WeakMap(), Ee = new WeakMap(), Q = new WeakMap(), ts = new WeakMap(), h(bs, "CellInputText");
1962
- let Ve = bs;
1960
+ Xt = new WeakMap(), ut = new WeakMap(), Rt = new WeakMap(), At = new WeakMap(), Ae = new WeakMap(), Z = new WeakMap(), Qe = new WeakMap(), d(gs, "CellInputText");
1961
+ let je = gs;
1963
1962
  customElements.get("cell-input-text");
1964
- customElements.get("cell-input") || customElements.define("cell-input", Ve);
1963
+ customElements.get("cell-input") || customElements.define("cell-input", je);
1965
1964
  //# sourceMappingURL=nine-table.js.map