@ninebone/table 0.0.128 β†’ 0.0.130

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,100 +1,100 @@
1
- var Le = Object.defineProperty;
2
- var _e = (w) => {
1
+ var _e = Object.defineProperty;
2
+ var Me = (w) => {
3
3
  throw TypeError(w);
4
4
  };
5
- var $e = (w, s, t) => s in w ? Le(w, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : w[s] = t;
6
- var a = (w, s) => Le(w, "name", { value: s, configurable: !0 });
7
- var v = (w, s, t) => $e(w, typeof s != "symbol" ? s + "" : s, t), Ie = (w, s, t) => s.has(w) || _e("Cannot " + t);
8
- var e = (w, s, t) => (Ie(w, s, "read from private field"), t ? t.call(w) : s.get(w)), h = (w, s, t) => s.has(w) ? _e("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(w) : s.set(w, t), p = (w, s, t, i) => (Ie(w, s, "write to private field"), i ? i.call(w, t) : s.set(w, t), t);
9
- var Me = (w, s, t, i) => ({
5
+ var $e = (w, i, t) => i in w ? _e(w, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : w[i] = t;
6
+ var c = (w, i) => _e(w, "name", { value: i, configurable: !0 });
7
+ var v = (w, i, t) => $e(w, typeof i != "symbol" ? i + "" : i, t), Ie = (w, i, t) => i.has(w) || Me("Cannot " + t);
8
+ var e = (w, i, t) => (Ie(w, i, "read from private field"), t ? t.call(w) : i.get(w)), u = (w, i, t) => i.has(w) ? Me("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(w) : i.set(w, t), p = (w, i, t, s) => (Ie(w, i, "write to private field"), s ? s.call(w, t) : i.set(w, t), t);
9
+ var He = (w, i, t, s) => ({
10
10
  set _(n) {
11
- p(w, s, n, t);
11
+ p(w, i, n, t);
12
12
  },
13
13
  get _() {
14
- return e(w, s, i);
14
+ return e(w, i, s);
15
15
  }
16
16
  });
17
- import { trace as He } from "@ninebone/util";
18
- const Re = class Re extends He.constructor {
17
+ import { trace as We } from "@ninebone/util";
18
+ const Re = class Re extends We.constructor {
19
19
  constructor() {
20
20
  super(), this.init("nine-table", "green");
21
21
  }
22
22
  };
23
- a(Re, "Trace");
24
- let fe = Re;
25
- const V = new fe();
26
- var I, O, y, B, N, D, Q, P, ee;
27
- const Se = class Se extends HTMLElement {
23
+ c(Re, "Trace");
24
+ let ue = Re;
25
+ const j = new ue();
26
+ var M, B, y, D, N, P, ee, X, te;
27
+ const Ee = class Ee extends HTMLElement {
28
28
  constructor() {
29
29
  super();
30
- h(this, I);
31
- h(this, O, !1);
32
- h(this, y);
33
- h(this, B);
34
- h(this, N);
35
- h(this, D);
36
- h(this, Q, /* @__PURE__ */ a(() => {
37
- if (!e(this, I)) return;
38
- const t = e(this, I).querySelector(".ng-container-body");
39
- t && (p(this, D, new ResizeObserver(() => {
30
+ u(this, M);
31
+ u(this, B, !1);
32
+ u(this, y);
33
+ u(this, D);
34
+ u(this, N);
35
+ u(this, P);
36
+ u(this, ee, /* @__PURE__ */ c(() => {
37
+ if (!e(this, M)) return;
38
+ const t = e(this, M).querySelector(".ng-container-body");
39
+ t && (p(this, P, new ResizeObserver(() => {
40
40
  this.refresh();
41
- })), e(this, D).observe(t));
41
+ })), e(this, P).observe(t));
42
42
  }, "#observeResize"));
43
- v(this, "refresh", /* @__PURE__ */ a(() => {
44
- if (!e(this, I) || !e(this, y) || e(this, O)) return;
45
- const t = e(this, y).container, i = t.querySelector("table");
46
- if (!i) return;
47
- const n = e(this, y).track, o = e(this, y).thumb, r = e(this, I).querySelector(".ng-container-bottom"), l = t.clientWidth, f = i.scrollWidth;
43
+ v(this, "refresh", /* @__PURE__ */ c(() => {
44
+ if (!e(this, M) || !e(this, y) || e(this, B)) return;
45
+ const t = e(this, y).container, s = t.querySelector("table");
46
+ if (!s) return;
47
+ const n = e(this, y).track, o = e(this, y).thumb, r = e(this, M).querySelector(".ng-container-bottom"), l = t.clientWidth, f = s.scrollWidth;
48
48
  if (l !== 0 && f > l)
49
49
  r && (r.style.display = "flex");
50
50
  else {
51
51
  r && (r.style.display = "none");
52
52
  return;
53
53
  }
54
- const c = n.clientWidth;
55
- if (c <= 0) return;
56
- const g = Math.max(Math.min(c * (l / f), c), 20);
57
- o.style.width = `${g}px`;
58
- let d = 0;
59
- const u = i.style.transform;
60
- if (u && u.includes("translateX")) {
61
- const R = u.match(/translateX\(([-\d.]+)px\)/);
62
- R && R[1] && (d = parseFloat(R[1]));
54
+ const a = n.clientWidth;
55
+ if (a <= 0) return;
56
+ const b = Math.max(Math.min(a * (l / f), a), 20);
57
+ o.style.width = `${b}px`;
58
+ let h = 0;
59
+ const g = s.style.transform;
60
+ if (g && g.includes("translateX")) {
61
+ const x = g.match(/translateX\(([-\d.]+)px\)/);
62
+ x && x[1] && (h = parseFloat(x[1]));
63
63
  } else
64
- d = parseInt(i.style.left || 0, 10);
65
- let b = parseInt(Math.abs(d) * c / f, 10);
66
- b < 0 && (b = 0);
67
- const x = c - g;
68
- b > x && (b = x), o.style.left = `${b}px`, e(this, y).left.disabled = b === 0, e(this, y).right.disabled = b >= x - 1;
64
+ h = parseInt(s.style.left || 0, 10);
65
+ let d = parseInt(Math.abs(h) * a / f, 10);
66
+ d < 0 && (d = 0);
67
+ const S = a - b;
68
+ d > S && (d = S), o.style.left = `${d}px`, e(this, y).left.disabled = d === 0, e(this, y).right.disabled = d >= S - 1;
69
69
  }, "refresh"));
70
- h(this, P, /* @__PURE__ */ a((t) => {
70
+ u(this, X, /* @__PURE__ */ c((t) => {
71
71
  if (!e(this, y)) return !1;
72
- const i = e(this, y).container, n = i.querySelector("table");
72
+ const s = e(this, y).container, n = s.querySelector("table");
73
73
  if (!n) return !1;
74
74
  const o = e(this, y).track.getBoundingClientRect(), r = e(this, y).thumb.clientWidth;
75
75
  let l = t;
76
76
  l < 0 && (l = 0);
77
77
  const f = o.width - r;
78
78
  l > f && (l = f), l = parseInt(l, 10), e(this, y).thumb.style.left = `${l}px`, e(this, y).left.disabled = l === 0, e(this, y).right.disabled = l >= f - 1;
79
- const c = i.clientWidth, g = n.scrollWidth;
80
- let d = f > 0 ? -l * (g - c) / f : 0;
81
- return -d > g - c && (d = -(g - c)), -d + 5 > g - c && (d = -(g - c)), c >= g && (d = 0), n.style.transform = `translateX(${d}px)`, l > 0 && l < f - 1;
79
+ const a = s.clientWidth, b = n.scrollWidth;
80
+ let h = f > 0 ? -l * (b - a) / f : 0;
81
+ return -h > b - a && (h = -(b - a)), -h + 5 > b - a && (h = -(b - a)), a >= b && (h = 0), n.style.transform = `translateX(${h}px)`, l > 0 && l < f - 1;
82
82
  }, "#thumbMoveTo"));
83
- h(this, ee, /* @__PURE__ */ a(() => {
84
- const t = /* @__PURE__ */ a((n) => {
85
- clearInterval(e(this, B)), clearInterval(e(this, N));
83
+ u(this, te, /* @__PURE__ */ c(() => {
84
+ const t = /* @__PURE__ */ c((n) => {
85
+ clearInterval(e(this, D)), clearInterval(e(this, N));
86
86
  const o = parseInt(e(this, y).thumb.style.left || 0, 10);
87
- e(this, P).call(this, o + n), p(this, B, setInterval(() => {
88
- clearInterval(e(this, B)), p(this, N, setInterval(() => {
87
+ e(this, X).call(this, o + n), p(this, D, setInterval(() => {
88
+ clearInterval(e(this, D)), p(this, N, setInterval(() => {
89
89
  const r = parseInt(e(this, y).thumb.style.left || 0, 10);
90
- e(this, P).call(this, r + n) || clearInterval(e(this, N));
90
+ e(this, X).call(this, r + n) || clearInterval(e(this, N));
91
91
  }, 50));
92
92
  }, 500));
93
- }, "delayScroll"), i = /* @__PURE__ */ a(() => {
94
- clearInterval(e(this, B)), clearInterval(e(this, N));
93
+ }, "delayScroll"), s = /* @__PURE__ */ c(() => {
94
+ clearInterval(e(this, D)), clearInterval(e(this, N));
95
95
  }, "clearTimer");
96
96
  ["mouseup", "mouseleave", "touchend"].forEach((n) => {
97
- e(this, y).left.addEventListener(n, i), e(this, y).right.addEventListener(n, i), e(this, y).track.addEventListener(n, i);
97
+ e(this, y).left.addEventListener(n, s), e(this, y).right.addEventListener(n, s), e(this, y).track.addEventListener(n, s);
98
98
  }), e(this, y).left.addEventListener("mousedown", (n) => {
99
99
  n.button === 0 && t(-20);
100
100
  }), e(this, y).right.addEventListener("mousedown", (n) => {
@@ -103,23 +103,23 @@ const Se = class Se extends HTMLElement {
103
103
  if (n.button !== 0) return;
104
104
  n.preventDefault();
105
105
  const o = e(this, y).track.getBoundingClientRect(), r = e(this, y).thumb.clientWidth;
106
- e(this, P).call(this, n.clientX - o.left - r / 2);
106
+ e(this, X).call(this, n.clientX - o.left - r / 2);
107
107
  }), e(this, y).thumb.addEventListener("mousedown", (n) => {
108
108
  if (n.button !== 0) return;
109
- n.stopPropagation(), n.preventDefault(), p(this, O, !0), this.shiftX = n.clientX - e(this, y).thumb.getBoundingClientRect().left;
110
- const o = /* @__PURE__ */ a((l) => {
111
- if (!e(this, O)) return;
109
+ n.stopPropagation(), n.preventDefault(), p(this, B, !0), this.shiftX = n.clientX - e(this, y).thumb.getBoundingClientRect().left;
110
+ const o = /* @__PURE__ */ c((l) => {
111
+ if (!e(this, B)) return;
112
112
  const f = e(this, y).track.getBoundingClientRect();
113
- e(this, P).call(this, l.clientX - f.left - this.shiftX);
114
- }, "onMouseMove"), r = /* @__PURE__ */ a(() => {
115
- p(this, O, !1), i(), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", r), this.refresh();
113
+ e(this, X).call(this, l.clientX - f.left - this.shiftX);
114
+ }, "onMouseMove"), r = /* @__PURE__ */ c(() => {
115
+ p(this, B, !1), s(), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", r), this.refresh();
116
116
  }, "onMouseUp");
117
117
  document.addEventListener("mousemove", o), document.addEventListener("mouseup", r);
118
118
  });
119
119
  }, "#init"));
120
120
  }
121
121
  connectedCallback() {
122
- if (p(this, I, this.closest("nine-table-sheet") || this.getRootNode().host), !e(this, I)) return;
122
+ if (p(this, M, this.closest("nine-table-sheet") || this.getRootNode().host), !e(this, M)) return;
123
123
  this.innerHTML = `
124
124
  <style>
125
125
  nine-table-hscrollbar {
@@ -183,199 +183,209 @@ const Se = class Se extends HTMLElement {
183
183
  <div class='ng-scroll-track'><div class='ng-scroll-thumb'></div></div>
184
184
  <button class='ng-scroll-right' disabled><div class='ng-scroll-icon'></div></button>
185
185
  `;
186
- const t = /* @__PURE__ */ a(() => {
187
- const i = e(this, I).querySelector(".ng-container-body");
188
- if (!i) {
186
+ const t = /* @__PURE__ */ c(() => {
187
+ const s = e(this, M).querySelector(".ng-container-body");
188
+ if (!s) {
189
189
  setTimeout(t, 10);
190
190
  return;
191
191
  }
192
192
  p(this, y, {
193
- container: i,
193
+ container: s,
194
194
  track: this.querySelector(".ng-scroll-track"),
195
195
  thumb: this.querySelector(".ng-scroll-thumb"),
196
196
  left: this.querySelector(".ng-scroll-left"),
197
197
  right: this.querySelector(".ng-scroll-right")
198
- }), e(this, ee).call(this), e(this, Q).call(this), this.refresh();
198
+ }), e(this, te).call(this), e(this, ee).call(this), this.refresh();
199
199
  }, "initWhenReady");
200
200
  t();
201
201
  }
202
202
  disconnectedCallback() {
203
- e(this, D) && e(this, D).disconnect();
203
+ e(this, P) && e(this, P).disconnect();
204
204
  }
205
205
  };
206
- I = new WeakMap(), O = new WeakMap(), y = new WeakMap(), B = new WeakMap(), N = new WeakMap(), D = new WeakMap(), Q = new WeakMap(), P = new WeakMap(), ee = new WeakMap(), a(Se, "NineTableHScrollBar");
207
- let ue = Se;
208
- customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ue);
209
- var $, M, C, H, Z, te;
210
- const Ee = class Ee {
211
- constructor(s) {
212
- h(this, $);
213
- h(this, M, []);
214
- h(this, C, null);
215
- h(this, H, null);
216
- h(this, Z, 0);
206
+ M = new WeakMap(), B = new WeakMap(), y = new WeakMap(), D = new WeakMap(), N = new WeakMap(), P = new WeakMap(), ee = new WeakMap(), X = new WeakMap(), te = new WeakMap(), c(Ee, "NineTableHScrollBar");
207
+ let be = Ee;
208
+ customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", be);
209
+ var V, I, q, $, H, A, ie;
210
+ const Te = class Te {
211
+ constructor(i) {
212
+ u(this, V);
213
+ u(this, I, []);
214
+ u(this, q, null);
215
+ u(this, $, null);
216
+ u(this, H, 0);
217
+ u(this, A, 0);
217
218
  /**
218
- * 🎯 뷰포트 크기 λ³€ν™” 및 초기 높이λ₯Ό μ •ν™•νžˆ μΆ”μ ν•˜κΈ° μœ„ν•œ ResizeObserver μ„€μ •
219
+ * 🎯 뷰포트 크기 λ³€ν™” μ‹œμ μ— 높이 계산 및 ν•„μš”ν•œ ν–‰ 개수 산정·캐싱을 μ™„κ²°
219
220
  */
220
- h(this, te, /* @__PURE__ */ a(() => {
221
- !e(this, $) || !(e(this, $) instanceof HTMLElement) || (p(this, H, new ResizeObserver((s) => {
222
- for (const t of s) {
223
- const i = t.contentRect.height || (t.borderBoxSize && t.borderBoxSize[0] ? t.borderBoxSize[0].blockSize : 0);
224
- V.log(t, i), i > 0 && p(this, Z, i);
221
+ u(this, ie, /* @__PURE__ */ c(() => {
222
+ !e(this, V) || !(e(this, V) instanceof HTMLElement) || (p(this, $, new ResizeObserver((i) => {
223
+ for (const t of i) {
224
+ const s = t.target;
225
+ if (!s.classList.contains("active"))
226
+ continue;
227
+ const n = t.contentRect.height || (t.borderBoxSize && t.borderBoxSize[0] ? t.borderBoxSize[0].blockSize : 0);
228
+ if (n > 0) {
229
+ const o = s.clientHeight || s.getBoundingClientRect().height || n;
230
+ let r = 0;
231
+ const l = s.querySelector(".ng-container-body") || s, f = l.querySelector("thead"), a = l.querySelector("tfoot");
232
+ f && (r += f.offsetHeight || f.getBoundingClientRect().height), a && (r += a.offsetHeight || a.getBoundingClientRect().height);
233
+ const b = Math.max(o - r, 100);
234
+ if (e(this, H) !== b && (p(this, H, b), e(this, q) !== null)) {
235
+ const h = Math.ceil(e(this, H) / e(this, q));
236
+ p(this, A, h + 20), j.log(`[RowManager] Resized. Height: ${e(this, H)}px | Target Rows: ${e(this, A)}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
237
+ const d = s.querySelector(g);
238
+ d && d.querySelector("tbody") && this.renderRows(d);
239
+ });
240
+ }
241
+ }
225
242
  }
226
- })), e(this, H).observe(e(this, $)));
243
+ })), e(this, $).observe(e(this, V)));
227
244
  }, "#initResizeObserver"));
228
- v(this, "initTemplate", /* @__PURE__ */ a((s) => {
229
- const t = s.querySelector("tbody.bindable") || s.querySelector("tbody");
245
+ v(this, "initTemplate", /* @__PURE__ */ c((i) => {
246
+ const t = i.querySelector("tbody.bindable") || i.querySelector("tbody");
230
247
  if (!t) return;
231
- const i = Array.from(t.querySelectorAll("tr")).filter((n) => !n.classList.contains("nodata"));
232
- p(this, M, i.map((n) => n.cloneNode(!0))), p(this, C, null), console.log(`[RowManager] Template initialized with ${e(this, M).length} row(s).`);
248
+ const s = Array.from(t.querySelectorAll("tr")).filter((n) => !n.classList.contains("nodata"));
249
+ p(this, I, s.map((n) => n.cloneNode(!0))), p(this, q, null), console.log(`[RowManager] Template initialized with ${e(this, I).length} row(s).`);
233
250
  }, "initTemplate"));
234
- v(this, "measureAndCacheHeight", /* @__PURE__ */ a((s) => {
235
- if (e(this, C) !== null)
236
- return e(this, C);
237
- if (e(this, M).length === 0)
251
+ v(this, "measureAndCacheHeight", /* @__PURE__ */ c((i) => {
252
+ if (e(this, q) !== null)
253
+ return e(this, q);
254
+ if (e(this, I).length === 0)
238
255
  throw new Error("[RowManager] Template TRs are empty.");
239
- const t = s.querySelector("tbody.bindable") || s.querySelector("tbody");
256
+ const t = i.querySelector("tbody.bindable") || i.querySelector("tbody");
240
257
  if (!t) return 24;
241
258
  t.querySelectorAll("tr:not(.nodata)").forEach((l) => l.remove());
242
- const i = t.querySelector("tr.nodata"), n = document.createDocumentFragment();
243
- e(this, M).forEach((l) => {
259
+ const s = t.querySelector("tr.nodata"), n = document.createDocumentFragment();
260
+ e(this, I).forEach((l) => {
244
261
  n.appendChild(l.cloneNode(!0));
245
- }), i ? i.before(n) : t.appendChild(n);
262
+ }), s ? s.before(n) : t.appendChild(n);
246
263
  let o = 0;
247
- return t.querySelectorAll("tr:not(.nodata)").forEach((l, f) => {
248
- const c = l.offsetHeight;
249
- if (c === 0)
264
+ if (t.querySelectorAll("tr:not(.nodata)").forEach((l, f) => {
265
+ const a = l.offsetHeight;
266
+ if (a === 0)
250
267
  throw new Error(`[RowManager] Rendered TR[${f}] height is 0. Check CSS styles.`);
251
- o += c, V.log(`[RowManager] Measured TR[${f}] height: ${c}px`);
252
- }), p(this, C, o), console.log(`[RowManager] Template Height Cached Successfully: ${e(this, C)}px`), e(this, C);
268
+ o += a;
269
+ }), p(this, q, o), e(this, H) > 0) {
270
+ const l = Math.ceil(e(this, H) / e(this, q));
271
+ p(this, A, l + 20);
272
+ }
273
+ return console.log(`[RowManager] Template Height Cached: ${e(this, q)}px | RowCount: ${e(this, A)}`), e(this, q);
253
274
  }, "measureAndCacheHeight"));
254
275
  /**
255
- * 🎯 μ΅œμƒλ‹¨ nine-table-sheet의 높이λ₯Ό κΈ°μ€€μœΌλ‘œ ν•„μš”ν•œ ν–‰ 갯수 μ‚°μ • (ResizeObserver μΈ‘μ •μΉ˜ μš°μ„  반영)
276
+ * 🎯 μΊμ‹œλœ ν–‰ 개수 λ°˜ν™˜ (없을 λ•Œλ§Œ μ΅œμ†Œν•œμ˜ λ°©μ–΄ μ—°μ‚°)
277
+ */
278
+ v(this, "calculateRequiredRowCount", /* @__PURE__ */ c((i) => e(this, A) > 0 ? e(this, A) : (this.measureAndCacheHeight(i), e(this, A) || 40), "calculateRequiredRowCount"));
279
+ /**
280
+ * 🎯 μΊμ‹œλœ ν–‰ 개수λ₯Ό κ³§λ°”λ‘œ κ°€μ Έμ™€μ„œ TR λΌˆλŒ€ μ£Όμž… (쀑볡 계산 제거)
256
281
  */
257
- v(this, "calculateRequiredRowCount", /* @__PURE__ */ a((s) => {
258
- const t = e(this, $).closest("nine-table-body") || e(this, $);
259
- let i = e(this, Z);
260
- (!i || i === 0) && (i = t.clientHeight || t.getBoundingClientRect().height), V.log(t, i, t.clientHeight, t.getBoundingClientRect().height), (!i || i === 0) && (i = t.offsetHeight || (t.parentElement ? t.parentElement.clientHeight : 400));
261
- const n = e(this, C) !== null ? e(this, C) : this.measureAndCacheHeight(s), l = Math.ceil(i / n) + 20;
262
- return console.log(`[RowManager] NineTableSheet Height: ${i}px | Template Height: ${n}px | Target Rows: ${l}`), l;
263
- }, "calculateRequiredRowCount"));
264
- v(this, "renderRows", /* @__PURE__ */ a((s, t = null) => {
265
- if (e(this, M).length === 0) return;
266
- const i = s.querySelector("tbody.bindable") || s.querySelector("tbody");
267
- if (!i) return;
268
- i.querySelectorAll("tr:not(.nodata)").forEach((l) => l.remove());
269
- const n = i.querySelector("tr.nodata"), o = document.createDocumentFragment(), r = t !== null ? t : this.calculateRequiredRowCount(s);
270
- console.log(`[RowManager] Rendering ${r} row sets into container...`);
282
+ v(this, "renderRows", /* @__PURE__ */ c((i, t = null) => {
283
+ if (e(this, I).length === 0) return;
284
+ const s = i.querySelector("tbody.bindable") || i.querySelector("tbody");
285
+ if (!s) return;
286
+ s.querySelectorAll("tr:not(.nodata)").forEach((l) => l.remove());
287
+ const n = s.querySelector("tr.nodata"), o = document.createDocumentFragment(), r = e(this, A);
271
288
  for (let l = 0; l < r; l++)
272
- e(this, M).forEach((f) => {
289
+ e(this, I).forEach((f) => {
273
290
  o.appendChild(f.cloneNode(!0));
274
291
  });
275
- n ? n.before(o) : i.appendChild(o), console.log(`[RowManager] Successfully rendered. Total DOM tr count: ${i.querySelectorAll("tr:not(.nodata)").length}`);
292
+ n ? n.before(o) : s.appendChild(o), console.log(`[RowManager] Rendered ${r} sets into DOM.`);
276
293
  }, "renderRows"));
277
- /**
278
- * 🎯 μ»΄ν¬λ„ŒνŠΈ μ†Œλ©Έ μ‹œ Observer ν•΄μ œ
279
- */
280
- v(this, "destroy", /* @__PURE__ */ a(() => {
281
- e(this, H) && (e(this, H).disconnect(), p(this, H, null));
294
+ v(this, "destroy", /* @__PURE__ */ c(() => {
295
+ e(this, $) && (e(this, $).disconnect(), p(this, $, null));
282
296
  }, "destroy"));
283
- p(this, $, s), e(this, te).call(this);
297
+ p(this, V, i), e(this, ie).call(this);
284
298
  }
285
299
  get templateLength() {
286
- return e(this, M).length || 1;
300
+ return e(this, I).length || 1;
287
301
  }
288
302
  };
289
- $ = new WeakMap(), M = new WeakMap(), C = new WeakMap(), H = new WeakMap(), Z = new WeakMap(), te = new WeakMap(), a(Ee, "RowManager");
290
- let be = Ee;
291
- var k, L, se;
292
- const K = class K extends HTMLElement {
303
+ V = new WeakMap(), I = new WeakMap(), q = new WeakMap(), $ = new WeakMap(), H = new WeakMap(), A = new WeakMap(), ie = new WeakMap(), c(Te, "RowManager");
304
+ let ge = Te;
305
+ var L, W, se;
306
+ const Z = class Z extends HTMLElement {
293
307
  constructor() {
294
308
  super();
295
- h(this, k, null);
296
- h(this, L);
297
- v(this, "init", /* @__PURE__ */ a((t) => {
309
+ u(this, L, null);
310
+ u(this, W);
311
+ v(this, "init", /* @__PURE__ */ c((t) => {
298
312
  if (!t) return;
299
- const i = /* @__PURE__ */ a((c) => {
300
- const g = /* @__PURE__ */ a((u) => {
301
- if (u.querySelector("colgroup")) return;
302
- const b = u.querySelector("tbody tr") || u.querySelector("tr"), x = b ? b.querySelectorAll("th, td").length : 1, R = document.createElement("colgroup"), A = Math.max(Math.floor((u.clientWidth || 600) / x), 100);
303
- for (let E = 0; E < x; E++) {
304
- const de = document.createElement("col");
305
- de.setAttribute("width", A), R.appendChild(de);
313
+ const s = /* @__PURE__ */ c((a) => {
314
+ const b = /* @__PURE__ */ c((g) => {
315
+ if (g.querySelector("colgroup")) return;
316
+ const d = g.querySelector("tbody tr") || g.querySelector("tr"), S = d ? d.querySelectorAll("th, td").length : 1, x = document.createElement("colgroup"), k = Math.max(Math.floor((g.clientWidth || 600) / S), 100);
317
+ for (let E = 0; E < S; E++) {
318
+ const fe = document.createElement("col");
319
+ fe.setAttribute("width", k), x.appendChild(fe);
306
320
  }
307
- u.prepend(R);
308
- }, "ensureColgroup"), d = /* @__PURE__ */ a((u) => {
309
- if (u.querySelector("thead")) return;
310
- const b = document.createElement("thead"), x = u.querySelector("colgroup");
311
- x ? x.after(b) : u.prepend(b);
321
+ g.prepend(x);
322
+ }, "ensureColgroup"), h = /* @__PURE__ */ c((g) => {
323
+ if (g.querySelector("thead")) return;
324
+ const d = document.createElement("thead"), S = g.querySelector("colgroup");
325
+ S ? S.after(d) : g.prepend(d);
312
326
  }, "ensureThead");
313
- return g(c), d(c), c.classList.add("nine-table-element"), c;
327
+ return b(a), h(a), a.classList.add("nine-table-element"), a;
314
328
  }, "initializeTable"), n = t.cloneNode(!0);
315
- p(this, k, i(n)), e(this, k).style.display = "table", e(this, L).initTemplate(e(this, k));
316
- const o = this.querySelector(".ng-container-left"), r = this.querySelector(".ng-container-body"), l = this.querySelector(".ng-container-right"), f = /* @__PURE__ */ a((c, g, d = !1) => {
317
- const u = c.cloneNode(!0), b = Array.from(u.querySelectorAll("colgroup col")), x = [];
318
- return b.forEach((R, A) => {
319
- const E = R.getAttribute("fixed");
320
- (d ? !E || E === "" : E === g) || x.push(A);
321
- }), x.reverse().forEach((R) => {
322
- b[R] && b[R].remove(), u.querySelectorAll("tr").forEach((A) => {
323
- const E = A.querySelectorAll("th, td");
324
- E[R] && E[R].remove();
329
+ p(this, L, s(n)), e(this, L).style.display = "table", e(this, W).initTemplate(e(this, L));
330
+ const o = this.querySelector(".ng-container-left"), r = this.querySelector(".ng-container-body"), l = this.querySelector(".ng-container-right"), f = /* @__PURE__ */ c((a, b, h = !1) => {
331
+ const g = a.cloneNode(!0), d = Array.from(g.querySelectorAll("colgroup col")), S = [];
332
+ return d.forEach((x, k) => {
333
+ const E = x.getAttribute("fixed");
334
+ (h ? !E || E === "" : E === b) || S.push(k);
335
+ }), S.reverse().forEach((x) => {
336
+ d[x] && d[x].remove(), g.querySelectorAll("tr").forEach((k) => {
337
+ const E = k.querySelectorAll("th, td");
338
+ E[x] && E[x].remove();
325
339
  });
326
- }), u;
340
+ }), g;
327
341
  }, "filterTableByFixed");
328
342
  if (r) {
329
- const c = f(e(this, k), null, !0);
330
- r.innerHTML = "", r.appendChild(c), e(this, L).measureAndCacheHeight(r), e(this, L).renderRows(r);
343
+ const a = f(e(this, L), null, !0);
344
+ r.innerHTML = "", r.appendChild(a), e(this, W).measureAndCacheHeight(r);
331
345
  }
332
346
  if (o) {
333
- const c = f(e(this, k), "left", !1);
334
- let g = 0;
335
- c.querySelectorAll("col").forEach((b) => {
336
- const x = parseInt(b.getAttribute("width"), 10);
337
- isNaN(x) || (g += x);
338
- }), o.innerHTML = "", o.appendChild(c);
339
- const d = e(this, L).calculateRequiredRowCount(o);
340
- e(this, L).renderRows(o, d);
341
- const u = g > 0 ? g : 0;
342
- o.style.flex = `0 0 ${u}px`, o.style.width = `${u}px`;
347
+ const a = f(e(this, L), "left", !1);
348
+ let b = 0;
349
+ a.querySelectorAll("col").forEach((g) => {
350
+ const d = parseInt(g.getAttribute("width"), 10);
351
+ isNaN(d) || (b += d);
352
+ }), o.innerHTML = "", o.appendChild(a), e(this, W).calculateRequiredRowCount(o);
353
+ const h = b > 0 ? b : 0;
354
+ o.style.flex = `0 0 ${h}px`, o.style.width = `${h}px`;
343
355
  }
344
356
  if (l) {
345
- const c = f(e(this, k), "right", !1);
346
- let g = 0;
347
- c.querySelectorAll("col").forEach((b) => {
348
- const x = parseInt(b.getAttribute("width"), 10);
349
- isNaN(x) || (g += x);
350
- }), l.innerHTML = "", l.appendChild(c);
351
- const d = e(this, L).calculateRequiredRowCount(l);
352
- e(this, L).renderRows(l, d);
353
- const u = g > 0 ? g : 0;
354
- l.style.flex = `0 0 ${u}px`, l.style.width = `${u}px`;
357
+ const a = f(e(this, L), "right", !1);
358
+ let b = 0;
359
+ a.querySelectorAll("col").forEach((g) => {
360
+ const d = parseInt(g.getAttribute("width"), 10);
361
+ isNaN(d) || (b += d);
362
+ }), l.innerHTML = "", l.appendChild(a), e(this, W).calculateRequiredRowCount(l);
363
+ const h = b > 0 ? b : 0;
364
+ l.style.flex = `0 0 ${h}px`, l.style.width = `${h}px`;
355
365
  }
356
366
  if (r) {
357
- const c = this.getRowCount();
358
- r.style.overflowY = c > 10 ? "auto" : "hidden", r.addEventListener("scroll", () => {
359
- const g = this.querySelector("nine-table-hscrollbar");
360
- g && typeof g.refresh == "function" && g.refresh();
367
+ const a = this.getRowCount();
368
+ r.style.overflowY = a > 10 ? "auto" : "hidden", r.addEventListener("scroll", () => {
369
+ const b = this.querySelector("nine-table-hscrollbar");
370
+ b && typeof b.refresh == "function" && b.refresh();
361
371
  });
362
372
  }
363
373
  setTimeout(() => {
364
- const c = this.querySelector("nine-table-hscrollbar");
365
- c && typeof c.refresh == "function" && c.refresh();
366
- }, 0), V.log(`NineTableSheet 3-split initialized with rows: ${this.getRowCount()}`);
374
+ const a = this.querySelector("nine-table-hscrollbar");
375
+ a && typeof a.refresh == "function" && a.refresh();
376
+ }, 0), j.log(`NineTableSheet 3-split initialized with rows: ${this.getRowCount()}`);
367
377
  }, "init"));
368
- v(this, "getRowCount", /* @__PURE__ */ a(() => e(this, k) ? e(this, k).querySelectorAll("tbody tr").length : 0, "getRowCount"));
369
- v(this, "scrollToX", /* @__PURE__ */ a((t) => {
370
- const i = this.querySelector(".ng-container-body");
371
- i && (i.scrollLeft = t);
378
+ v(this, "getRowCount", /* @__PURE__ */ c(() => e(this, L) ? e(this, L).querySelectorAll("tbody tr").length : 0, "getRowCount"));
379
+ v(this, "scrollToX", /* @__PURE__ */ c((t) => {
380
+ const s = this.querySelector(".ng-container-body");
381
+ s && (s.scrollLeft = t);
372
382
  }, "scrollToX"));
373
- v(this, "scrollToY", /* @__PURE__ */ a((t) => {
374
- const i = this.querySelector(".ng-container-body");
375
- i && (i.scrollTop = t);
383
+ v(this, "scrollToY", /* @__PURE__ */ c((t) => {
384
+ const s = this.querySelector(".ng-container-body");
385
+ s && (s.scrollTop = t);
376
386
  }, "scrollToY"));
377
- h(this, se, /* @__PURE__ */ a(() => {
378
- const t = K.SCROLLBAR_SIZE;
387
+ u(this, se, /* @__PURE__ */ c(() => {
388
+ const t = Z.SCROLLBAR_SIZE;
379
389
  this.innerHTML = `
380
390
  <style>
381
391
  nine-table-sheet {
@@ -491,104 +501,104 @@ const K = class K extends HTMLElement {
491
501
  </div>
492
502
  `;
493
503
  }, "#render"));
494
- p(this, L, new be(this));
504
+ p(this, W, new ge(this));
495
505
  }
496
506
  connectedCallback() {
497
507
  e(this, se).call(this);
498
508
  }
499
509
  disconnectedCallback() {
500
- this.innerHTML = "", V.log("NineTableSheet destroyed.");
510
+ this.innerHTML = "", j.log("NineTableSheet destroyed.");
501
511
  }
502
512
  };
503
- k = new WeakMap(), L = new WeakMap(), se = new WeakMap(), a(K, "NineTableSheet"), v(K, "SCROLLBAR_SIZE", 16);
504
- let ge = K;
505
- customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", ge);
506
- var ie;
507
- const Te = class Te extends HTMLElement {
513
+ L = new WeakMap(), W = new WeakMap(), se = new WeakMap(), c(Z, "NineTableSheet"), v(Z, "SCROLLBAR_SIZE", 16);
514
+ let pe = Z;
515
+ customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", pe);
516
+ var ne;
517
+ const qe = class qe extends HTMLElement {
508
518
  constructor() {
509
519
  super();
510
- h(this, ie, /* @__PURE__ */ a(() => {
520
+ u(this, ne, /* @__PURE__ */ c(() => {
511
521
  const t = this.querySelector(".nine-tab-bar");
512
- t && (t.addEventListener("click", (i) => {
513
- const n = i.target.closest(".nine-tab-item");
522
+ t && (t.addEventListener("click", (s) => {
523
+ const n = s.target.closest(".nine-tab-item");
514
524
  if (!n) return;
515
- const o = i.ctrlKey || i.metaKey || i.shiftKey, r = parseInt(n.dataset.index, 10);
525
+ const o = s.ctrlKey || s.metaKey || s.shiftKey, r = parseInt(n.dataset.index, 10);
516
526
  this.switchSheet(r, o);
517
527
  }), this.switchSheet(0, !1));
518
528
  }, "#init"));
519
- v(this, "switchSheet", /* @__PURE__ */ a((t, i = !1) => {
520
- const n = /* @__PURE__ */ a(() => {
521
- const d = this.querySelector("nine-table-sheets-body");
522
- d.querySelectorAll("nine-splitter").forEach((b) => {
523
- const x = parseInt(b.dataset.splitIndex, 10), R = d.querySelector(`nine-table-sheet[data-index="${x - 1}"]`), A = d.querySelector(`nine-table-sheet[data-index="${x}"]`);
524
- R && A && R.classList.contains("active") && A.classList.contains("active") ? b.classList.add("active") : b.classList.remove("active");
529
+ v(this, "switchSheet", /* @__PURE__ */ c((t, s = !1) => {
530
+ const n = /* @__PURE__ */ c(() => {
531
+ const h = this.querySelector("nine-table-sheets-body");
532
+ h.querySelectorAll("nine-splitter").forEach((d) => {
533
+ const S = parseInt(d.dataset.splitIndex, 10), x = h.querySelector(`nine-table-sheet[data-index="${S - 1}"]`), k = h.querySelector(`nine-table-sheet[data-index="${S}"]`);
534
+ x && k && x.classList.contains("active") && k.classList.contains("active") ? d.classList.add("active") : d.classList.remove("active");
525
535
  });
526
536
  }, "updateSplitters"), o = this.querySelector(".nine-tab-bar"), r = this.querySelector("nine-table-sheets-body"), l = o.querySelectorAll(".nine-tab-item"), f = r.querySelectorAll("nine-table-sheet");
527
537
  if (!l[t]) return;
528
- if (!i)
529
- l.forEach((d, u) => {
530
- d.classList.toggle("active", u === t);
531
- const b = r.querySelector(`nine-table-sheet[data-index="${u}"]`);
532
- b && (b.style.flex = "");
533
- }), f.forEach((d, u) => {
534
- d.classList.toggle("active", u === t);
538
+ if (!s)
539
+ l.forEach((h, g) => {
540
+ h.classList.toggle("active", g === t);
541
+ const d = r.querySelector(`nine-table-sheet[data-index="${g}"]`);
542
+ d && (d.style.flex = "");
543
+ }), f.forEach((h, g) => {
544
+ h.classList.toggle("active", g === t);
535
545
  });
536
546
  else {
537
- const d = l[t], u = o.querySelectorAll(".nine-tab-item.active");
538
- if (d.classList.contains("active") && u.length <= 1)
547
+ const h = l[t], g = o.querySelectorAll(".nine-tab-item.active");
548
+ if (h.classList.contains("active") && g.length <= 1)
539
549
  return;
540
- d.classList.toggle("active");
541
- const b = r.querySelector(`nine-table-sheet[data-index="${t}"]`);
542
- b && (b.classList.toggle("active"), b.classList.contains("active") || (b.style.flex = ""));
550
+ h.classList.toggle("active");
551
+ const d = r.querySelector(`nine-table-sheet[data-index="${t}"]`);
552
+ d && (d.classList.toggle("active"), d.classList.contains("active") || (d.style.flex = ""));
543
553
  }
544
- const c = Array.from(r.querySelectorAll("nine-table-sheet.active"));
545
- if (c.length > 1) {
546
- const d = 1 / c.length;
547
- c.forEach((u) => {
548
- (!u.style.flex || u.style.flex === "1 1 100%") && (u.style.flex = `${d} ${d} 0px`);
554
+ const a = Array.from(r.querySelectorAll("nine-table-sheet.active"));
555
+ if (a.length > 1) {
556
+ const h = 1 / a.length;
557
+ a.forEach((g) => {
558
+ (!g.style.flex || g.style.flex === "1 1 100%") && (g.style.flex = `${h} ${h} 0px`);
549
559
  });
550
560
  } else
551
- c.forEach((d) => {
552
- d.style.flex = "1 1 100%";
561
+ a.forEach((h) => {
562
+ h.style.flex = "1 1 100%";
553
563
  });
554
564
  n();
555
- const g = r.querySelector("nine-table-sheet.active");
556
- if (g && typeof g.getRowCount == "function") {
557
- const d = this.querySelector("#row-count");
558
- d && (d.textContent = g.getRowCount().toLocaleString());
565
+ const b = r.querySelector("nine-table-sheet.active");
566
+ if (b && typeof b.getRowCount == "function") {
567
+ const h = this.querySelector("#row-count");
568
+ h && (h.textContent = b.getRowCount().toLocaleString());
559
569
  }
560
570
  }, "switchSheet"));
561
571
  }
562
572
  connectedCallback() {
563
- e(this, ie).call(this);
573
+ e(this, ne).call(this);
564
574
  }
565
575
  };
566
- ie = new WeakMap(), a(Te, "NineTableSheets");
567
- let pe = Te;
568
- customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", pe);
569
- var _, j, ne, G, re;
570
- const qe = class qe {
571
- constructor(s) {
572
- h(this, _);
573
- h(this, j, null);
574
- h(this, ne, /* @__PURE__ */ a(() => {
575
- const s = e(this, _).host;
576
- s && (p(this, j, new ResizeObserver((t) => {
577
- for (let i of t)
578
- s.getAttribute("auto-height") === "true" && e(this, G).call(this, s);
579
- })), e(this, j).observe(s));
576
+ ne = new WeakMap(), c(qe, "NineTableSheets");
577
+ let ye = qe;
578
+ customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", ye);
579
+ var _, G, re, J, oe;
580
+ const Ce = class Ce {
581
+ constructor(i) {
582
+ u(this, _);
583
+ u(this, G, null);
584
+ u(this, re, /* @__PURE__ */ c(() => {
585
+ const i = e(this, _).host;
586
+ i && (p(this, G, new ResizeObserver((t) => {
587
+ for (let s of t)
588
+ i.getAttribute("auto-height") === "true" && e(this, J).call(this, i);
589
+ })), e(this, G).observe(i));
580
590
  }, "#observeResize"));
581
- h(this, G, /* @__PURE__ */ a((s) => {
582
- var A, E;
583
- const t = (A = s.shadowRoot) == null ? void 0 : A.querySelector("nine-table-sheet.active");
591
+ u(this, J, /* @__PURE__ */ c((i) => {
592
+ var k, E;
593
+ const t = (k = i.shadowRoot) == null ? void 0 : k.querySelector("nine-table-sheet.active");
584
594
  if (!t) return;
585
- const i = ((E = t.getRowCount) == null ? void 0 : E.call(t)) || 0, n = parseInt(s.getAttribute("max-display-row"), 10) || 10, o = Math.min(i, n), r = t.querySelector("tbody tr") || t.querySelector("tr"), l = r ? r.getBoundingClientRect().height : 32, f = e(this, _).querySelector("nine-table-header"), c = e(this, _).querySelector("nine-table-sheets-footer"), g = f ? f.getBoundingClientRect().height : 40, d = c ? c.getBoundingClientRect().height : 32, b = g + d + 16, x = o * l + b;
586
- s.style.height = `${x}px`, s.style.maxHeight = `${n * l + b}px`;
587
- const R = e(this, _).querySelector("nine-table-sheets-body");
588
- R && (R.style.overflowY = i > n ? "auto" : "hidden");
595
+ const s = ((E = t.getRowCount) == null ? void 0 : E.call(t)) || 0, n = parseInt(i.getAttribute("max-display-row"), 10) || 10, o = Math.min(s, n), r = t.querySelector("tbody tr") || t.querySelector("tr"), l = r ? r.getBoundingClientRect().height : 32, f = e(this, _).querySelector("nine-table-header"), a = e(this, _).querySelector("nine-table-sheets-footer"), b = f ? f.getBoundingClientRect().height : 40, h = a ? a.getBoundingClientRect().height : 32, d = b + h + 16, S = o * l + d;
596
+ i.style.height = `${S}px`, i.style.maxHeight = `${n * l + d}px`;
597
+ const x = e(this, _).querySelector("nine-table-sheets-body");
598
+ x && (x.style.overflowY = s > n ? "auto" : "hidden");
589
599
  }, "#applyAutoHeight"));
590
- h(this, re, /* @__PURE__ */ a(() => {
591
- const s = e(this, _).host, i = Array.from(s.children).filter((f) => f.tagName === "TABLE"), n = s.getAttribute("auto-height") === "true", o = i.map((f, c) => `<nine-table-sheet class="${c === 0 ? "active" : ""}" data-index="${c}"></nine-table-sheet>`).join(""), r = i.map((f, c) => `<div class="nine-tab-item ${c === 0 ? "active" : ""}" data-index="${c}">Sheet ${c + 1}</div>`).join("");
600
+ u(this, oe, /* @__PURE__ */ c(() => {
601
+ const i = e(this, _).host, s = Array.from(i.children).filter((f) => f.tagName === "TABLE"), n = i.getAttribute("auto-height") === "true", o = s.map((f, a) => `<nine-table-sheet class="${a === 0 ? "active" : ""}" data-index="${a}"></nine-table-sheet>`).join(""), r = s.map((f, a) => `<div class="nine-tab-item ${a === 0 ? "active" : ""}" data-index="${a}">Sheet ${a + 1}</div>`).join("");
592
602
  e(this, _).innerHTML = `
593
603
  <style>
594
604
  :host {
@@ -688,171 +698,171 @@ const qe = class qe {
688
698
  <nine-table-footer></nine-table-footer>
689
699
  `;
690
700
  const l = e(this, _).querySelectorAll("nine-table-sheet");
691
- l == null || l.forEach((f, c) => {
692
- i[c] && setTimeout(() => {
693
- f.init(i[c]), n && e(this, G).call(this, s);
701
+ l == null || l.forEach((f, a) => {
702
+ s[a] && setTimeout(() => {
703
+ f.init(s[a]), n && e(this, J).call(this, i);
694
704
  });
695
705
  });
696
706
  }, "#render"));
697
- p(this, _, s), e(this, re).call(this), e(this, ne).call(this);
707
+ p(this, _, i), e(this, oe).call(this), e(this, re).call(this);
698
708
  }
699
709
  };
700
- _ = new WeakMap(), j = new WeakMap(), ne = new WeakMap(), G = new WeakMap(), re = new WeakMap(), a(qe, "LayoutManager");
701
- let ye = qe;
702
- var W, X;
703
- const Ae = class Ae {
704
- constructor(s) {
705
- h(this, W);
706
- h(this, X, -1);
707
- v(this, "count", /* @__PURE__ */ a(() => e(this, W).rawRecords.length, "count"));
708
- p(this, W, s);
710
+ _ = new WeakMap(), G = new WeakMap(), re = new WeakMap(), J = new WeakMap(), oe = new WeakMap(), c(Ce, "LayoutManager");
711
+ let we = Ce;
712
+ var z, Y;
713
+ const ke = class ke {
714
+ constructor(i) {
715
+ u(this, z);
716
+ u(this, Y, -1);
717
+ v(this, "count", /* @__PURE__ */ c(() => e(this, z).rawRecords.length, "count"));
718
+ p(this, z, i);
709
719
  }
710
720
  get at() {
711
- return e(this, X);
721
+ return e(this, Y);
712
722
  }
713
- set at(s) {
714
- var i, n;
715
- p(this, X, parseInt(s, 10));
716
- const t = ((n = (i = e(this, W).owner).querySelector) == null ? void 0 : n.call(i, ".ng-container-body")) || e(this, W).owner.body;
717
- t && !t.querySelector(`tbody.bindable tr[data-row="${e(this, X)}"]`) && setTimeout(() => {
723
+ set at(i) {
724
+ var s, n;
725
+ p(this, Y, parseInt(i, 10));
726
+ const t = ((n = (s = e(this, z).owner).querySelector) == null ? void 0 : n.call(s, ".ng-container-body")) || e(this, z).owner.body;
727
+ t && !t.querySelector(`tbody.bindable tr[data-row="${e(this, Y)}"]`) && setTimeout(() => {
718
728
  var o, r;
719
- (r = (o = e(this, W).owner).scrollTo_V1) == null || r.call(o, e(this, X));
729
+ (r = (o = e(this, z).owner).scrollTo_V1) == null || r.call(o, e(this, Y));
720
730
  });
721
731
  }
722
732
  };
723
- W = new WeakMap(), X = new WeakMap(), a(Ae, "ngRow");
724
- let we = Ae;
725
- var S, m, q, Y, oe, z, le, J, ae, ce, U;
733
+ z = new WeakMap(), Y = new WeakMap(), c(ke, "ngRow");
734
+ let me = ke;
735
+ var R, m, C, U, le, O, ae, Q, ce, he, K;
726
736
  const T = class T {
727
- constructor(s, t) {
728
- h(this, S);
729
- h(this, m);
730
- h(this, q, []);
731
- h(this, Y, []);
732
- h(this, oe, 0);
733
- h(this, z, []);
734
- h(this, le, /* @__PURE__ */ a(() => {
735
- p(this, z, []);
736
- const s = e(this, S).template || [];
737
- Array.from(s).forEach((t) => {
738
- var i;
739
- e(this, z).push(((i = t.getBoundingClientRect) == null ? void 0 : i.call(t).height) || 24);
737
+ constructor(i, t) {
738
+ u(this, R);
739
+ u(this, m);
740
+ u(this, C, []);
741
+ u(this, U, []);
742
+ u(this, le, 0);
743
+ u(this, O, []);
744
+ u(this, ae, /* @__PURE__ */ c(() => {
745
+ p(this, O, []);
746
+ const i = e(this, R).template || [];
747
+ Array.from(i).forEach((t) => {
748
+ var s;
749
+ e(this, O).push(((s = t.getBoundingClientRect) == null ? void 0 : s.call(t).height) || 24);
740
750
  }), (e(this, m).rawRecords || []).forEach((t) => {
741
- t.__ng || (t.__ng = e(this, J).call(this)), t.__ng.height = e(this, z).slice();
751
+ t.__ng || (t.__ng = e(this, Q).call(this)), t.__ng.height = e(this, O).slice();
742
752
  });
743
753
  }, "#initialize"));
744
- v(this, "set", /* @__PURE__ */ a((s) => {
745
- this.clear(), this.add(s, !1);
754
+ v(this, "set", /* @__PURE__ */ c((i) => {
755
+ this.clear(), this.add(i, !1);
746
756
  }, "set"));
747
- h(this, J, /* @__PURE__ */ a(() => ({
757
+ u(this, Q, /* @__PURE__ */ c(() => ({
748
758
  rowState: T.ROW_STATE.EMPTY,
749
759
  deleted: !1,
750
760
  filtered: !1,
751
- height: e(this, z).slice(),
761
+ height: e(this, O).slice(),
752
762
  o: {},
753
763
  c: {},
754
- _: [0, 0, 0, 0, T.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, z).slice(), -1, {}, {}]
764
+ _: [0, 0, 0, 0, T.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, O).slice(), -1, {}, {}]
755
765
  }), "#getDefaultMeta"));
756
- v(this, "reset", /* @__PURE__ */ a(() => {
757
- p(this, q, []), p(this, Y, []);
766
+ v(this, "reset", /* @__PURE__ */ c(() => {
767
+ p(this, C, []), p(this, U, []);
758
768
  }, "reset"));
759
- v(this, "clear", /* @__PURE__ */ a(() => {
760
- var s;
761
- e(this, m).rawRecords = [], p(this, q, []), p(this, Y, []), (s = e(this, m).viewRecords) != null && s.reset && e(this, m).viewRecords.reset();
769
+ v(this, "clear", /* @__PURE__ */ c(() => {
770
+ var i;
771
+ e(this, m).rawRecords = [], p(this, C, []), p(this, U, []), (i = e(this, m).viewRecords) != null && i.reset && e(this, m).viewRecords.reset();
762
772
  }, "clear"));
763
- h(this, ae, /* @__PURE__ */ a((s) => {
773
+ u(this, ce, /* @__PURE__ */ c((i) => {
764
774
  var n;
765
- Array.isArray(s) || (s = [s]);
766
- const t = typeof ((n = e(this, S).fields) == null ? void 0 : n.get) == "function" ? e(this, S).fields.get() : Object.keys(s[0] || {}), i = [];
767
- return s.forEach((o) => {
775
+ Array.isArray(i) || (i = [i]);
776
+ const t = typeof ((n = e(this, R).fields) == null ? void 0 : n.get) == "function" ? e(this, R).fields.get() : Object.keys(i[0] || {}), s = [];
777
+ return i.forEach((o) => {
768
778
  const r = { v: [] };
769
779
  t.forEach((l) => {
770
780
  r.v.push(o[l] !== void 0 && o[l] !== null ? o[l] : "");
771
- }), i.push(r);
772
- }), i;
781
+ }), s.push(r);
782
+ }), s;
773
783
  }, "#json2Array"));
774
- h(this, ce, /* @__PURE__ */ a((s) => (Array.isArray(s) || (s = [s]), s.forEach((t) => {
775
- t.__ng = e(this, J).call(this), t.__ng.rowid = this.nextId, t.__ng.rowState = T.ROW_STATE.INSERT, t.__ng._[0] = t.__ng.rowid;
776
- }), s), "#defaultInsert"));
777
- v(this, "add", /* @__PURE__ */ a((s, t = !0) => {
784
+ u(this, he, /* @__PURE__ */ c((i) => (Array.isArray(i) || (i = [i]), i.forEach((t) => {
785
+ t.__ng = e(this, Q).call(this), t.__ng.rowid = this.nextId, t.__ng.rowState = T.ROW_STATE.INSERT, t.__ng._[0] = t.__ng.rowid;
786
+ }), i), "#defaultInsert"));
787
+ v(this, "add", /* @__PURE__ */ c((i, t = !0) => {
778
788
  var o;
779
- s === void 0 && (s = {});
780
- const i = e(this, ae).call(this, s);
781
- e(this, m).rawRecords = e(this, m).rawRecords.concat(e(this, ce).call(this, i)), this.resetRecords();
789
+ i === void 0 && (i = {});
790
+ const s = e(this, ce).call(this, i);
791
+ e(this, m).rawRecords = e(this, m).rawRecords.concat(e(this, he).call(this, s)), this.resetRecords();
782
792
  const n = this.count() - 1;
783
- return t || i.forEach((r, l) => {
793
+ return t || s.forEach((r, l) => {
784
794
  const f = e(this, m).rawRecords[n - l];
785
795
  f && (f.__ng.rowState = T.ROW_STATE.EMPTY);
786
796
  }), (o = e(this, m).viewRecords) != null && o.reset && e(this, m).viewRecords.reset(), n;
787
797
  }, "add"));
788
- v(this, "delete", /* @__PURE__ */ a((s) => {
789
- var i;
798
+ v(this, "delete", /* @__PURE__ */ c((i) => {
799
+ var s;
790
800
  let t = [];
791
- Array.isArray(s) ? t = s : typeof s > "u" ? t = [e(this, m).owner.row.at] : t = [parseInt(s, 10)], t.sort((n, o) => o - n).forEach((n) => {
792
- if (e(this, q)[n]) {
793
- const o = e(this, q)[n].__ng.rowid;
794
- e(this, q)[n].__ng.rowState === T.ROW_STATE.INSERT ? e(this, m).rawRecords = e(this, m).rawRecords.filter((r) => r.__ng.rowid !== o) : e(this, m).rawRecords.forEach((r) => {
801
+ Array.isArray(i) ? t = i : typeof i > "u" ? t = [e(this, m).owner.row.at] : t = [parseInt(i, 10)], t.sort((n, o) => o - n).forEach((n) => {
802
+ if (e(this, C)[n]) {
803
+ const o = e(this, C)[n].__ng.rowid;
804
+ e(this, C)[n].__ng.rowState === T.ROW_STATE.INSERT ? e(this, m).rawRecords = e(this, m).rawRecords.filter((r) => r.__ng.rowid !== o) : e(this, m).rawRecords.forEach((r) => {
795
805
  r.__ng.rowid === o && (r.__ng.deleted = !0, r.__ng.rowState = T.ROW_STATE.DELETE);
796
806
  });
797
807
  }
798
- }), this.resetRecords(), (i = e(this, m).viewRecords) != null && i.reset && e(this, m).viewRecords.reset();
808
+ }), this.resetRecords(), (s = e(this, m).viewRecords) != null && s.reset && e(this, m).viewRecords.reset();
799
809
  }, "delete"));
800
- v(this, "setValue", /* @__PURE__ */ a((s, t, i) => {
810
+ v(this, "setValue", /* @__PURE__ */ c((i, t, s) => {
801
811
  var f;
802
- s = parseInt(s, 10);
803
- const o = (typeof ((f = e(this, S).fields) == null ? void 0 : f.get) == "function" ? e(this, S).fields.get() : []).indexOf(t);
812
+ i = parseInt(i, 10);
813
+ const o = (typeof ((f = e(this, R).fields) == null ? void 0 : f.get) == "function" ? e(this, R).fields.get() : []).indexOf(t);
804
814
  if (o < 0) return;
805
- const r = this.getValidData()[s];
815
+ const r = this.getValidData()[i];
806
816
  if (!r) return;
807
817
  const l = r.v[o];
808
- l !== i && r.__ng.rowState !== T.ROW_STATE.INSERT && (r.__ng.o.hasOwnProperty(t) || (r.__ng.o[t] = l), r.__ng.rowState = T.ROW_STATE.UPDATE), r.v[o] = i, e(this, m).owner.refreshData && e(this, m).owner.refreshData(s);
818
+ l !== s && r.__ng.rowState !== T.ROW_STATE.INSERT && (r.__ng.o.hasOwnProperty(t) || (r.__ng.o[t] = l), r.__ng.rowState = T.ROW_STATE.UPDATE), r.v[o] = s, e(this, m).owner.refreshData && e(this, m).owner.refreshData(i);
809
819
  }, "setValue"));
810
- v(this, "resetRecords", /* @__PURE__ */ a(() => {
811
- p(this, Y, e(this, m).rawRecords.filter((s) => !s.__ng.deleted)), p(this, q, e(this, m).rawRecords.filter((s) => !s.__ng.deleted && !s.__ng.filtered)), e(this, m).rawRecords.forEach((s, t) => {
812
- s.__ng.rowidx = t;
813
- }), e(this, q).forEach((s, t) => {
814
- s.__ng.i = t;
820
+ v(this, "resetRecords", /* @__PURE__ */ c(() => {
821
+ p(this, U, e(this, m).rawRecords.filter((i) => !i.__ng.deleted)), p(this, C, e(this, m).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), e(this, m).rawRecords.forEach((i, t) => {
822
+ i.__ng.rowidx = t;
823
+ }), e(this, C).forEach((i, t) => {
824
+ i.__ng.i = t;
815
825
  });
816
826
  }, "resetRecords"));
817
- v(this, "getValidData", /* @__PURE__ */ a(() => (e(this, q).length === 0 && e(this, m).rawRecords.length > 0 && this.resetRecords(), e(this, q)), "getValidData"));
818
- h(this, U, /* @__PURE__ */ a((s) => {
819
- var i;
820
- if (!s) return s;
821
- const t = typeof ((i = e(this, S).fields) == null ? void 0 : i.get) == "function" ? e(this, S).fields.get() : [];
822
- return Array.isArray(s) ? s.filter((n) => !n.__ng.deleted).map((n) => {
827
+ v(this, "getValidData", /* @__PURE__ */ c(() => (e(this, C).length === 0 && e(this, m).rawRecords.length > 0 && this.resetRecords(), e(this, C)), "getValidData"));
828
+ u(this, K, /* @__PURE__ */ c((i) => {
829
+ var s;
830
+ if (!i) return i;
831
+ const t = typeof ((s = e(this, R).fields) == null ? void 0 : s.get) == "function" ? e(this, R).fields.get() : [];
832
+ return Array.isArray(i) ? i.filter((n) => !n.__ng.deleted).map((n) => {
823
833
  const o = {};
824
834
  return t.forEach((r, l) => {
825
835
  o[r] = n.v ? n.v[l] : n[r];
826
836
  }), o.__ng = n.__ng, o;
827
- }) : s;
837
+ }) : i;
828
838
  }, "#conv2"));
829
- v(this, "count", /* @__PURE__ */ a(() => this.getValidData().length, "count"));
830
- v(this, "get", /* @__PURE__ */ a((s, t) => {
839
+ v(this, "count", /* @__PURE__ */ c(() => this.getValidData().length, "count"));
840
+ v(this, "get", /* @__PURE__ */ c((i, t) => {
831
841
  var o;
832
- const i = this.getValidData();
833
- if (!i || i.length <= 0) return;
834
- if (s == null) return e(this, U).call(this, i);
835
- if (s < 0 || s >= i.length) return null;
836
- const n = typeof ((o = e(this, S).fields) == null ? void 0 : o.get) == "function" ? e(this, S).fields.get() : [];
842
+ const s = this.getValidData();
843
+ if (!s || s.length <= 0) return;
844
+ if (i == null) return e(this, K).call(this, s);
845
+ if (i < 0 || i >= s.length) return null;
846
+ const n = typeof ((o = e(this, R).fields) == null ? void 0 : o.get) == "function" ? e(this, R).fields.get() : [];
837
847
  if (t != null) {
838
848
  const r = n.indexOf(t);
839
- return r >= 0 ? i[s].v[r] : null;
849
+ return r >= 0 ? s[i].v[r] : null;
840
850
  }
841
- return e(this, U).call(this, i[s]);
851
+ return e(this, K).call(this, s[i]);
842
852
  }, "get"));
843
- p(this, S, s), p(this, m, t), e(this, le).call(this);
853
+ p(this, R, i), p(this, m, t), e(this, ae).call(this);
844
854
  }
845
855
  get source() {
846
- return e(this, U).call(this, e(this, m).rawRecords);
856
+ return e(this, K).call(this, e(this, m).rawRecords);
847
857
  }
848
- set source(s) {
849
- this.clear(), this.add(s, !1);
858
+ set source(i) {
859
+ this.clear(), this.add(i, !1);
850
860
  }
851
861
  get nextId() {
852
- return ++Me(this, oe)._;
862
+ return ++He(this, le)._;
853
863
  }
854
864
  };
855
- S = new WeakMap(), m = new WeakMap(), q = new WeakMap(), Y = new WeakMap(), oe = new WeakMap(), z = new WeakMap(), le = new WeakMap(), J = new WeakMap(), ae = new WeakMap(), ce = new WeakMap(), U = new WeakMap(), a(T, "ngData"), // 🎯 ν–‰ μƒνƒœ μ •μ˜ μƒμˆ˜λ₯Ό 클래슀 λ‚΄λΆ€λ‘œ λ‚΄μž¬ν™”
865
+ R = new WeakMap(), m = new WeakMap(), C = new WeakMap(), U = new WeakMap(), le = new WeakMap(), O = new WeakMap(), ae = new WeakMap(), Q = new WeakMap(), ce = new WeakMap(), he = new WeakMap(), K = new WeakMap(), c(T, "ngData"), // 🎯 ν–‰ μƒνƒœ μ •μ˜ μƒμˆ˜λ₯Ό 클래슀 λ‚΄λΆ€λ‘œ λ‚΄μž¬ν™”
856
866
  v(T, "ROW_STATE", {
857
867
  EMPTY: "EMPTY",
858
868
  NORMAL: "NORMAL",
@@ -860,42 +870,42 @@ v(T, "ROW_STATE", {
860
870
  UPDATE: "UPDATE",
861
871
  DELETE: "DELETE"
862
872
  });
863
- let me = T;
864
- const Ce = class Ce {
865
- constructor(s) {
866
- this.owner = s, this.row = new we(this), this.data = new me(s, this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
873
+ let ve = T;
874
+ const Ae = class Ae {
875
+ constructor(i) {
876
+ this.owner = i, this.row = new me(this), this.data = new ve(i, this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
867
877
  var t;
868
878
  (t = this.owner.view) != null && t.redraw && this.owner.view.redraw();
869
879
  }, this.setDataSource = (t) => {
870
880
  this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(t || []);
871
881
  }, this.getRowState = (t) => {
872
882
  var n, o;
873
- const i = parseInt(t, 10);
874
- if (!(i >= this.data.count()))
875
- return (o = (n = this.data.getValidData()[i]) == null ? void 0 : n.__ng) == null ? void 0 : o.rowState;
883
+ const s = parseInt(t, 10);
884
+ if (!(s >= this.data.count()))
885
+ return (o = (n = this.data.getValidData()[s]) == null ? void 0 : n.__ng) == null ? void 0 : o.rowState;
876
886
  }, this.getRowPosition = () => this.row.at, this.setRowPosition = (t) => {
877
887
  this.row.at = t;
878
- }, this.scrollTo_V1 = (t) => (t < 0 && (t = 0), t >= this.rawRecords.length && (t = this.rawRecords.length - 1), this.viewRecords.rawIndex = t, this.viewRecords.reset && this.viewRecords.reset(), !(t <= 0 || t >= this.rawRecords.length - 1)), this.getColumn = (t, i) => this.data.get(t, i), this.setColumn = (t, i, n) => {
879
- t = parseInt(t, 10), this.data.setValue(t, i, n);
888
+ }, this.scrollTo_V1 = (t) => (t < 0 && (t = 0), t >= this.rawRecords.length && (t = this.rawRecords.length - 1), this.viewRecords.rawIndex = t, this.viewRecords.reset && this.viewRecords.reset(), !(t <= 0 || t >= this.rawRecords.length - 1)), this.getColumn = (t, s) => this.data.get(t, s), this.setColumn = (t, s, n) => {
889
+ t = parseInt(t, 10), this.data.setValue(t, s, n);
880
890
  }, this.setDataSource([]);
881
891
  }
882
892
  };
883
- a(Ce, "ngDataManager");
884
- let ve = Ce;
885
- var F, he;
886
- const ke = class ke extends HTMLElement {
893
+ c(Ae, "ngDataManager");
894
+ let xe = Ae;
895
+ var F, de;
896
+ const Le = class Le extends HTMLElement {
887
897
  constructor() {
888
898
  super();
889
899
  //#created = false;
890
- h(this, F);
891
- h(this, he);
892
- this.attachShadow({ mode: "open" }), p(this, F, new ve(this));
900
+ u(this, F);
901
+ u(this, de);
902
+ this.attachShadow({ mode: "open" }), p(this, F, new xe(this));
893
903
  }
894
904
  connectedCallback() {
895
- p(this, he, new ye(this.shadowRoot)), V.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
905
+ p(this, de, new we(this.shadowRoot)), j.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
896
906
  }
897
907
  disconnectedCallback() {
898
- V.log("NineTable disconnected.");
908
+ j.log("NineTable disconnected.");
899
909
  }
900
910
  // 🎯 μ™ΈλΆ€μ—μ„œ grid.data.set(...) ν˜•νƒœλ‘œ μ ‘κ·Όν•  수 μžˆλ„λ‘ 데이터 λ§€λ‹ˆμ € μ˜€ν”ˆ
901
911
  get data() {
@@ -910,7 +920,7 @@ const ke = class ke extends HTMLElement {
910
920
  return e(this, F);
911
921
  }
912
922
  };
913
- F = new WeakMap(), he = new WeakMap(), a(ke, "NineTable");
914
- let xe = ke;
915
- customElements.get("nine-table") || customElements.define("nine-table", xe);
923
+ F = new WeakMap(), de = new WeakMap(), c(Le, "NineTable");
924
+ let Se = Le;
925
+ customElements.get("nine-table") || customElements.define("nine-table", Se);
916
926
  //# sourceMappingURL=nine-table.js.map