@ninebone/table 0.0.472 β 0.0.474
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 +109 -111
- 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,8 +22,8 @@ const He = class He extends Xe.constructor {
|
|
|
22
22
|
};
|
|
23
23
|
h(He, "Trace");
|
|
24
24
|
let le = He;
|
|
25
|
-
const
|
|
26
|
-
var D, P, S, K, U, X,
|
|
25
|
+
const yt = new le();
|
|
26
|
+
var D, P, S, K, U, X, It, Z, _t;
|
|
27
27
|
const Me = class Me extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
@@ -33,7 +33,7 @@ const Me = class Me extends HTMLElement {
|
|
|
33
33
|
d(this, K);
|
|
34
34
|
d(this, U);
|
|
35
35
|
d(this, X);
|
|
36
|
-
d(this,
|
|
36
|
+
d(this, It, /* @__PURE__ */ h(() => {
|
|
37
37
|
if (!t(this, D)) return;
|
|
38
38
|
const e = t(this, D).querySelector(".ng-container-body .ng-part-body");
|
|
39
39
|
e && (y(this, X, new ResizeObserver(() => {
|
|
@@ -73,7 +73,7 @@ const Me = class Me extends HTMLElement {
|
|
|
73
73
|
const l = s.clientWidth, u = r.scrollWidth - l;
|
|
74
74
|
return c > 0 && u > 0 && (s.scrollLeft = a / c * u), a > 0 && a < c - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
d(this,
|
|
76
|
+
d(this, _t, /* @__PURE__ */ h(() => {
|
|
77
77
|
const e = /* @__PURE__ */ h((r) => {
|
|
78
78
|
clearInterval(t(this, K)), clearInterval(t(this, U));
|
|
79
79
|
const n = parseInt(t(this, S).thumb.style.left || 0, 10);
|
|
@@ -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, P) || this.refresh();
|
|
193
|
-
}), t(this,
|
|
193
|
+
}), t(this, _t).call(this), t(this, It).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, X) && t(this, X).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
D = new WeakMap(), P = new WeakMap(), S = new WeakMap(), K = new WeakMap(), U = new WeakMap(), X = new WeakMap(),
|
|
201
|
+
D = new WeakMap(), P = new WeakMap(), S = new WeakMap(), K = new WeakMap(), U = new WeakMap(), X = new WeakMap(), It = new WeakMap(), Z = new WeakMap(), _t = new WeakMap(), h(Me, "NineTableHScrollBar");
|
|
202
202
|
let ce = Me;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ce);
|
|
204
|
-
var j, nt, G, R,
|
|
204
|
+
var j, nt, G, R, vt, wt, Nt;
|
|
205
205
|
const $e = class $e extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
@@ -209,8 +209,8 @@ const $e = class $e extends HTMLElement {
|
|
|
209
209
|
d(this, nt);
|
|
210
210
|
d(this, G, !1);
|
|
211
211
|
d(this, R);
|
|
212
|
+
d(this, vt, 0);
|
|
212
213
|
d(this, wt, 0);
|
|
213
|
-
d(this, St, 0);
|
|
214
214
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
215
|
if (!t(this, j) || !t(this, R)) return;
|
|
216
216
|
const e = t(this, R).container, s = t(this, R).track, r = t(this, R).thumb, n = e.clientHeight, a = (t(this, j).data.get() || []).length, c = t(this, nt).getRowHeight(), l = a * c;
|
|
@@ -229,7 +229,7 @@ const $e = class $e extends HTMLElement {
|
|
|
229
229
|
const v = f - u;
|
|
230
230
|
m < 0 && (m = 0), m > v && (m = v), r.style.top = `${m}px`, t(this, R).top.disabled = b <= 0, t(this, R).bottom.disabled = b >= g - 1;
|
|
231
231
|
}, "refresh"));
|
|
232
|
-
d(this,
|
|
232
|
+
d(this, Nt, /* @__PURE__ */ h(() => {
|
|
233
233
|
const e = t(this, R).container, s = /* @__PURE__ */ h(() => {
|
|
234
234
|
const n = (t(this, j).data.get() || []).length, o = t(this, nt).getRowHeight();
|
|
235
235
|
return n * o;
|
|
@@ -238,13 +238,13 @@ const $e = class $e extends HTMLElement {
|
|
|
238
238
|
t(this, G) || this.refresh();
|
|
239
239
|
}), t(this, R).thumb.addEventListener("mousedown", (r) => {
|
|
240
240
|
if (r.button !== 0) return;
|
|
241
|
-
r.stopPropagation(), r.preventDefault(), y(this, G, !0), y(this,
|
|
241
|
+
r.stopPropagation(), r.preventDefault(), y(this, G, !0), y(this, vt, r.clientY), y(this, wt, e.scrollTop);
|
|
242
242
|
const n = /* @__PURE__ */ h((a) => {
|
|
243
243
|
if (!t(this, G)) return;
|
|
244
|
-
const c = t(this, R).track.getBoundingClientRect(), l = t(this, R).thumb.clientHeight, u = c.height - l, b = a.clientY - t(this,
|
|
244
|
+
const c = t(this, R).track.getBoundingClientRect(), l = t(this, R).thumb.clientHeight, u = c.height - l, b = a.clientY - t(this, vt), g = e.clientHeight, m = s(), v = Math.max(m - g, 1);
|
|
245
245
|
if (u > 0 && v > 0) {
|
|
246
246
|
const w = b / u * v;
|
|
247
|
-
let x = t(this,
|
|
247
|
+
let x = t(this, wt) + w;
|
|
248
248
|
const M = Math.max(0, m - g);
|
|
249
249
|
x < 0 && (x = 0), x > M && (x = M), e.scrollTop = x;
|
|
250
250
|
}
|
|
@@ -345,15 +345,15 @@ const $e = class $e extends HTMLElement {
|
|
|
345
345
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
346
346
|
top: this.querySelector(".ng-scroll-top"),
|
|
347
347
|
bottom: this.querySelector(".ng-scroll-bottom")
|
|
348
|
-
}), t(this,
|
|
348
|
+
}), t(this, Nt).call(this), this.refresh();
|
|
349
349
|
}, "initWhenReady");
|
|
350
350
|
e();
|
|
351
351
|
}
|
|
352
352
|
};
|
|
353
|
-
j = new WeakMap(), nt = new WeakMap(), G = new WeakMap(), R = new WeakMap(),
|
|
353
|
+
j = new WeakMap(), nt = new WeakMap(), G = new WeakMap(), R = new WeakMap(), vt = new WeakMap(), wt = new WeakMap(), Nt = new WeakMap(), h($e, "NineTableVScrollBar");
|
|
354
354
|
let he = $e;
|
|
355
355
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", he);
|
|
356
|
-
var O, E, B, H, F, J,
|
|
356
|
+
var O, E, B, H, F, J, St, ot, Wt, Ot, Bt, zt, Et, At, Dt, Pt, qt, jt, Ae, at, lt, Ft;
|
|
357
357
|
const Ie = class Ie {
|
|
358
358
|
constructor(i) {
|
|
359
359
|
d(this, O);
|
|
@@ -362,14 +362,14 @@ const Ie = class Ie {
|
|
|
362
362
|
d(this, H, null);
|
|
363
363
|
d(this, F, null);
|
|
364
364
|
d(this, J, 0);
|
|
365
|
-
d(this,
|
|
365
|
+
d(this, St, 40);
|
|
366
366
|
d(this, ot, !1);
|
|
367
|
-
d(this,
|
|
367
|
+
d(this, Wt, !1);
|
|
368
368
|
d(this, Ot, 3);
|
|
369
369
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
370
370
|
var e;
|
|
371
371
|
const i = t(this, E).querySelector(".ng-container-body .ng-part-body");
|
|
372
|
-
i && (t(this,
|
|
372
|
+
i && (t(this, Et).call(this), t(this, at).call(this, i.scrollTop), (e = t(this, E).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
373
373
|
}, "refresh"));
|
|
374
374
|
A(this, "initialize", /* @__PURE__ */ h(() => {
|
|
375
375
|
y(this, H, null), t(this, B).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((r) => {
|
|
@@ -384,17 +384,15 @@ const Ie = class Ie {
|
|
|
384
384
|
});
|
|
385
385
|
const i = t(this, E).querySelector(".ng-container-body .ng-part-body"), e = t(this, E).querySelector(".ng-container-left .ng-part-body"), s = t(this, E).querySelector(".ng-container-right .ng-part-body");
|
|
386
386
|
if (i) {
|
|
387
|
-
t(this, zt).call(this, i), t(this,
|
|
387
|
+
t(this, zt).call(this, i), t(this, qt).call(this), t(this, Et).call(this), t(this, at).call(this, i.scrollTop);
|
|
388
388
|
let r = !1;
|
|
389
389
|
const n = /* @__PURE__ */ h((o, a) => {
|
|
390
390
|
var c;
|
|
391
|
-
r || (r = !0, i && i.scrollTop !== o && (i.scrollTop = o), e && e.scrollTop !== o && (e.scrollTop = o), s && s.scrollTop !== o && (s.scrollTop = o), t(this,
|
|
391
|
+
r || (r = !0, i && i.scrollTop !== o && (i.scrollTop = o), e && e.scrollTop !== o && (e.scrollTop = o), s && s.scrollTop !== o && (s.scrollTop = o), t(this, at).call(this, o), (c = t(this, E).querySelector("nine-table-vscrollbar")) == null || c.refresh(), r = !1);
|
|
392
392
|
}, "syncScroll");
|
|
393
393
|
[i, e, s].forEach((o) => {
|
|
394
394
|
o == null || o.addEventListener("scroll", () => {
|
|
395
|
-
|
|
396
|
-
n(o.scrollTop), y(this, at, !1);
|
|
397
|
-
}));
|
|
395
|
+
n(o.scrollTop), y(this, Wt, !1);
|
|
398
396
|
});
|
|
399
397
|
});
|
|
400
398
|
}
|
|
@@ -406,7 +404,7 @@ const Ie = class Ie {
|
|
|
406
404
|
if (!r) return;
|
|
407
405
|
r.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
|
|
408
406
|
const n = r.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
409
|
-
for (let a = 0; a < t(this,
|
|
407
|
+
for (let a = 0; a < t(this, St); a++)
|
|
410
408
|
s.forEach((c) => {
|
|
411
409
|
o.appendChild(c.cloneNode(!0));
|
|
412
410
|
});
|
|
@@ -430,9 +428,9 @@ const Ie = class Ie {
|
|
|
430
428
|
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
431
429
|
return u.forEach((b) => {
|
|
432
430
|
f += b.offsetHeight || b.getBoundingClientRect().height;
|
|
433
|
-
}), u.forEach((b) => b.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l, y(this, H, f > 0 ? f : 24), t(this,
|
|
431
|
+
}), u.forEach((b) => b.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l, y(this, H, f > 0 ? f : 24), t(this, At).call(this), t(this, H);
|
|
434
432
|
}, "#measureAndCacheHeight"));
|
|
435
|
-
d(this,
|
|
433
|
+
d(this, Et, /* @__PURE__ */ h(() => {
|
|
436
434
|
const e = (t(this, O).data.get() || []).length, s = t(this, H) || 24, r = e * s;
|
|
437
435
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
438
436
|
const o = t(this, E).querySelector(n);
|
|
@@ -441,10 +439,10 @@ const Ie = class Ie {
|
|
|
441
439
|
a && (a.style.height = `${r}px`);
|
|
442
440
|
});
|
|
443
441
|
}, "#updateVirtualScrollHeight"));
|
|
444
|
-
d(this,
|
|
442
|
+
d(this, At, /* @__PURE__ */ h(() => {
|
|
445
443
|
if (t(this, J) > 0 && t(this, H) > 0) {
|
|
446
444
|
const i = Math.ceil(t(this, J) / t(this, H));
|
|
447
|
-
y(this,
|
|
445
|
+
y(this, St, i + t(this, Ot));
|
|
448
446
|
}
|
|
449
447
|
}, "#updateRowCount"));
|
|
450
448
|
d(this, Dt, /* @__PURE__ */ h(() => {
|
|
@@ -485,12 +483,12 @@ const Ie = class Ie {
|
|
|
485
483
|
const o = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
|
|
486
484
|
o && (n += o.offsetHeight), a && (n += a.offsetHeight);
|
|
487
485
|
const c = Math.max(r - n, 100);
|
|
488
|
-
t(this, J) !== c && (y(this, J, c), t(this,
|
|
486
|
+
t(this, J) !== c && (y(this, J, c), t(this, At).call(this), t(this, H) !== null && t(this, qt).call(this));
|
|
489
487
|
}
|
|
490
488
|
}
|
|
491
489
|
})), t(this, F).observe(t(this, E)));
|
|
492
490
|
}, "#initResizeObserver"));
|
|
493
|
-
d(this,
|
|
491
|
+
d(this, qt, /* @__PURE__ */ h(() => {
|
|
494
492
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
495
493
|
const e = t(this, E).querySelector(i);
|
|
496
494
|
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Bt).call(this, e, i);
|
|
@@ -511,7 +509,7 @@ const Ie = class Ie {
|
|
|
511
509
|
return;
|
|
512
510
|
}
|
|
513
511
|
const g = t(this, O).data.get(b);
|
|
514
|
-
f.style.display = "", t(this,
|
|
512
|
+
f.style.display = "", t(this, lt).call(this, f, g, b);
|
|
515
513
|
});
|
|
516
514
|
});
|
|
517
515
|
}, "#adjustBufferRows"));
|
|
@@ -532,13 +530,13 @@ const Ie = class Ie {
|
|
|
532
530
|
return;
|
|
533
531
|
}
|
|
534
532
|
const w = t(this, O).data.get(v);
|
|
535
|
-
g.style.display = "", t(this,
|
|
533
|
+
g.style.display = "", t(this, lt).call(this, g, w, v);
|
|
536
534
|
});
|
|
537
535
|
}), t(this, ot) || (y(this, ot, !0), setTimeout(() => {
|
|
538
536
|
t(this, jt).call(this, n), y(this, ot, !1);
|
|
539
537
|
}, 0));
|
|
540
538
|
}, "#handleScroll_BAK"));
|
|
541
|
-
d(this,
|
|
539
|
+
d(this, at, /* @__PURE__ */ h((i) => {
|
|
542
540
|
var u;
|
|
543
541
|
const e = t(this, H);
|
|
544
542
|
if (!e || e <= 0) return;
|
|
@@ -560,7 +558,7 @@ const Ie = class Ie {
|
|
|
560
558
|
return;
|
|
561
559
|
}
|
|
562
560
|
const k = t(this, O).data.get(M);
|
|
563
|
-
w.style.display = "", t(this,
|
|
561
|
+
w.style.display = "", t(this, lt).call(this, w, k, M);
|
|
564
562
|
});
|
|
565
563
|
});
|
|
566
564
|
}, "#handleScroll"));
|
|
@@ -578,8 +576,8 @@ const Ie = class Ie {
|
|
|
578
576
|
cell.dataset.row = dataIndex;
|
|
579
577
|
});
|
|
580
578
|
}; */
|
|
581
|
-
d(this,
|
|
582
|
-
i.dataset.row = s, i.data = e,
|
|
579
|
+
d(this, lt, /* @__PURE__ */ h((i, e, s) => {
|
|
580
|
+
i.dataset.row = s, i.data = e, yt.log(s), Array.from(i.cells).forEach((r, n) => {
|
|
583
581
|
r.dataset.row = s, r.querySelector(':scope > [is^="cell-"], :scope > [class*="cell-"], :scope > cell-');
|
|
584
582
|
const o = Array.from(r.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
|
|
585
583
|
o && typeof o.refresh == "function" && o.refresh();
|
|
@@ -612,7 +610,7 @@ const Ie = class Ie {
|
|
|
612
610
|
return ((e = t(this, B).get(i)) == null ? void 0 : e.length) || 1;
|
|
613
611
|
}
|
|
614
612
|
};
|
|
615
|
-
O = new WeakMap(), E = new WeakMap(), B = new WeakMap(), H = new WeakMap(), F = new WeakMap(), J = new WeakMap(),
|
|
613
|
+
O = new WeakMap(), E = new WeakMap(), B = new WeakMap(), H = new WeakMap(), F = new WeakMap(), J = new WeakMap(), St = new WeakMap(), ot = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), Bt = new WeakMap(), zt = new WeakMap(), Et = new WeakMap(), At = new WeakMap(), Dt = new WeakMap(), Pt = new WeakMap(), qt = new WeakMap(), jt = new WeakMap(), Ae = new WeakMap(), at = new WeakMap(), lt = new WeakMap(), Ft = new WeakMap(), h(Ie, "RowManager");
|
|
616
614
|
let de = Ie;
|
|
617
615
|
const Yt = class Yt {
|
|
618
616
|
/**
|
|
@@ -668,8 +666,8 @@ const Yt = class Yt {
|
|
|
668
666
|
}
|
|
669
667
|
const M = x.rowSpan || 1, k = x.colSpan || 1;
|
|
670
668
|
for (let z = 0; z < M; z++)
|
|
671
|
-
for (let
|
|
672
|
-
v + z < u && w +
|
|
669
|
+
for (let pt = 0; pt < k; pt++)
|
|
670
|
+
v + z < u && w + pt < b && (g[v + z][w + pt] = z === 0 && pt === 0 ? "1" : "0");
|
|
673
671
|
});
|
|
674
672
|
}), l.forEach((m) => {
|
|
675
673
|
const v = m.sectionRowIndex;
|
|
@@ -693,8 +691,8 @@ const Yt = class Yt {
|
|
|
693
691
|
};
|
|
694
692
|
h(Yt, "TableCompiler");
|
|
695
693
|
let fe = Yt;
|
|
696
|
-
var Vt, Q, tt, Kt, Ut,
|
|
697
|
-
const
|
|
694
|
+
var Vt, Q, tt, Kt, Ut, ct, Xt, Zt;
|
|
695
|
+
const mt = class mt extends HTMLElement {
|
|
698
696
|
constructor() {
|
|
699
697
|
super();
|
|
700
698
|
d(this, Vt);
|
|
@@ -714,15 +712,15 @@ const xt = class xt extends HTMLElement {
|
|
|
714
712
|
if (!n) return;
|
|
715
713
|
n.innerHTML = "";
|
|
716
714
|
const o = document.createElement("div");
|
|
717
|
-
o.className = "ng-part-header", o.appendChild(t(this,
|
|
715
|
+
o.className = "ng-part-header", o.appendChild(t(this, ct).call(this, t(this, Q), r, "header"));
|
|
718
716
|
const a = document.createElement("div");
|
|
719
717
|
a.className = "ng-part-body";
|
|
720
718
|
const c = document.createElement("div");
|
|
721
|
-
c.className = "ng-scroll-content", c.style.position = "relative", c.style.width = "100%", c.appendChild(t(this,
|
|
719
|
+
c.className = "ng-scroll-content", c.style.position = "relative", c.style.width = "100%", c.appendChild(t(this, ct).call(this, t(this, Q), r, "body"));
|
|
722
720
|
const l = document.createElement("div");
|
|
723
721
|
l.className = "ng-virtual-spacer", l.style.width = "100%", l.style.pointerEvents = "none", c.appendChild(l), a.appendChild(c);
|
|
724
722
|
const f = document.createElement("div");
|
|
725
|
-
f.className = "ng-part-footer", f.appendChild(t(this,
|
|
723
|
+
f.className = "ng-part-footer", f.appendChild(t(this, ct).call(this, t(this, Q), r, "footer")), n.appendChild(o), n.appendChild(a), n.appendChild(f);
|
|
726
724
|
});
|
|
727
725
|
}, "#renderSplitContainers"));
|
|
728
726
|
d(this, Ut, /* @__PURE__ */ h(() => {
|
|
@@ -742,7 +740,7 @@ const xt = class xt extends HTMLElement {
|
|
|
742
740
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
743
741
|
}, 0));
|
|
744
742
|
}, "generate"));
|
|
745
|
-
d(this,
|
|
743
|
+
d(this, ct, /* @__PURE__ */ h((e, s, r) => {
|
|
746
744
|
const n = e.cloneNode(!0), o = n.querySelector("thead"), a = n.querySelector("tbody"), c = n.querySelector("tfoot");
|
|
747
745
|
if (r === "header") {
|
|
748
746
|
if (a && a.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
@@ -771,7 +769,7 @@ const xt = class xt extends HTMLElement {
|
|
|
771
769
|
t(this, Zt).call(this);
|
|
772
770
|
}, "#init"));
|
|
773
771
|
d(this, Zt, /* @__PURE__ */ h(() => {
|
|
774
|
-
const e =
|
|
772
|
+
const e = mt.SCROLLBAR_SIZE;
|
|
775
773
|
this.innerHTML = `
|
|
776
774
|
<style>
|
|
777
775
|
nine-table-sheet {
|
|
@@ -919,13 +917,13 @@ const xt = class xt extends HTMLElement {
|
|
|
919
917
|
t(this, Xt).call(this);
|
|
920
918
|
}
|
|
921
919
|
disconnectedCallback() {
|
|
922
|
-
this.innerHTML = "",
|
|
920
|
+
this.innerHTML = "", yt.log("NineTableSheet destroyed.");
|
|
923
921
|
}
|
|
924
922
|
};
|
|
925
|
-
Vt = new WeakMap(), Q = new WeakMap(), tt = new WeakMap(), Kt = new WeakMap(), Ut = new WeakMap(),
|
|
926
|
-
let
|
|
927
|
-
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet",
|
|
928
|
-
var Gt,
|
|
923
|
+
Vt = new WeakMap(), Q = new WeakMap(), tt = new WeakMap(), Kt = new WeakMap(), Ut = new WeakMap(), ct = new WeakMap(), Xt = new WeakMap(), Zt = new WeakMap(), h(mt, "NineTableSheet"), A(mt, "SCROLLBAR_SIZE", 16);
|
|
924
|
+
let $t = mt;
|
|
925
|
+
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", $t);
|
|
926
|
+
var Gt, Rt;
|
|
929
927
|
const _e = class _e extends HTMLElement {
|
|
930
928
|
constructor() {
|
|
931
929
|
super();
|
|
@@ -934,10 +932,10 @@ const _e = class _e extends HTMLElement {
|
|
|
934
932
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
935
933
|
var o;
|
|
936
934
|
const r = s.ctrlKey || s.metaKey || s.shiftKey, n = parseInt((o = s.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
|
|
937
|
-
t(this,
|
|
938
|
-
}), t(this,
|
|
935
|
+
t(this, Rt).call(this, n, r);
|
|
936
|
+
}), t(this, Rt).call(this, 0, !1);
|
|
939
937
|
}, "#init"));
|
|
940
|
-
d(this,
|
|
938
|
+
d(this, Rt, /* @__PURE__ */ h((e, s = !1) => {
|
|
941
939
|
const r = /* @__PURE__ */ h(() => {
|
|
942
940
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
943
941
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((g) => g.style.setProperty("display", "none"));
|
|
@@ -973,24 +971,24 @@ const _e = class _e extends HTMLElement {
|
|
|
973
971
|
t(this, Gt).call(this);
|
|
974
972
|
}
|
|
975
973
|
};
|
|
976
|
-
Gt = new WeakMap(),
|
|
974
|
+
Gt = new WeakMap(), Rt = new WeakMap(), h(_e, "NineTableSheets");
|
|
977
975
|
let ue = _e;
|
|
978
976
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", ue);
|
|
979
|
-
var I, Jt,
|
|
977
|
+
var I, Jt, kt, Qt;
|
|
980
978
|
const Ne = class Ne {
|
|
981
979
|
constructor(i) {
|
|
982
980
|
d(this, I);
|
|
983
981
|
d(this, Jt, /* @__PURE__ */ h(() => {
|
|
984
982
|
t(this, Qt).call(this), new ResizeObserver((i) => {
|
|
985
983
|
for (let e of i)
|
|
986
|
-
t(this, I).getAttribute("auto-height") === "true" && t(this,
|
|
984
|
+
t(this, I).getAttribute("auto-height") === "true" && t(this, kt).call(this);
|
|
987
985
|
}).observe(t(this, I));
|
|
988
986
|
}, "#init"));
|
|
989
|
-
d(this,
|
|
987
|
+
d(this, kt, /* @__PURE__ */ h(() => {
|
|
990
988
|
var c, l;
|
|
991
989
|
const i = Array.from(t(this, I).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
992
990
|
if (i.length === 0) return;
|
|
993
|
-
const e = parseInt(t(this, I).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), r = (c = t(this, I).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, n = (l = t(this, I).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o =
|
|
991
|
+
const e = parseInt(t(this, I).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), r = (c = t(this, I).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, n = (l = t(this, I).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = $t.SCROLLBAR_SIZE, a = e * s + r + n + o;
|
|
994
992
|
t(this, I).style.height = `${a}px`;
|
|
995
993
|
}, "#applyAutoHeight"));
|
|
996
994
|
d(this, Qt, /* @__PURE__ */ h(() => {
|
|
@@ -1092,40 +1090,40 @@ const Ne = class Ne {
|
|
|
1092
1090
|
const a = t(this, I).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1093
1091
|
a == null || a.forEach((c, l) => {
|
|
1094
1092
|
e[l] && setTimeout(() => {
|
|
1095
|
-
c.generate(e[l]), s && t(this,
|
|
1093
|
+
c.generate(e[l]), s && t(this, kt).call(this);
|
|
1096
1094
|
});
|
|
1097
1095
|
});
|
|
1098
1096
|
}, "#render"));
|
|
1099
1097
|
y(this, I, i), t(this, Jt).call(this);
|
|
1100
1098
|
}
|
|
1101
1099
|
};
|
|
1102
|
-
I = new WeakMap(), Jt = new WeakMap(),
|
|
1100
|
+
I = new WeakMap(), Jt = new WeakMap(), kt = new WeakMap(), Qt = new WeakMap(), h(Ne, "LayoutManager");
|
|
1103
1101
|
let ge = Ne;
|
|
1104
|
-
var
|
|
1102
|
+
var Tt, ht;
|
|
1105
1103
|
const We = class We {
|
|
1106
1104
|
constructor(i) {
|
|
1107
|
-
d(this,
|
|
1108
|
-
d(this,
|
|
1109
|
-
A(this, "count", /* @__PURE__ */ h(() => t(this,
|
|
1110
|
-
y(this,
|
|
1105
|
+
d(this, Tt);
|
|
1106
|
+
d(this, ht, -1);
|
|
1107
|
+
A(this, "count", /* @__PURE__ */ h(() => t(this, Tt).rawRecords.length, "count"));
|
|
1108
|
+
y(this, Tt, i);
|
|
1111
1109
|
}
|
|
1112
1110
|
get at() {
|
|
1113
|
-
return t(this,
|
|
1111
|
+
return t(this, ht);
|
|
1114
1112
|
}
|
|
1115
1113
|
set at(i) {
|
|
1116
|
-
y(this,
|
|
1114
|
+
y(this, ht, parseInt(i, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, ht)}"]`) && setTimeout(() => {
|
|
1117
1115
|
});
|
|
1118
1116
|
}
|
|
1119
1117
|
};
|
|
1120
|
-
|
|
1118
|
+
Tt = new WeakMap(), ht = new WeakMap(), h(We, "ngRow");
|
|
1121
1119
|
let be = We;
|
|
1122
|
-
var _, T, N,
|
|
1120
|
+
var _, T, N, dt, te, Y, ee, et, Ct, se, ie, ft;
|
|
1123
1121
|
const W = class W {
|
|
1124
1122
|
constructor(i, e) {
|
|
1125
1123
|
d(this, _);
|
|
1126
1124
|
d(this, T);
|
|
1127
1125
|
d(this, N, []);
|
|
1128
|
-
d(this,
|
|
1126
|
+
d(this, dt, []);
|
|
1129
1127
|
d(this, te, 0);
|
|
1130
1128
|
d(this, Y, []);
|
|
1131
1129
|
d(this, ee, /* @__PURE__ */ h(() => {
|
|
@@ -1135,7 +1133,7 @@ const W = class W {
|
|
|
1135
1133
|
var s;
|
|
1136
1134
|
t(this, Y).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1137
1135
|
}), (t(this, T).rawRecords || []).forEach((e) => {
|
|
1138
|
-
e.__ng || (e.__ng = t(this,
|
|
1136
|
+
e.__ng || (e.__ng = t(this, Ct).call(this)), e.__ng.height = t(this, Y).slice();
|
|
1139
1137
|
});
|
|
1140
1138
|
}, "#initialize"));
|
|
1141
1139
|
d(this, et, /* @__PURE__ */ h(() => {
|
|
@@ -1147,19 +1145,19 @@ const W = class W {
|
|
|
1147
1145
|
var n;
|
|
1148
1146
|
const s = this.getValidData();
|
|
1149
1147
|
if (!s || s.length <= 0) return;
|
|
1150
|
-
if (i == null) return t(this,
|
|
1148
|
+
if (i == null) return t(this, ft).call(this, s);
|
|
1151
1149
|
if (i < 0 || i >= s.length) return null;
|
|
1152
1150
|
const r = typeof ((n = t(this, _).fields) == null ? void 0 : n.get) == "function" ? t(this, _).fields.get() : [];
|
|
1153
1151
|
if (e != null) {
|
|
1154
1152
|
const o = r.indexOf(e);
|
|
1155
1153
|
return o >= 0 ? s[i].v[o] : null;
|
|
1156
1154
|
}
|
|
1157
|
-
return t(this,
|
|
1155
|
+
return t(this, ft).call(this, s[i]);
|
|
1158
1156
|
}, "get"));
|
|
1159
1157
|
A(this, "set", /* @__PURE__ */ h((i) => {
|
|
1160
1158
|
this.clear(), this.add(i, !1), t(this, et).call(this);
|
|
1161
1159
|
}, "set"));
|
|
1162
|
-
d(this,
|
|
1160
|
+
d(this, Ct, /* @__PURE__ */ h(() => ({
|
|
1163
1161
|
rowState: W.ROW_STATE.EMPTY,
|
|
1164
1162
|
deleted: !1,
|
|
1165
1163
|
filtered: !1,
|
|
@@ -1169,11 +1167,11 @@ const W = class W {
|
|
|
1169
1167
|
_: [0, 0, 0, 0, W.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Y).slice(), -1, {}, {}]
|
|
1170
1168
|
}), "#getDefaultMeta"));
|
|
1171
1169
|
A(this, "reset", /* @__PURE__ */ h(() => {
|
|
1172
|
-
y(this, N, []), y(this,
|
|
1170
|
+
y(this, N, []), y(this, dt, []), t(this, et).call(this);
|
|
1173
1171
|
}, "reset"));
|
|
1174
1172
|
A(this, "clear", /* @__PURE__ */ h(() => {
|
|
1175
1173
|
var i;
|
|
1176
|
-
t(this, T).rawRecords = [], y(this, N, []), y(this,
|
|
1174
|
+
t(this, T).rawRecords = [], y(this, N, []), y(this, dt, []), (i = t(this, T).viewRecords) != null && i.reset && t(this, T).viewRecords.reset();
|
|
1177
1175
|
}, "clear"));
|
|
1178
1176
|
d(this, se, /* @__PURE__ */ h((i) => {
|
|
1179
1177
|
var r;
|
|
@@ -1187,7 +1185,7 @@ const W = class W {
|
|
|
1187
1185
|
}), s;
|
|
1188
1186
|
}, "#json2Array"));
|
|
1189
1187
|
d(this, ie, /* @__PURE__ */ h((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1190
|
-
e.__ng = t(this,
|
|
1188
|
+
e.__ng = t(this, Ct).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = W.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1191
1189
|
}), i), "#defaultInsert"));
|
|
1192
1190
|
A(this, "add", /* @__PURE__ */ h((i, e = !0) => {
|
|
1193
1191
|
i === void 0 && (i = {});
|
|
@@ -1221,14 +1219,14 @@ const W = class W {
|
|
|
1221
1219
|
a !== s && o.__ng.rowState !== W.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = a), o.__ng.rowState = W.ROW_STATE.UPDATE), o.v[n] = s;
|
|
1222
1220
|
}, "setValue"));
|
|
1223
1221
|
A(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1224
|
-
y(this,
|
|
1222
|
+
y(this, dt, t(this, T).rawRecords.filter((i) => !i.__ng.deleted)), y(this, N, t(this, T).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, T).rawRecords.forEach((i, e) => {
|
|
1225
1223
|
i.__ng.rowidx = e;
|
|
1226
1224
|
}), t(this, N).forEach((i, e) => {
|
|
1227
1225
|
i.__ng.i = e;
|
|
1228
1226
|
});
|
|
1229
1227
|
}, "resetRecords"));
|
|
1230
1228
|
A(this, "getValidData", /* @__PURE__ */ h(() => (t(this, N).length === 0 && t(this, T).rawRecords.length > 0 && this.resetRecords(), t(this, N)), "getValidData"));
|
|
1231
|
-
d(this,
|
|
1229
|
+
d(this, ft, /* @__PURE__ */ h((i) => {
|
|
1232
1230
|
var o;
|
|
1233
1231
|
if (!i) return i;
|
|
1234
1232
|
const e = !Array.isArray(i), s = e ? [i] : i, r = typeof ((o = t(this, _).fields) == null ? void 0 : o.get) == "function" ? t(this, _).fields.get() : [], n = s.filter((a) => !a.__ng.deleted).map((a) => {
|
|
@@ -1243,7 +1241,7 @@ const W = class W {
|
|
|
1243
1241
|
y(this, _, i), y(this, T, e), t(this, ee).call(this);
|
|
1244
1242
|
}
|
|
1245
1243
|
get source() {
|
|
1246
|
-
return t(this,
|
|
1244
|
+
return t(this, ft).call(this, t(this, T).rawRecords);
|
|
1247
1245
|
}
|
|
1248
1246
|
set source(i) {
|
|
1249
1247
|
this.clear(), this.add(i, !1);
|
|
@@ -1258,7 +1256,7 @@ const W = class W {
|
|
|
1258
1256
|
return this.length;
|
|
1259
1257
|
}
|
|
1260
1258
|
};
|
|
1261
|
-
_ = new WeakMap(), T = new WeakMap(), N = new WeakMap(),
|
|
1259
|
+
_ = new WeakMap(), T = new WeakMap(), N = new WeakMap(), dt = new WeakMap(), te = new WeakMap(), Y = new WeakMap(), ee = new WeakMap(), et = new WeakMap(), Ct = new WeakMap(), se = new WeakMap(), ie = new WeakMap(), ft = new WeakMap(), h(W, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1262
1260
|
A(W, "ROW_STATE", {
|
|
1263
1261
|
EMPTY: "EMPTY",
|
|
1264
1262
|
NORMAL: "NORMAL",
|
|
@@ -1290,29 +1288,29 @@ const Oe = class Oe {
|
|
|
1290
1288
|
};
|
|
1291
1289
|
st = new WeakMap(), h(Oe, "ngDataManager");
|
|
1292
1290
|
let pe = Oe;
|
|
1293
|
-
var
|
|
1291
|
+
var ut, L, Lt, re;
|
|
1294
1292
|
const Be = class Be {
|
|
1295
1293
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1296
1294
|
constructor(i) {
|
|
1297
|
-
d(this,
|
|
1295
|
+
d(this, ut);
|
|
1298
1296
|
d(this, L, []);
|
|
1299
1297
|
A(this, "add", /* @__PURE__ */ h((i, e = "string") => {
|
|
1300
1298
|
i.forEach((s) => {
|
|
1301
1299
|
t(this, L).some((r) => r.name === s) || t(this, L).push({ name: s, type: e });
|
|
1302
|
-
}), t(this,
|
|
1300
|
+
}), t(this, Lt).call(this);
|
|
1303
1301
|
}, "add"));
|
|
1304
|
-
d(this,
|
|
1302
|
+
d(this, Lt, /* @__PURE__ */ h(() => {
|
|
1305
1303
|
const i = /* @__PURE__ */ new Map();
|
|
1306
1304
|
t(this, L).forEach((e) => {
|
|
1307
1305
|
i.set(e.name, e.type);
|
|
1308
1306
|
}), 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);
|
|
1309
1307
|
}, "#adjust"));
|
|
1310
1308
|
d(this, re, /* @__PURE__ */ h(() => {
|
|
1311
|
-
y(this, L, []),
|
|
1312
|
-
const i = Array.from(t(this,
|
|
1309
|
+
y(this, L, []), yt.log(t(this, ut).querySelectorAll("table"));
|
|
1310
|
+
const i = Array.from(t(this, ut).querySelectorAll("table"));
|
|
1313
1311
|
if (!(!i || i.length === 0)) {
|
|
1314
1312
|
for (const e of i)
|
|
1315
|
-
|
|
1313
|
+
yt.log(e), $("[data-bind]", e).each((s, r) => {
|
|
1316
1314
|
const n = r.dataset.bind, o = r.getAttribute("data-type") || "string";
|
|
1317
1315
|
n && t(this, L).push({ name: n, type: o });
|
|
1318
1316
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
@@ -1336,10 +1334,10 @@ const Be = class Be {
|
|
|
1336
1334
|
});
|
|
1337
1335
|
});
|
|
1338
1336
|
});
|
|
1339
|
-
t(this,
|
|
1337
|
+
t(this, Lt).call(this);
|
|
1340
1338
|
}
|
|
1341
1339
|
}, "#init"));
|
|
1342
|
-
y(this,
|
|
1340
|
+
y(this, ut, i), t(this, re).call(this);
|
|
1343
1341
|
}
|
|
1344
1342
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
1345
1343
|
get() {
|
|
@@ -1361,7 +1359,7 @@ const Be = class Be {
|
|
|
1361
1359
|
return t(this, L).some((e) => e.name === i);
|
|
1362
1360
|
}
|
|
1363
1361
|
};
|
|
1364
|
-
|
|
1362
|
+
ut = new WeakMap(), L = new WeakMap(), Lt = new WeakMap(), re = new WeakMap(), h(Be, "ngFields");
|
|
1365
1363
|
let me = Be;
|
|
1366
1364
|
var it, ne, oe;
|
|
1367
1365
|
const ze = class ze extends HTMLElement {
|
|
@@ -1371,7 +1369,7 @@ const ze = class ze extends HTMLElement {
|
|
|
1371
1369
|
d(this, it);
|
|
1372
1370
|
d(this, ne);
|
|
1373
1371
|
d(this, oe, /* @__PURE__ */ h(() => {
|
|
1374
|
-
this.fields = new me(this), y(this, ne, new ge(this)),
|
|
1372
|
+
this.fields = new me(this), y(this, ne, new ge(this)), yt.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1375
1373
|
}, "#init"));
|
|
1376
1374
|
this.attachShadow({ mode: "open" }), y(this, it, new pe(this));
|
|
1377
1375
|
}
|
|
@@ -1379,7 +1377,7 @@ const ze = class ze extends HTMLElement {
|
|
|
1379
1377
|
t(this, oe).call(this);
|
|
1380
1378
|
}
|
|
1381
1379
|
disconnectedCallback() {
|
|
1382
|
-
|
|
1380
|
+
yt.log("NineTable disconnected.");
|
|
1383
1381
|
}
|
|
1384
1382
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1385
1383
|
get data() {
|
|
@@ -1397,7 +1395,7 @@ const ze = class ze extends HTMLElement {
|
|
|
1397
1395
|
it = new WeakMap(), ne = new WeakMap(), oe = new WeakMap(), h(ze, "NineTable");
|
|
1398
1396
|
let xe = ze;
|
|
1399
1397
|
customElements.get("nine-table") || customElements.define("nine-table", xe);
|
|
1400
|
-
const
|
|
1398
|
+
const xt = class xt extends HTMLElement {
|
|
1401
1399
|
// π 컀μ€ν
μ€νμΌμ© μΊμ μΆκ°
|
|
1402
1400
|
constructor() {
|
|
1403
1401
|
super();
|
|
@@ -1408,14 +1406,14 @@ const vt = class vt extends HTMLElement {
|
|
|
1408
1406
|
connectedCallback() {
|
|
1409
1407
|
}
|
|
1410
1408
|
};
|
|
1411
|
-
h(
|
|
1412
|
-
let ve =
|
|
1413
|
-
var C,
|
|
1409
|
+
h(xt, "BasicCellElement"), A(xt, "_styleCache", /* @__PURE__ */ new Map()), A(xt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1410
|
+
let ve = xt;
|
|
1411
|
+
var C, Ht, p, qe, Re, ke, Te, Ce;
|
|
1414
1412
|
const De = class De extends ve {
|
|
1415
1413
|
constructor() {
|
|
1416
1414
|
super();
|
|
1417
1415
|
d(this, C);
|
|
1418
|
-
d(this,
|
|
1416
|
+
d(this, Ht);
|
|
1419
1417
|
d(this, p);
|
|
1420
1418
|
d(this, qe);
|
|
1421
1419
|
d(this, Re);
|
|
@@ -1484,7 +1482,7 @@ const De = class De extends ve {
|
|
|
1484
1482
|
}, "getExprValue"));
|
|
1485
1483
|
}
|
|
1486
1484
|
connectedCallback() {
|
|
1487
|
-
super.connectedCallback(), y(this, C, this.getRootNode().host), y(this, p, this.closest("th,td")), y(this,
|
|
1485
|
+
super.connectedCallback(), y(this, C, this.getRootNode().host), y(this, p, this.closest("th,td")), y(this, Ht, t(this, p).closest("tr"));
|
|
1488
1486
|
}
|
|
1489
1487
|
get value() {
|
|
1490
1488
|
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];
|
|
@@ -1502,10 +1500,10 @@ const De = class De extends ve {
|
|
|
1502
1500
|
return t(this, p).closest("tr").data;
|
|
1503
1501
|
}
|
|
1504
1502
|
refresh() {
|
|
1505
|
-
return t(this, p).dataset.bind, parseInt(t(this, p).dataset.row), t(this,
|
|
1503
|
+
return t(this, p).dataset.bind, parseInt(t(this, p).dataset.row), t(this, Ht).data, t(this, p).dataset.row;
|
|
1506
1504
|
}
|
|
1507
1505
|
};
|
|
1508
|
-
C = new WeakMap(),
|
|
1506
|
+
C = new WeakMap(), Ht = new WeakMap(), p = new WeakMap(), qe = new WeakMap(), Re = new WeakMap(), ke = new WeakMap(), Te = new WeakMap(), Ce = new WeakMap(), h(De, "CellElement");
|
|
1509
1507
|
let we = De;
|
|
1510
1508
|
const Pe = class Pe extends we {
|
|
1511
1509
|
constructor() {
|
|
@@ -1520,19 +1518,19 @@ const Pe = class Pe extends we {
|
|
|
1520
1518
|
};
|
|
1521
1519
|
h(Pe, "EditableCellElement");
|
|
1522
1520
|
let Se = Pe;
|
|
1523
|
-
var
|
|
1521
|
+
var Mt, rt, gt, bt, ae, V, Le;
|
|
1524
1522
|
const je = class je extends Se {
|
|
1525
1523
|
constructor() {
|
|
1526
1524
|
super();
|
|
1527
|
-
d(this,
|
|
1525
|
+
d(this, Mt);
|
|
1528
1526
|
d(this, rt);
|
|
1527
|
+
d(this, gt);
|
|
1529
1528
|
d(this, bt);
|
|
1530
|
-
d(this, yt);
|
|
1531
1529
|
d(this, ae);
|
|
1532
1530
|
d(this, V);
|
|
1533
1531
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
1534
1532
|
const e = super.refresh();
|
|
1535
|
-
t(this,
|
|
1533
|
+
t(this, Mt).value = e;
|
|
1536
1534
|
}, "refresh"));
|
|
1537
1535
|
/**
|
|
1538
1536
|
dataRefresh = (v) => {
|
|
@@ -1568,7 +1566,7 @@ const je = class je extends Se {
|
|
|
1568
1566
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1569
1567
|
if (t(this, rt) == "number") {
|
|
1570
1568
|
let n = [];
|
|
1571
|
-
if (t(this, V) && Number(t(this, V)) > 0 && n.push("."), t(this,
|
|
1569
|
+
if (t(this, V) && Number(t(this, V)) > 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, V) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
|
|
1572
1570
|
var s = e.target.value, r = s.indexOf(".");
|
|
1573
1571
|
if (r >= 0) {
|
|
1574
1572
|
var s = s.substr(r + 1, s.length);
|
|
@@ -1576,10 +1574,10 @@ const je = class je extends Se {
|
|
|
1576
1574
|
}
|
|
1577
1575
|
}
|
|
1578
1576
|
}
|
|
1579
|
-
t(this,
|
|
1577
|
+
t(this, gt) && ninegrid.getByteLength(e.target.value) >= Number(t(this, gt)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1580
1578
|
}
|
|
1581
1579
|
}, "#onKeyDown"));
|
|
1582
|
-
if (this.applyBaseStyle(), y(this, rt, this.getAttribute("type") || "text"), y(this,
|
|
1580
|
+
if (this.applyBaseStyle(), y(this, rt, this.getAttribute("type") || "text"), y(this, gt, this.getAttribute("maxbyte")), y(this, bt, this.getAttribute("min")), y(this, ae, this.getAttribute("max")), y(this, V, this.getAttribute("scale")), !["text", "number"].includes(t(this, rt))) throw `invalid type : ${t(this, rt)}`;
|
|
1583
1581
|
}
|
|
1584
1582
|
connectedCallback() {
|
|
1585
1583
|
for (var e = [], s = 0; s < this.attributes.length; s++)
|
|
@@ -1589,10 +1587,10 @@ const je = class je extends Se {
|
|
|
1589
1587
|
${e.join(" ")}
|
|
1590
1588
|
ondragstart="return false;"
|
|
1591
1589
|
>
|
|
1592
|
-
`, super.connectedCallback(), y(this,
|
|
1590
|
+
`, super.connectedCallback(), y(this, Mt, this.querySelector("input"));
|
|
1593
1591
|
}
|
|
1594
1592
|
};
|
|
1595
|
-
|
|
1593
|
+
Mt = new WeakMap(), rt = new WeakMap(), gt = new WeakMap(), bt = new WeakMap(), ae = new WeakMap(), V = new WeakMap(), Le = new WeakMap(), h(je, "CellInputText");
|
|
1596
1594
|
let Ee = je;
|
|
1597
1595
|
customElements.get("cell-input-text");
|
|
1598
1596
|
customElements.get("cell-input") || customElements.define("cell-input", Ee);
|