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