@ninebone/table 0.0.778 β 0.0.780
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 +189 -191
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +5 -5
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -22,7 +22,7 @@ const ts = class ts extends Rs.constructor {
|
|
|
22
22
|
};
|
|
23
23
|
h(ts, "Trace");
|
|
24
24
|
let qe = ts;
|
|
25
|
-
const
|
|
25
|
+
const S = new qe();
|
|
26
26
|
var j, G, E, tt, et, st, Jt, nt, Qt;
|
|
27
27
|
const es = class es extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
@@ -53,13 +53,13 @@ const es = class es extends HTMLElement {
|
|
|
53
53
|
}
|
|
54
54
|
const l = r.clientWidth;
|
|
55
55
|
if (l <= 0) return;
|
|
56
|
-
const
|
|
57
|
-
i.style.width = `${
|
|
56
|
+
const g = Math.max(Math.min(l * (a / c), l), 20);
|
|
57
|
+
i.style.width = `${g}px`;
|
|
58
58
|
const f = e.scrollLeft, b = c - a;
|
|
59
|
-
let
|
|
60
|
-
b > 0 && (
|
|
61
|
-
const p = l -
|
|
62
|
-
|
|
59
|
+
let u = 0;
|
|
60
|
+
b > 0 && (u = parseInt(f / b * (l - g), 10)), u < 0 && (u = 0);
|
|
61
|
+
const p = l - g;
|
|
62
|
+
u > p && (u = p), i.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;
|
|
@@ -212,7 +212,7 @@ const ss = class ss extends HTMLElement {
|
|
|
212
212
|
d(this, kt, 0);
|
|
213
213
|
d(this, It, 0);
|
|
214
214
|
q(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
|
-
if (
|
|
215
|
+
if (S.log("vscrollbar.refresh"), !t(this, rt) || !t(this, k)) return;
|
|
216
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
217
|
if (c <= i || o === 0) {
|
|
218
218
|
this.style.display = "none";
|
|
@@ -221,17 +221,17 @@ const ss = class ss extends HTMLElement {
|
|
|
221
221
|
this.style.display = "flex";
|
|
222
222
|
const l = s.clientHeight;
|
|
223
223
|
if (l <= 0) return;
|
|
224
|
-
const
|
|
225
|
-
r.style.height = `${
|
|
224
|
+
const g = Math.max(Math.min(l * (i / c), l), 20);
|
|
225
|
+
r.style.height = `${g}px`;
|
|
226
226
|
const f = e.scrollTop, b = Math.max(c - i, 1);
|
|
227
|
-
|
|
228
|
-
let
|
|
229
|
-
b > 0 && (
|
|
230
|
-
const p = l -
|
|
231
|
-
|
|
227
|
+
S.log(e, f, b);
|
|
228
|
+
let u = 0;
|
|
229
|
+
b > 0 && (u = f / b * (l - g));
|
|
230
|
+
const p = l - g;
|
|
231
|
+
u < 0 && (u = 0), u > p && (u = p), r.style.top = `${u}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
236
|
const i = (t(this, rt).data.get() || []).length, o = t(this, ot).getRowHeight();
|
|
237
237
|
return i * o;
|
|
@@ -241,11 +241,11 @@ const ss = class ss extends HTMLElement {
|
|
|
241
241
|
r.stopPropagation(), r.preventDefault(), y(this, yt, !0), y(this, kt, r.clientY), y(this, It, e.scrollTop);
|
|
242
242
|
const i = /* @__PURE__ */ h((a) => {
|
|
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 = a.clientY - t(this, kt),
|
|
244
|
+
const c = t(this, k).track.getBoundingClientRect(), l = t(this, k).thumb.clientHeight, f = c.height - l, b = a.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;
|
|
248
|
-
const T = Math.max(0, p -
|
|
248
|
+
const T = Math.max(0, p - u);
|
|
249
249
|
m < 0 && (m = 0), m > T && (m = T), e.scrollTop = m;
|
|
250
250
|
}
|
|
251
251
|
this.refresh();
|
|
@@ -255,10 +255,10 @@ const ss = class ss extends HTMLElement {
|
|
|
255
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 i = t(this, k).track.getBoundingClientRect(), o = t(this, k).thumb.clientHeight, a = r.clientY - i.top - o / 2, l = i.height - o,
|
|
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, g = e.clientHeight, f = s(), b = Math.max(f - g, 1);
|
|
259
259
|
if (l > 0 && b > 0) {
|
|
260
|
-
const
|
|
261
|
-
e.scrollTop =
|
|
260
|
+
const u = Math.max(0, Math.min(1, a / l));
|
|
261
|
+
e.scrollTop = u * b;
|
|
262
262
|
}
|
|
263
263
|
this.refresh();
|
|
264
264
|
}), t(this, k).top.addEventListener("click", () => {
|
|
@@ -353,11 +353,11 @@ 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,
|
|
356
|
+
var U, R, it, Y, O, Z, at, Lt, Ye, Ve, ee, se, Mt, $t, Ht, ne, re, Nt, Ue, mt, _t, oe;
|
|
357
357
|
const ns = class ns {
|
|
358
358
|
constructor(n) {
|
|
359
359
|
d(this, U);
|
|
360
|
-
d(this,
|
|
360
|
+
d(this, R);
|
|
361
361
|
d(this, it);
|
|
362
362
|
d(this, Y, /* @__PURE__ */ new Map());
|
|
363
363
|
d(this, O, null);
|
|
@@ -370,46 +370,44 @@ const ns = class ns {
|
|
|
370
370
|
d(this, ee, 3);
|
|
371
371
|
q(this, "refresh", /* @__PURE__ */ h(() => {
|
|
372
372
|
var e;
|
|
373
|
-
|
|
374
|
-
const n = t(this,
|
|
375
|
-
n && (t(this, Mt).call(this), t(this,
|
|
373
|
+
S.log("rowManager.refresh");
|
|
374
|
+
const n = t(this, R).querySelector(".ng-container-body .ng-part-body");
|
|
375
|
+
n && (t(this, Mt).call(this), t(this, $t).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
|
-
|
|
379
|
-
scrollTables: t(this,
|
|
380
|
-
firstTr: t(this,
|
|
378
|
+
S.log("rowManager.initialize"), y(this, it, {
|
|
379
|
+
scrollTables: t(this, R).querySelectorAll(".ng-part-body table"),
|
|
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 i = t(this,
|
|
382
|
+
const i = t(this, R).querySelector(r);
|
|
383
383
|
if (!i) return;
|
|
384
384
|
const o = i.querySelector(".ng-part-body table");
|
|
385
385
|
if (!o) return;
|
|
386
386
|
const a = o.querySelector("tbody.bindable-tbody");
|
|
387
387
|
if (!a) return;
|
|
388
|
-
const l = Array.from(a.querySelectorAll("tr")).map((
|
|
388
|
+
const l = Array.from(a.querySelectorAll("tr")).map((g) => g.cloneNode(!0));
|
|
389
389
|
t(this, Y).set(r, l);
|
|
390
390
|
});
|
|
391
|
-
const n = t(this,
|
|
392
|
-
if (t(this,
|
|
393
|
-
t(this, Mt).call(this), t(this, Nt).call(this), t(this,
|
|
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
|
+
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, $t).call(this), t(this, mt).call(this, n.scrollTop);
|
|
394
394
|
let r = !1;
|
|
395
395
|
const i = /* @__PURE__ */ h((o) => {
|
|
396
396
|
var f;
|
|
397
397
|
if (r) return;
|
|
398
398
|
r = !0;
|
|
399
|
-
const a = o.scrollTop, c = o.scrollLeft;
|
|
400
|
-
n && n.scrollTop !== a && (n.scrollTop = a),
|
|
401
|
-
const l = t(this, S).querySelector(".ng-container-body .ng-part-header"), u = t(this, S).querySelector(".ng-container-body .ng-part-footer");
|
|
402
|
-
l && l.scrollLeft !== c && (l.scrollLeft = c), u && u.scrollLeft !== c && (u.scrollLeft = c), t(this, mt).call(this, a), (f = t(this, S).querySelector("nine-table-vscrollbar")) == null || f.refresh(), r = !1;
|
|
399
|
+
const a = 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 !== a && (n.scrollTop = a), g && g.scrollTop !== a && (g.scrollTop = a), s && s.scrollTop !== a && (s.scrollTop = a), t(this, mt).call(this, a), (f = t(this, R).querySelector("nine-table-vscrollbar")) == null || f.refresh(), r = !1;
|
|
403
401
|
}, "handleContainerScroll");
|
|
404
402
|
[n, e, s].forEach((o) => {
|
|
405
403
|
o == null || o.addEventListener("scroll", (a) => {
|
|
406
|
-
|
|
404
|
+
S.log(a), S.log("rowManager.scroll event"), i(o);
|
|
407
405
|
});
|
|
408
406
|
});
|
|
409
407
|
}
|
|
410
408
|
}, "initialize"));
|
|
411
409
|
d(this, se, /* @__PURE__ */ h((n, e) => {
|
|
412
|
-
|
|
410
|
+
S.log("rowManager.#renderRows");
|
|
413
411
|
const s = t(this, Y).get(e);
|
|
414
412
|
if (!s || s.length === 0) return;
|
|
415
413
|
const r = n.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
@@ -425,75 +423,75 @@ const ns = class ns {
|
|
|
425
423
|
d(this, Mt, /* @__PURE__ */ h(() => {
|
|
426
424
|
if (t(this, O) !== null && t(this, O) > 0)
|
|
427
425
|
return t(this, O);
|
|
428
|
-
const n = t(this,
|
|
429
|
-
|
|
426
|
+
const n = t(this, R).querySelector(".ng-container-body .ng-part-body");
|
|
427
|
+
S.log("rowManager.#measureAndCacheHeight");
|
|
430
428
|
const e = t(this, Y).get(".ng-container-body");
|
|
431
429
|
if (!e || e.length === 0) throw new Error("invalid dom");
|
|
432
430
|
const s = n.querySelector("tbody.bindable-tbody");
|
|
433
|
-
if (
|
|
431
|
+
if (S.log(s), !s) throw new Error("invalid dom");
|
|
434
432
|
s.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
|
|
435
433
|
const r = s.querySelector("tr.nodata"), i = document.createDocumentFragment();
|
|
436
434
|
e.forEach((b) => {
|
|
437
435
|
i.appendChild(b.cloneNode(!0));
|
|
438
436
|
}), r ? r.before(i) : s.appendChild(i);
|
|
439
|
-
const o = t(this,
|
|
437
|
+
const o = t(this, R), a = o.style.display, c = o.style.visibility, l = o.style.position;
|
|
440
438
|
(a === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
441
|
-
let
|
|
439
|
+
let g = 0;
|
|
442
440
|
const f = s.querySelectorAll("tr");
|
|
443
441
|
return f.forEach((b) => {
|
|
444
|
-
let
|
|
445
|
-
if (
|
|
442
|
+
let u = b.offsetHeight || b.getBoundingClientRect().height;
|
|
443
|
+
if (u === 0) {
|
|
446
444
|
const p = window.getComputedStyle(b);
|
|
447
|
-
|
|
445
|
+
u = parseFloat(p.height) || parseFloat(p.minHeight) || 0;
|
|
448
446
|
}
|
|
449
|
-
|
|
450
|
-
}), f.forEach((b) => b.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l,
|
|
447
|
+
g += u;
|
|
448
|
+
}), f.forEach((b) => b.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l, g <= 0 ? -1 : (y(this, O, g), t(this, Ht).call(this), t(this, O));
|
|
451
449
|
}, "#measureAndCacheHeight"));
|
|
452
|
-
d(this,
|
|
453
|
-
|
|
450
|
+
d(this, $t, /* @__PURE__ */ h(() => {
|
|
451
|
+
S.log("rowManager.#updateVirtualScrollHeight");
|
|
454
452
|
const e = (t(this, U).data.get() || []).length, s = t(this, O), r = e * s;
|
|
455
|
-
|
|
456
|
-
const o = t(this,
|
|
453
|
+
S.log("π [VirtualHeight]", { totalCount: e, rowHeight: s, totalVirtualHeight: r }), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
454
|
+
const o = t(this, R).querySelector(i);
|
|
457
455
|
if (!o) return;
|
|
458
456
|
const a = o.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
459
457
|
a && (a.style.height = `${r}px`);
|
|
460
458
|
});
|
|
461
459
|
}, "#updateVirtualScrollHeight"));
|
|
462
|
-
d(this,
|
|
460
|
+
d(this, Ht, /* @__PURE__ */ h(() => {
|
|
463
461
|
if (t(this, at) > 0 && t(this, O) > 0) {
|
|
464
462
|
const n = Math.ceil(t(this, at) / t(this, O));
|
|
465
463
|
y(this, Lt, n + t(this, ee));
|
|
466
464
|
}
|
|
467
465
|
}, "#updateRowCount"));
|
|
468
466
|
d(this, ne, /* @__PURE__ */ h(() => {
|
|
469
|
-
var a, c, l,
|
|
470
|
-
const n = t(this,
|
|
467
|
+
var a, c, l, g, f, b;
|
|
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");
|
|
471
469
|
if (e) {
|
|
472
|
-
const
|
|
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);
|
|
473
471
|
for (let m = 0; m < w; m++) {
|
|
474
472
|
const T = [
|
|
475
|
-
((a =
|
|
473
|
+
((a = u[m]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
476
474
|
((c = p[m]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
477
475
|
((l = x[m]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
478
476
|
], A = Math.max(...T);
|
|
479
|
-
A > 0 && (
|
|
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`));
|
|
480
478
|
}
|
|
481
479
|
}
|
|
482
|
-
const r = t(this,
|
|
480
|
+
const r = t(this, R).querySelector(".ng-container-left .ng-part-footer table"), i = t(this, R).querySelector(".ng-container-body .ng-part-footer table"), o = t(this, R).querySelector(".ng-container-right .ng-part-footer table");
|
|
483
481
|
if (i) {
|
|
484
|
-
const
|
|
482
|
+
const u = 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(u.length, p.length, x.length);
|
|
485
483
|
for (let m = 0; m < w; m++) {
|
|
486
484
|
const T = [
|
|
487
|
-
((
|
|
485
|
+
((g = u[m]) == null ? void 0 : g.getBoundingClientRect().height) || 0,
|
|
488
486
|
((f = p[m]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
489
487
|
((b = x[m]) == null ? void 0 : b.getBoundingClientRect().height) || 0
|
|
490
488
|
], A = Math.max(...T);
|
|
491
|
-
A > 0 && (
|
|
489
|
+
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`));
|
|
492
490
|
}
|
|
493
491
|
}
|
|
494
492
|
}, "#syncRowHeights"));
|
|
495
493
|
d(this, re, /* @__PURE__ */ h(() => {
|
|
496
|
-
!t(this,
|
|
494
|
+
!t(this, R) || !(t(this, R) instanceof HTMLElement) || (y(this, Z, new ResizeObserver((n) => {
|
|
497
495
|
for (const e of n) {
|
|
498
496
|
const s = e.target;
|
|
499
497
|
if (!s.classList.contains("active")) continue;
|
|
@@ -503,33 +501,33 @@ const ns = class ns {
|
|
|
503
501
|
const o = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
|
|
504
502
|
o && (i += o.offsetHeight), a && (i += a.offsetHeight);
|
|
505
503
|
const c = Math.max(r - i, 100);
|
|
506
|
-
t(this, at) !== c && (y(this, at, c), t(this,
|
|
504
|
+
t(this, at) !== c && (y(this, at, c), t(this, Ht).call(this), t(this, O) !== null && (t(this, Nt).call(this), this.refresh()));
|
|
507
505
|
}
|
|
508
506
|
}
|
|
509
|
-
})), t(this, Z).observe(t(this,
|
|
507
|
+
})), t(this, Z).observe(t(this, R)));
|
|
510
508
|
}, "#initResizeObserver"));
|
|
511
509
|
d(this, Nt, /* @__PURE__ */ h(() => {
|
|
512
|
-
|
|
513
|
-
const e = t(this,
|
|
510
|
+
S.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
511
|
+
const e = t(this, R).querySelector(n);
|
|
514
512
|
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, se).call(this, e, n);
|
|
515
513
|
}), t(this, oe).call(this), t(this, ne).call(this);
|
|
516
514
|
}, "#renderAllContainers"));
|
|
517
515
|
d(this, Ue, /* @__PURE__ */ h((n) => {
|
|
518
516
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
519
517
|
var l;
|
|
520
|
-
const s = t(this,
|
|
518
|
+
const s = t(this, R).querySelector(e);
|
|
521
519
|
if (!s) return;
|
|
522
520
|
const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
523
521
|
if (!r) return;
|
|
524
522
|
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;
|
|
525
|
-
i.forEach((
|
|
523
|
+
i.forEach((g, f) => {
|
|
526
524
|
const b = n + Math.floor(f / o);
|
|
527
525
|
if (b >= c) {
|
|
528
|
-
|
|
526
|
+
g.style.visibility = "hidden";
|
|
529
527
|
return;
|
|
530
528
|
}
|
|
531
|
-
const
|
|
532
|
-
|
|
529
|
+
const u = t(this, U).data.get(b);
|
|
530
|
+
g.style.display = "", t(this, _t).call(this, g, u, b);
|
|
533
531
|
});
|
|
534
532
|
});
|
|
535
533
|
}, "#adjustBufferRows"));
|
|
@@ -539,16 +537,16 @@ const ns = class ns {
|
|
|
539
537
|
if (!e || e <= 0) return;
|
|
540
538
|
const s = t(this, U).data.length;
|
|
541
539
|
if (s === 0) return;
|
|
542
|
-
const r = ((f = t(this, Y).get(".ng-container-body")) == null ? void 0 : f.length) || 1, i = t(this,
|
|
543
|
-
|
|
540
|
+
const r = ((f = t(this, Y).get(".ng-container-body")) == null ? void 0 : f.length) || 1, i = t(this, R).querySelector(".ng-container-body .ng-part-body");
|
|
541
|
+
S.log("bodyContainer.clientHeight", i.clientHeight);
|
|
544
542
|
const o = Math.max(0, s - Math.floor(i.clientHeight / e)), a = Math.min(o, Math.max(0, Math.floor(n / e)));
|
|
545
543
|
let c = Math.floor(a * e);
|
|
546
|
-
|
|
547
|
-
const l = t(this, it).firstTr,
|
|
548
|
-
(b = t(this, it)) == null || b.scrollTables.forEach((
|
|
549
|
-
|
|
550
|
-
}),
|
|
551
|
-
const p = t(this,
|
|
544
|
+
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}`);
|
|
545
|
+
const l = t(this, it).firstTr, g = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
|
|
546
|
+
(b = t(this, it)) == null || b.scrollTables.forEach((u) => {
|
|
547
|
+
u.style.transform = `translate3d(0, ${c}px, 0)`;
|
|
548
|
+
}), g !== a && (S.log(`π [Row Bind Trigger] currentStartIndex(${g}) !== startIndex(${a})`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((u) => {
|
|
549
|
+
const p = t(this, R).querySelector(u);
|
|
552
550
|
if (!p) return;
|
|
553
551
|
const x = p.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
554
552
|
if (!x) return;
|
|
@@ -585,24 +583,24 @@ const ns = class ns {
|
|
|
585
583
|
});
|
|
586
584
|
}, "#bindRowData"));
|
|
587
585
|
d(this, oe, /* @__PURE__ */ h(() => {
|
|
588
|
-
var c, l,
|
|
589
|
-
|
|
590
|
-
const n = t(this,
|
|
586
|
+
var c, l, g;
|
|
587
|
+
S.log("rowManager.#syncHeaderHeights");
|
|
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");
|
|
591
589
|
if (!e) return;
|
|
592
590
|
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);
|
|
593
591
|
for (let f = 0; f < a; f++) {
|
|
594
592
|
const b = [
|
|
595
593
|
((c = r[f]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
596
594
|
((l = i[f]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
597
|
-
((
|
|
598
|
-
],
|
|
599
|
-
|
|
595
|
+
((g = o[f]) == null ? void 0 : g.getBoundingClientRect().height) || 0
|
|
596
|
+
], u = Math.max(...b);
|
|
597
|
+
u > 0 && (r[f] && (r[f].style.height = `${u}px`), i[f] && (i[f].style.height = `${u}px`), o[f] && (o[f].style.height = `${u}px`));
|
|
600
598
|
}
|
|
601
599
|
}, "#syncHeaderHeights"));
|
|
602
600
|
q(this, "destroy", /* @__PURE__ */ h(() => {
|
|
603
601
|
t(this, Z) && (t(this, Z).disconnect(), y(this, Z, null));
|
|
604
602
|
}, "destroy"));
|
|
605
|
-
y(this, U, n.getRootNode().host), y(this,
|
|
603
|
+
y(this, U, n.getRootNode().host), y(this, R, n), t(this, re).call(this);
|
|
606
604
|
}
|
|
607
605
|
getRowHeight() {
|
|
608
606
|
return t(this, O);
|
|
@@ -612,7 +610,7 @@ const ns = class ns {
|
|
|
612
610
|
return ((e = t(this, Y).get(n)) == null ? void 0 : e.length) || 1;
|
|
613
611
|
}
|
|
614
612
|
};
|
|
615
|
-
U = 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(), $t = new WeakMap(), Ht = 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");
|
|
616
614
|
let ke = ns;
|
|
617
615
|
const ie = class ie {
|
|
618
616
|
/**
|
|
@@ -628,23 +626,23 @@ const ie = class ie {
|
|
|
628
626
|
if (!n) return null;
|
|
629
627
|
const e = /* @__PURE__ */ h((a) => {
|
|
630
628
|
a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
|
|
631
|
-
const
|
|
629
|
+
const g = l.getAttribute("cell-type") || "renderer";
|
|
632
630
|
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
633
|
-
let f = `cell-${
|
|
634
|
-
const b = l.getAttribute("data-bind"),
|
|
631
|
+
let f = `cell-${g}`;
|
|
632
|
+
const b = l.getAttribute("data-bind"), u = l.getAttribute("data-expr"), p = l.getAttribute("maxbyte"), x = l.getAttribute("type");
|
|
635
633
|
let w = [];
|
|
636
|
-
b && w.push(`data-bind="${b}"`),
|
|
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}>`;
|
|
637
635
|
}), a.querySelectorAll("tbody td, tfoot td").forEach((l) => {
|
|
638
636
|
l.setAttribute("tabindex", "0");
|
|
639
637
|
});
|
|
640
638
|
}, "processCellTypes"), s = /* @__PURE__ */ h((a) => {
|
|
641
639
|
if (!a.querySelector("colgroup")) {
|
|
642
|
-
const c = a.querySelector("tbody tr") || a.querySelector("tr"), l = c ? c.querySelectorAll("th, td").length : 1,
|
|
640
|
+
const c = a.querySelector("tbody tr") || a.querySelector("tr"), l = c ? c.querySelectorAll("th, td").length : 1, g = document.createElement("colgroup"), f = Math.max(Math.floor(a.clientWidth / l), 100);
|
|
643
641
|
for (let b = 0; b < l; b++) {
|
|
644
|
-
const
|
|
645
|
-
|
|
642
|
+
const u = document.createElement("col");
|
|
643
|
+
u.setAttribute("width", f), g.appendChild(u);
|
|
646
644
|
}
|
|
647
|
-
a.prepend(
|
|
645
|
+
a.prepend(g);
|
|
648
646
|
}
|
|
649
647
|
if (!a.querySelector("thead")) {
|
|
650
648
|
const c = document.createElement("thead"), l = a.querySelector("colgroup");
|
|
@@ -652,33 +650,33 @@ const ie = class ie {
|
|
|
652
650
|
}
|
|
653
651
|
a.classList.add("nine-table-element");
|
|
654
652
|
}, "ensureTableStructure"), r = /* @__PURE__ */ h((a, c) => {
|
|
655
|
-
const l = Array.from(a.querySelectorAll(c + " tr")),
|
|
656
|
-
if (f === 0 ||
|
|
653
|
+
const l = Array.from(a.querySelectorAll(c + " tr")), g = Array.from(a.querySelectorAll(c + " th," + c + " td")), f = l.length;
|
|
654
|
+
if (f === 0 || g.length === 0) return;
|
|
657
655
|
let b = 0;
|
|
658
|
-
|
|
656
|
+
g.forEach((p) => {
|
|
659
657
|
b += p.colSpan || 1;
|
|
660
658
|
});
|
|
661
|
-
const
|
|
659
|
+
const u = Array.from(Array(f), () => Array(b).fill(null));
|
|
662
660
|
l.forEach((p) => {
|
|
663
661
|
const x = p.sectionRowIndex;
|
|
664
662
|
let w = 0;
|
|
665
663
|
Array.from(p.querySelectorAll("th,td")).forEach((m) => {
|
|
666
|
-
for (let M = 0; M <
|
|
667
|
-
if (
|
|
664
|
+
for (let M = 0; M < u[x].length; M++)
|
|
665
|
+
if (u[x][M] === null) {
|
|
668
666
|
w = M;
|
|
669
667
|
break;
|
|
670
668
|
}
|
|
671
669
|
const T = m.rowSpan || 1, A = m.colSpan || 1;
|
|
672
670
|
for (let M = 0; M < T; M++)
|
|
673
671
|
for (let B = 0; B < A; B++)
|
|
674
|
-
x + M < f && w + B < b && (
|
|
672
|
+
x + M < f && w + B < b && (u[x + M][w + B] = M === 0 && B === 0 ? "1" : "0");
|
|
675
673
|
});
|
|
676
674
|
}), l.forEach((p) => {
|
|
677
675
|
const x = p.sectionRowIndex;
|
|
678
676
|
Array.from(p.querySelectorAll("th,td")).forEach((w) => {
|
|
679
|
-
for (let m = 0; m <
|
|
680
|
-
if (
|
|
681
|
-
w.dataset.col = m,
|
|
677
|
+
for (let m = 0; m < u[x].length; m++)
|
|
678
|
+
if (u[x][m] === "1") {
|
|
679
|
+
w.dataset.col = m, u[x][m] = "0";
|
|
682
680
|
break;
|
|
683
681
|
}
|
|
684
682
|
});
|
|
@@ -686,8 +684,8 @@ const ie = class ie {
|
|
|
686
684
|
}, "resetColIndex"), i = n.cloneNode(!0);
|
|
687
685
|
return s(i), e(i), r(i, "thead"), r(i, "tbody"), r(i, "tfoot"), Array.from(i.querySelectorAll("colgroup col")).forEach((a, c) => {
|
|
688
686
|
const l = a.getAttribute("fixed");
|
|
689
|
-
l && i.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((
|
|
690
|
-
|
|
687
|
+
l && i.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((g) => {
|
|
688
|
+
g.setAttribute("fixed", l);
|
|
691
689
|
});
|
|
692
690
|
}), i;
|
|
693
691
|
}
|
|
@@ -703,7 +701,7 @@ const rs = class rs {
|
|
|
703
701
|
d(this, X, { startRow: -1, startCol: -1, endRow: -1, endCol: -1 });
|
|
704
702
|
q(this, "render", /* @__PURE__ */ h(() => {
|
|
705
703
|
const { startRow: n, startCol: e, endRow: s, endCol: r } = t(this, X);
|
|
706
|
-
|
|
704
|
+
S.log("π¨ [CellSelection.render] Rendering range ->", t(this, X));
|
|
707
705
|
const i = t(this, N).querySelectorAll(
|
|
708
706
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
709
707
|
);
|
|
@@ -712,21 +710,21 @@ const rs = class rs {
|
|
|
712
710
|
c.classList.remove("selected", "selected-top", "selected-bottom", "selected-left", "selected-right");
|
|
713
711
|
});
|
|
714
712
|
}), n < 0 || e < 0) {
|
|
715
|
-
|
|
713
|
+
S.log("β οΈ [CellSelection.render] Range is invalid (< 0), skipping render.");
|
|
716
714
|
return;
|
|
717
715
|
}
|
|
718
716
|
let o = 0;
|
|
719
717
|
i.forEach((a) => {
|
|
720
718
|
a.querySelectorAll("tbody tr").forEach((c) => {
|
|
721
719
|
const { matrixRow: l } = V(this, K, qt).call(this, c);
|
|
722
|
-
l < 0 || c.querySelectorAll("td, th").forEach((
|
|
723
|
-
const f = parseInt(
|
|
720
|
+
l < 0 || c.querySelectorAll("td, th").forEach((g) => {
|
|
721
|
+
const f = parseInt(g.dataset.col, 10);
|
|
724
722
|
if (isNaN(f)) return;
|
|
725
|
-
const b = parseInt(
|
|
726
|
-
p >= n && l <= s && x >= e && f <= r && (o++,
|
|
723
|
+
const b = parseInt(g.rowSpan || 1, 10), u = parseInt(g.colSpan || 1, 10), p = l + b - 1, x = f + u - 1;
|
|
724
|
+
p >= n && l <= s && x >= e && f <= r && (o++, g.classList.add("selected"), S.log(g, n, e, s, r), l <= n && g.classList.add("selected-top"), p >= s && g.classList.add("selected-bottom"), f <= e && g.classList.add("selected-left"), x >= r && g.classList.add("selected-right"));
|
|
727
725
|
});
|
|
728
726
|
});
|
|
729
|
-
}),
|
|
727
|
+
}), S.log(`β¨ [CellSelection.render] Total rendered cells marked: ${o}`);
|
|
730
728
|
}, "render"));
|
|
731
729
|
y(this, N, n), V(this, K, ws).call(this), t(this, N).querySelectorAll(
|
|
732
730
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
@@ -734,32 +732,32 @@ const rs = class rs {
|
|
|
734
732
|
s.addEventListener("scroll", () => {
|
|
735
733
|
t(this, X).startRow >= 0 && t(this, X).startCol >= 0 && this.render();
|
|
736
734
|
});
|
|
737
|
-
}),
|
|
735
|
+
}), S.log("π― [CellSelection] Initialized");
|
|
738
736
|
}
|
|
739
737
|
setRange(n, e, s, r) {
|
|
740
|
-
|
|
738
|
+
S.log(`π [CellSelection.setRange] Input -> startRow: ${n}, startCol: ${e}, endRow: ${s}, endCol: ${r}`);
|
|
741
739
|
let i = Math.min(n, s), o = Math.max(n, s), a = Math.min(e, r), c = Math.max(e, r);
|
|
742
740
|
const l = t(this, N).querySelectorAll(
|
|
743
741
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
744
742
|
);
|
|
745
|
-
let
|
|
746
|
-
for (;
|
|
747
|
-
|
|
748
|
-
b.querySelectorAll("tbody tr").forEach((
|
|
749
|
-
if (
|
|
750
|
-
const { matrixRow: p } = V(this, K, qt).call(this,
|
|
751
|
-
p < 0 ||
|
|
743
|
+
let g = !0, f = 0;
|
|
744
|
+
for (; g && f < 5; )
|
|
745
|
+
g = !1, f++, l.forEach((b) => {
|
|
746
|
+
b.querySelectorAll("tbody tr").forEach((u) => {
|
|
747
|
+
if (u.classList.contains("nodata")) return;
|
|
748
|
+
const { matrixRow: p } = V(this, K, qt).call(this, u);
|
|
749
|
+
p < 0 || u.querySelectorAll("td, th").forEach((x) => {
|
|
752
750
|
const w = parseInt(x.dataset.col, 10);
|
|
753
751
|
if (isNaN(w)) return;
|
|
754
752
|
const m = parseInt(x.rowSpan || 1, 10), T = parseInt(x.colSpan || 1, 10), A = p + m - 1, M = w + T - 1;
|
|
755
753
|
if (A >= i && p <= o && M >= a && w <= c) {
|
|
756
754
|
const z = Math.min(i, p), Gt = Math.max(o, A), bs = Math.min(a, w), ps = Math.max(c, M);
|
|
757
|
-
(z !== i || Gt !== o || bs !== a || ps !== c) && (i = z, o = Gt, a = bs, c = ps,
|
|
755
|
+
(z !== i || Gt !== o || bs !== a || ps !== c) && (i = z, o = Gt, a = bs, c = ps, g = !0);
|
|
758
756
|
}
|
|
759
757
|
});
|
|
760
758
|
});
|
|
761
759
|
});
|
|
762
|
-
y(this, X, { startRow: i, startCol: a, endRow: o, endCol: c }),
|
|
760
|
+
y(this, X, { startRow: i, startCol: a, endRow: o, endCol: c }), S.log("π¦ [CellSelection.setRange] Final Range ->", t(this, X)), this.render();
|
|
763
761
|
}
|
|
764
762
|
};
|
|
765
763
|
N = new WeakMap(), X = new WeakMap(), K = new WeakSet(), qt = /* @__PURE__ */ h(function(n) {
|
|
@@ -771,7 +769,7 @@ N = new WeakMap(), X = new WeakMap(), K = new WeakSet(), qt = /* @__PURE__ */ h(
|
|
|
771
769
|
}, "#getMatrixRow"), ws = /* @__PURE__ */ h(function() {
|
|
772
770
|
const n = t(this, N).querySelector(".ng-container-top");
|
|
773
771
|
if (!n) {
|
|
774
|
-
|
|
772
|
+
S.log("β [CellSelection] .ng-container-top not found!");
|
|
775
773
|
return;
|
|
776
774
|
}
|
|
777
775
|
n.addEventListener("mousedown", (e) => {
|
|
@@ -784,32 +782,32 @@ N = new WeakMap(), X = new WeakMap(), K = new WeakSet(), qt = /* @__PURE__ */ h(
|
|
|
784
782
|
t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "";
|
|
785
783
|
return;
|
|
786
784
|
}
|
|
787
|
-
|
|
785
|
+
S.log(`π±οΈ [MouseDown Success] startRow: ${i}, startCol: ${o}`), t(this, N).navigation.currentCell = s;
|
|
788
786
|
let a = i, c = o;
|
|
789
787
|
const l = /* @__PURE__ */ h((f) => {
|
|
790
788
|
const b = document.elementFromPoint(f.clientX, f.clientY);
|
|
791
|
-
let
|
|
792
|
-
if (!
|
|
789
|
+
let u = b == null ? void 0 : b.closest("td, th");
|
|
790
|
+
if (!u || !t(this, N).contains(u)) {
|
|
793
791
|
const m = t(this, N).querySelectorAll(".ng-part-body tbody tr:not(.nodata) td, .ng-part-body tbody tr:not(.nodata) th");
|
|
794
792
|
for (const T of m) {
|
|
795
793
|
const A = T.getBoundingClientRect();
|
|
796
794
|
if (f.clientX >= A.left && f.clientX <= A.right && f.clientY >= A.top && f.clientY <= A.bottom) {
|
|
797
|
-
|
|
795
|
+
u = T;
|
|
798
796
|
break;
|
|
799
797
|
}
|
|
800
798
|
}
|
|
801
799
|
}
|
|
802
|
-
if (!
|
|
803
|
-
const p =
|
|
800
|
+
if (!u || u.dataset.row === void 0 || u.dataset.col === void 0 || u.closest("tr").classList.contains("nodata")) return;
|
|
801
|
+
const p = u.closest("tr"), { matrixRow: x } = V(this, K, qt).call(this, p), w = parseInt(u.dataset.col, 10);
|
|
804
802
|
x < 0 || a === x && c === w || (a = x, c = w, this.setRange(i, o, x, w));
|
|
805
|
-
}, "onMouseMove"),
|
|
806
|
-
|
|
803
|
+
}, "onMouseMove"), g = /* @__PURE__ */ h(() => {
|
|
804
|
+
S.log("π±οΈ [MouseUp] Drag ended."), t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "", document.removeEventListener("mousemove", l), document.removeEventListener("mouseup", g);
|
|
807
805
|
}, "onMouseUp");
|
|
808
|
-
document.addEventListener("mousemove", l), document.addEventListener("mouseup",
|
|
806
|
+
document.addEventListener("mousemove", l), document.addEventListener("mouseup", g);
|
|
809
807
|
});
|
|
810
808
|
}, "#initEvents"), h(rs, "CellSelection");
|
|
811
809
|
let Le = rs;
|
|
812
|
-
var F, lt, ae, le, pt,
|
|
810
|
+
var F, lt, ae, le, pt, $e, Ot, Dt, Bt, ct, Wt, vs;
|
|
813
811
|
const os = class os {
|
|
814
812
|
constructor(n) {
|
|
815
813
|
d(this, pt);
|
|
@@ -859,21 +857,21 @@ const os = class os {
|
|
|
859
857
|
return e.forEach((r) => {
|
|
860
858
|
const i = Array.from(r.querySelectorAll("tbody tr:not(.nodata)"));
|
|
861
859
|
for (const o of i) {
|
|
862
|
-
const a = parseInt(o.dataset.row, 10), c = i.filter((p) => parseInt(p.dataset.row, 10) === a), l = c.length > 0 ? c.length : 1,
|
|
860
|
+
const a = parseInt(o.dataset.row, 10), c = i.filter((p) => parseInt(p.dataset.row, 10) === a), l = c.length > 0 ? c.length : 1, g = c.indexOf(o), f = a * l + (g >= 0 ? g : 0);
|
|
863
861
|
if (f === n) {
|
|
864
862
|
s.push(o);
|
|
865
863
|
break;
|
|
866
864
|
}
|
|
867
865
|
const b = Array.from(o.querySelectorAll("td"));
|
|
868
|
-
let
|
|
866
|
+
let u = !1;
|
|
869
867
|
for (const p of b) {
|
|
870
868
|
const x = parseInt(p.rowSpan || 1, 10);
|
|
871
869
|
if (x > 1 && n >= f && n < f + x) {
|
|
872
|
-
s.push(o),
|
|
870
|
+
s.push(o), u = !0;
|
|
873
871
|
break;
|
|
874
872
|
}
|
|
875
873
|
}
|
|
876
|
-
if (
|
|
874
|
+
if (u) break;
|
|
877
875
|
}
|
|
878
876
|
}), s;
|
|
879
877
|
}, "#findTargetTrsByMatrix"));
|
|
@@ -885,7 +883,7 @@ const os = class os {
|
|
|
885
883
|
for (const a of i) {
|
|
886
884
|
const c = Array.from(a.querySelectorAll("tbody tr:not(.nodata)"));
|
|
887
885
|
for (const l of c) {
|
|
888
|
-
const
|
|
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"));
|
|
889
887
|
for (const w of x) {
|
|
890
888
|
const m = parseInt(w.dataset.col, 10), T = parseInt(w.colSpan || 1, 10), A = parseInt(w.rowSpan || 1, 10);
|
|
891
889
|
if (!isNaN(m) && s >= m && s < m + T && o >= p && o < p + A && window.getComputedStyle(w).display !== "none")
|
|
@@ -895,7 +893,7 @@ const os = class os {
|
|
|
895
893
|
}
|
|
896
894
|
return null;
|
|
897
895
|
}, "#getNearElement"));
|
|
898
|
-
y(this, F, n), V(this, pt, vs).call(this),
|
|
896
|
+
y(this, F, n), V(this, pt, vs).call(this), S.log("π― [CellNavigation] Initialized");
|
|
899
897
|
}
|
|
900
898
|
get currentCell() {
|
|
901
899
|
return t(this, lt);
|
|
@@ -908,8 +906,8 @@ const os = class os {
|
|
|
908
906
|
y(this, ae, e), y(this, le, s);
|
|
909
907
|
const r = n.closest("tr"), i = r == null ? void 0 : r.closest("tbody");
|
|
910
908
|
if (i) {
|
|
911
|
-
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),
|
|
912
|
-
t(this, F).selection.setRange(
|
|
909
|
+
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), g = e * c + (l >= 0 ? l : 0);
|
|
910
|
+
t(this, F).selection.setRange(g, s, g, s);
|
|
913
911
|
}
|
|
914
912
|
}
|
|
915
913
|
}
|
|
@@ -918,27 +916,27 @@ const os = class os {
|
|
|
918
916
|
if (!t(this, lt)) return;
|
|
919
917
|
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");
|
|
920
918
|
if (!o) return;
|
|
921
|
-
const c = Array.from(o.querySelectorAll("tr:not(.nodata)")).filter((B) => parseInt(B.dataset.row, 10) === r), l = c.length > 0 ? c.length : 1,
|
|
922
|
-
let b = f,
|
|
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 = i;
|
|
923
921
|
switch (n.code) {
|
|
924
922
|
case "Tab":
|
|
925
923
|
if (n.preventDefault(), n.shiftKey) {
|
|
926
|
-
if (
|
|
924
|
+
if (u = t(this, Bt).call(this, f, i), u < 0 && f > 0) {
|
|
927
925
|
b = f - 1;
|
|
928
926
|
const B = t(this, ct).call(this, b), z = t(this, Ot).call(this, B);
|
|
929
|
-
|
|
927
|
+
u = z ? parseInt(z.dataset.col, 10) : 0;
|
|
930
928
|
}
|
|
931
929
|
} else {
|
|
932
|
-
|
|
930
|
+
u = t(this, Dt).call(this, f, i);
|
|
933
931
|
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;
|
|
934
|
-
|
|
932
|
+
u >= Gt && (b = f + 1, u = 0);
|
|
935
933
|
}
|
|
936
934
|
break;
|
|
937
935
|
case "ArrowRight":
|
|
938
|
-
|
|
936
|
+
u = t(this, Dt).call(this, f, i);
|
|
939
937
|
break;
|
|
940
938
|
case "ArrowLeft":
|
|
941
|
-
|
|
939
|
+
u = t(this, Bt).call(this, f, i);
|
|
942
940
|
break;
|
|
943
941
|
case "ArrowDown":
|
|
944
942
|
n.preventDefault(), b = f + (e.rowSpan || 1);
|
|
@@ -948,20 +946,20 @@ const os = class os {
|
|
|
948
946
|
break;
|
|
949
947
|
}
|
|
950
948
|
const p = Math.floor(b / l), x = b % l;
|
|
951
|
-
let w = t(this, Wt).call(this, p, x,
|
|
949
|
+
let w = t(this, Wt).call(this, p, x, u, b);
|
|
952
950
|
if (w)
|
|
953
|
-
this.currentCell = w, V(this, pt,
|
|
951
|
+
this.currentCell = w, V(this, pt, $e).call(this, w);
|
|
954
952
|
else if (p !== r && p >= 0) {
|
|
955
953
|
const B = ((T = (m = t(this, F)).getRowHeight) == null ? void 0 : T.call(m)) || 40;
|
|
956
954
|
(M = (A = t(this, F)).scrollToY) == null || M.call(A, p * B), setTimeout(() => {
|
|
957
|
-
const z = t(this, Wt).call(this, p, x,
|
|
958
|
-
z && (this.currentCell = z, V(this, pt,
|
|
955
|
+
const z = t(this, Wt).call(this, p, x, u, b);
|
|
956
|
+
z && (this.currentCell = z, V(this, pt, $e).call(this, z));
|
|
959
957
|
}, 0);
|
|
960
958
|
}
|
|
961
959
|
}
|
|
962
960
|
};
|
|
963
961
|
F = new WeakMap(), lt = new WeakMap(), ae = new WeakMap(), le = new WeakMap(), pt = new WeakSet(), // π― μ
μ΄ λ³΄μ΄μ§ μλ μμμ μμ λ 컨ν
μ΄λ μ€ν¬λ‘€μ λκΈ°ννλ ν¨μ
|
|
964
|
-
|
|
962
|
+
$e = /* @__PURE__ */ h(function(n) {
|
|
965
963
|
const e = t(this, F).querySelector(".ng-container-body .ng-part-body");
|
|
966
964
|
if (!e) return;
|
|
967
965
|
const s = n.getBoundingClientRect(), r = e.getBoundingClientRect();
|
|
@@ -982,10 +980,10 @@ const Ct = class Ct extends HTMLElement {
|
|
|
982
980
|
d(this, zt);
|
|
983
981
|
d(this, Pt);
|
|
984
982
|
q(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
985
|
-
|
|
983
|
+
S.log("sheet.invalidate()"), t(this, dt).refresh();
|
|
986
984
|
}, "invalidate"));
|
|
987
985
|
q(this, "generate", /* @__PURE__ */ h((e) => {
|
|
988
|
-
if (
|
|
986
|
+
if (S.log("sheet.generate()"), !e) return;
|
|
989
987
|
y(this, ht, Ie.compile(e)), t(this, he).call(this), t(this, de).call(this);
|
|
990
988
|
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");
|
|
991
989
|
s && i && (i.style.top = `${s.offsetHeight}px`), r && i && (i.style.bottom = `${r.offsetHeight}px`), t(this, dt).initialize(), setTimeout(() => {
|
|
@@ -1022,8 +1020,8 @@ const Ct = class Ct extends HTMLElement {
|
|
|
1022
1020
|
const i = e.cloneNode(!0), o = i.querySelector("thead"), a = i.querySelector("tbody"), c = i.querySelector("tfoot");
|
|
1023
1021
|
if (r === "header") {
|
|
1024
1022
|
if (a && a.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
1025
|
-
const
|
|
1026
|
-
|
|
1023
|
+
const g = document.createElement("tbody");
|
|
1024
|
+
g.className = "fixed-tbody", i.appendChild(g);
|
|
1027
1025
|
}
|
|
1028
1026
|
} else r === "body" ? (o && o.remove(), c && c.remove(), a && (a.className = "bindable-tbody")) : r === "footer" && (o && o.remove(), a && a.remove());
|
|
1029
1027
|
return s === "left" ? i.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
@@ -1260,7 +1258,7 @@ const Ct = class Ct extends HTMLElement {
|
|
|
1260
1258
|
return t(this, Pt);
|
|
1261
1259
|
}
|
|
1262
1260
|
disconnectedCallback() {
|
|
1263
|
-
this.innerHTML = "",
|
|
1261
|
+
this.innerHTML = "", S.log("NineTableSheet destroyed.");
|
|
1264
1262
|
}
|
|
1265
1263
|
};
|
|
1266
1264
|
ce = new WeakMap(), ht = new WeakMap(), dt = new WeakMap(), zt = 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);
|
|
@@ -1280,33 +1278,33 @@ const is = class is extends HTMLElement {
|
|
|
1280
1278
|
}, "#init"));
|
|
1281
1279
|
d(this, Ft, /* @__PURE__ */ h((e, s = !1) => {
|
|
1282
1280
|
const r = /* @__PURE__ */ h(() => {
|
|
1283
|
-
const
|
|
1284
|
-
Array.from(this.querySelectorAll("nine-splitter")).forEach((
|
|
1285
|
-
const b =
|
|
1286
|
-
b.length < 2 || b.forEach((
|
|
1287
|
-
const p = parseInt(
|
|
1281
|
+
const g = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
1282
|
+
Array.from(this.querySelectorAll("nine-splitter")).forEach((u) => u.style.setProperty("display", "none"));
|
|
1283
|
+
const b = g.filter((u) => u.classList.contains("active"));
|
|
1284
|
+
b.length < 2 || b.forEach((u) => {
|
|
1285
|
+
const p = parseInt(u.getAttribute("data-index"), 10), x = this.querySelector(`nine-splitter[data-split-index="${p}"]`), w = g[p + 1];
|
|
1288
1286
|
x && w && w.classList.contains("active") && x.style.setProperty("display", "flex");
|
|
1289
1287
|
});
|
|
1290
1288
|
}, "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");
|
|
1291
1289
|
if (!a[e]) return;
|
|
1292
1290
|
if (!s)
|
|
1293
|
-
a.forEach((
|
|
1294
|
-
|
|
1295
|
-
}), c.forEach((
|
|
1291
|
+
a.forEach((g, f) => {
|
|
1292
|
+
g.classList.toggle("active", f === e);
|
|
1293
|
+
}), c.forEach((g, f) => {
|
|
1296
1294
|
const b = f === e;
|
|
1297
|
-
|
|
1295
|
+
g.classList.toggle("active", b), g.style.flex = b ? "1 1 100%" : "";
|
|
1298
1296
|
});
|
|
1299
1297
|
else {
|
|
1300
|
-
const
|
|
1301
|
-
if (
|
|
1298
|
+
const g = a[e], f = i.querySelectorAll(".nine-tab-item.active");
|
|
1299
|
+
if (g.classList.contains("active") && f.length <= 1)
|
|
1302
1300
|
return;
|
|
1303
|
-
|
|
1301
|
+
g.classList.toggle("active");
|
|
1304
1302
|
const b = o.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
1305
1303
|
b && (b.classList.toggle("active"), b.classList.contains("active") || (b.style.flex = ""));
|
|
1306
1304
|
}
|
|
1307
1305
|
const l = o.querySelectorAll("nine-table-sheet.active");
|
|
1308
|
-
l == null || l.forEach((
|
|
1309
|
-
|
|
1306
|
+
l == null || l.forEach((g) => {
|
|
1307
|
+
g.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
1310
1308
|
}), r();
|
|
1311
1309
|
}, "#switchSheet"));
|
|
1312
1310
|
}
|
|
@@ -1315,8 +1313,8 @@ const is = class is extends HTMLElement {
|
|
|
1315
1313
|
}
|
|
1316
1314
|
};
|
|
1317
1315
|
ue = new WeakMap(), Ft = new WeakMap(), h(is, "NineTableSheets");
|
|
1318
|
-
let
|
|
1319
|
-
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets",
|
|
1316
|
+
let He = is;
|
|
1317
|
+
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", He);
|
|
1320
1318
|
var _, be, jt, pe;
|
|
1321
1319
|
const as = class as {
|
|
1322
1320
|
constructor(n) {
|
|
@@ -1331,7 +1329,7 @@ const as = class as {
|
|
|
1331
1329
|
var c, l;
|
|
1332
1330
|
const n = Array.from(t(this, _).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
1333
1331
|
if (n.length === 0) return;
|
|
1334
|
-
const e = parseInt(t(this, _).getAttribute("max-display-row"), 10) || 10, s = Math.max(...n.map((
|
|
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, 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;
|
|
1335
1333
|
t(this, _).style.height = `${a}px`;
|
|
1336
1334
|
}, "#applyAutoHeight"));
|
|
1337
1335
|
d(this, pe, /* @__PURE__ */ h(() => {
|
|
@@ -1605,8 +1603,8 @@ const P = class P {
|
|
|
1605
1603
|
if (!n) return n;
|
|
1606
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() : [], i = s.filter((a) => !a.__ng.deleted).map((a) => {
|
|
1607
1605
|
const c = {};
|
|
1608
|
-
return r.forEach((l,
|
|
1609
|
-
c[l] = a.v ? a.v[
|
|
1606
|
+
return r.forEach((l, g) => {
|
|
1607
|
+
c[l] = a.v ? a.v[g] : a[l];
|
|
1610
1608
|
}), c.__ng = a.__ng, c;
|
|
1611
1609
|
});
|
|
1612
1610
|
return e ? i[0] : i;
|
|
@@ -1683,11 +1681,11 @@ const hs = class hs {
|
|
|
1683
1681
|
}), y(this, H, Array.from(n, ([e, s]) => ({ name: e, type: s }))), y(this, H, t(this, H).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, H).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
1684
1682
|
}, "#adjust"));
|
|
1685
1683
|
d(this, ve, /* @__PURE__ */ h(() => {
|
|
1686
|
-
y(this, H, []),
|
|
1684
|
+
y(this, H, []), S.log(t(this, Rt).querySelectorAll("table"));
|
|
1687
1685
|
const n = Array.from(t(this, Rt).querySelectorAll("table"));
|
|
1688
1686
|
if (!(!n || n.length === 0)) {
|
|
1689
1687
|
for (const e of n)
|
|
1690
|
-
|
|
1688
|
+
S.log(e), $("[data-bind]", e).each((s, r) => {
|
|
1691
1689
|
const i = r.dataset.bind, o = r.getAttribute("data-type") || "string";
|
|
1692
1690
|
i && t(this, H).push({ name: i, type: o });
|
|
1693
1691
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
@@ -1746,7 +1744,7 @@ const ds = class ds extends HTMLElement {
|
|
|
1746
1744
|
d(this, ut);
|
|
1747
1745
|
d(this, Se);
|
|
1748
1746
|
d(this, Re, /* @__PURE__ */ h(() => {
|
|
1749
|
-
this.fields = new Be(this), y(this, Se, new Ne(this)),
|
|
1747
|
+
this.fields = new Be(this), y(this, Se, new Ne(this)), S.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1750
1748
|
}, "#init"));
|
|
1751
1749
|
this.attachShadow({ mode: "open" }), y(this, ut, new De(this));
|
|
1752
1750
|
}
|
|
@@ -1754,7 +1752,7 @@ const ds = class ds extends HTMLElement {
|
|
|
1754
1752
|
t(this, Re).call(this);
|
|
1755
1753
|
}
|
|
1756
1754
|
disconnectedCallback() {
|
|
1757
|
-
|
|
1755
|
+
S.log("NineTable disconnected.");
|
|
1758
1756
|
}
|
|
1759
1757
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1760
1758
|
get data() {
|
|
@@ -1829,10 +1827,10 @@ const fs = class fs extends ze {
|
|
|
1829
1827
|
if (parseInt(s.sectionRowIndex / t(this, L).template.length) > 0)
|
|
1830
1828
|
for (var o of r) {
|
|
1831
1829
|
if (o > e) break;
|
|
1832
|
-
var a = parseInt(t(this, v).dataset.row), c = a - 1, l = t(this, v).closest("tr").data,
|
|
1830
|
+
var a = parseInt(t(this, v).dataset.row), c = a - 1, l = t(this, v).closest("tr").data, g = t(this, L).data.get(c);
|
|
1833
1831
|
t(this, v).dataset.matrixRow;
|
|
1834
|
-
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],
|
|
1835
|
-
if (b !=
|
|
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, a) : l[f.dataset.bind], u = f.dataset.expr ? this.getExprValue(f.dataset.expr, g, c) : g[f.dataset.bind];
|
|
1833
|
+
if (b != u) {
|
|
1836
1834
|
i = !0;
|
|
1837
1835
|
break;
|
|
1838
1836
|
}
|