@ninebone/table 0.0.782 β 0.0.784
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 +488 -484
- 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
|
@@ -5,7 +5,7 @@ var ms = (C) => {
|
|
|
5
5
|
var Ss = (C, n, e) => n in C ? ys(C, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : C[n] = e;
|
|
6
6
|
var h = (C, n) => ys(C, "name", { value: n, configurable: !0 });
|
|
7
7
|
var q = (C, n, e) => Ss(C, typeof n != "symbol" ? n + "" : n, e), Ee = (C, n, e) => n.has(C) || ms("Cannot " + e);
|
|
8
|
-
var t = (C, n, e) => (Ee(C, n, "read from private field"), e ? e.call(C) : n.get(C)),
|
|
8
|
+
var t = (C, n, e) => (Ee(C, n, "read from private field"), e ? e.call(C) : n.get(C)), f = (C, n, e) => n.has(C) ? ms("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(C) : n.set(C, e), y = (C, n, e, s) => (Ee(C, n, "write to private field"), s ? s.call(C, e) : n.set(C, e), e), V = (C, n, e) => (Ee(C, n, "access private method"), e);
|
|
9
9
|
var xs = (C, n, e, s) => ({
|
|
10
10
|
set _(r) {
|
|
11
11
|
y(C, n, r, e);
|
|
@@ -27,13 +27,13 @@ var j, G, E, tt, et, st, Jt, nt, Qt;
|
|
|
27
27
|
const es = class es extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
f(this, j);
|
|
31
|
+
f(this, G, !1);
|
|
32
|
+
f(this, E);
|
|
33
|
+
f(this, tt);
|
|
34
|
+
f(this, et);
|
|
35
|
+
f(this, st);
|
|
36
|
+
f(this, Jt, /* @__PURE__ */ h(() => {
|
|
37
37
|
if (!t(this, j)) return;
|
|
38
38
|
const e = t(this, j).querySelector(".ng-container-body .ng-part-body");
|
|
39
39
|
e && (y(this, st, new ResizeObserver(() => {
|
|
@@ -44,8 +44,8 @@ const es = class es extends HTMLElement {
|
|
|
44
44
|
if (!t(this, j) || !t(this, E) || t(this, G)) return;
|
|
45
45
|
const e = t(this, E).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const r = t(this, E).track,
|
|
48
|
-
if (
|
|
47
|
+
const r = t(this, E).track, i = t(this, E).thumb, o = t(this, j).querySelector(".ng-container-bottom"), a = e.clientWidth, c = s.scrollWidth;
|
|
48
|
+
if (a !== 0 && c > a)
|
|
49
49
|
o && (o.style.display = "flex");
|
|
50
50
|
else {
|
|
51
51
|
o && (o.style.display = "none");
|
|
@@ -53,31 +53,31 @@ const es = class es extends HTMLElement {
|
|
|
53
53
|
}
|
|
54
54
|
const l = r.clientWidth;
|
|
55
55
|
if (l <= 0) return;
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
let
|
|
60
|
-
b > 0 && (
|
|
61
|
-
const p = l -
|
|
62
|
-
|
|
56
|
+
const u = Math.max(Math.min(l * (a / c), l), 20);
|
|
57
|
+
i.style.width = `${u}px`;
|
|
58
|
+
const d = e.scrollLeft, b = c - a;
|
|
59
|
+
let g = 0;
|
|
60
|
+
b > 0 && (g = parseInt(d / b * (l - u), 10)), g < 0 && (g = 0);
|
|
61
|
+
const p = l - u;
|
|
62
|
+
g > p && (g = p), i.style.left = `${g}px`, t(this, E).left.disabled = g === 0, t(this, E).right.disabled = g >= p - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
|
|
64
|
+
f(this, nt, /* @__PURE__ */ h((e) => {
|
|
65
65
|
if (!t(this, E)) return !1;
|
|
66
66
|
const s = t(this, E).container, r = s.querySelector("table");
|
|
67
67
|
if (!r) return !1;
|
|
68
|
-
const
|
|
69
|
-
let
|
|
70
|
-
|
|
71
|
-
const c =
|
|
72
|
-
|
|
73
|
-
const l = s.clientWidth,
|
|
74
|
-
return c > 0 &&
|
|
68
|
+
const i = t(this, E).track.getBoundingClientRect(), o = t(this, E).thumb.clientWidth;
|
|
69
|
+
let a = e;
|
|
70
|
+
a < 0 && (a = 0);
|
|
71
|
+
const c = i.width - o;
|
|
72
|
+
a > c && (a = c), a = parseInt(a, 10), t(this, E).thumb.style.left = `${a}px`, t(this, E).left.disabled = a === 0, t(this, E).right.disabled = a >= c - 1;
|
|
73
|
+
const l = s.clientWidth, d = r.scrollWidth - l;
|
|
74
|
+
return c > 0 && d > 0 && (s.scrollLeft = a / c * d), a > 0 && a < c - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
|
|
76
|
+
f(this, Qt, /* @__PURE__ */ h(() => {
|
|
77
77
|
const e = /* @__PURE__ */ h((r) => {
|
|
78
78
|
clearInterval(t(this, tt)), clearInterval(t(this, et));
|
|
79
|
-
const
|
|
80
|
-
t(this, nt).call(this,
|
|
79
|
+
const i = parseInt(t(this, E).thumb.style.left || 0, 10);
|
|
80
|
+
t(this, nt).call(this, i + r), y(this, tt, setInterval(() => {
|
|
81
81
|
clearInterval(t(this, tt)), y(this, et, setInterval(() => {
|
|
82
82
|
const o = parseInt(t(this, E).thumb.style.left || 0, 10);
|
|
83
83
|
t(this, nt).call(this, o + r) || clearInterval(t(this, et));
|
|
@@ -95,19 +95,19 @@ const es = class es extends HTMLElement {
|
|
|
95
95
|
}), t(this, E).left.addEventListener("touchstart", () => e(-20)), t(this, E).right.addEventListener("touchstart", () => e(20)), t(this, E).track.addEventListener("mousedown", (r) => {
|
|
96
96
|
if (r.button !== 0) return;
|
|
97
97
|
r.preventDefault();
|
|
98
|
-
const
|
|
99
|
-
t(this, nt).call(this, r.clientX -
|
|
98
|
+
const i = t(this, E).track.getBoundingClientRect(), o = t(this, E).thumb.clientWidth;
|
|
99
|
+
t(this, nt).call(this, r.clientX - i.left - o / 2);
|
|
100
100
|
}), t(this, E).thumb.addEventListener("mousedown", (r) => {
|
|
101
101
|
if (r.button !== 0) return;
|
|
102
102
|
r.stopPropagation(), r.preventDefault(), y(this, G, !0), this.shiftX = r.clientX - t(this, E).thumb.getBoundingClientRect().left;
|
|
103
|
-
const
|
|
103
|
+
const i = /* @__PURE__ */ h((a) => {
|
|
104
104
|
if (!t(this, G)) return;
|
|
105
105
|
const c = t(this, E).track.getBoundingClientRect();
|
|
106
|
-
t(this, nt).call(this,
|
|
106
|
+
t(this, nt).call(this, a.clientX - c.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
108
|
-
y(this, G, !1), s(), document.removeEventListener("mousemove",
|
|
108
|
+
y(this, G, !1), s(), document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", o), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
|
-
document.addEventListener("mousemove",
|
|
110
|
+
document.addEventListener("mousemove", i), document.addEventListener("mouseup", o);
|
|
111
111
|
});
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
@@ -205,60 +205,60 @@ var rt, ot, yt, k, kt, It, te;
|
|
|
205
205
|
const ss = class ss extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
208
|
+
f(this, rt);
|
|
209
|
+
f(this, ot);
|
|
210
|
+
f(this, yt, !1);
|
|
211
|
+
f(this, k);
|
|
212
|
+
f(this, kt, 0);
|
|
213
|
+
f(this, It, 0);
|
|
214
214
|
q(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
215
|
if (S.log("vscrollbar.refresh"), !t(this, rt) || !t(this, k)) return;
|
|
216
|
-
const e = t(this, k).container, s = t(this, k).track, r = t(this, k).thumb,
|
|
217
|
-
if (c <=
|
|
216
|
+
const e = t(this, k).container, s = t(this, k).track, r = t(this, k).thumb, i = e.clientHeight, o = t(this, rt).data.length, a = t(this, ot).getRowHeight(), c = o * a;
|
|
217
|
+
if (c <= i || o === 0) {
|
|
218
218
|
this.style.display = "none";
|
|
219
219
|
return;
|
|
220
220
|
} else
|
|
221
221
|
this.style.display = "flex";
|
|
222
222
|
const l = s.clientHeight;
|
|
223
223
|
if (l <= 0) return;
|
|
224
|
-
const
|
|
225
|
-
r.style.height = `${
|
|
226
|
-
const
|
|
227
|
-
S.log(e,
|
|
228
|
-
let
|
|
229
|
-
b > 0 && (
|
|
230
|
-
const p = l -
|
|
231
|
-
|
|
224
|
+
const u = Math.max(Math.min(l * (i / c), l), 20);
|
|
225
|
+
r.style.height = `${u}px`;
|
|
226
|
+
const d = e.scrollTop, b = Math.max(c - i, 1);
|
|
227
|
+
S.log(e, d, b);
|
|
228
|
+
let g = 0;
|
|
229
|
+
b > 0 && (g = d / b * (l - u));
|
|
230
|
+
const p = l - u;
|
|
231
|
+
g < 0 && (g = 0), g > p && (g = p), r.style.top = `${g}px`, t(this, k).top.disabled = d <= 0, t(this, k).bottom.disabled = d >= b - 1;
|
|
232
232
|
}, "refresh"));
|
|
233
|
-
|
|
233
|
+
f(this, te, /* @__PURE__ */ h(() => {
|
|
234
234
|
S.log("nine-table-vscrollbar.#init");
|
|
235
235
|
const e = t(this, k).container, s = /* @__PURE__ */ h(() => {
|
|
236
|
-
const
|
|
237
|
-
return
|
|
236
|
+
const i = (t(this, rt).data.get() || []).length, o = t(this, ot).getRowHeight();
|
|
237
|
+
return i * o;
|
|
238
238
|
}, "getContentHeight");
|
|
239
239
|
t(this, k).thumb.addEventListener("mousedown", (r) => {
|
|
240
240
|
if (r.button !== 0) return;
|
|
241
241
|
r.stopPropagation(), r.preventDefault(), y(this, yt, !0), y(this, kt, r.clientY), y(this, It, e.scrollTop);
|
|
242
|
-
const
|
|
242
|
+
const i = /* @__PURE__ */ h((a) => {
|
|
243
243
|
if (!t(this, yt)) return;
|
|
244
|
-
const c = t(this, k).track.getBoundingClientRect(), l = t(this, k).thumb.clientHeight,
|
|
245
|
-
if (
|
|
246
|
-
const w = b /
|
|
244
|
+
const c = t(this, k).track.getBoundingClientRect(), l = t(this, k).thumb.clientHeight, d = c.height - l, b = a.clientY - t(this, kt), g = e.clientHeight, p = s(), x = Math.max(p - g, 1);
|
|
245
|
+
if (d > 0 && x > 0) {
|
|
246
|
+
const w = b / d * x;
|
|
247
247
|
let m = t(this, It) + w;
|
|
248
|
-
const T = Math.max(0, p -
|
|
248
|
+
const T = Math.max(0, p - g);
|
|
249
249
|
m < 0 && (m = 0), m > T && (m = T), e.scrollTop = m;
|
|
250
250
|
}
|
|
251
251
|
this.refresh();
|
|
252
252
|
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
253
|
-
y(this, yt, !1), document.removeEventListener("mousemove",
|
|
253
|
+
y(this, yt, !1), document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", o), this.refresh();
|
|
254
254
|
}, "onMouseUp");
|
|
255
|
-
document.addEventListener("mousemove",
|
|
255
|
+
document.addEventListener("mousemove", i), document.addEventListener("mouseup", o);
|
|
256
256
|
}), t(this, k).track.addEventListener("mousedown", (r) => {
|
|
257
257
|
if (r.button !== 0 || r.target === t(this, k).thumb) return;
|
|
258
|
-
const
|
|
258
|
+
const i = t(this, k).track.getBoundingClientRect(), o = t(this, k).thumb.clientHeight, a = r.clientY - i.top - o / 2, l = i.height - o, u = e.clientHeight, d = s(), b = Math.max(d - u, 1);
|
|
259
259
|
if (l > 0 && b > 0) {
|
|
260
|
-
const
|
|
261
|
-
e.scrollTop =
|
|
260
|
+
const g = Math.max(0, Math.min(1, a / l));
|
|
261
|
+
e.scrollTop = g * b;
|
|
262
262
|
}
|
|
263
263
|
this.refresh();
|
|
264
264
|
}), t(this, k).top.addEventListener("click", () => {
|
|
@@ -353,76 +353,76 @@ const ss = class ss extends HTMLElement {
|
|
|
353
353
|
rt = new WeakMap(), ot = new WeakMap(), yt = new WeakMap(), k = new WeakMap(), kt = new WeakMap(), It = new WeakMap(), te = new WeakMap(), h(ss, "NineTableVScrollBar");
|
|
354
354
|
let Te = ss;
|
|
355
355
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Te);
|
|
356
|
-
var U, R, it, Y,
|
|
356
|
+
var U, R, it, Y, D, Z, at, Lt, Ye, Ve, ee, se, Mt, $t, Ht, ne, re, Nt, Ue, mt, _t, oe;
|
|
357
357
|
const ns = class ns {
|
|
358
358
|
constructor(n) {
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
359
|
+
f(this, U);
|
|
360
|
+
f(this, R);
|
|
361
|
+
f(this, it);
|
|
362
|
+
f(this, Y, /* @__PURE__ */ new Map());
|
|
363
|
+
f(this, D, null);
|
|
364
|
+
f(this, Z, null);
|
|
365
|
+
f(this, at, 0);
|
|
366
|
+
f(this, Lt, 40);
|
|
367
|
+
f(this, Ye, !1);
|
|
368
|
+
f(this, Ve, !1);
|
|
369
369
|
//#ticking = false; // π― κ³ μ μ€ν¬λ‘€ μ€λ‘νλ§μ© νλκ·Έ
|
|
370
|
-
|
|
370
|
+
f(this, ee, 3);
|
|
371
371
|
q(this, "refresh", /* @__PURE__ */ h(() => {
|
|
372
372
|
var e;
|
|
373
373
|
S.log("rowManager.refresh");
|
|
374
374
|
const n = t(this, R).querySelector(".ng-container-body .ng-part-body");
|
|
375
|
-
n && (t(this, Mt).call(this), t(this,
|
|
375
|
+
n && (t(this, Mt).call(this), t(this, $t).call(this), t(this, mt).call(this, n.scrollTop), (e = t(this, R).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
376
376
|
}, "refresh"));
|
|
377
377
|
q(this, "initialize", /* @__PURE__ */ h(() => {
|
|
378
378
|
S.log("rowManager.initialize"), y(this, it, {
|
|
379
379
|
scrollTables: t(this, R).querySelectorAll(".ng-part-body table"),
|
|
380
380
|
firstTr: t(this, R).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
381
|
-
}), y(this,
|
|
382
|
-
const a = t(this, R).querySelector(
|
|
381
|
+
}), y(this, D, null), t(this, Y).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
382
|
+
const a = t(this, R).querySelector(o);
|
|
383
383
|
if (!a) return;
|
|
384
|
-
const
|
|
385
|
-
if (!
|
|
386
|
-
const
|
|
387
|
-
if (!
|
|
388
|
-
const
|
|
389
|
-
t(this, Y).set(
|
|
384
|
+
const c = a.querySelector(".ng-part-body table");
|
|
385
|
+
if (!c) return;
|
|
386
|
+
const l = c.querySelector("tbody.bindable-tbody");
|
|
387
|
+
if (!l) return;
|
|
388
|
+
const d = Array.from(l.querySelectorAll("tr")).map((b) => b.cloneNode(!0));
|
|
389
|
+
t(this, Y).set(o, d);
|
|
390
390
|
});
|
|
391
|
-
const n = t(this, R).querySelector(".ng-container-body .ng-part-body"), e = t(this, R).querySelector(".ng-container-left .ng-part-body"), s = t(this, R).querySelector(".ng-container-right .ng-part-body");
|
|
392
|
-
if (
|
|
393
|
-
t(this, Mt).call(this), t(this, Nt).call(this), t(this,
|
|
394
|
-
let
|
|
395
|
-
const a = /* @__PURE__ */ h((
|
|
396
|
-
var
|
|
397
|
-
if (
|
|
398
|
-
|
|
399
|
-
const
|
|
400
|
-
S.log(
|
|
391
|
+
const n = t(this, R).querySelector(".ng-container-body .ng-part-body"), e = t(this, R).querySelector(".ng-container-left .ng-part-body"), s = t(this, R).querySelector(".ng-container-right .ng-part-body"), r = t(this, R).querySelector(".ng-container-body .ng-part-header"), i = t(this, R).querySelector(".ng-container-body .ng-part-footer");
|
|
392
|
+
if (n) {
|
|
393
|
+
t(this, Mt).call(this), t(this, Nt).call(this), t(this, $t).call(this), t(this, mt).call(this, n.scrollTop);
|
|
394
|
+
let o = !1;
|
|
395
|
+
const a = /* @__PURE__ */ h((c) => {
|
|
396
|
+
var g;
|
|
397
|
+
if (o) return;
|
|
398
|
+
o = !0;
|
|
399
|
+
const l = c.scrollTop, u = c.scrollLeft, d = t(this, R).querySelector(".ng-container-body .ng-part-header"), b = t(this, R).querySelector(".ng-container-body .ng-part-body");
|
|
400
|
+
S.log(`[Scroll Debug] source: ${c.className.trim()} | scrollLeft -> container: ${u}, bodyHeader: ${d == null ? void 0 : d.scrollLeft}, bodyPartBody: ${b == null ? void 0 : b.scrollLeft}`), n && n.scrollTop !== l && (n.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), r && r.scrollLeft !== u && (r.scrollLeft = u), i && i.scrollLeft !== u && (i.scrollLeft = u), t(this, mt).call(this, l), (g = t(this, R).querySelector("nine-table-vscrollbar")) == null || g.refresh(), o = !1;
|
|
401
401
|
}, "handleContainerScroll");
|
|
402
|
-
[n, e, s].forEach((
|
|
403
|
-
|
|
404
|
-
S.log(
|
|
402
|
+
[n, e, s].forEach((c) => {
|
|
403
|
+
c == null || c.addEventListener("scroll", (l) => {
|
|
404
|
+
S.log(l), S.log("rowManager.scroll event"), a(c);
|
|
405
405
|
});
|
|
406
406
|
});
|
|
407
407
|
}
|
|
408
408
|
}, "initialize"));
|
|
409
|
-
|
|
409
|
+
f(this, se, /* @__PURE__ */ h((n, e) => {
|
|
410
410
|
S.log("rowManager.#renderRows");
|
|
411
411
|
const s = t(this, Y).get(e);
|
|
412
412
|
if (!s || s.length === 0) return;
|
|
413
413
|
const r = n.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
414
414
|
if (!r) return;
|
|
415
|
-
r.querySelectorAll("tr:not(.nodata)").forEach((
|
|
416
|
-
const
|
|
417
|
-
for (let
|
|
415
|
+
r.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
|
|
416
|
+
const i = r.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
417
|
+
for (let a = 0; a < t(this, Lt); a++)
|
|
418
418
|
s.forEach((c) => {
|
|
419
419
|
o.appendChild(c.cloneNode(!0));
|
|
420
420
|
});
|
|
421
|
-
|
|
421
|
+
i ? i.before(o) : r.appendChild(o), e === ".ng-container-body" && (t(this, it).firstTr = r.querySelector("tr:not(.nodata)"));
|
|
422
422
|
}, "#renderRows"));
|
|
423
|
-
|
|
424
|
-
if (t(this,
|
|
425
|
-
return t(this,
|
|
423
|
+
f(this, Mt, /* @__PURE__ */ h(() => {
|
|
424
|
+
if (t(this, D) !== null && t(this, D) > 0)
|
|
425
|
+
return t(this, D);
|
|
426
426
|
const n = t(this, R).querySelector(".ng-container-body .ng-part-body");
|
|
427
427
|
S.log("rowManager.#measureAndCacheHeight");
|
|
428
428
|
const e = t(this, Y).get(".ng-container-body");
|
|
@@ -430,128 +430,128 @@ const ns = class ns {
|
|
|
430
430
|
const s = n.querySelector("tbody.bindable-tbody");
|
|
431
431
|
if (S.log(s), !s) throw new Error("invalid dom");
|
|
432
432
|
s.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
|
|
433
|
-
const r = s.querySelector("tr.nodata"),
|
|
433
|
+
const r = s.querySelector("tr.nodata"), i = document.createDocumentFragment();
|
|
434
434
|
e.forEach((b) => {
|
|
435
|
-
|
|
436
|
-
}), r ? r.before(
|
|
437
|
-
const o = t(this, R),
|
|
438
|
-
(
|
|
439
|
-
let
|
|
440
|
-
const
|
|
441
|
-
return
|
|
442
|
-
let
|
|
443
|
-
if (
|
|
435
|
+
i.appendChild(b.cloneNode(!0));
|
|
436
|
+
}), r ? r.before(i) : s.appendChild(i);
|
|
437
|
+
const o = t(this, R), a = o.style.display, c = o.style.visibility, l = o.style.position;
|
|
438
|
+
(a === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
439
|
+
let u = 0;
|
|
440
|
+
const d = s.querySelectorAll("tr");
|
|
441
|
+
return d.forEach((b) => {
|
|
442
|
+
let g = b.offsetHeight || b.getBoundingClientRect().height;
|
|
443
|
+
if (g === 0) {
|
|
444
444
|
const p = window.getComputedStyle(b);
|
|
445
|
-
|
|
445
|
+
g = parseFloat(p.height) || parseFloat(p.minHeight) || 0;
|
|
446
446
|
}
|
|
447
|
-
|
|
448
|
-
}),
|
|
447
|
+
u += g;
|
|
448
|
+
}), d.forEach((b) => b.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l, u <= 0 ? -1 : (y(this, D, u), t(this, Ht).call(this), t(this, D));
|
|
449
449
|
}, "#measureAndCacheHeight"));
|
|
450
|
-
|
|
450
|
+
f(this, $t, /* @__PURE__ */ h(() => {
|
|
451
451
|
S.log("rowManager.#updateVirtualScrollHeight");
|
|
452
|
-
const e = (t(this, U).data.get() || []).length, s = t(this,
|
|
453
|
-
S.log("π [VirtualHeight]", { totalCount: e, rowHeight: s, totalVirtualHeight: r }), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
454
|
-
const o = t(this, R).querySelector(
|
|
452
|
+
const e = (t(this, U).data.get() || []).length, s = t(this, D), r = e * s;
|
|
453
|
+
S.log("π [VirtualHeight]", { totalCount: e, rowHeight: s, totalVirtualHeight: r }), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
454
|
+
const o = t(this, R).querySelector(i);
|
|
455
455
|
if (!o) return;
|
|
456
|
-
const
|
|
457
|
-
|
|
456
|
+
const a = o.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
457
|
+
a && (a.style.height = `${r}px`);
|
|
458
458
|
});
|
|
459
459
|
}, "#updateVirtualScrollHeight"));
|
|
460
|
-
|
|
461
|
-
if (t(this, at) > 0 && t(this,
|
|
462
|
-
const n = Math.ceil(t(this, at) / t(this,
|
|
460
|
+
f(this, Ht, /* @__PURE__ */ h(() => {
|
|
461
|
+
if (t(this, at) > 0 && t(this, D) > 0) {
|
|
462
|
+
const n = Math.ceil(t(this, at) / t(this, D));
|
|
463
463
|
y(this, Lt, n + t(this, ee));
|
|
464
464
|
}
|
|
465
465
|
}, "#updateRowCount"));
|
|
466
|
-
|
|
467
|
-
var
|
|
466
|
+
f(this, ne, /* @__PURE__ */ h(() => {
|
|
467
|
+
var a, c, l, u, d, b;
|
|
468
468
|
const n = t(this, R).querySelector(".ng-container-left .ng-part-body table"), e = t(this, R).querySelector(".ng-container-body .ng-part-body table"), s = t(this, R).querySelector(".ng-container-right .ng-part-body table");
|
|
469
469
|
if (e) {
|
|
470
|
-
const
|
|
470
|
+
const g = n ? Array.from(n.querySelectorAll("tbody tr")) : [], p = Array.from(e.querySelectorAll("tbody tr")), x = s ? Array.from(s.querySelectorAll("tbody tr")) : [], w = Math.max(g.length, p.length, x.length);
|
|
471
471
|
for (let m = 0; m < w; m++) {
|
|
472
472
|
const T = [
|
|
473
|
-
((
|
|
473
|
+
((a = g[m]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
474
474
|
((c = p[m]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
475
475
|
((l = x[m]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
476
476
|
], A = Math.max(...T);
|
|
477
|
-
A > 0 && (
|
|
477
|
+
A > 0 && (g[m] && (g[m].style.height = `${A}px`), p[m] && (p[m].style.height = `${A}px`), x[m] && (x[m].style.height = `${A}px`));
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
|
-
const r = t(this, R).querySelector(".ng-container-left .ng-part-footer table"),
|
|
481
|
-
if (
|
|
482
|
-
const
|
|
480
|
+
const r = t(this, R).querySelector(".ng-container-left .ng-part-footer table"), i = t(this, R).querySelector(".ng-container-body .ng-part-footer table"), o = t(this, R).querySelector(".ng-container-right .ng-part-footer table");
|
|
481
|
+
if (i) {
|
|
482
|
+
const g = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], p = Array.from(i.querySelectorAll("tfoot tr")), x = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], w = Math.max(g.length, p.length, x.length);
|
|
483
483
|
for (let m = 0; m < w; m++) {
|
|
484
484
|
const T = [
|
|
485
|
-
((
|
|
486
|
-
((
|
|
485
|
+
((u = g[m]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
|
|
486
|
+
((d = p[m]) == null ? void 0 : d.getBoundingClientRect().height) || 0,
|
|
487
487
|
((b = x[m]) == null ? void 0 : b.getBoundingClientRect().height) || 0
|
|
488
488
|
], A = Math.max(...T);
|
|
489
|
-
A > 0 && (
|
|
489
|
+
A > 0 && (g[m] && (g[m].style.height = `${A}px`), p[m] && (p[m].style.height = `${A}px`), x[m] && (x[m].style.height = `${A}px`));
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
492
|
}, "#syncRowHeights"));
|
|
493
|
-
|
|
493
|
+
f(this, re, /* @__PURE__ */ h(() => {
|
|
494
494
|
!t(this, R) || !(t(this, R) instanceof HTMLElement) || (y(this, Z, new ResizeObserver((n) => {
|
|
495
495
|
for (const e of n) {
|
|
496
496
|
const s = e.target;
|
|
497
497
|
if (!s.classList.contains("active")) continue;
|
|
498
498
|
const r = e.contentRect.height;
|
|
499
499
|
if (r > 0) {
|
|
500
|
-
let
|
|
501
|
-
const o = s.querySelector(".ng-part-header"),
|
|
502
|
-
o && (
|
|
503
|
-
const c = Math.max(r -
|
|
504
|
-
t(this, at) !== c && (y(this, at, c), t(this,
|
|
500
|
+
let i = 0;
|
|
501
|
+
const o = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
|
|
502
|
+
o && (i += o.offsetHeight), a && (i += a.offsetHeight);
|
|
503
|
+
const c = Math.max(r - i, 100);
|
|
504
|
+
t(this, at) !== c && (y(this, at, c), t(this, Ht).call(this), t(this, D) !== null && (t(this, Nt).call(this), this.refresh()));
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
507
|
})), t(this, Z).observe(t(this, R)));
|
|
508
508
|
}, "#initResizeObserver"));
|
|
509
|
-
|
|
509
|
+
f(this, Nt, /* @__PURE__ */ h(() => {
|
|
510
510
|
S.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
511
511
|
const e = t(this, R).querySelector(n);
|
|
512
512
|
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, se).call(this, e, n);
|
|
513
513
|
}), t(this, oe).call(this), t(this, ne).call(this);
|
|
514
514
|
}, "#renderAllContainers"));
|
|
515
|
-
|
|
515
|
+
f(this, Ue, /* @__PURE__ */ h((n) => {
|
|
516
516
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
517
517
|
var l;
|
|
518
518
|
const s = t(this, R).querySelector(e);
|
|
519
519
|
if (!s) return;
|
|
520
520
|
const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
521
521
|
if (!r) return;
|
|
522
|
-
const
|
|
523
|
-
|
|
524
|
-
const b = n + Math.floor(
|
|
522
|
+
const i = Array.from(r.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this, Y).get(e)) == null ? void 0 : l.length) || 1, c = (t(this, U).data.get() || []).length;
|
|
523
|
+
i.forEach((u, d) => {
|
|
524
|
+
const b = n + Math.floor(d / o);
|
|
525
525
|
if (b >= c) {
|
|
526
|
-
|
|
526
|
+
u.style.visibility = "hidden";
|
|
527
527
|
return;
|
|
528
528
|
}
|
|
529
|
-
const
|
|
530
|
-
|
|
529
|
+
const g = t(this, U).data.get(b);
|
|
530
|
+
u.style.display = "", t(this, _t).call(this, u, g, b);
|
|
531
531
|
});
|
|
532
532
|
});
|
|
533
533
|
}, "#adjustBufferRows"));
|
|
534
|
-
|
|
535
|
-
var
|
|
536
|
-
const e = t(this,
|
|
534
|
+
f(this, mt, /* @__PURE__ */ h((n) => {
|
|
535
|
+
var d, b;
|
|
536
|
+
const e = t(this, D);
|
|
537
537
|
if (!e || e <= 0) return;
|
|
538
538
|
const s = t(this, U).data.length;
|
|
539
539
|
if (s === 0) return;
|
|
540
|
-
const r = ((
|
|
541
|
-
S.log("bodyContainer.clientHeight",
|
|
542
|
-
const o = Math.max(0, s - Math.floor(
|
|
543
|
-
let c = Math.floor(
|
|
544
|
-
S.log(`π [Scroll Calc] maxStartIndex: ${o}, startIndex: ${
|
|
545
|
-
const l = t(this, it).firstTr,
|
|
546
|
-
(b = t(this, it)) == null || b.scrollTables.forEach((
|
|
547
|
-
|
|
548
|
-
}),
|
|
549
|
-
const p = t(this, R).querySelector(
|
|
540
|
+
const r = ((d = t(this, Y).get(".ng-container-body")) == null ? void 0 : d.length) || 1, i = t(this, R).querySelector(".ng-container-body .ng-part-body");
|
|
541
|
+
S.log("bodyContainer.clientHeight", i.clientHeight);
|
|
542
|
+
const o = Math.max(0, s - Math.floor(i.clientHeight / e)), a = Math.min(o, Math.max(0, Math.floor(n / e)));
|
|
543
|
+
let c = Math.floor(a * e);
|
|
544
|
+
S.log(`π [Scroll Calc] maxStartIndex: ${o}, startIndex: ${a}, offsetY: ${c}`), a === o && S.log(`π [Scroll Inspect] scrollTop: ${n}, rowHeight: ${e}, maxStartIndex: ${o}, startIndex: ${a}, offsetY: ${c}`);
|
|
545
|
+
const l = t(this, it).firstTr, u = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
|
|
546
|
+
(b = t(this, it)) == null || b.scrollTables.forEach((g) => {
|
|
547
|
+
g.style.transform = `translate3d(0, ${c}px, 0)`;
|
|
548
|
+
}), u !== a && (S.log(`π [Row Bind Trigger] currentStartIndex(${u}) !== startIndex(${a})`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
|
|
549
|
+
const p = t(this, R).querySelector(g);
|
|
550
550
|
if (!p) return;
|
|
551
551
|
const x = p.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
552
552
|
if (!x) return;
|
|
553
553
|
Array.from(x.querySelectorAll("tr:not(.nodata)")).forEach((m, T) => {
|
|
554
|
-
const A =
|
|
554
|
+
const A = a + Math.floor(T / r);
|
|
555
555
|
if (A >= s) {
|
|
556
556
|
m.style.display = "none";
|
|
557
557
|
return;
|
|
@@ -575,26 +575,26 @@ const ns = class ns {
|
|
|
575
575
|
cell.dataset.row = dataIndex;
|
|
576
576
|
});
|
|
577
577
|
}; */
|
|
578
|
-
|
|
579
|
-
n.dataset.row = s, n.data = e, Array.from(n.cells).forEach((r,
|
|
578
|
+
f(this, _t, /* @__PURE__ */ h((n, e, s) => {
|
|
579
|
+
n.dataset.row = s, n.data = e, Array.from(n.cells).forEach((r, i) => {
|
|
580
580
|
r.dataset.row = s;
|
|
581
|
-
const o = Array.from(r.children).find((
|
|
581
|
+
const o = Array.from(r.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
|
|
582
582
|
o && typeof o.refresh == "function" && o.refresh();
|
|
583
583
|
});
|
|
584
584
|
}, "#bindRowData"));
|
|
585
|
-
|
|
586
|
-
var c, l,
|
|
585
|
+
f(this, oe, /* @__PURE__ */ h(() => {
|
|
586
|
+
var c, l, u;
|
|
587
587
|
S.log("rowManager.#syncHeaderHeights");
|
|
588
588
|
const n = t(this, R).querySelector(".ng-container-left .ng-part-header table"), e = t(this, R).querySelector(".ng-container-body .ng-part-header table"), s = t(this, R).querySelector(".ng-container-right .ng-part-header table");
|
|
589
589
|
if (!e) return;
|
|
590
|
-
const r = n ? Array.from(n.querySelectorAll("tr")) : [],
|
|
591
|
-
for (let
|
|
590
|
+
const r = n ? Array.from(n.querySelectorAll("tr")) : [], i = Array.from(e.querySelectorAll("tr")), o = s ? Array.from(s.querySelectorAll("tr")) : [], a = Math.max(r.length, i.length, o.length);
|
|
591
|
+
for (let d = 0; d < a; d++) {
|
|
592
592
|
const b = [
|
|
593
|
-
((c = r[
|
|
594
|
-
((l =
|
|
595
|
-
((
|
|
596
|
-
],
|
|
597
|
-
|
|
593
|
+
((c = r[d]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
594
|
+
((l = i[d]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
595
|
+
((u = o[d]) == null ? void 0 : u.getBoundingClientRect().height) || 0
|
|
596
|
+
], g = Math.max(...b);
|
|
597
|
+
g > 0 && (r[d] && (r[d].style.height = `${g}px`), i[d] && (i[d].style.height = `${g}px`), o[d] && (o[d].style.height = `${g}px`));
|
|
598
598
|
}
|
|
599
599
|
}, "#syncHeaderHeights"));
|
|
600
600
|
q(this, "destroy", /* @__PURE__ */ h(() => {
|
|
@@ -603,14 +603,14 @@ const ns = class ns {
|
|
|
603
603
|
y(this, U, n.getRootNode().host), y(this, R, n), t(this, re).call(this);
|
|
604
604
|
}
|
|
605
605
|
getRowHeight() {
|
|
606
|
-
return t(this,
|
|
606
|
+
return t(this, D);
|
|
607
607
|
}
|
|
608
608
|
templateLength(n = ".ng-container-body") {
|
|
609
609
|
var e;
|
|
610
610
|
return ((e = t(this, Y).get(n)) == null ? void 0 : e.length) || 1;
|
|
611
611
|
}
|
|
612
612
|
};
|
|
613
|
-
U = new WeakMap(), R = new WeakMap(), it = new WeakMap(), Y = new WeakMap(),
|
|
613
|
+
U = new WeakMap(), R = new WeakMap(), it = new WeakMap(), Y = new WeakMap(), D = new WeakMap(), Z = new WeakMap(), at = new WeakMap(), Lt = new WeakMap(), Ye = new WeakMap(), Ve = new WeakMap(), ee = new WeakMap(), se = new WeakMap(), Mt = new WeakMap(), $t = new WeakMap(), Ht = new WeakMap(), ne = new WeakMap(), re = new WeakMap(), Nt = new WeakMap(), Ue = new WeakMap(), mt = new WeakMap(), _t = new WeakMap(), oe = new WeakMap(), h(ns, "RowManager");
|
|
614
614
|
let ke = ns;
|
|
615
615
|
const ie = class ie {
|
|
616
616
|
/**
|
|
@@ -624,70 +624,70 @@ const ie = class ie {
|
|
|
624
624
|
*/
|
|
625
625
|
static compile(n) {
|
|
626
626
|
if (!n) return null;
|
|
627
|
-
const e = /* @__PURE__ */ h((
|
|
628
|
-
|
|
629
|
-
const
|
|
627
|
+
const e = /* @__PURE__ */ h((a) => {
|
|
628
|
+
a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
|
|
629
|
+
const u = l.getAttribute("cell-type") || "renderer";
|
|
630
630
|
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
631
|
-
let
|
|
632
|
-
const b = l.getAttribute("data-bind"),
|
|
631
|
+
let d = `cell-${u}`;
|
|
632
|
+
const b = l.getAttribute("data-bind"), g = l.getAttribute("data-expr"), p = l.getAttribute("maxbyte"), x = l.getAttribute("type");
|
|
633
633
|
let w = [];
|
|
634
|
-
b && w.push(`data-bind="${b}"`),
|
|
635
|
-
}),
|
|
634
|
+
b && w.push(`data-bind="${b}"`), g && w.push(`data-expr="${g}"`), p && w.push(`maxbyte="${p}"`), x && w.push(`type="${x}"`), l.innerHTML = `<${d} ${w.join(" ")}></${d}>`;
|
|
635
|
+
}), a.querySelectorAll("tbody td, tfoot td").forEach((l) => {
|
|
636
636
|
l.setAttribute("tabindex", "0");
|
|
637
637
|
});
|
|
638
|
-
}, "processCellTypes"), s = /* @__PURE__ */ h((
|
|
639
|
-
if (!
|
|
640
|
-
const c =
|
|
638
|
+
}, "processCellTypes"), s = /* @__PURE__ */ h((a) => {
|
|
639
|
+
if (!a.querySelector("colgroup")) {
|
|
640
|
+
const c = a.querySelector("tbody tr") || a.querySelector("tr"), l = c ? c.querySelectorAll("th, td").length : 1, u = document.createElement("colgroup"), d = Math.max(Math.floor(a.clientWidth / l), 100);
|
|
641
641
|
for (let b = 0; b < l; b++) {
|
|
642
|
-
const
|
|
643
|
-
|
|
642
|
+
const g = document.createElement("col");
|
|
643
|
+
g.setAttribute("width", d), u.appendChild(g);
|
|
644
644
|
}
|
|
645
|
-
|
|
645
|
+
a.prepend(u);
|
|
646
646
|
}
|
|
647
|
-
if (!
|
|
648
|
-
const c = document.createElement("thead"), l =
|
|
649
|
-
l ? l.after(c) :
|
|
647
|
+
if (!a.querySelector("thead")) {
|
|
648
|
+
const c = document.createElement("thead"), l = a.querySelector("colgroup");
|
|
649
|
+
l ? l.after(c) : a.prepend(c);
|
|
650
650
|
}
|
|
651
|
-
|
|
652
|
-
}, "ensureTableStructure"), r = /* @__PURE__ */ h((
|
|
653
|
-
const l = Array.from(
|
|
654
|
-
if (
|
|
651
|
+
a.classList.add("nine-table-element");
|
|
652
|
+
}, "ensureTableStructure"), r = /* @__PURE__ */ h((a, c) => {
|
|
653
|
+
const l = Array.from(a.querySelectorAll(c + " tr")), u = Array.from(a.querySelectorAll(c + " th," + c + " td")), d = l.length;
|
|
654
|
+
if (d === 0 || u.length === 0) return;
|
|
655
655
|
let b = 0;
|
|
656
|
-
|
|
656
|
+
u.forEach((p) => {
|
|
657
657
|
b += p.colSpan || 1;
|
|
658
658
|
});
|
|
659
|
-
const
|
|
659
|
+
const g = Array.from(Array(d), () => Array(b).fill(null));
|
|
660
660
|
l.forEach((p) => {
|
|
661
661
|
const x = p.sectionRowIndex;
|
|
662
662
|
let w = 0;
|
|
663
663
|
Array.from(p.querySelectorAll("th,td")).forEach((m) => {
|
|
664
|
-
for (let M = 0; M <
|
|
665
|
-
if (
|
|
664
|
+
for (let M = 0; M < g[x].length; M++)
|
|
665
|
+
if (g[x][M] === null) {
|
|
666
666
|
w = M;
|
|
667
667
|
break;
|
|
668
668
|
}
|
|
669
669
|
const T = m.rowSpan || 1, A = m.colSpan || 1;
|
|
670
670
|
for (let M = 0; M < T; M++)
|
|
671
671
|
for (let B = 0; B < A; B++)
|
|
672
|
-
x + M <
|
|
672
|
+
x + M < d && w + B < b && (g[x + M][w + B] = M === 0 && B === 0 ? "1" : "0");
|
|
673
673
|
});
|
|
674
674
|
}), l.forEach((p) => {
|
|
675
675
|
const x = p.sectionRowIndex;
|
|
676
676
|
Array.from(p.querySelectorAll("th,td")).forEach((w) => {
|
|
677
|
-
for (let m = 0; m <
|
|
678
|
-
if (
|
|
679
|
-
w.dataset.col = m,
|
|
677
|
+
for (let m = 0; m < g[x].length; m++)
|
|
678
|
+
if (g[x][m] === "1") {
|
|
679
|
+
w.dataset.col = m, g[x][m] = "0";
|
|
680
680
|
break;
|
|
681
681
|
}
|
|
682
682
|
});
|
|
683
683
|
});
|
|
684
|
-
}, "resetColIndex"),
|
|
685
|
-
return s(
|
|
686
|
-
const l =
|
|
687
|
-
l &&
|
|
688
|
-
|
|
684
|
+
}, "resetColIndex"), i = n.cloneNode(!0);
|
|
685
|
+
return s(i), e(i), r(i, "thead"), r(i, "tbody"), r(i, "tfoot"), Array.from(i.querySelectorAll("colgroup col")).forEach((a, c) => {
|
|
686
|
+
const l = a.getAttribute("fixed");
|
|
687
|
+
l && i.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((u) => {
|
|
688
|
+
u.setAttribute("fixed", l);
|
|
689
689
|
});
|
|
690
|
-
}),
|
|
690
|
+
}), i;
|
|
691
691
|
}
|
|
692
692
|
// π― [μΆκ°] td/thμ μ μΈλ cell-type μμ±μ μ½μ΄ 컀μ€ν
νκ·Έλ‘ μλ κ°μΈκΈ°
|
|
693
693
|
};
|
|
@@ -696,17 +696,17 @@ let Ie = ie;
|
|
|
696
696
|
var N, X, K, qt, ws;
|
|
697
697
|
const rs = class rs {
|
|
698
698
|
constructor(n) {
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
699
|
+
f(this, K);
|
|
700
|
+
f(this, N);
|
|
701
|
+
f(this, X, { startRow: -1, startCol: -1, endRow: -1, endCol: -1 });
|
|
702
702
|
q(this, "render", /* @__PURE__ */ h(() => {
|
|
703
703
|
const { startRow: n, startCol: e, endRow: s, endCol: r } = t(this, X);
|
|
704
704
|
S.log("π¨ [CellSelection.render] Rendering range ->", t(this, X));
|
|
705
|
-
const
|
|
705
|
+
const i = t(this, N).querySelectorAll(
|
|
706
706
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
707
707
|
);
|
|
708
|
-
if (
|
|
709
|
-
|
|
708
|
+
if (i.forEach((a) => {
|
|
709
|
+
a.querySelectorAll(".selected, .selected-top, .selected-bottom, .selected-left, .selected-right").forEach((c) => {
|
|
710
710
|
c.classList.remove("selected", "selected-top", "selected-bottom", "selected-left", "selected-right");
|
|
711
711
|
});
|
|
712
712
|
}), n < 0 || e < 0) {
|
|
@@ -714,14 +714,14 @@ const rs = class rs {
|
|
|
714
714
|
return;
|
|
715
715
|
}
|
|
716
716
|
let o = 0;
|
|
717
|
-
|
|
718
|
-
|
|
717
|
+
i.forEach((a) => {
|
|
718
|
+
a.querySelectorAll("tbody tr").forEach((c) => {
|
|
719
719
|
const { matrixRow: l } = V(this, K, qt).call(this, c);
|
|
720
|
-
l < 0 || c.querySelectorAll("td, th").forEach((
|
|
721
|
-
const
|
|
722
|
-
if (isNaN(
|
|
723
|
-
const b = parseInt(
|
|
724
|
-
p >= n && l <= s && x >= e &&
|
|
720
|
+
l < 0 || c.querySelectorAll("td, th").forEach((u) => {
|
|
721
|
+
const d = parseInt(u.dataset.col, 10);
|
|
722
|
+
if (isNaN(d)) return;
|
|
723
|
+
const b = parseInt(u.rowSpan || 1, 10), g = parseInt(u.colSpan || 1, 10), p = l + b - 1, x = d + g - 1;
|
|
724
|
+
p >= n && l <= s && x >= e && d <= r && (o++, u.classList.add("selected"), S.log(u, n, e, s, r), l <= n && u.classList.add("selected-top"), p >= s && u.classList.add("selected-bottom"), d <= e && u.classList.add("selected-left"), x >= r && u.classList.add("selected-right"));
|
|
725
725
|
});
|
|
726
726
|
});
|
|
727
727
|
}), S.log(`β¨ [CellSelection.render] Total rendered cells marked: ${o}`);
|
|
@@ -736,35 +736,35 @@ const rs = class rs {
|
|
|
736
736
|
}
|
|
737
737
|
setRange(n, e, s, r) {
|
|
738
738
|
S.log(`π [CellSelection.setRange] Input -> startRow: ${n}, startCol: ${e}, endRow: ${s}, endCol: ${r}`);
|
|
739
|
-
let
|
|
739
|
+
let i = Math.min(n, s), o = Math.max(n, s), a = Math.min(e, r), c = Math.max(e, r);
|
|
740
740
|
const l = t(this, N).querySelectorAll(
|
|
741
741
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
742
742
|
);
|
|
743
|
-
let
|
|
744
|
-
for (;
|
|
745
|
-
|
|
746
|
-
b.querySelectorAll("tbody tr").forEach((
|
|
747
|
-
if (
|
|
748
|
-
const { matrixRow: p } = V(this, K, qt).call(this,
|
|
749
|
-
p < 0 ||
|
|
743
|
+
let u = !0, d = 0;
|
|
744
|
+
for (; u && d < 5; )
|
|
745
|
+
u = !1, d++, l.forEach((b) => {
|
|
746
|
+
b.querySelectorAll("tbody tr").forEach((g) => {
|
|
747
|
+
if (g.classList.contains("nodata")) return;
|
|
748
|
+
const { matrixRow: p } = V(this, K, qt).call(this, g);
|
|
749
|
+
p < 0 || g.querySelectorAll("td, th").forEach((x) => {
|
|
750
750
|
const w = parseInt(x.dataset.col, 10);
|
|
751
751
|
if (isNaN(w)) return;
|
|
752
752
|
const m = parseInt(x.rowSpan || 1, 10), T = parseInt(x.colSpan || 1, 10), A = p + m - 1, M = w + T - 1;
|
|
753
|
-
if (A >=
|
|
754
|
-
const
|
|
755
|
-
(
|
|
753
|
+
if (A >= i && p <= o && M >= a && w <= c) {
|
|
754
|
+
const z = Math.min(i, p), Gt = Math.max(o, A), bs = Math.min(a, w), ps = Math.max(c, M);
|
|
755
|
+
(z !== i || Gt !== o || bs !== a || ps !== c) && (i = z, o = Gt, a = bs, c = ps, u = !0);
|
|
756
756
|
}
|
|
757
757
|
});
|
|
758
758
|
});
|
|
759
759
|
});
|
|
760
|
-
y(this, X, { startRow:
|
|
760
|
+
y(this, X, { startRow: i, startCol: a, endRow: o, endCol: c }), S.log("π¦ [CellSelection.setRange] Final Range ->", t(this, X)), this.render();
|
|
761
761
|
}
|
|
762
762
|
};
|
|
763
763
|
N = new WeakMap(), X = new WeakMap(), K = new WeakSet(), qt = /* @__PURE__ */ h(function(n) {
|
|
764
764
|
if (!n || n.classList.contains("nodata")) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
|
|
765
765
|
const e = parseInt(n.dataset.row, 10);
|
|
766
766
|
if (isNaN(e)) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
|
|
767
|
-
const s = n.closest("tbody"),
|
|
767
|
+
const s = n.closest("tbody"), i = Array.from(s.querySelectorAll("tr:not(.nodata)")).filter((l) => parseInt(l.dataset.row, 10) === e), o = i.indexOf(n), a = i.length > 0 ? i.length : 1, c = e * a + (o >= 0 ? o : n.sectionRowIndex % a);
|
|
768
768
|
return { dataRow: e, subRowIndex: o, matrixRow: c };
|
|
769
769
|
}, "#getMatrixRow"), ws = /* @__PURE__ */ h(function() {
|
|
770
770
|
const n = t(this, N).querySelector(".ng-container-top");
|
|
@@ -777,113 +777,113 @@ N = new WeakMap(), X = new WeakMap(), K = new WeakSet(), qt = /* @__PURE__ */ h(
|
|
|
777
777
|
const s = e.target.closest("td, th");
|
|
778
778
|
if (!s || s.dataset.row === void 0 || s.dataset.col === void 0 || s.closest("tr").classList.contains("nodata")) return;
|
|
779
779
|
t(this, N).style.userSelect = "none", t(this, N).style.webkitUserSelect = "none";
|
|
780
|
-
const r = s.closest("tr"), { matrixRow:
|
|
781
|
-
if (
|
|
780
|
+
const r = s.closest("tr"), { matrixRow: i } = V(this, K, qt).call(this, r), o = parseInt(s.dataset.col, 10);
|
|
781
|
+
if (i < 0) {
|
|
782
782
|
t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "";
|
|
783
783
|
return;
|
|
784
784
|
}
|
|
785
|
-
S.log(`π±οΈ [MouseDown Success] startRow: ${
|
|
786
|
-
let
|
|
787
|
-
const l = /* @__PURE__ */ h((
|
|
788
|
-
const b = document.elementFromPoint(
|
|
789
|
-
let
|
|
790
|
-
if (!
|
|
785
|
+
S.log(`π±οΈ [MouseDown Success] startRow: ${i}, startCol: ${o}`), t(this, N).navigation.currentCell = s;
|
|
786
|
+
let a = i, c = o;
|
|
787
|
+
const l = /* @__PURE__ */ h((d) => {
|
|
788
|
+
const b = document.elementFromPoint(d.clientX, d.clientY);
|
|
789
|
+
let g = b == null ? void 0 : b.closest("td, th");
|
|
790
|
+
if (!g || !t(this, N).contains(g)) {
|
|
791
791
|
const m = t(this, N).querySelectorAll(".ng-part-body tbody tr:not(.nodata) td, .ng-part-body tbody tr:not(.nodata) th");
|
|
792
792
|
for (const T of m) {
|
|
793
793
|
const A = T.getBoundingClientRect();
|
|
794
|
-
if (
|
|
795
|
-
|
|
794
|
+
if (d.clientX >= A.left && d.clientX <= A.right && d.clientY >= A.top && d.clientY <= A.bottom) {
|
|
795
|
+
g = T;
|
|
796
796
|
break;
|
|
797
797
|
}
|
|
798
798
|
}
|
|
799
799
|
}
|
|
800
|
-
if (!
|
|
801
|
-
const p =
|
|
802
|
-
x < 0 ||
|
|
803
|
-
}, "onMouseMove"),
|
|
804
|
-
S.log("π±οΈ [MouseUp] Drag ended."), t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "", document.removeEventListener("mousemove", l), document.removeEventListener("mouseup",
|
|
800
|
+
if (!g || g.dataset.row === void 0 || g.dataset.col === void 0 || g.closest("tr").classList.contains("nodata")) return;
|
|
801
|
+
const p = g.closest("tr"), { matrixRow: x } = V(this, K, qt).call(this, p), w = parseInt(g.dataset.col, 10);
|
|
802
|
+
x < 0 || a === x && c === w || (a = x, c = w, this.setRange(i, o, x, w));
|
|
803
|
+
}, "onMouseMove"), u = /* @__PURE__ */ h(() => {
|
|
804
|
+
S.log("π±οΈ [MouseUp] Drag ended."), t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "", document.removeEventListener("mousemove", l), document.removeEventListener("mouseup", u);
|
|
805
805
|
}, "onMouseUp");
|
|
806
|
-
document.addEventListener("mousemove", l), document.addEventListener("mouseup",
|
|
806
|
+
document.addEventListener("mousemove", l), document.addEventListener("mouseup", u);
|
|
807
807
|
});
|
|
808
808
|
}, "#initEvents"), h(rs, "CellSelection");
|
|
809
809
|
let Le = rs;
|
|
810
|
-
var F, lt, ae, le, pt,
|
|
810
|
+
var F, lt, ae, le, pt, $e, Dt, Ot, Bt, ct, Wt, vs;
|
|
811
811
|
const os = class os {
|
|
812
812
|
constructor(n) {
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
813
|
+
f(this, pt);
|
|
814
|
+
f(this, F);
|
|
815
|
+
f(this, lt, null);
|
|
816
|
+
f(this, ae, -1);
|
|
817
|
+
f(this, le, -1);
|
|
818
|
+
f(this, Dt, /* @__PURE__ */ h((n) => {
|
|
819
819
|
const e = [];
|
|
820
820
|
return n.forEach((s) => e.push(...Array.from(s.querySelectorAll("td")))), e.length === 0 ? null : (e.sort((s, r) => parseInt(s.dataset.col, 10) - parseInt(r.dataset.col, 10)), e[e.length - 1]);
|
|
821
821
|
}, "#getMaxColCell"));
|
|
822
|
-
|
|
822
|
+
f(this, Ot, /* @__PURE__ */ h((n, e) => {
|
|
823
823
|
const s = t(this, ct).call(this, n);
|
|
824
824
|
if (s.length === 0) return e + 1;
|
|
825
825
|
let r = e + 1;
|
|
826
|
-
const
|
|
827
|
-
s.forEach((o) =>
|
|
828
|
-
for (const o of
|
|
829
|
-
const
|
|
830
|
-
if (e >=
|
|
831
|
-
r =
|
|
826
|
+
const i = [];
|
|
827
|
+
s.forEach((o) => i.push(...Array.from(o.querySelectorAll("td")))), i.sort((o, a) => parseInt(o.dataset.col, 10) - parseInt(a.dataset.col, 10));
|
|
828
|
+
for (const o of i) {
|
|
829
|
+
const a = parseInt(o.dataset.col, 10), c = parseInt(o.colSpan || 1, 10);
|
|
830
|
+
if (e >= a && e < a + c) {
|
|
831
|
+
r = a + c;
|
|
832
832
|
break;
|
|
833
833
|
}
|
|
834
834
|
}
|
|
835
835
|
return r;
|
|
836
836
|
}, "#getNextCol"));
|
|
837
|
-
|
|
837
|
+
f(this, Bt, /* @__PURE__ */ h((n, e) => {
|
|
838
838
|
const s = t(this, ct).call(this, n);
|
|
839
839
|
if (s.length === 0) return Math.max(0, e - 1);
|
|
840
840
|
let r = -1;
|
|
841
|
-
const
|
|
842
|
-
s.forEach((o) =>
|
|
843
|
-
for (const o of
|
|
844
|
-
const
|
|
845
|
-
if (
|
|
846
|
-
r =
|
|
841
|
+
const i = [];
|
|
842
|
+
s.forEach((o) => i.push(...Array.from(o.querySelectorAll("td")))), i.sort((o, a) => parseInt(o.dataset.col, 10) - parseInt(a.dataset.col, 10));
|
|
843
|
+
for (const o of i) {
|
|
844
|
+
const a = parseInt(o.dataset.col, 10);
|
|
845
|
+
if (a < e)
|
|
846
|
+
r = a;
|
|
847
847
|
else
|
|
848
848
|
break;
|
|
849
849
|
}
|
|
850
850
|
return r;
|
|
851
851
|
}, "#getPreviousCol"));
|
|
852
852
|
// π― λ κ±°μμ λ³ν© μ
(rowSpan) λΈλ‘ ν¬μ© νμ λ‘μ§ μ΄μ
|
|
853
|
-
|
|
853
|
+
f(this, ct, /* @__PURE__ */ h((n) => {
|
|
854
854
|
const e = t(this, F).querySelectorAll(
|
|
855
855
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
856
856
|
), s = [];
|
|
857
857
|
return e.forEach((r) => {
|
|
858
|
-
const
|
|
859
|
-
for (const o of
|
|
860
|
-
const
|
|
861
|
-
if (
|
|
858
|
+
const i = Array.from(r.querySelectorAll("tbody tr:not(.nodata)"));
|
|
859
|
+
for (const o of i) {
|
|
860
|
+
const a = parseInt(o.dataset.row, 10), c = i.filter((p) => parseInt(p.dataset.row, 10) === a), l = c.length > 0 ? c.length : 1, u = c.indexOf(o), d = a * l + (u >= 0 ? u : 0);
|
|
861
|
+
if (d === n) {
|
|
862
862
|
s.push(o);
|
|
863
863
|
break;
|
|
864
864
|
}
|
|
865
865
|
const b = Array.from(o.querySelectorAll("td"));
|
|
866
|
-
let
|
|
866
|
+
let g = !1;
|
|
867
867
|
for (const p of b) {
|
|
868
868
|
const x = parseInt(p.rowSpan || 1, 10);
|
|
869
|
-
if (x > 1 && n >=
|
|
870
|
-
s.push(o),
|
|
869
|
+
if (x > 1 && n >= d && n < d + x) {
|
|
870
|
+
s.push(o), g = !0;
|
|
871
871
|
break;
|
|
872
872
|
}
|
|
873
873
|
}
|
|
874
|
-
if (
|
|
874
|
+
if (g) break;
|
|
875
875
|
}
|
|
876
876
|
}), s;
|
|
877
877
|
}, "#findTargetTrsByMatrix"));
|
|
878
878
|
// π― rowSpan λ° colSpan κ²½κ³λ₯Ό λͺ¨λ μΆ©μ‘±νλ μ
μ 3λΆν μ 체 μμμμ νμ
|
|
879
|
-
|
|
880
|
-
const
|
|
879
|
+
f(this, Wt, /* @__PURE__ */ h((n, e, s, r) => {
|
|
880
|
+
const i = t(this, F).querySelectorAll(
|
|
881
881
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
882
882
|
), o = r !== void 0 ? r : n * 1 + e;
|
|
883
|
-
for (const
|
|
884
|
-
const c = Array.from(
|
|
883
|
+
for (const a of i) {
|
|
884
|
+
const c = Array.from(a.querySelectorAll("tbody tr:not(.nodata)"));
|
|
885
885
|
for (const l of c) {
|
|
886
|
-
const
|
|
886
|
+
const u = parseInt(l.dataset.row, 10), d = c.filter((w) => parseInt(w.dataset.row, 10) === u), b = d.length > 0 ? d.length : 1, g = d.indexOf(l), p = u * b + (g >= 0 ? g : 0), x = Array.from(l.querySelectorAll("td"));
|
|
887
887
|
for (const w of x) {
|
|
888
888
|
const m = parseInt(w.dataset.col, 10), T = parseInt(w.colSpan || 1, 10), A = parseInt(w.rowSpan || 1, 10);
|
|
889
889
|
if (!isNaN(m) && s >= m && s < m + T && o >= p && o < p + A && window.getComputedStyle(w).display !== "none")
|
|
@@ -904,129 +904,133 @@ const os = class os {
|
|
|
904
904
|
const e = parseInt(n.dataset.row, 10), s = parseInt(n.dataset.col, 10);
|
|
905
905
|
if (!isNaN(e) && !isNaN(s)) {
|
|
906
906
|
y(this, ae, e), y(this, le, s);
|
|
907
|
-
const r = n.closest("tr"),
|
|
908
|
-
if (
|
|
909
|
-
const
|
|
910
|
-
t(this, F).selection.setRange(
|
|
907
|
+
const r = n.closest("tr"), i = r == null ? void 0 : r.closest("tbody");
|
|
908
|
+
if (i) {
|
|
909
|
+
const a = Array.from(i.querySelectorAll("tr:not(.nodata)")).filter((d) => parseInt(d.dataset.row, 10) === e), c = a.length > 0 ? a.length : 1, l = a.indexOf(r), u = e * c + (l >= 0 ? l : 0);
|
|
910
|
+
t(this, F).selection.setRange(u, s, u, s);
|
|
911
911
|
}
|
|
912
912
|
}
|
|
913
913
|
}
|
|
914
914
|
moveCell(n) {
|
|
915
915
|
var m, T, A, M;
|
|
916
916
|
if (!t(this, lt)) return;
|
|
917
|
-
const e = t(this, lt), s = e.closest("tr"), r = parseInt(e.dataset.row, 10),
|
|
917
|
+
const e = t(this, lt), s = e.closest("tr"), r = parseInt(e.dataset.row, 10), i = parseInt(e.dataset.col, 10), o = s == null ? void 0 : s.closest("tbody");
|
|
918
918
|
if (!o) return;
|
|
919
|
-
const c = Array.from(o.querySelectorAll("tr:not(.nodata)")).filter((B) => parseInt(B.dataset.row, 10) === r), l = c.length > 0 ? c.length : 1,
|
|
920
|
-
let b =
|
|
919
|
+
const c = Array.from(o.querySelectorAll("tr:not(.nodata)")).filter((B) => parseInt(B.dataset.row, 10) === r), l = c.length > 0 ? c.length : 1, u = c.indexOf(s), d = r * l + (u >= 0 ? u : 0);
|
|
920
|
+
let b = d, g = i;
|
|
921
921
|
switch (n.code) {
|
|
922
922
|
case "Tab":
|
|
923
923
|
if (n.preventDefault(), n.shiftKey) {
|
|
924
|
-
if (
|
|
925
|
-
b =
|
|
926
|
-
const B = t(this, ct).call(this, b),
|
|
927
|
-
|
|
924
|
+
if (g = t(this, Bt).call(this, d, i), g < 0 && d > 0) {
|
|
925
|
+
b = d - 1;
|
|
926
|
+
const B = t(this, ct).call(this, b), z = t(this, Dt).call(this, B);
|
|
927
|
+
g = z ? parseInt(z.dataset.col, 10) : 0;
|
|
928
928
|
}
|
|
929
929
|
} else {
|
|
930
|
-
|
|
931
|
-
const B = t(this, ct).call(this,
|
|
932
|
-
|
|
930
|
+
g = t(this, Ot).call(this, d, i);
|
|
931
|
+
const B = t(this, ct).call(this, d), z = t(this, Dt).call(this, B), Gt = z ? parseInt(z.dataset.col, 10) + parseInt(z.colSpan || 1, 10) : 0;
|
|
932
|
+
g >= Gt && (b = d + 1, g = 0);
|
|
933
933
|
}
|
|
934
934
|
break;
|
|
935
935
|
case "ArrowRight":
|
|
936
|
-
|
|
936
|
+
g = t(this, Ot).call(this, d, i);
|
|
937
937
|
break;
|
|
938
938
|
case "ArrowLeft":
|
|
939
|
-
|
|
939
|
+
g = t(this, Bt).call(this, d, i);
|
|
940
940
|
break;
|
|
941
941
|
case "ArrowDown":
|
|
942
|
-
n.preventDefault(), b =
|
|
942
|
+
n.preventDefault(), b = d + (e.rowSpan || 1);
|
|
943
943
|
break;
|
|
944
944
|
case "ArrowUp":
|
|
945
|
-
n.preventDefault(), b = Math.max(0,
|
|
945
|
+
n.preventDefault(), b = Math.max(0, d - (e.rowSpan || 1));
|
|
946
946
|
break;
|
|
947
947
|
}
|
|
948
948
|
const p = Math.floor(b / l), x = b % l;
|
|
949
|
-
let w = t(this,
|
|
949
|
+
let w = t(this, Wt).call(this, p, x, g, b);
|
|
950
950
|
if (w)
|
|
951
|
-
this.currentCell = w, V(this, pt,
|
|
951
|
+
this.currentCell = w, V(this, pt, $e).call(this, w);
|
|
952
952
|
else if (p !== r && p >= 0) {
|
|
953
953
|
const B = ((T = (m = t(this, F)).getRowHeight) == null ? void 0 : T.call(m)) || 40;
|
|
954
954
|
(M = (A = t(this, F)).scrollToY) == null || M.call(A, p * B), setTimeout(() => {
|
|
955
|
-
const
|
|
956
|
-
|
|
955
|
+
const z = t(this, Wt).call(this, p, x, g, b);
|
|
956
|
+
z && (this.currentCell = z, V(this, pt, $e).call(this, z));
|
|
957
957
|
}, 0);
|
|
958
958
|
}
|
|
959
959
|
}
|
|
960
960
|
};
|
|
961
961
|
F = new WeakMap(), lt = new WeakMap(), ae = new WeakMap(), le = new WeakMap(), pt = new WeakSet(), // π― μ
μ΄ λ³΄μ΄μ§ μλ μμμ μμ λ 컨ν
μ΄λ μ€ν¬λ‘€μ λκΈ°ννλ ν¨μ
|
|
962
|
-
|
|
962
|
+
$e = /* @__PURE__ */ h(function(n) {
|
|
963
963
|
const e = t(this, F).querySelector(".ng-container-body .ng-part-body");
|
|
964
964
|
if (!e) return;
|
|
965
965
|
const s = n.getBoundingClientRect(), r = e.getBoundingClientRect();
|
|
966
966
|
s.top < r.top ? e.scrollTop -= r.top - s.top : s.bottom > r.bottom && (e.scrollTop += s.bottom - r.bottom), s.left < r.left ? e.scrollLeft -= r.left - s.left : s.right > r.right && (e.scrollLeft += s.right - r.right);
|
|
967
|
-
}, "#ensureCellVisible"),
|
|
967
|
+
}, "#ensureCellVisible"), Dt = new WeakMap(), Ot = new WeakMap(), Bt = new WeakMap(), ct = new WeakMap(), Wt = new WeakMap(), vs = /* @__PURE__ */ h(function() {
|
|
968
968
|
t(this, F).addEventListener("keydown", (n) => {
|
|
969
969
|
["Tab", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(n.code) && this.moveCell(n);
|
|
970
970
|
});
|
|
971
971
|
}, "#initEvents"), h(os, "CellNavigation");
|
|
972
972
|
let Me = os;
|
|
973
|
-
var ce, ht, dt,
|
|
973
|
+
var ce, ht, dt, zt, Pt, he, de, xt, fe, ge;
|
|
974
974
|
const Ct = class Ct extends HTMLElement {
|
|
975
975
|
constructor() {
|
|
976
976
|
super();
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
977
|
+
f(this, ce);
|
|
978
|
+
f(this, ht, null);
|
|
979
|
+
f(this, dt);
|
|
980
|
+
f(this, zt);
|
|
981
|
+
f(this, Pt);
|
|
982
982
|
q(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
983
983
|
S.log("sheet.invalidate()"), t(this, dt).refresh();
|
|
984
984
|
}, "invalidate"));
|
|
985
985
|
q(this, "generate", /* @__PURE__ */ h((e) => {
|
|
986
986
|
if (S.log("sheet.generate()"), !e) return;
|
|
987
987
|
y(this, ht, Ie.compile(e)), t(this, he).call(this), t(this, de).call(this);
|
|
988
|
-
const s = this.querySelector(".ng-container-body .ng-part-header"), r = this.querySelector(".ng-container-body .ng-part-footer"),
|
|
989
|
-
s &&
|
|
988
|
+
const s = this.querySelector(".ng-container-body .ng-part-header"), r = this.querySelector(".ng-container-body .ng-part-footer"), i = this.querySelector(".ng-nodata-overlay");
|
|
989
|
+
s && i && (i.style.top = `${s.offsetHeight}px`), r && i && (i.style.bottom = `${r.offsetHeight}px`), t(this, dt).initialize(), setTimeout(() => {
|
|
990
990
|
var o;
|
|
991
991
|
(o = this.querySelector("nine-table-hscrollbar")) == null || o.refresh();
|
|
992
992
|
}, 0);
|
|
993
993
|
}, "generate"));
|
|
994
|
-
|
|
994
|
+
f(this, he, /* @__PURE__ */ h(() => {
|
|
995
995
|
[
|
|
996
996
|
{ selector: ".ng-container-body", type: null },
|
|
997
997
|
{ selector: ".ng-container-left", type: "left" },
|
|
998
998
|
{ selector: ".ng-container-right", type: "right" }
|
|
999
999
|
].forEach(({ selector: s, type: r }) => {
|
|
1000
|
-
var
|
|
1001
|
-
(
|
|
1000
|
+
var i, o, a;
|
|
1001
|
+
(i = this.querySelector(`${s} .ng-part-header`)) == null || i.appendChild(t(this, xt).call(this, t(this, ht), r, "header")), (o = this.querySelector(`${s} .ng-virtual-spacer`)) == null || o.before(t(this, xt).call(this, t(this, ht), r, "body")), (a = this.querySelector(`${s} .ng-part-footer`)) == null || a.appendChild(t(this, xt).call(this, t(this, ht), r, "footer"));
|
|
1002
1002
|
});
|
|
1003
1003
|
}, "#renderSplitContainers"));
|
|
1004
|
-
|
|
1004
|
+
f(this, de, /* @__PURE__ */ h(() => {
|
|
1005
1005
|
["left", "right", "body"].forEach((e) => {
|
|
1006
1006
|
const s = this.querySelector(`.ng-container-${e}`), r = s == null ? void 0 : s.querySelectorAll("table");
|
|
1007
1007
|
if (!s || !r || r.length === 0) return;
|
|
1008
|
-
let
|
|
1008
|
+
let i = 0;
|
|
1009
1009
|
r[0].querySelectorAll("col").forEach((o) => {
|
|
1010
|
-
const
|
|
1011
|
-
isNaN(
|
|
1012
|
-
}), e === "body" ? s.style.flex = "1"
|
|
1010
|
+
const a = parseInt(o.getAttribute("width"), 10);
|
|
1011
|
+
isNaN(a) || (i += a);
|
|
1012
|
+
}), e === "body" ? (s.style.flex = "1", r.forEach((o) => {
|
|
1013
|
+
o.style.width = `${i}px`, o.style.minWidth = `${i}px`;
|
|
1014
|
+
})) : (s.style.flex = `0 0 ${i}px`, s.style.width = `${i}px`, r.forEach((o) => {
|
|
1015
|
+
o.style.width = `${i}px`, o.style.minWidth = `${i}px`;
|
|
1016
|
+
}));
|
|
1013
1017
|
});
|
|
1014
1018
|
}, "#updateContainerWidths"));
|
|
1015
|
-
|
|
1016
|
-
const
|
|
1019
|
+
f(this, xt, /* @__PURE__ */ h((e, s, r) => {
|
|
1020
|
+
const i = e.cloneNode(!0), o = i.querySelector("thead"), a = i.querySelector("tbody"), c = i.querySelector("tfoot");
|
|
1017
1021
|
if (r === "header") {
|
|
1018
|
-
if (
|
|
1019
|
-
const
|
|
1020
|
-
|
|
1022
|
+
if (a && a.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
1023
|
+
const u = document.createElement("tbody");
|
|
1024
|
+
u.className = "fixed-tbody", i.appendChild(u);
|
|
1021
1025
|
}
|
|
1022
|
-
} else r === "body" ? (o && o.remove(), c && c.remove(),
|
|
1023
|
-
return s === "left" ?
|
|
1026
|
+
} else r === "body" ? (o && o.remove(), c && c.remove(), a && (a.className = "bindable-tbody")) : r === "footer" && (o && o.remove(), a && a.remove());
|
|
1027
|
+
return s === "left" ? i.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
1024
1028
|
l.getAttribute("fixed") !== "left" && l.remove();
|
|
1025
|
-
}) : s === "right" ?
|
|
1029
|
+
}) : s === "right" ? i.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
1026
1030
|
l.getAttribute("fixed") !== "right" && l.remove();
|
|
1027
|
-
}) :
|
|
1031
|
+
}) : i.querySelectorAll("[fixed=left], [fixed=right]").forEach((l) => {
|
|
1028
1032
|
l.remove();
|
|
1029
|
-
}),
|
|
1033
|
+
}), i;
|
|
1030
1034
|
}, "#createSplitTable"));
|
|
1031
1035
|
q(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, dt).getRowHeight(), "getRowHeight"));
|
|
1032
1036
|
q(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
@@ -1037,10 +1041,10 @@ const Ct = class Ct extends HTMLElement {
|
|
|
1037
1041
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
1038
1042
|
s && (s.scrollTop = e);
|
|
1039
1043
|
}, "scrollToY"));
|
|
1040
|
-
|
|
1041
|
-
t(this, ge).call(this), y(this,
|
|
1044
|
+
f(this, fe, /* @__PURE__ */ h(() => {
|
|
1045
|
+
t(this, ge).call(this), y(this, zt, new Le(this)), y(this, Pt, new Me(this));
|
|
1042
1046
|
}, "#init"));
|
|
1043
|
-
|
|
1047
|
+
f(this, ge, /* @__PURE__ */ h(() => {
|
|
1044
1048
|
const e = Ct.SCROLLBAR_SIZE;
|
|
1045
1049
|
this.innerHTML = `
|
|
1046
1050
|
<style>
|
|
@@ -1248,7 +1252,7 @@ const Ct = class Ct extends HTMLElement {
|
|
|
1248
1252
|
t(this, fe).call(this);
|
|
1249
1253
|
}
|
|
1250
1254
|
get selection() {
|
|
1251
|
-
return t(this,
|
|
1255
|
+
return t(this, zt);
|
|
1252
1256
|
}
|
|
1253
1257
|
get navigation() {
|
|
1254
1258
|
return t(this, Pt);
|
|
@@ -1257,50 +1261,50 @@ const Ct = class Ct extends HTMLElement {
|
|
|
1257
1261
|
this.innerHTML = "", S.log("NineTableSheet destroyed.");
|
|
1258
1262
|
}
|
|
1259
1263
|
};
|
|
1260
|
-
ce = new WeakMap(), ht = new WeakMap(), dt = new WeakMap(),
|
|
1264
|
+
ce = new WeakMap(), ht = new WeakMap(), dt = new WeakMap(), zt = new WeakMap(), Pt = new WeakMap(), he = new WeakMap(), de = new WeakMap(), xt = new WeakMap(), fe = new WeakMap(), ge = new WeakMap(), h(Ct, "NineTableSheet"), q(Ct, "SCROLLBAR_SIZE", 16);
|
|
1261
1265
|
let Zt = Ct;
|
|
1262
1266
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", Zt);
|
|
1263
1267
|
var ue, Ft;
|
|
1264
1268
|
const is = class is extends HTMLElement {
|
|
1265
1269
|
constructor() {
|
|
1266
1270
|
super();
|
|
1267
|
-
|
|
1271
|
+
f(this, ue, /* @__PURE__ */ h(() => {
|
|
1268
1272
|
var e;
|
|
1269
1273
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
1270
1274
|
var o;
|
|
1271
|
-
const r = s.ctrlKey || s.metaKey || s.shiftKey,
|
|
1272
|
-
t(this, Ft).call(this,
|
|
1275
|
+
const r = s.ctrlKey || s.metaKey || s.shiftKey, i = parseInt((o = s.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
|
|
1276
|
+
t(this, Ft).call(this, i, r);
|
|
1273
1277
|
}), t(this, Ft).call(this, 0, !1);
|
|
1274
1278
|
}, "#init"));
|
|
1275
|
-
|
|
1279
|
+
f(this, Ft, /* @__PURE__ */ h((e, s = !1) => {
|
|
1276
1280
|
const r = /* @__PURE__ */ h(() => {
|
|
1277
|
-
const
|
|
1278
|
-
Array.from(this.querySelectorAll("nine-splitter")).forEach((
|
|
1279
|
-
const b =
|
|
1280
|
-
b.length < 2 || b.forEach((
|
|
1281
|
-
const p = parseInt(
|
|
1281
|
+
const u = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
1282
|
+
Array.from(this.querySelectorAll("nine-splitter")).forEach((g) => g.style.setProperty("display", "none"));
|
|
1283
|
+
const b = u.filter((g) => g.classList.contains("active"));
|
|
1284
|
+
b.length < 2 || b.forEach((g) => {
|
|
1285
|
+
const p = parseInt(g.getAttribute("data-index"), 10), x = this.querySelector(`nine-splitter[data-split-index="${p}"]`), w = u[p + 1];
|
|
1282
1286
|
x && w && w.classList.contains("active") && x.style.setProperty("display", "flex");
|
|
1283
1287
|
});
|
|
1284
|
-
}, "updateSplitters"),
|
|
1285
|
-
if (!
|
|
1288
|
+
}, "updateSplitters"), i = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = i.querySelectorAll(".nine-tab-item"), c = o.querySelectorAll("nine-table-sheet");
|
|
1289
|
+
if (!a[e]) return;
|
|
1286
1290
|
if (!s)
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
}), c.forEach((
|
|
1290
|
-
const b =
|
|
1291
|
-
|
|
1291
|
+
a.forEach((u, d) => {
|
|
1292
|
+
u.classList.toggle("active", d === e);
|
|
1293
|
+
}), c.forEach((u, d) => {
|
|
1294
|
+
const b = d === e;
|
|
1295
|
+
u.classList.toggle("active", b), u.style.flex = b ? "1 1 100%" : "";
|
|
1292
1296
|
});
|
|
1293
1297
|
else {
|
|
1294
|
-
const
|
|
1295
|
-
if (
|
|
1298
|
+
const u = a[e], d = i.querySelectorAll(".nine-tab-item.active");
|
|
1299
|
+
if (u.classList.contains("active") && d.length <= 1)
|
|
1296
1300
|
return;
|
|
1297
|
-
|
|
1301
|
+
u.classList.toggle("active");
|
|
1298
1302
|
const b = o.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
1299
1303
|
b && (b.classList.toggle("active"), b.classList.contains("active") || (b.style.flex = ""));
|
|
1300
1304
|
}
|
|
1301
1305
|
const l = o.querySelectorAll("nine-table-sheet.active");
|
|
1302
|
-
l == null || l.forEach((
|
|
1303
|
-
|
|
1306
|
+
l == null || l.forEach((u) => {
|
|
1307
|
+
u.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
1304
1308
|
}), r();
|
|
1305
1309
|
}, "#switchSheet"));
|
|
1306
1310
|
}
|
|
@@ -1309,29 +1313,29 @@ const is = class is extends HTMLElement {
|
|
|
1309
1313
|
}
|
|
1310
1314
|
};
|
|
1311
1315
|
ue = new WeakMap(), Ft = new WeakMap(), h(is, "NineTableSheets");
|
|
1312
|
-
let
|
|
1313
|
-
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets",
|
|
1316
|
+
let He = is;
|
|
1317
|
+
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", He);
|
|
1314
1318
|
var _, be, jt, pe;
|
|
1315
1319
|
const as = class as {
|
|
1316
1320
|
constructor(n) {
|
|
1317
|
-
|
|
1318
|
-
|
|
1321
|
+
f(this, _);
|
|
1322
|
+
f(this, be, /* @__PURE__ */ h(() => {
|
|
1319
1323
|
t(this, pe).call(this), new ResizeObserver((n) => {
|
|
1320
1324
|
for (let e of n)
|
|
1321
1325
|
t(this, _).getAttribute("auto-height") === "true" && t(this, jt).call(this);
|
|
1322
1326
|
}).observe(t(this, _));
|
|
1323
1327
|
}, "#init"));
|
|
1324
|
-
|
|
1328
|
+
f(this, jt, /* @__PURE__ */ h(() => {
|
|
1325
1329
|
var c, l;
|
|
1326
1330
|
const n = Array.from(t(this, _).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
1327
1331
|
if (n.length === 0) return;
|
|
1328
|
-
const e = parseInt(t(this, _).getAttribute("max-display-row"), 10) || 10, s = Math.max(...n.map((
|
|
1329
|
-
t(this, _).style.height = `${
|
|
1332
|
+
const e = parseInt(t(this, _).getAttribute("max-display-row"), 10) || 10, s = Math.max(...n.map((u) => u.getRowHeight())), r = (c = t(this, _).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, i = (l = t(this, _).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = Zt.SCROLLBAR_SIZE, a = e * s + r + i + o;
|
|
1333
|
+
t(this, _).style.height = `${a}px`;
|
|
1330
1334
|
}, "#applyAutoHeight"));
|
|
1331
|
-
|
|
1332
|
-
const e = Array.from(t(this, _).children).filter((c) => c.tagName === "TABLE"), s = t(this, _).getAttribute("auto-height") === "true", r = e.length,
|
|
1333
|
-
const
|
|
1334
|
-
return
|
|
1335
|
+
f(this, pe, /* @__PURE__ */ h(() => {
|
|
1336
|
+
const e = Array.from(t(this, _).children).filter((c) => c.tagName === "TABLE"), s = t(this, _).getAttribute("auto-height") === "true", r = e.length, i = e.map((c, l) => {
|
|
1337
|
+
const d = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, b = l < r - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
1338
|
+
return d + b;
|
|
1335
1339
|
}).join(""), o = e.map((c, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
1336
1340
|
t(this, _).shadowRoot.innerHTML = `
|
|
1337
1341
|
<style>
|
|
@@ -1444,7 +1448,7 @@ const as = class as {
|
|
|
1444
1448
|
<nine-table-body>
|
|
1445
1449
|
<nine-table-summary></nine-table-summary>
|
|
1446
1450
|
<nine-table-sheets>
|
|
1447
|
-
<nine-table-sheets-body>${
|
|
1451
|
+
<nine-table-sheets-body>${i}</nine-table-sheets-body>
|
|
1448
1452
|
<nine-table-sheets-footer>
|
|
1449
1453
|
<div class="nine-tab-bar">${o}</div>
|
|
1450
1454
|
<div class="sheets-counter">Total : <span id="row-count">0</span></div>
|
|
@@ -1454,8 +1458,8 @@ const as = class as {
|
|
|
1454
1458
|
</nine-table-body>
|
|
1455
1459
|
<nine-table-footer></nine-table-footer>
|
|
1456
1460
|
`, t(this, _).shadowRoot.querySelector("nine-table-sheets").classList.add("nodata");
|
|
1457
|
-
const
|
|
1458
|
-
|
|
1461
|
+
const a = t(this, _).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1462
|
+
a == null || a.forEach((c, l) => {
|
|
1459
1463
|
e[l] && setTimeout(() => {
|
|
1460
1464
|
c.generate(e[l]), s && t(this, jt).call(this);
|
|
1461
1465
|
});
|
|
@@ -1469,8 +1473,8 @@ let Ne = as;
|
|
|
1469
1473
|
var Yt, wt;
|
|
1470
1474
|
const ls = class ls {
|
|
1471
1475
|
constructor(n) {
|
|
1472
|
-
|
|
1473
|
-
|
|
1476
|
+
f(this, Yt);
|
|
1477
|
+
f(this, wt, -1);
|
|
1474
1478
|
q(this, "count", /* @__PURE__ */ h(() => t(this, Yt).rawRecords.length, "count"));
|
|
1475
1479
|
y(this, Yt, n);
|
|
1476
1480
|
}
|
|
@@ -1484,18 +1488,18 @@ const ls = class ls {
|
|
|
1484
1488
|
};
|
|
1485
1489
|
Yt = new WeakMap(), wt = new WeakMap(), h(ls, "ngRow");
|
|
1486
1490
|
let _e = ls;
|
|
1487
|
-
var
|
|
1491
|
+
var O, I, W, vt, ye, J, me, ft, Vt, xe, we, St;
|
|
1488
1492
|
const P = class P {
|
|
1489
1493
|
constructor(n, e) {
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1494
|
+
f(this, O);
|
|
1495
|
+
f(this, I);
|
|
1496
|
+
f(this, W, []);
|
|
1497
|
+
f(this, vt, []);
|
|
1498
|
+
f(this, ye, 0);
|
|
1499
|
+
f(this, J, []);
|
|
1500
|
+
f(this, me, /* @__PURE__ */ h(() => {
|
|
1497
1501
|
y(this, J, []);
|
|
1498
|
-
const n = t(this,
|
|
1502
|
+
const n = t(this, O).template || [];
|
|
1499
1503
|
Array.from(n).forEach((e) => {
|
|
1500
1504
|
var s;
|
|
1501
1505
|
t(this, J).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
@@ -1503,19 +1507,19 @@ const P = class P {
|
|
|
1503
1507
|
e.__ng || (e.__ng = t(this, Vt).call(this)), e.__ng.height = t(this, J).slice();
|
|
1504
1508
|
});
|
|
1505
1509
|
}, "#initialize"));
|
|
1506
|
-
|
|
1507
|
-
const n = t(this,
|
|
1508
|
-
n == null || n.classList.toggle("nodata", this.length === 0), t(this,
|
|
1510
|
+
f(this, ft, /* @__PURE__ */ h(() => {
|
|
1511
|
+
const n = t(this, O).shadowRoot.querySelector("nine-table-sheets");
|
|
1512
|
+
n == null || n.classList.toggle("nodata", this.length === 0), t(this, O).shadowRoot.querySelectorAll("nine-table-sheet").forEach((e) => {
|
|
1509
1513
|
e.invalidate();
|
|
1510
1514
|
});
|
|
1511
1515
|
}, "#invalidate"));
|
|
1512
1516
|
q(this, "get", /* @__PURE__ */ h((n, e) => {
|
|
1513
|
-
var
|
|
1517
|
+
var i;
|
|
1514
1518
|
const s = this.getValidData();
|
|
1515
1519
|
if (!s || s.length <= 0) return;
|
|
1516
1520
|
if (n == null) return t(this, St).call(this, s);
|
|
1517
1521
|
if (n < 0 || n >= s.length) return null;
|
|
1518
|
-
const r = typeof ((
|
|
1522
|
+
const r = typeof ((i = t(this, O).fields) == null ? void 0 : i.get) == "function" ? t(this, O).fields.get() : [];
|
|
1519
1523
|
if (e != null) {
|
|
1520
1524
|
const o = r.indexOf(e);
|
|
1521
1525
|
return o >= 0 ? s[n].v[o] : null;
|
|
@@ -1525,7 +1529,7 @@ const P = class P {
|
|
|
1525
1529
|
q(this, "set", /* @__PURE__ */ h((n) => {
|
|
1526
1530
|
this.clear(), this.add(n, !1), t(this, ft).call(this);
|
|
1527
1531
|
}, "set"));
|
|
1528
|
-
|
|
1532
|
+
f(this, Vt, /* @__PURE__ */ h(() => ({
|
|
1529
1533
|
rowState: P.ROW_STATE.EMPTY,
|
|
1530
1534
|
deleted: !1,
|
|
1531
1535
|
filtered: !1,
|
|
@@ -1535,24 +1539,24 @@ const P = class P {
|
|
|
1535
1539
|
_: [0, 0, 0, 0, P.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, J).slice(), -1, {}, {}]
|
|
1536
1540
|
}), "#getDefaultMeta"));
|
|
1537
1541
|
q(this, "reset", /* @__PURE__ */ h(() => {
|
|
1538
|
-
y(this,
|
|
1542
|
+
y(this, W, []), y(this, vt, []), t(this, ft).call(this);
|
|
1539
1543
|
}, "reset"));
|
|
1540
1544
|
q(this, "clear", /* @__PURE__ */ h(() => {
|
|
1541
1545
|
var n;
|
|
1542
|
-
t(this, I).rawRecords = [], y(this,
|
|
1546
|
+
t(this, I).rawRecords = [], y(this, W, []), y(this, vt, []), (n = t(this, I).viewRecords) != null && n.reset && t(this, I).viewRecords.reset();
|
|
1543
1547
|
}, "clear"));
|
|
1544
|
-
|
|
1548
|
+
f(this, xe, /* @__PURE__ */ h((n) => {
|
|
1545
1549
|
var r;
|
|
1546
1550
|
Array.isArray(n) || (n = [n]);
|
|
1547
|
-
const e = typeof ((r = t(this,
|
|
1548
|
-
return n.forEach((
|
|
1551
|
+
const e = typeof ((r = t(this, O).fields) == null ? void 0 : r.get) == "function" ? t(this, O).fields.get() : Object.keys(n[0] || {}), s = [];
|
|
1552
|
+
return n.forEach((i) => {
|
|
1549
1553
|
const o = { v: [] };
|
|
1550
|
-
e.forEach((
|
|
1551
|
-
o.v.push(a
|
|
1554
|
+
e.forEach((a) => {
|
|
1555
|
+
o.v.push(i[a] !== void 0 && i[a] !== null ? i[a] : "");
|
|
1552
1556
|
}), s.push(o);
|
|
1553
1557
|
}), s;
|
|
1554
1558
|
}, "#json2Array"));
|
|
1555
|
-
|
|
1559
|
+
f(this, we, /* @__PURE__ */ h((n) => (Array.isArray(n) || (n = [n]), n.forEach((e) => {
|
|
1556
1560
|
e.__ng = t(this, Vt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = P.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1557
1561
|
}), n), "#defaultInsert"));
|
|
1558
1562
|
q(this, "add", /* @__PURE__ */ h((n, e = !0) => {
|
|
@@ -1560,18 +1564,18 @@ const P = class P {
|
|
|
1560
1564
|
const s = t(this, xe).call(this, n);
|
|
1561
1565
|
t(this, I).rawRecords = t(this, I).rawRecords.concat(t(this, we).call(this, s)), this.resetRecords();
|
|
1562
1566
|
const r = this.count() - 1;
|
|
1563
|
-
return e || s.forEach((
|
|
1564
|
-
const
|
|
1565
|
-
|
|
1567
|
+
return e || s.forEach((i, o) => {
|
|
1568
|
+
const a = t(this, I).rawRecords[r - o];
|
|
1569
|
+
a && (a.__ng.rowState = P.ROW_STATE.EMPTY);
|
|
1566
1570
|
}), t(this, ft).call(this), r;
|
|
1567
1571
|
}, "add"));
|
|
1568
1572
|
q(this, "delete", /* @__PURE__ */ h((n) => {
|
|
1569
1573
|
let e = [];
|
|
1570
1574
|
Array.isArray(n) ? e = n : typeof n > "u" ? e = [t(this, I).host.row.at] : e = [parseInt(n, 10)], e.sort((s, r) => r - s).forEach((s) => {
|
|
1571
|
-
if (t(this,
|
|
1572
|
-
const r = t(this,
|
|
1573
|
-
t(this,
|
|
1574
|
-
|
|
1575
|
+
if (t(this, W)[s]) {
|
|
1576
|
+
const r = t(this, W)[s].__ng.rowid;
|
|
1577
|
+
t(this, W)[s].__ng.rowState === P.ROW_STATE.INSERT ? t(this, I).rawRecords = t(this, I).rawRecords.filter((i) => i.__ng.rowid !== r) : t(this, I).rawRecords.forEach((i) => {
|
|
1578
|
+
i.__ng.rowid === r && (i.__ng.deleted = !0, i.__ng.rowState = P.ROW_STATE.DELETE);
|
|
1575
1579
|
});
|
|
1576
1580
|
}
|
|
1577
1581
|
}), this.resetRecords(), t(this, ft).call(this);
|
|
@@ -1579,34 +1583,34 @@ const P = class P {
|
|
|
1579
1583
|
q(this, "setValue", /* @__PURE__ */ h((n, e, s) => {
|
|
1580
1584
|
var c;
|
|
1581
1585
|
n = parseInt(n, 10);
|
|
1582
|
-
const
|
|
1583
|
-
if (
|
|
1586
|
+
const i = (typeof ((c = t(this, O).fields) == null ? void 0 : c.get) == "function" ? t(this, O).fields.get() : []).indexOf(e);
|
|
1587
|
+
if (i < 0) return;
|
|
1584
1588
|
const o = this.getValidData()[n];
|
|
1585
1589
|
if (!o) return;
|
|
1586
|
-
const
|
|
1587
|
-
|
|
1590
|
+
const a = o.v[i];
|
|
1591
|
+
a !== s && o.__ng.rowState !== P.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = a), o.__ng.rowState = P.ROW_STATE.UPDATE), o.v[i] = s;
|
|
1588
1592
|
}, "setValue"));
|
|
1589
1593
|
q(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1590
|
-
y(this, vt, t(this, I).rawRecords.filter((n) => !n.__ng.deleted)), y(this,
|
|
1594
|
+
y(this, vt, t(this, I).rawRecords.filter((n) => !n.__ng.deleted)), y(this, W, t(this, I).rawRecords.filter((n) => !n.__ng.deleted && !n.__ng.filtered)), t(this, I).rawRecords.forEach((n, e) => {
|
|
1591
1595
|
n.__ng.rowidx = e;
|
|
1592
|
-
}), t(this,
|
|
1596
|
+
}), t(this, W).forEach((n, e) => {
|
|
1593
1597
|
n.__ng.i = e;
|
|
1594
1598
|
});
|
|
1595
1599
|
}, "resetRecords"));
|
|
1596
|
-
q(this, "getValidData", /* @__PURE__ */ h(() => (t(this,
|
|
1597
|
-
|
|
1600
|
+
q(this, "getValidData", /* @__PURE__ */ h(() => (t(this, W).length === 0 && t(this, I).rawRecords.length > 0 && this.resetRecords(), t(this, W)), "getValidData"));
|
|
1601
|
+
f(this, St, /* @__PURE__ */ h((n) => {
|
|
1598
1602
|
var o;
|
|
1599
1603
|
if (!n) return n;
|
|
1600
|
-
const e = !Array.isArray(n), s = e ? [n] : n, r = typeof ((o = t(this,
|
|
1604
|
+
const e = !Array.isArray(n), s = e ? [n] : n, r = typeof ((o = t(this, O).fields) == null ? void 0 : o.get) == "function" ? t(this, O).fields.get() : [], i = s.filter((a) => !a.__ng.deleted).map((a) => {
|
|
1601
1605
|
const c = {};
|
|
1602
|
-
return r.forEach((l,
|
|
1603
|
-
c[l] =
|
|
1604
|
-
}), c.__ng =
|
|
1606
|
+
return r.forEach((l, u) => {
|
|
1607
|
+
c[l] = a.v ? a.v[u] : a[l];
|
|
1608
|
+
}), c.__ng = a.__ng, c;
|
|
1605
1609
|
});
|
|
1606
|
-
return e ?
|
|
1610
|
+
return e ? i[0] : i;
|
|
1607
1611
|
}, "#conv"));
|
|
1608
1612
|
q(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1609
|
-
y(this,
|
|
1613
|
+
y(this, O, n), y(this, I, e), t(this, me).call(this);
|
|
1610
1614
|
}
|
|
1611
1615
|
get source() {
|
|
1612
1616
|
return t(this, St).call(this, t(this, I).rawRecords);
|
|
@@ -1618,16 +1622,16 @@ const P = class P {
|
|
|
1618
1622
|
return ++xs(this, ye)._;
|
|
1619
1623
|
}
|
|
1620
1624
|
get count() {
|
|
1621
|
-
return t(this,
|
|
1625
|
+
return t(this, W).length;
|
|
1622
1626
|
}
|
|
1623
1627
|
get length() {
|
|
1624
|
-
return t(this,
|
|
1628
|
+
return t(this, W).length;
|
|
1625
1629
|
}
|
|
1626
1630
|
getRowCount() {
|
|
1627
1631
|
return this.length;
|
|
1628
1632
|
}
|
|
1629
1633
|
};
|
|
1630
|
-
|
|
1634
|
+
O = new WeakMap(), I = new WeakMap(), W = new WeakMap(), vt = new WeakMap(), ye = new WeakMap(), J = new WeakMap(), me = new WeakMap(), ft = new WeakMap(), Vt = new WeakMap(), xe = new WeakMap(), we = new WeakMap(), St = new WeakMap(), h(P, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1631
1635
|
q(P, "ROW_STATE", {
|
|
1632
1636
|
EMPTY: "EMPTY",
|
|
1633
1637
|
NORMAL: "NORMAL",
|
|
@@ -1635,21 +1639,21 @@ q(P, "ROW_STATE", {
|
|
|
1635
1639
|
UPDATE: "UPDATE",
|
|
1636
1640
|
DELETE: "DELETE"
|
|
1637
1641
|
});
|
|
1638
|
-
let
|
|
1642
|
+
let De = P;
|
|
1639
1643
|
var gt;
|
|
1640
1644
|
const cs = class cs {
|
|
1641
1645
|
constructor(n) {
|
|
1642
|
-
|
|
1643
|
-
y(this, gt, n), this.row = new _e(this), this.data = new
|
|
1646
|
+
f(this, gt);
|
|
1647
|
+
y(this, gt, n), this.row = new _e(this), this.data = new De(t(this, gt), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1644
1648
|
var e;
|
|
1645
1649
|
(e = t(this, gt).view) != null && e.redraw && t(this, gt).view.redraw();
|
|
1646
1650
|
}, this.setDataSource = (e) => {
|
|
1647
1651
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1648
1652
|
}, this.getRowState = (e) => {
|
|
1649
|
-
var r,
|
|
1653
|
+
var r, i;
|
|
1650
1654
|
const s = parseInt(e, 10);
|
|
1651
1655
|
if (!(s >= this.data.count()))
|
|
1652
|
-
return (
|
|
1656
|
+
return (i = (r = this.data.getValidData()[s]) == null ? void 0 : r.__ng) == null ? void 0 : i.rowState;
|
|
1653
1657
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1654
1658
|
this.row.at = e;
|
|
1655
1659
|
}, this.scrollTo_V1 = (e) => (e < 0 && (e = 0), e >= this.rawRecords.length && (e = this.rawRecords.length - 1), this.viewRecords.rawIndex = e, this.viewRecords.reset && this.viewRecords.reset(), !(e <= 0 || e >= this.rawRecords.length - 1)), this.getColumn = (e, s) => this.data.get(e, s), this.setColumn = (e, s, r) => {
|
|
@@ -1658,49 +1662,49 @@ const cs = class cs {
|
|
|
1658
1662
|
}
|
|
1659
1663
|
};
|
|
1660
1664
|
gt = new WeakMap(), h(cs, "ngDataManager");
|
|
1661
|
-
let
|
|
1665
|
+
let Oe = cs;
|
|
1662
1666
|
var Rt, H, Ut, ve;
|
|
1663
1667
|
const hs = class hs {
|
|
1664
1668
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1665
1669
|
constructor(n) {
|
|
1666
|
-
|
|
1667
|
-
|
|
1670
|
+
f(this, Rt);
|
|
1671
|
+
f(this, H, []);
|
|
1668
1672
|
q(this, "add", /* @__PURE__ */ h((n, e = "string") => {
|
|
1669
1673
|
n.forEach((s) => {
|
|
1670
1674
|
t(this, H).some((r) => r.name === s) || t(this, H).push({ name: s, type: e });
|
|
1671
1675
|
}), t(this, Ut).call(this);
|
|
1672
1676
|
}, "add"));
|
|
1673
|
-
|
|
1677
|
+
f(this, Ut, /* @__PURE__ */ h(() => {
|
|
1674
1678
|
const n = /* @__PURE__ */ new Map();
|
|
1675
1679
|
t(this, H).forEach((e) => {
|
|
1676
1680
|
n.set(e.name, e.type);
|
|
1677
1681
|
}), y(this, H, Array.from(n, ([e, s]) => ({ name: e, type: s }))), y(this, H, t(this, H).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, H).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
1678
1682
|
}, "#adjust"));
|
|
1679
|
-
|
|
1683
|
+
f(this, ve, /* @__PURE__ */ h(() => {
|
|
1680
1684
|
y(this, H, []), S.log(t(this, Rt).querySelectorAll("table"));
|
|
1681
1685
|
const n = Array.from(t(this, Rt).querySelectorAll("table"));
|
|
1682
1686
|
if (!(!n || n.length === 0)) {
|
|
1683
1687
|
for (const e of n)
|
|
1684
1688
|
S.log(e), $("[data-bind]", e).each((s, r) => {
|
|
1685
|
-
const
|
|
1686
|
-
|
|
1689
|
+
const i = r.dataset.bind, o = r.getAttribute("data-type") || "string";
|
|
1690
|
+
i && t(this, H).push({ name: i, type: o });
|
|
1687
1691
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
1688
|
-
$(`[${s}]`, e).each((r,
|
|
1689
|
-
var o =
|
|
1692
|
+
$(`[${s}]`, e).each((r, i) => {
|
|
1693
|
+
var o = i.getAttribute(s);
|
|
1690
1694
|
if (o.indexOf("data.") < 0) {
|
|
1691
|
-
const
|
|
1692
|
-
if (
|
|
1695
|
+
const a = o.search(/[(]/g);
|
|
1696
|
+
if (a > 0)
|
|
1693
1697
|
try {
|
|
1694
|
-
o = String(window[o.substring(0,
|
|
1698
|
+
o = String(window[o.substring(0, a).trim()]);
|
|
1695
1699
|
} catch {
|
|
1696
1700
|
o = "";
|
|
1697
1701
|
}
|
|
1698
1702
|
}
|
|
1699
|
-
o.split("data.").forEach((
|
|
1700
|
-
if (
|
|
1701
|
-
const c =
|
|
1703
|
+
o.split("data.").forEach((a) => {
|
|
1704
|
+
if (a.trim() != "") {
|
|
1705
|
+
const c = a.search(/[^_A-Za-z0-9]/g);
|
|
1702
1706
|
let l = "";
|
|
1703
|
-
c >= 0 ? l =
|
|
1707
|
+
c >= 0 ? l = a.substring(0, c) : o.startsWith("data.") && (l = a.replace("data.", "")), l && t(this, H).push({ name: l, type: "string" });
|
|
1704
1708
|
}
|
|
1705
1709
|
});
|
|
1706
1710
|
});
|
|
@@ -1737,12 +1741,12 @@ const ds = class ds extends HTMLElement {
|
|
|
1737
1741
|
constructor() {
|
|
1738
1742
|
super();
|
|
1739
1743
|
//#created = false;
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1744
|
+
f(this, ut);
|
|
1745
|
+
f(this, Se);
|
|
1746
|
+
f(this, Re, /* @__PURE__ */ h(() => {
|
|
1743
1747
|
this.fields = new Be(this), y(this, Se, new Ne(this)), S.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1744
1748
|
}, "#init"));
|
|
1745
|
-
this.attachShadow({ mode: "open" }), y(this, ut, new
|
|
1749
|
+
this.attachShadow({ mode: "open" }), y(this, ut, new Oe(this));
|
|
1746
1750
|
}
|
|
1747
1751
|
connectedCallback() {
|
|
1748
1752
|
t(this, Re).call(this);
|
|
@@ -1764,8 +1768,8 @@ const ds = class ds extends HTMLElement {
|
|
|
1764
1768
|
}
|
|
1765
1769
|
};
|
|
1766
1770
|
ut = new WeakMap(), Se = new WeakMap(), Re = new WeakMap(), h(ds, "NineTable");
|
|
1767
|
-
let
|
|
1768
|
-
customElements.get("nine-table") || customElements.define("nine-table",
|
|
1771
|
+
let We = ds;
|
|
1772
|
+
customElements.get("nine-table") || customElements.define("nine-table", We);
|
|
1769
1773
|
const Tt = class Tt extends HTMLElement {
|
|
1770
1774
|
// π 컀μ€ν
μ€νμΌμ© μΊμ μΆκ°
|
|
1771
1775
|
constructor() {
|
|
@@ -1778,18 +1782,18 @@ const Tt = class Tt extends HTMLElement {
|
|
|
1778
1782
|
}
|
|
1779
1783
|
};
|
|
1780
1784
|
h(Tt, "BasicCellElement"), q(Tt, "_styleCache", /* @__PURE__ */ new Map()), q(Tt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1781
|
-
let
|
|
1785
|
+
let ze = Tt;
|
|
1782
1786
|
var L, Xt, v, Xe, Ke, Ge, Ze, Je;
|
|
1783
|
-
const fs = class fs extends
|
|
1787
|
+
const fs = class fs extends ze {
|
|
1784
1788
|
constructor() {
|
|
1785
1789
|
super();
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1790
|
+
f(this, L);
|
|
1791
|
+
f(this, Xt);
|
|
1792
|
+
f(this, v);
|
|
1793
|
+
f(this, Xe);
|
|
1794
|
+
f(this, Ke);
|
|
1795
|
+
f(this, Ge);
|
|
1796
|
+
f(this, Ze);
|
|
1793
1797
|
q(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1794
1798
|
if (t(this, v))
|
|
1795
1799
|
if (t(this, v).closest("tbody")) {
|
|
@@ -1810,7 +1814,7 @@ const fs = class fs extends We {
|
|
|
1810
1814
|
} catch {
|
|
1811
1815
|
}
|
|
1812
1816
|
}, "getDisplayText"));
|
|
1813
|
-
|
|
1817
|
+
f(this, Je, /* @__PURE__ */ h(() => {
|
|
1814
1818
|
if (!(!t(this, L) || !t(this, L).template || !t(this, v).closest("tbody.bindable"))) {
|
|
1815
1819
|
var e = ninegrid.j.querySelectorAll(t(this, v)).attr("suppress");
|
|
1816
1820
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
@@ -1819,27 +1823,27 @@ const fs = class fs extends We {
|
|
|
1819
1823
|
var A = ninegrid.j.querySelectorAll(T).attr("suppress");
|
|
1820
1824
|
A && T.dataset.row && (A = parseInt(A), !isNaN(A) && A <= e && r.push(A));
|
|
1821
1825
|
}), r.sort();
|
|
1822
|
-
var
|
|
1826
|
+
var i = !1;
|
|
1823
1827
|
if (parseInt(s.sectionRowIndex / t(this, L).template.length) > 0)
|
|
1824
1828
|
for (var o of r) {
|
|
1825
1829
|
if (o > e) break;
|
|
1826
|
-
var
|
|
1830
|
+
var a = parseInt(t(this, v).dataset.row), c = a - 1, l = t(this, v).closest("tr").data, u = t(this, L).data.get(c);
|
|
1827
1831
|
t(this, v).dataset.matrixRow;
|
|
1828
|
-
var
|
|
1829
|
-
if (b !=
|
|
1830
|
-
|
|
1832
|
+
var d = t(this, L).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, v).dataset.matrixRow}"]`), b = d.dataset.expr ? this.getExprValue(d.dataset.expr, l, a) : l[d.dataset.bind], g = d.dataset.expr ? this.getExprValue(d.dataset.expr, u, c) : u[d.dataset.bind];
|
|
1833
|
+
if (b != g) {
|
|
1834
|
+
i = !0;
|
|
1831
1835
|
break;
|
|
1832
1836
|
}
|
|
1833
1837
|
}
|
|
1834
1838
|
else
|
|
1835
|
-
|
|
1836
|
-
|
|
1839
|
+
i = !0;
|
|
1840
|
+
i ? ninegrid.j.querySelectorAll(t(this, v)).removeClass("suppress") : ninegrid.j.querySelectorAll(t(this, v)).addClass("suppress"), ninegrid.j.querySelectorAll(t(this, v)).hasClass("hidden") || (i ? ninegrid.j.querySelectorAll(t(this, v)).removeClass("hidden") : ninegrid.j.querySelectorAll(t(this, v)).addClass("hidden"));
|
|
1837
1841
|
var p = parseInt(t(this, v).dataset.matrixRow), x = p - 1, w = t(this, L).body.querySelector(`tbody.bindable [data-col="${t(this, v).dataset.col}"][data-matrix-row="${x}"]`);
|
|
1838
1842
|
$(w).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this, v)).hasClass("suppress") ? ninegrid.j.querySelectorAll(w).removeClass("last-none-suppress").addClass("last-suppress") : !$(w).hasClass("suppress") && ninegrid.j.querySelectorAll(t(this, v)).hasClass("suppress") ? ninegrid.j.querySelectorAll(w).removeClass("last-suppress").addClass("last-none-suppress") : ninegrid.j.querySelectorAll(w).removeClass("last-none-suppress").removeClass("last-suppress");
|
|
1839
1843
|
}
|
|
1840
1844
|
}
|
|
1841
1845
|
}, "#resetSuppress"));
|
|
1842
|
-
q(this, "getExprValue", /* @__PURE__ */ h((e, s, r,
|
|
1846
|
+
q(this, "getExprValue", /* @__PURE__ */ h((e, s, r, i) => {
|
|
1843
1847
|
if (typeof e < "u")
|
|
1844
1848
|
try {
|
|
1845
1849
|
r = parseInt(r);
|
|
@@ -1894,12 +1898,12 @@ var Kt, bt, At, Et, Ae, Q, Qe;
|
|
|
1894
1898
|
const us = class us extends Fe {
|
|
1895
1899
|
constructor() {
|
|
1896
1900
|
super();
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1901
|
+
f(this, Kt);
|
|
1902
|
+
f(this, bt);
|
|
1903
|
+
f(this, At);
|
|
1904
|
+
f(this, Et);
|
|
1905
|
+
f(this, Ae);
|
|
1906
|
+
f(this, Q);
|
|
1903
1907
|
q(this, "refresh", /* @__PURE__ */ h(() => {
|
|
1904
1908
|
const e = super.refresh();
|
|
1905
1909
|
t(this, Kt).value = e;
|
|
@@ -1934,11 +1938,11 @@ const us = class us extends Fe {
|
|
|
1934
1938
|
if (!v) this.reset();
|
|
1935
1939
|
};
|
|
1936
1940
|
*/
|
|
1937
|
-
|
|
1941
|
+
f(this, Qe, /* @__PURE__ */ h((e) => {
|
|
1938
1942
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1939
1943
|
if (t(this, bt) == "number") {
|
|
1940
|
-
let
|
|
1941
|
-
if (t(this, Q) && Number(t(this, Q)) > 0 &&
|
|
1944
|
+
let i = [];
|
|
1945
|
+
if (t(this, Q) && Number(t(this, Q)) > 0 && i.push("."), t(this, Et) && Number(t(this, Et)) >= 0 && i.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !i.includes(e.key) && e.preventDefault(), t(this, Q) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
|
|
1942
1946
|
var s = e.target.value, r = s.indexOf(".");
|
|
1943
1947
|
if (r >= 0) {
|
|
1944
1948
|
var s = s.substr(r + 1, s.length);
|