@ninebone/table 0.0.324 β 0.0.326
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 +182 -180
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +6 -6
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var ie = Object.defineProperty;
|
|
2
|
+
var se = (x) => {
|
|
3
3
|
throw TypeError(x);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var c = (x, i) =>
|
|
7
|
-
var w = (x, i, e) =>
|
|
8
|
-
var t = (x, i, e) => (
|
|
9
|
-
var
|
|
5
|
+
var re = (x, i, e) => i in x ? ie(x, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : x[i] = e;
|
|
6
|
+
var c = (x, i) => ie(x, "name", { value: i, configurable: !0 });
|
|
7
|
+
var w = (x, i, e) => re(x, typeof i != "symbol" ? i + "" : i, e), ne = (x, i, e) => i.has(x) || se("Cannot " + e);
|
|
8
|
+
var t = (x, i, e) => (ne(x, i, "read from private field"), e ? e.call(x) : i.get(x)), h = (x, i, e) => i.has(x) ? se("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(x) : i.set(x, e), g = (x, i, e, s) => (ne(x, i, "write to private field"), s ? s.call(x, e) : i.set(x, e), e);
|
|
9
|
+
var oe = (x, i, e, s) => ({
|
|
10
10
|
set _(o) {
|
|
11
11
|
g(x, i, o, e);
|
|
12
12
|
},
|
|
@@ -14,31 +14,31 @@ var ne = (x, i, e, s) => ({
|
|
|
14
14
|
return t(x, i, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
import { trace as
|
|
18
|
-
const
|
|
17
|
+
import { trace as le } from "@ninebone/util";
|
|
18
|
+
const Ut = class Ut extends le.constructor {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
c(
|
|
24
|
-
let
|
|
25
|
-
const
|
|
26
|
-
var C, M, y, N, B,
|
|
27
|
-
const
|
|
23
|
+
c(Ut, "Trace");
|
|
24
|
+
let $t = Ut;
|
|
25
|
+
const tt = new $t();
|
|
26
|
+
var C, M, y, D, N, B, ft, P, ut;
|
|
27
|
+
const Ft = class Ft extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
h(this, C);
|
|
31
31
|
h(this, M, !1);
|
|
32
32
|
h(this, y);
|
|
33
|
+
h(this, D);
|
|
33
34
|
h(this, N);
|
|
34
35
|
h(this, B);
|
|
35
|
-
h(this, P);
|
|
36
36
|
h(this, ft, /* @__PURE__ */ c(() => {
|
|
37
37
|
if (!t(this, C)) return;
|
|
38
38
|
const e = t(this, C).querySelector(".ng-container-body");
|
|
39
|
-
e && (g(this,
|
|
39
|
+
e && (g(this, B, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
|
-
})), t(this,
|
|
41
|
+
})), t(this, B).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
w(this, "refresh", /* @__PURE__ */ c(() => {
|
|
44
44
|
if (!t(this, C) || !t(this, y) || t(this, M)) return;
|
|
@@ -56,12 +56,12 @@ const Ut = class Ut extends HTMLElement {
|
|
|
56
56
|
const f = Math.max(Math.min(d * (l / a), d), 20);
|
|
57
57
|
r.style.width = `${f}px`;
|
|
58
58
|
const u = e.scrollLeft, b = a - l;
|
|
59
|
-
let
|
|
60
|
-
b > 0 && (
|
|
59
|
+
let p = 0;
|
|
60
|
+
b > 0 && (p = parseInt(u / b * (d - f), 10)), p < 0 && (p = 0);
|
|
61
61
|
const E = d - f;
|
|
62
|
-
|
|
62
|
+
p > E && (p = E), r.style.left = `${p}px`, tt.log(p), t(this, y).left.disabled = p === 0, t(this, y).right.disabled = p >= E - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
h(this,
|
|
64
|
+
h(this, P, /* @__PURE__ */ c((e) => {
|
|
65
65
|
if (!t(this, y)) return !1;
|
|
66
66
|
const s = t(this, y).container, o = s.querySelector("table");
|
|
67
67
|
if (!o) return !1;
|
|
@@ -75,16 +75,16 @@ const Ut = class Ut extends HTMLElement {
|
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
76
|
h(this, ut, /* @__PURE__ */ c(() => {
|
|
77
77
|
const e = /* @__PURE__ */ c((o) => {
|
|
78
|
-
clearInterval(t(this,
|
|
78
|
+
clearInterval(t(this, D)), clearInterval(t(this, N));
|
|
79
79
|
const r = parseInt(t(this, y).thumb.style.left || 0, 10);
|
|
80
|
-
t(this,
|
|
81
|
-
clearInterval(t(this,
|
|
80
|
+
t(this, P).call(this, r + o), g(this, D, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, D)), g(this, N, setInterval(() => {
|
|
82
82
|
const n = parseInt(t(this, y).thumb.style.left || 0, 10);
|
|
83
|
-
t(this,
|
|
83
|
+
t(this, P).call(this, n + o) || clearInterval(t(this, N));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), s = /* @__PURE__ */ c(() => {
|
|
87
|
-
clearInterval(t(this,
|
|
87
|
+
clearInterval(t(this, D)), clearInterval(t(this, N));
|
|
88
88
|
}, "clearTimer");
|
|
89
89
|
["mouseup", "mouseleave", "touchend"].forEach((o) => {
|
|
90
90
|
t(this, y).left.addEventListener(o, s), t(this, y).right.addEventListener(o, s), t(this, y).track.addEventListener(o, s);
|
|
@@ -96,14 +96,14 @@ const Ut = class Ut extends HTMLElement {
|
|
|
96
96
|
if (o.button !== 0) return;
|
|
97
97
|
o.preventDefault();
|
|
98
98
|
const r = t(this, y).track.getBoundingClientRect(), n = t(this, y).thumb.clientWidth;
|
|
99
|
-
t(this,
|
|
99
|
+
t(this, P).call(this, o.clientX - r.left - n / 2);
|
|
100
100
|
}), t(this, y).thumb.addEventListener("mousedown", (o) => {
|
|
101
101
|
if (o.button !== 0) return;
|
|
102
102
|
o.stopPropagation(), o.preventDefault(), g(this, M, !0), this.shiftX = o.clientX - t(this, y).thumb.getBoundingClientRect().left;
|
|
103
103
|
const r = /* @__PURE__ */ c((l) => {
|
|
104
104
|
if (!t(this, M)) return;
|
|
105
105
|
const a = t(this, y).track.getBoundingClientRect();
|
|
106
|
-
t(this,
|
|
106
|
+
t(this, P).call(this, l.clientX - a.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), n = /* @__PURE__ */ c(() => {
|
|
108
108
|
g(this, M, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", n), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
@@ -195,17 +195,17 @@ const Ut = class Ut extends HTMLElement {
|
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
197
197
|
disconnectedCallback() {
|
|
198
|
-
t(this,
|
|
198
|
+
t(this, B) && t(this, B).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
C = new WeakMap(), M = new WeakMap(), y = new WeakMap(),
|
|
202
|
-
let
|
|
203
|
-
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar",
|
|
204
|
-
var
|
|
205
|
-
const
|
|
201
|
+
C = new WeakMap(), M = new WeakMap(), y = new WeakMap(), D = new WeakMap(), N = new WeakMap(), B = new WeakMap(), ft = new WeakMap(), P = new WeakMap(), ut = new WeakMap(), c(Ft, "NineTableHScrollBar");
|
|
202
|
+
let Wt = Ft;
|
|
203
|
+
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Wt);
|
|
204
|
+
var Y, I, S, it, st, bt;
|
|
205
|
+
const Kt = class Kt extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
-
h(this,
|
|
208
|
+
h(this, Y);
|
|
209
209
|
h(this, I, !1);
|
|
210
210
|
h(this, S);
|
|
211
211
|
h(this, it, 0);
|
|
@@ -214,7 +214,7 @@ const Ft = class Ft extends HTMLElement {
|
|
|
214
214
|
* π― μ€ν¬λ‘€λ° μμΉ λ° μΈλΈ ν¬κΈ° κ°±μ
|
|
215
215
|
*/
|
|
216
216
|
w(this, "refresh", /* @__PURE__ */ c(() => {
|
|
217
|
-
if (!t(this,
|
|
217
|
+
if (!t(this, Y) || !t(this, S) || t(this, I)) return;
|
|
218
218
|
const e = t(this, S).container, s = e.querySelector("table");
|
|
219
219
|
if (!s) return;
|
|
220
220
|
const o = t(this, S).track, r = t(this, S).thumb, n = e.clientHeight, l = s.scrollHeight;
|
|
@@ -230,8 +230,8 @@ const Ft = class Ft extends HTMLElement {
|
|
|
230
230
|
const f = e.scrollTop, u = l - n;
|
|
231
231
|
let b = 0;
|
|
232
232
|
u > 0 && (b = f / u * (a - d));
|
|
233
|
-
const
|
|
234
|
-
b < 0 && (b = 0), b >
|
|
233
|
+
const p = a - d;
|
|
234
|
+
b < 0 && (b = 0), b > p && (b = p), r.style.top = `${b}px`, t(this, S).top.disabled = f <= 0, t(this, S).bottom.disabled = f >= u - 1;
|
|
235
235
|
}, "refresh"));
|
|
236
236
|
h(this, bt, /* @__PURE__ */ c(() => {
|
|
237
237
|
const e = t(this, S).container;
|
|
@@ -242,12 +242,12 @@ const Ft = class Ft extends HTMLElement {
|
|
|
242
242
|
s.stopPropagation(), s.preventDefault(), g(this, I, !0), g(this, it, s.clientY), g(this, st, e.scrollTop);
|
|
243
243
|
const o = /* @__PURE__ */ c((n) => {
|
|
244
244
|
if (!t(this, I)) return;
|
|
245
|
-
const l = t(this, S).track.getBoundingClientRect(), a = t(this, S).thumb.clientHeight, f = l.height - a, u = n.clientY - t(this, it), b = e.clientHeight,
|
|
246
|
-
|
|
247
|
-
const q =
|
|
245
|
+
const l = t(this, S).track.getBoundingClientRect(), a = t(this, S).thumb.clientHeight, f = l.height - a, u = n.clientY - t(this, it), b = e.clientHeight, p = e.querySelector("table");
|
|
246
|
+
tt.log(p), tt.log(p.scrollHeight);
|
|
247
|
+
const q = p.scrollHeight - b;
|
|
248
248
|
if (f > 0 && q > 0) {
|
|
249
|
-
const
|
|
250
|
-
e.scrollTop = t(this, st) +
|
|
249
|
+
const O = u / f * q;
|
|
250
|
+
e.scrollTop = t(this, st) + O;
|
|
251
251
|
}
|
|
252
252
|
this.refresh();
|
|
253
253
|
}, "onMouseMove"), r = /* @__PURE__ */ c(() => {
|
|
@@ -270,7 +270,7 @@ const Ft = class Ft extends HTMLElement {
|
|
|
270
270
|
}, "#init"));
|
|
271
271
|
}
|
|
272
272
|
connectedCallback() {
|
|
273
|
-
if (g(this,
|
|
273
|
+
if (g(this, Y, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, Y)) return;
|
|
274
274
|
this.innerHTML = `
|
|
275
275
|
<style>
|
|
276
276
|
nine-table-vscrollbar {
|
|
@@ -335,7 +335,7 @@ const Ft = class Ft extends HTMLElement {
|
|
|
335
335
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
336
336
|
`;
|
|
337
337
|
const e = /* @__PURE__ */ c(() => {
|
|
338
|
-
const s = t(this,
|
|
338
|
+
const s = t(this, Y).querySelector(".ng-container-body");
|
|
339
339
|
if (!s) {
|
|
340
340
|
setTimeout(e, 10);
|
|
341
341
|
return;
|
|
@@ -351,10 +351,10 @@ const Ft = class Ft extends HTMLElement {
|
|
|
351
351
|
e();
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
|
-
|
|
355
|
-
let
|
|
356
|
-
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar",
|
|
357
|
-
var gt,
|
|
354
|
+
Y = new WeakMap(), I = new WeakMap(), S = new WeakMap(), it = new WeakMap(), st = new WeakMap(), bt = new WeakMap(), c(Kt, "NineTableVScrollBar");
|
|
355
|
+
let zt = Kt;
|
|
356
|
+
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", zt);
|
|
357
|
+
var gt, F;
|
|
358
358
|
const H = class H {
|
|
359
359
|
/**
|
|
360
360
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
@@ -369,7 +369,7 @@ const H = class H {
|
|
|
369
369
|
var o, r, n, l;
|
|
370
370
|
if (!i) return null;
|
|
371
371
|
const e = i.cloneNode(!0);
|
|
372
|
-
return t(o = H, gt).call(o, e), t(r = H,
|
|
372
|
+
return t(o = H, gt).call(o, e), t(r = H, F).call(r, e, "thead"), t(n = H, F).call(n, e, "tbody"), t(l = H, F).call(l, e, "tfoot"), Array.from(e.querySelectorAll("colgroup col")).forEach((a, d) => {
|
|
373
373
|
const f = a.getAttribute("fixed");
|
|
374
374
|
f && e.querySelectorAll(`thead [data-col="${d}"], tbody [data-col="${d}"], tfoot [data-col="${d}"]`).forEach((u) => {
|
|
375
375
|
u.setAttribute("fixed", f);
|
|
@@ -377,7 +377,7 @@ const H = class H {
|
|
|
377
377
|
}), e;
|
|
378
378
|
}
|
|
379
379
|
};
|
|
380
|
-
gt = new WeakMap(),
|
|
380
|
+
gt = new WeakMap(), F = new WeakMap(), c(H, "TableCompiler"), h(H, gt, /* @__PURE__ */ c((i) => {
|
|
381
381
|
if (!i.querySelector("colgroup")) {
|
|
382
382
|
const e = i.querySelector("tbody tr") || i.querySelector("tr"), s = e ? e.querySelectorAll("th, td").length : 1, o = document.createElement("colgroup"), r = Math.max(Math.floor(i.clientWidth / s), 100);
|
|
383
383
|
for (let n = 0; n < s; n++) {
|
|
@@ -391,7 +391,7 @@ gt = new WeakMap(), K = new WeakMap(), c(H, "TableCompiler"), h(H, gt, /* @__PUR
|
|
|
391
391
|
s ? s.after(e) : i.prepend(e);
|
|
392
392
|
}
|
|
393
393
|
i.classList.add("nine-table-element"), i.style.display = "table";
|
|
394
|
-
}, "#ensureTableStructure")), h(H,
|
|
394
|
+
}, "#ensureTableStructure")), h(H, F, /* @__PURE__ */ c((i, e) => {
|
|
395
395
|
const s = Array.from(i.querySelectorAll(e + " tr")), o = Array.from(i.querySelectorAll(e + " th," + e + " td")), r = s.length;
|
|
396
396
|
if (r === 0 || o.length === 0) return;
|
|
397
397
|
let n = 0;
|
|
@@ -408,9 +408,9 @@ gt = new WeakMap(), K = new WeakMap(), c(H, "TableCompiler"), h(H, gt, /* @__PUR
|
|
|
408
408
|
f = E;
|
|
409
409
|
break;
|
|
410
410
|
}
|
|
411
|
-
const b = u.rowSpan || 1,
|
|
411
|
+
const b = u.rowSpan || 1, p = u.colSpan || 1;
|
|
412
412
|
for (let E = 0; E < b; E++)
|
|
413
|
-
for (let q = 0; q <
|
|
413
|
+
for (let q = 0; q < p; q++)
|
|
414
414
|
d + E < r && f + q < n && (l[d + E][f + q] = E === 0 && q === 0 ? "1" : "0");
|
|
415
415
|
});
|
|
416
416
|
}), s.forEach((a) => {
|
|
@@ -424,24 +424,25 @@ gt = new WeakMap(), K = new WeakMap(), c(H, "TableCompiler"), h(H, gt, /* @__PUR
|
|
|
424
424
|
});
|
|
425
425
|
});
|
|
426
426
|
}, "#resetColIndex"));
|
|
427
|
-
let
|
|
428
|
-
var
|
|
429
|
-
const
|
|
427
|
+
let Ot = H;
|
|
428
|
+
var nt, m, _, R, $, V, K, yt, pt, ot, rt, mt, xt, lt, j, vt;
|
|
429
|
+
const jt = class jt {
|
|
430
430
|
constructor(i) {
|
|
431
|
-
h(this,
|
|
431
|
+
h(this, nt);
|
|
432
|
+
h(this, m);
|
|
432
433
|
h(this, _, /* @__PURE__ */ new Map());
|
|
433
434
|
h(this, R, null);
|
|
434
435
|
h(this, $, null);
|
|
435
|
-
h(this,
|
|
436
|
-
h(this,
|
|
436
|
+
h(this, V, 0);
|
|
437
|
+
h(this, K, 40);
|
|
437
438
|
w(this, "refresh", /* @__PURE__ */ c(() => {
|
|
438
439
|
var e;
|
|
439
|
-
const i = t(this,
|
|
440
|
-
i && (t(this,
|
|
440
|
+
const i = t(this, m).querySelector(".ng-container-body");
|
|
441
|
+
i && (t(this, ot).call(this), t(this, j).call(this, i.scrollTop), (e = t(this, m).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
441
442
|
}, "refresh"));
|
|
442
443
|
w(this, "initialize", /* @__PURE__ */ c(() => {
|
|
443
444
|
g(this, R, null), t(this, _).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
444
|
-
const r = t(this,
|
|
445
|
+
const r = t(this, m).querySelector(o);
|
|
445
446
|
if (!r) return;
|
|
446
447
|
const n = r.querySelector("table");
|
|
447
448
|
if (!n) return;
|
|
@@ -450,13 +451,13 @@ const Kt = class Kt {
|
|
|
450
451
|
const d = Array.from(l.querySelectorAll("tr")).map((f) => f.cloneNode(!0));
|
|
451
452
|
t(this, _).set(o, d);
|
|
452
453
|
});
|
|
453
|
-
const i = t(this,
|
|
454
|
+
const i = t(this, m).querySelector(".ng-container-body"), e = t(this, m).querySelector(".ng-container-left"), s = t(this, m).querySelector(".ng-container-right");
|
|
454
455
|
if (i) {
|
|
455
|
-
t(this, pt).call(this, i), t(this,
|
|
456
|
+
t(this, pt).call(this, i), t(this, lt).call(this), t(this, ot).call(this), t(this, j).call(this, i.scrollTop);
|
|
456
457
|
let o = i.scrollTop;
|
|
457
458
|
const r = /* @__PURE__ */ c((n) => {
|
|
458
459
|
var l;
|
|
459
|
-
e && e.scrollTop !== n && (e.scrollTop = n), s && s.scrollTop !== n && (s.scrollTop = n), t(this,
|
|
460
|
+
e && e.scrollTop !== n && (e.scrollTop = n), s && s.scrollTop !== n && (s.scrollTop = n), t(this, j).call(this, n), (l = t(this, m).querySelector("nine-table-vscrollbar")) == null || l.refresh();
|
|
460
461
|
}, "syncScroll");
|
|
461
462
|
i.addEventListener("scroll", () => {
|
|
462
463
|
const n = i.scrollTop;
|
|
@@ -471,7 +472,7 @@ const Kt = class Kt {
|
|
|
471
472
|
if (!o) return;
|
|
472
473
|
o.querySelectorAll("tr:not(.nodata)").forEach((l) => l.remove());
|
|
473
474
|
const r = o.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
474
|
-
for (let l = 0; l < t(this,
|
|
475
|
+
for (let l = 0; l < t(this, K); l++)
|
|
475
476
|
s.forEach((a) => {
|
|
476
477
|
n.appendChild(a.cloneNode(!0));
|
|
477
478
|
});
|
|
@@ -489,33 +490,34 @@ const Kt = class Kt {
|
|
|
489
490
|
e.forEach((b) => {
|
|
490
491
|
r.appendChild(b.cloneNode(!0));
|
|
491
492
|
}), o ? o.before(r) : s.appendChild(r);
|
|
492
|
-
const n = t(this,
|
|
493
|
+
const n = t(this, m), l = n.style.display, a = n.style.visibility, d = n.style.position;
|
|
493
494
|
(l === "none" || window.getComputedStyle(n).display === "none") && (n.style.display = "block", n.style.visibility = "hidden", n.style.position = "absolute");
|
|
494
495
|
let f = 0;
|
|
495
496
|
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
496
497
|
return u.forEach((b) => {
|
|
497
498
|
f += b.offsetHeight || b.getBoundingClientRect().height;
|
|
498
|
-
}), u.forEach((b) => b.remove()), n.style.display = l, n.style.visibility = a, n.style.position = d, g(this, R, f > 0 ? f : 24), t(this,
|
|
499
|
+
}), u.forEach((b) => b.remove()), n.style.display = l, n.style.visibility = a, n.style.position = d, g(this, R, f > 0 ? f : 24), t(this, rt).call(this), t(this, R);
|
|
499
500
|
}, "#measureAndCacheHeight"));
|
|
500
|
-
h(this,
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
501
|
+
h(this, ot, /* @__PURE__ */ c(() => {
|
|
502
|
+
if (!t(this, m).querySelector(".ng-container-body")) return;
|
|
503
|
+
const e = t(this, nt).data.get() || [];
|
|
504
|
+
console.trace(e);
|
|
505
|
+
const s = e.length > 0 ? e.length : 100, o = t(this, R), r = s * o;
|
|
506
|
+
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
507
|
+
const l = t(this, m).querySelector(n), a = l == null ? void 0 : l.querySelector("table");
|
|
508
|
+
a && (a.style.height = `${r}px`);
|
|
507
509
|
});
|
|
508
510
|
}, "#updateVirtualScrollHeight"));
|
|
509
|
-
h(this,
|
|
510
|
-
if (t(this,
|
|
511
|
-
const i = Math.ceil(t(this,
|
|
512
|
-
g(this,
|
|
511
|
+
h(this, rt, /* @__PURE__ */ c(() => {
|
|
512
|
+
if (t(this, V) > 0 && t(this, R) > 0) {
|
|
513
|
+
const i = Math.ceil(t(this, V) / t(this, R));
|
|
514
|
+
g(this, K, i + 20);
|
|
513
515
|
} else
|
|
514
|
-
g(this,
|
|
516
|
+
g(this, K, 40);
|
|
515
517
|
}, "#updateRowCount"));
|
|
516
518
|
h(this, mt, /* @__PURE__ */ c(() => {
|
|
517
519
|
var a, d, f;
|
|
518
|
-
const i = t(this,
|
|
520
|
+
const i = t(this, m).querySelector(".ng-container-left table"), e = t(this, m).querySelector(".ng-container-body table"), s = t(this, m).querySelector(".ng-container-right table");
|
|
519
521
|
if (!e) return;
|
|
520
522
|
const o = i ? Array.from(i.querySelectorAll("tr")) : [], r = Array.from(e.querySelectorAll("tr")), n = s ? Array.from(s.querySelectorAll("tr")) : [], l = Math.max(o.length, r.length, n.length);
|
|
521
523
|
for (let u = 0; u < l; u++) {
|
|
@@ -523,12 +525,12 @@ const Kt = class Kt {
|
|
|
523
525
|
((a = o[u]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
524
526
|
((d = r[u]) == null ? void 0 : d.getBoundingClientRect().height) || 0,
|
|
525
527
|
((f = n[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
526
|
-
],
|
|
527
|
-
|
|
528
|
+
], p = Math.max(...b);
|
|
529
|
+
p > 0 && (o[u] && (o[u].style.height = `${p}px`), r[u] && (r[u].style.height = `${p}px`), n[u] && (n[u].style.height = `${p}px`));
|
|
528
530
|
}
|
|
529
531
|
}, "#syncRowHeights"));
|
|
530
532
|
h(this, xt, /* @__PURE__ */ c(() => {
|
|
531
|
-
!t(this,
|
|
533
|
+
!t(this, m) || !(t(this, m) instanceof HTMLElement) || (g(this, $, new ResizeObserver((i) => {
|
|
532
534
|
for (const e of i) {
|
|
533
535
|
const s = e.target;
|
|
534
536
|
if (!s.classList.contains("active")) continue;
|
|
@@ -538,31 +540,31 @@ const Kt = class Kt {
|
|
|
538
540
|
const n = s.querySelector("thead");
|
|
539
541
|
n && (r += n.offsetHeight || n.getBoundingClientRect().height);
|
|
540
542
|
const l = Math.max(o - r, 100);
|
|
541
|
-
t(this,
|
|
543
|
+
t(this, V) !== l && (g(this, V, l), t(this, rt).call(this), t(this, R) !== null && t(this, lt).call(this));
|
|
542
544
|
}
|
|
543
545
|
}
|
|
544
|
-
})), t(this, $).observe(t(this,
|
|
546
|
+
})), t(this, $).observe(t(this, m)));
|
|
545
547
|
}, "#initResizeObserver"));
|
|
546
|
-
h(this,
|
|
548
|
+
h(this, lt, /* @__PURE__ */ c(() => {
|
|
547
549
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
548
|
-
const e = t(this,
|
|
550
|
+
const e = t(this, m).querySelector(i);
|
|
549
551
|
e && e.querySelector("tbody.bindable-tbody") && t(this, yt).call(this, e, i);
|
|
550
552
|
}), t(this, mt).call(this);
|
|
551
553
|
}, "#renderAllContainers"));
|
|
552
|
-
h(this,
|
|
554
|
+
h(this, j, /* @__PURE__ */ c((i) => {
|
|
553
555
|
var r;
|
|
554
556
|
const e = t(this, R);
|
|
555
557
|
if (!e || e <= 0) return;
|
|
556
558
|
const s = Math.max(0, Math.floor(i / e)), o = ((r = t(this, _).get(".ng-container-body")) == null ? void 0 : r.length) || 1;
|
|
557
559
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
558
|
-
const l = t(this,
|
|
560
|
+
const l = t(this, m).querySelector(n);
|
|
559
561
|
if (!l) return;
|
|
560
562
|
const a = l.querySelector("tbody.bindable-tbody");
|
|
561
563
|
if (!a) return;
|
|
562
564
|
Array.from(a.querySelectorAll("tr:not(.nodata)")).forEach((f, u) => {
|
|
563
|
-
var E, q,
|
|
564
|
-
const b = s + Math.floor(u / o),
|
|
565
|
-
f.style.display = "", t(this, vt).call(this, f,
|
|
565
|
+
var E, q, O, ee;
|
|
566
|
+
const b = s + Math.floor(u / o), p = (typeof t(this, m).getData == "function" ? t(this, m).getData(b) : null) ?? (typeof ((E = t(this, m).data) == null ? void 0 : E.get) == "function" ? t(this, m).data.get(b) : null) ?? ((O = (q = t(this, m).dataManager) == null ? void 0 : q.rawRecords) == null ? void 0 : O[b]) ?? ((ee = t(this, m).data) == null ? void 0 : ee[b]) ?? { _index: b };
|
|
567
|
+
f.style.display = "", t(this, vt).call(this, f, p, b);
|
|
566
568
|
});
|
|
567
569
|
});
|
|
568
570
|
}, "#handleScroll"));
|
|
@@ -575,7 +577,7 @@ const Kt = class Kt {
|
|
|
575
577
|
w(this, "destroy", /* @__PURE__ */ c(() => {
|
|
576
578
|
t(this, $) && (t(this, $).disconnect(), g(this, $, null));
|
|
577
579
|
}, "destroy"));
|
|
578
|
-
g(this,
|
|
580
|
+
g(this, nt, i.getRootNode().host), g(this, m, i), t(this, xt).call(this);
|
|
579
581
|
}
|
|
580
582
|
getRowHeight() {
|
|
581
583
|
return t(this, R);
|
|
@@ -585,16 +587,16 @@ const Kt = class Kt {
|
|
|
585
587
|
return ((e = t(this, _).get(i)) == null ? void 0 : e.length) || 1;
|
|
586
588
|
}
|
|
587
589
|
};
|
|
588
|
-
|
|
589
|
-
let
|
|
590
|
-
var
|
|
590
|
+
nt = new WeakMap(), m = new WeakMap(), _ = new WeakMap(), R = new WeakMap(), $ = new WeakMap(), V = new WeakMap(), K = new WeakMap(), yt = new WeakMap(), pt = new WeakMap(), ot = new WeakMap(), rt = new WeakMap(), mt = new WeakMap(), xt = new WeakMap(), lt = new WeakMap(), j = new WeakMap(), vt = new WeakMap(), c(jt, "RowManager");
|
|
591
|
+
let Dt = jt;
|
|
592
|
+
var wt, Z, G, St, Et, Rt, kt, qt;
|
|
591
593
|
const et = class et extends HTMLElement {
|
|
592
594
|
constructor() {
|
|
593
595
|
super();
|
|
594
|
-
h(this,
|
|
595
|
-
h(this,
|
|
596
|
-
h(this,
|
|
597
|
-
h(this,
|
|
596
|
+
h(this, wt);
|
|
597
|
+
h(this, Z, null);
|
|
598
|
+
h(this, G);
|
|
599
|
+
h(this, St, /* @__PURE__ */ c(() => {
|
|
598
600
|
[
|
|
599
601
|
{ selector: ".ng-container-body", type: null },
|
|
600
602
|
{ selector: ".ng-container-left", type: "left" },
|
|
@@ -602,11 +604,11 @@ const et = class et extends HTMLElement {
|
|
|
602
604
|
].forEach(({ selector: s, type: o }) => {
|
|
603
605
|
const r = this.querySelector(s);
|
|
604
606
|
if (!r) return;
|
|
605
|
-
const n = t(this,
|
|
607
|
+
const n = t(this, Rt).call(this, t(this, Z), o);
|
|
606
608
|
r.innerHTML = "", r.appendChild(n);
|
|
607
609
|
});
|
|
608
610
|
}, "#renderSplitContainers"));
|
|
609
|
-
h(this,
|
|
611
|
+
h(this, Et, /* @__PURE__ */ c(() => {
|
|
610
612
|
["left", "right"].forEach((e) => {
|
|
611
613
|
const s = this.querySelector(`.ng-container-${e}`), o = s == null ? void 0 : s.querySelector("table");
|
|
612
614
|
if (!s || !o) return;
|
|
@@ -618,13 +620,13 @@ const et = class et extends HTMLElement {
|
|
|
618
620
|
});
|
|
619
621
|
}, "#updateContainerWidths"));
|
|
620
622
|
w(this, "generate", /* @__PURE__ */ c((e) => {
|
|
621
|
-
e && (g(this,
|
|
623
|
+
e && (g(this, Z, Ot.compile(e)), t(this, Z).style.display = "table", t(this, St).call(this), t(this, Et).call(this), requestAnimationFrame(() => {
|
|
622
624
|
var o;
|
|
623
625
|
const s = (o = this.querySelector("thead")) == null ? void 0 : o.getBoundingClientRect().height;
|
|
624
626
|
this.querySelectorAll("tbody.fixed-tbody").forEach((r) => {
|
|
625
627
|
r.style.top = `${s}px`;
|
|
626
628
|
});
|
|
627
|
-
}), t(this,
|
|
629
|
+
}), t(this, G).initialize(), setTimeout(() => {
|
|
628
630
|
var s;
|
|
629
631
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
630
632
|
}, 0));
|
|
@@ -632,7 +634,7 @@ const et = class et extends HTMLElement {
|
|
|
632
634
|
/**
|
|
633
635
|
* π― λ§μ€ν° ν
μ΄λΈμ κΈ°λ°μΌλ‘ νΉμ fixed νμ
μμλ§ λ¨κΈ°λ λΆν ν¬νΌ
|
|
634
636
|
*/
|
|
635
|
-
h(this,
|
|
637
|
+
h(this, Rt, /* @__PURE__ */ c((e, s) => {
|
|
636
638
|
const o = e.cloneNode(!0), r = o.querySelector("tbody");
|
|
637
639
|
if (r) {
|
|
638
640
|
const n = document.createElement("tbody");
|
|
@@ -646,7 +648,7 @@ const et = class et extends HTMLElement {
|
|
|
646
648
|
n.remove();
|
|
647
649
|
}), o;
|
|
648
650
|
}, "#createSplitTable"));
|
|
649
|
-
w(this, "getRowHeight", /* @__PURE__ */ c(() => t(this,
|
|
651
|
+
w(this, "getRowHeight", /* @__PURE__ */ c(() => t(this, G).getRowHeight(), "getRowHeight"));
|
|
650
652
|
w(this, "scrollToX", /* @__PURE__ */ c((e) => {
|
|
651
653
|
const s = this.querySelector(".ng-container-body");
|
|
652
654
|
s && (s.scrollLeft = e);
|
|
@@ -655,10 +657,10 @@ const et = class et extends HTMLElement {
|
|
|
655
657
|
const s = this.querySelector(".ng-container-body");
|
|
656
658
|
s && (s.scrollTop = e);
|
|
657
659
|
}, "scrollToY"));
|
|
658
|
-
h(this, Rt, /* @__PURE__ */ c(() => {
|
|
659
|
-
t(this, kt).call(this);
|
|
660
|
-
}, "#init"));
|
|
661
660
|
h(this, kt, /* @__PURE__ */ c(() => {
|
|
661
|
+
t(this, qt).call(this);
|
|
662
|
+
}, "#init"));
|
|
663
|
+
h(this, qt, /* @__PURE__ */ c(() => {
|
|
662
664
|
const e = et.SCROLLBAR_SIZE;
|
|
663
665
|
this.innerHTML = `
|
|
664
666
|
<style>
|
|
@@ -805,23 +807,23 @@ const et = class et extends HTMLElement {
|
|
|
805
807
|
</div>
|
|
806
808
|
`;
|
|
807
809
|
}, "#render"));
|
|
808
|
-
g(this,
|
|
810
|
+
g(this, G, new Dt(this)), g(this, wt, this.getRootNode().host);
|
|
809
811
|
}
|
|
810
812
|
connectedCallback() {
|
|
811
|
-
t(this,
|
|
813
|
+
t(this, kt).call(this);
|
|
812
814
|
}
|
|
813
815
|
disconnectedCallback() {
|
|
814
|
-
this.innerHTML = "",
|
|
816
|
+
this.innerHTML = "", tt.log("NineTableSheet destroyed.");
|
|
815
817
|
}
|
|
816
818
|
};
|
|
817
|
-
|
|
819
|
+
wt = new WeakMap(), Z = new WeakMap(), G = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), Rt = new WeakMap(), kt = new WeakMap(), qt = new WeakMap(), c(et, "NineTableSheet"), w(et, "SCROLLBAR_SIZE", 16);
|
|
818
820
|
let dt = et;
|
|
819
821
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", dt);
|
|
820
|
-
var
|
|
821
|
-
const
|
|
822
|
+
var Tt, ct;
|
|
823
|
+
const Zt = class Zt extends HTMLElement {
|
|
822
824
|
constructor() {
|
|
823
825
|
super();
|
|
824
|
-
h(this,
|
|
826
|
+
h(this, Tt, /* @__PURE__ */ c(() => {
|
|
825
827
|
var e;
|
|
826
828
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
827
829
|
var n;
|
|
@@ -832,11 +834,11 @@ const jt = class jt extends HTMLElement {
|
|
|
832
834
|
h(this, ct, /* @__PURE__ */ c((e, s = !1) => {
|
|
833
835
|
const o = /* @__PURE__ */ c(() => {
|
|
834
836
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
835
|
-
Array.from(this.querySelectorAll("nine-splitter")).forEach((
|
|
836
|
-
const b = f.filter((
|
|
837
|
-
b.length < 2 || b.forEach((
|
|
838
|
-
const E = parseInt(
|
|
839
|
-
q &&
|
|
837
|
+
Array.from(this.querySelectorAll("nine-splitter")).forEach((p) => p.style.setProperty("display", "none"));
|
|
838
|
+
const b = f.filter((p) => p.classList.contains("active"));
|
|
839
|
+
b.length < 2 || b.forEach((p) => {
|
|
840
|
+
const E = parseInt(p.getAttribute("data-index"), 10), q = this.querySelector(`nine-splitter[data-split-index="${E}"]`), O = f[E + 1];
|
|
841
|
+
q && O && O.classList.contains("active") && q.style.setProperty("display", "flex");
|
|
840
842
|
});
|
|
841
843
|
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), n = this.querySelector("nine-table-sheets-body"), l = r.querySelectorAll(".nine-tab-item"), a = n.querySelectorAll("nine-table-sheet");
|
|
842
844
|
if (!l[e]) return;
|
|
@@ -862,18 +864,18 @@ const jt = class jt extends HTMLElement {
|
|
|
862
864
|
}, "#switchSheet"));
|
|
863
865
|
}
|
|
864
866
|
connectedCallback() {
|
|
865
|
-
t(this,
|
|
867
|
+
t(this, Tt).call(this);
|
|
866
868
|
}
|
|
867
869
|
};
|
|
868
|
-
|
|
869
|
-
let
|
|
870
|
-
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets",
|
|
871
|
-
var k,
|
|
872
|
-
const
|
|
870
|
+
Tt = new WeakMap(), ct = new WeakMap(), c(Zt, "NineTableSheets");
|
|
871
|
+
let Nt = Zt;
|
|
872
|
+
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", Nt);
|
|
873
|
+
var k, At, at, Lt;
|
|
874
|
+
const Gt = class Gt {
|
|
873
875
|
constructor(i) {
|
|
874
876
|
h(this, k);
|
|
875
|
-
h(this,
|
|
876
|
-
t(this,
|
|
877
|
+
h(this, At, /* @__PURE__ */ c(() => {
|
|
878
|
+
t(this, Lt).call(this), new ResizeObserver((i) => {
|
|
877
879
|
for (let e of i)
|
|
878
880
|
t(this, k).getAttribute("auto-height") === "true" && t(this, at).call(this);
|
|
879
881
|
}).observe(t(this, k));
|
|
@@ -885,7 +887,7 @@ const Zt = class Zt {
|
|
|
885
887
|
const e = parseInt(t(this, k).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), o = (a = t(this, k).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : a.getBoundingClientRect().height, r = (d = t(this, k).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : d.getBoundingClientRect().height, n = dt.SCROLLBAR_SIZE, l = e * s + o + r + n;
|
|
886
888
|
t(this, k).style.height = `${l}px`;
|
|
887
889
|
}, "#applyAutoHeight"));
|
|
888
|
-
h(this,
|
|
890
|
+
h(this, Lt, /* @__PURE__ */ c(() => {
|
|
889
891
|
const e = Array.from(t(this, k).children).filter((a) => a.tagName === "TABLE"), s = t(this, k).getAttribute("auto-height") === "true", o = e.length, r = e.map((a, d) => {
|
|
890
892
|
const u = `<nine-table-sheet class="${d === 0 ? "active" : ""}" data-index="${d}"></nine-table-sheet>`, b = d < o - 1 ? `<nine-splitter class="h" data-split-index="${d}"></nine-splitter>` : "";
|
|
891
893
|
return u + b;
|
|
@@ -996,44 +998,44 @@ const Zt = class Zt {
|
|
|
996
998
|
});
|
|
997
999
|
});
|
|
998
1000
|
}, "#render"));
|
|
999
|
-
g(this, k, i), t(this,
|
|
1001
|
+
g(this, k, i), t(this, At).call(this);
|
|
1000
1002
|
}
|
|
1001
1003
|
};
|
|
1002
|
-
k = new WeakMap(),
|
|
1003
|
-
let
|
|
1004
|
-
var W,
|
|
1005
|
-
const
|
|
1004
|
+
k = new WeakMap(), At = new WeakMap(), at = new WeakMap(), Lt = new WeakMap(), c(Gt, "LayoutManager");
|
|
1005
|
+
let Bt = Gt;
|
|
1006
|
+
var W, X;
|
|
1007
|
+
const Jt = class Jt {
|
|
1006
1008
|
constructor(i) {
|
|
1007
1009
|
h(this, W);
|
|
1008
|
-
h(this,
|
|
1010
|
+
h(this, X, -1);
|
|
1009
1011
|
w(this, "count", /* @__PURE__ */ c(() => t(this, W).rawRecords.length, "count"));
|
|
1010
1012
|
g(this, W, i);
|
|
1011
1013
|
}
|
|
1012
1014
|
get at() {
|
|
1013
|
-
return t(this,
|
|
1015
|
+
return t(this, X);
|
|
1014
1016
|
}
|
|
1015
1017
|
set at(i) {
|
|
1016
1018
|
var s, o;
|
|
1017
|
-
g(this,
|
|
1019
|
+
g(this, X, parseInt(i, 10));
|
|
1018
1020
|
const e = ((o = (s = t(this, W).owner).querySelector) == null ? void 0 : o.call(s, ".ng-container-body")) || t(this, W).owner.body;
|
|
1019
|
-
e && !e.querySelector(`tbody.bindable tr[data-row="${t(this,
|
|
1021
|
+
e && !e.querySelector(`tbody.bindable tr[data-row="${t(this, X)}"]`) && setTimeout(() => {
|
|
1020
1022
|
var r, n;
|
|
1021
|
-
(n = (r = t(this, W).owner).scrollTo_V1) == null || n.call(r, t(this,
|
|
1023
|
+
(n = (r = t(this, W).owner).scrollTo_V1) == null || n.call(r, t(this, X));
|
|
1022
1024
|
});
|
|
1023
1025
|
}
|
|
1024
1026
|
};
|
|
1025
|
-
W = new WeakMap(),
|
|
1026
|
-
let
|
|
1027
|
-
var T, v, A,
|
|
1027
|
+
W = new WeakMap(), X = new WeakMap(), c(Jt, "ngRow");
|
|
1028
|
+
let Pt = Jt;
|
|
1029
|
+
var T, v, A, J, Ht, z, Ct, ht, _t, Mt, Q;
|
|
1028
1030
|
const L = class L {
|
|
1029
1031
|
constructor(i, e) {
|
|
1030
1032
|
h(this, T);
|
|
1031
1033
|
h(this, v);
|
|
1032
1034
|
h(this, A, []);
|
|
1033
|
-
h(this,
|
|
1034
|
-
h(this,
|
|
1035
|
+
h(this, J, []);
|
|
1036
|
+
h(this, Ht, 0);
|
|
1035
1037
|
h(this, z, []);
|
|
1036
|
-
h(this,
|
|
1038
|
+
h(this, Ct, /* @__PURE__ */ c(() => {
|
|
1037
1039
|
g(this, z, []);
|
|
1038
1040
|
const i = t(this, T).template || [];
|
|
1039
1041
|
Array.from(i).forEach((e) => {
|
|
@@ -1056,13 +1058,13 @@ const L = class L {
|
|
|
1056
1058
|
_: [0, 0, 0, 0, L.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, z).slice(), -1, {}, {}]
|
|
1057
1059
|
}), "#getDefaultMeta"));
|
|
1058
1060
|
w(this, "reset", /* @__PURE__ */ c(() => {
|
|
1059
|
-
g(this, A, []), g(this,
|
|
1061
|
+
g(this, A, []), g(this, J, []);
|
|
1060
1062
|
}, "reset"));
|
|
1061
1063
|
w(this, "clear", /* @__PURE__ */ c(() => {
|
|
1062
1064
|
var i;
|
|
1063
|
-
t(this, v).rawRecords = [], g(this, A, []), g(this,
|
|
1065
|
+
t(this, v).rawRecords = [], g(this, A, []), g(this, J, []), (i = t(this, v).viewRecords) != null && i.reset && t(this, v).viewRecords.reset();
|
|
1064
1066
|
}, "clear"));
|
|
1065
|
-
h(this,
|
|
1067
|
+
h(this, _t, /* @__PURE__ */ c((i) => {
|
|
1066
1068
|
var o;
|
|
1067
1069
|
Array.isArray(i) || (i = [i]);
|
|
1068
1070
|
const e = typeof ((o = t(this, T).fields) == null ? void 0 : o.get) == "function" ? t(this, T).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
@@ -1073,14 +1075,14 @@ const L = class L {
|
|
|
1073
1075
|
}), s.push(n);
|
|
1074
1076
|
}), s;
|
|
1075
1077
|
}, "#json2Array"));
|
|
1076
|
-
h(this,
|
|
1078
|
+
h(this, Mt, /* @__PURE__ */ c((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1077
1079
|
e.__ng = t(this, ht).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = L.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1078
1080
|
}), i), "#defaultInsert"));
|
|
1079
1081
|
w(this, "add", /* @__PURE__ */ c((i, e = !0) => {
|
|
1080
1082
|
var r;
|
|
1081
1083
|
i === void 0 && (i = {});
|
|
1082
|
-
const s = t(this,
|
|
1083
|
-
t(this, v).rawRecords = t(this, v).rawRecords.concat(t(this,
|
|
1084
|
+
const s = t(this, _t).call(this, i);
|
|
1085
|
+
t(this, v).rawRecords = t(this, v).rawRecords.concat(t(this, Mt).call(this, s)), this.resetRecords();
|
|
1084
1086
|
const o = this.count() - 1;
|
|
1085
1087
|
return e || s.forEach((n, l) => {
|
|
1086
1088
|
const a = t(this, v).rawRecords[o - l];
|
|
@@ -1110,14 +1112,14 @@ const L = class L {
|
|
|
1110
1112
|
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, t(this, v).owner.refreshData && t(this, v).owner.refreshData(i);
|
|
1111
1113
|
}, "setValue"));
|
|
1112
1114
|
w(this, "resetRecords", /* @__PURE__ */ c(() => {
|
|
1113
|
-
g(this,
|
|
1115
|
+
g(this, J, t(this, v).rawRecords.filter((i) => !i.__ng.deleted)), g(this, A, t(this, v).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, v).rawRecords.forEach((i, e) => {
|
|
1114
1116
|
i.__ng.rowidx = e;
|
|
1115
1117
|
}), t(this, A).forEach((i, e) => {
|
|
1116
1118
|
i.__ng.i = e;
|
|
1117
1119
|
});
|
|
1118
1120
|
}, "resetRecords"));
|
|
1119
1121
|
w(this, "getValidData", /* @__PURE__ */ c(() => (t(this, A).length === 0 && t(this, v).rawRecords.length > 0 && this.resetRecords(), t(this, A)), "getValidData"));
|
|
1120
|
-
h(this,
|
|
1122
|
+
h(this, Q, /* @__PURE__ */ c((i) => {
|
|
1121
1123
|
var s;
|
|
1122
1124
|
if (!i) return i;
|
|
1123
1125
|
const e = typeof ((s = t(this, T).fields) == null ? void 0 : s.get) == "function" ? t(this, T).fields.get() : [];
|
|
@@ -1133,25 +1135,25 @@ const L = class L {
|
|
|
1133
1135
|
var r;
|
|
1134
1136
|
const s = this.getValidData();
|
|
1135
1137
|
if (!s || s.length <= 0) return;
|
|
1136
|
-
if (i == null) return t(this,
|
|
1138
|
+
if (i == null) return t(this, Q).call(this, s);
|
|
1137
1139
|
if (i < 0 || i >= s.length) return null;
|
|
1138
1140
|
const o = typeof ((r = t(this, T).fields) == null ? void 0 : r.get) == "function" ? t(this, T).fields.get() : [];
|
|
1139
1141
|
if (e != null) {
|
|
1140
1142
|
const n = o.indexOf(e);
|
|
1141
1143
|
return n >= 0 ? s[i].v[n] : null;
|
|
1142
1144
|
}
|
|
1143
|
-
return t(this,
|
|
1145
|
+
return t(this, Q).call(this, s[i]);
|
|
1144
1146
|
}, "get"));
|
|
1145
|
-
g(this, T, i), g(this, v, e), t(this,
|
|
1147
|
+
g(this, T, i), g(this, v, e), t(this, Ct).call(this);
|
|
1146
1148
|
}
|
|
1147
1149
|
get source() {
|
|
1148
|
-
return t(this,
|
|
1150
|
+
return t(this, Q).call(this, t(this, v).rawRecords);
|
|
1149
1151
|
}
|
|
1150
1152
|
set source(i) {
|
|
1151
1153
|
this.clear(), this.add(i, !1);
|
|
1152
1154
|
}
|
|
1153
1155
|
get nextId() {
|
|
1154
|
-
return ++
|
|
1156
|
+
return ++oe(this, Ht)._;
|
|
1155
1157
|
}
|
|
1156
1158
|
get length() {
|
|
1157
1159
|
return t(this, A).length;
|
|
@@ -1160,7 +1162,7 @@ const L = class L {
|
|
|
1160
1162
|
return this.length;
|
|
1161
1163
|
}
|
|
1162
1164
|
};
|
|
1163
|
-
T = new WeakMap(), v = new WeakMap(), A = new WeakMap(),
|
|
1165
|
+
T = new WeakMap(), v = new WeakMap(), A = new WeakMap(), J = new WeakMap(), Ht = new WeakMap(), z = new WeakMap(), Ct = new WeakMap(), ht = new WeakMap(), _t = new WeakMap(), Mt = new WeakMap(), Q = new WeakMap(), c(L, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1164
1166
|
w(L, "ROW_STATE", {
|
|
1165
1167
|
EMPTY: "EMPTY",
|
|
1166
1168
|
NORMAL: "NORMAL",
|
|
@@ -1168,10 +1170,10 @@ w(L, "ROW_STATE", {
|
|
|
1168
1170
|
UPDATE: "UPDATE",
|
|
1169
1171
|
DELETE: "DELETE"
|
|
1170
1172
|
});
|
|
1171
|
-
let
|
|
1172
|
-
const
|
|
1173
|
+
let Yt = L;
|
|
1174
|
+
const Qt = class Qt {
|
|
1173
1175
|
constructor(i) {
|
|
1174
|
-
this.owner = i, this.row = new
|
|
1176
|
+
this.owner = i, this.row = new Pt(this), this.data = new Yt(i, this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1175
1177
|
var e;
|
|
1176
1178
|
(e = this.owner.view) != null && e.redraw && this.owner.view.redraw();
|
|
1177
1179
|
}, this.setDataSource = (e) => {
|
|
@@ -1188,37 +1190,37 @@ const Jt = class Jt {
|
|
|
1188
1190
|
}, this.setDataSource([]);
|
|
1189
1191
|
}
|
|
1190
1192
|
};
|
|
1191
|
-
c(
|
|
1192
|
-
let
|
|
1193
|
-
var
|
|
1194
|
-
const
|
|
1193
|
+
c(Qt, "ngDataManager");
|
|
1194
|
+
let Vt = Qt;
|
|
1195
|
+
var U, It;
|
|
1196
|
+
const te = class te extends HTMLElement {
|
|
1195
1197
|
constructor() {
|
|
1196
1198
|
super();
|
|
1197
1199
|
//#created = false;
|
|
1198
|
-
h(this,
|
|
1199
|
-
h(this,
|
|
1200
|
-
this.attachShadow({ mode: "open" }), g(this,
|
|
1200
|
+
h(this, U);
|
|
1201
|
+
h(this, It);
|
|
1202
|
+
this.attachShadow({ mode: "open" }), g(this, U, new Vt(this));
|
|
1201
1203
|
}
|
|
1202
1204
|
connectedCallback() {
|
|
1203
|
-
g(this,
|
|
1205
|
+
g(this, It, new Bt(this)), tt.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1204
1206
|
}
|
|
1205
1207
|
disconnectedCallback() {
|
|
1206
|
-
|
|
1208
|
+
tt.log("NineTable disconnected.");
|
|
1207
1209
|
}
|
|
1208
1210
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1209
1211
|
get data() {
|
|
1210
|
-
return t(this,
|
|
1212
|
+
return t(this, U).data;
|
|
1211
1213
|
}
|
|
1212
1214
|
// π― ν(row) κ΄λ ¨ μ μ΄ μ κ·Όμ μ€ν
|
|
1213
1215
|
get row() {
|
|
1214
|
-
return t(this,
|
|
1216
|
+
return t(this, U).row;
|
|
1215
1217
|
}
|
|
1216
1218
|
// π― μ 체 λ°μ΄ν° λ§€λμ μ κ·Ό νμν κ²½μ°
|
|
1217
1219
|
get dataManager() {
|
|
1218
|
-
return t(this,
|
|
1220
|
+
return t(this, U);
|
|
1219
1221
|
}
|
|
1220
1222
|
};
|
|
1221
|
-
|
|
1222
|
-
let
|
|
1223
|
-
customElements.get("nine-table") || customElements.define("nine-table",
|
|
1223
|
+
U = new WeakMap(), It = new WeakMap(), c(te, "NineTable");
|
|
1224
|
+
let Xt = te;
|
|
1225
|
+
customElements.get("nine-table") || customElements.define("nine-table", Xt);
|
|
1224
1226
|
//# sourceMappingURL=nine-table.js.map
|