@ninebone/table 0.0.280 β 0.0.281
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 +69 -66
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +4 -4
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -22,7 +22,7 @@ const Me = class Me extends Ze.constructor {
|
|
|
22
22
|
};
|
|
23
23
|
a(Me, "Trace");
|
|
24
24
|
let Ee = Me;
|
|
25
|
-
const
|
|
25
|
+
const j = new Ee();
|
|
26
26
|
var k, $, y, O, W, z, ne, D, re;
|
|
27
27
|
const $e = class $e extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
@@ -59,7 +59,7 @@ const $e = class $e extends HTMLElement {
|
|
|
59
59
|
let x = 0;
|
|
60
60
|
u > 0 && (x = parseInt(b / u * (h - f), 10)), x < 0 && (x = 0);
|
|
61
61
|
const w = h - f;
|
|
62
|
-
x > w && (x = w), r.style.left = `${x}px`,
|
|
62
|
+
x > w && (x = w), r.style.left = `${x}px`, j.log(x), e(this, y).left.disabled = x === 0, e(this, y).right.disabled = x >= w - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
64
|
c(this, D, /* @__PURE__ */ a((t) => {
|
|
65
65
|
if (!e(this, y)) return !1;
|
|
@@ -200,7 +200,7 @@ const $e = class $e extends HTMLElement {
|
|
|
200
200
|
k = new WeakMap(), $ = new WeakMap(), y = new WeakMap(), O = new WeakMap(), W = new WeakMap(), z = new WeakMap(), ne = new WeakMap(), D = new WeakMap(), re = new WeakMap(), a($e, "NineTableHScrollBar");
|
|
201
201
|
let Re = $e;
|
|
202
202
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Re);
|
|
203
|
-
var oe,
|
|
203
|
+
var oe, G;
|
|
204
204
|
const L = class L {
|
|
205
205
|
/**
|
|
206
206
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
@@ -215,7 +215,7 @@ const L = class L {
|
|
|
215
215
|
var n, r, o;
|
|
216
216
|
if (!i) return null;
|
|
217
217
|
const t = i.cloneNode(!0);
|
|
218
|
-
return e(n = L, oe).call(n, t), e(r = L,
|
|
218
|
+
return e(n = L, oe).call(n, t), e(r = L, G).call(r, t, "thead"), e(o = L, G).call(o, t, "tbody"), Array.from(t.querySelectorAll("colgroup col")).forEach((l, d) => {
|
|
219
219
|
const h = l.getAttribute("fixed");
|
|
220
220
|
h && t.querySelectorAll(`[data-col="${d}"]`).forEach((f) => {
|
|
221
221
|
f.setAttribute("fixed", h);
|
|
@@ -223,7 +223,7 @@ const L = class L {
|
|
|
223
223
|
}), t;
|
|
224
224
|
}
|
|
225
225
|
};
|
|
226
|
-
oe = new WeakMap(),
|
|
226
|
+
oe = new WeakMap(), G = new WeakMap(), a(L, "TableCompiler"), c(L, oe, /* @__PURE__ */ a((i) => {
|
|
227
227
|
if (!i.querySelector("colgroup")) {
|
|
228
228
|
const t = i.querySelector("tbody tr") || i.querySelector("tr"), s = t ? t.querySelectorAll("th, td").length : 1, n = document.createElement("colgroup"), r = Math.max(Math.floor(i.clientWidth / s), 100);
|
|
229
229
|
for (let o = 0; o < s; o++) {
|
|
@@ -237,7 +237,7 @@ oe = new WeakMap(), j = new WeakMap(), a(L, "TableCompiler"), c(L, oe, /* @__PUR
|
|
|
237
237
|
s ? s.after(t) : i.prepend(t);
|
|
238
238
|
}
|
|
239
239
|
i.classList.add("nine-table-element"), i.style.display = "table";
|
|
240
|
-
}, "#ensureTableStructure")), c(L,
|
|
240
|
+
}, "#ensureTableStructure")), c(L, G, /* @__PURE__ */ a((i, t) => {
|
|
241
241
|
const s = Array.from(i.querySelectorAll(t + " tr")), n = Array.from(i.querySelectorAll(t + " th," + t + " td")), r = s.length;
|
|
242
242
|
if (r === 0 || n.length === 0) return;
|
|
243
243
|
let o = 0;
|
|
@@ -271,10 +271,10 @@ oe = new WeakMap(), j = new WeakMap(), a(L, "TableCompiler"), c(L, oe, /* @__PUR
|
|
|
271
271
|
});
|
|
272
272
|
}, "#resetColIndex"));
|
|
273
273
|
let Ae = L;
|
|
274
|
-
var
|
|
274
|
+
var R, _, E, I, N, B, le, He, ae, J, ce, Q;
|
|
275
275
|
const Oe = class Oe {
|
|
276
276
|
constructor(i) {
|
|
277
|
-
c(this,
|
|
277
|
+
c(this, R);
|
|
278
278
|
c(this, _, /* @__PURE__ */ new Map());
|
|
279
279
|
// κ° μ»¨ν
μ΄λλ³ λ
립λ ν
νλ¦Ώ TR κ΄λ¦¬
|
|
280
280
|
c(this, E, null);
|
|
@@ -287,7 +287,7 @@ const Oe = class Oe {
|
|
|
287
287
|
// [RowManager.js μμ λ΄μ© λ°μ·]
|
|
288
288
|
v(this, "initialize", /* @__PURE__ */ a(() => {
|
|
289
289
|
g(this, E, null), e(this, _).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((t) => {
|
|
290
|
-
const s = e(this,
|
|
290
|
+
const s = e(this, R).querySelector(t);
|
|
291
291
|
if (!s) return;
|
|
292
292
|
const n = s.querySelector("table");
|
|
293
293
|
if (!n) return;
|
|
@@ -296,8 +296,8 @@ const Oe = class Oe {
|
|
|
296
296
|
const l = Array.from(r.querySelectorAll("tr")).map((d) => d.cloneNode(!0));
|
|
297
297
|
e(this, _).set(t, l);
|
|
298
298
|
});
|
|
299
|
-
const i = e(this,
|
|
300
|
-
i && (e(this, ae).call(this, i), e(this,
|
|
299
|
+
const i = e(this, R).querySelector(".ng-container-body");
|
|
300
|
+
i && (e(this, ae).call(this, i), e(this, Q).call(this));
|
|
301
301
|
}, "initialize"));
|
|
302
302
|
c(this, le, /* @__PURE__ */ a((i, t) => {
|
|
303
303
|
const s = e(this, _).get(t);
|
|
@@ -338,15 +338,15 @@ const Oe = class Oe {
|
|
|
338
338
|
t.forEach((u) => {
|
|
339
339
|
r.appendChild(u.cloneNode(!0));
|
|
340
340
|
}), n ? n.before(r) : s.appendChild(r);
|
|
341
|
-
const o = e(this,
|
|
341
|
+
const o = e(this, R), l = o.style.display, d = o.style.visibility, h = o.style.position;
|
|
342
342
|
(l === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
343
343
|
let f = 0;
|
|
344
344
|
const b = s.querySelectorAll("tr:not(.nodata)");
|
|
345
345
|
return b.forEach((u) => {
|
|
346
346
|
f += u.offsetHeight || u.getBoundingClientRect().height;
|
|
347
|
-
}), b.forEach((u) => u.remove()), o.style.display = l, o.style.visibility = d, o.style.position = h, g(this, E, f > 0 ? f : 24), e(this,
|
|
347
|
+
}), b.forEach((u) => u.remove()), o.style.display = l, o.style.visibility = d, o.style.position = h, g(this, E, f > 0 ? f : 24), e(this, J).call(this), j.log(`[RowManager] Height Cached: ${e(this, E)}px | RowCount: ${e(this, B)}`), e(this, E);
|
|
348
348
|
}, "#measureAndCacheHeight"));
|
|
349
|
-
c(this,
|
|
349
|
+
c(this, J, /* @__PURE__ */ a(() => {
|
|
350
350
|
if (e(this, N) > 0 && e(this, E) > 0) {
|
|
351
351
|
const i = Math.ceil(e(this, N) / e(this, E));
|
|
352
352
|
g(this, B, i + 20);
|
|
@@ -357,7 +357,7 @@ const Oe = class Oe {
|
|
|
357
357
|
* π― ResizeObserver μ€μ : μνΈ ν¬κΈ° λ³κ²½ μ ν κ°μ μ¬μ°μ λ° μ¬λ λλ§
|
|
358
358
|
*/
|
|
359
359
|
c(this, ce, /* @__PURE__ */ a(() => {
|
|
360
|
-
!e(this,
|
|
360
|
+
!e(this, R) || !(e(this, R) instanceof HTMLElement) || (g(this, I, new ResizeObserver((i) => {
|
|
361
361
|
for (const t of i) {
|
|
362
362
|
const s = t.target;
|
|
363
363
|
if (!s.classList.contains("active")) continue;
|
|
@@ -367,24 +367,24 @@ const Oe = class Oe {
|
|
|
367
367
|
const o = s.querySelector("thead");
|
|
368
368
|
o && (r += o.offsetHeight || o.getBoundingClientRect().height);
|
|
369
369
|
const l = Math.max(n - r, 100);
|
|
370
|
-
e(this, N) !== l && (g(this, N, l), e(this,
|
|
370
|
+
e(this, N) !== l && (g(this, N, l), e(this, J).call(this), e(this, E) !== null && e(this, Q).call(this));
|
|
371
371
|
}
|
|
372
372
|
}
|
|
373
|
-
})), e(this, I).observe(e(this,
|
|
373
|
+
})), e(this, I).observe(e(this, R)));
|
|
374
374
|
}, "#initResizeObserver"));
|
|
375
375
|
/**
|
|
376
376
|
* π― λ°λ λ° μ’μ° κ³ μ 컨ν
μ΄λ μ 체μ κ°κ°μ λ§λ ν
νλ¦Ώ ν λΌλ μ£Όμ
|
|
377
377
|
*/
|
|
378
|
-
c(this,
|
|
378
|
+
c(this, Q, /* @__PURE__ */ a(() => {
|
|
379
379
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
380
|
-
const t = e(this,
|
|
380
|
+
const t = e(this, R).querySelector(i);
|
|
381
381
|
t && t.querySelector("tbody") && e(this, le).call(this, t, i);
|
|
382
|
-
});
|
|
382
|
+
}), typeof e(this, R).syncRowHeights == "function" && e(this, R).syncRowHeights();
|
|
383
383
|
}, "#renderAllContainers"));
|
|
384
384
|
v(this, "destroy", /* @__PURE__ */ a(() => {
|
|
385
385
|
e(this, I) && (e(this, I).disconnect(), g(this, I, null));
|
|
386
386
|
}, "destroy"));
|
|
387
|
-
g(this,
|
|
387
|
+
g(this, R, i), e(this, ce).call(this);
|
|
388
388
|
}
|
|
389
389
|
getRowHeight() {
|
|
390
390
|
return e(this, E);
|
|
@@ -394,10 +394,10 @@ const Oe = class Oe {
|
|
|
394
394
|
return ((t = e(this, _).get(i)) == null ? void 0 : t.length) || 1;
|
|
395
395
|
}
|
|
396
396
|
};
|
|
397
|
-
|
|
397
|
+
R = new WeakMap(), _ = new WeakMap(), E = new WeakMap(), I = new WeakMap(), N = new WeakMap(), B = new WeakMap(), le = new WeakMap(), He = new WeakMap(), ae = new WeakMap(), J = new WeakMap(), ce = new WeakMap(), Q = new WeakMap(), a(Oe, "RowManager");
|
|
398
398
|
let qe = Oe;
|
|
399
|
-
var X, Y, he, de, fe,
|
|
400
|
-
const
|
|
399
|
+
var X, Y, he, de, fe, U, ue, ge;
|
|
400
|
+
const F = class F extends HTMLElement {
|
|
401
401
|
constructor() {
|
|
402
402
|
super();
|
|
403
403
|
c(this, X, null);
|
|
@@ -434,7 +434,7 @@ const Z = class Z extends HTMLElement {
|
|
|
434
434
|
(n = this.querySelector("nine-table-hscrollbar")) == null || n.refresh();
|
|
435
435
|
}), setTimeout(() => {
|
|
436
436
|
var n;
|
|
437
|
-
e(this,
|
|
437
|
+
e(this, U).call(this), (n = this.querySelector("nine-table-hscrollbar")) == null || n.refresh();
|
|
438
438
|
}, 0);
|
|
439
439
|
}, "generate"));
|
|
440
440
|
/**
|
|
@@ -459,7 +459,10 @@ const Z = class Z extends HTMLElement {
|
|
|
459
459
|
const s = this.querySelector(".ng-container-body");
|
|
460
460
|
s && (s.scrollTop = t);
|
|
461
461
|
}, "scrollToY"));
|
|
462
|
-
|
|
462
|
+
v(this, "syncRowHeights", /* @__PURE__ */ a(() => {
|
|
463
|
+
e(this, U).call(this);
|
|
464
|
+
}, "syncRowHeights"));
|
|
465
|
+
c(this, U, /* @__PURE__ */ a(() => {
|
|
463
466
|
var h, f, b;
|
|
464
467
|
const t = this.querySelector(".ng-container-left table"), s = this.querySelector(".ng-container-body table"), n = this.querySelector(".ng-container-right table");
|
|
465
468
|
if (!s) return;
|
|
@@ -476,11 +479,11 @@ const Z = class Z extends HTMLElement {
|
|
|
476
479
|
c(this, ue, /* @__PURE__ */ a(() => {
|
|
477
480
|
e(this, ge).call(this), new MutationObserver((t) => {
|
|
478
481
|
for (const s of t)
|
|
479
|
-
s.attributeName === "class" && this.classList.contains("active") && e(this,
|
|
482
|
+
s.attributeName === "class" && this.classList.contains("active") && e(this, U).call(this);
|
|
480
483
|
}).observe(this, { attributes: !0 });
|
|
481
484
|
}, "#init"));
|
|
482
485
|
c(this, ge, /* @__PURE__ */ a(() => {
|
|
483
|
-
const t =
|
|
486
|
+
const t = F.SCROLLBAR_SIZE;
|
|
484
487
|
this.innerHTML = `
|
|
485
488
|
<style>
|
|
486
489
|
nine-table-sheet {
|
|
@@ -609,11 +612,11 @@ const Z = class Z extends HTMLElement {
|
|
|
609
612
|
e(this, ue).call(this);
|
|
610
613
|
}
|
|
611
614
|
disconnectedCallback() {
|
|
612
|
-
this.innerHTML = "",
|
|
615
|
+
this.innerHTML = "", j.log("NineTableSheet destroyed.");
|
|
613
616
|
}
|
|
614
617
|
};
|
|
615
|
-
X = new WeakMap(), Y = new WeakMap(), he = new WeakMap(), de = new WeakMap(), fe = new WeakMap(),
|
|
616
|
-
let se =
|
|
618
|
+
X = new WeakMap(), Y = new WeakMap(), he = new WeakMap(), de = new WeakMap(), fe = new WeakMap(), U = new WeakMap(), ue = new WeakMap(), ge = new WeakMap(), a(F, "NineTableSheet"), v(F, "SCROLLBAR_SIZE", 16);
|
|
619
|
+
let se = F;
|
|
617
620
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", se);
|
|
618
621
|
var be, ee;
|
|
619
622
|
const We = class We extends HTMLElement {
|
|
@@ -822,18 +825,18 @@ const De = class De {
|
|
|
822
825
|
};
|
|
823
826
|
H = new WeakMap(), P = new WeakMap(), a(De, "ngRow");
|
|
824
827
|
let Le = De;
|
|
825
|
-
var
|
|
826
|
-
const
|
|
828
|
+
var A, m, q, K, me, M, we, ie, ve, xe, Z;
|
|
829
|
+
const T = class T {
|
|
827
830
|
constructor(i, t) {
|
|
828
|
-
c(this,
|
|
831
|
+
c(this, A);
|
|
829
832
|
c(this, m);
|
|
830
|
-
c(this,
|
|
831
|
-
c(this,
|
|
833
|
+
c(this, q, []);
|
|
834
|
+
c(this, K, []);
|
|
832
835
|
c(this, me, 0);
|
|
833
836
|
c(this, M, []);
|
|
834
837
|
c(this, we, /* @__PURE__ */ a(() => {
|
|
835
838
|
g(this, M, []);
|
|
836
|
-
const i = e(this,
|
|
839
|
+
const i = e(this, A).template || [];
|
|
837
840
|
Array.from(i).forEach((t) => {
|
|
838
841
|
var s;
|
|
839
842
|
e(this, M).push(((s = t.getBoundingClientRect) == null ? void 0 : s.call(t).height) || 24);
|
|
@@ -845,25 +848,25 @@ const q = class q {
|
|
|
845
848
|
this.clear(), this.add(i, !1);
|
|
846
849
|
}, "set"));
|
|
847
850
|
c(this, ie, /* @__PURE__ */ a(() => ({
|
|
848
|
-
rowState:
|
|
851
|
+
rowState: T.ROW_STATE.EMPTY,
|
|
849
852
|
deleted: !1,
|
|
850
853
|
filtered: !1,
|
|
851
854
|
height: e(this, M).slice(),
|
|
852
855
|
o: {},
|
|
853
856
|
c: {},
|
|
854
|
-
_: [0, 0, 0, 0,
|
|
857
|
+
_: [0, 0, 0, 0, T.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, M).slice(), -1, {}, {}]
|
|
855
858
|
}), "#getDefaultMeta"));
|
|
856
859
|
v(this, "reset", /* @__PURE__ */ a(() => {
|
|
857
|
-
g(this,
|
|
860
|
+
g(this, q, []), g(this, K, []);
|
|
858
861
|
}, "reset"));
|
|
859
862
|
v(this, "clear", /* @__PURE__ */ a(() => {
|
|
860
863
|
var i;
|
|
861
|
-
e(this, m).rawRecords = [], g(this,
|
|
864
|
+
e(this, m).rawRecords = [], g(this, q, []), g(this, K, []), (i = e(this, m).viewRecords) != null && i.reset && e(this, m).viewRecords.reset();
|
|
862
865
|
}, "clear"));
|
|
863
866
|
c(this, ve, /* @__PURE__ */ a((i) => {
|
|
864
867
|
var n;
|
|
865
868
|
Array.isArray(i) || (i = [i]);
|
|
866
|
-
const t = typeof ((n = e(this,
|
|
869
|
+
const t = typeof ((n = e(this, A).fields) == null ? void 0 : n.get) == "function" ? e(this, A).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
867
870
|
return i.forEach((r) => {
|
|
868
871
|
const o = { v: [] };
|
|
869
872
|
t.forEach((l) => {
|
|
@@ -872,7 +875,7 @@ const q = class q {
|
|
|
872
875
|
}), s;
|
|
873
876
|
}, "#json2Array"));
|
|
874
877
|
c(this, xe, /* @__PURE__ */ a((i) => (Array.isArray(i) || (i = [i]), i.forEach((t) => {
|
|
875
|
-
t.__ng = e(this, ie).call(this), t.__ng.rowid = this.nextId, t.__ng.rowState =
|
|
878
|
+
t.__ng = e(this, ie).call(this), t.__ng.rowid = this.nextId, t.__ng.rowState = T.ROW_STATE.INSERT, t.__ng._[0] = t.__ng.rowid;
|
|
876
879
|
}), i), "#defaultInsert"));
|
|
877
880
|
v(this, "add", /* @__PURE__ */ a((i, t = !0) => {
|
|
878
881
|
var r;
|
|
@@ -882,17 +885,17 @@ const q = class q {
|
|
|
882
885
|
const n = this.count() - 1;
|
|
883
886
|
return t || s.forEach((o, l) => {
|
|
884
887
|
const d = e(this, m).rawRecords[n - l];
|
|
885
|
-
d && (d.__ng.rowState =
|
|
888
|
+
d && (d.__ng.rowState = T.ROW_STATE.EMPTY);
|
|
886
889
|
}), (r = e(this, m).viewRecords) != null && r.reset && e(this, m).viewRecords.reset(), n;
|
|
887
890
|
}, "add"));
|
|
888
891
|
v(this, "delete", /* @__PURE__ */ a((i) => {
|
|
889
892
|
var s;
|
|
890
893
|
let t = [];
|
|
891
894
|
Array.isArray(i) ? t = i : typeof i > "u" ? t = [e(this, m).owner.row.at] : t = [parseInt(i, 10)], t.sort((n, r) => r - n).forEach((n) => {
|
|
892
|
-
if (e(this,
|
|
893
|
-
const r = e(this,
|
|
894
|
-
e(this,
|
|
895
|
-
o.__ng.rowid === r && (o.__ng.deleted = !0, o.__ng.rowState =
|
|
895
|
+
if (e(this, q)[n]) {
|
|
896
|
+
const r = e(this, q)[n].__ng.rowid;
|
|
897
|
+
e(this, q)[n].__ng.rowState === T.ROW_STATE.INSERT ? e(this, m).rawRecords = e(this, m).rawRecords.filter((o) => o.__ng.rowid !== r) : e(this, m).rawRecords.forEach((o) => {
|
|
898
|
+
o.__ng.rowid === r && (o.__ng.deleted = !0, o.__ng.rowState = T.ROW_STATE.DELETE);
|
|
896
899
|
});
|
|
897
900
|
}
|
|
898
901
|
}), this.resetRecords(), (s = e(this, m).viewRecords) != null && s.reset && e(this, m).viewRecords.reset();
|
|
@@ -900,25 +903,25 @@ const q = class q {
|
|
|
900
903
|
v(this, "setValue", /* @__PURE__ */ a((i, t, s) => {
|
|
901
904
|
var d;
|
|
902
905
|
i = parseInt(i, 10);
|
|
903
|
-
const r = (typeof ((d = e(this,
|
|
906
|
+
const r = (typeof ((d = e(this, A).fields) == null ? void 0 : d.get) == "function" ? e(this, A).fields.get() : []).indexOf(t);
|
|
904
907
|
if (r < 0) return;
|
|
905
908
|
const o = this.getValidData()[i];
|
|
906
909
|
if (!o) return;
|
|
907
910
|
const l = o.v[r];
|
|
908
|
-
l !== s && o.__ng.rowState !==
|
|
911
|
+
l !== s && o.__ng.rowState !== T.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(t) || (o.__ng.o[t] = l), o.__ng.rowState = T.ROW_STATE.UPDATE), o.v[r] = s, e(this, m).owner.refreshData && e(this, m).owner.refreshData(i);
|
|
909
912
|
}, "setValue"));
|
|
910
913
|
v(this, "resetRecords", /* @__PURE__ */ a(() => {
|
|
911
|
-
g(this,
|
|
914
|
+
g(this, K, e(this, m).rawRecords.filter((i) => !i.__ng.deleted)), g(this, q, e(this, m).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), e(this, m).rawRecords.forEach((i, t) => {
|
|
912
915
|
i.__ng.rowidx = t;
|
|
913
|
-
}), e(this,
|
|
916
|
+
}), e(this, q).forEach((i, t) => {
|
|
914
917
|
i.__ng.i = t;
|
|
915
918
|
});
|
|
916
919
|
}, "resetRecords"));
|
|
917
|
-
v(this, "getValidData", /* @__PURE__ */ a(() => (e(this,
|
|
918
|
-
c(this,
|
|
920
|
+
v(this, "getValidData", /* @__PURE__ */ a(() => (e(this, q).length === 0 && e(this, m).rawRecords.length > 0 && this.resetRecords(), e(this, q)), "getValidData"));
|
|
921
|
+
c(this, Z, /* @__PURE__ */ a((i) => {
|
|
919
922
|
var s;
|
|
920
923
|
if (!i) return i;
|
|
921
|
-
const t = typeof ((s = e(this,
|
|
924
|
+
const t = typeof ((s = e(this, A).fields) == null ? void 0 : s.get) == "function" ? e(this, A).fields.get() : [];
|
|
922
925
|
return Array.isArray(i) ? i.filter((n) => !n.__ng.deleted).map((n) => {
|
|
923
926
|
const r = {};
|
|
924
927
|
return t.forEach((o, l) => {
|
|
@@ -931,19 +934,19 @@ const q = class q {
|
|
|
931
934
|
var r;
|
|
932
935
|
const s = this.getValidData();
|
|
933
936
|
if (!s || s.length <= 0) return;
|
|
934
|
-
if (i == null) return e(this,
|
|
937
|
+
if (i == null) return e(this, Z).call(this, s);
|
|
935
938
|
if (i < 0 || i >= s.length) return null;
|
|
936
|
-
const n = typeof ((r = e(this,
|
|
939
|
+
const n = typeof ((r = e(this, A).fields) == null ? void 0 : r.get) == "function" ? e(this, A).fields.get() : [];
|
|
937
940
|
if (t != null) {
|
|
938
941
|
const o = n.indexOf(t);
|
|
939
942
|
return o >= 0 ? s[i].v[o] : null;
|
|
940
943
|
}
|
|
941
|
-
return e(this,
|
|
944
|
+
return e(this, Z).call(this, s[i]);
|
|
942
945
|
}, "get"));
|
|
943
|
-
g(this,
|
|
946
|
+
g(this, A, i), g(this, m, t), e(this, we).call(this);
|
|
944
947
|
}
|
|
945
948
|
get source() {
|
|
946
|
-
return e(this,
|
|
949
|
+
return e(this, Z).call(this, e(this, m).rawRecords);
|
|
947
950
|
}
|
|
948
951
|
set source(i) {
|
|
949
952
|
this.clear(), this.add(i, !1);
|
|
@@ -952,21 +955,21 @@ const q = class q {
|
|
|
952
955
|
return ++Ue(this, me)._;
|
|
953
956
|
}
|
|
954
957
|
get length() {
|
|
955
|
-
return e(this,
|
|
958
|
+
return e(this, q).length;
|
|
956
959
|
}
|
|
957
960
|
getRowCount() {
|
|
958
961
|
return this.length;
|
|
959
962
|
}
|
|
960
963
|
};
|
|
961
|
-
|
|
962
|
-
v(
|
|
964
|
+
A = new WeakMap(), m = new WeakMap(), q = new WeakMap(), K = new WeakMap(), me = new WeakMap(), M = new WeakMap(), we = new WeakMap(), ie = new WeakMap(), ve = new WeakMap(), xe = new WeakMap(), Z = new WeakMap(), a(T, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
965
|
+
v(T, "ROW_STATE", {
|
|
963
966
|
EMPTY: "EMPTY",
|
|
964
967
|
NORMAL: "NORMAL",
|
|
965
968
|
INSERT: "INSERT",
|
|
966
969
|
UPDATE: "UPDATE",
|
|
967
970
|
DELETE: "DELETE"
|
|
968
971
|
});
|
|
969
|
-
let Ce =
|
|
972
|
+
let Ce = T;
|
|
970
973
|
const Ne = class Ne {
|
|
971
974
|
constructor(i) {
|
|
972
975
|
this.owner = i, this.row = new Le(this), this.data = new Ce(i, this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
@@ -998,10 +1001,10 @@ const Be = class Be extends HTMLElement {
|
|
|
998
1001
|
this.attachShadow({ mode: "open" }), g(this, V, new _e(this));
|
|
999
1002
|
}
|
|
1000
1003
|
connectedCallback() {
|
|
1001
|
-
g(this, Se, new ke(this)),
|
|
1004
|
+
g(this, Se, new ke(this)), j.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1002
1005
|
}
|
|
1003
1006
|
disconnectedCallback() {
|
|
1004
|
-
|
|
1007
|
+
j.log("NineTable disconnected.");
|
|
1005
1008
|
}
|
|
1006
1009
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1007
1010
|
get data() {
|