@ninebone/table 0.0.322 β 0.0.324
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 +53 -53
- 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,23 +22,23 @@ const Xt = class Xt extends re.constructor {
|
|
|
22
22
|
};
|
|
23
23
|
c(Xt, "Trace");
|
|
24
24
|
let It = Xt;
|
|
25
|
-
const
|
|
26
|
-
var C, M, y,
|
|
25
|
+
const O = new It();
|
|
26
|
+
var C, M, y, N, B, P, ft, Y, ut;
|
|
27
27
|
const Ut = class Ut extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
h(this, C);
|
|
31
31
|
h(this, M, !1);
|
|
32
32
|
h(this, y);
|
|
33
|
-
h(this, D);
|
|
34
33
|
h(this, N);
|
|
35
34
|
h(this, B);
|
|
35
|
+
h(this, P);
|
|
36
36
|
h(this, ft, /* @__PURE__ */ c(() => {
|
|
37
37
|
if (!t(this, C)) return;
|
|
38
38
|
const e = t(this, C).querySelector(".ng-container-body");
|
|
39
|
-
e && (g(this,
|
|
39
|
+
e && (g(this, P, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
|
-
})), t(this,
|
|
41
|
+
})), t(this, P).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
w(this, "refresh", /* @__PURE__ */ c(() => {
|
|
44
44
|
if (!t(this, C) || !t(this, y) || t(this, M)) return;
|
|
@@ -59,9 +59,9 @@ const Ut = class Ut extends HTMLElement {
|
|
|
59
59
|
let m = 0;
|
|
60
60
|
b > 0 && (m = parseInt(u / b * (d - f), 10)), m < 0 && (m = 0);
|
|
61
61
|
const E = d - f;
|
|
62
|
-
m > E && (m = E), r.style.left = `${m}px`,
|
|
62
|
+
m > E && (m = E), r.style.left = `${m}px`, O.log(m), t(this, y).left.disabled = m === 0, t(this, y).right.disabled = m >= E - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
h(this,
|
|
64
|
+
h(this, Y, /* @__PURE__ */ c((e) => {
|
|
65
65
|
if (!t(this, y)) return !1;
|
|
66
66
|
const s = t(this, y).container, o = s.querySelector("table");
|
|
67
67
|
if (!o) return !1;
|
|
@@ -75,16 +75,16 @@ const Ut = class Ut extends HTMLElement {
|
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
76
|
h(this, ut, /* @__PURE__ */ c(() => {
|
|
77
77
|
const e = /* @__PURE__ */ c((o) => {
|
|
78
|
-
clearInterval(t(this,
|
|
78
|
+
clearInterval(t(this, N)), clearInterval(t(this, B));
|
|
79
79
|
const r = parseInt(t(this, y).thumb.style.left || 0, 10);
|
|
80
|
-
t(this,
|
|
81
|
-
clearInterval(t(this,
|
|
80
|
+
t(this, Y).call(this, r + o), g(this, N, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, N)), g(this, B, setInterval(() => {
|
|
82
82
|
const n = parseInt(t(this, y).thumb.style.left || 0, 10);
|
|
83
|
-
t(this,
|
|
83
|
+
t(this, Y).call(this, n + o) || clearInterval(t(this, B));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), s = /* @__PURE__ */ c(() => {
|
|
87
|
-
clearInterval(t(this,
|
|
87
|
+
clearInterval(t(this, N)), clearInterval(t(this, B));
|
|
88
88
|
}, "clearTimer");
|
|
89
89
|
["mouseup", "mouseleave", "touchend"].forEach((o) => {
|
|
90
90
|
t(this, y).left.addEventListener(o, s), t(this, y).right.addEventListener(o, s), t(this, y).track.addEventListener(o, s);
|
|
@@ -96,14 +96,14 @@ const Ut = class Ut extends HTMLElement {
|
|
|
96
96
|
if (o.button !== 0) return;
|
|
97
97
|
o.preventDefault();
|
|
98
98
|
const r = t(this, y).track.getBoundingClientRect(), n = t(this, y).thumb.clientWidth;
|
|
99
|
-
t(this,
|
|
99
|
+
t(this, Y).call(this, o.clientX - r.left - n / 2);
|
|
100
100
|
}), t(this, y).thumb.addEventListener("mousedown", (o) => {
|
|
101
101
|
if (o.button !== 0) return;
|
|
102
102
|
o.stopPropagation(), o.preventDefault(), g(this, M, !0), this.shiftX = o.clientX - t(this, y).thumb.getBoundingClientRect().left;
|
|
103
103
|
const r = /* @__PURE__ */ c((l) => {
|
|
104
104
|
if (!t(this, M)) return;
|
|
105
105
|
const a = t(this, y).track.getBoundingClientRect();
|
|
106
|
-
t(this,
|
|
106
|
+
t(this, Y).call(this, l.clientX - a.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), n = /* @__PURE__ */ c(() => {
|
|
108
108
|
g(this, M, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", n), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
@@ -195,17 +195,17 @@ const Ut = class Ut extends HTMLElement {
|
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
197
197
|
disconnectedCallback() {
|
|
198
|
-
t(this,
|
|
198
|
+
t(this, P) && t(this, P).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
C = new WeakMap(), M = new WeakMap(), y = new WeakMap(),
|
|
201
|
+
C = new WeakMap(), M = new WeakMap(), y = new WeakMap(), N = new WeakMap(), B = new WeakMap(), P = new WeakMap(), ft = new WeakMap(), Y = new WeakMap(), ut = new WeakMap(), c(Ut, "NineTableHScrollBar");
|
|
202
202
|
let $t = Ut;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", $t);
|
|
204
|
-
var
|
|
204
|
+
var V, I, S, it, st, bt;
|
|
205
205
|
const Ft = class Ft extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
-
h(this,
|
|
208
|
+
h(this, V);
|
|
209
209
|
h(this, I, !1);
|
|
210
210
|
h(this, S);
|
|
211
211
|
h(this, it, 0);
|
|
@@ -214,7 +214,7 @@ const Ft = class Ft extends HTMLElement {
|
|
|
214
214
|
* π― μ€ν¬λ‘€λ° μμΉ λ° μΈλΈ ν¬κΈ° κ°±μ
|
|
215
215
|
*/
|
|
216
216
|
w(this, "refresh", /* @__PURE__ */ c(() => {
|
|
217
|
-
if (!t(this,
|
|
217
|
+
if (!t(this, V) || !t(this, S) || t(this, I)) return;
|
|
218
218
|
const e = t(this, S).container, s = e.querySelector("table");
|
|
219
219
|
if (!s) return;
|
|
220
220
|
const o = t(this, S).track, r = t(this, S).thumb, n = e.clientHeight, l = s.scrollHeight;
|
|
@@ -243,11 +243,11 @@ const Ft = class Ft extends HTMLElement {
|
|
|
243
243
|
const o = /* @__PURE__ */ c((n) => {
|
|
244
244
|
if (!t(this, I)) return;
|
|
245
245
|
const l = t(this, S).track.getBoundingClientRect(), a = t(this, S).thumb.clientHeight, f = l.height - a, u = n.clientY - t(this, it), b = e.clientHeight, m = e.querySelector("table");
|
|
246
|
-
|
|
246
|
+
O.log(m), O.log(m.scrollHeight);
|
|
247
247
|
const q = m.scrollHeight - b;
|
|
248
248
|
if (f > 0 && q > 0) {
|
|
249
|
-
const
|
|
250
|
-
e.scrollTop = t(this, st) +
|
|
249
|
+
const D = u / f * q;
|
|
250
|
+
e.scrollTop = t(this, st) + D;
|
|
251
251
|
}
|
|
252
252
|
this.refresh();
|
|
253
253
|
}, "onMouseMove"), r = /* @__PURE__ */ c(() => {
|
|
@@ -270,7 +270,7 @@ const Ft = class Ft extends HTMLElement {
|
|
|
270
270
|
}, "#init"));
|
|
271
271
|
}
|
|
272
272
|
connectedCallback() {
|
|
273
|
-
if (g(this,
|
|
273
|
+
if (g(this, V, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, V)) return;
|
|
274
274
|
this.innerHTML = `
|
|
275
275
|
<style>
|
|
276
276
|
nine-table-vscrollbar {
|
|
@@ -335,7 +335,7 @@ const Ft = class Ft extends HTMLElement {
|
|
|
335
335
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
336
336
|
`;
|
|
337
337
|
const e = /* @__PURE__ */ c(() => {
|
|
338
|
-
const s = t(this,
|
|
338
|
+
const s = t(this, V).querySelector(".ng-container-body");
|
|
339
339
|
if (!s) {
|
|
340
340
|
setTimeout(e, 10);
|
|
341
341
|
return;
|
|
@@ -351,7 +351,7 @@ const Ft = class Ft extends HTMLElement {
|
|
|
351
351
|
e();
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
|
-
|
|
354
|
+
V = new WeakMap(), I = new WeakMap(), S = new WeakMap(), it = new WeakMap(), st = new WeakMap(), bt = new WeakMap(), c(Ft, "NineTableVScrollBar");
|
|
355
355
|
let Wt = Ft;
|
|
356
356
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Wt);
|
|
357
357
|
var gt, K;
|
|
@@ -425,14 +425,14 @@ gt = new WeakMap(), K = new WeakMap(), c(H, "TableCompiler"), h(H, gt, /* @__PUR
|
|
|
425
425
|
});
|
|
426
426
|
}, "#resetColIndex"));
|
|
427
427
|
let zt = H;
|
|
428
|
-
var p, _, R, $,
|
|
428
|
+
var p, _, R, $, X, j, yt, pt, nt, ot, mt, xt, rt, Z, vt;
|
|
429
429
|
const Kt = class Kt {
|
|
430
430
|
constructor(i) {
|
|
431
431
|
h(this, p);
|
|
432
432
|
h(this, _, /* @__PURE__ */ new Map());
|
|
433
433
|
h(this, R, null);
|
|
434
434
|
h(this, $, null);
|
|
435
|
-
h(this,
|
|
435
|
+
h(this, X, 0);
|
|
436
436
|
h(this, j, 40);
|
|
437
437
|
w(this, "refresh", /* @__PURE__ */ c(() => {
|
|
438
438
|
var e;
|
|
@@ -507,8 +507,8 @@ const Kt = class Kt {
|
|
|
507
507
|
});
|
|
508
508
|
}, "#updateVirtualScrollHeight"));
|
|
509
509
|
h(this, ot, /* @__PURE__ */ c(() => {
|
|
510
|
-
if (t(this,
|
|
511
|
-
const i = Math.ceil(t(this,
|
|
510
|
+
if (t(this, X) > 0 && t(this, R) > 0) {
|
|
511
|
+
const i = Math.ceil(t(this, X) / t(this, R));
|
|
512
512
|
g(this, j, i + 20);
|
|
513
513
|
} else
|
|
514
514
|
g(this, j, 40);
|
|
@@ -538,7 +538,7 @@ const Kt = class Kt {
|
|
|
538
538
|
const n = s.querySelector("thead");
|
|
539
539
|
n && (r += n.offsetHeight || n.getBoundingClientRect().height);
|
|
540
540
|
const l = Math.max(o - r, 100);
|
|
541
|
-
t(this,
|
|
541
|
+
t(this, X) !== l && (g(this, X, l), t(this, ot).call(this), t(this, R) !== null && t(this, rt).call(this));
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
544
|
})), t(this, $).observe(t(this, p)));
|
|
@@ -560,8 +560,8 @@ const Kt = class Kt {
|
|
|
560
560
|
const a = l.querySelector("tbody.bindable-tbody");
|
|
561
561
|
if (!a) return;
|
|
562
562
|
Array.from(a.querySelectorAll("tr:not(.nodata)")).forEach((f, u) => {
|
|
563
|
-
var E, q,
|
|
564
|
-
const b = s + Math.floor(u / o), m = (typeof t(this, p).getData == "function" ? t(this, p).getData(b) : null) ?? (typeof ((E = t(this, p).data) == null ? void 0 : E.get) == "function" ? t(this, p).data.get(b) : null) ?? ((
|
|
563
|
+
var E, q, D, te;
|
|
564
|
+
const b = s + Math.floor(u / o), m = (typeof t(this, p).getData == "function" ? t(this, p).getData(b) : null) ?? (typeof ((E = t(this, p).data) == null ? void 0 : E.get) == "function" ? t(this, p).data.get(b) : null) ?? ((D = (q = t(this, p).dataManager) == null ? void 0 : q.rawRecords) == null ? void 0 : D[b]) ?? ((te = t(this, p).data) == null ? void 0 : te[b]) ?? { _index: b };
|
|
565
565
|
f.style.display = "", t(this, vt).call(this, f, m, b);
|
|
566
566
|
});
|
|
567
567
|
});
|
|
@@ -585,7 +585,7 @@ const Kt = class Kt {
|
|
|
585
585
|
return ((e = t(this, _).get(i)) == null ? void 0 : e.length) || 1;
|
|
586
586
|
}
|
|
587
587
|
};
|
|
588
|
-
p = new WeakMap(), _ = new WeakMap(), R = new WeakMap(), $ = new WeakMap(),
|
|
588
|
+
p = new WeakMap(), _ = new WeakMap(), R = new WeakMap(), $ = new WeakMap(), X = new WeakMap(), j = new WeakMap(), yt = new WeakMap(), pt = new WeakMap(), nt = new WeakMap(), ot = new WeakMap(), mt = new WeakMap(), xt = new WeakMap(), rt = new WeakMap(), Z = new WeakMap(), vt = new WeakMap(), c(Kt, "RowManager");
|
|
589
589
|
let Ot = Kt;
|
|
590
590
|
var lt, G, J, wt, St, Et, Rt, kt;
|
|
591
591
|
const et = class et extends HTMLElement {
|
|
@@ -805,13 +805,13 @@ const et = class et extends HTMLElement {
|
|
|
805
805
|
</div>
|
|
806
806
|
`;
|
|
807
807
|
}, "#render"));
|
|
808
|
-
g(this, J, new Ot(this)), g(this, lt, this.getRootNode().host),
|
|
808
|
+
g(this, J, new Ot(this)), g(this, lt, this.getRootNode().host), O.log("================"), O.log(t(this, lt));
|
|
809
809
|
}
|
|
810
810
|
connectedCallback() {
|
|
811
811
|
t(this, Rt).call(this);
|
|
812
812
|
}
|
|
813
813
|
disconnectedCallback() {
|
|
814
|
-
this.innerHTML = "",
|
|
814
|
+
this.innerHTML = "", O.log("NineTableSheet destroyed.");
|
|
815
815
|
}
|
|
816
816
|
};
|
|
817
817
|
lt = new WeakMap(), G = new WeakMap(), J = new WeakMap(), wt = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), Rt = new WeakMap(), kt = new WeakMap(), c(et, "NineTableSheet"), w(et, "SCROLLBAR_SIZE", 16);
|
|
@@ -835,8 +835,8 @@ const jt = class jt extends HTMLElement {
|
|
|
835
835
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((m) => m.style.setProperty("display", "none"));
|
|
836
836
|
const b = f.filter((m) => m.classList.contains("active"));
|
|
837
837
|
b.length < 2 || b.forEach((m) => {
|
|
838
|
-
const E = parseInt(m.getAttribute("data-index"), 10), q = this.querySelector(`nine-splitter[data-split-index="${E}"]`),
|
|
839
|
-
q &&
|
|
838
|
+
const E = parseInt(m.getAttribute("data-index"), 10), q = this.querySelector(`nine-splitter[data-split-index="${E}"]`), D = f[E + 1];
|
|
839
|
+
q && D && D.classList.contains("active") && q.style.setProperty("display", "flex");
|
|
840
840
|
});
|
|
841
841
|
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), n = this.querySelector("nine-table-sheets-body"), l = r.querySelectorAll(".nine-tab-item"), a = n.querySelectorAll("nine-table-sheet");
|
|
842
842
|
if (!l[e]) return;
|
|
@@ -1001,28 +1001,28 @@ const Zt = class Zt {
|
|
|
1001
1001
|
};
|
|
1002
1002
|
k = new WeakMap(), Tt = new WeakMap(), at = new WeakMap(), At = new WeakMap(), c(Zt, "LayoutManager");
|
|
1003
1003
|
let Nt = Zt;
|
|
1004
|
-
var W,
|
|
1004
|
+
var W, U;
|
|
1005
1005
|
const Gt = class Gt {
|
|
1006
1006
|
constructor(i) {
|
|
1007
1007
|
h(this, W);
|
|
1008
|
-
h(this,
|
|
1008
|
+
h(this, U, -1);
|
|
1009
1009
|
w(this, "count", /* @__PURE__ */ c(() => t(this, W).rawRecords.length, "count"));
|
|
1010
1010
|
g(this, W, i);
|
|
1011
1011
|
}
|
|
1012
1012
|
get at() {
|
|
1013
|
-
return t(this,
|
|
1013
|
+
return t(this, U);
|
|
1014
1014
|
}
|
|
1015
1015
|
set at(i) {
|
|
1016
1016
|
var s, o;
|
|
1017
|
-
g(this,
|
|
1017
|
+
g(this, U, parseInt(i, 10));
|
|
1018
1018
|
const e = ((o = (s = t(this, W).owner).querySelector) == null ? void 0 : o.call(s, ".ng-container-body")) || t(this, W).owner.body;
|
|
1019
|
-
e && !e.querySelector(`tbody.bindable tr[data-row="${t(this,
|
|
1019
|
+
e && !e.querySelector(`tbody.bindable tr[data-row="${t(this, U)}"]`) && setTimeout(() => {
|
|
1020
1020
|
var r, n;
|
|
1021
|
-
(n = (r = t(this, W).owner).scrollTo_V1) == null || n.call(r, t(this,
|
|
1021
|
+
(n = (r = t(this, W).owner).scrollTo_V1) == null || n.call(r, t(this, U));
|
|
1022
1022
|
});
|
|
1023
1023
|
}
|
|
1024
1024
|
};
|
|
1025
|
-
W = new WeakMap(),
|
|
1025
|
+
W = new WeakMap(), U = new WeakMap(), c(Gt, "ngRow");
|
|
1026
1026
|
let Bt = Gt;
|
|
1027
1027
|
var T, v, A, Q, Lt, z, Ht, ht, Ct, _t, tt;
|
|
1028
1028
|
const L = class L {
|
|
@@ -1190,35 +1190,35 @@ const Jt = class Jt {
|
|
|
1190
1190
|
};
|
|
1191
1191
|
c(Jt, "ngDataManager");
|
|
1192
1192
|
let Yt = Jt;
|
|
1193
|
-
var
|
|
1193
|
+
var F, Mt;
|
|
1194
1194
|
const Qt = class Qt extends HTMLElement {
|
|
1195
1195
|
constructor() {
|
|
1196
1196
|
super();
|
|
1197
1197
|
//#created = false;
|
|
1198
|
-
h(this,
|
|
1198
|
+
h(this, F);
|
|
1199
1199
|
h(this, Mt);
|
|
1200
|
-
this.attachShadow({ mode: "open" }), g(this,
|
|
1200
|
+
this.attachShadow({ mode: "open" }), g(this, F, new Yt(this));
|
|
1201
1201
|
}
|
|
1202
1202
|
connectedCallback() {
|
|
1203
|
-
g(this, Mt, new Nt(this)),
|
|
1203
|
+
g(this, Mt, new Nt(this)), O.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1204
1204
|
}
|
|
1205
1205
|
disconnectedCallback() {
|
|
1206
|
-
|
|
1206
|
+
O.log("NineTable disconnected.");
|
|
1207
1207
|
}
|
|
1208
1208
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1209
1209
|
get data() {
|
|
1210
|
-
return t(this,
|
|
1210
|
+
return t(this, F).data;
|
|
1211
1211
|
}
|
|
1212
1212
|
// π― ν(row) κ΄λ ¨ μ μ΄ μ κ·Όμ μ€ν
|
|
1213
1213
|
get row() {
|
|
1214
|
-
return t(this,
|
|
1214
|
+
return t(this, F).row;
|
|
1215
1215
|
}
|
|
1216
1216
|
// π― μ 체 λ°μ΄ν° λ§€λμ μ κ·Ό νμν κ²½μ°
|
|
1217
1217
|
get dataManager() {
|
|
1218
|
-
return t(this,
|
|
1218
|
+
return t(this, F);
|
|
1219
1219
|
}
|
|
1220
1220
|
};
|
|
1221
|
-
|
|
1221
|
+
F = new WeakMap(), Mt = new WeakMap(), c(Qt, "NineTable");
|
|
1222
1222
|
let Vt = Qt;
|
|
1223
1223
|
customElements.get("nine-table") || customElements.define("nine-table", Vt);
|
|
1224
1224
|
//# sourceMappingURL=nine-table.js.map
|