@ninebone/table 0.0.150 β 0.0.152
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 +90 -90
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +6 -6
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -22,7 +22,7 @@ const Re = class Re extends We.constructor {
|
|
|
22
22
|
};
|
|
23
23
|
a(Re, "Trace");
|
|
24
24
|
let be = Re;
|
|
25
|
-
const
|
|
25
|
+
const J = new be();
|
|
26
26
|
var _, O, y, B, D, N, ee, P, te;
|
|
27
27
|
const Te = class Te extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
@@ -44,8 +44,8 @@ const Te = class Te extends HTMLElement {
|
|
|
44
44
|
if (!e(this, _) || !e(this, y) || e(this, O)) return;
|
|
45
45
|
const t = e(this, y).container, i = t.querySelector("table");
|
|
46
46
|
if (!i) return;
|
|
47
|
-
const n = e(this, y).track, o = e(this, y).thumb, r = e(this, _).querySelector(".ng-container-bottom"), l = t.clientWidth,
|
|
48
|
-
if (l !== 0 &&
|
|
47
|
+
const n = e(this, y).track, o = e(this, y).thumb, r = e(this, _).querySelector(".ng-container-bottom"), l = t.clientWidth, g = i.scrollWidth;
|
|
48
|
+
if (l !== 0 && g > l)
|
|
49
49
|
r && (r.style.display = "flex");
|
|
50
50
|
else {
|
|
51
51
|
r && (r.style.display = "none");
|
|
@@ -53,16 +53,16 @@ const Te = class Te extends HTMLElement {
|
|
|
53
53
|
}
|
|
54
54
|
const c = n.clientWidth;
|
|
55
55
|
if (c <= 0) return;
|
|
56
|
-
const h = Math.max(Math.min(c * (l /
|
|
56
|
+
const h = Math.max(Math.min(c * (l / g), c), 20);
|
|
57
57
|
o.style.width = `${h}px`;
|
|
58
58
|
let d = 0;
|
|
59
|
-
const
|
|
60
|
-
if (
|
|
61
|
-
const x =
|
|
59
|
+
const b = i.style.transform;
|
|
60
|
+
if (b && b.includes("translateX")) {
|
|
61
|
+
const x = b.match(/translateX\(([-\d.]+)px\)/);
|
|
62
62
|
x && x[1] && (d = parseFloat(x[1]));
|
|
63
63
|
} else
|
|
64
64
|
d = parseInt(i.style.left || 0, 10);
|
|
65
|
-
let f = parseInt(Math.abs(d) * c /
|
|
65
|
+
let f = parseInt(Math.abs(d) * c / g, 10);
|
|
66
66
|
f < 0 && (f = 0);
|
|
67
67
|
const S = c - h;
|
|
68
68
|
f > S && (f = S), o.style.left = `${f}px`, e(this, y).left.disabled = f === 0, e(this, y).right.disabled = f >= S - 1;
|
|
@@ -74,11 +74,11 @@ const Te = class Te extends HTMLElement {
|
|
|
74
74
|
const o = e(this, y).track.getBoundingClientRect(), r = e(this, y).thumb.clientWidth;
|
|
75
75
|
let l = t;
|
|
76
76
|
l < 0 && (l = 0);
|
|
77
|
-
const
|
|
78
|
-
l >
|
|
77
|
+
const g = o.width - r;
|
|
78
|
+
l > g && (l = g), l = parseInt(l, 10), e(this, y).thumb.style.left = `${l}px`, e(this, y).left.disabled = l === 0, e(this, y).right.disabled = l >= g - 1;
|
|
79
79
|
const c = i.clientWidth, h = n.scrollWidth;
|
|
80
|
-
let d =
|
|
81
|
-
return -d > h - c && (d = -(h - c)), -d + 5 > h - c && (d = -(h - c)), c >= h && (d = 0), n.style.transform = `translateX(${d}px)`, l > 0 && l <
|
|
80
|
+
let d = g > 0 ? -l * (h - c) / g : 0;
|
|
81
|
+
return -d > h - c && (d = -(h - c)), -d + 5 > h - c && (d = -(h - c)), c >= h && (d = 0), n.style.transform = `translateX(${d}px)`, l > 0 && l < g - 1;
|
|
82
82
|
}, "#thumbMoveTo"));
|
|
83
83
|
u(this, te, /* @__PURE__ */ a(() => {
|
|
84
84
|
const t = /* @__PURE__ */ a((n) => {
|
|
@@ -109,8 +109,8 @@ const Te = class Te extends HTMLElement {
|
|
|
109
109
|
n.stopPropagation(), n.preventDefault(), p(this, O, !0), this.shiftX = n.clientX - e(this, y).thumb.getBoundingClientRect().left;
|
|
110
110
|
const o = /* @__PURE__ */ a((l) => {
|
|
111
111
|
if (!e(this, O)) return;
|
|
112
|
-
const
|
|
113
|
-
e(this, P).call(this, l.clientX -
|
|
112
|
+
const g = e(this, y).track.getBoundingClientRect();
|
|
113
|
+
e(this, P).call(this, l.clientX - g.left - this.shiftX);
|
|
114
114
|
}, "onMouseMove"), r = /* @__PURE__ */ a(() => {
|
|
115
115
|
p(this, O, !1), i(), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", r), this.refresh();
|
|
116
116
|
}, "onMouseUp");
|
|
@@ -206,10 +206,10 @@ const Te = class Te extends HTMLElement {
|
|
|
206
206
|
_ = new WeakMap(), O = new WeakMap(), y = new WeakMap(), B = new WeakMap(), D = new WeakMap(), N = new WeakMap(), ee = new WeakMap(), P = new WeakMap(), te = new WeakMap(), a(Te, "NineTableHScrollBar");
|
|
207
207
|
let ge = Te;
|
|
208
208
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ge);
|
|
209
|
-
var
|
|
209
|
+
var X, M, q, I, $, H, se, ie;
|
|
210
210
|
const qe = class qe {
|
|
211
211
|
constructor(s) {
|
|
212
|
-
u(this,
|
|
212
|
+
u(this, X);
|
|
213
213
|
u(this, M, []);
|
|
214
214
|
u(this, q, null);
|
|
215
215
|
u(this, I, null);
|
|
@@ -222,7 +222,7 @@ const qe = class qe {
|
|
|
222
222
|
* π― λ·°ν¬νΈ ν¬κΈ° λ³ν μμ μ λμ΄ κ³μ° λ° νμν ν κ°μ μ°μ Β·μΊμ±μ μκ²°
|
|
223
223
|
*/
|
|
224
224
|
u(this, ie, /* @__PURE__ */ a(() => {
|
|
225
|
-
!e(this,
|
|
225
|
+
!e(this, X) || !(e(this, X) instanceof HTMLElement) || (p(this, I, new ResizeObserver((s) => {
|
|
226
226
|
for (const t of s) {
|
|
227
227
|
const i = t.target;
|
|
228
228
|
if (!i.classList.contains("active"))
|
|
@@ -231,19 +231,19 @@ const qe = class qe {
|
|
|
231
231
|
if (n > 0) {
|
|
232
232
|
const o = i.clientHeight || i.getBoundingClientRect().height || n;
|
|
233
233
|
let r = 0;
|
|
234
|
-
const l = i.querySelector(".ng-container-body") || i,
|
|
235
|
-
|
|
234
|
+
const l = i.querySelector(".ng-container-body") || i, g = l.querySelector("thead"), c = l.querySelector("tfoot");
|
|
235
|
+
g && (r += g.offsetHeight || g.getBoundingClientRect().height), c && (r += c.offsetHeight || c.getBoundingClientRect().height);
|
|
236
236
|
const h = Math.max(o - r, 100);
|
|
237
237
|
if (e(this, $) !== h && (p(this, $, h), e(this, q) !== null)) {
|
|
238
238
|
const d = Math.ceil(e(this, $) / e(this, q));
|
|
239
|
-
p(this, H, d + 20),
|
|
240
|
-
const f = i.querySelector(
|
|
239
|
+
p(this, H, d + 20), J.log(`[RowManager] Resized. Height: ${e(this, $)}px | Target Rows: ${e(this, H)}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((b) => {
|
|
240
|
+
const f = i.querySelector(b);
|
|
241
241
|
f && f.querySelector("tbody") && this.renderRows(f);
|
|
242
242
|
});
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
|
-
})), e(this, I).observe(e(this,
|
|
246
|
+
})), e(this, I).observe(e(this, X)));
|
|
247
247
|
}, "#initResizeObserver"));
|
|
248
248
|
v(this, "initTemplate", /* @__PURE__ */ a((s) => {
|
|
249
249
|
const t = s.querySelector("tbody.bindable") || s.querySelector("tbody");
|
|
@@ -264,10 +264,10 @@ const qe = class qe {
|
|
|
264
264
|
n.appendChild(l.cloneNode(!0));
|
|
265
265
|
}), i ? i.before(n) : t.appendChild(n);
|
|
266
266
|
let o = 0;
|
|
267
|
-
if (t.querySelectorAll("tr:not(.nodata)").forEach((l,
|
|
267
|
+
if (t.querySelectorAll("tr:not(.nodata)").forEach((l, g) => {
|
|
268
268
|
const c = l.offsetHeight;
|
|
269
269
|
if (c === 0)
|
|
270
|
-
throw new Error(`[RowManager] Rendered TR[${
|
|
270
|
+
throw new Error(`[RowManager] Rendered TR[${g}] height is 0. Check CSS styles.`);
|
|
271
271
|
o += c;
|
|
272
272
|
}), p(this, q, o), e(this, $) > 0) {
|
|
273
273
|
const l = Math.ceil(e(this, $) / e(this, q));
|
|
@@ -306,13 +306,13 @@ const qe = class qe {
|
|
|
306
306
|
v(this, "destroy", /* @__PURE__ */ a(() => {
|
|
307
307
|
e(this, I) && (e(this, I).disconnect(), p(this, I, null));
|
|
308
308
|
}, "destroy"));
|
|
309
|
-
p(this,
|
|
309
|
+
p(this, X, s), e(this, se).call(this);
|
|
310
310
|
}
|
|
311
311
|
get templateLength() {
|
|
312
312
|
return e(this, M).length || 1;
|
|
313
313
|
}
|
|
314
314
|
};
|
|
315
|
-
|
|
315
|
+
X = new WeakMap(), M = new WeakMap(), q = new WeakMap(), I = new WeakMap(), $ = new WeakMap(), H = new WeakMap(), se = new WeakMap(), ie = new WeakMap(), a(qe, "RowManager");
|
|
316
316
|
let pe = qe;
|
|
317
317
|
var L, F, ne;
|
|
318
318
|
const Z = class Z extends HTMLElement {
|
|
@@ -323,53 +323,53 @@ const Z = class Z extends HTMLElement {
|
|
|
323
323
|
v(this, "init", /* @__PURE__ */ a((t) => {
|
|
324
324
|
if (!t) return;
|
|
325
325
|
const i = /* @__PURE__ */ a((c) => {
|
|
326
|
-
const h = /* @__PURE__ */ a((
|
|
327
|
-
if (
|
|
328
|
-
const f =
|
|
326
|
+
const h = /* @__PURE__ */ a((b) => {
|
|
327
|
+
if (b.querySelector("colgroup")) return;
|
|
328
|
+
const f = b.querySelector("tbody tr") || b.querySelector("tr"), S = f ? f.querySelectorAll("th, td").length : 1, x = document.createElement("colgroup"), C = Math.max(Math.floor((b.clientWidth || 600) / S), 100);
|
|
329
329
|
for (let R = 0; R < S; R++) {
|
|
330
330
|
const ue = document.createElement("col");
|
|
331
331
|
ue.setAttribute("width", C), x.appendChild(ue);
|
|
332
332
|
}
|
|
333
|
-
|
|
334
|
-
}, "ensureColgroup"), d = /* @__PURE__ */ a((
|
|
335
|
-
if (
|
|
336
|
-
const f = document.createElement("thead"), S =
|
|
337
|
-
S ? S.after(f) :
|
|
333
|
+
b.prepend(x);
|
|
334
|
+
}, "ensureColgroup"), d = /* @__PURE__ */ a((b) => {
|
|
335
|
+
if (b.querySelector("thead")) return;
|
|
336
|
+
const f = document.createElement("thead"), S = b.querySelector("colgroup");
|
|
337
|
+
S ? S.after(f) : b.prepend(f);
|
|
338
338
|
}, "ensureThead");
|
|
339
339
|
return h(c), d(c), c.classList.add("nine-table-element"), c;
|
|
340
340
|
}, "initializeTable"), n = t.cloneNode(!0);
|
|
341
341
|
p(this, L, i(n)), e(this, L).style.display = "table", e(this, F).initTemplate(e(this, L));
|
|
342
|
-
const o = this.querySelector(".ng-container-left"), r = this.querySelector(".ng-container-body"), l = this.querySelector(".ng-container-right"),
|
|
343
|
-
const
|
|
342
|
+
const o = this.querySelector(".ng-container-left"), r = this.querySelector(".ng-container-body"), l = this.querySelector(".ng-container-right"), g = /* @__PURE__ */ a((c, h, d = !1) => {
|
|
343
|
+
const b = c.cloneNode(!0), f = Array.from(b.querySelectorAll("colgroup col")), S = [];
|
|
344
344
|
return f.forEach((x, C) => {
|
|
345
345
|
const R = x.getAttribute("fixed");
|
|
346
346
|
(d ? !R || R === "" : R === h) || S.push(C);
|
|
347
347
|
}), S.reverse().forEach((x) => {
|
|
348
|
-
f[x] && f[x].remove(),
|
|
348
|
+
f[x] && f[x].remove(), b.querySelectorAll("tr").forEach((C) => {
|
|
349
349
|
const R = C.querySelectorAll("th, td");
|
|
350
350
|
R[x] && R[x].remove();
|
|
351
351
|
});
|
|
352
|
-
}),
|
|
352
|
+
}), b;
|
|
353
353
|
}, "filterTableByFixed");
|
|
354
354
|
if (r) {
|
|
355
|
-
const c =
|
|
355
|
+
const c = g(e(this, L), null, !0);
|
|
356
356
|
r.innerHTML = "", r.appendChild(c), e(this, F).measureAndCacheHeight(r);
|
|
357
357
|
}
|
|
358
358
|
if (o) {
|
|
359
|
-
const c =
|
|
359
|
+
const c = g(e(this, L), "left", !1);
|
|
360
360
|
let h = 0;
|
|
361
|
-
c.querySelectorAll("col").forEach((
|
|
362
|
-
const f = parseInt(
|
|
361
|
+
c.querySelectorAll("col").forEach((b) => {
|
|
362
|
+
const f = parseInt(b.getAttribute("width"), 10);
|
|
363
363
|
isNaN(f) || (h += f);
|
|
364
364
|
}), o.innerHTML = "", o.appendChild(c);
|
|
365
365
|
const d = h > 0 ? h : 0;
|
|
366
366
|
o.style.flex = `0 0 ${d}px`, o.style.width = `${d}px`;
|
|
367
367
|
}
|
|
368
368
|
if (l) {
|
|
369
|
-
const c =
|
|
369
|
+
const c = g(e(this, L), "right", !1);
|
|
370
370
|
let h = 0;
|
|
371
|
-
c.querySelectorAll("col").forEach((
|
|
372
|
-
const f = parseInt(
|
|
371
|
+
c.querySelectorAll("col").forEach((b) => {
|
|
372
|
+
const f = parseInt(b.getAttribute("width"), 10);
|
|
373
373
|
isNaN(f) || (h += f);
|
|
374
374
|
}), l.innerHTML = "", l.appendChild(c);
|
|
375
375
|
const d = h > 0 ? h : 0;
|
|
@@ -385,7 +385,7 @@ const Z = class Z extends HTMLElement {
|
|
|
385
385
|
setTimeout(() => {
|
|
386
386
|
const c = this.querySelector("nine-table-hscrollbar");
|
|
387
387
|
c && typeof c.refresh == "function" && c.refresh();
|
|
388
|
-
}, 0),
|
|
388
|
+
}, 0), J.log(`NineTableSheet 3-split initialized with rows: ${this.getRowCount()}`);
|
|
389
389
|
}, "init"));
|
|
390
390
|
v(this, "getRowCount", /* @__PURE__ */ a(() => e(this, L) ? e(this, L).querySelectorAll("tbody tr").length : 0, "getRowCount"));
|
|
391
391
|
v(this, "scrollToX", /* @__PURE__ */ a((t) => {
|
|
@@ -519,7 +519,7 @@ const Z = class Z extends HTMLElement {
|
|
|
519
519
|
e(this, ne).call(this);
|
|
520
520
|
}
|
|
521
521
|
disconnectedCallback() {
|
|
522
|
-
this.innerHTML = "",
|
|
522
|
+
this.innerHTML = "", J.log("NineTableSheet destroyed.");
|
|
523
523
|
}
|
|
524
524
|
};
|
|
525
525
|
L = new WeakMap(), F = new WeakMap(), ne = new WeakMap(), a(Z, "NineTableSheet"), v(Z, "SCROLLBAR_SIZE", 16);
|
|
@@ -545,19 +545,19 @@ const ke = class ke extends HTMLElement {
|
|
|
545
545
|
const S = parseInt(f.dataset.splitIndex, 10), x = d.querySelector(`nine-table-sheet[data-index="${S - 1}"]`), C = d.querySelector(`nine-table-sheet[data-index="${S}"]`);
|
|
546
546
|
x && C && x.classList.contains("active") && C.classList.contains("active") ? f.classList.add("active") : f.classList.remove("active");
|
|
547
547
|
});
|
|
548
|
-
}, "updateSplitters"), o = this.querySelector(".nine-tab-bar"), r = this.querySelector("nine-table-sheets-body"), l = o.querySelectorAll(".nine-tab-item"),
|
|
548
|
+
}, "updateSplitters"), o = this.querySelector(".nine-tab-bar"), r = this.querySelector("nine-table-sheets-body"), l = o.querySelectorAll(".nine-tab-item"), g = r.querySelectorAll("nine-table-sheet");
|
|
549
549
|
if (!l[t]) return;
|
|
550
550
|
if (!i)
|
|
551
|
-
l.forEach((d,
|
|
552
|
-
d.classList.toggle("active",
|
|
553
|
-
const f = r.querySelector(`nine-table-sheet[data-index="${
|
|
551
|
+
l.forEach((d, b) => {
|
|
552
|
+
d.classList.toggle("active", b === t);
|
|
553
|
+
const f = r.querySelector(`nine-table-sheet[data-index="${b}"]`);
|
|
554
554
|
f && (f.style.flex = "");
|
|
555
|
-
}),
|
|
556
|
-
d.classList.toggle("active",
|
|
555
|
+
}), g.forEach((d, b) => {
|
|
556
|
+
d.classList.toggle("active", b === t);
|
|
557
557
|
});
|
|
558
558
|
else {
|
|
559
|
-
const d = l[t],
|
|
560
|
-
if (d.classList.contains("active") &&
|
|
559
|
+
const d = l[t], b = o.querySelectorAll(".nine-tab-item.active");
|
|
560
|
+
if (d.classList.contains("active") && b.length <= 1)
|
|
561
561
|
return;
|
|
562
562
|
d.classList.toggle("active");
|
|
563
563
|
const f = r.querySelector(`nine-table-sheet[data-index="${t}"]`);
|
|
@@ -566,8 +566,8 @@ const ke = class ke extends HTMLElement {
|
|
|
566
566
|
const c = Array.from(r.querySelectorAll("nine-table-sheet.active"));
|
|
567
567
|
if (c.length > 1) {
|
|
568
568
|
const d = 1 / c.length;
|
|
569
|
-
c.forEach((
|
|
570
|
-
(!
|
|
569
|
+
c.forEach((b) => {
|
|
570
|
+
(!b.style.flex || b.style.flex === "1 1 100%") && (b.style.flex = `${d} ${d} 0px`);
|
|
571
571
|
});
|
|
572
572
|
} else
|
|
573
573
|
c.forEach((d) => {
|
|
@@ -588,43 +588,43 @@ const ke = class ke extends HTMLElement {
|
|
|
588
588
|
re = new WeakMap(), a(ke, "NineTableSheets");
|
|
589
589
|
let we = ke;
|
|
590
590
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", we);
|
|
591
|
-
var k,
|
|
591
|
+
var k, j, oe, G, le;
|
|
592
592
|
const Ae = class Ae {
|
|
593
593
|
constructor(s) {
|
|
594
594
|
u(this, k);
|
|
595
|
-
u(this,
|
|
595
|
+
u(this, j, null);
|
|
596
596
|
u(this, oe, /* @__PURE__ */ a(() => {
|
|
597
597
|
const s = e(this, k).host;
|
|
598
|
-
s && (p(this,
|
|
598
|
+
s && (p(this, j, new ResizeObserver((t) => {
|
|
599
599
|
for (let i of t)
|
|
600
|
-
s.getAttribute("auto-height") === "true" && e(this,
|
|
601
|
-
})), e(this,
|
|
600
|
+
s.getAttribute("auto-height") === "true" && e(this, G).call(this, s);
|
|
601
|
+
})), e(this, j).observe(s));
|
|
602
602
|
}, "#observeResize"));
|
|
603
|
-
u(this,
|
|
603
|
+
u(this, G, /* @__PURE__ */ a((s) => {
|
|
604
604
|
var C, R;
|
|
605
605
|
const t = (C = s.shadowRoot) == null ? void 0 : C.querySelector("nine-table-sheet.active");
|
|
606
606
|
if (!t) return;
|
|
607
|
-
const i = ((R = t.getRowCount) == null ? void 0 : R.call(t)) || 0, n = parseInt(s.getAttribute("max-display-row"), 10) || 10, o = Math.min(i, n), r = t.querySelector("tbody tr") || t.querySelector("tr"), l = r ? r.getBoundingClientRect().height : 32,
|
|
607
|
+
const i = ((R = t.getRowCount) == null ? void 0 : R.call(t)) || 0, n = parseInt(s.getAttribute("max-display-row"), 10) || 10, o = Math.min(i, n), r = t.querySelector("tbody tr") || t.querySelector("tr"), l = r ? r.getBoundingClientRect().height : 32, g = e(this, k).querySelector("nine-table-header"), c = e(this, k).querySelector("nine-table-sheets-footer"), h = g ? g.getBoundingClientRect().height : 40, d = c ? c.getBoundingClientRect().height : 32, f = h + d + 16, S = o * l + f;
|
|
608
608
|
s.style.height = `${S}px`, s.style.maxHeight = `${n * l + f}px`;
|
|
609
609
|
const x = e(this, k).querySelector("nine-table-sheets-body");
|
|
610
610
|
x && (x.style.overflowY = i > n ? "auto" : "hidden");
|
|
611
611
|
}, "#applyAutoHeight"));
|
|
612
612
|
/**
|
|
613
|
-
* π― μνΈ
|
|
613
|
+
* π― νμ± μνΈ μνμ λ°λΌ μ€ν리ν°(.h)λ₯Ό μ§μ νμν΄ λ³΄μ¬μ£Όκ±°λ μ¨κΈ°λ μ§κ΄μ λ©μλ
|
|
614
614
|
*/
|
|
615
615
|
v(this, "updateSplitters", /* @__PURE__ */ a(() => {
|
|
616
616
|
const s = e(this, k).querySelector("nine-table-sheets-body");
|
|
617
617
|
if (!s) return;
|
|
618
|
-
const t = Array.from(s.querySelectorAll("nine-table-sheet"))
|
|
619
|
-
|
|
620
|
-
const
|
|
621
|
-
|
|
618
|
+
const t = Array.from(s.querySelectorAll("nine-table-sheet"));
|
|
619
|
+
Array.from(s.querySelectorAll("nine-splitter.h")).forEach((n, o) => {
|
|
620
|
+
const r = t[o], l = t[o + 1];
|
|
621
|
+
r && l && r.classList.contains("active") && l.classList.contains("active") ? n.style.display = "block" : n.style.display = "none";
|
|
622
622
|
});
|
|
623
623
|
}, "updateSplitters"));
|
|
624
624
|
u(this, le, /* @__PURE__ */ a(() => {
|
|
625
625
|
const s = e(this, k).host, i = Array.from(s.children).filter((c) => c.tagName === "TABLE"), n = s.getAttribute("auto-height") === "true", o = i.length, r = i.map((c, h) => {
|
|
626
|
-
const
|
|
627
|
-
return
|
|
626
|
+
const b = `<nine-table-sheet class="${h === 0 ? "active" : ""}" data-index="${h}"></nine-table-sheet>`, f = h < o - 1 ? `<nine-splitter class="h" data-split-index="${h}"></nine-splitter>` : "";
|
|
627
|
+
return b + f;
|
|
628
628
|
}).join(""), l = i.map((c, h) => `<div class="nine-tab-item ${h === 0 ? "active" : ""}" data-index="${h}">Sheet ${h + 1}</div>`).join("");
|
|
629
629
|
e(this, k).innerHTML = `
|
|
630
630
|
<style>
|
|
@@ -669,13 +669,13 @@ const Ae = class Ae {
|
|
|
669
669
|
display: block !important;
|
|
670
670
|
}
|
|
671
671
|
|
|
672
|
-
/* π―
|
|
672
|
+
/* π― μ€νλ¦¬ν° κΈ°λ³Έ μ€νμΌ (JSλ‘ μ§μ display μ‘°μ) */
|
|
673
673
|
nine-table-sheets-body nine-splitter.h {
|
|
674
674
|
width: 4px;
|
|
675
675
|
background: #e5e7eb;
|
|
676
676
|
cursor: col-resize;
|
|
677
677
|
flex-shrink: 0;
|
|
678
|
-
display:
|
|
678
|
+
display: none;
|
|
679
679
|
}
|
|
680
680
|
|
|
681
681
|
nine-table-sheets-footer {
|
|
@@ -735,40 +735,40 @@ const Ae = class Ae {
|
|
|
735
735
|
</nine-table-body>
|
|
736
736
|
<nine-table-footer></nine-table-footer>
|
|
737
737
|
`;
|
|
738
|
-
const
|
|
739
|
-
|
|
738
|
+
const g = e(this, k).querySelectorAll("nine-table-sheet");
|
|
739
|
+
g == null || g.forEach((c, h) => {
|
|
740
740
|
i[h] && setTimeout(() => {
|
|
741
|
-
c.init(i[h]), n && e(this,
|
|
741
|
+
c.init(i[h]), n && e(this, G).call(this, s), this.updateSplitters();
|
|
742
742
|
});
|
|
743
743
|
});
|
|
744
744
|
}, "#render"));
|
|
745
745
|
p(this, k, s), e(this, le).call(this), e(this, oe).call(this);
|
|
746
746
|
}
|
|
747
747
|
};
|
|
748
|
-
k = new WeakMap(),
|
|
748
|
+
k = new WeakMap(), j = new WeakMap(), oe = new WeakMap(), G = new WeakMap(), le = new WeakMap(), a(Ae, "LayoutManager");
|
|
749
749
|
let me = Ae;
|
|
750
|
-
var z,
|
|
750
|
+
var z, V;
|
|
751
751
|
const Ce = class Ce {
|
|
752
752
|
constructor(s) {
|
|
753
753
|
u(this, z);
|
|
754
|
-
u(this,
|
|
754
|
+
u(this, V, -1);
|
|
755
755
|
v(this, "count", /* @__PURE__ */ a(() => e(this, z).rawRecords.length, "count"));
|
|
756
756
|
p(this, z, s);
|
|
757
757
|
}
|
|
758
758
|
get at() {
|
|
759
|
-
return e(this,
|
|
759
|
+
return e(this, V);
|
|
760
760
|
}
|
|
761
761
|
set at(s) {
|
|
762
762
|
var i, n;
|
|
763
|
-
p(this,
|
|
763
|
+
p(this, V, parseInt(s, 10));
|
|
764
764
|
const t = ((n = (i = e(this, z).owner).querySelector) == null ? void 0 : n.call(i, ".ng-container-body")) || e(this, z).owner.body;
|
|
765
|
-
t && !t.querySelector(`tbody.bindable tr[data-row="${e(this,
|
|
765
|
+
t && !t.querySelector(`tbody.bindable tr[data-row="${e(this, V)}"]`) && setTimeout(() => {
|
|
766
766
|
var o, r;
|
|
767
|
-
(r = (o = e(this, z).owner).scrollTo_V1) == null || r.call(o, e(this,
|
|
767
|
+
(r = (o = e(this, z).owner).scrollTo_V1) == null || r.call(o, e(this, V));
|
|
768
768
|
});
|
|
769
769
|
}
|
|
770
770
|
};
|
|
771
|
-
z = new WeakMap(),
|
|
771
|
+
z = new WeakMap(), V = new WeakMap(), a(Ce, "ngRow");
|
|
772
772
|
let ve = Ce;
|
|
773
773
|
var E, m, A, U, ae, W, ce, Q, he, de, K;
|
|
774
774
|
const T = class T {
|
|
@@ -829,8 +829,8 @@ const T = class T {
|
|
|
829
829
|
e(this, m).rawRecords = e(this, m).rawRecords.concat(e(this, de).call(this, i)), this.resetRecords();
|
|
830
830
|
const n = this.count() - 1;
|
|
831
831
|
return t || i.forEach((r, l) => {
|
|
832
|
-
const
|
|
833
|
-
|
|
832
|
+
const g = e(this, m).rawRecords[n - l];
|
|
833
|
+
g && (g.__ng.rowState = T.ROW_STATE.EMPTY);
|
|
834
834
|
}), (o = e(this, m).viewRecords) != null && o.reset && e(this, m).viewRecords.reset(), n;
|
|
835
835
|
}, "add"));
|
|
836
836
|
v(this, "delete", /* @__PURE__ */ a((s) => {
|
|
@@ -846,9 +846,9 @@ const T = class T {
|
|
|
846
846
|
}), this.resetRecords(), (i = e(this, m).viewRecords) != null && i.reset && e(this, m).viewRecords.reset();
|
|
847
847
|
}, "delete"));
|
|
848
848
|
v(this, "setValue", /* @__PURE__ */ a((s, t, i) => {
|
|
849
|
-
var
|
|
849
|
+
var g;
|
|
850
850
|
s = parseInt(s, 10);
|
|
851
|
-
const o = (typeof ((
|
|
851
|
+
const o = (typeof ((g = e(this, E).fields) == null ? void 0 : g.get) == "function" ? e(this, E).fields.get() : []).indexOf(t);
|
|
852
852
|
if (o < 0) return;
|
|
853
853
|
const r = this.getValidData()[s];
|
|
854
854
|
if (!r) return;
|
|
@@ -940,10 +940,10 @@ const _e = class _e extends HTMLElement {
|
|
|
940
940
|
this.attachShadow({ mode: "open" }), p(this, Y, new Se(this));
|
|
941
941
|
}
|
|
942
942
|
connectedCallback() {
|
|
943
|
-
p(this, fe, new me(this.shadowRoot)),
|
|
943
|
+
p(this, fe, new me(this.shadowRoot)), J.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
944
944
|
}
|
|
945
945
|
disconnectedCallback() {
|
|
946
|
-
|
|
946
|
+
J.log("NineTable disconnected.");
|
|
947
947
|
}
|
|
948
948
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
949
949
|
get data() {
|