@ninebone/table 0.0.526 → 0.0.528
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 +330 -328
- 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
|
@@ -4,7 +4,7 @@ var Fe = (R) => {
|
|
|
4
4
|
};
|
|
5
5
|
var Ue = (R, i, e) => i in R ? je(R, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : R[i] = e;
|
|
6
6
|
var h = (R, i) => je(R, "name", { value: i, configurable: !0 });
|
|
7
|
-
var
|
|
7
|
+
var S = (R, i, e) => Ue(R, typeof i != "symbol" ? i + "" : i, e), Ve = (R, i, e) => i.has(R) || Fe("Cannot " + e);
|
|
8
8
|
var t = (R, i, e) => (Ve(R, i, "read from private field"), e ? e.call(R) : i.get(R)), d = (R, i, e) => i.has(R) ? Fe("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(R) : i.set(R, e), y = (R, i, e, s) => (Ve(R, i, "write to private field"), s ? s.call(R, e) : i.set(R, e), e);
|
|
9
9
|
var Ye = (R, i, e, s) => ({
|
|
10
10
|
set _(r) {
|
|
@@ -40,38 +40,38 @@ const He = class He extends HTMLElement {
|
|
|
40
40
|
this.refresh();
|
|
41
41
|
})), t(this, Z).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
|
-
|
|
43
|
+
S(this, "refresh", /* @__PURE__ */ h(() => {
|
|
44
44
|
if (!t(this, z) || !t(this, w) || t(this, j)) return;
|
|
45
45
|
const e = t(this, w).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const r = t(this, w).track, n = t(this, w).thumb,
|
|
48
|
-
if (
|
|
49
|
-
|
|
47
|
+
const r = t(this, w).track, n = t(this, w).thumb, a = t(this, z).querySelector(".ng-container-bottom"), o = e.clientWidth, c = s.scrollWidth;
|
|
48
|
+
if (o !== 0 && c > o)
|
|
49
|
+
a && (a.style.display = "flex");
|
|
50
50
|
else {
|
|
51
|
-
|
|
51
|
+
a && (a.style.display = "none");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
54
|
const l = r.clientWidth;
|
|
55
55
|
if (l <= 0) return;
|
|
56
|
-
const f = Math.max(Math.min(l * (
|
|
56
|
+
const f = Math.max(Math.min(l * (o / c), l), 20);
|
|
57
57
|
n.style.width = `${f}px`;
|
|
58
|
-
const u = e.scrollLeft,
|
|
59
|
-
let
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
|
|
58
|
+
const u = e.scrollLeft, g = c - o;
|
|
59
|
+
let b = 0;
|
|
60
|
+
g > 0 && (b = parseInt(u / g * (l - f), 10)), b < 0 && (b = 0);
|
|
61
|
+
const x = l - f;
|
|
62
|
+
b > x && (b = x), n.style.left = `${b}px`, t(this, w).left.disabled = b === 0, t(this, w).right.disabled = b >= x - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
64
|
d(this, G, /* @__PURE__ */ h((e) => {
|
|
65
65
|
if (!t(this, w)) return !1;
|
|
66
66
|
const s = t(this, w).container, r = s.querySelector("table");
|
|
67
67
|
if (!r) return !1;
|
|
68
|
-
const n = t(this, w).track.getBoundingClientRect(),
|
|
69
|
-
let
|
|
70
|
-
|
|
71
|
-
const c = n.width -
|
|
72
|
-
|
|
68
|
+
const n = t(this, w).track.getBoundingClientRect(), a = t(this, w).thumb.clientWidth;
|
|
69
|
+
let o = e;
|
|
70
|
+
o < 0 && (o = 0);
|
|
71
|
+
const c = n.width - a;
|
|
72
|
+
o > c && (o = c), o = parseInt(o, 10), t(this, w).thumb.style.left = `${o}px`, t(this, w).left.disabled = o === 0, t(this, w).right.disabled = o >= c - 1;
|
|
73
73
|
const l = s.clientWidth, u = r.scrollWidth - l;
|
|
74
|
-
return c > 0 && u > 0 && (s.scrollLeft =
|
|
74
|
+
return c > 0 && u > 0 && (s.scrollLeft = o / c * u), o > 0 && o < c - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
76
|
d(this, _t, /* @__PURE__ */ h(() => {
|
|
77
77
|
const e = /* @__PURE__ */ h((r) => {
|
|
@@ -79,8 +79,8 @@ const He = class He extends HTMLElement {
|
|
|
79
79
|
const n = parseInt(t(this, w).thumb.style.left || 0, 10);
|
|
80
80
|
t(this, G).call(this, n + r), y(this, X, setInterval(() => {
|
|
81
81
|
clearInterval(t(this, X)), y(this, K, setInterval(() => {
|
|
82
|
-
const
|
|
83
|
-
t(this, G).call(this,
|
|
82
|
+
const a = parseInt(t(this, w).thumb.style.left || 0, 10);
|
|
83
|
+
t(this, G).call(this, a + r) || clearInterval(t(this, K));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), s = /* @__PURE__ */ h(() => {
|
|
@@ -95,19 +95,19 @@ const He = class He extends HTMLElement {
|
|
|
95
95
|
}), t(this, w).left.addEventListener("touchstart", () => e(-20)), t(this, w).right.addEventListener("touchstart", () => e(20)), t(this, w).track.addEventListener("mousedown", (r) => {
|
|
96
96
|
if (r.button !== 0) return;
|
|
97
97
|
r.preventDefault();
|
|
98
|
-
const n = t(this, w).track.getBoundingClientRect(),
|
|
99
|
-
t(this, G).call(this, r.clientX - n.left -
|
|
98
|
+
const n = t(this, w).track.getBoundingClientRect(), a = t(this, w).thumb.clientWidth;
|
|
99
|
+
t(this, G).call(this, r.clientX - n.left - a / 2);
|
|
100
100
|
}), t(this, w).thumb.addEventListener("mousedown", (r) => {
|
|
101
101
|
if (r.button !== 0) return;
|
|
102
102
|
r.stopPropagation(), r.preventDefault(), y(this, j, !0), this.shiftX = r.clientX - t(this, w).thumb.getBoundingClientRect().left;
|
|
103
|
-
const n = /* @__PURE__ */ h((
|
|
103
|
+
const n = /* @__PURE__ */ h((o) => {
|
|
104
104
|
if (!t(this, j)) return;
|
|
105
105
|
const c = t(this, w).track.getBoundingClientRect();
|
|
106
|
-
t(this, G).call(this,
|
|
107
|
-
}, "onMouseMove"),
|
|
108
|
-
y(this, j, !1), s(), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup",
|
|
106
|
+
t(this, G).call(this, o.clientX - c.left - this.shiftX);
|
|
107
|
+
}, "onMouseMove"), a = /* @__PURE__ */ h(() => {
|
|
108
|
+
y(this, j, !1), s(), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", a), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
|
-
document.addEventListener("mousemove", n), document.addEventListener("mouseup",
|
|
110
|
+
document.addEventListener("mousemove", n), document.addEventListener("mouseup", a);
|
|
111
111
|
});
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
@@ -211,10 +211,10 @@ const Me = class Me extends HTMLElement {
|
|
|
211
211
|
d(this, q);
|
|
212
212
|
d(this, xt, 0);
|
|
213
213
|
d(this, vt, 0);
|
|
214
|
-
|
|
214
|
+
S(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
215
|
if (!t(this, F) || !t(this, q)) return;
|
|
216
216
|
H.log("nine-table-vscrollbar.refresh");
|
|
217
|
-
const e = t(this, q).container, s = t(this, q).track, r = t(this, q).thumb, n = e.clientHeight,
|
|
217
|
+
const e = t(this, q).container, s = t(this, q).track, r = t(this, q).thumb, n = e.clientHeight, o = (t(this, F).data.get() || []).length, c = t(this, ot).getRowHeight(), l = o * c;
|
|
218
218
|
if (l <= n) {
|
|
219
219
|
r.style.display = "none", t(this, q).top.disabled = !0, t(this, q).bottom.disabled = !0;
|
|
220
220
|
return;
|
|
@@ -224,43 +224,43 @@ const Me = class Me extends HTMLElement {
|
|
|
224
224
|
if (f <= 0) return;
|
|
225
225
|
const u = Math.max(Math.min(f * (n / l), f), 20);
|
|
226
226
|
r.style.height = `${u}px`;
|
|
227
|
-
const
|
|
228
|
-
let
|
|
229
|
-
|
|
227
|
+
const g = e.scrollTop, b = Math.max(l - n, 1);
|
|
228
|
+
let x = 0;
|
|
229
|
+
b > 0 && (x = g / b * (f - u));
|
|
230
230
|
const v = f - u;
|
|
231
|
-
|
|
231
|
+
x < 0 && (x = 0), x > v && (x = v), r.style.top = `${x}px`, t(this, q).top.disabled = g <= 0, t(this, q).bottom.disabled = g >= b - 1;
|
|
232
232
|
}, "refresh"));
|
|
233
233
|
d(this, Nt, /* @__PURE__ */ h(() => {
|
|
234
234
|
H.log("nine-table-vscrollbar.#init");
|
|
235
235
|
const e = t(this, q).container, s = /* @__PURE__ */ h(() => {
|
|
236
|
-
const n = (t(this, F).data.get() || []).length,
|
|
237
|
-
return n *
|
|
236
|
+
const n = (t(this, F).data.get() || []).length, a = t(this, ot).getRowHeight();
|
|
237
|
+
return n * a;
|
|
238
238
|
}, "getContentHeight");
|
|
239
239
|
e.addEventListener("scroll", () => {
|
|
240
240
|
t(this, J) || this.refresh();
|
|
241
241
|
}), t(this, q).thumb.addEventListener("mousedown", (r) => {
|
|
242
242
|
if (r.button !== 0) return;
|
|
243
243
|
r.stopPropagation(), r.preventDefault(), y(this, J, !0), y(this, xt, r.clientY), y(this, vt, e.scrollTop);
|
|
244
|
-
const n = /* @__PURE__ */ h((
|
|
244
|
+
const n = /* @__PURE__ */ h((o) => {
|
|
245
245
|
if (!t(this, J)) return;
|
|
246
|
-
const c = t(this, q).track.getBoundingClientRect(), l = t(this, q).thumb.clientHeight, u = c.height - l,
|
|
246
|
+
const c = t(this, q).track.getBoundingClientRect(), l = t(this, q).thumb.clientHeight, u = c.height - l, g = o.clientY - t(this, xt), b = e.clientHeight, x = s(), v = Math.max(x - b, 1);
|
|
247
247
|
if (u > 0 && v > 0) {
|
|
248
|
-
const
|
|
249
|
-
let
|
|
250
|
-
const
|
|
251
|
-
|
|
248
|
+
const A = g / u * v;
|
|
249
|
+
let m = t(this, vt) + A;
|
|
250
|
+
const W = Math.max(0, x - b);
|
|
251
|
+
m < 0 && (m = 0), m > W && (m = W), e.scrollTop = m;
|
|
252
252
|
}
|
|
253
253
|
this.refresh();
|
|
254
|
-
}, "onMouseMove"),
|
|
255
|
-
y(this, J, !1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup",
|
|
254
|
+
}, "onMouseMove"), a = /* @__PURE__ */ h(() => {
|
|
255
|
+
y(this, J, !1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", a), this.refresh();
|
|
256
256
|
}, "onMouseUp");
|
|
257
|
-
document.addEventListener("mousemove", n), document.addEventListener("mouseup",
|
|
257
|
+
document.addEventListener("mousemove", n), document.addEventListener("mouseup", a);
|
|
258
258
|
}), t(this, q).track.addEventListener("mousedown", (r) => {
|
|
259
259
|
if (r.button !== 0 || r.target === t(this, q).thumb) return;
|
|
260
|
-
const n = t(this, q).track.getBoundingClientRect(),
|
|
261
|
-
if (l > 0 &&
|
|
262
|
-
const
|
|
263
|
-
e.scrollTop =
|
|
260
|
+
const n = t(this, q).track.getBoundingClientRect(), a = t(this, q).thumb.clientHeight, o = r.clientY - n.top - a / 2, l = n.height - a, f = e.clientHeight, u = s(), g = Math.max(u - f, 1);
|
|
261
|
+
if (l > 0 && g > 0) {
|
|
262
|
+
const b = Math.max(0, Math.min(1, o / l));
|
|
263
|
+
e.scrollTop = b * g;
|
|
264
264
|
}
|
|
265
265
|
this.refresh();
|
|
266
266
|
}), t(this, q).top.addEventListener("click", () => {
|
|
@@ -355,47 +355,47 @@ const Me = class Me extends HTMLElement {
|
|
|
355
355
|
F = new WeakMap(), ot = new WeakMap(), J = new WeakMap(), q = new WeakMap(), xt = new WeakMap(), vt = new WeakMap(), Nt = new WeakMap(), h(Me, "NineTableVScrollBar");
|
|
356
356
|
let le = Me;
|
|
357
357
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", le);
|
|
358
|
-
var P,
|
|
358
|
+
var P, E, D, M, V, Q, wt, Se, at, Wt, Ot, Bt, St, Et, zt, Dt, At, Ee, lt, Rt, Pt;
|
|
359
359
|
const $e = class $e {
|
|
360
360
|
constructor(i) {
|
|
361
361
|
d(this, P);
|
|
362
|
-
d(this,
|
|
362
|
+
d(this, E);
|
|
363
363
|
d(this, D, /* @__PURE__ */ new Map());
|
|
364
|
-
d(this,
|
|
364
|
+
d(this, M, null);
|
|
365
365
|
d(this, V, null);
|
|
366
366
|
d(this, Q, 0);
|
|
367
367
|
d(this, wt, 40);
|
|
368
368
|
d(this, Se, !1);
|
|
369
369
|
d(this, at, !1);
|
|
370
370
|
d(this, Wt, 3);
|
|
371
|
-
|
|
371
|
+
S(this, "refresh", /* @__PURE__ */ h(() => {
|
|
372
372
|
H.log("rowManager.refresh");
|
|
373
|
-
const i = t(this,
|
|
373
|
+
const i = t(this, E).querySelector(".ng-container-body .ng-part-body");
|
|
374
374
|
i && (t(this, St).call(this), t(this, lt).call(this, i.scrollTop));
|
|
375
375
|
}, "refresh"));
|
|
376
|
-
|
|
377
|
-
H.log("rowManager.initialize"), y(this,
|
|
378
|
-
const
|
|
379
|
-
if (!
|
|
380
|
-
const c =
|
|
376
|
+
S(this, "initialize", /* @__PURE__ */ h(() => {
|
|
377
|
+
H.log("rowManager.initialize"), y(this, M, null), t(this, D).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((a) => {
|
|
378
|
+
const o = t(this, E).querySelector(a);
|
|
379
|
+
if (!o) return;
|
|
380
|
+
const c = o.querySelector(".ng-part-body table");
|
|
381
381
|
if (!c) return;
|
|
382
382
|
const l = c.querySelector("tbody.bindable-tbody");
|
|
383
383
|
if (!l) return;
|
|
384
|
-
const u = Array.from(l.querySelectorAll("tr")).map((
|
|
385
|
-
t(this, D).set(
|
|
384
|
+
const u = Array.from(l.querySelectorAll("tr")).map((g) => g.cloneNode(!0));
|
|
385
|
+
t(this, D).set(a, u);
|
|
386
386
|
});
|
|
387
|
-
const i = t(this,
|
|
387
|
+
const i = t(this, E).querySelector(".ng-container-body .ng-part-body"), e = t(this, E).querySelector(".ng-container-left .ng-part-body"), s = t(this, E).querySelector(".ng-container-right .ng-part-body"), r = t(this, E).querySelector(".ng-container-body .ng-part-header"), n = t(this, E).querySelector(".ng-container-body .ng-part-footer");
|
|
388
388
|
if (i) {
|
|
389
389
|
t(this, Bt).call(this, i), t(this, At).call(this), t(this, St).call(this), t(this, lt).call(this, i.scrollTop);
|
|
390
|
-
let
|
|
391
|
-
const
|
|
390
|
+
let a = !1;
|
|
391
|
+
const o = /* @__PURE__ */ h((c, l, f) => {
|
|
392
392
|
var u;
|
|
393
|
-
|
|
393
|
+
a || (a = !0, i && i.scrollTop !== c && (i.scrollTop = c), e && e.scrollTop !== c && (e.scrollTop = c), s && s.scrollTop !== c && (s.scrollTop = c), r && r.scrollLeft !== l && (r.scrollLeft = l), n && n.scrollLeft !== l && (n.scrollLeft = l), t(this, lt).call(this, c), (u = t(this, E).querySelector("nine-table-vscrollbar")) == null || u.refresh(), a = !1);
|
|
394
394
|
}, "syncScroll");
|
|
395
395
|
[i, e, s].forEach((c) => {
|
|
396
396
|
c && c.addEventListener("scroll", () => {
|
|
397
397
|
t(this, at) || (y(this, at, !0), requestAnimationFrame(() => {
|
|
398
|
-
|
|
398
|
+
o(c.scrollTop, c.scrollLeft), y(this, at, !1);
|
|
399
399
|
}));
|
|
400
400
|
});
|
|
401
401
|
});
|
|
@@ -407,140 +407,139 @@ const $e = class $e {
|
|
|
407
407
|
if (!s || s.length === 0) return;
|
|
408
408
|
const r = i.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
409
409
|
if (!r) return;
|
|
410
|
-
r.querySelectorAll("tr:not(.nodata)").forEach((
|
|
411
|
-
const n = r.querySelector("tr.nodata"),
|
|
412
|
-
for (let
|
|
410
|
+
r.querySelectorAll("tr:not(.nodata)").forEach((o) => o.remove());
|
|
411
|
+
const n = r.querySelector("tr.nodata"), a = document.createDocumentFragment();
|
|
412
|
+
for (let o = 0; o < t(this, wt); o++)
|
|
413
413
|
s.forEach((c) => {
|
|
414
|
-
|
|
414
|
+
a.appendChild(c.cloneNode(!0));
|
|
415
415
|
});
|
|
416
|
-
n ? n.before(
|
|
416
|
+
n ? n.before(a) : r.appendChild(a);
|
|
417
417
|
}, "#renderRows"));
|
|
418
418
|
d(this, Bt, /* @__PURE__ */ h((i) => {
|
|
419
|
-
if (H.log("rowManager.#measureAndCacheHeight"), t(this,
|
|
420
|
-
return t(this,
|
|
419
|
+
if (H.log("rowManager.#measureAndCacheHeight"), t(this, M) !== null && t(this, M) > 0)
|
|
420
|
+
return t(this, M);
|
|
421
421
|
H.log("#measureAndCacheHeight");
|
|
422
422
|
const e = t(this, D).get(".ng-container-body");
|
|
423
423
|
if (!e || e.length === 0) return 24;
|
|
424
424
|
const s = i.querySelector("tbody.bindable-tbody");
|
|
425
425
|
if (!s) return 24;
|
|
426
|
-
s.querySelectorAll("tr:not(.nodata)").forEach((
|
|
426
|
+
s.querySelectorAll("tr:not(.nodata)").forEach((g) => g.remove());
|
|
427
427
|
const r = s.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
428
|
-
e.forEach((
|
|
429
|
-
n.appendChild(
|
|
428
|
+
e.forEach((g) => {
|
|
429
|
+
n.appendChild(g.cloneNode(!0));
|
|
430
430
|
}), r ? r.before(n) : s.appendChild(n);
|
|
431
|
-
const
|
|
432
|
-
(
|
|
431
|
+
const a = t(this, E), o = a.style.display, c = a.style.visibility, l = a.style.position;
|
|
432
|
+
(o === "none" || window.getComputedStyle(a).display === "none") && (a.style.display = "block", a.style.visibility = "hidden", a.style.position = "absolute");
|
|
433
433
|
let f = 0;
|
|
434
434
|
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
435
|
-
return u.forEach((
|
|
436
|
-
f +=
|
|
437
|
-
}), u.forEach((
|
|
435
|
+
return u.forEach((g) => {
|
|
436
|
+
f += g.offsetHeight || g.getBoundingClientRect().height;
|
|
437
|
+
}), u.forEach((g) => g.remove()), a.style.display = o, a.style.visibility = c, a.style.position = l, y(this, M, f > 0 ? f : 24), t(this, Et).call(this), t(this, M);
|
|
438
438
|
}, "#measureAndCacheHeight"));
|
|
439
439
|
d(this, St, /* @__PURE__ */ h(() => {
|
|
440
440
|
H.log("rowManager.#updateVirtualScrollHeight");
|
|
441
|
-
const e = (t(this, P).data.get() || []).length, s = t(this,
|
|
441
|
+
const e = (t(this, P).data.get() || []).length, s = t(this, M), r = e * s;
|
|
442
442
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
443
|
-
const
|
|
444
|
-
if (!
|
|
445
|
-
const
|
|
446
|
-
|
|
443
|
+
const a = t(this, E).querySelector(n);
|
|
444
|
+
if (!a) return;
|
|
445
|
+
const o = a.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
446
|
+
o && (o.style.height = `${r}px`);
|
|
447
447
|
});
|
|
448
448
|
}, "#updateVirtualScrollHeight"));
|
|
449
449
|
d(this, Et, /* @__PURE__ */ h(() => {
|
|
450
|
-
if (t(this, Q) > 0 && t(this,
|
|
451
|
-
const i = Math.ceil(t(this, Q) / t(this,
|
|
450
|
+
if (t(this, Q) > 0 && t(this, M) > 0) {
|
|
451
|
+
const i = Math.ceil(t(this, Q) / t(this, M));
|
|
452
452
|
y(this, wt, i + t(this, Wt));
|
|
453
453
|
}
|
|
454
454
|
}, "#updateRowCount"));
|
|
455
455
|
d(this, zt, /* @__PURE__ */ h(() => {
|
|
456
|
-
var
|
|
457
|
-
const i = t(this,
|
|
456
|
+
var o, c, l, f, u, g;
|
|
457
|
+
const i = t(this, E).querySelector(".ng-container-left .ng-part-body table"), e = t(this, E).querySelector(".ng-container-body .ng-part-body table"), s = t(this, E).querySelector(".ng-container-right .ng-part-body table");
|
|
458
458
|
if (e) {
|
|
459
|
-
const
|
|
460
|
-
for (let
|
|
461
|
-
const
|
|
462
|
-
((
|
|
463
|
-
((c = m
|
|
464
|
-
((l = v[
|
|
465
|
-
],
|
|
466
|
-
|
|
459
|
+
const b = i ? Array.from(i.querySelectorAll("tbody tr")) : [], x = Array.from(e.querySelectorAll("tbody tr")), v = s ? Array.from(s.querySelectorAll("tbody tr")) : [], A = Math.max(b.length, x.length, v.length);
|
|
460
|
+
for (let m = 0; m < A; m++) {
|
|
461
|
+
const W = [
|
|
462
|
+
((o = b[m]) == null ? void 0 : o.getBoundingClientRect().height) || 0,
|
|
463
|
+
((c = x[m]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
464
|
+
((l = v[m]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
465
|
+
], C = Math.max(...W);
|
|
466
|
+
C > 0 && (b[m] && (b[m].style.height = `${C}px`), x[m] && (x[m].style.height = `${C}px`), v[m] && (v[m].style.height = `${C}px`));
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
|
-
const r = t(this,
|
|
469
|
+
const r = t(this, E).querySelector(".ng-container-left .ng-part-footer table"), n = t(this, E).querySelector(".ng-container-body .ng-part-footer table"), a = t(this, E).querySelector(".ng-container-right .ng-part-footer table");
|
|
470
470
|
if (n) {
|
|
471
|
-
const
|
|
472
|
-
for (let
|
|
473
|
-
const
|
|
474
|
-
((f =
|
|
475
|
-
((u = m
|
|
476
|
-
((
|
|
477
|
-
],
|
|
478
|
-
|
|
471
|
+
const b = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], x = Array.from(n.querySelectorAll("tfoot tr")), v = a ? Array.from(a.querySelectorAll("tfoot tr")) : [], A = Math.max(b.length, x.length, v.length);
|
|
472
|
+
for (let m = 0; m < A; m++) {
|
|
473
|
+
const W = [
|
|
474
|
+
((f = b[m]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
475
|
+
((u = x[m]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
|
|
476
|
+
((g = v[m]) == null ? void 0 : g.getBoundingClientRect().height) || 0
|
|
477
|
+
], C = Math.max(...W);
|
|
478
|
+
C > 0 && (b[m] && (b[m].style.height = `${C}px`), x[m] && (x[m].style.height = `${C}px`), v[m] && (v[m].style.height = `${C}px`));
|
|
479
479
|
}
|
|
480
480
|
}
|
|
481
481
|
}, "#syncRowHeights"));
|
|
482
482
|
d(this, Dt, /* @__PURE__ */ h(() => {
|
|
483
|
-
!t(this,
|
|
483
|
+
!t(this, E) || !(t(this, E) instanceof HTMLElement) || (y(this, V, new ResizeObserver((i) => {
|
|
484
484
|
for (const e of i) {
|
|
485
485
|
const s = e.target;
|
|
486
486
|
if (!s.classList.contains("active")) continue;
|
|
487
487
|
const r = e.contentRect.height;
|
|
488
488
|
if (r > 0) {
|
|
489
489
|
let n = 0;
|
|
490
|
-
const
|
|
491
|
-
|
|
490
|
+
const a = s.querySelector(".ng-part-header"), o = s.querySelector(".ng-part-footer");
|
|
491
|
+
a && (n += a.offsetHeight), o && (n += o.offsetHeight);
|
|
492
492
|
const c = Math.max(r - n, 100);
|
|
493
|
-
t(this, Q) !== c && (y(this, Q, c), t(this, Et).call(this), t(this,
|
|
493
|
+
t(this, Q) !== c && (y(this, Q, c), t(this, Et).call(this), t(this, M) !== null && (t(this, At).call(this), this.refresh()));
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
|
-
})), t(this, V).observe(t(this,
|
|
496
|
+
})), t(this, V).observe(t(this, E)));
|
|
497
497
|
}, "#initResizeObserver"));
|
|
498
498
|
d(this, At, /* @__PURE__ */ h(() => {
|
|
499
499
|
H.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
500
|
-
const e = t(this,
|
|
500
|
+
const e = t(this, E).querySelector(i);
|
|
501
501
|
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Ot).call(this, e, i);
|
|
502
502
|
}), t(this, Pt).call(this), t(this, zt).call(this);
|
|
503
503
|
}, "#renderAllContainers"));
|
|
504
504
|
d(this, Ee, /* @__PURE__ */ h((i) => {
|
|
505
505
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
506
506
|
var l;
|
|
507
|
-
const s = t(this,
|
|
507
|
+
const s = t(this, E).querySelector(e);
|
|
508
508
|
if (!s) return;
|
|
509
509
|
const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
510
510
|
if (!r) return;
|
|
511
|
-
const n = Array.from(r.querySelectorAll("tr:not(.nodata)")),
|
|
511
|
+
const n = Array.from(r.querySelectorAll("tr:not(.nodata)")), a = ((l = t(this, D).get(e)) == null ? void 0 : l.length) || 1, c = (t(this, P).data.get() || []).length;
|
|
512
512
|
n.forEach((f, u) => {
|
|
513
|
-
const
|
|
514
|
-
if (
|
|
513
|
+
const g = i + Math.floor(u / a);
|
|
514
|
+
if (g >= c) {
|
|
515
515
|
f.style.display = "none";
|
|
516
516
|
return;
|
|
517
517
|
}
|
|
518
|
-
const
|
|
519
|
-
f.style.display = "", t(this, Rt).call(this, f,
|
|
518
|
+
const b = t(this, P).data.get(g);
|
|
519
|
+
f.style.display = "", t(this, Rt).call(this, f, b, g);
|
|
520
520
|
});
|
|
521
521
|
});
|
|
522
522
|
}, "#adjustBufferRows"));
|
|
523
523
|
d(this, lt, /* @__PURE__ */ h((i) => {
|
|
524
|
-
var
|
|
525
|
-
const e = t(this,
|
|
524
|
+
var f;
|
|
525
|
+
const e = t(this, M);
|
|
526
526
|
if (!e || e <= 0) return;
|
|
527
|
-
const
|
|
528
|
-
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
const g = t(this, S).querySelector(b);
|
|
527
|
+
const s = t(this, P).data.length, r = Math.max(0, Math.floor(i / e)), n = r * e, a = ((f = t(this, D).get(".ng-container-body")) == null ? void 0 : f.length) || 1, o = t(this, E).querySelector(".ng-container-body"), c = o == null ? void 0 : o.querySelector(".ng-part-body tbody.bindable-tbody tr:not(.nodata)"), l = c && c.dataset.row !== void 0 ? parseInt(c.dataset.row, 10) : -1;
|
|
528
|
+
[".ng-container-body .ng-part-body table", ".ng-container-left .ng-part-body table", ".ng-container-right .ng-part-body table"].forEach((u) => {
|
|
529
|
+
u.style.transform = `translateY(${n}px)`;
|
|
530
|
+
}), H.log("#handleScroll", l, r), l !== r && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((u) => {
|
|
531
|
+
const g = t(this, E).querySelector(u);
|
|
533
532
|
if (!g) return;
|
|
534
|
-
const
|
|
535
|
-
if (!
|
|
536
|
-
Array.from(
|
|
537
|
-
const
|
|
538
|
-
if (
|
|
539
|
-
|
|
533
|
+
const b = g.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
534
|
+
if (!b) return;
|
|
535
|
+
Array.from(b.querySelectorAll("tr:not(.nodata)")).forEach((v, A) => {
|
|
536
|
+
const m = r + Math.floor(A / a);
|
|
537
|
+
if (m >= s) {
|
|
538
|
+
v.style.display = "none";
|
|
540
539
|
return;
|
|
541
540
|
}
|
|
542
|
-
const
|
|
543
|
-
|
|
541
|
+
const W = t(this, P).data.get(m);
|
|
542
|
+
v.style.display = "", t(this, Rt).call(this, v, W, m);
|
|
544
543
|
});
|
|
545
544
|
});
|
|
546
545
|
}, "#handleScroll"));
|
|
@@ -561,39 +560,39 @@ const $e = class $e {
|
|
|
561
560
|
d(this, Rt, /* @__PURE__ */ h((i, e, s) => {
|
|
562
561
|
i.dataset.row = s, i.data = e, H.log(e, s), Array.from(i.cells).forEach((r, n) => {
|
|
563
562
|
r.dataset.row = s;
|
|
564
|
-
const
|
|
565
|
-
|
|
563
|
+
const a = Array.from(r.children).find((o) => o.tagName.toLowerCase().startsWith("cell-") || typeof o.refresh == "function");
|
|
564
|
+
a && typeof a.refresh == "function" && a.refresh();
|
|
566
565
|
});
|
|
567
566
|
}, "#bindRowData"));
|
|
568
567
|
d(this, Pt, /* @__PURE__ */ h(() => {
|
|
569
568
|
var c, l, f;
|
|
570
569
|
H.log("rowManager.#syncHeaderHeights");
|
|
571
|
-
const i = t(this,
|
|
570
|
+
const i = t(this, E).querySelector(".ng-container-left .ng-part-header table"), e = t(this, E).querySelector(".ng-container-body .ng-part-header table"), s = t(this, E).querySelector(".ng-container-right .ng-part-header table");
|
|
572
571
|
if (!e) return;
|
|
573
|
-
const r = i ? Array.from(i.querySelectorAll("tr")) : [], n = Array.from(e.querySelectorAll("tr")),
|
|
574
|
-
for (let u = 0; u <
|
|
575
|
-
const
|
|
572
|
+
const r = i ? Array.from(i.querySelectorAll("tr")) : [], n = Array.from(e.querySelectorAll("tr")), a = s ? Array.from(s.querySelectorAll("tr")) : [], o = Math.max(r.length, n.length, a.length);
|
|
573
|
+
for (let u = 0; u < o; u++) {
|
|
574
|
+
const g = [
|
|
576
575
|
((c = r[u]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
577
576
|
((l = n[u]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
578
|
-
((f =
|
|
579
|
-
],
|
|
580
|
-
|
|
577
|
+
((f = a[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
578
|
+
], b = Math.max(...g);
|
|
579
|
+
b > 0 && (r[u] && (r[u].style.height = `${b}px`), n[u] && (n[u].style.height = `${b}px`), a[u] && (a[u].style.height = `${b}px`));
|
|
581
580
|
}
|
|
582
581
|
}, "#syncHeaderHeights"));
|
|
583
|
-
|
|
582
|
+
S(this, "destroy", /* @__PURE__ */ h(() => {
|
|
584
583
|
t(this, V) && (t(this, V).disconnect(), y(this, V, null));
|
|
585
584
|
}, "destroy"));
|
|
586
|
-
y(this, P, i.getRootNode().host), y(this,
|
|
585
|
+
y(this, P, i.getRootNode().host), y(this, E, i), t(this, Dt).call(this);
|
|
587
586
|
}
|
|
588
587
|
getRowHeight() {
|
|
589
|
-
return t(this,
|
|
588
|
+
return t(this, M);
|
|
590
589
|
}
|
|
591
590
|
templateLength(i = ".ng-container-body") {
|
|
592
591
|
var e;
|
|
593
592
|
return ((e = t(this, D).get(i)) == null ? void 0 : e.length) || 1;
|
|
594
593
|
}
|
|
595
594
|
};
|
|
596
|
-
P = new WeakMap(),
|
|
595
|
+
P = new WeakMap(), E = new WeakMap(), D = new WeakMap(), M = new WeakMap(), V = new WeakMap(), Q = new WeakMap(), wt = new WeakMap(), Se = new WeakMap(), at = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), Bt = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), zt = new WeakMap(), Dt = new WeakMap(), At = new WeakMap(), Ee = new WeakMap(), lt = new WeakMap(), Rt = new WeakMap(), Pt = new WeakMap(), h($e, "RowManager");
|
|
597
596
|
let ce = $e;
|
|
598
597
|
const jt = class jt {
|
|
599
598
|
/**
|
|
@@ -607,64 +606,64 @@ const jt = class jt {
|
|
|
607
606
|
*/
|
|
608
607
|
static compile(i) {
|
|
609
608
|
if (!i) return null;
|
|
610
|
-
const e = /* @__PURE__ */ h((
|
|
611
|
-
|
|
609
|
+
const e = /* @__PURE__ */ h((o) => {
|
|
610
|
+
o.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
|
|
612
611
|
const f = l.getAttribute("cell-type") || "renderer";
|
|
613
612
|
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
614
613
|
let u = `cell-${f}`;
|
|
615
|
-
const
|
|
616
|
-
let
|
|
617
|
-
|
|
614
|
+
const g = l.getAttribute("data-bind"), b = l.getAttribute("data-expr"), x = l.getAttribute("maxbyte"), v = l.getAttribute("type");
|
|
615
|
+
let A = [];
|
|
616
|
+
g && A.push(`data-bind="${g}"`), b && A.push(`data-expr="${b}"`), x && A.push(`maxbyte="${x}"`), v && A.push(`type="${v}"`), l.innerHTML = `<${u} ${A.join(" ")}></${u}>`;
|
|
618
617
|
});
|
|
619
|
-
}, "processCellTypes"), s = /* @__PURE__ */ h((
|
|
620
|
-
if (!
|
|
621
|
-
const c =
|
|
622
|
-
for (let
|
|
623
|
-
const
|
|
624
|
-
|
|
618
|
+
}, "processCellTypes"), s = /* @__PURE__ */ h((o) => {
|
|
619
|
+
if (!o.querySelector("colgroup")) {
|
|
620
|
+
const c = o.querySelector("tbody tr") || o.querySelector("tr"), l = c ? c.querySelectorAll("th, td").length : 1, f = document.createElement("colgroup"), u = Math.max(Math.floor(o.clientWidth / l), 100);
|
|
621
|
+
for (let g = 0; g < l; g++) {
|
|
622
|
+
const b = document.createElement("col");
|
|
623
|
+
b.setAttribute("width", u), f.appendChild(b);
|
|
625
624
|
}
|
|
626
|
-
|
|
625
|
+
o.prepend(f);
|
|
627
626
|
}
|
|
628
|
-
if (!
|
|
629
|
-
const c = document.createElement("thead"), l =
|
|
630
|
-
l ? l.after(c) :
|
|
627
|
+
if (!o.querySelector("thead")) {
|
|
628
|
+
const c = document.createElement("thead"), l = o.querySelector("colgroup");
|
|
629
|
+
l ? l.after(c) : o.prepend(c);
|
|
631
630
|
}
|
|
632
|
-
|
|
633
|
-
}, "ensureTableStructure"), r = /* @__PURE__ */ h((
|
|
634
|
-
const l = Array.from(
|
|
631
|
+
o.classList.add("nine-table-element"), o.style.display = "table";
|
|
632
|
+
}, "ensureTableStructure"), r = /* @__PURE__ */ h((o, c) => {
|
|
633
|
+
const l = Array.from(o.querySelectorAll(c + " tr")), f = Array.from(o.querySelectorAll(c + " th," + c + " td")), u = l.length;
|
|
635
634
|
if (u === 0 || f.length === 0) return;
|
|
636
|
-
let
|
|
637
|
-
f.forEach((
|
|
638
|
-
|
|
635
|
+
let g = 0;
|
|
636
|
+
f.forEach((x) => {
|
|
637
|
+
g += x.colSpan || 1;
|
|
639
638
|
});
|
|
640
|
-
const
|
|
641
|
-
l.forEach((
|
|
642
|
-
const v =
|
|
643
|
-
let
|
|
644
|
-
Array.from(
|
|
645
|
-
for (let B = 0; B <
|
|
646
|
-
if (
|
|
647
|
-
|
|
639
|
+
const b = Array.from(Array(u), () => Array(g).fill(null));
|
|
640
|
+
l.forEach((x) => {
|
|
641
|
+
const v = x.sectionRowIndex;
|
|
642
|
+
let A = 0;
|
|
643
|
+
Array.from(x.querySelectorAll("th,td")).forEach((m) => {
|
|
644
|
+
for (let B = 0; B < b[v].length; B++)
|
|
645
|
+
if (b[v][B] === null) {
|
|
646
|
+
A = B;
|
|
648
647
|
break;
|
|
649
648
|
}
|
|
650
|
-
const
|
|
651
|
-
for (let B = 0; B <
|
|
652
|
-
for (let yt = 0; yt <
|
|
653
|
-
v + B < u &&
|
|
649
|
+
const W = m.rowSpan || 1, C = m.colSpan || 1;
|
|
650
|
+
for (let B = 0; B < W; B++)
|
|
651
|
+
for (let yt = 0; yt < C; yt++)
|
|
652
|
+
v + B < u && A + yt < g && (b[v + B][A + yt] = B === 0 && yt === 0 ? "1" : "0");
|
|
654
653
|
});
|
|
655
|
-
}), l.forEach((
|
|
656
|
-
const v =
|
|
657
|
-
Array.from(
|
|
658
|
-
for (let
|
|
659
|
-
if (
|
|
660
|
-
|
|
654
|
+
}), l.forEach((x) => {
|
|
655
|
+
const v = x.sectionRowIndex;
|
|
656
|
+
Array.from(x.querySelectorAll("th,td")).forEach((A) => {
|
|
657
|
+
for (let m = 0; m < b[v].length; m++)
|
|
658
|
+
if (b[v][m] === "1") {
|
|
659
|
+
A.dataset.col = m, b[v][m] = "0";
|
|
661
660
|
break;
|
|
662
661
|
}
|
|
663
662
|
});
|
|
664
663
|
});
|
|
665
664
|
}, "resetColIndex"), n = i.cloneNode(!0);
|
|
666
|
-
return s(n), e(n), r(n, "thead"), r(n, "tbody"), r(n, "tfoot"), Array.from(n.querySelectorAll("colgroup col")).forEach((
|
|
667
|
-
const l =
|
|
665
|
+
return s(n), e(n), r(n, "thead"), r(n, "tbody"), r(n, "tfoot"), Array.from(n.querySelectorAll("colgroup col")).forEach((o, c) => {
|
|
666
|
+
const l = o.getAttribute("fixed");
|
|
668
667
|
l && n.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((f) => {
|
|
669
668
|
f.setAttribute("fixed", l);
|
|
670
669
|
});
|
|
@@ -681,7 +680,7 @@ const pt = class pt extends HTMLElement {
|
|
|
681
680
|
d(this, Ft);
|
|
682
681
|
d(this, tt, null);
|
|
683
682
|
d(this, et);
|
|
684
|
-
|
|
683
|
+
S(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
685
684
|
t(this, et).refresh();
|
|
686
685
|
}, "invalidate"));
|
|
687
686
|
d(this, Vt, /* @__PURE__ */ h(() => {
|
|
@@ -693,16 +692,16 @@ const pt = class pt extends HTMLElement {
|
|
|
693
692
|
const n = this.querySelector(s);
|
|
694
693
|
if (!n) return;
|
|
695
694
|
n.innerHTML = "";
|
|
696
|
-
const o = document.createElement("div");
|
|
697
|
-
o.className = "ng-part-header", o.appendChild(t(this, ct).call(this, t(this, tt), r, "header"));
|
|
698
695
|
const a = document.createElement("div");
|
|
699
|
-
a.className = "ng-part-
|
|
696
|
+
a.className = "ng-part-header", a.appendChild(t(this, ct).call(this, t(this, tt), r, "header"));
|
|
697
|
+
const o = document.createElement("div");
|
|
698
|
+
o.className = "ng-part-body";
|
|
700
699
|
const c = document.createElement("div");
|
|
701
700
|
c.className = "ng-scroll-content", c.style.position = "relative", c.style.width = "100%", c.appendChild(t(this, ct).call(this, t(this, tt), r, "body"));
|
|
702
701
|
const l = document.createElement("div");
|
|
703
|
-
l.className = "ng-virtual-spacer", l.style.width = "100%", l.style.pointerEvents = "none", c.appendChild(l),
|
|
702
|
+
l.className = "ng-virtual-spacer", l.style.width = "100%", l.style.pointerEvents = "none", c.appendChild(l), o.appendChild(c);
|
|
704
703
|
const f = document.createElement("div");
|
|
705
|
-
f.className = "ng-part-footer", f.appendChild(t(this, ct).call(this, t(this, tt), r, "footer")), n.appendChild(
|
|
704
|
+
f.className = "ng-part-footer", f.appendChild(t(this, ct).call(this, t(this, tt), r, "footer")), n.appendChild(a), n.appendChild(o), n.appendChild(f);
|
|
706
705
|
});
|
|
707
706
|
}, "#renderSplitContainers"));
|
|
708
707
|
d(this, Yt, /* @__PURE__ */ h(() => {
|
|
@@ -710,26 +709,26 @@ const pt = class pt extends HTMLElement {
|
|
|
710
709
|
const s = this.querySelector(`.ng-container-${e}`), r = s == null ? void 0 : s.querySelectorAll("table");
|
|
711
710
|
if (!s || !r || r.length === 0) return;
|
|
712
711
|
let n = 0;
|
|
713
|
-
r[0].querySelectorAll("col").forEach((
|
|
714
|
-
const
|
|
715
|
-
isNaN(n) || (n +=
|
|
712
|
+
r[0].querySelectorAll("col").forEach((a) => {
|
|
713
|
+
const o = parseInt(a.getAttribute("width"), 10);
|
|
714
|
+
isNaN(n) || (n += o);
|
|
716
715
|
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${n}px`, s.style.width = `${n}px`);
|
|
717
716
|
});
|
|
718
717
|
}, "#updateContainerWidths"));
|
|
719
|
-
|
|
718
|
+
S(this, "generate", /* @__PURE__ */ h((e) => {
|
|
720
719
|
e && (y(this, tt, he.compile(e)), t(this, Vt).call(this), t(this, Yt).call(this), t(this, et).initialize(), setTimeout(() => {
|
|
721
720
|
var s;
|
|
722
721
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
723
722
|
}, 0));
|
|
724
723
|
}, "generate"));
|
|
725
724
|
d(this, ct, /* @__PURE__ */ h((e, s, r) => {
|
|
726
|
-
const n = e.cloneNode(!0),
|
|
725
|
+
const n = e.cloneNode(!0), a = n.querySelector("thead"), o = n.querySelector("tbody"), c = n.querySelector("tfoot");
|
|
727
726
|
if (r === "header") {
|
|
728
|
-
if (
|
|
727
|
+
if (o && o.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
729
728
|
const f = document.createElement("tbody");
|
|
730
729
|
f.className = "fixed-tbody", n.appendChild(f);
|
|
731
730
|
}
|
|
732
|
-
} else r === "body" ? (
|
|
731
|
+
} else r === "body" ? (a && a.remove(), c && c.remove(), o && (o.className = "bindable-tbody")) : r === "footer" && (a && a.remove(), o && o.remove());
|
|
733
732
|
return s === "left" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
734
733
|
l.getAttribute("fixed") !== "left" && l.remove();
|
|
735
734
|
}) : s === "right" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
@@ -738,12 +737,12 @@ const pt = class pt extends HTMLElement {
|
|
|
738
737
|
l.remove();
|
|
739
738
|
}), n;
|
|
740
739
|
}, "#createSplitTable"));
|
|
741
|
-
|
|
742
|
-
|
|
740
|
+
S(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, et).getRowHeight(), "getRowHeight"));
|
|
741
|
+
S(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
743
742
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
744
743
|
s && (s.scrollLeft = e);
|
|
745
744
|
}, "scrollToX"));
|
|
746
|
-
|
|
745
|
+
S(this, "scrollToY", /* @__PURE__ */ h((e) => {
|
|
747
746
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
748
747
|
s && (s.scrollTop = e);
|
|
749
748
|
}, "scrollToY"));
|
|
@@ -902,7 +901,7 @@ const pt = class pt extends HTMLElement {
|
|
|
902
901
|
this.innerHTML = "", H.log("NineTableSheet destroyed.");
|
|
903
902
|
}
|
|
904
903
|
};
|
|
905
|
-
Ft = new WeakMap(), tt = new WeakMap(), et = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), ct = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(), h(pt, "NineTableSheet"),
|
|
904
|
+
Ft = new WeakMap(), tt = new WeakMap(), et = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), ct = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(), h(pt, "NineTableSheet"), S(pt, "SCROLLBAR_SIZE", 16);
|
|
906
905
|
let $t = pt;
|
|
907
906
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", $t);
|
|
908
907
|
var Kt, qt;
|
|
@@ -912,38 +911,38 @@ const Ie = class Ie extends HTMLElement {
|
|
|
912
911
|
d(this, Kt, /* @__PURE__ */ h(() => {
|
|
913
912
|
var e;
|
|
914
913
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
915
|
-
var
|
|
916
|
-
const r = s.ctrlKey || s.metaKey || s.shiftKey, n = parseInt((
|
|
914
|
+
var a;
|
|
915
|
+
const r = s.ctrlKey || s.metaKey || s.shiftKey, n = parseInt((a = s.target.closest(".nine-tab-item")) == null ? void 0 : a.dataset.index, 10);
|
|
917
916
|
t(this, qt).call(this, n, r);
|
|
918
917
|
}), t(this, qt).call(this, 0, !1);
|
|
919
918
|
}, "#init"));
|
|
920
919
|
d(this, qt, /* @__PURE__ */ h((e, s = !1) => {
|
|
921
920
|
const r = /* @__PURE__ */ h(() => {
|
|
922
921
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
923
|
-
Array.from(this.querySelectorAll("nine-splitter")).forEach((
|
|
924
|
-
const
|
|
925
|
-
|
|
926
|
-
const
|
|
927
|
-
v &&
|
|
922
|
+
Array.from(this.querySelectorAll("nine-splitter")).forEach((b) => b.style.setProperty("display", "none"));
|
|
923
|
+
const g = f.filter((b) => b.classList.contains("active"));
|
|
924
|
+
g.length < 2 || g.forEach((b) => {
|
|
925
|
+
const x = parseInt(b.getAttribute("data-index"), 10), v = this.querySelector(`nine-splitter[data-split-index="${x}"]`), A = f[x + 1];
|
|
926
|
+
v && A && A.classList.contains("active") && v.style.setProperty("display", "flex");
|
|
928
927
|
});
|
|
929
|
-
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"),
|
|
930
|
-
if (!
|
|
928
|
+
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"), a = this.querySelector("nine-table-sheets-body"), o = n.querySelectorAll(".nine-tab-item"), c = a.querySelectorAll("nine-table-sheet");
|
|
929
|
+
if (!o[e]) return;
|
|
931
930
|
if (!s)
|
|
932
|
-
|
|
931
|
+
o.forEach((f, u) => {
|
|
933
932
|
f.classList.toggle("active", u === e);
|
|
934
933
|
}), c.forEach((f, u) => {
|
|
935
|
-
const
|
|
936
|
-
f.classList.toggle("active",
|
|
934
|
+
const g = u === e;
|
|
935
|
+
f.classList.toggle("active", g), f.style.flex = g ? "1 1 100%" : "";
|
|
937
936
|
});
|
|
938
937
|
else {
|
|
939
|
-
const f =
|
|
938
|
+
const f = o[e], u = n.querySelectorAll(".nine-tab-item.active");
|
|
940
939
|
if (f.classList.contains("active") && u.length <= 1)
|
|
941
940
|
return;
|
|
942
941
|
f.classList.toggle("active");
|
|
943
|
-
const
|
|
944
|
-
|
|
942
|
+
const g = a.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
943
|
+
g && (g.classList.toggle("active"), g.classList.contains("active") || (g.style.flex = ""));
|
|
945
944
|
}
|
|
946
|
-
const l =
|
|
945
|
+
const l = a.querySelectorAll("nine-table-sheet.active");
|
|
947
946
|
l == null || l.forEach((f) => {
|
|
948
947
|
f.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
949
948
|
}), r();
|
|
@@ -956,29 +955,29 @@ const Ie = class Ie extends HTMLElement {
|
|
|
956
955
|
Kt = new WeakMap(), qt = new WeakMap(), h(Ie, "NineTableSheets");
|
|
957
956
|
let de = Ie;
|
|
958
957
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", de);
|
|
959
|
-
var
|
|
958
|
+
var I, Zt, kt, Gt;
|
|
960
959
|
const _e = class _e {
|
|
961
960
|
constructor(i) {
|
|
962
|
-
d(this,
|
|
961
|
+
d(this, I);
|
|
963
962
|
d(this, Zt, /* @__PURE__ */ h(() => {
|
|
964
963
|
t(this, Gt).call(this), new ResizeObserver((i) => {
|
|
965
964
|
for (let e of i)
|
|
966
|
-
t(this,
|
|
967
|
-
}).observe(t(this,
|
|
965
|
+
t(this, I).getAttribute("auto-height") === "true" && t(this, kt).call(this);
|
|
966
|
+
}).observe(t(this, I));
|
|
968
967
|
}, "#init"));
|
|
969
968
|
d(this, kt, /* @__PURE__ */ h(() => {
|
|
970
969
|
var c, l;
|
|
971
|
-
const i = Array.from(t(this,
|
|
970
|
+
const i = Array.from(t(this, I).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
972
971
|
if (i.length === 0) return;
|
|
973
|
-
const e = parseInt(t(this,
|
|
974
|
-
t(this,
|
|
972
|
+
const e = parseInt(t(this, I).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), r = (c = t(this, I).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, n = (l = t(this, I).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, a = $t.SCROLLBAR_SIZE, o = e * s + r + n + a;
|
|
973
|
+
t(this, I).style.height = `${o}px`;
|
|
975
974
|
}, "#applyAutoHeight"));
|
|
976
975
|
d(this, Gt, /* @__PURE__ */ h(() => {
|
|
977
|
-
const e = Array.from(t(this,
|
|
978
|
-
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`,
|
|
979
|
-
return u +
|
|
980
|
-
}).join(""),
|
|
981
|
-
t(this,
|
|
976
|
+
const e = Array.from(t(this, I).children).filter((c) => c.tagName === "TABLE"), s = t(this, I).getAttribute("auto-height") === "true", r = e.length, n = e.map((c, l) => {
|
|
977
|
+
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, g = l < r - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
978
|
+
return u + g;
|
|
979
|
+
}).join(""), a = e.map((c, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
980
|
+
t(this, I).shadowRoot.innerHTML = `
|
|
982
981
|
<style>
|
|
983
982
|
:host {
|
|
984
983
|
display: flex;
|
|
@@ -1061,7 +1060,7 @@ const _e = class _e {
|
|
|
1061
1060
|
<nine-table-sheets>
|
|
1062
1061
|
<nine-table-sheets-body>${n}</nine-table-sheets-body>
|
|
1063
1062
|
<nine-table-sheets-footer>
|
|
1064
|
-
<div class="nine-tab-bar">${
|
|
1063
|
+
<div class="nine-tab-bar">${a}</div>
|
|
1065
1064
|
<div class="sheets-counter">Total : <span id="row-count">0</span></div>
|
|
1066
1065
|
</nine-table-sheets-footer>
|
|
1067
1066
|
</nine-table-sheets>
|
|
@@ -1069,24 +1068,24 @@ const _e = class _e {
|
|
|
1069
1068
|
</nine-table-body>
|
|
1070
1069
|
<nine-table-footer></nine-table-footer>
|
|
1071
1070
|
`;
|
|
1072
|
-
const
|
|
1073
|
-
|
|
1071
|
+
const o = t(this, I).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1072
|
+
o == null || o.forEach((c, l) => {
|
|
1074
1073
|
e[l] && setTimeout(() => {
|
|
1075
1074
|
c.generate(e[l]), s && t(this, kt).call(this);
|
|
1076
1075
|
});
|
|
1077
1076
|
});
|
|
1078
1077
|
}, "#render"));
|
|
1079
|
-
y(this,
|
|
1078
|
+
y(this, I, i), t(this, Zt).call(this);
|
|
1080
1079
|
}
|
|
1081
1080
|
};
|
|
1082
|
-
|
|
1081
|
+
I = new WeakMap(), Zt = new WeakMap(), kt = new WeakMap(), Gt = new WeakMap(), h(_e, "LayoutManager");
|
|
1083
1082
|
let fe = _e;
|
|
1084
1083
|
var Tt, ht;
|
|
1085
1084
|
const Ne = class Ne {
|
|
1086
1085
|
constructor(i) {
|
|
1087
1086
|
d(this, Tt);
|
|
1088
1087
|
d(this, ht, -1);
|
|
1089
|
-
|
|
1088
|
+
S(this, "count", /* @__PURE__ */ h(() => t(this, Tt).rawRecords.length, "count"));
|
|
1090
1089
|
y(this, Tt, i);
|
|
1091
1090
|
}
|
|
1092
1091
|
get at() {
|
|
@@ -1099,44 +1098,44 @@ const Ne = class Ne {
|
|
|
1099
1098
|
};
|
|
1100
1099
|
Tt = new WeakMap(), ht = new WeakMap(), h(Ne, "ngRow");
|
|
1101
1100
|
let ue = Ne;
|
|
1102
|
-
var
|
|
1101
|
+
var _, k, N, dt, Jt, Y, Qt, st, Ct, te, ee, ft;
|
|
1103
1102
|
const O = class O {
|
|
1104
1103
|
constructor(i, e) {
|
|
1105
|
-
d(this,
|
|
1106
|
-
d(this,
|
|
1107
|
-
d(this,
|
|
1104
|
+
d(this, _);
|
|
1105
|
+
d(this, k);
|
|
1106
|
+
d(this, N, []);
|
|
1108
1107
|
d(this, dt, []);
|
|
1109
1108
|
d(this, Jt, 0);
|
|
1110
1109
|
d(this, Y, []);
|
|
1111
1110
|
d(this, Qt, /* @__PURE__ */ h(() => {
|
|
1112
1111
|
y(this, Y, []);
|
|
1113
|
-
const i = t(this,
|
|
1112
|
+
const i = t(this, _).template || [];
|
|
1114
1113
|
Array.from(i).forEach((e) => {
|
|
1115
1114
|
var s;
|
|
1116
1115
|
t(this, Y).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1117
|
-
}), (t(this,
|
|
1116
|
+
}), (t(this, k).rawRecords || []).forEach((e) => {
|
|
1118
1117
|
e.__ng || (e.__ng = t(this, Ct).call(this)), e.__ng.height = t(this, Y).slice();
|
|
1119
1118
|
});
|
|
1120
1119
|
}, "#initialize"));
|
|
1121
1120
|
d(this, st, /* @__PURE__ */ h(() => {
|
|
1122
|
-
t(this,
|
|
1121
|
+
t(this, _).shadowRoot.querySelectorAll("nine-table-sheet").forEach((i) => {
|
|
1123
1122
|
i.invalidate();
|
|
1124
1123
|
});
|
|
1125
1124
|
}, "#invalidate"));
|
|
1126
|
-
|
|
1125
|
+
S(this, "get", /* @__PURE__ */ h((i, e) => {
|
|
1127
1126
|
var n;
|
|
1128
1127
|
const s = this.getValidData();
|
|
1129
1128
|
if (!s || s.length <= 0) return;
|
|
1130
1129
|
if (i == null) return t(this, ft).call(this, s);
|
|
1131
1130
|
if (i < 0 || i >= s.length) return null;
|
|
1132
|
-
const r = typeof ((n = t(this,
|
|
1131
|
+
const r = typeof ((n = t(this, _).fields) == null ? void 0 : n.get) == "function" ? t(this, _).fields.get() : [];
|
|
1133
1132
|
if (e != null) {
|
|
1134
|
-
const
|
|
1135
|
-
return
|
|
1133
|
+
const a = r.indexOf(e);
|
|
1134
|
+
return a >= 0 ? s[i].v[a] : null;
|
|
1136
1135
|
}
|
|
1137
1136
|
return t(this, ft).call(this, s[i]);
|
|
1138
1137
|
}, "get"));
|
|
1139
|
-
|
|
1138
|
+
S(this, "set", /* @__PURE__ */ h((i) => {
|
|
1140
1139
|
this.clear(), this.add(i, !1), t(this, st).call(this);
|
|
1141
1140
|
}, "set"));
|
|
1142
1141
|
d(this, Ct, /* @__PURE__ */ h(() => ({
|
|
@@ -1148,82 +1147,82 @@ const O = class O {
|
|
|
1148
1147
|
c: {},
|
|
1149
1148
|
_: [0, 0, 0, 0, O.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Y).slice(), -1, {}, {}]
|
|
1150
1149
|
}), "#getDefaultMeta"));
|
|
1151
|
-
|
|
1152
|
-
y(this,
|
|
1150
|
+
S(this, "reset", /* @__PURE__ */ h(() => {
|
|
1151
|
+
y(this, N, []), y(this, dt, []), t(this, st).call(this);
|
|
1153
1152
|
}, "reset"));
|
|
1154
|
-
|
|
1153
|
+
S(this, "clear", /* @__PURE__ */ h(() => {
|
|
1155
1154
|
var i;
|
|
1156
|
-
t(this,
|
|
1155
|
+
t(this, k).rawRecords = [], y(this, N, []), y(this, dt, []), (i = t(this, k).viewRecords) != null && i.reset && t(this, k).viewRecords.reset();
|
|
1157
1156
|
}, "clear"));
|
|
1158
1157
|
d(this, te, /* @__PURE__ */ h((i) => {
|
|
1159
1158
|
var r;
|
|
1160
1159
|
Array.isArray(i) || (i = [i]);
|
|
1161
|
-
const e = typeof ((r = t(this,
|
|
1160
|
+
const e = typeof ((r = t(this, _).fields) == null ? void 0 : r.get) == "function" ? t(this, _).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
1162
1161
|
return i.forEach((n) => {
|
|
1163
|
-
const
|
|
1164
|
-
e.forEach((
|
|
1165
|
-
|
|
1166
|
-
}), s.push(
|
|
1162
|
+
const a = { v: [] };
|
|
1163
|
+
e.forEach((o) => {
|
|
1164
|
+
a.v.push(n[o] !== void 0 && n[o] !== null ? n[o] : "");
|
|
1165
|
+
}), s.push(a);
|
|
1167
1166
|
}), s;
|
|
1168
1167
|
}, "#json2Array"));
|
|
1169
1168
|
d(this, ee, /* @__PURE__ */ h((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1170
1169
|
e.__ng = t(this, Ct).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = O.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1171
1170
|
}), i), "#defaultInsert"));
|
|
1172
|
-
|
|
1171
|
+
S(this, "add", /* @__PURE__ */ h((i, e = !0) => {
|
|
1173
1172
|
i === void 0 && (i = {});
|
|
1174
1173
|
const s = t(this, te).call(this, i);
|
|
1175
|
-
t(this,
|
|
1174
|
+
t(this, k).rawRecords = t(this, k).rawRecords.concat(t(this, ee).call(this, s)), this.resetRecords();
|
|
1176
1175
|
const r = this.count() - 1;
|
|
1177
|
-
return e || s.forEach((n,
|
|
1178
|
-
const
|
|
1179
|
-
|
|
1176
|
+
return e || s.forEach((n, a) => {
|
|
1177
|
+
const o = t(this, k).rawRecords[r - a];
|
|
1178
|
+
o && (o.__ng.rowState = O.ROW_STATE.EMPTY);
|
|
1180
1179
|
}), t(this, st).call(this), r;
|
|
1181
1180
|
}, "add"));
|
|
1182
|
-
|
|
1181
|
+
S(this, "delete", /* @__PURE__ */ h((i) => {
|
|
1183
1182
|
let e = [];
|
|
1184
|
-
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this,
|
|
1185
|
-
if (t(this,
|
|
1186
|
-
const r = t(this,
|
|
1187
|
-
t(this,
|
|
1183
|
+
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this, k).host.row.at] : e = [parseInt(i, 10)], e.sort((s, r) => r - s).forEach((s) => {
|
|
1184
|
+
if (t(this, N)[s]) {
|
|
1185
|
+
const r = t(this, N)[s].__ng.rowid;
|
|
1186
|
+
t(this, N)[s].__ng.rowState === O.ROW_STATE.INSERT ? t(this, k).rawRecords = t(this, k).rawRecords.filter((n) => n.__ng.rowid !== r) : t(this, k).rawRecords.forEach((n) => {
|
|
1188
1187
|
n.__ng.rowid === r && (n.__ng.deleted = !0, n.__ng.rowState = O.ROW_STATE.DELETE);
|
|
1189
1188
|
});
|
|
1190
1189
|
}
|
|
1191
1190
|
}), this.resetRecords(), t(this, st).call(this);
|
|
1192
1191
|
}, "delete"));
|
|
1193
|
-
|
|
1192
|
+
S(this, "setValue", /* @__PURE__ */ h((i, e, s) => {
|
|
1194
1193
|
var c;
|
|
1195
1194
|
i = parseInt(i, 10);
|
|
1196
|
-
const n = (typeof ((c = t(this,
|
|
1195
|
+
const n = (typeof ((c = t(this, _).fields) == null ? void 0 : c.get) == "function" ? t(this, _).fields.get() : []).indexOf(e);
|
|
1197
1196
|
if (n < 0) return;
|
|
1198
|
-
const
|
|
1199
|
-
if (!
|
|
1200
|
-
const
|
|
1201
|
-
|
|
1197
|
+
const a = this.getValidData()[i];
|
|
1198
|
+
if (!a) return;
|
|
1199
|
+
const o = a.v[n];
|
|
1200
|
+
o !== s && a.__ng.rowState !== O.ROW_STATE.INSERT && (a.__ng.o.hasOwnProperty(e) || (a.__ng.o[e] = o), a.__ng.rowState = O.ROW_STATE.UPDATE), a.v[n] = s;
|
|
1202
1201
|
}, "setValue"));
|
|
1203
|
-
|
|
1204
|
-
y(this, dt, t(this,
|
|
1202
|
+
S(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1203
|
+
y(this, dt, t(this, k).rawRecords.filter((i) => !i.__ng.deleted)), y(this, N, t(this, k).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, k).rawRecords.forEach((i, e) => {
|
|
1205
1204
|
i.__ng.rowidx = e;
|
|
1206
|
-
}), t(this,
|
|
1205
|
+
}), t(this, N).forEach((i, e) => {
|
|
1207
1206
|
i.__ng.i = e;
|
|
1208
1207
|
});
|
|
1209
1208
|
}, "resetRecords"));
|
|
1210
|
-
|
|
1209
|
+
S(this, "getValidData", /* @__PURE__ */ h(() => (t(this, N).length === 0 && t(this, k).rawRecords.length > 0 && this.resetRecords(), t(this, N)), "getValidData"));
|
|
1211
1210
|
d(this, ft, /* @__PURE__ */ h((i) => {
|
|
1212
|
-
var
|
|
1211
|
+
var a;
|
|
1213
1212
|
if (!i) return i;
|
|
1214
|
-
const e = !Array.isArray(i), s = e ? [i] : i, r = typeof ((
|
|
1213
|
+
const e = !Array.isArray(i), s = e ? [i] : i, r = typeof ((a = t(this, _).fields) == null ? void 0 : a.get) == "function" ? t(this, _).fields.get() : [], n = s.filter((o) => !o.__ng.deleted).map((o) => {
|
|
1215
1214
|
const c = {};
|
|
1216
1215
|
return r.forEach((l, f) => {
|
|
1217
|
-
c[l] =
|
|
1218
|
-
}), c.__ng =
|
|
1216
|
+
c[l] = o.v ? o.v[f] : o[l];
|
|
1217
|
+
}), c.__ng = o.__ng, c;
|
|
1219
1218
|
});
|
|
1220
1219
|
return e ? n[0] : n;
|
|
1221
1220
|
}, "#conv"));
|
|
1222
|
-
|
|
1223
|
-
y(this,
|
|
1221
|
+
S(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1222
|
+
y(this, _, i), y(this, k, e), t(this, Qt).call(this);
|
|
1224
1223
|
}
|
|
1225
1224
|
get source() {
|
|
1226
|
-
return t(this, ft).call(this, t(this,
|
|
1225
|
+
return t(this, ft).call(this, t(this, k).rawRecords);
|
|
1227
1226
|
}
|
|
1228
1227
|
set source(i) {
|
|
1229
1228
|
this.clear(), this.add(i, !1);
|
|
@@ -1231,15 +1230,18 @@ const O = class O {
|
|
|
1231
1230
|
get nextId() {
|
|
1232
1231
|
return ++Ye(this, Jt)._;
|
|
1233
1232
|
}
|
|
1233
|
+
get count() {
|
|
1234
|
+
return t(this, N).length;
|
|
1235
|
+
}
|
|
1234
1236
|
get length() {
|
|
1235
|
-
return t(this,
|
|
1237
|
+
return t(this, N).length;
|
|
1236
1238
|
}
|
|
1237
1239
|
getRowCount() {
|
|
1238
1240
|
return this.length;
|
|
1239
1241
|
}
|
|
1240
1242
|
};
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
+
_ = new WeakMap(), k = new WeakMap(), N = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), Y = new WeakMap(), Qt = new WeakMap(), st = new WeakMap(), Ct = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), ft = new WeakMap(), h(O, "ngData"), // 🎯 행 상태 정의 상수를 클래스 내부로 내재화
|
|
1244
|
+
S(O, "ROW_STATE", {
|
|
1243
1245
|
EMPTY: "EMPTY",
|
|
1244
1246
|
NORMAL: "NORMAL",
|
|
1245
1247
|
INSERT: "INSERT",
|
|
@@ -1276,7 +1278,7 @@ const Oe = class Oe {
|
|
|
1276
1278
|
constructor(i) {
|
|
1277
1279
|
d(this, ut);
|
|
1278
1280
|
d(this, L, []);
|
|
1279
|
-
|
|
1281
|
+
S(this, "add", /* @__PURE__ */ h((i, e = "string") => {
|
|
1280
1282
|
i.forEach((s) => {
|
|
1281
1283
|
t(this, L).some((r) => r.name === s) || t(this, L).push({ name: s, type: e });
|
|
1282
1284
|
}), t(this, Lt).call(this);
|
|
@@ -1293,25 +1295,25 @@ const Oe = class Oe {
|
|
|
1293
1295
|
if (!(!i || i.length === 0)) {
|
|
1294
1296
|
for (const e of i)
|
|
1295
1297
|
H.log(e), $("[data-bind]", e).each((s, r) => {
|
|
1296
|
-
const n = r.dataset.bind,
|
|
1297
|
-
n && t(this, L).push({ name: n, type:
|
|
1298
|
+
const n = r.dataset.bind, a = r.getAttribute("data-type") || "string";
|
|
1299
|
+
n && t(this, L).push({ name: n, type: a });
|
|
1298
1300
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
1299
1301
|
$(`[${s}]`, e).each((r, n) => {
|
|
1300
|
-
var
|
|
1301
|
-
if (
|
|
1302
|
-
const
|
|
1303
|
-
if (
|
|
1302
|
+
var a = n.getAttribute(s);
|
|
1303
|
+
if (a.indexOf("data.") < 0) {
|
|
1304
|
+
const o = a.search(/[(]/g);
|
|
1305
|
+
if (o > 0)
|
|
1304
1306
|
try {
|
|
1305
|
-
|
|
1307
|
+
a = String(window[a.substring(0, o).trim()]);
|
|
1306
1308
|
} catch {
|
|
1307
|
-
|
|
1309
|
+
a = "";
|
|
1308
1310
|
}
|
|
1309
1311
|
}
|
|
1310
|
-
|
|
1311
|
-
if (
|
|
1312
|
-
const c =
|
|
1312
|
+
a.split("data.").forEach((o) => {
|
|
1313
|
+
if (o.trim() != "") {
|
|
1314
|
+
const c = o.search(/[^_A-Za-z0-9]/g);
|
|
1313
1315
|
let l = "";
|
|
1314
|
-
c >= 0 ? l =
|
|
1316
|
+
c >= 0 ? l = o.substring(0, c) : a.startsWith("data.") && (l = o.replace("data.", "")), l && t(this, L).push({ name: l, type: "string" });
|
|
1315
1317
|
}
|
|
1316
1318
|
});
|
|
1317
1319
|
});
|
|
@@ -1388,20 +1390,20 @@ const mt = class mt extends HTMLElement {
|
|
|
1388
1390
|
connectedCallback() {
|
|
1389
1391
|
}
|
|
1390
1392
|
};
|
|
1391
|
-
h(mt, "BasicCellElement"),
|
|
1393
|
+
h(mt, "BasicCellElement"), S(mt, "_styleCache", /* @__PURE__ */ new Map()), S(mt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1392
1394
|
let me = mt;
|
|
1393
|
-
var
|
|
1395
|
+
var T, Ht, p, Ae, Re, qe, ke, Te;
|
|
1394
1396
|
const ze = class ze extends me {
|
|
1395
1397
|
constructor() {
|
|
1396
1398
|
super();
|
|
1397
|
-
d(this,
|
|
1399
|
+
d(this, T);
|
|
1398
1400
|
d(this, Ht);
|
|
1399
1401
|
d(this, p);
|
|
1400
1402
|
d(this, Ae);
|
|
1401
1403
|
d(this, Re);
|
|
1402
1404
|
d(this, qe);
|
|
1403
1405
|
d(this, ke);
|
|
1404
|
-
|
|
1406
|
+
S(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1405
1407
|
if (t(this, p))
|
|
1406
1408
|
if (t(this, p).closest("tbody")) {
|
|
1407
1409
|
const s = t(this, p).closest("tr").data, r = parseInt(t(this, p).dataset.row);
|
|
@@ -1417,27 +1419,27 @@ const ze = class ze extends me {
|
|
|
1417
1419
|
return ninegrid.nvl(e, "");
|
|
1418
1420
|
} else
|
|
1419
1421
|
try {
|
|
1420
|
-
return t(this,
|
|
1422
|
+
return t(this, T).exprFunction(t(this, p).dataset.expr).call(this, null, -1, t(this, T).data);
|
|
1421
1423
|
} catch {
|
|
1422
1424
|
}
|
|
1423
1425
|
}, "getDisplayText"));
|
|
1424
1426
|
d(this, Te, /* @__PURE__ */ h(() => {
|
|
1425
|
-
if (!(!t(this,
|
|
1427
|
+
if (!(!t(this, T) || !t(this, T).template || !t(this, p).closest("tbody.bindable"))) {
|
|
1426
1428
|
var e = ninegrid.j.querySelectorAll(t(this, p)).attr("suppress");
|
|
1427
1429
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1428
1430
|
var s = t(this, p).closest("tr"), r = [];
|
|
1429
|
-
$("th,td", s).each((
|
|
1430
|
-
var
|
|
1431
|
-
|
|
1431
|
+
$("th,td", s).each((m, W) => {
|
|
1432
|
+
var C = ninegrid.j.querySelectorAll(W).attr("suppress");
|
|
1433
|
+
C && W.dataset.row && (C = parseInt(C), !isNaN(C) && C <= e && r.push(C));
|
|
1432
1434
|
}), r.sort();
|
|
1433
1435
|
var n = !1;
|
|
1434
|
-
if (parseInt(s.sectionRowIndex / t(this,
|
|
1435
|
-
for (var
|
|
1436
|
-
if (
|
|
1437
|
-
var
|
|
1436
|
+
if (parseInt(s.sectionRowIndex / t(this, T).template.length) > 0)
|
|
1437
|
+
for (var a of r) {
|
|
1438
|
+
if (a > e) break;
|
|
1439
|
+
var o = parseInt(t(this, p).dataset.row), c = o - 1, l = t(this, p).closest("tr").data, f = t(this, T).data.get(c);
|
|
1438
1440
|
t(this, p).dataset.matrixRow;
|
|
1439
|
-
var u = t(this,
|
|
1440
|
-
if (
|
|
1441
|
+
var u = t(this, T).body.querySelector(`tbody.bindable [suppress="${a}"][data-matrix-row="${t(this, p).dataset.matrixRow}"]`), g = u.dataset.expr ? this.getExprValue(u.dataset.expr, l, o) : l[u.dataset.bind], b = u.dataset.expr ? this.getExprValue(u.dataset.expr, f, c) : f[u.dataset.bind];
|
|
1442
|
+
if (g != b) {
|
|
1441
1443
|
n = !0;
|
|
1442
1444
|
break;
|
|
1443
1445
|
}
|
|
@@ -1445,17 +1447,17 @@ const ze = class ze extends me {
|
|
|
1445
1447
|
else
|
|
1446
1448
|
n = !0;
|
|
1447
1449
|
n ? ninegrid.j.querySelectorAll(t(this, p)).removeClass("suppress") : ninegrid.j.querySelectorAll(t(this, p)).addClass("suppress"), ninegrid.j.querySelectorAll(t(this, p)).hasClass("hidden") || (n ? ninegrid.j.querySelectorAll(t(this, p)).removeClass("hidden") : ninegrid.j.querySelectorAll(t(this, p)).addClass("hidden"));
|
|
1448
|
-
var
|
|
1449
|
-
$(
|
|
1450
|
+
var x = parseInt(t(this, p).dataset.matrixRow), v = x - 1, A = t(this, T).body.querySelector(`tbody.bindable [data-col="${t(this, p).dataset.col}"][data-matrix-row="${v}"]`);
|
|
1451
|
+
$(A).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this, p)).hasClass("suppress") ? ninegrid.j.querySelectorAll(A).removeClass("last-none-suppress").addClass("last-suppress") : !$(A).hasClass("suppress") && ninegrid.j.querySelectorAll(t(this, p)).hasClass("suppress") ? ninegrid.j.querySelectorAll(A).removeClass("last-suppress").addClass("last-none-suppress") : ninegrid.j.querySelectorAll(A).removeClass("last-none-suppress").removeClass("last-suppress");
|
|
1450
1452
|
}
|
|
1451
1453
|
}
|
|
1452
1454
|
}, "#resetSuppress"));
|
|
1453
|
-
|
|
1455
|
+
S(this, "getExprValue", /* @__PURE__ */ h((e, s, r, n) => {
|
|
1454
1456
|
if (typeof e < "u")
|
|
1455
1457
|
try {
|
|
1456
1458
|
r = parseInt(r);
|
|
1457
|
-
const
|
|
1458
|
-
return t(this,
|
|
1459
|
+
const a = e.replace("()", "");
|
|
1460
|
+
return t(this, T)[a] ? t(this, T)[a].call(this, s, r, t(this, p)) : t(this, T).exprFunction(e).call(this, s, r, t(this, T).data);
|
|
1459
1461
|
} catch {
|
|
1460
1462
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1461
1463
|
}
|
|
@@ -1464,16 +1466,16 @@ const ze = class ze extends me {
|
|
|
1464
1466
|
}, "getExprValue"));
|
|
1465
1467
|
}
|
|
1466
1468
|
connectedCallback() {
|
|
1467
|
-
super.connectedCallback(), y(this,
|
|
1469
|
+
super.connectedCallback(), y(this, T, this.getRootNode().host), y(this, p, this.closest("th,td")), y(this, Ht, t(this, p).closest("tr"));
|
|
1468
1470
|
}
|
|
1469
1471
|
get value() {
|
|
1470
|
-
var e = !t(this,
|
|
1472
|
+
var e = !t(this, T) || !t(this, T).dataManager || !t(this, p) || !t(this, p).dataset || !t(this, p).dataset.row || !t(this, p).dataset.bind ? "" : t(this, p).closest("tr").data[t(this, p).dataset.bind];
|
|
1471
1473
|
return e ?? "";
|
|
1472
1474
|
}
|
|
1473
1475
|
set value(e) {
|
|
1474
1476
|
var s = parseInt(t(this, p).dataset.row);
|
|
1475
1477
|
const r = this.getAttribute("update-row-state") != "false";
|
|
1476
|
-
s < 0 ? t(this,
|
|
1478
|
+
s < 0 ? t(this, T).data.setValueNF(parseInt(t(this, p).dataset.index), t(this, p).dataset.bind, e, r) : t(this, T).data.setValue(s, t(this, p).dataset.bind, e, r);
|
|
1477
1479
|
}
|
|
1478
1480
|
get row() {
|
|
1479
1481
|
return parseInt(t(this, p).dataset.row);
|
|
@@ -1486,7 +1488,7 @@ const ze = class ze extends me {
|
|
|
1486
1488
|
return parseInt(t(this, p).dataset.row), t(this, Ht).data[e];
|
|
1487
1489
|
}
|
|
1488
1490
|
};
|
|
1489
|
-
|
|
1491
|
+
T = new WeakMap(), Ht = new WeakMap(), p = new WeakMap(), Ae = new WeakMap(), Re = new WeakMap(), qe = new WeakMap(), ke = new WeakMap(), Te = new WeakMap(), h(ze, "CellElement");
|
|
1490
1492
|
let xe = ze;
|
|
1491
1493
|
const De = class De extends xe {
|
|
1492
1494
|
constructor() {
|
|
@@ -1511,7 +1513,7 @@ const Pe = class Pe extends ve {
|
|
|
1511
1513
|
d(this, bt);
|
|
1512
1514
|
d(this, ne);
|
|
1513
1515
|
d(this, U);
|
|
1514
|
-
|
|
1516
|
+
S(this, "refresh", /* @__PURE__ */ h(() => {
|
|
1515
1517
|
const e = super.refresh();
|
|
1516
1518
|
H.log("::", e), t(this, Mt).value = e;
|
|
1517
1519
|
}, "refresh"));
|