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