@ninebone/table 0.0.112 β†’ 0.0.114

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,59 +1,59 @@
1
- var ke = Object.defineProperty;
2
- var Le = (w) => {
1
+ var Le = Object.defineProperty;
2
+ var Ce = (w) => {
3
3
  throw TypeError(w);
4
4
  };
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) => ({
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
- y(w, s, n, e);
11
+ y(w, s, n, t);
12
12
  },
13
13
  get _() {
14
- return t(w, s, i);
14
+ return e(w, s, i);
15
15
  }
16
16
  });
17
17
  import { trace as Ie } from "@ninebone/util";
18
- const ve = class ve extends Ie.constructor {
18
+ const xe = class xe extends Ie.constructor {
19
19
  constructor() {
20
20
  super(), this.init("nine-table", "green");
21
21
  }
22
22
  };
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 {
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
- 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(() => {
30
+ f(this, C);
31
+ f(this, W, !1);
32
+ f(this, p);
33
+ f(this, O);
34
+ f(this, z);
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
- })), t(this, z).observe(e));
41
+ })), e(this, D).observe(t));
42
42
  }, "#observeResize"));
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");
43
+ v(this, "refresh", /* @__PURE__ */ c(() => {
44
+ if (!e(this, C) || !e(this, p) || e(this, W)) return;
45
+ const t = e(this, p).container, i = t.querySelector("table");
46
46
  if (!i) return;
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;
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
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 * (l / d), 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,64 +62,64 @@ const xe = class xe 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 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;
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
- u(this, B, /* @__PURE__ */ a((e) => {
71
- if (!t(this, p)) return !1;
72
- const i = t(this, p).container, n = i.querySelector("table");
70
+ f(this, N, /* @__PURE__ */ c((t) => {
71
+ if (!e(this, p)) return !1;
72
+ const i = e(this, p).container, n = i.querySelector("table");
73
73
  if (!n) return !1;
74
- const o = t(this, p).track.getBoundingClientRect(), r = t(this, p).thumb.clientWidth;
75
- let l = e;
74
+ const o = e(this, p).track.getBoundingClientRect(), r = e(this, p).thumb.clientWidth;
75
+ let l = t;
76
76
  l < 0 && (l = 0);
77
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
- const c = i.clientWidth, g = n.scrollWidth;
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;
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
- 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));
83
+ f(this, G, /* @__PURE__ */ c(() => {
84
+ const t = /* @__PURE__ */ c((n) => {
85
+ clearInterval(e(this, O)), clearInterval(e(this, z));
86
+ const o = parseInt(e(this, p).thumb.style.left || 0, 10);
87
+ e(this, N).call(this, o + n), y(this, O, setInterval(() => {
88
+ clearInterval(e(this, O)), y(this, z, setInterval(() => {
89
+ const r = parseInt(e(this, p).thumb.style.left || 0, 10);
90
+ e(this, N).call(this, r + n) || clearInterval(e(this, z));
91
91
  }, 50));
92
92
  }, 500));
93
- }, "delayScroll"), i = /* @__PURE__ */ a(() => {
94
- clearInterval(t(this, W)), clearInterval(t(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
- 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) => {
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) => {
103
103
  if (n.button !== 0) return;
104
104
  n.preventDefault();
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) => {
105
+ const o = e(this, p).track.getBoundingClientRect(), r = e(this, p).thumb.clientWidth;
106
+ e(this, N).call(this, n.clientX - o.left - r / 2);
107
+ }), e(this, p).thumb.addEventListener("mousedown", (n) => {
108
108
  if (n.button !== 0) return;
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
- 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, A, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, A)) 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,10 +183,10 @@ const xe = class xe 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 e = /* @__PURE__ */ a(() => {
187
- const i = t(this, A).querySelector(".ng-container-body");
186
+ const t = /* @__PURE__ */ c(() => {
187
+ const i = e(this, C).querySelector(".ng-container-body");
188
188
  if (!i) {
189
- setTimeout(e, 10);
189
+ setTimeout(t, 10);
190
190
  return;
191
191
  }
192
192
  y(this, p, {
@@ -195,164 +195,172 @@ const xe = class xe 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
- }), t(this, j).call(this), t(this, Z).call(this), this.refresh();
198
+ }), e(this, G).call(this), e(this, j).call(this), this.refresh();
199
199
  }, "initWhenReady");
200
- e();
200
+ t();
201
201
  }
202
202
  disconnectedCallback() {
203
- t(this, z) && t(this, z).disconnect();
203
+ e(this, D) && e(this, D).disconnect();
204
204
  }
205
205
  };
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;
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
210
  const Ee = class Ee {
211
+ // 🎯 졜초 μΈ‘μ •λœ ν…œν”Œλ¦Ώ 높이 μΊμ‹œ
211
212
  constructor(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).`);
213
+ f(this, J);
214
+ f(this, M, []);
215
+ f(this, _, null);
216
+ v(this, "initTemplate", /* @__PURE__ */ c((s) => {
217
+ const t = s.querySelector("tbody.bindable") || s.querySelector("tbody");
218
+ if (!t) return;
219
+ const i = Array.from(t.querySelectorAll("tr")).filter((n) => !n.classList.contains("nodata"));
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μ„ΈνŠΈμ˜ 총 높이λ₯Ό κ³„μ‚°ν•©λ‹ˆλ‹€. (Private λ©”μ„œλ“œ)
223
+ * 🎯 μ‹€μ œ DOM에 κ·Έλ €μ§„ 첫 번째 행듀을 λ°”νƒ•μœΌλ‘œ ν…œν”Œλ¦Ώ 높이λ₯Ό 졜초 1회만 μΈ‘μ •ν•©λ‹ˆλ‹€.
222
224
  */
223
- u(this, J, /* @__PURE__ */ a(() => {
224
- if (t(this, _).length === 0)
225
- throw new Error("[RowManager] Template TRs are empty. Cannot calculate height.");
226
- let s = 0;
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;
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, _);
240
244
  }, "#getTemplateHeight"));
241
- /**
242
- * 🎯 μ»¨ν…Œμ΄λ„ˆ 높이와 ν…œν”Œλ¦Ώ 높이λ₯Ό λ°”νƒ•μœΌλ‘œ ν•„μš”ν•œ TR μ…‹νŠΈ(ν–‰) 개수λ₯Ό 동적 μ‚°μ •ν•©λ‹ˆλ‹€. (Private λ©”μ„œλ“œ)
243
- */
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;
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;
247
248
  }, "#calculateRequiredRowCount"));
248
- v(this, "renderRows", /* @__PURE__ */ a((s, e = null) => {
249
- if (t(this, _).length === 0) {
249
+ v(this, "renderRows", /* @__PURE__ */ c((s, t = null) => {
250
+ if (e(this, M).length === 0) {
250
251
  console.warn("[RowManager] Cannot render rows because template is empty.");
251
252
  return;
252
253
  }
253
254
  const i = s.querySelector("tbody.bindable") || s.querySelector("tbody");
254
255
  if (!i) return;
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
+ }
255
263
  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);
264
+ const n = i.querySelector("tr.nodata"), o = document.createDocumentFragment(), r = t !== null ? t : e(this, ee).call(this, s);
257
265
  console.log(`[RowManager] Rendering ${r} row sets into container...`);
258
266
  for (let l = 0; l < r; l++)
259
- t(this, _).forEach((d) => {
267
+ e(this, M).forEach((d) => {
260
268
  o.appendChild(d.cloneNode(!0));
261
269
  });
262
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}`);
263
271
  }, "renderRows"));
264
- y(this, G, s);
272
+ y(this, J, s);
265
273
  }
266
274
  get templateLength() {
267
- return t(this, _).length || 1;
275
+ return e(this, M).length || 1;
268
276
  }
269
277
  };
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 {
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 {
274
282
  constructor() {
275
283
  super();
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) => {
284
+ f(this, A, null);
285
+ f(this, $);
286
+ v(this, "init", /* @__PURE__ */ c((t) => {
287
+ if (!t) return;
288
+ const i = /* @__PURE__ */ c((a) => {
289
+ const g = /* @__PURE__ */ c((b) => {
282
290
  if (b.querySelector("colgroup")) return;
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);
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);
287
295
  }
288
296
  b.prepend(x);
289
- }, "ensureColgroup"), h = /* @__PURE__ */ a((b) => {
297
+ }, "ensureColgroup"), h = /* @__PURE__ */ c((b) => {
290
298
  if (b.querySelector("thead")) return;
291
- const f = document.createElement("thead"), E = b.querySelector("colgroup");
292
- E ? E.after(f) : b.prepend(f);
299
+ const u = document.createElement("thead"), S = b.querySelector("colgroup");
300
+ S ? S.after(u) : b.prepend(u);
293
301
  }, "ensureThead");
294
- return g(c), h(c), c.classList.add("nine-table-element"), c;
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) => {
302
+ return g(a), h(a), a.classList.add("nine-table-element"), a;
303
+ }, "initializeTable"), n = t.cloneNode(!0);
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) => {
300
308
  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");
309
+ (h ? !R || R === "" : R === g) || S.push(k);
310
+ }), S.reverse().forEach((x) => {
311
+ u[x] && u[x].remove(), b.querySelectorAll("tr").forEach((k) => {
312
+ const R = k.querySelectorAll("th, td");
305
313
  R[x] && R[x].remove();
306
314
  });
307
315
  }), b;
308
316
  }, "filterTableByFixed");
309
317
  if (r) {
310
- const c = d(t(this, k), null, !0);
311
- r.innerHTML = "", r.appendChild(c), t(this, $).renderRows(r);
318
+ const a = d(e(this, A), null, !0);
319
+ r.innerHTML = "", r.appendChild(a), e(this, $).renderRows(r);
312
320
  }
313
321
  if (o) {
314
- const c = d(t(this, k), "left", !1);
322
+ const a = d(e(this, A), "left", !1);
315
323
  let g = 0;
316
- c.querySelectorAll("col").forEach((b) => {
317
- const f = parseInt(b.getAttribute("width"), 10);
318
- isNaN(f) || (g += f);
319
- }), o.innerHTML = "", o.appendChild(c), t(this, $).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);
320
328
  const h = g > 0 ? g : 0;
321
329
  o.style.flex = `0 0 ${h}px`, o.style.width = `${h}px`;
322
330
  }
323
331
  if (l) {
324
- const c = d(t(this, k), "right", !1);
332
+ const a = d(e(this, A), "right", !1);
325
333
  let g = 0;
326
- c.querySelectorAll("col").forEach((b) => {
327
- const f = parseInt(b.getAttribute("width"), 10);
328
- isNaN(f) || (g += f);
329
- }), l.innerHTML = "", l.appendChild(c), t(this, $).renderRows(l);
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);
330
338
  const h = g > 0 ? g : 0;
331
339
  l.style.flex = `0 0 ${h}px`, l.style.width = `${h}px`;
332
340
  }
333
341
  if (r) {
334
- const c = this.getRowCount();
335
- 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", () => {
336
344
  const g = this.querySelector("nine-table-hscrollbar");
337
345
  g && typeof g.refresh == "function" && g.refresh();
338
346
  });
339
347
  }
340
348
  setTimeout(() => {
341
- const c = this.querySelector("nine-table-hscrollbar");
342
- c && typeof c.refresh == "function" && c.refresh();
343
- }, 0), X.log(`NineTableSheet 3-split initialized with rows: ${this.getRowCount()}`);
349
+ const a = this.querySelector("nine-table-hscrollbar");
350
+ a && typeof a.refresh == "function" && a.refresh();
351
+ }, 0), F.log(`NineTableSheet 3-split initialized with rows: ${this.getRowCount()}`);
344
352
  }, "init"));
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) => {
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) => {
347
355
  const i = this.querySelector(".ng-container-body");
348
- i && (i.scrollLeft = e);
356
+ i && (i.scrollLeft = t);
349
357
  }, "scrollToX"));
350
- v(this, "scrollToY", /* @__PURE__ */ a((e) => {
358
+ v(this, "scrollToY", /* @__PURE__ */ c((t) => {
351
359
  const i = this.querySelector(".ng-container-body");
352
- i && (i.scrollTop = e);
360
+ i && (i.scrollTop = t);
353
361
  }, "scrollToY"));
354
- u(this, ee, /* @__PURE__ */ a(() => {
355
- const e = F.SCROLLBAR_SIZE;
362
+ f(this, te, /* @__PURE__ */ c(() => {
363
+ const t = Y.SCROLLBAR_SIZE;
356
364
  this.innerHTML = `
357
365
  <style>
358
366
  nine-table-sheet {
@@ -371,7 +379,7 @@ const F = class F extends HTMLElement {
371
379
  flex-direction: row;
372
380
  flex: 1 1 auto;
373
381
  width: 100%;
374
- height: calc(100% - ${e}px);
382
+ height: calc(100% - ${t}px);
375
383
  overflow: hidden;
376
384
  position: relative;
377
385
  }
@@ -408,8 +416,8 @@ const F = class F extends HTMLElement {
408
416
  nine-table-sheet .ng-container-bottom {
409
417
  display: flex;
410
418
  flex-direction: row;
411
- height: ${e}px;
412
- min-height: ${e}px;
419
+ height: ${t}px;
420
+ min-height: ${t}px;
413
421
  flex-shrink: 0;
414
422
  background: #f9fafb;
415
423
  border-top: 1px solid #e5e7eb;
@@ -424,8 +432,8 @@ const F = class F extends HTMLElement {
424
432
  } */
425
433
 
426
434
  nine-table-sheet .ng-scroll-edge {
427
- width: ${e}px;
428
- min-width: ${e}px;
435
+ width: ${t}px;
436
+ min-width: ${t}px;
429
437
  height: 100%;
430
438
  flex-shrink: 0;
431
439
  background: #f3f4f6;
@@ -468,64 +476,64 @@ const F = class F extends HTMLElement {
468
476
  </div>
469
477
  `;
470
478
  }, "#render"));
471
- y(this, $, new fe(this));
479
+ y(this, $, new ue(this));
472
480
  }
473
481
  connectedCallback() {
474
- t(this, ee).call(this);
482
+ e(this, te).call(this);
475
483
  }
476
484
  disconnectedCallback() {
477
- this.innerHTML = "", X.log("NineTableSheet destroyed.");
485
+ this.innerHTML = "", F.log("NineTableSheet destroyed.");
478
486
  }
479
487
  };
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 {
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 {
485
493
  constructor() {
486
494
  super();
487
- u(this, te, /* @__PURE__ */ a(() => {
488
- const e = this.querySelector(".nine-tab-bar");
489
- e && (e.addEventListener("click", (i) => {
495
+ f(this, se, /* @__PURE__ */ c(() => {
496
+ const t = this.querySelector(".nine-tab-bar");
497
+ t && (t.addEventListener("click", (i) => {
490
498
  const n = i.target.closest(".nine-tab-item");
491
499
  if (!n) return;
492
500
  const o = i.ctrlKey || i.metaKey || i.shiftKey, r = parseInt(n.dataset.index, 10);
493
501
  this.switchSheet(r, o);
494
502
  }), this.switchSheet(0, !1));
495
503
  }, "#init"));
496
- v(this, "switchSheet", /* @__PURE__ */ a((e, i = !1) => {
497
- const n = /* @__PURE__ */ a(() => {
504
+ v(this, "switchSheet", /* @__PURE__ */ c((t, i = !1) => {
505
+ const n = /* @__PURE__ */ c(() => {
498
506
  const h = this.querySelector("nine-table-sheets-body");
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");
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");
502
510
  });
503
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");
504
- if (!l[e]) return;
512
+ if (!l[t]) return;
505
513
  if (!i)
506
514
  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 = "");
515
+ h.classList.toggle("active", b === t);
516
+ const u = r.querySelector(`nine-table-sheet[data-index="${b}"]`);
517
+ u && (u.style.flex = "");
510
518
  }), d.forEach((h, b) => {
511
- h.classList.toggle("active", b === e);
519
+ h.classList.toggle("active", b === t);
512
520
  });
513
521
  else {
514
- const h = l[e], b = o.querySelectorAll(".nine-tab-item.active");
522
+ const h = l[t], b = o.querySelectorAll(".nine-tab-item.active");
515
523
  if (h.classList.contains("active") && b.length <= 1)
516
524
  return;
517
525
  h.classList.toggle("active");
518
- const f = r.querySelector(`nine-table-sheet[data-index="${e}"]`);
519
- f && (f.classList.toggle("active"), f.classList.contains("active") || (f.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 = ""));
520
528
  }
521
- const c = Array.from(r.querySelectorAll("nine-table-sheet.active"));
522
- if (c.length > 1) {
523
- const h = 1 / c.length;
524
- 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) => {
525
533
  (!b.style.flex || b.style.flex === "1 1 100%") && (b.style.flex = `${h} ${h} 0px`);
526
534
  });
527
535
  } else
528
- c.forEach((h) => {
536
+ a.forEach((h) => {
529
537
  h.style.flex = "1 1 100%";
530
538
  });
531
539
  n();
@@ -537,36 +545,36 @@ const Se = class Se extends HTMLElement {
537
545
  }, "switchSheet"));
538
546
  }
539
547
  connectedCallback() {
540
- t(this, te).call(this);
548
+ e(this, se).call(this);
541
549
  }
542
550
  };
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 {
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 {
548
556
  constructor(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));
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) => {
562
+ for (let i of t)
563
+ s.getAttribute("auto-height") === "true" && e(this, K).call(this, s);
564
+ })), e(this, U).observe(s));
557
565
  }, "#observeResize"));
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");
566
+ f(this, K, /* @__PURE__ */ c((s) => {
567
+ var k, R;
568
+ const t = (k = s.shadowRoot) == null ? void 0 : k.querySelector("nine-table-sheet.active");
569
+ if (!t) return;
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");
565
573
  x && (x.style.overflowY = i > n ? "auto" : "hidden");
566
574
  }, "#applyAutoHeight"));
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 = `
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 = `
570
578
  <style>
571
579
  :host {
572
580
  display: flex;
@@ -664,172 +672,172 @@ const Re = class Re {
664
672
  </nine-table-body>
665
673
  <nine-table-footer></nine-table-footer>
666
674
  `;
667
- const l = t(this, L).querySelectorAll("nine-table-sheet");
668
- l == null || l.forEach((d, c) => {
669
- i[c] && setTimeout(() => {
670
- d.init(i[c]), n && t(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);
671
679
  });
672
680
  });
673
681
  }, "#render"));
674
- y(this, L, s), t(this, ie).call(this), t(this, se).call(this);
682
+ y(this, L, s), e(this, ne).call(this), e(this, ie).call(this);
675
683
  }
676
684
  };
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 {
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 {
681
689
  constructor(s) {
682
- u(this, I);
683
- u(this, N, -1);
684
- v(this, "count", /* @__PURE__ */ a(() => t(this, I).rawRecords.length, "count"));
690
+ f(this, I);
691
+ f(this, B, -1);
692
+ v(this, "count", /* @__PURE__ */ c(() => e(this, I).rawRecords.length, "count"));
685
693
  y(this, I, s);
686
694
  }
687
695
  get at() {
688
- return t(this, N);
696
+ return e(this, B);
689
697
  }
690
698
  set at(s) {
691
699
  var i, n;
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(() => {
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(() => {
695
703
  var o, r;
696
- (r = (o = t(this, I).owner).scrollTo_V1) == null || r.call(o, t(this, N));
704
+ (r = (o = e(this, I).owner).scrollTo_V1) == null || r.call(o, e(this, B));
697
705
  });
698
706
  }
699
707
  };
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;
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;
703
711
  const T = class T {
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(() => {
712
- y(this, M, []);
713
- const s = t(this, S).template || [];
714
- Array.from(s).forEach((e) => {
712
+ constructor(s, t) {
713
+ f(this, E);
714
+ f(this, m);
715
+ f(this, q, []);
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 || [];
722
+ Array.from(s).forEach((t) => {
715
723
  var i;
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();
724
+ e(this, H).push(((i = t.getBoundingClientRect) == null ? void 0 : i.call(t).height) || 24);
725
+ }), (e(this, m).rawRecords || []).forEach((t) => {
726
+ t.__ng || (t.__ng = e(this, Z).call(this)), t.__ng.height = e(this, H).slice();
719
727
  });
720
728
  }, "#initialize"));
721
- v(this, "set", /* @__PURE__ */ a((s) => {
729
+ v(this, "set", /* @__PURE__ */ c((s) => {
722
730
  this.clear(), this.add(s, !1);
723
731
  }, "set"));
724
- u(this, K, /* @__PURE__ */ a(() => ({
732
+ f(this, Z, /* @__PURE__ */ c(() => ({
725
733
  rowState: T.ROW_STATE.EMPTY,
726
734
  deleted: !1,
727
735
  filtered: !1,
728
- height: t(this, M).slice(),
736
+ height: e(this, H).slice(),
729
737
  o: {},
730
738
  c: {},
731
- _: [0, 0, 0, 0, T.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(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, {}, {}]
732
740
  }), "#getDefaultMeta"));
733
- v(this, "reset", /* @__PURE__ */ a(() => {
734
- y(this, q, []), y(this, P, []);
741
+ v(this, "reset", /* @__PURE__ */ c(() => {
742
+ y(this, q, []), y(this, V, []);
735
743
  }, "reset"));
736
- v(this, "clear", /* @__PURE__ */ a(() => {
744
+ v(this, "clear", /* @__PURE__ */ c(() => {
737
745
  var s;
738
- t(this, m).rawRecords = [], y(this, q, []), y(this, P, []), (s = t(this, m).viewRecords) != null && s.reset && t(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();
739
747
  }, "clear"));
740
- u(this, oe, /* @__PURE__ */ a((s) => {
748
+ f(this, le, /* @__PURE__ */ c((s) => {
741
749
  var n;
742
750
  Array.isArray(s) || (s = [s]);
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 = [];
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 = [];
744
752
  return s.forEach((o) => {
745
753
  const r = { v: [] };
746
- e.forEach((l) => {
754
+ t.forEach((l) => {
747
755
  r.v.push(o[l] !== void 0 && o[l] !== null ? o[l] : "");
748
756
  }), i.push(r);
749
757
  }), i;
750
758
  }, "#json2Array"));
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;
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;
753
761
  }), s), "#defaultInsert"));
754
- v(this, "add", /* @__PURE__ */ a((s, e = !0) => {
762
+ v(this, "add", /* @__PURE__ */ c((s, t = !0) => {
755
763
  var o;
756
764
  s === void 0 && (s = {});
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();
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();
759
767
  const n = this.count() - 1;
760
- return e || i.forEach((r, l) => {
761
- const d = t(this, m).rawRecords[n - l];
768
+ return t || i.forEach((r, l) => {
769
+ const d = e(this, m).rawRecords[n - l];
762
770
  d && (d.__ng.rowState = T.ROW_STATE.EMPTY);
763
- }), (o = t(this, m).viewRecords) != null && o.reset && t(this, m).viewRecords.reset(), n;
771
+ }), (o = e(this, m).viewRecords) != null && o.reset && e(this, m).viewRecords.reset(), n;
764
772
  }, "add"));
765
- v(this, "delete", /* @__PURE__ */ a((s) => {
773
+ v(this, "delete", /* @__PURE__ */ c((s) => {
766
774
  var i;
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) => {
775
+ let t = [];
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) => {
777
+ if (e(this, q)[n]) {
778
+ const o = e(this, q)[n].__ng.rowid;
779
+ 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) => {
772
780
  r.__ng.rowid === o && (r.__ng.deleted = !0, r.__ng.rowState = T.ROW_STATE.DELETE);
773
781
  });
774
782
  }
775
- }), this.resetRecords(), (i = t(this, m).viewRecords) != null && i.reset && t(this, m).viewRecords.reset();
783
+ }), this.resetRecords(), (i = e(this, m).viewRecords) != null && i.reset && e(this, m).viewRecords.reset();
776
784
  }, "delete"));
777
- v(this, "setValue", /* @__PURE__ */ a((s, e, i) => {
785
+ v(this, "setValue", /* @__PURE__ */ c((s, t, i) => {
778
786
  var d;
779
787
  s = parseInt(s, 10);
780
- const o = (typeof ((d = t(this, S).fields) == null ? void 0 : d.get) == "function" ? t(this, S).fields.get() : []).indexOf(e);
788
+ const o = (typeof ((d = e(this, E).fields) == null ? void 0 : d.get) == "function" ? e(this, E).fields.get() : []).indexOf(t);
781
789
  if (o < 0) return;
782
790
  const r = this.getValidData()[s];
783
791
  if (!r) return;
784
792
  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);
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);
786
794
  }, "setValue"));
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;
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) => {
797
+ s.__ng.rowidx = t;
798
+ }), e(this, q).forEach((s, t) => {
799
+ s.__ng.i = t;
792
800
  });
793
801
  }, "resetRecords"));
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) => {
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) => {
796
804
  var i;
797
805
  if (!s) return s;
798
- const e = typeof ((i = t(this, S).fields) == null ? void 0 : i.get) == "function" ? t(this, S).fields.get() : [];
806
+ const t = typeof ((i = e(this, E).fields) == null ? void 0 : i.get) == "function" ? e(this, E).fields.get() : [];
799
807
  return Array.isArray(s) ? s.filter((n) => !n.__ng.deleted).map((n) => {
800
808
  const o = {};
801
- return e.forEach((r, l) => {
809
+ return t.forEach((r, l) => {
802
810
  o[r] = n.v ? n.v[l] : n[r];
803
811
  }), o.__ng = n.__ng, o;
804
812
  }) : s;
805
813
  }, "#conv2"));
806
- v(this, "count", /* @__PURE__ */ a(() => this.getValidData().length, "count"));
807
- v(this, "get", /* @__PURE__ */ a((s, e) => {
814
+ v(this, "count", /* @__PURE__ */ c(() => this.getValidData().length, "count"));
815
+ v(this, "get", /* @__PURE__ */ c((s, t) => {
808
816
  var o;
809
817
  const i = this.getValidData();
810
818
  if (!i || i.length <= 0) return;
811
- if (s == null) return t(this, V).call(this, i);
819
+ if (s == null) return e(this, X).call(this, i);
812
820
  if (s < 0 || s >= i.length) return null;
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);
821
+ const n = typeof ((o = e(this, E).fields) == null ? void 0 : o.get) == "function" ? e(this, E).fields.get() : [];
822
+ if (t != null) {
823
+ const r = n.indexOf(t);
816
824
  return r >= 0 ? i[s].v[r] : null;
817
825
  }
818
- return t(this, V).call(this, i[s]);
826
+ return e(this, X).call(this, i[s]);
819
827
  }, "get"));
820
- y(this, S, s), y(this, m, e), t(this, re).call(this);
828
+ y(this, E, s), y(this, m, t), e(this, oe).call(this);
821
829
  }
822
830
  get source() {
823
- return t(this, V).call(this, t(this, m).rawRecords);
831
+ return e(this, X).call(this, e(this, m).rawRecords);
824
832
  }
825
833
  set source(s) {
826
834
  this.clear(), this.add(s, !1);
827
835
  }
828
836
  get nextId() {
829
- return ++_e(this, ne)._;
837
+ return ++Me(this, re)._;
830
838
  }
831
839
  };
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"), // 🎯 ν–‰ μƒνƒœ μ •μ˜ μƒμˆ˜λ₯Ό 클래슀 λ‚΄λΆ€λ‘œ λ‚΄μž¬ν™”
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"), // 🎯 ν–‰ μƒνƒœ μ •μ˜ μƒμˆ˜λ₯Ό 클래슀 λ‚΄λΆ€λ‘œ λ‚΄μž¬ν™”
833
841
  v(T, "ROW_STATE", {
834
842
  EMPTY: "EMPTY",
835
843
  NORMAL: "NORMAL",
@@ -837,57 +845,57 @@ v(T, "ROW_STATE", {
837
845
  UPDATE: "UPDATE",
838
846
  DELETE: "DELETE"
839
847
  });
840
- let ye = T;
841
- const qe = class qe {
848
+ let we = T;
849
+ const ke = class ke {
842
850
  constructor(s) {
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) => {
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 = () => {
852
+ var t;
853
+ (t = this.owner.view) != null && t.redraw && this.owner.view.redraw();
854
+ }, this.setDataSource = (t) => {
855
+ this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(t || []);
856
+ }, this.getRowState = (t) => {
849
857
  var n, o;
850
- const i = parseInt(e, 10);
858
+ const i = parseInt(t, 10);
851
859
  if (!(i >= this.data.count()))
852
860
  return (o = (n = this.data.getValidData()[i]) == null ? void 0 : n.__ng) == null ? void 0 : o.rowState;
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);
861
+ }, this.getRowPosition = () => this.row.at, this.setRowPosition = (t) => {
862
+ this.row.at = t;
863
+ }, 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) => {
864
+ t = parseInt(t, 10), this.data.setValue(t, i, n);
857
865
  }, this.setDataSource([]);
858
866
  }
859
867
  };
860
- a(qe, "ngDataManager");
861
- let we = qe;
862
- var D, ae;
863
- const Ce = class Ce extends HTMLElement {
868
+ c(ke, "ngDataManager");
869
+ let me = ke;
870
+ var P, ce;
871
+ const Ae = class Ae extends HTMLElement {
864
872
  constructor() {
865
873
  super();
866
874
  //#created = false;
867
- u(this, D);
868
- u(this, ae);
869
- this.attachShadow({ mode: "open" }), y(this, D, new we(this));
875
+ f(this, P);
876
+ f(this, ce);
877
+ this.attachShadow({ mode: "open" }), y(this, P, new me(this));
870
878
  }
871
879
  connectedCallback() {
872
- y(this, ae, new ge(this.shadowRoot)), X.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 } }));
873
881
  }
874
882
  disconnectedCallback() {
875
- X.log("NineTable disconnected.");
883
+ F.log("NineTable disconnected.");
876
884
  }
877
885
  // 🎯 μ™ΈλΆ€μ—μ„œ grid.data.set(...) ν˜•νƒœλ‘œ μ ‘κ·Όν•  수 μžˆλ„λ‘ 데이터 λ§€λ‹ˆμ € μ˜€ν”ˆ
878
886
  get data() {
879
- return t(this, D).data;
887
+ return e(this, P).data;
880
888
  }
881
889
  // 🎯 ν–‰(row) κ΄€λ ¨ μ œμ–΄ μ ‘κ·Όμž μ˜€ν”ˆ
882
890
  get row() {
883
- return t(this, D).row;
891
+ return e(this, P).row;
884
892
  }
885
893
  // 🎯 전체 데이터 λ§€λ‹ˆμ € μ ‘κ·Ό ν•„μš”ν•  경우
886
894
  get dataManager() {
887
- return t(this, D);
895
+ return e(this, P);
888
896
  }
889
897
  };
890
- D = new WeakMap(), ae = new WeakMap(), a(Ce, "NineTable");
891
- let me = Ce;
892
- customElements.get("nine-table") || customElements.define("nine-table", me);
898
+ P = new WeakMap(), ce = new WeakMap(), c(Ae, "NineTable");
899
+ let ve = Ae;
900
+ customElements.get("nine-table") || customElements.define("nine-table", ve);
893
901
  //# sourceMappingURL=nine-table.js.map