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