@ninebone/table 0.0.445 → 0.0.446
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 +120 -125
- 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
|
@@ -23,12 +23,12 @@ const ce = class ce extends Re.constructor {
|
|
|
23
23
|
h(ce, "Trace");
|
|
24
24
|
let Gt = ce;
|
|
25
25
|
const dt = new Gt();
|
|
26
|
-
var W,
|
|
26
|
+
var W, B, v, F, V, X, At, U, qt;
|
|
27
27
|
const he = class he extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
d(this, W);
|
|
31
|
-
d(this,
|
|
31
|
+
d(this, B, !1);
|
|
32
32
|
d(this, v);
|
|
33
33
|
d(this, F);
|
|
34
34
|
d(this, V);
|
|
@@ -41,7 +41,7 @@ const he = class he extends HTMLElement {
|
|
|
41
41
|
})), t(this, X).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
44
|
-
if (!t(this, W) || !t(this, v) || t(this,
|
|
44
|
+
if (!t(this, W) || !t(this, v) || t(this, B)) return;
|
|
45
45
|
const e = t(this, v).container, i = e.querySelector("table");
|
|
46
46
|
if (!i) return;
|
|
47
47
|
const o = t(this, v).track, r = t(this, v).thumb, s = t(this, W).querySelector(".ng-container-bottom"), l = e.clientWidth, c = i.scrollWidth;
|
|
@@ -55,11 +55,11 @@ const he = class he extends HTMLElement {
|
|
|
55
55
|
if (a <= 0) return;
|
|
56
56
|
const f = Math.max(Math.min(a * (l / c), a), 20);
|
|
57
57
|
r.style.width = `${f}px`;
|
|
58
|
-
const
|
|
59
|
-
let
|
|
60
|
-
b > 0 && (
|
|
58
|
+
const g = e.scrollLeft, b = c - l;
|
|
59
|
+
let u = 0;
|
|
60
|
+
b > 0 && (u = parseInt(g / b * (a - f), 10)), u < 0 && (u = 0);
|
|
61
61
|
const p = a - f;
|
|
62
|
-
|
|
62
|
+
u > p && (u = p), r.style.left = `${u}px`, t(this, v).left.disabled = u === 0, t(this, v).right.disabled = u >= p - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
64
|
d(this, U, /* @__PURE__ */ h((e) => {
|
|
65
65
|
if (!t(this, v)) return !1;
|
|
@@ -70,8 +70,8 @@ const he = class he extends HTMLElement {
|
|
|
70
70
|
l < 0 && (l = 0);
|
|
71
71
|
const c = r.width - s;
|
|
72
72
|
l > c && (l = c), l = parseInt(l, 10), t(this, v).thumb.style.left = `${l}px`, t(this, v).left.disabled = l === 0, t(this, v).right.disabled = l >= c - 1;
|
|
73
|
-
const a = i.clientWidth,
|
|
74
|
-
return c > 0 &&
|
|
73
|
+
const a = i.clientWidth, g = o.scrollWidth - a;
|
|
74
|
+
return c > 0 && g > 0 && (i.scrollLeft = l / c * g), l > 0 && l < c - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
76
|
d(this, qt, /* @__PURE__ */ h(() => {
|
|
77
77
|
const e = /* @__PURE__ */ h((o) => {
|
|
@@ -99,13 +99,13 @@ const he = class he extends HTMLElement {
|
|
|
99
99
|
t(this, U).call(this, o.clientX - r.left - s / 2);
|
|
100
100
|
}), t(this, v).thumb.addEventListener("mousedown", (o) => {
|
|
101
101
|
if (o.button !== 0) return;
|
|
102
|
-
o.stopPropagation(), o.preventDefault(), y(this,
|
|
102
|
+
o.stopPropagation(), o.preventDefault(), y(this, B, !0), this.shiftX = o.clientX - t(this, v).thumb.getBoundingClientRect().left;
|
|
103
103
|
const r = /* @__PURE__ */ h((l) => {
|
|
104
|
-
if (!t(this,
|
|
104
|
+
if (!t(this, B)) return;
|
|
105
105
|
const c = t(this, v).track.getBoundingClientRect();
|
|
106
106
|
t(this, U).call(this, l.clientX - c.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), s = /* @__PURE__ */ h(() => {
|
|
108
|
-
y(this,
|
|
108
|
+
y(this, B, !1), i(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", s), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
110
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", s);
|
|
111
111
|
});
|
|
@@ -189,7 +189,7 @@ const he = class he extends HTMLElement {
|
|
|
189
189
|
left: this.querySelector(".ng-scroll-left"),
|
|
190
190
|
right: this.querySelector(".ng-scroll-right")
|
|
191
191
|
}), i.addEventListener("scroll", () => {
|
|
192
|
-
t(this,
|
|
192
|
+
t(this, B) || this.refresh();
|
|
193
193
|
}), t(this, qt).call(this), t(this, At).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
195
195
|
e();
|
|
@@ -198,10 +198,10 @@ const he = class he extends HTMLElement {
|
|
|
198
198
|
t(this, X) && t(this, X).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
W = new WeakMap(),
|
|
201
|
+
W = new WeakMap(), B = new WeakMap(), v = new WeakMap(), F = new WeakMap(), V = new WeakMap(), X = new WeakMap(), At = new WeakMap(), U = new WeakMap(), qt = new WeakMap(), h(he, "NineTableHScrollBar");
|
|
202
202
|
let Jt = he;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Jt);
|
|
204
|
-
var P, et, j, A, ft,
|
|
204
|
+
var P, et, j, A, ft, ut, Tt;
|
|
205
205
|
const de = class de extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
@@ -210,7 +210,7 @@ const de = class de extends HTMLElement {
|
|
|
210
210
|
d(this, j, !1);
|
|
211
211
|
d(this, A);
|
|
212
212
|
d(this, ft, 0);
|
|
213
|
-
d(this,
|
|
213
|
+
d(this, ut, 0);
|
|
214
214
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
215
|
if (!t(this, P) || !t(this, A)) return;
|
|
216
216
|
const e = t(this, A).container, i = t(this, A).track, o = t(this, A).thumb, r = e.clientHeight, l = (t(this, P).data.get() || []).length, c = t(this, et).getRowHeight(), a = l * c;
|
|
@@ -221,13 +221,13 @@ const de = class de extends HTMLElement {
|
|
|
221
221
|
o.style.display = "block";
|
|
222
222
|
const f = i.clientHeight;
|
|
223
223
|
if (f <= 0) return;
|
|
224
|
-
const
|
|
225
|
-
o.style.height = `${
|
|
226
|
-
const b = e.scrollTop,
|
|
224
|
+
const g = Math.max(Math.min(f * (r / a), f), 20);
|
|
225
|
+
o.style.height = `${g}px`;
|
|
226
|
+
const b = e.scrollTop, u = Math.max(a - r, 1);
|
|
227
227
|
let p = 0;
|
|
228
|
-
|
|
229
|
-
const x = f -
|
|
230
|
-
p < 0 && (p = 0), p > x && (p = x), o.style.top = `${p}px`, t(this, A).top.disabled = b <= 0, t(this, A).bottom.disabled = b >=
|
|
228
|
+
u > 0 && (p = b / u * (f - g));
|
|
229
|
+
const x = f - g;
|
|
230
|
+
p < 0 && (p = 0), p > x && (p = x), o.style.top = `${p}px`, t(this, A).top.disabled = b <= 0, t(this, A).bottom.disabled = b >= u - 1;
|
|
231
231
|
}, "refresh"));
|
|
232
232
|
d(this, Tt, /* @__PURE__ */ h(() => {
|
|
233
233
|
const e = t(this, A).container, i = /* @__PURE__ */ h(() => {
|
|
@@ -238,15 +238,15 @@ const de = class de extends HTMLElement {
|
|
|
238
238
|
t(this, j) || this.refresh();
|
|
239
239
|
}), t(this, A).thumb.addEventListener("mousedown", (o) => {
|
|
240
240
|
if (o.button !== 0) return;
|
|
241
|
-
o.stopPropagation(), o.preventDefault(), y(this, j, !0), y(this, ft, o.clientY), y(this,
|
|
241
|
+
o.stopPropagation(), o.preventDefault(), y(this, j, !0), y(this, ft, o.clientY), y(this, ut, e.scrollTop);
|
|
242
242
|
const r = /* @__PURE__ */ h((l) => {
|
|
243
243
|
if (!t(this, j)) return;
|
|
244
|
-
const c = t(this, A).track.getBoundingClientRect(), a = t(this, A).thumb.clientHeight,
|
|
245
|
-
if (
|
|
246
|
-
const R = b /
|
|
247
|
-
let m = t(this,
|
|
248
|
-
const
|
|
249
|
-
m < 0 && (m = 0), m >
|
|
244
|
+
const c = t(this, A).track.getBoundingClientRect(), a = t(this, A).thumb.clientHeight, g = c.height - a, b = l.clientY - t(this, ft), u = e.clientHeight, p = i(), x = Math.max(p - u, 1);
|
|
245
|
+
if (g > 0 && x > 0) {
|
|
246
|
+
const R = b / g * x;
|
|
247
|
+
let m = t(this, ut) + R;
|
|
248
|
+
const z = Math.max(0, p - u);
|
|
249
|
+
m < 0 && (m = 0), m > z && (m = z), e.scrollTop = m;
|
|
250
250
|
}
|
|
251
251
|
this.refresh();
|
|
252
252
|
}, "onMouseMove"), s = /* @__PURE__ */ h(() => {
|
|
@@ -255,10 +255,10 @@ const de = class de extends HTMLElement {
|
|
|
255
255
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", s);
|
|
256
256
|
}), t(this, A).track.addEventListener("mousedown", (o) => {
|
|
257
257
|
if (o.button !== 0 || o.target === t(this, A).thumb) return;
|
|
258
|
-
const r = t(this, A).track.getBoundingClientRect(), s = t(this, A).thumb.clientHeight, l = o.clientY - r.top - s / 2, a = r.height - s, f = e.clientHeight,
|
|
258
|
+
const r = t(this, A).track.getBoundingClientRect(), s = t(this, A).thumb.clientHeight, l = o.clientY - r.top - s / 2, a = r.height - s, f = e.clientHeight, g = i(), b = Math.max(g - f, 1);
|
|
259
259
|
if (a > 0 && b > 0) {
|
|
260
|
-
const
|
|
261
|
-
e.scrollTop =
|
|
260
|
+
const u = Math.max(0, Math.min(1, l / a));
|
|
261
|
+
e.scrollTop = u * b;
|
|
262
262
|
}
|
|
263
263
|
this.refresh();
|
|
264
264
|
}), t(this, A).top.addEventListener("click", () => {
|
|
@@ -350,19 +350,19 @@ const de = class de extends HTMLElement {
|
|
|
350
350
|
e();
|
|
351
351
|
}
|
|
352
352
|
};
|
|
353
|
-
P = new WeakMap(), et = new WeakMap(), j = new WeakMap(), A = new WeakMap(), ft = new WeakMap(),
|
|
353
|
+
P = new WeakMap(), et = new WeakMap(), j = new WeakMap(), A = new WeakMap(), ft = new WeakMap(), ut = new WeakMap(), Tt = new WeakMap(), h(de, "NineTableVScrollBar");
|
|
354
354
|
let Qt = de;
|
|
355
355
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Qt);
|
|
356
|
-
var
|
|
356
|
+
var N, w, O, k, D, K, gt, nt, kt, Lt, Ct, bt, yt, Ht, Mt, pt, _t, it, mt, $t;
|
|
357
357
|
const fe = class fe {
|
|
358
358
|
constructor(n) {
|
|
359
|
-
d(this,
|
|
359
|
+
d(this, N);
|
|
360
360
|
d(this, w);
|
|
361
361
|
d(this, O, /* @__PURE__ */ new Map());
|
|
362
362
|
d(this, k, null);
|
|
363
363
|
d(this, D, null);
|
|
364
364
|
d(this, K, 0);
|
|
365
|
-
d(this,
|
|
365
|
+
d(this, gt, 40);
|
|
366
366
|
d(this, nt, !1);
|
|
367
367
|
d(this, kt, 3);
|
|
368
368
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
@@ -403,7 +403,7 @@ const fe = class fe {
|
|
|
403
403
|
if (!o) return;
|
|
404
404
|
o.querySelectorAll("tr:not(.nodata)").forEach((l) => l.remove());
|
|
405
405
|
const r = o.querySelector("tr.nodata"), s = document.createDocumentFragment();
|
|
406
|
-
for (let l = 0; l < t(this,
|
|
406
|
+
for (let l = 0; l < t(this, gt); l++)
|
|
407
407
|
i.forEach((c) => {
|
|
408
408
|
s.appendChild(c.cloneNode(!0));
|
|
409
409
|
});
|
|
@@ -424,13 +424,13 @@ const fe = class fe {
|
|
|
424
424
|
const s = t(this, w), l = s.style.display, c = s.style.visibility, a = s.style.position;
|
|
425
425
|
(l === "none" || window.getComputedStyle(s).display === "none") && (s.style.display = "block", s.style.visibility = "hidden", s.style.position = "absolute");
|
|
426
426
|
let f = 0;
|
|
427
|
-
const
|
|
428
|
-
return
|
|
427
|
+
const g = i.querySelectorAll("tr:not(.nodata)");
|
|
428
|
+
return g.forEach((b) => {
|
|
429
429
|
f += b.offsetHeight || b.getBoundingClientRect().height;
|
|
430
|
-
}),
|
|
430
|
+
}), g.forEach((b) => b.remove()), s.style.display = l, s.style.visibility = c, s.style.position = a, y(this, k, f > 0 ? f : 24), t(this, yt).call(this), t(this, k);
|
|
431
431
|
}, "#measureAndCacheHeight"));
|
|
432
432
|
d(this, bt, /* @__PURE__ */ h(() => {
|
|
433
|
-
const e = (t(this,
|
|
433
|
+
const e = (t(this, N).data.get() || []).length, i = t(this, k) || 24, o = e * i;
|
|
434
434
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((r) => {
|
|
435
435
|
const s = t(this, w).querySelector(r);
|
|
436
436
|
if (!s) return;
|
|
@@ -441,33 +441,33 @@ const fe = class fe {
|
|
|
441
441
|
d(this, yt, /* @__PURE__ */ h(() => {
|
|
442
442
|
if (t(this, K) > 0 && t(this, k) > 0) {
|
|
443
443
|
const n = Math.ceil(t(this, K) / t(this, k));
|
|
444
|
-
y(this,
|
|
444
|
+
y(this, gt, n + t(this, kt));
|
|
445
445
|
}
|
|
446
446
|
}, "#updateRowCount"));
|
|
447
447
|
d(this, Ht, /* @__PURE__ */ h(() => {
|
|
448
|
-
var l, c, a, f,
|
|
448
|
+
var l, c, a, f, g, b;
|
|
449
449
|
const n = t(this, w).querySelector(".ng-container-left .ng-part-body table"), e = t(this, w).querySelector(".ng-container-body .ng-part-body table"), i = t(this, w).querySelector(".ng-container-right .ng-part-body table");
|
|
450
450
|
if (e) {
|
|
451
|
-
const
|
|
451
|
+
const u = n ? Array.from(n.querySelectorAll("tbody tr")) : [], p = Array.from(e.querySelectorAll("tbody tr")), x = i ? Array.from(i.querySelectorAll("tbody tr")) : [], R = Math.max(u.length, p.length, x.length);
|
|
452
452
|
for (let m = 0; m < R; m++) {
|
|
453
|
-
const
|
|
454
|
-
((l =
|
|
453
|
+
const z = [
|
|
454
|
+
((l = u[m]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
455
455
|
((c = p[m]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
456
456
|
((a = x[m]) == null ? void 0 : a.getBoundingClientRect().height) || 0
|
|
457
|
-
], _ = Math.max(...
|
|
458
|
-
_ > 0 && (
|
|
457
|
+
], _ = Math.max(...z);
|
|
458
|
+
_ > 0 && (u[m] && (u[m].style.height = `${_}px`), p[m] && (p[m].style.height = `${_}px`), x[m] && (x[m].style.height = `${_}px`));
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
461
|
const o = t(this, w).querySelector(".ng-container-left .ng-part-footer table"), r = t(this, w).querySelector(".ng-container-body .ng-part-footer table"), s = t(this, w).querySelector(".ng-container-right .ng-part-footer table");
|
|
462
462
|
if (r) {
|
|
463
|
-
const
|
|
463
|
+
const u = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], p = Array.from(r.querySelectorAll("tfoot tr")), x = s ? Array.from(s.querySelectorAll("tfoot tr")) : [], R = Math.max(u.length, p.length, x.length);
|
|
464
464
|
for (let m = 0; m < R; m++) {
|
|
465
|
-
const
|
|
466
|
-
((f =
|
|
467
|
-
((
|
|
465
|
+
const z = [
|
|
466
|
+
((f = u[m]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
467
|
+
((g = p[m]) == null ? void 0 : g.getBoundingClientRect().height) || 0,
|
|
468
468
|
((b = x[m]) == null ? void 0 : b.getBoundingClientRect().height) || 0
|
|
469
|
-
], _ = Math.max(...
|
|
470
|
-
_ > 0 && (
|
|
469
|
+
], _ = Math.max(...z);
|
|
470
|
+
_ > 0 && (u[m] && (u[m].style.height = `${_}px`), p[m] && (p[m].style.height = `${_}px`), x[m] && (x[m].style.height = `${_}px`));
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
473
|
}, "#syncRowHeights"));
|
|
@@ -500,15 +500,15 @@ const fe = class fe {
|
|
|
500
500
|
if (!i) return;
|
|
501
501
|
const o = i.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
502
502
|
if (!o) return;
|
|
503
|
-
const r = Array.from(o.querySelectorAll("tr:not(.nodata)")), s = ((a = t(this, O).get(e)) == null ? void 0 : a.length) || 1, c = (t(this,
|
|
504
|
-
r.forEach((f,
|
|
505
|
-
const b = n + Math.floor(
|
|
503
|
+
const r = Array.from(o.querySelectorAll("tr:not(.nodata)")), s = ((a = t(this, O).get(e)) == null ? void 0 : a.length) || 1, c = (t(this, N).data.get() || []).length;
|
|
504
|
+
r.forEach((f, g) => {
|
|
505
|
+
const b = n + Math.floor(g / s);
|
|
506
506
|
if (b >= c) {
|
|
507
507
|
f.style.display = "none";
|
|
508
508
|
return;
|
|
509
509
|
}
|
|
510
|
-
const
|
|
511
|
-
f.style.display = "", t(this, mt).call(this, f,
|
|
510
|
+
const u = t(this, N).data.get(b);
|
|
511
|
+
f.style.display = "", t(this, mt).call(this, f, u, b);
|
|
512
512
|
});
|
|
513
513
|
});
|
|
514
514
|
}, "#adjustBufferRows"));
|
|
@@ -516,20 +516,20 @@ const fe = class fe {
|
|
|
516
516
|
var c;
|
|
517
517
|
const e = t(this, k);
|
|
518
518
|
if (!e || e <= 0) return;
|
|
519
|
-
const o = (t(this,
|
|
519
|
+
const o = (t(this, N).data.get() || []).length, r = Math.max(0, Math.floor(n / e)), s = r * e, l = ((c = t(this, O).get(".ng-container-body")) == null ? void 0 : c.length) || 1;
|
|
520
520
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((a) => {
|
|
521
521
|
const f = t(this, w).querySelector(a);
|
|
522
522
|
if (!f) return;
|
|
523
|
-
const
|
|
524
|
-
if (!
|
|
525
|
-
|
|
523
|
+
const g = f.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
524
|
+
if (!g) return;
|
|
525
|
+
g.style.transform = `translateY(${s}px)`, Array.from(g.querySelectorAll("tr:not(.nodata)")).forEach((u, p) => {
|
|
526
526
|
const x = r + Math.floor(p / l);
|
|
527
527
|
if (x >= o) {
|
|
528
|
-
|
|
528
|
+
u.style.display = "none";
|
|
529
529
|
return;
|
|
530
530
|
}
|
|
531
|
-
const R = t(this,
|
|
532
|
-
|
|
531
|
+
const R = t(this, N).data.get(x);
|
|
532
|
+
u.style.display = "", t(this, mt).call(this, u, R, x);
|
|
533
533
|
});
|
|
534
534
|
}), t(this, nt) || (y(this, nt, !0), setTimeout(() => {
|
|
535
535
|
t(this, _t).call(this, r), y(this, nt, !1);
|
|
@@ -551,14 +551,9 @@ const fe = class fe {
|
|
|
551
551
|
}; */
|
|
552
552
|
d(this, mt, /* @__PURE__ */ h((n, e, i) => {
|
|
553
553
|
n.dataset.row = i, n.data = e, Array.from(n.cells).forEach((o, r) => {
|
|
554
|
-
o.dataset.row = i;
|
|
555
|
-
const s = o.
|
|
556
|
-
|
|
557
|
-
s.reset();
|
|
558
|
-
else {
|
|
559
|
-
const l = o.dataset.bind;
|
|
560
|
-
l && e && e[l] !== void 0 ? o.textContent = e[l] : o.textContent = e ? e[Object.keys(e)[r]] ?? `R${i}C${r}` : `행 ${i + 1}`;
|
|
561
|
-
}
|
|
554
|
+
o.dataset.row = i, o.querySelector(':scope > [is^="cell-"], :scope > [class*="cell-"], :scope > cell-');
|
|
555
|
+
const s = Array.from(o.children).find((l) => l.tagName.toLowerCase().startsWith("cell-") || typeof l.reset == "function");
|
|
556
|
+
s && typeof s.reset == "function" && s.reset();
|
|
562
557
|
});
|
|
563
558
|
}, "#bindRowData"));
|
|
564
559
|
d(this, $t, /* @__PURE__ */ h(() => {
|
|
@@ -566,19 +561,19 @@ const fe = class fe {
|
|
|
566
561
|
const n = t(this, w).querySelector(".ng-container-left .ng-part-header table"), e = t(this, w).querySelector(".ng-container-body .ng-part-header table"), i = t(this, w).querySelector(".ng-container-right .ng-part-header table");
|
|
567
562
|
if (!e) return;
|
|
568
563
|
const o = n ? Array.from(n.querySelectorAll("tr")) : [], r = Array.from(e.querySelectorAll("tr")), s = i ? Array.from(i.querySelectorAll("tr")) : [], l = Math.max(o.length, r.length, s.length);
|
|
569
|
-
for (let
|
|
564
|
+
for (let g = 0; g < l; g++) {
|
|
570
565
|
const b = [
|
|
571
|
-
((c = o[
|
|
572
|
-
((a = r[
|
|
573
|
-
((f = s[
|
|
574
|
-
],
|
|
575
|
-
|
|
566
|
+
((c = o[g]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
567
|
+
((a = r[g]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
568
|
+
((f = s[g]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
569
|
+
], u = Math.max(...b);
|
|
570
|
+
u > 0 && (o[g] && (o[g].style.height = `${u}px`), r[g] && (r[g].style.height = `${u}px`), s[g] && (s[g].style.height = `${u}px`));
|
|
576
571
|
}
|
|
577
572
|
}, "#syncHeaderHeights"));
|
|
578
573
|
E(this, "destroy", /* @__PURE__ */ h(() => {
|
|
579
574
|
t(this, D) && (t(this, D).disconnect(), y(this, D, null));
|
|
580
575
|
}, "destroy"));
|
|
581
|
-
y(this,
|
|
576
|
+
y(this, N, n.getRootNode().host), y(this, w, n), t(this, Mt).call(this);
|
|
582
577
|
}
|
|
583
578
|
getRowHeight() {
|
|
584
579
|
return t(this, k);
|
|
@@ -588,7 +583,7 @@ const fe = class fe {
|
|
|
588
583
|
return ((e = t(this, O).get(n)) == null ? void 0 : e.length) || 1;
|
|
589
584
|
}
|
|
590
585
|
};
|
|
591
|
-
|
|
586
|
+
N = new WeakMap(), w = new WeakMap(), O = new WeakMap(), k = new WeakMap(), D = new WeakMap(), K = new WeakMap(), gt = new WeakMap(), nt = new WeakMap(), kt = new WeakMap(), Lt = new WeakMap(), Ct = new WeakMap(), bt = new WeakMap(), yt = new WeakMap(), Ht = new WeakMap(), Mt = new WeakMap(), pt = new WeakMap(), _t = new WeakMap(), it = new WeakMap(), mt = new WeakMap(), $t = new WeakMap(), h(fe, "RowManager");
|
|
592
587
|
let te = fe;
|
|
593
588
|
const It = class It {
|
|
594
589
|
/**
|
|
@@ -606,17 +601,17 @@ const It = class It {
|
|
|
606
601
|
l.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((a) => {
|
|
607
602
|
const f = a.getAttribute("cell-type") || "renderer";
|
|
608
603
|
if (a.children.length > 0 && a.firstElementChild.tagName.includes("-")) return;
|
|
609
|
-
let
|
|
610
|
-
const b = a.getAttribute("data-bind"),
|
|
604
|
+
let g = `cell-${f}`;
|
|
605
|
+
const b = a.getAttribute("data-bind"), u = a.getAttribute("data-expr"), p = a.getAttribute("maxbyte"), x = a.getAttribute("type");
|
|
611
606
|
let R = [];
|
|
612
|
-
b && R.push(`data-bind="${b}"`),
|
|
607
|
+
b && R.push(`data-bind="${b}"`), u && R.push(`data-expr="${u}"`), p && R.push(`maxbyte="${p}"`), x && R.push(`type="${x}"`), a.innerHTML = `<${g} ${R.join(" ")}></${g}>`;
|
|
613
608
|
});
|
|
614
609
|
}, "processCellTypes"), i = /* @__PURE__ */ h((l) => {
|
|
615
610
|
if (!l.querySelector("colgroup")) {
|
|
616
|
-
const c = l.querySelector("tbody tr") || l.querySelector("tr"), a = c ? c.querySelectorAll("th, td").length : 1, f = document.createElement("colgroup"),
|
|
611
|
+
const c = l.querySelector("tbody tr") || l.querySelector("tr"), a = c ? c.querySelectorAll("th, td").length : 1, f = document.createElement("colgroup"), g = Math.max(Math.floor(l.clientWidth / a), 100);
|
|
617
612
|
for (let b = 0; b < a; b++) {
|
|
618
|
-
const
|
|
619
|
-
|
|
613
|
+
const u = document.createElement("col");
|
|
614
|
+
u.setAttribute("width", g), f.appendChild(u);
|
|
620
615
|
}
|
|
621
616
|
l.prepend(f);
|
|
622
617
|
}
|
|
@@ -626,33 +621,33 @@ const It = class It {
|
|
|
626
621
|
}
|
|
627
622
|
l.classList.add("nine-table-element"), l.style.display = "table";
|
|
628
623
|
}, "ensureTableStructure"), o = /* @__PURE__ */ h((l, c) => {
|
|
629
|
-
const a = Array.from(l.querySelectorAll(c + " tr")), f = Array.from(l.querySelectorAll(c + " th," + c + " td")),
|
|
630
|
-
if (
|
|
624
|
+
const a = Array.from(l.querySelectorAll(c + " tr")), f = Array.from(l.querySelectorAll(c + " th," + c + " td")), g = a.length;
|
|
625
|
+
if (g === 0 || f.length === 0) return;
|
|
631
626
|
let b = 0;
|
|
632
627
|
f.forEach((p) => {
|
|
633
628
|
b += p.colSpan || 1;
|
|
634
629
|
});
|
|
635
|
-
const
|
|
630
|
+
const u = Array.from(Array(g), () => Array(b).fill(null));
|
|
636
631
|
a.forEach((p) => {
|
|
637
632
|
const x = p.sectionRowIndex;
|
|
638
633
|
let R = 0;
|
|
639
634
|
Array.from(p.querySelectorAll("th,td")).forEach((m) => {
|
|
640
|
-
for (let I = 0; I <
|
|
641
|
-
if (
|
|
635
|
+
for (let I = 0; I < u[x].length; I++)
|
|
636
|
+
if (u[x][I] === null) {
|
|
642
637
|
R = I;
|
|
643
638
|
break;
|
|
644
639
|
}
|
|
645
|
-
const
|
|
646
|
-
for (let I = 0; I <
|
|
640
|
+
const z = m.rowSpan || 1, _ = m.colSpan || 1;
|
|
641
|
+
for (let I = 0; I < z; I++)
|
|
647
642
|
for (let ct = 0; ct < _; ct++)
|
|
648
|
-
x + I <
|
|
643
|
+
x + I < g && R + ct < b && (u[x + I][R + ct] = I === 0 && ct === 0 ? "1" : "0");
|
|
649
644
|
});
|
|
650
645
|
}), a.forEach((p) => {
|
|
651
646
|
const x = p.sectionRowIndex;
|
|
652
647
|
Array.from(p.querySelectorAll("th,td")).forEach((R) => {
|
|
653
|
-
for (let m = 0; m <
|
|
654
|
-
if (
|
|
655
|
-
R.dataset.col = m,
|
|
648
|
+
for (let m = 0; m < u[x].length; m++)
|
|
649
|
+
if (u[x][m] === "1") {
|
|
650
|
+
R.dataset.col = m, u[x][m] = "0";
|
|
656
651
|
break;
|
|
657
652
|
}
|
|
658
653
|
});
|
|
@@ -669,7 +664,7 @@ const It = class It {
|
|
|
669
664
|
};
|
|
670
665
|
h(It, "TableCompiler");
|
|
671
666
|
let ee = It;
|
|
672
|
-
var Wt, Z, G, Ot,
|
|
667
|
+
var Wt, Z, G, Ot, Nt, ot, zt, Bt;
|
|
673
668
|
const ht = class ht extends HTMLElement {
|
|
674
669
|
constructor() {
|
|
675
670
|
super();
|
|
@@ -701,7 +696,7 @@ const ht = class ht extends HTMLElement {
|
|
|
701
696
|
f.className = "ng-part-footer", f.appendChild(t(this, ot).call(this, t(this, Z), o, "footer")), r.appendChild(s), r.appendChild(l), r.appendChild(f);
|
|
702
697
|
});
|
|
703
698
|
}, "#renderSplitContainers"));
|
|
704
|
-
d(this,
|
|
699
|
+
d(this, Nt, /* @__PURE__ */ h(() => {
|
|
705
700
|
["left", "right", "body"].forEach((e) => {
|
|
706
701
|
const i = this.querySelector(`.ng-container-${e}`), o = i == null ? void 0 : i.querySelectorAll("table");
|
|
707
702
|
if (!i || !o || o.length === 0) return;
|
|
@@ -713,7 +708,7 @@ const ht = class ht extends HTMLElement {
|
|
|
713
708
|
});
|
|
714
709
|
}, "#updateContainerWidths"));
|
|
715
710
|
E(this, "generate", /* @__PURE__ */ h((e) => {
|
|
716
|
-
e && (y(this, Z, ee.compile(e)), t(this, Ot).call(this), t(this,
|
|
711
|
+
e && (y(this, Z, ee.compile(e)), t(this, Ot).call(this), t(this, Nt).call(this), t(this, G).initialize(), setTimeout(() => {
|
|
717
712
|
var i;
|
|
718
713
|
(i = this.querySelector("nine-table-hscrollbar")) == null || i.refresh();
|
|
719
714
|
}, 0));
|
|
@@ -743,10 +738,10 @@ const ht = class ht extends HTMLElement {
|
|
|
743
738
|
const i = this.querySelector(".ng-container-body .ng-part-body");
|
|
744
739
|
i && (i.scrollTop = e);
|
|
745
740
|
}, "scrollToY"));
|
|
746
|
-
d(this,
|
|
747
|
-
t(this,
|
|
741
|
+
d(this, zt, /* @__PURE__ */ h(() => {
|
|
742
|
+
t(this, Bt).call(this);
|
|
748
743
|
}, "#init"));
|
|
749
|
-
d(this,
|
|
744
|
+
d(this, Bt, /* @__PURE__ */ h(() => {
|
|
750
745
|
const e = ht.SCROLLBAR_SIZE;
|
|
751
746
|
this.innerHTML = `
|
|
752
747
|
<style>
|
|
@@ -892,17 +887,17 @@ const ht = class ht extends HTMLElement {
|
|
|
892
887
|
y(this, G, new te(this)), y(this, Wt, this.getRootNode().host);
|
|
893
888
|
}
|
|
894
889
|
connectedCallback() {
|
|
895
|
-
t(this,
|
|
890
|
+
t(this, zt).call(this);
|
|
896
891
|
}
|
|
897
892
|
disconnectedCallback() {
|
|
898
893
|
this.innerHTML = "", dt.log("NineTableSheet destroyed.");
|
|
899
894
|
}
|
|
900
895
|
};
|
|
901
|
-
Wt = new WeakMap(), Z = new WeakMap(), G = new WeakMap(), Ot = new WeakMap(),
|
|
896
|
+
Wt = new WeakMap(), Z = new WeakMap(), G = new WeakMap(), Ot = new WeakMap(), Nt = new WeakMap(), ot = new WeakMap(), zt = new WeakMap(), Bt = new WeakMap(), h(ht, "NineTableSheet"), E(ht, "SCROLLBAR_SIZE", 16);
|
|
902
897
|
let Rt = ht;
|
|
903
898
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", Rt);
|
|
904
899
|
var Pt, xt;
|
|
905
|
-
const
|
|
900
|
+
const ue = class ue extends HTMLElement {
|
|
906
901
|
constructor() {
|
|
907
902
|
super();
|
|
908
903
|
d(this, Pt, /* @__PURE__ */ h(() => {
|
|
@@ -916,24 +911,24 @@ const ge = class ge extends HTMLElement {
|
|
|
916
911
|
d(this, xt, /* @__PURE__ */ h((e, i = !1) => {
|
|
917
912
|
const o = /* @__PURE__ */ h(() => {
|
|
918
913
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
919
|
-
Array.from(this.querySelectorAll("nine-splitter")).forEach((
|
|
920
|
-
const b = f.filter((
|
|
921
|
-
b.length < 2 || b.forEach((
|
|
922
|
-
const p = parseInt(
|
|
914
|
+
Array.from(this.querySelectorAll("nine-splitter")).forEach((u) => u.style.setProperty("display", "none"));
|
|
915
|
+
const b = f.filter((u) => u.classList.contains("active"));
|
|
916
|
+
b.length < 2 || b.forEach((u) => {
|
|
917
|
+
const p = parseInt(u.getAttribute("data-index"), 10), x = this.querySelector(`nine-splitter[data-split-index="${p}"]`), R = f[p + 1];
|
|
923
918
|
x && R && R.classList.contains("active") && x.style.setProperty("display", "flex");
|
|
924
919
|
});
|
|
925
920
|
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), s = this.querySelector("nine-table-sheets-body"), l = r.querySelectorAll(".nine-tab-item"), c = s.querySelectorAll("nine-table-sheet");
|
|
926
921
|
if (!l[e]) return;
|
|
927
922
|
if (!i)
|
|
928
|
-
l.forEach((f,
|
|
929
|
-
f.classList.toggle("active",
|
|
930
|
-
}), c.forEach((f,
|
|
931
|
-
const b =
|
|
923
|
+
l.forEach((f, g) => {
|
|
924
|
+
f.classList.toggle("active", g === e);
|
|
925
|
+
}), c.forEach((f, g) => {
|
|
926
|
+
const b = g === e;
|
|
932
927
|
f.classList.toggle("active", b), f.style.flex = b ? "1 1 100%" : "";
|
|
933
928
|
});
|
|
934
929
|
else {
|
|
935
|
-
const f = l[e],
|
|
936
|
-
if (f.classList.contains("active") &&
|
|
930
|
+
const f = l[e], g = r.querySelectorAll(".nine-tab-item.active");
|
|
931
|
+
if (f.classList.contains("active") && g.length <= 1)
|
|
937
932
|
return;
|
|
938
933
|
f.classList.toggle("active");
|
|
939
934
|
const b = s.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
@@ -949,11 +944,11 @@ const ge = class ge extends HTMLElement {
|
|
|
949
944
|
t(this, Pt).call(this);
|
|
950
945
|
}
|
|
951
946
|
};
|
|
952
|
-
Pt = new WeakMap(), xt = new WeakMap(), h(
|
|
953
|
-
let ne =
|
|
947
|
+
Pt = new WeakMap(), xt = new WeakMap(), h(ue, "NineTableSheets");
|
|
948
|
+
let ne = ue;
|
|
954
949
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", ne);
|
|
955
950
|
var L, Dt, vt, Yt;
|
|
956
|
-
const
|
|
951
|
+
const ge = class ge {
|
|
957
952
|
constructor(n) {
|
|
958
953
|
d(this, L);
|
|
959
954
|
d(this, Dt, /* @__PURE__ */ h(() => {
|
|
@@ -971,8 +966,8 @@ const ue = class ue {
|
|
|
971
966
|
}, "#applyAutoHeight"));
|
|
972
967
|
d(this, Yt, /* @__PURE__ */ h(() => {
|
|
973
968
|
const e = Array.from(t(this, L).children).filter((c) => c.tagName === "TABLE"), i = t(this, L).getAttribute("auto-height") === "true", o = e.length, r = e.map((c, a) => {
|
|
974
|
-
const
|
|
975
|
-
return
|
|
969
|
+
const g = `<nine-table-sheet class="${a === 0 ? "active" : ""}" data-index="${a}"></nine-table-sheet>`, b = a < o - 1 ? `<nine-splitter class="h" data-split-index="${a}"></nine-splitter>` : "";
|
|
970
|
+
return g + b;
|
|
976
971
|
}).join(""), s = e.map((c, a) => `<div class="nine-tab-item ${a === 0 ? "active" : ""}" data-index="${a}">Sheet ${a + 1}</div>`).join("");
|
|
977
972
|
t(this, L).shadowRoot.innerHTML = `
|
|
978
973
|
<style>
|
|
@@ -1075,8 +1070,8 @@ const ue = class ue {
|
|
|
1075
1070
|
y(this, L, n), t(this, Dt).call(this);
|
|
1076
1071
|
}
|
|
1077
1072
|
};
|
|
1078
|
-
L = new WeakMap(), Dt = new WeakMap(), vt = new WeakMap(), Yt = new WeakMap(), h(
|
|
1079
|
-
let ie =
|
|
1073
|
+
L = new WeakMap(), Dt = new WeakMap(), vt = new WeakMap(), Yt = new WeakMap(), h(ge, "LayoutManager");
|
|
1074
|
+
let ie = ge;
|
|
1080
1075
|
var wt, st;
|
|
1081
1076
|
const be = class be {
|
|
1082
1077
|
constructor(n) {
|