@ninebone/table 0.0.697 → 0.0.698
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nine-table.js +26 -26
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +3 -3
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -23,12 +23,12 @@ const We = class We extends as.constructor {
|
|
|
23
23
|
h(We, "Trace");
|
|
24
24
|
let fe = We;
|
|
25
25
|
const T = new fe();
|
|
26
|
-
var B,
|
|
26
|
+
var B, j, S, K, Z, G, Ot, J, Bt;
|
|
27
27
|
const Oe = class Oe extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
d(this, B);
|
|
31
|
-
d(this,
|
|
31
|
+
d(this, j, !1);
|
|
32
32
|
d(this, S);
|
|
33
33
|
d(this, K);
|
|
34
34
|
d(this, Z);
|
|
@@ -41,7 +41,7 @@ const Oe = class Oe extends HTMLElement {
|
|
|
41
41
|
})), t(this, G).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
44
|
-
if (!t(this, B) || !t(this, S) || t(this,
|
|
44
|
+
if (!t(this, B) || !t(this, S) || t(this, j)) return;
|
|
45
45
|
const e = t(this, S).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
47
|
const r = t(this, S).track, i = t(this, S).thumb, o = t(this, B).querySelector(".ng-container-bottom"), a = e.clientWidth, c = s.scrollWidth;
|
|
@@ -99,13 +99,13 @@ const Oe = class Oe extends HTMLElement {
|
|
|
99
99
|
t(this, J).call(this, r.clientX - i.left - o / 2);
|
|
100
100
|
}), t(this, S).thumb.addEventListener("mousedown", (r) => {
|
|
101
101
|
if (r.button !== 0) return;
|
|
102
|
-
r.stopPropagation(), r.preventDefault(), p(this,
|
|
102
|
+
r.stopPropagation(), r.preventDefault(), p(this, j, !0), this.shiftX = r.clientX - t(this, S).thumb.getBoundingClientRect().left;
|
|
103
103
|
const i = /* @__PURE__ */ h((a) => {
|
|
104
|
-
if (!t(this,
|
|
104
|
+
if (!t(this, j)) return;
|
|
105
105
|
const c = t(this, S).track.getBoundingClientRect();
|
|
106
106
|
t(this, J).call(this, a.clientX - c.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
108
|
-
p(this,
|
|
108
|
+
p(this, j, !1), s(), document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", o), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
110
|
document.addEventListener("mousemove", i), document.addEventListener("mouseup", o);
|
|
111
111
|
});
|
|
@@ -189,7 +189,7 @@ const Oe = class Oe extends HTMLElement {
|
|
|
189
189
|
left: this.querySelector(".ng-scroll-left"),
|
|
190
190
|
right: this.querySelector(".ng-scroll-right")
|
|
191
191
|
}), s.addEventListener("scroll", () => {
|
|
192
|
-
t(this,
|
|
192
|
+
t(this, j) || this.refresh();
|
|
193
193
|
}), t(this, Bt).call(this), t(this, Ot).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
195
195
|
e();
|
|
@@ -198,7 +198,7 @@ const Oe = class Oe extends HTMLElement {
|
|
|
198
198
|
t(this, G) && t(this, G).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
B = new WeakMap(),
|
|
201
|
+
B = new WeakMap(), j = new WeakMap(), S = new WeakMap(), K = new WeakMap(), Z = new WeakMap(), G = new WeakMap(), Ot = new WeakMap(), J = new WeakMap(), Bt = new WeakMap(), h(Oe, "NineTableHScrollBar");
|
|
202
202
|
let ue = Oe;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ue);
|
|
204
204
|
var Q, tt, ct, k, wt, St, Pt;
|
|
@@ -353,7 +353,7 @@ const Be = class Be extends HTMLElement {
|
|
|
353
353
|
Q = new WeakMap(), tt = new WeakMap(), ct = new WeakMap(), k = new WeakMap(), wt = new WeakMap(), St = new WeakMap(), Pt = new WeakMap(), h(Be, "NineTableVScrollBar");
|
|
354
354
|
let ge = Be;
|
|
355
355
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", ge);
|
|
356
|
-
var D, w, et, P, _,
|
|
356
|
+
var D, w, et, P, _, V, st, Et, Ce, Le, Dt, Ft, At, Rt, qt, jt, Vt, Tt, He, ht, kt, Yt;
|
|
357
357
|
const Pe = class Pe {
|
|
358
358
|
constructor(n) {
|
|
359
359
|
d(this, D);
|
|
@@ -361,7 +361,7 @@ const Pe = class Pe {
|
|
|
361
361
|
d(this, et);
|
|
362
362
|
d(this, P, /* @__PURE__ */ new Map());
|
|
363
363
|
d(this, _, null);
|
|
364
|
-
d(this,
|
|
364
|
+
d(this, V, null);
|
|
365
365
|
d(this, st, 0);
|
|
366
366
|
d(this, Et, 40);
|
|
367
367
|
d(this, Ce, !1);
|
|
@@ -491,7 +491,7 @@ const Pe = class Pe {
|
|
|
491
491
|
}
|
|
492
492
|
}, "#syncRowHeights"));
|
|
493
493
|
d(this, Vt, /* @__PURE__ */ h(() => {
|
|
494
|
-
!t(this, w) || !(t(this, w) instanceof HTMLElement) || (p(this,
|
|
494
|
+
!t(this, w) || !(t(this, w) instanceof HTMLElement) || (p(this, V, new ResizeObserver((n) => {
|
|
495
495
|
for (const e of n) {
|
|
496
496
|
const s = e.target;
|
|
497
497
|
if (!s.classList.contains("active")) continue;
|
|
@@ -504,7 +504,7 @@ const Pe = class Pe {
|
|
|
504
504
|
t(this, st) !== c && (p(this, st, c), t(this, qt).call(this), t(this, _) !== null && (t(this, Tt).call(this), this.refresh()));
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
|
-
})), t(this,
|
|
507
|
+
})), t(this, V).observe(t(this, w)));
|
|
508
508
|
}, "#initResizeObserver"));
|
|
509
509
|
d(this, Tt, /* @__PURE__ */ h(() => {
|
|
510
510
|
T.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
@@ -598,7 +598,7 @@ const Pe = class Pe {
|
|
|
598
598
|
}
|
|
599
599
|
}, "#syncHeaderHeights"));
|
|
600
600
|
E(this, "destroy", /* @__PURE__ */ h(() => {
|
|
601
|
-
t(this,
|
|
601
|
+
t(this, V) && (t(this, V).disconnect(), p(this, V, null));
|
|
602
602
|
}, "destroy"));
|
|
603
603
|
p(this, D, n.getRootNode().host), p(this, w, n), t(this, Vt).call(this);
|
|
604
604
|
}
|
|
@@ -610,7 +610,7 @@ const Pe = class Pe {
|
|
|
610
610
|
return ((e = t(this, P).get(n)) == null ? void 0 : e.length) || 1;
|
|
611
611
|
}
|
|
612
612
|
};
|
|
613
|
-
D = new WeakMap(), w = new WeakMap(), et = new WeakMap(), P = new WeakMap(), _ = new WeakMap(),
|
|
613
|
+
D = new WeakMap(), w = new WeakMap(), et = new WeakMap(), P = new WeakMap(), _ = new WeakMap(), V = new WeakMap(), st = new WeakMap(), Et = new WeakMap(), Ce = new WeakMap(), Le = new WeakMap(), Dt = new WeakMap(), Ft = new WeakMap(), At = new WeakMap(), Rt = new WeakMap(), qt = new WeakMap(), jt = new WeakMap(), Vt = new WeakMap(), Tt = new WeakMap(), He = new WeakMap(), ht = new WeakMap(), kt = new WeakMap(), Yt = new WeakMap(), h(Pe, "RowManager");
|
|
614
614
|
let be = Pe;
|
|
615
615
|
const Ut = class Ut {
|
|
616
616
|
/**
|
|
@@ -666,8 +666,8 @@ const Ut = class Ut {
|
|
|
666
666
|
}
|
|
667
667
|
const M = x.rowSpan || 1, q = x.colSpan || 1;
|
|
668
668
|
for (let W = 0; W < M; W++)
|
|
669
|
-
for (let
|
|
670
|
-
v + W < g && A +
|
|
669
|
+
for (let F = 0; F < q; F++)
|
|
670
|
+
v + W < g && A + F < b && (u[v + W][A + F] = W === 0 && F === 0 ? "1" : "0");
|
|
671
671
|
});
|
|
672
672
|
}), l.forEach((y) => {
|
|
673
673
|
const v = y.sectionRowIndex;
|
|
@@ -691,16 +691,16 @@ const Ut = class Ut {
|
|
|
691
691
|
};
|
|
692
692
|
h(Ut, "TableCompiler");
|
|
693
693
|
let pe = Ut;
|
|
694
|
-
var
|
|
694
|
+
var Y, Ct, mt, rs, is;
|
|
695
695
|
const De = class De {
|
|
696
696
|
constructor(n) {
|
|
697
697
|
d(this, mt);
|
|
698
|
-
d(this,
|
|
698
|
+
d(this, Y);
|
|
699
699
|
d(this, Ct, { startRow: -1, startCol: -1, endRow: -1, endCol: -1 });
|
|
700
700
|
// 3. 뷰 렌더링 (9분할 전체를 순회하며 경계선 클래스 부여)
|
|
701
701
|
E(this, "render", /* @__PURE__ */ h(() => {
|
|
702
702
|
const { startRow: n, startCol: e, endRow: s, endCol: r } = t(this, Ct);
|
|
703
|
-
t(this,
|
|
703
|
+
t(this, Y).querySelectorAll(
|
|
704
704
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
705
705
|
).forEach((o) => {
|
|
706
706
|
o.querySelectorAll(".selected, .selected-top, .selected-bottom, .selected-left, .selected-right").forEach((a) => {
|
|
@@ -716,7 +716,7 @@ const De = class De {
|
|
|
716
716
|
});
|
|
717
717
|
});
|
|
718
718
|
}, "render"));
|
|
719
|
-
p(this,
|
|
719
|
+
p(this, Y, n), de(this, mt, is).call(this);
|
|
720
720
|
}
|
|
721
721
|
setRange(n, e, s, r) {
|
|
722
722
|
let i = Math.min(n, s), o = Math.max(n, s), a = Math.min(e, r), c = Math.max(e, r);
|
|
@@ -724,10 +724,10 @@ const De = class De {
|
|
|
724
724
|
p(this, Ct, l), this.render();
|
|
725
725
|
}
|
|
726
726
|
};
|
|
727
|
-
|
|
727
|
+
Y = new WeakMap(), Ct = new WeakMap(), mt = new WeakSet(), // 머지된 셀이 선택 영역에 걸쳐있으면 범위를 자동으로 넓혀주는 보정기
|
|
728
728
|
rs = /* @__PURE__ */ h(function(n, e, s, r) {
|
|
729
729
|
let i = n, o = e, a = s, c = r, l = !0;
|
|
730
|
-
const f = t(this,
|
|
730
|
+
const f = t(this, Y).querySelectorAll(
|
|
731
731
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
732
732
|
);
|
|
733
733
|
for (; l; )
|
|
@@ -739,15 +739,15 @@ rs = /* @__PURE__ */ h(function(n, e, s, r) {
|
|
|
739
739
|
if (isNaN(v)) return;
|
|
740
740
|
const A = parseInt(y.rowSpan || 1, 10), x = parseInt(y.colSpan || 1, 10), M = u + A - 1, q = v + x - 1;
|
|
741
741
|
if (u <= a && M >= i && v <= c && q >= o) {
|
|
742
|
-
const
|
|
743
|
-
(
|
|
742
|
+
const F = Math.min(i, u), Je = Math.max(a, M), Qe = Math.min(o, v), ts = Math.max(c, q);
|
|
743
|
+
(F !== i || Je !== a || Qe !== o || ts !== c) && (i = F, a = Je, o = Qe, c = ts, l = !0);
|
|
744
744
|
}
|
|
745
745
|
});
|
|
746
746
|
});
|
|
747
747
|
});
|
|
748
748
|
return { startRow: i, startCol: o, endRow: a, endCol: c };
|
|
749
749
|
}, "#expandRangeByMerge"), is = /* @__PURE__ */ h(function() {
|
|
750
|
-
const n =
|
|
750
|
+
const n = t(this, Y).querySelector(".ng-container-top");
|
|
751
751
|
n && n.addEventListener("mousedown", (e) => {
|
|
752
752
|
const s = e.target.closest("td, th");
|
|
753
753
|
if (!s || s.dataset.row === void 0 || s.dataset.col === void 0 || s.closest("tr").classList.contains("nodata")) return;
|
|
@@ -755,7 +755,7 @@ rs = /* @__PURE__ */ h(function(n, e, s, r) {
|
|
|
755
755
|
this.setRange(r, i, r, i);
|
|
756
756
|
const o = /* @__PURE__ */ h((c) => {
|
|
757
757
|
const l = document.elementFromPoint(c.clientX, c.clientY), f = l == null ? void 0 : l.closest("td, th");
|
|
758
|
-
if (!f || !t(this,
|
|
758
|
+
if (!f || !t(this, Y).contains(f) || f.dataset.row === void 0 || f.dataset.col === void 0 || f.closest("tr").classList.contains("nodata")) return;
|
|
759
759
|
const g = parseInt(f.dataset.row, 10), b = parseInt(f.dataset.col, 10);
|
|
760
760
|
this.setRange(r, i, g, b);
|
|
761
761
|
}, "onMouseMove"), a = /* @__PURE__ */ h(() => {
|