@ninebone/table 0.0.780 β 0.0.781
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 +251 -255
- 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
|
@@ -44,8 +44,8 @@ const es = class es extends HTMLElement {
|
|
|
44
44
|
if (!t(this, j) || !t(this, E) || t(this, G)) return;
|
|
45
45
|
const e = t(this, E).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const r = t(this, E).track,
|
|
48
|
-
if (
|
|
47
|
+
const r = t(this, E).track, a = t(this, E).thumb, o = t(this, j).querySelector(".ng-container-bottom"), i = e.clientWidth, c = s.scrollWidth;
|
|
48
|
+
if (i !== 0 && c > i)
|
|
49
49
|
o && (o.style.display = "flex");
|
|
50
50
|
else {
|
|
51
51
|
o && (o.style.display = "none");
|
|
@@ -53,31 +53,31 @@ const es = class es extends HTMLElement {
|
|
|
53
53
|
}
|
|
54
54
|
const l = r.clientWidth;
|
|
55
55
|
if (l <= 0) return;
|
|
56
|
-
const g = Math.max(Math.min(l * (
|
|
57
|
-
|
|
58
|
-
const f = e.scrollLeft, b = c -
|
|
56
|
+
const g = Math.max(Math.min(l * (i / c), l), 20);
|
|
57
|
+
a.style.width = `${g}px`;
|
|
58
|
+
const f = e.scrollLeft, b = c - i;
|
|
59
59
|
let u = 0;
|
|
60
60
|
b > 0 && (u = parseInt(f / b * (l - g), 10)), u < 0 && (u = 0);
|
|
61
61
|
const p = l - g;
|
|
62
|
-
u > p && (u = p),
|
|
62
|
+
u > p && (u = p), a.style.left = `${u}px`, t(this, E).left.disabled = u === 0, t(this, E).right.disabled = u >= p - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
64
|
d(this, nt, /* @__PURE__ */ h((e) => {
|
|
65
65
|
if (!t(this, E)) return !1;
|
|
66
66
|
const s = t(this, E).container, r = s.querySelector("table");
|
|
67
67
|
if (!r) return !1;
|
|
68
|
-
const
|
|
69
|
-
let
|
|
70
|
-
|
|
71
|
-
const c =
|
|
72
|
-
|
|
68
|
+
const a = t(this, E).track.getBoundingClientRect(), o = t(this, E).thumb.clientWidth;
|
|
69
|
+
let i = e;
|
|
70
|
+
i < 0 && (i = 0);
|
|
71
|
+
const c = a.width - o;
|
|
72
|
+
i > c && (i = c), i = parseInt(i, 10), t(this, E).thumb.style.left = `${i}px`, t(this, E).left.disabled = i === 0, t(this, E).right.disabled = i >= c - 1;
|
|
73
73
|
const l = s.clientWidth, f = r.scrollWidth - l;
|
|
74
|
-
return c > 0 && f > 0 && (s.scrollLeft =
|
|
74
|
+
return c > 0 && f > 0 && (s.scrollLeft = i / c * f), i > 0 && i < c - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
76
|
d(this, Qt, /* @__PURE__ */ h(() => {
|
|
77
77
|
const e = /* @__PURE__ */ h((r) => {
|
|
78
78
|
clearInterval(t(this, tt)), clearInterval(t(this, et));
|
|
79
|
-
const
|
|
80
|
-
t(this, nt).call(this,
|
|
79
|
+
const a = parseInt(t(this, E).thumb.style.left || 0, 10);
|
|
80
|
+
t(this, nt).call(this, a + r), y(this, tt, setInterval(() => {
|
|
81
81
|
clearInterval(t(this, tt)), y(this, et, setInterval(() => {
|
|
82
82
|
const o = parseInt(t(this, E).thumb.style.left || 0, 10);
|
|
83
83
|
t(this, nt).call(this, o + r) || clearInterval(t(this, et));
|
|
@@ -95,19 +95,19 @@ const es = class es extends HTMLElement {
|
|
|
95
95
|
}), t(this, E).left.addEventListener("touchstart", () => e(-20)), t(this, E).right.addEventListener("touchstart", () => e(20)), t(this, E).track.addEventListener("mousedown", (r) => {
|
|
96
96
|
if (r.button !== 0) return;
|
|
97
97
|
r.preventDefault();
|
|
98
|
-
const
|
|
99
|
-
t(this, nt).call(this, r.clientX -
|
|
98
|
+
const a = t(this, E).track.getBoundingClientRect(), o = t(this, E).thumb.clientWidth;
|
|
99
|
+
t(this, nt).call(this, r.clientX - a.left - o / 2);
|
|
100
100
|
}), t(this, E).thumb.addEventListener("mousedown", (r) => {
|
|
101
101
|
if (r.button !== 0) return;
|
|
102
102
|
r.stopPropagation(), r.preventDefault(), y(this, G, !0), this.shiftX = r.clientX - t(this, E).thumb.getBoundingClientRect().left;
|
|
103
|
-
const
|
|
103
|
+
const a = /* @__PURE__ */ h((i) => {
|
|
104
104
|
if (!t(this, G)) return;
|
|
105
105
|
const c = t(this, E).track.getBoundingClientRect();
|
|
106
|
-
t(this, nt).call(this,
|
|
106
|
+
t(this, nt).call(this, i.clientX - c.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
108
|
-
y(this, G, !1), s(), document.removeEventListener("mousemove",
|
|
108
|
+
y(this, G, !1), s(), document.removeEventListener("mousemove", a), document.removeEventListener("mouseup", o), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
|
-
document.addEventListener("mousemove",
|
|
110
|
+
document.addEventListener("mousemove", a), document.addEventListener("mouseup", o);
|
|
111
111
|
});
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
@@ -213,17 +213,17 @@ const ss = class ss extends HTMLElement {
|
|
|
213
213
|
d(this, It, 0);
|
|
214
214
|
q(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
215
|
if (S.log("vscrollbar.refresh"), !t(this, rt) || !t(this, k)) return;
|
|
216
|
-
const e = t(this, k).container, s = t(this, k).track, r = t(this, k).thumb,
|
|
217
|
-
if (c <=
|
|
216
|
+
const e = t(this, k).container, s = t(this, k).track, r = t(this, k).thumb, a = e.clientHeight, o = t(this, rt).data.length, i = t(this, ot).getRowHeight(), c = o * i;
|
|
217
|
+
if (c <= a || o === 0) {
|
|
218
218
|
this.style.display = "none";
|
|
219
219
|
return;
|
|
220
220
|
} else
|
|
221
221
|
this.style.display = "flex";
|
|
222
222
|
const l = s.clientHeight;
|
|
223
223
|
if (l <= 0) return;
|
|
224
|
-
const g = Math.max(Math.min(l * (
|
|
224
|
+
const g = Math.max(Math.min(l * (a / c), l), 20);
|
|
225
225
|
r.style.height = `${g}px`;
|
|
226
|
-
const f = e.scrollTop, b = Math.max(c -
|
|
226
|
+
const f = e.scrollTop, b = Math.max(c - a, 1);
|
|
227
227
|
S.log(e, f, b);
|
|
228
228
|
let u = 0;
|
|
229
229
|
b > 0 && (u = f / b * (l - g));
|
|
@@ -233,15 +233,15 @@ const ss = class ss extends HTMLElement {
|
|
|
233
233
|
d(this, te, /* @__PURE__ */ h(() => {
|
|
234
234
|
S.log("nine-table-vscrollbar.#init");
|
|
235
235
|
const e = t(this, k).container, s = /* @__PURE__ */ h(() => {
|
|
236
|
-
const
|
|
237
|
-
return
|
|
236
|
+
const a = (t(this, rt).data.get() || []).length, o = t(this, ot).getRowHeight();
|
|
237
|
+
return a * o;
|
|
238
238
|
}, "getContentHeight");
|
|
239
239
|
t(this, k).thumb.addEventListener("mousedown", (r) => {
|
|
240
240
|
if (r.button !== 0) return;
|
|
241
241
|
r.stopPropagation(), r.preventDefault(), y(this, yt, !0), y(this, kt, r.clientY), y(this, It, e.scrollTop);
|
|
242
|
-
const
|
|
242
|
+
const a = /* @__PURE__ */ h((i) => {
|
|
243
243
|
if (!t(this, yt)) return;
|
|
244
|
-
const c = t(this, k).track.getBoundingClientRect(), l = t(this, k).thumb.clientHeight, f = c.height - l, b =
|
|
244
|
+
const c = t(this, k).track.getBoundingClientRect(), l = t(this, k).thumb.clientHeight, f = c.height - l, b = i.clientY - t(this, kt), u = e.clientHeight, p = s(), x = Math.max(p - u, 1);
|
|
245
245
|
if (f > 0 && x > 0) {
|
|
246
246
|
const w = b / f * x;
|
|
247
247
|
let m = t(this, It) + w;
|
|
@@ -250,14 +250,14 @@ const ss = class ss extends HTMLElement {
|
|
|
250
250
|
}
|
|
251
251
|
this.refresh();
|
|
252
252
|
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
253
|
-
y(this, yt, !1), document.removeEventListener("mousemove",
|
|
253
|
+
y(this, yt, !1), document.removeEventListener("mousemove", a), document.removeEventListener("mouseup", o), this.refresh();
|
|
254
254
|
}, "onMouseUp");
|
|
255
|
-
document.addEventListener("mousemove",
|
|
255
|
+
document.addEventListener("mousemove", a), document.addEventListener("mouseup", o);
|
|
256
256
|
}), t(this, k).track.addEventListener("mousedown", (r) => {
|
|
257
257
|
if (r.button !== 0 || r.target === t(this, k).thumb) return;
|
|
258
|
-
const
|
|
258
|
+
const a = t(this, k).track.getBoundingClientRect(), o = t(this, k).thumb.clientHeight, i = r.clientY - a.top - o / 2, l = a.height - o, g = e.clientHeight, f = s(), b = Math.max(f - g, 1);
|
|
259
259
|
if (l > 0 && b > 0) {
|
|
260
|
-
const u = Math.max(0, Math.min(1,
|
|
260
|
+
const u = Math.max(0, Math.min(1, i / l));
|
|
261
261
|
e.scrollTop = u * b;
|
|
262
262
|
}
|
|
263
263
|
this.refresh();
|
|
@@ -353,7 +353,7 @@ const ss = class ss extends HTMLElement {
|
|
|
353
353
|
rt = new WeakMap(), ot = new WeakMap(), yt = new WeakMap(), k = new WeakMap(), kt = new WeakMap(), It = new WeakMap(), te = new WeakMap(), h(ss, "NineTableVScrollBar");
|
|
354
354
|
let Te = ss;
|
|
355
355
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Te);
|
|
356
|
-
var U, R, it, Y, O, Z, at, Lt, Ye, Ve, ee, se, Mt, $t,
|
|
356
|
+
var U, R, it, Y, O, Z, at, Lt, Ye, Ve, ee, se, Mt, Ht, $t, ne, re, Nt, Ue, mt, _t, oe;
|
|
357
357
|
const ns = class ns {
|
|
358
358
|
constructor(n) {
|
|
359
359
|
d(this, U);
|
|
@@ -372,36 +372,36 @@ const ns = class ns {
|
|
|
372
372
|
var e;
|
|
373
373
|
S.log("rowManager.refresh");
|
|
374
374
|
const n = t(this, R).querySelector(".ng-container-body .ng-part-body");
|
|
375
|
-
n && (t(this, Mt).call(this), t(this,
|
|
375
|
+
n && (t(this, Mt).call(this), t(this, Ht).call(this), t(this, mt).call(this, n.scrollTop), (e = t(this, R).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
376
376
|
}, "refresh"));
|
|
377
377
|
q(this, "initialize", /* @__PURE__ */ h(() => {
|
|
378
378
|
S.log("rowManager.initialize"), y(this, it, {
|
|
379
379
|
scrollTables: t(this, R).querySelectorAll(".ng-part-body table"),
|
|
380
380
|
firstTr: t(this, R).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
381
381
|
}), y(this, O, null), t(this, Y).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((r) => {
|
|
382
|
-
const
|
|
383
|
-
if (!i) return;
|
|
384
|
-
const o = i.querySelector(".ng-part-body table");
|
|
385
|
-
if (!o) return;
|
|
386
|
-
const a = o.querySelector("tbody.bindable-tbody");
|
|
382
|
+
const a = t(this, R).querySelector(r);
|
|
387
383
|
if (!a) return;
|
|
388
|
-
const
|
|
384
|
+
const o = a.querySelector(".ng-part-body table");
|
|
385
|
+
if (!o) return;
|
|
386
|
+
const i = o.querySelector("tbody.bindable-tbody");
|
|
387
|
+
if (!i) return;
|
|
388
|
+
const l = Array.from(i.querySelectorAll("tr")).map((g) => g.cloneNode(!0));
|
|
389
389
|
t(this, Y).set(r, l);
|
|
390
390
|
});
|
|
391
391
|
const n = t(this, R).querySelector(".ng-container-body .ng-part-body"), e = t(this, R).querySelector(".ng-container-left .ng-part-body"), s = t(this, R).querySelector(".ng-container-right .ng-part-body");
|
|
392
392
|
if (t(this, R).querySelector(".ng-container-body .ng-part-header"), t(this, R).querySelector(".ng-container-body .ng-part-footer"), n) {
|
|
393
|
-
t(this, Mt).call(this), t(this, Nt).call(this), t(this,
|
|
393
|
+
t(this, Mt).call(this), t(this, Nt).call(this), t(this, Ht).call(this), t(this, mt).call(this, n.scrollTop);
|
|
394
394
|
let r = !1;
|
|
395
|
-
const
|
|
395
|
+
const a = /* @__PURE__ */ h((o) => {
|
|
396
396
|
var f;
|
|
397
397
|
if (r) return;
|
|
398
398
|
r = !0;
|
|
399
|
-
const
|
|
400
|
-
S.log(`π [Scroll] source: ${o.className.trim()} | scrollLeft: ${c} | bodyHeader.scrollLeft: ${l == null ? void 0 : l.scrollLeft} | leftContainer.scrollLeft: ${g == null ? void 0 : g.scrollLeft}`), n && n.scrollTop !==
|
|
399
|
+
const i = o.scrollTop, c = o.scrollLeft, l = t(this, R).querySelector(".ng-container-body .ng-part-header"), g = t(this, R).querySelector(".ng-container-left .ng-part-body");
|
|
400
|
+
S.log(`π [Scroll] source: ${o.className.trim()} | scrollLeft: ${c} | bodyHeader.scrollLeft: ${l == null ? void 0 : l.scrollLeft} | leftContainer.scrollLeft: ${g == null ? void 0 : g.scrollLeft}`), n && n.scrollTop !== i && (n.scrollTop = i), g && g.scrollTop !== i && (g.scrollTop = i), s && s.scrollTop !== i && (s.scrollTop = i), t(this, mt).call(this, i), (f = t(this, R).querySelector("nine-table-vscrollbar")) == null || f.refresh(), r = !1;
|
|
401
401
|
}, "handleContainerScroll");
|
|
402
402
|
[n, e, s].forEach((o) => {
|
|
403
|
-
o == null || o.addEventListener("scroll", (
|
|
404
|
-
S.log(
|
|
403
|
+
o == null || o.addEventListener("scroll", (i) => {
|
|
404
|
+
S.log(i), S.log("rowManager.scroll event"), a(o);
|
|
405
405
|
});
|
|
406
406
|
});
|
|
407
407
|
}
|
|
@@ -412,13 +412,13 @@ const ns = class ns {
|
|
|
412
412
|
if (!s || s.length === 0) return;
|
|
413
413
|
const r = n.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
414
414
|
if (!r) return;
|
|
415
|
-
r.querySelectorAll("tr:not(.nodata)").forEach((
|
|
416
|
-
const
|
|
417
|
-
for (let
|
|
415
|
+
r.querySelectorAll("tr:not(.nodata)").forEach((i) => i.remove());
|
|
416
|
+
const a = r.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
417
|
+
for (let i = 0; i < t(this, Lt); i++)
|
|
418
418
|
s.forEach((c) => {
|
|
419
419
|
o.appendChild(c.cloneNode(!0));
|
|
420
420
|
});
|
|
421
|
-
|
|
421
|
+
a ? a.before(o) : r.appendChild(o), e === ".ng-container-body" && (t(this, it).firstTr = r.querySelector("tr:not(.nodata)"));
|
|
422
422
|
}, "#renderRows"));
|
|
423
423
|
d(this, Mt, /* @__PURE__ */ h(() => {
|
|
424
424
|
if (t(this, O) !== null && t(this, O) > 0)
|
|
@@ -430,12 +430,12 @@ const ns = class ns {
|
|
|
430
430
|
const s = n.querySelector("tbody.bindable-tbody");
|
|
431
431
|
if (S.log(s), !s) throw new Error("invalid dom");
|
|
432
432
|
s.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
|
|
433
|
-
const r = s.querySelector("tr.nodata"),
|
|
433
|
+
const r = s.querySelector("tr.nodata"), a = document.createDocumentFragment();
|
|
434
434
|
e.forEach((b) => {
|
|
435
|
-
|
|
436
|
-
}), r ? r.before(
|
|
437
|
-
const o = t(this, R),
|
|
438
|
-
(
|
|
435
|
+
a.appendChild(b.cloneNode(!0));
|
|
436
|
+
}), r ? r.before(a) : s.appendChild(a);
|
|
437
|
+
const o = t(this, R), i = o.style.display, c = o.style.visibility, l = o.style.position;
|
|
438
|
+
(i === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
439
439
|
let g = 0;
|
|
440
440
|
const f = s.querySelectorAll("tr");
|
|
441
441
|
return f.forEach((b) => {
|
|
@@ -445,41 +445,41 @@ const ns = class ns {
|
|
|
445
445
|
u = parseFloat(p.height) || parseFloat(p.minHeight) || 0;
|
|
446
446
|
}
|
|
447
447
|
g += u;
|
|
448
|
-
}), f.forEach((b) => b.remove()), o.style.display =
|
|
448
|
+
}), f.forEach((b) => b.remove()), o.style.display = i, o.style.visibility = c, o.style.position = l, g <= 0 ? -1 : (y(this, O, g), t(this, $t).call(this), t(this, O));
|
|
449
449
|
}, "#measureAndCacheHeight"));
|
|
450
|
-
d(this,
|
|
450
|
+
d(this, Ht, /* @__PURE__ */ h(() => {
|
|
451
451
|
S.log("rowManager.#updateVirtualScrollHeight");
|
|
452
452
|
const e = (t(this, U).data.get() || []).length, s = t(this, O), r = e * s;
|
|
453
|
-
S.log("π [VirtualHeight]", { totalCount: e, rowHeight: s, totalVirtualHeight: r }), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
454
|
-
const o = t(this, R).querySelector(
|
|
453
|
+
S.log("π [VirtualHeight]", { totalCount: e, rowHeight: s, totalVirtualHeight: r }), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((a) => {
|
|
454
|
+
const o = t(this, R).querySelector(a);
|
|
455
455
|
if (!o) return;
|
|
456
|
-
const
|
|
457
|
-
|
|
456
|
+
const i = o.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
457
|
+
i && (i.style.height = `${r}px`);
|
|
458
458
|
});
|
|
459
459
|
}, "#updateVirtualScrollHeight"));
|
|
460
|
-
d(this,
|
|
460
|
+
d(this, $t, /* @__PURE__ */ h(() => {
|
|
461
461
|
if (t(this, at) > 0 && t(this, O) > 0) {
|
|
462
462
|
const n = Math.ceil(t(this, at) / t(this, O));
|
|
463
463
|
y(this, Lt, n + t(this, ee));
|
|
464
464
|
}
|
|
465
465
|
}, "#updateRowCount"));
|
|
466
466
|
d(this, ne, /* @__PURE__ */ h(() => {
|
|
467
|
-
var
|
|
467
|
+
var i, c, l, g, f, b;
|
|
468
468
|
const n = t(this, R).querySelector(".ng-container-left .ng-part-body table"), e = t(this, R).querySelector(".ng-container-body .ng-part-body table"), s = t(this, R).querySelector(".ng-container-right .ng-part-body table");
|
|
469
469
|
if (e) {
|
|
470
470
|
const u = n ? Array.from(n.querySelectorAll("tbody tr")) : [], p = Array.from(e.querySelectorAll("tbody tr")), x = s ? Array.from(s.querySelectorAll("tbody tr")) : [], w = Math.max(u.length, p.length, x.length);
|
|
471
471
|
for (let m = 0; m < w; m++) {
|
|
472
472
|
const T = [
|
|
473
|
-
((
|
|
473
|
+
((i = u[m]) == null ? void 0 : i.getBoundingClientRect().height) || 0,
|
|
474
474
|
((c = p[m]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
475
475
|
((l = x[m]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
476
476
|
], A = Math.max(...T);
|
|
477
477
|
A > 0 && (u[m] && (u[m].style.height = `${A}px`), p[m] && (p[m].style.height = `${A}px`), x[m] && (x[m].style.height = `${A}px`));
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
|
-
const r = t(this, R).querySelector(".ng-container-left .ng-part-footer table"),
|
|
481
|
-
if (
|
|
482
|
-
const u = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], p = Array.from(
|
|
480
|
+
const r = t(this, R).querySelector(".ng-container-left .ng-part-footer table"), a = t(this, R).querySelector(".ng-container-body .ng-part-footer table"), o = t(this, R).querySelector(".ng-container-right .ng-part-footer table");
|
|
481
|
+
if (a) {
|
|
482
|
+
const u = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], p = Array.from(a.querySelectorAll("tfoot tr")), x = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], w = Math.max(u.length, p.length, x.length);
|
|
483
483
|
for (let m = 0; m < w; m++) {
|
|
484
484
|
const T = [
|
|
485
485
|
((g = u[m]) == null ? void 0 : g.getBoundingClientRect().height) || 0,
|
|
@@ -497,11 +497,11 @@ const ns = class ns {
|
|
|
497
497
|
if (!s.classList.contains("active")) continue;
|
|
498
498
|
const r = e.contentRect.height;
|
|
499
499
|
if (r > 0) {
|
|
500
|
-
let
|
|
501
|
-
const o = s.querySelector(".ng-part-header"),
|
|
502
|
-
o && (
|
|
503
|
-
const c = Math.max(r -
|
|
504
|
-
t(this, at) !== c && (y(this, at, c), t(this,
|
|
500
|
+
let a = 0;
|
|
501
|
+
const o = s.querySelector(".ng-part-header"), i = s.querySelector(".ng-part-footer");
|
|
502
|
+
o && (a += o.offsetHeight), i && (a += i.offsetHeight);
|
|
503
|
+
const c = Math.max(r - a, 100);
|
|
504
|
+
t(this, at) !== c && (y(this, at, c), t(this, $t).call(this), t(this, O) !== null && (t(this, Nt).call(this), this.refresh()));
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
507
|
})), t(this, Z).observe(t(this, R)));
|
|
@@ -519,8 +519,8 @@ const ns = class ns {
|
|
|
519
519
|
if (!s) return;
|
|
520
520
|
const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
521
521
|
if (!r) return;
|
|
522
|
-
const
|
|
523
|
-
|
|
522
|
+
const a = Array.from(r.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this, Y).get(e)) == null ? void 0 : l.length) || 1, c = (t(this, U).data.get() || []).length;
|
|
523
|
+
a.forEach((g, f) => {
|
|
524
524
|
const b = n + Math.floor(f / o);
|
|
525
525
|
if (b >= c) {
|
|
526
526
|
g.style.visibility = "hidden";
|
|
@@ -537,21 +537,21 @@ const ns = class ns {
|
|
|
537
537
|
if (!e || e <= 0) return;
|
|
538
538
|
const s = t(this, U).data.length;
|
|
539
539
|
if (s === 0) return;
|
|
540
|
-
const r = ((f = t(this, Y).get(".ng-container-body")) == null ? void 0 : f.length) || 1,
|
|
541
|
-
S.log("bodyContainer.clientHeight",
|
|
542
|
-
const o = Math.max(0, s - Math.floor(
|
|
543
|
-
let c = Math.floor(
|
|
544
|
-
S.log(`π [Scroll Calc] maxStartIndex: ${o}, startIndex: ${
|
|
540
|
+
const r = ((f = t(this, Y).get(".ng-container-body")) == null ? void 0 : f.length) || 1, a = t(this, R).querySelector(".ng-container-body .ng-part-body");
|
|
541
|
+
S.log("bodyContainer.clientHeight", a.clientHeight);
|
|
542
|
+
const o = Math.max(0, s - Math.floor(a.clientHeight / e)), i = Math.min(o, Math.max(0, Math.floor(n / e)));
|
|
543
|
+
let c = Math.floor(i * e);
|
|
544
|
+
S.log(`π [Scroll Calc] maxStartIndex: ${o}, startIndex: ${i}, offsetY: ${c}`), i === o && S.log(`π [Scroll Inspect] scrollTop: ${n}, rowHeight: ${e}, maxStartIndex: ${o}, startIndex: ${i}, offsetY: ${c}`);
|
|
545
545
|
const l = t(this, it).firstTr, g = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
|
|
546
546
|
(b = t(this, it)) == null || b.scrollTables.forEach((u) => {
|
|
547
547
|
u.style.transform = `translate3d(0, ${c}px, 0)`;
|
|
548
|
-
}), g !==
|
|
548
|
+
}), g !== i && (S.log(`π [Row Bind Trigger] currentStartIndex(${g}) !== startIndex(${i})`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((u) => {
|
|
549
549
|
const p = t(this, R).querySelector(u);
|
|
550
550
|
if (!p) return;
|
|
551
551
|
const x = p.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
552
552
|
if (!x) return;
|
|
553
553
|
Array.from(x.querySelectorAll("tr:not(.nodata)")).forEach((m, T) => {
|
|
554
|
-
const A =
|
|
554
|
+
const A = i + Math.floor(T / r);
|
|
555
555
|
if (A >= s) {
|
|
556
556
|
m.style.display = "none";
|
|
557
557
|
return;
|
|
@@ -576,9 +576,9 @@ const ns = class ns {
|
|
|
576
576
|
});
|
|
577
577
|
}; */
|
|
578
578
|
d(this, _t, /* @__PURE__ */ h((n, e, s) => {
|
|
579
|
-
n.dataset.row = s, n.data = e, Array.from(n.cells).forEach((r,
|
|
579
|
+
n.dataset.row = s, n.data = e, Array.from(n.cells).forEach((r, a) => {
|
|
580
580
|
r.dataset.row = s;
|
|
581
|
-
const o = Array.from(r.children).find((
|
|
581
|
+
const o = Array.from(r.children).find((i) => i.tagName.toLowerCase().startsWith("cell-") || typeof i.refresh == "function");
|
|
582
582
|
o && typeof o.refresh == "function" && o.refresh();
|
|
583
583
|
});
|
|
584
584
|
}, "#bindRowData"));
|
|
@@ -587,14 +587,14 @@ const ns = class ns {
|
|
|
587
587
|
S.log("rowManager.#syncHeaderHeights");
|
|
588
588
|
const n = t(this, R).querySelector(".ng-container-left .ng-part-header table"), e = t(this, R).querySelector(".ng-container-body .ng-part-header table"), s = t(this, R).querySelector(".ng-container-right .ng-part-header table");
|
|
589
589
|
if (!e) return;
|
|
590
|
-
const r = n ? Array.from(n.querySelectorAll("tr")) : [],
|
|
591
|
-
for (let f = 0; f <
|
|
590
|
+
const r = n ? Array.from(n.querySelectorAll("tr")) : [], a = Array.from(e.querySelectorAll("tr")), o = s ? Array.from(s.querySelectorAll("tr")) : [], i = Math.max(r.length, a.length, o.length);
|
|
591
|
+
for (let f = 0; f < i; f++) {
|
|
592
592
|
const b = [
|
|
593
593
|
((c = r[f]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
594
|
-
((l =
|
|
594
|
+
((l = a[f]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
595
595
|
((g = o[f]) == null ? void 0 : g.getBoundingClientRect().height) || 0
|
|
596
596
|
], u = Math.max(...b);
|
|
597
|
-
u > 0 && (r[f] && (r[f].style.height = `${u}px`),
|
|
597
|
+
u > 0 && (r[f] && (r[f].style.height = `${u}px`), a[f] && (a[f].style.height = `${u}px`), o[f] && (o[f].style.height = `${u}px`));
|
|
598
598
|
}
|
|
599
599
|
}, "#syncHeaderHeights"));
|
|
600
600
|
q(this, "destroy", /* @__PURE__ */ h(() => {
|
|
@@ -610,7 +610,7 @@ const ns = class ns {
|
|
|
610
610
|
return ((e = t(this, Y).get(n)) == null ? void 0 : e.length) || 1;
|
|
611
611
|
}
|
|
612
612
|
};
|
|
613
|
-
U = new WeakMap(), R = new WeakMap(), it = new WeakMap(), Y = new WeakMap(), O = new WeakMap(), Z = new WeakMap(), at = new WeakMap(), Lt = new WeakMap(), Ye = new WeakMap(), Ve = new WeakMap(), ee = new WeakMap(), se = new WeakMap(), Mt = new WeakMap(),
|
|
613
|
+
U = new WeakMap(), R = new WeakMap(), it = new WeakMap(), Y = new WeakMap(), O = new WeakMap(), Z = new WeakMap(), at = new WeakMap(), Lt = new WeakMap(), Ye = new WeakMap(), Ve = new WeakMap(), ee = new WeakMap(), se = new WeakMap(), Mt = new WeakMap(), Ht = new WeakMap(), $t = new WeakMap(), ne = new WeakMap(), re = new WeakMap(), Nt = new WeakMap(), Ue = new WeakMap(), mt = new WeakMap(), _t = new WeakMap(), oe = new WeakMap(), h(ns, "RowManager");
|
|
614
614
|
let ke = ns;
|
|
615
615
|
const ie = class ie {
|
|
616
616
|
/**
|
|
@@ -624,33 +624,33 @@ const ie = class ie {
|
|
|
624
624
|
*/
|
|
625
625
|
static compile(n) {
|
|
626
626
|
if (!n) return null;
|
|
627
|
-
const e = /* @__PURE__ */ h((
|
|
628
|
-
|
|
627
|
+
const e = /* @__PURE__ */ h((i) => {
|
|
628
|
+
i.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
|
|
629
629
|
const g = l.getAttribute("cell-type") || "renderer";
|
|
630
630
|
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
631
631
|
let f = `cell-${g}`;
|
|
632
632
|
const b = l.getAttribute("data-bind"), u = l.getAttribute("data-expr"), p = l.getAttribute("maxbyte"), x = l.getAttribute("type");
|
|
633
633
|
let w = [];
|
|
634
634
|
b && w.push(`data-bind="${b}"`), u && w.push(`data-expr="${u}"`), p && w.push(`maxbyte="${p}"`), x && w.push(`type="${x}"`), l.innerHTML = `<${f} ${w.join(" ")}></${f}>`;
|
|
635
|
-
}),
|
|
635
|
+
}), i.querySelectorAll("tbody td, tfoot td").forEach((l) => {
|
|
636
636
|
l.setAttribute("tabindex", "0");
|
|
637
637
|
});
|
|
638
|
-
}, "processCellTypes"), s = /* @__PURE__ */ h((
|
|
639
|
-
if (!
|
|
640
|
-
const c =
|
|
638
|
+
}, "processCellTypes"), s = /* @__PURE__ */ h((i) => {
|
|
639
|
+
if (!i.querySelector("colgroup")) {
|
|
640
|
+
const c = i.querySelector("tbody tr") || i.querySelector("tr"), l = c ? c.querySelectorAll("th, td").length : 1, g = document.createElement("colgroup"), f = Math.max(Math.floor(i.clientWidth / l), 100);
|
|
641
641
|
for (let b = 0; b < l; b++) {
|
|
642
642
|
const u = document.createElement("col");
|
|
643
643
|
u.setAttribute("width", f), g.appendChild(u);
|
|
644
644
|
}
|
|
645
|
-
|
|
645
|
+
i.prepend(g);
|
|
646
646
|
}
|
|
647
|
-
if (!
|
|
648
|
-
const c = document.createElement("thead"), l =
|
|
649
|
-
l ? l.after(c) :
|
|
647
|
+
if (!i.querySelector("thead")) {
|
|
648
|
+
const c = document.createElement("thead"), l = i.querySelector("colgroup");
|
|
649
|
+
l ? l.after(c) : i.prepend(c);
|
|
650
650
|
}
|
|
651
|
-
|
|
652
|
-
}, "ensureTableStructure"), r = /* @__PURE__ */ h((
|
|
653
|
-
const l = Array.from(
|
|
651
|
+
i.classList.add("nine-table-element");
|
|
652
|
+
}, "ensureTableStructure"), r = /* @__PURE__ */ h((i, c) => {
|
|
653
|
+
const l = Array.from(i.querySelectorAll(c + " tr")), g = Array.from(i.querySelectorAll(c + " th," + c + " td")), f = l.length;
|
|
654
654
|
if (f === 0 || g.length === 0) return;
|
|
655
655
|
let b = 0;
|
|
656
656
|
g.forEach((p) => {
|
|
@@ -681,13 +681,13 @@ const ie = class ie {
|
|
|
681
681
|
}
|
|
682
682
|
});
|
|
683
683
|
});
|
|
684
|
-
}, "resetColIndex"),
|
|
685
|
-
return s(
|
|
686
|
-
const l =
|
|
687
|
-
l &&
|
|
684
|
+
}, "resetColIndex"), a = n.cloneNode(!0);
|
|
685
|
+
return s(a), e(a), r(a, "thead"), r(a, "tbody"), r(a, "tfoot"), Array.from(a.querySelectorAll("colgroup col")).forEach((i, c) => {
|
|
686
|
+
const l = i.getAttribute("fixed");
|
|
687
|
+
l && a.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((g) => {
|
|
688
688
|
g.setAttribute("fixed", l);
|
|
689
689
|
});
|
|
690
|
-
}),
|
|
690
|
+
}), a;
|
|
691
691
|
}
|
|
692
692
|
// π― [μΆκ°] td/thμ μ μΈλ cell-type μμ±μ μ½μ΄ 컀μ€ν
νκ·Έλ‘ μλ κ°μΈκΈ°
|
|
693
693
|
};
|
|
@@ -702,11 +702,11 @@ const rs = class rs {
|
|
|
702
702
|
q(this, "render", /* @__PURE__ */ h(() => {
|
|
703
703
|
const { startRow: n, startCol: e, endRow: s, endCol: r } = t(this, X);
|
|
704
704
|
S.log("π¨ [CellSelection.render] Rendering range ->", t(this, X));
|
|
705
|
-
const
|
|
705
|
+
const a = t(this, N).querySelectorAll(
|
|
706
706
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
707
707
|
);
|
|
708
|
-
if (
|
|
709
|
-
|
|
708
|
+
if (a.forEach((i) => {
|
|
709
|
+
i.querySelectorAll(".selected, .selected-top, .selected-bottom, .selected-left, .selected-right").forEach((c) => {
|
|
710
710
|
c.classList.remove("selected", "selected-top", "selected-bottom", "selected-left", "selected-right");
|
|
711
711
|
});
|
|
712
712
|
}), n < 0 || e < 0) {
|
|
@@ -714,8 +714,8 @@ const rs = class rs {
|
|
|
714
714
|
return;
|
|
715
715
|
}
|
|
716
716
|
let o = 0;
|
|
717
|
-
|
|
718
|
-
|
|
717
|
+
a.forEach((i) => {
|
|
718
|
+
i.querySelectorAll("tbody tr").forEach((c) => {
|
|
719
719
|
const { matrixRow: l } = V(this, K, qt).call(this, c);
|
|
720
720
|
l < 0 || c.querySelectorAll("td, th").forEach((g) => {
|
|
721
721
|
const f = parseInt(g.dataset.col, 10);
|
|
@@ -736,7 +736,7 @@ const rs = class rs {
|
|
|
736
736
|
}
|
|
737
737
|
setRange(n, e, s, r) {
|
|
738
738
|
S.log(`π [CellSelection.setRange] Input -> startRow: ${n}, startCol: ${e}, endRow: ${s}, endCol: ${r}`);
|
|
739
|
-
let
|
|
739
|
+
let a = Math.min(n, s), o = Math.max(n, s), i = Math.min(e, r), c = Math.max(e, r);
|
|
740
740
|
const l = t(this, N).querySelectorAll(
|
|
741
741
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
742
742
|
);
|
|
@@ -750,21 +750,21 @@ const rs = class rs {
|
|
|
750
750
|
const w = parseInt(x.dataset.col, 10);
|
|
751
751
|
if (isNaN(w)) return;
|
|
752
752
|
const m = parseInt(x.rowSpan || 1, 10), T = parseInt(x.colSpan || 1, 10), A = p + m - 1, M = w + T - 1;
|
|
753
|
-
if (A >=
|
|
754
|
-
const
|
|
755
|
-
(
|
|
753
|
+
if (A >= a && p <= o && M >= i && w <= c) {
|
|
754
|
+
const W = Math.min(a, p), Gt = Math.max(o, A), bs = Math.min(i, w), ps = Math.max(c, M);
|
|
755
|
+
(W !== a || Gt !== o || bs !== i || ps !== c) && (a = W, o = Gt, i = bs, c = ps, g = !0);
|
|
756
756
|
}
|
|
757
757
|
});
|
|
758
758
|
});
|
|
759
759
|
});
|
|
760
|
-
y(this, X, { startRow:
|
|
760
|
+
y(this, X, { startRow: a, startCol: i, endRow: o, endCol: c }), S.log("π¦ [CellSelection.setRange] Final Range ->", t(this, X)), this.render();
|
|
761
761
|
}
|
|
762
762
|
};
|
|
763
763
|
N = new WeakMap(), X = new WeakMap(), K = new WeakSet(), qt = /* @__PURE__ */ h(function(n) {
|
|
764
764
|
if (!n || n.classList.contains("nodata")) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
|
|
765
765
|
const e = parseInt(n.dataset.row, 10);
|
|
766
766
|
if (isNaN(e)) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
|
|
767
|
-
const s = n.closest("tbody"),
|
|
767
|
+
const s = n.closest("tbody"), a = Array.from(s.querySelectorAll("tr:not(.nodata)")).filter((l) => parseInt(l.dataset.row, 10) === e), o = a.indexOf(n), i = a.length > 0 ? a.length : 1, c = e * i + (o >= 0 ? o : n.sectionRowIndex % i);
|
|
768
768
|
return { dataRow: e, subRowIndex: o, matrixRow: c };
|
|
769
769
|
}, "#getMatrixRow"), ws = /* @__PURE__ */ h(function() {
|
|
770
770
|
const n = t(this, N).querySelector(".ng-container-top");
|
|
@@ -777,13 +777,13 @@ N = new WeakMap(), X = new WeakMap(), K = new WeakSet(), qt = /* @__PURE__ */ h(
|
|
|
777
777
|
const s = e.target.closest("td, th");
|
|
778
778
|
if (!s || s.dataset.row === void 0 || s.dataset.col === void 0 || s.closest("tr").classList.contains("nodata")) return;
|
|
779
779
|
t(this, N).style.userSelect = "none", t(this, N).style.webkitUserSelect = "none";
|
|
780
|
-
const r = s.closest("tr"), { matrixRow:
|
|
781
|
-
if (
|
|
780
|
+
const r = s.closest("tr"), { matrixRow: a } = V(this, K, qt).call(this, r), o = parseInt(s.dataset.col, 10);
|
|
781
|
+
if (a < 0) {
|
|
782
782
|
t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "";
|
|
783
783
|
return;
|
|
784
784
|
}
|
|
785
|
-
S.log(`π±οΈ [MouseDown Success] startRow: ${
|
|
786
|
-
let
|
|
785
|
+
S.log(`π±οΈ [MouseDown Success] startRow: ${a}, startCol: ${o}`), t(this, N).navigation.currentCell = s;
|
|
786
|
+
let i = a, c = o;
|
|
787
787
|
const l = /* @__PURE__ */ h((f) => {
|
|
788
788
|
const b = document.elementFromPoint(f.clientX, f.clientY);
|
|
789
789
|
let u = b == null ? void 0 : b.closest("td, th");
|
|
@@ -799,7 +799,7 @@ N = new WeakMap(), X = new WeakMap(), K = new WeakSet(), qt = /* @__PURE__ */ h(
|
|
|
799
799
|
}
|
|
800
800
|
if (!u || u.dataset.row === void 0 || u.dataset.col === void 0 || u.closest("tr").classList.contains("nodata")) return;
|
|
801
801
|
const p = u.closest("tr"), { matrixRow: x } = V(this, K, qt).call(this, p), w = parseInt(u.dataset.col, 10);
|
|
802
|
-
x < 0 ||
|
|
802
|
+
x < 0 || i === x && c === w || (i = x, c = w, this.setRange(a, o, x, w));
|
|
803
803
|
}, "onMouseMove"), g = /* @__PURE__ */ h(() => {
|
|
804
804
|
S.log("π±οΈ [MouseUp] Drag ended."), t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "", document.removeEventListener("mousemove", l), document.removeEventListener("mouseup", g);
|
|
805
805
|
}, "onMouseUp");
|
|
@@ -807,7 +807,7 @@ N = new WeakMap(), X = new WeakMap(), K = new WeakSet(), qt = /* @__PURE__ */ h(
|
|
|
807
807
|
});
|
|
808
808
|
}, "#initEvents"), h(rs, "CellSelection");
|
|
809
809
|
let Le = rs;
|
|
810
|
-
var F, lt, ae, le, pt,
|
|
810
|
+
var F, lt, ae, le, pt, He, Ot, Dt, Bt, ct, zt, vs;
|
|
811
811
|
const os = class os {
|
|
812
812
|
constructor(n) {
|
|
813
813
|
d(this, pt);
|
|
@@ -823,12 +823,12 @@ const os = class os {
|
|
|
823
823
|
const s = t(this, ct).call(this, n);
|
|
824
824
|
if (s.length === 0) return e + 1;
|
|
825
825
|
let r = e + 1;
|
|
826
|
-
const
|
|
827
|
-
s.forEach((o) =>
|
|
828
|
-
for (const o of
|
|
829
|
-
const
|
|
830
|
-
if (e >=
|
|
831
|
-
r =
|
|
826
|
+
const a = [];
|
|
827
|
+
s.forEach((o) => a.push(...Array.from(o.querySelectorAll("td")))), a.sort((o, i) => parseInt(o.dataset.col, 10) - parseInt(i.dataset.col, 10));
|
|
828
|
+
for (const o of a) {
|
|
829
|
+
const i = parseInt(o.dataset.col, 10), c = parseInt(o.colSpan || 1, 10);
|
|
830
|
+
if (e >= i && e < i + c) {
|
|
831
|
+
r = i + c;
|
|
832
832
|
break;
|
|
833
833
|
}
|
|
834
834
|
}
|
|
@@ -838,12 +838,12 @@ const os = class os {
|
|
|
838
838
|
const s = t(this, ct).call(this, n);
|
|
839
839
|
if (s.length === 0) return Math.max(0, e - 1);
|
|
840
840
|
let r = -1;
|
|
841
|
-
const
|
|
842
|
-
s.forEach((o) =>
|
|
843
|
-
for (const o of
|
|
844
|
-
const
|
|
845
|
-
if (
|
|
846
|
-
r =
|
|
841
|
+
const a = [];
|
|
842
|
+
s.forEach((o) => a.push(...Array.from(o.querySelectorAll("td")))), a.sort((o, i) => parseInt(o.dataset.col, 10) - parseInt(i.dataset.col, 10));
|
|
843
|
+
for (const o of a) {
|
|
844
|
+
const i = parseInt(o.dataset.col, 10);
|
|
845
|
+
if (i < e)
|
|
846
|
+
r = i;
|
|
847
847
|
else
|
|
848
848
|
break;
|
|
849
849
|
}
|
|
@@ -855,9 +855,9 @@ const os = class os {
|
|
|
855
855
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
856
856
|
), s = [];
|
|
857
857
|
return e.forEach((r) => {
|
|
858
|
-
const
|
|
859
|
-
for (const o of
|
|
860
|
-
const
|
|
858
|
+
const a = Array.from(r.querySelectorAll("tbody tr:not(.nodata)"));
|
|
859
|
+
for (const o of a) {
|
|
860
|
+
const i = parseInt(o.dataset.row, 10), c = a.filter((p) => parseInt(p.dataset.row, 10) === i), l = c.length > 0 ? c.length : 1, g = c.indexOf(o), f = i * l + (g >= 0 ? g : 0);
|
|
861
861
|
if (f === n) {
|
|
862
862
|
s.push(o);
|
|
863
863
|
break;
|
|
@@ -876,12 +876,12 @@ const os = class os {
|
|
|
876
876
|
}), s;
|
|
877
877
|
}, "#findTargetTrsByMatrix"));
|
|
878
878
|
// π― rowSpan λ° colSpan κ²½κ³λ₯Ό λͺ¨λ μΆ©μ‘±νλ μ
μ 3λΆν μ 체 μμμμ νμ
|
|
879
|
-
d(this,
|
|
880
|
-
const
|
|
879
|
+
d(this, zt, /* @__PURE__ */ h((n, e, s, r) => {
|
|
880
|
+
const a = t(this, F).querySelectorAll(
|
|
881
881
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
882
882
|
), o = r !== void 0 ? r : n * 1 + e;
|
|
883
|
-
for (const
|
|
884
|
-
const c = Array.from(
|
|
883
|
+
for (const i of a) {
|
|
884
|
+
const c = Array.from(i.querySelectorAll("tbody tr:not(.nodata)"));
|
|
885
885
|
for (const l of c) {
|
|
886
886
|
const g = parseInt(l.dataset.row, 10), f = c.filter((w) => parseInt(w.dataset.row, 10) === g), b = f.length > 0 ? f.length : 1, u = f.indexOf(l), p = g * b + (u >= 0 ? u : 0), x = Array.from(l.querySelectorAll("td"));
|
|
887
887
|
for (const w of x) {
|
|
@@ -904,9 +904,9 @@ const os = class os {
|
|
|
904
904
|
const e = parseInt(n.dataset.row, 10), s = parseInt(n.dataset.col, 10);
|
|
905
905
|
if (!isNaN(e) && !isNaN(s)) {
|
|
906
906
|
y(this, ae, e), y(this, le, s);
|
|
907
|
-
const r = n.closest("tr"),
|
|
908
|
-
if (
|
|
909
|
-
const
|
|
907
|
+
const r = n.closest("tr"), a = r == null ? void 0 : r.closest("tbody");
|
|
908
|
+
if (a) {
|
|
909
|
+
const i = Array.from(a.querySelectorAll("tr:not(.nodata)")).filter((f) => parseInt(f.dataset.row, 10) === e), c = i.length > 0 ? i.length : 1, l = i.indexOf(r), g = e * c + (l >= 0 ? l : 0);
|
|
910
910
|
t(this, F).selection.setRange(g, s, g, s);
|
|
911
911
|
}
|
|
912
912
|
}
|
|
@@ -914,29 +914,29 @@ const os = class os {
|
|
|
914
914
|
moveCell(n) {
|
|
915
915
|
var m, T, A, M;
|
|
916
916
|
if (!t(this, lt)) return;
|
|
917
|
-
const e = t(this, lt), s = e.closest("tr"), r = parseInt(e.dataset.row, 10),
|
|
917
|
+
const e = t(this, lt), s = e.closest("tr"), r = parseInt(e.dataset.row, 10), a = parseInt(e.dataset.col, 10), o = s == null ? void 0 : s.closest("tbody");
|
|
918
918
|
if (!o) return;
|
|
919
919
|
const c = Array.from(o.querySelectorAll("tr:not(.nodata)")).filter((B) => parseInt(B.dataset.row, 10) === r), l = c.length > 0 ? c.length : 1, g = c.indexOf(s), f = r * l + (g >= 0 ? g : 0);
|
|
920
|
-
let b = f, u =
|
|
920
|
+
let b = f, u = a;
|
|
921
921
|
switch (n.code) {
|
|
922
922
|
case "Tab":
|
|
923
923
|
if (n.preventDefault(), n.shiftKey) {
|
|
924
|
-
if (u = t(this, Bt).call(this, f,
|
|
924
|
+
if (u = t(this, Bt).call(this, f, a), u < 0 && f > 0) {
|
|
925
925
|
b = f - 1;
|
|
926
|
-
const B = t(this, ct).call(this, b),
|
|
927
|
-
u =
|
|
926
|
+
const B = t(this, ct).call(this, b), W = t(this, Ot).call(this, B);
|
|
927
|
+
u = W ? parseInt(W.dataset.col, 10) : 0;
|
|
928
928
|
}
|
|
929
929
|
} else {
|
|
930
|
-
u = t(this, Dt).call(this, f,
|
|
931
|
-
const B = t(this, ct).call(this, f),
|
|
930
|
+
u = t(this, Dt).call(this, f, a);
|
|
931
|
+
const B = t(this, ct).call(this, f), W = t(this, Ot).call(this, B), Gt = W ? parseInt(W.dataset.col, 10) + parseInt(W.colSpan || 1, 10) : 0;
|
|
932
932
|
u >= Gt && (b = f + 1, u = 0);
|
|
933
933
|
}
|
|
934
934
|
break;
|
|
935
935
|
case "ArrowRight":
|
|
936
|
-
u = t(this, Dt).call(this, f,
|
|
936
|
+
u = t(this, Dt).call(this, f, a);
|
|
937
937
|
break;
|
|
938
938
|
case "ArrowLeft":
|
|
939
|
-
u = t(this, Bt).call(this, f,
|
|
939
|
+
u = t(this, Bt).call(this, f, a);
|
|
940
940
|
break;
|
|
941
941
|
case "ArrowDown":
|
|
942
942
|
n.preventDefault(), b = f + (e.rowSpan || 1);
|
|
@@ -946,38 +946,38 @@ const os = class os {
|
|
|
946
946
|
break;
|
|
947
947
|
}
|
|
948
948
|
const p = Math.floor(b / l), x = b % l;
|
|
949
|
-
let w = t(this,
|
|
949
|
+
let w = t(this, zt).call(this, p, x, u, b);
|
|
950
950
|
if (w)
|
|
951
|
-
this.currentCell = w, V(this, pt,
|
|
951
|
+
this.currentCell = w, V(this, pt, He).call(this, w);
|
|
952
952
|
else if (p !== r && p >= 0) {
|
|
953
953
|
const B = ((T = (m = t(this, F)).getRowHeight) == null ? void 0 : T.call(m)) || 40;
|
|
954
954
|
(M = (A = t(this, F)).scrollToY) == null || M.call(A, p * B), setTimeout(() => {
|
|
955
|
-
const
|
|
956
|
-
|
|
955
|
+
const W = t(this, zt).call(this, p, x, u, b);
|
|
956
|
+
W && (this.currentCell = W, V(this, pt, He).call(this, W));
|
|
957
957
|
}, 0);
|
|
958
958
|
}
|
|
959
959
|
}
|
|
960
960
|
};
|
|
961
961
|
F = new WeakMap(), lt = new WeakMap(), ae = new WeakMap(), le = new WeakMap(), pt = new WeakSet(), // π― μ
μ΄ λ³΄μ΄μ§ μλ μμμ μμ λ 컨ν
μ΄λ μ€ν¬λ‘€μ λκΈ°ννλ ν¨μ
|
|
962
|
-
|
|
962
|
+
He = /* @__PURE__ */ h(function(n) {
|
|
963
963
|
const e = t(this, F).querySelector(".ng-container-body .ng-part-body");
|
|
964
964
|
if (!e) return;
|
|
965
965
|
const s = n.getBoundingClientRect(), r = e.getBoundingClientRect();
|
|
966
966
|
s.top < r.top ? e.scrollTop -= r.top - s.top : s.bottom > r.bottom && (e.scrollTop += s.bottom - r.bottom), s.left < r.left ? e.scrollLeft -= r.left - s.left : s.right > r.right && (e.scrollLeft += s.right - r.right);
|
|
967
|
-
}, "#ensureCellVisible"), Ot = new WeakMap(), Dt = new WeakMap(), Bt = new WeakMap(), ct = new WeakMap(),
|
|
967
|
+
}, "#ensureCellVisible"), Ot = new WeakMap(), Dt = new WeakMap(), Bt = new WeakMap(), ct = new WeakMap(), zt = new WeakMap(), vs = /* @__PURE__ */ h(function() {
|
|
968
968
|
t(this, F).addEventListener("keydown", (n) => {
|
|
969
969
|
["Tab", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(n.code) && this.moveCell(n);
|
|
970
970
|
});
|
|
971
971
|
}, "#initEvents"), h(os, "CellNavigation");
|
|
972
972
|
let Me = os;
|
|
973
|
-
var ce, ht, dt,
|
|
973
|
+
var ce, ht, dt, Wt, Pt, he, de, xt, fe, ge;
|
|
974
974
|
const Ct = class Ct extends HTMLElement {
|
|
975
975
|
constructor() {
|
|
976
976
|
super();
|
|
977
977
|
d(this, ce);
|
|
978
978
|
d(this, ht, null);
|
|
979
979
|
d(this, dt);
|
|
980
|
-
d(this,
|
|
980
|
+
d(this, Wt);
|
|
981
981
|
d(this, Pt);
|
|
982
982
|
q(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
983
983
|
S.log("sheet.invalidate()"), t(this, dt).refresh();
|
|
@@ -985,8 +985,8 @@ const Ct = class Ct extends HTMLElement {
|
|
|
985
985
|
q(this, "generate", /* @__PURE__ */ h((e) => {
|
|
986
986
|
if (S.log("sheet.generate()"), !e) return;
|
|
987
987
|
y(this, ht, Ie.compile(e)), t(this, he).call(this), t(this, de).call(this);
|
|
988
|
-
const s = this.querySelector(".ng-container-body .ng-part-header"), r = this.querySelector(".ng-container-body .ng-part-footer"),
|
|
989
|
-
s &&
|
|
988
|
+
const s = this.querySelector(".ng-container-body .ng-part-header"), r = this.querySelector(".ng-container-body .ng-part-footer"), a = this.querySelector(".ng-nodata-overlay");
|
|
989
|
+
s && a && (a.style.top = `${s.offsetHeight}px`), r && a && (a.style.bottom = `${r.offsetHeight}px`), t(this, dt).initialize(), setTimeout(() => {
|
|
990
990
|
var o;
|
|
991
991
|
(o = this.querySelector("nine-table-hscrollbar")) == null || o.refresh();
|
|
992
992
|
}, 0);
|
|
@@ -997,40 +997,36 @@ const Ct = class Ct extends HTMLElement {
|
|
|
997
997
|
{ selector: ".ng-container-left", type: "left" },
|
|
998
998
|
{ selector: ".ng-container-right", type: "right" }
|
|
999
999
|
].forEach(({ selector: s, type: r }) => {
|
|
1000
|
-
var
|
|
1001
|
-
(
|
|
1000
|
+
var a, o, i;
|
|
1001
|
+
(a = this.querySelector(`${s} .ng-part-header`)) == null || a.appendChild(t(this, xt).call(this, t(this, ht), r, "header")), (o = this.querySelector(`${s} .ng-virtual-spacer`)) == null || o.before(t(this, xt).call(this, t(this, ht), r, "body")), (i = this.querySelector(`${s} .ng-part-footer`)) == null || i.appendChild(t(this, xt).call(this, t(this, ht), r, "footer"));
|
|
1002
1002
|
});
|
|
1003
1003
|
}, "#renderSplitContainers"));
|
|
1004
1004
|
d(this, de, /* @__PURE__ */ h(() => {
|
|
1005
1005
|
["left", "right", "body"].forEach((e) => {
|
|
1006
1006
|
const s = this.querySelector(`.ng-container-${e}`), r = s == null ? void 0 : s.querySelectorAll("table");
|
|
1007
1007
|
if (!s || !r || r.length === 0) return;
|
|
1008
|
-
let
|
|
1008
|
+
let a = 0;
|
|
1009
1009
|
r[0].querySelectorAll("col").forEach((o) => {
|
|
1010
|
-
const
|
|
1011
|
-
isNaN(
|
|
1012
|
-
}), e === "body" ?
|
|
1013
|
-
o.style.width = `${i}px`, o.style.minWidth = `${i}px`;
|
|
1014
|
-
})) : (s.style.flex = `0 0 ${i}px`, s.style.width = `${i}px`, r.forEach((o) => {
|
|
1015
|
-
o.style.width = `${i}px`, o.style.minWidth = `${i}px`;
|
|
1016
|
-
}));
|
|
1010
|
+
const i = parseInt(o.getAttribute("width"), 10);
|
|
1011
|
+
isNaN(i) || (a += i);
|
|
1012
|
+
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${a}px`, s.style.width = `${a}px`);
|
|
1017
1013
|
});
|
|
1018
1014
|
}, "#updateContainerWidths"));
|
|
1019
1015
|
d(this, xt, /* @__PURE__ */ h((e, s, r) => {
|
|
1020
|
-
const
|
|
1016
|
+
const a = e.cloneNode(!0), o = a.querySelector("thead"), i = a.querySelector("tbody"), c = a.querySelector("tfoot");
|
|
1021
1017
|
if (r === "header") {
|
|
1022
|
-
if (
|
|
1018
|
+
if (i && i.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
1023
1019
|
const g = document.createElement("tbody");
|
|
1024
|
-
g.className = "fixed-tbody",
|
|
1020
|
+
g.className = "fixed-tbody", a.appendChild(g);
|
|
1025
1021
|
}
|
|
1026
|
-
} else r === "body" ? (o && o.remove(), c && c.remove(),
|
|
1027
|
-
return s === "left" ?
|
|
1022
|
+
} else r === "body" ? (o && o.remove(), c && c.remove(), i && (i.className = "bindable-tbody")) : r === "footer" && (o && o.remove(), i && i.remove());
|
|
1023
|
+
return s === "left" ? a.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
1028
1024
|
l.getAttribute("fixed") !== "left" && l.remove();
|
|
1029
|
-
}) : s === "right" ?
|
|
1025
|
+
}) : s === "right" ? a.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
1030
1026
|
l.getAttribute("fixed") !== "right" && l.remove();
|
|
1031
|
-
}) :
|
|
1027
|
+
}) : a.querySelectorAll("[fixed=left], [fixed=right]").forEach((l) => {
|
|
1032
1028
|
l.remove();
|
|
1033
|
-
}),
|
|
1029
|
+
}), a;
|
|
1034
1030
|
}, "#createSplitTable"));
|
|
1035
1031
|
q(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, dt).getRowHeight(), "getRowHeight"));
|
|
1036
1032
|
q(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
@@ -1042,7 +1038,7 @@ const Ct = class Ct extends HTMLElement {
|
|
|
1042
1038
|
s && (s.scrollTop = e);
|
|
1043
1039
|
}, "scrollToY"));
|
|
1044
1040
|
d(this, fe, /* @__PURE__ */ h(() => {
|
|
1045
|
-
t(this, ge).call(this), y(this,
|
|
1041
|
+
t(this, ge).call(this), y(this, Wt, new Le(this)), y(this, Pt, new Me(this));
|
|
1046
1042
|
}, "#init"));
|
|
1047
1043
|
d(this, ge, /* @__PURE__ */ h(() => {
|
|
1048
1044
|
const e = Ct.SCROLLBAR_SIZE;
|
|
@@ -1252,7 +1248,7 @@ const Ct = class Ct extends HTMLElement {
|
|
|
1252
1248
|
t(this, fe).call(this);
|
|
1253
1249
|
}
|
|
1254
1250
|
get selection() {
|
|
1255
|
-
return t(this,
|
|
1251
|
+
return t(this, Wt);
|
|
1256
1252
|
}
|
|
1257
1253
|
get navigation() {
|
|
1258
1254
|
return t(this, Pt);
|
|
@@ -1261,7 +1257,7 @@ const Ct = class Ct extends HTMLElement {
|
|
|
1261
1257
|
this.innerHTML = "", S.log("NineTableSheet destroyed.");
|
|
1262
1258
|
}
|
|
1263
1259
|
};
|
|
1264
|
-
ce = new WeakMap(), ht = new WeakMap(), dt = new WeakMap(),
|
|
1260
|
+
ce = new WeakMap(), ht = new WeakMap(), dt = new WeakMap(), Wt = new WeakMap(), Pt = new WeakMap(), he = new WeakMap(), de = new WeakMap(), xt = new WeakMap(), fe = new WeakMap(), ge = new WeakMap(), h(Ct, "NineTableSheet"), q(Ct, "SCROLLBAR_SIZE", 16);
|
|
1265
1261
|
let Zt = Ct;
|
|
1266
1262
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", Zt);
|
|
1267
1263
|
var ue, Ft;
|
|
@@ -1272,8 +1268,8 @@ const is = class is extends HTMLElement {
|
|
|
1272
1268
|
var e;
|
|
1273
1269
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
1274
1270
|
var o;
|
|
1275
|
-
const r = s.ctrlKey || s.metaKey || s.shiftKey,
|
|
1276
|
-
t(this, Ft).call(this,
|
|
1271
|
+
const r = s.ctrlKey || s.metaKey || s.shiftKey, a = parseInt((o = s.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
|
|
1272
|
+
t(this, Ft).call(this, a, r);
|
|
1277
1273
|
}), t(this, Ft).call(this, 0, !1);
|
|
1278
1274
|
}, "#init"));
|
|
1279
1275
|
d(this, Ft, /* @__PURE__ */ h((e, s = !1) => {
|
|
@@ -1285,17 +1281,17 @@ const is = class is extends HTMLElement {
|
|
|
1285
1281
|
const p = parseInt(u.getAttribute("data-index"), 10), x = this.querySelector(`nine-splitter[data-split-index="${p}"]`), w = g[p + 1];
|
|
1286
1282
|
x && w && w.classList.contains("active") && x.style.setProperty("display", "flex");
|
|
1287
1283
|
});
|
|
1288
|
-
}, "updateSplitters"),
|
|
1289
|
-
if (!
|
|
1284
|
+
}, "updateSplitters"), a = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), i = a.querySelectorAll(".nine-tab-item"), c = o.querySelectorAll("nine-table-sheet");
|
|
1285
|
+
if (!i[e]) return;
|
|
1290
1286
|
if (!s)
|
|
1291
|
-
|
|
1287
|
+
i.forEach((g, f) => {
|
|
1292
1288
|
g.classList.toggle("active", f === e);
|
|
1293
1289
|
}), c.forEach((g, f) => {
|
|
1294
1290
|
const b = f === e;
|
|
1295
1291
|
g.classList.toggle("active", b), g.style.flex = b ? "1 1 100%" : "";
|
|
1296
1292
|
});
|
|
1297
1293
|
else {
|
|
1298
|
-
const g =
|
|
1294
|
+
const g = i[e], f = a.querySelectorAll(".nine-tab-item.active");
|
|
1299
1295
|
if (g.classList.contains("active") && f.length <= 1)
|
|
1300
1296
|
return;
|
|
1301
1297
|
g.classList.toggle("active");
|
|
@@ -1313,8 +1309,8 @@ const is = class is extends HTMLElement {
|
|
|
1313
1309
|
}
|
|
1314
1310
|
};
|
|
1315
1311
|
ue = new WeakMap(), Ft = new WeakMap(), h(is, "NineTableSheets");
|
|
1316
|
-
let
|
|
1317
|
-
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets",
|
|
1312
|
+
let $e = is;
|
|
1313
|
+
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", $e);
|
|
1318
1314
|
var _, be, jt, pe;
|
|
1319
1315
|
const as = class as {
|
|
1320
1316
|
constructor(n) {
|
|
@@ -1329,11 +1325,11 @@ const as = class as {
|
|
|
1329
1325
|
var c, l;
|
|
1330
1326
|
const n = Array.from(t(this, _).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
1331
1327
|
if (n.length === 0) return;
|
|
1332
|
-
const e = parseInt(t(this, _).getAttribute("max-display-row"), 10) || 10, s = Math.max(...n.map((g) => g.getRowHeight())), r = (c = t(this, _).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height,
|
|
1333
|
-
t(this, _).style.height = `${
|
|
1328
|
+
const e = parseInt(t(this, _).getAttribute("max-display-row"), 10) || 10, s = Math.max(...n.map((g) => g.getRowHeight())), r = (c = t(this, _).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, a = (l = t(this, _).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = Zt.SCROLLBAR_SIZE, i = e * s + r + a + o;
|
|
1329
|
+
t(this, _).style.height = `${i}px`;
|
|
1334
1330
|
}, "#applyAutoHeight"));
|
|
1335
1331
|
d(this, pe, /* @__PURE__ */ h(() => {
|
|
1336
|
-
const e = Array.from(t(this, _).children).filter((c) => c.tagName === "TABLE"), s = t(this, _).getAttribute("auto-height") === "true", r = e.length,
|
|
1332
|
+
const e = Array.from(t(this, _).children).filter((c) => c.tagName === "TABLE"), s = t(this, _).getAttribute("auto-height") === "true", r = e.length, a = e.map((c, l) => {
|
|
1337
1333
|
const f = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, b = l < r - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
1338
1334
|
return f + b;
|
|
1339
1335
|
}).join(""), o = e.map((c, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
@@ -1448,7 +1444,7 @@ const as = class as {
|
|
|
1448
1444
|
<nine-table-body>
|
|
1449
1445
|
<nine-table-summary></nine-table-summary>
|
|
1450
1446
|
<nine-table-sheets>
|
|
1451
|
-
<nine-table-sheets-body>${
|
|
1447
|
+
<nine-table-sheets-body>${a}</nine-table-sheets-body>
|
|
1452
1448
|
<nine-table-sheets-footer>
|
|
1453
1449
|
<div class="nine-tab-bar">${o}</div>
|
|
1454
1450
|
<div class="sheets-counter">Total : <span id="row-count">0</span></div>
|
|
@@ -1458,8 +1454,8 @@ const as = class as {
|
|
|
1458
1454
|
</nine-table-body>
|
|
1459
1455
|
<nine-table-footer></nine-table-footer>
|
|
1460
1456
|
`, t(this, _).shadowRoot.querySelector("nine-table-sheets").classList.add("nodata");
|
|
1461
|
-
const
|
|
1462
|
-
|
|
1457
|
+
const i = t(this, _).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1458
|
+
i == null || i.forEach((c, l) => {
|
|
1463
1459
|
e[l] && setTimeout(() => {
|
|
1464
1460
|
c.generate(e[l]), s && t(this, jt).call(this);
|
|
1465
1461
|
});
|
|
@@ -1488,12 +1484,12 @@ const ls = class ls {
|
|
|
1488
1484
|
};
|
|
1489
1485
|
Yt = new WeakMap(), wt = new WeakMap(), h(ls, "ngRow");
|
|
1490
1486
|
let _e = ls;
|
|
1491
|
-
var D, I,
|
|
1487
|
+
var D, I, z, vt, ye, J, me, ft, Vt, xe, we, St;
|
|
1492
1488
|
const P = class P {
|
|
1493
1489
|
constructor(n, e) {
|
|
1494
1490
|
d(this, D);
|
|
1495
1491
|
d(this, I);
|
|
1496
|
-
d(this,
|
|
1492
|
+
d(this, z, []);
|
|
1497
1493
|
d(this, vt, []);
|
|
1498
1494
|
d(this, ye, 0);
|
|
1499
1495
|
d(this, J, []);
|
|
@@ -1514,12 +1510,12 @@ const P = class P {
|
|
|
1514
1510
|
});
|
|
1515
1511
|
}, "#invalidate"));
|
|
1516
1512
|
q(this, "get", /* @__PURE__ */ h((n, e) => {
|
|
1517
|
-
var
|
|
1513
|
+
var a;
|
|
1518
1514
|
const s = this.getValidData();
|
|
1519
1515
|
if (!s || s.length <= 0) return;
|
|
1520
1516
|
if (n == null) return t(this, St).call(this, s);
|
|
1521
1517
|
if (n < 0 || n >= s.length) return null;
|
|
1522
|
-
const r = typeof ((
|
|
1518
|
+
const r = typeof ((a = t(this, D).fields) == null ? void 0 : a.get) == "function" ? t(this, D).fields.get() : [];
|
|
1523
1519
|
if (e != null) {
|
|
1524
1520
|
const o = r.indexOf(e);
|
|
1525
1521
|
return o >= 0 ? s[n].v[o] : null;
|
|
@@ -1539,20 +1535,20 @@ const P = class P {
|
|
|
1539
1535
|
_: [0, 0, 0, 0, P.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, J).slice(), -1, {}, {}]
|
|
1540
1536
|
}), "#getDefaultMeta"));
|
|
1541
1537
|
q(this, "reset", /* @__PURE__ */ h(() => {
|
|
1542
|
-
y(this,
|
|
1538
|
+
y(this, z, []), y(this, vt, []), t(this, ft).call(this);
|
|
1543
1539
|
}, "reset"));
|
|
1544
1540
|
q(this, "clear", /* @__PURE__ */ h(() => {
|
|
1545
1541
|
var n;
|
|
1546
|
-
t(this, I).rawRecords = [], y(this,
|
|
1542
|
+
t(this, I).rawRecords = [], y(this, z, []), y(this, vt, []), (n = t(this, I).viewRecords) != null && n.reset && t(this, I).viewRecords.reset();
|
|
1547
1543
|
}, "clear"));
|
|
1548
1544
|
d(this, xe, /* @__PURE__ */ h((n) => {
|
|
1549
1545
|
var r;
|
|
1550
1546
|
Array.isArray(n) || (n = [n]);
|
|
1551
1547
|
const e = typeof ((r = t(this, D).fields) == null ? void 0 : r.get) == "function" ? t(this, D).fields.get() : Object.keys(n[0] || {}), s = [];
|
|
1552
|
-
return n.forEach((
|
|
1548
|
+
return n.forEach((a) => {
|
|
1553
1549
|
const o = { v: [] };
|
|
1554
|
-
e.forEach((
|
|
1555
|
-
o.v.push(i
|
|
1550
|
+
e.forEach((i) => {
|
|
1551
|
+
o.v.push(a[i] !== void 0 && a[i] !== null ? a[i] : "");
|
|
1556
1552
|
}), s.push(o);
|
|
1557
1553
|
}), s;
|
|
1558
1554
|
}, "#json2Array"));
|
|
@@ -1564,18 +1560,18 @@ const P = class P {
|
|
|
1564
1560
|
const s = t(this, xe).call(this, n);
|
|
1565
1561
|
t(this, I).rawRecords = t(this, I).rawRecords.concat(t(this, we).call(this, s)), this.resetRecords();
|
|
1566
1562
|
const r = this.count() - 1;
|
|
1567
|
-
return e || s.forEach((
|
|
1568
|
-
const
|
|
1569
|
-
|
|
1563
|
+
return e || s.forEach((a, o) => {
|
|
1564
|
+
const i = t(this, I).rawRecords[r - o];
|
|
1565
|
+
i && (i.__ng.rowState = P.ROW_STATE.EMPTY);
|
|
1570
1566
|
}), t(this, ft).call(this), r;
|
|
1571
1567
|
}, "add"));
|
|
1572
1568
|
q(this, "delete", /* @__PURE__ */ h((n) => {
|
|
1573
1569
|
let e = [];
|
|
1574
1570
|
Array.isArray(n) ? e = n : typeof n > "u" ? e = [t(this, I).host.row.at] : e = [parseInt(n, 10)], e.sort((s, r) => r - s).forEach((s) => {
|
|
1575
|
-
if (t(this,
|
|
1576
|
-
const r = t(this,
|
|
1577
|
-
t(this,
|
|
1578
|
-
|
|
1571
|
+
if (t(this, z)[s]) {
|
|
1572
|
+
const r = t(this, z)[s].__ng.rowid;
|
|
1573
|
+
t(this, z)[s].__ng.rowState === P.ROW_STATE.INSERT ? t(this, I).rawRecords = t(this, I).rawRecords.filter((a) => a.__ng.rowid !== r) : t(this, I).rawRecords.forEach((a) => {
|
|
1574
|
+
a.__ng.rowid === r && (a.__ng.deleted = !0, a.__ng.rowState = P.ROW_STATE.DELETE);
|
|
1579
1575
|
});
|
|
1580
1576
|
}
|
|
1581
1577
|
}), this.resetRecords(), t(this, ft).call(this);
|
|
@@ -1583,31 +1579,31 @@ const P = class P {
|
|
|
1583
1579
|
q(this, "setValue", /* @__PURE__ */ h((n, e, s) => {
|
|
1584
1580
|
var c;
|
|
1585
1581
|
n = parseInt(n, 10);
|
|
1586
|
-
const
|
|
1587
|
-
if (
|
|
1582
|
+
const a = (typeof ((c = t(this, D).fields) == null ? void 0 : c.get) == "function" ? t(this, D).fields.get() : []).indexOf(e);
|
|
1583
|
+
if (a < 0) return;
|
|
1588
1584
|
const o = this.getValidData()[n];
|
|
1589
1585
|
if (!o) return;
|
|
1590
|
-
const
|
|
1591
|
-
|
|
1586
|
+
const i = o.v[a];
|
|
1587
|
+
i !== s && o.__ng.rowState !== P.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = i), o.__ng.rowState = P.ROW_STATE.UPDATE), o.v[a] = s;
|
|
1592
1588
|
}, "setValue"));
|
|
1593
1589
|
q(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1594
|
-
y(this, vt, t(this, I).rawRecords.filter((n) => !n.__ng.deleted)), y(this,
|
|
1590
|
+
y(this, vt, t(this, I).rawRecords.filter((n) => !n.__ng.deleted)), y(this, z, t(this, I).rawRecords.filter((n) => !n.__ng.deleted && !n.__ng.filtered)), t(this, I).rawRecords.forEach((n, e) => {
|
|
1595
1591
|
n.__ng.rowidx = e;
|
|
1596
|
-
}), t(this,
|
|
1592
|
+
}), t(this, z).forEach((n, e) => {
|
|
1597
1593
|
n.__ng.i = e;
|
|
1598
1594
|
});
|
|
1599
1595
|
}, "resetRecords"));
|
|
1600
|
-
q(this, "getValidData", /* @__PURE__ */ h(() => (t(this,
|
|
1596
|
+
q(this, "getValidData", /* @__PURE__ */ h(() => (t(this, z).length === 0 && t(this, I).rawRecords.length > 0 && this.resetRecords(), t(this, z)), "getValidData"));
|
|
1601
1597
|
d(this, St, /* @__PURE__ */ h((n) => {
|
|
1602
1598
|
var o;
|
|
1603
1599
|
if (!n) return n;
|
|
1604
|
-
const e = !Array.isArray(n), s = e ? [n] : n, r = typeof ((o = t(this, D).fields) == null ? void 0 : o.get) == "function" ? t(this, D).fields.get() : [],
|
|
1600
|
+
const e = !Array.isArray(n), s = e ? [n] : n, r = typeof ((o = t(this, D).fields) == null ? void 0 : o.get) == "function" ? t(this, D).fields.get() : [], a = s.filter((i) => !i.__ng.deleted).map((i) => {
|
|
1605
1601
|
const c = {};
|
|
1606
1602
|
return r.forEach((l, g) => {
|
|
1607
|
-
c[l] =
|
|
1608
|
-
}), c.__ng =
|
|
1603
|
+
c[l] = i.v ? i.v[g] : i[l];
|
|
1604
|
+
}), c.__ng = i.__ng, c;
|
|
1609
1605
|
});
|
|
1610
|
-
return e ?
|
|
1606
|
+
return e ? a[0] : a;
|
|
1611
1607
|
}, "#conv"));
|
|
1612
1608
|
q(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1613
1609
|
y(this, D, n), y(this, I, e), t(this, me).call(this);
|
|
@@ -1622,16 +1618,16 @@ const P = class P {
|
|
|
1622
1618
|
return ++xs(this, ye)._;
|
|
1623
1619
|
}
|
|
1624
1620
|
get count() {
|
|
1625
|
-
return t(this,
|
|
1621
|
+
return t(this, z).length;
|
|
1626
1622
|
}
|
|
1627
1623
|
get length() {
|
|
1628
|
-
return t(this,
|
|
1624
|
+
return t(this, z).length;
|
|
1629
1625
|
}
|
|
1630
1626
|
getRowCount() {
|
|
1631
1627
|
return this.length;
|
|
1632
1628
|
}
|
|
1633
1629
|
};
|
|
1634
|
-
D = new WeakMap(), I = new WeakMap(),
|
|
1630
|
+
D = new WeakMap(), I = new WeakMap(), z = new WeakMap(), vt = new WeakMap(), ye = new WeakMap(), J = new WeakMap(), me = new WeakMap(), ft = new WeakMap(), Vt = new WeakMap(), xe = new WeakMap(), we = new WeakMap(), St = new WeakMap(), h(P, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1635
1631
|
q(P, "ROW_STATE", {
|
|
1636
1632
|
EMPTY: "EMPTY",
|
|
1637
1633
|
NORMAL: "NORMAL",
|
|
@@ -1650,10 +1646,10 @@ const cs = class cs {
|
|
|
1650
1646
|
}, this.setDataSource = (e) => {
|
|
1651
1647
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1652
1648
|
}, this.getRowState = (e) => {
|
|
1653
|
-
var r,
|
|
1649
|
+
var r, a;
|
|
1654
1650
|
const s = parseInt(e, 10);
|
|
1655
1651
|
if (!(s >= this.data.count()))
|
|
1656
|
-
return (
|
|
1652
|
+
return (a = (r = this.data.getValidData()[s]) == null ? void 0 : r.__ng) == null ? void 0 : a.rowState;
|
|
1657
1653
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1658
1654
|
this.row.at = e;
|
|
1659
1655
|
}, this.scrollTo_V1 = (e) => (e < 0 && (e = 0), e >= this.rawRecords.length && (e = this.rawRecords.length - 1), this.viewRecords.rawIndex = e, this.viewRecords.reset && this.viewRecords.reset(), !(e <= 0 || e >= this.rawRecords.length - 1)), this.getColumn = (e, s) => this.data.get(e, s), this.setColumn = (e, s, r) => {
|
|
@@ -1686,25 +1682,25 @@ const hs = class hs {
|
|
|
1686
1682
|
if (!(!n || n.length === 0)) {
|
|
1687
1683
|
for (const e of n)
|
|
1688
1684
|
S.log(e), $("[data-bind]", e).each((s, r) => {
|
|
1689
|
-
const
|
|
1690
|
-
|
|
1685
|
+
const a = r.dataset.bind, o = r.getAttribute("data-type") || "string";
|
|
1686
|
+
a && t(this, H).push({ name: a, type: o });
|
|
1691
1687
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
1692
|
-
$(`[${s}]`, e).each((r,
|
|
1693
|
-
var o =
|
|
1688
|
+
$(`[${s}]`, e).each((r, a) => {
|
|
1689
|
+
var o = a.getAttribute(s);
|
|
1694
1690
|
if (o.indexOf("data.") < 0) {
|
|
1695
|
-
const
|
|
1696
|
-
if (
|
|
1691
|
+
const i = o.search(/[(]/g);
|
|
1692
|
+
if (i > 0)
|
|
1697
1693
|
try {
|
|
1698
|
-
o = String(window[o.substring(0,
|
|
1694
|
+
o = String(window[o.substring(0, i).trim()]);
|
|
1699
1695
|
} catch {
|
|
1700
1696
|
o = "";
|
|
1701
1697
|
}
|
|
1702
1698
|
}
|
|
1703
|
-
o.split("data.").forEach((
|
|
1704
|
-
if (
|
|
1705
|
-
const c =
|
|
1699
|
+
o.split("data.").forEach((i) => {
|
|
1700
|
+
if (i.trim() != "") {
|
|
1701
|
+
const c = i.search(/[^_A-Za-z0-9]/g);
|
|
1706
1702
|
let l = "";
|
|
1707
|
-
c >= 0 ? l =
|
|
1703
|
+
c >= 0 ? l = i.substring(0, c) : o.startsWith("data.") && (l = i.replace("data.", "")), l && t(this, H).push({ name: l, type: "string" });
|
|
1708
1704
|
}
|
|
1709
1705
|
});
|
|
1710
1706
|
});
|
|
@@ -1768,8 +1764,8 @@ const ds = class ds extends HTMLElement {
|
|
|
1768
1764
|
}
|
|
1769
1765
|
};
|
|
1770
1766
|
ut = new WeakMap(), Se = new WeakMap(), Re = new WeakMap(), h(ds, "NineTable");
|
|
1771
|
-
let
|
|
1772
|
-
customElements.get("nine-table") || customElements.define("nine-table",
|
|
1767
|
+
let ze = ds;
|
|
1768
|
+
customElements.get("nine-table") || customElements.define("nine-table", ze);
|
|
1773
1769
|
const Tt = class Tt extends HTMLElement {
|
|
1774
1770
|
// π 컀μ€ν
μ€νμΌμ© μΊμ μΆκ°
|
|
1775
1771
|
constructor() {
|
|
@@ -1782,9 +1778,9 @@ const Tt = class Tt extends HTMLElement {
|
|
|
1782
1778
|
}
|
|
1783
1779
|
};
|
|
1784
1780
|
h(Tt, "BasicCellElement"), q(Tt, "_styleCache", /* @__PURE__ */ new Map()), q(Tt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1785
|
-
let
|
|
1781
|
+
let We = Tt;
|
|
1786
1782
|
var L, Xt, v, Xe, Ke, Ge, Ze, Je;
|
|
1787
|
-
const fs = class fs extends
|
|
1783
|
+
const fs = class fs extends We {
|
|
1788
1784
|
constructor() {
|
|
1789
1785
|
super();
|
|
1790
1786
|
d(this, L);
|
|
@@ -1823,27 +1819,27 @@ const fs = class fs extends ze {
|
|
|
1823
1819
|
var A = ninegrid.j.querySelectorAll(T).attr("suppress");
|
|
1824
1820
|
A && T.dataset.row && (A = parseInt(A), !isNaN(A) && A <= e && r.push(A));
|
|
1825
1821
|
}), r.sort();
|
|
1826
|
-
var
|
|
1822
|
+
var a = !1;
|
|
1827
1823
|
if (parseInt(s.sectionRowIndex / t(this, L).template.length) > 0)
|
|
1828
1824
|
for (var o of r) {
|
|
1829
1825
|
if (o > e) break;
|
|
1830
|
-
var
|
|
1826
|
+
var i = parseInt(t(this, v).dataset.row), c = i - 1, l = t(this, v).closest("tr").data, g = t(this, L).data.get(c);
|
|
1831
1827
|
t(this, v).dataset.matrixRow;
|
|
1832
|
-
var f = t(this, L).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, v).dataset.matrixRow}"]`), b = f.dataset.expr ? this.getExprValue(f.dataset.expr, l,
|
|
1828
|
+
var f = t(this, L).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, v).dataset.matrixRow}"]`), b = f.dataset.expr ? this.getExprValue(f.dataset.expr, l, i) : l[f.dataset.bind], u = f.dataset.expr ? this.getExprValue(f.dataset.expr, g, c) : g[f.dataset.bind];
|
|
1833
1829
|
if (b != u) {
|
|
1834
|
-
|
|
1830
|
+
a = !0;
|
|
1835
1831
|
break;
|
|
1836
1832
|
}
|
|
1837
1833
|
}
|
|
1838
1834
|
else
|
|
1839
|
-
|
|
1840
|
-
|
|
1835
|
+
a = !0;
|
|
1836
|
+
a ? ninegrid.j.querySelectorAll(t(this, v)).removeClass("suppress") : ninegrid.j.querySelectorAll(t(this, v)).addClass("suppress"), ninegrid.j.querySelectorAll(t(this, v)).hasClass("hidden") || (a ? ninegrid.j.querySelectorAll(t(this, v)).removeClass("hidden") : ninegrid.j.querySelectorAll(t(this, v)).addClass("hidden"));
|
|
1841
1837
|
var p = parseInt(t(this, v).dataset.matrixRow), x = p - 1, w = t(this, L).body.querySelector(`tbody.bindable [data-col="${t(this, v).dataset.col}"][data-matrix-row="${x}"]`);
|
|
1842
1838
|
$(w).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this, v)).hasClass("suppress") ? ninegrid.j.querySelectorAll(w).removeClass("last-none-suppress").addClass("last-suppress") : !$(w).hasClass("suppress") && ninegrid.j.querySelectorAll(t(this, v)).hasClass("suppress") ? ninegrid.j.querySelectorAll(w).removeClass("last-suppress").addClass("last-none-suppress") : ninegrid.j.querySelectorAll(w).removeClass("last-none-suppress").removeClass("last-suppress");
|
|
1843
1839
|
}
|
|
1844
1840
|
}
|
|
1845
1841
|
}, "#resetSuppress"));
|
|
1846
|
-
q(this, "getExprValue", /* @__PURE__ */ h((e, s, r,
|
|
1842
|
+
q(this, "getExprValue", /* @__PURE__ */ h((e, s, r, a) => {
|
|
1847
1843
|
if (typeof e < "u")
|
|
1848
1844
|
try {
|
|
1849
1845
|
r = parseInt(r);
|
|
@@ -1941,8 +1937,8 @@ const us = class us extends Fe {
|
|
|
1941
1937
|
d(this, Qe, /* @__PURE__ */ h((e) => {
|
|
1942
1938
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1943
1939
|
if (t(this, bt) == "number") {
|
|
1944
|
-
let
|
|
1945
|
-
if (t(this, Q) && Number(t(this, Q)) > 0 &&
|
|
1940
|
+
let a = [];
|
|
1941
|
+
if (t(this, Q) && Number(t(this, Q)) > 0 && a.push("."), t(this, Et) && Number(t(this, Et)) >= 0 && a.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !a.includes(e.key) && e.preventDefault(), t(this, Q) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
|
|
1946
1942
|
var s = e.target.value, r = s.indexOf(".");
|
|
1947
1943
|
if (r >= 0) {
|
|
1948
1944
|
var s = s.substr(r + 1, s.length);
|