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