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