@ninebone/table 0.0.279 β 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 +77 -71
- 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);
|
|
@@ -426,13 +426,16 @@ const Z = class Z extends HTMLElement {
|
|
|
426
426
|
});
|
|
427
427
|
}, "#updateContainerWidths"));
|
|
428
428
|
v(this, "generate", /* @__PURE__ */ a((t) => {
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
429
|
+
if (!t) return;
|
|
430
|
+
g(this, X, Ae.compile(t)), e(this, X).style.display = "table", e(this, he).call(this), e(this, Y).initialize(), e(this, de).call(this);
|
|
431
|
+
const s = this.querySelector(".ng-container-body");
|
|
432
|
+
s && s.addEventListener("scroll", () => {
|
|
433
|
+
var n;
|
|
434
|
+
(n = this.querySelector("nine-table-hscrollbar")) == null || n.refresh();
|
|
432
435
|
}), setTimeout(() => {
|
|
433
|
-
var
|
|
434
|
-
e(this,
|
|
435
|
-
}, 0)
|
|
436
|
+
var n;
|
|
437
|
+
e(this, U).call(this), (n = this.querySelector("nine-table-hscrollbar")) == null || n.refresh();
|
|
438
|
+
}, 0);
|
|
436
439
|
}, "generate"));
|
|
437
440
|
/**
|
|
438
441
|
* π― λ§μ€ν° ν
μ΄λΈμ κΈ°λ°μΌλ‘ νΉμ fixed νμ
μμλ§ λ¨κΈ°λ λΆν ν¬νΌ
|
|
@@ -456,7 +459,10 @@ const Z = class Z extends HTMLElement {
|
|
|
456
459
|
const s = this.querySelector(".ng-container-body");
|
|
457
460
|
s && (s.scrollTop = t);
|
|
458
461
|
}, "scrollToY"));
|
|
459
|
-
|
|
462
|
+
v(this, "syncRowHeights", /* @__PURE__ */ a(() => {
|
|
463
|
+
e(this, U).call(this);
|
|
464
|
+
}, "syncRowHeights"));
|
|
465
|
+
c(this, U, /* @__PURE__ */ a(() => {
|
|
460
466
|
var h, f, b;
|
|
461
467
|
const t = this.querySelector(".ng-container-left table"), s = this.querySelector(".ng-container-body table"), n = this.querySelector(".ng-container-right table");
|
|
462
468
|
if (!s) return;
|
|
@@ -473,11 +479,11 @@ const Z = class Z extends HTMLElement {
|
|
|
473
479
|
c(this, ue, /* @__PURE__ */ a(() => {
|
|
474
480
|
e(this, ge).call(this), new MutationObserver((t) => {
|
|
475
481
|
for (const s of t)
|
|
476
|
-
s.attributeName === "class" && this.classList.contains("active") && e(this,
|
|
482
|
+
s.attributeName === "class" && this.classList.contains("active") && e(this, U).call(this);
|
|
477
483
|
}).observe(this, { attributes: !0 });
|
|
478
484
|
}, "#init"));
|
|
479
485
|
c(this, ge, /* @__PURE__ */ a(() => {
|
|
480
|
-
const t =
|
|
486
|
+
const t = F.SCROLLBAR_SIZE;
|
|
481
487
|
this.innerHTML = `
|
|
482
488
|
<style>
|
|
483
489
|
nine-table-sheet {
|
|
@@ -606,11 +612,11 @@ const Z = class Z extends HTMLElement {
|
|
|
606
612
|
e(this, ue).call(this);
|
|
607
613
|
}
|
|
608
614
|
disconnectedCallback() {
|
|
609
|
-
this.innerHTML = "",
|
|
615
|
+
this.innerHTML = "", j.log("NineTableSheet destroyed.");
|
|
610
616
|
}
|
|
611
617
|
};
|
|
612
|
-
X = new WeakMap(), Y = new WeakMap(), he = new WeakMap(), de = new WeakMap(), fe = new WeakMap(),
|
|
613
|
-
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;
|
|
614
620
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", se);
|
|
615
621
|
var be, ee;
|
|
616
622
|
const We = class We extends HTMLElement {
|
|
@@ -819,18 +825,18 @@ const De = class De {
|
|
|
819
825
|
};
|
|
820
826
|
H = new WeakMap(), P = new WeakMap(), a(De, "ngRow");
|
|
821
827
|
let Le = De;
|
|
822
|
-
var
|
|
823
|
-
const
|
|
828
|
+
var A, m, q, K, me, M, we, ie, ve, xe, Z;
|
|
829
|
+
const T = class T {
|
|
824
830
|
constructor(i, t) {
|
|
825
|
-
c(this,
|
|
831
|
+
c(this, A);
|
|
826
832
|
c(this, m);
|
|
827
|
-
c(this,
|
|
828
|
-
c(this,
|
|
833
|
+
c(this, q, []);
|
|
834
|
+
c(this, K, []);
|
|
829
835
|
c(this, me, 0);
|
|
830
836
|
c(this, M, []);
|
|
831
837
|
c(this, we, /* @__PURE__ */ a(() => {
|
|
832
838
|
g(this, M, []);
|
|
833
|
-
const i = e(this,
|
|
839
|
+
const i = e(this, A).template || [];
|
|
834
840
|
Array.from(i).forEach((t) => {
|
|
835
841
|
var s;
|
|
836
842
|
e(this, M).push(((s = t.getBoundingClientRect) == null ? void 0 : s.call(t).height) || 24);
|
|
@@ -842,25 +848,25 @@ const q = class q {
|
|
|
842
848
|
this.clear(), this.add(i, !1);
|
|
843
849
|
}, "set"));
|
|
844
850
|
c(this, ie, /* @__PURE__ */ a(() => ({
|
|
845
|
-
rowState:
|
|
851
|
+
rowState: T.ROW_STATE.EMPTY,
|
|
846
852
|
deleted: !1,
|
|
847
853
|
filtered: !1,
|
|
848
854
|
height: e(this, M).slice(),
|
|
849
855
|
o: {},
|
|
850
856
|
c: {},
|
|
851
|
-
_: [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, {}, {}]
|
|
852
858
|
}), "#getDefaultMeta"));
|
|
853
859
|
v(this, "reset", /* @__PURE__ */ a(() => {
|
|
854
|
-
g(this,
|
|
860
|
+
g(this, q, []), g(this, K, []);
|
|
855
861
|
}, "reset"));
|
|
856
862
|
v(this, "clear", /* @__PURE__ */ a(() => {
|
|
857
863
|
var i;
|
|
858
|
-
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();
|
|
859
865
|
}, "clear"));
|
|
860
866
|
c(this, ve, /* @__PURE__ */ a((i) => {
|
|
861
867
|
var n;
|
|
862
868
|
Array.isArray(i) || (i = [i]);
|
|
863
|
-
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 = [];
|
|
864
870
|
return i.forEach((r) => {
|
|
865
871
|
const o = { v: [] };
|
|
866
872
|
t.forEach((l) => {
|
|
@@ -869,7 +875,7 @@ const q = class q {
|
|
|
869
875
|
}), s;
|
|
870
876
|
}, "#json2Array"));
|
|
871
877
|
c(this, xe, /* @__PURE__ */ a((i) => (Array.isArray(i) || (i = [i]), i.forEach((t) => {
|
|
872
|
-
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;
|
|
873
879
|
}), i), "#defaultInsert"));
|
|
874
880
|
v(this, "add", /* @__PURE__ */ a((i, t = !0) => {
|
|
875
881
|
var r;
|
|
@@ -879,17 +885,17 @@ const q = class q {
|
|
|
879
885
|
const n = this.count() - 1;
|
|
880
886
|
return t || s.forEach((o, l) => {
|
|
881
887
|
const d = e(this, m).rawRecords[n - l];
|
|
882
|
-
d && (d.__ng.rowState =
|
|
888
|
+
d && (d.__ng.rowState = T.ROW_STATE.EMPTY);
|
|
883
889
|
}), (r = e(this, m).viewRecords) != null && r.reset && e(this, m).viewRecords.reset(), n;
|
|
884
890
|
}, "add"));
|
|
885
891
|
v(this, "delete", /* @__PURE__ */ a((i) => {
|
|
886
892
|
var s;
|
|
887
893
|
let t = [];
|
|
888
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) => {
|
|
889
|
-
if (e(this,
|
|
890
|
-
const r = e(this,
|
|
891
|
-
e(this,
|
|
892
|
-
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);
|
|
893
899
|
});
|
|
894
900
|
}
|
|
895
901
|
}), this.resetRecords(), (s = e(this, m).viewRecords) != null && s.reset && e(this, m).viewRecords.reset();
|
|
@@ -897,25 +903,25 @@ const q = class q {
|
|
|
897
903
|
v(this, "setValue", /* @__PURE__ */ a((i, t, s) => {
|
|
898
904
|
var d;
|
|
899
905
|
i = parseInt(i, 10);
|
|
900
|
-
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);
|
|
901
907
|
if (r < 0) return;
|
|
902
908
|
const o = this.getValidData()[i];
|
|
903
909
|
if (!o) return;
|
|
904
910
|
const l = o.v[r];
|
|
905
|
-
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);
|
|
906
912
|
}, "setValue"));
|
|
907
913
|
v(this, "resetRecords", /* @__PURE__ */ a(() => {
|
|
908
|
-
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) => {
|
|
909
915
|
i.__ng.rowidx = t;
|
|
910
|
-
}), e(this,
|
|
916
|
+
}), e(this, q).forEach((i, t) => {
|
|
911
917
|
i.__ng.i = t;
|
|
912
918
|
});
|
|
913
919
|
}, "resetRecords"));
|
|
914
|
-
v(this, "getValidData", /* @__PURE__ */ a(() => (e(this,
|
|
915
|
-
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) => {
|
|
916
922
|
var s;
|
|
917
923
|
if (!i) return i;
|
|
918
|
-
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() : [];
|
|
919
925
|
return Array.isArray(i) ? i.filter((n) => !n.__ng.deleted).map((n) => {
|
|
920
926
|
const r = {};
|
|
921
927
|
return t.forEach((o, l) => {
|
|
@@ -928,19 +934,19 @@ const q = class q {
|
|
|
928
934
|
var r;
|
|
929
935
|
const s = this.getValidData();
|
|
930
936
|
if (!s || s.length <= 0) return;
|
|
931
|
-
if (i == null) return e(this,
|
|
937
|
+
if (i == null) return e(this, Z).call(this, s);
|
|
932
938
|
if (i < 0 || i >= s.length) return null;
|
|
933
|
-
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() : [];
|
|
934
940
|
if (t != null) {
|
|
935
941
|
const o = n.indexOf(t);
|
|
936
942
|
return o >= 0 ? s[i].v[o] : null;
|
|
937
943
|
}
|
|
938
|
-
return e(this,
|
|
944
|
+
return e(this, Z).call(this, s[i]);
|
|
939
945
|
}, "get"));
|
|
940
|
-
g(this,
|
|
946
|
+
g(this, A, i), g(this, m, t), e(this, we).call(this);
|
|
941
947
|
}
|
|
942
948
|
get source() {
|
|
943
|
-
return e(this,
|
|
949
|
+
return e(this, Z).call(this, e(this, m).rawRecords);
|
|
944
950
|
}
|
|
945
951
|
set source(i) {
|
|
946
952
|
this.clear(), this.add(i, !1);
|
|
@@ -949,21 +955,21 @@ const q = class q {
|
|
|
949
955
|
return ++Ue(this, me)._;
|
|
950
956
|
}
|
|
951
957
|
get length() {
|
|
952
|
-
return e(this,
|
|
958
|
+
return e(this, q).length;
|
|
953
959
|
}
|
|
954
960
|
getRowCount() {
|
|
955
961
|
return this.length;
|
|
956
962
|
}
|
|
957
963
|
};
|
|
958
|
-
|
|
959
|
-
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", {
|
|
960
966
|
EMPTY: "EMPTY",
|
|
961
967
|
NORMAL: "NORMAL",
|
|
962
968
|
INSERT: "INSERT",
|
|
963
969
|
UPDATE: "UPDATE",
|
|
964
970
|
DELETE: "DELETE"
|
|
965
971
|
});
|
|
966
|
-
let Ce =
|
|
972
|
+
let Ce = T;
|
|
967
973
|
const Ne = class Ne {
|
|
968
974
|
constructor(i) {
|
|
969
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 = () => {
|
|
@@ -995,10 +1001,10 @@ const Be = class Be extends HTMLElement {
|
|
|
995
1001
|
this.attachShadow({ mode: "open" }), g(this, V, new _e(this));
|
|
996
1002
|
}
|
|
997
1003
|
connectedCallback() {
|
|
998
|
-
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 } }));
|
|
999
1005
|
}
|
|
1000
1006
|
disconnectedCallback() {
|
|
1001
|
-
|
|
1007
|
+
j.log("NineTable disconnected.");
|
|
1002
1008
|
}
|
|
1003
1009
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1004
1010
|
get data() {
|