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