@ninebone/table 0.0.534 β 0.0.536
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 +80 -80
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +6 -6
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -23,22 +23,22 @@ const He = class He extends Ke.constructor {
|
|
|
23
23
|
h(He, "Trace");
|
|
24
24
|
let ae = He;
|
|
25
25
|
const H = new ae();
|
|
26
|
-
var z, j, w,
|
|
26
|
+
var z, j, w, K, Z, G, _t, J, Nt;
|
|
27
27
|
const Me = class Me extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
d(this, z);
|
|
31
31
|
d(this, j, !1);
|
|
32
32
|
d(this, w);
|
|
33
|
-
d(this, X);
|
|
34
33
|
d(this, K);
|
|
35
34
|
d(this, Z);
|
|
35
|
+
d(this, G);
|
|
36
36
|
d(this, _t, /* @__PURE__ */ h(() => {
|
|
37
37
|
if (!t(this, z)) return;
|
|
38
38
|
const e = t(this, z).querySelector(".ng-container-body .ng-part-body");
|
|
39
|
-
e && (y(this,
|
|
39
|
+
e && (y(this, G, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
|
-
})), t(this,
|
|
41
|
+
})), t(this, G).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
44
44
|
if (!t(this, z) || !t(this, w) || t(this, j)) return;
|
|
@@ -61,7 +61,7 @@ const Me = class Me extends HTMLElement {
|
|
|
61
61
|
const m = c - f;
|
|
62
62
|
b > m && (b = m), n.style.left = `${b}px`, t(this, w).left.disabled = b === 0, t(this, w).right.disabled = b >= m - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
d(this,
|
|
64
|
+
d(this, J, /* @__PURE__ */ h((e) => {
|
|
65
65
|
if (!t(this, w)) return !1;
|
|
66
66
|
const s = t(this, w).container, i = s.querySelector("table");
|
|
67
67
|
if (!i) return !1;
|
|
@@ -75,16 +75,16 @@ const Me = class Me extends HTMLElement {
|
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
76
|
d(this, Nt, /* @__PURE__ */ h(() => {
|
|
77
77
|
const e = /* @__PURE__ */ h((i) => {
|
|
78
|
-
clearInterval(t(this,
|
|
78
|
+
clearInterval(t(this, K)), clearInterval(t(this, Z));
|
|
79
79
|
const n = parseInt(t(this, w).thumb.style.left || 0, 10);
|
|
80
|
-
t(this,
|
|
81
|
-
clearInterval(t(this,
|
|
80
|
+
t(this, J).call(this, n + i), y(this, K, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, K)), y(this, Z, setInterval(() => {
|
|
82
82
|
const a = parseInt(t(this, w).thumb.style.left || 0, 10);
|
|
83
|
-
t(this,
|
|
83
|
+
t(this, J).call(this, a + i) || clearInterval(t(this, Z));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), s = /* @__PURE__ */ h(() => {
|
|
87
|
-
clearInterval(t(this,
|
|
87
|
+
clearInterval(t(this, K)), clearInterval(t(this, Z));
|
|
88
88
|
}, "clearTimer");
|
|
89
89
|
["mouseup", "mouseleave", "touchend"].forEach((i) => {
|
|
90
90
|
t(this, w).left.addEventListener(i, s), t(this, w).right.addEventListener(i, s), t(this, w).track.addEventListener(i, s);
|
|
@@ -96,14 +96,14 @@ const Me = class Me extends HTMLElement {
|
|
|
96
96
|
if (i.button !== 0) return;
|
|
97
97
|
i.preventDefault();
|
|
98
98
|
const n = t(this, w).track.getBoundingClientRect(), a = t(this, w).thumb.clientWidth;
|
|
99
|
-
t(this,
|
|
99
|
+
t(this, J).call(this, i.clientX - n.left - a / 2);
|
|
100
100
|
}), t(this, w).thumb.addEventListener("mousedown", (i) => {
|
|
101
101
|
if (i.button !== 0) return;
|
|
102
102
|
i.stopPropagation(), i.preventDefault(), y(this, j, !0), this.shiftX = i.clientX - t(this, w).thumb.getBoundingClientRect().left;
|
|
103
103
|
const n = /* @__PURE__ */ h((o) => {
|
|
104
104
|
if (!t(this, j)) return;
|
|
105
105
|
const l = t(this, w).track.getBoundingClientRect();
|
|
106
|
-
t(this,
|
|
106
|
+
t(this, J).call(this, o.clientX - l.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), a = /* @__PURE__ */ h(() => {
|
|
108
108
|
y(this, j, !1), s(), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", a), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
@@ -195,19 +195,19 @@ const Me = class Me extends HTMLElement {
|
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
197
197
|
disconnectedCallback() {
|
|
198
|
-
t(this,
|
|
198
|
+
t(this, G) && t(this, G).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
z = new WeakMap(), j = new WeakMap(), w = new WeakMap(),
|
|
201
|
+
z = new WeakMap(), j = new WeakMap(), w = new WeakMap(), K = new WeakMap(), Z = new WeakMap(), G = new WeakMap(), _t = new WeakMap(), J = new WeakMap(), Nt = new WeakMap(), h(Me, "NineTableHScrollBar");
|
|
202
202
|
let le = Me;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", le);
|
|
204
|
-
var F, at,
|
|
204
|
+
var F, at, Q, q, vt, wt, Wt;
|
|
205
205
|
const $e = class $e extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
208
|
d(this, F);
|
|
209
209
|
d(this, at);
|
|
210
|
-
d(this,
|
|
210
|
+
d(this, Q, !1);
|
|
211
211
|
d(this, q);
|
|
212
212
|
d(this, vt, 0);
|
|
213
213
|
d(this, wt, 0);
|
|
@@ -237,12 +237,12 @@ const $e = class $e extends HTMLElement {
|
|
|
237
237
|
return n * a;
|
|
238
238
|
}, "getContentHeight");
|
|
239
239
|
e.addEventListener("scroll", () => {
|
|
240
|
-
t(this,
|
|
240
|
+
t(this, Q) || this.refresh();
|
|
241
241
|
}), t(this, q).thumb.addEventListener("mousedown", (i) => {
|
|
242
242
|
if (i.button !== 0) return;
|
|
243
|
-
i.stopPropagation(), i.preventDefault(), y(this,
|
|
243
|
+
i.stopPropagation(), i.preventDefault(), y(this, Q, !0), y(this, vt, i.clientY), y(this, wt, e.scrollTop);
|
|
244
244
|
const n = /* @__PURE__ */ h((o) => {
|
|
245
|
-
if (!t(this,
|
|
245
|
+
if (!t(this, Q)) return;
|
|
246
246
|
const l = t(this, q).track.getBoundingClientRect(), c = t(this, q).thumb.clientHeight, u = l.height - c, g = o.clientY - t(this, vt), b = e.clientHeight, m = s(), v = Math.max(m - b, 1);
|
|
247
247
|
if (u > 0 && v > 0) {
|
|
248
248
|
const E = g / u * v;
|
|
@@ -252,7 +252,7 @@ const $e = class $e extends HTMLElement {
|
|
|
252
252
|
}
|
|
253
253
|
this.refresh();
|
|
254
254
|
}, "onMouseMove"), a = /* @__PURE__ */ h(() => {
|
|
255
|
-
y(this,
|
|
255
|
+
y(this, Q, !1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", a), this.refresh();
|
|
256
256
|
}, "onMouseUp");
|
|
257
257
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", a);
|
|
258
258
|
}), t(this, q).track.addEventListener("mousedown", (i) => {
|
|
@@ -352,18 +352,18 @@ const $e = class $e extends HTMLElement {
|
|
|
352
352
|
e();
|
|
353
353
|
}
|
|
354
354
|
};
|
|
355
|
-
F = new WeakMap(), at = new WeakMap(),
|
|
355
|
+
F = new WeakMap(), at = new WeakMap(), Q = new WeakMap(), q = new WeakMap(), vt = new WeakMap(), wt = new WeakMap(), Wt = new WeakMap(), h($e, "NineTableVScrollBar");
|
|
356
356
|
let ce = $e;
|
|
357
357
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", ce);
|
|
358
|
-
var P, S,
|
|
358
|
+
var P, S, V, D, I, Y, tt, St, Ee, lt, Ot, Bt, zt, Et, At, Dt, Pt, Rt, Ae, ct, qt, jt;
|
|
359
359
|
const Ie = class Ie {
|
|
360
360
|
constructor(r) {
|
|
361
361
|
d(this, P);
|
|
362
362
|
d(this, S);
|
|
363
|
-
d(this,
|
|
363
|
+
d(this, V);
|
|
364
364
|
d(this, D, /* @__PURE__ */ new Map());
|
|
365
365
|
d(this, I, null);
|
|
366
|
-
d(this,
|
|
366
|
+
d(this, Y, null);
|
|
367
367
|
d(this, tt, 0);
|
|
368
368
|
d(this, St, 40);
|
|
369
369
|
d(this, Ee, !1);
|
|
@@ -375,7 +375,7 @@ const Ie = class Ie {
|
|
|
375
375
|
r && (t(this, Et).call(this), t(this, ct).call(this, r.scrollTop));
|
|
376
376
|
}, "refresh"));
|
|
377
377
|
A(this, "initialize", /* @__PURE__ */ h(() => {
|
|
378
|
-
H.log("rowManager.initialize"), y(this,
|
|
378
|
+
H.log("rowManager.initialize"), y(this, V, {
|
|
379
379
|
scrollTables: t(this, S).querySelectorAll(".ng-part-body table"),
|
|
380
380
|
firstTr: t(this, S).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
381
381
|
}), y(this, I, null), t(this, D).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((a) => {
|
|
@@ -417,7 +417,7 @@ const Ie = class Ie {
|
|
|
417
417
|
s.forEach((l) => {
|
|
418
418
|
a.appendChild(l.cloneNode(!0));
|
|
419
419
|
});
|
|
420
|
-
n ? n.before(a) : i.appendChild(a);
|
|
420
|
+
n ? n.before(a) : i.appendChild(a), e === ".ng-container-body" && (t(this, V).firstTr = i.querySelector("tr:not(.nodata)"));
|
|
421
421
|
}, "#renderRows"));
|
|
422
422
|
d(this, zt, /* @__PURE__ */ h((r) => {
|
|
423
423
|
if (H.log("rowManager.#measureAndCacheHeight"), t(this, I) !== null && t(this, I) > 0)
|
|
@@ -466,8 +466,8 @@ const Ie = class Ie {
|
|
|
466
466
|
((o = b[x]) == null ? void 0 : o.getBoundingClientRect().height) || 0,
|
|
467
467
|
((l = m[x]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
468
468
|
((c = v[x]) == null ? void 0 : c.getBoundingClientRect().height) || 0
|
|
469
|
-
],
|
|
470
|
-
|
|
469
|
+
], T = Math.max(...M);
|
|
470
|
+
T > 0 && (b[x] && (b[x].style.height = `${T}px`), m[x] && (m[x].style.height = `${T}px`), v[x] && (v[x].style.height = `${T}px`));
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
473
|
const i = t(this, S).querySelector(".ng-container-left .ng-part-footer table"), n = t(this, S).querySelector(".ng-container-body .ng-part-footer table"), a = t(this, S).querySelector(".ng-container-right .ng-part-footer table");
|
|
@@ -478,13 +478,13 @@ const Ie = class Ie {
|
|
|
478
478
|
((f = b[x]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
479
479
|
((u = m[x]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
|
|
480
480
|
((g = v[x]) == null ? void 0 : g.getBoundingClientRect().height) || 0
|
|
481
|
-
],
|
|
482
|
-
|
|
481
|
+
], T = Math.max(...M);
|
|
482
|
+
T > 0 && (b[x] && (b[x].style.height = `${T}px`), m[x] && (m[x].style.height = `${T}px`), v[x] && (v[x].style.height = `${T}px`));
|
|
483
483
|
}
|
|
484
484
|
}
|
|
485
485
|
}, "#syncRowHeights"));
|
|
486
486
|
d(this, Pt, /* @__PURE__ */ h(() => {
|
|
487
|
-
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (y(this,
|
|
487
|
+
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (y(this, Y, new ResizeObserver((r) => {
|
|
488
488
|
for (const e of r) {
|
|
489
489
|
const s = e.target;
|
|
490
490
|
if (!s.classList.contains("active")) continue;
|
|
@@ -497,7 +497,7 @@ const Ie = class Ie {
|
|
|
497
497
|
t(this, tt) !== l && (y(this, tt, l), t(this, At).call(this), t(this, I) !== null && (t(this, Rt).call(this), this.refresh()));
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
|
-
})), t(this,
|
|
500
|
+
})), t(this, Y).observe(t(this, S)));
|
|
501
501
|
}, "#initResizeObserver"));
|
|
502
502
|
d(this, Rt, /* @__PURE__ */ h(() => {
|
|
503
503
|
H.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((r) => {
|
|
@@ -529,9 +529,9 @@ const Ie = class Ie {
|
|
|
529
529
|
const e = t(this, I);
|
|
530
530
|
if (!e || e <= 0) return;
|
|
531
531
|
const s = t(this, P).data.length, i = Math.max(0, Math.floor(r / e)), n = i * e, a = ((f = t(this, D).get(".ng-container-body")) == null ? void 0 : f.length) || 1, o = t(this, S).querySelector(".ng-container-body"), l = o == null ? void 0 : o.querySelector(".ng-part-body tbody.bindable-tbody tr:not(.nodata)");
|
|
532
|
-
H.log(t(this,
|
|
532
|
+
H.log(t(this, V).firstTr, t(this, V).firstTr.dataset.row);
|
|
533
533
|
const c = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
|
|
534
|
-
(u = t(this,
|
|
534
|
+
(u = t(this, V)) == null || u.scrollTables.forEach((g) => {
|
|
535
535
|
g.style.transform = `translateY(${n}px)`;
|
|
536
536
|
}), c !== i && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
|
|
537
537
|
const b = t(this, S).querySelector(g);
|
|
@@ -544,8 +544,8 @@ const Ie = class Ie {
|
|
|
544
544
|
E.style.display = "none";
|
|
545
545
|
return;
|
|
546
546
|
}
|
|
547
|
-
const
|
|
548
|
-
E.style.display = "", t(this, qt).call(this, E,
|
|
547
|
+
const T = t(this, P).data.get(M);
|
|
548
|
+
E.style.display = "", t(this, qt).call(this, E, T, M);
|
|
549
549
|
});
|
|
550
550
|
});
|
|
551
551
|
}, "#handleScroll"));
|
|
@@ -586,7 +586,7 @@ const Ie = class Ie {
|
|
|
586
586
|
}
|
|
587
587
|
}, "#syncHeaderHeights"));
|
|
588
588
|
A(this, "destroy", /* @__PURE__ */ h(() => {
|
|
589
|
-
t(this,
|
|
589
|
+
t(this, Y) && (t(this, Y).disconnect(), y(this, Y, null));
|
|
590
590
|
}, "destroy"));
|
|
591
591
|
y(this, P, r.getRootNode().host), y(this, S, r), t(this, Pt).call(this);
|
|
592
592
|
}
|
|
@@ -598,7 +598,7 @@ const Ie = class Ie {
|
|
|
598
598
|
return ((e = t(this, D).get(r)) == null ? void 0 : e.length) || 1;
|
|
599
599
|
}
|
|
600
600
|
};
|
|
601
|
-
P = new WeakMap(), S = new WeakMap(),
|
|
601
|
+
P = new WeakMap(), S = new WeakMap(), V = new WeakMap(), D = new WeakMap(), I = new WeakMap(), Y = new WeakMap(), tt = new WeakMap(), St = new WeakMap(), Ee = new WeakMap(), lt = new WeakMap(), Ot = new WeakMap(), Bt = new WeakMap(), zt = new WeakMap(), Et = new WeakMap(), At = new WeakMap(), Dt = new WeakMap(), Pt = new WeakMap(), Rt = new WeakMap(), Ae = new WeakMap(), ct = new WeakMap(), qt = new WeakMap(), jt = new WeakMap(), h(Ie, "RowManager");
|
|
602
602
|
let he = Ie;
|
|
603
603
|
const Ft = class Ft {
|
|
604
604
|
/**
|
|
@@ -652,9 +652,9 @@ const Ft = class Ft {
|
|
|
652
652
|
E = B;
|
|
653
653
|
break;
|
|
654
654
|
}
|
|
655
|
-
const M = x.rowSpan || 1,
|
|
655
|
+
const M = x.rowSpan || 1, T = x.colSpan || 1;
|
|
656
656
|
for (let B = 0; B < M; B++)
|
|
657
|
-
for (let pt = 0; pt <
|
|
657
|
+
for (let pt = 0; pt < T; pt++)
|
|
658
658
|
v + B < u && E + pt < g && (b[v + B][E + pt] = B === 0 && pt === 0 ? "1" : "0");
|
|
659
659
|
});
|
|
660
660
|
}), c.forEach((m) => {
|
|
@@ -910,7 +910,7 @@ const mt = class mt extends HTMLElement {
|
|
|
910
910
|
Vt = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Yt = new WeakMap(), Ut = new WeakMap(), ht = new WeakMap(), Xt = new WeakMap(), Kt = new WeakMap(), h(mt, "NineTableSheet"), A(mt, "SCROLLBAR_SIZE", 16);
|
|
911
911
|
let It = mt;
|
|
912
912
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", It);
|
|
913
|
-
var Zt,
|
|
913
|
+
var Zt, Tt;
|
|
914
914
|
const _e = class _e extends HTMLElement {
|
|
915
915
|
constructor() {
|
|
916
916
|
super();
|
|
@@ -919,10 +919,10 @@ const _e = class _e extends HTMLElement {
|
|
|
919
919
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
920
920
|
var a;
|
|
921
921
|
const i = s.ctrlKey || s.metaKey || s.shiftKey, n = parseInt((a = s.target.closest(".nine-tab-item")) == null ? void 0 : a.dataset.index, 10);
|
|
922
|
-
t(this,
|
|
923
|
-
}), t(this,
|
|
922
|
+
t(this, Tt).call(this, n, i);
|
|
923
|
+
}), t(this, Tt).call(this, 0, !1);
|
|
924
924
|
}, "#init"));
|
|
925
|
-
d(this,
|
|
925
|
+
d(this, Tt, /* @__PURE__ */ h((e, s = !1) => {
|
|
926
926
|
const i = /* @__PURE__ */ h(() => {
|
|
927
927
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
928
928
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((b) => b.style.setProperty("display", "none"));
|
|
@@ -958,20 +958,20 @@ const _e = class _e extends HTMLElement {
|
|
|
958
958
|
t(this, Zt).call(this);
|
|
959
959
|
}
|
|
960
960
|
};
|
|
961
|
-
Zt = new WeakMap(),
|
|
961
|
+
Zt = new WeakMap(), Tt = new WeakMap(), h(_e, "NineTableSheets");
|
|
962
962
|
let fe = _e;
|
|
963
963
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", fe);
|
|
964
|
-
var _, Gt,
|
|
964
|
+
var _, Gt, kt, Jt;
|
|
965
965
|
const Ne = class Ne {
|
|
966
966
|
constructor(r) {
|
|
967
967
|
d(this, _);
|
|
968
968
|
d(this, Gt, /* @__PURE__ */ h(() => {
|
|
969
969
|
t(this, Jt).call(this), new ResizeObserver((r) => {
|
|
970
970
|
for (let e of r)
|
|
971
|
-
t(this, _).getAttribute("auto-height") === "true" && t(this,
|
|
971
|
+
t(this, _).getAttribute("auto-height") === "true" && t(this, kt).call(this);
|
|
972
972
|
}).observe(t(this, _));
|
|
973
973
|
}, "#init"));
|
|
974
|
-
d(this,
|
|
974
|
+
d(this, kt, /* @__PURE__ */ h(() => {
|
|
975
975
|
var l, c;
|
|
976
976
|
const r = Array.from(t(this, _).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
977
977
|
if (r.length === 0) return;
|
|
@@ -1077,14 +1077,14 @@ const Ne = class Ne {
|
|
|
1077
1077
|
const o = t(this, _).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1078
1078
|
o == null || o.forEach((l, c) => {
|
|
1079
1079
|
e[c] && setTimeout(() => {
|
|
1080
|
-
l.generate(e[c]), s && t(this,
|
|
1080
|
+
l.generate(e[c]), s && t(this, kt).call(this);
|
|
1081
1081
|
});
|
|
1082
1082
|
});
|
|
1083
1083
|
}, "#render"));
|
|
1084
1084
|
y(this, _, r), t(this, Gt).call(this);
|
|
1085
1085
|
}
|
|
1086
1086
|
};
|
|
1087
|
-
_ = new WeakMap(), Gt = new WeakMap(),
|
|
1087
|
+
_ = new WeakMap(), Gt = new WeakMap(), kt = new WeakMap(), Jt = new WeakMap(), h(Ne, "LayoutManager");
|
|
1088
1088
|
let ue = Ne;
|
|
1089
1089
|
var Ct, dt;
|
|
1090
1090
|
const We = class We {
|
|
@@ -1104,23 +1104,23 @@ const We = class We {
|
|
|
1104
1104
|
};
|
|
1105
1105
|
Ct = new WeakMap(), dt = new WeakMap(), h(We, "ngRow");
|
|
1106
1106
|
let ge = We;
|
|
1107
|
-
var N,
|
|
1107
|
+
var N, k, W, ft, Qt, U, te, rt, Lt, ee, se, ut;
|
|
1108
1108
|
const O = class O {
|
|
1109
1109
|
constructor(r, e) {
|
|
1110
1110
|
d(this, N);
|
|
1111
|
-
d(this,
|
|
1111
|
+
d(this, k);
|
|
1112
1112
|
d(this, W, []);
|
|
1113
1113
|
d(this, ft, []);
|
|
1114
1114
|
d(this, Qt, 0);
|
|
1115
|
-
d(this,
|
|
1115
|
+
d(this, U, []);
|
|
1116
1116
|
d(this, te, /* @__PURE__ */ h(() => {
|
|
1117
|
-
y(this,
|
|
1117
|
+
y(this, U, []);
|
|
1118
1118
|
const r = t(this, N).template || [];
|
|
1119
1119
|
Array.from(r).forEach((e) => {
|
|
1120
1120
|
var s;
|
|
1121
|
-
t(this,
|
|
1122
|
-
}), (t(this,
|
|
1123
|
-
e.__ng || (e.__ng = t(this, Lt).call(this)), e.__ng.height = t(this,
|
|
1121
|
+
t(this, U).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1122
|
+
}), (t(this, k).rawRecords || []).forEach((e) => {
|
|
1123
|
+
e.__ng || (e.__ng = t(this, Lt).call(this)), e.__ng.height = t(this, U).slice();
|
|
1124
1124
|
});
|
|
1125
1125
|
}, "#initialize"));
|
|
1126
1126
|
d(this, rt, /* @__PURE__ */ h(() => {
|
|
@@ -1148,17 +1148,17 @@ const O = class O {
|
|
|
1148
1148
|
rowState: O.ROW_STATE.EMPTY,
|
|
1149
1149
|
deleted: !1,
|
|
1150
1150
|
filtered: !1,
|
|
1151
|
-
height: t(this,
|
|
1151
|
+
height: t(this, U).slice(),
|
|
1152
1152
|
o: {},
|
|
1153
1153
|
c: {},
|
|
1154
|
-
_: [0, 0, 0, 0, O.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this,
|
|
1154
|
+
_: [0, 0, 0, 0, O.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, U).slice(), -1, {}, {}]
|
|
1155
1155
|
}), "#getDefaultMeta"));
|
|
1156
1156
|
A(this, "reset", /* @__PURE__ */ h(() => {
|
|
1157
1157
|
y(this, W, []), y(this, ft, []), t(this, rt).call(this);
|
|
1158
1158
|
}, "reset"));
|
|
1159
1159
|
A(this, "clear", /* @__PURE__ */ h(() => {
|
|
1160
1160
|
var r;
|
|
1161
|
-
t(this,
|
|
1161
|
+
t(this, k).rawRecords = [], y(this, W, []), y(this, ft, []), (r = t(this, k).viewRecords) != null && r.reset && t(this, k).viewRecords.reset();
|
|
1162
1162
|
}, "clear"));
|
|
1163
1163
|
d(this, ee, /* @__PURE__ */ h((r) => {
|
|
1164
1164
|
var i;
|
|
@@ -1177,19 +1177,19 @@ const O = class O {
|
|
|
1177
1177
|
A(this, "add", /* @__PURE__ */ h((r, e = !0) => {
|
|
1178
1178
|
r === void 0 && (r = {});
|
|
1179
1179
|
const s = t(this, ee).call(this, r);
|
|
1180
|
-
t(this,
|
|
1180
|
+
t(this, k).rawRecords = t(this, k).rawRecords.concat(t(this, se).call(this, s)), this.resetRecords();
|
|
1181
1181
|
const i = this.count() - 1;
|
|
1182
1182
|
return e || s.forEach((n, a) => {
|
|
1183
|
-
const o = t(this,
|
|
1183
|
+
const o = t(this, k).rawRecords[i - a];
|
|
1184
1184
|
o && (o.__ng.rowState = O.ROW_STATE.EMPTY);
|
|
1185
1185
|
}), t(this, rt).call(this), i;
|
|
1186
1186
|
}, "add"));
|
|
1187
1187
|
A(this, "delete", /* @__PURE__ */ h((r) => {
|
|
1188
1188
|
let e = [];
|
|
1189
|
-
Array.isArray(r) ? e = r : typeof r > "u" ? e = [t(this,
|
|
1189
|
+
Array.isArray(r) ? e = r : typeof r > "u" ? e = [t(this, k).host.row.at] : e = [parseInt(r, 10)], e.sort((s, i) => i - s).forEach((s) => {
|
|
1190
1190
|
if (t(this, W)[s]) {
|
|
1191
1191
|
const i = t(this, W)[s].__ng.rowid;
|
|
1192
|
-
t(this, W)[s].__ng.rowState === O.ROW_STATE.INSERT ? t(this,
|
|
1192
|
+
t(this, W)[s].__ng.rowState === O.ROW_STATE.INSERT ? t(this, k).rawRecords = t(this, k).rawRecords.filter((n) => n.__ng.rowid !== i) : t(this, k).rawRecords.forEach((n) => {
|
|
1193
1193
|
n.__ng.rowid === i && (n.__ng.deleted = !0, n.__ng.rowState = O.ROW_STATE.DELETE);
|
|
1194
1194
|
});
|
|
1195
1195
|
}
|
|
@@ -1206,13 +1206,13 @@ const O = class O {
|
|
|
1206
1206
|
o !== s && a.__ng.rowState !== O.ROW_STATE.INSERT && (a.__ng.o.hasOwnProperty(e) || (a.__ng.o[e] = o), a.__ng.rowState = O.ROW_STATE.UPDATE), a.v[n] = s;
|
|
1207
1207
|
}, "setValue"));
|
|
1208
1208
|
A(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1209
|
-
y(this, ft, t(this,
|
|
1209
|
+
y(this, ft, t(this, k).rawRecords.filter((r) => !r.__ng.deleted)), y(this, W, t(this, k).rawRecords.filter((r) => !r.__ng.deleted && !r.__ng.filtered)), t(this, k).rawRecords.forEach((r, e) => {
|
|
1210
1210
|
r.__ng.rowidx = e;
|
|
1211
1211
|
}), t(this, W).forEach((r, e) => {
|
|
1212
1212
|
r.__ng.i = e;
|
|
1213
1213
|
});
|
|
1214
1214
|
}, "resetRecords"));
|
|
1215
|
-
A(this, "getValidData", /* @__PURE__ */ h(() => (t(this, W).length === 0 && t(this,
|
|
1215
|
+
A(this, "getValidData", /* @__PURE__ */ h(() => (t(this, W).length === 0 && t(this, k).rawRecords.length > 0 && this.resetRecords(), t(this, W)), "getValidData"));
|
|
1216
1216
|
d(this, ut, /* @__PURE__ */ h((r) => {
|
|
1217
1217
|
var a;
|
|
1218
1218
|
if (!r) return r;
|
|
@@ -1225,10 +1225,10 @@ const O = class O {
|
|
|
1225
1225
|
return e ? n[0] : n;
|
|
1226
1226
|
}, "#conv"));
|
|
1227
1227
|
A(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1228
|
-
y(this, N, r), y(this,
|
|
1228
|
+
y(this, N, r), y(this, k, e), t(this, te).call(this);
|
|
1229
1229
|
}
|
|
1230
1230
|
get source() {
|
|
1231
|
-
return t(this, ut).call(this, t(this,
|
|
1231
|
+
return t(this, ut).call(this, t(this, k).rawRecords);
|
|
1232
1232
|
}
|
|
1233
1233
|
set source(r) {
|
|
1234
1234
|
this.clear(), this.add(r, !1);
|
|
@@ -1246,7 +1246,7 @@ const O = class O {
|
|
|
1246
1246
|
return this.length;
|
|
1247
1247
|
}
|
|
1248
1248
|
};
|
|
1249
|
-
N = new WeakMap(),
|
|
1249
|
+
N = new WeakMap(), k = new WeakMap(), W = new WeakMap(), ft = new WeakMap(), Qt = new WeakMap(), U = new WeakMap(), te = new WeakMap(), rt = new WeakMap(), Lt = new WeakMap(), ee = new WeakMap(), se = new WeakMap(), ut = new WeakMap(), h(O, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1250
1250
|
A(O, "ROW_STATE", {
|
|
1251
1251
|
EMPTY: "EMPTY",
|
|
1252
1252
|
NORMAL: "NORMAL",
|
|
@@ -1398,7 +1398,7 @@ const xt = class xt extends HTMLElement {
|
|
|
1398
1398
|
};
|
|
1399
1399
|
h(xt, "BasicCellElement"), A(xt, "_styleCache", /* @__PURE__ */ new Map()), A(xt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1400
1400
|
let xe = xt;
|
|
1401
|
-
var C, Mt, p, Re, qe,
|
|
1401
|
+
var C, Mt, p, Re, qe, Te, ke, Ce;
|
|
1402
1402
|
const De = class De extends xe {
|
|
1403
1403
|
constructor() {
|
|
1404
1404
|
super();
|
|
@@ -1407,8 +1407,8 @@ const De = class De extends xe {
|
|
|
1407
1407
|
d(this, p);
|
|
1408
1408
|
d(this, Re);
|
|
1409
1409
|
d(this, qe);
|
|
1410
|
-
d(this, ke);
|
|
1411
1410
|
d(this, Te);
|
|
1411
|
+
d(this, ke);
|
|
1412
1412
|
A(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1413
1413
|
if (t(this, p))
|
|
1414
1414
|
if (t(this, p).closest("tbody")) {
|
|
@@ -1435,8 +1435,8 @@ const De = class De extends xe {
|
|
|
1435
1435
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1436
1436
|
var s = t(this, p).closest("tr"), i = [];
|
|
1437
1437
|
$("th,td", s).each((x, M) => {
|
|
1438
|
-
var
|
|
1439
|
-
|
|
1438
|
+
var T = ninegrid.j.querySelectorAll(M).attr("suppress");
|
|
1439
|
+
T && M.dataset.row && (T = parseInt(T), !isNaN(T) && T <= e && i.push(T));
|
|
1440
1440
|
}), i.sort();
|
|
1441
1441
|
var n = !1;
|
|
1442
1442
|
if (parseInt(s.sectionRowIndex / t(this, C).template.length) > 0)
|
|
@@ -1494,7 +1494,7 @@ const De = class De extends xe {
|
|
|
1494
1494
|
return parseInt(t(this, p).dataset.row), t(this, Mt).data[e];
|
|
1495
1495
|
}
|
|
1496
1496
|
};
|
|
1497
|
-
C = new WeakMap(), Mt = new WeakMap(), p = new WeakMap(), Re = new WeakMap(), qe = new WeakMap(),
|
|
1497
|
+
C = new WeakMap(), Mt = new WeakMap(), p = new WeakMap(), Re = new WeakMap(), qe = new WeakMap(), Te = new WeakMap(), ke = new WeakMap(), Ce = new WeakMap(), h(De, "CellElement");
|
|
1498
1498
|
let ve = De;
|
|
1499
1499
|
const Pe = class Pe extends ve {
|
|
1500
1500
|
constructor() {
|
|
@@ -1509,7 +1509,7 @@ const Pe = class Pe extends ve {
|
|
|
1509
1509
|
};
|
|
1510
1510
|
h(Pe, "EditableCellElement");
|
|
1511
1511
|
let we = Pe;
|
|
1512
|
-
var $t, ot, bt, yt, oe,
|
|
1512
|
+
var $t, ot, bt, yt, oe, X, Le;
|
|
1513
1513
|
const je = class je extends we {
|
|
1514
1514
|
constructor() {
|
|
1515
1515
|
super();
|
|
@@ -1518,7 +1518,7 @@ const je = class je extends we {
|
|
|
1518
1518
|
d(this, bt);
|
|
1519
1519
|
d(this, yt);
|
|
1520
1520
|
d(this, oe);
|
|
1521
|
-
d(this,
|
|
1521
|
+
d(this, X);
|
|
1522
1522
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
1523
1523
|
const e = super.refresh();
|
|
1524
1524
|
H.log("::", e), t(this, $t).value = e;
|
|
@@ -1557,18 +1557,18 @@ const je = class je extends we {
|
|
|
1557
1557
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1558
1558
|
if (t(this, ot) == "number") {
|
|
1559
1559
|
let n = [];
|
|
1560
|
-
if (t(this,
|
|
1560
|
+
if (t(this, X) && Number(t(this, X)) > 0 && n.push("."), t(this, yt) && Number(t(this, yt)) >= 0 && n.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !n.includes(e.key) && e.preventDefault(), t(this, X) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
|
|
1561
1561
|
var s = e.target.value, i = s.indexOf(".");
|
|
1562
1562
|
if (i >= 0) {
|
|
1563
1563
|
var s = s.substr(i + 1, s.length);
|
|
1564
|
-
s.length >= Number(t(this,
|
|
1564
|
+
s.length >= Number(t(this, X)) && e.preventDefault();
|
|
1565
1565
|
}
|
|
1566
1566
|
}
|
|
1567
1567
|
}
|
|
1568
1568
|
t(this, bt) && ninegrid.getByteLength(e.target.value) >= Number(t(this, bt)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1569
1569
|
}
|
|
1570
1570
|
}, "#onKeyDown"));
|
|
1571
|
-
if (this.applyBaseStyle(), y(this, ot, this.getAttribute("type") || "text"), y(this, bt, this.getAttribute("maxbyte")), y(this, yt, this.getAttribute("min")), y(this, oe, this.getAttribute("max")), y(this,
|
|
1571
|
+
if (this.applyBaseStyle(), y(this, ot, this.getAttribute("type") || "text"), y(this, bt, this.getAttribute("maxbyte")), y(this, yt, this.getAttribute("min")), y(this, oe, this.getAttribute("max")), y(this, X, this.getAttribute("scale")), !["text", "number"].includes(t(this, ot))) throw `invalid type : ${t(this, ot)}`;
|
|
1572
1572
|
}
|
|
1573
1573
|
connectedCallback() {
|
|
1574
1574
|
for (var e = [], s = 0; s < this.attributes.length; s++)
|
|
@@ -1581,7 +1581,7 @@ const je = class je extends we {
|
|
|
1581
1581
|
`, super.connectedCallback(), y(this, $t, this.querySelector("input"));
|
|
1582
1582
|
}
|
|
1583
1583
|
};
|
|
1584
|
-
$t = new WeakMap(), ot = new WeakMap(), bt = new WeakMap(), yt = new WeakMap(), oe = new WeakMap(),
|
|
1584
|
+
$t = new WeakMap(), ot = new WeakMap(), bt = new WeakMap(), yt = new WeakMap(), oe = new WeakMap(), X = new WeakMap(), Le = new WeakMap(), h(je, "CellInputText");
|
|
1585
1585
|
let Se = je;
|
|
1586
1586
|
customElements.get("cell-input-text");
|
|
1587
1587
|
customElements.get("cell-input") || customElements.define("cell-input", Se);
|