@ninebone/table 0.0.589 → 0.0.591
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 +99 -89
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +22 -8
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
var Fe = Object.defineProperty;
|
|
2
|
-
var Ve = (
|
|
3
|
-
throw TypeError(
|
|
2
|
+
var Ve = (q) => {
|
|
3
|
+
throw TypeError(q);
|
|
4
4
|
};
|
|
5
|
-
var Xe = (
|
|
6
|
-
var h = (
|
|
7
|
-
var A = (
|
|
8
|
-
var t = (
|
|
9
|
-
var Ue = (
|
|
5
|
+
var Xe = (q, r, e) => r in q ? Fe(q, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : q[r] = e;
|
|
6
|
+
var h = (q, r) => Fe(q, "name", { value: r, configurable: !0 });
|
|
7
|
+
var A = (q, r, e) => Xe(q, typeof r != "symbol" ? r + "" : r, e), Ye = (q, r, e) => r.has(q) || Ve("Cannot " + e);
|
|
8
|
+
var t = (q, r, e) => (Ye(q, r, "read from private field"), e ? e.call(q) : r.get(q)), d = (q, r, e) => r.has(q) ? Ve("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(q) : r.set(q, e), p = (q, r, e, s) => (Ye(q, r, "write to private field"), s ? s.call(q, e) : r.set(q, e), e);
|
|
9
|
+
var Ue = (q, r, e, s) => ({
|
|
10
10
|
set _(i) {
|
|
11
|
-
p(
|
|
11
|
+
p(q, r, i, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
|
-
return t(
|
|
14
|
+
return t(q, r, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
import { trace as Ke } from "@ninebone/util";
|
|
@@ -201,21 +201,21 @@ const Me = class Me extends HTMLElement {
|
|
|
201
201
|
P = new WeakMap(), j = new WeakMap(), w = new WeakMap(), X = new WeakMap(), K = new WeakMap(), Z = new WeakMap(), It = new WeakMap(), G = new WeakMap(), _t = new WeakMap(), h(Me, "NineTableHScrollBar");
|
|
202
202
|
let ae = Me;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ae);
|
|
204
|
-
var F, at, J,
|
|
204
|
+
var F, at, J, R, vt, xt, Nt;
|
|
205
205
|
const $e = class $e extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
208
|
d(this, F);
|
|
209
209
|
d(this, at);
|
|
210
210
|
d(this, J, !1);
|
|
211
|
-
d(this,
|
|
212
|
-
d(this, xt, 0);
|
|
211
|
+
d(this, R);
|
|
213
212
|
d(this, vt, 0);
|
|
213
|
+
d(this, xt, 0);
|
|
214
214
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
|
-
if (!t(this, F) || !t(this,
|
|
216
|
-
const e = t(this,
|
|
215
|
+
if (!t(this, F) || !t(this, R)) return;
|
|
216
|
+
const e = t(this, R).container, s = t(this, R).track, i = t(this, R).thumb, n = e.clientHeight, a = (t(this, F).data.get() || []).length, c = t(this, at).getRowHeight(), l = a * c;
|
|
217
217
|
if (l <= n) {
|
|
218
|
-
i.style.display = "none", t(this,
|
|
218
|
+
i.style.display = "none", t(this, R).top.disabled = !0, t(this, R).bottom.disabled = !0;
|
|
219
219
|
return;
|
|
220
220
|
} else
|
|
221
221
|
i.style.display = "block";
|
|
@@ -226,45 +226,45 @@ const $e = class $e extends HTMLElement {
|
|
|
226
226
|
const g = e.scrollTop, b = Math.max(l - n, 1);
|
|
227
227
|
let m = 0;
|
|
228
228
|
b > 0 && (m = g / b * (f - u));
|
|
229
|
-
const
|
|
230
|
-
m < 0 && (m = 0), m >
|
|
229
|
+
const x = f - u;
|
|
230
|
+
m < 0 && (m = 0), m > x && (m = x), i.style.top = `${m}px`, t(this, R).top.disabled = g <= 0, t(this, R).bottom.disabled = g >= b - 1;
|
|
231
231
|
}, "refresh"));
|
|
232
232
|
d(this, Nt, /* @__PURE__ */ h(() => {
|
|
233
233
|
W.log("nine-table-vscrollbar.#init");
|
|
234
|
-
const e = t(this,
|
|
234
|
+
const e = t(this, R).container, s = /* @__PURE__ */ h(() => {
|
|
235
235
|
const n = (t(this, F).data.get() || []).length, o = t(this, at).getRowHeight();
|
|
236
236
|
return n * o;
|
|
237
237
|
}, "getContentHeight");
|
|
238
238
|
e.addEventListener("scroll", () => {
|
|
239
239
|
t(this, J) || this.refresh();
|
|
240
|
-
}), t(this,
|
|
240
|
+
}), t(this, R).thumb.addEventListener("mousedown", (i) => {
|
|
241
241
|
if (i.button !== 0) return;
|
|
242
|
-
i.stopPropagation(), i.preventDefault(), p(this, J, !0), p(this,
|
|
242
|
+
i.stopPropagation(), i.preventDefault(), p(this, J, !0), p(this, vt, i.clientY), p(this, xt, e.scrollTop);
|
|
243
243
|
const n = /* @__PURE__ */ h((a) => {
|
|
244
244
|
if (!t(this, J)) return;
|
|
245
|
-
const c = t(this,
|
|
246
|
-
if (u > 0 &&
|
|
247
|
-
const E = g / u *
|
|
248
|
-
let
|
|
245
|
+
const c = t(this, R).track.getBoundingClientRect(), l = t(this, R).thumb.clientHeight, u = c.height - l, g = a.clientY - t(this, vt), b = e.clientHeight, m = s(), x = Math.max(m - b, 1);
|
|
246
|
+
if (u > 0 && x > 0) {
|
|
247
|
+
const E = g / u * x;
|
|
248
|
+
let v = t(this, xt) + E;
|
|
249
249
|
const M = Math.max(0, m - b);
|
|
250
|
-
|
|
250
|
+
v < 0 && (v = 0), v > M && (v = M), e.scrollTop = v;
|
|
251
251
|
}
|
|
252
252
|
this.refresh();
|
|
253
253
|
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
254
254
|
p(this, J, !1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), this.refresh();
|
|
255
255
|
}, "onMouseUp");
|
|
256
256
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", o);
|
|
257
|
-
}), t(this,
|
|
258
|
-
if (i.button !== 0 || i.target === t(this,
|
|
259
|
-
const n = t(this,
|
|
257
|
+
}), t(this, R).track.addEventListener("mousedown", (i) => {
|
|
258
|
+
if (i.button !== 0 || i.target === t(this, R).thumb) return;
|
|
259
|
+
const n = t(this, R).track.getBoundingClientRect(), o = t(this, R).thumb.clientHeight, a = i.clientY - n.top - o / 2, l = n.height - o, f = e.clientHeight, u = s(), g = Math.max(u - f, 1);
|
|
260
260
|
if (l > 0 && g > 0) {
|
|
261
261
|
const b = Math.max(0, Math.min(1, a / l));
|
|
262
262
|
e.scrollTop = b * g;
|
|
263
263
|
}
|
|
264
264
|
this.refresh();
|
|
265
|
-
}), t(this,
|
|
265
|
+
}), t(this, R).top.addEventListener("click", () => {
|
|
266
266
|
e.scrollTop -= 40;
|
|
267
|
-
}), t(this,
|
|
267
|
+
}), t(this, R).bottom.addEventListener("click", () => {
|
|
268
268
|
e.scrollTop += 40;
|
|
269
269
|
});
|
|
270
270
|
}, "#init"));
|
|
@@ -340,7 +340,7 @@ const $e = class $e extends HTMLElement {
|
|
|
340
340
|
setTimeout(e, 10);
|
|
341
341
|
return;
|
|
342
342
|
}
|
|
343
|
-
p(this,
|
|
343
|
+
p(this, R, {
|
|
344
344
|
container: s,
|
|
345
345
|
track: this.querySelector(".ng-scroll-track"),
|
|
346
346
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
@@ -351,10 +351,10 @@ const $e = class $e extends HTMLElement {
|
|
|
351
351
|
e();
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
|
-
F = new WeakMap(), at = new WeakMap(), J = new WeakMap(),
|
|
354
|
+
F = new WeakMap(), at = new WeakMap(), J = new WeakMap(), R = new WeakMap(), vt = new WeakMap(), xt = new WeakMap(), Nt = new WeakMap(), h($e, "NineTableVScrollBar");
|
|
355
355
|
let le = $e;
|
|
356
356
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", le);
|
|
357
|
-
var D, S, Q, z, I, V, tt, wt, Se, Ee, Wt, Ot, Bt, St, Et, Pt, zt, At, Ae, lt,
|
|
357
|
+
var D, S, Q, z, I, V, tt, wt, Se, Ee, Wt, Ot, Bt, St, Et, Pt, zt, At, Ae, lt, qt, Dt;
|
|
358
358
|
const Ie = class Ie {
|
|
359
359
|
constructor(r) {
|
|
360
360
|
d(this, D);
|
|
@@ -461,26 +461,26 @@ const Ie = class Ie {
|
|
|
461
461
|
var a, c, l, f, u, g;
|
|
462
462
|
const r = t(this, S).querySelector(".ng-container-left .ng-part-body table"), e = t(this, S).querySelector(".ng-container-body .ng-part-body table"), s = t(this, S).querySelector(".ng-container-right .ng-part-body table");
|
|
463
463
|
if (e) {
|
|
464
|
-
const b = r ? Array.from(r.querySelectorAll("tbody tr")) : [], m = Array.from(e.querySelectorAll("tbody tr")),
|
|
465
|
-
for (let
|
|
464
|
+
const b = r ? Array.from(r.querySelectorAll("tbody tr")) : [], m = Array.from(e.querySelectorAll("tbody tr")), x = s ? Array.from(s.querySelectorAll("tbody tr")) : [], E = Math.max(b.length, m.length, x.length);
|
|
465
|
+
for (let v = 0; v < E; v++) {
|
|
466
466
|
const M = [
|
|
467
|
-
((a = b[
|
|
468
|
-
((c = m[
|
|
469
|
-
((l = v
|
|
467
|
+
((a = b[v]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
468
|
+
((c = m[v]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
469
|
+
((l = x[v]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
470
470
|
], T = Math.max(...M);
|
|
471
|
-
T > 0 && (b[
|
|
471
|
+
T > 0 && (b[v] && (b[v].style.height = `${T}px`), m[v] && (m[v].style.height = `${T}px`), x[v] && (x[v].style.height = `${T}px`));
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
474
|
const i = t(this, S).querySelector(".ng-container-left .ng-part-footer table"), n = t(this, S).querySelector(".ng-container-body .ng-part-footer table"), o = t(this, S).querySelector(".ng-container-right .ng-part-footer table");
|
|
475
475
|
if (n) {
|
|
476
|
-
const b = i ? Array.from(i.querySelectorAll("tfoot tr")) : [], m = Array.from(n.querySelectorAll("tfoot tr")),
|
|
477
|
-
for (let
|
|
476
|
+
const b = i ? Array.from(i.querySelectorAll("tfoot tr")) : [], m = Array.from(n.querySelectorAll("tfoot tr")), x = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], E = Math.max(b.length, m.length, x.length);
|
|
477
|
+
for (let v = 0; v < E; v++) {
|
|
478
478
|
const M = [
|
|
479
|
-
((f = b[
|
|
480
|
-
((u = m[
|
|
481
|
-
((g = v
|
|
479
|
+
((f = b[v]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
480
|
+
((u = m[v]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
|
|
481
|
+
((g = x[v]) == null ? void 0 : g.getBoundingClientRect().height) || 0
|
|
482
482
|
], T = Math.max(...M);
|
|
483
|
-
T > 0 && (b[
|
|
483
|
+
T > 0 && (b[v] && (b[v].style.height = `${T}px`), m[v] && (m[v].style.height = `${T}px`), x[v] && (x[v].style.height = `${T}px`));
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
486
|
}, "#syncRowHeights"));
|
|
@@ -521,7 +521,7 @@ const Ie = class Ie {
|
|
|
521
521
|
return;
|
|
522
522
|
}
|
|
523
523
|
const b = t(this, D).data.get(g);
|
|
524
|
-
f.style.display = "", t(this,
|
|
524
|
+
f.style.display = "", t(this, qt).call(this, f, b, g);
|
|
525
525
|
});
|
|
526
526
|
});
|
|
527
527
|
}, "#adjustBufferRows"));
|
|
@@ -539,14 +539,14 @@ const Ie = class Ie {
|
|
|
539
539
|
if (!b) return;
|
|
540
540
|
const m = b.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
541
541
|
if (!m) return;
|
|
542
|
-
Array.from(m.querySelectorAll("tr:not(.nodata)")).forEach((E,
|
|
543
|
-
const M = o + Math.floor(
|
|
542
|
+
Array.from(m.querySelectorAll("tr:not(.nodata)")).forEach((E, v) => {
|
|
543
|
+
const M = o + Math.floor(v / i);
|
|
544
544
|
if (M >= s) {
|
|
545
545
|
E.style.display = "none";
|
|
546
546
|
return;
|
|
547
547
|
}
|
|
548
548
|
const T = t(this, D).data.get(M);
|
|
549
|
-
E.style.display = "", t(this,
|
|
549
|
+
E.style.display = "", t(this, qt).call(this, E, T, M);
|
|
550
550
|
});
|
|
551
551
|
});
|
|
552
552
|
}, "#handleScroll"));
|
|
@@ -564,7 +564,7 @@ const Ie = class Ie {
|
|
|
564
564
|
cell.dataset.row = dataIndex;
|
|
565
565
|
});
|
|
566
566
|
}; */
|
|
567
|
-
d(this,
|
|
567
|
+
d(this, qt, /* @__PURE__ */ h((r, e, s) => {
|
|
568
568
|
r.dataset.row = s, r.data = e, Array.from(r.cells).forEach((i, n) => {
|
|
569
569
|
i.dataset.row = s;
|
|
570
570
|
const o = Array.from(i.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
|
|
@@ -599,7 +599,7 @@ const Ie = class Ie {
|
|
|
599
599
|
return ((e = t(this, z).get(r)) == null ? void 0 : e.length) || 1;
|
|
600
600
|
}
|
|
601
601
|
};
|
|
602
|
-
D = new WeakMap(), S = new WeakMap(), Q = new WeakMap(), z = new WeakMap(), I = new WeakMap(), V = new WeakMap(), tt = new WeakMap(), wt = new WeakMap(), Se = new WeakMap(), Ee = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), Bt = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), Pt = new WeakMap(), zt = new WeakMap(), At = new WeakMap(), Ae = new WeakMap(), lt = new WeakMap(),
|
|
602
|
+
D = new WeakMap(), S = new WeakMap(), Q = new WeakMap(), z = new WeakMap(), I = new WeakMap(), V = new WeakMap(), tt = new WeakMap(), wt = new WeakMap(), Se = new WeakMap(), Ee = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), Bt = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), Pt = new WeakMap(), zt = new WeakMap(), At = new WeakMap(), Ae = new WeakMap(), lt = new WeakMap(), qt = new WeakMap(), Dt = new WeakMap(), h(Ie, "RowManager");
|
|
603
603
|
let ce = Ie;
|
|
604
604
|
const jt = class jt {
|
|
605
605
|
/**
|
|
@@ -618,9 +618,9 @@ const jt = class jt {
|
|
|
618
618
|
const f = l.getAttribute("cell-type") || "renderer";
|
|
619
619
|
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
620
620
|
let u = `cell-${f}`;
|
|
621
|
-
const g = l.getAttribute("data-bind"), b = l.getAttribute("data-expr"), m = l.getAttribute("maxbyte"),
|
|
621
|
+
const g = l.getAttribute("data-bind"), b = l.getAttribute("data-expr"), m = l.getAttribute("maxbyte"), x = l.getAttribute("type");
|
|
622
622
|
let E = [];
|
|
623
|
-
g && E.push(`data-bind="${g}"`), b && E.push(`data-expr="${b}"`), m && E.push(`maxbyte="${m}"`),
|
|
623
|
+
g && E.push(`data-bind="${g}"`), b && E.push(`data-expr="${b}"`), m && E.push(`maxbyte="${m}"`), x && E.push(`type="${x}"`), l.innerHTML = `<${u} ${E.join(" ")}></${u}>`;
|
|
624
624
|
});
|
|
625
625
|
}, "processCellTypes"), s = /* @__PURE__ */ h((a) => {
|
|
626
626
|
if (!a.querySelector("colgroup")) {
|
|
@@ -645,25 +645,25 @@ const jt = class jt {
|
|
|
645
645
|
});
|
|
646
646
|
const b = Array.from(Array(u), () => Array(g).fill(null));
|
|
647
647
|
l.forEach((m) => {
|
|
648
|
-
const
|
|
648
|
+
const x = m.sectionRowIndex;
|
|
649
649
|
let E = 0;
|
|
650
|
-
Array.from(m.querySelectorAll("th,td")).forEach((
|
|
651
|
-
for (let B = 0; B < b[
|
|
652
|
-
if (b[
|
|
650
|
+
Array.from(m.querySelectorAll("th,td")).forEach((v) => {
|
|
651
|
+
for (let B = 0; B < b[x].length; B++)
|
|
652
|
+
if (b[x][B] === null) {
|
|
653
653
|
E = B;
|
|
654
654
|
break;
|
|
655
655
|
}
|
|
656
|
-
const M =
|
|
656
|
+
const M = v.rowSpan || 1, T = v.colSpan || 1;
|
|
657
657
|
for (let B = 0; B < M; B++)
|
|
658
658
|
for (let pt = 0; pt < T; pt++)
|
|
659
|
-
|
|
659
|
+
x + B < u && E + pt < g && (b[x + B][E + pt] = B === 0 && pt === 0 ? "1" : "0");
|
|
660
660
|
});
|
|
661
661
|
}), l.forEach((m) => {
|
|
662
|
-
const
|
|
662
|
+
const x = m.sectionRowIndex;
|
|
663
663
|
Array.from(m.querySelectorAll("th,td")).forEach((E) => {
|
|
664
|
-
for (let
|
|
665
|
-
if (b[
|
|
666
|
-
E.dataset.col =
|
|
664
|
+
for (let v = 0; v < b[x].length; v++)
|
|
665
|
+
if (b[x][v] === "1") {
|
|
666
|
+
E.dataset.col = v, b[x][v] = "0";
|
|
667
667
|
break;
|
|
668
668
|
}
|
|
669
669
|
});
|
|
@@ -699,14 +699,10 @@ const yt = class yt extends HTMLElement {
|
|
|
699
699
|
const n = this.querySelector(s);
|
|
700
700
|
if (!n) return;
|
|
701
701
|
n.querySelector(".ng-part-header").appendChild(t(this, ct).call(this, t(this, et), i, "header"));
|
|
702
|
-
const a =
|
|
703
|
-
|
|
704
|
-
const c = document.createElement("div");
|
|
705
|
-
c.className = "ng-scroll-content", c.style.position = "relative", c.style.width = "100%", c.appendChild(t(this, ct).call(this, t(this, et), i, "body"));
|
|
702
|
+
const a = n.querySelector(".ng-part-body"), c = n.querySelector(".ng-scroll-content");
|
|
703
|
+
c.appendChild(t(this, ct).call(this, t(this, et), i, "body"));
|
|
706
704
|
const l = document.createElement("div");
|
|
707
|
-
l.className = "ng-virtual-spacer", l.style.width = "100%", l.style.pointerEvents = "none", c.appendChild(l), a.appendChild(c);
|
|
708
|
-
const f = document.createElement("div");
|
|
709
|
-
f.className = "ng-part-footer", f.appendChild(t(this, ct).call(this, t(this, et), i, "footer")), n.appendChild(a), n.appendChild(f);
|
|
705
|
+
l.className = "ng-virtual-spacer", l.style.width = "100%", l.style.pointerEvents = "none", c.appendChild(l), a.appendChild(c), n.querySelector(".ng-part-footer").appendChild(t(this, ct).call(this, t(this, et), i, "footer"));
|
|
710
706
|
});
|
|
711
707
|
}, "#renderSplitContainers"));
|
|
712
708
|
d(this, Yt, /* @__PURE__ */ h(() => {
|
|
@@ -890,20 +886,34 @@ const yt = class yt extends HTMLElement {
|
|
|
890
886
|
nine-splitter {
|
|
891
887
|
display: none;
|
|
892
888
|
}
|
|
889
|
+
|
|
890
|
+
.ng-scroll-content {
|
|
891
|
+
position: 'relative';
|
|
892
|
+
width: 100%;
|
|
893
|
+
}
|
|
893
894
|
</style>
|
|
894
895
|
|
|
895
896
|
<div class='ng-container-top'>
|
|
896
897
|
<div class='ng-container-left'>
|
|
897
|
-
<div class="ng-part-header">
|
|
898
|
+
<div class="ng-part-header"></div>
|
|
899
|
+
<div class="ng-part-body">
|
|
900
|
+
<div class="ng-scroll-content"></div>
|
|
898
901
|
</div>
|
|
902
|
+
<div class="ng-part-footer"></div>
|
|
899
903
|
</div>
|
|
900
904
|
<div class='ng-container-body'>
|
|
901
|
-
<div class="ng-part-header">
|
|
905
|
+
<div class="ng-part-header"></div>
|
|
906
|
+
<div class="ng-part-body">
|
|
907
|
+
<div class="ng-scroll-content"></div>
|
|
902
908
|
</div>
|
|
909
|
+
<div class="ng-part-footer"></div>
|
|
903
910
|
</div>
|
|
904
911
|
<div class='ng-container-right'>
|
|
905
|
-
<div class="ng-part-header">
|
|
912
|
+
<div class="ng-part-header"></div>
|
|
913
|
+
<div class="ng-part-body">
|
|
914
|
+
<div class="ng-scroll-content"></div>
|
|
906
915
|
</div>
|
|
916
|
+
<div class="ng-part-footer"></div>
|
|
907
917
|
</div>
|
|
908
918
|
<nine-table-vscrollbar></nine-table-vscrollbar>
|
|
909
919
|
</div>
|
|
@@ -925,7 +935,7 @@ const yt = class yt extends HTMLElement {
|
|
|
925
935
|
Ft = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), ct = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(), h(yt, "NineTableSheet"), A(yt, "SCROLLBAR_SIZE", 16);
|
|
926
936
|
let $t = yt;
|
|
927
937
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", $t);
|
|
928
|
-
var Kt,
|
|
938
|
+
var Kt, Rt;
|
|
929
939
|
const _e = class _e extends HTMLElement {
|
|
930
940
|
constructor() {
|
|
931
941
|
super();
|
|
@@ -934,17 +944,17 @@ const _e = class _e extends HTMLElement {
|
|
|
934
944
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
935
945
|
var o;
|
|
936
946
|
const i = s.ctrlKey || s.metaKey || s.shiftKey, n = parseInt((o = s.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
|
|
937
|
-
t(this,
|
|
938
|
-
}), t(this,
|
|
947
|
+
t(this, Rt).call(this, n, i);
|
|
948
|
+
}), t(this, Rt).call(this, 0, !1);
|
|
939
949
|
}, "#init"));
|
|
940
|
-
d(this,
|
|
950
|
+
d(this, Rt, /* @__PURE__ */ h((e, s = !1) => {
|
|
941
951
|
const i = /* @__PURE__ */ h(() => {
|
|
942
952
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
943
953
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((b) => b.style.setProperty("display", "none"));
|
|
944
954
|
const g = f.filter((b) => b.classList.contains("active"));
|
|
945
955
|
g.length < 2 || g.forEach((b) => {
|
|
946
|
-
const m = parseInt(b.getAttribute("data-index"), 10),
|
|
947
|
-
|
|
956
|
+
const m = parseInt(b.getAttribute("data-index"), 10), x = this.querySelector(`nine-splitter[data-split-index="${m}"]`), E = f[m + 1];
|
|
957
|
+
x && E && E.classList.contains("active") && x.style.setProperty("display", "flex");
|
|
948
958
|
});
|
|
949
959
|
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = n.querySelectorAll(".nine-tab-item"), c = o.querySelectorAll("nine-table-sheet");
|
|
950
960
|
if (!a[e]) return;
|
|
@@ -973,7 +983,7 @@ const _e = class _e extends HTMLElement {
|
|
|
973
983
|
t(this, Kt).call(this);
|
|
974
984
|
}
|
|
975
985
|
};
|
|
976
|
-
Kt = new WeakMap(),
|
|
986
|
+
Kt = new WeakMap(), Rt = new WeakMap(), h(_e, "NineTableSheets");
|
|
977
987
|
let de = _e;
|
|
978
988
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", de);
|
|
979
989
|
var H, Zt, Tt, Gt;
|
|
@@ -1430,15 +1440,15 @@ const mt = class mt extends HTMLElement {
|
|
|
1430
1440
|
};
|
|
1431
1441
|
h(mt, "BasicCellElement"), A(mt, "_styleCache", /* @__PURE__ */ new Map()), A(mt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1432
1442
|
let me = mt;
|
|
1433
|
-
var C, Ht, y,
|
|
1443
|
+
var C, Ht, y, qe, Re, Te, ke, Ce;
|
|
1434
1444
|
const ze = class ze extends me {
|
|
1435
1445
|
constructor() {
|
|
1436
1446
|
super();
|
|
1437
1447
|
d(this, C);
|
|
1438
1448
|
d(this, Ht);
|
|
1439
1449
|
d(this, y);
|
|
1440
|
-
d(this, Re);
|
|
1441
1450
|
d(this, qe);
|
|
1451
|
+
d(this, Re);
|
|
1442
1452
|
d(this, Te);
|
|
1443
1453
|
d(this, ke);
|
|
1444
1454
|
A(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
@@ -1466,7 +1476,7 @@ const ze = class ze extends me {
|
|
|
1466
1476
|
var e = ninegrid.j.querySelectorAll(t(this, y)).attr("suppress");
|
|
1467
1477
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1468
1478
|
var s = t(this, y).closest("tr"), i = [];
|
|
1469
|
-
$("th,td", s).each((
|
|
1479
|
+
$("th,td", s).each((v, M) => {
|
|
1470
1480
|
var T = ninegrid.j.querySelectorAll(M).attr("suppress");
|
|
1471
1481
|
T && M.dataset.row && (T = parseInt(T), !isNaN(T) && T <= e && i.push(T));
|
|
1472
1482
|
}), i.sort();
|
|
@@ -1485,7 +1495,7 @@ const ze = class ze extends me {
|
|
|
1485
1495
|
else
|
|
1486
1496
|
n = !0;
|
|
1487
1497
|
n ? ninegrid.j.querySelectorAll(t(this, y)).removeClass("suppress") : ninegrid.j.querySelectorAll(t(this, y)).addClass("suppress"), ninegrid.j.querySelectorAll(t(this, y)).hasClass("hidden") || (n ? ninegrid.j.querySelectorAll(t(this, y)).removeClass("hidden") : ninegrid.j.querySelectorAll(t(this, y)).addClass("hidden"));
|
|
1488
|
-
var m = parseInt(t(this, y).dataset.matrixRow),
|
|
1498
|
+
var m = parseInt(t(this, y).dataset.matrixRow), x = m - 1, E = t(this, C).body.querySelector(`tbody.bindable [data-col="${t(this, y).dataset.col}"][data-matrix-row="${x}"]`);
|
|
1489
1499
|
$(E).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this, y)).hasClass("suppress") ? ninegrid.j.querySelectorAll(E).removeClass("last-none-suppress").addClass("last-suppress") : !$(E).hasClass("suppress") && ninegrid.j.querySelectorAll(t(this, y)).hasClass("suppress") ? ninegrid.j.querySelectorAll(E).removeClass("last-suppress").addClass("last-none-suppress") : ninegrid.j.querySelectorAll(E).removeClass("last-none-suppress").removeClass("last-suppress");
|
|
1490
1500
|
}
|
|
1491
1501
|
}
|
|
@@ -1526,9 +1536,9 @@ const ze = class ze extends me {
|
|
|
1526
1536
|
return parseInt(t(this, y).dataset.row), t(this, Ht).data[e];
|
|
1527
1537
|
}
|
|
1528
1538
|
};
|
|
1529
|
-
C = new WeakMap(), Ht = new WeakMap(), y = new WeakMap(),
|
|
1530
|
-
let
|
|
1531
|
-
const De = class De extends
|
|
1539
|
+
C = new WeakMap(), Ht = new WeakMap(), y = new WeakMap(), qe = new WeakMap(), Re = new WeakMap(), Te = new WeakMap(), ke = new WeakMap(), Ce = new WeakMap(), h(ze, "CellElement");
|
|
1540
|
+
let ve = ze;
|
|
1541
|
+
const De = class De extends ve {
|
|
1532
1542
|
constructor() {
|
|
1533
1543
|
super();
|
|
1534
1544
|
}
|
|
@@ -1540,9 +1550,9 @@ const De = class De extends xe {
|
|
|
1540
1550
|
}
|
|
1541
1551
|
};
|
|
1542
1552
|
h(De, "EditableCellElement");
|
|
1543
|
-
let
|
|
1553
|
+
let xe = De;
|
|
1544
1554
|
var Mt, ot, gt, bt, ne, U, Le;
|
|
1545
|
-
const je = class je extends
|
|
1555
|
+
const je = class je extends xe {
|
|
1546
1556
|
constructor() {
|
|
1547
1557
|
super();
|
|
1548
1558
|
d(this, Mt);
|