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