@ninebone/table 0.0.132 β 0.0.133
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 +73 -70
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +4 -4
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var Me = Object.defineProperty;
|
|
2
|
+
var Ie = (w) => {
|
|
3
3
|
throw TypeError(w);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var c = (w, i) =>
|
|
7
|
-
var v = (w, i, t) =>
|
|
8
|
-
var e = (w, i, t) => (
|
|
9
|
-
var
|
|
5
|
+
var We = (w, i, t) => i in w ? Me(w, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : w[i] = t;
|
|
6
|
+
var c = (w, i) => Me(w, "name", { value: i, configurable: !0 });
|
|
7
|
+
var v = (w, i, t) => We(w, typeof i != "symbol" ? i + "" : i, t), $e = (w, i, t) => i.has(w) || Ie("Cannot " + t);
|
|
8
|
+
var e = (w, i, t) => ($e(w, i, "read from private field"), t ? t.call(w) : i.get(w)), f = (w, i, t) => i.has(w) ? Ie("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(w) : i.set(w, t), p = (w, i, t, s) => ($e(w, i, "write to private field"), s ? s.call(w, t) : i.set(w, t), t);
|
|
9
|
+
var He = (w, i, t, s) => ({
|
|
10
10
|
set _(n) {
|
|
11
11
|
p(w, i, n, t);
|
|
12
12
|
},
|
|
@@ -14,17 +14,17 @@ var $e = (w, i, t, s) => ({
|
|
|
14
14
|
return e(w, i, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
import { trace as
|
|
18
|
-
const
|
|
17
|
+
import { trace as ze } from "@ninebone/util";
|
|
18
|
+
const Re = class Re extends ze.constructor {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
c(
|
|
24
|
-
let
|
|
25
|
-
const j = new
|
|
23
|
+
c(Re, "Trace");
|
|
24
|
+
let be = Re;
|
|
25
|
+
const j = new be();
|
|
26
26
|
var _, O, y, B, D, N, ee, P, te;
|
|
27
|
-
const
|
|
27
|
+
const Te = class Te extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
f(this, _);
|
|
@@ -203,11 +203,11 @@ const Re = class Re extends HTMLElement {
|
|
|
203
203
|
e(this, N) && e(this, N).disconnect();
|
|
204
204
|
}
|
|
205
205
|
};
|
|
206
|
-
_ = new WeakMap(), O = new WeakMap(), y = new WeakMap(), B = new WeakMap(), D = new WeakMap(), N = new WeakMap(), ee = new WeakMap(), P = new WeakMap(), te = new WeakMap(), c(
|
|
207
|
-
let
|
|
208
|
-
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar",
|
|
209
|
-
var X, M, q, $, I, H, ie;
|
|
210
|
-
const
|
|
206
|
+
_ = new WeakMap(), O = new WeakMap(), y = new WeakMap(), B = new WeakMap(), D = new WeakMap(), N = new WeakMap(), ee = new WeakMap(), P = new WeakMap(), te = new WeakMap(), c(Te, "NineTableHScrollBar");
|
|
207
|
+
let ge = Te;
|
|
208
|
+
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ge);
|
|
209
|
+
var X, M, q, $, I, H, ie, se;
|
|
210
|
+
const qe = class qe {
|
|
211
211
|
constructor(i) {
|
|
212
212
|
f(this, X);
|
|
213
213
|
f(this, M, []);
|
|
@@ -215,10 +215,13 @@ const Te = class Te {
|
|
|
215
215
|
f(this, $, null);
|
|
216
216
|
f(this, I, 0);
|
|
217
217
|
f(this, H, 0);
|
|
218
|
+
f(this, ie, /* @__PURE__ */ c(() => {
|
|
219
|
+
e(this, se).call(this);
|
|
220
|
+
}, "#init"));
|
|
218
221
|
/**
|
|
219
222
|
* π― λ·°ν¬νΈ ν¬κΈ° λ³ν μμ μ λμ΄ κ³μ° λ° νμν ν κ°μ μ°μ Β·μΊμ±μ μκ²°
|
|
220
223
|
*/
|
|
221
|
-
f(this,
|
|
224
|
+
f(this, se, /* @__PURE__ */ c(() => {
|
|
222
225
|
!e(this, X) || !(e(this, X) instanceof HTMLElement) || (p(this, $, new ResizeObserver((i) => {
|
|
223
226
|
for (const t of i) {
|
|
224
227
|
const s = t.target;
|
|
@@ -309,9 +312,9 @@ const Te = class Te {
|
|
|
309
312
|
return e(this, M).length || 1;
|
|
310
313
|
}
|
|
311
314
|
};
|
|
312
|
-
X = new WeakMap(), M = new WeakMap(), q = new WeakMap(), $ = new WeakMap(), I = new WeakMap(), H = new WeakMap(), ie = new WeakMap(), c(
|
|
313
|
-
let
|
|
314
|
-
var A, F,
|
|
315
|
+
X = new WeakMap(), M = new WeakMap(), q = new WeakMap(), $ = new WeakMap(), I = new WeakMap(), H = new WeakMap(), ie = new WeakMap(), se = new WeakMap(), c(qe, "RowManager");
|
|
316
|
+
let pe = qe;
|
|
317
|
+
var A, F, ne;
|
|
315
318
|
const Z = class Z extends HTMLElement {
|
|
316
319
|
constructor() {
|
|
317
320
|
super();
|
|
@@ -324,8 +327,8 @@ const Z = class Z extends HTMLElement {
|
|
|
324
327
|
if (g.querySelector("colgroup")) return;
|
|
325
328
|
const d = g.querySelector("tbody tr") || g.querySelector("tr"), S = d ? d.querySelectorAll("th, td").length : 1, x = document.createElement("colgroup"), k = Math.max(Math.floor((g.clientWidth || 600) / S), 100);
|
|
326
329
|
for (let R = 0; R < S; R++) {
|
|
327
|
-
const
|
|
328
|
-
|
|
330
|
+
const ue = document.createElement("col");
|
|
331
|
+
ue.setAttribute("width", k), x.appendChild(ue);
|
|
329
332
|
}
|
|
330
333
|
g.prepend(x);
|
|
331
334
|
}, "ensureColgroup"), h = /* @__PURE__ */ c((g) => {
|
|
@@ -393,7 +396,7 @@ const Z = class Z extends HTMLElement {
|
|
|
393
396
|
const s = this.querySelector(".ng-container-body");
|
|
394
397
|
s && (s.scrollTop = t);
|
|
395
398
|
}, "scrollToY"));
|
|
396
|
-
f(this,
|
|
399
|
+
f(this, ne, /* @__PURE__ */ c(() => {
|
|
397
400
|
const t = Z.SCROLLBAR_SIZE;
|
|
398
401
|
this.innerHTML = `
|
|
399
402
|
<style>
|
|
@@ -510,23 +513,23 @@ const Z = class Z extends HTMLElement {
|
|
|
510
513
|
</div>
|
|
511
514
|
`;
|
|
512
515
|
}, "#render"));
|
|
513
|
-
p(this, F, new
|
|
516
|
+
p(this, F, new pe(this));
|
|
514
517
|
}
|
|
515
518
|
connectedCallback() {
|
|
516
|
-
e(this,
|
|
519
|
+
e(this, ne).call(this);
|
|
517
520
|
}
|
|
518
521
|
disconnectedCallback() {
|
|
519
522
|
this.innerHTML = "", j.log("NineTableSheet destroyed.");
|
|
520
523
|
}
|
|
521
524
|
};
|
|
522
|
-
A = new WeakMap(), F = new WeakMap(),
|
|
523
|
-
let
|
|
524
|
-
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet",
|
|
525
|
-
var
|
|
526
|
-
const
|
|
525
|
+
A = new WeakMap(), F = new WeakMap(), ne = new WeakMap(), c(Z, "NineTableSheet"), v(Z, "SCROLLBAR_SIZE", 16);
|
|
526
|
+
let ye = Z;
|
|
527
|
+
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", ye);
|
|
528
|
+
var re;
|
|
529
|
+
const Ce = class Ce extends HTMLElement {
|
|
527
530
|
constructor() {
|
|
528
531
|
super();
|
|
529
|
-
f(this,
|
|
532
|
+
f(this, re, /* @__PURE__ */ c(() => {
|
|
530
533
|
const t = this.querySelector(".nine-tab-bar");
|
|
531
534
|
t && (t.addEventListener("click", (s) => {
|
|
532
535
|
const n = s.target.closest(".nine-tab-item");
|
|
@@ -579,18 +582,18 @@ const qe = class qe extends HTMLElement {
|
|
|
579
582
|
}, "switchSheet"));
|
|
580
583
|
}
|
|
581
584
|
connectedCallback() {
|
|
582
|
-
e(this,
|
|
585
|
+
e(this, re).call(this);
|
|
583
586
|
}
|
|
584
587
|
};
|
|
585
|
-
|
|
586
|
-
let
|
|
587
|
-
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets",
|
|
588
|
-
var L, G,
|
|
589
|
-
const
|
|
588
|
+
re = new WeakMap(), c(Ce, "NineTableSheets");
|
|
589
|
+
let we = Ce;
|
|
590
|
+
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", we);
|
|
591
|
+
var L, G, oe, J, le;
|
|
592
|
+
const ke = class ke {
|
|
590
593
|
constructor(i) {
|
|
591
594
|
f(this, L);
|
|
592
595
|
f(this, G, null);
|
|
593
|
-
f(this,
|
|
596
|
+
f(this, oe, /* @__PURE__ */ c(() => {
|
|
594
597
|
const i = e(this, L).host;
|
|
595
598
|
i && (p(this, G, new ResizeObserver((t) => {
|
|
596
599
|
for (let s of t)
|
|
@@ -606,7 +609,7 @@ const Ce = class Ce {
|
|
|
606
609
|
const x = e(this, L).querySelector("nine-table-sheets-body");
|
|
607
610
|
x && (x.style.overflowY = s > n ? "auto" : "hidden");
|
|
608
611
|
}, "#applyAutoHeight"));
|
|
609
|
-
f(this,
|
|
612
|
+
f(this, le, /* @__PURE__ */ c(() => {
|
|
610
613
|
const i = e(this, L).host, s = Array.from(i.children).filter((u) => u.tagName === "TABLE"), n = i.getAttribute("auto-height") === "true", o = s.map((u, a) => `<nine-table-sheet class="${a === 0 ? "active" : ""}" data-index="${a}"></nine-table-sheet>`).join(""), r = s.map((u, a) => `<div class="nine-tab-item ${a === 0 ? "active" : ""}" data-index="${a}">Sheet ${a + 1}</div>`).join("");
|
|
611
614
|
e(this, L).innerHTML = `
|
|
612
615
|
<style>
|
|
@@ -713,13 +716,13 @@ const Ce = class Ce {
|
|
|
713
716
|
});
|
|
714
717
|
});
|
|
715
718
|
}, "#render"));
|
|
716
|
-
p(this, L, i), e(this,
|
|
719
|
+
p(this, L, i), e(this, le).call(this), e(this, oe).call(this);
|
|
717
720
|
}
|
|
718
721
|
};
|
|
719
|
-
L = new WeakMap(), G = new WeakMap(),
|
|
720
|
-
let
|
|
722
|
+
L = new WeakMap(), G = new WeakMap(), oe = new WeakMap(), J = new WeakMap(), le = new WeakMap(), c(ke, "LayoutManager");
|
|
723
|
+
let me = ke;
|
|
721
724
|
var W, V;
|
|
722
|
-
const
|
|
725
|
+
const Ae = class Ae {
|
|
723
726
|
constructor(i) {
|
|
724
727
|
f(this, W);
|
|
725
728
|
f(this, V, -1);
|
|
@@ -739,18 +742,18 @@ const ke = class ke {
|
|
|
739
742
|
});
|
|
740
743
|
}
|
|
741
744
|
};
|
|
742
|
-
W = new WeakMap(), V = new WeakMap(), c(
|
|
743
|
-
let
|
|
744
|
-
var E, m, C, U,
|
|
745
|
+
W = new WeakMap(), V = new WeakMap(), c(Ae, "ngRow");
|
|
746
|
+
let ve = Ae;
|
|
747
|
+
var E, m, C, U, ae, z, ce, Q, he, de, K;
|
|
745
748
|
const T = class T {
|
|
746
749
|
constructor(i, t) {
|
|
747
750
|
f(this, E);
|
|
748
751
|
f(this, m);
|
|
749
752
|
f(this, C, []);
|
|
750
753
|
f(this, U, []);
|
|
751
|
-
f(this,
|
|
754
|
+
f(this, ae, 0);
|
|
752
755
|
f(this, z, []);
|
|
753
|
-
f(this,
|
|
756
|
+
f(this, ce, /* @__PURE__ */ c(() => {
|
|
754
757
|
p(this, z, []);
|
|
755
758
|
const i = e(this, E).template || [];
|
|
756
759
|
Array.from(i).forEach((t) => {
|
|
@@ -779,7 +782,7 @@ const T = class T {
|
|
|
779
782
|
var i;
|
|
780
783
|
e(this, m).rawRecords = [], p(this, C, []), p(this, U, []), (i = e(this, m).viewRecords) != null && i.reset && e(this, m).viewRecords.reset();
|
|
781
784
|
}, "clear"));
|
|
782
|
-
f(this,
|
|
785
|
+
f(this, he, /* @__PURE__ */ c((i) => {
|
|
783
786
|
var n;
|
|
784
787
|
Array.isArray(i) || (i = [i]);
|
|
785
788
|
const t = typeof ((n = e(this, E).fields) == null ? void 0 : n.get) == "function" ? e(this, E).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
@@ -790,14 +793,14 @@ const T = class T {
|
|
|
790
793
|
}), s.push(r);
|
|
791
794
|
}), s;
|
|
792
795
|
}, "#json2Array"));
|
|
793
|
-
f(this,
|
|
796
|
+
f(this, de, /* @__PURE__ */ c((i) => (Array.isArray(i) || (i = [i]), i.forEach((t) => {
|
|
794
797
|
t.__ng = e(this, Q).call(this), t.__ng.rowid = this.nextId, t.__ng.rowState = T.ROW_STATE.INSERT, t.__ng._[0] = t.__ng.rowid;
|
|
795
798
|
}), i), "#defaultInsert"));
|
|
796
799
|
v(this, "add", /* @__PURE__ */ c((i, t = !0) => {
|
|
797
800
|
var o;
|
|
798
801
|
i === void 0 && (i = {});
|
|
799
|
-
const s = e(this,
|
|
800
|
-
e(this, m).rawRecords = e(this, m).rawRecords.concat(e(this,
|
|
802
|
+
const s = e(this, he).call(this, i);
|
|
803
|
+
e(this, m).rawRecords = e(this, m).rawRecords.concat(e(this, de).call(this, s)), this.resetRecords();
|
|
801
804
|
const n = this.count() - 1;
|
|
802
805
|
return t || s.forEach((r, l) => {
|
|
803
806
|
const u = e(this, m).rawRecords[n - l];
|
|
@@ -859,7 +862,7 @@ const T = class T {
|
|
|
859
862
|
}
|
|
860
863
|
return e(this, K).call(this, s[i]);
|
|
861
864
|
}, "get"));
|
|
862
|
-
p(this, E, i), p(this, m, t), e(this,
|
|
865
|
+
p(this, E, i), p(this, m, t), e(this, ce).call(this);
|
|
863
866
|
}
|
|
864
867
|
get source() {
|
|
865
868
|
return e(this, K).call(this, e(this, m).rawRecords);
|
|
@@ -868,10 +871,10 @@ const T = class T {
|
|
|
868
871
|
this.clear(), this.add(i, !1);
|
|
869
872
|
}
|
|
870
873
|
get nextId() {
|
|
871
|
-
return
|
|
874
|
+
return ++He(this, ae)._;
|
|
872
875
|
}
|
|
873
876
|
};
|
|
874
|
-
E = new WeakMap(), m = new WeakMap(), C = new WeakMap(), U = new WeakMap(),
|
|
877
|
+
E = new WeakMap(), m = new WeakMap(), C = new WeakMap(), U = new WeakMap(), ae = new WeakMap(), z = new WeakMap(), ce = new WeakMap(), Q = new WeakMap(), he = new WeakMap(), de = new WeakMap(), K = new WeakMap(), c(T, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
875
878
|
v(T, "ROW_STATE", {
|
|
876
879
|
EMPTY: "EMPTY",
|
|
877
880
|
NORMAL: "NORMAL",
|
|
@@ -879,10 +882,10 @@ v(T, "ROW_STATE", {
|
|
|
879
882
|
UPDATE: "UPDATE",
|
|
880
883
|
DELETE: "DELETE"
|
|
881
884
|
});
|
|
882
|
-
let
|
|
883
|
-
const
|
|
885
|
+
let xe = T;
|
|
886
|
+
const Le = class Le {
|
|
884
887
|
constructor(i) {
|
|
885
|
-
this.owner = i, this.row = new
|
|
888
|
+
this.owner = i, this.row = new ve(this), this.data = new xe(i, this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
886
889
|
var t;
|
|
887
890
|
(t = this.owner.view) != null && t.redraw && this.owner.view.redraw();
|
|
888
891
|
}, this.setDataSource = (t) => {
|
|
@@ -899,19 +902,19 @@ const Ae = class Ae {
|
|
|
899
902
|
}, this.setDataSource([]);
|
|
900
903
|
}
|
|
901
904
|
};
|
|
902
|
-
c(
|
|
903
|
-
let
|
|
904
|
-
var Y,
|
|
905
|
-
const
|
|
905
|
+
c(Le, "ngDataManager");
|
|
906
|
+
let Se = Le;
|
|
907
|
+
var Y, fe;
|
|
908
|
+
const _e = class _e extends HTMLElement {
|
|
906
909
|
constructor() {
|
|
907
910
|
super();
|
|
908
911
|
//#created = false;
|
|
909
912
|
f(this, Y);
|
|
910
|
-
f(this,
|
|
911
|
-
this.attachShadow({ mode: "open" }), p(this, Y, new
|
|
913
|
+
f(this, fe);
|
|
914
|
+
this.attachShadow({ mode: "open" }), p(this, Y, new Se(this));
|
|
912
915
|
}
|
|
913
916
|
connectedCallback() {
|
|
914
|
-
p(this,
|
|
917
|
+
p(this, fe, new me(this.shadowRoot)), j.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
915
918
|
}
|
|
916
919
|
disconnectedCallback() {
|
|
917
920
|
j.log("NineTable disconnected.");
|
|
@@ -929,7 +932,7 @@ const Le = class Le extends HTMLElement {
|
|
|
929
932
|
return e(this, Y);
|
|
930
933
|
}
|
|
931
934
|
};
|
|
932
|
-
Y = new WeakMap(),
|
|
933
|
-
let
|
|
934
|
-
customElements.get("nine-table") || customElements.define("nine-table",
|
|
935
|
+
Y = new WeakMap(), fe = new WeakMap(), c(_e, "NineTable");
|
|
936
|
+
let Ee = _e;
|
|
937
|
+
customElements.get("nine-table") || customElements.define("nine-table", Ee);
|
|
935
938
|
//# sourceMappingURL=nine-table.js.map
|