@ninebone/table 0.0.811 β 0.0.813
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 +139 -139
- 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
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
var ms = Object.defineProperty;
|
|
2
|
-
var xs = (
|
|
3
|
-
throw TypeError(
|
|
2
|
+
var xs = (T) => {
|
|
3
|
+
throw TypeError(T);
|
|
4
4
|
};
|
|
5
|
-
var Rs = (
|
|
6
|
-
var h = (
|
|
7
|
-
var E = (
|
|
8
|
-
var t = (
|
|
9
|
-
var ws = (
|
|
5
|
+
var Rs = (T, s, e) => s in T ? ms(T, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : T[s] = e;
|
|
6
|
+
var h = (T, s) => ms(T, "name", { value: s, configurable: !0 });
|
|
7
|
+
var E = (T, s, e) => Rs(T, typeof s != "symbol" ? s + "" : s, e), qe = (T, s, e) => s.has(T) || xs("Cannot " + e);
|
|
8
|
+
var t = (T, s, e) => (qe(T, s, "read from private field"), e ? e.call(T) : s.get(T)), d = (T, s, e) => s.has(T) ? xs("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(T) : s.set(T, e), y = (T, s, e, n) => (qe(T, s, "write to private field"), n ? n.call(T, e) : s.set(T, e), e), Y = (T, s, e) => (qe(T, s, "access private method"), e);
|
|
9
|
+
var ws = (T, s, e, n) => ({
|
|
10
10
|
set _(r) {
|
|
11
|
-
|
|
11
|
+
y(T, s, r, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
|
-
return t(
|
|
14
|
+
return t(T, s, n);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
import { trace as As } from "@ninebone/util";
|
|
@@ -22,7 +22,7 @@ const es = class es extends As.constructor {
|
|
|
22
22
|
};
|
|
23
23
|
h(es, "Trace");
|
|
24
24
|
let Te = es;
|
|
25
|
-
const
|
|
25
|
+
const q = new Te();
|
|
26
26
|
var j, K, A, Q, tt, et, Zt, st, Jt;
|
|
27
27
|
const ss = class ss extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
@@ -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;
|
|
@@ -69,7 +69,7 @@ const ss = class ss extends HTMLElement {
|
|
|
69
69
|
let a = e;
|
|
70
70
|
a < 0 && (a = 0);
|
|
71
71
|
const c = i.width - o;
|
|
72
|
-
a > c && (a = c), a = parseInt(a, 10), t(this, A).thumb.style.left = `${a}px`,
|
|
72
|
+
a > c && (a = c), a = parseInt(a, 10), t(this, A).thumb.style.left = `${a}px`, q.log("1111=========="), t(this, A).left.disabled = a === 0, t(this, A).right.disabled = a >= c - 1;
|
|
73
73
|
const l = n.clientWidth, f = r.scrollWidth - l;
|
|
74
74
|
return c > 0 && f > 0 && (n.scrollLeft = a / c * f), a > 0 && a < c - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
@@ -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,30 +226,30 @@ 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
|
+
q.log("nine-table-vscrollbar.#init");
|
|
234
234
|
const e = t(this, k).container, n = /* @__PURE__ */ h(() => {
|
|
235
235
|
const i = (t(this, nt).data.get() || []).length, o = t(this, rt).getRowHeight();
|
|
236
236
|
return i * o;
|
|
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"),
|
|
@@ -352,13 +352,13 @@ const ns = class ns extends HTMLElement {
|
|
|
352
352
|
nt = new WeakMap(), rt = new WeakMap(), yt = new WeakMap(), k = new WeakMap(), kt = new WeakMap(), Lt = new WeakMap(), Qt = new WeakMap(), h(ns, "NineTableVScrollBar");
|
|
353
353
|
let ke = ns;
|
|
354
354
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", ke);
|
|
355
|
-
var ot, R, it,
|
|
355
|
+
var ot, R, it, V, O, G, at, It, Ye, Ue, te, Xe, ee, se, Mt, Ht, $t, ne, re, Nt, mt, oe, ie;
|
|
356
356
|
const rs = class rs {
|
|
357
357
|
constructor(s) {
|
|
358
358
|
d(this, ot);
|
|
359
359
|
d(this, R);
|
|
360
360
|
d(this, it);
|
|
361
|
-
d(this,
|
|
361
|
+
d(this, V, /* @__PURE__ */ new Map());
|
|
362
362
|
d(this, O, null);
|
|
363
363
|
d(this, G, null);
|
|
364
364
|
d(this, at, 0);
|
|
@@ -371,15 +371,15 @@ const rs = class rs {
|
|
|
371
371
|
d(this, ee, 0);
|
|
372
372
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
373
373
|
var e;
|
|
374
|
-
|
|
374
|
+
q.log("rowManager.refresh");
|
|
375
375
|
const s = t(this, R).querySelector(".ng-container-body .ng-part-body");
|
|
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
|
-
|
|
379
|
+
q.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, V).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");
|
|
@@ -387,13 +387,13 @@ const rs = class rs {
|
|
|
387
387
|
const l = c.querySelector("tbody.bindable-tbody");
|
|
388
388
|
if (!l) return;
|
|
389
389
|
const f = Array.from(l.querySelectorAll("tr")).map((b) => b.cloneNode(!0));
|
|
390
|
-
t(this,
|
|
390
|
+
t(this, V).set(o, f);
|
|
391
391
|
});
|
|
392
392
|
const s = t(this, R).querySelector(".ng-container-body .ng-part-body"), e = t(this, R).querySelector(".ng-container-left .ng-part-body"), n = t(this, R).querySelector(".ng-container-right .ng-part-body"), r = t(this, R).querySelector(".ng-container-body .ng-part-header"), i = t(this, R).querySelector(".ng-container-body .ng-part-footer");
|
|
393
|
-
if (s) {
|
|
393
|
+
if (q.log(t(this, V)), 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;
|
|
@@ -414,8 +414,8 @@ const rs = class rs {
|
|
|
414
414
|
}
|
|
415
415
|
}, "initialize"));
|
|
416
416
|
d(this, se, /* @__PURE__ */ h((s, e) => {
|
|
417
|
-
|
|
418
|
-
const n = t(this,
|
|
417
|
+
q.log("rowManager.#renderRows");
|
|
418
|
+
const n = t(this, V).get(e);
|
|
419
419
|
if (!n || n.length === 0) return;
|
|
420
420
|
const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
421
421
|
if (!r) return;
|
|
@@ -431,8 +431,8 @@ const rs = class rs {
|
|
|
431
431
|
if (t(this, O) !== null && t(this, O) > 0)
|
|
432
432
|
return t(this, O);
|
|
433
433
|
const s = t(this, R).querySelector(".ng-container-body .ng-part-body");
|
|
434
|
-
|
|
435
|
-
const e = t(this,
|
|
434
|
+
q.log("rowManager.#measureAndCacheHeight");
|
|
435
|
+
const e = t(this, V).get(".ng-container-body");
|
|
436
436
|
if (!e || e.length === 0) throw new Error("invalid dom");
|
|
437
437
|
const n = s.querySelector("tbody.bindable-tbody");
|
|
438
438
|
if (!n) throw new Error("invalid dom");
|
|
@@ -448,14 +448,14 @@ 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
|
+
q.log("rowManager.#updateVirtualScrollHeight");
|
|
459
459
|
const e = (t(this, ot).data.get() || []).length, n = t(this, O), r = e * n;
|
|
460
460
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
461
461
|
const o = t(this, R).querySelector(i);
|
|
@@ -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,13 +508,13 @@ 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)));
|
|
515
515
|
}, "#initResizeObserver"));
|
|
516
516
|
d(this, Nt, /* @__PURE__ */ h(() => {
|
|
517
|
-
|
|
517
|
+
q.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((s) => {
|
|
518
518
|
const e = t(this, R).querySelector(s);
|
|
519
519
|
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, se).call(this, e, s);
|
|
520
520
|
}), t(this, ie).call(this), t(this, ne).call(this);
|
|
@@ -525,15 +525,15 @@ const rs = class rs {
|
|
|
525
525
|
if (!e || e <= 0) return;
|
|
526
526
|
const n = t(this, ot).data.length;
|
|
527
527
|
if (n === 0) return;
|
|
528
|
-
const r = ((f = t(this,
|
|
528
|
+
const r = ((f = t(this, V).get(".ng-container-body")) == null ? void 0 : f.length) || 1, i = t(this, R).querySelector(".ng-container-body .ng-part-body"), o = Math.max(0, n - Math.floor(i.clientHeight / e)), a = Math.min(o, Math.max(0, Math.floor(s / e)));
|
|
529
529
|
let c = Math.floor(a * e);
|
|
530
530
|
const l = t(this, it).firstTr, g = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
|
|
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);
|
|
@@ -569,7 +569,7 @@ const rs = class rs {
|
|
|
569
569
|
}, "#bindRowData"));
|
|
570
570
|
d(this, ie, /* @__PURE__ */ h(() => {
|
|
571
571
|
var c, l, g;
|
|
572
|
-
|
|
572
|
+
q.log("rowManager.#syncHeaderHeights");
|
|
573
573
|
const s = t(this, R).querySelector(".ng-container-left .ng-part-header table"), e = t(this, R).querySelector(".ng-container-body .ng-part-header table"), n = t(this, R).querySelector(".ng-container-right .ng-part-header table");
|
|
574
574
|
if (!e) return;
|
|
575
575
|
const r = s ? Array.from(s.querySelectorAll("tr")) : [], i = Array.from(e.querySelectorAll("tr")), o = n ? Array.from(n.querySelectorAll("tr")) : [], a = Math.max(r.length, i.length, o.length);
|
|
@@ -583,19 +583,19 @@ 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);
|
|
592
592
|
}
|
|
593
593
|
templateLength(s = ".ng-container-body") {
|
|
594
594
|
var e;
|
|
595
|
-
return ((e = t(this,
|
|
595
|
+
return ((e = t(this, V).get(s)) == null ? void 0 : e.length) || 1;
|
|
596
596
|
}
|
|
597
597
|
};
|
|
598
|
-
ot = new WeakMap(), R = new WeakMap(), it = new WeakMap(),
|
|
598
|
+
ot = new WeakMap(), R = new WeakMap(), it = new WeakMap(), V = new WeakMap(), O = new WeakMap(), G = new WeakMap(), at = new WeakMap(), It = new WeakMap(), Ye = new WeakMap(), Ue = new WeakMap(), te = new WeakMap(), Xe = new WeakMap(), ee = new WeakMap(), se = new WeakMap(), Mt = new WeakMap(), Ht = new WeakMap(), $t = new WeakMap(), ne = new WeakMap(), re = new WeakMap(), Nt = new WeakMap(), mt = new WeakMap(), oe = new WeakMap(), ie = new WeakMap(), h(rs, "RowManager");
|
|
599
599
|
let Le = rs;
|
|
600
600
|
const ae = class ae {
|
|
601
601
|
/**
|
|
@@ -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";
|
|
@@ -686,7 +686,7 @@ const os = class os {
|
|
|
686
686
|
d(this, U, { startRow: -1, startCol: -1, endRow: -1, endCol: -1 });
|
|
687
687
|
E(this, "render", /* @__PURE__ */ h(() => {
|
|
688
688
|
const { startRow: s, startCol: e, endRow: n, endCol: r } = t(this, U);
|
|
689
|
-
|
|
689
|
+
q.log("π¨ [CellSelection.render] Rendering range ->", t(this, U));
|
|
690
690
|
const i = t(this, N).querySelectorAll(
|
|
691
691
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
692
692
|
);
|
|
@@ -695,32 +695,32 @@ const os = class os {
|
|
|
695
695
|
c.classList.remove("selected", "selected-top", "selected-bottom", "selected-left", "selected-right");
|
|
696
696
|
});
|
|
697
697
|
}), s < 0 || e < 0) {
|
|
698
|
-
|
|
698
|
+
q.log("β οΈ [CellSelection.render] Range is invalid (< 0), skipping render.");
|
|
699
699
|
return;
|
|
700
700
|
}
|
|
701
701
|
let o = 0;
|
|
702
702
|
i.forEach((a) => {
|
|
703
703
|
a.querySelectorAll("tbody tr").forEach((c) => {
|
|
704
|
-
const { matrixRow: l } =
|
|
704
|
+
const { matrixRow: l } = Y(this, X, qt).call(this, c);
|
|
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"), q.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
|
+
}), q.log(`β¨ [CellSelection.render] Total rendered cells marked: ${o}`);
|
|
713
713
|
}, "render"));
|
|
714
|
-
|
|
714
|
+
y(this, N, s), Y(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", () => {
|
|
718
718
|
t(this, U).startRow >= 0 && t(this, U).startCol >= 0 && this.render();
|
|
719
719
|
});
|
|
720
|
-
}),
|
|
720
|
+
}), q.log("π― [CellSelection] Initialized");
|
|
721
721
|
}
|
|
722
722
|
setRange(s, e, n, r) {
|
|
723
|
-
|
|
723
|
+
q.log(`π [CellSelection.setRange] Input -> startRow: ${s}, startCol: ${e}, endRow: ${n}, endCol: ${r}`);
|
|
724
724
|
let i = Math.min(s, n), o = Math.max(s, n), a = Math.min(e, r), c = Math.max(e, r);
|
|
725
725
|
const l = t(this, N).querySelectorAll(
|
|
726
726
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
@@ -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 } = Y(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 }), q.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) {
|
|
@@ -754,7 +754,7 @@ N = new WeakMap(), U = new WeakMap(), X = new WeakSet(), qt = /* @__PURE__ */ h(
|
|
|
754
754
|
}, "#getMatrixRow"), vs = /* @__PURE__ */ h(function() {
|
|
755
755
|
const s = t(this, N).querySelector(".ng-container-top");
|
|
756
756
|
if (!s) {
|
|
757
|
-
|
|
757
|
+
q.log("β [CellSelection] .ng-container-top not found!");
|
|
758
758
|
return;
|
|
759
759
|
}
|
|
760
760
|
s.addEventListener("mousedown", (e) => {
|
|
@@ -762,12 +762,12 @@ N = new WeakMap(), U = new WeakMap(), X = new WeakSet(), qt = /* @__PURE__ */ h(
|
|
|
762
762
|
const n = e.target.closest("td, th");
|
|
763
763
|
if (!n || n.dataset.row === void 0 || n.dataset.col === void 0 || n.closest("tr").classList.contains("nodata")) return;
|
|
764
764
|
t(this, N).style.userSelect = "none", t(this, N).style.webkitUserSelect = "none";
|
|
765
|
-
const r = n.closest("tr"), { matrixRow: i } =
|
|
765
|
+
const r = n.closest("tr"), { matrixRow: i } = Y(this, X, qt).call(this, r), o = parseInt(n.dataset.col, 10);
|
|
766
766
|
if (i < 0) {
|
|
767
767
|
t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "";
|
|
768
768
|
return;
|
|
769
769
|
}
|
|
770
|
-
|
|
770
|
+
q.log(`π±οΈ [MouseDown Success] startRow: ${i}, startCol: ${o}`), t(this, N).navigation.currentCell = n;
|
|
771
771
|
let a = i, c = o;
|
|
772
772
|
const l = /* @__PURE__ */ h((f) => {
|
|
773
773
|
const b = document.elementFromPoint(f.clientX, f.clientY);
|
|
@@ -783,10 +783,10 @@ 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 } = Y(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
|
+
q.log("π±οΈ [MouseUp] Drag ended."), t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "", document.removeEventListener("mousemove", l), document.removeEventListener("mouseup", g);
|
|
790
790
|
}, "onMouseUp");
|
|
791
791
|
document.addEventListener("mousemove", l), document.addEventListener("mouseup", g);
|
|
792
792
|
});
|
|
@@ -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), Y(this, pt, Ss).call(this), q.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);
|
|
@@ -901,7 +901,7 @@ const is = class is {
|
|
|
901
901
|
if (!t(this, lt)) return;
|
|
902
902
|
const e = t(this, lt), n = e.closest("tr"), r = parseInt(e.dataset.row, 10), i = parseInt(e.dataset.col, 10), o = n == null ? void 0 : n.closest("tbody");
|
|
903
903
|
if (!o) return;
|
|
904
|
-
const c = Array.from(o.querySelectorAll("tr
|
|
904
|
+
const c = Array.from(o.querySelectorAll("tr")).filter((W) => parseInt(W.dataset.row, 10) === r), l = c.length > 0 ? c.length : 1, g = c.indexOf(n), f = r * l + (g >= 0 ? g : 0);
|
|
905
905
|
let b = f, u = i;
|
|
906
906
|
switch (s.code) {
|
|
907
907
|
case "Tab":
|
|
@@ -924,21 +924,21 @@ const is = class is {
|
|
|
924
924
|
u = t(this, Dt).call(this, f, i);
|
|
925
925
|
break;
|
|
926
926
|
case "ArrowDown":
|
|
927
|
-
s.preventDefault(), b = f + (e.rowSpan || 1);
|
|
927
|
+
s.preventDefault(), b = f + (e.rowSpan || 1), q.log("matrixRow:", f, "nextMatrixRow", b);
|
|
928
928
|
break;
|
|
929
929
|
case "ArrowUp":
|
|
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)
|
|
936
|
-
this.currentCell = w,
|
|
937
|
-
else if (
|
|
933
|
+
const p = Math.floor(b / l), x = b % l;
|
|
934
|
+
let w = t(this, Wt).call(this, p, x, u, b);
|
|
935
|
+
if (q.log(w, p, x, u, b), w)
|
|
936
|
+
this.currentCell = w, Y(this, pt, $e).call(this, w);
|
|
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,
|
|
941
|
-
B && (this.currentCell = B,
|
|
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
|
+
B && (this.currentCell = B, Y(this, pt, $e).call(this, B));
|
|
942
942
|
}, 0);
|
|
943
943
|
}
|
|
944
944
|
}
|
|
@@ -965,11 +965,11 @@ const Tt = class Tt extends HTMLElement {
|
|
|
965
965
|
d(this, zt);
|
|
966
966
|
d(this, Bt);
|
|
967
967
|
E(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
968
|
-
|
|
968
|
+
q.log("sheet.invalidate()"), t(this, dt).refresh();
|
|
969
969
|
}, "invalidate"));
|
|
970
970
|
E(this, "generate", /* @__PURE__ */ h((e) => {
|
|
971
|
-
if (
|
|
972
|
-
|
|
971
|
+
if (q.log("sheet.generate()"), !e) return;
|
|
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);
|
|
@@ -1243,7 +1243,7 @@ const Tt = class Tt extends HTMLElement {
|
|
|
1243
1243
|
return t(this, Bt);
|
|
1244
1244
|
}
|
|
1245
1245
|
disconnectedCallback() {
|
|
1246
|
-
this.innerHTML = "",
|
|
1246
|
+
this.innerHTML = "", q.log("NineTableSheet destroyed.");
|
|
1247
1247
|
}
|
|
1248
1248
|
};
|
|
1249
1249
|
he = new WeakMap(), ht = new WeakMap(), dt = new WeakMap(), zt = new WeakMap(), Bt = new WeakMap(), de = new WeakMap(), fe = new WeakMap(), xt = new WeakMap(), ue = new WeakMap(), ge = new WeakMap(), h(Tt, "NineTableSheet"), E(Tt, "SCROLLBAR_SIZE", 16);
|
|
@@ -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,14 +1663,14 @@ 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, []), q.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)
|
|
1673
|
-
|
|
1673
|
+
q.log(e), $("[data-bind]", e).each((n, r) => {
|
|
1674
1674
|
const i = r.dataset.bind, o = r.getAttribute("data-type") || "string";
|
|
1675
1675
|
i && t(this, H).push({ name: i, type: o });
|
|
1676
1676
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((n) => {
|
|
@@ -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,15 +1729,15 @@ 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)), q.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);
|
|
1738
1738
|
}
|
|
1739
1739
|
disconnectedCallback() {
|
|
1740
|
-
|
|
1740
|
+
q.log("NineTable disconnected.");
|
|
1741
1741
|
}
|
|
1742
1742
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1743
1743
|
get data() {
|
|
@@ -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");
|