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