@ninebone/table 0.0.370 β 0.0.371
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 +30 -31
- 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
|
@@ -23,7 +23,7 @@ const ne = class ne extends xe.constructor {
|
|
|
23
23
|
a(ne, "Trace");
|
|
24
24
|
let Ut = ne;
|
|
25
25
|
const W = new Ut();
|
|
26
|
-
var _, O, p, N, P,
|
|
26
|
+
var _, O, p, N, P, V, vt, Y, wt;
|
|
27
27
|
const oe = class oe extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
@@ -32,13 +32,13 @@ const oe = class oe extends HTMLElement {
|
|
|
32
32
|
c(this, p);
|
|
33
33
|
c(this, N);
|
|
34
34
|
c(this, P);
|
|
35
|
-
c(this,
|
|
35
|
+
c(this, V);
|
|
36
36
|
c(this, vt, /* @__PURE__ */ a(() => {
|
|
37
37
|
if (!t(this, _)) return;
|
|
38
38
|
const e = t(this, _).querySelector(".ng-container-body");
|
|
39
|
-
e && (g(this,
|
|
39
|
+
e && (g(this, V, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
|
-
})), t(this,
|
|
41
|
+
})), t(this, V).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
x(this, "refresh", /* @__PURE__ */ a(() => {
|
|
44
44
|
if (!t(this, _) || !t(this, p) || t(this, O)) return;
|
|
@@ -61,7 +61,7 @@ const oe = class oe extends HTMLElement {
|
|
|
61
61
|
const w = d - f;
|
|
62
62
|
y > w && (y = w), r.style.left = `${y}px`, W.log(y), t(this, p).left.disabled = y === 0, t(this, p).right.disabled = y >= w - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
c(this,
|
|
64
|
+
c(this, Y, /* @__PURE__ */ a((e) => {
|
|
65
65
|
if (!t(this, p)) return !1;
|
|
66
66
|
const s = t(this, p).container, o = s.querySelector("table");
|
|
67
67
|
if (!o) return !1;
|
|
@@ -77,10 +77,10 @@ const oe = class oe extends HTMLElement {
|
|
|
77
77
|
const e = /* @__PURE__ */ a((o) => {
|
|
78
78
|
clearInterval(t(this, N)), clearInterval(t(this, P));
|
|
79
79
|
const r = parseInt(t(this, p).thumb.style.left || 0, 10);
|
|
80
|
-
t(this,
|
|
80
|
+
t(this, Y).call(this, r + o), g(this, N, setInterval(() => {
|
|
81
81
|
clearInterval(t(this, N)), g(this, P, setInterval(() => {
|
|
82
82
|
const n = parseInt(t(this, p).thumb.style.left || 0, 10);
|
|
83
|
-
t(this,
|
|
83
|
+
t(this, Y).call(this, n + o) || clearInterval(t(this, P));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), s = /* @__PURE__ */ a(() => {
|
|
@@ -96,14 +96,14 @@ const oe = class oe extends HTMLElement {
|
|
|
96
96
|
if (o.button !== 0) return;
|
|
97
97
|
o.preventDefault();
|
|
98
98
|
const r = t(this, p).track.getBoundingClientRect(), n = t(this, p).thumb.clientWidth;
|
|
99
|
-
t(this,
|
|
99
|
+
t(this, Y).call(this, o.clientX - r.left - n / 2);
|
|
100
100
|
}), t(this, p).thumb.addEventListener("mousedown", (o) => {
|
|
101
101
|
if (o.button !== 0) return;
|
|
102
102
|
o.stopPropagation(), o.preventDefault(), g(this, O, !0), this.shiftX = o.clientX - t(this, p).thumb.getBoundingClientRect().left;
|
|
103
103
|
const r = /* @__PURE__ */ a((l) => {
|
|
104
104
|
if (!t(this, O)) return;
|
|
105
105
|
const h = t(this, p).track.getBoundingClientRect();
|
|
106
|
-
t(this,
|
|
106
|
+
t(this, Y).call(this, l.clientX - h.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), n = /* @__PURE__ */ a(() => {
|
|
108
108
|
g(this, O, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", n), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
@@ -195,10 +195,10 @@ const oe = class oe extends HTMLElement {
|
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
197
197
|
disconnectedCallback() {
|
|
198
|
-
t(this,
|
|
198
|
+
t(this, V) && t(this, V).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
_ = new WeakMap(), O = new WeakMap(), p = new WeakMap(), N = new WeakMap(), P = new WeakMap(),
|
|
201
|
+
_ = new WeakMap(), O = new WeakMap(), p = new WeakMap(), N = new WeakMap(), P = new WeakMap(), V = new WeakMap(), vt = new WeakMap(), Y = new WeakMap(), wt = new WeakMap(), a(oe, "NineTableHScrollBar");
|
|
202
202
|
let Ft = oe;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Ft);
|
|
204
204
|
var X, z, S, lt, at, St;
|
|
@@ -502,17 +502,16 @@ const le = class le {
|
|
|
502
502
|
}, "#measureAndCacheHeight"));
|
|
503
503
|
c(this, ct, /* @__PURE__ */ a(() => {
|
|
504
504
|
if (!t(this, v).querySelector(".ng-container-body")) return;
|
|
505
|
-
const
|
|
506
|
-
W.log(
|
|
505
|
+
const s = (t(this, M).data.get() || []).length, o = t(this, A) || 24, r = s * o;
|
|
506
|
+
W.log(`[VirtualHeight] totalCount: ${s}, rowHeight: ${o}, totalVirtualHeight: ${r}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
507
507
|
const l = t(this, v).querySelector(n), h = l == null ? void 0 : l.querySelector("table");
|
|
508
508
|
h && (h.style.height = `${r}px`);
|
|
509
509
|
});
|
|
510
510
|
}, "#updateVirtualScrollHeight"));
|
|
511
511
|
c(this, ht, /* @__PURE__ */ a(() => {
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
g(this, J, Math.min(e, s + t(this, Rt))), W.log(s, t(this, J));
|
|
512
|
+
if ((t(this, M).data.get() || []).length, t(this, U) > 0 && t(this, A) > 0) {
|
|
513
|
+
const e = Math.ceil(t(this, U) / t(this, A));
|
|
514
|
+
g(this, J, e + t(this, Rt)), W.log("visibleRows:", e, "cachedRowCount:", t(this, J));
|
|
516
515
|
}
|
|
517
516
|
}, "#updateRowCount"));
|
|
518
517
|
c(this, Tt, /* @__PURE__ */ a(() => {
|
|
@@ -614,7 +613,7 @@ const le = class le {
|
|
|
614
613
|
};
|
|
615
614
|
M = new WeakMap(), v = new WeakMap(), I = new WeakMap(), A = new WeakMap(), B = new WeakMap(), U = new WeakMap(), J = new WeakMap(), Q = new WeakMap(), Rt = new WeakMap(), At = new WeakMap(), qt = new WeakMap(), ct = new WeakMap(), ht = new WeakMap(), Tt = new WeakMap(), kt = new WeakMap(), dt = new WeakMap(), Lt = new WeakMap(), tt = new WeakMap(), ft = new WeakMap(), a(le, "RowManager");
|
|
616
615
|
let Zt = le;
|
|
617
|
-
var Ht, et, F, Ct, _t, Mt,
|
|
616
|
+
var Ht, et, F, Ct, _t, Mt, $t, It;
|
|
618
617
|
const rt = class rt extends HTMLElement {
|
|
619
618
|
constructor() {
|
|
620
619
|
super();
|
|
@@ -689,10 +688,10 @@ const rt = class rt extends HTMLElement {
|
|
|
689
688
|
const s = this.querySelector(".ng-container-body");
|
|
690
689
|
s && (s.scrollTop = e);
|
|
691
690
|
}, "scrollToY"));
|
|
692
|
-
c(this, It, /* @__PURE__ */ a(() => {
|
|
693
|
-
t(this, $t).call(this);
|
|
694
|
-
}, "#init"));
|
|
695
691
|
c(this, $t, /* @__PURE__ */ a(() => {
|
|
692
|
+
t(this, It).call(this);
|
|
693
|
+
}, "#init"));
|
|
694
|
+
c(this, It, /* @__PURE__ */ a(() => {
|
|
696
695
|
const e = rt.SCROLLBAR_SIZE;
|
|
697
696
|
this.innerHTML = `
|
|
698
697
|
<style>
|
|
@@ -842,13 +841,13 @@ const rt = class rt extends HTMLElement {
|
|
|
842
841
|
g(this, F, new Zt(this)), g(this, Ht, this.getRootNode().host);
|
|
843
842
|
}
|
|
844
843
|
connectedCallback() {
|
|
845
|
-
t(this,
|
|
844
|
+
t(this, $t).call(this);
|
|
846
845
|
}
|
|
847
846
|
disconnectedCallback() {
|
|
848
847
|
this.innerHTML = "", W.log("NineTableSheet destroyed.");
|
|
849
848
|
}
|
|
850
849
|
};
|
|
851
|
-
Ht = new WeakMap(), et = new WeakMap(), F = new WeakMap(), Ct = new WeakMap(), _t = new WeakMap(), Mt = new WeakMap(),
|
|
850
|
+
Ht = new WeakMap(), et = new WeakMap(), F = new WeakMap(), Ct = new WeakMap(), _t = new WeakMap(), Mt = new WeakMap(), $t = new WeakMap(), It = new WeakMap(), a(rt, "NineTableSheet"), x(rt, "SCROLLBAR_SIZE", 16);
|
|
852
851
|
let xt = rt;
|
|
853
852
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", xt);
|
|
854
853
|
var Wt, ut;
|
|
@@ -1224,7 +1223,7 @@ const de = class de {
|
|
|
1224
1223
|
};
|
|
1225
1224
|
K = new WeakMap(), a(de, "ngDataManager");
|
|
1226
1225
|
let ee = de;
|
|
1227
|
-
var ot, R, pt,
|
|
1226
|
+
var ot, R, pt, Vt;
|
|
1228
1227
|
const fe = class fe {
|
|
1229
1228
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1230
1229
|
constructor(i) {
|
|
@@ -1241,7 +1240,7 @@ const fe = class fe {
|
|
|
1241
1240
|
i.set(e.name, e.type);
|
|
1242
1241
|
}), g(this, R, Array.from(i, ([e, s]) => ({ name: e, type: s }))), g(this, R, t(this, R).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, R).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
1243
1242
|
}, "#adjust"));
|
|
1244
|
-
c(this,
|
|
1243
|
+
c(this, Vt, /* @__PURE__ */ a(() => {
|
|
1245
1244
|
g(this, R, []), W.log(t(this, ot).querySelectorAll("table"));
|
|
1246
1245
|
const i = Array.from(t(this, ot).querySelectorAll("table"));
|
|
1247
1246
|
if (!(!i || i.length === 0)) {
|
|
@@ -1273,7 +1272,7 @@ const fe = class fe {
|
|
|
1273
1272
|
t(this, pt).call(this);
|
|
1274
1273
|
}
|
|
1275
1274
|
}, "#init"));
|
|
1276
|
-
g(this, ot, i), t(this,
|
|
1275
|
+
g(this, ot, i), t(this, Vt).call(this);
|
|
1277
1276
|
}
|
|
1278
1277
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
1279
1278
|
get() {
|
|
@@ -1295,17 +1294,17 @@ const fe = class fe {
|
|
|
1295
1294
|
return t(this, R).some((e) => e.name === i);
|
|
1296
1295
|
}
|
|
1297
1296
|
};
|
|
1298
|
-
ot = new WeakMap(), R = new WeakMap(), pt = new WeakMap(),
|
|
1297
|
+
ot = new WeakMap(), R = new WeakMap(), pt = new WeakMap(), Vt = new WeakMap(), a(fe, "ngFields");
|
|
1299
1298
|
let ie = fe;
|
|
1300
|
-
var Z,
|
|
1299
|
+
var Z, Yt, Xt;
|
|
1301
1300
|
const ue = class ue extends HTMLElement {
|
|
1302
1301
|
constructor() {
|
|
1303
1302
|
super();
|
|
1304
1303
|
//#created = false;
|
|
1305
1304
|
c(this, Z);
|
|
1306
|
-
c(this,
|
|
1305
|
+
c(this, Yt);
|
|
1307
1306
|
c(this, Xt, /* @__PURE__ */ a(() => {
|
|
1308
|
-
this.fields = new ie(this), g(this,
|
|
1307
|
+
this.fields = new ie(this), g(this, Yt, new Jt(this)), W.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1309
1308
|
}, "#init"));
|
|
1310
1309
|
this.attachShadow({ mode: "open" }), g(this, Z, new ee(this));
|
|
1311
1310
|
}
|
|
@@ -1328,7 +1327,7 @@ const ue = class ue extends HTMLElement {
|
|
|
1328
1327
|
return t(this, Z);
|
|
1329
1328
|
}
|
|
1330
1329
|
};
|
|
1331
|
-
Z = new WeakMap(),
|
|
1330
|
+
Z = new WeakMap(), Yt = new WeakMap(), Xt = new WeakMap(), a(ue, "NineTable");
|
|
1332
1331
|
let se = ue;
|
|
1333
1332
|
customElements.get("nine-table") || customElements.define("nine-table", se);
|
|
1334
1333
|
//# sourceMappingURL=nine-table.js.map
|