@ninebone/table 0.0.680 → 0.0.681
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 +27 -26
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +4 -4
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -354,14 +354,14 @@ const Me = class Me extends HTMLElement {
|
|
|
354
354
|
F = new WeakMap(), at = new WeakMap(), J = new WeakMap(), k = new WeakMap(), vt = new WeakMap(), xt = new WeakMap(), Wt = new WeakMap(), h(Me, "NineTableVScrollBar");
|
|
355
355
|
let le = Me;
|
|
356
356
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", le);
|
|
357
|
-
var P, x, Q, D,
|
|
357
|
+
var P, x, Q, D, M, V, tt, wt, Se, Ee, Ot, Bt, St, Et, At, zt, Dt, qt, Ae, lt, Rt, Pt;
|
|
358
358
|
const Ie = class Ie {
|
|
359
359
|
constructor(i) {
|
|
360
360
|
d(this, P);
|
|
361
361
|
d(this, x);
|
|
362
362
|
d(this, Q);
|
|
363
363
|
d(this, D, /* @__PURE__ */ new Map());
|
|
364
|
-
d(this,
|
|
364
|
+
d(this, M, null);
|
|
365
365
|
d(this, V, null);
|
|
366
366
|
d(this, tt, 0);
|
|
367
367
|
d(this, wt, 40);
|
|
@@ -379,7 +379,7 @@ const Ie = class Ie {
|
|
|
379
379
|
T.log("rowManager.initialize"), y(this, Q, {
|
|
380
380
|
scrollTables: t(this, x).querySelectorAll(".ng-part-body table"),
|
|
381
381
|
firstTr: t(this, x).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
382
|
-
}), y(this,
|
|
382
|
+
}), y(this, M, null), t(this, D).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
383
383
|
const a = t(this, x).querySelector(o);
|
|
384
384
|
if (!a) return;
|
|
385
385
|
const c = a.querySelector(".ng-part-body table");
|
|
@@ -421,8 +421,8 @@ const Ie = class Ie {
|
|
|
421
421
|
n ? n.before(o) : r.appendChild(o), e === ".ng-container-body" && (t(this, Q).firstTr = r.querySelector("tr:not(.nodata)"));
|
|
422
422
|
}, "#renderRows"));
|
|
423
423
|
d(this, St, /* @__PURE__ */ h(() => {
|
|
424
|
-
if (t(this,
|
|
425
|
-
return t(this,
|
|
424
|
+
if (t(this, M) !== null && t(this, M) > 0)
|
|
425
|
+
return t(this, M);
|
|
426
426
|
const i = t(this, x).querySelector(".ng-container-body .ng-part-body");
|
|
427
427
|
T.log("rowManager.#measureAndCacheHeight");
|
|
428
428
|
const e = t(this, D).get(".ng-container-body");
|
|
@@ -446,11 +446,11 @@ const Ie = class Ie {
|
|
|
446
446
|
}
|
|
447
447
|
f += g;
|
|
448
448
|
}), u.forEach((b) => b.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l, f <= 0) throw new Error("#measureAndCacheHeight() invalid dom");
|
|
449
|
-
return y(this,
|
|
449
|
+
return y(this, M, f), t(this, At).call(this), t(this, M);
|
|
450
450
|
}, "#measureAndCacheHeight"));
|
|
451
451
|
d(this, Et, /* @__PURE__ */ h(() => {
|
|
452
452
|
T.log("rowManager.#updateVirtualScrollHeight");
|
|
453
|
-
const e = (t(this, P).data.get() || []).length, s = t(this,
|
|
453
|
+
const e = (t(this, P).data.get() || []).length, s = t(this, M), r = e * s;
|
|
454
454
|
T.log("🔍 [VirtualHeight]", { totalCount: e, rowHeight: s, totalVirtualHeight: r }), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
455
455
|
const o = t(this, x).querySelector(n);
|
|
456
456
|
if (!o) return;
|
|
@@ -459,8 +459,8 @@ const Ie = class Ie {
|
|
|
459
459
|
});
|
|
460
460
|
}, "#updateVirtualScrollHeight"));
|
|
461
461
|
d(this, At, /* @__PURE__ */ h(() => {
|
|
462
|
-
if (t(this, tt) > 0 && t(this,
|
|
463
|
-
const i = Math.ceil(t(this, tt) / t(this,
|
|
462
|
+
if (t(this, tt) > 0 && t(this, M) > 0) {
|
|
463
|
+
const i = Math.ceil(t(this, tt) / t(this, M));
|
|
464
464
|
y(this, wt, i + t(this, Ot));
|
|
465
465
|
}
|
|
466
466
|
}, "#updateRowCount"));
|
|
@@ -502,7 +502,7 @@ const Ie = class Ie {
|
|
|
502
502
|
const o = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
|
|
503
503
|
o && (n += o.offsetHeight), a && (n += a.offsetHeight);
|
|
504
504
|
const c = Math.max(r - n, 100);
|
|
505
|
-
t(this, tt) !== c && (y(this, tt, c), t(this, At).call(this), t(this,
|
|
505
|
+
t(this, tt) !== c && (y(this, tt, c), t(this, At).call(this), t(this, M) !== null && (t(this, qt).call(this), this.refresh()));
|
|
506
506
|
}
|
|
507
507
|
}
|
|
508
508
|
})), t(this, V).observe(t(this, x)));
|
|
@@ -534,7 +534,8 @@ const Ie = class Ie {
|
|
|
534
534
|
}, "#adjustBufferRows"));
|
|
535
535
|
d(this, lt, /* @__PURE__ */ h((i) => {
|
|
536
536
|
var u, b;
|
|
537
|
-
|
|
537
|
+
T.log("rowManager.#handleScroll()", t(this, M));
|
|
538
|
+
const e = t(this, M);
|
|
538
539
|
if (!e || e <= 0) return;
|
|
539
540
|
const s = t(this, P).data.length;
|
|
540
541
|
if (s === 0) return;
|
|
@@ -604,14 +605,14 @@ const Ie = class Ie {
|
|
|
604
605
|
y(this, P, i.getRootNode().host), y(this, x, i), t(this, Dt).call(this);
|
|
605
606
|
}
|
|
606
607
|
getRowHeight() {
|
|
607
|
-
return t(this,
|
|
608
|
+
return t(this, M);
|
|
608
609
|
}
|
|
609
610
|
templateLength(i = ".ng-container-body") {
|
|
610
611
|
var e;
|
|
611
612
|
return ((e = t(this, D).get(i)) == null ? void 0 : e.length) || 1;
|
|
612
613
|
}
|
|
613
614
|
};
|
|
614
|
-
P = new WeakMap(), x = new WeakMap(), Q = new WeakMap(), D = new WeakMap(),
|
|
615
|
+
P = new WeakMap(), x = new WeakMap(), Q = new WeakMap(), D = new WeakMap(), M = new WeakMap(), V = new WeakMap(), tt = new WeakMap(), wt = new WeakMap(), Se = new WeakMap(), Ee = new WeakMap(), Ot = new WeakMap(), Bt = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), At = new WeakMap(), zt = new WeakMap(), Dt = new WeakMap(), qt = new WeakMap(), Ae = new WeakMap(), lt = new WeakMap(), Rt = new WeakMap(), Pt = new WeakMap(), h(Ie, "RowManager");
|
|
615
616
|
let ce = Ie;
|
|
616
617
|
const jt = class jt {
|
|
617
618
|
/**
|
|
@@ -1014,29 +1015,29 @@ const _e = class _e extends HTMLElement {
|
|
|
1014
1015
|
Kt = new WeakMap(), Tt = new WeakMap(), h(_e, "NineTableSheets");
|
|
1015
1016
|
let de = _e;
|
|
1016
1017
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", de);
|
|
1017
|
-
var
|
|
1018
|
+
var I, Zt, kt, Gt;
|
|
1018
1019
|
const Ne = class Ne {
|
|
1019
1020
|
constructor(i) {
|
|
1020
|
-
d(this,
|
|
1021
|
+
d(this, I);
|
|
1021
1022
|
d(this, Zt, /* @__PURE__ */ h(() => {
|
|
1022
1023
|
t(this, Gt).call(this), new ResizeObserver((i) => {
|
|
1023
1024
|
for (let e of i)
|
|
1024
|
-
t(this,
|
|
1025
|
-
}).observe(t(this,
|
|
1025
|
+
t(this, I).getAttribute("auto-height") === "true" && t(this, kt).call(this);
|
|
1026
|
+
}).observe(t(this, I));
|
|
1026
1027
|
}, "#init"));
|
|
1027
1028
|
d(this, kt, /* @__PURE__ */ h(() => {
|
|
1028
1029
|
var c, l;
|
|
1029
|
-
const i = Array.from(t(this,
|
|
1030
|
+
const i = Array.from(t(this, I).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
1030
1031
|
if (i.length === 0) return;
|
|
1031
|
-
const e = parseInt(t(this,
|
|
1032
|
-
t(this,
|
|
1032
|
+
const e = parseInt(t(this, I).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), r = (c = t(this, I).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, n = (l = t(this, I).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = It.SCROLLBAR_SIZE, a = e * s + r + n + o;
|
|
1033
|
+
t(this, I).style.height = `${a}px`;
|
|
1033
1034
|
}, "#applyAutoHeight"));
|
|
1034
1035
|
d(this, Gt, /* @__PURE__ */ h(() => {
|
|
1035
|
-
const e = Array.from(t(this,
|
|
1036
|
+
const e = Array.from(t(this, I).children).filter((c) => c.tagName === "TABLE"), s = t(this, I).getAttribute("auto-height") === "true", r = e.length, n = e.map((c, l) => {
|
|
1036
1037
|
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, b = l < r - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
1037
1038
|
return u + b;
|
|
1038
1039
|
}).join(""), o = e.map((c, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
1039
|
-
t(this,
|
|
1040
|
+
t(this, I).shadowRoot.innerHTML = `
|
|
1040
1041
|
<style>
|
|
1041
1042
|
:host {
|
|
1042
1043
|
display: flex;
|
|
@@ -1156,18 +1157,18 @@ const Ne = class Ne {
|
|
|
1156
1157
|
<nine-table-analysis></nine-table-analysis>
|
|
1157
1158
|
</nine-table-body>
|
|
1158
1159
|
<nine-table-footer></nine-table-footer>
|
|
1159
|
-
`, t(this,
|
|
1160
|
-
const a = t(this,
|
|
1160
|
+
`, t(this, I).shadowRoot.querySelector("nine-table-sheets").classList.add("nodata");
|
|
1161
|
+
const a = t(this, I).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1161
1162
|
a == null || a.forEach((c, l) => {
|
|
1162
1163
|
e[l] && setTimeout(() => {
|
|
1163
1164
|
c.generate(e[l]), s && t(this, kt).call(this);
|
|
1164
1165
|
});
|
|
1165
1166
|
});
|
|
1166
1167
|
}, "#render"));
|
|
1167
|
-
y(this,
|
|
1168
|
+
y(this, I, i), t(this, Zt).call(this);
|
|
1168
1169
|
}
|
|
1169
1170
|
};
|
|
1170
|
-
|
|
1171
|
+
I = new WeakMap(), Zt = new WeakMap(), kt = new WeakMap(), Gt = new WeakMap(), h(Ne, "LayoutManager");
|
|
1171
1172
|
let fe = Ne;
|
|
1172
1173
|
var Ct, ht;
|
|
1173
1174
|
const We = class We {
|