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