@ninebone/table 0.0.552 → 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 -382
- 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,58 +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
|
-
|
|
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);
|
|
395
395
|
}));
|
|
396
396
|
}, "initialize"));
|
|
397
|
-
|
|
397
|
+
d(this, Ot, /* @__PURE__ */ c((i, e) => {
|
|
398
398
|
N.log("rowManager.#renderRows");
|
|
399
399
|
const s = t(this, P).get(e);
|
|
400
400
|
if (!s || s.length === 0) return;
|
|
401
401
|
const r = i.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
402
402
|
if (!r) return;
|
|
403
|
-
r.querySelectorAll("tr:not(.nodata)").forEach((
|
|
404
|
-
const n = r.querySelector("tr.nodata"),
|
|
405
|
-
for (let
|
|
406
|
-
s.forEach((
|
|
407
|
-
|
|
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));
|
|
408
408
|
});
|
|
409
|
-
n ? n.before(
|
|
409
|
+
n ? n.before(o) : r.appendChild(o), e === ".ng-container-body" && (t(this, Q).firstTr = r.querySelector("tr:not(.nodata)"));
|
|
410
410
|
}, "#renderRows"));
|
|
411
|
-
|
|
411
|
+
d(this, Bt, /* @__PURE__ */ c((i) => {
|
|
412
412
|
if (N.log("rowManager.#measureAndCacheHeight"), t(this, H) !== null && t(this, H) > 0)
|
|
413
413
|
return t(this, H);
|
|
414
414
|
N.log("#measureAndCacheHeight");
|
|
@@ -416,63 +416,63 @@ const Ie = class Ie {
|
|
|
416
416
|
if (!e || e.length === 0) return 24;
|
|
417
417
|
const s = i.querySelector("tbody.bindable-tbody");
|
|
418
418
|
if (!s) return 24;
|
|
419
|
-
s.querySelectorAll("tr:not(.nodata)").forEach((
|
|
419
|
+
s.querySelectorAll("tr:not(.nodata)").forEach((g) => g.remove());
|
|
420
420
|
const r = s.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
421
|
-
e.forEach((
|
|
422
|
-
n.appendChild(
|
|
421
|
+
e.forEach((g) => {
|
|
422
|
+
n.appendChild(g.cloneNode(!0));
|
|
423
423
|
}), r ? r.before(n) : s.appendChild(n);
|
|
424
|
-
const
|
|
425
|
-
(
|
|
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");
|
|
426
426
|
let f = 0;
|
|
427
427
|
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
428
|
-
return u.forEach((
|
|
429
|
-
f +=
|
|
430
|
-
}), 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);
|
|
431
431
|
}, "#measureAndCacheHeight"));
|
|
432
|
-
|
|
432
|
+
d(this, St, /* @__PURE__ */ c(() => {
|
|
433
433
|
N.log("rowManager.#updateVirtualScrollHeight");
|
|
434
434
|
const e = (t(this, D).data.get() || []).length, s = t(this, H), r = e * s;
|
|
435
435
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
436
|
-
const
|
|
437
|
-
if (!
|
|
438
|
-
const
|
|
439
|
-
|
|
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`);
|
|
440
440
|
});
|
|
441
441
|
}, "#updateVirtualScrollHeight"));
|
|
442
|
-
|
|
442
|
+
d(this, Et, /* @__PURE__ */ c(() => {
|
|
443
443
|
if (t(this, tt) > 0 && t(this, H) > 0) {
|
|
444
444
|
const i = Math.ceil(t(this, tt) / t(this, H));
|
|
445
445
|
p(this, wt, i + t(this, Wt));
|
|
446
446
|
}
|
|
447
447
|
}, "#updateRowCount"));
|
|
448
|
-
|
|
449
|
-
var
|
|
448
|
+
d(this, zt, /* @__PURE__ */ c(() => {
|
|
449
|
+
var a, h, l, f, u, g;
|
|
450
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");
|
|
451
451
|
if (e) {
|
|
452
|
-
const
|
|
453
|
-
for (let
|
|
454
|
-
const
|
|
455
|
-
((
|
|
456
|
-
((
|
|
457
|
-
((l = v[
|
|
458
|
-
], C = Math.max(...
|
|
459
|
-
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`));
|
|
460
460
|
}
|
|
461
461
|
}
|
|
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"),
|
|
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");
|
|
463
463
|
if (n) {
|
|
464
|
-
const
|
|
465
|
-
for (let
|
|
466
|
-
const
|
|
467
|
-
((f =
|
|
468
|
-
((u = x
|
|
469
|
-
((
|
|
470
|
-
], C = Math.max(...
|
|
471
|
-
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`));
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
474
|
}, "#syncRowHeights"));
|
|
475
|
-
|
|
475
|
+
d(this, Pt, /* @__PURE__ */ c(() => {
|
|
476
476
|
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (p(this, V, new ResizeObserver((i) => {
|
|
477
477
|
for (const e of i) {
|
|
478
478
|
const s = e.target;
|
|
@@ -480,61 +480,58 @@ const Ie = class Ie {
|
|
|
480
480
|
const r = e.contentRect.height;
|
|
481
481
|
if (r > 0) {
|
|
482
482
|
let n = 0;
|
|
483
|
-
const
|
|
484
|
-
|
|
485
|
-
const
|
|
486
|
-
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()));
|
|
487
487
|
}
|
|
488
488
|
}
|
|
489
489
|
})), t(this, V).observe(t(this, S)));
|
|
490
490
|
}, "#initResizeObserver"));
|
|
491
|
-
|
|
491
|
+
d(this, At, /* @__PURE__ */ c(() => {
|
|
492
492
|
N.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
493
493
|
const e = t(this, S).querySelector(i);
|
|
494
494
|
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Ot).call(this, e, i);
|
|
495
495
|
}), t(this, Dt).call(this), t(this, zt).call(this);
|
|
496
496
|
}, "#renderAllContainers"));
|
|
497
|
-
|
|
497
|
+
d(this, Ae, /* @__PURE__ */ c((i) => {
|
|
498
498
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
499
499
|
var l;
|
|
500
500
|
const s = t(this, S).querySelector(e);
|
|
501
501
|
if (!s) return;
|
|
502
502
|
const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
503
503
|
if (!r) return;
|
|
504
|
-
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;
|
|
505
505
|
n.forEach((f, u) => {
|
|
506
|
-
const
|
|
507
|
-
if (
|
|
506
|
+
const g = i + Math.floor(u / o);
|
|
507
|
+
if (g >= h) {
|
|
508
508
|
f.style.display = "none";
|
|
509
509
|
return;
|
|
510
510
|
}
|
|
511
|
-
const
|
|
512
|
-
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);
|
|
513
513
|
});
|
|
514
514
|
});
|
|
515
515
|
}, "#adjustBufferRows"));
|
|
516
|
-
|
|
517
|
-
var
|
|
516
|
+
d(this, lt, /* @__PURE__ */ c((i) => {
|
|
517
|
+
var h, l;
|
|
518
518
|
const e = t(this, H);
|
|
519
519
|
if (!e || e <= 0) return;
|
|
520
|
-
const s = t(this, D).data.length, r = Math.max(0, Math.floor(i / e)), n =
|
|
521
|
-
(
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
const b = t(this, S).querySelector(u);
|
|
527
|
-
if (!b) return;
|
|
528
|
-
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");
|
|
529
526
|
if (!g) return;
|
|
530
|
-
Array.from(g.querySelectorAll("tr:not(.nodata)")).forEach((
|
|
531
|
-
const
|
|
532
|
-
if (
|
|
533
|
-
|
|
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";
|
|
534
531
|
return;
|
|
535
532
|
}
|
|
536
|
-
const
|
|
537
|
-
|
|
533
|
+
const x = t(this, D).data.get(E);
|
|
534
|
+
m.style.display = "", t(this, Rt).call(this, m, x, E);
|
|
538
535
|
});
|
|
539
536
|
});
|
|
540
537
|
}, "#handleScroll"));
|
|
@@ -552,29 +549,29 @@ const Ie = class Ie {
|
|
|
552
549
|
cell.dataset.row = dataIndex;
|
|
553
550
|
});
|
|
554
551
|
}; */
|
|
555
|
-
|
|
552
|
+
d(this, Rt, /* @__PURE__ */ c((i, e, s) => {
|
|
556
553
|
i.dataset.row = s, i.data = e, Array.from(i.cells).forEach((r, n) => {
|
|
557
554
|
r.dataset.row = s;
|
|
558
|
-
const
|
|
559
|
-
|
|
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();
|
|
560
557
|
});
|
|
561
558
|
}, "#bindRowData"));
|
|
562
|
-
|
|
563
|
-
var
|
|
559
|
+
d(this, Dt, /* @__PURE__ */ c(() => {
|
|
560
|
+
var h, l, f;
|
|
564
561
|
N.log("rowManager.#syncHeaderHeights");
|
|
565
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");
|
|
566
563
|
if (!e) return;
|
|
567
|
-
const r = i ? Array.from(i.querySelectorAll("tr")) : [], n = Array.from(e.querySelectorAll("tr")),
|
|
568
|
-
for (let u = 0; u <
|
|
569
|
-
const
|
|
570
|
-
((
|
|
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,
|
|
571
568
|
((l = n[u]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
572
|
-
((f =
|
|
573
|
-
],
|
|
574
|
-
|
|
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`));
|
|
575
572
|
}
|
|
576
573
|
}, "#syncHeaderHeights"));
|
|
577
|
-
|
|
574
|
+
A(this, "destroy", /* @__PURE__ */ c(() => {
|
|
578
575
|
t(this, V) && (t(this, V).disconnect(), p(this, V, null));
|
|
579
576
|
}, "destroy"));
|
|
580
577
|
p(this, D, i.getRootNode().host), p(this, S, i), t(this, Pt).call(this);
|
|
@@ -601,65 +598,65 @@ const jt = class jt {
|
|
|
601
598
|
*/
|
|
602
599
|
static compile(i) {
|
|
603
600
|
if (!i) return null;
|
|
604
|
-
const e = /* @__PURE__ */ c((
|
|
605
|
-
|
|
601
|
+
const e = /* @__PURE__ */ c((a) => {
|
|
602
|
+
a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
|
|
606
603
|
const f = l.getAttribute("cell-type") || "renderer";
|
|
607
604
|
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
608
605
|
let u = `cell-${f}`;
|
|
609
|
-
const
|
|
610
|
-
let
|
|
611
|
-
|
|
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}>`;
|
|
612
609
|
});
|
|
613
|
-
}, "processCellTypes"), s = /* @__PURE__ */ c((
|
|
614
|
-
if (!
|
|
615
|
-
const
|
|
616
|
-
for (let
|
|
617
|
-
const
|
|
618
|
-
|
|
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);
|
|
619
616
|
}
|
|
620
|
-
|
|
617
|
+
a.prepend(f);
|
|
621
618
|
}
|
|
622
|
-
if (!
|
|
623
|
-
const
|
|
624
|
-
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);
|
|
625
622
|
}
|
|
626
|
-
|
|
627
|
-
}, "ensureTableStructure"), r = /* @__PURE__ */ c((
|
|
628
|
-
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;
|
|
629
626
|
if (u === 0 || f.length === 0) return;
|
|
630
|
-
let
|
|
631
|
-
f.forEach((
|
|
632
|
-
|
|
627
|
+
let g = 0;
|
|
628
|
+
f.forEach((m) => {
|
|
629
|
+
g += m.colSpan || 1;
|
|
633
630
|
});
|
|
634
|
-
const
|
|
635
|
-
l.forEach((
|
|
636
|
-
const v =
|
|
637
|
-
let
|
|
638
|
-
Array.from(
|
|
639
|
-
for (let B = 0; B <
|
|
640
|
-
if (
|
|
641
|
-
|
|
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;
|
|
642
639
|
break;
|
|
643
640
|
}
|
|
644
|
-
const
|
|
645
|
-
for (let B = 0; B <
|
|
641
|
+
const O = x.rowSpan || 1, C = x.colSpan || 1;
|
|
642
|
+
for (let B = 0; B < O; B++)
|
|
646
643
|
for (let pt = 0; pt < C; pt++)
|
|
647
|
-
v + B < u &&
|
|
644
|
+
v + B < u && E + pt < g && (b[v + B][E + pt] = B === 0 && pt === 0 ? "1" : "0");
|
|
648
645
|
});
|
|
649
|
-
}), l.forEach((
|
|
650
|
-
const v =
|
|
651
|
-
Array.from(
|
|
652
|
-
for (let
|
|
653
|
-
if (
|
|
654
|
-
|
|
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";
|
|
655
652
|
break;
|
|
656
653
|
}
|
|
657
654
|
});
|
|
658
655
|
});
|
|
659
656
|
}, "resetColIndex"), n = i.cloneNode(!0);
|
|
660
|
-
return s(n), e(n), r(n, "thead"), r(n, "tbody"), r(n, "tfoot"), Array.from(n.querySelectorAll("colgroup col")).forEach((
|
|
661
|
-
const l =
|
|
662
|
-
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) => {
|
|
663
660
|
f.setAttribute("fixed", l);
|
|
664
661
|
});
|
|
665
662
|
}), n;
|
|
@@ -672,13 +669,13 @@ var Ft, et, st, Vt, Yt, ct, Ut, Xt;
|
|
|
672
669
|
const yt = class yt extends HTMLElement {
|
|
673
670
|
constructor() {
|
|
674
671
|
super();
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
672
|
+
d(this, Ft);
|
|
673
|
+
d(this, et, null);
|
|
674
|
+
d(this, st);
|
|
675
|
+
A(this, "invalidate", /* @__PURE__ */ c(() => {
|
|
679
676
|
t(this, st).refresh();
|
|
680
677
|
}, "invalidate"));
|
|
681
|
-
|
|
678
|
+
d(this, Vt, /* @__PURE__ */ c(() => {
|
|
682
679
|
[
|
|
683
680
|
{ selector: ".ng-container-body", type: null },
|
|
684
681
|
{ selector: ".ng-container-left", type: "left" },
|
|
@@ -687,43 +684,43 @@ const yt = class yt extends HTMLElement {
|
|
|
687
684
|
const n = this.querySelector(s);
|
|
688
685
|
if (!n) return;
|
|
689
686
|
n.innerHTML = "";
|
|
690
|
-
const a = document.createElement("div");
|
|
691
|
-
a.className = "ng-part-header", a.appendChild(t(this, ct).call(this, t(this, et), r, "header"));
|
|
692
687
|
const o = document.createElement("div");
|
|
693
|
-
o.className = "ng-part-
|
|
694
|
-
const
|
|
695
|
-
|
|
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"));
|
|
696
693
|
const l = document.createElement("div");
|
|
697
|
-
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);
|
|
698
695
|
const f = document.createElement("div");
|
|
699
|
-
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);
|
|
700
697
|
});
|
|
701
698
|
}, "#renderSplitContainers"));
|
|
702
|
-
|
|
699
|
+
d(this, Yt, /* @__PURE__ */ c(() => {
|
|
703
700
|
["left", "right", "body"].forEach((e) => {
|
|
704
701
|
const s = this.querySelector(`.ng-container-${e}`), r = s == null ? void 0 : s.querySelectorAll("table");
|
|
705
702
|
if (!s || !r || r.length === 0) return;
|
|
706
703
|
let n = 0;
|
|
707
|
-
r[0].querySelectorAll("col").forEach((
|
|
708
|
-
const
|
|
709
|
-
isNaN(n) || (n +=
|
|
704
|
+
r[0].querySelectorAll("col").forEach((o) => {
|
|
705
|
+
const a = parseInt(o.getAttribute("width"), 10);
|
|
706
|
+
isNaN(n) || (n += a);
|
|
710
707
|
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${n}px`, s.style.width = `${n}px`);
|
|
711
708
|
});
|
|
712
709
|
}, "#updateContainerWidths"));
|
|
713
|
-
|
|
710
|
+
A(this, "generate", /* @__PURE__ */ c((e) => {
|
|
714
711
|
e && (p(this, et, he.compile(e)), t(this, Vt).call(this), t(this, Yt).call(this), t(this, st).initialize(), setTimeout(() => {
|
|
715
712
|
var s;
|
|
716
713
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
717
714
|
}, 0));
|
|
718
715
|
}, "generate"));
|
|
719
|
-
|
|
720
|
-
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");
|
|
721
718
|
if (r === "header") {
|
|
722
|
-
if (
|
|
719
|
+
if (a && a.remove(), h && h.remove(), e.querySelector("tbody")) {
|
|
723
720
|
const f = document.createElement("tbody");
|
|
724
721
|
f.className = "fixed-tbody", n.appendChild(f);
|
|
725
722
|
}
|
|
726
|
-
} 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());
|
|
727
724
|
return s === "left" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
728
725
|
l.getAttribute("fixed") !== "left" && l.remove();
|
|
729
726
|
}) : s === "right" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
@@ -732,19 +729,19 @@ const yt = class yt extends HTMLElement {
|
|
|
732
729
|
l.remove();
|
|
733
730
|
}), n;
|
|
734
731
|
}, "#createSplitTable"));
|
|
735
|
-
|
|
736
|
-
|
|
732
|
+
A(this, "getRowHeight", /* @__PURE__ */ c(() => t(this, st).getRowHeight(), "getRowHeight"));
|
|
733
|
+
A(this, "scrollToX", /* @__PURE__ */ c((e) => {
|
|
737
734
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
738
735
|
s && (s.scrollLeft = e);
|
|
739
736
|
}, "scrollToX"));
|
|
740
|
-
|
|
737
|
+
A(this, "scrollToY", /* @__PURE__ */ c((e) => {
|
|
741
738
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
742
739
|
s && (s.scrollTop = e);
|
|
743
740
|
}, "scrollToY"));
|
|
744
|
-
|
|
741
|
+
d(this, Ut, /* @__PURE__ */ c(() => {
|
|
745
742
|
t(this, Xt).call(this);
|
|
746
743
|
}, "#init"));
|
|
747
|
-
|
|
744
|
+
d(this, Xt, /* @__PURE__ */ c(() => {
|
|
748
745
|
const e = yt.SCROLLBAR_SIZE;
|
|
749
746
|
this.innerHTML = `
|
|
750
747
|
<style>
|
|
@@ -908,48 +905,48 @@ const yt = class yt extends HTMLElement {
|
|
|
908
905
|
this.innerHTML = "", N.log("NineTableSheet destroyed.");
|
|
909
906
|
}
|
|
910
907
|
};
|
|
911
|
-
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);
|
|
912
909
|
let $t = yt;
|
|
913
910
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", $t);
|
|
914
911
|
var Kt, qt;
|
|
915
912
|
const _e = class _e extends HTMLElement {
|
|
916
913
|
constructor() {
|
|
917
914
|
super();
|
|
918
|
-
|
|
915
|
+
d(this, Kt, /* @__PURE__ */ c(() => {
|
|
919
916
|
var e;
|
|
920
917
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
921
|
-
var
|
|
922
|
-
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);
|
|
923
920
|
t(this, qt).call(this, n, r);
|
|
924
921
|
}), t(this, qt).call(this, 0, !1);
|
|
925
922
|
}, "#init"));
|
|
926
|
-
|
|
923
|
+
d(this, qt, /* @__PURE__ */ c((e, s = !1) => {
|
|
927
924
|
const r = /* @__PURE__ */ c(() => {
|
|
928
925
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
929
|
-
Array.from(this.querySelectorAll("nine-splitter")).forEach((
|
|
930
|
-
const
|
|
931
|
-
|
|
932
|
-
const
|
|
933
|
-
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");
|
|
934
931
|
});
|
|
935
|
-
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"),
|
|
936
|
-
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;
|
|
937
934
|
if (!s)
|
|
938
|
-
|
|
935
|
+
a.forEach((f, u) => {
|
|
939
936
|
f.classList.toggle("active", u === e);
|
|
940
|
-
}),
|
|
941
|
-
const
|
|
942
|
-
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%" : "";
|
|
943
940
|
});
|
|
944
941
|
else {
|
|
945
|
-
const f =
|
|
942
|
+
const f = a[e], u = n.querySelectorAll(".nine-tab-item.active");
|
|
946
943
|
if (f.classList.contains("active") && u.length <= 1)
|
|
947
944
|
return;
|
|
948
945
|
f.classList.toggle("active");
|
|
949
|
-
const
|
|
950
|
-
|
|
946
|
+
const g = o.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
947
|
+
g && (g.classList.toggle("active"), g.classList.contains("active") || (g.style.flex = ""));
|
|
951
948
|
}
|
|
952
|
-
const l =
|
|
949
|
+
const l = o.querySelectorAll("nine-table-sheet.active");
|
|
953
950
|
l == null || l.forEach((f) => {
|
|
954
951
|
f.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
955
952
|
}), r();
|
|
@@ -965,25 +962,25 @@ customElements.get("nine-table-sheets") || customElements.define("nine-table-she
|
|
|
965
962
|
var M, Zt, Tt, Gt;
|
|
966
963
|
const Ne = class Ne {
|
|
967
964
|
constructor(i) {
|
|
968
|
-
|
|
969
|
-
|
|
965
|
+
d(this, M);
|
|
966
|
+
d(this, Zt, /* @__PURE__ */ c(() => {
|
|
970
967
|
t(this, Gt).call(this), new ResizeObserver((i) => {
|
|
971
968
|
for (let e of i)
|
|
972
969
|
t(this, M).getAttribute("auto-height") === "true" && t(this, Tt).call(this);
|
|
973
970
|
}).observe(t(this, M));
|
|
974
971
|
}, "#init"));
|
|
975
|
-
|
|
976
|
-
var
|
|
972
|
+
d(this, Tt, /* @__PURE__ */ c(() => {
|
|
973
|
+
var h, l;
|
|
977
974
|
const i = Array.from(t(this, M).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
978
975
|
if (i.length === 0) return;
|
|
979
|
-
const e = parseInt(t(this, M).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), r = (
|
|
980
|
-
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`;
|
|
981
978
|
}, "#applyAutoHeight"));
|
|
982
|
-
|
|
983
|
-
const e = Array.from(t(this, M).children).filter((
|
|
984
|
-
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`,
|
|
985
|
-
return u +
|
|
986
|
-
}).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("");
|
|
987
984
|
t(this, M).shadowRoot.innerHTML = `
|
|
988
985
|
<style>
|
|
989
986
|
:host {
|
|
@@ -1067,7 +1064,7 @@ const Ne = class Ne {
|
|
|
1067
1064
|
<nine-table-sheets>
|
|
1068
1065
|
<nine-table-sheets-body>${n}</nine-table-sheets-body>
|
|
1069
1066
|
<nine-table-sheets-footer>
|
|
1070
|
-
<div class="nine-tab-bar">${
|
|
1067
|
+
<div class="nine-tab-bar">${o}</div>
|
|
1071
1068
|
<div class="sheets-counter">Total : <span id="row-count">0</span></div>
|
|
1072
1069
|
</nine-table-sheets-footer>
|
|
1073
1070
|
</nine-table-sheets>
|
|
@@ -1075,10 +1072,10 @@ const Ne = class Ne {
|
|
|
1075
1072
|
</nine-table-body>
|
|
1076
1073
|
<nine-table-footer></nine-table-footer>
|
|
1077
1074
|
`;
|
|
1078
|
-
const
|
|
1079
|
-
|
|
1075
|
+
const a = t(this, M).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1076
|
+
a == null || a.forEach((h, l) => {
|
|
1080
1077
|
e[l] && setTimeout(() => {
|
|
1081
|
-
|
|
1078
|
+
h.generate(e[l]), s && t(this, Tt).call(this);
|
|
1082
1079
|
});
|
|
1083
1080
|
});
|
|
1084
1081
|
}, "#render"));
|
|
@@ -1090,9 +1087,9 @@ let fe = Ne;
|
|
|
1090
1087
|
var kt, ht;
|
|
1091
1088
|
const We = class We {
|
|
1092
1089
|
constructor(i) {
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1090
|
+
d(this, kt);
|
|
1091
|
+
d(this, ht, -1);
|
|
1092
|
+
A(this, "count", /* @__PURE__ */ c(() => t(this, kt).rawRecords.length, "count"));
|
|
1096
1093
|
p(this, kt, i);
|
|
1097
1094
|
}
|
|
1098
1095
|
get at() {
|
|
@@ -1106,15 +1103,15 @@ const We = class We {
|
|
|
1106
1103
|
kt = new WeakMap(), ht = new WeakMap(), c(We, "ngRow");
|
|
1107
1104
|
let ue = We;
|
|
1108
1105
|
var I, T, _, dt, Jt, Y, Qt, it, Ct, te, ee, ft;
|
|
1109
|
-
const
|
|
1106
|
+
const W = class W {
|
|
1110
1107
|
constructor(i, e) {
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
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(() => {
|
|
1118
1115
|
p(this, Y, []);
|
|
1119
1116
|
const i = t(this, I).template || [];
|
|
1120
1117
|
Array.from(i).forEach((e) => {
|
|
@@ -1124,12 +1121,12 @@ const O = class O {
|
|
|
1124
1121
|
e.__ng || (e.__ng = t(this, Ct).call(this)), e.__ng.height = t(this, Y).slice();
|
|
1125
1122
|
});
|
|
1126
1123
|
}, "#initialize"));
|
|
1127
|
-
|
|
1124
|
+
d(this, it, /* @__PURE__ */ c(() => {
|
|
1128
1125
|
t(this, I).shadowRoot.querySelectorAll("nine-table-sheet").forEach((i) => {
|
|
1129
1126
|
i.invalidate();
|
|
1130
1127
|
});
|
|
1131
1128
|
}, "#invalidate"));
|
|
1132
|
-
|
|
1129
|
+
A(this, "get", /* @__PURE__ */ c((i, e) => {
|
|
1133
1130
|
var n;
|
|
1134
1131
|
const s = this.getValidData();
|
|
1135
1132
|
if (!s || s.length <= 0) return;
|
|
@@ -1137,95 +1134,95 @@ const O = class O {
|
|
|
1137
1134
|
if (i < 0 || i >= s.length) return null;
|
|
1138
1135
|
const r = typeof ((n = t(this, I).fields) == null ? void 0 : n.get) == "function" ? t(this, I).fields.get() : [];
|
|
1139
1136
|
if (e != null) {
|
|
1140
|
-
const
|
|
1141
|
-
return
|
|
1137
|
+
const o = r.indexOf(e);
|
|
1138
|
+
return o >= 0 ? s[i].v[o] : null;
|
|
1142
1139
|
}
|
|
1143
1140
|
return t(this, ft).call(this, s[i]);
|
|
1144
1141
|
}, "get"));
|
|
1145
|
-
|
|
1142
|
+
A(this, "set", /* @__PURE__ */ c((i) => {
|
|
1146
1143
|
this.clear(), this.add(i, !1), t(this, it).call(this);
|
|
1147
1144
|
}, "set"));
|
|
1148
|
-
|
|
1149
|
-
rowState:
|
|
1145
|
+
d(this, Ct, /* @__PURE__ */ c(() => ({
|
|
1146
|
+
rowState: W.ROW_STATE.EMPTY,
|
|
1150
1147
|
deleted: !1,
|
|
1151
1148
|
filtered: !1,
|
|
1152
1149
|
height: t(this, Y).slice(),
|
|
1153
1150
|
o: {},
|
|
1154
1151
|
c: {},
|
|
1155
|
-
_: [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, {}, {}]
|
|
1156
1153
|
}), "#getDefaultMeta"));
|
|
1157
|
-
|
|
1154
|
+
A(this, "reset", /* @__PURE__ */ c(() => {
|
|
1158
1155
|
p(this, _, []), p(this, dt, []), t(this, it).call(this);
|
|
1159
1156
|
}, "reset"));
|
|
1160
|
-
|
|
1157
|
+
A(this, "clear", /* @__PURE__ */ c(() => {
|
|
1161
1158
|
var i;
|
|
1162
1159
|
t(this, T).rawRecords = [], p(this, _, []), p(this, dt, []), (i = t(this, T).viewRecords) != null && i.reset && t(this, T).viewRecords.reset();
|
|
1163
1160
|
}, "clear"));
|
|
1164
|
-
|
|
1161
|
+
d(this, te, /* @__PURE__ */ c((i) => {
|
|
1165
1162
|
var r;
|
|
1166
1163
|
Array.isArray(i) || (i = [i]);
|
|
1167
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 = [];
|
|
1168
1165
|
return i.forEach((n) => {
|
|
1169
|
-
const
|
|
1170
|
-
e.forEach((
|
|
1171
|
-
|
|
1172
|
-
}), 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);
|
|
1173
1170
|
}), s;
|
|
1174
1171
|
}, "#json2Array"));
|
|
1175
|
-
|
|
1176
|
-
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;
|
|
1177
1174
|
}), i), "#defaultInsert"));
|
|
1178
|
-
|
|
1175
|
+
A(this, "add", /* @__PURE__ */ c((i, e = !0) => {
|
|
1179
1176
|
i === void 0 && (i = {});
|
|
1180
1177
|
const s = t(this, te).call(this, i);
|
|
1181
1178
|
t(this, T).rawRecords = t(this, T).rawRecords.concat(t(this, ee).call(this, s)), this.resetRecords();
|
|
1182
1179
|
const r = this.count() - 1;
|
|
1183
|
-
return e || s.forEach((n,
|
|
1184
|
-
const
|
|
1185
|
-
|
|
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);
|
|
1186
1183
|
}), t(this, it).call(this), r;
|
|
1187
1184
|
}, "add"));
|
|
1188
|
-
|
|
1185
|
+
A(this, "delete", /* @__PURE__ */ c((i) => {
|
|
1189
1186
|
let e = [];
|
|
1190
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) => {
|
|
1191
1188
|
if (t(this, _)[s]) {
|
|
1192
1189
|
const r = t(this, _)[s].__ng.rowid;
|
|
1193
|
-
t(this, _)[s].__ng.rowState ===
|
|
1194
|
-
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);
|
|
1195
1192
|
});
|
|
1196
1193
|
}
|
|
1197
1194
|
}), this.resetRecords(), t(this, it).call(this);
|
|
1198
1195
|
}, "delete"));
|
|
1199
|
-
|
|
1200
|
-
var
|
|
1196
|
+
A(this, "setValue", /* @__PURE__ */ c((i, e, s) => {
|
|
1197
|
+
var h;
|
|
1201
1198
|
i = parseInt(i, 10);
|
|
1202
|
-
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);
|
|
1203
1200
|
if (n < 0) return;
|
|
1204
|
-
const
|
|
1205
|
-
if (!
|
|
1206
|
-
const
|
|
1207
|
-
|
|
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;
|
|
1208
1205
|
}, "setValue"));
|
|
1209
|
-
|
|
1206
|
+
A(this, "resetRecords", /* @__PURE__ */ c(() => {
|
|
1210
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) => {
|
|
1211
1208
|
i.__ng.rowidx = e;
|
|
1212
1209
|
}), t(this, _).forEach((i, e) => {
|
|
1213
1210
|
i.__ng.i = e;
|
|
1214
1211
|
});
|
|
1215
1212
|
}, "resetRecords"));
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
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;
|
|
1219
1216
|
if (!i) return i;
|
|
1220
|
-
const e = !Array.isArray(i), s = e ? [i] : i, r = typeof ((
|
|
1221
|
-
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 = {};
|
|
1222
1219
|
return r.forEach((l, f) => {
|
|
1223
|
-
|
|
1224
|
-
}),
|
|
1220
|
+
h[l] = a.v ? a.v[f] : a[l];
|
|
1221
|
+
}), h.__ng = a.__ng, h;
|
|
1225
1222
|
});
|
|
1226
1223
|
return e ? n[0] : n;
|
|
1227
1224
|
}, "#conv"));
|
|
1228
|
-
|
|
1225
|
+
A(this, "count", /* @__PURE__ */ c(() => this.getValidData().length, "count"));
|
|
1229
1226
|
p(this, I, i), p(this, T, e), t(this, Qt).call(this);
|
|
1230
1227
|
}
|
|
1231
1228
|
get source() {
|
|
@@ -1247,19 +1244,19 @@ const O = class O {
|
|
|
1247
1244
|
return this.length;
|
|
1248
1245
|
}
|
|
1249
1246
|
};
|
|
1250
|
-
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(
|
|
1251
|
-
|
|
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", {
|
|
1252
1249
|
EMPTY: "EMPTY",
|
|
1253
1250
|
NORMAL: "NORMAL",
|
|
1254
1251
|
INSERT: "INSERT",
|
|
1255
1252
|
UPDATE: "UPDATE",
|
|
1256
1253
|
DELETE: "DELETE"
|
|
1257
1254
|
});
|
|
1258
|
-
let ge =
|
|
1255
|
+
let ge = W;
|
|
1259
1256
|
var rt;
|
|
1260
1257
|
const Oe = class Oe {
|
|
1261
1258
|
constructor(i) {
|
|
1262
|
-
|
|
1259
|
+
d(this, rt);
|
|
1263
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 = () => {
|
|
1264
1261
|
var e;
|
|
1265
1262
|
(e = t(this, rt).view) != null && e.redraw && t(this, rt).view.redraw();
|
|
@@ -1283,44 +1280,44 @@ var ut, L, Lt, se;
|
|
|
1283
1280
|
const Be = class Be {
|
|
1284
1281
|
// 🎯 이제 { name: string, type: string } 객체들의 배열로 관리합니다.
|
|
1285
1282
|
constructor(i) {
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1283
|
+
d(this, ut);
|
|
1284
|
+
d(this, L, []);
|
|
1285
|
+
A(this, "add", /* @__PURE__ */ c((i, e = "string") => {
|
|
1289
1286
|
i.forEach((s) => {
|
|
1290
1287
|
t(this, L).some((r) => r.name === s) || t(this, L).push({ name: s, type: e });
|
|
1291
1288
|
}), t(this, Lt).call(this);
|
|
1292
1289
|
}, "add"));
|
|
1293
|
-
|
|
1290
|
+
d(this, Lt, /* @__PURE__ */ c(() => {
|
|
1294
1291
|
const i = /* @__PURE__ */ new Map();
|
|
1295
1292
|
t(this, L).forEach((e) => {
|
|
1296
1293
|
i.set(e.name, e.type);
|
|
1297
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);
|
|
1298
1295
|
}, "#adjust"));
|
|
1299
|
-
|
|
1296
|
+
d(this, se, /* @__PURE__ */ c(() => {
|
|
1300
1297
|
p(this, L, []), N.log(t(this, ut).querySelectorAll("table"));
|
|
1301
1298
|
const i = Array.from(t(this, ut).querySelectorAll("table"));
|
|
1302
1299
|
if (!(!i || i.length === 0)) {
|
|
1303
1300
|
for (const e of i)
|
|
1304
1301
|
N.log(e), $("[data-bind]", e).each((s, r) => {
|
|
1305
|
-
const n = r.dataset.bind,
|
|
1306
|
-
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 });
|
|
1307
1304
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
1308
1305
|
$(`[${s}]`, e).each((r, n) => {
|
|
1309
|
-
var
|
|
1310
|
-
if (
|
|
1311
|
-
const
|
|
1312
|
-
if (
|
|
1306
|
+
var o = n.getAttribute(s);
|
|
1307
|
+
if (o.indexOf("data.") < 0) {
|
|
1308
|
+
const a = o.search(/[(]/g);
|
|
1309
|
+
if (a > 0)
|
|
1313
1310
|
try {
|
|
1314
|
-
|
|
1311
|
+
o = String(window[o.substring(0, a).trim()]);
|
|
1315
1312
|
} catch {
|
|
1316
|
-
|
|
1313
|
+
o = "";
|
|
1317
1314
|
}
|
|
1318
1315
|
}
|
|
1319
|
-
|
|
1320
|
-
if (
|
|
1321
|
-
const
|
|
1316
|
+
o.split("data.").forEach((a) => {
|
|
1317
|
+
if (a.trim() != "") {
|
|
1318
|
+
const h = a.search(/[^_A-Za-z0-9]/g);
|
|
1322
1319
|
let l = "";
|
|
1323
|
-
|
|
1320
|
+
h >= 0 ? l = a.substring(0, h) : o.startsWith("data.") && (l = a.replace("data.", "")), l && t(this, L).push({ name: l, type: "string" });
|
|
1324
1321
|
}
|
|
1325
1322
|
});
|
|
1326
1323
|
});
|
|
@@ -1357,9 +1354,9 @@ const ze = class ze extends HTMLElement {
|
|
|
1357
1354
|
constructor() {
|
|
1358
1355
|
super();
|
|
1359
1356
|
//#created = false;
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1357
|
+
d(this, nt);
|
|
1358
|
+
d(this, ie);
|
|
1359
|
+
d(this, re, /* @__PURE__ */ c(() => {
|
|
1363
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 } }));
|
|
1364
1361
|
}, "#init"));
|
|
1365
1362
|
this.attachShadow({ mode: "open" }), p(this, nt, new be(this));
|
|
@@ -1397,20 +1394,20 @@ const mt = class mt extends HTMLElement {
|
|
|
1397
1394
|
connectedCallback() {
|
|
1398
1395
|
}
|
|
1399
1396
|
};
|
|
1400
|
-
c(mt, "BasicCellElement"),
|
|
1397
|
+
c(mt, "BasicCellElement"), A(mt, "_styleCache", /* @__PURE__ */ new Map()), A(mt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1401
1398
|
let me = mt;
|
|
1402
1399
|
var k, Ht, y, Re, qe, Te, ke, Ce;
|
|
1403
1400
|
const Pe = class Pe extends me {
|
|
1404
1401
|
constructor() {
|
|
1405
1402
|
super();
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
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) => {
|
|
1414
1411
|
if (t(this, y))
|
|
1415
1412
|
if (t(this, y).closest("tbody")) {
|
|
1416
1413
|
const s = t(this, y).closest("tr").data, r = parseInt(t(this, y).dataset.row);
|
|
@@ -1430,23 +1427,23 @@ const Pe = class Pe extends me {
|
|
|
1430
1427
|
} catch {
|
|
1431
1428
|
}
|
|
1432
1429
|
}, "getDisplayText"));
|
|
1433
|
-
|
|
1430
|
+
d(this, Ce, /* @__PURE__ */ c(() => {
|
|
1434
1431
|
if (!(!t(this, k) || !t(this, k).template || !t(this, y).closest("tbody.bindable"))) {
|
|
1435
1432
|
var e = ninegrid.j.querySelectorAll(t(this, y)).attr("suppress");
|
|
1436
1433
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1437
1434
|
var s = t(this, y).closest("tr"), r = [];
|
|
1438
|
-
$("th,td", s).each((
|
|
1439
|
-
var C = ninegrid.j.querySelectorAll(
|
|
1440
|
-
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));
|
|
1441
1438
|
}), r.sort();
|
|
1442
1439
|
var n = !1;
|
|
1443
1440
|
if (parseInt(s.sectionRowIndex / t(this, k).template.length) > 0)
|
|
1444
|
-
for (var
|
|
1445
|
-
if (
|
|
1446
|
-
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);
|
|
1447
1444
|
t(this, y).dataset.matrixRow;
|
|
1448
|
-
var u = t(this, k).body.querySelector(`tbody.bindable [suppress="${
|
|
1449
|
-
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) {
|
|
1450
1447
|
n = !0;
|
|
1451
1448
|
break;
|
|
1452
1449
|
}
|
|
@@ -1454,17 +1451,17 @@ const Pe = class Pe extends me {
|
|
|
1454
1451
|
else
|
|
1455
1452
|
n = !0;
|
|
1456
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"));
|
|
1457
|
-
var
|
|
1458
|
-
$(
|
|
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");
|
|
1459
1456
|
}
|
|
1460
1457
|
}
|
|
1461
1458
|
}, "#resetSuppress"));
|
|
1462
|
-
|
|
1459
|
+
A(this, "getExprValue", /* @__PURE__ */ c((e, s, r, n) => {
|
|
1463
1460
|
if (typeof e < "u")
|
|
1464
1461
|
try {
|
|
1465
1462
|
r = parseInt(r);
|
|
1466
|
-
const
|
|
1467
|
-
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);
|
|
1468
1465
|
} catch {
|
|
1469
1466
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1470
1467
|
}
|
|
@@ -1514,13 +1511,13 @@ var Mt, ot, gt, bt, ne, U, Le;
|
|
|
1514
1511
|
const je = class je extends ve {
|
|
1515
1512
|
constructor() {
|
|
1516
1513
|
super();
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
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(() => {
|
|
1524
1521
|
const e = super.refresh();
|
|
1525
1522
|
t(this, Mt).value = e;
|
|
1526
1523
|
}, "refresh"));
|
|
@@ -1554,7 +1551,7 @@ const je = class je extends ve {
|
|
|
1554
1551
|
if (!v) this.reset();
|
|
1555
1552
|
};
|
|
1556
1553
|
*/
|
|
1557
|
-
|
|
1554
|
+
d(this, Le, /* @__PURE__ */ c((e) => {
|
|
1558
1555
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1559
1556
|
if (t(this, ot) == "number") {
|
|
1560
1557
|
let n = [];
|