@ninebone/table 0.0.349 β 0.0.351
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 +67 -67
- 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
|
@@ -201,15 +201,15 @@ const ee = class ee extends HTMLElement {
|
|
|
201
201
|
_ = new WeakMap(), W = new WeakMap(), y = new WeakMap(), N = new WeakMap(), B = new WeakMap(), P = new WeakMap(), mt = new WeakMap(), Y = new WeakMap(), xt = new WeakMap(), a(ee, "NineTableHScrollBar");
|
|
202
202
|
let Yt = ee;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Yt);
|
|
204
|
-
var V, O, v,
|
|
204
|
+
var V, O, v, rt, lt, vt;
|
|
205
205
|
const ie = class ie extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
208
|
h(this, V);
|
|
209
209
|
h(this, O, !1);
|
|
210
210
|
h(this, v);
|
|
211
|
-
h(this, ot, 0);
|
|
212
211
|
h(this, rt, 0);
|
|
212
|
+
h(this, lt, 0);
|
|
213
213
|
/**
|
|
214
214
|
* π― μ€ν¬λ‘€λ° μμΉ λ° μΈλΈ ν¬κΈ° κ°±μ
|
|
215
215
|
*/
|
|
@@ -239,15 +239,15 @@ const ie = class ie extends HTMLElement {
|
|
|
239
239
|
t(this, O) || this.refresh();
|
|
240
240
|
}), t(this, v).thumb.addEventListener("mousedown", (s) => {
|
|
241
241
|
if (s.button !== 0) return;
|
|
242
|
-
s.stopPropagation(), s.preventDefault(), b(this, O, !0), b(this,
|
|
242
|
+
s.stopPropagation(), s.preventDefault(), b(this, O, !0), b(this, rt, s.clientY), b(this, lt, e.scrollTop);
|
|
243
243
|
const o = /* @__PURE__ */ a((n) => {
|
|
244
244
|
if (!t(this, O)) return;
|
|
245
|
-
const l = t(this, v).track.getBoundingClientRect(), c = t(this, v).thumb.clientHeight, f = l.height - c, u = n.clientY - t(this,
|
|
245
|
+
const l = t(this, v).track.getBoundingClientRect(), c = t(this, v).thumb.clientHeight, f = l.height - c, u = n.clientY - t(this, rt), g = e.clientHeight, p = e.querySelector("table");
|
|
246
246
|
I.log(p), I.log(p.scrollHeight);
|
|
247
247
|
const H = p.scrollHeight - g;
|
|
248
248
|
if (f > 0 && H > 0) {
|
|
249
249
|
const yt = u / f * H;
|
|
250
|
-
e.scrollTop = t(this,
|
|
250
|
+
e.scrollTop = t(this, lt) + yt;
|
|
251
251
|
}
|
|
252
252
|
this.refresh();
|
|
253
253
|
}, "onMouseMove"), r = /* @__PURE__ */ a(() => {
|
|
@@ -351,7 +351,7 @@ const ie = class ie extends HTMLElement {
|
|
|
351
351
|
e();
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
|
-
V = new WeakMap(), O = new WeakMap(), v = new WeakMap(),
|
|
354
|
+
V = new WeakMap(), O = new WeakMap(), v = new WeakMap(), rt = new WeakMap(), lt = new WeakMap(), vt = new WeakMap(), a(ie, "NineTableVScrollBar");
|
|
355
355
|
let Vt = ie;
|
|
356
356
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Vt);
|
|
357
357
|
var wt, G;
|
|
@@ -425,7 +425,7 @@ wt = new WeakMap(), G = new WeakMap(), a(C, "TableCompiler"), h(C, wt, /* @__PUR
|
|
|
425
425
|
});
|
|
426
426
|
}, "#resetColIndex"));
|
|
427
427
|
let Xt = C;
|
|
428
|
-
var X, w, M, A, z, U, J, St, Et,
|
|
428
|
+
var X, w, M, A, z, U, J, St, Et, at, ct, Rt, At, ht, Q, kt;
|
|
429
429
|
const se = class se {
|
|
430
430
|
constructor(i) {
|
|
431
431
|
h(this, X);
|
|
@@ -438,7 +438,7 @@ const se = class se {
|
|
|
438
438
|
x(this, "refresh", /* @__PURE__ */ a(() => {
|
|
439
439
|
var e;
|
|
440
440
|
const i = t(this, w).querySelector(".ng-container-body");
|
|
441
|
-
i && (t(this,
|
|
441
|
+
i && (t(this, at).call(this), t(this, Q).call(this, i.scrollTop), (e = t(this, w).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
442
442
|
}, "refresh"));
|
|
443
443
|
x(this, "initialize", /* @__PURE__ */ a(() => {
|
|
444
444
|
b(this, A, null), t(this, M).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
@@ -453,7 +453,7 @@ const se = class se {
|
|
|
453
453
|
});
|
|
454
454
|
const i = t(this, w).querySelector(".ng-container-body"), e = t(this, w).querySelector(".ng-container-left"), s = t(this, w).querySelector(".ng-container-right");
|
|
455
455
|
if (i) {
|
|
456
|
-
t(this, Et).call(this, i), t(this,
|
|
456
|
+
t(this, Et).call(this, i), t(this, ht).call(this), t(this, at).call(this), t(this, Q).call(this, i.scrollTop);
|
|
457
457
|
let o = i.scrollTop;
|
|
458
458
|
const r = /* @__PURE__ */ a((n) => {
|
|
459
459
|
var l;
|
|
@@ -496,9 +496,9 @@ const se = class se {
|
|
|
496
496
|
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
497
497
|
return u.forEach((g) => {
|
|
498
498
|
f += g.offsetHeight || g.getBoundingClientRect().height;
|
|
499
|
-
}), u.forEach((g) => g.remove()), n.style.display = l, n.style.visibility = c, n.style.position = d, b(this, A, f > 0 ? f : 24), t(this,
|
|
499
|
+
}), u.forEach((g) => g.remove()), n.style.display = l, n.style.visibility = c, n.style.position = d, b(this, A, f > 0 ? f : 24), t(this, ct).call(this), t(this, A);
|
|
500
500
|
}, "#measureAndCacheHeight"));
|
|
501
|
-
h(this,
|
|
501
|
+
h(this, at, /* @__PURE__ */ a(() => {
|
|
502
502
|
if (!t(this, w).querySelector(".ng-container-body")) return;
|
|
503
503
|
const e = t(this, X).data.get() || [], s = e.length > 0 ? e.length : 100, o = t(this, A), r = s * o;
|
|
504
504
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
@@ -506,7 +506,7 @@ const se = class se {
|
|
|
506
506
|
c && (c.style.height = `${r}px`);
|
|
507
507
|
});
|
|
508
508
|
}, "#updateVirtualScrollHeight"));
|
|
509
|
-
h(this,
|
|
509
|
+
h(this, ct, /* @__PURE__ */ a(() => {
|
|
510
510
|
if (t(this, U) > 0 && t(this, A) > 0) {
|
|
511
511
|
const i = Math.ceil(t(this, U) / t(this, A));
|
|
512
512
|
b(this, J, i + 20);
|
|
@@ -538,12 +538,12 @@ const se = class se {
|
|
|
538
538
|
const n = s.querySelector("thead");
|
|
539
539
|
n && (r += n.offsetHeight || n.getBoundingClientRect().height);
|
|
540
540
|
const l = Math.max(o - r, 100);
|
|
541
|
-
t(this, U) !== l && (b(this, U, l), t(this,
|
|
541
|
+
t(this, U) !== l && (b(this, U, l), t(this, ct).call(this), t(this, A) !== null && t(this, ht).call(this));
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
544
|
})), t(this, z).observe(t(this, w)));
|
|
545
545
|
}, "#initResizeObserver"));
|
|
546
|
-
h(this,
|
|
546
|
+
h(this, ht, /* @__PURE__ */ a(() => {
|
|
547
547
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
548
548
|
const e = t(this, w).querySelector(i);
|
|
549
549
|
e && e.querySelector("tbody.bindable-tbody") && t(this, St).call(this, e, i);
|
|
@@ -566,7 +566,7 @@ const se = class se {
|
|
|
566
566
|
});
|
|
567
567
|
}, "#handleScroll"));
|
|
568
568
|
h(this, kt, /* @__PURE__ */ a((i, e, s) => {
|
|
569
|
-
i.dataset.row = s,
|
|
569
|
+
i.dataset.row = s, Array.from(i.cells).forEach((o, r) => {
|
|
570
570
|
const n = o.dataset.bind;
|
|
571
571
|
n && e && e[n] !== void 0 ? o.textContent = e[n] : o.textContent = e ? e[Object.keys(e)[r]] ?? `R${s}C${r}` : `ν ${s + 1}`, o.dataset.row = s;
|
|
572
572
|
});
|
|
@@ -584,13 +584,13 @@ const se = class se {
|
|
|
584
584
|
return ((e = t(this, M).get(i)) == null ? void 0 : e.length) || 1;
|
|
585
585
|
}
|
|
586
586
|
};
|
|
587
|
-
X = new WeakMap(), w = new WeakMap(), M = new WeakMap(), A = new WeakMap(), z = new WeakMap(), U = new WeakMap(), J = new WeakMap(), St = new WeakMap(), Et = new WeakMap(),
|
|
587
|
+
X = new WeakMap(), w = new WeakMap(), M = new WeakMap(), A = new WeakMap(), z = new WeakMap(), U = new WeakMap(), J = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), at = new WeakMap(), ct = new WeakMap(), Rt = new WeakMap(), At = new WeakMap(), ht = new WeakMap(), Q = new WeakMap(), kt = new WeakMap(), a(se, "RowManager");
|
|
588
588
|
let Ut = se;
|
|
589
|
-
var
|
|
590
|
-
const
|
|
589
|
+
var qt, tt, j, Tt, Lt, Ht, Ct, _t;
|
|
590
|
+
const ot = class ot extends HTMLElement {
|
|
591
591
|
constructor() {
|
|
592
592
|
super();
|
|
593
|
-
h(this,
|
|
593
|
+
h(this, qt);
|
|
594
594
|
h(this, tt, null);
|
|
595
595
|
h(this, j);
|
|
596
596
|
/**
|
|
@@ -600,7 +600,7 @@ const nt = class nt extends HTMLElement {
|
|
|
600
600
|
x(this, "invalidate", /* @__PURE__ */ a(() => {
|
|
601
601
|
t(this, j).refresh();
|
|
602
602
|
}, "invalidate"));
|
|
603
|
-
h(this,
|
|
603
|
+
h(this, Tt, /* @__PURE__ */ a(() => {
|
|
604
604
|
[
|
|
605
605
|
{ selector: ".ng-container-body", type: null },
|
|
606
606
|
{ selector: ".ng-container-left", type: "left" },
|
|
@@ -624,7 +624,7 @@ const nt = class nt extends HTMLElement {
|
|
|
624
624
|
});
|
|
625
625
|
}, "#updateContainerWidths"));
|
|
626
626
|
x(this, "generate", /* @__PURE__ */ a((e) => {
|
|
627
|
-
e && (b(this, tt, Xt.compile(e)), t(this, tt).style.display = "table", t(this,
|
|
627
|
+
e && (b(this, tt, Xt.compile(e)), t(this, tt).style.display = "table", t(this, Tt).call(this), t(this, Lt).call(this), requestAnimationFrame(() => {
|
|
628
628
|
var o;
|
|
629
629
|
const s = (o = this.querySelector("thead")) == null ? void 0 : o.getBoundingClientRect().height;
|
|
630
630
|
this.querySelectorAll("tbody.fixed-tbody").forEach((r) => {
|
|
@@ -665,7 +665,7 @@ const nt = class nt extends HTMLElement {
|
|
|
665
665
|
t(this, _t).call(this);
|
|
666
666
|
}, "#init"));
|
|
667
667
|
h(this, _t, /* @__PURE__ */ a(() => {
|
|
668
|
-
const e =
|
|
668
|
+
const e = ot.SCROLLBAR_SIZE;
|
|
669
669
|
this.innerHTML = `
|
|
670
670
|
<style>
|
|
671
671
|
nine-table-sheet {
|
|
@@ -811,7 +811,7 @@ const nt = class nt extends HTMLElement {
|
|
|
811
811
|
</div>
|
|
812
812
|
`;
|
|
813
813
|
}, "#render"));
|
|
814
|
-
b(this, j, new Ut(this)), b(this,
|
|
814
|
+
b(this, j, new Ut(this)), b(this, qt, this.getRootNode().host);
|
|
815
815
|
}
|
|
816
816
|
connectedCallback() {
|
|
817
817
|
t(this, Ct).call(this);
|
|
@@ -820,10 +820,10 @@ const nt = class nt extends HTMLElement {
|
|
|
820
820
|
this.innerHTML = "", I.log("NineTableSheet destroyed.");
|
|
821
821
|
}
|
|
822
822
|
};
|
|
823
|
-
|
|
824
|
-
let pt =
|
|
823
|
+
qt = new WeakMap(), tt = new WeakMap(), j = new WeakMap(), Tt = new WeakMap(), Lt = new WeakMap(), Ht = new WeakMap(), Ct = new WeakMap(), _t = new WeakMap(), a(ot, "NineTableSheet"), x(ot, "SCROLLBAR_SIZE", 16);
|
|
824
|
+
let pt = ot;
|
|
825
825
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", pt);
|
|
826
|
-
var Mt,
|
|
826
|
+
var Mt, dt;
|
|
827
827
|
const ne = class ne extends HTMLElement {
|
|
828
828
|
constructor() {
|
|
829
829
|
super();
|
|
@@ -832,10 +832,10 @@ const ne = class ne extends HTMLElement {
|
|
|
832
832
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
833
833
|
var n;
|
|
834
834
|
const o = s.ctrlKey || s.metaKey || s.shiftKey, r = parseInt((n = s.target.closest(".nine-tab-item")) == null ? void 0 : n.dataset.index, 10);
|
|
835
|
-
t(this,
|
|
836
|
-
}), t(this,
|
|
835
|
+
t(this, dt).call(this, r, o);
|
|
836
|
+
}), t(this, dt).call(this, 0, !1);
|
|
837
837
|
}, "#init"));
|
|
838
|
-
h(this,
|
|
838
|
+
h(this, dt, /* @__PURE__ */ a((e, s = !1) => {
|
|
839
839
|
const o = /* @__PURE__ */ a(() => {
|
|
840
840
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
841
841
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((p) => p.style.setProperty("display", "none"));
|
|
@@ -871,14 +871,14 @@ const ne = class ne extends HTMLElement {
|
|
|
871
871
|
t(this, Mt).call(this);
|
|
872
872
|
}
|
|
873
873
|
};
|
|
874
|
-
Mt = new WeakMap(),
|
|
874
|
+
Mt = new WeakMap(), dt = new WeakMap(), a(ne, "NineTableSheets");
|
|
875
875
|
let jt = ne;
|
|
876
876
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", jt);
|
|
877
|
-
var
|
|
877
|
+
var et, R, ft, It;
|
|
878
878
|
const oe = class oe {
|
|
879
879
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
880
880
|
constructor(i) {
|
|
881
|
-
h(this,
|
|
881
|
+
h(this, et);
|
|
882
882
|
h(this, R, []);
|
|
883
883
|
x(this, "add", /* @__PURE__ */ a((i, e = "string") => {
|
|
884
884
|
i.forEach((s) => {
|
|
@@ -892,8 +892,8 @@ const oe = class oe {
|
|
|
892
892
|
}), b(this, R, Array.from(i, ([e, s]) => ({ name: e, type: s }))), b(this, R, t(this, R).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, R).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
893
893
|
}, "#adjust"));
|
|
894
894
|
h(this, It, /* @__PURE__ */ a(() => {
|
|
895
|
-
b(this, R, []);
|
|
896
|
-
const i = Array.from(t(this,
|
|
895
|
+
b(this, R, []), I.log(t(this, et).querySelectorAll("table"));
|
|
896
|
+
const i = Array.from(t(this, et).querySelectorAll("table"));
|
|
897
897
|
if (!(!i || i.length === 0)) {
|
|
898
898
|
for (const e of i)
|
|
899
899
|
I.log(e), $("[data-bind]", e).each((s, o) => {
|
|
@@ -923,7 +923,7 @@ const oe = class oe {
|
|
|
923
923
|
t(this, ft).call(this);
|
|
924
924
|
}
|
|
925
925
|
}, "#init"));
|
|
926
|
-
b(this,
|
|
926
|
+
b(this, et, i), t(this, It).call(this);
|
|
927
927
|
}
|
|
928
928
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
929
929
|
get() {
|
|
@@ -945,7 +945,7 @@ const oe = class oe {
|
|
|
945
945
|
return t(this, R).some((e) => e.name === i);
|
|
946
946
|
}
|
|
947
947
|
};
|
|
948
|
-
|
|
948
|
+
et = new WeakMap(), R = new WeakMap(), ft = new WeakMap(), It = new WeakMap(), a(oe, "ngFields");
|
|
949
949
|
let Ft = oe;
|
|
950
950
|
var k, $t, ut, Wt;
|
|
951
951
|
const re = class re {
|
|
@@ -1080,36 +1080,36 @@ const re = class re {
|
|
|
1080
1080
|
};
|
|
1081
1081
|
k = new WeakMap(), $t = new WeakMap(), ut = new WeakMap(), Wt = new WeakMap(), a(re, "LayoutManager");
|
|
1082
1082
|
let Kt = re;
|
|
1083
|
-
var bt,
|
|
1083
|
+
var bt, it;
|
|
1084
1084
|
const le = class le {
|
|
1085
1085
|
constructor(i) {
|
|
1086
1086
|
h(this, bt);
|
|
1087
|
-
h(this,
|
|
1087
|
+
h(this, it, -1);
|
|
1088
1088
|
x(this, "count", /* @__PURE__ */ a(() => t(this, bt).rawRecords.length, "count"));
|
|
1089
1089
|
b(this, bt, i);
|
|
1090
1090
|
}
|
|
1091
1091
|
get at() {
|
|
1092
|
-
return t(this,
|
|
1092
|
+
return t(this, it);
|
|
1093
1093
|
}
|
|
1094
1094
|
set at(i) {
|
|
1095
|
-
b(this,
|
|
1095
|
+
b(this, it, parseInt(i, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, it)}"]`) && setTimeout(() => {
|
|
1096
1096
|
});
|
|
1097
1097
|
}
|
|
1098
1098
|
};
|
|
1099
|
-
bt = new WeakMap(),
|
|
1099
|
+
bt = new WeakMap(), it = new WeakMap(), a(le, "ngRow");
|
|
1100
1100
|
let Zt = le;
|
|
1101
|
-
var
|
|
1101
|
+
var q, S, T, st, Ot, D, zt, F, gt, Dt, Nt, nt;
|
|
1102
1102
|
const L = class L {
|
|
1103
1103
|
constructor(i, e) {
|
|
1104
|
-
h(this,
|
|
1104
|
+
h(this, q);
|
|
1105
1105
|
h(this, S);
|
|
1106
|
-
h(this,
|
|
1107
|
-
h(this,
|
|
1106
|
+
h(this, T, []);
|
|
1107
|
+
h(this, st, []);
|
|
1108
1108
|
h(this, Ot, 0);
|
|
1109
1109
|
h(this, D, []);
|
|
1110
1110
|
h(this, zt, /* @__PURE__ */ a(() => {
|
|
1111
1111
|
b(this, D, []);
|
|
1112
|
-
const i = t(this,
|
|
1112
|
+
const i = t(this, q).template || [];
|
|
1113
1113
|
Array.from(i).forEach((e) => {
|
|
1114
1114
|
var s;
|
|
1115
1115
|
t(this, D).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
@@ -1118,7 +1118,7 @@ const L = class L {
|
|
|
1118
1118
|
});
|
|
1119
1119
|
}, "#initialize"));
|
|
1120
1120
|
h(this, F, /* @__PURE__ */ a(() => {
|
|
1121
|
-
t(this,
|
|
1121
|
+
t(this, q).shadowRoot.querySelectorAll("nine-table-sheet").forEach((i) => {
|
|
1122
1122
|
i.invalidate();
|
|
1123
1123
|
});
|
|
1124
1124
|
}, "#invalidate"));
|
|
@@ -1126,14 +1126,14 @@ const L = class L {
|
|
|
1126
1126
|
var r;
|
|
1127
1127
|
const s = this.getValidData();
|
|
1128
1128
|
if (!s || s.length <= 0) return;
|
|
1129
|
-
if (i == null) return t(this,
|
|
1129
|
+
if (i == null) return t(this, nt).call(this, s);
|
|
1130
1130
|
if (i < 0 || i >= s.length) return null;
|
|
1131
|
-
const o = typeof ((r = t(this,
|
|
1131
|
+
const o = typeof ((r = t(this, q).fields) == null ? void 0 : r.get) == "function" ? t(this, q).fields.get() : [];
|
|
1132
1132
|
if (e != null) {
|
|
1133
1133
|
const n = o.indexOf(e);
|
|
1134
1134
|
return n >= 0 ? s[i].v[n] : null;
|
|
1135
1135
|
}
|
|
1136
|
-
return t(this,
|
|
1136
|
+
return t(this, nt).call(this, s[i]);
|
|
1137
1137
|
}, "get"));
|
|
1138
1138
|
x(this, "set", /* @__PURE__ */ a((i) => {
|
|
1139
1139
|
this.clear(), this.add(i, !1), t(this, F).call(this);
|
|
@@ -1148,16 +1148,16 @@ const L = class L {
|
|
|
1148
1148
|
_: [0, 0, 0, 0, L.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, D).slice(), -1, {}, {}]
|
|
1149
1149
|
}), "#getDefaultMeta"));
|
|
1150
1150
|
x(this, "reset", /* @__PURE__ */ a(() => {
|
|
1151
|
-
b(this,
|
|
1151
|
+
b(this, T, []), b(this, st, []), t(this, F).call(this);
|
|
1152
1152
|
}, "reset"));
|
|
1153
1153
|
x(this, "clear", /* @__PURE__ */ a(() => {
|
|
1154
1154
|
var i;
|
|
1155
|
-
t(this, S).rawRecords = [], b(this,
|
|
1155
|
+
t(this, S).rawRecords = [], b(this, T, []), b(this, st, []), (i = t(this, S).viewRecords) != null && i.reset && t(this, S).viewRecords.reset();
|
|
1156
1156
|
}, "clear"));
|
|
1157
1157
|
h(this, Dt, /* @__PURE__ */ a((i) => {
|
|
1158
1158
|
var o;
|
|
1159
1159
|
Array.isArray(i) || (i = [i]);
|
|
1160
|
-
const e = typeof ((o = t(this,
|
|
1160
|
+
const e = typeof ((o = t(this, q).fields) == null ? void 0 : o.get) == "function" ? t(this, q).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
1161
1161
|
return i.forEach((r) => {
|
|
1162
1162
|
const n = { v: [] };
|
|
1163
1163
|
e.forEach((l) => {
|
|
@@ -1181,9 +1181,9 @@ const L = class L {
|
|
|
1181
1181
|
x(this, "delete", /* @__PURE__ */ a((i) => {
|
|
1182
1182
|
let e = [];
|
|
1183
1183
|
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this, S).host.row.at] : e = [parseInt(i, 10)], e.sort((s, o) => o - s).forEach((s) => {
|
|
1184
|
-
if (t(this,
|
|
1185
|
-
const o = t(this,
|
|
1186
|
-
t(this,
|
|
1184
|
+
if (t(this, T)[s]) {
|
|
1185
|
+
const o = t(this, T)[s].__ng.rowid;
|
|
1186
|
+
t(this, T)[s].__ng.rowState === L.ROW_STATE.INSERT ? t(this, S).rawRecords = t(this, S).rawRecords.filter((r) => r.__ng.rowid !== o) : t(this, S).rawRecords.forEach((r) => {
|
|
1187
1187
|
r.__ng.rowid === o && (r.__ng.deleted = !0, r.__ng.rowState = L.ROW_STATE.DELETE);
|
|
1188
1188
|
});
|
|
1189
1189
|
}
|
|
@@ -1192,7 +1192,7 @@ const L = class L {
|
|
|
1192
1192
|
x(this, "setValue", /* @__PURE__ */ a((i, e, s) => {
|
|
1193
1193
|
var c;
|
|
1194
1194
|
i = parseInt(i, 10);
|
|
1195
|
-
const r = (typeof ((c = t(this,
|
|
1195
|
+
const r = (typeof ((c = t(this, q).fields) == null ? void 0 : c.get) == "function" ? t(this, q).fields.get() : []).indexOf(e);
|
|
1196
1196
|
if (r < 0) return;
|
|
1197
1197
|
const n = this.getValidData()[i];
|
|
1198
1198
|
if (!n) return;
|
|
@@ -1200,17 +1200,17 @@ const L = class L {
|
|
|
1200
1200
|
l !== s && n.__ng.rowState !== L.ROW_STATE.INSERT && (n.__ng.o.hasOwnProperty(e) || (n.__ng.o[e] = l), n.__ng.rowState = L.ROW_STATE.UPDATE), n.v[r] = s;
|
|
1201
1201
|
}, "setValue"));
|
|
1202
1202
|
x(this, "resetRecords", /* @__PURE__ */ a(() => {
|
|
1203
|
-
b(this,
|
|
1203
|
+
b(this, st, t(this, S).rawRecords.filter((i) => !i.__ng.deleted)), b(this, T, t(this, S).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, S).rawRecords.forEach((i, e) => {
|
|
1204
1204
|
i.__ng.rowidx = e;
|
|
1205
|
-
}), t(this,
|
|
1205
|
+
}), t(this, T).forEach((i, e) => {
|
|
1206
1206
|
i.__ng.i = e;
|
|
1207
1207
|
});
|
|
1208
1208
|
}, "resetRecords"));
|
|
1209
|
-
x(this, "getValidData", /* @__PURE__ */ a(() => (t(this,
|
|
1210
|
-
h(this,
|
|
1209
|
+
x(this, "getValidData", /* @__PURE__ */ a(() => (t(this, T).length === 0 && t(this, S).rawRecords.length > 0 && this.resetRecords(), t(this, T)), "getValidData"));
|
|
1210
|
+
h(this, nt, /* @__PURE__ */ a((i) => {
|
|
1211
1211
|
var n;
|
|
1212
1212
|
if (!i) return i;
|
|
1213
|
-
const e = !Array.isArray(i), s = e ? [i] : i, o = typeof ((n = t(this,
|
|
1213
|
+
const e = !Array.isArray(i), s = e ? [i] : i, o = typeof ((n = t(this, q).fields) == null ? void 0 : n.get) == "function" ? t(this, q).fields.get() : [], r = s.filter((l) => !l.__ng.deleted).map((l) => {
|
|
1214
1214
|
const c = {};
|
|
1215
1215
|
return o.forEach((d, f) => {
|
|
1216
1216
|
c[d] = l.v ? l.v[f] : l[d];
|
|
@@ -1219,10 +1219,10 @@ const L = class L {
|
|
|
1219
1219
|
return e ? r[0] : r;
|
|
1220
1220
|
}, "#conv"));
|
|
1221
1221
|
x(this, "count", /* @__PURE__ */ a(() => this.getValidData().length, "count"));
|
|
1222
|
-
b(this,
|
|
1222
|
+
b(this, q, i), b(this, S, e), t(this, zt).call(this);
|
|
1223
1223
|
}
|
|
1224
1224
|
get source() {
|
|
1225
|
-
return t(this,
|
|
1225
|
+
return t(this, nt).call(this, t(this, S).rawRecords);
|
|
1226
1226
|
}
|
|
1227
1227
|
set source(i) {
|
|
1228
1228
|
this.clear(), this.add(i, !1);
|
|
@@ -1231,13 +1231,13 @@ const L = class L {
|
|
|
1231
1231
|
return ++ue(this, Ot)._;
|
|
1232
1232
|
}
|
|
1233
1233
|
get length() {
|
|
1234
|
-
return t(this,
|
|
1234
|
+
return t(this, T).length;
|
|
1235
1235
|
}
|
|
1236
1236
|
getRowCount() {
|
|
1237
1237
|
return this.length;
|
|
1238
1238
|
}
|
|
1239
1239
|
};
|
|
1240
|
-
|
|
1240
|
+
q = new WeakMap(), S = new WeakMap(), T = new WeakMap(), st = new WeakMap(), Ot = new WeakMap(), D = new WeakMap(), zt = new WeakMap(), F = new WeakMap(), gt = new WeakMap(), Dt = new WeakMap(), Nt = new WeakMap(), nt = new WeakMap(), a(L, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1241
1241
|
x(L, "ROW_STATE", {
|
|
1242
1242
|
EMPTY: "EMPTY",
|
|
1243
1243
|
NORMAL: "NORMAL",
|
|
@@ -1276,7 +1276,7 @@ const ce = class ce extends HTMLElement {
|
|
|
1276
1276
|
//#created = false;
|
|
1277
1277
|
h(this, Z);
|
|
1278
1278
|
h(this, Bt);
|
|
1279
|
-
this.attachShadow({ mode: "open" }),
|
|
1279
|
+
this.fields = new Ft(this), this.attachShadow({ mode: "open" }), b(this, Z, new Jt(this));
|
|
1280
1280
|
}
|
|
1281
1281
|
connectedCallback() {
|
|
1282
1282
|
b(this, Bt, new Kt(this)), I.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|