@ninebone/table 0.0.471 β 0.0.473
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 +123 -122
- 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 Fe = Object.defineProperty;
|
|
2
|
+
var Ye = (q) => {
|
|
3
3
|
throw TypeError(q);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var h = (q, i) =>
|
|
7
|
-
var A = (q, i, e) =>
|
|
8
|
-
var t = (q, i, e) => (
|
|
9
|
-
var
|
|
5
|
+
var Ue = (q, i, e) => i in q ? Fe(q, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : q[i] = e;
|
|
6
|
+
var h = (q, i) => Fe(q, "name", { value: i, configurable: !0 });
|
|
7
|
+
var A = (q, i, e) => Ue(q, typeof i != "symbol" ? i + "" : i, e), Ve = (q, i, e) => i.has(q) || Ye("Cannot " + e);
|
|
8
|
+
var t = (q, i, e) => (Ve(q, i, "read from private field"), e ? e.call(q) : i.get(q)), d = (q, i, e) => i.has(q) ? Ye("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(q) : i.set(q, e), y = (q, i, e, s) => (Ve(q, i, "write to private field"), s ? s.call(q, e) : i.set(q, e), e);
|
|
9
|
+
var Ke = (q, i, e, s) => ({
|
|
10
10
|
set _(r) {
|
|
11
11
|
y(q, i, r, e);
|
|
12
12
|
},
|
|
@@ -14,17 +14,17 @@ var Ve = (q, i, e, s) => ({
|
|
|
14
14
|
return t(q, i, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
import { trace as
|
|
18
|
-
const
|
|
17
|
+
import { trace as Xe } from "@ninebone/util";
|
|
18
|
+
const He = class He extends Xe.constructor {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
h(
|
|
24
|
-
let
|
|
25
|
-
const yt = new
|
|
23
|
+
h(He, "Trace");
|
|
24
|
+
let le = He;
|
|
25
|
+
const yt = new le();
|
|
26
26
|
var D, P, S, K, U, X, It, Z, _t;
|
|
27
|
-
const
|
|
27
|
+
const Me = class Me extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
d(this, D);
|
|
@@ -198,11 +198,11 @@ const He = class He extends HTMLElement {
|
|
|
198
198
|
t(this, X) && t(this, X).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
D = new WeakMap(), P = new WeakMap(), S = new WeakMap(), K = new WeakMap(), U = new WeakMap(), X = new WeakMap(), It = new WeakMap(), Z = new WeakMap(), _t = new WeakMap(), h(
|
|
202
|
-
let
|
|
203
|
-
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar",
|
|
201
|
+
D = new WeakMap(), P = new WeakMap(), S = new WeakMap(), K = new WeakMap(), U = new WeakMap(), X = new WeakMap(), It = new WeakMap(), Z = new WeakMap(), _t = new WeakMap(), h(Me, "NineTableHScrollBar");
|
|
202
|
+
let ce = Me;
|
|
203
|
+
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ce);
|
|
204
204
|
var j, nt, G, R, vt, wt, Nt;
|
|
205
|
-
const
|
|
205
|
+
const $e = class $e extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
208
|
d(this, j);
|
|
@@ -350,11 +350,11 @@ const Me = class Me extends HTMLElement {
|
|
|
350
350
|
e();
|
|
351
351
|
}
|
|
352
352
|
};
|
|
353
|
-
j = new WeakMap(), nt = new WeakMap(), G = new WeakMap(), R = new WeakMap(), vt = new WeakMap(), wt = new WeakMap(), Nt = new WeakMap(), h(
|
|
354
|
-
let
|
|
355
|
-
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar",
|
|
356
|
-
var O, E, B, H, F, J, St, ot, Wt, Ot, Bt, Et, At,
|
|
357
|
-
const
|
|
353
|
+
j = new WeakMap(), nt = new WeakMap(), G = new WeakMap(), R = new WeakMap(), vt = new WeakMap(), wt = new WeakMap(), Nt = new WeakMap(), h($e, "NineTableVScrollBar");
|
|
354
|
+
let he = $e;
|
|
355
|
+
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", he);
|
|
356
|
+
var O, E, B, H, F, J, St, ot, Wt, Ot, Bt, zt, Et, At, Dt, Pt, qt, jt, Ae, at, lt, Ft;
|
|
357
|
+
const Ie = class Ie {
|
|
358
358
|
constructor(i) {
|
|
359
359
|
d(this, O);
|
|
360
360
|
d(this, E);
|
|
@@ -364,7 +364,8 @@ const $e = class $e {
|
|
|
364
364
|
d(this, J, 0);
|
|
365
365
|
d(this, St, 40);
|
|
366
366
|
d(this, ot, !1);
|
|
367
|
-
d(this, Wt,
|
|
367
|
+
d(this, Wt, !1);
|
|
368
|
+
d(this, Ot, 3);
|
|
368
369
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
369
370
|
var e;
|
|
370
371
|
const i = t(this, E).querySelector(".ng-container-body .ng-part-body");
|
|
@@ -383,20 +384,20 @@ const $e = class $e {
|
|
|
383
384
|
});
|
|
384
385
|
const i = t(this, E).querySelector(".ng-container-body .ng-part-body"), e = t(this, E).querySelector(".ng-container-left .ng-part-body"), s = t(this, E).querySelector(".ng-container-right .ng-part-body");
|
|
385
386
|
if (i) {
|
|
386
|
-
t(this,
|
|
387
|
+
t(this, zt).call(this, i), t(this, qt).call(this), t(this, Et).call(this), t(this, at).call(this, i.scrollTop);
|
|
387
388
|
let r = !1;
|
|
388
389
|
const n = /* @__PURE__ */ h((o, a) => {
|
|
389
390
|
var c;
|
|
390
391
|
r || (r = !0, i && i.scrollTop !== o && (i.scrollTop = o), e && e.scrollTop !== o && (e.scrollTop = o), s && s.scrollTop !== o && (s.scrollTop = o), t(this, at).call(this, o), (c = t(this, E).querySelector("nine-table-vscrollbar")) == null || c.refresh(), r = !1);
|
|
391
392
|
}, "syncScroll");
|
|
392
393
|
[i, e, s].forEach((o) => {
|
|
393
|
-
o
|
|
394
|
-
n(o.scrollTop);
|
|
394
|
+
o == null || o.addEventListener("scroll", () => {
|
|
395
|
+
n(o.scrollTop), y(this, Wt, !1);
|
|
395
396
|
});
|
|
396
397
|
});
|
|
397
398
|
}
|
|
398
399
|
}, "initialize"));
|
|
399
|
-
d(this,
|
|
400
|
+
d(this, Bt, /* @__PURE__ */ h((i, e) => {
|
|
400
401
|
const s = t(this, B).get(e);
|
|
401
402
|
if (!s || s.length === 0) return;
|
|
402
403
|
const r = i.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
@@ -409,7 +410,7 @@ const $e = class $e {
|
|
|
409
410
|
});
|
|
410
411
|
n ? n.before(o) : r.appendChild(o);
|
|
411
412
|
}, "#renderRows"));
|
|
412
|
-
d(this,
|
|
413
|
+
d(this, zt, /* @__PURE__ */ h((i) => {
|
|
413
414
|
if (t(this, H) !== null && t(this, H) > 0)
|
|
414
415
|
return t(this, H);
|
|
415
416
|
const e = t(this, B).get(".ng-container-body");
|
|
@@ -441,10 +442,10 @@ const $e = class $e {
|
|
|
441
442
|
d(this, At, /* @__PURE__ */ h(() => {
|
|
442
443
|
if (t(this, J) > 0 && t(this, H) > 0) {
|
|
443
444
|
const i = Math.ceil(t(this, J) / t(this, H));
|
|
444
|
-
y(this, St, i + t(this,
|
|
445
|
+
y(this, St, i + t(this, Ot));
|
|
445
446
|
}
|
|
446
447
|
}, "#updateRowCount"));
|
|
447
|
-
d(this,
|
|
448
|
+
d(this, Dt, /* @__PURE__ */ h(() => {
|
|
448
449
|
var a, c, l, f, u, b;
|
|
449
450
|
const i = t(this, E).querySelector(".ng-container-left .ng-part-body table"), e = t(this, E).querySelector(".ng-container-body .ng-part-body table"), s = t(this, E).querySelector(".ng-container-right .ng-part-body table");
|
|
450
451
|
if (e) {
|
|
@@ -471,7 +472,7 @@ const $e = class $e {
|
|
|
471
472
|
}
|
|
472
473
|
}
|
|
473
474
|
}, "#syncRowHeights"));
|
|
474
|
-
d(this,
|
|
475
|
+
d(this, Pt, /* @__PURE__ */ h(() => {
|
|
475
476
|
!t(this, E) || !(t(this, E) instanceof HTMLElement) || (y(this, F, new ResizeObserver((i) => {
|
|
476
477
|
for (const e of i) {
|
|
477
478
|
const s = e.target;
|
|
@@ -490,10 +491,10 @@ const $e = class $e {
|
|
|
490
491
|
d(this, qt, /* @__PURE__ */ h(() => {
|
|
491
492
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
492
493
|
const e = t(this, E).querySelector(i);
|
|
493
|
-
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this,
|
|
494
|
-
}), t(this,
|
|
494
|
+
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Bt).call(this, e, i);
|
|
495
|
+
}), t(this, Ft).call(this), t(this, Dt).call(this);
|
|
495
496
|
}, "#renderAllContainers"));
|
|
496
|
-
d(this,
|
|
497
|
+
d(this, jt, /* @__PURE__ */ h((i) => {
|
|
497
498
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
498
499
|
var l;
|
|
499
500
|
const s = t(this, E).querySelector(e);
|
|
@@ -512,7 +513,7 @@ const $e = class $e {
|
|
|
512
513
|
});
|
|
513
514
|
});
|
|
514
515
|
}, "#adjustBufferRows"));
|
|
515
|
-
d(this,
|
|
516
|
+
d(this, Ae, /* @__PURE__ */ h((i) => {
|
|
516
517
|
var c;
|
|
517
518
|
const e = t(this, H);
|
|
518
519
|
if (!e || e <= 0) return;
|
|
@@ -532,7 +533,7 @@ const $e = class $e {
|
|
|
532
533
|
g.style.display = "", t(this, lt).call(this, g, w, v);
|
|
533
534
|
});
|
|
534
535
|
}), t(this, ot) || (y(this, ot, !0), setTimeout(() => {
|
|
535
|
-
t(this,
|
|
536
|
+
t(this, jt).call(this, n), y(this, ot, !1);
|
|
536
537
|
}, 0));
|
|
537
538
|
}, "#handleScroll_BAK"));
|
|
538
539
|
d(this, at, /* @__PURE__ */ h((i) => {
|
|
@@ -582,7 +583,7 @@ const $e = class $e {
|
|
|
582
583
|
o && typeof o.refresh == "function" && o.refresh();
|
|
583
584
|
});
|
|
584
585
|
}, "#bindRowData"));
|
|
585
|
-
d(this,
|
|
586
|
+
d(this, Ft, /* @__PURE__ */ h(() => {
|
|
586
587
|
var c, l, f;
|
|
587
588
|
const i = t(this, E).querySelector(".ng-container-left .ng-part-header table"), e = t(this, E).querySelector(".ng-container-body .ng-part-header table"), s = t(this, E).querySelector(".ng-container-right .ng-part-header table");
|
|
588
589
|
if (!e) return;
|
|
@@ -599,7 +600,7 @@ const $e = class $e {
|
|
|
599
600
|
A(this, "destroy", /* @__PURE__ */ h(() => {
|
|
600
601
|
t(this, F) && (t(this, F).disconnect(), y(this, F, null));
|
|
601
602
|
}, "destroy"));
|
|
602
|
-
y(this, O, i.getRootNode().host), y(this, E, i), t(this,
|
|
603
|
+
y(this, O, i.getRootNode().host), y(this, E, i), t(this, Pt).call(this);
|
|
603
604
|
}
|
|
604
605
|
getRowHeight() {
|
|
605
606
|
return t(this, H);
|
|
@@ -609,14 +610,14 @@ const $e = class $e {
|
|
|
609
610
|
return ((e = t(this, B).get(i)) == null ? void 0 : e.length) || 1;
|
|
610
611
|
}
|
|
611
612
|
};
|
|
612
|
-
O = new WeakMap(), E = new WeakMap(), B = new WeakMap(), H = new WeakMap(), F = new WeakMap(), J = new WeakMap(), St = new WeakMap(), ot = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), Bt = new WeakMap(), Et = new WeakMap(), At = new WeakMap(),
|
|
613
|
-
let
|
|
614
|
-
const
|
|
613
|
+
O = new WeakMap(), E = new WeakMap(), B = new WeakMap(), H = new WeakMap(), F = new WeakMap(), J = new WeakMap(), St = new WeakMap(), ot = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), Bt = new WeakMap(), zt = new WeakMap(), Et = new WeakMap(), At = new WeakMap(), Dt = new WeakMap(), Pt = new WeakMap(), qt = new WeakMap(), jt = new WeakMap(), Ae = new WeakMap(), at = new WeakMap(), lt = new WeakMap(), Ft = new WeakMap(), h(Ie, "RowManager");
|
|
614
|
+
let de = Ie;
|
|
615
|
+
const Yt = class Yt {
|
|
615
616
|
/**
|
|
616
617
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
617
618
|
*/
|
|
618
619
|
static compileAll(i) {
|
|
619
|
-
return Array.isArray(i) ? i.map((e) =>
|
|
620
|
+
return Array.isArray(i) ? i.map((e) => Yt.compile(e)) : [];
|
|
620
621
|
}
|
|
621
622
|
/**
|
|
622
623
|
* π― λ¨μΌ μλ³Έ ν
μ΄λΈμ λ°μ κΈ°λ³Έ ꡬ쑰 보μ λ° 2μ°¨μ 격μ μΈλ±μ€ μ¬μ λΆμ¬ μλ£λ λ§μ€ν° ν
μ΄λΈ λ°ν
|
|
@@ -688,20 +689,20 @@ const Ft = class Ft {
|
|
|
688
689
|
}
|
|
689
690
|
// π― [μΆκ°] td/thμ μ μΈλ cell-type μμ±μ μ½μ΄ 컀μ€ν
νκ·Έλ‘ μλ κ°μΈκΈ°
|
|
690
691
|
};
|
|
691
|
-
h(
|
|
692
|
-
let
|
|
693
|
-
var
|
|
692
|
+
h(Yt, "TableCompiler");
|
|
693
|
+
let fe = Yt;
|
|
694
|
+
var Vt, Q, tt, Kt, Ut, ct, Xt, Zt;
|
|
694
695
|
const mt = class mt extends HTMLElement {
|
|
695
696
|
constructor() {
|
|
696
697
|
super();
|
|
697
|
-
d(this,
|
|
698
|
+
d(this, Vt);
|
|
698
699
|
d(this, Q, null);
|
|
699
700
|
d(this, tt);
|
|
700
701
|
A(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
701
702
|
var e, s;
|
|
702
703
|
t(this, tt).refresh(), (e = this.querySelector("nine-table-hscrollbar")) == null || e.refresh(), (s = this.querySelector("nine-table-vscrollbar")) == null || s.refresh();
|
|
703
704
|
}, "invalidate"));
|
|
704
|
-
d(this,
|
|
705
|
+
d(this, Kt, /* @__PURE__ */ h(() => {
|
|
705
706
|
[
|
|
706
707
|
{ selector: ".ng-container-body", type: null },
|
|
707
708
|
{ selector: ".ng-container-left", type: "left" },
|
|
@@ -722,7 +723,7 @@ const mt = class mt extends HTMLElement {
|
|
|
722
723
|
f.className = "ng-part-footer", f.appendChild(t(this, ct).call(this, t(this, Q), r, "footer")), n.appendChild(o), n.appendChild(a), n.appendChild(f);
|
|
723
724
|
});
|
|
724
725
|
}, "#renderSplitContainers"));
|
|
725
|
-
d(this,
|
|
726
|
+
d(this, Ut, /* @__PURE__ */ h(() => {
|
|
726
727
|
["left", "right", "body"].forEach((e) => {
|
|
727
728
|
const s = this.querySelector(`.ng-container-${e}`), r = s == null ? void 0 : s.querySelectorAll("table");
|
|
728
729
|
if (!s || !r || r.length === 0) return;
|
|
@@ -734,7 +735,7 @@ const mt = class mt extends HTMLElement {
|
|
|
734
735
|
});
|
|
735
736
|
}, "#updateContainerWidths"));
|
|
736
737
|
A(this, "generate", /* @__PURE__ */ h((e) => {
|
|
737
|
-
e && (y(this, Q,
|
|
738
|
+
e && (y(this, Q, fe.compile(e)), t(this, Kt).call(this), t(this, Ut).call(this), t(this, tt).initialize(), setTimeout(() => {
|
|
738
739
|
var s;
|
|
739
740
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
740
741
|
}, 0));
|
|
@@ -764,10 +765,10 @@ const mt = class mt extends HTMLElement {
|
|
|
764
765
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
765
766
|
s && (s.scrollTop = e);
|
|
766
767
|
}, "scrollToY"));
|
|
767
|
-
d(this, Ut, /* @__PURE__ */ h(() => {
|
|
768
|
-
t(this, Xt).call(this);
|
|
769
|
-
}, "#init"));
|
|
770
768
|
d(this, Xt, /* @__PURE__ */ h(() => {
|
|
769
|
+
t(this, Zt).call(this);
|
|
770
|
+
}, "#init"));
|
|
771
|
+
d(this, Zt, /* @__PURE__ */ h(() => {
|
|
771
772
|
const e = mt.SCROLLBAR_SIZE;
|
|
772
773
|
this.innerHTML = `
|
|
773
774
|
<style>
|
|
@@ -910,23 +911,23 @@ const mt = class mt extends HTMLElement {
|
|
|
910
911
|
</div>
|
|
911
912
|
`;
|
|
912
913
|
}, "#render"));
|
|
913
|
-
y(this, tt, new
|
|
914
|
+
y(this, tt, new de(this)), y(this, Vt, this.getRootNode().host);
|
|
914
915
|
}
|
|
915
916
|
connectedCallback() {
|
|
916
|
-
t(this,
|
|
917
|
+
t(this, Xt).call(this);
|
|
917
918
|
}
|
|
918
919
|
disconnectedCallback() {
|
|
919
920
|
this.innerHTML = "", yt.log("NineTableSheet destroyed.");
|
|
920
921
|
}
|
|
921
922
|
};
|
|
922
|
-
|
|
923
|
+
Vt = new WeakMap(), Q = new WeakMap(), tt = new WeakMap(), Kt = new WeakMap(), Ut = new WeakMap(), ct = new WeakMap(), Xt = new WeakMap(), Zt = new WeakMap(), h(mt, "NineTableSheet"), A(mt, "SCROLLBAR_SIZE", 16);
|
|
923
924
|
let $t = mt;
|
|
924
925
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", $t);
|
|
925
|
-
var
|
|
926
|
-
const
|
|
926
|
+
var Gt, Rt;
|
|
927
|
+
const _e = class _e extends HTMLElement {
|
|
927
928
|
constructor() {
|
|
928
929
|
super();
|
|
929
|
-
d(this,
|
|
930
|
+
d(this, Gt, /* @__PURE__ */ h(() => {
|
|
930
931
|
var e;
|
|
931
932
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
932
933
|
var o;
|
|
@@ -967,18 +968,18 @@ const Ie = class Ie extends HTMLElement {
|
|
|
967
968
|
}, "#switchSheet"));
|
|
968
969
|
}
|
|
969
970
|
connectedCallback() {
|
|
970
|
-
t(this,
|
|
971
|
+
t(this, Gt).call(this);
|
|
971
972
|
}
|
|
972
973
|
};
|
|
973
|
-
|
|
974
|
-
let
|
|
975
|
-
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets",
|
|
976
|
-
var I,
|
|
977
|
-
const
|
|
974
|
+
Gt = new WeakMap(), Rt = new WeakMap(), h(_e, "NineTableSheets");
|
|
975
|
+
let ue = _e;
|
|
976
|
+
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", ue);
|
|
977
|
+
var I, Jt, kt, Qt;
|
|
978
|
+
const Ne = class Ne {
|
|
978
979
|
constructor(i) {
|
|
979
980
|
d(this, I);
|
|
980
|
-
d(this,
|
|
981
|
-
t(this,
|
|
981
|
+
d(this, Jt, /* @__PURE__ */ h(() => {
|
|
982
|
+
t(this, Qt).call(this), new ResizeObserver((i) => {
|
|
982
983
|
for (let e of i)
|
|
983
984
|
t(this, I).getAttribute("auto-height") === "true" && t(this, kt).call(this);
|
|
984
985
|
}).observe(t(this, I));
|
|
@@ -990,7 +991,7 @@ const _e = class _e {
|
|
|
990
991
|
const e = parseInt(t(this, I).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), r = (c = t(this, I).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, n = (l = t(this, I).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = $t.SCROLLBAR_SIZE, a = e * s + r + n + o;
|
|
991
992
|
t(this, I).style.height = `${a}px`;
|
|
992
993
|
}, "#applyAutoHeight"));
|
|
993
|
-
d(this,
|
|
994
|
+
d(this, Qt, /* @__PURE__ */ h(() => {
|
|
994
995
|
const e = Array.from(t(this, I).children).filter((c) => c.tagName === "TABLE"), s = t(this, I).getAttribute("auto-height") === "true", r = e.length, n = e.map((c, l) => {
|
|
995
996
|
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, b = l < r - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
996
997
|
return u + b;
|
|
@@ -1093,13 +1094,13 @@ const _e = class _e {
|
|
|
1093
1094
|
});
|
|
1094
1095
|
});
|
|
1095
1096
|
}, "#render"));
|
|
1096
|
-
y(this, I, i), t(this,
|
|
1097
|
+
y(this, I, i), t(this, Jt).call(this);
|
|
1097
1098
|
}
|
|
1098
1099
|
};
|
|
1099
|
-
I = new WeakMap(),
|
|
1100
|
-
let
|
|
1100
|
+
I = new WeakMap(), Jt = new WeakMap(), kt = new WeakMap(), Qt = new WeakMap(), h(Ne, "LayoutManager");
|
|
1101
|
+
let ge = Ne;
|
|
1101
1102
|
var Tt, ht;
|
|
1102
|
-
const
|
|
1103
|
+
const We = class We {
|
|
1103
1104
|
constructor(i) {
|
|
1104
1105
|
d(this, Tt);
|
|
1105
1106
|
d(this, ht, -1);
|
|
@@ -1114,18 +1115,18 @@ const Ne = class Ne {
|
|
|
1114
1115
|
});
|
|
1115
1116
|
}
|
|
1116
1117
|
};
|
|
1117
|
-
Tt = new WeakMap(), ht = new WeakMap(), h(
|
|
1118
|
-
let
|
|
1119
|
-
var _, T, N, dt,
|
|
1118
|
+
Tt = new WeakMap(), ht = new WeakMap(), h(We, "ngRow");
|
|
1119
|
+
let be = We;
|
|
1120
|
+
var _, T, N, dt, te, Y, ee, et, Ct, se, ie, ft;
|
|
1120
1121
|
const W = class W {
|
|
1121
1122
|
constructor(i, e) {
|
|
1122
1123
|
d(this, _);
|
|
1123
1124
|
d(this, T);
|
|
1124
1125
|
d(this, N, []);
|
|
1125
1126
|
d(this, dt, []);
|
|
1126
|
-
d(this,
|
|
1127
|
+
d(this, te, 0);
|
|
1127
1128
|
d(this, Y, []);
|
|
1128
|
-
d(this,
|
|
1129
|
+
d(this, ee, /* @__PURE__ */ h(() => {
|
|
1129
1130
|
y(this, Y, []);
|
|
1130
1131
|
const i = t(this, _).template || [];
|
|
1131
1132
|
Array.from(i).forEach((e) => {
|
|
@@ -1172,7 +1173,7 @@ const W = class W {
|
|
|
1172
1173
|
var i;
|
|
1173
1174
|
t(this, T).rawRecords = [], y(this, N, []), y(this, dt, []), (i = t(this, T).viewRecords) != null && i.reset && t(this, T).viewRecords.reset();
|
|
1174
1175
|
}, "clear"));
|
|
1175
|
-
d(this,
|
|
1176
|
+
d(this, se, /* @__PURE__ */ h((i) => {
|
|
1176
1177
|
var r;
|
|
1177
1178
|
Array.isArray(i) || (i = [i]);
|
|
1178
1179
|
const e = typeof ((r = t(this, _).fields) == null ? void 0 : r.get) == "function" ? t(this, _).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
@@ -1183,13 +1184,13 @@ const W = class W {
|
|
|
1183
1184
|
}), s.push(o);
|
|
1184
1185
|
}), s;
|
|
1185
1186
|
}, "#json2Array"));
|
|
1186
|
-
d(this,
|
|
1187
|
+
d(this, ie, /* @__PURE__ */ h((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1187
1188
|
e.__ng = t(this, Ct).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = W.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1188
1189
|
}), i), "#defaultInsert"));
|
|
1189
1190
|
A(this, "add", /* @__PURE__ */ h((i, e = !0) => {
|
|
1190
1191
|
i === void 0 && (i = {});
|
|
1191
|
-
const s = t(this,
|
|
1192
|
-
t(this, T).rawRecords = t(this, T).rawRecords.concat(t(this,
|
|
1192
|
+
const s = t(this, se).call(this, i);
|
|
1193
|
+
t(this, T).rawRecords = t(this, T).rawRecords.concat(t(this, ie).call(this, s)), this.resetRecords();
|
|
1193
1194
|
const r = this.count() - 1;
|
|
1194
1195
|
return e || s.forEach((n, o) => {
|
|
1195
1196
|
const a = t(this, T).rawRecords[r - o];
|
|
@@ -1237,7 +1238,7 @@ const W = class W {
|
|
|
1237
1238
|
return e ? n[0] : n;
|
|
1238
1239
|
}, "#conv"));
|
|
1239
1240
|
A(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1240
|
-
y(this, _, i), y(this, T, e), t(this,
|
|
1241
|
+
y(this, _, i), y(this, T, e), t(this, ee).call(this);
|
|
1241
1242
|
}
|
|
1242
1243
|
get source() {
|
|
1243
1244
|
return t(this, ft).call(this, t(this, T).rawRecords);
|
|
@@ -1246,7 +1247,7 @@ const W = class W {
|
|
|
1246
1247
|
this.clear(), this.add(i, !1);
|
|
1247
1248
|
}
|
|
1248
1249
|
get nextId() {
|
|
1249
|
-
return ++
|
|
1250
|
+
return ++Ke(this, te)._;
|
|
1250
1251
|
}
|
|
1251
1252
|
get length() {
|
|
1252
1253
|
return t(this, N).length;
|
|
@@ -1255,7 +1256,7 @@ const W = class W {
|
|
|
1255
1256
|
return this.length;
|
|
1256
1257
|
}
|
|
1257
1258
|
};
|
|
1258
|
-
_ = new WeakMap(), T = new WeakMap(), N = new WeakMap(), dt = new WeakMap(),
|
|
1259
|
+
_ = new WeakMap(), T = new WeakMap(), N = new WeakMap(), dt = new WeakMap(), te = new WeakMap(), Y = new WeakMap(), ee = new WeakMap(), et = new WeakMap(), Ct = new WeakMap(), se = new WeakMap(), ie = new WeakMap(), ft = new WeakMap(), h(W, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1259
1260
|
A(W, "ROW_STATE", {
|
|
1260
1261
|
EMPTY: "EMPTY",
|
|
1261
1262
|
NORMAL: "NORMAL",
|
|
@@ -1263,12 +1264,12 @@ A(W, "ROW_STATE", {
|
|
|
1263
1264
|
UPDATE: "UPDATE",
|
|
1264
1265
|
DELETE: "DELETE"
|
|
1265
1266
|
});
|
|
1266
|
-
let
|
|
1267
|
+
let ye = W;
|
|
1267
1268
|
var st;
|
|
1268
|
-
const
|
|
1269
|
+
const Oe = class Oe {
|
|
1269
1270
|
constructor(i) {
|
|
1270
1271
|
d(this, st);
|
|
1271
|
-
y(this, st, i), this.row = new
|
|
1272
|
+
y(this, st, i), this.row = new be(this), this.data = new ye(t(this, st), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1272
1273
|
var e;
|
|
1273
1274
|
(e = t(this, st).view) != null && e.redraw && t(this, st).view.redraw();
|
|
1274
1275
|
}, this.setDataSource = (e) => {
|
|
@@ -1285,10 +1286,10 @@ const We = class We {
|
|
|
1285
1286
|
}, this.setDataSource([]);
|
|
1286
1287
|
}
|
|
1287
1288
|
};
|
|
1288
|
-
st = new WeakMap(), h(
|
|
1289
|
-
let
|
|
1290
|
-
var ut, L, Lt,
|
|
1291
|
-
const
|
|
1289
|
+
st = new WeakMap(), h(Oe, "ngDataManager");
|
|
1290
|
+
let pe = Oe;
|
|
1291
|
+
var ut, L, Lt, re;
|
|
1292
|
+
const Be = class Be {
|
|
1292
1293
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1293
1294
|
constructor(i) {
|
|
1294
1295
|
d(this, ut);
|
|
@@ -1304,7 +1305,7 @@ const Oe = class Oe {
|
|
|
1304
1305
|
i.set(e.name, e.type);
|
|
1305
1306
|
}), y(this, L, Array.from(i, ([e, s]) => ({ name: e, type: s }))), y(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);
|
|
1306
1307
|
}, "#adjust"));
|
|
1307
|
-
d(this,
|
|
1308
|
+
d(this, re, /* @__PURE__ */ h(() => {
|
|
1308
1309
|
y(this, L, []), yt.log(t(this, ut).querySelectorAll("table"));
|
|
1309
1310
|
const i = Array.from(t(this, ut).querySelectorAll("table"));
|
|
1310
1311
|
if (!(!i || i.length === 0)) {
|
|
@@ -1336,7 +1337,7 @@ const Oe = class Oe {
|
|
|
1336
1337
|
t(this, Lt).call(this);
|
|
1337
1338
|
}
|
|
1338
1339
|
}, "#init"));
|
|
1339
|
-
y(this, ut, i), t(this,
|
|
1340
|
+
y(this, ut, i), t(this, re).call(this);
|
|
1340
1341
|
}
|
|
1341
1342
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
1342
1343
|
get() {
|
|
@@ -1358,22 +1359,22 @@ const Oe = class Oe {
|
|
|
1358
1359
|
return t(this, L).some((e) => e.name === i);
|
|
1359
1360
|
}
|
|
1360
1361
|
};
|
|
1361
|
-
ut = new WeakMap(), L = new WeakMap(), Lt = new WeakMap(),
|
|
1362
|
-
let
|
|
1363
|
-
var it,
|
|
1364
|
-
const
|
|
1362
|
+
ut = new WeakMap(), L = new WeakMap(), Lt = new WeakMap(), re = new WeakMap(), h(Be, "ngFields");
|
|
1363
|
+
let me = Be;
|
|
1364
|
+
var it, ne, oe;
|
|
1365
|
+
const ze = class ze extends HTMLElement {
|
|
1365
1366
|
constructor() {
|
|
1366
1367
|
super();
|
|
1367
1368
|
//#created = false;
|
|
1368
1369
|
d(this, it);
|
|
1369
|
-
d(this,
|
|
1370
|
-
d(this,
|
|
1371
|
-
this.fields = new
|
|
1370
|
+
d(this, ne);
|
|
1371
|
+
d(this, oe, /* @__PURE__ */ h(() => {
|
|
1372
|
+
this.fields = new me(this), y(this, ne, new ge(this)), yt.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1372
1373
|
}, "#init"));
|
|
1373
|
-
this.attachShadow({ mode: "open" }), y(this, it, new
|
|
1374
|
+
this.attachShadow({ mode: "open" }), y(this, it, new pe(this));
|
|
1374
1375
|
}
|
|
1375
1376
|
connectedCallback() {
|
|
1376
|
-
t(this,
|
|
1377
|
+
t(this, oe).call(this);
|
|
1377
1378
|
}
|
|
1378
1379
|
disconnectedCallback() {
|
|
1379
1380
|
yt.log("NineTable disconnected.");
|
|
@@ -1391,9 +1392,9 @@ const Be = class Be extends HTMLElement {
|
|
|
1391
1392
|
return t(this, it);
|
|
1392
1393
|
}
|
|
1393
1394
|
};
|
|
1394
|
-
it = new WeakMap(),
|
|
1395
|
-
let
|
|
1396
|
-
customElements.get("nine-table") || customElements.define("nine-table",
|
|
1395
|
+
it = new WeakMap(), ne = new WeakMap(), oe = new WeakMap(), h(ze, "NineTable");
|
|
1396
|
+
let xe = ze;
|
|
1397
|
+
customElements.get("nine-table") || customElements.define("nine-table", xe);
|
|
1397
1398
|
const xt = class xt extends HTMLElement {
|
|
1398
1399
|
// π 컀μ€ν
μ€νμΌμ© μΊμ μΆκ°
|
|
1399
1400
|
constructor() {
|
|
@@ -1406,18 +1407,18 @@ const xt = class xt extends HTMLElement {
|
|
|
1406
1407
|
}
|
|
1407
1408
|
};
|
|
1408
1409
|
h(xt, "BasicCellElement"), A(xt, "_styleCache", /* @__PURE__ */ new Map()), A(xt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1409
|
-
let
|
|
1410
|
-
var C, Ht, p,
|
|
1411
|
-
const
|
|
1410
|
+
let ve = xt;
|
|
1411
|
+
var C, Ht, p, qe, Re, ke, Te, Ce;
|
|
1412
|
+
const De = class De extends ve {
|
|
1412
1413
|
constructor() {
|
|
1413
1414
|
super();
|
|
1414
1415
|
d(this, C);
|
|
1415
1416
|
d(this, Ht);
|
|
1416
1417
|
d(this, p);
|
|
1417
|
-
d(this, Ae);
|
|
1418
1418
|
d(this, qe);
|
|
1419
1419
|
d(this, Re);
|
|
1420
1420
|
d(this, ke);
|
|
1421
|
+
d(this, Te);
|
|
1421
1422
|
A(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1422
1423
|
if (t(this, p))
|
|
1423
1424
|
if (t(this, p).closest("tbody")) {
|
|
@@ -1438,7 +1439,7 @@ const ze = class ze extends xe {
|
|
|
1438
1439
|
} catch {
|
|
1439
1440
|
}
|
|
1440
1441
|
}, "getDisplayText"));
|
|
1441
|
-
d(this,
|
|
1442
|
+
d(this, Ce, /* @__PURE__ */ h(() => {
|
|
1442
1443
|
if (!(!t(this, C) || !t(this, C).template || !t(this, p).closest("tbody.bindable"))) {
|
|
1443
1444
|
var e = ninegrid.j.querySelectorAll(t(this, p)).attr("suppress");
|
|
1444
1445
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
@@ -1502,9 +1503,9 @@ const ze = class ze extends xe {
|
|
|
1502
1503
|
return t(this, p).dataset.bind, parseInt(t(this, p).dataset.row), t(this, Ht).data, t(this, p).dataset.row;
|
|
1503
1504
|
}
|
|
1504
1505
|
};
|
|
1505
|
-
C = new WeakMap(), Ht = new WeakMap(), p = new WeakMap(),
|
|
1506
|
-
let
|
|
1507
|
-
const
|
|
1506
|
+
C = new WeakMap(), Ht = new WeakMap(), p = new WeakMap(), qe = new WeakMap(), Re = new WeakMap(), ke = new WeakMap(), Te = new WeakMap(), Ce = new WeakMap(), h(De, "CellElement");
|
|
1507
|
+
let we = De;
|
|
1508
|
+
const Pe = class Pe extends we {
|
|
1508
1509
|
constructor() {
|
|
1509
1510
|
super();
|
|
1510
1511
|
}
|
|
@@ -1515,17 +1516,17 @@ const De = class De extends ve {
|
|
|
1515
1516
|
return super.refresh();
|
|
1516
1517
|
}
|
|
1517
1518
|
};
|
|
1518
|
-
h(
|
|
1519
|
-
let
|
|
1520
|
-
var Mt, rt, gt, bt,
|
|
1521
|
-
const
|
|
1519
|
+
h(Pe, "EditableCellElement");
|
|
1520
|
+
let Se = Pe;
|
|
1521
|
+
var Mt, rt, gt, bt, ae, V, Le;
|
|
1522
|
+
const je = class je extends Se {
|
|
1522
1523
|
constructor() {
|
|
1523
1524
|
super();
|
|
1524
1525
|
d(this, Mt);
|
|
1525
1526
|
d(this, rt);
|
|
1526
1527
|
d(this, gt);
|
|
1527
1528
|
d(this, bt);
|
|
1528
|
-
d(this,
|
|
1529
|
+
d(this, ae);
|
|
1529
1530
|
d(this, V);
|
|
1530
1531
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
1531
1532
|
const e = super.refresh();
|
|
@@ -1561,7 +1562,7 @@ const Pe = class Pe extends we {
|
|
|
1561
1562
|
if (!v) this.reset();
|
|
1562
1563
|
};
|
|
1563
1564
|
*/
|
|
1564
|
-
d(this,
|
|
1565
|
+
d(this, Le, /* @__PURE__ */ h((e) => {
|
|
1565
1566
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1566
1567
|
if (t(this, rt) == "number") {
|
|
1567
1568
|
let n = [];
|
|
@@ -1576,7 +1577,7 @@ const Pe = class Pe extends we {
|
|
|
1576
1577
|
t(this, gt) && ninegrid.getByteLength(e.target.value) >= Number(t(this, gt)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1577
1578
|
}
|
|
1578
1579
|
}, "#onKeyDown"));
|
|
1579
|
-
if (this.applyBaseStyle(), y(this, rt, this.getAttribute("type") || "text"), y(this, gt, this.getAttribute("maxbyte")), y(this, bt, this.getAttribute("min")), y(this,
|
|
1580
|
+
if (this.applyBaseStyle(), y(this, rt, this.getAttribute("type") || "text"), y(this, gt, this.getAttribute("maxbyte")), y(this, bt, this.getAttribute("min")), y(this, ae, this.getAttribute("max")), y(this, V, this.getAttribute("scale")), !["text", "number"].includes(t(this, rt))) throw `invalid type : ${t(this, rt)}`;
|
|
1580
1581
|
}
|
|
1581
1582
|
connectedCallback() {
|
|
1582
1583
|
for (var e = [], s = 0; s < this.attributes.length; s++)
|
|
@@ -1589,8 +1590,8 @@ const Pe = class Pe extends we {
|
|
|
1589
1590
|
`, super.connectedCallback(), y(this, Mt, this.querySelector("input"));
|
|
1590
1591
|
}
|
|
1591
1592
|
};
|
|
1592
|
-
Mt = new WeakMap(), rt = new WeakMap(), gt = new WeakMap(), bt = new WeakMap(),
|
|
1593
|
-
let
|
|
1593
|
+
Mt = new WeakMap(), rt = new WeakMap(), gt = new WeakMap(), bt = new WeakMap(), ae = new WeakMap(), V = new WeakMap(), Le = new WeakMap(), h(je, "CellInputText");
|
|
1594
|
+
let Ee = je;
|
|
1594
1595
|
customElements.get("cell-input-text");
|
|
1595
|
-
customElements.get("cell-input") || customElements.define("cell-input",
|
|
1596
|
+
customElements.get("cell-input") || customElements.define("cell-input", Ee);
|
|
1596
1597
|
//# sourceMappingURL=nine-table.js.map
|