@ninebone/table 0.0.447 β 0.0.448
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 +101 -101
- 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
|
@@ -21,9 +21,9 @@ const Ce = class Ce extends Ye.constructor {
|
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
c(Ce, "Trace");
|
|
24
|
-
let
|
|
25
|
-
const rt = new
|
|
26
|
-
var B, z, w, U, X, K,
|
|
24
|
+
let re = Ce;
|
|
25
|
+
const rt = new re();
|
|
26
|
+
var B, z, w, U, X, K, $t, Z, Mt;
|
|
27
27
|
const Te = class Te extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
@@ -33,7 +33,7 @@ const Te = class Te extends HTMLElement {
|
|
|
33
33
|
d(this, U);
|
|
34
34
|
d(this, X);
|
|
35
35
|
d(this, K);
|
|
36
|
-
d(this,
|
|
36
|
+
d(this, $t, /* @__PURE__ */ c(() => {
|
|
37
37
|
if (!t(this, B)) return;
|
|
38
38
|
const e = t(this, B).querySelector(".ng-container-body .ng-part-body");
|
|
39
39
|
e && (y(this, K, new ResizeObserver(() => {
|
|
@@ -73,7 +73,7 @@ const Te = class Te extends HTMLElement {
|
|
|
73
73
|
const l = s.clientWidth, u = n.scrollWidth - l;
|
|
74
74
|
return h > 0 && u > 0 && (s.scrollLeft = a / h * u), a > 0 && a < h - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
d(this,
|
|
76
|
+
d(this, Mt, /* @__PURE__ */ c(() => {
|
|
77
77
|
const e = /* @__PURE__ */ c((n) => {
|
|
78
78
|
clearInterval(t(this, U)), clearInterval(t(this, X));
|
|
79
79
|
const r = parseInt(t(this, w).thumb.style.left || 0, 10);
|
|
@@ -190,7 +190,7 @@ const Te = class Te extends HTMLElement {
|
|
|
190
190
|
right: this.querySelector(".ng-scroll-right")
|
|
191
191
|
}), s.addEventListener("scroll", () => {
|
|
192
192
|
t(this, z) || this.refresh();
|
|
193
|
-
}), t(this,
|
|
193
|
+
}), t(this, Mt).call(this), t(this, $t).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
@@ -198,10 +198,10 @@ const Te = class Te extends HTMLElement {
|
|
|
198
198
|
t(this, K) && t(this, K).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
B = new WeakMap(), z = new WeakMap(), w = new WeakMap(), U = new WeakMap(), X = new WeakMap(), K = new WeakMap(),
|
|
202
|
-
let
|
|
203
|
-
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar",
|
|
204
|
-
var j, ot, G, q, xt, vt,
|
|
201
|
+
B = new WeakMap(), z = new WeakMap(), w = new WeakMap(), U = new WeakMap(), X = new WeakMap(), K = new WeakMap(), $t = new WeakMap(), Z = new WeakMap(), Mt = new WeakMap(), c(Te, "NineTableHScrollBar");
|
|
202
|
+
let oe = Te;
|
|
203
|
+
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", oe);
|
|
204
|
+
var j, ot, G, q, xt, vt, It;
|
|
205
205
|
const Le = class Le extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
@@ -229,7 +229,7 @@ const Le = class Le extends HTMLElement {
|
|
|
229
229
|
const v = f - u;
|
|
230
230
|
m < 0 && (m = 0), m > v && (m = v), n.style.top = `${m}px`, t(this, q).top.disabled = b <= 0, t(this, q).bottom.disabled = b >= g - 1;
|
|
231
231
|
}, "refresh"));
|
|
232
|
-
d(this,
|
|
232
|
+
d(this, It, /* @__PURE__ */ c(() => {
|
|
233
233
|
const e = t(this, q).container, s = /* @__PURE__ */ c(() => {
|
|
234
234
|
const r = (t(this, j).data.get() || []).length, o = t(this, ot).getRowHeight();
|
|
235
235
|
return r * o;
|
|
@@ -345,15 +345,15 @@ const Le = class Le extends HTMLElement {
|
|
|
345
345
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
346
346
|
top: this.querySelector(".ng-scroll-top"),
|
|
347
347
|
bottom: this.querySelector(".ng-scroll-bottom")
|
|
348
|
-
}), t(this,
|
|
348
|
+
}), t(this, It).call(this), this.refresh();
|
|
349
349
|
}, "initWhenReady");
|
|
350
350
|
e();
|
|
351
351
|
}
|
|
352
352
|
};
|
|
353
|
-
j = new WeakMap(), ot = new WeakMap(), G = new WeakMap(), q = new WeakMap(), xt = new WeakMap(), vt = new WeakMap(),
|
|
354
|
-
let
|
|
355
|
-
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar",
|
|
356
|
-
var D, A, P, H, F, J, wt, at, Nt, Wt,
|
|
353
|
+
j = new WeakMap(), ot = new WeakMap(), G = new WeakMap(), q = new WeakMap(), xt = new WeakMap(), vt = new WeakMap(), It = new WeakMap(), c(Le, "NineTableVScrollBar");
|
|
354
|
+
let ae = Le;
|
|
355
|
+
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", ae);
|
|
356
|
+
var D, A, P, H, F, J, wt, at, _t, Nt, Wt, St, Et, Ot, Bt, At, Pt, lt, Rt, Dt;
|
|
357
357
|
const He = class He {
|
|
358
358
|
constructor(i) {
|
|
359
359
|
d(this, D);
|
|
@@ -364,7 +364,7 @@ const He = class He {
|
|
|
364
364
|
d(this, J, 0);
|
|
365
365
|
d(this, wt, 40);
|
|
366
366
|
d(this, at, !1);
|
|
367
|
-
d(this,
|
|
367
|
+
d(this, _t, 3);
|
|
368
368
|
S(this, "refresh", /* @__PURE__ */ c(() => {
|
|
369
369
|
var e;
|
|
370
370
|
const i = t(this, A).querySelector(".ng-container-body .ng-part-body");
|
|
@@ -383,7 +383,7 @@ const He = class He {
|
|
|
383
383
|
});
|
|
384
384
|
const i = t(this, A).querySelector(".ng-container-body .ng-part-body"), e = t(this, A).querySelector(".ng-container-left .ng-part-body"), s = t(this, A).querySelector(".ng-container-right .ng-part-body");
|
|
385
385
|
if (i) {
|
|
386
|
-
t(this,
|
|
386
|
+
t(this, Wt).call(this, i), t(this, At).call(this), t(this, St).call(this), t(this, lt).call(this, i.scrollTop);
|
|
387
387
|
let n = !1;
|
|
388
388
|
const r = /* @__PURE__ */ c((o, a) => {
|
|
389
389
|
var h;
|
|
@@ -396,7 +396,7 @@ const He = class He {
|
|
|
396
396
|
});
|
|
397
397
|
}
|
|
398
398
|
}, "initialize"));
|
|
399
|
-
d(this,
|
|
399
|
+
d(this, Nt, /* @__PURE__ */ c((i, e) => {
|
|
400
400
|
const s = t(this, P).get(e);
|
|
401
401
|
if (!s || s.length === 0) return;
|
|
402
402
|
const n = i.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
@@ -409,7 +409,7 @@ const He = class He {
|
|
|
409
409
|
});
|
|
410
410
|
r ? r.before(o) : n.appendChild(o);
|
|
411
411
|
}, "#renderRows"));
|
|
412
|
-
d(this,
|
|
412
|
+
d(this, Wt, /* @__PURE__ */ c((i) => {
|
|
413
413
|
if (t(this, H) !== null && t(this, H) > 0)
|
|
414
414
|
return t(this, H);
|
|
415
415
|
const e = t(this, P).get(".ng-container-body");
|
|
@@ -441,10 +441,10 @@ const He = class He {
|
|
|
441
441
|
d(this, Et, /* @__PURE__ */ c(() => {
|
|
442
442
|
if (t(this, J) > 0 && t(this, H) > 0) {
|
|
443
443
|
const i = Math.ceil(t(this, J) / t(this, H));
|
|
444
|
-
y(this, wt, i + t(this,
|
|
444
|
+
y(this, wt, i + t(this, _t));
|
|
445
445
|
}
|
|
446
446
|
}, "#updateRowCount"));
|
|
447
|
-
d(this,
|
|
447
|
+
d(this, Ot, /* @__PURE__ */ c(() => {
|
|
448
448
|
var a, h, l, f, u, b;
|
|
449
449
|
const i = t(this, A).querySelector(".ng-container-left .ng-part-body table"), e = t(this, A).querySelector(".ng-container-body .ng-part-body table"), s = t(this, A).querySelector(".ng-container-right .ng-part-body table");
|
|
450
450
|
if (e) {
|
|
@@ -471,7 +471,7 @@ const He = class He {
|
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
473
|
}, "#syncRowHeights"));
|
|
474
|
-
d(this,
|
|
474
|
+
d(this, Bt, /* @__PURE__ */ c(() => {
|
|
475
475
|
!t(this, A) || !(t(this, A) instanceof HTMLElement) || (y(this, F, new ResizeObserver((i) => {
|
|
476
476
|
for (const e of i) {
|
|
477
477
|
const s = e.target;
|
|
@@ -490,10 +490,10 @@ const He = class He {
|
|
|
490
490
|
d(this, At, /* @__PURE__ */ c(() => {
|
|
491
491
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
492
492
|
const e = t(this, A).querySelector(i);
|
|
493
|
-
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this,
|
|
494
|
-
}), t(this,
|
|
493
|
+
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Nt).call(this, e, i);
|
|
494
|
+
}), t(this, Dt).call(this), t(this, Ot).call(this);
|
|
495
495
|
}, "#renderAllContainers"));
|
|
496
|
-
d(this,
|
|
496
|
+
d(this, Pt, /* @__PURE__ */ c((i) => {
|
|
497
497
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
498
498
|
var l;
|
|
499
499
|
const s = t(this, A).querySelector(e);
|
|
@@ -532,7 +532,7 @@ const He = class He {
|
|
|
532
532
|
g.style.display = "", t(this, Rt).call(this, g, E, v);
|
|
533
533
|
});
|
|
534
534
|
}), t(this, at) || (y(this, at, !0), setTimeout(() => {
|
|
535
|
-
t(this,
|
|
535
|
+
t(this, Pt).call(this, r), y(this, at, !1);
|
|
536
536
|
}, 0));
|
|
537
537
|
}, "#handleScroll"));
|
|
538
538
|
/**
|
|
@@ -556,7 +556,7 @@ const He = class He {
|
|
|
556
556
|
o && typeof o.reset == "function" && o.reset();
|
|
557
557
|
});
|
|
558
558
|
}, "#bindRowData"));
|
|
559
|
-
d(this,
|
|
559
|
+
d(this, Dt, /* @__PURE__ */ c(() => {
|
|
560
560
|
var h, l, f;
|
|
561
561
|
const i = t(this, A).querySelector(".ng-container-left .ng-part-header table"), e = t(this, A).querySelector(".ng-container-body .ng-part-header table"), s = t(this, A).querySelector(".ng-container-right .ng-part-header table");
|
|
562
562
|
if (!e) return;
|
|
@@ -573,7 +573,7 @@ const He = class He {
|
|
|
573
573
|
S(this, "destroy", /* @__PURE__ */ c(() => {
|
|
574
574
|
t(this, F) && (t(this, F).disconnect(), y(this, F, null));
|
|
575
575
|
}, "destroy"));
|
|
576
|
-
y(this, D, i.getRootNode().host), y(this, A, i), t(this,
|
|
576
|
+
y(this, D, i.getRootNode().host), y(this, A, i), t(this, Bt).call(this);
|
|
577
577
|
}
|
|
578
578
|
getRowHeight() {
|
|
579
579
|
return t(this, H);
|
|
@@ -583,14 +583,14 @@ const He = class He {
|
|
|
583
583
|
return ((e = t(this, P).get(i)) == null ? void 0 : e.length) || 1;
|
|
584
584
|
}
|
|
585
585
|
};
|
|
586
|
-
D = new WeakMap(), A = new WeakMap(), P = new WeakMap(), H = new WeakMap(), F = new WeakMap(), J = new WeakMap(), wt = new WeakMap(), at = new WeakMap(),
|
|
587
|
-
let
|
|
588
|
-
const
|
|
586
|
+
D = new WeakMap(), A = new WeakMap(), P = new WeakMap(), H = new WeakMap(), F = new WeakMap(), J = new WeakMap(), wt = new WeakMap(), at = new WeakMap(), _t = new WeakMap(), Nt = new WeakMap(), Wt = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), Ot = new WeakMap(), Bt = new WeakMap(), At = new WeakMap(), Pt = new WeakMap(), lt = new WeakMap(), Rt = new WeakMap(), Dt = new WeakMap(), c(He, "RowManager");
|
|
587
|
+
let le = He;
|
|
588
|
+
const zt = class zt {
|
|
589
589
|
/**
|
|
590
590
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
591
591
|
*/
|
|
592
592
|
static compileAll(i) {
|
|
593
|
-
return Array.isArray(i) ? i.map((e) =>
|
|
593
|
+
return Array.isArray(i) ? i.map((e) => zt.compile(e)) : [];
|
|
594
594
|
}
|
|
595
595
|
/**
|
|
596
596
|
* π― λ¨μΌ μλ³Έ ν
μ΄λΈμ λ°μ κΈ°λ³Έ ꡬ쑰 보μ λ° 2μ°¨μ 격μ μΈλ±μ€ μ¬μ λΆμ¬ μλ£λ λ§μ€ν° ν
μ΄λΈ λ°ν
|
|
@@ -662,20 +662,20 @@ const jt = class jt {
|
|
|
662
662
|
}
|
|
663
663
|
// π― [μΆκ°] td/thμ μ μΈλ cell-type μμ±μ μ½μ΄ 컀μ€ν
νκ·Έλ‘ μλ κ°μΈκΈ°
|
|
664
664
|
};
|
|
665
|
-
c(
|
|
666
|
-
let
|
|
667
|
-
var
|
|
665
|
+
c(zt, "TableCompiler");
|
|
666
|
+
let ce = zt;
|
|
667
|
+
var jt, Q, tt, Ft, Vt, ct, Yt, Ut;
|
|
668
668
|
const pt = class pt extends HTMLElement {
|
|
669
669
|
constructor() {
|
|
670
670
|
super();
|
|
671
|
-
d(this,
|
|
671
|
+
d(this, jt);
|
|
672
672
|
d(this, Q, null);
|
|
673
673
|
d(this, tt);
|
|
674
674
|
S(this, "invalidate", /* @__PURE__ */ c(() => {
|
|
675
675
|
var e, s;
|
|
676
676
|
t(this, tt).refresh(), (e = this.querySelector("nine-table-hscrollbar")) == null || e.refresh(), (s = this.querySelector("nine-table-vscrollbar")) == null || s.refresh();
|
|
677
677
|
}, "invalidate"));
|
|
678
|
-
d(this,
|
|
678
|
+
d(this, Ft, /* @__PURE__ */ c(() => {
|
|
679
679
|
[
|
|
680
680
|
{ selector: ".ng-container-body", type: null },
|
|
681
681
|
{ selector: ".ng-container-left", type: "left" },
|
|
@@ -696,7 +696,7 @@ const pt = class pt extends HTMLElement {
|
|
|
696
696
|
f.className = "ng-part-footer", f.appendChild(t(this, ct).call(this, t(this, Q), n, "footer")), r.appendChild(o), r.appendChild(a), r.appendChild(f);
|
|
697
697
|
});
|
|
698
698
|
}, "#renderSplitContainers"));
|
|
699
|
-
d(this,
|
|
699
|
+
d(this, Vt, /* @__PURE__ */ c(() => {
|
|
700
700
|
["left", "right", "body"].forEach((e) => {
|
|
701
701
|
const s = this.querySelector(`.ng-container-${e}`), n = s == null ? void 0 : s.querySelectorAll("table");
|
|
702
702
|
if (!s || !n || n.length === 0) return;
|
|
@@ -708,7 +708,7 @@ const pt = class pt extends HTMLElement {
|
|
|
708
708
|
});
|
|
709
709
|
}, "#updateContainerWidths"));
|
|
710
710
|
S(this, "generate", /* @__PURE__ */ c((e) => {
|
|
711
|
-
e && (y(this, Q,
|
|
711
|
+
e && (y(this, Q, ce.compile(e)), t(this, Ft).call(this), t(this, Vt).call(this), t(this, tt).initialize(), setTimeout(() => {
|
|
712
712
|
var s;
|
|
713
713
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
714
714
|
}, 0));
|
|
@@ -738,10 +738,10 @@ const pt = class pt extends HTMLElement {
|
|
|
738
738
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
739
739
|
s && (s.scrollTop = e);
|
|
740
740
|
}, "scrollToY"));
|
|
741
|
-
d(this,
|
|
742
|
-
t(this,
|
|
741
|
+
d(this, Yt, /* @__PURE__ */ c(() => {
|
|
742
|
+
t(this, Ut).call(this);
|
|
743
743
|
}, "#init"));
|
|
744
|
-
d(this,
|
|
744
|
+
d(this, Ut, /* @__PURE__ */ c(() => {
|
|
745
745
|
const e = pt.SCROLLBAR_SIZE;
|
|
746
746
|
this.innerHTML = `
|
|
747
747
|
<style>
|
|
@@ -884,23 +884,23 @@ const pt = class pt extends HTMLElement {
|
|
|
884
884
|
</div>
|
|
885
885
|
`;
|
|
886
886
|
}, "#render"));
|
|
887
|
-
y(this, tt, new
|
|
887
|
+
y(this, tt, new le(this)), y(this, jt, this.getRootNode().host);
|
|
888
888
|
}
|
|
889
889
|
connectedCallback() {
|
|
890
|
-
t(this,
|
|
890
|
+
t(this, Yt).call(this);
|
|
891
891
|
}
|
|
892
892
|
disconnectedCallback() {
|
|
893
893
|
this.innerHTML = "", rt.log("NineTableSheet destroyed.");
|
|
894
894
|
}
|
|
895
895
|
};
|
|
896
|
-
|
|
896
|
+
jt = new WeakMap(), Q = new WeakMap(), tt = new WeakMap(), Ft = new WeakMap(), Vt = new WeakMap(), ct = new WeakMap(), Yt = new WeakMap(), Ut = new WeakMap(), c(pt, "NineTableSheet"), S(pt, "SCROLLBAR_SIZE", 16);
|
|
897
897
|
let Ht = pt;
|
|
898
898
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", Ht);
|
|
899
|
-
var
|
|
899
|
+
var Xt, qt;
|
|
900
900
|
const $e = class $e extends HTMLElement {
|
|
901
901
|
constructor() {
|
|
902
902
|
super();
|
|
903
|
-
d(this,
|
|
903
|
+
d(this, Xt, /* @__PURE__ */ c(() => {
|
|
904
904
|
var e;
|
|
905
905
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
906
906
|
var o;
|
|
@@ -941,18 +941,18 @@ const $e = class $e extends HTMLElement {
|
|
|
941
941
|
}, "#switchSheet"));
|
|
942
942
|
}
|
|
943
943
|
connectedCallback() {
|
|
944
|
-
t(this,
|
|
944
|
+
t(this, Xt).call(this);
|
|
945
945
|
}
|
|
946
946
|
};
|
|
947
|
-
|
|
948
|
-
let
|
|
949
|
-
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets",
|
|
950
|
-
var M,
|
|
947
|
+
Xt = new WeakMap(), qt = new WeakMap(), c($e, "NineTableSheets");
|
|
948
|
+
let he = $e;
|
|
949
|
+
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", he);
|
|
950
|
+
var M, Kt, kt, Zt;
|
|
951
951
|
const Me = class Me {
|
|
952
952
|
constructor(i) {
|
|
953
953
|
d(this, M);
|
|
954
|
-
d(this,
|
|
955
|
-
t(this,
|
|
954
|
+
d(this, Kt, /* @__PURE__ */ c(() => {
|
|
955
|
+
t(this, Zt).call(this), new ResizeObserver((i) => {
|
|
956
956
|
for (let e of i)
|
|
957
957
|
t(this, M).getAttribute("auto-height") === "true" && t(this, kt).call(this);
|
|
958
958
|
}).observe(t(this, M));
|
|
@@ -964,7 +964,7 @@ const Me = class Me {
|
|
|
964
964
|
const e = parseInt(t(this, M).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), n = (h = t(this, M).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : h.getBoundingClientRect().height, r = (l = t(this, M).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = Ht.SCROLLBAR_SIZE, a = e * s + n + r + o;
|
|
965
965
|
t(this, M).style.height = `${a}px`;
|
|
966
966
|
}, "#applyAutoHeight"));
|
|
967
|
-
d(this,
|
|
967
|
+
d(this, Zt, /* @__PURE__ */ c(() => {
|
|
968
968
|
const e = Array.from(t(this, M).children).filter((h) => h.tagName === "TABLE"), s = t(this, M).getAttribute("auto-height") === "true", n = e.length, r = e.map((h, l) => {
|
|
969
969
|
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, b = l < n - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
970
970
|
return u + b;
|
|
@@ -1067,11 +1067,11 @@ const Me = class Me {
|
|
|
1067
1067
|
});
|
|
1068
1068
|
});
|
|
1069
1069
|
}, "#render"));
|
|
1070
|
-
y(this, M, i), t(this,
|
|
1070
|
+
y(this, M, i), t(this, Kt).call(this);
|
|
1071
1071
|
}
|
|
1072
1072
|
};
|
|
1073
|
-
M = new WeakMap(),
|
|
1074
|
-
let
|
|
1073
|
+
M = new WeakMap(), Kt = new WeakMap(), kt = new WeakMap(), Zt = new WeakMap(), c(Me, "LayoutManager");
|
|
1074
|
+
let de = Me;
|
|
1075
1075
|
var Ct, ht;
|
|
1076
1076
|
const Ie = class Ie {
|
|
1077
1077
|
constructor(i) {
|
|
@@ -1089,17 +1089,17 @@ const Ie = class Ie {
|
|
|
1089
1089
|
}
|
|
1090
1090
|
};
|
|
1091
1091
|
Ct = new WeakMap(), ht = new WeakMap(), c(Ie, "ngRow");
|
|
1092
|
-
let
|
|
1093
|
-
var I, C, _, dt,
|
|
1092
|
+
let fe = Ie;
|
|
1093
|
+
var I, C, _, dt, Gt, V, Jt, et, Tt, Qt, te, ft;
|
|
1094
1094
|
const N = class N {
|
|
1095
1095
|
constructor(i, e) {
|
|
1096
1096
|
d(this, I);
|
|
1097
1097
|
d(this, C);
|
|
1098
1098
|
d(this, _, []);
|
|
1099
1099
|
d(this, dt, []);
|
|
1100
|
-
d(this,
|
|
1100
|
+
d(this, Gt, 0);
|
|
1101
1101
|
d(this, V, []);
|
|
1102
|
-
d(this,
|
|
1102
|
+
d(this, Jt, /* @__PURE__ */ c(() => {
|
|
1103
1103
|
y(this, V, []);
|
|
1104
1104
|
const i = t(this, I).template || [];
|
|
1105
1105
|
Array.from(i).forEach((e) => {
|
|
@@ -1146,7 +1146,7 @@ const N = class N {
|
|
|
1146
1146
|
var i;
|
|
1147
1147
|
t(this, C).rawRecords = [], y(this, _, []), y(this, dt, []), (i = t(this, C).viewRecords) != null && i.reset && t(this, C).viewRecords.reset();
|
|
1148
1148
|
}, "clear"));
|
|
1149
|
-
d(this,
|
|
1149
|
+
d(this, Qt, /* @__PURE__ */ c((i) => {
|
|
1150
1150
|
var n;
|
|
1151
1151
|
Array.isArray(i) || (i = [i]);
|
|
1152
1152
|
const e = typeof ((n = t(this, I).fields) == null ? void 0 : n.get) == "function" ? t(this, I).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
@@ -1157,13 +1157,13 @@ const N = class N {
|
|
|
1157
1157
|
}), s.push(o);
|
|
1158
1158
|
}), s;
|
|
1159
1159
|
}, "#json2Array"));
|
|
1160
|
-
d(this,
|
|
1160
|
+
d(this, te, /* @__PURE__ */ c((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1161
1161
|
e.__ng = t(this, Tt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = N.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1162
1162
|
}), i), "#defaultInsert"));
|
|
1163
1163
|
S(this, "add", /* @__PURE__ */ c((i, e = !0) => {
|
|
1164
1164
|
i === void 0 && (i = {});
|
|
1165
|
-
const s = t(this,
|
|
1166
|
-
t(this, C).rawRecords = t(this, C).rawRecords.concat(t(this,
|
|
1165
|
+
const s = t(this, Qt).call(this, i);
|
|
1166
|
+
t(this, C).rawRecords = t(this, C).rawRecords.concat(t(this, te).call(this, s)), this.resetRecords();
|
|
1167
1167
|
const n = this.count() - 1;
|
|
1168
1168
|
return e || s.forEach((r, o) => {
|
|
1169
1169
|
const a = t(this, C).rawRecords[n - o];
|
|
@@ -1211,7 +1211,7 @@ const N = class N {
|
|
|
1211
1211
|
return e ? r[0] : r;
|
|
1212
1212
|
}, "#conv"));
|
|
1213
1213
|
S(this, "count", /* @__PURE__ */ c(() => this.getValidData().length, "count"));
|
|
1214
|
-
y(this, I, i), y(this, C, e), t(this,
|
|
1214
|
+
y(this, I, i), y(this, C, e), t(this, Jt).call(this);
|
|
1215
1215
|
}
|
|
1216
1216
|
get source() {
|
|
1217
1217
|
return t(this, ft).call(this, t(this, C).rawRecords);
|
|
@@ -1220,7 +1220,7 @@ const N = class N {
|
|
|
1220
1220
|
this.clear(), this.add(i, !1);
|
|
1221
1221
|
}
|
|
1222
1222
|
get nextId() {
|
|
1223
|
-
return ++Fe(this,
|
|
1223
|
+
return ++Fe(this, Gt)._;
|
|
1224
1224
|
}
|
|
1225
1225
|
get length() {
|
|
1226
1226
|
return t(this, _).length;
|
|
@@ -1229,7 +1229,7 @@ const N = class N {
|
|
|
1229
1229
|
return this.length;
|
|
1230
1230
|
}
|
|
1231
1231
|
};
|
|
1232
|
-
I = new WeakMap(), C = new WeakMap(), _ = new WeakMap(), dt = new WeakMap(),
|
|
1232
|
+
I = new WeakMap(), C = new WeakMap(), _ = new WeakMap(), dt = new WeakMap(), Gt = new WeakMap(), V = new WeakMap(), Jt = new WeakMap(), et = new WeakMap(), Tt = new WeakMap(), Qt = new WeakMap(), te = new WeakMap(), ft = new WeakMap(), c(N, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1233
1233
|
S(N, "ROW_STATE", {
|
|
1234
1234
|
EMPTY: "EMPTY",
|
|
1235
1235
|
NORMAL: "NORMAL",
|
|
@@ -1237,12 +1237,12 @@ S(N, "ROW_STATE", {
|
|
|
1237
1237
|
UPDATE: "UPDATE",
|
|
1238
1238
|
DELETE: "DELETE"
|
|
1239
1239
|
});
|
|
1240
|
-
let
|
|
1240
|
+
let ue = N;
|
|
1241
1241
|
var st;
|
|
1242
1242
|
const _e = class _e {
|
|
1243
1243
|
constructor(i) {
|
|
1244
1244
|
d(this, st);
|
|
1245
|
-
y(this, st, i), this.row = new
|
|
1245
|
+
y(this, st, i), this.row = new fe(this), this.data = new ue(t(this, st), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1246
1246
|
var e;
|
|
1247
1247
|
(e = t(this, st).view) != null && e.redraw && t(this, st).view.redraw();
|
|
1248
1248
|
}, this.setDataSource = (e) => {
|
|
@@ -1260,8 +1260,8 @@ const _e = class _e {
|
|
|
1260
1260
|
}
|
|
1261
1261
|
};
|
|
1262
1262
|
st = new WeakMap(), c(_e, "ngDataManager");
|
|
1263
|
-
let
|
|
1264
|
-
var ut, L, Lt,
|
|
1263
|
+
let ge = _e;
|
|
1264
|
+
var ut, L, Lt, ee;
|
|
1265
1265
|
const Ne = class Ne {
|
|
1266
1266
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1267
1267
|
constructor(i) {
|
|
@@ -1278,7 +1278,7 @@ const Ne = class Ne {
|
|
|
1278
1278
|
i.set(e.name, e.type);
|
|
1279
1279
|
}), 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);
|
|
1280
1280
|
}, "#adjust"));
|
|
1281
|
-
d(this,
|
|
1281
|
+
d(this, ee, /* @__PURE__ */ c(() => {
|
|
1282
1282
|
y(this, L, []), rt.log(t(this, ut).querySelectorAll("table"));
|
|
1283
1283
|
const i = Array.from(t(this, ut).querySelectorAll("table"));
|
|
1284
1284
|
if (!(!i || i.length === 0)) {
|
|
@@ -1310,7 +1310,7 @@ const Ne = class Ne {
|
|
|
1310
1310
|
t(this, Lt).call(this);
|
|
1311
1311
|
}
|
|
1312
1312
|
}, "#init"));
|
|
1313
|
-
y(this, ut, i), t(this,
|
|
1313
|
+
y(this, ut, i), t(this, ee).call(this);
|
|
1314
1314
|
}
|
|
1315
1315
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
1316
1316
|
get() {
|
|
@@ -1332,22 +1332,22 @@ const Ne = class Ne {
|
|
|
1332
1332
|
return t(this, L).some((e) => e.name === i);
|
|
1333
1333
|
}
|
|
1334
1334
|
};
|
|
1335
|
-
ut = new WeakMap(), L = new WeakMap(), Lt = new WeakMap(),
|
|
1336
|
-
let
|
|
1337
|
-
var it,
|
|
1335
|
+
ut = new WeakMap(), L = new WeakMap(), Lt = new WeakMap(), ee = new WeakMap(), c(Ne, "ngFields");
|
|
1336
|
+
let be = Ne;
|
|
1337
|
+
var it, se, ie;
|
|
1338
1338
|
const We = class We extends HTMLElement {
|
|
1339
1339
|
constructor() {
|
|
1340
1340
|
super();
|
|
1341
1341
|
//#created = false;
|
|
1342
1342
|
d(this, it);
|
|
1343
|
-
d(this,
|
|
1344
|
-
d(this,
|
|
1345
|
-
this.fields = new
|
|
1343
|
+
d(this, se);
|
|
1344
|
+
d(this, ie, /* @__PURE__ */ c(() => {
|
|
1345
|
+
this.fields = new be(this), y(this, se, new de(this)), rt.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1346
1346
|
}, "#init"));
|
|
1347
|
-
this.attachShadow({ mode: "open" }), y(this, it, new
|
|
1347
|
+
this.attachShadow({ mode: "open" }), y(this, it, new ge(this));
|
|
1348
1348
|
}
|
|
1349
1349
|
connectedCallback() {
|
|
1350
|
-
t(this,
|
|
1350
|
+
t(this, ie).call(this);
|
|
1351
1351
|
}
|
|
1352
1352
|
disconnectedCallback() {
|
|
1353
1353
|
rt.log("NineTable disconnected.");
|
|
@@ -1365,9 +1365,9 @@ const We = class We extends HTMLElement {
|
|
|
1365
1365
|
return t(this, it);
|
|
1366
1366
|
}
|
|
1367
1367
|
};
|
|
1368
|
-
it = new WeakMap(),
|
|
1369
|
-
let
|
|
1370
|
-
customElements.get("nine-table") || customElements.define("nine-table",
|
|
1368
|
+
it = new WeakMap(), se = new WeakMap(), ie = new WeakMap(), c(We, "NineTable");
|
|
1369
|
+
let ye = We;
|
|
1370
|
+
customElements.get("nine-table") || customElements.define("nine-table", ye);
|
|
1371
1371
|
const mt = class mt extends HTMLElement {
|
|
1372
1372
|
// π 컀μ€ν
μ€νμΌμ© μΊμ μΆκ°
|
|
1373
1373
|
constructor() {
|
|
@@ -1378,7 +1378,7 @@ const mt = class mt extends HTMLElement {
|
|
|
1378
1378
|
if (!ngElement._styleCache.has(i)) {
|
|
1379
1379
|
const s = new CSSStyleSheet();
|
|
1380
1380
|
ngElement._styleCache.set(i, s);
|
|
1381
|
-
const n = `https://cdn.jsdelivr.net/npm/@ninebone/grid@0.0.
|
|
1381
|
+
const n = `https://cdn.jsdelivr.net/npm/@ninebone/grid@0.0.448/dist/css/${i}.css`;
|
|
1382
1382
|
fetch(n).then((r) => r.text()).then((r) => s.replaceSync(r)).catch((r) => console.error("Base CSS Load Error:", r));
|
|
1383
1383
|
}
|
|
1384
1384
|
const e = [ngElement._styleCache.get(i)];
|
|
@@ -1397,9 +1397,9 @@ const mt = class mt extends HTMLElement {
|
|
|
1397
1397
|
}
|
|
1398
1398
|
};
|
|
1399
1399
|
c(mt, "BasicCellElement"), S(mt, "_styleCache", /* @__PURE__ */ new Map()), S(mt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1400
|
-
let
|
|
1400
|
+
let pe = mt;
|
|
1401
1401
|
var k, p, we, Se, Ee, Ae, Re;
|
|
1402
|
-
const Oe = class Oe extends
|
|
1402
|
+
const Oe = class Oe extends pe {
|
|
1403
1403
|
constructor() {
|
|
1404
1404
|
super();
|
|
1405
1405
|
d(this, k);
|
|
@@ -1497,8 +1497,8 @@ const Oe = class Oe extends me {
|
|
|
1497
1497
|
}
|
|
1498
1498
|
};
|
|
1499
1499
|
k = new WeakMap(), p = new WeakMap(), we = new WeakMap(), Se = new WeakMap(), Ee = new WeakMap(), Ae = new WeakMap(), Re = new WeakMap(), c(Oe, "CellElement");
|
|
1500
|
-
let
|
|
1501
|
-
const Be = class Be extends
|
|
1500
|
+
let me = Oe;
|
|
1501
|
+
const Be = class Be extends me {
|
|
1502
1502
|
constructor() {
|
|
1503
1503
|
super();
|
|
1504
1504
|
}
|
|
@@ -1507,16 +1507,16 @@ const Be = class Be extends xe {
|
|
|
1507
1507
|
}
|
|
1508
1508
|
};
|
|
1509
1509
|
c(Be, "EditableCellElement");
|
|
1510
|
-
let
|
|
1511
|
-
var qe, nt, gt, bt,
|
|
1512
|
-
const Pe = class Pe extends
|
|
1510
|
+
let xe = Be;
|
|
1511
|
+
var qe, nt, gt, bt, ne, Y, ke;
|
|
1512
|
+
const Pe = class Pe extends xe {
|
|
1513
1513
|
constructor() {
|
|
1514
1514
|
super();
|
|
1515
1515
|
d(this, qe);
|
|
1516
1516
|
d(this, nt);
|
|
1517
1517
|
d(this, gt);
|
|
1518
1518
|
d(this, bt);
|
|
1519
|
-
d(this,
|
|
1519
|
+
d(this, ne);
|
|
1520
1520
|
d(this, Y);
|
|
1521
1521
|
/**
|
|
1522
1522
|
dataRefresh = (v) => {
|
|
@@ -1563,7 +1563,7 @@ const Pe = class Pe extends ve {
|
|
|
1563
1563
|
t(this, gt) && ninegrid.getByteLength(e.target.value) >= Number(t(this, gt)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1564
1564
|
}
|
|
1565
1565
|
}, "#onKeyDown"));
|
|
1566
|
-
if (this.applyBaseStyle(), y(this, nt, this.getAttribute("type") || "text"), y(this, gt, this.getAttribute("maxbyte")), y(this, bt, this.getAttribute("min")), y(this,
|
|
1566
|
+
if (this.applyBaseStyle(), y(this, nt, this.getAttribute("type") || "text"), y(this, gt, this.getAttribute("maxbyte")), y(this, bt, this.getAttribute("min")), y(this, ne, this.getAttribute("max")), y(this, Y, this.getAttribute("scale")), !["text", "number"].includes(t(this, nt))) throw `invalid type : ${t(this, nt)}`;
|
|
1567
1567
|
}
|
|
1568
1568
|
connectedCallback() {
|
|
1569
1569
|
for (var e = [], s = 0; s < this.attributes.length; s++)
|
|
@@ -1576,8 +1576,8 @@ const Pe = class Pe extends ve {
|
|
|
1576
1576
|
`, super.connectedCallback();
|
|
1577
1577
|
}
|
|
1578
1578
|
};
|
|
1579
|
-
qe = new WeakMap(), nt = new WeakMap(), gt = new WeakMap(), bt = new WeakMap(),
|
|
1580
|
-
let
|
|
1581
|
-
customElements.get("cell-input-text")
|
|
1582
|
-
customElements.get("cell-input") || customElements.define("cell-input",
|
|
1579
|
+
qe = new WeakMap(), nt = new WeakMap(), gt = new WeakMap(), bt = new WeakMap(), ne = new WeakMap(), Y = new WeakMap(), ke = new WeakMap(), c(Pe, "CellInputText");
|
|
1580
|
+
let ve = Pe;
|
|
1581
|
+
customElements.get("cell-input-text");
|
|
1582
|
+
customElements.get("cell-input") || customElements.define("cell-input", ve);
|
|
1583
1583
|
//# sourceMappingURL=nine-table.js.map
|