@ninebone/table 0.0.340 → 0.0.344
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 +121 -121
- 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
|
@@ -5,7 +5,7 @@ var ne = (m) => {
|
|
|
5
5
|
var le = (m, i, e) => i in m ? se(m, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : m[i] = e;
|
|
6
6
|
var c = (m, i) => se(m, "name", { value: i, configurable: !0 });
|
|
7
7
|
var x = (m, i, e) => le(m, typeof i != "symbol" ? i + "" : i, e), oe = (m, i, e) => i.has(m) || ne("Cannot " + e);
|
|
8
|
-
var t = (m, i, e) => (oe(m, i, "read from private field"), e ? e.call(m) : i.get(m)),
|
|
8
|
+
var t = (m, i, e) => (oe(m, i, "read from private field"), e ? e.call(m) : i.get(m)), h = (m, i, e) => i.has(m) ? ne("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(m) : i.set(m, e), g = (m, i, e, s) => (oe(m, i, "write to private field"), s ? s.call(m, e) : i.set(m, e), e);
|
|
9
9
|
var re = (m, i, e, s) => ({
|
|
10
10
|
set _(o) {
|
|
11
11
|
g(m, i, o, e);
|
|
@@ -27,13 +27,13 @@ var C, M, y, O, D, N, bt, B, gt;
|
|
|
27
27
|
const jt = class jt extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
h(this, C);
|
|
31
|
+
h(this, M, !1);
|
|
32
|
+
h(this, y);
|
|
33
|
+
h(this, O);
|
|
34
|
+
h(this, D);
|
|
35
|
+
h(this, N);
|
|
36
|
+
h(this, bt, /* @__PURE__ */ c(() => {
|
|
37
37
|
if (!t(this, C)) return;
|
|
38
38
|
const e = t(this, C).querySelector(".ng-container-body");
|
|
39
39
|
e && (g(this, N, new ResizeObserver(() => {
|
|
@@ -44,8 +44,8 @@ const jt = class jt extends HTMLElement {
|
|
|
44
44
|
if (!t(this, C) || !t(this, y) || t(this, M)) return;
|
|
45
45
|
const e = t(this, y).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const o = t(this, y).track, r = t(this, y).thumb, n = t(this, C).querySelector(".ng-container-bottom"), l = e.clientWidth,
|
|
48
|
-
if (l !== 0 &&
|
|
47
|
+
const o = t(this, y).track, r = t(this, y).thumb, n = t(this, C).querySelector(".ng-container-bottom"), l = e.clientWidth, a = s.scrollWidth;
|
|
48
|
+
if (l !== 0 && a > l)
|
|
49
49
|
n && (n.style.display = "flex");
|
|
50
50
|
else {
|
|
51
51
|
n && (n.style.display = "none");
|
|
@@ -53,27 +53,27 @@ const jt = class jt extends HTMLElement {
|
|
|
53
53
|
}
|
|
54
54
|
const d = o.clientWidth;
|
|
55
55
|
if (d <= 0) return;
|
|
56
|
-
const f = Math.max(Math.min(d * (l /
|
|
56
|
+
const f = Math.max(Math.min(d * (l / a), d), 20);
|
|
57
57
|
r.style.width = `${f}px`;
|
|
58
|
-
const u = e.scrollLeft, b =
|
|
58
|
+
const u = e.scrollLeft, b = a - l;
|
|
59
59
|
let p = 0;
|
|
60
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`, z.log(p), t(this, y).left.disabled = p === 0, t(this, y).right.disabled = p >= E - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
|
|
64
|
+
h(this, B, /* @__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;
|
|
68
68
|
const r = t(this, y).track.getBoundingClientRect(), n = t(this, y).thumb.clientWidth;
|
|
69
69
|
let l = e;
|
|
70
70
|
l < 0 && (l = 0);
|
|
71
|
-
const
|
|
72
|
-
l >
|
|
71
|
+
const a = r.width - n;
|
|
72
|
+
l > a && (l = a), l = parseInt(l, 10), t(this, y).thumb.style.left = `${l}px`, t(this, y).left.disabled = l === 0, t(this, y).right.disabled = l >= a - 1;
|
|
73
73
|
const d = s.clientWidth, u = o.scrollWidth - d;
|
|
74
|
-
return
|
|
74
|
+
return a > 0 && u > 0 && (s.scrollLeft = l / a * u), l > 0 && l < a - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
|
|
76
|
+
h(this, gt, /* @__PURE__ */ c(() => {
|
|
77
77
|
const e = /* @__PURE__ */ c((o) => {
|
|
78
78
|
clearInterval(t(this, O)), clearInterval(t(this, D));
|
|
79
79
|
const r = parseInt(t(this, y).thumb.style.left || 0, 10);
|
|
@@ -102,8 +102,8 @@ const jt = class jt extends HTMLElement {
|
|
|
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
|
-
const
|
|
106
|
-
t(this, B).call(this, l.clientX -
|
|
105
|
+
const a = t(this, y).track.getBoundingClientRect();
|
|
106
|
+
t(this, B).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");
|
|
@@ -205,11 +205,11 @@ var P, I, v, st, nt, yt;
|
|
|
205
205
|
const Zt = class Zt extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
208
|
+
h(this, P);
|
|
209
|
+
h(this, I, !1);
|
|
210
|
+
h(this, v);
|
|
211
|
+
h(this, st, 0);
|
|
212
|
+
h(this, nt, 0);
|
|
213
213
|
/**
|
|
214
214
|
* 🎯 스크롤바 위치 및 썸브 크기 갱신
|
|
215
215
|
*/
|
|
@@ -223,17 +223,17 @@ const Zt = class Zt extends HTMLElement {
|
|
|
223
223
|
return;
|
|
224
224
|
} else
|
|
225
225
|
r.style.display = "block";
|
|
226
|
-
const
|
|
227
|
-
if (
|
|
228
|
-
const d = Math.max(Math.min(
|
|
226
|
+
const a = o.clientHeight;
|
|
227
|
+
if (a <= 0) return;
|
|
228
|
+
const d = Math.max(Math.min(a * (n / l), a), 20);
|
|
229
229
|
r.style.height = `${d}px`;
|
|
230
230
|
const f = e.scrollTop, u = l - n;
|
|
231
231
|
let b = 0;
|
|
232
|
-
u > 0 && (b = f / u * (
|
|
233
|
-
const p =
|
|
232
|
+
u > 0 && (b = f / u * (a - d));
|
|
233
|
+
const p = a - d;
|
|
234
234
|
b < 0 && (b = 0), b > p && (b = p), r.style.top = `${b}px`, t(this, v).top.disabled = f <= 0, t(this, v).bottom.disabled = f >= u - 1;
|
|
235
235
|
}, "refresh"));
|
|
236
|
-
|
|
236
|
+
h(this, yt, /* @__PURE__ */ c(() => {
|
|
237
237
|
const e = t(this, v).container;
|
|
238
238
|
e.addEventListener("scroll", () => {
|
|
239
239
|
t(this, I) || this.refresh();
|
|
@@ -242,7 +242,7 @@ const Zt = class Zt extends HTMLElement {
|
|
|
242
242
|
s.stopPropagation(), s.preventDefault(), g(this, I, !0), g(this, st, s.clientY), g(this, nt, e.scrollTop);
|
|
243
243
|
const o = /* @__PURE__ */ c((n) => {
|
|
244
244
|
if (!t(this, I)) return;
|
|
245
|
-
const l = t(this, v).track.getBoundingClientRect(),
|
|
245
|
+
const l = t(this, v).track.getBoundingClientRect(), a = t(this, v).thumb.clientHeight, f = l.height - a, u = n.clientY - t(this, st), b = e.clientHeight, p = e.querySelector("table");
|
|
246
246
|
z.log(p), z.log(p.scrollHeight);
|
|
247
247
|
const L = p.scrollHeight - b;
|
|
248
248
|
if (f > 0 && L > 0) {
|
|
@@ -256,9 +256,9 @@ const Zt = class Zt extends HTMLElement {
|
|
|
256
256
|
document.addEventListener("mousemove", o), document.addEventListener("mouseup", r);
|
|
257
257
|
}), t(this, v).track.addEventListener("mousedown", (s) => {
|
|
258
258
|
if (s.button !== 0 || s.target === t(this, v).thumb) return;
|
|
259
|
-
const o = t(this, v).track.getBoundingClientRect(), r = t(this, v).thumb.clientHeight, n = s.clientY - o.top - r / 2,
|
|
260
|
-
if (
|
|
261
|
-
const b = Math.max(0, Math.min(1, n /
|
|
259
|
+
const o = t(this, v).track.getBoundingClientRect(), r = t(this, v).thumb.clientHeight, n = s.clientY - o.top - r / 2, a = o.height - r, d = e.clientHeight, u = e.querySelector("table").scrollHeight - d;
|
|
260
|
+
if (a > 0 && u > 0) {
|
|
261
|
+
const b = Math.max(0, Math.min(1, n / a));
|
|
262
262
|
e.scrollTop = b * u;
|
|
263
263
|
}
|
|
264
264
|
this.refresh();
|
|
@@ -369,15 +369,15 @@ 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, pt).call(o, e), t(r = H, j).call(r, e, "thead"), t(n = H, j).call(n, e, "tbody"), t(l = H, j).call(l, e, "tfoot"), Array.from(e.querySelectorAll("colgroup col")).forEach((
|
|
373
|
-
const f =
|
|
372
|
+
return t(o = H, pt).call(o, e), t(r = H, j).call(r, e, "thead"), t(n = H, j).call(n, e, "tbody"), t(l = H, j).call(l, e, "tfoot"), Array.from(e.querySelectorAll("colgroup col")).forEach((a, d) => {
|
|
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);
|
|
376
376
|
});
|
|
377
377
|
}), e;
|
|
378
378
|
}
|
|
379
379
|
};
|
|
380
|
-
pt = new WeakMap(), j = new WeakMap(), c(H, "TableCompiler"),
|
|
380
|
+
pt = new WeakMap(), j = new WeakMap(), c(H, "TableCompiler"), h(H, pt, /* @__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,18 +391,18 @@ pt = new WeakMap(), j = new WeakMap(), c(H, "TableCompiler"), a(H, pt, /* @__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")),
|
|
394
|
+
}, "#ensureTableStructure")), h(H, j, /* @__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;
|
|
398
|
-
o.forEach((
|
|
399
|
-
n +=
|
|
398
|
+
o.forEach((a) => {
|
|
399
|
+
n += a.colSpan || 1;
|
|
400
400
|
});
|
|
401
401
|
const l = Array.from(Array(r), () => Array(n).fill(null));
|
|
402
|
-
s.forEach((
|
|
403
|
-
const d =
|
|
402
|
+
s.forEach((a) => {
|
|
403
|
+
const d = a.sectionRowIndex;
|
|
404
404
|
let f = 0;
|
|
405
|
-
Array.from(
|
|
405
|
+
Array.from(a.querySelectorAll("th,td")).forEach((u) => {
|
|
406
406
|
for (let E = 0; E < l[d].length; E++)
|
|
407
407
|
if (l[d][E] === null) {
|
|
408
408
|
f = E;
|
|
@@ -413,9 +413,9 @@ pt = new WeakMap(), j = new WeakMap(), c(H, "TableCompiler"), a(H, pt, /* @__PUR
|
|
|
413
413
|
for (let L = 0; L < p; L++)
|
|
414
414
|
d + E < r && f + L < n && (l[d + E][f + L] = E === 0 && L === 0 ? "1" : "0");
|
|
415
415
|
});
|
|
416
|
-
}), s.forEach((
|
|
417
|
-
const d =
|
|
418
|
-
Array.from(
|
|
416
|
+
}), s.forEach((a) => {
|
|
417
|
+
const d = a.sectionRowIndex;
|
|
418
|
+
Array.from(a.querySelectorAll("th,td")).forEach((f) => {
|
|
419
419
|
for (let u = 0; u < l[d].length; u++)
|
|
420
420
|
if (l[d][u] === "1") {
|
|
421
421
|
f.dataset.col = u, l[d][u] = "0";
|
|
@@ -428,13 +428,13 @@ let Nt = H;
|
|
|
428
428
|
var Y, w, _, R, $, V, Z, mt, xt, ot, rt, vt, wt, lt, G, St;
|
|
429
429
|
const Gt = class Gt {
|
|
430
430
|
constructor(i) {
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
431
|
+
h(this, Y);
|
|
432
|
+
h(this, w);
|
|
433
|
+
h(this, _, /* @__PURE__ */ new Map());
|
|
434
|
+
h(this, R, null);
|
|
435
|
+
h(this, $, null);
|
|
436
|
+
h(this, V, 0);
|
|
437
|
+
h(this, Z, 40);
|
|
438
438
|
x(this, "refresh", /* @__PURE__ */ c(() => {
|
|
439
439
|
var e;
|
|
440
440
|
const i = t(this, w).querySelector(".ng-container-body");
|
|
@@ -465,7 +465,7 @@ const Gt = class Gt {
|
|
|
465
465
|
});
|
|
466
466
|
}
|
|
467
467
|
}, "initialize"));
|
|
468
|
-
|
|
468
|
+
h(this, mt, /* @__PURE__ */ c((i, e) => {
|
|
469
469
|
const s = t(this, _).get(e);
|
|
470
470
|
if (!s || s.length === 0) return;
|
|
471
471
|
const o = i.querySelector("tbody.bindable-tbody");
|
|
@@ -473,12 +473,12 @@ const Gt = class Gt {
|
|
|
473
473
|
o.querySelectorAll("tr:not(.nodata)").forEach((l) => l.remove());
|
|
474
474
|
const r = o.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
475
475
|
for (let l = 0; l < t(this, Z); l++)
|
|
476
|
-
s.forEach((
|
|
477
|
-
n.appendChild(
|
|
476
|
+
s.forEach((a) => {
|
|
477
|
+
n.appendChild(a.cloneNode(!0));
|
|
478
478
|
});
|
|
479
479
|
r ? r.before(n) : o.appendChild(n);
|
|
480
480
|
}, "#renderRows"));
|
|
481
|
-
|
|
481
|
+
h(this, xt, /* @__PURE__ */ c((i) => {
|
|
482
482
|
if (t(this, R) !== null && t(this, R) > 0)
|
|
483
483
|
return t(this, R);
|
|
484
484
|
const e = t(this, _).get(".ng-container-body");
|
|
@@ -490,44 +490,44 @@ const Gt = class Gt {
|
|
|
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, w), l = n.style.display,
|
|
493
|
+
const n = t(this, w), 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)");
|
|
497
497
|
return u.forEach((b) => {
|
|
498
498
|
f += b.offsetHeight || b.getBoundingClientRect().height;
|
|
499
|
-
}), u.forEach((b) => b.remove()), n.style.display = l, n.style.visibility =
|
|
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
502
|
if (!t(this, w).querySelector(".ng-container-body")) return;
|
|
503
503
|
const e = t(this, Y).data.get() || [], s = e.length > 0 ? e.length : 100, o = t(this, R), r = s * o;
|
|
504
504
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
505
|
-
const l = t(this, w).querySelector(n),
|
|
506
|
-
|
|
505
|
+
const l = t(this, w).querySelector(n), a = l == null ? void 0 : l.querySelector("table");
|
|
506
|
+
a && (a.style.height = `${r}px`);
|
|
507
507
|
});
|
|
508
508
|
}, "#updateVirtualScrollHeight"));
|
|
509
|
-
|
|
509
|
+
h(this, rt, /* @__PURE__ */ c(() => {
|
|
510
510
|
if (t(this, V) > 0 && t(this, R) > 0) {
|
|
511
511
|
const i = Math.ceil(t(this, V) / t(this, R));
|
|
512
512
|
g(this, Z, i + 20);
|
|
513
513
|
} else
|
|
514
514
|
g(this, Z, 40);
|
|
515
515
|
}, "#updateRowCount"));
|
|
516
|
-
|
|
517
|
-
var
|
|
516
|
+
h(this, vt, /* @__PURE__ */ c(() => {
|
|
517
|
+
var a, d, f;
|
|
518
518
|
const i = t(this, w).querySelector(".ng-container-left table"), e = t(this, w).querySelector(".ng-container-body table"), s = t(this, w).querySelector(".ng-container-right table");
|
|
519
519
|
if (!e) return;
|
|
520
520
|
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);
|
|
521
521
|
for (let u = 0; u < l; u++) {
|
|
522
522
|
const b = [
|
|
523
|
-
((
|
|
523
|
+
((a = o[u]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
524
524
|
((d = r[u]) == null ? void 0 : d.getBoundingClientRect().height) || 0,
|
|
525
525
|
((f = n[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
526
526
|
], p = Math.max(...b);
|
|
527
527
|
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`));
|
|
528
528
|
}
|
|
529
529
|
}, "#syncRowHeights"));
|
|
530
|
-
|
|
530
|
+
h(this, wt, /* @__PURE__ */ c(() => {
|
|
531
531
|
!t(this, w) || !(t(this, w) instanceof HTMLElement) || (g(this, $, new ResizeObserver((i) => {
|
|
532
532
|
for (const e of i) {
|
|
533
533
|
const s = e.target;
|
|
@@ -543,13 +543,13 @@ const Gt = class Gt {
|
|
|
543
543
|
}
|
|
544
544
|
})), t(this, $).observe(t(this, w)));
|
|
545
545
|
}, "#initResizeObserver"));
|
|
546
|
-
|
|
546
|
+
h(this, lt, /* @__PURE__ */ c(() => {
|
|
547
547
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
548
548
|
const e = t(this, w).querySelector(i);
|
|
549
549
|
e && e.querySelector("tbody.bindable-tbody") && t(this, mt).call(this, e, i);
|
|
550
550
|
}), t(this, vt).call(this);
|
|
551
551
|
}, "#renderAllContainers"));
|
|
552
|
-
|
|
552
|
+
h(this, G, /* @__PURE__ */ c((i) => {
|
|
553
553
|
var r;
|
|
554
554
|
const e = t(this, R);
|
|
555
555
|
if (!e || e <= 0) return;
|
|
@@ -557,15 +557,15 @@ const Gt = class Gt {
|
|
|
557
557
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
558
558
|
const l = t(this, w).querySelector(n);
|
|
559
559
|
if (!l) return;
|
|
560
|
-
const
|
|
561
|
-
if (!
|
|
562
|
-
Array.from(
|
|
560
|
+
const a = l.querySelector("tbody.bindable-tbody");
|
|
561
|
+
if (!a) return;
|
|
562
|
+
Array.from(a.querySelectorAll("tr:not(.nodata)")).forEach((f, u) => {
|
|
563
563
|
const b = s + Math.floor(u / o), p = t(this, Y).data.get(b);
|
|
564
564
|
z.log("--", t(this, Y).data.get(0)), f.style.display = "", t(this, St).call(this, f, p, b);
|
|
565
565
|
});
|
|
566
566
|
});
|
|
567
567
|
}, "#handleScroll"));
|
|
568
|
-
|
|
568
|
+
h(this, St, /* @__PURE__ */ c((i, e, s) => {
|
|
569
569
|
i.dataset.row = s, z.log(i, e, s), Array.from(i.cells).forEach((o, r) => {
|
|
570
570
|
const n = o.dataset.bind;
|
|
571
571
|
n && e && e[n] !== void 0 ? o.textContent = e[n] : o.textContent = e ? e[Object.keys(e)[r]] ?? `R${s}C${r}` : `행 ${s + 1}`, o.dataset.row = s;
|
|
@@ -590,9 +590,9 @@ var Et, J, X, Rt, kt, qt, At, Tt;
|
|
|
590
590
|
const it = class it extends HTMLElement {
|
|
591
591
|
constructor() {
|
|
592
592
|
super();
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
593
|
+
h(this, Et);
|
|
594
|
+
h(this, J, null);
|
|
595
|
+
h(this, X);
|
|
596
596
|
/**
|
|
597
597
|
* data.set, add, delete
|
|
598
598
|
* filter, sorting : 고려대상
|
|
@@ -600,7 +600,7 @@ const it = class it extends HTMLElement {
|
|
|
600
600
|
x(this, "invalidate", /* @__PURE__ */ c(() => {
|
|
601
601
|
t(this, X).refresh();
|
|
602
602
|
}, "invalidate"));
|
|
603
|
-
|
|
603
|
+
h(this, Rt, /* @__PURE__ */ c(() => {
|
|
604
604
|
[
|
|
605
605
|
{ selector: ".ng-container-body", type: null },
|
|
606
606
|
{ selector: ".ng-container-left", type: "left" },
|
|
@@ -612,7 +612,7 @@ const it = class it extends HTMLElement {
|
|
|
612
612
|
r.innerHTML = "", r.appendChild(n);
|
|
613
613
|
});
|
|
614
614
|
}, "#renderSplitContainers"));
|
|
615
|
-
|
|
615
|
+
h(this, kt, /* @__PURE__ */ c(() => {
|
|
616
616
|
["left", "right"].forEach((e) => {
|
|
617
617
|
const s = this.querySelector(`.ng-container-${e}`), o = s == null ? void 0 : s.querySelector("table");
|
|
618
618
|
if (!s || !o) return;
|
|
@@ -638,7 +638,7 @@ const it = class it extends HTMLElement {
|
|
|
638
638
|
/**
|
|
639
639
|
* 🎯 마스터 테이블을 기반으로 특정 fixed 타입 영역만 남기는 분할 헬퍼
|
|
640
640
|
*/
|
|
641
|
-
|
|
641
|
+
h(this, qt, /* @__PURE__ */ c((e, s) => {
|
|
642
642
|
const o = e.cloneNode(!0), r = o.querySelector("tbody");
|
|
643
643
|
if (r) {
|
|
644
644
|
const n = document.createElement("tbody");
|
|
@@ -661,10 +661,10 @@ const it = class it extends HTMLElement {
|
|
|
661
661
|
const s = this.querySelector(".ng-container-body");
|
|
662
662
|
s && (s.scrollTop = e);
|
|
663
663
|
}, "scrollToY"));
|
|
664
|
-
|
|
664
|
+
h(this, At, /* @__PURE__ */ c(() => {
|
|
665
665
|
t(this, Tt).call(this);
|
|
666
666
|
}, "#init"));
|
|
667
|
-
|
|
667
|
+
h(this, Tt, /* @__PURE__ */ c(() => {
|
|
668
668
|
const e = it.SCROLLBAR_SIZE;
|
|
669
669
|
this.innerHTML = `
|
|
670
670
|
<style>
|
|
@@ -827,7 +827,7 @@ var Lt, ct;
|
|
|
827
827
|
const Jt = class Jt extends HTMLElement {
|
|
828
828
|
constructor() {
|
|
829
829
|
super();
|
|
830
|
-
|
|
830
|
+
h(this, Lt, /* @__PURE__ */ c(() => {
|
|
831
831
|
var e;
|
|
832
832
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
833
833
|
var n;
|
|
@@ -835,7 +835,7 @@ const Jt = class Jt extends HTMLElement {
|
|
|
835
835
|
t(this, ct).call(this, r, o);
|
|
836
836
|
}), t(this, ct).call(this, 0, !1);
|
|
837
837
|
}, "#init"));
|
|
838
|
-
|
|
838
|
+
h(this, ct, /* @__PURE__ */ c((e, s = !1) => {
|
|
839
839
|
const o = /* @__PURE__ */ c(() => {
|
|
840
840
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
841
841
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((p) => p.style.setProperty("display", "none"));
|
|
@@ -844,12 +844,12 @@ const Jt = class Jt extends HTMLElement {
|
|
|
844
844
|
const E = parseInt(p.getAttribute("data-index"), 10), L = this.querySelector(`nine-splitter[data-split-index="${E}"]`), ft = f[E + 1];
|
|
845
845
|
L && ft && ft.classList.contains("active") && L.style.setProperty("display", "flex");
|
|
846
846
|
});
|
|
847
|
-
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), n = this.querySelector("nine-table-sheets-body"), l = r.querySelectorAll(".nine-tab-item"),
|
|
847
|
+
}, "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");
|
|
848
848
|
if (!l[e]) return;
|
|
849
849
|
if (!s)
|
|
850
850
|
l.forEach((f, u) => {
|
|
851
851
|
f.classList.toggle("active", u === e);
|
|
852
|
-
}),
|
|
852
|
+
}), a.forEach((f, u) => {
|
|
853
853
|
const b = u === e;
|
|
854
854
|
f.classList.toggle("active", b), f.style.flex = b ? "1 1 100%" : "";
|
|
855
855
|
});
|
|
@@ -877,25 +877,25 @@ customElements.get("nine-table-sheets") || customElements.define("nine-table-she
|
|
|
877
877
|
var k, Ht, at, Ct;
|
|
878
878
|
const Qt = class Qt {
|
|
879
879
|
constructor(i) {
|
|
880
|
-
|
|
881
|
-
|
|
880
|
+
h(this, k);
|
|
881
|
+
h(this, Ht, /* @__PURE__ */ c(() => {
|
|
882
882
|
t(this, Ct).call(this), new ResizeObserver((i) => {
|
|
883
883
|
for (let e of i)
|
|
884
884
|
t(this, k).getAttribute("auto-height") === "true" && t(this, at).call(this);
|
|
885
885
|
}).observe(t(this, k));
|
|
886
886
|
}, "#init"));
|
|
887
|
-
|
|
888
|
-
var
|
|
887
|
+
h(this, at, /* @__PURE__ */ c(() => {
|
|
888
|
+
var a, d;
|
|
889
889
|
const i = Array.from(t(this, k).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
890
890
|
if (i.length === 0) return;
|
|
891
|
-
const e = parseInt(t(this, k).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), o = (
|
|
891
|
+
const e = parseInt(t(this, k).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), o = (a = t(this, k).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : a.getBoundingClientRect().height, r = (d = t(this, k).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : d.getBoundingClientRect().height, n = ut.SCROLLBAR_SIZE, l = e * s + o + r + n;
|
|
892
892
|
t(this, k).style.height = `${l}px`;
|
|
893
893
|
}, "#applyAutoHeight"));
|
|
894
|
-
|
|
895
|
-
const e = Array.from(t(this, k).children).filter((
|
|
894
|
+
h(this, Ct, /* @__PURE__ */ c(() => {
|
|
895
|
+
const e = Array.from(t(this, k).children).filter((a) => a.tagName === "TABLE"), s = t(this, k).getAttribute("auto-height") === "true", o = e.length, r = e.map((a, d) => {
|
|
896
896
|
const u = `<nine-table-sheet class="${d === 0 ? "active" : ""}" data-index="${d}"></nine-table-sheet>`, b = d < o - 1 ? `<nine-splitter class="h" data-split-index="${d}"></nine-splitter>` : "";
|
|
897
897
|
return u + b;
|
|
898
|
-
}).join(""), n = e.map((
|
|
898
|
+
}).join(""), n = e.map((a, d) => `<div class="nine-tab-item ${d === 0 ? "active" : ""}" data-index="${d}">Sheet ${d + 1}</div>`).join("");
|
|
899
899
|
t(this, k).shadowRoot.innerHTML = `
|
|
900
900
|
<style>
|
|
901
901
|
:host {
|
|
@@ -996,9 +996,9 @@ const Qt = class Qt {
|
|
|
996
996
|
<nine-table-footer></nine-table-footer>
|
|
997
997
|
`;
|
|
998
998
|
const l = t(this, k).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
999
|
-
l == null || l.forEach((
|
|
999
|
+
l == null || l.forEach((a, d) => {
|
|
1000
1000
|
e[d] && setTimeout(() => {
|
|
1001
|
-
|
|
1001
|
+
a.generate(e[d]), s && t(this, at).call(this);
|
|
1002
1002
|
});
|
|
1003
1003
|
});
|
|
1004
1004
|
}, "#render"));
|
|
@@ -1010,8 +1010,8 @@ let Yt = Qt;
|
|
|
1010
1010
|
var ht, Q;
|
|
1011
1011
|
const te = class te {
|
|
1012
1012
|
constructor(i) {
|
|
1013
|
-
|
|
1014
|
-
|
|
1013
|
+
h(this, ht);
|
|
1014
|
+
h(this, Q, -1);
|
|
1015
1015
|
x(this, "count", /* @__PURE__ */ c(() => t(this, ht).rawRecords.length, "count"));
|
|
1016
1016
|
g(this, ht, i);
|
|
1017
1017
|
}
|
|
@@ -1028,13 +1028,13 @@ let Vt = te;
|
|
|
1028
1028
|
var q, S, A, tt, _t, W, Mt, U, dt, It, $t, et;
|
|
1029
1029
|
const T = class T {
|
|
1030
1030
|
constructor(i, e) {
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1031
|
+
h(this, q);
|
|
1032
|
+
h(this, S);
|
|
1033
|
+
h(this, A, []);
|
|
1034
|
+
h(this, tt, []);
|
|
1035
|
+
h(this, _t, 0);
|
|
1036
|
+
h(this, W, []);
|
|
1037
|
+
h(this, Mt, /* @__PURE__ */ c(() => {
|
|
1038
1038
|
g(this, W, []);
|
|
1039
1039
|
const i = t(this, q).template || [];
|
|
1040
1040
|
Array.from(i).forEach((e) => {
|
|
@@ -1044,7 +1044,7 @@ const T = class T {
|
|
|
1044
1044
|
e.__ng || (e.__ng = t(this, dt).call(this)), e.__ng.height = t(this, W).slice();
|
|
1045
1045
|
});
|
|
1046
1046
|
}, "#initialize"));
|
|
1047
|
-
|
|
1047
|
+
h(this, U, /* @__PURE__ */ c(() => {
|
|
1048
1048
|
t(this, q).shadowRoot.querySelectorAll("nine-table-sheet").forEach((i) => {
|
|
1049
1049
|
i.invalidate();
|
|
1050
1050
|
});
|
|
@@ -1065,7 +1065,7 @@ const T = class T {
|
|
|
1065
1065
|
x(this, "set", /* @__PURE__ */ c((i) => {
|
|
1066
1066
|
this.clear(), this.add(i, !1), t(this, U).call(this);
|
|
1067
1067
|
}, "set"));
|
|
1068
|
-
|
|
1068
|
+
h(this, dt, /* @__PURE__ */ c(() => ({
|
|
1069
1069
|
rowState: T.ROW_STATE.EMPTY,
|
|
1070
1070
|
deleted: !1,
|
|
1071
1071
|
filtered: !1,
|
|
@@ -1081,7 +1081,7 @@ const T = class T {
|
|
|
1081
1081
|
var i;
|
|
1082
1082
|
t(this, S).rawRecords = [], g(this, A, []), g(this, tt, []), (i = t(this, S).viewRecords) != null && i.reset && t(this, S).viewRecords.reset();
|
|
1083
1083
|
}, "clear"));
|
|
1084
|
-
|
|
1084
|
+
h(this, It, /* @__PURE__ */ c((i) => {
|
|
1085
1085
|
var o;
|
|
1086
1086
|
Array.isArray(i) || (i = [i]);
|
|
1087
1087
|
const e = typeof ((o = t(this, q).fields) == null ? void 0 : o.get) == "function" ? t(this, q).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
@@ -1092,7 +1092,7 @@ const T = class T {
|
|
|
1092
1092
|
}), s.push(n);
|
|
1093
1093
|
}), s;
|
|
1094
1094
|
}, "#json2Array"));
|
|
1095
|
-
|
|
1095
|
+
h(this, $t, /* @__PURE__ */ c((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1096
1096
|
e.__ng = t(this, dt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = T.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1097
1097
|
}), i), "#defaultInsert"));
|
|
1098
1098
|
x(this, "add", /* @__PURE__ */ c((i, e = !0) => {
|
|
@@ -1117,9 +1117,9 @@ const T = class T {
|
|
|
1117
1117
|
}), this.resetRecords(), t(this, U).call(this);
|
|
1118
1118
|
}, "delete"));
|
|
1119
1119
|
x(this, "setValue", /* @__PURE__ */ c((i, e, s) => {
|
|
1120
|
-
var
|
|
1120
|
+
var a;
|
|
1121
1121
|
i = parseInt(i, 10);
|
|
1122
|
-
const r = (typeof ((
|
|
1122
|
+
const r = (typeof ((a = t(this, q).fields) == null ? void 0 : a.get) == "function" ? t(this, q).fields.get() : []).indexOf(e);
|
|
1123
1123
|
if (r < 0) return;
|
|
1124
1124
|
const n = this.getValidData()[i];
|
|
1125
1125
|
if (!n) return;
|
|
@@ -1134,16 +1134,16 @@ const T = class T {
|
|
|
1134
1134
|
});
|
|
1135
1135
|
}, "resetRecords"));
|
|
1136
1136
|
x(this, "getValidData", /* @__PURE__ */ c(() => (t(this, A).length === 0 && t(this, S).rawRecords.length > 0 && this.resetRecords(), t(this, A)), "getValidData"));
|
|
1137
|
-
|
|
1138
|
-
var
|
|
1137
|
+
h(this, et, /* @__PURE__ */ c((i) => {
|
|
1138
|
+
var n;
|
|
1139
1139
|
if (!i) return i;
|
|
1140
|
-
const e = Array.isArray(i) ? i :
|
|
1141
|
-
const
|
|
1142
|
-
return
|
|
1143
|
-
|
|
1144
|
-
}),
|
|
1140
|
+
const e = !Array.isArray(i), s = e ? [i] : i, o = typeof ((n = t(this, q).fields) == null ? void 0 : n.get) == "function" ? t(this, q).fields.get() : [], r = s.filter((l) => !l.__ng.deleted).map((l) => {
|
|
1141
|
+
const a = {};
|
|
1142
|
+
return o.forEach((d, f) => {
|
|
1143
|
+
a[d] = l.v ? l.v[f] : l[d];
|
|
1144
|
+
}), a.__ng = l.__ng, a;
|
|
1145
1145
|
});
|
|
1146
|
-
return
|
|
1146
|
+
return e ? r[0] : r;
|
|
1147
1147
|
}, "#conv"));
|
|
1148
1148
|
x(this, "count", /* @__PURE__ */ c(() => this.getValidData().length, "count"));
|
|
1149
1149
|
g(this, q, i), g(this, S, e), t(this, Mt).call(this);
|
|
@@ -1176,7 +1176,7 @@ let Xt = T;
|
|
|
1176
1176
|
var F;
|
|
1177
1177
|
const ee = class ee {
|
|
1178
1178
|
constructor(i) {
|
|
1179
|
-
|
|
1179
|
+
h(this, F);
|
|
1180
1180
|
g(this, F, i), this.row = new Vt(this), this.data = new Xt(t(this, F), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1181
1181
|
var e;
|
|
1182
1182
|
(e = t(this, F).view) != null && e.redraw && t(this, F).view.redraw();
|
|
@@ -1201,8 +1201,8 @@ const ie = class ie extends HTMLElement {
|
|
|
1201
1201
|
constructor() {
|
|
1202
1202
|
super();
|
|
1203
1203
|
//#created = false;
|
|
1204
|
-
|
|
1205
|
-
|
|
1204
|
+
h(this, K);
|
|
1205
|
+
h(this, Wt);
|
|
1206
1206
|
this.attachShadow({ mode: "open" }), g(this, K, new Ut(this));
|
|
1207
1207
|
}
|
|
1208
1208
|
connectedCallback() {
|