@ninebone/table 0.0.103 β†’ 0.0.105

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,117 +1,125 @@
1
- var te = Object.defineProperty;
2
- var ne = (p) => {
3
- throw TypeError(p);
1
+ var xe = Object.defineProperty;
2
+ var Se = (y) => {
3
+ throw TypeError(y);
4
4
  };
5
- var se = (p, i, t) => i in p ? te(p, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : p[i] = t;
6
- var b = (p, i) => te(p, "name", { value: i, configurable: !0 });
7
- var L = (p, i, t) => se(p, typeof i != "symbol" ? i + "" : i, t), ie = (p, i, t) => i.has(p) || ne("Cannot " + t);
8
- var e = (p, i, t) => (ie(p, i, "read from private field"), t ? t.call(p) : i.get(p)), m = (p, i, t) => i.has(p) ? ne("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(p) : i.set(p, t), w = (p, i, t, s) => (ie(p, i, "write to private field"), s ? s.call(p, t) : i.set(p, t), t);
9
- import { trace as oe } from "@ninebone/util";
10
- const J = class J extends oe.constructor {
5
+ var _e = (y, s, t) => s in y ? xe(y, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : y[s] = t;
6
+ var a = (y, s) => xe(y, "name", { value: s, configurable: !0 });
7
+ var x = (y, s, t) => _e(y, typeof s != "symbol" ? s + "" : s, t), Ee = (y, s, t) => s.has(y) || Se("Cannot " + t);
8
+ var e = (y, s, t) => (Ee(y, s, "read from private field"), t ? t.call(y) : s.get(y)), g = (y, s, t) => s.has(y) ? Se("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(y) : s.set(y, t), m = (y, s, t, i) => (Ee(y, s, "write to private field"), i ? i.call(y, t) : s.set(y, t), t);
9
+ var Re = (y, s, t, i) => ({
10
+ set _(n) {
11
+ m(y, s, n, t);
12
+ },
13
+ get _() {
14
+ return e(y, s, i);
15
+ }
16
+ });
17
+ import { trace as ke } from "@ninebone/util";
18
+ const ue = class ue extends ke.constructor {
11
19
  constructor() {
12
20
  super(), this.init("nine-table", "green");
13
21
  }
14
22
  };
15
- b(J, "Trace");
16
- let P = J;
17
- const z = new P();
18
- var E, C, f, R, A, $, B, T, X;
19
- const Q = class Q extends HTMLElement {
23
+ a(ue, "Trace");
24
+ let ne = ue;
25
+ const Y = new ne();
26
+ var q, I, p, $, M, W, F, H, K;
27
+ const be = class be extends HTMLElement {
20
28
  constructor() {
21
29
  super();
22
- m(this, E);
23
- m(this, C, !1);
24
- m(this, f);
25
- m(this, R);
26
- m(this, A);
27
- m(this, $);
28
- m(this, B, /* @__PURE__ */ b(() => {
29
- if (!e(this, E)) return;
30
- const t = e(this, E).querySelector(".ng-container-body");
31
- t && (w(this, $, new ResizeObserver(() => {
30
+ g(this, q);
31
+ g(this, I, !1);
32
+ g(this, p);
33
+ g(this, $);
34
+ g(this, M);
35
+ g(this, W);
36
+ g(this, F, /* @__PURE__ */ a(() => {
37
+ if (!e(this, q)) return;
38
+ const t = e(this, q).querySelector(".ng-container-body");
39
+ t && (m(this, W, new ResizeObserver(() => {
32
40
  this.refresh();
33
- })), e(this, $).observe(t));
41
+ })), e(this, W).observe(t));
34
42
  }, "#observeResize"));
35
- L(this, "refresh", /* @__PURE__ */ b(() => {
36
- if (!e(this, E) || !e(this, f) || e(this, C)) return;
37
- const t = e(this, f).container, s = t.querySelector("table");
38
- if (!s) return;
39
- const r = e(this, f).track, g = e(this, f).thumb, h = e(this, E).querySelector(".ng-container-bottom"), a = t.clientWidth, u = s.scrollWidth;
40
- if (a !== 0 && u > a)
41
- h && (h.style.display = "flex");
43
+ x(this, "refresh", /* @__PURE__ */ a(() => {
44
+ if (!e(this, q) || !e(this, p) || e(this, I)) return;
45
+ const t = e(this, p).container, i = t.querySelector("table");
46
+ if (!i) return;
47
+ const n = e(this, p).track, l = e(this, p).thumb, r = e(this, q).querySelector(".ng-container-bottom"), c = t.clientWidth, u = i.scrollWidth;
48
+ if (c !== 0 && u > c)
49
+ r && (r.style.display = "flex");
42
50
  else {
43
- h && (h.style.display = "none");
51
+ r && (r.style.display = "none");
44
52
  return;
45
53
  }
46
- const n = r.clientWidth;
47
- if (n <= 0) return;
48
- const d = Math.max(Math.min(n * (a / u), n), 20);
49
- g.style.width = `${d}px`;
50
- let o = 0;
51
- const c = s.style.transform;
52
- if (c && c.includes("translateX")) {
53
- const y = c.match(/translateX\(([-\d.]+)px\)/);
54
- y && y[1] && (o = parseFloat(y[1]));
54
+ const o = n.clientWidth;
55
+ if (o <= 0) return;
56
+ const b = Math.max(Math.min(o * (c / u), o), 20);
57
+ l.style.width = `${b}px`;
58
+ let h = 0;
59
+ const f = i.style.transform;
60
+ if (f && f.includes("translateX")) {
61
+ const v = f.match(/translateX\(([-\d.]+)px\)/);
62
+ v && v[1] && (h = parseFloat(v[1]));
55
63
  } else
56
- o = parseInt(s.style.left || 0, 10);
57
- let l = parseInt(Math.abs(o) * n / u, 10);
58
- l < 0 && (l = 0);
59
- const x = n - d;
60
- l > x && (l = x), g.style.left = `${l}px`, e(this, f).left.disabled = l === 0, e(this, f).right.disabled = l >= x - 1;
64
+ h = parseInt(i.style.left || 0, 10);
65
+ let d = parseInt(Math.abs(h) * o / u, 10);
66
+ d < 0 && (d = 0);
67
+ const S = o - b;
68
+ d > S && (d = S), l.style.left = `${d}px`, e(this, p).left.disabled = d === 0, e(this, p).right.disabled = d >= S - 1;
61
69
  }, "refresh"));
62
- m(this, T, /* @__PURE__ */ b((t) => {
63
- if (!e(this, f)) return !1;
64
- const s = e(this, f).container, r = s.querySelector("table");
65
- if (!r) return !1;
66
- const g = e(this, f).track.getBoundingClientRect(), h = e(this, f).thumb.clientWidth;
67
- let a = t;
68
- a < 0 && (a = 0);
69
- const u = g.width - h;
70
- a > u && (a = u), a = parseInt(a, 10), e(this, f).thumb.style.left = `${a}px`, e(this, f).left.disabled = a === 0, e(this, f).right.disabled = a >= u - 1;
71
- const n = s.clientWidth, d = r.scrollWidth;
72
- let o = u > 0 ? -a * (d - n) / u : 0;
73
- return -o > d - n && (o = -(d - n)), -o + 5 > d - n && (o = -(d - n)), n >= d && (o = 0), r.style.transform = `translateX(${o}px)`, a > 0 && a < u - 1;
70
+ g(this, H, /* @__PURE__ */ a((t) => {
71
+ if (!e(this, p)) return !1;
72
+ const i = e(this, p).container, n = i.querySelector("table");
73
+ if (!n) return !1;
74
+ const l = e(this, p).track.getBoundingClientRect(), r = e(this, p).thumb.clientWidth;
75
+ let c = t;
76
+ c < 0 && (c = 0);
77
+ const u = l.width - r;
78
+ c > u && (c = u), c = parseInt(c, 10), e(this, p).thumb.style.left = `${c}px`, e(this, p).left.disabled = c === 0, e(this, p).right.disabled = c >= u - 1;
79
+ const o = i.clientWidth, b = n.scrollWidth;
80
+ let h = u > 0 ? -c * (b - o) / u : 0;
81
+ return -h > b - o && (h = -(b - o)), -h + 5 > b - o && (h = -(b - o)), o >= b && (h = 0), n.style.transform = `translateX(${h}px)`, c > 0 && c < u - 1;
74
82
  }, "#thumbMoveTo"));
75
- m(this, X, /* @__PURE__ */ b(() => {
76
- const t = /* @__PURE__ */ b((r) => {
77
- clearInterval(e(this, R)), clearInterval(e(this, A));
78
- const g = parseInt(e(this, f).thumb.style.left || 0, 10);
79
- e(this, T).call(this, g + r), w(this, R, setInterval(() => {
80
- clearInterval(e(this, R)), w(this, A, setInterval(() => {
81
- const h = parseInt(e(this, f).thumb.style.left || 0, 10);
82
- e(this, T).call(this, h + r) || clearInterval(e(this, A));
83
+ g(this, K, /* @__PURE__ */ a(() => {
84
+ const t = /* @__PURE__ */ a((n) => {
85
+ clearInterval(e(this, $)), clearInterval(e(this, M));
86
+ const l = parseInt(e(this, p).thumb.style.left || 0, 10);
87
+ e(this, H).call(this, l + n), m(this, $, setInterval(() => {
88
+ clearInterval(e(this, $)), m(this, M, setInterval(() => {
89
+ const r = parseInt(e(this, p).thumb.style.left || 0, 10);
90
+ e(this, H).call(this, r + n) || clearInterval(e(this, M));
83
91
  }, 50));
84
92
  }, 500));
85
- }, "delayScroll"), s = /* @__PURE__ */ b(() => {
86
- clearInterval(e(this, R)), clearInterval(e(this, A));
93
+ }, "delayScroll"), i = /* @__PURE__ */ a(() => {
94
+ clearInterval(e(this, $)), clearInterval(e(this, M));
87
95
  }, "clearTimer");
88
- ["mouseup", "mouseleave", "touchend"].forEach((r) => {
89
- e(this, f).left.addEventListener(r, s), e(this, f).right.addEventListener(r, s), e(this, f).track.addEventListener(r, s);
90
- }), e(this, f).left.addEventListener("mousedown", (r) => {
91
- r.button === 0 && t(-20);
92
- }), e(this, f).right.addEventListener("mousedown", (r) => {
93
- r.button === 0 && t(20);
94
- }), e(this, f).left.addEventListener("touchstart", () => t(-20)), e(this, f).right.addEventListener("touchstart", () => t(20)), e(this, f).track.addEventListener("mousedown", (r) => {
95
- if (r.button !== 0) return;
96
- r.preventDefault();
97
- const g = e(this, f).track.getBoundingClientRect(), h = e(this, f).thumb.clientWidth;
98
- e(this, T).call(this, r.clientX - g.left - h / 2);
99
- }), e(this, f).thumb.addEventListener("mousedown", (r) => {
100
- if (r.button !== 0) return;
101
- r.stopPropagation(), r.preventDefault(), w(this, C, !0), this.shiftX = r.clientX - e(this, f).thumb.getBoundingClientRect().left;
102
- const g = /* @__PURE__ */ b((a) => {
103
- if (!e(this, C)) return;
104
- const u = e(this, f).track.getBoundingClientRect();
105
- e(this, T).call(this, a.clientX - u.left - this.shiftX);
106
- }, "onMouseMove"), h = /* @__PURE__ */ b(() => {
107
- w(this, C, !1), s(), document.removeEventListener("mousemove", g), document.removeEventListener("mouseup", h), this.refresh();
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) => {
103
+ if (n.button !== 0) return;
104
+ n.preventDefault();
105
+ const l = e(this, p).track.getBoundingClientRect(), r = e(this, p).thumb.clientWidth;
106
+ e(this, H).call(this, n.clientX - l.left - r / 2);
107
+ }), e(this, p).thumb.addEventListener("mousedown", (n) => {
108
+ if (n.button !== 0) return;
109
+ n.stopPropagation(), n.preventDefault(), m(this, I, !0), this.shiftX = n.clientX - e(this, p).thumb.getBoundingClientRect().left;
110
+ const l = /* @__PURE__ */ a((c) => {
111
+ if (!e(this, I)) return;
112
+ const u = e(this, p).track.getBoundingClientRect();
113
+ e(this, H).call(this, c.clientX - u.left - this.shiftX);
114
+ }, "onMouseMove"), r = /* @__PURE__ */ a(() => {
115
+ m(this, I, !1), i(), document.removeEventListener("mousemove", l), document.removeEventListener("mouseup", r), this.refresh();
108
116
  }, "onMouseUp");
109
- document.addEventListener("mousemove", g), document.addEventListener("mouseup", h);
117
+ document.addEventListener("mousemove", l), document.addEventListener("mouseup", r);
110
118
  });
111
119
  }, "#init"));
112
120
  }
113
121
  connectedCallback() {
114
- if (w(this, E, this.closest("nine-table-sheet") || this.getRootNode().host), !e(this, E)) return;
122
+ if (m(this, q, this.closest("nine-table-sheet") || this.getRootNode().host), !e(this, q)) return;
115
123
  this.innerHTML = `
116
124
  <style>
117
125
  nine-table-hscrollbar {
@@ -175,112 +183,112 @@ const Q = class Q extends HTMLElement {
175
183
  <div class='ng-scroll-track'><div class='ng-scroll-thumb'></div></div>
176
184
  <button class='ng-scroll-right' disabled><div class='ng-scroll-icon'></div></button>
177
185
  `;
178
- const t = /* @__PURE__ */ b(() => {
179
- const s = e(this, E).querySelector(".ng-container-body");
180
- if (!s) {
186
+ const t = /* @__PURE__ */ a(() => {
187
+ const i = e(this, q).querySelector(".ng-container-body");
188
+ if (!i) {
181
189
  setTimeout(t, 10);
182
190
  return;
183
191
  }
184
- w(this, f, {
185
- container: s,
192
+ m(this, p, {
193
+ container: i,
186
194
  track: this.querySelector(".ng-scroll-track"),
187
195
  thumb: this.querySelector(".ng-scroll-thumb"),
188
196
  left: this.querySelector(".ng-scroll-left"),
189
197
  right: this.querySelector(".ng-scroll-right")
190
- }), e(this, X).call(this), e(this, B).call(this), this.refresh();
198
+ }), e(this, K).call(this), e(this, F).call(this), this.refresh();
191
199
  }, "initWhenReady");
192
200
  t();
193
201
  }
194
202
  disconnectedCallback() {
195
- e(this, $) && e(this, $).disconnect();
203
+ e(this, W) && e(this, W).disconnect();
196
204
  }
197
205
  };
198
- E = new WeakMap(), C = new WeakMap(), f = new WeakMap(), R = new WeakMap(), A = new WeakMap(), $ = new WeakMap(), B = new WeakMap(), T = new WeakMap(), X = new WeakMap(), b(Q, "NineTableHScrollBar");
199
- let Y = Q;
200
- customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Y);
201
- var q, N;
202
- const I = class I extends HTMLElement {
206
+ q = new WeakMap(), I = new WeakMap(), p = new WeakMap(), $ = new WeakMap(), M = new WeakMap(), W = new WeakMap(), F = new WeakMap(), H = new WeakMap(), K = new WeakMap(), a(be, "NineTableHScrollBar");
207
+ let re = be;
208
+ customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", re);
209
+ var L, U;
210
+ const P = class P extends HTMLElement {
203
211
  constructor() {
204
212
  super();
205
- m(this, q, null);
206
- L(this, "init", /* @__PURE__ */ b((t) => {
213
+ g(this, L, null);
214
+ x(this, "init", /* @__PURE__ */ a((t) => {
207
215
  if (!t) return;
208
- const s = /* @__PURE__ */ b((n) => {
209
- const d = /* @__PURE__ */ b((c) => {
210
- if (c.querySelector("colgroup")) return;
211
- const l = c.querySelector("tbody tr") || c.querySelector("tr"), x = l ? l.querySelectorAll("th, td").length : 1, y = document.createElement("colgroup"), S = Math.max(Math.floor((c.clientWidth || 600) / x), 100);
212
- for (let v = 0; v < x; v++) {
213
- const K = document.createElement("col");
214
- K.setAttribute("width", S), y.appendChild(K);
216
+ const i = /* @__PURE__ */ a((o) => {
217
+ const b = /* @__PURE__ */ a((f) => {
218
+ if (f.querySelector("colgroup")) return;
219
+ const d = f.querySelector("tbody tr") || f.querySelector("tr"), S = d ? d.querySelectorAll("th, td").length : 1, v = document.createElement("colgroup"), k = Math.max(Math.floor((f.clientWidth || 600) / S), 100);
220
+ for (let R = 0; R < S; R++) {
221
+ const ie = document.createElement("col");
222
+ ie.setAttribute("width", k), v.appendChild(ie);
215
223
  }
216
- c.prepend(y);
217
- }, "ensureColgroup"), o = /* @__PURE__ */ b((c) => {
218
- if (c.querySelector("thead")) return;
219
- const l = document.createElement("thead"), x = c.querySelector("colgroup");
220
- x ? x.after(l) : c.prepend(l);
224
+ f.prepend(v);
225
+ }, "ensureColgroup"), h = /* @__PURE__ */ a((f) => {
226
+ if (f.querySelector("thead")) return;
227
+ const d = document.createElement("thead"), S = f.querySelector("colgroup");
228
+ S ? S.after(d) : f.prepend(d);
221
229
  }, "ensureThead");
222
- return d(n), o(n), n.classList.add("nine-table-element"), n;
223
- }, "initializeTable"), r = t.cloneNode(!0);
224
- w(this, q, s(r)), e(this, q).style.display = "table";
225
- const g = this.querySelector(".ng-container-left"), h = this.querySelector(".ng-container-body"), a = this.querySelector(".ng-container-right"), u = /* @__PURE__ */ b((n, d, o = !1) => {
226
- const c = n.cloneNode(!0), l = Array.from(c.querySelectorAll("colgroup col")), x = [];
227
- return l.forEach((y, S) => {
228
- const v = y.getAttribute("fixed");
229
- (o ? !v || v === "" : v === d) || x.push(S);
230
- }), x.reverse().forEach((y) => {
231
- l[y] && l[y].remove(), c.querySelectorAll("tr").forEach((S) => {
232
- const v = S.querySelectorAll("th, td");
233
- v[y] && v[y].remove();
230
+ return b(o), h(o), o.classList.add("nine-table-element"), o;
231
+ }, "initializeTable"), n = t.cloneNode(!0);
232
+ m(this, L, i(n)), e(this, L).style.display = "table";
233
+ const l = this.querySelector(".ng-container-left"), r = this.querySelector(".ng-container-body"), c = this.querySelector(".ng-container-right"), u = /* @__PURE__ */ a((o, b, h = !1) => {
234
+ const f = o.cloneNode(!0), d = Array.from(f.querySelectorAll("colgroup col")), S = [];
235
+ return d.forEach((v, k) => {
236
+ const R = v.getAttribute("fixed");
237
+ (h ? !R || R === "" : R === b) || S.push(k);
238
+ }), S.reverse().forEach((v) => {
239
+ d[v] && d[v].remove(), f.querySelectorAll("tr").forEach((k) => {
240
+ const R = k.querySelectorAll("th, td");
241
+ R[v] && R[v].remove();
234
242
  });
235
- }), c;
243
+ }), f;
236
244
  }, "filterTableByFixed");
237
- if (h) {
238
- const n = u(e(this, q), null, !0);
239
- h.innerHTML = "", h.appendChild(n);
245
+ if (r) {
246
+ const o = u(e(this, L), null, !0);
247
+ r.innerHTML = "", r.appendChild(o);
240
248
  }
241
- if (g) {
242
- const n = u(e(this, q), "left", !1);
243
- let d = 0;
244
- n.querySelectorAll("col").forEach((c) => {
245
- const l = parseInt(c.getAttribute("width"), 10);
246
- isNaN(l) || (d += l);
247
- }), g.innerHTML = "", g.appendChild(n);
248
- const o = d > 0 ? d : 0;
249
- g.style.flex = `0 0 ${o}px`, g.style.width = `${o}px`;
249
+ if (l) {
250
+ const o = u(e(this, L), "left", !1);
251
+ let b = 0;
252
+ o.querySelectorAll("col").forEach((f) => {
253
+ const d = parseInt(f.getAttribute("width"), 10);
254
+ isNaN(d) || (b += d);
255
+ }), l.innerHTML = "", l.appendChild(o);
256
+ const h = b > 0 ? b : 0;
257
+ l.style.flex = `0 0 ${h}px`, l.style.width = `${h}px`;
250
258
  }
251
- if (a) {
252
- const n = u(e(this, q), "right", !1);
253
- let d = 0;
254
- n.querySelectorAll("col").forEach((c) => {
255
- const l = parseInt(c.getAttribute("width"), 10);
256
- isNaN(l) || (d += l);
257
- }), a.innerHTML = "", a.appendChild(n);
258
- const o = d > 0 ? d : 0;
259
- a.style.flex = `0 0 ${o}px`, a.style.width = `${o}px`;
259
+ if (c) {
260
+ const o = u(e(this, L), "right", !1);
261
+ let b = 0;
262
+ o.querySelectorAll("col").forEach((f) => {
263
+ const d = parseInt(f.getAttribute("width"), 10);
264
+ isNaN(d) || (b += d);
265
+ }), c.innerHTML = "", c.appendChild(o);
266
+ const h = b > 0 ? b : 0;
267
+ c.style.flex = `0 0 ${h}px`, c.style.width = `${h}px`;
260
268
  }
261
- if (h) {
262
- const n = this.getRowCount();
263
- h.style.overflowY = n > 10 ? "auto" : "hidden", h.addEventListener("scroll", () => {
264
- const d = this.querySelector("nine-table-hscrollbar");
265
- d && typeof d.refresh == "function" && d.refresh();
269
+ if (r) {
270
+ const o = this.getRowCount();
271
+ r.style.overflowY = o > 10 ? "auto" : "hidden", r.addEventListener("scroll", () => {
272
+ const b = this.querySelector("nine-table-hscrollbar");
273
+ b && typeof b.refresh == "function" && b.refresh();
266
274
  });
267
275
  }
268
276
  setTimeout(() => {
269
- const n = this.querySelector("nine-table-hscrollbar");
270
- n && typeof n.refresh == "function" && n.refresh();
271
- }, 0), z.log(`NineTableSheet 3-split initialized with rows: ${this.getRowCount()}`);
277
+ const o = this.querySelector("nine-table-hscrollbar");
278
+ o && typeof o.refresh == "function" && o.refresh();
279
+ }, 0), Y.log(`NineTableSheet 3-split initialized with rows: ${this.getRowCount()}`);
272
280
  }, "init"));
273
- L(this, "getRowCount", /* @__PURE__ */ b(() => e(this, q) ? e(this, q).querySelectorAll("tbody tr").length : 0, "getRowCount"));
274
- L(this, "scrollToX", /* @__PURE__ */ b((t) => {
275
- const s = this.querySelector(".ng-container-body");
276
- s && (s.scrollLeft = t);
281
+ x(this, "getRowCount", /* @__PURE__ */ a(() => e(this, L) ? e(this, L).querySelectorAll("tbody tr").length : 0, "getRowCount"));
282
+ x(this, "scrollToX", /* @__PURE__ */ a((t) => {
283
+ const i = this.querySelector(".ng-container-body");
284
+ i && (i.scrollLeft = t);
277
285
  }, "scrollToX"));
278
- L(this, "scrollToY", /* @__PURE__ */ b((t) => {
279
- const s = this.querySelector(".ng-container-body");
280
- s && (s.scrollTop = t);
286
+ x(this, "scrollToY", /* @__PURE__ */ a((t) => {
287
+ const i = this.querySelector(".ng-container-body");
288
+ i && (i.scrollTop = t);
281
289
  }, "scrollToY"));
282
- m(this, N, /* @__PURE__ */ b(() => {
283
- const t = I.SCROLLBAR_SIZE;
290
+ g(this, U, /* @__PURE__ */ a(() => {
291
+ const t = P.SCROLLBAR_SIZE;
284
292
  this.innerHTML = `
285
293
  <style>
286
294
  nine-table-sheet {
@@ -398,109 +406,109 @@ const I = class I extends HTMLElement {
398
406
  }, "#render"));
399
407
  }
400
408
  connectedCallback() {
401
- e(this, N).call(this);
409
+ e(this, U).call(this);
402
410
  }
403
411
  disconnectedCallback() {
404
- this.innerHTML = "", z.log("NineTableSheet destroyed.");
412
+ this.innerHTML = "", Y.log("NineTableSheet destroyed.");
405
413
  }
406
414
  };
407
- q = new WeakMap(), N = new WeakMap(), b(I, "NineTableSheet"), L(I, "SCROLLBAR_SIZE", 16);
408
- let D = I;
409
- customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", D);
410
- var O;
411
- const V = class V extends HTMLElement {
415
+ L = new WeakMap(), U = new WeakMap(), a(P, "NineTableSheet"), x(P, "SCROLLBAR_SIZE", 16);
416
+ let oe = P;
417
+ customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", oe);
418
+ var Z;
419
+ const ge = class ge extends HTMLElement {
412
420
  constructor() {
413
421
  super();
414
- m(this, O, /* @__PURE__ */ b(() => {
422
+ g(this, Z, /* @__PURE__ */ a(() => {
415
423
  const t = this.querySelector(".nine-tab-bar");
416
- t && (t.addEventListener("click", (s) => {
417
- const r = s.target.closest(".nine-tab-item");
418
- if (!r) return;
419
- const g = s.ctrlKey || s.metaKey || s.shiftKey, h = parseInt(r.dataset.index, 10);
420
- this.switchSheet(h, g);
424
+ t && (t.addEventListener("click", (i) => {
425
+ const n = i.target.closest(".nine-tab-item");
426
+ if (!n) return;
427
+ const l = i.ctrlKey || i.metaKey || i.shiftKey, r = parseInt(n.dataset.index, 10);
428
+ this.switchSheet(r, l);
421
429
  }), this.switchSheet(0, !1));
422
430
  }, "#init"));
423
- L(this, "switchSheet", /* @__PURE__ */ b((t, s = !1) => {
424
- const r = /* @__PURE__ */ b(() => {
425
- const o = this.querySelector("nine-table-sheets-body");
426
- o.querySelectorAll("nine-splitter").forEach((l) => {
427
- const x = parseInt(l.dataset.splitIndex, 10), y = o.querySelector(`nine-table-sheet[data-index="${x - 1}"]`), S = o.querySelector(`nine-table-sheet[data-index="${x}"]`);
428
- y && S && y.classList.contains("active") && S.classList.contains("active") ? l.classList.add("active") : l.classList.remove("active");
431
+ x(this, "switchSheet", /* @__PURE__ */ a((t, i = !1) => {
432
+ const n = /* @__PURE__ */ a(() => {
433
+ const h = this.querySelector("nine-table-sheets-body");
434
+ h.querySelectorAll("nine-splitter").forEach((d) => {
435
+ const S = parseInt(d.dataset.splitIndex, 10), v = h.querySelector(`nine-table-sheet[data-index="${S - 1}"]`), k = h.querySelector(`nine-table-sheet[data-index="${S}"]`);
436
+ v && k && v.classList.contains("active") && k.classList.contains("active") ? d.classList.add("active") : d.classList.remove("active");
429
437
  });
430
- }, "updateSplitters"), g = this.querySelector(".nine-tab-bar"), h = this.querySelector("nine-table-sheets-body"), a = g.querySelectorAll(".nine-tab-item"), u = h.querySelectorAll("nine-table-sheet");
431
- if (!a[t]) return;
432
- if (!s)
433
- a.forEach((o, c) => {
434
- o.classList.toggle("active", c === t);
435
- const l = h.querySelector(`nine-table-sheet[data-index="${c}"]`);
436
- l && (l.style.flex = "");
437
- }), u.forEach((o, c) => {
438
- o.classList.toggle("active", c === t);
438
+ }, "updateSplitters"), l = this.querySelector(".nine-tab-bar"), r = this.querySelector("nine-table-sheets-body"), c = l.querySelectorAll(".nine-tab-item"), u = r.querySelectorAll("nine-table-sheet");
439
+ if (!c[t]) return;
440
+ if (!i)
441
+ c.forEach((h, f) => {
442
+ h.classList.toggle("active", f === t);
443
+ const d = r.querySelector(`nine-table-sheet[data-index="${f}"]`);
444
+ d && (d.style.flex = "");
445
+ }), u.forEach((h, f) => {
446
+ h.classList.toggle("active", f === t);
439
447
  });
440
448
  else {
441
- const o = a[t], c = g.querySelectorAll(".nine-tab-item.active");
442
- if (o.classList.contains("active") && c.length <= 1)
449
+ const h = c[t], f = l.querySelectorAll(".nine-tab-item.active");
450
+ if (h.classList.contains("active") && f.length <= 1)
443
451
  return;
444
- o.classList.toggle("active");
445
- const l = h.querySelector(`nine-table-sheet[data-index="${t}"]`);
446
- l && (l.classList.toggle("active"), l.classList.contains("active") || (l.style.flex = ""));
452
+ h.classList.toggle("active");
453
+ const d = r.querySelector(`nine-table-sheet[data-index="${t}"]`);
454
+ d && (d.classList.toggle("active"), d.classList.contains("active") || (d.style.flex = ""));
447
455
  }
448
- const n = Array.from(h.querySelectorAll("nine-table-sheet.active"));
449
- if (n.length > 1) {
450
- const o = 1 / n.length;
451
- n.forEach((c) => {
452
- (!c.style.flex || c.style.flex === "1 1 100%") && (c.style.flex = `${o} ${o} 0px`);
456
+ const o = Array.from(r.querySelectorAll("nine-table-sheet.active"));
457
+ if (o.length > 1) {
458
+ const h = 1 / o.length;
459
+ o.forEach((f) => {
460
+ (!f.style.flex || f.style.flex === "1 1 100%") && (f.style.flex = `${h} ${h} 0px`);
453
461
  });
454
462
  } else
455
- n.forEach((o) => {
456
- o.style.flex = "1 1 100%";
463
+ o.forEach((h) => {
464
+ h.style.flex = "1 1 100%";
457
465
  });
458
- r();
459
- const d = h.querySelector("nine-table-sheet.active");
460
- if (d && typeof d.getRowCount == "function") {
461
- const o = this.querySelector("#row-count");
462
- o && (o.textContent = d.getRowCount().toLocaleString());
466
+ n();
467
+ const b = r.querySelector("nine-table-sheet.active");
468
+ if (b && typeof b.getRowCount == "function") {
469
+ const h = this.querySelector("#row-count");
470
+ h && (h.textContent = b.getRowCount().toLocaleString());
463
471
  }
464
472
  }, "switchSheet"));
465
473
  }
466
474
  connectedCallback() {
467
- e(this, O).call(this);
475
+ e(this, Z).call(this);
468
476
  }
469
477
  };
470
- O = new WeakMap(), b(V, "NineTableSheets");
471
- let Z = V;
472
- customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", Z);
473
- var k, M, j, H, F;
474
- const _ = class _ {
475
- constructor(i) {
476
- m(this, k);
477
- m(this, M, null);
478
- m(this, j, /* @__PURE__ */ b(() => {
479
- const i = e(this, k).host;
480
- i && (w(this, M, new ResizeObserver((t) => {
481
- for (let s of t)
482
- i.getAttribute("auto-height") === "true" && e(this, H).call(this, i);
483
- })), e(this, M).observe(i));
478
+ Z = new WeakMap(), a(ge, "NineTableSheets");
479
+ let le = ge;
480
+ customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", le);
481
+ var T, N, j, X, G;
482
+ const pe = class pe {
483
+ constructor(s) {
484
+ g(this, T);
485
+ g(this, N, null);
486
+ g(this, j, /* @__PURE__ */ a(() => {
487
+ const s = e(this, T).host;
488
+ s && (m(this, N, new ResizeObserver((t) => {
489
+ for (let i of t)
490
+ s.getAttribute("auto-height") === "true" && e(this, X).call(this, s);
491
+ })), e(this, N).observe(s));
484
492
  }, "#observeResize"));
485
- m(this, H, /* @__PURE__ */ b((i) => {
486
- var S, v;
487
- const t = (S = i.shadowRoot) == null ? void 0 : S.querySelector("nine-table-sheet.active");
493
+ g(this, X, /* @__PURE__ */ a((s) => {
494
+ var k, R;
495
+ const t = (k = s.shadowRoot) == null ? void 0 : k.querySelector("nine-table-sheet.active");
488
496
  if (!t) return;
489
- const s = ((v = t.getRowCount) == null ? void 0 : v.call(t)) || 0, r = parseInt(i.getAttribute("max-display-row"), 10) || 10, g = Math.min(s, r), h = t.querySelector("tbody tr") || t.querySelector("tr"), a = h ? h.getBoundingClientRect().height : 32, u = e(this, k).querySelector("nine-table-header"), n = e(this, k).querySelector("nine-table-sheets-footer"), d = u ? u.getBoundingClientRect().height : 40, o = n ? n.getBoundingClientRect().height : 32, l = d + o + 16, x = g * a + l;
490
- i.style.height = `${x}px`, i.style.maxHeight = `${r * a + l}px`;
491
- const y = e(this, k).querySelector("nine-table-sheets-body");
492
- y && (y.style.overflowY = s > r ? "auto" : "hidden");
497
+ const i = ((R = t.getRowCount) == null ? void 0 : R.call(t)) || 0, n = parseInt(s.getAttribute("max-display-row"), 10) || 10, l = Math.min(i, n), r = t.querySelector("tbody tr") || t.querySelector("tr"), c = r ? r.getBoundingClientRect().height : 32, u = e(this, T).querySelector("nine-table-header"), o = e(this, T).querySelector("nine-table-sheets-footer"), b = u ? u.getBoundingClientRect().height : 40, h = o ? o.getBoundingClientRect().height : 32, d = b + h + 16, S = l * c + d;
498
+ s.style.height = `${S}px`, s.style.maxHeight = `${n * c + d}px`;
499
+ const v = e(this, T).querySelector("nine-table-sheets-body");
500
+ v && (v.style.overflowY = i > n ? "auto" : "hidden");
493
501
  }, "#applyAutoHeight"));
494
- m(this, F, /* @__PURE__ */ b(() => {
495
- const i = e(this, k).host, s = Array.from(i.children).filter((u) => u.tagName === "TABLE"), r = i.getAttribute("auto-height") === "true", g = s.map((u, n) => `<nine-table-sheet class="${n === 0 ? "active" : ""}" data-index="${n}"></nine-table-sheet>`).join(""), h = s.map((u, n) => `<div class="nine-tab-item ${n === 0 ? "active" : ""}" data-index="${n}">Sheet ${n + 1}</div>`).join("");
496
- e(this, k).innerHTML = `
502
+ g(this, G, /* @__PURE__ */ a(() => {
503
+ const s = e(this, T).host, i = Array.from(s.children).filter((u) => u.tagName === "TABLE"), n = s.getAttribute("auto-height") === "true", l = i.map((u, o) => `<nine-table-sheet class="${o === 0 ? "active" : ""}" data-index="${o}"></nine-table-sheet>`).join(""), r = i.map((u, o) => `<div class="nine-tab-item ${o === 0 ? "active" : ""}" data-index="${o}">Sheet ${o + 1}</div>`).join("");
504
+ e(this, T).innerHTML = `
497
505
  <style>
498
506
  :host {
499
507
  display: flex;
500
508
  flex-direction: column;
501
509
  position: relative;
502
510
  overflow: hidden;
503
- height: ${r ? "auto" : "100%"};
511
+ height: ${n ? "auto" : "100%"};
504
512
  background: #fff;
505
513
  }
506
514
  nine-table-header { height: 40px; display: block; flex-shrink: 0; border-bottom: 1px solid #e5e7eb; background: #fff; }
@@ -581,9 +589,9 @@ const _ = class _ {
581
589
  <nine-table-body>
582
590
  <nine-table-summary></nine-table-summary>
583
591
  <nine-table-sheets>
584
- <nine-table-sheets-body>${g}</nine-table-sheets-body>
592
+ <nine-table-sheets-body>${l}</nine-table-sheets-body>
585
593
  <nine-table-sheets-footer>
586
- <div class="nine-tab-bar">${h}</div>
594
+ <div class="nine-tab-bar">${r}</div>
587
595
  <div class="sheets-counter">Total : <span id="row-count">0</span></div>
588
596
  </nine-table-sheets-footer>
589
597
  </nine-table-sheets>
@@ -591,33 +599,229 @@ const _ = class _ {
591
599
  </nine-table-body>
592
600
  <nine-table-footer></nine-table-footer>
593
601
  `;
594
- const a = e(this, k).querySelectorAll("nine-table-sheet");
595
- a == null || a.forEach((u, n) => {
596
- s[n] && setTimeout(() => {
597
- u.init(s[n]), r && e(this, H).call(this, i);
602
+ const c = e(this, T).querySelectorAll("nine-table-sheet");
603
+ c == null || c.forEach((u, o) => {
604
+ i[o] && setTimeout(() => {
605
+ u.init(i[o]), n && e(this, X).call(this, s);
598
606
  });
599
607
  });
600
608
  }, "#render"));
601
- w(this, k, i), e(this, F).call(this), e(this, j).call(this);
609
+ m(this, T, s), e(this, G).call(this), e(this, j).call(this);
610
+ }
611
+ };
612
+ T = new WeakMap(), N = new WeakMap(), j = new WeakMap(), X = new WeakMap(), G = new WeakMap(), a(pe, "LayoutManager");
613
+ let ae = pe;
614
+ var A, z;
615
+ const ye = class ye {
616
+ constructor(s) {
617
+ g(this, A);
618
+ g(this, z, -1);
619
+ x(this, "count", /* @__PURE__ */ a(() => e(this, A).rawRecords.length, "count"));
620
+ m(this, A, s);
621
+ }
622
+ get at() {
623
+ return e(this, z);
624
+ }
625
+ set at(s) {
626
+ var i, n;
627
+ m(this, z, parseInt(s, 10));
628
+ const t = ((n = (i = e(this, A).owner).querySelector) == null ? void 0 : n.call(i, ".ng-container-body")) || e(this, A).owner.body;
629
+ t && !t.querySelector(`tbody.bindable tr[data-row="${e(this, z)}"]`) && setTimeout(() => {
630
+ var l, r;
631
+ (r = (l = e(this, A).owner).scrollTo_V1) == null || r.call(l, e(this, z));
632
+ });
602
633
  }
603
634
  };
604
- k = new WeakMap(), M = new WeakMap(), j = new WeakMap(), H = new WeakMap(), F = new WeakMap(), b(_, "LayoutManager");
605
- let U = _;
606
- var W;
607
- const ee = class ee extends HTMLElement {
635
+ A = new WeakMap(), z = new WeakMap(), a(ye, "ngRow");
636
+ let ce = ye;
637
+ var E, w, _, B, J, C, Q, V, ee, te, D;
638
+ const we = class we {
639
+ constructor(s, t) {
640
+ g(this, E);
641
+ g(this, w);
642
+ g(this, _, []);
643
+ g(this, B, []);
644
+ g(this, J, 0);
645
+ g(this, C, []);
646
+ g(this, Q, /* @__PURE__ */ a(() => {
647
+ m(this, C, []);
648
+ const s = e(this, E).template || [];
649
+ Array.from(s).forEach((t) => {
650
+ var i;
651
+ e(this, C).push(((i = t.getBoundingClientRect) == null ? void 0 : i.call(t).height) || 24);
652
+ }), (e(this, w).rawRecords || []).forEach((t) => {
653
+ t.__ng || (t.__ng = e(this, V).call(this)), t.__ng.height = e(this, C).slice();
654
+ });
655
+ }, "#initialize"));
656
+ x(this, "set", /* @__PURE__ */ a((s) => {
657
+ this.clear(), this.add(s, !1);
658
+ }, "set"));
659
+ g(this, V, /* @__PURE__ */ a(() => {
660
+ var s;
661
+ return {
662
+ rowState: ((s = ninegrid.ROW_STATE) == null ? void 0 : s.EMPTY) || "EMPTY",
663
+ deleted: !1,
664
+ filtered: !1,
665
+ height: e(this, C).slice(),
666
+ o: {},
667
+ c: {},
668
+ _: [0, 0, 0, 0, "EMPTY", !1, !1, !0, !1, !0, !0, !1, e(this, C).slice(), -1, {}, {}]
669
+ };
670
+ }, "#getDefaultMeta"));
671
+ x(this, "reset", /* @__PURE__ */ a(() => {
672
+ m(this, _, []), m(this, B, []);
673
+ }, "reset"));
674
+ x(this, "clear", /* @__PURE__ */ a(() => {
675
+ var s;
676
+ e(this, w).rawRecords = [], m(this, _, []), m(this, B, []), (s = e(this, w).viewRecords) != null && s.reset && e(this, w).viewRecords.reset();
677
+ }, "clear"));
678
+ g(this, ee, /* @__PURE__ */ a((s) => {
679
+ var n;
680
+ Array.isArray(s) || (s = [s]);
681
+ const t = typeof ((n = e(this, E).fields) == null ? void 0 : n.get) == "function" ? e(this, E).fields.get() : Object.keys(s[0] || {}), i = [];
682
+ return s.forEach((l) => {
683
+ const r = { v: [] };
684
+ t.forEach((c) => {
685
+ r.v.push(l[c] !== void 0 && l[c] !== null ? l[c] : "");
686
+ }), i.push(r);
687
+ }), i;
688
+ }, "#json2Array"));
689
+ g(this, te, /* @__PURE__ */ a((s) => (Array.isArray(s) || (s = [s]), s.forEach((t) => {
690
+ var i;
691
+ t.__ng = e(this, V).call(this), t.__ng.rowid = this.nextId, t.__ng.rowState = ((i = ninegrid.ROW_STATE) == null ? void 0 : i.INSERT) || "INSERT", t.__ng._[0] = t.__ng.rowid;
692
+ }), s), "#defaultInsert"));
693
+ x(this, "add", /* @__PURE__ */ a((s, t = !0) => {
694
+ var l;
695
+ s === void 0 && (s = {});
696
+ const i = e(this, ee).call(this, s);
697
+ e(this, w).rawRecords = e(this, w).rawRecords.concat(e(this, te).call(this, i)), this.resetRecords();
698
+ const n = this.count() - 1;
699
+ return t || i.forEach((r, c) => {
700
+ var o;
701
+ const u = e(this, w).rawRecords[n - c];
702
+ u && (u.__ng.rowState = ((o = ninegrid.ROW_STATE) == null ? void 0 : o.EMPTY) || "EMPTY");
703
+ }), (l = e(this, w).viewRecords) != null && l.reset && e(this, w).viewRecords.reset(), n;
704
+ }, "add"));
705
+ x(this, "delete", /* @__PURE__ */ a((s) => {
706
+ var i;
707
+ let t = [];
708
+ Array.isArray(s) ? t = s : typeof s > "u" ? t = [e(this, w).owner.row.at] : t = [parseInt(s, 10)], t.sort((n, l) => l - n).forEach((n) => {
709
+ if (e(this, _)[n]) {
710
+ const l = e(this, _)[n].__ng.rowid;
711
+ e(this, _)[n].__ng.rowState === "INSERT" ? e(this, w).rawRecords = e(this, w).rawRecords.filter((r) => r.__ng.rowid !== l) : e(this, w).rawRecords.forEach((r) => {
712
+ var c;
713
+ r.__ng.rowid === l && (r.__ng.deleted = !0, r.__ng.rowState = ((c = ninegrid.ROW_STATE) == null ? void 0 : c.DELETE) || "DELETE");
714
+ });
715
+ }
716
+ }), this.resetRecords(), (i = e(this, w).viewRecords) != null && i.reset && e(this, w).viewRecords.reset();
717
+ }, "delete"));
718
+ x(this, "setValue", /* @__PURE__ */ a((s, t, i) => {
719
+ var u, o;
720
+ s = parseInt(s, 10);
721
+ const l = (typeof ((u = e(this, E).fields) == null ? void 0 : u.get) == "function" ? e(this, E).fields.get() : []).indexOf(t);
722
+ if (l < 0) return;
723
+ const r = this.getValidData()[s];
724
+ if (!r) return;
725
+ const c = r.v[l];
726
+ c !== i && r.__ng.rowState !== "INSERT" && (r.__ng.o.hasOwnProperty(t) || (r.__ng.o[t] = c), r.__ng.rowState = ((o = ninegrid.ROW_STATE) == null ? void 0 : o.UPDATE) || "UPDATE"), r.v[l] = i, e(this, w).owner.refreshData && e(this, w).owner.refreshData(s);
727
+ }, "setValue"));
728
+ x(this, "resetRecords", /* @__PURE__ */ a(() => {
729
+ m(this, B, e(this, w).rawRecords.filter((s) => !s.__ng.deleted)), m(this, _, e(this, w).rawRecords.filter((s) => !s.__ng.deleted && !s.__ng.filtered)), e(this, w).rawRecords.forEach((s, t) => {
730
+ s.__ng.rowidx = t;
731
+ }), e(this, _).forEach((s, t) => {
732
+ s.__ng.i = t;
733
+ });
734
+ }, "resetRecords"));
735
+ x(this, "getValidData", /* @__PURE__ */ a(() => (e(this, _).length === 0 && e(this, w).rawRecords.length > 0 && this.resetRecords(), e(this, _)), "getValidData"));
736
+ g(this, D, /* @__PURE__ */ a((s) => {
737
+ var i;
738
+ if (!s) return s;
739
+ const t = typeof ((i = e(this, E).fields) == null ? void 0 : i.get) == "function" ? e(this, E).fields.get() : [];
740
+ return Array.isArray(s) ? s.filter((n) => !n.__ng.deleted).map((n) => {
741
+ const l = {};
742
+ return t.forEach((r, c) => {
743
+ l[r] = n.v ? n.v[c] : n[r];
744
+ }), l.__ng = n.__ng, l;
745
+ }) : s;
746
+ }, "#conv2"));
747
+ x(this, "count", /* @__PURE__ */ a(() => this.getValidData().length, "count"));
748
+ x(this, "get", /* @__PURE__ */ a((s, t) => {
749
+ var l;
750
+ const i = this.getValidData();
751
+ if (!i || i.length <= 0) return;
752
+ if (s == null) return e(this, D).call(this, i);
753
+ if (s < 0 || s >= i.length) return null;
754
+ const n = typeof ((l = e(this, E).fields) == null ? void 0 : l.get) == "function" ? e(this, E).fields.get() : [];
755
+ if (t != null) {
756
+ const r = n.indexOf(t);
757
+ return r >= 0 ? i[s].v[r] : null;
758
+ }
759
+ return e(this, D).call(this, i[s]);
760
+ }, "get"));
761
+ m(this, E, s), m(this, w, t), e(this, Q).call(this);
762
+ }
763
+ get source() {
764
+ return e(this, D).call(this, e(this, w).rawRecords);
765
+ }
766
+ set source(s) {
767
+ this.clear(), this.add(s, !1);
768
+ }
769
+ get nextId() {
770
+ return ++Re(this, J)._;
771
+ }
772
+ };
773
+ E = new WeakMap(), w = new WeakMap(), _ = new WeakMap(), B = new WeakMap(), J = new WeakMap(), C = new WeakMap(), Q = new WeakMap(), V = new WeakMap(), ee = new WeakMap(), te = new WeakMap(), D = new WeakMap(), a(we, "ngData");
774
+ let he = we;
775
+ const me = class me {
776
+ constructor(s) {
777
+ this.owner = s, this.row = new ce(this), this.data = new he(s, this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
778
+ var t;
779
+ (t = this.owner.view) != null && t.redraw && this.owner.view.redraw();
780
+ }, this.setDataSource = (t) => {
781
+ this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(t || []);
782
+ }, this.getRowState = (t) => {
783
+ var n, l;
784
+ const i = parseInt(t, 10);
785
+ if (!(i >= this.data.count()))
786
+ return (l = (n = this.data.getValidData()[i]) == null ? void 0 : n.__ng) == null ? void 0 : l.rowState;
787
+ }, this.getRowPosition = () => this.row.at, this.setRowPosition = (t) => {
788
+ this.row.at = t;
789
+ }, 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) => {
790
+ t = parseInt(t, 10), this.data.setValue(t, i, n);
791
+ }, this.setDataSource([]);
792
+ }
793
+ };
794
+ a(me, "ngDataManager");
795
+ let de = me;
796
+ var O, se;
797
+ const ve = class ve extends HTMLElement {
608
798
  constructor() {
609
799
  super();
610
- m(this, W, !1);
611
- this.attachShadow({ mode: "open" });
800
+ //#created = false;
801
+ g(this, O);
802
+ g(this, se);
803
+ this.attachShadow({ mode: "open" }), m(this, O, new de(this));
612
804
  }
613
805
  connectedCallback() {
614
- e(this, W) || (this.layoutManager = new U(this.shadowRoot), w(this, W, !0), z.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } })));
806
+ m(this, se, new ae(this.shadowRoot)), Y.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
615
807
  }
616
808
  disconnectedCallback() {
617
- z.log("NineTable disconnected.");
809
+ Y.log("NineTable disconnected.");
810
+ }
811
+ // 🎯 μ™ΈλΆ€μ—μ„œ grid.data.set(...) ν˜•νƒœλ‘œ μ ‘κ·Όν•  수 μžˆλ„λ‘ 데이터 λ§€λ‹ˆμ € μ˜€ν”ˆ
812
+ get data() {
813
+ return e(this, O).data;
814
+ }
815
+ // 🎯 ν–‰(row) κ΄€λ ¨ μ œμ–΄ μ ‘κ·Όμž μ˜€ν”ˆ
816
+ get row() {
817
+ return e(this, O).row;
818
+ }
819
+ // 🎯 전체 데이터 λ§€λ‹ˆμ € μ ‘κ·Ό ν•„μš”ν•  경우
820
+ get dataManager() {
821
+ return e(this, O);
618
822
  }
619
823
  };
620
- W = new WeakMap(), b(ee, "NineTable");
621
- let G = ee;
622
- customElements.get("nine-table") || customElements.define("nine-table", G);
824
+ O = new WeakMap(), se = new WeakMap(), a(ve, "NineTable");
825
+ let fe = ve;
826
+ customElements.get("nine-table") || customElements.define("nine-table", fe);
623
827
  //# sourceMappingURL=nine-table.js.map