@ninebone/table 0.0.110 β†’ 0.0.112

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