@ninebone/table 0.0.245 β 0.0.247
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 +57 -59
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +1 -1
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -22,7 +22,7 @@ const qe = class qe extends Pe.constructor {
|
|
|
22
22
|
};
|
|
23
23
|
h(qe, "Trace");
|
|
24
24
|
let me = qe;
|
|
25
|
-
const
|
|
25
|
+
const O = new me();
|
|
26
26
|
var C, B, p, D, N, P, ie, V, se;
|
|
27
27
|
const ke = class ke extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
@@ -59,7 +59,7 @@ const ke = class ke extends HTMLElement {
|
|
|
59
59
|
let b = 0;
|
|
60
60
|
g > 0 && (b = parseInt(f / g * (l - c), 10)), b < 0 && (b = 0);
|
|
61
61
|
const w = l - c;
|
|
62
|
-
b > w && (b = w), r.style.left = `${b}px`,
|
|
62
|
+
b > w && (b = w), r.style.left = `${b}px`, O.log(b), e(this, p).left.disabled = b === 0, e(this, p).right.disabled = b >= w - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
64
|
u(this, V, /* @__PURE__ */ h((t) => {
|
|
65
65
|
if (!e(this, p)) return !1;
|
|
@@ -200,13 +200,13 @@ const ke = class ke extends HTMLElement {
|
|
|
200
200
|
C = new WeakMap(), B = new WeakMap(), p = new WeakMap(), D = new WeakMap(), N = new WeakMap(), P = new WeakMap(), ie = new WeakMap(), V = new WeakMap(), se = new WeakMap(), h(ke, "NineTableHScrollBar");
|
|
201
201
|
let we = ke;
|
|
202
202
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", we);
|
|
203
|
-
var
|
|
203
|
+
var M, _, A, $, I, H, ne, re, oe, le;
|
|
204
204
|
const Le = class Le {
|
|
205
205
|
constructor(i) {
|
|
206
|
-
u(this,
|
|
206
|
+
u(this, M);
|
|
207
207
|
u(this, _, []);
|
|
208
208
|
u(this, A, null);
|
|
209
|
-
u(this,
|
|
209
|
+
u(this, $, null);
|
|
210
210
|
u(this, I, 0);
|
|
211
211
|
u(this, H, 0);
|
|
212
212
|
v(this, "getRowHeight", /* @__PURE__ */ h(() => e(this, A), "getRowHeight"));
|
|
@@ -217,7 +217,7 @@ const Le = class Le {
|
|
|
217
217
|
* π― λ·°ν¬νΈ ν¬κΈ° λ³ν μμ μ λμ΄ κ³μ° λ° νμν ν κ°μ μ°μ Β·μΊμ±μ μκ²°
|
|
218
218
|
*/
|
|
219
219
|
u(this, re, /* @__PURE__ */ h(() => {
|
|
220
|
-
!e(this,
|
|
220
|
+
!e(this, M) || !(e(this, M) instanceof HTMLElement) || (y(this, $, new ResizeObserver((i) => {
|
|
221
221
|
for (const t of i) {
|
|
222
222
|
const s = t.target;
|
|
223
223
|
if (!s.classList.contains("active"))
|
|
@@ -231,19 +231,19 @@ const Le = class Le {
|
|
|
231
231
|
const c = Math.max(r - o, 100);
|
|
232
232
|
if (e(this, I) !== c && (y(this, I, c), e(this, A) !== null)) {
|
|
233
233
|
const f = Math.ceil(e(this, I) / e(this, A));
|
|
234
|
-
y(this, H, f + 20),
|
|
234
|
+
y(this, H, f + 20), O.log(`[RowManager] Resized. Height: ${e(this, I)}px | Target Rows: ${e(this, H)}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
|
|
235
235
|
const b = s.querySelector(g);
|
|
236
236
|
b && b.querySelector("tbody") && e(this, le).call(this, b);
|
|
237
237
|
});
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
-
})), e(this,
|
|
241
|
+
})), e(this, $).observe(e(this, M)));
|
|
242
242
|
}, "#initResizeObserver"));
|
|
243
243
|
// π― ν
νλ¦Ώ μΆμΆ, λμ΄ μΈ‘μ , μ΄κΈ° λ λλ§μ μμμ λ§κ² λ΄λΆμμ μΌκ΄ μ²λ¦¬
|
|
244
244
|
v(this, "initialize", /* @__PURE__ */ h((i) => {
|
|
245
|
-
|
|
246
|
-
const t = e(this,
|
|
245
|
+
O.log(i);
|
|
246
|
+
const t = e(this, M).querySelector(".ng-container-body"), s = i.querySelector("tbody"), n = Array.from(s.querySelectorAll("tr"));
|
|
247
247
|
y(this, _, n.map((r) => r.cloneNode(!0))), y(this, A, null), e(this, oe).call(this, t);
|
|
248
248
|
}, "initialize"));
|
|
249
249
|
u(this, oe, /* @__PURE__ */ h((i) => {
|
|
@@ -300,22 +300,22 @@ const Le = class Le {
|
|
|
300
300
|
s ? s.before(n) : t.appendChild(n), console.log(`[RowManager] Rendered ${r} sets into DOM.`);
|
|
301
301
|
}, "#renderRows"));
|
|
302
302
|
v(this, "destroy", /* @__PURE__ */ h(() => {
|
|
303
|
-
e(this,
|
|
303
|
+
e(this, $) && (e(this, $).disconnect(), y(this, $, null));
|
|
304
304
|
}, "destroy"));
|
|
305
|
-
y(this,
|
|
305
|
+
y(this, M, i), e(this, ne).call(this);
|
|
306
306
|
}
|
|
307
307
|
get templateLength() {
|
|
308
308
|
return e(this, _).length || 1;
|
|
309
309
|
}
|
|
310
310
|
};
|
|
311
|
-
|
|
311
|
+
M = new WeakMap(), _ = new WeakMap(), A = new WeakMap(), $ = new WeakMap(), I = new WeakMap(), H = new WeakMap(), ne = new WeakMap(), re = new WeakMap(), oe = new WeakMap(), le = new WeakMap(), h(Le, "RowManager");
|
|
312
312
|
let xe = Le;
|
|
313
|
-
var T,
|
|
313
|
+
var T, U, G, F, ae, ce;
|
|
314
314
|
const j = class j extends HTMLElement {
|
|
315
315
|
constructor() {
|
|
316
316
|
super();
|
|
317
317
|
u(this, T, null);
|
|
318
|
-
u(this,
|
|
318
|
+
u(this, U);
|
|
319
319
|
/**
|
|
320
320
|
* π― 2μ°¨μ μ
격μ μΈλ±μ€λ₯Ό κ³μ°νμ¬ λ³ν©(`rowSpan`/`colSpan`) μ
μ μ λ μ»¬λΌ μμΉλ₯Ό λΆμ¬
|
|
321
321
|
*/
|
|
@@ -355,7 +355,7 @@ const j = class j extends HTMLElement {
|
|
|
355
355
|
/**
|
|
356
356
|
* π― μλ³Έ ν
μ΄λΈμ λΆμνμ¬ κ³ μ μ»¬λΌ μμλ³(left, body, right)λ‘ μλ²½νκ² μͺΌκ°μ§ ν
μ΄λΈ μμ±
|
|
357
357
|
*/
|
|
358
|
-
u(this,
|
|
358
|
+
u(this, F, /* @__PURE__ */ h((t, s) => {
|
|
359
359
|
const n = t.cloneNode(!0), r = n.querySelector("colgroup");
|
|
360
360
|
if (!r) return n;
|
|
361
361
|
const o = Array.from(r.querySelectorAll("col")), a = [];
|
|
@@ -394,14 +394,14 @@ const j = class j extends HTMLElement {
|
|
|
394
394
|
f && e(this, T).querySelectorAll(`[data-col="${c}"]`).forEach((g) => {
|
|
395
395
|
g.setAttribute("fixed", f);
|
|
396
396
|
});
|
|
397
|
-
}),
|
|
397
|
+
}), O.log(e(this, T));
|
|
398
398
|
const o = this.querySelector(".ng-container-left"), a = this.querySelector(".ng-container-body"), d = this.querySelector(".ng-container-right");
|
|
399
399
|
if (a) {
|
|
400
|
-
const l = e(this,
|
|
401
|
-
a.innerHTML = "", a.appendChild(l), e(this,
|
|
400
|
+
const l = e(this, F).call(this, e(this, T), null);
|
|
401
|
+
a.innerHTML = "", a.appendChild(l), e(this, U).initialize(e(this, T));
|
|
402
402
|
}
|
|
403
403
|
if (o) {
|
|
404
|
-
const l = e(this,
|
|
404
|
+
const l = e(this, F).call(this, e(this, T), "left");
|
|
405
405
|
let c = 0;
|
|
406
406
|
l.querySelectorAll("col").forEach((g) => {
|
|
407
407
|
const b = parseInt(g.getAttribute("width"), 10);
|
|
@@ -411,7 +411,7 @@ const j = class j extends HTMLElement {
|
|
|
411
411
|
o.style.flex = `0 0 ${f}px`, o.style.width = `${f}px`;
|
|
412
412
|
}
|
|
413
413
|
if (d) {
|
|
414
|
-
const l = e(this,
|
|
414
|
+
const l = e(this, F).call(this, e(this, T), "right");
|
|
415
415
|
let c = 0;
|
|
416
416
|
l.querySelectorAll("col").forEach((g) => {
|
|
417
417
|
const b = parseInt(g.getAttribute("width"), 10);
|
|
@@ -428,7 +428,7 @@ const j = class j extends HTMLElement {
|
|
|
428
428
|
(l = this.querySelector("nine-table-hscrollbar")) == null || l.refresh();
|
|
429
429
|
}, 0);
|
|
430
430
|
}, "generate"));
|
|
431
|
-
v(this, "getRowHeight", /* @__PURE__ */ h(() => e(this,
|
|
431
|
+
v(this, "getRowHeight", /* @__PURE__ */ h(() => e(this, U).getRowHeight(), "getRowHeight"));
|
|
432
432
|
v(this, "scrollToX", /* @__PURE__ */ h((t) => {
|
|
433
433
|
const s = this.querySelector(".ng-container-body");
|
|
434
434
|
s && (s.scrollLeft = t);
|
|
@@ -438,27 +438,25 @@ const j = class j extends HTMLElement {
|
|
|
438
438
|
s && (s.scrollTop = t);
|
|
439
439
|
}, "scrollToY"));
|
|
440
440
|
u(this, ae, /* @__PURE__ */ h(() => {
|
|
441
|
-
|
|
441
|
+
new MutationObserver((t) => {
|
|
442
442
|
const s = /* @__PURE__ */ h(() => {
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
}
|
|
457
|
-
});
|
|
443
|
+
var f, g, b;
|
|
444
|
+
O.log(":::::::::::::::");
|
|
445
|
+
const n = this.querySelector(".ng-container-left table"), r = this.querySelector(".ng-container-body table"), o = this.querySelector(".ng-container-right table");
|
|
446
|
+
if (!r) return;
|
|
447
|
+
const a = n ? Array.from(n.querySelectorAll("tr")) : [], d = Array.from(r.querySelectorAll("tr")), l = o ? Array.from(o.querySelectorAll("tr")) : [], c = Math.max(a.length, d.length, l.length);
|
|
448
|
+
for (let w = 0; w < c; w++) {
|
|
449
|
+
const S = [
|
|
450
|
+
((f = a[w]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
451
|
+
((g = d[w]) == null ? void 0 : g.getBoundingClientRect().height) || 0,
|
|
452
|
+
((b = l[w]) == null ? void 0 : b.getBoundingClientRect().height) || 0
|
|
453
|
+
], E = Math.max(...S);
|
|
454
|
+
E > 0 && (a[w] && (a[w].style.height = `${E}px`), d[w] && (d[w].style.height = `${E}px`), l[w] && (l[w].style.height = `${E}px`));
|
|
455
|
+
}
|
|
458
456
|
}, "syncRowHeights");
|
|
459
457
|
for (const n of t)
|
|
460
458
|
n.attributeName === "class" && this.classList.contains("active") && s();
|
|
461
|
-
}).observe(this, { attributes: !0 });
|
|
459
|
+
}).observe(this, { attributes: !0 }), e(this, ce).call(this);
|
|
462
460
|
}, "#init"));
|
|
463
461
|
u(this, ce, /* @__PURE__ */ h(() => {
|
|
464
462
|
const t = j.SCROLLBAR_SIZE;
|
|
@@ -584,16 +582,16 @@ const j = class j extends HTMLElement {
|
|
|
584
582
|
</div>
|
|
585
583
|
`;
|
|
586
584
|
}, "#render"));
|
|
587
|
-
y(this,
|
|
585
|
+
y(this, U, new xe(this));
|
|
588
586
|
}
|
|
589
587
|
connectedCallback() {
|
|
590
588
|
e(this, ae).call(this);
|
|
591
589
|
}
|
|
592
590
|
disconnectedCallback() {
|
|
593
|
-
this.innerHTML = "",
|
|
591
|
+
this.innerHTML = "", O.log("NineTableSheet destroyed.");
|
|
594
592
|
}
|
|
595
593
|
};
|
|
596
|
-
T = new WeakMap(),
|
|
594
|
+
T = new WeakMap(), U = new WeakMap(), G = new WeakMap(), F = new WeakMap(), ae = new WeakMap(), ce = new WeakMap(), h(j, "NineTableSheet"), v(j, "SCROLLBAR_SIZE", 16);
|
|
597
595
|
let te = j;
|
|
598
596
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", te);
|
|
599
597
|
var he, J;
|
|
@@ -780,13 +778,13 @@ const _e = class _e {
|
|
|
780
778
|
};
|
|
781
779
|
R = new WeakMap(), de = new WeakMap(), Q = new WeakMap(), fe = new WeakMap(), h(_e, "LayoutManager");
|
|
782
780
|
let Se = _e;
|
|
783
|
-
var
|
|
781
|
+
var W, X;
|
|
784
782
|
const Ie = class Ie {
|
|
785
783
|
constructor(i) {
|
|
786
|
-
u(this,
|
|
784
|
+
u(this, W);
|
|
787
785
|
u(this, X, -1);
|
|
788
|
-
v(this, "count", /* @__PURE__ */ h(() => e(this,
|
|
789
|
-
y(this,
|
|
786
|
+
v(this, "count", /* @__PURE__ */ h(() => e(this, W).rawRecords.length, "count"));
|
|
787
|
+
y(this, W, i);
|
|
790
788
|
}
|
|
791
789
|
get at() {
|
|
792
790
|
return e(this, X);
|
|
@@ -794,16 +792,16 @@ const Ie = class Ie {
|
|
|
794
792
|
set at(i) {
|
|
795
793
|
var s, n;
|
|
796
794
|
y(this, X, parseInt(i, 10));
|
|
797
|
-
const t = ((n = (s = e(this,
|
|
795
|
+
const t = ((n = (s = e(this, W).owner).querySelector) == null ? void 0 : n.call(s, ".ng-container-body")) || e(this, W).owner.body;
|
|
798
796
|
t && !t.querySelector(`tbody.bindable tr[data-row="${e(this, X)}"]`) && setTimeout(() => {
|
|
799
797
|
var r, o;
|
|
800
|
-
(o = (r = e(this,
|
|
798
|
+
(o = (r = e(this, W).owner).scrollTo_V1) == null || o.call(r, e(this, X));
|
|
801
799
|
});
|
|
802
800
|
}
|
|
803
801
|
};
|
|
804
|
-
|
|
802
|
+
W = new WeakMap(), X = new WeakMap(), h(Ie, "ngRow");
|
|
805
803
|
let Ee = Ie;
|
|
806
|
-
var q, x, k, K, ue,
|
|
804
|
+
var q, x, k, K, ue, z, ge, ee, be, ye, Z;
|
|
807
805
|
const L = class L {
|
|
808
806
|
constructor(i, t) {
|
|
809
807
|
u(this, q);
|
|
@@ -811,15 +809,15 @@ const L = class L {
|
|
|
811
809
|
u(this, k, []);
|
|
812
810
|
u(this, K, []);
|
|
813
811
|
u(this, ue, 0);
|
|
814
|
-
u(this,
|
|
812
|
+
u(this, z, []);
|
|
815
813
|
u(this, ge, /* @__PURE__ */ h(() => {
|
|
816
|
-
y(this,
|
|
814
|
+
y(this, z, []);
|
|
817
815
|
const i = e(this, q).template || [];
|
|
818
816
|
Array.from(i).forEach((t) => {
|
|
819
817
|
var s;
|
|
820
|
-
e(this,
|
|
818
|
+
e(this, z).push(((s = t.getBoundingClientRect) == null ? void 0 : s.call(t).height) || 24);
|
|
821
819
|
}), (e(this, x).rawRecords || []).forEach((t) => {
|
|
822
|
-
t.__ng || (t.__ng = e(this, ee).call(this)), t.__ng.height = e(this,
|
|
820
|
+
t.__ng || (t.__ng = e(this, ee).call(this)), t.__ng.height = e(this, z).slice();
|
|
823
821
|
});
|
|
824
822
|
}, "#initialize"));
|
|
825
823
|
v(this, "set", /* @__PURE__ */ h((i) => {
|
|
@@ -829,10 +827,10 @@ const L = class L {
|
|
|
829
827
|
rowState: L.ROW_STATE.EMPTY,
|
|
830
828
|
deleted: !1,
|
|
831
829
|
filtered: !1,
|
|
832
|
-
height: e(this,
|
|
830
|
+
height: e(this, z).slice(),
|
|
833
831
|
o: {},
|
|
834
832
|
c: {},
|
|
835
|
-
_: [0, 0, 0, 0, L.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this,
|
|
833
|
+
_: [0, 0, 0, 0, L.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, z).slice(), -1, {}, {}]
|
|
836
834
|
}), "#getDefaultMeta"));
|
|
837
835
|
v(this, "reset", /* @__PURE__ */ h(() => {
|
|
838
836
|
y(this, k, []), y(this, K, []);
|
|
@@ -939,7 +937,7 @@ const L = class L {
|
|
|
939
937
|
return this.length;
|
|
940
938
|
}
|
|
941
939
|
};
|
|
942
|
-
q = new WeakMap(), x = new WeakMap(), k = new WeakMap(), K = new WeakMap(), ue = new WeakMap(),
|
|
940
|
+
q = new WeakMap(), x = new WeakMap(), k = new WeakMap(), K = new WeakMap(), ue = new WeakMap(), z = new WeakMap(), ge = new WeakMap(), ee = new WeakMap(), be = new WeakMap(), ye = new WeakMap(), Z = new WeakMap(), h(L, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
943
941
|
v(L, "ROW_STATE", {
|
|
944
942
|
EMPTY: "EMPTY",
|
|
945
943
|
NORMAL: "NORMAL",
|
|
@@ -979,10 +977,10 @@ const Me = class Me extends HTMLElement {
|
|
|
979
977
|
this.attachShadow({ mode: "open" }), y(this, Y, new Ae(this));
|
|
980
978
|
}
|
|
981
979
|
connectedCallback() {
|
|
982
|
-
y(this, pe, new Se(this)),
|
|
980
|
+
y(this, pe, new Se(this)), O.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
983
981
|
}
|
|
984
982
|
disconnectedCallback() {
|
|
985
|
-
|
|
983
|
+
O.log("NineTable disconnected.");
|
|
986
984
|
}
|
|
987
985
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
988
986
|
get data() {
|