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