@ninebone/table 0.0.336 β 0.0.337
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 +87 -87
- 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,13 +22,13 @@ const Kt = class Kt extends ce.constructor {
|
|
|
22
22
|
};
|
|
23
23
|
c(Kt, "Trace");
|
|
24
24
|
let zt = Kt;
|
|
25
|
-
const
|
|
26
|
-
var C,
|
|
25
|
+
const _ = new zt();
|
|
26
|
+
var C, I, y, O, D, N, bt, B, gt;
|
|
27
27
|
const jt = class jt extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
a(this, C);
|
|
31
|
-
a(this,
|
|
31
|
+
a(this, I, !1);
|
|
32
32
|
a(this, y);
|
|
33
33
|
a(this, O);
|
|
34
34
|
a(this, D);
|
|
@@ -41,7 +41,7 @@ const jt = class jt extends HTMLElement {
|
|
|
41
41
|
})), t(this, N).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
x(this, "refresh", /* @__PURE__ */ c(() => {
|
|
44
|
-
if (!t(this, C) || !t(this, y) || t(this,
|
|
44
|
+
if (!t(this, C) || !t(this, y) || t(this, I)) return;
|
|
45
45
|
const e = t(this, y).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
47
|
const n = t(this, y).track, r = t(this, y).thumb, o = t(this, C).querySelector(".ng-container-bottom"), l = e.clientWidth, h = s.scrollWidth;
|
|
@@ -59,7 +59,7 @@ const jt = class jt extends HTMLElement {
|
|
|
59
59
|
let p = 0;
|
|
60
60
|
b > 0 && (p = parseInt(u / b * (d - f), 10)), p < 0 && (p = 0);
|
|
61
61
|
const E = d - f;
|
|
62
|
-
p > E && (p = E), r.style.left = `${p}px`,
|
|
62
|
+
p > E && (p = E), r.style.left = `${p}px`, _.log(p), t(this, y).left.disabled = p === 0, t(this, y).right.disabled = p >= E - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
64
|
a(this, B, /* @__PURE__ */ c((e) => {
|
|
65
65
|
if (!t(this, y)) return !1;
|
|
@@ -99,13 +99,13 @@ const jt = class jt extends HTMLElement {
|
|
|
99
99
|
t(this, B).call(this, n.clientX - r.left - o / 2);
|
|
100
100
|
}), t(this, y).thumb.addEventListener("mousedown", (n) => {
|
|
101
101
|
if (n.button !== 0) return;
|
|
102
|
-
n.stopPropagation(), n.preventDefault(), g(this,
|
|
102
|
+
n.stopPropagation(), n.preventDefault(), g(this, I, !0), this.shiftX = n.clientX - t(this, y).thumb.getBoundingClientRect().left;
|
|
103
103
|
const r = /* @__PURE__ */ c((l) => {
|
|
104
|
-
if (!t(this,
|
|
104
|
+
if (!t(this, I)) return;
|
|
105
105
|
const h = t(this, y).track.getBoundingClientRect();
|
|
106
106
|
t(this, B).call(this, l.clientX - h.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), o = /* @__PURE__ */ c(() => {
|
|
108
|
-
g(this,
|
|
108
|
+
g(this, I, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
110
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", o);
|
|
111
111
|
});
|
|
@@ -189,7 +189,7 @@ const jt = class jt extends HTMLElement {
|
|
|
189
189
|
left: this.querySelector(".ng-scroll-left"),
|
|
190
190
|
right: this.querySelector(".ng-scroll-right")
|
|
191
191
|
}), s.addEventListener("scroll", () => {
|
|
192
|
-
t(this,
|
|
192
|
+
t(this, I) || this.refresh();
|
|
193
193
|
}), t(this, gt).call(this), t(this, bt).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
195
195
|
e();
|
|
@@ -198,15 +198,15 @@ const jt = class jt extends HTMLElement {
|
|
|
198
198
|
t(this, N) && t(this, N).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
C = new WeakMap(),
|
|
201
|
+
C = new WeakMap(), I = new WeakMap(), y = new WeakMap(), O = new WeakMap(), D = new WeakMap(), N = new WeakMap(), bt = new WeakMap(), B = new WeakMap(), gt = new WeakMap(), c(jt, "NineTableHScrollBar");
|
|
202
202
|
let Ot = jt;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Ot);
|
|
204
|
-
var P,
|
|
204
|
+
var P, $, v, st, nt, yt;
|
|
205
205
|
const Zt = class Zt extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
208
|
a(this, P);
|
|
209
|
-
a(this,
|
|
209
|
+
a(this, $, !1);
|
|
210
210
|
a(this, v);
|
|
211
211
|
a(this, st, 0);
|
|
212
212
|
a(this, nt, 0);
|
|
@@ -214,7 +214,7 @@ const Zt = class Zt extends HTMLElement {
|
|
|
214
214
|
* π― μ€ν¬λ‘€λ° μμΉ λ° μΈλΈ ν¬κΈ° κ°±μ
|
|
215
215
|
*/
|
|
216
216
|
x(this, "refresh", /* @__PURE__ */ c(() => {
|
|
217
|
-
if (!t(this, P) || !t(this, v) || t(this,
|
|
217
|
+
if (!t(this, P) || !t(this, v) || t(this, $)) return;
|
|
218
218
|
const e = t(this, v).container, s = e.querySelector("table");
|
|
219
219
|
if (!s) return;
|
|
220
220
|
const n = t(this, v).track, r = t(this, v).thumb, o = e.clientHeight, l = s.scrollHeight;
|
|
@@ -236,14 +236,14 @@ const Zt = class Zt extends HTMLElement {
|
|
|
236
236
|
a(this, yt, /* @__PURE__ */ c(() => {
|
|
237
237
|
const e = t(this, v).container;
|
|
238
238
|
e.addEventListener("scroll", () => {
|
|
239
|
-
t(this,
|
|
239
|
+
t(this, $) || this.refresh();
|
|
240
240
|
}), t(this, v).thumb.addEventListener("mousedown", (s) => {
|
|
241
241
|
if (s.button !== 0) return;
|
|
242
|
-
s.stopPropagation(), s.preventDefault(), g(this,
|
|
242
|
+
s.stopPropagation(), s.preventDefault(), g(this, $, !0), g(this, st, s.clientY), g(this, nt, e.scrollTop);
|
|
243
243
|
const n = /* @__PURE__ */ c((o) => {
|
|
244
|
-
if (!t(this,
|
|
244
|
+
if (!t(this, $)) return;
|
|
245
245
|
const l = t(this, v).track.getBoundingClientRect(), h = t(this, v).thumb.clientHeight, f = l.height - h, u = o.clientY - t(this, st), b = e.clientHeight, p = e.querySelector("table");
|
|
246
|
-
|
|
246
|
+
_.log(p), _.log(p.scrollHeight);
|
|
247
247
|
const L = p.scrollHeight - b;
|
|
248
248
|
if (f > 0 && L > 0) {
|
|
249
249
|
const ft = u / f * L;
|
|
@@ -251,7 +251,7 @@ const Zt = class Zt extends HTMLElement {
|
|
|
251
251
|
}
|
|
252
252
|
this.refresh();
|
|
253
253
|
}, "onMouseMove"), r = /* @__PURE__ */ c(() => {
|
|
254
|
-
g(this,
|
|
254
|
+
g(this, $, !1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", r), this.refresh();
|
|
255
255
|
}, "onMouseUp");
|
|
256
256
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", r);
|
|
257
257
|
}), t(this, v).track.addEventListener("mousedown", (s) => {
|
|
@@ -351,10 +351,10 @@ const Zt = class Zt extends HTMLElement {
|
|
|
351
351
|
e();
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
|
-
P = new WeakMap(),
|
|
354
|
+
P = new WeakMap(), $ = new WeakMap(), v = new WeakMap(), st = new WeakMap(), nt = new WeakMap(), yt = new WeakMap(), c(Zt, "NineTableVScrollBar");
|
|
355
355
|
let Dt = Zt;
|
|
356
356
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Dt);
|
|
357
|
-
var pt,
|
|
357
|
+
var pt, Z;
|
|
358
358
|
const H = class H {
|
|
359
359
|
/**
|
|
360
360
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
@@ -369,7 +369,7 @@ const H = class H {
|
|
|
369
369
|
var n, r, o, l;
|
|
370
370
|
if (!i) return null;
|
|
371
371
|
const e = i.cloneNode(!0);
|
|
372
|
-
return t(n = H, pt).call(n, e), t(r = H,
|
|
372
|
+
return t(n = H, pt).call(n, e), t(r = H, Z).call(r, e, "thead"), t(o = H, Z).call(o, e, "tbody"), t(l = H, Z).call(l, e, "tfoot"), Array.from(e.querySelectorAll("colgroup col")).forEach((h, d) => {
|
|
373
373
|
const f = h.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
|
-
pt = new WeakMap(),
|
|
380
|
+
pt = new WeakMap(), Z = new WeakMap(), c(H, "TableCompiler"), a(H, pt, /* @__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, n = document.createElement("colgroup"), r = Math.max(Math.floor(i.clientWidth / s), 100);
|
|
383
383
|
for (let o = 0; o < s; o++) {
|
|
@@ -391,7 +391,7 @@ pt = new WeakMap(), j = new WeakMap(), c(H, "TableCompiler"), a(H, pt, /* @__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")), a(H,
|
|
394
|
+
}, "#ensureTableStructure")), a(H, Z, /* @__PURE__ */ c((i, e) => {
|
|
395
395
|
const s = Array.from(i.querySelectorAll(e + " tr")), n = Array.from(i.querySelectorAll(e + " th," + e + " td")), r = s.length;
|
|
396
396
|
if (r === 0 || n.length === 0) return;
|
|
397
397
|
let o = 0;
|
|
@@ -425,23 +425,23 @@ pt = new WeakMap(), j = new WeakMap(), c(H, "TableCompiler"), a(H, pt, /* @__PUR
|
|
|
425
425
|
});
|
|
426
426
|
}, "#resetColIndex"));
|
|
427
427
|
let Nt = H;
|
|
428
|
-
var Y, w,
|
|
428
|
+
var Y, w, M, R, W, V, G, mt, xt, ot, rt, vt, wt, lt, J, St;
|
|
429
429
|
const Gt = class Gt {
|
|
430
430
|
constructor(i) {
|
|
431
431
|
a(this, Y);
|
|
432
432
|
a(this, w);
|
|
433
|
-
a(this,
|
|
433
|
+
a(this, M, /* @__PURE__ */ new Map());
|
|
434
434
|
a(this, R, null);
|
|
435
|
-
a(this,
|
|
435
|
+
a(this, W, null);
|
|
436
436
|
a(this, V, 0);
|
|
437
|
-
a(this,
|
|
437
|
+
a(this, G, 40);
|
|
438
438
|
x(this, "refresh", /* @__PURE__ */ c(() => {
|
|
439
439
|
var e;
|
|
440
440
|
const i = t(this, w).querySelector(".ng-container-body");
|
|
441
|
-
i && (t(this, ot).call(this), t(this,
|
|
441
|
+
i && (t(this, ot).call(this), t(this, J).call(this, i.scrollTop), (e = t(this, w).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
442
442
|
}, "refresh"));
|
|
443
443
|
x(this, "initialize", /* @__PURE__ */ c(() => {
|
|
444
|
-
g(this, R, null), t(this,
|
|
444
|
+
g(this, R, null), t(this, M).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
445
445
|
const r = t(this, w).querySelector(n);
|
|
446
446
|
if (!r) return;
|
|
447
447
|
const o = r.querySelector("table");
|
|
@@ -449,15 +449,15 @@ const Gt = class Gt {
|
|
|
449
449
|
const l = o.querySelector("tbody.bindable-tbody");
|
|
450
450
|
if (!l) return;
|
|
451
451
|
const d = Array.from(l.querySelectorAll("tr")).map((f) => f.cloneNode(!0));
|
|
452
|
-
t(this,
|
|
452
|
+
t(this, M).set(n, d);
|
|
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, xt).call(this, i), t(this, lt).call(this), t(this, ot).call(this), t(this,
|
|
456
|
+
t(this, xt).call(this, i), t(this, lt).call(this), t(this, ot).call(this), t(this, J).call(this, i.scrollTop);
|
|
457
457
|
let n = i.scrollTop;
|
|
458
458
|
const r = /* @__PURE__ */ c((o) => {
|
|
459
459
|
var l;
|
|
460
|
-
e && e.scrollTop !== o && (e.scrollTop = o), s && s.scrollTop !== o && (s.scrollTop = o), t(this,
|
|
460
|
+
e && e.scrollTop !== o && (e.scrollTop = o), s && s.scrollTop !== o && (s.scrollTop = o), t(this, J).call(this, o), (l = t(this, w).querySelector("nine-table-vscrollbar")) == null || l.refresh();
|
|
461
461
|
}, "syncScroll");
|
|
462
462
|
i.addEventListener("scroll", () => {
|
|
463
463
|
const o = i.scrollTop;
|
|
@@ -466,13 +466,13 @@ const Gt = class Gt {
|
|
|
466
466
|
}
|
|
467
467
|
}, "initialize"));
|
|
468
468
|
a(this, mt, /* @__PURE__ */ c((i, e) => {
|
|
469
|
-
const s = t(this,
|
|
469
|
+
const s = t(this, M).get(e);
|
|
470
470
|
if (!s || s.length === 0) return;
|
|
471
471
|
const n = i.querySelector("tbody.bindable-tbody");
|
|
472
472
|
if (!n) return;
|
|
473
473
|
n.querySelectorAll("tr:not(.nodata)").forEach((l) => l.remove());
|
|
474
474
|
const r = n.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
475
|
-
for (let l = 0; l < t(this,
|
|
475
|
+
for (let l = 0; l < t(this, G); l++)
|
|
476
476
|
s.forEach((h) => {
|
|
477
477
|
o.appendChild(h.cloneNode(!0));
|
|
478
478
|
});
|
|
@@ -481,7 +481,7 @@ const Gt = class Gt {
|
|
|
481
481
|
a(this, xt, /* @__PURE__ */ c((i) => {
|
|
482
482
|
if (t(this, R) !== null && t(this, R) > 0)
|
|
483
483
|
return t(this, R);
|
|
484
|
-
const e = t(this,
|
|
484
|
+
const e = t(this, M).get(".ng-container-body");
|
|
485
485
|
if (!e || e.length === 0) return 24;
|
|
486
486
|
const s = i.querySelector("tbody.bindable-tbody") || i.querySelector("tbody.bindable-tbody:last-of-type");
|
|
487
487
|
if (!s) return 24;
|
|
@@ -509,9 +509,9 @@ const Gt = class Gt {
|
|
|
509
509
|
a(this, rt, /* @__PURE__ */ c(() => {
|
|
510
510
|
if (t(this, V) > 0 && t(this, R) > 0) {
|
|
511
511
|
const i = Math.ceil(t(this, V) / t(this, R));
|
|
512
|
-
g(this,
|
|
512
|
+
g(this, G, i + 20);
|
|
513
513
|
} else
|
|
514
|
-
g(this,
|
|
514
|
+
g(this, G, 40);
|
|
515
515
|
}, "#updateRowCount"));
|
|
516
516
|
a(this, vt, /* @__PURE__ */ c(() => {
|
|
517
517
|
var h, d, f;
|
|
@@ -528,7 +528,7 @@ const Gt = class Gt {
|
|
|
528
528
|
}
|
|
529
529
|
}, "#syncRowHeights"));
|
|
530
530
|
a(this, wt, /* @__PURE__ */ c(() => {
|
|
531
|
-
!t(this, w) || !(t(this, w) instanceof HTMLElement) || (g(this,
|
|
531
|
+
!t(this, w) || !(t(this, w) instanceof HTMLElement) || (g(this, W, new ResizeObserver((i) => {
|
|
532
532
|
for (const e of i) {
|
|
533
533
|
const s = e.target;
|
|
534
534
|
if (!s.classList.contains("active")) continue;
|
|
@@ -541,7 +541,7 @@ const Gt = class Gt {
|
|
|
541
541
|
t(this, V) !== l && (g(this, V, l), t(this, rt).call(this), t(this, R) !== null && t(this, lt).call(this));
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
|
-
})), t(this,
|
|
544
|
+
})), t(this, W).observe(t(this, w)));
|
|
545
545
|
}, "#initResizeObserver"));
|
|
546
546
|
a(this, lt, /* @__PURE__ */ c(() => {
|
|
547
547
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
@@ -549,11 +549,11 @@ const Gt = class Gt {
|
|
|
549
549
|
e && e.querySelector("tbody.bindable-tbody") && t(this, mt).call(this, e, i);
|
|
550
550
|
}), t(this, vt).call(this);
|
|
551
551
|
}, "#renderAllContainers"));
|
|
552
|
-
a(this,
|
|
552
|
+
a(this, J, /* @__PURE__ */ c((i) => {
|
|
553
553
|
var r;
|
|
554
554
|
const e = t(this, R);
|
|
555
555
|
if (!e || e <= 0) return;
|
|
556
|
-
const s = Math.max(0, Math.floor(i / e)), n = ((r = t(this,
|
|
556
|
+
const s = Math.max(0, Math.floor(i / e)), n = ((r = t(this, M).get(".ng-container-body")) == null ? void 0 : r.length) || 1;
|
|
557
557
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
558
558
|
const l = t(this, w).querySelector(o);
|
|
559
559
|
if (!l) return;
|
|
@@ -561,18 +561,18 @@ const Gt = class Gt {
|
|
|
561
561
|
if (!h) return;
|
|
562
562
|
Array.from(h.querySelectorAll("tr:not(.nodata)")).forEach((f, u) => {
|
|
563
563
|
const b = s + Math.floor(u / n), p = t(this, Y).data.get(b);
|
|
564
|
-
|
|
564
|
+
_.log("--", t(this, Y).data.get(0)), f.style.display = "", t(this, St).call(this, f, p, b);
|
|
565
565
|
});
|
|
566
566
|
});
|
|
567
567
|
}, "#handleScroll"));
|
|
568
568
|
a(this, St, /* @__PURE__ */ c((i, e, s) => {
|
|
569
|
-
i.dataset.row = s,
|
|
569
|
+
i.dataset.row = s, _.log(i, e, s), Array.from(i.cells).forEach((n, r) => {
|
|
570
570
|
const o = n.dataset.bind;
|
|
571
571
|
o && e && e[o] !== void 0 ? n.textContent = e[o] : n.textContent = e ? e[Object.keys(e)[r]] ?? `R${s}C${r}` : `ν ${s + 1}`, n.dataset.row = s;
|
|
572
572
|
});
|
|
573
573
|
}, "#bindRowData"));
|
|
574
574
|
x(this, "destroy", /* @__PURE__ */ c(() => {
|
|
575
|
-
t(this,
|
|
575
|
+
t(this, W) && (t(this, W).disconnect(), g(this, W, null));
|
|
576
576
|
}, "destroy"));
|
|
577
577
|
g(this, Y, i.getRootNode().host), g(this, w, i), t(this, wt).call(this);
|
|
578
578
|
}
|
|
@@ -581,17 +581,17 @@ const Gt = class Gt {
|
|
|
581
581
|
}
|
|
582
582
|
templateLength(i = ".ng-container-body") {
|
|
583
583
|
var e;
|
|
584
|
-
return ((e = t(this,
|
|
584
|
+
return ((e = t(this, M).get(i)) == null ? void 0 : e.length) || 1;
|
|
585
585
|
}
|
|
586
586
|
};
|
|
587
|
-
Y = new WeakMap(), w = new WeakMap(),
|
|
587
|
+
Y = new WeakMap(), w = new WeakMap(), M = new WeakMap(), R = new WeakMap(), W = new WeakMap(), V = new WeakMap(), G = new WeakMap(), mt = new WeakMap(), xt = new WeakMap(), ot = new WeakMap(), rt = new WeakMap(), vt = new WeakMap(), wt = new WeakMap(), lt = new WeakMap(), J = new WeakMap(), St = new WeakMap(), c(Gt, "RowManager");
|
|
588
588
|
let Bt = Gt;
|
|
589
|
-
var Et,
|
|
589
|
+
var Et, Q, X, Rt, kt, qt, At, Tt;
|
|
590
590
|
const it = class it extends HTMLElement {
|
|
591
591
|
constructor() {
|
|
592
592
|
super();
|
|
593
593
|
a(this, Et);
|
|
594
|
-
a(this,
|
|
594
|
+
a(this, Q, null);
|
|
595
595
|
a(this, X);
|
|
596
596
|
/**
|
|
597
597
|
* data.set, add, delete
|
|
@@ -608,7 +608,7 @@ const it = class it extends HTMLElement {
|
|
|
608
608
|
].forEach(({ selector: s, type: n }) => {
|
|
609
609
|
const r = this.querySelector(s);
|
|
610
610
|
if (!r) return;
|
|
611
|
-
const o = t(this, qt).call(this, t(this,
|
|
611
|
+
const o = t(this, qt).call(this, t(this, Q), n);
|
|
612
612
|
r.innerHTML = "", r.appendChild(o);
|
|
613
613
|
});
|
|
614
614
|
}, "#renderSplitContainers"));
|
|
@@ -624,7 +624,7 @@ const it = class it extends HTMLElement {
|
|
|
624
624
|
});
|
|
625
625
|
}, "#updateContainerWidths"));
|
|
626
626
|
x(this, "generate", /* @__PURE__ */ c((e) => {
|
|
627
|
-
e && (g(this,
|
|
627
|
+
e && (g(this, Q, Nt.compile(e)), t(this, Q).style.display = "table", t(this, Rt).call(this), t(this, kt).call(this), requestAnimationFrame(() => {
|
|
628
628
|
var n;
|
|
629
629
|
const s = (n = this.querySelector("thead")) == null ? void 0 : n.getBoundingClientRect().height;
|
|
630
630
|
this.querySelectorAll("tbody.fixed-tbody").forEach((r) => {
|
|
@@ -817,10 +817,10 @@ const it = class it extends HTMLElement {
|
|
|
817
817
|
t(this, At).call(this);
|
|
818
818
|
}
|
|
819
819
|
disconnectedCallback() {
|
|
820
|
-
this.innerHTML = "",
|
|
820
|
+
this.innerHTML = "", _.log("NineTableSheet destroyed.");
|
|
821
821
|
}
|
|
822
822
|
};
|
|
823
|
-
Et = new WeakMap(),
|
|
823
|
+
Et = new WeakMap(), Q = new WeakMap(), X = new WeakMap(), Rt = new WeakMap(), kt = new WeakMap(), qt = new WeakMap(), At = new WeakMap(), Tt = new WeakMap(), c(it, "NineTableSheet"), x(it, "SCROLLBAR_SIZE", 16);
|
|
824
824
|
let ut = it;
|
|
825
825
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", ut);
|
|
826
826
|
var Lt, ct;
|
|
@@ -1007,41 +1007,41 @@ const Qt = class Qt {
|
|
|
1007
1007
|
};
|
|
1008
1008
|
k = new WeakMap(), Ht = new WeakMap(), at = new WeakMap(), Ct = new WeakMap(), c(Qt, "LayoutManager");
|
|
1009
1009
|
let Yt = Qt;
|
|
1010
|
-
var ht,
|
|
1010
|
+
var ht, tt;
|
|
1011
1011
|
const te = class te {
|
|
1012
1012
|
constructor(i) {
|
|
1013
1013
|
a(this, ht);
|
|
1014
|
-
a(this,
|
|
1014
|
+
a(this, tt, -1);
|
|
1015
1015
|
x(this, "count", /* @__PURE__ */ c(() => t(this, ht).rawRecords.length, "count"));
|
|
1016
1016
|
g(this, ht, i);
|
|
1017
1017
|
}
|
|
1018
1018
|
get at() {
|
|
1019
|
-
return t(this,
|
|
1019
|
+
return t(this, tt);
|
|
1020
1020
|
}
|
|
1021
1021
|
set at(i) {
|
|
1022
|
-
g(this,
|
|
1022
|
+
g(this, tt, parseInt(i, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, tt)}"]`) && setTimeout(() => {
|
|
1023
1023
|
});
|
|
1024
1024
|
}
|
|
1025
1025
|
};
|
|
1026
|
-
ht = new WeakMap(),
|
|
1026
|
+
ht = new WeakMap(), tt = new WeakMap(), c(te, "ngRow");
|
|
1027
1027
|
let Vt = te;
|
|
1028
|
-
var q, S, A,
|
|
1028
|
+
var q, S, A, et, _t, z, Mt, U, dt, It, $t, F;
|
|
1029
1029
|
const T = class T {
|
|
1030
1030
|
constructor(i, e) {
|
|
1031
1031
|
a(this, q);
|
|
1032
1032
|
a(this, S);
|
|
1033
1033
|
a(this, A, []);
|
|
1034
|
-
a(this,
|
|
1034
|
+
a(this, et, []);
|
|
1035
1035
|
a(this, _t, 0);
|
|
1036
|
-
a(this,
|
|
1036
|
+
a(this, z, []);
|
|
1037
1037
|
a(this, Mt, /* @__PURE__ */ c(() => {
|
|
1038
|
-
g(this,
|
|
1038
|
+
g(this, z, []);
|
|
1039
1039
|
const i = t(this, q).template || [];
|
|
1040
1040
|
Array.from(i).forEach((e) => {
|
|
1041
1041
|
var s;
|
|
1042
|
-
t(this,
|
|
1042
|
+
t(this, z).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1043
1043
|
}), (t(this, S).rawRecords || []).forEach((e) => {
|
|
1044
|
-
e.__ng || (e.__ng = t(this, dt).call(this)), e.__ng.height = t(this,
|
|
1044
|
+
e.__ng || (e.__ng = t(this, dt).call(this)), e.__ng.height = t(this, z).slice();
|
|
1045
1045
|
});
|
|
1046
1046
|
}, "#initialize"));
|
|
1047
1047
|
a(this, U, /* @__PURE__ */ c(() => {
|
|
@@ -1053,14 +1053,14 @@ const T = class T {
|
|
|
1053
1053
|
var r;
|
|
1054
1054
|
const s = this.getValidData();
|
|
1055
1055
|
if (!s || s.length <= 0) return;
|
|
1056
|
-
if (i == null) return t(this,
|
|
1056
|
+
if (i == null) return t(this, F).call(this, s);
|
|
1057
1057
|
if (i < 0 || i >= s.length) return null;
|
|
1058
1058
|
const n = typeof ((r = t(this, q).fields) == null ? void 0 : r.get) == "function" ? t(this, q).fields.get() : [];
|
|
1059
1059
|
if (e != null) {
|
|
1060
1060
|
const o = n.indexOf(e);
|
|
1061
1061
|
return o >= 0 ? s[i].v[o] : null;
|
|
1062
1062
|
}
|
|
1063
|
-
return t(this,
|
|
1063
|
+
return _.log(s[i]), _.log(t(this, F).call(this, s[i])), t(this, F).call(this, s[i]);
|
|
1064
1064
|
}, "get"));
|
|
1065
1065
|
x(this, "set", /* @__PURE__ */ c((i) => {
|
|
1066
1066
|
this.clear(), this.add(i, !1), t(this, U).call(this);
|
|
@@ -1069,17 +1069,17 @@ const T = class T {
|
|
|
1069
1069
|
rowState: T.ROW_STATE.EMPTY,
|
|
1070
1070
|
deleted: !1,
|
|
1071
1071
|
filtered: !1,
|
|
1072
|
-
height: t(this,
|
|
1072
|
+
height: t(this, z).slice(),
|
|
1073
1073
|
o: {},
|
|
1074
1074
|
c: {},
|
|
1075
|
-
_: [0, 0, 0, 0, T.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this,
|
|
1075
|
+
_: [0, 0, 0, 0, T.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, z).slice(), -1, {}, {}]
|
|
1076
1076
|
}), "#getDefaultMeta"));
|
|
1077
1077
|
x(this, "reset", /* @__PURE__ */ c(() => {
|
|
1078
|
-
g(this, A, []), g(this,
|
|
1078
|
+
g(this, A, []), g(this, et, []), t(this, U).call(this);
|
|
1079
1079
|
}, "reset"));
|
|
1080
1080
|
x(this, "clear", /* @__PURE__ */ c(() => {
|
|
1081
1081
|
var i;
|
|
1082
|
-
t(this, S).rawRecords = [], g(this, A, []), g(this,
|
|
1082
|
+
t(this, S).rawRecords = [], g(this, A, []), g(this, et, []), (i = t(this, S).viewRecords) != null && i.reset && t(this, S).viewRecords.reset();
|
|
1083
1083
|
}, "clear"));
|
|
1084
1084
|
a(this, It, /* @__PURE__ */ c((i) => {
|
|
1085
1085
|
var n;
|
|
@@ -1127,14 +1127,14 @@ const T = class T {
|
|
|
1127
1127
|
l !== s && o.__ng.rowState !== T.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = l), o.__ng.rowState = T.ROW_STATE.UPDATE), o.v[r] = s;
|
|
1128
1128
|
}, "setValue"));
|
|
1129
1129
|
x(this, "resetRecords", /* @__PURE__ */ c(() => {
|
|
1130
|
-
g(this,
|
|
1130
|
+
g(this, et, t(this, S).rawRecords.filter((i) => !i.__ng.deleted)), g(this, A, t(this, S).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, S).rawRecords.forEach((i, e) => {
|
|
1131
1131
|
i.__ng.rowidx = e;
|
|
1132
1132
|
}), t(this, A).forEach((i, e) => {
|
|
1133
1133
|
i.__ng.i = e;
|
|
1134
1134
|
});
|
|
1135
1135
|
}, "resetRecords"));
|
|
1136
1136
|
x(this, "getValidData", /* @__PURE__ */ c(() => (t(this, A).length === 0 && t(this, S).rawRecords.length > 0 && this.resetRecords(), t(this, A)), "getValidData"));
|
|
1137
|
-
a(this,
|
|
1137
|
+
a(this, F, /* @__PURE__ */ c((i) => {
|
|
1138
1138
|
var s;
|
|
1139
1139
|
if (!i) return i;
|
|
1140
1140
|
const e = typeof ((s = t(this, q).fields) == null ? void 0 : s.get) == "function" ? t(this, q).fields.get() : [];
|
|
@@ -1149,7 +1149,7 @@ const T = class T {
|
|
|
1149
1149
|
g(this, q, i), g(this, S, e), t(this, Mt).call(this);
|
|
1150
1150
|
}
|
|
1151
1151
|
get source() {
|
|
1152
|
-
return t(this,
|
|
1152
|
+
return t(this, F).call(this, t(this, S).rawRecords);
|
|
1153
1153
|
}
|
|
1154
1154
|
set source(i) {
|
|
1155
1155
|
this.clear(), this.add(i, !1);
|
|
@@ -1164,7 +1164,7 @@ const T = class T {
|
|
|
1164
1164
|
return this.length;
|
|
1165
1165
|
}
|
|
1166
1166
|
};
|
|
1167
|
-
q = new WeakMap(), S = new WeakMap(), A = new WeakMap(),
|
|
1167
|
+
q = new WeakMap(), S = new WeakMap(), A = new WeakMap(), et = new WeakMap(), _t = new WeakMap(), z = new WeakMap(), Mt = new WeakMap(), U = new WeakMap(), dt = new WeakMap(), It = new WeakMap(), $t = new WeakMap(), F = new WeakMap(), c(T, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1168
1168
|
x(T, "ROW_STATE", {
|
|
1169
1169
|
EMPTY: "EMPTY",
|
|
1170
1170
|
NORMAL: "NORMAL",
|
|
@@ -1173,13 +1173,13 @@ x(T, "ROW_STATE", {
|
|
|
1173
1173
|
DELETE: "DELETE"
|
|
1174
1174
|
});
|
|
1175
1175
|
let Xt = T;
|
|
1176
|
-
var
|
|
1176
|
+
var K;
|
|
1177
1177
|
const ee = class ee {
|
|
1178
1178
|
constructor(i) {
|
|
1179
|
-
a(this,
|
|
1180
|
-
g(this,
|
|
1179
|
+
a(this, K);
|
|
1180
|
+
g(this, K, i), this.row = new Vt(this), this.data = new Xt(t(this, K), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1181
1181
|
var e;
|
|
1182
|
-
(e = t(this,
|
|
1182
|
+
(e = t(this, K).view) != null && e.redraw && t(this, K).view.redraw();
|
|
1183
1183
|
}, this.setDataSource = (e) => {
|
|
1184
1184
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1185
1185
|
}, this.getRowState = (e) => {
|
|
@@ -1194,37 +1194,37 @@ const ee = class ee {
|
|
|
1194
1194
|
}, this.setDataSource([]);
|
|
1195
1195
|
}
|
|
1196
1196
|
};
|
|
1197
|
-
|
|
1197
|
+
K = new WeakMap(), c(ee, "ngDataManager");
|
|
1198
1198
|
let Ut = ee;
|
|
1199
|
-
var
|
|
1199
|
+
var j, Wt;
|
|
1200
1200
|
const ie = class ie extends HTMLElement {
|
|
1201
1201
|
constructor() {
|
|
1202
1202
|
super();
|
|
1203
1203
|
//#created = false;
|
|
1204
|
-
a(this,
|
|
1204
|
+
a(this, j);
|
|
1205
1205
|
a(this, Wt);
|
|
1206
|
-
this.attachShadow({ mode: "open" }), g(this,
|
|
1206
|
+
this.attachShadow({ mode: "open" }), g(this, j, new Ut(this));
|
|
1207
1207
|
}
|
|
1208
1208
|
connectedCallback() {
|
|
1209
|
-
g(this, Wt, new Yt(this)),
|
|
1209
|
+
g(this, Wt, new Yt(this)), _.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1210
1210
|
}
|
|
1211
1211
|
disconnectedCallback() {
|
|
1212
|
-
|
|
1212
|
+
_.log("NineTable disconnected.");
|
|
1213
1213
|
}
|
|
1214
1214
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1215
1215
|
get data() {
|
|
1216
|
-
return t(this,
|
|
1216
|
+
return t(this, j).data;
|
|
1217
1217
|
}
|
|
1218
1218
|
// π― ν(row) κ΄λ ¨ μ μ΄ μ κ·Όμ μ€ν
|
|
1219
1219
|
get row() {
|
|
1220
|
-
return t(this,
|
|
1220
|
+
return t(this, j).row;
|
|
1221
1221
|
}
|
|
1222
1222
|
// π― μ 체 λ°μ΄ν° λ§€λμ μ κ·Ό νμν κ²½μ°
|
|
1223
1223
|
get dataManager() {
|
|
1224
|
-
return t(this,
|
|
1224
|
+
return t(this, j);
|
|
1225
1225
|
}
|
|
1226
1226
|
};
|
|
1227
|
-
|
|
1227
|
+
j = new WeakMap(), Wt = new WeakMap(), c(ie, "NineTable");
|
|
1228
1228
|
let Ft = ie;
|
|
1229
1229
|
customElements.get("nine-table") || customElements.define("nine-table", Ft);
|
|
1230
1230
|
//# sourceMappingURL=nine-table.js.map
|