@ninebone/table 0.0.345 β 0.0.346
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 +20 -20
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +2 -2
- 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 te = class te extends ge.constructor {
|
|
|
22
22
|
};
|
|
23
23
|
a(te, "Trace");
|
|
24
24
|
let Pt = te;
|
|
25
|
-
const
|
|
25
|
+
const I = new Pt();
|
|
26
26
|
var _, W, y, N, B, P, mt, Y, xt;
|
|
27
27
|
const ee = class ee extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
@@ -59,7 +59,7 @@ const ee = class ee extends HTMLElement {
|
|
|
59
59
|
let p = 0;
|
|
60
60
|
g > 0 && (p = parseInt(u / g * (d - f), 10)), p < 0 && (p = 0);
|
|
61
61
|
const E = d - f;
|
|
62
|
-
p > E && (p = E), r.style.left = `${p}px`,
|
|
62
|
+
p > E && (p = E), r.style.left = `${p}px`, I.log(p), t(this, y).left.disabled = p === 0, t(this, y).right.disabled = p >= E - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
64
|
h(this, Y, /* @__PURE__ */ a((e) => {
|
|
65
65
|
if (!t(this, y)) return !1;
|
|
@@ -243,7 +243,7 @@ const ie = class ie extends HTMLElement {
|
|
|
243
243
|
const o = /* @__PURE__ */ a((n) => {
|
|
244
244
|
if (!t(this, O)) return;
|
|
245
245
|
const l = t(this, v).track.getBoundingClientRect(), c = t(this, v).thumb.clientHeight, f = l.height - c, u = n.clientY - t(this, ot), g = e.clientHeight, p = e.querySelector("table");
|
|
246
|
-
|
|
246
|
+
I.log(p), I.log(p.scrollHeight);
|
|
247
247
|
const H = p.scrollHeight - g;
|
|
248
248
|
if (f > 0 && H > 0) {
|
|
249
249
|
const yt = u / f * H;
|
|
@@ -425,12 +425,12 @@ wt = new WeakMap(), G = new WeakMap(), a(C, "TableCompiler"), h(C, wt, /* @__PUR
|
|
|
425
425
|
});
|
|
426
426
|
}, "#resetColIndex"));
|
|
427
427
|
let Xt = C;
|
|
428
|
-
var X, w,
|
|
428
|
+
var X, w, M, A, z, U, J, St, Et, lt, at, Rt, At, ct, Q, kt;
|
|
429
429
|
const se = class se {
|
|
430
430
|
constructor(i) {
|
|
431
431
|
h(this, X);
|
|
432
432
|
h(this, w);
|
|
433
|
-
h(this,
|
|
433
|
+
h(this, M, /* @__PURE__ */ new Map());
|
|
434
434
|
h(this, A, null);
|
|
435
435
|
h(this, z, null);
|
|
436
436
|
h(this, U, 0);
|
|
@@ -441,7 +441,7 @@ const se = class se {
|
|
|
441
441
|
i && (t(this, lt).call(this), t(this, Q).call(this, i.scrollTop), (e = t(this, w).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
442
442
|
}, "refresh"));
|
|
443
443
|
x(this, "initialize", /* @__PURE__ */ a(() => {
|
|
444
|
-
b(this, A, null), t(this,
|
|
444
|
+
b(this, A, null), t(this, M).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
445
445
|
const r = t(this, w).querySelector(o);
|
|
446
446
|
if (!r) return;
|
|
447
447
|
const n = r.querySelector("table");
|
|
@@ -449,7 +449,7 @@ const se = class se {
|
|
|
449
449
|
const l = n.querySelector("tbody.bindable-tbody");
|
|
450
450
|
if (!l) return;
|
|
451
451
|
const d = Array.from(l.querySelectorAll("tr")).map((f) => f.cloneNode(!0));
|
|
452
|
-
t(this,
|
|
452
|
+
t(this, M).set(o, d);
|
|
453
453
|
});
|
|
454
454
|
const i = t(this, w).querySelector(".ng-container-body"), e = t(this, w).querySelector(".ng-container-left"), s = t(this, w).querySelector(".ng-container-right");
|
|
455
455
|
if (i) {
|
|
@@ -466,7 +466,7 @@ const se = class se {
|
|
|
466
466
|
}
|
|
467
467
|
}, "initialize"));
|
|
468
468
|
h(this, St, /* @__PURE__ */ a((i, e) => {
|
|
469
|
-
const s = t(this,
|
|
469
|
+
const s = t(this, M).get(e);
|
|
470
470
|
if (!s || s.length === 0) return;
|
|
471
471
|
const o = i.querySelector("tbody.bindable-tbody");
|
|
472
472
|
if (!o) return;
|
|
@@ -481,7 +481,7 @@ const se = class se {
|
|
|
481
481
|
h(this, Et, /* @__PURE__ */ a((i) => {
|
|
482
482
|
if (t(this, A) !== null && t(this, A) > 0)
|
|
483
483
|
return t(this, A);
|
|
484
|
-
const e = t(this,
|
|
484
|
+
const e = t(this, M).get(".ng-container-body");
|
|
485
485
|
if (!e || e.length === 0) return 24;
|
|
486
486
|
const s = i.querySelector("tbody.bindable-tbody") || i.querySelector("tbody.bindable-tbody:last-of-type");
|
|
487
487
|
if (!s) return 24;
|
|
@@ -553,7 +553,7 @@ const se = class se {
|
|
|
553
553
|
var r;
|
|
554
554
|
const e = t(this, A);
|
|
555
555
|
if (!e || e <= 0) return;
|
|
556
|
-
const s = Math.max(0, Math.floor(i / e)), o = ((r = t(this,
|
|
556
|
+
const s = Math.max(0, Math.floor(i / e)), o = ((r = t(this, M).get(".ng-container-body")) == null ? void 0 : r.length) || 1;
|
|
557
557
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
558
558
|
const l = t(this, w).querySelector(n);
|
|
559
559
|
if (!l) return;
|
|
@@ -561,12 +561,12 @@ const se = class se {
|
|
|
561
561
|
if (!c) return;
|
|
562
562
|
Array.from(c.querySelectorAll("tr:not(.nodata)")).forEach((f, u) => {
|
|
563
563
|
const g = s + Math.floor(u / o), p = t(this, X).data.get(g);
|
|
564
|
-
|
|
564
|
+
I.log("--", t(this, X).data.get(0)), f.style.display = "", t(this, kt).call(this, f, p, g);
|
|
565
565
|
});
|
|
566
566
|
});
|
|
567
567
|
}, "#handleScroll"));
|
|
568
568
|
h(this, kt, /* @__PURE__ */ a((i, e, s) => {
|
|
569
|
-
i.dataset.row = s,
|
|
569
|
+
i.dataset.row = s, I.log(i, e, s), Array.from(i.cells).forEach((o, r) => {
|
|
570
570
|
const n = o.dataset.bind;
|
|
571
571
|
n && e && e[n] !== void 0 ? o.textContent = e[n] : o.textContent = e ? e[Object.keys(e)[r]] ?? `R${s}C${r}` : `ν ${s + 1}`, o.dataset.row = s;
|
|
572
572
|
});
|
|
@@ -581,10 +581,10 @@ const se = class se {
|
|
|
581
581
|
}
|
|
582
582
|
templateLength(i = ".ng-container-body") {
|
|
583
583
|
var e;
|
|
584
|
-
return ((e = t(this,
|
|
584
|
+
return ((e = t(this, M).get(i)) == null ? void 0 : e.length) || 1;
|
|
585
585
|
}
|
|
586
586
|
};
|
|
587
|
-
X = new WeakMap(), w = new WeakMap(),
|
|
587
|
+
X = new WeakMap(), w = new WeakMap(), M = new WeakMap(), A = new WeakMap(), z = new WeakMap(), U = new WeakMap(), J = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), lt = new WeakMap(), at = new WeakMap(), Rt = new WeakMap(), At = new WeakMap(), ct = new WeakMap(), Q = new WeakMap(), kt = new WeakMap(), a(se, "RowManager");
|
|
588
588
|
let Ut = se;
|
|
589
589
|
var Tt, tt, j, qt, Lt, Ht, Ct, _t;
|
|
590
590
|
const nt = class nt extends HTMLElement {
|
|
@@ -817,7 +817,7 @@ const nt = class nt extends HTMLElement {
|
|
|
817
817
|
t(this, Ct).call(this);
|
|
818
818
|
}
|
|
819
819
|
disconnectedCallback() {
|
|
820
|
-
this.innerHTML = "",
|
|
820
|
+
this.innerHTML = "", I.log("NineTableSheet destroyed.");
|
|
821
821
|
}
|
|
822
822
|
};
|
|
823
823
|
Tt = new WeakMap(), tt = new WeakMap(), j = new WeakMap(), qt = new WeakMap(), Lt = new WeakMap(), Ht = new WeakMap(), Ct = new WeakMap(), _t = new WeakMap(), a(nt, "NineTableSheet"), x(nt, "SCROLLBAR_SIZE", 16);
|
|
@@ -896,7 +896,7 @@ const oe = class oe {
|
|
|
896
896
|
const i = Array.from(t(this, dt).querySelectorAll("table"));
|
|
897
897
|
if (!(!i || i.length === 0)) {
|
|
898
898
|
for (const e of i)
|
|
899
|
-
|
|
899
|
+
I.log(e), $("[data-bind]", e).each((s, o) => {
|
|
900
900
|
const r = o.dataset.bind, n = o.getAttribute("data-type") || "string";
|
|
901
901
|
r && t(this, R).push({ name: r, type: n });
|
|
902
902
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
@@ -923,7 +923,7 @@ const oe = class oe {
|
|
|
923
923
|
t(this, ft).call(this);
|
|
924
924
|
}
|
|
925
925
|
}, "#init"));
|
|
926
|
-
b(this, dt, i), t(this, It).call(this)
|
|
926
|
+
b(this, dt, i), t(this, It).call(this);
|
|
927
927
|
}
|
|
928
928
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
929
929
|
get() {
|
|
@@ -1276,13 +1276,13 @@ const ce = class ce extends HTMLElement {
|
|
|
1276
1276
|
//#created = false;
|
|
1277
1277
|
h(this, Z);
|
|
1278
1278
|
h(this, Bt);
|
|
1279
|
-
this.attachShadow({ mode: "open" }), b(this, Z, new Jt(this))
|
|
1279
|
+
this.fields = new Ft(this), this.attachShadow({ mode: "open" }), b(this, Z, new Jt(this));
|
|
1280
1280
|
}
|
|
1281
1281
|
connectedCallback() {
|
|
1282
|
-
b(this, Bt, new Kt(this)),
|
|
1282
|
+
b(this, Bt, new Kt(this)), I.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1283
1283
|
}
|
|
1284
1284
|
disconnectedCallback() {
|
|
1285
|
-
|
|
1285
|
+
I.log("NineTable disconnected.");
|
|
1286
1286
|
}
|
|
1287
1287
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1288
1288
|
get data() {
|