@ninebone/table 0.0.528 β 0.0.530
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 +91 -89
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +1 -1
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -4,7 +4,7 @@ var Fe = (R) => {
|
|
|
4
4
|
};
|
|
5
5
|
var Ue = (R, i, e) => i in R ? je(R, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : R[i] = e;
|
|
6
6
|
var h = (R, i) => je(R, "name", { value: i, configurable: !0 });
|
|
7
|
-
var
|
|
7
|
+
var E = (R, i, e) => Ue(R, typeof i != "symbol" ? i + "" : i, e), Ve = (R, i, e) => i.has(R) || Fe("Cannot " + e);
|
|
8
8
|
var t = (R, i, e) => (Ve(R, i, "read from private field"), e ? e.call(R) : i.get(R)), d = (R, i, e) => i.has(R) ? Fe("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(R) : i.set(R, e), y = (R, i, e, s) => (Ve(R, i, "write to private field"), s ? s.call(R, e) : i.set(R, e), e);
|
|
9
9
|
var Ye = (R, i, e, s) => ({
|
|
10
10
|
set _(r) {
|
|
@@ -22,7 +22,7 @@ const Le = class Le extends Xe.constructor {
|
|
|
22
22
|
};
|
|
23
23
|
h(Le, "Trace");
|
|
24
24
|
let oe = Le;
|
|
25
|
-
const
|
|
25
|
+
const C = new oe();
|
|
26
26
|
var z, j, w, X, K, Z, It, G, _t;
|
|
27
27
|
const He = class He extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
@@ -40,7 +40,7 @@ const He = class He extends HTMLElement {
|
|
|
40
40
|
this.refresh();
|
|
41
41
|
})), t(this, Z).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
|
-
|
|
43
|
+
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
44
44
|
if (!t(this, z) || !t(this, w) || t(this, j)) return;
|
|
45
45
|
const e = t(this, w).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
@@ -211,9 +211,9 @@ const Me = class Me extends HTMLElement {
|
|
|
211
211
|
d(this, q);
|
|
212
212
|
d(this, xt, 0);
|
|
213
213
|
d(this, vt, 0);
|
|
214
|
-
|
|
214
|
+
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
215
|
if (!t(this, F) || !t(this, q)) return;
|
|
216
|
-
|
|
216
|
+
C.log("nine-table-vscrollbar.refresh");
|
|
217
217
|
const e = t(this, q).container, s = t(this, q).track, r = t(this, q).thumb, n = e.clientHeight, o = (t(this, F).data.get() || []).length, c = t(this, ot).getRowHeight(), l = o * c;
|
|
218
218
|
if (l <= n) {
|
|
219
219
|
r.style.display = "none", t(this, q).top.disabled = !0, t(this, q).bottom.disabled = !0;
|
|
@@ -231,7 +231,7 @@ const Me = class Me extends HTMLElement {
|
|
|
231
231
|
x < 0 && (x = 0), x > v && (x = v), r.style.top = `${x}px`, t(this, q).top.disabled = g <= 0, t(this, q).bottom.disabled = g >= b - 1;
|
|
232
232
|
}, "refresh"));
|
|
233
233
|
d(this, Nt, /* @__PURE__ */ h(() => {
|
|
234
|
-
|
|
234
|
+
C.log("nine-table-vscrollbar.#init");
|
|
235
235
|
const e = t(this, q).container, s = /* @__PURE__ */ h(() => {
|
|
236
236
|
const n = (t(this, F).data.get() || []).length, a = t(this, ot).getRowHeight();
|
|
237
237
|
return n * a;
|
|
@@ -355,11 +355,11 @@ const Me = class Me extends HTMLElement {
|
|
|
355
355
|
F = new WeakMap(), ot = new WeakMap(), J = new WeakMap(), q = new WeakMap(), xt = new WeakMap(), vt = new WeakMap(), Nt = new WeakMap(), h(Me, "NineTableVScrollBar");
|
|
356
356
|
let le = Me;
|
|
357
357
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", le);
|
|
358
|
-
var P,
|
|
358
|
+
var P, S, D, M, V, Q, wt, Se, at, Wt, Ot, Bt, St, Et, zt, Dt, At, Ee, lt, Rt, Pt;
|
|
359
359
|
const $e = class $e {
|
|
360
360
|
constructor(i) {
|
|
361
361
|
d(this, P);
|
|
362
|
-
d(this,
|
|
362
|
+
d(this, S);
|
|
363
363
|
d(this, D, /* @__PURE__ */ new Map());
|
|
364
364
|
d(this, M, null);
|
|
365
365
|
d(this, V, null);
|
|
@@ -368,14 +368,14 @@ const $e = class $e {
|
|
|
368
368
|
d(this, Se, !1);
|
|
369
369
|
d(this, at, !1);
|
|
370
370
|
d(this, Wt, 3);
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
const i = t(this,
|
|
371
|
+
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
372
|
+
C.log("rowManager.refresh");
|
|
373
|
+
const i = t(this, S).querySelector(".ng-container-body .ng-part-body");
|
|
374
374
|
i && (t(this, St).call(this), t(this, lt).call(this, i.scrollTop));
|
|
375
375
|
}, "refresh"));
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
const o = t(this,
|
|
376
|
+
E(this, "initialize", /* @__PURE__ */ h(() => {
|
|
377
|
+
C.log("rowManager.initialize"), y(this, M, null), t(this, D).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((a) => {
|
|
378
|
+
const o = t(this, S).querySelector(a);
|
|
379
379
|
if (!o) return;
|
|
380
380
|
const c = o.querySelector(".ng-part-body table");
|
|
381
381
|
if (!c) return;
|
|
@@ -384,13 +384,13 @@ const $e = class $e {
|
|
|
384
384
|
const u = Array.from(l.querySelectorAll("tr")).map((g) => g.cloneNode(!0));
|
|
385
385
|
t(this, D).set(a, u);
|
|
386
386
|
});
|
|
387
|
-
const i = t(this,
|
|
387
|
+
const i = t(this, S).querySelector(".ng-container-body .ng-part-body"), e = t(this, S).querySelector(".ng-container-left .ng-part-body"), s = t(this, S).querySelector(".ng-container-right .ng-part-body"), r = t(this, S).querySelector(".ng-container-body .ng-part-header"), n = t(this, S).querySelector(".ng-container-body .ng-part-footer");
|
|
388
388
|
if (i) {
|
|
389
389
|
t(this, Bt).call(this, i), t(this, At).call(this), t(this, St).call(this), t(this, lt).call(this, i.scrollTop);
|
|
390
390
|
let a = !1;
|
|
391
391
|
const o = /* @__PURE__ */ h((c, l, f) => {
|
|
392
392
|
var u;
|
|
393
|
-
a || (a = !0, i && i.scrollTop !== c && (i.scrollTop = c), e && e.scrollTop !== c && (e.scrollTop = c), s && s.scrollTop !== c && (s.scrollTop = c), r && r.scrollLeft !== l && (r.scrollLeft = l), n && n.scrollLeft !== l && (n.scrollLeft = l), t(this, lt).call(this, c), (u = t(this,
|
|
393
|
+
a || (a = !0, i && i.scrollTop !== c && (i.scrollTop = c), e && e.scrollTop !== c && (e.scrollTop = c), s && s.scrollTop !== c && (s.scrollTop = c), r && r.scrollLeft !== l && (r.scrollLeft = l), n && n.scrollLeft !== l && (n.scrollLeft = l), t(this, lt).call(this, c), (u = t(this, S).querySelector("nine-table-vscrollbar")) == null || u.refresh(), a = !1);
|
|
394
394
|
}, "syncScroll");
|
|
395
395
|
[i, e, s].forEach((c) => {
|
|
396
396
|
c && c.addEventListener("scroll", () => {
|
|
@@ -402,7 +402,7 @@ const $e = class $e {
|
|
|
402
402
|
}
|
|
403
403
|
}, "initialize"));
|
|
404
404
|
d(this, Ot, /* @__PURE__ */ h((i, e) => {
|
|
405
|
-
|
|
405
|
+
C.log("rowManager.#renderRows");
|
|
406
406
|
const s = t(this, D).get(e);
|
|
407
407
|
if (!s || s.length === 0) return;
|
|
408
408
|
const r = i.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
@@ -416,9 +416,9 @@ const $e = class $e {
|
|
|
416
416
|
n ? n.before(a) : r.appendChild(a);
|
|
417
417
|
}, "#renderRows"));
|
|
418
418
|
d(this, Bt, /* @__PURE__ */ h((i) => {
|
|
419
|
-
if (
|
|
419
|
+
if (C.log("rowManager.#measureAndCacheHeight"), t(this, M) !== null && t(this, M) > 0)
|
|
420
420
|
return t(this, M);
|
|
421
|
-
|
|
421
|
+
C.log("#measureAndCacheHeight");
|
|
422
422
|
const e = t(this, D).get(".ng-container-body");
|
|
423
423
|
if (!e || e.length === 0) return 24;
|
|
424
424
|
const s = i.querySelector("tbody.bindable-tbody");
|
|
@@ -428,7 +428,7 @@ const $e = class $e {
|
|
|
428
428
|
e.forEach((g) => {
|
|
429
429
|
n.appendChild(g.cloneNode(!0));
|
|
430
430
|
}), r ? r.before(n) : s.appendChild(n);
|
|
431
|
-
const a = t(this,
|
|
431
|
+
const a = t(this, S), o = a.style.display, c = a.style.visibility, l = a.style.position;
|
|
432
432
|
(o === "none" || window.getComputedStyle(a).display === "none") && (a.style.display = "block", a.style.visibility = "hidden", a.style.position = "absolute");
|
|
433
433
|
let f = 0;
|
|
434
434
|
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
@@ -437,10 +437,10 @@ const $e = class $e {
|
|
|
437
437
|
}), u.forEach((g) => g.remove()), a.style.display = o, a.style.visibility = c, a.style.position = l, y(this, M, f > 0 ? f : 24), t(this, Et).call(this), t(this, M);
|
|
438
438
|
}, "#measureAndCacheHeight"));
|
|
439
439
|
d(this, St, /* @__PURE__ */ h(() => {
|
|
440
|
-
|
|
440
|
+
C.log("rowManager.#updateVirtualScrollHeight");
|
|
441
441
|
const e = (t(this, P).data.get() || []).length, s = t(this, M), r = e * s;
|
|
442
442
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
443
|
-
const a = t(this,
|
|
443
|
+
const a = t(this, S).querySelector(n);
|
|
444
444
|
if (!a) return;
|
|
445
445
|
const o = a.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
446
446
|
o && (o.style.height = `${r}px`);
|
|
@@ -454,7 +454,7 @@ const $e = class $e {
|
|
|
454
454
|
}, "#updateRowCount"));
|
|
455
455
|
d(this, zt, /* @__PURE__ */ h(() => {
|
|
456
456
|
var o, c, l, f, u, g;
|
|
457
|
-
const i = t(this,
|
|
457
|
+
const i = t(this, S).querySelector(".ng-container-left .ng-part-body table"), e = t(this, S).querySelector(".ng-container-body .ng-part-body table"), s = t(this, S).querySelector(".ng-container-right .ng-part-body table");
|
|
458
458
|
if (e) {
|
|
459
459
|
const b = i ? Array.from(i.querySelectorAll("tbody tr")) : [], x = Array.from(e.querySelectorAll("tbody tr")), v = s ? Array.from(s.querySelectorAll("tbody tr")) : [], A = Math.max(b.length, x.length, v.length);
|
|
460
460
|
for (let m = 0; m < A; m++) {
|
|
@@ -462,11 +462,11 @@ const $e = class $e {
|
|
|
462
462
|
((o = b[m]) == null ? void 0 : o.getBoundingClientRect().height) || 0,
|
|
463
463
|
((c = x[m]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
464
464
|
((l = v[m]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
465
|
-
],
|
|
466
|
-
|
|
465
|
+
], L = Math.max(...W);
|
|
466
|
+
L > 0 && (b[m] && (b[m].style.height = `${L}px`), x[m] && (x[m].style.height = `${L}px`), v[m] && (v[m].style.height = `${L}px`));
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
|
-
const r = t(this,
|
|
469
|
+
const r = t(this, S).querySelector(".ng-container-left .ng-part-footer table"), n = t(this, S).querySelector(".ng-container-body .ng-part-footer table"), a = t(this, S).querySelector(".ng-container-right .ng-part-footer table");
|
|
470
470
|
if (n) {
|
|
471
471
|
const b = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], x = Array.from(n.querySelectorAll("tfoot tr")), v = a ? Array.from(a.querySelectorAll("tfoot tr")) : [], A = Math.max(b.length, x.length, v.length);
|
|
472
472
|
for (let m = 0; m < A; m++) {
|
|
@@ -474,13 +474,13 @@ const $e = class $e {
|
|
|
474
474
|
((f = b[m]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
475
475
|
((u = x[m]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
|
|
476
476
|
((g = v[m]) == null ? void 0 : g.getBoundingClientRect().height) || 0
|
|
477
|
-
],
|
|
478
|
-
|
|
477
|
+
], L = Math.max(...W);
|
|
478
|
+
L > 0 && (b[m] && (b[m].style.height = `${L}px`), x[m] && (x[m].style.height = `${L}px`), v[m] && (v[m].style.height = `${L}px`));
|
|
479
479
|
}
|
|
480
480
|
}
|
|
481
481
|
}, "#syncRowHeights"));
|
|
482
482
|
d(this, Dt, /* @__PURE__ */ h(() => {
|
|
483
|
-
!t(this,
|
|
483
|
+
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (y(this, V, new ResizeObserver((i) => {
|
|
484
484
|
for (const e of i) {
|
|
485
485
|
const s = e.target;
|
|
486
486
|
if (!s.classList.contains("active")) continue;
|
|
@@ -493,18 +493,18 @@ const $e = class $e {
|
|
|
493
493
|
t(this, Q) !== c && (y(this, Q, c), t(this, Et).call(this), t(this, M) !== null && (t(this, At).call(this), this.refresh()));
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
|
-
})), t(this, V).observe(t(this,
|
|
496
|
+
})), t(this, V).observe(t(this, S)));
|
|
497
497
|
}, "#initResizeObserver"));
|
|
498
498
|
d(this, At, /* @__PURE__ */ h(() => {
|
|
499
|
-
|
|
500
|
-
const e = t(this,
|
|
499
|
+
C.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
500
|
+
const e = t(this, S).querySelector(i);
|
|
501
501
|
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Ot).call(this, e, i);
|
|
502
502
|
}), t(this, Pt).call(this), t(this, zt).call(this);
|
|
503
503
|
}, "#renderAllContainers"));
|
|
504
504
|
d(this, Ee, /* @__PURE__ */ h((i) => {
|
|
505
505
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
506
506
|
var l;
|
|
507
|
-
const s = t(this,
|
|
507
|
+
const s = t(this, S).querySelector(e);
|
|
508
508
|
if (!s) return;
|
|
509
509
|
const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
510
510
|
if (!r) return;
|
|
@@ -524,11 +524,13 @@ const $e = class $e {
|
|
|
524
524
|
var f;
|
|
525
525
|
const e = t(this, M);
|
|
526
526
|
if (!e || e <= 0) return;
|
|
527
|
-
const s = t(this, P).data.length
|
|
528
|
-
|
|
527
|
+
const s = t(this, P).data.length;
|
|
528
|
+
C.log(s);
|
|
529
|
+
const r = Math.max(0, Math.floor(i / e)), n = r * e, a = ((f = t(this, D).get(".ng-container-body")) == null ? void 0 : f.length) || 1, o = t(this, S).querySelector(".ng-container-body"), c = o == null ? void 0 : o.querySelector(".ng-part-body tbody.bindable-tbody tr:not(.nodata)"), l = c && c.dataset.row !== void 0 ? parseInt(c.dataset.row, 10) : -1;
|
|
530
|
+
t(this, S).querySelectorAll(".ng-part-body table").forEach((u) => {
|
|
529
531
|
u.style.transform = `translateY(${n}px)`;
|
|
530
|
-
}),
|
|
531
|
-
const g = t(this,
|
|
532
|
+
}), C.log("#handleScroll", l, r), l !== r && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((u) => {
|
|
533
|
+
const g = t(this, S).querySelector(u);
|
|
532
534
|
if (!g) return;
|
|
533
535
|
const b = g.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
534
536
|
if (!b) return;
|
|
@@ -558,7 +560,7 @@ const $e = class $e {
|
|
|
558
560
|
});
|
|
559
561
|
}; */
|
|
560
562
|
d(this, Rt, /* @__PURE__ */ h((i, e, s) => {
|
|
561
|
-
i.dataset.row = s, i.data = e,
|
|
563
|
+
i.dataset.row = s, i.data = e, C.log(e, s), Array.from(i.cells).forEach((r, n) => {
|
|
562
564
|
r.dataset.row = s;
|
|
563
565
|
const a = Array.from(r.children).find((o) => o.tagName.toLowerCase().startsWith("cell-") || typeof o.refresh == "function");
|
|
564
566
|
a && typeof a.refresh == "function" && a.refresh();
|
|
@@ -566,8 +568,8 @@ const $e = class $e {
|
|
|
566
568
|
}, "#bindRowData"));
|
|
567
569
|
d(this, Pt, /* @__PURE__ */ h(() => {
|
|
568
570
|
var c, l, f;
|
|
569
|
-
|
|
570
|
-
const i = t(this,
|
|
571
|
+
C.log("rowManager.#syncHeaderHeights");
|
|
572
|
+
const i = t(this, S).querySelector(".ng-container-left .ng-part-header table"), e = t(this, S).querySelector(".ng-container-body .ng-part-header table"), s = t(this, S).querySelector(".ng-container-right .ng-part-header table");
|
|
571
573
|
if (!e) return;
|
|
572
574
|
const r = i ? Array.from(i.querySelectorAll("tr")) : [], n = Array.from(e.querySelectorAll("tr")), a = s ? Array.from(s.querySelectorAll("tr")) : [], o = Math.max(r.length, n.length, a.length);
|
|
573
575
|
for (let u = 0; u < o; u++) {
|
|
@@ -579,10 +581,10 @@ const $e = class $e {
|
|
|
579
581
|
b > 0 && (r[u] && (r[u].style.height = `${b}px`), n[u] && (n[u].style.height = `${b}px`), a[u] && (a[u].style.height = `${b}px`));
|
|
580
582
|
}
|
|
581
583
|
}, "#syncHeaderHeights"));
|
|
582
|
-
|
|
584
|
+
E(this, "destroy", /* @__PURE__ */ h(() => {
|
|
583
585
|
t(this, V) && (t(this, V).disconnect(), y(this, V, null));
|
|
584
586
|
}, "destroy"));
|
|
585
|
-
y(this, P, i.getRootNode().host), y(this,
|
|
587
|
+
y(this, P, i.getRootNode().host), y(this, S, i), t(this, Dt).call(this);
|
|
586
588
|
}
|
|
587
589
|
getRowHeight() {
|
|
588
590
|
return t(this, M);
|
|
@@ -592,7 +594,7 @@ const $e = class $e {
|
|
|
592
594
|
return ((e = t(this, D).get(i)) == null ? void 0 : e.length) || 1;
|
|
593
595
|
}
|
|
594
596
|
};
|
|
595
|
-
P = new WeakMap(),
|
|
597
|
+
P = new WeakMap(), S = new WeakMap(), D = new WeakMap(), M = new WeakMap(), V = new WeakMap(), Q = new WeakMap(), wt = new WeakMap(), Se = new WeakMap(), at = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), Bt = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), zt = new WeakMap(), Dt = new WeakMap(), At = new WeakMap(), Ee = new WeakMap(), lt = new WeakMap(), Rt = new WeakMap(), Pt = new WeakMap(), h($e, "RowManager");
|
|
596
598
|
let ce = $e;
|
|
597
599
|
const jt = class jt {
|
|
598
600
|
/**
|
|
@@ -646,9 +648,9 @@ const jt = class jt {
|
|
|
646
648
|
A = B;
|
|
647
649
|
break;
|
|
648
650
|
}
|
|
649
|
-
const W = m.rowSpan || 1,
|
|
651
|
+
const W = m.rowSpan || 1, L = m.colSpan || 1;
|
|
650
652
|
for (let B = 0; B < W; B++)
|
|
651
|
-
for (let yt = 0; yt <
|
|
653
|
+
for (let yt = 0; yt < L; yt++)
|
|
652
654
|
v + B < u && A + yt < g && (b[v + B][A + yt] = B === 0 && yt === 0 ? "1" : "0");
|
|
653
655
|
});
|
|
654
656
|
}), l.forEach((x) => {
|
|
@@ -680,7 +682,7 @@ const pt = class pt extends HTMLElement {
|
|
|
680
682
|
d(this, Ft);
|
|
681
683
|
d(this, tt, null);
|
|
682
684
|
d(this, et);
|
|
683
|
-
|
|
685
|
+
E(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
684
686
|
t(this, et).refresh();
|
|
685
687
|
}, "invalidate"));
|
|
686
688
|
d(this, Vt, /* @__PURE__ */ h(() => {
|
|
@@ -715,7 +717,7 @@ const pt = class pt extends HTMLElement {
|
|
|
715
717
|
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${n}px`, s.style.width = `${n}px`);
|
|
716
718
|
});
|
|
717
719
|
}, "#updateContainerWidths"));
|
|
718
|
-
|
|
720
|
+
E(this, "generate", /* @__PURE__ */ h((e) => {
|
|
719
721
|
e && (y(this, tt, he.compile(e)), t(this, Vt).call(this), t(this, Yt).call(this), t(this, et).initialize(), setTimeout(() => {
|
|
720
722
|
var s;
|
|
721
723
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
@@ -737,12 +739,12 @@ const pt = class pt extends HTMLElement {
|
|
|
737
739
|
l.remove();
|
|
738
740
|
}), n;
|
|
739
741
|
}, "#createSplitTable"));
|
|
740
|
-
|
|
741
|
-
|
|
742
|
+
E(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, et).getRowHeight(), "getRowHeight"));
|
|
743
|
+
E(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
742
744
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
743
745
|
s && (s.scrollLeft = e);
|
|
744
746
|
}, "scrollToX"));
|
|
745
|
-
|
|
747
|
+
E(this, "scrollToY", /* @__PURE__ */ h((e) => {
|
|
746
748
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
747
749
|
s && (s.scrollTop = e);
|
|
748
750
|
}, "scrollToY"));
|
|
@@ -898,10 +900,10 @@ const pt = class pt extends HTMLElement {
|
|
|
898
900
|
t(this, Ut).call(this);
|
|
899
901
|
}
|
|
900
902
|
disconnectedCallback() {
|
|
901
|
-
this.innerHTML = "",
|
|
903
|
+
this.innerHTML = "", C.log("NineTableSheet destroyed.");
|
|
902
904
|
}
|
|
903
905
|
};
|
|
904
|
-
Ft = new WeakMap(), tt = new WeakMap(), et = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), ct = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(), h(pt, "NineTableSheet"),
|
|
906
|
+
Ft = new WeakMap(), tt = new WeakMap(), et = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), ct = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(), h(pt, "NineTableSheet"), E(pt, "SCROLLBAR_SIZE", 16);
|
|
905
907
|
let $t = pt;
|
|
906
908
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", $t);
|
|
907
909
|
var Kt, qt;
|
|
@@ -1085,7 +1087,7 @@ const Ne = class Ne {
|
|
|
1085
1087
|
constructor(i) {
|
|
1086
1088
|
d(this, Tt);
|
|
1087
1089
|
d(this, ht, -1);
|
|
1088
|
-
|
|
1090
|
+
E(this, "count", /* @__PURE__ */ h(() => t(this, Tt).rawRecords.length, "count"));
|
|
1089
1091
|
y(this, Tt, i);
|
|
1090
1092
|
}
|
|
1091
1093
|
get at() {
|
|
@@ -1122,7 +1124,7 @@ const O = class O {
|
|
|
1122
1124
|
i.invalidate();
|
|
1123
1125
|
});
|
|
1124
1126
|
}, "#invalidate"));
|
|
1125
|
-
|
|
1127
|
+
E(this, "get", /* @__PURE__ */ h((i, e) => {
|
|
1126
1128
|
var n;
|
|
1127
1129
|
const s = this.getValidData();
|
|
1128
1130
|
if (!s || s.length <= 0) return;
|
|
@@ -1135,7 +1137,7 @@ const O = class O {
|
|
|
1135
1137
|
}
|
|
1136
1138
|
return t(this, ft).call(this, s[i]);
|
|
1137
1139
|
}, "get"));
|
|
1138
|
-
|
|
1140
|
+
E(this, "set", /* @__PURE__ */ h((i) => {
|
|
1139
1141
|
this.clear(), this.add(i, !1), t(this, st).call(this);
|
|
1140
1142
|
}, "set"));
|
|
1141
1143
|
d(this, Ct, /* @__PURE__ */ h(() => ({
|
|
@@ -1147,10 +1149,10 @@ const O = class O {
|
|
|
1147
1149
|
c: {},
|
|
1148
1150
|
_: [0, 0, 0, 0, O.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Y).slice(), -1, {}, {}]
|
|
1149
1151
|
}), "#getDefaultMeta"));
|
|
1150
|
-
|
|
1152
|
+
E(this, "reset", /* @__PURE__ */ h(() => {
|
|
1151
1153
|
y(this, N, []), y(this, dt, []), t(this, st).call(this);
|
|
1152
1154
|
}, "reset"));
|
|
1153
|
-
|
|
1155
|
+
E(this, "clear", /* @__PURE__ */ h(() => {
|
|
1154
1156
|
var i;
|
|
1155
1157
|
t(this, k).rawRecords = [], y(this, N, []), y(this, dt, []), (i = t(this, k).viewRecords) != null && i.reset && t(this, k).viewRecords.reset();
|
|
1156
1158
|
}, "clear"));
|
|
@@ -1168,7 +1170,7 @@ const O = class O {
|
|
|
1168
1170
|
d(this, ee, /* @__PURE__ */ h((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1169
1171
|
e.__ng = t(this, Ct).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = O.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1170
1172
|
}), i), "#defaultInsert"));
|
|
1171
|
-
|
|
1173
|
+
E(this, "add", /* @__PURE__ */ h((i, e = !0) => {
|
|
1172
1174
|
i === void 0 && (i = {});
|
|
1173
1175
|
const s = t(this, te).call(this, i);
|
|
1174
1176
|
t(this, k).rawRecords = t(this, k).rawRecords.concat(t(this, ee).call(this, s)), this.resetRecords();
|
|
@@ -1178,7 +1180,7 @@ const O = class O {
|
|
|
1178
1180
|
o && (o.__ng.rowState = O.ROW_STATE.EMPTY);
|
|
1179
1181
|
}), t(this, st).call(this), r;
|
|
1180
1182
|
}, "add"));
|
|
1181
|
-
|
|
1183
|
+
E(this, "delete", /* @__PURE__ */ h((i) => {
|
|
1182
1184
|
let e = [];
|
|
1183
1185
|
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this, k).host.row.at] : e = [parseInt(i, 10)], e.sort((s, r) => r - s).forEach((s) => {
|
|
1184
1186
|
if (t(this, N)[s]) {
|
|
@@ -1189,7 +1191,7 @@ const O = class O {
|
|
|
1189
1191
|
}
|
|
1190
1192
|
}), this.resetRecords(), t(this, st).call(this);
|
|
1191
1193
|
}, "delete"));
|
|
1192
|
-
|
|
1194
|
+
E(this, "setValue", /* @__PURE__ */ h((i, e, s) => {
|
|
1193
1195
|
var c;
|
|
1194
1196
|
i = parseInt(i, 10);
|
|
1195
1197
|
const n = (typeof ((c = t(this, _).fields) == null ? void 0 : c.get) == "function" ? t(this, _).fields.get() : []).indexOf(e);
|
|
@@ -1199,14 +1201,14 @@ const O = class O {
|
|
|
1199
1201
|
const o = a.v[n];
|
|
1200
1202
|
o !== s && a.__ng.rowState !== O.ROW_STATE.INSERT && (a.__ng.o.hasOwnProperty(e) || (a.__ng.o[e] = o), a.__ng.rowState = O.ROW_STATE.UPDATE), a.v[n] = s;
|
|
1201
1203
|
}, "setValue"));
|
|
1202
|
-
|
|
1204
|
+
E(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1203
1205
|
y(this, dt, t(this, k).rawRecords.filter((i) => !i.__ng.deleted)), y(this, N, t(this, k).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, k).rawRecords.forEach((i, e) => {
|
|
1204
1206
|
i.__ng.rowidx = e;
|
|
1205
1207
|
}), t(this, N).forEach((i, e) => {
|
|
1206
1208
|
i.__ng.i = e;
|
|
1207
1209
|
});
|
|
1208
1210
|
}, "resetRecords"));
|
|
1209
|
-
|
|
1211
|
+
E(this, "getValidData", /* @__PURE__ */ h(() => (t(this, N).length === 0 && t(this, k).rawRecords.length > 0 && this.resetRecords(), t(this, N)), "getValidData"));
|
|
1210
1212
|
d(this, ft, /* @__PURE__ */ h((i) => {
|
|
1211
1213
|
var a;
|
|
1212
1214
|
if (!i) return i;
|
|
@@ -1218,7 +1220,7 @@ const O = class O {
|
|
|
1218
1220
|
});
|
|
1219
1221
|
return e ? n[0] : n;
|
|
1220
1222
|
}, "#conv"));
|
|
1221
|
-
|
|
1223
|
+
E(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1222
1224
|
y(this, _, i), y(this, k, e), t(this, Qt).call(this);
|
|
1223
1225
|
}
|
|
1224
1226
|
get source() {
|
|
@@ -1241,7 +1243,7 @@ const O = class O {
|
|
|
1241
1243
|
}
|
|
1242
1244
|
};
|
|
1243
1245
|
_ = new WeakMap(), k = new WeakMap(), N = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), Y = new WeakMap(), Qt = new WeakMap(), st = new WeakMap(), Ct = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), ft = new WeakMap(), h(O, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1244
|
-
|
|
1246
|
+
E(O, "ROW_STATE", {
|
|
1245
1247
|
EMPTY: "EMPTY",
|
|
1246
1248
|
NORMAL: "NORMAL",
|
|
1247
1249
|
INSERT: "INSERT",
|
|
@@ -1272,31 +1274,31 @@ const We = class We {
|
|
|
1272
1274
|
};
|
|
1273
1275
|
it = new WeakMap(), h(We, "ngDataManager");
|
|
1274
1276
|
let be = We;
|
|
1275
|
-
var ut,
|
|
1277
|
+
var ut, H, Lt, se;
|
|
1276
1278
|
const Oe = class Oe {
|
|
1277
1279
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1278
1280
|
constructor(i) {
|
|
1279
1281
|
d(this, ut);
|
|
1280
|
-
d(this,
|
|
1281
|
-
|
|
1282
|
+
d(this, H, []);
|
|
1283
|
+
E(this, "add", /* @__PURE__ */ h((i, e = "string") => {
|
|
1282
1284
|
i.forEach((s) => {
|
|
1283
|
-
t(this,
|
|
1285
|
+
t(this, H).some((r) => r.name === s) || t(this, H).push({ name: s, type: e });
|
|
1284
1286
|
}), t(this, Lt).call(this);
|
|
1285
1287
|
}, "add"));
|
|
1286
1288
|
d(this, Lt, /* @__PURE__ */ h(() => {
|
|
1287
1289
|
const i = /* @__PURE__ */ new Map();
|
|
1288
|
-
t(this,
|
|
1290
|
+
t(this, H).forEach((e) => {
|
|
1289
1291
|
i.set(e.name, e.type);
|
|
1290
|
-
}), y(this,
|
|
1292
|
+
}), y(this, H, Array.from(i, ([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);
|
|
1291
1293
|
}, "#adjust"));
|
|
1292
1294
|
d(this, se, /* @__PURE__ */ h(() => {
|
|
1293
|
-
y(this,
|
|
1295
|
+
y(this, H, []), C.log(t(this, ut).querySelectorAll("table"));
|
|
1294
1296
|
const i = Array.from(t(this, ut).querySelectorAll("table"));
|
|
1295
1297
|
if (!(!i || i.length === 0)) {
|
|
1296
1298
|
for (const e of i)
|
|
1297
|
-
|
|
1299
|
+
C.log(e), $("[data-bind]", e).each((s, r) => {
|
|
1298
1300
|
const n = r.dataset.bind, a = r.getAttribute("data-type") || "string";
|
|
1299
|
-
n && t(this,
|
|
1301
|
+
n && t(this, H).push({ name: n, type: a });
|
|
1300
1302
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
1301
1303
|
$(`[${s}]`, e).each((r, n) => {
|
|
1302
1304
|
var a = n.getAttribute(s);
|
|
@@ -1313,7 +1315,7 @@ const Oe = class Oe {
|
|
|
1313
1315
|
if (o.trim() != "") {
|
|
1314
1316
|
const c = o.search(/[^_A-Za-z0-9]/g);
|
|
1315
1317
|
let l = "";
|
|
1316
|
-
c >= 0 ? l = o.substring(0, c) : a.startsWith("data.") && (l = o.replace("data.", "")), l && t(this,
|
|
1318
|
+
c >= 0 ? l = o.substring(0, c) : a.startsWith("data.") && (l = o.replace("data.", "")), l && t(this, H).push({ name: l, type: "string" });
|
|
1317
1319
|
}
|
|
1318
1320
|
});
|
|
1319
1321
|
});
|
|
@@ -1325,25 +1327,25 @@ const Oe = class Oe {
|
|
|
1325
1327
|
}
|
|
1326
1328
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
1327
1329
|
get() {
|
|
1328
|
-
return t(this,
|
|
1330
|
+
return t(this, H).map((i) => i.name);
|
|
1329
1331
|
}
|
|
1330
1332
|
// π― λ΄λΆ κ°μ²΄ ν΅μ§Έλ‘ μ»κΈ°
|
|
1331
1333
|
getFields() {
|
|
1332
|
-
return t(this,
|
|
1334
|
+
return t(this, H);
|
|
1333
1335
|
}
|
|
1334
1336
|
// π― νΉμ νλμ λ°μ΄ν° νμ
μ‘°ν
|
|
1335
1337
|
getType(i) {
|
|
1336
|
-
const e = t(this,
|
|
1338
|
+
const e = t(this, H).find((s) => s.name === i);
|
|
1337
1339
|
return e ? e.type : "string";
|
|
1338
1340
|
}
|
|
1339
1341
|
indexOf(i) {
|
|
1340
|
-
return t(this,
|
|
1342
|
+
return t(this, H).findIndex((e) => e.name === i);
|
|
1341
1343
|
}
|
|
1342
1344
|
includes(i) {
|
|
1343
|
-
return t(this,
|
|
1345
|
+
return t(this, H).some((e) => e.name === i);
|
|
1344
1346
|
}
|
|
1345
1347
|
};
|
|
1346
|
-
ut = new WeakMap(),
|
|
1348
|
+
ut = new WeakMap(), H = new WeakMap(), Lt = new WeakMap(), se = new WeakMap(), h(Oe, "ngFields");
|
|
1347
1349
|
let ye = Oe;
|
|
1348
1350
|
var rt, ie, re;
|
|
1349
1351
|
const Be = class Be extends HTMLElement {
|
|
@@ -1353,7 +1355,7 @@ const Be = class Be extends HTMLElement {
|
|
|
1353
1355
|
d(this, rt);
|
|
1354
1356
|
d(this, ie);
|
|
1355
1357
|
d(this, re, /* @__PURE__ */ h(() => {
|
|
1356
|
-
this.fields = new ye(this), y(this, ie, new fe(this)),
|
|
1358
|
+
this.fields = new ye(this), y(this, ie, new fe(this)), C.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1357
1359
|
}, "#init"));
|
|
1358
1360
|
this.attachShadow({ mode: "open" }), y(this, rt, new be(this));
|
|
1359
1361
|
}
|
|
@@ -1361,7 +1363,7 @@ const Be = class Be extends HTMLElement {
|
|
|
1361
1363
|
t(this, re).call(this);
|
|
1362
1364
|
}
|
|
1363
1365
|
disconnectedCallback() {
|
|
1364
|
-
|
|
1366
|
+
C.log("NineTable disconnected.");
|
|
1365
1367
|
}
|
|
1366
1368
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1367
1369
|
get data() {
|
|
@@ -1390,7 +1392,7 @@ const mt = class mt extends HTMLElement {
|
|
|
1390
1392
|
connectedCallback() {
|
|
1391
1393
|
}
|
|
1392
1394
|
};
|
|
1393
|
-
h(mt, "BasicCellElement"),
|
|
1395
|
+
h(mt, "BasicCellElement"), E(mt, "_styleCache", /* @__PURE__ */ new Map()), E(mt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1394
1396
|
let me = mt;
|
|
1395
1397
|
var T, Ht, p, Ae, Re, qe, ke, Te;
|
|
1396
1398
|
const ze = class ze extends me {
|
|
@@ -1403,7 +1405,7 @@ const ze = class ze extends me {
|
|
|
1403
1405
|
d(this, Re);
|
|
1404
1406
|
d(this, qe);
|
|
1405
1407
|
d(this, ke);
|
|
1406
|
-
|
|
1408
|
+
E(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1407
1409
|
if (t(this, p))
|
|
1408
1410
|
if (t(this, p).closest("tbody")) {
|
|
1409
1411
|
const s = t(this, p).closest("tr").data, r = parseInt(t(this, p).dataset.row);
|
|
@@ -1429,8 +1431,8 @@ const ze = class ze extends me {
|
|
|
1429
1431
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1430
1432
|
var s = t(this, p).closest("tr"), r = [];
|
|
1431
1433
|
$("th,td", s).each((m, W) => {
|
|
1432
|
-
var
|
|
1433
|
-
|
|
1434
|
+
var L = ninegrid.j.querySelectorAll(W).attr("suppress");
|
|
1435
|
+
L && W.dataset.row && (L = parseInt(L), !isNaN(L) && L <= e && r.push(L));
|
|
1434
1436
|
}), r.sort();
|
|
1435
1437
|
var n = !1;
|
|
1436
1438
|
if (parseInt(s.sectionRowIndex / t(this, T).template.length) > 0)
|
|
@@ -1452,7 +1454,7 @@ const ze = class ze extends me {
|
|
|
1452
1454
|
}
|
|
1453
1455
|
}
|
|
1454
1456
|
}, "#resetSuppress"));
|
|
1455
|
-
|
|
1457
|
+
E(this, "getExprValue", /* @__PURE__ */ h((e, s, r, n) => {
|
|
1456
1458
|
if (typeof e < "u")
|
|
1457
1459
|
try {
|
|
1458
1460
|
r = parseInt(r);
|
|
@@ -1513,9 +1515,9 @@ const Pe = class Pe extends ve {
|
|
|
1513
1515
|
d(this, bt);
|
|
1514
1516
|
d(this, ne);
|
|
1515
1517
|
d(this, U);
|
|
1516
|
-
|
|
1518
|
+
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
1517
1519
|
const e = super.refresh();
|
|
1518
|
-
|
|
1520
|
+
C.log("::", e), t(this, Mt).value = e;
|
|
1519
1521
|
}, "refresh"));
|
|
1520
1522
|
/**
|
|
1521
1523
|
dataRefresh = (v) => {
|