@ninebone/table 0.0.811 β 0.0.812
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 +95 -95
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +6 -6
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -5,10 +5,10 @@ var xs = (q) => {
|
|
|
5
5
|
var Rs = (q, s, e) => s in q ? ms(q, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : q[s] = e;
|
|
6
6
|
var h = (q, s) => ms(q, "name", { value: s, configurable: !0 });
|
|
7
7
|
var E = (q, s, e) => Rs(q, typeof s != "symbol" ? s + "" : s, e), qe = (q, s, e) => s.has(q) || xs("Cannot " + e);
|
|
8
|
-
var t = (q, s, e) => (qe(q, s, "read from private field"), e ? e.call(q) : s.get(q)), d = (q, s, e) => s.has(q) ? xs("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(q) : s.set(q, e),
|
|
8
|
+
var t = (q, s, e) => (qe(q, s, "read from private field"), e ? e.call(q) : s.get(q)), d = (q, s, e) => s.has(q) ? xs("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(q) : s.set(q, e), y = (q, s, e, n) => (qe(q, s, "write to private field"), n ? n.call(q, e) : s.set(q, e), e), V = (q, s, e) => (qe(q, s, "access private method"), e);
|
|
9
9
|
var ws = (q, s, e, n) => ({
|
|
10
10
|
set _(r) {
|
|
11
|
-
|
|
11
|
+
y(q, s, r, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
14
|
return t(q, s, n);
|
|
@@ -36,7 +36,7 @@ const ss = class ss extends HTMLElement {
|
|
|
36
36
|
d(this, Zt, /* @__PURE__ */ h(() => {
|
|
37
37
|
if (!t(this, j)) return;
|
|
38
38
|
const e = t(this, j).querySelector(".ng-container-body .ng-part-body");
|
|
39
|
-
e && (
|
|
39
|
+
e && (y(this, et, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
41
|
})), t(this, et).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
@@ -58,8 +58,8 @@ const ss = class ss extends HTMLElement {
|
|
|
58
58
|
const f = e.scrollLeft, b = c - a;
|
|
59
59
|
let u = 0;
|
|
60
60
|
b > 0 && (u = parseInt(f / b * (l - g), 10)), u < 0 && (u = 0);
|
|
61
|
-
const
|
|
62
|
-
u >
|
|
61
|
+
const p = l - g;
|
|
62
|
+
u > p && (u = p), i.style.left = `${u}px`, t(this, A).left.disabled = u === 0, t(this, A).right.disabled = u >= p - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
64
|
d(this, st, /* @__PURE__ */ h((e) => {
|
|
65
65
|
if (!t(this, A)) return !1;
|
|
@@ -77,8 +77,8 @@ const ss = class ss extends HTMLElement {
|
|
|
77
77
|
const e = /* @__PURE__ */ h((r) => {
|
|
78
78
|
clearInterval(t(this, Q)), clearInterval(t(this, tt));
|
|
79
79
|
const i = parseInt(t(this, A).thumb.style.left || 0, 10);
|
|
80
|
-
t(this, st).call(this, i + r),
|
|
81
|
-
clearInterval(t(this, Q)),
|
|
80
|
+
t(this, st).call(this, i + r), y(this, Q, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, Q)), y(this, tt, setInterval(() => {
|
|
82
82
|
const o = parseInt(t(this, A).thumb.style.left || 0, 10);
|
|
83
83
|
t(this, st).call(this, o + r) || clearInterval(t(this, tt));
|
|
84
84
|
}, 50));
|
|
@@ -99,20 +99,20 @@ const ss = class ss extends HTMLElement {
|
|
|
99
99
|
t(this, st).call(this, r.clientX - i.left - o / 2);
|
|
100
100
|
}), t(this, A).thumb.addEventListener("mousedown", (r) => {
|
|
101
101
|
if (r.button !== 0) return;
|
|
102
|
-
r.stopPropagation(), r.preventDefault(),
|
|
102
|
+
r.stopPropagation(), r.preventDefault(), y(this, K, !0), this.shiftX = r.clientX - t(this, A).thumb.getBoundingClientRect().left;
|
|
103
103
|
const i = /* @__PURE__ */ h((a) => {
|
|
104
104
|
if (!t(this, K)) return;
|
|
105
105
|
const c = t(this, A).track.getBoundingClientRect();
|
|
106
106
|
t(this, st).call(this, a.clientX - c.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
108
|
-
|
|
108
|
+
y(this, K, !1), n(), document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", o), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
110
|
document.addEventListener("mousemove", i), document.addEventListener("mouseup", o);
|
|
111
111
|
});
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
114
114
|
connectedCallback() {
|
|
115
|
-
if (
|
|
115
|
+
if (y(this, j, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, j)) return;
|
|
116
116
|
this.innerHTML = `
|
|
117
117
|
<style>
|
|
118
118
|
nine-table-hscrollbar {
|
|
@@ -182,7 +182,7 @@ const ss = class ss extends HTMLElement {
|
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
|
-
|
|
185
|
+
y(this, A, {
|
|
186
186
|
container: n,
|
|
187
187
|
track: this.querySelector(".ng-scroll-track"),
|
|
188
188
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
@@ -226,8 +226,8 @@ const ns = class ns extends HTMLElement {
|
|
|
226
226
|
const f = e.scrollTop, b = Math.max(c - i, 1);
|
|
227
227
|
let u = 0;
|
|
228
228
|
b > 0 && (u = f / b * (l - g));
|
|
229
|
-
const
|
|
230
|
-
u < 0 && (u = 0), u >
|
|
229
|
+
const p = l - g;
|
|
230
|
+
u < 0 && (u = 0), u > p && (u = p), r.style.top = `${u}px`, t(this, k).top.disabled = f <= 0, t(this, k).bottom.disabled = f >= b - 1;
|
|
231
231
|
}, "refresh"));
|
|
232
232
|
d(this, Qt, /* @__PURE__ */ h(() => {
|
|
233
233
|
T.log("nine-table-vscrollbar.#init");
|
|
@@ -237,19 +237,19 @@ const ns = class ns extends HTMLElement {
|
|
|
237
237
|
}, "getContentHeight");
|
|
238
238
|
t(this, k).thumb.addEventListener("mousedown", (r) => {
|
|
239
239
|
if (r.button !== 0) return;
|
|
240
|
-
r.stopPropagation(), r.preventDefault(),
|
|
240
|
+
r.stopPropagation(), r.preventDefault(), y(this, yt, !0), y(this, kt, r.clientY), y(this, Lt, e.scrollTop);
|
|
241
241
|
const i = /* @__PURE__ */ h((a) => {
|
|
242
242
|
if (!t(this, yt)) return;
|
|
243
|
-
const c = t(this, k).track.getBoundingClientRect(), l = t(this, k).thumb.clientHeight, f = c.height - l, b = a.clientY - t(this, kt), u = e.clientHeight,
|
|
243
|
+
const c = t(this, k).track.getBoundingClientRect(), l = t(this, k).thumb.clientHeight, f = c.height - l, b = a.clientY - t(this, kt), u = e.clientHeight, p = n(), x = Math.max(p - u, 1);
|
|
244
244
|
if (f > 0 && x > 0) {
|
|
245
245
|
const w = b / f * x;
|
|
246
246
|
let m = t(this, Lt) + w;
|
|
247
|
-
const C = Math.max(0,
|
|
247
|
+
const C = Math.max(0, p - u);
|
|
248
248
|
m < 0 && (m = 0), m > C && (m = C), e.scrollTop = m;
|
|
249
249
|
}
|
|
250
250
|
this.refresh();
|
|
251
251
|
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
252
|
-
|
|
252
|
+
y(this, yt, !1), document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", o), this.refresh();
|
|
253
253
|
}, "onMouseUp");
|
|
254
254
|
document.addEventListener("mousemove", i), document.addEventListener("mouseup", o);
|
|
255
255
|
}), t(this, k).track.addEventListener("mousedown", (r) => {
|
|
@@ -268,7 +268,7 @@ const ns = class ns extends HTMLElement {
|
|
|
268
268
|
}, "#init"));
|
|
269
269
|
}
|
|
270
270
|
connectedCallback() {
|
|
271
|
-
|
|
271
|
+
y(this, nt, this.getRootNode().host), y(this, rt, this.closest("nine-table-sheet")), this.innerHTML = `
|
|
272
272
|
<style>
|
|
273
273
|
nine-table-vscrollbar {
|
|
274
274
|
display: flex;
|
|
@@ -338,7 +338,7 @@ const ns = class ns extends HTMLElement {
|
|
|
338
338
|
setTimeout(e, 10);
|
|
339
339
|
return;
|
|
340
340
|
}
|
|
341
|
-
|
|
341
|
+
y(this, k, {
|
|
342
342
|
container: n,
|
|
343
343
|
track: this.querySelector(".ng-scroll-track"),
|
|
344
344
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
@@ -376,10 +376,10 @@ const rs = class rs {
|
|
|
376
376
|
s && (t(this, Mt).call(this), t(this, Ht).call(this), t(this, mt).call(this, s.scrollTop), (e = t(this, R).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
377
377
|
}, "refresh"));
|
|
378
378
|
E(this, "initialize", /* @__PURE__ */ h(() => {
|
|
379
|
-
T.log("rowManager.initialize"),
|
|
379
|
+
T.log("rowManager.initialize"), y(this, it, {
|
|
380
380
|
scrollTables: t(this, R).querySelectorAll(".ng-part-body table"),
|
|
381
381
|
firstTr: t(this, R).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
382
|
-
}),
|
|
382
|
+
}), y(this, O, null), t(this, Y).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
383
383
|
const a = t(this, R).querySelector(o);
|
|
384
384
|
if (!a) return;
|
|
385
385
|
const c = a.querySelector(".ng-part-body table");
|
|
@@ -393,7 +393,7 @@ const rs = class rs {
|
|
|
393
393
|
if (s) {
|
|
394
394
|
t(this, Mt).call(this), t(this, Nt).call(this), t(this, Ht).call(this), t(this, mt).call(this, s.scrollTop);
|
|
395
395
|
let o = !1;
|
|
396
|
-
|
|
396
|
+
y(this, ee, s.scrollLeft);
|
|
397
397
|
const a = /* @__PURE__ */ h((c) => {
|
|
398
398
|
var f;
|
|
399
399
|
if (o) return;
|
|
@@ -448,11 +448,11 @@ const rs = class rs {
|
|
|
448
448
|
return f.forEach((b) => {
|
|
449
449
|
let u = b.offsetHeight || b.getBoundingClientRect().height;
|
|
450
450
|
if (u === 0) {
|
|
451
|
-
const
|
|
452
|
-
u = parseFloat(
|
|
451
|
+
const p = window.getComputedStyle(b);
|
|
452
|
+
u = parseFloat(p.height) || parseFloat(p.minHeight) || 0;
|
|
453
453
|
}
|
|
454
454
|
g += u;
|
|
455
|
-
}), f.forEach((b) => b.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l, g <= 0 ? -1 : (
|
|
455
|
+
}), f.forEach((b) => b.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l, g <= 0 ? -1 : (y(this, O, g), t(this, $t).call(this), t(this, O));
|
|
456
456
|
}, "#measureAndCacheHeight"));
|
|
457
457
|
d(this, Ht, /* @__PURE__ */ h(() => {
|
|
458
458
|
T.log("rowManager.#updateVirtualScrollHeight");
|
|
@@ -467,38 +467,38 @@ const rs = class rs {
|
|
|
467
467
|
d(this, $t, /* @__PURE__ */ h(() => {
|
|
468
468
|
if (t(this, at) > 0 && t(this, O) > 0) {
|
|
469
469
|
const s = Math.ceil(t(this, at) / t(this, O));
|
|
470
|
-
|
|
470
|
+
y(this, It, s + t(this, te));
|
|
471
471
|
}
|
|
472
472
|
}, "#updateRowCount"));
|
|
473
473
|
d(this, ne, /* @__PURE__ */ h(() => {
|
|
474
474
|
var a, c, l, g, f, b;
|
|
475
475
|
const s = t(this, R).querySelector(".ng-container-left .ng-part-body table"), e = t(this, R).querySelector(".ng-container-body .ng-part-body table"), n = t(this, R).querySelector(".ng-container-right .ng-part-body table");
|
|
476
476
|
if (e) {
|
|
477
|
-
const u = s ? Array.from(s.querySelectorAll("tbody tr")) : [],
|
|
477
|
+
const u = s ? Array.from(s.querySelectorAll("tbody tr")) : [], p = Array.from(e.querySelectorAll("tbody tr")), x = n ? Array.from(n.querySelectorAll("tbody tr")) : [], w = Math.max(u.length, p.length, x.length);
|
|
478
478
|
for (let m = 0; m < w; m++) {
|
|
479
479
|
const C = [
|
|
480
480
|
((a = u[m]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
481
|
-
((c =
|
|
481
|
+
((c = p[m]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
482
482
|
((l = x[m]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
483
483
|
], S = Math.max(...C);
|
|
484
|
-
S > 0 && (u[m] && (u[m].style.height = `${S}px`),
|
|
484
|
+
S > 0 && (u[m] && (u[m].style.height = `${S}px`), p[m] && (p[m].style.height = `${S}px`), x[m] && (x[m].style.height = `${S}px`));
|
|
485
485
|
}
|
|
486
486
|
}
|
|
487
487
|
const r = t(this, R).querySelector(".ng-container-left .ng-part-footer table"), i = t(this, R).querySelector(".ng-container-body .ng-part-footer table"), o = t(this, R).querySelector(".ng-container-right .ng-part-footer table");
|
|
488
488
|
if (i) {
|
|
489
|
-
const u = r ? Array.from(r.querySelectorAll("tfoot tr")) : [],
|
|
489
|
+
const u = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], p = Array.from(i.querySelectorAll("tfoot tr")), x = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], w = Math.max(u.length, p.length, x.length);
|
|
490
490
|
for (let m = 0; m < w; m++) {
|
|
491
491
|
const C = [
|
|
492
492
|
((g = u[m]) == null ? void 0 : g.getBoundingClientRect().height) || 0,
|
|
493
|
-
((f =
|
|
493
|
+
((f = p[m]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
494
494
|
((b = x[m]) == null ? void 0 : b.getBoundingClientRect().height) || 0
|
|
495
495
|
], S = Math.max(...C);
|
|
496
|
-
S > 0 && (u[m] && (u[m].style.height = `${S}px`),
|
|
496
|
+
S > 0 && (u[m] && (u[m].style.height = `${S}px`), p[m] && (p[m].style.height = `${S}px`), x[m] && (x[m].style.height = `${S}px`));
|
|
497
497
|
}
|
|
498
498
|
}
|
|
499
499
|
}, "#syncRowHeights"));
|
|
500
500
|
d(this, re, /* @__PURE__ */ h(() => {
|
|
501
|
-
!t(this, R) || !(t(this, R) instanceof HTMLElement) || (
|
|
501
|
+
!t(this, R) || !(t(this, R) instanceof HTMLElement) || (y(this, G, new ResizeObserver((s) => {
|
|
502
502
|
for (const e of s) {
|
|
503
503
|
const n = e.target;
|
|
504
504
|
if (!n.classList.contains("active")) continue;
|
|
@@ -508,7 +508,7 @@ const rs = class rs {
|
|
|
508
508
|
const o = n.querySelector(".ng-part-header"), a = n.querySelector(".ng-part-footer");
|
|
509
509
|
o && (i += o.offsetHeight), a && (i += a.offsetHeight);
|
|
510
510
|
const c = Math.max(r - i, 100);
|
|
511
|
-
t(this, at) !== c && (
|
|
511
|
+
t(this, at) !== c && (y(this, at, c), t(this, $t).call(this), t(this, O) !== null && (t(this, Nt).call(this), this.refresh()));
|
|
512
512
|
}
|
|
513
513
|
}
|
|
514
514
|
})), t(this, G).observe(t(this, R)));
|
|
@@ -531,9 +531,9 @@ const rs = class rs {
|
|
|
531
531
|
(b = t(this, it)) == null || b.scrollTables.forEach((u) => {
|
|
532
532
|
u.style.transform = `translate3d(0, ${c}px, 0)`;
|
|
533
533
|
}), g !== a && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((u) => {
|
|
534
|
-
const
|
|
535
|
-
if (!
|
|
536
|
-
const x =
|
|
534
|
+
const p = t(this, R).querySelector(u);
|
|
535
|
+
if (!p) return;
|
|
536
|
+
const x = p.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
537
537
|
if (!x) return;
|
|
538
538
|
Array.from(x.querySelectorAll("tr:not(.nodata)")).forEach((m, C) => {
|
|
539
539
|
const S = a + Math.floor(C / r);
|
|
@@ -583,9 +583,9 @@ const rs = class rs {
|
|
|
583
583
|
}
|
|
584
584
|
}, "#syncHeaderHeights"));
|
|
585
585
|
E(this, "destroy", /* @__PURE__ */ h(() => {
|
|
586
|
-
t(this, G) && (t(this, G).disconnect(),
|
|
586
|
+
t(this, G) && (t(this, G).disconnect(), y(this, G, null));
|
|
587
587
|
}, "destroy"));
|
|
588
|
-
|
|
588
|
+
y(this, ot, s.getRootNode().host), y(this, R, s), t(this, re).call(this);
|
|
589
589
|
}
|
|
590
590
|
getRowHeight() {
|
|
591
591
|
return t(this, O);
|
|
@@ -614,9 +614,9 @@ const ae = class ae {
|
|
|
614
614
|
const g = l.getAttribute("cell-type") || "renderer";
|
|
615
615
|
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
616
616
|
let f = `cell-${g}`;
|
|
617
|
-
const b = l.getAttribute("data-bind"), u = l.getAttribute("data-expr"),
|
|
617
|
+
const b = l.getAttribute("data-bind"), u = l.getAttribute("data-expr"), p = l.getAttribute("maxbyte"), x = l.getAttribute("type");
|
|
618
618
|
let w = [];
|
|
619
|
-
b && w.push(`data-bind="${b}"`), u && w.push(`data-expr="${u}"`),
|
|
619
|
+
b && w.push(`data-bind="${b}"`), u && w.push(`data-expr="${u}"`), p && w.push(`maxbyte="${p}"`), x && w.push(`type="${x}"`), l.innerHTML = `<${f} ${w.join(" ")}></${f}>`;
|
|
620
620
|
}), a.querySelectorAll("tbody td, tfoot td").forEach((l) => {
|
|
621
621
|
l.setAttribute("tabindex", "0");
|
|
622
622
|
});
|
|
@@ -638,14 +638,14 @@ const ae = class ae {
|
|
|
638
638
|
const l = Array.from(a.querySelectorAll(c + " tr")), g = Array.from(a.querySelectorAll(c + " th," + c + " td")), f = l.length;
|
|
639
639
|
if (f === 0 || g.length === 0) return;
|
|
640
640
|
let b = 0;
|
|
641
|
-
g.forEach((
|
|
642
|
-
b +=
|
|
641
|
+
g.forEach((p) => {
|
|
642
|
+
b += p.colSpan || 1;
|
|
643
643
|
});
|
|
644
644
|
const u = Array.from(Array(f), () => Array(b).fill(null));
|
|
645
|
-
l.forEach((
|
|
646
|
-
const x =
|
|
645
|
+
l.forEach((p) => {
|
|
646
|
+
const x = p.sectionRowIndex;
|
|
647
647
|
let w = 0;
|
|
648
|
-
Array.from(
|
|
648
|
+
Array.from(p.querySelectorAll("th,td")).forEach((m) => {
|
|
649
649
|
for (let M = 0; M < u[x].length; M++)
|
|
650
650
|
if (u[x][M] === null) {
|
|
651
651
|
w = M;
|
|
@@ -656,9 +656,9 @@ const ae = class ae {
|
|
|
656
656
|
for (let W = 0; W < S; W++)
|
|
657
657
|
x + M < f && w + W < b && (u[x + M][w + W] = M === 0 && W === 0 ? "1" : "0");
|
|
658
658
|
});
|
|
659
|
-
}), l.forEach((
|
|
660
|
-
const x =
|
|
661
|
-
Array.from(
|
|
659
|
+
}), l.forEach((p) => {
|
|
660
|
+
const x = p.sectionRowIndex;
|
|
661
|
+
Array.from(p.querySelectorAll("th,td")).forEach((w) => {
|
|
662
662
|
for (let m = 0; m < u[x].length; m++)
|
|
663
663
|
if (u[x][m] === "1") {
|
|
664
664
|
w.dataset.col = m, u[x][m] = "0";
|
|
@@ -705,13 +705,13 @@ const os = class os {
|
|
|
705
705
|
l < 0 || c.querySelectorAll("td, th").forEach((g) => {
|
|
706
706
|
const f = parseInt(g.dataset.col, 10);
|
|
707
707
|
if (isNaN(f)) return;
|
|
708
|
-
const b = parseInt(g.rowSpan || 1, 10), u = parseInt(g.colSpan || 1, 10),
|
|
709
|
-
|
|
708
|
+
const b = parseInt(g.rowSpan || 1, 10), u = parseInt(g.colSpan || 1, 10), p = l + b - 1, x = f + u - 1;
|
|
709
|
+
p >= s && l <= n && x >= e && f <= r && (o++, g.classList.add("selected"), T.log(g, s, e, n, r), l <= s && g.classList.add("selected-top"), p >= n && g.classList.add("selected-bottom"), f <= e && g.classList.add("selected-left"), x >= r && g.classList.add("selected-right"));
|
|
710
710
|
});
|
|
711
711
|
});
|
|
712
712
|
}), T.log(`β¨ [CellSelection.render] Total rendered cells marked: ${o}`);
|
|
713
713
|
}, "render"));
|
|
714
|
-
|
|
714
|
+
y(this, N, s), V(this, X, vs).call(this), t(this, N).querySelectorAll(
|
|
715
715
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
716
716
|
).forEach((n) => {
|
|
717
717
|
n.addEventListener("scroll", () => {
|
|
@@ -730,19 +730,19 @@ const os = class os {
|
|
|
730
730
|
g = !1, f++, l.forEach((b) => {
|
|
731
731
|
b.querySelectorAll("tbody tr").forEach((u) => {
|
|
732
732
|
if (u.classList.contains("nodata")) return;
|
|
733
|
-
const { matrixRow:
|
|
734
|
-
|
|
733
|
+
const { matrixRow: p } = V(this, X, qt).call(this, u);
|
|
734
|
+
p < 0 || u.querySelectorAll("td, th").forEach((x) => {
|
|
735
735
|
const w = parseInt(x.dataset.col, 10);
|
|
736
736
|
if (isNaN(w)) return;
|
|
737
|
-
const m = parseInt(x.rowSpan || 1, 10), C = parseInt(x.colSpan || 1, 10), S =
|
|
738
|
-
if (S >= i &&
|
|
739
|
-
const B = Math.min(i,
|
|
737
|
+
const m = parseInt(x.rowSpan || 1, 10), C = parseInt(x.colSpan || 1, 10), S = p + m - 1, M = w + C - 1;
|
|
738
|
+
if (S >= i && p <= o && M >= a && w <= c) {
|
|
739
|
+
const B = Math.min(i, p), Kt = Math.max(o, S), ps = Math.min(a, w), ys = Math.max(c, M);
|
|
740
740
|
(B !== i || Kt !== o || ps !== a || ys !== c) && (i = B, o = Kt, a = ps, c = ys, g = !0);
|
|
741
741
|
}
|
|
742
742
|
});
|
|
743
743
|
});
|
|
744
744
|
});
|
|
745
|
-
|
|
745
|
+
y(this, U, { startRow: i, startCol: a, endRow: o, endCol: c }), T.log("π¦ [CellSelection.setRange] Final Range ->", t(this, U)), this.render();
|
|
746
746
|
}
|
|
747
747
|
};
|
|
748
748
|
N = new WeakMap(), U = new WeakMap(), X = new WeakSet(), qt = /* @__PURE__ */ h(function(s) {
|
|
@@ -783,7 +783,7 @@ N = new WeakMap(), U = new WeakMap(), X = new WeakSet(), qt = /* @__PURE__ */ h(
|
|
|
783
783
|
}
|
|
784
784
|
}
|
|
785
785
|
if (!u || u.dataset.row === void 0 || u.dataset.col === void 0 || u.closest("tr").classList.contains("nodata")) return;
|
|
786
|
-
const
|
|
786
|
+
const p = u.closest("tr"), { matrixRow: x } = V(this, X, qt).call(this, p), w = parseInt(u.dataset.col, 10);
|
|
787
787
|
x < 0 || a === x && c === w || (a = x, c = w, this.setRange(i, o, x, w));
|
|
788
788
|
}, "onMouseMove"), g = /* @__PURE__ */ h(() => {
|
|
789
789
|
T.log("π±οΈ [MouseUp] Drag ended."), t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "", document.removeEventListener("mousemove", l), document.removeEventListener("mouseup", g);
|
|
@@ -842,15 +842,15 @@ const is = class is {
|
|
|
842
842
|
return e.forEach((r) => {
|
|
843
843
|
const i = Array.from(r.querySelectorAll("tbody tr:not(.nodata)"));
|
|
844
844
|
for (const o of i) {
|
|
845
|
-
const a = parseInt(o.dataset.row, 10), c = i.filter((
|
|
845
|
+
const a = parseInt(o.dataset.row, 10), c = i.filter((p) => parseInt(p.dataset.row, 10) === a), l = c.length > 0 ? c.length : 1, g = c.indexOf(o), f = a * l + (g >= 0 ? g : 0);
|
|
846
846
|
if (f === s) {
|
|
847
847
|
n.push(o);
|
|
848
848
|
break;
|
|
849
849
|
}
|
|
850
850
|
const b = Array.from(o.querySelectorAll("td"));
|
|
851
851
|
let u = !1;
|
|
852
|
-
for (const
|
|
853
|
-
const x = parseInt(
|
|
852
|
+
for (const p of b) {
|
|
853
|
+
const x = parseInt(p.rowSpan || 1, 10);
|
|
854
854
|
if (x > 1 && s >= f && s < f + x) {
|
|
855
855
|
n.push(o), u = !0;
|
|
856
856
|
break;
|
|
@@ -868,27 +868,27 @@ const is = class is {
|
|
|
868
868
|
for (const a of i) {
|
|
869
869
|
const c = Array.from(a.querySelectorAll("tbody tr:not(.nodata)"));
|
|
870
870
|
for (const l of c) {
|
|
871
|
-
const g = parseInt(l.dataset.row, 10), f = c.filter((w) => parseInt(w.dataset.row, 10) === g), b = f.length > 0 ? f.length : 1, u = f.indexOf(l),
|
|
871
|
+
const g = parseInt(l.dataset.row, 10), f = c.filter((w) => parseInt(w.dataset.row, 10) === g), b = f.length > 0 ? f.length : 1, u = f.indexOf(l), p = g * b + (u >= 0 ? u : 0), x = Array.from(l.querySelectorAll("td"));
|
|
872
872
|
for (const w of x) {
|
|
873
873
|
const m = parseInt(w.dataset.col, 10), C = parseInt(w.colSpan || 1, 10), S = parseInt(w.rowSpan || 1, 10);
|
|
874
|
-
if (!isNaN(m) && n >= m && n < m + C && o >=
|
|
874
|
+
if (!isNaN(m) && n >= m && n < m + C && o >= p && o < p + S && window.getComputedStyle(w).display !== "none")
|
|
875
875
|
return w;
|
|
876
876
|
}
|
|
877
877
|
}
|
|
878
878
|
}
|
|
879
879
|
return null;
|
|
880
880
|
}, "#getNearElement"));
|
|
881
|
-
|
|
881
|
+
y(this, F, s), V(this, pt, Ss).call(this), T.log("π― [CellNavigation] Initialized");
|
|
882
882
|
}
|
|
883
883
|
get currentCell() {
|
|
884
884
|
return t(this, lt);
|
|
885
885
|
}
|
|
886
886
|
set currentCell(s) {
|
|
887
887
|
if (!s) return;
|
|
888
|
-
|
|
888
|
+
y(this, lt, s), s.focus({ preventScroll: !0 });
|
|
889
889
|
const e = parseInt(s.dataset.row, 10), n = parseInt(s.dataset.col, 10);
|
|
890
890
|
if (!isNaN(e) && !isNaN(n)) {
|
|
891
|
-
|
|
891
|
+
y(this, le, e), y(this, ce, n);
|
|
892
892
|
const r = s.closest("tr"), i = r == null ? void 0 : r.closest("tbody");
|
|
893
893
|
if (i) {
|
|
894
894
|
const a = Array.from(i.querySelectorAll("tr:not(.nodata)")).filter((f) => parseInt(f.dataset.row, 10) === e), c = a.length > 0 ? a.length : 1, l = a.indexOf(r), g = e * c + (l >= 0 ? l : 0);
|
|
@@ -930,14 +930,14 @@ const is = class is {
|
|
|
930
930
|
s.preventDefault(), b = Math.max(0, f - (e.rowSpan || 1));
|
|
931
931
|
break;
|
|
932
932
|
}
|
|
933
|
-
const
|
|
934
|
-
let w = t(this, Wt).call(this,
|
|
935
|
-
if (w)
|
|
933
|
+
const p = Math.floor(b / l), x = b % l;
|
|
934
|
+
let w = t(this, Wt).call(this, p, x, u, b);
|
|
935
|
+
if (T.log(w, p, x, u, b), w)
|
|
936
936
|
this.currentCell = w, V(this, pt, $e).call(this, w);
|
|
937
|
-
else if (
|
|
937
|
+
else if (p !== r && p >= 0) {
|
|
938
938
|
const W = ((C = (m = t(this, F)).getRowHeight) == null ? void 0 : C.call(m)) || 40;
|
|
939
|
-
(M = (S = t(this, F)).scrollToY) == null || M.call(S,
|
|
940
|
-
const B = t(this, Wt).call(this,
|
|
939
|
+
(M = (S = t(this, F)).scrollToY) == null || M.call(S, p * W), setTimeout(() => {
|
|
940
|
+
const B = t(this, Wt).call(this, p, x, u, b);
|
|
941
941
|
B && (this.currentCell = B, V(this, pt, $e).call(this, B));
|
|
942
942
|
}, 0);
|
|
943
943
|
}
|
|
@@ -969,7 +969,7 @@ const Tt = class Tt extends HTMLElement {
|
|
|
969
969
|
}, "invalidate"));
|
|
970
970
|
E(this, "generate", /* @__PURE__ */ h((e) => {
|
|
971
971
|
if (T.log("sheet.generate()"), !e) return;
|
|
972
|
-
|
|
972
|
+
y(this, ht, Ie.compile(e)), t(this, de).call(this), t(this, fe).call(this);
|
|
973
973
|
const n = this.querySelector(".ng-container-body .ng-part-header"), r = this.querySelector(".ng-container-body .ng-part-footer"), i = this.querySelector(".ng-nodata-overlay");
|
|
974
974
|
n && i && (i.style.top = `${n.offsetHeight}px`), r && i && (i.style.bottom = `${r.offsetHeight}px`), t(this, dt).initialize(), setTimeout(() => {
|
|
975
975
|
var o;
|
|
@@ -1027,7 +1027,7 @@ const Tt = class Tt extends HTMLElement {
|
|
|
1027
1027
|
n && (n.scrollTop = e);
|
|
1028
1028
|
}, "scrollToY"));
|
|
1029
1029
|
d(this, ue, /* @__PURE__ */ h(() => {
|
|
1030
|
-
t(this, ge).call(this),
|
|
1030
|
+
t(this, ge).call(this), y(this, zt, new Me(this)), y(this, Bt, new He(this));
|
|
1031
1031
|
}, "#init"));
|
|
1032
1032
|
d(this, ge, /* @__PURE__ */ h(() => {
|
|
1033
1033
|
const e = Tt.SCROLLBAR_SIZE;
|
|
@@ -1231,7 +1231,7 @@ const Tt = class Tt extends HTMLElement {
|
|
|
1231
1231
|
</div>
|
|
1232
1232
|
`;
|
|
1233
1233
|
}, "#render"));
|
|
1234
|
-
|
|
1234
|
+
y(this, dt, new Le(this)), y(this, he, this.getRootNode().host);
|
|
1235
1235
|
}
|
|
1236
1236
|
connectedCallback() {
|
|
1237
1237
|
t(this, ue).call(this);
|
|
@@ -1267,7 +1267,7 @@ const as = class as extends HTMLElement {
|
|
|
1267
1267
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((u) => u.style.setProperty("display", "none"));
|
|
1268
1268
|
const b = g.filter((u) => u.classList.contains("active"));
|
|
1269
1269
|
b.length < 2 || b.forEach((u) => {
|
|
1270
|
-
const
|
|
1270
|
+
const p = parseInt(u.getAttribute("data-index"), 10), x = this.querySelector(`nine-splitter[data-split-index="${p}"]`), w = g[p + 1];
|
|
1271
1271
|
x && w && w.classList.contains("active") && x.style.setProperty("display", "flex");
|
|
1272
1272
|
});
|
|
1273
1273
|
}, "updateSplitters"), i = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = i.querySelectorAll(".nine-tab-item"), c = o.querySelectorAll("nine-table-sheet");
|
|
@@ -1450,7 +1450,7 @@ const ls = class ls {
|
|
|
1450
1450
|
});
|
|
1451
1451
|
});
|
|
1452
1452
|
}, "#render"));
|
|
1453
|
-
|
|
1453
|
+
y(this, _, s), t(this, pe).call(this);
|
|
1454
1454
|
}
|
|
1455
1455
|
};
|
|
1456
1456
|
_ = new WeakMap(), pe = new WeakMap(), Ft = new WeakMap(), ye = new WeakMap(), h(ls, "LayoutManager");
|
|
@@ -1461,13 +1461,13 @@ const cs = class cs {
|
|
|
1461
1461
|
d(this, jt);
|
|
1462
1462
|
d(this, wt, -1);
|
|
1463
1463
|
E(this, "count", /* @__PURE__ */ h(() => t(this, jt).rawRecords.length, "count"));
|
|
1464
|
-
|
|
1464
|
+
y(this, jt, s);
|
|
1465
1465
|
}
|
|
1466
1466
|
get at() {
|
|
1467
1467
|
return t(this, wt);
|
|
1468
1468
|
}
|
|
1469
1469
|
set at(s) {
|
|
1470
|
-
|
|
1470
|
+
y(this, wt, parseInt(s, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, wt)}"]`) && setTimeout(() => {
|
|
1471
1471
|
});
|
|
1472
1472
|
}
|
|
1473
1473
|
};
|
|
@@ -1483,7 +1483,7 @@ const P = class P {
|
|
|
1483
1483
|
d(this, me, 0);
|
|
1484
1484
|
d(this, Z, []);
|
|
1485
1485
|
d(this, xe, /* @__PURE__ */ h(() => {
|
|
1486
|
-
|
|
1486
|
+
y(this, Z, []);
|
|
1487
1487
|
const s = t(this, D).template || [];
|
|
1488
1488
|
Array.from(s).forEach((e) => {
|
|
1489
1489
|
var n;
|
|
@@ -1524,11 +1524,11 @@ const P = class P {
|
|
|
1524
1524
|
_: [0, 0, 0, 0, P.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Z).slice(), -1, {}, {}]
|
|
1525
1525
|
}), "#getDefaultMeta"));
|
|
1526
1526
|
E(this, "reset", /* @__PURE__ */ h(() => {
|
|
1527
|
-
|
|
1527
|
+
y(this, z, []), y(this, vt, []), t(this, ft).call(this);
|
|
1528
1528
|
}, "reset"));
|
|
1529
1529
|
E(this, "clear", /* @__PURE__ */ h(() => {
|
|
1530
1530
|
var s;
|
|
1531
|
-
t(this, L).rawRecords = [],
|
|
1531
|
+
t(this, L).rawRecords = [], y(this, z, []), y(this, vt, []), (s = t(this, L).viewRecords) != null && s.reset && t(this, L).viewRecords.reset();
|
|
1532
1532
|
}, "clear"));
|
|
1533
1533
|
d(this, we, /* @__PURE__ */ h((s) => {
|
|
1534
1534
|
var r;
|
|
@@ -1576,7 +1576,7 @@ const P = class P {
|
|
|
1576
1576
|
a !== n && o.__ng.rowState !== P.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = a), o.__ng.rowState = P.ROW_STATE.UPDATE), o.v[i] = n;
|
|
1577
1577
|
}, "setValue"));
|
|
1578
1578
|
E(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1579
|
-
|
|
1579
|
+
y(this, vt, t(this, L).rawRecords.filter((s) => !s.__ng.deleted)), y(this, z, t(this, L).rawRecords.filter((s) => !s.__ng.deleted && !s.__ng.filtered)), t(this, L).rawRecords.forEach((s, e) => {
|
|
1580
1580
|
s.__ng.rowidx = e;
|
|
1581
1581
|
}), t(this, z).forEach((s, e) => {
|
|
1582
1582
|
s.__ng.i = e;
|
|
@@ -1595,7 +1595,7 @@ const P = class P {
|
|
|
1595
1595
|
return e ? i[0] : i;
|
|
1596
1596
|
}, "#conv"));
|
|
1597
1597
|
E(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1598
|
-
|
|
1598
|
+
y(this, D, s), y(this, L, e), t(this, xe).call(this);
|
|
1599
1599
|
}
|
|
1600
1600
|
get source() {
|
|
1601
1601
|
return t(this, St).call(this, t(this, L).rawRecords);
|
|
@@ -1629,7 +1629,7 @@ var ut;
|
|
|
1629
1629
|
const hs = class hs {
|
|
1630
1630
|
constructor(s) {
|
|
1631
1631
|
d(this, ut);
|
|
1632
|
-
|
|
1632
|
+
y(this, ut, s), this.row = new Oe(this), this.data = new De(t(this, ut), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1633
1633
|
var e;
|
|
1634
1634
|
(e = t(this, ut).view) != null && e.redraw && t(this, ut).view.redraw();
|
|
1635
1635
|
}, this.setDataSource = (e) => {
|
|
@@ -1663,10 +1663,10 @@ const ds = class ds {
|
|
|
1663
1663
|
const s = /* @__PURE__ */ new Map();
|
|
1664
1664
|
t(this, H).forEach((e) => {
|
|
1665
1665
|
s.set(e.name, e.type);
|
|
1666
|
-
}),
|
|
1666
|
+
}), y(this, H, Array.from(s, ([e, n]) => ({ name: e, type: n }))), y(this, H, t(this, H).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, H).sort((e, n) => e.name.length < n.name.length ? 1 : -1);
|
|
1667
1667
|
}, "#adjust"));
|
|
1668
1668
|
d(this, Se, /* @__PURE__ */ h(() => {
|
|
1669
|
-
|
|
1669
|
+
y(this, H, []), T.log(t(this, Rt).querySelectorAll("table"));
|
|
1670
1670
|
const s = Array.from(t(this, Rt).querySelectorAll("table"));
|
|
1671
1671
|
if (!(!s || s.length === 0)) {
|
|
1672
1672
|
for (const e of s)
|
|
@@ -1697,7 +1697,7 @@ const ds = class ds {
|
|
|
1697
1697
|
t(this, Yt).call(this);
|
|
1698
1698
|
}
|
|
1699
1699
|
}, "#init"));
|
|
1700
|
-
|
|
1700
|
+
y(this, Rt, s), t(this, Se).call(this);
|
|
1701
1701
|
}
|
|
1702
1702
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
1703
1703
|
get() {
|
|
@@ -1729,9 +1729,9 @@ const fs = class fs extends HTMLElement {
|
|
|
1729
1729
|
d(this, gt);
|
|
1730
1730
|
d(this, Re);
|
|
1731
1731
|
d(this, Ae, /* @__PURE__ */ h(() => {
|
|
1732
|
-
this.fields = new ze(this),
|
|
1732
|
+
this.fields = new ze(this), y(this, Re, new _e(this)), T.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1733
1733
|
}, "#init"));
|
|
1734
|
-
this.attachShadow({ mode: "open" }),
|
|
1734
|
+
this.attachShadow({ mode: "open" }), y(this, gt, new We(this));
|
|
1735
1735
|
}
|
|
1736
1736
|
connectedCallback() {
|
|
1737
1737
|
t(this, Ae).call(this);
|
|
@@ -1823,7 +1823,7 @@ const us = class us extends Pe {
|
|
|
1823
1823
|
else
|
|
1824
1824
|
i = !0;
|
|
1825
1825
|
i ? ninegrid.j.querySelectorAll(t(this, v)).removeClass("suppress") : ninegrid.j.querySelectorAll(t(this, v)).addClass("suppress"), ninegrid.j.querySelectorAll(t(this, v)).hasClass("hidden") || (i ? ninegrid.j.querySelectorAll(t(this, v)).removeClass("hidden") : ninegrid.j.querySelectorAll(t(this, v)).addClass("hidden"));
|
|
1826
|
-
var
|
|
1826
|
+
var p = parseInt(t(this, v).dataset.matrixRow), x = p - 1, w = t(this, I).body.querySelector(`tbody.bindable [data-col="${t(this, v).dataset.col}"][data-matrix-row="${x}"]`);
|
|
1827
1827
|
$(w).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this, v)).hasClass("suppress") ? ninegrid.j.querySelectorAll(w).removeClass("last-none-suppress").addClass("last-suppress") : !$(w).hasClass("suppress") && ninegrid.j.querySelectorAll(t(this, v)).hasClass("suppress") ? ninegrid.j.querySelectorAll(w).removeClass("last-suppress").addClass("last-none-suppress") : ninegrid.j.querySelectorAll(w).removeClass("last-none-suppress").removeClass("last-suppress");
|
|
1828
1828
|
}
|
|
1829
1829
|
}
|
|
@@ -1842,7 +1842,7 @@ const us = class us extends Pe {
|
|
|
1842
1842
|
}, "getExprValue"));
|
|
1843
1843
|
}
|
|
1844
1844
|
connectedCallback() {
|
|
1845
|
-
super.connectedCallback(),
|
|
1845
|
+
super.connectedCallback(), y(this, I, this.getRootNode().host), y(this, v, this.closest("th,td")), y(this, Ut, t(this, v).closest("tr"));
|
|
1846
1846
|
}
|
|
1847
1847
|
get value() {
|
|
1848
1848
|
var e = !t(this, I) || !t(this, I).dataManager || !t(this, v) || !t(this, v).dataset || !t(this, v).dataset.row || !t(this, v).dataset.bind ? "" : t(this, v).closest("tr").data[t(this, v).dataset.bind];
|
|
@@ -1938,7 +1938,7 @@ const bs = class bs extends je {
|
|
|
1938
1938
|
t(this, At) && ninegrid.getByteLength(e.target.value) >= Number(t(this, At)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1939
1939
|
}
|
|
1940
1940
|
}, "#onKeyDown"));
|
|
1941
|
-
if (this.applyBaseStyle(),
|
|
1941
|
+
if (this.applyBaseStyle(), y(this, bt, this.getAttribute("type") || "text"), y(this, At, this.getAttribute("maxbyte")), y(this, Et, this.getAttribute("min")), y(this, Ee, this.getAttribute("max")), y(this, J, this.getAttribute("scale")), !["text", "number"].includes(t(this, bt))) throw `invalid type : ${t(this, bt)}`;
|
|
1942
1942
|
}
|
|
1943
1943
|
connectedCallback() {
|
|
1944
1944
|
for (var e = [], n = 0; n < this.attributes.length; n++)
|
|
@@ -1948,7 +1948,7 @@ const bs = class bs extends je {
|
|
|
1948
1948
|
${e.join(" ")}
|
|
1949
1949
|
ondragstart="return false;"
|
|
1950
1950
|
>
|
|
1951
|
-
`, super.connectedCallback(),
|
|
1951
|
+
`, super.connectedCallback(), y(this, Xt, this.querySelector("input"));
|
|
1952
1952
|
}
|
|
1953
1953
|
};
|
|
1954
1954
|
Xt = new WeakMap(), bt = new WeakMap(), At = new WeakMap(), Et = new WeakMap(), Ee = new WeakMap(), J = new WeakMap(), ts = new WeakMap(), h(bs, "CellInputText");
|