@ninebone/table 0.0.622 → 0.0.623
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 +282 -284
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +7 -7
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -5,10 +5,10 @@ var Ve = (q) => {
|
|
|
5
5
|
var Xe = (q, i, e) => i in q ? Fe(q, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : q[i] = e;
|
|
6
6
|
var c = (q, i) => Fe(q, "name", { value: i, configurable: !0 });
|
|
7
7
|
var E = (q, i, e) => Xe(q, typeof i != "symbol" ? i + "" : i, e), Ye = (q, i, e) => i.has(q) || Ve("Cannot " + e);
|
|
8
|
-
var t = (q, i, e) => (Ye(q, i, "read from private field"), e ? e.call(q) : i.get(q)), d = (q, i, e) => i.has(q) ? Ve("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(q) : i.set(q, e),
|
|
8
|
+
var t = (q, i, e) => (Ye(q, i, "read from private field"), e ? e.call(q) : i.get(q)), d = (q, i, e) => i.has(q) ? Ve("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(q) : i.set(q, e), b = (q, i, e, s) => (Ye(q, i, "write to private field"), s ? s.call(q, e) : i.set(q, e), e);
|
|
9
9
|
var Ue = (q, i, e, s) => ({
|
|
10
10
|
set _(r) {
|
|
11
|
-
|
|
11
|
+
b(q, i, r, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
14
|
return t(q, i, s);
|
|
@@ -36,7 +36,7 @@ const Me = class Me extends HTMLElement {
|
|
|
36
36
|
d(this, It, /* @__PURE__ */ c(() => {
|
|
37
37
|
if (!t(this, B)) return;
|
|
38
38
|
const e = t(this, B).querySelector(".ng-container-body .ng-part-body");
|
|
39
|
-
e && (
|
|
39
|
+
e && (b(this, Z, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
41
|
})), t(this, Z).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
@@ -44,43 +44,43 @@ const Me = class Me extends HTMLElement {
|
|
|
44
44
|
if (!t(this, B) || !t(this, w) || t(this, j)) return;
|
|
45
45
|
const e = t(this, w).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const r = t(this, w).track, n = t(this, w).thumb,
|
|
48
|
-
if (
|
|
49
|
-
|
|
47
|
+
const r = t(this, w).track, n = t(this, w).thumb, a = t(this, B).querySelector(".ng-container-bottom"), o = e.clientWidth, h = s.scrollWidth;
|
|
48
|
+
if (o !== 0 && h > o)
|
|
49
|
+
a && (a.style.display = "flex");
|
|
50
50
|
else {
|
|
51
|
-
|
|
51
|
+
a && (a.style.display = "none");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
54
|
const l = r.clientWidth;
|
|
55
55
|
if (l <= 0) return;
|
|
56
|
-
const f = Math.max(Math.min(l * (
|
|
56
|
+
const f = Math.max(Math.min(l * (o / h), l), 20);
|
|
57
57
|
n.style.width = `${f}px`;
|
|
58
|
-
const u = e.scrollLeft,
|
|
59
|
-
let
|
|
60
|
-
|
|
58
|
+
const u = e.scrollLeft, y = h - o;
|
|
59
|
+
let g = 0;
|
|
60
|
+
y > 0 && (g = parseInt(u / y * (l - f), 10)), g < 0 && (g = 0);
|
|
61
61
|
const m = l - f;
|
|
62
|
-
|
|
62
|
+
g > m && (g = m), n.style.left = `${g}px`, t(this, w).left.disabled = g === 0, t(this, w).right.disabled = g >= 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 h = n.width -
|
|
72
|
-
|
|
68
|
+
const n = t(this, w).track.getBoundingClientRect(), a = t(this, w).thumb.clientWidth;
|
|
69
|
+
let o = e;
|
|
70
|
+
o < 0 && (o = 0);
|
|
71
|
+
const h = n.width - a;
|
|
72
|
+
o > h && (o = h), o = parseInt(o, 10), t(this, w).thumb.style.left = `${o}px`, t(this, w).left.disabled = o === 0, t(this, w).right.disabled = o >= h - 1;
|
|
73
73
|
const l = s.clientWidth, u = r.scrollWidth - l;
|
|
74
|
-
return h > 0 && u > 0 && (s.scrollLeft =
|
|
74
|
+
return h > 0 && u > 0 && (s.scrollLeft = o / h * u), o > 0 && o < 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
|
-
t(this, G).call(this, n + r),
|
|
81
|
-
clearInterval(t(this, X)),
|
|
82
|
-
const
|
|
83
|
-
t(this, G).call(this,
|
|
80
|
+
t(this, G).call(this, n + r), b(this, X, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, X)), b(this, K, setInterval(() => {
|
|
82
|
+
const a = parseInt(t(this, w).thumb.style.left || 0, 10);
|
|
83
|
+
t(this, G).call(this, a + r) || clearInterval(t(this, K));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), s = /* @__PURE__ */ c(() => {
|
|
@@ -95,24 +95,24 @@ 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(), a = t(this, w).thumb.clientWidth;
|
|
99
|
+
t(this, G).call(this, r.clientX - n.left - a / 2);
|
|
100
100
|
}), t(this, w).thumb.addEventListener("mousedown", (r) => {
|
|
101
101
|
if (r.button !== 0) return;
|
|
102
|
-
r.stopPropagation(), r.preventDefault(),
|
|
103
|
-
const n = /* @__PURE__ */ c((
|
|
102
|
+
r.stopPropagation(), r.preventDefault(), b(this, j, !0), this.shiftX = r.clientX - t(this, w).thumb.getBoundingClientRect().left;
|
|
103
|
+
const n = /* @__PURE__ */ c((o) => {
|
|
104
104
|
if (!t(this, j)) return;
|
|
105
105
|
const h = t(this, w).track.getBoundingClientRect();
|
|
106
|
-
t(this, G).call(this,
|
|
107
|
-
}, "onMouseMove"),
|
|
108
|
-
|
|
106
|
+
t(this, G).call(this, o.clientX - h.left - this.shiftX);
|
|
107
|
+
}, "onMouseMove"), a = /* @__PURE__ */ c(() => {
|
|
108
|
+
b(this, j, !1), s(), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", a), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
|
-
document.addEventListener("mousemove", n), document.addEventListener("mouseup",
|
|
110
|
+
document.addEventListener("mousemove", n), document.addEventListener("mouseup", a);
|
|
111
111
|
});
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
114
114
|
connectedCallback() {
|
|
115
|
-
if (
|
|
115
|
+
if (b(this, B, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, B)) return;
|
|
116
116
|
this.innerHTML = `
|
|
117
117
|
<style>
|
|
118
118
|
nine-table-hscrollbar {
|
|
@@ -182,7 +182,7 @@ const Me = class Me extends HTMLElement {
|
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
|
-
|
|
185
|
+
b(this, w, {
|
|
186
186
|
container: s,
|
|
187
187
|
track: this.querySelector(".ng-scroll-track"),
|
|
188
188
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
@@ -213,8 +213,8 @@ const $e = class $e extends HTMLElement {
|
|
|
213
213
|
d(this, xt, 0);
|
|
214
214
|
E(this, "refresh", /* @__PURE__ */ c(() => {
|
|
215
215
|
if (!t(this, F) || !t(this, T)) return;
|
|
216
|
-
const e = t(this, T).container, s = t(this, T).track, r = t(this, T).thumb, n = e.clientHeight,
|
|
217
|
-
if (l <= n ||
|
|
216
|
+
const e = t(this, T).container, s = t(this, T).track, r = t(this, T).thumb, n = e.clientHeight, o = (t(this, F).data.get() || []).length, h = t(this, at).getRowHeight(), l = o * h;
|
|
217
|
+
if (l <= n || o === 0) {
|
|
218
218
|
this.style.display = "none";
|
|
219
219
|
return;
|
|
220
220
|
} else
|
|
@@ -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
|
|
226
|
+
const y = e.scrollTop, g = Math.max(l - n, 1);
|
|
227
227
|
let m = 0;
|
|
228
|
-
|
|
228
|
+
g > 0 && (m = y / g * (f - u));
|
|
229
229
|
const x = f - u;
|
|
230
|
-
m < 0 && (m = 0), m > x && (m = x), r.style.top = `${m}px`, t(this, T).top.disabled =
|
|
230
|
+
m < 0 && (m = 0), m > x && (m = x), r.style.top = `${m}px`, t(this, T).top.disabled = y <= 0, t(this, T).bottom.disabled = y >= g - 1;
|
|
231
231
|
}, "refresh"));
|
|
232
232
|
d(this, Nt, /* @__PURE__ */ c(() => {
|
|
233
233
|
M.log("nine-table-vscrollbar.#init");
|
|
234
234
|
const e = t(this, T).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, a = t(this, at).getRowHeight();
|
|
236
|
+
return n * a;
|
|
237
237
|
}, "getContentHeight");
|
|
238
238
|
e.addEventListener("scroll", () => {
|
|
239
239
|
t(this, J) || this.refresh();
|
|
240
240
|
}), t(this, T).thumb.addEventListener("mousedown", (r) => {
|
|
241
241
|
if (r.button !== 0) return;
|
|
242
|
-
r.stopPropagation(), r.preventDefault(),
|
|
243
|
-
const n = /* @__PURE__ */ c((
|
|
242
|
+
r.stopPropagation(), r.preventDefault(), b(this, J, !0), b(this, vt, r.clientY), b(this, xt, e.scrollTop);
|
|
243
|
+
const n = /* @__PURE__ */ c((o) => {
|
|
244
244
|
if (!t(this, J)) return;
|
|
245
|
-
const h = t(this, T).track.getBoundingClientRect(), l = t(this, T).thumb.clientHeight, u = h.height - l,
|
|
245
|
+
const h = t(this, T).track.getBoundingClientRect(), l = t(this, T).thumb.clientHeight, u = h.height - l, y = o.clientY - t(this, vt), g = e.clientHeight, m = s(), x = Math.max(m - g, 1);
|
|
246
246
|
if (u > 0 && x > 0) {
|
|
247
|
-
const A =
|
|
247
|
+
const A = y / u * x;
|
|
248
248
|
let v = t(this, xt) + A;
|
|
249
|
-
const I = Math.max(0, m -
|
|
249
|
+
const I = Math.max(0, m - g);
|
|
250
250
|
v < 0 && (v = 0), v > I && (v = I), e.scrollTop = v;
|
|
251
251
|
}
|
|
252
252
|
this.refresh();
|
|
253
|
-
}, "onMouseMove"),
|
|
254
|
-
|
|
253
|
+
}, "onMouseMove"), a = /* @__PURE__ */ c(() => {
|
|
254
|
+
b(this, J, !1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", a), this.refresh();
|
|
255
255
|
}, "onMouseUp");
|
|
256
|
-
document.addEventListener("mousemove", n), document.addEventListener("mouseup",
|
|
256
|
+
document.addEventListener("mousemove", n), document.addEventListener("mouseup", a);
|
|
257
257
|
}), t(this, T).track.addEventListener("mousedown", (r) => {
|
|
258
258
|
if (r.button !== 0 || r.target === t(this, T).thumb) return;
|
|
259
|
-
const n = t(this, T).track.getBoundingClientRect(),
|
|
260
|
-
if (l > 0 &&
|
|
261
|
-
const
|
|
262
|
-
e.scrollTop =
|
|
259
|
+
const n = t(this, T).track.getBoundingClientRect(), a = t(this, T).thumb.clientHeight, o = r.clientY - n.top - a / 2, l = n.height - a, f = e.clientHeight, u = s(), y = Math.max(u - f, 1);
|
|
260
|
+
if (l > 0 && y > 0) {
|
|
261
|
+
const g = Math.max(0, Math.min(1, o / l));
|
|
262
|
+
e.scrollTop = g * y;
|
|
263
263
|
}
|
|
264
264
|
this.refresh();
|
|
265
265
|
}), t(this, T).top.addEventListener("click", () => {
|
|
@@ -270,7 +270,7 @@ const $e = class $e extends HTMLElement {
|
|
|
270
270
|
}, "#init"));
|
|
271
271
|
}
|
|
272
272
|
connectedCallback() {
|
|
273
|
-
|
|
273
|
+
b(this, F, this.getRootNode().host), b(this, at, this.closest("nine-table-sheet")), this.innerHTML = `
|
|
274
274
|
<style>
|
|
275
275
|
nine-table-vscrollbar {
|
|
276
276
|
display: flex;
|
|
@@ -340,7 +340,7 @@ const $e = class $e extends HTMLElement {
|
|
|
340
340
|
setTimeout(e, 10);
|
|
341
341
|
return;
|
|
342
342
|
}
|
|
343
|
-
|
|
343
|
+
b(this, T, {
|
|
344
344
|
container: s,
|
|
345
345
|
track: this.querySelector(".ng-scroll-track"),
|
|
346
346
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
@@ -354,13 +354,13 @@ const $e = class $e extends HTMLElement {
|
|
|
354
354
|
F = new WeakMap(), at = new WeakMap(), J = new WeakMap(), T = new WeakMap(), vt = new WeakMap(), xt = new WeakMap(), Nt = new WeakMap(), c($e, "NineTableVScrollBar");
|
|
355
355
|
let le = $e;
|
|
356
356
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", le);
|
|
357
|
-
var
|
|
357
|
+
var D, S, Q, P, _, V, tt, wt, Se, Ae, Wt, Ot, zt, St, At, Bt, Dt, Et, Ee, lt, qt, Pt;
|
|
358
358
|
const Ie = class Ie {
|
|
359
359
|
constructor(i) {
|
|
360
|
-
d(this,
|
|
360
|
+
d(this, D);
|
|
361
361
|
d(this, S);
|
|
362
362
|
d(this, Q);
|
|
363
|
-
d(this,
|
|
363
|
+
d(this, P, /* @__PURE__ */ new Map());
|
|
364
364
|
d(this, _, null);
|
|
365
365
|
d(this, V, null);
|
|
366
366
|
d(this, tt, 0);
|
|
@@ -376,126 +376,124 @@ const Ie = class Ie {
|
|
|
376
376
|
i && (t(this, St).call(this), t(this, lt).call(this, i.scrollTop), (e = t(this, S).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
377
377
|
}, "refresh"));
|
|
378
378
|
E(this, "initialize", /* @__PURE__ */ c(() => {
|
|
379
|
-
M.log("rowManager.initialize"),
|
|
379
|
+
M.log("rowManager.initialize"), b(this, Q, {
|
|
380
380
|
scrollTables: t(this, S).querySelectorAll(".ng-part-body table"),
|
|
381
381
|
firstTr: t(this, S).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
382
|
-
}),
|
|
383
|
-
const
|
|
384
|
-
if (!
|
|
385
|
-
const h =
|
|
382
|
+
}), b(this, _, null), t(this, P).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((a) => {
|
|
383
|
+
const o = t(this, S).querySelector(a);
|
|
384
|
+
if (!o) return;
|
|
385
|
+
const h = o.querySelector(".ng-part-body table");
|
|
386
386
|
if (!h) return;
|
|
387
387
|
const l = h.querySelector("tbody.bindable-tbody");
|
|
388
388
|
if (!l) return;
|
|
389
|
-
const u = Array.from(l.querySelectorAll("tr")).map((
|
|
390
|
-
t(this,
|
|
389
|
+
const u = Array.from(l.querySelectorAll("tr")).map((y) => y.cloneNode(!0));
|
|
390
|
+
t(this, P).set(a, u);
|
|
391
391
|
});
|
|
392
392
|
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");
|
|
393
393
|
if (i) {
|
|
394
394
|
t(this, zt).call(this, i), t(this, Et).call(this), t(this, St).call(this), t(this, lt).call(this, i.scrollTop);
|
|
395
|
-
let
|
|
396
|
-
const
|
|
397
|
-
if (
|
|
398
|
-
|
|
395
|
+
let a = !1;
|
|
396
|
+
const o = /* @__PURE__ */ c((h) => {
|
|
397
|
+
if (a) return;
|
|
398
|
+
a = !0;
|
|
399
399
|
const l = h.scrollTop, f = h.scrollLeft;
|
|
400
|
-
i && i.scrollTop !== l && (i.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), r && r.scrollLeft !== f && (r.scrollLeft = f), n && n.scrollLeft !== f && (n.scrollLeft = f), t(this, lt).call(this, l),
|
|
400
|
+
i && i.scrollTop !== l && (i.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), r && r.scrollLeft !== f && (r.scrollLeft = f), n && n.scrollLeft !== f && (n.scrollLeft = f), t(this, lt).call(this, l), a = !1;
|
|
401
401
|
}, "handleContainerScroll");
|
|
402
402
|
[i, e, s].forEach((h) => {
|
|
403
403
|
h && h.addEventListener("scroll", () => {
|
|
404
|
-
|
|
404
|
+
o(h);
|
|
405
405
|
}, { passive: !0 });
|
|
406
406
|
});
|
|
407
407
|
}
|
|
408
408
|
}, "initialize"));
|
|
409
409
|
d(this, Ot, /* @__PURE__ */ c((i, e) => {
|
|
410
410
|
M.log("rowManager.#renderRows");
|
|
411
|
-
const s = t(this,
|
|
411
|
+
const s = t(this, P).get(e);
|
|
412
412
|
if (!s || s.length === 0) return;
|
|
413
413
|
const r = i.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
414
414
|
if (!r) return;
|
|
415
|
-
r.querySelectorAll("tr:not(.nodata)").forEach((
|
|
416
|
-
const n = r.querySelector("tr.nodata"),
|
|
417
|
-
for (let
|
|
415
|
+
r.querySelectorAll("tr:not(.nodata)").forEach((o) => o.remove());
|
|
416
|
+
const n = r.querySelector("tr.nodata"), a = document.createDocumentFragment();
|
|
417
|
+
for (let o = 0; o < t(this, wt); o++)
|
|
418
418
|
s.forEach((h) => {
|
|
419
|
-
|
|
419
|
+
a.appendChild(h.cloneNode(!0));
|
|
420
420
|
});
|
|
421
|
-
n ? n.before(
|
|
421
|
+
n ? n.before(a) : r.appendChild(a), e === ".ng-container-body" && (t(this, Q).firstTr = r.querySelector("tr:not(.nodata)"));
|
|
422
422
|
}, "#renderRows"));
|
|
423
423
|
d(this, zt, /* @__PURE__ */ c((i) => {
|
|
424
424
|
if (M.log("rowManager.#measureAndCacheHeight"), t(this, _) !== null && t(this, _) > 0)
|
|
425
425
|
return t(this, _);
|
|
426
426
|
M.log("#measureAndCacheHeight");
|
|
427
|
-
const e =
|
|
428
|
-
if (!e
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
f += g.offsetHeight || g.getBoundingClientRect().height;
|
|
442
|
-
}), u.forEach((g) => g.remove()), o.style.display = a, o.style.visibility = h, o.style.position = l, y(this, _, f > 0 ? f : 24), t(this, At).call(this), t(this, _);
|
|
427
|
+
const e = i.querySelector("tbody.bindable-tbody");
|
|
428
|
+
if (M.log(e), !e) throw new Error("invalid dom");
|
|
429
|
+
e.querySelectorAll("tr:not(.nodata)").forEach((u) => u.remove());
|
|
430
|
+
const s = e.querySelector("tr.nodata"), r = document.createDocumentFragment();
|
|
431
|
+
bodyTemplates.forEach((u) => {
|
|
432
|
+
r.appendChild(u.cloneNode(!0));
|
|
433
|
+
}), s ? s.before(r) : e.appendChild(r);
|
|
434
|
+
const n = t(this, S), a = n.style.display, o = n.style.visibility, h = n.style.position;
|
|
435
|
+
(a === "none" || window.getComputedStyle(n).display === "none") && (n.style.display = "block", n.style.visibility = "hidden", n.style.position = "absolute");
|
|
436
|
+
let l = 0;
|
|
437
|
+
const f = e.querySelectorAll("tr:not(.nodata)");
|
|
438
|
+
return f.forEach((u) => {
|
|
439
|
+
l += u.offsetHeight || u.getBoundingClientRect().height;
|
|
440
|
+
}), f.forEach((u) => u.remove()), n.style.display = a, n.style.visibility = o, n.style.position = h, b(this, _, l > 0 ? l : 24), t(this, At).call(this), t(this, _);
|
|
443
441
|
}, "#measureAndCacheHeight"));
|
|
444
442
|
d(this, St, /* @__PURE__ */ c(() => {
|
|
445
443
|
M.log("rowManager.#updateVirtualScrollHeight");
|
|
446
|
-
const e = (t(this,
|
|
444
|
+
const e = (t(this, D).data.get() || []).length, s = t(this, _), r = e * s;
|
|
447
445
|
M.log("🔍 [VirtualHeight]", { totalCount: e, rowHeight: s, totalVirtualHeight: r }), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
448
|
-
const
|
|
449
|
-
if (!
|
|
450
|
-
const
|
|
451
|
-
|
|
446
|
+
const a = t(this, S).querySelector(n);
|
|
447
|
+
if (!a) return;
|
|
448
|
+
const o = a.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
449
|
+
o && (o.style.height = `${r}px`);
|
|
452
450
|
});
|
|
453
451
|
}, "#updateVirtualScrollHeight"));
|
|
454
452
|
d(this, At, /* @__PURE__ */ c(() => {
|
|
455
453
|
if (t(this, tt) > 0 && t(this, _) > 0) {
|
|
456
454
|
const i = Math.ceil(t(this, tt) / t(this, _));
|
|
457
|
-
|
|
455
|
+
b(this, wt, i + t(this, Wt));
|
|
458
456
|
}
|
|
459
457
|
}, "#updateRowCount"));
|
|
460
458
|
d(this, Bt, /* @__PURE__ */ c(() => {
|
|
461
|
-
var
|
|
459
|
+
var o, h, l, f, u, y;
|
|
462
460
|
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");
|
|
463
461
|
if (e) {
|
|
464
|
-
const
|
|
462
|
+
const g = i ? Array.from(i.querySelectorAll("tbody tr")) : [], m = Array.from(e.querySelectorAll("tbody tr")), x = s ? Array.from(s.querySelectorAll("tbody tr")) : [], A = Math.max(g.length, m.length, x.length);
|
|
465
463
|
for (let v = 0; v < A; v++) {
|
|
466
464
|
const I = [
|
|
467
|
-
((
|
|
465
|
+
((o = g[v]) == null ? void 0 : o.getBoundingClientRect().height) || 0,
|
|
468
466
|
((h = m[v]) == null ? void 0 : h.getBoundingClientRect().height) || 0,
|
|
469
467
|
((l = x[v]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
470
468
|
], R = Math.max(...I);
|
|
471
|
-
R > 0 && (
|
|
469
|
+
R > 0 && (g[v] && (g[v].style.height = `${R}px`), m[v] && (m[v].style.height = `${R}px`), x[v] && (x[v].style.height = `${R}px`));
|
|
472
470
|
}
|
|
473
471
|
}
|
|
474
|
-
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"),
|
|
472
|
+
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"), a = t(this, S).querySelector(".ng-container-right .ng-part-footer table");
|
|
475
473
|
if (n) {
|
|
476
|
-
const
|
|
474
|
+
const g = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], m = Array.from(n.querySelectorAll("tfoot tr")), x = a ? Array.from(a.querySelectorAll("tfoot tr")) : [], A = Math.max(g.length, m.length, x.length);
|
|
477
475
|
for (let v = 0; v < A; v++) {
|
|
478
476
|
const I = [
|
|
479
|
-
((f =
|
|
477
|
+
((f = g[v]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
480
478
|
((u = m[v]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
|
|
481
|
-
((
|
|
479
|
+
((y = x[v]) == null ? void 0 : y.getBoundingClientRect().height) || 0
|
|
482
480
|
], R = Math.max(...I);
|
|
483
|
-
R > 0 && (
|
|
481
|
+
R > 0 && (g[v] && (g[v].style.height = `${R}px`), m[v] && (m[v].style.height = `${R}px`), x[v] && (x[v].style.height = `${R}px`));
|
|
484
482
|
}
|
|
485
483
|
}
|
|
486
484
|
}, "#syncRowHeights"));
|
|
487
485
|
d(this, Dt, /* @__PURE__ */ c(() => {
|
|
488
|
-
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (
|
|
486
|
+
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (b(this, V, new ResizeObserver((i) => {
|
|
489
487
|
for (const e of i) {
|
|
490
488
|
const s = e.target;
|
|
491
489
|
if (!s.classList.contains("active")) continue;
|
|
492
490
|
const r = e.contentRect.height;
|
|
493
491
|
if (r > 0) {
|
|
494
492
|
let n = 0;
|
|
495
|
-
const
|
|
496
|
-
|
|
493
|
+
const a = s.querySelector(".ng-part-header"), o = s.querySelector(".ng-part-footer");
|
|
494
|
+
a && (n += a.offsetHeight), o && (n += o.offsetHeight);
|
|
497
495
|
const h = Math.max(r - n, 100);
|
|
498
|
-
t(this, tt) !== h && (
|
|
496
|
+
t(this, tt) !== h && (b(this, tt, h), t(this, At).call(this), t(this, _) !== null && (t(this, Et).call(this), this.refresh()));
|
|
499
497
|
}
|
|
500
498
|
}
|
|
501
499
|
})), t(this, V).observe(t(this, S)));
|
|
@@ -513,15 +511,15 @@ const Ie = class Ie {
|
|
|
513
511
|
if (!s) return;
|
|
514
512
|
const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
515
513
|
if (!r) return;
|
|
516
|
-
const n = Array.from(r.querySelectorAll("tr:not(.nodata)")),
|
|
514
|
+
const n = Array.from(r.querySelectorAll("tr:not(.nodata)")), a = ((l = t(this, P).get(e)) == null ? void 0 : l.length) || 1, h = (t(this, D).data.get() || []).length;
|
|
517
515
|
n.forEach((f, u) => {
|
|
518
|
-
const
|
|
519
|
-
if (
|
|
516
|
+
const y = i + Math.floor(u / a);
|
|
517
|
+
if (y >= h) {
|
|
520
518
|
f.style.visibility = "hidden";
|
|
521
519
|
return;
|
|
522
520
|
}
|
|
523
|
-
const
|
|
524
|
-
f.style.display = "", t(this, qt).call(this, f,
|
|
521
|
+
const g = t(this, D).data.get(y);
|
|
522
|
+
f.style.display = "", t(this, qt).call(this, f, g, y);
|
|
525
523
|
});
|
|
526
524
|
});
|
|
527
525
|
}, "#adjustBufferRows"));
|
|
@@ -529,23 +527,23 @@ const Ie = class Ie {
|
|
|
529
527
|
var f, u;
|
|
530
528
|
const e = t(this, _);
|
|
531
529
|
if (!e || e <= 0) return;
|
|
532
|
-
const s = t(this,
|
|
530
|
+
const s = t(this, D).data.length;
|
|
533
531
|
if (s === 0) return;
|
|
534
|
-
const r = ((f = t(this,
|
|
535
|
-
(u = t(this, Q)) == null || u.scrollTables.forEach((
|
|
536
|
-
|
|
537
|
-
}), l !==
|
|
538
|
-
const
|
|
539
|
-
if (!
|
|
540
|
-
const m =
|
|
532
|
+
const r = ((f = t(this, P).get(".ng-container-body")) == null ? void 0 : f.length) || 1, n = Math.max(0, s - 1), a = Math.min(n, Math.max(0, Math.floor(i / e))), o = Math.floor(a * e), h = t(this, Q).firstTr, l = h && h.dataset.row !== void 0 ? parseInt(h.dataset.row, 10) : -1;
|
|
533
|
+
(u = t(this, Q)) == null || u.scrollTables.forEach((y) => {
|
|
534
|
+
y.style.transform = `translate3d(0, ${o}px, 0)`;
|
|
535
|
+
}), l !== a && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((y) => {
|
|
536
|
+
const g = t(this, S).querySelector(y);
|
|
537
|
+
if (!g) return;
|
|
538
|
+
const m = g.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
541
539
|
if (!m) return;
|
|
542
540
|
Array.from(m.querySelectorAll("tr:not(.nodata)")).forEach((A, v) => {
|
|
543
|
-
const I =
|
|
541
|
+
const I = a + Math.floor(v / r);
|
|
544
542
|
if (I >= s) {
|
|
545
543
|
A.style.display = "none";
|
|
546
544
|
return;
|
|
547
545
|
}
|
|
548
|
-
const R = t(this,
|
|
546
|
+
const R = t(this, D).data.get(I);
|
|
549
547
|
A.style.display = "", t(this, qt).call(this, A, R, I);
|
|
550
548
|
});
|
|
551
549
|
});
|
|
@@ -567,8 +565,8 @@ const Ie = class Ie {
|
|
|
567
565
|
d(this, qt, /* @__PURE__ */ c((i, e, s) => {
|
|
568
566
|
i.dataset.row = s, i.data = e, Array.from(i.cells).forEach((r, n) => {
|
|
569
567
|
r.dataset.row = s;
|
|
570
|
-
const
|
|
571
|
-
|
|
568
|
+
const a = Array.from(r.children).find((o) => o.tagName.toLowerCase().startsWith("cell-") || typeof o.refresh == "function");
|
|
569
|
+
a && typeof a.refresh == "function" && a.refresh();
|
|
572
570
|
});
|
|
573
571
|
}, "#bindRowData"));
|
|
574
572
|
d(this, Pt, /* @__PURE__ */ c(() => {
|
|
@@ -576,30 +574,30 @@ const Ie = class Ie {
|
|
|
576
574
|
M.log("rowManager.#syncHeaderHeights");
|
|
577
575
|
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");
|
|
578
576
|
if (!e) return;
|
|
579
|
-
const r = i ? Array.from(i.querySelectorAll("tr")) : [], n = Array.from(e.querySelectorAll("tr")),
|
|
580
|
-
for (let u = 0; u <
|
|
581
|
-
const
|
|
577
|
+
const r = i ? Array.from(i.querySelectorAll("tr")) : [], n = Array.from(e.querySelectorAll("tr")), a = s ? Array.from(s.querySelectorAll("tr")) : [], o = Math.max(r.length, n.length, a.length);
|
|
578
|
+
for (let u = 0; u < o; u++) {
|
|
579
|
+
const y = [
|
|
582
580
|
((h = r[u]) == null ? void 0 : h.getBoundingClientRect().height) || 0,
|
|
583
581
|
((l = n[u]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
584
|
-
((f =
|
|
585
|
-
],
|
|
586
|
-
|
|
582
|
+
((f = a[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
583
|
+
], g = Math.max(...y);
|
|
584
|
+
g > 0 && (r[u] && (r[u].style.height = `${g}px`), n[u] && (n[u].style.height = `${g}px`), a[u] && (a[u].style.height = `${g}px`));
|
|
587
585
|
}
|
|
588
586
|
}, "#syncHeaderHeights"));
|
|
589
587
|
E(this, "destroy", /* @__PURE__ */ c(() => {
|
|
590
|
-
t(this, V) && (t(this, V).disconnect(),
|
|
588
|
+
t(this, V) && (t(this, V).disconnect(), b(this, V, null));
|
|
591
589
|
}, "destroy"));
|
|
592
|
-
|
|
590
|
+
b(this, D, i.getRootNode().host), b(this, S, i), t(this, Dt).call(this);
|
|
593
591
|
}
|
|
594
592
|
getRowHeight() {
|
|
595
593
|
return t(this, _);
|
|
596
594
|
}
|
|
597
595
|
templateLength(i = ".ng-container-body") {
|
|
598
596
|
var e;
|
|
599
|
-
return ((e = t(this,
|
|
597
|
+
return ((e = t(this, P).get(i)) == null ? void 0 : e.length) || 1;
|
|
600
598
|
}
|
|
601
599
|
};
|
|
602
|
-
|
|
600
|
+
D = new WeakMap(), S = new WeakMap(), Q = new WeakMap(), P = new WeakMap(), _ = new WeakMap(), V = new WeakMap(), tt = new WeakMap(), wt = new WeakMap(), Se = new WeakMap(), Ae = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), zt = new WeakMap(), St = new WeakMap(), At = new WeakMap(), Bt = new WeakMap(), Dt = new WeakMap(), Et = new WeakMap(), Ee = new WeakMap(), lt = new WeakMap(), qt = new WeakMap(), Pt = new WeakMap(), c(Ie, "RowManager");
|
|
603
601
|
let ce = Ie;
|
|
604
602
|
const jt = class jt {
|
|
605
603
|
/**
|
|
@@ -613,64 +611,64 @@ const jt = class jt {
|
|
|
613
611
|
*/
|
|
614
612
|
static compile(i) {
|
|
615
613
|
if (!i) return null;
|
|
616
|
-
const e = /* @__PURE__ */ c((
|
|
617
|
-
|
|
614
|
+
const e = /* @__PURE__ */ c((o) => {
|
|
615
|
+
o.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
|
|
618
616
|
const f = l.getAttribute("cell-type") || "renderer";
|
|
619
617
|
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
620
618
|
let u = `cell-${f}`;
|
|
621
|
-
const
|
|
619
|
+
const y = l.getAttribute("data-bind"), g = l.getAttribute("data-expr"), m = l.getAttribute("maxbyte"), x = l.getAttribute("type");
|
|
622
620
|
let A = [];
|
|
623
|
-
|
|
621
|
+
y && A.push(`data-bind="${y}"`), g && A.push(`data-expr="${g}"`), m && A.push(`maxbyte="${m}"`), x && A.push(`type="${x}"`), l.innerHTML = `<${u} ${A.join(" ")}></${u}>`;
|
|
624
622
|
});
|
|
625
|
-
}, "processCellTypes"), s = /* @__PURE__ */ c((
|
|
626
|
-
if (!
|
|
627
|
-
const h =
|
|
628
|
-
for (let
|
|
629
|
-
const
|
|
630
|
-
|
|
623
|
+
}, "processCellTypes"), s = /* @__PURE__ */ c((o) => {
|
|
624
|
+
if (!o.querySelector("colgroup")) {
|
|
625
|
+
const h = o.querySelector("tbody tr") || o.querySelector("tr"), l = h ? h.querySelectorAll("th, td").length : 1, f = document.createElement("colgroup"), u = Math.max(Math.floor(o.clientWidth / l), 100);
|
|
626
|
+
for (let y = 0; y < l; y++) {
|
|
627
|
+
const g = document.createElement("col");
|
|
628
|
+
g.setAttribute("width", u), f.appendChild(g);
|
|
631
629
|
}
|
|
632
|
-
|
|
630
|
+
o.prepend(f);
|
|
633
631
|
}
|
|
634
|
-
if (!
|
|
635
|
-
const h = document.createElement("thead"), l =
|
|
636
|
-
l ? l.after(h) :
|
|
632
|
+
if (!o.querySelector("thead")) {
|
|
633
|
+
const h = document.createElement("thead"), l = o.querySelector("colgroup");
|
|
634
|
+
l ? l.after(h) : o.prepend(h);
|
|
637
635
|
}
|
|
638
|
-
|
|
639
|
-
}, "ensureTableStructure"), r = /* @__PURE__ */ c((
|
|
640
|
-
const l = Array.from(
|
|
636
|
+
o.classList.add("nine-table-element");
|
|
637
|
+
}, "ensureTableStructure"), r = /* @__PURE__ */ c((o, h) => {
|
|
638
|
+
const l = Array.from(o.querySelectorAll(h + " tr")), f = Array.from(o.querySelectorAll(h + " th," + h + " td")), u = l.length;
|
|
641
639
|
if (u === 0 || f.length === 0) return;
|
|
642
|
-
let
|
|
640
|
+
let y = 0;
|
|
643
641
|
f.forEach((m) => {
|
|
644
|
-
|
|
642
|
+
y += m.colSpan || 1;
|
|
645
643
|
});
|
|
646
|
-
const
|
|
644
|
+
const g = Array.from(Array(u), () => Array(y).fill(null));
|
|
647
645
|
l.forEach((m) => {
|
|
648
646
|
const x = m.sectionRowIndex;
|
|
649
647
|
let A = 0;
|
|
650
648
|
Array.from(m.querySelectorAll("th,td")).forEach((v) => {
|
|
651
|
-
for (let z = 0; z <
|
|
652
|
-
if (
|
|
649
|
+
for (let z = 0; z < g[x].length; z++)
|
|
650
|
+
if (g[x][z] === null) {
|
|
653
651
|
A = z;
|
|
654
652
|
break;
|
|
655
653
|
}
|
|
656
654
|
const I = v.rowSpan || 1, R = v.colSpan || 1;
|
|
657
655
|
for (let z = 0; z < I; z++)
|
|
658
656
|
for (let yt = 0; yt < R; yt++)
|
|
659
|
-
x + z < u && A + yt <
|
|
657
|
+
x + z < u && A + yt < y && (g[x + z][A + yt] = z === 0 && yt === 0 ? "1" : "0");
|
|
660
658
|
});
|
|
661
659
|
}), l.forEach((m) => {
|
|
662
660
|
const x = m.sectionRowIndex;
|
|
663
661
|
Array.from(m.querySelectorAll("th,td")).forEach((A) => {
|
|
664
|
-
for (let v = 0; v <
|
|
665
|
-
if (
|
|
666
|
-
A.dataset.col = v,
|
|
662
|
+
for (let v = 0; v < g[x].length; v++)
|
|
663
|
+
if (g[x][v] === "1") {
|
|
664
|
+
A.dataset.col = v, g[x][v] = "0";
|
|
667
665
|
break;
|
|
668
666
|
}
|
|
669
667
|
});
|
|
670
668
|
});
|
|
671
669
|
}, "resetColIndex"), n = i.cloneNode(!0);
|
|
672
|
-
return s(n), e(n), r(n, "thead"), r(n, "tbody"), r(n, "tfoot"), Array.from(n.querySelectorAll("colgroup col")).forEach((
|
|
673
|
-
const l =
|
|
670
|
+
return s(n), e(n), r(n, "thead"), r(n, "tbody"), r(n, "tfoot"), Array.from(n.querySelectorAll("colgroup col")).forEach((o, h) => {
|
|
671
|
+
const l = o.getAttribute("fixed");
|
|
674
672
|
l && n.querySelectorAll(`thead [data-col="${h}"], tbody [data-col="${h}"], tfoot [data-col="${h}"]`).forEach((f) => {
|
|
675
673
|
f.setAttribute("fixed", l);
|
|
676
674
|
});
|
|
@@ -696,8 +694,8 @@ const pt = class pt extends HTMLElement {
|
|
|
696
694
|
{ selector: ".ng-container-left", type: "left" },
|
|
697
695
|
{ selector: ".ng-container-right", type: "right" }
|
|
698
696
|
].forEach(({ selector: s, type: r }) => {
|
|
699
|
-
var n,
|
|
700
|
-
(n = this.querySelector(`${s} .ng-part-header`)) == null || n.appendChild(t(this, ct).call(this, t(this, et), r, "header")), (
|
|
697
|
+
var n, a, o;
|
|
698
|
+
(n = this.querySelector(`${s} .ng-part-header`)) == null || n.appendChild(t(this, ct).call(this, t(this, et), r, "header")), (a = this.querySelector(`${s} .ng-virtual-spacer`)) == null || a.before(t(this, ct).call(this, t(this, et), r, "body")), (o = this.querySelector(`${s} .ng-part-footer`)) == null || o.appendChild(t(this, ct).call(this, t(this, et), r, "footer"));
|
|
701
699
|
});
|
|
702
700
|
}, "#renderSplitContainers"));
|
|
703
701
|
d(this, Yt, /* @__PURE__ */ c(() => {
|
|
@@ -705,29 +703,29 @@ const pt = class pt extends HTMLElement {
|
|
|
705
703
|
const s = this.querySelector(`.ng-container-${e}`), r = s == null ? void 0 : s.querySelectorAll("table");
|
|
706
704
|
if (!s || !r || r.length === 0) return;
|
|
707
705
|
let n = 0;
|
|
708
|
-
r[0].querySelectorAll("col").forEach((
|
|
709
|
-
const
|
|
710
|
-
isNaN(n) || (n +=
|
|
706
|
+
r[0].querySelectorAll("col").forEach((a) => {
|
|
707
|
+
const o = parseInt(a.getAttribute("width"), 10);
|
|
708
|
+
isNaN(n) || (n += o);
|
|
711
709
|
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${n}px`, s.style.width = `${n}px`);
|
|
712
710
|
});
|
|
713
711
|
}, "#updateContainerWidths"));
|
|
714
712
|
E(this, "generate", /* @__PURE__ */ c((e) => {
|
|
715
713
|
if (!e) return;
|
|
716
|
-
|
|
714
|
+
b(this, et, he.compile(e)), t(this, Vt).call(this), t(this, Yt).call(this);
|
|
717
715
|
const s = this.querySelector(".ng-container-body .ng-part-header"), r = this.querySelector(".ng-container-body .ng-part-footer"), n = this.querySelector(".ng-nodata-overlay");
|
|
718
716
|
s && n && (n.style.top = `${s.offsetHeight}px`), r && n && (n.style.bottom = `${r.offsetHeight}px`), t(this, st).initialize(), setTimeout(() => {
|
|
719
|
-
var
|
|
720
|
-
(
|
|
717
|
+
var a;
|
|
718
|
+
(a = this.querySelector("nine-table-hscrollbar")) == null || a.refresh();
|
|
721
719
|
}, 0);
|
|
722
720
|
}, "generate"));
|
|
723
721
|
d(this, ct, /* @__PURE__ */ c((e, s, r) => {
|
|
724
|
-
const n = e.cloneNode(!0),
|
|
722
|
+
const n = e.cloneNode(!0), a = n.querySelector("thead"), o = n.querySelector("tbody"), h = n.querySelector("tfoot");
|
|
725
723
|
if (r === "header") {
|
|
726
|
-
if (
|
|
724
|
+
if (o && o.remove(), h && h.remove(), e.querySelector("tbody")) {
|
|
727
725
|
const f = document.createElement("tbody");
|
|
728
726
|
f.className = "fixed-tbody", n.appendChild(f);
|
|
729
727
|
}
|
|
730
|
-
} else r === "body" ? (
|
|
728
|
+
} else r === "body" ? (a && a.remove(), h && h.remove(), o && (o.className = "bindable-tbody")) : r === "footer" && (a && a.remove(), o && o.remove());
|
|
731
729
|
return s === "left" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
732
730
|
l.getAttribute("fixed") !== "left" && l.remove();
|
|
733
731
|
}) : s === "right" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
@@ -937,7 +935,7 @@ const pt = class pt extends HTMLElement {
|
|
|
937
935
|
</div>
|
|
938
936
|
`;
|
|
939
937
|
}, "#render"));
|
|
940
|
-
|
|
938
|
+
b(this, st, new ce(this)), b(this, Ft, this.getRootNode().host);
|
|
941
939
|
}
|
|
942
940
|
connectedCallback() {
|
|
943
941
|
t(this, Ut).call(this);
|
|
@@ -956,38 +954,38 @@ const _e = class _e extends HTMLElement {
|
|
|
956
954
|
d(this, Kt, /* @__PURE__ */ c(() => {
|
|
957
955
|
var e;
|
|
958
956
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
959
|
-
var
|
|
960
|
-
const r = s.ctrlKey || s.metaKey || s.shiftKey, n = parseInt((
|
|
957
|
+
var a;
|
|
958
|
+
const r = s.ctrlKey || s.metaKey || s.shiftKey, n = parseInt((a = s.target.closest(".nine-tab-item")) == null ? void 0 : a.dataset.index, 10);
|
|
961
959
|
t(this, Rt).call(this, n, r);
|
|
962
960
|
}), t(this, Rt).call(this, 0, !1);
|
|
963
961
|
}, "#init"));
|
|
964
962
|
d(this, Rt, /* @__PURE__ */ c((e, s = !1) => {
|
|
965
963
|
const r = /* @__PURE__ */ c(() => {
|
|
966
964
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
967
|
-
Array.from(this.querySelectorAll("nine-splitter")).forEach((
|
|
968
|
-
const
|
|
969
|
-
|
|
970
|
-
const m = parseInt(
|
|
965
|
+
Array.from(this.querySelectorAll("nine-splitter")).forEach((g) => g.style.setProperty("display", "none"));
|
|
966
|
+
const y = f.filter((g) => g.classList.contains("active"));
|
|
967
|
+
y.length < 2 || y.forEach((g) => {
|
|
968
|
+
const m = parseInt(g.getAttribute("data-index"), 10), x = this.querySelector(`nine-splitter[data-split-index="${m}"]`), A = f[m + 1];
|
|
971
969
|
x && A && A.classList.contains("active") && x.style.setProperty("display", "flex");
|
|
972
970
|
});
|
|
973
|
-
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"),
|
|
974
|
-
if (!
|
|
971
|
+
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"), a = this.querySelector("nine-table-sheets-body"), o = n.querySelectorAll(".nine-tab-item"), h = a.querySelectorAll("nine-table-sheet");
|
|
972
|
+
if (!o[e]) return;
|
|
975
973
|
if (!s)
|
|
976
|
-
|
|
974
|
+
o.forEach((f, u) => {
|
|
977
975
|
f.classList.toggle("active", u === e);
|
|
978
976
|
}), h.forEach((f, u) => {
|
|
979
|
-
const
|
|
980
|
-
f.classList.toggle("active",
|
|
977
|
+
const y = u === e;
|
|
978
|
+
f.classList.toggle("active", y), f.style.flex = y ? "1 1 100%" : "";
|
|
981
979
|
});
|
|
982
980
|
else {
|
|
983
|
-
const f =
|
|
981
|
+
const f = o[e], u = n.querySelectorAll(".nine-tab-item.active");
|
|
984
982
|
if (f.classList.contains("active") && u.length <= 1)
|
|
985
983
|
return;
|
|
986
984
|
f.classList.toggle("active");
|
|
987
|
-
const
|
|
988
|
-
|
|
985
|
+
const y = a.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
986
|
+
y && (y.classList.toggle("active"), y.classList.contains("active") || (y.style.flex = ""));
|
|
989
987
|
}
|
|
990
|
-
const l =
|
|
988
|
+
const l = a.querySelectorAll("nine-table-sheet.active");
|
|
991
989
|
l == null || l.forEach((f) => {
|
|
992
990
|
f.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
993
991
|
}), r();
|
|
@@ -1014,14 +1012,14 @@ const Ne = class Ne {
|
|
|
1014
1012
|
var h, l;
|
|
1015
1013
|
const i = Array.from(t(this, H).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
1016
1014
|
if (i.length === 0) return;
|
|
1017
|
-
const e = parseInt(t(this, H).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), r = (h = t(this, H).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : h.getBoundingClientRect().height, n = (l = t(this, H).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height,
|
|
1018
|
-
t(this, H).style.height = `${
|
|
1015
|
+
const e = parseInt(t(this, H).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), r = (h = t(this, H).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : h.getBoundingClientRect().height, n = (l = t(this, H).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, a = $t.SCROLLBAR_SIZE, o = e * s + r + n + a;
|
|
1016
|
+
t(this, H).style.height = `${o}px`;
|
|
1019
1017
|
}, "#applyAutoHeight"));
|
|
1020
1018
|
d(this, Gt, /* @__PURE__ */ c(() => {
|
|
1021
1019
|
const e = Array.from(t(this, H).children).filter((h) => h.tagName === "TABLE"), s = t(this, H).getAttribute("auto-height") === "true", r = e.length, n = e.map((h, l) => {
|
|
1022
|
-
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`,
|
|
1023
|
-
return u +
|
|
1024
|
-
}).join(""),
|
|
1020
|
+
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, y = l < r - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
1021
|
+
return u + y;
|
|
1022
|
+
}).join(""), a = e.map((h, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
1025
1023
|
t(this, H).shadowRoot.innerHTML = `
|
|
1026
1024
|
<style>
|
|
1027
1025
|
:host {
|
|
@@ -1135,7 +1133,7 @@ const Ne = class Ne {
|
|
|
1135
1133
|
<nine-table-sheets>
|
|
1136
1134
|
<nine-table-sheets-body>${n}</nine-table-sheets-body>
|
|
1137
1135
|
<nine-table-sheets-footer>
|
|
1138
|
-
<div class="nine-tab-bar">${
|
|
1136
|
+
<div class="nine-tab-bar">${a}</div>
|
|
1139
1137
|
<div class="sheets-counter">Total : <span id="row-count">0</span></div>
|
|
1140
1138
|
</nine-table-sheets-footer>
|
|
1141
1139
|
</nine-table-sheets>
|
|
@@ -1143,14 +1141,14 @@ const Ne = class Ne {
|
|
|
1143
1141
|
</nine-table-body>
|
|
1144
1142
|
<nine-table-footer></nine-table-footer>
|
|
1145
1143
|
`, t(this, H).shadowRoot.querySelector("nine-table-sheets").classList.add("nodata");
|
|
1146
|
-
const
|
|
1147
|
-
|
|
1144
|
+
const o = t(this, H).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1145
|
+
o == null || o.forEach((h, l) => {
|
|
1148
1146
|
e[l] && setTimeout(() => {
|
|
1149
1147
|
h.generate(e[l]), s && t(this, Tt).call(this);
|
|
1150
1148
|
});
|
|
1151
1149
|
});
|
|
1152
1150
|
}, "#render"));
|
|
1153
|
-
|
|
1151
|
+
b(this, H, i), t(this, Zt).call(this);
|
|
1154
1152
|
}
|
|
1155
1153
|
};
|
|
1156
1154
|
H = new WeakMap(), Zt = new WeakMap(), Tt = new WeakMap(), Gt = new WeakMap(), c(Ne, "LayoutManager");
|
|
@@ -1161,19 +1159,19 @@ const We = class We {
|
|
|
1161
1159
|
d(this, kt);
|
|
1162
1160
|
d(this, ht, -1);
|
|
1163
1161
|
E(this, "count", /* @__PURE__ */ c(() => t(this, kt).rawRecords.length, "count"));
|
|
1164
|
-
|
|
1162
|
+
b(this, kt, i);
|
|
1165
1163
|
}
|
|
1166
1164
|
get at() {
|
|
1167
1165
|
return t(this, ht);
|
|
1168
1166
|
}
|
|
1169
1167
|
set at(i) {
|
|
1170
|
-
|
|
1168
|
+
b(this, ht, parseInt(i, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, ht)}"]`) && setTimeout(() => {
|
|
1171
1169
|
});
|
|
1172
1170
|
}
|
|
1173
1171
|
};
|
|
1174
1172
|
kt = new WeakMap(), ht = new WeakMap(), c(We, "ngRow");
|
|
1175
1173
|
let ue = We;
|
|
1176
|
-
var N, k, W, dt, Jt, Y, Qt, it,
|
|
1174
|
+
var N, k, W, dt, Jt, Y, Qt, it, Ct, te, ee, ft;
|
|
1177
1175
|
const O = class O {
|
|
1178
1176
|
constructor(i, e) {
|
|
1179
1177
|
d(this, N);
|
|
@@ -1183,13 +1181,13 @@ const O = class O {
|
|
|
1183
1181
|
d(this, Jt, 0);
|
|
1184
1182
|
d(this, Y, []);
|
|
1185
1183
|
d(this, Qt, /* @__PURE__ */ c(() => {
|
|
1186
|
-
|
|
1184
|
+
b(this, Y, []);
|
|
1187
1185
|
const i = t(this, N).template || [];
|
|
1188
1186
|
Array.from(i).forEach((e) => {
|
|
1189
1187
|
var s;
|
|
1190
1188
|
t(this, Y).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1191
1189
|
}), (t(this, k).rawRecords || []).forEach((e) => {
|
|
1192
|
-
e.__ng || (e.__ng = t(this,
|
|
1190
|
+
e.__ng || (e.__ng = t(this, Ct).call(this)), e.__ng.height = t(this, Y).slice();
|
|
1193
1191
|
});
|
|
1194
1192
|
}, "#initialize"));
|
|
1195
1193
|
d(this, it, /* @__PURE__ */ c(() => {
|
|
@@ -1206,15 +1204,15 @@ const O = class O {
|
|
|
1206
1204
|
if (i < 0 || i >= s.length) return null;
|
|
1207
1205
|
const r = typeof ((n = t(this, N).fields) == null ? void 0 : n.get) == "function" ? t(this, N).fields.get() : [];
|
|
1208
1206
|
if (e != null) {
|
|
1209
|
-
const
|
|
1210
|
-
return
|
|
1207
|
+
const a = r.indexOf(e);
|
|
1208
|
+
return a >= 0 ? s[i].v[a] : null;
|
|
1211
1209
|
}
|
|
1212
1210
|
return t(this, ft).call(this, s[i]);
|
|
1213
1211
|
}, "get"));
|
|
1214
1212
|
E(this, "set", /* @__PURE__ */ c((i) => {
|
|
1215
1213
|
this.clear(), this.add(i, !1), t(this, it).call(this);
|
|
1216
1214
|
}, "set"));
|
|
1217
|
-
d(this,
|
|
1215
|
+
d(this, Ct, /* @__PURE__ */ c(() => ({
|
|
1218
1216
|
rowState: O.ROW_STATE.EMPTY,
|
|
1219
1217
|
deleted: !1,
|
|
1220
1218
|
filtered: !1,
|
|
@@ -1224,34 +1222,34 @@ const O = class O {
|
|
|
1224
1222
|
_: [0, 0, 0, 0, O.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Y).slice(), -1, {}, {}]
|
|
1225
1223
|
}), "#getDefaultMeta"));
|
|
1226
1224
|
E(this, "reset", /* @__PURE__ */ c(() => {
|
|
1227
|
-
|
|
1225
|
+
b(this, W, []), b(this, dt, []), t(this, it).call(this);
|
|
1228
1226
|
}, "reset"));
|
|
1229
1227
|
E(this, "clear", /* @__PURE__ */ c(() => {
|
|
1230
1228
|
var i;
|
|
1231
|
-
t(this, k).rawRecords = [],
|
|
1229
|
+
t(this, k).rawRecords = [], b(this, W, []), b(this, dt, []), (i = t(this, k).viewRecords) != null && i.reset && t(this, k).viewRecords.reset();
|
|
1232
1230
|
}, "clear"));
|
|
1233
1231
|
d(this, te, /* @__PURE__ */ c((i) => {
|
|
1234
1232
|
var r;
|
|
1235
1233
|
Array.isArray(i) || (i = [i]);
|
|
1236
1234
|
const e = typeof ((r = t(this, N).fields) == null ? void 0 : r.get) == "function" ? t(this, N).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
1237
1235
|
return i.forEach((n) => {
|
|
1238
|
-
const
|
|
1239
|
-
e.forEach((
|
|
1240
|
-
|
|
1241
|
-
}), s.push(
|
|
1236
|
+
const a = { v: [] };
|
|
1237
|
+
e.forEach((o) => {
|
|
1238
|
+
a.v.push(n[o] !== void 0 && n[o] !== null ? n[o] : "");
|
|
1239
|
+
}), s.push(a);
|
|
1242
1240
|
}), s;
|
|
1243
1241
|
}, "#json2Array"));
|
|
1244
1242
|
d(this, ee, /* @__PURE__ */ c((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1245
|
-
e.__ng = t(this,
|
|
1243
|
+
e.__ng = t(this, Ct).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = O.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1246
1244
|
}), i), "#defaultInsert"));
|
|
1247
1245
|
E(this, "add", /* @__PURE__ */ c((i, e = !0) => {
|
|
1248
1246
|
i === void 0 && (i = {});
|
|
1249
1247
|
const s = t(this, te).call(this, i);
|
|
1250
1248
|
t(this, k).rawRecords = t(this, k).rawRecords.concat(t(this, ee).call(this, s)), this.resetRecords();
|
|
1251
1249
|
const r = this.count() - 1;
|
|
1252
|
-
return e || s.forEach((n,
|
|
1253
|
-
const
|
|
1254
|
-
|
|
1250
|
+
return e || s.forEach((n, a) => {
|
|
1251
|
+
const o = t(this, k).rawRecords[r - a];
|
|
1252
|
+
o && (o.__ng.rowState = O.ROW_STATE.EMPTY);
|
|
1255
1253
|
}), t(this, it).call(this), r;
|
|
1256
1254
|
}, "add"));
|
|
1257
1255
|
E(this, "delete", /* @__PURE__ */ c((i) => {
|
|
@@ -1270,13 +1268,13 @@ const O = class O {
|
|
|
1270
1268
|
i = parseInt(i, 10);
|
|
1271
1269
|
const n = (typeof ((h = t(this, N).fields) == null ? void 0 : h.get) == "function" ? t(this, N).fields.get() : []).indexOf(e);
|
|
1272
1270
|
if (n < 0) return;
|
|
1273
|
-
const
|
|
1274
|
-
if (!
|
|
1275
|
-
const
|
|
1276
|
-
|
|
1271
|
+
const a = this.getValidData()[i];
|
|
1272
|
+
if (!a) return;
|
|
1273
|
+
const o = a.v[n];
|
|
1274
|
+
o !== s && a.__ng.rowState !== O.ROW_STATE.INSERT && (a.__ng.o.hasOwnProperty(e) || (a.__ng.o[e] = o), a.__ng.rowState = O.ROW_STATE.UPDATE), a.v[n] = s;
|
|
1277
1275
|
}, "setValue"));
|
|
1278
1276
|
E(this, "resetRecords", /* @__PURE__ */ c(() => {
|
|
1279
|
-
|
|
1277
|
+
b(this, dt, t(this, k).rawRecords.filter((i) => !i.__ng.deleted)), b(this, W, t(this, k).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, k).rawRecords.forEach((i, e) => {
|
|
1280
1278
|
i.__ng.rowidx = e;
|
|
1281
1279
|
}), t(this, W).forEach((i, e) => {
|
|
1282
1280
|
i.__ng.i = e;
|
|
@@ -1284,18 +1282,18 @@ const O = class O {
|
|
|
1284
1282
|
}, "resetRecords"));
|
|
1285
1283
|
E(this, "getValidData", /* @__PURE__ */ c(() => (t(this, W).length === 0 && t(this, k).rawRecords.length > 0 && this.resetRecords(), t(this, W)), "getValidData"));
|
|
1286
1284
|
d(this, ft, /* @__PURE__ */ c((i) => {
|
|
1287
|
-
var
|
|
1285
|
+
var a;
|
|
1288
1286
|
if (!i) return i;
|
|
1289
|
-
const e = !Array.isArray(i), s = e ? [i] : i, r = typeof ((
|
|
1287
|
+
const e = !Array.isArray(i), s = e ? [i] : i, r = typeof ((a = t(this, N).fields) == null ? void 0 : a.get) == "function" ? t(this, N).fields.get() : [], n = s.filter((o) => !o.__ng.deleted).map((o) => {
|
|
1290
1288
|
const h = {};
|
|
1291
1289
|
return r.forEach((l, f) => {
|
|
1292
|
-
h[l] =
|
|
1293
|
-
}), h.__ng =
|
|
1290
|
+
h[l] = o.v ? o.v[f] : o[l];
|
|
1291
|
+
}), h.__ng = o.__ng, h;
|
|
1294
1292
|
});
|
|
1295
1293
|
return e ? n[0] : n;
|
|
1296
1294
|
}, "#conv"));
|
|
1297
1295
|
E(this, "count", /* @__PURE__ */ c(() => this.getValidData().length, "count"));
|
|
1298
|
-
|
|
1296
|
+
b(this, N, i), b(this, k, e), t(this, Qt).call(this);
|
|
1299
1297
|
}
|
|
1300
1298
|
get source() {
|
|
1301
1299
|
return t(this, ft).call(this, t(this, k).rawRecords);
|
|
@@ -1316,7 +1314,7 @@ const O = class O {
|
|
|
1316
1314
|
return this.length;
|
|
1317
1315
|
}
|
|
1318
1316
|
};
|
|
1319
|
-
N = new WeakMap(), k = new WeakMap(), W = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), Y = new WeakMap(), Qt = new WeakMap(), it = new WeakMap(),
|
|
1317
|
+
N = new WeakMap(), k = new WeakMap(), W = 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(O, "ngData"), // 🎯 행 상태 정의 상수를 클래스 내부로 내재화
|
|
1320
1318
|
E(O, "ROW_STATE", {
|
|
1321
1319
|
EMPTY: "EMPTY",
|
|
1322
1320
|
NORMAL: "NORMAL",
|
|
@@ -1329,7 +1327,7 @@ var rt;
|
|
|
1329
1327
|
const Oe = class Oe {
|
|
1330
1328
|
constructor(i) {
|
|
1331
1329
|
d(this, rt);
|
|
1332
|
-
|
|
1330
|
+
b(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 = () => {
|
|
1333
1331
|
var e;
|
|
1334
1332
|
(e = t(this, rt).view) != null && e.redraw && t(this, rt).view.redraw();
|
|
1335
1333
|
}, this.setDataSource = (e) => {
|
|
@@ -1348,78 +1346,78 @@ const Oe = class Oe {
|
|
|
1348
1346
|
};
|
|
1349
1347
|
rt = new WeakMap(), c(Oe, "ngDataManager");
|
|
1350
1348
|
let be = Oe;
|
|
1351
|
-
var ut,
|
|
1349
|
+
var ut, L, Lt, se;
|
|
1352
1350
|
const ze = class ze {
|
|
1353
1351
|
// 🎯 이제 { name: string, type: string } 객체들의 배열로 관리합니다.
|
|
1354
1352
|
constructor(i) {
|
|
1355
1353
|
d(this, ut);
|
|
1356
|
-
d(this,
|
|
1354
|
+
d(this, L, []);
|
|
1357
1355
|
E(this, "add", /* @__PURE__ */ c((i, e = "string") => {
|
|
1358
1356
|
i.forEach((s) => {
|
|
1359
|
-
t(this,
|
|
1360
|
-
}), t(this,
|
|
1357
|
+
t(this, L).some((r) => r.name === s) || t(this, L).push({ name: s, type: e });
|
|
1358
|
+
}), t(this, Lt).call(this);
|
|
1361
1359
|
}, "add"));
|
|
1362
|
-
d(this,
|
|
1360
|
+
d(this, Lt, /* @__PURE__ */ c(() => {
|
|
1363
1361
|
const i = /* @__PURE__ */ new Map();
|
|
1364
|
-
t(this,
|
|
1362
|
+
t(this, L).forEach((e) => {
|
|
1365
1363
|
i.set(e.name, e.type);
|
|
1366
|
-
}),
|
|
1364
|
+
}), b(this, L, Array.from(i, ([e, s]) => ({ name: e, type: s }))), b(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);
|
|
1367
1365
|
}, "#adjust"));
|
|
1368
1366
|
d(this, se, /* @__PURE__ */ c(() => {
|
|
1369
|
-
|
|
1367
|
+
b(this, L, []), M.log(t(this, ut).querySelectorAll("table"));
|
|
1370
1368
|
const i = Array.from(t(this, ut).querySelectorAll("table"));
|
|
1371
1369
|
if (!(!i || i.length === 0)) {
|
|
1372
1370
|
for (const e of i)
|
|
1373
1371
|
M.log(e), $("[data-bind]", e).each((s, r) => {
|
|
1374
|
-
const n = r.dataset.bind,
|
|
1375
|
-
n && t(this,
|
|
1372
|
+
const n = r.dataset.bind, a = r.getAttribute("data-type") || "string";
|
|
1373
|
+
n && t(this, L).push({ name: n, type: a });
|
|
1376
1374
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
1377
1375
|
$(`[${s}]`, e).each((r, n) => {
|
|
1378
|
-
var
|
|
1379
|
-
if (
|
|
1380
|
-
const
|
|
1381
|
-
if (
|
|
1376
|
+
var a = n.getAttribute(s);
|
|
1377
|
+
if (a.indexOf("data.") < 0) {
|
|
1378
|
+
const o = a.search(/[(]/g);
|
|
1379
|
+
if (o > 0)
|
|
1382
1380
|
try {
|
|
1383
|
-
|
|
1381
|
+
a = String(window[a.substring(0, o).trim()]);
|
|
1384
1382
|
} catch {
|
|
1385
|
-
|
|
1383
|
+
a = "";
|
|
1386
1384
|
}
|
|
1387
1385
|
}
|
|
1388
|
-
|
|
1389
|
-
if (
|
|
1390
|
-
const h =
|
|
1386
|
+
a.split("data.").forEach((o) => {
|
|
1387
|
+
if (o.trim() != "") {
|
|
1388
|
+
const h = o.search(/[^_A-Za-z0-9]/g);
|
|
1391
1389
|
let l = "";
|
|
1392
|
-
h >= 0 ? l =
|
|
1390
|
+
h >= 0 ? l = o.substring(0, h) : a.startsWith("data.") && (l = o.replace("data.", "")), l && t(this, L).push({ name: l, type: "string" });
|
|
1393
1391
|
}
|
|
1394
1392
|
});
|
|
1395
1393
|
});
|
|
1396
1394
|
});
|
|
1397
|
-
t(this,
|
|
1395
|
+
t(this, Lt).call(this);
|
|
1398
1396
|
}
|
|
1399
1397
|
}, "#init"));
|
|
1400
|
-
|
|
1398
|
+
b(this, ut, i), t(this, se).call(this);
|
|
1401
1399
|
}
|
|
1402
1400
|
// 🎯 기존에 필드 이름만 쓰던 곳들과의 호환을 위해 이름 배열만 리턴하는 메서드 유지
|
|
1403
1401
|
get() {
|
|
1404
|
-
return t(this,
|
|
1402
|
+
return t(this, L).map((i) => i.name);
|
|
1405
1403
|
}
|
|
1406
1404
|
// 🎯 내부 객체 통째로 얻기
|
|
1407
1405
|
getFields() {
|
|
1408
|
-
return t(this,
|
|
1406
|
+
return t(this, L);
|
|
1409
1407
|
}
|
|
1410
1408
|
// 🎯 특정 필드의 데이터 타입 조회
|
|
1411
1409
|
getType(i) {
|
|
1412
|
-
const e = t(this,
|
|
1410
|
+
const e = t(this, L).find((s) => s.name === i);
|
|
1413
1411
|
return e ? e.type : "string";
|
|
1414
1412
|
}
|
|
1415
1413
|
indexOf(i) {
|
|
1416
|
-
return t(this,
|
|
1414
|
+
return t(this, L).findIndex((e) => e.name === i);
|
|
1417
1415
|
}
|
|
1418
1416
|
includes(i) {
|
|
1419
|
-
return t(this,
|
|
1417
|
+
return t(this, L).some((e) => e.name === i);
|
|
1420
1418
|
}
|
|
1421
1419
|
};
|
|
1422
|
-
ut = new WeakMap(),
|
|
1420
|
+
ut = new WeakMap(), L = new WeakMap(), Lt = new WeakMap(), se = new WeakMap(), c(ze, "ngFields");
|
|
1423
1421
|
let ye = ze;
|
|
1424
1422
|
var nt, ie, re;
|
|
1425
1423
|
const Be = class Be extends HTMLElement {
|
|
@@ -1429,9 +1427,9 @@ const Be = class Be extends HTMLElement {
|
|
|
1429
1427
|
d(this, nt);
|
|
1430
1428
|
d(this, ie);
|
|
1431
1429
|
d(this, re, /* @__PURE__ */ c(() => {
|
|
1432
|
-
this.fields = new ye(this),
|
|
1430
|
+
this.fields = new ye(this), b(this, ie, new fe(this)), M.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1433
1431
|
}, "#init"));
|
|
1434
|
-
this.attachShadow({ mode: "open" }),
|
|
1432
|
+
this.attachShadow({ mode: "open" }), b(this, nt, new be(this));
|
|
1435
1433
|
}
|
|
1436
1434
|
connectedCallback() {
|
|
1437
1435
|
t(this, re).call(this);
|
|
@@ -1468,11 +1466,11 @@ const mt = class mt extends HTMLElement {
|
|
|
1468
1466
|
};
|
|
1469
1467
|
c(mt, "BasicCellElement"), E(mt, "_styleCache", /* @__PURE__ */ new Map()), E(mt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1470
1468
|
let me = mt;
|
|
1471
|
-
var
|
|
1469
|
+
var C, Ht, p, qe, Re, Te, ke, Ce;
|
|
1472
1470
|
const De = class De extends me {
|
|
1473
1471
|
constructor() {
|
|
1474
1472
|
super();
|
|
1475
|
-
d(this,
|
|
1473
|
+
d(this, C);
|
|
1476
1474
|
d(this, Ht);
|
|
1477
1475
|
d(this, p);
|
|
1478
1476
|
d(this, qe);
|
|
@@ -1495,12 +1493,12 @@ const De = class De extends me {
|
|
|
1495
1493
|
return ninegrid.nvl(e, "");
|
|
1496
1494
|
} else
|
|
1497
1495
|
try {
|
|
1498
|
-
return t(this,
|
|
1496
|
+
return t(this, C).exprFunction(t(this, p).dataset.expr).call(this, null, -1, t(this, C).data);
|
|
1499
1497
|
} catch {
|
|
1500
1498
|
}
|
|
1501
1499
|
}, "getDisplayText"));
|
|
1502
|
-
d(this,
|
|
1503
|
-
if (!(!t(this,
|
|
1500
|
+
d(this, Ce, /* @__PURE__ */ c(() => {
|
|
1501
|
+
if (!(!t(this, C) || !t(this, C).template || !t(this, p).closest("tbody.bindable"))) {
|
|
1504
1502
|
var e = ninegrid.j.querySelectorAll(t(this, p)).attr("suppress");
|
|
1505
1503
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1506
1504
|
var s = t(this, p).closest("tr"), r = [];
|
|
@@ -1509,13 +1507,13 @@ const De = class De extends me {
|
|
|
1509
1507
|
R && I.dataset.row && (R = parseInt(R), !isNaN(R) && R <= e && r.push(R));
|
|
1510
1508
|
}), r.sort();
|
|
1511
1509
|
var n = !1;
|
|
1512
|
-
if (parseInt(s.sectionRowIndex / t(this,
|
|
1513
|
-
for (var
|
|
1514
|
-
if (
|
|
1515
|
-
var
|
|
1510
|
+
if (parseInt(s.sectionRowIndex / t(this, C).template.length) > 0)
|
|
1511
|
+
for (var a of r) {
|
|
1512
|
+
if (a > e) break;
|
|
1513
|
+
var o = parseInt(t(this, p).dataset.row), h = o - 1, l = t(this, p).closest("tr").data, f = t(this, C).data.get(h);
|
|
1516
1514
|
t(this, p).dataset.matrixRow;
|
|
1517
|
-
var u = t(this,
|
|
1518
|
-
if (
|
|
1515
|
+
var u = t(this, C).body.querySelector(`tbody.bindable [suppress="${a}"][data-matrix-row="${t(this, p).dataset.matrixRow}"]`), y = u.dataset.expr ? this.getExprValue(u.dataset.expr, l, o) : l[u.dataset.bind], g = u.dataset.expr ? this.getExprValue(u.dataset.expr, f, h) : f[u.dataset.bind];
|
|
1516
|
+
if (y != g) {
|
|
1519
1517
|
n = !0;
|
|
1520
1518
|
break;
|
|
1521
1519
|
}
|
|
@@ -1523,7 +1521,7 @@ const De = class De extends me {
|
|
|
1523
1521
|
else
|
|
1524
1522
|
n = !0;
|
|
1525
1523
|
n ? ninegrid.j.querySelectorAll(t(this, p)).removeClass("suppress") : ninegrid.j.querySelectorAll(t(this, p)).addClass("suppress"), ninegrid.j.querySelectorAll(t(this, p)).hasClass("hidden") || (n ? ninegrid.j.querySelectorAll(t(this, p)).removeClass("hidden") : ninegrid.j.querySelectorAll(t(this, p)).addClass("hidden"));
|
|
1526
|
-
var m = parseInt(t(this, p).dataset.matrixRow), x = m - 1, A = t(this,
|
|
1524
|
+
var m = parseInt(t(this, p).dataset.matrixRow), x = m - 1, A = t(this, C).body.querySelector(`tbody.bindable [data-col="${t(this, p).dataset.col}"][data-matrix-row="${x}"]`);
|
|
1527
1525
|
$(A).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this, p)).hasClass("suppress") ? ninegrid.j.querySelectorAll(A).removeClass("last-none-suppress").addClass("last-suppress") : !$(A).hasClass("suppress") && ninegrid.j.querySelectorAll(t(this, p)).hasClass("suppress") ? ninegrid.j.querySelectorAll(A).removeClass("last-suppress").addClass("last-none-suppress") : ninegrid.j.querySelectorAll(A).removeClass("last-none-suppress").removeClass("last-suppress");
|
|
1528
1526
|
}
|
|
1529
1527
|
}
|
|
@@ -1532,8 +1530,8 @@ const De = class De extends me {
|
|
|
1532
1530
|
if (typeof e < "u")
|
|
1533
1531
|
try {
|
|
1534
1532
|
r = parseInt(r);
|
|
1535
|
-
const
|
|
1536
|
-
return t(this,
|
|
1533
|
+
const a = e.replace("()", "");
|
|
1534
|
+
return t(this, C)[a] ? t(this, C)[a].call(this, s, r, t(this, p)) : t(this, C).exprFunction(e).call(this, s, r, t(this, C).data);
|
|
1537
1535
|
} catch {
|
|
1538
1536
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1539
1537
|
}
|
|
@@ -1542,16 +1540,16 @@ const De = class De extends me {
|
|
|
1542
1540
|
}, "getExprValue"));
|
|
1543
1541
|
}
|
|
1544
1542
|
connectedCallback() {
|
|
1545
|
-
super.connectedCallback(),
|
|
1543
|
+
super.connectedCallback(), b(this, C, this.getRootNode().host), b(this, p, this.closest("th,td")), b(this, Ht, t(this, p).closest("tr"));
|
|
1546
1544
|
}
|
|
1547
1545
|
get value() {
|
|
1548
|
-
var e = !t(this,
|
|
1546
|
+
var e = !t(this, C) || !t(this, C).dataManager || !t(this, p) || !t(this, p).dataset || !t(this, p).dataset.row || !t(this, p).dataset.bind ? "" : t(this, p).closest("tr").data[t(this, p).dataset.bind];
|
|
1549
1547
|
return e ?? "";
|
|
1550
1548
|
}
|
|
1551
1549
|
set value(e) {
|
|
1552
1550
|
var s = parseInt(t(this, p).dataset.row);
|
|
1553
1551
|
const r = this.getAttribute("update-row-state") != "false";
|
|
1554
|
-
s < 0 ? t(this,
|
|
1552
|
+
s < 0 ? t(this, C).data.setValueNF(parseInt(t(this, p).dataset.index), t(this, p).dataset.bind, e, r) : t(this, C).data.setValue(s, t(this, p).dataset.bind, e, r);
|
|
1555
1553
|
}
|
|
1556
1554
|
get row() {
|
|
1557
1555
|
return parseInt(t(this, p).dataset.row);
|
|
@@ -1564,7 +1562,7 @@ const De = class De extends me {
|
|
|
1564
1562
|
return parseInt(t(this, p).dataset.row), t(this, Ht).data[e];
|
|
1565
1563
|
}
|
|
1566
1564
|
};
|
|
1567
|
-
|
|
1565
|
+
C = new WeakMap(), Ht = new WeakMap(), p = new WeakMap(), qe = new WeakMap(), Re = new WeakMap(), Te = new WeakMap(), ke = new WeakMap(), Ce = new WeakMap(), c(De, "CellElement");
|
|
1568
1566
|
let ve = De;
|
|
1569
1567
|
const Pe = class Pe extends ve {
|
|
1570
1568
|
constructor() {
|
|
@@ -1579,7 +1577,7 @@ const Pe = class Pe extends ve {
|
|
|
1579
1577
|
};
|
|
1580
1578
|
c(Pe, "EditableCellElement");
|
|
1581
1579
|
let xe = Pe;
|
|
1582
|
-
var Mt, ot, gt, bt, ne, U,
|
|
1580
|
+
var Mt, ot, gt, bt, ne, U, Le;
|
|
1583
1581
|
const je = class je extends xe {
|
|
1584
1582
|
constructor() {
|
|
1585
1583
|
super();
|
|
@@ -1623,7 +1621,7 @@ const je = class je extends xe {
|
|
|
1623
1621
|
if (!v) this.reset();
|
|
1624
1622
|
};
|
|
1625
1623
|
*/
|
|
1626
|
-
d(this,
|
|
1624
|
+
d(this, Le, /* @__PURE__ */ c((e) => {
|
|
1627
1625
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1628
1626
|
if (t(this, ot) == "number") {
|
|
1629
1627
|
let n = [];
|
|
@@ -1638,7 +1636,7 @@ const je = class je extends xe {
|
|
|
1638
1636
|
t(this, gt) && ninegrid.getByteLength(e.target.value) >= Number(t(this, gt)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1639
1637
|
}
|
|
1640
1638
|
}, "#onKeyDown"));
|
|
1641
|
-
if (this.applyBaseStyle(),
|
|
1639
|
+
if (this.applyBaseStyle(), b(this, ot, this.getAttribute("type") || "text"), b(this, gt, this.getAttribute("maxbyte")), b(this, bt, this.getAttribute("min")), b(this, ne, this.getAttribute("max")), b(this, U, this.getAttribute("scale")), !["text", "number"].includes(t(this, ot))) throw `invalid type : ${t(this, ot)}`;
|
|
1642
1640
|
}
|
|
1643
1641
|
connectedCallback() {
|
|
1644
1642
|
for (var e = [], s = 0; s < this.attributes.length; s++)
|
|
@@ -1648,10 +1646,10 @@ const je = class je extends xe {
|
|
|
1648
1646
|
${e.join(" ")}
|
|
1649
1647
|
ondragstart="return false;"
|
|
1650
1648
|
>
|
|
1651
|
-
`, super.connectedCallback(),
|
|
1649
|
+
`, super.connectedCallback(), b(this, Mt, this.querySelector("input"));
|
|
1652
1650
|
}
|
|
1653
1651
|
};
|
|
1654
|
-
Mt = new WeakMap(), ot = new WeakMap(), gt = new WeakMap(), bt = new WeakMap(), ne = new WeakMap(), U = new WeakMap(),
|
|
1652
|
+
Mt = new WeakMap(), ot = new WeakMap(), gt = new WeakMap(), bt = new WeakMap(), ne = new WeakMap(), U = new WeakMap(), Le = new WeakMap(), c(je, "CellInputText");
|
|
1655
1653
|
let we = je;
|
|
1656
1654
|
customElements.get("cell-input-text");
|
|
1657
1655
|
customElements.get("cell-input") || customElements.define("cell-input", we);
|