@ninebone/table 0.0.446 → 0.0.447

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,118 +1,118 @@
1
- var xe = Object.defineProperty;
2
- var ve = (S) => {
3
- throw TypeError(S);
1
+ var De = Object.defineProperty;
2
+ var ze = (R) => {
3
+ throw TypeError(R);
4
4
  };
5
- var Ee = (S, n, e) => n in S ? xe(S, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : S[n] = e;
6
- var h = (S, n) => xe(S, "name", { value: n, configurable: !0 });
7
- var E = (S, n, e) => Ee(S, typeof n != "symbol" ? n + "" : n, e), we = (S, n, e) => n.has(S) || ve("Cannot " + e);
8
- var t = (S, n, e) => (we(S, n, "read from private field"), e ? e.call(S) : n.get(S)), d = (S, n, e) => n.has(S) ? ve("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(S) : n.set(S, e), y = (S, n, e, i) => (we(S, n, "write to private field"), i ? i.call(S, e) : n.set(S, e), e);
9
- var Se = (S, n, e, i) => ({
10
- set _(o) {
11
- y(S, n, o, e);
5
+ var Ve = (R, i, e) => i in R ? De(R, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : R[i] = e;
6
+ var c = (R, i) => De(R, "name", { value: i, configurable: !0 });
7
+ var S = (R, i, e) => Ve(R, typeof i != "symbol" ? i + "" : i, e), je = (R, i, e) => i.has(R) || ze("Cannot " + e);
8
+ var t = (R, i, e) => (je(R, i, "read from private field"), e ? e.call(R) : i.get(R)), d = (R, i, e) => i.has(R) ? ze("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(R) : i.set(R, e), y = (R, i, e, s) => (je(R, i, "write to private field"), s ? s.call(R, e) : i.set(R, e), e);
9
+ var Fe = (R, i, e, s) => ({
10
+ set _(n) {
11
+ y(R, i, n, e);
12
12
  },
13
13
  get _() {
14
- return t(S, n, i);
14
+ return t(R, i, s);
15
15
  }
16
16
  });
17
- import { trace as Re } from "@ninebone/util";
18
- const ce = class ce extends Re.constructor {
17
+ import { trace as Ye } from "@ninebone/util";
18
+ const Ce = class Ce extends Ye.constructor {
19
19
  constructor() {
20
20
  super(), this.init("nine-table", "green");
21
21
  }
22
22
  };
23
- h(ce, "Trace");
24
- let Gt = ce;
25
- const dt = new Gt();
26
- var W, B, v, F, V, X, At, U, qt;
27
- const he = class he extends HTMLElement {
23
+ c(Ce, "Trace");
24
+ let oe = Ce;
25
+ const rt = new oe();
26
+ var B, z, w, U, X, K, Mt, Z, It;
27
+ const Te = class Te extends HTMLElement {
28
28
  constructor() {
29
29
  super();
30
- d(this, W);
31
- d(this, B, !1);
32
- d(this, v);
33
- d(this, F);
34
- d(this, V);
30
+ d(this, B);
31
+ d(this, z, !1);
32
+ d(this, w);
33
+ d(this, U);
35
34
  d(this, X);
36
- d(this, At, /* @__PURE__ */ h(() => {
37
- if (!t(this, W)) return;
38
- const e = t(this, W).querySelector(".ng-container-body .ng-part-body");
39
- e && (y(this, X, new ResizeObserver(() => {
35
+ d(this, K);
36
+ d(this, Mt, /* @__PURE__ */ c(() => {
37
+ if (!t(this, B)) return;
38
+ const e = t(this, B).querySelector(".ng-container-body .ng-part-body");
39
+ e && (y(this, K, new ResizeObserver(() => {
40
40
  this.refresh();
41
- })), t(this, X).observe(e));
41
+ })), t(this, K).observe(e));
42
42
  }, "#observeResize"));
43
- E(this, "refresh", /* @__PURE__ */ h(() => {
44
- if (!t(this, W) || !t(this, v) || t(this, B)) return;
45
- const e = t(this, v).container, i = e.querySelector("table");
46
- if (!i) return;
47
- const o = t(this, v).track, r = t(this, v).thumb, s = t(this, W).querySelector(".ng-container-bottom"), l = e.clientWidth, c = i.scrollWidth;
48
- if (l !== 0 && c > l)
49
- s && (s.style.display = "flex");
43
+ S(this, "refresh", /* @__PURE__ */ c(() => {
44
+ if (!t(this, B) || !t(this, w) || t(this, z)) return;
45
+ const e = t(this, w).container, s = e.querySelector("table");
46
+ if (!s) return;
47
+ const n = t(this, w).track, r = t(this, w).thumb, o = t(this, B).querySelector(".ng-container-bottom"), a = e.clientWidth, h = s.scrollWidth;
48
+ if (a !== 0 && h > a)
49
+ o && (o.style.display = "flex");
50
50
  else {
51
- s && (s.style.display = "none");
51
+ o && (o.style.display = "none");
52
52
  return;
53
53
  }
54
- const a = o.clientWidth;
55
- if (a <= 0) return;
56
- const f = Math.max(Math.min(a * (l / c), a), 20);
54
+ const l = n.clientWidth;
55
+ if (l <= 0) return;
56
+ const f = Math.max(Math.min(l * (a / h), l), 20);
57
57
  r.style.width = `${f}px`;
58
- const g = e.scrollLeft, b = c - l;
59
- let u = 0;
60
- b > 0 && (u = parseInt(g / b * (a - f), 10)), u < 0 && (u = 0);
61
- const p = a - f;
62
- u > p && (u = p), r.style.left = `${u}px`, t(this, v).left.disabled = u === 0, t(this, v).right.disabled = u >= p - 1;
58
+ const u = e.scrollLeft, b = h - a;
59
+ let g = 0;
60
+ b > 0 && (g = parseInt(u / b * (l - f), 10)), g < 0 && (g = 0);
61
+ const m = l - f;
62
+ g > m && (g = m), r.style.left = `${g}px`, t(this, w).left.disabled = g === 0, t(this, w).right.disabled = g >= m - 1;
63
63
  }, "refresh"));
64
- d(this, U, /* @__PURE__ */ h((e) => {
65
- if (!t(this, v)) return !1;
66
- const i = t(this, v).container, o = i.querySelector("table");
67
- if (!o) return !1;
68
- const r = t(this, v).track.getBoundingClientRect(), s = t(this, v).thumb.clientWidth;
69
- let l = e;
70
- l < 0 && (l = 0);
71
- const c = r.width - s;
72
- l > c && (l = c), l = parseInt(l, 10), t(this, v).thumb.style.left = `${l}px`, t(this, v).left.disabled = l === 0, t(this, v).right.disabled = l >= c - 1;
73
- const a = i.clientWidth, g = o.scrollWidth - a;
74
- return c > 0 && g > 0 && (i.scrollLeft = l / c * g), l > 0 && l < c - 1;
64
+ d(this, Z, /* @__PURE__ */ c((e) => {
65
+ if (!t(this, w)) return !1;
66
+ const s = t(this, w).container, n = s.querySelector("table");
67
+ if (!n) return !1;
68
+ const r = t(this, w).track.getBoundingClientRect(), o = t(this, w).thumb.clientWidth;
69
+ let a = e;
70
+ a < 0 && (a = 0);
71
+ const h = r.width - o;
72
+ a > h && (a = h), a = parseInt(a, 10), t(this, w).thumb.style.left = `${a}px`, t(this, w).left.disabled = a === 0, t(this, w).right.disabled = a >= h - 1;
73
+ const l = s.clientWidth, u = n.scrollWidth - l;
74
+ return h > 0 && u > 0 && (s.scrollLeft = a / h * u), a > 0 && a < h - 1;
75
75
  }, "#thumbMoveTo"));
76
- d(this, qt, /* @__PURE__ */ h(() => {
77
- const e = /* @__PURE__ */ h((o) => {
78
- clearInterval(t(this, F)), clearInterval(t(this, V));
79
- const r = parseInt(t(this, v).thumb.style.left || 0, 10);
80
- t(this, U).call(this, r + o), y(this, F, setInterval(() => {
81
- clearInterval(t(this, F)), y(this, V, setInterval(() => {
82
- const s = parseInt(t(this, v).thumb.style.left || 0, 10);
83
- t(this, U).call(this, s + o) || clearInterval(t(this, V));
76
+ d(this, It, /* @__PURE__ */ c(() => {
77
+ const e = /* @__PURE__ */ c((n) => {
78
+ clearInterval(t(this, U)), clearInterval(t(this, X));
79
+ const r = parseInt(t(this, w).thumb.style.left || 0, 10);
80
+ t(this, Z).call(this, r + n), y(this, U, setInterval(() => {
81
+ clearInterval(t(this, U)), y(this, X, setInterval(() => {
82
+ const o = parseInt(t(this, w).thumb.style.left || 0, 10);
83
+ t(this, Z).call(this, o + n) || clearInterval(t(this, X));
84
84
  }, 50));
85
85
  }, 500));
86
- }, "delayScroll"), i = /* @__PURE__ */ h(() => {
87
- clearInterval(t(this, F)), clearInterval(t(this, V));
86
+ }, "delayScroll"), s = /* @__PURE__ */ c(() => {
87
+ clearInterval(t(this, U)), clearInterval(t(this, X));
88
88
  }, "clearTimer");
89
- ["mouseup", "mouseleave", "touchend"].forEach((o) => {
90
- t(this, v).left.addEventListener(o, i), t(this, v).right.addEventListener(o, i), t(this, v).track.addEventListener(o, i);
91
- }), t(this, v).left.addEventListener("mousedown", (o) => {
92
- o.button === 0 && e(-20);
93
- }), t(this, v).right.addEventListener("mousedown", (o) => {
94
- o.button === 0 && e(20);
95
- }), t(this, v).left.addEventListener("touchstart", () => e(-20)), t(this, v).right.addEventListener("touchstart", () => e(20)), t(this, v).track.addEventListener("mousedown", (o) => {
96
- if (o.button !== 0) return;
97
- o.preventDefault();
98
- const r = t(this, v).track.getBoundingClientRect(), s = t(this, v).thumb.clientWidth;
99
- t(this, U).call(this, o.clientX - r.left - s / 2);
100
- }), t(this, v).thumb.addEventListener("mousedown", (o) => {
101
- if (o.button !== 0) return;
102
- o.stopPropagation(), o.preventDefault(), y(this, B, !0), this.shiftX = o.clientX - t(this, v).thumb.getBoundingClientRect().left;
103
- const r = /* @__PURE__ */ h((l) => {
104
- if (!t(this, B)) return;
105
- const c = t(this, v).track.getBoundingClientRect();
106
- t(this, U).call(this, l.clientX - c.left - this.shiftX);
107
- }, "onMouseMove"), s = /* @__PURE__ */ h(() => {
108
- y(this, B, !1), i(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", s), this.refresh();
89
+ ["mouseup", "mouseleave", "touchend"].forEach((n) => {
90
+ t(this, w).left.addEventListener(n, s), t(this, w).right.addEventListener(n, s), t(this, w).track.addEventListener(n, s);
91
+ }), t(this, w).left.addEventListener("mousedown", (n) => {
92
+ n.button === 0 && e(-20);
93
+ }), t(this, w).right.addEventListener("mousedown", (n) => {
94
+ n.button === 0 && e(20);
95
+ }), t(this, w).left.addEventListener("touchstart", () => e(-20)), t(this, w).right.addEventListener("touchstart", () => e(20)), t(this, w).track.addEventListener("mousedown", (n) => {
96
+ if (n.button !== 0) return;
97
+ n.preventDefault();
98
+ const r = t(this, w).track.getBoundingClientRect(), o = t(this, w).thumb.clientWidth;
99
+ t(this, Z).call(this, n.clientX - r.left - o / 2);
100
+ }), t(this, w).thumb.addEventListener("mousedown", (n) => {
101
+ if (n.button !== 0) return;
102
+ n.stopPropagation(), n.preventDefault(), y(this, z, !0), this.shiftX = n.clientX - t(this, w).thumb.getBoundingClientRect().left;
103
+ const r = /* @__PURE__ */ c((a) => {
104
+ if (!t(this, z)) return;
105
+ const h = t(this, w).track.getBoundingClientRect();
106
+ t(this, Z).call(this, a.clientX - h.left - this.shiftX);
107
+ }, "onMouseMove"), o = /* @__PURE__ */ c(() => {
108
+ y(this, z, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
109
109
  }, "onMouseUp");
110
- document.addEventListener("mousemove", r), document.addEventListener("mouseup", s);
110
+ document.addEventListener("mousemove", r), document.addEventListener("mouseup", o);
111
111
  });
112
112
  }, "#init"));
113
113
  }
114
114
  connectedCallback() {
115
- if (y(this, W, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, W)) return;
115
+ if (y(this, B, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, B)) return;
116
116
  this.innerHTML = `
117
117
  <style>
118
118
  nine-table-hscrollbar {
@@ -176,100 +176,100 @@ const he = class he 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 i = t(this, W).querySelector(".ng-container-body .ng-part-body");
181
- if (!i) {
179
+ const e = /* @__PURE__ */ c(() => {
180
+ const s = t(this, B).querySelector(".ng-container-body .ng-part-body");
181
+ if (!s) {
182
182
  setTimeout(e, 10);
183
183
  return;
184
184
  }
185
- y(this, v, {
186
- container: i,
185
+ y(this, w, {
186
+ container: s,
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
- }), i.addEventListener("scroll", () => {
192
- t(this, B) || this.refresh();
193
- }), t(this, qt).call(this), t(this, At).call(this), this.refresh();
191
+ }), s.addEventListener("scroll", () => {
192
+ t(this, z) || this.refresh();
193
+ }), t(this, It).call(this), t(this, Mt).call(this), this.refresh();
194
194
  }, "initWhenReady");
195
195
  e();
196
196
  }
197
197
  disconnectedCallback() {
198
- t(this, X) && t(this, X).disconnect();
198
+ t(this, K) && t(this, K).disconnect();
199
199
  }
200
200
  };
201
- W = new WeakMap(), B = new WeakMap(), v = new WeakMap(), F = new WeakMap(), V = new WeakMap(), X = new WeakMap(), At = new WeakMap(), U = new WeakMap(), qt = new WeakMap(), h(he, "NineTableHScrollBar");
202
- let Jt = he;
203
- customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Jt);
204
- var P, et, j, A, ft, ut, Tt;
205
- const de = class de extends HTMLElement {
201
+ B = new WeakMap(), z = new WeakMap(), w = new WeakMap(), U = new WeakMap(), X = new WeakMap(), K = new WeakMap(), Mt = new WeakMap(), Z = new WeakMap(), It = new WeakMap(), c(Te, "NineTableHScrollBar");
202
+ let ae = Te;
203
+ customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ae);
204
+ var j, ot, G, q, xt, vt, _t;
205
+ const Le = class Le extends HTMLElement {
206
206
  constructor() {
207
207
  super();
208
- d(this, P);
209
- d(this, et);
210
- d(this, j, !1);
211
- d(this, A);
212
- d(this, ft, 0);
213
- d(this, ut, 0);
214
- E(this, "refresh", /* @__PURE__ */ h(() => {
215
- if (!t(this, P) || !t(this, A)) return;
216
- const e = t(this, A).container, i = t(this, A).track, o = t(this, A).thumb, r = e.clientHeight, l = (t(this, P).data.get() || []).length, c = t(this, et).getRowHeight(), a = l * c;
217
- if (a <= r) {
218
- o.style.display = "none", t(this, A).top.disabled = !0, t(this, A).bottom.disabled = !0;
208
+ d(this, j);
209
+ d(this, ot);
210
+ d(this, G, !1);
211
+ d(this, q);
212
+ d(this, xt, 0);
213
+ d(this, vt, 0);
214
+ S(this, "refresh", /* @__PURE__ */ c(() => {
215
+ if (!t(this, j) || !t(this, q)) return;
216
+ const e = t(this, q).container, s = t(this, q).track, n = t(this, q).thumb, r = e.clientHeight, a = (t(this, j).data.get() || []).length, h = t(this, ot).getRowHeight(), l = a * h;
217
+ if (l <= r) {
218
+ n.style.display = "none", t(this, q).top.disabled = !0, t(this, q).bottom.disabled = !0;
219
219
  return;
220
220
  } else
221
- o.style.display = "block";
222
- const f = i.clientHeight;
221
+ n.style.display = "block";
222
+ const f = s.clientHeight;
223
223
  if (f <= 0) return;
224
- const g = Math.max(Math.min(f * (r / a), f), 20);
225
- o.style.height = `${g}px`;
226
- const b = e.scrollTop, u = Math.max(a - r, 1);
227
- let p = 0;
228
- u > 0 && (p = b / u * (f - g));
229
- const x = f - g;
230
- p < 0 && (p = 0), p > x && (p = x), o.style.top = `${p}px`, t(this, A).top.disabled = b <= 0, t(this, A).bottom.disabled = b >= u - 1;
224
+ const u = Math.max(Math.min(f * (r / l), f), 20);
225
+ n.style.height = `${u}px`;
226
+ const b = e.scrollTop, g = Math.max(l - r, 1);
227
+ let m = 0;
228
+ g > 0 && (m = b / g * (f - u));
229
+ const v = f - u;
230
+ m < 0 && (m = 0), m > v && (m = v), n.style.top = `${m}px`, t(this, q).top.disabled = b <= 0, t(this, q).bottom.disabled = b >= g - 1;
231
231
  }, "refresh"));
232
- d(this, Tt, /* @__PURE__ */ h(() => {
233
- const e = t(this, A).container, i = /* @__PURE__ */ h(() => {
234
- const r = (t(this, P).data.get() || []).length, s = t(this, et).getRowHeight();
235
- return r * s;
232
+ d(this, _t, /* @__PURE__ */ c(() => {
233
+ const e = t(this, q).container, s = /* @__PURE__ */ c(() => {
234
+ const r = (t(this, j).data.get() || []).length, o = t(this, ot).getRowHeight();
235
+ return r * o;
236
236
  }, "getContentHeight");
237
237
  e.addEventListener("scroll", () => {
238
- t(this, j) || this.refresh();
239
- }), t(this, A).thumb.addEventListener("mousedown", (o) => {
240
- if (o.button !== 0) return;
241
- o.stopPropagation(), o.preventDefault(), y(this, j, !0), y(this, ft, o.clientY), y(this, ut, e.scrollTop);
242
- const r = /* @__PURE__ */ h((l) => {
243
- if (!t(this, j)) return;
244
- const c = t(this, A).track.getBoundingClientRect(), a = t(this, A).thumb.clientHeight, g = c.height - a, b = l.clientY - t(this, ft), u = e.clientHeight, p = i(), x = Math.max(p - u, 1);
245
- if (g > 0 && x > 0) {
246
- const R = b / g * x;
247
- let m = t(this, ut) + R;
248
- const z = Math.max(0, p - u);
249
- m < 0 && (m = 0), m > z && (m = z), e.scrollTop = m;
238
+ t(this, G) || this.refresh();
239
+ }), t(this, q).thumb.addEventListener("mousedown", (n) => {
240
+ if (n.button !== 0) return;
241
+ n.stopPropagation(), n.preventDefault(), y(this, G, !0), y(this, xt, n.clientY), y(this, vt, e.scrollTop);
242
+ const r = /* @__PURE__ */ c((a) => {
243
+ if (!t(this, G)) return;
244
+ const h = t(this, q).track.getBoundingClientRect(), l = t(this, q).thumb.clientHeight, u = h.height - l, b = a.clientY - t(this, xt), g = e.clientHeight, m = s(), v = Math.max(m - g, 1);
245
+ if (u > 0 && v > 0) {
246
+ const E = b / u * v;
247
+ let x = t(this, vt) + E;
248
+ const W = Math.max(0, m - g);
249
+ x < 0 && (x = 0), x > W && (x = W), e.scrollTop = x;
250
250
  }
251
251
  this.refresh();
252
- }, "onMouseMove"), s = /* @__PURE__ */ h(() => {
253
- y(this, j, !1), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", s), this.refresh();
252
+ }, "onMouseMove"), o = /* @__PURE__ */ c(() => {
253
+ y(this, G, !1), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
254
254
  }, "onMouseUp");
255
- document.addEventListener("mousemove", r), document.addEventListener("mouseup", s);
256
- }), t(this, A).track.addEventListener("mousedown", (o) => {
257
- if (o.button !== 0 || o.target === t(this, A).thumb) return;
258
- const r = t(this, A).track.getBoundingClientRect(), s = t(this, A).thumb.clientHeight, l = o.clientY - r.top - s / 2, a = r.height - s, f = e.clientHeight, g = i(), b = Math.max(g - f, 1);
259
- if (a > 0 && b > 0) {
260
- const u = Math.max(0, Math.min(1, l / a));
261
- e.scrollTop = u * b;
255
+ document.addEventListener("mousemove", r), document.addEventListener("mouseup", o);
256
+ }), t(this, q).track.addEventListener("mousedown", (n) => {
257
+ if (n.button !== 0 || n.target === t(this, q).thumb) return;
258
+ const r = t(this, q).track.getBoundingClientRect(), o = t(this, q).thumb.clientHeight, a = n.clientY - r.top - o / 2, l = r.height - o, f = e.clientHeight, u = s(), b = Math.max(u - f, 1);
259
+ if (l > 0 && b > 0) {
260
+ const g = Math.max(0, Math.min(1, a / l));
261
+ e.scrollTop = g * b;
262
262
  }
263
263
  this.refresh();
264
- }), t(this, A).top.addEventListener("click", () => {
264
+ }), t(this, q).top.addEventListener("click", () => {
265
265
  e.scrollTop -= 40;
266
- }), t(this, A).bottom.addEventListener("click", () => {
266
+ }), t(this, q).bottom.addEventListener("click", () => {
267
267
  e.scrollTop += 40;
268
268
  });
269
269
  }, "#init"));
270
270
  }
271
271
  connectedCallback() {
272
- y(this, P, this.getRootNode().host), y(this, et, this.closest("nine-table-sheet")), this.innerHTML = `
272
+ y(this, j, this.getRootNode().host), y(this, ot, this.closest("nine-table-sheet")), this.innerHTML = `
273
273
  <style>
274
274
  nine-table-vscrollbar {
275
275
  display: flex;
@@ -333,206 +333,206 @@ const de = class de extends HTMLElement {
333
333
  <div class='ng-scroll-track'><div class='ng-scroll-thumb'></div></div>
334
334
  <button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
335
335
  `;
336
- const e = /* @__PURE__ */ h(() => {
337
- const i = t(this, P).shadowRoot.querySelector(".ng-container-body .ng-part-body");
338
- if (!i) {
336
+ const e = /* @__PURE__ */ c(() => {
337
+ const s = t(this, j).shadowRoot.querySelector(".ng-container-body .ng-part-body");
338
+ if (!s) {
339
339
  setTimeout(e, 10);
340
340
  return;
341
341
  }
342
- y(this, A, {
343
- container: i,
342
+ y(this, q, {
343
+ container: s,
344
344
  track: this.querySelector(".ng-scroll-track"),
345
345
  thumb: this.querySelector(".ng-scroll-thumb"),
346
346
  top: this.querySelector(".ng-scroll-top"),
347
347
  bottom: this.querySelector(".ng-scroll-bottom")
348
- }), t(this, Tt).call(this), this.refresh();
348
+ }), t(this, _t).call(this), this.refresh();
349
349
  }, "initWhenReady");
350
350
  e();
351
351
  }
352
352
  };
353
- P = new WeakMap(), et = new WeakMap(), j = new WeakMap(), A = new WeakMap(), ft = new WeakMap(), ut = new WeakMap(), Tt = new WeakMap(), h(de, "NineTableVScrollBar");
354
- let Qt = de;
355
- customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Qt);
356
- var N, w, O, k, D, K, gt, nt, kt, Lt, Ct, bt, yt, Ht, Mt, pt, _t, it, mt, $t;
357
- const fe = class fe {
358
- constructor(n) {
359
- d(this, N);
360
- d(this, w);
361
- d(this, O, /* @__PURE__ */ new Map());
362
- d(this, k, null);
363
- d(this, D, null);
364
- d(this, K, 0);
365
- d(this, gt, 40);
366
- d(this, nt, !1);
367
- d(this, kt, 3);
368
- E(this, "refresh", /* @__PURE__ */ h(() => {
353
+ j = new WeakMap(), ot = new WeakMap(), G = new WeakMap(), q = new WeakMap(), xt = new WeakMap(), vt = new WeakMap(), _t = new WeakMap(), c(Le, "NineTableVScrollBar");
354
+ let le = Le;
355
+ customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", le);
356
+ var D, A, P, H, F, J, wt, at, Nt, Wt, Ot, St, Et, Bt, Pt, At, Dt, lt, Rt, zt;
357
+ const He = class He {
358
+ constructor(i) {
359
+ d(this, D);
360
+ d(this, A);
361
+ d(this, P, /* @__PURE__ */ new Map());
362
+ d(this, H, null);
363
+ d(this, F, null);
364
+ d(this, J, 0);
365
+ d(this, wt, 40);
366
+ d(this, at, !1);
367
+ d(this, Nt, 3);
368
+ S(this, "refresh", /* @__PURE__ */ c(() => {
369
369
  var e;
370
- const n = t(this, w).querySelector(".ng-container-body .ng-part-body");
371
- n && (t(this, bt).call(this), t(this, it).call(this, n.scrollTop), (e = t(this, w).querySelector("nine-table-vscrollbar")) == null || e.refresh());
370
+ const i = t(this, A).querySelector(".ng-container-body .ng-part-body");
371
+ i && (t(this, St).call(this), t(this, lt).call(this, i.scrollTop), (e = t(this, A).querySelector("nine-table-vscrollbar")) == null || e.refresh());
372
372
  }, "refresh"));
373
- E(this, "initialize", /* @__PURE__ */ h(() => {
374
- y(this, k, null), t(this, O).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
375
- const r = t(this, w).querySelector(o);
373
+ S(this, "initialize", /* @__PURE__ */ c(() => {
374
+ y(this, H, null), t(this, P).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
375
+ const r = t(this, A).querySelector(n);
376
376
  if (!r) return;
377
- const s = r.querySelector(".ng-part-body table");
378
- if (!s) return;
379
- const l = s.querySelector("tbody.bindable-tbody");
380
- if (!l) return;
381
- const a = Array.from(l.querySelectorAll("tr")).map((f) => f.cloneNode(!0));
382
- t(this, O).set(o, a);
377
+ const o = r.querySelector(".ng-part-body table");
378
+ if (!o) return;
379
+ const a = o.querySelector("tbody.bindable-tbody");
380
+ if (!a) return;
381
+ const l = Array.from(a.querySelectorAll("tr")).map((f) => f.cloneNode(!0));
382
+ t(this, P).set(n, l);
383
383
  });
384
- const n = t(this, w).querySelector(".ng-container-body .ng-part-body"), e = t(this, w).querySelector(".ng-container-left .ng-part-body"), i = t(this, w).querySelector(".ng-container-right .ng-part-body");
385
- if (n) {
386
- t(this, Ct).call(this, n), t(this, pt).call(this), t(this, bt).call(this), t(this, it).call(this, n.scrollTop);
387
- let o = !1;
388
- const r = /* @__PURE__ */ h((s, l) => {
389
- var c;
390
- o || (o = !0, n && n.scrollTop !== s && (n.scrollTop = s), e && e.scrollTop !== s && (e.scrollTop = s), i && i.scrollTop !== s && (i.scrollTop = s), t(this, it).call(this, s), (c = t(this, w).querySelector("nine-table-vscrollbar")) == null || c.refresh(), o = !1);
384
+ const i = t(this, A).querySelector(".ng-container-body .ng-part-body"), e = t(this, A).querySelector(".ng-container-left .ng-part-body"), s = t(this, A).querySelector(".ng-container-right .ng-part-body");
385
+ if (i) {
386
+ t(this, Ot).call(this, i), t(this, At).call(this), t(this, St).call(this), t(this, lt).call(this, i.scrollTop);
387
+ let n = !1;
388
+ const r = /* @__PURE__ */ c((o, a) => {
389
+ var h;
390
+ n || (n = !0, i && i.scrollTop !== o && (i.scrollTop = o), e && e.scrollTop !== o && (e.scrollTop = o), s && s.scrollTop !== o && (s.scrollTop = o), t(this, lt).call(this, o), (h = t(this, A).querySelector("nine-table-vscrollbar")) == null || h.refresh(), n = !1);
391
391
  }, "syncScroll");
392
- [n, e, i].forEach((s) => {
393
- s && s.addEventListener("scroll", () => {
394
- r(s.scrollTop);
392
+ [i, e, s].forEach((o) => {
393
+ o && o.addEventListener("scroll", () => {
394
+ r(o.scrollTop);
395
395
  });
396
396
  });
397
397
  }
398
398
  }, "initialize"));
399
- d(this, Lt, /* @__PURE__ */ h((n, e) => {
400
- const i = t(this, O).get(e);
401
- if (!i || i.length === 0) return;
402
- const o = n.querySelector(".ng-part-body tbody.bindable-tbody");
403
- if (!o) return;
404
- o.querySelectorAll("tr:not(.nodata)").forEach((l) => l.remove());
405
- const r = o.querySelector("tr.nodata"), s = document.createDocumentFragment();
406
- for (let l = 0; l < t(this, gt); l++)
407
- i.forEach((c) => {
408
- s.appendChild(c.cloneNode(!0));
399
+ d(this, Wt, /* @__PURE__ */ c((i, e) => {
400
+ const s = t(this, P).get(e);
401
+ if (!s || s.length === 0) return;
402
+ const n = i.querySelector(".ng-part-body tbody.bindable-tbody");
403
+ if (!n) return;
404
+ n.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
405
+ const r = n.querySelector("tr.nodata"), o = document.createDocumentFragment();
406
+ for (let a = 0; a < t(this, wt); a++)
407
+ s.forEach((h) => {
408
+ o.appendChild(h.cloneNode(!0));
409
409
  });
410
- r ? r.before(s) : o.appendChild(s);
410
+ r ? r.before(o) : n.appendChild(o);
411
411
  }, "#renderRows"));
412
- d(this, Ct, /* @__PURE__ */ h((n) => {
413
- if (t(this, k) !== null && t(this, k) > 0)
414
- return t(this, k);
415
- const e = t(this, O).get(".ng-container-body");
412
+ d(this, Ot, /* @__PURE__ */ c((i) => {
413
+ if (t(this, H) !== null && t(this, H) > 0)
414
+ return t(this, H);
415
+ const e = t(this, P).get(".ng-container-body");
416
416
  if (!e || e.length === 0) return 24;
417
- const i = n.querySelector("tbody.bindable-tbody");
418
- if (!i) return 24;
419
- i.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
420
- const o = i.querySelector("tr.nodata"), r = document.createDocumentFragment();
417
+ const s = i.querySelector("tbody.bindable-tbody");
418
+ if (!s) return 24;
419
+ s.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
420
+ const n = s.querySelector("tr.nodata"), r = document.createDocumentFragment();
421
421
  e.forEach((b) => {
422
422
  r.appendChild(b.cloneNode(!0));
423
- }), o ? o.before(r) : i.appendChild(r);
424
- const s = t(this, w), l = s.style.display, c = s.style.visibility, a = s.style.position;
425
- (l === "none" || window.getComputedStyle(s).display === "none") && (s.style.display = "block", s.style.visibility = "hidden", s.style.position = "absolute");
423
+ }), n ? n.before(r) : s.appendChild(r);
424
+ const o = t(this, A), a = o.style.display, h = o.style.visibility, l = o.style.position;
425
+ (a === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
426
426
  let f = 0;
427
- const g = i.querySelectorAll("tr:not(.nodata)");
428
- return g.forEach((b) => {
427
+ const u = s.querySelectorAll("tr:not(.nodata)");
428
+ return u.forEach((b) => {
429
429
  f += b.offsetHeight || b.getBoundingClientRect().height;
430
- }), g.forEach((b) => b.remove()), s.style.display = l, s.style.visibility = c, s.style.position = a, y(this, k, f > 0 ? f : 24), t(this, yt).call(this), t(this, k);
430
+ }), u.forEach((b) => b.remove()), o.style.display = a, o.style.visibility = h, o.style.position = l, y(this, H, f > 0 ? f : 24), t(this, Et).call(this), t(this, H);
431
431
  }, "#measureAndCacheHeight"));
432
- d(this, bt, /* @__PURE__ */ h(() => {
433
- const e = (t(this, N).data.get() || []).length, i = t(this, k) || 24, o = e * i;
432
+ d(this, St, /* @__PURE__ */ c(() => {
433
+ const e = (t(this, D).data.get() || []).length, s = t(this, H) || 24, n = e * s;
434
434
  [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((r) => {
435
- const s = t(this, w).querySelector(r);
436
- if (!s) return;
437
- const l = s.querySelector(".ng-part-body .ng-virtual-spacer");
438
- l && (l.style.height = `${o}px`);
435
+ const o = t(this, A).querySelector(r);
436
+ if (!o) return;
437
+ const a = o.querySelector(".ng-part-body .ng-virtual-spacer");
438
+ a && (a.style.height = `${n}px`);
439
439
  });
440
440
  }, "#updateVirtualScrollHeight"));
441
- d(this, yt, /* @__PURE__ */ h(() => {
442
- if (t(this, K) > 0 && t(this, k) > 0) {
443
- const n = Math.ceil(t(this, K) / t(this, k));
444
- y(this, gt, n + t(this, kt));
441
+ d(this, Et, /* @__PURE__ */ c(() => {
442
+ if (t(this, J) > 0 && t(this, H) > 0) {
443
+ const i = Math.ceil(t(this, J) / t(this, H));
444
+ y(this, wt, i + t(this, Nt));
445
445
  }
446
446
  }, "#updateRowCount"));
447
- d(this, Ht, /* @__PURE__ */ h(() => {
448
- var l, c, a, f, g, b;
449
- const n = t(this, w).querySelector(".ng-container-left .ng-part-body table"), e = t(this, w).querySelector(".ng-container-body .ng-part-body table"), i = t(this, w).querySelector(".ng-container-right .ng-part-body table");
447
+ d(this, Bt, /* @__PURE__ */ c(() => {
448
+ var a, h, l, f, u, b;
449
+ const i = t(this, A).querySelector(".ng-container-left .ng-part-body table"), e = t(this, A).querySelector(".ng-container-body .ng-part-body table"), s = t(this, A).querySelector(".ng-container-right .ng-part-body table");
450
450
  if (e) {
451
- const u = n ? Array.from(n.querySelectorAll("tbody tr")) : [], p = Array.from(e.querySelectorAll("tbody tr")), x = i ? Array.from(i.querySelectorAll("tbody tr")) : [], R = Math.max(u.length, p.length, x.length);
452
- for (let m = 0; m < R; m++) {
453
- const z = [
454
- ((l = u[m]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
455
- ((c = p[m]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
456
- ((a = x[m]) == null ? void 0 : a.getBoundingClientRect().height) || 0
457
- ], _ = Math.max(...z);
458
- _ > 0 && (u[m] && (u[m].style.height = `${_}px`), p[m] && (p[m].style.height = `${_}px`), x[m] && (x[m].style.height = `${_}px`));
451
+ const g = i ? Array.from(i.querySelectorAll("tbody tr")) : [], m = Array.from(e.querySelectorAll("tbody tr")), v = s ? Array.from(s.querySelectorAll("tbody tr")) : [], E = Math.max(g.length, m.length, v.length);
452
+ for (let x = 0; x < E; x++) {
453
+ const W = [
454
+ ((a = g[x]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
455
+ ((h = m[x]) == null ? void 0 : h.getBoundingClientRect().height) || 0,
456
+ ((l = v[x]) == null ? void 0 : l.getBoundingClientRect().height) || 0
457
+ ], T = Math.max(...W);
458
+ T > 0 && (g[x] && (g[x].style.height = `${T}px`), m[x] && (m[x].style.height = `${T}px`), v[x] && (v[x].style.height = `${T}px`));
459
459
  }
460
460
  }
461
- const o = t(this, w).querySelector(".ng-container-left .ng-part-footer table"), r = t(this, w).querySelector(".ng-container-body .ng-part-footer table"), s = t(this, w).querySelector(".ng-container-right .ng-part-footer table");
461
+ const n = t(this, A).querySelector(".ng-container-left .ng-part-footer table"), r = t(this, A).querySelector(".ng-container-body .ng-part-footer table"), o = t(this, A).querySelector(".ng-container-right .ng-part-footer table");
462
462
  if (r) {
463
- const u = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], p = Array.from(r.querySelectorAll("tfoot tr")), x = s ? Array.from(s.querySelectorAll("tfoot tr")) : [], R = Math.max(u.length, p.length, x.length);
464
- for (let m = 0; m < R; m++) {
465
- const z = [
466
- ((f = u[m]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
467
- ((g = p[m]) == null ? void 0 : g.getBoundingClientRect().height) || 0,
468
- ((b = x[m]) == null ? void 0 : b.getBoundingClientRect().height) || 0
469
- ], _ = Math.max(...z);
470
- _ > 0 && (u[m] && (u[m].style.height = `${_}px`), p[m] && (p[m].style.height = `${_}px`), x[m] && (x[m].style.height = `${_}px`));
463
+ const g = n ? Array.from(n.querySelectorAll("tfoot tr")) : [], m = Array.from(r.querySelectorAll("tfoot tr")), v = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], E = Math.max(g.length, m.length, v.length);
464
+ for (let x = 0; x < E; x++) {
465
+ const W = [
466
+ ((f = g[x]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
467
+ ((u = m[x]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
468
+ ((b = v[x]) == null ? void 0 : b.getBoundingClientRect().height) || 0
469
+ ], T = Math.max(...W);
470
+ T > 0 && (g[x] && (g[x].style.height = `${T}px`), m[x] && (m[x].style.height = `${T}px`), v[x] && (v[x].style.height = `${T}px`));
471
471
  }
472
472
  }
473
473
  }, "#syncRowHeights"));
474
- d(this, Mt, /* @__PURE__ */ h(() => {
475
- !t(this, w) || !(t(this, w) instanceof HTMLElement) || (y(this, D, new ResizeObserver((n) => {
476
- for (const e of n) {
477
- const i = e.target;
478
- if (!i.classList.contains("active")) continue;
479
- const o = e.contentRect.height;
480
- if (o > 0) {
474
+ d(this, Pt, /* @__PURE__ */ c(() => {
475
+ !t(this, A) || !(t(this, A) instanceof HTMLElement) || (y(this, F, new ResizeObserver((i) => {
476
+ for (const e of i) {
477
+ const s = e.target;
478
+ if (!s.classList.contains("active")) continue;
479
+ const n = e.contentRect.height;
480
+ if (n > 0) {
481
481
  let r = 0;
482
- const s = i.querySelector(".ng-part-header"), l = i.querySelector(".ng-part-footer");
483
- s && (r += s.offsetHeight), l && (r += l.offsetHeight);
484
- const c = Math.max(o - r, 100);
485
- t(this, K) !== c && (y(this, K, c), t(this, yt).call(this), t(this, k) !== null && t(this, pt).call(this));
482
+ const o = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
483
+ o && (r += o.offsetHeight), a && (r += a.offsetHeight);
484
+ const h = Math.max(n - r, 100);
485
+ t(this, J) !== h && (y(this, J, h), t(this, Et).call(this), t(this, H) !== null && t(this, At).call(this));
486
486
  }
487
487
  }
488
- })), t(this, D).observe(t(this, w)));
488
+ })), t(this, F).observe(t(this, A)));
489
489
  }, "#initResizeObserver"));
490
- d(this, pt, /* @__PURE__ */ h(() => {
491
- [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
492
- const e = t(this, w).querySelector(n);
493
- e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Lt).call(this, e, n);
494
- }), t(this, $t).call(this), t(this, Ht).call(this);
490
+ d(this, At, /* @__PURE__ */ c(() => {
491
+ [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
492
+ const e = t(this, A).querySelector(i);
493
+ e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Wt).call(this, e, i);
494
+ }), t(this, zt).call(this), t(this, Bt).call(this);
495
495
  }, "#renderAllContainers"));
496
- d(this, _t, /* @__PURE__ */ h((n) => {
496
+ d(this, Dt, /* @__PURE__ */ c((i) => {
497
497
  [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
498
- var a;
499
- const i = t(this, w).querySelector(e);
500
- if (!i) return;
501
- const o = i.querySelector(".ng-part-body tbody.bindable-tbody");
502
- if (!o) return;
503
- const r = Array.from(o.querySelectorAll("tr:not(.nodata)")), s = ((a = t(this, O).get(e)) == null ? void 0 : a.length) || 1, c = (t(this, N).data.get() || []).length;
504
- r.forEach((f, g) => {
505
- const b = n + Math.floor(g / s);
506
- if (b >= c) {
498
+ var l;
499
+ const s = t(this, A).querySelector(e);
500
+ if (!s) return;
501
+ const n = s.querySelector(".ng-part-body tbody.bindable-tbody");
502
+ if (!n) return;
503
+ const r = Array.from(n.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this, P).get(e)) == null ? void 0 : l.length) || 1, h = (t(this, D).data.get() || []).length;
504
+ r.forEach((f, u) => {
505
+ const b = i + Math.floor(u / o);
506
+ if (b >= h) {
507
507
  f.style.display = "none";
508
508
  return;
509
509
  }
510
- const u = t(this, N).data.get(b);
511
- f.style.display = "", t(this, mt).call(this, f, u, b);
510
+ const g = t(this, D).data.get(b);
511
+ f.style.display = "", t(this, Rt).call(this, f, g, b);
512
512
  });
513
513
  });
514
514
  }, "#adjustBufferRows"));
515
- d(this, it, /* @__PURE__ */ h((n) => {
516
- var c;
517
- const e = t(this, k);
515
+ d(this, lt, /* @__PURE__ */ c((i) => {
516
+ var h;
517
+ const e = t(this, H);
518
518
  if (!e || e <= 0) return;
519
- const o = (t(this, N).data.get() || []).length, r = Math.max(0, Math.floor(n / e)), s = r * e, l = ((c = t(this, O).get(".ng-container-body")) == null ? void 0 : c.length) || 1;
520
- [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((a) => {
521
- const f = t(this, w).querySelector(a);
519
+ const n = (t(this, D).data.get() || []).length, r = Math.max(0, Math.floor(i / e)), o = r * e, a = ((h = t(this, P).get(".ng-container-body")) == null ? void 0 : h.length) || 1;
520
+ [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((l) => {
521
+ const f = t(this, A).querySelector(l);
522
522
  if (!f) return;
523
- const g = f.querySelector(".ng-part-body tbody.bindable-tbody");
524
- if (!g) return;
525
- g.style.transform = `translateY(${s}px)`, Array.from(g.querySelectorAll("tr:not(.nodata)")).forEach((u, p) => {
526
- const x = r + Math.floor(p / l);
527
- if (x >= o) {
528
- u.style.display = "none";
523
+ const u = f.querySelector(".ng-part-body tbody.bindable-tbody");
524
+ if (!u) return;
525
+ u.style.transform = `translateY(${o}px)`, Array.from(u.querySelectorAll("tr:not(.nodata)")).forEach((g, m) => {
526
+ const v = r + Math.floor(m / a);
527
+ if (v >= n) {
528
+ g.style.display = "none";
529
529
  return;
530
530
  }
531
- const R = t(this, N).data.get(x);
532
- u.style.display = "", t(this, mt).call(this, u, R, x);
531
+ const E = t(this, D).data.get(v);
532
+ g.style.display = "", t(this, Rt).call(this, g, E, v);
533
533
  });
534
- }), t(this, nt) || (y(this, nt, !0), setTimeout(() => {
535
- t(this, _t).call(this, r), y(this, nt, !1);
534
+ }), t(this, at) || (y(this, at, !0), setTimeout(() => {
535
+ t(this, Dt).call(this, r), y(this, at, !1);
536
536
  }, 0));
537
537
  }, "#handleScroll"));
538
538
  /**
@@ -549,200 +549,200 @@ const fe = class fe {
549
549
  cell.dataset.row = dataIndex;
550
550
  });
551
551
  }; */
552
- d(this, mt, /* @__PURE__ */ h((n, e, i) => {
553
- n.dataset.row = i, n.data = e, Array.from(n.cells).forEach((o, r) => {
554
- o.dataset.row = i, o.querySelector(':scope > [is^="cell-"], :scope > [class*="cell-"], :scope > cell-');
555
- const s = Array.from(o.children).find((l) => l.tagName.toLowerCase().startsWith("cell-") || typeof l.reset == "function");
556
- s && typeof s.reset == "function" && s.reset();
552
+ d(this, Rt, /* @__PURE__ */ c((i, e, s) => {
553
+ i.dataset.row = s, i.data = e, Array.from(i.cells).forEach((n, r) => {
554
+ n.dataset.row = s, n.querySelector(':scope > [is^="cell-"], :scope > [class*="cell-"], :scope > cell-');
555
+ const o = Array.from(n.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.reset == "function");
556
+ o && typeof o.reset == "function" && o.reset();
557
557
  });
558
558
  }, "#bindRowData"));
559
- d(this, $t, /* @__PURE__ */ h(() => {
560
- var c, a, f;
561
- const n = t(this, w).querySelector(".ng-container-left .ng-part-header table"), e = t(this, w).querySelector(".ng-container-body .ng-part-header table"), i = t(this, w).querySelector(".ng-container-right .ng-part-header table");
559
+ d(this, zt, /* @__PURE__ */ c(() => {
560
+ var h, l, f;
561
+ const i = t(this, A).querySelector(".ng-container-left .ng-part-header table"), e = t(this, A).querySelector(".ng-container-body .ng-part-header table"), s = t(this, A).querySelector(".ng-container-right .ng-part-header table");
562
562
  if (!e) return;
563
- const o = n ? Array.from(n.querySelectorAll("tr")) : [], r = Array.from(e.querySelectorAll("tr")), s = i ? Array.from(i.querySelectorAll("tr")) : [], l = Math.max(o.length, r.length, s.length);
564
- for (let g = 0; g < l; g++) {
563
+ const n = i ? Array.from(i.querySelectorAll("tr")) : [], r = Array.from(e.querySelectorAll("tr")), o = s ? Array.from(s.querySelectorAll("tr")) : [], a = Math.max(n.length, r.length, o.length);
564
+ for (let u = 0; u < a; u++) {
565
565
  const b = [
566
- ((c = o[g]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
567
- ((a = r[g]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
568
- ((f = s[g]) == null ? void 0 : f.getBoundingClientRect().height) || 0
569
- ], u = Math.max(...b);
570
- u > 0 && (o[g] && (o[g].style.height = `${u}px`), r[g] && (r[g].style.height = `${u}px`), s[g] && (s[g].style.height = `${u}px`));
566
+ ((h = n[u]) == null ? void 0 : h.getBoundingClientRect().height) || 0,
567
+ ((l = r[u]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
568
+ ((f = o[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
569
+ ], g = Math.max(...b);
570
+ g > 0 && (n[u] && (n[u].style.height = `${g}px`), r[u] && (r[u].style.height = `${g}px`), o[u] && (o[u].style.height = `${g}px`));
571
571
  }
572
572
  }, "#syncHeaderHeights"));
573
- E(this, "destroy", /* @__PURE__ */ h(() => {
574
- t(this, D) && (t(this, D).disconnect(), y(this, D, null));
573
+ S(this, "destroy", /* @__PURE__ */ c(() => {
574
+ t(this, F) && (t(this, F).disconnect(), y(this, F, null));
575
575
  }, "destroy"));
576
- y(this, N, n.getRootNode().host), y(this, w, n), t(this, Mt).call(this);
576
+ y(this, D, i.getRootNode().host), y(this, A, i), t(this, Pt).call(this);
577
577
  }
578
578
  getRowHeight() {
579
- return t(this, k);
579
+ return t(this, H);
580
580
  }
581
- templateLength(n = ".ng-container-body") {
581
+ templateLength(i = ".ng-container-body") {
582
582
  var e;
583
- return ((e = t(this, O).get(n)) == null ? void 0 : e.length) || 1;
583
+ return ((e = t(this, P).get(i)) == null ? void 0 : e.length) || 1;
584
584
  }
585
585
  };
586
- N = new WeakMap(), w = new WeakMap(), O = new WeakMap(), k = new WeakMap(), D = new WeakMap(), K = new WeakMap(), gt = new WeakMap(), nt = new WeakMap(), kt = new WeakMap(), Lt = new WeakMap(), Ct = new WeakMap(), bt = new WeakMap(), yt = new WeakMap(), Ht = new WeakMap(), Mt = new WeakMap(), pt = new WeakMap(), _t = new WeakMap(), it = new WeakMap(), mt = new WeakMap(), $t = new WeakMap(), h(fe, "RowManager");
587
- let te = fe;
588
- const It = class It {
586
+ D = new WeakMap(), A = new WeakMap(), P = new WeakMap(), H = new WeakMap(), F = new WeakMap(), J = new WeakMap(), wt = new WeakMap(), at = new WeakMap(), Nt = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), Bt = new WeakMap(), Pt = new WeakMap(), At = new WeakMap(), Dt = new WeakMap(), lt = new WeakMap(), Rt = new WeakMap(), zt = new WeakMap(), c(He, "RowManager");
587
+ let ce = He;
588
+ const jt = class jt {
589
589
  /**
590
590
  * 🎯 레이아웃 내의 여러 rawTables 배열을 일괄로 받아 단일 마스터 템플릿으로 사전 컴파일합니다.
591
591
  */
592
- static compileAll(n) {
593
- return Array.isArray(n) ? n.map((e) => It.compile(e)) : [];
592
+ static compileAll(i) {
593
+ return Array.isArray(i) ? i.map((e) => jt.compile(e)) : [];
594
594
  }
595
595
  /**
596
596
  * 🎯 단일 원본 테이블을 받아 기본 구조 보정 및 2차원 격자 인덱스 사전 부여 완료된 마스터 테이블 반환
597
597
  */
598
- static compile(n) {
599
- if (!n) return null;
600
- const e = /* @__PURE__ */ h((l) => {
601
- l.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((a) => {
602
- const f = a.getAttribute("cell-type") || "renderer";
603
- if (a.children.length > 0 && a.firstElementChild.tagName.includes("-")) return;
604
- let g = `cell-${f}`;
605
- const b = a.getAttribute("data-bind"), u = a.getAttribute("data-expr"), p = a.getAttribute("maxbyte"), x = a.getAttribute("type");
606
- let R = [];
607
- b && R.push(`data-bind="${b}"`), u && R.push(`data-expr="${u}"`), p && R.push(`maxbyte="${p}"`), x && R.push(`type="${x}"`), a.innerHTML = `<${g} ${R.join(" ")}></${g}>`;
598
+ static compile(i) {
599
+ if (!i) return null;
600
+ const e = /* @__PURE__ */ c((a) => {
601
+ a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
602
+ const f = l.getAttribute("cell-type") || "renderer";
603
+ if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
604
+ let u = `cell-${f}`;
605
+ const b = l.getAttribute("data-bind"), g = l.getAttribute("data-expr"), m = l.getAttribute("maxbyte"), v = l.getAttribute("type");
606
+ let E = [];
607
+ b && E.push(`data-bind="${b}"`), g && E.push(`data-expr="${g}"`), m && E.push(`maxbyte="${m}"`), v && E.push(`type="${v}"`), l.innerHTML = `<${u} ${E.join(" ")}></${u}>`;
608
608
  });
609
- }, "processCellTypes"), i = /* @__PURE__ */ h((l) => {
610
- if (!l.querySelector("colgroup")) {
611
- const c = l.querySelector("tbody tr") || l.querySelector("tr"), a = c ? c.querySelectorAll("th, td").length : 1, f = document.createElement("colgroup"), g = Math.max(Math.floor(l.clientWidth / a), 100);
612
- for (let b = 0; b < a; b++) {
613
- const u = document.createElement("col");
614
- u.setAttribute("width", g), f.appendChild(u);
609
+ }, "processCellTypes"), s = /* @__PURE__ */ c((a) => {
610
+ if (!a.querySelector("colgroup")) {
611
+ const h = a.querySelector("tbody tr") || a.querySelector("tr"), l = h ? h.querySelectorAll("th, td").length : 1, f = document.createElement("colgroup"), u = Math.max(Math.floor(a.clientWidth / l), 100);
612
+ for (let b = 0; b < l; b++) {
613
+ const g = document.createElement("col");
614
+ g.setAttribute("width", u), f.appendChild(g);
615
615
  }
616
- l.prepend(f);
616
+ a.prepend(f);
617
617
  }
618
- if (!l.querySelector("thead")) {
619
- const c = document.createElement("thead"), a = l.querySelector("colgroup");
620
- a ? a.after(c) : l.prepend(c);
618
+ if (!a.querySelector("thead")) {
619
+ const h = document.createElement("thead"), l = a.querySelector("colgroup");
620
+ l ? l.after(h) : a.prepend(h);
621
621
  }
622
- l.classList.add("nine-table-element"), l.style.display = "table";
623
- }, "ensureTableStructure"), o = /* @__PURE__ */ h((l, c) => {
624
- const a = Array.from(l.querySelectorAll(c + " tr")), f = Array.from(l.querySelectorAll(c + " th," + c + " td")), g = a.length;
625
- if (g === 0 || f.length === 0) return;
622
+ a.classList.add("nine-table-element"), a.style.display = "table";
623
+ }, "ensureTableStructure"), n = /* @__PURE__ */ c((a, h) => {
624
+ const l = Array.from(a.querySelectorAll(h + " tr")), f = Array.from(a.querySelectorAll(h + " th," + h + " td")), u = l.length;
625
+ if (u === 0 || f.length === 0) return;
626
626
  let b = 0;
627
- f.forEach((p) => {
628
- b += p.colSpan || 1;
627
+ f.forEach((m) => {
628
+ b += m.colSpan || 1;
629
629
  });
630
- const u = Array.from(Array(g), () => Array(b).fill(null));
631
- a.forEach((p) => {
632
- const x = p.sectionRowIndex;
633
- let R = 0;
634
- Array.from(p.querySelectorAll("th,td")).forEach((m) => {
635
- for (let I = 0; I < u[x].length; I++)
636
- if (u[x][I] === null) {
637
- R = I;
630
+ const g = Array.from(Array(u), () => Array(b).fill(null));
631
+ l.forEach((m) => {
632
+ const v = m.sectionRowIndex;
633
+ let E = 0;
634
+ Array.from(m.querySelectorAll("th,td")).forEach((x) => {
635
+ for (let O = 0; O < g[v].length; O++)
636
+ if (g[v][O] === null) {
637
+ E = O;
638
638
  break;
639
639
  }
640
- const z = m.rowSpan || 1, _ = m.colSpan || 1;
641
- for (let I = 0; I < z; I++)
642
- for (let ct = 0; ct < _; ct++)
643
- x + I < g && R + ct < b && (u[x + I][R + ct] = I === 0 && ct === 0 ? "1" : "0");
640
+ const W = x.rowSpan || 1, T = x.colSpan || 1;
641
+ for (let O = 0; O < W; O++)
642
+ for (let yt = 0; yt < T; yt++)
643
+ v + O < u && E + yt < b && (g[v + O][E + yt] = O === 0 && yt === 0 ? "1" : "0");
644
644
  });
645
- }), a.forEach((p) => {
646
- const x = p.sectionRowIndex;
647
- Array.from(p.querySelectorAll("th,td")).forEach((R) => {
648
- for (let m = 0; m < u[x].length; m++)
649
- if (u[x][m] === "1") {
650
- R.dataset.col = m, u[x][m] = "0";
645
+ }), l.forEach((m) => {
646
+ const v = m.sectionRowIndex;
647
+ Array.from(m.querySelectorAll("th,td")).forEach((E) => {
648
+ for (let x = 0; x < g[v].length; x++)
649
+ if (g[v][x] === "1") {
650
+ E.dataset.col = x, g[v][x] = "0";
651
651
  break;
652
652
  }
653
653
  });
654
654
  });
655
- }, "resetColIndex"), r = n.cloneNode(!0);
656
- return i(r), e(r), o(r, "thead"), o(r, "tbody"), o(r, "tfoot"), Array.from(r.querySelectorAll("colgroup col")).forEach((l, c) => {
657
- const a = l.getAttribute("fixed");
658
- a && r.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((f) => {
659
- f.setAttribute("fixed", a);
655
+ }, "resetColIndex"), r = i.cloneNode(!0);
656
+ return s(r), e(r), n(r, "thead"), n(r, "tbody"), n(r, "tfoot"), Array.from(r.querySelectorAll("colgroup col")).forEach((a, h) => {
657
+ const l = a.getAttribute("fixed");
658
+ l && r.querySelectorAll(`thead [data-col="${h}"], tbody [data-col="${h}"], tfoot [data-col="${h}"]`).forEach((f) => {
659
+ f.setAttribute("fixed", l);
660
660
  });
661
661
  }), r;
662
662
  }
663
663
  // 🎯 [추가] td/th에 선언된 cell-type 속성을 읽어 커스텀 태그로 자동 감싸기
664
664
  };
665
- h(It, "TableCompiler");
666
- let ee = It;
667
- var Wt, Z, G, Ot, Nt, ot, zt, Bt;
668
- const ht = class ht extends HTMLElement {
665
+ c(jt, "TableCompiler");
666
+ let he = jt;
667
+ var Ft, Q, tt, Vt, Yt, ct, Ut, Xt;
668
+ const pt = class pt extends HTMLElement {
669
669
  constructor() {
670
670
  super();
671
- d(this, Wt);
672
- d(this, Z, null);
673
- d(this, G);
674
- E(this, "invalidate", /* @__PURE__ */ h(() => {
675
- var e, i;
676
- t(this, G).refresh(), (e = this.querySelector("nine-table-hscrollbar")) == null || e.refresh(), (i = this.querySelector("nine-table-vscrollbar")) == null || i.refresh();
671
+ d(this, Ft);
672
+ d(this, Q, null);
673
+ d(this, tt);
674
+ S(this, "invalidate", /* @__PURE__ */ c(() => {
675
+ var e, s;
676
+ t(this, tt).refresh(), (e = this.querySelector("nine-table-hscrollbar")) == null || e.refresh(), (s = this.querySelector("nine-table-vscrollbar")) == null || s.refresh();
677
677
  }, "invalidate"));
678
- d(this, Ot, /* @__PURE__ */ h(() => {
678
+ d(this, Vt, /* @__PURE__ */ c(() => {
679
679
  [
680
680
  { selector: ".ng-container-body", type: null },
681
681
  { selector: ".ng-container-left", type: "left" },
682
682
  { selector: ".ng-container-right", type: "right" }
683
- ].forEach(({ selector: i, type: o }) => {
684
- const r = this.querySelector(i);
683
+ ].forEach(({ selector: s, type: n }) => {
684
+ const r = this.querySelector(s);
685
685
  if (!r) return;
686
686
  r.innerHTML = "";
687
- const s = document.createElement("div");
688
- s.className = "ng-part-header", s.appendChild(t(this, ot).call(this, t(this, Z), o, "header"));
689
- const l = document.createElement("div");
690
- l.className = "ng-part-body";
691
- const c = document.createElement("div");
692
- c.className = "ng-scroll-content", c.style.position = "relative", c.style.width = "100%", c.appendChild(t(this, ot).call(this, t(this, Z), o, "body"));
687
+ const o = document.createElement("div");
688
+ o.className = "ng-part-header", o.appendChild(t(this, ct).call(this, t(this, Q), n, "header"));
693
689
  const a = document.createElement("div");
694
- a.className = "ng-virtual-spacer", a.style.width = "100%", a.style.pointerEvents = "none", c.appendChild(a), l.appendChild(c);
690
+ a.className = "ng-part-body";
691
+ const h = document.createElement("div");
692
+ h.className = "ng-scroll-content", h.style.position = "relative", h.style.width = "100%", h.appendChild(t(this, ct).call(this, t(this, Q), n, "body"));
693
+ const l = document.createElement("div");
694
+ l.className = "ng-virtual-spacer", l.style.width = "100%", l.style.pointerEvents = "none", h.appendChild(l), a.appendChild(h);
695
695
  const f = document.createElement("div");
696
- f.className = "ng-part-footer", f.appendChild(t(this, ot).call(this, t(this, Z), o, "footer")), r.appendChild(s), r.appendChild(l), r.appendChild(f);
696
+ f.className = "ng-part-footer", f.appendChild(t(this, ct).call(this, t(this, Q), n, "footer")), r.appendChild(o), r.appendChild(a), r.appendChild(f);
697
697
  });
698
698
  }, "#renderSplitContainers"));
699
- d(this, Nt, /* @__PURE__ */ h(() => {
699
+ d(this, Yt, /* @__PURE__ */ c(() => {
700
700
  ["left", "right", "body"].forEach((e) => {
701
- const i = this.querySelector(`.ng-container-${e}`), o = i == null ? void 0 : i.querySelectorAll("table");
702
- if (!i || !o || o.length === 0) return;
701
+ const s = this.querySelector(`.ng-container-${e}`), n = s == null ? void 0 : s.querySelectorAll("table");
702
+ if (!s || !n || n.length === 0) return;
703
703
  let r = 0;
704
- o[0].querySelectorAll("col").forEach((s) => {
705
- const l = parseInt(s.getAttribute("width"), 10);
706
- isNaN(r) || (r += l);
707
- }), e === "body" ? i.style.flex = "1" : (i.style.flex = `0 0 ${r}px`, i.style.width = `${r}px`);
704
+ n[0].querySelectorAll("col").forEach((o) => {
705
+ const a = parseInt(o.getAttribute("width"), 10);
706
+ isNaN(r) || (r += a);
707
+ }), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${r}px`, s.style.width = `${r}px`);
708
708
  });
709
709
  }, "#updateContainerWidths"));
710
- E(this, "generate", /* @__PURE__ */ h((e) => {
711
- e && (y(this, Z, ee.compile(e)), t(this, Ot).call(this), t(this, Nt).call(this), t(this, G).initialize(), setTimeout(() => {
712
- var i;
713
- (i = this.querySelector("nine-table-hscrollbar")) == null || i.refresh();
710
+ S(this, "generate", /* @__PURE__ */ c((e) => {
711
+ e && (y(this, Q, he.compile(e)), t(this, Vt).call(this), t(this, Yt).call(this), t(this, tt).initialize(), setTimeout(() => {
712
+ var s;
713
+ (s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
714
714
  }, 0));
715
715
  }, "generate"));
716
- d(this, ot, /* @__PURE__ */ h((e, i, o) => {
717
- const r = e.cloneNode(!0), s = r.querySelector("thead"), l = r.querySelector("tbody"), c = r.querySelector("tfoot");
718
- if (o === "header") {
719
- if (l && l.remove(), c && c.remove(), e.querySelector("tbody")) {
716
+ d(this, ct, /* @__PURE__ */ c((e, s, n) => {
717
+ const r = e.cloneNode(!0), o = r.querySelector("thead"), a = r.querySelector("tbody"), h = r.querySelector("tfoot");
718
+ if (n === "header") {
719
+ if (a && a.remove(), h && h.remove(), e.querySelector("tbody")) {
720
720
  const f = document.createElement("tbody");
721
721
  f.className = "fixed-tbody", r.appendChild(f);
722
722
  }
723
- } else o === "body" ? (s && s.remove(), c && c.remove(), l && (l.className = "bindable-tbody")) : o === "footer" && (s && s.remove(), l && l.remove());
724
- return i === "left" ? r.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((a) => {
725
- a.getAttribute("fixed") !== "left" && a.remove();
726
- }) : i === "right" ? r.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((a) => {
727
- a.getAttribute("fixed") !== "right" && a.remove();
728
- }) : r.querySelectorAll("[fixed=left], [fixed=right]").forEach((a) => {
729
- a.remove();
723
+ } else n === "body" ? (o && o.remove(), h && h.remove(), a && (a.className = "bindable-tbody")) : n === "footer" && (o && o.remove(), a && a.remove());
724
+ return s === "left" ? r.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
725
+ l.getAttribute("fixed") !== "left" && l.remove();
726
+ }) : s === "right" ? r.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
727
+ l.getAttribute("fixed") !== "right" && l.remove();
728
+ }) : r.querySelectorAll("[fixed=left], [fixed=right]").forEach((l) => {
729
+ l.remove();
730
730
  }), r;
731
731
  }, "#createSplitTable"));
732
- E(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, G).getRowHeight(), "getRowHeight"));
733
- E(this, "scrollToX", /* @__PURE__ */ h((e) => {
734
- const i = this.querySelector(".ng-container-body .ng-part-body");
735
- i && (i.scrollLeft = e);
732
+ S(this, "getRowHeight", /* @__PURE__ */ c(() => t(this, tt).getRowHeight(), "getRowHeight"));
733
+ S(this, "scrollToX", /* @__PURE__ */ c((e) => {
734
+ const s = this.querySelector(".ng-container-body .ng-part-body");
735
+ s && (s.scrollLeft = e);
736
736
  }, "scrollToX"));
737
- E(this, "scrollToY", /* @__PURE__ */ h((e) => {
738
- const i = this.querySelector(".ng-container-body .ng-part-body");
739
- i && (i.scrollTop = e);
737
+ S(this, "scrollToY", /* @__PURE__ */ c((e) => {
738
+ const s = this.querySelector(".ng-container-body .ng-part-body");
739
+ s && (s.scrollTop = e);
740
740
  }, "scrollToY"));
741
- d(this, zt, /* @__PURE__ */ h(() => {
742
- t(this, Bt).call(this);
741
+ d(this, Ut, /* @__PURE__ */ c(() => {
742
+ t(this, Xt).call(this);
743
743
  }, "#init"));
744
- d(this, Bt, /* @__PURE__ */ h(() => {
745
- const e = ht.SCROLLBAR_SIZE;
744
+ d(this, Xt, /* @__PURE__ */ c(() => {
745
+ const e = pt.SCROLLBAR_SIZE;
746
746
  this.innerHTML = `
747
747
  <style>
748
748
  nine-table-sheet {
@@ -884,99 +884,99 @@ const ht = class ht extends HTMLElement {
884
884
  </div>
885
885
  `;
886
886
  }, "#render"));
887
- y(this, G, new te(this)), y(this, Wt, this.getRootNode().host);
887
+ y(this, tt, new ce(this)), y(this, Ft, this.getRootNode().host);
888
888
  }
889
889
  connectedCallback() {
890
- t(this, zt).call(this);
890
+ t(this, Ut).call(this);
891
891
  }
892
892
  disconnectedCallback() {
893
- this.innerHTML = "", dt.log("NineTableSheet destroyed.");
893
+ this.innerHTML = "", rt.log("NineTableSheet destroyed.");
894
894
  }
895
895
  };
896
- Wt = new WeakMap(), Z = new WeakMap(), G = new WeakMap(), Ot = new WeakMap(), Nt = new WeakMap(), ot = new WeakMap(), zt = new WeakMap(), Bt = new WeakMap(), h(ht, "NineTableSheet"), E(ht, "SCROLLBAR_SIZE", 16);
897
- let Rt = ht;
898
- customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", Rt);
899
- var Pt, xt;
900
- const ue = class ue extends HTMLElement {
896
+ Ft = new WeakMap(), Q = new WeakMap(), tt = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), ct = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(), c(pt, "NineTableSheet"), S(pt, "SCROLLBAR_SIZE", 16);
897
+ let Ht = pt;
898
+ customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", Ht);
899
+ var Kt, qt;
900
+ const $e = class $e extends HTMLElement {
901
901
  constructor() {
902
902
  super();
903
- d(this, Pt, /* @__PURE__ */ h(() => {
903
+ d(this, Kt, /* @__PURE__ */ c(() => {
904
904
  var e;
905
- (e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (i) => {
906
- var s;
907
- const o = i.ctrlKey || i.metaKey || i.shiftKey, r = parseInt((s = i.target.closest(".nine-tab-item")) == null ? void 0 : s.dataset.index, 10);
908
- t(this, xt).call(this, r, o);
909
- }), t(this, xt).call(this, 0, !1);
905
+ (e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
906
+ var o;
907
+ const n = s.ctrlKey || s.metaKey || s.shiftKey, r = parseInt((o = s.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
908
+ t(this, qt).call(this, r, n);
909
+ }), t(this, qt).call(this, 0, !1);
910
910
  }, "#init"));
911
- d(this, xt, /* @__PURE__ */ h((e, i = !1) => {
912
- const o = /* @__PURE__ */ h(() => {
911
+ d(this, qt, /* @__PURE__ */ c((e, s = !1) => {
912
+ const n = /* @__PURE__ */ c(() => {
913
913
  const f = Array.from(this.querySelectorAll("nine-table-sheet"));
914
- Array.from(this.querySelectorAll("nine-splitter")).forEach((u) => u.style.setProperty("display", "none"));
915
- const b = f.filter((u) => u.classList.contains("active"));
916
- b.length < 2 || b.forEach((u) => {
917
- const p = parseInt(u.getAttribute("data-index"), 10), x = this.querySelector(`nine-splitter[data-split-index="${p}"]`), R = f[p + 1];
918
- x && R && R.classList.contains("active") && x.style.setProperty("display", "flex");
914
+ Array.from(this.querySelectorAll("nine-splitter")).forEach((g) => g.style.setProperty("display", "none"));
915
+ const b = f.filter((g) => g.classList.contains("active"));
916
+ b.length < 2 || b.forEach((g) => {
917
+ const m = parseInt(g.getAttribute("data-index"), 10), v = this.querySelector(`nine-splitter[data-split-index="${m}"]`), E = f[m + 1];
918
+ v && E && E.classList.contains("active") && v.style.setProperty("display", "flex");
919
919
  });
920
- }, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), s = this.querySelector("nine-table-sheets-body"), l = r.querySelectorAll(".nine-tab-item"), c = s.querySelectorAll("nine-table-sheet");
921
- if (!l[e]) return;
922
- if (!i)
923
- l.forEach((f, g) => {
924
- f.classList.toggle("active", g === e);
925
- }), c.forEach((f, g) => {
926
- const b = g === e;
920
+ }, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = r.querySelectorAll(".nine-tab-item"), h = o.querySelectorAll("nine-table-sheet");
921
+ if (!a[e]) return;
922
+ if (!s)
923
+ a.forEach((f, u) => {
924
+ f.classList.toggle("active", u === e);
925
+ }), h.forEach((f, u) => {
926
+ const b = u === e;
927
927
  f.classList.toggle("active", b), f.style.flex = b ? "1 1 100%" : "";
928
928
  });
929
929
  else {
930
- const f = l[e], g = r.querySelectorAll(".nine-tab-item.active");
931
- if (f.classList.contains("active") && g.length <= 1)
930
+ const f = a[e], u = r.querySelectorAll(".nine-tab-item.active");
931
+ if (f.classList.contains("active") && u.length <= 1)
932
932
  return;
933
933
  f.classList.toggle("active");
934
- const b = s.querySelector(`nine-table-sheet[data-index="${e}"]`);
934
+ const b = o.querySelector(`nine-table-sheet[data-index="${e}"]`);
935
935
  b && (b.classList.toggle("active"), b.classList.contains("active") || (b.style.flex = ""));
936
936
  }
937
- const a = s.querySelectorAll("nine-table-sheet.active");
938
- a == null || a.forEach((f) => {
939
- f.style.flex = a.length > 1 ? "1 1 0%" : "1 1 100%";
940
- }), o();
937
+ const l = o.querySelectorAll("nine-table-sheet.active");
938
+ l == null || l.forEach((f) => {
939
+ f.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
940
+ }), n();
941
941
  }, "#switchSheet"));
942
942
  }
943
943
  connectedCallback() {
944
- t(this, Pt).call(this);
944
+ t(this, Kt).call(this);
945
945
  }
946
946
  };
947
- Pt = new WeakMap(), xt = new WeakMap(), h(ue, "NineTableSheets");
948
- let ne = ue;
949
- customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", ne);
950
- var L, Dt, vt, Yt;
951
- const ge = class ge {
952
- constructor(n) {
953
- d(this, L);
954
- d(this, Dt, /* @__PURE__ */ h(() => {
955
- t(this, Yt).call(this), new ResizeObserver((n) => {
956
- for (let e of n)
957
- t(this, L).getAttribute("auto-height") === "true" && t(this, vt).call(this);
958
- }).observe(t(this, L));
947
+ Kt = new WeakMap(), qt = new WeakMap(), c($e, "NineTableSheets");
948
+ let de = $e;
949
+ customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", de);
950
+ var M, Zt, kt, Gt;
951
+ const Me = class Me {
952
+ constructor(i) {
953
+ d(this, M);
954
+ d(this, Zt, /* @__PURE__ */ c(() => {
955
+ t(this, Gt).call(this), new ResizeObserver((i) => {
956
+ for (let e of i)
957
+ t(this, M).getAttribute("auto-height") === "true" && t(this, kt).call(this);
958
+ }).observe(t(this, M));
959
959
  }, "#init"));
960
- d(this, vt, /* @__PURE__ */ h(() => {
961
- var c, a;
962
- const n = Array.from(t(this, L).shadowRoot.querySelectorAll("nine-table-sheet.active"));
963
- if (n.length === 0) return;
964
- const e = parseInt(t(this, L).getAttribute("max-display-row"), 10) || 10, i = Math.max(...n.map((f) => f.getRowHeight())), o = (c = t(this, L).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, r = (a = t(this, L).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : a.getBoundingClientRect().height, s = Rt.SCROLLBAR_SIZE, l = e * i + o + r + s;
965
- t(this, L).style.height = `${l}px`;
960
+ d(this, kt, /* @__PURE__ */ c(() => {
961
+ var h, l;
962
+ const i = Array.from(t(this, M).shadowRoot.querySelectorAll("nine-table-sheet.active"));
963
+ if (i.length === 0) return;
964
+ const e = parseInt(t(this, M).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), n = (h = t(this, M).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : h.getBoundingClientRect().height, r = (l = t(this, M).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = Ht.SCROLLBAR_SIZE, a = e * s + n + r + o;
965
+ t(this, M).style.height = `${a}px`;
966
966
  }, "#applyAutoHeight"));
967
- d(this, Yt, /* @__PURE__ */ h(() => {
968
- const e = Array.from(t(this, L).children).filter((c) => c.tagName === "TABLE"), i = t(this, L).getAttribute("auto-height") === "true", o = e.length, r = e.map((c, a) => {
969
- const g = `<nine-table-sheet class="${a === 0 ? "active" : ""}" data-index="${a}"></nine-table-sheet>`, b = a < o - 1 ? `<nine-splitter class="h" data-split-index="${a}"></nine-splitter>` : "";
970
- return g + b;
971
- }).join(""), s = e.map((c, a) => `<div class="nine-tab-item ${a === 0 ? "active" : ""}" data-index="${a}">Sheet ${a + 1}</div>`).join("");
972
- t(this, L).shadowRoot.innerHTML = `
967
+ d(this, Gt, /* @__PURE__ */ c(() => {
968
+ const e = Array.from(t(this, M).children).filter((h) => h.tagName === "TABLE"), s = t(this, M).getAttribute("auto-height") === "true", n = e.length, r = e.map((h, l) => {
969
+ 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>` : "";
970
+ return u + b;
971
+ }).join(""), o = e.map((h, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
972
+ t(this, M).shadowRoot.innerHTML = `
973
973
  <style>
974
974
  :host {
975
975
  display: flex;
976
976
  flex-direction: column;
977
977
  position: relative;
978
978
  overflow: hidden;
979
- height: ${i ? "auto" : "100%"};
979
+ height: ${s ? "auto" : "100%"};
980
980
  background: #fff;
981
981
  }
982
982
 
@@ -1052,7 +1052,7 @@ const ge = class ge {
1052
1052
  <nine-table-sheets>
1053
1053
  <nine-table-sheets-body>${r}</nine-table-sheets-body>
1054
1054
  <nine-table-sheets-footer>
1055
- <div class="nine-tab-bar">${s}</div>
1055
+ <div class="nine-tab-bar">${o}</div>
1056
1056
  <div class="sheets-counter">Total : <span id="row-count">0</span></div>
1057
1057
  </nine-table-sheets-footer>
1058
1058
  </nine-table-sheets>
@@ -1060,312 +1060,524 @@ const ge = class ge {
1060
1060
  </nine-table-body>
1061
1061
  <nine-table-footer></nine-table-footer>
1062
1062
  `;
1063
- const l = t(this, L).shadowRoot.querySelectorAll("nine-table-sheet");
1064
- l == null || l.forEach((c, a) => {
1065
- e[a] && setTimeout(() => {
1066
- c.generate(e[a]), i && t(this, vt).call(this);
1063
+ const a = t(this, M).shadowRoot.querySelectorAll("nine-table-sheet");
1064
+ a == null || a.forEach((h, l) => {
1065
+ e[l] && setTimeout(() => {
1066
+ h.generate(e[l]), s && t(this, kt).call(this);
1067
1067
  });
1068
1068
  });
1069
1069
  }, "#render"));
1070
- y(this, L, n), t(this, Dt).call(this);
1070
+ y(this, M, i), t(this, Zt).call(this);
1071
1071
  }
1072
1072
  };
1073
- L = new WeakMap(), Dt = new WeakMap(), vt = new WeakMap(), Yt = new WeakMap(), h(ge, "LayoutManager");
1074
- let ie = ge;
1075
- var wt, st;
1076
- const be = class be {
1077
- constructor(n) {
1078
- d(this, wt);
1079
- d(this, st, -1);
1080
- E(this, "count", /* @__PURE__ */ h(() => t(this, wt).rawRecords.length, "count"));
1081
- y(this, wt, n);
1073
+ M = new WeakMap(), Zt = new WeakMap(), kt = new WeakMap(), Gt = new WeakMap(), c(Me, "LayoutManager");
1074
+ let fe = Me;
1075
+ var Ct, ht;
1076
+ const Ie = class Ie {
1077
+ constructor(i) {
1078
+ d(this, Ct);
1079
+ d(this, ht, -1);
1080
+ S(this, "count", /* @__PURE__ */ c(() => t(this, Ct).rawRecords.length, "count"));
1081
+ y(this, Ct, i);
1082
1082
  }
1083
1083
  get at() {
1084
- return t(this, st);
1084
+ return t(this, ht);
1085
1085
  }
1086
- set at(n) {
1087
- y(this, st, parseInt(n, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, st)}"]`) && setTimeout(() => {
1086
+ set at(i) {
1087
+ y(this, ht, parseInt(i, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, ht)}"]`) && setTimeout(() => {
1088
1088
  });
1089
1089
  }
1090
1090
  };
1091
- wt = new WeakMap(), st = new WeakMap(), h(be, "ngRow");
1092
- let oe = be;
1093
- var C, q, H, rt, Ft, Y, Vt, J, St, Xt, Ut, lt;
1094
- const M = class M {
1095
- constructor(n, e) {
1091
+ Ct = new WeakMap(), ht = new WeakMap(), c(Ie, "ngRow");
1092
+ let ue = Ie;
1093
+ var I, C, _, dt, Jt, V, Qt, et, Tt, te, ee, ft;
1094
+ const N = class N {
1095
+ constructor(i, e) {
1096
+ d(this, I);
1096
1097
  d(this, C);
1097
- d(this, q);
1098
- d(this, H, []);
1099
- d(this, rt, []);
1100
- d(this, Ft, 0);
1101
- d(this, Y, []);
1102
- d(this, Vt, /* @__PURE__ */ h(() => {
1103
- y(this, Y, []);
1104
- const n = t(this, C).template || [];
1105
- Array.from(n).forEach((e) => {
1106
- var i;
1107
- t(this, Y).push(((i = e.getBoundingClientRect) == null ? void 0 : i.call(e).height) || 24);
1108
- }), (t(this, q).rawRecords || []).forEach((e) => {
1109
- e.__ng || (e.__ng = t(this, St).call(this)), e.__ng.height = t(this, Y).slice();
1098
+ d(this, _, []);
1099
+ d(this, dt, []);
1100
+ d(this, Jt, 0);
1101
+ d(this, V, []);
1102
+ d(this, Qt, /* @__PURE__ */ c(() => {
1103
+ y(this, V, []);
1104
+ const i = t(this, I).template || [];
1105
+ Array.from(i).forEach((e) => {
1106
+ var s;
1107
+ t(this, V).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
1108
+ }), (t(this, C).rawRecords || []).forEach((e) => {
1109
+ e.__ng || (e.__ng = t(this, Tt).call(this)), e.__ng.height = t(this, V).slice();
1110
1110
  });
1111
1111
  }, "#initialize"));
1112
- d(this, J, /* @__PURE__ */ h(() => {
1113
- t(this, C).shadowRoot.querySelectorAll("nine-table-sheet").forEach((n) => {
1114
- n.invalidate();
1112
+ d(this, et, /* @__PURE__ */ c(() => {
1113
+ t(this, I).shadowRoot.querySelectorAll("nine-table-sheet").forEach((i) => {
1114
+ i.invalidate();
1115
1115
  });
1116
1116
  }, "#invalidate"));
1117
- E(this, "get", /* @__PURE__ */ h((n, e) => {
1117
+ S(this, "get", /* @__PURE__ */ c((i, e) => {
1118
1118
  var r;
1119
- const i = this.getValidData();
1120
- if (!i || i.length <= 0) return;
1121
- if (n == null) return t(this, lt).call(this, i);
1122
- if (n < 0 || n >= i.length) return null;
1123
- const o = typeof ((r = t(this, C).fields) == null ? void 0 : r.get) == "function" ? t(this, C).fields.get() : [];
1119
+ const s = this.getValidData();
1120
+ if (!s || s.length <= 0) return;
1121
+ if (i == null) return t(this, ft).call(this, s);
1122
+ if (i < 0 || i >= s.length) return null;
1123
+ const n = typeof ((r = t(this, I).fields) == null ? void 0 : r.get) == "function" ? t(this, I).fields.get() : [];
1124
1124
  if (e != null) {
1125
- const s = o.indexOf(e);
1126
- return s >= 0 ? i[n].v[s] : null;
1125
+ const o = n.indexOf(e);
1126
+ return o >= 0 ? s[i].v[o] : null;
1127
1127
  }
1128
- return t(this, lt).call(this, i[n]);
1128
+ return t(this, ft).call(this, s[i]);
1129
1129
  }, "get"));
1130
- E(this, "set", /* @__PURE__ */ h((n) => {
1131
- this.clear(), this.add(n, !1), t(this, J).call(this);
1130
+ S(this, "set", /* @__PURE__ */ c((i) => {
1131
+ this.clear(), this.add(i, !1), t(this, et).call(this);
1132
1132
  }, "set"));
1133
- d(this, St, /* @__PURE__ */ h(() => ({
1134
- rowState: M.ROW_STATE.EMPTY,
1133
+ d(this, Tt, /* @__PURE__ */ c(() => ({
1134
+ rowState: N.ROW_STATE.EMPTY,
1135
1135
  deleted: !1,
1136
1136
  filtered: !1,
1137
- height: t(this, Y).slice(),
1137
+ height: t(this, V).slice(),
1138
1138
  o: {},
1139
1139
  c: {},
1140
- _: [0, 0, 0, 0, M.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Y).slice(), -1, {}, {}]
1140
+ _: [0, 0, 0, 0, N.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, V).slice(), -1, {}, {}]
1141
1141
  }), "#getDefaultMeta"));
1142
- E(this, "reset", /* @__PURE__ */ h(() => {
1143
- y(this, H, []), y(this, rt, []), t(this, J).call(this);
1142
+ S(this, "reset", /* @__PURE__ */ c(() => {
1143
+ y(this, _, []), y(this, dt, []), t(this, et).call(this);
1144
1144
  }, "reset"));
1145
- E(this, "clear", /* @__PURE__ */ h(() => {
1146
- var n;
1147
- t(this, q).rawRecords = [], y(this, H, []), y(this, rt, []), (n = t(this, q).viewRecords) != null && n.reset && t(this, q).viewRecords.reset();
1145
+ S(this, "clear", /* @__PURE__ */ c(() => {
1146
+ var i;
1147
+ t(this, C).rawRecords = [], y(this, _, []), y(this, dt, []), (i = t(this, C).viewRecords) != null && i.reset && t(this, C).viewRecords.reset();
1148
1148
  }, "clear"));
1149
- d(this, Xt, /* @__PURE__ */ h((n) => {
1150
- var o;
1151
- Array.isArray(n) || (n = [n]);
1152
- const e = typeof ((o = t(this, C).fields) == null ? void 0 : o.get) == "function" ? t(this, C).fields.get() : Object.keys(n[0] || {}), i = [];
1153
- return n.forEach((r) => {
1154
- const s = { v: [] };
1155
- e.forEach((l) => {
1156
- s.v.push(r[l] !== void 0 && r[l] !== null ? r[l] : "");
1157
- }), i.push(s);
1158
- }), i;
1149
+ d(this, te, /* @__PURE__ */ c((i) => {
1150
+ var n;
1151
+ Array.isArray(i) || (i = [i]);
1152
+ const e = typeof ((n = t(this, I).fields) == null ? void 0 : n.get) == "function" ? t(this, I).fields.get() : Object.keys(i[0] || {}), s = [];
1153
+ return i.forEach((r) => {
1154
+ const o = { v: [] };
1155
+ e.forEach((a) => {
1156
+ o.v.push(r[a] !== void 0 && r[a] !== null ? r[a] : "");
1157
+ }), s.push(o);
1158
+ }), s;
1159
1159
  }, "#json2Array"));
1160
- d(this, Ut, /* @__PURE__ */ h((n) => (Array.isArray(n) || (n = [n]), n.forEach((e) => {
1161
- e.__ng = t(this, St).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = M.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
1162
- }), n), "#defaultInsert"));
1163
- E(this, "add", /* @__PURE__ */ h((n, e = !0) => {
1164
- n === void 0 && (n = {});
1165
- const i = t(this, Xt).call(this, n);
1166
- t(this, q).rawRecords = t(this, q).rawRecords.concat(t(this, Ut).call(this, i)), this.resetRecords();
1167
- const o = this.count() - 1;
1168
- return e || i.forEach((r, s) => {
1169
- const l = t(this, q).rawRecords[o - s];
1170
- l && (l.__ng.rowState = M.ROW_STATE.EMPTY);
1171
- }), t(this, J).call(this), o;
1160
+ d(this, ee, /* @__PURE__ */ c((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
1161
+ e.__ng = t(this, Tt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = N.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
1162
+ }), i), "#defaultInsert"));
1163
+ S(this, "add", /* @__PURE__ */ c((i, e = !0) => {
1164
+ i === void 0 && (i = {});
1165
+ const s = t(this, te).call(this, i);
1166
+ t(this, C).rawRecords = t(this, C).rawRecords.concat(t(this, ee).call(this, s)), this.resetRecords();
1167
+ const n = this.count() - 1;
1168
+ return e || s.forEach((r, o) => {
1169
+ const a = t(this, C).rawRecords[n - o];
1170
+ a && (a.__ng.rowState = N.ROW_STATE.EMPTY);
1171
+ }), t(this, et).call(this), n;
1172
1172
  }, "add"));
1173
- E(this, "delete", /* @__PURE__ */ h((n) => {
1173
+ S(this, "delete", /* @__PURE__ */ c((i) => {
1174
1174
  let e = [];
1175
- Array.isArray(n) ? e = n : typeof n > "u" ? e = [t(this, q).host.row.at] : e = [parseInt(n, 10)], e.sort((i, o) => o - i).forEach((i) => {
1176
- if (t(this, H)[i]) {
1177
- const o = t(this, H)[i].__ng.rowid;
1178
- t(this, H)[i].__ng.rowState === M.ROW_STATE.INSERT ? t(this, q).rawRecords = t(this, q).rawRecords.filter((r) => r.__ng.rowid !== o) : t(this, q).rawRecords.forEach((r) => {
1179
- r.__ng.rowid === o && (r.__ng.deleted = !0, r.__ng.rowState = M.ROW_STATE.DELETE);
1175
+ Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this, C).host.row.at] : e = [parseInt(i, 10)], e.sort((s, n) => n - s).forEach((s) => {
1176
+ if (t(this, _)[s]) {
1177
+ const n = t(this, _)[s].__ng.rowid;
1178
+ t(this, _)[s].__ng.rowState === N.ROW_STATE.INSERT ? t(this, C).rawRecords = t(this, C).rawRecords.filter((r) => r.__ng.rowid !== n) : t(this, C).rawRecords.forEach((r) => {
1179
+ r.__ng.rowid === n && (r.__ng.deleted = !0, r.__ng.rowState = N.ROW_STATE.DELETE);
1180
1180
  });
1181
1181
  }
1182
- }), this.resetRecords(), t(this, J).call(this);
1182
+ }), this.resetRecords(), t(this, et).call(this);
1183
1183
  }, "delete"));
1184
- E(this, "setValue", /* @__PURE__ */ h((n, e, i) => {
1185
- var c;
1186
- n = parseInt(n, 10);
1187
- const r = (typeof ((c = t(this, C).fields) == null ? void 0 : c.get) == "function" ? t(this, C).fields.get() : []).indexOf(e);
1184
+ S(this, "setValue", /* @__PURE__ */ c((i, e, s) => {
1185
+ var h;
1186
+ i = parseInt(i, 10);
1187
+ const r = (typeof ((h = t(this, I).fields) == null ? void 0 : h.get) == "function" ? t(this, I).fields.get() : []).indexOf(e);
1188
1188
  if (r < 0) return;
1189
- const s = this.getValidData()[n];
1190
- if (!s) return;
1191
- const l = s.v[r];
1192
- l !== i && s.__ng.rowState !== M.ROW_STATE.INSERT && (s.__ng.o.hasOwnProperty(e) || (s.__ng.o[e] = l), s.__ng.rowState = M.ROW_STATE.UPDATE), s.v[r] = i;
1189
+ const o = this.getValidData()[i];
1190
+ if (!o) return;
1191
+ const a = o.v[r];
1192
+ a !== s && o.__ng.rowState !== N.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = a), o.__ng.rowState = N.ROW_STATE.UPDATE), o.v[r] = s;
1193
1193
  }, "setValue"));
1194
- E(this, "resetRecords", /* @__PURE__ */ h(() => {
1195
- y(this, rt, t(this, q).rawRecords.filter((n) => !n.__ng.deleted)), y(this, H, t(this, q).rawRecords.filter((n) => !n.__ng.deleted && !n.__ng.filtered)), t(this, q).rawRecords.forEach((n, e) => {
1196
- n.__ng.rowidx = e;
1197
- }), t(this, H).forEach((n, e) => {
1198
- n.__ng.i = e;
1194
+ S(this, "resetRecords", /* @__PURE__ */ c(() => {
1195
+ y(this, dt, t(this, C).rawRecords.filter((i) => !i.__ng.deleted)), y(this, _, t(this, C).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, C).rawRecords.forEach((i, e) => {
1196
+ i.__ng.rowidx = e;
1197
+ }), t(this, _).forEach((i, e) => {
1198
+ i.__ng.i = e;
1199
1199
  });
1200
1200
  }, "resetRecords"));
1201
- E(this, "getValidData", /* @__PURE__ */ h(() => (t(this, H).length === 0 && t(this, q).rawRecords.length > 0 && this.resetRecords(), t(this, H)), "getValidData"));
1202
- d(this, lt, /* @__PURE__ */ h((n) => {
1203
- var s;
1204
- if (!n) return n;
1205
- const e = !Array.isArray(n), i = e ? [n] : n, o = typeof ((s = t(this, C).fields) == null ? void 0 : s.get) == "function" ? t(this, C).fields.get() : [], r = i.filter((l) => !l.__ng.deleted).map((l) => {
1206
- const c = {};
1207
- return o.forEach((a, f) => {
1208
- c[a] = l.v ? l.v[f] : l[a];
1209
- }), c.__ng = l.__ng, c;
1201
+ S(this, "getValidData", /* @__PURE__ */ c(() => (t(this, _).length === 0 && t(this, C).rawRecords.length > 0 && this.resetRecords(), t(this, _)), "getValidData"));
1202
+ d(this, ft, /* @__PURE__ */ c((i) => {
1203
+ var o;
1204
+ if (!i) return i;
1205
+ const e = !Array.isArray(i), s = e ? [i] : i, n = typeof ((o = t(this, I).fields) == null ? void 0 : o.get) == "function" ? t(this, I).fields.get() : [], r = s.filter((a) => !a.__ng.deleted).map((a) => {
1206
+ const h = {};
1207
+ return n.forEach((l, f) => {
1208
+ h[l] = a.v ? a.v[f] : a[l];
1209
+ }), h.__ng = a.__ng, h;
1210
1210
  });
1211
1211
  return e ? r[0] : r;
1212
1212
  }, "#conv"));
1213
- E(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
1214
- y(this, C, n), y(this, q, e), t(this, Vt).call(this);
1213
+ S(this, "count", /* @__PURE__ */ c(() => this.getValidData().length, "count"));
1214
+ y(this, I, i), y(this, C, e), t(this, Qt).call(this);
1215
1215
  }
1216
1216
  get source() {
1217
- return t(this, lt).call(this, t(this, q).rawRecords);
1217
+ return t(this, ft).call(this, t(this, C).rawRecords);
1218
1218
  }
1219
- set source(n) {
1220
- this.clear(), this.add(n, !1);
1219
+ set source(i) {
1220
+ this.clear(), this.add(i, !1);
1221
1221
  }
1222
1222
  get nextId() {
1223
- return ++Se(this, Ft)._;
1223
+ return ++Fe(this, Jt)._;
1224
1224
  }
1225
1225
  get length() {
1226
- return t(this, H).length;
1226
+ return t(this, _).length;
1227
1227
  }
1228
1228
  getRowCount() {
1229
1229
  return this.length;
1230
1230
  }
1231
1231
  };
1232
- C = new WeakMap(), q = new WeakMap(), H = new WeakMap(), rt = new WeakMap(), Ft = new WeakMap(), Y = new WeakMap(), Vt = new WeakMap(), J = new WeakMap(), St = new WeakMap(), Xt = new WeakMap(), Ut = new WeakMap(), lt = new WeakMap(), h(M, "ngData"), // 🎯 행 상태 정의 상수를 클래스 내부로 내재화
1233
- E(M, "ROW_STATE", {
1232
+ I = new WeakMap(), C = new WeakMap(), _ = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), V = new WeakMap(), Qt = new WeakMap(), et = new WeakMap(), Tt = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), ft = new WeakMap(), c(N, "ngData"), // 🎯 행 상태 정의 상수를 클래스 내부로 내재화
1233
+ S(N, "ROW_STATE", {
1234
1234
  EMPTY: "EMPTY",
1235
1235
  NORMAL: "NORMAL",
1236
1236
  INSERT: "INSERT",
1237
1237
  UPDATE: "UPDATE",
1238
1238
  DELETE: "DELETE"
1239
1239
  });
1240
- let se = M;
1241
- var Q;
1242
- const ye = class ye {
1243
- constructor(n) {
1244
- d(this, Q);
1245
- y(this, Q, n), this.row = new oe(this), this.data = new se(t(this, Q), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
1240
+ let ge = N;
1241
+ var st;
1242
+ const _e = class _e {
1243
+ constructor(i) {
1244
+ d(this, st);
1245
+ y(this, st, i), this.row = new ue(this), this.data = new ge(t(this, st), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
1246
1246
  var e;
1247
- (e = t(this, Q).view) != null && e.redraw && t(this, Q).view.redraw();
1247
+ (e = t(this, st).view) != null && e.redraw && t(this, st).view.redraw();
1248
1248
  }, this.setDataSource = (e) => {
1249
1249
  this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
1250
1250
  }, this.getRowState = (e) => {
1251
- var o, r;
1252
- const i = parseInt(e, 10);
1253
- if (!(i >= this.data.count()))
1254
- return (r = (o = this.data.getValidData()[i]) == null ? void 0 : o.__ng) == null ? void 0 : r.rowState;
1251
+ var n, r;
1252
+ const s = parseInt(e, 10);
1253
+ if (!(s >= this.data.count()))
1254
+ return (r = (n = this.data.getValidData()[s]) == null ? void 0 : n.__ng) == null ? void 0 : r.rowState;
1255
1255
  }, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
1256
1256
  this.row.at = e;
1257
- }, 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, i) => this.data.get(e, i), this.setColumn = (e, i, o) => {
1258
- e = parseInt(e, 10), this.data.setValue(e, i, o);
1257
+ }, 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) => {
1258
+ e = parseInt(e, 10), this.data.setValue(e, s, n);
1259
1259
  }, this.setDataSource([]);
1260
1260
  }
1261
1261
  };
1262
- Q = new WeakMap(), h(ye, "ngDataManager");
1263
- let re = ye;
1264
- var at, T, Et, jt;
1265
- const pe = class pe {
1262
+ st = new WeakMap(), c(_e, "ngDataManager");
1263
+ let be = _e;
1264
+ var ut, L, Lt, se;
1265
+ const Ne = class Ne {
1266
1266
  // 🎯 이제 { name: string, type: string } 객체들의 배열로 관리합니다.
1267
- constructor(n) {
1268
- d(this, at);
1269
- d(this, T, []);
1270
- E(this, "add", /* @__PURE__ */ h((n, e = "string") => {
1271
- n.forEach((i) => {
1272
- t(this, T).some((o) => o.name === i) || t(this, T).push({ name: i, type: e });
1273
- }), t(this, Et).call(this);
1267
+ constructor(i) {
1268
+ d(this, ut);
1269
+ d(this, L, []);
1270
+ S(this, "add", /* @__PURE__ */ c((i, e = "string") => {
1271
+ i.forEach((s) => {
1272
+ t(this, L).some((n) => n.name === s) || t(this, L).push({ name: s, type: e });
1273
+ }), t(this, Lt).call(this);
1274
1274
  }, "add"));
1275
- d(this, Et, /* @__PURE__ */ h(() => {
1276
- const n = /* @__PURE__ */ new Map();
1277
- t(this, T).forEach((e) => {
1278
- n.set(e.name, e.type);
1279
- }), y(this, T, Array.from(n, ([e, i]) => ({ name: e, type: i }))), y(this, T, t(this, T).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, T).sort((e, i) => e.name.length < i.name.length ? 1 : -1);
1275
+ d(this, Lt, /* @__PURE__ */ c(() => {
1276
+ const i = /* @__PURE__ */ new Map();
1277
+ t(this, L).forEach((e) => {
1278
+ i.set(e.name, e.type);
1279
+ }), y(this, L, Array.from(i, ([e, s]) => ({ name: e, type: s }))), y(this, L, t(this, L).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, L).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
1280
1280
  }, "#adjust"));
1281
- d(this, jt, /* @__PURE__ */ h(() => {
1282
- y(this, T, []), dt.log(t(this, at).querySelectorAll("table"));
1283
- const n = Array.from(t(this, at).querySelectorAll("table"));
1284
- if (!(!n || n.length === 0)) {
1285
- for (const e of n)
1286
- dt.log(e), $("[data-bind]", e).each((i, o) => {
1287
- const r = o.dataset.bind, s = o.getAttribute("data-type") || "string";
1288
- r && t(this, T).push({ name: r, type: s });
1289
- }), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((i) => {
1290
- $(`[${i}]`, e).each((o, r) => {
1291
- var s = r.getAttribute(i);
1292
- if (s.indexOf("data.") < 0) {
1293
- const l = s.search(/[(]/g);
1294
- if (l > 0)
1281
+ d(this, se, /* @__PURE__ */ c(() => {
1282
+ y(this, L, []), rt.log(t(this, ut).querySelectorAll("table"));
1283
+ const i = Array.from(t(this, ut).querySelectorAll("table"));
1284
+ if (!(!i || i.length === 0)) {
1285
+ for (const e of i)
1286
+ rt.log(e), $("[data-bind]", e).each((s, n) => {
1287
+ const r = n.dataset.bind, o = n.getAttribute("data-type") || "string";
1288
+ r && t(this, L).push({ name: r, type: o });
1289
+ }), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
1290
+ $(`[${s}]`, e).each((n, r) => {
1291
+ var o = r.getAttribute(s);
1292
+ if (o.indexOf("data.") < 0) {
1293
+ const a = o.search(/[(]/g);
1294
+ if (a > 0)
1295
1295
  try {
1296
- s = String(window[s.substring(0, l).trim()]);
1296
+ o = String(window[o.substring(0, a).trim()]);
1297
1297
  } catch {
1298
- s = "";
1298
+ o = "";
1299
1299
  }
1300
1300
  }
1301
- s.split("data.").forEach((l) => {
1302
- if (l.trim() != "") {
1303
- const c = l.search(/[^_A-Za-z0-9]/g);
1304
- let a = "";
1305
- c >= 0 ? a = l.substring(0, c) : s.startsWith("data.") && (a = l.replace("data.", "")), a && t(this, T).push({ name: a, type: "string" });
1301
+ o.split("data.").forEach((a) => {
1302
+ if (a.trim() != "") {
1303
+ const h = a.search(/[^_A-Za-z0-9]/g);
1304
+ let l = "";
1305
+ h >= 0 ? l = a.substring(0, h) : o.startsWith("data.") && (l = a.replace("data.", "")), l && t(this, L).push({ name: l, type: "string" });
1306
1306
  }
1307
1307
  });
1308
1308
  });
1309
1309
  });
1310
- t(this, Et).call(this);
1310
+ t(this, Lt).call(this);
1311
1311
  }
1312
1312
  }, "#init"));
1313
- y(this, at, n), t(this, jt).call(this);
1313
+ y(this, ut, i), t(this, se).call(this);
1314
1314
  }
1315
1315
  // 🎯 기존에 필드 이름만 쓰던 곳들과의 호환을 위해 이름 배열만 리턴하는 메서드 유지
1316
1316
  get() {
1317
- return t(this, T).map((n) => n.name);
1317
+ return t(this, L).map((i) => i.name);
1318
1318
  }
1319
1319
  // 🎯 내부 객체 통째로 얻기
1320
1320
  getFields() {
1321
- return t(this, T);
1321
+ return t(this, L);
1322
1322
  }
1323
1323
  // 🎯 특정 필드의 데이터 타입 조회
1324
- getType(n) {
1325
- const e = t(this, T).find((i) => i.name === n);
1324
+ getType(i) {
1325
+ const e = t(this, L).find((s) => s.name === i);
1326
1326
  return e ? e.type : "string";
1327
1327
  }
1328
- indexOf(n) {
1329
- return t(this, T).findIndex((e) => e.name === n);
1328
+ indexOf(i) {
1329
+ return t(this, L).findIndex((e) => e.name === i);
1330
1330
  }
1331
- includes(n) {
1332
- return t(this, T).some((e) => e.name === n);
1331
+ includes(i) {
1332
+ return t(this, L).some((e) => e.name === i);
1333
1333
  }
1334
1334
  };
1335
- at = new WeakMap(), T = new WeakMap(), Et = new WeakMap(), jt = new WeakMap(), h(pe, "ngFields");
1336
- let le = pe;
1337
- var tt, Kt, Zt;
1338
- const me = class me extends HTMLElement {
1335
+ ut = new WeakMap(), L = new WeakMap(), Lt = new WeakMap(), se = new WeakMap(), c(Ne, "ngFields");
1336
+ let ye = Ne;
1337
+ var it, ie, ne;
1338
+ const We = class We extends HTMLElement {
1339
1339
  constructor() {
1340
1340
  super();
1341
1341
  //#created = false;
1342
- d(this, tt);
1343
- d(this, Kt);
1344
- d(this, Zt, /* @__PURE__ */ h(() => {
1345
- this.fields = new le(this), y(this, Kt, new ie(this)), dt.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
1342
+ d(this, it);
1343
+ d(this, ie);
1344
+ d(this, ne, /* @__PURE__ */ c(() => {
1345
+ this.fields = new ye(this), y(this, ie, new fe(this)), rt.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
1346
1346
  }, "#init"));
1347
- this.attachShadow({ mode: "open" }), y(this, tt, new re(this));
1347
+ this.attachShadow({ mode: "open" }), y(this, it, new be(this));
1348
1348
  }
1349
1349
  connectedCallback() {
1350
- t(this, Zt).call(this);
1350
+ t(this, ne).call(this);
1351
1351
  }
1352
1352
  disconnectedCallback() {
1353
- dt.log("NineTable disconnected.");
1353
+ rt.log("NineTable disconnected.");
1354
1354
  }
1355
1355
  // 🎯 외부에서 grid.data.set(...) 형태로 접근할 수 있도록 데이터 매니저 오픈
1356
1356
  get data() {
1357
- return t(this, tt).data;
1357
+ return t(this, it).data;
1358
1358
  }
1359
1359
  // 🎯 행(row) 관련 제어 접근자 오픈
1360
1360
  get row() {
1361
- return t(this, tt).row;
1361
+ return t(this, it).row;
1362
1362
  }
1363
1363
  // 🎯 전체 데이터 매니저 접근 필요할 경우
1364
1364
  get dataManager() {
1365
- return t(this, tt);
1365
+ return t(this, it);
1366
+ }
1367
+ };
1368
+ it = new WeakMap(), ie = new WeakMap(), ne = new WeakMap(), c(We, "NineTable");
1369
+ let pe = We;
1370
+ customElements.get("nine-table") || customElements.define("nine-table", pe);
1371
+ const mt = class mt extends HTMLElement {
1372
+ // 👈 커스텀 스타일용 캐시 추가
1373
+ constructor() {
1374
+ super();
1375
+ }
1376
+ applyBaseStyle() {
1377
+ const i = this.constructor.name;
1378
+ if (!ngElement._styleCache.has(i)) {
1379
+ const s = new CSSStyleSheet();
1380
+ ngElement._styleCache.set(i, s);
1381
+ const n = `https://cdn.jsdelivr.net/npm/@ninebone/grid@0.0.447/dist/css/${i}.css`;
1382
+ fetch(n).then((r) => r.text()).then((r) => s.replaceSync(r)).catch((r) => console.error("Base CSS Load Error:", r));
1383
+ }
1384
+ const e = [ngElement._styleCache.get(i)];
1385
+ if (nine.cssPath) {
1386
+ if (!ngElement._customStyleCache.has(i)) {
1387
+ const s = new CSSStyleSheet();
1388
+ ngElement._customStyleCache.set(i, s);
1389
+ const n = `${nine.cssPath}/ninegrid/${i}.css`;
1390
+ fetch(n).then((r) => r.text()).then((r) => s.replaceSync(r)).catch((r) => console.error("Custom CSS Load Error:", r));
1391
+ }
1392
+ e.push(ngElement._customStyleCache.get(i));
1393
+ }
1394
+ this.shadowRoot.adoptedStyleSheets = e;
1395
+ }
1396
+ connectedCallback() {
1397
+ }
1398
+ };
1399
+ c(mt, "BasicCellElement"), S(mt, "_styleCache", /* @__PURE__ */ new Map()), S(mt, "_customStyleCache", /* @__PURE__ */ new Map());
1400
+ let me = mt;
1401
+ var k, p, we, Se, Ee, Ae, Re;
1402
+ const Oe = class Oe extends me {
1403
+ constructor() {
1404
+ super();
1405
+ d(this, k);
1406
+ d(this, p);
1407
+ d(this, we);
1408
+ d(this, Se);
1409
+ d(this, Ee);
1410
+ d(this, Ae);
1411
+ S(this, "getDisplayText", /* @__PURE__ */ c((e) => {
1412
+ if (t(this, p))
1413
+ if (t(this, p).closest("tbody")) {
1414
+ const s = t(this, p).closest("tr").data, n = parseInt(t(this, p).dataset.row);
1415
+ if (!s) return "";
1416
+ if (ninegrid.isNull(t(this, p).dataset.expr)) {
1417
+ if (!ninegrid.isNull(t(this, p).dataset.bind))
1418
+ return s[t(this, p).dataset.bind] || ninegrid.nvl(e, "");
1419
+ } else try {
1420
+ return this.getExprValue(t(this, p).dataset.expr, s, n, t(this, p));
1421
+ } catch {
1422
+ console.error(t(this, p).dataset.expr, s, t(this, p).dataset.row);
1423
+ }
1424
+ return ninegrid.nvl(e, "");
1425
+ } else
1426
+ try {
1427
+ return t(this, k).exprFunction(t(this, p).dataset.expr).call(this, null, -1, t(this, k).data);
1428
+ } catch {
1429
+ }
1430
+ }, "getDisplayText"));
1431
+ S(this, "reset", /* @__PURE__ */ c(() => {
1432
+ parseInt(t(this, p).dataset.row);
1433
+ var e = t(this, p).closest("tr"), s = e.data;
1434
+ rt.log(s);
1435
+ }, "reset"));
1436
+ d(this, Re, /* @__PURE__ */ c(() => {
1437
+ if (!(!t(this, k) || !t(this, k).template || !t(this, p).closest("tbody.bindable"))) {
1438
+ var e = ninegrid.j.querySelectorAll(t(this, p)).attr("suppress");
1439
+ if (e && (e = parseInt(e)), e && !isNaN(e)) {
1440
+ var s = t(this, p).closest("tr"), n = [];
1441
+ $("th,td", s).each((x, W) => {
1442
+ var T = ninegrid.j.querySelectorAll(W).attr("suppress");
1443
+ T && W.dataset.row && (T = parseInt(T), !isNaN(T) && T <= e && n.push(T));
1444
+ }), n.sort();
1445
+ var r = !1;
1446
+ if (parseInt(s.sectionRowIndex / t(this, k).template.length) > 0)
1447
+ for (var o of n) {
1448
+ if (o > e) break;
1449
+ var a = parseInt(t(this, p).dataset.row), h = a - 1, l = t(this, p).closest("tr").data, f = t(this, k).data.get(h);
1450
+ t(this, p).dataset.matrixRow;
1451
+ var u = t(this, k).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, p).dataset.matrixRow}"]`), b = u.dataset.expr ? this.getExprValue(u.dataset.expr, l, a) : l[u.dataset.bind], g = u.dataset.expr ? this.getExprValue(u.dataset.expr, f, h) : f[u.dataset.bind];
1452
+ if (b != g) {
1453
+ r = !0;
1454
+ break;
1455
+ }
1456
+ }
1457
+ else
1458
+ r = !0;
1459
+ r ? ninegrid.j.querySelectorAll(t(this, p)).removeClass("suppress") : ninegrid.j.querySelectorAll(t(this, p)).addClass("suppress"), ninegrid.j.querySelectorAll(t(this, p)).hasClass("hidden") || (r ? ninegrid.j.querySelectorAll(t(this, p)).removeClass("hidden") : ninegrid.j.querySelectorAll(t(this, p)).addClass("hidden"));
1460
+ var m = parseInt(t(this, p).dataset.matrixRow), v = m - 1, E = t(this, k).body.querySelector(`tbody.bindable [data-col="${t(this, p).dataset.col}"][data-matrix-row="${v}"]`);
1461
+ $(E).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this, p)).hasClass("suppress") ? ninegrid.j.querySelectorAll(E).removeClass("last-none-suppress").addClass("last-suppress") : !$(E).hasClass("suppress") && ninegrid.j.querySelectorAll(t(this, p)).hasClass("suppress") ? ninegrid.j.querySelectorAll(E).removeClass("last-suppress").addClass("last-none-suppress") : ninegrid.j.querySelectorAll(E).removeClass("last-none-suppress").removeClass("last-suppress");
1462
+ }
1463
+ }
1464
+ }, "#resetSuppress"));
1465
+ S(this, "getExprValue", /* @__PURE__ */ c((e, s, n, r) => {
1466
+ if (typeof e < "u")
1467
+ try {
1468
+ n = parseInt(n);
1469
+ const o = e.replace("()", "");
1470
+ return t(this, k)[o] ? t(this, k)[o].call(this, s, n, t(this, p)) : t(this, k).exprFunction(e).call(this, s, n, t(this, k).data);
1471
+ } catch {
1472
+ return ["NG-COMBO"].includes(this.tagName) ? "" : e;
1473
+ }
1474
+ else
1475
+ return e;
1476
+ }, "getExprValue"));
1477
+ }
1478
+ connectedCallback() {
1479
+ super.connectedCallback();
1480
+ let e = this.getRootNode().host;
1481
+ e && e.tagName != "NINE-GRID" && (e = e.getRootNode().host), y(this, k, this.getRootNode().host), y(this, p, this.closest("th,td")), rt.log(t(this, k), t(this, p));
1482
+ }
1483
+ get value() {
1484
+ var e = !t(this, k) || !t(this, k).dataManager || !t(this, p) || !t(this, p).dataset || !t(this, p).dataset.row || !t(this, p).dataset.bind ? "" : t(this, p).closest("tr").data[t(this, p).dataset.bind];
1485
+ return e ?? "";
1486
+ }
1487
+ set value(e) {
1488
+ var s = parseInt(t(this, p).dataset.row);
1489
+ const n = this.getAttribute("update-row-state") != "false";
1490
+ s < 0 ? t(this, k).data.setValueNF(parseInt(t(this, p).dataset.index), t(this, p).dataset.bind, e, n) : t(this, k).data.setValue(s, t(this, p).dataset.bind, e, n);
1491
+ }
1492
+ get row() {
1493
+ return parseInt(t(this, p).dataset.row);
1494
+ }
1495
+ get data() {
1496
+ return t(this, p).closest("tr").data;
1497
+ }
1498
+ };
1499
+ k = new WeakMap(), p = new WeakMap(), we = new WeakMap(), Se = new WeakMap(), Ee = new WeakMap(), Ae = new WeakMap(), Re = new WeakMap(), c(Oe, "CellElement");
1500
+ let xe = Oe;
1501
+ const Be = class Be extends xe {
1502
+ constructor() {
1503
+ super();
1504
+ }
1505
+ connectedCallback() {
1506
+ super.connectedCallback();
1507
+ }
1508
+ };
1509
+ c(Be, "EditableCellElement");
1510
+ let ve = Be;
1511
+ var qe, nt, gt, bt, re, Y, ke;
1512
+ const Pe = class Pe extends ve {
1513
+ constructor() {
1514
+ super();
1515
+ d(this, qe);
1516
+ d(this, nt);
1517
+ d(this, gt);
1518
+ d(this, bt);
1519
+ d(this, re);
1520
+ d(this, Y);
1521
+ /**
1522
+ dataRefresh = (v) => {
1523
+ this.#target.value = this.value;
1524
+
1525
+
1526
+ ninegrid.j.querySelectorAll(this.#target).removeClass("invalid");
1527
+
1528
+ if (this.#type == "number") {
1529
+
1530
+ if (isNaN(this.value) ||
1531
+ this.#max && Number(this.#target.value) > Number(this.#max) ||
1532
+ this.#min && Number(this.#target.value) < Number(this.#min)
1533
+ ) {
1534
+ ninegrid.j.querySelectorAll(this.#target).addClass("invalid");
1535
+ }
1536
+ else if (this.#scale) {
1537
+ if (this.#target.value.indexOf('.') >= 0 && this.#target.value.substring(this.#target.value.indexOf('.')+1).length > Number(this.#scale) ) {
1538
+ ninegrid.j.querySelectorAll(this.#target).addClass("invalid");
1539
+ }
1540
+ }
1541
+ }
1542
+
1543
+
1544
+ if (this.#maxbyte && ninegrid.getByteLength(this.value) > Number(this.#maxbyte)) {
1545
+ ninegrid.j.querySelectorAll(this.#target).addClass("invalid");
1546
+ }
1547
+
1548
+ if (!v) this.reset();
1549
+ };
1550
+ */
1551
+ d(this, ke, /* @__PURE__ */ c((e) => {
1552
+ if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
1553
+ if (t(this, nt) == "number") {
1554
+ let r = [];
1555
+ if (t(this, Y) && Number(t(this, Y)) > 0 && r.push("."), t(this, bt) && Number(t(this, bt)) >= 0 && r.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !r.includes(e.key) && e.preventDefault(), t(this, Y) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
1556
+ var s = e.target.value, n = s.indexOf(".");
1557
+ if (n >= 0) {
1558
+ var s = s.substr(n + 1, s.length);
1559
+ s.length >= Number(t(this, Y)) && e.preventDefault();
1560
+ }
1561
+ }
1562
+ }
1563
+ t(this, gt) && ninegrid.getByteLength(e.target.value) >= Number(t(this, gt)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
1564
+ }
1565
+ }, "#onKeyDown"));
1566
+ if (this.applyBaseStyle(), y(this, nt, this.getAttribute("type") || "text"), y(this, gt, this.getAttribute("maxbyte")), y(this, bt, this.getAttribute("min")), y(this, re, this.getAttribute("max")), y(this, Y, this.getAttribute("scale")), !["text", "number"].includes(t(this, nt))) throw `invalid type : ${t(this, nt)}`;
1567
+ }
1568
+ connectedCallback() {
1569
+ for (var e = [], s = 0; s < this.attributes.length; s++)
1570
+ ["type", "maxlength", "maxbyte", "min", "max", "step", "scale", "text-align"].includes(this.attributes[s].name) && e.push(`${this.attributes[s].name}="${this.attributes[s].value}"`);
1571
+ this.shadowRoot.innerHTML = `
1572
+ <input type="text"
1573
+ ${e.join(" ")}
1574
+ ondragstart="return false;"
1575
+ >
1576
+ `, super.connectedCallback();
1366
1577
  }
1367
1578
  };
1368
- tt = new WeakMap(), Kt = new WeakMap(), Zt = new WeakMap(), h(me, "NineTable");
1369
- let ae = me;
1370
- customElements.get("nine-table") || customElements.define("nine-table", ae);
1579
+ qe = new WeakMap(), nt = new WeakMap(), gt = new WeakMap(), bt = new WeakMap(), re = new WeakMap(), Y = new WeakMap(), ke = new WeakMap(), c(Pe, "CellInputText");
1580
+ let $t = Pe;
1581
+ customElements.get("cell-input-text") || customElements.define("cell-input-text", $t);
1582
+ customElements.get("cell-input") || customElements.define("cell-input", $t);
1371
1583
  //# sourceMappingURL=nine-table.js.map