@ninebone/table 0.0.68 → 0.0.71

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,98 +1,355 @@
1
- var P = Object.defineProperty;
2
- var Z = (r) => {
3
- throw TypeError(r);
1
+ var qt = Object.defineProperty;
2
+ var It = (v) => {
3
+ throw TypeError(v);
4
4
  };
5
- var D = (r, t, e) => t in r ? P(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
6
- var c = (r, t) => P(r, "name", { value: t, configurable: !0 });
7
- var q = (r, t, e) => D(r, typeof t != "symbol" ? t + "" : t, e), X = (r, t, e) => t.has(r) || Z("Cannot " + e);
8
- var a = (r, t, e) => (X(r, t, "read from private field"), e ? e.call(r) : t.get(r)), w = (r, t, e) => t.has(r) ? Z("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, e), k = (r, t, e, l) => (X(r, t, "write to private field"), l ? l.call(r, e) : t.set(r, e), e);
9
- import { trace as G } from "@ninebone/util";
10
- const j = class j extends G.constructor {
5
+ var Ht = (v, c, e) => c in v ? qt(v, c, { enumerable: !0, configurable: !0, writable: !0, value: e }) : v[c] = e;
6
+ var l = (v, c) => qt(v, "name", { value: c, configurable: !0 });
7
+ var I = (v, c, e) => Ht(v, typeof c != "symbol" ? c + "" : c, e), $t = (v, c, e) => c.has(v) || It("Cannot " + e);
8
+ var t = (v, c, e) => ($t(v, c, "read from private field"), e ? e.call(v) : c.get(v)), h = (v, c, e) => c.has(v) ? It("Cannot add the same private member more than once") : c instanceof WeakSet ? c.add(v) : c.set(v, e), g = (v, c, e, s) => ($t(v, c, "write to private field"), s ? s.call(v, e) : c.set(v, e), e);
9
+ import { trace as Rt } from "@ninebone/util";
10
+ const vt = class vt extends Rt.constructor {
11
11
  constructor() {
12
12
  super(), this.init("nine-table", "green");
13
13
  }
14
14
  };
15
- c(j, "Trace");
16
- let I = j;
17
- const $ = new I();
18
- var S, R;
19
- const E = class E extends HTMLElement {
15
+ l(vt, "Trace");
16
+ let dt = vt;
17
+ const J = new dt();
18
+ var w, M, b, S, R, Q, U, V, tt, z, et, D, _, B, N;
19
+ const xt = class xt extends HTMLElement {
20
20
  constructor() {
21
21
  super();
22
- w(this, S, null);
23
- q(this, "init", /* @__PURE__ */ c((e) => {
22
+ h(this, w);
23
+ h(this, M);
24
+ h(this, b);
25
+ h(this, S);
26
+ h(this, R);
27
+ h(this, Q);
28
+ h(this, U, 0);
29
+ I(this, "refresh", /* @__PURE__ */ l(() => {
30
+ if (!t(this, w)) return;
31
+ const e = t(this, w).querySelector(".ng-container-body");
24
32
  if (!e) return;
25
- const l = /* @__PURE__ */ c((n) => {
26
- const d = /* @__PURE__ */ c((o) => {
27
- if (o.querySelector("colgroup")) return;
28
- const s = o.querySelector("tbody tr") || o.querySelector("tr"), y = s ? s.querySelectorAll("th, td").length : 1, b = document.createElement("colgroup"), m = Math.max(Math.floor((o.clientWidth || 600) / y), 100);
29
- for (let x = 0; x < y; x++) {
30
- const z = document.createElement("col");
31
- z.setAttribute("width", m), b.appendChild(z);
33
+ const s = $(t(this, b).thumb, this.shadowRoot), o = e.querySelector("table > thead");
34
+ t(this, w).getRowCount;
35
+ const n = $(t(this, b).track).height(), i = $(t(this, b).thumb).height(), u = t(this, w).getRowCount ? t(this, w).getRowCount() : 0;
36
+ if (u <= 10) {
37
+ $(this).hide();
38
+ return;
39
+ } else
40
+ $(this).show();
41
+ const y = o ? o.getBoundingClientRect().height : 0, a = Math.max(Math.min(n * (e.clientHeight - y) / (32 * u), n), 16);
42
+ s[0].dataset.height = a, s.css({ height: a });
43
+ const p = n - t(this, N).call(this);
44
+ if (p <= 0) return;
45
+ let r = 0;
46
+ const d = e.scrollHeight - e.clientHeight;
47
+ d > 0 && (r = parseInt(e.scrollTop / d * p, 10), r > n - i && (r = n - i), r < 0 && (r = 0)), t(this, b).thumb.style.top = r + "px", t(this, b).top.disabled = e.scrollTop <= 0, t(this, b).bottom.disabled = e.scrollTop >= d;
48
+ }, "refresh"));
49
+ I(this, "delayScroll", /* @__PURE__ */ l((e, s, o, n) => {
50
+ clearInterval(t(this, S)), clearInterval(t(this, R));
51
+ const i = t(this, w).querySelector(".ng-container-body");
52
+ i && (i.scrollTop += e * 32), g(this, S, setInterval(() => {
53
+ clearInterval(t(this, S)), g(this, R, setInterval(() => {
54
+ i && (i.scrollTop += e * 32, n && n.call());
55
+ }, o));
56
+ }, s));
57
+ }, "delayScroll"));
58
+ I(this, "stopScroll", /* @__PURE__ */ l(() => {
59
+ clearInterval(t(this, S)), clearInterval(t(this, R));
60
+ }, "stopScroll"));
61
+ h(this, V, /* @__PURE__ */ l(() => {
62
+ const e = /* @__PURE__ */ l((o) => {
63
+ clearInterval(t(this, S)), clearInterval(t(this, R));
64
+ const n = t(this, w).querySelector(".ng-container-body");
65
+ n && (n.scrollTop += o * 32), g(this, S, setInterval(() => {
66
+ clearInterval(t(this, S)), g(this, R, setInterval(() => {
67
+ n && (n.scrollTop += o * 32);
68
+ }, 10));
69
+ }, 500));
70
+ }, "delayScrollAction");
71
+ $(t(this, b).top).on("mousedown", (o) => {
72
+ o.buttons != 1 || o.altKey || o.ctrlKey || o.shiftKey || e(-1);
73
+ }), $(t(this, b).bottom).on("mousedown", (o) => {
74
+ o.buttons != 1 || o.altKey || o.ctrlKey || o.shiftKey || e(1);
75
+ }), $(t(this, b).top).on("touchstart", (o) => {
76
+ e(-1);
77
+ }), $(t(this, b).bottom).on("touchstart", (o) => {
78
+ e(1);
79
+ });
80
+ const s = /* @__PURE__ */ l(() => {
81
+ clearInterval(t(this, S)), clearInterval(t(this, R));
82
+ }, "clearTimer");
83
+ t(this, b).top.ontouchend = t(this, b).bottom.ontouchend = t(this, b).track.ontouchend = t(this, b).top.onmouseup = t(this, b).top.onmouseleave = t(this, b).bottom.onmouseup = t(this, b).bottom.onmouseleave = t(this, b).track.onmouseup = t(this, b).track.onmouseleave = s, $(t(this, b).track).on("mousedown", t(this, z)), $(t(this, b).track).on("touchstart", t(this, tt)), $(t(this, b).thumb).on("mousedown", t(this, _)), $(t(this, b).thumb).on("touchstart", t(this, et)), document.addEventListener("mouseup", (o) => {
84
+ t(this, M) && g(this, M, !1), document.removeEventListener("mousemove", t(this, B));
85
+ }), document.addEventListener("touchend", (o) => {
86
+ g(this, M, !1), document.removeEventListener("touchmove", t(this, D));
87
+ });
88
+ }, "#init"));
89
+ h(this, tt, /* @__PURE__ */ l((e) => {
90
+ e.target.getBoundingClientRect(), e.clientX = e.targetTouches[0].clientX, e.clientY = e.targetTouches[0].clientY, e.buttons = 1, t(this, z).call(this, e);
91
+ }, "#track_onTouchStart"));
92
+ h(this, z, /* @__PURE__ */ l((e) => {
93
+ if (t(this, M) || e.buttons != 1 || e.altKey || e.ctrlKey || e.shiftKey) return;
94
+ e.preventDefault();
95
+ var s = t(this, b).thumb.getBoundingClientRect();
96
+ const o = t(this, w).querySelector(".ng-container-body");
97
+ if (!o) return;
98
+ const n = o.clientHeight, i = e.clientY > s.y ? n : -n;
99
+ o.scrollTop += i, clearInterval(t(this, S)), clearInterval(t(this, R)), g(this, S, setInterval(() => {
100
+ clearInterval(t(this, S)), g(this, R, setInterval(() => {
101
+ var u = t(this, b).thumb.getBoundingClientRect();
102
+ e.clientY > u.y && e.clientY < u.y + u.height ? clearInterval(t(this, R)) : o.scrollTop += e.clientY > u.y ? n : -n;
103
+ }, 10));
104
+ }, 500));
105
+ }, "#track_onMouseDown"));
106
+ h(this, et, /* @__PURE__ */ l((e) => {
107
+ e.clientX = e.targetTouches[0].clientX, e.clientY = e.targetTouches[0].clientY, e.buttons = 1, t(this, _).call(this, e), document.addEventListener("touchmove", t(this, D));
108
+ }, "#thumb_onTouchStart"));
109
+ h(this, D, /* @__PURE__ */ l((e) => {
110
+ e.clientX = e.targetTouches[0].clientX, e.clientY = e.targetTouches[0].clientY, e.buttons = 1, t(this, B).call(this, e);
111
+ }, "#thumb_onTouchMove"));
112
+ h(this, _, /* @__PURE__ */ l((e) => {
113
+ g(this, U, e.clientY), g(this, M, !0), this.shiftY = e.offsetY + t(this, b).track.getBoundingClientRect().y, this.trackHeight = $(t(this, b).track).height(), this.thumbHeight = $(t(this, b).thumb).height(), g(this, Q, !0), document.addEventListener("mousemove", t(this, B));
114
+ }, "#thumb_onMouseDown"));
115
+ h(this, B, /* @__PURE__ */ l((e) => {
116
+ if (!t(this, M)) return;
117
+ e.preventDefault();
118
+ const s = this.trackHeight, o = t(this, N).call(this);
119
+ var n = e.clientY - this.shiftY;
120
+ n < 0 && (n = 0), n + o > s && (n = parseInt(s - o)), t(this, b).thumb.style.top = n + "px";
121
+ const i = t(this, w).querySelector(".ng-container-body");
122
+ if (!i) return;
123
+ const u = i.scrollHeight - i.clientHeight, y = s - o;
124
+ y > 0 && u > 0 && (i.scrollTop = n / y * u);
125
+ }, "#thumb_onMouseMove"));
126
+ h(this, N, /* @__PURE__ */ l(() => parseInt(t(this, b).thumb.dataset.height || 30, 10), "#getThumbHeight"));
127
+ this.applyBaseStyle();
128
+ }
129
+ connectedCallback() {
130
+ g(this, w, this.getRootNode().host), t(this, w) && (this.shadowRoot.innerHTML = `
131
+ <button class='ng-scroll-top' disabled><div class='ng-scroll-icon'></div></button>
132
+ <div class='ng-scroll-track'> <div class='ng-scroll-thumb'></div> </div>
133
+ <button class='ng-scroll-bottom'><div class='ng-scroll-icon'></div></button>
134
+ `, super.connectedCallback(), g(this, b, {
135
+ track: this.shadowRoot.querySelector(".ng-scroll-track"),
136
+ thumb: this.shadowRoot.querySelector(".ng-scroll-thumb"),
137
+ top: this.shadowRoot.querySelector(".ng-scroll-top"),
138
+ bottom: this.shadowRoot.querySelector(".ng-scroll-bottom")
139
+ }), t(this, V).call(this));
140
+ }
141
+ };
142
+ w = new WeakMap(), M = new WeakMap(), b = new WeakMap(), S = new WeakMap(), R = new WeakMap(), Q = new WeakMap(), U = new WeakMap(), V = new WeakMap(), tt = new WeakMap(), z = new WeakMap(), et = new WeakMap(), D = new WeakMap(), _ = new WeakMap(), B = new WeakMap(), N = new WeakMap(), l(xt, "NineTableVScrollBar");
143
+ let bt = xt;
144
+ customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", bt);
145
+ var T, A, f, k, C, ot, nt, st, it, W, lt, O, j, K, F;
146
+ const wt = class wt extends HTMLElement {
147
+ constructor() {
148
+ super();
149
+ h(this, T);
150
+ h(this, A);
151
+ h(this, f);
152
+ h(this, k);
153
+ h(this, C);
154
+ h(this, ot);
155
+ h(this, nt, 0);
156
+ I(this, "refresh", /* @__PURE__ */ l(() => {
157
+ if (!t(this, T)) return;
158
+ const e = t(this, T).querySelector(".ng-container-body");
159
+ if (!e) return;
160
+ const s = $(t(this, f).thumb, this.shadowRoot), o = e.querySelector("table > thead");
161
+ t(this, T).getRowCount;
162
+ const n = $(t(this, f).track).height(), i = $(t(this, f).thumb).height(), u = t(this, T).getRowCount ? t(this, T).getRowCount() : 0;
163
+ if (u <= 10) {
164
+ $(this).hide();
165
+ return;
166
+ } else
167
+ $(this).show();
168
+ const y = o ? o.getBoundingClientRect().height : 0, a = Math.max(Math.min(n * (e.clientHeight - y) / (32 * u), n), 16);
169
+ s[0].dataset.height = a, s.css({ height: a });
170
+ const p = n - t(this, F).call(this);
171
+ if (p <= 0) return;
172
+ let r = 0;
173
+ const d = e.scrollHeight - e.clientHeight;
174
+ d > 0 && (r = parseInt(e.scrollTop / d * p, 10), r > n - i && (r = n - i), r < 0 && (r = 0)), t(this, f).thumb.style.top = r + "px", t(this, f).top.disabled = e.scrollTop <= 0, t(this, f).bottom.disabled = e.scrollTop >= d;
175
+ }, "refresh"));
176
+ I(this, "delayScroll", /* @__PURE__ */ l((e, s, o, n) => {
177
+ clearInterval(t(this, k)), clearInterval(t(this, C));
178
+ const i = t(this, T).querySelector(".ng-container-body");
179
+ i && (i.scrollTop += e * 32), g(this, k, setInterval(() => {
180
+ clearInterval(t(this, k)), g(this, C, setInterval(() => {
181
+ i && (i.scrollTop += e * 32, n && n.call());
182
+ }, o));
183
+ }, s));
184
+ }, "delayScroll"));
185
+ I(this, "stopScroll", /* @__PURE__ */ l(() => {
186
+ clearInterval(t(this, k)), clearInterval(t(this, C));
187
+ }, "stopScroll"));
188
+ h(this, st, /* @__PURE__ */ l(() => {
189
+ const e = /* @__PURE__ */ l((o) => {
190
+ clearInterval(t(this, k)), clearInterval(t(this, C));
191
+ const n = t(this, T).querySelector(".ng-container-body");
192
+ n && (n.scrollTop += o * 32), g(this, k, setInterval(() => {
193
+ clearInterval(t(this, k)), g(this, C, setInterval(() => {
194
+ n && (n.scrollTop += o * 32);
195
+ }, 10));
196
+ }, 500));
197
+ }, "delayScrollAction");
198
+ $(t(this, f).top).on("mousedown", (o) => {
199
+ o.buttons != 1 || o.altKey || o.ctrlKey || o.shiftKey || e(-1);
200
+ }), $(t(this, f).bottom).on("mousedown", (o) => {
201
+ o.buttons != 1 || o.altKey || o.ctrlKey || o.shiftKey || e(1);
202
+ }), $(t(this, f).top).on("touchstart", (o) => {
203
+ e(-1);
204
+ }), $(t(this, f).bottom).on("touchstart", (o) => {
205
+ e(1);
206
+ });
207
+ const s = /* @__PURE__ */ l(() => {
208
+ clearInterval(t(this, k)), clearInterval(t(this, C));
209
+ }, "clearTimer");
210
+ t(this, f).top.ontouchend = t(this, f).bottom.ontouchend = t(this, f).track.ontouchend = t(this, f).top.onmouseup = t(this, f).top.onmouseleave = t(this, f).bottom.onmouseup = t(this, f).bottom.onmouseleave = t(this, f).track.onmouseup = t(this, f).track.onmouseleave = s, $(t(this, f).track).on("mousedown", t(this, W)), $(t(this, f).track).on("touchstart", t(this, it)), $(t(this, f).thumb).on("mousedown", t(this, j)), $(t(this, f).thumb).on("touchstart", t(this, lt)), document.addEventListener("mouseup", (o) => {
211
+ t(this, A) && g(this, A, !1), document.removeEventListener("mousemove", t(this, K));
212
+ }), document.addEventListener("touchend", (o) => {
213
+ g(this, A, !1), document.removeEventListener("touchmove", t(this, O));
214
+ });
215
+ }, "#init"));
216
+ h(this, it, /* @__PURE__ */ l((e) => {
217
+ e.target.getBoundingClientRect(), e.clientX = e.targetTouches[0].clientX, e.clientY = e.targetTouches[0].clientY, e.buttons = 1, t(this, W).call(this, e);
218
+ }, "#track_onTouchStart"));
219
+ h(this, W, /* @__PURE__ */ l((e) => {
220
+ if (t(this, A) || e.buttons != 1 || e.altKey || e.ctrlKey || e.shiftKey) return;
221
+ e.preventDefault();
222
+ var s = t(this, f).thumb.getBoundingClientRect();
223
+ const o = t(this, T).querySelector(".ng-container-body");
224
+ if (!o) return;
225
+ const n = o.clientHeight, i = e.clientY > s.y ? n : -n;
226
+ o.scrollTop += i, clearInterval(t(this, k)), clearInterval(t(this, C)), g(this, k, setInterval(() => {
227
+ clearInterval(t(this, k)), g(this, C, setInterval(() => {
228
+ var u = t(this, f).thumb.getBoundingClientRect();
229
+ e.clientY > u.y && e.clientY < u.y + u.height ? clearInterval(t(this, C)) : o.scrollTop += e.clientY > u.y ? n : -n;
230
+ }, 10));
231
+ }, 500));
232
+ }, "#track_onMouseDown"));
233
+ h(this, lt, /* @__PURE__ */ l((e) => {
234
+ e.clientX = e.targetTouches[0].clientX, e.clientY = e.targetTouches[0].clientY, e.buttons = 1, t(this, j).call(this, e), document.addEventListener("touchmove", t(this, O));
235
+ }, "#thumb_onTouchStart"));
236
+ h(this, O, /* @__PURE__ */ l((e) => {
237
+ e.clientX = e.targetTouches[0].clientX, e.clientY = e.targetTouches[0].clientY, e.buttons = 1, t(this, K).call(this, e);
238
+ }, "#thumb_onTouchMove"));
239
+ h(this, j, /* @__PURE__ */ l((e) => {
240
+ g(this, nt, e.clientY), g(this, A, !0), this.shiftY = e.offsetY + t(this, f).track.getBoundingClientRect().y, this.trackHeight = $(t(this, f).track).height(), this.thumbHeight = $(t(this, f).thumb).height(), g(this, ot, !0), document.addEventListener("mousemove", t(this, K));
241
+ }, "#thumb_onMouseDown"));
242
+ h(this, K, /* @__PURE__ */ l((e) => {
243
+ if (!t(this, A)) return;
244
+ e.preventDefault();
245
+ const s = this.trackHeight, o = t(this, F).call(this);
246
+ var n = e.clientY - this.shiftY;
247
+ n < 0 && (n = 0), n + o > s && (n = parseInt(s - o)), t(this, f).thumb.style.top = n + "px";
248
+ const i = t(this, T).querySelector(".ng-container-body");
249
+ if (!i) return;
250
+ const u = i.scrollHeight - i.clientHeight, y = s - o;
251
+ y > 0 && u > 0 && (i.scrollTop = n / y * u);
252
+ }, "#thumb_onMouseMove"));
253
+ h(this, F, /* @__PURE__ */ l(() => parseInt(t(this, f).thumb.dataset.height || 30, 10), "#getThumbHeight"));
254
+ this.applyBaseStyle();
255
+ }
256
+ connectedCallback() {
257
+ g(this, T, this.getRootNode().host), t(this, T) && (this.shadowRoot.innerHTML = `
258
+ <button class='ng-scroll-top' disabled><div class='ng-scroll-icon'></div></button>
259
+ <div class='ng-scroll-track'> <div class='ng-scroll-thumb'></div> </div>
260
+ <button class='ng-scroll-bottom'><div class='ng-scroll-icon'></div></button>
261
+ `, super.connectedCallback(), g(this, f, {
262
+ track: this.shadowRoot.querySelector(".ng-scroll-track"),
263
+ thumb: this.shadowRoot.querySelector(".ng-scroll-thumb"),
264
+ top: this.shadowRoot.querySelector(".ng-scroll-top"),
265
+ bottom: this.shadowRoot.querySelector(".ng-scroll-bottom")
266
+ }), t(this, st).call(this));
267
+ }
268
+ };
269
+ T = new WeakMap(), A = new WeakMap(), f = new WeakMap(), k = new WeakMap(), C = new WeakMap(), ot = new WeakMap(), nt = new WeakMap(), st = new WeakMap(), it = new WeakMap(), W = new WeakMap(), lt = new WeakMap(), O = new WeakMap(), j = new WeakMap(), K = new WeakMap(), F = new WeakMap(), l(wt, "NineTableHScrollBar");
270
+ let ft = wt;
271
+ customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ft);
272
+ var Y, rt;
273
+ const X = class X extends HTMLElement {
274
+ constructor() {
275
+ super();
276
+ h(this, Y, null);
277
+ I(this, "init", /* @__PURE__ */ l((e) => {
278
+ if (!e) return;
279
+ const s = /* @__PURE__ */ l((a) => {
280
+ const p = /* @__PURE__ */ l((d) => {
281
+ if (d.querySelector("colgroup")) return;
282
+ const m = d.querySelector("tbody tr") || d.querySelector("tr"), q = m ? m.querySelectorAll("th, td").length : 1, x = document.createElement("colgroup"), E = Math.max(Math.floor((d.clientWidth || 600) / q), 100);
283
+ for (let H = 0; H < q; H++) {
284
+ const ut = document.createElement("col");
285
+ ut.setAttribute("width", E), x.appendChild(ut);
32
286
  }
33
- o.prepend(b);
34
- }, "ensureColgroup"), i = /* @__PURE__ */ c((o) => {
35
- if (o.querySelector("thead")) return;
36
- const s = document.createElement("thead"), y = o.querySelector("colgroup");
37
- y ? y.after(s) : o.prepend(s);
287
+ d.prepend(x);
288
+ }, "ensureColgroup"), r = /* @__PURE__ */ l((d) => {
289
+ if (d.querySelector("thead")) return;
290
+ const m = document.createElement("thead"), q = d.querySelector("colgroup");
291
+ q ? q.after(m) : d.prepend(m);
38
292
  }, "ensureThead");
39
- return d(n), i(n), n.classList.add("nine-table-element"), n;
40
- }, "initializeTable"), u = e.cloneNode(!0);
41
- k(this, S, l(u)), a(this, S).style.display = "table";
42
- const g = this.querySelector(".ng-container-left"), h = this.querySelector(".ng-container-body"), f = this.querySelector(".ng-container-right"), p = /* @__PURE__ */ c((n, d, i = !1) => {
43
- const o = n.cloneNode(!0), s = Array.from(o.querySelectorAll("colgroup col")), y = [];
44
- return s.forEach((b, m) => {
45
- const x = b.getAttribute("fixed");
46
- (i ? !x || x === "" : x === d) || y.push(m);
47
- }), y.reverse().forEach((b) => {
48
- s[b] && s[b].remove(), o.querySelectorAll("tr").forEach((m) => {
49
- const x = m.querySelectorAll("th, td");
50
- x[b] && x[b].remove();
293
+ return p(a), r(a), a.classList.add("nine-table-element"), a;
294
+ }, "initializeTable"), o = e.cloneNode(!0);
295
+ g(this, Y, s(o)), t(this, Y).style.display = "table";
296
+ const n = this.querySelector(".ng-container-left"), i = this.querySelector(".ng-container-body"), u = this.querySelector(".ng-container-right"), y = /* @__PURE__ */ l((a, p, r = !1) => {
297
+ const d = a.cloneNode(!0), m = Array.from(d.querySelectorAll("colgroup col")), q = [];
298
+ return m.forEach((x, E) => {
299
+ const H = x.getAttribute("fixed");
300
+ (r ? !H || H === "" : H === p) || q.push(E);
301
+ }), q.reverse().forEach((x) => {
302
+ m[x] && m[x].remove(), d.querySelectorAll("tr").forEach((E) => {
303
+ const H = E.querySelectorAll("th, td");
304
+ H[x] && H[x].remove();
51
305
  });
52
- }), o;
306
+ }), d;
53
307
  }, "filterTableByFixed");
54
- if (h) {
55
- const n = p(a(this, S), null, !0);
56
- h.innerHTML = "", h.appendChild(n);
308
+ if (i) {
309
+ const a = y(t(this, Y), null, !0);
310
+ i.innerHTML = "", i.appendChild(a);
57
311
  }
58
- if (g) {
59
- const n = p(a(this, S), "left", !1);
60
- let d = 0;
61
- n.querySelectorAll("col").forEach((o) => {
62
- const s = parseInt(o.getAttribute("width"), 10);
63
- isNaN(s) || (d += s);
64
- }), g.innerHTML = "", g.appendChild(n);
65
- const i = d > 0 ? d : 0;
66
- g.style.flex = `0 0 ${i}px`, g.style.width = `${i}px`;
312
+ if (n) {
313
+ const a = y(t(this, Y), "left", !1);
314
+ let p = 0;
315
+ a.querySelectorAll("col").forEach((d) => {
316
+ const m = parseInt(d.getAttribute("width"), 10);
317
+ isNaN(m) || (p += m);
318
+ }), n.innerHTML = "", n.appendChild(a);
319
+ const r = p > 0 ? p : 0;
320
+ n.style.flex = `0 0 ${r}px`, n.style.width = `${r}px`;
67
321
  }
68
- if (f) {
69
- const n = p(a(this, S), "right", !1);
70
- let d = 0;
71
- n.querySelectorAll("col").forEach((o) => {
72
- const s = parseInt(o.getAttribute("width"), 10);
73
- isNaN(s) || (d += s);
74
- }), f.innerHTML = "", f.appendChild(n);
75
- const i = d > 0 ? d : 0;
76
- f.style.flex = `0 0 ${i}px`, f.style.width = `${i}px`;
322
+ if (u) {
323
+ const a = y(t(this, Y), "right", !1);
324
+ let p = 0;
325
+ a.querySelectorAll("col").forEach((d) => {
326
+ const m = parseInt(d.getAttribute("width"), 10);
327
+ isNaN(m) || (p += m);
328
+ }), u.innerHTML = "", u.appendChild(a);
329
+ const r = p > 0 ? p : 0;
330
+ u.style.flex = `0 0 ${r}px`, u.style.width = `${r}px`;
77
331
  }
78
- if (h) {
79
- const n = this.getRowCount();
80
- h.style.overflowY = n > 10 ? "auto" : "hidden";
332
+ if (i) {
333
+ const a = this.getRowCount();
334
+ i.style.overflowY = a > 10 ? "auto" : "hidden", i.addEventListener("scroll", () => {
335
+ const p = i.scrollLeft, r = this.querySelector("nine-table-hscrollbar");
336
+ r && typeof r.syncThumb == "function" && r.syncThumb(p);
337
+ });
81
338
  }
82
- $.log(`NineTableSheet 3-split initialized with rows: ${this.getRowCount()}`);
339
+ J.log(`NineTableSheet 3-split initialized with rows: ${this.getRowCount()}`);
83
340
  }, "init"));
84
- q(this, "getRowCount", /* @__PURE__ */ c(() => a(this, S) ? a(this, S).querySelectorAll("tbody tr").length : 0, "getRowCount"));
341
+ I(this, "getRowCount", /* @__PURE__ */ l(() => t(this, Y) ? t(this, Y).querySelectorAll("tbody tr").length : 0, "getRowCount"));
85
342
  // 🎯 외부 스크롤바 및 컨트롤러 연동용 메서드
86
- q(this, "scrollToX", /* @__PURE__ */ c((e) => {
87
- const l = this.querySelector(".ng-container-body");
88
- l && (l.scrollLeft = e);
343
+ I(this, "scrollToX", /* @__PURE__ */ l((e) => {
344
+ const s = this.querySelector(".ng-container-body");
345
+ s && (s.scrollLeft = e);
89
346
  }, "scrollToX"));
90
- q(this, "scrollToY", /* @__PURE__ */ c((e) => {
91
- const l = this.querySelector(".ng-container-body");
92
- l && (l.scrollTop = e);
347
+ I(this, "scrollToY", /* @__PURE__ */ l((e) => {
348
+ const s = this.querySelector(".ng-container-body");
349
+ s && (s.scrollTop = e);
93
350
  }, "scrollToY"));
94
- w(this, R, /* @__PURE__ */ c(() => {
95
- const e = E.SCROLLBAR_SIZE;
351
+ h(this, rt, /* @__PURE__ */ l(() => {
352
+ const e = X.SCROLLBAR_SIZE;
96
353
  this.innerHTML = `
97
354
  <style>
98
355
  nine-table-sheet {
@@ -207,109 +464,109 @@ const E = class E extends HTMLElement {
207
464
  }, "#render"));
208
465
  }
209
466
  connectedCallback() {
210
- a(this, R).call(this);
467
+ t(this, rt).call(this);
211
468
  }
212
469
  disconnectedCallback() {
213
- this.innerHTML = "", $.log("NineTableSheet destroyed.");
470
+ this.innerHTML = "", J.log("NineTableSheet destroyed.");
214
471
  }
215
472
  };
216
- S = new WeakMap(), R = new WeakMap(), c(E, "NineTableSheet"), q(E, "SCROLLBAR_SIZE", 16);
217
- let B = E;
218
- customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", B);
219
- var H;
220
- const K = class K extends HTMLElement {
473
+ Y = new WeakMap(), rt = new WeakMap(), l(X, "NineTableSheet"), I(X, "SCROLLBAR_SIZE", 16);
474
+ let gt = X;
475
+ customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", gt);
476
+ var ct;
477
+ const St = class St extends HTMLElement {
221
478
  constructor() {
222
479
  super();
223
- w(this, H, /* @__PURE__ */ c(() => {
480
+ h(this, ct, /* @__PURE__ */ l(() => {
224
481
  const e = this.querySelector(".nine-tab-bar");
225
- e && (e.addEventListener("click", (l) => {
226
- const u = l.target.closest(".nine-tab-item");
227
- if (!u) return;
228
- const g = l.ctrlKey || l.metaKey || l.shiftKey, h = parseInt(u.dataset.index, 10);
229
- this.switchSheet(h, g);
482
+ e && (e.addEventListener("click", (s) => {
483
+ const o = s.target.closest(".nine-tab-item");
484
+ if (!o) return;
485
+ const n = s.ctrlKey || s.metaKey || s.shiftKey, i = parseInt(o.dataset.index, 10);
486
+ this.switchSheet(i, n);
230
487
  }), this.switchSheet(0, !1));
231
488
  }, "#init"));
232
- q(this, "switchSheet", /* @__PURE__ */ c((e, l = !1) => {
233
- const u = /* @__PURE__ */ c(() => {
234
- const i = this.querySelector("nine-table-sheets-body");
235
- i.querySelectorAll("nine-splitter").forEach((s) => {
236
- const y = parseInt(s.dataset.splitIndex, 10), b = i.querySelector(`nine-table-sheet[data-index="${y - 1}"]`), m = i.querySelector(`nine-table-sheet[data-index="${y}"]`);
237
- b && m && b.classList.contains("active") && m.classList.contains("active") ? s.classList.add("active") : s.classList.remove("active");
489
+ I(this, "switchSheet", /* @__PURE__ */ l((e, s = !1) => {
490
+ const o = /* @__PURE__ */ l(() => {
491
+ const r = this.querySelector("nine-table-sheets-body");
492
+ r.querySelectorAll("nine-splitter").forEach((m) => {
493
+ const q = parseInt(m.dataset.splitIndex, 10), x = r.querySelector(`nine-table-sheet[data-index="${q - 1}"]`), E = r.querySelector(`nine-table-sheet[data-index="${q}"]`);
494
+ x && E && x.classList.contains("active") && E.classList.contains("active") ? m.classList.add("active") : m.classList.remove("active");
238
495
  });
239
- }, "updateSplitters"), g = this.querySelector(".nine-tab-bar"), h = this.querySelector("nine-table-sheets-body"), f = g.querySelectorAll(".nine-tab-item"), p = h.querySelectorAll("nine-table-sheet");
240
- if (!f[e]) return;
241
- if (!l)
242
- f.forEach((i, o) => {
243
- i.classList.toggle("active", o === e);
244
- const s = h.querySelector(`nine-table-sheet[data-index="${o}"]`);
245
- s && (s.style.flex = "");
246
- }), p.forEach((i, o) => {
247
- i.classList.toggle("active", o === e);
496
+ }, "updateSplitters"), n = this.querySelector(".nine-tab-bar"), i = this.querySelector("nine-table-sheets-body"), u = n.querySelectorAll(".nine-tab-item"), y = i.querySelectorAll("nine-table-sheet");
497
+ if (!u[e]) return;
498
+ if (!s)
499
+ u.forEach((r, d) => {
500
+ r.classList.toggle("active", d === e);
501
+ const m = i.querySelector(`nine-table-sheet[data-index="${d}"]`);
502
+ m && (m.style.flex = "");
503
+ }), y.forEach((r, d) => {
504
+ r.classList.toggle("active", d === e);
248
505
  });
249
506
  else {
250
- const i = f[e], o = g.querySelectorAll(".nine-tab-item.active");
251
- if (i.classList.contains("active") && o.length <= 1)
507
+ const r = u[e], d = n.querySelectorAll(".nine-tab-item.active");
508
+ if (r.classList.contains("active") && d.length <= 1)
252
509
  return;
253
- i.classList.toggle("active");
254
- const s = h.querySelector(`nine-table-sheet[data-index="${e}"]`);
255
- s && (s.classList.toggle("active"), s.classList.contains("active") || (s.style.flex = ""));
510
+ r.classList.toggle("active");
511
+ const m = i.querySelector(`nine-table-sheet[data-index="${e}"]`);
512
+ m && (m.classList.toggle("active"), m.classList.contains("active") || (m.style.flex = ""));
256
513
  }
257
- const n = Array.from(h.querySelectorAll("nine-table-sheet.active"));
258
- if (n.length > 1) {
259
- const i = 1 / n.length;
260
- n.forEach((o) => {
261
- (!o.style.flex || o.style.flex === "1 1 100%") && (o.style.flex = `${i} ${i} 0px`);
514
+ const a = Array.from(i.querySelectorAll("nine-table-sheet.active"));
515
+ if (a.length > 1) {
516
+ const r = 1 / a.length;
517
+ a.forEach((d) => {
518
+ (!d.style.flex || d.style.flex === "1 1 100%") && (d.style.flex = `${r} ${r} 0px`);
262
519
  });
263
520
  } else
264
- n.forEach((i) => {
265
- i.style.flex = "1 1 100%";
521
+ a.forEach((r) => {
522
+ r.style.flex = "1 1 100%";
266
523
  });
267
- u();
268
- const d = h.querySelector("nine-table-sheet.active");
269
- if (d && typeof d.getRowCount == "function") {
270
- const i = this.querySelector("#row-count");
271
- i && (i.textContent = d.getRowCount().toLocaleString());
524
+ o();
525
+ const p = i.querySelector("nine-table-sheet.active");
526
+ if (p && typeof p.getRowCount == "function") {
527
+ const r = this.querySelector("#row-count");
528
+ r && (r.textContent = p.getRowCount().toLocaleString());
272
529
  }
273
530
  }, "switchSheet"));
274
531
  }
275
532
  connectedCallback() {
276
- a(this, H).call(this);
533
+ t(this, ct).call(this);
277
534
  }
278
535
  };
279
- H = new WeakMap(), c(K, "NineTableSheets");
280
- let N = K;
281
- customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", N);
282
- var v, C, T, A, M;
283
- const Y = class Y {
284
- constructor(t) {
285
- w(this, v);
286
- w(this, C, null);
287
- w(this, T, /* @__PURE__ */ c(() => {
288
- const t = a(this, v).host;
289
- t && (k(this, C, new ResizeObserver((e) => {
290
- for (let l of e)
291
- t.getAttribute("auto-height") === "true" && a(this, A).call(this, t);
292
- })), a(this, C).observe(t));
536
+ ct = new WeakMap(), l(St, "NineTableSheets");
537
+ let mt = St;
538
+ customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", mt);
539
+ var L, P, at, Z, ht;
540
+ const Tt = class Tt {
541
+ constructor(c) {
542
+ h(this, L);
543
+ h(this, P, null);
544
+ h(this, at, /* @__PURE__ */ l(() => {
545
+ const c = t(this, L).host;
546
+ c && (g(this, P, new ResizeObserver((e) => {
547
+ for (let s of e)
548
+ c.getAttribute("auto-height") === "true" && t(this, Z).call(this, c);
549
+ })), t(this, P).observe(c));
293
550
  }, "#observeResize"));
294
- w(this, A, /* @__PURE__ */ c((t) => {
295
- var m, x;
296
- const e = (m = t.shadowRoot) == null ? void 0 : m.querySelector("nine-table-sheet.active");
551
+ h(this, Z, /* @__PURE__ */ l((c) => {
552
+ var E, H;
553
+ const e = (E = c.shadowRoot) == null ? void 0 : E.querySelector("nine-table-sheet.active");
297
554
  if (!e) return;
298
- const l = ((x = e.getRowCount) == null ? void 0 : x.call(e)) || 0, u = parseInt(t.getAttribute("max-display-row"), 10) || 10, g = Math.min(l, u), h = e.querySelector("tbody tr") || e.querySelector("tr"), f = h ? h.getBoundingClientRect().height : 32, p = a(this, v).querySelector("nine-table-header"), n = a(this, v).querySelector("nine-table-sheets-footer"), d = p ? p.getBoundingClientRect().height : 40, i = n ? n.getBoundingClientRect().height : 32, s = d + i + 16, y = g * f + s;
299
- t.style.height = `${y}px`, t.style.maxHeight = `${u * f + s}px`;
300
- const b = a(this, v).querySelector("nine-table-sheets-body");
301
- b && (b.style.overflowY = l > u ? "auto" : "hidden");
555
+ const s = ((H = e.getRowCount) == null ? void 0 : H.call(e)) || 0, o = parseInt(c.getAttribute("max-display-row"), 10) || 10, n = Math.min(s, o), i = e.querySelector("tbody tr") || e.querySelector("tr"), u = i ? i.getBoundingClientRect().height : 32, y = t(this, L).querySelector("nine-table-header"), a = t(this, L).querySelector("nine-table-sheets-footer"), p = y ? y.getBoundingClientRect().height : 40, r = a ? a.getBoundingClientRect().height : 32, m = p + r + 16, q = n * u + m;
556
+ c.style.height = `${q}px`, c.style.maxHeight = `${o * u + m}px`;
557
+ const x = t(this, L).querySelector("nine-table-sheets-body");
558
+ x && (x.style.overflowY = s > o ? "auto" : "hidden");
302
559
  }, "#applyAutoHeight"));
303
- w(this, M, /* @__PURE__ */ c(() => {
304
- const t = a(this, v).host, l = Array.from(t.children).filter((p) => p.tagName === "TABLE"), u = t.getAttribute("auto-height") === "true", g = l.map((p, n) => `<nine-table-sheet class="${n === 0 ? "active" : ""}" data-index="${n}"></nine-table-sheet>`).join(""), h = l.map((p, n) => `<div class="nine-tab-item ${n === 0 ? "active" : ""}" data-index="${n}">Sheet ${n + 1}</div>`).join("");
305
- a(this, v).innerHTML = `
560
+ h(this, ht, /* @__PURE__ */ l(() => {
561
+ const c = t(this, L).host, s = Array.from(c.children).filter((y) => y.tagName === "TABLE"), o = c.getAttribute("auto-height") === "true", n = s.map((y, a) => `<nine-table-sheet class="${a === 0 ? "active" : ""}" data-index="${a}"></nine-table-sheet>`).join(""), i = s.map((y, a) => `<div class="nine-tab-item ${a === 0 ? "active" : ""}" data-index="${a}">Sheet ${a + 1}</div>`).join("");
562
+ t(this, L).innerHTML = `
306
563
  <style>
307
564
  :host {
308
565
  display: flex;
309
566
  flex-direction: column;
310
567
  position: relative;
311
568
  overflow: hidden;
312
- height: ${u ? "auto" : "100%"};
569
+ height: ${o ? "auto" : "100%"};
313
570
  background: #fff;
314
571
  }
315
572
  nine-table-header { height: 40px; display: block; flex-shrink: 0; border-bottom: 1px solid #e5e7eb; background: #fff; }
@@ -390,9 +647,9 @@ const Y = class Y {
390
647
  <nine-table-body>
391
648
  <nine-table-summary></nine-table-summary>
392
649
  <nine-table-sheets>
393
- <nine-table-sheets-body>${g}</nine-table-sheets-body>
650
+ <nine-table-sheets-body>${n}</nine-table-sheets-body>
394
651
  <nine-table-sheets-footer>
395
- <div class="nine-tab-bar">${h}</div>
652
+ <div class="nine-tab-bar">${i}</div>
396
653
  <div class="sheets-counter">Total : <span id="row-count">0</span></div>
397
654
  </nine-table-sheets-footer>
398
655
  </nine-table-sheets>
@@ -400,33 +657,33 @@ const Y = class Y {
400
657
  </nine-table-body>
401
658
  <nine-table-footer></nine-table-footer>
402
659
  `;
403
- const f = a(this, v).querySelectorAll("nine-table-sheet");
404
- f == null || f.forEach((p, n) => {
405
- l[n] && setTimeout(() => {
406
- p.init(l[n]), u && a(this, A).call(this, t);
660
+ const u = t(this, L).querySelectorAll("nine-table-sheet");
661
+ u == null || u.forEach((y, a) => {
662
+ s[a] && setTimeout(() => {
663
+ y.init(s[a]), o && t(this, Z).call(this, c);
407
664
  });
408
665
  });
409
666
  }, "#render"));
410
- k(this, v, t), a(this, M).call(this), a(this, T).call(this);
667
+ g(this, L, c), t(this, ht).call(this), t(this, at).call(this);
411
668
  }
412
669
  };
413
- v = new WeakMap(), C = new WeakMap(), T = new WeakMap(), A = new WeakMap(), M = new WeakMap(), c(Y, "LayoutManager");
414
- let W = Y;
415
- var L;
416
- const F = class F extends HTMLElement {
670
+ L = new WeakMap(), P = new WeakMap(), at = new WeakMap(), Z = new WeakMap(), ht = new WeakMap(), l(Tt, "LayoutManager");
671
+ let pt = Tt;
672
+ var G;
673
+ const kt = class kt extends HTMLElement {
417
674
  constructor() {
418
675
  super();
419
- w(this, L, !1);
676
+ h(this, G, !1);
420
677
  this.attachShadow({ mode: "open" });
421
678
  }
422
679
  connectedCallback() {
423
- a(this, L) || (this.layoutManager = new W(this.shadowRoot), k(this, L, !0), $.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } })));
680
+ t(this, G) || (this.layoutManager = new pt(this.shadowRoot), g(this, G, !0), J.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } })));
424
681
  }
425
682
  disconnectedCallback() {
426
- $.log("NineTable disconnected.");
683
+ J.log("NineTable disconnected.");
427
684
  }
428
685
  };
429
- L = new WeakMap(), c(F, "NineTable");
430
- let O = F;
431
- customElements.get("nine-table") || customElements.define("nine-table", O);
686
+ G = new WeakMap(), l(kt, "NineTable");
687
+ let yt = kt;
688
+ customElements.get("nine-table") || customElements.define("nine-table", yt);
432
689
  //# sourceMappingURL=nine-table.js.map