@ninebone/table 0.0.553 → 0.0.554
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 +379 -384
- 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,8 +4,8 @@ var Ve = (R) => {
|
|
|
4
4
|
};
|
|
5
5
|
var Xe = (R, i, e) => i in R ? Fe(R, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : R[i] = e;
|
|
6
6
|
var c = (R, i) => Fe(R, "name", { value: i, configurable: !0 });
|
|
7
|
-
var
|
|
8
|
-
var t = (R, i, e) => (Ye(R, i, "read from private field"), e ? e.call(R) : i.get(R)),
|
|
7
|
+
var A = (R, i, e) => Xe(R, typeof i != "symbol" ? i + "" : i, e), Ye = (R, i, e) => i.has(R) || Ve("Cannot " + e);
|
|
8
|
+
var t = (R, i, e) => (Ye(R, i, "read from private field"), e ? e.call(R) : i.get(R)), d = (R, i, e) => i.has(R) ? Ve("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(R) : i.set(R, e), p = (R, i, e, s) => (Ye(R, i, "write to private field"), s ? s.call(R, e) : i.set(R, e), e);
|
|
9
9
|
var Ue = (R, i, e, s) => ({
|
|
10
10
|
set _(r) {
|
|
11
11
|
p(R, i, r, e);
|
|
@@ -27,60 +27,60 @@ var z, j, w, X, K, Z, It, G, _t;
|
|
|
27
27
|
const Me = class Me extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
d(this, z);
|
|
31
|
+
d(this, j, !1);
|
|
32
|
+
d(this, w);
|
|
33
|
+
d(this, X);
|
|
34
|
+
d(this, K);
|
|
35
|
+
d(this, Z);
|
|
36
|
+
d(this, It, /* @__PURE__ */ c(() => {
|
|
37
37
|
if (!t(this, z)) return;
|
|
38
38
|
const e = t(this, z).querySelector(".ng-container-body .ng-part-body");
|
|
39
39
|
e && (p(this, Z, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
41
|
})), t(this, Z).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
|
-
|
|
43
|
+
A(this, "refresh", /* @__PURE__ */ c(() => {
|
|
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, o = t(this, z).querySelector(".ng-container-bottom"), a = e.clientWidth, h = s.scrollWidth;
|
|
48
|
+
if (a !== 0 && h > a)
|
|
49
|
+
o && (o.style.display = "flex");
|
|
50
50
|
else {
|
|
51
|
-
|
|
51
|
+
o && (o.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 * (a / h), 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 = h - a;
|
|
59
|
+
let b = 0;
|
|
60
|
+
g > 0 && (b = parseInt(u / g * (l - f), 10)), b < 0 && (b = 0);
|
|
61
|
+
const m = l - f;
|
|
62
|
+
b > m && (b = m), n.style.left = `${b}px`, t(this, w).left.disabled = b === 0, t(this, w).right.disabled = b >= m - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
|
|
64
|
+
d(this, G, /* @__PURE__ */ c((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
|
|
72
|
-
|
|
68
|
+
const n = t(this, w).track.getBoundingClientRect(), o = t(this, w).thumb.clientWidth;
|
|
69
|
+
let a = e;
|
|
70
|
+
a < 0 && (a = 0);
|
|
71
|
+
const h = n.width - o;
|
|
72
|
+
a > h && (a = h), a = parseInt(a, 10), t(this, w).thumb.style.left = `${a}px`, t(this, w).left.disabled = a === 0, t(this, w).right.disabled = a >= h - 1;
|
|
73
73
|
const l = s.clientWidth, u = r.scrollWidth - l;
|
|
74
|
-
return
|
|
74
|
+
return h > 0 && u > 0 && (s.scrollLeft = a / h * u), a > 0 && a < h - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
|
|
76
|
+
d(this, _t, /* @__PURE__ */ c(() => {
|
|
77
77
|
const e = /* @__PURE__ */ c((r) => {
|
|
78
78
|
clearInterval(t(this, X)), clearInterval(t(this, K));
|
|
79
79
|
const n = parseInt(t(this, w).thumb.style.left || 0, 10);
|
|
80
80
|
t(this, G).call(this, n + r), p(this, X, setInterval(() => {
|
|
81
81
|
clearInterval(t(this, X)), p(this, K, setInterval(() => {
|
|
82
|
-
const
|
|
83
|
-
t(this, G).call(this,
|
|
82
|
+
const o = parseInt(t(this, w).thumb.style.left || 0, 10);
|
|
83
|
+
t(this, G).call(this, o + r) || clearInterval(t(this, K));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), s = /* @__PURE__ */ c(() => {
|
|
@@ -95,19 +95,19 @@ const Me = class Me 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(), o = t(this, w).thumb.clientWidth;
|
|
99
|
+
t(this, G).call(this, r.clientX - n.left - o / 2);
|
|
100
100
|
}), t(this, w).thumb.addEventListener("mousedown", (r) => {
|
|
101
101
|
if (r.button !== 0) return;
|
|
102
102
|
r.stopPropagation(), r.preventDefault(), p(this, j, !0), this.shiftX = r.clientX - t(this, w).thumb.getBoundingClientRect().left;
|
|
103
|
-
const n = /* @__PURE__ */ c((
|
|
103
|
+
const n = /* @__PURE__ */ c((a) => {
|
|
104
104
|
if (!t(this, j)) return;
|
|
105
|
-
const
|
|
106
|
-
t(this, G).call(this,
|
|
107
|
-
}, "onMouseMove"),
|
|
108
|
-
p(this, j, !1), s(), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup",
|
|
105
|
+
const h = t(this, w).track.getBoundingClientRect();
|
|
106
|
+
t(this, G).call(this, a.clientX - h.left - this.shiftX);
|
|
107
|
+
}, "onMouseMove"), o = /* @__PURE__ */ c(() => {
|
|
108
|
+
p(this, j, !1), s(), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
|
-
document.addEventListener("mousemove", n), document.addEventListener("mouseup",
|
|
110
|
+
document.addEventListener("mousemove", n), document.addEventListener("mouseup", o);
|
|
111
111
|
});
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
@@ -205,15 +205,15 @@ var F, at, J, q, xt, vt, Nt;
|
|
|
205
205
|
const $e = class $e extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
208
|
+
d(this, F);
|
|
209
|
+
d(this, at);
|
|
210
|
+
d(this, J, !1);
|
|
211
|
+
d(this, q);
|
|
212
|
+
d(this, xt, 0);
|
|
213
|
+
d(this, vt, 0);
|
|
214
|
+
A(this, "refresh", /* @__PURE__ */ c(() => {
|
|
215
215
|
if (!t(this, F) || !t(this, q)) return;
|
|
216
|
-
const e = t(this, q).container, s = t(this, q).track, r = t(this, q).thumb, n = e.clientHeight,
|
|
216
|
+
const e = t(this, q).container, s = t(this, q).track, r = t(this, q).thumb, n = e.clientHeight, a = (t(this, F).data.get() || []).length, h = t(this, at).getRowHeight(), l = a * h;
|
|
217
217
|
if (l <= n) {
|
|
218
218
|
r.style.display = "none", t(this, q).top.disabled = !0, t(this, q).bottom.disabled = !0;
|
|
219
219
|
return;
|
|
@@ -223,43 +223,43 @@ const $e = class $e extends HTMLElement {
|
|
|
223
223
|
if (f <= 0) return;
|
|
224
224
|
const u = Math.max(Math.min(f * (n / l), f), 20);
|
|
225
225
|
r.style.height = `${u}px`;
|
|
226
|
-
const
|
|
227
|
-
let
|
|
228
|
-
|
|
226
|
+
const g = e.scrollTop, b = Math.max(l - n, 1);
|
|
227
|
+
let m = 0;
|
|
228
|
+
b > 0 && (m = g / b * (f - u));
|
|
229
229
|
const v = f - u;
|
|
230
|
-
|
|
230
|
+
m < 0 && (m = 0), m > v && (m = v), r.style.top = `${m}px`, t(this, q).top.disabled = g <= 0, t(this, q).bottom.disabled = g >= b - 1;
|
|
231
231
|
}, "refresh"));
|
|
232
|
-
|
|
232
|
+
d(this, Nt, /* @__PURE__ */ c(() => {
|
|
233
233
|
N.log("nine-table-vscrollbar.#init");
|
|
234
234
|
const e = t(this, q).container, s = /* @__PURE__ */ c(() => {
|
|
235
|
-
const n = (t(this, F).data.get() || []).length,
|
|
236
|
-
return n *
|
|
235
|
+
const n = (t(this, F).data.get() || []).length, o = t(this, at).getRowHeight();
|
|
236
|
+
return n * o;
|
|
237
237
|
}, "getContentHeight");
|
|
238
238
|
e.addEventListener("scroll", () => {
|
|
239
239
|
t(this, J) || this.refresh();
|
|
240
240
|
}), t(this, q).thumb.addEventListener("mousedown", (r) => {
|
|
241
241
|
if (r.button !== 0) return;
|
|
242
242
|
r.stopPropagation(), r.preventDefault(), p(this, J, !0), p(this, xt, r.clientY), p(this, vt, e.scrollTop);
|
|
243
|
-
const n = /* @__PURE__ */ c((
|
|
243
|
+
const n = /* @__PURE__ */ c((a) => {
|
|
244
244
|
if (!t(this, J)) return;
|
|
245
|
-
const
|
|
245
|
+
const h = t(this, q).track.getBoundingClientRect(), l = t(this, q).thumb.clientHeight, u = h.height - l, g = a.clientY - t(this, xt), b = e.clientHeight, m = s(), v = Math.max(m - b, 1);
|
|
246
246
|
if (u > 0 && v > 0) {
|
|
247
|
-
const
|
|
248
|
-
let
|
|
249
|
-
const
|
|
250
|
-
|
|
247
|
+
const E = g / u * v;
|
|
248
|
+
let x = t(this, vt) + E;
|
|
249
|
+
const O = Math.max(0, m - b);
|
|
250
|
+
x < 0 && (x = 0), x > O && (x = O), e.scrollTop = x;
|
|
251
251
|
}
|
|
252
252
|
this.refresh();
|
|
253
|
-
}, "onMouseMove"),
|
|
254
|
-
p(this, J, !1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup",
|
|
253
|
+
}, "onMouseMove"), o = /* @__PURE__ */ c(() => {
|
|
254
|
+
p(this, J, !1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), this.refresh();
|
|
255
255
|
}, "onMouseUp");
|
|
256
|
-
document.addEventListener("mousemove", n), document.addEventListener("mouseup",
|
|
256
|
+
document.addEventListener("mousemove", n), document.addEventListener("mouseup", o);
|
|
257
257
|
}), t(this, q).track.addEventListener("mousedown", (r) => {
|
|
258
258
|
if (r.button !== 0 || r.target === t(this, q).thumb) return;
|
|
259
|
-
const n = t(this, q).track.getBoundingClientRect(),
|
|
260
|
-
if (l > 0 &&
|
|
261
|
-
const
|
|
262
|
-
e.scrollTop =
|
|
259
|
+
const n = t(this, q).track.getBoundingClientRect(), o = t(this, q).thumb.clientHeight, a = r.clientY - n.top - o / 2, l = n.height - o, f = e.clientHeight, u = s(), g = Math.max(u - f, 1);
|
|
260
|
+
if (l > 0 && g > 0) {
|
|
261
|
+
const b = Math.max(0, Math.min(1, a / l));
|
|
262
|
+
e.scrollTop = b * g;
|
|
263
263
|
}
|
|
264
264
|
this.refresh();
|
|
265
265
|
}), t(this, q).top.addEventListener("click", () => {
|
|
@@ -357,60 +357,58 @@ customElements.get("nine-table-vscrollbar") || customElements.define("nine-table
|
|
|
357
357
|
var D, S, Q, P, H, V, tt, wt, Se, Ee, Wt, Ot, Bt, St, Et, zt, Pt, At, Ae, lt, Rt, Dt;
|
|
358
358
|
const Ie = class Ie {
|
|
359
359
|
constructor(i) {
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
360
|
+
d(this, D);
|
|
361
|
+
d(this, S);
|
|
362
|
+
d(this, Q);
|
|
363
|
+
d(this, P, /* @__PURE__ */ new Map());
|
|
364
|
+
d(this, H, null);
|
|
365
|
+
d(this, V, null);
|
|
366
|
+
d(this, tt, 0);
|
|
367
|
+
d(this, wt, 40);
|
|
368
|
+
d(this, Se, !1);
|
|
369
|
+
d(this, Ee, !1);
|
|
370
|
+
d(this, Wt, 3);
|
|
371
|
+
A(this, "refresh", /* @__PURE__ */ c(() => {
|
|
372
372
|
var e;
|
|
373
373
|
N.log("rowManager.refresh");
|
|
374
374
|
const i = t(this, S).querySelector(".ng-container-body .ng-part-body");
|
|
375
375
|
i && (t(this, St).call(this), t(this, lt).call(this, i.scrollTop), (e = t(this, S).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
376
376
|
}, "refresh"));
|
|
377
|
-
|
|
377
|
+
A(this, "initialize", /* @__PURE__ */ c(() => {
|
|
378
378
|
N.log("rowManager.initialize"), p(this, Q, {
|
|
379
379
|
scrollTables: t(this, S).querySelectorAll(".ng-part-body table"),
|
|
380
380
|
firstTr: t(this, S).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
381
|
-
}), p(this, H, null), t(this, P).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
382
|
-
const
|
|
383
|
-
if (!n) return;
|
|
384
|
-
const a = n.querySelector(".ng-part-body table");
|
|
381
|
+
}), p(this, H, null), t(this, P).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
382
|
+
const a = t(this, S).querySelector(o);
|
|
385
383
|
if (!a) return;
|
|
386
|
-
const
|
|
387
|
-
if (!
|
|
388
|
-
const l =
|
|
389
|
-
|
|
384
|
+
const h = a.querySelector(".ng-part-body table");
|
|
385
|
+
if (!h) return;
|
|
386
|
+
const l = h.querySelector("tbody.bindable-tbody");
|
|
387
|
+
if (!l) return;
|
|
388
|
+
const u = Array.from(l.querySelectorAll("tr")).map((g) => g.cloneNode(!0));
|
|
389
|
+
t(this, P).set(o, u);
|
|
390
390
|
});
|
|
391
|
-
const i = t(this, S).querySelector(".ng-container-body .ng-part-body"), e = t(this, S).querySelector(".ng-container-left .ng-part-body"), s = t(this, S).querySelector(".ng-container-right .ng-part-body");
|
|
392
|
-
|
|
393
|
-
const
|
|
394
|
-
|
|
395
|
-
e && (e.scrollTop = r), s && (s.scrollTop = r), t(this, lt).call(this, r);
|
|
396
|
-
});
|
|
391
|
+
const i = t(this, S).querySelector(".ng-container-body .ng-part-body"), e = t(this, S).querySelector(".ng-container-left .ng-part-body"), s = t(this, S).querySelector(".ng-container-right .ng-part-body"), r = t(this, S).querySelector(".ng-container-body .ng-part-header"), n = t(this, S).querySelector(".ng-container-body .ng-part-footer");
|
|
392
|
+
i && (t(this, Bt).call(this, i), t(this, At).call(this), t(this, St).call(this), t(this, lt).call(this, i.scrollTop), i.addEventListener("scroll", () => {
|
|
393
|
+
const o = i.scrollTop, a = i.scrollLeft;
|
|
394
|
+
e && (e.scrollTop = o), s && (s.scrollTop = o), r && (r.scrollLeft = a), n && (n.scrollLeft = a), t(this, lt).call(this, o);
|
|
397
395
|
}));
|
|
398
396
|
}, "initialize"));
|
|
399
|
-
|
|
397
|
+
d(this, Ot, /* @__PURE__ */ c((i, e) => {
|
|
400
398
|
N.log("rowManager.#renderRows");
|
|
401
399
|
const s = t(this, P).get(e);
|
|
402
400
|
if (!s || s.length === 0) return;
|
|
403
401
|
const r = i.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
404
402
|
if (!r) return;
|
|
405
|
-
r.querySelectorAll("tr:not(.nodata)").forEach((
|
|
406
|
-
const n = r.querySelector("tr.nodata"),
|
|
407
|
-
for (let
|
|
408
|
-
s.forEach((
|
|
409
|
-
|
|
403
|
+
r.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
|
|
404
|
+
const n = r.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
405
|
+
for (let a = 0; a < t(this, wt); a++)
|
|
406
|
+
s.forEach((h) => {
|
|
407
|
+
o.appendChild(h.cloneNode(!0));
|
|
410
408
|
});
|
|
411
|
-
n ? n.before(
|
|
409
|
+
n ? n.before(o) : r.appendChild(o), e === ".ng-container-body" && (t(this, Q).firstTr = r.querySelector("tr:not(.nodata)"));
|
|
412
410
|
}, "#renderRows"));
|
|
413
|
-
|
|
411
|
+
d(this, Bt, /* @__PURE__ */ c((i) => {
|
|
414
412
|
if (N.log("rowManager.#measureAndCacheHeight"), t(this, H) !== null && t(this, H) > 0)
|
|
415
413
|
return t(this, H);
|
|
416
414
|
N.log("#measureAndCacheHeight");
|
|
@@ -418,63 +416,63 @@ const Ie = class Ie {
|
|
|
418
416
|
if (!e || e.length === 0) return 24;
|
|
419
417
|
const s = i.querySelector("tbody.bindable-tbody");
|
|
420
418
|
if (!s) return 24;
|
|
421
|
-
s.querySelectorAll("tr:not(.nodata)").forEach((
|
|
419
|
+
s.querySelectorAll("tr:not(.nodata)").forEach((g) => g.remove());
|
|
422
420
|
const r = s.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
423
|
-
e.forEach((
|
|
424
|
-
n.appendChild(
|
|
421
|
+
e.forEach((g) => {
|
|
422
|
+
n.appendChild(g.cloneNode(!0));
|
|
425
423
|
}), r ? r.before(n) : s.appendChild(n);
|
|
426
|
-
const
|
|
427
|
-
(
|
|
424
|
+
const o = t(this, S), a = o.style.display, h = o.style.visibility, l = o.style.position;
|
|
425
|
+
(a === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
428
426
|
let f = 0;
|
|
429
427
|
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
430
|
-
return u.forEach((
|
|
431
|
-
f +=
|
|
432
|
-
}), u.forEach((
|
|
428
|
+
return u.forEach((g) => {
|
|
429
|
+
f += g.offsetHeight || g.getBoundingClientRect().height;
|
|
430
|
+
}), u.forEach((g) => g.remove()), o.style.display = a, o.style.visibility = h, o.style.position = l, p(this, H, f > 0 ? f : 24), t(this, Et).call(this), t(this, H);
|
|
433
431
|
}, "#measureAndCacheHeight"));
|
|
434
|
-
|
|
432
|
+
d(this, St, /* @__PURE__ */ c(() => {
|
|
435
433
|
N.log("rowManager.#updateVirtualScrollHeight");
|
|
436
434
|
const e = (t(this, D).data.get() || []).length, s = t(this, H), r = e * s;
|
|
437
435
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
438
|
-
const
|
|
439
|
-
if (!
|
|
440
|
-
const
|
|
441
|
-
|
|
436
|
+
const o = t(this, S).querySelector(n);
|
|
437
|
+
if (!o) return;
|
|
438
|
+
const a = o.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
439
|
+
a && (a.style.height = `${r}px`);
|
|
442
440
|
});
|
|
443
441
|
}, "#updateVirtualScrollHeight"));
|
|
444
|
-
|
|
442
|
+
d(this, Et, /* @__PURE__ */ c(() => {
|
|
445
443
|
if (t(this, tt) > 0 && t(this, H) > 0) {
|
|
446
444
|
const i = Math.ceil(t(this, tt) / t(this, H));
|
|
447
445
|
p(this, wt, i + t(this, Wt));
|
|
448
446
|
}
|
|
449
447
|
}, "#updateRowCount"));
|
|
450
|
-
|
|
451
|
-
var
|
|
448
|
+
d(this, zt, /* @__PURE__ */ c(() => {
|
|
449
|
+
var a, h, l, f, u, g;
|
|
452
450
|
const i = t(this, S).querySelector(".ng-container-left .ng-part-body table"), e = t(this, S).querySelector(".ng-container-body .ng-part-body table"), s = t(this, S).querySelector(".ng-container-right .ng-part-body table");
|
|
453
451
|
if (e) {
|
|
454
|
-
const
|
|
455
|
-
for (let
|
|
456
|
-
const
|
|
457
|
-
((
|
|
458
|
-
((
|
|
459
|
-
((l = v[
|
|
460
|
-
], C = Math.max(...
|
|
461
|
-
C > 0 && (
|
|
452
|
+
const b = i ? Array.from(i.querySelectorAll("tbody tr")) : [], m = Array.from(e.querySelectorAll("tbody tr")), v = s ? Array.from(s.querySelectorAll("tbody tr")) : [], E = Math.max(b.length, m.length, v.length);
|
|
453
|
+
for (let x = 0; x < E; x++) {
|
|
454
|
+
const O = [
|
|
455
|
+
((a = b[x]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
456
|
+
((h = m[x]) == null ? void 0 : h.getBoundingClientRect().height) || 0,
|
|
457
|
+
((l = v[x]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
458
|
+
], C = Math.max(...O);
|
|
459
|
+
C > 0 && (b[x] && (b[x].style.height = `${C}px`), m[x] && (m[x].style.height = `${C}px`), v[x] && (v[x].style.height = `${C}px`));
|
|
462
460
|
}
|
|
463
461
|
}
|
|
464
|
-
const r = t(this, S).querySelector(".ng-container-left .ng-part-footer table"), n = t(this, S).querySelector(".ng-container-body .ng-part-footer table"),
|
|
462
|
+
const r = t(this, S).querySelector(".ng-container-left .ng-part-footer table"), n = t(this, S).querySelector(".ng-container-body .ng-part-footer table"), o = t(this, S).querySelector(".ng-container-right .ng-part-footer table");
|
|
465
463
|
if (n) {
|
|
466
|
-
const
|
|
467
|
-
for (let
|
|
468
|
-
const
|
|
469
|
-
((f =
|
|
470
|
-
((u = x
|
|
471
|
-
((
|
|
472
|
-
], C = Math.max(...
|
|
473
|
-
C > 0 && (
|
|
464
|
+
const b = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], m = Array.from(n.querySelectorAll("tfoot tr")), v = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], E = Math.max(b.length, m.length, v.length);
|
|
465
|
+
for (let x = 0; x < E; x++) {
|
|
466
|
+
const O = [
|
|
467
|
+
((f = b[x]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
468
|
+
((u = m[x]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
|
|
469
|
+
((g = v[x]) == null ? void 0 : g.getBoundingClientRect().height) || 0
|
|
470
|
+
], C = Math.max(...O);
|
|
471
|
+
C > 0 && (b[x] && (b[x].style.height = `${C}px`), m[x] && (m[x].style.height = `${C}px`), v[x] && (v[x].style.height = `${C}px`));
|
|
474
472
|
}
|
|
475
473
|
}
|
|
476
474
|
}, "#syncRowHeights"));
|
|
477
|
-
|
|
475
|
+
d(this, Pt, /* @__PURE__ */ c(() => {
|
|
478
476
|
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (p(this, V, new ResizeObserver((i) => {
|
|
479
477
|
for (const e of i) {
|
|
480
478
|
const s = e.target;
|
|
@@ -482,61 +480,58 @@ const Ie = class Ie {
|
|
|
482
480
|
const r = e.contentRect.height;
|
|
483
481
|
if (r > 0) {
|
|
484
482
|
let n = 0;
|
|
485
|
-
const
|
|
486
|
-
|
|
487
|
-
const
|
|
488
|
-
t(this, tt) !==
|
|
483
|
+
const o = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
|
|
484
|
+
o && (n += o.offsetHeight), a && (n += a.offsetHeight);
|
|
485
|
+
const h = Math.max(r - n, 100);
|
|
486
|
+
t(this, tt) !== h && (p(this, tt, h), t(this, Et).call(this), t(this, H) !== null && (t(this, At).call(this), this.refresh()));
|
|
489
487
|
}
|
|
490
488
|
}
|
|
491
489
|
})), t(this, V).observe(t(this, S)));
|
|
492
490
|
}, "#initResizeObserver"));
|
|
493
|
-
|
|
491
|
+
d(this, At, /* @__PURE__ */ c(() => {
|
|
494
492
|
N.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
495
493
|
const e = t(this, S).querySelector(i);
|
|
496
494
|
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Ot).call(this, e, i);
|
|
497
495
|
}), t(this, Dt).call(this), t(this, zt).call(this);
|
|
498
496
|
}, "#renderAllContainers"));
|
|
499
|
-
|
|
497
|
+
d(this, Ae, /* @__PURE__ */ c((i) => {
|
|
500
498
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
501
499
|
var l;
|
|
502
500
|
const s = t(this, S).querySelector(e);
|
|
503
501
|
if (!s) return;
|
|
504
502
|
const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
505
503
|
if (!r) return;
|
|
506
|
-
const n = Array.from(r.querySelectorAll("tr:not(.nodata)")),
|
|
504
|
+
const n = Array.from(r.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this, P).get(e)) == null ? void 0 : l.length) || 1, h = (t(this, D).data.get() || []).length;
|
|
507
505
|
n.forEach((f, u) => {
|
|
508
|
-
const
|
|
509
|
-
if (
|
|
506
|
+
const g = i + Math.floor(u / o);
|
|
507
|
+
if (g >= h) {
|
|
510
508
|
f.style.display = "none";
|
|
511
509
|
return;
|
|
512
510
|
}
|
|
513
|
-
const
|
|
514
|
-
f.style.display = "", t(this, Rt).call(this, f,
|
|
511
|
+
const b = t(this, D).data.get(g);
|
|
512
|
+
f.style.display = "", t(this, Rt).call(this, f, b, g);
|
|
515
513
|
});
|
|
516
514
|
});
|
|
517
515
|
}, "#adjustBufferRows"));
|
|
518
|
-
|
|
519
|
-
var
|
|
516
|
+
d(this, lt, /* @__PURE__ */ c((i) => {
|
|
517
|
+
var h, l;
|
|
520
518
|
const e = t(this, H);
|
|
521
519
|
if (!e || e <= 0) return;
|
|
522
|
-
const s = t(this, D).data.length, r = Math.max(0, Math.floor(i / e)), n =
|
|
523
|
-
(
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
const b = t(this, S).querySelector(u);
|
|
529
|
-
if (!b) return;
|
|
530
|
-
const g = b.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
520
|
+
const s = t(this, D).data.length, r = Math.max(0, Math.floor(i / e)), n = ((h = t(this, P).get(".ng-container-body")) == null ? void 0 : h.length) || 1, o = t(this, Q).firstTr, a = o && o.dataset.row !== void 0 ? parseInt(o.dataset.row, 10) : -1;
|
|
521
|
+
(l = t(this, Q)) == null || l.scrollTables.forEach((f) => {
|
|
522
|
+
}), a !== r && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((f) => {
|
|
523
|
+
const u = t(this, S).querySelector(f);
|
|
524
|
+
if (!u) return;
|
|
525
|
+
const g = u.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
531
526
|
if (!g) return;
|
|
532
|
-
Array.from(g.querySelectorAll("tr:not(.nodata)")).forEach((
|
|
533
|
-
const
|
|
534
|
-
if (
|
|
535
|
-
|
|
527
|
+
Array.from(g.querySelectorAll("tr:not(.nodata)")).forEach((m, v) => {
|
|
528
|
+
const E = r + Math.floor(v / n);
|
|
529
|
+
if (E >= s) {
|
|
530
|
+
m.style.display = "none";
|
|
536
531
|
return;
|
|
537
532
|
}
|
|
538
|
-
const
|
|
539
|
-
|
|
533
|
+
const x = t(this, D).data.get(E);
|
|
534
|
+
m.style.display = "", t(this, Rt).call(this, m, x, E);
|
|
540
535
|
});
|
|
541
536
|
});
|
|
542
537
|
}, "#handleScroll"));
|
|
@@ -554,29 +549,29 @@ const Ie = class Ie {
|
|
|
554
549
|
cell.dataset.row = dataIndex;
|
|
555
550
|
});
|
|
556
551
|
}; */
|
|
557
|
-
|
|
552
|
+
d(this, Rt, /* @__PURE__ */ c((i, e, s) => {
|
|
558
553
|
i.dataset.row = s, i.data = e, Array.from(i.cells).forEach((r, n) => {
|
|
559
554
|
r.dataset.row = s;
|
|
560
|
-
const
|
|
561
|
-
|
|
555
|
+
const o = Array.from(r.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
|
|
556
|
+
o && typeof o.refresh == "function" && o.refresh();
|
|
562
557
|
});
|
|
563
558
|
}, "#bindRowData"));
|
|
564
|
-
|
|
565
|
-
var
|
|
559
|
+
d(this, Dt, /* @__PURE__ */ c(() => {
|
|
560
|
+
var h, l, f;
|
|
566
561
|
N.log("rowManager.#syncHeaderHeights");
|
|
567
562
|
const i = t(this, S).querySelector(".ng-container-left .ng-part-header table"), e = t(this, S).querySelector(".ng-container-body .ng-part-header table"), s = t(this, S).querySelector(".ng-container-right .ng-part-header table");
|
|
568
563
|
if (!e) return;
|
|
569
|
-
const r = i ? Array.from(i.querySelectorAll("tr")) : [], n = Array.from(e.querySelectorAll("tr")),
|
|
570
|
-
for (let u = 0; u <
|
|
571
|
-
const
|
|
572
|
-
((
|
|
564
|
+
const r = i ? Array.from(i.querySelectorAll("tr")) : [], n = Array.from(e.querySelectorAll("tr")), o = s ? Array.from(s.querySelectorAll("tr")) : [], a = Math.max(r.length, n.length, o.length);
|
|
565
|
+
for (let u = 0; u < a; u++) {
|
|
566
|
+
const g = [
|
|
567
|
+
((h = r[u]) == null ? void 0 : h.getBoundingClientRect().height) || 0,
|
|
573
568
|
((l = n[u]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
574
|
-
((f =
|
|
575
|
-
],
|
|
576
|
-
|
|
569
|
+
((f = o[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
570
|
+
], b = Math.max(...g);
|
|
571
|
+
b > 0 && (r[u] && (r[u].style.height = `${b}px`), n[u] && (n[u].style.height = `${b}px`), o[u] && (o[u].style.height = `${b}px`));
|
|
577
572
|
}
|
|
578
573
|
}, "#syncHeaderHeights"));
|
|
579
|
-
|
|
574
|
+
A(this, "destroy", /* @__PURE__ */ c(() => {
|
|
580
575
|
t(this, V) && (t(this, V).disconnect(), p(this, V, null));
|
|
581
576
|
}, "destroy"));
|
|
582
577
|
p(this, D, i.getRootNode().host), p(this, S, i), t(this, Pt).call(this);
|
|
@@ -603,65 +598,65 @@ const jt = class jt {
|
|
|
603
598
|
*/
|
|
604
599
|
static compile(i) {
|
|
605
600
|
if (!i) return null;
|
|
606
|
-
const e = /* @__PURE__ */ c((
|
|
607
|
-
|
|
601
|
+
const e = /* @__PURE__ */ c((a) => {
|
|
602
|
+
a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
|
|
608
603
|
const f = l.getAttribute("cell-type") || "renderer";
|
|
609
604
|
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
610
605
|
let u = `cell-${f}`;
|
|
611
|
-
const
|
|
612
|
-
let
|
|
613
|
-
|
|
606
|
+
const g = l.getAttribute("data-bind"), b = l.getAttribute("data-expr"), m = l.getAttribute("maxbyte"), v = l.getAttribute("type");
|
|
607
|
+
let E = [];
|
|
608
|
+
g && E.push(`data-bind="${g}"`), b && E.push(`data-expr="${b}"`), m && E.push(`maxbyte="${m}"`), v && E.push(`type="${v}"`), l.innerHTML = `<${u} ${E.join(" ")}></${u}>`;
|
|
614
609
|
});
|
|
615
|
-
}, "processCellTypes"), s = /* @__PURE__ */ c((
|
|
616
|
-
if (!
|
|
617
|
-
const
|
|
618
|
-
for (let
|
|
619
|
-
const
|
|
620
|
-
|
|
610
|
+
}, "processCellTypes"), s = /* @__PURE__ */ c((a) => {
|
|
611
|
+
if (!a.querySelector("colgroup")) {
|
|
612
|
+
const h = a.querySelector("tbody tr") || a.querySelector("tr"), l = h ? h.querySelectorAll("th, td").length : 1, f = document.createElement("colgroup"), u = Math.max(Math.floor(a.clientWidth / l), 100);
|
|
613
|
+
for (let g = 0; g < l; g++) {
|
|
614
|
+
const b = document.createElement("col");
|
|
615
|
+
b.setAttribute("width", u), f.appendChild(b);
|
|
621
616
|
}
|
|
622
|
-
|
|
617
|
+
a.prepend(f);
|
|
623
618
|
}
|
|
624
|
-
if (!
|
|
625
|
-
const
|
|
626
|
-
l ? l.after(
|
|
619
|
+
if (!a.querySelector("thead")) {
|
|
620
|
+
const h = document.createElement("thead"), l = a.querySelector("colgroup");
|
|
621
|
+
l ? l.after(h) : a.prepend(h);
|
|
627
622
|
}
|
|
628
|
-
|
|
629
|
-
}, "ensureTableStructure"), r = /* @__PURE__ */ c((
|
|
630
|
-
const l = Array.from(
|
|
623
|
+
a.classList.add("nine-table-element"), a.style.display = "table";
|
|
624
|
+
}, "ensureTableStructure"), r = /* @__PURE__ */ c((a, h) => {
|
|
625
|
+
const l = Array.from(a.querySelectorAll(h + " tr")), f = Array.from(a.querySelectorAll(h + " th," + h + " td")), u = l.length;
|
|
631
626
|
if (u === 0 || f.length === 0) return;
|
|
632
|
-
let
|
|
633
|
-
f.forEach((
|
|
634
|
-
|
|
627
|
+
let g = 0;
|
|
628
|
+
f.forEach((m) => {
|
|
629
|
+
g += m.colSpan || 1;
|
|
635
630
|
});
|
|
636
|
-
const
|
|
637
|
-
l.forEach((
|
|
638
|
-
const v =
|
|
639
|
-
let
|
|
640
|
-
Array.from(
|
|
641
|
-
for (let B = 0; B <
|
|
642
|
-
if (
|
|
643
|
-
|
|
631
|
+
const b = Array.from(Array(u), () => Array(g).fill(null));
|
|
632
|
+
l.forEach((m) => {
|
|
633
|
+
const v = m.sectionRowIndex;
|
|
634
|
+
let E = 0;
|
|
635
|
+
Array.from(m.querySelectorAll("th,td")).forEach((x) => {
|
|
636
|
+
for (let B = 0; B < b[v].length; B++)
|
|
637
|
+
if (b[v][B] === null) {
|
|
638
|
+
E = B;
|
|
644
639
|
break;
|
|
645
640
|
}
|
|
646
|
-
const
|
|
647
|
-
for (let B = 0; B <
|
|
641
|
+
const O = x.rowSpan || 1, C = x.colSpan || 1;
|
|
642
|
+
for (let B = 0; B < O; B++)
|
|
648
643
|
for (let pt = 0; pt < C; pt++)
|
|
649
|
-
v + B < u &&
|
|
644
|
+
v + B < u && E + pt < g && (b[v + B][E + pt] = B === 0 && pt === 0 ? "1" : "0");
|
|
650
645
|
});
|
|
651
|
-
}), l.forEach((
|
|
652
|
-
const v =
|
|
653
|
-
Array.from(
|
|
654
|
-
for (let
|
|
655
|
-
if (
|
|
656
|
-
|
|
646
|
+
}), l.forEach((m) => {
|
|
647
|
+
const v = m.sectionRowIndex;
|
|
648
|
+
Array.from(m.querySelectorAll("th,td")).forEach((E) => {
|
|
649
|
+
for (let x = 0; x < b[v].length; x++)
|
|
650
|
+
if (b[v][x] === "1") {
|
|
651
|
+
E.dataset.col = x, b[v][x] = "0";
|
|
657
652
|
break;
|
|
658
653
|
}
|
|
659
654
|
});
|
|
660
655
|
});
|
|
661
656
|
}, "resetColIndex"), n = i.cloneNode(!0);
|
|
662
|
-
return s(n), e(n), r(n, "thead"), r(n, "tbody"), r(n, "tfoot"), Array.from(n.querySelectorAll("colgroup col")).forEach((
|
|
663
|
-
const l =
|
|
664
|
-
l && n.querySelectorAll(`thead [data-col="${
|
|
657
|
+
return s(n), e(n), r(n, "thead"), r(n, "tbody"), r(n, "tfoot"), Array.from(n.querySelectorAll("colgroup col")).forEach((a, h) => {
|
|
658
|
+
const l = a.getAttribute("fixed");
|
|
659
|
+
l && n.querySelectorAll(`thead [data-col="${h}"], tbody [data-col="${h}"], tfoot [data-col="${h}"]`).forEach((f) => {
|
|
665
660
|
f.setAttribute("fixed", l);
|
|
666
661
|
});
|
|
667
662
|
}), n;
|
|
@@ -674,13 +669,13 @@ var Ft, et, st, Vt, Yt, ct, Ut, Xt;
|
|
|
674
669
|
const yt = class yt extends HTMLElement {
|
|
675
670
|
constructor() {
|
|
676
671
|
super();
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
672
|
+
d(this, Ft);
|
|
673
|
+
d(this, et, null);
|
|
674
|
+
d(this, st);
|
|
675
|
+
A(this, "invalidate", /* @__PURE__ */ c(() => {
|
|
681
676
|
t(this, st).refresh();
|
|
682
677
|
}, "invalidate"));
|
|
683
|
-
|
|
678
|
+
d(this, Vt, /* @__PURE__ */ c(() => {
|
|
684
679
|
[
|
|
685
680
|
{ selector: ".ng-container-body", type: null },
|
|
686
681
|
{ selector: ".ng-container-left", type: "left" },
|
|
@@ -689,43 +684,43 @@ const yt = class yt extends HTMLElement {
|
|
|
689
684
|
const n = this.querySelector(s);
|
|
690
685
|
if (!n) return;
|
|
691
686
|
n.innerHTML = "";
|
|
692
|
-
const a = document.createElement("div");
|
|
693
|
-
a.className = "ng-part-header", a.appendChild(t(this, ct).call(this, t(this, et), r, "header"));
|
|
694
687
|
const o = document.createElement("div");
|
|
695
|
-
o.className = "ng-part-
|
|
696
|
-
const
|
|
697
|
-
|
|
688
|
+
o.className = "ng-part-header", o.appendChild(t(this, ct).call(this, t(this, et), r, "header"));
|
|
689
|
+
const a = document.createElement("div");
|
|
690
|
+
a.className = "ng-part-body";
|
|
691
|
+
const h = document.createElement("div");
|
|
692
|
+
h.className = "ng-scroll-content", h.style.position = "relative", h.style.width = "100%", h.appendChild(t(this, ct).call(this, t(this, et), r, "body"));
|
|
698
693
|
const l = document.createElement("div");
|
|
699
|
-
l.className = "ng-virtual-spacer", l.style.width = "100%", l.style.pointerEvents = "none",
|
|
694
|
+
l.className = "ng-virtual-spacer", l.style.width = "100%", l.style.pointerEvents = "none", h.appendChild(l), a.appendChild(h);
|
|
700
695
|
const f = document.createElement("div");
|
|
701
|
-
f.className = "ng-part-footer", f.appendChild(t(this, ct).call(this, t(this, et), r, "footer")), n.appendChild(
|
|
696
|
+
f.className = "ng-part-footer", f.appendChild(t(this, ct).call(this, t(this, et), r, "footer")), n.appendChild(o), n.appendChild(a), n.appendChild(f);
|
|
702
697
|
});
|
|
703
698
|
}, "#renderSplitContainers"));
|
|
704
|
-
|
|
699
|
+
d(this, Yt, /* @__PURE__ */ c(() => {
|
|
705
700
|
["left", "right", "body"].forEach((e) => {
|
|
706
701
|
const s = this.querySelector(`.ng-container-${e}`), r = s == null ? void 0 : s.querySelectorAll("table");
|
|
707
702
|
if (!s || !r || r.length === 0) return;
|
|
708
703
|
let n = 0;
|
|
709
|
-
r[0].querySelectorAll("col").forEach((
|
|
710
|
-
const
|
|
711
|
-
isNaN(n) || (n +=
|
|
704
|
+
r[0].querySelectorAll("col").forEach((o) => {
|
|
705
|
+
const a = parseInt(o.getAttribute("width"), 10);
|
|
706
|
+
isNaN(n) || (n += a);
|
|
712
707
|
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${n}px`, s.style.width = `${n}px`);
|
|
713
708
|
});
|
|
714
709
|
}, "#updateContainerWidths"));
|
|
715
|
-
|
|
710
|
+
A(this, "generate", /* @__PURE__ */ c((e) => {
|
|
716
711
|
e && (p(this, et, he.compile(e)), t(this, Vt).call(this), t(this, Yt).call(this), t(this, st).initialize(), setTimeout(() => {
|
|
717
712
|
var s;
|
|
718
713
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
719
714
|
}, 0));
|
|
720
715
|
}, "generate"));
|
|
721
|
-
|
|
722
|
-
const n = e.cloneNode(!0),
|
|
716
|
+
d(this, ct, /* @__PURE__ */ c((e, s, r) => {
|
|
717
|
+
const n = e.cloneNode(!0), o = n.querySelector("thead"), a = n.querySelector("tbody"), h = n.querySelector("tfoot");
|
|
723
718
|
if (r === "header") {
|
|
724
|
-
if (
|
|
719
|
+
if (a && a.remove(), h && h.remove(), e.querySelector("tbody")) {
|
|
725
720
|
const f = document.createElement("tbody");
|
|
726
721
|
f.className = "fixed-tbody", n.appendChild(f);
|
|
727
722
|
}
|
|
728
|
-
} else r === "body" ? (
|
|
723
|
+
} else r === "body" ? (o && o.remove(), h && h.remove(), a && (a.className = "bindable-tbody")) : r === "footer" && (o && o.remove(), a && a.remove());
|
|
729
724
|
return s === "left" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
730
725
|
l.getAttribute("fixed") !== "left" && l.remove();
|
|
731
726
|
}) : s === "right" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
@@ -734,19 +729,19 @@ const yt = class yt extends HTMLElement {
|
|
|
734
729
|
l.remove();
|
|
735
730
|
}), n;
|
|
736
731
|
}, "#createSplitTable"));
|
|
737
|
-
|
|
738
|
-
|
|
732
|
+
A(this, "getRowHeight", /* @__PURE__ */ c(() => t(this, st).getRowHeight(), "getRowHeight"));
|
|
733
|
+
A(this, "scrollToX", /* @__PURE__ */ c((e) => {
|
|
739
734
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
740
735
|
s && (s.scrollLeft = e);
|
|
741
736
|
}, "scrollToX"));
|
|
742
|
-
|
|
737
|
+
A(this, "scrollToY", /* @__PURE__ */ c((e) => {
|
|
743
738
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
744
739
|
s && (s.scrollTop = e);
|
|
745
740
|
}, "scrollToY"));
|
|
746
|
-
|
|
741
|
+
d(this, Ut, /* @__PURE__ */ c(() => {
|
|
747
742
|
t(this, Xt).call(this);
|
|
748
743
|
}, "#init"));
|
|
749
|
-
|
|
744
|
+
d(this, Xt, /* @__PURE__ */ c(() => {
|
|
750
745
|
const e = yt.SCROLLBAR_SIZE;
|
|
751
746
|
this.innerHTML = `
|
|
752
747
|
<style>
|
|
@@ -910,48 +905,48 @@ const yt = class yt extends HTMLElement {
|
|
|
910
905
|
this.innerHTML = "", N.log("NineTableSheet destroyed.");
|
|
911
906
|
}
|
|
912
907
|
};
|
|
913
|
-
Ft = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), ct = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(), c(yt, "NineTableSheet"),
|
|
908
|
+
Ft = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), ct = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(), c(yt, "NineTableSheet"), A(yt, "SCROLLBAR_SIZE", 16);
|
|
914
909
|
let $t = yt;
|
|
915
910
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", $t);
|
|
916
911
|
var Kt, qt;
|
|
917
912
|
const _e = class _e extends HTMLElement {
|
|
918
913
|
constructor() {
|
|
919
914
|
super();
|
|
920
|
-
|
|
915
|
+
d(this, Kt, /* @__PURE__ */ c(() => {
|
|
921
916
|
var e;
|
|
922
917
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
923
|
-
var
|
|
924
|
-
const r = s.ctrlKey || s.metaKey || s.shiftKey, n = parseInt((
|
|
918
|
+
var o;
|
|
919
|
+
const r = s.ctrlKey || s.metaKey || s.shiftKey, n = parseInt((o = s.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
|
|
925
920
|
t(this, qt).call(this, n, r);
|
|
926
921
|
}), t(this, qt).call(this, 0, !1);
|
|
927
922
|
}, "#init"));
|
|
928
|
-
|
|
923
|
+
d(this, qt, /* @__PURE__ */ c((e, s = !1) => {
|
|
929
924
|
const r = /* @__PURE__ */ c(() => {
|
|
930
925
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
931
|
-
Array.from(this.querySelectorAll("nine-splitter")).forEach((
|
|
932
|
-
const
|
|
933
|
-
|
|
934
|
-
const
|
|
935
|
-
v &&
|
|
926
|
+
Array.from(this.querySelectorAll("nine-splitter")).forEach((b) => b.style.setProperty("display", "none"));
|
|
927
|
+
const g = f.filter((b) => b.classList.contains("active"));
|
|
928
|
+
g.length < 2 || g.forEach((b) => {
|
|
929
|
+
const m = parseInt(b.getAttribute("data-index"), 10), v = this.querySelector(`nine-splitter[data-split-index="${m}"]`), E = f[m + 1];
|
|
930
|
+
v && E && E.classList.contains("active") && v.style.setProperty("display", "flex");
|
|
936
931
|
});
|
|
937
|
-
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"),
|
|
938
|
-
if (!
|
|
932
|
+
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = n.querySelectorAll(".nine-tab-item"), h = o.querySelectorAll("nine-table-sheet");
|
|
933
|
+
if (!a[e]) return;
|
|
939
934
|
if (!s)
|
|
940
|
-
|
|
935
|
+
a.forEach((f, u) => {
|
|
941
936
|
f.classList.toggle("active", u === e);
|
|
942
|
-
}),
|
|
943
|
-
const
|
|
944
|
-
f.classList.toggle("active",
|
|
937
|
+
}), h.forEach((f, u) => {
|
|
938
|
+
const g = u === e;
|
|
939
|
+
f.classList.toggle("active", g), f.style.flex = g ? "1 1 100%" : "";
|
|
945
940
|
});
|
|
946
941
|
else {
|
|
947
|
-
const f =
|
|
942
|
+
const f = a[e], u = n.querySelectorAll(".nine-tab-item.active");
|
|
948
943
|
if (f.classList.contains("active") && u.length <= 1)
|
|
949
944
|
return;
|
|
950
945
|
f.classList.toggle("active");
|
|
951
|
-
const
|
|
952
|
-
|
|
946
|
+
const g = o.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
947
|
+
g && (g.classList.toggle("active"), g.classList.contains("active") || (g.style.flex = ""));
|
|
953
948
|
}
|
|
954
|
-
const l =
|
|
949
|
+
const l = o.querySelectorAll("nine-table-sheet.active");
|
|
955
950
|
l == null || l.forEach((f) => {
|
|
956
951
|
f.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
957
952
|
}), r();
|
|
@@ -967,25 +962,25 @@ customElements.get("nine-table-sheets") || customElements.define("nine-table-she
|
|
|
967
962
|
var M, Zt, Tt, Gt;
|
|
968
963
|
const Ne = class Ne {
|
|
969
964
|
constructor(i) {
|
|
970
|
-
|
|
971
|
-
|
|
965
|
+
d(this, M);
|
|
966
|
+
d(this, Zt, /* @__PURE__ */ c(() => {
|
|
972
967
|
t(this, Gt).call(this), new ResizeObserver((i) => {
|
|
973
968
|
for (let e of i)
|
|
974
969
|
t(this, M).getAttribute("auto-height") === "true" && t(this, Tt).call(this);
|
|
975
970
|
}).observe(t(this, M));
|
|
976
971
|
}, "#init"));
|
|
977
|
-
|
|
978
|
-
var
|
|
972
|
+
d(this, Tt, /* @__PURE__ */ c(() => {
|
|
973
|
+
var h, l;
|
|
979
974
|
const i = Array.from(t(this, M).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
980
975
|
if (i.length === 0) return;
|
|
981
|
-
const e = parseInt(t(this, M).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), r = (
|
|
982
|
-
t(this, M).style.height = `${
|
|
976
|
+
const e = parseInt(t(this, M).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), r = (h = t(this, M).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : h.getBoundingClientRect().height, n = (l = t(this, M).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = $t.SCROLLBAR_SIZE, a = e * s + r + n + o;
|
|
977
|
+
t(this, M).style.height = `${a}px`;
|
|
983
978
|
}, "#applyAutoHeight"));
|
|
984
|
-
|
|
985
|
-
const e = Array.from(t(this, M).children).filter((
|
|
986
|
-
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`,
|
|
987
|
-
return u +
|
|
988
|
-
}).join(""),
|
|
979
|
+
d(this, Gt, /* @__PURE__ */ c(() => {
|
|
980
|
+
const e = Array.from(t(this, M).children).filter((h) => h.tagName === "TABLE"), s = t(this, M).getAttribute("auto-height") === "true", r = e.length, n = e.map((h, l) => {
|
|
981
|
+
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>` : "";
|
|
982
|
+
return u + g;
|
|
983
|
+
}).join(""), o = e.map((h, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
989
984
|
t(this, M).shadowRoot.innerHTML = `
|
|
990
985
|
<style>
|
|
991
986
|
:host {
|
|
@@ -1069,7 +1064,7 @@ const Ne = class Ne {
|
|
|
1069
1064
|
<nine-table-sheets>
|
|
1070
1065
|
<nine-table-sheets-body>${n}</nine-table-sheets-body>
|
|
1071
1066
|
<nine-table-sheets-footer>
|
|
1072
|
-
<div class="nine-tab-bar">${
|
|
1067
|
+
<div class="nine-tab-bar">${o}</div>
|
|
1073
1068
|
<div class="sheets-counter">Total : <span id="row-count">0</span></div>
|
|
1074
1069
|
</nine-table-sheets-footer>
|
|
1075
1070
|
</nine-table-sheets>
|
|
@@ -1077,10 +1072,10 @@ const Ne = class Ne {
|
|
|
1077
1072
|
</nine-table-body>
|
|
1078
1073
|
<nine-table-footer></nine-table-footer>
|
|
1079
1074
|
`;
|
|
1080
|
-
const
|
|
1081
|
-
|
|
1075
|
+
const a = t(this, M).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1076
|
+
a == null || a.forEach((h, l) => {
|
|
1082
1077
|
e[l] && setTimeout(() => {
|
|
1083
|
-
|
|
1078
|
+
h.generate(e[l]), s && t(this, Tt).call(this);
|
|
1084
1079
|
});
|
|
1085
1080
|
});
|
|
1086
1081
|
}, "#render"));
|
|
@@ -1092,9 +1087,9 @@ let fe = Ne;
|
|
|
1092
1087
|
var kt, ht;
|
|
1093
1088
|
const We = class We {
|
|
1094
1089
|
constructor(i) {
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1090
|
+
d(this, kt);
|
|
1091
|
+
d(this, ht, -1);
|
|
1092
|
+
A(this, "count", /* @__PURE__ */ c(() => t(this, kt).rawRecords.length, "count"));
|
|
1098
1093
|
p(this, kt, i);
|
|
1099
1094
|
}
|
|
1100
1095
|
get at() {
|
|
@@ -1108,15 +1103,15 @@ const We = class We {
|
|
|
1108
1103
|
kt = new WeakMap(), ht = new WeakMap(), c(We, "ngRow");
|
|
1109
1104
|
let ue = We;
|
|
1110
1105
|
var I, T, _, dt, Jt, Y, Qt, it, Ct, te, ee, ft;
|
|
1111
|
-
const
|
|
1106
|
+
const W = class W {
|
|
1112
1107
|
constructor(i, e) {
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1108
|
+
d(this, I);
|
|
1109
|
+
d(this, T);
|
|
1110
|
+
d(this, _, []);
|
|
1111
|
+
d(this, dt, []);
|
|
1112
|
+
d(this, Jt, 0);
|
|
1113
|
+
d(this, Y, []);
|
|
1114
|
+
d(this, Qt, /* @__PURE__ */ c(() => {
|
|
1120
1115
|
p(this, Y, []);
|
|
1121
1116
|
const i = t(this, I).template || [];
|
|
1122
1117
|
Array.from(i).forEach((e) => {
|
|
@@ -1126,12 +1121,12 @@ const O = class O {
|
|
|
1126
1121
|
e.__ng || (e.__ng = t(this, Ct).call(this)), e.__ng.height = t(this, Y).slice();
|
|
1127
1122
|
});
|
|
1128
1123
|
}, "#initialize"));
|
|
1129
|
-
|
|
1124
|
+
d(this, it, /* @__PURE__ */ c(() => {
|
|
1130
1125
|
t(this, I).shadowRoot.querySelectorAll("nine-table-sheet").forEach((i) => {
|
|
1131
1126
|
i.invalidate();
|
|
1132
1127
|
});
|
|
1133
1128
|
}, "#invalidate"));
|
|
1134
|
-
|
|
1129
|
+
A(this, "get", /* @__PURE__ */ c((i, e) => {
|
|
1135
1130
|
var n;
|
|
1136
1131
|
const s = this.getValidData();
|
|
1137
1132
|
if (!s || s.length <= 0) return;
|
|
@@ -1139,95 +1134,95 @@ const O = class O {
|
|
|
1139
1134
|
if (i < 0 || i >= s.length) return null;
|
|
1140
1135
|
const r = typeof ((n = t(this, I).fields) == null ? void 0 : n.get) == "function" ? t(this, I).fields.get() : [];
|
|
1141
1136
|
if (e != null) {
|
|
1142
|
-
const
|
|
1143
|
-
return
|
|
1137
|
+
const o = r.indexOf(e);
|
|
1138
|
+
return o >= 0 ? s[i].v[o] : null;
|
|
1144
1139
|
}
|
|
1145
1140
|
return t(this, ft).call(this, s[i]);
|
|
1146
1141
|
}, "get"));
|
|
1147
|
-
|
|
1142
|
+
A(this, "set", /* @__PURE__ */ c((i) => {
|
|
1148
1143
|
this.clear(), this.add(i, !1), t(this, it).call(this);
|
|
1149
1144
|
}, "set"));
|
|
1150
|
-
|
|
1151
|
-
rowState:
|
|
1145
|
+
d(this, Ct, /* @__PURE__ */ c(() => ({
|
|
1146
|
+
rowState: W.ROW_STATE.EMPTY,
|
|
1152
1147
|
deleted: !1,
|
|
1153
1148
|
filtered: !1,
|
|
1154
1149
|
height: t(this, Y).slice(),
|
|
1155
1150
|
o: {},
|
|
1156
1151
|
c: {},
|
|
1157
|
-
_: [0, 0, 0, 0,
|
|
1152
|
+
_: [0, 0, 0, 0, W.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Y).slice(), -1, {}, {}]
|
|
1158
1153
|
}), "#getDefaultMeta"));
|
|
1159
|
-
|
|
1154
|
+
A(this, "reset", /* @__PURE__ */ c(() => {
|
|
1160
1155
|
p(this, _, []), p(this, dt, []), t(this, it).call(this);
|
|
1161
1156
|
}, "reset"));
|
|
1162
|
-
|
|
1157
|
+
A(this, "clear", /* @__PURE__ */ c(() => {
|
|
1163
1158
|
var i;
|
|
1164
1159
|
t(this, T).rawRecords = [], p(this, _, []), p(this, dt, []), (i = t(this, T).viewRecords) != null && i.reset && t(this, T).viewRecords.reset();
|
|
1165
1160
|
}, "clear"));
|
|
1166
|
-
|
|
1161
|
+
d(this, te, /* @__PURE__ */ c((i) => {
|
|
1167
1162
|
var r;
|
|
1168
1163
|
Array.isArray(i) || (i = [i]);
|
|
1169
1164
|
const e = typeof ((r = t(this, I).fields) == null ? void 0 : r.get) == "function" ? t(this, I).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
1170
1165
|
return i.forEach((n) => {
|
|
1171
|
-
const
|
|
1172
|
-
e.forEach((
|
|
1173
|
-
|
|
1174
|
-
}), s.push(
|
|
1166
|
+
const o = { v: [] };
|
|
1167
|
+
e.forEach((a) => {
|
|
1168
|
+
o.v.push(n[a] !== void 0 && n[a] !== null ? n[a] : "");
|
|
1169
|
+
}), s.push(o);
|
|
1175
1170
|
}), s;
|
|
1176
1171
|
}, "#json2Array"));
|
|
1177
|
-
|
|
1178
|
-
e.__ng = t(this, Ct).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState =
|
|
1172
|
+
d(this, ee, /* @__PURE__ */ c((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1173
|
+
e.__ng = t(this, Ct).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = W.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1179
1174
|
}), i), "#defaultInsert"));
|
|
1180
|
-
|
|
1175
|
+
A(this, "add", /* @__PURE__ */ c((i, e = !0) => {
|
|
1181
1176
|
i === void 0 && (i = {});
|
|
1182
1177
|
const s = t(this, te).call(this, i);
|
|
1183
1178
|
t(this, T).rawRecords = t(this, T).rawRecords.concat(t(this, ee).call(this, s)), this.resetRecords();
|
|
1184
1179
|
const r = this.count() - 1;
|
|
1185
|
-
return e || s.forEach((n,
|
|
1186
|
-
const
|
|
1187
|
-
|
|
1180
|
+
return e || s.forEach((n, o) => {
|
|
1181
|
+
const a = t(this, T).rawRecords[r - o];
|
|
1182
|
+
a && (a.__ng.rowState = W.ROW_STATE.EMPTY);
|
|
1188
1183
|
}), t(this, it).call(this), r;
|
|
1189
1184
|
}, "add"));
|
|
1190
|
-
|
|
1185
|
+
A(this, "delete", /* @__PURE__ */ c((i) => {
|
|
1191
1186
|
let e = [];
|
|
1192
1187
|
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this, T).host.row.at] : e = [parseInt(i, 10)], e.sort((s, r) => r - s).forEach((s) => {
|
|
1193
1188
|
if (t(this, _)[s]) {
|
|
1194
1189
|
const r = t(this, _)[s].__ng.rowid;
|
|
1195
|
-
t(this, _)[s].__ng.rowState ===
|
|
1196
|
-
n.__ng.rowid === r && (n.__ng.deleted = !0, n.__ng.rowState =
|
|
1190
|
+
t(this, _)[s].__ng.rowState === W.ROW_STATE.INSERT ? t(this, T).rawRecords = t(this, T).rawRecords.filter((n) => n.__ng.rowid !== r) : t(this, T).rawRecords.forEach((n) => {
|
|
1191
|
+
n.__ng.rowid === r && (n.__ng.deleted = !0, n.__ng.rowState = W.ROW_STATE.DELETE);
|
|
1197
1192
|
});
|
|
1198
1193
|
}
|
|
1199
1194
|
}), this.resetRecords(), t(this, it).call(this);
|
|
1200
1195
|
}, "delete"));
|
|
1201
|
-
|
|
1202
|
-
var
|
|
1196
|
+
A(this, "setValue", /* @__PURE__ */ c((i, e, s) => {
|
|
1197
|
+
var h;
|
|
1203
1198
|
i = parseInt(i, 10);
|
|
1204
|
-
const n = (typeof ((
|
|
1199
|
+
const n = (typeof ((h = t(this, I).fields) == null ? void 0 : h.get) == "function" ? t(this, I).fields.get() : []).indexOf(e);
|
|
1205
1200
|
if (n < 0) return;
|
|
1206
|
-
const
|
|
1207
|
-
if (!
|
|
1208
|
-
const
|
|
1209
|
-
|
|
1201
|
+
const o = this.getValidData()[i];
|
|
1202
|
+
if (!o) return;
|
|
1203
|
+
const a = o.v[n];
|
|
1204
|
+
a !== s && o.__ng.rowState !== W.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = a), o.__ng.rowState = W.ROW_STATE.UPDATE), o.v[n] = s;
|
|
1210
1205
|
}, "setValue"));
|
|
1211
|
-
|
|
1206
|
+
A(this, "resetRecords", /* @__PURE__ */ c(() => {
|
|
1212
1207
|
p(this, dt, t(this, T).rawRecords.filter((i) => !i.__ng.deleted)), p(this, _, t(this, T).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, T).rawRecords.forEach((i, e) => {
|
|
1213
1208
|
i.__ng.rowidx = e;
|
|
1214
1209
|
}), t(this, _).forEach((i, e) => {
|
|
1215
1210
|
i.__ng.i = e;
|
|
1216
1211
|
});
|
|
1217
1212
|
}, "resetRecords"));
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
var
|
|
1213
|
+
A(this, "getValidData", /* @__PURE__ */ c(() => (t(this, _).length === 0 && t(this, T).rawRecords.length > 0 && this.resetRecords(), t(this, _)), "getValidData"));
|
|
1214
|
+
d(this, ft, /* @__PURE__ */ c((i) => {
|
|
1215
|
+
var o;
|
|
1221
1216
|
if (!i) return i;
|
|
1222
|
-
const e = !Array.isArray(i), s = e ? [i] : i, r = typeof ((
|
|
1223
|
-
const
|
|
1217
|
+
const e = !Array.isArray(i), s = e ? [i] : i, r = typeof ((o = t(this, I).fields) == null ? void 0 : o.get) == "function" ? t(this, I).fields.get() : [], n = s.filter((a) => !a.__ng.deleted).map((a) => {
|
|
1218
|
+
const h = {};
|
|
1224
1219
|
return r.forEach((l, f) => {
|
|
1225
|
-
|
|
1226
|
-
}),
|
|
1220
|
+
h[l] = a.v ? a.v[f] : a[l];
|
|
1221
|
+
}), h.__ng = a.__ng, h;
|
|
1227
1222
|
});
|
|
1228
1223
|
return e ? n[0] : n;
|
|
1229
1224
|
}, "#conv"));
|
|
1230
|
-
|
|
1225
|
+
A(this, "count", /* @__PURE__ */ c(() => this.getValidData().length, "count"));
|
|
1231
1226
|
p(this, I, i), p(this, T, e), t(this, Qt).call(this);
|
|
1232
1227
|
}
|
|
1233
1228
|
get source() {
|
|
@@ -1249,19 +1244,19 @@ const O = class O {
|
|
|
1249
1244
|
return this.length;
|
|
1250
1245
|
}
|
|
1251
1246
|
};
|
|
1252
|
-
I = new WeakMap(), T = new WeakMap(), _ = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), Y = new WeakMap(), Qt = new WeakMap(), it = new WeakMap(), Ct = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), ft = new WeakMap(), c(
|
|
1253
|
-
|
|
1247
|
+
I = new WeakMap(), T = new WeakMap(), _ = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), Y = new WeakMap(), Qt = new WeakMap(), it = new WeakMap(), Ct = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), ft = new WeakMap(), c(W, "ngData"), // 🎯 행 상태 정의 상수를 클래스 내부로 내재화
|
|
1248
|
+
A(W, "ROW_STATE", {
|
|
1254
1249
|
EMPTY: "EMPTY",
|
|
1255
1250
|
NORMAL: "NORMAL",
|
|
1256
1251
|
INSERT: "INSERT",
|
|
1257
1252
|
UPDATE: "UPDATE",
|
|
1258
1253
|
DELETE: "DELETE"
|
|
1259
1254
|
});
|
|
1260
|
-
let ge =
|
|
1255
|
+
let ge = W;
|
|
1261
1256
|
var rt;
|
|
1262
1257
|
const Oe = class Oe {
|
|
1263
1258
|
constructor(i) {
|
|
1264
|
-
|
|
1259
|
+
d(this, rt);
|
|
1265
1260
|
p(this, rt, i), this.row = new ue(this), this.data = new ge(t(this, rt), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1266
1261
|
var e;
|
|
1267
1262
|
(e = t(this, rt).view) != null && e.redraw && t(this, rt).view.redraw();
|
|
@@ -1285,44 +1280,44 @@ var ut, L, Lt, se;
|
|
|
1285
1280
|
const Be = class Be {
|
|
1286
1281
|
// 🎯 이제 { name: string, type: string } 객체들의 배열로 관리합니다.
|
|
1287
1282
|
constructor(i) {
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1283
|
+
d(this, ut);
|
|
1284
|
+
d(this, L, []);
|
|
1285
|
+
A(this, "add", /* @__PURE__ */ c((i, e = "string") => {
|
|
1291
1286
|
i.forEach((s) => {
|
|
1292
1287
|
t(this, L).some((r) => r.name === s) || t(this, L).push({ name: s, type: e });
|
|
1293
1288
|
}), t(this, Lt).call(this);
|
|
1294
1289
|
}, "add"));
|
|
1295
|
-
|
|
1290
|
+
d(this, Lt, /* @__PURE__ */ c(() => {
|
|
1296
1291
|
const i = /* @__PURE__ */ new Map();
|
|
1297
1292
|
t(this, L).forEach((e) => {
|
|
1298
1293
|
i.set(e.name, e.type);
|
|
1299
1294
|
}), p(this, L, Array.from(i, ([e, s]) => ({ name: e, type: s }))), p(this, L, t(this, L).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, L).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
1300
1295
|
}, "#adjust"));
|
|
1301
|
-
|
|
1296
|
+
d(this, se, /* @__PURE__ */ c(() => {
|
|
1302
1297
|
p(this, L, []), N.log(t(this, ut).querySelectorAll("table"));
|
|
1303
1298
|
const i = Array.from(t(this, ut).querySelectorAll("table"));
|
|
1304
1299
|
if (!(!i || i.length === 0)) {
|
|
1305
1300
|
for (const e of i)
|
|
1306
1301
|
N.log(e), $("[data-bind]", e).each((s, r) => {
|
|
1307
|
-
const n = r.dataset.bind,
|
|
1308
|
-
n && t(this, L).push({ name: n, type:
|
|
1302
|
+
const n = r.dataset.bind, o = r.getAttribute("data-type") || "string";
|
|
1303
|
+
n && t(this, L).push({ name: n, type: o });
|
|
1309
1304
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
1310
1305
|
$(`[${s}]`, e).each((r, n) => {
|
|
1311
|
-
var
|
|
1312
|
-
if (
|
|
1313
|
-
const
|
|
1314
|
-
if (
|
|
1306
|
+
var o = n.getAttribute(s);
|
|
1307
|
+
if (o.indexOf("data.") < 0) {
|
|
1308
|
+
const a = o.search(/[(]/g);
|
|
1309
|
+
if (a > 0)
|
|
1315
1310
|
try {
|
|
1316
|
-
|
|
1311
|
+
o = String(window[o.substring(0, a).trim()]);
|
|
1317
1312
|
} catch {
|
|
1318
|
-
|
|
1313
|
+
o = "";
|
|
1319
1314
|
}
|
|
1320
1315
|
}
|
|
1321
|
-
|
|
1322
|
-
if (
|
|
1323
|
-
const
|
|
1316
|
+
o.split("data.").forEach((a) => {
|
|
1317
|
+
if (a.trim() != "") {
|
|
1318
|
+
const h = a.search(/[^_A-Za-z0-9]/g);
|
|
1324
1319
|
let l = "";
|
|
1325
|
-
|
|
1320
|
+
h >= 0 ? l = a.substring(0, h) : o.startsWith("data.") && (l = a.replace("data.", "")), l && t(this, L).push({ name: l, type: "string" });
|
|
1326
1321
|
}
|
|
1327
1322
|
});
|
|
1328
1323
|
});
|
|
@@ -1359,9 +1354,9 @@ const ze = class ze extends HTMLElement {
|
|
|
1359
1354
|
constructor() {
|
|
1360
1355
|
super();
|
|
1361
1356
|
//#created = false;
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1357
|
+
d(this, nt);
|
|
1358
|
+
d(this, ie);
|
|
1359
|
+
d(this, re, /* @__PURE__ */ c(() => {
|
|
1365
1360
|
this.fields = new pe(this), p(this, ie, new fe(this)), N.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1366
1361
|
}, "#init"));
|
|
1367
1362
|
this.attachShadow({ mode: "open" }), p(this, nt, new be(this));
|
|
@@ -1399,20 +1394,20 @@ const mt = class mt extends HTMLElement {
|
|
|
1399
1394
|
connectedCallback() {
|
|
1400
1395
|
}
|
|
1401
1396
|
};
|
|
1402
|
-
c(mt, "BasicCellElement"),
|
|
1397
|
+
c(mt, "BasicCellElement"), A(mt, "_styleCache", /* @__PURE__ */ new Map()), A(mt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1403
1398
|
let me = mt;
|
|
1404
1399
|
var k, Ht, y, Re, qe, Te, ke, Ce;
|
|
1405
1400
|
const Pe = class Pe extends me {
|
|
1406
1401
|
constructor() {
|
|
1407
1402
|
super();
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1403
|
+
d(this, k);
|
|
1404
|
+
d(this, Ht);
|
|
1405
|
+
d(this, y);
|
|
1406
|
+
d(this, Re);
|
|
1407
|
+
d(this, qe);
|
|
1408
|
+
d(this, Te);
|
|
1409
|
+
d(this, ke);
|
|
1410
|
+
A(this, "getDisplayText", /* @__PURE__ */ c((e) => {
|
|
1416
1411
|
if (t(this, y))
|
|
1417
1412
|
if (t(this, y).closest("tbody")) {
|
|
1418
1413
|
const s = t(this, y).closest("tr").data, r = parseInt(t(this, y).dataset.row);
|
|
@@ -1432,23 +1427,23 @@ const Pe = class Pe extends me {
|
|
|
1432
1427
|
} catch {
|
|
1433
1428
|
}
|
|
1434
1429
|
}, "getDisplayText"));
|
|
1435
|
-
|
|
1430
|
+
d(this, Ce, /* @__PURE__ */ c(() => {
|
|
1436
1431
|
if (!(!t(this, k) || !t(this, k).template || !t(this, y).closest("tbody.bindable"))) {
|
|
1437
1432
|
var e = ninegrid.j.querySelectorAll(t(this, y)).attr("suppress");
|
|
1438
1433
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1439
1434
|
var s = t(this, y).closest("tr"), r = [];
|
|
1440
|
-
$("th,td", s).each((
|
|
1441
|
-
var C = ninegrid.j.querySelectorAll(
|
|
1442
|
-
C &&
|
|
1435
|
+
$("th,td", s).each((x, O) => {
|
|
1436
|
+
var C = ninegrid.j.querySelectorAll(O).attr("suppress");
|
|
1437
|
+
C && O.dataset.row && (C = parseInt(C), !isNaN(C) && C <= e && r.push(C));
|
|
1443
1438
|
}), r.sort();
|
|
1444
1439
|
var n = !1;
|
|
1445
1440
|
if (parseInt(s.sectionRowIndex / t(this, k).template.length) > 0)
|
|
1446
|
-
for (var
|
|
1447
|
-
if (
|
|
1448
|
-
var
|
|
1441
|
+
for (var o of r) {
|
|
1442
|
+
if (o > e) break;
|
|
1443
|
+
var a = parseInt(t(this, y).dataset.row), h = a - 1, l = t(this, y).closest("tr").data, f = t(this, k).data.get(h);
|
|
1449
1444
|
t(this, y).dataset.matrixRow;
|
|
1450
|
-
var u = t(this, k).body.querySelector(`tbody.bindable [suppress="${
|
|
1451
|
-
if (
|
|
1445
|
+
var u = t(this, k).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, y).dataset.matrixRow}"]`), g = u.dataset.expr ? this.getExprValue(u.dataset.expr, l, a) : l[u.dataset.bind], b = u.dataset.expr ? this.getExprValue(u.dataset.expr, f, h) : f[u.dataset.bind];
|
|
1446
|
+
if (g != b) {
|
|
1452
1447
|
n = !0;
|
|
1453
1448
|
break;
|
|
1454
1449
|
}
|
|
@@ -1456,17 +1451,17 @@ const Pe = class Pe extends me {
|
|
|
1456
1451
|
else
|
|
1457
1452
|
n = !0;
|
|
1458
1453
|
n ? ninegrid.j.querySelectorAll(t(this, y)).removeClass("suppress") : ninegrid.j.querySelectorAll(t(this, y)).addClass("suppress"), ninegrid.j.querySelectorAll(t(this, y)).hasClass("hidden") || (n ? ninegrid.j.querySelectorAll(t(this, y)).removeClass("hidden") : ninegrid.j.querySelectorAll(t(this, y)).addClass("hidden"));
|
|
1459
|
-
var
|
|
1460
|
-
$(
|
|
1454
|
+
var m = parseInt(t(this, y).dataset.matrixRow), v = m - 1, E = t(this, k).body.querySelector(`tbody.bindable [data-col="${t(this, y).dataset.col}"][data-matrix-row="${v}"]`);
|
|
1455
|
+
$(E).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this, y)).hasClass("suppress") ? ninegrid.j.querySelectorAll(E).removeClass("last-none-suppress").addClass("last-suppress") : !$(E).hasClass("suppress") && ninegrid.j.querySelectorAll(t(this, y)).hasClass("suppress") ? ninegrid.j.querySelectorAll(E).removeClass("last-suppress").addClass("last-none-suppress") : ninegrid.j.querySelectorAll(E).removeClass("last-none-suppress").removeClass("last-suppress");
|
|
1461
1456
|
}
|
|
1462
1457
|
}
|
|
1463
1458
|
}, "#resetSuppress"));
|
|
1464
|
-
|
|
1459
|
+
A(this, "getExprValue", /* @__PURE__ */ c((e, s, r, n) => {
|
|
1465
1460
|
if (typeof e < "u")
|
|
1466
1461
|
try {
|
|
1467
1462
|
r = parseInt(r);
|
|
1468
|
-
const
|
|
1469
|
-
return t(this, k)[
|
|
1463
|
+
const o = e.replace("()", "");
|
|
1464
|
+
return t(this, k)[o] ? t(this, k)[o].call(this, s, r, t(this, y)) : t(this, k).exprFunction(e).call(this, s, r, t(this, k).data);
|
|
1470
1465
|
} catch {
|
|
1471
1466
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1472
1467
|
}
|
|
@@ -1516,13 +1511,13 @@ var Mt, ot, gt, bt, ne, U, Le;
|
|
|
1516
1511
|
const je = class je extends ve {
|
|
1517
1512
|
constructor() {
|
|
1518
1513
|
super();
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1514
|
+
d(this, Mt);
|
|
1515
|
+
d(this, ot);
|
|
1516
|
+
d(this, gt);
|
|
1517
|
+
d(this, bt);
|
|
1518
|
+
d(this, ne);
|
|
1519
|
+
d(this, U);
|
|
1520
|
+
A(this, "refresh", /* @__PURE__ */ c(() => {
|
|
1526
1521
|
const e = super.refresh();
|
|
1527
1522
|
t(this, Mt).value = e;
|
|
1528
1523
|
}, "refresh"));
|
|
@@ -1556,7 +1551,7 @@ const je = class je extends ve {
|
|
|
1556
1551
|
if (!v) this.reset();
|
|
1557
1552
|
};
|
|
1558
1553
|
*/
|
|
1559
|
-
|
|
1554
|
+
d(this, Le, /* @__PURE__ */ c((e) => {
|
|
1560
1555
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1561
1556
|
if (t(this, ot) == "number") {
|
|
1562
1557
|
let n = [];
|