@ninebone/table 0.0.215 β 0.0.216
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 +38 -38
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +4 -4
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -22,13 +22,13 @@ const Te = class Te extends ze.constructor {
|
|
|
22
22
|
};
|
|
23
23
|
a(Te, "Trace");
|
|
24
24
|
let pe = Te;
|
|
25
|
-
const
|
|
26
|
-
var L,
|
|
25
|
+
const j = new pe();
|
|
26
|
+
var L, z, y, B, D, N, te, P, ie;
|
|
27
27
|
const Ae = class Ae extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
u(this, L);
|
|
31
|
-
u(this,
|
|
31
|
+
u(this, z, !1);
|
|
32
32
|
u(this, y);
|
|
33
33
|
u(this, B);
|
|
34
34
|
u(this, D);
|
|
@@ -41,7 +41,7 @@ const Ae = class Ae extends HTMLElement {
|
|
|
41
41
|
})), e(this, N).observe(t));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
x(this, "refresh", /* @__PURE__ */ a(() => {
|
|
44
|
-
if (
|
|
44
|
+
if (!e(this, L) || !e(this, y) || e(this, z)) return;
|
|
45
45
|
const t = e(this, y).container, s = t.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
47
|
const n = e(this, y).track, r = e(this, y).thumb, o = e(this, L).querySelector(".ng-container-bottom"), c = t.clientWidth, h = s.scrollWidth;
|
|
@@ -65,7 +65,7 @@ const Ae = class Ae extends HTMLElement {
|
|
|
65
65
|
let b = parseInt(Math.abs(f) * l / h, 10);
|
|
66
66
|
b < 0 && (b = 0);
|
|
67
67
|
const m = l - d;
|
|
68
|
-
b > m && (b = m), r.style.left = `${b}px`, e(this, y).left.disabled = b === 0, e(this, y).right.disabled = b >= m - 1;
|
|
68
|
+
b > m && (b = m), r.style.left = `${b}px`, j.log(b), e(this, y).left.disabled = b === 0, e(this, y).right.disabled = b >= m - 1;
|
|
69
69
|
}, "refresh"));
|
|
70
70
|
u(this, P, /* @__PURE__ */ a((t) => {
|
|
71
71
|
if (!e(this, y)) return !1;
|
|
@@ -106,13 +106,13 @@ const Ae = class Ae extends HTMLElement {
|
|
|
106
106
|
e(this, P).call(this, n.clientX - r.left - o / 2);
|
|
107
107
|
}), e(this, y).thumb.addEventListener("mousedown", (n) => {
|
|
108
108
|
if (n.button !== 0) return;
|
|
109
|
-
n.stopPropagation(), n.preventDefault(), p(this,
|
|
109
|
+
n.stopPropagation(), n.preventDefault(), p(this, z, !0), this.shiftX = n.clientX - e(this, y).thumb.getBoundingClientRect().left;
|
|
110
110
|
const r = /* @__PURE__ */ a((c) => {
|
|
111
|
-
if (!e(this,
|
|
111
|
+
if (!e(this, z)) return;
|
|
112
112
|
const h = e(this, y).track.getBoundingClientRect();
|
|
113
113
|
e(this, P).call(this, c.clientX - h.left - this.shiftX);
|
|
114
114
|
}, "onMouseMove"), o = /* @__PURE__ */ a(() => {
|
|
115
|
-
p(this,
|
|
115
|
+
p(this, z, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
|
|
116
116
|
}, "onMouseUp");
|
|
117
117
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", o);
|
|
118
118
|
});
|
|
@@ -203,16 +203,16 @@ const Ae = class Ae extends HTMLElement {
|
|
|
203
203
|
e(this, N) && e(this, N).disconnect();
|
|
204
204
|
}
|
|
205
205
|
};
|
|
206
|
-
L = new WeakMap(),
|
|
206
|
+
L = new WeakMap(), z = new WeakMap(), y = new WeakMap(), B = new WeakMap(), D = new WeakMap(), N = new WeakMap(), te = new WeakMap(), P = new WeakMap(), ie = new WeakMap(), a(Ae, "NineTableHScrollBar");
|
|
207
207
|
let ye = Ae;
|
|
208
208
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ye);
|
|
209
|
-
var V, C, E,
|
|
209
|
+
var V, C, E, $, M, H, se, ne;
|
|
210
210
|
const qe = class qe {
|
|
211
211
|
constructor(i) {
|
|
212
212
|
u(this, V);
|
|
213
213
|
u(this, C, []);
|
|
214
214
|
u(this, E, null);
|
|
215
|
-
u(this,
|
|
215
|
+
u(this, $, null);
|
|
216
216
|
u(this, M, 0);
|
|
217
217
|
u(this, H, 0);
|
|
218
218
|
x(this, "getRowHeight", /* @__PURE__ */ a(() => e(this, E), "getRowHeight"));
|
|
@@ -223,7 +223,7 @@ const qe = class qe {
|
|
|
223
223
|
* π― λ·°ν¬νΈ ν¬κΈ° λ³ν μμ μ λμ΄ κ³μ° λ° νμν ν κ°μ μ°μ Β·μΊμ±μ μκ²°
|
|
224
224
|
*/
|
|
225
225
|
u(this, ne, /* @__PURE__ */ a(() => {
|
|
226
|
-
!e(this, V) || !(e(this, V) instanceof HTMLElement) || (p(this,
|
|
226
|
+
!e(this, V) || !(e(this, V) instanceof HTMLElement) || (p(this, $, new ResizeObserver((i) => {
|
|
227
227
|
for (const t of i) {
|
|
228
228
|
const s = t.target;
|
|
229
229
|
if (!s.classList.contains("active"))
|
|
@@ -237,14 +237,14 @@ const qe = class qe {
|
|
|
237
237
|
const d = Math.max(r - o, 100);
|
|
238
238
|
if (e(this, M) !== d && (p(this, M, d), e(this, E) !== null)) {
|
|
239
239
|
const f = Math.ceil(e(this, M) / e(this, E));
|
|
240
|
-
p(this, H, f + 20),
|
|
240
|
+
p(this, H, f + 20), j.log(`[RowManager] Resized. Height: ${e(this, M)}px | Target Rows: ${e(this, H)}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
|
|
241
241
|
const b = s.querySelector(g);
|
|
242
242
|
b && b.querySelector("tbody") && this.renderRows(b);
|
|
243
243
|
});
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
|
-
})), e(this,
|
|
247
|
+
})), e(this, $).observe(e(this, V)));
|
|
248
248
|
}, "#initResizeObserver"));
|
|
249
249
|
x(this, "initTemplate", /* @__PURE__ */ a((i) => {
|
|
250
250
|
const t = i.querySelector("tbody.bindable") || i.querySelector("tbody");
|
|
@@ -306,7 +306,7 @@ const qe = class qe {
|
|
|
306
306
|
s ? s.before(n) : t.appendChild(n), console.log(`[RowManager] Rendered ${r} sets into DOM.`);
|
|
307
307
|
}, "renderRows"));
|
|
308
308
|
x(this, "destroy", /* @__PURE__ */ a(() => {
|
|
309
|
-
e(this,
|
|
309
|
+
e(this, $) && (e(this, $).disconnect(), p(this, $, null));
|
|
310
310
|
}, "destroy"));
|
|
311
311
|
p(this, V, i), e(this, se).call(this);
|
|
312
312
|
}
|
|
@@ -314,10 +314,10 @@ const qe = class qe {
|
|
|
314
314
|
return e(this, C).length || 1;
|
|
315
315
|
}
|
|
316
316
|
};
|
|
317
|
-
V = new WeakMap(), C = new WeakMap(), E = new WeakMap(),
|
|
317
|
+
V = new WeakMap(), C = new WeakMap(), E = new WeakMap(), $ = new WeakMap(), M = new WeakMap(), H = new WeakMap(), se = new WeakMap(), ne = new WeakMap(), a(qe, "RowManager");
|
|
318
318
|
let me = qe;
|
|
319
319
|
var I, X, re, oe;
|
|
320
|
-
const
|
|
320
|
+
const Z = class Z extends HTMLElement {
|
|
321
321
|
constructor() {
|
|
322
322
|
super();
|
|
323
323
|
u(this, I, null);
|
|
@@ -422,7 +422,7 @@ const j = class j extends HTMLElement {
|
|
|
422
422
|
}).observe(this, { attributes: !0 });
|
|
423
423
|
}, "#init"));
|
|
424
424
|
u(this, oe, /* @__PURE__ */ a(() => {
|
|
425
|
-
const t =
|
|
425
|
+
const t = Z.SCROLLBAR_SIZE;
|
|
426
426
|
this.innerHTML = `
|
|
427
427
|
<style>
|
|
428
428
|
nine-table-sheet {
|
|
@@ -544,11 +544,11 @@ const j = class j extends HTMLElement {
|
|
|
544
544
|
e(this, re).call(this);
|
|
545
545
|
}
|
|
546
546
|
disconnectedCallback() {
|
|
547
|
-
this.innerHTML = "",
|
|
547
|
+
this.innerHTML = "", j.log("NineTableSheet destroyed.");
|
|
548
548
|
}
|
|
549
549
|
};
|
|
550
|
-
I = new WeakMap(), X = new WeakMap(), re = new WeakMap(), oe = new WeakMap(), a(
|
|
551
|
-
let ee =
|
|
550
|
+
I = new WeakMap(), X = new WeakMap(), re = new WeakMap(), oe = new WeakMap(), a(Z, "NineTableSheet"), x(Z, "SCROLLBAR_SIZE", 16);
|
|
551
|
+
let ee = Z;
|
|
552
552
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", ee);
|
|
553
553
|
var le, G;
|
|
554
554
|
const ke = class ke extends HTMLElement {
|
|
@@ -734,13 +734,13 @@ const Le = class Le {
|
|
|
734
734
|
};
|
|
735
735
|
S = new WeakMap(), ae = new WeakMap(), J = new WeakMap(), ce = new WeakMap(), a(Le, "LayoutManager");
|
|
736
736
|
let ve = Le;
|
|
737
|
-
var
|
|
737
|
+
var W, F;
|
|
738
738
|
const Ce = class Ce {
|
|
739
739
|
constructor(i) {
|
|
740
|
-
u(this,
|
|
740
|
+
u(this, W);
|
|
741
741
|
u(this, F, -1);
|
|
742
|
-
x(this, "count", /* @__PURE__ */ a(() => e(this,
|
|
743
|
-
p(this,
|
|
742
|
+
x(this, "count", /* @__PURE__ */ a(() => e(this, W).rawRecords.length, "count"));
|
|
743
|
+
p(this, W, i);
|
|
744
744
|
}
|
|
745
745
|
get at() {
|
|
746
746
|
return e(this, F);
|
|
@@ -748,16 +748,16 @@ const Ce = class Ce {
|
|
|
748
748
|
set at(i) {
|
|
749
749
|
var s, n;
|
|
750
750
|
p(this, F, parseInt(i, 10));
|
|
751
|
-
const t = ((n = (s = e(this,
|
|
751
|
+
const t = ((n = (s = e(this, W).owner).querySelector) == null ? void 0 : n.call(s, ".ng-container-body")) || e(this, W).owner.body;
|
|
752
752
|
t && !t.querySelector(`tbody.bindable tr[data-row="${e(this, F)}"]`) && setTimeout(() => {
|
|
753
753
|
var r, o;
|
|
754
|
-
(o = (r = e(this,
|
|
754
|
+
(o = (r = e(this, W).owner).scrollTo_V1) == null || o.call(r, e(this, F));
|
|
755
755
|
});
|
|
756
756
|
}
|
|
757
757
|
};
|
|
758
|
-
|
|
758
|
+
W = new WeakMap(), F = new WeakMap(), a(Ce, "ngRow");
|
|
759
759
|
let xe = Ce;
|
|
760
|
-
var A, v, q, U, he,
|
|
760
|
+
var A, v, q, U, he, O, de, Q, fe, ue, K;
|
|
761
761
|
const k = class k {
|
|
762
762
|
constructor(i, t) {
|
|
763
763
|
u(this, A);
|
|
@@ -765,15 +765,15 @@ const k = class k {
|
|
|
765
765
|
u(this, q, []);
|
|
766
766
|
u(this, U, []);
|
|
767
767
|
u(this, he, 0);
|
|
768
|
-
u(this,
|
|
768
|
+
u(this, O, []);
|
|
769
769
|
u(this, de, /* @__PURE__ */ a(() => {
|
|
770
|
-
p(this,
|
|
770
|
+
p(this, O, []);
|
|
771
771
|
const i = e(this, A).template || [];
|
|
772
772
|
Array.from(i).forEach((t) => {
|
|
773
773
|
var s;
|
|
774
|
-
e(this,
|
|
774
|
+
e(this, O).push(((s = t.getBoundingClientRect) == null ? void 0 : s.call(t).height) || 24);
|
|
775
775
|
}), (e(this, v).rawRecords || []).forEach((t) => {
|
|
776
|
-
t.__ng || (t.__ng = e(this, Q).call(this)), t.__ng.height = e(this,
|
|
776
|
+
t.__ng || (t.__ng = e(this, Q).call(this)), t.__ng.height = e(this, O).slice();
|
|
777
777
|
});
|
|
778
778
|
}, "#initialize"));
|
|
779
779
|
x(this, "set", /* @__PURE__ */ a((i) => {
|
|
@@ -783,10 +783,10 @@ const k = class k {
|
|
|
783
783
|
rowState: k.ROW_STATE.EMPTY,
|
|
784
784
|
deleted: !1,
|
|
785
785
|
filtered: !1,
|
|
786
|
-
height: e(this,
|
|
786
|
+
height: e(this, O).slice(),
|
|
787
787
|
o: {},
|
|
788
788
|
c: {},
|
|
789
|
-
_: [0, 0, 0, 0, k.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this,
|
|
789
|
+
_: [0, 0, 0, 0, k.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, O).slice(), -1, {}, {}]
|
|
790
790
|
}), "#getDefaultMeta"));
|
|
791
791
|
x(this, "reset", /* @__PURE__ */ a(() => {
|
|
792
792
|
p(this, q, []), p(this, U, []);
|
|
@@ -893,7 +893,7 @@ const k = class k {
|
|
|
893
893
|
return this.length;
|
|
894
894
|
}
|
|
895
895
|
};
|
|
896
|
-
A = new WeakMap(), v = new WeakMap(), q = new WeakMap(), U = new WeakMap(), he = new WeakMap(),
|
|
896
|
+
A = new WeakMap(), v = new WeakMap(), q = new WeakMap(), U = new WeakMap(), he = new WeakMap(), O = new WeakMap(), de = new WeakMap(), Q = new WeakMap(), fe = new WeakMap(), ue = new WeakMap(), K = new WeakMap(), a(k, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
897
897
|
x(k, "ROW_STATE", {
|
|
898
898
|
EMPTY: "EMPTY",
|
|
899
899
|
NORMAL: "NORMAL",
|
|
@@ -933,10 +933,10 @@ const Me = class Me extends HTMLElement {
|
|
|
933
933
|
this.attachShadow({ mode: "open" }), p(this, Y, new Se(this));
|
|
934
934
|
}
|
|
935
935
|
connectedCallback() {
|
|
936
|
-
p(this, ge, new ve(this)),
|
|
936
|
+
p(this, ge, new ve(this)), j.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
937
937
|
}
|
|
938
938
|
disconnectedCallback() {
|
|
939
|
-
|
|
939
|
+
j.log("NineTable disconnected.");
|
|
940
940
|
}
|
|
941
941
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
942
942
|
get data() {
|