@ninebone/table 0.0.701 → 0.0.702
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 +459 -433
- 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
|
@@ -6,9 +6,9 @@ var as = (q, n, e) => n in q ? ss(q, n, { enumerable: !0, configurable: !0, writ
|
|
|
6
6
|
var h = (q, n) => ss(q, "name", { value: n, configurable: !0 });
|
|
7
7
|
var A = (q, n, e) => as(q, typeof n != "symbol" ? n + "" : n, e), he = (q, n, e) => n.has(q) || ns("Cannot " + e);
|
|
8
8
|
var t = (q, n, e) => (he(q, n, "read from private field"), e ? e.call(q) : n.get(q)), d = (q, n, e) => n.has(q) ? ns("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(q) : n.set(q, e), p = (q, n, e, s) => (he(q, n, "write to private field"), s ? s.call(q, e) : n.set(q, e), e), de = (q, n, e) => (he(q, n, "access private method"), e);
|
|
9
|
-
var
|
|
10
|
-
set _(
|
|
11
|
-
p(q, n,
|
|
9
|
+
var os = (q, n, e, s) => ({
|
|
10
|
+
set _(o) {
|
|
11
|
+
p(q, n, o, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
14
|
return t(q, n, s);
|
|
@@ -23,96 +23,96 @@ const De = class De extends ls.constructor {
|
|
|
23
23
|
h(De, "Trace");
|
|
24
24
|
let fe = De;
|
|
25
25
|
const w = new fe();
|
|
26
|
-
var
|
|
26
|
+
var B, j, R, K, Z, G, Wt, J, Bt;
|
|
27
27
|
const We = class We extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
d(this,
|
|
30
|
+
d(this, B);
|
|
31
31
|
d(this, j, !1);
|
|
32
32
|
d(this, R);
|
|
33
33
|
d(this, K);
|
|
34
34
|
d(this, Z);
|
|
35
35
|
d(this, G);
|
|
36
36
|
d(this, Wt, /* @__PURE__ */ h(() => {
|
|
37
|
-
if (!t(this,
|
|
38
|
-
const e = t(this,
|
|
37
|
+
if (!t(this, B)) return;
|
|
38
|
+
const e = t(this, B).querySelector(".ng-container-body .ng-part-body");
|
|
39
39
|
e && (p(this, G, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
41
|
})), t(this, G).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
44
|
-
if (!t(this,
|
|
44
|
+
if (!t(this, B) || !t(this, R) || t(this, j)) return;
|
|
45
45
|
const e = t(this, R).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const
|
|
47
|
+
const o = t(this, R).track, r = t(this, R).thumb, i = t(this, B).querySelector(".ng-container-bottom"), a = e.clientWidth, c = s.scrollWidth;
|
|
48
48
|
if (a !== 0 && c > a)
|
|
49
49
|
i && (i.style.display = "flex");
|
|
50
50
|
else {
|
|
51
51
|
i && (i.style.display = "none");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
const l =
|
|
54
|
+
const l = o.clientWidth;
|
|
55
55
|
if (l <= 0) return;
|
|
56
56
|
const f = Math.max(Math.min(l * (a / c), l), 20);
|
|
57
|
-
|
|
58
|
-
const g = e.scrollLeft,
|
|
59
|
-
let
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
|
|
57
|
+
r.style.width = `${f}px`;
|
|
58
|
+
const g = e.scrollLeft, b = c - a;
|
|
59
|
+
let u = 0;
|
|
60
|
+
b > 0 && (u = parseInt(g / b * (l - f), 10)), u < 0 && (u = 0);
|
|
61
|
+
const y = l - f;
|
|
62
|
+
u > y && (u = y), r.style.left = `${u}px`, t(this, R).left.disabled = u === 0, t(this, R).right.disabled = u >= y - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
64
|
d(this, J, /* @__PURE__ */ h((e) => {
|
|
65
65
|
if (!t(this, R)) return !1;
|
|
66
|
-
const s = t(this, R).container,
|
|
67
|
-
if (!
|
|
68
|
-
const
|
|
66
|
+
const s = t(this, R).container, o = s.querySelector("table");
|
|
67
|
+
if (!o) return !1;
|
|
68
|
+
const r = t(this, R).track.getBoundingClientRect(), i = t(this, R).thumb.clientWidth;
|
|
69
69
|
let a = e;
|
|
70
70
|
a < 0 && (a = 0);
|
|
71
|
-
const c =
|
|
71
|
+
const c = r.width - i;
|
|
72
72
|
a > c && (a = c), a = parseInt(a, 10), t(this, R).thumb.style.left = `${a}px`, t(this, R).left.disabled = a === 0, t(this, R).right.disabled = a >= c - 1;
|
|
73
|
-
const l = s.clientWidth, g =
|
|
73
|
+
const l = s.clientWidth, g = o.scrollWidth - l;
|
|
74
74
|
return c > 0 && g > 0 && (s.scrollLeft = a / c * g), a > 0 && a < c - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
d(this,
|
|
77
|
-
const e = /* @__PURE__ */ h((
|
|
76
|
+
d(this, Bt, /* @__PURE__ */ h(() => {
|
|
77
|
+
const e = /* @__PURE__ */ h((o) => {
|
|
78
78
|
clearInterval(t(this, K)), clearInterval(t(this, Z));
|
|
79
|
-
const
|
|
80
|
-
t(this, J).call(this,
|
|
79
|
+
const r = parseInt(t(this, R).thumb.style.left || 0, 10);
|
|
80
|
+
t(this, J).call(this, r + o), p(this, K, setInterval(() => {
|
|
81
81
|
clearInterval(t(this, K)), p(this, Z, setInterval(() => {
|
|
82
82
|
const i = parseInt(t(this, R).thumb.style.left || 0, 10);
|
|
83
|
-
t(this, J).call(this, i +
|
|
83
|
+
t(this, J).call(this, i + o) || clearInterval(t(this, Z));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), s = /* @__PURE__ */ h(() => {
|
|
87
87
|
clearInterval(t(this, K)), clearInterval(t(this, Z));
|
|
88
88
|
}, "clearTimer");
|
|
89
|
-
["mouseup", "mouseleave", "touchend"].forEach((
|
|
90
|
-
t(this, R).left.addEventListener(
|
|
91
|
-
}), t(this, R).left.addEventListener("mousedown", (
|
|
92
|
-
|
|
93
|
-
}), t(this, R).right.addEventListener("mousedown", (
|
|
94
|
-
|
|
95
|
-
}), t(this, R).left.addEventListener("touchstart", () => e(-20)), t(this, R).right.addEventListener("touchstart", () => e(20)), t(this, R).track.addEventListener("mousedown", (
|
|
96
|
-
if (
|
|
97
|
-
|
|
98
|
-
const
|
|
99
|
-
t(this, J).call(this,
|
|
100
|
-
}), t(this, R).thumb.addEventListener("mousedown", (
|
|
101
|
-
if (
|
|
102
|
-
|
|
103
|
-
const
|
|
89
|
+
["mouseup", "mouseleave", "touchend"].forEach((o) => {
|
|
90
|
+
t(this, R).left.addEventListener(o, s), t(this, R).right.addEventListener(o, s), t(this, R).track.addEventListener(o, s);
|
|
91
|
+
}), t(this, R).left.addEventListener("mousedown", (o) => {
|
|
92
|
+
o.button === 0 && e(-20);
|
|
93
|
+
}), t(this, R).right.addEventListener("mousedown", (o) => {
|
|
94
|
+
o.button === 0 && e(20);
|
|
95
|
+
}), t(this, R).left.addEventListener("touchstart", () => e(-20)), t(this, R).right.addEventListener("touchstart", () => e(20)), t(this, R).track.addEventListener("mousedown", (o) => {
|
|
96
|
+
if (o.button !== 0) return;
|
|
97
|
+
o.preventDefault();
|
|
98
|
+
const r = t(this, R).track.getBoundingClientRect(), i = t(this, R).thumb.clientWidth;
|
|
99
|
+
t(this, J).call(this, o.clientX - r.left - i / 2);
|
|
100
|
+
}), t(this, R).thumb.addEventListener("mousedown", (o) => {
|
|
101
|
+
if (o.button !== 0) return;
|
|
102
|
+
o.stopPropagation(), o.preventDefault(), p(this, j, !0), this.shiftX = o.clientX - t(this, R).thumb.getBoundingClientRect().left;
|
|
103
|
+
const r = /* @__PURE__ */ h((a) => {
|
|
104
104
|
if (!t(this, j)) return;
|
|
105
105
|
const c = t(this, R).track.getBoundingClientRect();
|
|
106
106
|
t(this, J).call(this, a.clientX - c.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), i = /* @__PURE__ */ h(() => {
|
|
108
|
-
p(this, j, !1), s(), document.removeEventListener("mousemove",
|
|
108
|
+
p(this, j, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
|
-
document.addEventListener("mousemove",
|
|
110
|
+
document.addEventListener("mousemove", r), document.addEventListener("mouseup", i);
|
|
111
111
|
});
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
114
114
|
connectedCallback() {
|
|
115
|
-
if (p(this,
|
|
115
|
+
if (p(this, B, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, B)) return;
|
|
116
116
|
this.innerHTML = `
|
|
117
117
|
<style>
|
|
118
118
|
nine-table-hscrollbar {
|
|
@@ -177,7 +177,7 @@ const We = class We 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 s = t(this,
|
|
180
|
+
const s = t(this, B).querySelector(".ng-container-body .ng-part-body");
|
|
181
181
|
if (!s) {
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
@@ -190,7 +190,7 @@ const We = class We extends HTMLElement {
|
|
|
190
190
|
right: this.querySelector(".ng-scroll-right")
|
|
191
191
|
}), s.addEventListener("scroll", () => {
|
|
192
192
|
t(this, j) || this.refresh();
|
|
193
|
-
}), t(this,
|
|
193
|
+
}), t(this, Bt).call(this), t(this, Wt).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
@@ -198,11 +198,11 @@ const We = class We extends HTMLElement {
|
|
|
198
198
|
t(this, G) && t(this, G).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
|
|
201
|
+
B = new WeakMap(), j = new WeakMap(), R = new WeakMap(), K = new WeakMap(), Z = new WeakMap(), G = new WeakMap(), Wt = new WeakMap(), J = new WeakMap(), Bt = new WeakMap(), h(We, "NineTableHScrollBar");
|
|
202
202
|
let ge = We;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ge);
|
|
204
|
-
var Q, tt, ht, T, St, Et,
|
|
205
|
-
const
|
|
204
|
+
var Q, tt, ht, T, St, Et, Ot;
|
|
205
|
+
const Be = class Be extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
208
|
d(this, Q);
|
|
@@ -213,52 +213,52 @@ const Oe = class Oe extends HTMLElement {
|
|
|
213
213
|
d(this, Et, 0);
|
|
214
214
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
215
|
if (w.log("vscrollbar.refresh"), !t(this, Q) || !t(this, T)) return;
|
|
216
|
-
const e = t(this, T).container, s = t(this, T).track,
|
|
217
|
-
if (c <=
|
|
216
|
+
const e = t(this, T).container, s = t(this, T).track, o = t(this, T).thumb, r = e.clientHeight, i = t(this, Q).data.length, a = t(this, tt).getRowHeight(), c = i * a;
|
|
217
|
+
if (c <= r || i === 0) {
|
|
218
218
|
this.style.display = "none";
|
|
219
219
|
return;
|
|
220
220
|
} else
|
|
221
221
|
this.style.display = "flex";
|
|
222
222
|
const l = s.clientHeight;
|
|
223
223
|
if (l <= 0) return;
|
|
224
|
-
const f = Math.max(Math.min(l * (
|
|
225
|
-
|
|
226
|
-
const g = e.scrollTop,
|
|
227
|
-
w.log(e, g,
|
|
228
|
-
let
|
|
229
|
-
|
|
230
|
-
const
|
|
231
|
-
|
|
224
|
+
const f = Math.max(Math.min(l * (r / c), l), 20);
|
|
225
|
+
o.style.height = `${f}px`;
|
|
226
|
+
const g = e.scrollTop, b = Math.max(c - r, 1);
|
|
227
|
+
w.log(e, g, b);
|
|
228
|
+
let u = 0;
|
|
229
|
+
b > 0 && (u = g / b * (l - f));
|
|
230
|
+
const y = l - f;
|
|
231
|
+
u < 0 && (u = 0), u > y && (u = y), o.style.top = `${u}px`, t(this, T).top.disabled = g <= 0, t(this, T).bottom.disabled = g >= b - 1;
|
|
232
232
|
}, "refresh"));
|
|
233
|
-
d(this,
|
|
233
|
+
d(this, Ot, /* @__PURE__ */ h(() => {
|
|
234
234
|
w.log("nine-table-vscrollbar.#init");
|
|
235
235
|
const e = t(this, T).container, s = /* @__PURE__ */ h(() => {
|
|
236
|
-
const
|
|
237
|
-
return
|
|
236
|
+
const r = (t(this, Q).data.get() || []).length, i = t(this, tt).getRowHeight();
|
|
237
|
+
return r * i;
|
|
238
238
|
}, "getContentHeight");
|
|
239
|
-
t(this, T).thumb.addEventListener("mousedown", (
|
|
240
|
-
if (
|
|
241
|
-
|
|
242
|
-
const
|
|
239
|
+
t(this, T).thumb.addEventListener("mousedown", (o) => {
|
|
240
|
+
if (o.button !== 0) return;
|
|
241
|
+
o.stopPropagation(), o.preventDefault(), p(this, ht, !0), p(this, St, o.clientY), p(this, Et, e.scrollTop);
|
|
242
|
+
const r = /* @__PURE__ */ h((a) => {
|
|
243
243
|
if (!t(this, ht)) return;
|
|
244
|
-
const c = t(this, T).track.getBoundingClientRect(), l = t(this, T).thumb.clientHeight, g = c.height - l,
|
|
244
|
+
const c = t(this, T).track.getBoundingClientRect(), l = t(this, T).thumb.clientHeight, g = c.height - l, b = a.clientY - t(this, St), u = e.clientHeight, y = s(), v = Math.max(y - u, 1);
|
|
245
245
|
if (g > 0 && v > 0) {
|
|
246
|
-
const S =
|
|
247
|
-
let
|
|
248
|
-
const I = Math.max(0,
|
|
249
|
-
|
|
246
|
+
const S = b / g * v;
|
|
247
|
+
let m = t(this, Et) + S;
|
|
248
|
+
const I = Math.max(0, y - u);
|
|
249
|
+
m < 0 && (m = 0), m > I && (m = I), e.scrollTop = m;
|
|
250
250
|
}
|
|
251
251
|
this.refresh();
|
|
252
252
|
}, "onMouseMove"), i = /* @__PURE__ */ h(() => {
|
|
253
|
-
p(this, ht, !1), document.removeEventListener("mousemove",
|
|
253
|
+
p(this, ht, !1), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i), this.refresh();
|
|
254
254
|
}, "onMouseUp");
|
|
255
|
-
document.addEventListener("mousemove",
|
|
256
|
-
}), t(this, T).track.addEventListener("mousedown", (
|
|
257
|
-
if (
|
|
258
|
-
const
|
|
259
|
-
if (l > 0 &&
|
|
260
|
-
const
|
|
261
|
-
e.scrollTop =
|
|
255
|
+
document.addEventListener("mousemove", r), document.addEventListener("mouseup", i);
|
|
256
|
+
}), t(this, T).track.addEventListener("mousedown", (o) => {
|
|
257
|
+
if (o.button !== 0 || o.target === t(this, T).thumb) return;
|
|
258
|
+
const r = t(this, T).track.getBoundingClientRect(), i = t(this, T).thumb.clientHeight, a = o.clientY - r.top - i / 2, l = r.height - i, f = e.clientHeight, g = s(), b = Math.max(g - f, 1);
|
|
259
|
+
if (l > 0 && b > 0) {
|
|
260
|
+
const u = Math.max(0, Math.min(1, a / l));
|
|
261
|
+
e.scrollTop = u * b;
|
|
262
262
|
}
|
|
263
263
|
this.refresh();
|
|
264
264
|
}), t(this, T).top.addEventListener("click", () => {
|
|
@@ -345,27 +345,27 @@ const Oe = class Oe extends HTMLElement {
|
|
|
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, Ot).call(this), this.refresh();
|
|
349
349
|
}, "initWhenReady");
|
|
350
350
|
e();
|
|
351
351
|
}
|
|
352
352
|
};
|
|
353
|
-
Q = new WeakMap(), tt = new WeakMap(), ht = new WeakMap(), T = new WeakMap(), St = new WeakMap(), Et = new WeakMap(),
|
|
354
|
-
let ue =
|
|
353
|
+
Q = new WeakMap(), tt = new WeakMap(), ht = new WeakMap(), T = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), Ot = new WeakMap(), h(Be, "NineTableVScrollBar");
|
|
354
|
+
let ue = Be;
|
|
355
355
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", ue);
|
|
356
|
-
var P, E, et,
|
|
357
|
-
const
|
|
356
|
+
var P, E, et, O, N, V, st, Rt, ke, Me, Pt, Ft, At, qt, Ct, Yt, jt, Tt, Le, dt, kt, Vt;
|
|
357
|
+
const Oe = class Oe {
|
|
358
358
|
constructor(n) {
|
|
359
359
|
d(this, P);
|
|
360
360
|
d(this, E);
|
|
361
361
|
d(this, et);
|
|
362
|
-
d(this,
|
|
362
|
+
d(this, O, /* @__PURE__ */ new Map());
|
|
363
363
|
d(this, N, null);
|
|
364
364
|
d(this, V, null);
|
|
365
365
|
d(this, st, 0);
|
|
366
366
|
d(this, Rt, 40);
|
|
367
367
|
d(this, ke, !1);
|
|
368
|
-
d(this,
|
|
368
|
+
d(this, Me, !1);
|
|
369
369
|
//#ticking = false; // 🎯 고속 스크롤 스로틀링용 플래그
|
|
370
370
|
d(this, Pt, 3);
|
|
371
371
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
@@ -378,17 +378,17 @@ const Be = class Be {
|
|
|
378
378
|
w.log("rowManager.initialize"), p(this, et, {
|
|
379
379
|
scrollTables: t(this, E).querySelectorAll(".ng-part-body table"),
|
|
380
380
|
firstTr: t(this, E).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
381
|
-
}), p(this, N, null), t(this,
|
|
381
|
+
}), p(this, N, null), t(this, O).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
382
382
|
const a = t(this, E).querySelector(i);
|
|
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
|
-
const g = Array.from(l.querySelectorAll("tr")).map((
|
|
389
|
-
t(this,
|
|
388
|
+
const g = Array.from(l.querySelectorAll("tr")).map((b) => b.cloneNode(!0));
|
|
389
|
+
t(this, O).set(i, g);
|
|
390
390
|
});
|
|
391
|
-
const n = t(this, E).querySelector(".ng-container-body .ng-part-body"), e = t(this, E).querySelector(".ng-container-left .ng-part-body"), s = t(this, E).querySelector(".ng-container-right .ng-part-body"),
|
|
391
|
+
const n = t(this, E).querySelector(".ng-container-body .ng-part-body"), e = t(this, E).querySelector(".ng-container-left .ng-part-body"), s = t(this, E).querySelector(".ng-container-right .ng-part-body"), o = t(this, E).querySelector(".ng-container-body .ng-part-header"), r = t(this, E).querySelector(".ng-container-body .ng-part-footer");
|
|
392
392
|
if (n) {
|
|
393
393
|
t(this, At).call(this), t(this, Tt).call(this), t(this, qt).call(this), t(this, dt).call(this, n.scrollTop);
|
|
394
394
|
let i = !1;
|
|
@@ -397,7 +397,7 @@ const Be = class Be {
|
|
|
397
397
|
if (i) return;
|
|
398
398
|
i = !0;
|
|
399
399
|
const l = c.scrollTop, f = c.scrollLeft;
|
|
400
|
-
n && n.scrollTop !== l && (n.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l),
|
|
400
|
+
n && n.scrollTop !== l && (n.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), o && o.scrollLeft !== f && (o.scrollLeft = f), r && r.scrollLeft !== f && (r.scrollLeft = f), t(this, dt).call(this, l), (g = t(this, E).querySelector("nine-table-vscrollbar")) == null || g.refresh(), i = !1;
|
|
401
401
|
}, "handleContainerScroll");
|
|
402
402
|
[n, e, s].forEach((c) => {
|
|
403
403
|
c == null || c.addEventListener("scroll", () => {
|
|
@@ -408,53 +408,53 @@ const Be = class Be {
|
|
|
408
408
|
}, "initialize"));
|
|
409
409
|
d(this, Ft, /* @__PURE__ */ h((n, e) => {
|
|
410
410
|
w.log("rowManager.#renderRows");
|
|
411
|
-
const s = t(this,
|
|
411
|
+
const s = t(this, O).get(e);
|
|
412
412
|
if (!s || s.length === 0) return;
|
|
413
|
-
const
|
|
414
|
-
if (!
|
|
415
|
-
|
|
416
|
-
const
|
|
413
|
+
const o = n.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
414
|
+
if (!o) return;
|
|
415
|
+
o.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
|
|
416
|
+
const r = o.querySelector("tr.nodata"), i = document.createDocumentFragment();
|
|
417
417
|
for (let a = 0; a < t(this, Rt); a++)
|
|
418
418
|
s.forEach((c) => {
|
|
419
419
|
i.appendChild(c.cloneNode(!0));
|
|
420
420
|
});
|
|
421
|
-
|
|
421
|
+
r ? r.before(i) : o.appendChild(i), e === ".ng-container-body" && (t(this, et).firstTr = o.querySelector("tr:not(.nodata)"));
|
|
422
422
|
}, "#renderRows"));
|
|
423
423
|
d(this, At, /* @__PURE__ */ h(() => {
|
|
424
424
|
if (t(this, N) !== null && t(this, N) > 0)
|
|
425
425
|
return t(this, N);
|
|
426
426
|
const n = t(this, E).querySelector(".ng-container-body .ng-part-body");
|
|
427
427
|
w.log("rowManager.#measureAndCacheHeight");
|
|
428
|
-
const e = t(this,
|
|
428
|
+
const e = t(this, O).get(".ng-container-body");
|
|
429
429
|
if (!e || e.length === 0) throw new Error("invalid dom");
|
|
430
430
|
const s = n.querySelector("tbody.bindable-tbody");
|
|
431
431
|
if (w.log(s), !s) throw new Error("invalid dom");
|
|
432
|
-
s.querySelectorAll("tr:not(.nodata)").forEach((
|
|
433
|
-
const
|
|
434
|
-
e.forEach((
|
|
435
|
-
|
|
436
|
-
}),
|
|
432
|
+
s.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
|
|
433
|
+
const o = s.querySelector("tr.nodata"), r = document.createDocumentFragment();
|
|
434
|
+
e.forEach((b) => {
|
|
435
|
+
r.appendChild(b.cloneNode(!0));
|
|
436
|
+
}), o ? o.before(r) : s.appendChild(r);
|
|
437
437
|
const i = t(this, E), a = i.style.display, c = i.style.visibility, l = i.style.position;
|
|
438
438
|
(a === "none" || window.getComputedStyle(i).display === "none") && (i.style.display = "block", i.style.visibility = "hidden", i.style.position = "absolute");
|
|
439
439
|
let f = 0;
|
|
440
440
|
const g = s.querySelectorAll("tr");
|
|
441
|
-
return g.forEach((
|
|
442
|
-
let
|
|
443
|
-
if (
|
|
444
|
-
const
|
|
445
|
-
|
|
441
|
+
return g.forEach((b) => {
|
|
442
|
+
let u = b.offsetHeight || b.getBoundingClientRect().height;
|
|
443
|
+
if (u === 0) {
|
|
444
|
+
const y = window.getComputedStyle(b);
|
|
445
|
+
u = parseFloat(y.height) || parseFloat(y.minHeight) || 0;
|
|
446
446
|
}
|
|
447
|
-
f +=
|
|
448
|
-
}), g.forEach((
|
|
447
|
+
f += u;
|
|
448
|
+
}), g.forEach((b) => b.remove()), i.style.display = a, i.style.visibility = c, i.style.position = l, f <= 0 ? -1 : (p(this, N, f), t(this, Ct).call(this), t(this, N));
|
|
449
449
|
}, "#measureAndCacheHeight"));
|
|
450
450
|
d(this, qt, /* @__PURE__ */ h(() => {
|
|
451
451
|
w.log("rowManager.#updateVirtualScrollHeight");
|
|
452
|
-
const e = (t(this, P).data.get() || []).length, s = t(this, N),
|
|
453
|
-
w.log("🔍 [VirtualHeight]", { totalCount: e, rowHeight: s, totalVirtualHeight:
|
|
454
|
-
const i = t(this, E).querySelector(
|
|
452
|
+
const e = (t(this, P).data.get() || []).length, s = t(this, N), o = e * s;
|
|
453
|
+
w.log("🔍 [VirtualHeight]", { totalCount: e, rowHeight: s, totalVirtualHeight: o }), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((r) => {
|
|
454
|
+
const i = t(this, E).querySelector(r);
|
|
455
455
|
if (!i) return;
|
|
456
456
|
const a = i.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
457
|
-
a && (a.style.height = `${
|
|
457
|
+
a && (a.style.height = `${o}px`);
|
|
458
458
|
});
|
|
459
459
|
}, "#updateVirtualScrollHeight"));
|
|
460
460
|
d(this, Ct, /* @__PURE__ */ h(() => {
|
|
@@ -463,44 +463,44 @@ const Be = class Be {
|
|
|
463
463
|
p(this, Rt, n + t(this, Pt));
|
|
464
464
|
}
|
|
465
465
|
}, "#updateRowCount"));
|
|
466
|
-
d(this,
|
|
467
|
-
var a, c, l, f, g,
|
|
466
|
+
d(this, Yt, /* @__PURE__ */ h(() => {
|
|
467
|
+
var a, c, l, f, g, b;
|
|
468
468
|
const n = t(this, E).querySelector(".ng-container-left .ng-part-body table"), e = t(this, E).querySelector(".ng-container-body .ng-part-body table"), s = t(this, E).querySelector(".ng-container-right .ng-part-body table");
|
|
469
469
|
if (e) {
|
|
470
|
-
const
|
|
471
|
-
for (let
|
|
470
|
+
const u = n ? Array.from(n.querySelectorAll("tbody tr")) : [], y = Array.from(e.querySelectorAll("tbody tr")), v = s ? Array.from(s.querySelectorAll("tbody tr")) : [], S = Math.max(u.length, y.length, v.length);
|
|
471
|
+
for (let m = 0; m < S; m++) {
|
|
472
472
|
const I = [
|
|
473
|
-
((a =
|
|
474
|
-
((c =
|
|
475
|
-
((l = v[
|
|
473
|
+
((a = u[m]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
474
|
+
((c = y[m]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
475
|
+
((l = v[m]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
476
476
|
], C = Math.max(...I);
|
|
477
|
-
C > 0 && (
|
|
477
|
+
C > 0 && (u[m] && (u[m].style.height = `${C}px`), y[m] && (y[m].style.height = `${C}px`), v[m] && (v[m].style.height = `${C}px`));
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
|
-
const
|
|
481
|
-
if (
|
|
482
|
-
const
|
|
483
|
-
for (let
|
|
480
|
+
const o = t(this, E).querySelector(".ng-container-left .ng-part-footer table"), r = t(this, E).querySelector(".ng-container-body .ng-part-footer table"), i = t(this, E).querySelector(".ng-container-right .ng-part-footer table");
|
|
481
|
+
if (r) {
|
|
482
|
+
const u = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], y = Array.from(r.querySelectorAll("tfoot tr")), v = i ? Array.from(i.querySelectorAll("tfoot tr")) : [], S = Math.max(u.length, y.length, v.length);
|
|
483
|
+
for (let m = 0; m < S; m++) {
|
|
484
484
|
const I = [
|
|
485
|
-
((f =
|
|
486
|
-
((g =
|
|
487
|
-
((
|
|
485
|
+
((f = u[m]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
486
|
+
((g = y[m]) == null ? void 0 : g.getBoundingClientRect().height) || 0,
|
|
487
|
+
((b = v[m]) == null ? void 0 : b.getBoundingClientRect().height) || 0
|
|
488
488
|
], C = Math.max(...I);
|
|
489
|
-
C > 0 && (
|
|
489
|
+
C > 0 && (u[m] && (u[m].style.height = `${C}px`), y[m] && (y[m].style.height = `${C}px`), v[m] && (v[m].style.height = `${C}px`));
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
492
|
}, "#syncRowHeights"));
|
|
493
|
-
d(this,
|
|
493
|
+
d(this, jt, /* @__PURE__ */ h(() => {
|
|
494
494
|
!t(this, E) || !(t(this, E) instanceof HTMLElement) || (p(this, V, new ResizeObserver((n) => {
|
|
495
495
|
for (const e of n) {
|
|
496
496
|
const s = e.target;
|
|
497
497
|
if (!s.classList.contains("active")) continue;
|
|
498
|
-
const
|
|
499
|
-
if (
|
|
500
|
-
let
|
|
498
|
+
const o = e.contentRect.height;
|
|
499
|
+
if (o > 0) {
|
|
500
|
+
let r = 0;
|
|
501
501
|
const i = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
|
|
502
|
-
i && (
|
|
503
|
-
const c = Math.max(
|
|
502
|
+
i && (r += i.offsetHeight), a && (r += a.offsetHeight);
|
|
503
|
+
const c = Math.max(o - r, 100);
|
|
504
504
|
t(this, st) !== c && (p(this, st, c), t(this, Ct).call(this), t(this, N) !== null && (t(this, Tt).call(this), this.refresh()));
|
|
505
505
|
}
|
|
506
506
|
}
|
|
@@ -510,54 +510,54 @@ const Be = class Be {
|
|
|
510
510
|
w.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
511
511
|
const e = t(this, E).querySelector(n);
|
|
512
512
|
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Ft).call(this, e, n);
|
|
513
|
-
}), t(this,
|
|
513
|
+
}), t(this, Vt).call(this), t(this, Yt).call(this);
|
|
514
514
|
}, "#renderAllContainers"));
|
|
515
|
-
d(this,
|
|
515
|
+
d(this, Le, /* @__PURE__ */ h((n) => {
|
|
516
516
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
517
517
|
var l;
|
|
518
518
|
const s = t(this, E).querySelector(e);
|
|
519
519
|
if (!s) return;
|
|
520
|
-
const
|
|
521
|
-
if (!
|
|
522
|
-
const
|
|
523
|
-
|
|
524
|
-
const
|
|
525
|
-
if (
|
|
520
|
+
const o = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
521
|
+
if (!o) return;
|
|
522
|
+
const r = Array.from(o.querySelectorAll("tr:not(.nodata)")), i = ((l = t(this, O).get(e)) == null ? void 0 : l.length) || 1, c = (t(this, P).data.get() || []).length;
|
|
523
|
+
r.forEach((f, g) => {
|
|
524
|
+
const b = n + Math.floor(g / i);
|
|
525
|
+
if (b >= c) {
|
|
526
526
|
f.style.visibility = "hidden";
|
|
527
527
|
return;
|
|
528
528
|
}
|
|
529
|
-
const
|
|
530
|
-
f.style.display = "", t(this, kt).call(this, f,
|
|
529
|
+
const u = t(this, P).data.get(b);
|
|
530
|
+
f.style.display = "", t(this, kt).call(this, f, u, b);
|
|
531
531
|
});
|
|
532
532
|
});
|
|
533
533
|
}, "#adjustBufferRows"));
|
|
534
534
|
d(this, dt, /* @__PURE__ */ h((n) => {
|
|
535
|
-
var g,
|
|
535
|
+
var g, b;
|
|
536
536
|
const e = t(this, N);
|
|
537
537
|
if (!e || e <= 0) return;
|
|
538
538
|
const s = t(this, P).data.length;
|
|
539
539
|
if (s === 0) return;
|
|
540
|
-
const
|
|
541
|
-
w.log("bodyContainer.clientHeight",
|
|
542
|
-
const i = Math.max(0, s - Math.floor(
|
|
540
|
+
const o = ((g = t(this, O).get(".ng-container-body")) == null ? void 0 : g.length) || 1, r = t(this, E).querySelector(".ng-container-body .ng-part-body");
|
|
541
|
+
w.log("bodyContainer.clientHeight", r.clientHeight);
|
|
542
|
+
const i = Math.max(0, s - Math.floor(r.clientHeight / e)), a = Math.min(i, Math.max(0, Math.floor(n / e)));
|
|
543
543
|
let c = Math.floor(a * e);
|
|
544
544
|
w.log(`📜 [Scroll Calc] maxStartIndex: ${i}, startIndex: ${a}, offsetY: ${c}`), a === i && w.log(`📜 [Scroll Inspect] scrollTop: ${n}, rowHeight: ${e}, maxStartIndex: ${i}, startIndex: ${a}, offsetY: ${c}`);
|
|
545
545
|
const l = t(this, et).firstTr, f = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
|
|
546
|
-
(
|
|
547
|
-
|
|
548
|
-
}), f !== a && (w.log(`🔄 [Row Bind Trigger] currentStartIndex(${f}) !== startIndex(${a})`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
549
|
-
const
|
|
550
|
-
if (!
|
|
551
|
-
const v =
|
|
546
|
+
(b = t(this, et)) == null || b.scrollTables.forEach((u) => {
|
|
547
|
+
u.style.transform = `translate3d(0, ${c}px, 0)`;
|
|
548
|
+
}), f !== a && (w.log(`🔄 [Row Bind Trigger] currentStartIndex(${f}) !== startIndex(${a})`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((u) => {
|
|
549
|
+
const y = t(this, E).querySelector(u);
|
|
550
|
+
if (!y) return;
|
|
551
|
+
const v = y.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
552
552
|
if (!v) return;
|
|
553
|
-
Array.from(v.querySelectorAll("tr:not(.nodata)")).forEach((
|
|
554
|
-
const C = a + Math.floor(I /
|
|
553
|
+
Array.from(v.querySelectorAll("tr:not(.nodata)")).forEach((m, I) => {
|
|
554
|
+
const C = a + Math.floor(I / o);
|
|
555
555
|
if (C >= s) {
|
|
556
|
-
|
|
556
|
+
m.style.display = "none";
|
|
557
557
|
return;
|
|
558
558
|
}
|
|
559
559
|
const _ = t(this, P).data.get(C);
|
|
560
|
-
|
|
560
|
+
m.style.display = "", t(this, kt).call(this, m, _, C);
|
|
561
561
|
});
|
|
562
562
|
}));
|
|
563
563
|
}, "#handleScroll"));
|
|
@@ -576,48 +576,48 @@ const Be = class Be {
|
|
|
576
576
|
});
|
|
577
577
|
}; */
|
|
578
578
|
d(this, kt, /* @__PURE__ */ h((n, e, s) => {
|
|
579
|
-
n.dataset.row = s, n.data = e, Array.from(n.cells).forEach((
|
|
580
|
-
|
|
581
|
-
const i = Array.from(
|
|
579
|
+
n.dataset.row = s, n.data = e, Array.from(n.cells).forEach((o, r) => {
|
|
580
|
+
o.dataset.row = s;
|
|
581
|
+
const i = Array.from(o.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
|
|
582
582
|
i && typeof i.refresh == "function" && i.refresh();
|
|
583
583
|
});
|
|
584
584
|
}, "#bindRowData"));
|
|
585
|
-
d(this,
|
|
585
|
+
d(this, Vt, /* @__PURE__ */ h(() => {
|
|
586
586
|
var c, l, f;
|
|
587
587
|
w.log("rowManager.#syncHeaderHeights");
|
|
588
588
|
const n = t(this, E).querySelector(".ng-container-left .ng-part-header table"), e = t(this, E).querySelector(".ng-container-body .ng-part-header table"), s = t(this, E).querySelector(".ng-container-right .ng-part-header table");
|
|
589
589
|
if (!e) return;
|
|
590
|
-
const
|
|
590
|
+
const o = n ? Array.from(n.querySelectorAll("tr")) : [], r = Array.from(e.querySelectorAll("tr")), i = s ? Array.from(s.querySelectorAll("tr")) : [], a = Math.max(o.length, r.length, i.length);
|
|
591
591
|
for (let g = 0; g < a; g++) {
|
|
592
|
-
const
|
|
593
|
-
((c =
|
|
594
|
-
((l =
|
|
592
|
+
const b = [
|
|
593
|
+
((c = o[g]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
594
|
+
((l = r[g]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
595
595
|
((f = i[g]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
596
|
-
],
|
|
597
|
-
|
|
596
|
+
], u = Math.max(...b);
|
|
597
|
+
u > 0 && (o[g] && (o[g].style.height = `${u}px`), r[g] && (r[g].style.height = `${u}px`), i[g] && (i[g].style.height = `${u}px`));
|
|
598
598
|
}
|
|
599
599
|
}, "#syncHeaderHeights"));
|
|
600
600
|
A(this, "destroy", /* @__PURE__ */ h(() => {
|
|
601
601
|
t(this, V) && (t(this, V).disconnect(), p(this, V, null));
|
|
602
602
|
}, "destroy"));
|
|
603
|
-
p(this, P, n.getRootNode().host), p(this, E, n), t(this,
|
|
603
|
+
p(this, P, n.getRootNode().host), p(this, E, n), t(this, jt).call(this);
|
|
604
604
|
}
|
|
605
605
|
getRowHeight() {
|
|
606
606
|
return t(this, N);
|
|
607
607
|
}
|
|
608
608
|
templateLength(n = ".ng-container-body") {
|
|
609
609
|
var e;
|
|
610
|
-
return ((e = t(this,
|
|
610
|
+
return ((e = t(this, O).get(n)) == null ? void 0 : e.length) || 1;
|
|
611
611
|
}
|
|
612
612
|
};
|
|
613
|
-
P = new WeakMap(), E = new WeakMap(), et = new WeakMap(),
|
|
614
|
-
let be =
|
|
615
|
-
const
|
|
613
|
+
P = new WeakMap(), E = new WeakMap(), et = new WeakMap(), O = new WeakMap(), N = new WeakMap(), V = new WeakMap(), st = new WeakMap(), Rt = new WeakMap(), ke = new WeakMap(), Me = new WeakMap(), Pt = new WeakMap(), Ft = new WeakMap(), At = new WeakMap(), qt = new WeakMap(), Ct = new WeakMap(), Yt = new WeakMap(), jt = new WeakMap(), Tt = new WeakMap(), Le = new WeakMap(), dt = new WeakMap(), kt = new WeakMap(), Vt = new WeakMap(), h(Oe, "RowManager");
|
|
614
|
+
let be = Oe;
|
|
615
|
+
const Xt = class Xt {
|
|
616
616
|
/**
|
|
617
617
|
* 🎯 레이아웃 내의 여러 rawTables 배열을 일괄로 받아 단일 마스터 템플릿으로 사전 컴파일합니다.
|
|
618
618
|
*/
|
|
619
619
|
static compileAll(n) {
|
|
620
|
-
return Array.isArray(n) ? n.map((e) =>
|
|
620
|
+
return Array.isArray(n) ? n.map((e) => Xt.compile(e)) : [];
|
|
621
621
|
}
|
|
622
622
|
/**
|
|
623
623
|
* 🎯 단일 원본 테이블을 받아 기본 구조 보정 및 2차원 격자 인덱스 사전 부여 완료된 마스터 테이블 반환
|
|
@@ -629,16 +629,16 @@ const Ut = class Ut {
|
|
|
629
629
|
const f = l.getAttribute("cell-type") || "renderer";
|
|
630
630
|
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
631
631
|
let g = `cell-${f}`;
|
|
632
|
-
const
|
|
632
|
+
const b = l.getAttribute("data-bind"), u = l.getAttribute("data-expr"), y = l.getAttribute("maxbyte"), v = l.getAttribute("type");
|
|
633
633
|
let S = [];
|
|
634
|
-
|
|
634
|
+
b && S.push(`data-bind="${b}"`), u && S.push(`data-expr="${u}"`), y && S.push(`maxbyte="${y}"`), v && S.push(`type="${v}"`), l.innerHTML = `<${g} ${S.join(" ")}></${g}>`;
|
|
635
635
|
});
|
|
636
636
|
}, "processCellTypes"), s = /* @__PURE__ */ h((a) => {
|
|
637
637
|
if (!a.querySelector("colgroup")) {
|
|
638
638
|
const c = a.querySelector("tbody tr") || a.querySelector("tr"), l = c ? c.querySelectorAll("th, td").length : 1, f = document.createElement("colgroup"), g = Math.max(Math.floor(a.clientWidth / l), 100);
|
|
639
|
-
for (let
|
|
640
|
-
const
|
|
641
|
-
|
|
639
|
+
for (let b = 0; b < l; b++) {
|
|
640
|
+
const u = document.createElement("col");
|
|
641
|
+
u.setAttribute("width", g), f.appendChild(u);
|
|
642
642
|
}
|
|
643
643
|
a.prepend(f);
|
|
644
644
|
}
|
|
@@ -647,63 +647,63 @@ const Ut = class Ut {
|
|
|
647
647
|
l ? l.after(c) : a.prepend(c);
|
|
648
648
|
}
|
|
649
649
|
a.classList.add("nine-table-element");
|
|
650
|
-
}, "ensureTableStructure"),
|
|
650
|
+
}, "ensureTableStructure"), o = /* @__PURE__ */ h((a, c) => {
|
|
651
651
|
const l = Array.from(a.querySelectorAll(c + " tr")), f = Array.from(a.querySelectorAll(c + " th," + c + " td")), g = l.length;
|
|
652
652
|
if (g === 0 || f.length === 0) return;
|
|
653
|
-
let
|
|
654
|
-
f.forEach((
|
|
655
|
-
|
|
653
|
+
let b = 0;
|
|
654
|
+
f.forEach((y) => {
|
|
655
|
+
b += y.colSpan || 1;
|
|
656
656
|
});
|
|
657
|
-
const
|
|
658
|
-
l.forEach((
|
|
659
|
-
const v =
|
|
657
|
+
const u = Array.from(Array(g), () => Array(b).fill(null));
|
|
658
|
+
l.forEach((y) => {
|
|
659
|
+
const v = y.sectionRowIndex;
|
|
660
660
|
let S = 0;
|
|
661
|
-
Array.from(
|
|
662
|
-
for (let _ = 0; _ <
|
|
663
|
-
if (
|
|
661
|
+
Array.from(y.querySelectorAll("th,td")).forEach((m) => {
|
|
662
|
+
for (let _ = 0; _ < u[v].length; _++)
|
|
663
|
+
if (u[v][_] === null) {
|
|
664
664
|
S = _;
|
|
665
665
|
break;
|
|
666
666
|
}
|
|
667
|
-
const I =
|
|
667
|
+
const I = m.rowSpan || 1, C = m.colSpan || 1;
|
|
668
668
|
for (let _ = 0; _ < I; _++)
|
|
669
|
-
for (let
|
|
670
|
-
v + _ < g && S +
|
|
669
|
+
for (let Y = 0; Y < C; Y++)
|
|
670
|
+
v + _ < g && S + Y < b && (u[v + _][S + Y] = _ === 0 && Y === 0 ? "1" : "0");
|
|
671
671
|
});
|
|
672
|
-
}), l.forEach((
|
|
673
|
-
const v =
|
|
674
|
-
Array.from(
|
|
675
|
-
for (let
|
|
676
|
-
if (
|
|
677
|
-
S.dataset.col =
|
|
672
|
+
}), l.forEach((y) => {
|
|
673
|
+
const v = y.sectionRowIndex;
|
|
674
|
+
Array.from(y.querySelectorAll("th,td")).forEach((S) => {
|
|
675
|
+
for (let m = 0; m < u[v].length; m++)
|
|
676
|
+
if (u[v][m] === "1") {
|
|
677
|
+
S.dataset.col = m, u[v][m] = "0";
|
|
678
678
|
break;
|
|
679
679
|
}
|
|
680
680
|
});
|
|
681
681
|
});
|
|
682
|
-
}, "resetColIndex"),
|
|
683
|
-
return s(
|
|
682
|
+
}, "resetColIndex"), r = n.cloneNode(!0);
|
|
683
|
+
return s(r), e(r), o(r, "thead"), o(r, "tbody"), o(r, "tfoot"), Array.from(r.querySelectorAll("colgroup col")).forEach((a, c) => {
|
|
684
684
|
const l = a.getAttribute("fixed");
|
|
685
|
-
l &&
|
|
685
|
+
l && r.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((f) => {
|
|
686
686
|
f.setAttribute("fixed", l);
|
|
687
687
|
});
|
|
688
|
-
}),
|
|
688
|
+
}), r;
|
|
689
689
|
}
|
|
690
690
|
// 🎯 [추가] td/th에 선언된 cell-type 속성을 읽어 커스텀 태그로 자동 감싸기
|
|
691
691
|
};
|
|
692
|
-
h(
|
|
693
|
-
let pe =
|
|
694
|
-
var
|
|
692
|
+
h(Xt, "TableCompiler");
|
|
693
|
+
let pe = Xt;
|
|
694
|
+
var F, nt, xt, rs, is;
|
|
695
695
|
const Pe = class Pe {
|
|
696
696
|
constructor(n) {
|
|
697
697
|
d(this, xt);
|
|
698
|
-
d(this,
|
|
698
|
+
d(this, F);
|
|
699
699
|
d(this, nt, { startRow: -1, startCol: -1, endRow: -1, endCol: -1 });
|
|
700
700
|
A(this, "render", /* @__PURE__ */ h(() => {
|
|
701
|
-
const { startRow: n, startCol: e, endRow: s, endCol:
|
|
701
|
+
const { startRow: n, startCol: e, endRow: s, endCol: o } = t(this, nt);
|
|
702
702
|
w.log("🎨 [CellSelection.render] Rendering range ->", t(this, nt));
|
|
703
|
-
const
|
|
703
|
+
const r = t(this, F).querySelectorAll(
|
|
704
704
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
705
705
|
);
|
|
706
|
-
if (
|
|
706
|
+
if (r.forEach((a) => {
|
|
707
707
|
a.querySelectorAll(".selected, .selected-top, .selected-bottom, .selected-left, .selected-right").forEach((c) => {
|
|
708
708
|
c.classList.remove("selected", "selected-top", "selected-bottom", "selected-left", "selected-right");
|
|
709
709
|
});
|
|
@@ -712,51 +712,52 @@ const Pe = class Pe {
|
|
|
712
712
|
return;
|
|
713
713
|
}
|
|
714
714
|
let i = 0;
|
|
715
|
-
|
|
715
|
+
r.forEach((a, c) => {
|
|
716
716
|
a.querySelectorAll("tbody tr").forEach((l) => {
|
|
717
717
|
if (l.classList.contains("nodata")) return;
|
|
718
718
|
const f = parseInt(l.dataset.row, 10);
|
|
719
719
|
isNaN(f) || l.querySelectorAll("td, th").forEach((g) => {
|
|
720
|
-
const
|
|
721
|
-
if (isNaN(
|
|
722
|
-
const
|
|
723
|
-
f <= s && v >= n &&
|
|
720
|
+
const b = parseInt(g.dataset.col, 10);
|
|
721
|
+
if (isNaN(b)) return;
|
|
722
|
+
const u = parseInt(g.rowSpan || 1, 10), y = parseInt(g.colSpan || 1, 10), v = f + u - 1, S = b + y - 1;
|
|
723
|
+
f <= s && v >= n && b <= o && S >= e && (i++, g.classList.add("selected"), f === n && g.classList.add("selected-top"), v === s && g.classList.add("selected-bottom"), b === e && g.classList.add("selected-left"), S === o && g.classList.add("selected-right"));
|
|
724
724
|
});
|
|
725
725
|
});
|
|
726
726
|
}), w.log(`✨ [CellSelection.render] Total rendered cells marked: ${i}`);
|
|
727
727
|
}, "render"));
|
|
728
|
-
p(this,
|
|
728
|
+
p(this, F, n), de(this, xt, is).call(this), w.log("🎯 [CellSelection] Initialized");
|
|
729
729
|
}
|
|
730
|
-
setRange(n, e, s,
|
|
731
|
-
w.log(`🔍 [CellSelection.setRange] Input -> startRow: ${n}, startCol: ${e}, endRow: ${s}, endCol: ${
|
|
732
|
-
let
|
|
733
|
-
const l = de(this, xt,
|
|
730
|
+
setRange(n, e, s, o) {
|
|
731
|
+
w.log(`🔍 [CellSelection.setRange] Input -> startRow: ${n}, startCol: ${e}, endRow: ${s}, endCol: ${o}`);
|
|
732
|
+
let r = Math.min(n, s), i = Math.max(n, s), a = Math.min(e, o), c = Math.max(e, o);
|
|
733
|
+
const l = de(this, xt, rs).call(this, r, a, i, c);
|
|
734
734
|
p(this, nt, l), w.log("📦 [CellSelection.setRange] Expanded Range ->", t(this, nt)), this.render();
|
|
735
735
|
}
|
|
736
736
|
};
|
|
737
|
-
|
|
738
|
-
let
|
|
739
|
-
const g = t(this,
|
|
737
|
+
F = new WeakMap(), nt = new WeakMap(), xt = new WeakSet(), rs = /* @__PURE__ */ h(function(n, e, s, o) {
|
|
738
|
+
let r = n, i = e, a = s, c = o, l = !0, f = 0;
|
|
739
|
+
const g = t(this, F).querySelectorAll(
|
|
740
740
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
741
741
|
);
|
|
742
742
|
for (; l && f < 10; )
|
|
743
|
-
l = !1, f++, g.forEach((
|
|
744
|
-
|
|
745
|
-
const v = parseInt(
|
|
746
|
-
isNaN(v) ||
|
|
747
|
-
const
|
|
748
|
-
if (isNaN(
|
|
749
|
-
const I = parseInt(S.rowSpan || 1, 10), C = parseInt(S.colSpan || 1, 10), _ = v + I - 1,
|
|
750
|
-
if (v <= a && _ >=
|
|
751
|
-
const Je = Math.min(
|
|
752
|
-
(Je !==
|
|
743
|
+
l = !1, f++, g.forEach((b, u) => {
|
|
744
|
+
b.querySelectorAll("tbody tr").forEach((y) => {
|
|
745
|
+
const v = parseInt(y.dataset.row, 10);
|
|
746
|
+
isNaN(v) || y.querySelectorAll("td, th").forEach((S) => {
|
|
747
|
+
const m = parseInt(S.dataset.col, 10);
|
|
748
|
+
if (isNaN(m)) return;
|
|
749
|
+
const I = parseInt(S.rowSpan || 1, 10), C = parseInt(S.colSpan || 1, 10), _ = v + I - 1, Y = m + C - 1;
|
|
750
|
+
if (v <= a && _ >= r && m <= c && Y >= i) {
|
|
751
|
+
const Je = Math.min(r, v), Qe = Math.max(a, _), ts = Math.min(i, m), es = Math.max(c, Y);
|
|
752
|
+
(Je !== r || Qe !== a || ts !== i || es !== c) && (r = Je, a = Qe, i = ts, c = es, l = !0);
|
|
753
753
|
}
|
|
754
754
|
});
|
|
755
755
|
});
|
|
756
756
|
});
|
|
757
|
-
return { startRow:
|
|
758
|
-
}, "#expandRangeByMerge"),
|
|
759
|
-
|
|
757
|
+
return { startRow: r, startCol: i, endRow: a, endCol: c };
|
|
758
|
+
}, "#expandRangeByMerge"), // CellSelection.js 내부의 #initEvents 메서드 수정
|
|
759
|
+
is = /* @__PURE__ */ h(function() {
|
|
760
|
+
const n = t(this, F).querySelector(".ng-container-top");
|
|
760
761
|
if (!n) {
|
|
761
762
|
w.log("❌ [CellSelection] .ng-container-top not found!");
|
|
762
763
|
return;
|
|
@@ -776,13 +777,38 @@ Y = new WeakMap(), nt = new WeakMap(), xt = new WeakSet(), os = /* @__PURE__ */
|
|
|
776
777
|
w.log("🖱️ [MouseDown] Clicked on .nodata row");
|
|
777
778
|
return;
|
|
778
779
|
}
|
|
779
|
-
const
|
|
780
|
-
w.log(`🖱️ [MouseDown Success] startRow: ${
|
|
780
|
+
const o = parseInt(s.dataset.row, 10), r = parseInt(s.dataset.col, 10);
|
|
781
|
+
w.log(`🖱️ [MouseDown Success] startRow: ${o}, startCol: ${r}`), this.setRange(o, r, o, r);
|
|
781
782
|
const i = /* @__PURE__ */ h((c) => {
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
w.log(
|
|
783
|
+
w.log(`🏃 [MouseMove Event] clientX: ${c.clientX}, clientY: ${c.clientY}`);
|
|
784
|
+
const l = document.elementFromPoint(c.clientX, c.clientY);
|
|
785
|
+
let f = l == null ? void 0 : l.closest("td, th");
|
|
786
|
+
if (f ? w.log("🎯 [MouseMove] elementFromPoint found cell:", { row: f.dataset.row, col: f.dataset.col }) : w.log("🔍 [MouseMove] elementFromPoint failed to find td/th. Element found:", l), !f || !t(this, F).contains(f)) {
|
|
787
|
+
w.log("⚠️ [MouseMove] Fallback to bounding rect check...");
|
|
788
|
+
const u = t(this, F).querySelectorAll(".ng-part-body tbody tr:not(.nodata) td, .ng-part-body tbody tr:not(.nodata) th");
|
|
789
|
+
for (const y of u) {
|
|
790
|
+
const v = y.getBoundingClientRect();
|
|
791
|
+
if (c.clientX >= v.left && c.clientX <= v.right && c.clientY >= v.top && c.clientY <= v.bottom) {
|
|
792
|
+
f = y;
|
|
793
|
+
break;
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
w.log(`🔍 [MouseMove Fallback Result] Matched cell found: ${!!f}, total checked cells: ${u.length}`);
|
|
797
|
+
}
|
|
798
|
+
if (!f) {
|
|
799
|
+
w.log("❌ [MouseMove] Target cell is still null after fallback.");
|
|
800
|
+
return;
|
|
801
|
+
}
|
|
802
|
+
if (f.dataset.row === void 0 || f.dataset.col === void 0) {
|
|
803
|
+
w.log("❌ [MouseMove] Target cell missing dataset.row or dataset.col", f);
|
|
804
|
+
return;
|
|
805
|
+
}
|
|
806
|
+
if (f.closest("tr").classList.contains("nodata")) {
|
|
807
|
+
w.log("🏃 [MouseMove] Target cell is in .nodata row");
|
|
808
|
+
return;
|
|
809
|
+
}
|
|
810
|
+
const g = parseInt(f.dataset.row, 10), b = parseInt(f.dataset.col, 10);
|
|
811
|
+
w.log(`🏃 [MouseMove Dragging Success] endRow: ${g}, endCol: ${b}`), this.setRange(o, r, g, b);
|
|
786
812
|
}, "onMouseMove"), a = /* @__PURE__ */ h(() => {
|
|
787
813
|
w.log("🖱️ [MouseUp] Drag ended."), document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", a);
|
|
788
814
|
}, "onMouseUp");
|
|
@@ -790,22 +816,22 @@ Y = new WeakMap(), nt = new WeakMap(), xt = new WeakSet(), os = /* @__PURE__ */
|
|
|
790
816
|
});
|
|
791
817
|
}, "#initEvents"), h(Pe, "CellSelection");
|
|
792
818
|
let ye = Pe;
|
|
793
|
-
var
|
|
819
|
+
var Ut, ot, rt, Mt, Kt, Zt, ft, Gt, Jt;
|
|
794
820
|
const vt = class vt extends HTMLElement {
|
|
795
821
|
constructor() {
|
|
796
822
|
super();
|
|
797
|
-
d(this,
|
|
798
|
-
d(this,
|
|
799
|
-
d(this,
|
|
800
|
-
d(this,
|
|
823
|
+
d(this, Ut);
|
|
824
|
+
d(this, ot, null);
|
|
825
|
+
d(this, rt);
|
|
826
|
+
d(this, Mt);
|
|
801
827
|
A(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
802
|
-
w.log("sheet.invalidate()"), t(this,
|
|
828
|
+
w.log("sheet.invalidate()"), t(this, rt).refresh();
|
|
803
829
|
}, "invalidate"));
|
|
804
830
|
A(this, "generate", /* @__PURE__ */ h((e) => {
|
|
805
831
|
if (w.log("sheet.generate()"), !e) return;
|
|
806
|
-
p(this,
|
|
807
|
-
const s = this.querySelector(".ng-container-body .ng-part-header"),
|
|
808
|
-
s &&
|
|
832
|
+
p(this, ot, pe.compile(e)), t(this, Kt).call(this), t(this, Zt).call(this);
|
|
833
|
+
const s = this.querySelector(".ng-container-body .ng-part-header"), o = this.querySelector(".ng-container-body .ng-part-footer"), r = this.querySelector(".ng-nodata-overlay");
|
|
834
|
+
s && r && (r.style.top = `${s.offsetHeight}px`), o && r && (r.style.bottom = `${o.offsetHeight}px`), t(this, rt).initialize(), setTimeout(() => {
|
|
809
835
|
var i;
|
|
810
836
|
(i = this.querySelector("nine-table-hscrollbar")) == null || i.refresh();
|
|
811
837
|
}, 0);
|
|
@@ -815,39 +841,39 @@ const vt = class vt extends HTMLElement {
|
|
|
815
841
|
{ selector: ".ng-container-body", type: null },
|
|
816
842
|
{ selector: ".ng-container-left", type: "left" },
|
|
817
843
|
{ selector: ".ng-container-right", type: "right" }
|
|
818
|
-
].forEach(({ selector: s, type:
|
|
819
|
-
var
|
|
820
|
-
(
|
|
844
|
+
].forEach(({ selector: s, type: o }) => {
|
|
845
|
+
var r, i, a;
|
|
846
|
+
(r = this.querySelector(`${s} .ng-part-header`)) == null || r.appendChild(t(this, ft).call(this, t(this, ot), o, "header")), (i = this.querySelector(`${s} .ng-virtual-spacer`)) == null || i.before(t(this, ft).call(this, t(this, ot), o, "body")), (a = this.querySelector(`${s} .ng-part-footer`)) == null || a.appendChild(t(this, ft).call(this, t(this, ot), o, "footer"));
|
|
821
847
|
});
|
|
822
848
|
}, "#renderSplitContainers"));
|
|
823
849
|
d(this, Zt, /* @__PURE__ */ h(() => {
|
|
824
850
|
["left", "right", "body"].forEach((e) => {
|
|
825
|
-
const s = this.querySelector(`.ng-container-${e}`),
|
|
826
|
-
if (!s || !
|
|
827
|
-
let
|
|
828
|
-
|
|
851
|
+
const s = this.querySelector(`.ng-container-${e}`), o = s == null ? void 0 : s.querySelectorAll("table");
|
|
852
|
+
if (!s || !o || o.length === 0) return;
|
|
853
|
+
let r = 0;
|
|
854
|
+
o[0].querySelectorAll("col").forEach((i) => {
|
|
829
855
|
const a = parseInt(i.getAttribute("width"), 10);
|
|
830
|
-
isNaN(
|
|
831
|
-
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${
|
|
856
|
+
isNaN(r) || (r += a);
|
|
857
|
+
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${r}px`, s.style.width = `${r}px`);
|
|
832
858
|
});
|
|
833
859
|
}, "#updateContainerWidths"));
|
|
834
|
-
d(this, ft, /* @__PURE__ */ h((e, s,
|
|
835
|
-
const
|
|
836
|
-
if (
|
|
860
|
+
d(this, ft, /* @__PURE__ */ h((e, s, o) => {
|
|
861
|
+
const r = e.cloneNode(!0), i = r.querySelector("thead"), a = r.querySelector("tbody"), c = r.querySelector("tfoot");
|
|
862
|
+
if (o === "header") {
|
|
837
863
|
if (a && a.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
838
864
|
const f = document.createElement("tbody");
|
|
839
|
-
f.className = "fixed-tbody",
|
|
865
|
+
f.className = "fixed-tbody", r.appendChild(f);
|
|
840
866
|
}
|
|
841
|
-
} else
|
|
842
|
-
return s === "left" ?
|
|
867
|
+
} else o === "body" ? (i && i.remove(), c && c.remove(), a && (a.className = "bindable-tbody")) : o === "footer" && (i && i.remove(), a && a.remove());
|
|
868
|
+
return s === "left" ? r.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
843
869
|
l.getAttribute("fixed") !== "left" && l.remove();
|
|
844
|
-
}) : s === "right" ?
|
|
870
|
+
}) : s === "right" ? r.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
845
871
|
l.getAttribute("fixed") !== "right" && l.remove();
|
|
846
|
-
}) :
|
|
872
|
+
}) : r.querySelectorAll("[fixed=left], [fixed=right]").forEach((l) => {
|
|
847
873
|
l.remove();
|
|
848
|
-
}),
|
|
874
|
+
}), r;
|
|
849
875
|
}, "#createSplitTable"));
|
|
850
|
-
A(this, "getRowHeight", /* @__PURE__ */ h(() => t(this,
|
|
876
|
+
A(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, rt).getRowHeight(), "getRowHeight"));
|
|
851
877
|
A(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
852
878
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
853
879
|
s && (s.scrollLeft = e);
|
|
@@ -857,7 +883,7 @@ const vt = class vt extends HTMLElement {
|
|
|
857
883
|
s && (s.scrollTop = e);
|
|
858
884
|
}, "scrollToY"));
|
|
859
885
|
d(this, Gt, /* @__PURE__ */ h(() => {
|
|
860
|
-
t(this, Jt).call(this), p(this,
|
|
886
|
+
t(this, Jt).call(this), p(this, Mt, new ye(this));
|
|
861
887
|
}, "#init"));
|
|
862
888
|
d(this, Jt, /* @__PURE__ */ h(() => {
|
|
863
889
|
const e = vt.SCROLLBAR_SIZE;
|
|
@@ -1060,22 +1086,22 @@ const vt = class vt extends HTMLElement {
|
|
|
1060
1086
|
</div>
|
|
1061
1087
|
`;
|
|
1062
1088
|
}, "#render"));
|
|
1063
|
-
p(this,
|
|
1089
|
+
p(this, rt, new be(this)), p(this, Ut, this.getRootNode().host);
|
|
1064
1090
|
}
|
|
1065
1091
|
connectedCallback() {
|
|
1066
1092
|
t(this, Gt).call(this);
|
|
1067
1093
|
}
|
|
1068
1094
|
get selection() {
|
|
1069
|
-
return t(this,
|
|
1095
|
+
return t(this, Mt);
|
|
1070
1096
|
}
|
|
1071
1097
|
disconnectedCallback() {
|
|
1072
1098
|
this.innerHTML = "", w.log("NineTableSheet destroyed.");
|
|
1073
1099
|
}
|
|
1074
1100
|
};
|
|
1075
|
-
|
|
1101
|
+
Ut = new WeakMap(), ot = new WeakMap(), rt = new WeakMap(), Mt = new WeakMap(), Kt = new WeakMap(), Zt = new WeakMap(), ft = new WeakMap(), Gt = new WeakMap(), Jt = new WeakMap(), h(vt, "NineTableSheet"), A(vt, "SCROLLBAR_SIZE", 16);
|
|
1076
1102
|
let Dt = vt;
|
|
1077
1103
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", Dt);
|
|
1078
|
-
var Qt,
|
|
1104
|
+
var Qt, Lt;
|
|
1079
1105
|
const Fe = class Fe extends HTMLElement {
|
|
1080
1106
|
constructor() {
|
|
1081
1107
|
super();
|
|
@@ -1083,70 +1109,70 @@ const Fe = class Fe extends HTMLElement {
|
|
|
1083
1109
|
var e;
|
|
1084
1110
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
1085
1111
|
var i;
|
|
1086
|
-
const
|
|
1087
|
-
t(this,
|
|
1088
|
-
}), t(this,
|
|
1112
|
+
const o = s.ctrlKey || s.metaKey || s.shiftKey, r = parseInt((i = s.target.closest(".nine-tab-item")) == null ? void 0 : i.dataset.index, 10);
|
|
1113
|
+
t(this, Lt).call(this, r, o);
|
|
1114
|
+
}), t(this, Lt).call(this, 0, !1);
|
|
1089
1115
|
}, "#init"));
|
|
1090
|
-
d(this,
|
|
1091
|
-
const
|
|
1116
|
+
d(this, Lt, /* @__PURE__ */ h((e, s = !1) => {
|
|
1117
|
+
const o = /* @__PURE__ */ h(() => {
|
|
1092
1118
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
1093
|
-
Array.from(this.querySelectorAll("nine-splitter")).forEach((
|
|
1094
|
-
const
|
|
1095
|
-
|
|
1096
|
-
const
|
|
1119
|
+
Array.from(this.querySelectorAll("nine-splitter")).forEach((u) => u.style.setProperty("display", "none"));
|
|
1120
|
+
const b = f.filter((u) => u.classList.contains("active"));
|
|
1121
|
+
b.length < 2 || b.forEach((u) => {
|
|
1122
|
+
const y = parseInt(u.getAttribute("data-index"), 10), v = this.querySelector(`nine-splitter[data-split-index="${y}"]`), S = f[y + 1];
|
|
1097
1123
|
v && S && S.classList.contains("active") && v.style.setProperty("display", "flex");
|
|
1098
1124
|
});
|
|
1099
|
-
}, "updateSplitters"),
|
|
1125
|
+
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), i = this.querySelector("nine-table-sheets-body"), a = r.querySelectorAll(".nine-tab-item"), c = i.querySelectorAll("nine-table-sheet");
|
|
1100
1126
|
if (!a[e]) return;
|
|
1101
1127
|
if (!s)
|
|
1102
1128
|
a.forEach((f, g) => {
|
|
1103
1129
|
f.classList.toggle("active", g === e);
|
|
1104
1130
|
}), c.forEach((f, g) => {
|
|
1105
|
-
const
|
|
1106
|
-
f.classList.toggle("active",
|
|
1131
|
+
const b = g === e;
|
|
1132
|
+
f.classList.toggle("active", b), f.style.flex = b ? "1 1 100%" : "";
|
|
1107
1133
|
});
|
|
1108
1134
|
else {
|
|
1109
|
-
const f = a[e], g =
|
|
1135
|
+
const f = a[e], g = r.querySelectorAll(".nine-tab-item.active");
|
|
1110
1136
|
if (f.classList.contains("active") && g.length <= 1)
|
|
1111
1137
|
return;
|
|
1112
1138
|
f.classList.toggle("active");
|
|
1113
|
-
const
|
|
1114
|
-
|
|
1139
|
+
const b = i.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
1140
|
+
b && (b.classList.toggle("active"), b.classList.contains("active") || (b.style.flex = ""));
|
|
1115
1141
|
}
|
|
1116
1142
|
const l = i.querySelectorAll("nine-table-sheet.active");
|
|
1117
1143
|
l == null || l.forEach((f) => {
|
|
1118
1144
|
f.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
1119
|
-
}),
|
|
1145
|
+
}), o();
|
|
1120
1146
|
}, "#switchSheet"));
|
|
1121
1147
|
}
|
|
1122
1148
|
connectedCallback() {
|
|
1123
1149
|
t(this, Qt).call(this);
|
|
1124
1150
|
}
|
|
1125
1151
|
};
|
|
1126
|
-
Qt = new WeakMap(),
|
|
1152
|
+
Qt = new WeakMap(), Lt = new WeakMap(), h(Fe, "NineTableSheets");
|
|
1127
1153
|
let me = Fe;
|
|
1128
1154
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", me);
|
|
1129
|
-
var H, te,
|
|
1130
|
-
const
|
|
1155
|
+
var H, te, $t, ee;
|
|
1156
|
+
const Ye = class Ye {
|
|
1131
1157
|
constructor(n) {
|
|
1132
1158
|
d(this, H);
|
|
1133
1159
|
d(this, te, /* @__PURE__ */ h(() => {
|
|
1134
1160
|
t(this, ee).call(this), new ResizeObserver((n) => {
|
|
1135
1161
|
for (let e of n)
|
|
1136
|
-
t(this, H).getAttribute("auto-height") === "true" && t(this,
|
|
1162
|
+
t(this, H).getAttribute("auto-height") === "true" && t(this, $t).call(this);
|
|
1137
1163
|
}).observe(t(this, H));
|
|
1138
1164
|
}, "#init"));
|
|
1139
|
-
d(this,
|
|
1165
|
+
d(this, $t, /* @__PURE__ */ h(() => {
|
|
1140
1166
|
var c, l;
|
|
1141
1167
|
const n = Array.from(t(this, H).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
1142
1168
|
if (n.length === 0) return;
|
|
1143
|
-
const e = parseInt(t(this, H).getAttribute("max-display-row"), 10) || 10, s = Math.max(...n.map((f) => f.getRowHeight())),
|
|
1169
|
+
const e = parseInt(t(this, H).getAttribute("max-display-row"), 10) || 10, s = Math.max(...n.map((f) => f.getRowHeight())), o = (c = t(this, H).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, r = (l = t(this, H).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, i = Dt.SCROLLBAR_SIZE, a = e * s + o + r + i;
|
|
1144
1170
|
t(this, H).style.height = `${a}px`;
|
|
1145
1171
|
}, "#applyAutoHeight"));
|
|
1146
1172
|
d(this, ee, /* @__PURE__ */ h(() => {
|
|
1147
|
-
const e = Array.from(t(this, H).children).filter((c) => c.tagName === "TABLE"), s = t(this, H).getAttribute("auto-height") === "true",
|
|
1148
|
-
const g = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`,
|
|
1149
|
-
return g +
|
|
1173
|
+
const e = Array.from(t(this, H).children).filter((c) => c.tagName === "TABLE"), s = t(this, H).getAttribute("auto-height") === "true", o = e.length, r = e.map((c, l) => {
|
|
1174
|
+
const g = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, b = l < o - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
1175
|
+
return g + b;
|
|
1150
1176
|
}).join(""), i = e.map((c, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
1151
1177
|
t(this, H).shadowRoot.innerHTML = `
|
|
1152
1178
|
<style>
|
|
@@ -1259,7 +1285,7 @@ const je = class je {
|
|
|
1259
1285
|
<nine-table-body>
|
|
1260
1286
|
<nine-table-summary></nine-table-summary>
|
|
1261
1287
|
<nine-table-sheets>
|
|
1262
|
-
<nine-table-sheets-body>${
|
|
1288
|
+
<nine-table-sheets-body>${r}</nine-table-sheets-body>
|
|
1263
1289
|
<nine-table-sheets-footer>
|
|
1264
1290
|
<div class="nine-tab-bar">${i}</div>
|
|
1265
1291
|
<div class="sheets-counter">Total : <span id="row-count">0</span></div>
|
|
@@ -1272,22 +1298,22 @@ const je = class je {
|
|
|
1272
1298
|
const a = t(this, H).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1273
1299
|
a == null || a.forEach((c, l) => {
|
|
1274
1300
|
e[l] && setTimeout(() => {
|
|
1275
|
-
c.generate(e[l]), s && t(this,
|
|
1301
|
+
c.generate(e[l]), s && t(this, $t).call(this);
|
|
1276
1302
|
});
|
|
1277
1303
|
});
|
|
1278
1304
|
}, "#render"));
|
|
1279
1305
|
p(this, H, n), t(this, te).call(this);
|
|
1280
1306
|
}
|
|
1281
1307
|
};
|
|
1282
|
-
H = new WeakMap(), te = new WeakMap(),
|
|
1283
|
-
let xe =
|
|
1284
|
-
var
|
|
1285
|
-
const
|
|
1308
|
+
H = new WeakMap(), te = new WeakMap(), $t = new WeakMap(), ee = new WeakMap(), h(Ye, "LayoutManager");
|
|
1309
|
+
let xe = Ye;
|
|
1310
|
+
var Ht, gt;
|
|
1311
|
+
const je = class je {
|
|
1286
1312
|
constructor(n) {
|
|
1287
|
-
d(this,
|
|
1313
|
+
d(this, Ht);
|
|
1288
1314
|
d(this, gt, -1);
|
|
1289
|
-
A(this, "count", /* @__PURE__ */ h(() => t(this,
|
|
1290
|
-
p(this,
|
|
1315
|
+
A(this, "count", /* @__PURE__ */ h(() => t(this, Ht).rawRecords.length, "count"));
|
|
1316
|
+
p(this, Ht, n);
|
|
1291
1317
|
}
|
|
1292
1318
|
get at() {
|
|
1293
1319
|
return t(this, gt);
|
|
@@ -1297,9 +1323,9 @@ const Ve = class Ve {
|
|
|
1297
1323
|
});
|
|
1298
1324
|
}
|
|
1299
1325
|
};
|
|
1300
|
-
|
|
1301
|
-
let ve =
|
|
1302
|
-
var z, k, D, ut, se,
|
|
1326
|
+
Ht = new WeakMap(), gt = new WeakMap(), h(je, "ngRow");
|
|
1327
|
+
let ve = je;
|
|
1328
|
+
var z, k, D, ut, se, X, ne, it, It, oe, re, bt;
|
|
1303
1329
|
const W = class W {
|
|
1304
1330
|
constructor(n, e) {
|
|
1305
1331
|
d(this, z);
|
|
@@ -1307,15 +1333,15 @@ const W = class W {
|
|
|
1307
1333
|
d(this, D, []);
|
|
1308
1334
|
d(this, ut, []);
|
|
1309
1335
|
d(this, se, 0);
|
|
1310
|
-
d(this,
|
|
1336
|
+
d(this, X, []);
|
|
1311
1337
|
d(this, ne, /* @__PURE__ */ h(() => {
|
|
1312
|
-
p(this,
|
|
1338
|
+
p(this, X, []);
|
|
1313
1339
|
const n = t(this, z).template || [];
|
|
1314
1340
|
Array.from(n).forEach((e) => {
|
|
1315
1341
|
var s;
|
|
1316
|
-
t(this,
|
|
1342
|
+
t(this, X).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1317
1343
|
}), (t(this, k).rawRecords || []).forEach((e) => {
|
|
1318
|
-
e.__ng || (e.__ng = t(this,
|
|
1344
|
+
e.__ng || (e.__ng = t(this, It).call(this)), e.__ng.height = t(this, X).slice();
|
|
1319
1345
|
});
|
|
1320
1346
|
}, "#initialize"));
|
|
1321
1347
|
d(this, it, /* @__PURE__ */ h(() => {
|
|
@@ -1325,14 +1351,14 @@ const W = class W {
|
|
|
1325
1351
|
});
|
|
1326
1352
|
}, "#invalidate"));
|
|
1327
1353
|
A(this, "get", /* @__PURE__ */ h((n, e) => {
|
|
1328
|
-
var
|
|
1354
|
+
var r;
|
|
1329
1355
|
const s = this.getValidData();
|
|
1330
1356
|
if (!s || s.length <= 0) return;
|
|
1331
1357
|
if (n == null) return t(this, bt).call(this, s);
|
|
1332
1358
|
if (n < 0 || n >= s.length) return null;
|
|
1333
|
-
const
|
|
1359
|
+
const o = typeof ((r = t(this, z).fields) == null ? void 0 : r.get) == "function" ? t(this, z).fields.get() : [];
|
|
1334
1360
|
if (e != null) {
|
|
1335
|
-
const i =
|
|
1361
|
+
const i = o.indexOf(e);
|
|
1336
1362
|
return i >= 0 ? s[n].v[i] : null;
|
|
1337
1363
|
}
|
|
1338
1364
|
return t(this, bt).call(this, s[n]);
|
|
@@ -1340,14 +1366,14 @@ const W = class W {
|
|
|
1340
1366
|
A(this, "set", /* @__PURE__ */ h((n) => {
|
|
1341
1367
|
this.clear(), this.add(n, !1), t(this, it).call(this);
|
|
1342
1368
|
}, "set"));
|
|
1343
|
-
d(this,
|
|
1369
|
+
d(this, It, /* @__PURE__ */ h(() => ({
|
|
1344
1370
|
rowState: W.ROW_STATE.EMPTY,
|
|
1345
1371
|
deleted: !1,
|
|
1346
1372
|
filtered: !1,
|
|
1347
|
-
height: t(this,
|
|
1373
|
+
height: t(this, X).slice(),
|
|
1348
1374
|
o: {},
|
|
1349
1375
|
c: {},
|
|
1350
|
-
_: [0, 0, 0, 0, W.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this,
|
|
1376
|
+
_: [0, 0, 0, 0, W.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, X).slice(), -1, {}, {}]
|
|
1351
1377
|
}), "#getDefaultMeta"));
|
|
1352
1378
|
A(this, "reset", /* @__PURE__ */ h(() => {
|
|
1353
1379
|
p(this, D, []), p(this, ut, []), t(this, it).call(this);
|
|
@@ -1356,37 +1382,37 @@ const W = class W {
|
|
|
1356
1382
|
var n;
|
|
1357
1383
|
t(this, k).rawRecords = [], p(this, D, []), p(this, ut, []), (n = t(this, k).viewRecords) != null && n.reset && t(this, k).viewRecords.reset();
|
|
1358
1384
|
}, "clear"));
|
|
1359
|
-
d(this,
|
|
1360
|
-
var
|
|
1385
|
+
d(this, oe, /* @__PURE__ */ h((n) => {
|
|
1386
|
+
var o;
|
|
1361
1387
|
Array.isArray(n) || (n = [n]);
|
|
1362
|
-
const e = typeof ((
|
|
1363
|
-
return n.forEach((
|
|
1388
|
+
const e = typeof ((o = t(this, z).fields) == null ? void 0 : o.get) == "function" ? t(this, z).fields.get() : Object.keys(n[0] || {}), s = [];
|
|
1389
|
+
return n.forEach((r) => {
|
|
1364
1390
|
const i = { v: [] };
|
|
1365
1391
|
e.forEach((a) => {
|
|
1366
|
-
i.v.push(
|
|
1392
|
+
i.v.push(r[a] !== void 0 && r[a] !== null ? r[a] : "");
|
|
1367
1393
|
}), s.push(i);
|
|
1368
1394
|
}), s;
|
|
1369
1395
|
}, "#json2Array"));
|
|
1370
|
-
d(this,
|
|
1371
|
-
e.__ng = t(this,
|
|
1396
|
+
d(this, re, /* @__PURE__ */ h((n) => (Array.isArray(n) || (n = [n]), n.forEach((e) => {
|
|
1397
|
+
e.__ng = t(this, It).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = W.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1372
1398
|
}), n), "#defaultInsert"));
|
|
1373
1399
|
A(this, "add", /* @__PURE__ */ h((n, e = !0) => {
|
|
1374
1400
|
n === void 0 && (n = {});
|
|
1375
|
-
const s = t(this,
|
|
1376
|
-
t(this, k).rawRecords = t(this, k).rawRecords.concat(t(this,
|
|
1377
|
-
const
|
|
1378
|
-
return e || s.forEach((
|
|
1379
|
-
const a = t(this, k).rawRecords[
|
|
1401
|
+
const s = t(this, oe).call(this, n);
|
|
1402
|
+
t(this, k).rawRecords = t(this, k).rawRecords.concat(t(this, re).call(this, s)), this.resetRecords();
|
|
1403
|
+
const o = this.count() - 1;
|
|
1404
|
+
return e || s.forEach((r, i) => {
|
|
1405
|
+
const a = t(this, k).rawRecords[o - i];
|
|
1380
1406
|
a && (a.__ng.rowState = W.ROW_STATE.EMPTY);
|
|
1381
|
-
}), t(this, it).call(this),
|
|
1407
|
+
}), t(this, it).call(this), o;
|
|
1382
1408
|
}, "add"));
|
|
1383
1409
|
A(this, "delete", /* @__PURE__ */ h((n) => {
|
|
1384
1410
|
let e = [];
|
|
1385
|
-
Array.isArray(n) ? e = n : typeof n > "u" ? e = [t(this, k).host.row.at] : e = [parseInt(n, 10)], e.sort((s,
|
|
1411
|
+
Array.isArray(n) ? e = n : typeof n > "u" ? e = [t(this, k).host.row.at] : e = [parseInt(n, 10)], e.sort((s, o) => o - s).forEach((s) => {
|
|
1386
1412
|
if (t(this, D)[s]) {
|
|
1387
|
-
const
|
|
1388
|
-
t(this, D)[s].__ng.rowState === W.ROW_STATE.INSERT ? t(this, k).rawRecords = t(this, k).rawRecords.filter((
|
|
1389
|
-
|
|
1413
|
+
const o = t(this, D)[s].__ng.rowid;
|
|
1414
|
+
t(this, D)[s].__ng.rowState === W.ROW_STATE.INSERT ? t(this, k).rawRecords = t(this, k).rawRecords.filter((r) => r.__ng.rowid !== o) : t(this, k).rawRecords.forEach((r) => {
|
|
1415
|
+
r.__ng.rowid === o && (r.__ng.deleted = !0, r.__ng.rowState = W.ROW_STATE.DELETE);
|
|
1390
1416
|
});
|
|
1391
1417
|
}
|
|
1392
1418
|
}), this.resetRecords(), t(this, it).call(this);
|
|
@@ -1394,12 +1420,12 @@ const W = class W {
|
|
|
1394
1420
|
A(this, "setValue", /* @__PURE__ */ h((n, e, s) => {
|
|
1395
1421
|
var c;
|
|
1396
1422
|
n = parseInt(n, 10);
|
|
1397
|
-
const
|
|
1398
|
-
if (
|
|
1423
|
+
const r = (typeof ((c = t(this, z).fields) == null ? void 0 : c.get) == "function" ? t(this, z).fields.get() : []).indexOf(e);
|
|
1424
|
+
if (r < 0) return;
|
|
1399
1425
|
const i = this.getValidData()[n];
|
|
1400
1426
|
if (!i) return;
|
|
1401
|
-
const a = i.v[
|
|
1402
|
-
a !== s && i.__ng.rowState !== W.ROW_STATE.INSERT && (i.__ng.o.hasOwnProperty(e) || (i.__ng.o[e] = a), i.__ng.rowState = W.ROW_STATE.UPDATE), i.v[
|
|
1427
|
+
const a = i.v[r];
|
|
1428
|
+
a !== s && i.__ng.rowState !== W.ROW_STATE.INSERT && (i.__ng.o.hasOwnProperty(e) || (i.__ng.o[e] = a), i.__ng.rowState = W.ROW_STATE.UPDATE), i.v[r] = s;
|
|
1403
1429
|
}, "setValue"));
|
|
1404
1430
|
A(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1405
1431
|
p(this, ut, t(this, k).rawRecords.filter((n) => !n.__ng.deleted)), p(this, D, t(this, k).rawRecords.filter((n) => !n.__ng.deleted && !n.__ng.filtered)), t(this, k).rawRecords.forEach((n, e) => {
|
|
@@ -1412,13 +1438,13 @@ const W = class W {
|
|
|
1412
1438
|
d(this, bt, /* @__PURE__ */ h((n) => {
|
|
1413
1439
|
var i;
|
|
1414
1440
|
if (!n) return n;
|
|
1415
|
-
const e = !Array.isArray(n), s = e ? [n] : n,
|
|
1441
|
+
const e = !Array.isArray(n), s = e ? [n] : n, o = typeof ((i = t(this, z).fields) == null ? void 0 : i.get) == "function" ? t(this, z).fields.get() : [], r = s.filter((a) => !a.__ng.deleted).map((a) => {
|
|
1416
1442
|
const c = {};
|
|
1417
|
-
return
|
|
1443
|
+
return o.forEach((l, f) => {
|
|
1418
1444
|
c[l] = a.v ? a.v[f] : a[l];
|
|
1419
1445
|
}), c.__ng = a.__ng, c;
|
|
1420
1446
|
});
|
|
1421
|
-
return e ?
|
|
1447
|
+
return e ? r[0] : r;
|
|
1422
1448
|
}, "#conv"));
|
|
1423
1449
|
A(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1424
1450
|
p(this, z, n), p(this, k, e), t(this, ne).call(this);
|
|
@@ -1430,7 +1456,7 @@ const W = class W {
|
|
|
1430
1456
|
this.clear(), this.add(n, !1);
|
|
1431
1457
|
}
|
|
1432
1458
|
get nextId() {
|
|
1433
|
-
return ++
|
|
1459
|
+
return ++os(this, se)._;
|
|
1434
1460
|
}
|
|
1435
1461
|
get count() {
|
|
1436
1462
|
return t(this, D).length;
|
|
@@ -1442,7 +1468,7 @@ const W = class W {
|
|
|
1442
1468
|
return this.length;
|
|
1443
1469
|
}
|
|
1444
1470
|
};
|
|
1445
|
-
z = new WeakMap(), k = new WeakMap(), D = new WeakMap(), ut = new WeakMap(), se = new WeakMap(),
|
|
1471
|
+
z = new WeakMap(), k = new WeakMap(), D = new WeakMap(), ut = new WeakMap(), se = new WeakMap(), X = new WeakMap(), ne = new WeakMap(), it = new WeakMap(), It = new WeakMap(), oe = new WeakMap(), re = new WeakMap(), bt = new WeakMap(), h(W, "ngData"), // 🎯 행 상태 정의 상수를 클래스 내부로 내재화
|
|
1446
1472
|
A(W, "ROW_STATE", {
|
|
1447
1473
|
EMPTY: "EMPTY",
|
|
1448
1474
|
NORMAL: "NORMAL",
|
|
@@ -1452,7 +1478,7 @@ A(W, "ROW_STATE", {
|
|
|
1452
1478
|
});
|
|
1453
1479
|
let we = W;
|
|
1454
1480
|
var at;
|
|
1455
|
-
const
|
|
1481
|
+
const Ve = class Ve {
|
|
1456
1482
|
constructor(n) {
|
|
1457
1483
|
d(this, at);
|
|
1458
1484
|
p(this, at, n), this.row = new ve(this), this.data = new we(t(this, at), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
@@ -1461,47 +1487,47 @@ const Ye = class Ye {
|
|
|
1461
1487
|
}, this.setDataSource = (e) => {
|
|
1462
1488
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1463
1489
|
}, this.getRowState = (e) => {
|
|
1464
|
-
var
|
|
1490
|
+
var o, r;
|
|
1465
1491
|
const s = parseInt(e, 10);
|
|
1466
1492
|
if (!(s >= this.data.count()))
|
|
1467
|
-
return (
|
|
1493
|
+
return (r = (o = this.data.getValidData()[s]) == null ? void 0 : o.__ng) == null ? void 0 : r.rowState;
|
|
1468
1494
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1469
1495
|
this.row.at = e;
|
|
1470
|
-
}, 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,
|
|
1471
|
-
e = parseInt(e, 10), this.data.setValue(e, s,
|
|
1496
|
+
}, 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, o) => {
|
|
1497
|
+
e = parseInt(e, 10), this.data.setValue(e, s, o);
|
|
1472
1498
|
}, this.setDataSource([]);
|
|
1473
1499
|
}
|
|
1474
1500
|
};
|
|
1475
|
-
at = new WeakMap(), h(
|
|
1476
|
-
let Se =
|
|
1477
|
-
var pt,
|
|
1478
|
-
const
|
|
1501
|
+
at = new WeakMap(), h(Ve, "ngDataManager");
|
|
1502
|
+
let Se = Ve;
|
|
1503
|
+
var pt, L, _t, ie;
|
|
1504
|
+
const Xe = class Xe {
|
|
1479
1505
|
// 🎯 이제 { name: string, type: string } 객체들의 배열로 관리합니다.
|
|
1480
1506
|
constructor(n) {
|
|
1481
1507
|
d(this, pt);
|
|
1482
|
-
d(this,
|
|
1508
|
+
d(this, L, []);
|
|
1483
1509
|
A(this, "add", /* @__PURE__ */ h((n, e = "string") => {
|
|
1484
1510
|
n.forEach((s) => {
|
|
1485
|
-
t(this,
|
|
1511
|
+
t(this, L).some((o) => o.name === s) || t(this, L).push({ name: s, type: e });
|
|
1486
1512
|
}), t(this, _t).call(this);
|
|
1487
1513
|
}, "add"));
|
|
1488
1514
|
d(this, _t, /* @__PURE__ */ h(() => {
|
|
1489
1515
|
const n = /* @__PURE__ */ new Map();
|
|
1490
|
-
t(this,
|
|
1516
|
+
t(this, L).forEach((e) => {
|
|
1491
1517
|
n.set(e.name, e.type);
|
|
1492
|
-
}), p(this,
|
|
1518
|
+
}), p(this, L, Array.from(n, ([e, s]) => ({ name: e, type: s }))), p(this, L, t(this, L).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, L).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
1493
1519
|
}, "#adjust"));
|
|
1494
1520
|
d(this, ie, /* @__PURE__ */ h(() => {
|
|
1495
|
-
p(this,
|
|
1521
|
+
p(this, L, []), w.log(t(this, pt).querySelectorAll("table"));
|
|
1496
1522
|
const n = Array.from(t(this, pt).querySelectorAll("table"));
|
|
1497
1523
|
if (!(!n || n.length === 0)) {
|
|
1498
1524
|
for (const e of n)
|
|
1499
|
-
w.log(e), $("[data-bind]", e).each((s,
|
|
1500
|
-
const
|
|
1501
|
-
|
|
1525
|
+
w.log(e), $("[data-bind]", e).each((s, o) => {
|
|
1526
|
+
const r = o.dataset.bind, i = o.getAttribute("data-type") || "string";
|
|
1527
|
+
r && t(this, L).push({ name: r, type: i });
|
|
1502
1528
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
1503
|
-
$(`[${s}]`, e).each((
|
|
1504
|
-
var i =
|
|
1529
|
+
$(`[${s}]`, e).each((o, r) => {
|
|
1530
|
+
var i = r.getAttribute(s);
|
|
1505
1531
|
if (i.indexOf("data.") < 0) {
|
|
1506
1532
|
const a = i.search(/[(]/g);
|
|
1507
1533
|
if (a > 0)
|
|
@@ -1515,7 +1541,7 @@ const Ue = class Ue {
|
|
|
1515
1541
|
if (a.trim() != "") {
|
|
1516
1542
|
const c = a.search(/[^_A-Za-z0-9]/g);
|
|
1517
1543
|
let l = "";
|
|
1518
|
-
c >= 0 ? l = a.substring(0, c) : i.startsWith("data.") && (l = a.replace("data.", "")), l && t(this,
|
|
1544
|
+
c >= 0 ? l = a.substring(0, c) : i.startsWith("data.") && (l = a.replace("data.", "")), l && t(this, L).push({ name: l, type: "string" });
|
|
1519
1545
|
}
|
|
1520
1546
|
});
|
|
1521
1547
|
});
|
|
@@ -1527,28 +1553,28 @@ const Ue = class Ue {
|
|
|
1527
1553
|
}
|
|
1528
1554
|
// 🎯 기존에 필드 이름만 쓰던 곳들과의 호환을 위해 이름 배열만 리턴하는 메서드 유지
|
|
1529
1555
|
get() {
|
|
1530
|
-
return t(this,
|
|
1556
|
+
return t(this, L).map((n) => n.name);
|
|
1531
1557
|
}
|
|
1532
1558
|
// 🎯 내부 객체 통째로 얻기
|
|
1533
1559
|
getFields() {
|
|
1534
|
-
return t(this,
|
|
1560
|
+
return t(this, L);
|
|
1535
1561
|
}
|
|
1536
1562
|
// 🎯 특정 필드의 데이터 타입 조회
|
|
1537
1563
|
getType(n) {
|
|
1538
|
-
const e = t(this,
|
|
1564
|
+
const e = t(this, L).find((s) => s.name === n);
|
|
1539
1565
|
return e ? e.type : "string";
|
|
1540
1566
|
}
|
|
1541
1567
|
indexOf(n) {
|
|
1542
|
-
return t(this,
|
|
1568
|
+
return t(this, L).findIndex((e) => e.name === n);
|
|
1543
1569
|
}
|
|
1544
1570
|
includes(n) {
|
|
1545
|
-
return t(this,
|
|
1571
|
+
return t(this, L).some((e) => e.name === n);
|
|
1546
1572
|
}
|
|
1547
1573
|
};
|
|
1548
|
-
pt = new WeakMap(),
|
|
1549
|
-
let Ee =
|
|
1574
|
+
pt = new WeakMap(), L = new WeakMap(), _t = new WeakMap(), ie = new WeakMap(), h(Xe, "ngFields");
|
|
1575
|
+
let Ee = Xe;
|
|
1550
1576
|
var lt, ae, le;
|
|
1551
|
-
const
|
|
1577
|
+
const Ue = class Ue extends HTMLElement {
|
|
1552
1578
|
constructor() {
|
|
1553
1579
|
super();
|
|
1554
1580
|
//#created = false;
|
|
@@ -1578,8 +1604,8 @@ const Xe = class Xe extends HTMLElement {
|
|
|
1578
1604
|
return t(this, lt);
|
|
1579
1605
|
}
|
|
1580
1606
|
};
|
|
1581
|
-
lt = new WeakMap(), ae = new WeakMap(), le = new WeakMap(), h(
|
|
1582
|
-
let Re =
|
|
1607
|
+
lt = new WeakMap(), ae = new WeakMap(), le = new WeakMap(), h(Ue, "NineTable");
|
|
1608
|
+
let Re = Ue;
|
|
1583
1609
|
customElements.get("nine-table") || customElements.define("nine-table", Re);
|
|
1584
1610
|
const wt = class wt extends HTMLElement {
|
|
1585
1611
|
// 👈 커스텀 스타일용 캐시 추가
|
|
@@ -1594,72 +1620,72 @@ const wt = class wt extends HTMLElement {
|
|
|
1594
1620
|
};
|
|
1595
1621
|
h(wt, "BasicCellElement"), A(wt, "_styleCache", /* @__PURE__ */ new Map()), A(wt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1596
1622
|
let Ae = wt;
|
|
1597
|
-
var
|
|
1623
|
+
var M, Nt, x, $e, He, Ie, _e, Ne;
|
|
1598
1624
|
const Ke = class Ke extends Ae {
|
|
1599
1625
|
constructor() {
|
|
1600
1626
|
super();
|
|
1601
|
-
d(this,
|
|
1627
|
+
d(this, M);
|
|
1602
1628
|
d(this, Nt);
|
|
1603
|
-
d(this,
|
|
1629
|
+
d(this, x);
|
|
1630
|
+
d(this, $e);
|
|
1604
1631
|
d(this, He);
|
|
1605
1632
|
d(this, Ie);
|
|
1606
|
-
d(this, $e);
|
|
1607
1633
|
d(this, _e);
|
|
1608
1634
|
A(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1609
|
-
if (t(this,
|
|
1610
|
-
if (t(this,
|
|
1611
|
-
const s = t(this,
|
|
1635
|
+
if (t(this, x))
|
|
1636
|
+
if (t(this, x).closest("tbody")) {
|
|
1637
|
+
const s = t(this, x).closest("tr").data, o = parseInt(t(this, x).dataset.row);
|
|
1612
1638
|
if (!s) return "";
|
|
1613
|
-
if (ninegrid.isNull(t(this,
|
|
1614
|
-
if (!ninegrid.isNull(t(this,
|
|
1615
|
-
return s[t(this,
|
|
1639
|
+
if (ninegrid.isNull(t(this, x).dataset.expr)) {
|
|
1640
|
+
if (!ninegrid.isNull(t(this, x).dataset.bind))
|
|
1641
|
+
return s[t(this, x).dataset.bind] || ninegrid.nvl(e, "");
|
|
1616
1642
|
} else try {
|
|
1617
|
-
return this.getExprValue(t(this,
|
|
1643
|
+
return this.getExprValue(t(this, x).dataset.expr, s, o, t(this, x));
|
|
1618
1644
|
} catch {
|
|
1619
|
-
console.error(t(this,
|
|
1645
|
+
console.error(t(this, x).dataset.expr, s, t(this, x).dataset.row);
|
|
1620
1646
|
}
|
|
1621
1647
|
return ninegrid.nvl(e, "");
|
|
1622
1648
|
} else
|
|
1623
1649
|
try {
|
|
1624
|
-
return t(this,
|
|
1650
|
+
return t(this, M).exprFunction(t(this, x).dataset.expr).call(this, null, -1, t(this, M).data);
|
|
1625
1651
|
} catch {
|
|
1626
1652
|
}
|
|
1627
1653
|
}, "getDisplayText"));
|
|
1628
1654
|
d(this, Ne, /* @__PURE__ */ h(() => {
|
|
1629
|
-
if (!(!t(this,
|
|
1630
|
-
var e = ninegrid.j.querySelectorAll(t(this,
|
|
1655
|
+
if (!(!t(this, M) || !t(this, M).template || !t(this, x).closest("tbody.bindable"))) {
|
|
1656
|
+
var e = ninegrid.j.querySelectorAll(t(this, x)).attr("suppress");
|
|
1631
1657
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1632
|
-
var s = t(this,
|
|
1633
|
-
$("th,td", s).each((
|
|
1658
|
+
var s = t(this, x).closest("tr"), o = [];
|
|
1659
|
+
$("th,td", s).each((m, I) => {
|
|
1634
1660
|
var C = ninegrid.j.querySelectorAll(I).attr("suppress");
|
|
1635
|
-
C && I.dataset.row && (C = parseInt(C), !isNaN(C) && C <= e &&
|
|
1636
|
-
}),
|
|
1637
|
-
var
|
|
1638
|
-
if (parseInt(s.sectionRowIndex / t(this,
|
|
1639
|
-
for (var i of
|
|
1661
|
+
C && I.dataset.row && (C = parseInt(C), !isNaN(C) && C <= e && o.push(C));
|
|
1662
|
+
}), o.sort();
|
|
1663
|
+
var r = !1;
|
|
1664
|
+
if (parseInt(s.sectionRowIndex / t(this, M).template.length) > 0)
|
|
1665
|
+
for (var i of o) {
|
|
1640
1666
|
if (i > e) break;
|
|
1641
|
-
var a = parseInt(t(this,
|
|
1642
|
-
t(this,
|
|
1643
|
-
var g = t(this,
|
|
1644
|
-
if (
|
|
1645
|
-
|
|
1667
|
+
var a = parseInt(t(this, x).dataset.row), c = a - 1, l = t(this, x).closest("tr").data, f = t(this, M).data.get(c);
|
|
1668
|
+
t(this, x).dataset.matrixRow;
|
|
1669
|
+
var g = t(this, M).body.querySelector(`tbody.bindable [suppress="${i}"][data-matrix-row="${t(this, x).dataset.matrixRow}"]`), b = g.dataset.expr ? this.getExprValue(g.dataset.expr, l, a) : l[g.dataset.bind], u = g.dataset.expr ? this.getExprValue(g.dataset.expr, f, c) : f[g.dataset.bind];
|
|
1670
|
+
if (b != u) {
|
|
1671
|
+
r = !0;
|
|
1646
1672
|
break;
|
|
1647
1673
|
}
|
|
1648
1674
|
}
|
|
1649
1675
|
else
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
var
|
|
1653
|
-
$(S).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this,
|
|
1676
|
+
r = !0;
|
|
1677
|
+
r ? ninegrid.j.querySelectorAll(t(this, x)).removeClass("suppress") : ninegrid.j.querySelectorAll(t(this, x)).addClass("suppress"), ninegrid.j.querySelectorAll(t(this, x)).hasClass("hidden") || (r ? ninegrid.j.querySelectorAll(t(this, x)).removeClass("hidden") : ninegrid.j.querySelectorAll(t(this, x)).addClass("hidden"));
|
|
1678
|
+
var y = parseInt(t(this, x).dataset.matrixRow), v = y - 1, S = t(this, M).body.querySelector(`tbody.bindable [data-col="${t(this, x).dataset.col}"][data-matrix-row="${v}"]`);
|
|
1679
|
+
$(S).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this, x)).hasClass("suppress") ? ninegrid.j.querySelectorAll(S).removeClass("last-none-suppress").addClass("last-suppress") : !$(S).hasClass("suppress") && ninegrid.j.querySelectorAll(t(this, x)).hasClass("suppress") ? ninegrid.j.querySelectorAll(S).removeClass("last-suppress").addClass("last-none-suppress") : ninegrid.j.querySelectorAll(S).removeClass("last-none-suppress").removeClass("last-suppress");
|
|
1654
1680
|
}
|
|
1655
1681
|
}
|
|
1656
1682
|
}, "#resetSuppress"));
|
|
1657
|
-
A(this, "getExprValue", /* @__PURE__ */ h((e, s,
|
|
1683
|
+
A(this, "getExprValue", /* @__PURE__ */ h((e, s, o, r) => {
|
|
1658
1684
|
if (typeof e < "u")
|
|
1659
1685
|
try {
|
|
1660
|
-
|
|
1686
|
+
o = parseInt(o);
|
|
1661
1687
|
const i = e.replace("()", "");
|
|
1662
|
-
return t(this,
|
|
1688
|
+
return t(this, M)[i] ? t(this, M)[i].call(this, s, o, t(this, x)) : t(this, M).exprFunction(e).call(this, s, o, t(this, M).data);
|
|
1663
1689
|
} catch {
|
|
1664
1690
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1665
1691
|
}
|
|
@@ -1668,29 +1694,29 @@ const Ke = class Ke extends Ae {
|
|
|
1668
1694
|
}, "getExprValue"));
|
|
1669
1695
|
}
|
|
1670
1696
|
connectedCallback() {
|
|
1671
|
-
super.connectedCallback(), p(this,
|
|
1697
|
+
super.connectedCallback(), p(this, M, this.getRootNode().host), p(this, x, this.closest("th,td")), p(this, Nt, t(this, x).closest("tr"));
|
|
1672
1698
|
}
|
|
1673
1699
|
get value() {
|
|
1674
|
-
var e = !t(this,
|
|
1700
|
+
var e = !t(this, M) || !t(this, M).dataManager || !t(this, x) || !t(this, x).dataset || !t(this, x).dataset.row || !t(this, x).dataset.bind ? "" : t(this, x).closest("tr").data[t(this, x).dataset.bind];
|
|
1675
1701
|
return e ?? "";
|
|
1676
1702
|
}
|
|
1677
1703
|
set value(e) {
|
|
1678
|
-
var s = parseInt(t(this,
|
|
1679
|
-
const
|
|
1680
|
-
s < 0 ? t(this,
|
|
1704
|
+
var s = parseInt(t(this, x).dataset.row);
|
|
1705
|
+
const o = this.getAttribute("update-row-state") != "false";
|
|
1706
|
+
s < 0 ? t(this, M).data.setValueNF(parseInt(t(this, x).dataset.index), t(this, x).dataset.bind, e, o) : t(this, M).data.setValue(s, t(this, x).dataset.bind, e, o);
|
|
1681
1707
|
}
|
|
1682
1708
|
get row() {
|
|
1683
|
-
return parseInt(t(this,
|
|
1709
|
+
return parseInt(t(this, x).dataset.row);
|
|
1684
1710
|
}
|
|
1685
1711
|
get data() {
|
|
1686
|
-
return t(this,
|
|
1712
|
+
return t(this, x).closest("tr").data;
|
|
1687
1713
|
}
|
|
1688
1714
|
refresh() {
|
|
1689
|
-
const e = t(this,
|
|
1690
|
-
return parseInt(t(this,
|
|
1715
|
+
const e = t(this, x).dataset.bind;
|
|
1716
|
+
return parseInt(t(this, x).dataset.row), t(this, Nt).data[e];
|
|
1691
1717
|
}
|
|
1692
1718
|
};
|
|
1693
|
-
|
|
1719
|
+
M = new WeakMap(), Nt = new WeakMap(), x = new WeakMap(), $e = new WeakMap(), He = new WeakMap(), Ie = new WeakMap(), _e = new WeakMap(), Ne = new WeakMap(), h(Ke, "CellElement");
|
|
1694
1720
|
let qe = Ke;
|
|
1695
1721
|
const Ze = class Ze extends qe {
|
|
1696
1722
|
constructor() {
|
|
@@ -1705,7 +1731,7 @@ const Ze = class Ze extends qe {
|
|
|
1705
1731
|
};
|
|
1706
1732
|
h(Ze, "EditableCellElement");
|
|
1707
1733
|
let Ce = Ze;
|
|
1708
|
-
var zt, ct, yt, mt, ce,
|
|
1734
|
+
var zt, ct, yt, mt, ce, U, ze;
|
|
1709
1735
|
const Ge = class Ge extends Ce {
|
|
1710
1736
|
constructor() {
|
|
1711
1737
|
super();
|
|
@@ -1714,7 +1740,7 @@ const Ge = class Ge extends Ce {
|
|
|
1714
1740
|
d(this, yt);
|
|
1715
1741
|
d(this, mt);
|
|
1716
1742
|
d(this, ce);
|
|
1717
|
-
d(this,
|
|
1743
|
+
d(this, U);
|
|
1718
1744
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
1719
1745
|
const e = super.refresh();
|
|
1720
1746
|
t(this, zt).value = e;
|
|
@@ -1752,19 +1778,19 @@ const Ge = class Ge extends Ce {
|
|
|
1752
1778
|
d(this, ze, /* @__PURE__ */ h((e) => {
|
|
1753
1779
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1754
1780
|
if (t(this, ct) == "number") {
|
|
1755
|
-
let
|
|
1756
|
-
if (t(this,
|
|
1757
|
-
var s = e.target.value,
|
|
1758
|
-
if (
|
|
1759
|
-
var s = s.substr(
|
|
1760
|
-
s.length >= Number(t(this,
|
|
1781
|
+
let r = [];
|
|
1782
|
+
if (t(this, U) && Number(t(this, U)) > 0 && r.push("."), t(this, mt) && Number(t(this, mt)) >= 0 && r.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !r.includes(e.key) && e.preventDefault(), t(this, U) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
|
|
1783
|
+
var s = e.target.value, o = s.indexOf(".");
|
|
1784
|
+
if (o >= 0) {
|
|
1785
|
+
var s = s.substr(o + 1, s.length);
|
|
1786
|
+
s.length >= Number(t(this, U)) && e.preventDefault();
|
|
1761
1787
|
}
|
|
1762
1788
|
}
|
|
1763
1789
|
}
|
|
1764
1790
|
t(this, yt) && ninegrid.getByteLength(e.target.value) >= Number(t(this, yt)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1765
1791
|
}
|
|
1766
1792
|
}, "#onKeyDown"));
|
|
1767
|
-
if (this.applyBaseStyle(), p(this, ct, this.getAttribute("type") || "text"), p(this, yt, this.getAttribute("maxbyte")), p(this, mt, this.getAttribute("min")), p(this, ce, this.getAttribute("max")), p(this,
|
|
1793
|
+
if (this.applyBaseStyle(), p(this, ct, this.getAttribute("type") || "text"), p(this, yt, this.getAttribute("maxbyte")), p(this, mt, this.getAttribute("min")), p(this, ce, this.getAttribute("max")), p(this, U, this.getAttribute("scale")), !["text", "number"].includes(t(this, ct))) throw `invalid type : ${t(this, ct)}`;
|
|
1768
1794
|
}
|
|
1769
1795
|
connectedCallback() {
|
|
1770
1796
|
for (var e = [], s = 0; s < this.attributes.length; s++)
|
|
@@ -1777,7 +1803,7 @@ const Ge = class Ge extends Ce {
|
|
|
1777
1803
|
`, super.connectedCallback(), p(this, zt, this.querySelector("input"));
|
|
1778
1804
|
}
|
|
1779
1805
|
};
|
|
1780
|
-
zt = new WeakMap(), ct = new WeakMap(), yt = new WeakMap(), mt = new WeakMap(), ce = new WeakMap(),
|
|
1806
|
+
zt = new WeakMap(), ct = new WeakMap(), yt = new WeakMap(), mt = new WeakMap(), ce = new WeakMap(), U = new WeakMap(), ze = new WeakMap(), h(Ge, "CellInputText");
|
|
1781
1807
|
let Te = Ge;
|
|
1782
1808
|
customElements.get("cell-input-text");
|
|
1783
1809
|
customElements.get("cell-input") || customElements.define("cell-input", Te);
|