@ninebone/table 0.0.429 β 0.0.430
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 +96 -96
- 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
|
@@ -23,25 +23,25 @@ const re = class re extends Se.constructor {
|
|
|
23
23
|
a(re, "Trace");
|
|
24
24
|
let jt = re;
|
|
25
25
|
const H = new jt();
|
|
26
|
-
var _,
|
|
26
|
+
var _, O, p, D, P, Y, St, V, Et;
|
|
27
27
|
const le = class le extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
c(this, _);
|
|
31
|
-
c(this,
|
|
31
|
+
c(this, O, !1);
|
|
32
32
|
c(this, p);
|
|
33
|
+
c(this, D);
|
|
33
34
|
c(this, P);
|
|
34
35
|
c(this, Y);
|
|
35
|
-
c(this, V);
|
|
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 && (b(this,
|
|
39
|
+
e && (b(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
|
-
if (!t(this, _) || !t(this, p) || t(this,
|
|
44
|
+
if (!t(this, _) || !t(this, p) || t(this, O)) return;
|
|
45
45
|
const e = t(this, p).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
47
|
const o = t(this, p).track, r = t(this, p).thumb, n = t(this, _).querySelector(".ng-container-bottom"), l = e.clientWidth, d = s.scrollWidth;
|
|
@@ -61,7 +61,7 @@ const le = class le extends HTMLElement {
|
|
|
61
61
|
const m = h - f;
|
|
62
62
|
y > m && (y = m), r.style.left = `${y}px`, H.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, V, /* @__PURE__ */ a((e) => {
|
|
65
65
|
if (!t(this, p)) return !1;
|
|
66
66
|
const s = t(this, p).container, o = s.querySelector("table");
|
|
67
67
|
if (!o) 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((o) => {
|
|
78
|
-
clearInterval(t(this,
|
|
78
|
+
clearInterval(t(this, D)), clearInterval(t(this, P));
|
|
79
79
|
const r = parseInt(t(this, p).thumb.style.left || 0, 10);
|
|
80
|
-
t(this,
|
|
81
|
-
clearInterval(t(this,
|
|
80
|
+
t(this, V).call(this, r + o), b(this, D, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, D)), b(this, P, setInterval(() => {
|
|
82
82
|
const n = parseInt(t(this, p).thumb.style.left || 0, 10);
|
|
83
|
-
t(this,
|
|
83
|
+
t(this, V).call(this, n + o) || clearInterval(t(this, P));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), s = /* @__PURE__ */ a(() => {
|
|
87
|
-
clearInterval(t(this,
|
|
87
|
+
clearInterval(t(this, D)), clearInterval(t(this, P));
|
|
88
88
|
}, "clearTimer");
|
|
89
89
|
["mouseup", "mouseleave", "touchend"].forEach((o) => {
|
|
90
90
|
t(this, p).left.addEventListener(o, s), t(this, p).right.addEventListener(o, s), t(this, p).track.addEventListener(o, s);
|
|
@@ -96,16 +96,16 @@ const le = class le extends HTMLElement {
|
|
|
96
96
|
if (o.button !== 0) return;
|
|
97
97
|
o.preventDefault();
|
|
98
98
|
const r = t(this, p).track.getBoundingClientRect(), n = t(this, p).thumb.clientWidth;
|
|
99
|
-
t(this,
|
|
99
|
+
t(this, V).call(this, o.clientX - r.left - n / 2);
|
|
100
100
|
}), t(this, p).thumb.addEventListener("mousedown", (o) => {
|
|
101
101
|
if (o.button !== 0) return;
|
|
102
|
-
o.stopPropagation(), o.preventDefault(), b(this,
|
|
102
|
+
o.stopPropagation(), o.preventDefault(), b(this, O, !0), this.shiftX = o.clientX - t(this, p).thumb.getBoundingClientRect().left;
|
|
103
103
|
const r = /* @__PURE__ */ a((l) => {
|
|
104
|
-
if (!t(this,
|
|
104
|
+
if (!t(this, O)) return;
|
|
105
105
|
const d = t(this, p).track.getBoundingClientRect();
|
|
106
|
-
t(this,
|
|
106
|
+
t(this, V).call(this, l.clientX - d.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), n = /* @__PURE__ */ a(() => {
|
|
108
|
-
b(this,
|
|
108
|
+
b(this, O, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", n), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
110
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", n);
|
|
111
111
|
});
|
|
@@ -189,25 +189,25 @@ const le = class le extends HTMLElement {
|
|
|
189
189
|
left: this.querySelector(".ng-scroll-left"),
|
|
190
190
|
right: this.querySelector(".ng-scroll-right")
|
|
191
191
|
}), s.addEventListener("scroll", () => {
|
|
192
|
-
t(this,
|
|
192
|
+
t(this, O) || this.refresh();
|
|
193
193
|
}), t(this, Et).call(this), t(this, St).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
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(),
|
|
201
|
+
_ = new WeakMap(), O = new WeakMap(), p = new WeakMap(), D = new WeakMap(), P = new WeakMap(), Y = new WeakMap(), St = new WeakMap(), V = 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 X, J, z, S, ct, ht, Rt;
|
|
205
205
|
const ae = class ae extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
-
c(this,
|
|
209
|
-
c(this,
|
|
210
|
-
c(this,
|
|
208
|
+
c(this, X);
|
|
209
|
+
c(this, J);
|
|
210
|
+
c(this, z, !1);
|
|
211
211
|
c(this, S);
|
|
212
212
|
c(this, ct, 0);
|
|
213
213
|
c(this, ht, 0);
|
|
@@ -215,8 +215,8 @@ const ae = class ae extends HTMLElement {
|
|
|
215
215
|
* π― μ€ν¬λ‘€λ° μμΉ λ° μΈλΈ ν¬κΈ° κ°±μ
|
|
216
216
|
*/
|
|
217
217
|
v(this, "refresh", /* @__PURE__ */ a(() => {
|
|
218
|
-
H.log("refresh", t(this,
|
|
219
|
-
const e = t(this, S).container, s = t(this, S).track, o = t(this, S).thumb, r = e.clientHeight, l = (t(this,
|
|
218
|
+
H.log("refresh", t(this, z)), H.log("refresh2");
|
|
219
|
+
const e = t(this, S).container, s = t(this, S).track, o = t(this, S).thumb, r = e.clientHeight, l = (t(this, X).data.get() || []).length, d = t(this, J).getRowHeight(), h = l * d;
|
|
220
220
|
if (h <= r) {
|
|
221
221
|
o.style.display = "none", t(this, S).top.disabled = !0, t(this, S).bottom.disabled = !0;
|
|
222
222
|
return;
|
|
@@ -234,26 +234,26 @@ const ae = class ae extends HTMLElement {
|
|
|
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, X).data.get() || []).length, n = t(this, J).getRowHeight();
|
|
238
238
|
return r * n;
|
|
239
239
|
}, "getContentHeight");
|
|
240
240
|
e.addEventListener("scroll", () => {
|
|
241
|
-
t(this,
|
|
241
|
+
t(this, z) || this.refresh();
|
|
242
242
|
}), t(this, S).thumb.addEventListener("mousedown", (o) => {
|
|
243
243
|
if (o.button !== 0) return;
|
|
244
|
-
o.stopPropagation(), o.preventDefault(), b(this,
|
|
244
|
+
o.stopPropagation(), o.preventDefault(), b(this, z, !0), b(this, ct, o.clientY), b(this, ht, e.scrollTop);
|
|
245
245
|
const r = /* @__PURE__ */ a((l) => {
|
|
246
|
-
if (!t(this,
|
|
246
|
+
if (!t(this, z)) return;
|
|
247
247
|
const d = t(this, S).track.getBoundingClientRect(), h = t(this, S).thumb.clientHeight, u = d.height - h, g = l.clientY - t(this, ct), y = e.clientHeight, m = s(), R = Math.max(m - y, 1);
|
|
248
248
|
if (u > 0 && R > 0) {
|
|
249
|
-
const
|
|
250
|
-
let lt = t(this, ht) +
|
|
249
|
+
const G = g / u * R;
|
|
250
|
+
let lt = t(this, ht) + G;
|
|
251
251
|
const ye = Math.max(0, m - y);
|
|
252
252
|
lt < 0 && (lt = 0), lt > ye && (lt = ye), e.scrollTop = lt;
|
|
253
253
|
}
|
|
254
254
|
this.refresh();
|
|
255
255
|
}, "onMouseMove"), n = /* @__PURE__ */ a(() => {
|
|
256
|
-
b(this,
|
|
256
|
+
b(this, z, !1), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", n), this.refresh();
|
|
257
257
|
}, "onMouseUp");
|
|
258
258
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", n);
|
|
259
259
|
}), t(this, S).track.addEventListener("mousedown", (o) => {
|
|
@@ -272,7 +272,7 @@ const ae = class ae extends HTMLElement {
|
|
|
272
272
|
}, "#init"));
|
|
273
273
|
}
|
|
274
274
|
connectedCallback() {
|
|
275
|
-
b(this,
|
|
275
|
+
b(this, X, this.getRootNode().host), b(this, J, 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, X).shadowRoot.querySelector(".ng-container-body");
|
|
342
342
|
if (!s) {
|
|
343
343
|
setTimeout(e, 10);
|
|
344
344
|
return;
|
|
@@ -354,10 +354,10 @@ const ae = class ae extends HTMLElement {
|
|
|
354
354
|
e();
|
|
355
355
|
}
|
|
356
356
|
};
|
|
357
|
-
|
|
357
|
+
X = new WeakMap(), J = new WeakMap(), z = new WeakMap(), S = new WeakMap(), ct = new WeakMap(), ht = 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
|
-
var At,
|
|
360
|
+
var At, Q;
|
|
361
361
|
const M = class M {
|
|
362
362
|
/**
|
|
363
363
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
@@ -372,7 +372,7 @@ const M = class M {
|
|
|
372
372
|
var o, r, n, l;
|
|
373
373
|
if (!i) return null;
|
|
374
374
|
const e = i.cloneNode(!0);
|
|
375
|
-
return t(o = M, At).call(o, e), t(r = M,
|
|
375
|
+
return t(o = M, At).call(o, e), t(r = M, Q).call(r, e, "thead"), t(n = M, Q).call(n, e, "tbody"), t(l = M, Q).call(l, e, "tfoot"), Array.from(e.querySelectorAll("colgroup col")).forEach((d, h) => {
|
|
376
376
|
const f = d.getAttribute("fixed");
|
|
377
377
|
f && e.querySelectorAll(`thead [data-col="${h}"], tbody [data-col="${h}"], tfoot [data-col="${h}"]`).forEach((u) => {
|
|
378
378
|
u.setAttribute("fixed", f);
|
|
@@ -380,7 +380,7 @@ const M = class M {
|
|
|
380
380
|
}), e;
|
|
381
381
|
}
|
|
382
382
|
};
|
|
383
|
-
At = new WeakMap(),
|
|
383
|
+
At = new WeakMap(), Q = new WeakMap(), a(M, "TableCompiler"), c(M, At, /* @__PURE__ */ a((i) => {
|
|
384
384
|
if (!i.querySelector("colgroup")) {
|
|
385
385
|
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);
|
|
386
386
|
for (let n = 0; n < s; n++) {
|
|
@@ -394,7 +394,7 @@ At = new WeakMap(), tt = new WeakMap(), a(M, "TableCompiler"), c(M, At, /* @__PU
|
|
|
394
394
|
s ? s.after(e) : i.prepend(e);
|
|
395
395
|
}
|
|
396
396
|
i.classList.add("nine-table-element"), i.style.display = "table";
|
|
397
|
-
}, "#ensureTableStructure")), c(M,
|
|
397
|
+
}, "#ensureTableStructure")), c(M, Q, /* @__PURE__ */ a((i, e) => {
|
|
398
398
|
const s = Array.from(i.querySelectorAll(e + " tr")), o = Array.from(i.querySelectorAll(e + " th," + e + " td")), r = s.length;
|
|
399
399
|
if (r === 0 || o.length === 0) return;
|
|
400
400
|
let n = 0;
|
|
@@ -428,22 +428,22 @@ 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, T,
|
|
431
|
+
var I, w, W, T, N, U, dt, tt, Tt, qt, kt, ft, ut, Lt, Ct, bt, Ht, et, gt;
|
|
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
437
|
c(this, T, null);
|
|
438
|
-
c(this,
|
|
439
|
-
c(this,
|
|
438
|
+
c(this, N, null);
|
|
439
|
+
c(this, U, 0);
|
|
440
440
|
c(this, dt, 40);
|
|
441
|
-
c(this,
|
|
441
|
+
c(this, tt, !1);
|
|
442
442
|
c(this, Tt, 3);
|
|
443
443
|
v(this, "refresh", /* @__PURE__ */ a(() => {
|
|
444
444
|
var e;
|
|
445
445
|
const i = t(this, w).querySelector(".ng-container-body");
|
|
446
|
-
i && (t(this, ft).call(this), t(this,
|
|
446
|
+
i && (t(this, ft).call(this), t(this, et).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
449
|
b(this, T, null), t(this, W).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
@@ -458,11 +458,11 @@ 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, kt).call(this, i), t(this, bt).call(this), t(this, ft).call(this), t(this,
|
|
461
|
+
t(this, kt).call(this, i), t(this, bt).call(this), t(this, ft).call(this), t(this, et).call(this, i.scrollTop);
|
|
462
462
|
let o = i.scrollTop;
|
|
463
463
|
const r = /* @__PURE__ */ a((n) => {
|
|
464
464
|
var l;
|
|
465
|
-
e && e.scrollTop !== n && (e.scrollTop = n), s && s.scrollTop !== n && (s.scrollTop = n), t(this,
|
|
465
|
+
e && e.scrollTop !== n && (e.scrollTop = n), s && s.scrollTop !== n && (s.scrollTop = n), t(this, et).call(this, n), (l = t(this, w).querySelector("nine-table-vscrollbar")) == null || l.refresh();
|
|
466
466
|
}, "syncScroll");
|
|
467
467
|
i.addEventListener("scroll", () => {
|
|
468
468
|
const n = i.scrollTop;
|
|
@@ -517,8 +517,8 @@ const ce = class ce {
|
|
|
517
517
|
});
|
|
518
518
|
}, "#updateVirtualScrollHeight"));
|
|
519
519
|
c(this, ut, /* @__PURE__ */ a(() => {
|
|
520
|
-
if ((t(this, I).data.get() || []).length, t(this,
|
|
521
|
-
const e = Math.ceil(t(this,
|
|
520
|
+
if ((t(this, I).data.get() || []).length, t(this, U) > 0 && t(this, T) > 0) {
|
|
521
|
+
const e = Math.ceil(t(this, U) / t(this, T));
|
|
522
522
|
b(this, dt, e + t(this, Tt));
|
|
523
523
|
}
|
|
524
524
|
}, "#updateRowCount"));
|
|
@@ -537,7 +537,7 @@ const ce = class ce {
|
|
|
537
537
|
}
|
|
538
538
|
}, "#syncRowHeights"));
|
|
539
539
|
c(this, Ct, /* @__PURE__ */ a(() => {
|
|
540
|
-
!t(this, w) || !(t(this, w) instanceof HTMLElement) || (b(this,
|
|
540
|
+
!t(this, w) || !(t(this, w) instanceof HTMLElement) || (b(this, N, new ResizeObserver((i) => {
|
|
541
541
|
for (const e of i) {
|
|
542
542
|
const s = e.target;
|
|
543
543
|
if (!s.classList.contains("active")) continue;
|
|
@@ -547,10 +547,10 @@ const ce = class ce {
|
|
|
547
547
|
const n = s.querySelector("thead");
|
|
548
548
|
n && (r += n.offsetHeight || n.getBoundingClientRect().height);
|
|
549
549
|
const l = Math.max(o - r, 100);
|
|
550
|
-
t(this,
|
|
550
|
+
t(this, U) !== l && (b(this, U, l), t(this, ut).call(this), t(this, T) !== null && t(this, bt).call(this));
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
|
-
})), t(this,
|
|
553
|
+
})), t(this, N).observe(t(this, w)));
|
|
554
554
|
}, "#initResizeObserver"));
|
|
555
555
|
c(this, bt, /* @__PURE__ */ a(() => {
|
|
556
556
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
@@ -577,7 +577,7 @@ const ce = class ce {
|
|
|
577
577
|
});
|
|
578
578
|
});
|
|
579
579
|
}, "#adjustBufferRows"));
|
|
580
|
-
c(this,
|
|
580
|
+
c(this, et, /* @__PURE__ */ a((i) => {
|
|
581
581
|
var d;
|
|
582
582
|
const e = t(this, T);
|
|
583
583
|
if (!e || e <= 0) return;
|
|
@@ -593,11 +593,11 @@ const ce = class ce {
|
|
|
593
593
|
y.style.display = "none";
|
|
594
594
|
return;
|
|
595
595
|
}
|
|
596
|
-
const
|
|
597
|
-
y.style.display = "", t(this, gt).call(this, y,
|
|
596
|
+
const G = t(this, I).data.get(R);
|
|
597
|
+
y.style.display = "", t(this, gt).call(this, y, G, R);
|
|
598
598
|
});
|
|
599
|
-
}), t(this,
|
|
600
|
-
t(this, Ht).call(this, r), b(this,
|
|
599
|
+
}), t(this, tt) || (b(this, tt, !0), setTimeout(() => {
|
|
600
|
+
t(this, Ht).call(this, r), b(this, tt, !1);
|
|
601
601
|
}, 0));
|
|
602
602
|
}, "#handleScroll"));
|
|
603
603
|
c(this, gt, /* @__PURE__ */ a((i, e, s) => {
|
|
@@ -607,7 +607,7 @@ const ce = class ce {
|
|
|
607
607
|
});
|
|
608
608
|
}, "#bindRowData"));
|
|
609
609
|
v(this, "destroy", /* @__PURE__ */ a(() => {
|
|
610
|
-
t(this,
|
|
610
|
+
t(this, N) && (t(this, N).disconnect(), b(this, N, null));
|
|
611
611
|
}, "destroy"));
|
|
612
612
|
b(this, I, i.getRootNode().host), b(this, w, i), t(this, Ct).call(this);
|
|
613
613
|
}
|
|
@@ -619,18 +619,18 @@ const ce = class ce {
|
|
|
619
619
|
return ((e = t(this, W).get(i)) == null ? void 0 : e.length) || 1;
|
|
620
620
|
}
|
|
621
621
|
};
|
|
622
|
-
I = new WeakMap(), w = new WeakMap(), W = new WeakMap(), T = new WeakMap(),
|
|
622
|
+
I = new WeakMap(), w = new WeakMap(), W = new WeakMap(), T = new WeakMap(), N = new WeakMap(), U = new WeakMap(), dt = new WeakMap(), tt = new WeakMap(), Tt = new WeakMap(), qt = new WeakMap(), kt = new WeakMap(), ft = new WeakMap(), ut = new WeakMap(), Lt = new WeakMap(), Ct = new WeakMap(), bt = new WeakMap(), Ht = new WeakMap(), et = new WeakMap(), gt = new WeakMap(), a(ce, "RowManager");
|
|
623
623
|
let Jt = ce;
|
|
624
|
-
var Mt,
|
|
624
|
+
var Mt, it, F, _t, It, $t, Wt, Ot;
|
|
625
625
|
const at = class at extends HTMLElement {
|
|
626
626
|
constructor() {
|
|
627
627
|
super();
|
|
628
628
|
c(this, Mt);
|
|
629
|
-
c(this,
|
|
630
|
-
c(this,
|
|
629
|
+
c(this, it, null);
|
|
630
|
+
c(this, F);
|
|
631
631
|
v(this, "invalidate", /* @__PURE__ */ a(() => {
|
|
632
632
|
var e, s;
|
|
633
|
-
t(this,
|
|
633
|
+
t(this, F).refresh(), (e = this.querySelector("nine-table-hscrollbar")) == null || e.refresh(), (s = this.querySelector("nine-table-vscrollbar")) == null || s.refresh();
|
|
634
634
|
}, "invalidate"));
|
|
635
635
|
c(this, _t, /* @__PURE__ */ a(() => {
|
|
636
636
|
[
|
|
@@ -640,7 +640,7 @@ const at = class at extends HTMLElement {
|
|
|
640
640
|
].forEach(({ selector: s, type: o }) => {
|
|
641
641
|
const r = this.querySelector(s);
|
|
642
642
|
if (!r) return;
|
|
643
|
-
const n = t(this, $t).call(this, t(this,
|
|
643
|
+
const n = t(this, $t).call(this, t(this, it), o);
|
|
644
644
|
r.innerHTML = "";
|
|
645
645
|
const l = document.createElement("div");
|
|
646
646
|
l.className = "ng-scroll-content", l.style.position = "relative", l.style.width = "100%", l.appendChild(n);
|
|
@@ -660,13 +660,13 @@ const at = class at extends HTMLElement {
|
|
|
660
660
|
});
|
|
661
661
|
}, "#updateContainerWidths"));
|
|
662
662
|
v(this, "generate", /* @__PURE__ */ a((e) => {
|
|
663
|
-
e && (b(this,
|
|
663
|
+
e && (b(this, it, Gt.compile(e)), t(this, it).style.display = "table", t(this, _t).call(this), t(this, It).call(this), requestAnimationFrame(() => {
|
|
664
664
|
var o;
|
|
665
665
|
const s = (o = this.querySelector("thead")) == null ? void 0 : o.getBoundingClientRect().height;
|
|
666
666
|
this.querySelectorAll("tbody.fixed-tbody").forEach((r) => {
|
|
667
667
|
r.style.top = `${s}px`;
|
|
668
668
|
});
|
|
669
|
-
}), t(this,
|
|
669
|
+
}), t(this, F).initialize(), setTimeout(() => {
|
|
670
670
|
var s;
|
|
671
671
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
672
672
|
}, 0));
|
|
@@ -685,7 +685,7 @@ const at = class at extends HTMLElement {
|
|
|
685
685
|
n.remove();
|
|
686
686
|
}), o;
|
|
687
687
|
}, "#createSplitTable"));
|
|
688
|
-
v(this, "getRowHeight", /* @__PURE__ */ a(() => t(this,
|
|
688
|
+
v(this, "getRowHeight", /* @__PURE__ */ a(() => t(this, F).getRowHeight(), "getRowHeight"));
|
|
689
689
|
v(this, "scrollToX", /* @__PURE__ */ a((e) => {
|
|
690
690
|
const s = this.querySelector(".ng-container-body");
|
|
691
691
|
s && (s.scrollLeft = e);
|
|
@@ -843,7 +843,7 @@ const at = class at extends HTMLElement {
|
|
|
843
843
|
</div>
|
|
844
844
|
`;
|
|
845
845
|
}, "#render"));
|
|
846
|
-
b(this,
|
|
846
|
+
b(this, F, new Jt(this)), b(this, Mt, this.getRootNode().host);
|
|
847
847
|
}
|
|
848
848
|
connectedCallback() {
|
|
849
849
|
t(this, Wt).call(this);
|
|
@@ -852,7 +852,7 @@ const at = class at extends HTMLElement {
|
|
|
852
852
|
this.innerHTML = "", H.log("NineTableSheet destroyed.");
|
|
853
853
|
}
|
|
854
854
|
};
|
|
855
|
-
Mt = new WeakMap(),
|
|
855
|
+
Mt = new WeakMap(), it = new WeakMap(), F = new WeakMap(), _t = new WeakMap(), It = new WeakMap(), $t = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), a(at, "NineTableSheet"), v(at, "SCROLLBAR_SIZE", 16);
|
|
856
856
|
let wt = at;
|
|
857
857
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", wt);
|
|
858
858
|
var zt, yt;
|
|
@@ -873,8 +873,8 @@ const he = class he extends HTMLElement {
|
|
|
873
873
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((y) => y.style.setProperty("display", "none"));
|
|
874
874
|
const g = f.filter((y) => y.classList.contains("active"));
|
|
875
875
|
g.length < 2 || g.forEach((y) => {
|
|
876
|
-
const m = parseInt(y.getAttribute("data-index"), 10), R = this.querySelector(`nine-splitter[data-split-index="${m}"]`),
|
|
877
|
-
R &&
|
|
876
|
+
const m = parseInt(y.getAttribute("data-index"), 10), R = this.querySelector(`nine-splitter[data-split-index="${m}"]`), G = f[m + 1];
|
|
877
|
+
R && G && G.classList.contains("active") && R.style.setProperty("display", "flex");
|
|
878
878
|
});
|
|
879
879
|
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), n = this.querySelector("nine-table-sheets-body"), l = r.querySelectorAll(".nine-tab-item"), d = n.querySelectorAll("nine-table-sheet");
|
|
880
880
|
if (!l[e]) return;
|
|
@@ -1049,7 +1049,7 @@ const fe = class fe {
|
|
|
1049
1049
|
};
|
|
1050
1050
|
mt = new WeakMap(), st = new WeakMap(), a(fe, "ngRow");
|
|
1051
1051
|
let ee = fe;
|
|
1052
|
-
var k, E, L, nt, Dt,
|
|
1052
|
+
var k, E, L, nt, Dt, B, Pt, j, xt, Yt, Vt, ot;
|
|
1053
1053
|
const C = class C {
|
|
1054
1054
|
constructor(i, e) {
|
|
1055
1055
|
c(this, k);
|
|
@@ -1057,18 +1057,18 @@ const C = class C {
|
|
|
1057
1057
|
c(this, L, []);
|
|
1058
1058
|
c(this, nt, []);
|
|
1059
1059
|
c(this, Dt, 0);
|
|
1060
|
-
c(this,
|
|
1060
|
+
c(this, B, []);
|
|
1061
1061
|
c(this, Pt, /* @__PURE__ */ a(() => {
|
|
1062
|
-
b(this,
|
|
1062
|
+
b(this, B, []);
|
|
1063
1063
|
const i = t(this, k).template || [];
|
|
1064
1064
|
Array.from(i).forEach((e) => {
|
|
1065
1065
|
var s;
|
|
1066
|
-
t(this,
|
|
1066
|
+
t(this, B).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1067
1067
|
}), (t(this, E).rawRecords || []).forEach((e) => {
|
|
1068
|
-
e.__ng || (e.__ng = t(this, xt).call(this)), e.__ng.height = t(this,
|
|
1068
|
+
e.__ng || (e.__ng = t(this, xt).call(this)), e.__ng.height = t(this, B).slice();
|
|
1069
1069
|
});
|
|
1070
1070
|
}, "#initialize"));
|
|
1071
|
-
c(this,
|
|
1071
|
+
c(this, j, /* @__PURE__ */ a(() => {
|
|
1072
1072
|
t(this, k).shadowRoot.querySelectorAll("nine-table-sheet").forEach((i) => {
|
|
1073
1073
|
i.invalidate();
|
|
1074
1074
|
});
|
|
@@ -1087,19 +1087,19 @@ const C = class C {
|
|
|
1087
1087
|
return t(this, ot).call(this, s[i]);
|
|
1088
1088
|
}, "get"));
|
|
1089
1089
|
v(this, "set", /* @__PURE__ */ a((i) => {
|
|
1090
|
-
this.clear(), this.add(i, !1), t(this,
|
|
1090
|
+
this.clear(), this.add(i, !1), t(this, j).call(this);
|
|
1091
1091
|
}, "set"));
|
|
1092
1092
|
c(this, xt, /* @__PURE__ */ a(() => ({
|
|
1093
1093
|
rowState: C.ROW_STATE.EMPTY,
|
|
1094
1094
|
deleted: !1,
|
|
1095
1095
|
filtered: !1,
|
|
1096
|
-
height: t(this,
|
|
1096
|
+
height: t(this, B).slice(),
|
|
1097
1097
|
o: {},
|
|
1098
1098
|
c: {},
|
|
1099
|
-
_: [0, 0, 0, 0, C.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this,
|
|
1099
|
+
_: [0, 0, 0, 0, C.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, B).slice(), -1, {}, {}]
|
|
1100
1100
|
}), "#getDefaultMeta"));
|
|
1101
1101
|
v(this, "reset", /* @__PURE__ */ a(() => {
|
|
1102
|
-
b(this, L, []), b(this, nt, []), t(this,
|
|
1102
|
+
b(this, L, []), b(this, nt, []), t(this, j).call(this);
|
|
1103
1103
|
}, "reset"));
|
|
1104
1104
|
v(this, "clear", /* @__PURE__ */ a(() => {
|
|
1105
1105
|
var i;
|
|
@@ -1127,7 +1127,7 @@ const C = class C {
|
|
|
1127
1127
|
return e || s.forEach((r, n) => {
|
|
1128
1128
|
const l = t(this, E).rawRecords[o - n];
|
|
1129
1129
|
l && (l.__ng.rowState = C.ROW_STATE.EMPTY);
|
|
1130
|
-
}), t(this,
|
|
1130
|
+
}), t(this, j).call(this), o;
|
|
1131
1131
|
}, "add"));
|
|
1132
1132
|
v(this, "delete", /* @__PURE__ */ a((i) => {
|
|
1133
1133
|
let e = [];
|
|
@@ -1138,7 +1138,7 @@ const C = class C {
|
|
|
1138
1138
|
r.__ng.rowid === o && (r.__ng.deleted = !0, r.__ng.rowState = C.ROW_STATE.DELETE);
|
|
1139
1139
|
});
|
|
1140
1140
|
}
|
|
1141
|
-
}), this.resetRecords(), t(this,
|
|
1141
|
+
}), this.resetRecords(), t(this, j).call(this);
|
|
1142
1142
|
}, "delete"));
|
|
1143
1143
|
v(this, "setValue", /* @__PURE__ */ a((i, e, s) => {
|
|
1144
1144
|
var d;
|
|
@@ -1188,7 +1188,7 @@ const C = class C {
|
|
|
1188
1188
|
return this.length;
|
|
1189
1189
|
}
|
|
1190
1190
|
};
|
|
1191
|
-
k = new WeakMap(), E = new WeakMap(), L = new WeakMap(), nt = new WeakMap(), Dt = new WeakMap(),
|
|
1191
|
+
k = new WeakMap(), E = new WeakMap(), L = new WeakMap(), nt = new WeakMap(), Dt = new WeakMap(), B = new WeakMap(), Pt = new WeakMap(), j = new WeakMap(), xt = new WeakMap(), Yt = new WeakMap(), Vt = new WeakMap(), ot = new WeakMap(), a(C, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1192
1192
|
v(C, "ROW_STATE", {
|
|
1193
1193
|
EMPTY: "EMPTY",
|
|
1194
1194
|
NORMAL: "NORMAL",
|
|
@@ -1197,13 +1197,13 @@ v(C, "ROW_STATE", {
|
|
|
1197
1197
|
DELETE: "DELETE"
|
|
1198
1198
|
});
|
|
1199
1199
|
let ie = C;
|
|
1200
|
-
var
|
|
1200
|
+
var K;
|
|
1201
1201
|
const ue = class ue {
|
|
1202
1202
|
constructor(i) {
|
|
1203
|
-
c(this,
|
|
1204
|
-
b(this,
|
|
1203
|
+
c(this, K);
|
|
1204
|
+
b(this, K, i), this.row = new ee(this), this.data = new ie(t(this, K), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1205
1205
|
var e;
|
|
1206
|
-
(e = t(this,
|
|
1206
|
+
(e = t(this, K).view) != null && e.redraw && t(this, K).view.redraw();
|
|
1207
1207
|
}, this.setDataSource = (e) => {
|
|
1208
1208
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1209
1209
|
}, this.getRowState = (e) => {
|
|
@@ -1218,7 +1218,7 @@ const ue = class ue {
|
|
|
1218
1218
|
}, this.setDataSource([]);
|
|
1219
1219
|
}
|
|
1220
1220
|
};
|
|
1221
|
-
|
|
1221
|
+
K = new WeakMap(), a(ue, "ngDataManager");
|
|
1222
1222
|
let se = ue;
|
|
1223
1223
|
var rt, A, vt, Xt;
|
|
1224
1224
|
const be = class be {
|
|
@@ -1293,17 +1293,17 @@ const be = class be {
|
|
|
1293
1293
|
};
|
|
1294
1294
|
rt = new WeakMap(), A = new WeakMap(), vt = new WeakMap(), Xt = new WeakMap(), a(be, "ngFields");
|
|
1295
1295
|
let ne = be;
|
|
1296
|
-
var
|
|
1296
|
+
var Z, Ut, Ft;
|
|
1297
1297
|
const ge = class ge extends HTMLElement {
|
|
1298
1298
|
constructor() {
|
|
1299
1299
|
super();
|
|
1300
1300
|
//#created = false;
|
|
1301
|
-
c(this,
|
|
1301
|
+
c(this, Z);
|
|
1302
1302
|
c(this, Ut);
|
|
1303
1303
|
c(this, Ft, /* @__PURE__ */ a(() => {
|
|
1304
1304
|
this.fields = new ne(this), b(this, Ut, new te(this)), H.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1305
1305
|
}, "#init"));
|
|
1306
|
-
this.attachShadow({ mode: "open" }), b(this,
|
|
1306
|
+
this.attachShadow({ mode: "open" }), b(this, Z, new se(this));
|
|
1307
1307
|
}
|
|
1308
1308
|
connectedCallback() {
|
|
1309
1309
|
t(this, Ft).call(this);
|
|
@@ -1313,18 +1313,18 @@ const ge = class ge extends HTMLElement {
|
|
|
1313
1313
|
}
|
|
1314
1314
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1315
1315
|
get data() {
|
|
1316
|
-
return t(this,
|
|
1316
|
+
return t(this, Z).data;
|
|
1317
1317
|
}
|
|
1318
1318
|
// π― ν(row) κ΄λ ¨ μ μ΄ μ κ·Όμ μ€ν
|
|
1319
1319
|
get row() {
|
|
1320
|
-
return t(this,
|
|
1320
|
+
return t(this, Z).row;
|
|
1321
1321
|
}
|
|
1322
1322
|
// π― μ 체 λ°μ΄ν° λ§€λμ μ κ·Ό νμν κ²½μ°
|
|
1323
1323
|
get dataManager() {
|
|
1324
|
-
return t(this,
|
|
1324
|
+
return t(this, Z);
|
|
1325
1325
|
}
|
|
1326
1326
|
};
|
|
1327
|
-
|
|
1327
|
+
Z = new WeakMap(), Ut = new WeakMap(), Ft = new WeakMap(), a(ge, "NineTable");
|
|
1328
1328
|
let oe = ge;
|
|
1329
1329
|
customElements.get("nine-table") || customElements.define("nine-table", oe);
|
|
1330
1330
|
//# sourceMappingURL=nine-table.js.map
|