@ninebone/table 0.0.111 β†’ 0.0.113

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