@ninebone/table 0.1.46 β 0.1.47
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 +122 -120
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +1 -1
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -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 v = 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, []), v.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
|
+
v.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
|
}), [
|
|
@@ -784,7 +784,7 @@ const zo = class zo extends HTMLElement {
|
|
|
784
784
|
return e.clientHeight - o;
|
|
785
785
|
}, "#getViewHeight"));
|
|
786
786
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
787
|
-
if (
|
|
787
|
+
if (v.log("=================", "vscrollbar.refresh"), t(this, He) || !t(this, M) || !t(this, M).elements || !t(this, F)) return;
|
|
788
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;
|
|
789
789
|
if (t(this, M).classList.toggle("vscroll-visible", a), !a)
|
|
790
790
|
return;
|
|
@@ -799,7 +799,7 @@ const zo = class zo extends HTMLElement {
|
|
|
799
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;
|
|
800
800
|
}, "refresh"));
|
|
801
801
|
d(this, rr, /* @__PURE__ */ h(() => {
|
|
802
|
-
|
|
802
|
+
v.log("nine-table-vscrollbar.#init");
|
|
803
803
|
const e = t(this, F).container;
|
|
804
804
|
t(this, F).thumb.addEventListener("mousedown", (s) => {
|
|
805
805
|
if (s.button !== 0) return;
|
|
@@ -810,8 +810,8 @@ const zo = class zo extends HTMLElement {
|
|
|
810
810
|
const f = u.clientY - t(this, Vs);
|
|
811
811
|
let g = t(this, Ps) + f;
|
|
812
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),
|
|
814
|
-
t(this, M).rowManager.scrollToDataRow(
|
|
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), S = Math.floor(b * (w - x + 1));
|
|
814
|
+
t(this, M).rowManager.scrollToDataRow(S);
|
|
815
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);
|
|
816
816
|
t(this, F).top.disabled = $ <= 0, t(this, F).bottom.disabled = $ >= T - 1;
|
|
817
817
|
}, "onMouseMove"), c = /* @__PURE__ */ h(() => {
|
|
@@ -823,7 +823,7 @@ const zo = class zo extends HTMLElement {
|
|
|
823
823
|
const i = t(this, F).track.getBoundingClientRect(), n = t(this, F).thumb.clientHeight, l = t(this, F).track.clientHeight - n;
|
|
824
824
|
if (l > 0) {
|
|
825
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
|
-
|
|
826
|
+
v.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");
|
|
827
827
|
}
|
|
828
828
|
this.refresh();
|
|
829
829
|
}), t(this, F).top.addEventListener("click", () => {
|
|
@@ -952,7 +952,7 @@ const Bo = class Bo {
|
|
|
952
952
|
return t(this, $e);
|
|
953
953
|
}
|
|
954
954
|
apply() {
|
|
955
|
-
if (
|
|
955
|
+
if (v.log("==================", "Grouping.Apply"), t(this, Fe)) return;
|
|
956
956
|
p(this, Fe, !0);
|
|
957
957
|
let r = [];
|
|
958
958
|
const e = t(this, qt).sourceTable;
|
|
@@ -1084,8 +1084,8 @@ const Vo = class Vo {
|
|
|
1084
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
1085
|
let g = 1, b = c;
|
|
1086
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)),
|
|
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 = `-${
|
|
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)), S = 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 = `-${S}px`;
|
|
1089
1089
|
const L = t(this, We).firstTr, C = L && L.dataset.row !== void 0 ? parseInt(L.dataset.row, 10) : -1;
|
|
1090
1090
|
!e && C === w || ([
|
|
1091
1091
|
t(this, R).elements.left.tbody.body,
|
|
@@ -1111,7 +1111,7 @@ const Vo = class Vo {
|
|
|
1111
1111
|
}, "#handleScroll"));
|
|
1112
1112
|
d(this, or, /* @__PURE__ */ h((r, e = !1) => {
|
|
1113
1113
|
var $;
|
|
1114
|
-
|
|
1114
|
+
v.log("handleGroupdScroll() start");
|
|
1115
1115
|
const s = t(this, R).view.getArray() || [], i = s.length;
|
|
1116
1116
|
if (i === 0) {
|
|
1117
1117
|
t(this, R).elements.scrollHolder.style.height = "0px";
|
|
@@ -1136,7 +1136,7 @@ const Vo = class Vo {
|
|
|
1136
1136
|
const H = l(s[T]);
|
|
1137
1137
|
c[T] = H, a += H;
|
|
1138
1138
|
}
|
|
1139
|
-
t(this, R).elements.scrollHolder.style.height = `${a}px`,
|
|
1139
|
+
t(this, R).elements.scrollHolder.style.height = `${a}px`, v.log("*************", a);
|
|
1140
1140
|
const u = t(this, R).clientHeight;
|
|
1141
1141
|
let f = 0, g = 0;
|
|
1142
1142
|
for (let T = 0; T < i; T++) {
|
|
@@ -1154,7 +1154,7 @@ const Vo = class Vo {
|
|
|
1154
1154
|
const m = t(this, We).firstTr, y = m && m.dataset.virtualIndex !== void 0 ? parseInt(m.dataset.virtualIndex, 10) : -1;
|
|
1155
1155
|
if (!e && y === g)
|
|
1156
1156
|
return;
|
|
1157
|
-
const x = Math.ceil(u / (t(this, _) / o)), w = ((($ = t(this, R).grouping.columns) == null ? void 0 : $.length) || 1) * 15,
|
|
1157
|
+
const x = Math.ceil(u / (t(this, _) / o)), w = ((($ = t(this, R).grouping.columns) == null ? void 0 : $.length) || 1) * 15, S = g, L = Math.min(i, g + x + w), C = s.slice(S, L);
|
|
1158
1158
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((T) => {
|
|
1159
1159
|
const H = t(this, R).querySelector(`.ng-sheet-body ${T}`);
|
|
1160
1160
|
if (!H) return;
|
|
@@ -1188,7 +1188,7 @@ const Vo = class Vo {
|
|
|
1188
1188
|
}
|
|
1189
1189
|
});
|
|
1190
1190
|
}
|
|
1191
|
-
}), t(this, R).selection.refresh(),
|
|
1191
|
+
}), t(this, R).selection.refresh(), v.log("handleGroupdScroll() end");
|
|
1192
1192
|
}, "#handleGroupedScroll"));
|
|
1193
1193
|
d(this, lr, /* @__PURE__ */ h((r, e, s, i) => {
|
|
1194
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) : [];
|
|
@@ -1249,18 +1249,18 @@ const Vo = class Vo {
|
|
|
1249
1249
|
}, "#measureAndCacheHeight"));
|
|
1250
1250
|
d(this, Ks, /* @__PURE__ */ h(() => {
|
|
1251
1251
|
var r;
|
|
1252
|
-
if (
|
|
1252
|
+
if (v.log("[DEBUG #updateRowCount] sheetHeight:", t(this, Zt), "cachedTemplateHeight:", t(this, _)), t(this, Zt) > 0 && t(this, _) > 0) {
|
|
1253
1253
|
const e = Math.ceil(t(this, Zt) / t(this, _));
|
|
1254
1254
|
let s = t(this, nr);
|
|
1255
1255
|
if (t(this, Oe) && t(this, R).grouping) {
|
|
1256
1256
|
const i = ((r = t(this, R).grouping.columns) == null ? void 0 : r.length) || 1;
|
|
1257
1257
|
s += i * 15;
|
|
1258
1258
|
}
|
|
1259
|
-
p(this, hs, e + s),
|
|
1259
|
+
p(this, hs, e + s), v.log("[DEBUG #updateRowCount] calculated cachedRowCount:", t(this, hs));
|
|
1260
1260
|
}
|
|
1261
1261
|
}, "#updateRowCount"));
|
|
1262
1262
|
d(this, us, /* @__PURE__ */ h(() => {
|
|
1263
|
-
|
|
1263
|
+
v.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((r) => {
|
|
1264
1264
|
const e = t(this, R).querySelector(`.ng-sheet-body ${r}`);
|
|
1265
1265
|
e && e.querySelector("tbody") && t(this, ar).call(this, e);
|
|
1266
1266
|
}), t(this, cr).call(this);
|
|
@@ -1345,8 +1345,8 @@ const Vo = class Vo {
|
|
|
1345
1345
|
let g = l * f;
|
|
1346
1346
|
t(this, R).templateLength;
|
|
1347
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
|
|
1349
|
-
w && (
|
|
1348
|
+
let S = 1;
|
|
1349
|
+
w && (S = x / y), a = g * S;
|
|
1350
1350
|
}
|
|
1351
1351
|
p(this, ds, !0), i.scrollTop = a, t(this, ze).call(this, a), requestAnimationFrame(() => {
|
|
1352
1352
|
requestAnimationFrame(() => {
|
|
@@ -1432,7 +1432,7 @@ const Po = class Po {
|
|
|
1432
1432
|
const o = t(this, Z).querySelector(`.ng-sheet-body-content tr[data-matrix-row="${r}"] td[data-col="${e}"]`);
|
|
1433
1433
|
o && (o.classList.add("selected-start"), (l = o.closest("tr")) == null || l.classList.add("selected-start"));
|
|
1434
1434
|
}, "render"));
|
|
1435
|
-
p(this, Z, r), A(this, oe, Ll).call(this),
|
|
1435
|
+
p(this, Z, r), A(this, oe, Ll).call(this), v.log("π― [CellSelection] Initialized (New Structure Compatible)");
|
|
1436
1436
|
}
|
|
1437
1437
|
setFocus(r, e) {
|
|
1438
1438
|
var i;
|
|
@@ -1458,7 +1458,7 @@ const Po = class Po {
|
|
|
1458
1458
|
m < 0 || b.querySelectorAll("td, th").forEach((y) => {
|
|
1459
1459
|
const x = parseInt(y.dataset.col, 10);
|
|
1460
1460
|
if (isNaN(x)) return;
|
|
1461
|
-
const w = parseInt(y.rowSpan || 1, 10),
|
|
1461
|
+
const w = parseInt(y.rowSpan || 1, 10), S = parseInt(y.colSpan || 1, 10), L = m + w - 1, C = x + S - 1;
|
|
1462
1462
|
if (L >= n && m <= o && C >= l && x <= a) {
|
|
1463
1463
|
const T = Math.min(n, m), H = Math.max(o, L), V = Math.min(l, x), Q = Math.max(a, C);
|
|
1464
1464
|
(T !== n || H !== o || V !== l || Q !== a) && (n = T, o = H, l = V, a = Q, u = !0);
|
|
@@ -1478,7 +1478,7 @@ Z = new WeakMap(), Zs = new WeakMap(), oe = new WeakSet(), Hs = /* @__PURE__ */
|
|
|
1478
1478
|
}, "#getMatrixRow"), Ll = /* @__PURE__ */ h(function() {
|
|
1479
1479
|
const r = t(this, Z).querySelector(".ng-sheet-body");
|
|
1480
1480
|
if (!r) {
|
|
1481
|
-
|
|
1481
|
+
v.log("β [CellSelection] .ng-sheet-body not found!");
|
|
1482
1482
|
return;
|
|
1483
1483
|
}
|
|
1484
1484
|
r.addEventListener("mousedown", (e) => {
|
|
@@ -1498,10 +1498,10 @@ Z = new WeakMap(), Zs = new WeakMap(), oe = new WeakSet(), Hs = /* @__PURE__ */
|
|
|
1498
1498
|
let b = g == null ? void 0 : g.closest("td, th");
|
|
1499
1499
|
if (!b || !t(this, Z).contains(b)) {
|
|
1500
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");
|
|
1501
|
-
for (const
|
|
1502
|
-
const L =
|
|
1501
|
+
for (const S of w) {
|
|
1502
|
+
const L = S.getBoundingClientRect();
|
|
1503
1503
|
if (f.clientX >= L.left && f.clientX <= L.right && f.clientY >= L.top && f.clientY <= L.bottom) {
|
|
1504
|
-
b =
|
|
1504
|
+
b = S;
|
|
1505
1505
|
break;
|
|
1506
1506
|
}
|
|
1507
1507
|
}
|
|
@@ -1550,7 +1550,7 @@ const Xo = class Xo {
|
|
|
1550
1550
|
}, "#getMaxColCell"));
|
|
1551
1551
|
d(this, si, /* @__PURE__ */ h((r, e) => {
|
|
1552
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;
|
|
1553
|
-
return
|
|
1553
|
+
return v.log(`π [#getNextCol] current col: ${e}, found td colSpan: ${i}, calculated next col: ${n}`), n;
|
|
1554
1554
|
}, "#getNextCol"));
|
|
1555
1555
|
d(this, ii, /* @__PURE__ */ h((r, e) => {
|
|
1556
1556
|
if (e <= 0) return 0;
|
|
@@ -1606,14 +1606,14 @@ const Xo = class Xo {
|
|
|
1606
1606
|
for (const m of Array.from(c.querySelectorAll("td"))) {
|
|
1607
1607
|
const y = parseInt(m.dataset.col, 10), x = parseInt(m.colSpan || 1, 10), w = parseInt(m.rowSpan || 1, 10);
|
|
1608
1608
|
if (isNaN(y) || window.getComputedStyle(m).display === "none") continue;
|
|
1609
|
-
const
|
|
1609
|
+
const S = u, L = b, C = S * o + L, $ = C + w - 1;
|
|
1610
1610
|
if (n >= C && n <= $ && s >= y && s < y + x)
|
|
1611
1611
|
return m;
|
|
1612
1612
|
}
|
|
1613
1613
|
}
|
|
1614
1614
|
return null;
|
|
1615
1615
|
}, "#getNearElement"));
|
|
1616
|
-
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), v.log("π― [CellNavigation] Initialized (Diagnostic Logging Restored)");
|
|
1617
1617
|
}
|
|
1618
1618
|
get currentCell() {
|
|
1619
1619
|
return t(this, fe);
|
|
@@ -1623,14 +1623,14 @@ const Xo = class Xo {
|
|
|
1623
1623
|
if (!r) return;
|
|
1624
1624
|
p(this, fe, r), r.focus({ preventScroll: !0 }), p(this, zt, r.closest("tr"));
|
|
1625
1625
|
const e = A(this, ft, Le).call(this, t(this, zt));
|
|
1626
|
-
|
|
1626
|
+
v.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);
|
|
1627
1627
|
}
|
|
1628
1628
|
moveCell(r) {
|
|
1629
1629
|
var m;
|
|
1630
1630
|
if (!["TH", "TD"].includes(r.target.tagName))
|
|
1631
1631
|
return;
|
|
1632
1632
|
if (!t(this, fe) || !t(this, zt)) {
|
|
1633
|
-
|
|
1633
|
+
v.log("β οΈ [moveCell] currentCell or currentTr is missing!");
|
|
1634
1634
|
return;
|
|
1635
1635
|
}
|
|
1636
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));
|
|
@@ -1688,24 +1688,24 @@ const Xo = class Xo {
|
|
|
1688
1688
|
return;
|
|
1689
1689
|
break;
|
|
1690
1690
|
}
|
|
1691
|
-
|
|
1691
|
+
v.log("========");
|
|
1692
1692
|
const u = (((m = t(this, D).view.getArray()) == null ? void 0 : m.length) || 0) * n - 1;
|
|
1693
|
-
l = Math.max(0, Math.min(l, u)),
|
|
1693
|
+
l = Math.max(0, Math.min(l, u)), v.log(`β¨οΈ [Key: ${r.code}] Current matrixRow: ${o} -> Target nextMatrixRow: ${l}, nextCol: ${a}`);
|
|
1694
1694
|
const f = Math.floor(l / n), g = l % n;
|
|
1695
1695
|
(/* @__PURE__ */ h((y = 0) => {
|
|
1696
1696
|
let x = t(this, ri).call(this, f, g, a, l);
|
|
1697
1697
|
if (x) {
|
|
1698
|
-
|
|
1698
|
+
v.log(`β
[Found Cell] Attempt ${y} -> dataRow: ${x.dataset.row}, col: ${x.dataset.col}`), this.currentCell = x;
|
|
1699
1699
|
const w = A(this, ft, Le).call(this, t(this, zt));
|
|
1700
1700
|
t(this, D).selection.setRange(w, x.dataset.col, w, x.dataset.col), A(this, ft, Vn).call(this, x);
|
|
1701
1701
|
} else
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
let
|
|
1705
|
-
if (
|
|
1706
|
-
|
|
1707
|
-
const L =
|
|
1708
|
-
t(this, D).selection.setRange(C,
|
|
1702
|
+
v.log(`π [Scroll Trigger] Cell not found in DOM, invoking rowManager.scrollToDataRow(${f})`), t(this, D).rowManager.scrollToDataRow(f, "bottom", () => {
|
|
1703
|
+
v.log("nextDataRow", f), (/* @__PURE__ */ h(() => {
|
|
1704
|
+
let S = t(this, ri).call(this, f, g, a, l);
|
|
1705
|
+
if (S) {
|
|
1706
|
+
v.log(`β
[Found After Scroll] RetryLoop success -> dataRow: ${S.dataset.row}`), this.currentCell = S;
|
|
1707
|
+
const L = S.closest("tr"), C = A(this, ft, Le).call(this, L);
|
|
1708
|
+
t(this, D).selection.setRange(C, S.dataset.col, C, S.dataset.col), A(this, ft, Vn).call(this, S);
|
|
1709
1709
|
}
|
|
1710
1710
|
}, "retryLoop"))();
|
|
1711
1711
|
});
|
|
@@ -1728,7 +1728,7 @@ D = new WeakMap(), Js = new WeakMap(), fe = new WeakMap(), zt = new WeakMap(), A
|
|
|
1728
1728
|
const e = t(this, D).querySelector(".ng-sheet-body"), s = t(this, D).querySelector(".ng-sheet-body .ng-container-body");
|
|
1729
1729
|
if (!e || !s) return;
|
|
1730
1730
|
const i = r.getBoundingClientRect(), n = e.getBoundingClientRect(), o = s.getBoundingClientRect();
|
|
1731
|
-
|
|
1731
|
+
v.log(`π [DIAGNOSTIC VISIBILITY]
|
|
1732
1732
|
- cell.dataset.col: ${r.dataset.col}
|
|
1733
1733
|
- cellRect (left: ${i.left}, right: ${i.right})
|
|
1734
1734
|
- containerRect (left: ${o.left}, right: ${o.right}, width: ${o.width}, scrollLeft: ${s.scrollLeft}, scrollWidth: ${s.scrollWidth}, clientWidth: ${s.clientWidth})
|
|
@@ -1746,7 +1746,7 @@ D = new WeakMap(), Js = new WeakMap(), fe = new WeakMap(), zt = new WeakMap(), A
|
|
|
1746
1746
|
}
|
|
1747
1747
|
});
|
|
1748
1748
|
}
|
|
1749
|
-
i.left < o.left ? (
|
|
1749
|
+
i.left < o.left ? (v.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 && (v.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));
|
|
1750
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() {
|
|
1751
1751
|
t(this, D).addEventListener("mousedown", (r) => {
|
|
1752
1752
|
if (r.button !== 0) return;
|
|
@@ -1793,9 +1793,9 @@ const _o = class _o {
|
|
|
1793
1793
|
o || l ? s.classList.add("resizable-edge") : s.classList.remove("resizable-edge");
|
|
1794
1794
|
}, "#onPointerMove"));
|
|
1795
1795
|
d(this, ai, /* @__PURE__ */ h((r) => {
|
|
1796
|
-
if (
|
|
1796
|
+
if (v.log(r.actualTarget, r.target), !r.actualTarget.closest("thead")) return;
|
|
1797
1797
|
const s = r.actualTarget.closest("th, td");
|
|
1798
|
-
if (
|
|
1798
|
+
if (v.log(s, r.actualTarget), !s || !s.classList.contains("resizable-edge")) return;
|
|
1799
1799
|
r.preventDefault();
|
|
1800
1800
|
const i = s.getBoundingClientRect(), n = r.clientX - i.left;
|
|
1801
1801
|
let o = s;
|
|
@@ -1822,7 +1822,7 @@ const _o = class _o {
|
|
|
1822
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 });
|
|
1823
1823
|
}, "#onPointerDown"));
|
|
1824
1824
|
d(this, ci, /* @__PURE__ */ h((r) => {
|
|
1825
|
-
|
|
1825
|
+
v.log(r), A(this, It, _n).call(this, r.clientX);
|
|
1826
1826
|
}, "#onDragMove"));
|
|
1827
1827
|
d(this, dr, /* @__PURE__ */ h((r) => {
|
|
1828
1828
|
var n;
|
|
@@ -1905,12 +1905,12 @@ const _o = class _o {
|
|
|
1905
1905
|
}
|
|
1906
1906
|
break;
|
|
1907
1907
|
}
|
|
1908
|
-
}),
|
|
1908
|
+
}), v.log(a);
|
|
1909
1909
|
const c = t(this, Be).fields.get().indexOf(l.dataset.bind), f = window.getComputedStyle(l).font || "12px sans-serif", g = s.innerText || "";
|
|
1910
1910
|
let m = (nine.measureTextSize(g, f).width || 0) + 16;
|
|
1911
1911
|
t(this, Be).execute(() => {
|
|
1912
1912
|
t(this, P).view.getArray().forEach((x, w) => {
|
|
1913
|
-
const
|
|
1913
|
+
const S = String(l.dataset.expr ? t(this, Be).exprEngine.evaluate(l.dataset.expr, x, w) : x.v[c] ?? "").trim(), L = nine.measureTextSize(S, f);
|
|
1914
1914
|
L.width && L.width > m && (m = L.width);
|
|
1915
1915
|
});
|
|
1916
1916
|
const y = Math.max(32, Math.min(400, Math.ceil(m) + a));
|
|
@@ -1942,7 +1942,7 @@ const _o = class _o {
|
|
|
1942
1942
|
isNaN(g) || (c[f] = g, a += g);
|
|
1943
1943
|
}), e.forEach((u) => {
|
|
1944
1944
|
const f = u.querySelectorAll("table");
|
|
1945
|
-
|
|
1945
|
+
v.log("====================", e, r), r === "body" ? f.forEach((g) => {
|
|
1946
1946
|
g.style.width = `${a}px`;
|
|
1947
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
1948
|
g.style.width = `${a}px`, g.style.minWidth = `${a}px`, g.style.maxWidth = `${a}px`, Object.entries(c).forEach(([b, m]) => {
|
|
@@ -1957,12 +1957,12 @@ const _o = class _o {
|
|
|
1957
1957
|
}
|
|
1958
1958
|
setColumnWidth(r, e, s = null) {
|
|
1959
1959
|
var a, c;
|
|
1960
|
-
|
|
1960
|
+
v.log("setColumnWidth");
|
|
1961
1961
|
let i = [];
|
|
1962
1962
|
if (i = Array.from(t(this, P).querySelectorAll(`table colgroup col[data-col="${r}"]`)), i.length === 0) return;
|
|
1963
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");
|
|
1964
1964
|
i.forEach((u) => {
|
|
1965
|
-
u.setAttribute("width", e), u.style.width = `${e}px`,
|
|
1965
|
+
u.setAttribute("width", e), u.style.width = `${e}px`, v.log(u, e);
|
|
1966
1966
|
});
|
|
1967
1967
|
const l = (a = t(this, P).sourceTable) == null ? void 0 : a.querySelector(`colgroup col[data-col="${r}"]`);
|
|
1968
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();
|
|
@@ -2052,7 +2052,7 @@ const Uo = class Uo {
|
|
|
2052
2052
|
const O = s.colSpan || 1;
|
|
2053
2053
|
g = o + O, b = u - l.left;
|
|
2054
2054
|
}
|
|
2055
|
-
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, S = x + w - 1, L = ((i = s.closest("tr")) == null ? void 0 : i.sectionRowIndex) ?? 0, C = s.rowSpan || 1, $ = L + C - 1, T = !(S < L || x > $);
|
|
2056
2056
|
let H = !1;
|
|
2057
2057
|
if (m.parentGroupRange) {
|
|
2058
2058
|
const { startCol: O, endCol: K } = m.parentGroupRange;
|
|
@@ -2064,7 +2064,7 @@ const Uo = class Uo {
|
|
|
2064
2064
|
for (const K of O) {
|
|
2065
2065
|
if (K === t(this, Jt)) continue;
|
|
2066
2066
|
const pt = ((n = K.closest("tr")) == null ? void 0 : n.sectionRowIndex) ?? 0, B = K.rowSpan || 1, os = pt + B - 1;
|
|
2067
|
-
if (!!(
|
|
2067
|
+
if (!!(S < pt || x > os)) continue;
|
|
2068
2068
|
const ae = parseInt(K.dataset.col, 10), Wi = K.colSpan || 1, ce = ae + Wi - 1;
|
|
2069
2069
|
if (g > ae && g < ce + 1) {
|
|
2070
2070
|
V = !0;
|
|
@@ -2096,7 +2096,7 @@ const Uo = class Uo {
|
|
|
2096
2096
|
t(this, G).addEventListener("pointerdown", t(this, ui));
|
|
2097
2097
|
}
|
|
2098
2098
|
moveColumn(r, e) {
|
|
2099
|
-
|
|
2099
|
+
v.log(t(this, G).sourceTable.cloneNode(!0));
|
|
2100
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));
|
|
2101
2101
|
if (!n || !n.isValidGroup) return;
|
|
2102
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;
|
|
@@ -2159,8 +2159,8 @@ G = new WeakMap(), z = new WeakMap(), tt = new WeakMap(), pe = new WeakMap(), Jt
|
|
|
2159
2159
|
const f = [];
|
|
2160
2160
|
if (o.querySelectorAll("thead th, thead td").forEach((y) => {
|
|
2161
2161
|
if (y.dataset.col === void 0) return;
|
|
2162
|
-
const x = parseInt(y.dataset.col, 10), w = y.colSpan || 1,
|
|
2163
|
-
if (n ? x >= s &&
|
|
2162
|
+
const x = parseInt(y.dataset.col, 10), w = y.colSpan || 1, S = x + w - 1;
|
|
2163
|
+
if (n ? x >= s && S <= i : y === r) {
|
|
2164
2164
|
const C = y.getBoundingClientRect();
|
|
2165
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);
|
|
2166
2166
|
const $ = window.getComputedStyle(y);
|
|
@@ -2169,8 +2169,8 @@ G = new WeakMap(), z = new WeakMap(), tt = new WeakMap(), pe = new WeakMap(), Jt
|
|
|
2169
2169
|
}), f.length === 0) return null;
|
|
2170
2170
|
const g = a - l, b = u - c, m = document.createElement("div");
|
|
2171
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
|
|
2173
|
-
|
|
2172
|
+
const S = y.cloneNode(!0);
|
|
2173
|
+
S.style.position = "absolute", S.style.left = `${x.left - l}px`, S.style.top = `${x.top - c}px`, S.style.width = `${x.width}px`, S.style.minWidth = `${x.width}px`, S.style.maxWidth = "none", S.style.height = `${x.height}px`, S.style.boxSizing = "border-box", S.style.margin = "0", S.style.backgroundColor = w.backgroundColor !== "transparent" && w.backgroundColor !== "rgba(0, 0, 0, 0)" ? w.backgroundColor : "#f9fafb", S.style.color = w.color, S.style.font = w.font, S.style.fontWeight = w.fontWeight, S.style.fontSize = w.fontSize, S.style.textAlign = w.textAlign, S.style.padding = w.padding, S.style.border = w.border, S.style.borderRight = w.borderRight, S.style.borderBottom = w.borderBottom, S.style.display = "flex", S.style.alignItems = "center", S.style.justifyContent = w.textAlign === "center" ? "center" : w.textAlign === "right" ? "flex-end" : "flex-start", m.appendChild(S);
|
|
2174
2174
|
}), {
|
|
2175
2175
|
element: m,
|
|
2176
2176
|
bounds: {
|
|
@@ -2276,8 +2276,8 @@ const Go = class Go {
|
|
|
2276
2276
|
["thead", "tbody", "tfoot"].forEach((m) => {
|
|
2277
2277
|
i.querySelectorAll(`${m} tr`).forEach((y, x) => {
|
|
2278
2278
|
Array.from(y.children).forEach((w) => {
|
|
2279
|
-
const
|
|
2280
|
-
T + $ - 1 < w.closest("tr").sectionRowIndex || T > w.closest("tr").sectionRowIndex + $ - 1, !(C < n ||
|
|
2279
|
+
const S = parseInt(w.dataset.col, 10), L = w.colSpan || 1, C = S + L - 1, $ = w.rowSpan || 1, T = y.sectionRowIndex ?? x;
|
|
2280
|
+
T + $ - 1 < w.closest("tr").sectionRowIndex || T > w.closest("tr").sectionRowIndex + $ - 1, !(C < n || S > l) && (g = Math.min(g, S));
|
|
2281
2281
|
});
|
|
2282
2282
|
});
|
|
2283
2283
|
}), c.forEach((m) => {
|
|
@@ -2291,13 +2291,13 @@ const Go = class Go {
|
|
|
2291
2291
|
Array.from(y.children).forEach((x) => {
|
|
2292
2292
|
const w = parseInt(x.dataset.col, 10);
|
|
2293
2293
|
if (isNaN(w)) return;
|
|
2294
|
-
const
|
|
2294
|
+
const S = c.find((C) => parseInt(C.getAttribute("data-col"), 10) === w), L = S == null ? void 0 : S.getAttribute("fixed");
|
|
2295
2295
|
L ? x.setAttribute("fixed", L) : x.removeAttribute("fixed");
|
|
2296
2296
|
});
|
|
2297
2297
|
});
|
|
2298
2298
|
});
|
|
2299
2299
|
}
|
|
2300
|
-
|
|
2300
|
+
v.log(t(this, be).sourceTable), (f = (u = t(this, be)).recompileAndRefresh) == null || f.call(u);
|
|
2301
2301
|
}
|
|
2302
2302
|
};
|
|
2303
2303
|
be = new WeakMap(), h(Go, "ColFixManager");
|
|
@@ -2314,8 +2314,8 @@ const jo = class jo extends HTMLElement {
|
|
|
2314
2314
|
d(this, _t);
|
|
2315
2315
|
E(this, "currentCol", null);
|
|
2316
2316
|
d(this, fr, /* @__PURE__ */ h(() => {
|
|
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")),
|
|
2318
|
-
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")), v.log("1***********************", t(this, ut)), setTimeout(() => {
|
|
2318
|
+
p(this, ee, t(this, ut).shadowRoot.querySelector("nine-table-sheet")), v.log("2***********************", t(this, ee));
|
|
2319
2319
|
}), this.querySelector(".search-box").addEventListener("focusin", (e) => {
|
|
2320
2320
|
e.stopPropagation();
|
|
2321
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));
|
|
@@ -2458,7 +2458,7 @@ const jo = class jo extends HTMLElement {
|
|
|
2458
2458
|
i.forEach((a) => {
|
|
2459
2459
|
const c = o >= 0 && a.v ? a.v[o] : "";
|
|
2460
2460
|
String(c).replace(/<[^>]*>?/gm, "").toLowerCase().includes(s) && l.push(c);
|
|
2461
|
-
}),
|
|
2461
|
+
}), v.log(l), t(this, ee).filtering.set({
|
|
2462
2462
|
DATA2: [...new Set(l)]
|
|
2463
2463
|
});
|
|
2464
2464
|
}
|
|
@@ -2514,8 +2514,8 @@ Ht = new WeakMap(), te = new WeakMap(), ut = new WeakMap(), ee = new WeakMap(),
|
|
|
2514
2514
|
// π‘ νλ©΄ μΆλ ₯ κΈ°μ€ (DATA2)
|
|
2515
2515
|
});
|
|
2516
2516
|
}
|
|
2517
|
-
const
|
|
2518
|
-
return
|
|
2517
|
+
const S = [...w.values()];
|
|
2518
|
+
return S.sort((L, C) => String(L.v2 || "").localeCompare(String(C.v2 || ""))), x.sort((L, C) => L > C ? 1 : -1), S.map((L) => ({
|
|
2519
2519
|
LVL: 2,
|
|
2520
2520
|
DATA: L.v,
|
|
2521
2521
|
// νν°λ§ λΉκ΅μ© κ°
|
|
@@ -2591,10 +2591,10 @@ const Yo = class Yo {
|
|
|
2591
2591
|
E(this, "clear", /* @__PURE__ */ h((r) => {
|
|
2592
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) => {
|
|
2593
2593
|
e.updateFilteredState();
|
|
2594
|
-
}),
|
|
2594
|
+
}), v.log(`π [NineTableFiltering] Filter cleared for ${r || "all"}`);
|
|
2595
2595
|
}, "clear"));
|
|
2596
2596
|
E(this, "set", /* @__PURE__ */ h((r) => {
|
|
2597
|
-
|
|
2597
|
+
v.log(r);
|
|
2598
2598
|
let e = Array.isArray(r) ? Object.fromEntries(Object.keys(r[0]).map((s) => [s, [...new Set(r.map((i) => i[s]))]])) : r;
|
|
2599
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);
|
|
2600
2600
|
}, "set"));
|
|
@@ -2673,7 +2673,7 @@ lt = new WeakMap(), bi = new WeakMap(), at = new WeakMap(), Ft = new WeakSet(),
|
|
|
2673
2673
|
}
|
|
2674
2674
|
});
|
|
2675
2675
|
});
|
|
2676
|
-
}),
|
|
2676
|
+
}), v.log("π― [NineTableSorting] Initialized");
|
|
2677
2677
|
}, "#initEvents"), Nl = /* @__PURE__ */ h(function(r, e) {
|
|
2678
2678
|
const s = e.dataset.col, i = e.closest("tr"), n = i ? i.dataset.subrow || String(i.sectionRowIndex) : "0";
|
|
2679
2679
|
if (s === void 0) return;
|
|
@@ -2705,7 +2705,7 @@ lt = new WeakMap(), bi = new WeakMap(), at = new WeakMap(), Ft = new WeakSet(),
|
|
|
2705
2705
|
console.warn("β οΈ [NineTableSorting] Sheet view (SheetView) is not initialized.");
|
|
2706
2706
|
return;
|
|
2707
2707
|
}
|
|
2708
|
-
t(this, lt).view.setSorting(t(this, at)), A(this, Ft, Qn).call(this), t(this, lt).invalidate(),
|
|
2708
|
+
t(this, lt).view.setSorting(t(this, at)), A(this, Ft, Qn).call(this), t(this, lt).invalidate(), v.log("π [NineTableSorting] Sorting applied via RowManager.refresh(true)");
|
|
2709
2709
|
}, "#applySorting"), Qn = /* @__PURE__ */ h(function() {
|
|
2710
2710
|
t(this, lt).querySelectorAll("thead th, thead td").forEach((r) => {
|
|
2711
2711
|
r.classList.remove("asc", "desc");
|
|
@@ -2787,7 +2787,7 @@ const Jo = class Jo {
|
|
|
2787
2787
|
if (!o) return;
|
|
2788
2788
|
const a = (u = (c = o.m) == null ? void 0 : c._) == null ? void 0 : u[jt.META.INDEX.FILTER];
|
|
2789
2789
|
a && a[t(this, Ge).index] === !1 || e.push(l);
|
|
2790
|
-
}),
|
|
2790
|
+
}), v.log(e), t(this, ye).length > 0 && (e = t(this, Ar).call(this, e, r)), p(this, mi, e);
|
|
2791
2791
|
const s = e.map((o) => r[o]), i = ((n = t(this, Ge).grouping) == null ? void 0 : n.columns) || [];
|
|
2792
2792
|
if (i.length > 0) {
|
|
2793
2793
|
const o = Hn.apply(s, i, t(this, mt).data.getHostFields());
|
|
@@ -2803,7 +2803,7 @@ const Jo = class Jo {
|
|
|
2803
2803
|
p(this, ye, []), this.refresh();
|
|
2804
2804
|
}, "resetSorting"));
|
|
2805
2805
|
d(this, Ar, /* @__PURE__ */ h((r, e) => {
|
|
2806
|
-
|
|
2806
|
+
v.log(/* @__PURE__ */ new Date());
|
|
2807
2807
|
const s = typeof t(this, mt).data.getHostFields == "function" ? t(this, mt).data.getHostFields() : [], i = t(this, ye).map((n) => ({
|
|
2808
2808
|
...n,
|
|
2809
2809
|
colIndex: s.indexOf(n.colname || n.colName)
|
|
@@ -2823,8 +2823,8 @@ const Jo = class Jo {
|
|
|
2823
2823
|
if (typeof g == "number" && typeof b == "number")
|
|
2824
2824
|
x = g - b;
|
|
2825
2825
|
else {
|
|
2826
|
-
const w = String(g),
|
|
2827
|
-
x = w >
|
|
2826
|
+
const w = String(g), S = String(b);
|
|
2827
|
+
x = w > S ? 1 : w < S ? -1 : 0;
|
|
2828
2828
|
}
|
|
2829
2829
|
if (x !== 0)
|
|
2830
2830
|
return u ? x : -x;
|
|
@@ -2955,9 +2955,9 @@ W = new WeakSet(), $l = /* @__PURE__ */ h(function(r) {
|
|
|
2955
2955
|
}, "#initFilterButtons"), _l = /* @__PURE__ */ h(function(r) {
|
|
2956
2956
|
r.querySelectorAll("thead th, thead td").forEach((e) => {
|
|
2957
2957
|
if (!(e.getAttribute("collapsible") === "true" || e.getAttribute("expandable") === "true")) return;
|
|
2958
|
-
|
|
2958
|
+
v.log("11.*******************************", e.dataset.col);
|
|
2959
2959
|
const i = parseInt(e.dataset.col, 10), n = e.colSpan || 1, o = r.querySelector(`colgroup col[data-col="${i}"]`);
|
|
2960
|
-
|
|
2960
|
+
v.log("11.*******************************", o);
|
|
2961
2961
|
const l = o && parseInt(o.getAttribute("width"), 10) || 100;
|
|
2962
2962
|
(!e.dataset.expandWidth || parseInt(e.dataset.expandWidth, 10) <= wn) && (e.dataset.expandWidth = String(l > wn ? l : 100));
|
|
2963
2963
|
let a = e.querySelector("nine-table-col-expand");
|
|
@@ -2982,7 +2982,7 @@ W = new WeakSet(), $l = /* @__PURE__ */ h(function(r) {
|
|
|
2982
2982
|
});
|
|
2983
2983
|
}, "#ensureRowIndicator"), Gl = /* @__PURE__ */ h(function(r) {
|
|
2984
2984
|
r.querySelectorAll("th[data-col], td[data-col]").forEach((e) => {
|
|
2985
|
-
|
|
2985
|
+
v.log(e);
|
|
2986
2986
|
const s = parseInt(e.getAttribute("data-col"), 10);
|
|
2987
2987
|
if (isNaN(s)) return;
|
|
2988
2988
|
const i = parseInt(e.getAttribute("colspan") || e.colSpan, 10) || 1;
|
|
@@ -3034,7 +3034,7 @@ const Ns = class Ns extends HTMLElement {
|
|
|
3034
3034
|
}, "autoFit"));
|
|
3035
3035
|
d(this, Cr, /* @__PURE__ */ h((e = !0) => {
|
|
3036
3036
|
var n;
|
|
3037
|
-
|
|
3037
|
+
v.log("***************** autoFit", this);
|
|
3038
3038
|
const s = this.querySelector(".ng-sheet-body .ng-container-body");
|
|
3039
3039
|
if (!s) return;
|
|
3040
3040
|
const i = this.querySelector(".ng-container-body table colgroup");
|
|
@@ -3048,30 +3048,30 @@ const Ns = class Ns extends HTMLElement {
|
|
|
3048
3048
|
i.querySelectorAll("col").forEach((f) => {
|
|
3049
3049
|
const g = f.getAttribute("data-col"), b = this.querySelector(`thead th[data-col="${g}"]`);
|
|
3050
3050
|
if ((b == null ? void 0 : b.getAttribute("collapsed")) === "true")
|
|
3051
|
-
a.unshift({ globalColIndex: g, width: 16, isCollapsed: !0 }),
|
|
3051
|
+
a.unshift({ globalColIndex: g, width: 16, isCollapsed: !0 }), v.log(`[AutoFit Col] Index ${g}: COLLAPSED (forced 16px)`);
|
|
3052
3052
|
else {
|
|
3053
3053
|
const y = parseInt(f.getAttribute("width"), 10) || 100;
|
|
3054
|
-
a.push({ globalColIndex: g, width: y, isCollapsed: !1 }), l += y,
|
|
3054
|
+
a.push({ globalColIndex: g, width: y, isCollapsed: !1 }), l += y, v.log(`[AutoFit Col] Index ${g}: NORMAL (original width: ${y}px)`);
|
|
3055
3055
|
}
|
|
3056
|
-
}),
|
|
3056
|
+
}), v.log(`[AutoFit] Total Original Width of Normal Cols: ${l}px`);
|
|
3057
3057
|
const c = a.filter((f) => f.isCollapsed).reduce((f, g) => f + g.width, 0), u = Math.max(0, o - c);
|
|
3058
|
-
if (
|
|
3058
|
+
if (v.log(`[AutoFit] Collapsed Total Width: ${c}px | Available Width for Normal Cols: ${u}px`), l > 0 && a.length > 0) {
|
|
3059
3059
|
let f = 0;
|
|
3060
3060
|
const g = a.map((x) => {
|
|
3061
3061
|
if (x.isCollapsed)
|
|
3062
3062
|
return { globalColIndex: x.globalColIndex, remainder: 0, width: 16 };
|
|
3063
|
-
const w = x.width * u / l,
|
|
3064
|
-
return f +=
|
|
3063
|
+
const w = x.width * u / l, S = Math.max(30, Math.floor(w));
|
|
3064
|
+
return f += S, {
|
|
3065
3065
|
globalColIndex: x.globalColIndex,
|
|
3066
3066
|
remainder: w - Math.floor(w),
|
|
3067
|
-
width:
|
|
3067
|
+
width: S
|
|
3068
3068
|
};
|
|
3069
3069
|
});
|
|
3070
3070
|
let b = u - f;
|
|
3071
|
-
|
|
3071
|
+
v.log(`[AutoFit] Initial Allocated Total: ${f}px | Remainder Pixels to distribute: ${b}`);
|
|
3072
3072
|
const m = g.filter((x) => {
|
|
3073
3073
|
var w;
|
|
3074
|
-
return !((w = a.find((
|
|
3074
|
+
return !((w = a.find((S) => S.globalColIndex === x.globalColIndex)) != null && w.isCollapsed);
|
|
3075
3075
|
});
|
|
3076
3076
|
if (b > 0 && m.length > 0) {
|
|
3077
3077
|
m.sort((x, w) => w.remainder - x.remainder);
|
|
@@ -3085,9 +3085,9 @@ const Ns = class Ns extends HTMLElement {
|
|
|
3085
3085
|
}
|
|
3086
3086
|
}
|
|
3087
3087
|
const y = g.reduce((x, w) => x + w.width, 0);
|
|
3088
|
-
|
|
3089
|
-
var
|
|
3090
|
-
|
|
3088
|
+
v.log(`[AutoFit Verification] Target Container Width: ${o}px | Sum of All Calculated Cols: ${y}px`), o !== y ? v.log(`β οΈ [AutoFit Mismatch Warning!] μ€μ°¨ λ°μ: ${o - y}px μ°¨μ΄κ° λ©λλ€.`) : v.log("β
[AutoFit Success] μλ²½νκ² μΌμΉν©λλ€!"), g.forEach(({ globalColIndex: x, width: w }) => {
|
|
3089
|
+
var S;
|
|
3090
|
+
v.log(`[AutoFit Apply] Col Index ${x} -> ${w}px`), (S = t(this, xe)) == null || S.setColumnWidth(x, w, "body");
|
|
3091
3091
|
});
|
|
3092
3092
|
}
|
|
3093
3093
|
} else
|
|
@@ -3096,7 +3096,7 @@ const Ns = class Ns extends HTMLElement {
|
|
|
3096
3096
|
}
|
|
3097
3097
|
}, "#autoFit"));
|
|
3098
3098
|
E(this, "generate", /* @__PURE__ */ h((e, s) => {
|
|
3099
|
-
p(this, xi, s), to.initializeTable(t(this, ie), e),
|
|
3099
|
+
p(this, xi, s), to.initializeTable(t(this, ie), e), v.log("=======", e), p(this, Ct, {
|
|
3100
3100
|
table: Ee.compile(e),
|
|
3101
3101
|
tbody: {
|
|
3102
3102
|
tr: e.querySelectorAll("tbody tr")
|
|
@@ -3161,12 +3161,12 @@ const Ns = class Ns extends HTMLElement {
|
|
|
3161
3161
|
s && (s.scrollTop = e);
|
|
3162
3162
|
}, "scrollToY"));
|
|
3163
3163
|
d(this, kr, /* @__PURE__ */ h(() => {
|
|
3164
|
-
|
|
3164
|
+
v.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", () => {
|
|
3165
3165
|
this.querySelector("nine-table-hscrollbar").refresh();
|
|
3166
3166
|
});
|
|
3167
3167
|
}, "#init"));
|
|
3168
3168
|
d(this, Ir, /* @__PURE__ */ h(() => {
|
|
3169
|
-
|
|
3169
|
+
v.log("11111*****************"), Ns.SCROLLBAR_SIZE, v.log("2222*****************"), this.innerHTML = `
|
|
3170
3170
|
<div class="ng-sheet-body">
|
|
3171
3171
|
<div class="ng-sheet-body-content">
|
|
3172
3172
|
<div class="ng-container-left"></div>
|
|
@@ -3196,16 +3196,16 @@ const Ns = class Ns extends HTMLElement {
|
|
|
3196
3196
|
|
|
3197
3197
|
<div class="ng-col-mover-grip"></div>
|
|
3198
3198
|
<div class="ng-col-mover-indi"></div>
|
|
3199
|
-
`,
|
|
3199
|
+
`, v.log("3333*****************"), p(this, Ke, {
|
|
3200
3200
|
mainBody: this.querySelector(".ng-sheet-body .ng-container-body"),
|
|
3201
3201
|
hscrollbar: this.querySelector("nine-table-hscrollbar"),
|
|
3202
3202
|
vscrollbar: this.querySelector("nine-table-vscrollbar"),
|
|
3203
3203
|
content: this.querySelector(".ng-sheet-body .ng-sheet-body-content"),
|
|
3204
3204
|
scrollHolder: this.querySelector(".ng-sheet-body .ng-virtual-height-holder")
|
|
3205
|
-
}),
|
|
3205
|
+
}), v.log("444*****************");
|
|
3206
3206
|
}, "#render"));
|
|
3207
3207
|
d(this, qr, /* @__PURE__ */ h(() => {
|
|
3208
|
-
|
|
3208
|
+
v.log("**********************", "#syncHeaderAndFooterHeights");
|
|
3209
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)"));
|
|
3210
3210
|
t(this, Ri).call(this, n, o, l);
|
|
3211
3211
|
const a = Array.from(e.querySelectorAll("tfoot tr")), c = Array.from(s.querySelectorAll("tfoot tr")), u = Array.from(i.querySelectorAll("tfoot tr"));
|
|
@@ -3244,7 +3244,7 @@ const Ns = class Ns extends HTMLElement {
|
|
|
3244
3244
|
}), s = null);
|
|
3245
3245
|
});
|
|
3246
3246
|
}, "#initRowHoverEvent"));
|
|
3247
|
-
|
|
3247
|
+
v.log("11111"), p(this, Nt, new Wn(this)), v.log("222"), p(this, ie, this.getRootNode().host), v.log("333");
|
|
3248
3248
|
}
|
|
3249
3249
|
connectedCallback() {
|
|
3250
3250
|
t(this, kr).call(this);
|
|
@@ -3345,10 +3345,12 @@ const Qo = class Qo {
|
|
|
3345
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) => {
|
|
3346
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>` : "";
|
|
3347
3347
|
return b + m;
|
|
3348
|
-
}).join("")
|
|
3348
|
+
}).join("");
|
|
3349
|
+
v.log("Welcome nine-table", "0.1.47");
|
|
3350
|
+
const o = [
|
|
3349
3351
|
"_nine-table"
|
|
3350
3352
|
], l = [
|
|
3351
|
-
'@import "https://cdn.jsdelivr.net/npm/@ninebone/table@0.1.
|
|
3353
|
+
'@import "https://cdn.jsdelivr.net/npm/@ninebone/table@0.1.47/dist/css/nine-table.css";'
|
|
3352
3354
|
], a = [];
|
|
3353
3355
|
nine.cssPath && o.forEach((c) => {
|
|
3354
3356
|
a.push(`@import "${nine.cssPath}/${c}.css";`);
|
|
@@ -3480,7 +3482,7 @@ const el = class el extends HTMLElement {
|
|
|
3480
3482
|
});
|
|
3481
3483
|
}
|
|
3482
3484
|
disconnectedCallback() {
|
|
3483
|
-
|
|
3485
|
+
v.log("NineTable disconnected.");
|
|
3484
3486
|
}
|
|
3485
3487
|
// π― κ³΅ν΅ λ°μ΄ν° & API μ κ·Όμ
|
|
3486
3488
|
get shadow() {
|
|
@@ -3576,9 +3578,9 @@ const sl = class sl extends io {
|
|
|
3576
3578
|
d(this, q);
|
|
3577
3579
|
d(this, Ze);
|
|
3578
3580
|
E(this, "getDisplayText", /* @__PURE__ */ h((e = "") => {
|
|
3579
|
-
if (
|
|
3581
|
+
if (v.log("================================="), !t(this, q) || !t(this, q).closest("tbody")) return e;
|
|
3580
3582
|
const s = t(this, ct).data;
|
|
3581
|
-
if (
|
|
3583
|
+
if (v.log("==============================", s), !s) return e;
|
|
3582
3584
|
const i = t(this, q).dataset.expr, n = t(this, q).dataset.bind, o = parseInt(t(this, q).dataset.row, 10);
|
|
3583
3585
|
if (i)
|
|
3584
3586
|
try {
|
|
@@ -3586,7 +3588,7 @@ const sl = class sl extends io {
|
|
|
3586
3588
|
} catch (l) {
|
|
3587
3589
|
return console.trace(l), e;
|
|
3588
3590
|
}
|
|
3589
|
-
if (
|
|
3591
|
+
if (v.log("==============================", n, this.value), n) {
|
|
3590
3592
|
const l = this.value;
|
|
3591
3593
|
return l ?? e;
|
|
3592
3594
|
}
|
|
@@ -3605,24 +3607,24 @@ const sl = class sl extends io {
|
|
|
3605
3607
|
return t(this, I)[g].call(this, s, i, n);
|
|
3606
3608
|
const b = g.match(/^(\w+)\s*\(\s*([\w\-]*)\s*\)/);
|
|
3607
3609
|
if (b) {
|
|
3608
|
-
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,
|
|
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, S] = b, L = t(this, I);
|
|
3609
3611
|
switch (w.toLowerCase()) {
|
|
3610
3612
|
case "count":
|
|
3611
3613
|
return x.length;
|
|
3612
3614
|
case "sum": {
|
|
3613
|
-
const C = ((c = (a = L == null ? void 0 : L.fields) == null ? void 0 : a.indexOf) == null ? void 0 : c.call(a,
|
|
3615
|
+
const C = ((c = (a = L == null ? void 0 : L.fields) == null ? void 0 : a.indexOf) == null ? void 0 : c.call(a, S)) ?? -1;
|
|
3614
3616
|
return x.reduce(($, T) => {
|
|
3615
3617
|
var V;
|
|
3616
|
-
const H = C >= 0 ? (V = T.v) == null ? void 0 : V[C] : T[
|
|
3618
|
+
const H = C >= 0 ? (V = T.v) == null ? void 0 : V[C] : T[S];
|
|
3617
3619
|
return $ + (Number(H) || 0);
|
|
3618
3620
|
}, 0);
|
|
3619
3621
|
}
|
|
3620
3622
|
case "avg": {
|
|
3621
3623
|
if (x.length === 0) return 0;
|
|
3622
|
-
const C = ((f = (u = L == null ? void 0 : L.fields) == null ? void 0 : u.indexOf) == null ? void 0 : f.call(u,
|
|
3624
|
+
const C = ((f = (u = L == null ? void 0 : L.fields) == null ? void 0 : u.indexOf) == null ? void 0 : f.call(u, S)) ?? -1;
|
|
3623
3625
|
return x.reduce((T, H) => {
|
|
3624
3626
|
var Q;
|
|
3625
|
-
const V = C >= 0 ? (Q = H.v) == null ? void 0 : Q[C] : H[
|
|
3627
|
+
const V = C >= 0 ? (Q = H.v) == null ? void 0 : Q[C] : H[S];
|
|
3626
3628
|
return T + (Number(V) || 0);
|
|
3627
3629
|
}, 0) / x.length;
|
|
3628
3630
|
}
|
|
@@ -4481,8 +4483,8 @@ const cl = class cl extends le {
|
|
|
4481
4483
|
var s;
|
|
4482
4484
|
if (!super.sheet || !super.cell) return;
|
|
4483
4485
|
const e = (s = super.cell) == null ? void 0 : s.getAttribute("data-source");
|
|
4484
|
-
if (e && (p(this, Dt, super.getExprValue(e, super.tr.data, super.tr.dataset.row)),
|
|
4485
|
-
|
|
4486
|
+
if (e && (p(this, Dt, super.getExprValue(e, super.tr.data, super.tr.dataset.row)), v.log("=============================================="), v.log(this.sheet, t(this, Dt)), setTimeout(() => {
|
|
4487
|
+
v.log("1111");
|
|
4486
4488
|
}, 300), t(this, ts).replaceChildren(), t(this, Dt) && Array.isArray(t(this, Dt)))) {
|
|
4487
4489
|
const i = document.createDocumentFragment();
|
|
4488
4490
|
t(this, Dt).forEach((n) => {
|
|
@@ -4658,7 +4660,7 @@ const hl = class hl extends HTMLElement {
|
|
|
4658
4660
|
a ? c = a.split(",").map((g) => g.trim()) : c = [i].filter(Boolean);
|
|
4659
4661
|
const u = c.length;
|
|
4660
4662
|
l.shadowRoot.querySelector(".ng-container-left").style.display = n ? "" : "none", l.shadowRoot.querySelectorAll("table colgroup col, tbody td").forEach((g, b) => {
|
|
4661
|
-
|
|
4663
|
+
v.log(g);
|
|
4662
4664
|
const m = parseInt(g.dataset.col, 10);
|
|
4663
4665
|
m >= 2 && (g.style.display = m - 2 >= u ? "none" : "");
|
|
4664
4666
|
});
|
|
@@ -4679,7 +4681,7 @@ const hl = class hl extends HTMLElement {
|
|
|
4679
4681
|
}
|
|
4680
4682
|
}, "#initData"));
|
|
4681
4683
|
E(this, "open", /* @__PURE__ */ h((e, s, i, n, o, l) => {
|
|
4682
|
-
p(this, nt, e), p(this, Jr, i), p(this, Qr, n), p(this, Ls, !0),
|
|
4684
|
+
p(this, nt, e), p(this, Jr, i), p(this, Qr, n), p(this, Ls, !0), v.log(/* @__PURE__ */ new Date()), this.classList.add("active");
|
|
4683
4685
|
const a = this.querySelector("nine-table-simple");
|
|
4684
4686
|
if (!a || !s) return;
|
|
4685
4687
|
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");
|
|
@@ -4692,12 +4694,12 @@ const hl = class hl extends HTMLElement {
|
|
|
4692
4694
|
const w = f.top - g.top - x - 2;
|
|
4693
4695
|
w >= 0 ? m = w : m = Math.max(0, g.height - x - 5);
|
|
4694
4696
|
}
|
|
4695
|
-
this.style.left = `${b}px`, this.style.top = `${m}px`,
|
|
4696
|
-
|
|
4697
|
+
this.style.left = `${b}px`, this.style.top = `${m}px`, v.log(/* @__PURE__ */ new Date()), setTimeout(() => {
|
|
4698
|
+
v.log(/* @__PURE__ */ new Date()), t(this, tn).call(this, s, i, n, o, l), v.log(/* @__PURE__ */ new Date());
|
|
4697
4699
|
const w = a.shadowRoot.querySelector(".ng-container-body table tbody.body");
|
|
4698
|
-
w.__hasClickEvent || (w.addEventListener("mousedown", (
|
|
4699
|
-
|
|
4700
|
-
}), w.__hasClickEvent = !0),
|
|
4700
|
+
w.__hasClickEvent || (w.addEventListener("mousedown", (S) => {
|
|
4701
|
+
v.log("==========================================", S.target), S.target.closest("tr") && (v.log("==========================================", o), o || t(this, en).call(this, S));
|
|
4702
|
+
}), w.__hasClickEvent = !0), v.log(/* @__PURE__ */ new Date());
|
|
4701
4703
|
}, 100);
|
|
4702
4704
|
}, "open"));
|
|
4703
4705
|
E(this, "close", /* @__PURE__ */ h(() => {
|
|
@@ -4871,7 +4873,7 @@ const dl = class dl extends le {
|
|
|
4871
4873
|
d(this, Se);
|
|
4872
4874
|
d(this, kt);
|
|
4873
4875
|
E(this, "rerenderer", /* @__PURE__ */ h(() => {
|
|
4874
|
-
|
|
4876
|
+
v.log("rerenderer"), t(this, Hi).call(this), this.refresh();
|
|
4875
4877
|
}, "rerenderer"));
|
|
4876
4878
|
d(this, Hi, /* @__PURE__ */ h(() => {
|
|
4877
4879
|
var s;
|
|
@@ -4889,7 +4891,7 @@ const dl = class dl extends le {
|
|
|
4889
4891
|
});
|
|
4890
4892
|
}, "#initEvent"));
|
|
4891
4893
|
d(this, Ni, /* @__PURE__ */ h(() => {
|
|
4892
|
-
|
|
4894
|
+
v.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)))), v.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)), v.log(/* @__PURE__ */ new Date());
|
|
4893
4895
|
}, "#togglePanel"));
|
|
4894
4896
|
d(this, cn, /* @__PURE__ */ h(() => {
|
|
4895
4897
|
this.innerHTML = `
|