@ninebone/table 0.0.693 → 0.0.695
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 +724 -636
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +17 -7
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -1,118 +1,118 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
throw TypeError(
|
|
1
|
+
var es = Object.defineProperty;
|
|
2
|
+
var ss = (R) => {
|
|
3
|
+
throw TypeError(R);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var h = (
|
|
7
|
-
var E = (
|
|
8
|
-
var t = (
|
|
9
|
-
var
|
|
10
|
-
set _(
|
|
11
|
-
|
|
5
|
+
var is = (R, n, e) => n in R ? es(R, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : R[n] = e;
|
|
6
|
+
var h = (R, n) => es(R, "name", { value: n, configurable: !0 });
|
|
7
|
+
var E = (R, n, e) => is(R, typeof n != "symbol" ? n + "" : n, e), he = (R, n, e) => n.has(R) || ss("Cannot " + e);
|
|
8
|
+
var t = (R, n, e) => (he(R, n, "read from private field"), e ? e.call(R) : n.get(R)), d = (R, n, e) => n.has(R) ? ss("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(R) : n.set(R, e), p = (R, n, e, s) => (he(R, n, "write to private field"), s ? s.call(R, e) : n.set(R, e), e), de = (R, n, e) => (he(R, n, "access private method"), e);
|
|
9
|
+
var ns = (R, n, e, s) => ({
|
|
10
|
+
set _(r) {
|
|
11
|
+
p(R, n, r, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
|
-
return t(
|
|
14
|
+
return t(R, n, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
import { trace as
|
|
18
|
-
const
|
|
17
|
+
import { trace as as } from "@ninebone/util";
|
|
18
|
+
const Oe = class Oe extends as.constructor {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
h(
|
|
24
|
-
let
|
|
25
|
-
const
|
|
26
|
-
var z,
|
|
27
|
-
const
|
|
23
|
+
h(Oe, "Trace");
|
|
24
|
+
let fe = Oe;
|
|
25
|
+
const T = new fe();
|
|
26
|
+
var z, V, S, K, Z, G, Bt, J, zt;
|
|
27
|
+
const Be = class Be extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
d(this, z);
|
|
31
|
-
d(this,
|
|
31
|
+
d(this, V, !1);
|
|
32
32
|
d(this, S);
|
|
33
|
-
d(this, U);
|
|
34
|
-
d(this, X);
|
|
35
33
|
d(this, K);
|
|
36
|
-
d(this,
|
|
34
|
+
d(this, Z);
|
|
35
|
+
d(this, G);
|
|
36
|
+
d(this, Bt, /* @__PURE__ */ h(() => {
|
|
37
37
|
if (!t(this, z)) return;
|
|
38
38
|
const e = t(this, z).querySelector(".ng-container-body .ng-part-body");
|
|
39
|
-
e && (
|
|
39
|
+
e && (p(this, G, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
|
-
})), t(this,
|
|
41
|
+
})), t(this, G).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
44
|
-
if (!t(this, z) || !t(this, S) || t(this,
|
|
44
|
+
if (!t(this, z) || !t(this, S) || t(this, V)) return;
|
|
45
45
|
const e = t(this, S).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const
|
|
47
|
+
const r = t(this, S).track, o = t(this, S).thumb, i = t(this, z).querySelector(".ng-container-bottom"), a = e.clientWidth, c = s.scrollWidth;
|
|
48
48
|
if (a !== 0 && c > a)
|
|
49
|
-
|
|
49
|
+
i && (i.style.display = "flex");
|
|
50
50
|
else {
|
|
51
|
-
|
|
51
|
+
i && (i.style.display = "none");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
const l =
|
|
54
|
+
const l = r.clientWidth;
|
|
55
55
|
if (l <= 0) return;
|
|
56
56
|
const f = Math.max(Math.min(l * (a / c), l), 20);
|
|
57
|
-
|
|
57
|
+
o.style.width = `${f}px`;
|
|
58
58
|
const g = e.scrollLeft, b = c - a;
|
|
59
59
|
let u = 0;
|
|
60
60
|
b > 0 && (u = parseInt(g / b * (l - f), 10)), u < 0 && (u = 0);
|
|
61
|
-
const
|
|
62
|
-
u >
|
|
61
|
+
const y = l - f;
|
|
62
|
+
u > y && (u = y), o.style.left = `${u}px`, t(this, S).left.disabled = u === 0, t(this, S).right.disabled = u >= y - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
d(this,
|
|
64
|
+
d(this, J, /* @__PURE__ */ h((e) => {
|
|
65
65
|
if (!t(this, S)) return !1;
|
|
66
|
-
const s = t(this, S).container,
|
|
67
|
-
if (!
|
|
68
|
-
const
|
|
66
|
+
const s = t(this, S).container, r = s.querySelector("table");
|
|
67
|
+
if (!r) return !1;
|
|
68
|
+
const o = t(this, S).track.getBoundingClientRect(), i = t(this, S).thumb.clientWidth;
|
|
69
69
|
let a = e;
|
|
70
70
|
a < 0 && (a = 0);
|
|
71
|
-
const c =
|
|
71
|
+
const c = o.width - i;
|
|
72
72
|
a > c && (a = c), a = parseInt(a, 10), t(this, S).thumb.style.left = `${a}px`, t(this, S).left.disabled = a === 0, t(this, S).right.disabled = a >= c - 1;
|
|
73
|
-
const l = s.clientWidth, g =
|
|
73
|
+
const l = s.clientWidth, g = r.scrollWidth - l;
|
|
74
74
|
return c > 0 && g > 0 && (s.scrollLeft = a / c * g), a > 0 && a < c - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
d(this,
|
|
77
|
-
const e = /* @__PURE__ */ h((
|
|
78
|
-
clearInterval(t(this,
|
|
79
|
-
const
|
|
80
|
-
t(this,
|
|
81
|
-
clearInterval(t(this,
|
|
82
|
-
const
|
|
83
|
-
t(this,
|
|
76
|
+
d(this, zt, /* @__PURE__ */ h(() => {
|
|
77
|
+
const e = /* @__PURE__ */ h((r) => {
|
|
78
|
+
clearInterval(t(this, K)), clearInterval(t(this, Z));
|
|
79
|
+
const o = parseInt(t(this, S).thumb.style.left || 0, 10);
|
|
80
|
+
t(this, J).call(this, o + r), p(this, K, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, K)), p(this, Z, setInterval(() => {
|
|
82
|
+
const i = parseInt(t(this, S).thumb.style.left || 0, 10);
|
|
83
|
+
t(this, J).call(this, i + r) || clearInterval(t(this, Z));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), s = /* @__PURE__ */ h(() => {
|
|
87
|
-
clearInterval(t(this,
|
|
87
|
+
clearInterval(t(this, K)), clearInterval(t(this, Z));
|
|
88
88
|
}, "clearTimer");
|
|
89
|
-
["mouseup", "mouseleave", "touchend"].forEach((
|
|
90
|
-
t(this, S).left.addEventListener(
|
|
91
|
-
}), t(this, S).left.addEventListener("mousedown", (
|
|
92
|
-
|
|
93
|
-
}), t(this, S).right.addEventListener("mousedown", (
|
|
94
|
-
|
|
95
|
-
}), t(this, S).left.addEventListener("touchstart", () => e(-20)), t(this, S).right.addEventListener("touchstart", () => e(20)), t(this, S).track.addEventListener("mousedown", (
|
|
96
|
-
if (
|
|
97
|
-
|
|
98
|
-
const
|
|
99
|
-
t(this,
|
|
100
|
-
}), t(this, S).thumb.addEventListener("mousedown", (
|
|
101
|
-
if (
|
|
102
|
-
|
|
103
|
-
const
|
|
104
|
-
if (!t(this,
|
|
89
|
+
["mouseup", "mouseleave", "touchend"].forEach((r) => {
|
|
90
|
+
t(this, S).left.addEventListener(r, s), t(this, S).right.addEventListener(r, s), t(this, S).track.addEventListener(r, s);
|
|
91
|
+
}), t(this, S).left.addEventListener("mousedown", (r) => {
|
|
92
|
+
r.button === 0 && e(-20);
|
|
93
|
+
}), t(this, S).right.addEventListener("mousedown", (r) => {
|
|
94
|
+
r.button === 0 && e(20);
|
|
95
|
+
}), t(this, S).left.addEventListener("touchstart", () => e(-20)), t(this, S).right.addEventListener("touchstart", () => e(20)), t(this, S).track.addEventListener("mousedown", (r) => {
|
|
96
|
+
if (r.button !== 0) return;
|
|
97
|
+
r.preventDefault();
|
|
98
|
+
const o = t(this, S).track.getBoundingClientRect(), i = t(this, S).thumb.clientWidth;
|
|
99
|
+
t(this, J).call(this, r.clientX - o.left - i / 2);
|
|
100
|
+
}), t(this, S).thumb.addEventListener("mousedown", (r) => {
|
|
101
|
+
if (r.button !== 0) return;
|
|
102
|
+
r.stopPropagation(), r.preventDefault(), p(this, V, !0), this.shiftX = r.clientX - t(this, S).thumb.getBoundingClientRect().left;
|
|
103
|
+
const o = /* @__PURE__ */ h((a) => {
|
|
104
|
+
if (!t(this, V)) return;
|
|
105
105
|
const c = t(this, S).track.getBoundingClientRect();
|
|
106
|
-
t(this,
|
|
107
|
-
}, "onMouseMove"),
|
|
108
|
-
|
|
106
|
+
t(this, J).call(this, a.clientX - c.left - this.shiftX);
|
|
107
|
+
}, "onMouseMove"), i = /* @__PURE__ */ h(() => {
|
|
108
|
+
p(this, V, !1), s(), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", i), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
|
-
document.addEventListener("mousemove",
|
|
110
|
+
document.addEventListener("mousemove", o), document.addEventListener("mouseup", i);
|
|
111
111
|
});
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
114
114
|
connectedCallback() {
|
|
115
|
-
if (
|
|
115
|
+
if (p(this, z, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, z)) return;
|
|
116
116
|
this.innerHTML = `
|
|
117
117
|
<style>
|
|
118
118
|
nine-table-hscrollbar {
|
|
@@ -182,80 +182,80 @@ const $e = class $e extends HTMLElement {
|
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
|
-
|
|
185
|
+
p(this, S, {
|
|
186
186
|
container: s,
|
|
187
187
|
track: this.querySelector(".ng-scroll-track"),
|
|
188
188
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
189
189
|
left: this.querySelector(".ng-scroll-left"),
|
|
190
190
|
right: this.querySelector(".ng-scroll-right")
|
|
191
191
|
}), s.addEventListener("scroll", () => {
|
|
192
|
-
t(this,
|
|
193
|
-
}), t(this,
|
|
192
|
+
t(this, V) || this.refresh();
|
|
193
|
+
}), t(this, zt).call(this), t(this, Bt).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
197
197
|
disconnectedCallback() {
|
|
198
|
-
t(this,
|
|
198
|
+
t(this, G) && t(this, G).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
z = new WeakMap(),
|
|
202
|
-
let
|
|
203
|
-
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar",
|
|
204
|
-
var
|
|
205
|
-
const
|
|
201
|
+
z = new WeakMap(), V = new WeakMap(), S = new WeakMap(), K = new WeakMap(), Z = new WeakMap(), G = new WeakMap(), Bt = new WeakMap(), J = new WeakMap(), zt = new WeakMap(), h(Be, "NineTableHScrollBar");
|
|
202
|
+
let ue = Be;
|
|
203
|
+
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ue);
|
|
204
|
+
var Q, tt, ct, k, wt, St, Pt;
|
|
205
|
+
const ze = class ze extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
-
d(this,
|
|
209
|
-
d(this,
|
|
210
|
-
d(this,
|
|
208
|
+
d(this, Q);
|
|
209
|
+
d(this, tt);
|
|
210
|
+
d(this, ct, !1);
|
|
211
211
|
d(this, k);
|
|
212
|
-
d(this,
|
|
213
|
-
d(this,
|
|
212
|
+
d(this, wt, 0);
|
|
213
|
+
d(this, St, 0);
|
|
214
214
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
|
-
if (
|
|
216
|
-
const e = t(this, k).container, s = t(this, k).track,
|
|
217
|
-
if (c <=
|
|
215
|
+
if (T.log("vscrollbar.refresh"), !t(this, Q) || !t(this, k)) return;
|
|
216
|
+
const e = t(this, k).container, s = t(this, k).track, r = t(this, k).thumb, o = e.clientHeight, i = t(this, Q).data.length, a = t(this, tt).getRowHeight(), c = i * a;
|
|
217
|
+
if (c <= o || i === 0) {
|
|
218
218
|
this.style.display = "none";
|
|
219
219
|
return;
|
|
220
220
|
} else
|
|
221
221
|
this.style.display = "flex";
|
|
222
222
|
const l = s.clientHeight;
|
|
223
223
|
if (l <= 0) return;
|
|
224
|
-
const f = Math.max(Math.min(l * (
|
|
225
|
-
|
|
226
|
-
const g = e.scrollTop, b = Math.max(c -
|
|
227
|
-
|
|
224
|
+
const f = Math.max(Math.min(l * (o / c), l), 20);
|
|
225
|
+
r.style.height = `${f}px`;
|
|
226
|
+
const g = e.scrollTop, b = Math.max(c - o, 1);
|
|
227
|
+
T.log(e, g, b);
|
|
228
228
|
let u = 0;
|
|
229
229
|
b > 0 && (u = g / b * (l - f));
|
|
230
|
-
const
|
|
231
|
-
u < 0 && (u = 0), u >
|
|
230
|
+
const y = l - f;
|
|
231
|
+
u < 0 && (u = 0), u > y && (u = y), r.style.top = `${u}px`, t(this, k).top.disabled = g <= 0, t(this, k).bottom.disabled = g >= b - 1;
|
|
232
232
|
}, "refresh"));
|
|
233
|
-
d(this,
|
|
234
|
-
|
|
233
|
+
d(this, Pt, /* @__PURE__ */ h(() => {
|
|
234
|
+
T.log("nine-table-vscrollbar.#init");
|
|
235
235
|
const e = t(this, k).container, s = /* @__PURE__ */ h(() => {
|
|
236
|
-
const
|
|
237
|
-
return
|
|
236
|
+
const o = (t(this, Q).data.get() || []).length, i = t(this, tt).getRowHeight();
|
|
237
|
+
return o * i;
|
|
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, g = c.height - l, b = a.clientY - t(this,
|
|
245
|
-
if (g > 0 &&
|
|
246
|
-
const A = b / g *
|
|
247
|
-
let
|
|
248
|
-
const
|
|
249
|
-
|
|
239
|
+
t(this, k).thumb.addEventListener("mousedown", (r) => {
|
|
240
|
+
if (r.button !== 0) return;
|
|
241
|
+
r.stopPropagation(), r.preventDefault(), p(this, ct, !0), p(this, wt, r.clientY), p(this, St, e.scrollTop);
|
|
242
|
+
const o = /* @__PURE__ */ h((a) => {
|
|
243
|
+
if (!t(this, ct)) return;
|
|
244
|
+
const c = t(this, k).track.getBoundingClientRect(), l = t(this, k).thumb.clientHeight, g = c.height - l, b = a.clientY - t(this, wt), u = e.clientHeight, y = s(), x = Math.max(y - u, 1);
|
|
245
|
+
if (g > 0 && x > 0) {
|
|
246
|
+
const A = b / g * x;
|
|
247
|
+
let v = t(this, St) + A;
|
|
248
|
+
const M = Math.max(0, y - u);
|
|
249
|
+
v < 0 && (v = 0), v > M && (v = M), e.scrollTop = v;
|
|
250
250
|
}
|
|
251
251
|
this.refresh();
|
|
252
|
-
}, "onMouseMove"),
|
|
253
|
-
|
|
252
|
+
}, "onMouseMove"), i = /* @__PURE__ */ h(() => {
|
|
253
|
+
p(this, ct, !1), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", i), this.refresh();
|
|
254
254
|
}, "onMouseUp");
|
|
255
|
-
document.addEventListener("mousemove",
|
|
256
|
-
}), t(this, k).track.addEventListener("mousedown", (
|
|
257
|
-
if (
|
|
258
|
-
const
|
|
255
|
+
document.addEventListener("mousemove", o), document.addEventListener("mouseup", i);
|
|
256
|
+
}), t(this, k).track.addEventListener("mousedown", (r) => {
|
|
257
|
+
if (r.button !== 0 || r.target === t(this, k).thumb) return;
|
|
258
|
+
const o = t(this, k).track.getBoundingClientRect(), i = t(this, k).thumb.clientHeight, a = r.clientY - o.top - i / 2, l = o.height - i, f = e.clientHeight, g = s(), b = Math.max(g - f, 1);
|
|
259
259
|
if (l > 0 && b > 0) {
|
|
260
260
|
const u = Math.max(0, Math.min(1, a / l));
|
|
261
261
|
e.scrollTop = u * b;
|
|
@@ -269,7 +269,7 @@ const Me = class Me extends HTMLElement {
|
|
|
269
269
|
}, "#init"));
|
|
270
270
|
}
|
|
271
271
|
connectedCallback() {
|
|
272
|
-
|
|
272
|
+
p(this, Q, this.getRootNode().host), p(this, tt, this.closest("nine-table-sheet")), this.innerHTML = `
|
|
273
273
|
<style>
|
|
274
274
|
nine-table-vscrollbar {
|
|
275
275
|
display: flex;
|
|
@@ -334,230 +334,230 @@ const Me = class Me 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 s = t(this,
|
|
337
|
+
const s = t(this, tt).querySelector(".ng-container-body .ng-part-body");
|
|
338
338
|
if (!s) {
|
|
339
339
|
setTimeout(e, 10);
|
|
340
340
|
return;
|
|
341
341
|
}
|
|
342
|
-
|
|
342
|
+
p(this, k, {
|
|
343
343
|
container: s,
|
|
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, Pt).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
|
-
d(this,
|
|
360
|
-
d(this,
|
|
361
|
-
d(this,
|
|
362
|
-
d(this,
|
|
363
|
-
d(this,
|
|
364
|
-
d(this,
|
|
365
|
-
d(this,
|
|
366
|
-
d(this,
|
|
367
|
-
d(this,
|
|
368
|
-
d(this,
|
|
353
|
+
Q = new WeakMap(), tt = new WeakMap(), ct = new WeakMap(), k = new WeakMap(), wt = new WeakMap(), St = new WeakMap(), Pt = new WeakMap(), h(ze, "NineTableVScrollBar");
|
|
354
|
+
let ge = ze;
|
|
355
|
+
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", ge);
|
|
356
|
+
var D, w, et, P, _, Y, st, Et, Ce, Le, Dt, Ft, At, Rt, qt, jt, Vt, Tt, He, ht, kt, Yt;
|
|
357
|
+
const Pe = class Pe {
|
|
358
|
+
constructor(n) {
|
|
359
|
+
d(this, D);
|
|
360
|
+
d(this, w);
|
|
361
|
+
d(this, et);
|
|
362
|
+
d(this, P, /* @__PURE__ */ new Map());
|
|
363
|
+
d(this, _, null);
|
|
364
|
+
d(this, Y, null);
|
|
365
|
+
d(this, st, 0);
|
|
366
|
+
d(this, Et, 40);
|
|
367
|
+
d(this, Ce, !1);
|
|
368
|
+
d(this, Le, !1);
|
|
369
369
|
//#ticking = false; // 🎯 고속 스크롤 스로틀링용 플래그
|
|
370
|
-
d(this,
|
|
370
|
+
d(this, Dt, 3);
|
|
371
371
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
372
372
|
var e;
|
|
373
|
-
|
|
374
|
-
const
|
|
375
|
-
|
|
373
|
+
T.log("rowManager.refresh");
|
|
374
|
+
const n = t(this, w).querySelector(".ng-container-body .ng-part-body");
|
|
375
|
+
n && (t(this, At).call(this), t(this, Rt).call(this), t(this, ht).call(this, n.scrollTop), (e = t(this, w).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
376
376
|
}, "refresh"));
|
|
377
377
|
E(this, "initialize", /* @__PURE__ */ h(() => {
|
|
378
|
-
|
|
379
|
-
scrollTables: t(this,
|
|
380
|
-
firstTr: t(this,
|
|
381
|
-
}),
|
|
382
|
-
const a = t(this,
|
|
378
|
+
T.log("rowManager.initialize"), p(this, et, {
|
|
379
|
+
scrollTables: t(this, w).querySelectorAll(".ng-part-body table"),
|
|
380
|
+
firstTr: t(this, w).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
381
|
+
}), p(this, _, null), t(this, P).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
382
|
+
const a = t(this, w).querySelector(i);
|
|
383
383
|
if (!a) return;
|
|
384
384
|
const c = a.querySelector(".ng-part-body table");
|
|
385
385
|
if (!c) return;
|
|
386
386
|
const l = c.querySelector("tbody.bindable-tbody");
|
|
387
387
|
if (!l) return;
|
|
388
388
|
const g = Array.from(l.querySelectorAll("tr")).map((b) => b.cloneNode(!0));
|
|
389
|
-
t(this,
|
|
389
|
+
t(this, P).set(i, g);
|
|
390
390
|
});
|
|
391
|
-
const
|
|
392
|
-
if (
|
|
393
|
-
t(this,
|
|
394
|
-
let
|
|
391
|
+
const n = t(this, w).querySelector(".ng-container-body .ng-part-body"), e = t(this, w).querySelector(".ng-container-left .ng-part-body"), s = t(this, w).querySelector(".ng-container-right .ng-part-body"), r = t(this, w).querySelector(".ng-container-body .ng-part-header"), o = t(this, w).querySelector(".ng-container-body .ng-part-footer");
|
|
392
|
+
if (n) {
|
|
393
|
+
t(this, At).call(this), t(this, Tt).call(this), t(this, Rt).call(this), t(this, ht).call(this, n.scrollTop);
|
|
394
|
+
let i = !1;
|
|
395
395
|
const a = /* @__PURE__ */ h((c) => {
|
|
396
396
|
var g;
|
|
397
|
-
if (
|
|
398
|
-
|
|
397
|
+
if (i) return;
|
|
398
|
+
i = !0;
|
|
399
399
|
const l = c.scrollTop, f = c.scrollLeft;
|
|
400
|
-
|
|
400
|
+
n && n.scrollTop !== l && (n.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), r && r.scrollLeft !== f && (r.scrollLeft = f), o && o.scrollLeft !== f && (o.scrollLeft = f), t(this, ht).call(this, l), (g = t(this, w).querySelector("nine-table-vscrollbar")) == null || g.refresh(), i = !1;
|
|
401
401
|
}, "handleContainerScroll");
|
|
402
|
-
[
|
|
402
|
+
[n, e, s].forEach((c) => {
|
|
403
403
|
c == null || c.addEventListener("scroll", () => {
|
|
404
404
|
a(c);
|
|
405
405
|
});
|
|
406
406
|
});
|
|
407
407
|
}
|
|
408
408
|
}, "initialize"));
|
|
409
|
-
d(this,
|
|
410
|
-
|
|
411
|
-
const s = t(this,
|
|
409
|
+
d(this, Ft, /* @__PURE__ */ h((n, e) => {
|
|
410
|
+
T.log("rowManager.#renderRows");
|
|
411
|
+
const s = t(this, P).get(e);
|
|
412
412
|
if (!s || s.length === 0) return;
|
|
413
|
-
const
|
|
414
|
-
if (!
|
|
415
|
-
|
|
416
|
-
const
|
|
417
|
-
for (let a = 0; a < t(this,
|
|
413
|
+
const r = n.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
414
|
+
if (!r) return;
|
|
415
|
+
r.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
|
|
416
|
+
const o = r.querySelector("tr.nodata"), i = document.createDocumentFragment();
|
|
417
|
+
for (let a = 0; a < t(this, Et); a++)
|
|
418
418
|
s.forEach((c) => {
|
|
419
|
-
|
|
419
|
+
i.appendChild(c.cloneNode(!0));
|
|
420
420
|
});
|
|
421
|
-
|
|
421
|
+
o ? o.before(i) : r.appendChild(i), e === ".ng-container-body" && (t(this, et).firstTr = r.querySelector("tr:not(.nodata)"));
|
|
422
422
|
}, "#renderRows"));
|
|
423
|
-
d(this,
|
|
424
|
-
if (t(this,
|
|
425
|
-
return t(this,
|
|
426
|
-
const
|
|
427
|
-
|
|
428
|
-
const e = t(this,
|
|
423
|
+
d(this, At, /* @__PURE__ */ h(() => {
|
|
424
|
+
if (t(this, _) !== null && t(this, _) > 0)
|
|
425
|
+
return t(this, _);
|
|
426
|
+
const n = t(this, w).querySelector(".ng-container-body .ng-part-body");
|
|
427
|
+
T.log("rowManager.#measureAndCacheHeight");
|
|
428
|
+
const e = t(this, P).get(".ng-container-body");
|
|
429
429
|
if (!e || e.length === 0) throw new Error("invalid dom");
|
|
430
|
-
const s =
|
|
431
|
-
if (
|
|
430
|
+
const s = n.querySelector("tbody.bindable-tbody");
|
|
431
|
+
if (T.log(s), !s) throw new Error("invalid dom");
|
|
432
432
|
s.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
|
|
433
|
-
const
|
|
433
|
+
const r = s.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
434
434
|
e.forEach((b) => {
|
|
435
|
-
|
|
436
|
-
}),
|
|
437
|
-
const
|
|
438
|
-
(a === "none" || window.getComputedStyle(
|
|
435
|
+
o.appendChild(b.cloneNode(!0));
|
|
436
|
+
}), r ? r.before(o) : s.appendChild(o);
|
|
437
|
+
const i = t(this, w), a = i.style.display, c = i.style.visibility, l = i.style.position;
|
|
438
|
+
(a === "none" || window.getComputedStyle(i).display === "none") && (i.style.display = "block", i.style.visibility = "hidden", i.style.position = "absolute");
|
|
439
439
|
let f = 0;
|
|
440
440
|
const g = s.querySelectorAll("tr");
|
|
441
441
|
return g.forEach((b) => {
|
|
442
442
|
let u = b.offsetHeight || b.getBoundingClientRect().height;
|
|
443
443
|
if (u === 0) {
|
|
444
|
-
const
|
|
445
|
-
u = parseFloat(
|
|
444
|
+
const y = window.getComputedStyle(b);
|
|
445
|
+
u = parseFloat(y.height) || parseFloat(y.minHeight) || 0;
|
|
446
446
|
}
|
|
447
447
|
f += u;
|
|
448
|
-
}), g.forEach((b) => b.remove()),
|
|
448
|
+
}), g.forEach((b) => b.remove()), i.style.display = a, i.style.visibility = c, i.style.position = l, f <= 0 ? -1 : (p(this, _, f), t(this, qt).call(this), t(this, _));
|
|
449
449
|
}, "#measureAndCacheHeight"));
|
|
450
|
-
d(this,
|
|
451
|
-
|
|
452
|
-
const e = (t(this,
|
|
453
|
-
|
|
454
|
-
const
|
|
455
|
-
if (!
|
|
456
|
-
const a =
|
|
457
|
-
a && (a.style.height = `${
|
|
450
|
+
d(this, Rt, /* @__PURE__ */ h(() => {
|
|
451
|
+
T.log("rowManager.#updateVirtualScrollHeight");
|
|
452
|
+
const e = (t(this, D).data.get() || []).length, s = t(this, _), r = e * s;
|
|
453
|
+
T.log("🔍 [VirtualHeight]", { totalCount: e, rowHeight: s, totalVirtualHeight: r }), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
454
|
+
const i = t(this, w).querySelector(o);
|
|
455
|
+
if (!i) return;
|
|
456
|
+
const a = i.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
457
|
+
a && (a.style.height = `${r}px`);
|
|
458
458
|
});
|
|
459
459
|
}, "#updateVirtualScrollHeight"));
|
|
460
|
-
d(this,
|
|
461
|
-
if (t(this,
|
|
462
|
-
const
|
|
463
|
-
|
|
460
|
+
d(this, qt, /* @__PURE__ */ h(() => {
|
|
461
|
+
if (t(this, st) > 0 && t(this, _) > 0) {
|
|
462
|
+
const n = Math.ceil(t(this, st) / t(this, _));
|
|
463
|
+
p(this, Et, n + t(this, Dt));
|
|
464
464
|
}
|
|
465
465
|
}, "#updateRowCount"));
|
|
466
|
-
d(this,
|
|
466
|
+
d(this, jt, /* @__PURE__ */ h(() => {
|
|
467
467
|
var a, c, l, f, g, b;
|
|
468
|
-
const
|
|
468
|
+
const n = t(this, w).querySelector(".ng-container-left .ng-part-body table"), e = t(this, w).querySelector(".ng-container-body .ng-part-body table"), s = t(this, w).querySelector(".ng-container-right .ng-part-body table");
|
|
469
469
|
if (e) {
|
|
470
|
-
const u =
|
|
471
|
-
for (let
|
|
472
|
-
const
|
|
473
|
-
((a = u[
|
|
474
|
-
((c = v
|
|
475
|
-
((l =
|
|
476
|
-
],
|
|
477
|
-
|
|
470
|
+
const u = n ? Array.from(n.querySelectorAll("tbody tr")) : [], y = Array.from(e.querySelectorAll("tbody tr")), x = s ? Array.from(s.querySelectorAll("tbody tr")) : [], A = Math.max(u.length, y.length, x.length);
|
|
471
|
+
for (let v = 0; v < A; v++) {
|
|
472
|
+
const M = [
|
|
473
|
+
((a = u[v]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
474
|
+
((c = y[v]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
475
|
+
((l = x[v]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
476
|
+
], q = Math.max(...M);
|
|
477
|
+
q > 0 && (u[v] && (u[v].style.height = `${q}px`), y[v] && (y[v].style.height = `${q}px`), x[v] && (x[v].style.height = `${q}px`));
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
|
-
const
|
|
481
|
-
if (
|
|
482
|
-
const u =
|
|
483
|
-
for (let
|
|
484
|
-
const
|
|
485
|
-
((f = u[
|
|
486
|
-
((g = v
|
|
487
|
-
((b =
|
|
488
|
-
],
|
|
489
|
-
|
|
480
|
+
const r = t(this, w).querySelector(".ng-container-left .ng-part-footer table"), o = t(this, w).querySelector(".ng-container-body .ng-part-footer table"), i = t(this, w).querySelector(".ng-container-right .ng-part-footer table");
|
|
481
|
+
if (o) {
|
|
482
|
+
const u = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], y = Array.from(o.querySelectorAll("tfoot tr")), x = i ? Array.from(i.querySelectorAll("tfoot tr")) : [], A = Math.max(u.length, y.length, x.length);
|
|
483
|
+
for (let v = 0; v < A; v++) {
|
|
484
|
+
const M = [
|
|
485
|
+
((f = u[v]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
486
|
+
((g = y[v]) == null ? void 0 : g.getBoundingClientRect().height) || 0,
|
|
487
|
+
((b = x[v]) == null ? void 0 : b.getBoundingClientRect().height) || 0
|
|
488
|
+
], q = Math.max(...M);
|
|
489
|
+
q > 0 && (u[v] && (u[v].style.height = `${q}px`), y[v] && (y[v].style.height = `${q}px`), x[v] && (x[v].style.height = `${q}px`));
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
492
|
}, "#syncRowHeights"));
|
|
493
|
-
d(this,
|
|
494
|
-
!t(this,
|
|
495
|
-
for (const e of
|
|
493
|
+
d(this, Vt, /* @__PURE__ */ h(() => {
|
|
494
|
+
!t(this, w) || !(t(this, w) instanceof HTMLElement) || (p(this, Y, new ResizeObserver((n) => {
|
|
495
|
+
for (const e of n) {
|
|
496
496
|
const s = e.target;
|
|
497
497
|
if (!s.classList.contains("active")) continue;
|
|
498
|
-
const
|
|
499
|
-
if (
|
|
500
|
-
let
|
|
501
|
-
const
|
|
502
|
-
|
|
503
|
-
const c = Math.max(
|
|
504
|
-
t(this,
|
|
498
|
+
const r = e.contentRect.height;
|
|
499
|
+
if (r > 0) {
|
|
500
|
+
let o = 0;
|
|
501
|
+
const i = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
|
|
502
|
+
i && (o += i.offsetHeight), a && (o += a.offsetHeight);
|
|
503
|
+
const c = Math.max(r - o, 100);
|
|
504
|
+
t(this, st) !== c && (p(this, st, c), t(this, qt).call(this), t(this, _) !== null && (t(this, Tt).call(this), this.refresh()));
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
|
-
})), t(this,
|
|
507
|
+
})), t(this, Y).observe(t(this, w)));
|
|
508
508
|
}, "#initResizeObserver"));
|
|
509
|
-
d(this,
|
|
510
|
-
|
|
511
|
-
const e = t(this,
|
|
512
|
-
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this,
|
|
513
|
-
}), t(this,
|
|
509
|
+
d(this, Tt, /* @__PURE__ */ h(() => {
|
|
510
|
+
T.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
511
|
+
const e = t(this, w).querySelector(n);
|
|
512
|
+
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Ft).call(this, e, n);
|
|
513
|
+
}), t(this, Yt).call(this), t(this, jt).call(this);
|
|
514
514
|
}, "#renderAllContainers"));
|
|
515
|
-
d(this,
|
|
515
|
+
d(this, He, /* @__PURE__ */ h((n) => {
|
|
516
516
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
517
517
|
var l;
|
|
518
|
-
const s = t(this,
|
|
518
|
+
const s = t(this, w).querySelector(e);
|
|
519
519
|
if (!s) return;
|
|
520
|
-
const
|
|
521
|
-
if (!
|
|
522
|
-
const
|
|
523
|
-
|
|
524
|
-
const b =
|
|
520
|
+
const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
521
|
+
if (!r) return;
|
|
522
|
+
const o = Array.from(r.querySelectorAll("tr:not(.nodata)")), i = ((l = t(this, P).get(e)) == null ? void 0 : l.length) || 1, c = (t(this, D).data.get() || []).length;
|
|
523
|
+
o.forEach((f, g) => {
|
|
524
|
+
const b = n + Math.floor(g / i);
|
|
525
525
|
if (b >= c) {
|
|
526
526
|
f.style.visibility = "hidden";
|
|
527
527
|
return;
|
|
528
528
|
}
|
|
529
|
-
const u = t(this,
|
|
530
|
-
f.style.display = "", t(this,
|
|
529
|
+
const u = t(this, D).data.get(b);
|
|
530
|
+
f.style.display = "", t(this, kt).call(this, f, u, b);
|
|
531
531
|
});
|
|
532
532
|
});
|
|
533
533
|
}, "#adjustBufferRows"));
|
|
534
|
-
d(this,
|
|
534
|
+
d(this, ht, /* @__PURE__ */ h((n) => {
|
|
535
535
|
var g, b;
|
|
536
|
-
const e = t(this,
|
|
536
|
+
const e = t(this, _);
|
|
537
537
|
if (!e || e <= 0) return;
|
|
538
|
-
const s = t(this,
|
|
538
|
+
const s = t(this, D).data.length;
|
|
539
539
|
if (s === 0) return;
|
|
540
|
-
const
|
|
541
|
-
|
|
542
|
-
const
|
|
540
|
+
const r = ((g = t(this, P).get(".ng-container-body")) == null ? void 0 : g.length) || 1, o = t(this, w).querySelector(".ng-container-body .ng-part-body");
|
|
541
|
+
T.log("bodyContainer.clientHeight", o.clientHeight);
|
|
542
|
+
const i = Math.max(0, s - Math.floor(o.clientHeight / e)), a = Math.min(i, Math.max(0, Math.floor(n / e)));
|
|
543
543
|
let c = Math.floor(a * e);
|
|
544
|
-
|
|
545
|
-
const l = t(this,
|
|
546
|
-
(b = t(this,
|
|
544
|
+
T.log(`📜 [Scroll Calc] maxStartIndex: ${i}, startIndex: ${a}, offsetY: ${c}`), a === i && T.log(`📜 [Scroll Inspect] scrollTop: ${n}, rowHeight: ${e}, maxStartIndex: ${i}, startIndex: ${a}, offsetY: ${c}`);
|
|
545
|
+
const l = t(this, et).firstTr, f = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
|
|
546
|
+
(b = t(this, et)) == null || b.scrollTables.forEach((u) => {
|
|
547
547
|
u.style.transform = `translate3d(0, ${c}px, 0)`;
|
|
548
|
-
}), f !== a && (
|
|
549
|
-
const
|
|
550
|
-
if (!
|
|
551
|
-
const
|
|
552
|
-
if (!
|
|
553
|
-
Array.from(
|
|
554
|
-
const
|
|
555
|
-
if (
|
|
556
|
-
|
|
548
|
+
}), f !== a && (T.log(`🔄 [Row Bind Trigger] currentStartIndex(${f}) !== startIndex(${a})`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((u) => {
|
|
549
|
+
const y = t(this, w).querySelector(u);
|
|
550
|
+
if (!y) return;
|
|
551
|
+
const x = y.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
552
|
+
if (!x) return;
|
|
553
|
+
Array.from(x.querySelectorAll("tr:not(.nodata)")).forEach((v, M) => {
|
|
554
|
+
const q = a + Math.floor(M / r);
|
|
555
|
+
if (q >= s) {
|
|
556
|
+
v.style.display = "none";
|
|
557
557
|
return;
|
|
558
558
|
}
|
|
559
|
-
const O = t(this,
|
|
560
|
-
|
|
559
|
+
const O = t(this, D).data.get(q);
|
|
560
|
+
v.style.display = "", t(this, kt).call(this, v, O, q);
|
|
561
561
|
});
|
|
562
562
|
}));
|
|
563
563
|
}, "#handleScroll"));
|
|
@@ -575,63 +575,63 @@ const Ie = class Ie {
|
|
|
575
575
|
cell.dataset.row = dataIndex;
|
|
576
576
|
});
|
|
577
577
|
}; */
|
|
578
|
-
d(this,
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
const
|
|
582
|
-
|
|
578
|
+
d(this, kt, /* @__PURE__ */ h((n, e, s) => {
|
|
579
|
+
n.dataset.row = s, n.data = e, Array.from(n.cells).forEach((r, o) => {
|
|
580
|
+
r.dataset.row = s;
|
|
581
|
+
const i = Array.from(r.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
|
|
582
|
+
i && typeof i.refresh == "function" && i.refresh();
|
|
583
583
|
});
|
|
584
584
|
}, "#bindRowData"));
|
|
585
|
-
d(this,
|
|
585
|
+
d(this, Yt, /* @__PURE__ */ h(() => {
|
|
586
586
|
var c, l, f;
|
|
587
|
-
|
|
588
|
-
const
|
|
587
|
+
T.log("rowManager.#syncHeaderHeights");
|
|
588
|
+
const n = t(this, w).querySelector(".ng-container-left .ng-part-header table"), e = t(this, w).querySelector(".ng-container-body .ng-part-header table"), s = t(this, w).querySelector(".ng-container-right .ng-part-header table");
|
|
589
589
|
if (!e) return;
|
|
590
|
-
const
|
|
590
|
+
const r = n ? Array.from(n.querySelectorAll("tr")) : [], o = Array.from(e.querySelectorAll("tr")), i = s ? Array.from(s.querySelectorAll("tr")) : [], a = Math.max(r.length, o.length, i.length);
|
|
591
591
|
for (let g = 0; g < a; g++) {
|
|
592
592
|
const b = [
|
|
593
|
-
((c =
|
|
594
|
-
((l =
|
|
595
|
-
((f =
|
|
593
|
+
((c = r[g]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
594
|
+
((l = o[g]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
595
|
+
((f = i[g]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
596
596
|
], u = Math.max(...b);
|
|
597
|
-
u > 0 && (
|
|
597
|
+
u > 0 && (r[g] && (r[g].style.height = `${u}px`), o[g] && (o[g].style.height = `${u}px`), i[g] && (i[g].style.height = `${u}px`));
|
|
598
598
|
}
|
|
599
599
|
}, "#syncHeaderHeights"));
|
|
600
600
|
E(this, "destroy", /* @__PURE__ */ h(() => {
|
|
601
|
-
t(this,
|
|
601
|
+
t(this, Y) && (t(this, Y).disconnect(), p(this, Y, null));
|
|
602
602
|
}, "destroy"));
|
|
603
|
-
|
|
603
|
+
p(this, D, n.getRootNode().host), p(this, w, n), t(this, Vt).call(this);
|
|
604
604
|
}
|
|
605
605
|
getRowHeight() {
|
|
606
|
-
return t(this,
|
|
606
|
+
return t(this, _);
|
|
607
607
|
}
|
|
608
|
-
templateLength(
|
|
608
|
+
templateLength(n = ".ng-container-body") {
|
|
609
609
|
var e;
|
|
610
|
-
return ((e = t(this,
|
|
610
|
+
return ((e = t(this, P).get(n)) == null ? void 0 : e.length) || 1;
|
|
611
611
|
}
|
|
612
612
|
};
|
|
613
|
-
|
|
614
|
-
let
|
|
615
|
-
const
|
|
613
|
+
D = new WeakMap(), w = new WeakMap(), et = new WeakMap(), P = new WeakMap(), _ = new WeakMap(), Y = new WeakMap(), st = new WeakMap(), Et = new WeakMap(), Ce = new WeakMap(), Le = new WeakMap(), Dt = new WeakMap(), Ft = new WeakMap(), At = new WeakMap(), Rt = new WeakMap(), qt = new WeakMap(), jt = new WeakMap(), Vt = new WeakMap(), Tt = new WeakMap(), He = new WeakMap(), ht = new WeakMap(), kt = new WeakMap(), Yt = new WeakMap(), h(Pe, "RowManager");
|
|
614
|
+
let be = Pe;
|
|
615
|
+
const Ut = class Ut {
|
|
616
616
|
/**
|
|
617
617
|
* 🎯 레이아웃 내의 여러 rawTables 배열을 일괄로 받아 단일 마스터 템플릿으로 사전 컴파일합니다.
|
|
618
618
|
*/
|
|
619
|
-
static compileAll(
|
|
620
|
-
return Array.isArray(
|
|
619
|
+
static compileAll(n) {
|
|
620
|
+
return Array.isArray(n) ? n.map((e) => Ut.compile(e)) : [];
|
|
621
621
|
}
|
|
622
622
|
/**
|
|
623
623
|
* 🎯 단일 원본 테이블을 받아 기본 구조 보정 및 2차원 격자 인덱스 사전 부여 완료된 마스터 테이블 반환
|
|
624
624
|
*/
|
|
625
|
-
static compile(
|
|
626
|
-
if (!
|
|
625
|
+
static compile(n) {
|
|
626
|
+
if (!n) return null;
|
|
627
627
|
const e = /* @__PURE__ */ h((a) => {
|
|
628
628
|
a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
|
|
629
629
|
const f = l.getAttribute("cell-type") || "renderer";
|
|
630
630
|
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
631
631
|
let g = `cell-${f}`;
|
|
632
|
-
const b = l.getAttribute("data-bind"), u = l.getAttribute("data-expr"),
|
|
632
|
+
const b = l.getAttribute("data-bind"), u = l.getAttribute("data-expr"), y = l.getAttribute("maxbyte"), x = l.getAttribute("type");
|
|
633
633
|
let A = [];
|
|
634
|
-
b && A.push(`data-bind="${b}"`), u && A.push(`data-expr="${u}"`),
|
|
634
|
+
b && A.push(`data-bind="${b}"`), u && A.push(`data-expr="${u}"`), y && A.push(`maxbyte="${y}"`), x && A.push(`type="${x}"`), l.innerHTML = `<${g} ${A.join(" ")}></${g}>`;
|
|
635
635
|
});
|
|
636
636
|
}, "processCellTypes"), s = /* @__PURE__ */ h((a) => {
|
|
637
637
|
if (!a.querySelector("colgroup")) {
|
|
@@ -647,107 +647,182 @@ const jt = class jt {
|
|
|
647
647
|
l ? l.after(c) : a.prepend(c);
|
|
648
648
|
}
|
|
649
649
|
a.classList.add("nine-table-element");
|
|
650
|
-
}, "ensureTableStructure"),
|
|
650
|
+
}, "ensureTableStructure"), r = /* @__PURE__ */ h((a, c) => {
|
|
651
651
|
const l = Array.from(a.querySelectorAll(c + " tr")), f = Array.from(a.querySelectorAll(c + " th," + c + " td")), g = l.length;
|
|
652
652
|
if (g === 0 || f.length === 0) return;
|
|
653
653
|
let b = 0;
|
|
654
|
-
f.forEach((
|
|
655
|
-
b +=
|
|
654
|
+
f.forEach((y) => {
|
|
655
|
+
b += y.colSpan || 1;
|
|
656
656
|
});
|
|
657
657
|
const u = Array.from(Array(g), () => Array(b).fill(null));
|
|
658
|
-
l.forEach((
|
|
659
|
-
const
|
|
658
|
+
l.forEach((y) => {
|
|
659
|
+
const x = y.sectionRowIndex;
|
|
660
660
|
let A = 0;
|
|
661
|
-
Array.from(
|
|
662
|
-
for (let O = 0; O < u[
|
|
663
|
-
if (u[
|
|
661
|
+
Array.from(y.querySelectorAll("th,td")).forEach((v) => {
|
|
662
|
+
for (let O = 0; O < u[x].length; O++)
|
|
663
|
+
if (u[x][O] === null) {
|
|
664
664
|
A = O;
|
|
665
665
|
break;
|
|
666
666
|
}
|
|
667
|
-
const
|
|
668
|
-
for (let O = 0; O <
|
|
669
|
-
for (let
|
|
670
|
-
|
|
667
|
+
const M = v.rowSpan || 1, q = v.colSpan || 1;
|
|
668
|
+
for (let O = 0; O < M; O++)
|
|
669
|
+
for (let j = 0; j < q; j++)
|
|
670
|
+
x + O < g && A + j < b && (u[x + O][A + j] = O === 0 && j === 0 ? "1" : "0");
|
|
671
671
|
});
|
|
672
|
-
}), l.forEach((
|
|
673
|
-
const
|
|
674
|
-
Array.from(
|
|
675
|
-
for (let
|
|
676
|
-
if (u[
|
|
677
|
-
A.dataset.col =
|
|
672
|
+
}), l.forEach((y) => {
|
|
673
|
+
const x = y.sectionRowIndex;
|
|
674
|
+
Array.from(y.querySelectorAll("th,td")).forEach((A) => {
|
|
675
|
+
for (let v = 0; v < u[x].length; v++)
|
|
676
|
+
if (u[x][v] === "1") {
|
|
677
|
+
A.dataset.col = v, u[x][v] = "0";
|
|
678
678
|
break;
|
|
679
679
|
}
|
|
680
680
|
});
|
|
681
681
|
});
|
|
682
|
-
}, "resetColIndex"),
|
|
683
|
-
return s(
|
|
682
|
+
}, "resetColIndex"), o = n.cloneNode(!0);
|
|
683
|
+
return s(o), e(o), r(o, "thead"), r(o, "tbody"), r(o, "tfoot"), Array.from(o.querySelectorAll("colgroup col")).forEach((a, c) => {
|
|
684
684
|
const l = a.getAttribute("fixed");
|
|
685
|
-
l &&
|
|
685
|
+
l && o.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((f) => {
|
|
686
686
|
f.setAttribute("fixed", l);
|
|
687
687
|
});
|
|
688
|
-
}),
|
|
688
|
+
}), o;
|
|
689
689
|
}
|
|
690
690
|
// 🎯 [추가] td/th에 선언된 cell-type 속성을 읽어 커스텀 태그로 자동 감싸기
|
|
691
691
|
};
|
|
692
|
-
h(
|
|
693
|
-
let
|
|
694
|
-
var
|
|
695
|
-
const
|
|
692
|
+
h(Ut, "TableCompiler");
|
|
693
|
+
let pe = Ut;
|
|
694
|
+
var F, Ct, mt, rs, os;
|
|
695
|
+
const De = class De {
|
|
696
|
+
constructor(n) {
|
|
697
|
+
d(this, mt);
|
|
698
|
+
d(this, F);
|
|
699
|
+
d(this, Ct, { startRow: -1, startCol: -1, endRow: -1, endCol: -1 });
|
|
700
|
+
// 3. 뷰 렌더링 (9분할 전체를 순회하며 경계선 클래스 부여)
|
|
701
|
+
E(this, "render", /* @__PURE__ */ h(() => {
|
|
702
|
+
const { startRow: n, startCol: e, endRow: s, endCol: r } = t(this, Ct);
|
|
703
|
+
t(this, F).querySelectorAll(
|
|
704
|
+
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
705
|
+
).forEach((i) => {
|
|
706
|
+
i.querySelectorAll(".selected, .selected-top, .selected-bottom, .selected-left, .selected-right").forEach((a) => {
|
|
707
|
+
a.classList.remove("selected", "selected-top", "selected-bottom", "selected-left", "selected-right");
|
|
708
|
+
}), !(n < 0) && i.querySelectorAll("tbody tr").forEach((a) => {
|
|
709
|
+
const c = parseInt(a.dataset.row, 10);
|
|
710
|
+
isNaN(c) || a.querySelectorAll("td, th").forEach((l) => {
|
|
711
|
+
const f = parseInt(l.dataset.col, 10);
|
|
712
|
+
if (isNaN(f)) return;
|
|
713
|
+
const g = parseInt(l.rowSpan || 1, 10), b = parseInt(l.colSpan || 1, 10), u = c + g - 1, y = f + b - 1;
|
|
714
|
+
c <= s && u >= n && f <= r && y >= e && (l.classList.add("selected"), c === n && l.classList.add("selected-top"), u === s && l.classList.add("selected-bottom"), f === e && l.classList.add("selected-left"), y === r && l.classList.add("selected-right"));
|
|
715
|
+
});
|
|
716
|
+
});
|
|
717
|
+
});
|
|
718
|
+
}, "render"));
|
|
719
|
+
p(this, F, n), de(this, mt, os).call(this);
|
|
720
|
+
}
|
|
721
|
+
setRange(n, e, s, r) {
|
|
722
|
+
let o = Math.min(n, s), i = Math.max(n, s), a = Math.min(e, r), c = Math.max(e, r);
|
|
723
|
+
const l = de(this, mt, rs).call(this, o, a, i, c);
|
|
724
|
+
p(this, Ct, l), this.render();
|
|
725
|
+
}
|
|
726
|
+
};
|
|
727
|
+
F = new WeakMap(), Ct = new WeakMap(), mt = new WeakSet(), // 머지된 셀이 선택 영역에 걸쳐있으면 범위를 자동으로 넓혀주는 보정기
|
|
728
|
+
rs = /* @__PURE__ */ h(function(n, e, s, r) {
|
|
729
|
+
let o = n, i = e, a = s, c = r, l = !0;
|
|
730
|
+
const f = t(this, F).querySelectorAll(
|
|
731
|
+
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
732
|
+
);
|
|
733
|
+
for (; l; )
|
|
734
|
+
l = !1, f.forEach((g) => {
|
|
735
|
+
g.querySelectorAll("tbody tr").forEach((b) => {
|
|
736
|
+
const u = parseInt(b.dataset.row, 10);
|
|
737
|
+
isNaN(u) || b.querySelectorAll("td, th").forEach((y) => {
|
|
738
|
+
const x = parseInt(y.dataset.col, 10);
|
|
739
|
+
if (isNaN(x)) return;
|
|
740
|
+
const A = parseInt(y.rowSpan || 1, 10), v = parseInt(y.colSpan || 1, 10), M = u + A - 1, q = x + v - 1;
|
|
741
|
+
if (u <= a && M >= o && x <= c && q >= i) {
|
|
742
|
+
const j = Math.min(o, u), Je = Math.max(a, M), Qe = Math.min(i, x), ts = Math.max(c, q);
|
|
743
|
+
(j !== o || Je !== a || Qe !== i || ts !== c) && (o = j, a = Je, i = Qe, c = ts, l = !0);
|
|
744
|
+
}
|
|
745
|
+
});
|
|
746
|
+
});
|
|
747
|
+
});
|
|
748
|
+
return { startRow: o, startCol: i, endRow: a, endCol: c };
|
|
749
|
+
}, "#expandRangeByMerge"), os = /* @__PURE__ */ h(function() {
|
|
750
|
+
const n = this.selector ? t(this, F).querySelector(".ng-container-top") : t(this, F).querySelector(".ng-container-top");
|
|
751
|
+
n && n.addEventListener("mousedown", (e) => {
|
|
752
|
+
const s = e.target.closest("td, th");
|
|
753
|
+
if (!s || s.dataset.row === void 0 || s.dataset.col === void 0 || s.closest("tr").classList.contains("nodata")) return;
|
|
754
|
+
const r = parseInt(s.dataset.row, 10), o = parseInt(s.dataset.col, 10);
|
|
755
|
+
this.setRange(r, o, r, o);
|
|
756
|
+
const i = /* @__PURE__ */ h((c) => {
|
|
757
|
+
const l = document.elementFromPoint(c.clientX, c.clientY), f = l == null ? void 0 : l.closest("td, th");
|
|
758
|
+
if (!f || !t(this, F).contains(f) || f.dataset.row === void 0 || f.dataset.col === void 0 || f.closest("tr").classList.contains("nodata")) return;
|
|
759
|
+
const g = parseInt(f.dataset.row, 10), b = parseInt(f.dataset.col, 10);
|
|
760
|
+
this.setRange(r, o, g, b);
|
|
761
|
+
}, "onMouseMove"), a = /* @__PURE__ */ h(() => {
|
|
762
|
+
document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", a);
|
|
763
|
+
}, "onMouseUp");
|
|
764
|
+
document.addEventListener("mousemove", i), document.addEventListener("mouseup", a);
|
|
765
|
+
});
|
|
766
|
+
}, "#initEvents"), h(De, "CellSelection");
|
|
767
|
+
let ye = De;
|
|
768
|
+
var Xt, nt, rt, Lt, Kt, Zt, dt, Gt, Jt;
|
|
769
|
+
const vt = class vt extends HTMLElement {
|
|
696
770
|
constructor() {
|
|
697
771
|
super();
|
|
698
|
-
d(this,
|
|
699
|
-
d(this,
|
|
700
|
-
d(this,
|
|
772
|
+
d(this, Xt);
|
|
773
|
+
d(this, nt, null);
|
|
774
|
+
d(this, rt);
|
|
775
|
+
d(this, Lt);
|
|
701
776
|
E(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
702
|
-
|
|
777
|
+
T.log("sheet.invalidate()"), t(this, rt).refresh();
|
|
703
778
|
}, "invalidate"));
|
|
704
779
|
E(this, "generate", /* @__PURE__ */ h((e) => {
|
|
705
|
-
if (
|
|
706
|
-
|
|
707
|
-
const s = this.querySelector(".ng-container-body .ng-part-header"),
|
|
708
|
-
s &&
|
|
709
|
-
var
|
|
710
|
-
(
|
|
780
|
+
if (T.log("sheet.generate()"), !e) return;
|
|
781
|
+
p(this, nt, pe.compile(e)), t(this, Kt).call(this), t(this, Zt).call(this);
|
|
782
|
+
const s = this.querySelector(".ng-container-body .ng-part-header"), r = this.querySelector(".ng-container-body .ng-part-footer"), o = this.querySelector(".ng-nodata-overlay");
|
|
783
|
+
s && o && (o.style.top = `${s.offsetHeight}px`), r && o && (o.style.bottom = `${r.offsetHeight}px`), t(this, rt).initialize(), setTimeout(() => {
|
|
784
|
+
var i;
|
|
785
|
+
(i = this.querySelector("nine-table-hscrollbar")) == null || i.refresh();
|
|
711
786
|
}, 0);
|
|
712
787
|
}, "generate"));
|
|
713
|
-
d(this,
|
|
788
|
+
d(this, Kt, /* @__PURE__ */ h(() => {
|
|
714
789
|
[
|
|
715
790
|
{ selector: ".ng-container-body", type: null },
|
|
716
791
|
{ selector: ".ng-container-left", type: "left" },
|
|
717
792
|
{ selector: ".ng-container-right", type: "right" }
|
|
718
|
-
].forEach(({ selector: s, type:
|
|
719
|
-
var
|
|
720
|
-
(
|
|
793
|
+
].forEach(({ selector: s, type: r }) => {
|
|
794
|
+
var o, i, a;
|
|
795
|
+
(o = this.querySelector(`${s} .ng-part-header`)) == null || o.appendChild(t(this, dt).call(this, t(this, nt), r, "header")), (i = this.querySelector(`${s} .ng-virtual-spacer`)) == null || i.before(t(this, dt).call(this, t(this, nt), r, "body")), (a = this.querySelector(`${s} .ng-part-footer`)) == null || a.appendChild(t(this, dt).call(this, t(this, nt), r, "footer"));
|
|
721
796
|
});
|
|
722
797
|
}, "#renderSplitContainers"));
|
|
723
|
-
d(this,
|
|
798
|
+
d(this, Zt, /* @__PURE__ */ h(() => {
|
|
724
799
|
["left", "right", "body"].forEach((e) => {
|
|
725
|
-
const s = this.querySelector(`.ng-container-${e}`),
|
|
726
|
-
if (!s || !
|
|
727
|
-
let
|
|
728
|
-
|
|
729
|
-
const a = parseInt(
|
|
730
|
-
isNaN(
|
|
731
|
-
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${
|
|
800
|
+
const s = this.querySelector(`.ng-container-${e}`), r = s == null ? void 0 : s.querySelectorAll("table");
|
|
801
|
+
if (!s || !r || r.length === 0) return;
|
|
802
|
+
let o = 0;
|
|
803
|
+
r[0].querySelectorAll("col").forEach((i) => {
|
|
804
|
+
const a = parseInt(i.getAttribute("width"), 10);
|
|
805
|
+
isNaN(o) || (o += a);
|
|
806
|
+
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${o}px`, s.style.width = `${o}px`);
|
|
732
807
|
});
|
|
733
808
|
}, "#updateContainerWidths"));
|
|
734
|
-
d(this,
|
|
735
|
-
const
|
|
736
|
-
if (
|
|
809
|
+
d(this, dt, /* @__PURE__ */ h((e, s, r) => {
|
|
810
|
+
const o = e.cloneNode(!0), i = o.querySelector("thead"), a = o.querySelector("tbody"), c = o.querySelector("tfoot");
|
|
811
|
+
if (r === "header") {
|
|
737
812
|
if (a && a.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
738
813
|
const f = document.createElement("tbody");
|
|
739
|
-
f.className = "fixed-tbody",
|
|
814
|
+
f.className = "fixed-tbody", o.appendChild(f);
|
|
740
815
|
}
|
|
741
|
-
} else
|
|
742
|
-
return s === "left" ?
|
|
816
|
+
} else r === "body" ? (i && i.remove(), c && c.remove(), a && (a.className = "bindable-tbody")) : r === "footer" && (i && i.remove(), a && a.remove());
|
|
817
|
+
return s === "left" ? o.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
743
818
|
l.getAttribute("fixed") !== "left" && l.remove();
|
|
744
|
-
}) : s === "right" ?
|
|
819
|
+
}) : s === "right" ? o.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
745
820
|
l.getAttribute("fixed") !== "right" && l.remove();
|
|
746
|
-
}) :
|
|
821
|
+
}) : o.querySelectorAll("[fixed=left], [fixed=right]").forEach((l) => {
|
|
747
822
|
l.remove();
|
|
748
|
-
}),
|
|
823
|
+
}), o;
|
|
749
824
|
}, "#createSplitTable"));
|
|
750
|
-
E(this, "getRowHeight", /* @__PURE__ */ h(() => t(this,
|
|
825
|
+
E(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, rt).getRowHeight(), "getRowHeight"));
|
|
751
826
|
E(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
752
827
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
753
828
|
s && (s.scrollLeft = e);
|
|
@@ -756,11 +831,11 @@ const pt = class pt extends HTMLElement {
|
|
|
756
831
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
757
832
|
s && (s.scrollTop = e);
|
|
758
833
|
}, "scrollToY"));
|
|
759
|
-
d(this,
|
|
760
|
-
t(this,
|
|
834
|
+
d(this, Gt, /* @__PURE__ */ h(() => {
|
|
835
|
+
t(this, Jt).call(this);
|
|
761
836
|
}, "#init"));
|
|
762
|
-
d(this,
|
|
763
|
-
const e =
|
|
837
|
+
d(this, Jt, /* @__PURE__ */ h(() => {
|
|
838
|
+
const e = vt.SCROLLBAR_SIZE;
|
|
764
839
|
this.innerHTML = `
|
|
765
840
|
<style>
|
|
766
841
|
nine-table-sheet {
|
|
@@ -907,6 +982,16 @@ const pt = class pt extends HTMLElement {
|
|
|
907
982
|
--display: none;
|
|
908
983
|
}
|
|
909
984
|
|
|
985
|
+
nine-table-sheet td.selected,
|
|
986
|
+
nine-table-sheet th.selected {
|
|
987
|
+
background-color: rgba(37, 99, 235, 0.08); /* 은은한 선택 배경 */
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
/* 외곽 경계선에만 적용되는 단단한 테두리 */
|
|
991
|
+
nine-table-sheet td.selected-top { border-top: 2px solid #2563eb !important; }
|
|
992
|
+
nine-table-sheet td.selected-bottom { border-bottom: 2px solid #2563eb !important; }
|
|
993
|
+
nine-table-sheet td.selected-left { border-left: 2px solid #2563eb !important; }
|
|
994
|
+
nine-table-sheet td.selected-right { border-right: 2px solid #2563eb !important; }
|
|
910
995
|
</style>
|
|
911
996
|
|
|
912
997
|
<div class='ng-container-top'>
|
|
@@ -950,40 +1035,43 @@ const pt = class pt extends HTMLElement {
|
|
|
950
1035
|
</div>
|
|
951
1036
|
`;
|
|
952
1037
|
}, "#render"));
|
|
953
|
-
|
|
1038
|
+
p(this, rt, new be(this)), p(this, Lt, new ye(this)), p(this, Xt, this.getRootNode().host);
|
|
954
1039
|
}
|
|
955
1040
|
connectedCallback() {
|
|
956
|
-
t(this,
|
|
1041
|
+
t(this, Gt).call(this);
|
|
1042
|
+
}
|
|
1043
|
+
get selection() {
|
|
1044
|
+
return t(this, Lt);
|
|
957
1045
|
}
|
|
958
1046
|
disconnectedCallback() {
|
|
959
|
-
this.innerHTML = "",
|
|
1047
|
+
this.innerHTML = "", T.log("NineTableSheet destroyed.");
|
|
960
1048
|
}
|
|
961
1049
|
};
|
|
962
|
-
|
|
963
|
-
let
|
|
964
|
-
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet",
|
|
965
|
-
var
|
|
966
|
-
const
|
|
1050
|
+
Xt = new WeakMap(), nt = new WeakMap(), rt = new WeakMap(), Lt = new WeakMap(), Kt = new WeakMap(), Zt = new WeakMap(), dt = new WeakMap(), Gt = new WeakMap(), Jt = new WeakMap(), h(vt, "NineTableSheet"), E(vt, "SCROLLBAR_SIZE", 16);
|
|
1051
|
+
let Ot = vt;
|
|
1052
|
+
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", Ot);
|
|
1053
|
+
var Qt, Ht;
|
|
1054
|
+
const Fe = class Fe extends HTMLElement {
|
|
967
1055
|
constructor() {
|
|
968
1056
|
super();
|
|
969
|
-
d(this,
|
|
1057
|
+
d(this, Qt, /* @__PURE__ */ h(() => {
|
|
970
1058
|
var e;
|
|
971
1059
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
972
|
-
var
|
|
973
|
-
const
|
|
974
|
-
t(this,
|
|
975
|
-
}), t(this,
|
|
1060
|
+
var i;
|
|
1061
|
+
const r = s.ctrlKey || s.metaKey || s.shiftKey, o = parseInt((i = s.target.closest(".nine-tab-item")) == null ? void 0 : i.dataset.index, 10);
|
|
1062
|
+
t(this, Ht).call(this, o, r);
|
|
1063
|
+
}), t(this, Ht).call(this, 0, !1);
|
|
976
1064
|
}, "#init"));
|
|
977
|
-
d(this,
|
|
978
|
-
const
|
|
1065
|
+
d(this, Ht, /* @__PURE__ */ h((e, s = !1) => {
|
|
1066
|
+
const r = /* @__PURE__ */ h(() => {
|
|
979
1067
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
980
1068
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((u) => u.style.setProperty("display", "none"));
|
|
981
1069
|
const b = f.filter((u) => u.classList.contains("active"));
|
|
982
1070
|
b.length < 2 || b.forEach((u) => {
|
|
983
|
-
const
|
|
984
|
-
|
|
1071
|
+
const y = parseInt(u.getAttribute("data-index"), 10), x = this.querySelector(`nine-splitter[data-split-index="${y}"]`), A = f[y + 1];
|
|
1072
|
+
x && A && A.classList.contains("active") && x.style.setProperty("display", "flex");
|
|
985
1073
|
});
|
|
986
|
-
}, "updateSplitters"),
|
|
1074
|
+
}, "updateSplitters"), o = this.querySelector(".nine-tab-bar"), i = this.querySelector("nine-table-sheets-body"), a = o.querySelectorAll(".nine-tab-item"), c = i.querySelectorAll("nine-table-sheet");
|
|
987
1075
|
if (!a[e]) return;
|
|
988
1076
|
if (!s)
|
|
989
1077
|
a.forEach((f, g) => {
|
|
@@ -993,49 +1081,49 @@ const _e = class _e extends HTMLElement {
|
|
|
993
1081
|
f.classList.toggle("active", b), f.style.flex = b ? "1 1 100%" : "";
|
|
994
1082
|
});
|
|
995
1083
|
else {
|
|
996
|
-
const f = a[e], g =
|
|
1084
|
+
const f = a[e], g = o.querySelectorAll(".nine-tab-item.active");
|
|
997
1085
|
if (f.classList.contains("active") && g.length <= 1)
|
|
998
1086
|
return;
|
|
999
1087
|
f.classList.toggle("active");
|
|
1000
|
-
const b =
|
|
1088
|
+
const b = i.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
1001
1089
|
b && (b.classList.toggle("active"), b.classList.contains("active") || (b.style.flex = ""));
|
|
1002
1090
|
}
|
|
1003
|
-
const l =
|
|
1091
|
+
const l = i.querySelectorAll("nine-table-sheet.active");
|
|
1004
1092
|
l == null || l.forEach((f) => {
|
|
1005
1093
|
f.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
1006
|
-
}),
|
|
1094
|
+
}), r();
|
|
1007
1095
|
}, "#switchSheet"));
|
|
1008
1096
|
}
|
|
1009
1097
|
connectedCallback() {
|
|
1010
|
-
t(this,
|
|
1098
|
+
t(this, Qt).call(this);
|
|
1011
1099
|
}
|
|
1012
1100
|
};
|
|
1013
|
-
|
|
1014
|
-
let
|
|
1015
|
-
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets",
|
|
1016
|
-
var
|
|
1017
|
-
const
|
|
1018
|
-
constructor(
|
|
1019
|
-
d(this,
|
|
1020
|
-
d(this,
|
|
1021
|
-
t(this,
|
|
1022
|
-
for (let e of
|
|
1023
|
-
t(this,
|
|
1024
|
-
}).observe(t(this,
|
|
1101
|
+
Qt = new WeakMap(), Ht = new WeakMap(), h(Fe, "NineTableSheets");
|
|
1102
|
+
let me = Fe;
|
|
1103
|
+
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", me);
|
|
1104
|
+
var I, te, Mt, ee;
|
|
1105
|
+
const je = class je {
|
|
1106
|
+
constructor(n) {
|
|
1107
|
+
d(this, I);
|
|
1108
|
+
d(this, te, /* @__PURE__ */ h(() => {
|
|
1109
|
+
t(this, ee).call(this), new ResizeObserver((n) => {
|
|
1110
|
+
for (let e of n)
|
|
1111
|
+
t(this, I).getAttribute("auto-height") === "true" && t(this, Mt).call(this);
|
|
1112
|
+
}).observe(t(this, I));
|
|
1025
1113
|
}, "#init"));
|
|
1026
|
-
d(this,
|
|
1114
|
+
d(this, Mt, /* @__PURE__ */ h(() => {
|
|
1027
1115
|
var c, l;
|
|
1028
|
-
const
|
|
1029
|
-
if (
|
|
1030
|
-
const e = parseInt(t(this,
|
|
1031
|
-
t(this,
|
|
1116
|
+
const n = Array.from(t(this, I).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
1117
|
+
if (n.length === 0) return;
|
|
1118
|
+
const e = parseInt(t(this, I).getAttribute("max-display-row"), 10) || 10, s = Math.max(...n.map((f) => f.getRowHeight())), r = (c = t(this, I).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, o = (l = t(this, I).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, i = Ot.SCROLLBAR_SIZE, a = e * s + r + o + i;
|
|
1119
|
+
t(this, I).style.height = `${a}px`;
|
|
1032
1120
|
}, "#applyAutoHeight"));
|
|
1033
|
-
d(this,
|
|
1034
|
-
const e = Array.from(t(this,
|
|
1035
|
-
const g = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, b = l <
|
|
1121
|
+
d(this, ee, /* @__PURE__ */ h(() => {
|
|
1122
|
+
const e = Array.from(t(this, I).children).filter((c) => c.tagName === "TABLE"), s = t(this, I).getAttribute("auto-height") === "true", r = e.length, o = e.map((c, l) => {
|
|
1123
|
+
const g = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, b = l < r - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
1036
1124
|
return g + b;
|
|
1037
|
-
}).join(""),
|
|
1038
|
-
t(this,
|
|
1125
|
+
}).join(""), i = e.map((c, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
1126
|
+
t(this, I).shadowRoot.innerHTML = `
|
|
1039
1127
|
<style>
|
|
1040
1128
|
:host {
|
|
1041
1129
|
display: flex;
|
|
@@ -1146,190 +1234,190 @@ const Ne = class Ne {
|
|
|
1146
1234
|
<nine-table-body>
|
|
1147
1235
|
<nine-table-summary></nine-table-summary>
|
|
1148
1236
|
<nine-table-sheets>
|
|
1149
|
-
<nine-table-sheets-body>${
|
|
1237
|
+
<nine-table-sheets-body>${o}</nine-table-sheets-body>
|
|
1150
1238
|
<nine-table-sheets-footer>
|
|
1151
|
-
<div class="nine-tab-bar">${
|
|
1239
|
+
<div class="nine-tab-bar">${i}</div>
|
|
1152
1240
|
<div class="sheets-counter">Total : <span id="row-count">0</span></div>
|
|
1153
1241
|
</nine-table-sheets-footer>
|
|
1154
1242
|
</nine-table-sheets>
|
|
1155
1243
|
<nine-table-analysis></nine-table-analysis>
|
|
1156
1244
|
</nine-table-body>
|
|
1157
1245
|
<nine-table-footer></nine-table-footer>
|
|
1158
|
-
`, t(this,
|
|
1159
|
-
const a = t(this,
|
|
1246
|
+
`, t(this, I).shadowRoot.querySelector("nine-table-sheets").classList.add("nodata");
|
|
1247
|
+
const a = t(this, I).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1160
1248
|
a == null || a.forEach((c, l) => {
|
|
1161
1249
|
e[l] && setTimeout(() => {
|
|
1162
|
-
c.generate(e[l]), s && t(this,
|
|
1250
|
+
c.generate(e[l]), s && t(this, Mt).call(this);
|
|
1163
1251
|
});
|
|
1164
1252
|
});
|
|
1165
1253
|
}, "#render"));
|
|
1166
|
-
|
|
1254
|
+
p(this, I, n), t(this, te).call(this);
|
|
1167
1255
|
}
|
|
1168
1256
|
};
|
|
1169
|
-
|
|
1170
|
-
let
|
|
1171
|
-
var
|
|
1172
|
-
const
|
|
1173
|
-
constructor(
|
|
1174
|
-
d(this,
|
|
1175
|
-
d(this,
|
|
1176
|
-
E(this, "count", /* @__PURE__ */ h(() => t(this,
|
|
1177
|
-
|
|
1257
|
+
I = new WeakMap(), te = new WeakMap(), Mt = new WeakMap(), ee = new WeakMap(), h(je, "LayoutManager");
|
|
1258
|
+
let ve = je;
|
|
1259
|
+
var It, ft;
|
|
1260
|
+
const Ve = class Ve {
|
|
1261
|
+
constructor(n) {
|
|
1262
|
+
d(this, It);
|
|
1263
|
+
d(this, ft, -1);
|
|
1264
|
+
E(this, "count", /* @__PURE__ */ h(() => t(this, It).rawRecords.length, "count"));
|
|
1265
|
+
p(this, It, n);
|
|
1178
1266
|
}
|
|
1179
1267
|
get at() {
|
|
1180
|
-
return t(this,
|
|
1268
|
+
return t(this, ft);
|
|
1181
1269
|
}
|
|
1182
|
-
set at(
|
|
1183
|
-
|
|
1270
|
+
set at(n) {
|
|
1271
|
+
p(this, ft, parseInt(n, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, ft)}"]`) && setTimeout(() => {
|
|
1184
1272
|
});
|
|
1185
1273
|
}
|
|
1186
1274
|
};
|
|
1187
|
-
|
|
1188
|
-
let
|
|
1189
|
-
var
|
|
1275
|
+
It = new WeakMap(), ft = new WeakMap(), h(Ve, "ngRow");
|
|
1276
|
+
let xe = Ve;
|
|
1277
|
+
var N, C, W, ut, se, U, ne, ot, $t, re, oe, gt;
|
|
1190
1278
|
const B = class B {
|
|
1191
|
-
constructor(
|
|
1192
|
-
d(this,
|
|
1279
|
+
constructor(n, e) {
|
|
1280
|
+
d(this, N);
|
|
1193
1281
|
d(this, C);
|
|
1194
|
-
d(this,
|
|
1195
|
-
d(this,
|
|
1196
|
-
d(this,
|
|
1197
|
-
d(this,
|
|
1198
|
-
d(this,
|
|
1199
|
-
|
|
1200
|
-
const
|
|
1201
|
-
Array.from(
|
|
1282
|
+
d(this, W, []);
|
|
1283
|
+
d(this, ut, []);
|
|
1284
|
+
d(this, se, 0);
|
|
1285
|
+
d(this, U, []);
|
|
1286
|
+
d(this, ne, /* @__PURE__ */ h(() => {
|
|
1287
|
+
p(this, U, []);
|
|
1288
|
+
const n = t(this, N).template || [];
|
|
1289
|
+
Array.from(n).forEach((e) => {
|
|
1202
1290
|
var s;
|
|
1203
|
-
t(this,
|
|
1291
|
+
t(this, U).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1204
1292
|
}), (t(this, C).rawRecords || []).forEach((e) => {
|
|
1205
|
-
e.__ng || (e.__ng = t(this,
|
|
1293
|
+
e.__ng || (e.__ng = t(this, $t).call(this)), e.__ng.height = t(this, U).slice();
|
|
1206
1294
|
});
|
|
1207
1295
|
}, "#initialize"));
|
|
1208
|
-
d(this,
|
|
1209
|
-
const
|
|
1210
|
-
|
|
1296
|
+
d(this, ot, /* @__PURE__ */ h(() => {
|
|
1297
|
+
const n = t(this, N).shadowRoot.querySelector("nine-table-sheets");
|
|
1298
|
+
n == null || n.classList.toggle("nodata", this.length === 0), t(this, N).shadowRoot.querySelectorAll("nine-table-sheet").forEach((e) => {
|
|
1211
1299
|
e.invalidate();
|
|
1212
1300
|
});
|
|
1213
1301
|
}, "#invalidate"));
|
|
1214
|
-
E(this, "get", /* @__PURE__ */ h((
|
|
1215
|
-
var
|
|
1302
|
+
E(this, "get", /* @__PURE__ */ h((n, e) => {
|
|
1303
|
+
var o;
|
|
1216
1304
|
const s = this.getValidData();
|
|
1217
1305
|
if (!s || s.length <= 0) return;
|
|
1218
|
-
if (
|
|
1219
|
-
if (
|
|
1220
|
-
const
|
|
1306
|
+
if (n == null) return t(this, gt).call(this, s);
|
|
1307
|
+
if (n < 0 || n >= s.length) return null;
|
|
1308
|
+
const r = typeof ((o = t(this, N).fields) == null ? void 0 : o.get) == "function" ? t(this, N).fields.get() : [];
|
|
1221
1309
|
if (e != null) {
|
|
1222
|
-
const
|
|
1223
|
-
return
|
|
1310
|
+
const i = r.indexOf(e);
|
|
1311
|
+
return i >= 0 ? s[n].v[i] : null;
|
|
1224
1312
|
}
|
|
1225
|
-
return t(this,
|
|
1313
|
+
return t(this, gt).call(this, s[n]);
|
|
1226
1314
|
}, "get"));
|
|
1227
|
-
E(this, "set", /* @__PURE__ */ h((
|
|
1228
|
-
this.clear(), this.add(
|
|
1315
|
+
E(this, "set", /* @__PURE__ */ h((n) => {
|
|
1316
|
+
this.clear(), this.add(n, !1), t(this, ot).call(this);
|
|
1229
1317
|
}, "set"));
|
|
1230
|
-
d(this,
|
|
1318
|
+
d(this, $t, /* @__PURE__ */ h(() => ({
|
|
1231
1319
|
rowState: B.ROW_STATE.EMPTY,
|
|
1232
1320
|
deleted: !1,
|
|
1233
1321
|
filtered: !1,
|
|
1234
|
-
height: t(this,
|
|
1322
|
+
height: t(this, U).slice(),
|
|
1235
1323
|
o: {},
|
|
1236
1324
|
c: {},
|
|
1237
|
-
_: [0, 0, 0, 0, B.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this,
|
|
1325
|
+
_: [0, 0, 0, 0, B.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, U).slice(), -1, {}, {}]
|
|
1238
1326
|
}), "#getDefaultMeta"));
|
|
1239
1327
|
E(this, "reset", /* @__PURE__ */ h(() => {
|
|
1240
|
-
|
|
1328
|
+
p(this, W, []), p(this, ut, []), t(this, ot).call(this);
|
|
1241
1329
|
}, "reset"));
|
|
1242
1330
|
E(this, "clear", /* @__PURE__ */ h(() => {
|
|
1243
|
-
var
|
|
1244
|
-
t(this, C).rawRecords = [],
|
|
1331
|
+
var n;
|
|
1332
|
+
t(this, C).rawRecords = [], p(this, W, []), p(this, ut, []), (n = t(this, C).viewRecords) != null && n.reset && t(this, C).viewRecords.reset();
|
|
1245
1333
|
}, "clear"));
|
|
1246
|
-
d(this,
|
|
1247
|
-
var
|
|
1248
|
-
Array.isArray(
|
|
1249
|
-
const e = typeof ((
|
|
1250
|
-
return
|
|
1251
|
-
const
|
|
1334
|
+
d(this, re, /* @__PURE__ */ h((n) => {
|
|
1335
|
+
var r;
|
|
1336
|
+
Array.isArray(n) || (n = [n]);
|
|
1337
|
+
const e = typeof ((r = t(this, N).fields) == null ? void 0 : r.get) == "function" ? t(this, N).fields.get() : Object.keys(n[0] || {}), s = [];
|
|
1338
|
+
return n.forEach((o) => {
|
|
1339
|
+
const i = { v: [] };
|
|
1252
1340
|
e.forEach((a) => {
|
|
1253
|
-
|
|
1254
|
-
}), s.push(
|
|
1341
|
+
i.v.push(o[a] !== void 0 && o[a] !== null ? o[a] : "");
|
|
1342
|
+
}), s.push(i);
|
|
1255
1343
|
}), s;
|
|
1256
1344
|
}, "#json2Array"));
|
|
1257
|
-
d(this,
|
|
1258
|
-
e.__ng = t(this,
|
|
1259
|
-
}),
|
|
1260
|
-
E(this, "add", /* @__PURE__ */ h((
|
|
1261
|
-
|
|
1262
|
-
const s = t(this,
|
|
1263
|
-
t(this, C).rawRecords = t(this, C).rawRecords.concat(t(this,
|
|
1264
|
-
const
|
|
1265
|
-
return e || s.forEach((
|
|
1266
|
-
const a = t(this, C).rawRecords[
|
|
1345
|
+
d(this, oe, /* @__PURE__ */ h((n) => (Array.isArray(n) || (n = [n]), n.forEach((e) => {
|
|
1346
|
+
e.__ng = t(this, $t).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = B.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1347
|
+
}), n), "#defaultInsert"));
|
|
1348
|
+
E(this, "add", /* @__PURE__ */ h((n, e = !0) => {
|
|
1349
|
+
n === void 0 && (n = {});
|
|
1350
|
+
const s = t(this, re).call(this, n);
|
|
1351
|
+
t(this, C).rawRecords = t(this, C).rawRecords.concat(t(this, oe).call(this, s)), this.resetRecords();
|
|
1352
|
+
const r = this.count() - 1;
|
|
1353
|
+
return e || s.forEach((o, i) => {
|
|
1354
|
+
const a = t(this, C).rawRecords[r - i];
|
|
1267
1355
|
a && (a.__ng.rowState = B.ROW_STATE.EMPTY);
|
|
1268
|
-
}), t(this,
|
|
1356
|
+
}), t(this, ot).call(this), r;
|
|
1269
1357
|
}, "add"));
|
|
1270
|
-
E(this, "delete", /* @__PURE__ */ h((
|
|
1358
|
+
E(this, "delete", /* @__PURE__ */ h((n) => {
|
|
1271
1359
|
let e = [];
|
|
1272
|
-
Array.isArray(
|
|
1273
|
-
if (t(this,
|
|
1274
|
-
const
|
|
1275
|
-
t(this,
|
|
1276
|
-
|
|
1360
|
+
Array.isArray(n) ? e = n : typeof n > "u" ? e = [t(this, C).host.row.at] : e = [parseInt(n, 10)], e.sort((s, r) => r - s).forEach((s) => {
|
|
1361
|
+
if (t(this, W)[s]) {
|
|
1362
|
+
const r = t(this, W)[s].__ng.rowid;
|
|
1363
|
+
t(this, W)[s].__ng.rowState === B.ROW_STATE.INSERT ? t(this, C).rawRecords = t(this, C).rawRecords.filter((o) => o.__ng.rowid !== r) : t(this, C).rawRecords.forEach((o) => {
|
|
1364
|
+
o.__ng.rowid === r && (o.__ng.deleted = !0, o.__ng.rowState = B.ROW_STATE.DELETE);
|
|
1277
1365
|
});
|
|
1278
1366
|
}
|
|
1279
|
-
}), this.resetRecords(), t(this,
|
|
1367
|
+
}), this.resetRecords(), t(this, ot).call(this);
|
|
1280
1368
|
}, "delete"));
|
|
1281
|
-
E(this, "setValue", /* @__PURE__ */ h((
|
|
1369
|
+
E(this, "setValue", /* @__PURE__ */ h((n, e, s) => {
|
|
1282
1370
|
var c;
|
|
1283
|
-
|
|
1284
|
-
const
|
|
1285
|
-
if (
|
|
1286
|
-
const
|
|
1287
|
-
if (!
|
|
1288
|
-
const a =
|
|
1289
|
-
a !== s &&
|
|
1371
|
+
n = parseInt(n, 10);
|
|
1372
|
+
const o = (typeof ((c = t(this, N).fields) == null ? void 0 : c.get) == "function" ? t(this, N).fields.get() : []).indexOf(e);
|
|
1373
|
+
if (o < 0) return;
|
|
1374
|
+
const i = this.getValidData()[n];
|
|
1375
|
+
if (!i) return;
|
|
1376
|
+
const a = i.v[o];
|
|
1377
|
+
a !== s && i.__ng.rowState !== B.ROW_STATE.INSERT && (i.__ng.o.hasOwnProperty(e) || (i.__ng.o[e] = a), i.__ng.rowState = B.ROW_STATE.UPDATE), i.v[o] = s;
|
|
1290
1378
|
}, "setValue"));
|
|
1291
1379
|
E(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
}), t(this,
|
|
1295
|
-
|
|
1380
|
+
p(this, ut, t(this, C).rawRecords.filter((n) => !n.__ng.deleted)), p(this, W, t(this, C).rawRecords.filter((n) => !n.__ng.deleted && !n.__ng.filtered)), t(this, C).rawRecords.forEach((n, e) => {
|
|
1381
|
+
n.__ng.rowidx = e;
|
|
1382
|
+
}), t(this, W).forEach((n, e) => {
|
|
1383
|
+
n.__ng.i = e;
|
|
1296
1384
|
});
|
|
1297
1385
|
}, "resetRecords"));
|
|
1298
|
-
E(this, "getValidData", /* @__PURE__ */ h(() => (t(this,
|
|
1299
|
-
d(this,
|
|
1300
|
-
var
|
|
1301
|
-
if (!
|
|
1302
|
-
const e = !Array.isArray(
|
|
1386
|
+
E(this, "getValidData", /* @__PURE__ */ h(() => (t(this, W).length === 0 && t(this, C).rawRecords.length > 0 && this.resetRecords(), t(this, W)), "getValidData"));
|
|
1387
|
+
d(this, gt, /* @__PURE__ */ h((n) => {
|
|
1388
|
+
var i;
|
|
1389
|
+
if (!n) return n;
|
|
1390
|
+
const e = !Array.isArray(n), s = e ? [n] : n, r = typeof ((i = t(this, N).fields) == null ? void 0 : i.get) == "function" ? t(this, N).fields.get() : [], o = s.filter((a) => !a.__ng.deleted).map((a) => {
|
|
1303
1391
|
const c = {};
|
|
1304
|
-
return
|
|
1392
|
+
return r.forEach((l, f) => {
|
|
1305
1393
|
c[l] = a.v ? a.v[f] : a[l];
|
|
1306
1394
|
}), c.__ng = a.__ng, c;
|
|
1307
1395
|
});
|
|
1308
|
-
return e ?
|
|
1396
|
+
return e ? o[0] : o;
|
|
1309
1397
|
}, "#conv"));
|
|
1310
1398
|
E(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1311
|
-
|
|
1399
|
+
p(this, N, n), p(this, C, e), t(this, ne).call(this);
|
|
1312
1400
|
}
|
|
1313
1401
|
get source() {
|
|
1314
|
-
return t(this,
|
|
1402
|
+
return t(this, gt).call(this, t(this, C).rawRecords);
|
|
1315
1403
|
}
|
|
1316
|
-
set source(
|
|
1317
|
-
this.clear(), this.add(
|
|
1404
|
+
set source(n) {
|
|
1405
|
+
this.clear(), this.add(n, !1);
|
|
1318
1406
|
}
|
|
1319
1407
|
get nextId() {
|
|
1320
|
-
return ++
|
|
1408
|
+
return ++ns(this, se)._;
|
|
1321
1409
|
}
|
|
1322
1410
|
get count() {
|
|
1323
|
-
return t(this,
|
|
1411
|
+
return t(this, W).length;
|
|
1324
1412
|
}
|
|
1325
1413
|
get length() {
|
|
1326
|
-
return t(this,
|
|
1414
|
+
return t(this, W).length;
|
|
1327
1415
|
}
|
|
1328
1416
|
getRowCount() {
|
|
1329
1417
|
return this.length;
|
|
1330
1418
|
}
|
|
1331
1419
|
};
|
|
1332
|
-
|
|
1420
|
+
N = new WeakMap(), C = new WeakMap(), W = new WeakMap(), ut = new WeakMap(), se = new WeakMap(), U = new WeakMap(), ne = new WeakMap(), ot = new WeakMap(), $t = new WeakMap(), re = new WeakMap(), oe = new WeakMap(), gt = new WeakMap(), h(B, "ngData"), // 🎯 행 상태 정의 상수를 클래스 내부로 내재화
|
|
1333
1421
|
E(B, "ROW_STATE", {
|
|
1334
1422
|
EMPTY: "EMPTY",
|
|
1335
1423
|
NORMAL: "NORMAL",
|
|
@@ -1337,138 +1425,138 @@ E(B, "ROW_STATE", {
|
|
|
1337
1425
|
UPDATE: "UPDATE",
|
|
1338
1426
|
DELETE: "DELETE"
|
|
1339
1427
|
});
|
|
1340
|
-
let
|
|
1428
|
+
let we = B;
|
|
1341
1429
|
var it;
|
|
1342
|
-
const
|
|
1343
|
-
constructor(
|
|
1430
|
+
const Ye = class Ye {
|
|
1431
|
+
constructor(n) {
|
|
1344
1432
|
d(this, it);
|
|
1345
|
-
|
|
1433
|
+
p(this, it, n), this.row = new xe(this), this.data = new we(t(this, it), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1346
1434
|
var e;
|
|
1347
1435
|
(e = t(this, it).view) != null && e.redraw && t(this, it).view.redraw();
|
|
1348
1436
|
}, this.setDataSource = (e) => {
|
|
1349
1437
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1350
1438
|
}, this.getRowState = (e) => {
|
|
1351
|
-
var
|
|
1439
|
+
var r, o;
|
|
1352
1440
|
const s = parseInt(e, 10);
|
|
1353
1441
|
if (!(s >= this.data.count()))
|
|
1354
|
-
return (
|
|
1442
|
+
return (o = (r = this.data.getValidData()[s]) == null ? void 0 : r.__ng) == null ? void 0 : o.rowState;
|
|
1355
1443
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1356
1444
|
this.row.at = e;
|
|
1357
|
-
}, this.scrollTo_V1 = (e) => (e < 0 && (e = 0), e >= this.rawRecords.length && (e = this.rawRecords.length - 1), this.viewRecords.rawIndex = e, this.viewRecords.reset && this.viewRecords.reset(), !(e <= 0 || e >= this.rawRecords.length - 1)), this.getColumn = (e, s) => this.data.get(e, s), this.setColumn = (e, s,
|
|
1358
|
-
e = parseInt(e, 10), this.data.setValue(e, s,
|
|
1445
|
+
}, this.scrollTo_V1 = (e) => (e < 0 && (e = 0), e >= this.rawRecords.length && (e = this.rawRecords.length - 1), this.viewRecords.rawIndex = e, this.viewRecords.reset && this.viewRecords.reset(), !(e <= 0 || e >= this.rawRecords.length - 1)), this.getColumn = (e, s) => this.data.get(e, s), this.setColumn = (e, s, r) => {
|
|
1446
|
+
e = parseInt(e, 10), this.data.setValue(e, s, r);
|
|
1359
1447
|
}, this.setDataSource([]);
|
|
1360
1448
|
}
|
|
1361
1449
|
};
|
|
1362
|
-
it = new WeakMap(), h(
|
|
1363
|
-
let
|
|
1364
|
-
var
|
|
1365
|
-
const
|
|
1450
|
+
it = new WeakMap(), h(Ye, "ngDataManager");
|
|
1451
|
+
let Se = Ye;
|
|
1452
|
+
var bt, H, _t, ie;
|
|
1453
|
+
const Ue = class Ue {
|
|
1366
1454
|
// 🎯 이제 { name: string, type: string } 객체들의 배열로 관리합니다.
|
|
1367
|
-
constructor(
|
|
1368
|
-
d(this,
|
|
1455
|
+
constructor(n) {
|
|
1456
|
+
d(this, bt);
|
|
1369
1457
|
d(this, H, []);
|
|
1370
|
-
E(this, "add", /* @__PURE__ */ h((
|
|
1371
|
-
|
|
1372
|
-
t(this, H).some((
|
|
1373
|
-
}), t(this,
|
|
1458
|
+
E(this, "add", /* @__PURE__ */ h((n, e = "string") => {
|
|
1459
|
+
n.forEach((s) => {
|
|
1460
|
+
t(this, H).some((r) => r.name === s) || t(this, H).push({ name: s, type: e });
|
|
1461
|
+
}), t(this, _t).call(this);
|
|
1374
1462
|
}, "add"));
|
|
1375
|
-
d(this,
|
|
1376
|
-
const
|
|
1463
|
+
d(this, _t, /* @__PURE__ */ h(() => {
|
|
1464
|
+
const n = /* @__PURE__ */ new Map();
|
|
1377
1465
|
t(this, H).forEach((e) => {
|
|
1378
|
-
|
|
1379
|
-
}),
|
|
1466
|
+
n.set(e.name, e.type);
|
|
1467
|
+
}), p(this, H, Array.from(n, ([e, s]) => ({ name: e, type: s }))), p(this, H, t(this, H).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, H).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
1380
1468
|
}, "#adjust"));
|
|
1381
|
-
d(this,
|
|
1382
|
-
|
|
1383
|
-
const
|
|
1384
|
-
if (!(!
|
|
1385
|
-
for (const e of
|
|
1386
|
-
|
|
1387
|
-
const
|
|
1388
|
-
|
|
1469
|
+
d(this, ie, /* @__PURE__ */ h(() => {
|
|
1470
|
+
p(this, H, []), T.log(t(this, bt).querySelectorAll("table"));
|
|
1471
|
+
const n = Array.from(t(this, bt).querySelectorAll("table"));
|
|
1472
|
+
if (!(!n || n.length === 0)) {
|
|
1473
|
+
for (const e of n)
|
|
1474
|
+
T.log(e), $("[data-bind]", e).each((s, r) => {
|
|
1475
|
+
const o = r.dataset.bind, i = r.getAttribute("data-type") || "string";
|
|
1476
|
+
o && t(this, H).push({ name: o, type: i });
|
|
1389
1477
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
1390
|
-
$(`[${s}]`, e).each((
|
|
1391
|
-
var
|
|
1392
|
-
if (
|
|
1393
|
-
const a =
|
|
1478
|
+
$(`[${s}]`, e).each((r, o) => {
|
|
1479
|
+
var i = o.getAttribute(s);
|
|
1480
|
+
if (i.indexOf("data.") < 0) {
|
|
1481
|
+
const a = i.search(/[(]/g);
|
|
1394
1482
|
if (a > 0)
|
|
1395
1483
|
try {
|
|
1396
|
-
|
|
1484
|
+
i = String(window[i.substring(0, a).trim()]);
|
|
1397
1485
|
} catch {
|
|
1398
|
-
|
|
1486
|
+
i = "";
|
|
1399
1487
|
}
|
|
1400
1488
|
}
|
|
1401
|
-
|
|
1489
|
+
i.split("data.").forEach((a) => {
|
|
1402
1490
|
if (a.trim() != "") {
|
|
1403
1491
|
const c = a.search(/[^_A-Za-z0-9]/g);
|
|
1404
1492
|
let l = "";
|
|
1405
|
-
c >= 0 ? l = a.substring(0, c) :
|
|
1493
|
+
c >= 0 ? l = a.substring(0, c) : i.startsWith("data.") && (l = a.replace("data.", "")), l && t(this, H).push({ name: l, type: "string" });
|
|
1406
1494
|
}
|
|
1407
1495
|
});
|
|
1408
1496
|
});
|
|
1409
1497
|
});
|
|
1410
|
-
t(this,
|
|
1498
|
+
t(this, _t).call(this);
|
|
1411
1499
|
}
|
|
1412
1500
|
}, "#init"));
|
|
1413
|
-
|
|
1501
|
+
p(this, bt, n), t(this, ie).call(this);
|
|
1414
1502
|
}
|
|
1415
1503
|
// 🎯 기존에 필드 이름만 쓰던 곳들과의 호환을 위해 이름 배열만 리턴하는 메서드 유지
|
|
1416
1504
|
get() {
|
|
1417
|
-
return t(this, H).map((
|
|
1505
|
+
return t(this, H).map((n) => n.name);
|
|
1418
1506
|
}
|
|
1419
1507
|
// 🎯 내부 객체 통째로 얻기
|
|
1420
1508
|
getFields() {
|
|
1421
1509
|
return t(this, H);
|
|
1422
1510
|
}
|
|
1423
1511
|
// 🎯 특정 필드의 데이터 타입 조회
|
|
1424
|
-
getType(
|
|
1425
|
-
const e = t(this, H).find((s) => s.name ===
|
|
1512
|
+
getType(n) {
|
|
1513
|
+
const e = t(this, H).find((s) => s.name === n);
|
|
1426
1514
|
return e ? e.type : "string";
|
|
1427
1515
|
}
|
|
1428
|
-
indexOf(
|
|
1429
|
-
return t(this, H).findIndex((e) => e.name ===
|
|
1516
|
+
indexOf(n) {
|
|
1517
|
+
return t(this, H).findIndex((e) => e.name === n);
|
|
1430
1518
|
}
|
|
1431
|
-
includes(
|
|
1432
|
-
return t(this, H).some((e) => e.name ===
|
|
1519
|
+
includes(n) {
|
|
1520
|
+
return t(this, H).some((e) => e.name === n);
|
|
1433
1521
|
}
|
|
1434
1522
|
};
|
|
1435
|
-
|
|
1436
|
-
let
|
|
1437
|
-
var
|
|
1438
|
-
const
|
|
1523
|
+
bt = new WeakMap(), H = new WeakMap(), _t = new WeakMap(), ie = new WeakMap(), h(Ue, "ngFields");
|
|
1524
|
+
let Ee = Ue;
|
|
1525
|
+
var at, ae, le;
|
|
1526
|
+
const Xe = class Xe extends HTMLElement {
|
|
1439
1527
|
constructor() {
|
|
1440
1528
|
super();
|
|
1441
1529
|
//#created = false;
|
|
1442
|
-
d(this,
|
|
1443
|
-
d(this,
|
|
1444
|
-
d(this,
|
|
1445
|
-
this.fields = new
|
|
1530
|
+
d(this, at);
|
|
1531
|
+
d(this, ae);
|
|
1532
|
+
d(this, le, /* @__PURE__ */ h(() => {
|
|
1533
|
+
this.fields = new Ee(this), p(this, ae, new ve(this)), T.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1446
1534
|
}, "#init"));
|
|
1447
|
-
this.attachShadow({ mode: "open" }),
|
|
1535
|
+
this.attachShadow({ mode: "open" }), p(this, at, new Se(this));
|
|
1448
1536
|
}
|
|
1449
1537
|
connectedCallback() {
|
|
1450
|
-
t(this,
|
|
1538
|
+
t(this, le).call(this);
|
|
1451
1539
|
}
|
|
1452
1540
|
disconnectedCallback() {
|
|
1453
|
-
|
|
1541
|
+
T.log("NineTable disconnected.");
|
|
1454
1542
|
}
|
|
1455
1543
|
// 🎯 외부에서 grid.data.set(...) 형태로 접근할 수 있도록 데이터 매니저 오픈
|
|
1456
1544
|
get data() {
|
|
1457
|
-
return t(this,
|
|
1545
|
+
return t(this, at).data;
|
|
1458
1546
|
}
|
|
1459
1547
|
// 🎯 행(row) 관련 제어 접근자 오픈
|
|
1460
1548
|
get row() {
|
|
1461
|
-
return t(this,
|
|
1549
|
+
return t(this, at).row;
|
|
1462
1550
|
}
|
|
1463
1551
|
// 🎯 전체 데이터 매니저 접근 필요할 경우
|
|
1464
1552
|
get dataManager() {
|
|
1465
|
-
return t(this,
|
|
1553
|
+
return t(this, at);
|
|
1466
1554
|
}
|
|
1467
1555
|
};
|
|
1468
|
-
|
|
1469
|
-
let
|
|
1470
|
-
customElements.get("nine-table") || customElements.define("nine-table",
|
|
1471
|
-
const
|
|
1556
|
+
at = new WeakMap(), ae = new WeakMap(), le = new WeakMap(), h(Xe, "NineTable");
|
|
1557
|
+
let Ae = Xe;
|
|
1558
|
+
customElements.get("nine-table") || customElements.define("nine-table", Ae);
|
|
1559
|
+
const xt = class xt extends HTMLElement {
|
|
1472
1560
|
// 👈 커스텀 스타일용 캐시 추가
|
|
1473
1561
|
constructor() {
|
|
1474
1562
|
super();
|
|
@@ -1479,74 +1567,74 @@ const mt = class mt extends HTMLElement {
|
|
|
1479
1567
|
connectedCallback() {
|
|
1480
1568
|
}
|
|
1481
1569
|
};
|
|
1482
|
-
h(
|
|
1483
|
-
let
|
|
1484
|
-
var L,
|
|
1485
|
-
const
|
|
1570
|
+
h(xt, "BasicCellElement"), E(xt, "_styleCache", /* @__PURE__ */ new Map()), E(xt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1571
|
+
let Re = xt;
|
|
1572
|
+
var L, Nt, m, Me, Ie, $e, _e, Ne;
|
|
1573
|
+
const Ke = class Ke extends Re {
|
|
1486
1574
|
constructor() {
|
|
1487
1575
|
super();
|
|
1488
1576
|
d(this, L);
|
|
1489
|
-
d(this,
|
|
1490
|
-
d(this,
|
|
1491
|
-
d(this,
|
|
1492
|
-
d(this,
|
|
1493
|
-
d(this,
|
|
1494
|
-
d(this,
|
|
1577
|
+
d(this, Nt);
|
|
1578
|
+
d(this, m);
|
|
1579
|
+
d(this, Me);
|
|
1580
|
+
d(this, Ie);
|
|
1581
|
+
d(this, $e);
|
|
1582
|
+
d(this, _e);
|
|
1495
1583
|
E(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1496
|
-
if (t(this,
|
|
1497
|
-
if (t(this,
|
|
1498
|
-
const s = t(this,
|
|
1584
|
+
if (t(this, m))
|
|
1585
|
+
if (t(this, m).closest("tbody")) {
|
|
1586
|
+
const s = t(this, m).closest("tr").data, r = parseInt(t(this, m).dataset.row);
|
|
1499
1587
|
if (!s) return "";
|
|
1500
|
-
if (ninegrid.isNull(t(this,
|
|
1501
|
-
if (!ninegrid.isNull(t(this,
|
|
1502
|
-
return s[t(this,
|
|
1588
|
+
if (ninegrid.isNull(t(this, m).dataset.expr)) {
|
|
1589
|
+
if (!ninegrid.isNull(t(this, m).dataset.bind))
|
|
1590
|
+
return s[t(this, m).dataset.bind] || ninegrid.nvl(e, "");
|
|
1503
1591
|
} else try {
|
|
1504
|
-
return this.getExprValue(t(this,
|
|
1592
|
+
return this.getExprValue(t(this, m).dataset.expr, s, r, t(this, m));
|
|
1505
1593
|
} catch {
|
|
1506
|
-
console.error(t(this,
|
|
1594
|
+
console.error(t(this, m).dataset.expr, s, t(this, m).dataset.row);
|
|
1507
1595
|
}
|
|
1508
1596
|
return ninegrid.nvl(e, "");
|
|
1509
1597
|
} else
|
|
1510
1598
|
try {
|
|
1511
|
-
return t(this, L).exprFunction(t(this,
|
|
1599
|
+
return t(this, L).exprFunction(t(this, m).dataset.expr).call(this, null, -1, t(this, L).data);
|
|
1512
1600
|
} catch {
|
|
1513
1601
|
}
|
|
1514
1602
|
}, "getDisplayText"));
|
|
1515
|
-
d(this,
|
|
1516
|
-
if (!(!t(this, L) || !t(this, L).template || !t(this,
|
|
1517
|
-
var e = ninegrid.j.querySelectorAll(t(this,
|
|
1603
|
+
d(this, Ne, /* @__PURE__ */ h(() => {
|
|
1604
|
+
if (!(!t(this, L) || !t(this, L).template || !t(this, m).closest("tbody.bindable"))) {
|
|
1605
|
+
var e = ninegrid.j.querySelectorAll(t(this, m)).attr("suppress");
|
|
1518
1606
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1519
|
-
var s = t(this,
|
|
1520
|
-
$("th,td", s).each((
|
|
1521
|
-
var
|
|
1522
|
-
|
|
1523
|
-
}),
|
|
1524
|
-
var
|
|
1607
|
+
var s = t(this, m).closest("tr"), r = [];
|
|
1608
|
+
$("th,td", s).each((v, M) => {
|
|
1609
|
+
var q = ninegrid.j.querySelectorAll(M).attr("suppress");
|
|
1610
|
+
q && M.dataset.row && (q = parseInt(q), !isNaN(q) && q <= e && r.push(q));
|
|
1611
|
+
}), r.sort();
|
|
1612
|
+
var o = !1;
|
|
1525
1613
|
if (parseInt(s.sectionRowIndex / t(this, L).template.length) > 0)
|
|
1526
|
-
for (var
|
|
1527
|
-
if (
|
|
1528
|
-
var a = parseInt(t(this,
|
|
1529
|
-
t(this,
|
|
1530
|
-
var g = t(this, L).body.querySelector(`tbody.bindable [suppress="${
|
|
1614
|
+
for (var i of r) {
|
|
1615
|
+
if (i > e) break;
|
|
1616
|
+
var a = parseInt(t(this, m).dataset.row), c = a - 1, l = t(this, m).closest("tr").data, f = t(this, L).data.get(c);
|
|
1617
|
+
t(this, m).dataset.matrixRow;
|
|
1618
|
+
var g = t(this, L).body.querySelector(`tbody.bindable [suppress="${i}"][data-matrix-row="${t(this, m).dataset.matrixRow}"]`), b = g.dataset.expr ? this.getExprValue(g.dataset.expr, l, a) : l[g.dataset.bind], u = g.dataset.expr ? this.getExprValue(g.dataset.expr, f, c) : f[g.dataset.bind];
|
|
1531
1619
|
if (b != u) {
|
|
1532
|
-
|
|
1620
|
+
o = !0;
|
|
1533
1621
|
break;
|
|
1534
1622
|
}
|
|
1535
1623
|
}
|
|
1536
1624
|
else
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
var
|
|
1540
|
-
$(A).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this,
|
|
1625
|
+
o = !0;
|
|
1626
|
+
o ? ninegrid.j.querySelectorAll(t(this, m)).removeClass("suppress") : ninegrid.j.querySelectorAll(t(this, m)).addClass("suppress"), ninegrid.j.querySelectorAll(t(this, m)).hasClass("hidden") || (o ? ninegrid.j.querySelectorAll(t(this, m)).removeClass("hidden") : ninegrid.j.querySelectorAll(t(this, m)).addClass("hidden"));
|
|
1627
|
+
var y = parseInt(t(this, m).dataset.matrixRow), x = y - 1, A = t(this, L).body.querySelector(`tbody.bindable [data-col="${t(this, m).dataset.col}"][data-matrix-row="${x}"]`);
|
|
1628
|
+
$(A).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this, m)).hasClass("suppress") ? ninegrid.j.querySelectorAll(A).removeClass("last-none-suppress").addClass("last-suppress") : !$(A).hasClass("suppress") && ninegrid.j.querySelectorAll(t(this, m)).hasClass("suppress") ? ninegrid.j.querySelectorAll(A).removeClass("last-suppress").addClass("last-none-suppress") : ninegrid.j.querySelectorAll(A).removeClass("last-none-suppress").removeClass("last-suppress");
|
|
1541
1629
|
}
|
|
1542
1630
|
}
|
|
1543
1631
|
}, "#resetSuppress"));
|
|
1544
|
-
E(this, "getExprValue", /* @__PURE__ */ h((e, s,
|
|
1632
|
+
E(this, "getExprValue", /* @__PURE__ */ h((e, s, r, o) => {
|
|
1545
1633
|
if (typeof e < "u")
|
|
1546
1634
|
try {
|
|
1547
|
-
|
|
1548
|
-
const
|
|
1549
|
-
return t(this, L)[
|
|
1635
|
+
r = parseInt(r);
|
|
1636
|
+
const i = e.replace("()", "");
|
|
1637
|
+
return t(this, L)[i] ? t(this, L)[i].call(this, s, r, t(this, m)) : t(this, L).exprFunction(e).call(this, s, r, t(this, L).data);
|
|
1550
1638
|
} catch {
|
|
1551
1639
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1552
1640
|
}
|
|
@@ -1555,31 +1643,31 @@ const De = class De extends me {
|
|
|
1555
1643
|
}, "getExprValue"));
|
|
1556
1644
|
}
|
|
1557
1645
|
connectedCallback() {
|
|
1558
|
-
super.connectedCallback(),
|
|
1646
|
+
super.connectedCallback(), p(this, L, this.getRootNode().host), p(this, m, this.closest("th,td")), p(this, Nt, t(this, m).closest("tr"));
|
|
1559
1647
|
}
|
|
1560
1648
|
get value() {
|
|
1561
|
-
var e = !t(this, L) || !t(this, L).dataManager || !t(this,
|
|
1649
|
+
var e = !t(this, L) || !t(this, L).dataManager || !t(this, m) || !t(this, m).dataset || !t(this, m).dataset.row || !t(this, m).dataset.bind ? "" : t(this, m).closest("tr").data[t(this, m).dataset.bind];
|
|
1562
1650
|
return e ?? "";
|
|
1563
1651
|
}
|
|
1564
1652
|
set value(e) {
|
|
1565
|
-
var s = parseInt(t(this,
|
|
1566
|
-
const
|
|
1567
|
-
s < 0 ? t(this, L).data.setValueNF(parseInt(t(this,
|
|
1653
|
+
var s = parseInt(t(this, m).dataset.row);
|
|
1654
|
+
const r = this.getAttribute("update-row-state") != "false";
|
|
1655
|
+
s < 0 ? t(this, L).data.setValueNF(parseInt(t(this, m).dataset.index), t(this, m).dataset.bind, e, r) : t(this, L).data.setValue(s, t(this, m).dataset.bind, e, r);
|
|
1568
1656
|
}
|
|
1569
1657
|
get row() {
|
|
1570
|
-
return parseInt(t(this,
|
|
1658
|
+
return parseInt(t(this, m).dataset.row);
|
|
1571
1659
|
}
|
|
1572
1660
|
get data() {
|
|
1573
|
-
return t(this,
|
|
1661
|
+
return t(this, m).closest("tr").data;
|
|
1574
1662
|
}
|
|
1575
1663
|
refresh() {
|
|
1576
|
-
const e = t(this,
|
|
1577
|
-
return parseInt(t(this,
|
|
1664
|
+
const e = t(this, m).dataset.bind;
|
|
1665
|
+
return parseInt(t(this, m).dataset.row), t(this, Nt).data[e];
|
|
1578
1666
|
}
|
|
1579
1667
|
};
|
|
1580
|
-
L = new WeakMap(),
|
|
1581
|
-
let
|
|
1582
|
-
const
|
|
1668
|
+
L = new WeakMap(), Nt = new WeakMap(), m = new WeakMap(), Me = new WeakMap(), Ie = new WeakMap(), $e = new WeakMap(), _e = new WeakMap(), Ne = new WeakMap(), h(Ke, "CellElement");
|
|
1669
|
+
let qe = Ke;
|
|
1670
|
+
const Ze = class Ze extends qe {
|
|
1583
1671
|
constructor() {
|
|
1584
1672
|
super();
|
|
1585
1673
|
}
|
|
@@ -1590,21 +1678,21 @@ const Pe = class Pe extends ve {
|
|
|
1590
1678
|
return super.refresh();
|
|
1591
1679
|
}
|
|
1592
1680
|
};
|
|
1593
|
-
h(
|
|
1594
|
-
let
|
|
1595
|
-
var
|
|
1596
|
-
const
|
|
1681
|
+
h(Ze, "EditableCellElement");
|
|
1682
|
+
let Te = Ze;
|
|
1683
|
+
var Wt, lt, pt, yt, ce, X, We;
|
|
1684
|
+
const Ge = class Ge extends Te {
|
|
1597
1685
|
constructor() {
|
|
1598
1686
|
super();
|
|
1599
|
-
d(this,
|
|
1600
|
-
d(this,
|
|
1601
|
-
d(this,
|
|
1602
|
-
d(this,
|
|
1603
|
-
d(this,
|
|
1604
|
-
d(this,
|
|
1687
|
+
d(this, Wt);
|
|
1688
|
+
d(this, lt);
|
|
1689
|
+
d(this, pt);
|
|
1690
|
+
d(this, yt);
|
|
1691
|
+
d(this, ce);
|
|
1692
|
+
d(this, X);
|
|
1605
1693
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
1606
1694
|
const e = super.refresh();
|
|
1607
|
-
t(this,
|
|
1695
|
+
t(this, Wt).value = e;
|
|
1608
1696
|
}, "refresh"));
|
|
1609
1697
|
/**
|
|
1610
1698
|
dataRefresh = (v) => {
|
|
@@ -1636,22 +1724,22 @@ const je = class je extends xe {
|
|
|
1636
1724
|
if (!v) this.reset();
|
|
1637
1725
|
};
|
|
1638
1726
|
*/
|
|
1639
|
-
d(this,
|
|
1727
|
+
d(this, We, /* @__PURE__ */ h((e) => {
|
|
1640
1728
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1641
|
-
if (t(this,
|
|
1642
|
-
let
|
|
1643
|
-
if (t(this,
|
|
1644
|
-
var s = e.target.value,
|
|
1645
|
-
if (
|
|
1646
|
-
var s = s.substr(
|
|
1647
|
-
s.length >= Number(t(this,
|
|
1729
|
+
if (t(this, lt) == "number") {
|
|
1730
|
+
let o = [];
|
|
1731
|
+
if (t(this, X) && Number(t(this, X)) > 0 && o.push("."), t(this, yt) && Number(t(this, yt)) >= 0 && o.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !o.includes(e.key) && e.preventDefault(), t(this, X) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
|
|
1732
|
+
var s = e.target.value, r = s.indexOf(".");
|
|
1733
|
+
if (r >= 0) {
|
|
1734
|
+
var s = s.substr(r + 1, s.length);
|
|
1735
|
+
s.length >= Number(t(this, X)) && e.preventDefault();
|
|
1648
1736
|
}
|
|
1649
1737
|
}
|
|
1650
1738
|
}
|
|
1651
|
-
t(this,
|
|
1739
|
+
t(this, pt) && ninegrid.getByteLength(e.target.value) >= Number(t(this, pt)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1652
1740
|
}
|
|
1653
1741
|
}, "#onKeyDown"));
|
|
1654
|
-
if (this.applyBaseStyle(),
|
|
1742
|
+
if (this.applyBaseStyle(), p(this, lt, this.getAttribute("type") || "text"), p(this, pt, this.getAttribute("maxbyte")), p(this, yt, this.getAttribute("min")), p(this, ce, this.getAttribute("max")), p(this, X, this.getAttribute("scale")), !["text", "number"].includes(t(this, lt))) throw `invalid type : ${t(this, lt)}`;
|
|
1655
1743
|
}
|
|
1656
1744
|
connectedCallback() {
|
|
1657
1745
|
for (var e = [], s = 0; s < this.attributes.length; s++)
|
|
@@ -1661,11 +1749,11 @@ const je = class je extends xe {
|
|
|
1661
1749
|
${e.join(" ")}
|
|
1662
1750
|
ondragstart="return false;"
|
|
1663
1751
|
>
|
|
1664
|
-
`, super.connectedCallback(),
|
|
1752
|
+
`, super.connectedCallback(), p(this, Wt, this.querySelector("input"));
|
|
1665
1753
|
}
|
|
1666
1754
|
};
|
|
1667
|
-
|
|
1668
|
-
let
|
|
1755
|
+
Wt = new WeakMap(), lt = new WeakMap(), pt = new WeakMap(), yt = new WeakMap(), ce = new WeakMap(), X = new WeakMap(), We = new WeakMap(), h(Ge, "CellInputText");
|
|
1756
|
+
let ke = Ge;
|
|
1669
1757
|
customElements.get("cell-input-text");
|
|
1670
|
-
customElements.get("cell-input") || customElements.define("cell-input",
|
|
1758
|
+
customElements.get("cell-input") || customElements.define("cell-input", ke);
|
|
1671
1759
|
//# sourceMappingURL=nine-table.js.map
|