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