@ninebone/table 0.0.325 β 0.0.326
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 +115 -114
- 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,23 +22,23 @@ const Ut = class Ut extends le.constructor {
|
|
|
22
22
|
};
|
|
23
23
|
c(Ut, "Trace");
|
|
24
24
|
let $t = Ut;
|
|
25
|
-
const
|
|
26
|
-
var C, M, y, N, B,
|
|
25
|
+
const tt = new $t();
|
|
26
|
+
var C, M, y, D, N, B, ft, P, ut;
|
|
27
27
|
const Ft = class Ft extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
h(this, C);
|
|
31
31
|
h(this, M, !1);
|
|
32
32
|
h(this, y);
|
|
33
|
+
h(this, D);
|
|
33
34
|
h(this, N);
|
|
34
35
|
h(this, B);
|
|
35
|
-
h(this, P);
|
|
36
36
|
h(this, ft, /* @__PURE__ */ c(() => {
|
|
37
37
|
if (!t(this, C)) return;
|
|
38
38
|
const e = t(this, C).querySelector(".ng-container-body");
|
|
39
|
-
e && (g(this,
|
|
39
|
+
e && (g(this, B, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
|
-
})), t(this,
|
|
41
|
+
})), t(this, B).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
w(this, "refresh", /* @__PURE__ */ c(() => {
|
|
44
44
|
if (!t(this, C) || !t(this, y) || t(this, M)) return;
|
|
@@ -56,12 +56,12 @@ const Ft = class Ft extends HTMLElement {
|
|
|
56
56
|
const f = Math.max(Math.min(d * (l / a), d), 20);
|
|
57
57
|
r.style.width = `${f}px`;
|
|
58
58
|
const u = e.scrollLeft, b = a - l;
|
|
59
|
-
let
|
|
60
|
-
b > 0 && (
|
|
59
|
+
let p = 0;
|
|
60
|
+
b > 0 && (p = parseInt(u / b * (d - f), 10)), p < 0 && (p = 0);
|
|
61
61
|
const E = d - f;
|
|
62
|
-
|
|
62
|
+
p > E && (p = E), r.style.left = `${p}px`, tt.log(p), t(this, y).left.disabled = p === 0, t(this, y).right.disabled = p >= E - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
h(this,
|
|
64
|
+
h(this, P, /* @__PURE__ */ c((e) => {
|
|
65
65
|
if (!t(this, y)) return !1;
|
|
66
66
|
const s = t(this, y).container, o = s.querySelector("table");
|
|
67
67
|
if (!o) return !1;
|
|
@@ -75,16 +75,16 @@ const Ft = class Ft extends HTMLElement {
|
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
76
|
h(this, ut, /* @__PURE__ */ c(() => {
|
|
77
77
|
const e = /* @__PURE__ */ c((o) => {
|
|
78
|
-
clearInterval(t(this,
|
|
78
|
+
clearInterval(t(this, D)), clearInterval(t(this, N));
|
|
79
79
|
const r = parseInt(t(this, y).thumb.style.left || 0, 10);
|
|
80
|
-
t(this,
|
|
81
|
-
clearInterval(t(this,
|
|
80
|
+
t(this, P).call(this, r + o), g(this, D, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, D)), g(this, N, setInterval(() => {
|
|
82
82
|
const n = parseInt(t(this, y).thumb.style.left || 0, 10);
|
|
83
|
-
t(this,
|
|
83
|
+
t(this, P).call(this, n + o) || clearInterval(t(this, N));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), s = /* @__PURE__ */ c(() => {
|
|
87
|
-
clearInterval(t(this,
|
|
87
|
+
clearInterval(t(this, D)), clearInterval(t(this, N));
|
|
88
88
|
}, "clearTimer");
|
|
89
89
|
["mouseup", "mouseleave", "touchend"].forEach((o) => {
|
|
90
90
|
t(this, y).left.addEventListener(o, s), t(this, y).right.addEventListener(o, s), t(this, y).track.addEventListener(o, s);
|
|
@@ -96,14 +96,14 @@ const Ft = class Ft extends HTMLElement {
|
|
|
96
96
|
if (o.button !== 0) return;
|
|
97
97
|
o.preventDefault();
|
|
98
98
|
const r = t(this, y).track.getBoundingClientRect(), n = t(this, y).thumb.clientWidth;
|
|
99
|
-
t(this,
|
|
99
|
+
t(this, P).call(this, o.clientX - r.left - n / 2);
|
|
100
100
|
}), t(this, y).thumb.addEventListener("mousedown", (o) => {
|
|
101
101
|
if (o.button !== 0) return;
|
|
102
102
|
o.stopPropagation(), o.preventDefault(), g(this, M, !0), this.shiftX = o.clientX - t(this, y).thumb.getBoundingClientRect().left;
|
|
103
103
|
const r = /* @__PURE__ */ c((l) => {
|
|
104
104
|
if (!t(this, M)) return;
|
|
105
105
|
const a = t(this, y).track.getBoundingClientRect();
|
|
106
|
-
t(this,
|
|
106
|
+
t(this, P).call(this, l.clientX - a.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), n = /* @__PURE__ */ c(() => {
|
|
108
108
|
g(this, M, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", n), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
@@ -195,17 +195,17 @@ const Ft = class Ft extends HTMLElement {
|
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
197
197
|
disconnectedCallback() {
|
|
198
|
-
t(this,
|
|
198
|
+
t(this, B) && t(this, B).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
C = new WeakMap(), M = new WeakMap(), y = new WeakMap(),
|
|
201
|
+
C = new WeakMap(), M = new WeakMap(), y = new WeakMap(), D = new WeakMap(), N = new WeakMap(), B = new WeakMap(), ft = new WeakMap(), P = new WeakMap(), ut = new WeakMap(), c(Ft, "NineTableHScrollBar");
|
|
202
202
|
let Wt = Ft;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Wt);
|
|
204
|
-
var
|
|
204
|
+
var Y, I, S, it, st, bt;
|
|
205
205
|
const Kt = class Kt extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
-
h(this,
|
|
208
|
+
h(this, Y);
|
|
209
209
|
h(this, I, !1);
|
|
210
210
|
h(this, S);
|
|
211
211
|
h(this, it, 0);
|
|
@@ -214,7 +214,7 @@ const Kt = class Kt extends HTMLElement {
|
|
|
214
214
|
* π― μ€ν¬λ‘€λ° μμΉ λ° μΈλΈ ν¬κΈ° κ°±μ
|
|
215
215
|
*/
|
|
216
216
|
w(this, "refresh", /* @__PURE__ */ c(() => {
|
|
217
|
-
if (!t(this,
|
|
217
|
+
if (!t(this, Y) || !t(this, S) || t(this, I)) return;
|
|
218
218
|
const e = t(this, S).container, s = e.querySelector("table");
|
|
219
219
|
if (!s) return;
|
|
220
220
|
const o = t(this, S).track, r = t(this, S).thumb, n = e.clientHeight, l = s.scrollHeight;
|
|
@@ -230,8 +230,8 @@ const Kt = class Kt extends HTMLElement {
|
|
|
230
230
|
const f = e.scrollTop, u = l - n;
|
|
231
231
|
let b = 0;
|
|
232
232
|
u > 0 && (b = f / u * (a - d));
|
|
233
|
-
const
|
|
234
|
-
b < 0 && (b = 0), b >
|
|
233
|
+
const p = a - d;
|
|
234
|
+
b < 0 && (b = 0), b > p && (b = p), r.style.top = `${b}px`, t(this, S).top.disabled = f <= 0, t(this, S).bottom.disabled = f >= u - 1;
|
|
235
235
|
}, "refresh"));
|
|
236
236
|
h(this, bt, /* @__PURE__ */ c(() => {
|
|
237
237
|
const e = t(this, S).container;
|
|
@@ -242,12 +242,12 @@ const Kt = class Kt extends HTMLElement {
|
|
|
242
242
|
s.stopPropagation(), s.preventDefault(), g(this, I, !0), g(this, it, s.clientY), g(this, st, e.scrollTop);
|
|
243
243
|
const o = /* @__PURE__ */ c((n) => {
|
|
244
244
|
if (!t(this, I)) return;
|
|
245
|
-
const l = t(this, S).track.getBoundingClientRect(), a = t(this, S).thumb.clientHeight, f = l.height - a, u = n.clientY - t(this, it), b = e.clientHeight,
|
|
246
|
-
|
|
247
|
-
const q =
|
|
245
|
+
const l = t(this, S).track.getBoundingClientRect(), a = t(this, S).thumb.clientHeight, f = l.height - a, u = n.clientY - t(this, it), b = e.clientHeight, p = e.querySelector("table");
|
|
246
|
+
tt.log(p), tt.log(p.scrollHeight);
|
|
247
|
+
const q = p.scrollHeight - b;
|
|
248
248
|
if (f > 0 && q > 0) {
|
|
249
|
-
const
|
|
250
|
-
e.scrollTop = t(this, st) +
|
|
249
|
+
const O = u / f * q;
|
|
250
|
+
e.scrollTop = t(this, st) + O;
|
|
251
251
|
}
|
|
252
252
|
this.refresh();
|
|
253
253
|
}, "onMouseMove"), r = /* @__PURE__ */ c(() => {
|
|
@@ -270,7 +270,7 @@ const Kt = class Kt extends HTMLElement {
|
|
|
270
270
|
}, "#init"));
|
|
271
271
|
}
|
|
272
272
|
connectedCallback() {
|
|
273
|
-
if (g(this,
|
|
273
|
+
if (g(this, Y, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, Y)) return;
|
|
274
274
|
this.innerHTML = `
|
|
275
275
|
<style>
|
|
276
276
|
nine-table-vscrollbar {
|
|
@@ -335,7 +335,7 @@ const Kt = class Kt extends HTMLElement {
|
|
|
335
335
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
336
336
|
`;
|
|
337
337
|
const e = /* @__PURE__ */ c(() => {
|
|
338
|
-
const s = t(this,
|
|
338
|
+
const s = t(this, Y).querySelector(".ng-container-body");
|
|
339
339
|
if (!s) {
|
|
340
340
|
setTimeout(e, 10);
|
|
341
341
|
return;
|
|
@@ -351,10 +351,10 @@ const Kt = class Kt extends HTMLElement {
|
|
|
351
351
|
e();
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
|
-
|
|
354
|
+
Y = new WeakMap(), I = new WeakMap(), S = new WeakMap(), it = new WeakMap(), st = new WeakMap(), bt = new WeakMap(), c(Kt, "NineTableVScrollBar");
|
|
355
355
|
let zt = Kt;
|
|
356
356
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", zt);
|
|
357
|
-
var gt,
|
|
357
|
+
var gt, F;
|
|
358
358
|
const H = class H {
|
|
359
359
|
/**
|
|
360
360
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
@@ -369,7 +369,7 @@ const H = class H {
|
|
|
369
369
|
var o, r, n, l;
|
|
370
370
|
if (!i) return null;
|
|
371
371
|
const e = i.cloneNode(!0);
|
|
372
|
-
return t(o = H, gt).call(o, e), t(r = H,
|
|
372
|
+
return t(o = H, gt).call(o, e), t(r = H, F).call(r, e, "thead"), t(n = H, F).call(n, e, "tbody"), t(l = H, F).call(l, e, "tfoot"), Array.from(e.querySelectorAll("colgroup col")).forEach((a, d) => {
|
|
373
373
|
const f = a.getAttribute("fixed");
|
|
374
374
|
f && e.querySelectorAll(`thead [data-col="${d}"], tbody [data-col="${d}"], tfoot [data-col="${d}"]`).forEach((u) => {
|
|
375
375
|
u.setAttribute("fixed", f);
|
|
@@ -377,7 +377,7 @@ const H = class H {
|
|
|
377
377
|
}), e;
|
|
378
378
|
}
|
|
379
379
|
};
|
|
380
|
-
gt = new WeakMap(),
|
|
380
|
+
gt = new WeakMap(), F = new WeakMap(), c(H, "TableCompiler"), h(H, gt, /* @__PURE__ */ c((i) => {
|
|
381
381
|
if (!i.querySelector("colgroup")) {
|
|
382
382
|
const e = i.querySelector("tbody tr") || i.querySelector("tr"), s = e ? e.querySelectorAll("th, td").length : 1, o = document.createElement("colgroup"), r = Math.max(Math.floor(i.clientWidth / s), 100);
|
|
383
383
|
for (let n = 0; n < s; n++) {
|
|
@@ -391,7 +391,7 @@ gt = new WeakMap(), K = new WeakMap(), c(H, "TableCompiler"), h(H, gt, /* @__PUR
|
|
|
391
391
|
s ? s.after(e) : i.prepend(e);
|
|
392
392
|
}
|
|
393
393
|
i.classList.add("nine-table-element"), i.style.display = "table";
|
|
394
|
-
}, "#ensureTableStructure")), h(H,
|
|
394
|
+
}, "#ensureTableStructure")), h(H, F, /* @__PURE__ */ c((i, e) => {
|
|
395
395
|
const s = Array.from(i.querySelectorAll(e + " tr")), o = Array.from(i.querySelectorAll(e + " th," + e + " td")), r = s.length;
|
|
396
396
|
if (r === 0 || o.length === 0) return;
|
|
397
397
|
let n = 0;
|
|
@@ -408,9 +408,9 @@ gt = new WeakMap(), K = new WeakMap(), c(H, "TableCompiler"), h(H, gt, /* @__PUR
|
|
|
408
408
|
f = E;
|
|
409
409
|
break;
|
|
410
410
|
}
|
|
411
|
-
const b = u.rowSpan || 1,
|
|
411
|
+
const b = u.rowSpan || 1, p = u.colSpan || 1;
|
|
412
412
|
for (let E = 0; E < b; E++)
|
|
413
|
-
for (let q = 0; q <
|
|
413
|
+
for (let q = 0; q < p; q++)
|
|
414
414
|
d + E < r && f + q < n && (l[d + E][f + q] = E === 0 && q === 0 ? "1" : "0");
|
|
415
415
|
});
|
|
416
416
|
}), s.forEach((a) => {
|
|
@@ -425,24 +425,24 @@ gt = new WeakMap(), K = new WeakMap(), c(H, "TableCompiler"), h(H, gt, /* @__PUR
|
|
|
425
425
|
});
|
|
426
426
|
}, "#resetColIndex"));
|
|
427
427
|
let Ot = H;
|
|
428
|
-
var nt,
|
|
428
|
+
var nt, m, _, R, $, V, K, yt, pt, ot, rt, mt, xt, lt, j, vt;
|
|
429
429
|
const jt = class jt {
|
|
430
430
|
constructor(i) {
|
|
431
431
|
h(this, nt);
|
|
432
|
-
h(this,
|
|
432
|
+
h(this, m);
|
|
433
433
|
h(this, _, /* @__PURE__ */ new Map());
|
|
434
434
|
h(this, R, null);
|
|
435
435
|
h(this, $, null);
|
|
436
|
-
h(this,
|
|
437
|
-
h(this,
|
|
436
|
+
h(this, V, 0);
|
|
437
|
+
h(this, K, 40);
|
|
438
438
|
w(this, "refresh", /* @__PURE__ */ c(() => {
|
|
439
439
|
var e;
|
|
440
|
-
const i = t(this,
|
|
441
|
-
i && (t(this, ot).call(this), t(this,
|
|
440
|
+
const i = t(this, m).querySelector(".ng-container-body");
|
|
441
|
+
i && (t(this, ot).call(this), t(this, j).call(this, i.scrollTop), (e = t(this, m).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
442
442
|
}, "refresh"));
|
|
443
443
|
w(this, "initialize", /* @__PURE__ */ c(() => {
|
|
444
444
|
g(this, R, null), t(this, _).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
445
|
-
const r = t(this,
|
|
445
|
+
const r = t(this, m).querySelector(o);
|
|
446
446
|
if (!r) return;
|
|
447
447
|
const n = r.querySelector("table");
|
|
448
448
|
if (!n) return;
|
|
@@ -451,13 +451,13 @@ const jt = class jt {
|
|
|
451
451
|
const d = Array.from(l.querySelectorAll("tr")).map((f) => f.cloneNode(!0));
|
|
452
452
|
t(this, _).set(o, d);
|
|
453
453
|
});
|
|
454
|
-
const i = t(this,
|
|
454
|
+
const i = t(this, m).querySelector(".ng-container-body"), e = t(this, m).querySelector(".ng-container-left"), s = t(this, m).querySelector(".ng-container-right");
|
|
455
455
|
if (i) {
|
|
456
|
-
t(this, pt).call(this, i), t(this, lt).call(this), t(this, ot).call(this), t(this,
|
|
456
|
+
t(this, pt).call(this, i), t(this, lt).call(this), t(this, ot).call(this), t(this, j).call(this, i.scrollTop);
|
|
457
457
|
let o = i.scrollTop;
|
|
458
458
|
const r = /* @__PURE__ */ c((n) => {
|
|
459
459
|
var l;
|
|
460
|
-
e && e.scrollTop !== n && (e.scrollTop = n), s && s.scrollTop !== n && (s.scrollTop = n), t(this,
|
|
460
|
+
e && e.scrollTop !== n && (e.scrollTop = n), s && s.scrollTop !== n && (s.scrollTop = n), t(this, j).call(this, n), (l = t(this, m).querySelector("nine-table-vscrollbar")) == null || l.refresh();
|
|
461
461
|
}, "syncScroll");
|
|
462
462
|
i.addEventListener("scroll", () => {
|
|
463
463
|
const n = i.scrollTop;
|
|
@@ -472,7 +472,7 @@ const jt = class jt {
|
|
|
472
472
|
if (!o) return;
|
|
473
473
|
o.querySelectorAll("tr:not(.nodata)").forEach((l) => l.remove());
|
|
474
474
|
const r = o.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
475
|
-
for (let l = 0; l < t(this,
|
|
475
|
+
for (let l = 0; l < t(this, K); l++)
|
|
476
476
|
s.forEach((a) => {
|
|
477
477
|
n.appendChild(a.cloneNode(!0));
|
|
478
478
|
});
|
|
@@ -490,7 +490,7 @@ const jt = class jt {
|
|
|
490
490
|
e.forEach((b) => {
|
|
491
491
|
r.appendChild(b.cloneNode(!0));
|
|
492
492
|
}), o ? o.before(r) : s.appendChild(r);
|
|
493
|
-
const n = t(this,
|
|
493
|
+
const n = t(this, m), l = n.style.display, a = n.style.visibility, d = n.style.position;
|
|
494
494
|
(l === "none" || window.getComputedStyle(n).display === "none") && (n.style.display = "block", n.style.visibility = "hidden", n.style.position = "absolute");
|
|
495
495
|
let f = 0;
|
|
496
496
|
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
@@ -499,24 +499,25 @@ const jt = class jt {
|
|
|
499
499
|
}), u.forEach((b) => b.remove()), n.style.display = l, n.style.visibility = a, n.style.position = d, g(this, R, f > 0 ? f : 24), t(this, rt).call(this), t(this, R);
|
|
500
500
|
}, "#measureAndCacheHeight"));
|
|
501
501
|
h(this, ot, /* @__PURE__ */ c(() => {
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
502
|
+
if (!t(this, m).querySelector(".ng-container-body")) return;
|
|
503
|
+
const e = t(this, nt).data.get() || [];
|
|
504
|
+
console.trace(e);
|
|
505
|
+
const s = e.length > 0 ? e.length : 100, o = t(this, R), r = s * o;
|
|
506
|
+
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
507
|
+
const l = t(this, m).querySelector(n), a = l == null ? void 0 : l.querySelector("table");
|
|
508
|
+
a && (a.style.height = `${r}px`);
|
|
508
509
|
});
|
|
509
510
|
}, "#updateVirtualScrollHeight"));
|
|
510
511
|
h(this, rt, /* @__PURE__ */ c(() => {
|
|
511
|
-
if (t(this,
|
|
512
|
-
const i = Math.ceil(t(this,
|
|
513
|
-
g(this,
|
|
512
|
+
if (t(this, V) > 0 && t(this, R) > 0) {
|
|
513
|
+
const i = Math.ceil(t(this, V) / t(this, R));
|
|
514
|
+
g(this, K, i + 20);
|
|
514
515
|
} else
|
|
515
|
-
g(this,
|
|
516
|
+
g(this, K, 40);
|
|
516
517
|
}, "#updateRowCount"));
|
|
517
518
|
h(this, mt, /* @__PURE__ */ c(() => {
|
|
518
519
|
var a, d, f;
|
|
519
|
-
const i = t(this,
|
|
520
|
+
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");
|
|
520
521
|
if (!e) return;
|
|
521
522
|
const o = i ? Array.from(i.querySelectorAll("tr")) : [], r = Array.from(e.querySelectorAll("tr")), n = s ? Array.from(s.querySelectorAll("tr")) : [], l = Math.max(o.length, r.length, n.length);
|
|
522
523
|
for (let u = 0; u < l; u++) {
|
|
@@ -524,12 +525,12 @@ const jt = class jt {
|
|
|
524
525
|
((a = o[u]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
525
526
|
((d = r[u]) == null ? void 0 : d.getBoundingClientRect().height) || 0,
|
|
526
527
|
((f = n[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
527
|
-
],
|
|
528
|
-
|
|
528
|
+
], p = Math.max(...b);
|
|
529
|
+
p > 0 && (o[u] && (o[u].style.height = `${p}px`), r[u] && (r[u].style.height = `${p}px`), n[u] && (n[u].style.height = `${p}px`));
|
|
529
530
|
}
|
|
530
531
|
}, "#syncRowHeights"));
|
|
531
532
|
h(this, xt, /* @__PURE__ */ c(() => {
|
|
532
|
-
!t(this,
|
|
533
|
+
!t(this, m) || !(t(this, m) instanceof HTMLElement) || (g(this, $, new ResizeObserver((i) => {
|
|
533
534
|
for (const e of i) {
|
|
534
535
|
const s = e.target;
|
|
535
536
|
if (!s.classList.contains("active")) continue;
|
|
@@ -539,31 +540,31 @@ const jt = class jt {
|
|
|
539
540
|
const n = s.querySelector("thead");
|
|
540
541
|
n && (r += n.offsetHeight || n.getBoundingClientRect().height);
|
|
541
542
|
const l = Math.max(o - r, 100);
|
|
542
|
-
t(this,
|
|
543
|
+
t(this, V) !== l && (g(this, V, l), t(this, rt).call(this), t(this, R) !== null && t(this, lt).call(this));
|
|
543
544
|
}
|
|
544
545
|
}
|
|
545
|
-
})), t(this, $).observe(t(this,
|
|
546
|
+
})), t(this, $).observe(t(this, m)));
|
|
546
547
|
}, "#initResizeObserver"));
|
|
547
548
|
h(this, lt, /* @__PURE__ */ c(() => {
|
|
548
549
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
549
|
-
const e = t(this,
|
|
550
|
+
const e = t(this, m).querySelector(i);
|
|
550
551
|
e && e.querySelector("tbody.bindable-tbody") && t(this, yt).call(this, e, i);
|
|
551
552
|
}), t(this, mt).call(this);
|
|
552
553
|
}, "#renderAllContainers"));
|
|
553
|
-
h(this,
|
|
554
|
+
h(this, j, /* @__PURE__ */ c((i) => {
|
|
554
555
|
var r;
|
|
555
556
|
const e = t(this, R);
|
|
556
557
|
if (!e || e <= 0) return;
|
|
557
558
|
const s = Math.max(0, Math.floor(i / e)), o = ((r = t(this, _).get(".ng-container-body")) == null ? void 0 : r.length) || 1;
|
|
558
559
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
559
|
-
const l = t(this,
|
|
560
|
+
const l = t(this, m).querySelector(n);
|
|
560
561
|
if (!l) return;
|
|
561
562
|
const a = l.querySelector("tbody.bindable-tbody");
|
|
562
563
|
if (!a) return;
|
|
563
564
|
Array.from(a.querySelectorAll("tr:not(.nodata)")).forEach((f, u) => {
|
|
564
|
-
var E, q,
|
|
565
|
-
const b = s + Math.floor(u / o),
|
|
566
|
-
f.style.display = "", t(this, vt).call(this, f,
|
|
565
|
+
var E, q, O, ee;
|
|
566
|
+
const b = s + Math.floor(u / o), p = (typeof t(this, m).getData == "function" ? t(this, m).getData(b) : null) ?? (typeof ((E = t(this, m).data) == null ? void 0 : E.get) == "function" ? t(this, m).data.get(b) : null) ?? ((O = (q = t(this, m).dataManager) == null ? void 0 : q.rawRecords) == null ? void 0 : O[b]) ?? ((ee = t(this, m).data) == null ? void 0 : ee[b]) ?? { _index: b };
|
|
567
|
+
f.style.display = "", t(this, vt).call(this, f, p, b);
|
|
567
568
|
});
|
|
568
569
|
});
|
|
569
570
|
}, "#handleScroll"));
|
|
@@ -576,7 +577,7 @@ const jt = class jt {
|
|
|
576
577
|
w(this, "destroy", /* @__PURE__ */ c(() => {
|
|
577
578
|
t(this, $) && (t(this, $).disconnect(), g(this, $, null));
|
|
578
579
|
}, "destroy"));
|
|
579
|
-
g(this, nt, i.getRootNode().host), g(this,
|
|
580
|
+
g(this, nt, i.getRootNode().host), g(this, m, i), t(this, xt).call(this);
|
|
580
581
|
}
|
|
581
582
|
getRowHeight() {
|
|
582
583
|
return t(this, R);
|
|
@@ -586,15 +587,15 @@ const jt = class jt {
|
|
|
586
587
|
return ((e = t(this, _).get(i)) == null ? void 0 : e.length) || 1;
|
|
587
588
|
}
|
|
588
589
|
};
|
|
589
|
-
nt = new WeakMap(),
|
|
590
|
+
nt = new WeakMap(), m = new WeakMap(), _ = new WeakMap(), R = new WeakMap(), $ = new WeakMap(), V = new WeakMap(), K = new WeakMap(), yt = new WeakMap(), pt = new WeakMap(), ot = new WeakMap(), rt = new WeakMap(), mt = new WeakMap(), xt = new WeakMap(), lt = new WeakMap(), j = new WeakMap(), vt = new WeakMap(), c(jt, "RowManager");
|
|
590
591
|
let Dt = jt;
|
|
591
|
-
var wt,
|
|
592
|
+
var wt, Z, G, St, Et, Rt, kt, qt;
|
|
592
593
|
const et = class et extends HTMLElement {
|
|
593
594
|
constructor() {
|
|
594
595
|
super();
|
|
595
596
|
h(this, wt);
|
|
596
|
-
h(this,
|
|
597
|
-
h(this,
|
|
597
|
+
h(this, Z, null);
|
|
598
|
+
h(this, G);
|
|
598
599
|
h(this, St, /* @__PURE__ */ c(() => {
|
|
599
600
|
[
|
|
600
601
|
{ selector: ".ng-container-body", type: null },
|
|
@@ -603,7 +604,7 @@ const et = class et extends HTMLElement {
|
|
|
603
604
|
].forEach(({ selector: s, type: o }) => {
|
|
604
605
|
const r = this.querySelector(s);
|
|
605
606
|
if (!r) return;
|
|
606
|
-
const n = t(this, Rt).call(this, t(this,
|
|
607
|
+
const n = t(this, Rt).call(this, t(this, Z), o);
|
|
607
608
|
r.innerHTML = "", r.appendChild(n);
|
|
608
609
|
});
|
|
609
610
|
}, "#renderSplitContainers"));
|
|
@@ -619,13 +620,13 @@ const et = class et extends HTMLElement {
|
|
|
619
620
|
});
|
|
620
621
|
}, "#updateContainerWidths"));
|
|
621
622
|
w(this, "generate", /* @__PURE__ */ c((e) => {
|
|
622
|
-
e && (g(this,
|
|
623
|
+
e && (g(this, Z, Ot.compile(e)), t(this, Z).style.display = "table", t(this, St).call(this), t(this, Et).call(this), requestAnimationFrame(() => {
|
|
623
624
|
var o;
|
|
624
625
|
const s = (o = this.querySelector("thead")) == null ? void 0 : o.getBoundingClientRect().height;
|
|
625
626
|
this.querySelectorAll("tbody.fixed-tbody").forEach((r) => {
|
|
626
627
|
r.style.top = `${s}px`;
|
|
627
628
|
});
|
|
628
|
-
}), t(this,
|
|
629
|
+
}), t(this, G).initialize(), setTimeout(() => {
|
|
629
630
|
var s;
|
|
630
631
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
631
632
|
}, 0));
|
|
@@ -647,7 +648,7 @@ const et = class et extends HTMLElement {
|
|
|
647
648
|
n.remove();
|
|
648
649
|
}), o;
|
|
649
650
|
}, "#createSplitTable"));
|
|
650
|
-
w(this, "getRowHeight", /* @__PURE__ */ c(() => t(this,
|
|
651
|
+
w(this, "getRowHeight", /* @__PURE__ */ c(() => t(this, G).getRowHeight(), "getRowHeight"));
|
|
651
652
|
w(this, "scrollToX", /* @__PURE__ */ c((e) => {
|
|
652
653
|
const s = this.querySelector(".ng-container-body");
|
|
653
654
|
s && (s.scrollLeft = e);
|
|
@@ -806,16 +807,16 @@ const et = class et extends HTMLElement {
|
|
|
806
807
|
</div>
|
|
807
808
|
`;
|
|
808
809
|
}, "#render"));
|
|
809
|
-
g(this,
|
|
810
|
+
g(this, G, new Dt(this)), g(this, wt, this.getRootNode().host);
|
|
810
811
|
}
|
|
811
812
|
connectedCallback() {
|
|
812
813
|
t(this, kt).call(this);
|
|
813
814
|
}
|
|
814
815
|
disconnectedCallback() {
|
|
815
|
-
this.innerHTML = "",
|
|
816
|
+
this.innerHTML = "", tt.log("NineTableSheet destroyed.");
|
|
816
817
|
}
|
|
817
818
|
};
|
|
818
|
-
wt = new WeakMap(),
|
|
819
|
+
wt = new WeakMap(), Z = new WeakMap(), G = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), Rt = new WeakMap(), kt = new WeakMap(), qt = new WeakMap(), c(et, "NineTableSheet"), w(et, "SCROLLBAR_SIZE", 16);
|
|
819
820
|
let dt = et;
|
|
820
821
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", dt);
|
|
821
822
|
var Tt, ct;
|
|
@@ -833,11 +834,11 @@ const Zt = class Zt extends HTMLElement {
|
|
|
833
834
|
h(this, ct, /* @__PURE__ */ c((e, s = !1) => {
|
|
834
835
|
const o = /* @__PURE__ */ c(() => {
|
|
835
836
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
836
|
-
Array.from(this.querySelectorAll("nine-splitter")).forEach((
|
|
837
|
-
const b = f.filter((
|
|
838
|
-
b.length < 2 || b.forEach((
|
|
839
|
-
const E = parseInt(
|
|
840
|
-
q &&
|
|
837
|
+
Array.from(this.querySelectorAll("nine-splitter")).forEach((p) => p.style.setProperty("display", "none"));
|
|
838
|
+
const b = f.filter((p) => p.classList.contains("active"));
|
|
839
|
+
b.length < 2 || b.forEach((p) => {
|
|
840
|
+
const E = parseInt(p.getAttribute("data-index"), 10), q = this.querySelector(`nine-splitter[data-split-index="${E}"]`), O = f[E + 1];
|
|
841
|
+
q && O && O.classList.contains("active") && q.style.setProperty("display", "flex");
|
|
841
842
|
});
|
|
842
843
|
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), n = this.querySelector("nine-table-sheets-body"), l = r.querySelectorAll(".nine-tab-item"), a = n.querySelectorAll("nine-table-sheet");
|
|
843
844
|
if (!l[e]) return;
|
|
@@ -1002,36 +1003,36 @@ const Gt = class Gt {
|
|
|
1002
1003
|
};
|
|
1003
1004
|
k = new WeakMap(), At = new WeakMap(), at = new WeakMap(), Lt = new WeakMap(), c(Gt, "LayoutManager");
|
|
1004
1005
|
let Bt = Gt;
|
|
1005
|
-
var W,
|
|
1006
|
+
var W, X;
|
|
1006
1007
|
const Jt = class Jt {
|
|
1007
1008
|
constructor(i) {
|
|
1008
1009
|
h(this, W);
|
|
1009
|
-
h(this,
|
|
1010
|
+
h(this, X, -1);
|
|
1010
1011
|
w(this, "count", /* @__PURE__ */ c(() => t(this, W).rawRecords.length, "count"));
|
|
1011
1012
|
g(this, W, i);
|
|
1012
1013
|
}
|
|
1013
1014
|
get at() {
|
|
1014
|
-
return t(this,
|
|
1015
|
+
return t(this, X);
|
|
1015
1016
|
}
|
|
1016
1017
|
set at(i) {
|
|
1017
1018
|
var s, o;
|
|
1018
|
-
g(this,
|
|
1019
|
+
g(this, X, parseInt(i, 10));
|
|
1019
1020
|
const e = ((o = (s = t(this, W).owner).querySelector) == null ? void 0 : o.call(s, ".ng-container-body")) || t(this, W).owner.body;
|
|
1020
|
-
e && !e.querySelector(`tbody.bindable tr[data-row="${t(this,
|
|
1021
|
+
e && !e.querySelector(`tbody.bindable tr[data-row="${t(this, X)}"]`) && setTimeout(() => {
|
|
1021
1022
|
var r, n;
|
|
1022
|
-
(n = (r = t(this, W).owner).scrollTo_V1) == null || n.call(r, t(this,
|
|
1023
|
+
(n = (r = t(this, W).owner).scrollTo_V1) == null || n.call(r, t(this, X));
|
|
1023
1024
|
});
|
|
1024
1025
|
}
|
|
1025
1026
|
};
|
|
1026
|
-
W = new WeakMap(),
|
|
1027
|
+
W = new WeakMap(), X = new WeakMap(), c(Jt, "ngRow");
|
|
1027
1028
|
let Pt = Jt;
|
|
1028
|
-
var T, v, A,
|
|
1029
|
+
var T, v, A, J, Ht, z, Ct, ht, _t, Mt, Q;
|
|
1029
1030
|
const L = class L {
|
|
1030
1031
|
constructor(i, e) {
|
|
1031
1032
|
h(this, T);
|
|
1032
1033
|
h(this, v);
|
|
1033
1034
|
h(this, A, []);
|
|
1034
|
-
h(this,
|
|
1035
|
+
h(this, J, []);
|
|
1035
1036
|
h(this, Ht, 0);
|
|
1036
1037
|
h(this, z, []);
|
|
1037
1038
|
h(this, Ct, /* @__PURE__ */ c(() => {
|
|
@@ -1057,11 +1058,11 @@ const L = class L {
|
|
|
1057
1058
|
_: [0, 0, 0, 0, L.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, z).slice(), -1, {}, {}]
|
|
1058
1059
|
}), "#getDefaultMeta"));
|
|
1059
1060
|
w(this, "reset", /* @__PURE__ */ c(() => {
|
|
1060
|
-
g(this, A, []), g(this,
|
|
1061
|
+
g(this, A, []), g(this, J, []);
|
|
1061
1062
|
}, "reset"));
|
|
1062
1063
|
w(this, "clear", /* @__PURE__ */ c(() => {
|
|
1063
1064
|
var i;
|
|
1064
|
-
t(this, v).rawRecords = [], g(this, A, []), g(this,
|
|
1065
|
+
t(this, v).rawRecords = [], g(this, A, []), g(this, J, []), (i = t(this, v).viewRecords) != null && i.reset && t(this, v).viewRecords.reset();
|
|
1065
1066
|
}, "clear"));
|
|
1066
1067
|
h(this, _t, /* @__PURE__ */ c((i) => {
|
|
1067
1068
|
var o;
|
|
@@ -1111,14 +1112,14 @@ const L = class L {
|
|
|
1111
1112
|
l !== s && n.__ng.rowState !== L.ROW_STATE.INSERT && (n.__ng.o.hasOwnProperty(e) || (n.__ng.o[e] = l), n.__ng.rowState = L.ROW_STATE.UPDATE), n.v[r] = s, t(this, v).owner.refreshData && t(this, v).owner.refreshData(i);
|
|
1112
1113
|
}, "setValue"));
|
|
1113
1114
|
w(this, "resetRecords", /* @__PURE__ */ c(() => {
|
|
1114
|
-
g(this,
|
|
1115
|
+
g(this, J, t(this, v).rawRecords.filter((i) => !i.__ng.deleted)), g(this, A, t(this, v).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, v).rawRecords.forEach((i, e) => {
|
|
1115
1116
|
i.__ng.rowidx = e;
|
|
1116
1117
|
}), t(this, A).forEach((i, e) => {
|
|
1117
1118
|
i.__ng.i = e;
|
|
1118
1119
|
});
|
|
1119
1120
|
}, "resetRecords"));
|
|
1120
1121
|
w(this, "getValidData", /* @__PURE__ */ c(() => (t(this, A).length === 0 && t(this, v).rawRecords.length > 0 && this.resetRecords(), t(this, A)), "getValidData"));
|
|
1121
|
-
h(this,
|
|
1122
|
+
h(this, Q, /* @__PURE__ */ c((i) => {
|
|
1122
1123
|
var s;
|
|
1123
1124
|
if (!i) return i;
|
|
1124
1125
|
const e = typeof ((s = t(this, T).fields) == null ? void 0 : s.get) == "function" ? t(this, T).fields.get() : [];
|
|
@@ -1134,19 +1135,19 @@ const L = class L {
|
|
|
1134
1135
|
var r;
|
|
1135
1136
|
const s = this.getValidData();
|
|
1136
1137
|
if (!s || s.length <= 0) return;
|
|
1137
|
-
if (i == null) return t(this,
|
|
1138
|
+
if (i == null) return t(this, Q).call(this, s);
|
|
1138
1139
|
if (i < 0 || i >= s.length) return null;
|
|
1139
1140
|
const o = typeof ((r = t(this, T).fields) == null ? void 0 : r.get) == "function" ? t(this, T).fields.get() : [];
|
|
1140
1141
|
if (e != null) {
|
|
1141
1142
|
const n = o.indexOf(e);
|
|
1142
1143
|
return n >= 0 ? s[i].v[n] : null;
|
|
1143
1144
|
}
|
|
1144
|
-
return t(this,
|
|
1145
|
+
return t(this, Q).call(this, s[i]);
|
|
1145
1146
|
}, "get"));
|
|
1146
1147
|
g(this, T, i), g(this, v, e), t(this, Ct).call(this);
|
|
1147
1148
|
}
|
|
1148
1149
|
get source() {
|
|
1149
|
-
return t(this,
|
|
1150
|
+
return t(this, Q).call(this, t(this, v).rawRecords);
|
|
1150
1151
|
}
|
|
1151
1152
|
set source(i) {
|
|
1152
1153
|
this.clear(), this.add(i, !1);
|
|
@@ -1161,7 +1162,7 @@ const L = class L {
|
|
|
1161
1162
|
return this.length;
|
|
1162
1163
|
}
|
|
1163
1164
|
};
|
|
1164
|
-
T = new WeakMap(), v = new WeakMap(), A = new WeakMap(),
|
|
1165
|
+
T = new WeakMap(), v = new WeakMap(), A = new WeakMap(), J = new WeakMap(), Ht = new WeakMap(), z = new WeakMap(), Ct = new WeakMap(), ht = new WeakMap(), _t = new WeakMap(), Mt = new WeakMap(), Q = new WeakMap(), c(L, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1165
1166
|
w(L, "ROW_STATE", {
|
|
1166
1167
|
EMPTY: "EMPTY",
|
|
1167
1168
|
NORMAL: "NORMAL",
|
|
@@ -1191,35 +1192,35 @@ const Qt = class Qt {
|
|
|
1191
1192
|
};
|
|
1192
1193
|
c(Qt, "ngDataManager");
|
|
1193
1194
|
let Vt = Qt;
|
|
1194
|
-
var
|
|
1195
|
+
var U, It;
|
|
1195
1196
|
const te = class te extends HTMLElement {
|
|
1196
1197
|
constructor() {
|
|
1197
1198
|
super();
|
|
1198
1199
|
//#created = false;
|
|
1199
|
-
h(this,
|
|
1200
|
+
h(this, U);
|
|
1200
1201
|
h(this, It);
|
|
1201
|
-
this.attachShadow({ mode: "open" }), g(this,
|
|
1202
|
+
this.attachShadow({ mode: "open" }), g(this, U, new Vt(this));
|
|
1202
1203
|
}
|
|
1203
1204
|
connectedCallback() {
|
|
1204
|
-
g(this, It, new Bt(this)),
|
|
1205
|
+
g(this, It, new Bt(this)), tt.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1205
1206
|
}
|
|
1206
1207
|
disconnectedCallback() {
|
|
1207
|
-
|
|
1208
|
+
tt.log("NineTable disconnected.");
|
|
1208
1209
|
}
|
|
1209
1210
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1210
1211
|
get data() {
|
|
1211
|
-
return t(this,
|
|
1212
|
+
return t(this, U).data;
|
|
1212
1213
|
}
|
|
1213
1214
|
// π― ν(row) κ΄λ ¨ μ μ΄ μ κ·Όμ μ€ν
|
|
1214
1215
|
get row() {
|
|
1215
|
-
return t(this,
|
|
1216
|
+
return t(this, U).row;
|
|
1216
1217
|
}
|
|
1217
1218
|
// π― μ 체 λ°μ΄ν° λ§€λμ μ κ·Ό νμν κ²½μ°
|
|
1218
1219
|
get dataManager() {
|
|
1219
|
-
return t(this,
|
|
1220
|
+
return t(this, U);
|
|
1220
1221
|
}
|
|
1221
1222
|
};
|
|
1222
|
-
|
|
1223
|
+
U = new WeakMap(), It = new WeakMap(), c(te, "NineTable");
|
|
1223
1224
|
let Xt = te;
|
|
1224
1225
|
customElements.get("nine-table") || customElements.define("nine-table", Xt);
|
|
1225
1226
|
//# sourceMappingURL=nine-table.js.map
|