@ninebone/table 0.0.692 β 0.0.694
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 +81 -81
- 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 oe = He;
|
|
25
25
|
const R = new oe();
|
|
26
|
-
var z, j, S, X, K,
|
|
26
|
+
var z, j, S, U, X, K, _t, Z, Nt;
|
|
27
27
|
const $e = class $e extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
d(this, z);
|
|
31
31
|
d(this, j, !1);
|
|
32
32
|
d(this, S);
|
|
33
|
+
d(this, U);
|
|
33
34
|
d(this, X);
|
|
34
35
|
d(this, K);
|
|
35
|
-
d(this, Z);
|
|
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, K, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
|
-
})), t(this,
|
|
41
|
+
})), t(this, K).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
44
44
|
if (!t(this, z) || !t(this, S) || t(this, j)) return;
|
|
@@ -61,7 +61,7 @@ const $e = class $e extends HTMLElement {
|
|
|
61
61
|
const v = l - f;
|
|
62
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
|
-
d(this,
|
|
64
|
+
d(this, Z, /* @__PURE__ */ h((e) => {
|
|
65
65
|
if (!t(this, S)) return !1;
|
|
66
66
|
const s = t(this, S).container, i = s.querySelector("table");
|
|
67
67
|
if (!i) return !1;
|
|
@@ -75,16 +75,16 @@ const $e = class $e 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, U)), clearInterval(t(this, X));
|
|
79
79
|
const n = parseInt(t(this, S).thumb.style.left || 0, 10);
|
|
80
|
-
t(this,
|
|
81
|
-
clearInterval(t(this,
|
|
80
|
+
t(this, Z).call(this, n + i), y(this, U, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, U)), y(this, X, setInterval(() => {
|
|
82
82
|
const o = parseInt(t(this, S).thumb.style.left || 0, 10);
|
|
83
|
-
t(this,
|
|
83
|
+
t(this, Z).call(this, o + i) || clearInterval(t(this, X));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), s = /* @__PURE__ */ h(() => {
|
|
87
|
-
clearInterval(t(this,
|
|
87
|
+
clearInterval(t(this, U)), clearInterval(t(this, X));
|
|
88
88
|
}, "clearTimer");
|
|
89
89
|
["mouseup", "mouseleave", "touchend"].forEach((i) => {
|
|
90
90
|
t(this, S).left.addEventListener(i, s), t(this, S).right.addEventListener(i, s), t(this, S).track.addEventListener(i, s);
|
|
@@ -96,14 +96,14 @@ const $e = class $e extends HTMLElement {
|
|
|
96
96
|
if (i.button !== 0) return;
|
|
97
97
|
i.preventDefault();
|
|
98
98
|
const n = t(this, S).track.getBoundingClientRect(), o = t(this, S).thumb.clientWidth;
|
|
99
|
-
t(this,
|
|
99
|
+
t(this, Z).call(this, i.clientX - n.left - o / 2);
|
|
100
100
|
}), t(this, S).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, S).thumb.getBoundingClientRect().left;
|
|
103
103
|
const n = /* @__PURE__ */ h((a) => {
|
|
104
104
|
if (!t(this, j)) return;
|
|
105
105
|
const c = t(this, S).track.getBoundingClientRect();
|
|
106
|
-
t(this,
|
|
106
|
+
t(this, Z).call(this, a.clientX - c.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
108
108
|
y(this, j, !1), s(), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
@@ -195,25 +195,25 @@ const $e = class $e extends HTMLElement {
|
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
197
197
|
disconnectedCallback() {
|
|
198
|
-
t(this,
|
|
198
|
+
t(this, K) && t(this, K).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
z = new WeakMap(), j = new WeakMap(), S = new WeakMap(),
|
|
201
|
+
z = new WeakMap(), j = new WeakMap(), S = new WeakMap(), U = new WeakMap(), X = new WeakMap(), K = new WeakMap(), _t = new WeakMap(), Z = new WeakMap(), Nt = new WeakMap(), h($e, "NineTableHScrollBar");
|
|
202
202
|
let ae = $e;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ae);
|
|
204
|
-
var
|
|
204
|
+
var G, J, at, k, vt, xt, Wt;
|
|
205
205
|
const Me = class Me extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
-
d(this,
|
|
209
|
-
d(this,
|
|
208
|
+
d(this, G);
|
|
209
|
+
d(this, J);
|
|
210
210
|
d(this, at, !1);
|
|
211
211
|
d(this, k);
|
|
212
212
|
d(this, vt, 0);
|
|
213
213
|
d(this, xt, 0);
|
|
214
214
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
|
-
if (R.log("vscrollbar.refresh"), !t(this,
|
|
216
|
-
const e = t(this, k).container, s = t(this, k).track, i = t(this, k).thumb, n = e.clientHeight, o = t(this,
|
|
215
|
+
if (R.log("vscrollbar.refresh"), !t(this, G) || !t(this, k)) return;
|
|
216
|
+
const e = t(this, k).container, s = t(this, k).track, i = t(this, k).thumb, n = e.clientHeight, o = t(this, G).data.length, a = t(this, J).getRowHeight(), c = o * a;
|
|
217
217
|
if (c <= n || o === 0) {
|
|
218
218
|
this.style.display = "none";
|
|
219
219
|
return;
|
|
@@ -233,7 +233,7 @@ const Me = class Me extends HTMLElement {
|
|
|
233
233
|
d(this, Wt, /* @__PURE__ */ h(() => {
|
|
234
234
|
R.log("nine-table-vscrollbar.#init");
|
|
235
235
|
const e = t(this, k).container, s = /* @__PURE__ */ h(() => {
|
|
236
|
-
const n = (t(this,
|
|
236
|
+
const n = (t(this, G).data.get() || []).length, o = t(this, J).getRowHeight();
|
|
237
237
|
return n * o;
|
|
238
238
|
}, "getContentHeight");
|
|
239
239
|
t(this, k).thumb.addEventListener("mousedown", (i) => {
|
|
@@ -269,7 +269,7 @@ const Me = class Me extends HTMLElement {
|
|
|
269
269
|
}, "#init"));
|
|
270
270
|
}
|
|
271
271
|
connectedCallback() {
|
|
272
|
-
y(this,
|
|
272
|
+
y(this, G, this.getRootNode().host), y(this, J, this.closest("nine-table-sheet")), this.innerHTML = `
|
|
273
273
|
<style>
|
|
274
274
|
nine-table-vscrollbar {
|
|
275
275
|
display: flex;
|
|
@@ -334,7 +334,7 @@ const Me = class Me extends HTMLElement {
|
|
|
334
334
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
335
335
|
`;
|
|
336
336
|
const e = /* @__PURE__ */ h(() => {
|
|
337
|
-
const s = t(this,
|
|
337
|
+
const s = t(this, J).querySelector(".ng-container-body .ng-part-body");
|
|
338
338
|
if (!s) {
|
|
339
339
|
setTimeout(e, 10);
|
|
340
340
|
return;
|
|
@@ -350,19 +350,19 @@ const Me = class Me extends HTMLElement {
|
|
|
350
350
|
e();
|
|
351
351
|
}
|
|
352
352
|
};
|
|
353
|
-
|
|
353
|
+
G = new WeakMap(), J = new WeakMap(), at = new WeakMap(), k = new WeakMap(), vt = new WeakMap(), xt = new WeakMap(), Wt = new WeakMap(), h(Me, "NineTableVScrollBar");
|
|
354
354
|
let le = Me;
|
|
355
355
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", le);
|
|
356
|
-
var P, x,
|
|
356
|
+
var P, x, Q, D, I, F, tt, wt, Se, Ee, Ot, Bt, St, Et, At, zt, Dt, qt, Ae, lt, Rt, Pt;
|
|
357
357
|
const Ie = class Ie {
|
|
358
358
|
constructor(r) {
|
|
359
359
|
d(this, P);
|
|
360
360
|
d(this, x);
|
|
361
|
-
d(this,
|
|
361
|
+
d(this, Q);
|
|
362
362
|
d(this, D, /* @__PURE__ */ new Map());
|
|
363
363
|
d(this, I, null);
|
|
364
|
-
d(this,
|
|
365
|
-
d(this,
|
|
364
|
+
d(this, F, null);
|
|
365
|
+
d(this, tt, 0);
|
|
366
366
|
d(this, wt, 40);
|
|
367
367
|
d(this, Se, !1);
|
|
368
368
|
d(this, Ee, !1);
|
|
@@ -375,7 +375,7 @@ const Ie = class Ie {
|
|
|
375
375
|
r && (t(this, St).call(this), t(this, Et).call(this), t(this, lt).call(this, r.scrollTop), (e = t(this, x).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
376
376
|
}, "refresh"));
|
|
377
377
|
E(this, "initialize", /* @__PURE__ */ h(() => {
|
|
378
|
-
R.log("rowManager.initialize"), y(this,
|
|
378
|
+
R.log("rowManager.initialize"), y(this, Q, {
|
|
379
379
|
scrollTables: t(this, x).querySelectorAll(".ng-part-body table"),
|
|
380
380
|
firstTr: t(this, x).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((o) => {
|
|
@@ -418,7 +418,7 @@ const Ie = class Ie {
|
|
|
418
418
|
s.forEach((c) => {
|
|
419
419
|
o.appendChild(c.cloneNode(!0));
|
|
420
420
|
});
|
|
421
|
-
n ? n.before(o) : i.appendChild(o), e === ".ng-container-body" && (t(this,
|
|
421
|
+
n ? n.before(o) : i.appendChild(o), e === ".ng-container-body" && (t(this, Q).firstTr = i.querySelector("tr:not(.nodata)"));
|
|
422
422
|
}, "#renderRows"));
|
|
423
423
|
d(this, St, /* @__PURE__ */ h(() => {
|
|
424
424
|
if (t(this, I) !== null && t(this, I) > 0)
|
|
@@ -458,8 +458,8 @@ const Ie = class Ie {
|
|
|
458
458
|
});
|
|
459
459
|
}, "#updateVirtualScrollHeight"));
|
|
460
460
|
d(this, At, /* @__PURE__ */ h(() => {
|
|
461
|
-
if (t(this,
|
|
462
|
-
const r = Math.ceil(t(this,
|
|
461
|
+
if (t(this, tt) > 0 && t(this, I) > 0) {
|
|
462
|
+
const r = Math.ceil(t(this, tt) / t(this, I));
|
|
463
463
|
y(this, wt, r + t(this, Ot));
|
|
464
464
|
}
|
|
465
465
|
}, "#updateRowCount"));
|
|
@@ -491,7 +491,7 @@ const Ie = class Ie {
|
|
|
491
491
|
}
|
|
492
492
|
}, "#syncRowHeights"));
|
|
493
493
|
d(this, Dt, /* @__PURE__ */ h(() => {
|
|
494
|
-
!t(this, x) || !(t(this, x) instanceof HTMLElement) || (y(this,
|
|
494
|
+
!t(this, x) || !(t(this, x) instanceof HTMLElement) || (y(this, F, new ResizeObserver((r) => {
|
|
495
495
|
for (const e of r) {
|
|
496
496
|
const s = e.target;
|
|
497
497
|
if (!s.classList.contains("active")) continue;
|
|
@@ -501,10 +501,10 @@ const Ie = class Ie {
|
|
|
501
501
|
const o = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
|
|
502
502
|
o && (n += o.offsetHeight), a && (n += a.offsetHeight);
|
|
503
503
|
const c = Math.max(i - n, 100);
|
|
504
|
-
t(this,
|
|
504
|
+
t(this, tt) !== c && (y(this, tt, c), t(this, At).call(this), t(this, I) !== null && (t(this, qt).call(this), this.refresh()));
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
|
-
})), t(this,
|
|
507
|
+
})), t(this, F).observe(t(this, x)));
|
|
508
508
|
}, "#initResizeObserver"));
|
|
509
509
|
d(this, qt, /* @__PURE__ */ h(() => {
|
|
510
510
|
R.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((r) => {
|
|
@@ -542,8 +542,8 @@ const Ie = class Ie {
|
|
|
542
542
|
const o = Math.max(0, s - Math.floor(n.clientHeight / e)), a = Math.min(o, Math.max(0, Math.floor(r / e)));
|
|
543
543
|
let c = Math.floor(a * e);
|
|
544
544
|
R.log(`π [Scroll Calc] maxStartIndex: ${o}, startIndex: ${a}, offsetY: ${c}`), a === o && R.log(`π [Scroll Inspect] scrollTop: ${r}, rowHeight: ${e}, maxStartIndex: ${o}, startIndex: ${a}, offsetY: ${c}`);
|
|
545
|
-
const l = t(this,
|
|
546
|
-
(b = t(this,
|
|
545
|
+
const l = t(this, Q).firstTr, f = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
|
|
546
|
+
(b = t(this, Q)) == null || b.scrollTables.forEach((u) => {
|
|
547
547
|
u.style.transform = `translate3d(0, ${c}px, 0)`;
|
|
548
548
|
}), f !== a && (R.log(`π [Row Bind Trigger] currentStartIndex(${f}) !== startIndex(${a})`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((u) => {
|
|
549
549
|
const v = t(this, x).querySelector(u);
|
|
@@ -598,7 +598,7 @@ const Ie = class Ie {
|
|
|
598
598
|
}
|
|
599
599
|
}, "#syncHeaderHeights"));
|
|
600
600
|
E(this, "destroy", /* @__PURE__ */ h(() => {
|
|
601
|
-
t(this,
|
|
601
|
+
t(this, F) && (t(this, F).disconnect(), y(this, F, null));
|
|
602
602
|
}, "destroy"));
|
|
603
603
|
y(this, P, r.getRootNode().host), y(this, x, r), t(this, Dt).call(this);
|
|
604
604
|
}
|
|
@@ -610,7 +610,7 @@ const Ie = class Ie {
|
|
|
610
610
|
return ((e = t(this, D).get(r)) == null ? void 0 : e.length) || 1;
|
|
611
611
|
}
|
|
612
612
|
};
|
|
613
|
-
P = new WeakMap(), x = new WeakMap(),
|
|
613
|
+
P = new WeakMap(), x = new WeakMap(), Q = new WeakMap(), D = new WeakMap(), I = new WeakMap(), F = new WeakMap(), tt = new WeakMap(), wt = new WeakMap(), Se = new WeakMap(), Ee = new WeakMap(), Ot = new WeakMap(), Bt = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), At = new WeakMap(), zt = new WeakMap(), Dt = new WeakMap(), qt = new WeakMap(), Ae = new WeakMap(), lt = new WeakMap(), Rt = new WeakMap(), Pt = new WeakMap(), h(Ie, "RowManager");
|
|
614
614
|
let ce = Ie;
|
|
615
615
|
const jt = class jt {
|
|
616
616
|
/**
|
|
@@ -691,21 +691,21 @@ const jt = class jt {
|
|
|
691
691
|
};
|
|
692
692
|
h(jt, "TableCompiler");
|
|
693
693
|
let he = jt;
|
|
694
|
-
var Ft,
|
|
694
|
+
var Ft, et, st, Vt, Yt, ct, Ut, Xt;
|
|
695
695
|
const pt = class pt extends HTMLElement {
|
|
696
696
|
constructor() {
|
|
697
697
|
super();
|
|
698
698
|
d(this, Ft);
|
|
699
|
-
d(this,
|
|
700
|
-
d(this,
|
|
699
|
+
d(this, et, null);
|
|
700
|
+
d(this, st);
|
|
701
701
|
E(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
702
|
-
R.log("sheet.invalidate()"), t(this,
|
|
702
|
+
R.log("sheet.invalidate()"), t(this, st).refresh();
|
|
703
703
|
}, "invalidate"));
|
|
704
704
|
E(this, "generate", /* @__PURE__ */ h((e) => {
|
|
705
705
|
if (R.log("sheet.generate()"), !e) return;
|
|
706
|
-
y(this,
|
|
706
|
+
y(this, et, he.compile(e)), t(this, Vt).call(this), t(this, Yt).call(this);
|
|
707
707
|
const s = this.querySelector(".ng-container-body .ng-part-header"), i = this.querySelector(".ng-container-body .ng-part-footer"), n = this.querySelector(".ng-nodata-overlay");
|
|
708
|
-
s && n && (n.style.top = `${s.offsetHeight}px`), i && n && (n.style.bottom = `${i.offsetHeight}px`), t(this,
|
|
708
|
+
s && n && (n.style.top = `${s.offsetHeight}px`), i && n && (n.style.bottom = `${i.offsetHeight}px`), t(this, st).initialize(), setTimeout(() => {
|
|
709
709
|
var o;
|
|
710
710
|
(o = this.querySelector("nine-table-hscrollbar")) == null || o.refresh();
|
|
711
711
|
}, 0);
|
|
@@ -717,7 +717,7 @@ const pt = class pt extends HTMLElement {
|
|
|
717
717
|
{ selector: ".ng-container-right", type: "right" }
|
|
718
718
|
].forEach(({ selector: s, type: i }) => {
|
|
719
719
|
var n, o, a;
|
|
720
|
-
(n = this.querySelector(`${s} .ng-part-header`)) == null || n.appendChild(t(this, ct).call(this, t(this,
|
|
720
|
+
(n = this.querySelector(`${s} .ng-part-header`)) == null || n.appendChild(t(this, ct).call(this, t(this, et), i, "header")), (o = this.querySelector(`${s} .ng-virtual-spacer`)) == null || o.before(t(this, ct).call(this, t(this, et), i, "body")), (a = this.querySelector(`${s} .ng-part-footer`)) == null || a.appendChild(t(this, ct).call(this, t(this, et), i, "footer"));
|
|
721
721
|
});
|
|
722
722
|
}, "#renderSplitContainers"));
|
|
723
723
|
d(this, Yt, /* @__PURE__ */ h(() => {
|
|
@@ -747,7 +747,7 @@ const pt = class pt extends HTMLElement {
|
|
|
747
747
|
l.remove();
|
|
748
748
|
}), n;
|
|
749
749
|
}, "#createSplitTable"));
|
|
750
|
-
E(this, "getRowHeight", /* @__PURE__ */ h(() => t(this,
|
|
750
|
+
E(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, st).getRowHeight(), "getRowHeight"));
|
|
751
751
|
E(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
752
752
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
753
753
|
s && (s.scrollLeft = e);
|
|
@@ -950,7 +950,7 @@ const pt = class pt extends HTMLElement {
|
|
|
950
950
|
</div>
|
|
951
951
|
`;
|
|
952
952
|
}, "#render"));
|
|
953
|
-
y(this,
|
|
953
|
+
y(this, st, new ce(this)), y(this, Ft, this.getRootNode().host);
|
|
954
954
|
}
|
|
955
955
|
connectedCallback() {
|
|
956
956
|
t(this, Ut).call(this);
|
|
@@ -959,7 +959,7 @@ const pt = class pt extends HTMLElement {
|
|
|
959
959
|
this.innerHTML = "", R.log("NineTableSheet destroyed.");
|
|
960
960
|
}
|
|
961
961
|
};
|
|
962
|
-
Ft = new WeakMap(),
|
|
962
|
+
Ft = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), ct = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(), h(pt, "NineTableSheet"), E(pt, "SCROLLBAR_SIZE", 16);
|
|
963
963
|
let It = pt;
|
|
964
964
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", It);
|
|
965
965
|
var Kt, Tt;
|
|
@@ -1186,7 +1186,7 @@ const We = class We {
|
|
|
1186
1186
|
};
|
|
1187
1187
|
Ct = new WeakMap(), ht = new WeakMap(), h(We, "ngRow");
|
|
1188
1188
|
let ge = We;
|
|
1189
|
-
var _, C, N, dt, Jt,
|
|
1189
|
+
var _, C, N, dt, Jt, V, Qt, rt, Lt, te, ee, ft;
|
|
1190
1190
|
const B = class B {
|
|
1191
1191
|
constructor(r, e) {
|
|
1192
1192
|
d(this, _);
|
|
@@ -1194,18 +1194,18 @@ const B = class B {
|
|
|
1194
1194
|
d(this, N, []);
|
|
1195
1195
|
d(this, dt, []);
|
|
1196
1196
|
d(this, Jt, 0);
|
|
1197
|
-
d(this,
|
|
1197
|
+
d(this, V, []);
|
|
1198
1198
|
d(this, Qt, /* @__PURE__ */ h(() => {
|
|
1199
|
-
y(this,
|
|
1199
|
+
y(this, V, []);
|
|
1200
1200
|
const r = t(this, _).template || [];
|
|
1201
1201
|
Array.from(r).forEach((e) => {
|
|
1202
1202
|
var s;
|
|
1203
|
-
t(this,
|
|
1203
|
+
t(this, V).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1204
1204
|
}), (t(this, C).rawRecords || []).forEach((e) => {
|
|
1205
|
-
e.__ng || (e.__ng = t(this, Lt).call(this)), e.__ng.height = t(this,
|
|
1205
|
+
e.__ng || (e.__ng = t(this, Lt).call(this)), e.__ng.height = t(this, V).slice();
|
|
1206
1206
|
});
|
|
1207
1207
|
}, "#initialize"));
|
|
1208
|
-
d(this,
|
|
1208
|
+
d(this, rt, /* @__PURE__ */ h(() => {
|
|
1209
1209
|
const r = t(this, _).shadowRoot.querySelector("nine-table-sheets");
|
|
1210
1210
|
r == null || r.classList.toggle("nodata", this.length === 0), t(this, _).shadowRoot.querySelectorAll("nine-table-sheet").forEach((e) => {
|
|
1211
1211
|
e.invalidate();
|
|
@@ -1225,19 +1225,19 @@ const B = class B {
|
|
|
1225
1225
|
return t(this, ft).call(this, s[r]);
|
|
1226
1226
|
}, "get"));
|
|
1227
1227
|
E(this, "set", /* @__PURE__ */ h((r) => {
|
|
1228
|
-
this.clear(), this.add(r, !1), t(this,
|
|
1228
|
+
this.clear(), this.add(r, !1), t(this, rt).call(this);
|
|
1229
1229
|
}, "set"));
|
|
1230
1230
|
d(this, Lt, /* @__PURE__ */ h(() => ({
|
|
1231
1231
|
rowState: B.ROW_STATE.EMPTY,
|
|
1232
1232
|
deleted: !1,
|
|
1233
1233
|
filtered: !1,
|
|
1234
|
-
height: t(this,
|
|
1234
|
+
height: t(this, V).slice(),
|
|
1235
1235
|
o: {},
|
|
1236
1236
|
c: {},
|
|
1237
|
-
_: [0, 0, 0, 0, B.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this,
|
|
1237
|
+
_: [0, 0, 0, 0, B.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, V).slice(), -1, {}, {}]
|
|
1238
1238
|
}), "#getDefaultMeta"));
|
|
1239
1239
|
E(this, "reset", /* @__PURE__ */ h(() => {
|
|
1240
|
-
y(this, N, []), y(this, dt, []), t(this,
|
|
1240
|
+
y(this, N, []), y(this, dt, []), t(this, rt).call(this);
|
|
1241
1241
|
}, "reset"));
|
|
1242
1242
|
E(this, "clear", /* @__PURE__ */ h(() => {
|
|
1243
1243
|
var r;
|
|
@@ -1265,7 +1265,7 @@ const B = class B {
|
|
|
1265
1265
|
return e || s.forEach((n, o) => {
|
|
1266
1266
|
const a = t(this, C).rawRecords[i - o];
|
|
1267
1267
|
a && (a.__ng.rowState = B.ROW_STATE.EMPTY);
|
|
1268
|
-
}), t(this,
|
|
1268
|
+
}), t(this, rt).call(this), i;
|
|
1269
1269
|
}, "add"));
|
|
1270
1270
|
E(this, "delete", /* @__PURE__ */ h((r) => {
|
|
1271
1271
|
let e = [];
|
|
@@ -1276,7 +1276,7 @@ const B = class B {
|
|
|
1276
1276
|
n.__ng.rowid === i && (n.__ng.deleted = !0, n.__ng.rowState = B.ROW_STATE.DELETE);
|
|
1277
1277
|
});
|
|
1278
1278
|
}
|
|
1279
|
-
}), this.resetRecords(), t(this,
|
|
1279
|
+
}), this.resetRecords(), t(this, rt).call(this);
|
|
1280
1280
|
}, "delete"));
|
|
1281
1281
|
E(this, "setValue", /* @__PURE__ */ h((r, e, s) => {
|
|
1282
1282
|
var c;
|
|
@@ -1329,7 +1329,7 @@ const B = class B {
|
|
|
1329
1329
|
return this.length;
|
|
1330
1330
|
}
|
|
1331
1331
|
};
|
|
1332
|
-
_ = new WeakMap(), C = new WeakMap(), N = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(),
|
|
1332
|
+
_ = new WeakMap(), C = new WeakMap(), N = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), V = new WeakMap(), Qt = new WeakMap(), rt = new WeakMap(), Lt = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), ft = new WeakMap(), h(B, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1333
1333
|
E(B, "ROW_STATE", {
|
|
1334
1334
|
EMPTY: "EMPTY",
|
|
1335
1335
|
NORMAL: "NORMAL",
|
|
@@ -1338,13 +1338,13 @@ E(B, "ROW_STATE", {
|
|
|
1338
1338
|
DELETE: "DELETE"
|
|
1339
1339
|
});
|
|
1340
1340
|
let ue = B;
|
|
1341
|
-
var
|
|
1341
|
+
var it;
|
|
1342
1342
|
const Oe = class Oe {
|
|
1343
1343
|
constructor(r) {
|
|
1344
|
-
d(this,
|
|
1345
|
-
y(this,
|
|
1344
|
+
d(this, it);
|
|
1345
|
+
y(this, it, r), this.row = new ge(this), this.data = new ue(t(this, it), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1346
1346
|
var e;
|
|
1347
|
-
(e = t(this,
|
|
1347
|
+
(e = t(this, it).view) != null && e.redraw && t(this, it).view.redraw();
|
|
1348
1348
|
}, this.setDataSource = (e) => {
|
|
1349
1349
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1350
1350
|
}, this.getRowState = (e) => {
|
|
@@ -1359,7 +1359,7 @@ const Oe = class Oe {
|
|
|
1359
1359
|
}, this.setDataSource([]);
|
|
1360
1360
|
}
|
|
1361
1361
|
};
|
|
1362
|
-
|
|
1362
|
+
it = new WeakMap(), h(Oe, "ngDataManager");
|
|
1363
1363
|
let be = Oe;
|
|
1364
1364
|
var gt, H, Ht, se;
|
|
1365
1365
|
const Be = class Be {
|
|
@@ -1434,17 +1434,17 @@ const Be = class Be {
|
|
|
1434
1434
|
};
|
|
1435
1435
|
gt = new WeakMap(), H = new WeakMap(), Ht = new WeakMap(), se = new WeakMap(), h(Be, "ngFields");
|
|
1436
1436
|
let ye = Be;
|
|
1437
|
-
var
|
|
1437
|
+
var nt, re, ie;
|
|
1438
1438
|
const ze = class ze extends HTMLElement {
|
|
1439
1439
|
constructor() {
|
|
1440
1440
|
super();
|
|
1441
1441
|
//#created = false;
|
|
1442
|
-
d(this,
|
|
1442
|
+
d(this, nt);
|
|
1443
1443
|
d(this, re);
|
|
1444
1444
|
d(this, ie, /* @__PURE__ */ h(() => {
|
|
1445
1445
|
this.fields = new ye(this), y(this, re, new fe(this)), R.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1446
1446
|
}, "#init"));
|
|
1447
|
-
this.attachShadow({ mode: "open" }), y(this,
|
|
1447
|
+
this.attachShadow({ mode: "open" }), y(this, nt, new be(this));
|
|
1448
1448
|
}
|
|
1449
1449
|
connectedCallback() {
|
|
1450
1450
|
t(this, ie).call(this);
|
|
@@ -1454,18 +1454,18 @@ const ze = class ze extends HTMLElement {
|
|
|
1454
1454
|
}
|
|
1455
1455
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1456
1456
|
get data() {
|
|
1457
|
-
return t(this,
|
|
1457
|
+
return t(this, nt).data;
|
|
1458
1458
|
}
|
|
1459
1459
|
// π― ν(row) κ΄λ ¨ μ μ΄ μ κ·Όμ μ€ν
|
|
1460
1460
|
get row() {
|
|
1461
|
-
return t(this,
|
|
1461
|
+
return t(this, nt).row;
|
|
1462
1462
|
}
|
|
1463
1463
|
// π― μ 체 λ°μ΄ν° λ§€λμ μ κ·Ό νμν κ²½μ°
|
|
1464
1464
|
get dataManager() {
|
|
1465
|
-
return t(this,
|
|
1465
|
+
return t(this, nt);
|
|
1466
1466
|
}
|
|
1467
1467
|
};
|
|
1468
|
-
|
|
1468
|
+
nt = new WeakMap(), re = new WeakMap(), ie = new WeakMap(), h(ze, "NineTable");
|
|
1469
1469
|
let pe = ze;
|
|
1470
1470
|
customElements.get("nine-table") || customElements.define("nine-table", pe);
|
|
1471
1471
|
const mt = class mt extends HTMLElement {
|
|
@@ -1592,16 +1592,16 @@ const Pe = class Pe extends ve {
|
|
|
1592
1592
|
};
|
|
1593
1593
|
h(Pe, "EditableCellElement");
|
|
1594
1594
|
let xe = Pe;
|
|
1595
|
-
var Mt,
|
|
1595
|
+
var Mt, ot, ut, bt, ne, Y, Le;
|
|
1596
1596
|
const je = class je extends xe {
|
|
1597
1597
|
constructor() {
|
|
1598
1598
|
super();
|
|
1599
1599
|
d(this, Mt);
|
|
1600
|
-
d(this,
|
|
1600
|
+
d(this, ot);
|
|
1601
1601
|
d(this, ut);
|
|
1602
1602
|
d(this, bt);
|
|
1603
1603
|
d(this, ne);
|
|
1604
|
-
d(this,
|
|
1604
|
+
d(this, Y);
|
|
1605
1605
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
1606
1606
|
const e = super.refresh();
|
|
1607
1607
|
t(this, Mt).value = e;
|
|
@@ -1638,20 +1638,20 @@ const je = class je extends xe {
|
|
|
1638
1638
|
*/
|
|
1639
1639
|
d(this, Le, /* @__PURE__ */ h((e) => {
|
|
1640
1640
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1641
|
-
if (t(this,
|
|
1641
|
+
if (t(this, ot) == "number") {
|
|
1642
1642
|
let n = [];
|
|
1643
|
-
if (t(this,
|
|
1643
|
+
if (t(this, Y) && Number(t(this, Y)) > 0 && n.push("."), t(this, bt) && Number(t(this, bt)) >= 0 && n.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !n.includes(e.key) && e.preventDefault(), t(this, Y) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
|
|
1644
1644
|
var s = e.target.value, i = s.indexOf(".");
|
|
1645
1645
|
if (i >= 0) {
|
|
1646
1646
|
var s = s.substr(i + 1, s.length);
|
|
1647
|
-
s.length >= Number(t(this,
|
|
1647
|
+
s.length >= Number(t(this, Y)) && e.preventDefault();
|
|
1648
1648
|
}
|
|
1649
1649
|
}
|
|
1650
1650
|
}
|
|
1651
1651
|
t(this, ut) && ninegrid.getByteLength(e.target.value) >= Number(t(this, ut)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1652
1652
|
}
|
|
1653
1653
|
}, "#onKeyDown"));
|
|
1654
|
-
if (this.applyBaseStyle(), y(this,
|
|
1654
|
+
if (this.applyBaseStyle(), y(this, ot, this.getAttribute("type") || "text"), y(this, ut, this.getAttribute("maxbyte")), y(this, bt, this.getAttribute("min")), y(this, ne, this.getAttribute("max")), y(this, Y, this.getAttribute("scale")), !["text", "number"].includes(t(this, ot))) throw `invalid type : ${t(this, ot)}`;
|
|
1655
1655
|
}
|
|
1656
1656
|
connectedCallback() {
|
|
1657
1657
|
for (var e = [], s = 0; s < this.attributes.length; s++)
|
|
@@ -1664,7 +1664,7 @@ const je = class je extends xe {
|
|
|
1664
1664
|
`, super.connectedCallback(), y(this, Mt, this.querySelector("input"));
|
|
1665
1665
|
}
|
|
1666
1666
|
};
|
|
1667
|
-
Mt = new WeakMap(),
|
|
1667
|
+
Mt = new WeakMap(), ot = new WeakMap(), ut = new WeakMap(), bt = new WeakMap(), ne = new WeakMap(), Y = new WeakMap(), Le = new WeakMap(), h(je, "CellInputText");
|
|
1668
1668
|
let we = je;
|
|
1669
1669
|
customElements.get("cell-input-text");
|
|
1670
1670
|
customElements.get("cell-input") || customElements.define("cell-input", we);
|