@ninebone/table 0.0.686 β 0.0.688
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 +233 -233
- 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
|
@@ -2,16 +2,16 @@ var Fe = Object.defineProperty;
|
|
|
2
2
|
var Ve = (q) => {
|
|
3
3
|
throw TypeError(q);
|
|
4
4
|
};
|
|
5
|
-
var Xe = (q,
|
|
6
|
-
var h = (q,
|
|
7
|
-
var E = (q,
|
|
8
|
-
var t = (q,
|
|
9
|
-
var Ue = (q,
|
|
10
|
-
set _(
|
|
11
|
-
y(q,
|
|
5
|
+
var Xe = (q, r, e) => r in q ? Fe(q, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : q[r] = e;
|
|
6
|
+
var h = (q, r) => Fe(q, "name", { value: r, configurable: !0 });
|
|
7
|
+
var E = (q, r, e) => Xe(q, typeof r != "symbol" ? r + "" : r, e), Ye = (q, r, e) => r.has(q) || Ve("Cannot " + e);
|
|
8
|
+
var t = (q, r, e) => (Ye(q, r, "read from private field"), e ? e.call(q) : r.get(q)), d = (q, r, e) => r.has(q) ? Ve("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(q) : r.set(q, e), y = (q, r, e, s) => (Ye(q, r, "write to private field"), s ? s.call(q, e) : r.set(q, e), e);
|
|
9
|
+
var Ue = (q, r, e, s) => ({
|
|
10
|
+
set _(i) {
|
|
11
|
+
y(q, r, i, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
|
-
return t(q,
|
|
14
|
+
return t(q, r, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
import { trace as Ke } from "@ninebone/util";
|
|
@@ -44,14 +44,14 @@ const $e = class $e extends HTMLElement {
|
|
|
44
44
|
if (!t(this, z) || !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
|
|
47
|
+
const i = t(this, S).track, n = t(this, S).thumb, o = t(this, z).querySelector(".ng-container-bottom"), a = e.clientWidth, c = s.scrollWidth;
|
|
48
48
|
if (a !== 0 && c > a)
|
|
49
49
|
o && (o.style.display = "flex");
|
|
50
50
|
else {
|
|
51
51
|
o && (o.style.display = "none");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
const l =
|
|
54
|
+
const l = i.clientWidth;
|
|
55
55
|
if (l <= 0) return;
|
|
56
56
|
const f = Math.max(Math.min(l * (a / c), l), 20);
|
|
57
57
|
n.style.width = `${f}px`;
|
|
@@ -63,43 +63,43 @@ const $e = class $e extends HTMLElement {
|
|
|
63
63
|
}, "refresh"));
|
|
64
64
|
d(this, G, /* @__PURE__ */ h((e) => {
|
|
65
65
|
if (!t(this, S)) return !1;
|
|
66
|
-
const s = t(this, S).container,
|
|
67
|
-
if (!
|
|
66
|
+
const s = t(this, S).container, i = s.querySelector("table");
|
|
67
|
+
if (!i) return !1;
|
|
68
68
|
const n = t(this, S).track.getBoundingClientRect(), o = t(this, S).thumb.clientWidth;
|
|
69
69
|
let a = e;
|
|
70
70
|
a < 0 && (a = 0);
|
|
71
71
|
const c = n.width - o;
|
|
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
|
-
const l = s.clientWidth, u =
|
|
73
|
+
const l = s.clientWidth, u = i.scrollWidth - l;
|
|
74
74
|
return c > 0 && u > 0 && (s.scrollLeft = a / c * u), a > 0 && a < c - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
76
|
d(this, Nt, /* @__PURE__ */ h(() => {
|
|
77
|
-
const e = /* @__PURE__ */ h((
|
|
77
|
+
const e = /* @__PURE__ */ h((i) => {
|
|
78
78
|
clearInterval(t(this, X)), clearInterval(t(this, K));
|
|
79
79
|
const n = parseInt(t(this, S).thumb.style.left || 0, 10);
|
|
80
|
-
t(this, G).call(this, n +
|
|
80
|
+
t(this, G).call(this, n + i), y(this, X, setInterval(() => {
|
|
81
81
|
clearInterval(t(this, X)), y(this, K, setInterval(() => {
|
|
82
82
|
const o = parseInt(t(this, S).thumb.style.left || 0, 10);
|
|
83
|
-
t(this, G).call(this, o +
|
|
83
|
+
t(this, G).call(this, o + i) || clearInterval(t(this, K));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), s = /* @__PURE__ */ h(() => {
|
|
87
87
|
clearInterval(t(this, X)), clearInterval(t(this, K));
|
|
88
88
|
}, "clearTimer");
|
|
89
|
-
["mouseup", "mouseleave", "touchend"].forEach((
|
|
90
|
-
t(this, S).left.addEventListener(
|
|
91
|
-
}), t(this, S).left.addEventListener("mousedown", (
|
|
92
|
-
|
|
93
|
-
}), t(this, S).right.addEventListener("mousedown", (
|
|
94
|
-
|
|
95
|
-
}), t(this, S).left.addEventListener("touchstart", () => e(-20)), t(this, S).right.addEventListener("touchstart", () => e(20)), t(this, S).track.addEventListener("mousedown", (
|
|
96
|
-
if (
|
|
97
|
-
|
|
89
|
+
["mouseup", "mouseleave", "touchend"].forEach((i) => {
|
|
90
|
+
t(this, S).left.addEventListener(i, s), t(this, S).right.addEventListener(i, s), t(this, S).track.addEventListener(i, s);
|
|
91
|
+
}), t(this, S).left.addEventListener("mousedown", (i) => {
|
|
92
|
+
i.button === 0 && e(-20);
|
|
93
|
+
}), t(this, S).right.addEventListener("mousedown", (i) => {
|
|
94
|
+
i.button === 0 && e(20);
|
|
95
|
+
}), t(this, S).left.addEventListener("touchstart", () => e(-20)), t(this, S).right.addEventListener("touchstart", () => e(20)), t(this, S).track.addEventListener("mousedown", (i) => {
|
|
96
|
+
if (i.button !== 0) return;
|
|
97
|
+
i.preventDefault();
|
|
98
98
|
const n = t(this, S).track.getBoundingClientRect(), o = t(this, S).thumb.clientWidth;
|
|
99
|
-
t(this, G).call(this,
|
|
100
|
-
}), t(this, S).thumb.addEventListener("mousedown", (
|
|
101
|
-
if (
|
|
102
|
-
|
|
99
|
+
t(this, G).call(this, i.clientX - n.left - o / 2);
|
|
100
|
+
}), t(this, S).thumb.addEventListener("mousedown", (i) => {
|
|
101
|
+
if (i.button !== 0) return;
|
|
102
|
+
i.stopPropagation(), i.preventDefault(), y(this, j, !0), this.shiftX = i.clientX - t(this, S).thumb.getBoundingClientRect().left;
|
|
103
103
|
const n = /* @__PURE__ */ h((a) => {
|
|
104
104
|
if (!t(this, j)) return;
|
|
105
105
|
const c = t(this, S).track.getBoundingClientRect();
|
|
@@ -212,8 +212,8 @@ const Me = class Me extends HTMLElement {
|
|
|
212
212
|
d(this, vt, 0);
|
|
213
213
|
d(this, xt, 0);
|
|
214
214
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
|
-
if (!t(this, F) || !t(this, k)) return;
|
|
216
|
-
const e = t(this, k).container, s = t(this, k).track,
|
|
215
|
+
if (R.log("vscrollbar.refresh"), R.log(t(this, k)), !t(this, F) || !t(this, k)) return;
|
|
216
|
+
const e = t(this, k).container, s = t(this, k).track, i = t(this, k).thumb, n = e.clientHeight, o = t(this, F).data.length, a = t(this, at).getRowHeight(), c = o * a;
|
|
217
217
|
if (c <= n || o === 0) {
|
|
218
218
|
this.style.display = "none";
|
|
219
219
|
return;
|
|
@@ -222,12 +222,12 @@ const Me = class Me extends HTMLElement {
|
|
|
222
222
|
const l = s.clientHeight;
|
|
223
223
|
if (l <= 0) return;
|
|
224
224
|
const f = Math.max(Math.min(l * (n / c), l), 20);
|
|
225
|
-
|
|
225
|
+
i.style.height = `${f}px`;
|
|
226
226
|
const u = e.scrollTop, b = Math.max(c - n, 1);
|
|
227
227
|
let g = 0;
|
|
228
228
|
b > 0 && (g = u / b * (l - f));
|
|
229
229
|
const v = l - f;
|
|
230
|
-
g < 0 && (g = 0), g > v && (g = v),
|
|
230
|
+
g < 0 && (g = 0), g > v && (g = v), i.style.top = `${g}px`, t(this, k).top.disabled = u <= 0, t(this, k).bottom.disabled = u >= b - 1;
|
|
231
231
|
}, "refresh"));
|
|
232
232
|
d(this, Wt, /* @__PURE__ */ h(() => {
|
|
233
233
|
R.log("nine-table-vscrollbar.#init");
|
|
@@ -237,9 +237,9 @@ const Me = class Me extends HTMLElement {
|
|
|
237
237
|
}, "getContentHeight");
|
|
238
238
|
e.addEventListener("scroll", () => {
|
|
239
239
|
t(this, J) || this.refresh();
|
|
240
|
-
}), t(this, k).thumb.addEventListener("mousedown", (
|
|
241
|
-
if (
|
|
242
|
-
|
|
240
|
+
}), t(this, k).thumb.addEventListener("mousedown", (i) => {
|
|
241
|
+
if (i.button !== 0) return;
|
|
242
|
+
i.stopPropagation(), i.preventDefault(), y(this, J, !0), y(this, vt, i.clientY), y(this, xt, e.scrollTop);
|
|
243
243
|
const n = /* @__PURE__ */ h((a) => {
|
|
244
244
|
if (!t(this, J)) return;
|
|
245
245
|
const c = t(this, k).track.getBoundingClientRect(), l = t(this, k).thumb.clientHeight, u = c.height - l, b = a.clientY - t(this, vt), g = e.clientHeight, v = s(), w = Math.max(v - g, 1);
|
|
@@ -254,9 +254,9 @@ const Me = class Me extends HTMLElement {
|
|
|
254
254
|
y(this, J, !1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), this.refresh();
|
|
255
255
|
}, "onMouseUp");
|
|
256
256
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", o);
|
|
257
|
-
}), t(this, k).track.addEventListener("mousedown", (
|
|
258
|
-
if (
|
|
259
|
-
const n = t(this, k).track.getBoundingClientRect(), o = t(this, k).thumb.clientHeight, a =
|
|
257
|
+
}), t(this, k).track.addEventListener("mousedown", (i) => {
|
|
258
|
+
if (i.button !== 0 || i.target === t(this, k).thumb) return;
|
|
259
|
+
const n = t(this, k).track.getBoundingClientRect(), o = t(this, k).thumb.clientHeight, a = i.clientY - n.top - o / 2, l = n.height - o, f = e.clientHeight, u = s(), b = Math.max(u - f, 1);
|
|
260
260
|
if (l > 0 && b > 0) {
|
|
261
261
|
const g = Math.max(0, Math.min(1, a / l));
|
|
262
262
|
e.scrollTop = g * b;
|
|
@@ -356,7 +356,7 @@ let le = Me;
|
|
|
356
356
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", le);
|
|
357
357
|
var P, x, Q, D, M, V, tt, wt, Se, Ee, Ot, Bt, St, Et, At, zt, Dt, qt, Ae, lt, Rt, Pt;
|
|
358
358
|
const Ie = class Ie {
|
|
359
|
-
constructor(
|
|
359
|
+
constructor(r) {
|
|
360
360
|
d(this, P);
|
|
361
361
|
d(this, x);
|
|
362
362
|
d(this, Q);
|
|
@@ -372,8 +372,8 @@ const Ie = class Ie {
|
|
|
372
372
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
373
373
|
var e;
|
|
374
374
|
R.log("rowManager.refresh");
|
|
375
|
-
const
|
|
376
|
-
|
|
375
|
+
const r = t(this, x).querySelector(".ng-container-body .ng-part-body");
|
|
376
|
+
r && (t(this, St).call(this), t(this, Et).call(this), t(this, lt).call(this, r.scrollTop), (e = t(this, x).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
377
377
|
}, "refresh"));
|
|
378
378
|
E(this, "initialize", /* @__PURE__ */ h(() => {
|
|
379
379
|
R.log("rowManager.initialize"), y(this, Q, {
|
|
@@ -389,51 +389,51 @@ const Ie = class Ie {
|
|
|
389
389
|
const u = Array.from(l.querySelectorAll("tr")).map((b) => b.cloneNode(!0));
|
|
390
390
|
t(this, D).set(o, u);
|
|
391
391
|
});
|
|
392
|
-
const
|
|
393
|
-
if (
|
|
394
|
-
t(this, St).call(this), t(this, qt).call(this), t(this, Et).call(this), t(this, lt).call(this,
|
|
392
|
+
const r = t(this, x).querySelector(".ng-container-body .ng-part-body"), e = t(this, x).querySelector(".ng-container-left .ng-part-body"), s = t(this, x).querySelector(".ng-container-right .ng-part-body"), i = t(this, x).querySelector(".ng-container-body .ng-part-header"), n = t(this, x).querySelector(".ng-container-body .ng-part-footer");
|
|
393
|
+
if (r) {
|
|
394
|
+
t(this, St).call(this), t(this, qt).call(this), t(this, Et).call(this), t(this, lt).call(this, r.scrollTop);
|
|
395
395
|
let o = !1;
|
|
396
396
|
const a = /* @__PURE__ */ h((c) => {
|
|
397
397
|
if (o) return;
|
|
398
398
|
o = !0;
|
|
399
399
|
const l = c.scrollTop, f = c.scrollLeft;
|
|
400
|
-
|
|
400
|
+
r && r.scrollTop !== l && (r.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), i && i.scrollLeft !== f && (i.scrollLeft = f), n && n.scrollLeft !== f && (n.scrollLeft = f), t(this, lt).call(this, l), o = !1;
|
|
401
401
|
}, "handleContainerScroll");
|
|
402
|
-
[
|
|
402
|
+
[r, e, s].forEach((c) => {
|
|
403
403
|
R.log(c), c && c.addEventListener("scroll", () => {
|
|
404
404
|
a(c);
|
|
405
405
|
});
|
|
406
406
|
});
|
|
407
407
|
}
|
|
408
408
|
}, "initialize"));
|
|
409
|
-
d(this, Bt, /* @__PURE__ */ h((
|
|
409
|
+
d(this, Bt, /* @__PURE__ */ h((r, e) => {
|
|
410
410
|
R.log("rowManager.#renderRows");
|
|
411
411
|
const s = t(this, D).get(e);
|
|
412
412
|
if (!s || s.length === 0) return;
|
|
413
|
-
const
|
|
414
|
-
if (!
|
|
415
|
-
|
|
416
|
-
const n =
|
|
413
|
+
const i = r.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
414
|
+
if (!i) return;
|
|
415
|
+
i.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
|
|
416
|
+
const n = i.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
417
417
|
for (let a = 0; a < t(this, wt); a++)
|
|
418
418
|
s.forEach((c) => {
|
|
419
419
|
o.appendChild(c.cloneNode(!0));
|
|
420
420
|
});
|
|
421
|
-
n ? n.before(o) :
|
|
421
|
+
n ? n.before(o) : i.appendChild(o), e === ".ng-container-body" && (t(this, Q).firstTr = i.querySelector("tr:not(.nodata)"));
|
|
422
422
|
}, "#renderRows"));
|
|
423
423
|
d(this, St, /* @__PURE__ */ h(() => {
|
|
424
424
|
if (t(this, M) !== null && t(this, M) > 0)
|
|
425
425
|
return t(this, M);
|
|
426
|
-
const
|
|
426
|
+
const r = t(this, x).querySelector(".ng-container-body .ng-part-body");
|
|
427
427
|
R.log("rowManager.#measureAndCacheHeight");
|
|
428
428
|
const e = t(this, D).get(".ng-container-body");
|
|
429
429
|
if (!e || e.length === 0) throw new Error("invalid dom");
|
|
430
|
-
const s =
|
|
430
|
+
const s = r.querySelector("tbody.bindable-tbody");
|
|
431
431
|
if (R.log(s), !s) throw new Error("invalid dom");
|
|
432
432
|
s.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
|
|
433
|
-
const
|
|
433
|
+
const i = s.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
434
434
|
e.forEach((b) => {
|
|
435
435
|
n.appendChild(b.cloneNode(!0));
|
|
436
|
-
}),
|
|
436
|
+
}), i ? i.before(n) : s.appendChild(n);
|
|
437
437
|
const o = t(this, x), a = o.style.display, c = o.style.visibility, l = o.style.position;
|
|
438
438
|
(a === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
439
439
|
let f = 0;
|
|
@@ -449,25 +449,25 @@ const Ie = class Ie {
|
|
|
449
449
|
}, "#measureAndCacheHeight"));
|
|
450
450
|
d(this, Et, /* @__PURE__ */ h(() => {
|
|
451
451
|
R.log("rowManager.#updateVirtualScrollHeight");
|
|
452
|
-
const e = (t(this, P).data.get() || []).length, s = t(this, M),
|
|
453
|
-
R.log("π [VirtualHeight]", { totalCount: e, rowHeight: s, totalVirtualHeight:
|
|
452
|
+
const e = (t(this, P).data.get() || []).length, s = t(this, M), i = e * s;
|
|
453
|
+
R.log("π [VirtualHeight]", { totalCount: e, rowHeight: s, totalVirtualHeight: i }), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
454
454
|
const o = t(this, x).querySelector(n);
|
|
455
455
|
if (!o) return;
|
|
456
456
|
const a = o.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
457
|
-
a && (a.style.height = `${
|
|
457
|
+
a && (a.style.height = `${i}px`);
|
|
458
458
|
});
|
|
459
459
|
}, "#updateVirtualScrollHeight"));
|
|
460
460
|
d(this, At, /* @__PURE__ */ h(() => {
|
|
461
461
|
if (t(this, tt) > 0 && t(this, M) > 0) {
|
|
462
|
-
const
|
|
463
|
-
y(this, wt,
|
|
462
|
+
const r = Math.ceil(t(this, tt) / t(this, M));
|
|
463
|
+
y(this, wt, r + t(this, Ot));
|
|
464
464
|
}
|
|
465
465
|
}, "#updateRowCount"));
|
|
466
466
|
d(this, zt, /* @__PURE__ */ h(() => {
|
|
467
467
|
var a, c, l, f, u, b;
|
|
468
|
-
const
|
|
468
|
+
const r = t(this, x).querySelector(".ng-container-left .ng-part-body table"), e = t(this, x).querySelector(".ng-container-body .ng-part-body table"), s = t(this, x).querySelector(".ng-container-right .ng-part-body table");
|
|
469
469
|
if (e) {
|
|
470
|
-
const g =
|
|
470
|
+
const g = r ? Array.from(r.querySelectorAll("tbody tr")) : [], v = Array.from(e.querySelectorAll("tbody tr")), w = s ? Array.from(s.querySelectorAll("tbody tr")) : [], A = Math.max(g.length, v.length, w.length);
|
|
471
471
|
for (let m = 0; m < A; m++) {
|
|
472
472
|
const W = [
|
|
473
473
|
((a = g[m]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
@@ -477,9 +477,9 @@ const Ie = class Ie {
|
|
|
477
477
|
T > 0 && (g[m] && (g[m].style.height = `${T}px`), v[m] && (v[m].style.height = `${T}px`), w[m] && (w[m].style.height = `${T}px`));
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
|
-
const
|
|
480
|
+
const i = t(this, x).querySelector(".ng-container-left .ng-part-footer table"), n = t(this, x).querySelector(".ng-container-body .ng-part-footer table"), o = t(this, x).querySelector(".ng-container-right .ng-part-footer table");
|
|
481
481
|
if (n) {
|
|
482
|
-
const g =
|
|
482
|
+
const g = i ? Array.from(i.querySelectorAll("tfoot tr")) : [], v = Array.from(n.querySelectorAll("tfoot tr")), w = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], A = Math.max(g.length, v.length, w.length);
|
|
483
483
|
for (let m = 0; m < A; m++) {
|
|
484
484
|
const W = [
|
|
485
485
|
((f = g[m]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
@@ -491,37 +491,37 @@ const Ie = class Ie {
|
|
|
491
491
|
}
|
|
492
492
|
}, "#syncRowHeights"));
|
|
493
493
|
d(this, Dt, /* @__PURE__ */ h(() => {
|
|
494
|
-
!t(this, x) || !(t(this, x) instanceof HTMLElement) || (y(this, V, new ResizeObserver((
|
|
495
|
-
for (const e of
|
|
494
|
+
!t(this, x) || !(t(this, x) instanceof HTMLElement) || (y(this, V, new ResizeObserver((r) => {
|
|
495
|
+
for (const e of r) {
|
|
496
496
|
const s = e.target;
|
|
497
497
|
if (!s.classList.contains("active")) continue;
|
|
498
|
-
const
|
|
499
|
-
if (
|
|
498
|
+
const i = e.contentRect.height;
|
|
499
|
+
if (i > 0) {
|
|
500
500
|
let n = 0;
|
|
501
501
|
const o = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
|
|
502
502
|
o && (n += o.offsetHeight), a && (n += a.offsetHeight);
|
|
503
|
-
const c = Math.max(
|
|
503
|
+
const c = Math.max(i - n, 100);
|
|
504
504
|
t(this, tt) !== c && (y(this, tt, c), t(this, At).call(this), t(this, M) !== null && (t(this, qt).call(this), this.refresh()));
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
507
|
})), t(this, V).observe(t(this, x)));
|
|
508
508
|
}, "#initResizeObserver"));
|
|
509
509
|
d(this, qt, /* @__PURE__ */ h(() => {
|
|
510
|
-
R.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
511
|
-
const e = t(this, x).querySelector(
|
|
512
|
-
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Bt).call(this, e,
|
|
510
|
+
R.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((r) => {
|
|
511
|
+
const e = t(this, x).querySelector(r);
|
|
512
|
+
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Bt).call(this, e, r);
|
|
513
513
|
}), t(this, Pt).call(this), t(this, zt).call(this);
|
|
514
514
|
}, "#renderAllContainers"));
|
|
515
|
-
d(this, Ae, /* @__PURE__ */ h((
|
|
515
|
+
d(this, Ae, /* @__PURE__ */ h((r) => {
|
|
516
516
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
517
517
|
var l;
|
|
518
518
|
const s = t(this, x).querySelector(e);
|
|
519
519
|
if (!s) return;
|
|
520
|
-
const
|
|
521
|
-
if (!
|
|
522
|
-
const n = Array.from(
|
|
520
|
+
const i = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
521
|
+
if (!i) return;
|
|
522
|
+
const n = Array.from(i.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this, D).get(e)) == null ? void 0 : l.length) || 1, c = (t(this, P).data.get() || []).length;
|
|
523
523
|
n.forEach((f, u) => {
|
|
524
|
-
const b =
|
|
524
|
+
const b = r + Math.floor(u / o);
|
|
525
525
|
if (b >= c) {
|
|
526
526
|
f.style.visibility = "hidden";
|
|
527
527
|
return;
|
|
@@ -531,18 +531,18 @@ const Ie = class Ie {
|
|
|
531
531
|
});
|
|
532
532
|
});
|
|
533
533
|
}, "#adjustBufferRows"));
|
|
534
|
-
d(this, lt, /* @__PURE__ */ h((
|
|
534
|
+
d(this, lt, /* @__PURE__ */ h((r) => {
|
|
535
535
|
var u, b;
|
|
536
536
|
R.log("rowManager.#handleScroll()", t(this, M));
|
|
537
537
|
const e = t(this, M);
|
|
538
538
|
if (!e || e <= 0) return;
|
|
539
539
|
const s = t(this, P).data.length;
|
|
540
540
|
if (s === 0) return;
|
|
541
|
-
const
|
|
541
|
+
const i = ((u = t(this, D).get(".ng-container-body")) == null ? void 0 : u.length) || 1, n = t(this, x).querySelector(".ng-container-body .ng-part-body");
|
|
542
542
|
R.log("bodyContainer.clientHeight", n.clientHeight);
|
|
543
|
-
const o = Math.max(0, s - Math.floor(n.clientHeight / e)), a = Math.min(o, Math.max(0, Math.floor(
|
|
543
|
+
const o = Math.max(0, s - Math.floor(n.clientHeight / e)), a = Math.min(o, Math.max(0, Math.floor(r / e)));
|
|
544
544
|
let c = Math.floor(a * e);
|
|
545
|
-
R.log(`π [Scroll Calc] maxStartIndex: ${o}, startIndex: ${a}, offsetY: ${c}`), a === o && R.log(`π [Scroll Inspect] scrollTop: ${
|
|
545
|
+
R.log(`π [Scroll Calc] maxStartIndex: ${o}, startIndex: ${a}, offsetY: ${c}`), a === o && R.log(`π [Scroll Inspect] scrollTop: ${r}, rowHeight: ${e}, maxStartIndex: ${o}, startIndex: ${a}, offsetY: ${c}`);
|
|
546
546
|
const l = t(this, Q).firstTr, f = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
|
|
547
547
|
(b = t(this, Q)) == null || b.scrollTables.forEach((g) => {
|
|
548
548
|
g.style.transform = `translate3d(0, ${c}px, 0)`;
|
|
@@ -552,7 +552,7 @@ const Ie = class Ie {
|
|
|
552
552
|
const w = v.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
553
553
|
if (!w) return;
|
|
554
554
|
Array.from(w.querySelectorAll("tr:not(.nodata)")).forEach((m, W) => {
|
|
555
|
-
const T = a + Math.floor(W /
|
|
555
|
+
const T = a + Math.floor(W / i);
|
|
556
556
|
if (T >= s) {
|
|
557
557
|
m.style.display = "none";
|
|
558
558
|
return;
|
|
@@ -576,39 +576,39 @@ const Ie = class Ie {
|
|
|
576
576
|
cell.dataset.row = dataIndex;
|
|
577
577
|
});
|
|
578
578
|
}; */
|
|
579
|
-
d(this, Rt, /* @__PURE__ */ h((
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
const o = Array.from(
|
|
579
|
+
d(this, Rt, /* @__PURE__ */ h((r, e, s) => {
|
|
580
|
+
r.dataset.row = s, r.data = e, Array.from(r.cells).forEach((i, n) => {
|
|
581
|
+
i.dataset.row = s;
|
|
582
|
+
const o = Array.from(i.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
|
|
583
583
|
o && typeof o.refresh == "function" && o.refresh();
|
|
584
584
|
});
|
|
585
585
|
}, "#bindRowData"));
|
|
586
586
|
d(this, Pt, /* @__PURE__ */ h(() => {
|
|
587
587
|
var c, l, f;
|
|
588
588
|
R.log("rowManager.#syncHeaderHeights");
|
|
589
|
-
const
|
|
589
|
+
const r = t(this, x).querySelector(".ng-container-left .ng-part-header table"), e = t(this, x).querySelector(".ng-container-body .ng-part-header table"), s = t(this, x).querySelector(".ng-container-right .ng-part-header table");
|
|
590
590
|
if (!e) return;
|
|
591
|
-
const
|
|
591
|
+
const i = r ? Array.from(r.querySelectorAll("tr")) : [], n = Array.from(e.querySelectorAll("tr")), o = s ? Array.from(s.querySelectorAll("tr")) : [], a = Math.max(i.length, n.length, o.length);
|
|
592
592
|
for (let u = 0; u < a; u++) {
|
|
593
593
|
const b = [
|
|
594
|
-
((c =
|
|
594
|
+
((c = i[u]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
595
595
|
((l = n[u]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
596
596
|
((f = o[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
597
597
|
], g = Math.max(...b);
|
|
598
|
-
g > 0 && (
|
|
598
|
+
g > 0 && (i[u] && (i[u].style.height = `${g}px`), n[u] && (n[u].style.height = `${g}px`), o[u] && (o[u].style.height = `${g}px`));
|
|
599
599
|
}
|
|
600
600
|
}, "#syncHeaderHeights"));
|
|
601
601
|
E(this, "destroy", /* @__PURE__ */ h(() => {
|
|
602
602
|
t(this, V) && (t(this, V).disconnect(), y(this, V, null));
|
|
603
603
|
}, "destroy"));
|
|
604
|
-
y(this, P,
|
|
604
|
+
y(this, P, r.getRootNode().host), y(this, x, r), t(this, Dt).call(this);
|
|
605
605
|
}
|
|
606
606
|
getRowHeight() {
|
|
607
607
|
return t(this, M);
|
|
608
608
|
}
|
|
609
|
-
templateLength(
|
|
609
|
+
templateLength(r = ".ng-container-body") {
|
|
610
610
|
var e;
|
|
611
|
-
return ((e = t(this, D).get(
|
|
611
|
+
return ((e = t(this, D).get(r)) == null ? void 0 : e.length) || 1;
|
|
612
612
|
}
|
|
613
613
|
};
|
|
614
614
|
P = new WeakMap(), x = new WeakMap(), Q = new WeakMap(), D = new WeakMap(), M = new WeakMap(), V = new WeakMap(), tt = new WeakMap(), wt = new WeakMap(), Se = new WeakMap(), Ee = new WeakMap(), Ot = new WeakMap(), Bt = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), At = new WeakMap(), zt = new WeakMap(), Dt = new WeakMap(), qt = new WeakMap(), Ae = new WeakMap(), lt = new WeakMap(), Rt = new WeakMap(), Pt = new WeakMap(), h(Ie, "RowManager");
|
|
@@ -617,14 +617,14 @@ const jt = class jt {
|
|
|
617
617
|
/**
|
|
618
618
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
619
619
|
*/
|
|
620
|
-
static compileAll(
|
|
621
|
-
return Array.isArray(
|
|
620
|
+
static compileAll(r) {
|
|
621
|
+
return Array.isArray(r) ? r.map((e) => jt.compile(e)) : [];
|
|
622
622
|
}
|
|
623
623
|
/**
|
|
624
624
|
* π― λ¨μΌ μλ³Έ ν
μ΄λΈμ λ°μ κΈ°λ³Έ ꡬ쑰 보μ λ° 2μ°¨μ 격μ μΈλ±μ€ μ¬μ λΆμ¬ μλ£λ λ§μ€ν° ν
μ΄λΈ λ°ν
|
|
625
625
|
*/
|
|
626
|
-
static compile(
|
|
627
|
-
if (!
|
|
626
|
+
static compile(r) {
|
|
627
|
+
if (!r) return null;
|
|
628
628
|
const e = /* @__PURE__ */ h((a) => {
|
|
629
629
|
a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
|
|
630
630
|
const f = l.getAttribute("cell-type") || "renderer";
|
|
@@ -648,7 +648,7 @@ const jt = class jt {
|
|
|
648
648
|
l ? l.after(c) : a.prepend(c);
|
|
649
649
|
}
|
|
650
650
|
a.classList.add("nine-table-element");
|
|
651
|
-
}, "ensureTableStructure"),
|
|
651
|
+
}, "ensureTableStructure"), i = /* @__PURE__ */ h((a, c) => {
|
|
652
652
|
const l = Array.from(a.querySelectorAll(c + " tr")), f = Array.from(a.querySelectorAll(c + " th," + c + " td")), u = l.length;
|
|
653
653
|
if (u === 0 || f.length === 0) return;
|
|
654
654
|
let b = 0;
|
|
@@ -680,8 +680,8 @@ const jt = class jt {
|
|
|
680
680
|
}
|
|
681
681
|
});
|
|
682
682
|
});
|
|
683
|
-
}, "resetColIndex"), n =
|
|
684
|
-
return s(n), e(n),
|
|
683
|
+
}, "resetColIndex"), n = r.cloneNode(!0);
|
|
684
|
+
return s(n), e(n), i(n, "thead"), i(n, "tbody"), i(n, "tfoot"), Array.from(n.querySelectorAll("colgroup col")).forEach((a, c) => {
|
|
685
685
|
const l = a.getAttribute("fixed");
|
|
686
686
|
l && n.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((f) => {
|
|
687
687
|
f.setAttribute("fixed", l);
|
|
@@ -705,8 +705,8 @@ const pt = class pt extends HTMLElement {
|
|
|
705
705
|
E(this, "generate", /* @__PURE__ */ h((e) => {
|
|
706
706
|
if (R.log("sheet.generate()"), !e) return;
|
|
707
707
|
y(this, et, he.compile(e)), t(this, Vt).call(this), t(this, Yt).call(this);
|
|
708
|
-
const s = this.querySelector(".ng-container-body .ng-part-header"),
|
|
709
|
-
s && n && (n.style.top = `${s.offsetHeight}px`),
|
|
708
|
+
const s = this.querySelector(".ng-container-body .ng-part-header"), i = this.querySelector(".ng-container-body .ng-part-footer"), n = this.querySelector(".ng-nodata-overlay");
|
|
709
|
+
s && n && (n.style.top = `${s.offsetHeight}px`), i && n && (n.style.bottom = `${i.offsetHeight}px`), t(this, st).initialize(), setTimeout(() => {
|
|
710
710
|
var o;
|
|
711
711
|
(o = this.querySelector("nine-table-hscrollbar")) == null || o.refresh();
|
|
712
712
|
}, 0);
|
|
@@ -716,30 +716,30 @@ const pt = class pt extends HTMLElement {
|
|
|
716
716
|
{ selector: ".ng-container-body", type: null },
|
|
717
717
|
{ selector: ".ng-container-left", type: "left" },
|
|
718
718
|
{ selector: ".ng-container-right", type: "right" }
|
|
719
|
-
].forEach(({ selector: s, type:
|
|
719
|
+
].forEach(({ selector: s, type: i }) => {
|
|
720
720
|
var n, o, a;
|
|
721
|
-
(n = this.querySelector(`${s} .ng-part-header`)) == null || n.appendChild(t(this, ct).call(this, t(this, et),
|
|
721
|
+
(n = this.querySelector(`${s} .ng-part-header`)) == null || n.appendChild(t(this, ct).call(this, t(this, et), i, "header")), (o = this.querySelector(`${s} .ng-virtual-spacer`)) == null || o.before(t(this, ct).call(this, t(this, et), i, "body")), (a = this.querySelector(`${s} .ng-part-footer`)) == null || a.appendChild(t(this, ct).call(this, t(this, et), i, "footer"));
|
|
722
722
|
});
|
|
723
723
|
}, "#renderSplitContainers"));
|
|
724
724
|
d(this, Yt, /* @__PURE__ */ h(() => {
|
|
725
725
|
["left", "right", "body"].forEach((e) => {
|
|
726
|
-
const s = this.querySelector(`.ng-container-${e}`),
|
|
727
|
-
if (!s || !
|
|
726
|
+
const s = this.querySelector(`.ng-container-${e}`), i = s == null ? void 0 : s.querySelectorAll("table");
|
|
727
|
+
if (!s || !i || i.length === 0) return;
|
|
728
728
|
let n = 0;
|
|
729
|
-
|
|
729
|
+
i[0].querySelectorAll("col").forEach((o) => {
|
|
730
730
|
const a = parseInt(o.getAttribute("width"), 10);
|
|
731
731
|
isNaN(n) || (n += a);
|
|
732
732
|
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${n}px`, s.style.width = `${n}px`);
|
|
733
733
|
});
|
|
734
734
|
}, "#updateContainerWidths"));
|
|
735
|
-
d(this, ct, /* @__PURE__ */ h((e, s,
|
|
735
|
+
d(this, ct, /* @__PURE__ */ h((e, s, i) => {
|
|
736
736
|
const n = e.cloneNode(!0), o = n.querySelector("thead"), a = n.querySelector("tbody"), c = n.querySelector("tfoot");
|
|
737
|
-
if (
|
|
737
|
+
if (i === "header") {
|
|
738
738
|
if (a && a.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
739
739
|
const f = document.createElement("tbody");
|
|
740
740
|
f.className = "fixed-tbody", n.appendChild(f);
|
|
741
741
|
}
|
|
742
|
-
} else
|
|
742
|
+
} else i === "body" ? (o && o.remove(), c && c.remove(), a && (a.className = "bindable-tbody")) : i === "footer" && (o && o.remove(), a && a.remove());
|
|
743
743
|
return s === "left" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
744
744
|
l.getAttribute("fixed") !== "left" && l.remove();
|
|
745
745
|
}) : s === "right" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
@@ -971,12 +971,12 @@ const _e = class _e extends HTMLElement {
|
|
|
971
971
|
var e;
|
|
972
972
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
973
973
|
var o;
|
|
974
|
-
const
|
|
975
|
-
t(this, Tt).call(this, n,
|
|
974
|
+
const i = s.ctrlKey || s.metaKey || s.shiftKey, n = parseInt((o = s.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
|
|
975
|
+
t(this, Tt).call(this, n, i);
|
|
976
976
|
}), t(this, Tt).call(this, 0, !1);
|
|
977
977
|
}, "#init"));
|
|
978
978
|
d(this, Tt, /* @__PURE__ */ h((e, s = !1) => {
|
|
979
|
-
const
|
|
979
|
+
const i = /* @__PURE__ */ h(() => {
|
|
980
980
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
981
981
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((g) => g.style.setProperty("display", "none"));
|
|
982
982
|
const b = f.filter((g) => g.classList.contains("active"));
|
|
@@ -1004,7 +1004,7 @@ const _e = class _e extends HTMLElement {
|
|
|
1004
1004
|
const l = o.querySelectorAll("nine-table-sheet.active");
|
|
1005
1005
|
l == null || l.forEach((f) => {
|
|
1006
1006
|
f.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
1007
|
-
}),
|
|
1007
|
+
}), i();
|
|
1008
1008
|
}, "#switchSheet"));
|
|
1009
1009
|
}
|
|
1010
1010
|
connectedCallback() {
|
|
@@ -1016,24 +1016,24 @@ let de = _e;
|
|
|
1016
1016
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", de);
|
|
1017
1017
|
var I, Zt, kt, Gt;
|
|
1018
1018
|
const Ne = class Ne {
|
|
1019
|
-
constructor(
|
|
1019
|
+
constructor(r) {
|
|
1020
1020
|
d(this, I);
|
|
1021
1021
|
d(this, Zt, /* @__PURE__ */ h(() => {
|
|
1022
|
-
t(this, Gt).call(this), new ResizeObserver((
|
|
1023
|
-
for (let e of
|
|
1022
|
+
t(this, Gt).call(this), new ResizeObserver((r) => {
|
|
1023
|
+
for (let e of r)
|
|
1024
1024
|
t(this, I).getAttribute("auto-height") === "true" && t(this, kt).call(this);
|
|
1025
1025
|
}).observe(t(this, I));
|
|
1026
1026
|
}, "#init"));
|
|
1027
1027
|
d(this, kt, /* @__PURE__ */ h(() => {
|
|
1028
1028
|
var c, l;
|
|
1029
|
-
const
|
|
1030
|
-
if (
|
|
1031
|
-
const e = parseInt(t(this, I).getAttribute("max-display-row"), 10) || 10, s = Math.max(...
|
|
1029
|
+
const r = Array.from(t(this, I).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
1030
|
+
if (r.length === 0) return;
|
|
1031
|
+
const e = parseInt(t(this, I).getAttribute("max-display-row"), 10) || 10, s = Math.max(...r.map((f) => f.getRowHeight())), i = (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 = It.SCROLLBAR_SIZE, a = e * s + i + n + o;
|
|
1032
1032
|
t(this, I).style.height = `${a}px`;
|
|
1033
1033
|
}, "#applyAutoHeight"));
|
|
1034
1034
|
d(this, Gt, /* @__PURE__ */ h(() => {
|
|
1035
|
-
const e = Array.from(t(this, I).children).filter((c) => c.tagName === "TABLE"), s = t(this, I).getAttribute("auto-height") === "true",
|
|
1036
|
-
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, b = l <
|
|
1035
|
+
const e = Array.from(t(this, I).children).filter((c) => c.tagName === "TABLE"), s = t(this, I).getAttribute("auto-height") === "true", i = e.length, n = e.map((c, l) => {
|
|
1036
|
+
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, b = l < i - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
1037
1037
|
return u + b;
|
|
1038
1038
|
}).join(""), o = e.map((c, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
1039
1039
|
t(this, I).shadowRoot.innerHTML = `
|
|
@@ -1164,32 +1164,32 @@ const Ne = class Ne {
|
|
|
1164
1164
|
});
|
|
1165
1165
|
});
|
|
1166
1166
|
}, "#render"));
|
|
1167
|
-
y(this, I,
|
|
1167
|
+
y(this, I, r), t(this, Zt).call(this);
|
|
1168
1168
|
}
|
|
1169
1169
|
};
|
|
1170
1170
|
I = new WeakMap(), Zt = new WeakMap(), kt = new WeakMap(), Gt = new WeakMap(), h(Ne, "LayoutManager");
|
|
1171
1171
|
let fe = Ne;
|
|
1172
1172
|
var Ct, ht;
|
|
1173
1173
|
const We = class We {
|
|
1174
|
-
constructor(
|
|
1174
|
+
constructor(r) {
|
|
1175
1175
|
d(this, Ct);
|
|
1176
1176
|
d(this, ht, -1);
|
|
1177
1177
|
E(this, "count", /* @__PURE__ */ h(() => t(this, Ct).rawRecords.length, "count"));
|
|
1178
|
-
y(this, Ct,
|
|
1178
|
+
y(this, Ct, r);
|
|
1179
1179
|
}
|
|
1180
1180
|
get at() {
|
|
1181
1181
|
return t(this, ht);
|
|
1182
1182
|
}
|
|
1183
|
-
set at(
|
|
1184
|
-
y(this, ht, parseInt(
|
|
1183
|
+
set at(r) {
|
|
1184
|
+
y(this, ht, parseInt(r, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, ht)}"]`) && setTimeout(() => {
|
|
1185
1185
|
});
|
|
1186
1186
|
}
|
|
1187
1187
|
};
|
|
1188
1188
|
Ct = new WeakMap(), ht = new WeakMap(), h(We, "ngRow");
|
|
1189
1189
|
let ge = We;
|
|
1190
|
-
var _, C, N, dt, Jt, Y, Qt,
|
|
1190
|
+
var _, C, N, dt, Jt, Y, Qt, rt, Lt, te, ee, ft;
|
|
1191
1191
|
const B = class B {
|
|
1192
|
-
constructor(
|
|
1192
|
+
constructor(r, e) {
|
|
1193
1193
|
d(this, _);
|
|
1194
1194
|
d(this, C);
|
|
1195
1195
|
d(this, N, []);
|
|
@@ -1198,35 +1198,35 @@ const B = class B {
|
|
|
1198
1198
|
d(this, Y, []);
|
|
1199
1199
|
d(this, Qt, /* @__PURE__ */ h(() => {
|
|
1200
1200
|
y(this, Y, []);
|
|
1201
|
-
const
|
|
1202
|
-
Array.from(
|
|
1201
|
+
const r = t(this, _).template || [];
|
|
1202
|
+
Array.from(r).forEach((e) => {
|
|
1203
1203
|
var s;
|
|
1204
1204
|
t(this, Y).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1205
1205
|
}), (t(this, C).rawRecords || []).forEach((e) => {
|
|
1206
1206
|
e.__ng || (e.__ng = t(this, Lt).call(this)), e.__ng.height = t(this, Y).slice();
|
|
1207
1207
|
});
|
|
1208
1208
|
}, "#initialize"));
|
|
1209
|
-
d(this,
|
|
1210
|
-
const
|
|
1211
|
-
|
|
1209
|
+
d(this, rt, /* @__PURE__ */ h(() => {
|
|
1210
|
+
const r = t(this, _).shadowRoot.querySelector("nine-table-sheets");
|
|
1211
|
+
r == null || r.classList.toggle("nodata", this.length === 0), t(this, _).shadowRoot.querySelectorAll("nine-table-sheet").forEach((e) => {
|
|
1212
1212
|
e.invalidate();
|
|
1213
1213
|
});
|
|
1214
1214
|
}, "#invalidate"));
|
|
1215
|
-
E(this, "get", /* @__PURE__ */ h((
|
|
1215
|
+
E(this, "get", /* @__PURE__ */ h((r, e) => {
|
|
1216
1216
|
var n;
|
|
1217
1217
|
const s = this.getValidData();
|
|
1218
1218
|
if (!s || s.length <= 0) return;
|
|
1219
|
-
if (
|
|
1220
|
-
if (
|
|
1221
|
-
const
|
|
1219
|
+
if (r == null) return t(this, ft).call(this, s);
|
|
1220
|
+
if (r < 0 || r >= s.length) return null;
|
|
1221
|
+
const i = typeof ((n = t(this, _).fields) == null ? void 0 : n.get) == "function" ? t(this, _).fields.get() : [];
|
|
1222
1222
|
if (e != null) {
|
|
1223
|
-
const o =
|
|
1224
|
-
return o >= 0 ? s[
|
|
1223
|
+
const o = i.indexOf(e);
|
|
1224
|
+
return o >= 0 ? s[r].v[o] : null;
|
|
1225
1225
|
}
|
|
1226
|
-
return t(this, ft).call(this, s[
|
|
1226
|
+
return t(this, ft).call(this, s[r]);
|
|
1227
1227
|
}, "get"));
|
|
1228
|
-
E(this, "set", /* @__PURE__ */ h((
|
|
1229
|
-
this.clear(), this.add(
|
|
1228
|
+
E(this, "set", /* @__PURE__ */ h((r) => {
|
|
1229
|
+
this.clear(), this.add(r, !1), t(this, rt).call(this);
|
|
1230
1230
|
}, "set"));
|
|
1231
1231
|
d(this, Lt, /* @__PURE__ */ h(() => ({
|
|
1232
1232
|
rowState: B.ROW_STATE.EMPTY,
|
|
@@ -1238,84 +1238,84 @@ const B = class B {
|
|
|
1238
1238
|
_: [0, 0, 0, 0, B.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Y).slice(), -1, {}, {}]
|
|
1239
1239
|
}), "#getDefaultMeta"));
|
|
1240
1240
|
E(this, "reset", /* @__PURE__ */ h(() => {
|
|
1241
|
-
y(this, N, []), y(this, dt, []), t(this,
|
|
1241
|
+
y(this, N, []), y(this, dt, []), t(this, rt).call(this);
|
|
1242
1242
|
}, "reset"));
|
|
1243
1243
|
E(this, "clear", /* @__PURE__ */ h(() => {
|
|
1244
|
-
var i;
|
|
1245
|
-
t(this, C).rawRecords = [], y(this, N, []), y(this, dt, []), (i = t(this, C).viewRecords) != null && i.reset && t(this, C).viewRecords.reset();
|
|
1246
|
-
}, "clear"));
|
|
1247
|
-
d(this, te, /* @__PURE__ */ h((i) => {
|
|
1248
1244
|
var r;
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1245
|
+
t(this, C).rawRecords = [], y(this, N, []), y(this, dt, []), (r = t(this, C).viewRecords) != null && r.reset && t(this, C).viewRecords.reset();
|
|
1246
|
+
}, "clear"));
|
|
1247
|
+
d(this, te, /* @__PURE__ */ h((r) => {
|
|
1248
|
+
var i;
|
|
1249
|
+
Array.isArray(r) || (r = [r]);
|
|
1250
|
+
const e = typeof ((i = t(this, _).fields) == null ? void 0 : i.get) == "function" ? t(this, _).fields.get() : Object.keys(r[0] || {}), s = [];
|
|
1251
|
+
return r.forEach((n) => {
|
|
1252
1252
|
const o = { v: [] };
|
|
1253
1253
|
e.forEach((a) => {
|
|
1254
1254
|
o.v.push(n[a] !== void 0 && n[a] !== null ? n[a] : "");
|
|
1255
1255
|
}), s.push(o);
|
|
1256
1256
|
}), s;
|
|
1257
1257
|
}, "#json2Array"));
|
|
1258
|
-
d(this, ee, /* @__PURE__ */ h((
|
|
1258
|
+
d(this, ee, /* @__PURE__ */ h((r) => (Array.isArray(r) || (r = [r]), r.forEach((e) => {
|
|
1259
1259
|
e.__ng = t(this, Lt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = B.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1260
|
-
}),
|
|
1261
|
-
E(this, "add", /* @__PURE__ */ h((
|
|
1262
|
-
|
|
1263
|
-
const s = t(this, te).call(this,
|
|
1260
|
+
}), r), "#defaultInsert"));
|
|
1261
|
+
E(this, "add", /* @__PURE__ */ h((r, e = !0) => {
|
|
1262
|
+
r === void 0 && (r = {});
|
|
1263
|
+
const s = t(this, te).call(this, r);
|
|
1264
1264
|
t(this, C).rawRecords = t(this, C).rawRecords.concat(t(this, ee).call(this, s)), this.resetRecords();
|
|
1265
|
-
const
|
|
1265
|
+
const i = this.count() - 1;
|
|
1266
1266
|
return e || s.forEach((n, o) => {
|
|
1267
|
-
const a = t(this, C).rawRecords[
|
|
1267
|
+
const a = t(this, C).rawRecords[i - o];
|
|
1268
1268
|
a && (a.__ng.rowState = B.ROW_STATE.EMPTY);
|
|
1269
|
-
}), t(this,
|
|
1269
|
+
}), t(this, rt).call(this), i;
|
|
1270
1270
|
}, "add"));
|
|
1271
|
-
E(this, "delete", /* @__PURE__ */ h((
|
|
1271
|
+
E(this, "delete", /* @__PURE__ */ h((r) => {
|
|
1272
1272
|
let e = [];
|
|
1273
|
-
Array.isArray(
|
|
1273
|
+
Array.isArray(r) ? e = r : typeof r > "u" ? e = [t(this, C).host.row.at] : e = [parseInt(r, 10)], e.sort((s, i) => i - s).forEach((s) => {
|
|
1274
1274
|
if (t(this, N)[s]) {
|
|
1275
|
-
const
|
|
1276
|
-
t(this, N)[s].__ng.rowState === B.ROW_STATE.INSERT ? t(this, C).rawRecords = t(this, C).rawRecords.filter((n) => n.__ng.rowid !==
|
|
1277
|
-
n.__ng.rowid ===
|
|
1275
|
+
const i = t(this, N)[s].__ng.rowid;
|
|
1276
|
+
t(this, N)[s].__ng.rowState === B.ROW_STATE.INSERT ? t(this, C).rawRecords = t(this, C).rawRecords.filter((n) => n.__ng.rowid !== i) : t(this, C).rawRecords.forEach((n) => {
|
|
1277
|
+
n.__ng.rowid === i && (n.__ng.deleted = !0, n.__ng.rowState = B.ROW_STATE.DELETE);
|
|
1278
1278
|
});
|
|
1279
1279
|
}
|
|
1280
|
-
}), this.resetRecords(), t(this,
|
|
1280
|
+
}), this.resetRecords(), t(this, rt).call(this);
|
|
1281
1281
|
}, "delete"));
|
|
1282
|
-
E(this, "setValue", /* @__PURE__ */ h((
|
|
1282
|
+
E(this, "setValue", /* @__PURE__ */ h((r, e, s) => {
|
|
1283
1283
|
var c;
|
|
1284
|
-
|
|
1284
|
+
r = parseInt(r, 10);
|
|
1285
1285
|
const n = (typeof ((c = t(this, _).fields) == null ? void 0 : c.get) == "function" ? t(this, _).fields.get() : []).indexOf(e);
|
|
1286
1286
|
if (n < 0) return;
|
|
1287
|
-
const o = this.getValidData()[
|
|
1287
|
+
const o = this.getValidData()[r];
|
|
1288
1288
|
if (!o) return;
|
|
1289
1289
|
const a = o.v[n];
|
|
1290
1290
|
a !== s && o.__ng.rowState !== B.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = a), o.__ng.rowState = B.ROW_STATE.UPDATE), o.v[n] = s;
|
|
1291
1291
|
}, "setValue"));
|
|
1292
1292
|
E(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1293
|
-
y(this, dt, t(this, C).rawRecords.filter((
|
|
1294
|
-
|
|
1295
|
-
}), t(this, N).forEach((
|
|
1296
|
-
|
|
1293
|
+
y(this, dt, t(this, C).rawRecords.filter((r) => !r.__ng.deleted)), y(this, N, t(this, C).rawRecords.filter((r) => !r.__ng.deleted && !r.__ng.filtered)), t(this, C).rawRecords.forEach((r, e) => {
|
|
1294
|
+
r.__ng.rowidx = e;
|
|
1295
|
+
}), t(this, N).forEach((r, e) => {
|
|
1296
|
+
r.__ng.i = e;
|
|
1297
1297
|
});
|
|
1298
1298
|
}, "resetRecords"));
|
|
1299
1299
|
E(this, "getValidData", /* @__PURE__ */ h(() => (t(this, N).length === 0 && t(this, C).rawRecords.length > 0 && this.resetRecords(), t(this, N)), "getValidData"));
|
|
1300
|
-
d(this, ft, /* @__PURE__ */ h((
|
|
1300
|
+
d(this, ft, /* @__PURE__ */ h((r) => {
|
|
1301
1301
|
var o;
|
|
1302
|
-
if (!
|
|
1303
|
-
const e = !Array.isArray(
|
|
1302
|
+
if (!r) return r;
|
|
1303
|
+
const e = !Array.isArray(r), s = e ? [r] : r, i = typeof ((o = t(this, _).fields) == null ? void 0 : o.get) == "function" ? t(this, _).fields.get() : [], n = s.filter((a) => !a.__ng.deleted).map((a) => {
|
|
1304
1304
|
const c = {};
|
|
1305
|
-
return
|
|
1305
|
+
return i.forEach((l, f) => {
|
|
1306
1306
|
c[l] = a.v ? a.v[f] : a[l];
|
|
1307
1307
|
}), c.__ng = a.__ng, c;
|
|
1308
1308
|
});
|
|
1309
1309
|
return e ? n[0] : n;
|
|
1310
1310
|
}, "#conv"));
|
|
1311
1311
|
E(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1312
|
-
y(this, _,
|
|
1312
|
+
y(this, _, r), y(this, C, e), t(this, Qt).call(this);
|
|
1313
1313
|
}
|
|
1314
1314
|
get source() {
|
|
1315
1315
|
return t(this, ft).call(this, t(this, C).rawRecords);
|
|
1316
1316
|
}
|
|
1317
|
-
set source(
|
|
1318
|
-
this.clear(), this.add(
|
|
1317
|
+
set source(r) {
|
|
1318
|
+
this.clear(), this.add(r, !1);
|
|
1319
1319
|
}
|
|
1320
1320
|
get nextId() {
|
|
1321
1321
|
return ++Ue(this, Jt)._;
|
|
@@ -1330,7 +1330,7 @@ const B = class B {
|
|
|
1330
1330
|
return this.length;
|
|
1331
1331
|
}
|
|
1332
1332
|
};
|
|
1333
|
-
_ = new WeakMap(), C = new WeakMap(), N = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), Y = new WeakMap(), Qt = new WeakMap(),
|
|
1333
|
+
_ = new WeakMap(), C = new WeakMap(), N = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), Y = new WeakMap(), Qt = new WeakMap(), rt = new WeakMap(), Lt = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), ft = new WeakMap(), h(B, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1334
1334
|
E(B, "ROW_STATE", {
|
|
1335
1335
|
EMPTY: "EMPTY",
|
|
1336
1336
|
NORMAL: "NORMAL",
|
|
@@ -1339,56 +1339,56 @@ E(B, "ROW_STATE", {
|
|
|
1339
1339
|
DELETE: "DELETE"
|
|
1340
1340
|
});
|
|
1341
1341
|
let ue = B;
|
|
1342
|
-
var
|
|
1342
|
+
var it;
|
|
1343
1343
|
const Oe = class Oe {
|
|
1344
|
-
constructor(
|
|
1345
|
-
d(this,
|
|
1346
|
-
y(this,
|
|
1344
|
+
constructor(r) {
|
|
1345
|
+
d(this, it);
|
|
1346
|
+
y(this, it, r), this.row = new ge(this), this.data = new ue(t(this, it), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1347
1347
|
var e;
|
|
1348
|
-
(e = t(this,
|
|
1348
|
+
(e = t(this, it).view) != null && e.redraw && t(this, it).view.redraw();
|
|
1349
1349
|
}, this.setDataSource = (e) => {
|
|
1350
1350
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1351
1351
|
}, this.getRowState = (e) => {
|
|
1352
|
-
var
|
|
1352
|
+
var i, n;
|
|
1353
1353
|
const s = parseInt(e, 10);
|
|
1354
1354
|
if (!(s >= this.data.count()))
|
|
1355
|
-
return (n = (
|
|
1355
|
+
return (n = (i = this.data.getValidData()[s]) == null ? void 0 : i.__ng) == null ? void 0 : n.rowState;
|
|
1356
1356
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1357
1357
|
this.row.at = e;
|
|
1358
|
-
}, 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,
|
|
1359
|
-
e = parseInt(e, 10), this.data.setValue(e, s,
|
|
1358
|
+
}, 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, i) => {
|
|
1359
|
+
e = parseInt(e, 10), this.data.setValue(e, s, i);
|
|
1360
1360
|
}, this.setDataSource([]);
|
|
1361
1361
|
}
|
|
1362
1362
|
};
|
|
1363
|
-
|
|
1363
|
+
it = new WeakMap(), h(Oe, "ngDataManager");
|
|
1364
1364
|
let be = Oe;
|
|
1365
1365
|
var gt, H, Ht, se;
|
|
1366
1366
|
const Be = class Be {
|
|
1367
1367
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1368
|
-
constructor(
|
|
1368
|
+
constructor(r) {
|
|
1369
1369
|
d(this, gt);
|
|
1370
1370
|
d(this, H, []);
|
|
1371
|
-
E(this, "add", /* @__PURE__ */ h((
|
|
1372
|
-
|
|
1373
|
-
t(this, H).some((
|
|
1371
|
+
E(this, "add", /* @__PURE__ */ h((r, e = "string") => {
|
|
1372
|
+
r.forEach((s) => {
|
|
1373
|
+
t(this, H).some((i) => i.name === s) || t(this, H).push({ name: s, type: e });
|
|
1374
1374
|
}), t(this, Ht).call(this);
|
|
1375
1375
|
}, "add"));
|
|
1376
1376
|
d(this, Ht, /* @__PURE__ */ h(() => {
|
|
1377
|
-
const
|
|
1377
|
+
const r = /* @__PURE__ */ new Map();
|
|
1378
1378
|
t(this, H).forEach((e) => {
|
|
1379
|
-
|
|
1380
|
-
}), y(this, H, Array.from(
|
|
1379
|
+
r.set(e.name, e.type);
|
|
1380
|
+
}), y(this, H, Array.from(r, ([e, s]) => ({ name: e, type: s }))), y(this, H, t(this, H).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, H).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
1381
1381
|
}, "#adjust"));
|
|
1382
1382
|
d(this, se, /* @__PURE__ */ h(() => {
|
|
1383
1383
|
y(this, H, []), R.log(t(this, gt).querySelectorAll("table"));
|
|
1384
|
-
const
|
|
1385
|
-
if (!(!
|
|
1386
|
-
for (const e of
|
|
1387
|
-
R.log(e), $("[data-bind]", e).each((s,
|
|
1388
|
-
const n =
|
|
1384
|
+
const r = Array.from(t(this, gt).querySelectorAll("table"));
|
|
1385
|
+
if (!(!r || r.length === 0)) {
|
|
1386
|
+
for (const e of r)
|
|
1387
|
+
R.log(e), $("[data-bind]", e).each((s, i) => {
|
|
1388
|
+
const n = i.dataset.bind, o = i.getAttribute("data-type") || "string";
|
|
1389
1389
|
n && t(this, H).push({ name: n, type: o });
|
|
1390
1390
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
1391
|
-
$(`[${s}]`, e).each((
|
|
1391
|
+
$(`[${s}]`, e).each((i, n) => {
|
|
1392
1392
|
var o = n.getAttribute(s);
|
|
1393
1393
|
if (o.indexOf("data.") < 0) {
|
|
1394
1394
|
const a = o.search(/[(]/g);
|
|
@@ -1411,44 +1411,44 @@ const Be = class Be {
|
|
|
1411
1411
|
t(this, Ht).call(this);
|
|
1412
1412
|
}
|
|
1413
1413
|
}, "#init"));
|
|
1414
|
-
y(this, gt,
|
|
1414
|
+
y(this, gt, r), t(this, se).call(this);
|
|
1415
1415
|
}
|
|
1416
1416
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
1417
1417
|
get() {
|
|
1418
|
-
return t(this, H).map((
|
|
1418
|
+
return t(this, H).map((r) => r.name);
|
|
1419
1419
|
}
|
|
1420
1420
|
// π― λ΄λΆ κ°μ²΄ ν΅μ§Έλ‘ μ»κΈ°
|
|
1421
1421
|
getFields() {
|
|
1422
1422
|
return t(this, H);
|
|
1423
1423
|
}
|
|
1424
1424
|
// π― νΉμ νλμ λ°μ΄ν° νμ
μ‘°ν
|
|
1425
|
-
getType(
|
|
1426
|
-
const e = t(this, H).find((s) => s.name ===
|
|
1425
|
+
getType(r) {
|
|
1426
|
+
const e = t(this, H).find((s) => s.name === r);
|
|
1427
1427
|
return e ? e.type : "string";
|
|
1428
1428
|
}
|
|
1429
|
-
indexOf(
|
|
1430
|
-
return t(this, H).findIndex((e) => e.name ===
|
|
1429
|
+
indexOf(r) {
|
|
1430
|
+
return t(this, H).findIndex((e) => e.name === r);
|
|
1431
1431
|
}
|
|
1432
|
-
includes(
|
|
1433
|
-
return t(this, H).some((e) => e.name ===
|
|
1432
|
+
includes(r) {
|
|
1433
|
+
return t(this, H).some((e) => e.name === r);
|
|
1434
1434
|
}
|
|
1435
1435
|
};
|
|
1436
1436
|
gt = new WeakMap(), H = new WeakMap(), Ht = new WeakMap(), se = new WeakMap(), h(Be, "ngFields");
|
|
1437
1437
|
let ye = Be;
|
|
1438
|
-
var nt,
|
|
1438
|
+
var nt, re, ie;
|
|
1439
1439
|
const ze = class ze extends HTMLElement {
|
|
1440
1440
|
constructor() {
|
|
1441
1441
|
super();
|
|
1442
1442
|
//#created = false;
|
|
1443
1443
|
d(this, nt);
|
|
1444
|
-
d(this,
|
|
1445
|
-
d(this,
|
|
1446
|
-
this.fields = new ye(this), y(this,
|
|
1444
|
+
d(this, re);
|
|
1445
|
+
d(this, ie, /* @__PURE__ */ h(() => {
|
|
1446
|
+
this.fields = new ye(this), y(this, re, new fe(this)), R.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1447
1447
|
}, "#init"));
|
|
1448
1448
|
this.attachShadow({ mode: "open" }), y(this, nt, new be(this));
|
|
1449
1449
|
}
|
|
1450
1450
|
connectedCallback() {
|
|
1451
|
-
t(this,
|
|
1451
|
+
t(this, ie).call(this);
|
|
1452
1452
|
}
|
|
1453
1453
|
disconnectedCallback() {
|
|
1454
1454
|
R.log("NineTable disconnected.");
|
|
@@ -1466,7 +1466,7 @@ const ze = class ze extends HTMLElement {
|
|
|
1466
1466
|
return t(this, nt);
|
|
1467
1467
|
}
|
|
1468
1468
|
};
|
|
1469
|
-
nt = new WeakMap(),
|
|
1469
|
+
nt = new WeakMap(), re = new WeakMap(), ie = new WeakMap(), h(ze, "NineTable");
|
|
1470
1470
|
let pe = ze;
|
|
1471
1471
|
customElements.get("nine-table") || customElements.define("nine-table", pe);
|
|
1472
1472
|
const mt = class mt extends HTMLElement {
|
|
@@ -1496,13 +1496,13 @@ const De = class De extends me {
|
|
|
1496
1496
|
E(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1497
1497
|
if (t(this, p))
|
|
1498
1498
|
if (t(this, p).closest("tbody")) {
|
|
1499
|
-
const s = t(this, p).closest("tr").data,
|
|
1499
|
+
const s = t(this, p).closest("tr").data, i = parseInt(t(this, p).dataset.row);
|
|
1500
1500
|
if (!s) return "";
|
|
1501
1501
|
if (ninegrid.isNull(t(this, p).dataset.expr)) {
|
|
1502
1502
|
if (!ninegrid.isNull(t(this, p).dataset.bind))
|
|
1503
1503
|
return s[t(this, p).dataset.bind] || ninegrid.nvl(e, "");
|
|
1504
1504
|
} else try {
|
|
1505
|
-
return this.getExprValue(t(this, p).dataset.expr, s,
|
|
1505
|
+
return this.getExprValue(t(this, p).dataset.expr, s, i, t(this, p));
|
|
1506
1506
|
} catch {
|
|
1507
1507
|
console.error(t(this, p).dataset.expr, s, t(this, p).dataset.row);
|
|
1508
1508
|
}
|
|
@@ -1517,14 +1517,14 @@ const De = class De extends me {
|
|
|
1517
1517
|
if (!(!t(this, L) || !t(this, L).template || !t(this, p).closest("tbody.bindable"))) {
|
|
1518
1518
|
var e = ninegrid.j.querySelectorAll(t(this, p)).attr("suppress");
|
|
1519
1519
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1520
|
-
var s = t(this, p).closest("tr"),
|
|
1520
|
+
var s = t(this, p).closest("tr"), i = [];
|
|
1521
1521
|
$("th,td", s).each((m, W) => {
|
|
1522
1522
|
var T = ninegrid.j.querySelectorAll(W).attr("suppress");
|
|
1523
|
-
T && W.dataset.row && (T = parseInt(T), !isNaN(T) && T <= e &&
|
|
1524
|
-
}),
|
|
1523
|
+
T && W.dataset.row && (T = parseInt(T), !isNaN(T) && T <= e && i.push(T));
|
|
1524
|
+
}), i.sort();
|
|
1525
1525
|
var n = !1;
|
|
1526
1526
|
if (parseInt(s.sectionRowIndex / t(this, L).template.length) > 0)
|
|
1527
|
-
for (var o of
|
|
1527
|
+
for (var o of i) {
|
|
1528
1528
|
if (o > e) break;
|
|
1529
1529
|
var a = parseInt(t(this, p).dataset.row), c = a - 1, l = t(this, p).closest("tr").data, f = t(this, L).data.get(c);
|
|
1530
1530
|
t(this, p).dataset.matrixRow;
|
|
@@ -1542,12 +1542,12 @@ const De = class De extends me {
|
|
|
1542
1542
|
}
|
|
1543
1543
|
}
|
|
1544
1544
|
}, "#resetSuppress"));
|
|
1545
|
-
E(this, "getExprValue", /* @__PURE__ */ h((e, s,
|
|
1545
|
+
E(this, "getExprValue", /* @__PURE__ */ h((e, s, i, n) => {
|
|
1546
1546
|
if (typeof e < "u")
|
|
1547
1547
|
try {
|
|
1548
|
-
|
|
1548
|
+
i = parseInt(i);
|
|
1549
1549
|
const o = e.replace("()", "");
|
|
1550
|
-
return t(this, L)[o] ? t(this, L)[o].call(this, s,
|
|
1550
|
+
return t(this, L)[o] ? t(this, L)[o].call(this, s, i, t(this, p)) : t(this, L).exprFunction(e).call(this, s, i, t(this, L).data);
|
|
1551
1551
|
} catch {
|
|
1552
1552
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1553
1553
|
}
|
|
@@ -1564,8 +1564,8 @@ const De = class De extends me {
|
|
|
1564
1564
|
}
|
|
1565
1565
|
set value(e) {
|
|
1566
1566
|
var s = parseInt(t(this, p).dataset.row);
|
|
1567
|
-
const
|
|
1568
|
-
s < 0 ? t(this, L).data.setValueNF(parseInt(t(this, p).dataset.index), t(this, p).dataset.bind, e,
|
|
1567
|
+
const i = this.getAttribute("update-row-state") != "false";
|
|
1568
|
+
s < 0 ? t(this, L).data.setValueNF(parseInt(t(this, p).dataset.index), t(this, p).dataset.bind, e, i) : t(this, L).data.setValue(s, t(this, p).dataset.bind, e, i);
|
|
1569
1569
|
}
|
|
1570
1570
|
get row() {
|
|
1571
1571
|
return parseInt(t(this, p).dataset.row);
|
|
@@ -1642,9 +1642,9 @@ const je = class je extends xe {
|
|
|
1642
1642
|
if (t(this, ot) == "number") {
|
|
1643
1643
|
let n = [];
|
|
1644
1644
|
if (t(this, U) && Number(t(this, U)) > 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, U) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
|
|
1645
|
-
var s = e.target.value,
|
|
1646
|
-
if (
|
|
1647
|
-
var s = s.substr(
|
|
1645
|
+
var s = e.target.value, i = s.indexOf(".");
|
|
1646
|
+
if (i >= 0) {
|
|
1647
|
+
var s = s.substr(i + 1, s.length);
|
|
1648
1648
|
s.length >= Number(t(this, U)) && e.preventDefault();
|
|
1649
1649
|
}
|
|
1650
1650
|
}
|