@ninebone/table 0.0.698 → 0.0.700
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 +229 -233
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +7 -7
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -44,31 +44,31 @@ const Oe = class Oe extends HTMLElement {
|
|
|
44
44
|
if (!t(this, B) || !t(this, S) || t(this, j)) return;
|
|
45
45
|
const e = t(this, S).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const r = t(this, S).track,
|
|
47
|
+
const r = t(this, S).track, o = t(this, S).thumb, i = t(this, B).querySelector(".ng-container-bottom"), a = e.clientWidth, c = s.scrollWidth;
|
|
48
48
|
if (a !== 0 && c > a)
|
|
49
|
-
|
|
49
|
+
i && (i.style.display = "flex");
|
|
50
50
|
else {
|
|
51
|
-
|
|
51
|
+
i && (i.style.display = "none");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
54
|
const l = r.clientWidth;
|
|
55
55
|
if (l <= 0) return;
|
|
56
56
|
const f = Math.max(Math.min(l * (a / c), l), 20);
|
|
57
|
-
|
|
57
|
+
o.style.width = `${f}px`;
|
|
58
58
|
const g = e.scrollLeft, b = c - a;
|
|
59
59
|
let u = 0;
|
|
60
60
|
b > 0 && (u = parseInt(g / b * (l - f), 10)), u < 0 && (u = 0);
|
|
61
|
-
const
|
|
62
|
-
u >
|
|
61
|
+
const m = l - f;
|
|
62
|
+
u > m && (u = m), o.style.left = `${u}px`, t(this, S).left.disabled = u === 0, t(this, S).right.disabled = u >= m - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
64
|
d(this, J, /* @__PURE__ */ h((e) => {
|
|
65
65
|
if (!t(this, S)) return !1;
|
|
66
66
|
const s = t(this, S).container, r = s.querySelector("table");
|
|
67
67
|
if (!r) return !1;
|
|
68
|
-
const
|
|
68
|
+
const o = t(this, S).track.getBoundingClientRect(), i = t(this, S).thumb.clientWidth;
|
|
69
69
|
let a = e;
|
|
70
70
|
a < 0 && (a = 0);
|
|
71
|
-
const c =
|
|
71
|
+
const c = o.width - i;
|
|
72
72
|
a > c && (a = c), a = parseInt(a, 10), t(this, S).thumb.style.left = `${a}px`, t(this, S).left.disabled = a === 0, t(this, S).right.disabled = a >= c - 1;
|
|
73
73
|
const l = s.clientWidth, g = r.scrollWidth - l;
|
|
74
74
|
return c > 0 && g > 0 && (s.scrollLeft = a / c * g), a > 0 && a < c - 1;
|
|
@@ -76,11 +76,11 @@ const Oe = class Oe extends HTMLElement {
|
|
|
76
76
|
d(this, Bt, /* @__PURE__ */ h(() => {
|
|
77
77
|
const e = /* @__PURE__ */ h((r) => {
|
|
78
78
|
clearInterval(t(this, K)), clearInterval(t(this, Z));
|
|
79
|
-
const
|
|
80
|
-
t(this, J).call(this,
|
|
79
|
+
const o = parseInt(t(this, S).thumb.style.left || 0, 10);
|
|
80
|
+
t(this, J).call(this, o + r), p(this, K, setInterval(() => {
|
|
81
81
|
clearInterval(t(this, K)), p(this, Z, setInterval(() => {
|
|
82
|
-
const
|
|
83
|
-
t(this, J).call(this,
|
|
82
|
+
const i = parseInt(t(this, S).thumb.style.left || 0, 10);
|
|
83
|
+
t(this, J).call(this, i + r) || clearInterval(t(this, Z));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), s = /* @__PURE__ */ h(() => {
|
|
@@ -95,19 +95,19 @@ const Oe = class Oe extends HTMLElement {
|
|
|
95
95
|
}), t(this, S).left.addEventListener("touchstart", () => e(-20)), t(this, S).right.addEventListener("touchstart", () => e(20)), t(this, S).track.addEventListener("mousedown", (r) => {
|
|
96
96
|
if (r.button !== 0) return;
|
|
97
97
|
r.preventDefault();
|
|
98
|
-
const
|
|
99
|
-
t(this, J).call(this, r.clientX -
|
|
98
|
+
const o = t(this, S).track.getBoundingClientRect(), i = t(this, S).thumb.clientWidth;
|
|
99
|
+
t(this, J).call(this, r.clientX - o.left - i / 2);
|
|
100
100
|
}), t(this, S).thumb.addEventListener("mousedown", (r) => {
|
|
101
101
|
if (r.button !== 0) return;
|
|
102
102
|
r.stopPropagation(), r.preventDefault(), p(this, j, !0), this.shiftX = r.clientX - t(this, S).thumb.getBoundingClientRect().left;
|
|
103
|
-
const
|
|
103
|
+
const o = /* @__PURE__ */ h((a) => {
|
|
104
104
|
if (!t(this, j)) return;
|
|
105
105
|
const c = t(this, S).track.getBoundingClientRect();
|
|
106
106
|
t(this, J).call(this, a.clientX - c.left - this.shiftX);
|
|
107
|
-
}, "onMouseMove"),
|
|
108
|
-
p(this, j, !1), s(), document.removeEventListener("mousemove",
|
|
107
|
+
}, "onMouseMove"), i = /* @__PURE__ */ h(() => {
|
|
108
|
+
p(this, j, !1), s(), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", i), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
|
-
document.addEventListener("mousemove",
|
|
110
|
+
document.addEventListener("mousemove", o), document.addEventListener("mouseup", i);
|
|
111
111
|
});
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
@@ -213,49 +213,49 @@ const Be = class Be extends HTMLElement {
|
|
|
213
213
|
d(this, St, 0);
|
|
214
214
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
215
|
if (T.log("vscrollbar.refresh"), !t(this, Q) || !t(this, k)) return;
|
|
216
|
-
const e = t(this, k).container, s = t(this, k).track, r = t(this, k).thumb,
|
|
217
|
-
if (c <=
|
|
216
|
+
const e = t(this, k).container, s = t(this, k).track, r = t(this, k).thumb, o = e.clientHeight, i = t(this, Q).data.length, a = t(this, tt).getRowHeight(), c = i * a;
|
|
217
|
+
if (c <= o || i === 0) {
|
|
218
218
|
this.style.display = "none";
|
|
219
219
|
return;
|
|
220
220
|
} else
|
|
221
221
|
this.style.display = "flex";
|
|
222
222
|
const l = s.clientHeight;
|
|
223
223
|
if (l <= 0) return;
|
|
224
|
-
const f = Math.max(Math.min(l * (
|
|
224
|
+
const f = Math.max(Math.min(l * (o / c), l), 20);
|
|
225
225
|
r.style.height = `${f}px`;
|
|
226
|
-
const g = e.scrollTop, b = Math.max(c -
|
|
226
|
+
const g = e.scrollTop, b = Math.max(c - o, 1);
|
|
227
227
|
T.log(e, g, b);
|
|
228
228
|
let u = 0;
|
|
229
229
|
b > 0 && (u = g / b * (l - f));
|
|
230
|
-
const
|
|
231
|
-
u < 0 && (u = 0), u >
|
|
230
|
+
const m = l - f;
|
|
231
|
+
u < 0 && (u = 0), u > m && (u = m), r.style.top = `${u}px`, t(this, k).top.disabled = g <= 0, t(this, k).bottom.disabled = g >= b - 1;
|
|
232
232
|
}, "refresh"));
|
|
233
233
|
d(this, Pt, /* @__PURE__ */ h(() => {
|
|
234
234
|
T.log("nine-table-vscrollbar.#init");
|
|
235
235
|
const e = t(this, k).container, s = /* @__PURE__ */ h(() => {
|
|
236
|
-
const
|
|
237
|
-
return
|
|
236
|
+
const o = (t(this, Q).data.get() || []).length, i = t(this, tt).getRowHeight();
|
|
237
|
+
return o * i;
|
|
238
238
|
}, "getContentHeight");
|
|
239
239
|
t(this, k).thumb.addEventListener("mousedown", (r) => {
|
|
240
240
|
if (r.button !== 0) return;
|
|
241
241
|
r.stopPropagation(), r.preventDefault(), p(this, ct, !0), p(this, wt, r.clientY), p(this, St, e.scrollTop);
|
|
242
|
-
const
|
|
242
|
+
const o = /* @__PURE__ */ h((a) => {
|
|
243
243
|
if (!t(this, ct)) return;
|
|
244
|
-
const c = t(this, k).track.getBoundingClientRect(), l = t(this, k).thumb.clientHeight, g = c.height - l, b = a.clientY - t(this, wt), u = e.clientHeight,
|
|
244
|
+
const c = t(this, k).track.getBoundingClientRect(), l = t(this, k).thumb.clientHeight, g = c.height - l, b = a.clientY - t(this, wt), u = e.clientHeight, m = s(), v = Math.max(m - u, 1);
|
|
245
245
|
if (g > 0 && v > 0) {
|
|
246
246
|
const A = b / g * v;
|
|
247
247
|
let x = t(this, St) + A;
|
|
248
|
-
const M = Math.max(0,
|
|
248
|
+
const M = Math.max(0, m - u);
|
|
249
249
|
x < 0 && (x = 0), x > M && (x = M), e.scrollTop = x;
|
|
250
250
|
}
|
|
251
251
|
this.refresh();
|
|
252
|
-
}, "onMouseMove"),
|
|
253
|
-
p(this, ct, !1), document.removeEventListener("mousemove",
|
|
252
|
+
}, "onMouseMove"), i = /* @__PURE__ */ h(() => {
|
|
253
|
+
p(this, ct, !1), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", i), this.refresh();
|
|
254
254
|
}, "onMouseUp");
|
|
255
|
-
document.addEventListener("mousemove",
|
|
255
|
+
document.addEventListener("mousemove", o), document.addEventListener("mouseup", i);
|
|
256
256
|
}), t(this, k).track.addEventListener("mousedown", (r) => {
|
|
257
257
|
if (r.button !== 0 || r.target === t(this, k).thumb) return;
|
|
258
|
-
const
|
|
258
|
+
const o = t(this, k).track.getBoundingClientRect(), i = t(this, k).thumb.clientHeight, a = r.clientY - o.top - i / 2, l = o.height - i, f = e.clientHeight, g = s(), b = Math.max(g - f, 1);
|
|
259
259
|
if (l > 0 && b > 0) {
|
|
260
260
|
const u = Math.max(0, Math.min(1, a / l));
|
|
261
261
|
e.scrollTop = u * b;
|
|
@@ -378,26 +378,26 @@ const Pe = class Pe {
|
|
|
378
378
|
T.log("rowManager.initialize"), p(this, et, {
|
|
379
379
|
scrollTables: t(this, w).querySelectorAll(".ng-part-body table"),
|
|
380
380
|
firstTr: t(this, w).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
381
|
-
}), p(this, _, null), t(this, P).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
382
|
-
const a = t(this, w).querySelector(
|
|
381
|
+
}), p(this, _, null), t(this, P).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
382
|
+
const a = t(this, w).querySelector(i);
|
|
383
383
|
if (!a) return;
|
|
384
384
|
const c = a.querySelector(".ng-part-body table");
|
|
385
385
|
if (!c) return;
|
|
386
386
|
const l = c.querySelector("tbody.bindable-tbody");
|
|
387
387
|
if (!l) return;
|
|
388
388
|
const g = Array.from(l.querySelectorAll("tr")).map((b) => b.cloneNode(!0));
|
|
389
|
-
t(this, P).set(
|
|
389
|
+
t(this, P).set(i, g);
|
|
390
390
|
});
|
|
391
|
-
const n = t(this, w).querySelector(".ng-container-body .ng-part-body"), e = t(this, w).querySelector(".ng-container-left .ng-part-body"), s = t(this, w).querySelector(".ng-container-right .ng-part-body"), r = t(this, w).querySelector(".ng-container-body .ng-part-header"),
|
|
391
|
+
const n = t(this, w).querySelector(".ng-container-body .ng-part-body"), e = t(this, w).querySelector(".ng-container-left .ng-part-body"), s = t(this, w).querySelector(".ng-container-right .ng-part-body"), r = t(this, w).querySelector(".ng-container-body .ng-part-header"), o = t(this, w).querySelector(".ng-container-body .ng-part-footer");
|
|
392
392
|
if (n) {
|
|
393
393
|
t(this, At).call(this), t(this, Tt).call(this), t(this, Rt).call(this), t(this, ht).call(this, n.scrollTop);
|
|
394
|
-
let
|
|
394
|
+
let i = !1;
|
|
395
395
|
const a = /* @__PURE__ */ h((c) => {
|
|
396
396
|
var g;
|
|
397
|
-
if (
|
|
398
|
-
|
|
397
|
+
if (i) return;
|
|
398
|
+
i = !0;
|
|
399
399
|
const l = c.scrollTop, f = c.scrollLeft;
|
|
400
|
-
n && n.scrollTop !== l && (n.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), r && r.scrollLeft !== f && (r.scrollLeft = f),
|
|
400
|
+
n && n.scrollTop !== l && (n.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), r && r.scrollLeft !== f && (r.scrollLeft = f), o && o.scrollLeft !== f && (o.scrollLeft = f), t(this, ht).call(this, l), (g = t(this, w).querySelector("nine-table-vscrollbar")) == null || g.refresh(), i = !1;
|
|
401
401
|
}, "handleContainerScroll");
|
|
402
402
|
[n, e, s].forEach((c) => {
|
|
403
403
|
c == null || c.addEventListener("scroll", () => {
|
|
@@ -413,12 +413,12 @@ const Pe = class Pe {
|
|
|
413
413
|
const r = n.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
414
414
|
if (!r) return;
|
|
415
415
|
r.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
|
|
416
|
-
const
|
|
416
|
+
const o = r.querySelector("tr.nodata"), i = document.createDocumentFragment();
|
|
417
417
|
for (let a = 0; a < t(this, Et); a++)
|
|
418
418
|
s.forEach((c) => {
|
|
419
|
-
|
|
419
|
+
i.appendChild(c.cloneNode(!0));
|
|
420
420
|
});
|
|
421
|
-
|
|
421
|
+
o ? o.before(i) : r.appendChild(i), e === ".ng-container-body" && (t(this, et).firstTr = r.querySelector("tr:not(.nodata)"));
|
|
422
422
|
}, "#renderRows"));
|
|
423
423
|
d(this, At, /* @__PURE__ */ h(() => {
|
|
424
424
|
if (t(this, _) !== null && t(this, _) > 0)
|
|
@@ -430,30 +430,30 @@ const Pe = class Pe {
|
|
|
430
430
|
const s = n.querySelector("tbody.bindable-tbody");
|
|
431
431
|
if (T.log(s), !s) throw new Error("invalid dom");
|
|
432
432
|
s.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
|
|
433
|
-
const r = s.querySelector("tr.nodata"),
|
|
433
|
+
const r = s.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
434
434
|
e.forEach((b) => {
|
|
435
|
-
|
|
436
|
-
}), r ? r.before(
|
|
437
|
-
const
|
|
438
|
-
(a === "none" || window.getComputedStyle(
|
|
435
|
+
o.appendChild(b.cloneNode(!0));
|
|
436
|
+
}), r ? r.before(o) : s.appendChild(o);
|
|
437
|
+
const i = t(this, w), a = i.style.display, c = i.style.visibility, l = i.style.position;
|
|
438
|
+
(a === "none" || window.getComputedStyle(i).display === "none") && (i.style.display = "block", i.style.visibility = "hidden", i.style.position = "absolute");
|
|
439
439
|
let f = 0;
|
|
440
440
|
const g = s.querySelectorAll("tr");
|
|
441
441
|
return g.forEach((b) => {
|
|
442
442
|
let u = b.offsetHeight || b.getBoundingClientRect().height;
|
|
443
443
|
if (u === 0) {
|
|
444
|
-
const
|
|
445
|
-
u = parseFloat(
|
|
444
|
+
const m = window.getComputedStyle(b);
|
|
445
|
+
u = parseFloat(m.height) || parseFloat(m.minHeight) || 0;
|
|
446
446
|
}
|
|
447
447
|
f += u;
|
|
448
|
-
}), g.forEach((b) => b.remove()),
|
|
448
|
+
}), g.forEach((b) => b.remove()), i.style.display = a, i.style.visibility = c, i.style.position = l, f <= 0 ? -1 : (p(this, _, f), t(this, qt).call(this), t(this, _));
|
|
449
449
|
}, "#measureAndCacheHeight"));
|
|
450
450
|
d(this, Rt, /* @__PURE__ */ h(() => {
|
|
451
451
|
T.log("rowManager.#updateVirtualScrollHeight");
|
|
452
452
|
const e = (t(this, D).data.get() || []).length, s = t(this, _), r = e * s;
|
|
453
|
-
T.log("🔍 [VirtualHeight]", { totalCount: e, rowHeight: s, totalVirtualHeight: r }), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
454
|
-
const
|
|
455
|
-
if (!
|
|
456
|
-
const a =
|
|
453
|
+
T.log("🔍 [VirtualHeight]", { totalCount: e, rowHeight: s, totalVirtualHeight: r }), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
454
|
+
const i = t(this, w).querySelector(o);
|
|
455
|
+
if (!i) return;
|
|
456
|
+
const a = i.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
457
457
|
a && (a.style.height = `${r}px`);
|
|
458
458
|
});
|
|
459
459
|
}, "#updateVirtualScrollHeight"));
|
|
@@ -467,26 +467,26 @@ const Pe = class Pe {
|
|
|
467
467
|
var a, c, l, f, g, b;
|
|
468
468
|
const n = t(this, w).querySelector(".ng-container-left .ng-part-body table"), e = t(this, w).querySelector(".ng-container-body .ng-part-body table"), s = t(this, w).querySelector(".ng-container-right .ng-part-body table");
|
|
469
469
|
if (e) {
|
|
470
|
-
const u = n ? Array.from(n.querySelectorAll("tbody tr")) : [],
|
|
470
|
+
const u = n ? Array.from(n.querySelectorAll("tbody tr")) : [], m = Array.from(e.querySelectorAll("tbody tr")), v = s ? Array.from(s.querySelectorAll("tbody tr")) : [], A = Math.max(u.length, m.length, v.length);
|
|
471
471
|
for (let x = 0; x < A; x++) {
|
|
472
472
|
const M = [
|
|
473
473
|
((a = u[x]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
474
|
-
((c =
|
|
474
|
+
((c = m[x]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
475
475
|
((l = v[x]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
476
476
|
], q = Math.max(...M);
|
|
477
|
-
q > 0 && (u[x] && (u[x].style.height = `${q}px`),
|
|
477
|
+
q > 0 && (u[x] && (u[x].style.height = `${q}px`), m[x] && (m[x].style.height = `${q}px`), v[x] && (v[x].style.height = `${q}px`));
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
|
-
const r = t(this, w).querySelector(".ng-container-left .ng-part-footer table"),
|
|
481
|
-
if (
|
|
482
|
-
const u = r ? Array.from(r.querySelectorAll("tfoot tr")) : [],
|
|
480
|
+
const r = t(this, w).querySelector(".ng-container-left .ng-part-footer table"), o = t(this, w).querySelector(".ng-container-body .ng-part-footer table"), i = t(this, w).querySelector(".ng-container-right .ng-part-footer table");
|
|
481
|
+
if (o) {
|
|
482
|
+
const u = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], m = Array.from(o.querySelectorAll("tfoot tr")), v = i ? Array.from(i.querySelectorAll("tfoot tr")) : [], A = Math.max(u.length, m.length, v.length);
|
|
483
483
|
for (let x = 0; x < A; x++) {
|
|
484
484
|
const M = [
|
|
485
485
|
((f = u[x]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
486
|
-
((g =
|
|
486
|
+
((g = m[x]) == null ? void 0 : g.getBoundingClientRect().height) || 0,
|
|
487
487
|
((b = v[x]) == null ? void 0 : b.getBoundingClientRect().height) || 0
|
|
488
488
|
], q = Math.max(...M);
|
|
489
|
-
q > 0 && (u[x] && (u[x].style.height = `${q}px`),
|
|
489
|
+
q > 0 && (u[x] && (u[x].style.height = `${q}px`), m[x] && (m[x].style.height = `${q}px`), v[x] && (v[x].style.height = `${q}px`));
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
492
|
}, "#syncRowHeights"));
|
|
@@ -497,10 +497,10 @@ const Pe = class Pe {
|
|
|
497
497
|
if (!s.classList.contains("active")) continue;
|
|
498
498
|
const r = e.contentRect.height;
|
|
499
499
|
if (r > 0) {
|
|
500
|
-
let
|
|
501
|
-
const
|
|
502
|
-
|
|
503
|
-
const c = Math.max(r -
|
|
500
|
+
let o = 0;
|
|
501
|
+
const i = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
|
|
502
|
+
i && (o += i.offsetHeight), a && (o += a.offsetHeight);
|
|
503
|
+
const c = Math.max(r - o, 100);
|
|
504
504
|
t(this, st) !== c && (p(this, st, c), t(this, qt).call(this), t(this, _) !== null && (t(this, Tt).call(this), this.refresh()));
|
|
505
505
|
}
|
|
506
506
|
}
|
|
@@ -519,9 +519,9 @@ const Pe = class Pe {
|
|
|
519
519
|
if (!s) return;
|
|
520
520
|
const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
521
521
|
if (!r) return;
|
|
522
|
-
const
|
|
523
|
-
|
|
524
|
-
const b = n + Math.floor(g /
|
|
522
|
+
const o = Array.from(r.querySelectorAll("tr:not(.nodata)")), i = ((l = t(this, P).get(e)) == null ? void 0 : l.length) || 1, c = (t(this, D).data.get() || []).length;
|
|
523
|
+
o.forEach((f, g) => {
|
|
524
|
+
const b = n + Math.floor(g / i);
|
|
525
525
|
if (b >= c) {
|
|
526
526
|
f.style.visibility = "hidden";
|
|
527
527
|
return;
|
|
@@ -537,18 +537,18 @@ const Pe = class Pe {
|
|
|
537
537
|
if (!e || e <= 0) return;
|
|
538
538
|
const s = t(this, D).data.length;
|
|
539
539
|
if (s === 0) return;
|
|
540
|
-
const r = ((g = t(this, P).get(".ng-container-body")) == null ? void 0 : g.length) || 1,
|
|
541
|
-
T.log("bodyContainer.clientHeight",
|
|
542
|
-
const
|
|
540
|
+
const r = ((g = t(this, P).get(".ng-container-body")) == null ? void 0 : g.length) || 1, o = t(this, w).querySelector(".ng-container-body .ng-part-body");
|
|
541
|
+
T.log("bodyContainer.clientHeight", o.clientHeight);
|
|
542
|
+
const i = Math.max(0, s - Math.floor(o.clientHeight / e)), a = Math.min(i, Math.max(0, Math.floor(n / e)));
|
|
543
543
|
let c = Math.floor(a * e);
|
|
544
|
-
T.log(`📜 [Scroll Calc] maxStartIndex: ${
|
|
544
|
+
T.log(`📜 [Scroll Calc] maxStartIndex: ${i}, startIndex: ${a}, offsetY: ${c}`), a === i && T.log(`📜 [Scroll Inspect] scrollTop: ${n}, rowHeight: ${e}, maxStartIndex: ${i}, startIndex: ${a}, offsetY: ${c}`);
|
|
545
545
|
const l = t(this, et).firstTr, f = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
|
|
546
546
|
(b = t(this, et)) == null || b.scrollTables.forEach((u) => {
|
|
547
547
|
u.style.transform = `translate3d(0, ${c}px, 0)`;
|
|
548
548
|
}), f !== a && (T.log(`🔄 [Row Bind Trigger] currentStartIndex(${f}) !== startIndex(${a})`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((u) => {
|
|
549
|
-
const
|
|
550
|
-
if (!
|
|
551
|
-
const v =
|
|
549
|
+
const m = t(this, w).querySelector(u);
|
|
550
|
+
if (!m) return;
|
|
551
|
+
const v = m.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
552
552
|
if (!v) return;
|
|
553
553
|
Array.from(v.querySelectorAll("tr:not(.nodata)")).forEach((x, M) => {
|
|
554
554
|
const q = a + Math.floor(M / r);
|
|
@@ -576,10 +576,10 @@ const Pe = class Pe {
|
|
|
576
576
|
});
|
|
577
577
|
}; */
|
|
578
578
|
d(this, kt, /* @__PURE__ */ h((n, e, s) => {
|
|
579
|
-
n.dataset.row = s, n.data = e, Array.from(n.cells).forEach((r,
|
|
579
|
+
n.dataset.row = s, n.data = e, Array.from(n.cells).forEach((r, o) => {
|
|
580
580
|
r.dataset.row = s;
|
|
581
|
-
const
|
|
582
|
-
|
|
581
|
+
const i = Array.from(r.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
|
|
582
|
+
i && typeof i.refresh == "function" && i.refresh();
|
|
583
583
|
});
|
|
584
584
|
}, "#bindRowData"));
|
|
585
585
|
d(this, Yt, /* @__PURE__ */ h(() => {
|
|
@@ -587,14 +587,14 @@ const Pe = class Pe {
|
|
|
587
587
|
T.log("rowManager.#syncHeaderHeights");
|
|
588
588
|
const n = t(this, w).querySelector(".ng-container-left .ng-part-header table"), e = t(this, w).querySelector(".ng-container-body .ng-part-header table"), s = t(this, w).querySelector(".ng-container-right .ng-part-header table");
|
|
589
589
|
if (!e) return;
|
|
590
|
-
const r = n ? Array.from(n.querySelectorAll("tr")) : [],
|
|
590
|
+
const r = n ? Array.from(n.querySelectorAll("tr")) : [], o = Array.from(e.querySelectorAll("tr")), i = s ? Array.from(s.querySelectorAll("tr")) : [], a = Math.max(r.length, o.length, i.length);
|
|
591
591
|
for (let g = 0; g < a; g++) {
|
|
592
592
|
const b = [
|
|
593
593
|
((c = r[g]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
594
|
-
((l =
|
|
595
|
-
((f =
|
|
594
|
+
((l = o[g]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
595
|
+
((f = i[g]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
596
596
|
], u = Math.max(...b);
|
|
597
|
-
u > 0 && (r[g] && (r[g].style.height = `${u}px`),
|
|
597
|
+
u > 0 && (r[g] && (r[g].style.height = `${u}px`), o[g] && (o[g].style.height = `${u}px`), i[g] && (i[g].style.height = `${u}px`));
|
|
598
598
|
}
|
|
599
599
|
}, "#syncHeaderHeights"));
|
|
600
600
|
E(this, "destroy", /* @__PURE__ */ h(() => {
|
|
@@ -629,9 +629,9 @@ const Ut = class Ut {
|
|
|
629
629
|
const f = l.getAttribute("cell-type") || "renderer";
|
|
630
630
|
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
631
631
|
let g = `cell-${f}`;
|
|
632
|
-
const b = l.getAttribute("data-bind"), u = l.getAttribute("data-expr"),
|
|
632
|
+
const b = l.getAttribute("data-bind"), u = l.getAttribute("data-expr"), m = l.getAttribute("maxbyte"), v = l.getAttribute("type");
|
|
633
633
|
let A = [];
|
|
634
|
-
b && A.push(`data-bind="${b}"`), u && A.push(`data-expr="${u}"`),
|
|
634
|
+
b && A.push(`data-bind="${b}"`), u && A.push(`data-expr="${u}"`), m && A.push(`maxbyte="${m}"`), v && A.push(`type="${v}"`), l.innerHTML = `<${g} ${A.join(" ")}></${g}>`;
|
|
635
635
|
});
|
|
636
636
|
}, "processCellTypes"), s = /* @__PURE__ */ h((a) => {
|
|
637
637
|
if (!a.querySelector("colgroup")) {
|
|
@@ -651,14 +651,14 @@ const Ut = class Ut {
|
|
|
651
651
|
const l = Array.from(a.querySelectorAll(c + " tr")), f = Array.from(a.querySelectorAll(c + " th," + c + " td")), g = l.length;
|
|
652
652
|
if (g === 0 || f.length === 0) return;
|
|
653
653
|
let b = 0;
|
|
654
|
-
f.forEach((
|
|
655
|
-
b +=
|
|
654
|
+
f.forEach((m) => {
|
|
655
|
+
b += m.colSpan || 1;
|
|
656
656
|
});
|
|
657
657
|
const u = Array.from(Array(g), () => Array(b).fill(null));
|
|
658
|
-
l.forEach((
|
|
659
|
-
const v =
|
|
658
|
+
l.forEach((m) => {
|
|
659
|
+
const v = m.sectionRowIndex;
|
|
660
660
|
let A = 0;
|
|
661
|
-
Array.from(
|
|
661
|
+
Array.from(m.querySelectorAll("th,td")).forEach((x) => {
|
|
662
662
|
for (let W = 0; W < u[v].length; W++)
|
|
663
663
|
if (u[v][W] === null) {
|
|
664
664
|
A = W;
|
|
@@ -669,9 +669,9 @@ const Ut = class Ut {
|
|
|
669
669
|
for (let F = 0; F < q; F++)
|
|
670
670
|
v + W < g && A + F < b && (u[v + W][A + F] = W === 0 && F === 0 ? "1" : "0");
|
|
671
671
|
});
|
|
672
|
-
}), l.forEach((
|
|
673
|
-
const v =
|
|
674
|
-
Array.from(
|
|
672
|
+
}), l.forEach((m) => {
|
|
673
|
+
const v = m.sectionRowIndex;
|
|
674
|
+
Array.from(m.querySelectorAll("th,td")).forEach((A) => {
|
|
675
675
|
for (let x = 0; x < u[v].length; x++)
|
|
676
676
|
if (u[v][x] === "1") {
|
|
677
677
|
A.dataset.col = x, u[v][x] = "0";
|
|
@@ -679,13 +679,13 @@ const Ut = class Ut {
|
|
|
679
679
|
}
|
|
680
680
|
});
|
|
681
681
|
});
|
|
682
|
-
}, "resetColIndex"),
|
|
683
|
-
return s(
|
|
682
|
+
}, "resetColIndex"), o = n.cloneNode(!0);
|
|
683
|
+
return s(o), e(o), r(o, "thead"), r(o, "tbody"), r(o, "tfoot"), Array.from(o.querySelectorAll("colgroup col")).forEach((a, c) => {
|
|
684
684
|
const l = a.getAttribute("fixed");
|
|
685
|
-
l &&
|
|
685
|
+
l && o.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((f) => {
|
|
686
686
|
f.setAttribute("fixed", l);
|
|
687
687
|
});
|
|
688
|
-
}),
|
|
688
|
+
}), o;
|
|
689
689
|
}
|
|
690
690
|
// 🎯 [추가] td/th에 선언된 cell-type 속성을 읽어 커스텀 태그로 자동 감싸기
|
|
691
691
|
};
|
|
@@ -699,34 +699,29 @@ const De = class De {
|
|
|
699
699
|
d(this, Ct, { startRow: -1, startCol: -1, endRow: -1, endCol: -1 });
|
|
700
700
|
// 3. 뷰 렌더링 (9분할 전체를 순회하며 경계선 클래스 부여)
|
|
701
701
|
E(this, "render", /* @__PURE__ */ h(() => {
|
|
702
|
-
const { startRow: n, startCol: e, endRow: s, endCol: r } = t(this, Ct);
|
|
703
|
-
|
|
704
|
-
"
|
|
705
|
-
).forEach((
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
if (isNaN(f)) return;
|
|
713
|
-
const g = parseInt(l.rowSpan || 1, 10), b = parseInt(l.colSpan || 1, 10), u = c + g - 1, y = f + b - 1;
|
|
714
|
-
c <= s && u >= n && f <= r && y >= e && (l.classList.add("selected"), c === n && l.classList.add("selected-top"), u === s && l.classList.add("selected-bottom"), f === e && l.classList.add("selected-left"), y === r && l.classList.add("selected-right"));
|
|
715
|
-
});
|
|
716
|
-
});
|
|
702
|
+
const { startRow: n, startCol: e, endRow: s, endCol: r } = t(this, Ct), o = t(this, Y).querySelectorAll(".ng-container-top td, .ng-container-top th");
|
|
703
|
+
o.forEach((i) => {
|
|
704
|
+
i.classList.remove("selected", "selected-top", "selected-bottom", "selected-left", "selected-right");
|
|
705
|
+
}), !(n < 0 || e < 0) && o.forEach((i) => {
|
|
706
|
+
const a = i.closest("tr");
|
|
707
|
+
if (!a || a.classList.contains("nodata")) return;
|
|
708
|
+
const c = parseInt(a.dataset.row, 10), l = parseInt(i.dataset.col, 10);
|
|
709
|
+
if (isNaN(c) || isNaN(l)) return;
|
|
710
|
+
const f = parseInt(i.rowSpan || 1, 10), g = parseInt(i.colSpan || 1, 10), b = c + f - 1, u = l + g - 1;
|
|
711
|
+
c <= s && b >= n && l <= r && u >= e && (i.classList.add("selected"), c === n && i.classList.add("selected-top"), b === s && i.classList.add("selected-bottom"), l === e && i.classList.add("selected-left"), u === r && i.classList.add("selected-right"));
|
|
717
712
|
});
|
|
718
713
|
}, "render"));
|
|
719
714
|
p(this, Y, n), de(this, mt, is).call(this);
|
|
720
715
|
}
|
|
721
716
|
setRange(n, e, s, r) {
|
|
722
|
-
let
|
|
723
|
-
const l = de(this, mt, rs).call(this,
|
|
717
|
+
let o = Math.min(n, s), i = Math.max(n, s), a = Math.min(e, r), c = Math.max(e, r);
|
|
718
|
+
const l = de(this, mt, rs).call(this, o, a, i, c);
|
|
724
719
|
p(this, Ct, l), this.render();
|
|
725
720
|
}
|
|
726
721
|
};
|
|
727
722
|
Y = new WeakMap(), Ct = new WeakMap(), mt = new WeakSet(), // 머지된 셀이 선택 영역에 걸쳐있으면 범위를 자동으로 넓혀주는 보정기
|
|
728
723
|
rs = /* @__PURE__ */ h(function(n, e, s, r) {
|
|
729
|
-
let
|
|
724
|
+
let o = n, i = e, a = s, c = r, l = !0;
|
|
730
725
|
const f = t(this, Y).querySelectorAll(
|
|
731
726
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
732
727
|
);
|
|
@@ -734,34 +729,35 @@ rs = /* @__PURE__ */ h(function(n, e, s, r) {
|
|
|
734
729
|
l = !1, f.forEach((g) => {
|
|
735
730
|
g.querySelectorAll("tbody tr").forEach((b) => {
|
|
736
731
|
const u = parseInt(b.dataset.row, 10);
|
|
737
|
-
isNaN(u) || b.querySelectorAll("td, th").forEach((
|
|
738
|
-
const v = parseInt(
|
|
732
|
+
isNaN(u) || b.querySelectorAll("td, th").forEach((m) => {
|
|
733
|
+
const v = parseInt(m.dataset.col, 10);
|
|
739
734
|
if (isNaN(v)) return;
|
|
740
|
-
const A = parseInt(
|
|
741
|
-
if (u <= a && M >=
|
|
742
|
-
const F = Math.min(
|
|
743
|
-
(F !==
|
|
735
|
+
const A = parseInt(m.rowSpan || 1, 10), x = parseInt(m.colSpan || 1, 10), M = u + A - 1, q = v + x - 1;
|
|
736
|
+
if (u <= a && M >= o && v <= c && q >= i) {
|
|
737
|
+
const F = Math.min(o, u), Je = Math.max(a, M), Qe = Math.min(i, v), ts = Math.max(c, q);
|
|
738
|
+
(F !== o || Je !== a || Qe !== i || ts !== c) && (o = F, a = Je, i = Qe, c = ts, l = !0);
|
|
744
739
|
}
|
|
745
740
|
});
|
|
746
741
|
});
|
|
747
742
|
});
|
|
748
|
-
return { startRow:
|
|
743
|
+
return { startRow: o, startCol: i, endRow: a, endCol: c };
|
|
749
744
|
}, "#expandRangeByMerge"), is = /* @__PURE__ */ h(function() {
|
|
750
745
|
const n = t(this, Y).querySelector(".ng-container-top");
|
|
751
746
|
n && n.addEventListener("mousedown", (e) => {
|
|
747
|
+
if (e.button !== 0) return;
|
|
752
748
|
const s = e.target.closest("td, th");
|
|
753
749
|
if (!s || s.dataset.row === void 0 || s.dataset.col === void 0 || s.closest("tr").classList.contains("nodata")) return;
|
|
754
|
-
const r = parseInt(s.dataset.row, 10),
|
|
755
|
-
this.setRange(r,
|
|
756
|
-
const
|
|
750
|
+
const r = parseInt(s.dataset.row, 10), o = parseInt(s.dataset.col, 10);
|
|
751
|
+
this.setRange(r, o, r, o);
|
|
752
|
+
const i = /* @__PURE__ */ h((c) => {
|
|
757
753
|
const l = document.elementFromPoint(c.clientX, c.clientY), f = l == null ? void 0 : l.closest("td, th");
|
|
758
754
|
if (!f || !t(this, Y).contains(f) || f.dataset.row === void 0 || f.dataset.col === void 0 || f.closest("tr").classList.contains("nodata")) return;
|
|
759
755
|
const g = parseInt(f.dataset.row, 10), b = parseInt(f.dataset.col, 10);
|
|
760
|
-
this.setRange(r,
|
|
756
|
+
this.setRange(r, o, g, b);
|
|
761
757
|
}, "onMouseMove"), a = /* @__PURE__ */ h(() => {
|
|
762
|
-
document.removeEventListener("mousemove",
|
|
758
|
+
document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", a);
|
|
763
759
|
}, "onMouseUp");
|
|
764
|
-
document.addEventListener("mousemove",
|
|
760
|
+
document.addEventListener("mousemove", i), document.addEventListener("mouseup", a);
|
|
765
761
|
});
|
|
766
762
|
}, "#initEvents"), h(De, "CellSelection");
|
|
767
763
|
let ye = De;
|
|
@@ -779,10 +775,10 @@ const xt = class xt extends HTMLElement {
|
|
|
779
775
|
E(this, "generate", /* @__PURE__ */ h((e) => {
|
|
780
776
|
if (T.log("sheet.generate()"), !e) return;
|
|
781
777
|
p(this, nt, pe.compile(e)), t(this, Kt).call(this), t(this, Zt).call(this);
|
|
782
|
-
const s = this.querySelector(".ng-container-body .ng-part-header"), r = this.querySelector(".ng-container-body .ng-part-footer"),
|
|
783
|
-
s &&
|
|
784
|
-
var
|
|
785
|
-
(
|
|
778
|
+
const s = this.querySelector(".ng-container-body .ng-part-header"), r = this.querySelector(".ng-container-body .ng-part-footer"), o = this.querySelector(".ng-nodata-overlay");
|
|
779
|
+
s && o && (o.style.top = `${s.offsetHeight}px`), r && o && (o.style.bottom = `${r.offsetHeight}px`), t(this, rt).initialize(), setTimeout(() => {
|
|
780
|
+
var i;
|
|
781
|
+
(i = this.querySelector("nine-table-hscrollbar")) == null || i.refresh();
|
|
786
782
|
}, 0);
|
|
787
783
|
}, "generate"));
|
|
788
784
|
d(this, Kt, /* @__PURE__ */ h(() => {
|
|
@@ -791,36 +787,36 @@ const xt = class xt extends HTMLElement {
|
|
|
791
787
|
{ selector: ".ng-container-left", type: "left" },
|
|
792
788
|
{ selector: ".ng-container-right", type: "right" }
|
|
793
789
|
].forEach(({ selector: s, type: r }) => {
|
|
794
|
-
var
|
|
795
|
-
(
|
|
790
|
+
var o, i, a;
|
|
791
|
+
(o = this.querySelector(`${s} .ng-part-header`)) == null || o.appendChild(t(this, dt).call(this, t(this, nt), r, "header")), (i = this.querySelector(`${s} .ng-virtual-spacer`)) == null || i.before(t(this, dt).call(this, t(this, nt), r, "body")), (a = this.querySelector(`${s} .ng-part-footer`)) == null || a.appendChild(t(this, dt).call(this, t(this, nt), r, "footer"));
|
|
796
792
|
});
|
|
797
793
|
}, "#renderSplitContainers"));
|
|
798
794
|
d(this, Zt, /* @__PURE__ */ h(() => {
|
|
799
795
|
["left", "right", "body"].forEach((e) => {
|
|
800
796
|
const s = this.querySelector(`.ng-container-${e}`), r = s == null ? void 0 : s.querySelectorAll("table");
|
|
801
797
|
if (!s || !r || r.length === 0) return;
|
|
802
|
-
let
|
|
803
|
-
r[0].querySelectorAll("col").forEach((
|
|
804
|
-
const a = parseInt(
|
|
805
|
-
isNaN(
|
|
806
|
-
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${
|
|
798
|
+
let o = 0;
|
|
799
|
+
r[0].querySelectorAll("col").forEach((i) => {
|
|
800
|
+
const a = parseInt(i.getAttribute("width"), 10);
|
|
801
|
+
isNaN(o) || (o += a);
|
|
802
|
+
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${o}px`, s.style.width = `${o}px`);
|
|
807
803
|
});
|
|
808
804
|
}, "#updateContainerWidths"));
|
|
809
805
|
d(this, dt, /* @__PURE__ */ h((e, s, r) => {
|
|
810
|
-
const
|
|
806
|
+
const o = e.cloneNode(!0), i = o.querySelector("thead"), a = o.querySelector("tbody"), c = o.querySelector("tfoot");
|
|
811
807
|
if (r === "header") {
|
|
812
808
|
if (a && a.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
813
809
|
const f = document.createElement("tbody");
|
|
814
|
-
f.className = "fixed-tbody",
|
|
810
|
+
f.className = "fixed-tbody", o.appendChild(f);
|
|
815
811
|
}
|
|
816
|
-
} else r === "body" ? (
|
|
817
|
-
return s === "left" ?
|
|
812
|
+
} else r === "body" ? (i && i.remove(), c && c.remove(), a && (a.className = "bindable-tbody")) : r === "footer" && (i && i.remove(), a && a.remove());
|
|
813
|
+
return s === "left" ? o.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
818
814
|
l.getAttribute("fixed") !== "left" && l.remove();
|
|
819
|
-
}) : s === "right" ?
|
|
815
|
+
}) : s === "right" ? o.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
820
816
|
l.getAttribute("fixed") !== "right" && l.remove();
|
|
821
|
-
}) :
|
|
817
|
+
}) : o.querySelectorAll("[fixed=left], [fixed=right]").forEach((l) => {
|
|
822
818
|
l.remove();
|
|
823
|
-
}),
|
|
819
|
+
}), o;
|
|
824
820
|
}, "#createSplitTable"));
|
|
825
821
|
E(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, rt).getRowHeight(), "getRowHeight"));
|
|
826
822
|
E(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
@@ -1057,9 +1053,9 @@ const Fe = class Fe extends HTMLElement {
|
|
|
1057
1053
|
d(this, Qt, /* @__PURE__ */ h(() => {
|
|
1058
1054
|
var e;
|
|
1059
1055
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
1060
|
-
var
|
|
1061
|
-
const r = s.ctrlKey || s.metaKey || s.shiftKey,
|
|
1062
|
-
t(this, Ht).call(this,
|
|
1056
|
+
var i;
|
|
1057
|
+
const r = s.ctrlKey || s.metaKey || s.shiftKey, o = parseInt((i = s.target.closest(".nine-tab-item")) == null ? void 0 : i.dataset.index, 10);
|
|
1058
|
+
t(this, Ht).call(this, o, r);
|
|
1063
1059
|
}), t(this, Ht).call(this, 0, !1);
|
|
1064
1060
|
}, "#init"));
|
|
1065
1061
|
d(this, Ht, /* @__PURE__ */ h((e, s = !1) => {
|
|
@@ -1068,10 +1064,10 @@ const Fe = class Fe extends HTMLElement {
|
|
|
1068
1064
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((u) => u.style.setProperty("display", "none"));
|
|
1069
1065
|
const b = f.filter((u) => u.classList.contains("active"));
|
|
1070
1066
|
b.length < 2 || b.forEach((u) => {
|
|
1071
|
-
const
|
|
1067
|
+
const m = parseInt(u.getAttribute("data-index"), 10), v = this.querySelector(`nine-splitter[data-split-index="${m}"]`), A = f[m + 1];
|
|
1072
1068
|
v && A && A.classList.contains("active") && v.style.setProperty("display", "flex");
|
|
1073
1069
|
});
|
|
1074
|
-
}, "updateSplitters"),
|
|
1070
|
+
}, "updateSplitters"), o = this.querySelector(".nine-tab-bar"), i = this.querySelector("nine-table-sheets-body"), a = o.querySelectorAll(".nine-tab-item"), c = i.querySelectorAll("nine-table-sheet");
|
|
1075
1071
|
if (!a[e]) return;
|
|
1076
1072
|
if (!s)
|
|
1077
1073
|
a.forEach((f, g) => {
|
|
@@ -1081,14 +1077,14 @@ const Fe = class Fe extends HTMLElement {
|
|
|
1081
1077
|
f.classList.toggle("active", b), f.style.flex = b ? "1 1 100%" : "";
|
|
1082
1078
|
});
|
|
1083
1079
|
else {
|
|
1084
|
-
const f = a[e], g =
|
|
1080
|
+
const f = a[e], g = o.querySelectorAll(".nine-tab-item.active");
|
|
1085
1081
|
if (f.classList.contains("active") && g.length <= 1)
|
|
1086
1082
|
return;
|
|
1087
1083
|
f.classList.toggle("active");
|
|
1088
|
-
const b =
|
|
1084
|
+
const b = i.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
1089
1085
|
b && (b.classList.toggle("active"), b.classList.contains("active") || (b.style.flex = ""));
|
|
1090
1086
|
}
|
|
1091
|
-
const l =
|
|
1087
|
+
const l = i.querySelectorAll("nine-table-sheet.active");
|
|
1092
1088
|
l == null || l.forEach((f) => {
|
|
1093
1089
|
f.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
1094
1090
|
}), r();
|
|
@@ -1115,14 +1111,14 @@ const je = class je {
|
|
|
1115
1111
|
var c, l;
|
|
1116
1112
|
const n = Array.from(t(this, I).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
1117
1113
|
if (n.length === 0) return;
|
|
1118
|
-
const e = parseInt(t(this, I).getAttribute("max-display-row"), 10) || 10, s = Math.max(...n.map((f) => f.getRowHeight())), r = (c = t(this, I).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height,
|
|
1114
|
+
const e = parseInt(t(this, I).getAttribute("max-display-row"), 10) || 10, s = Math.max(...n.map((f) => f.getRowHeight())), r = (c = t(this, I).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, o = (l = t(this, I).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, i = Wt.SCROLLBAR_SIZE, a = e * s + r + o + i;
|
|
1119
1115
|
t(this, I).style.height = `${a}px`;
|
|
1120
1116
|
}, "#applyAutoHeight"));
|
|
1121
1117
|
d(this, ee, /* @__PURE__ */ h(() => {
|
|
1122
|
-
const e = Array.from(t(this, I).children).filter((c) => c.tagName === "TABLE"), s = t(this, I).getAttribute("auto-height") === "true", r = e.length,
|
|
1118
|
+
const e = Array.from(t(this, I).children).filter((c) => c.tagName === "TABLE"), s = t(this, I).getAttribute("auto-height") === "true", r = e.length, o = e.map((c, l) => {
|
|
1123
1119
|
const g = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, b = l < r - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
1124
1120
|
return g + b;
|
|
1125
|
-
}).join(""),
|
|
1121
|
+
}).join(""), i = e.map((c, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
1126
1122
|
t(this, I).shadowRoot.innerHTML = `
|
|
1127
1123
|
<style>
|
|
1128
1124
|
:host {
|
|
@@ -1234,9 +1230,9 @@ const je = class je {
|
|
|
1234
1230
|
<nine-table-body>
|
|
1235
1231
|
<nine-table-summary></nine-table-summary>
|
|
1236
1232
|
<nine-table-sheets>
|
|
1237
|
-
<nine-table-sheets-body>${
|
|
1233
|
+
<nine-table-sheets-body>${o}</nine-table-sheets-body>
|
|
1238
1234
|
<nine-table-sheets-footer>
|
|
1239
|
-
<div class="nine-tab-bar">${
|
|
1235
|
+
<div class="nine-tab-bar">${i}</div>
|
|
1240
1236
|
<div class="sheets-counter">Total : <span id="row-count">0</span></div>
|
|
1241
1237
|
</nine-table-sheets-footer>
|
|
1242
1238
|
</nine-table-sheets>
|
|
@@ -1300,15 +1296,15 @@ const O = class O {
|
|
|
1300
1296
|
});
|
|
1301
1297
|
}, "#invalidate"));
|
|
1302
1298
|
E(this, "get", /* @__PURE__ */ h((n, e) => {
|
|
1303
|
-
var
|
|
1299
|
+
var o;
|
|
1304
1300
|
const s = this.getValidData();
|
|
1305
1301
|
if (!s || s.length <= 0) return;
|
|
1306
1302
|
if (n == null) return t(this, gt).call(this, s);
|
|
1307
1303
|
if (n < 0 || n >= s.length) return null;
|
|
1308
|
-
const r = typeof ((
|
|
1304
|
+
const r = typeof ((o = t(this, N).fields) == null ? void 0 : o.get) == "function" ? t(this, N).fields.get() : [];
|
|
1309
1305
|
if (e != null) {
|
|
1310
|
-
const
|
|
1311
|
-
return
|
|
1306
|
+
const i = r.indexOf(e);
|
|
1307
|
+
return i >= 0 ? s[n].v[i] : null;
|
|
1312
1308
|
}
|
|
1313
1309
|
return t(this, gt).call(this, s[n]);
|
|
1314
1310
|
}, "get"));
|
|
@@ -1335,11 +1331,11 @@ const O = class O {
|
|
|
1335
1331
|
var r;
|
|
1336
1332
|
Array.isArray(n) || (n = [n]);
|
|
1337
1333
|
const e = typeof ((r = t(this, N).fields) == null ? void 0 : r.get) == "function" ? t(this, N).fields.get() : Object.keys(n[0] || {}), s = [];
|
|
1338
|
-
return n.forEach((
|
|
1339
|
-
const
|
|
1334
|
+
return n.forEach((o) => {
|
|
1335
|
+
const i = { v: [] };
|
|
1340
1336
|
e.forEach((a) => {
|
|
1341
|
-
|
|
1342
|
-
}), s.push(
|
|
1337
|
+
i.v.push(o[a] !== void 0 && o[a] !== null ? o[a] : "");
|
|
1338
|
+
}), s.push(i);
|
|
1343
1339
|
}), s;
|
|
1344
1340
|
}, "#json2Array"));
|
|
1345
1341
|
d(this, ie, /* @__PURE__ */ h((n) => (Array.isArray(n) || (n = [n]), n.forEach((e) => {
|
|
@@ -1350,8 +1346,8 @@ const O = class O {
|
|
|
1350
1346
|
const s = t(this, re).call(this, n);
|
|
1351
1347
|
t(this, C).rawRecords = t(this, C).rawRecords.concat(t(this, ie).call(this, s)), this.resetRecords();
|
|
1352
1348
|
const r = this.count() - 1;
|
|
1353
|
-
return e || s.forEach((
|
|
1354
|
-
const a = t(this, C).rawRecords[r -
|
|
1349
|
+
return e || s.forEach((o, i) => {
|
|
1350
|
+
const a = t(this, C).rawRecords[r - i];
|
|
1355
1351
|
a && (a.__ng.rowState = O.ROW_STATE.EMPTY);
|
|
1356
1352
|
}), t(this, it).call(this), r;
|
|
1357
1353
|
}, "add"));
|
|
@@ -1360,8 +1356,8 @@ const O = class O {
|
|
|
1360
1356
|
Array.isArray(n) ? e = n : typeof n > "u" ? e = [t(this, C).host.row.at] : e = [parseInt(n, 10)], e.sort((s, r) => r - s).forEach((s) => {
|
|
1361
1357
|
if (t(this, z)[s]) {
|
|
1362
1358
|
const r = t(this, z)[s].__ng.rowid;
|
|
1363
|
-
t(this, z)[s].__ng.rowState === O.ROW_STATE.INSERT ? t(this, C).rawRecords = t(this, C).rawRecords.filter((
|
|
1364
|
-
|
|
1359
|
+
t(this, z)[s].__ng.rowState === O.ROW_STATE.INSERT ? t(this, C).rawRecords = t(this, C).rawRecords.filter((o) => o.__ng.rowid !== r) : t(this, C).rawRecords.forEach((o) => {
|
|
1360
|
+
o.__ng.rowid === r && (o.__ng.deleted = !0, o.__ng.rowState = O.ROW_STATE.DELETE);
|
|
1365
1361
|
});
|
|
1366
1362
|
}
|
|
1367
1363
|
}), this.resetRecords(), t(this, it).call(this);
|
|
@@ -1369,12 +1365,12 @@ const O = class O {
|
|
|
1369
1365
|
E(this, "setValue", /* @__PURE__ */ h((n, e, s) => {
|
|
1370
1366
|
var c;
|
|
1371
1367
|
n = parseInt(n, 10);
|
|
1372
|
-
const
|
|
1373
|
-
if (
|
|
1374
|
-
const
|
|
1375
|
-
if (!
|
|
1376
|
-
const a =
|
|
1377
|
-
a !== s &&
|
|
1368
|
+
const o = (typeof ((c = t(this, N).fields) == null ? void 0 : c.get) == "function" ? t(this, N).fields.get() : []).indexOf(e);
|
|
1369
|
+
if (o < 0) return;
|
|
1370
|
+
const i = this.getValidData()[n];
|
|
1371
|
+
if (!i) return;
|
|
1372
|
+
const a = i.v[o];
|
|
1373
|
+
a !== s && i.__ng.rowState !== O.ROW_STATE.INSERT && (i.__ng.o.hasOwnProperty(e) || (i.__ng.o[e] = a), i.__ng.rowState = O.ROW_STATE.UPDATE), i.v[o] = s;
|
|
1378
1374
|
}, "setValue"));
|
|
1379
1375
|
E(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1380
1376
|
p(this, ut, t(this, C).rawRecords.filter((n) => !n.__ng.deleted)), p(this, z, t(this, C).rawRecords.filter((n) => !n.__ng.deleted && !n.__ng.filtered)), t(this, C).rawRecords.forEach((n, e) => {
|
|
@@ -1385,15 +1381,15 @@ const O = class O {
|
|
|
1385
1381
|
}, "resetRecords"));
|
|
1386
1382
|
E(this, "getValidData", /* @__PURE__ */ h(() => (t(this, z).length === 0 && t(this, C).rawRecords.length > 0 && this.resetRecords(), t(this, z)), "getValidData"));
|
|
1387
1383
|
d(this, gt, /* @__PURE__ */ h((n) => {
|
|
1388
|
-
var
|
|
1384
|
+
var i;
|
|
1389
1385
|
if (!n) return n;
|
|
1390
|
-
const e = !Array.isArray(n), s = e ? [n] : n, r = typeof ((
|
|
1386
|
+
const e = !Array.isArray(n), s = e ? [n] : n, r = typeof ((i = t(this, N).fields) == null ? void 0 : i.get) == "function" ? t(this, N).fields.get() : [], o = s.filter((a) => !a.__ng.deleted).map((a) => {
|
|
1391
1387
|
const c = {};
|
|
1392
1388
|
return r.forEach((l, f) => {
|
|
1393
1389
|
c[l] = a.v ? a.v[f] : a[l];
|
|
1394
1390
|
}), c.__ng = a.__ng, c;
|
|
1395
1391
|
});
|
|
1396
|
-
return e ?
|
|
1392
|
+
return e ? o[0] : o;
|
|
1397
1393
|
}, "#conv"));
|
|
1398
1394
|
E(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1399
1395
|
p(this, N, n), p(this, C, e), t(this, ne).call(this);
|
|
@@ -1436,10 +1432,10 @@ const Ye = class Ye {
|
|
|
1436
1432
|
}, this.setDataSource = (e) => {
|
|
1437
1433
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1438
1434
|
}, this.getRowState = (e) => {
|
|
1439
|
-
var r,
|
|
1435
|
+
var r, o;
|
|
1440
1436
|
const s = parseInt(e, 10);
|
|
1441
1437
|
if (!(s >= this.data.count()))
|
|
1442
|
-
return (
|
|
1438
|
+
return (o = (r = this.data.getValidData()[s]) == null ? void 0 : r.__ng) == null ? void 0 : o.rowState;
|
|
1443
1439
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1444
1440
|
this.row.at = e;
|
|
1445
1441
|
}, this.scrollTo_V1 = (e) => (e < 0 && (e = 0), e >= this.rawRecords.length && (e = this.rawRecords.length - 1), this.viewRecords.rawIndex = e, this.viewRecords.reset && this.viewRecords.reset(), !(e <= 0 || e >= this.rawRecords.length - 1)), this.getColumn = (e, s) => this.data.get(e, s), this.setColumn = (e, s, r) => {
|
|
@@ -1472,25 +1468,25 @@ const Ue = class Ue {
|
|
|
1472
1468
|
if (!(!n || n.length === 0)) {
|
|
1473
1469
|
for (const e of n)
|
|
1474
1470
|
T.log(e), $("[data-bind]", e).each((s, r) => {
|
|
1475
|
-
const
|
|
1476
|
-
|
|
1471
|
+
const o = r.dataset.bind, i = r.getAttribute("data-type") || "string";
|
|
1472
|
+
o && t(this, H).push({ name: o, type: i });
|
|
1477
1473
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
1478
|
-
$(`[${s}]`, e).each((r,
|
|
1479
|
-
var
|
|
1480
|
-
if (
|
|
1481
|
-
const a =
|
|
1474
|
+
$(`[${s}]`, e).each((r, o) => {
|
|
1475
|
+
var i = o.getAttribute(s);
|
|
1476
|
+
if (i.indexOf("data.") < 0) {
|
|
1477
|
+
const a = i.search(/[(]/g);
|
|
1482
1478
|
if (a > 0)
|
|
1483
1479
|
try {
|
|
1484
|
-
|
|
1480
|
+
i = String(window[i.substring(0, a).trim()]);
|
|
1485
1481
|
} catch {
|
|
1486
|
-
|
|
1482
|
+
i = "";
|
|
1487
1483
|
}
|
|
1488
1484
|
}
|
|
1489
|
-
|
|
1485
|
+
i.split("data.").forEach((a) => {
|
|
1490
1486
|
if (a.trim() != "") {
|
|
1491
1487
|
const c = a.search(/[^_A-Za-z0-9]/g);
|
|
1492
1488
|
let l = "";
|
|
1493
|
-
c >= 0 ? l = a.substring(0, c) :
|
|
1489
|
+
c >= 0 ? l = a.substring(0, c) : i.startsWith("data.") && (l = a.replace("data.", "")), l && t(this, H).push({ name: l, type: "string" });
|
|
1494
1490
|
}
|
|
1495
1491
|
});
|
|
1496
1492
|
});
|
|
@@ -1569,72 +1565,72 @@ const vt = class vt extends HTMLElement {
|
|
|
1569
1565
|
};
|
|
1570
1566
|
h(vt, "BasicCellElement"), E(vt, "_styleCache", /* @__PURE__ */ new Map()), E(vt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1571
1567
|
let Re = vt;
|
|
1572
|
-
var L, Nt,
|
|
1568
|
+
var L, Nt, y, Me, Ie, $e, _e, Ne;
|
|
1573
1569
|
const Ke = class Ke extends Re {
|
|
1574
1570
|
constructor() {
|
|
1575
1571
|
super();
|
|
1576
1572
|
d(this, L);
|
|
1577
1573
|
d(this, Nt);
|
|
1578
|
-
d(this,
|
|
1574
|
+
d(this, y);
|
|
1579
1575
|
d(this, Me);
|
|
1580
1576
|
d(this, Ie);
|
|
1581
1577
|
d(this, $e);
|
|
1582
1578
|
d(this, _e);
|
|
1583
1579
|
E(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1584
|
-
if (t(this,
|
|
1585
|
-
if (t(this,
|
|
1586
|
-
const s = t(this,
|
|
1580
|
+
if (t(this, y))
|
|
1581
|
+
if (t(this, y).closest("tbody")) {
|
|
1582
|
+
const s = t(this, y).closest("tr").data, r = parseInt(t(this, y).dataset.row);
|
|
1587
1583
|
if (!s) return "";
|
|
1588
|
-
if (ninegrid.isNull(t(this,
|
|
1589
|
-
if (!ninegrid.isNull(t(this,
|
|
1590
|
-
return s[t(this,
|
|
1584
|
+
if (ninegrid.isNull(t(this, y).dataset.expr)) {
|
|
1585
|
+
if (!ninegrid.isNull(t(this, y).dataset.bind))
|
|
1586
|
+
return s[t(this, y).dataset.bind] || ninegrid.nvl(e, "");
|
|
1591
1587
|
} else try {
|
|
1592
|
-
return this.getExprValue(t(this,
|
|
1588
|
+
return this.getExprValue(t(this, y).dataset.expr, s, r, t(this, y));
|
|
1593
1589
|
} catch {
|
|
1594
|
-
console.error(t(this,
|
|
1590
|
+
console.error(t(this, y).dataset.expr, s, t(this, y).dataset.row);
|
|
1595
1591
|
}
|
|
1596
1592
|
return ninegrid.nvl(e, "");
|
|
1597
1593
|
} else
|
|
1598
1594
|
try {
|
|
1599
|
-
return t(this, L).exprFunction(t(this,
|
|
1595
|
+
return t(this, L).exprFunction(t(this, y).dataset.expr).call(this, null, -1, t(this, L).data);
|
|
1600
1596
|
} catch {
|
|
1601
1597
|
}
|
|
1602
1598
|
}, "getDisplayText"));
|
|
1603
1599
|
d(this, Ne, /* @__PURE__ */ h(() => {
|
|
1604
|
-
if (!(!t(this, L) || !t(this, L).template || !t(this,
|
|
1605
|
-
var e = ninegrid.j.querySelectorAll(t(this,
|
|
1600
|
+
if (!(!t(this, L) || !t(this, L).template || !t(this, y).closest("tbody.bindable"))) {
|
|
1601
|
+
var e = ninegrid.j.querySelectorAll(t(this, y)).attr("suppress");
|
|
1606
1602
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1607
|
-
var s = t(this,
|
|
1603
|
+
var s = t(this, y).closest("tr"), r = [];
|
|
1608
1604
|
$("th,td", s).each((x, M) => {
|
|
1609
1605
|
var q = ninegrid.j.querySelectorAll(M).attr("suppress");
|
|
1610
1606
|
q && M.dataset.row && (q = parseInt(q), !isNaN(q) && q <= e && r.push(q));
|
|
1611
1607
|
}), r.sort();
|
|
1612
|
-
var
|
|
1608
|
+
var o = !1;
|
|
1613
1609
|
if (parseInt(s.sectionRowIndex / t(this, L).template.length) > 0)
|
|
1614
|
-
for (var
|
|
1615
|
-
if (
|
|
1616
|
-
var a = parseInt(t(this,
|
|
1617
|
-
t(this,
|
|
1618
|
-
var g = t(this, L).body.querySelector(`tbody.bindable [suppress="${
|
|
1610
|
+
for (var i of r) {
|
|
1611
|
+
if (i > e) break;
|
|
1612
|
+
var a = parseInt(t(this, y).dataset.row), c = a - 1, l = t(this, y).closest("tr").data, f = t(this, L).data.get(c);
|
|
1613
|
+
t(this, y).dataset.matrixRow;
|
|
1614
|
+
var g = t(this, L).body.querySelector(`tbody.bindable [suppress="${i}"][data-matrix-row="${t(this, y).dataset.matrixRow}"]`), b = g.dataset.expr ? this.getExprValue(g.dataset.expr, l, a) : l[g.dataset.bind], u = g.dataset.expr ? this.getExprValue(g.dataset.expr, f, c) : f[g.dataset.bind];
|
|
1619
1615
|
if (b != u) {
|
|
1620
|
-
|
|
1616
|
+
o = !0;
|
|
1621
1617
|
break;
|
|
1622
1618
|
}
|
|
1623
1619
|
}
|
|
1624
1620
|
else
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
var
|
|
1628
|
-
$(A).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this,
|
|
1621
|
+
o = !0;
|
|
1622
|
+
o ? ninegrid.j.querySelectorAll(t(this, y)).removeClass("suppress") : ninegrid.j.querySelectorAll(t(this, y)).addClass("suppress"), ninegrid.j.querySelectorAll(t(this, y)).hasClass("hidden") || (o ? ninegrid.j.querySelectorAll(t(this, y)).removeClass("hidden") : ninegrid.j.querySelectorAll(t(this, y)).addClass("hidden"));
|
|
1623
|
+
var m = parseInt(t(this, y).dataset.matrixRow), v = m - 1, A = t(this, L).body.querySelector(`tbody.bindable [data-col="${t(this, y).dataset.col}"][data-matrix-row="${v}"]`);
|
|
1624
|
+
$(A).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this, y)).hasClass("suppress") ? ninegrid.j.querySelectorAll(A).removeClass("last-none-suppress").addClass("last-suppress") : !$(A).hasClass("suppress") && ninegrid.j.querySelectorAll(t(this, y)).hasClass("suppress") ? ninegrid.j.querySelectorAll(A).removeClass("last-suppress").addClass("last-none-suppress") : ninegrid.j.querySelectorAll(A).removeClass("last-none-suppress").removeClass("last-suppress");
|
|
1629
1625
|
}
|
|
1630
1626
|
}
|
|
1631
1627
|
}, "#resetSuppress"));
|
|
1632
|
-
E(this, "getExprValue", /* @__PURE__ */ h((e, s, r,
|
|
1628
|
+
E(this, "getExprValue", /* @__PURE__ */ h((e, s, r, o) => {
|
|
1633
1629
|
if (typeof e < "u")
|
|
1634
1630
|
try {
|
|
1635
1631
|
r = parseInt(r);
|
|
1636
|
-
const
|
|
1637
|
-
return t(this, L)[
|
|
1632
|
+
const i = e.replace("()", "");
|
|
1633
|
+
return t(this, L)[i] ? t(this, L)[i].call(this, s, r, t(this, y)) : t(this, L).exprFunction(e).call(this, s, r, t(this, L).data);
|
|
1638
1634
|
} catch {
|
|
1639
1635
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1640
1636
|
}
|
|
@@ -1643,29 +1639,29 @@ const Ke = class Ke extends Re {
|
|
|
1643
1639
|
}, "getExprValue"));
|
|
1644
1640
|
}
|
|
1645
1641
|
connectedCallback() {
|
|
1646
|
-
super.connectedCallback(), p(this, L, this.getRootNode().host), p(this,
|
|
1642
|
+
super.connectedCallback(), p(this, L, this.getRootNode().host), p(this, y, this.closest("th,td")), p(this, Nt, t(this, y).closest("tr"));
|
|
1647
1643
|
}
|
|
1648
1644
|
get value() {
|
|
1649
|
-
var e = !t(this, L) || !t(this, L).dataManager || !t(this,
|
|
1645
|
+
var e = !t(this, L) || !t(this, L).dataManager || !t(this, y) || !t(this, y).dataset || !t(this, y).dataset.row || !t(this, y).dataset.bind ? "" : t(this, y).closest("tr").data[t(this, y).dataset.bind];
|
|
1650
1646
|
return e ?? "";
|
|
1651
1647
|
}
|
|
1652
1648
|
set value(e) {
|
|
1653
|
-
var s = parseInt(t(this,
|
|
1649
|
+
var s = parseInt(t(this, y).dataset.row);
|
|
1654
1650
|
const r = this.getAttribute("update-row-state") != "false";
|
|
1655
|
-
s < 0 ? t(this, L).data.setValueNF(parseInt(t(this,
|
|
1651
|
+
s < 0 ? t(this, L).data.setValueNF(parseInt(t(this, y).dataset.index), t(this, y).dataset.bind, e, r) : t(this, L).data.setValue(s, t(this, y).dataset.bind, e, r);
|
|
1656
1652
|
}
|
|
1657
1653
|
get row() {
|
|
1658
|
-
return parseInt(t(this,
|
|
1654
|
+
return parseInt(t(this, y).dataset.row);
|
|
1659
1655
|
}
|
|
1660
1656
|
get data() {
|
|
1661
|
-
return t(this,
|
|
1657
|
+
return t(this, y).closest("tr").data;
|
|
1662
1658
|
}
|
|
1663
1659
|
refresh() {
|
|
1664
|
-
const e = t(this,
|
|
1665
|
-
return parseInt(t(this,
|
|
1660
|
+
const e = t(this, y).dataset.bind;
|
|
1661
|
+
return parseInt(t(this, y).dataset.row), t(this, Nt).data[e];
|
|
1666
1662
|
}
|
|
1667
1663
|
};
|
|
1668
|
-
L = new WeakMap(), Nt = new WeakMap(),
|
|
1664
|
+
L = new WeakMap(), Nt = new WeakMap(), y = new WeakMap(), Me = new WeakMap(), Ie = new WeakMap(), $e = new WeakMap(), _e = new WeakMap(), Ne = new WeakMap(), h(Ke, "CellElement");
|
|
1669
1665
|
let qe = Ke;
|
|
1670
1666
|
const Ze = class Ze extends qe {
|
|
1671
1667
|
constructor() {
|
|
@@ -1727,8 +1723,8 @@ const Ge = class Ge extends Te {
|
|
|
1727
1723
|
d(this, ze, /* @__PURE__ */ h((e) => {
|
|
1728
1724
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1729
1725
|
if (t(this, lt) == "number") {
|
|
1730
|
-
let
|
|
1731
|
-
if (t(this, X) && Number(t(this, X)) > 0 &&
|
|
1726
|
+
let o = [];
|
|
1727
|
+
if (t(this, X) && Number(t(this, X)) > 0 && o.push("."), t(this, yt) && Number(t(this, yt)) >= 0 && o.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !o.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) {
|
|
1732
1728
|
var s = e.target.value, r = s.indexOf(".");
|
|
1733
1729
|
if (r >= 0) {
|
|
1734
1730
|
var s = s.substr(r + 1, s.length);
|