@ninebone/table 0.0.587 → 0.0.588
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 +32 -31
- 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,13 +354,13 @@ const $e = class $e extends HTMLElement {
|
|
|
354
354
|
F = new WeakMap(), ot = new WeakMap(), J = new WeakMap(), q = new WeakMap(), mt = new WeakMap(), xt = new WeakMap(), Nt = new WeakMap(), h($e, "NineTableVScrollBar");
|
|
355
355
|
let le = $e;
|
|
356
356
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", le);
|
|
357
|
-
var
|
|
357
|
+
var P, S, Q, D, I, V, tt, vt, Se, Ee, Wt, Ot, Bt, wt, St, zt, Dt, Et, Ae, at, At, Pt;
|
|
358
358
|
const Ie = class Ie {
|
|
359
359
|
constructor(r) {
|
|
360
|
-
d(this,
|
|
360
|
+
d(this, P);
|
|
361
361
|
d(this, S);
|
|
362
362
|
d(this, Q);
|
|
363
|
-
d(this,
|
|
363
|
+
d(this, D, /* @__PURE__ */ new Map());
|
|
364
364
|
d(this, I, null);
|
|
365
365
|
d(this, V, null);
|
|
366
366
|
d(this, tt, 0);
|
|
@@ -379,7 +379,7 @@ const Ie = class Ie {
|
|
|
379
379
|
W.log("rowManager.initialize"), p(this, Q, {
|
|
380
380
|
scrollTables: t(this, S).querySelectorAll(".ng-part-body table"),
|
|
381
381
|
firstTr: t(this, S).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
382
|
-
}), p(this, I, null), t(this,
|
|
382
|
+
}), p(this, I, null), t(this, D).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
383
383
|
const a = t(this, S).querySelector(o);
|
|
384
384
|
if (!a) return;
|
|
385
385
|
const c = a.querySelector(".ng-part-body table");
|
|
@@ -387,7 +387,7 @@ const Ie = class Ie {
|
|
|
387
387
|
const l = c.querySelector("tbody.bindable-tbody");
|
|
388
388
|
if (!l) return;
|
|
389
389
|
const u = Array.from(l.querySelectorAll("tr")).map((g) => g.cloneNode(!0));
|
|
390
|
-
t(this,
|
|
390
|
+
t(this, D).set(o, u);
|
|
391
391
|
});
|
|
392
392
|
const r = t(this, S).querySelector(".ng-container-body .ng-part-body"), e = t(this, S).querySelector(".ng-container-left .ng-part-body"), s = t(this, S).querySelector(".ng-container-right .ng-part-body"), i = t(this, S).querySelector(".ng-container-body .ng-part-header"), n = t(this, S).querySelector(".ng-container-body .ng-part-footer");
|
|
393
393
|
if (r) {
|
|
@@ -408,7 +408,7 @@ const Ie = class Ie {
|
|
|
408
408
|
}, "initialize"));
|
|
409
409
|
d(this, Ot, /* @__PURE__ */ h((r, e) => {
|
|
410
410
|
W.log("rowManager.#renderRows");
|
|
411
|
-
const s = t(this,
|
|
411
|
+
const s = t(this, D).get(e);
|
|
412
412
|
if (!s || s.length === 0) return;
|
|
413
413
|
const i = r.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
414
414
|
if (!i) return;
|
|
@@ -424,7 +424,7 @@ const Ie = class Ie {
|
|
|
424
424
|
if (W.log("rowManager.#measureAndCacheHeight"), t(this, I) !== null && t(this, I) > 0)
|
|
425
425
|
return t(this, I);
|
|
426
426
|
W.log("#measureAndCacheHeight");
|
|
427
|
-
const e = t(this,
|
|
427
|
+
const e = t(this, D).get(".ng-container-body");
|
|
428
428
|
if (!e || e.length === 0) return 24;
|
|
429
429
|
const s = r.querySelector("tbody.bindable-tbody");
|
|
430
430
|
if (!s) return 24;
|
|
@@ -443,7 +443,7 @@ const Ie = class Ie {
|
|
|
443
443
|
}, "#measureAndCacheHeight"));
|
|
444
444
|
d(this, wt, /* @__PURE__ */ h(() => {
|
|
445
445
|
W.log("rowManager.#updateVirtualScrollHeight");
|
|
446
|
-
const e = (t(this,
|
|
446
|
+
const e = (t(this, P).data.get() || []).length, s = t(this, I), i = e * s;
|
|
447
447
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
448
448
|
const o = t(this, S).querySelector(n);
|
|
449
449
|
if (!o) return;
|
|
@@ -484,7 +484,7 @@ const Ie = class Ie {
|
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
486
|
}, "#syncRowHeights"));
|
|
487
|
-
d(this,
|
|
487
|
+
d(this, Dt, /* @__PURE__ */ h(() => {
|
|
488
488
|
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (p(this, V, new ResizeObserver((r) => {
|
|
489
489
|
for (const e of r) {
|
|
490
490
|
const s = e.target;
|
|
@@ -504,7 +504,7 @@ const Ie = class Ie {
|
|
|
504
504
|
W.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((r) => {
|
|
505
505
|
const e = t(this, S).querySelector(r);
|
|
506
506
|
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Ot).call(this, e, r);
|
|
507
|
-
}), t(this,
|
|
507
|
+
}), t(this, Pt).call(this), t(this, zt).call(this);
|
|
508
508
|
}, "#renderAllContainers"));
|
|
509
509
|
d(this, Ae, /* @__PURE__ */ h((r) => {
|
|
510
510
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
@@ -513,14 +513,14 @@ const Ie = class Ie {
|
|
|
513
513
|
if (!s) return;
|
|
514
514
|
const i = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
515
515
|
if (!i) return;
|
|
516
|
-
const n = Array.from(i.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this,
|
|
516
|
+
const n = Array.from(i.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this, D).get(e)) == null ? void 0 : l.length) || 1, c = (t(this, P).data.get() || []).length;
|
|
517
517
|
n.forEach((f, u) => {
|
|
518
518
|
const g = r + Math.floor(u / o);
|
|
519
519
|
if (g >= c) {
|
|
520
520
|
f.style.display = "none";
|
|
521
521
|
return;
|
|
522
522
|
}
|
|
523
|
-
const b = t(this,
|
|
523
|
+
const b = t(this, P).data.get(g);
|
|
524
524
|
f.style.display = "", t(this, At).call(this, f, b, g);
|
|
525
525
|
});
|
|
526
526
|
});
|
|
@@ -529,9 +529,9 @@ const Ie = class Ie {
|
|
|
529
529
|
var f, u;
|
|
530
530
|
const e = t(this, I);
|
|
531
531
|
if (!e || e <= 0) return;
|
|
532
|
-
const s = t(this,
|
|
532
|
+
const s = t(this, P).data.length;
|
|
533
533
|
if (s === 0) return;
|
|
534
|
-
const i = ((f = t(this,
|
|
534
|
+
const i = ((f = t(this, D).get(".ng-container-body")) == null ? void 0 : f.length) || 1, n = Math.max(0, s - 1), o = Math.min(n, Math.max(0, Math.floor(r / e))), a = Math.floor(o * e), c = t(this, Q).firstTr, l = c && c.dataset.row !== void 0 ? parseInt(c.dataset.row, 10) : -1;
|
|
535
535
|
(u = t(this, Q)) == null || u.scrollTables.forEach((g) => {
|
|
536
536
|
g.style.transform = `translate3d(0, ${a}px, 0)`;
|
|
537
537
|
}), l !== o && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
|
|
@@ -545,7 +545,7 @@ const Ie = class Ie {
|
|
|
545
545
|
E.style.display = "none";
|
|
546
546
|
return;
|
|
547
547
|
}
|
|
548
|
-
const T = t(this,
|
|
548
|
+
const T = t(this, P).data.get(M);
|
|
549
549
|
E.style.display = "", t(this, At).call(this, E, T, M);
|
|
550
550
|
});
|
|
551
551
|
});
|
|
@@ -571,7 +571,7 @@ const Ie = class Ie {
|
|
|
571
571
|
o && typeof o.refresh == "function" && o.refresh();
|
|
572
572
|
});
|
|
573
573
|
}, "#bindRowData"));
|
|
574
|
-
d(this,
|
|
574
|
+
d(this, Pt, /* @__PURE__ */ h(() => {
|
|
575
575
|
var c, l, f;
|
|
576
576
|
W.log("rowManager.#syncHeaderHeights");
|
|
577
577
|
const r = t(this, S).querySelector(".ng-container-left .ng-part-header table"), e = t(this, S).querySelector(".ng-container-body .ng-part-header table"), s = t(this, S).querySelector(".ng-container-right .ng-part-header table");
|
|
@@ -589,17 +589,17 @@ const Ie = class Ie {
|
|
|
589
589
|
A(this, "destroy", /* @__PURE__ */ h(() => {
|
|
590
590
|
t(this, V) && (t(this, V).disconnect(), p(this, V, null));
|
|
591
591
|
}, "destroy"));
|
|
592
|
-
p(this,
|
|
592
|
+
p(this, P, r.getRootNode().host), p(this, S, r), t(this, Dt).call(this);
|
|
593
593
|
}
|
|
594
594
|
getRowHeight() {
|
|
595
595
|
return t(this, I);
|
|
596
596
|
}
|
|
597
597
|
templateLength(r = ".ng-container-body") {
|
|
598
598
|
var e;
|
|
599
|
-
return ((e = t(this,
|
|
599
|
+
return ((e = t(this, D).get(r)) == null ? void 0 : e.length) || 1;
|
|
600
600
|
}
|
|
601
601
|
};
|
|
602
|
-
|
|
602
|
+
P = new WeakMap(), S = new WeakMap(), Q = new WeakMap(), D = new WeakMap(), I = new WeakMap(), V = new WeakMap(), tt = new WeakMap(), vt = new WeakMap(), Se = new WeakMap(), Ee = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), Bt = new WeakMap(), wt = new WeakMap(), St = new WeakMap(), zt = new WeakMap(), Dt = new WeakMap(), Et = new WeakMap(), Ae = new WeakMap(), at = new WeakMap(), At = new WeakMap(), Pt = new WeakMap(), h(Ie, "RowManager");
|
|
603
603
|
let ce = Ie;
|
|
604
604
|
const jt = class jt {
|
|
605
605
|
/**
|
|
@@ -698,14 +698,15 @@ const pt = class pt extends HTMLElement {
|
|
|
698
698
|
].forEach(({ selector: s, type: i }) => {
|
|
699
699
|
const n = this.querySelector(s);
|
|
700
700
|
if (!n) return;
|
|
701
|
-
|
|
702
|
-
|
|
701
|
+
n.querySelector(".ng-part-header");
|
|
702
|
+
const o = document.createElement("div");
|
|
703
|
+
o.className = "ng-part-body";
|
|
704
|
+
const a = document.createElement("div");
|
|
705
|
+
a.className = "ng-scroll-content", a.style.position = "relative", a.style.width = "100%", a.appendChild(t(this, Rt).call(this, t(this, lt), i, "body"));
|
|
703
706
|
const c = document.createElement("div");
|
|
704
|
-
c.className = "ng-
|
|
707
|
+
c.className = "ng-virtual-spacer", c.style.width = "100%", c.style.pointerEvents = "none", a.appendChild(c), o.appendChild(a);
|
|
705
708
|
const l = document.createElement("div");
|
|
706
|
-
l.className = "ng-
|
|
707
|
-
const f = document.createElement("div");
|
|
708
|
-
f.className = "ng-part-footer", f.appendChild(t(this, Rt).call(this, t(this, lt), i, "footer")), n.appendChild(o), n.appendChild(a), n.appendChild(f);
|
|
709
|
+
l.className = "ng-part-footer", l.appendChild(t(this, Rt).call(this, t(this, lt), i, "footer")), n.appendChild(o), n.appendChild(l);
|
|
709
710
|
});
|
|
710
711
|
}, "#renderSplitContainers"));
|
|
711
712
|
d(this, Yt, /* @__PURE__ */ h(() => {
|
|
@@ -1430,7 +1431,7 @@ const yt = class yt extends HTMLElement {
|
|
|
1430
1431
|
h(yt, "BasicCellElement"), A(yt, "_styleCache", /* @__PURE__ */ new Map()), A(yt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1431
1432
|
let me = yt;
|
|
1432
1433
|
var C, Ht, y, Re, qe, Te, ke, Ce;
|
|
1433
|
-
const
|
|
1434
|
+
const De = class De extends me {
|
|
1434
1435
|
constructor() {
|
|
1435
1436
|
super();
|
|
1436
1437
|
d(this, C);
|
|
@@ -1525,9 +1526,9 @@ const Pe = class Pe extends me {
|
|
|
1525
1526
|
return parseInt(t(this, y).dataset.row), t(this, Ht).data[e];
|
|
1526
1527
|
}
|
|
1527
1528
|
};
|
|
1528
|
-
C = new WeakMap(), Ht = new WeakMap(), y = new WeakMap(), Re = new WeakMap(), qe = new WeakMap(), Te = new WeakMap(), ke = new WeakMap(), Ce = new WeakMap(), h(
|
|
1529
|
-
let xe =
|
|
1530
|
-
const
|
|
1529
|
+
C = new WeakMap(), Ht = new WeakMap(), y = new WeakMap(), Re = new WeakMap(), qe = new WeakMap(), Te = new WeakMap(), ke = new WeakMap(), Ce = new WeakMap(), h(De, "CellElement");
|
|
1530
|
+
let xe = De;
|
|
1531
|
+
const Pe = class Pe extends xe {
|
|
1531
1532
|
constructor() {
|
|
1532
1533
|
super();
|
|
1533
1534
|
}
|
|
@@ -1538,8 +1539,8 @@ const De = class De extends xe {
|
|
|
1538
1539
|
return super.refresh();
|
|
1539
1540
|
}
|
|
1540
1541
|
};
|
|
1541
|
-
h(
|
|
1542
|
-
let ve =
|
|
1542
|
+
h(Pe, "EditableCellElement");
|
|
1543
|
+
let ve = Pe;
|
|
1543
1544
|
var Mt, nt, ut, gt, ne, U, Le;
|
|
1544
1545
|
const je = class je extends ve {
|
|
1545
1546
|
constructor() {
|