@ninebone/table 0.1.41 β 0.1.43
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/css/layout.css +0 -470
- package/dist/css/nine-table-hscrollbar.css +0 -3
- package/dist/css/nine-table-sheet.css +0 -540
- package/dist/css/nine-table-vscrollbar.css +0 -4
- package/dist/css/table.css +0 -22
- package/dist/nine-table.js +586 -578
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +24 -25
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -53,8 +53,8 @@ nine.measureTextSize = (k, r = "12px sans-serif") => {
|
|
|
53
53
|
for (let l of k.split("<br>")) {
|
|
54
54
|
const a = e(l), c = i.measureText(a);
|
|
55
55
|
n = Math.max(n, c.width);
|
|
56
|
-
const u = c.fontBoundingBoxAscent || 10,
|
|
57
|
-
o += u +
|
|
56
|
+
const u = c.fontBoundingBoxAscent || 10, f = c.fontBoundingBoxDescent || 3;
|
|
57
|
+
o += u + f;
|
|
58
58
|
}
|
|
59
59
|
return {
|
|
60
60
|
width: n,
|
|
@@ -68,7 +68,7 @@ const qo = class qo extends sa.constructor {
|
|
|
68
68
|
};
|
|
69
69
|
h(qo, "Trace");
|
|
70
70
|
let vn = qo;
|
|
71
|
-
const
|
|
71
|
+
const S = new vn(), jt = {
|
|
72
72
|
META: {
|
|
73
73
|
INDEX: {
|
|
74
74
|
ROWID: 0,
|
|
@@ -356,11 +356,11 @@ const No = class No {
|
|
|
356
356
|
}), p(this, Y, Array.from(r, ([e, s]) => ({ name: e, type: s }))), p(this, Y, t(this, Y).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, Y).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
357
357
|
}, "#adjust"));
|
|
358
358
|
d(this, Yi, /* @__PURE__ */ h(() => {
|
|
359
|
-
p(this, Y, []),
|
|
359
|
+
p(this, Y, []), S.log(t(this, as).querySelectorAll("table"));
|
|
360
360
|
const r = Array.from(t(this, as).querySelectorAll("table"));
|
|
361
361
|
if (!(!r || r.length === 0)) {
|
|
362
362
|
for (const e of r)
|
|
363
|
-
|
|
363
|
+
S.log(e), e.querySelectorAll("[data-bind]").forEach((i) => {
|
|
364
364
|
const n = i.dataset.bind, o = i.getAttribute("data-type") || "string";
|
|
365
365
|
n && t(this, Y).push({ name: n, type: o });
|
|
366
366
|
}), [
|
|
@@ -424,7 +424,7 @@ const No = class No {
|
|
|
424
424
|
}
|
|
425
425
|
};
|
|
426
426
|
as = new WeakMap(), Y = new WeakMap(), zs = new WeakMap(), Yi = new WeakMap(), h(No, "fields");
|
|
427
|
-
let
|
|
427
|
+
let Rn = No;
|
|
428
428
|
var Zi;
|
|
429
429
|
const Do = class Do extends HTMLElement {
|
|
430
430
|
constructor() {
|
|
@@ -437,20 +437,20 @@ const Do = class Do extends HTMLElement {
|
|
|
437
437
|
}
|
|
438
438
|
};
|
|
439
439
|
Zi = new WeakMap(), h(Do, "NineTableSheets");
|
|
440
|
-
let
|
|
441
|
-
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets",
|
|
442
|
-
var
|
|
440
|
+
let Ln = Do;
|
|
441
|
+
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", Ln);
|
|
442
|
+
var Wt, Ji, Bs, Qi, Sl;
|
|
443
443
|
const $o = class $o extends HTMLElement {
|
|
444
444
|
constructor() {
|
|
445
445
|
super();
|
|
446
446
|
d(this, Qi);
|
|
447
|
-
d(this,
|
|
447
|
+
d(this, Wt);
|
|
448
448
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
449
|
-
this.querySelector("#row-count").innerHTML = t(this,
|
|
449
|
+
this.querySelector("#row-count").innerHTML = t(this, Wt).data.count().toLocaleString();
|
|
450
450
|
}, "refresh"));
|
|
451
451
|
d(this, Ji, /* @__PURE__ */ h(() => {
|
|
452
452
|
var e;
|
|
453
|
-
p(this,
|
|
453
|
+
p(this, Wt, this.getRootNode().host), A(this, Qi, Sl).call(this), (e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
454
454
|
const i = s.ctrlKey || s.metaKey || s.shiftKey, n = s.target.closest("nt-sheets-tab-item");
|
|
455
455
|
if (!n) return;
|
|
456
456
|
const o = parseInt(n.dataset.index, 10);
|
|
@@ -459,35 +459,35 @@ const $o = class $o extends HTMLElement {
|
|
|
459
459
|
}, "#init"));
|
|
460
460
|
d(this, Bs, /* @__PURE__ */ h((e, s = !1) => {
|
|
461
461
|
const i = /* @__PURE__ */ h(() => {
|
|
462
|
-
const u = Array.from(t(this,
|
|
463
|
-
Array.from(t(this,
|
|
464
|
-
const
|
|
465
|
-
if (!(
|
|
466
|
-
for (let b = 0; b <
|
|
467
|
-
const m =
|
|
462
|
+
const u = Array.from(t(this, Wt).shadowRoot.querySelectorAll("nine-table-sheet"));
|
|
463
|
+
Array.from(t(this, Wt).shadowRoot.querySelectorAll("nine-splitter")).forEach((b) => b.style.setProperty("display", "none"));
|
|
464
|
+
const g = u.map((b, m) => ({ sheet: b, idx: m })).filter(({ sheet: b }) => b.classList.contains("active"));
|
|
465
|
+
if (!(g.length < 2))
|
|
466
|
+
for (let b = 0; b < g.length - 1; b++) {
|
|
467
|
+
const m = g[b].idx, y = t(this, Wt).shadowRoot.querySelector(`nine-splitter[data-split-index="${m}"]`);
|
|
468
468
|
y && y.style.setProperty("display", "");
|
|
469
469
|
}
|
|
470
|
-
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"), o = t(this,
|
|
470
|
+
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"), o = t(this, Wt).shadowRoot.querySelector("nine-table-sheets-body"), l = n.querySelectorAll("nt-sheets-tab-item"), a = o.querySelectorAll("nine-table-sheet");
|
|
471
471
|
if (!l[e]) return;
|
|
472
472
|
if (!s)
|
|
473
|
-
l.forEach((u,
|
|
474
|
-
u.setActive(
|
|
475
|
-
}), a.forEach((u,
|
|
476
|
-
const
|
|
477
|
-
u.classList.toggle("active",
|
|
473
|
+
l.forEach((u, f) => {
|
|
474
|
+
u.setActive(f === e);
|
|
475
|
+
}), a.forEach((u, f) => {
|
|
476
|
+
const g = f === e;
|
|
477
|
+
u.classList.toggle("active", g), u.style.flex = g ? "1 1 100%" : "";
|
|
478
478
|
});
|
|
479
479
|
else {
|
|
480
|
-
const u = l[e],
|
|
481
|
-
if (u.classList.contains("active") &&
|
|
480
|
+
const u = l[e], f = n.querySelectorAll("nt-sheets-tab-item.active");
|
|
481
|
+
if (u.classList.contains("active") && f.length <= 1)
|
|
482
482
|
return;
|
|
483
483
|
u.classList.toggle("active");
|
|
484
|
-
const
|
|
485
|
-
|
|
484
|
+
const g = o.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
485
|
+
g && (g.classList.toggle("active"), g.classList.contains("active") || (g.style.flex = ""));
|
|
486
486
|
}
|
|
487
487
|
const c = o.querySelectorAll("nine-table-sheet.active");
|
|
488
488
|
c == null || c.forEach((u) => {
|
|
489
|
-
var
|
|
490
|
-
u.style.flex = c.length > 1 ? "1 1 0%" : "1 1 100%", typeof u.refreshLayout == "function" ? u.refreshLayout() : (
|
|
489
|
+
var f;
|
|
490
|
+
u.style.flex = c.length > 1 ? "1 1 0%" : "1 1 100%", typeof u.refreshLayout == "function" ? u.refreshLayout() : (f = u.invalidate) == null || f.call(u);
|
|
491
491
|
}), i();
|
|
492
492
|
}, "#switchSheet"));
|
|
493
493
|
}
|
|
@@ -495,8 +495,8 @@ const $o = class $o extends HTMLElement {
|
|
|
495
495
|
t(this, Ji).call(this);
|
|
496
496
|
}
|
|
497
497
|
};
|
|
498
|
-
|
|
499
|
-
const i = Array.from(t(this,
|
|
498
|
+
Wt = new WeakMap(), Ji = new WeakMap(), Bs = new WeakMap(), Qi = new WeakSet(), Sl = /* @__PURE__ */ h(function() {
|
|
499
|
+
const i = Array.from(t(this, Wt).children).filter((n) => n.tagName.toUpperCase() === "TABLE").map((n, o) => {
|
|
500
500
|
const l = o === 0 ? "active" : "", a = n.getAttribute("caption") || `Sheet ${o + 1}`;
|
|
501
501
|
return `<nt-sheets-tab-item class="${l}" data-index="${o}">${a}</nt-sheets-tab-item>`;
|
|
502
502
|
}).join("");
|
|
@@ -520,16 +520,16 @@ h(Fo, "SheetTabItem");
|
|
|
520
520
|
let Tn = Fo;
|
|
521
521
|
customElements.get("nt-sheets-tab-item") || customElements.define("nt-sheets-tab-item", Tn);
|
|
522
522
|
customElements.get("nine-table-sheets-footer") || customElements.define("nine-table-sheets-footer", Cn);
|
|
523
|
-
var At, cs,
|
|
523
|
+
var At, cs, Re, Al, El, Rl;
|
|
524
524
|
const Wo = class Wo extends HTMLElement {
|
|
525
525
|
constructor() {
|
|
526
526
|
super(...arguments);
|
|
527
|
-
d(this,
|
|
527
|
+
d(this, Re);
|
|
528
528
|
d(this, At);
|
|
529
529
|
d(this, cs);
|
|
530
530
|
}
|
|
531
531
|
connectedCallback() {
|
|
532
|
-
p(this, At, this.getRootNode().host), A(this,
|
|
532
|
+
p(this, At, this.getRootNode().host), A(this, Re, Al).call(this), A(this, Re, Rl).call(this);
|
|
533
533
|
}
|
|
534
534
|
addCustomElement(e) {
|
|
535
535
|
t(this, cs) && t(this, cs).append(e);
|
|
@@ -539,7 +539,7 @@ const Wo = class Wo extends HTMLElement {
|
|
|
539
539
|
s && (s.textContent = e);
|
|
540
540
|
}
|
|
541
541
|
};
|
|
542
|
-
At = new WeakMap(), cs = new WeakMap(),
|
|
542
|
+
At = new WeakMap(), cs = new WeakMap(), Re = new WeakSet(), Al = /* @__PURE__ */ h(function() {
|
|
543
543
|
this.innerHTML = `
|
|
544
544
|
<div class="ng-toolbar-left">
|
|
545
545
|
<button type="button" class="ng-toolbar-menu-btn" title="Menu">
|
|
@@ -553,11 +553,11 @@ At = new WeakMap(), cs = new WeakMap(), Le = new WeakSet(), Al = /* @__PURE__ */
|
|
|
553
553
|
</div>
|
|
554
554
|
|
|
555
555
|
<div class="ng-toolbar-custom" id="custom-container"></div>
|
|
556
|
-
`, p(this, cs, this.querySelector("#custom-container")), A(this,
|
|
556
|
+
`, p(this, cs, this.querySelector("#custom-container")), A(this, Re, El).call(this);
|
|
557
557
|
}, "#render"), El = /* @__PURE__ */ h(function() {
|
|
558
558
|
const e = t(this, At).getAttribute("theme") === "simple" || t(this, At).classList.contains("simple"), s = t(this, At).getAttribute("show-toolbar") !== "false", i = t(this, At).getAttribute("show-menu") !== "false", n = t(this, At).getAttribute("caption") || "";
|
|
559
559
|
e || !s ? this.setAttribute("hidden", "") : this.removeAttribute("hidden"), this.setAttribute("show-menu", i ? "true" : "false"), this.updateCaption(n);
|
|
560
|
-
}, "#syncStateFromHost"),
|
|
560
|
+
}, "#syncStateFromHost"), Rl = /* @__PURE__ */ h(function() {
|
|
561
561
|
const e = this.querySelector(".ng-toolbar-title");
|
|
562
562
|
e && e.addEventListener("dblclick", () => {
|
|
563
563
|
const i = '<font color="green">https://www.ninegrid.net</font>', n = t(this, At).getAttribute("caption") || "";
|
|
@@ -574,37 +574,37 @@ At = new WeakMap(), cs = new WeakMap(), Le = new WeakSet(), Al = /* @__PURE__ */
|
|
|
574
574
|
}, "#bindEvents"), h(Wo, "Toolbar");
|
|
575
575
|
let kn = Wo;
|
|
576
576
|
customElements.get("nine-table-toolbar") || customElements.define("nine-table-toolbar", kn);
|
|
577
|
-
var
|
|
577
|
+
var Ot, Te, N, ke, Ie, qe, tr, Me, er;
|
|
578
578
|
const Oo = class Oo extends HTMLElement {
|
|
579
579
|
constructor() {
|
|
580
580
|
super();
|
|
581
|
-
d(this,
|
|
581
|
+
d(this, Ot);
|
|
582
582
|
d(this, Te, !1);
|
|
583
583
|
d(this, N);
|
|
584
584
|
d(this, ke);
|
|
585
585
|
d(this, Ie);
|
|
586
586
|
d(this, qe);
|
|
587
587
|
d(this, tr, /* @__PURE__ */ h(() => {
|
|
588
|
-
if (!t(this,
|
|
589
|
-
const e = t(this,
|
|
588
|
+
if (!t(this, Ot)) return;
|
|
589
|
+
const e = t(this, Ot).querySelector(".ng-sheet-body .ng-container-body");
|
|
590
590
|
e && (p(this, qe, new ResizeObserver(() => {
|
|
591
591
|
this.refresh();
|
|
592
592
|
})), t(this, qe).observe(e));
|
|
593
593
|
}, "#observeResize"));
|
|
594
594
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
595
|
-
if (!t(this,
|
|
595
|
+
if (!t(this, Ot) || !t(this, N) || t(this, Te)) return;
|
|
596
596
|
const e = t(this, N).container, s = e.querySelector("table");
|
|
597
597
|
if (!s) return;
|
|
598
598
|
const i = t(this, N).track, n = t(this, N).thumb, o = e.clientWidth, l = s.scrollWidth, a = o !== 0 && l > o;
|
|
599
|
-
if (t(this,
|
|
599
|
+
if (t(this, Ot).classList.toggle("hscroll-visible", a), !a)
|
|
600
600
|
return;
|
|
601
601
|
const c = i.clientWidth;
|
|
602
602
|
if (c <= 0) return;
|
|
603
603
|
const u = Math.max(Math.min(c * (o / l), c), 20);
|
|
604
604
|
n.style.width = `${u}px`;
|
|
605
|
-
const
|
|
605
|
+
const f = e.scrollLeft, g = l - o;
|
|
606
606
|
let b = 0;
|
|
607
|
-
|
|
607
|
+
g > 0 && (b = parseInt(f / g * (c - u), 10)), b < 0 && (b = 0);
|
|
608
608
|
const m = c - u;
|
|
609
609
|
b > m && (b = m), n.style.left = `${b}px`, t(this, N).left.disabled = b === 0, t(this, N).right.disabled = b >= m - 1;
|
|
610
610
|
}, "refresh"));
|
|
@@ -617,12 +617,10 @@ const Oo = class Oo extends HTMLElement {
|
|
|
617
617
|
l < 0 && (l = 0);
|
|
618
618
|
const a = n.width - o;
|
|
619
619
|
l > a && (l = a), l = parseInt(l, 10), t(this, N).thumb.style.left = `${l}px`, t(this, N).left.disabled = l === 0, t(this, N).right.disabled = l >= a - 1;
|
|
620
|
-
const c = s.clientWidth,
|
|
621
|
-
if (a > 0 &&
|
|
622
|
-
const
|
|
623
|
-
s.scrollLeft =
|
|
624
|
-
const b = t(this, Et).querySelector(".ng-sheet-header .ng-container-body"), m = t(this, Et).querySelector(".ng-sheet-footer .ng-container-body");
|
|
625
|
-
b && (b.scrollLeft = f), m && (m.scrollLeft = f);
|
|
620
|
+
const c = s.clientWidth, f = i.scrollWidth - c;
|
|
621
|
+
if (a > 0 && f > 0) {
|
|
622
|
+
const g = l / a * f;
|
|
623
|
+
s.scrollLeft = g;
|
|
626
624
|
}
|
|
627
625
|
return l > 0 && l < a - 1;
|
|
628
626
|
}, "#thumbMoveTo"));
|
|
@@ -665,7 +663,7 @@ const Oo = class Oo extends HTMLElement {
|
|
|
665
663
|
}, "#init"));
|
|
666
664
|
}
|
|
667
665
|
connectedCallback() {
|
|
668
|
-
if (p(this,
|
|
666
|
+
if (p(this, Ot, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, Ot)) return;
|
|
669
667
|
this.innerHTML = `
|
|
670
668
|
<style>
|
|
671
669
|
nine-table-hscrollbar {
|
|
@@ -730,7 +728,7 @@ const Oo = class Oo extends HTMLElement {
|
|
|
730
728
|
<button class='ng-scroll-right' disabled><div class='ng-scroll-icon'></div></button>
|
|
731
729
|
`;
|
|
732
730
|
const e = /* @__PURE__ */ h(() => {
|
|
733
|
-
const s = t(this,
|
|
731
|
+
const s = t(this, Ot).querySelector(".ng-sheet-body .ng-container-body");
|
|
734
732
|
if (!s) {
|
|
735
733
|
setTimeout(e, 10);
|
|
736
734
|
return;
|
|
@@ -749,7 +747,7 @@ const Oo = class Oo extends HTMLElement {
|
|
|
749
747
|
t(this, qe) && t(this, qe).disconnect();
|
|
750
748
|
}
|
|
751
749
|
};
|
|
752
|
-
|
|
750
|
+
Ot = new WeakMap(), Te = new WeakMap(), N = new WeakMap(), ke = new WeakMap(), Ie = new WeakMap(), qe = new WeakMap(), tr = new WeakMap(), Me = new WeakMap(), er = new WeakMap(), h(Oo, "NineTableHScrollBar");
|
|
753
751
|
let In = Oo;
|
|
754
752
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", In);
|
|
755
753
|
var sr, M, He, F, Vs, So, Ps, Ne, ir, rr;
|
|
@@ -764,11 +762,11 @@ const zo = class zo extends HTMLElement {
|
|
|
764
762
|
d(this, So, 0);
|
|
765
763
|
d(this, Ps, 0);
|
|
766
764
|
d(this, Ne, /* @__PURE__ */ h(() => {
|
|
767
|
-
var u,
|
|
765
|
+
var u, f;
|
|
768
766
|
const e = t(this, M).view.getArray(), s = e ? e.length : 0, i = (u = t(this, M).elements) == null ? void 0 : u.scrollHolder;
|
|
769
767
|
let n = i && parseFloat(i.style.height) || 0;
|
|
770
768
|
if (!n || n <= 0)
|
|
771
|
-
if (!!((
|
|
769
|
+
if (!!((f = t(this, M).sourceTable) != null && f.querySelector("tbody tr[grouping='true']")) && t(this, M).rowManager)
|
|
772
770
|
n = body.scrollHeight > body.clientHeight ? body.scrollHeight : s * 30;
|
|
773
771
|
else {
|
|
774
772
|
const b = t(this, M).getRowHeight() || 1;
|
|
@@ -779,14 +777,14 @@ const zo = class zo extends HTMLElement {
|
|
|
779
777
|
return l && (a = o / n, c = o), { rawContentHeight: n, contentHeight: c, scaleFactor: a, useScaling: l, totalCount: s };
|
|
780
778
|
}, "#getScaleInfo"));
|
|
781
779
|
d(this, ir, /* @__PURE__ */ h(() => {
|
|
782
|
-
var l, a, c, u,
|
|
780
|
+
var l, a, c, u, f, g, b, m, y, x;
|
|
783
781
|
const e = t(this, F).container;
|
|
784
782
|
if (!e) return 0;
|
|
785
|
-
const s = ((c = (a = (l = t(this, M).elements) == null ? void 0 : l.body) == null ? void 0 : a.thead) == null ? void 0 : c.offsetHeight) || 0, i = ((
|
|
783
|
+
const s = ((c = (a = (l = t(this, M).elements) == null ? void 0 : l.body) == null ? void 0 : a.thead) == null ? void 0 : c.offsetHeight) || 0, i = ((g = (f = (u = t(this, M).elements) == null ? void 0 : u.body) == null ? void 0 : f.tfoot) == null ? void 0 : g.offsetHeight) || 0, n = ((x = (y = (m = (b = t(this, M).elements) == null ? void 0 : b.body) == null ? void 0 : m.tbody) == null ? void 0 : y.head) == null ? void 0 : x.offsetHeight) || 0, o = s + i + n;
|
|
786
784
|
return e.clientHeight - o;
|
|
787
785
|
}, "#getViewHeight"));
|
|
788
786
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
789
|
-
if (
|
|
787
|
+
if (S.log("=================", "vscrollbar.refresh"), t(this, He) || !t(this, M) || !t(this, M).elements || !t(this, F)) return;
|
|
790
788
|
const e = t(this, F).container, s = t(this, F).track, i = t(this, F).thumb, n = t(this, ir).call(this), { rawContentHeight: o, contentHeight: l } = t(this, Ne).call(this), a = o > n && o > 0 && n > 0;
|
|
791
789
|
if (t(this, M).classList.toggle("vscroll-visible", a), !a)
|
|
792
790
|
return;
|
|
@@ -794,14 +792,14 @@ const zo = class zo extends HTMLElement {
|
|
|
794
792
|
if (c <= 0) return;
|
|
795
793
|
const u = Math.max(Math.min(c * (n / l), c), 20);
|
|
796
794
|
i.style.height = `${u}px`;
|
|
797
|
-
const
|
|
795
|
+
const f = e.scrollTop, g = Math.max(l - t(this, M).rowManager.getRowHeight(), 1);
|
|
798
796
|
let b = 0;
|
|
799
|
-
|
|
797
|
+
g > 0 && (b = f / g * (c - u));
|
|
800
798
|
const m = c - u;
|
|
801
|
-
b < 0 && (b = 0), b > m && (b = m), i.style.top = `${b}px`, t(this, F).top.disabled =
|
|
799
|
+
b < 0 && (b = 0), b > m && (b = m), i.style.top = `${b}px`, t(this, F).top.disabled = f <= 0, t(this, F).bottom.disabled = f >= g - 1;
|
|
802
800
|
}, "refresh"));
|
|
803
801
|
d(this, rr, /* @__PURE__ */ h(() => {
|
|
804
|
-
|
|
802
|
+
S.log("nine-table-vscrollbar.#init");
|
|
805
803
|
const e = t(this, F).container;
|
|
806
804
|
t(this, F).thumb.addEventListener("mousedown", (s) => {
|
|
807
805
|
if (s.button !== 0) return;
|
|
@@ -809,12 +807,12 @@ const zo = class zo extends HTMLElement {
|
|
|
809
807
|
const n = t(this, F).track.getBoundingClientRect().height, o = t(this, F).thumb.clientHeight, l = n - o, a = /* @__PURE__ */ h((u) => {
|
|
810
808
|
var H, V;
|
|
811
809
|
if (!t(this, He) || l <= 0) return;
|
|
812
|
-
const
|
|
813
|
-
let
|
|
814
|
-
|
|
815
|
-
const b =
|
|
816
|
-
t(this, M).rowManager.scrollToDataRow(
|
|
817
|
-
const { rawContentHeight:
|
|
810
|
+
const f = u.clientY - t(this, Vs);
|
|
811
|
+
let g = t(this, Ps) + f;
|
|
812
|
+
g < 0 && (g = 0), g > l && (g = l), t(this, F).thumb.style.top = `${g}px`;
|
|
813
|
+
const b = g / l, m = t(this, M).getRowHeight(), y = (t(this, M).querySelector(".ng-sheet-body").offsetHeight || 0) - (((H = t(this, M).elements.body.thead) == null ? void 0 : H.offsetHeight) || 0) - (((V = t(this, M).elements.body.tfoot) == null ? void 0 : V.offsetHeight) || 0) - (t(this, M).elements.body.tbody.head.offsetHeight || 0), x = Math.floor(y / m), { totalCount: w } = t(this, Ne).call(this), v = Math.floor(b * (w - x + 1));
|
|
814
|
+
t(this, M).rowManager.scrollToDataRow(v);
|
|
815
|
+
const { rawContentHeight: L, contentHeight: C } = t(this, Ne).call(this), $ = t(this, F).container.scrollTop, T = Math.max(C - t(this, M).rowManager.getRowHeight(), 0);
|
|
818
816
|
t(this, F).top.disabled = $ <= 0, t(this, F).bottom.disabled = $ >= T - 1;
|
|
819
817
|
}, "onMouseMove"), c = /* @__PURE__ */ h(() => {
|
|
820
818
|
p(this, He, !1), document.removeEventListener("mousemove", a), document.removeEventListener("mouseup", c);
|
|
@@ -824,8 +822,8 @@ const zo = class zo extends HTMLElement {
|
|
|
824
822
|
if (s.button !== 0 || s.target === t(this, F).thumb) return;
|
|
825
823
|
const i = t(this, F).track.getBoundingClientRect(), n = t(this, F).thumb.clientHeight, l = t(this, F).track.clientHeight - n;
|
|
826
824
|
if (l > 0) {
|
|
827
|
-
const a = s.clientY - i.top - n / 2, c = Math.max(0, Math.min(1, a / l)), { totalCount: u } = t(this, Ne).call(this),
|
|
828
|
-
|
|
825
|
+
const a = s.clientY - i.top - n / 2, c = Math.max(0, Math.min(1, a / l)), { totalCount: u } = t(this, Ne).call(this), f = Math.max(0, Math.min(Math.floor(c * (u - 1)), u - 1));
|
|
826
|
+
S.log("π― [VScroll Track Click]", { ratio: c, clickY: a, totalCount: u, targetRow: f }), f >= 0 && t(this, M).rowManager && typeof t(this, M).rowManager.scrollToDataRow == "function" && t(this, M).rowManager.scrollToDataRow(f, "top");
|
|
829
827
|
}
|
|
830
828
|
this.refresh();
|
|
831
829
|
}), t(this, F).top.addEventListener("click", () => {
|
|
@@ -928,10 +926,10 @@ const Ae = {
|
|
|
928
926
|
NAME: 2,
|
|
929
927
|
CHILDREN: 3
|
|
930
928
|
};
|
|
931
|
-
var
|
|
929
|
+
var qt, Xs, De, $e, Fe;
|
|
932
930
|
const Bo = class Bo {
|
|
933
931
|
constructor(r) {
|
|
934
|
-
d(this,
|
|
932
|
+
d(this, qt);
|
|
935
933
|
d(this, Xs);
|
|
936
934
|
d(this, De, []);
|
|
937
935
|
d(this, $e, /* @__PURE__ */ new Map());
|
|
@@ -939,13 +937,13 @@ const Bo = class Bo {
|
|
|
939
937
|
d(this, Fe, !1);
|
|
940
938
|
E(this, "initialize", /* @__PURE__ */ h(() => {
|
|
941
939
|
let r = [];
|
|
942
|
-
const e = t(this,
|
|
940
|
+
const e = t(this, qt).sourceTable;
|
|
943
941
|
e && e.querySelectorAll('tbody tr[grouping="true"]').forEach((s) => {
|
|
944
942
|
const i = s.querySelector('[cell-type="tree"]');
|
|
945
943
|
i && i.dataset.bind && r.push(i.dataset.bind);
|
|
946
944
|
}), p(this, De, r);
|
|
947
945
|
}, "initialize"));
|
|
948
|
-
p(this,
|
|
946
|
+
p(this, qt, r), p(this, Xs, t(this, qt).getRootNode().host);
|
|
949
947
|
}
|
|
950
948
|
get columns() {
|
|
951
949
|
return t(this, De);
|
|
@@ -954,17 +952,17 @@ const Bo = class Bo {
|
|
|
954
952
|
return t(this, $e);
|
|
955
953
|
}
|
|
956
954
|
apply() {
|
|
957
|
-
if (
|
|
955
|
+
if (S.log("==================", "Grouping.Apply"), t(this, Fe)) return;
|
|
958
956
|
p(this, Fe, !0);
|
|
959
957
|
let r = [];
|
|
960
|
-
const e = t(this,
|
|
958
|
+
const e = t(this, qt).sourceTable;
|
|
961
959
|
e && e.querySelectorAll('tbody tr[grouping="true"]').forEach((s) => {
|
|
962
960
|
const i = s.querySelector('[cell-type="tree"]');
|
|
963
961
|
i && i.dataset.bind && r.push(i.dataset.bind);
|
|
964
|
-
}), p(this, De, r), p(this, Fe, !1), t(this,
|
|
962
|
+
}), p(this, De, r), p(this, Fe, !1), t(this, qt).scrollToY(0), t(this, qt).view.refresh();
|
|
965
963
|
}
|
|
966
964
|
clear() {
|
|
967
|
-
p(this, De, []), t(this, $e).clear(), p(this, Fe, !1), t(this,
|
|
965
|
+
p(this, De, []), t(this, $e).clear(), p(this, Fe, !1), t(this, qt).scrollToY(0), t(this, qt).view.refresh();
|
|
968
966
|
}
|
|
969
967
|
// SheetViewκ° κ·Έλ£Ήν μ°μ° ν groupMapμ 곡μ ν μ μλλ‘ μ€μ λ©μλ μ 곡
|
|
970
968
|
setGroupMap(r) {
|
|
@@ -978,7 +976,7 @@ const Bo = class Bo {
|
|
|
978
976
|
return e.map((i) => s.getArray(i)).filter(Boolean);
|
|
979
977
|
}
|
|
980
978
|
};
|
|
981
|
-
|
|
979
|
+
qt = new WeakMap(), Xs = new WeakMap(), De = new WeakMap(), $e = new WeakMap(), Fe = new WeakMap(), h(Bo, "GroupingManager");
|
|
982
980
|
let Mn = Bo;
|
|
983
981
|
var gt, Nn, Dn, $n, Fn;
|
|
984
982
|
const vt = class vt {
|
|
@@ -986,15 +984,15 @@ const vt = class vt {
|
|
|
986
984
|
var c, u;
|
|
987
985
|
if (!e || e.length === 0)
|
|
988
986
|
return { headers: [], renderItems: [], groupMap: /* @__PURE__ */ new Map() };
|
|
989
|
-
const i = r.filter((
|
|
990
|
-
var
|
|
991
|
-
return !((
|
|
987
|
+
const i = r.filter((f) => {
|
|
988
|
+
var g;
|
|
989
|
+
return !((g = f.__ng) != null && g.deleted);
|
|
992
990
|
}), n = /* @__PURE__ */ new Map(), o = A(c = vt, gt, Dn).call(c, i, e, s), l = [], a = [];
|
|
993
991
|
return A(u = vt, gt, Nn).call(u, o, 0, e, l, a, n, ""), { headers: l, renderItems: a, groupMap: n };
|
|
994
992
|
}
|
|
995
993
|
};
|
|
996
994
|
gt = new WeakSet(), Nn = /* @__PURE__ */ h(function(r, e, s, i, n, o, l) {
|
|
997
|
-
var u,
|
|
995
|
+
var u, f, g;
|
|
998
996
|
let a = 0;
|
|
999
997
|
const c = e === s.length - 1;
|
|
1000
998
|
for (let [b, m] of r.entries()) {
|
|
@@ -1005,10 +1003,10 @@ gt = new WeakSet(), Nn = /* @__PURE__ */ h(function(r, e, s, i, n, o, l) {
|
|
|
1005
1003
|
type: "group",
|
|
1006
1004
|
record: w,
|
|
1007
1005
|
groupId: y
|
|
1008
|
-
}), !c && m instanceof Map ? A(
|
|
1009
|
-
|
|
1006
|
+
}), !c && m instanceof Map ? A(f = vt, gt, Nn).call(f, m, e + 1, s, i, n, o, y) : A(g = vt, gt, Fn).call(g, m).forEach((L) => {
|
|
1007
|
+
L.__isGroupHeader = !1, L.__groupId = y, i.push(L), n.push({
|
|
1010
1008
|
type: "data",
|
|
1011
|
-
record:
|
|
1009
|
+
record: L,
|
|
1012
1010
|
groupId: y
|
|
1013
1011
|
});
|
|
1014
1012
|
});
|
|
@@ -1047,12 +1045,12 @@ gt = new WeakSet(), Nn = /* @__PURE__ */ h(function(r, e, s, i, n, o, l) {
|
|
|
1047
1045
|
return e;
|
|
1048
1046
|
}, "#collectLeafRecords"), d(vt, gt), h(vt, "Grouping");
|
|
1049
1047
|
let Hn = vt;
|
|
1050
|
-
var nr, _s,
|
|
1048
|
+
var nr, _s, R, We, Us, Yt, _, ue, Zt, hs, ds, Oe, ze, or, lr, Gs, js, Ks, us, ar, cr, hr;
|
|
1051
1049
|
const Vo = class Vo {
|
|
1052
1050
|
constructor(r) {
|
|
1053
1051
|
d(this, nr, 3);
|
|
1054
1052
|
d(this, _s);
|
|
1055
|
-
d(this,
|
|
1053
|
+
d(this, R);
|
|
1056
1054
|
d(this, We);
|
|
1057
1055
|
d(this, Us, /* @__PURE__ */ new Map());
|
|
1058
1056
|
d(this, Yt, []);
|
|
@@ -1065,10 +1063,10 @@ const Vo = class Vo {
|
|
|
1065
1063
|
d(this, Oe, !1);
|
|
1066
1064
|
E(this, "refresh", /* @__PURE__ */ h((r = !1) => {
|
|
1067
1065
|
var i;
|
|
1068
|
-
if (!t(this,
|
|
1069
|
-
const e = t(this,
|
|
1066
|
+
if (!t(this, R).classList.contains("active")) return;
|
|
1067
|
+
const e = t(this, R).querySelector(".ng-sheet-body");
|
|
1070
1068
|
if (!e) return;
|
|
1071
|
-
(!t(this, _) || t(this, _) <= 0) && (t(this, js).call(this), t(this, _) && t(this, _) > 0 && t(this, us).call(this)), t(this, ze).call(this, e.scrollTop, r), (i = t(this,
|
|
1069
|
+
(!t(this, _) || t(this, _) <= 0) && (t(this, js).call(this), t(this, _) && t(this, _) > 0 && t(this, us).call(this)), t(this, ze).call(this, e.scrollTop, r), (i = t(this, R).querySelector("nine-table-vscrollbar")) == null || i.refresh();
|
|
1072
1070
|
}, "refresh"));
|
|
1073
1071
|
d(this, ze, /* @__PURE__ */ h((r, e = !1) => {
|
|
1074
1072
|
var $, T;
|
|
@@ -1078,21 +1076,21 @@ const Vo = class Vo {
|
|
|
1078
1076
|
}
|
|
1079
1077
|
const s = t(this, _);
|
|
1080
1078
|
if (!s || s <= 0) return;
|
|
1081
|
-
const i = t(this,
|
|
1079
|
+
const i = t(this, R).view.getArray(), n = i.length;
|
|
1082
1080
|
if (n === 0) {
|
|
1083
|
-
t(this,
|
|
1081
|
+
t(this, R).elements.scrollHolder.style.height = "0px";
|
|
1084
1082
|
return;
|
|
1085
1083
|
}
|
|
1086
|
-
const o = t(this,
|
|
1087
|
-
let
|
|
1088
|
-
|
|
1089
|
-
const m =
|
|
1090
|
-
t(this,
|
|
1091
|
-
const
|
|
1084
|
+
const o = t(this, R).templateLength, l = ((($ = t(this, R).elements.body.thead) == null ? void 0 : $.offsetHeight) || 0) + (((T = t(this, R).elements.body.tfoot) == null ? void 0 : T.offsetHeight) || 0) + t(this, R).elements.body.tbody.head.offsetHeight, a = t(this, R).querySelector(".ng-sheet-body").offsetHeight || 0, c = Math.max(n * s + s * 2 + l - a, 0), u = 15e6, f = c > u;
|
|
1085
|
+
let g = 1, b = c;
|
|
1086
|
+
f && (g = u / c, b = u), t(this, R).elements.scrollHolder.style.height = `${b}px`;
|
|
1087
|
+
const m = f ? r / g : r, y = Math.max(0, n - 1), x = Math.min(m, c), w = Math.max(0, Math.min(Math.floor(x / s) - 1, y)), v = x % s;
|
|
1088
|
+
t(this, R).elements.left.tbody.body.style.top = t(this, R).elements.body.tbody.body.style.top = t(this, R).elements.right.tbody.body.style.top = `-${v}px`;
|
|
1089
|
+
const L = t(this, We).firstTr, C = L && L.dataset.row !== void 0 ? parseInt(L.dataset.row, 10) : -1;
|
|
1092
1090
|
!e && C === w || ([
|
|
1093
|
-
t(this,
|
|
1094
|
-
t(this,
|
|
1095
|
-
t(this,
|
|
1091
|
+
t(this, R).elements.left.tbody.body,
|
|
1092
|
+
t(this, R).elements.body.tbody.body,
|
|
1093
|
+
t(this, R).elements.right.tbody.body
|
|
1096
1094
|
].forEach((H, V) => {
|
|
1097
1095
|
if (!H) return;
|
|
1098
1096
|
H.querySelectorAll("tbody.body tr").forEach((it, O) => {
|
|
@@ -1109,23 +1107,23 @@ const Vo = class Vo {
|
|
|
1109
1107
|
const B = pt.m._[jt.META.INDEX.ROWID];
|
|
1110
1108
|
it.style.display = "", t(this, Gs).call(this, it, pt, B, K);
|
|
1111
1109
|
});
|
|
1112
|
-
}), t(this,
|
|
1110
|
+
}), t(this, R).selection.refresh());
|
|
1113
1111
|
}, "#handleScroll"));
|
|
1114
1112
|
d(this, or, /* @__PURE__ */ h((r, e = !1) => {
|
|
1115
1113
|
var $;
|
|
1116
|
-
|
|
1117
|
-
const s = t(this,
|
|
1114
|
+
S.log("handleGroupdScroll() start");
|
|
1115
|
+
const s = t(this, R).view.getArray() || [], i = s.length;
|
|
1118
1116
|
if (i === 0) {
|
|
1119
|
-
t(this,
|
|
1117
|
+
t(this, R).elements.scrollHolder.style.height = "0px";
|
|
1120
1118
|
return;
|
|
1121
1119
|
}
|
|
1122
|
-
const n = t(this,
|
|
1120
|
+
const n = t(this, R).querySelector(".ng-sheet-body .ng-sheet-body-content"), o = t(this, R).templateLength || 1, l = /* @__PURE__ */ h((T) => {
|
|
1123
1121
|
if (T.type === "group") {
|
|
1124
1122
|
const H = T.record[Ae.DEPTH] || 0;
|
|
1125
1123
|
return t(this, Yt)[H] || t(this, _) / o;
|
|
1126
1124
|
} else {
|
|
1127
1125
|
let H = 0;
|
|
1128
|
-
const V = t(this,
|
|
1126
|
+
const V = t(this, R).templateLength || 1;
|
|
1129
1127
|
let Q = 0;
|
|
1130
1128
|
for (let it = 0; it < V - 1; it++)
|
|
1131
1129
|
Q += t(this, Yt)[it] || 0;
|
|
@@ -1138,27 +1136,27 @@ const Vo = class Vo {
|
|
|
1138
1136
|
const H = l(s[T]);
|
|
1139
1137
|
c[T] = H, a += H;
|
|
1140
1138
|
}
|
|
1141
|
-
t(this,
|
|
1142
|
-
const u = t(this,
|
|
1143
|
-
let
|
|
1139
|
+
t(this, R).elements.scrollHolder.style.height = `${a}px`, S.log("*************", a);
|
|
1140
|
+
const u = t(this, R).clientHeight;
|
|
1141
|
+
let f = 0, g = 0;
|
|
1144
1142
|
for (let T = 0; T < i; T++) {
|
|
1145
1143
|
const H = c[T];
|
|
1146
|
-
if (
|
|
1147
|
-
|
|
1144
|
+
if (f + H > r) {
|
|
1145
|
+
g = T;
|
|
1148
1146
|
break;
|
|
1149
1147
|
}
|
|
1150
|
-
|
|
1148
|
+
f += H, g = T;
|
|
1151
1149
|
}
|
|
1152
|
-
const b = r -
|
|
1150
|
+
const b = r - f;
|
|
1153
1151
|
n && n.querySelectorAll("tbody").forEach((T) => {
|
|
1154
1152
|
T.style.top = `-${Math.max(0, b)}px`;
|
|
1155
1153
|
});
|
|
1156
1154
|
const m = t(this, We).firstTr, y = m && m.dataset.virtualIndex !== void 0 ? parseInt(m.dataset.virtualIndex, 10) : -1;
|
|
1157
|
-
if (!e && y ===
|
|
1155
|
+
if (!e && y === g)
|
|
1158
1156
|
return;
|
|
1159
|
-
const x = Math.ceil(u / (t(this, _) / o)), w = ((($ = t(this,
|
|
1157
|
+
const x = Math.ceil(u / (t(this, _) / o)), w = ((($ = t(this, R).grouping.columns) == null ? void 0 : $.length) || 1) * 15, v = g, L = Math.min(i, g + x + w), C = s.slice(v, L);
|
|
1160
1158
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((T) => {
|
|
1161
|
-
const H = t(this,
|
|
1159
|
+
const H = t(this, R).querySelector(`.ng-sheet-body ${T}`);
|
|
1162
1160
|
if (!H) return;
|
|
1163
1161
|
const V = Array.from(H.querySelectorAll("tbody.body tr"));
|
|
1164
1162
|
for (let Q = 0; Q < V.length; Q += o) {
|
|
@@ -1169,10 +1167,10 @@ const Vo = class Vo {
|
|
|
1169
1167
|
});
|
|
1170
1168
|
continue;
|
|
1171
1169
|
}
|
|
1172
|
-
const pt =
|
|
1170
|
+
const pt = g + it;
|
|
1173
1171
|
K.forEach((B, os) => {
|
|
1174
1172
|
var Wi;
|
|
1175
|
-
const Fi =
|
|
1173
|
+
const Fi = g + it;
|
|
1176
1174
|
B.dataset.virtualIndex = Fi, B.dataset.row = O.type === "data" ? pt : "";
|
|
1177
1175
|
const ae = B.getAttribute("grouping") === "true";
|
|
1178
1176
|
if (O.type === "group")
|
|
@@ -1190,20 +1188,20 @@ const Vo = class Vo {
|
|
|
1190
1188
|
}
|
|
1191
1189
|
});
|
|
1192
1190
|
}
|
|
1193
|
-
}), t(this,
|
|
1191
|
+
}), t(this, R).selection.refresh(), S.log("handleGroupdScroll() end");
|
|
1194
1192
|
}, "#handleGroupedScroll"));
|
|
1195
1193
|
d(this, lr, /* @__PURE__ */ h((r, e, s, i) => {
|
|
1196
|
-
const n = t(this,
|
|
1197
|
-
r.dataset.virtualIndex = i, r.dataset.row = "", r.dataset.matrixRow = l, r.data = u, r.dataset.groupId = s[Ae.ID], Array.from(r.cells).forEach((
|
|
1198
|
-
|
|
1199
|
-
const
|
|
1194
|
+
const n = t(this, R).templateLength || 1, o = parseInt(r.dataset.subrow, 10) || 0, l = i * n + o, a = s[Ae.CHILDREN], c = t(this, _s).data.getArray(), u = a ? a.map((f) => c[f]).filter(Boolean) : [];
|
|
1195
|
+
r.dataset.virtualIndex = i, r.dataset.row = "", r.dataset.matrixRow = l, r.data = u, r.dataset.groupId = s[Ae.ID], Array.from(r.cells).forEach((f) => {
|
|
1196
|
+
f.dataset.row = i;
|
|
1197
|
+
const g = Array.from(f.children).find(
|
|
1200
1198
|
(b) => b.tagName.toLowerCase().startsWith("cell-") || typeof b.refresh == "function"
|
|
1201
1199
|
);
|
|
1202
|
-
|
|
1200
|
+
g !== void 0 && typeof g.refresh == "function" && (g == null || g.refresh());
|
|
1203
1201
|
});
|
|
1204
1202
|
}, "#bindGroupRowData"));
|
|
1205
1203
|
d(this, Gs, /* @__PURE__ */ h((r, e, s, i) => {
|
|
1206
|
-
const n = t(this,
|
|
1204
|
+
const n = t(this, R).templateLength || 1, o = parseInt(r.dataset.subrow, 10) || 0, l = i * n + o;
|
|
1207
1205
|
r.dataset.index = i, r.dataset.row = s, r.dataset.matrixRow = l, r.data = e, Array.from(r.cells).forEach((a) => {
|
|
1208
1206
|
a.dataset.index = i, a.dataset.row = s;
|
|
1209
1207
|
const c = Array.from(a.children).find(
|
|
@@ -1213,11 +1211,11 @@ const Vo = class Vo {
|
|
|
1213
1211
|
});
|
|
1214
1212
|
}, "#bindRowData"));
|
|
1215
1213
|
E(this, "initialize", /* @__PURE__ */ h(() => {
|
|
1216
|
-
p(this, Oe, !!t(this,
|
|
1217
|
-
scrollTables: t(this,
|
|
1218
|
-
firstTr: t(this,
|
|
1214
|
+
p(this, Oe, !!t(this, R).sourceTable.querySelector("tbody tr[grouping='true']")), p(this, _, null), t(this, Us).clear(), p(this, We, {
|
|
1215
|
+
scrollTables: t(this, R).querySelectorAll(".ng-sheet-body table"),
|
|
1216
|
+
firstTr: t(this, R).querySelector(".ng-sheet-body .ng-container-body tbody.body tr")
|
|
1219
1217
|
}), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
1220
|
-
const s = t(this,
|
|
1218
|
+
const s = t(this, R).querySelector(`.ng-sheet-body ${e}`);
|
|
1221
1219
|
if (!s) return;
|
|
1222
1220
|
const i = s.querySelector("table");
|
|
1223
1221
|
if (!i) return;
|
|
@@ -1226,12 +1224,12 @@ const Vo = class Vo {
|
|
|
1226
1224
|
const l = Array.from(n.querySelectorAll("tr")).map((a) => a.cloneNode(!0));
|
|
1227
1225
|
t(this, Us).set(e, l);
|
|
1228
1226
|
});
|
|
1229
|
-
const r = t(this,
|
|
1227
|
+
const r = t(this, R).querySelector(".ng-sheet-body");
|
|
1230
1228
|
r && (p(this, Zt, r.clientHeight), t(this, js).call(this), t(this, us).call(this), t(this, ze).call(this, r.scrollTop, !0), r.addEventListener("scroll", () => {
|
|
1231
1229
|
var n;
|
|
1232
1230
|
if (t(this, ds)) return;
|
|
1233
1231
|
const e = t(this, _) || 0;
|
|
1234
|
-
(((n = t(this,
|
|
1232
|
+
(((n = t(this, R).view.getArray()) == null ? void 0 : n.length) || 0) * e <= r.clientHeight || (t(this, ze).call(this, r.scrollTop), t(this, R).querySelector("nine-table-vscrollbar").refresh());
|
|
1235
1233
|
}, { passive: !0 }));
|
|
1236
1234
|
}, "initialize"));
|
|
1237
1235
|
E(this, "destroy", /* @__PURE__ */ h(() => {
|
|
@@ -1239,8 +1237,8 @@ const Vo = class Vo {
|
|
|
1239
1237
|
}, "destroy"));
|
|
1240
1238
|
d(this, js, /* @__PURE__ */ h(() => {
|
|
1241
1239
|
var n;
|
|
1242
|
-
if (!t(this,
|
|
1243
|
-
const r = (n = t(this,
|
|
1240
|
+
if (!t(this, R).classList.contains("active") || !t(this, R).sourceTable) return;
|
|
1241
|
+
const r = (n = t(this, R).sourceTable) == null ? void 0 : n.querySelectorAll("tbody.body tr"), e = t(this, R).querySelector(".ng-sheet-body .ng-container-body tbody.body");
|
|
1244
1242
|
e.querySelectorAll("tr").forEach((o) => o.remove());
|
|
1245
1243
|
const s = document.createDocumentFragment();
|
|
1246
1244
|
r.forEach((o) => s.appendChild(o.cloneNode(!0))), e.appendChild(s);
|
|
@@ -1251,26 +1249,26 @@ const Vo = class Vo {
|
|
|
1251
1249
|
}, "#measureAndCacheHeight"));
|
|
1252
1250
|
d(this, Ks, /* @__PURE__ */ h(() => {
|
|
1253
1251
|
var r;
|
|
1254
|
-
if (
|
|
1252
|
+
if (S.log("[DEBUG #updateRowCount] sheetHeight:", t(this, Zt), "cachedTemplateHeight:", t(this, _)), t(this, Zt) > 0 && t(this, _) > 0) {
|
|
1255
1253
|
const e = Math.ceil(t(this, Zt) / t(this, _));
|
|
1256
1254
|
let s = t(this, nr);
|
|
1257
|
-
if (t(this, Oe) && t(this,
|
|
1258
|
-
const i = ((r = t(this,
|
|
1255
|
+
if (t(this, Oe) && t(this, R).grouping) {
|
|
1256
|
+
const i = ((r = t(this, R).grouping.columns) == null ? void 0 : r.length) || 1;
|
|
1259
1257
|
s += i * 15;
|
|
1260
1258
|
}
|
|
1261
|
-
p(this, hs, e + s),
|
|
1259
|
+
p(this, hs, e + s), S.log("[DEBUG #updateRowCount] calculated cachedRowCount:", t(this, hs));
|
|
1262
1260
|
}
|
|
1263
1261
|
}, "#updateRowCount"));
|
|
1264
1262
|
d(this, us, /* @__PURE__ */ h(() => {
|
|
1265
|
-
|
|
1266
|
-
const e = t(this,
|
|
1263
|
+
S.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((r) => {
|
|
1264
|
+
const e = t(this, R).querySelector(`.ng-sheet-body ${r}`);
|
|
1267
1265
|
e && e.querySelector("tbody") && t(this, ar).call(this, e);
|
|
1268
1266
|
}), t(this, cr).call(this);
|
|
1269
1267
|
}, "#renderAllContainers"));
|
|
1270
1268
|
d(this, ar, /* @__PURE__ */ h((r) => {
|
|
1271
1269
|
let e = null;
|
|
1272
1270
|
r.classList.contains("ng-container-left") ? e = "left" : r.classList.contains("ng-container-right") && (e = "right");
|
|
1273
|
-
const s = Array.from(t(this,
|
|
1271
|
+
const s = Array.from(t(this, R).sourceTable.querySelectorAll("tbody.body tr")).map((o) => {
|
|
1274
1272
|
const l = o.cloneNode(!0);
|
|
1275
1273
|
return e === "left" ? l.querySelectorAll("th,td").forEach((a) => {
|
|
1276
1274
|
a.getAttribute("fixed") !== "left" && a.remove();
|
|
@@ -1291,29 +1289,29 @@ const Vo = class Vo {
|
|
|
1291
1289
|
}, "#renderRows"));
|
|
1292
1290
|
d(this, cr, /* @__PURE__ */ h(() => {
|
|
1293
1291
|
var i, n, o;
|
|
1294
|
-
const r = t(this,
|
|
1292
|
+
const r = t(this, R).querySelector(".ng-sheet-body .ng-container-left table"), e = t(this, R).querySelector(".ng-sheet-body .ng-container-body table"), s = t(this, R).querySelector(".ng-sheet-body .ng-container-right table");
|
|
1295
1293
|
if (e) {
|
|
1296
1294
|
const l = r ? Array.from(r.querySelectorAll("tbody tr")) : [], a = Array.from(e.querySelectorAll("tbody tr")), c = s ? Array.from(s.querySelectorAll("tbody tr")) : [], u = Math.max(l.length, a.length, c.length);
|
|
1297
|
-
for (let
|
|
1298
|
-
const
|
|
1299
|
-
((i = l[
|
|
1300
|
-
((n = a[
|
|
1301
|
-
((o = c[
|
|
1302
|
-
], b = Math.max(...
|
|
1303
|
-
b > 0 && (l[
|
|
1295
|
+
for (let f = 0; f < u; f++) {
|
|
1296
|
+
const g = [
|
|
1297
|
+
((i = l[f]) == null ? void 0 : i.getBoundingClientRect().height) || 0,
|
|
1298
|
+
((n = a[f]) == null ? void 0 : n.getBoundingClientRect().height) || 0,
|
|
1299
|
+
((o = c[f]) == null ? void 0 : o.getBoundingClientRect().height) || 0
|
|
1300
|
+
], b = Math.max(...g);
|
|
1301
|
+
b > 0 && (l[f] && (l[f].style.height = `${b}px`), a[f] && (a[f].style.height = `${b}px`), c[f] && (c[f].style.height = `${b}px`));
|
|
1304
1302
|
}
|
|
1305
1303
|
}
|
|
1306
1304
|
}, "#syncRowHeights"));
|
|
1307
1305
|
d(this, hr, /* @__PURE__ */ h(() => {
|
|
1308
|
-
!t(this,
|
|
1306
|
+
!t(this, R) || !(t(this, R) instanceof HTMLElement) || (p(this, ue, new ResizeObserver((r) => {
|
|
1309
1307
|
for (const e of r) {
|
|
1310
1308
|
if (!e.target.classList.contains("active")) continue;
|
|
1311
1309
|
const i = e.contentRect.height;
|
|
1312
|
-
e.contentRect.width > 0 && t(this,
|
|
1310
|
+
e.contentRect.width > 0 && t(this, R).isAutoFitCol && t(this, R).autoFit(!0), i > 0 && t(this, Zt) !== i && (p(this, Zt, i), t(this, Ks).call(this), t(this, _) !== null && (t(this, us).call(this), this.refresh()));
|
|
1313
1311
|
}
|
|
1314
|
-
})), t(this, ue).observe(t(this,
|
|
1312
|
+
})), t(this, ue).observe(t(this, R)));
|
|
1315
1313
|
}, "#initResizeObserver"));
|
|
1316
|
-
p(this, _s, r.getRootNode().host), p(this,
|
|
1314
|
+
p(this, _s, r.getRootNode().host), p(this, R, r), t(this, hr).call(this);
|
|
1317
1315
|
}
|
|
1318
1316
|
// ==========================================
|
|
1319
1317
|
// π― Public APIs & Getters
|
|
@@ -1323,12 +1321,12 @@ const Vo = class Vo {
|
|
|
1323
1321
|
}
|
|
1324
1322
|
scrollToDataRow(r, e = "top", s) {
|
|
1325
1323
|
var c, u;
|
|
1326
|
-
const i = t(this,
|
|
1324
|
+
const i = t(this, R).querySelector(".ng-sheet-body");
|
|
1327
1325
|
if (!i) {
|
|
1328
1326
|
typeof s == "function" && s();
|
|
1329
1327
|
return;
|
|
1330
1328
|
}
|
|
1331
|
-
const n = t(this,
|
|
1329
|
+
const n = t(this, R).view.getArray(), o = (n == null ? void 0 : n.length) || 0;
|
|
1332
1330
|
if (o === 0) {
|
|
1333
1331
|
typeof s == "function" && s();
|
|
1334
1332
|
return;
|
|
@@ -1336,19 +1334,19 @@ const Vo = class Vo {
|
|
|
1336
1334
|
const l = Math.max(0, Math.min(r, o - 1));
|
|
1337
1335
|
let a = 0;
|
|
1338
1336
|
if (t(this, Oe)) {
|
|
1339
|
-
const
|
|
1340
|
-
a = l / Math.max(o - 1, 1) *
|
|
1337
|
+
const f = Math.max(i.scrollHeight - i.clientHeight, 1);
|
|
1338
|
+
a = l / Math.max(o - 1, 1) * f;
|
|
1341
1339
|
} else {
|
|
1342
|
-
const
|
|
1343
|
-
if (!
|
|
1340
|
+
const f = t(this, _);
|
|
1341
|
+
if (!f || f <= 0) {
|
|
1344
1342
|
typeof s == "function" && s();
|
|
1345
1343
|
return;
|
|
1346
1344
|
}
|
|
1347
|
-
let
|
|
1348
|
-
t(this,
|
|
1349
|
-
const b = (((c = t(this,
|
|
1350
|
-
let
|
|
1351
|
-
w && (
|
|
1345
|
+
let g = l * f;
|
|
1346
|
+
t(this, R).templateLength;
|
|
1347
|
+
const b = (((c = t(this, R).elements.body.thead) == null ? void 0 : c.offsetHeight) || 0) + (((u = t(this, R).elements.body.tfoot) == null ? void 0 : u.offsetHeight) || 0) + t(this, R).elements.body.tbody.head.offsetHeight, m = t(this, R).querySelector(".ng-sheet-body").offsetHeight || 0, y = Math.max(o * f + f * 2 + b - m, 0), x = 15e6, w = y > x;
|
|
1348
|
+
let v = 1;
|
|
1349
|
+
w && (v = x / y), a = g * v;
|
|
1352
1350
|
}
|
|
1353
1351
|
p(this, ds, !0), i.scrollTop = a, t(this, ze).call(this, a), requestAnimationFrame(() => {
|
|
1354
1352
|
requestAnimationFrame(() => {
|
|
@@ -1357,7 +1355,7 @@ const Vo = class Vo {
|
|
|
1357
1355
|
});
|
|
1358
1356
|
}
|
|
1359
1357
|
};
|
|
1360
|
-
nr = new WeakMap(), _s = new WeakMap(),
|
|
1358
|
+
nr = new WeakMap(), _s = new WeakMap(), R = new WeakMap(), We = new WeakMap(), Us = new WeakMap(), Yt = new WeakMap(), _ = new WeakMap(), ue = new WeakMap(), Zt = new WeakMap(), hs = new WeakMap(), ds = new WeakMap(), Oe = new WeakMap(), ze = new WeakMap(), or = new WeakMap(), lr = new WeakMap(), Gs = new WeakMap(), js = new WeakMap(), Ks = new WeakMap(), us = new WeakMap(), ar = new WeakMap(), cr = new WeakMap(), hr = new WeakMap(), h(Vo, "RowManager");
|
|
1361
1359
|
let Wn = Vo;
|
|
1362
1360
|
const bt = 16;
|
|
1363
1361
|
var Ys, On;
|
|
@@ -1381,9 +1379,9 @@ const dt = class dt {
|
|
|
1381
1379
|
l++;
|
|
1382
1380
|
a.dataset.col = l;
|
|
1383
1381
|
const c = a.rowSpan || 1, u = a.colSpan || 1;
|
|
1384
|
-
for (let
|
|
1385
|
-
for (let
|
|
1386
|
-
o +
|
|
1382
|
+
for (let f = 0; f < c; f++)
|
|
1383
|
+
for (let g = 0; g < u; g++)
|
|
1384
|
+
o + f < e.length && l + g < s.length && (i[o + f][l + g] = a);
|
|
1387
1385
|
l += u;
|
|
1388
1386
|
});
|
|
1389
1387
|
});
|
|
@@ -1399,7 +1397,7 @@ Ys = new WeakSet(), On = /* @__PURE__ */ h(function(r) {
|
|
|
1399
1397
|
});
|
|
1400
1398
|
}, "#syncColAttributes"), d(dt, Ys), h(dt, "TableCompiler");
|
|
1401
1399
|
let Ee = dt;
|
|
1402
|
-
var Z, Zs, oe, Hs,
|
|
1400
|
+
var Z, Zs, oe, Hs, Ll;
|
|
1403
1401
|
const Po = class Po {
|
|
1404
1402
|
constructor(r) {
|
|
1405
1403
|
d(this, oe);
|
|
@@ -1423,18 +1421,18 @@ const Po = class Po {
|
|
|
1423
1421
|
n.forEach((a) => {
|
|
1424
1422
|
a.querySelectorAll("tbody tr").forEach((c) => {
|
|
1425
1423
|
const { matrixRow: u } = A(this, oe, Hs).call(this, c);
|
|
1426
|
-
u < 0 || c.querySelectorAll("td, th").forEach((
|
|
1427
|
-
const
|
|
1428
|
-
if (isNaN(
|
|
1429
|
-
const b = parseInt(
|
|
1430
|
-
y >= r && u <= s && x >= e &&
|
|
1424
|
+
u < 0 || c.querySelectorAll("td, th").forEach((f) => {
|
|
1425
|
+
const g = parseInt(f.dataset.col, 10);
|
|
1426
|
+
if (isNaN(g)) return;
|
|
1427
|
+
const b = parseInt(f.rowSpan || 1, 10), m = parseInt(f.colSpan || 1, 10), y = u + b - 1, x = g + m - 1;
|
|
1428
|
+
y >= r && u <= s && x >= e && g <= i && (f.classList.add("selected"), u <= r && f.classList.add("selected-top"), y >= s && f.classList.add("selected-bottom"), g <= e && f.classList.add("selected-left"), x >= i && f.classList.add("selected-right"));
|
|
1431
1429
|
});
|
|
1432
1430
|
});
|
|
1433
1431
|
});
|
|
1434
1432
|
const o = t(this, Z).querySelector(`.ng-sheet-body-content tr[data-matrix-row="${r}"] td[data-col="${e}"]`);
|
|
1435
1433
|
o && (o.classList.add("selected-start"), (l = o.closest("tr")) == null || l.classList.add("selected-start"));
|
|
1436
1434
|
}, "render"));
|
|
1437
|
-
p(this, Z, r), A(this, oe,
|
|
1435
|
+
p(this, Z, r), A(this, oe, Ll).call(this), S.log("π― [CellSelection] Initialized (New Structure Compatible)");
|
|
1438
1436
|
}
|
|
1439
1437
|
setFocus(r, e) {
|
|
1440
1438
|
var i;
|
|
@@ -1451,18 +1449,18 @@ const Po = class Po {
|
|
|
1451
1449
|
const c = t(this, Z).querySelectorAll(
|
|
1452
1450
|
".ng-sheet-body-content .ng-container-left, .ng-sheet-body-content .ng-container-body, .ng-sheet-body-content .ng-container-right"
|
|
1453
1451
|
);
|
|
1454
|
-
let u = !0,
|
|
1455
|
-
for (; u &&
|
|
1456
|
-
u = !1,
|
|
1457
|
-
|
|
1452
|
+
let u = !0, f = 0;
|
|
1453
|
+
for (; u && f < 5; )
|
|
1454
|
+
u = !1, f++, c.forEach((g) => {
|
|
1455
|
+
g.querySelectorAll("tbody tr").forEach((b) => {
|
|
1458
1456
|
if (b.classList.contains("nodata")) return;
|
|
1459
1457
|
const { matrixRow: m } = A(this, oe, Hs).call(this, b);
|
|
1460
1458
|
m < 0 || b.querySelectorAll("td, th").forEach((y) => {
|
|
1461
1459
|
const x = parseInt(y.dataset.col, 10);
|
|
1462
1460
|
if (isNaN(x)) return;
|
|
1463
|
-
const w = parseInt(y.rowSpan || 1, 10),
|
|
1464
|
-
if (
|
|
1465
|
-
const T = Math.min(n, m), H = Math.max(o,
|
|
1461
|
+
const w = parseInt(y.rowSpan || 1, 10), v = parseInt(y.colSpan || 1, 10), L = m + w - 1, C = x + v - 1;
|
|
1462
|
+
if (L >= n && m <= o && C >= l && x <= a) {
|
|
1463
|
+
const T = Math.min(n, m), H = Math.max(o, L), V = Math.min(l, x), Q = Math.max(a, C);
|
|
1466
1464
|
(T !== n || H !== o || V !== l || Q !== a) && (n = T, o = H, l = V, a = Q, u = !0);
|
|
1467
1465
|
}
|
|
1468
1466
|
});
|
|
@@ -1477,10 +1475,10 @@ Z = new WeakMap(), Zs = new WeakMap(), oe = new WeakSet(), Hs = /* @__PURE__ */
|
|
|
1477
1475
|
if (isNaN(e)) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
|
|
1478
1476
|
const s = r.closest("tbody"), n = Array.from(s.querySelectorAll("tr:not(.nodata)")).filter((c) => parseInt(c.dataset.row, 10) === e), o = n.indexOf(r), l = n.length > 0 ? n.length : 1, a = e * l + (o >= 0 ? o : r.sectionRowIndex % l);
|
|
1479
1477
|
return { dataRow: e, subRowIndex: o, matrixRow: a };
|
|
1480
|
-
}, "#getMatrixRow"),
|
|
1478
|
+
}, "#getMatrixRow"), Ll = /* @__PURE__ */ h(function() {
|
|
1481
1479
|
const r = t(this, Z).querySelector(".ng-sheet-body");
|
|
1482
1480
|
if (!r) {
|
|
1483
|
-
|
|
1481
|
+
S.log("β [CellSelection] .ng-sheet-body not found!");
|
|
1484
1482
|
return;
|
|
1485
1483
|
}
|
|
1486
1484
|
r.addEventListener("mousedown", (e) => {
|
|
@@ -1495,15 +1493,15 @@ Z = new WeakMap(), Zs = new WeakMap(), oe = new WeakSet(), Hs = /* @__PURE__ */
|
|
|
1495
1493
|
}
|
|
1496
1494
|
this.setFocus(n, o), this.setRange(n, o, n, o);
|
|
1497
1495
|
let l = n, a = o;
|
|
1498
|
-
const c = /* @__PURE__ */ h((
|
|
1499
|
-
const
|
|
1500
|
-
let b =
|
|
1496
|
+
const c = /* @__PURE__ */ h((f) => {
|
|
1497
|
+
const g = document.elementFromPoint(f.clientX, f.clientY);
|
|
1498
|
+
let b = g == null ? void 0 : g.closest("td, th");
|
|
1501
1499
|
if (!b || !t(this, Z).contains(b)) {
|
|
1502
1500
|
const w = t(this, Z).querySelectorAll(".ng-sheet-body-content tbody tr:not(.nodata) td, .ng-sheet-body-content tbody tr:not(.nodata) th");
|
|
1503
|
-
for (const
|
|
1504
|
-
const
|
|
1505
|
-
if (
|
|
1506
|
-
b =
|
|
1501
|
+
for (const v of w) {
|
|
1502
|
+
const L = v.getBoundingClientRect();
|
|
1503
|
+
if (f.clientX >= L.left && f.clientX <= L.right && f.clientY >= L.top && f.clientY <= L.bottom) {
|
|
1504
|
+
b = v;
|
|
1507
1505
|
break;
|
|
1508
1506
|
}
|
|
1509
1507
|
}
|
|
@@ -1518,7 +1516,7 @@ Z = new WeakMap(), Zs = new WeakMap(), oe = new WeakSet(), Hs = /* @__PURE__ */
|
|
|
1518
1516
|
});
|
|
1519
1517
|
}, "#initEvents"), h(Po, "CellSelection");
|
|
1520
1518
|
let zn = Po;
|
|
1521
|
-
var D, Js, fe, zt, Ao, Eo, ft,
|
|
1519
|
+
var D, Js, fe, zt, Ao, Eo, ft, Le, Vn, Qs, ti, ei, si, ii, fs, ri, Cl;
|
|
1522
1520
|
const Xo = class Xo {
|
|
1523
1521
|
constructor(r) {
|
|
1524
1522
|
d(this, ft);
|
|
@@ -1552,7 +1550,7 @@ const Xo = class Xo {
|
|
|
1552
1550
|
}, "#getMaxColCell"));
|
|
1553
1551
|
d(this, si, /* @__PURE__ */ h((r, e) => {
|
|
1554
1552
|
const s = t(this, D).querySelector(`.ng-sheet-body tr[data-matrix-row="${r}"] td[data-col="${e}"]`) || t(this, D).querySelector(`.ng-sheet-body td[data-col="${e}"]`), i = (s == null ? void 0 : s.colSpan) || 1, n = e + i;
|
|
1555
|
-
return
|
|
1553
|
+
return S.log(`π [#getNextCol] current col: ${e}, found td colSpan: ${i}, calculated next col: ${n}`), n;
|
|
1556
1554
|
}, "#getNextCol"));
|
|
1557
1555
|
d(this, ii, /* @__PURE__ */ h((r, e) => {
|
|
1558
1556
|
if (e <= 0) return 0;
|
|
@@ -1576,7 +1574,7 @@ const Xo = class Xo {
|
|
|
1576
1574
|
return e.forEach((i) => {
|
|
1577
1575
|
const n = Array.from(i.querySelectorAll("tbody tr"));
|
|
1578
1576
|
for (const o of n) {
|
|
1579
|
-
const l = A(this, ft,
|
|
1577
|
+
const l = A(this, ft, Le).call(this, o);
|
|
1580
1578
|
if (l === r) {
|
|
1581
1579
|
s.push(o);
|
|
1582
1580
|
break;
|
|
@@ -1584,8 +1582,8 @@ const Xo = class Xo {
|
|
|
1584
1582
|
const a = Array.from(o.querySelectorAll("td"));
|
|
1585
1583
|
let c = !1;
|
|
1586
1584
|
for (const u of a) {
|
|
1587
|
-
const
|
|
1588
|
-
if (
|
|
1585
|
+
const f = parseInt(u.rowSpan || 1, 10);
|
|
1586
|
+
if (f > 1 && r >= l && r < l + f) {
|
|
1589
1587
|
s.push(o), c = !0;
|
|
1590
1588
|
break;
|
|
1591
1589
|
}
|
|
@@ -1604,18 +1602,18 @@ const Xo = class Xo {
|
|
|
1604
1602
|
for (const c of Array.from(a)) {
|
|
1605
1603
|
const u = parseInt(c.dataset.row, 10);
|
|
1606
1604
|
if (isNaN(u)) continue;
|
|
1607
|
-
const
|
|
1605
|
+
const f = c.closest("tbody"), b = (f ? Array.from(f.querySelectorAll(`tr[data-row="${u}"]`)) : [c]).indexOf(c);
|
|
1608
1606
|
for (const m of Array.from(c.querySelectorAll("td"))) {
|
|
1609
1607
|
const y = parseInt(m.dataset.col, 10), x = parseInt(m.colSpan || 1, 10), w = parseInt(m.rowSpan || 1, 10);
|
|
1610
1608
|
if (isNaN(y) || window.getComputedStyle(m).display === "none") continue;
|
|
1611
|
-
const
|
|
1609
|
+
const v = u, L = b, C = v * o + L, $ = C + w - 1;
|
|
1612
1610
|
if (n >= C && n <= $ && s >= y && s < y + x)
|
|
1613
1611
|
return m;
|
|
1614
1612
|
}
|
|
1615
1613
|
}
|
|
1616
1614
|
return null;
|
|
1617
1615
|
}, "#getNearElement"));
|
|
1618
|
-
p(this, D, r), p(this, Js, r.getRootNode().host), A(this, ft, Cl).call(this),
|
|
1616
|
+
p(this, D, r), p(this, Js, r.getRootNode().host), A(this, ft, Cl).call(this), S.log("π― [CellNavigation] Initialized (Diagnostic Logging Restored)");
|
|
1619
1617
|
}
|
|
1620
1618
|
get currentCell() {
|
|
1621
1619
|
return t(this, fe);
|
|
@@ -1624,18 +1622,18 @@ const Xo = class Xo {
|
|
|
1624
1622
|
var s;
|
|
1625
1623
|
if (!r) return;
|
|
1626
1624
|
p(this, fe, r), r.focus({ preventScroll: !0 }), p(this, zt, r.closest("tr"));
|
|
1627
|
-
const e = A(this, ft,
|
|
1628
|
-
|
|
1625
|
+
const e = A(this, ft, Le).call(this, t(this, zt));
|
|
1626
|
+
S.log(`π [setCurCell] Active set -> dataRow: ${r.dataset.row}, subrow: ${(s = r.closest("tr")) == null ? void 0 : s.dataset.subrow}, matrixRow: ${e}, col: ${r.dataset.col}`), t(this, D).selection.setFocus(e, t(this, fe).dataset.col);
|
|
1629
1627
|
}
|
|
1630
1628
|
moveCell(r) {
|
|
1631
1629
|
var m;
|
|
1632
1630
|
if (!["TH", "TD"].includes(r.target.tagName))
|
|
1633
1631
|
return;
|
|
1634
1632
|
if (!t(this, fe) || !t(this, zt)) {
|
|
1635
|
-
|
|
1633
|
+
S.log("β οΈ [moveCell] currentCell or currentTr is missing!");
|
|
1636
1634
|
return;
|
|
1637
1635
|
}
|
|
1638
|
-
const e = t(this, fe), s = parseInt(e.dataset.row, 10), i = parseInt(e.dataset.col, 10), n = t(this, D).templateLength || 1, o = A(this, ft,
|
|
1636
|
+
const e = t(this, fe), s = parseInt(e.dataset.row, 10), i = parseInt(e.dataset.col, 10), n = t(this, D).templateLength || 1, o = A(this, ft, Le).call(this, t(this, zt));
|
|
1639
1637
|
let l = o, a = i;
|
|
1640
1638
|
switch (r.code) {
|
|
1641
1639
|
case "ArrowDown":
|
|
@@ -1690,31 +1688,31 @@ const Xo = class Xo {
|
|
|
1690
1688
|
return;
|
|
1691
1689
|
break;
|
|
1692
1690
|
}
|
|
1693
|
-
|
|
1691
|
+
S.log("========");
|
|
1694
1692
|
const u = (((m = t(this, D).view.getArray()) == null ? void 0 : m.length) || 0) * n - 1;
|
|
1695
|
-
l = Math.max(0, Math.min(l, u)),
|
|
1696
|
-
const
|
|
1693
|
+
l = Math.max(0, Math.min(l, u)), S.log(`β¨οΈ [Key: ${r.code}] Current matrixRow: ${o} -> Target nextMatrixRow: ${l}, nextCol: ${a}`);
|
|
1694
|
+
const f = Math.floor(l / n), g = l % n;
|
|
1697
1695
|
(/* @__PURE__ */ h((y = 0) => {
|
|
1698
|
-
let x = t(this, ri).call(this,
|
|
1696
|
+
let x = t(this, ri).call(this, f, g, a, l);
|
|
1699
1697
|
if (x) {
|
|
1700
|
-
|
|
1701
|
-
const w = A(this, ft,
|
|
1698
|
+
S.log(`β
[Found Cell] Attempt ${y} -> dataRow: ${x.dataset.row}, col: ${x.dataset.col}`), this.currentCell = x;
|
|
1699
|
+
const w = A(this, ft, Le).call(this, t(this, zt));
|
|
1702
1700
|
t(this, D).selection.setRange(w, x.dataset.col, w, x.dataset.col), A(this, ft, Vn).call(this, x);
|
|
1703
1701
|
} else
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
let
|
|
1707
|
-
if (
|
|
1708
|
-
|
|
1709
|
-
const
|
|
1710
|
-
t(this, D).selection.setRange(C,
|
|
1702
|
+
S.log(`π [Scroll Trigger] Cell not found in DOM, invoking rowManager.scrollToDataRow(${f})`), t(this, D).rowManager.scrollToDataRow(f, "bottom", () => {
|
|
1703
|
+
S.log("nextDataRow", f), (/* @__PURE__ */ h(() => {
|
|
1704
|
+
let v = t(this, ri).call(this, f, g, a, l);
|
|
1705
|
+
if (v) {
|
|
1706
|
+
S.log(`β
[Found After Scroll] RetryLoop success -> dataRow: ${v.dataset.row}`), this.currentCell = v;
|
|
1707
|
+
const L = v.closest("tr"), C = A(this, ft, Le).call(this, L);
|
|
1708
|
+
t(this, D).selection.setRange(C, v.dataset.col, C, v.dataset.col), A(this, ft, Vn).call(this, v);
|
|
1711
1709
|
}
|
|
1712
1710
|
}, "retryLoop"))();
|
|
1713
1711
|
});
|
|
1714
1712
|
}, "attemptFindAndMove"))();
|
|
1715
1713
|
}
|
|
1716
1714
|
};
|
|
1717
|
-
D = new WeakMap(), Js = new WeakMap(), fe = new WeakMap(), zt = new WeakMap(), Ao = new WeakMap(), Eo = new WeakMap(), ft = new WeakSet(),
|
|
1715
|
+
D = new WeakMap(), Js = new WeakMap(), fe = new WeakMap(), zt = new WeakMap(), Ao = new WeakMap(), Eo = new WeakMap(), ft = new WeakSet(), Le = /* @__PURE__ */ h(function(r) {
|
|
1718
1716
|
if (!r) return 0;
|
|
1719
1717
|
const e = parseInt(r.dataset.row, 10) || 0, s = t(this, D).templateLength || 1, i = parseInt(r.dataset.matrixRow, 10);
|
|
1720
1718
|
if (!isNaN(i)) return i;
|
|
@@ -1727,29 +1725,28 @@ D = new WeakMap(), Js = new WeakMap(), fe = new WeakMap(), zt = new WeakMap(), A
|
|
|
1727
1725
|
const o = parseInt(r.dataset.subrow, 10) || 0;
|
|
1728
1726
|
return e * s + o;
|
|
1729
1727
|
}, "#getMatrixRowFromTr"), Vn = /* @__PURE__ */ h(function(r) {
|
|
1730
|
-
const e = t(this, D).querySelector(".ng-sheet-body"), s = t(this, D).querySelector(".ng-sheet-body .ng-container-body")
|
|
1728
|
+
const e = t(this, D).querySelector(".ng-sheet-body"), s = t(this, D).querySelector(".ng-sheet-body .ng-container-body");
|
|
1731
1729
|
if (!e || !s) return;
|
|
1732
|
-
const
|
|
1733
|
-
|
|
1730
|
+
const i = r.getBoundingClientRect(), n = e.getBoundingClientRect(), o = s.getBoundingClientRect();
|
|
1731
|
+
S.log(`π [DIAGNOSTIC VISIBILITY]
|
|
1734
1732
|
- cell.dataset.col: ${r.dataset.col}
|
|
1735
|
-
- cellRect (left: ${
|
|
1736
|
-
- containerRect (left: ${
|
|
1737
|
-
- viewportRect (width: ${
|
|
1738
|
-
- headerBody (scrollLeft: ${i == null ? void 0 : i.scrollLeft}, width: ${a == null ? void 0 : a.width})
|
|
1733
|
+
- cellRect (left: ${i.left}, right: ${i.right})
|
|
1734
|
+
- containerRect (left: ${o.left}, right: ${o.right}, width: ${o.width}, scrollLeft: ${s.scrollLeft}, scrollWidth: ${s.scrollWidth}, clientWidth: ${s.clientWidth})
|
|
1735
|
+
- viewportRect (width: ${n.width})
|
|
1739
1736
|
`);
|
|
1740
|
-
const
|
|
1741
|
-
if (
|
|
1742
|
-
const
|
|
1743
|
-
!isNaN(
|
|
1744
|
-
const
|
|
1745
|
-
if (
|
|
1746
|
-
this.currentCell =
|
|
1747
|
-
const
|
|
1748
|
-
t(this, D).selection.setRange(
|
|
1737
|
+
const l = i.top < n.top, a = i.bottom > n.bottom;
|
|
1738
|
+
if (l || a) {
|
|
1739
|
+
const c = parseInt(r.dataset.row, 10), u = r.dataset.col, f = r.closest("tr"), g = (f == null ? void 0 : f.dataset.subrow) || 0;
|
|
1740
|
+
!isNaN(c) && t(this, D).rowManager && t(this, D).rowManager.scrollToDataRow(c, "top", () => {
|
|
1741
|
+
const b = t(this, D).querySelector(`.ng-sheet-body tr[data-row="${c}"][data-subrow="${g}"] td[data-col="${u}"]`);
|
|
1742
|
+
if (b) {
|
|
1743
|
+
this.currentCell = b;
|
|
1744
|
+
const m = b.closest("tr"), y = A(this, ft, Le).call(this, m);
|
|
1745
|
+
t(this, D).selection.setRange(y, u, y, u);
|
|
1749
1746
|
}
|
|
1750
|
-
})
|
|
1747
|
+
});
|
|
1751
1748
|
}
|
|
1752
|
-
|
|
1749
|
+
i.left < o.left ? (S.log("βοΈ [Scroll X Left] cell out of left bound"), s.scrollLeft -= o.left - i.left + 10, t(this, D).scrollToX(s.scrollLeft)) : i.right > o.right && (S.log(`βοΈ [Scroll X Right] cell out of right bound. cellRect.right: ${i.right} > containerRect.right: ${o.right}`), s.scrollLeft += i.right - o.right + 10, t(this, D).scrollToX(s.scrollLeft));
|
|
1753
1750
|
}, "#ensureCellVisible"), Qs = new WeakMap(), ti = new WeakMap(), ei = new WeakMap(), si = new WeakMap(), ii = new WeakMap(), fs = new WeakMap(), ri = new WeakMap(), Cl = /* @__PURE__ */ h(function() {
|
|
1754
1751
|
t(this, D).addEventListener("mousedown", (r) => {
|
|
1755
1752
|
if (r.button !== 0) return;
|
|
@@ -1761,13 +1758,13 @@ D = new WeakMap(), Js = new WeakMap(), fe = new WeakMap(), zt = new WeakMap(), A
|
|
|
1761
1758
|
}, "#initEvents"), h(Xo, "CellNavigation");
|
|
1762
1759
|
let Bn = Xo;
|
|
1763
1760
|
const Oi = 2;
|
|
1764
|
-
var P, Be,
|
|
1761
|
+
var P, Be, Et, Ve, Bt, Rt, Vt, Pt, gs, Xt, ge, ni, oi, It, zi, Xn, li, ai, _n, ci, dr, hi;
|
|
1765
1762
|
const _o = class _o {
|
|
1766
1763
|
constructor(r) {
|
|
1767
|
-
d(this,
|
|
1764
|
+
d(this, It);
|
|
1768
1765
|
d(this, P);
|
|
1769
1766
|
d(this, Be);
|
|
1770
|
-
d(this,
|
|
1767
|
+
d(this, Et);
|
|
1771
1768
|
d(this, Ve);
|
|
1772
1769
|
d(this, Bt, null);
|
|
1773
1770
|
d(this, Rt, null);
|
|
@@ -1796,9 +1793,9 @@ const _o = class _o {
|
|
|
1796
1793
|
o || l ? s.classList.add("resizable-edge") : s.classList.remove("resizable-edge");
|
|
1797
1794
|
}, "#onPointerMove"));
|
|
1798
1795
|
d(this, ai, /* @__PURE__ */ h((r) => {
|
|
1799
|
-
if (
|
|
1796
|
+
if (S.log(r.actualTarget, r.target), !r.actualTarget.closest("thead")) return;
|
|
1800
1797
|
const s = r.actualTarget.closest("th, td");
|
|
1801
|
-
if (
|
|
1798
|
+
if (S.log(s, r.actualTarget), !s || !s.classList.contains("resizable-edge")) return;
|
|
1802
1799
|
r.preventDefault();
|
|
1803
1800
|
const i = s.getBoundingClientRect(), n = r.clientX - i.left;
|
|
1804
1801
|
let o = s;
|
|
@@ -1809,28 +1806,28 @@ const _o = class _o {
|
|
|
1809
1806
|
else if (!s.previousElementSibling)
|
|
1810
1807
|
return;
|
|
1811
1808
|
}
|
|
1812
|
-
p(this, Pt, o), p(this, Vt, A(this,
|
|
1809
|
+
p(this, Pt, o), p(this, Vt, A(this, It, Xn).call(this, o));
|
|
1813
1810
|
const l = t(this, P).querySelector(`.ng-container-${t(this, Vt)}`);
|
|
1814
1811
|
if (!l) return;
|
|
1815
1812
|
const a = parseInt(o.dataset.col, 10), c = o.colSpan || 1;
|
|
1816
|
-
if (p(this, Bt, a + c - 1), A(this,
|
|
1813
|
+
if (p(this, Bt, a + c - 1), A(this, It, zi).call(this, o)) {
|
|
1817
1814
|
p(this, Rt, t(this, Bt) + 1);
|
|
1818
1815
|
const y = l.querySelector(`col[data-col="${t(this, Rt)}"]`);
|
|
1819
1816
|
y ? p(this, ge, parseInt(y.getAttribute("width"), 10) || 100) : p(this, Rt, null);
|
|
1820
1817
|
} else
|
|
1821
1818
|
p(this, Rt, null);
|
|
1822
|
-
const
|
|
1823
|
-
p(this, ni,
|
|
1819
|
+
const f = o.getBoundingClientRect(), g = t(this, P).getBoundingClientRect();
|
|
1820
|
+
p(this, ni, f.width), p(this, oi, f.left - g.left);
|
|
1824
1821
|
const b = l.querySelector(`col[data-col="${t(this, Bt)}"]`), m = b == null ? void 0 : b.getAttribute("width");
|
|
1825
|
-
p(this, Xt, m && !isNaN(parseInt(m, 10)) ? parseInt(m, 10) :
|
|
1822
|
+
p(this, Xt, m && !isNaN(parseInt(m, 10)) ? parseInt(m, 10) : f.width / c), p(this, gs, r.clientX), t(this, Et) && (t(this, Et).classList.add("active"), A(this, It, _n).call(this, r.clientX)), window.addEventListener("pointermove", t(this, ci)), window.addEventListener("pointerup", t(this, dr), { once: !0 });
|
|
1826
1823
|
}, "#onPointerDown"));
|
|
1827
1824
|
d(this, ci, /* @__PURE__ */ h((r) => {
|
|
1828
|
-
|
|
1825
|
+
S.log(r), A(this, It, _n).call(this, r.clientX);
|
|
1829
1826
|
}, "#onDragMove"));
|
|
1830
1827
|
d(this, dr, /* @__PURE__ */ h((r) => {
|
|
1831
1828
|
var n;
|
|
1832
1829
|
window.removeEventListener("pointermove", t(this, ci));
|
|
1833
|
-
const e = r.clientX - t(this, gs), s = A(this,
|
|
1830
|
+
const e = r.clientX - t(this, gs), s = A(this, It, zi).call(this, t(this, Pt));
|
|
1834
1831
|
let i = 0;
|
|
1835
1832
|
if (s && t(this, Rt) !== null) {
|
|
1836
1833
|
let o = Math.max(bt, t(this, Xt) + e), l = t(this, Xt) + t(this, ge) - o;
|
|
@@ -1843,9 +1840,9 @@ const _o = class _o {
|
|
|
1843
1840
|
const o = t(this, Pt);
|
|
1844
1841
|
o.getAttribute("collapsed") !== "true" && i > 20 && (o.dataset.expandWidth = String(i));
|
|
1845
1842
|
}
|
|
1846
|
-
t(this,
|
|
1843
|
+
t(this, Et) && ((n = t(this, Ve)) == null || n.classList.add("fade-out"), setTimeout(() => {
|
|
1847
1844
|
var o;
|
|
1848
|
-
t(this,
|
|
1845
|
+
t(this, Et).classList.remove("active"), (o = t(this, Ve)) == null || o.classList.remove("fade-out");
|
|
1849
1846
|
}, 150)), p(this, Bt, null), p(this, Rt, null), p(this, Vt, null), p(this, Pt, null);
|
|
1850
1847
|
}, "#onDragEnd"));
|
|
1851
1848
|
d(this, hi, /* @__PURE__ */ h((r) => {
|
|
@@ -1908,20 +1905,20 @@ const _o = class _o {
|
|
|
1908
1905
|
}
|
|
1909
1906
|
break;
|
|
1910
1907
|
}
|
|
1911
|
-
}),
|
|
1912
|
-
const c = t(this, Be).fields.get().indexOf(l.dataset.bind),
|
|
1913
|
-
let m = (nine.measureTextSize(
|
|
1908
|
+
}), S.log(a);
|
|
1909
|
+
const c = t(this, Be).fields.get().indexOf(l.dataset.bind), f = window.getComputedStyle(l).font || "12px sans-serif", g = s.innerText || "";
|
|
1910
|
+
let m = (nine.measureTextSize(g, f).width || 0) + 16;
|
|
1914
1911
|
t(this, Be).execute(() => {
|
|
1915
1912
|
t(this, P).view.getArray().forEach((x, w) => {
|
|
1916
|
-
const
|
|
1917
|
-
|
|
1913
|
+
const v = String(l.dataset.expr ? t(this, Be).exprEngine.evaluate(l.dataset.expr, x, w) : x.v[c] ?? "").trim(), L = nine.measureTextSize(v, f);
|
|
1914
|
+
L.width && L.width > m && (m = L.width);
|
|
1918
1915
|
});
|
|
1919
1916
|
const y = Math.max(32, Math.min(400, Math.ceil(m) + a));
|
|
1920
|
-
this.setColumnWidth(l.dataset.col, y, A(this,
|
|
1917
|
+
this.setColumnWidth(l.dataset.col, y, A(this, It, Xn).call(this, s));
|
|
1921
1918
|
});
|
|
1922
1919
|
}, "#onDblClick"));
|
|
1923
1920
|
var e;
|
|
1924
|
-
p(this, P, r), p(this, Be, r.getRootNode().host), p(this,
|
|
1921
|
+
p(this, P, r), p(this, Be, r.getRootNode().host), p(this, Et, t(this, P).querySelector(".ng-col-resizer-panel")), p(this, Ve, (e = t(this, Et)) == null ? void 0 : e.querySelector(".resizer-overlay")), this.bindEvents();
|
|
1925
1922
|
}
|
|
1926
1923
|
destroy() {
|
|
1927
1924
|
t(this, P).removeEventListener("pointermove", t(this, li)), t(this, P).removeEventListener("pointerdown", t(this, ai)), t(this, P).removeEventListener("dblclick", t(this, hi));
|
|
@@ -1941,15 +1938,15 @@ const _o = class _o {
|
|
|
1941
1938
|
let a = 0;
|
|
1942
1939
|
const c = {};
|
|
1943
1940
|
Array.from(l.querySelectorAll("col")).forEach((u) => {
|
|
1944
|
-
const
|
|
1945
|
-
isNaN(
|
|
1941
|
+
const f = u.getAttribute("data-col"), g = parseInt(u.getAttribute("width"), 10);
|
|
1942
|
+
isNaN(g) || (c[f] = g, a += g);
|
|
1946
1943
|
}), e.forEach((u) => {
|
|
1947
|
-
const
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
}) : (u.style.flex = `0 0 ${a}px`, u.style.width = `${a}px`, u.style.minWidth = `${a}px`, u.style.maxWidth = `${a}px`,
|
|
1951
|
-
|
|
1952
|
-
|
|
1944
|
+
const f = u.querySelectorAll("table");
|
|
1945
|
+
S.log("====================", e, r), r === "body" ? f.forEach((g) => {
|
|
1946
|
+
g.style.width = `${a}px`;
|
|
1947
|
+
}) : (u.style.flex = `0 0 ${a}px`, u.style.width = `${a}px`, u.style.minWidth = `${a}px`, u.style.maxWidth = `${a}px`, f.forEach((g) => {
|
|
1948
|
+
g.style.width = `${a}px`, g.style.minWidth = `${a}px`, g.style.maxWidth = `${a}px`, Object.entries(c).forEach(([b, m]) => {
|
|
1949
|
+
g.querySelectorAll(`th[data-col="${b}"], td[data-col="${b}"]`).forEach((y) => {
|
|
1953
1950
|
y.style.width = `${m}px`, y.style.minWidth = `${m}px`, y.style.maxWidth = `${m}px`;
|
|
1954
1951
|
});
|
|
1955
1952
|
});
|
|
@@ -1960,12 +1957,12 @@ const _o = class _o {
|
|
|
1960
1957
|
}
|
|
1961
1958
|
setColumnWidth(r, e, s = null) {
|
|
1962
1959
|
var a, c;
|
|
1963
|
-
|
|
1960
|
+
S.log("setColumnWidth");
|
|
1964
1961
|
let i = [];
|
|
1965
1962
|
if (i = Array.from(t(this, P).querySelectorAll(`table colgroup col[data-col="${r}"]`)), i.length === 0) return;
|
|
1966
1963
|
const n = i[0].closest(".ng-container-left, .ng-container-body, .ng-container-right"), o = s || (n != null && n.classList.contains("ng-container-left") ? "left" : n != null && n.classList.contains("ng-container-right") ? "right" : "body");
|
|
1967
1964
|
i.forEach((u) => {
|
|
1968
|
-
u.setAttribute("width", e), u.style.width = `${e}px`,
|
|
1965
|
+
u.setAttribute("width", e), u.style.width = `${e}px`, S.log(u, e);
|
|
1969
1966
|
});
|
|
1970
1967
|
const l = (a = t(this, P).sourceTable) == null ? void 0 : a.querySelector(`colgroup col[data-col="${r}"]`);
|
|
1971
1968
|
l && (l.setAttribute("width", e), l.style.width = `${e}px`), this.refreshLayout(o), (o === "left" || o === "right") && this.refreshLayout("body"), (c = t(this, P).rowManager) == null || c.refresh();
|
|
@@ -1974,7 +1971,7 @@ const _o = class _o {
|
|
|
1974
1971
|
t(this, P).addEventListener("pointermove", t(this, li)), t(this, P).addDebounseEventListener("dblclick", t(this, hi), "pointerdown", t(this, ai));
|
|
1975
1972
|
}
|
|
1976
1973
|
};
|
|
1977
|
-
P = new WeakMap(), Be = new WeakMap(),
|
|
1974
|
+
P = new WeakMap(), Be = new WeakMap(), Et = new WeakMap(), Ve = new WeakMap(), Bt = new WeakMap(), Rt = new WeakMap(), Vt = new WeakMap(), Pt = new WeakMap(), gs = new WeakMap(), Xt = new WeakMap(), ge = new WeakMap(), ni = new WeakMap(), oi = new WeakMap(), It = new WeakSet(), zi = /* @__PURE__ */ h(function(r) {
|
|
1978
1975
|
if (t(this, P).isAutoFitCol) return !0;
|
|
1979
1976
|
const e = r == null ? void 0 : r.closest("table");
|
|
1980
1977
|
return !!(e && e.getAttribute("auto-fit-col") === "true");
|
|
@@ -1984,10 +1981,10 @@ P = new WeakMap(), Be = new WeakMap(), Lt = new WeakMap(), Ve = new WeakMap(), B
|
|
|
1984
1981
|
}, "#getContainerType"), li = new WeakMap(), ai = new WeakMap(), _n = /* @__PURE__ */ h(function(r) {
|
|
1985
1982
|
var c;
|
|
1986
1983
|
let e = r - t(this, gs);
|
|
1987
|
-
const s = A(this,
|
|
1984
|
+
const s = A(this, It, zi).call(this, t(this, Pt));
|
|
1988
1985
|
if (s && t(this, Rt) !== null) {
|
|
1989
|
-
const u = t(this, ge) - bt,
|
|
1990
|
-
e = Math.max(
|
|
1986
|
+
const u = t(this, ge) - bt, f = -(t(this, Xt) - bt);
|
|
1987
|
+
e = Math.max(f, Math.min(e, u));
|
|
1991
1988
|
}
|
|
1992
1989
|
const i = Math.max(bt, t(this, Xt) + e), n = t(this, Pt).getBoundingClientRect();
|
|
1993
1990
|
let o = r - n.left;
|
|
@@ -1996,12 +1993,12 @@ P = new WeakMap(), Be = new WeakMap(), Lt = new WeakMap(), Ve = new WeakMap(), B
|
|
|
1996
1993
|
o = Math.min(o, u);
|
|
1997
1994
|
}
|
|
1998
1995
|
const l = Math.max(bt, o);
|
|
1999
|
-
t(this,
|
|
1996
|
+
t(this, Et) && (t(this, Et).style.setProperty("--tooltip-left", `${t(this, oi)}px`), t(this, Et).style.setProperty("--tooltip-width", `${l}px`));
|
|
2000
1997
|
const a = (c = t(this, Ve)) == null ? void 0 : c.querySelector(".size-badge");
|
|
2001
1998
|
a && (a.textContent = `${Math.round(i)}px`);
|
|
2002
1999
|
}, "#updatePositions"), ci = new WeakMap(), dr = new WeakMap(), hi = new WeakMap(), h(_o, "ColResizer");
|
|
2003
2000
|
let Pn = _o;
|
|
2004
|
-
var G, z, tt, pe, Jt, Qt,
|
|
2001
|
+
var G, z, tt, pe, Jt, Qt, Mt, di, Pe, st, Tl, kl, Bi, Il, ui, ql, fi, Gn, ur;
|
|
2005
2002
|
const Uo = class Uo {
|
|
2006
2003
|
constructor(r) {
|
|
2007
2004
|
d(this, st);
|
|
@@ -2011,7 +2008,7 @@ const Uo = class Uo {
|
|
|
2011
2008
|
d(this, pe, !1);
|
|
2012
2009
|
d(this, Jt, null);
|
|
2013
2010
|
d(this, Qt, null);
|
|
2014
|
-
d(this,
|
|
2011
|
+
d(this, Mt, null);
|
|
2015
2012
|
d(this, di, 0);
|
|
2016
2013
|
d(this, Pe, null);
|
|
2017
2014
|
d(this, ui, /* @__PURE__ */ h((r) => {
|
|
@@ -2047,19 +2044,19 @@ const Uo = class Uo {
|
|
|
2047
2044
|
const O = s.getBoundingClientRect();
|
|
2048
2045
|
c = O.left, u = O.right;
|
|
2049
2046
|
}
|
|
2050
|
-
const
|
|
2051
|
-
let
|
|
2052
|
-
if (r.clientX <
|
|
2053
|
-
|
|
2047
|
+
const f = c + (u - c) / 2;
|
|
2048
|
+
let g = 0, b = 0;
|
|
2049
|
+
if (r.clientX < f)
|
|
2050
|
+
g = o, b = c - l.left;
|
|
2054
2051
|
else {
|
|
2055
2052
|
const O = s.colSpan || 1;
|
|
2056
|
-
|
|
2053
|
+
g = o + O, b = u - l.left;
|
|
2057
2054
|
}
|
|
2058
|
-
const m = A(this, st, Bi).call(this, t(this, Jt)), y = m.colSpan, x = m.rowIndex, w = t(this, Jt).rowSpan || 1,
|
|
2055
|
+
const m = A(this, st, Bi).call(this, t(this, Jt)), y = m.colSpan, x = m.rowIndex, w = t(this, Jt).rowSpan || 1, v = x + w - 1, L = ((i = s.closest("tr")) == null ? void 0 : i.sectionRowIndex) ?? 0, C = s.rowSpan || 1, $ = L + C - 1, T = !(v < L || x > $);
|
|
2059
2056
|
let H = !1;
|
|
2060
2057
|
if (m.parentGroupRange) {
|
|
2061
2058
|
const { startCol: O, endCol: K } = m.parentGroupRange;
|
|
2062
|
-
(
|
|
2059
|
+
(g < O || g + y - 1 > K) && (H = !0);
|
|
2063
2060
|
}
|
|
2064
2061
|
let V = !1;
|
|
2065
2062
|
if (a) {
|
|
@@ -2067,31 +2064,31 @@ const Uo = class Uo {
|
|
|
2067
2064
|
for (const K of O) {
|
|
2068
2065
|
if (K === t(this, Jt)) continue;
|
|
2069
2066
|
const pt = ((n = K.closest("tr")) == null ? void 0 : n.sectionRowIndex) ?? 0, B = K.rowSpan || 1, os = pt + B - 1;
|
|
2070
|
-
if (!!(
|
|
2067
|
+
if (!!(v < pt || x > os)) continue;
|
|
2071
2068
|
const ae = parseInt(K.dataset.col, 10), Wi = K.colSpan || 1, ce = ae + Wi - 1;
|
|
2072
|
-
if (
|
|
2069
|
+
if (g > ae && g < ce + 1) {
|
|
2073
2070
|
V = !0;
|
|
2074
2071
|
break;
|
|
2075
2072
|
}
|
|
2076
|
-
const mn =
|
|
2077
|
-
if (
|
|
2073
|
+
const mn = g + y - 1;
|
|
2074
|
+
if (g > ae && g <= ce && mn > ce || g < ae && mn >= ae && mn < ce) {
|
|
2078
2075
|
V = !0;
|
|
2079
2076
|
break;
|
|
2080
2077
|
}
|
|
2081
2078
|
}
|
|
2082
2079
|
}
|
|
2083
|
-
const Q =
|
|
2080
|
+
const Q = g >= m.startCol && g <= m.endCol + 1;
|
|
2084
2081
|
if (!T || Q || H || V || !m.isValidGroup)
|
|
2085
|
-
p(this,
|
|
2086
|
-
else if (p(this,
|
|
2082
|
+
p(this, Mt, null), t(this, tt) && (t(this, tt).style.display = "none"), t(this, z) && t(this, z).classList.add("invalid");
|
|
2083
|
+
else if (p(this, Mt, g), t(this, z) && t(this, z).classList.remove("invalid"), t(this, tt)) {
|
|
2087
2084
|
const pt = s.closest(".ng-sheet-header").getBoundingClientRect().top - l.top, B = l.height - pt;
|
|
2088
2085
|
t(this, tt).style.top = `${pt}px`, t(this, tt).style.height = `${B}px`, t(this, tt).style.left = `${b - 1}px`, t(this, tt).style.display = "block";
|
|
2089
2086
|
}
|
|
2090
2087
|
} else
|
|
2091
|
-
t(this, tt) && (t(this, tt).style.display = "none"), t(this, z) && t(this, z).classList.add("invalid"), p(this,
|
|
2088
|
+
t(this, tt) && (t(this, tt).style.display = "none"), t(this, z) && t(this, z).classList.add("invalid"), p(this, Mt, null);
|
|
2092
2089
|
}, "#onPointerMove"));
|
|
2093
2090
|
d(this, ur, /* @__PURE__ */ h((r) => {
|
|
2094
|
-
t(this, pe) && (window.removeEventListener("pointermove", t(this, fi)), document.body.style.cursor = "", t(this, z) && (t(this, z).style.display = "none", t(this, z).replaceChildren()), t(this, tt) && (t(this, tt).style.display = "none"), t(this,
|
|
2091
|
+
t(this, pe) && (window.removeEventListener("pointermove", t(this, fi)), document.body.style.cursor = "", t(this, z) && (t(this, z).style.display = "none", t(this, z).replaceChildren()), t(this, tt) && (t(this, tt).style.display = "none"), t(this, Mt) !== null && t(this, Qt) !== null && t(this, Mt) !== t(this, Qt) && t(this, Mt) !== t(this, Qt) + 1 && this.moveColumn(t(this, Qt), t(this, Mt)), p(this, pe, !1), p(this, Jt, null), p(this, Qt, null), p(this, Mt, null));
|
|
2095
2092
|
}, "#onPointerUp"));
|
|
2096
2093
|
p(this, G, r), p(this, z, t(this, G).querySelector(".ng-col-mover-grip")), p(this, tt, t(this, G).querySelector(".ng-col-mover-indi")), this.bindEvents();
|
|
2097
2094
|
}
|
|
@@ -2099,17 +2096,17 @@ const Uo = class Uo {
|
|
|
2099
2096
|
t(this, G).addEventListener("pointerdown", t(this, ui));
|
|
2100
2097
|
}
|
|
2101
2098
|
moveColumn(r, e) {
|
|
2102
|
-
|
|
2099
|
+
S.log(t(this, G).sourceTable.cloneNode(!0));
|
|
2103
2100
|
const s = t(this, G).sourceTable.querySelector("colgroup"), i = s.querySelector(`col[data-col="${e}"]`), n = A(this, st, Bi).call(this, t(this, Jt));
|
|
2104
2101
|
if (!n || !n.isValidGroup) return;
|
|
2105
2102
|
const o = n.colSpan, l = /* @__PURE__ */ h((u) => u >= r && u < r + o, "isInRange"), a = t(this, G).querySelector(`.ng-sheet-body-content col[data-col="${e}"]`), c = a != null && a.closest(".ng-container-left") ? "left" : a != null && a.closest(".ng-container-right") ? "right" : null;
|
|
2106
2103
|
s.querySelectorAll("col").forEach((u) => {
|
|
2107
2104
|
l(parseInt(u.getAttribute("data-col"), 10)) && (c ? u.setAttribute("fixed", c) : u.removeAttribute("fixed"), s.insertBefore(u, i));
|
|
2108
2105
|
}), ["thead", "tbody", "tfoot"].forEach((u) => {
|
|
2109
|
-
t(this, G).sourceTable.querySelectorAll(`${u} tr`).forEach((
|
|
2110
|
-
const
|
|
2111
|
-
|
|
2112
|
-
l(parseInt(m.dataset.col, 10)) &&
|
|
2106
|
+
t(this, G).sourceTable.querySelectorAll(`${u} tr`).forEach((f) => {
|
|
2107
|
+
const g = Array.from(f.children), b = g.find((m) => parseInt(m.dataset.col, 10) >= e);
|
|
2108
|
+
g.forEach((m) => {
|
|
2109
|
+
l(parseInt(m.dataset.col, 10)) && f.insertBefore(m, b || null);
|
|
2113
2110
|
});
|
|
2114
2111
|
});
|
|
2115
2112
|
}), t(this, G).recompileAndRefresh();
|
|
@@ -2118,7 +2115,7 @@ const Uo = class Uo {
|
|
|
2118
2115
|
t(this, G).removeEventListener("pointerdown", t(this, ui));
|
|
2119
2116
|
}
|
|
2120
2117
|
};
|
|
2121
|
-
G = new WeakMap(), z = new WeakMap(), tt = new WeakMap(), pe = new WeakMap(), Jt = new WeakMap(), Qt = new WeakMap(),
|
|
2118
|
+
G = new WeakMap(), z = new WeakMap(), tt = new WeakMap(), pe = new WeakMap(), Jt = new WeakMap(), Qt = new WeakMap(), Mt = new WeakMap(), di = new WeakMap(), Pe = new WeakMap(), st = new WeakSet(), Tl = /* @__PURE__ */ h(function() {
|
|
2122
2119
|
var e;
|
|
2123
2120
|
const r = (e = t(this, G).getRootNode()) == null ? void 0 : e.host;
|
|
2124
2121
|
return t(this, G).getAttribute("col-movable") === "true" || (r == null ? void 0 : r.getAttribute("col-movable")) === "true";
|
|
@@ -2132,9 +2129,9 @@ G = new WeakMap(), z = new WeakMap(), tt = new WeakMap(), pe = new WeakMap(), Jt
|
|
|
2132
2129
|
}
|
|
2133
2130
|
return i;
|
|
2134
2131
|
}, "#getDeepElementFromPoint"), Bi = /* @__PURE__ */ h(function(r) {
|
|
2135
|
-
var
|
|
2132
|
+
var g, b;
|
|
2136
2133
|
if (!r || r.dataset.col === void 0) return null;
|
|
2137
|
-
const e = parseInt(r.dataset.col, 10), s = r.colSpan || 1, i = e + s - 1, n = ((
|
|
2134
|
+
const e = parseInt(r.dataset.col, 10), s = r.colSpan || 1, i = e + s - 1, n = ((g = r.closest("tr")) == null ? void 0 : g.sectionRowIndex) ?? 0, o = r.closest("table");
|
|
2138
2135
|
if (!o) return { startCol: e, colSpan: s, endCol: i, rowIndex: n, isGroup: !1, parentGroupRange: null, isValidGroup: !0 };
|
|
2139
2136
|
const l = o.querySelectorAll("thead th, thead td");
|
|
2140
2137
|
let a = !1, c = !0, u = null;
|
|
@@ -2143,13 +2140,13 @@ G = new WeakMap(), z = new WeakMap(), tt = new WeakMap(), pe = new WeakMap(), Jt
|
|
|
2143
2140
|
const y = parseInt(m.dataset.col, 10), x = m.colSpan || 1, w = y + x - 1;
|
|
2144
2141
|
(((b = m.closest("tr")) == null ? void 0 : b.sectionRowIndex) ?? 0) < n && y <= e && w >= i && x > s && (u ? (u.startCol = Math.max(u.startCol, y), u.endCol = Math.min(u.endCol, w)) : u = { startCol: y, endCol: w }), !(w < e || y > i) && (y >= e && w <= i ? x < s && (a = !0) : (y < e || w > i) && (y <= e && w >= i || (c = !1)));
|
|
2145
2142
|
}
|
|
2146
|
-
const
|
|
2143
|
+
const f = a && c;
|
|
2147
2144
|
return {
|
|
2148
2145
|
startCol: e,
|
|
2149
|
-
colSpan:
|
|
2150
|
-
endCol:
|
|
2146
|
+
colSpan: f ? s : 1,
|
|
2147
|
+
endCol: f ? i : e,
|
|
2151
2148
|
rowIndex: n,
|
|
2152
|
-
isGroup:
|
|
2149
|
+
isGroup: f,
|
|
2153
2150
|
parentGroupRange: u,
|
|
2154
2151
|
isValidGroup: c
|
|
2155
2152
|
};
|
|
@@ -2159,21 +2156,21 @@ G = new WeakMap(), z = new WeakMap(), tt = new WeakMap(), pe = new WeakMap(), Jt
|
|
|
2159
2156
|
const { startCol: s, endCol: i, isGroup: n } = e, o = r.closest("table");
|
|
2160
2157
|
if (!o) return null;
|
|
2161
2158
|
let l = 1 / 0, a = -1 / 0, c = 1 / 0, u = -1 / 0;
|
|
2162
|
-
const
|
|
2159
|
+
const f = [];
|
|
2163
2160
|
if (o.querySelectorAll("thead th, thead td").forEach((y) => {
|
|
2164
2161
|
if (y.dataset.col === void 0) return;
|
|
2165
|
-
const x = parseInt(y.dataset.col, 10), w = y.colSpan || 1,
|
|
2166
|
-
if (n ? x >= s &&
|
|
2162
|
+
const x = parseInt(y.dataset.col, 10), w = y.colSpan || 1, v = x + w - 1;
|
|
2163
|
+
if (n ? x >= s && v <= i : y === r) {
|
|
2167
2164
|
const C = y.getBoundingClientRect();
|
|
2168
2165
|
l = Math.min(l, C.left), a = Math.max(a, C.right), c = Math.min(c, C.top), u = Math.max(u, C.bottom);
|
|
2169
2166
|
const $ = window.getComputedStyle(y);
|
|
2170
|
-
|
|
2167
|
+
f.push({ el: y, rect: C, style: $ });
|
|
2171
2168
|
}
|
|
2172
|
-
}),
|
|
2173
|
-
const
|
|
2174
|
-
return m.className = "grip-header-content", m.style.position = "relative", m.style.width = `${
|
|
2175
|
-
const
|
|
2176
|
-
|
|
2169
|
+
}), f.length === 0) return null;
|
|
2170
|
+
const g = a - l, b = u - c, m = document.createElement("div");
|
|
2171
|
+
return m.className = "grip-header-content", m.style.position = "relative", m.style.width = `${g}px`, m.style.height = `${b}px`, f.forEach(({ el: y, rect: x, style: w }) => {
|
|
2172
|
+
const v = y.cloneNode(!0);
|
|
2173
|
+
v.style.position = "absolute", v.style.left = `${x.left - l}px`, v.style.top = `${x.top - c}px`, v.style.width = `${x.width}px`, v.style.minWidth = `${x.width}px`, v.style.maxWidth = "none", v.style.height = `${x.height}px`, v.style.boxSizing = "border-box", v.style.margin = "0", v.style.backgroundColor = w.backgroundColor !== "transparent" && w.backgroundColor !== "rgba(0, 0, 0, 0)" ? w.backgroundColor : "#f9fafb", v.style.color = w.color, v.style.font = w.font, v.style.fontWeight = w.fontWeight, v.style.fontSize = w.fontSize, v.style.textAlign = w.textAlign, v.style.padding = w.padding, v.style.border = w.border, v.style.borderRight = w.borderRight, v.style.borderBottom = w.borderBottom, v.style.display = "flex", v.style.alignItems = "center", v.style.justifyContent = w.textAlign === "center" ? "center" : w.textAlign === "right" ? "flex-end" : "flex-start", m.appendChild(v);
|
|
2177
2174
|
}), {
|
|
2178
2175
|
element: m,
|
|
2179
2176
|
bounds: {
|
|
@@ -2181,7 +2178,7 @@ G = new WeakMap(), z = new WeakMap(), tt = new WeakMap(), pe = new WeakMap(), Jt
|
|
|
2181
2178
|
right: a,
|
|
2182
2179
|
top: c,
|
|
2183
2180
|
bottom: u,
|
|
2184
|
-
width:
|
|
2181
|
+
width: g,
|
|
2185
2182
|
height: b
|
|
2186
2183
|
}
|
|
2187
2184
|
};
|
|
@@ -2237,8 +2234,8 @@ const Go = class Go {
|
|
|
2237
2234
|
const a = Array.from(l.querySelectorAll("th, td"));
|
|
2238
2235
|
let c = !1;
|
|
2239
2236
|
for (const u of a) {
|
|
2240
|
-
const
|
|
2241
|
-
if (
|
|
2237
|
+
const f = parseInt(u.dataset.col, 10), g = u.colSpan || 1, b = f + g - 1;
|
|
2238
|
+
if (f <= n && n < b)
|
|
2242
2239
|
return !1;
|
|
2243
2240
|
if (b === n) {
|
|
2244
2241
|
c = !0;
|
|
@@ -2254,7 +2251,7 @@ const Go = class Go {
|
|
|
2254
2251
|
* - μλ³Έ(`sourceTable`)μ ꡬ쑰(fixed μμ±)λ₯Ό μ§μ μ‘°μνλ―λ‘ decompileμ μ λ νΈμΆνμ§ μμ!
|
|
2255
2252
|
*/
|
|
2256
2253
|
executeFixToggle(r, e, s = "left") {
|
|
2257
|
-
var u,
|
|
2254
|
+
var u, f;
|
|
2258
2255
|
if (!t(this, be) || !e) return;
|
|
2259
2256
|
const i = t(this, be).sourceTable;
|
|
2260
2257
|
if (!i) return;
|
|
@@ -2264,10 +2261,10 @@ const Go = class Go {
|
|
|
2264
2261
|
if (!a) return;
|
|
2265
2262
|
const c = Array.from(a.querySelectorAll("col"));
|
|
2266
2263
|
if (r === "fix-column")
|
|
2267
|
-
c.forEach((
|
|
2268
|
-
parseInt(
|
|
2269
|
-
}), ["thead", "tbody", "tfoot"].forEach((
|
|
2270
|
-
i.querySelectorAll(`${
|
|
2264
|
+
c.forEach((g) => {
|
|
2265
|
+
parseInt(g.getAttribute("data-col"), 10) <= l && g.setAttribute("fixed", s);
|
|
2266
|
+
}), ["thead", "tbody", "tfoot"].forEach((g) => {
|
|
2267
|
+
i.querySelectorAll(`${g} tr`).forEach((b) => {
|
|
2271
2268
|
Array.from(b.children).forEach((m) => {
|
|
2272
2269
|
const y = parseInt(m.dataset.col, 10);
|
|
2273
2270
|
!isNaN(y) && y <= l && m.setAttribute("fixed", s);
|
|
@@ -2275,16 +2272,16 @@ const Go = class Go {
|
|
|
2275
2272
|
});
|
|
2276
2273
|
});
|
|
2277
2274
|
else if (r === "unfix-column") {
|
|
2278
|
-
let
|
|
2275
|
+
let g = n;
|
|
2279
2276
|
["thead", "tbody", "tfoot"].forEach((m) => {
|
|
2280
2277
|
i.querySelectorAll(`${m} tr`).forEach((y, x) => {
|
|
2281
2278
|
Array.from(y.children).forEach((w) => {
|
|
2282
|
-
const
|
|
2283
|
-
T + $ - 1 < w.closest("tr").sectionRowIndex || T > w.closest("tr").sectionRowIndex + $ - 1, !(C < n ||
|
|
2279
|
+
const v = parseInt(w.dataset.col, 10), L = w.colSpan || 1, C = v + L - 1, $ = w.rowSpan || 1, T = y.sectionRowIndex ?? x;
|
|
2280
|
+
T + $ - 1 < w.closest("tr").sectionRowIndex || T > w.closest("tr").sectionRowIndex + $ - 1, !(C < n || v > l) && (g = Math.min(g, v));
|
|
2284
2281
|
});
|
|
2285
2282
|
});
|
|
2286
2283
|
}), c.forEach((m) => {
|
|
2287
|
-
parseInt(m.getAttribute("data-col"), 10) >=
|
|
2284
|
+
parseInt(m.getAttribute("data-col"), 10) >= g && m.removeAttribute("fixed");
|
|
2288
2285
|
});
|
|
2289
2286
|
let b = !1;
|
|
2290
2287
|
c.forEach((m) => {
|
|
@@ -2294,31 +2291,31 @@ const Go = class Go {
|
|
|
2294
2291
|
Array.from(y.children).forEach((x) => {
|
|
2295
2292
|
const w = parseInt(x.dataset.col, 10);
|
|
2296
2293
|
if (isNaN(w)) return;
|
|
2297
|
-
const
|
|
2298
|
-
|
|
2294
|
+
const v = c.find((C) => parseInt(C.getAttribute("data-col"), 10) === w), L = v == null ? void 0 : v.getAttribute("fixed");
|
|
2295
|
+
L ? x.setAttribute("fixed", L) : x.removeAttribute("fixed");
|
|
2299
2296
|
});
|
|
2300
2297
|
});
|
|
2301
2298
|
});
|
|
2302
2299
|
}
|
|
2303
|
-
|
|
2300
|
+
S.log(t(this, be).sourceTable), (f = (u = t(this, be)).recompileAndRefresh) == null || f.call(u);
|
|
2304
2301
|
}
|
|
2305
2302
|
};
|
|
2306
2303
|
be = new WeakMap(), h(Go, "ColFixManager");
|
|
2307
2304
|
let Pi = Go;
|
|
2308
|
-
var
|
|
2305
|
+
var Ht, te, ut, ee, _t, fr, gr, pr, br, Ml, mr, yr, xr, Ro;
|
|
2309
2306
|
const jo = class jo extends HTMLElement {
|
|
2310
2307
|
constructor() {
|
|
2311
2308
|
super(...arguments);
|
|
2312
2309
|
d(this, br);
|
|
2313
|
-
d(this,
|
|
2310
|
+
d(this, Ht);
|
|
2314
2311
|
d(this, te);
|
|
2315
2312
|
d(this, ut);
|
|
2316
2313
|
d(this, ee);
|
|
2317
2314
|
d(this, _t);
|
|
2318
2315
|
E(this, "currentCol", null);
|
|
2319
2316
|
d(this, fr, /* @__PURE__ */ h(() => {
|
|
2320
|
-
t(this, gr).call(this), p(this,
|
|
2321
|
-
p(this, ee, t(this, ut).shadowRoot.querySelector("nine-table-sheet")),
|
|
2317
|
+
t(this, gr).call(this), p(this, Ht, this.closest("nine-table-sheet")), p(this, te, this.getRootNode().host), p(this, ut, this.querySelector("nine-table-simple")), S.log("1***********************", t(this, ut)), setTimeout(() => {
|
|
2318
|
+
p(this, ee, t(this, ut).shadowRoot.querySelector("nine-table-sheet")), S.log("2***********************", t(this, ee));
|
|
2322
2319
|
}), this.querySelector(".search-box").addEventListener("focusin", (e) => {
|
|
2323
2320
|
e.stopPropagation();
|
|
2324
2321
|
}), this.querySelector(".search-box").addEventListener("input", t(this, yr)), this.querySelector("#chkSelectAll").addEventListener("change", t(this, xr)), this.querySelector("#btnOk").addEventListener("click", t(this, mr));
|
|
@@ -2433,20 +2430,20 @@ const jo = class jo extends HTMLElement {
|
|
|
2433
2430
|
const e = t(this, ee).view.getArray(), s = t(this, ut).data.getHostFields(), i = e.filter((a) => {
|
|
2434
2431
|
const c = a.v[s.indexOf("CHK")];
|
|
2435
2432
|
return c === "Y" || c === !0;
|
|
2436
|
-
}), n = { ...((l = t(this,
|
|
2433
|
+
}), n = { ...((l = t(this, Ht).filtering) == null ? void 0 : l.filters) || {} };
|
|
2437
2434
|
t(this, _t).columns.forEach((a) => {
|
|
2438
|
-
const c = a.expr || a.bind, u = a.expr ? s.indexOf("DATA2") : s.indexOf("DATA"),
|
|
2439
|
-
|
|
2435
|
+
const c = a.expr || a.bind, u = a.expr ? s.indexOf("DATA2") : s.indexOf("DATA"), f = i.map((g) => g.v[u]);
|
|
2436
|
+
f.length > 0 ? n[c] = f : delete n[c];
|
|
2440
2437
|
});
|
|
2441
2438
|
const o = t(this, ut).data.count();
|
|
2442
2439
|
setTimeout(() => {
|
|
2443
2440
|
try {
|
|
2444
2441
|
o === i.length ? t(this, _t).columns.forEach((a) => {
|
|
2445
2442
|
const c = a.expr || a.bind;
|
|
2446
|
-
c && t(this,
|
|
2447
|
-
}) : t(this,
|
|
2443
|
+
c && t(this, Ht).filtering.clear(c);
|
|
2444
|
+
}) : t(this, Ht).filtering.set(n), t(this, Ht).querySelectorAll("nine-table-filter-button").forEach((a) => {
|
|
2448
2445
|
a.updateFilteredState();
|
|
2449
|
-
}), t(this,
|
|
2446
|
+
}), t(this, Ht).invalidate(), this.close();
|
|
2450
2447
|
} finally {
|
|
2451
2448
|
t(this, te).loading = !1;
|
|
2452
2449
|
}
|
|
@@ -2461,7 +2458,7 @@ const jo = class jo extends HTMLElement {
|
|
|
2461
2458
|
i.forEach((a) => {
|
|
2462
2459
|
const c = o >= 0 && a.v ? a.v[o] : "";
|
|
2463
2460
|
String(c).replace(/<[^>]*>?/gm, "").toLowerCase().includes(s) && l.push(c);
|
|
2464
|
-
}),
|
|
2461
|
+
}), S.log(l), t(this, ee).filtering.set({
|
|
2465
2462
|
DATA2: [...new Set(l)]
|
|
2466
2463
|
});
|
|
2467
2464
|
}
|
|
@@ -2473,7 +2470,7 @@ const jo = class jo extends HTMLElement {
|
|
|
2473
2470
|
c.v[o] = s ? "Y" : "N";
|
|
2474
2471
|
}), t(this, ut).refresh();
|
|
2475
2472
|
}, "#onSelectAll"));
|
|
2476
|
-
d(this,
|
|
2473
|
+
d(this, Ro, /* @__PURE__ */ h(() => {
|
|
2477
2474
|
this.close();
|
|
2478
2475
|
}, "#onCancel"));
|
|
2479
2476
|
}
|
|
@@ -2484,7 +2481,7 @@ const jo = class jo extends HTMLElement {
|
|
|
2484
2481
|
p(this, _t, e);
|
|
2485
2482
|
const s = e.closest("th, td");
|
|
2486
2483
|
this.currentCol = s == null ? void 0 : s.dataset.col;
|
|
2487
|
-
const i = s.getBoundingClientRect(), n = t(this,
|
|
2484
|
+
const i = s.getBoundingClientRect(), n = t(this, Ht).getBoundingClientRect(), o = this.offsetWidth || 240;
|
|
2488
2485
|
let l = i.right - n.left - o, a = i.bottom - n.top;
|
|
2489
2486
|
l < 0 && (l = Math.max(0, i.left - n.left)), this.style.left = `${l}px`, this.style.top = `${a}px`;
|
|
2490
2487
|
const c = this.querySelector(".search-box");
|
|
@@ -2500,38 +2497,38 @@ const jo = class jo extends HTMLElement {
|
|
|
2500
2497
|
this.currentCol = null, this.classList.remove("active"), p(this, _t, null);
|
|
2501
2498
|
}
|
|
2502
2499
|
};
|
|
2503
|
-
|
|
2500
|
+
Ht = new WeakMap(), te = new WeakMap(), ut = new WeakMap(), ee = new WeakMap(), _t = new WeakMap(), fr = new WeakMap(), gr = new WeakMap(), pr = new WeakMap(), br = new WeakSet(), Ml = /* @__PURE__ */ h(function() {
|
|
2504
2501
|
var c, u;
|
|
2505
|
-
const e = t(this, te).data.getArray(), s = ((c = t(this, _t)) == null ? void 0 : c.columns) || [], i = t(this, te).fields.get() || [], n = ((u = t(this,
|
|
2506
|
-
const
|
|
2507
|
-
for (let
|
|
2508
|
-
const C = e[
|
|
2502
|
+
const e = t(this, te).data.getArray(), s = ((c = t(this, _t)) == null ? void 0 : c.columns) || [], i = t(this, te).fields.get() || [], n = ((u = t(this, Ht).filtering) == null ? void 0 : u.filters) || {}, o = t(this, te).exprEngine, l = s.flatMap((f) => {
|
|
2503
|
+
const g = f.bind, b = f.expr, m = g || b, y = g ? i.indexOf(g) : -1, x = n[m] || [], w = /* @__PURE__ */ new Map();
|
|
2504
|
+
for (let L = 0; L < e.length; L++) {
|
|
2505
|
+
const C = e[L];
|
|
2509
2506
|
if (!C) continue;
|
|
2510
2507
|
let $;
|
|
2511
|
-
y >= 0 && C.v ? $ = C.v[y] :
|
|
2508
|
+
y >= 0 && C.v ? $ = C.v[y] : g && g.includes("data.") ? $ = o ? o.evaluate(g, C, L) : void 0 : b && o && ($ = o.evaluate(b, C, L));
|
|
2512
2509
|
let T = $;
|
|
2513
|
-
b && o && (T = o.evaluate(b, C,
|
|
2510
|
+
b && o && (T = o.evaluate(b, C, L)), T != null && !w.has(T) && w.set(T, {
|
|
2514
2511
|
v: $,
|
|
2515
2512
|
// π‘ νν°λ§ λΉκ΅ κΈ°μ€ (DATA)
|
|
2516
2513
|
v2: T
|
|
2517
2514
|
// π‘ νλ©΄ μΆλ ₯ κΈ°μ€ (DATA2)
|
|
2518
2515
|
});
|
|
2519
2516
|
}
|
|
2520
|
-
const
|
|
2521
|
-
return
|
|
2517
|
+
const v = [...w.values()];
|
|
2518
|
+
return v.sort((L, C) => String(L.v2 || "").localeCompare(String(C.v2 || ""))), x.sort((L, C) => L > C ? 1 : -1), v.map((L) => ({
|
|
2522
2519
|
LVL: 2,
|
|
2523
|
-
DATA:
|
|
2520
|
+
DATA: L.v,
|
|
2524
2521
|
// νν°λ§ λΉκ΅μ© κ°
|
|
2525
|
-
DATA2:
|
|
2522
|
+
DATA2: L.v2 === "" || L.v2 === null || L.v2 === void 0 ? '<span class="empty-value">(empty)</span>' : L.v2,
|
|
2526
2523
|
// νλ©΄ μΆλ ₯μ© κ°
|
|
2527
2524
|
COLNM: m,
|
|
2528
|
-
CHK: x.length === 0 || x.nineBinarySearch(
|
|
2525
|
+
CHK: x.length === 0 || x.nineBinarySearch(L.v || "") >= 0 ? "Y" : "N"
|
|
2529
2526
|
}));
|
|
2530
2527
|
});
|
|
2531
2528
|
t(this, ut).data.set(l);
|
|
2532
2529
|
const a = this.querySelector("#chkSelectAll");
|
|
2533
|
-
a && (a.checked = l.length > 0 && l.every((
|
|
2534
|
-
}, "#loadVirtualFilterItems"), mr = new WeakMap(), yr = new WeakMap(), xr = new WeakMap(),
|
|
2530
|
+
a && (a.checked = l.length > 0 && l.every((f) => f.CHK === "Y"));
|
|
2531
|
+
}, "#loadVirtualFilterItems"), mr = new WeakMap(), yr = new WeakMap(), xr = new WeakMap(), Ro = new WeakMap(), h(jo, "NineTableFilterPanel");
|
|
2535
2532
|
let jn = jo;
|
|
2536
2533
|
var Xe, _e, gi;
|
|
2537
2534
|
const Ko = class Ko extends HTMLElement {
|
|
@@ -2573,11 +2570,11 @@ const Ko = class Ko extends HTMLElement {
|
|
|
2573
2570
|
};
|
|
2574
2571
|
Xe = new WeakMap(), _e = new WeakMap(), gi = new WeakMap(), h(Ko, "NineTableFilterButton");
|
|
2575
2572
|
let Kn = Ko;
|
|
2576
|
-
var
|
|
2573
|
+
var Lt, me, Ue, wr, Ut, vr, Sr, pi, Zn;
|
|
2577
2574
|
const Yo = class Yo {
|
|
2578
2575
|
constructor(r) {
|
|
2579
2576
|
d(this, pi);
|
|
2580
|
-
d(this,
|
|
2577
|
+
d(this, Lt);
|
|
2581
2578
|
d(this, me);
|
|
2582
2579
|
d(this, Ue, !1);
|
|
2583
2580
|
d(this, wr, null);
|
|
@@ -2588,20 +2585,20 @@ const Yo = class Yo {
|
|
|
2588
2585
|
d(this, Sr, /* @__PURE__ */ h(() => {
|
|
2589
2586
|
if (t(this, me).tagName.toLowerCase() === "nine-table-simple")
|
|
2590
2587
|
return;
|
|
2591
|
-
let r = t(this,
|
|
2592
|
-
r || (r = document.createElement("nine-table-filter-panel"), t(this,
|
|
2588
|
+
let r = t(this, Lt).querySelector("nine-table-filter-panel");
|
|
2589
|
+
r || (r = document.createElement("nine-table-filter-panel"), t(this, Lt).appendChild(r)), p(this, wr, r);
|
|
2593
2590
|
}, "#initFilterPanel"));
|
|
2594
2591
|
E(this, "clear", /* @__PURE__ */ h((r) => {
|
|
2595
|
-
r ? delete t(this, Ut)[r] : p(this, Ut, {}), p(this, Ue, Object.keys(t(this, Ut)).length > 0), A(this, pi, Zn).call(this), t(this,
|
|
2592
|
+
r ? delete t(this, Ut)[r] : p(this, Ut, {}), p(this, Ue, Object.keys(t(this, Ut)).length > 0), A(this, pi, Zn).call(this), t(this, Lt).querySelectorAll("nine-table-filter-button").forEach((e) => {
|
|
2596
2593
|
e.updateFilteredState();
|
|
2597
|
-
}),
|
|
2594
|
+
}), S.log(`π [NineTableFiltering] Filter cleared for ${r || "all"}`);
|
|
2598
2595
|
}, "clear"));
|
|
2599
2596
|
E(this, "set", /* @__PURE__ */ h((r) => {
|
|
2600
|
-
|
|
2597
|
+
S.log(r);
|
|
2601
2598
|
let e = Array.isArray(r) ? Object.fromEntries(Object.keys(r[0]).map((s) => [s, [...new Set(r.map((i) => i[s]))]])) : r;
|
|
2602
|
-
p(this, Ut, e), p(this, Ue, Object.keys(e).length > 0), t(this,
|
|
2599
|
+
p(this, Ut, e), p(this, Ue, Object.keys(e).length > 0), t(this, Lt).toggleAttribute("filtering", t(this, Ue)), A(this, pi, Zn).call(this);
|
|
2603
2600
|
}, "set"));
|
|
2604
|
-
p(this,
|
|
2601
|
+
p(this, Lt, r), p(this, me, t(this, Lt).getRootNode().host), t(this, vr).call(this);
|
|
2605
2602
|
}
|
|
2606
2603
|
get filters() {
|
|
2607
2604
|
return t(this, Ut);
|
|
@@ -2610,13 +2607,13 @@ const Yo = class Yo {
|
|
|
2610
2607
|
return t(this, Ue);
|
|
2611
2608
|
}
|
|
2612
2609
|
};
|
|
2613
|
-
|
|
2614
|
-
const e = t(this, me).data.getArray(), s = t(this, me).data.getHostFields(), i = t(this,
|
|
2610
|
+
Lt = new WeakMap(), me = new WeakMap(), Ue = new WeakMap(), wr = new WeakMap(), Ut = new WeakMap(), vr = new WeakMap(), Sr = new WeakMap(), pi = new WeakSet(), Zn = /* @__PURE__ */ h(function() {
|
|
2611
|
+
const e = t(this, me).data.getArray(), s = t(this, me).data.getHostFields(), i = t(this, Lt).index, n = t(this, me).exprEngine;
|
|
2615
2612
|
if (!(Object.keys(t(this, Ut)).length > 0)) {
|
|
2616
2613
|
e.forEach((a) => {
|
|
2617
2614
|
var c, u;
|
|
2618
2615
|
(u = (c = a == null ? void 0 : a.m) == null ? void 0 : c._) != null && u[jt.META.INDEX.FILTER] && (a.m._[jt.META.INDEX.FILTER][i] = !0);
|
|
2619
|
-
}), t(this,
|
|
2616
|
+
}), t(this, Lt).invalidate();
|
|
2620
2617
|
return;
|
|
2621
2618
|
}
|
|
2622
2619
|
const l = Object.entries(t(this, Ut)).map(([a, c]) => {
|
|
@@ -2632,37 +2629,37 @@ Ct = new WeakMap(), me = new WeakMap(), Ue = new WeakMap(), wr = new WeakMap(),
|
|
|
2632
2629
|
if (!a) return;
|
|
2633
2630
|
a.m._[jt.META.INDEX.FILTER] || (a.m._[jt.META.INDEX.FILTER] = []);
|
|
2634
2631
|
let u = !0;
|
|
2635
|
-
for (let
|
|
2636
|
-
const { targetKey:
|
|
2632
|
+
for (let f = 0; f < l.length; f++) {
|
|
2633
|
+
const { targetKey: g, isExpr: b, fieldIdx: m, allowedSet: y } = l[f];
|
|
2637
2634
|
let x;
|
|
2638
|
-
if (b && n ? x = n.evaluate(
|
|
2635
|
+
if (b && n ? x = n.evaluate(g, a, c) : m >= 0 && a.v && (x = a.v[m]), !y.has(x)) {
|
|
2639
2636
|
u = !1;
|
|
2640
2637
|
break;
|
|
2641
2638
|
}
|
|
2642
2639
|
}
|
|
2643
2640
|
a.m._[jt.META.INDEX.FILTER][i] = u;
|
|
2644
|
-
}), t(this,
|
|
2641
|
+
}), t(this, Lt).invalidate();
|
|
2645
2642
|
}, "#applyFiltering"), h(Yo, "Filtering");
|
|
2646
2643
|
let Yn = Yo;
|
|
2647
2644
|
customElements.get("nine-table-filter-panel") || customElements.define("nine-table-filter-panel", jn);
|
|
2648
2645
|
customElements.get("nine-table-filter-button") || customElements.define("nine-table-filter-button", Kn);
|
|
2649
|
-
var lt, bi, at,
|
|
2646
|
+
var lt, bi, at, Ft, Hl, Nl, Dl, Qn;
|
|
2650
2647
|
const Zo = class Zo {
|
|
2651
2648
|
constructor(r) {
|
|
2652
|
-
d(this,
|
|
2649
|
+
d(this, Ft);
|
|
2653
2650
|
d(this, lt);
|
|
2654
2651
|
d(this, bi);
|
|
2655
2652
|
d(this, at, []);
|
|
2656
2653
|
p(this, lt, r), p(this, bi, r.getRootNode().host), setTimeout(() => {
|
|
2657
|
-
A(this,
|
|
2654
|
+
A(this, Ft, Hl).call(this);
|
|
2658
2655
|
}, 300);
|
|
2659
2656
|
}
|
|
2660
2657
|
restore() {
|
|
2661
2658
|
var r;
|
|
2662
|
-
p(this, at, []), t(this, lt).view && t(this, lt).view.resetSorting(), A(this,
|
|
2659
|
+
p(this, at, []), t(this, lt).view && t(this, lt).view.resetSorting(), A(this, Ft, Qn).call(this), (r = t(this, lt).rowManager) == null || r.refresh(!0);
|
|
2663
2660
|
}
|
|
2664
2661
|
};
|
|
2665
|
-
lt = new WeakMap(), bi = new WeakMap(), at = new WeakMap(),
|
|
2662
|
+
lt = new WeakMap(), bi = new WeakMap(), at = new WeakMap(), Ft = new WeakSet(), Hl = /* @__PURE__ */ h(function() {
|
|
2666
2663
|
t(this, lt).querySelectorAll("thead").forEach((r) => {
|
|
2667
2664
|
r.addEventListener("dblclick", (e) => {
|
|
2668
2665
|
const s = e.target.closest("th, td");
|
|
@@ -2670,13 +2667,13 @@ lt = new WeakMap(), bi = new WeakMap(), at = new WeakMap(), Wt = new WeakSet(),
|
|
|
2670
2667
|
const i = t(this, lt).getRootNode().host;
|
|
2671
2668
|
i.loading = !0, setTimeout(() => {
|
|
2672
2669
|
try {
|
|
2673
|
-
A(this,
|
|
2670
|
+
A(this, Ft, Nl).call(this, e, s);
|
|
2674
2671
|
} finally {
|
|
2675
2672
|
i.loading = !1;
|
|
2676
2673
|
}
|
|
2677
2674
|
});
|
|
2678
2675
|
});
|
|
2679
|
-
}),
|
|
2676
|
+
}), S.log("π― [NineTableSorting] Initialized");
|
|
2680
2677
|
}, "#initEvents"), Nl = /* @__PURE__ */ h(function(r, e) {
|
|
2681
2678
|
const s = e.dataset.col, i = e.closest("tr"), n = i ? i.dataset.subrow || String(i.sectionRowIndex) : "0";
|
|
2682
2679
|
if (s === void 0) return;
|
|
@@ -2688,9 +2685,9 @@ lt = new WeakMap(), bi = new WeakMap(), at = new WeakMap(), Wt = new WeakSet(),
|
|
|
2688
2685
|
}), !l && !a) return;
|
|
2689
2686
|
const c = e.classList.contains("asc"), u = e.classList.contains("desc");
|
|
2690
2687
|
!r.ctrlKey && !r.shiftKey && p(this, at, []);
|
|
2691
|
-
const
|
|
2688
|
+
const f = t(this, at).findIndex(
|
|
2692
2689
|
(b) => b.colIndex === s && b.subRowIndex === n || b.colName === l
|
|
2693
|
-
),
|
|
2690
|
+
), g = {
|
|
2694
2691
|
colIndex: s,
|
|
2695
2692
|
subRowIndex: n,
|
|
2696
2693
|
colname: l || a,
|
|
@@ -2700,15 +2697,15 @@ lt = new WeakMap(), bi = new WeakMap(), at = new WeakMap(), Wt = new WeakSet(),
|
|
|
2700
2697
|
asc: !0,
|
|
2701
2698
|
"expr-func": a ? (b, m) => t(this, bi).exprEngine(a, b, m) : null
|
|
2702
2699
|
};
|
|
2703
|
-
!c && !u ?
|
|
2700
|
+
!c && !u ? f >= 0 ? t(this, at)[f].asc = !0 : t(this, at).push({ ...g, asc: !0 }) : c ? f >= 0 ? t(this, at)[f].asc = !1 : t(this, at).push({ ...g, asc: !1 }) : p(this, at, t(this, at).filter(
|
|
2704
2701
|
(b) => !(b.colIndex === s && b.subRowIndex === n || b.colName === l)
|
|
2705
|
-
)), A(this,
|
|
2702
|
+
)), A(this, Ft, Dl).call(this);
|
|
2706
2703
|
}, "#handleSort"), Dl = /* @__PURE__ */ h(function() {
|
|
2707
2704
|
if (!t(this, lt).view) {
|
|
2708
2705
|
console.warn("β οΈ [NineTableSorting] Sheet view (SheetView) is not initialized.");
|
|
2709
2706
|
return;
|
|
2710
2707
|
}
|
|
2711
|
-
t(this, lt).view.setSorting(t(this, at)), A(this,
|
|
2708
|
+
t(this, lt).view.setSorting(t(this, at)), A(this, Ft, Qn).call(this), t(this, lt).invalidate(), S.log("π [NineTableSorting] Sorting applied via RowManager.refresh(true)");
|
|
2712
2709
|
}, "#applySorting"), Qn = /* @__PURE__ */ h(function() {
|
|
2713
2710
|
t(this, lt).querySelectorAll("thead th, thead td").forEach((r) => {
|
|
2714
2711
|
r.classList.remove("asc", "desc");
|
|
@@ -2723,7 +2720,7 @@ lt = new WeakMap(), bi = new WeakMap(), at = new WeakMap(), Wt = new WeakSet(),
|
|
|
2723
2720
|
});
|
|
2724
2721
|
}, "#syncHeaderUI"), h(Zo, "Sorting");
|
|
2725
2722
|
let Jn = Zo;
|
|
2726
|
-
var Ge, mt, ye,
|
|
2723
|
+
var Ge, mt, ye, Lo, mi, se, yi, Ar;
|
|
2727
2724
|
const Jo = class Jo {
|
|
2728
2725
|
// π‘ [μΆκ°] μΊμ±λ μ ν¨ λ μ½λ λ°°μ΄
|
|
2729
2726
|
constructor(r) {
|
|
@@ -2731,7 +2728,7 @@ const Jo = class Jo {
|
|
|
2731
2728
|
d(this, mt);
|
|
2732
2729
|
d(this, ye, []);
|
|
2733
2730
|
// μ λ ¬ κ·μΉ [{ colname, asc, expr-func }]
|
|
2734
|
-
d(this,
|
|
2731
|
+
d(this, Lo, []);
|
|
2735
2732
|
// νν° κ·μΉ
|
|
2736
2733
|
d(this, mi, []);
|
|
2737
2734
|
// νν°λ§ λ° μν
μ΄ λ°μλ μ ν¨ λ°μ΄ν° μΈλ±μ€ λ²νΌ
|
|
@@ -2790,7 +2787,7 @@ const Jo = class Jo {
|
|
|
2790
2787
|
if (!o) return;
|
|
2791
2788
|
const a = (u = (c = o.m) == null ? void 0 : c._) == null ? void 0 : u[jt.META.INDEX.FILTER];
|
|
2792
2789
|
a && a[t(this, Ge).index] === !1 || e.push(l);
|
|
2793
|
-
}),
|
|
2790
|
+
}), S.log(e), t(this, ye).length > 0 && (e = t(this, Ar).call(this, e, r)), p(this, mi, e);
|
|
2794
2791
|
const s = e.map((o) => r[o]), i = ((n = t(this, Ge).grouping) == null ? void 0 : n.columns) || [];
|
|
2795
2792
|
if (i.length > 0) {
|
|
2796
2793
|
const o = Hn.apply(s, i, t(this, mt).data.getHostFields());
|
|
@@ -2806,7 +2803,7 @@ const Jo = class Jo {
|
|
|
2806
2803
|
p(this, ye, []), this.refresh();
|
|
2807
2804
|
}, "resetSorting"));
|
|
2808
2805
|
d(this, Ar, /* @__PURE__ */ h((r, e) => {
|
|
2809
|
-
|
|
2806
|
+
S.log(/* @__PURE__ */ new Date());
|
|
2810
2807
|
const s = typeof t(this, mt).data.getHostFields == "function" ? t(this, mt).data.getHostFields() : [], i = t(this, ye).map((n) => ({
|
|
2811
2808
|
...n,
|
|
2812
2809
|
colIndex: s.indexOf(n.colname || n.colName)
|
|
@@ -2814,20 +2811,20 @@ const Jo = class Jo {
|
|
|
2814
2811
|
return r.sort((n, o) => {
|
|
2815
2812
|
const l = e[n], a = e[o];
|
|
2816
2813
|
for (const c of i) {
|
|
2817
|
-
const u = c.asc,
|
|
2818
|
-
let
|
|
2819
|
-
|
|
2820
|
-
const m =
|
|
2814
|
+
const u = c.asc, f = c.expr;
|
|
2815
|
+
let g, b;
|
|
2816
|
+
f ? (g = t(this, mt).exprEngine.evaluate(f, l, n), b = t(this, mt).exprEngine.evaluate(f, a, o)) : c.colIndex >= 0 && l.v && a.v && (g = l.v[c.colIndex], b = a.v[c.colIndex]);
|
|
2817
|
+
const m = g == null || g === "", y = b == null || b === "";
|
|
2821
2818
|
if (!(m && y)) {
|
|
2822
2819
|
if (m) return 1;
|
|
2823
2820
|
if (y) return -1;
|
|
2824
|
-
if (
|
|
2821
|
+
if (g !== b) {
|
|
2825
2822
|
let x = 0;
|
|
2826
|
-
if (typeof
|
|
2827
|
-
x =
|
|
2823
|
+
if (typeof g == "number" && typeof b == "number")
|
|
2824
|
+
x = g - b;
|
|
2828
2825
|
else {
|
|
2829
|
-
const w = String(
|
|
2830
|
-
x = w >
|
|
2826
|
+
const w = String(g), v = String(b);
|
|
2827
|
+
x = w > v ? 1 : w < v ? -1 : 0;
|
|
2831
2828
|
}
|
|
2832
2829
|
if (x !== 0)
|
|
2833
2830
|
return u ? x : -x;
|
|
@@ -2840,14 +2837,14 @@ const Jo = class Jo {
|
|
|
2840
2837
|
p(this, Ge, r), p(this, mt, r.getRootNode().host), this.refresh();
|
|
2841
2838
|
}
|
|
2842
2839
|
};
|
|
2843
|
-
Ge = new WeakMap(), mt = new WeakMap(), ye = new WeakMap(),
|
|
2840
|
+
Ge = new WeakMap(), mt = new WeakMap(), ye = new WeakMap(), Lo = new WeakMap(), mi = new WeakMap(), se = new WeakMap(), yi = new WeakMap(), Ar = new WeakMap(), h(Jo, "SheetView");
|
|
2844
2841
|
let Xi = Jo;
|
|
2845
2842
|
const wn = 16;
|
|
2846
2843
|
var W, $l, Fl, Wl, Ol, zl, Bl, Vl, Pl, Xl, _l, Ul, Gl;
|
|
2847
2844
|
const rt = class rt {
|
|
2848
2845
|
static initializeTable(r, e) {
|
|
2849
|
-
var s, i, n, o, l, a, c, u,
|
|
2850
|
-
return !r || !e ? null : (A(s = rt, W, Ol).call(s, e), A(i = rt, W, Bl).call(i, e), A(n = rt, W, Wl).call(n, e), A(o = rt, W, Ul).call(o, e), A(l = rt, W, zl).call(l, e), Ee.resetColIndex(e, e.querySelectorAll("thead tr")), Ee.resetColIndex(e, e.querySelectorAll('tbody.body tr[grouping="true"]')), Ee.resetColIndex(e, e.querySelectorAll('tbody.body tr:not([grouping="true"])')), Ee.resetColIndex(e, e.querySelectorAll("tfoot tr")), A(a = rt, W, $l).call(a, e), A(c = rt, W, Vl).call(c, e), A(u = rt, W, Pl).call(u, r, e), A(
|
|
2846
|
+
var s, i, n, o, l, a, c, u, f, g, b;
|
|
2847
|
+
return !r || !e ? null : (A(s = rt, W, Ol).call(s, e), A(i = rt, W, Bl).call(i, e), A(n = rt, W, Wl).call(n, e), A(o = rt, W, Ul).call(o, e), A(l = rt, W, zl).call(l, e), Ee.resetColIndex(e, e.querySelectorAll("thead tr")), Ee.resetColIndex(e, e.querySelectorAll('tbody.body tr[grouping="true"]')), Ee.resetColIndex(e, e.querySelectorAll('tbody.body tr:not([grouping="true"])')), Ee.resetColIndex(e, e.querySelectorAll("tfoot tr")), A(a = rt, W, $l).call(a, e), A(c = rt, W, Vl).call(c, e), A(u = rt, W, Pl).call(u, r, e), A(f = rt, W, _l).call(f, e), A(g = rt, W, Xl).call(g, r, e), A(b = rt, W, Gl).call(b, e), e);
|
|
2851
2848
|
}
|
|
2852
2849
|
};
|
|
2853
2850
|
W = new WeakSet(), $l = /* @__PURE__ */ h(function(r) {
|
|
@@ -2862,9 +2859,9 @@ W = new WeakSet(), $l = /* @__PURE__ */ h(function(r) {
|
|
|
2862
2859
|
var c;
|
|
2863
2860
|
if (!a.classList.contains("dummy")) {
|
|
2864
2861
|
const u = a.colSpan || 1;
|
|
2865
|
-
for (let
|
|
2866
|
-
const
|
|
2867
|
-
i.insertAdjacentHTML("beforeend",
|
|
2862
|
+
for (let f = 0; f < u; f++) {
|
|
2863
|
+
const g = s.replace("@col", o).replace("@text", A(c = rt, W, Fl).call(c, o++));
|
|
2864
|
+
i.insertAdjacentHTML("beforeend", g);
|
|
2868
2865
|
}
|
|
2869
2866
|
}
|
|
2870
2867
|
});
|
|
@@ -2926,21 +2923,21 @@ W = new WeakSet(), $l = /* @__PURE__ */ h(function(r) {
|
|
|
2926
2923
|
e.querySelectorAll("tbody th, tbody td").forEach((n) => {
|
|
2927
2924
|
const l = `cell-${n.getAttribute("cell-type") || "renderer"}`, a = n.querySelector("datalist");
|
|
2928
2925
|
if (a) {
|
|
2929
|
-
let
|
|
2926
|
+
let f = [];
|
|
2930
2927
|
a.querySelectorAll("option").forEach((b) => {
|
|
2931
|
-
|
|
2928
|
+
f.push({
|
|
2932
2929
|
k: b.getAttribute("k"),
|
|
2933
2930
|
v: b.getAttribute("v")
|
|
2934
2931
|
});
|
|
2935
2932
|
});
|
|
2936
|
-
const
|
|
2937
|
-
r && (r[
|
|
2933
|
+
const g = `__ds_${Date.now()}_${++i}`;
|
|
2934
|
+
r && (r[g] = () => f), n.setAttribute("data-source", `host.${g}()`), a.remove();
|
|
2938
2935
|
}
|
|
2939
2936
|
const c = n.dataset.expr;
|
|
2940
|
-
c && n.setAttribute("data-expr", r.exprEngine.precompile(c)), Array.from(n.attributes).forEach((
|
|
2941
|
-
["data-bind", "data-expr", "cell-type"].includes(
|
|
2937
|
+
c && n.setAttribute("data-expr", r.exprEngine.precompile(c)), Array.from(n.attributes).forEach((f) => {
|
|
2938
|
+
["data-bind", "data-expr", "cell-type"].includes(f.name) || (f.value.includes("data.") || f.value.includes("host.")) && n.setAttribute(f.name, r.exprEngine.precompile(f.value));
|
|
2942
2939
|
});
|
|
2943
|
-
const u = s.filter((
|
|
2940
|
+
const u = s.filter((f) => n.hasAttribute(f)).map((f) => `${f}="${n.getAttribute(f)}"`);
|
|
2944
2941
|
n.innerHTML = `<${l} ${u.join(" ")}></${l}>`, n.setAttribute("tabindex", "0");
|
|
2945
2942
|
}), e.querySelectorAll("thead th, thead td, tfoot th, tfoot td").forEach((n) => {
|
|
2946
2943
|
const o = n.getAttribute("cell-type");
|
|
@@ -2958,9 +2955,9 @@ W = new WeakSet(), $l = /* @__PURE__ */ h(function(r) {
|
|
|
2958
2955
|
}, "#initFilterButtons"), _l = /* @__PURE__ */ h(function(r) {
|
|
2959
2956
|
r.querySelectorAll("thead th, thead td").forEach((e) => {
|
|
2960
2957
|
if (!(e.getAttribute("collapsible") === "true" || e.getAttribute("expandable") === "true")) return;
|
|
2961
|
-
|
|
2958
|
+
S.log("11.*******************************", e.dataset.col);
|
|
2962
2959
|
const i = parseInt(e.dataset.col, 10), n = e.colSpan || 1, o = r.querySelector(`colgroup col[data-col="${i}"]`);
|
|
2963
|
-
|
|
2960
|
+
S.log("11.*******************************", o);
|
|
2964
2961
|
const l = o && parseInt(o.getAttribute("width"), 10) || 100;
|
|
2965
2962
|
(!e.dataset.expandWidth || parseInt(e.dataset.expandWidth, 10) <= wn) && (e.dataset.expandWidth = String(l > wn ? l : 100));
|
|
2966
2963
|
let a = e.querySelector("nine-table-col-expand");
|
|
@@ -2968,9 +2965,9 @@ W = new WeakSet(), $l = /* @__PURE__ */ h(function(r) {
|
|
|
2968
2965
|
a.classList.add("collapsed"), a.classList.remove("expand"), a.setAttribute("collapsed", "true"), e.style.color = "transparent";
|
|
2969
2966
|
const u = Math.max(10, Math.floor(wn / n));
|
|
2970
2967
|
if (!isNaN(i))
|
|
2971
|
-
for (let
|
|
2972
|
-
const
|
|
2973
|
-
|
|
2968
|
+
for (let f = 0; f < n; f++) {
|
|
2969
|
+
const g = r.querySelector(`colgroup col[data-col="${i + f}"]`);
|
|
2970
|
+
g && (g.setAttribute("width", u), g.style.width = `${u}px`);
|
|
2974
2971
|
}
|
|
2975
2972
|
} else
|
|
2976
2973
|
a.classList.remove("collapsed"), a.classList.add("expand"), a.setAttribute("collapsed", "false"), e.style.color = "";
|
|
@@ -2985,7 +2982,7 @@ W = new WeakSet(), $l = /* @__PURE__ */ h(function(r) {
|
|
|
2985
2982
|
});
|
|
2986
2983
|
}, "#ensureRowIndicator"), Gl = /* @__PURE__ */ h(function(r) {
|
|
2987
2984
|
r.querySelectorAll("th[data-col], td[data-col]").forEach((e) => {
|
|
2988
|
-
|
|
2985
|
+
S.log(e);
|
|
2989
2986
|
const s = parseInt(e.getAttribute("data-col"), 10);
|
|
2990
2987
|
if (isNaN(s)) return;
|
|
2991
2988
|
const i = parseInt(e.getAttribute("colspan") || e.colSpan, 10) || 1;
|
|
@@ -3001,14 +2998,14 @@ W = new WeakSet(), $l = /* @__PURE__ */ h(function(r) {
|
|
|
3001
2998
|
});
|
|
3002
2999
|
}, "#applyInitialCellWidths"), d(rt, W), h(rt, "PreCompiler");
|
|
3003
3000
|
let to = rt;
|
|
3004
|
-
var xi, ie,
|
|
3001
|
+
var xi, ie, Nt, wi, vi, xe, ps, Si, Er, Ai, bs, je, Ct, Ke, Rr, jl, Lr, Cr, Ye, Ei, Tr, kr, Ir, qr, Ri, Mr;
|
|
3005
3002
|
const Ns = class Ns extends HTMLElement {
|
|
3006
3003
|
constructor() {
|
|
3007
3004
|
super();
|
|
3008
|
-
d(this,
|
|
3005
|
+
d(this, Rr);
|
|
3009
3006
|
d(this, xi);
|
|
3010
3007
|
d(this, ie);
|
|
3011
|
-
d(this,
|
|
3008
|
+
d(this, Nt);
|
|
3012
3009
|
d(this, wi);
|
|
3013
3010
|
d(this, vi);
|
|
3014
3011
|
d(this, xe);
|
|
@@ -3018,16 +3015,16 @@ const Ns = class Ns extends HTMLElement {
|
|
|
3018
3015
|
d(this, Ai);
|
|
3019
3016
|
d(this, bs);
|
|
3020
3017
|
d(this, je);
|
|
3021
|
-
d(this,
|
|
3018
|
+
d(this, Ct, {
|
|
3022
3019
|
table: null
|
|
3023
3020
|
});
|
|
3024
3021
|
d(this, Ke);
|
|
3025
|
-
d(this,
|
|
3022
|
+
d(this, Lr, /* @__PURE__ */ h(() => {
|
|
3026
3023
|
const e = this.querySelector(".ng-container-body thead"), s = this.querySelector(".ng-nodata-overlay");
|
|
3027
3024
|
s.style.top = `${e.offsetHeight}px`;
|
|
3028
3025
|
}, "#adjustOverlay"));
|
|
3029
3026
|
E(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
3030
|
-
this.view.refresh(), t(this,
|
|
3027
|
+
this.view.refresh(), t(this, Nt).refresh(!0), this.isAutoFitCol && this.autoFit(!0);
|
|
3031
3028
|
}, "invalidate"));
|
|
3032
3029
|
E(this, "autoFit", /* @__PURE__ */ h((e = !0) => {
|
|
3033
3030
|
requestAnimationFrame(() => {
|
|
@@ -3037,11 +3034,10 @@ const Ns = class Ns extends HTMLElement {
|
|
|
3037
3034
|
}, "autoFit"));
|
|
3038
3035
|
d(this, Cr, /* @__PURE__ */ h((e = !0) => {
|
|
3039
3036
|
var n;
|
|
3040
|
-
|
|
3037
|
+
S.log("***************** autoFit", this);
|
|
3041
3038
|
const s = this.querySelector(".ng-sheet-body .ng-container-body");
|
|
3042
3039
|
if (!s) return;
|
|
3043
|
-
|
|
3044
|
-
const i = this.querySelector(".ng-sheet-header .ng-container-body table colgroup");
|
|
3040
|
+
const i = this.querySelector(".ng-container-body table colgroup");
|
|
3045
3041
|
if (i) {
|
|
3046
3042
|
if (e) {
|
|
3047
3043
|
this.setAttribute("auto-fit-col", "true");
|
|
@@ -3049,33 +3045,33 @@ const Ns = class Ns extends HTMLElement {
|
|
|
3049
3045
|
if (o <= 0) return;
|
|
3050
3046
|
let l = 0;
|
|
3051
3047
|
const a = [];
|
|
3052
|
-
i.querySelectorAll("col").forEach((
|
|
3053
|
-
const
|
|
3048
|
+
i.querySelectorAll("col").forEach((f) => {
|
|
3049
|
+
const g = f.getAttribute("data-col"), b = this.querySelector(`thead th[data-col="${g}"]`);
|
|
3054
3050
|
if ((b == null ? void 0 : b.getAttribute("collapsed")) === "true")
|
|
3055
|
-
a.unshift({ globalColIndex:
|
|
3051
|
+
a.unshift({ globalColIndex: g, width: 16, isCollapsed: !0 }), S.log(`[AutoFit Col] Index ${g}: COLLAPSED (forced 16px)`);
|
|
3056
3052
|
else {
|
|
3057
|
-
const y = parseInt(
|
|
3058
|
-
a.push({ globalColIndex:
|
|
3053
|
+
const y = parseInt(f.getAttribute("width"), 10) || 100;
|
|
3054
|
+
a.push({ globalColIndex: g, width: y, isCollapsed: !1 }), l += y, S.log(`[AutoFit Col] Index ${g}: NORMAL (original width: ${y}px)`);
|
|
3059
3055
|
}
|
|
3060
|
-
}),
|
|
3061
|
-
const c = a.filter((
|
|
3062
|
-
if (
|
|
3063
|
-
let
|
|
3064
|
-
const
|
|
3056
|
+
}), S.log(`[AutoFit] Total Original Width of Normal Cols: ${l}px`);
|
|
3057
|
+
const c = a.filter((f) => f.isCollapsed).reduce((f, g) => f + g.width, 0), u = Math.max(0, o - c);
|
|
3058
|
+
if (S.log(`[AutoFit] Collapsed Total Width: ${c}px | Available Width for Normal Cols: ${u}px`), l > 0 && a.length > 0) {
|
|
3059
|
+
let f = 0;
|
|
3060
|
+
const g = a.map((x) => {
|
|
3065
3061
|
if (x.isCollapsed)
|
|
3066
3062
|
return { globalColIndex: x.globalColIndex, remainder: 0, width: 16 };
|
|
3067
|
-
const w = x.width * u / l,
|
|
3068
|
-
return
|
|
3063
|
+
const w = x.width * u / l, v = Math.max(30, Math.floor(w));
|
|
3064
|
+
return f += v, {
|
|
3069
3065
|
globalColIndex: x.globalColIndex,
|
|
3070
3066
|
remainder: w - Math.floor(w),
|
|
3071
|
-
width:
|
|
3067
|
+
width: v
|
|
3072
3068
|
};
|
|
3073
3069
|
});
|
|
3074
|
-
let b = u -
|
|
3075
|
-
|
|
3076
|
-
const m =
|
|
3070
|
+
let b = u - f;
|
|
3071
|
+
S.log(`[AutoFit] Initial Allocated Total: ${f}px | Remainder Pixels to distribute: ${b}`);
|
|
3072
|
+
const m = g.filter((x) => {
|
|
3077
3073
|
var w;
|
|
3078
|
-
return !((w = a.find((
|
|
3074
|
+
return !((w = a.find((v) => v.globalColIndex === x.globalColIndex)) != null && w.isCollapsed);
|
|
3079
3075
|
});
|
|
3080
3076
|
if (b > 0 && m.length > 0) {
|
|
3081
3077
|
m.sort((x, w) => w.remainder - x.remainder);
|
|
@@ -3088,10 +3084,10 @@ const Ns = class Ns extends HTMLElement {
|
|
|
3088
3084
|
w.width > 30 && (w.width -= 1);
|
|
3089
3085
|
}
|
|
3090
3086
|
}
|
|
3091
|
-
const y =
|
|
3092
|
-
|
|
3093
|
-
var
|
|
3094
|
-
|
|
3087
|
+
const y = g.reduce((x, w) => x + w.width, 0);
|
|
3088
|
+
S.log(`[AutoFit Verification] Target Container Width: ${o}px | Sum of All Calculated Cols: ${y}px`), o !== y ? S.log(`β οΈ [AutoFit Mismatch Warning!] μ€μ°¨ λ°μ: ${o - y}px μ°¨μ΄κ° λ©λλ€.`) : S.log("β
[AutoFit Success] μλ²½νκ² μΌμΉν©λλ€!"), g.forEach(({ globalColIndex: x, width: w }) => {
|
|
3089
|
+
var v;
|
|
3090
|
+
S.log(`[AutoFit Apply] Col Index ${x} -> ${w}px`), (v = t(this, xe)) == null || v.setColumnWidth(x, w, "body");
|
|
3095
3091
|
});
|
|
3096
3092
|
}
|
|
3097
3093
|
} else
|
|
@@ -3100,7 +3096,7 @@ const Ns = class Ns extends HTMLElement {
|
|
|
3100
3096
|
}
|
|
3101
3097
|
}, "#autoFit"));
|
|
3102
3098
|
E(this, "generate", /* @__PURE__ */ h((e, s) => {
|
|
3103
|
-
p(this, xi, s), to.initializeTable(t(this, ie), e),
|
|
3099
|
+
p(this, xi, s), to.initializeTable(t(this, ie), e), S.log("=======", e), p(this, Ct, {
|
|
3104
3100
|
table: Ee.compile(e),
|
|
3105
3101
|
tbody: {
|
|
3106
3102
|
tr: e.querySelectorAll("tbody tr")
|
|
@@ -3116,7 +3112,7 @@ const Ns = class Ns extends HTMLElement {
|
|
|
3116
3112
|
},
|
|
3117
3113
|
tfoot: this.querySelector(`${n} tfoot`)
|
|
3118
3114
|
};
|
|
3119
|
-
}), t(this,
|
|
3115
|
+
}), t(this, Nt).initialize(), this.isAutoFitCol ? this.autoFit(!0) : this.querySelector("nine-table-hscrollbar").refresh(), t(this, bs).initialize(), this.loaded = !0;
|
|
3120
3116
|
}, "generate"));
|
|
3121
3117
|
d(this, Ye, /* @__PURE__ */ h(() => {
|
|
3122
3118
|
this.isAutoFitCol, ["left", "right", "body"].forEach((e) => {
|
|
@@ -3146,7 +3142,7 @@ const Ns = class Ns extends HTMLElement {
|
|
|
3146
3142
|
});
|
|
3147
3143
|
}, "#renderSplitContainers"));
|
|
3148
3144
|
d(this, Tr, /* @__PURE__ */ h((e) => {
|
|
3149
|
-
const s = t(this,
|
|
3145
|
+
const s = t(this, Ct).table.cloneNode(!0);
|
|
3150
3146
|
return e === "left" ? s.querySelectorAll("col, th, td").forEach((i) => {
|
|
3151
3147
|
i.getAttribute("fixed") !== "left" && i.remove();
|
|
3152
3148
|
}) : e === "right" ? s.querySelectorAll("col, th, td").forEach((i) => {
|
|
@@ -3155,7 +3151,7 @@ const Ns = class Ns extends HTMLElement {
|
|
|
3155
3151
|
i.remove();
|
|
3156
3152
|
}), s;
|
|
3157
3153
|
}, "#createSplitTable"));
|
|
3158
|
-
E(this, "getRowHeight", /* @__PURE__ */ h(() => t(this,
|
|
3154
|
+
E(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, Nt).getRowHeight(), "getRowHeight"));
|
|
3159
3155
|
E(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
3160
3156
|
const s = this.querySelector(".ng-sheet-body .ng-container-body");
|
|
3161
3157
|
s && (s.scrollLeft = e);
|
|
@@ -3165,12 +3161,12 @@ const Ns = class Ns extends HTMLElement {
|
|
|
3165
3161
|
s && (s.scrollTop = e);
|
|
3166
3162
|
}, "scrollToY"));
|
|
3167
3163
|
d(this, kr, /* @__PURE__ */ h(() => {
|
|
3168
|
-
|
|
3164
|
+
S.log("11111*****************"), t(this, Ir).call(this), p(this, wi, new zn(this)), p(this, vi, new Bn(this)), p(this, xe, new Pn(this)), p(this, ps, new Un(this)), p(this, Si, new Pi(this)), p(this, je, new Xi(this)), p(this, Ai, new Yn(this)), p(this, bs, new Mn(this)), t(this, Rr, jl) || p(this, Er, new Jn(this)), t(this, Ke).mainBody.addEventListener("scroll", () => {
|
|
3169
3165
|
this.querySelector("nine-table-hscrollbar").refresh();
|
|
3170
3166
|
});
|
|
3171
3167
|
}, "#init"));
|
|
3172
3168
|
d(this, Ir, /* @__PURE__ */ h(() => {
|
|
3173
|
-
|
|
3169
|
+
S.log("11111*****************"), Ns.SCROLLBAR_SIZE, S.log("2222*****************"), this.innerHTML = `
|
|
3174
3170
|
<div class="ng-sheet-body">
|
|
3175
3171
|
<div class="ng-sheet-body-content">
|
|
3176
3172
|
<div class="ng-container-left"></div>
|
|
@@ -3200,23 +3196,23 @@ const Ns = class Ns extends HTMLElement {
|
|
|
3200
3196
|
|
|
3201
3197
|
<div class="ng-col-mover-grip"></div>
|
|
3202
3198
|
<div class="ng-col-mover-indi"></div>
|
|
3203
|
-
`,
|
|
3199
|
+
`, S.log("3333*****************"), p(this, Ke, {
|
|
3204
3200
|
mainBody: this.querySelector(".ng-sheet-body .ng-container-body"),
|
|
3205
3201
|
hscrollbar: this.querySelector("nine-table-hscrollbar"),
|
|
3206
3202
|
vscrollbar: this.querySelector("nine-table-vscrollbar"),
|
|
3207
3203
|
content: this.querySelector(".ng-sheet-body .ng-sheet-body-content"),
|
|
3208
3204
|
scrollHolder: this.querySelector(".ng-sheet-body .ng-virtual-height-holder")
|
|
3209
|
-
}),
|
|
3205
|
+
}), S.log("444*****************");
|
|
3210
3206
|
}, "#render"));
|
|
3211
3207
|
d(this, qr, /* @__PURE__ */ h(() => {
|
|
3212
|
-
|
|
3208
|
+
S.log("**********************", "#syncHeaderAndFooterHeights");
|
|
3213
3209
|
const e = this.querySelector(".ng-container-left table"), s = this.querySelector(".ng-container-body table"), i = this.querySelector(".ng-container-right table"), n = Array.from(e.querySelectorAll("thead tr:not(.col-indicator-rowgroup)")), o = Array.from(s.querySelectorAll("thead tr:not(.col-indicator-rowgroup)")), l = Array.from(i.querySelectorAll("thead tr:not(.col-indicator-rowgroup)"));
|
|
3214
|
-
t(this,
|
|
3210
|
+
t(this, Ri).call(this, n, o, l);
|
|
3215
3211
|
const a = Array.from(e.querySelectorAll("tfoot tr")), c = Array.from(s.querySelectorAll("tfoot tr")), u = Array.from(i.querySelectorAll("tfoot tr"));
|
|
3216
|
-
t(this,
|
|
3212
|
+
t(this, Ri).call(this, a, c, u);
|
|
3217
3213
|
}, "#syncHeaderAndFooterHeights"));
|
|
3218
3214
|
// κ³΅ν΅ μ΅λ λμ΄ μ μ© ν¬νΌ λ©μλ
|
|
3219
|
-
d(this,
|
|
3215
|
+
d(this, Ri, /* @__PURE__ */ h((e, s, i) => {
|
|
3220
3216
|
var o, l, a;
|
|
3221
3217
|
const n = Math.max(e.length, s.length, i.length);
|
|
3222
3218
|
for (let c = 0; c < n; c++) {
|
|
@@ -3224,8 +3220,8 @@ const Ns = class Ns extends HTMLElement {
|
|
|
3224
3220
|
((o = e[c]) == null ? void 0 : o.getBoundingClientRect().height) || 0,
|
|
3225
3221
|
((l = s[c]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
3226
3222
|
((a = i[c]) == null ? void 0 : a.getBoundingClientRect().height) || 0
|
|
3227
|
-
],
|
|
3228
|
-
|
|
3223
|
+
], f = Math.max(...u);
|
|
3224
|
+
f > 0 && (e[c] && (e[c].style.height = `${f}px`), s[c] && (s[c].style.height = `${f}px`), i[c] && (i[c].style.height = `${f}px`));
|
|
3229
3225
|
}
|
|
3230
3226
|
}, "#applyMaxHeights"));
|
|
3231
3227
|
d(this, Mr, /* @__PURE__ */ h(() => {
|
|
@@ -3248,7 +3244,7 @@ const Ns = class Ns extends HTMLElement {
|
|
|
3248
3244
|
}), s = null);
|
|
3249
3245
|
});
|
|
3250
3246
|
}, "#initRowHoverEvent"));
|
|
3251
|
-
|
|
3247
|
+
S.log("11111"), p(this, Nt, new Wn(this)), S.log("222"), p(this, ie, this.getRootNode().host), S.log("333");
|
|
3252
3248
|
}
|
|
3253
3249
|
connectedCallback() {
|
|
3254
3250
|
t(this, kr).call(this);
|
|
@@ -3272,7 +3268,7 @@ const Ns = class Ns extends HTMLElement {
|
|
|
3272
3268
|
return t(this, Si);
|
|
3273
3269
|
}
|
|
3274
3270
|
get rowManager() {
|
|
3275
|
-
return t(this,
|
|
3271
|
+
return t(this, Nt);
|
|
3276
3272
|
}
|
|
3277
3273
|
get selection() {
|
|
3278
3274
|
return t(this, wi);
|
|
@@ -3281,38 +3277,38 @@ const Ns = class Ns extends HTMLElement {
|
|
|
3281
3277
|
return t(this, vi);
|
|
3282
3278
|
}
|
|
3283
3279
|
get templateLength() {
|
|
3284
|
-
return t(this,
|
|
3280
|
+
return t(this, Ct).tbody.tr.length || 0;
|
|
3285
3281
|
}
|
|
3286
3282
|
get elements() {
|
|
3287
3283
|
return t(this, Ke);
|
|
3288
3284
|
}
|
|
3289
3285
|
get isAutoFitCol() {
|
|
3290
3286
|
var i, n;
|
|
3291
|
-
const e = this.getAttribute("auto-fit-col") === "true" || ((i = t(this, ie)) == null ? void 0 : i.getAttribute("auto-fit-col")) === "true", s = ((n = t(this,
|
|
3287
|
+
const e = this.getAttribute("auto-fit-col") === "true" || ((i = t(this, ie)) == null ? void 0 : i.getAttribute("auto-fit-col")) === "true", s = ((n = t(this, Ct).table) == null ? void 0 : n.getAttribute("auto-fit-col")) === "true";
|
|
3292
3288
|
return e || s;
|
|
3293
3289
|
}
|
|
3294
3290
|
get sourceTable() {
|
|
3295
|
-
return t(this,
|
|
3291
|
+
return t(this, Ct).table;
|
|
3296
3292
|
}
|
|
3297
3293
|
get source() {
|
|
3298
|
-
return t(this,
|
|
3294
|
+
return t(this, Ct);
|
|
3299
3295
|
}
|
|
3300
3296
|
recompileAndRefresh() {
|
|
3301
3297
|
var e;
|
|
3302
|
-
t(this,
|
|
3298
|
+
t(this, Ct).table && (Ee.recompile(t(this, Ct).table), ["left", "right", "body"].forEach((s) => {
|
|
3303
3299
|
["header", "body", "footer"].forEach((i) => {
|
|
3304
3300
|
const n = this.querySelector(`.ng-sheet-${i} .ng-container-${s}`);
|
|
3305
3301
|
n && n.querySelectorAll("table").forEach((o) => o.remove());
|
|
3306
3302
|
});
|
|
3307
|
-
}), t(this, Ei).call(this), t(this, Ye).call(this), t(this,
|
|
3303
|
+
}), t(this, Ei).call(this), t(this, Ye).call(this), t(this, Nt).initialize(), this.isAutoFitCol ? this.autoFit(!0) : (e = this.querySelector("nine-table-hscrollbar")) == null || e.refresh(), requestAnimationFrame(() => {
|
|
3308
3304
|
var s;
|
|
3309
|
-
t(this, Ye).call(this), (s = t(this,
|
|
3305
|
+
t(this, Ye).call(this), (s = t(this, Nt)) == null || s.refresh();
|
|
3310
3306
|
}));
|
|
3311
3307
|
}
|
|
3312
3308
|
refreshLayout() {
|
|
3313
|
-
!this.classList.contains("active") || !t(this,
|
|
3309
|
+
!this.classList.contains("active") || !t(this, Ct).table || requestAnimationFrame(() => {
|
|
3314
3310
|
var e, s, i;
|
|
3315
|
-
t(this, Ye).call(this), this.isAutoFitCol ? this.autoFit(!0) : (e = this.querySelector("nine-table-hscrollbar")) == null || e.refresh(), t(this,
|
|
3311
|
+
t(this, Ye).call(this), this.isAutoFitCol ? this.autoFit(!0) : (e = this.querySelector("nine-table-hscrollbar")) == null || e.refresh(), t(this, Lr).call(this), (s = t(this, xe)) == null || s.refreshLayout(), (i = t(this, Nt)) == null || i.refresh();
|
|
3316
3312
|
});
|
|
3317
3313
|
}
|
|
3318
3314
|
get view() {
|
|
@@ -3324,22 +3320,22 @@ const Ns = class Ns extends HTMLElement {
|
|
|
3324
3320
|
(e = t(this, xe)) == null || e.destroy(), (s = t(this, ps)) == null || s.destroy(), this.innerHTML = "";
|
|
3325
3321
|
}
|
|
3326
3322
|
};
|
|
3327
|
-
xi = new WeakMap(), ie = new WeakMap(),
|
|
3323
|
+
xi = new WeakMap(), ie = new WeakMap(), Nt = new WeakMap(), wi = new WeakMap(), vi = new WeakMap(), xe = new WeakMap(), ps = new WeakMap(), Si = new WeakMap(), Er = new WeakMap(), Ai = new WeakMap(), bs = new WeakMap(), je = new WeakMap(), Ct = new WeakMap(), Ke = new WeakMap(), Rr = new WeakSet(), jl = /* @__PURE__ */ h(function() {
|
|
3328
3324
|
return t(this, ie).hasAttribute("simple") || t(this, ie).getAttribute("theme") === "simple";
|
|
3329
|
-
}, "#isSimple"),
|
|
3325
|
+
}, "#isSimple"), Lr = new WeakMap(), Cr = new WeakMap(), Ye = new WeakMap(), Ei = new WeakMap(), Tr = new WeakMap(), kr = new WeakMap(), Ir = new WeakMap(), qr = new WeakMap(), Ri = new WeakMap(), Mr = new WeakMap(), h(Ns, "NineTableSheet"), E(Ns, "SCROLLBAR_SIZE", 16);
|
|
3330
3326
|
let _i = Ns;
|
|
3331
3327
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", _i);
|
|
3332
|
-
var et, Hr,
|
|
3328
|
+
var et, Hr, Li, Nr;
|
|
3333
3329
|
const Qo = class Qo {
|
|
3334
3330
|
constructor(r) {
|
|
3335
3331
|
d(this, et);
|
|
3336
3332
|
d(this, Hr, /* @__PURE__ */ h(() => {
|
|
3337
3333
|
t(this, Nr).call(this), new ResizeObserver((r) => {
|
|
3338
3334
|
for (let e of r)
|
|
3339
|
-
t(this, et).getAttribute("auto-height") === "true" && t(this,
|
|
3335
|
+
t(this, et).getAttribute("auto-height") === "true" && t(this, Li).call(this);
|
|
3340
3336
|
}).observe(t(this, et));
|
|
3341
3337
|
}, "#init"));
|
|
3342
|
-
d(this,
|
|
3338
|
+
d(this, Li, /* @__PURE__ */ h(() => {
|
|
3343
3339
|
const r = Array.from(t(this, et).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
3344
3340
|
if (r.length === 0) return;
|
|
3345
3341
|
const e = parseInt(t(this, et).getAttribute("max-display-row"), 10) || 10, s = Math.max(...r.map((u) => u.getRowHeight())), i = t(this, et).shadowRoot.querySelector("nine-table-toolbar"), n = t(this, et).shadowRoot.querySelector("nine-table-sheets-footer"), o = i ? i.getBoundingClientRect().height : 0, l = n ? n.getBoundingClientRect().height : 0, a = _i.SCROLLBAR_SIZE, c = e * s + o + l + a;
|
|
@@ -3347,10 +3343,22 @@ const Qo = class Qo {
|
|
|
3347
3343
|
}, "#applyAutoHeight"));
|
|
3348
3344
|
d(this, Nr, /* @__PURE__ */ h(() => {
|
|
3349
3345
|
const e = Array.from(t(this, et).children).filter((c) => c.tagName.toUpperCase() === "TABLE"), s = t(this, et).getAttribute("auto-height") === "true", i = e.length, n = e.map((c, u) => {
|
|
3350
|
-
const
|
|
3346
|
+
const f = u === 0 ? "active" : "", g = c.id || `sheet${u + 1}`, b = `<nine-table-sheet class="${f}" data-index="${u}" data-sheet-id="${g}" id="${g}"></nine-table-sheet>`, m = u < i - 1 ? `<nine-splitter class="h" data-split-index="${u}"></nine-splitter>` : "";
|
|
3351
3347
|
return b + m;
|
|
3352
|
-
}).join(""), o = [
|
|
3353
|
-
|
|
3348
|
+
}).join(""), o = [
|
|
3349
|
+
"layout",
|
|
3350
|
+
"nine-table-sheet",
|
|
3351
|
+
"nine-table-vscrollbar",
|
|
3352
|
+
"nine-table-hscrollbar",
|
|
3353
|
+
"table",
|
|
3354
|
+
"col-resize",
|
|
3355
|
+
"sorting",
|
|
3356
|
+
"fitering",
|
|
3357
|
+
"cell-select",
|
|
3358
|
+
"col-expand",
|
|
3359
|
+
"cell-combo"
|
|
3360
|
+
], l = o.map(
|
|
3361
|
+
(c) => `@import "https://cdn.jsdelivr.net/npm/@ninebone/table@0.1.43/dist/css/${c}.css";`
|
|
3354
3362
|
), a = [];
|
|
3355
3363
|
nine.cssPath && o.forEach((c) => {
|
|
3356
3364
|
a.push(`@import "${nine.cssPath}/${c}.css";`);
|
|
@@ -3376,7 +3384,7 @@ const Qo = class Qo {
|
|
|
3376
3384
|
<nine-table-footer></nine-table-footer>
|
|
3377
3385
|
`, t(this, et).shadowRoot.querySelectorAll("nine-table-sheet").forEach((c, u) => {
|
|
3378
3386
|
e[u] && setTimeout(() => {
|
|
3379
|
-
c.generate(e[u], u), s && t(this,
|
|
3387
|
+
c.generate(e[u], u), s && t(this, Li).call(this);
|
|
3380
3388
|
});
|
|
3381
3389
|
});
|
|
3382
3390
|
}, "#render"));
|
|
@@ -3386,7 +3394,7 @@ const Qo = class Qo {
|
|
|
3386
3394
|
r ? t(this, et).classList.add("loading") : t(this, et).classList.remove("loading");
|
|
3387
3395
|
}
|
|
3388
3396
|
};
|
|
3389
|
-
et = new WeakMap(), Hr = new WeakMap(),
|
|
3397
|
+
et = new WeakMap(), Hr = new WeakMap(), Li = new WeakMap(), Nr = new WeakMap(), h(Qo, "LayoutManager");
|
|
3390
3398
|
let eo = Qo;
|
|
3391
3399
|
var Ci, ms, Ti;
|
|
3392
3400
|
const tl = class tl {
|
|
@@ -3478,11 +3486,11 @@ const el = class el extends HTMLElement {
|
|
|
3478
3486
|
connectedCallback() {
|
|
3479
3487
|
setTimeout(() => {
|
|
3480
3488
|
var e;
|
|
3481
|
-
p(this, ys, (e = this.querySelectorAll("table")) == null ? void 0 : e.length), this.fields = new
|
|
3489
|
+
p(this, ys, (e = this.querySelectorAll("table")) == null ? void 0 : e.length), this.fields = new Rn(this), this.exprEngine = new so(this), A(this, $r, Kl).call(this), p(this, Ii, new eo(this)), t(this, Dr).call(this);
|
|
3482
3490
|
});
|
|
3483
3491
|
}
|
|
3484
3492
|
disconnectedCallback() {
|
|
3485
|
-
|
|
3493
|
+
S.log("NineTable disconnected.");
|
|
3486
3494
|
}
|
|
3487
3495
|
// π― κ³΅ν΅ λ°μ΄ν° & API μ κ·Όμ
|
|
3488
3496
|
get shadow() {
|
|
@@ -3578,9 +3586,9 @@ const sl = class sl extends io {
|
|
|
3578
3586
|
d(this, q);
|
|
3579
3587
|
d(this, Ze);
|
|
3580
3588
|
E(this, "getDisplayText", /* @__PURE__ */ h((e = "") => {
|
|
3581
|
-
if (
|
|
3589
|
+
if (S.log("================================="), !t(this, q) || !t(this, q).closest("tbody")) return e;
|
|
3582
3590
|
const s = t(this, ct).data;
|
|
3583
|
-
if (
|
|
3591
|
+
if (S.log("==============================", s), !s) return e;
|
|
3584
3592
|
const i = t(this, q).dataset.expr, n = t(this, q).dataset.bind, o = parseInt(t(this, q).dataset.row, 10);
|
|
3585
3593
|
if (i)
|
|
3586
3594
|
try {
|
|
@@ -3588,7 +3596,7 @@ const sl = class sl extends io {
|
|
|
3588
3596
|
} catch (l) {
|
|
3589
3597
|
return console.trace(l), e;
|
|
3590
3598
|
}
|
|
3591
|
-
if (
|
|
3599
|
+
if (S.log("==============================", n, this.value), n) {
|
|
3592
3600
|
const l = this.value;
|
|
3593
3601
|
return l ?? e;
|
|
3594
3602
|
}
|
|
@@ -3598,33 +3606,33 @@ const sl = class sl extends io {
|
|
|
3598
3606
|
* π― [μ κ·] κ·Έλ£Ή νμ μμ λ°μ΄ν° λͺ©λ‘(childRecords)μ κΈ°λ°μΌλ‘ ν©κ³/νκ· /κ°μ λ±μ μ²λ¦¬νλ λ©μλ
|
|
3599
3607
|
*/
|
|
3600
3608
|
E(this, "getGroupExprValue", /* @__PURE__ */ h((e, s, i, n) => {
|
|
3601
|
-
var o, l, a, c, u,
|
|
3609
|
+
var o, l, a, c, u, f;
|
|
3602
3610
|
if (!e) return "";
|
|
3603
3611
|
try {
|
|
3604
3612
|
i = parseInt(i, 10);
|
|
3605
|
-
const
|
|
3606
|
-
if (t(this, I) && typeof t(this, I)[
|
|
3607
|
-
return t(this, I)[
|
|
3608
|
-
const b =
|
|
3613
|
+
const g = e.replace("()", "").trim();
|
|
3614
|
+
if (t(this, I) && typeof t(this, I)[g] == "function")
|
|
3615
|
+
return t(this, I)[g].call(this, s, i, n);
|
|
3616
|
+
const b = g.match(/^(\w+)\s*\(\s*([\w\-]*)\s*\)/);
|
|
3609
3617
|
if (b) {
|
|
3610
|
-
const m = s[GROUP_IDX.CHILDREN], y = (l = (o = t(this, I)) == null ? void 0 : o.data) != null && l.getArray ? t(this, I).data.getArray() : [], x = m ? m.map((C) => y[C]).filter(Boolean) : [], [, w,
|
|
3618
|
+
const m = s[GROUP_IDX.CHILDREN], y = (l = (o = t(this, I)) == null ? void 0 : o.data) != null && l.getArray ? t(this, I).data.getArray() : [], x = m ? m.map((C) => y[C]).filter(Boolean) : [], [, w, v] = b, L = t(this, I);
|
|
3611
3619
|
switch (w.toLowerCase()) {
|
|
3612
3620
|
case "count":
|
|
3613
3621
|
return x.length;
|
|
3614
3622
|
case "sum": {
|
|
3615
|
-
const C = ((c = (a =
|
|
3623
|
+
const C = ((c = (a = L == null ? void 0 : L.fields) == null ? void 0 : a.indexOf) == null ? void 0 : c.call(a, v)) ?? -1;
|
|
3616
3624
|
return x.reduce(($, T) => {
|
|
3617
3625
|
var V;
|
|
3618
|
-
const H = C >= 0 ? (V = T.v) == null ? void 0 : V[C] : T[
|
|
3626
|
+
const H = C >= 0 ? (V = T.v) == null ? void 0 : V[C] : T[v];
|
|
3619
3627
|
return $ + (Number(H) || 0);
|
|
3620
3628
|
}, 0);
|
|
3621
3629
|
}
|
|
3622
3630
|
case "avg": {
|
|
3623
3631
|
if (x.length === 0) return 0;
|
|
3624
|
-
const C = ((
|
|
3632
|
+
const C = ((f = (u = L == null ? void 0 : L.fields) == null ? void 0 : u.indexOf) == null ? void 0 : f.call(u, v)) ?? -1;
|
|
3625
3633
|
return x.reduce((T, H) => {
|
|
3626
3634
|
var Q;
|
|
3627
|
-
const V = C >= 0 ? (Q = H.v) == null ? void 0 : Q[C] : H[
|
|
3635
|
+
const V = C >= 0 ? (Q = H.v) == null ? void 0 : Q[C] : H[v];
|
|
3628
3636
|
return T + (Number(V) || 0);
|
|
3629
3637
|
}, 0) / x.length;
|
|
3630
3638
|
}
|
|
@@ -3661,8 +3669,8 @@ const sl = class sl extends io {
|
|
|
3661
3669
|
`), vl.set("grp_" + e, m)), m(s, i, n, t(this, I));
|
|
3662
3670
|
}
|
|
3663
3671
|
return e;
|
|
3664
|
-
} catch (
|
|
3665
|
-
return console.error("Group expr evaluation error:", e,
|
|
3672
|
+
} catch (g) {
|
|
3673
|
+
return console.error("Group expr evaluation error:", e, g), e;
|
|
3666
3674
|
}
|
|
3667
3675
|
}, "getGroupExprValue"));
|
|
3668
3676
|
}
|
|
@@ -3696,8 +3704,8 @@ const sl = class sl extends io {
|
|
|
3696
3704
|
const o = this.data, l = parseInt(t(this, q).dataset.row, 10);
|
|
3697
3705
|
if (n && t(this, I)) {
|
|
3698
3706
|
n = n.replace("()", "");
|
|
3699
|
-
const u = n.match(/^(\w+)\s*\(/),
|
|
3700
|
-
typeof t(this, I)[
|
|
3707
|
+
const u = n.match(/^(\w+)\s*\(/), f = (u == null ? void 0 : u[1]) || n;
|
|
3708
|
+
typeof t(this, I)[f] == "function" ? t(this, I)[f].call(t(this, I), o, l, t(this, q)) : typeof t(this, I).exprFunction == "function" && t(this, I).exprFunction(n).call(this, o, l);
|
|
3701
3709
|
}
|
|
3702
3710
|
});
|
|
3703
3711
|
});
|
|
@@ -3878,11 +3886,11 @@ const rl = class rl extends le {
|
|
|
3878
3886
|
Je = new WeakMap(), Fr = new WeakMap(), Wr = new WeakMap(), h(rl, "CellInputText");
|
|
3879
3887
|
let ro = rl;
|
|
3880
3888
|
customElements.get("cell-input") || customElements.define("cell-input", ro);
|
|
3881
|
-
var
|
|
3889
|
+
var Tt, Or, zr, Br;
|
|
3882
3890
|
const nl = class nl extends le {
|
|
3883
3891
|
constructor() {
|
|
3884
3892
|
super();
|
|
3885
|
-
d(this,
|
|
3893
|
+
d(this, Tt);
|
|
3886
3894
|
d(this, Or, /* @__PURE__ */ h(() => {
|
|
3887
3895
|
for (var e = [], s = 0; s < this.attributes.length; s++)
|
|
3888
3896
|
["type", "maxlength", "maxbyte", "min", "max", "step", "scale", "text-align"].includes(this.attributes[s].name);
|
|
@@ -3931,10 +3939,10 @@ const nl = class nl extends le {
|
|
|
3931
3939
|
}, "#renderer"));
|
|
3932
3940
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
3933
3941
|
const e = super.refresh();
|
|
3934
|
-
return t(this,
|
|
3942
|
+
return t(this, Tt) && (t(this, Tt).value = e ?? "", t(this, zr).call(this, t(this, Tt).value)), e;
|
|
3935
3943
|
}, "refresh"));
|
|
3936
3944
|
d(this, zr, /* @__PURE__ */ h((e) => {
|
|
3937
|
-
if (t(this,
|
|
3945
|
+
if (t(this, Tt) && (super.cell.classList.remove("invalid"), e !== "" && e !== null && e !== void 0)) {
|
|
3938
3946
|
const s = Number(e);
|
|
3939
3947
|
if (isNaN(s) || super.attr.max !== null && super.attr.max !== void 0 && s > Number(super.attr.max) || super.attr.min !== null && super.attr.min !== void 0 && s < Number(super.attr.min))
|
|
3940
3948
|
super.cell.classList.add("invalid");
|
|
@@ -3976,14 +3984,14 @@ const nl = class nl extends le {
|
|
|
3976
3984
|
this.applyBaseStyle();
|
|
3977
3985
|
}
|
|
3978
3986
|
connectedCallback() {
|
|
3979
|
-
t(this, Or).call(this), super.connectedCallback(), p(this,
|
|
3987
|
+
t(this, Or).call(this), super.connectedCallback(), p(this, Tt, this.querySelector("input")), t(this, Tt) && (t(this, Tt).addEventListener("keydown", t(this, Br)), t(this, Tt).addEventListener("input", (e) => {
|
|
3980
3988
|
this.value = e.target.value, super.sheet.rowManager.refresh(!0);
|
|
3981
|
-
}), t(this,
|
|
3989
|
+
}), t(this, Tt).addEventListener("change", (e) => {
|
|
3982
3990
|
this.value = e.target.value, super.sheet.rowManager.refresh(!0);
|
|
3983
3991
|
}));
|
|
3984
3992
|
}
|
|
3985
3993
|
};
|
|
3986
|
-
|
|
3994
|
+
Tt = new WeakMap(), Or = new WeakMap(), zr = new WeakMap(), Br = new WeakMap(), h(nl, "CellInputNumber");
|
|
3987
3995
|
let no = nl;
|
|
3988
3996
|
customElements.get("cell-input-number") || customElements.define("cell-input-number", no);
|
|
3989
3997
|
var yt, xs, Vr, ws, Pr;
|
|
@@ -4255,15 +4263,15 @@ const ll = class ll extends le {
|
|
|
4255
4263
|
switch (t(this, re)) {
|
|
4256
4264
|
case "date":
|
|
4257
4265
|
case "datetime-local":
|
|
4258
|
-
const
|
|
4259
|
-
if (isNaN(
|
|
4266
|
+
const f = Number(e.substr(0, 4)), g = Number(e.substr(5, 2)), b = Number(e.substr(8, 2));
|
|
4267
|
+
if (isNaN(f) || isNaN(g) || isNaN(b))
|
|
4260
4268
|
s = !1;
|
|
4261
|
-
else if (
|
|
4269
|
+
else if (g < 1 || g > 12 || b < 1 || b > 31)
|
|
4262
4270
|
s = !1;
|
|
4263
|
-
else if ([4, 6, 9, 11].includes(
|
|
4271
|
+
else if ([4, 6, 9, 11].includes(g) && b == 31)
|
|
4264
4272
|
s = !1;
|
|
4265
|
-
else if (
|
|
4266
|
-
let m =
|
|
4273
|
+
else if (g == 2) {
|
|
4274
|
+
let m = f % 4 == 0 && (f % 100 != 0 || f % 400 == 0);
|
|
4267
4275
|
(b > 29 || b == 29 && !m) && (s = !1);
|
|
4268
4276
|
}
|
|
4269
4277
|
break;
|
|
@@ -4456,14 +4464,14 @@ const al = class al extends le {
|
|
|
4456
4464
|
ne = new WeakMap(), Ss = new WeakMap(), Qe = new WeakMap(), As = new WeakMap(), Es = new WeakMap(), Ur = new WeakMap(), Gr = new WeakMap(), jr = new WeakMap(), h(al, "CellCheckbox");
|
|
4457
4465
|
let ao = al;
|
|
4458
4466
|
customElements.get("cell-checkbox") || customElements.define("cell-checkbox", ao);
|
|
4459
|
-
var ts,
|
|
4467
|
+
var ts, Dt, es, Rs, Co, To, ko, Io, Kr, Mi, Yr, Zr;
|
|
4460
4468
|
const cl = class cl extends le {
|
|
4461
4469
|
constructor() {
|
|
4462
4470
|
super();
|
|
4463
4471
|
d(this, ts);
|
|
4464
|
-
d(this,
|
|
4472
|
+
d(this, Dt, []);
|
|
4465
4473
|
d(this, es);
|
|
4466
|
-
d(this,
|
|
4474
|
+
d(this, Rs);
|
|
4467
4475
|
d(this, Co);
|
|
4468
4476
|
d(this, To);
|
|
4469
4477
|
d(this, ko);
|
|
@@ -4483,12 +4491,12 @@ const cl = class cl extends le {
|
|
|
4483
4491
|
var s;
|
|
4484
4492
|
if (!super.sheet || !super.cell) return;
|
|
4485
4493
|
const e = (s = super.cell) == null ? void 0 : s.getAttribute("data-source");
|
|
4486
|
-
if (e && (p(this,
|
|
4487
|
-
|
|
4488
|
-
}, 300), t(this, ts).replaceChildren(), t(this,
|
|
4494
|
+
if (e && (p(this, Dt, super.getExprValue(e, super.tr.data, super.tr.dataset.row)), S.log("=============================================="), S.log(this.sheet, t(this, Dt)), setTimeout(() => {
|
|
4495
|
+
S.log("1111");
|
|
4496
|
+
}, 300), t(this, ts).replaceChildren(), t(this, Dt) && Array.isArray(t(this, Dt)))) {
|
|
4489
4497
|
const i = document.createDocumentFragment();
|
|
4490
|
-
t(this,
|
|
4491
|
-
const o = n[t(this, es)] !== void 0 ? n[t(this, es)] : "", l = n[t(this,
|
|
4498
|
+
t(this, Dt).forEach((n) => {
|
|
4499
|
+
const o = n[t(this, es)] !== void 0 ? n[t(this, es)] : "", l = n[t(this, Rs)] !== void 0 ? n[t(this, Rs)] : "", a = document.createElement("label"), c = document.createElement("input");
|
|
4492
4500
|
c.type = "radio", c.value = o;
|
|
4493
4501
|
const u = document.createElement("span");
|
|
4494
4502
|
u.textContent = l, a.appendChild(c), a.appendChild(u), i.appendChild(a);
|
|
@@ -4628,82 +4636,82 @@ const cl = class cl extends le {
|
|
|
4628
4636
|
}), t(this, Zr).call(this)), e;
|
|
4629
4637
|
}, "refresh"));
|
|
4630
4638
|
d(this, Zr, /* @__PURE__ */ h(() => {
|
|
4631
|
-
if (!super.cell || (super.cell.classList.remove("invalid"), this.value === null || this.value === void 0 || this.value === "" || !Array.isArray(t(this,
|
|
4639
|
+
if (!super.cell || (super.cell.classList.remove("invalid"), this.value === null || this.value === void 0 || this.value === "" || !Array.isArray(t(this, Dt))))
|
|
4632
4640
|
return;
|
|
4633
|
-
t(this,
|
|
4641
|
+
t(this, Dt).findIndex((s) => this.value === s[t(this, es)]) < 0 && super.cell.classList.add("invalid");
|
|
4634
4642
|
}, "#validateInput"));
|
|
4635
4643
|
this.applyBaseStyle();
|
|
4636
4644
|
}
|
|
4637
4645
|
connectedCallback() {
|
|
4638
|
-
p(this, es, this.closest("th,td").getAttribute("key-name") || "k"), p(this,
|
|
4646
|
+
p(this, es, this.closest("th,td").getAttribute("key-name") || "k"), p(this, Rs, this.closest("th,td").getAttribute("value-name") || "v"), t(this, Yr).call(this), super.connectedCallback(), t(this, Mi).call(this), t(this, Kr).call(this);
|
|
4639
4647
|
}
|
|
4640
4648
|
get dataSource() {
|
|
4641
|
-
return t(this,
|
|
4649
|
+
return t(this, Dt);
|
|
4642
4650
|
}
|
|
4643
4651
|
};
|
|
4644
|
-
ts = new WeakMap(),
|
|
4652
|
+
ts = new WeakMap(), Dt = new WeakMap(), es = new WeakMap(), Rs = new WeakMap(), Co = new WeakMap(), To = new WeakMap(), ko = new WeakMap(), Io = new WeakMap(), Kr = new WeakMap(), Mi = new WeakMap(), Yr = new WeakMap(), Zr = new WeakMap(), h(cl, "CellRadio");
|
|
4645
4653
|
let co = cl;
|
|
4646
4654
|
customElements.get("cell-radio") || customElements.define("cell-radio", co);
|
|
4647
|
-
var nt, Jr, Qr,
|
|
4655
|
+
var nt, Jr, Qr, Ls, tn, en, sn, rn, nn, on, ln;
|
|
4648
4656
|
const hl = class hl extends HTMLElement {
|
|
4649
4657
|
constructor() {
|
|
4650
4658
|
super();
|
|
4651
4659
|
d(this, nt);
|
|
4652
4660
|
d(this, Jr);
|
|
4653
4661
|
d(this, Qr);
|
|
4654
|
-
d(this,
|
|
4662
|
+
d(this, Ls, !1);
|
|
4655
4663
|
d(this, tn, /* @__PURE__ */ h((e, s, i, n, o) => {
|
|
4656
4664
|
const l = this.querySelector("nine-table-simple");
|
|
4657
4665
|
if (!l || !e || e.length === 0) return;
|
|
4658
4666
|
const a = t(this, nt).getAttribute("items");
|
|
4659
4667
|
let c = [];
|
|
4660
|
-
a ? c = a.split(",").map((
|
|
4668
|
+
a ? c = a.split(",").map((g) => g.trim()) : c = [i].filter(Boolean);
|
|
4661
4669
|
const u = c.length;
|
|
4662
|
-
l.shadowRoot.querySelector(".ng-container-left").style.display = n ? "" : "none", l.shadowRoot.querySelectorAll("table colgroup col, tbody td").forEach((
|
|
4663
|
-
|
|
4664
|
-
const m = parseInt(
|
|
4665
|
-
m >= 2 && (
|
|
4670
|
+
l.shadowRoot.querySelector(".ng-container-left").style.display = n ? "" : "none", l.shadowRoot.querySelectorAll("table colgroup col, tbody td").forEach((g, b) => {
|
|
4671
|
+
S.log(g);
|
|
4672
|
+
const m = parseInt(g.dataset.col, 10);
|
|
4673
|
+
m >= 2 && (g.style.display = m - 2 >= u ? "none" : "");
|
|
4666
4674
|
});
|
|
4667
|
-
const
|
|
4675
|
+
const f = e.map((g) => {
|
|
4668
4676
|
const b = {
|
|
4669
4677
|
CHK: "N",
|
|
4670
|
-
k: s &&
|
|
4678
|
+
k: s && g[s] !== void 0 ? g[s] : g[0] !== void 0 ? g[0] : ""
|
|
4671
4679
|
};
|
|
4672
4680
|
return c.forEach((m, y) => {
|
|
4673
|
-
b[`tmp${y + 1}`] =
|
|
4681
|
+
b[`tmp${y + 1}`] = g[m] !== void 0 ? g[m] : g[y] !== void 0 ? g[y] : "";
|
|
4674
4682
|
}), b;
|
|
4675
4683
|
});
|
|
4676
|
-
if (l.data.set(
|
|
4677
|
-
const
|
|
4684
|
+
if (l.data.set(f), n && t(this, nt).value) {
|
|
4685
|
+
const g = String(t(this, nt).value).split(o || ",");
|
|
4678
4686
|
l.data.getValidData().forEach((b) => {
|
|
4679
|
-
|
|
4687
|
+
g.includes(String(b.v[1])) && (b.v[0] = "Y");
|
|
4680
4688
|
}), l.refreshData();
|
|
4681
4689
|
}
|
|
4682
4690
|
}, "#initData"));
|
|
4683
4691
|
E(this, "open", /* @__PURE__ */ h((e, s, i, n, o, l) => {
|
|
4684
|
-
p(this, nt, e), p(this, Jr, i), p(this, Qr, n), p(this,
|
|
4692
|
+
p(this, nt, e), p(this, Jr, i), p(this, Qr, n), p(this, Ls, !0), S.log(/* @__PURE__ */ new Date()), this.classList.add("active");
|
|
4685
4693
|
const a = this.querySelector("nine-table-simple");
|
|
4686
4694
|
if (!a || !s) return;
|
|
4687
4695
|
this.querySelector(".search-input").value = "", this.querySelector("#chkAll").checked = !0, s.length > 10 ? this.classList.add("expand") : this.classList.remove("expand"), o ? this.classList.add("multi") : this.classList.remove("multi");
|
|
4688
4696
|
const c = e.closest("nine-table-sheet"), u = e.querySelector(".btn1");
|
|
4689
4697
|
if (!u || !c) return;
|
|
4690
|
-
const
|
|
4691
|
-
let b =
|
|
4698
|
+
const f = u.getBoundingClientRect(), g = c.getBoundingClientRect();
|
|
4699
|
+
let b = f.left - g.left, m = f.bottom - g.top + 2;
|
|
4692
4700
|
const y = this.offsetWidth || 250, x = this.offsetHeight || 250;
|
|
4693
|
-
if (b + y >
|
|
4694
|
-
const w =
|
|
4695
|
-
w >= 0 ? m = w : m = Math.max(0,
|
|
4701
|
+
if (b + y > g.width && (b = Math.max(0, g.width - y - 5)), b < 0 && (b = 5), m + x > g.height) {
|
|
4702
|
+
const w = f.top - g.top - x - 2;
|
|
4703
|
+
w >= 0 ? m = w : m = Math.max(0, g.height - x - 5);
|
|
4696
4704
|
}
|
|
4697
|
-
this.style.left = `${b}px`, this.style.top = `${m}px`,
|
|
4698
|
-
|
|
4705
|
+
this.style.left = `${b}px`, this.style.top = `${m}px`, S.log(/* @__PURE__ */ new Date()), setTimeout(() => {
|
|
4706
|
+
S.log(/* @__PURE__ */ new Date()), t(this, tn).call(this, s, i, n, o, l), S.log(/* @__PURE__ */ new Date());
|
|
4699
4707
|
const w = a.shadowRoot.querySelector(".ng-container-body table tbody.body");
|
|
4700
|
-
w.__hasClickEvent || (w.addEventListener("mousedown", (
|
|
4701
|
-
|
|
4702
|
-
}), w.__hasClickEvent = !0),
|
|
4708
|
+
w.__hasClickEvent || (w.addEventListener("mousedown", (v) => {
|
|
4709
|
+
S.log("==========================================", v.target), v.target.closest("tr") && (S.log("==========================================", o), o || t(this, en).call(this, v));
|
|
4710
|
+
}), w.__hasClickEvent = !0), S.log(/* @__PURE__ */ new Date());
|
|
4703
4711
|
}, 100);
|
|
4704
4712
|
}, "open"));
|
|
4705
4713
|
E(this, "close", /* @__PURE__ */ h(() => {
|
|
4706
|
-
this.classList.remove("active"), p(this,
|
|
4714
|
+
this.classList.remove("active"), p(this, Ls, !1), t(this, nt) && t(this, nt).cell && t(this, nt).cell.focus();
|
|
4707
4715
|
}, "close"));
|
|
4708
4716
|
d(this, en, /* @__PURE__ */ h((e) => {
|
|
4709
4717
|
const s = e.target.closest("nine-table-sheet"), i = e.target.closest("tr"), n = parseInt(i.dataset.row, 10), o = s.view.get(n);
|
|
@@ -4852,34 +4860,34 @@ const hl = class hl extends HTMLElement {
|
|
|
4852
4860
|
t(this, ln).call(this), t(this, on).call(this);
|
|
4853
4861
|
}
|
|
4854
4862
|
get isOpen() {
|
|
4855
|
-
return t(this,
|
|
4863
|
+
return t(this, Ls);
|
|
4856
4864
|
}
|
|
4857
4865
|
get targetCell() {
|
|
4858
4866
|
return t(this, nt);
|
|
4859
4867
|
}
|
|
4860
4868
|
};
|
|
4861
|
-
nt = new WeakMap(), Jr = new WeakMap(), Qr = new WeakMap(),
|
|
4869
|
+
nt = new WeakMap(), Jr = new WeakMap(), Qr = new WeakMap(), Ls = new WeakMap(), tn = new WeakMap(), en = new WeakMap(), sn = new WeakMap(), rn = new WeakMap(), nn = new WeakMap(), on = new WeakMap(), ln = new WeakMap(), h(hl, "CellComboPanel");
|
|
4862
4870
|
let ho = hl;
|
|
4863
4871
|
customElements.get("cell-combo-panel") || customElements.define("cell-combo-panel", ho);
|
|
4864
|
-
var Cs,
|
|
4872
|
+
var Cs, $t, ve, ss, is, Se, kt, Hi, an, Ni, cn, hn, dn;
|
|
4865
4873
|
const dl = class dl extends le {
|
|
4866
4874
|
constructor() {
|
|
4867
4875
|
super();
|
|
4868
4876
|
d(this, Cs);
|
|
4869
|
-
d(this,
|
|
4877
|
+
d(this, $t, []);
|
|
4870
4878
|
d(this, ve);
|
|
4871
4879
|
d(this, ss);
|
|
4872
4880
|
d(this, is);
|
|
4873
4881
|
d(this, Se);
|
|
4874
|
-
d(this,
|
|
4882
|
+
d(this, kt);
|
|
4875
4883
|
E(this, "rerenderer", /* @__PURE__ */ h(() => {
|
|
4876
|
-
|
|
4884
|
+
S.log("rerenderer"), t(this, Hi).call(this), this.refresh();
|
|
4877
4885
|
}, "rerenderer"));
|
|
4878
4886
|
d(this, Hi, /* @__PURE__ */ h(() => {
|
|
4879
4887
|
var s;
|
|
4880
4888
|
if (!super.sheet || !super.cell) return;
|
|
4881
4889
|
const e = (s = super.cell) == null ? void 0 : s.getAttribute("data-source");
|
|
4882
|
-
e && p(this,
|
|
4890
|
+
e && p(this, $t, super.getExprValue(e, super.tr.data, super.tr.dataset.row));
|
|
4883
4891
|
}, "#initData"));
|
|
4884
4892
|
d(this, an, /* @__PURE__ */ h(() => {
|
|
4885
4893
|
this.addEventListener("keydown", (e) => {
|
|
@@ -4891,7 +4899,7 @@ const dl = class dl extends le {
|
|
|
4891
4899
|
});
|
|
4892
4900
|
}, "#initEvent"));
|
|
4893
4901
|
d(this, Ni, /* @__PURE__ */ h(() => {
|
|
4894
|
-
|
|
4902
|
+
S.log(/* @__PURE__ */ new Date()), t(this, kt) || (p(this, kt, super.sheet.querySelector("cell-combo-panel")), t(this, kt) || (p(this, kt, document.createElement("cell-combo-panel")), super.sheet.appendChild(t(this, kt)))), S.log(/* @__PURE__ */ new Date()), t(this, kt).isOpen && t(this, kt).targetCell === this ? t(this, kt).close() : t(this, kt).open(this, t(this, $t), t(this, ve), t(this, ss), t(this, is), t(this, Se)), S.log(/* @__PURE__ */ new Date());
|
|
4895
4903
|
}, "#togglePanel"));
|
|
4896
4904
|
d(this, cn, /* @__PURE__ */ h(() => {
|
|
4897
4905
|
this.innerHTML = `
|
|
@@ -4965,21 +4973,21 @@ const dl = class dl extends le {
|
|
|
4965
4973
|
return t(this, Cs) && (t(this, Cs).textContent = t(this, hn).call(this) || "Select", t(this, dn).call(this)), e;
|
|
4966
4974
|
}, "refresh"));
|
|
4967
4975
|
d(this, hn, /* @__PURE__ */ h(() => {
|
|
4968
|
-
if (!this.value || !Array.isArray(t(this,
|
|
4976
|
+
if (!this.value || !Array.isArray(t(this, $t))) return "";
|
|
4969
4977
|
if (t(this, is)) {
|
|
4970
4978
|
const e = String(this.value).split(t(this, Se));
|
|
4971
|
-
return t(this,
|
|
4979
|
+
return t(this, $t).filter((s) => e.includes(String(s[t(this, ve)]))).map((s) => s[t(this, ss)]).join(t(this, Se));
|
|
4972
4980
|
} else {
|
|
4973
|
-
const e = t(this,
|
|
4981
|
+
const e = t(this, $t).find((s) => String(s[t(this, ve)]) === String(this.value));
|
|
4974
4982
|
return e ? e[t(this, ss)] : this.value;
|
|
4975
4983
|
}
|
|
4976
4984
|
}, "#getDisplayText"));
|
|
4977
4985
|
d(this, dn, /* @__PURE__ */ h(() => {
|
|
4978
|
-
if (!super.cell || (super.cell.classList.remove("invalid"), this.value === null || this.value === void 0 || this.value === "" || !Array.isArray(t(this,
|
|
4986
|
+
if (!super.cell || (super.cell.classList.remove("invalid"), this.value === null || this.value === void 0 || this.value === "" || !Array.isArray(t(this, $t))))
|
|
4979
4987
|
return;
|
|
4980
4988
|
const e = t(this, is) ? String(this.value).split(t(this, Se)) : [this.value];
|
|
4981
4989
|
for (const s of e)
|
|
4982
|
-
if (t(this,
|
|
4990
|
+
if (t(this, $t).findIndex((n) => String(s) === String(n[t(this, ve)])) < 0) {
|
|
4983
4991
|
super.cell.classList.add("invalid");
|
|
4984
4992
|
break;
|
|
4985
4993
|
}
|
|
@@ -4990,10 +4998,10 @@ const dl = class dl extends le {
|
|
|
4990
4998
|
t(this, cn).call(this), super.connectedCallback(), p(this, ve, super.cell.getAttribute("key-name") || "k"), p(this, ss, super.cell.getAttribute("value-name") || "v"), p(this, is, super.cell.getAttribute("multi") === "true"), p(this, Se, super.cell.getAttribute("multi-separator") || ","), t(this, Hi).call(this), t(this, an).call(this);
|
|
4991
4999
|
}
|
|
4992
5000
|
get dataSource() {
|
|
4993
|
-
return t(this,
|
|
5001
|
+
return t(this, $t);
|
|
4994
5002
|
}
|
|
4995
5003
|
};
|
|
4996
|
-
Cs = new WeakMap(),
|
|
5004
|
+
Cs = new WeakMap(), $t = new WeakMap(), ve = new WeakMap(), ss = new WeakMap(), is = new WeakMap(), Se = new WeakMap(), kt = new WeakMap(), Hi = new WeakMap(), an = new WeakMap(), Ni = new WeakMap(), cn = new WeakMap(), hn = new WeakMap(), dn = new WeakMap(), h(dl, "CellCombo");
|
|
4997
5005
|
let uo = dl;
|
|
4998
5006
|
customElements.get("cell-combo") || customElements.define("cell-combo", uo);
|
|
4999
5007
|
var Ts, un;
|
|
@@ -5339,13 +5347,13 @@ Vi = /* @__PURE__ */ h(function(e) {
|
|
|
5339
5347
|
const l = A(this, U, Yl).call(this, this, e);
|
|
5340
5348
|
l.length > 0 && o.push(...l);
|
|
5341
5349
|
const a = A(this, U, yo).call(this, i), c = (a == null ? void 0 : a.getFixState(i, e)) ?? "none", u = s && ((a == null ? void 0 : a.canFixColumn(i, e)) ?? !1);
|
|
5342
|
-
let
|
|
5343
|
-
c === "left" || c === "right" ?
|
|
5350
|
+
let f = null;
|
|
5351
|
+
c === "left" || c === "right" ? f = {
|
|
5344
5352
|
menuId: "unfix-column",
|
|
5345
5353
|
name: "Unfix Column",
|
|
5346
5354
|
className: "ng-menu-unfix-col",
|
|
5347
5355
|
disabled: !s
|
|
5348
|
-
} :
|
|
5356
|
+
} : f = {
|
|
5349
5357
|
menuId: "fix-column",
|
|
5350
5358
|
name: "Fix Column",
|
|
5351
5359
|
className: "ng-menu-fix-col",
|
|
@@ -5358,7 +5366,7 @@ Vi = /* @__PURE__ */ h(function(e) {
|
|
|
5358
5366
|
className: "ng-menu-sort",
|
|
5359
5367
|
disabled: !s
|
|
5360
5368
|
},
|
|
5361
|
-
|
|
5369
|
+
f,
|
|
5362
5370
|
{ type: "separator" },
|
|
5363
5371
|
{ menuId: "filtering", name: "Filtering", className: "ng-menu-filtering" },
|
|
5364
5372
|
{ menuId: "maximize", name: "Maximize", className: "maximize" },
|
|
@@ -5382,10 +5390,10 @@ Vi = /* @__PURE__ */ h(function(e) {
|
|
|
5382
5390
|
]
|
|
5383
5391
|
}
|
|
5384
5392
|
);
|
|
5385
|
-
const
|
|
5393
|
+
const g = [];
|
|
5386
5394
|
return o.forEach((b) => {
|
|
5387
|
-
b.type === "separator" && (
|
|
5388
|
-
}),
|
|
5395
|
+
b.type === "separator" && (g.length === 0 || g[g.length - 1].type === "separator") || g.push(b);
|
|
5396
|
+
}), g.length > 0 && g[g.length - 1].type === "separator" && g.pop(), g;
|
|
5389
5397
|
}, "#buildMenuItems"), /**
|
|
5390
5398
|
* π― λ©λ΄ νλͺ© νμ±ν μ²΄ν¬ νμ(β) λκΈ°ν
|
|
5391
5399
|
*/
|
|
@@ -5399,7 +5407,7 @@ Jl = /* @__PURE__ */ h(function(e) {
|
|
|
5399
5407
|
const n = t(this, J).getAttribute("show-title-bar") === "true";
|
|
5400
5408
|
t(this, wt).toggleItemState("show-title-bar", "on", n);
|
|
5401
5409
|
}, "#syncMenuStates"), Ql = /* @__PURE__ */ h(function(e, s, i) {
|
|
5402
|
-
var c, u,
|
|
5410
|
+
var c, u, f;
|
|
5403
5411
|
const n = e.menuId, o = new CustomEvent("menu-click", {
|
|
5404
5412
|
detail: { menuId: n, targetCell: s, targetTable: i, originalEvent: e },
|
|
5405
5413
|
bubbles: !0,
|
|
@@ -5410,14 +5418,14 @@ Jl = /* @__PURE__ */ h(function(e) {
|
|
|
5410
5418
|
switch (n) {
|
|
5411
5419
|
case "fix-column":
|
|
5412
5420
|
case "unfix-column":
|
|
5413
|
-
const
|
|
5414
|
-
|
|
5421
|
+
const g = A(this, U, yo).call(this, s);
|
|
5422
|
+
g == null || g.executeFixToggle(n, s);
|
|
5415
5423
|
break;
|
|
5416
5424
|
case "sort":
|
|
5417
5425
|
isNaN(l) || (u = (c = a.sorting) == null ? void 0 : c.handleSortFromMenu) == null || u.call(c, l, s);
|
|
5418
5426
|
break;
|
|
5419
5427
|
case "filtering":
|
|
5420
|
-
(
|
|
5428
|
+
(f = a == null ? void 0 : a.filtering) == null || f.toggle();
|
|
5421
5429
|
break;
|
|
5422
5430
|
case "auto-fit-col":
|
|
5423
5431
|
t(this, J).setAttribute("auto-fit-col", t(this, J).getAttribute("auto-fit-col") === "true" ? "false" : "true");
|
|
@@ -5535,8 +5543,8 @@ const ml = class ml extends HTMLElement {
|
|
|
5535
5543
|
let c = o - a;
|
|
5536
5544
|
c < 0 && (c = n.left);
|
|
5537
5545
|
const u = l.getBoundingClientRect().height;
|
|
5538
|
-
let
|
|
5539
|
-
s + u > window.innerHeight && (
|
|
5546
|
+
let f = s;
|
|
5547
|
+
s + u > window.innerHeight && (f = s - u), this.style.left = `${c}px`, this.style.top = `${f}px`;
|
|
5540
5548
|
});
|
|
5541
5549
|
} else
|
|
5542
5550
|
this.style.left = `${e}px`, this.style.top = `${s}px`, requestAnimationFrame(() => {
|