@ninebone/table 0.0.558 β 0.0.560
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 +105 -104
- 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
|
@@ -4,7 +4,7 @@ var Ve = (R) => {
|
|
|
4
4
|
};
|
|
5
5
|
var Xe = (R, i, e) => i in R ? Fe(R, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : R[i] = e;
|
|
6
6
|
var h = (R, i) => Fe(R, "name", { value: i, configurable: !0 });
|
|
7
|
-
var
|
|
7
|
+
var E = (R, i, e) => Xe(R, typeof i != "symbol" ? i + "" : i, e), Ye = (R, i, e) => i.has(R) || Ve("Cannot " + e);
|
|
8
8
|
var t = (R, i, e) => (Ye(R, i, "read from private field"), e ? e.call(R) : i.get(R)), d = (R, i, e) => i.has(R) ? Ve("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(R) : i.set(R, e), p = (R, i, e, s) => (Ye(R, i, "write to private field"), s ? s.call(R, e) : i.set(R, e), e);
|
|
9
9
|
var Ue = (R, i, e, s) => ({
|
|
10
10
|
set _(r) {
|
|
@@ -40,7 +40,7 @@ const Me = class Me 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, P) || !t(this, w) || t(this, j)) return;
|
|
45
45
|
const e = t(this, w).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
@@ -58,8 +58,8 @@ const Me = class Me extends HTMLElement {
|
|
|
58
58
|
const u = e.scrollLeft, g = c - o;
|
|
59
59
|
let b = 0;
|
|
60
60
|
g > 0 && (b = parseInt(u / g * (l - f), 10)), b < 0 && (b = 0);
|
|
61
|
-
const
|
|
62
|
-
b >
|
|
61
|
+
const x = l - f;
|
|
62
|
+
b > x && (b = x), n.style.left = `${b}px`, t(this, w).left.disabled = b === 0, t(this, w).right.disabled = b >= x - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
64
|
d(this, G, /* @__PURE__ */ h((e) => {
|
|
65
65
|
if (!t(this, w)) return !1;
|
|
@@ -211,7 +211,7 @@ const $e = class $e 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
|
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, at).getRowHeight(), l = o * c;
|
|
217
217
|
if (l <= n) {
|
|
@@ -224,10 +224,10 @@ const $e = class $e extends HTMLElement {
|
|
|
224
224
|
const u = Math.max(Math.min(f * (n / l), f), 20);
|
|
225
225
|
r.style.height = `${u}px`;
|
|
226
226
|
const g = e.scrollTop, b = Math.max(l - n, 1);
|
|
227
|
-
let
|
|
228
|
-
b > 0 && (
|
|
227
|
+
let x = 0;
|
|
228
|
+
b > 0 && (x = g / b * (f - u));
|
|
229
229
|
const v = f - u;
|
|
230
|
-
|
|
230
|
+
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;
|
|
231
231
|
}, "refresh"));
|
|
232
232
|
d(this, Nt, /* @__PURE__ */ h(() => {
|
|
233
233
|
N.log("nine-table-vscrollbar.#init");
|
|
@@ -242,12 +242,12 @@ const $e = class $e extends HTMLElement {
|
|
|
242
242
|
r.stopPropagation(), r.preventDefault(), p(this, J, !0), p(this, xt, r.clientY), p(this, vt, e.scrollTop);
|
|
243
243
|
const n = /* @__PURE__ */ h((o) => {
|
|
244
244
|
if (!t(this, J)) return;
|
|
245
|
-
const c = t(this, q).track.getBoundingClientRect(), l = t(this, q).thumb.clientHeight, u = c.height - l, g = o.clientY - t(this, xt), b = e.clientHeight,
|
|
245
|
+
const c = t(this, q).track.getBoundingClientRect(), l = t(this, q).thumb.clientHeight, u = c.height - l, g = o.clientY - t(this, xt), b = e.clientHeight, x = s(), v = Math.max(x - b, 1);
|
|
246
246
|
if (u > 0 && v > 0) {
|
|
247
|
-
const
|
|
248
|
-
let
|
|
249
|
-
const
|
|
250
|
-
|
|
247
|
+
const A = g / u * v;
|
|
248
|
+
let m = t(this, vt) + A;
|
|
249
|
+
const W = Math.max(0, x - b);
|
|
250
|
+
m < 0 && (m = 0), m > W && (m = W), e.scrollTop = m;
|
|
251
251
|
}
|
|
252
252
|
this.refresh();
|
|
253
253
|
}, "onMouseMove"), a = /* @__PURE__ */ h(() => {
|
|
@@ -368,13 +368,13 @@ const Ie = class Ie {
|
|
|
368
368
|
d(this, Se, !1);
|
|
369
369
|
d(this, Ee, !1);
|
|
370
370
|
d(this, Wt, 3);
|
|
371
|
-
|
|
371
|
+
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
372
372
|
var e;
|
|
373
373
|
N.log("rowManager.refresh");
|
|
374
374
|
const i = t(this, S).querySelector(".ng-container-body .ng-part-body");
|
|
375
375
|
i && (t(this, St).call(this), t(this, lt).call(this, i.scrollTop), (e = t(this, S).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
376
376
|
}, "refresh"));
|
|
377
|
-
|
|
377
|
+
E(this, "initialize", /* @__PURE__ */ h(() => {
|
|
378
378
|
N.log("rowManager.initialize"), p(this, Q, {
|
|
379
379
|
scrollTables: t(this, S).querySelectorAll(".ng-part-body table"),
|
|
380
380
|
firstTr: t(this, S).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
@@ -450,26 +450,26 @@ const Ie = class Ie {
|
|
|
450
450
|
var o, c, l, f, u, g;
|
|
451
451
|
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");
|
|
452
452
|
if (e) {
|
|
453
|
-
const b = i ? Array.from(i.querySelectorAll("tbody tr")) : [],
|
|
454
|
-
for (let
|
|
455
|
-
const
|
|
456
|
-
((o = b[
|
|
457
|
-
((c = m
|
|
458
|
-
((l = v[
|
|
459
|
-
], C = Math.max(...
|
|
460
|
-
C > 0 && (b[
|
|
453
|
+
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);
|
|
454
|
+
for (let m = 0; m < A; m++) {
|
|
455
|
+
const W = [
|
|
456
|
+
((o = b[m]) == null ? void 0 : o.getBoundingClientRect().height) || 0,
|
|
457
|
+
((c = x[m]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
458
|
+
((l = v[m]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
459
|
+
], C = Math.max(...W);
|
|
460
|
+
C > 0 && (b[m] && (b[m].style.height = `${C}px`), x[m] && (x[m].style.height = `${C}px`), v[m] && (v[m].style.height = `${C}px`));
|
|
461
461
|
}
|
|
462
462
|
}
|
|
463
463
|
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");
|
|
464
464
|
if (n) {
|
|
465
|
-
const b = r ? Array.from(r.querySelectorAll("tfoot tr")) : [],
|
|
466
|
-
for (let
|
|
467
|
-
const
|
|
468
|
-
((f = b[
|
|
469
|
-
((u = m
|
|
470
|
-
((g = v[
|
|
471
|
-
], C = Math.max(...
|
|
472
|
-
C > 0 && (b[
|
|
465
|
+
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);
|
|
466
|
+
for (let m = 0; m < A; m++) {
|
|
467
|
+
const W = [
|
|
468
|
+
((f = b[m]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
469
|
+
((u = x[m]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
|
|
470
|
+
((g = v[m]) == null ? void 0 : g.getBoundingClientRect().height) || 0
|
|
471
|
+
], C = Math.max(...W);
|
|
472
|
+
C > 0 && (b[m] && (b[m].style.height = `${C}px`), x[m] && (x[m].style.height = `${C}px`), v[m] && (v[m].style.height = `${C}px`));
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
475
|
}, "#syncRowHeights"));
|
|
@@ -515,24 +515,25 @@ const Ie = class Ie {
|
|
|
515
515
|
});
|
|
516
516
|
}, "#adjustBufferRows"));
|
|
517
517
|
d(this, lt, /* @__PURE__ */ h((i) => {
|
|
518
|
-
var
|
|
518
|
+
var l, f;
|
|
519
519
|
const e = t(this, H);
|
|
520
520
|
if (!e || e <= 0) return;
|
|
521
|
-
const s = t(this, D).data.length, r = Math.max(0, Math.floor(i / e)), n = ((
|
|
522
|
-
(
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
const g = u.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
521
|
+
const s = t(this, D).data.length, r = Math.max(0, Math.floor(i / e)), n = r * e, a = ((l = t(this, z).get(".ng-container-body")) == null ? void 0 : l.length) || 1, o = t(this, Q).firstTr, c = o && o.dataset.row !== void 0 ? parseInt(o.dataset.row, 10) : -1;
|
|
522
|
+
(f = t(this, Q)) == null || f.scrollTables.forEach((u) => {
|
|
523
|
+
u.style.transform = `translate3d(0, ${n}px, 0)`;
|
|
524
|
+
}), c !== r && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((u) => {
|
|
525
|
+
const g = t(this, S).querySelector(u);
|
|
527
526
|
if (!g) return;
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
527
|
+
const b = g.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
528
|
+
if (!b) return;
|
|
529
|
+
Array.from(b.querySelectorAll("tr:not(.nodata)")).forEach((v, A) => {
|
|
530
|
+
const m = r + Math.floor(A / a);
|
|
531
|
+
if (m >= s) {
|
|
532
|
+
v.style.display = "none";
|
|
532
533
|
return;
|
|
533
534
|
}
|
|
534
|
-
const
|
|
535
|
-
|
|
535
|
+
const W = t(this, D).data.get(m);
|
|
536
|
+
v.style.display = "", t(this, Rt).call(this, v, W, m);
|
|
536
537
|
});
|
|
537
538
|
});
|
|
538
539
|
}, "#handleScroll"));
|
|
@@ -572,7 +573,7 @@ const Ie = class Ie {
|
|
|
572
573
|
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`));
|
|
573
574
|
}
|
|
574
575
|
}, "#syncHeaderHeights"));
|
|
575
|
-
|
|
576
|
+
E(this, "destroy", /* @__PURE__ */ h(() => {
|
|
576
577
|
t(this, V) && (t(this, V).disconnect(), p(this, V, null));
|
|
577
578
|
}, "destroy"));
|
|
578
579
|
p(this, D, i.getRootNode().host), p(this, S, i), t(this, zt).call(this);
|
|
@@ -604,9 +605,9 @@ const jt = class jt {
|
|
|
604
605
|
const f = l.getAttribute("cell-type") || "renderer";
|
|
605
606
|
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
606
607
|
let u = `cell-${f}`;
|
|
607
|
-
const g = l.getAttribute("data-bind"), b = l.getAttribute("data-expr"),
|
|
608
|
-
let
|
|
609
|
-
g &&
|
|
608
|
+
const g = l.getAttribute("data-bind"), b = l.getAttribute("data-expr"), x = l.getAttribute("maxbyte"), v = l.getAttribute("type");
|
|
609
|
+
let A = [];
|
|
610
|
+
g && A.push(`data-bind="${g}"`), b && A.push(`data-expr="${b}"`), x && A.push(`maxbyte="${x}"`), v && A.push(`type="${v}"`), l.innerHTML = `<${u} ${A.join(" ")}></${u}>`;
|
|
610
611
|
});
|
|
611
612
|
}, "processCellTypes"), s = /* @__PURE__ */ h((o) => {
|
|
612
613
|
if (!o.querySelector("colgroup")) {
|
|
@@ -626,30 +627,30 @@ const jt = class jt {
|
|
|
626
627
|
const l = Array.from(o.querySelectorAll(c + " tr")), f = Array.from(o.querySelectorAll(c + " th," + c + " td")), u = l.length;
|
|
627
628
|
if (u === 0 || f.length === 0) return;
|
|
628
629
|
let g = 0;
|
|
629
|
-
f.forEach((
|
|
630
|
-
g +=
|
|
630
|
+
f.forEach((x) => {
|
|
631
|
+
g += x.colSpan || 1;
|
|
631
632
|
});
|
|
632
633
|
const b = Array.from(Array(u), () => Array(g).fill(null));
|
|
633
|
-
l.forEach((
|
|
634
|
-
const v =
|
|
635
|
-
let
|
|
636
|
-
Array.from(
|
|
634
|
+
l.forEach((x) => {
|
|
635
|
+
const v = x.sectionRowIndex;
|
|
636
|
+
let A = 0;
|
|
637
|
+
Array.from(x.querySelectorAll("th,td")).forEach((m) => {
|
|
637
638
|
for (let B = 0; B < b[v].length; B++)
|
|
638
639
|
if (b[v][B] === null) {
|
|
639
|
-
|
|
640
|
+
A = B;
|
|
640
641
|
break;
|
|
641
642
|
}
|
|
642
|
-
const
|
|
643
|
-
for (let B = 0; B <
|
|
643
|
+
const W = m.rowSpan || 1, C = m.colSpan || 1;
|
|
644
|
+
for (let B = 0; B < W; B++)
|
|
644
645
|
for (let pt = 0; pt < C; pt++)
|
|
645
|
-
v + B < u &&
|
|
646
|
+
v + B < u && A + pt < g && (b[v + B][A + pt] = B === 0 && pt === 0 ? "1" : "0");
|
|
646
647
|
});
|
|
647
|
-
}), l.forEach((
|
|
648
|
-
const v =
|
|
649
|
-
Array.from(
|
|
650
|
-
for (let
|
|
651
|
-
if (b[v][
|
|
652
|
-
|
|
648
|
+
}), l.forEach((x) => {
|
|
649
|
+
const v = x.sectionRowIndex;
|
|
650
|
+
Array.from(x.querySelectorAll("th,td")).forEach((A) => {
|
|
651
|
+
for (let m = 0; m < b[v].length; m++)
|
|
652
|
+
if (b[v][m] === "1") {
|
|
653
|
+
A.dataset.col = m, b[v][m] = "0";
|
|
653
654
|
break;
|
|
654
655
|
}
|
|
655
656
|
});
|
|
@@ -673,7 +674,7 @@ const yt = class yt extends HTMLElement {
|
|
|
673
674
|
d(this, Ft);
|
|
674
675
|
d(this, et, null);
|
|
675
676
|
d(this, st);
|
|
676
|
-
|
|
677
|
+
E(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
677
678
|
t(this, st).refresh();
|
|
678
679
|
}, "invalidate"));
|
|
679
680
|
d(this, Vt, /* @__PURE__ */ h(() => {
|
|
@@ -708,7 +709,7 @@ const yt = class yt extends HTMLElement {
|
|
|
708
709
|
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${n}px`, s.style.width = `${n}px`);
|
|
709
710
|
});
|
|
710
711
|
}, "#updateContainerWidths"));
|
|
711
|
-
|
|
712
|
+
E(this, "generate", /* @__PURE__ */ h((e) => {
|
|
712
713
|
e && (p(this, et, he.compile(e)), t(this, Vt).call(this), t(this, Yt).call(this), t(this, st).initialize(), setTimeout(() => {
|
|
713
714
|
var s;
|
|
714
715
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
@@ -730,12 +731,12 @@ const yt = class yt extends HTMLElement {
|
|
|
730
731
|
l.remove();
|
|
731
732
|
}), n;
|
|
732
733
|
}, "#createSplitTable"));
|
|
733
|
-
|
|
734
|
-
|
|
734
|
+
E(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, st).getRowHeight(), "getRowHeight"));
|
|
735
|
+
E(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
735
736
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
736
737
|
s && (s.scrollLeft = e);
|
|
737
738
|
}, "scrollToX"));
|
|
738
|
-
|
|
739
|
+
E(this, "scrollToY", /* @__PURE__ */ h((e) => {
|
|
739
740
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
740
741
|
s && (s.scrollTop = e);
|
|
741
742
|
}, "scrollToY"));
|
|
@@ -906,7 +907,7 @@ const yt = class yt extends HTMLElement {
|
|
|
906
907
|
this.innerHTML = "", N.log("NineTableSheet destroyed.");
|
|
907
908
|
}
|
|
908
909
|
};
|
|
909
|
-
Ft = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), ct = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(), h(yt, "NineTableSheet"),
|
|
910
|
+
Ft = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), ct = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(), h(yt, "NineTableSheet"), E(yt, "SCROLLBAR_SIZE", 16);
|
|
910
911
|
let $t = yt;
|
|
911
912
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", $t);
|
|
912
913
|
var Kt, qt;
|
|
@@ -927,8 +928,8 @@ const _e = class _e extends HTMLElement {
|
|
|
927
928
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((b) => b.style.setProperty("display", "none"));
|
|
928
929
|
const g = f.filter((b) => b.classList.contains("active"));
|
|
929
930
|
g.length < 2 || g.forEach((b) => {
|
|
930
|
-
const
|
|
931
|
-
v &&
|
|
931
|
+
const x = parseInt(b.getAttribute("data-index"), 10), v = this.querySelector(`nine-splitter[data-split-index="${x}"]`), A = f[x + 1];
|
|
932
|
+
v && A && A.classList.contains("active") && v.style.setProperty("display", "flex");
|
|
932
933
|
});
|
|
933
934
|
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"), a = this.querySelector("nine-table-sheets-body"), o = n.querySelectorAll(".nine-tab-item"), c = a.querySelectorAll("nine-table-sheet");
|
|
934
935
|
if (!o[e]) return;
|
|
@@ -1090,7 +1091,7 @@ const We = class We {
|
|
|
1090
1091
|
constructor(i) {
|
|
1091
1092
|
d(this, kt);
|
|
1092
1093
|
d(this, ht, -1);
|
|
1093
|
-
|
|
1094
|
+
E(this, "count", /* @__PURE__ */ h(() => t(this, kt).rawRecords.length, "count"));
|
|
1094
1095
|
p(this, kt, i);
|
|
1095
1096
|
}
|
|
1096
1097
|
get at() {
|
|
@@ -1104,7 +1105,7 @@ const We = class We {
|
|
|
1104
1105
|
kt = new WeakMap(), ht = new WeakMap(), h(We, "ngRow");
|
|
1105
1106
|
let ue = We;
|
|
1106
1107
|
var I, T, _, dt, Jt, Y, Qt, it, Ct, te, ee, ft;
|
|
1107
|
-
const
|
|
1108
|
+
const O = class O {
|
|
1108
1109
|
constructor(i, e) {
|
|
1109
1110
|
d(this, I);
|
|
1110
1111
|
d(this, T);
|
|
@@ -1127,7 +1128,7 @@ const W = class W {
|
|
|
1127
1128
|
i.invalidate();
|
|
1128
1129
|
});
|
|
1129
1130
|
}, "#invalidate"));
|
|
1130
|
-
|
|
1131
|
+
E(this, "get", /* @__PURE__ */ h((i, e) => {
|
|
1131
1132
|
var n;
|
|
1132
1133
|
const s = this.getValidData();
|
|
1133
1134
|
if (!s || s.length <= 0) return;
|
|
@@ -1140,22 +1141,22 @@ const W = class W {
|
|
|
1140
1141
|
}
|
|
1141
1142
|
return t(this, ft).call(this, s[i]);
|
|
1142
1143
|
}, "get"));
|
|
1143
|
-
|
|
1144
|
+
E(this, "set", /* @__PURE__ */ h((i) => {
|
|
1144
1145
|
this.clear(), this.add(i, !1), t(this, it).call(this);
|
|
1145
1146
|
}, "set"));
|
|
1146
1147
|
d(this, Ct, /* @__PURE__ */ h(() => ({
|
|
1147
|
-
rowState:
|
|
1148
|
+
rowState: O.ROW_STATE.EMPTY,
|
|
1148
1149
|
deleted: !1,
|
|
1149
1150
|
filtered: !1,
|
|
1150
1151
|
height: t(this, Y).slice(),
|
|
1151
1152
|
o: {},
|
|
1152
1153
|
c: {},
|
|
1153
|
-
_: [0, 0, 0, 0,
|
|
1154
|
+
_: [0, 0, 0, 0, O.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Y).slice(), -1, {}, {}]
|
|
1154
1155
|
}), "#getDefaultMeta"));
|
|
1155
|
-
|
|
1156
|
+
E(this, "reset", /* @__PURE__ */ h(() => {
|
|
1156
1157
|
p(this, _, []), p(this, dt, []), t(this, it).call(this);
|
|
1157
1158
|
}, "reset"));
|
|
1158
|
-
|
|
1159
|
+
E(this, "clear", /* @__PURE__ */ h(() => {
|
|
1159
1160
|
var i;
|
|
1160
1161
|
t(this, T).rawRecords = [], p(this, _, []), p(this, dt, []), (i = t(this, T).viewRecords) != null && i.reset && t(this, T).viewRecords.reset();
|
|
1161
1162
|
}, "clear"));
|
|
@@ -1171,30 +1172,30 @@ const W = class W {
|
|
|
1171
1172
|
}), s;
|
|
1172
1173
|
}, "#json2Array"));
|
|
1173
1174
|
d(this, ee, /* @__PURE__ */ h((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1174
|
-
e.__ng = t(this, Ct).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState =
|
|
1175
|
+
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;
|
|
1175
1176
|
}), i), "#defaultInsert"));
|
|
1176
|
-
|
|
1177
|
+
E(this, "add", /* @__PURE__ */ h((i, e = !0) => {
|
|
1177
1178
|
i === void 0 && (i = {});
|
|
1178
1179
|
const s = t(this, te).call(this, i);
|
|
1179
1180
|
t(this, T).rawRecords = t(this, T).rawRecords.concat(t(this, ee).call(this, s)), this.resetRecords();
|
|
1180
1181
|
const r = this.count() - 1;
|
|
1181
1182
|
return e || s.forEach((n, a) => {
|
|
1182
1183
|
const o = t(this, T).rawRecords[r - a];
|
|
1183
|
-
o && (o.__ng.rowState =
|
|
1184
|
+
o && (o.__ng.rowState = O.ROW_STATE.EMPTY);
|
|
1184
1185
|
}), t(this, it).call(this), r;
|
|
1185
1186
|
}, "add"));
|
|
1186
|
-
|
|
1187
|
+
E(this, "delete", /* @__PURE__ */ h((i) => {
|
|
1187
1188
|
let e = [];
|
|
1188
1189
|
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this, T).host.row.at] : e = [parseInt(i, 10)], e.sort((s, r) => r - s).forEach((s) => {
|
|
1189
1190
|
if (t(this, _)[s]) {
|
|
1190
1191
|
const r = t(this, _)[s].__ng.rowid;
|
|
1191
|
-
t(this, _)[s].__ng.rowState ===
|
|
1192
|
-
n.__ng.rowid === r && (n.__ng.deleted = !0, n.__ng.rowState =
|
|
1192
|
+
t(this, _)[s].__ng.rowState === O.ROW_STATE.INSERT ? t(this, T).rawRecords = t(this, T).rawRecords.filter((n) => n.__ng.rowid !== r) : t(this, T).rawRecords.forEach((n) => {
|
|
1193
|
+
n.__ng.rowid === r && (n.__ng.deleted = !0, n.__ng.rowState = O.ROW_STATE.DELETE);
|
|
1193
1194
|
});
|
|
1194
1195
|
}
|
|
1195
1196
|
}), this.resetRecords(), t(this, it).call(this);
|
|
1196
1197
|
}, "delete"));
|
|
1197
|
-
|
|
1198
|
+
E(this, "setValue", /* @__PURE__ */ h((i, e, s) => {
|
|
1198
1199
|
var c;
|
|
1199
1200
|
i = parseInt(i, 10);
|
|
1200
1201
|
const n = (typeof ((c = t(this, I).fields) == null ? void 0 : c.get) == "function" ? t(this, I).fields.get() : []).indexOf(e);
|
|
@@ -1202,16 +1203,16 @@ const W = class W {
|
|
|
1202
1203
|
const a = this.getValidData()[i];
|
|
1203
1204
|
if (!a) return;
|
|
1204
1205
|
const o = a.v[n];
|
|
1205
|
-
o !== s && a.__ng.rowState !==
|
|
1206
|
+
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;
|
|
1206
1207
|
}, "setValue"));
|
|
1207
|
-
|
|
1208
|
+
E(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1208
1209
|
p(this, dt, t(this, T).rawRecords.filter((i) => !i.__ng.deleted)), p(this, _, t(this, T).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, T).rawRecords.forEach((i, e) => {
|
|
1209
1210
|
i.__ng.rowidx = e;
|
|
1210
1211
|
}), t(this, _).forEach((i, e) => {
|
|
1211
1212
|
i.__ng.i = e;
|
|
1212
1213
|
});
|
|
1213
1214
|
}, "resetRecords"));
|
|
1214
|
-
|
|
1215
|
+
E(this, "getValidData", /* @__PURE__ */ h(() => (t(this, _).length === 0 && t(this, T).rawRecords.length > 0 && this.resetRecords(), t(this, _)), "getValidData"));
|
|
1215
1216
|
d(this, ft, /* @__PURE__ */ h((i) => {
|
|
1216
1217
|
var a;
|
|
1217
1218
|
if (!i) return i;
|
|
@@ -1223,7 +1224,7 @@ const W = class W {
|
|
|
1223
1224
|
});
|
|
1224
1225
|
return e ? n[0] : n;
|
|
1225
1226
|
}, "#conv"));
|
|
1226
|
-
|
|
1227
|
+
E(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1227
1228
|
p(this, I, i), p(this, T, e), t(this, Qt).call(this);
|
|
1228
1229
|
}
|
|
1229
1230
|
get source() {
|
|
@@ -1245,15 +1246,15 @@ const W = class W {
|
|
|
1245
1246
|
return this.length;
|
|
1246
1247
|
}
|
|
1247
1248
|
};
|
|
1248
|
-
I = new WeakMap(), T = new WeakMap(), _ = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), Y = new WeakMap(), Qt = new WeakMap(), it = new WeakMap(), Ct = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), ft = new WeakMap(), h(
|
|
1249
|
-
|
|
1249
|
+
I = new WeakMap(), T = new WeakMap(), _ = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), Y = new WeakMap(), Qt = new WeakMap(), it = new WeakMap(), Ct = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), ft = new WeakMap(), h(O, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1250
|
+
E(O, "ROW_STATE", {
|
|
1250
1251
|
EMPTY: "EMPTY",
|
|
1251
1252
|
NORMAL: "NORMAL",
|
|
1252
1253
|
INSERT: "INSERT",
|
|
1253
1254
|
UPDATE: "UPDATE",
|
|
1254
1255
|
DELETE: "DELETE"
|
|
1255
1256
|
});
|
|
1256
|
-
let ge =
|
|
1257
|
+
let ge = O;
|
|
1257
1258
|
var rt;
|
|
1258
1259
|
const Oe = class Oe {
|
|
1259
1260
|
constructor(i) {
|
|
@@ -1283,7 +1284,7 @@ const Be = class Be {
|
|
|
1283
1284
|
constructor(i) {
|
|
1284
1285
|
d(this, ut);
|
|
1285
1286
|
d(this, L, []);
|
|
1286
|
-
|
|
1287
|
+
E(this, "add", /* @__PURE__ */ h((i, e = "string") => {
|
|
1287
1288
|
i.forEach((s) => {
|
|
1288
1289
|
t(this, L).some((r) => r.name === s) || t(this, L).push({ name: s, type: e });
|
|
1289
1290
|
}), t(this, Lt).call(this);
|
|
@@ -1395,7 +1396,7 @@ const mt = class mt extends HTMLElement {
|
|
|
1395
1396
|
connectedCallback() {
|
|
1396
1397
|
}
|
|
1397
1398
|
};
|
|
1398
|
-
h(mt, "BasicCellElement"),
|
|
1399
|
+
h(mt, "BasicCellElement"), E(mt, "_styleCache", /* @__PURE__ */ new Map()), E(mt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1399
1400
|
let me = mt;
|
|
1400
1401
|
var k, Ht, y, Re, qe, Te, ke, Ce;
|
|
1401
1402
|
const ze = class ze extends me {
|
|
@@ -1408,7 +1409,7 @@ const ze = class ze extends me {
|
|
|
1408
1409
|
d(this, qe);
|
|
1409
1410
|
d(this, Te);
|
|
1410
1411
|
d(this, ke);
|
|
1411
|
-
|
|
1412
|
+
E(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1412
1413
|
if (t(this, y))
|
|
1413
1414
|
if (t(this, y).closest("tbody")) {
|
|
1414
1415
|
const s = t(this, y).closest("tr").data, r = parseInt(t(this, y).dataset.row);
|
|
@@ -1433,9 +1434,9 @@ const ze = class ze extends me {
|
|
|
1433
1434
|
var e = ninegrid.j.querySelectorAll(t(this, y)).attr("suppress");
|
|
1434
1435
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1435
1436
|
var s = t(this, y).closest("tr"), r = [];
|
|
1436
|
-
$("th,td", s).each((
|
|
1437
|
-
var C = ninegrid.j.querySelectorAll(
|
|
1438
|
-
C &&
|
|
1437
|
+
$("th,td", s).each((m, W) => {
|
|
1438
|
+
var C = ninegrid.j.querySelectorAll(W).attr("suppress");
|
|
1439
|
+
C && W.dataset.row && (C = parseInt(C), !isNaN(C) && C <= e && r.push(C));
|
|
1439
1440
|
}), r.sort();
|
|
1440
1441
|
var n = !1;
|
|
1441
1442
|
if (parseInt(s.sectionRowIndex / t(this, k).template.length) > 0)
|
|
@@ -1452,12 +1453,12 @@ const ze = class ze extends me {
|
|
|
1452
1453
|
else
|
|
1453
1454
|
n = !0;
|
|
1454
1455
|
n ? ninegrid.j.querySelectorAll(t(this, y)).removeClass("suppress") : ninegrid.j.querySelectorAll(t(this, y)).addClass("suppress"), ninegrid.j.querySelectorAll(t(this, y)).hasClass("hidden") || (n ? ninegrid.j.querySelectorAll(t(this, y)).removeClass("hidden") : ninegrid.j.querySelectorAll(t(this, y)).addClass("hidden"));
|
|
1455
|
-
var
|
|
1456
|
-
$(
|
|
1456
|
+
var x = parseInt(t(this, y).dataset.matrixRow), v = x - 1, A = t(this, k).body.querySelector(`tbody.bindable [data-col="${t(this, y).dataset.col}"][data-matrix-row="${v}"]`);
|
|
1457
|
+
$(A).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this, y)).hasClass("suppress") ? ninegrid.j.querySelectorAll(A).removeClass("last-none-suppress").addClass("last-suppress") : !$(A).hasClass("suppress") && ninegrid.j.querySelectorAll(t(this, y)).hasClass("suppress") ? ninegrid.j.querySelectorAll(A).removeClass("last-suppress").addClass("last-none-suppress") : ninegrid.j.querySelectorAll(A).removeClass("last-none-suppress").removeClass("last-suppress");
|
|
1457
1458
|
}
|
|
1458
1459
|
}
|
|
1459
1460
|
}, "#resetSuppress"));
|
|
1460
|
-
|
|
1461
|
+
E(this, "getExprValue", /* @__PURE__ */ h((e, s, r, n) => {
|
|
1461
1462
|
if (typeof e < "u")
|
|
1462
1463
|
try {
|
|
1463
1464
|
r = parseInt(r);
|
|
@@ -1518,7 +1519,7 @@ const je = class je extends ve {
|
|
|
1518
1519
|
d(this, bt);
|
|
1519
1520
|
d(this, ne);
|
|
1520
1521
|
d(this, U);
|
|
1521
|
-
|
|
1522
|
+
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
1522
1523
|
const e = super.refresh();
|
|
1523
1524
|
t(this, Mt).value = e;
|
|
1524
1525
|
}, "refresh"));
|