@ninebone/table 0.0.775 → 0.0.776
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 +643 -637
- 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
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var ys = Object.defineProperty;
|
|
2
|
+
var ms = (C) => {
|
|
3
3
|
throw TypeError(C);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var h = (C,
|
|
7
|
-
var q = (C,
|
|
8
|
-
var t = (C,
|
|
9
|
-
var
|
|
10
|
-
set _(
|
|
11
|
-
y(C,
|
|
5
|
+
var Ss = (C, n, e) => n in C ? ys(C, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : C[n] = e;
|
|
6
|
+
var h = (C, n) => ys(C, "name", { value: n, configurable: !0 });
|
|
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)), d = (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
|
+
var xs = (C, n, e, s) => ({
|
|
10
|
+
set _(r) {
|
|
11
|
+
y(C, n, r, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
|
-
return t(C,
|
|
14
|
+
return t(C, n, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
import { trace as
|
|
18
|
-
const
|
|
17
|
+
import { trace as Rs } from "@ninebone/util";
|
|
18
|
+
const ts = class ts extends Rs.constructor {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
h(
|
|
24
|
-
let qe =
|
|
23
|
+
h(ts, "Trace");
|
|
24
|
+
let qe = ts;
|
|
25
25
|
const S = new qe();
|
|
26
|
-
var
|
|
27
|
-
const
|
|
26
|
+
var j, G, E, tt, et, st, Jt, nt, Qt;
|
|
27
|
+
const es = class es extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
d(this,
|
|
31
|
-
d(this,
|
|
30
|
+
d(this, j);
|
|
31
|
+
d(this, G, !1);
|
|
32
32
|
d(this, E);
|
|
33
33
|
d(this, tt);
|
|
34
34
|
d(this, et);
|
|
35
35
|
d(this, st);
|
|
36
|
-
d(this,
|
|
37
|
-
if (!t(this,
|
|
38
|
-
const e = t(this,
|
|
36
|
+
d(this, Jt, /* @__PURE__ */ h(() => {
|
|
37
|
+
if (!t(this, j)) return;
|
|
38
|
+
const e = t(this, j).querySelector(".ng-container-body .ng-part-body");
|
|
39
39
|
e && (y(this, st, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
41
|
})), t(this, st).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
q(this, "refresh", /* @__PURE__ */ h(() => {
|
|
44
|
-
if (!t(this,
|
|
45
|
-
const e = t(this, E).container,
|
|
46
|
-
if (!
|
|
47
|
-
const
|
|
44
|
+
if (!t(this, j) || !t(this, E) || t(this, G)) return;
|
|
45
|
+
const e = t(this, E).container, s = e.querySelector("table");
|
|
46
|
+
if (!s) return;
|
|
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
48
|
if (a !== 0 && c > a)
|
|
49
|
-
|
|
49
|
+
o && (o.style.display = "flex");
|
|
50
50
|
else {
|
|
51
|
-
|
|
51
|
+
o && (o.style.display = "none");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
const l =
|
|
54
|
+
const l = r.clientWidth;
|
|
55
55
|
if (l <= 0) return;
|
|
56
56
|
const g = Math.max(Math.min(l * (a / c), l), 20);
|
|
57
57
|
i.style.width = `${g}px`;
|
|
@@ -63,56 +63,56 @@ const ts = class ts extends HTMLElement {
|
|
|
63
63
|
}, "refresh"));
|
|
64
64
|
d(this, nt, /* @__PURE__ */ h((e) => {
|
|
65
65
|
if (!t(this, E)) return !1;
|
|
66
|
-
const
|
|
67
|
-
if (!
|
|
68
|
-
const i = t(this, E).track.getBoundingClientRect(),
|
|
66
|
+
const s = t(this, E).container, r = s.querySelector("table");
|
|
67
|
+
if (!r) return !1;
|
|
68
|
+
const i = t(this, E).track.getBoundingClientRect(), o = t(this, E).thumb.clientWidth;
|
|
69
69
|
let a = e;
|
|
70
70
|
a < 0 && (a = 0);
|
|
71
|
-
const c = i.width -
|
|
71
|
+
const c = i.width - o;
|
|
72
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 =
|
|
74
|
-
return c > 0 && f > 0 && (
|
|
73
|
+
const l = s.clientWidth, f = r.scrollWidth - l;
|
|
74
|
+
return c > 0 && f > 0 && (s.scrollLeft = a / c * f), a > 0 && a < c - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
d(this,
|
|
77
|
-
const e = /* @__PURE__ */ h((
|
|
76
|
+
d(this, Qt, /* @__PURE__ */ h(() => {
|
|
77
|
+
const e = /* @__PURE__ */ h((r) => {
|
|
78
78
|
clearInterval(t(this, tt)), clearInterval(t(this, et));
|
|
79
79
|
const i = parseInt(t(this, E).thumb.style.left || 0, 10);
|
|
80
|
-
t(this, nt).call(this, i +
|
|
80
|
+
t(this, nt).call(this, i + r), y(this, tt, setInterval(() => {
|
|
81
81
|
clearInterval(t(this, tt)), y(this, et, setInterval(() => {
|
|
82
|
-
const
|
|
83
|
-
t(this, nt).call(this,
|
|
82
|
+
const o = parseInt(t(this, E).thumb.style.left || 0, 10);
|
|
83
|
+
t(this, nt).call(this, o + r) || clearInterval(t(this, et));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
|
-
}, "delayScroll"),
|
|
86
|
+
}, "delayScroll"), s = /* @__PURE__ */ h(() => {
|
|
87
87
|
clearInterval(t(this, tt)), clearInterval(t(this, et));
|
|
88
88
|
}, "clearTimer");
|
|
89
|
-
["mouseup", "mouseleave", "touchend"].forEach((
|
|
90
|
-
t(this, E).left.addEventListener(
|
|
91
|
-
}), t(this, E).left.addEventListener("mousedown", (
|
|
92
|
-
|
|
93
|
-
}), t(this, E).right.addEventListener("mousedown", (
|
|
94
|
-
|
|
95
|
-
}), t(this, E).left.addEventListener("touchstart", () => e(-20)), t(this, E).right.addEventListener("touchstart", () => e(20)), t(this, E).track.addEventListener("mousedown", (
|
|
96
|
-
if (
|
|
97
|
-
|
|
98
|
-
const i = t(this, E).track.getBoundingClientRect(),
|
|
99
|
-
t(this, nt).call(this,
|
|
100
|
-
}), t(this, E).thumb.addEventListener("mousedown", (
|
|
101
|
-
if (
|
|
102
|
-
|
|
89
|
+
["mouseup", "mouseleave", "touchend"].forEach((r) => {
|
|
90
|
+
t(this, E).left.addEventListener(r, s), t(this, E).right.addEventListener(r, s), t(this, E).track.addEventListener(r, s);
|
|
91
|
+
}), t(this, E).left.addEventListener("mousedown", (r) => {
|
|
92
|
+
r.button === 0 && e(-20);
|
|
93
|
+
}), t(this, E).right.addEventListener("mousedown", (r) => {
|
|
94
|
+
r.button === 0 && e(20);
|
|
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
|
+
if (r.button !== 0) return;
|
|
97
|
+
r.preventDefault();
|
|
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
|
+
}), t(this, E).thumb.addEventListener("mousedown", (r) => {
|
|
101
|
+
if (r.button !== 0) return;
|
|
102
|
+
r.stopPropagation(), r.preventDefault(), y(this, G, !0), this.shiftX = r.clientX - t(this, E).thumb.getBoundingClientRect().left;
|
|
103
103
|
const i = /* @__PURE__ */ h((a) => {
|
|
104
|
-
if (!t(this,
|
|
104
|
+
if (!t(this, G)) return;
|
|
105
105
|
const c = t(this, E).track.getBoundingClientRect();
|
|
106
106
|
t(this, nt).call(this, a.clientX - c.left - this.shiftX);
|
|
107
|
-
}, "onMouseMove"),
|
|
108
|
-
y(this,
|
|
107
|
+
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
108
|
+
y(this, G, !1), s(), document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", o), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
|
-
document.addEventListener("mousemove", i), document.addEventListener("mouseup",
|
|
110
|
+
document.addEventListener("mousemove", i), document.addEventListener("mouseup", o);
|
|
111
111
|
});
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
114
114
|
connectedCallback() {
|
|
115
|
-
if (y(this,
|
|
115
|
+
if (y(this, j, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, j)) return;
|
|
116
116
|
this.innerHTML = `
|
|
117
117
|
<style>
|
|
118
118
|
nine-table-hscrollbar {
|
|
@@ -177,20 +177,20 @@ const ts = class ts extends HTMLElement {
|
|
|
177
177
|
<button class='ng-scroll-right' disabled><div class='ng-scroll-icon'></div></button>
|
|
178
178
|
`;
|
|
179
179
|
const e = /* @__PURE__ */ h(() => {
|
|
180
|
-
const
|
|
181
|
-
if (!
|
|
180
|
+
const s = t(this, j).querySelector(".ng-container-body .ng-part-body");
|
|
181
|
+
if (!s) {
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
185
|
y(this, E, {
|
|
186
|
-
container:
|
|
186
|
+
container: s,
|
|
187
187
|
track: this.querySelector(".ng-scroll-track"),
|
|
188
188
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
189
189
|
left: this.querySelector(".ng-scroll-left"),
|
|
190
190
|
right: this.querySelector(".ng-scroll-right")
|
|
191
|
-
}),
|
|
192
|
-
t(this,
|
|
193
|
-
}), t(this,
|
|
191
|
+
}), s.addEventListener("scroll", () => {
|
|
192
|
+
t(this, G) || this.refresh();
|
|
193
|
+
}), t(this, Qt).call(this), t(this, Jt).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
@@ -198,64 +198,64 @@ const ts = class ts extends HTMLElement {
|
|
|
198
198
|
t(this, st) && t(this, st).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
|
|
202
|
-
let Ce =
|
|
201
|
+
j = new WeakMap(), G = new WeakMap(), E = new WeakMap(), tt = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Jt = new WeakMap(), nt = new WeakMap(), Qt = new WeakMap(), h(es, "NineTableHScrollBar");
|
|
202
|
+
let Ce = es;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Ce);
|
|
204
|
-
var rt, ot,
|
|
205
|
-
const
|
|
204
|
+
var rt, ot, yt, k, kt, It, te;
|
|
205
|
+
const ss = class ss extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
208
|
d(this, rt);
|
|
209
209
|
d(this, ot);
|
|
210
|
-
d(this,
|
|
210
|
+
d(this, yt, !1);
|
|
211
211
|
d(this, k);
|
|
212
|
-
d(this, Tt, 0);
|
|
213
212
|
d(this, kt, 0);
|
|
213
|
+
d(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,
|
|
217
|
-
if (c <= i ||
|
|
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
|
-
const l =
|
|
222
|
+
const l = s.clientHeight;
|
|
223
223
|
if (l <= 0) return;
|
|
224
224
|
const g = Math.max(Math.min(l * (i / c), l), 20);
|
|
225
|
-
|
|
225
|
+
r.style.height = `${g}px`;
|
|
226
226
|
const f = e.scrollTop, b = Math.max(c - i, 1);
|
|
227
227
|
S.log(e, f, b);
|
|
228
228
|
let u = 0;
|
|
229
229
|
b > 0 && (u = f / b * (l - g));
|
|
230
230
|
const p = l - g;
|
|
231
|
-
u < 0 && (u = 0), u > p && (u = p),
|
|
231
|
+
u < 0 && (u = 0), u > p && (u = p), r.style.top = `${u}px`, t(this, k).top.disabled = f <= 0, t(this, k).bottom.disabled = f >= b - 1;
|
|
232
232
|
}, "refresh"));
|
|
233
|
-
d(this,
|
|
233
|
+
d(this, te, /* @__PURE__ */ h(() => {
|
|
234
234
|
S.log("nine-table-vscrollbar.#init");
|
|
235
|
-
const e = t(this, k).container,
|
|
236
|
-
const i = (t(this, rt).data.get() || []).length,
|
|
237
|
-
return i *
|
|
235
|
+
const e = t(this, k).container, s = /* @__PURE__ */ h(() => {
|
|
236
|
+
const i = (t(this, rt).data.get() || []).length, o = t(this, ot).getRowHeight();
|
|
237
|
+
return i * o;
|
|
238
238
|
}, "getContentHeight");
|
|
239
|
-
t(this, k).thumb.addEventListener("mousedown", (
|
|
240
|
-
if (
|
|
241
|
-
|
|
239
|
+
t(this, k).thumb.addEventListener("mousedown", (r) => {
|
|
240
|
+
if (r.button !== 0) return;
|
|
241
|
+
r.stopPropagation(), r.preventDefault(), y(this, yt, !0), y(this, kt, r.clientY), y(this, It, e.scrollTop);
|
|
242
242
|
const i = /* @__PURE__ */ h((a) => {
|
|
243
|
-
if (!t(this,
|
|
244
|
-
const c = t(this, k).track.getBoundingClientRect(), l = t(this, k).thumb.clientHeight, f = c.height - l, b = a.clientY - t(this,
|
|
243
|
+
if (!t(this, yt)) return;
|
|
244
|
+
const c = t(this, k).track.getBoundingClientRect(), l = t(this, k).thumb.clientHeight, f = c.height - l, b = a.clientY - t(this, kt), u = e.clientHeight, p = s(), x = Math.max(p - u, 1);
|
|
245
245
|
if (f > 0 && x > 0) {
|
|
246
246
|
const w = b / f * x;
|
|
247
|
-
let m = t(this,
|
|
247
|
+
let m = t(this, It) + w;
|
|
248
248
|
const T = Math.max(0, p - u);
|
|
249
249
|
m < 0 && (m = 0), m > T && (m = T), e.scrollTop = m;
|
|
250
250
|
}
|
|
251
251
|
this.refresh();
|
|
252
|
-
}, "onMouseMove"),
|
|
253
|
-
y(this,
|
|
252
|
+
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
253
|
+
y(this, yt, !1), document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", o), this.refresh();
|
|
254
254
|
}, "onMouseUp");
|
|
255
|
-
document.addEventListener("mousemove", i), document.addEventListener("mouseup",
|
|
256
|
-
}), t(this, k).track.addEventListener("mousedown", (
|
|
257
|
-
if (
|
|
258
|
-
const i = t(this, k).track.getBoundingClientRect(),
|
|
255
|
+
document.addEventListener("mousemove", i), document.addEventListener("mouseup", o);
|
|
256
|
+
}), t(this, k).track.addEventListener("mousedown", (r) => {
|
|
257
|
+
if (r.button !== 0 || r.target === t(this, k).thumb) return;
|
|
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, g = e.clientHeight, f = s(), b = Math.max(f - g, 1);
|
|
259
259
|
if (l > 0 && b > 0) {
|
|
260
260
|
const u = Math.max(0, Math.min(1, a / l));
|
|
261
261
|
e.scrollTop = u * b;
|
|
@@ -334,110 +334,110 @@ const es = class es extends HTMLElement {
|
|
|
334
334
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
335
335
|
`;
|
|
336
336
|
const e = /* @__PURE__ */ h(() => {
|
|
337
|
-
const
|
|
338
|
-
if (!
|
|
337
|
+
const s = t(this, ot).querySelector(".ng-container-body .ng-part-body");
|
|
338
|
+
if (!s) {
|
|
339
339
|
setTimeout(e, 10);
|
|
340
340
|
return;
|
|
341
341
|
}
|
|
342
342
|
y(this, k, {
|
|
343
|
-
container:
|
|
343
|
+
container: s,
|
|
344
344
|
track: this.querySelector(".ng-scroll-track"),
|
|
345
345
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
346
346
|
top: this.querySelector(".ng-scroll-top"),
|
|
347
347
|
bottom: this.querySelector(".ng-scroll-bottom")
|
|
348
|
-
}), t(this,
|
|
348
|
+
}), t(this, te).call(this), this.refresh();
|
|
349
349
|
}, "initWhenReady");
|
|
350
350
|
e();
|
|
351
351
|
}
|
|
352
352
|
};
|
|
353
|
-
rt = new WeakMap(), ot = new WeakMap(),
|
|
354
|
-
let Te =
|
|
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
|
+
let Te = ss;
|
|
355
355
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Te);
|
|
356
|
-
var
|
|
357
|
-
const
|
|
358
|
-
constructor(
|
|
359
|
-
d(this,
|
|
360
|
-
d(this,
|
|
356
|
+
var U, A, it, Y, O, Z, at, Lt, Ye, Ve, ee, se, Mt, Ht, $t, ne, re, Nt, Ue, mt, _t, oe;
|
|
357
|
+
const ns = class ns {
|
|
358
|
+
constructor(n) {
|
|
359
|
+
d(this, U);
|
|
360
|
+
d(this, A);
|
|
361
361
|
d(this, it);
|
|
362
|
-
d(this,
|
|
362
|
+
d(this, Y, /* @__PURE__ */ new Map());
|
|
363
363
|
d(this, O, null);
|
|
364
|
-
d(this,
|
|
364
|
+
d(this, Z, null);
|
|
365
365
|
d(this, at, 0);
|
|
366
|
-
d(this,
|
|
367
|
-
d(this, je, !1);
|
|
366
|
+
d(this, Lt, 40);
|
|
368
367
|
d(this, Ye, !1);
|
|
368
|
+
d(this, Ve, !1);
|
|
369
369
|
//#ticking = false; // 🎯 고속 스크롤 스로틀링용 플래그
|
|
370
|
-
d(this,
|
|
370
|
+
d(this, ee, 3);
|
|
371
371
|
q(this, "refresh", /* @__PURE__ */ h(() => {
|
|
372
372
|
var e;
|
|
373
373
|
S.log("rowManager.refresh");
|
|
374
|
-
const
|
|
375
|
-
|
|
374
|
+
const n = t(this, A).querySelector(".ng-container-body .ng-part-body");
|
|
375
|
+
n && (t(this, Mt).call(this), t(this, Ht).call(this), t(this, mt).call(this, n.scrollTop), (e = t(this, A).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
|
-
scrollTables: t(this,
|
|
380
|
-
firstTr: t(this,
|
|
381
|
-
}), y(this, O, null), t(this,
|
|
382
|
-
const a = t(this,
|
|
379
|
+
scrollTables: t(this, A).querySelectorAll(".ng-part-body table"),
|
|
380
|
+
firstTr: t(this, A).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
381
|
+
}), y(this, O, null), t(this, Y).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
382
|
+
const a = t(this, A).querySelector(o);
|
|
383
383
|
if (!a) return;
|
|
384
384
|
const c = a.querySelector(".ng-part-body table");
|
|
385
385
|
if (!c) return;
|
|
386
386
|
const l = c.querySelector("tbody.bindable-tbody");
|
|
387
387
|
if (!l) return;
|
|
388
388
|
const f = Array.from(l.querySelectorAll("tr")).map((b) => b.cloneNode(!0));
|
|
389
|
-
t(this,
|
|
389
|
+
t(this, Y).set(o, f);
|
|
390
390
|
});
|
|
391
|
-
const
|
|
392
|
-
if (
|
|
393
|
-
t(this,
|
|
394
|
-
let
|
|
391
|
+
const n = t(this, A).querySelector(".ng-container-body .ng-part-body"), e = t(this, A).querySelector(".ng-container-left .ng-part-body"), s = t(this, A).querySelector(".ng-container-right .ng-part-body"), r = t(this, A).querySelector(".ng-container-body .ng-part-header"), i = t(this, A).querySelector(".ng-container-body .ng-part-footer");
|
|
392
|
+
if (n) {
|
|
393
|
+
t(this, Mt).call(this), t(this, Nt).call(this), t(this, Ht).call(this), t(this, mt).call(this, n.scrollTop);
|
|
394
|
+
let o = !1;
|
|
395
395
|
const a = /* @__PURE__ */ h((c) => {
|
|
396
396
|
var f;
|
|
397
|
-
if (
|
|
398
|
-
|
|
397
|
+
if (o) return;
|
|
398
|
+
o = !0;
|
|
399
399
|
const l = c.scrollTop, g = c.scrollLeft;
|
|
400
|
-
|
|
400
|
+
n && n.scrollTop !== l && (n.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), r && r.scrollLeft !== g && (r.scrollLeft = g), i && i.scrollLeft !== g && (i.scrollLeft = g), t(this, mt).call(this, l), (f = t(this, A).querySelector("nine-table-vscrollbar")) == null || f.refresh(), o = !1;
|
|
401
401
|
}, "handleContainerScroll");
|
|
402
|
-
[
|
|
402
|
+
[n, e, s].forEach((c) => {
|
|
403
403
|
c == null || c.addEventListener("scroll", (l) => {
|
|
404
404
|
S.log(l), S.log("rowManager.scroll event"), a(c);
|
|
405
405
|
});
|
|
406
406
|
});
|
|
407
407
|
}
|
|
408
408
|
}, "initialize"));
|
|
409
|
-
d(this,
|
|
409
|
+
d(this, se, /* @__PURE__ */ h((n, e) => {
|
|
410
410
|
S.log("rowManager.#renderRows");
|
|
411
|
-
const
|
|
412
|
-
if (!
|
|
413
|
-
const
|
|
414
|
-
if (!
|
|
415
|
-
|
|
416
|
-
const i =
|
|
417
|
-
for (let a = 0; a < t(this,
|
|
418
|
-
|
|
419
|
-
|
|
411
|
+
const s = t(this, Y).get(e);
|
|
412
|
+
if (!s || s.length === 0) return;
|
|
413
|
+
const r = n.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
414
|
+
if (!r) return;
|
|
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
|
+
s.forEach((c) => {
|
|
419
|
+
o.appendChild(c.cloneNode(!0));
|
|
420
420
|
});
|
|
421
|
-
i ? i.before(
|
|
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
|
-
d(this,
|
|
423
|
+
d(this, Mt, /* @__PURE__ */ h(() => {
|
|
424
424
|
if (t(this, O) !== null && t(this, O) > 0)
|
|
425
425
|
return t(this, O);
|
|
426
|
-
const
|
|
426
|
+
const n = t(this, A).querySelector(".ng-container-body .ng-part-body");
|
|
427
427
|
S.log("rowManager.#measureAndCacheHeight");
|
|
428
|
-
const e = t(this,
|
|
428
|
+
const e = t(this, Y).get(".ng-container-body");
|
|
429
429
|
if (!e || e.length === 0) throw new Error("invalid dom");
|
|
430
|
-
const
|
|
431
|
-
if (S.log(
|
|
432
|
-
|
|
433
|
-
const
|
|
430
|
+
const s = n.querySelector("tbody.bindable-tbody");
|
|
431
|
+
if (S.log(s), !s) throw new Error("invalid dom");
|
|
432
|
+
s.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
|
|
433
|
+
const r = s.querySelector("tr.nodata"), i = document.createDocumentFragment();
|
|
434
434
|
e.forEach((b) => {
|
|
435
435
|
i.appendChild(b.cloneNode(!0));
|
|
436
|
-
}),
|
|
437
|
-
const
|
|
438
|
-
(a === "none" || window.getComputedStyle(
|
|
436
|
+
}), r ? r.before(i) : s.appendChild(i);
|
|
437
|
+
const o = t(this, A), 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
439
|
let g = 0;
|
|
440
|
-
const f =
|
|
440
|
+
const f = s.querySelectorAll("tr");
|
|
441
441
|
return f.forEach((b) => {
|
|
442
442
|
let u = b.offsetHeight || b.getBoundingClientRect().height;
|
|
443
443
|
if (u === 0) {
|
|
@@ -445,119 +445,119 @@ const ss = class ss {
|
|
|
445
445
|
u = parseFloat(p.height) || parseFloat(p.minHeight) || 0;
|
|
446
446
|
}
|
|
447
447
|
g += u;
|
|
448
|
-
}), f.forEach((b) => b.remove()),
|
|
448
|
+
}), f.forEach((b) => b.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l, g <= 0 ? -1 : (y(this, O, g), t(this, $t).call(this), t(this, O));
|
|
449
449
|
}, "#measureAndCacheHeight"));
|
|
450
|
-
d(this,
|
|
450
|
+
d(this, Ht, /* @__PURE__ */ h(() => {
|
|
451
451
|
S.log("rowManager.#updateVirtualScrollHeight");
|
|
452
|
-
const e = (t(this,
|
|
453
|
-
S.log("🔍 [VirtualHeight]", { totalCount: e, rowHeight:
|
|
454
|
-
const
|
|
455
|
-
if (!
|
|
456
|
-
const a =
|
|
457
|
-
a && (a.style.height = `${
|
|
452
|
+
const e = (t(this, U).data.get() || []).length, s = t(this, O), 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, A).querySelector(i);
|
|
455
|
+
if (!o) return;
|
|
456
|
+
const a = o.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
457
|
+
a && (a.style.height = `${r}px`);
|
|
458
458
|
});
|
|
459
459
|
}, "#updateVirtualScrollHeight"));
|
|
460
|
-
d(this,
|
|
460
|
+
d(this, $t, /* @__PURE__ */ h(() => {
|
|
461
461
|
if (t(this, at) > 0 && t(this, O) > 0) {
|
|
462
|
-
const
|
|
463
|
-
y(this,
|
|
462
|
+
const n = Math.ceil(t(this, at) / t(this, O));
|
|
463
|
+
y(this, Lt, n + t(this, ee));
|
|
464
464
|
}
|
|
465
465
|
}, "#updateRowCount"));
|
|
466
|
-
d(this,
|
|
466
|
+
d(this, ne, /* @__PURE__ */ h(() => {
|
|
467
467
|
var a, c, l, g, f, b;
|
|
468
|
-
const
|
|
468
|
+
const n = t(this, A).querySelector(".ng-container-left .ng-part-body table"), e = t(this, A).querySelector(".ng-container-body .ng-part-body table"), s = t(this, A).querySelector(".ng-container-right .ng-part-body table");
|
|
469
469
|
if (e) {
|
|
470
|
-
const u =
|
|
470
|
+
const u = 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(u.length, p.length, x.length);
|
|
471
471
|
for (let m = 0; m < w; m++) {
|
|
472
472
|
const T = [
|
|
473
473
|
((a = u[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
|
-
],
|
|
477
|
-
|
|
476
|
+
], R = Math.max(...T);
|
|
477
|
+
R > 0 && (u[m] && (u[m].style.height = `${R}px`), p[m] && (p[m].style.height = `${R}px`), x[m] && (x[m].style.height = `${R}px`));
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
|
-
const
|
|
480
|
+
const r = t(this, A).querySelector(".ng-container-left .ng-part-footer table"), i = t(this, A).querySelector(".ng-container-body .ng-part-footer table"), o = t(this, A).querySelector(".ng-container-right .ng-part-footer table");
|
|
481
481
|
if (i) {
|
|
482
|
-
const u =
|
|
482
|
+
const u = 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(u.length, p.length, x.length);
|
|
483
483
|
for (let m = 0; m < w; m++) {
|
|
484
484
|
const T = [
|
|
485
485
|
((g = u[m]) == null ? void 0 : g.getBoundingClientRect().height) || 0,
|
|
486
486
|
((f = p[m]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
487
487
|
((b = x[m]) == null ? void 0 : b.getBoundingClientRect().height) || 0
|
|
488
|
-
],
|
|
489
|
-
|
|
488
|
+
], R = Math.max(...T);
|
|
489
|
+
R > 0 && (u[m] && (u[m].style.height = `${R}px`), p[m] && (p[m].style.height = `${R}px`), x[m] && (x[m].style.height = `${R}px`));
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
492
|
}, "#syncRowHeights"));
|
|
493
|
-
d(this,
|
|
494
|
-
!t(this,
|
|
495
|
-
for (const e of
|
|
496
|
-
const
|
|
497
|
-
if (!
|
|
498
|
-
const
|
|
499
|
-
if (
|
|
493
|
+
d(this, re, /* @__PURE__ */ h(() => {
|
|
494
|
+
!t(this, A) || !(t(this, A) instanceof HTMLElement) || (y(this, Z, new ResizeObserver((n) => {
|
|
495
|
+
for (const e of n) {
|
|
496
|
+
const s = e.target;
|
|
497
|
+
if (!s.classList.contains("active")) continue;
|
|
498
|
+
const r = e.contentRect.height;
|
|
499
|
+
if (r > 0) {
|
|
500
500
|
let i = 0;
|
|
501
|
-
const
|
|
502
|
-
|
|
503
|
-
const c = Math.max(
|
|
504
|
-
t(this, at) !== c && (y(this, at, c), t(this,
|
|
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, $t).call(this), t(this, O) !== null && (t(this, Nt).call(this), this.refresh()));
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
|
-
})), t(this,
|
|
507
|
+
})), t(this, Z).observe(t(this, A)));
|
|
508
508
|
}, "#initResizeObserver"));
|
|
509
|
-
d(this,
|
|
510
|
-
S.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
511
|
-
const e = t(this,
|
|
512
|
-
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this,
|
|
513
|
-
}), t(this,
|
|
509
|
+
d(this, Nt, /* @__PURE__ */ h(() => {
|
|
510
|
+
S.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
511
|
+
const e = t(this, A).querySelector(n);
|
|
512
|
+
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, se).call(this, e, n);
|
|
513
|
+
}), t(this, oe).call(this), t(this, ne).call(this);
|
|
514
514
|
}, "#renderAllContainers"));
|
|
515
|
-
d(this,
|
|
515
|
+
d(this, Ue, /* @__PURE__ */ h((n) => {
|
|
516
516
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
517
517
|
var l;
|
|
518
|
-
const
|
|
519
|
-
if (!
|
|
520
|
-
const
|
|
521
|
-
if (!
|
|
522
|
-
const i = Array.from(
|
|
518
|
+
const s = t(this, A).querySelector(e);
|
|
519
|
+
if (!s) return;
|
|
520
|
+
const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
521
|
+
if (!r) return;
|
|
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
523
|
i.forEach((g, f) => {
|
|
524
|
-
const b =
|
|
524
|
+
const b = n + Math.floor(f / o);
|
|
525
525
|
if (b >= c) {
|
|
526
526
|
g.style.visibility = "hidden";
|
|
527
527
|
return;
|
|
528
528
|
}
|
|
529
|
-
const u = t(this,
|
|
530
|
-
g.style.display = "", t(this,
|
|
529
|
+
const u = t(this, U).data.get(b);
|
|
530
|
+
g.style.display = "", t(this, _t).call(this, g, u, b);
|
|
531
531
|
});
|
|
532
532
|
});
|
|
533
533
|
}, "#adjustBufferRows"));
|
|
534
|
-
d(this,
|
|
534
|
+
d(this, mt, /* @__PURE__ */ h((n) => {
|
|
535
535
|
var f, b;
|
|
536
536
|
const e = t(this, O);
|
|
537
537
|
if (!e || e <= 0) return;
|
|
538
|
-
const
|
|
539
|
-
if (
|
|
540
|
-
const
|
|
538
|
+
const s = t(this, U).data.length;
|
|
539
|
+
if (s === 0) return;
|
|
540
|
+
const r = ((f = t(this, Y).get(".ng-container-body")) == null ? void 0 : f.length) || 1, i = t(this, A).querySelector(".ng-container-body .ng-part-body");
|
|
541
541
|
S.log("bodyContainer.clientHeight", i.clientHeight);
|
|
542
|
-
const
|
|
542
|
+
const o = Math.max(0, s - Math.floor(i.clientHeight / e)), a = Math.min(o, Math.max(0, Math.floor(n / e)));
|
|
543
543
|
let c = Math.floor(a * e);
|
|
544
|
-
S.log(`📜 [Scroll Calc] maxStartIndex: ${
|
|
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
545
|
const l = t(this, it).firstTr, g = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
|
|
546
546
|
(b = t(this, it)) == null || b.scrollTables.forEach((u) => {
|
|
547
547
|
u.style.transform = `translate3d(0, ${c}px, 0)`;
|
|
548
548
|
}), g !== a && (S.log(`🔄 [Row Bind Trigger] currentStartIndex(${g}) !== startIndex(${a})`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((u) => {
|
|
549
|
-
const p = t(this,
|
|
549
|
+
const p = t(this, A).querySelector(u);
|
|
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
|
|
555
|
-
if (
|
|
554
|
+
const R = a + Math.floor(T / r);
|
|
555
|
+
if (R >= s) {
|
|
556
556
|
m.style.display = "none";
|
|
557
557
|
return;
|
|
558
558
|
}
|
|
559
|
-
const M = t(this,
|
|
560
|
-
m.style.display = "", t(this,
|
|
559
|
+
const M = t(this, U).data.get(R);
|
|
560
|
+
m.style.display = "", t(this, _t).call(this, m, M, R);
|
|
561
561
|
});
|
|
562
562
|
}));
|
|
563
563
|
}, "#handleScroll"));
|
|
@@ -575,55 +575,55 @@ const ss = class ss {
|
|
|
575
575
|
cell.dataset.row = dataIndex;
|
|
576
576
|
});
|
|
577
577
|
}; */
|
|
578
|
-
d(this,
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
const
|
|
582
|
-
|
|
578
|
+
d(this, _t, /* @__PURE__ */ h((n, e, s) => {
|
|
579
|
+
n.dataset.row = s, n.data = e, Array.from(n.cells).forEach((r, i) => {
|
|
580
|
+
r.dataset.row = s;
|
|
581
|
+
const o = Array.from(r.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
|
|
582
|
+
o && typeof o.refresh == "function" && o.refresh();
|
|
583
583
|
});
|
|
584
584
|
}, "#bindRowData"));
|
|
585
|
-
d(this,
|
|
585
|
+
d(this, oe, /* @__PURE__ */ h(() => {
|
|
586
586
|
var c, l, g;
|
|
587
587
|
S.log("rowManager.#syncHeaderHeights");
|
|
588
|
-
const
|
|
588
|
+
const n = t(this, A).querySelector(".ng-container-left .ng-part-header table"), e = t(this, A).querySelector(".ng-container-body .ng-part-header table"), s = t(this, A).querySelector(".ng-container-right .ng-part-header table");
|
|
589
589
|
if (!e) return;
|
|
590
|
-
const
|
|
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
591
|
for (let f = 0; f < a; f++) {
|
|
592
592
|
const b = [
|
|
593
|
-
((c =
|
|
593
|
+
((c = r[f]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
594
594
|
((l = i[f]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
595
|
-
((g =
|
|
595
|
+
((g = o[f]) == null ? void 0 : g.getBoundingClientRect().height) || 0
|
|
596
596
|
], u = Math.max(...b);
|
|
597
|
-
u > 0 && (
|
|
597
|
+
u > 0 && (r[f] && (r[f].style.height = `${u}px`), i[f] && (i[f].style.height = `${u}px`), o[f] && (o[f].style.height = `${u}px`));
|
|
598
598
|
}
|
|
599
599
|
}, "#syncHeaderHeights"));
|
|
600
600
|
q(this, "destroy", /* @__PURE__ */ h(() => {
|
|
601
|
-
t(this,
|
|
601
|
+
t(this, Z) && (t(this, Z).disconnect(), y(this, Z, null));
|
|
602
602
|
}, "destroy"));
|
|
603
|
-
y(this,
|
|
603
|
+
y(this, U, n.getRootNode().host), y(this, A, n), t(this, re).call(this);
|
|
604
604
|
}
|
|
605
605
|
getRowHeight() {
|
|
606
606
|
return t(this, O);
|
|
607
607
|
}
|
|
608
|
-
templateLength(
|
|
608
|
+
templateLength(n = ".ng-container-body") {
|
|
609
609
|
var e;
|
|
610
|
-
return ((e = t(this,
|
|
610
|
+
return ((e = t(this, Y).get(n)) == null ? void 0 : e.length) || 1;
|
|
611
611
|
}
|
|
612
612
|
};
|
|
613
|
-
|
|
614
|
-
let ke =
|
|
615
|
-
const
|
|
613
|
+
U = new WeakMap(), A = new WeakMap(), it = new WeakMap(), Y = new WeakMap(), O = 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(), Ht = new WeakMap(), $t = 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
|
+
let ke = ns;
|
|
615
|
+
const ie = class ie {
|
|
616
616
|
/**
|
|
617
617
|
* 🎯 레이아웃 내의 여러 rawTables 배열을 일괄로 받아 단일 마스터 템플릿으로 사전 컴파일합니다.
|
|
618
618
|
*/
|
|
619
|
-
static compileAll(
|
|
620
|
-
return Array.isArray(
|
|
619
|
+
static compileAll(n) {
|
|
620
|
+
return Array.isArray(n) ? n.map((e) => ie.compile(e)) : [];
|
|
621
621
|
}
|
|
622
622
|
/**
|
|
623
623
|
* 🎯 단일 원본 테이블을 받아 기본 구조 보정 및 2차원 격자 인덱스 사전 부여 완료된 마스터 테이블 반환
|
|
624
624
|
*/
|
|
625
|
-
static compile(
|
|
626
|
-
if (!
|
|
625
|
+
static compile(n) {
|
|
626
|
+
if (!n) return null;
|
|
627
627
|
const e = /* @__PURE__ */ h((a) => {
|
|
628
628
|
a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
|
|
629
629
|
const g = l.getAttribute("cell-type") || "renderer";
|
|
@@ -635,7 +635,7 @@ const oe = class oe {
|
|
|
635
635
|
}), a.querySelectorAll("tbody td, tfoot td").forEach((l) => {
|
|
636
636
|
l.setAttribute("tabindex", "0");
|
|
637
637
|
});
|
|
638
|
-
}, "processCellTypes"),
|
|
638
|
+
}, "processCellTypes"), s = /* @__PURE__ */ h((a) => {
|
|
639
639
|
if (!a.querySelector("colgroup")) {
|
|
640
640
|
const c = a.querySelector("tbody tr") || a.querySelector("tr"), l = c ? c.querySelectorAll("th, td").length : 1, g = document.createElement("colgroup"), f = Math.max(Math.floor(a.clientWidth / l), 100);
|
|
641
641
|
for (let b = 0; b < l; b++) {
|
|
@@ -649,7 +649,7 @@ const oe = class oe {
|
|
|
649
649
|
l ? l.after(c) : a.prepend(c);
|
|
650
650
|
}
|
|
651
651
|
a.classList.add("nine-table-element");
|
|
652
|
-
}, "ensureTableStructure"),
|
|
652
|
+
}, "ensureTableStructure"), r = /* @__PURE__ */ h((a, c) => {
|
|
653
653
|
const l = Array.from(a.querySelectorAll(c + " tr")), g = Array.from(a.querySelectorAll(c + " th," + c + " td")), f = l.length;
|
|
654
654
|
if (f === 0 || g.length === 0) return;
|
|
655
655
|
let b = 0;
|
|
@@ -666,10 +666,10 @@ const oe = class oe {
|
|
|
666
666
|
w = M;
|
|
667
667
|
break;
|
|
668
668
|
}
|
|
669
|
-
const T = m.rowSpan || 1,
|
|
669
|
+
const T = m.rowSpan || 1, R = m.colSpan || 1;
|
|
670
670
|
for (let M = 0; M < T; M++)
|
|
671
|
-
for (let
|
|
672
|
-
x + M < f && w +
|
|
671
|
+
for (let B = 0; B < R; B++)
|
|
672
|
+
x + M < f && w + B < b && (u[x + M][w + B] = M === 0 && B === 0 ? "1" : "0");
|
|
673
673
|
});
|
|
674
674
|
}), l.forEach((p) => {
|
|
675
675
|
const x = p.sectionRowIndex;
|
|
@@ -681,8 +681,8 @@ const oe = class oe {
|
|
|
681
681
|
}
|
|
682
682
|
});
|
|
683
683
|
});
|
|
684
|
-
}, "resetColIndex"), i =
|
|
685
|
-
return
|
|
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
686
|
const l = a.getAttribute("fixed");
|
|
687
687
|
l && i.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((g) => {
|
|
688
688
|
g.setAttribute("fixed", l);
|
|
@@ -691,17 +691,17 @@ const oe = class oe {
|
|
|
691
691
|
}
|
|
692
692
|
// 🎯 [추가] td/th에 선언된 cell-type 속성을 읽어 커스텀 태그로 자동 감싸기
|
|
693
693
|
};
|
|
694
|
-
h(
|
|
695
|
-
let Ie =
|
|
696
|
-
var N,
|
|
697
|
-
const
|
|
698
|
-
constructor(
|
|
699
|
-
d(this,
|
|
694
|
+
h(ie, "TableCompiler");
|
|
695
|
+
let Ie = ie;
|
|
696
|
+
var N, X, K, qt, ws;
|
|
697
|
+
const rs = class rs {
|
|
698
|
+
constructor(n) {
|
|
699
|
+
d(this, K);
|
|
700
700
|
d(this, N);
|
|
701
|
-
d(this,
|
|
701
|
+
d(this, X, { startRow: -1, startCol: -1, endRow: -1, endCol: -1 });
|
|
702
702
|
q(this, "render", /* @__PURE__ */ h(() => {
|
|
703
|
-
const { startRow:
|
|
704
|
-
S.log("🎨 [CellSelection.render] Rendering range ->", t(this,
|
|
703
|
+
const { startRow: n, startCol: e, endRow: s, endCol: r } = t(this, X);
|
|
704
|
+
S.log("🎨 [CellSelection.render] Rendering range ->", t(this, X));
|
|
705
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
|
);
|
|
@@ -709,34 +709,34 @@ const ns = class ns {
|
|
|
709
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) {
|
|
713
713
|
S.log("⚠️ [CellSelection.render] Range is invalid (< 0), skipping render.");
|
|
714
714
|
return;
|
|
715
715
|
}
|
|
716
|
-
let
|
|
716
|
+
let o = 0;
|
|
717
717
|
i.forEach((a) => {
|
|
718
718
|
a.querySelectorAll("tbody tr").forEach((c) => {
|
|
719
|
-
const { matrixRow: l } =
|
|
719
|
+
const { matrixRow: l } = V(this, K, qt).call(this, c);
|
|
720
720
|
l < 0 || c.querySelectorAll("td, th").forEach((g) => {
|
|
721
721
|
const f = parseInt(g.dataset.col, 10);
|
|
722
722
|
if (isNaN(f)) return;
|
|
723
723
|
const b = parseInt(g.rowSpan || 1, 10), u = parseInt(g.colSpan || 1, 10), p = l + b - 1, x = f + u - 1;
|
|
724
|
-
p >=
|
|
724
|
+
p >= n && l <= s && x >= e && f <= r && (o++, g.classList.add("selected"), S.log(g, n, e, s, r), l <= n && g.classList.add("selected-top"), p >= s && g.classList.add("selected-bottom"), f <= e && g.classList.add("selected-left"), x >= r && g.classList.add("selected-right"));
|
|
725
725
|
});
|
|
726
726
|
});
|
|
727
|
-
}), S.log(`✨ [CellSelection.render] Total rendered cells marked: ${
|
|
727
|
+
}), S.log(`✨ [CellSelection.render] Total rendered cells marked: ${o}`);
|
|
728
728
|
}, "render"));
|
|
729
|
-
y(this, N,
|
|
729
|
+
y(this, N, n), V(this, K, ws).call(this), t(this, N).querySelectorAll(
|
|
730
730
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
731
|
-
).forEach((
|
|
732
|
-
|
|
733
|
-
t(this,
|
|
731
|
+
).forEach((s) => {
|
|
732
|
+
s.addEventListener("scroll", () => {
|
|
733
|
+
t(this, X).startRow >= 0 && t(this, X).startCol >= 0 && this.render();
|
|
734
734
|
});
|
|
735
735
|
}), S.log("🎯 [CellSelection] Initialized");
|
|
736
736
|
}
|
|
737
|
-
setRange(
|
|
738
|
-
S.log(`🔍 [CellSelection.setRange] Input -> startRow: ${
|
|
739
|
-
let i = Math.min(
|
|
737
|
+
setRange(n, e, s, r) {
|
|
738
|
+
S.log(`🔍 [CellSelection.setRange] Input -> startRow: ${n}, startCol: ${e}, endRow: ${s}, endCol: ${r}`);
|
|
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
|
);
|
|
@@ -745,244 +745,250 @@ const ns = class ns {
|
|
|
745
745
|
g = !1, f++, l.forEach((b) => {
|
|
746
746
|
b.querySelectorAll("tbody tr").forEach((u) => {
|
|
747
747
|
if (u.classList.contains("nodata")) return;
|
|
748
|
-
const { matrixRow: p } =
|
|
748
|
+
const { matrixRow: p } = V(this, K, qt).call(this, u);
|
|
749
749
|
p < 0 || u.querySelectorAll("td, th").forEach((x) => {
|
|
750
750
|
const w = parseInt(x.dataset.col, 10);
|
|
751
751
|
if (isNaN(w)) return;
|
|
752
|
-
const m = parseInt(x.rowSpan || 1, 10), T = parseInt(x.colSpan || 1, 10),
|
|
753
|
-
if (
|
|
754
|
-
const
|
|
755
|
-
(
|
|
752
|
+
const m = parseInt(x.rowSpan || 1, 10), T = parseInt(x.colSpan || 1, 10), R = p + m - 1, M = w + T - 1;
|
|
753
|
+
if (R >= i && p <= o && M >= a && w <= c) {
|
|
754
|
+
const z = Math.min(i, p), Gt = Math.max(o, R), 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, g = !0);
|
|
756
756
|
}
|
|
757
757
|
});
|
|
758
758
|
});
|
|
759
759
|
});
|
|
760
|
-
y(this,
|
|
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
|
-
N = new WeakMap(),
|
|
764
|
-
if (!
|
|
765
|
-
const e = parseInt(
|
|
763
|
+
N = new WeakMap(), X = new WeakMap(), K = new WeakSet(), qt = /* @__PURE__ */ h(function(n) {
|
|
764
|
+
if (!n || n.classList.contains("nodata")) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
|
|
765
|
+
const e = parseInt(n.dataset.row, 10);
|
|
766
766
|
if (isNaN(e)) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
|
|
767
|
-
const
|
|
768
|
-
return { dataRow: e, subRowIndex:
|
|
769
|
-
}, "#getMatrixRow"),
|
|
770
|
-
const
|
|
771
|
-
if (!
|
|
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
|
+
return { dataRow: e, subRowIndex: o, matrixRow: c };
|
|
769
|
+
}, "#getMatrixRow"), ws = /* @__PURE__ */ h(function() {
|
|
770
|
+
const n = t(this, N).querySelector(".ng-container-top");
|
|
771
|
+
if (!n) {
|
|
772
772
|
S.log("❌ [CellSelection] .ng-container-top not found!");
|
|
773
773
|
return;
|
|
774
774
|
}
|
|
775
|
-
|
|
775
|
+
n.addEventListener("mousedown", (e) => {
|
|
776
776
|
if (e.button !== 0) return;
|
|
777
|
-
const
|
|
778
|
-
if (!
|
|
777
|
+
const s = e.target.closest("td, th");
|
|
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
|
|
780
|
+
const r = s.closest("tr"), { matrixRow: i } = V(this, K, qt).call(this, r), o = parseInt(s.dataset.col, 10);
|
|
781
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: ${i}, startCol: ${
|
|
786
|
-
let a = i, c =
|
|
785
|
+
S.log(`🖱️ [MouseDown Success] startRow: ${i}, startCol: ${o}`), t(this, N).navigation.currentCell = s;
|
|
786
|
+
let a = i, c = o;
|
|
787
787
|
const l = /* @__PURE__ */ h((f) => {
|
|
788
788
|
const b = document.elementFromPoint(f.clientX, f.clientY);
|
|
789
789
|
let u = b == null ? void 0 : b.closest("td, th");
|
|
790
790
|
if (!u || !t(this, N).contains(u)) {
|
|
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
|
-
const
|
|
794
|
-
if (f.clientX >=
|
|
793
|
+
const R = T.getBoundingClientRect();
|
|
794
|
+
if (f.clientX >= R.left && f.clientX <= R.right && f.clientY >= R.top && f.clientY <= R.bottom) {
|
|
795
795
|
u = T;
|
|
796
796
|
break;
|
|
797
797
|
}
|
|
798
798
|
}
|
|
799
799
|
}
|
|
800
800
|
if (!u || u.dataset.row === void 0 || u.dataset.col === void 0 || u.closest("tr").classList.contains("nodata")) return;
|
|
801
|
-
const p = u.closest("tr"), { matrixRow: x } =
|
|
802
|
-
x < 0 || a === x && c === w || (a = x, c = w, this.setRange(i,
|
|
801
|
+
const p = u.closest("tr"), { matrixRow: x } = V(this, K, qt).call(this, p), w = parseInt(u.dataset.col, 10);
|
|
802
|
+
x < 0 || a === x && c === w || (a = x, c = w, this.setRange(i, o, x, w));
|
|
803
803
|
}, "onMouseMove"), g = /* @__PURE__ */ h(() => {
|
|
804
804
|
S.log("🖱️ [MouseUp] Drag ended."), t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "", document.removeEventListener("mousemove", l), document.removeEventListener("mouseup", g);
|
|
805
805
|
}, "onMouseUp");
|
|
806
806
|
document.addEventListener("mousemove", l), document.addEventListener("mouseup", g);
|
|
807
807
|
});
|
|
808
|
-
}, "#initEvents"), h(
|
|
809
|
-
let Le =
|
|
810
|
-
var
|
|
811
|
-
const
|
|
812
|
-
constructor(
|
|
813
|
-
d(this,
|
|
814
|
-
d(this,
|
|
808
|
+
}, "#initEvents"), h(rs, "CellSelection");
|
|
809
|
+
let Le = rs;
|
|
810
|
+
var F, lt, ae, le, pt, He, Ot, Dt, Bt, ct, Wt, vs;
|
|
811
|
+
const os = class os {
|
|
812
|
+
constructor(n) {
|
|
813
|
+
d(this, pt);
|
|
814
|
+
d(this, F);
|
|
815
815
|
d(this, lt, null);
|
|
816
|
-
d(this, ie, -1);
|
|
817
816
|
d(this, ae, -1);
|
|
818
|
-
d(this,
|
|
817
|
+
d(this, le, -1);
|
|
818
|
+
d(this, Ot, /* @__PURE__ */ h((n) => {
|
|
819
819
|
const e = [];
|
|
820
|
-
return
|
|
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
|
-
d(this,
|
|
823
|
-
const
|
|
824
|
-
if (
|
|
825
|
-
let
|
|
822
|
+
d(this, Dt, /* @__PURE__ */ h((n, e) => {
|
|
823
|
+
const s = t(this, ct).call(this, n);
|
|
824
|
+
if (s.length === 0) return e + 1;
|
|
825
|
+
let r = e + 1;
|
|
826
826
|
const i = [];
|
|
827
|
-
|
|
828
|
-
for (const
|
|
829
|
-
const a = parseInt(
|
|
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
830
|
if (e >= a && e < a + c) {
|
|
831
|
-
|
|
831
|
+
r = a + c;
|
|
832
832
|
break;
|
|
833
833
|
}
|
|
834
834
|
}
|
|
835
|
-
return
|
|
835
|
+
return r;
|
|
836
836
|
}, "#getNextCol"));
|
|
837
|
-
d(this,
|
|
838
|
-
const
|
|
839
|
-
if (
|
|
840
|
-
let
|
|
837
|
+
d(this, Bt, /* @__PURE__ */ h((n, e) => {
|
|
838
|
+
const s = t(this, ct).call(this, n);
|
|
839
|
+
if (s.length === 0) return Math.max(0, e - 1);
|
|
840
|
+
let r = -1;
|
|
841
841
|
const i = [];
|
|
842
|
-
|
|
843
|
-
for (const
|
|
844
|
-
const a = parseInt(
|
|
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
845
|
if (a < e)
|
|
846
|
-
|
|
846
|
+
r = a;
|
|
847
847
|
else
|
|
848
848
|
break;
|
|
849
849
|
}
|
|
850
|
-
return
|
|
850
|
+
return r;
|
|
851
851
|
}, "#getPreviousCol"));
|
|
852
852
|
// 🎯 레거시의 병합 셀(rowSpan) 블록 포용 탐색 로직 이식
|
|
853
|
-
d(this, ct, /* @__PURE__ */ h((
|
|
854
|
-
const e = t(this,
|
|
853
|
+
d(this, ct, /* @__PURE__ */ h((n) => {
|
|
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
|
-
),
|
|
857
|
-
return e.forEach((
|
|
858
|
-
const i = Array.from(
|
|
859
|
-
for (const
|
|
860
|
-
const a = parseInt(
|
|
861
|
-
if (f ===
|
|
862
|
-
|
|
856
|
+
), s = [];
|
|
857
|
+
return e.forEach((r) => {
|
|
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, g = c.indexOf(o), f = a * l + (g >= 0 ? g : 0);
|
|
861
|
+
if (f === n) {
|
|
862
|
+
s.push(o);
|
|
863
863
|
break;
|
|
864
864
|
}
|
|
865
|
-
const b = Array.from(
|
|
865
|
+
const b = Array.from(o.querySelectorAll("td"));
|
|
866
866
|
let u = !1;
|
|
867
867
|
for (const p of b) {
|
|
868
868
|
const x = parseInt(p.rowSpan || 1, 10);
|
|
869
|
-
if (x > 1 &&
|
|
870
|
-
|
|
869
|
+
if (x > 1 && n >= f && n < f + x) {
|
|
870
|
+
s.push(o), u = !0;
|
|
871
871
|
break;
|
|
872
872
|
}
|
|
873
873
|
}
|
|
874
874
|
if (u) break;
|
|
875
875
|
}
|
|
876
|
-
}),
|
|
876
|
+
}), s;
|
|
877
877
|
}, "#findTargetTrsByMatrix"));
|
|
878
878
|
// 🎯 rowSpan 및 colSpan 경계를 모두 충족하는 셀을 3분할 전체 영역에서 탐색
|
|
879
|
-
d(this, Wt, /* @__PURE__ */ h((
|
|
880
|
-
const i = t(this,
|
|
879
|
+
d(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
883
|
for (const a of i) {
|
|
884
884
|
const c = Array.from(a.querySelectorAll("tbody tr:not(.nodata)"));
|
|
885
885
|
for (const l of c) {
|
|
886
886
|
const g = parseInt(l.dataset.row, 10), f = c.filter((w) => parseInt(w.dataset.row, 10) === g), b = f.length > 0 ? f.length : 1, u = f.indexOf(l), p = g * b + (u >= 0 ? u : 0), x = Array.from(l.querySelectorAll("td"));
|
|
887
887
|
for (const w of x) {
|
|
888
|
-
const m = parseInt(w.dataset.col, 10), T = parseInt(w.colSpan || 1, 10),
|
|
889
|
-
if (!isNaN(m) &&
|
|
888
|
+
const m = parseInt(w.dataset.col, 10), T = parseInt(w.colSpan || 1, 10), R = parseInt(w.rowSpan || 1, 10);
|
|
889
|
+
if (!isNaN(m) && s >= m && s < m + T && o >= p && o < p + R && window.getComputedStyle(w).display !== "none")
|
|
890
890
|
return w;
|
|
891
891
|
}
|
|
892
892
|
}
|
|
893
893
|
}
|
|
894
894
|
return null;
|
|
895
895
|
}, "#getNearElement"));
|
|
896
|
-
y(this,
|
|
896
|
+
y(this, F, n), V(this, pt, vs).call(this), S.log("🎯 [CellNavigation] Initialized");
|
|
897
897
|
}
|
|
898
898
|
get currentCell() {
|
|
899
899
|
return t(this, lt);
|
|
900
900
|
}
|
|
901
|
-
set currentCell(
|
|
902
|
-
if (!
|
|
903
|
-
y(this, lt,
|
|
904
|
-
const e = parseInt(
|
|
905
|
-
if (!isNaN(e) && !isNaN(
|
|
906
|
-
y(this,
|
|
907
|
-
const
|
|
901
|
+
set currentCell(n) {
|
|
902
|
+
if (!n) return;
|
|
903
|
+
y(this, lt, n), n.focus({ preventScroll: !0 });
|
|
904
|
+
const e = parseInt(n.dataset.row, 10), s = parseInt(n.dataset.col, 10);
|
|
905
|
+
if (!isNaN(e) && !isNaN(s)) {
|
|
906
|
+
y(this, ae, e), y(this, le, s);
|
|
907
|
+
const r = n.closest("tr"), i = r == null ? void 0 : r.closest("tbody");
|
|
908
908
|
if (i) {
|
|
909
|
-
const a = Array.from(i.querySelectorAll("tr:not(.nodata)")).filter((f) => parseInt(f.dataset.row, 10) === e), c = a.length > 0 ? a.length : 1, l = a.indexOf(
|
|
910
|
-
t(this,
|
|
909
|
+
const a = Array.from(i.querySelectorAll("tr:not(.nodata)")).filter((f) => parseInt(f.dataset.row, 10) === e), c = a.length > 0 ? a.length : 1, l = a.indexOf(r), g = e * c + (l >= 0 ? l : 0);
|
|
910
|
+
t(this, F).selection.setRange(g, s, g, s);
|
|
911
911
|
}
|
|
912
912
|
}
|
|
913
913
|
}
|
|
914
|
-
moveCell(
|
|
915
|
-
var m, T,
|
|
914
|
+
moveCell(n) {
|
|
915
|
+
var m, T, R, M;
|
|
916
916
|
if (!t(this, lt)) return;
|
|
917
|
-
const e = t(this, lt),
|
|
918
|
-
if (!
|
|
919
|
-
const c = Array.from(
|
|
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
|
+
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, g = c.indexOf(s), f = r * l + (g >= 0 ? g : 0);
|
|
920
920
|
let b = f, u = i;
|
|
921
|
-
switch (
|
|
921
|
+
switch (n.code) {
|
|
922
922
|
case "Tab":
|
|
923
|
-
if (
|
|
924
|
-
if (u = t(this,
|
|
923
|
+
if (n.preventDefault(), n.shiftKey) {
|
|
924
|
+
if (u = t(this, Bt).call(this, f, i), u < 0 && f > 0) {
|
|
925
925
|
b = f - 1;
|
|
926
|
-
const
|
|
927
|
-
u =
|
|
926
|
+
const B = t(this, ct).call(this, b), z = t(this, Ot).call(this, B);
|
|
927
|
+
u = z ? parseInt(z.dataset.col, 10) : 0;
|
|
928
928
|
}
|
|
929
929
|
} else {
|
|
930
|
-
u = t(this,
|
|
931
|
-
const
|
|
932
|
-
u >=
|
|
930
|
+
u = t(this, Dt).call(this, f, i);
|
|
931
|
+
const B = t(this, ct).call(this, f), z = t(this, Ot).call(this, B), Gt = z ? parseInt(z.dataset.col, 10) + parseInt(z.colSpan || 1, 10) : 0;
|
|
932
|
+
u >= Gt && (b = f + 1, u = 0);
|
|
933
933
|
}
|
|
934
934
|
break;
|
|
935
935
|
case "ArrowRight":
|
|
936
|
-
u = t(this,
|
|
936
|
+
u = t(this, Dt).call(this, f, i);
|
|
937
937
|
break;
|
|
938
938
|
case "ArrowLeft":
|
|
939
|
-
u = t(this,
|
|
939
|
+
u = t(this, Bt).call(this, f, i);
|
|
940
940
|
break;
|
|
941
941
|
case "ArrowDown":
|
|
942
|
-
|
|
942
|
+
n.preventDefault(), b = f + (e.rowSpan || 1);
|
|
943
943
|
break;
|
|
944
944
|
case "ArrowUp":
|
|
945
|
-
|
|
945
|
+
n.preventDefault(), b = Math.max(0, f - (e.rowSpan || 1));
|
|
946
946
|
break;
|
|
947
947
|
}
|
|
948
948
|
const p = Math.floor(b / l), x = b % l;
|
|
949
949
|
let w = t(this, Wt).call(this, p, x, u, b);
|
|
950
950
|
if (w)
|
|
951
|
-
this.currentCell = w;
|
|
952
|
-
else if (p !==
|
|
953
|
-
const
|
|
954
|
-
(M = (
|
|
955
|
-
const
|
|
956
|
-
|
|
951
|
+
this.currentCell = w, V(this, pt, He).call(this, w);
|
|
952
|
+
else if (p !== r && p >= 0) {
|
|
953
|
+
const B = ((T = (m = t(this, F)).getRowHeight) == null ? void 0 : T.call(m)) || 40;
|
|
954
|
+
(M = (R = t(this, F)).scrollToY) == null || M.call(R, p * B), setTimeout(() => {
|
|
955
|
+
const z = t(this, Wt).call(this, p, x, u, b);
|
|
956
|
+
z && (this.currentCell = z, V(this, pt, He).call(this, z));
|
|
957
957
|
}, 0);
|
|
958
958
|
}
|
|
959
959
|
}
|
|
960
960
|
};
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
961
|
+
F = new WeakMap(), lt = new WeakMap(), ae = new WeakMap(), le = new WeakMap(), pt = new WeakSet(), // 🎯 셀이 보이지 않는 영역에 있을 때 컨테이너 스크롤을 동기화하는 함수
|
|
962
|
+
He = /* @__PURE__ */ h(function(n) {
|
|
963
|
+
const e = t(this, F).querySelector(".ng-container-body .ng-part-body");
|
|
964
|
+
if (!e) return;
|
|
965
|
+
const s = n.getBoundingClientRect(), r = e.getBoundingClientRect();
|
|
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"), Ot = new WeakMap(), Dt = new WeakMap(), Bt = new WeakMap(), ct = new WeakMap(), Wt = new WeakMap(), vs = /* @__PURE__ */ h(function() {
|
|
968
|
+
t(this, F).addEventListener("keydown", (n) => {
|
|
969
|
+
["Tab", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(n.code) && this.moveCell(n);
|
|
964
970
|
});
|
|
965
|
-
}, "#initEvents"), h(
|
|
966
|
-
let Me =
|
|
967
|
-
var ce, ht, dt, zt,
|
|
968
|
-
const
|
|
971
|
+
}, "#initEvents"), h(os, "CellNavigation");
|
|
972
|
+
let Me = os;
|
|
973
|
+
var ce, ht, dt, zt, Pt, he, de, xt, fe, ue;
|
|
974
|
+
const Ct = class Ct extends HTMLElement {
|
|
969
975
|
constructor() {
|
|
970
976
|
super();
|
|
971
977
|
d(this, ce);
|
|
972
978
|
d(this, ht, null);
|
|
973
979
|
d(this, dt);
|
|
974
980
|
d(this, zt);
|
|
975
|
-
d(this,
|
|
981
|
+
d(this, Pt);
|
|
976
982
|
q(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
977
983
|
S.log("sheet.invalidate()"), t(this, dt).refresh();
|
|
978
984
|
}, "invalidate"));
|
|
979
985
|
q(this, "generate", /* @__PURE__ */ h((e) => {
|
|
980
986
|
if (S.log("sheet.generate()"), !e) return;
|
|
981
987
|
y(this, ht, Ie.compile(e)), t(this, he).call(this), t(this, de).call(this);
|
|
982
|
-
const
|
|
983
|
-
|
|
984
|
-
var
|
|
985
|
-
(
|
|
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
|
+
var o;
|
|
991
|
+
(o = this.querySelector("nine-table-hscrollbar")) == null || o.refresh();
|
|
986
992
|
}, 0);
|
|
987
993
|
}, "generate"));
|
|
988
994
|
d(this, he, /* @__PURE__ */ h(() => {
|
|
@@ -990,37 +996,37 @@ const qt = class qt extends HTMLElement {
|
|
|
990
996
|
{ selector: ".ng-container-body", type: null },
|
|
991
997
|
{ selector: ".ng-container-left", type: "left" },
|
|
992
998
|
{ selector: ".ng-container-right", type: "right" }
|
|
993
|
-
].forEach(({ selector:
|
|
994
|
-
var i,
|
|
995
|
-
(i = this.querySelector(`${
|
|
999
|
+
].forEach(({ selector: s, type: r }) => {
|
|
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"));
|
|
996
1002
|
});
|
|
997
1003
|
}, "#renderSplitContainers"));
|
|
998
1004
|
d(this, de, /* @__PURE__ */ h(() => {
|
|
999
1005
|
["left", "right", "body"].forEach((e) => {
|
|
1000
|
-
const
|
|
1001
|
-
if (!
|
|
1006
|
+
const s = this.querySelector(`.ng-container-${e}`), r = s == null ? void 0 : s.querySelectorAll("table");
|
|
1007
|
+
if (!s || !r || r.length === 0) return;
|
|
1002
1008
|
let i = 0;
|
|
1003
|
-
|
|
1004
|
-
const a = parseInt(
|
|
1009
|
+
r[0].querySelectorAll("col").forEach((o) => {
|
|
1010
|
+
const a = parseInt(o.getAttribute("width"), 10);
|
|
1005
1011
|
isNaN(a) || (i += a);
|
|
1006
|
-
}), e === "body" ? (
|
|
1007
|
-
|
|
1008
|
-
})) : (
|
|
1009
|
-
|
|
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`;
|
|
1010
1016
|
}));
|
|
1011
1017
|
});
|
|
1012
1018
|
}, "#updateContainerWidths"));
|
|
1013
|
-
d(this,
|
|
1014
|
-
const i = e.cloneNode(!0),
|
|
1015
|
-
if (
|
|
1019
|
+
d(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");
|
|
1021
|
+
if (r === "header") {
|
|
1016
1022
|
if (a && a.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
1017
1023
|
const g = document.createElement("tbody");
|
|
1018
1024
|
g.className = "fixed-tbody", i.appendChild(g);
|
|
1019
1025
|
}
|
|
1020
|
-
} else
|
|
1021
|
-
return
|
|
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) => {
|
|
1022
1028
|
l.getAttribute("fixed") !== "left" && l.remove();
|
|
1023
|
-
}) :
|
|
1029
|
+
}) : s === "right" ? i.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
1024
1030
|
l.getAttribute("fixed") !== "right" && l.remove();
|
|
1025
1031
|
}) : i.querySelectorAll("[fixed=left], [fixed=right]").forEach((l) => {
|
|
1026
1032
|
l.remove();
|
|
@@ -1028,18 +1034,18 @@ const qt = class qt extends HTMLElement {
|
|
|
1028
1034
|
}, "#createSplitTable"));
|
|
1029
1035
|
q(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, dt).getRowHeight(), "getRowHeight"));
|
|
1030
1036
|
q(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
1031
|
-
const
|
|
1032
|
-
|
|
1037
|
+
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
1038
|
+
s && (s.scrollLeft = e);
|
|
1033
1039
|
}, "scrollToX"));
|
|
1034
1040
|
q(this, "scrollToY", /* @__PURE__ */ h((e) => {
|
|
1035
|
-
const
|
|
1036
|
-
|
|
1041
|
+
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
1042
|
+
s && (s.scrollTop = e);
|
|
1037
1043
|
}, "scrollToY"));
|
|
1038
1044
|
d(this, fe, /* @__PURE__ */ h(() => {
|
|
1039
|
-
t(this, ue).call(this), y(this, zt, new Le(this)), y(this,
|
|
1045
|
+
t(this, ue).call(this), y(this, zt, new Le(this)), y(this, Pt, new Me(this));
|
|
1040
1046
|
}, "#init"));
|
|
1041
1047
|
d(this, ue, /* @__PURE__ */ h(() => {
|
|
1042
|
-
const e =
|
|
1048
|
+
const e = Ct.SCROLLBAR_SIZE;
|
|
1043
1049
|
this.innerHTML = `
|
|
1044
1050
|
<style>
|
|
1045
1051
|
nine-table-sheet {
|
|
@@ -1249,29 +1255,29 @@ const qt = class qt extends HTMLElement {
|
|
|
1249
1255
|
return t(this, zt);
|
|
1250
1256
|
}
|
|
1251
1257
|
get navigation() {
|
|
1252
|
-
return t(this,
|
|
1258
|
+
return t(this, Pt);
|
|
1253
1259
|
}
|
|
1254
1260
|
disconnectedCallback() {
|
|
1255
1261
|
this.innerHTML = "", S.log("NineTableSheet destroyed.");
|
|
1256
1262
|
}
|
|
1257
1263
|
};
|
|
1258
|
-
ce = new WeakMap(), ht = new WeakMap(), dt = new WeakMap(), zt = new WeakMap(),
|
|
1259
|
-
let
|
|
1260
|
-
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet",
|
|
1261
|
-
var ge,
|
|
1262
|
-
const
|
|
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(), ue = new WeakMap(), h(Ct, "NineTableSheet"), q(Ct, "SCROLLBAR_SIZE", 16);
|
|
1265
|
+
let Zt = Ct;
|
|
1266
|
+
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", Zt);
|
|
1267
|
+
var ge, Ft;
|
|
1268
|
+
const is = class is extends HTMLElement {
|
|
1263
1269
|
constructor() {
|
|
1264
1270
|
super();
|
|
1265
1271
|
d(this, ge, /* @__PURE__ */ h(() => {
|
|
1266
1272
|
var e;
|
|
1267
|
-
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (
|
|
1268
|
-
var
|
|
1269
|
-
const
|
|
1270
|
-
t(this,
|
|
1271
|
-
}), t(this,
|
|
1273
|
+
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
1274
|
+
var o;
|
|
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);
|
|
1277
|
+
}), t(this, Ft).call(this, 0, !1);
|
|
1272
1278
|
}, "#init"));
|
|
1273
|
-
d(this,
|
|
1274
|
-
const
|
|
1279
|
+
d(this, Ft, /* @__PURE__ */ h((e, s = !1) => {
|
|
1280
|
+
const r = /* @__PURE__ */ h(() => {
|
|
1275
1281
|
const g = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
1276
1282
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((u) => u.style.setProperty("display", "none"));
|
|
1277
1283
|
const b = g.filter((u) => u.classList.contains("active"));
|
|
@@ -1279,9 +1285,9 @@ const os = class os extends HTMLElement {
|
|
|
1279
1285
|
const p = parseInt(u.getAttribute("data-index"), 10), x = this.querySelector(`nine-splitter[data-split-index="${p}"]`), w = g[p + 1];
|
|
1280
1286
|
x && w && w.classList.contains("active") && x.style.setProperty("display", "flex");
|
|
1281
1287
|
});
|
|
1282
|
-
}, "updateSplitters"), i = this.querySelector(".nine-tab-bar"),
|
|
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");
|
|
1283
1289
|
if (!a[e]) return;
|
|
1284
|
-
if (!
|
|
1290
|
+
if (!s)
|
|
1285
1291
|
a.forEach((g, f) => {
|
|
1286
1292
|
g.classList.toggle("active", f === e);
|
|
1287
1293
|
}), c.forEach((g, f) => {
|
|
@@ -1293,44 +1299,44 @@ const os = class os extends HTMLElement {
|
|
|
1293
1299
|
if (g.classList.contains("active") && f.length <= 1)
|
|
1294
1300
|
return;
|
|
1295
1301
|
g.classList.toggle("active");
|
|
1296
|
-
const b =
|
|
1302
|
+
const b = o.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
1297
1303
|
b && (b.classList.toggle("active"), b.classList.contains("active") || (b.style.flex = ""));
|
|
1298
1304
|
}
|
|
1299
|
-
const l =
|
|
1305
|
+
const l = o.querySelectorAll("nine-table-sheet.active");
|
|
1300
1306
|
l == null || l.forEach((g) => {
|
|
1301
1307
|
g.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
1302
|
-
}),
|
|
1308
|
+
}), r();
|
|
1303
1309
|
}, "#switchSheet"));
|
|
1304
1310
|
}
|
|
1305
1311
|
connectedCallback() {
|
|
1306
1312
|
t(this, ge).call(this);
|
|
1307
1313
|
}
|
|
1308
1314
|
};
|
|
1309
|
-
ge = new WeakMap(),
|
|
1310
|
-
let
|
|
1311
|
-
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets",
|
|
1312
|
-
var _, be,
|
|
1313
|
-
const
|
|
1314
|
-
constructor(
|
|
1315
|
+
ge = new WeakMap(), Ft = new WeakMap(), h(is, "NineTableSheets");
|
|
1316
|
+
let $e = is;
|
|
1317
|
+
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", $e);
|
|
1318
|
+
var _, be, jt, pe;
|
|
1319
|
+
const as = class as {
|
|
1320
|
+
constructor(n) {
|
|
1315
1321
|
d(this, _);
|
|
1316
1322
|
d(this, be, /* @__PURE__ */ h(() => {
|
|
1317
|
-
t(this, pe).call(this), new ResizeObserver((
|
|
1318
|
-
for (let e of
|
|
1319
|
-
t(this, _).getAttribute("auto-height") === "true" && t(this,
|
|
1323
|
+
t(this, pe).call(this), new ResizeObserver((n) => {
|
|
1324
|
+
for (let e of n)
|
|
1325
|
+
t(this, _).getAttribute("auto-height") === "true" && t(this, jt).call(this);
|
|
1320
1326
|
}).observe(t(this, _));
|
|
1321
1327
|
}, "#init"));
|
|
1322
|
-
d(this,
|
|
1328
|
+
d(this, jt, /* @__PURE__ */ h(() => {
|
|
1323
1329
|
var c, l;
|
|
1324
|
-
const
|
|
1325
|
-
if (
|
|
1326
|
-
const e = parseInt(t(this, _).getAttribute("max-display-row"), 10) || 10,
|
|
1330
|
+
const n = Array.from(t(this, _).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
1331
|
+
if (n.length === 0) return;
|
|
1332
|
+
const e = parseInt(t(this, _).getAttribute("max-display-row"), 10) || 10, s = Math.max(...n.map((g) => g.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;
|
|
1327
1333
|
t(this, _).style.height = `${a}px`;
|
|
1328
1334
|
}, "#applyAutoHeight"));
|
|
1329
1335
|
d(this, pe, /* @__PURE__ */ h(() => {
|
|
1330
|
-
const e = Array.from(t(this, _).children).filter((c) => c.tagName === "TABLE"),
|
|
1331
|
-
const f = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, b = l <
|
|
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 f = `<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>` : "";
|
|
1332
1338
|
return f + b;
|
|
1333
|
-
}).join(""),
|
|
1339
|
+
}).join(""), o = e.map((c, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
1334
1340
|
t(this, _).shadowRoot.innerHTML = `
|
|
1335
1341
|
<style>
|
|
1336
1342
|
:host {
|
|
@@ -1338,7 +1344,7 @@ const is = class is {
|
|
|
1338
1344
|
flex-direction: column;
|
|
1339
1345
|
position: relative;
|
|
1340
1346
|
overflow: hidden;
|
|
1341
|
-
height: ${
|
|
1347
|
+
height: ${s ? "auto" : "100%"};
|
|
1342
1348
|
background: #fff;
|
|
1343
1349
|
}
|
|
1344
1350
|
|
|
@@ -1444,7 +1450,7 @@ const is = class is {
|
|
|
1444
1450
|
<nine-table-sheets>
|
|
1445
1451
|
<nine-table-sheets-body>${i}</nine-table-sheets-body>
|
|
1446
1452
|
<nine-table-sheets-footer>
|
|
1447
|
-
<div class="nine-tab-bar">${
|
|
1453
|
+
<div class="nine-tab-bar">${o}</div>
|
|
1448
1454
|
<div class="sheets-counter">Total : <span id="row-count">0</span></div>
|
|
1449
1455
|
</nine-table-sheets-footer>
|
|
1450
1456
|
</nine-table-sheets>
|
|
@@ -1455,177 +1461,177 @@ const is = class is {
|
|
|
1455
1461
|
const a = t(this, _).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1456
1462
|
a == null || a.forEach((c, l) => {
|
|
1457
1463
|
e[l] && setTimeout(() => {
|
|
1458
|
-
c.generate(e[l]),
|
|
1464
|
+
c.generate(e[l]), s && t(this, jt).call(this);
|
|
1459
1465
|
});
|
|
1460
1466
|
});
|
|
1461
1467
|
}, "#render"));
|
|
1462
|
-
y(this, _,
|
|
1468
|
+
y(this, _, n), t(this, be).call(this);
|
|
1463
1469
|
}
|
|
1464
1470
|
};
|
|
1465
|
-
_ = new WeakMap(), be = new WeakMap(),
|
|
1466
|
-
let
|
|
1467
|
-
var
|
|
1468
|
-
const
|
|
1469
|
-
constructor(
|
|
1470
|
-
d(this,
|
|
1471
|
-
d(this,
|
|
1472
|
-
q(this, "count", /* @__PURE__ */ h(() => t(this,
|
|
1473
|
-
y(this,
|
|
1471
|
+
_ = new WeakMap(), be = new WeakMap(), jt = new WeakMap(), pe = new WeakMap(), h(as, "LayoutManager");
|
|
1472
|
+
let Ne = as;
|
|
1473
|
+
var Yt, wt;
|
|
1474
|
+
const ls = class ls {
|
|
1475
|
+
constructor(n) {
|
|
1476
|
+
d(this, Yt);
|
|
1477
|
+
d(this, wt, -1);
|
|
1478
|
+
q(this, "count", /* @__PURE__ */ h(() => t(this, Yt).rawRecords.length, "count"));
|
|
1479
|
+
y(this, Yt, n);
|
|
1474
1480
|
}
|
|
1475
1481
|
get at() {
|
|
1476
|
-
return t(this,
|
|
1482
|
+
return t(this, wt);
|
|
1477
1483
|
}
|
|
1478
|
-
set at(
|
|
1479
|
-
y(this,
|
|
1484
|
+
set at(n) {
|
|
1485
|
+
y(this, wt, parseInt(n, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, wt)}"]`) && setTimeout(() => {
|
|
1480
1486
|
});
|
|
1481
1487
|
}
|
|
1482
1488
|
};
|
|
1483
|
-
|
|
1484
|
-
let
|
|
1485
|
-
var D, I,
|
|
1489
|
+
Yt = new WeakMap(), wt = new WeakMap(), h(ls, "ngRow");
|
|
1490
|
+
let _e = ls;
|
|
1491
|
+
var D, I, W, vt, ye, J, me, ft, Vt, xe, we, St;
|
|
1486
1492
|
const P = class P {
|
|
1487
|
-
constructor(
|
|
1493
|
+
constructor(n, e) {
|
|
1488
1494
|
d(this, D);
|
|
1489
1495
|
d(this, I);
|
|
1490
|
-
d(this,
|
|
1491
|
-
d(this,
|
|
1496
|
+
d(this, W, []);
|
|
1497
|
+
d(this, vt, []);
|
|
1492
1498
|
d(this, ye, 0);
|
|
1493
|
-
d(this,
|
|
1499
|
+
d(this, J, []);
|
|
1494
1500
|
d(this, me, /* @__PURE__ */ h(() => {
|
|
1495
|
-
y(this,
|
|
1496
|
-
const
|
|
1497
|
-
Array.from(
|
|
1498
|
-
var
|
|
1499
|
-
t(this,
|
|
1501
|
+
y(this, J, []);
|
|
1502
|
+
const n = t(this, D).template || [];
|
|
1503
|
+
Array.from(n).forEach((e) => {
|
|
1504
|
+
var s;
|
|
1505
|
+
t(this, J).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1500
1506
|
}), (t(this, I).rawRecords || []).forEach((e) => {
|
|
1501
|
-
e.__ng || (e.__ng = t(this,
|
|
1507
|
+
e.__ng || (e.__ng = t(this, Vt).call(this)), e.__ng.height = t(this, J).slice();
|
|
1502
1508
|
});
|
|
1503
1509
|
}, "#initialize"));
|
|
1504
1510
|
d(this, ft, /* @__PURE__ */ h(() => {
|
|
1505
|
-
const
|
|
1506
|
-
|
|
1511
|
+
const n = t(this, D).shadowRoot.querySelector("nine-table-sheets");
|
|
1512
|
+
n == null || n.classList.toggle("nodata", this.length === 0), t(this, D).shadowRoot.querySelectorAll("nine-table-sheet").forEach((e) => {
|
|
1507
1513
|
e.invalidate();
|
|
1508
1514
|
});
|
|
1509
1515
|
}, "#invalidate"));
|
|
1510
|
-
q(this, "get", /* @__PURE__ */ h((
|
|
1516
|
+
q(this, "get", /* @__PURE__ */ h((n, e) => {
|
|
1511
1517
|
var i;
|
|
1512
|
-
const
|
|
1513
|
-
if (!
|
|
1514
|
-
if (
|
|
1515
|
-
if (
|
|
1516
|
-
const
|
|
1518
|
+
const s = this.getValidData();
|
|
1519
|
+
if (!s || s.length <= 0) return;
|
|
1520
|
+
if (n == null) return t(this, St).call(this, s);
|
|
1521
|
+
if (n < 0 || n >= s.length) return null;
|
|
1522
|
+
const r = typeof ((i = t(this, D).fields) == null ? void 0 : i.get) == "function" ? t(this, D).fields.get() : [];
|
|
1517
1523
|
if (e != null) {
|
|
1518
|
-
const
|
|
1519
|
-
return
|
|
1524
|
+
const o = r.indexOf(e);
|
|
1525
|
+
return o >= 0 ? s[n].v[o] : null;
|
|
1520
1526
|
}
|
|
1521
|
-
return t(this,
|
|
1527
|
+
return t(this, St).call(this, s[n]);
|
|
1522
1528
|
}, "get"));
|
|
1523
|
-
q(this, "set", /* @__PURE__ */ h((
|
|
1524
|
-
this.clear(), this.add(
|
|
1529
|
+
q(this, "set", /* @__PURE__ */ h((n) => {
|
|
1530
|
+
this.clear(), this.add(n, !1), t(this, ft).call(this);
|
|
1525
1531
|
}, "set"));
|
|
1526
|
-
d(this,
|
|
1532
|
+
d(this, Vt, /* @__PURE__ */ h(() => ({
|
|
1527
1533
|
rowState: P.ROW_STATE.EMPTY,
|
|
1528
1534
|
deleted: !1,
|
|
1529
1535
|
filtered: !1,
|
|
1530
|
-
height: t(this,
|
|
1536
|
+
height: t(this, J).slice(),
|
|
1531
1537
|
o: {},
|
|
1532
1538
|
c: {},
|
|
1533
|
-
_: [0, 0, 0, 0, P.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this,
|
|
1539
|
+
_: [0, 0, 0, 0, P.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, J).slice(), -1, {}, {}]
|
|
1534
1540
|
}), "#getDefaultMeta"));
|
|
1535
1541
|
q(this, "reset", /* @__PURE__ */ h(() => {
|
|
1536
|
-
y(this,
|
|
1542
|
+
y(this, W, []), y(this, vt, []), t(this, ft).call(this);
|
|
1537
1543
|
}, "reset"));
|
|
1538
1544
|
q(this, "clear", /* @__PURE__ */ h(() => {
|
|
1539
|
-
var
|
|
1540
|
-
t(this, I).rawRecords = [], y(this,
|
|
1545
|
+
var n;
|
|
1546
|
+
t(this, I).rawRecords = [], y(this, W, []), y(this, vt, []), (n = t(this, I).viewRecords) != null && n.reset && t(this, I).viewRecords.reset();
|
|
1541
1547
|
}, "clear"));
|
|
1542
|
-
d(this, xe, /* @__PURE__ */ h((
|
|
1543
|
-
var
|
|
1544
|
-
Array.isArray(
|
|
1545
|
-
const e = typeof ((
|
|
1546
|
-
return
|
|
1547
|
-
const
|
|
1548
|
+
d(this, xe, /* @__PURE__ */ h((n) => {
|
|
1549
|
+
var r;
|
|
1550
|
+
Array.isArray(n) || (n = [n]);
|
|
1551
|
+
const e = typeof ((r = t(this, D).fields) == null ? void 0 : r.get) == "function" ? t(this, D).fields.get() : Object.keys(n[0] || {}), s = [];
|
|
1552
|
+
return n.forEach((i) => {
|
|
1553
|
+
const o = { v: [] };
|
|
1548
1554
|
e.forEach((a) => {
|
|
1549
|
-
|
|
1550
|
-
}),
|
|
1551
|
-
}),
|
|
1555
|
+
o.v.push(i[a] !== void 0 && i[a] !== null ? i[a] : "");
|
|
1556
|
+
}), s.push(o);
|
|
1557
|
+
}), s;
|
|
1552
1558
|
}, "#json2Array"));
|
|
1553
|
-
d(this, we, /* @__PURE__ */ h((
|
|
1554
|
-
e.__ng = t(this,
|
|
1555
|
-
}),
|
|
1556
|
-
q(this, "add", /* @__PURE__ */ h((
|
|
1557
|
-
|
|
1558
|
-
const
|
|
1559
|
-
t(this, I).rawRecords = t(this, I).rawRecords.concat(t(this, we).call(this,
|
|
1560
|
-
const
|
|
1561
|
-
return e ||
|
|
1562
|
-
const a = t(this, I).rawRecords[
|
|
1559
|
+
d(this, we, /* @__PURE__ */ h((n) => (Array.isArray(n) || (n = [n]), n.forEach((e) => {
|
|
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;
|
|
1561
|
+
}), n), "#defaultInsert"));
|
|
1562
|
+
q(this, "add", /* @__PURE__ */ h((n, e = !0) => {
|
|
1563
|
+
n === void 0 && (n = {});
|
|
1564
|
+
const s = t(this, xe).call(this, n);
|
|
1565
|
+
t(this, I).rawRecords = t(this, I).rawRecords.concat(t(this, we).call(this, s)), this.resetRecords();
|
|
1566
|
+
const r = this.count() - 1;
|
|
1567
|
+
return e || s.forEach((i, o) => {
|
|
1568
|
+
const a = t(this, I).rawRecords[r - o];
|
|
1563
1569
|
a && (a.__ng.rowState = P.ROW_STATE.EMPTY);
|
|
1564
|
-
}), t(this, ft).call(this),
|
|
1570
|
+
}), t(this, ft).call(this), r;
|
|
1565
1571
|
}, "add"));
|
|
1566
|
-
q(this, "delete", /* @__PURE__ */ h((
|
|
1572
|
+
q(this, "delete", /* @__PURE__ */ h((n) => {
|
|
1567
1573
|
let e = [];
|
|
1568
|
-
Array.isArray(
|
|
1569
|
-
if (t(this,
|
|
1570
|
-
const
|
|
1571
|
-
t(this,
|
|
1572
|
-
i.__ng.rowid ===
|
|
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) => {
|
|
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);
|
|
1573
1579
|
});
|
|
1574
1580
|
}
|
|
1575
1581
|
}), this.resetRecords(), t(this, ft).call(this);
|
|
1576
1582
|
}, "delete"));
|
|
1577
|
-
q(this, "setValue", /* @__PURE__ */ h((
|
|
1583
|
+
q(this, "setValue", /* @__PURE__ */ h((n, e, s) => {
|
|
1578
1584
|
var c;
|
|
1579
|
-
|
|
1585
|
+
n = parseInt(n, 10);
|
|
1580
1586
|
const i = (typeof ((c = t(this, D).fields) == null ? void 0 : c.get) == "function" ? t(this, D).fields.get() : []).indexOf(e);
|
|
1581
1587
|
if (i < 0) return;
|
|
1582
|
-
const
|
|
1583
|
-
if (!
|
|
1584
|
-
const a =
|
|
1585
|
-
a !==
|
|
1588
|
+
const o = this.getValidData()[n];
|
|
1589
|
+
if (!o) return;
|
|
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;
|
|
1586
1592
|
}, "setValue"));
|
|
1587
1593
|
q(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1588
|
-
y(this,
|
|
1589
|
-
|
|
1590
|
-
}), t(this,
|
|
1591
|
-
|
|
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) => {
|
|
1595
|
+
n.__ng.rowidx = e;
|
|
1596
|
+
}), t(this, W).forEach((n, e) => {
|
|
1597
|
+
n.__ng.i = e;
|
|
1592
1598
|
});
|
|
1593
1599
|
}, "resetRecords"));
|
|
1594
|
-
q(this, "getValidData", /* @__PURE__ */ h(() => (t(this,
|
|
1595
|
-
d(this,
|
|
1596
|
-
var
|
|
1597
|
-
if (!
|
|
1598
|
-
const e = !Array.isArray(
|
|
1600
|
+
q(this, "getValidData", /* @__PURE__ */ h(() => (t(this, W).length === 0 && t(this, I).rawRecords.length > 0 && this.resetRecords(), t(this, W)), "getValidData"));
|
|
1601
|
+
d(this, St, /* @__PURE__ */ h((n) => {
|
|
1602
|
+
var o;
|
|
1603
|
+
if (!n) return n;
|
|
1604
|
+
const e = !Array.isArray(n), s = e ? [n] : n, r = typeof ((o = t(this, D).fields) == null ? void 0 : o.get) == "function" ? t(this, D).fields.get() : [], i = s.filter((a) => !a.__ng.deleted).map((a) => {
|
|
1599
1605
|
const c = {};
|
|
1600
|
-
return
|
|
1606
|
+
return r.forEach((l, g) => {
|
|
1601
1607
|
c[l] = a.v ? a.v[g] : a[l];
|
|
1602
1608
|
}), c.__ng = a.__ng, c;
|
|
1603
1609
|
});
|
|
1604
1610
|
return e ? i[0] : i;
|
|
1605
1611
|
}, "#conv"));
|
|
1606
1612
|
q(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1607
|
-
y(this, D,
|
|
1613
|
+
y(this, D, n), y(this, I, e), t(this, me).call(this);
|
|
1608
1614
|
}
|
|
1609
1615
|
get source() {
|
|
1610
|
-
return t(this,
|
|
1616
|
+
return t(this, St).call(this, t(this, I).rawRecords);
|
|
1611
1617
|
}
|
|
1612
|
-
set source(
|
|
1613
|
-
this.clear(), this.add(
|
|
1618
|
+
set source(n) {
|
|
1619
|
+
this.clear(), this.add(n, !1);
|
|
1614
1620
|
}
|
|
1615
1621
|
get nextId() {
|
|
1616
|
-
return ++
|
|
1622
|
+
return ++xs(this, ye)._;
|
|
1617
1623
|
}
|
|
1618
1624
|
get count() {
|
|
1619
|
-
return t(this,
|
|
1625
|
+
return t(this, W).length;
|
|
1620
1626
|
}
|
|
1621
1627
|
get length() {
|
|
1622
|
-
return t(this,
|
|
1628
|
+
return t(this, W).length;
|
|
1623
1629
|
}
|
|
1624
1630
|
getRowCount() {
|
|
1625
1631
|
return this.length;
|
|
1626
1632
|
}
|
|
1627
1633
|
};
|
|
1628
|
-
D = new WeakMap(), I = new WeakMap(),
|
|
1634
|
+
D = 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"), // 🎯 행 상태 정의 상수를 클래스 내부로 내재화
|
|
1629
1635
|
q(P, "ROW_STATE", {
|
|
1630
1636
|
EMPTY: "EMPTY",
|
|
1631
1637
|
NORMAL: "NORMAL",
|
|
@@ -1633,117 +1639,117 @@ q(P, "ROW_STATE", {
|
|
|
1633
1639
|
UPDATE: "UPDATE",
|
|
1634
1640
|
DELETE: "DELETE"
|
|
1635
1641
|
});
|
|
1636
|
-
let
|
|
1642
|
+
let Oe = P;
|
|
1637
1643
|
var ut;
|
|
1638
|
-
const
|
|
1639
|
-
constructor(
|
|
1644
|
+
const cs = class cs {
|
|
1645
|
+
constructor(n) {
|
|
1640
1646
|
d(this, ut);
|
|
1641
|
-
y(this, ut,
|
|
1647
|
+
y(this, ut, n), this.row = new _e(this), this.data = new Oe(t(this, ut), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1642
1648
|
var e;
|
|
1643
1649
|
(e = t(this, ut).view) != null && e.redraw && t(this, ut).view.redraw();
|
|
1644
1650
|
}, this.setDataSource = (e) => {
|
|
1645
1651
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1646
1652
|
}, this.getRowState = (e) => {
|
|
1647
|
-
var
|
|
1648
|
-
const
|
|
1649
|
-
if (!(
|
|
1650
|
-
return (i = (
|
|
1653
|
+
var r, i;
|
|
1654
|
+
const s = parseInt(e, 10);
|
|
1655
|
+
if (!(s >= this.data.count()))
|
|
1656
|
+
return (i = (r = this.data.getValidData()[s]) == null ? void 0 : r.__ng) == null ? void 0 : i.rowState;
|
|
1651
1657
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1652
1658
|
this.row.at = e;
|
|
1653
|
-
}, 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,
|
|
1654
|
-
e = parseInt(e, 10), this.data.setValue(e,
|
|
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) => {
|
|
1660
|
+
e = parseInt(e, 10), this.data.setValue(e, s, r);
|
|
1655
1661
|
}, this.setDataSource([]);
|
|
1656
1662
|
}
|
|
1657
1663
|
};
|
|
1658
|
-
ut = new WeakMap(), h(
|
|
1659
|
-
let
|
|
1660
|
-
var
|
|
1661
|
-
const
|
|
1664
|
+
ut = new WeakMap(), h(cs, "ngDataManager");
|
|
1665
|
+
let De = cs;
|
|
1666
|
+
var Rt, H, Ut, ve;
|
|
1667
|
+
const hs = class hs {
|
|
1662
1668
|
// 🎯 이제 { name: string, type: string } 객체들의 배열로 관리합니다.
|
|
1663
|
-
constructor(
|
|
1664
|
-
d(this,
|
|
1669
|
+
constructor(n) {
|
|
1670
|
+
d(this, Rt);
|
|
1665
1671
|
d(this, H, []);
|
|
1666
|
-
q(this, "add", /* @__PURE__ */ h((
|
|
1667
|
-
|
|
1668
|
-
t(this, H).some((
|
|
1669
|
-
}), t(this,
|
|
1672
|
+
q(this, "add", /* @__PURE__ */ h((n, e = "string") => {
|
|
1673
|
+
n.forEach((s) => {
|
|
1674
|
+
t(this, H).some((r) => r.name === s) || t(this, H).push({ name: s, type: e });
|
|
1675
|
+
}), t(this, Ut).call(this);
|
|
1670
1676
|
}, "add"));
|
|
1671
|
-
d(this,
|
|
1672
|
-
const
|
|
1677
|
+
d(this, Ut, /* @__PURE__ */ h(() => {
|
|
1678
|
+
const n = /* @__PURE__ */ new Map();
|
|
1673
1679
|
t(this, H).forEach((e) => {
|
|
1674
|
-
|
|
1675
|
-
}), y(this, H, Array.from(
|
|
1680
|
+
n.set(e.name, e.type);
|
|
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);
|
|
1676
1682
|
}, "#adjust"));
|
|
1677
1683
|
d(this, ve, /* @__PURE__ */ h(() => {
|
|
1678
|
-
y(this, H, []), S.log(t(this,
|
|
1679
|
-
const
|
|
1680
|
-
if (!(!
|
|
1681
|
-
for (const e of
|
|
1682
|
-
S.log(e), $("[data-bind]", e).each((
|
|
1683
|
-
const i =
|
|
1684
|
-
i && t(this, H).push({ name: i, type:
|
|
1685
|
-
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((
|
|
1686
|
-
$(`[${
|
|
1687
|
-
var
|
|
1688
|
-
if (
|
|
1689
|
-
const a =
|
|
1684
|
+
y(this, H, []), S.log(t(this, Rt).querySelectorAll("table"));
|
|
1685
|
+
const n = Array.from(t(this, Rt).querySelectorAll("table"));
|
|
1686
|
+
if (!(!n || n.length === 0)) {
|
|
1687
|
+
for (const e of n)
|
|
1688
|
+
S.log(e), $("[data-bind]", e).each((s, r) => {
|
|
1689
|
+
const i = r.dataset.bind, o = r.getAttribute("data-type") || "string";
|
|
1690
|
+
i && t(this, H).push({ name: i, type: o });
|
|
1691
|
+
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
1692
|
+
$(`[${s}]`, e).each((r, i) => {
|
|
1693
|
+
var o = i.getAttribute(s);
|
|
1694
|
+
if (o.indexOf("data.") < 0) {
|
|
1695
|
+
const a = o.search(/[(]/g);
|
|
1690
1696
|
if (a > 0)
|
|
1691
1697
|
try {
|
|
1692
|
-
|
|
1698
|
+
o = String(window[o.substring(0, a).trim()]);
|
|
1693
1699
|
} catch {
|
|
1694
|
-
|
|
1700
|
+
o = "";
|
|
1695
1701
|
}
|
|
1696
1702
|
}
|
|
1697
|
-
|
|
1703
|
+
o.split("data.").forEach((a) => {
|
|
1698
1704
|
if (a.trim() != "") {
|
|
1699
1705
|
const c = a.search(/[^_A-Za-z0-9]/g);
|
|
1700
1706
|
let l = "";
|
|
1701
|
-
c >= 0 ? l = a.substring(0, c) :
|
|
1707
|
+
c >= 0 ? l = a.substring(0, c) : o.startsWith("data.") && (l = a.replace("data.", "")), l && t(this, H).push({ name: l, type: "string" });
|
|
1702
1708
|
}
|
|
1703
1709
|
});
|
|
1704
1710
|
});
|
|
1705
1711
|
});
|
|
1706
|
-
t(this,
|
|
1712
|
+
t(this, Ut).call(this);
|
|
1707
1713
|
}
|
|
1708
1714
|
}, "#init"));
|
|
1709
|
-
y(this,
|
|
1715
|
+
y(this, Rt, n), t(this, ve).call(this);
|
|
1710
1716
|
}
|
|
1711
1717
|
// 🎯 기존에 필드 이름만 쓰던 곳들과의 호환을 위해 이름 배열만 리턴하는 메서드 유지
|
|
1712
1718
|
get() {
|
|
1713
|
-
return t(this, H).map((
|
|
1719
|
+
return t(this, H).map((n) => n.name);
|
|
1714
1720
|
}
|
|
1715
1721
|
// 🎯 내부 객체 통째로 얻기
|
|
1716
1722
|
getFields() {
|
|
1717
1723
|
return t(this, H);
|
|
1718
1724
|
}
|
|
1719
1725
|
// 🎯 특정 필드의 데이터 타입 조회
|
|
1720
|
-
getType(
|
|
1721
|
-
const e = t(this, H).find((
|
|
1726
|
+
getType(n) {
|
|
1727
|
+
const e = t(this, H).find((s) => s.name === n);
|
|
1722
1728
|
return e ? e.type : "string";
|
|
1723
1729
|
}
|
|
1724
|
-
indexOf(
|
|
1725
|
-
return t(this, H).findIndex((e) => e.name ===
|
|
1730
|
+
indexOf(n) {
|
|
1731
|
+
return t(this, H).findIndex((e) => e.name === n);
|
|
1726
1732
|
}
|
|
1727
|
-
includes(
|
|
1728
|
-
return t(this, H).some((e) => e.name ===
|
|
1733
|
+
includes(n) {
|
|
1734
|
+
return t(this, H).some((e) => e.name === n);
|
|
1729
1735
|
}
|
|
1730
1736
|
};
|
|
1731
|
-
|
|
1732
|
-
let
|
|
1733
|
-
var gt, Se,
|
|
1734
|
-
const
|
|
1737
|
+
Rt = new WeakMap(), H = new WeakMap(), Ut = new WeakMap(), ve = new WeakMap(), h(hs, "ngFields");
|
|
1738
|
+
let Be = hs;
|
|
1739
|
+
var gt, Se, Re;
|
|
1740
|
+
const ds = class ds extends HTMLElement {
|
|
1735
1741
|
constructor() {
|
|
1736
1742
|
super();
|
|
1737
1743
|
//#created = false;
|
|
1738
1744
|
d(this, gt);
|
|
1739
1745
|
d(this, Se);
|
|
1740
|
-
d(this,
|
|
1741
|
-
this.fields = new
|
|
1746
|
+
d(this, Re, /* @__PURE__ */ h(() => {
|
|
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 } }));
|
|
1742
1748
|
}, "#init"));
|
|
1743
|
-
this.attachShadow({ mode: "open" }), y(this, gt, new
|
|
1749
|
+
this.attachShadow({ mode: "open" }), y(this, gt, new De(this));
|
|
1744
1750
|
}
|
|
1745
1751
|
connectedCallback() {
|
|
1746
|
-
t(this,
|
|
1752
|
+
t(this, Re).call(this);
|
|
1747
1753
|
}
|
|
1748
1754
|
disconnectedCallback() {
|
|
1749
1755
|
S.log("NineTable disconnected.");
|
|
@@ -1761,10 +1767,10 @@ const hs = class hs extends HTMLElement {
|
|
|
1761
1767
|
return t(this, gt);
|
|
1762
1768
|
}
|
|
1763
1769
|
};
|
|
1764
|
-
gt = new WeakMap(), Se = new WeakMap(),
|
|
1765
|
-
let We =
|
|
1770
|
+
gt = new WeakMap(), Se = new WeakMap(), Re = new WeakMap(), h(ds, "NineTable");
|
|
1771
|
+
let We = ds;
|
|
1766
1772
|
customElements.get("nine-table") || customElements.define("nine-table", We);
|
|
1767
|
-
const
|
|
1773
|
+
const Tt = class Tt extends HTMLElement {
|
|
1768
1774
|
// 👈 커스텀 스타일용 캐시 추가
|
|
1769
1775
|
constructor() {
|
|
1770
1776
|
super();
|
|
@@ -1775,31 +1781,31 @@ const Ct = class Ct extends HTMLElement {
|
|
|
1775
1781
|
connectedCallback() {
|
|
1776
1782
|
}
|
|
1777
1783
|
};
|
|
1778
|
-
h(
|
|
1779
|
-
let ze =
|
|
1780
|
-
var L,
|
|
1781
|
-
const
|
|
1784
|
+
h(Tt, "BasicCellElement"), q(Tt, "_styleCache", /* @__PURE__ */ new Map()), q(Tt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1785
|
+
let ze = Tt;
|
|
1786
|
+
var L, Xt, v, Xe, Ke, Ge, Ze, Je;
|
|
1787
|
+
const fs = class fs extends ze {
|
|
1782
1788
|
constructor() {
|
|
1783
1789
|
super();
|
|
1784
1790
|
d(this, L);
|
|
1785
|
-
d(this,
|
|
1791
|
+
d(this, Xt);
|
|
1786
1792
|
d(this, v);
|
|
1787
|
-
d(this, Ue);
|
|
1788
1793
|
d(this, Xe);
|
|
1789
1794
|
d(this, Ke);
|
|
1790
1795
|
d(this, Ge);
|
|
1796
|
+
d(this, Ze);
|
|
1791
1797
|
q(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1792
1798
|
if (t(this, v))
|
|
1793
1799
|
if (t(this, v).closest("tbody")) {
|
|
1794
|
-
const
|
|
1795
|
-
if (!
|
|
1800
|
+
const s = t(this, v).closest("tr").data, r = parseInt(t(this, v).dataset.row);
|
|
1801
|
+
if (!s) return "";
|
|
1796
1802
|
if (ninegrid.isNull(t(this, v).dataset.expr)) {
|
|
1797
1803
|
if (!ninegrid.isNull(t(this, v).dataset.bind))
|
|
1798
|
-
return
|
|
1804
|
+
return s[t(this, v).dataset.bind] || ninegrid.nvl(e, "");
|
|
1799
1805
|
} else try {
|
|
1800
|
-
return this.getExprValue(t(this, v).dataset.expr,
|
|
1806
|
+
return this.getExprValue(t(this, v).dataset.expr, s, r, t(this, v));
|
|
1801
1807
|
} catch {
|
|
1802
|
-
console.error(t(this, v).dataset.expr,
|
|
1808
|
+
console.error(t(this, v).dataset.expr, s, t(this, v).dataset.row);
|
|
1803
1809
|
}
|
|
1804
1810
|
return ninegrid.nvl(e, "");
|
|
1805
1811
|
} else
|
|
@@ -1808,22 +1814,22 @@ const ds = class ds extends ze {
|
|
|
1808
1814
|
} catch {
|
|
1809
1815
|
}
|
|
1810
1816
|
}, "getDisplayText"));
|
|
1811
|
-
d(this,
|
|
1817
|
+
d(this, Je, /* @__PURE__ */ h(() => {
|
|
1812
1818
|
if (!(!t(this, L) || !t(this, L).template || !t(this, v).closest("tbody.bindable"))) {
|
|
1813
1819
|
var e = ninegrid.j.querySelectorAll(t(this, v)).attr("suppress");
|
|
1814
1820
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1815
|
-
var
|
|
1816
|
-
$("th,td",
|
|
1817
|
-
var
|
|
1818
|
-
|
|
1819
|
-
}),
|
|
1821
|
+
var s = t(this, v).closest("tr"), r = [];
|
|
1822
|
+
$("th,td", s).each((m, T) => {
|
|
1823
|
+
var R = ninegrid.j.querySelectorAll(T).attr("suppress");
|
|
1824
|
+
R && T.dataset.row && (R = parseInt(R), !isNaN(R) && R <= e && r.push(R));
|
|
1825
|
+
}), r.sort();
|
|
1820
1826
|
var i = !1;
|
|
1821
|
-
if (parseInt(
|
|
1822
|
-
for (var
|
|
1823
|
-
if (
|
|
1827
|
+
if (parseInt(s.sectionRowIndex / t(this, L).template.length) > 0)
|
|
1828
|
+
for (var o of r) {
|
|
1829
|
+
if (o > e) break;
|
|
1824
1830
|
var a = parseInt(t(this, v).dataset.row), c = a - 1, l = t(this, v).closest("tr").data, g = t(this, L).data.get(c);
|
|
1825
1831
|
t(this, v).dataset.matrixRow;
|
|
1826
|
-
var f = t(this, L).body.querySelector(`tbody.bindable [suppress="${
|
|
1832
|
+
var f = t(this, L).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, v).dataset.matrixRow}"]`), b = f.dataset.expr ? this.getExprValue(f.dataset.expr, l, a) : l[f.dataset.bind], u = f.dataset.expr ? this.getExprValue(f.dataset.expr, g, c) : g[f.dataset.bind];
|
|
1827
1833
|
if (b != u) {
|
|
1828
1834
|
i = !0;
|
|
1829
1835
|
break;
|
|
@@ -1837,12 +1843,12 @@ const ds = class ds extends ze {
|
|
|
1837
1843
|
}
|
|
1838
1844
|
}
|
|
1839
1845
|
}, "#resetSuppress"));
|
|
1840
|
-
q(this, "getExprValue", /* @__PURE__ */ h((e,
|
|
1846
|
+
q(this, "getExprValue", /* @__PURE__ */ h((e, s, r, i) => {
|
|
1841
1847
|
if (typeof e < "u")
|
|
1842
1848
|
try {
|
|
1843
|
-
|
|
1844
|
-
const
|
|
1845
|
-
return t(this, L)[
|
|
1849
|
+
r = parseInt(r);
|
|
1850
|
+
const o = e.replace("()", "");
|
|
1851
|
+
return t(this, L)[o] ? t(this, L)[o].call(this, s, r, t(this, v)) : t(this, L).exprFunction(e).call(this, s, r, t(this, L).data);
|
|
1846
1852
|
} catch {
|
|
1847
1853
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1848
1854
|
}
|
|
@@ -1851,16 +1857,16 @@ const ds = class ds extends ze {
|
|
|
1851
1857
|
}, "getExprValue"));
|
|
1852
1858
|
}
|
|
1853
1859
|
connectedCallback() {
|
|
1854
|
-
super.connectedCallback(), y(this, L, this.getRootNode().host), y(this, v, this.closest("th,td")), y(this,
|
|
1860
|
+
super.connectedCallback(), y(this, L, this.getRootNode().host), y(this, v, this.closest("th,td")), y(this, Xt, t(this, v).closest("tr"));
|
|
1855
1861
|
}
|
|
1856
1862
|
get value() {
|
|
1857
1863
|
var e = !t(this, L) || !t(this, L).dataManager || !t(this, v) || !t(this, v).dataset || !t(this, v).dataset.row || !t(this, v).dataset.bind ? "" : t(this, v).closest("tr").data[t(this, v).dataset.bind];
|
|
1858
1864
|
return e ?? "";
|
|
1859
1865
|
}
|
|
1860
1866
|
set value(e) {
|
|
1861
|
-
var
|
|
1862
|
-
const
|
|
1863
|
-
|
|
1867
|
+
var s = parseInt(t(this, v).dataset.row);
|
|
1868
|
+
const r = this.getAttribute("update-row-state") != "false";
|
|
1869
|
+
s < 0 ? t(this, L).data.setValueNF(parseInt(t(this, v).dataset.index), t(this, v).dataset.bind, e, r) : t(this, L).data.setValue(s, t(this, v).dataset.bind, e, r);
|
|
1864
1870
|
}
|
|
1865
1871
|
get row() {
|
|
1866
1872
|
return parseInt(t(this, v).dataset.row);
|
|
@@ -1870,12 +1876,12 @@ const ds = class ds extends ze {
|
|
|
1870
1876
|
}
|
|
1871
1877
|
refresh() {
|
|
1872
1878
|
const e = t(this, v).dataset.bind;
|
|
1873
|
-
return parseInt(t(this, v).dataset.row), t(this,
|
|
1879
|
+
return parseInt(t(this, v).dataset.row), t(this, Xt).data[e];
|
|
1874
1880
|
}
|
|
1875
1881
|
};
|
|
1876
|
-
L = new WeakMap(),
|
|
1877
|
-
let
|
|
1878
|
-
const
|
|
1882
|
+
L = new WeakMap(), Xt = new WeakMap(), v = new WeakMap(), Xe = new WeakMap(), Ke = new WeakMap(), Ge = new WeakMap(), Ze = new WeakMap(), Je = new WeakMap(), h(fs, "CellElement");
|
|
1883
|
+
let Pe = fs;
|
|
1884
|
+
const us = class us extends Pe {
|
|
1879
1885
|
constructor() {
|
|
1880
1886
|
super();
|
|
1881
1887
|
}
|
|
@@ -1886,21 +1892,21 @@ const fs = class fs extends Be {
|
|
|
1886
1892
|
return super.refresh();
|
|
1887
1893
|
}
|
|
1888
1894
|
};
|
|
1889
|
-
h(
|
|
1890
|
-
let
|
|
1891
|
-
var
|
|
1892
|
-
const
|
|
1895
|
+
h(us, "EditableCellElement");
|
|
1896
|
+
let Fe = us;
|
|
1897
|
+
var Kt, bt, At, Et, Ae, Q, Qe;
|
|
1898
|
+
const gs = class gs extends Fe {
|
|
1893
1899
|
constructor() {
|
|
1894
1900
|
super();
|
|
1895
|
-
d(this,
|
|
1901
|
+
d(this, Kt);
|
|
1896
1902
|
d(this, bt);
|
|
1897
1903
|
d(this, At);
|
|
1898
|
-
d(this,
|
|
1899
|
-
d(this,
|
|
1900
|
-
d(this,
|
|
1904
|
+
d(this, Et);
|
|
1905
|
+
d(this, Ae);
|
|
1906
|
+
d(this, Q);
|
|
1901
1907
|
q(this, "refresh", /* @__PURE__ */ h(() => {
|
|
1902
1908
|
const e = super.refresh();
|
|
1903
|
-
t(this,
|
|
1909
|
+
t(this, Kt).value = e;
|
|
1904
1910
|
}, "refresh"));
|
|
1905
1911
|
/**
|
|
1906
1912
|
dataRefresh = (v) => {
|
|
@@ -1932,36 +1938,36 @@ const us = class us extends Pe {
|
|
|
1932
1938
|
if (!v) this.reset();
|
|
1933
1939
|
};
|
|
1934
1940
|
*/
|
|
1935
|
-
d(this,
|
|
1941
|
+
d(this, Qe, /* @__PURE__ */ h((e) => {
|
|
1936
1942
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1937
1943
|
if (t(this, bt) == "number") {
|
|
1938
1944
|
let i = [];
|
|
1939
|
-
if (t(this,
|
|
1940
|
-
var
|
|
1941
|
-
if (
|
|
1942
|
-
var
|
|
1943
|
-
|
|
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) {
|
|
1946
|
+
var s = e.target.value, r = s.indexOf(".");
|
|
1947
|
+
if (r >= 0) {
|
|
1948
|
+
var s = s.substr(r + 1, s.length);
|
|
1949
|
+
s.length >= Number(t(this, Q)) && e.preventDefault();
|
|
1944
1950
|
}
|
|
1945
1951
|
}
|
|
1946
1952
|
}
|
|
1947
1953
|
t(this, At) && ninegrid.getByteLength(e.target.value) >= Number(t(this, At)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1948
1954
|
}
|
|
1949
1955
|
}, "#onKeyDown"));
|
|
1950
|
-
if (this.applyBaseStyle(), y(this, bt, this.getAttribute("type") || "text"), y(this, At, this.getAttribute("maxbyte")), y(this,
|
|
1956
|
+
if (this.applyBaseStyle(), y(this, bt, this.getAttribute("type") || "text"), y(this, At, this.getAttribute("maxbyte")), y(this, Et, this.getAttribute("min")), y(this, Ae, this.getAttribute("max")), y(this, Q, this.getAttribute("scale")), !["text", "number"].includes(t(this, bt))) throw `invalid type : ${t(this, bt)}`;
|
|
1951
1957
|
}
|
|
1952
1958
|
connectedCallback() {
|
|
1953
|
-
for (var e = [],
|
|
1954
|
-
["type", "maxlength", "maxbyte", "min", "max", "step", "scale", "text-align"].includes(this.attributes[
|
|
1959
|
+
for (var e = [], s = 0; s < this.attributes.length; s++)
|
|
1960
|
+
["type", "maxlength", "maxbyte", "min", "max", "step", "scale", "text-align"].includes(this.attributes[s].name) && e.push(`${this.attributes[s].name}="${this.attributes[s].value}"`);
|
|
1955
1961
|
this.innerHTML = `
|
|
1956
1962
|
<input type="text"
|
|
1957
1963
|
${e.join(" ")}
|
|
1958
1964
|
ondragstart="return false;"
|
|
1959
1965
|
>
|
|
1960
|
-
`, super.connectedCallback(), y(this,
|
|
1966
|
+
`, super.connectedCallback(), y(this, Kt, this.querySelector("input"));
|
|
1961
1967
|
}
|
|
1962
1968
|
};
|
|
1963
|
-
|
|
1964
|
-
let
|
|
1969
|
+
Kt = new WeakMap(), bt = new WeakMap(), At = new WeakMap(), Et = new WeakMap(), Ae = new WeakMap(), Q = new WeakMap(), Qe = new WeakMap(), h(gs, "CellInputText");
|
|
1970
|
+
let je = gs;
|
|
1965
1971
|
customElements.get("cell-input-text");
|
|
1966
|
-
customElements.get("cell-input") || customElements.define("cell-input",
|
|
1972
|
+
customElements.get("cell-input") || customElements.define("cell-input", je);
|
|
1967
1973
|
//# sourceMappingURL=nine-table.js.map
|