@ninebone/table 0.0.796 → 0.0.797
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 +294 -294
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +7 -7
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -44,43 +44,43 @@ 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 (a !== 0 &&
|
|
49
|
-
|
|
47
|
+
const r = t(this, E).track, i = t(this, E).thumb, o = t(this, j).querySelector(".ng-container-bottom"), a = e.clientWidth, c = s.scrollWidth;
|
|
48
|
+
if (a !== 0 && c > a)
|
|
49
|
+
o && (o.style.display = "flex");
|
|
50
50
|
else {
|
|
51
|
-
|
|
51
|
+
o && (o.style.display = "none");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
56
|
-
const u = Math.max(Math.min(
|
|
57
|
-
|
|
58
|
-
const f = e.scrollLeft, b =
|
|
54
|
+
const l = r.clientWidth;
|
|
55
|
+
if (l <= 0) return;
|
|
56
|
+
const u = Math.max(Math.min(l * (a / c), l), 20);
|
|
57
|
+
i.style.width = `${u}px`;
|
|
58
|
+
const f = e.scrollLeft, b = c - a;
|
|
59
59
|
let g = 0;
|
|
60
|
-
b > 0 && (g = parseInt(f / b * (
|
|
61
|
-
const p =
|
|
62
|
-
g > p && (g = p),
|
|
60
|
+
b > 0 && (g = parseInt(f / b * (l - u), 10)), g < 0 && (g = 0);
|
|
61
|
+
const p = l - u;
|
|
62
|
+
g > p && (g = p), i.style.left = `${g}px`, t(this, E).left.disabled = g === 0, t(this, E).right.disabled = g >= 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
|
|
68
|
+
const i = t(this, E).track.getBoundingClientRect(), o = t(this, E).thumb.clientWidth;
|
|
69
69
|
let a = e;
|
|
70
70
|
a < 0 && (a = 0);
|
|
71
|
-
const
|
|
72
|
-
a >
|
|
73
|
-
const
|
|
74
|
-
return
|
|
71
|
+
const c = i.width - o;
|
|
72
|
+
a > c && (a = c), a = parseInt(a, 10), t(this, E).thumb.style.left = `${a}px`, S.log("1111=========="), t(this, E).left.disabled = a === 0, t(this, E).right.disabled = a >= c - 1;
|
|
73
|
+
const l = s.clientWidth, f = r.scrollWidth - l;
|
|
74
|
+
return c > 0 && f > 0 && (s.scrollLeft = a / c * f), a > 0 && a < 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 i = parseInt(t(this, E).thumb.style.left || 0, 10);
|
|
80
|
+
t(this, nt).call(this, i + r), y(this, tt, setInterval(() => {
|
|
81
81
|
clearInterval(t(this, tt)), y(this, et, setInterval(() => {
|
|
82
|
-
const
|
|
83
|
-
t(this, nt).call(this,
|
|
82
|
+
const o = parseInt(t(this, E).thumb.style.left || 0, 10);
|
|
83
|
+
t(this, nt).call(this, o + r) || clearInterval(t(this, et));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), s = /* @__PURE__ */ h(() => {
|
|
@@ -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 i = t(this, E).track.getBoundingClientRect(), o = t(this, E).thumb.clientWidth;
|
|
99
|
+
t(this, nt).call(this, r.clientX - i.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 i = /* @__PURE__ */ h((a) => {
|
|
104
104
|
if (!t(this, G)) return;
|
|
105
|
-
const
|
|
106
|
-
t(this, nt).call(this, a.clientX -
|
|
107
|
-
}, "onMouseMove"),
|
|
108
|
-
y(this, G, !1), s(), document.removeEventListener("mousemove",
|
|
105
|
+
const c = t(this, E).track.getBoundingClientRect();
|
|
106
|
+
t(this, nt).call(this, a.clientX - c.left - this.shiftX);
|
|
107
|
+
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
108
|
+
y(this, G, !1), s(), document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", o), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
|
-
document.addEventListener("mousemove",
|
|
110
|
+
document.addEventListener("mousemove", i), document.addEventListener("mouseup", o);
|
|
111
111
|
});
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
@@ -213,35 +213,35 @@ 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 (
|
|
216
|
+
const e = t(this, k).container, s = t(this, k).track, r = t(this, k).thumb, i = e.clientHeight, o = t(this, rt).data.length, a = t(this, ot).getRowHeight(), c = o * a;
|
|
217
|
+
if (c <= i || o === 0) {
|
|
218
218
|
this.style.display = "none";
|
|
219
219
|
return;
|
|
220
220
|
} else
|
|
221
221
|
this.style.display = "flex";
|
|
222
|
-
const
|
|
223
|
-
if (
|
|
224
|
-
const u = Math.max(Math.min(
|
|
222
|
+
const l = s.clientHeight;
|
|
223
|
+
if (l <= 0) return;
|
|
224
|
+
const u = Math.max(Math.min(l * (i / c), l), 20);
|
|
225
225
|
r.style.height = `${u}px`;
|
|
226
|
-
const f = e.scrollTop, b = Math.max(
|
|
226
|
+
const f = e.scrollTop, b = Math.max(c - i, 1);
|
|
227
227
|
S.log(e, f, b);
|
|
228
228
|
let g = 0;
|
|
229
|
-
b > 0 && (g = f / b * (
|
|
230
|
-
const p =
|
|
229
|
+
b > 0 && (g = f / b * (l - u));
|
|
230
|
+
const p = l - u;
|
|
231
231
|
g < 0 && (g = 0), g > p && (g = p), r.style.top = `${g}px`, t(this, k).top.disabled = f <= 0, t(this, k).bottom.disabled = f >= b - 1;
|
|
232
232
|
}, "refresh"));
|
|
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 i = (t(this, rt).data.get() || []).length, o = t(this, ot).getRowHeight();
|
|
237
|
+
return i * 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 i = /* @__PURE__ */ h((a) => {
|
|
243
243
|
if (!t(this, yt)) return;
|
|
244
|
-
const
|
|
244
|
+
const c = t(this, k).track.getBoundingClientRect(), l = t(this, k).thumb.clientHeight, f = c.height - l, b = a.clientY - t(this, kt), g = e.clientHeight, p = s(), x = Math.max(p - g, 1);
|
|
245
245
|
if (f > 0 && x > 0) {
|
|
246
246
|
const w = b / f * x;
|
|
247
247
|
let m = t(this, It) + w;
|
|
@@ -249,15 +249,15 @@ const ss = class ss extends HTMLElement {
|
|
|
249
249
|
m < 0 && (m = 0), m > T && (m = T), e.scrollTop = m;
|
|
250
250
|
}
|
|
251
251
|
this.refresh();
|
|
252
|
-
}, "onMouseMove"),
|
|
253
|
-
y(this, yt, !1), document.removeEventListener("mousemove",
|
|
252
|
+
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
253
|
+
y(this, yt, !1), document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", o), this.refresh();
|
|
254
254
|
}, "onMouseUp");
|
|
255
|
-
document.addEventListener("mousemove",
|
|
255
|
+
document.addEventListener("mousemove", i), 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
|
|
259
|
-
if (
|
|
260
|
-
const g = Math.max(0, Math.min(1, a /
|
|
258
|
+
const i = t(this, k).track.getBoundingClientRect(), o = t(this, k).thumb.clientHeight, a = r.clientY - i.top - o / 2, l = i.height - o, u = e.clientHeight, f = s(), b = Math.max(f - u, 1);
|
|
259
|
+
if (l > 0 && b > 0) {
|
|
260
|
+
const g = Math.max(0, Math.min(1, a / l));
|
|
261
261
|
e.scrollTop = g * b;
|
|
262
262
|
}
|
|
263
263
|
this.refresh();
|
|
@@ -378,31 +378,31 @@ const ns = class ns {
|
|
|
378
378
|
S.log("rowManager.initialize"), y(this, it, {
|
|
379
379
|
scrollTables: t(this, A).querySelectorAll(".ng-part-body table"),
|
|
380
380
|
firstTr: t(this, A).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
381
|
-
}), y(this, O, null), t(this, Y).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
382
|
-
const i = t(this, A).querySelector(
|
|
381
|
+
}), y(this, O, null), t(this, Y).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((r) => {
|
|
382
|
+
const i = t(this, A).querySelector(r);
|
|
383
383
|
if (!i) return;
|
|
384
|
-
const
|
|
384
|
+
const o = i.querySelector(".ng-part-body table");
|
|
385
|
+
if (!o) return;
|
|
386
|
+
const a = o.querySelector("tbody.bindable-tbody");
|
|
385
387
|
if (!a) return;
|
|
386
|
-
const l = a.
|
|
387
|
-
|
|
388
|
-
const u = Array.from(l.querySelectorAll("tr")).map((f) => f.cloneNode(!0));
|
|
389
|
-
t(this, Y).set(o, u);
|
|
388
|
+
const l = Array.from(a.querySelectorAll("tr")).map((u) => u.cloneNode(!0));
|
|
389
|
+
t(this, Y).set(r, l);
|
|
390
390
|
});
|
|
391
|
-
const n = t(this, A).querySelector(".ng-container-body .ng-part-body"), e = t(this, A).querySelector(".ng-container-left .ng-part-body"), s = t(this, A).querySelector(".ng-container-right .ng-part-body")
|
|
392
|
-
if (t(this, A).querySelector(".ng-container-body .ng-part-footer"), n) {
|
|
391
|
+
const n = t(this, A).querySelector(".ng-container-body .ng-part-body"), e = t(this, A).querySelector(".ng-container-left .ng-part-body"), s = t(this, A).querySelector(".ng-container-right .ng-part-body");
|
|
392
|
+
if (t(this, A).querySelector(".ng-container-body .ng-part-header"), t(this, A).querySelector(".ng-container-body .ng-part-footer"), n) {
|
|
393
393
|
t(this, Mt).call(this), t(this, Nt).call(this), t(this, Ht).call(this), t(this, mt).call(this, n.scrollTop);
|
|
394
|
-
let
|
|
394
|
+
let r = !1;
|
|
395
395
|
n.scrollTop, n.scrollLeft;
|
|
396
|
-
const i = /* @__PURE__ */ h((
|
|
396
|
+
const i = /* @__PURE__ */ h((o) => {
|
|
397
397
|
var c;
|
|
398
|
-
if (
|
|
399
|
-
|
|
400
|
-
const
|
|
401
|
-
|
|
398
|
+
if (r) return;
|
|
399
|
+
r = !0;
|
|
400
|
+
const a = o.scrollTop;
|
|
401
|
+
o.scrollLeft, S.log("======", o, o.scrollLeft), n && n.scrollTop !== a && (n.scrollTop = a), e && e.scrollTop !== a && (e.scrollTop = a), s && s.scrollTop !== a && (s.scrollTop = a), t(this, mt).call(this, a), (c = t(this, A).querySelector("nine-table-vscrollbar")) == null || c.refresh(), r = !1;
|
|
402
402
|
}, "handleContainerScroll");
|
|
403
|
-
[n, e, s].forEach((
|
|
404
|
-
|
|
405
|
-
S.log(
|
|
403
|
+
[n, e, s].forEach((o) => {
|
|
404
|
+
o == null || o.addEventListener("scroll", (a) => {
|
|
405
|
+
S.log(a), S.log("rowManager.scroll event"), i(o);
|
|
406
406
|
});
|
|
407
407
|
});
|
|
408
408
|
}
|
|
@@ -414,12 +414,12 @@ const ns = class ns {
|
|
|
414
414
|
const r = n.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
415
415
|
if (!r) return;
|
|
416
416
|
r.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
|
|
417
|
-
const
|
|
417
|
+
const i = r.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
418
418
|
for (let a = 0; a < t(this, Lt); a++)
|
|
419
|
-
s.forEach((
|
|
420
|
-
|
|
419
|
+
s.forEach((c) => {
|
|
420
|
+
o.appendChild(c.cloneNode(!0));
|
|
421
421
|
});
|
|
422
|
-
|
|
422
|
+
i ? i.before(o) : r.appendChild(o), e === ".ng-container-body" && (t(this, it).firstTr = r.querySelector("tr:not(.nodata)"));
|
|
423
423
|
}, "#renderRows"));
|
|
424
424
|
d(this, Mt, /* @__PURE__ */ h(() => {
|
|
425
425
|
if (t(this, O) !== null && t(this, O) > 0)
|
|
@@ -431,12 +431,12 @@ const ns = class ns {
|
|
|
431
431
|
const s = n.querySelector("tbody.bindable-tbody");
|
|
432
432
|
if (S.log(s), !s) throw new Error("invalid dom");
|
|
433
433
|
s.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
|
|
434
|
-
const r = s.querySelector("tr.nodata"),
|
|
434
|
+
const r = s.querySelector("tr.nodata"), i = document.createDocumentFragment();
|
|
435
435
|
e.forEach((b) => {
|
|
436
|
-
|
|
437
|
-
}), r ? r.before(
|
|
438
|
-
const
|
|
439
|
-
(a === "none" || window.getComputedStyle(
|
|
436
|
+
i.appendChild(b.cloneNode(!0));
|
|
437
|
+
}), r ? r.before(i) : s.appendChild(i);
|
|
438
|
+
const o = t(this, A), a = o.style.display, c = o.style.visibility, l = o.style.position;
|
|
439
|
+
(a === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
440
440
|
let u = 0;
|
|
441
441
|
const f = s.querySelectorAll("tr");
|
|
442
442
|
return f.forEach((b) => {
|
|
@@ -446,15 +446,15 @@ const ns = class ns {
|
|
|
446
446
|
g = parseFloat(p.height) || parseFloat(p.minHeight) || 0;
|
|
447
447
|
}
|
|
448
448
|
u += g;
|
|
449
|
-
}), f.forEach((b) => b.remove()),
|
|
449
|
+
}), f.forEach((b) => b.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l, u <= 0 ? -1 : (y(this, O, u), t(this, $t).call(this), t(this, O));
|
|
450
450
|
}, "#measureAndCacheHeight"));
|
|
451
451
|
d(this, Ht, /* @__PURE__ */ h(() => {
|
|
452
452
|
S.log("rowManager.#updateVirtualScrollHeight");
|
|
453
453
|
const e = (t(this, U).data.get() || []).length, s = t(this, O), r = e * s;
|
|
454
|
-
S.log("🔍 [VirtualHeight]", { totalCount: e, rowHeight: s, totalVirtualHeight: r }), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
455
|
-
const
|
|
456
|
-
if (!
|
|
457
|
-
const a =
|
|
454
|
+
S.log("🔍 [VirtualHeight]", { totalCount: e, rowHeight: s, totalVirtualHeight: r }), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
455
|
+
const o = t(this, A).querySelector(i);
|
|
456
|
+
if (!o) return;
|
|
457
|
+
const a = o.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
458
458
|
a && (a.style.height = `${r}px`);
|
|
459
459
|
});
|
|
460
460
|
}, "#updateVirtualScrollHeight"));
|
|
@@ -465,22 +465,22 @@ const ns = class ns {
|
|
|
465
465
|
}
|
|
466
466
|
}, "#updateRowCount"));
|
|
467
467
|
d(this, ne, /* @__PURE__ */ h(() => {
|
|
468
|
-
var a,
|
|
468
|
+
var a, c, l, u, f, b;
|
|
469
469
|
const n = t(this, A).querySelector(".ng-container-left .ng-part-body table"), e = t(this, A).querySelector(".ng-container-body .ng-part-body table"), s = t(this, A).querySelector(".ng-container-right .ng-part-body table");
|
|
470
470
|
if (e) {
|
|
471
471
|
const g = 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(g.length, p.length, x.length);
|
|
472
472
|
for (let m = 0; m < w; m++) {
|
|
473
473
|
const T = [
|
|
474
474
|
((a = g[m]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
475
|
-
((
|
|
476
|
-
((
|
|
475
|
+
((c = p[m]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
476
|
+
((l = x[m]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
477
477
|
], R = Math.max(...T);
|
|
478
478
|
R > 0 && (g[m] && (g[m].style.height = `${R}px`), p[m] && (p[m].style.height = `${R}px`), x[m] && (x[m].style.height = `${R}px`));
|
|
479
479
|
}
|
|
480
480
|
}
|
|
481
|
-
const r = t(this, A).querySelector(".ng-container-left .ng-part-footer table"),
|
|
482
|
-
if (
|
|
483
|
-
const g = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], p = Array.from(
|
|
481
|
+
const r = t(this, A).querySelector(".ng-container-left .ng-part-footer table"), i = t(this, A).querySelector(".ng-container-body .ng-part-footer table"), o = t(this, A).querySelector(".ng-container-right .ng-part-footer table");
|
|
482
|
+
if (i) {
|
|
483
|
+
const g = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], p = Array.from(i.querySelectorAll("tfoot tr")), x = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], w = Math.max(g.length, p.length, x.length);
|
|
484
484
|
for (let m = 0; m < w; m++) {
|
|
485
485
|
const T = [
|
|
486
486
|
((u = g[m]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
|
|
@@ -498,11 +498,11 @@ const ns = class ns {
|
|
|
498
498
|
if (!s.classList.contains("active")) continue;
|
|
499
499
|
const r = e.contentRect.height;
|
|
500
500
|
if (r > 0) {
|
|
501
|
-
let
|
|
502
|
-
const
|
|
503
|
-
|
|
504
|
-
const
|
|
505
|
-
t(this, at) !==
|
|
501
|
+
let i = 0;
|
|
502
|
+
const o = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
|
|
503
|
+
o && (i += o.offsetHeight), a && (i += a.offsetHeight);
|
|
504
|
+
const c = Math.max(r - i, 100);
|
|
505
|
+
t(this, at) !== c && (y(this, at, c), t(this, $t).call(this), t(this, O) !== null && (t(this, Nt).call(this), this.refresh()));
|
|
506
506
|
}
|
|
507
507
|
}
|
|
508
508
|
})), t(this, Z).observe(t(this, A)));
|
|
@@ -515,15 +515,15 @@ const ns = class ns {
|
|
|
515
515
|
}, "#renderAllContainers"));
|
|
516
516
|
d(this, Ue, /* @__PURE__ */ h((n) => {
|
|
517
517
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
518
|
-
var
|
|
518
|
+
var l;
|
|
519
519
|
const s = t(this, A).querySelector(e);
|
|
520
520
|
if (!s) return;
|
|
521
521
|
const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
522
522
|
if (!r) return;
|
|
523
|
-
const
|
|
524
|
-
|
|
525
|
-
const b = n + Math.floor(f /
|
|
526
|
-
if (b >=
|
|
523
|
+
const i = 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;
|
|
524
|
+
i.forEach((u, f) => {
|
|
525
|
+
const b = n + Math.floor(f / o);
|
|
526
|
+
if (b >= c) {
|
|
527
527
|
u.style.visibility = "hidden";
|
|
528
528
|
return;
|
|
529
529
|
}
|
|
@@ -538,14 +538,14 @@ const ns = class ns {
|
|
|
538
538
|
if (!e || e <= 0) return;
|
|
539
539
|
const s = t(this, U).data.length;
|
|
540
540
|
if (s === 0) return;
|
|
541
|
-
const r = ((f = t(this, Y).get(".ng-container-body")) == null ? void 0 : f.length) || 1,
|
|
542
|
-
S.log("bodyContainer.clientHeight",
|
|
543
|
-
const
|
|
544
|
-
let
|
|
545
|
-
S.log(`📜 [Scroll Calc] maxStartIndex: ${
|
|
546
|
-
const
|
|
541
|
+
const r = ((f = t(this, Y).get(".ng-container-body")) == null ? void 0 : f.length) || 1, i = t(this, A).querySelector(".ng-container-body .ng-part-body");
|
|
542
|
+
S.log("bodyContainer.clientHeight", i.clientHeight);
|
|
543
|
+
const o = Math.max(0, s - Math.floor(i.clientHeight / e)), a = Math.min(o, Math.max(0, Math.floor(n / e)));
|
|
544
|
+
let c = Math.floor(a * e);
|
|
545
|
+
S.log(`📜 [Scroll Calc] maxStartIndex: ${o}, startIndex: ${a}, offsetY: ${c}`), a === o && S.log(`📜 [Scroll Inspect] scrollTop: ${n}, rowHeight: ${e}, maxStartIndex: ${o}, startIndex: ${a}, offsetY: ${c}`);
|
|
546
|
+
const l = t(this, it).firstTr, u = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
|
|
547
547
|
(b = t(this, it)) == null || b.scrollTables.forEach((g) => {
|
|
548
|
-
g.style.transform = `translate3d(0, ${
|
|
548
|
+
g.style.transform = `translate3d(0, ${c}px, 0)`;
|
|
549
549
|
}), u !== a && (S.log(`🔄 [Row Bind Trigger] currentStartIndex(${u}) !== startIndex(${a})`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
|
|
550
550
|
const p = t(this, A).querySelector(g);
|
|
551
551
|
if (!p) return;
|
|
@@ -577,25 +577,25 @@ const ns = class ns {
|
|
|
577
577
|
});
|
|
578
578
|
}; */
|
|
579
579
|
d(this, _t, /* @__PURE__ */ h((n, e, s) => {
|
|
580
|
-
n.dataset.row = s, n.data = e, Array.from(n.cells).forEach((r,
|
|
580
|
+
n.dataset.row = s, n.data = e, Array.from(n.cells).forEach((r, i) => {
|
|
581
581
|
r.dataset.row = s;
|
|
582
|
-
const
|
|
583
|
-
|
|
582
|
+
const o = Array.from(r.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
|
|
583
|
+
o && typeof o.refresh == "function" && o.refresh();
|
|
584
584
|
});
|
|
585
585
|
}, "#bindRowData"));
|
|
586
586
|
d(this, oe, /* @__PURE__ */ h(() => {
|
|
587
|
-
var
|
|
587
|
+
var c, l, u;
|
|
588
588
|
S.log("rowManager.#syncHeaderHeights");
|
|
589
589
|
const n = t(this, A).querySelector(".ng-container-left .ng-part-header table"), e = t(this, A).querySelector(".ng-container-body .ng-part-header table"), s = t(this, A).querySelector(".ng-container-right .ng-part-header table");
|
|
590
590
|
if (!e) return;
|
|
591
|
-
const r = n ? Array.from(n.querySelectorAll("tr")) : [],
|
|
591
|
+
const r = n ? Array.from(n.querySelectorAll("tr")) : [], i = Array.from(e.querySelectorAll("tr")), o = s ? Array.from(s.querySelectorAll("tr")) : [], a = Math.max(r.length, i.length, o.length);
|
|
592
592
|
for (let f = 0; f < a; f++) {
|
|
593
593
|
const b = [
|
|
594
|
-
((
|
|
595
|
-
((
|
|
596
|
-
((u =
|
|
594
|
+
((c = r[f]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
595
|
+
((l = i[f]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
596
|
+
((u = o[f]) == null ? void 0 : u.getBoundingClientRect().height) || 0
|
|
597
597
|
], g = Math.max(...b);
|
|
598
|
-
g > 0 && (r[f] && (r[f].style.height = `${g}px`),
|
|
598
|
+
g > 0 && (r[f] && (r[f].style.height = `${g}px`), i[f] && (i[f].style.height = `${g}px`), o[f] && (o[f].style.height = `${g}px`));
|
|
599
599
|
}
|
|
600
600
|
}, "#syncHeaderHeights"));
|
|
601
601
|
q(this, "destroy", /* @__PURE__ */ h(() => {
|
|
@@ -626,39 +626,39 @@ const ie = class ie {
|
|
|
626
626
|
static compile(n) {
|
|
627
627
|
if (!n) return null;
|
|
628
628
|
const e = /* @__PURE__ */ h((a) => {
|
|
629
|
-
a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((
|
|
630
|
-
const u =
|
|
631
|
-
if (
|
|
629
|
+
a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
|
|
630
|
+
const u = l.getAttribute("cell-type") || "renderer";
|
|
631
|
+
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
632
632
|
let f = `cell-${u}`;
|
|
633
|
-
const b =
|
|
633
|
+
const b = l.getAttribute("data-bind"), g = l.getAttribute("data-expr"), p = l.getAttribute("maxbyte"), x = l.getAttribute("type");
|
|
634
634
|
let w = [];
|
|
635
|
-
b && w.push(`data-bind="${b}"`), g && w.push(`data-expr="${g}"`), p && w.push(`maxbyte="${p}"`), x && w.push(`type="${x}"`),
|
|
636
|
-
}), a.querySelectorAll("tbody td, tfoot td").forEach((
|
|
637
|
-
|
|
635
|
+
b && w.push(`data-bind="${b}"`), g && w.push(`data-expr="${g}"`), p && w.push(`maxbyte="${p}"`), x && w.push(`type="${x}"`), l.innerHTML = `<${f} ${w.join(" ")}></${f}>`;
|
|
636
|
+
}), a.querySelectorAll("tbody td, tfoot td").forEach((l) => {
|
|
637
|
+
l.setAttribute("tabindex", "0");
|
|
638
638
|
});
|
|
639
639
|
}, "processCellTypes"), s = /* @__PURE__ */ h((a) => {
|
|
640
640
|
if (!a.querySelector("colgroup")) {
|
|
641
|
-
const
|
|
642
|
-
for (let b = 0; b <
|
|
641
|
+
const c = a.querySelector("tbody tr") || a.querySelector("tr"), l = c ? c.querySelectorAll("th, td").length : 1, u = document.createElement("colgroup"), f = Math.max(Math.floor(a.clientWidth / l), 100);
|
|
642
|
+
for (let b = 0; b < l; b++) {
|
|
643
643
|
const g = document.createElement("col");
|
|
644
644
|
g.setAttribute("width", f), u.appendChild(g);
|
|
645
645
|
}
|
|
646
646
|
a.prepend(u);
|
|
647
647
|
}
|
|
648
648
|
if (!a.querySelector("thead")) {
|
|
649
|
-
const
|
|
650
|
-
|
|
649
|
+
const c = document.createElement("thead"), l = a.querySelector("colgroup");
|
|
650
|
+
l ? l.after(c) : a.prepend(c);
|
|
651
651
|
}
|
|
652
652
|
a.classList.add("nine-table-element");
|
|
653
|
-
}, "ensureTableStructure"), r = /* @__PURE__ */ h((a,
|
|
654
|
-
const
|
|
653
|
+
}, "ensureTableStructure"), r = /* @__PURE__ */ h((a, c) => {
|
|
654
|
+
const l = Array.from(a.querySelectorAll(c + " tr")), u = Array.from(a.querySelectorAll(c + " th," + c + " td")), f = l.length;
|
|
655
655
|
if (f === 0 || u.length === 0) return;
|
|
656
656
|
let b = 0;
|
|
657
657
|
u.forEach((p) => {
|
|
658
658
|
b += p.colSpan || 1;
|
|
659
659
|
});
|
|
660
660
|
const g = Array.from(Array(f), () => Array(b).fill(null));
|
|
661
|
-
|
|
661
|
+
l.forEach((p) => {
|
|
662
662
|
const x = p.sectionRowIndex;
|
|
663
663
|
let w = 0;
|
|
664
664
|
Array.from(p.querySelectorAll("th,td")).forEach((m) => {
|
|
@@ -672,7 +672,7 @@ const ie = class ie {
|
|
|
672
672
|
for (let B = 0; B < R; B++)
|
|
673
673
|
x + M < f && w + B < b && (g[x + M][w + B] = M === 0 && B === 0 ? "1" : "0");
|
|
674
674
|
});
|
|
675
|
-
}),
|
|
675
|
+
}), l.forEach((p) => {
|
|
676
676
|
const x = p.sectionRowIndex;
|
|
677
677
|
Array.from(p.querySelectorAll("th,td")).forEach((w) => {
|
|
678
678
|
for (let m = 0; m < g[x].length; m++)
|
|
@@ -682,13 +682,13 @@ const ie = class ie {
|
|
|
682
682
|
}
|
|
683
683
|
});
|
|
684
684
|
});
|
|
685
|
-
}, "resetColIndex"),
|
|
686
|
-
return s(
|
|
687
|
-
const
|
|
688
|
-
|
|
689
|
-
u.setAttribute("fixed",
|
|
685
|
+
}, "resetColIndex"), i = n.cloneNode(!0);
|
|
686
|
+
return s(i), e(i), r(i, "thead"), r(i, "tbody"), r(i, "tfoot"), Array.from(i.querySelectorAll("colgroup col")).forEach((a, c) => {
|
|
687
|
+
const l = a.getAttribute("fixed");
|
|
688
|
+
l && i.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((u) => {
|
|
689
|
+
u.setAttribute("fixed", l);
|
|
690
690
|
});
|
|
691
|
-
}),
|
|
691
|
+
}), i;
|
|
692
692
|
}
|
|
693
693
|
// 🎯 [추가] td/th에 선언된 cell-type 속성을 읽어 커스텀 태그로 자동 감싸기
|
|
694
694
|
};
|
|
@@ -703,29 +703,29 @@ const rs = class rs {
|
|
|
703
703
|
q(this, "render", /* @__PURE__ */ h(() => {
|
|
704
704
|
const { startRow: n, startCol: e, endRow: s, endCol: r } = t(this, X);
|
|
705
705
|
S.log("🎨 [CellSelection.render] Rendering range ->", t(this, X));
|
|
706
|
-
const
|
|
706
|
+
const i = t(this, N).querySelectorAll(
|
|
707
707
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
708
708
|
);
|
|
709
|
-
if (
|
|
710
|
-
a.querySelectorAll(".selected, .selected-top, .selected-bottom, .selected-left, .selected-right").forEach((
|
|
711
|
-
|
|
709
|
+
if (i.forEach((a) => {
|
|
710
|
+
a.querySelectorAll(".selected, .selected-top, .selected-bottom, .selected-left, .selected-right").forEach((c) => {
|
|
711
|
+
c.classList.remove("selected", "selected-top", "selected-bottom", "selected-left", "selected-right");
|
|
712
712
|
});
|
|
713
713
|
}), n < 0 || e < 0) {
|
|
714
714
|
S.log("⚠️ [CellSelection.render] Range is invalid (< 0), skipping render.");
|
|
715
715
|
return;
|
|
716
716
|
}
|
|
717
|
-
let
|
|
718
|
-
|
|
719
|
-
a.querySelectorAll("tbody tr").forEach((
|
|
720
|
-
const { matrixRow:
|
|
721
|
-
|
|
717
|
+
let o = 0;
|
|
718
|
+
i.forEach((a) => {
|
|
719
|
+
a.querySelectorAll("tbody tr").forEach((c) => {
|
|
720
|
+
const { matrixRow: l } = V(this, K, qt).call(this, c);
|
|
721
|
+
l < 0 || c.querySelectorAll("td, th").forEach((u) => {
|
|
722
722
|
const f = parseInt(u.dataset.col, 10);
|
|
723
723
|
if (isNaN(f)) return;
|
|
724
|
-
const b = parseInt(u.rowSpan || 1, 10), g = parseInt(u.colSpan || 1, 10), p =
|
|
725
|
-
p >= n &&
|
|
724
|
+
const b = parseInt(u.rowSpan || 1, 10), g = parseInt(u.colSpan || 1, 10), p = l + b - 1, x = f + g - 1;
|
|
725
|
+
p >= n && l <= s && x >= e && f <= r && (o++, u.classList.add("selected"), S.log(u, n, e, s, r), l <= n && u.classList.add("selected-top"), p >= s && u.classList.add("selected-bottom"), f <= e && u.classList.add("selected-left"), x >= r && u.classList.add("selected-right"));
|
|
726
726
|
});
|
|
727
727
|
});
|
|
728
|
-
}), S.log(`✨ [CellSelection.render] Total rendered cells marked: ${
|
|
728
|
+
}), S.log(`✨ [CellSelection.render] Total rendered cells marked: ${o}`);
|
|
729
729
|
}, "render"));
|
|
730
730
|
y(this, N, n), V(this, K, ws).call(this), t(this, N).querySelectorAll(
|
|
731
731
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
@@ -737,13 +737,13 @@ const rs = class rs {
|
|
|
737
737
|
}
|
|
738
738
|
setRange(n, e, s, r) {
|
|
739
739
|
S.log(`🔍 [CellSelection.setRange] Input -> startRow: ${n}, startCol: ${e}, endRow: ${s}, endCol: ${r}`);
|
|
740
|
-
let
|
|
741
|
-
const
|
|
740
|
+
let i = Math.min(n, s), o = Math.max(n, s), a = Math.min(e, r), c = Math.max(e, r);
|
|
741
|
+
const l = t(this, N).querySelectorAll(
|
|
742
742
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
743
743
|
);
|
|
744
744
|
let u = !0, f = 0;
|
|
745
745
|
for (; u && f < 5; )
|
|
746
|
-
u = !1, f++,
|
|
746
|
+
u = !1, f++, l.forEach((b) => {
|
|
747
747
|
b.querySelectorAll("tbody tr").forEach((g) => {
|
|
748
748
|
if (g.classList.contains("nodata")) return;
|
|
749
749
|
const { matrixRow: p } = V(this, K, qt).call(this, g);
|
|
@@ -751,22 +751,22 @@ const rs = class rs {
|
|
|
751
751
|
const w = parseInt(x.dataset.col, 10);
|
|
752
752
|
if (isNaN(w)) return;
|
|
753
753
|
const m = parseInt(x.rowSpan || 1, 10), T = parseInt(x.colSpan || 1, 10), R = p + m - 1, M = w + T - 1;
|
|
754
|
-
if (R >=
|
|
755
|
-
const z = Math.min(
|
|
756
|
-
(z !==
|
|
754
|
+
if (R >= i && p <= o && M >= a && w <= c) {
|
|
755
|
+
const z = Math.min(i, p), Gt = Math.max(o, R), bs = Math.min(a, w), ps = Math.max(c, M);
|
|
756
|
+
(z !== i || Gt !== o || bs !== a || ps !== c) && (i = z, o = Gt, a = bs, c = ps, u = !0);
|
|
757
757
|
}
|
|
758
758
|
});
|
|
759
759
|
});
|
|
760
760
|
});
|
|
761
|
-
y(this, X, { startRow:
|
|
761
|
+
y(this, X, { startRow: i, startCol: a, endRow: o, endCol: c }), S.log("📦 [CellSelection.setRange] Final Range ->", t(this, X)), this.render();
|
|
762
762
|
}
|
|
763
763
|
};
|
|
764
764
|
N = new WeakMap(), X = new WeakMap(), K = new WeakSet(), qt = /* @__PURE__ */ h(function(n) {
|
|
765
765
|
if (!n || n.classList.contains("nodata")) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
|
|
766
766
|
const e = parseInt(n.dataset.row, 10);
|
|
767
767
|
if (isNaN(e)) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
|
|
768
|
-
const s = n.closest("tbody"),
|
|
769
|
-
return { dataRow: e, subRowIndex:
|
|
768
|
+
const s = n.closest("tbody"), i = Array.from(s.querySelectorAll("tr:not(.nodata)")).filter((l) => parseInt(l.dataset.row, 10) === e), o = i.indexOf(n), a = i.length > 0 ? i.length : 1, c = e * a + (o >= 0 ? o : n.sectionRowIndex % a);
|
|
769
|
+
return { dataRow: e, subRowIndex: o, matrixRow: c };
|
|
770
770
|
}, "#getMatrixRow"), ws = /* @__PURE__ */ h(function() {
|
|
771
771
|
const n = t(this, N).querySelector(".ng-container-top");
|
|
772
772
|
if (!n) {
|
|
@@ -778,14 +778,14 @@ N = new WeakMap(), X = new WeakMap(), K = new WeakSet(), qt = /* @__PURE__ */ h(
|
|
|
778
778
|
const s = e.target.closest("td, th");
|
|
779
779
|
if (!s || s.dataset.row === void 0 || s.dataset.col === void 0 || s.closest("tr").classList.contains("nodata")) return;
|
|
780
780
|
t(this, N).style.userSelect = "none", t(this, N).style.webkitUserSelect = "none";
|
|
781
|
-
const r = s.closest("tr"), { matrixRow:
|
|
782
|
-
if (
|
|
781
|
+
const r = s.closest("tr"), { matrixRow: i } = V(this, K, qt).call(this, r), o = parseInt(s.dataset.col, 10);
|
|
782
|
+
if (i < 0) {
|
|
783
783
|
t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "";
|
|
784
784
|
return;
|
|
785
785
|
}
|
|
786
|
-
S.log(`🖱️ [MouseDown Success] startRow: ${
|
|
787
|
-
let a =
|
|
788
|
-
const
|
|
786
|
+
S.log(`🖱️ [MouseDown Success] startRow: ${i}, startCol: ${o}`), t(this, N).navigation.currentCell = s;
|
|
787
|
+
let a = i, c = o;
|
|
788
|
+
const l = /* @__PURE__ */ h((f) => {
|
|
789
789
|
const b = document.elementFromPoint(f.clientX, f.clientY);
|
|
790
790
|
let g = b == null ? void 0 : b.closest("td, th");
|
|
791
791
|
if (!g || !t(this, N).contains(g)) {
|
|
@@ -800,11 +800,11 @@ N = new WeakMap(), X = new WeakMap(), K = new WeakSet(), qt = /* @__PURE__ */ h(
|
|
|
800
800
|
}
|
|
801
801
|
if (!g || g.dataset.row === void 0 || g.dataset.col === void 0 || g.closest("tr").classList.contains("nodata")) return;
|
|
802
802
|
const p = g.closest("tr"), { matrixRow: x } = V(this, K, qt).call(this, p), w = parseInt(g.dataset.col, 10);
|
|
803
|
-
x < 0 || a === x &&
|
|
803
|
+
x < 0 || a === x && c === w || (a = x, c = w, this.setRange(i, o, x, w));
|
|
804
804
|
}, "onMouseMove"), u = /* @__PURE__ */ h(() => {
|
|
805
|
-
S.log("🖱️ [MouseUp] Drag ended."), t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "", document.removeEventListener("mousemove",
|
|
805
|
+
S.log("🖱️ [MouseUp] Drag ended."), t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "", document.removeEventListener("mousemove", l), document.removeEventListener("mouseup", u);
|
|
806
806
|
}, "onMouseUp");
|
|
807
|
-
document.addEventListener("mousemove",
|
|
807
|
+
document.addEventListener("mousemove", l), document.addEventListener("mouseup", u);
|
|
808
808
|
});
|
|
809
809
|
}, "#initEvents"), h(rs, "CellSelection");
|
|
810
810
|
let Le = rs;
|
|
@@ -824,12 +824,12 @@ const os = class os {
|
|
|
824
824
|
const s = t(this, ct).call(this, n);
|
|
825
825
|
if (s.length === 0) return e + 1;
|
|
826
826
|
let r = e + 1;
|
|
827
|
-
const
|
|
828
|
-
s.forEach((
|
|
829
|
-
for (const
|
|
830
|
-
const a = parseInt(
|
|
831
|
-
if (e >= a && e < a +
|
|
832
|
-
r = a +
|
|
827
|
+
const i = [];
|
|
828
|
+
s.forEach((o) => i.push(...Array.from(o.querySelectorAll("td")))), i.sort((o, a) => parseInt(o.dataset.col, 10) - parseInt(a.dataset.col, 10));
|
|
829
|
+
for (const o of i) {
|
|
830
|
+
const a = parseInt(o.dataset.col, 10), c = parseInt(o.colSpan || 1, 10);
|
|
831
|
+
if (e >= a && e < a + c) {
|
|
832
|
+
r = a + c;
|
|
833
833
|
break;
|
|
834
834
|
}
|
|
835
835
|
}
|
|
@@ -839,10 +839,10 @@ const os = class os {
|
|
|
839
839
|
const s = t(this, ct).call(this, n);
|
|
840
840
|
if (s.length === 0) return Math.max(0, e - 1);
|
|
841
841
|
let r = -1;
|
|
842
|
-
const
|
|
843
|
-
s.forEach((
|
|
844
|
-
for (const
|
|
845
|
-
const a = parseInt(
|
|
842
|
+
const i = [];
|
|
843
|
+
s.forEach((o) => i.push(...Array.from(o.querySelectorAll("td")))), i.sort((o, a) => parseInt(o.dataset.col, 10) - parseInt(a.dataset.col, 10));
|
|
844
|
+
for (const o of i) {
|
|
845
|
+
const a = parseInt(o.dataset.col, 10);
|
|
846
846
|
if (a < e)
|
|
847
847
|
r = a;
|
|
848
848
|
else
|
|
@@ -856,19 +856,19 @@ const os = class os {
|
|
|
856
856
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
857
857
|
), s = [];
|
|
858
858
|
return e.forEach((r) => {
|
|
859
|
-
const
|
|
860
|
-
for (const
|
|
861
|
-
const a = parseInt(
|
|
859
|
+
const i = Array.from(r.querySelectorAll("tbody tr:not(.nodata)"));
|
|
860
|
+
for (const o of i) {
|
|
861
|
+
const a = parseInt(o.dataset.row, 10), c = i.filter((p) => parseInt(p.dataset.row, 10) === a), l = c.length > 0 ? c.length : 1, u = c.indexOf(o), f = a * l + (u >= 0 ? u : 0);
|
|
862
862
|
if (f === n) {
|
|
863
|
-
s.push(
|
|
863
|
+
s.push(o);
|
|
864
864
|
break;
|
|
865
865
|
}
|
|
866
|
-
const b = Array.from(
|
|
866
|
+
const b = Array.from(o.querySelectorAll("td"));
|
|
867
867
|
let g = !1;
|
|
868
868
|
for (const p of b) {
|
|
869
869
|
const x = parseInt(p.rowSpan || 1, 10);
|
|
870
870
|
if (x > 1 && n >= f && n < f + x) {
|
|
871
|
-
s.push(
|
|
871
|
+
s.push(o), g = !0;
|
|
872
872
|
break;
|
|
873
873
|
}
|
|
874
874
|
}
|
|
@@ -878,16 +878,16 @@ const os = class os {
|
|
|
878
878
|
}, "#findTargetTrsByMatrix"));
|
|
879
879
|
// 🎯 rowSpan 및 colSpan 경계를 모두 충족하는 셀을 3분할 전체 영역에서 탐색
|
|
880
880
|
d(this, Wt, /* @__PURE__ */ h((n, e, s, r) => {
|
|
881
|
-
const
|
|
881
|
+
const i = t(this, F).querySelectorAll(
|
|
882
882
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
883
|
-
),
|
|
884
|
-
for (const a of
|
|
885
|
-
const
|
|
886
|
-
for (const
|
|
887
|
-
const u = parseInt(
|
|
883
|
+
), o = r !== void 0 ? r : n * 1 + e;
|
|
884
|
+
for (const a of i) {
|
|
885
|
+
const c = Array.from(a.querySelectorAll("tbody tr:not(.nodata)"));
|
|
886
|
+
for (const l of c) {
|
|
887
|
+
const u = parseInt(l.dataset.row, 10), f = c.filter((w) => parseInt(w.dataset.row, 10) === u), b = f.length > 0 ? f.length : 1, g = f.indexOf(l), p = u * b + (g >= 0 ? g : 0), x = Array.from(l.querySelectorAll("td"));
|
|
888
888
|
for (const w of x) {
|
|
889
889
|
const m = parseInt(w.dataset.col, 10), T = parseInt(w.colSpan || 1, 10), R = parseInt(w.rowSpan || 1, 10);
|
|
890
|
-
if (!isNaN(m) && s >= m && s < m + T &&
|
|
890
|
+
if (!isNaN(m) && s >= m && s < m + T && o >= p && o < p + R && window.getComputedStyle(w).display !== "none")
|
|
891
891
|
return w;
|
|
892
892
|
}
|
|
893
893
|
}
|
|
@@ -905,9 +905,9 @@ const os = class os {
|
|
|
905
905
|
const e = parseInt(n.dataset.row, 10), s = parseInt(n.dataset.col, 10);
|
|
906
906
|
if (!isNaN(e) && !isNaN(s)) {
|
|
907
907
|
y(this, ae, e), y(this, le, s);
|
|
908
|
-
const r = n.closest("tr"),
|
|
909
|
-
if (
|
|
910
|
-
const a = Array.from(
|
|
908
|
+
const r = n.closest("tr"), i = r == null ? void 0 : r.closest("tbody");
|
|
909
|
+
if (i) {
|
|
910
|
+
const a = Array.from(i.querySelectorAll("tr:not(.nodata)")).filter((f) => parseInt(f.dataset.row, 10) === e), c = a.length > 0 ? a.length : 1, l = a.indexOf(r), u = e * c + (l >= 0 ? l : 0);
|
|
911
911
|
t(this, F).selection.setRange(u, s, u, s);
|
|
912
912
|
}
|
|
913
913
|
}
|
|
@@ -915,29 +915,29 @@ const os = class os {
|
|
|
915
915
|
moveCell(n) {
|
|
916
916
|
var m, T, R, M;
|
|
917
917
|
if (!t(this, lt)) return;
|
|
918
|
-
const e = t(this, lt), s = e.closest("tr"), r = parseInt(e.dataset.row, 10),
|
|
919
|
-
if (!
|
|
920
|
-
const
|
|
921
|
-
let b = f, g =
|
|
918
|
+
const e = t(this, lt), s = e.closest("tr"), r = parseInt(e.dataset.row, 10), i = parseInt(e.dataset.col, 10), o = s == null ? void 0 : s.closest("tbody");
|
|
919
|
+
if (!o) return;
|
|
920
|
+
const c = Array.from(o.querySelectorAll("tr:not(.nodata)")).filter((B) => parseInt(B.dataset.row, 10) === r), l = c.length > 0 ? c.length : 1, u = c.indexOf(s), f = r * l + (u >= 0 ? u : 0);
|
|
921
|
+
let b = f, g = i;
|
|
922
922
|
switch (n.code) {
|
|
923
923
|
case "Tab":
|
|
924
924
|
if (n.preventDefault(), n.shiftKey) {
|
|
925
|
-
if (g = t(this, Bt).call(this, f,
|
|
925
|
+
if (g = t(this, Bt).call(this, f, i), g < 0 && f > 0) {
|
|
926
926
|
b = f - 1;
|
|
927
927
|
const B = t(this, ct).call(this, b), z = t(this, Ot).call(this, B);
|
|
928
928
|
g = z ? parseInt(z.dataset.col, 10) : 0;
|
|
929
929
|
}
|
|
930
930
|
} else {
|
|
931
|
-
g = t(this, Dt).call(this, f,
|
|
931
|
+
g = t(this, Dt).call(this, f, i);
|
|
932
932
|
const B = t(this, ct).call(this, f), z = t(this, Ot).call(this, B), Gt = z ? parseInt(z.dataset.col, 10) + parseInt(z.colSpan || 1, 10) : 0;
|
|
933
933
|
g >= Gt && (b = f + 1, g = 0);
|
|
934
934
|
}
|
|
935
935
|
break;
|
|
936
936
|
case "ArrowRight":
|
|
937
|
-
g = t(this, Dt).call(this, f,
|
|
937
|
+
g = t(this, Dt).call(this, f, i);
|
|
938
938
|
break;
|
|
939
939
|
case "ArrowLeft":
|
|
940
|
-
g = t(this, Bt).call(this, f,
|
|
940
|
+
g = t(this, Bt).call(this, f, i);
|
|
941
941
|
break;
|
|
942
942
|
case "ArrowDown":
|
|
943
943
|
n.preventDefault(), b = f + (e.rowSpan || 1);
|
|
@@ -946,7 +946,7 @@ const os = class os {
|
|
|
946
946
|
n.preventDefault(), b = Math.max(0, f - (e.rowSpan || 1));
|
|
947
947
|
break;
|
|
948
948
|
}
|
|
949
|
-
const p = Math.floor(b /
|
|
949
|
+
const p = Math.floor(b / l), x = b % l;
|
|
950
950
|
let w = t(this, Wt).call(this, p, x, g, b);
|
|
951
951
|
if (w)
|
|
952
952
|
this.currentCell = w, V(this, pt, He).call(this, w);
|
|
@@ -986,10 +986,10 @@ const Ct = class Ct extends HTMLElement {
|
|
|
986
986
|
q(this, "generate", /* @__PURE__ */ h((e) => {
|
|
987
987
|
if (S.log("sheet.generate()"), !e) return;
|
|
988
988
|
y(this, ht, Ie.compile(e)), t(this, he).call(this), t(this, de).call(this);
|
|
989
|
-
const s = this.querySelector(".ng-container-body .ng-part-header"), r = this.querySelector(".ng-container-body .ng-part-footer"),
|
|
990
|
-
s &&
|
|
991
|
-
var
|
|
992
|
-
(
|
|
989
|
+
const s = this.querySelector(".ng-container-body .ng-part-header"), r = this.querySelector(".ng-container-body .ng-part-footer"), i = this.querySelector(".ng-nodata-overlay");
|
|
990
|
+
s && i && (i.style.top = `${s.offsetHeight}px`), r && i && (i.style.bottom = `${r.offsetHeight}px`), t(this, dt).initialize(), setTimeout(() => {
|
|
991
|
+
var o;
|
|
992
|
+
(o = this.querySelector("nine-table-hscrollbar")) == null || o.refresh();
|
|
993
993
|
}, 0);
|
|
994
994
|
}, "generate"));
|
|
995
995
|
d(this, he, /* @__PURE__ */ h(() => {
|
|
@@ -998,40 +998,40 @@ const Ct = class Ct extends HTMLElement {
|
|
|
998
998
|
{ selector: ".ng-container-left", type: "left" },
|
|
999
999
|
{ selector: ".ng-container-right", type: "right" }
|
|
1000
1000
|
].forEach(({ selector: s, type: r }) => {
|
|
1001
|
-
var
|
|
1002
|
-
(
|
|
1001
|
+
var i, o, a;
|
|
1002
|
+
(i = this.querySelector(`${s} .ng-part-header`)) == null || i.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")), (a = this.querySelector(`${s} .ng-part-footer`)) == null || a.appendChild(t(this, xt).call(this, t(this, ht), r, "footer"));
|
|
1003
1003
|
});
|
|
1004
1004
|
}, "#renderSplitContainers"));
|
|
1005
1005
|
d(this, de, /* @__PURE__ */ h(() => {
|
|
1006
1006
|
["left", "right", "body"].forEach((e) => {
|
|
1007
1007
|
const s = this.querySelector(`.ng-container-${e}`), r = s == null ? void 0 : s.querySelectorAll("table");
|
|
1008
1008
|
if (!s || !r || r.length === 0) return;
|
|
1009
|
-
let
|
|
1010
|
-
r[0].querySelectorAll("col").forEach((
|
|
1011
|
-
const a = parseInt(
|
|
1012
|
-
isNaN(a) || (
|
|
1013
|
-
}), e === "body" ? (s.style.flex = "1", r.forEach((
|
|
1014
|
-
|
|
1015
|
-
})) : (s.style.flex = `0 0 ${
|
|
1016
|
-
|
|
1009
|
+
let i = 0;
|
|
1010
|
+
r[0].querySelectorAll("col").forEach((o) => {
|
|
1011
|
+
const a = parseInt(o.getAttribute("width"), 10);
|
|
1012
|
+
isNaN(a) || (i += a);
|
|
1013
|
+
}), e === "body" ? (s.style.flex = "1", r.forEach((o) => {
|
|
1014
|
+
o.style.width = `${i}px`, o.style.minWidth = `${i}px`;
|
|
1015
|
+
})) : (s.style.flex = `0 0 ${i}px`, s.style.width = `${i}px`, r.forEach((o) => {
|
|
1016
|
+
o.style.width = `${i}px`, o.style.minWidth = `${i}px`;
|
|
1017
1017
|
}));
|
|
1018
1018
|
});
|
|
1019
1019
|
}, "#updateContainerWidths"));
|
|
1020
1020
|
d(this, xt, /* @__PURE__ */ h((e, s, r) => {
|
|
1021
|
-
const
|
|
1021
|
+
const i = e.cloneNode(!0), o = i.querySelector("thead"), a = i.querySelector("tbody"), c = i.querySelector("tfoot");
|
|
1022
1022
|
if (r === "header") {
|
|
1023
|
-
if (a && a.remove(),
|
|
1023
|
+
if (a && a.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
1024
1024
|
const u = document.createElement("tbody");
|
|
1025
|
-
u.className = "fixed-tbody",
|
|
1025
|
+
u.className = "fixed-tbody", i.appendChild(u);
|
|
1026
1026
|
}
|
|
1027
|
-
} else r === "body" ? (
|
|
1028
|
-
return s === "left" ?
|
|
1029
|
-
|
|
1030
|
-
}) : s === "right" ?
|
|
1031
|
-
|
|
1032
|
-
}) :
|
|
1033
|
-
|
|
1034
|
-
}),
|
|
1027
|
+
} else r === "body" ? (o && o.remove(), c && c.remove(), a && (a.className = "bindable-tbody")) : r === "footer" && (o && o.remove(), a && a.remove());
|
|
1028
|
+
return s === "left" ? i.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
1029
|
+
l.getAttribute("fixed") !== "left" && l.remove();
|
|
1030
|
+
}) : s === "right" ? i.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
1031
|
+
l.getAttribute("fixed") !== "right" && l.remove();
|
|
1032
|
+
}) : i.querySelectorAll("[fixed=left], [fixed=right]").forEach((l) => {
|
|
1033
|
+
l.remove();
|
|
1034
|
+
}), i;
|
|
1035
1035
|
}, "#createSplitTable"));
|
|
1036
1036
|
q(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, dt).getRowHeight(), "getRowHeight"));
|
|
1037
1037
|
q(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
@@ -1272,9 +1272,9 @@ const is = class is extends HTMLElement {
|
|
|
1272
1272
|
d(this, ue, /* @__PURE__ */ h(() => {
|
|
1273
1273
|
var e;
|
|
1274
1274
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
1275
|
-
var
|
|
1276
|
-
const r = s.ctrlKey || s.metaKey || s.shiftKey,
|
|
1277
|
-
t(this, Ft).call(this,
|
|
1275
|
+
var o;
|
|
1276
|
+
const r = s.ctrlKey || s.metaKey || s.shiftKey, i = parseInt((o = s.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
|
|
1277
|
+
t(this, Ft).call(this, i, r);
|
|
1278
1278
|
}), t(this, Ft).call(this, 0, !1);
|
|
1279
1279
|
}, "#init"));
|
|
1280
1280
|
d(this, Ft, /* @__PURE__ */ h((e, s = !1) => {
|
|
@@ -1286,26 +1286,26 @@ const is = class is extends HTMLElement {
|
|
|
1286
1286
|
const p = parseInt(g.getAttribute("data-index"), 10), x = this.querySelector(`nine-splitter[data-split-index="${p}"]`), w = u[p + 1];
|
|
1287
1287
|
x && w && w.classList.contains("active") && x.style.setProperty("display", "flex");
|
|
1288
1288
|
});
|
|
1289
|
-
}, "updateSplitters"),
|
|
1289
|
+
}, "updateSplitters"), i = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = i.querySelectorAll(".nine-tab-item"), c = o.querySelectorAll("nine-table-sheet");
|
|
1290
1290
|
if (!a[e]) return;
|
|
1291
1291
|
if (!s)
|
|
1292
1292
|
a.forEach((u, f) => {
|
|
1293
1293
|
u.classList.toggle("active", f === e);
|
|
1294
|
-
}),
|
|
1294
|
+
}), c.forEach((u, f) => {
|
|
1295
1295
|
const b = f === e;
|
|
1296
1296
|
u.classList.toggle("active", b), u.style.flex = b ? "1 1 100%" : "";
|
|
1297
1297
|
});
|
|
1298
1298
|
else {
|
|
1299
|
-
const u = a[e], f =
|
|
1299
|
+
const u = a[e], f = i.querySelectorAll(".nine-tab-item.active");
|
|
1300
1300
|
if (u.classList.contains("active") && f.length <= 1)
|
|
1301
1301
|
return;
|
|
1302
1302
|
u.classList.toggle("active");
|
|
1303
|
-
const b =
|
|
1303
|
+
const b = o.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
1304
1304
|
b && (b.classList.toggle("active"), b.classList.contains("active") || (b.style.flex = ""));
|
|
1305
1305
|
}
|
|
1306
|
-
const
|
|
1307
|
-
|
|
1308
|
-
u.style.flex =
|
|
1306
|
+
const l = o.querySelectorAll("nine-table-sheet.active");
|
|
1307
|
+
l == null || l.forEach((u) => {
|
|
1308
|
+
u.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
1309
1309
|
}), r();
|
|
1310
1310
|
}, "#switchSheet"));
|
|
1311
1311
|
}
|
|
@@ -1327,17 +1327,17 @@ const as = class as {
|
|
|
1327
1327
|
}).observe(t(this, _));
|
|
1328
1328
|
}, "#init"));
|
|
1329
1329
|
d(this, jt, /* @__PURE__ */ h(() => {
|
|
1330
|
-
var
|
|
1330
|
+
var c, l;
|
|
1331
1331
|
const n = Array.from(t(this, _).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
1332
1332
|
if (n.length === 0) return;
|
|
1333
|
-
const e = parseInt(t(this, _).getAttribute("max-display-row"), 10) || 10, s = Math.max(...n.map((u) => u.getRowHeight())), r = (
|
|
1333
|
+
const e = parseInt(t(this, _).getAttribute("max-display-row"), 10) || 10, s = Math.max(...n.map((u) => u.getRowHeight())), r = (c = t(this, _).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, i = (l = t(this, _).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = Zt.SCROLLBAR_SIZE, a = e * s + r + i + o;
|
|
1334
1334
|
t(this, _).style.height = `${a}px`;
|
|
1335
1335
|
}, "#applyAutoHeight"));
|
|
1336
1336
|
d(this, pe, /* @__PURE__ */ h(() => {
|
|
1337
|
-
const e = Array.from(t(this, _).children).filter((
|
|
1338
|
-
const f = `<nine-table-sheet class="${
|
|
1337
|
+
const e = Array.from(t(this, _).children).filter((c) => c.tagName === "TABLE"), s = t(this, _).getAttribute("auto-height") === "true", r = e.length, i = e.map((c, l) => {
|
|
1338
|
+
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>` : "";
|
|
1339
1339
|
return f + b;
|
|
1340
|
-
}).join(""),
|
|
1340
|
+
}).join(""), o = e.map((c, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
1341
1341
|
t(this, _).shadowRoot.innerHTML = `
|
|
1342
1342
|
<style>
|
|
1343
1343
|
:host {
|
|
@@ -1449,9 +1449,9 @@ const as = class as {
|
|
|
1449
1449
|
<nine-table-body>
|
|
1450
1450
|
<nine-table-summary></nine-table-summary>
|
|
1451
1451
|
<nine-table-sheets>
|
|
1452
|
-
<nine-table-sheets-body>${
|
|
1452
|
+
<nine-table-sheets-body>${i}</nine-table-sheets-body>
|
|
1453
1453
|
<nine-table-sheets-footer>
|
|
1454
|
-
<div class="nine-tab-bar">${
|
|
1454
|
+
<div class="nine-tab-bar">${o}</div>
|
|
1455
1455
|
<div class="sheets-counter">Total : <span id="row-count">0</span></div>
|
|
1456
1456
|
</nine-table-sheets-footer>
|
|
1457
1457
|
</nine-table-sheets>
|
|
@@ -1460,9 +1460,9 @@ const as = class as {
|
|
|
1460
1460
|
<nine-table-footer></nine-table-footer>
|
|
1461
1461
|
`, t(this, _).shadowRoot.querySelector("nine-table-sheets").classList.add("nodata");
|
|
1462
1462
|
const a = t(this, _).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1463
|
-
a == null || a.forEach((
|
|
1464
|
-
e[
|
|
1465
|
-
|
|
1463
|
+
a == null || a.forEach((c, l) => {
|
|
1464
|
+
e[l] && setTimeout(() => {
|
|
1465
|
+
c.generate(e[l]), s && t(this, jt).call(this);
|
|
1466
1466
|
});
|
|
1467
1467
|
});
|
|
1468
1468
|
}, "#render"));
|
|
@@ -1515,15 +1515,15 @@ const P = class P {
|
|
|
1515
1515
|
});
|
|
1516
1516
|
}, "#invalidate"));
|
|
1517
1517
|
q(this, "get", /* @__PURE__ */ h((n, e) => {
|
|
1518
|
-
var
|
|
1518
|
+
var i;
|
|
1519
1519
|
const s = this.getValidData();
|
|
1520
1520
|
if (!s || s.length <= 0) return;
|
|
1521
1521
|
if (n == null) return t(this, St).call(this, s);
|
|
1522
1522
|
if (n < 0 || n >= s.length) return null;
|
|
1523
|
-
const r = typeof ((
|
|
1523
|
+
const r = typeof ((i = t(this, D).fields) == null ? void 0 : i.get) == "function" ? t(this, D).fields.get() : [];
|
|
1524
1524
|
if (e != null) {
|
|
1525
|
-
const
|
|
1526
|
-
return
|
|
1525
|
+
const o = r.indexOf(e);
|
|
1526
|
+
return o >= 0 ? s[n].v[o] : null;
|
|
1527
1527
|
}
|
|
1528
1528
|
return t(this, St).call(this, s[n]);
|
|
1529
1529
|
}, "get"));
|
|
@@ -1550,11 +1550,11 @@ const P = class P {
|
|
|
1550
1550
|
var r;
|
|
1551
1551
|
Array.isArray(n) || (n = [n]);
|
|
1552
1552
|
const e = typeof ((r = t(this, D).fields) == null ? void 0 : r.get) == "function" ? t(this, D).fields.get() : Object.keys(n[0] || {}), s = [];
|
|
1553
|
-
return n.forEach((
|
|
1554
|
-
const
|
|
1553
|
+
return n.forEach((i) => {
|
|
1554
|
+
const o = { v: [] };
|
|
1555
1555
|
e.forEach((a) => {
|
|
1556
|
-
|
|
1557
|
-
}), s.push(
|
|
1556
|
+
o.v.push(i[a] !== void 0 && i[a] !== null ? i[a] : "");
|
|
1557
|
+
}), s.push(o);
|
|
1558
1558
|
}), s;
|
|
1559
1559
|
}, "#json2Array"));
|
|
1560
1560
|
d(this, we, /* @__PURE__ */ h((n) => (Array.isArray(n) || (n = [n]), n.forEach((e) => {
|
|
@@ -1565,8 +1565,8 @@ const P = class P {
|
|
|
1565
1565
|
const s = t(this, xe).call(this, n);
|
|
1566
1566
|
t(this, I).rawRecords = t(this, I).rawRecords.concat(t(this, we).call(this, s)), this.resetRecords();
|
|
1567
1567
|
const r = this.count() - 1;
|
|
1568
|
-
return e || s.forEach((
|
|
1569
|
-
const a = t(this, I).rawRecords[r -
|
|
1568
|
+
return e || s.forEach((i, o) => {
|
|
1569
|
+
const a = t(this, I).rawRecords[r - o];
|
|
1570
1570
|
a && (a.__ng.rowState = P.ROW_STATE.EMPTY);
|
|
1571
1571
|
}), t(this, ft).call(this), r;
|
|
1572
1572
|
}, "add"));
|
|
@@ -1575,21 +1575,21 @@ const P = class P {
|
|
|
1575
1575
|
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) => {
|
|
1576
1576
|
if (t(this, W)[s]) {
|
|
1577
1577
|
const r = t(this, W)[s].__ng.rowid;
|
|
1578
|
-
t(this, W)[s].__ng.rowState === P.ROW_STATE.INSERT ? t(this, I).rawRecords = t(this, I).rawRecords.filter((
|
|
1579
|
-
|
|
1578
|
+
t(this, W)[s].__ng.rowState === P.ROW_STATE.INSERT ? t(this, I).rawRecords = t(this, I).rawRecords.filter((i) => i.__ng.rowid !== r) : t(this, I).rawRecords.forEach((i) => {
|
|
1579
|
+
i.__ng.rowid === r && (i.__ng.deleted = !0, i.__ng.rowState = P.ROW_STATE.DELETE);
|
|
1580
1580
|
});
|
|
1581
1581
|
}
|
|
1582
1582
|
}), this.resetRecords(), t(this, ft).call(this);
|
|
1583
1583
|
}, "delete"));
|
|
1584
1584
|
q(this, "setValue", /* @__PURE__ */ h((n, e, s) => {
|
|
1585
|
-
var
|
|
1585
|
+
var c;
|
|
1586
1586
|
n = parseInt(n, 10);
|
|
1587
|
-
const
|
|
1588
|
-
if (
|
|
1589
|
-
const
|
|
1590
|
-
if (!
|
|
1591
|
-
const a =
|
|
1592
|
-
a !== s &&
|
|
1587
|
+
const i = (typeof ((c = t(this, D).fields) == null ? void 0 : c.get) == "function" ? t(this, D).fields.get() : []).indexOf(e);
|
|
1588
|
+
if (i < 0) return;
|
|
1589
|
+
const o = this.getValidData()[n];
|
|
1590
|
+
if (!o) return;
|
|
1591
|
+
const a = o.v[i];
|
|
1592
|
+
a !== s && o.__ng.rowState !== P.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = a), o.__ng.rowState = P.ROW_STATE.UPDATE), o.v[i] = s;
|
|
1593
1593
|
}, "setValue"));
|
|
1594
1594
|
q(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1595
1595
|
y(this, vt, t(this, I).rawRecords.filter((n) => !n.__ng.deleted)), y(this, W, t(this, I).rawRecords.filter((n) => !n.__ng.deleted && !n.__ng.filtered)), t(this, I).rawRecords.forEach((n, e) => {
|
|
@@ -1600,15 +1600,15 @@ const P = class P {
|
|
|
1600
1600
|
}, "resetRecords"));
|
|
1601
1601
|
q(this, "getValidData", /* @__PURE__ */ h(() => (t(this, W).length === 0 && t(this, I).rawRecords.length > 0 && this.resetRecords(), t(this, W)), "getValidData"));
|
|
1602
1602
|
d(this, St, /* @__PURE__ */ h((n) => {
|
|
1603
|
-
var
|
|
1603
|
+
var o;
|
|
1604
1604
|
if (!n) return n;
|
|
1605
|
-
const e = !Array.isArray(n), s = e ? [n] : n, r = typeof ((
|
|
1606
|
-
const
|
|
1607
|
-
return r.forEach((
|
|
1608
|
-
l
|
|
1609
|
-
}),
|
|
1605
|
+
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() : [], i = s.filter((a) => !a.__ng.deleted).map((a) => {
|
|
1606
|
+
const c = {};
|
|
1607
|
+
return r.forEach((l, u) => {
|
|
1608
|
+
c[l] = a.v ? a.v[u] : a[l];
|
|
1609
|
+
}), c.__ng = a.__ng, c;
|
|
1610
1610
|
});
|
|
1611
|
-
return e ?
|
|
1611
|
+
return e ? i[0] : i;
|
|
1612
1612
|
}, "#conv"));
|
|
1613
1613
|
q(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1614
1614
|
y(this, D, n), y(this, I, e), t(this, me).call(this);
|
|
@@ -1651,10 +1651,10 @@ const cs = class cs {
|
|
|
1651
1651
|
}, this.setDataSource = (e) => {
|
|
1652
1652
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1653
1653
|
}, this.getRowState = (e) => {
|
|
1654
|
-
var r,
|
|
1654
|
+
var r, i;
|
|
1655
1655
|
const s = parseInt(e, 10);
|
|
1656
1656
|
if (!(s >= this.data.count()))
|
|
1657
|
-
return (
|
|
1657
|
+
return (i = (r = this.data.getValidData()[s]) == null ? void 0 : r.__ng) == null ? void 0 : i.rowState;
|
|
1658
1658
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1659
1659
|
this.row.at = e;
|
|
1660
1660
|
}, 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) => {
|
|
@@ -1687,25 +1687,25 @@ const hs = class hs {
|
|
|
1687
1687
|
if (!(!n || n.length === 0)) {
|
|
1688
1688
|
for (const e of n)
|
|
1689
1689
|
S.log(e), $("[data-bind]", e).each((s, r) => {
|
|
1690
|
-
const
|
|
1691
|
-
|
|
1690
|
+
const i = r.dataset.bind, o = r.getAttribute("data-type") || "string";
|
|
1691
|
+
i && t(this, H).push({ name: i, type: o });
|
|
1692
1692
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
1693
|
-
$(`[${s}]`, e).each((r,
|
|
1694
|
-
var
|
|
1695
|
-
if (
|
|
1696
|
-
const a =
|
|
1693
|
+
$(`[${s}]`, e).each((r, i) => {
|
|
1694
|
+
var o = i.getAttribute(s);
|
|
1695
|
+
if (o.indexOf("data.") < 0) {
|
|
1696
|
+
const a = o.search(/[(]/g);
|
|
1697
1697
|
if (a > 0)
|
|
1698
1698
|
try {
|
|
1699
|
-
|
|
1699
|
+
o = String(window[o.substring(0, a).trim()]);
|
|
1700
1700
|
} catch {
|
|
1701
|
-
|
|
1701
|
+
o = "";
|
|
1702
1702
|
}
|
|
1703
1703
|
}
|
|
1704
|
-
|
|
1704
|
+
o.split("data.").forEach((a) => {
|
|
1705
1705
|
if (a.trim() != "") {
|
|
1706
|
-
const
|
|
1707
|
-
let
|
|
1708
|
-
|
|
1706
|
+
const c = a.search(/[^_A-Za-z0-9]/g);
|
|
1707
|
+
let l = "";
|
|
1708
|
+
c >= 0 ? l = a.substring(0, c) : o.startsWith("data.") && (l = a.replace("data.", "")), l && t(this, H).push({ name: l, type: "string" });
|
|
1709
1709
|
}
|
|
1710
1710
|
});
|
|
1711
1711
|
});
|
|
@@ -1824,32 +1824,32 @@ const fs = class fs extends ze {
|
|
|
1824
1824
|
var R = ninegrid.j.querySelectorAll(T).attr("suppress");
|
|
1825
1825
|
R && T.dataset.row && (R = parseInt(R), !isNaN(R) && R <= e && r.push(R));
|
|
1826
1826
|
}), r.sort();
|
|
1827
|
-
var
|
|
1827
|
+
var i = !1;
|
|
1828
1828
|
if (parseInt(s.sectionRowIndex / t(this, L).template.length) > 0)
|
|
1829
|
-
for (var
|
|
1830
|
-
if (
|
|
1831
|
-
var a = parseInt(t(this, v).dataset.row),
|
|
1829
|
+
for (var o of r) {
|
|
1830
|
+
if (o > e) break;
|
|
1831
|
+
var a = parseInt(t(this, v).dataset.row), c = a - 1, l = t(this, v).closest("tr").data, u = t(this, L).data.get(c);
|
|
1832
1832
|
t(this, v).dataset.matrixRow;
|
|
1833
|
-
var f = t(this, L).body.querySelector(`tbody.bindable [suppress="${
|
|
1833
|
+
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, a) : l[f.dataset.bind], g = f.dataset.expr ? this.getExprValue(f.dataset.expr, u, c) : u[f.dataset.bind];
|
|
1834
1834
|
if (b != g) {
|
|
1835
|
-
|
|
1835
|
+
i = !0;
|
|
1836
1836
|
break;
|
|
1837
1837
|
}
|
|
1838
1838
|
}
|
|
1839
1839
|
else
|
|
1840
|
-
|
|
1841
|
-
|
|
1840
|
+
i = !0;
|
|
1841
|
+
i ? ninegrid.j.querySelectorAll(t(this, v)).removeClass("suppress") : ninegrid.j.querySelectorAll(t(this, v)).addClass("suppress"), ninegrid.j.querySelectorAll(t(this, v)).hasClass("hidden") || (i ? ninegrid.j.querySelectorAll(t(this, v)).removeClass("hidden") : ninegrid.j.querySelectorAll(t(this, v)).addClass("hidden"));
|
|
1842
1842
|
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}"]`);
|
|
1843
1843
|
$(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");
|
|
1844
1844
|
}
|
|
1845
1845
|
}
|
|
1846
1846
|
}, "#resetSuppress"));
|
|
1847
|
-
q(this, "getExprValue", /* @__PURE__ */ h((e, s, r,
|
|
1847
|
+
q(this, "getExprValue", /* @__PURE__ */ h((e, s, r, i) => {
|
|
1848
1848
|
if (typeof e < "u")
|
|
1849
1849
|
try {
|
|
1850
1850
|
r = parseInt(r);
|
|
1851
|
-
const
|
|
1852
|
-
return t(this, L)[
|
|
1851
|
+
const o = e.replace("()", "");
|
|
1852
|
+
return t(this, L)[o] ? t(this, L)[o].call(this, s, r, t(this, v)) : t(this, L).exprFunction(e).call(this, s, r, t(this, L).data);
|
|
1853
1853
|
} catch {
|
|
1854
1854
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1855
1855
|
}
|
|
@@ -1942,8 +1942,8 @@ const us = class us extends Fe {
|
|
|
1942
1942
|
d(this, Qe, /* @__PURE__ */ h((e) => {
|
|
1943
1943
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1944
1944
|
if (t(this, bt) == "number") {
|
|
1945
|
-
let
|
|
1946
|
-
if (t(this, Q) && Number(t(this, Q)) > 0 &&
|
|
1945
|
+
let i = [];
|
|
1946
|
+
if (t(this, Q) && Number(t(this, Q)) > 0 && i.push("."), t(this, Et) && Number(t(this, Et)) >= 0 && i.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !i.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) {
|
|
1947
1947
|
var s = e.target.value, r = s.indexOf(".");
|
|
1948
1948
|
if (r >= 0) {
|
|
1949
1949
|
var s = s.substr(r + 1, s.length);
|