@ninebone/table 0.0.767 โ 0.0.769
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 +35 -42
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +3 -7
- 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 Xe = class Xe extends ms.constructor {
|
|
|
23
23
|
h(Xe, "Trace");
|
|
24
24
|
let we = Xe;
|
|
25
25
|
const S = new we();
|
|
26
|
-
var B,
|
|
26
|
+
var B, X, E, tt, et, st, Yt, nt, Vt;
|
|
27
27
|
const Ke = class Ke extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
d(this, B);
|
|
31
|
-
d(this,
|
|
31
|
+
d(this, X, !1);
|
|
32
32
|
d(this, E);
|
|
33
33
|
d(this, tt);
|
|
34
34
|
d(this, et);
|
|
@@ -41,7 +41,7 @@ const Ke = class Ke extends HTMLElement {
|
|
|
41
41
|
})), t(this, st).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
q(this, "refresh", /* @__PURE__ */ h(() => {
|
|
44
|
-
if (!t(this, B) || !t(this, E) || t(this,
|
|
44
|
+
if (!t(this, B) || !t(this, E) || t(this, X)) return;
|
|
45
45
|
const e = t(this, E).container, n = e.querySelector("table");
|
|
46
46
|
if (!n) return;
|
|
47
47
|
const r = t(this, E).track, o = t(this, E).thumb, i = t(this, B).querySelector(".ng-container-bottom"), a = e.clientWidth, c = n.scrollWidth;
|
|
@@ -99,13 +99,13 @@ const Ke = class Ke extends HTMLElement {
|
|
|
99
99
|
t(this, nt).call(this, r.clientX - o.left - i / 2);
|
|
100
100
|
}), t(this, E).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, X, !0), this.shiftX = r.clientX - t(this, E).thumb.getBoundingClientRect().left;
|
|
103
103
|
const o = /* @__PURE__ */ h((a) => {
|
|
104
|
-
if (!t(this,
|
|
104
|
+
if (!t(this, X)) return;
|
|
105
105
|
const c = t(this, E).track.getBoundingClientRect();
|
|
106
106
|
t(this, nt).call(this, a.clientX - c.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), i = /* @__PURE__ */ h(() => {
|
|
108
|
-
p(this,
|
|
108
|
+
p(this, X, !1), n(), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", i), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
110
|
document.addEventListener("mousemove", o), document.addEventListener("mouseup", i);
|
|
111
111
|
});
|
|
@@ -189,7 +189,7 @@ const Ke = class Ke extends HTMLElement {
|
|
|
189
189
|
left: this.querySelector(".ng-scroll-left"),
|
|
190
190
|
right: this.querySelector(".ng-scroll-right")
|
|
191
191
|
}), n.addEventListener("scroll", () => {
|
|
192
|
-
t(this,
|
|
192
|
+
t(this, X) || this.refresh();
|
|
193
193
|
}), t(this, Vt).call(this), t(this, Yt).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
195
195
|
e();
|
|
@@ -198,7 +198,7 @@ const Ke = class Ke extends HTMLElement {
|
|
|
198
198
|
t(this, st) && t(this, st).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
B = new WeakMap(),
|
|
201
|
+
B = new WeakMap(), X = new WeakMap(), E = new WeakMap(), tt = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Yt = new WeakMap(), nt = new WeakMap(), Vt = new WeakMap(), h(Ke, "NineTableHScrollBar");
|
|
202
202
|
let ve = Ke;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ve);
|
|
204
204
|
var rt, ot, bt, k, Tt, Ct, Ut;
|
|
@@ -353,7 +353,7 @@ const Ge = class Ge extends HTMLElement {
|
|
|
353
353
|
rt = new WeakMap(), ot = new WeakMap(), bt = new WeakMap(), k = new WeakMap(), Tt = new WeakMap(), Ct = new WeakMap(), Ut = new WeakMap(), h(Ge, "NineTableVScrollBar");
|
|
354
354
|
let Se = Ge;
|
|
355
355
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Se);
|
|
356
|
-
var j, R, it, P, D,
|
|
356
|
+
var j, R, it, P, D, K, at, kt, Oe, We, Xt, Kt, Lt, It, Ht, Gt, Zt, $t, ze, pt, Mt, Jt;
|
|
357
357
|
const Ze = class Ze {
|
|
358
358
|
constructor(s) {
|
|
359
359
|
d(this, j);
|
|
@@ -361,7 +361,7 @@ const Ze = class Ze {
|
|
|
361
361
|
d(this, it);
|
|
362
362
|
d(this, P, /* @__PURE__ */ new Map());
|
|
363
363
|
d(this, D, null);
|
|
364
|
-
d(this,
|
|
364
|
+
d(this, K, null);
|
|
365
365
|
d(this, at, 0);
|
|
366
366
|
d(this, kt, 40);
|
|
367
367
|
d(this, Oe, !1);
|
|
@@ -491,7 +491,7 @@ const Ze = class Ze {
|
|
|
491
491
|
}
|
|
492
492
|
}, "#syncRowHeights"));
|
|
493
493
|
d(this, Zt, /* @__PURE__ */ h(() => {
|
|
494
|
-
!t(this, R) || !(t(this, R) instanceof HTMLElement) || (p(this,
|
|
494
|
+
!t(this, R) || !(t(this, R) instanceof HTMLElement) || (p(this, K, new ResizeObserver((s) => {
|
|
495
495
|
for (const e of s) {
|
|
496
496
|
const n = e.target;
|
|
497
497
|
if (!n.classList.contains("active")) continue;
|
|
@@ -504,7 +504,7 @@ const Ze = class Ze {
|
|
|
504
504
|
t(this, at) !== c && (p(this, at, c), t(this, Ht).call(this), t(this, D) !== null && (t(this, $t).call(this), this.refresh()));
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
|
-
})), t(this,
|
|
507
|
+
})), t(this, K).observe(t(this, R)));
|
|
508
508
|
}, "#initResizeObserver"));
|
|
509
509
|
d(this, $t, /* @__PURE__ */ h(() => {
|
|
510
510
|
S.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((s) => {
|
|
@@ -598,7 +598,7 @@ const Ze = class Ze {
|
|
|
598
598
|
}
|
|
599
599
|
}, "#syncHeaderHeights"));
|
|
600
600
|
q(this, "destroy", /* @__PURE__ */ h(() => {
|
|
601
|
-
t(this,
|
|
601
|
+
t(this, K) && (t(this, K).disconnect(), p(this, K, null));
|
|
602
602
|
}, "destroy"));
|
|
603
603
|
p(this, j, s.getRootNode().host), p(this, R, s), t(this, Zt).call(this);
|
|
604
604
|
}
|
|
@@ -610,7 +610,7 @@ const Ze = class Ze {
|
|
|
610
610
|
return ((e = t(this, P).get(s)) == null ? void 0 : e.length) || 1;
|
|
611
611
|
}
|
|
612
612
|
};
|
|
613
|
-
j = new WeakMap(), R = new WeakMap(), it = new WeakMap(), P = new WeakMap(), D = new WeakMap(),
|
|
613
|
+
j = new WeakMap(), R = new WeakMap(), it = new WeakMap(), P = new WeakMap(), D = new WeakMap(), K = new WeakMap(), at = new WeakMap(), kt = new WeakMap(), Oe = new WeakMap(), We = new WeakMap(), Xt = new WeakMap(), Kt = new WeakMap(), Lt = new WeakMap(), It = new WeakMap(), Ht = new WeakMap(), Gt = new WeakMap(), Zt = new WeakMap(), $t = new WeakMap(), ze = new WeakMap(), pt = new WeakMap(), Mt = new WeakMap(), Jt = new WeakMap(), h(Ze, "RowManager");
|
|
614
614
|
let Re = Ze;
|
|
615
615
|
const Qt = class Qt {
|
|
616
616
|
/**
|
|
@@ -693,10 +693,10 @@ const Qt = class Qt {
|
|
|
693
693
|
};
|
|
694
694
|
h(Qt, "TableCompiler");
|
|
695
695
|
let Ae = Qt;
|
|
696
|
-
var _, Y,
|
|
696
|
+
var _, Y, V, At, bs;
|
|
697
697
|
const Je = class Je {
|
|
698
698
|
constructor(s) {
|
|
699
|
-
d(this,
|
|
699
|
+
d(this, V);
|
|
700
700
|
d(this, _);
|
|
701
701
|
d(this, Y, { startRow: -1, startCol: -1, endRow: -1, endCol: -1 });
|
|
702
702
|
q(this, "render", /* @__PURE__ */ h(() => {
|
|
@@ -716,7 +716,7 @@ const Je = class Je {
|
|
|
716
716
|
let i = 0;
|
|
717
717
|
o.forEach((a) => {
|
|
718
718
|
a.querySelectorAll("tbody tr").forEach((c) => {
|
|
719
|
-
const { matrixRow: l } = Q(this,
|
|
719
|
+
const { matrixRow: l } = Q(this, V, At).call(this, c);
|
|
720
720
|
l < 0 || c.querySelectorAll("td, th").forEach((f) => {
|
|
721
721
|
const u = parseInt(f.dataset.col, 10);
|
|
722
722
|
if (isNaN(u)) return;
|
|
@@ -726,7 +726,7 @@ const Je = class Je {
|
|
|
726
726
|
});
|
|
727
727
|
}), S.log(`โจ [CellSelection.render] Total rendered cells marked: ${i}`);
|
|
728
728
|
}, "render"));
|
|
729
|
-
p(this, _, s), Q(this,
|
|
729
|
+
p(this, _, s), Q(this, V, bs).call(this), t(this, _).querySelectorAll(
|
|
730
730
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
731
731
|
).forEach((n) => {
|
|
732
732
|
n.addEventListener("scroll", () => {
|
|
@@ -745,14 +745,14 @@ const Je = class Je {
|
|
|
745
745
|
f = !1, u++, l.forEach((b) => {
|
|
746
746
|
b.querySelectorAll("tbody tr").forEach((g) => {
|
|
747
747
|
if (g.classList.contains("nodata")) return;
|
|
748
|
-
const { matrixRow: y } = Q(this,
|
|
748
|
+
const { matrixRow: y } = Q(this, V, At).call(this, g);
|
|
749
749
|
y < 0 || g.querySelectorAll("td, th").forEach((w) => {
|
|
750
750
|
const v = parseInt(w.dataset.col, 10);
|
|
751
751
|
if (isNaN(v)) return;
|
|
752
752
|
const m = parseInt(w.rowSpan || 1, 10), C = parseInt(w.colSpan || 1, 10), A = y + m - 1, H = v + C - 1;
|
|
753
753
|
if (A >= o && y <= i && H >= a && v <= c) {
|
|
754
|
-
const
|
|
755
|
-
(
|
|
754
|
+
const U = Math.min(o, y), cs = Math.max(i, A), hs = Math.min(a, v), ds = Math.max(c, H);
|
|
755
|
+
(U !== o || cs !== i || hs !== a || ds !== c) && (o = U, i = cs, a = hs, c = ds, f = !0);
|
|
756
756
|
}
|
|
757
757
|
});
|
|
758
758
|
});
|
|
@@ -760,7 +760,7 @@ const Je = class Je {
|
|
|
760
760
|
p(this, Y, { startRow: o, startCol: a, endRow: i, endCol: c }), S.log("๐ฆ [CellSelection.setRange] Final Range ->", t(this, Y)), this.render();
|
|
761
761
|
}
|
|
762
762
|
};
|
|
763
|
-
_ = new WeakMap(), Y = new WeakMap(),
|
|
763
|
+
_ = new WeakMap(), Y = new WeakMap(), V = new WeakSet(), At = /* @__PURE__ */ h(function(s) {
|
|
764
764
|
if (!s || s.classList.contains("nodata")) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
|
|
765
765
|
const e = parseInt(s.dataset.row, 10);
|
|
766
766
|
if (isNaN(e)) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
|
|
@@ -777,12 +777,12 @@ _ = new WeakMap(), Y = new WeakMap(), U = new WeakSet(), At = /* @__PURE__ */ h(
|
|
|
777
777
|
const n = e.target.closest("td, th");
|
|
778
778
|
if (!n || n.dataset.row === void 0 || n.dataset.col === void 0 || n.closest("tr").classList.contains("nodata")) return;
|
|
779
779
|
t(this, _).style.userSelect = "none", t(this, _).style.webkitUserSelect = "none";
|
|
780
|
-
const r = n.closest("tr"), { matrixRow: o } = Q(this,
|
|
780
|
+
const r = n.closest("tr"), { matrixRow: o } = Q(this, V, At).call(this, r), i = parseInt(n.dataset.col, 10);
|
|
781
781
|
if (o < 0) {
|
|
782
782
|
t(this, _).style.userSelect = "", t(this, _).style.webkitUserSelect = "";
|
|
783
783
|
return;
|
|
784
784
|
}
|
|
785
|
-
S.log(`๐ฑ๏ธ [MouseDown Success] startRow: ${o}, startCol: ${i}`), this
|
|
785
|
+
S.log(`๐ฑ๏ธ [MouseDown Success] startRow: ${o}, startCol: ${i}`), t(this, _).navigation.currentCell = n;
|
|
786
786
|
let a = o, c = i;
|
|
787
787
|
const l = /* @__PURE__ */ h((u) => {
|
|
788
788
|
const b = document.elementFromPoint(u.clientX, u.clientY);
|
|
@@ -798,7 +798,7 @@ _ = new WeakMap(), Y = new WeakMap(), U = new WeakSet(), At = /* @__PURE__ */ h(
|
|
|
798
798
|
}
|
|
799
799
|
}
|
|
800
800
|
if (!g || g.dataset.row === void 0 || g.dataset.col === void 0 || g.closest("tr").classList.contains("nodata")) return;
|
|
801
|
-
const y = g.closest("tr"), { matrixRow: w } = Q(this,
|
|
801
|
+
const y = g.closest("tr"), { matrixRow: w } = Q(this, V, At).call(this, y), v = parseInt(g.dataset.col, 10);
|
|
802
802
|
w < 0 || a === w && c === v || (a = w, c = v, this.setRange(o, i, w, v));
|
|
803
803
|
}, "onMouseMove"), f = /* @__PURE__ */ h(() => {
|
|
804
804
|
S.log("๐ฑ๏ธ [MouseUp] Drag ended."), t(this, _).style.userSelect = "", t(this, _).style.webkitUserSelect = "", document.removeEventListener("mousemove", l), document.removeEventListener("mouseup", f);
|
|
@@ -807,17 +807,17 @@ _ = new WeakMap(), Y = new WeakMap(), U = new WeakSet(), At = /* @__PURE__ */ h(
|
|
|
807
807
|
});
|
|
808
808
|
}, "#initEvents"), h(Je, "CellSelection");
|
|
809
809
|
let Ee = Je;
|
|
810
|
-
var
|
|
810
|
+
var G, lt, te, ee, Be, se, ps;
|
|
811
811
|
const Qe = class Qe {
|
|
812
812
|
// ๐ฏ ํค๋ณด๋ ๋ค๋น๊ฒ์ด์
์ค ์คํฌ๋กค ํ ๋ฐฉ์ง ํ๋๊ทธ
|
|
813
813
|
constructor(s) {
|
|
814
814
|
d(this, se);
|
|
815
|
-
d(this,
|
|
815
|
+
d(this, G);
|
|
816
816
|
d(this, lt, null);
|
|
817
817
|
d(this, te, -1);
|
|
818
818
|
d(this, ee, -1);
|
|
819
819
|
d(this, Be, !1);
|
|
820
|
-
p(this,
|
|
820
|
+
p(this, G, s), Q(this, se, ps).call(this), S.log("๐ฏ [CellNavigation] Initialized");
|
|
821
821
|
}
|
|
822
822
|
get currentCell() {
|
|
823
823
|
return t(this, lt);
|
|
@@ -831,14 +831,14 @@ const Qe = class Qe {
|
|
|
831
831
|
const r = s.closest("tr"), o = r == null ? void 0 : r.closest("tbody");
|
|
832
832
|
if (o) {
|
|
833
833
|
const a = Array.from(o.querySelectorAll("tr:not(.nodata)")).filter((u) => parseInt(u.dataset.row, 10) === e), c = a.length > 0 ? a.length : 1, l = a.indexOf(r), f = e * c + (l >= 0 ? l : 0);
|
|
834
|
-
S.log("====================", f, n, f, n), t(this,
|
|
834
|
+
S.log("====================", f, n, f, n), t(this, G).selection.setRange(f, n, f, n);
|
|
835
835
|
}
|
|
836
836
|
}
|
|
837
837
|
}
|
|
838
838
|
moveCell(s) {
|
|
839
839
|
var C, A, H, F;
|
|
840
840
|
if (!t(this, lt)) return;
|
|
841
|
-
const e = t(this, lt), n = e.closest("tr"), r = parseInt(e.dataset.row, 10), o = parseInt(e.dataset.col, 10), i = n == null ? void 0 : n.closest("tbody"), c = Array.from(i.querySelectorAll("tr:not(.nodata)")).filter((
|
|
841
|
+
const e = t(this, lt), n = e.closest("tr"), r = parseInt(e.dataset.row, 10), o = parseInt(e.dataset.col, 10), i = n == null ? void 0 : n.closest("tbody"), c = Array.from(i.querySelectorAll("tr:not(.nodata)")).filter((U) => parseInt(U.dataset.row, 10) === r), l = c.length > 0 ? c.length : 1, f = c.indexOf(n);
|
|
842
842
|
let u = r, b = f, g = o;
|
|
843
843
|
switch (s.code) {
|
|
844
844
|
case "Tab":
|
|
@@ -858,20 +858,17 @@ const Qe = class Qe {
|
|
|
858
858
|
break;
|
|
859
859
|
}
|
|
860
860
|
let y = null;
|
|
861
|
-
const m = Array.from(i.querySelectorAll("tr:not(.nodata)")).filter((
|
|
861
|
+
const m = Array.from(i.querySelectorAll("tr:not(.nodata)")).filter((U) => parseInt(U.dataset.row, 10) === u)[b];
|
|
862
862
|
if (m && (y = m.querySelector(`[data-col="${g}"]`)), y)
|
|
863
863
|
this.currentCell = y;
|
|
864
864
|
else if (u !== r && u >= 0) {
|
|
865
|
-
const
|
|
866
|
-
(F = (H = t(this,
|
|
865
|
+
const U = ((A = (C = t(this, G)).getRowHeight) == null ? void 0 : A.call(C)) || 40;
|
|
866
|
+
(F = (H = t(this, G)).scrollToY) == null || F.call(H, u * U);
|
|
867
867
|
}
|
|
868
868
|
}
|
|
869
869
|
};
|
|
870
|
-
|
|
871
|
-
t(this,
|
|
872
|
-
const e = s.target.closest("td, th");
|
|
873
|
-
!e || e.dataset.row === void 0 || e.dataset.col === void 0 || (this.currentCell = e);
|
|
874
|
-
}), t(this, V).addEventListener("keydown", (s) => {
|
|
870
|
+
G = new WeakMap(), lt = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), Be = new WeakMap(), se = new WeakSet(), ps = /* @__PURE__ */ h(function() {
|
|
871
|
+
t(this, G).addEventListener("keydown", (s) => {
|
|
875
872
|
["Tab", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(s.code) && this.moveCell(s);
|
|
876
873
|
});
|
|
877
874
|
}, "#initEvents"), h(Qe, "CellNavigation");
|
|
@@ -1102,10 +1099,6 @@ const Et = class Et extends HTMLElement {
|
|
|
1102
1099
|
nine-table-sheet th.selected {
|
|
1103
1100
|
background-color: rgba(37, 99, 235, 0.08);
|
|
1104
1101
|
position: relative; /* z-index์ ๊ฐ์ ์์ ๊ธฐ์ค์ */
|
|
1105
|
-
border-top: 1px solid #e5e7eb;
|
|
1106
|
-
border-bottom: 1px solid #e5e7eb;
|
|
1107
|
-
border-left: 1px solid #e5e7eb;
|
|
1108
|
-
border-right: 1px solid #e5e7eb;
|
|
1109
1102
|
}
|
|
1110
1103
|
|
|
1111
1104
|
/* box-shadow ๋์ z-index๋ฅผ ๋์ด๊ณ ํ
๋๋ฆฌ ์ ์ ๋๋ ทํ๊ฒ ์ค๋ฒ๋ ์ด */
|