@ninebone/table 0.0.125 β†’ 0.0.126

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