@ninebone/table 0.0.424 → 0.0.425
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.
- package/dist/nine-table.js +64 -62
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +5 -5
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -23,12 +23,12 @@ const re = class re extends Se.constructor {
|
|
|
23
23
|
a(re, "Trace");
|
|
24
24
|
let jt = re;
|
|
25
25
|
const P = new jt();
|
|
26
|
-
var M,
|
|
26
|
+
var M, z, p, Y, V, X, St, U, Et;
|
|
27
27
|
const le = class le extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
c(this, M);
|
|
31
|
-
c(this,
|
|
31
|
+
c(this, z, !1);
|
|
32
32
|
c(this, p);
|
|
33
33
|
c(this, Y);
|
|
34
34
|
c(this, V);
|
|
@@ -41,7 +41,7 @@ const le = class le extends HTMLElement {
|
|
|
41
41
|
})), t(this, X).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
v(this, "refresh", /* @__PURE__ */ a(() => {
|
|
44
|
-
if (!t(this, M) || !t(this, p) || t(this,
|
|
44
|
+
if (!t(this, M) || !t(this, p) || t(this, z)) return;
|
|
45
45
|
const e = t(this, p).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
47
|
const n = t(this, p).track, r = t(this, p).thumb, o = t(this, M).querySelector(".ng-container-bottom"), l = e.clientWidth, d = s.scrollWidth;
|
|
@@ -99,13 +99,13 @@ const le = class le extends HTMLElement {
|
|
|
99
99
|
t(this, U).call(this, n.clientX - r.left - o / 2);
|
|
100
100
|
}), t(this, p).thumb.addEventListener("mousedown", (n) => {
|
|
101
101
|
if (n.button !== 0) return;
|
|
102
|
-
n.stopPropagation(), n.preventDefault(), b(this,
|
|
102
|
+
n.stopPropagation(), n.preventDefault(), b(this, z, !0), this.shiftX = n.clientX - t(this, p).thumb.getBoundingClientRect().left;
|
|
103
103
|
const r = /* @__PURE__ */ a((l) => {
|
|
104
|
-
if (!t(this,
|
|
104
|
+
if (!t(this, z)) return;
|
|
105
105
|
const d = t(this, p).track.getBoundingClientRect();
|
|
106
106
|
t(this, U).call(this, l.clientX - d.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), o = /* @__PURE__ */ a(() => {
|
|
108
|
-
b(this,
|
|
108
|
+
b(this, z, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
110
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", o);
|
|
111
111
|
});
|
|
@@ -189,7 +189,7 @@ const le = class le extends HTMLElement {
|
|
|
189
189
|
left: this.querySelector(".ng-scroll-left"),
|
|
190
190
|
right: this.querySelector(".ng-scroll-right")
|
|
191
191
|
}), s.addEventListener("scroll", () => {
|
|
192
|
-
t(this,
|
|
192
|
+
t(this, z) || this.refresh();
|
|
193
193
|
}), t(this, Et).call(this), t(this, St).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
195
195
|
e();
|
|
@@ -198,14 +198,14 @@ const le = class le extends HTMLElement {
|
|
|
198
198
|
t(this, X) && t(this, X).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
M = new WeakMap(),
|
|
201
|
+
M = new WeakMap(), z = new WeakMap(), p = new WeakMap(), Y = new WeakMap(), V = new WeakMap(), X = new WeakMap(), St = new WeakMap(), U = new WeakMap(), Et = new WeakMap(), a(le, "NineTableHScrollBar");
|
|
202
202
|
let Kt = le;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Kt);
|
|
204
|
-
var
|
|
204
|
+
var _, tt, F, E, ht, dt, Rt;
|
|
205
205
|
const ae = class ae extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
-
c(this,
|
|
208
|
+
c(this, _);
|
|
209
209
|
c(this, tt);
|
|
210
210
|
c(this, F, !1);
|
|
211
211
|
c(this, E);
|
|
@@ -215,9 +215,9 @@ const ae = class ae extends HTMLElement {
|
|
|
215
215
|
* 🎯 스크롤바 위치 및 썸브 크기 갱신
|
|
216
216
|
*/
|
|
217
217
|
v(this, "refresh", /* @__PURE__ */ a(() => {
|
|
218
|
-
var
|
|
219
|
-
if (!t(this,
|
|
220
|
-
const e = t(this, E).container, s = t(this, E).track, n = t(this, E).thumb, r = e.clientHeight, l = (t(this,
|
|
218
|
+
var O;
|
|
219
|
+
if (!t(this, _) || !t(this, E)) return;
|
|
220
|
+
const e = t(this, E).container, s = t(this, E).track, n = t(this, E).thumb, r = e.clientHeight, l = (t(this, _).data.get() || []).length, d = ((O = t(this, tt)) == null ? void 0 : O.getRowHeight()) || 24, h = l * d;
|
|
221
221
|
if (h <= r) {
|
|
222
222
|
n.style.display = "none", t(this, E).top.disabled = !0, t(this, E).bottom.disabled = !0;
|
|
223
223
|
return;
|
|
@@ -234,7 +234,7 @@ const ae = class ae extends HTMLElement {
|
|
|
234
234
|
c(this, Rt, /* @__PURE__ */ a(() => {
|
|
235
235
|
const e = t(this, E).container, s = /* @__PURE__ */ a(() => {
|
|
236
236
|
var l;
|
|
237
|
-
const r = (t(this,
|
|
237
|
+
const r = (t(this, _).data.get() || []).length, o = ((l = t(this, tt)) == null ? void 0 : l.getRowHeight()) || 24;
|
|
238
238
|
return r * o;
|
|
239
239
|
}, "getContentHeight");
|
|
240
240
|
e.addEventListener("scroll", () => {
|
|
@@ -246,8 +246,8 @@ const ae = class ae extends HTMLElement {
|
|
|
246
246
|
if (!t(this, F)) return;
|
|
247
247
|
const d = t(this, E).track.getBoundingClientRect(), h = t(this, E).thumb.clientHeight, u = d.height - h, g = l.clientY - t(this, ht), y = e.clientHeight, m = s(), S = Math.max(m - y, 1);
|
|
248
248
|
if (u > 0 && S > 0) {
|
|
249
|
-
const
|
|
250
|
-
let Q = t(this, dt) +
|
|
249
|
+
const O = g / u * S;
|
|
250
|
+
let Q = t(this, dt) + O;
|
|
251
251
|
const ye = Math.max(0, m - y);
|
|
252
252
|
Q < 0 && (Q = 0), Q > ye && (Q = ye), e.scrollTop = Q;
|
|
253
253
|
}
|
|
@@ -272,7 +272,7 @@ const ae = class ae extends HTMLElement {
|
|
|
272
272
|
}, "#init"));
|
|
273
273
|
}
|
|
274
274
|
connectedCallback() {
|
|
275
|
-
b(this,
|
|
275
|
+
b(this, _, this.getRootNode().host), b(this, tt, this.closest("nine-table-sheet")), this.innerHTML = `
|
|
276
276
|
<style>
|
|
277
277
|
nine-table-vscrollbar {
|
|
278
278
|
display: flex;
|
|
@@ -338,13 +338,15 @@ const ae = class ae extends HTMLElement {
|
|
|
338
338
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
339
339
|
`;
|
|
340
340
|
const e = /* @__PURE__ */ a(() => {
|
|
341
|
-
const s = t(this,
|
|
341
|
+
const s = t(this, _).shadowRoot.querySelector(".ng-container-body");
|
|
342
342
|
if (!s) {
|
|
343
343
|
setTimeout(e, 10);
|
|
344
344
|
return;
|
|
345
345
|
}
|
|
346
346
|
b(this, E, {
|
|
347
347
|
container: s,
|
|
348
|
+
leftContainer: t(this, _).shadowRoot.querySelector(".ng-container-left"),
|
|
349
|
+
rightContainer: t(this, _).shadowRoot.querySelector(".ng-container-right"),
|
|
348
350
|
track: this.querySelector(".ng-scroll-track"),
|
|
349
351
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
350
352
|
top: this.querySelector(".ng-scroll-top"),
|
|
@@ -354,7 +356,7 @@ const ae = class ae extends HTMLElement {
|
|
|
354
356
|
e();
|
|
355
357
|
}
|
|
356
358
|
};
|
|
357
|
-
|
|
359
|
+
_ = new WeakMap(), tt = new WeakMap(), F = new WeakMap(), E = new WeakMap(), ht = new WeakMap(), dt = new WeakMap(), Rt = new WeakMap(), a(ae, "NineTableVScrollBar");
|
|
358
360
|
let Zt = ae;
|
|
359
361
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Zt);
|
|
360
362
|
var At, et;
|
|
@@ -428,25 +430,25 @@ At = new WeakMap(), et = new WeakMap(), a(H, "TableCompiler"), c(H, At, /* @__PU
|
|
|
428
430
|
});
|
|
429
431
|
}, "#resetColIndex"));
|
|
430
432
|
let Gt = H;
|
|
431
|
-
var
|
|
433
|
+
var I, w, W, q, D, j, N, it, qt, Tt, kt, ft, ut, Lt, Ct, bt, Ht, st, gt;
|
|
432
434
|
const ce = class ce {
|
|
433
435
|
constructor(i) {
|
|
434
|
-
c(this,
|
|
436
|
+
c(this, I);
|
|
435
437
|
c(this, w);
|
|
436
|
-
c(this,
|
|
437
|
-
c(this,
|
|
438
|
+
c(this, W, /* @__PURE__ */ new Map());
|
|
439
|
+
c(this, q, null);
|
|
438
440
|
c(this, D, null);
|
|
439
441
|
c(this, j, 0);
|
|
440
442
|
c(this, N, 40);
|
|
441
443
|
c(this, it, !1);
|
|
442
|
-
c(this,
|
|
444
|
+
c(this, qt, 3);
|
|
443
445
|
v(this, "refresh", /* @__PURE__ */ a(() => {
|
|
444
446
|
var e;
|
|
445
447
|
const i = t(this, w).querySelector(".ng-container-body");
|
|
446
448
|
i && (t(this, ft).call(this), t(this, st).call(this, i.scrollTop), (e = t(this, w).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
447
449
|
}, "refresh"));
|
|
448
450
|
v(this, "initialize", /* @__PURE__ */ a(() => {
|
|
449
|
-
b(this,
|
|
451
|
+
b(this, q, null), t(this, W).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
450
452
|
const r = t(this, w).querySelector(n);
|
|
451
453
|
if (!r) return;
|
|
452
454
|
const o = r.querySelector("table");
|
|
@@ -454,7 +456,7 @@ const ce = class ce {
|
|
|
454
456
|
const l = o.querySelector("tbody.bindable-tbody");
|
|
455
457
|
if (!l) return;
|
|
456
458
|
const h = Array.from(l.querySelectorAll("tr")).map((f) => f.cloneNode(!0));
|
|
457
|
-
t(this,
|
|
459
|
+
t(this, W).set(n, h);
|
|
458
460
|
});
|
|
459
461
|
const i = t(this, w).querySelector(".ng-container-body"), e = t(this, w).querySelector(".ng-container-left"), s = t(this, w).querySelector(".ng-container-right");
|
|
460
462
|
if (i) {
|
|
@@ -470,8 +472,8 @@ const ce = class ce {
|
|
|
470
472
|
});
|
|
471
473
|
}
|
|
472
474
|
}, "initialize"));
|
|
473
|
-
c(this,
|
|
474
|
-
const s = t(this,
|
|
475
|
+
c(this, Tt, /* @__PURE__ */ a((i, e) => {
|
|
476
|
+
const s = t(this, W).get(e);
|
|
475
477
|
if (!s || s.length === 0) return;
|
|
476
478
|
const n = i.querySelector("tbody.bindable-tbody");
|
|
477
479
|
if (!n) return;
|
|
@@ -484,9 +486,9 @@ const ce = class ce {
|
|
|
484
486
|
r ? r.before(o) : n.appendChild(o);
|
|
485
487
|
}, "#renderRows"));
|
|
486
488
|
c(this, kt, /* @__PURE__ */ a((i) => {
|
|
487
|
-
if (t(this,
|
|
488
|
-
return t(this,
|
|
489
|
-
const e = t(this,
|
|
489
|
+
if (t(this, q) !== null && t(this, q) > 0)
|
|
490
|
+
return t(this, q);
|
|
491
|
+
const e = t(this, W).get(".ng-container-body");
|
|
490
492
|
if (!e || e.length === 0) return 24;
|
|
491
493
|
const s = i.querySelector("tbody.bindable-tbody") || i.querySelector("tbody.bindable-tbody:last-of-type");
|
|
492
494
|
if (!s) return 24;
|
|
@@ -501,11 +503,11 @@ const ce = class ce {
|
|
|
501
503
|
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
502
504
|
return u.forEach((g) => {
|
|
503
505
|
f += g.offsetHeight || g.getBoundingClientRect().height;
|
|
504
|
-
}), u.forEach((g) => g.remove()), o.style.display = l, o.style.visibility = d, o.style.position = h, b(this,
|
|
506
|
+
}), u.forEach((g) => g.remove()), o.style.display = l, o.style.visibility = d, o.style.position = h, b(this, q, f > 0 ? f : 24), t(this, ut).call(this), t(this, q);
|
|
505
507
|
}, "#measureAndCacheHeight"));
|
|
506
508
|
c(this, ft, /* @__PURE__ */ a(() => {
|
|
507
509
|
if (!t(this, w).querySelector(".ng-container-body")) return;
|
|
508
|
-
const s = (t(this,
|
|
510
|
+
const s = (t(this, I).data.get() || []).length, n = t(this, q) || 24, r = s * n;
|
|
509
511
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
510
512
|
const l = t(this, w).querySelector(o);
|
|
511
513
|
if (!l) return;
|
|
@@ -516,9 +518,9 @@ const ce = class ce {
|
|
|
516
518
|
});
|
|
517
519
|
}, "#updateVirtualScrollHeight"));
|
|
518
520
|
c(this, ut, /* @__PURE__ */ a(() => {
|
|
519
|
-
if ((t(this,
|
|
520
|
-
const e = Math.ceil(t(this, j) / t(this,
|
|
521
|
-
b(this, N, e + t(this,
|
|
521
|
+
if ((t(this, I).data.get() || []).length, t(this, j) > 0 && t(this, q) > 0) {
|
|
522
|
+
const e = Math.ceil(t(this, j) / t(this, q));
|
|
523
|
+
b(this, N, e + t(this, qt)), P.log("visibleRows:", e, "cachedRowCount:", t(this, N));
|
|
522
524
|
}
|
|
523
525
|
}, "#updateRowCount"));
|
|
524
526
|
c(this, Lt, /* @__PURE__ */ a(() => {
|
|
@@ -546,7 +548,7 @@ const ce = class ce {
|
|
|
546
548
|
const o = s.querySelector("thead");
|
|
547
549
|
o && (r += o.offsetHeight || o.getBoundingClientRect().height);
|
|
548
550
|
const l = Math.max(n - r, 100);
|
|
549
|
-
t(this, j) !== l && (b(this, j, l), t(this, ut).call(this), t(this,
|
|
551
|
+
t(this, j) !== l && (b(this, j, l), t(this, ut).call(this), t(this, q) !== null && t(this, bt).call(this));
|
|
550
552
|
}
|
|
551
553
|
}
|
|
552
554
|
})), t(this, D).observe(t(this, w)));
|
|
@@ -554,7 +556,7 @@ const ce = class ce {
|
|
|
554
556
|
c(this, bt, /* @__PURE__ */ a(() => {
|
|
555
557
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
556
558
|
const e = t(this, w).querySelector(i);
|
|
557
|
-
e && e.querySelector("tbody.bindable-tbody") && t(this,
|
|
559
|
+
e && e.querySelector("tbody.bindable-tbody") && t(this, Tt).call(this, e, i);
|
|
558
560
|
}), t(this, Lt).call(this);
|
|
559
561
|
}, "#renderAllContainers"));
|
|
560
562
|
c(this, Ht, /* @__PURE__ */ a((i) => {
|
|
@@ -564,23 +566,23 @@ const ce = class ce {
|
|
|
564
566
|
if (!s) return;
|
|
565
567
|
const n = s.querySelector("tbody.bindable-tbody");
|
|
566
568
|
if (!n) return;
|
|
567
|
-
const r = Array.from(n.querySelectorAll("tr:not(.nodata)")), o = ((h = t(this,
|
|
569
|
+
const r = Array.from(n.querySelectorAll("tr:not(.nodata)")), o = ((h = t(this, W).get(e)) == null ? void 0 : h.length) || 1, d = (t(this, I).data.get() || []).length;
|
|
568
570
|
r.forEach((f, u) => {
|
|
569
571
|
const g = i + Math.floor(u / o);
|
|
570
572
|
if (g >= d) {
|
|
571
573
|
f.style.display = "none";
|
|
572
574
|
return;
|
|
573
575
|
}
|
|
574
|
-
const y = t(this,
|
|
576
|
+
const y = t(this, I).data.get(g);
|
|
575
577
|
f.style.display = "", t(this, gt).call(this, f, y, g);
|
|
576
578
|
});
|
|
577
579
|
});
|
|
578
580
|
}, "#adjustBufferRows"));
|
|
579
581
|
c(this, st, /* @__PURE__ */ a((i) => {
|
|
580
582
|
var d;
|
|
581
|
-
const e = t(this,
|
|
583
|
+
const e = t(this, q);
|
|
582
584
|
if (!e || e <= 0) return;
|
|
583
|
-
const n = (t(this,
|
|
585
|
+
const n = (t(this, I).data.get() || []).length, r = Math.max(0, Math.floor(i / e)), o = ((d = t(this, W).get(".ng-container-body")) == null ? void 0 : d.length) || 1, l = r + t(this, N);
|
|
584
586
|
P.log(`[Scroll] scrollTop: ${i}, startIndex: ${r}, cachedRowCount: ${t(this, N)}, targetDataIndex range: ${r} ~ ${l} (Total: ${n})`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((h) => {
|
|
585
587
|
const f = t(this, w).querySelector(h);
|
|
586
588
|
if (!f) return;
|
|
@@ -592,8 +594,8 @@ const ce = class ce {
|
|
|
592
594
|
y.style.display = "none";
|
|
593
595
|
return;
|
|
594
596
|
}
|
|
595
|
-
const
|
|
596
|
-
y.style.display = "", t(this, gt).call(this, y,
|
|
597
|
+
const O = t(this, I).data.get(S);
|
|
598
|
+
y.style.display = "", t(this, gt).call(this, y, O, S);
|
|
597
599
|
});
|
|
598
600
|
}), t(this, it) || (b(this, it, !0), setTimeout(() => {
|
|
599
601
|
t(this, Ht).call(this, r), b(this, it, !1);
|
|
@@ -608,17 +610,17 @@ const ce = class ce {
|
|
|
608
610
|
v(this, "destroy", /* @__PURE__ */ a(() => {
|
|
609
611
|
t(this, D) && (t(this, D).disconnect(), b(this, D, null));
|
|
610
612
|
}, "destroy"));
|
|
611
|
-
b(this,
|
|
613
|
+
b(this, I, i.getRootNode().host), b(this, w, i), t(this, Ct).call(this);
|
|
612
614
|
}
|
|
613
615
|
getRowHeight() {
|
|
614
|
-
return t(this,
|
|
616
|
+
return t(this, q);
|
|
615
617
|
}
|
|
616
618
|
templateLength(i = ".ng-container-body") {
|
|
617
619
|
var e;
|
|
618
|
-
return ((e = t(this,
|
|
620
|
+
return ((e = t(this, W).get(i)) == null ? void 0 : e.length) || 1;
|
|
619
621
|
}
|
|
620
622
|
};
|
|
621
|
-
|
|
623
|
+
I = new WeakMap(), w = new WeakMap(), W = new WeakMap(), q = new WeakMap(), D = new WeakMap(), j = new WeakMap(), N = new WeakMap(), it = new WeakMap(), qt = new WeakMap(), Tt = new WeakMap(), kt = new WeakMap(), ft = new WeakMap(), ut = new WeakMap(), Lt = new WeakMap(), Ct = new WeakMap(), bt = new WeakMap(), Ht = new WeakMap(), st = new WeakMap(), gt = new WeakMap(), a(ce, "RowManager");
|
|
622
624
|
let Jt = ce;
|
|
623
625
|
var Mt, nt, K, _t, $t, It, Wt, Ot;
|
|
624
626
|
const ct = class ct extends HTMLElement {
|
|
@@ -893,8 +895,8 @@ const he = class he extends HTMLElement {
|
|
|
893
895
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((y) => y.style.setProperty("display", "none"));
|
|
894
896
|
const g = f.filter((y) => y.classList.contains("active"));
|
|
895
897
|
g.length < 2 || g.forEach((y) => {
|
|
896
|
-
const m = parseInt(y.getAttribute("data-index"), 10), S = this.querySelector(`nine-splitter[data-split-index="${m}"]`),
|
|
897
|
-
S &&
|
|
898
|
+
const m = parseInt(y.getAttribute("data-index"), 10), S = this.querySelector(`nine-splitter[data-split-index="${m}"]`), O = f[m + 1];
|
|
899
|
+
S && O && O.classList.contains("active") && S.style.setProperty("display", "flex");
|
|
898
900
|
});
|
|
899
901
|
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), l = r.querySelectorAll(".nine-tab-item"), d = o.querySelectorAll("nine-table-sheet");
|
|
900
902
|
if (!l[e]) return;
|
|
@@ -926,29 +928,29 @@ const he = class he extends HTMLElement {
|
|
|
926
928
|
zt = new WeakMap(), yt = new WeakMap(), a(he, "NineTableSheets");
|
|
927
929
|
let Qt = he;
|
|
928
930
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", Qt);
|
|
929
|
-
var
|
|
931
|
+
var T, Dt, pt, Nt;
|
|
930
932
|
const de = class de {
|
|
931
933
|
constructor(i) {
|
|
932
|
-
c(this,
|
|
934
|
+
c(this, T);
|
|
933
935
|
c(this, Dt, /* @__PURE__ */ a(() => {
|
|
934
936
|
t(this, Nt).call(this), new ResizeObserver((i) => {
|
|
935
937
|
for (let e of i)
|
|
936
|
-
t(this,
|
|
937
|
-
}).observe(t(this,
|
|
938
|
+
t(this, T).getAttribute("auto-height") === "true" && t(this, pt).call(this);
|
|
939
|
+
}).observe(t(this, T));
|
|
938
940
|
}, "#init"));
|
|
939
941
|
c(this, pt, /* @__PURE__ */ a(() => {
|
|
940
942
|
var d, h;
|
|
941
|
-
const i = Array.from(t(this,
|
|
943
|
+
const i = Array.from(t(this, T).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
942
944
|
if (i.length === 0) return;
|
|
943
|
-
const e = parseInt(t(this,
|
|
944
|
-
t(this,
|
|
945
|
+
const e = parseInt(t(this, T).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), n = (d = t(this, T).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : d.getBoundingClientRect().height, r = (h = t(this, T).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : h.getBoundingClientRect().height, o = wt.SCROLLBAR_SIZE, l = e * s + n + r + o;
|
|
946
|
+
t(this, T).style.height = `${l}px`;
|
|
945
947
|
}, "#applyAutoHeight"));
|
|
946
948
|
c(this, Nt, /* @__PURE__ */ a(() => {
|
|
947
|
-
const e = Array.from(t(this,
|
|
949
|
+
const e = Array.from(t(this, T).children).filter((d) => d.tagName === "TABLE"), s = t(this, T).getAttribute("auto-height") === "true", n = e.length, r = e.map((d, h) => {
|
|
948
950
|
const u = `<nine-table-sheet class="${h === 0 ? "active" : ""}" data-index="${h}"></nine-table-sheet>`, g = h < n - 1 ? `<nine-splitter class="h" data-split-index="${h}"></nine-splitter>` : "";
|
|
949
951
|
return u + g;
|
|
950
952
|
}).join(""), o = e.map((d, h) => `<div class="nine-tab-item ${h === 0 ? "active" : ""}" data-index="${h}">Sheet ${h + 1}</div>`).join("");
|
|
951
|
-
t(this,
|
|
953
|
+
t(this, T).shadowRoot.innerHTML = `
|
|
952
954
|
<style>
|
|
953
955
|
:host {
|
|
954
956
|
display: flex;
|
|
@@ -1039,17 +1041,17 @@ const de = class de {
|
|
|
1039
1041
|
</nine-table-body>
|
|
1040
1042
|
<nine-table-footer></nine-table-footer>
|
|
1041
1043
|
`;
|
|
1042
|
-
const l = t(this,
|
|
1044
|
+
const l = t(this, T).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1043
1045
|
l == null || l.forEach((d, h) => {
|
|
1044
1046
|
e[h] && setTimeout(() => {
|
|
1045
1047
|
d.generate(e[h]), s && t(this, pt).call(this);
|
|
1046
1048
|
});
|
|
1047
1049
|
});
|
|
1048
1050
|
}, "#render"));
|
|
1049
|
-
b(this,
|
|
1051
|
+
b(this, T, i), t(this, Dt).call(this);
|
|
1050
1052
|
}
|
|
1051
1053
|
};
|
|
1052
|
-
|
|
1054
|
+
T = new WeakMap(), Dt = new WeakMap(), pt = new WeakMap(), Nt = new WeakMap(), a(de, "LayoutManager");
|
|
1053
1055
|
let te = de;
|
|
1054
1056
|
var mt, ot;
|
|
1055
1057
|
const fe = class fe {
|