@ninebone/table 0.0.413 β 0.0.414
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 +94 -84
- 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
|
@@ -21,24 +21,24 @@ const re = class re extends Se.constructor {
|
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
a(re, "Trace");
|
|
24
|
-
let
|
|
25
|
-
const
|
|
26
|
-
var _, O, p,
|
|
24
|
+
let jt = re;
|
|
25
|
+
const k = new jt();
|
|
26
|
+
var _, O, p, P, V, Y, St, X, Et;
|
|
27
27
|
const le = class le extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
c(this, _);
|
|
31
31
|
c(this, O, !1);
|
|
32
32
|
c(this, p);
|
|
33
|
-
c(this, N);
|
|
34
33
|
c(this, P);
|
|
35
34
|
c(this, V);
|
|
35
|
+
c(this, Y);
|
|
36
36
|
c(this, St, /* @__PURE__ */ a(() => {
|
|
37
37
|
if (!t(this, _)) return;
|
|
38
38
|
const e = t(this, _).querySelector(".ng-container-body");
|
|
39
|
-
e && (g(this,
|
|
39
|
+
e && (g(this, Y, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
|
-
})), t(this,
|
|
41
|
+
})), t(this, Y).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
v(this, "refresh", /* @__PURE__ */ a(() => {
|
|
44
44
|
if (!t(this, _) || !t(this, p) || t(this, O)) return;
|
|
@@ -59,9 +59,9 @@ const le = class le extends HTMLElement {
|
|
|
59
59
|
let y = 0;
|
|
60
60
|
b > 0 && (y = parseInt(u / b * (h - f), 10)), y < 0 && (y = 0);
|
|
61
61
|
const m = h - f;
|
|
62
|
-
y > m && (y = m), r.style.left = `${y}px`,
|
|
62
|
+
y > m && (y = m), r.style.left = `${y}px`, k.log(y), t(this, p).left.disabled = y === 0, t(this, p).right.disabled = y >= m - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
c(this,
|
|
64
|
+
c(this, X, /* @__PURE__ */ a((e) => {
|
|
65
65
|
if (!t(this, p)) return !1;
|
|
66
66
|
const s = t(this, p).container, n = s.querySelector("table");
|
|
67
67
|
if (!n) return !1;
|
|
@@ -75,16 +75,16 @@ const le = class le extends HTMLElement {
|
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
76
|
c(this, Et, /* @__PURE__ */ a(() => {
|
|
77
77
|
const e = /* @__PURE__ */ a((n) => {
|
|
78
|
-
clearInterval(t(this,
|
|
78
|
+
clearInterval(t(this, P)), clearInterval(t(this, V));
|
|
79
79
|
const r = parseInt(t(this, p).thumb.style.left || 0, 10);
|
|
80
|
-
t(this,
|
|
81
|
-
clearInterval(t(this,
|
|
80
|
+
t(this, X).call(this, r + n), g(this, P, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, P)), g(this, V, setInterval(() => {
|
|
82
82
|
const o = parseInt(t(this, p).thumb.style.left || 0, 10);
|
|
83
|
-
t(this,
|
|
83
|
+
t(this, X).call(this, o + n) || clearInterval(t(this, V));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), s = /* @__PURE__ */ a(() => {
|
|
87
|
-
clearInterval(t(this,
|
|
87
|
+
clearInterval(t(this, P)), clearInterval(t(this, V));
|
|
88
88
|
}, "clearTimer");
|
|
89
89
|
["mouseup", "mouseleave", "touchend"].forEach((n) => {
|
|
90
90
|
t(this, p).left.addEventListener(n, s), t(this, p).right.addEventListener(n, s), t(this, p).track.addEventListener(n, s);
|
|
@@ -96,14 +96,14 @@ const le = class le extends HTMLElement {
|
|
|
96
96
|
if (n.button !== 0) return;
|
|
97
97
|
n.preventDefault();
|
|
98
98
|
const r = t(this, p).track.getBoundingClientRect(), o = t(this, p).thumb.clientWidth;
|
|
99
|
-
t(this,
|
|
99
|
+
t(this, X).call(this, n.clientX - r.left - o / 2);
|
|
100
100
|
}), t(this, p).thumb.addEventListener("mousedown", (n) => {
|
|
101
101
|
if (n.button !== 0) return;
|
|
102
102
|
n.stopPropagation(), n.preventDefault(), g(this, O, !0), this.shiftX = n.clientX - t(this, p).thumb.getBoundingClientRect().left;
|
|
103
103
|
const r = /* @__PURE__ */ a((l) => {
|
|
104
104
|
if (!t(this, O)) return;
|
|
105
105
|
const d = t(this, p).track.getBoundingClientRect();
|
|
106
|
-
t(this,
|
|
106
|
+
t(this, X).call(this, l.clientX - d.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), o = /* @__PURE__ */ a(() => {
|
|
108
108
|
g(this, O, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
@@ -195,17 +195,17 @@ const le = class le extends HTMLElement {
|
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
197
197
|
disconnectedCallback() {
|
|
198
|
-
t(this,
|
|
198
|
+
t(this, Y) && t(this, Y).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
_ = new WeakMap(), O = new WeakMap(), p = new WeakMap(),
|
|
201
|
+
_ = new WeakMap(), O = new WeakMap(), p = new WeakMap(), P = new WeakMap(), V = new WeakMap(), Y = new WeakMap(), St = new WeakMap(), X = new WeakMap(), Et = new WeakMap(), a(le, "NineTableHScrollBar");
|
|
202
202
|
let Kt = le;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Kt);
|
|
204
|
-
var
|
|
204
|
+
var U, Q, z, S, ht, dt, Rt;
|
|
205
205
|
const ae = class ae extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
-
c(this,
|
|
208
|
+
c(this, U);
|
|
209
209
|
c(this, Q);
|
|
210
210
|
c(this, z, !1);
|
|
211
211
|
c(this, S);
|
|
@@ -215,8 +215,8 @@ const ae = class ae extends HTMLElement {
|
|
|
215
215
|
* π― μ€ν¬λ‘€λ° μμΉ λ° μΈλΈ ν¬κΈ° κ°±μ
|
|
216
216
|
*/
|
|
217
217
|
v(this, "refresh", /* @__PURE__ */ a(() => {
|
|
218
|
-
|
|
219
|
-
const e = t(this, S).container, s = t(this, S).track, n = t(this, S).thumb, r = e.clientHeight, l = (t(this,
|
|
218
|
+
k.log("refresh", t(this, z)), k.log("refresh2");
|
|
219
|
+
const e = t(this, S).container, s = t(this, S).track, n = t(this, S).thumb, r = e.clientHeight, l = (t(this, U).data.get() || []).length, d = t(this, Q).getRowHeight(), h = l * d;
|
|
220
220
|
if (h <= r) {
|
|
221
221
|
n.style.display = "none", t(this, S).top.disabled = !0, t(this, S).bottom.disabled = !0;
|
|
222
222
|
return;
|
|
@@ -230,11 +230,11 @@ const ae = class ae extends HTMLElement {
|
|
|
230
230
|
let m = 0;
|
|
231
231
|
y > 0 && (m = b / y * (f - u));
|
|
232
232
|
const R = f - u;
|
|
233
|
-
m < 0 && (m = 0), m > R && (m = R), n.style.top = `${m}px`,
|
|
233
|
+
m < 0 && (m = 0), m > R && (m = R), n.style.top = `${m}px`, k.log("currentScrollTop", b), k.log("maxScrollTop", y), k.log("trackHeight", f), k.log("thumbHeight", u), t(this, S).top.disabled = b <= 0, t(this, S).bottom.disabled = b >= y - 1;
|
|
234
234
|
}, "refresh"));
|
|
235
235
|
c(this, Rt, /* @__PURE__ */ a(() => {
|
|
236
236
|
const e = t(this, S).container, s = /* @__PURE__ */ a(() => {
|
|
237
|
-
const r = (t(this,
|
|
237
|
+
const r = (t(this, U).data.get() || []).length, o = t(this, Q).getRowHeight();
|
|
238
238
|
return r * o;
|
|
239
239
|
}, "getContentHeight");
|
|
240
240
|
e.addEventListener("scroll", () => {
|
|
@@ -272,7 +272,7 @@ const ae = class ae extends HTMLElement {
|
|
|
272
272
|
}, "#init"));
|
|
273
273
|
}
|
|
274
274
|
connectedCallback() {
|
|
275
|
-
g(this,
|
|
275
|
+
g(this, U, this.getRootNode().host), g(this, Q, this.closest("nine-table-sheet")), this.innerHTML = `
|
|
276
276
|
<style>
|
|
277
277
|
nine-table-vscrollbar {
|
|
278
278
|
display: flex;
|
|
@@ -338,7 +338,7 @@ const ae = class ae extends HTMLElement {
|
|
|
338
338
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
339
339
|
`;
|
|
340
340
|
const e = /* @__PURE__ */ a(() => {
|
|
341
|
-
const s = t(this,
|
|
341
|
+
const s = t(this, U).shadowRoot.querySelector(".ng-container-body");
|
|
342
342
|
if (!s) {
|
|
343
343
|
setTimeout(e, 10);
|
|
344
344
|
return;
|
|
@@ -354,7 +354,7 @@ const ae = class ae extends HTMLElement {
|
|
|
354
354
|
e();
|
|
355
355
|
}
|
|
356
356
|
};
|
|
357
|
-
|
|
357
|
+
U = new WeakMap(), Q = new WeakMap(), z = new WeakMap(), S = new WeakMap(), ht = new WeakMap(), dt = new WeakMap(), Rt = new WeakMap(), a(ae, "NineTableVScrollBar");
|
|
358
358
|
let Zt = ae;
|
|
359
359
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Zt);
|
|
360
360
|
var At, tt;
|
|
@@ -428,16 +428,16 @@ At = new WeakMap(), tt = new WeakMap(), a(M, "TableCompiler"), c(M, At, /* @__PU
|
|
|
428
428
|
});
|
|
429
429
|
}, "#resetColIndex"));
|
|
430
430
|
let Gt = M;
|
|
431
|
-
var I, w, W,
|
|
431
|
+
var I, w, W, T, D, F, B, et, Tt, qt, kt, ft, ut, Lt, Ht, gt, Ct, it, bt;
|
|
432
432
|
const ce = class ce {
|
|
433
433
|
constructor(i) {
|
|
434
434
|
c(this, I);
|
|
435
435
|
c(this, w);
|
|
436
436
|
c(this, W, /* @__PURE__ */ new Map());
|
|
437
|
-
c(this,
|
|
438
|
-
c(this,
|
|
439
|
-
c(this,
|
|
440
|
-
c(this,
|
|
437
|
+
c(this, T, null);
|
|
438
|
+
c(this, D, null);
|
|
439
|
+
c(this, F, 0);
|
|
440
|
+
c(this, B, 40);
|
|
441
441
|
c(this, et, !1);
|
|
442
442
|
c(this, Tt, 3);
|
|
443
443
|
v(this, "refresh", /* @__PURE__ */ a(() => {
|
|
@@ -446,7 +446,7 @@ const ce = class ce {
|
|
|
446
446
|
i && (t(this, ft).call(this), t(this, it).call(this, i.scrollTop), (e = t(this, w).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
447
447
|
}, "refresh"));
|
|
448
448
|
v(this, "initialize", /* @__PURE__ */ a(() => {
|
|
449
|
-
g(this,
|
|
449
|
+
g(this, T, null), t(this, W).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
450
450
|
const r = t(this, w).querySelector(n);
|
|
451
451
|
if (!r) return;
|
|
452
452
|
const o = r.querySelector("table");
|
|
@@ -458,7 +458,7 @@ const ce = class ce {
|
|
|
458
458
|
});
|
|
459
459
|
const i = t(this, w).querySelector(".ng-container-body"), e = t(this, w).querySelector(".ng-container-left"), s = t(this, w).querySelector(".ng-container-right");
|
|
460
460
|
if (i) {
|
|
461
|
-
t(this,
|
|
461
|
+
t(this, kt).call(this, i), t(this, gt).call(this), t(this, ft).call(this), t(this, it).call(this, i.scrollTop);
|
|
462
462
|
let n = i.scrollTop;
|
|
463
463
|
const r = /* @__PURE__ */ a((o) => {
|
|
464
464
|
var l;
|
|
@@ -470,12 +470,22 @@ const ce = class ce {
|
|
|
470
470
|
});
|
|
471
471
|
}
|
|
472
472
|
}, "initialize"));
|
|
473
|
-
c(this,
|
|
474
|
-
|
|
473
|
+
c(this, qt, /* @__PURE__ */ a((i, e) => {
|
|
474
|
+
const s = t(this, W).get(e);
|
|
475
|
+
if (!s || s.length === 0) return;
|
|
476
|
+
const n = i.querySelector("tbody.bindable-tbody");
|
|
477
|
+
if (!n) return;
|
|
478
|
+
n.querySelectorAll("tr:not(.nodata)").forEach((l) => l.remove());
|
|
479
|
+
const r = n.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
480
|
+
for (let l = 0; l < t(this, B); l++)
|
|
481
|
+
s.forEach((d) => {
|
|
482
|
+
o.appendChild(d.cloneNode(!0));
|
|
483
|
+
});
|
|
484
|
+
r ? r.before(o) : n.appendChild(o);
|
|
475
485
|
}, "#renderRows"));
|
|
476
|
-
c(this,
|
|
477
|
-
if (t(this,
|
|
478
|
-
return t(this,
|
|
486
|
+
c(this, kt, /* @__PURE__ */ a((i) => {
|
|
487
|
+
if (t(this, T) !== null && t(this, T) > 0)
|
|
488
|
+
return t(this, T);
|
|
479
489
|
const e = t(this, W).get(".ng-container-body");
|
|
480
490
|
if (!e || e.length === 0) return 24;
|
|
481
491
|
const s = i.querySelector("tbody.bindable-tbody") || i.querySelector("tbody.bindable-tbody:last-of-type");
|
|
@@ -491,20 +501,20 @@ const ce = class ce {
|
|
|
491
501
|
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
492
502
|
return u.forEach((b) => {
|
|
493
503
|
f += b.offsetHeight || b.getBoundingClientRect().height;
|
|
494
|
-
}), u.forEach((b) => b.remove()), o.style.display = l, o.style.visibility = d, o.style.position = h, g(this,
|
|
504
|
+
}), u.forEach((b) => b.remove()), o.style.display = l, o.style.visibility = d, o.style.position = h, g(this, T, f > 0 ? f : 24), t(this, ut).call(this), t(this, T);
|
|
495
505
|
}, "#measureAndCacheHeight"));
|
|
496
506
|
c(this, ft, /* @__PURE__ */ a(() => {
|
|
497
507
|
if (!t(this, w).querySelector(".ng-container-body")) return;
|
|
498
|
-
const s = (t(this, I).data.get() || []).length, n = t(this,
|
|
499
|
-
|
|
508
|
+
const s = (t(this, I).data.get() || []).length, n = t(this, T) || 24, r = s * n;
|
|
509
|
+
k.log(`[VirtualHeight] totalCount: ${s}, rowHeight: ${n}, totalVirtualHeight: ${r}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
500
510
|
const l = t(this, w).querySelector(o), d = l == null ? void 0 : l.querySelector("table");
|
|
501
511
|
d && (d.style.height = `${r}px`);
|
|
502
512
|
});
|
|
503
513
|
}, "#updateVirtualScrollHeight"));
|
|
504
514
|
c(this, ut, /* @__PURE__ */ a(() => {
|
|
505
|
-
if ((t(this, I).data.get() || []).length, t(this,
|
|
506
|
-
const e = Math.ceil(t(this,
|
|
507
|
-
g(this,
|
|
515
|
+
if ((t(this, I).data.get() || []).length, t(this, F) > 0 && t(this, T) > 0) {
|
|
516
|
+
const e = Math.ceil(t(this, F) / t(this, T));
|
|
517
|
+
g(this, B, e + t(this, Tt)), k.log("visibleRows:", e, "cachedRowCount:", t(this, B));
|
|
508
518
|
}
|
|
509
519
|
}, "#updateRowCount"));
|
|
510
520
|
c(this, Lt, /* @__PURE__ */ a(() => {
|
|
@@ -522,7 +532,7 @@ const ce = class ce {
|
|
|
522
532
|
}
|
|
523
533
|
}, "#syncRowHeights"));
|
|
524
534
|
c(this, Ht, /* @__PURE__ */ a(() => {
|
|
525
|
-
!t(this, w) || !(t(this, w) instanceof HTMLElement) || (g(this,
|
|
535
|
+
!t(this, w) || !(t(this, w) instanceof HTMLElement) || (g(this, D, new ResizeObserver((i) => {
|
|
526
536
|
for (const e of i) {
|
|
527
537
|
const s = e.target;
|
|
528
538
|
if (!s.classList.contains("active")) continue;
|
|
@@ -532,15 +542,15 @@ const ce = class ce {
|
|
|
532
542
|
const o = s.querySelector("thead");
|
|
533
543
|
o && (r += o.offsetHeight || o.getBoundingClientRect().height);
|
|
534
544
|
const l = Math.max(n - r, 100);
|
|
535
|
-
t(this,
|
|
545
|
+
t(this, F) !== l && (g(this, F, l), t(this, ut).call(this), t(this, T) !== null && t(this, gt).call(this));
|
|
536
546
|
}
|
|
537
547
|
}
|
|
538
|
-
})), t(this,
|
|
548
|
+
})), t(this, D).observe(t(this, w)));
|
|
539
549
|
}, "#initResizeObserver"));
|
|
540
550
|
c(this, gt, /* @__PURE__ */ a(() => {
|
|
541
551
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
542
552
|
const e = t(this, w).querySelector(i);
|
|
543
|
-
e && e.querySelector("tbody.bindable-tbody") && t(this,
|
|
553
|
+
e && e.querySelector("tbody.bindable-tbody") && t(this, qt).call(this, e, i);
|
|
544
554
|
}), t(this, Lt).call(this);
|
|
545
555
|
}, "#renderAllContainers"));
|
|
546
556
|
c(this, Ct, /* @__PURE__ */ a((i) => {
|
|
@@ -564,10 +574,10 @@ const ce = class ce {
|
|
|
564
574
|
}, "#adjustBufferRows"));
|
|
565
575
|
c(this, it, /* @__PURE__ */ a((i) => {
|
|
566
576
|
var d;
|
|
567
|
-
const e = t(this,
|
|
577
|
+
const e = t(this, T);
|
|
568
578
|
if (!e || e <= 0) return;
|
|
569
|
-
const n = (t(this, I).data.get() || []).length, r = Math.max(0, Math.floor(i / e)), o = ((d = t(this, W).get(".ng-container-body")) == null ? void 0 : d.length) || 1, l = r + t(this,
|
|
570
|
-
|
|
579
|
+
const n = (t(this, I).data.get() || []).length, r = Math.max(0, Math.floor(i / e)), o = ((d = t(this, W).get(".ng-container-body")) == null ? void 0 : d.length) || 1, l = r + t(this, B);
|
|
580
|
+
k.log(`[Scroll] scrollTop: ${i}, startIndex: ${r}, cachedRowCount: ${t(this, B)}, targetDataIndex range: ${r} ~ ${l} (Total: ${n})`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((h) => {
|
|
571
581
|
const f = t(this, w).querySelector(h);
|
|
572
582
|
if (!f) return;
|
|
573
583
|
const u = f.querySelector("tbody.bindable-tbody");
|
|
@@ -592,33 +602,33 @@ const ce = class ce {
|
|
|
592
602
|
});
|
|
593
603
|
}, "#bindRowData"));
|
|
594
604
|
v(this, "destroy", /* @__PURE__ */ a(() => {
|
|
595
|
-
t(this,
|
|
605
|
+
t(this, D) && (t(this, D).disconnect(), g(this, D, null));
|
|
596
606
|
}, "destroy"));
|
|
597
607
|
g(this, I, i.getRootNode().host), g(this, w, i), t(this, Ht).call(this);
|
|
598
608
|
}
|
|
599
609
|
getRowHeight() {
|
|
600
|
-
return t(this,
|
|
610
|
+
return t(this, T);
|
|
601
611
|
}
|
|
602
612
|
templateLength(i = ".ng-container-body") {
|
|
603
613
|
var e;
|
|
604
614
|
return ((e = t(this, W).get(i)) == null ? void 0 : e.length) || 1;
|
|
605
615
|
}
|
|
606
616
|
};
|
|
607
|
-
I = new WeakMap(), w = new WeakMap(), W = new WeakMap(),
|
|
617
|
+
I = new WeakMap(), w = new WeakMap(), W = new WeakMap(), T = new WeakMap(), D = new WeakMap(), F = new WeakMap(), B = new WeakMap(), et = new WeakMap(), Tt = new WeakMap(), qt = new WeakMap(), kt = new WeakMap(), ft = new WeakMap(), ut = new WeakMap(), Lt = new WeakMap(), Ht = new WeakMap(), gt = new WeakMap(), Ct = new WeakMap(), it = new WeakMap(), bt = new WeakMap(), a(ce, "RowManager");
|
|
608
618
|
let Jt = ce;
|
|
609
|
-
var Mt, st,
|
|
619
|
+
var Mt, st, j, _t, $t, It, Wt, Ot;
|
|
610
620
|
const ct = class ct extends HTMLElement {
|
|
611
621
|
constructor() {
|
|
612
622
|
super();
|
|
613
623
|
c(this, Mt);
|
|
614
624
|
c(this, st, null);
|
|
615
|
-
c(this,
|
|
625
|
+
c(this, j);
|
|
616
626
|
/**
|
|
617
627
|
* data.set, add, delete
|
|
618
628
|
* filter, sorting : κ³ λ €λμ
|
|
619
629
|
*/
|
|
620
630
|
v(this, "invalidate", /* @__PURE__ */ a(() => {
|
|
621
|
-
t(this,
|
|
631
|
+
t(this, j).refresh();
|
|
622
632
|
}, "invalidate"));
|
|
623
633
|
c(this, _t, /* @__PURE__ */ a(() => {
|
|
624
634
|
[
|
|
@@ -650,7 +660,7 @@ const ct = class ct extends HTMLElement {
|
|
|
650
660
|
this.querySelectorAll("tbody.fixed-tbody").forEach((r) => {
|
|
651
661
|
r.style.top = `${s}px`;
|
|
652
662
|
});
|
|
653
|
-
}), t(this,
|
|
663
|
+
}), t(this, j).initialize(), setTimeout(() => {
|
|
654
664
|
var s;
|
|
655
665
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
656
666
|
}, 0));
|
|
@@ -672,7 +682,7 @@ const ct = class ct extends HTMLElement {
|
|
|
672
682
|
o.remove();
|
|
673
683
|
}), n;
|
|
674
684
|
}, "#createSplitTable"));
|
|
675
|
-
v(this, "getRowHeight", /* @__PURE__ */ a(() => t(this,
|
|
685
|
+
v(this, "getRowHeight", /* @__PURE__ */ a(() => t(this, j).getRowHeight(), "getRowHeight"));
|
|
676
686
|
v(this, "scrollToX", /* @__PURE__ */ a((e) => {
|
|
677
687
|
const s = this.querySelector(".ng-container-body");
|
|
678
688
|
s && (s.scrollLeft = e);
|
|
@@ -831,16 +841,16 @@ const ct = class ct extends HTMLElement {
|
|
|
831
841
|
</div>
|
|
832
842
|
`;
|
|
833
843
|
}, "#render"));
|
|
834
|
-
g(this,
|
|
844
|
+
g(this, j, new Jt(this)), g(this, Mt, this.getRootNode().host);
|
|
835
845
|
}
|
|
836
846
|
connectedCallback() {
|
|
837
847
|
t(this, Wt).call(this);
|
|
838
848
|
}
|
|
839
849
|
disconnectedCallback() {
|
|
840
|
-
this.innerHTML = "",
|
|
850
|
+
this.innerHTML = "", k.log("NineTableSheet destroyed.");
|
|
841
851
|
}
|
|
842
852
|
};
|
|
843
|
-
Mt = new WeakMap(), st = new WeakMap(),
|
|
853
|
+
Mt = new WeakMap(), st = new WeakMap(), j = new WeakMap(), _t = new WeakMap(), $t = new WeakMap(), It = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), a(ct, "NineTableSheet"), v(ct, "SCROLLBAR_SIZE", 16);
|
|
844
854
|
let wt = ct;
|
|
845
855
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", wt);
|
|
846
856
|
var zt, yt;
|
|
@@ -894,12 +904,12 @@ const he = class he extends HTMLElement {
|
|
|
894
904
|
zt = new WeakMap(), yt = new WeakMap(), a(he, "NineTableSheets");
|
|
895
905
|
let Qt = he;
|
|
896
906
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", Qt);
|
|
897
|
-
var q,
|
|
907
|
+
var q, Dt, pt, Bt;
|
|
898
908
|
const de = class de {
|
|
899
909
|
constructor(i) {
|
|
900
910
|
c(this, q);
|
|
901
|
-
c(this,
|
|
902
|
-
t(this,
|
|
911
|
+
c(this, Dt, /* @__PURE__ */ a(() => {
|
|
912
|
+
t(this, Bt).call(this), new ResizeObserver((i) => {
|
|
903
913
|
for (let e of i)
|
|
904
914
|
t(this, q).getAttribute("auto-height") === "true" && t(this, pt).call(this);
|
|
905
915
|
}).observe(t(this, q));
|
|
@@ -911,7 +921,7 @@ const de = class de {
|
|
|
911
921
|
const e = parseInt(t(this, q).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), n = (d = t(this, q).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : d.getBoundingClientRect().height, r = (h = t(this, q).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : h.getBoundingClientRect().height, o = wt.SCROLLBAR_SIZE, l = e * s + n + r + o;
|
|
912
922
|
t(this, q).style.height = `${l}px`;
|
|
913
923
|
}, "#applyAutoHeight"));
|
|
914
|
-
c(this,
|
|
924
|
+
c(this, Bt, /* @__PURE__ */ a(() => {
|
|
915
925
|
const e = Array.from(t(this, q).children).filter((d) => d.tagName === "TABLE"), s = t(this, q).getAttribute("auto-height") === "true", n = e.length, r = e.map((d, h) => {
|
|
916
926
|
const u = `<nine-table-sheet class="${h === 0 ? "active" : ""}" data-index="${h}"></nine-table-sheet>`, b = h < n - 1 ? `<nine-splitter class="h" data-split-index="${h}"></nine-splitter>` : "";
|
|
917
927
|
return u + b;
|
|
@@ -1014,10 +1024,10 @@ const de = class de {
|
|
|
1014
1024
|
});
|
|
1015
1025
|
});
|
|
1016
1026
|
}, "#render"));
|
|
1017
|
-
g(this, q, i), t(this,
|
|
1027
|
+
g(this, q, i), t(this, Dt).call(this);
|
|
1018
1028
|
}
|
|
1019
1029
|
};
|
|
1020
|
-
q = new WeakMap(),
|
|
1030
|
+
q = new WeakMap(), Dt = new WeakMap(), pt = new WeakMap(), Bt = new WeakMap(), a(de, "LayoutManager");
|
|
1021
1031
|
let te = de;
|
|
1022
1032
|
var mt, nt;
|
|
1023
1033
|
const fe = class fe {
|
|
@@ -1037,7 +1047,7 @@ const fe = class fe {
|
|
|
1037
1047
|
};
|
|
1038
1048
|
mt = new WeakMap(), nt = new WeakMap(), a(fe, "ngRow");
|
|
1039
1049
|
let ee = fe;
|
|
1040
|
-
var L, E, H, ot, Nt,
|
|
1050
|
+
var L, E, H, ot, Nt, N, Pt, K, xt, Vt, Yt, rt;
|
|
1041
1051
|
const C = class C {
|
|
1042
1052
|
constructor(i, e) {
|
|
1043
1053
|
c(this, L);
|
|
@@ -1045,15 +1055,15 @@ const C = class C {
|
|
|
1045
1055
|
c(this, H, []);
|
|
1046
1056
|
c(this, ot, []);
|
|
1047
1057
|
c(this, Nt, 0);
|
|
1048
|
-
c(this,
|
|
1058
|
+
c(this, N, []);
|
|
1049
1059
|
c(this, Pt, /* @__PURE__ */ a(() => {
|
|
1050
|
-
g(this,
|
|
1060
|
+
g(this, N, []);
|
|
1051
1061
|
const i = t(this, L).template || [];
|
|
1052
1062
|
Array.from(i).forEach((e) => {
|
|
1053
1063
|
var s;
|
|
1054
|
-
t(this,
|
|
1064
|
+
t(this, N).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1055
1065
|
}), (t(this, E).rawRecords || []).forEach((e) => {
|
|
1056
|
-
e.__ng || (e.__ng = t(this, xt).call(this)), e.__ng.height = t(this,
|
|
1066
|
+
e.__ng || (e.__ng = t(this, xt).call(this)), e.__ng.height = t(this, N).slice();
|
|
1057
1067
|
});
|
|
1058
1068
|
}, "#initialize"));
|
|
1059
1069
|
c(this, K, /* @__PURE__ */ a(() => {
|
|
@@ -1081,10 +1091,10 @@ const C = class C {
|
|
|
1081
1091
|
rowState: C.ROW_STATE.EMPTY,
|
|
1082
1092
|
deleted: !1,
|
|
1083
1093
|
filtered: !1,
|
|
1084
|
-
height: t(this,
|
|
1094
|
+
height: t(this, N).slice(),
|
|
1085
1095
|
o: {},
|
|
1086
1096
|
c: {},
|
|
1087
|
-
_: [0, 0, 0, 0, C.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this,
|
|
1097
|
+
_: [0, 0, 0, 0, C.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, N).slice(), -1, {}, {}]
|
|
1088
1098
|
}), "#getDefaultMeta"));
|
|
1089
1099
|
v(this, "reset", /* @__PURE__ */ a(() => {
|
|
1090
1100
|
g(this, H, []), g(this, ot, []), t(this, K).call(this);
|
|
@@ -1176,7 +1186,7 @@ const C = class C {
|
|
|
1176
1186
|
return this.length;
|
|
1177
1187
|
}
|
|
1178
1188
|
};
|
|
1179
|
-
L = new WeakMap(), E = new WeakMap(), H = new WeakMap(), ot = new WeakMap(), Nt = new WeakMap(),
|
|
1189
|
+
L = new WeakMap(), E = new WeakMap(), H = new WeakMap(), ot = new WeakMap(), Nt = new WeakMap(), N = new WeakMap(), Pt = new WeakMap(), K = new WeakMap(), xt = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), rt = new WeakMap(), a(C, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1180
1190
|
v(C, "ROW_STATE", {
|
|
1181
1191
|
EMPTY: "EMPTY",
|
|
1182
1192
|
NORMAL: "NORMAL",
|
|
@@ -1226,11 +1236,11 @@ const ge = class ge {
|
|
|
1226
1236
|
}), g(this, A, Array.from(i, ([e, s]) => ({ name: e, type: s }))), g(this, A, t(this, A).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, A).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
1227
1237
|
}, "#adjust"));
|
|
1228
1238
|
c(this, Xt, /* @__PURE__ */ a(() => {
|
|
1229
|
-
g(this, A, []),
|
|
1239
|
+
g(this, A, []), k.log(t(this, lt).querySelectorAll("table"));
|
|
1230
1240
|
const i = Array.from(t(this, lt).querySelectorAll("table"));
|
|
1231
1241
|
if (!(!i || i.length === 0)) {
|
|
1232
1242
|
for (const e of i)
|
|
1233
|
-
|
|
1243
|
+
k.log(e), $("[data-bind]", e).each((s, n) => {
|
|
1234
1244
|
const r = n.dataset.bind, o = n.getAttribute("data-type") || "string";
|
|
1235
1245
|
r && t(this, A).push({ name: r, type: o });
|
|
1236
1246
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
@@ -1281,23 +1291,23 @@ const ge = class ge {
|
|
|
1281
1291
|
};
|
|
1282
1292
|
lt = new WeakMap(), A = new WeakMap(), vt = new WeakMap(), Xt = new WeakMap(), a(ge, "ngFields");
|
|
1283
1293
|
let ne = ge;
|
|
1284
|
-
var G, Ut,
|
|
1294
|
+
var G, Ut, Ft;
|
|
1285
1295
|
const be = class be extends HTMLElement {
|
|
1286
1296
|
constructor() {
|
|
1287
1297
|
super();
|
|
1288
1298
|
//#created = false;
|
|
1289
1299
|
c(this, G);
|
|
1290
1300
|
c(this, Ut);
|
|
1291
|
-
c(this,
|
|
1292
|
-
this.fields = new ne(this), g(this, Ut, new te(this)),
|
|
1301
|
+
c(this, Ft, /* @__PURE__ */ a(() => {
|
|
1302
|
+
this.fields = new ne(this), g(this, Ut, new te(this)), k.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1293
1303
|
}, "#init"));
|
|
1294
1304
|
this.attachShadow({ mode: "open" }), g(this, G, new se(this));
|
|
1295
1305
|
}
|
|
1296
1306
|
connectedCallback() {
|
|
1297
|
-
t(this,
|
|
1307
|
+
t(this, Ft).call(this);
|
|
1298
1308
|
}
|
|
1299
1309
|
disconnectedCallback() {
|
|
1300
|
-
|
|
1310
|
+
k.log("NineTable disconnected.");
|
|
1301
1311
|
}
|
|
1302
1312
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1303
1313
|
get data() {
|
|
@@ -1312,7 +1322,7 @@ const be = class be extends HTMLElement {
|
|
|
1312
1322
|
return t(this, G);
|
|
1313
1323
|
}
|
|
1314
1324
|
};
|
|
1315
|
-
G = new WeakMap(), Ut = new WeakMap(),
|
|
1325
|
+
G = new WeakMap(), Ut = new WeakMap(), Ft = new WeakMap(), a(be, "NineTable");
|
|
1316
1326
|
let oe = be;
|
|
1317
1327
|
customElements.get("nine-table") || customElements.define("nine-table", oe);
|
|
1318
1328
|
//# sourceMappingURL=nine-table.js.map
|