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