@ninebone/table 0.0.573 β 0.0.574
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 +95 -92
- 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
|
@@ -201,19 +201,19 @@ const Me = class Me extends HTMLElement {
|
|
|
201
201
|
z = new WeakMap(), j = new WeakMap(), w = new WeakMap(), X = new WeakMap(), K = new WeakMap(), Z = new WeakMap(), It = new WeakMap(), G = new WeakMap(), _t = new WeakMap(), h(Me, "NineTableHScrollBar");
|
|
202
202
|
let ae = Me;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ae);
|
|
204
|
-
var F,
|
|
204
|
+
var F, at, J, q, xt, vt, Nt;
|
|
205
205
|
const $e = class $e extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
208
|
d(this, F);
|
|
209
|
-
d(this,
|
|
209
|
+
d(this, at);
|
|
210
210
|
d(this, J, !1);
|
|
211
211
|
d(this, q);
|
|
212
|
-
d(this, mt, 0);
|
|
213
212
|
d(this, xt, 0);
|
|
213
|
+
d(this, vt, 0);
|
|
214
214
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
215
|
if (!t(this, F) || !t(this, q)) return;
|
|
216
|
-
const e = t(this, q).container, s = t(this, q).track, i = t(this, q).thumb, n = e.clientHeight, a = (t(this, F).data.get() || []).length, c = t(this,
|
|
216
|
+
const e = t(this, q).container, s = t(this, q).track, i = t(this, q).thumb, n = e.clientHeight, a = (t(this, F).data.get() || []).length, c = t(this, at).getRowHeight(), l = a * c;
|
|
217
217
|
if (l <= n) {
|
|
218
218
|
i.style.display = "none", t(this, q).top.disabled = !0, t(this, q).bottom.disabled = !0;
|
|
219
219
|
return;
|
|
@@ -232,20 +232,20 @@ const $e = class $e extends HTMLElement {
|
|
|
232
232
|
d(this, Nt, /* @__PURE__ */ h(() => {
|
|
233
233
|
W.log("nine-table-vscrollbar.#init");
|
|
234
234
|
const e = t(this, q).container, s = /* @__PURE__ */ h(() => {
|
|
235
|
-
const n = (t(this, F).data.get() || []).length, o = t(this,
|
|
235
|
+
const n = (t(this, F).data.get() || []).length, o = t(this, at).getRowHeight();
|
|
236
236
|
return n * o;
|
|
237
237
|
}, "getContentHeight");
|
|
238
238
|
e.addEventListener("scroll", () => {
|
|
239
239
|
t(this, J) || this.refresh();
|
|
240
240
|
}), t(this, q).thumb.addEventListener("mousedown", (i) => {
|
|
241
241
|
if (i.button !== 0) return;
|
|
242
|
-
i.stopPropagation(), i.preventDefault(), p(this, J, !0), p(this,
|
|
242
|
+
i.stopPropagation(), i.preventDefault(), p(this, J, !0), p(this, xt, i.clientY), p(this, vt, e.scrollTop);
|
|
243
243
|
const n = /* @__PURE__ */ h((a) => {
|
|
244
244
|
if (!t(this, J)) return;
|
|
245
|
-
const c = t(this, q).track.getBoundingClientRect(), l = t(this, q).thumb.clientHeight, u = c.height - l, g = a.clientY - t(this,
|
|
245
|
+
const c = t(this, q).track.getBoundingClientRect(), l = t(this, q).thumb.clientHeight, u = c.height - l, g = a.clientY - t(this, xt), b = e.clientHeight, m = s(), v = Math.max(m - b, 1);
|
|
246
246
|
if (u > 0 && v > 0) {
|
|
247
247
|
const E = g / u * v;
|
|
248
|
-
let x = t(this,
|
|
248
|
+
let x = t(this, vt) + E;
|
|
249
249
|
const M = Math.max(0, m - b);
|
|
250
250
|
x < 0 && (x = 0), x > M && (x = M), e.scrollTop = x;
|
|
251
251
|
}
|
|
@@ -270,7 +270,7 @@ const $e = class $e extends HTMLElement {
|
|
|
270
270
|
}, "#init"));
|
|
271
271
|
}
|
|
272
272
|
connectedCallback() {
|
|
273
|
-
p(this, F, this.getRootNode().host), p(this,
|
|
273
|
+
p(this, F, this.getRootNode().host), p(this, at, this.closest("nine-table-sheet")), this.innerHTML = `
|
|
274
274
|
<style>
|
|
275
275
|
nine-table-vscrollbar {
|
|
276
276
|
display: flex;
|
|
@@ -351,10 +351,10 @@ const $e = class $e extends HTMLElement {
|
|
|
351
351
|
e();
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
|
-
F = new WeakMap(),
|
|
354
|
+
F = new WeakMap(), at = new WeakMap(), J = new WeakMap(), q = new WeakMap(), xt = new WeakMap(), vt = new WeakMap(), Nt = new WeakMap(), h($e, "NineTableVScrollBar");
|
|
355
355
|
let le = $e;
|
|
356
356
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", le);
|
|
357
|
-
var D, S, Q, P, I, V, tt,
|
|
357
|
+
var D, S, Q, P, I, V, tt, wt, Se, Ee, Wt, Ot, Bt, St, Et, zt, Pt, At, Ae, lt, Rt, Dt;
|
|
358
358
|
const Ie = class Ie {
|
|
359
359
|
constructor(r) {
|
|
360
360
|
d(this, D);
|
|
@@ -364,7 +364,7 @@ const Ie = class Ie {
|
|
|
364
364
|
d(this, I, null);
|
|
365
365
|
d(this, V, null);
|
|
366
366
|
d(this, tt, 0);
|
|
367
|
-
d(this,
|
|
367
|
+
d(this, wt, 40);
|
|
368
368
|
d(this, Se, !1);
|
|
369
369
|
d(this, Ee, !1);
|
|
370
370
|
//#ticking = false; // π― κ³ μ μ€ν¬λ‘€ μ€λ‘νλ§μ© νλκ·Έ
|
|
@@ -373,7 +373,7 @@ const Ie = class Ie {
|
|
|
373
373
|
var e;
|
|
374
374
|
W.log("rowManager.refresh");
|
|
375
375
|
const r = t(this, S).querySelector(".ng-container-body .ng-part-body");
|
|
376
|
-
r && (t(this,
|
|
376
|
+
r && (t(this, St).call(this), t(this, lt).call(this, r.scrollTop), (e = t(this, S).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
377
377
|
}, "refresh"));
|
|
378
378
|
A(this, "initialize", /* @__PURE__ */ h(() => {
|
|
379
379
|
W.log("rowManager.initialize"), p(this, Q, {
|
|
@@ -391,13 +391,13 @@ const Ie = class Ie {
|
|
|
391
391
|
});
|
|
392
392
|
const r = t(this, S).querySelector(".ng-container-body .ng-part-body"), e = t(this, S).querySelector(".ng-container-left .ng-part-body"), s = t(this, S).querySelector(".ng-container-right .ng-part-body"), i = t(this, S).querySelector(".ng-container-body .ng-part-header"), n = t(this, S).querySelector(".ng-container-body .ng-part-footer");
|
|
393
393
|
if (r) {
|
|
394
|
-
t(this, Bt).call(this, r), t(this,
|
|
394
|
+
t(this, Bt).call(this, r), t(this, At).call(this), t(this, St).call(this), t(this, lt).call(this, r.scrollTop);
|
|
395
395
|
let o = !1;
|
|
396
396
|
const a = /* @__PURE__ */ h((c) => {
|
|
397
397
|
if (o) return;
|
|
398
398
|
o = !0;
|
|
399
399
|
const l = c.scrollTop, f = c.scrollLeft;
|
|
400
|
-
r && r.scrollTop !== l && (r.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), i && i.scrollLeft !== f && (i.scrollLeft = f), n && n.scrollLeft !== f && (n.scrollLeft = f), t(this,
|
|
400
|
+
r && r.scrollTop !== l && (r.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), i && i.scrollLeft !== f && (i.scrollLeft = f), n && n.scrollLeft !== f && (n.scrollLeft = f), t(this, lt).call(this, l), o = !1;
|
|
401
401
|
}, "handleContainerScroll");
|
|
402
402
|
[r, e, s].forEach((c) => {
|
|
403
403
|
c && c.addEventListener("scroll", () => {
|
|
@@ -414,7 +414,7 @@ const Ie = class Ie {
|
|
|
414
414
|
if (!i) return;
|
|
415
415
|
i.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
|
|
416
416
|
const n = i.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
417
|
-
for (let a = 0; a < t(this,
|
|
417
|
+
for (let a = 0; a < t(this, wt); a++)
|
|
418
418
|
s.forEach((c) => {
|
|
419
419
|
o.appendChild(c.cloneNode(!0));
|
|
420
420
|
});
|
|
@@ -439,9 +439,9 @@ const Ie = class Ie {
|
|
|
439
439
|
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
440
440
|
return u.forEach((g) => {
|
|
441
441
|
f += g.offsetHeight || g.getBoundingClientRect().height;
|
|
442
|
-
}), u.forEach((g) => g.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l, p(this, I, f > 0 ? f : 24), t(this,
|
|
442
|
+
}), u.forEach((g) => g.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l, p(this, I, f > 0 ? f : 24), t(this, Et).call(this), t(this, I);
|
|
443
443
|
}, "#measureAndCacheHeight"));
|
|
444
|
-
d(this,
|
|
444
|
+
d(this, St, /* @__PURE__ */ h(() => {
|
|
445
445
|
W.log("rowManager.#updateVirtualScrollHeight");
|
|
446
446
|
const e = (t(this, D).data.get() || []).length, s = t(this, I), i = e * s;
|
|
447
447
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
@@ -451,10 +451,10 @@ const Ie = class Ie {
|
|
|
451
451
|
a && (a.style.height = `${i}px`);
|
|
452
452
|
});
|
|
453
453
|
}, "#updateVirtualScrollHeight"));
|
|
454
|
-
d(this,
|
|
454
|
+
d(this, Et, /* @__PURE__ */ h(() => {
|
|
455
455
|
if (t(this, tt) > 0 && t(this, I) > 0) {
|
|
456
456
|
const r = Math.ceil(t(this, tt) / t(this, I));
|
|
457
|
-
p(this,
|
|
457
|
+
p(this, wt, r + t(this, Wt));
|
|
458
458
|
}
|
|
459
459
|
}, "#updateRowCount"));
|
|
460
460
|
d(this, zt, /* @__PURE__ */ h(() => {
|
|
@@ -495,12 +495,12 @@ const Ie = class Ie {
|
|
|
495
495
|
const o = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
|
|
496
496
|
o && (n += o.offsetHeight), a && (n += a.offsetHeight);
|
|
497
497
|
const c = Math.max(i - n, 100);
|
|
498
|
-
t(this, tt) !== c && (p(this, tt, c), t(this,
|
|
498
|
+
t(this, tt) !== c && (p(this, tt, c), t(this, Et).call(this), t(this, I) !== null && (t(this, At).call(this), this.refresh()));
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
501
|
})), t(this, V).observe(t(this, S)));
|
|
502
502
|
}, "#initResizeObserver"));
|
|
503
|
-
d(this,
|
|
503
|
+
d(this, At, /* @__PURE__ */ h(() => {
|
|
504
504
|
W.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((r) => {
|
|
505
505
|
const e = t(this, S).querySelector(r);
|
|
506
506
|
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Ot).call(this, e, r);
|
|
@@ -521,11 +521,11 @@ const Ie = class Ie {
|
|
|
521
521
|
return;
|
|
522
522
|
}
|
|
523
523
|
const b = t(this, D).data.get(g);
|
|
524
|
-
f.style.display = "", t(this,
|
|
524
|
+
f.style.display = "", t(this, Rt).call(this, f, b, g);
|
|
525
525
|
});
|
|
526
526
|
});
|
|
527
527
|
}, "#adjustBufferRows"));
|
|
528
|
-
d(this,
|
|
528
|
+
d(this, lt, /* @__PURE__ */ h((r) => {
|
|
529
529
|
var f, u;
|
|
530
530
|
const e = t(this, I);
|
|
531
531
|
if (!e || e <= 0) return;
|
|
@@ -546,7 +546,7 @@ const Ie = class Ie {
|
|
|
546
546
|
return;
|
|
547
547
|
}
|
|
548
548
|
const T = t(this, D).data.get(M);
|
|
549
|
-
E.style.display = "", t(this,
|
|
549
|
+
E.style.display = "", t(this, Rt).call(this, E, T, M);
|
|
550
550
|
});
|
|
551
551
|
});
|
|
552
552
|
}, "#handleScroll"));
|
|
@@ -564,7 +564,7 @@ const Ie = class Ie {
|
|
|
564
564
|
cell.dataset.row = dataIndex;
|
|
565
565
|
});
|
|
566
566
|
}; */
|
|
567
|
-
d(this,
|
|
567
|
+
d(this, Rt, /* @__PURE__ */ h((r, e, s) => {
|
|
568
568
|
r.dataset.row = s, r.data = e, Array.from(r.cells).forEach((i, n) => {
|
|
569
569
|
i.dataset.row = s;
|
|
570
570
|
const o = Array.from(i.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
|
|
@@ -599,7 +599,7 @@ const Ie = class Ie {
|
|
|
599
599
|
return ((e = t(this, P).get(r)) == null ? void 0 : e.length) || 1;
|
|
600
600
|
}
|
|
601
601
|
};
|
|
602
|
-
D = new WeakMap(), S = new WeakMap(), Q = new WeakMap(), P = new WeakMap(), I = new WeakMap(), V = new WeakMap(), tt = new WeakMap(),
|
|
602
|
+
D = new WeakMap(), S = new WeakMap(), Q = new WeakMap(), P = new WeakMap(), I = new WeakMap(), V = new WeakMap(), tt = new WeakMap(), wt = new WeakMap(), Se = new WeakMap(), Ee = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), Bt = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), zt = new WeakMap(), Pt = new WeakMap(), At = new WeakMap(), Ae = new WeakMap(), lt = new WeakMap(), Rt = new WeakMap(), Dt = new WeakMap(), h(Ie, "RowManager");
|
|
603
603
|
let ce = Ie;
|
|
604
604
|
const jt = class jt {
|
|
605
605
|
/**
|
|
@@ -655,8 +655,8 @@ const jt = class jt {
|
|
|
655
655
|
}
|
|
656
656
|
const M = x.rowSpan || 1, T = x.colSpan || 1;
|
|
657
657
|
for (let B = 0; B < M; B++)
|
|
658
|
-
for (let
|
|
659
|
-
v + B < u && E +
|
|
658
|
+
for (let pt = 0; pt < T; pt++)
|
|
659
|
+
v + B < u && E + pt < g && (b[v + B][E + pt] = B === 0 && pt === 0 ? "1" : "0");
|
|
660
660
|
});
|
|
661
661
|
}), l.forEach((m) => {
|
|
662
662
|
const v = m.sectionRowIndex;
|
|
@@ -680,15 +680,15 @@ const jt = class jt {
|
|
|
680
680
|
};
|
|
681
681
|
h(jt, "TableCompiler");
|
|
682
682
|
let he = jt;
|
|
683
|
-
var Ft,
|
|
684
|
-
const
|
|
683
|
+
var Ft, et, st, Vt, Yt, ct, Ut, Xt;
|
|
684
|
+
const yt = class yt extends HTMLElement {
|
|
685
685
|
constructor() {
|
|
686
686
|
super();
|
|
687
687
|
d(this, Ft);
|
|
688
|
-
d(this,
|
|
689
|
-
d(this,
|
|
688
|
+
d(this, et, null);
|
|
689
|
+
d(this, st);
|
|
690
690
|
A(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
691
|
-
t(this,
|
|
691
|
+
t(this, st).refresh();
|
|
692
692
|
}, "invalidate"));
|
|
693
693
|
d(this, Vt, /* @__PURE__ */ h(() => {
|
|
694
694
|
[
|
|
@@ -698,14 +698,17 @@ const pt = class pt extends HTMLElement {
|
|
|
698
698
|
].forEach(({ selector: s, type: i }) => {
|
|
699
699
|
const n = this.querySelector(s);
|
|
700
700
|
if (!n) return;
|
|
701
|
-
|
|
701
|
+
n.innerHTML = "";
|
|
702
|
+
const o = document.createElement("div");
|
|
703
|
+
o.className = "ng-part-header", o.appendChild(t(this, ct).call(this, t(this, et), i, "header"));
|
|
704
|
+
const a = document.createElement("div");
|
|
702
705
|
a.className = "ng-part-body";
|
|
703
706
|
const c = document.createElement("div");
|
|
704
|
-
c.className = "ng-scroll-content", c.style.position = "relative", c.style.width = "100%", c.appendChild(t(this,
|
|
707
|
+
c.className = "ng-scroll-content", c.style.position = "relative", c.style.width = "100%", c.appendChild(t(this, ct).call(this, t(this, et), i, "body"));
|
|
705
708
|
const l = document.createElement("div");
|
|
706
709
|
l.className = "ng-virtual-spacer", l.style.width = "100%", l.style.pointerEvents = "none", c.appendChild(l), a.appendChild(c);
|
|
707
710
|
const f = document.createElement("div");
|
|
708
|
-
f.className = "ng-part-footer", f.appendChild(t(this,
|
|
711
|
+
f.className = "ng-part-footer", f.appendChild(t(this, ct).call(this, t(this, et), i, "footer")), n.appendChild(o), n.appendChild(a), n.appendChild(f);
|
|
709
712
|
});
|
|
710
713
|
}, "#renderSplitContainers"));
|
|
711
714
|
d(this, Yt, /* @__PURE__ */ h(() => {
|
|
@@ -720,12 +723,12 @@ const pt = class pt extends HTMLElement {
|
|
|
720
723
|
});
|
|
721
724
|
}, "#updateContainerWidths"));
|
|
722
725
|
A(this, "generate", /* @__PURE__ */ h((e) => {
|
|
723
|
-
e && (p(this,
|
|
726
|
+
e && (p(this, et, he.compile(e)), t(this, Vt).call(this), t(this, Yt).call(this), t(this, st).initialize(), setTimeout(() => {
|
|
724
727
|
var s;
|
|
725
728
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
726
729
|
}, 0));
|
|
727
730
|
}, "generate"));
|
|
728
|
-
d(this,
|
|
731
|
+
d(this, ct, /* @__PURE__ */ h((e, s, i) => {
|
|
729
732
|
const n = e.cloneNode(!0), o = n.querySelector("thead"), a = n.querySelector("tbody"), c = n.querySelector("tfoot");
|
|
730
733
|
if (i === "header") {
|
|
731
734
|
if (a && a.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
@@ -741,7 +744,7 @@ const pt = class pt extends HTMLElement {
|
|
|
741
744
|
l.remove();
|
|
742
745
|
}), n;
|
|
743
746
|
}, "#createSplitTable"));
|
|
744
|
-
A(this, "getRowHeight", /* @__PURE__ */ h(() => t(this,
|
|
747
|
+
A(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, st).getRowHeight(), "getRowHeight"));
|
|
745
748
|
A(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
746
749
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
747
750
|
s && (s.scrollLeft = e);
|
|
@@ -754,7 +757,7 @@ const pt = class pt extends HTMLElement {
|
|
|
754
757
|
t(this, Xt).call(this);
|
|
755
758
|
}, "#init"));
|
|
756
759
|
d(this, Xt, /* @__PURE__ */ h(() => {
|
|
757
|
-
const e =
|
|
760
|
+
const e = yt.SCROLLBAR_SIZE;
|
|
758
761
|
this.innerHTML = `
|
|
759
762
|
<style>
|
|
760
763
|
nine-table-sheet {
|
|
@@ -908,7 +911,7 @@ const pt = class pt extends HTMLElement {
|
|
|
908
911
|
</div>
|
|
909
912
|
`;
|
|
910
913
|
}, "#render"));
|
|
911
|
-
p(this,
|
|
914
|
+
p(this, st, new ce(this)), p(this, Ft, this.getRootNode().host);
|
|
912
915
|
}
|
|
913
916
|
connectedCallback() {
|
|
914
917
|
t(this, Ut).call(this);
|
|
@@ -917,8 +920,8 @@ const pt = class pt extends HTMLElement {
|
|
|
917
920
|
this.innerHTML = "", W.log("NineTableSheet destroyed.");
|
|
918
921
|
}
|
|
919
922
|
};
|
|
920
|
-
Ft = new WeakMap(),
|
|
921
|
-
let $t =
|
|
923
|
+
Ft = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), ct = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(), h(yt, "NineTableSheet"), A(yt, "SCROLLBAR_SIZE", 16);
|
|
924
|
+
let $t = yt;
|
|
922
925
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", $t);
|
|
923
926
|
var Kt, qt;
|
|
924
927
|
const _e = class _e extends HTMLElement {
|
|
@@ -1113,31 +1116,31 @@ const Ne = class Ne {
|
|
|
1113
1116
|
};
|
|
1114
1117
|
H = new WeakMap(), Zt = new WeakMap(), Tt = new WeakMap(), Gt = new WeakMap(), h(Ne, "LayoutManager");
|
|
1115
1118
|
let fe = Ne;
|
|
1116
|
-
var kt,
|
|
1119
|
+
var kt, ht;
|
|
1117
1120
|
const We = class We {
|
|
1118
1121
|
constructor(r) {
|
|
1119
1122
|
d(this, kt);
|
|
1120
|
-
d(this,
|
|
1123
|
+
d(this, ht, -1);
|
|
1121
1124
|
A(this, "count", /* @__PURE__ */ h(() => t(this, kt).rawRecords.length, "count"));
|
|
1122
1125
|
p(this, kt, r);
|
|
1123
1126
|
}
|
|
1124
1127
|
get at() {
|
|
1125
|
-
return t(this,
|
|
1128
|
+
return t(this, ht);
|
|
1126
1129
|
}
|
|
1127
1130
|
set at(r) {
|
|
1128
|
-
p(this,
|
|
1131
|
+
p(this, ht, parseInt(r, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, ht)}"]`) && setTimeout(() => {
|
|
1129
1132
|
});
|
|
1130
1133
|
}
|
|
1131
1134
|
};
|
|
1132
|
-
kt = new WeakMap(),
|
|
1135
|
+
kt = new WeakMap(), ht = new WeakMap(), h(We, "ngRow");
|
|
1133
1136
|
let ue = We;
|
|
1134
|
-
var _, k, N,
|
|
1137
|
+
var _, k, N, dt, Jt, Y, Qt, rt, Ct, te, ee, ft;
|
|
1135
1138
|
const O = class O {
|
|
1136
1139
|
constructor(r, e) {
|
|
1137
1140
|
d(this, _);
|
|
1138
1141
|
d(this, k);
|
|
1139
1142
|
d(this, N, []);
|
|
1140
|
-
d(this,
|
|
1143
|
+
d(this, dt, []);
|
|
1141
1144
|
d(this, Jt, 0);
|
|
1142
1145
|
d(this, Y, []);
|
|
1143
1146
|
d(this, Qt, /* @__PURE__ */ h(() => {
|
|
@@ -1150,7 +1153,7 @@ const O = class O {
|
|
|
1150
1153
|
e.__ng || (e.__ng = t(this, Ct).call(this)), e.__ng.height = t(this, Y).slice();
|
|
1151
1154
|
});
|
|
1152
1155
|
}, "#initialize"));
|
|
1153
|
-
d(this,
|
|
1156
|
+
d(this, rt, /* @__PURE__ */ h(() => {
|
|
1154
1157
|
const r = t(this, _).shadowRoot.querySelector("nine-table-sheets");
|
|
1155
1158
|
r == null || r.classList.toggle("nodata", this.length === 0), t(this, _).shadowRoot.querySelectorAll("nine-table-sheet").forEach((e) => {
|
|
1156
1159
|
e.invalidate();
|
|
@@ -1160,17 +1163,17 @@ const O = class O {
|
|
|
1160
1163
|
var n;
|
|
1161
1164
|
const s = this.getValidData();
|
|
1162
1165
|
if (!s || s.length <= 0) return;
|
|
1163
|
-
if (r == null) return t(this,
|
|
1166
|
+
if (r == null) return t(this, ft).call(this, s);
|
|
1164
1167
|
if (r < 0 || r >= s.length) return null;
|
|
1165
1168
|
const i = typeof ((n = t(this, _).fields) == null ? void 0 : n.get) == "function" ? t(this, _).fields.get() : [];
|
|
1166
1169
|
if (e != null) {
|
|
1167
1170
|
const o = i.indexOf(e);
|
|
1168
1171
|
return o >= 0 ? s[r].v[o] : null;
|
|
1169
1172
|
}
|
|
1170
|
-
return t(this,
|
|
1173
|
+
return t(this, ft).call(this, s[r]);
|
|
1171
1174
|
}, "get"));
|
|
1172
1175
|
A(this, "set", /* @__PURE__ */ h((r) => {
|
|
1173
|
-
this.clear(), this.add(r, !1), t(this,
|
|
1176
|
+
this.clear(), this.add(r, !1), t(this, rt).call(this);
|
|
1174
1177
|
}, "set"));
|
|
1175
1178
|
d(this, Ct, /* @__PURE__ */ h(() => ({
|
|
1176
1179
|
rowState: O.ROW_STATE.EMPTY,
|
|
@@ -1182,11 +1185,11 @@ const O = class O {
|
|
|
1182
1185
|
_: [0, 0, 0, 0, O.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Y).slice(), -1, {}, {}]
|
|
1183
1186
|
}), "#getDefaultMeta"));
|
|
1184
1187
|
A(this, "reset", /* @__PURE__ */ h(() => {
|
|
1185
|
-
p(this, N, []), p(this,
|
|
1188
|
+
p(this, N, []), p(this, dt, []), t(this, rt).call(this);
|
|
1186
1189
|
}, "reset"));
|
|
1187
1190
|
A(this, "clear", /* @__PURE__ */ h(() => {
|
|
1188
1191
|
var r;
|
|
1189
|
-
t(this, k).rawRecords = [], p(this, N, []), p(this,
|
|
1192
|
+
t(this, k).rawRecords = [], p(this, N, []), p(this, dt, []), (r = t(this, k).viewRecords) != null && r.reset && t(this, k).viewRecords.reset();
|
|
1190
1193
|
}, "clear"));
|
|
1191
1194
|
d(this, te, /* @__PURE__ */ h((r) => {
|
|
1192
1195
|
var i;
|
|
@@ -1210,7 +1213,7 @@ const O = class O {
|
|
|
1210
1213
|
return e || s.forEach((n, o) => {
|
|
1211
1214
|
const a = t(this, k).rawRecords[i - o];
|
|
1212
1215
|
a && (a.__ng.rowState = O.ROW_STATE.EMPTY);
|
|
1213
|
-
}), t(this,
|
|
1216
|
+
}), t(this, rt).call(this), i;
|
|
1214
1217
|
}, "add"));
|
|
1215
1218
|
A(this, "delete", /* @__PURE__ */ h((r) => {
|
|
1216
1219
|
let e = [];
|
|
@@ -1221,7 +1224,7 @@ const O = class O {
|
|
|
1221
1224
|
n.__ng.rowid === i && (n.__ng.deleted = !0, n.__ng.rowState = O.ROW_STATE.DELETE);
|
|
1222
1225
|
});
|
|
1223
1226
|
}
|
|
1224
|
-
}), this.resetRecords(), t(this,
|
|
1227
|
+
}), this.resetRecords(), t(this, rt).call(this);
|
|
1225
1228
|
}, "delete"));
|
|
1226
1229
|
A(this, "setValue", /* @__PURE__ */ h((r, e, s) => {
|
|
1227
1230
|
var c;
|
|
@@ -1234,14 +1237,14 @@ const O = class O {
|
|
|
1234
1237
|
a !== s && o.__ng.rowState !== O.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = a), o.__ng.rowState = O.ROW_STATE.UPDATE), o.v[n] = s;
|
|
1235
1238
|
}, "setValue"));
|
|
1236
1239
|
A(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1237
|
-
p(this,
|
|
1240
|
+
p(this, dt, t(this, k).rawRecords.filter((r) => !r.__ng.deleted)), p(this, N, t(this, k).rawRecords.filter((r) => !r.__ng.deleted && !r.__ng.filtered)), t(this, k).rawRecords.forEach((r, e) => {
|
|
1238
1241
|
r.__ng.rowidx = e;
|
|
1239
1242
|
}), t(this, N).forEach((r, e) => {
|
|
1240
1243
|
r.__ng.i = e;
|
|
1241
1244
|
});
|
|
1242
1245
|
}, "resetRecords"));
|
|
1243
1246
|
A(this, "getValidData", /* @__PURE__ */ h(() => (t(this, N).length === 0 && t(this, k).rawRecords.length > 0 && this.resetRecords(), t(this, N)), "getValidData"));
|
|
1244
|
-
d(this,
|
|
1247
|
+
d(this, ft, /* @__PURE__ */ h((r) => {
|
|
1245
1248
|
var o;
|
|
1246
1249
|
if (!r) return r;
|
|
1247
1250
|
const e = !Array.isArray(r), s = e ? [r] : r, i = typeof ((o = t(this, _).fields) == null ? void 0 : o.get) == "function" ? t(this, _).fields.get() : [], n = s.filter((a) => !a.__ng.deleted).map((a) => {
|
|
@@ -1256,7 +1259,7 @@ const O = class O {
|
|
|
1256
1259
|
p(this, _, r), p(this, k, e), t(this, Qt).call(this);
|
|
1257
1260
|
}
|
|
1258
1261
|
get source() {
|
|
1259
|
-
return t(this,
|
|
1262
|
+
return t(this, ft).call(this, t(this, k).rawRecords);
|
|
1260
1263
|
}
|
|
1261
1264
|
set source(r) {
|
|
1262
1265
|
this.clear(), this.add(r, !1);
|
|
@@ -1274,7 +1277,7 @@ const O = class O {
|
|
|
1274
1277
|
return this.length;
|
|
1275
1278
|
}
|
|
1276
1279
|
};
|
|
1277
|
-
_ = new WeakMap(), k = new WeakMap(), N = new WeakMap(),
|
|
1280
|
+
_ = new WeakMap(), k = new WeakMap(), N = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), Y = new WeakMap(), Qt = new WeakMap(), rt = new WeakMap(), Ct = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), ft = new WeakMap(), h(O, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1278
1281
|
A(O, "ROW_STATE", {
|
|
1279
1282
|
EMPTY: "EMPTY",
|
|
1280
1283
|
NORMAL: "NORMAL",
|
|
@@ -1283,13 +1286,13 @@ A(O, "ROW_STATE", {
|
|
|
1283
1286
|
DELETE: "DELETE"
|
|
1284
1287
|
});
|
|
1285
1288
|
let ge = O;
|
|
1286
|
-
var
|
|
1289
|
+
var it;
|
|
1287
1290
|
const Oe = class Oe {
|
|
1288
1291
|
constructor(r) {
|
|
1289
|
-
d(this,
|
|
1290
|
-
p(this,
|
|
1292
|
+
d(this, it);
|
|
1293
|
+
p(this, it, r), this.row = new ue(this), this.data = new ge(t(this, it), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1291
1294
|
var e;
|
|
1292
|
-
(e = t(this,
|
|
1295
|
+
(e = t(this, it).view) != null && e.redraw && t(this, it).view.redraw();
|
|
1293
1296
|
}, this.setDataSource = (e) => {
|
|
1294
1297
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1295
1298
|
}, this.getRowState = (e) => {
|
|
@@ -1304,13 +1307,13 @@ const Oe = class Oe {
|
|
|
1304
1307
|
}, this.setDataSource([]);
|
|
1305
1308
|
}
|
|
1306
1309
|
};
|
|
1307
|
-
|
|
1310
|
+
it = new WeakMap(), h(Oe, "ngDataManager");
|
|
1308
1311
|
let be = Oe;
|
|
1309
|
-
var
|
|
1312
|
+
var ut, L, Lt, se;
|
|
1310
1313
|
const Be = class Be {
|
|
1311
1314
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1312
1315
|
constructor(r) {
|
|
1313
|
-
d(this,
|
|
1316
|
+
d(this, ut);
|
|
1314
1317
|
d(this, L, []);
|
|
1315
1318
|
A(this, "add", /* @__PURE__ */ h((r, e = "string") => {
|
|
1316
1319
|
r.forEach((s) => {
|
|
@@ -1324,8 +1327,8 @@ const Be = class Be {
|
|
|
1324
1327
|
}), p(this, L, Array.from(r, ([e, s]) => ({ name: e, type: s }))), p(this, L, t(this, L).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, L).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
1325
1328
|
}, "#adjust"));
|
|
1326
1329
|
d(this, se, /* @__PURE__ */ h(() => {
|
|
1327
|
-
p(this, L, []), W.log(t(this,
|
|
1328
|
-
const r = Array.from(t(this,
|
|
1330
|
+
p(this, L, []), W.log(t(this, ut).querySelectorAll("table"));
|
|
1331
|
+
const r = Array.from(t(this, ut).querySelectorAll("table"));
|
|
1329
1332
|
if (!(!r || r.length === 0)) {
|
|
1330
1333
|
for (const e of r)
|
|
1331
1334
|
W.log(e), $("[data-bind]", e).each((s, i) => {
|
|
@@ -1355,7 +1358,7 @@ const Be = class Be {
|
|
|
1355
1358
|
t(this, Lt).call(this);
|
|
1356
1359
|
}
|
|
1357
1360
|
}, "#init"));
|
|
1358
|
-
p(this,
|
|
1361
|
+
p(this, ut, r), t(this, se).call(this);
|
|
1359
1362
|
}
|
|
1360
1363
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
1361
1364
|
get() {
|
|
@@ -1377,19 +1380,19 @@ const Be = class Be {
|
|
|
1377
1380
|
return t(this, L).some((e) => e.name === r);
|
|
1378
1381
|
}
|
|
1379
1382
|
};
|
|
1380
|
-
|
|
1383
|
+
ut = new WeakMap(), L = new WeakMap(), Lt = new WeakMap(), se = new WeakMap(), h(Be, "ngFields");
|
|
1381
1384
|
let pe = Be;
|
|
1382
|
-
var
|
|
1385
|
+
var nt, re, ie;
|
|
1383
1386
|
const ze = class ze extends HTMLElement {
|
|
1384
1387
|
constructor() {
|
|
1385
1388
|
super();
|
|
1386
1389
|
//#created = false;
|
|
1387
|
-
d(this,
|
|
1390
|
+
d(this, nt);
|
|
1388
1391
|
d(this, re);
|
|
1389
1392
|
d(this, ie, /* @__PURE__ */ h(() => {
|
|
1390
1393
|
this.fields = new pe(this), p(this, re, new fe(this)), W.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1391
1394
|
}, "#init"));
|
|
1392
|
-
this.attachShadow({ mode: "open" }), p(this,
|
|
1395
|
+
this.attachShadow({ mode: "open" }), p(this, nt, new be(this));
|
|
1393
1396
|
}
|
|
1394
1397
|
connectedCallback() {
|
|
1395
1398
|
t(this, ie).call(this);
|
|
@@ -1399,21 +1402,21 @@ const ze = class ze extends HTMLElement {
|
|
|
1399
1402
|
}
|
|
1400
1403
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1401
1404
|
get data() {
|
|
1402
|
-
return t(this,
|
|
1405
|
+
return t(this, nt).data;
|
|
1403
1406
|
}
|
|
1404
1407
|
// π― ν(row) κ΄λ ¨ μ μ΄ μ κ·Όμ μ€ν
|
|
1405
1408
|
get row() {
|
|
1406
|
-
return t(this,
|
|
1409
|
+
return t(this, nt).row;
|
|
1407
1410
|
}
|
|
1408
1411
|
// π― μ 체 λ°μ΄ν° λ§€λμ μ κ·Ό νμν κ²½μ°
|
|
1409
1412
|
get dataManager() {
|
|
1410
|
-
return t(this,
|
|
1413
|
+
return t(this, nt);
|
|
1411
1414
|
}
|
|
1412
1415
|
};
|
|
1413
|
-
|
|
1416
|
+
nt = new WeakMap(), re = new WeakMap(), ie = new WeakMap(), h(ze, "NineTable");
|
|
1414
1417
|
let ye = ze;
|
|
1415
1418
|
customElements.get("nine-table") || customElements.define("nine-table", ye);
|
|
1416
|
-
const
|
|
1419
|
+
const mt = class mt extends HTMLElement {
|
|
1417
1420
|
// π 컀μ€ν
μ€νμΌμ© μΊμ μΆκ°
|
|
1418
1421
|
constructor() {
|
|
1419
1422
|
super();
|
|
@@ -1424,8 +1427,8 @@ const yt = class yt extends HTMLElement {
|
|
|
1424
1427
|
connectedCallback() {
|
|
1425
1428
|
}
|
|
1426
1429
|
};
|
|
1427
|
-
h(
|
|
1428
|
-
let me =
|
|
1430
|
+
h(mt, "BasicCellElement"), A(mt, "_styleCache", /* @__PURE__ */ new Map()), A(mt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1431
|
+
let me = mt;
|
|
1429
1432
|
var C, Ht, y, Re, qe, Te, ke, Ce;
|
|
1430
1433
|
const Pe = class Pe extends me {
|
|
1431
1434
|
constructor() {
|
|
@@ -1537,14 +1540,14 @@ const De = class De extends xe {
|
|
|
1537
1540
|
};
|
|
1538
1541
|
h(De, "EditableCellElement");
|
|
1539
1542
|
let ve = De;
|
|
1540
|
-
var Mt,
|
|
1543
|
+
var Mt, ot, gt, bt, ne, U, Le;
|
|
1541
1544
|
const je = class je extends ve {
|
|
1542
1545
|
constructor() {
|
|
1543
1546
|
super();
|
|
1544
1547
|
d(this, Mt);
|
|
1545
|
-
d(this,
|
|
1546
|
-
d(this, ut);
|
|
1548
|
+
d(this, ot);
|
|
1547
1549
|
d(this, gt);
|
|
1550
|
+
d(this, bt);
|
|
1548
1551
|
d(this, ne);
|
|
1549
1552
|
d(this, U);
|
|
1550
1553
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
@@ -1583,9 +1586,9 @@ const je = class je extends ve {
|
|
|
1583
1586
|
*/
|
|
1584
1587
|
d(this, Le, /* @__PURE__ */ h((e) => {
|
|
1585
1588
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1586
|
-
if (t(this,
|
|
1589
|
+
if (t(this, ot) == "number") {
|
|
1587
1590
|
let n = [];
|
|
1588
|
-
if (t(this, U) && Number(t(this, U)) > 0 && n.push("."), t(this,
|
|
1591
|
+
if (t(this, U) && Number(t(this, U)) > 0 && n.push("."), t(this, bt) && Number(t(this, bt)) >= 0 && n.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !n.includes(e.key) && e.preventDefault(), t(this, U) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
|
|
1589
1592
|
var s = e.target.value, i = s.indexOf(".");
|
|
1590
1593
|
if (i >= 0) {
|
|
1591
1594
|
var s = s.substr(i + 1, s.length);
|
|
@@ -1593,10 +1596,10 @@ const je = class je extends ve {
|
|
|
1593
1596
|
}
|
|
1594
1597
|
}
|
|
1595
1598
|
}
|
|
1596
|
-
t(this,
|
|
1599
|
+
t(this, gt) && ninegrid.getByteLength(e.target.value) >= Number(t(this, gt)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1597
1600
|
}
|
|
1598
1601
|
}, "#onKeyDown"));
|
|
1599
|
-
if (this.applyBaseStyle(), p(this,
|
|
1602
|
+
if (this.applyBaseStyle(), p(this, ot, this.getAttribute("type") || "text"), p(this, gt, this.getAttribute("maxbyte")), p(this, bt, this.getAttribute("min")), p(this, ne, this.getAttribute("max")), p(this, U, this.getAttribute("scale")), !["text", "number"].includes(t(this, ot))) throw `invalid type : ${t(this, ot)}`;
|
|
1600
1603
|
}
|
|
1601
1604
|
connectedCallback() {
|
|
1602
1605
|
for (var e = [], s = 0; s < this.attributes.length; s++)
|
|
@@ -1609,7 +1612,7 @@ const je = class je extends ve {
|
|
|
1609
1612
|
`, super.connectedCallback(), p(this, Mt, this.querySelector("input"));
|
|
1610
1613
|
}
|
|
1611
1614
|
};
|
|
1612
|
-
Mt = new WeakMap(),
|
|
1615
|
+
Mt = new WeakMap(), ot = new WeakMap(), gt = new WeakMap(), bt = new WeakMap(), ne = new WeakMap(), U = new WeakMap(), Le = new WeakMap(), h(je, "CellInputText");
|
|
1613
1616
|
let we = je;
|
|
1614
1617
|
customElements.get("cell-input-text");
|
|
1615
1618
|
customElements.get("cell-input") || customElements.define("cell-input", we);
|