@ninebone/table 0.0.671 β 0.0.673
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 +155 -154
- 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
|
@@ -22,18 +22,18 @@ const He = class He extends Ke.constructor {
|
|
|
22
22
|
};
|
|
23
23
|
c(He, "Trace");
|
|
24
24
|
let oe = He;
|
|
25
|
-
const
|
|
26
|
-
var B, j,
|
|
25
|
+
const M = new oe();
|
|
26
|
+
var B, j, S, X, K, Z, _t, G, Nt;
|
|
27
27
|
const Me = class Me extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
d(this, B);
|
|
31
31
|
d(this, j, !1);
|
|
32
|
-
d(this,
|
|
32
|
+
d(this, S);
|
|
33
33
|
d(this, X);
|
|
34
34
|
d(this, K);
|
|
35
35
|
d(this, Z);
|
|
36
|
-
d(this,
|
|
36
|
+
d(this, _t, /* @__PURE__ */ c(() => {
|
|
37
37
|
if (!t(this, B)) return;
|
|
38
38
|
const e = t(this, B).querySelector(".ng-container-body .ng-part-body");
|
|
39
39
|
e && (y(this, Z, new ResizeObserver(() => {
|
|
@@ -41,10 +41,10 @@ const Me = class Me extends HTMLElement {
|
|
|
41
41
|
})), t(this, Z).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
E(this, "refresh", /* @__PURE__ */ c(() => {
|
|
44
|
-
if (!t(this, B) || !t(this,
|
|
45
|
-
const e = t(this,
|
|
44
|
+
if (!t(this, B) || !t(this, S) || t(this, j)) return;
|
|
45
|
+
const e = t(this, S).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const r = t(this,
|
|
47
|
+
const r = t(this, S).track, n = t(this, S).thumb, o = t(this, B).querySelector(".ng-container-bottom"), a = e.clientWidth, h = s.scrollWidth;
|
|
48
48
|
if (a !== 0 && h > a)
|
|
49
49
|
o && (o.style.display = "flex");
|
|
50
50
|
else {
|
|
@@ -59,27 +59,27 @@ const Me = class Me extends HTMLElement {
|
|
|
59
59
|
let u = 0;
|
|
60
60
|
b > 0 && (u = parseInt(g / b * (l - f), 10)), u < 0 && (u = 0);
|
|
61
61
|
const v = l - f;
|
|
62
|
-
u > v && (u = v), n.style.left = `${u}px`, t(this,
|
|
62
|
+
u > v && (u = v), n.style.left = `${u}px`, t(this, S).left.disabled = u === 0, t(this, S).right.disabled = u >= v - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
64
|
d(this, G, /* @__PURE__ */ c((e) => {
|
|
65
|
-
if (!t(this,
|
|
66
|
-
const s = t(this,
|
|
65
|
+
if (!t(this, S)) return !1;
|
|
66
|
+
const s = t(this, S).container, r = s.querySelector("table");
|
|
67
67
|
if (!r) return !1;
|
|
68
|
-
const n = t(this,
|
|
68
|
+
const n = t(this, S).track.getBoundingClientRect(), o = t(this, S).thumb.clientWidth;
|
|
69
69
|
let a = e;
|
|
70
70
|
a < 0 && (a = 0);
|
|
71
71
|
const h = n.width - o;
|
|
72
|
-
a > h && (a = h), a = parseInt(a, 10), t(this,
|
|
72
|
+
a > h && (a = h), a = parseInt(a, 10), t(this, S).thumb.style.left = `${a}px`, t(this, S).left.disabled = a === 0, t(this, S).right.disabled = a >= h - 1;
|
|
73
73
|
const l = s.clientWidth, g = r.scrollWidth - l;
|
|
74
74
|
return h > 0 && g > 0 && (s.scrollLeft = a / h * g), a > 0 && a < h - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
d(this,
|
|
76
|
+
d(this, Nt, /* @__PURE__ */ c(() => {
|
|
77
77
|
const e = /* @__PURE__ */ c((r) => {
|
|
78
78
|
clearInterval(t(this, X)), clearInterval(t(this, K));
|
|
79
|
-
const n = parseInt(t(this,
|
|
79
|
+
const n = parseInt(t(this, S).thumb.style.left || 0, 10);
|
|
80
80
|
t(this, G).call(this, n + r), y(this, X, setInterval(() => {
|
|
81
81
|
clearInterval(t(this, X)), y(this, K, setInterval(() => {
|
|
82
|
-
const o = parseInt(t(this,
|
|
82
|
+
const o = parseInt(t(this, S).thumb.style.left || 0, 10);
|
|
83
83
|
t(this, G).call(this, o + r) || clearInterval(t(this, K));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
@@ -87,22 +87,22 @@ const Me = class Me extends HTMLElement {
|
|
|
87
87
|
clearInterval(t(this, X)), clearInterval(t(this, K));
|
|
88
88
|
}, "clearTimer");
|
|
89
89
|
["mouseup", "mouseleave", "touchend"].forEach((r) => {
|
|
90
|
-
t(this,
|
|
91
|
-
}), t(this,
|
|
90
|
+
t(this, S).left.addEventListener(r, s), t(this, S).right.addEventListener(r, s), t(this, S).track.addEventListener(r, s);
|
|
91
|
+
}), t(this, S).left.addEventListener("mousedown", (r) => {
|
|
92
92
|
r.button === 0 && e(-20);
|
|
93
|
-
}), t(this,
|
|
93
|
+
}), t(this, S).right.addEventListener("mousedown", (r) => {
|
|
94
94
|
r.button === 0 && e(20);
|
|
95
|
-
}), t(this,
|
|
95
|
+
}), t(this, S).left.addEventListener("touchstart", () => e(-20)), t(this, S).right.addEventListener("touchstart", () => e(20)), t(this, S).track.addEventListener("mousedown", (r) => {
|
|
96
96
|
if (r.button !== 0) return;
|
|
97
97
|
r.preventDefault();
|
|
98
|
-
const n = t(this,
|
|
98
|
+
const n = t(this, S).track.getBoundingClientRect(), o = t(this, S).thumb.clientWidth;
|
|
99
99
|
t(this, G).call(this, r.clientX - n.left - o / 2);
|
|
100
|
-
}), t(this,
|
|
100
|
+
}), t(this, S).thumb.addEventListener("mousedown", (r) => {
|
|
101
101
|
if (r.button !== 0) return;
|
|
102
|
-
r.stopPropagation(), r.preventDefault(), y(this, j, !0), this.shiftX = r.clientX - t(this,
|
|
102
|
+
r.stopPropagation(), r.preventDefault(), y(this, j, !0), this.shiftX = r.clientX - t(this, S).thumb.getBoundingClientRect().left;
|
|
103
103
|
const n = /* @__PURE__ */ c((a) => {
|
|
104
104
|
if (!t(this, j)) return;
|
|
105
|
-
const h = t(this,
|
|
105
|
+
const h = t(this, S).track.getBoundingClientRect();
|
|
106
106
|
t(this, G).call(this, a.clientX - h.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), o = /* @__PURE__ */ c(() => {
|
|
108
108
|
y(this, j, !1), s(), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), this.refresh();
|
|
@@ -182,7 +182,7 @@ const Me = class Me extends HTMLElement {
|
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
|
-
y(this,
|
|
185
|
+
y(this, S, {
|
|
186
186
|
container: s,
|
|
187
187
|
track: this.querySelector(".ng-scroll-track"),
|
|
188
188
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
@@ -190,7 +190,7 @@ const Me = class Me extends HTMLElement {
|
|
|
190
190
|
right: this.querySelector(".ng-scroll-right")
|
|
191
191
|
}), s.addEventListener("scroll", () => {
|
|
192
192
|
t(this, j) || this.refresh();
|
|
193
|
-
}), t(this,
|
|
193
|
+
}), t(this, Nt).call(this), t(this, _t).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
@@ -198,10 +198,10 @@ const Me = class Me extends HTMLElement {
|
|
|
198
198
|
t(this, Z) && t(this, Z).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
B = new WeakMap(), j = new WeakMap(),
|
|
201
|
+
B = new WeakMap(), j = new WeakMap(), S = new WeakMap(), X = new WeakMap(), K = new WeakMap(), Z = new WeakMap(), _t = new WeakMap(), G = new WeakMap(), Nt = new WeakMap(), c(Me, "NineTableHScrollBar");
|
|
202
202
|
let ae = Me;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ae);
|
|
204
|
-
var F, at, J, T, vt, xt,
|
|
204
|
+
var F, at, J, T, vt, xt, Wt;
|
|
205
205
|
const $e = class $e extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
@@ -229,8 +229,8 @@ const $e = class $e extends HTMLElement {
|
|
|
229
229
|
const v = l - f;
|
|
230
230
|
u < 0 && (u = 0), u > v && (u = v), r.style.top = `${u}px`, t(this, T).top.disabled = g <= 0, t(this, T).bottom.disabled = g >= b - 1;
|
|
231
231
|
}, "refresh"));
|
|
232
|
-
d(this,
|
|
233
|
-
|
|
232
|
+
d(this, Wt, /* @__PURE__ */ c(() => {
|
|
233
|
+
M.log("nine-table-vscrollbar.#init");
|
|
234
234
|
const e = t(this, T).container, s = /* @__PURE__ */ c(() => {
|
|
235
235
|
const n = (t(this, F).data.get() || []).length, o = t(this, at).getRowHeight();
|
|
236
236
|
return n * o;
|
|
@@ -242,9 +242,9 @@ const $e = class $e extends HTMLElement {
|
|
|
242
242
|
r.stopPropagation(), r.preventDefault(), y(this, J, !0), y(this, vt, r.clientY), y(this, xt, e.scrollTop);
|
|
243
243
|
const n = /* @__PURE__ */ c((a) => {
|
|
244
244
|
if (!t(this, J)) return;
|
|
245
|
-
const h = t(this, T).track.getBoundingClientRect(), l = t(this, T).thumb.clientHeight, g = h.height - l, b = a.clientY - t(this, vt), u = e.clientHeight, v = s(),
|
|
246
|
-
if (g > 0 &&
|
|
247
|
-
const A = b / g *
|
|
245
|
+
const h = t(this, T).track.getBoundingClientRect(), l = t(this, T).thumb.clientHeight, g = h.height - l, b = a.clientY - t(this, vt), u = e.clientHeight, v = s(), w = Math.max(v - u, 1);
|
|
246
|
+
if (g > 0 && w > 0) {
|
|
247
|
+
const A = b / g * w;
|
|
248
248
|
let m = t(this, xt) + A;
|
|
249
249
|
const W = Math.max(0, v - u);
|
|
250
250
|
m < 0 && (m = 0), m > W && (m = W), e.scrollTop = m;
|
|
@@ -346,19 +346,19 @@ const $e = class $e extends HTMLElement {
|
|
|
346
346
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
347
347
|
top: this.querySelector(".ng-scroll-top"),
|
|
348
348
|
bottom: this.querySelector(".ng-scroll-bottom")
|
|
349
|
-
}), t(this,
|
|
349
|
+
}), t(this, Wt).call(this), this.refresh();
|
|
350
350
|
}, "initWhenReady");
|
|
351
351
|
e();
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
|
-
F = new WeakMap(), at = new WeakMap(), J = new WeakMap(), T = new WeakMap(), vt = new WeakMap(), xt = new WeakMap(),
|
|
354
|
+
F = new WeakMap(), at = new WeakMap(), J = new WeakMap(), T = new WeakMap(), vt = new WeakMap(), xt = new WeakMap(), Wt = new WeakMap(), c($e, "NineTableVScrollBar");
|
|
355
355
|
let le = $e;
|
|
356
356
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", le);
|
|
357
|
-
var P,
|
|
357
|
+
var P, x, Q, D, I, V, tt, wt, Se, Ee, Ot, zt, St, Et, At, Bt, Dt, qt, Ae, lt, Rt, Pt;
|
|
358
358
|
const Ie = class Ie {
|
|
359
359
|
constructor(i) {
|
|
360
360
|
d(this, P);
|
|
361
|
-
d(this,
|
|
361
|
+
d(this, x);
|
|
362
362
|
d(this, Q);
|
|
363
363
|
d(this, D, /* @__PURE__ */ new Map());
|
|
364
364
|
d(this, I, null);
|
|
@@ -368,19 +368,19 @@ const Ie = class Ie {
|
|
|
368
368
|
d(this, Se, !1);
|
|
369
369
|
d(this, Ee, !1);
|
|
370
370
|
//#ticking = false; // π― κ³ μ μ€ν¬λ‘€ μ€λ‘νλ§μ© νλκ·Έ
|
|
371
|
-
d(this,
|
|
371
|
+
d(this, Ot, 3);
|
|
372
372
|
E(this, "refresh", /* @__PURE__ */ c(() => {
|
|
373
373
|
var e;
|
|
374
|
-
|
|
375
|
-
const i = t(this,
|
|
376
|
-
i && (t(this, St).call(this), t(this, lt).call(this, i.scrollTop), (e = t(this,
|
|
374
|
+
M.log("rowManager.refresh");
|
|
375
|
+
const i = t(this, x).querySelector(".ng-container-body .ng-part-body");
|
|
376
|
+
i && (t(this, St).call(this), t(this, Et).call(this), t(this, lt).call(this, i.scrollTop), (e = t(this, x).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
377
377
|
}, "refresh"));
|
|
378
378
|
E(this, "initialize", /* @__PURE__ */ c(() => {
|
|
379
|
-
|
|
380
|
-
scrollTables: t(this,
|
|
381
|
-
firstTr: t(this,
|
|
379
|
+
M.log("rowManager.initialize"), y(this, Q, {
|
|
380
|
+
scrollTables: t(this, x).querySelectorAll(".ng-part-body table"),
|
|
381
|
+
firstTr: t(this, x).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
382
382
|
}), y(this, I, null), t(this, D).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
383
|
-
const a = t(this,
|
|
383
|
+
const a = t(this, x).querySelector(o);
|
|
384
384
|
if (!a) return;
|
|
385
385
|
const h = a.querySelector(".ng-part-body table");
|
|
386
386
|
if (!h) return;
|
|
@@ -389,9 +389,9 @@ const Ie = class Ie {
|
|
|
389
389
|
const g = Array.from(l.querySelectorAll("tr")).map((b) => b.cloneNode(!0));
|
|
390
390
|
t(this, D).set(o, g);
|
|
391
391
|
});
|
|
392
|
-
const i = t(this,
|
|
392
|
+
const i = t(this, x).querySelector(".ng-container-body .ng-part-body"), e = t(this, x).querySelector(".ng-container-left .ng-part-body"), s = t(this, x).querySelector(".ng-container-right .ng-part-body"), r = t(this, x).querySelector(".ng-container-body .ng-part-header"), n = t(this, x).querySelector(".ng-container-body .ng-part-footer");
|
|
393
393
|
if (i) {
|
|
394
|
-
t(this,
|
|
394
|
+
t(this, St).call(this), t(this, qt).call(this), t(this, Et).call(this), t(this, lt).call(this, i.scrollTop);
|
|
395
395
|
let o = !1;
|
|
396
396
|
const a = /* @__PURE__ */ c((h) => {
|
|
397
397
|
if (o) return;
|
|
@@ -406,8 +406,8 @@ const Ie = class Ie {
|
|
|
406
406
|
});
|
|
407
407
|
}
|
|
408
408
|
}, "initialize"));
|
|
409
|
-
d(this,
|
|
410
|
-
|
|
409
|
+
d(this, zt, /* @__PURE__ */ c((i, e) => {
|
|
410
|
+
M.log("rowManager.#renderRows");
|
|
411
411
|
const s = t(this, D).get(e);
|
|
412
412
|
if (!s || s.length === 0) return;
|
|
413
413
|
const r = i.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
@@ -420,20 +420,21 @@ const Ie = class Ie {
|
|
|
420
420
|
});
|
|
421
421
|
n ? n.before(o) : r.appendChild(o), e === ".ng-container-body" && (t(this, Q).firstTr = r.querySelector("tr:not(.nodata)"));
|
|
422
422
|
}, "#renderRows"));
|
|
423
|
-
d(this,
|
|
424
|
-
if (
|
|
423
|
+
d(this, St, /* @__PURE__ */ c(() => {
|
|
424
|
+
if (t(this, I) !== null && t(this, I) > 0)
|
|
425
425
|
return t(this, I);
|
|
426
|
-
|
|
426
|
+
const i = t(this, x).querySelector(".ng-container-body .ng-part-body");
|
|
427
|
+
M.log("rowManager.#measureAndCacheHeight");
|
|
427
428
|
const e = t(this, D).get(".ng-container-body");
|
|
428
429
|
if (!e || e.length === 0) throw new Error("invalid dom");
|
|
429
430
|
const s = i.querySelector("tbody.bindable-tbody");
|
|
430
|
-
if (
|
|
431
|
+
if (M.log(s), !s) throw new Error("invalid dom");
|
|
431
432
|
s.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
|
|
432
433
|
const r = s.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
433
434
|
e.forEach((b) => {
|
|
434
435
|
n.appendChild(b.cloneNode(!0));
|
|
435
436
|
}), r ? r.before(n) : s.appendChild(n);
|
|
436
|
-
const o = t(this,
|
|
437
|
+
const o = t(this, x), a = o.style.display, h = o.style.visibility, l = o.style.position;
|
|
437
438
|
(a === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
438
439
|
let f = 0;
|
|
439
440
|
const g = s.querySelectorAll("tr");
|
|
@@ -445,53 +446,53 @@ const Ie = class Ie {
|
|
|
445
446
|
}
|
|
446
447
|
f += u;
|
|
447
448
|
}), g.forEach((b) => b.remove()), o.style.display = a, o.style.visibility = h, o.style.position = l, f <= 0) throw new Error("#measureAndCacheHeight() invalid dom");
|
|
448
|
-
return y(this, I, f), t(this,
|
|
449
|
+
return y(this, I, f), t(this, At).call(this), t(this, I);
|
|
449
450
|
}, "#measureAndCacheHeight"));
|
|
450
|
-
d(this,
|
|
451
|
-
|
|
451
|
+
d(this, Et, /* @__PURE__ */ c(() => {
|
|
452
|
+
M.log("rowManager.#updateVirtualScrollHeight");
|
|
452
453
|
const e = (t(this, P).data.get() || []).length, s = t(this, I), r = e * s;
|
|
453
|
-
|
|
454
|
-
const o = t(this,
|
|
454
|
+
M.log("π [VirtualHeight]", { totalCount: e, rowHeight: s, totalVirtualHeight: r }), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
455
|
+
const o = t(this, x).querySelector(n);
|
|
455
456
|
if (!o) return;
|
|
456
457
|
const a = o.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
457
458
|
a && (a.style.height = `${r}px`);
|
|
458
459
|
});
|
|
459
460
|
}, "#updateVirtualScrollHeight"));
|
|
460
|
-
d(this,
|
|
461
|
+
d(this, At, /* @__PURE__ */ c(() => {
|
|
461
462
|
if (t(this, tt) > 0 && t(this, I) > 0) {
|
|
462
463
|
const i = Math.ceil(t(this, tt) / t(this, I));
|
|
463
|
-
y(this, wt, i + t(this,
|
|
464
|
+
y(this, wt, i + t(this, Ot));
|
|
464
465
|
}
|
|
465
466
|
}, "#updateRowCount"));
|
|
466
467
|
d(this, Bt, /* @__PURE__ */ c(() => {
|
|
467
468
|
var a, h, l, f, g, b;
|
|
468
|
-
const i = t(this,
|
|
469
|
+
const i = t(this, x).querySelector(".ng-container-left .ng-part-body table"), e = t(this, x).querySelector(".ng-container-body .ng-part-body table"), s = t(this, x).querySelector(".ng-container-right .ng-part-body table");
|
|
469
470
|
if (e) {
|
|
470
|
-
const u = i ? Array.from(i.querySelectorAll("tbody tr")) : [], v = Array.from(e.querySelectorAll("tbody tr")),
|
|
471
|
+
const u = i ? Array.from(i.querySelectorAll("tbody tr")) : [], v = Array.from(e.querySelectorAll("tbody tr")), w = s ? Array.from(s.querySelectorAll("tbody tr")) : [], A = Math.max(u.length, v.length, w.length);
|
|
471
472
|
for (let m = 0; m < A; m++) {
|
|
472
473
|
const W = [
|
|
473
474
|
((a = u[m]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
474
475
|
((h = v[m]) == null ? void 0 : h.getBoundingClientRect().height) || 0,
|
|
475
|
-
((l =
|
|
476
|
+
((l = w[m]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
476
477
|
], R = Math.max(...W);
|
|
477
|
-
R > 0 && (u[m] && (u[m].style.height = `${R}px`), v[m] && (v[m].style.height = `${R}px`),
|
|
478
|
+
R > 0 && (u[m] && (u[m].style.height = `${R}px`), v[m] && (v[m].style.height = `${R}px`), w[m] && (w[m].style.height = `${R}px`));
|
|
478
479
|
}
|
|
479
480
|
}
|
|
480
|
-
const r = t(this,
|
|
481
|
+
const r = t(this, x).querySelector(".ng-container-left .ng-part-footer table"), n = t(this, x).querySelector(".ng-container-body .ng-part-footer table"), o = t(this, x).querySelector(".ng-container-right .ng-part-footer table");
|
|
481
482
|
if (n) {
|
|
482
|
-
const u = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], v = Array.from(n.querySelectorAll("tfoot tr")),
|
|
483
|
+
const u = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], v = Array.from(n.querySelectorAll("tfoot tr")), w = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], A = Math.max(u.length, v.length, w.length);
|
|
483
484
|
for (let m = 0; m < A; m++) {
|
|
484
485
|
const W = [
|
|
485
486
|
((f = u[m]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
486
487
|
((g = v[m]) == null ? void 0 : g.getBoundingClientRect().height) || 0,
|
|
487
|
-
((b =
|
|
488
|
+
((b = w[m]) == null ? void 0 : b.getBoundingClientRect().height) || 0
|
|
488
489
|
], R = Math.max(...W);
|
|
489
|
-
R > 0 && (u[m] && (u[m].style.height = `${R}px`), v[m] && (v[m].style.height = `${R}px`),
|
|
490
|
+
R > 0 && (u[m] && (u[m].style.height = `${R}px`), v[m] && (v[m].style.height = `${R}px`), w[m] && (w[m].style.height = `${R}px`));
|
|
490
491
|
}
|
|
491
492
|
}
|
|
492
493
|
}, "#syncRowHeights"));
|
|
493
494
|
d(this, Dt, /* @__PURE__ */ c(() => {
|
|
494
|
-
!t(this,
|
|
495
|
+
!t(this, x) || !(t(this, x) instanceof HTMLElement) || (y(this, V, new ResizeObserver((i) => {
|
|
495
496
|
for (const e of i) {
|
|
496
497
|
const s = e.target;
|
|
497
498
|
if (!s.classList.contains("active")) continue;
|
|
@@ -501,21 +502,21 @@ const Ie = class Ie {
|
|
|
501
502
|
const o = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
|
|
502
503
|
o && (n += o.offsetHeight), a && (n += a.offsetHeight);
|
|
503
504
|
const h = Math.max(r - n, 100);
|
|
504
|
-
t(this, tt) !== h && (y(this, tt, h), t(this,
|
|
505
|
+
t(this, tt) !== h && (y(this, tt, h), t(this, At).call(this), t(this, I) !== null && (t(this, qt).call(this), this.refresh()));
|
|
505
506
|
}
|
|
506
507
|
}
|
|
507
|
-
})), t(this, V).observe(t(this,
|
|
508
|
+
})), t(this, V).observe(t(this, x)));
|
|
508
509
|
}, "#initResizeObserver"));
|
|
509
|
-
d(this,
|
|
510
|
-
|
|
511
|
-
const e = t(this,
|
|
512
|
-
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this,
|
|
510
|
+
d(this, qt, /* @__PURE__ */ c(() => {
|
|
511
|
+
M.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
512
|
+
const e = t(this, x).querySelector(i);
|
|
513
|
+
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, zt).call(this, e, i);
|
|
513
514
|
}), t(this, Pt).call(this), t(this, Bt).call(this);
|
|
514
515
|
}, "#renderAllContainers"));
|
|
515
516
|
d(this, Ae, /* @__PURE__ */ c((i) => {
|
|
516
517
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
517
518
|
var l;
|
|
518
|
-
const s = t(this,
|
|
519
|
+
const s = t(this, x).querySelector(e);
|
|
519
520
|
if (!s) return;
|
|
520
521
|
const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
521
522
|
if (!r) return;
|
|
@@ -527,7 +528,7 @@ const Ie = class Ie {
|
|
|
527
528
|
return;
|
|
528
529
|
}
|
|
529
530
|
const u = t(this, P).data.get(b);
|
|
530
|
-
f.style.display = "", t(this,
|
|
531
|
+
f.style.display = "", t(this, Rt).call(this, f, u, b);
|
|
531
532
|
});
|
|
532
533
|
});
|
|
533
534
|
}, "#adjustBufferRows"));
|
|
@@ -537,25 +538,25 @@ const Ie = class Ie {
|
|
|
537
538
|
if (!e || e <= 0) return;
|
|
538
539
|
const s = t(this, P).data.length;
|
|
539
540
|
if (s === 0) return;
|
|
540
|
-
const r = ((g = t(this, D).get(".ng-container-body")) == null ? void 0 : g.length) || 1, n = t(this,
|
|
541
|
+
const r = ((g = t(this, D).get(".ng-container-body")) == null ? void 0 : g.length) || 1, n = t(this, x).querySelector(".ng-container-body .ng-part-body"), o = Math.max(0, s - Math.floor(n.clientHeight / e)), a = Math.min(o, Math.max(0, Math.floor(i / e)));
|
|
541
542
|
let h = Math.floor(a * e);
|
|
542
|
-
a === o &&
|
|
543
|
+
a === o && M.log(`π [Scroll Inspect] scrollTop: ${i}, rowHeight: ${e}, maxStartIndex: ${o}, startIndex: ${a}, offsetY: ${h}`);
|
|
543
544
|
const l = t(this, Q).firstTr, f = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
|
|
544
545
|
(b = t(this, Q)) == null || b.scrollTables.forEach((u) => {
|
|
545
546
|
u.style.transform = `translate3d(0, ${h}px, 0)`;
|
|
546
547
|
}), f !== a && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((u) => {
|
|
547
|
-
const v = t(this,
|
|
548
|
+
const v = t(this, x).querySelector(u);
|
|
548
549
|
if (!v) return;
|
|
549
|
-
const
|
|
550
|
-
if (!
|
|
551
|
-
Array.from(
|
|
550
|
+
const w = v.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
551
|
+
if (!w) return;
|
|
552
|
+
Array.from(w.querySelectorAll("tr:not(.nodata)")).forEach((m, W) => {
|
|
552
553
|
const R = a + Math.floor(W / r);
|
|
553
554
|
if (R >= s) {
|
|
554
555
|
m.style.display = "none";
|
|
555
556
|
return;
|
|
556
557
|
}
|
|
557
558
|
const O = t(this, P).data.get(R);
|
|
558
|
-
m.style.display = "", t(this,
|
|
559
|
+
m.style.display = "", t(this, Rt).call(this, m, O, R);
|
|
559
560
|
});
|
|
560
561
|
});
|
|
561
562
|
}, "#handleScroll"));
|
|
@@ -573,7 +574,7 @@ const Ie = class Ie {
|
|
|
573
574
|
cell.dataset.row = dataIndex;
|
|
574
575
|
});
|
|
575
576
|
}; */
|
|
576
|
-
d(this,
|
|
577
|
+
d(this, Rt, /* @__PURE__ */ c((i, e, s) => {
|
|
577
578
|
i.dataset.row = s, i.data = e, Array.from(i.cells).forEach((r, n) => {
|
|
578
579
|
r.dataset.row = s;
|
|
579
580
|
const o = Array.from(r.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
|
|
@@ -582,8 +583,8 @@ const Ie = class Ie {
|
|
|
582
583
|
}, "#bindRowData"));
|
|
583
584
|
d(this, Pt, /* @__PURE__ */ c(() => {
|
|
584
585
|
var h, l, f;
|
|
585
|
-
|
|
586
|
-
const i = t(this,
|
|
586
|
+
M.log("rowManager.#syncHeaderHeights");
|
|
587
|
+
const i = t(this, x).querySelector(".ng-container-left .ng-part-header table"), e = t(this, x).querySelector(".ng-container-body .ng-part-header table"), s = t(this, x).querySelector(".ng-container-right .ng-part-header table");
|
|
587
588
|
if (!e) return;
|
|
588
589
|
const r = i ? Array.from(i.querySelectorAll("tr")) : [], n = Array.from(e.querySelectorAll("tr")), o = s ? Array.from(s.querySelectorAll("tr")) : [], a = Math.max(r.length, n.length, o.length);
|
|
589
590
|
for (let g = 0; g < a; g++) {
|
|
@@ -598,7 +599,7 @@ const Ie = class Ie {
|
|
|
598
599
|
E(this, "destroy", /* @__PURE__ */ c(() => {
|
|
599
600
|
t(this, V) && (t(this, V).disconnect(), y(this, V, null));
|
|
600
601
|
}, "destroy"));
|
|
601
|
-
y(this, P, i.getRootNode().host), y(this,
|
|
602
|
+
y(this, P, i.getRootNode().host), y(this, x, i), t(this, Dt).call(this);
|
|
602
603
|
}
|
|
603
604
|
getRowHeight() {
|
|
604
605
|
return t(this, I);
|
|
@@ -608,7 +609,7 @@ const Ie = class Ie {
|
|
|
608
609
|
return ((e = t(this, D).get(i)) == null ? void 0 : e.length) || 1;
|
|
609
610
|
}
|
|
610
611
|
};
|
|
611
|
-
P = new WeakMap(),
|
|
612
|
+
P = new WeakMap(), x = new WeakMap(), Q = new WeakMap(), D = new WeakMap(), I = new WeakMap(), V = new WeakMap(), tt = new WeakMap(), wt = new WeakMap(), Se = new WeakMap(), Ee = new WeakMap(), Ot = new WeakMap(), zt = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), At = new WeakMap(), Bt = new WeakMap(), Dt = new WeakMap(), qt = new WeakMap(), Ae = new WeakMap(), lt = new WeakMap(), Rt = new WeakMap(), Pt = new WeakMap(), c(Ie, "RowManager");
|
|
612
613
|
let ce = Ie;
|
|
613
614
|
const jt = class jt {
|
|
614
615
|
/**
|
|
@@ -627,9 +628,9 @@ const jt = class jt {
|
|
|
627
628
|
const f = l.getAttribute("cell-type") || "renderer";
|
|
628
629
|
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
629
630
|
let g = `cell-${f}`;
|
|
630
|
-
const b = l.getAttribute("data-bind"), u = l.getAttribute("data-expr"), v = l.getAttribute("maxbyte"),
|
|
631
|
+
const b = l.getAttribute("data-bind"), u = l.getAttribute("data-expr"), v = l.getAttribute("maxbyte"), w = l.getAttribute("type");
|
|
631
632
|
let A = [];
|
|
632
|
-
b && A.push(`data-bind="${b}"`), u && A.push(`data-expr="${u}"`), v && A.push(`maxbyte="${v}"`),
|
|
633
|
+
b && A.push(`data-bind="${b}"`), u && A.push(`data-expr="${u}"`), v && A.push(`maxbyte="${v}"`), w && A.push(`type="${w}"`), l.innerHTML = `<${g} ${A.join(" ")}></${g}>`;
|
|
633
634
|
});
|
|
634
635
|
}, "processCellTypes"), s = /* @__PURE__ */ c((a) => {
|
|
635
636
|
if (!a.querySelector("colgroup")) {
|
|
@@ -654,25 +655,25 @@ const jt = class jt {
|
|
|
654
655
|
});
|
|
655
656
|
const u = Array.from(Array(g), () => Array(b).fill(null));
|
|
656
657
|
l.forEach((v) => {
|
|
657
|
-
const
|
|
658
|
+
const w = v.sectionRowIndex;
|
|
658
659
|
let A = 0;
|
|
659
660
|
Array.from(v.querySelectorAll("th,td")).forEach((m) => {
|
|
660
|
-
for (let O = 0; O < u[
|
|
661
|
-
if (u[
|
|
661
|
+
for (let O = 0; O < u[w].length; O++)
|
|
662
|
+
if (u[w][O] === null) {
|
|
662
663
|
A = O;
|
|
663
664
|
break;
|
|
664
665
|
}
|
|
665
666
|
const W = m.rowSpan || 1, R = m.colSpan || 1;
|
|
666
667
|
for (let O = 0; O < W; O++)
|
|
667
668
|
for (let yt = 0; yt < R; yt++)
|
|
668
|
-
|
|
669
|
+
w + O < g && A + yt < b && (u[w + O][A + yt] = O === 0 && yt === 0 ? "1" : "0");
|
|
669
670
|
});
|
|
670
671
|
}), l.forEach((v) => {
|
|
671
|
-
const
|
|
672
|
+
const w = v.sectionRowIndex;
|
|
672
673
|
Array.from(v.querySelectorAll("th,td")).forEach((A) => {
|
|
673
|
-
for (let m = 0; m < u[
|
|
674
|
-
if (u[
|
|
675
|
-
A.dataset.col = m, u[
|
|
674
|
+
for (let m = 0; m < u[w].length; m++)
|
|
675
|
+
if (u[w][m] === "1") {
|
|
676
|
+
A.dataset.col = m, u[w][m] = "0";
|
|
676
677
|
break;
|
|
677
678
|
}
|
|
678
679
|
});
|
|
@@ -954,13 +955,13 @@ const pt = class pt extends HTMLElement {
|
|
|
954
955
|
t(this, Ut).call(this);
|
|
955
956
|
}
|
|
956
957
|
disconnectedCallback() {
|
|
957
|
-
this.innerHTML = "",
|
|
958
|
+
this.innerHTML = "", M.log("NineTableSheet destroyed.");
|
|
958
959
|
}
|
|
959
960
|
};
|
|
960
961
|
Ft = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), ct = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(), c(pt, "NineTableSheet"), E(pt, "SCROLLBAR_SIZE", 16);
|
|
961
|
-
let
|
|
962
|
-
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet",
|
|
963
|
-
var Kt,
|
|
962
|
+
let It = pt;
|
|
963
|
+
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", It);
|
|
964
|
+
var Kt, Tt;
|
|
964
965
|
const _e = class _e extends HTMLElement {
|
|
965
966
|
constructor() {
|
|
966
967
|
super();
|
|
@@ -969,17 +970,17 @@ const _e = class _e extends HTMLElement {
|
|
|
969
970
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
970
971
|
var o;
|
|
971
972
|
const r = s.ctrlKey || s.metaKey || s.shiftKey, n = parseInt((o = s.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
|
|
972
|
-
t(this,
|
|
973
|
-
}), t(this,
|
|
973
|
+
t(this, Tt).call(this, n, r);
|
|
974
|
+
}), t(this, Tt).call(this, 0, !1);
|
|
974
975
|
}, "#init"));
|
|
975
|
-
d(this,
|
|
976
|
+
d(this, Tt, /* @__PURE__ */ c((e, s = !1) => {
|
|
976
977
|
const r = /* @__PURE__ */ c(() => {
|
|
977
978
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
978
979
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((u) => u.style.setProperty("display", "none"));
|
|
979
980
|
const b = f.filter((u) => u.classList.contains("active"));
|
|
980
981
|
b.length < 2 || b.forEach((u) => {
|
|
981
|
-
const v = parseInt(u.getAttribute("data-index"), 10),
|
|
982
|
-
|
|
982
|
+
const v = parseInt(u.getAttribute("data-index"), 10), w = this.querySelector(`nine-splitter[data-split-index="${v}"]`), A = f[v + 1];
|
|
983
|
+
w && A && A.classList.contains("active") && w.style.setProperty("display", "flex");
|
|
983
984
|
});
|
|
984
985
|
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = n.querySelectorAll(".nine-tab-item"), h = o.querySelectorAll("nine-table-sheet");
|
|
985
986
|
if (!a[e]) return;
|
|
@@ -1008,32 +1009,32 @@ const _e = class _e extends HTMLElement {
|
|
|
1008
1009
|
t(this, Kt).call(this);
|
|
1009
1010
|
}
|
|
1010
1011
|
};
|
|
1011
|
-
Kt = new WeakMap(),
|
|
1012
|
+
Kt = new WeakMap(), Tt = new WeakMap(), c(_e, "NineTableSheets");
|
|
1012
1013
|
let de = _e;
|
|
1013
1014
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", de);
|
|
1014
|
-
var
|
|
1015
|
+
var H, Zt, kt, Gt;
|
|
1015
1016
|
const Ne = class Ne {
|
|
1016
1017
|
constructor(i) {
|
|
1017
|
-
d(this,
|
|
1018
|
+
d(this, H);
|
|
1018
1019
|
d(this, Zt, /* @__PURE__ */ c(() => {
|
|
1019
1020
|
t(this, Gt).call(this), new ResizeObserver((i) => {
|
|
1020
1021
|
for (let e of i)
|
|
1021
|
-
t(this,
|
|
1022
|
-
}).observe(t(this,
|
|
1022
|
+
t(this, H).getAttribute("auto-height") === "true" && t(this, kt).call(this);
|
|
1023
|
+
}).observe(t(this, H));
|
|
1023
1024
|
}, "#init"));
|
|
1024
|
-
d(this,
|
|
1025
|
+
d(this, kt, /* @__PURE__ */ c(() => {
|
|
1025
1026
|
var h, l;
|
|
1026
|
-
const i = Array.from(t(this,
|
|
1027
|
+
const i = Array.from(t(this, H).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
1027
1028
|
if (i.length === 0) return;
|
|
1028
|
-
const e = parseInt(t(this,
|
|
1029
|
-
t(this,
|
|
1029
|
+
const e = parseInt(t(this, H).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), r = (h = t(this, H).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : h.getBoundingClientRect().height, n = (l = t(this, H).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = It.SCROLLBAR_SIZE, a = e * s + r + n + o;
|
|
1030
|
+
t(this, H).style.height = `${a}px`;
|
|
1030
1031
|
}, "#applyAutoHeight"));
|
|
1031
1032
|
d(this, Gt, /* @__PURE__ */ c(() => {
|
|
1032
|
-
const e = Array.from(t(this,
|
|
1033
|
+
const e = Array.from(t(this, H).children).filter((h) => h.tagName === "TABLE"), s = t(this, H).getAttribute("auto-height") === "true", r = e.length, n = e.map((h, l) => {
|
|
1033
1034
|
const g = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, b = l < r - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
1034
1035
|
return g + b;
|
|
1035
1036
|
}).join(""), o = e.map((h, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
1036
|
-
t(this,
|
|
1037
|
+
t(this, H).shadowRoot.innerHTML = `
|
|
1037
1038
|
<style>
|
|
1038
1039
|
:host {
|
|
1039
1040
|
display: flex;
|
|
@@ -1153,26 +1154,26 @@ const Ne = class Ne {
|
|
|
1153
1154
|
<nine-table-analysis></nine-table-analysis>
|
|
1154
1155
|
</nine-table-body>
|
|
1155
1156
|
<nine-table-footer></nine-table-footer>
|
|
1156
|
-
`, t(this,
|
|
1157
|
-
const a = t(this,
|
|
1157
|
+
`, t(this, H).shadowRoot.querySelector("nine-table-sheets").classList.add("nodata");
|
|
1158
|
+
const a = t(this, H).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1158
1159
|
a == null || a.forEach((h, l) => {
|
|
1159
1160
|
e[l] && setTimeout(() => {
|
|
1160
|
-
h.generate(e[l]), s && t(this,
|
|
1161
|
+
h.generate(e[l]), s && t(this, kt).call(this);
|
|
1161
1162
|
});
|
|
1162
1163
|
});
|
|
1163
1164
|
}, "#render"));
|
|
1164
|
-
y(this,
|
|
1165
|
+
y(this, H, i), t(this, Zt).call(this);
|
|
1165
1166
|
}
|
|
1166
1167
|
};
|
|
1167
|
-
|
|
1168
|
+
H = new WeakMap(), Zt = new WeakMap(), kt = new WeakMap(), Gt = new WeakMap(), c(Ne, "LayoutManager");
|
|
1168
1169
|
let fe = Ne;
|
|
1169
|
-
var
|
|
1170
|
+
var Ct, ht;
|
|
1170
1171
|
const We = class We {
|
|
1171
1172
|
constructor(i) {
|
|
1172
|
-
d(this,
|
|
1173
|
+
d(this, Ct);
|
|
1173
1174
|
d(this, ht, -1);
|
|
1174
|
-
E(this, "count", /* @__PURE__ */ c(() => t(this,
|
|
1175
|
-
y(this,
|
|
1175
|
+
E(this, "count", /* @__PURE__ */ c(() => t(this, Ct).rawRecords.length, "count"));
|
|
1176
|
+
y(this, Ct, i);
|
|
1176
1177
|
}
|
|
1177
1178
|
get at() {
|
|
1178
1179
|
return t(this, ht);
|
|
@@ -1182,9 +1183,9 @@ const We = class We {
|
|
|
1182
1183
|
});
|
|
1183
1184
|
}
|
|
1184
1185
|
};
|
|
1185
|
-
|
|
1186
|
+
Ct = new WeakMap(), ht = new WeakMap(), c(We, "ngRow");
|
|
1186
1187
|
let ue = We;
|
|
1187
|
-
var _, k, N, dt, Jt, Y, Qt, it,
|
|
1188
|
+
var _, k, N, dt, Jt, Y, Qt, it, Lt, te, ee, ft;
|
|
1188
1189
|
const z = class z {
|
|
1189
1190
|
constructor(i, e) {
|
|
1190
1191
|
d(this, _);
|
|
@@ -1200,7 +1201,7 @@ const z = class z {
|
|
|
1200
1201
|
var s;
|
|
1201
1202
|
t(this, Y).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1202
1203
|
}), (t(this, k).rawRecords || []).forEach((e) => {
|
|
1203
|
-
e.__ng || (e.__ng = t(this,
|
|
1204
|
+
e.__ng || (e.__ng = t(this, Lt).call(this)), e.__ng.height = t(this, Y).slice();
|
|
1204
1205
|
});
|
|
1205
1206
|
}, "#initialize"));
|
|
1206
1207
|
d(this, it, /* @__PURE__ */ c(() => {
|
|
@@ -1225,7 +1226,7 @@ const z = class z {
|
|
|
1225
1226
|
E(this, "set", /* @__PURE__ */ c((i) => {
|
|
1226
1227
|
this.clear(), this.add(i, !1), t(this, it).call(this);
|
|
1227
1228
|
}, "set"));
|
|
1228
|
-
d(this,
|
|
1229
|
+
d(this, Lt, /* @__PURE__ */ c(() => ({
|
|
1229
1230
|
rowState: z.ROW_STATE.EMPTY,
|
|
1230
1231
|
deleted: !1,
|
|
1231
1232
|
filtered: !1,
|
|
@@ -1253,7 +1254,7 @@ const z = class z {
|
|
|
1253
1254
|
}), s;
|
|
1254
1255
|
}, "#json2Array"));
|
|
1255
1256
|
d(this, ee, /* @__PURE__ */ c((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1256
|
-
e.__ng = t(this,
|
|
1257
|
+
e.__ng = t(this, Lt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = z.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1257
1258
|
}), i), "#defaultInsert"));
|
|
1258
1259
|
E(this, "add", /* @__PURE__ */ c((i, e = !0) => {
|
|
1259
1260
|
i === void 0 && (i = {});
|
|
@@ -1327,7 +1328,7 @@ const z = class z {
|
|
|
1327
1328
|
return this.length;
|
|
1328
1329
|
}
|
|
1329
1330
|
};
|
|
1330
|
-
_ = new WeakMap(), k = new WeakMap(), N = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), Y = new WeakMap(), Qt = new WeakMap(), it = new WeakMap(),
|
|
1331
|
+
_ = new WeakMap(), k = new WeakMap(), N = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), Y = new WeakMap(), Qt = new WeakMap(), it = new WeakMap(), Lt = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), ft = new WeakMap(), c(z, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1331
1332
|
E(z, "ROW_STATE", {
|
|
1332
1333
|
EMPTY: "EMPTY",
|
|
1333
1334
|
NORMAL: "NORMAL",
|
|
@@ -1359,7 +1360,7 @@ const Oe = class Oe {
|
|
|
1359
1360
|
};
|
|
1360
1361
|
rt = new WeakMap(), c(Oe, "ngDataManager");
|
|
1361
1362
|
let be = Oe;
|
|
1362
|
-
var ut, L,
|
|
1363
|
+
var ut, L, Ht, se;
|
|
1363
1364
|
const ze = class ze {
|
|
1364
1365
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1365
1366
|
constructor(i) {
|
|
@@ -1368,20 +1369,20 @@ const ze = class ze {
|
|
|
1368
1369
|
E(this, "add", /* @__PURE__ */ c((i, e = "string") => {
|
|
1369
1370
|
i.forEach((s) => {
|
|
1370
1371
|
t(this, L).some((r) => r.name === s) || t(this, L).push({ name: s, type: e });
|
|
1371
|
-
}), t(this,
|
|
1372
|
+
}), t(this, Ht).call(this);
|
|
1372
1373
|
}, "add"));
|
|
1373
|
-
d(this,
|
|
1374
|
+
d(this, Ht, /* @__PURE__ */ c(() => {
|
|
1374
1375
|
const i = /* @__PURE__ */ new Map();
|
|
1375
1376
|
t(this, L).forEach((e) => {
|
|
1376
1377
|
i.set(e.name, e.type);
|
|
1377
1378
|
}), y(this, L, Array.from(i, ([e, s]) => ({ name: e, type: s }))), y(this, L, t(this, L).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, L).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
1378
1379
|
}, "#adjust"));
|
|
1379
1380
|
d(this, se, /* @__PURE__ */ c(() => {
|
|
1380
|
-
y(this, L, []),
|
|
1381
|
+
y(this, L, []), M.log(t(this, ut).querySelectorAll("table"));
|
|
1381
1382
|
const i = Array.from(t(this, ut).querySelectorAll("table"));
|
|
1382
1383
|
if (!(!i || i.length === 0)) {
|
|
1383
1384
|
for (const e of i)
|
|
1384
|
-
|
|
1385
|
+
M.log(e), $("[data-bind]", e).each((s, r) => {
|
|
1385
1386
|
const n = r.dataset.bind, o = r.getAttribute("data-type") || "string";
|
|
1386
1387
|
n && t(this, L).push({ name: n, type: o });
|
|
1387
1388
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
@@ -1405,7 +1406,7 @@ const ze = class ze {
|
|
|
1405
1406
|
});
|
|
1406
1407
|
});
|
|
1407
1408
|
});
|
|
1408
|
-
t(this,
|
|
1409
|
+
t(this, Ht).call(this);
|
|
1409
1410
|
}
|
|
1410
1411
|
}, "#init"));
|
|
1411
1412
|
y(this, ut, i), t(this, se).call(this);
|
|
@@ -1430,7 +1431,7 @@ const ze = class ze {
|
|
|
1430
1431
|
return t(this, L).some((e) => e.name === i);
|
|
1431
1432
|
}
|
|
1432
1433
|
};
|
|
1433
|
-
ut = new WeakMap(), L = new WeakMap(),
|
|
1434
|
+
ut = new WeakMap(), L = new WeakMap(), Ht = new WeakMap(), se = new WeakMap(), c(ze, "ngFields");
|
|
1434
1435
|
let ye = ze;
|
|
1435
1436
|
var nt, ie, re;
|
|
1436
1437
|
const Be = class Be extends HTMLElement {
|
|
@@ -1440,7 +1441,7 @@ const Be = class Be extends HTMLElement {
|
|
|
1440
1441
|
d(this, nt);
|
|
1441
1442
|
d(this, ie);
|
|
1442
1443
|
d(this, re, /* @__PURE__ */ c(() => {
|
|
1443
|
-
this.fields = new ye(this), y(this, ie, new fe(this)),
|
|
1444
|
+
this.fields = new ye(this), y(this, ie, new fe(this)), M.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1444
1445
|
}, "#init"));
|
|
1445
1446
|
this.attachShadow({ mode: "open" }), y(this, nt, new be(this));
|
|
1446
1447
|
}
|
|
@@ -1448,7 +1449,7 @@ const Be = class Be extends HTMLElement {
|
|
|
1448
1449
|
t(this, re).call(this);
|
|
1449
1450
|
}
|
|
1450
1451
|
disconnectedCallback() {
|
|
1451
|
-
|
|
1452
|
+
M.log("NineTable disconnected.");
|
|
1452
1453
|
}
|
|
1453
1454
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1454
1455
|
get data() {
|
|
@@ -1479,12 +1480,12 @@ const mt = class mt extends HTMLElement {
|
|
|
1479
1480
|
};
|
|
1480
1481
|
c(mt, "BasicCellElement"), E(mt, "_styleCache", /* @__PURE__ */ new Map()), E(mt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1481
1482
|
let me = mt;
|
|
1482
|
-
var C,
|
|
1483
|
+
var C, Mt, p, qe, Re, Te, ke, Ce;
|
|
1483
1484
|
const De = class De extends me {
|
|
1484
1485
|
constructor() {
|
|
1485
1486
|
super();
|
|
1486
1487
|
d(this, C);
|
|
1487
|
-
d(this,
|
|
1488
|
+
d(this, Mt);
|
|
1488
1489
|
d(this, p);
|
|
1489
1490
|
d(this, qe);
|
|
1490
1491
|
d(this, Re);
|
|
@@ -1534,7 +1535,7 @@ const De = class De extends me {
|
|
|
1534
1535
|
else
|
|
1535
1536
|
n = !0;
|
|
1536
1537
|
n ? ninegrid.j.querySelectorAll(t(this, p)).removeClass("suppress") : ninegrid.j.querySelectorAll(t(this, p)).addClass("suppress"), ninegrid.j.querySelectorAll(t(this, p)).hasClass("hidden") || (n ? ninegrid.j.querySelectorAll(t(this, p)).removeClass("hidden") : ninegrid.j.querySelectorAll(t(this, p)).addClass("hidden"));
|
|
1537
|
-
var v = parseInt(t(this, p).dataset.matrixRow),
|
|
1538
|
+
var v = parseInt(t(this, p).dataset.matrixRow), w = v - 1, A = t(this, C).body.querySelector(`tbody.bindable [data-col="${t(this, p).dataset.col}"][data-matrix-row="${w}"]`);
|
|
1538
1539
|
$(A).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this, p)).hasClass("suppress") ? ninegrid.j.querySelectorAll(A).removeClass("last-none-suppress").addClass("last-suppress") : !$(A).hasClass("suppress") && ninegrid.j.querySelectorAll(t(this, p)).hasClass("suppress") ? ninegrid.j.querySelectorAll(A).removeClass("last-suppress").addClass("last-none-suppress") : ninegrid.j.querySelectorAll(A).removeClass("last-none-suppress").removeClass("last-suppress");
|
|
1539
1540
|
}
|
|
1540
1541
|
}
|
|
@@ -1553,7 +1554,7 @@ const De = class De extends me {
|
|
|
1553
1554
|
}, "getExprValue"));
|
|
1554
1555
|
}
|
|
1555
1556
|
connectedCallback() {
|
|
1556
|
-
super.connectedCallback(), y(this, C, this.getRootNode().host), y(this, p, this.closest("th,td")), y(this,
|
|
1557
|
+
super.connectedCallback(), y(this, C, this.getRootNode().host), y(this, p, this.closest("th,td")), y(this, Mt, t(this, p).closest("tr"));
|
|
1557
1558
|
}
|
|
1558
1559
|
get value() {
|
|
1559
1560
|
var e = !t(this, C) || !t(this, C).dataManager || !t(this, p) || !t(this, p).dataset || !t(this, p).dataset.row || !t(this, p).dataset.bind ? "" : t(this, p).closest("tr").data[t(this, p).dataset.bind];
|
|
@@ -1572,10 +1573,10 @@ const De = class De extends me {
|
|
|
1572
1573
|
}
|
|
1573
1574
|
refresh() {
|
|
1574
1575
|
const e = t(this, p).dataset.bind;
|
|
1575
|
-
return parseInt(t(this, p).dataset.row), t(this,
|
|
1576
|
+
return parseInt(t(this, p).dataset.row), t(this, Mt).data[e];
|
|
1576
1577
|
}
|
|
1577
1578
|
};
|
|
1578
|
-
C = new WeakMap(),
|
|
1579
|
+
C = new WeakMap(), Mt = new WeakMap(), p = new WeakMap(), qe = new WeakMap(), Re = new WeakMap(), Te = new WeakMap(), ke = new WeakMap(), Ce = new WeakMap(), c(De, "CellElement");
|
|
1579
1580
|
let ve = De;
|
|
1580
1581
|
const Pe = class Pe extends ve {
|
|
1581
1582
|
constructor() {
|
|
@@ -1590,11 +1591,11 @@ const Pe = class Pe extends ve {
|
|
|
1590
1591
|
};
|
|
1591
1592
|
c(Pe, "EditableCellElement");
|
|
1592
1593
|
let xe = Pe;
|
|
1593
|
-
var
|
|
1594
|
+
var $t, ot, gt, bt, ne, U, Le;
|
|
1594
1595
|
const je = class je extends xe {
|
|
1595
1596
|
constructor() {
|
|
1596
1597
|
super();
|
|
1597
|
-
d(this,
|
|
1598
|
+
d(this, $t);
|
|
1598
1599
|
d(this, ot);
|
|
1599
1600
|
d(this, gt);
|
|
1600
1601
|
d(this, bt);
|
|
@@ -1602,7 +1603,7 @@ const je = class je extends xe {
|
|
|
1602
1603
|
d(this, U);
|
|
1603
1604
|
E(this, "refresh", /* @__PURE__ */ c(() => {
|
|
1604
1605
|
const e = super.refresh();
|
|
1605
|
-
t(this,
|
|
1606
|
+
t(this, $t).value = e;
|
|
1606
1607
|
}, "refresh"));
|
|
1607
1608
|
/**
|
|
1608
1609
|
dataRefresh = (v) => {
|
|
@@ -1659,10 +1660,10 @@ const je = class je extends xe {
|
|
|
1659
1660
|
${e.join(" ")}
|
|
1660
1661
|
ondragstart="return false;"
|
|
1661
1662
|
>
|
|
1662
|
-
`, super.connectedCallback(), y(this,
|
|
1663
|
+
`, super.connectedCallback(), y(this, $t, this.querySelector("input"));
|
|
1663
1664
|
}
|
|
1664
1665
|
};
|
|
1665
|
-
|
|
1666
|
+
$t = new WeakMap(), ot = new WeakMap(), gt = new WeakMap(), bt = new WeakMap(), ne = new WeakMap(), U = new WeakMap(), Le = new WeakMap(), c(je, "CellInputText");
|
|
1666
1667
|
let we = je;
|
|
1667
1668
|
customElements.get("cell-input-text");
|
|
1668
1669
|
customElements.get("cell-input") || customElements.define("cell-input", we);
|