@ninebone/table 0.0.308 → 0.0.309
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 +91 -91
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +5 -5
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -44,21 +44,21 @@ const Xt = class Xt extends HTMLElement {
|
|
|
44
44
|
if (!t(this, M) || !t(this, y) || t(this, _)) return;
|
|
45
45
|
const e = t(this, y).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const n = t(this, y).track, o = t(this, y).thumb, r = t(this, M).querySelector(".ng-container-bottom"), l = e.clientWidth,
|
|
48
|
-
if (l !== 0 &&
|
|
47
|
+
const n = t(this, y).track, o = t(this, y).thumb, r = t(this, M).querySelector(".ng-container-bottom"), l = e.clientWidth, c = s.scrollWidth;
|
|
48
|
+
if (l !== 0 && c > l)
|
|
49
49
|
r && (r.style.display = "flex");
|
|
50
50
|
else {
|
|
51
51
|
r && (r.style.display = "none");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
56
|
-
const u = Math.max(Math.min(
|
|
54
|
+
const h = n.clientWidth;
|
|
55
|
+
if (h <= 0) return;
|
|
56
|
+
const u = Math.max(Math.min(h * (l / c), h), 20);
|
|
57
57
|
o.style.width = `${u}px`;
|
|
58
|
-
const f = e.scrollLeft, g =
|
|
58
|
+
const f = e.scrollLeft, g = c - l;
|
|
59
59
|
let p = 0;
|
|
60
|
-
g > 0 && (p = parseInt(f / g * (
|
|
61
|
-
const E =
|
|
60
|
+
g > 0 && (p = parseInt(f / g * (h - u), 10)), p < 0 && (p = 0);
|
|
61
|
+
const E = h - u;
|
|
62
62
|
p > E && (p = E), o.style.left = `${p}px`, A.log(p), t(this, y).left.disabled = p === 0, t(this, y).right.disabled = p >= E - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
64
|
d(this, Y, /* @__PURE__ */ a((e) => {
|
|
@@ -68,10 +68,10 @@ const Xt = class Xt extends HTMLElement {
|
|
|
68
68
|
const o = t(this, y).track.getBoundingClientRect(), r = t(this, y).thumb.clientWidth;
|
|
69
69
|
let l = e;
|
|
70
70
|
l < 0 && (l = 0);
|
|
71
|
-
const
|
|
72
|
-
l >
|
|
73
|
-
const
|
|
74
|
-
return
|
|
71
|
+
const c = o.width - r;
|
|
72
|
+
l > c && (l = c), l = parseInt(l, 10), t(this, y).thumb.style.left = `${l}px`, t(this, y).left.disabled = l === 0, t(this, y).right.disabled = l >= c - 1;
|
|
73
|
+
const h = s.clientWidth, f = n.scrollWidth - h;
|
|
74
|
+
return c > 0 && f > 0 && (s.scrollLeft = l / c * f), l > 0 && l < c - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
76
|
d(this, ft, /* @__PURE__ */ a(() => {
|
|
77
77
|
const e = /* @__PURE__ */ a((n) => {
|
|
@@ -102,8 +102,8 @@ const Xt = class Xt extends HTMLElement {
|
|
|
102
102
|
n.stopPropagation(), n.preventDefault(), b(this, _, !0), this.shiftX = n.clientX - t(this, y).thumb.getBoundingClientRect().left;
|
|
103
103
|
const o = /* @__PURE__ */ a((l) => {
|
|
104
104
|
if (!t(this, _)) return;
|
|
105
|
-
const
|
|
106
|
-
t(this, Y).call(this, l.clientX -
|
|
105
|
+
const c = t(this, y).track.getBoundingClientRect();
|
|
106
|
+
t(this, Y).call(this, l.clientX - c.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), r = /* @__PURE__ */ a(() => {
|
|
108
108
|
b(this, _, !1), s(), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", r), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
@@ -223,43 +223,43 @@ const Ut = class Ut extends HTMLElement {
|
|
|
223
223
|
return;
|
|
224
224
|
} else
|
|
225
225
|
o.style.display = "block";
|
|
226
|
-
const
|
|
227
|
-
if (
|
|
228
|
-
const
|
|
229
|
-
o.style.height = `${
|
|
226
|
+
const c = n.clientHeight;
|
|
227
|
+
if (c <= 0) return;
|
|
228
|
+
const h = Math.max(Math.min(c * (r / l), c), 20);
|
|
229
|
+
o.style.height = `${h}px`;
|
|
230
230
|
const u = e.scrollTop, f = l - r;
|
|
231
231
|
let g = 0;
|
|
232
|
-
f > 0 && (g = u / f * (
|
|
233
|
-
const p =
|
|
232
|
+
f > 0 && (g = u / f * (c - h));
|
|
233
|
+
const p = c - h;
|
|
234
234
|
g < 0 && (g = 0), g > p && (g = p), o.style.top = `${g}px`, t(this, S).top.disabled = u <= 0, t(this, S).bottom.disabled = u >= f - 1;
|
|
235
235
|
}, "refresh"));
|
|
236
236
|
d(this, ut, /* @__PURE__ */ a(() => {
|
|
237
|
-
const e = t(this, S).container
|
|
237
|
+
const e = t(this, S).container;
|
|
238
238
|
e.addEventListener("scroll", () => {
|
|
239
239
|
t(this, I) || this.refresh();
|
|
240
|
-
}), t(this, S).thumb.addEventListener("mousedown", (
|
|
241
|
-
if (
|
|
242
|
-
|
|
243
|
-
const
|
|
240
|
+
}), t(this, S).thumb.addEventListener("mousedown", (s) => {
|
|
241
|
+
if (s.button !== 0) return;
|
|
242
|
+
s.stopPropagation(), s.preventDefault(), b(this, I, !0), b(this, it, s.clientY), b(this, st, e.scrollTop);
|
|
243
|
+
const n = /* @__PURE__ */ a((r) => {
|
|
244
244
|
if (!t(this, I)) return;
|
|
245
|
-
const
|
|
246
|
-
A.log(
|
|
247
|
-
const k =
|
|
248
|
-
if (
|
|
249
|
-
const D =
|
|
245
|
+
const l = t(this, S).track.getBoundingClientRect(), c = t(this, S).thumb.clientHeight, u = l.height - c, f = r.clientY - t(this, it), g = e.clientHeight, p = e.querySelector("table");
|
|
246
|
+
A.log(p), A.log(p.scrollHeight);
|
|
247
|
+
const k = p.scrollHeight - g;
|
|
248
|
+
if (u > 0 && k > 0) {
|
|
249
|
+
const D = f / u * k;
|
|
250
250
|
e.scrollTop = t(this, st) + D;
|
|
251
251
|
}
|
|
252
252
|
this.refresh();
|
|
253
|
-
}, "onMouseMove"),
|
|
254
|
-
b(this, I, !1), document.removeEventListener("mousemove",
|
|
253
|
+
}, "onMouseMove"), o = /* @__PURE__ */ a(() => {
|
|
254
|
+
b(this, I, !1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), this.refresh();
|
|
255
255
|
}, "onMouseUp");
|
|
256
|
-
document.addEventListener("mousemove",
|
|
257
|
-
}), t(this, S).track.addEventListener("mousedown", (
|
|
258
|
-
if (
|
|
259
|
-
const
|
|
260
|
-
if (c > 0 &&
|
|
261
|
-
const
|
|
262
|
-
e.scrollTop =
|
|
256
|
+
document.addEventListener("mousemove", n), document.addEventListener("mouseup", o);
|
|
257
|
+
}), t(this, S).track.addEventListener("mousedown", (s) => {
|
|
258
|
+
if (s.button !== 0 || s.target === t(this, S).thumb) return;
|
|
259
|
+
const n = t(this, S).track.getBoundingClientRect(), o = t(this, S).thumb.clientHeight, r = s.clientY - n.top - o / 2, c = n.height - o, h = e.clientHeight, f = e.querySelector("table").scrollHeight - h;
|
|
260
|
+
if (c > 0 && f > 0) {
|
|
261
|
+
const g = Math.max(0, Math.min(1, r / c));
|
|
262
|
+
e.scrollTop = g * f;
|
|
263
263
|
}
|
|
264
264
|
this.refresh();
|
|
265
265
|
}), t(this, S).top.addEventListener("click", () => {
|
|
@@ -369,9 +369,9 @@ const C = class C {
|
|
|
369
369
|
var n, o, r, l;
|
|
370
370
|
if (!i) return null;
|
|
371
371
|
const e = i.cloneNode(!0);
|
|
372
|
-
return t(n = C, gt).call(n, e), t(o = C, F).call(o, e, "thead"), t(r = C, F).call(r, e, "tbody"), t(l = C, F).call(l, e, "tfoot"), Array.from(e.querySelectorAll("colgroup col")).forEach((
|
|
373
|
-
const u =
|
|
374
|
-
u && e.querySelectorAll(`thead [data-col="${
|
|
372
|
+
return t(n = C, gt).call(n, e), t(o = C, F).call(o, e, "thead"), t(r = C, F).call(r, e, "tbody"), t(l = C, F).call(l, e, "tfoot"), Array.from(e.querySelectorAll("colgroup col")).forEach((c, h) => {
|
|
373
|
+
const u = c.getAttribute("fixed");
|
|
374
|
+
u && e.querySelectorAll(`thead [data-col="${h}"], tbody [data-col="${h}"], tfoot [data-col="${h}"]`).forEach((f) => {
|
|
375
375
|
f.setAttribute("fixed", u);
|
|
376
376
|
});
|
|
377
377
|
}), e;
|
|
@@ -395,30 +395,30 @@ gt = new WeakMap(), F = new WeakMap(), a(C, "TableCompiler"), d(C, gt, /* @__PUR
|
|
|
395
395
|
const s = Array.from(i.querySelectorAll(e + " tr")), n = Array.from(i.querySelectorAll(e + " th," + e + " td")), o = s.length;
|
|
396
396
|
if (o === 0 || n.length === 0) return;
|
|
397
397
|
let r = 0;
|
|
398
|
-
n.forEach((
|
|
399
|
-
r +=
|
|
398
|
+
n.forEach((c) => {
|
|
399
|
+
r += c.colSpan || 1;
|
|
400
400
|
});
|
|
401
401
|
const l = Array.from(Array(o), () => Array(r).fill(null));
|
|
402
|
-
s.forEach((
|
|
403
|
-
const
|
|
402
|
+
s.forEach((c) => {
|
|
403
|
+
const h = c.sectionRowIndex;
|
|
404
404
|
let u = 0;
|
|
405
|
-
Array.from(
|
|
406
|
-
for (let E = 0; E < l[
|
|
407
|
-
if (l[
|
|
405
|
+
Array.from(c.querySelectorAll("th,td")).forEach((f) => {
|
|
406
|
+
for (let E = 0; E < l[h].length; E++)
|
|
407
|
+
if (l[h][E] === null) {
|
|
408
408
|
u = E;
|
|
409
409
|
break;
|
|
410
410
|
}
|
|
411
411
|
const g = f.rowSpan || 1, p = f.colSpan || 1;
|
|
412
412
|
for (let E = 0; E < g; E++)
|
|
413
413
|
for (let k = 0; k < p; k++)
|
|
414
|
-
|
|
414
|
+
h + E < o && u + k < r && (l[h + E][u + k] = E === 0 && k === 0 ? "1" : "0");
|
|
415
415
|
});
|
|
416
|
-
}), s.forEach((
|
|
417
|
-
const
|
|
418
|
-
Array.from(
|
|
419
|
-
for (let f = 0; f < l[
|
|
420
|
-
if (l[
|
|
421
|
-
u.dataset.col = f, l[
|
|
416
|
+
}), s.forEach((c) => {
|
|
417
|
+
const h = c.sectionRowIndex;
|
|
418
|
+
Array.from(c.querySelectorAll("th,td")).forEach((u) => {
|
|
419
|
+
for (let f = 0; f < l[h].length; f++)
|
|
420
|
+
if (l[h][f] === "1") {
|
|
421
|
+
u.dataset.col = f, l[h][f] = "0";
|
|
422
422
|
break;
|
|
423
423
|
}
|
|
424
424
|
});
|
|
@@ -455,7 +455,7 @@ const Kt = class Kt {
|
|
|
455
455
|
if (!n) return;
|
|
456
456
|
const o = n.querySelector("tbody");
|
|
457
457
|
if (!o) return;
|
|
458
|
-
const l = Array.from(o.querySelectorAll("tr")).map((
|
|
458
|
+
const l = Array.from(o.querySelectorAll("tr")).map((c) => c.cloneNode(!0));
|
|
459
459
|
t(this, $).set(e, l);
|
|
460
460
|
});
|
|
461
461
|
const i = t(this, m).querySelector(".ng-container-body");
|
|
@@ -477,8 +477,8 @@ const Kt = class Kt {
|
|
|
477
477
|
n.querySelectorAll("tr:not(.nodata)").forEach((l) => l.remove());
|
|
478
478
|
const o = n.querySelector("tr.nodata"), r = document.createDocumentFragment();
|
|
479
479
|
for (let l = 0; l < t(this, U); l++)
|
|
480
|
-
s.forEach((
|
|
481
|
-
r.appendChild(
|
|
480
|
+
s.forEach((c) => {
|
|
481
|
+
r.appendChild(c.cloneNode(!0));
|
|
482
482
|
});
|
|
483
483
|
o ? o.before(r) : n.appendChild(r);
|
|
484
484
|
}, "#renderRows"));
|
|
@@ -497,13 +497,13 @@ const Kt = class Kt {
|
|
|
497
497
|
e.forEach((g) => {
|
|
498
498
|
o.appendChild(g.cloneNode(!0));
|
|
499
499
|
}), n ? n.before(o) : s.appendChild(o);
|
|
500
|
-
const r = t(this, m), l = r.style.display,
|
|
500
|
+
const r = t(this, m), l = r.style.display, c = r.style.visibility, h = r.style.position;
|
|
501
501
|
(l === "none" || window.getComputedStyle(r).display === "none") && (r.style.display = "block", r.style.visibility = "hidden", r.style.position = "absolute");
|
|
502
502
|
let u = 0;
|
|
503
503
|
const f = s.querySelectorAll("tr:not(.nodata)");
|
|
504
504
|
return f.forEach((g) => {
|
|
505
505
|
u += g.offsetHeight || g.getBoundingClientRect().height;
|
|
506
|
-
}), f.forEach((g) => g.remove()), r.style.display = l, r.style.visibility =
|
|
506
|
+
}), f.forEach((g) => g.remove()), r.style.display = l, r.style.visibility = c, r.style.position = h, b(this, R, u > 0 ? u : 24), t(this, ot).call(this), A.log(`[RowManager] Height Cached: ${t(this, R)}px | RowCount: ${t(this, U)}`), t(this, R);
|
|
507
507
|
}, "#measureAndCacheHeight"));
|
|
508
508
|
/**
|
|
509
509
|
* 🎯 전체 데이터 개수 기반으로 가상 스크롤 높이 설정
|
|
@@ -512,12 +512,12 @@ const Kt = class Kt {
|
|
|
512
512
|
* 🎯 전체 데이터 개수 기반으로 가상 스크롤 높이 설정
|
|
513
513
|
*/
|
|
514
514
|
d(this, nt, /* @__PURE__ */ a(() => {
|
|
515
|
-
var o, r, l,
|
|
515
|
+
var o, r, l, c;
|
|
516
516
|
if (!t(this, m).querySelector(".ng-container-body")) return;
|
|
517
|
-
const e = (typeof ((o = t(this, m).data) == null ? void 0 : o.count) == "function" ? t(this, m).data.count() : null) ?? ((l = (r = t(this, m).dataManager) == null ? void 0 : r.rawRecords) == null ? void 0 : l.length) ?? ((
|
|
518
|
-
A.log(`[RowManager] TotalCount: ${e} | RowHeight: ${s}px | TotalVirtualHeight: ${n}px`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
519
|
-
const u = t(this, m).querySelector(
|
|
520
|
-
f ? (f.style.height = `${n}px`, A.log(`[RowManager] Applied height to ${
|
|
517
|
+
const e = (typeof ((o = t(this, m).data) == null ? void 0 : o.count) == "function" ? t(this, m).data.count() : null) ?? ((l = (r = t(this, m).dataManager) == null ? void 0 : r.rawRecords) == null ? void 0 : l.length) ?? ((c = t(this, m).data) == null ? void 0 : c.length) ?? 0, s = t(this, R) || 24, n = e * s;
|
|
518
|
+
A.log(`[RowManager] TotalCount: ${e} | RowHeight: ${s}px | TotalVirtualHeight: ${n}px`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((h) => {
|
|
519
|
+
const u = t(this, m).querySelector(h), f = u == null ? void 0 : u.querySelector("table");
|
|
520
|
+
f ? (f.style.height = `${n}px`, A.log(`[RowManager] Applied height to ${h} table:`, f.style.height)) : A.log(`[RowManager] Table not found for selector: ${h}`);
|
|
521
521
|
});
|
|
522
522
|
}, "#updateVirtualScrollHeight"));
|
|
523
523
|
d(this, ot, /* @__PURE__ */ a(() => {
|
|
@@ -528,14 +528,14 @@ const Kt = class Kt {
|
|
|
528
528
|
b(this, U, 40);
|
|
529
529
|
}, "#updateRowCount"));
|
|
530
530
|
d(this, yt, /* @__PURE__ */ a(() => {
|
|
531
|
-
var
|
|
531
|
+
var c, h, u;
|
|
532
532
|
const i = t(this, m).querySelector(".ng-container-left table"), e = t(this, m).querySelector(".ng-container-body table"), s = t(this, m).querySelector(".ng-container-right table");
|
|
533
533
|
if (!e) return;
|
|
534
534
|
const n = i ? Array.from(i.querySelectorAll("tr")) : [], o = Array.from(e.querySelectorAll("tr")), r = s ? Array.from(s.querySelectorAll("tr")) : [], l = Math.max(n.length, o.length, r.length);
|
|
535
535
|
for (let f = 0; f < l; f++) {
|
|
536
536
|
const g = [
|
|
537
|
-
((
|
|
538
|
-
((
|
|
537
|
+
((c = n[f]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
538
|
+
((h = o[f]) == null ? void 0 : h.getBoundingClientRect().height) || 0,
|
|
539
539
|
((u = r[f]) == null ? void 0 : u.getBoundingClientRect().height) || 0
|
|
540
540
|
], p = Math.max(...g);
|
|
541
541
|
p > 0 && (n[f] && (n[f].style.height = `${p}px`), o[f] && (o[f].style.height = `${p}px`), r[f] && (r[f].style.height = `${p}px`));
|
|
@@ -589,14 +589,14 @@ const Kt = class Kt {
|
|
|
589
589
|
A.log(`[RowManager] ScrollTop: ${i} | StartIndex: ${s} | OffsetY: ${n}px`);
|
|
590
590
|
const o = ((r = t(this, $).get(".ng-container-body")) == null ? void 0 : r.length) || 1;
|
|
591
591
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((l) => {
|
|
592
|
-
const
|
|
593
|
-
if (!
|
|
594
|
-
const
|
|
595
|
-
if (!
|
|
592
|
+
const c = t(this, m).querySelector(l);
|
|
593
|
+
if (!c) return;
|
|
594
|
+
const h = c.querySelector("tbody");
|
|
595
|
+
if (!h) {
|
|
596
596
|
A.log(`[RowManager] tbody not found for selector: ${l}`);
|
|
597
597
|
return;
|
|
598
598
|
}
|
|
599
|
-
window.getComputedStyle(
|
|
599
|
+
window.getComputedStyle(h).position === "static" && (h.style.position = "relative"), h.style.transform = `translateY(-${n}px)`, h.style.willChange = "transform", Array.from(h.querySelectorAll("tr:not(.nodata)")).forEach((f, g) => {
|
|
600
600
|
var k, D, Qt, te;
|
|
601
601
|
const p = s + Math.floor(g / o), E = (typeof t(this, m).getData == "function" ? t(this, m).getData(p) : null) ?? (typeof ((k = t(this, m).data) == null ? void 0 : k.get) == "function" ? t(this, m).data.get(p) : null) ?? ((Qt = (D = t(this, m).dataManager) == null ? void 0 : D.rawRecords) == null ? void 0 : Qt[p]) ?? ((te = t(this, m).data) == null ? void 0 : te[p]) ?? null;
|
|
602
602
|
E ? (f.style.display = "", t(this, xt).call(this, f, E, p)) : f.style.display = "none";
|
|
@@ -857,12 +857,12 @@ const jt = class jt extends HTMLElement {
|
|
|
857
857
|
const E = parseInt(p.getAttribute("data-index"), 10), k = this.querySelector(`nine-splitter[data-split-index="${E}"]`), D = u[E + 1];
|
|
858
858
|
k && D && D.classList.contains("active") && k.style.setProperty("display", "flex");
|
|
859
859
|
});
|
|
860
|
-
}, "updateSplitters"), o = this.querySelector(".nine-tab-bar"), r = this.querySelector("nine-table-sheets-body"), l = o.querySelectorAll(".nine-tab-item"),
|
|
860
|
+
}, "updateSplitters"), o = this.querySelector(".nine-tab-bar"), r = this.querySelector("nine-table-sheets-body"), l = o.querySelectorAll(".nine-tab-item"), c = r.querySelectorAll("nine-table-sheet");
|
|
861
861
|
if (!l[e]) return;
|
|
862
862
|
if (!s)
|
|
863
863
|
l.forEach((u, f) => {
|
|
864
864
|
u.classList.toggle("active", f === e);
|
|
865
|
-
}),
|
|
865
|
+
}), c.forEach((u, f) => {
|
|
866
866
|
const g = f === e;
|
|
867
867
|
u.classList.toggle("active", g), u.style.flex = g ? "1 1 100%" : "";
|
|
868
868
|
});
|
|
@@ -874,9 +874,9 @@ const jt = class jt extends HTMLElement {
|
|
|
874
874
|
const g = r.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
875
875
|
g && (g.classList.toggle("active"), g.classList.contains("active") || (g.style.flex = ""));
|
|
876
876
|
}
|
|
877
|
-
const
|
|
878
|
-
|
|
879
|
-
u.style.flex =
|
|
877
|
+
const h = r.querySelectorAll("nine-table-sheet.active");
|
|
878
|
+
h == null || h.forEach((u) => {
|
|
879
|
+
u.style.flex = h.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
880
880
|
}), n();
|
|
881
881
|
}, "#switchSheet"));
|
|
882
882
|
}
|
|
@@ -898,17 +898,17 @@ const Ft = class Ft {
|
|
|
898
898
|
}).observe(t(this, T));
|
|
899
899
|
}, "#init"));
|
|
900
900
|
d(this, at, /* @__PURE__ */ a(() => {
|
|
901
|
-
var
|
|
901
|
+
var c, h;
|
|
902
902
|
const i = Array.from(t(this, T).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
903
903
|
if (i.length === 0) return;
|
|
904
|
-
const e = parseInt(t(this, T).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((u) => u.getRowHeight())), n = (
|
|
904
|
+
const e = parseInt(t(this, T).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((u) => u.getRowHeight())), n = (c = t(this, T).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, o = (h = t(this, T).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : h.getBoundingClientRect().height, r = ht.SCROLLBAR_SIZE, l = e * s + n + o + r;
|
|
905
905
|
t(this, T).style.height = `${l}px`;
|
|
906
906
|
}, "#applyAutoHeight"));
|
|
907
907
|
d(this, At, /* @__PURE__ */ a(() => {
|
|
908
|
-
const e = Array.from(t(this, T).children).filter((
|
|
909
|
-
const f = `<nine-table-sheet class="${
|
|
908
|
+
const e = Array.from(t(this, T).children).filter((c) => c.tagName === "TABLE"), s = t(this, T).getAttribute("auto-height") === "true", n = e.length, o = e.map((c, h) => {
|
|
909
|
+
const f = `<nine-table-sheet class="${h === 0 ? "active" : ""}" data-index="${h}"></nine-table-sheet>`, g = h < n - 1 ? `<nine-splitter class="h" data-split-index="${h}"></nine-splitter>` : "";
|
|
910
910
|
return f + g;
|
|
911
|
-
}).join(""), r = e.map((
|
|
911
|
+
}).join(""), r = e.map((c, h) => `<div class="nine-tab-item ${h === 0 ? "active" : ""}" data-index="${h}">Sheet ${h + 1}</div>`).join("");
|
|
912
912
|
t(this, T).shadowRoot.innerHTML = `
|
|
913
913
|
<style>
|
|
914
914
|
:host {
|
|
@@ -1009,9 +1009,9 @@ const Ft = class Ft {
|
|
|
1009
1009
|
<nine-table-footer></nine-table-footer>
|
|
1010
1010
|
`;
|
|
1011
1011
|
const l = t(this, T).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1012
|
-
l == null || l.forEach((
|
|
1013
|
-
e[
|
|
1014
|
-
|
|
1012
|
+
l == null || l.forEach((c, h) => {
|
|
1013
|
+
e[h] && setTimeout(() => {
|
|
1014
|
+
c.generate(e[h]), s && t(this, at).call(this);
|
|
1015
1015
|
});
|
|
1016
1016
|
});
|
|
1017
1017
|
}, "#render"));
|
|
@@ -1102,8 +1102,8 @@ const H = class H {
|
|
|
1102
1102
|
t(this, v).rawRecords = t(this, v).rawRecords.concat(t(this, Ct).call(this, s)), this.resetRecords();
|
|
1103
1103
|
const n = this.count() - 1;
|
|
1104
1104
|
return e || s.forEach((r, l) => {
|
|
1105
|
-
const
|
|
1106
|
-
|
|
1105
|
+
const c = t(this, v).rawRecords[n - l];
|
|
1106
|
+
c && (c.__ng.rowState = H.ROW_STATE.EMPTY);
|
|
1107
1107
|
}), (o = t(this, v).viewRecords) != null && o.reset && t(this, v).viewRecords.reset(), n;
|
|
1108
1108
|
}, "add"));
|
|
1109
1109
|
w(this, "delete", /* @__PURE__ */ a((i) => {
|
|
@@ -1119,9 +1119,9 @@ const H = class H {
|
|
|
1119
1119
|
}), this.resetRecords(), (s = t(this, v).viewRecords) != null && s.reset && t(this, v).viewRecords.reset();
|
|
1120
1120
|
}, "delete"));
|
|
1121
1121
|
w(this, "setValue", /* @__PURE__ */ a((i, e, s) => {
|
|
1122
|
-
var
|
|
1122
|
+
var c;
|
|
1123
1123
|
i = parseInt(i, 10);
|
|
1124
|
-
const o = (typeof ((
|
|
1124
|
+
const o = (typeof ((c = t(this, q).fields) == null ? void 0 : c.get) == "function" ? t(this, q).fields.get() : []).indexOf(e);
|
|
1125
1125
|
if (o < 0) return;
|
|
1126
1126
|
const r = this.getValidData()[i];
|
|
1127
1127
|
if (!r) return;
|