@ninebone/table 0.0.95 → 0.0.97

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.
@@ -2,93 +2,93 @@ var te = Object.defineProperty;
2
2
  var ne = (p) => {
3
3
  throw TypeError(p);
4
4
  };
5
- var oe = (p, i, t) => i in p ? te(p, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : p[i] = t;
6
- var u = (p, i) => te(p, "name", { value: i, configurable: !0 });
7
- var C = (p, i, t) => oe(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)), y = (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), S = (p, i, t, r) => (ie(p, i, "write to private field"), r ? r.call(p, t) : i.set(p, t), t);
9
- import { trace as se } from "@ninebone/util";
10
- const J = class J extends se.constructor {
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 C = (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)), y = (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 {
11
11
  constructor() {
12
12
  super(), this.init("nine-table", "green");
13
13
  }
14
14
  };
15
- u(J, "Trace");
16
- let P = J;
17
- const x = new P();
18
- var k, B, h, R, A, T, z, $, N;
15
+ b(J, "Trace");
16
+ let Y = J;
17
+ const L = new Y();
18
+ var k, I, h, R, A, $, z, T, N;
19
19
  const Q = class Q extends HTMLElement {
20
20
  constructor() {
21
21
  super();
22
22
  y(this, k);
23
- y(this, B, !1);
23
+ y(this, I, !1);
24
24
  y(this, h);
25
25
  y(this, R);
26
26
  y(this, A);
27
- y(this, T);
28
- y(this, z, /* @__PURE__ */ u(() => {
27
+ y(this, $);
28
+ y(this, z, /* @__PURE__ */ b(() => {
29
29
  if (!e(this, k)) return;
30
30
  const t = e(this, k).querySelector(".ng-container-body");
31
- t && (S(this, T, new ResizeObserver(() => {
31
+ t && (w(this, $, new ResizeObserver(() => {
32
32
  this.refresh();
33
- })), e(this, T).observe(t));
33
+ })), e(this, $).observe(t));
34
34
  }, "#observeResize"));
35
- C(this, "refresh", /* @__PURE__ */ u(() => {
36
- if (x.log("refresh() 호출됨"), !e(this, k) || !e(this, h)) {
37
- x.log("refresh() 중단: owner 또는 elements가 없음");
35
+ C(this, "refresh", /* @__PURE__ */ b(() => {
36
+ if (L.log("refresh() 호출됨"), !e(this, k) || !e(this, h)) {
37
+ L.log("refresh() 중단: owner 또는 elements가 없음");
38
38
  return;
39
39
  }
40
- const t = e(this, h).container, r = t.querySelector("table");
41
- if (!r) {
42
- x.log("refresh() 중단: table 요소를 찾을 수 없음");
40
+ const t = e(this, h).container, s = t.querySelector("table");
41
+ if (!s) {
42
+ L.log("refresh() 중단: table 요소를 찾을 수 없음");
43
43
  return;
44
44
  }
45
- const o = e(this, h).track, g = e(this, h).thumb, d = e(this, k).querySelector(".ng-container-bottom"), a = t.clientWidth, b = r.scrollWidth;
46
- if (x.log("refresh 체크 -> bodyWidth:", a, "tableWidth:", b), a !== 0 && b > a)
45
+ const o = e(this, h).track, g = e(this, h).thumb, d = e(this, k).querySelector(".ng-container-bottom"), a = t.clientWidth, u = s.scrollWidth;
46
+ if (L.log("refresh 체크 -> bodyWidth:", a, "tableWidth:", u), a !== 0 && u > a)
47
47
  d && (d.style.display = "flex");
48
48
  else {
49
- x.log("refresh: 테이블 너비가 컨테이너보다 작거나 같음 (스크롤바 숨김)"), d && (d.style.display = "none");
49
+ L.log("refresh: 테이블 너비가 컨테이너보다 작거나 같음 (스크롤바 숨김)"), d && (d.style.display = "none");
50
50
  return;
51
51
  }
52
52
  const n = o.clientWidth;
53
53
  if (n <= 0) return;
54
- const f = Math.max(Math.min(n * (a / b), n), 20);
54
+ const f = Math.max(Math.min(n * (a / u), n), 20);
55
55
  g.style.width = `${f}px`;
56
- const s = parseInt(r.style.left || 0, 10);
57
- let l = parseInt(Math.abs(s) * n / b, 10);
58
- l < 0 && (l = 0);
56
+ const l = parseInt(s.style.left || 0, 10);
57
+ let r = parseInt(Math.abs(l) * n / u, 10);
58
+ r < 0 && (r = 0);
59
59
  const c = n - f;
60
- l > c && (l = c), g.style.left = `${l}px`, e(this, h).left.disabled = l === 0, e(this, h).right.disabled = l >= c - 1;
60
+ r > c && (r = c), g.style.left = `${r}px`, e(this, h).left.disabled = r === 0, e(this, h).right.disabled = r >= c - 1;
61
61
  }, "refresh"));
62
- y(this, $, /* @__PURE__ */ u((t) => {
62
+ y(this, T, /* @__PURE__ */ b((t) => {
63
63
  if (!e(this, h)) return !1;
64
- const r = e(this, h).container, o = r.querySelector("table");
64
+ const s = e(this, h).container, o = s.querySelector("table");
65
65
  if (!o) return !1;
66
66
  const g = e(this, h).track.getBoundingClientRect(), d = e(this, h).thumb.clientWidth;
67
67
  let a = t;
68
68
  a < 0 && (a = 0);
69
- const b = g.width - d;
70
- a > b && (a = b), a = parseInt(a, 10), e(this, h).thumb.style.left = `${a}px`, e(this, h).left.disabled = a === 0, e(this, h).right.disabled = a >= b - 1;
71
- const n = r.clientWidth, f = o.scrollWidth;
72
- let s = b > 0 ? -a * (f - n) / b : 0;
73
- return -s > f - n && (s = -(f - n)), -s + 5 > f - n && (s = -(f - n)), n >= f && (s = 0), e(this, k).querySelectorAll(".ng-container-left table, .ng-container-body table, .ng-container-right table").forEach((c) => {
74
- c.style.left = `${s}px`;
75
- }), a > 0 && a < b - 1;
69
+ const u = g.width - d;
70
+ a > u && (a = u), a = parseInt(a, 10), e(this, h).thumb.style.left = `${a}px`, e(this, h).left.disabled = a === 0, e(this, h).right.disabled = a >= u - 1;
71
+ const n = s.clientWidth, f = o.scrollWidth;
72
+ let l = u > 0 ? -a * (f - n) / u : 0;
73
+ return -l > f - n && (l = -(f - n)), -l + 5 > f - n && (l = -(f - n)), n >= f && (l = 0), e(this, k).querySelectorAll(".ng-container-left table, .ng-container-body table, .ng-container-right table").forEach((c) => {
74
+ c.style.left = `${l}px`;
75
+ }), a > 0 && a < u - 1;
76
76
  }, "#thumbMoveTo"));
77
- y(this, N, /* @__PURE__ */ u(() => {
78
- const t = /* @__PURE__ */ u((o) => {
77
+ y(this, N, /* @__PURE__ */ b(() => {
78
+ const t = /* @__PURE__ */ b((o) => {
79
79
  clearInterval(e(this, R)), clearInterval(e(this, A));
80
80
  const g = e(this, h).track.getBoundingClientRect(), d = e(this, h).thumb.getBoundingClientRect();
81
- e(this, $).call(this, d.x - g.x + o), S(this, R, setInterval(() => {
82
- clearInterval(e(this, R)), S(this, A, setInterval(() => {
83
- const a = e(this, h).track.getBoundingClientRect(), b = e(this, h).thumb.getBoundingClientRect();
84
- e(this, $).call(this, b.x - a.x + o) || clearInterval(e(this, A));
81
+ e(this, T).call(this, d.x - g.x + o), w(this, R, setInterval(() => {
82
+ clearInterval(e(this, R)), w(this, A, setInterval(() => {
83
+ const a = e(this, h).track.getBoundingClientRect(), u = e(this, h).thumb.getBoundingClientRect();
84
+ e(this, T).call(this, u.x - a.x + o) || clearInterval(e(this, A));
85
85
  }, 10));
86
86
  }, 500));
87
- }, "delayScroll"), r = /* @__PURE__ */ u(() => {
87
+ }, "delayScroll"), s = /* @__PURE__ */ b(() => {
88
88
  clearInterval(e(this, R)), clearInterval(e(this, A));
89
89
  }, "clearTimer");
90
90
  ["mouseup", "mouseleave", "touchend"].forEach((o) => {
91
- e(this, h).left.addEventListener(o, r), e(this, h).right.addEventListener(o, r), e(this, h).track.addEventListener(o, r);
91
+ e(this, h).left.addEventListener(o, s), e(this, h).right.addEventListener(o, s), e(this, h).track.addEventListener(o, s);
92
92
  }), e(this, h).left.addEventListener("mousedown", (o) => {
93
93
  o.button === 0 && t(-10);
94
94
  }), e(this, h).right.addEventListener("mousedown", (o) => {
@@ -97,26 +97,23 @@ const Q = class Q extends HTMLElement {
97
97
  if (o.button !== 0) return;
98
98
  o.preventDefault();
99
99
  const g = e(this, h).track.getBoundingClientRect(), d = e(this, h).thumb.clientWidth;
100
- e(this, $).call(this, o.clientX - g.left - d / 2);
100
+ e(this, T).call(this, o.clientX - g.left - d / 2);
101
101
  }), e(this, h).thumb.addEventListener("mousedown", (o) => {
102
102
  if (o.button !== 0) return;
103
- o.stopPropagation(), o.preventDefault(), S(this, B, !0), this.shiftX = o.clientX - e(this, h).thumb.getBoundingClientRect().left;
104
- const g = /* @__PURE__ */ u((a) => {
105
- if (!e(this, B)) return;
106
- const b = e(this, h).track.getBoundingClientRect();
107
- e(this, $).call(this, a.clientX - b.left - this.shiftX);
108
- }, "onMouseMove"), d = /* @__PURE__ */ u(() => {
109
- S(this, B, !1), r(), document.removeEventListener("mousemove", g), document.removeEventListener("mouseup", d), this.refresh();
103
+ o.stopPropagation(), o.preventDefault(), w(this, I, !0), this.shiftX = o.clientX - e(this, h).thumb.getBoundingClientRect().left;
104
+ const g = /* @__PURE__ */ b((a) => {
105
+ if (!e(this, I)) return;
106
+ const u = e(this, h).track.getBoundingClientRect();
107
+ e(this, T).call(this, a.clientX - u.left - this.shiftX);
108
+ }, "onMouseMove"), d = /* @__PURE__ */ b(() => {
109
+ w(this, I, !1), s(), document.removeEventListener("mousemove", g), document.removeEventListener("mouseup", d), this.refresh();
110
110
  }, "onMouseUp");
111
111
  document.addEventListener("mousemove", g), document.addEventListener("mouseup", d);
112
112
  });
113
113
  }, "#init"));
114
114
  }
115
115
  connectedCallback() {
116
- if (x.log("NineTableHScrollBar connectedCallback 진입"), S(this, k, this.getRootNode().host), !e(this, k)) {
117
- x.log("NineTableHScrollBar: #owner(host)를 찾을 수 없음");
118
- return;
119
- }
116
+ if (w(this, k, this.closest("nine-table-sheet") || this.getRootNode().host), !e(this, k)) return;
120
117
  this.innerHTML = `
121
118
  <style>
122
119
  nine-table-hscrollbar {
@@ -179,88 +176,89 @@ const Q = class Q extends HTMLElement {
179
176
  <button class='ng-scroll-left' disabled><div class='ng-scroll-icon'></div></button>
180
177
  <div class='ng-scroll-track'><div class='ng-scroll-thumb'></div></div>
181
178
  <button class='ng-scroll-right' disabled><div class='ng-scroll-icon'></div></button>
182
- `, requestAnimationFrame(() => {
183
- x.log(e(this, k));
184
- const t = e(this, k).querySelector(".ng-container-body");
185
- if (!t) {
186
- x.log("NineTableHScrollBar: .ng-container-body 요소를 찾지 못함");
179
+ `;
180
+ const t = /* @__PURE__ */ b(() => {
181
+ const s = e(this, k).querySelector(".ng-container-body");
182
+ if (!s) {
183
+ setTimeout(t, 10);
187
184
  return;
188
185
  }
189
- S(this, h, {
190
- container: t,
186
+ w(this, h, {
187
+ container: s,
191
188
  track: this.querySelector(".ng-scroll-track"),
192
189
  thumb: this.querySelector(".ng-scroll-thumb"),
193
190
  left: this.querySelector(".ng-scroll-left"),
194
191
  right: this.querySelector(".ng-scroll-right")
195
- }), x.log("NineTableHScrollBar elements 바인딩 완료:", e(this, h)), e(this, N).call(this), e(this, z).call(this), this.refresh();
196
- });
192
+ }), e(this, N).call(this), e(this, z).call(this), this.refresh();
193
+ }, "initWhenReady");
194
+ t();
197
195
  }
198
196
  disconnectedCallback() {
199
- e(this, T) && e(this, T).disconnect();
197
+ e(this, $) && e(this, $).disconnect();
200
198
  }
201
199
  };
202
- k = new WeakMap(), B = new WeakMap(), h = new WeakMap(), R = new WeakMap(), A = new WeakMap(), T = new WeakMap(), z = new WeakMap(), $ = new WeakMap(), N = new WeakMap(), u(Q, "NineTableHScrollBar");
203
- let Y = Q;
204
- customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Y);
205
- var L, X;
206
- const H = class H extends HTMLElement {
200
+ k = new WeakMap(), I = new WeakMap(), h = new WeakMap(), R = new WeakMap(), A = new WeakMap(), $ = new WeakMap(), z = new WeakMap(), T = new WeakMap(), N = new WeakMap(), b(Q, "NineTableHScrollBar");
201
+ let D = Q;
202
+ customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", D);
203
+ var q, X;
204
+ const M = class M extends HTMLElement {
207
205
  constructor() {
208
206
  super();
209
- y(this, L, null);
210
- C(this, "init", /* @__PURE__ */ u((t) => {
207
+ y(this, q, null);
208
+ C(this, "init", /* @__PURE__ */ b((t) => {
211
209
  if (!t) return;
212
- const r = /* @__PURE__ */ u((n) => {
213
- const f = /* @__PURE__ */ u((l) => {
214
- if (l.querySelector("colgroup")) return;
215
- const c = l.querySelector("tbody tr") || l.querySelector("tr"), v = c ? c.querySelectorAll("th, td").length : 1, m = document.createElement("colgroup"), q = Math.max(Math.floor((l.clientWidth || 600) / v), 100);
216
- for (let w = 0; w < v; w++) {
217
- const K = document.createElement("col");
218
- K.setAttribute("width", q), m.appendChild(K);
210
+ const s = /* @__PURE__ */ b((n) => {
211
+ const f = /* @__PURE__ */ b((r) => {
212
+ if (r.querySelector("colgroup")) return;
213
+ const c = r.querySelector("tbody tr") || r.querySelector("tr"), x = c ? c.querySelectorAll("th, td").length : 1, m = document.createElement("colgroup"), S = Math.max(Math.floor((r.clientWidth || 600) / x), 100);
214
+ for (let v = 0; v < x; v++) {
215
+ const P = document.createElement("col");
216
+ P.setAttribute("width", S), m.appendChild(P);
219
217
  }
220
- l.prepend(m);
221
- }, "ensureColgroup"), s = /* @__PURE__ */ u((l) => {
222
- if (l.querySelector("thead")) return;
223
- const c = document.createElement("thead"), v = l.querySelector("colgroup");
224
- v ? v.after(c) : l.prepend(c);
218
+ r.prepend(m);
219
+ }, "ensureColgroup"), l = /* @__PURE__ */ b((r) => {
220
+ if (r.querySelector("thead")) return;
221
+ const c = document.createElement("thead"), x = r.querySelector("colgroup");
222
+ x ? x.after(c) : r.prepend(c);
225
223
  }, "ensureThead");
226
- return f(n), s(n), n.classList.add("nine-table-element"), n;
224
+ return f(n), l(n), n.classList.add("nine-table-element"), n;
227
225
  }, "initializeTable"), o = t.cloneNode(!0);
228
- S(this, L, r(o)), e(this, L).style.display = "table";
229
- const g = this.querySelector(".ng-container-left"), d = this.querySelector(".ng-container-body"), a = this.querySelector(".ng-container-right"), b = /* @__PURE__ */ u((n, f, s = !1) => {
230
- const l = n.cloneNode(!0), c = Array.from(l.querySelectorAll("colgroup col")), v = [];
231
- return c.forEach((m, q) => {
232
- const w = m.getAttribute("fixed");
233
- (s ? !w || w === "" : w === f) || v.push(q);
234
- }), v.reverse().forEach((m) => {
235
- c[m] && c[m].remove(), l.querySelectorAll("tr").forEach((q) => {
236
- const w = q.querySelectorAll("th, td");
237
- w[m] && w[m].remove();
226
+ w(this, q, s(o)), e(this, q).style.display = "table";
227
+ const g = this.querySelector(".ng-container-left"), d = this.querySelector(".ng-container-body"), a = this.querySelector(".ng-container-right"), u = /* @__PURE__ */ b((n, f, l = !1) => {
228
+ const r = n.cloneNode(!0), c = Array.from(r.querySelectorAll("colgroup col")), x = [];
229
+ return c.forEach((m, S) => {
230
+ const v = m.getAttribute("fixed");
231
+ (l ? !v || v === "" : v === f) || x.push(S);
232
+ }), x.reverse().forEach((m) => {
233
+ c[m] && c[m].remove(), r.querySelectorAll("tr").forEach((S) => {
234
+ const v = S.querySelectorAll("th, td");
235
+ v[m] && v[m].remove();
238
236
  });
239
- }), l;
237
+ }), r;
240
238
  }, "filterTableByFixed");
241
239
  if (d) {
242
- const n = b(e(this, L), null, !0);
240
+ const n = u(e(this, q), null, !0);
243
241
  d.innerHTML = "", d.appendChild(n);
244
242
  }
245
243
  if (g) {
246
- const n = b(e(this, L), "left", !1);
244
+ const n = u(e(this, q), "left", !1);
247
245
  let f = 0;
248
- n.querySelectorAll("col").forEach((l) => {
249
- const c = parseInt(l.getAttribute("width"), 10);
246
+ n.querySelectorAll("col").forEach((r) => {
247
+ const c = parseInt(r.getAttribute("width"), 10);
250
248
  isNaN(c) || (f += c);
251
249
  }), g.innerHTML = "", g.appendChild(n);
252
- const s = f > 0 ? f : 0;
253
- g.style.flex = `0 0 ${s}px`, g.style.width = `${s}px`;
250
+ const l = f > 0 ? f : 0;
251
+ g.style.flex = `0 0 ${l}px`, g.style.width = `${l}px`;
254
252
  }
255
253
  if (a) {
256
- const n = b(e(this, L), "right", !1);
254
+ const n = u(e(this, q), "right", !1);
257
255
  let f = 0;
258
- n.querySelectorAll("col").forEach((l) => {
259
- const c = parseInt(l.getAttribute("width"), 10);
256
+ n.querySelectorAll("col").forEach((r) => {
257
+ const c = parseInt(r.getAttribute("width"), 10);
260
258
  isNaN(c) || (f += c);
261
259
  }), a.innerHTML = "", a.appendChild(n);
262
- const s = f > 0 ? f : 0;
263
- a.style.flex = `0 0 ${s}px`, a.style.width = `${s}px`;
260
+ const l = f > 0 ? f : 0;
261
+ a.style.flex = `0 0 ${l}px`, a.style.width = `${l}px`;
264
262
  }
265
263
  if (d) {
266
264
  const n = this.getRowCount();
@@ -272,19 +270,19 @@ const H = class H extends HTMLElement {
272
270
  setTimeout(() => {
273
271
  const n = this.querySelector("nine-table-hscrollbar");
274
272
  n && typeof n.refresh == "function" && n.refresh();
275
- }, 0), x.log(`NineTableSheet 3-split initialized with rows: ${this.getRowCount()}`);
273
+ }, 0), L.log(`NineTableSheet 3-split initialized with rows: ${this.getRowCount()}`);
276
274
  }, "init"));
277
- C(this, "getRowCount", /* @__PURE__ */ u(() => e(this, L) ? e(this, L).querySelectorAll("tbody tr").length : 0, "getRowCount"));
278
- C(this, "scrollToX", /* @__PURE__ */ u((t) => {
279
- const r = this.querySelector(".ng-container-body");
280
- r && (r.scrollLeft = t);
275
+ C(this, "getRowCount", /* @__PURE__ */ b(() => e(this, q) ? e(this, q).querySelectorAll("tbody tr").length : 0, "getRowCount"));
276
+ C(this, "scrollToX", /* @__PURE__ */ b((t) => {
277
+ const s = this.querySelector(".ng-container-body");
278
+ s && (s.scrollLeft = t);
281
279
  }, "scrollToX"));
282
- C(this, "scrollToY", /* @__PURE__ */ u((t) => {
283
- const r = this.querySelector(".ng-container-body");
284
- r && (r.scrollTop = t);
280
+ C(this, "scrollToY", /* @__PURE__ */ b((t) => {
281
+ const s = this.querySelector(".ng-container-body");
282
+ s && (s.scrollTop = t);
285
283
  }, "scrollToY"));
286
- y(this, X, /* @__PURE__ */ u(() => {
287
- const t = H.SCROLLBAR_SIZE;
284
+ y(this, X, /* @__PURE__ */ b(() => {
285
+ const t = M.SCROLLBAR_SIZE;
288
286
  this.innerHTML = `
289
287
  <style>
290
288
  nine-table-sheet {
@@ -404,65 +402,65 @@ const H = class H extends HTMLElement {
404
402
  e(this, X).call(this);
405
403
  }
406
404
  disconnectedCallback() {
407
- this.innerHTML = "", x.log("NineTableSheet destroyed.");
405
+ this.innerHTML = "", L.log("NineTableSheet destroyed.");
408
406
  }
409
407
  };
410
- L = new WeakMap(), X = new WeakMap(), u(H, "NineTableSheet"), C(H, "SCROLLBAR_SIZE", 16);
411
- let D = H;
412
- customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", D);
408
+ q = new WeakMap(), X = new WeakMap(), b(M, "NineTableSheet"), C(M, "SCROLLBAR_SIZE", 16);
409
+ let F = M;
410
+ customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", F);
413
411
  var O;
414
412
  const V = class V extends HTMLElement {
415
413
  constructor() {
416
414
  super();
417
- y(this, O, /* @__PURE__ */ u(() => {
415
+ y(this, O, /* @__PURE__ */ b(() => {
418
416
  const t = this.querySelector(".nine-tab-bar");
419
- t && (t.addEventListener("click", (r) => {
420
- const o = r.target.closest(".nine-tab-item");
417
+ t && (t.addEventListener("click", (s) => {
418
+ const o = s.target.closest(".nine-tab-item");
421
419
  if (!o) return;
422
- const g = r.ctrlKey || r.metaKey || r.shiftKey, d = parseInt(o.dataset.index, 10);
420
+ const g = s.ctrlKey || s.metaKey || s.shiftKey, d = parseInt(o.dataset.index, 10);
423
421
  this.switchSheet(d, g);
424
422
  }), this.switchSheet(0, !1));
425
423
  }, "#init"));
426
- C(this, "switchSheet", /* @__PURE__ */ u((t, r = !1) => {
427
- const o = /* @__PURE__ */ u(() => {
428
- const s = this.querySelector("nine-table-sheets-body");
429
- s.querySelectorAll("nine-splitter").forEach((c) => {
430
- const v = parseInt(c.dataset.splitIndex, 10), m = s.querySelector(`nine-table-sheet[data-index="${v - 1}"]`), q = s.querySelector(`nine-table-sheet[data-index="${v}"]`);
431
- m && q && m.classList.contains("active") && q.classList.contains("active") ? c.classList.add("active") : c.classList.remove("active");
424
+ C(this, "switchSheet", /* @__PURE__ */ b((t, s = !1) => {
425
+ const o = /* @__PURE__ */ b(() => {
426
+ const l = this.querySelector("nine-table-sheets-body");
427
+ l.querySelectorAll("nine-splitter").forEach((c) => {
428
+ const x = parseInt(c.dataset.splitIndex, 10), m = l.querySelector(`nine-table-sheet[data-index="${x - 1}"]`), S = l.querySelector(`nine-table-sheet[data-index="${x}"]`);
429
+ m && S && m.classList.contains("active") && S.classList.contains("active") ? c.classList.add("active") : c.classList.remove("active");
432
430
  });
433
- }, "updateSplitters"), g = this.querySelector(".nine-tab-bar"), d = this.querySelector("nine-table-sheets-body"), a = g.querySelectorAll(".nine-tab-item"), b = d.querySelectorAll("nine-table-sheet");
431
+ }, "updateSplitters"), g = this.querySelector(".nine-tab-bar"), d = this.querySelector("nine-table-sheets-body"), a = g.querySelectorAll(".nine-tab-item"), u = d.querySelectorAll("nine-table-sheet");
434
432
  if (!a[t]) return;
435
- if (!r)
436
- a.forEach((s, l) => {
437
- s.classList.toggle("active", l === t);
438
- const c = d.querySelector(`nine-table-sheet[data-index="${l}"]`);
433
+ if (!s)
434
+ a.forEach((l, r) => {
435
+ l.classList.toggle("active", r === t);
436
+ const c = d.querySelector(`nine-table-sheet[data-index="${r}"]`);
439
437
  c && (c.style.flex = "");
440
- }), b.forEach((s, l) => {
441
- s.classList.toggle("active", l === t);
438
+ }), u.forEach((l, r) => {
439
+ l.classList.toggle("active", r === t);
442
440
  });
443
441
  else {
444
- const s = a[t], l = g.querySelectorAll(".nine-tab-item.active");
445
- if (s.classList.contains("active") && l.length <= 1)
442
+ const l = a[t], r = g.querySelectorAll(".nine-tab-item.active");
443
+ if (l.classList.contains("active") && r.length <= 1)
446
444
  return;
447
- s.classList.toggle("active");
445
+ l.classList.toggle("active");
448
446
  const c = d.querySelector(`nine-table-sheet[data-index="${t}"]`);
449
447
  c && (c.classList.toggle("active"), c.classList.contains("active") || (c.style.flex = ""));
450
448
  }
451
449
  const n = Array.from(d.querySelectorAll("nine-table-sheet.active"));
452
450
  if (n.length > 1) {
453
- const s = 1 / n.length;
454
- n.forEach((l) => {
455
- (!l.style.flex || l.style.flex === "1 1 100%") && (l.style.flex = `${s} ${s} 0px`);
451
+ const l = 1 / n.length;
452
+ n.forEach((r) => {
453
+ (!r.style.flex || r.style.flex === "1 1 100%") && (r.style.flex = `${l} ${l} 0px`);
456
454
  });
457
455
  } else
458
- n.forEach((s) => {
459
- s.style.flex = "1 1 100%";
456
+ n.forEach((l) => {
457
+ l.style.flex = "1 1 100%";
460
458
  });
461
459
  o();
462
460
  const f = d.querySelector("nine-table-sheet.active");
463
461
  if (f && typeof f.getRowCount == "function") {
464
- const s = this.querySelector("#row-count");
465
- s && (s.textContent = f.getRowCount().toLocaleString());
462
+ const l = this.querySelector("#row-count");
463
+ l && (l.textContent = f.getRowCount().toLocaleString());
466
464
  }
467
465
  }, "switchSheet"));
468
466
  }
@@ -470,32 +468,32 @@ const V = class V extends HTMLElement {
470
468
  e(this, O).call(this);
471
469
  }
472
470
  };
473
- O = new WeakMap(), u(V, "NineTableSheets");
471
+ O = new WeakMap(), b(V, "NineTableSheets");
474
472
  let Z = V;
475
473
  customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", Z);
476
- var E, I, j, M, F;
474
+ var E, B, j, W, K;
477
475
  const _ = class _ {
478
476
  constructor(i) {
479
477
  y(this, E);
480
- y(this, I, null);
481
- y(this, j, /* @__PURE__ */ u(() => {
478
+ y(this, B, null);
479
+ y(this, j, /* @__PURE__ */ b(() => {
482
480
  const i = e(this, E).host;
483
- i && (S(this, I, new ResizeObserver((t) => {
484
- for (let r of t)
485
- i.getAttribute("auto-height") === "true" && e(this, M).call(this, i);
486
- })), e(this, I).observe(i));
481
+ i && (w(this, B, new ResizeObserver((t) => {
482
+ for (let s of t)
483
+ i.getAttribute("auto-height") === "true" && e(this, W).call(this, i);
484
+ })), e(this, B).observe(i));
487
485
  }, "#observeResize"));
488
- y(this, M, /* @__PURE__ */ u((i) => {
489
- var q, w;
490
- const t = (q = i.shadowRoot) == null ? void 0 : q.querySelector("nine-table-sheet.active");
486
+ y(this, W, /* @__PURE__ */ b((i) => {
487
+ var S, v;
488
+ const t = (S = i.shadowRoot) == null ? void 0 : S.querySelector("nine-table-sheet.active");
491
489
  if (!t) return;
492
- const r = ((w = t.getRowCount) == null ? void 0 : w.call(t)) || 0, o = parseInt(i.getAttribute("max-display-row"), 10) || 10, g = Math.min(r, o), d = t.querySelector("tbody tr") || t.querySelector("tr"), a = d ? d.getBoundingClientRect().height : 32, b = e(this, E).querySelector("nine-table-header"), n = e(this, E).querySelector("nine-table-sheets-footer"), f = b ? b.getBoundingClientRect().height : 40, s = n ? n.getBoundingClientRect().height : 32, c = f + s + 16, v = g * a + c;
493
- i.style.height = `${v}px`, i.style.maxHeight = `${o * a + c}px`;
490
+ const s = ((v = t.getRowCount) == null ? void 0 : v.call(t)) || 0, o = parseInt(i.getAttribute("max-display-row"), 10) || 10, g = Math.min(s, o), d = t.querySelector("tbody tr") || t.querySelector("tr"), a = d ? d.getBoundingClientRect().height : 32, u = e(this, E).querySelector("nine-table-header"), n = e(this, E).querySelector("nine-table-sheets-footer"), f = u ? u.getBoundingClientRect().height : 40, l = n ? n.getBoundingClientRect().height : 32, c = f + l + 16, x = g * a + c;
491
+ i.style.height = `${x}px`, i.style.maxHeight = `${o * a + c}px`;
494
492
  const m = e(this, E).querySelector("nine-table-sheets-body");
495
- m && (m.style.overflowY = r > o ? "auto" : "hidden");
493
+ m && (m.style.overflowY = s > o ? "auto" : "hidden");
496
494
  }, "#applyAutoHeight"));
497
- y(this, F, /* @__PURE__ */ u(() => {
498
- const i = e(this, E).host, r = Array.from(i.children).filter((b) => b.tagName === "TABLE"), o = i.getAttribute("auto-height") === "true", g = r.map((b, n) => `<nine-table-sheet class="${n === 0 ? "active" : ""}" data-index="${n}"></nine-table-sheet>`).join(""), d = r.map((b, n) => `<div class="nine-tab-item ${n === 0 ? "active" : ""}" data-index="${n}">Sheet ${n + 1}</div>`).join("");
495
+ y(this, K, /* @__PURE__ */ b(() => {
496
+ const i = e(this, E).host, s = Array.from(i.children).filter((u) => u.tagName === "TABLE"), o = i.getAttribute("auto-height") === "true", g = s.map((u, n) => `<nine-table-sheet class="${n === 0 ? "active" : ""}" data-index="${n}"></nine-table-sheet>`).join(""), d = s.map((u, n) => `<div class="nine-tab-item ${n === 0 ? "active" : ""}" data-index="${n}">Sheet ${n + 1}</div>`).join("");
499
497
  e(this, E).innerHTML = `
500
498
  <style>
501
499
  :host {
@@ -595,32 +593,32 @@ const _ = class _ {
595
593
  <nine-table-footer></nine-table-footer>
596
594
  `;
597
595
  const a = e(this, E).querySelectorAll("nine-table-sheet");
598
- a == null || a.forEach((b, n) => {
599
- r[n] && setTimeout(() => {
600
- b.init(r[n]), o && e(this, M).call(this, i);
596
+ a == null || a.forEach((u, n) => {
597
+ s[n] && setTimeout(() => {
598
+ u.init(s[n]), o && e(this, W).call(this, i);
601
599
  });
602
600
  });
603
601
  }, "#render"));
604
- S(this, E, i), e(this, F).call(this), e(this, j).call(this);
602
+ w(this, E, i), e(this, K).call(this), e(this, j).call(this);
605
603
  }
606
604
  };
607
- E = new WeakMap(), I = new WeakMap(), j = new WeakMap(), M = new WeakMap(), F = new WeakMap(), u(_, "LayoutManager");
605
+ E = new WeakMap(), B = new WeakMap(), j = new WeakMap(), W = new WeakMap(), K = new WeakMap(), b(_, "LayoutManager");
608
606
  let U = _;
609
- var W;
607
+ var H;
610
608
  const ee = class ee extends HTMLElement {
611
609
  constructor() {
612
610
  super();
613
- y(this, W, !1);
611
+ y(this, H, !1);
614
612
  this.attachShadow({ mode: "open" });
615
613
  }
616
614
  connectedCallback() {
617
- e(this, W) || (this.layoutManager = new U(this.shadowRoot), S(this, W, !0), x.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } })));
615
+ e(this, H) || (this.layoutManager = new U(this.shadowRoot), w(this, H, !0), L.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } })));
618
616
  }
619
617
  disconnectedCallback() {
620
- x.log("NineTable disconnected.");
618
+ L.log("NineTable disconnected.");
621
619
  }
622
620
  };
623
- W = new WeakMap(), u(ee, "NineTable");
621
+ H = new WeakMap(), b(ee, "NineTable");
624
622
  let G = ee;
625
623
  customElements.get("nine-table") || customElements.define("nine-table", G);
626
624
  //# sourceMappingURL=nine-table.js.map