@ninebone/table 0.0.646 → 0.0.648
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 +298 -297
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +7 -7
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -3,8 +3,8 @@ var Ve = (q) => {
|
|
|
3
3
|
throw TypeError(q);
|
|
4
4
|
};
|
|
5
5
|
var Xe = (q, i, e) => i in q ? Fe(q, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : q[i] = e;
|
|
6
|
-
var
|
|
7
|
-
var
|
|
6
|
+
var c = (q, i) => Fe(q, "name", { value: i, configurable: !0 });
|
|
7
|
+
var E = (q, i, e) => Xe(q, typeof i != "symbol" ? i + "" : i, e), Ye = (q, i, e) => i.has(q) || Ve("Cannot " + e);
|
|
8
8
|
var t = (q, i, e) => (Ye(q, i, "read from private field"), e ? e.call(q) : i.get(q)), d = (q, i, e) => i.has(q) ? Ve("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(q) : i.set(q, e), y = (q, i, e, s) => (Ye(q, i, "write to private field"), s ? s.call(q, e) : i.set(q, e), e);
|
|
9
9
|
var Ue = (q, i, e, s) => ({
|
|
10
10
|
set _(r) {
|
|
@@ -20,32 +20,32 @@ const He = class He extends Ke.constructor {
|
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
|
|
23
|
+
c(He, "Trace");
|
|
24
24
|
let oe = He;
|
|
25
25
|
const H = new oe();
|
|
26
|
-
var B, j,
|
|
26
|
+
var B, j, w, X, K, Z, It, G, _t;
|
|
27
27
|
const Me = class Me extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
d(this, B);
|
|
31
31
|
d(this, j, !1);
|
|
32
|
-
d(this,
|
|
32
|
+
d(this, w);
|
|
33
33
|
d(this, X);
|
|
34
34
|
d(this, K);
|
|
35
35
|
d(this, Z);
|
|
36
|
-
d(this, It, /* @__PURE__ */
|
|
36
|
+
d(this, It, /* @__PURE__ */ c(() => {
|
|
37
37
|
if (!t(this, B)) return;
|
|
38
38
|
const e = t(this, B).querySelector(".ng-container-body .ng-part-body");
|
|
39
39
|
e && (y(this, Z, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
41
|
})), t(this, Z).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
|
-
|
|
44
|
-
if (!t(this, B) || !t(this,
|
|
45
|
-
const e = t(this,
|
|
43
|
+
E(this, "refresh", /* @__PURE__ */ c(() => {
|
|
44
|
+
if (!t(this, B) || !t(this, w) || t(this, j)) return;
|
|
45
|
+
const e = t(this, w).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const r = t(this,
|
|
48
|
-
if (a !== 0 &&
|
|
47
|
+
const r = t(this, w).track, n = t(this, w).thumb, o = t(this, B).querySelector(".ng-container-bottom"), a = e.clientWidth, h = s.scrollWidth;
|
|
48
|
+
if (a !== 0 && h > a)
|
|
49
49
|
o && (o.style.display = "flex");
|
|
50
50
|
else {
|
|
51
51
|
o && (o.style.display = "none");
|
|
@@ -53,58 +53,58 @@ const Me = class Me extends HTMLElement {
|
|
|
53
53
|
}
|
|
54
54
|
const l = r.clientWidth;
|
|
55
55
|
if (l <= 0) return;
|
|
56
|
-
const f = Math.max(Math.min(l * (a /
|
|
56
|
+
const f = Math.max(Math.min(l * (a / h), l), 20);
|
|
57
57
|
n.style.width = `${f}px`;
|
|
58
|
-
const g = e.scrollLeft, b =
|
|
58
|
+
const g = e.scrollLeft, b = h - a;
|
|
59
59
|
let u = 0;
|
|
60
60
|
b > 0 && (u = parseInt(g / b * (l - f), 10)), u < 0 && (u = 0);
|
|
61
|
-
const
|
|
62
|
-
u >
|
|
61
|
+
const v = l - f;
|
|
62
|
+
u > v && (u = v), n.style.left = `${u}px`, t(this, w).left.disabled = u === 0, t(this, w).right.disabled = u >= v - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
d(this, G, /* @__PURE__ */
|
|
65
|
-
if (!t(this,
|
|
66
|
-
const s = t(this,
|
|
64
|
+
d(this, G, /* @__PURE__ */ c((e) => {
|
|
65
|
+
if (!t(this, w)) return !1;
|
|
66
|
+
const s = t(this, w).container, r = s.querySelector("table");
|
|
67
67
|
if (!r) return !1;
|
|
68
|
-
const n = t(this,
|
|
68
|
+
const n = t(this, w).track.getBoundingClientRect(), o = t(this, w).thumb.clientWidth;
|
|
69
69
|
let a = e;
|
|
70
70
|
a < 0 && (a = 0);
|
|
71
|
-
const
|
|
72
|
-
a >
|
|
71
|
+
const h = n.width - o;
|
|
72
|
+
a > h && (a = h), a = parseInt(a, 10), t(this, w).thumb.style.left = `${a}px`, t(this, w).left.disabled = a === 0, t(this, w).right.disabled = a >= h - 1;
|
|
73
73
|
const l = s.clientWidth, g = r.scrollWidth - l;
|
|
74
|
-
return
|
|
74
|
+
return h > 0 && g > 0 && (s.scrollLeft = a / h * g), a > 0 && a < h - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
d(this, _t, /* @__PURE__ */
|
|
77
|
-
const e = /* @__PURE__ */
|
|
76
|
+
d(this, _t, /* @__PURE__ */ c(() => {
|
|
77
|
+
const e = /* @__PURE__ */ c((r) => {
|
|
78
78
|
clearInterval(t(this, X)), clearInterval(t(this, K));
|
|
79
|
-
const n = parseInt(t(this,
|
|
79
|
+
const n = parseInt(t(this, w).thumb.style.left || 0, 10);
|
|
80
80
|
t(this, G).call(this, n + r), y(this, X, setInterval(() => {
|
|
81
81
|
clearInterval(t(this, X)), y(this, K, setInterval(() => {
|
|
82
|
-
const o = parseInt(t(this,
|
|
82
|
+
const o = parseInt(t(this, w).thumb.style.left || 0, 10);
|
|
83
83
|
t(this, G).call(this, o + r) || clearInterval(t(this, K));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
|
-
}, "delayScroll"), s = /* @__PURE__ */
|
|
86
|
+
}, "delayScroll"), s = /* @__PURE__ */ c(() => {
|
|
87
87
|
clearInterval(t(this, X)), clearInterval(t(this, K));
|
|
88
88
|
}, "clearTimer");
|
|
89
89
|
["mouseup", "mouseleave", "touchend"].forEach((r) => {
|
|
90
|
-
t(this,
|
|
91
|
-
}), t(this,
|
|
90
|
+
t(this, w).left.addEventListener(r, s), t(this, w).right.addEventListener(r, s), t(this, w).track.addEventListener(r, s);
|
|
91
|
+
}), t(this, w).left.addEventListener("mousedown", (r) => {
|
|
92
92
|
r.button === 0 && e(-20);
|
|
93
|
-
}), t(this,
|
|
93
|
+
}), t(this, w).right.addEventListener("mousedown", (r) => {
|
|
94
94
|
r.button === 0 && e(20);
|
|
95
|
-
}), t(this,
|
|
95
|
+
}), t(this, w).left.addEventListener("touchstart", () => e(-20)), t(this, w).right.addEventListener("touchstart", () => e(20)), t(this, w).track.addEventListener("mousedown", (r) => {
|
|
96
96
|
if (r.button !== 0) return;
|
|
97
97
|
r.preventDefault();
|
|
98
|
-
const n = t(this,
|
|
98
|
+
const n = t(this, w).track.getBoundingClientRect(), o = t(this, w).thumb.clientWidth;
|
|
99
99
|
t(this, G).call(this, r.clientX - n.left - o / 2);
|
|
100
|
-
}), t(this,
|
|
100
|
+
}), t(this, w).thumb.addEventListener("mousedown", (r) => {
|
|
101
101
|
if (r.button !== 0) return;
|
|
102
|
-
r.stopPropagation(), r.preventDefault(), y(this, j, !0), this.shiftX = r.clientX - t(this,
|
|
103
|
-
const n = /* @__PURE__ */
|
|
102
|
+
r.stopPropagation(), r.preventDefault(), y(this, j, !0), this.shiftX = r.clientX - t(this, w).thumb.getBoundingClientRect().left;
|
|
103
|
+
const n = /* @__PURE__ */ c((a) => {
|
|
104
104
|
if (!t(this, j)) return;
|
|
105
|
-
const
|
|
106
|
-
t(this, G).call(this, a.clientX -
|
|
107
|
-
}, "onMouseMove"), o = /* @__PURE__ */
|
|
105
|
+
const h = t(this, w).track.getBoundingClientRect();
|
|
106
|
+
t(this, G).call(this, a.clientX - h.left - this.shiftX);
|
|
107
|
+
}, "onMouseMove"), o = /* @__PURE__ */ c(() => {
|
|
108
108
|
y(this, j, !1), s(), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
110
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", o);
|
|
@@ -176,13 +176,13 @@ const Me = class Me extends HTMLElement {
|
|
|
176
176
|
<div class='ng-scroll-track'><div class='ng-scroll-thumb'></div></div>
|
|
177
177
|
<button class='ng-scroll-right' disabled><div class='ng-scroll-icon'></div></button>
|
|
178
178
|
`;
|
|
179
|
-
const e = /* @__PURE__ */
|
|
179
|
+
const e = /* @__PURE__ */ c(() => {
|
|
180
180
|
const s = t(this, B).querySelector(".ng-container-body .ng-part-body");
|
|
181
181
|
if (!s) {
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
|
-
y(this,
|
|
185
|
+
y(this, w, {
|
|
186
186
|
container: s,
|
|
187
187
|
track: this.querySelector(".ng-scroll-track"),
|
|
188
188
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
@@ -198,7 +198,7 @@ const Me = class Me extends HTMLElement {
|
|
|
198
198
|
t(this, Z) && t(this, Z).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
B = new WeakMap(), j = new WeakMap(),
|
|
201
|
+
B = new WeakMap(), j = new WeakMap(), w = new WeakMap(), X = new WeakMap(), K = new WeakMap(), Z = new WeakMap(), It = new WeakMap(), G = new WeakMap(), _t = new WeakMap(), c(Me, "NineTableHScrollBar");
|
|
202
202
|
let ae = Me;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ae);
|
|
204
204
|
var F, at, J, T, vt, xt, Nt;
|
|
@@ -211,27 +211,27 @@ const $e = class $e extends HTMLElement {
|
|
|
211
211
|
d(this, T);
|
|
212
212
|
d(this, vt, 0);
|
|
213
213
|
d(this, xt, 0);
|
|
214
|
-
|
|
214
|
+
E(this, "refresh", /* @__PURE__ */ c(() => {
|
|
215
215
|
if (!t(this, F) || !t(this, T)) return;
|
|
216
|
-
const e = t(this, T).container, s = t(this, T).track, r = t(this, T).thumb, n = e.clientHeight, o = t(this, F).data.length, a = t(this, at).getRowHeight(),
|
|
217
|
-
if (
|
|
216
|
+
const e = t(this, T).container, s = t(this, T).track, r = t(this, T).thumb, n = e.clientHeight, o = t(this, F).data.length, a = t(this, at).getRowHeight(), h = o * a;
|
|
217
|
+
if (h <= n || o === 0) {
|
|
218
218
|
this.style.display = "none";
|
|
219
219
|
return;
|
|
220
220
|
} else
|
|
221
221
|
this.style.display = "flex";
|
|
222
222
|
const l = s.clientHeight;
|
|
223
223
|
if (l <= 0) return;
|
|
224
|
-
const f = Math.max(Math.min(l * (n /
|
|
224
|
+
const f = Math.max(Math.min(l * (n / h), l), 20);
|
|
225
225
|
r.style.height = `${f}px`;
|
|
226
|
-
const g = e.scrollTop, b = Math.max(
|
|
226
|
+
const g = e.scrollTop, b = Math.max(h - n, 1);
|
|
227
227
|
let u = 0;
|
|
228
228
|
b > 0 && (u = g / b * (l - f));
|
|
229
|
-
const
|
|
230
|
-
u < 0 && (u = 0), u >
|
|
229
|
+
const v = l - f;
|
|
230
|
+
u < 0 && (u = 0), u > v && (u = v), r.style.top = `${u}px`, t(this, T).top.disabled = g <= 0, t(this, T).bottom.disabled = g >= b - 1;
|
|
231
231
|
}, "refresh"));
|
|
232
|
-
d(this, Nt, /* @__PURE__ */
|
|
232
|
+
d(this, Nt, /* @__PURE__ */ c(() => {
|
|
233
233
|
H.log("nine-table-vscrollbar.#init");
|
|
234
|
-
const e = t(this, T).container, s = /* @__PURE__ */
|
|
234
|
+
const e = t(this, T).container, s = /* @__PURE__ */ c(() => {
|
|
235
235
|
const n = (t(this, F).data.get() || []).length, o = t(this, at).getRowHeight();
|
|
236
236
|
return n * o;
|
|
237
237
|
}, "getContentHeight");
|
|
@@ -240,17 +240,17 @@ const $e = class $e extends HTMLElement {
|
|
|
240
240
|
}), t(this, T).thumb.addEventListener("mousedown", (r) => {
|
|
241
241
|
if (r.button !== 0) return;
|
|
242
242
|
r.stopPropagation(), r.preventDefault(), y(this, J, !0), y(this, vt, r.clientY), y(this, xt, e.scrollTop);
|
|
243
|
-
const n = /* @__PURE__ */
|
|
243
|
+
const n = /* @__PURE__ */ c((a) => {
|
|
244
244
|
if (!t(this, J)) return;
|
|
245
|
-
const
|
|
246
|
-
if (g > 0 &&
|
|
247
|
-
const
|
|
248
|
-
let
|
|
249
|
-
const
|
|
250
|
-
|
|
245
|
+
const h = t(this, T).track.getBoundingClientRect(), l = t(this, T).thumb.clientHeight, g = h.height - l, b = a.clientY - t(this, vt), u = e.clientHeight, v = s(), x = Math.max(v - u, 1);
|
|
246
|
+
if (g > 0 && x > 0) {
|
|
247
|
+
const A = b / g * x;
|
|
248
|
+
let m = t(this, xt) + A;
|
|
249
|
+
const W = Math.max(0, v - u);
|
|
250
|
+
m < 0 && (m = 0), m > W && (m = W), e.scrollTop = m;
|
|
251
251
|
}
|
|
252
252
|
this.refresh();
|
|
253
|
-
}, "onMouseMove"), o = /* @__PURE__ */
|
|
253
|
+
}, "onMouseMove"), o = /* @__PURE__ */ c(() => {
|
|
254
254
|
y(this, J, !1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), this.refresh();
|
|
255
255
|
}, "onMouseUp");
|
|
256
256
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", o);
|
|
@@ -334,7 +334,7 @@ const $e = class $e extends HTMLElement {
|
|
|
334
334
|
<div class='ng-scroll-track'><div class='ng-scroll-thumb'></div></div>
|
|
335
335
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
336
336
|
`;
|
|
337
|
-
const e = /* @__PURE__ */
|
|
337
|
+
const e = /* @__PURE__ */ c(() => {
|
|
338
338
|
const s = t(this, F).shadowRoot.querySelector(".ng-container-body .ng-part-body");
|
|
339
339
|
if (!s) {
|
|
340
340
|
setTimeout(e, 10);
|
|
@@ -351,17 +351,17 @@ const $e = class $e extends HTMLElement {
|
|
|
351
351
|
e();
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
|
-
F = new WeakMap(), at = new WeakMap(), J = new WeakMap(), T = new WeakMap(), vt = new WeakMap(), xt = new WeakMap(), Nt = new WeakMap(),
|
|
354
|
+
F = new WeakMap(), at = new WeakMap(), J = new WeakMap(), T = new WeakMap(), vt = new WeakMap(), xt = new WeakMap(), Nt = new WeakMap(), c($e, "NineTableVScrollBar");
|
|
355
355
|
let le = $e;
|
|
356
356
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", le);
|
|
357
|
-
var P,
|
|
357
|
+
var P, S, Q, D, I, V, tt, wt, Se, Ee, Wt, Ot, zt, St, Et, Bt, Dt, At, Ae, lt, qt, Pt;
|
|
358
358
|
const Ie = class Ie {
|
|
359
359
|
constructor(i) {
|
|
360
360
|
d(this, P);
|
|
361
|
-
d(this,
|
|
361
|
+
d(this, S);
|
|
362
362
|
d(this, Q);
|
|
363
363
|
d(this, D, /* @__PURE__ */ new Map());
|
|
364
|
-
d(this,
|
|
364
|
+
d(this, I, null);
|
|
365
365
|
d(this, V, null);
|
|
366
366
|
d(this, tt, 0);
|
|
367
367
|
d(this, wt, 40);
|
|
@@ -369,44 +369,44 @@ const Ie = class Ie {
|
|
|
369
369
|
d(this, Ee, !1);
|
|
370
370
|
//#ticking = false; // 🎯 고속 스크롤 스로틀링용 플래그
|
|
371
371
|
d(this, Wt, 3);
|
|
372
|
-
|
|
372
|
+
E(this, "refresh", /* @__PURE__ */ c(() => {
|
|
373
373
|
var e;
|
|
374
374
|
H.log("rowManager.refresh");
|
|
375
|
-
const i = t(this,
|
|
376
|
-
i && (t(this, St).call(this), t(this, lt).call(this, i.scrollTop), (e = t(this,
|
|
375
|
+
const i = t(this, S).querySelector(".ng-container-body .ng-part-body");
|
|
376
|
+
i && (t(this, St).call(this), t(this, lt).call(this, i.scrollTop), (e = t(this, S).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
377
377
|
}, "refresh"));
|
|
378
|
-
|
|
378
|
+
E(this, "initialize", /* @__PURE__ */ c(() => {
|
|
379
379
|
H.log("rowManager.initialize"), y(this, Q, {
|
|
380
|
-
scrollTables: t(this,
|
|
381
|
-
firstTr: t(this,
|
|
382
|
-
}), y(this,
|
|
383
|
-
const a = t(this,
|
|
380
|
+
scrollTables: t(this, S).querySelectorAll(".ng-part-body table"),
|
|
381
|
+
firstTr: t(this, S).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
382
|
+
}), y(this, I, null), t(this, D).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
383
|
+
const a = t(this, S).querySelector(o);
|
|
384
384
|
if (!a) return;
|
|
385
|
-
const
|
|
386
|
-
if (!
|
|
387
|
-
const l =
|
|
385
|
+
const h = a.querySelector(".ng-part-body table");
|
|
386
|
+
if (!h) return;
|
|
387
|
+
const l = h.querySelector("tbody.bindable-tbody");
|
|
388
388
|
if (!l) return;
|
|
389
389
|
const g = Array.from(l.querySelectorAll("tr")).map((b) => b.cloneNode(!0));
|
|
390
390
|
t(this, D).set(o, g);
|
|
391
391
|
});
|
|
392
|
-
const i = t(this,
|
|
392
|
+
const i = t(this, S).querySelector(".ng-container-body .ng-part-body"), e = t(this, S).querySelector(".ng-container-left .ng-part-body"), s = t(this, S).querySelector(".ng-container-right .ng-part-body"), r = t(this, S).querySelector(".ng-container-body .ng-part-header"), n = t(this, S).querySelector(".ng-container-body .ng-part-footer");
|
|
393
393
|
if (i) {
|
|
394
394
|
t(this, zt).call(this, i), t(this, At).call(this), t(this, St).call(this), t(this, lt).call(this, i.scrollTop);
|
|
395
395
|
let o = !1;
|
|
396
|
-
const a = /* @__PURE__ */
|
|
396
|
+
const a = /* @__PURE__ */ c((h) => {
|
|
397
397
|
if (o) return;
|
|
398
398
|
o = !0;
|
|
399
|
-
const l =
|
|
399
|
+
const l = h.scrollTop, f = h.scrollLeft;
|
|
400
400
|
i && i.scrollTop !== l && (i.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), r && r.scrollLeft !== f && (r.scrollLeft = f), n && n.scrollLeft !== f && (n.scrollLeft = f), t(this, lt).call(this, l), o = !1;
|
|
401
401
|
}, "handleContainerScroll");
|
|
402
|
-
[i, e, s].forEach((
|
|
403
|
-
|
|
404
|
-
a(
|
|
402
|
+
[i, e, s].forEach((h) => {
|
|
403
|
+
h && h.addEventListener("scroll", () => {
|
|
404
|
+
a(h);
|
|
405
405
|
}, { passive: !0 });
|
|
406
406
|
});
|
|
407
407
|
}
|
|
408
408
|
}, "initialize"));
|
|
409
|
-
d(this, Ot, /* @__PURE__ */
|
|
409
|
+
d(this, Ot, /* @__PURE__ */ c((i, e) => {
|
|
410
410
|
H.log("rowManager.#renderRows");
|
|
411
411
|
const s = t(this, D).get(e);
|
|
412
412
|
if (!s || s.length === 0) return;
|
|
@@ -415,14 +415,14 @@ const Ie = class Ie {
|
|
|
415
415
|
r.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
|
|
416
416
|
const n = r.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
417
417
|
for (let a = 0; a < t(this, wt); a++)
|
|
418
|
-
s.forEach((
|
|
419
|
-
o.appendChild(
|
|
418
|
+
s.forEach((h) => {
|
|
419
|
+
o.appendChild(h.cloneNode(!0));
|
|
420
420
|
});
|
|
421
421
|
n ? n.before(o) : r.appendChild(o), e === ".ng-container-body" && (t(this, Q).firstTr = r.querySelector("tr:not(.nodata)"));
|
|
422
422
|
}, "#renderRows"));
|
|
423
|
-
d(this, zt, /* @__PURE__ */
|
|
424
|
-
if (H.log("rowManager.#measureAndCacheHeight"), t(this,
|
|
425
|
-
return t(this,
|
|
423
|
+
d(this, zt, /* @__PURE__ */ c((i) => {
|
|
424
|
+
if (H.log("rowManager.#measureAndCacheHeight"), t(this, I) !== null && t(this, I) > 0)
|
|
425
|
+
return t(this, I);
|
|
426
426
|
H.log("#measureAndCacheHeight");
|
|
427
427
|
const e = t(this, D).get(".ng-container-body");
|
|
428
428
|
if (!e || e.length === 0) throw new Error("invalid dom");
|
|
@@ -433,65 +433,65 @@ const Ie = class Ie {
|
|
|
433
433
|
e.forEach((b) => {
|
|
434
434
|
n.appendChild(b.cloneNode(!0));
|
|
435
435
|
}), r ? r.before(n) : s.appendChild(n);
|
|
436
|
-
const o = t(this,
|
|
436
|
+
const o = t(this, S), a = o.style.display, h = o.style.visibility, l = o.style.position;
|
|
437
437
|
(a === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
438
438
|
let f = 0;
|
|
439
439
|
const g = s.querySelectorAll("tr");
|
|
440
440
|
if (g.forEach((b) => {
|
|
441
441
|
let u = b.offsetHeight || b.getBoundingClientRect().height;
|
|
442
442
|
if (u === 0) {
|
|
443
|
-
const
|
|
444
|
-
u = parseFloat(
|
|
443
|
+
const v = window.getComputedStyle(b);
|
|
444
|
+
u = parseFloat(v.height) || parseFloat(v.minHeight) || 0;
|
|
445
445
|
}
|
|
446
446
|
f += u;
|
|
447
|
-
}), g.forEach((b) => b.remove()), o.style.display = a, o.style.visibility =
|
|
448
|
-
return y(this,
|
|
447
|
+
}), g.forEach((b) => b.remove()), o.style.display = a, o.style.visibility = h, o.style.position = l, f <= 0) throw new Error("invalid dom");
|
|
448
|
+
return y(this, I, f), t(this, Et).call(this), t(this, I);
|
|
449
449
|
}, "#measureAndCacheHeight"));
|
|
450
|
-
d(this, St, /* @__PURE__ */
|
|
450
|
+
d(this, St, /* @__PURE__ */ c(() => {
|
|
451
451
|
H.log("rowManager.#updateVirtualScrollHeight");
|
|
452
|
-
const e = (t(this, P).data.get() || []).length, s = t(this,
|
|
452
|
+
const e = (t(this, P).data.get() || []).length, s = t(this, I), r = e * s;
|
|
453
453
|
H.log("🔍 [VirtualHeight]", { totalCount: e, rowHeight: s, totalVirtualHeight: r }), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
454
|
-
const o = t(this,
|
|
454
|
+
const o = t(this, S).querySelector(n);
|
|
455
455
|
if (!o) return;
|
|
456
456
|
const a = o.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
457
457
|
a && (a.style.height = `${r}px`);
|
|
458
458
|
});
|
|
459
459
|
}, "#updateVirtualScrollHeight"));
|
|
460
|
-
d(this, Et, /* @__PURE__ */
|
|
461
|
-
if (t(this, tt) > 0 && t(this,
|
|
462
|
-
const i = Math.ceil(t(this, tt) / t(this,
|
|
460
|
+
d(this, Et, /* @__PURE__ */ c(() => {
|
|
461
|
+
if (t(this, tt) > 0 && t(this, I) > 0) {
|
|
462
|
+
const i = Math.ceil(t(this, tt) / t(this, I));
|
|
463
463
|
y(this, wt, i + t(this, Wt));
|
|
464
464
|
}
|
|
465
465
|
}, "#updateRowCount"));
|
|
466
|
-
d(this, Bt, /* @__PURE__ */
|
|
467
|
-
var a,
|
|
468
|
-
const i = t(this,
|
|
466
|
+
d(this, Bt, /* @__PURE__ */ c(() => {
|
|
467
|
+
var a, h, l, f, g, b;
|
|
468
|
+
const i = t(this, S).querySelector(".ng-container-left .ng-part-body table"), e = t(this, S).querySelector(".ng-container-body .ng-part-body table"), s = t(this, S).querySelector(".ng-container-right .ng-part-body table");
|
|
469
469
|
if (e) {
|
|
470
|
-
const u = i ? Array.from(i.querySelectorAll("tbody tr")) : [],
|
|
471
|
-
for (let
|
|
472
|
-
const
|
|
473
|
-
((a = u[
|
|
474
|
-
((
|
|
475
|
-
((l =
|
|
476
|
-
], R = Math.max(...
|
|
477
|
-
R > 0 && (u[
|
|
470
|
+
const u = i ? Array.from(i.querySelectorAll("tbody tr")) : [], v = Array.from(e.querySelectorAll("tbody tr")), x = s ? Array.from(s.querySelectorAll("tbody tr")) : [], A = Math.max(u.length, v.length, x.length);
|
|
471
|
+
for (let m = 0; m < A; m++) {
|
|
472
|
+
const W = [
|
|
473
|
+
((a = u[m]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
474
|
+
((h = v[m]) == null ? void 0 : h.getBoundingClientRect().height) || 0,
|
|
475
|
+
((l = x[m]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
476
|
+
], R = Math.max(...W);
|
|
477
|
+
R > 0 && (u[m] && (u[m].style.height = `${R}px`), v[m] && (v[m].style.height = `${R}px`), x[m] && (x[m].style.height = `${R}px`));
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
|
-
const r = t(this,
|
|
480
|
+
const r = t(this, S).querySelector(".ng-container-left .ng-part-footer table"), n = t(this, S).querySelector(".ng-container-body .ng-part-footer table"), o = t(this, S).querySelector(".ng-container-right .ng-part-footer table");
|
|
481
481
|
if (n) {
|
|
482
|
-
const u = r ? Array.from(r.querySelectorAll("tfoot tr")) : [],
|
|
483
|
-
for (let
|
|
484
|
-
const
|
|
485
|
-
((f = u[
|
|
486
|
-
((g = m
|
|
487
|
-
((b =
|
|
488
|
-
], R = Math.max(...
|
|
489
|
-
R > 0 && (u[
|
|
482
|
+
const u = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], v = Array.from(n.querySelectorAll("tfoot tr")), x = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], A = Math.max(u.length, v.length, x.length);
|
|
483
|
+
for (let m = 0; m < A; m++) {
|
|
484
|
+
const W = [
|
|
485
|
+
((f = u[m]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
486
|
+
((g = v[m]) == null ? void 0 : g.getBoundingClientRect().height) || 0,
|
|
487
|
+
((b = x[m]) == null ? void 0 : b.getBoundingClientRect().height) || 0
|
|
488
|
+
], R = Math.max(...W);
|
|
489
|
+
R > 0 && (u[m] && (u[m].style.height = `${R}px`), v[m] && (v[m].style.height = `${R}px`), x[m] && (x[m].style.height = `${R}px`));
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
492
|
}, "#syncRowHeights"));
|
|
493
|
-
d(this, Dt, /* @__PURE__ */
|
|
494
|
-
!t(this,
|
|
493
|
+
d(this, Dt, /* @__PURE__ */ c(() => {
|
|
494
|
+
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (y(this, V, new ResizeObserver((i) => {
|
|
495
495
|
for (const e of i) {
|
|
496
496
|
const s = e.target;
|
|
497
497
|
if (!s.classList.contains("active")) continue;
|
|
@@ -500,29 +500,29 @@ const Ie = class Ie {
|
|
|
500
500
|
let n = 0;
|
|
501
501
|
const o = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
|
|
502
502
|
o && (n += o.offsetHeight), a && (n += a.offsetHeight);
|
|
503
|
-
const
|
|
504
|
-
t(this, tt) !==
|
|
503
|
+
const h = Math.max(r - n, 100);
|
|
504
|
+
t(this, tt) !== h && (y(this, tt, h), t(this, Et).call(this), t(this, I) !== null && (t(this, At).call(this), this.refresh()));
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
|
-
})), t(this, V).observe(t(this,
|
|
507
|
+
})), t(this, V).observe(t(this, S)));
|
|
508
508
|
}, "#initResizeObserver"));
|
|
509
|
-
d(this, At, /* @__PURE__ */
|
|
509
|
+
d(this, At, /* @__PURE__ */ c(() => {
|
|
510
510
|
H.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
511
|
-
const e = t(this,
|
|
511
|
+
const e = t(this, S).querySelector(i);
|
|
512
512
|
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Ot).call(this, e, i);
|
|
513
513
|
}), t(this, Pt).call(this), t(this, Bt).call(this);
|
|
514
514
|
}, "#renderAllContainers"));
|
|
515
|
-
d(this, Ae, /* @__PURE__ */
|
|
515
|
+
d(this, Ae, /* @__PURE__ */ c((i) => {
|
|
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, S).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 n = Array.from(r.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this, D).get(e)) == null ? void 0 : l.length) || 1,
|
|
522
|
+
const n = Array.from(r.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this, D).get(e)) == null ? void 0 : l.length) || 1, h = (t(this, P).data.get() || []).length;
|
|
523
523
|
n.forEach((f, g) => {
|
|
524
524
|
const b = i + Math.floor(g / o);
|
|
525
|
-
if (b >=
|
|
525
|
+
if (b >= h) {
|
|
526
526
|
f.style.visibility = "hidden";
|
|
527
527
|
return;
|
|
528
528
|
}
|
|
@@ -531,31 +531,32 @@ const Ie = class Ie {
|
|
|
531
531
|
});
|
|
532
532
|
});
|
|
533
533
|
}, "#adjustBufferRows"));
|
|
534
|
-
d(this, lt, /* @__PURE__ */
|
|
535
|
-
var
|
|
536
|
-
const e = t(this,
|
|
534
|
+
d(this, lt, /* @__PURE__ */ c((i) => {
|
|
535
|
+
var g, b;
|
|
536
|
+
const e = t(this, I);
|
|
537
537
|
if (!e || e <= 0) return;
|
|
538
538
|
const s = t(this, P).data.length;
|
|
539
539
|
if (s === 0) return;
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
540
|
+
i > 55094 && (i = 55094);
|
|
541
|
+
const r = ((g = t(this, D).get(".ng-container-body")) == null ? void 0 : g.length) || 1, n = t(this, S).querySelector(".ng-container-body .ng-part-body"), o = Math.max(0, s - Math.ceil(n.clientHeight / e)), a = Math.min(o, Math.max(0, Math.floor(i / e)));
|
|
542
|
+
let h = Math.floor(a * e);
|
|
543
|
+
H.log(`📜 [Scroll Inspect] scrollTop: ${i}, rowHeight: ${e}, maxStartIndex: ${o}, startIndex: ${a}, offsetY: ${h}`);
|
|
544
|
+
const l = t(this, Q).firstTr, f = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
|
|
545
|
+
(b = t(this, Q)) == null || b.scrollTables.forEach((u) => {
|
|
546
|
+
u.style.transform = `translate3d(0, ${h}px, 0)`;
|
|
547
|
+
}), f !== a && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((u) => {
|
|
548
|
+
const v = t(this, S).querySelector(u);
|
|
549
|
+
if (!v) return;
|
|
550
|
+
const x = v.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
551
|
+
if (!x) return;
|
|
552
|
+
Array.from(x.querySelectorAll("tr:not(.nodata)")).forEach((m, W) => {
|
|
553
|
+
const R = a + Math.floor(W / r);
|
|
554
|
+
if (R >= s) {
|
|
555
|
+
m.style.display = "none";
|
|
555
556
|
return;
|
|
556
557
|
}
|
|
557
|
-
const
|
|
558
|
-
|
|
558
|
+
const O = t(this, P).data.get(R);
|
|
559
|
+
m.style.display = "", t(this, qt).call(this, m, O, R);
|
|
559
560
|
});
|
|
560
561
|
});
|
|
561
562
|
}, "#handleScroll"));
|
|
@@ -573,42 +574,42 @@ const Ie = class Ie {
|
|
|
573
574
|
cell.dataset.row = dataIndex;
|
|
574
575
|
});
|
|
575
576
|
}; */
|
|
576
|
-
d(this, qt, /* @__PURE__ */
|
|
577
|
+
d(this, qt, /* @__PURE__ */ c((i, e, s) => {
|
|
577
578
|
i.dataset.row = s, i.data = e, Array.from(i.cells).forEach((r, n) => {
|
|
578
579
|
r.dataset.row = s;
|
|
579
580
|
const o = Array.from(r.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
|
|
580
581
|
o && typeof o.refresh == "function" && o.refresh();
|
|
581
582
|
});
|
|
582
583
|
}, "#bindRowData"));
|
|
583
|
-
d(this, Pt, /* @__PURE__ */
|
|
584
|
-
var
|
|
584
|
+
d(this, Pt, /* @__PURE__ */ c(() => {
|
|
585
|
+
var h, l, f;
|
|
585
586
|
H.log("rowManager.#syncHeaderHeights");
|
|
586
|
-
const i = t(this,
|
|
587
|
+
const i = t(this, S).querySelector(".ng-container-left .ng-part-header table"), e = t(this, S).querySelector(".ng-container-body .ng-part-header table"), s = t(this, S).querySelector(".ng-container-right .ng-part-header table");
|
|
587
588
|
if (!e) return;
|
|
588
589
|
const r = i ? Array.from(i.querySelectorAll("tr")) : [], n = Array.from(e.querySelectorAll("tr")), o = s ? Array.from(s.querySelectorAll("tr")) : [], a = Math.max(r.length, n.length, o.length);
|
|
589
590
|
for (let g = 0; g < a; g++) {
|
|
590
591
|
const b = [
|
|
591
|
-
((
|
|
592
|
+
((h = r[g]) == null ? void 0 : h.getBoundingClientRect().height) || 0,
|
|
592
593
|
((l = n[g]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
593
594
|
((f = o[g]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
594
595
|
], u = Math.max(...b);
|
|
595
596
|
u > 0 && (r[g] && (r[g].style.height = `${u}px`), n[g] && (n[g].style.height = `${u}px`), o[g] && (o[g].style.height = `${u}px`));
|
|
596
597
|
}
|
|
597
598
|
}, "#syncHeaderHeights"));
|
|
598
|
-
|
|
599
|
+
E(this, "destroy", /* @__PURE__ */ c(() => {
|
|
599
600
|
t(this, V) && (t(this, V).disconnect(), y(this, V, null));
|
|
600
601
|
}, "destroy"));
|
|
601
|
-
y(this, P, i.getRootNode().host), y(this,
|
|
602
|
+
y(this, P, i.getRootNode().host), y(this, S, i), t(this, Dt).call(this);
|
|
602
603
|
}
|
|
603
604
|
getRowHeight() {
|
|
604
|
-
return t(this,
|
|
605
|
+
return t(this, I);
|
|
605
606
|
}
|
|
606
607
|
templateLength(i = ".ng-container-body") {
|
|
607
608
|
var e;
|
|
608
609
|
return ((e = t(this, D).get(i)) == null ? void 0 : e.length) || 1;
|
|
609
610
|
}
|
|
610
611
|
};
|
|
611
|
-
P = new WeakMap(),
|
|
612
|
+
P = new WeakMap(), S = new WeakMap(), Q = new WeakMap(), D = new WeakMap(), I = new WeakMap(), V = new WeakMap(), tt = new WeakMap(), wt = new WeakMap(), Se = new WeakMap(), Ee = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), zt = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), Bt = new WeakMap(), Dt = new WeakMap(), At = new WeakMap(), Ae = new WeakMap(), lt = new WeakMap(), qt = new WeakMap(), Pt = new WeakMap(), c(Ie, "RowManager");
|
|
612
613
|
let ce = Ie;
|
|
613
614
|
const jt = class jt {
|
|
614
615
|
/**
|
|
@@ -622,18 +623,18 @@ const jt = class jt {
|
|
|
622
623
|
*/
|
|
623
624
|
static compile(i) {
|
|
624
625
|
if (!i) return null;
|
|
625
|
-
const e = /* @__PURE__ */
|
|
626
|
+
const e = /* @__PURE__ */ c((a) => {
|
|
626
627
|
a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
|
|
627
628
|
const f = l.getAttribute("cell-type") || "renderer";
|
|
628
629
|
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
629
630
|
let g = `cell-${f}`;
|
|
630
|
-
const b = l.getAttribute("data-bind"), u = l.getAttribute("data-expr"),
|
|
631
|
-
let
|
|
632
|
-
b &&
|
|
631
|
+
const b = l.getAttribute("data-bind"), u = l.getAttribute("data-expr"), v = l.getAttribute("maxbyte"), x = l.getAttribute("type");
|
|
632
|
+
let A = [];
|
|
633
|
+
b && A.push(`data-bind="${b}"`), u && A.push(`data-expr="${u}"`), v && A.push(`maxbyte="${v}"`), x && A.push(`type="${x}"`), l.innerHTML = `<${g} ${A.join(" ")}></${g}>`;
|
|
633
634
|
});
|
|
634
|
-
}, "processCellTypes"), s = /* @__PURE__ */
|
|
635
|
+
}, "processCellTypes"), s = /* @__PURE__ */ c((a) => {
|
|
635
636
|
if (!a.querySelector("colgroup")) {
|
|
636
|
-
const
|
|
637
|
+
const h = a.querySelector("tbody tr") || a.querySelector("tr"), l = h ? h.querySelectorAll("th, td").length : 1, f = document.createElement("colgroup"), g = Math.max(Math.floor(a.clientWidth / l), 100);
|
|
637
638
|
for (let b = 0; b < l; b++) {
|
|
638
639
|
const u = document.createElement("col");
|
|
639
640
|
u.setAttribute("width", g), f.appendChild(u);
|
|
@@ -641,53 +642,53 @@ const jt = class jt {
|
|
|
641
642
|
a.prepend(f);
|
|
642
643
|
}
|
|
643
644
|
if (!a.querySelector("thead")) {
|
|
644
|
-
const
|
|
645
|
-
l ? l.after(
|
|
645
|
+
const h = document.createElement("thead"), l = a.querySelector("colgroup");
|
|
646
|
+
l ? l.after(h) : a.prepend(h);
|
|
646
647
|
}
|
|
647
648
|
a.classList.add("nine-table-element");
|
|
648
|
-
}, "ensureTableStructure"), r = /* @__PURE__ */
|
|
649
|
-
const l = Array.from(a.querySelectorAll(
|
|
649
|
+
}, "ensureTableStructure"), r = /* @__PURE__ */ c((a, h) => {
|
|
650
|
+
const l = Array.from(a.querySelectorAll(h + " tr")), f = Array.from(a.querySelectorAll(h + " th," + h + " td")), g = l.length;
|
|
650
651
|
if (g === 0 || f.length === 0) return;
|
|
651
652
|
let b = 0;
|
|
652
|
-
f.forEach((
|
|
653
|
-
b +=
|
|
653
|
+
f.forEach((v) => {
|
|
654
|
+
b += v.colSpan || 1;
|
|
654
655
|
});
|
|
655
656
|
const u = Array.from(Array(g), () => Array(b).fill(null));
|
|
656
|
-
l.forEach((
|
|
657
|
-
const
|
|
658
|
-
let
|
|
659
|
-
Array.from(
|
|
660
|
-
for (let
|
|
661
|
-
if (u[
|
|
662
|
-
|
|
657
|
+
l.forEach((v) => {
|
|
658
|
+
const x = v.sectionRowIndex;
|
|
659
|
+
let A = 0;
|
|
660
|
+
Array.from(v.querySelectorAll("th,td")).forEach((m) => {
|
|
661
|
+
for (let O = 0; O < u[x].length; O++)
|
|
662
|
+
if (u[x][O] === null) {
|
|
663
|
+
A = O;
|
|
663
664
|
break;
|
|
664
665
|
}
|
|
665
|
-
const
|
|
666
|
-
for (let
|
|
666
|
+
const W = m.rowSpan || 1, R = m.colSpan || 1;
|
|
667
|
+
for (let O = 0; O < W; O++)
|
|
667
668
|
for (let yt = 0; yt < R; yt++)
|
|
668
|
-
|
|
669
|
+
x + O < g && A + yt < b && (u[x + O][A + yt] = O === 0 && yt === 0 ? "1" : "0");
|
|
669
670
|
});
|
|
670
|
-
}), l.forEach((
|
|
671
|
-
const
|
|
672
|
-
Array.from(
|
|
673
|
-
for (let
|
|
674
|
-
if (u[
|
|
675
|
-
|
|
671
|
+
}), l.forEach((v) => {
|
|
672
|
+
const x = v.sectionRowIndex;
|
|
673
|
+
Array.from(v.querySelectorAll("th,td")).forEach((A) => {
|
|
674
|
+
for (let m = 0; m < u[x].length; m++)
|
|
675
|
+
if (u[x][m] === "1") {
|
|
676
|
+
A.dataset.col = m, u[x][m] = "0";
|
|
676
677
|
break;
|
|
677
678
|
}
|
|
678
679
|
});
|
|
679
680
|
});
|
|
680
681
|
}, "resetColIndex"), n = i.cloneNode(!0);
|
|
681
|
-
return s(n), e(n), r(n, "thead"), r(n, "tbody"), r(n, "tfoot"), Array.from(n.querySelectorAll("colgroup col")).forEach((a,
|
|
682
|
+
return s(n), e(n), r(n, "thead"), r(n, "tbody"), r(n, "tfoot"), Array.from(n.querySelectorAll("colgroup col")).forEach((a, h) => {
|
|
682
683
|
const l = a.getAttribute("fixed");
|
|
683
|
-
l && n.querySelectorAll(`thead [data-col="${
|
|
684
|
+
l && n.querySelectorAll(`thead [data-col="${h}"], tbody [data-col="${h}"], tfoot [data-col="${h}"]`).forEach((f) => {
|
|
684
685
|
f.setAttribute("fixed", l);
|
|
685
686
|
});
|
|
686
687
|
}), n;
|
|
687
688
|
}
|
|
688
689
|
// 🎯 [추가] td/th에 선언된 cell-type 속성을 읽어 커스텀 태그로 자동 감싸기
|
|
689
690
|
};
|
|
690
|
-
|
|
691
|
+
c(jt, "TableCompiler");
|
|
691
692
|
let he = jt;
|
|
692
693
|
var Ft, et, st, Vt, Yt, ct, Ut, Xt;
|
|
693
694
|
const pt = class pt extends HTMLElement {
|
|
@@ -696,10 +697,10 @@ const pt = class pt extends HTMLElement {
|
|
|
696
697
|
d(this, Ft);
|
|
697
698
|
d(this, et, null);
|
|
698
699
|
d(this, st);
|
|
699
|
-
|
|
700
|
+
E(this, "invalidate", /* @__PURE__ */ c(() => {
|
|
700
701
|
t(this, st).refresh();
|
|
701
702
|
}, "invalidate"));
|
|
702
|
-
d(this, Vt, /* @__PURE__ */
|
|
703
|
+
d(this, Vt, /* @__PURE__ */ c(() => {
|
|
703
704
|
[
|
|
704
705
|
{ selector: ".ng-container-body", type: null },
|
|
705
706
|
{ selector: ".ng-container-left", type: "left" },
|
|
@@ -709,7 +710,7 @@ const pt = class pt extends HTMLElement {
|
|
|
709
710
|
(n = this.querySelector(`${s} .ng-part-header`)) == null || n.appendChild(t(this, ct).call(this, t(this, et), r, "header")), (o = this.querySelector(`${s} .ng-virtual-spacer`)) == null || o.before(t(this, ct).call(this, t(this, et), r, "body")), (a = this.querySelector(`${s} .ng-part-footer`)) == null || a.appendChild(t(this, ct).call(this, t(this, et), r, "footer"));
|
|
710
711
|
});
|
|
711
712
|
}, "#renderSplitContainers"));
|
|
712
|
-
d(this, Yt, /* @__PURE__ */
|
|
713
|
+
d(this, Yt, /* @__PURE__ */ c(() => {
|
|
713
714
|
["left", "right", "body"].forEach((e) => {
|
|
714
715
|
const s = this.querySelector(`.ng-container-${e}`), r = s == null ? void 0 : s.querySelectorAll("table");
|
|
715
716
|
if (!s || !r || r.length === 0) return;
|
|
@@ -720,7 +721,7 @@ const pt = class pt extends HTMLElement {
|
|
|
720
721
|
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${n}px`, s.style.width = `${n}px`);
|
|
721
722
|
});
|
|
722
723
|
}, "#updateContainerWidths"));
|
|
723
|
-
|
|
724
|
+
E(this, "generate", /* @__PURE__ */ c((e) => {
|
|
724
725
|
if (!e) return;
|
|
725
726
|
y(this, et, he.compile(e)), t(this, Vt).call(this), t(this, Yt).call(this);
|
|
726
727
|
const s = this.querySelector(".ng-container-body .ng-part-header"), r = this.querySelector(".ng-container-body .ng-part-footer"), n = this.querySelector(".ng-nodata-overlay");
|
|
@@ -729,14 +730,14 @@ const pt = class pt extends HTMLElement {
|
|
|
729
730
|
(o = this.querySelector("nine-table-hscrollbar")) == null || o.refresh();
|
|
730
731
|
}, 0);
|
|
731
732
|
}, "generate"));
|
|
732
|
-
d(this, ct, /* @__PURE__ */
|
|
733
|
-
const n = e.cloneNode(!0), o = n.querySelector("thead"), a = n.querySelector("tbody"),
|
|
733
|
+
d(this, ct, /* @__PURE__ */ c((e, s, r) => {
|
|
734
|
+
const n = e.cloneNode(!0), o = n.querySelector("thead"), a = n.querySelector("tbody"), h = n.querySelector("tfoot");
|
|
734
735
|
if (r === "header") {
|
|
735
|
-
if (a && a.remove(),
|
|
736
|
+
if (a && a.remove(), h && h.remove(), e.querySelector("tbody")) {
|
|
736
737
|
const f = document.createElement("tbody");
|
|
737
738
|
f.className = "fixed-tbody", n.appendChild(f);
|
|
738
739
|
}
|
|
739
|
-
} else r === "body" ? (o && o.remove(),
|
|
740
|
+
} else r === "body" ? (o && o.remove(), h && h.remove(), a && (a.className = "bindable-tbody")) : r === "footer" && (o && o.remove(), a && a.remove());
|
|
740
741
|
return s === "left" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
741
742
|
l.getAttribute("fixed") !== "left" && l.remove();
|
|
742
743
|
}) : s === "right" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
@@ -745,19 +746,19 @@ const pt = class pt extends HTMLElement {
|
|
|
745
746
|
l.remove();
|
|
746
747
|
}), n;
|
|
747
748
|
}, "#createSplitTable"));
|
|
748
|
-
|
|
749
|
-
|
|
749
|
+
E(this, "getRowHeight", /* @__PURE__ */ c(() => t(this, st).getRowHeight(), "getRowHeight"));
|
|
750
|
+
E(this, "scrollToX", /* @__PURE__ */ c((e) => {
|
|
750
751
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
751
752
|
s && (s.scrollLeft = e);
|
|
752
753
|
}, "scrollToX"));
|
|
753
|
-
|
|
754
|
+
E(this, "scrollToY", /* @__PURE__ */ c((e) => {
|
|
754
755
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
755
756
|
s && (s.scrollTop = e);
|
|
756
757
|
}, "scrollToY"));
|
|
757
|
-
d(this, Ut, /* @__PURE__ */
|
|
758
|
+
d(this, Ut, /* @__PURE__ */ c(() => {
|
|
758
759
|
t(this, Xt).call(this);
|
|
759
760
|
}, "#init"));
|
|
760
|
-
d(this, Xt, /* @__PURE__ */
|
|
761
|
+
d(this, Xt, /* @__PURE__ */ c(() => {
|
|
761
762
|
const e = pt.SCROLLBAR_SIZE;
|
|
762
763
|
this.innerHTML = `
|
|
763
764
|
<style>
|
|
@@ -955,14 +956,14 @@ const pt = class pt extends HTMLElement {
|
|
|
955
956
|
this.innerHTML = "", H.log("NineTableSheet destroyed.");
|
|
956
957
|
}
|
|
957
958
|
};
|
|
958
|
-
Ft = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), ct = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(),
|
|
959
|
+
Ft = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), ct = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(), c(pt, "NineTableSheet"), E(pt, "SCROLLBAR_SIZE", 16);
|
|
959
960
|
let $t = pt;
|
|
960
961
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", $t);
|
|
961
962
|
var Kt, Rt;
|
|
962
963
|
const _e = class _e extends HTMLElement {
|
|
963
964
|
constructor() {
|
|
964
965
|
super();
|
|
965
|
-
d(this, Kt, /* @__PURE__ */
|
|
966
|
+
d(this, Kt, /* @__PURE__ */ c(() => {
|
|
966
967
|
var e;
|
|
967
968
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
968
969
|
var o;
|
|
@@ -970,21 +971,21 @@ const _e = class _e extends HTMLElement {
|
|
|
970
971
|
t(this, Rt).call(this, n, r);
|
|
971
972
|
}), t(this, Rt).call(this, 0, !1);
|
|
972
973
|
}, "#init"));
|
|
973
|
-
d(this, Rt, /* @__PURE__ */
|
|
974
|
-
const r = /* @__PURE__ */
|
|
974
|
+
d(this, Rt, /* @__PURE__ */ c((e, s = !1) => {
|
|
975
|
+
const r = /* @__PURE__ */ c(() => {
|
|
975
976
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
976
977
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((u) => u.style.setProperty("display", "none"));
|
|
977
978
|
const b = f.filter((u) => u.classList.contains("active"));
|
|
978
979
|
b.length < 2 || b.forEach((u) => {
|
|
979
|
-
const
|
|
980
|
-
|
|
980
|
+
const v = parseInt(u.getAttribute("data-index"), 10), x = this.querySelector(`nine-splitter[data-split-index="${v}"]`), A = f[v + 1];
|
|
981
|
+
x && A && A.classList.contains("active") && x.style.setProperty("display", "flex");
|
|
981
982
|
});
|
|
982
|
-
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = n.querySelectorAll(".nine-tab-item"),
|
|
983
|
+
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = n.querySelectorAll(".nine-tab-item"), h = o.querySelectorAll("nine-table-sheet");
|
|
983
984
|
if (!a[e]) return;
|
|
984
985
|
if (!s)
|
|
985
986
|
a.forEach((f, g) => {
|
|
986
987
|
f.classList.toggle("active", g === e);
|
|
987
|
-
}),
|
|
988
|
+
}), h.forEach((f, g) => {
|
|
988
989
|
const b = g === e;
|
|
989
990
|
f.classList.toggle("active", b), f.style.flex = b ? "1 1 100%" : "";
|
|
990
991
|
});
|
|
@@ -1006,31 +1007,31 @@ const _e = class _e extends HTMLElement {
|
|
|
1006
1007
|
t(this, Kt).call(this);
|
|
1007
1008
|
}
|
|
1008
1009
|
};
|
|
1009
|
-
Kt = new WeakMap(), Rt = new WeakMap(),
|
|
1010
|
+
Kt = new WeakMap(), Rt = new WeakMap(), c(_e, "NineTableSheets");
|
|
1010
1011
|
let de = _e;
|
|
1011
1012
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", de);
|
|
1012
1013
|
var M, Zt, Tt, Gt;
|
|
1013
1014
|
const Ne = class Ne {
|
|
1014
1015
|
constructor(i) {
|
|
1015
1016
|
d(this, M);
|
|
1016
|
-
d(this, Zt, /* @__PURE__ */
|
|
1017
|
+
d(this, Zt, /* @__PURE__ */ c(() => {
|
|
1017
1018
|
t(this, Gt).call(this), new ResizeObserver((i) => {
|
|
1018
1019
|
for (let e of i)
|
|
1019
1020
|
t(this, M).getAttribute("auto-height") === "true" && t(this, Tt).call(this);
|
|
1020
1021
|
}).observe(t(this, M));
|
|
1021
1022
|
}, "#init"));
|
|
1022
|
-
d(this, Tt, /* @__PURE__ */
|
|
1023
|
-
var
|
|
1023
|
+
d(this, Tt, /* @__PURE__ */ c(() => {
|
|
1024
|
+
var h, l;
|
|
1024
1025
|
const i = Array.from(t(this, M).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
1025
1026
|
if (i.length === 0) return;
|
|
1026
|
-
const e = parseInt(t(this, M).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), r = (
|
|
1027
|
+
const e = parseInt(t(this, M).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), r = (h = t(this, M).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : h.getBoundingClientRect().height, n = (l = t(this, M).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = $t.SCROLLBAR_SIZE, a = e * s + r + n + o;
|
|
1027
1028
|
t(this, M).style.height = `${a}px`;
|
|
1028
1029
|
}, "#applyAutoHeight"));
|
|
1029
|
-
d(this, Gt, /* @__PURE__ */
|
|
1030
|
-
const e = Array.from(t(this, M).children).filter((
|
|
1030
|
+
d(this, Gt, /* @__PURE__ */ c(() => {
|
|
1031
|
+
const e = Array.from(t(this, M).children).filter((h) => h.tagName === "TABLE"), s = t(this, M).getAttribute("auto-height") === "true", r = e.length, n = e.map((h, l) => {
|
|
1031
1032
|
const g = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, b = l < r - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
1032
1033
|
return g + b;
|
|
1033
|
-
}).join(""), o = e.map((
|
|
1034
|
+
}).join(""), o = e.map((h, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
1034
1035
|
t(this, M).shadowRoot.innerHTML = `
|
|
1035
1036
|
<style>
|
|
1036
1037
|
:host {
|
|
@@ -1153,23 +1154,23 @@ const Ne = class Ne {
|
|
|
1153
1154
|
<nine-table-footer></nine-table-footer>
|
|
1154
1155
|
`, t(this, M).shadowRoot.querySelector("nine-table-sheets").classList.add("nodata");
|
|
1155
1156
|
const a = t(this, M).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1156
|
-
a == null || a.forEach((
|
|
1157
|
+
a == null || a.forEach((h, l) => {
|
|
1157
1158
|
e[l] && setTimeout(() => {
|
|
1158
|
-
|
|
1159
|
+
h.generate(e[l]), s && t(this, Tt).call(this);
|
|
1159
1160
|
});
|
|
1160
1161
|
});
|
|
1161
1162
|
}, "#render"));
|
|
1162
1163
|
y(this, M, i), t(this, Zt).call(this);
|
|
1163
1164
|
}
|
|
1164
1165
|
};
|
|
1165
|
-
M = new WeakMap(), Zt = new WeakMap(), Tt = new WeakMap(), Gt = new WeakMap(),
|
|
1166
|
+
M = new WeakMap(), Zt = new WeakMap(), Tt = new WeakMap(), Gt = new WeakMap(), c(Ne, "LayoutManager");
|
|
1166
1167
|
let fe = Ne;
|
|
1167
1168
|
var kt, ht;
|
|
1168
1169
|
const We = class We {
|
|
1169
1170
|
constructor(i) {
|
|
1170
1171
|
d(this, kt);
|
|
1171
1172
|
d(this, ht, -1);
|
|
1172
|
-
|
|
1173
|
+
E(this, "count", /* @__PURE__ */ c(() => t(this, kt).rawRecords.length, "count"));
|
|
1173
1174
|
y(this, kt, i);
|
|
1174
1175
|
}
|
|
1175
1176
|
get at() {
|
|
@@ -1180,20 +1181,20 @@ const We = class We {
|
|
|
1180
1181
|
});
|
|
1181
1182
|
}
|
|
1182
1183
|
};
|
|
1183
|
-
kt = new WeakMap(), ht = new WeakMap(),
|
|
1184
|
+
kt = new WeakMap(), ht = new WeakMap(), c(We, "ngRow");
|
|
1184
1185
|
let ue = We;
|
|
1185
|
-
var
|
|
1186
|
-
const
|
|
1186
|
+
var _, k, N, dt, Jt, Y, Qt, it, Ct, te, ee, ft;
|
|
1187
|
+
const z = class z {
|
|
1187
1188
|
constructor(i, e) {
|
|
1188
|
-
d(this,
|
|
1189
|
+
d(this, _);
|
|
1189
1190
|
d(this, k);
|
|
1190
|
-
d(this,
|
|
1191
|
+
d(this, N, []);
|
|
1191
1192
|
d(this, dt, []);
|
|
1192
1193
|
d(this, Jt, 0);
|
|
1193
1194
|
d(this, Y, []);
|
|
1194
|
-
d(this, Qt, /* @__PURE__ */
|
|
1195
|
+
d(this, Qt, /* @__PURE__ */ c(() => {
|
|
1195
1196
|
y(this, Y, []);
|
|
1196
|
-
const i = t(this,
|
|
1197
|
+
const i = t(this, _).template || [];
|
|
1197
1198
|
Array.from(i).forEach((e) => {
|
|
1198
1199
|
var s;
|
|
1199
1200
|
t(this, Y).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
@@ -1201,48 +1202,48 @@ const O = class O {
|
|
|
1201
1202
|
e.__ng || (e.__ng = t(this, Ct).call(this)), e.__ng.height = t(this, Y).slice();
|
|
1202
1203
|
});
|
|
1203
1204
|
}, "#initialize"));
|
|
1204
|
-
d(this, it, /* @__PURE__ */
|
|
1205
|
-
const i = t(this,
|
|
1206
|
-
i == null || i.classList.toggle("nodata", this.length === 0), t(this,
|
|
1205
|
+
d(this, it, /* @__PURE__ */ c(() => {
|
|
1206
|
+
const i = t(this, _).shadowRoot.querySelector("nine-table-sheets");
|
|
1207
|
+
i == null || i.classList.toggle("nodata", this.length === 0), t(this, _).shadowRoot.querySelectorAll("nine-table-sheet").forEach((e) => {
|
|
1207
1208
|
e.invalidate();
|
|
1208
1209
|
});
|
|
1209
1210
|
}, "#invalidate"));
|
|
1210
|
-
|
|
1211
|
+
E(this, "get", /* @__PURE__ */ c((i, e) => {
|
|
1211
1212
|
var n;
|
|
1212
1213
|
const s = this.getValidData();
|
|
1213
1214
|
if (!s || s.length <= 0) return;
|
|
1214
1215
|
if (i == null) return t(this, ft).call(this, s);
|
|
1215
1216
|
if (i < 0 || i >= s.length) return null;
|
|
1216
|
-
const r = typeof ((n = t(this,
|
|
1217
|
+
const r = typeof ((n = t(this, _).fields) == null ? void 0 : n.get) == "function" ? t(this, _).fields.get() : [];
|
|
1217
1218
|
if (e != null) {
|
|
1218
1219
|
const o = r.indexOf(e);
|
|
1219
1220
|
return o >= 0 ? s[i].v[o] : null;
|
|
1220
1221
|
}
|
|
1221
1222
|
return t(this, ft).call(this, s[i]);
|
|
1222
1223
|
}, "get"));
|
|
1223
|
-
|
|
1224
|
+
E(this, "set", /* @__PURE__ */ c((i) => {
|
|
1224
1225
|
this.clear(), this.add(i, !1), t(this, it).call(this);
|
|
1225
1226
|
}, "set"));
|
|
1226
|
-
d(this, Ct, /* @__PURE__ */
|
|
1227
|
-
rowState:
|
|
1227
|
+
d(this, Ct, /* @__PURE__ */ c(() => ({
|
|
1228
|
+
rowState: z.ROW_STATE.EMPTY,
|
|
1228
1229
|
deleted: !1,
|
|
1229
1230
|
filtered: !1,
|
|
1230
1231
|
height: t(this, Y).slice(),
|
|
1231
1232
|
o: {},
|
|
1232
1233
|
c: {},
|
|
1233
|
-
_: [0, 0, 0, 0,
|
|
1234
|
+
_: [0, 0, 0, 0, z.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Y).slice(), -1, {}, {}]
|
|
1234
1235
|
}), "#getDefaultMeta"));
|
|
1235
|
-
|
|
1236
|
-
y(this,
|
|
1236
|
+
E(this, "reset", /* @__PURE__ */ c(() => {
|
|
1237
|
+
y(this, N, []), y(this, dt, []), t(this, it).call(this);
|
|
1237
1238
|
}, "reset"));
|
|
1238
|
-
|
|
1239
|
+
E(this, "clear", /* @__PURE__ */ c(() => {
|
|
1239
1240
|
var i;
|
|
1240
|
-
t(this, k).rawRecords = [], y(this,
|
|
1241
|
+
t(this, k).rawRecords = [], y(this, N, []), y(this, dt, []), (i = t(this, k).viewRecords) != null && i.reset && t(this, k).viewRecords.reset();
|
|
1241
1242
|
}, "clear"));
|
|
1242
|
-
d(this, te, /* @__PURE__ */
|
|
1243
|
+
d(this, te, /* @__PURE__ */ c((i) => {
|
|
1243
1244
|
var r;
|
|
1244
1245
|
Array.isArray(i) || (i = [i]);
|
|
1245
|
-
const e = typeof ((r = t(this,
|
|
1246
|
+
const e = typeof ((r = t(this, _).fields) == null ? void 0 : r.get) == "function" ? t(this, _).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
1246
1247
|
return i.forEach((n) => {
|
|
1247
1248
|
const o = { v: [] };
|
|
1248
1249
|
e.forEach((a) => {
|
|
@@ -1250,61 +1251,61 @@ const O = class O {
|
|
|
1250
1251
|
}), s.push(o);
|
|
1251
1252
|
}), s;
|
|
1252
1253
|
}, "#json2Array"));
|
|
1253
|
-
d(this, ee, /* @__PURE__ */
|
|
1254
|
-
e.__ng = t(this, Ct).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState =
|
|
1254
|
+
d(this, ee, /* @__PURE__ */ c((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1255
|
+
e.__ng = t(this, Ct).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = z.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1255
1256
|
}), i), "#defaultInsert"));
|
|
1256
|
-
|
|
1257
|
+
E(this, "add", /* @__PURE__ */ c((i, e = !0) => {
|
|
1257
1258
|
i === void 0 && (i = {});
|
|
1258
1259
|
const s = t(this, te).call(this, i);
|
|
1259
1260
|
t(this, k).rawRecords = t(this, k).rawRecords.concat(t(this, ee).call(this, s)), this.resetRecords();
|
|
1260
1261
|
const r = this.count() - 1;
|
|
1261
1262
|
return e || s.forEach((n, o) => {
|
|
1262
1263
|
const a = t(this, k).rawRecords[r - o];
|
|
1263
|
-
a && (a.__ng.rowState =
|
|
1264
|
+
a && (a.__ng.rowState = z.ROW_STATE.EMPTY);
|
|
1264
1265
|
}), t(this, it).call(this), r;
|
|
1265
1266
|
}, "add"));
|
|
1266
|
-
|
|
1267
|
+
E(this, "delete", /* @__PURE__ */ c((i) => {
|
|
1267
1268
|
let e = [];
|
|
1268
1269
|
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this, k).host.row.at] : e = [parseInt(i, 10)], e.sort((s, r) => r - s).forEach((s) => {
|
|
1269
|
-
if (t(this,
|
|
1270
|
-
const r = t(this,
|
|
1271
|
-
t(this,
|
|
1272
|
-
n.__ng.rowid === r && (n.__ng.deleted = !0, n.__ng.rowState =
|
|
1270
|
+
if (t(this, N)[s]) {
|
|
1271
|
+
const r = t(this, N)[s].__ng.rowid;
|
|
1272
|
+
t(this, N)[s].__ng.rowState === z.ROW_STATE.INSERT ? t(this, k).rawRecords = t(this, k).rawRecords.filter((n) => n.__ng.rowid !== r) : t(this, k).rawRecords.forEach((n) => {
|
|
1273
|
+
n.__ng.rowid === r && (n.__ng.deleted = !0, n.__ng.rowState = z.ROW_STATE.DELETE);
|
|
1273
1274
|
});
|
|
1274
1275
|
}
|
|
1275
1276
|
}), this.resetRecords(), t(this, it).call(this);
|
|
1276
1277
|
}, "delete"));
|
|
1277
|
-
|
|
1278
|
-
var
|
|
1278
|
+
E(this, "setValue", /* @__PURE__ */ c((i, e, s) => {
|
|
1279
|
+
var h;
|
|
1279
1280
|
i = parseInt(i, 10);
|
|
1280
|
-
const n = (typeof ((
|
|
1281
|
+
const n = (typeof ((h = t(this, _).fields) == null ? void 0 : h.get) == "function" ? t(this, _).fields.get() : []).indexOf(e);
|
|
1281
1282
|
if (n < 0) return;
|
|
1282
1283
|
const o = this.getValidData()[i];
|
|
1283
1284
|
if (!o) return;
|
|
1284
1285
|
const a = o.v[n];
|
|
1285
|
-
a !== s && o.__ng.rowState !==
|
|
1286
|
+
a !== s && o.__ng.rowState !== z.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = a), o.__ng.rowState = z.ROW_STATE.UPDATE), o.v[n] = s;
|
|
1286
1287
|
}, "setValue"));
|
|
1287
|
-
|
|
1288
|
-
y(this, dt, t(this, k).rawRecords.filter((i) => !i.__ng.deleted)), y(this,
|
|
1288
|
+
E(this, "resetRecords", /* @__PURE__ */ c(() => {
|
|
1289
|
+
y(this, dt, t(this, k).rawRecords.filter((i) => !i.__ng.deleted)), y(this, N, t(this, k).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, k).rawRecords.forEach((i, e) => {
|
|
1289
1290
|
i.__ng.rowidx = e;
|
|
1290
|
-
}), t(this,
|
|
1291
|
+
}), t(this, N).forEach((i, e) => {
|
|
1291
1292
|
i.__ng.i = e;
|
|
1292
1293
|
});
|
|
1293
1294
|
}, "resetRecords"));
|
|
1294
|
-
|
|
1295
|
-
d(this, ft, /* @__PURE__ */
|
|
1295
|
+
E(this, "getValidData", /* @__PURE__ */ c(() => (t(this, N).length === 0 && t(this, k).rawRecords.length > 0 && this.resetRecords(), t(this, N)), "getValidData"));
|
|
1296
|
+
d(this, ft, /* @__PURE__ */ c((i) => {
|
|
1296
1297
|
var o;
|
|
1297
1298
|
if (!i) return i;
|
|
1298
|
-
const e = !Array.isArray(i), s = e ? [i] : i, r = typeof ((o = t(this,
|
|
1299
|
-
const
|
|
1299
|
+
const e = !Array.isArray(i), s = e ? [i] : i, r = typeof ((o = t(this, _).fields) == null ? void 0 : o.get) == "function" ? t(this, _).fields.get() : [], n = s.filter((a) => !a.__ng.deleted).map((a) => {
|
|
1300
|
+
const h = {};
|
|
1300
1301
|
return r.forEach((l, f) => {
|
|
1301
|
-
|
|
1302
|
-
}),
|
|
1302
|
+
h[l] = a.v ? a.v[f] : a[l];
|
|
1303
|
+
}), h.__ng = a.__ng, h;
|
|
1303
1304
|
});
|
|
1304
1305
|
return e ? n[0] : n;
|
|
1305
1306
|
}, "#conv"));
|
|
1306
|
-
|
|
1307
|
-
y(this,
|
|
1307
|
+
E(this, "count", /* @__PURE__ */ c(() => this.getValidData().length, "count"));
|
|
1308
|
+
y(this, _, i), y(this, k, e), t(this, Qt).call(this);
|
|
1308
1309
|
}
|
|
1309
1310
|
get source() {
|
|
1310
1311
|
return t(this, ft).call(this, t(this, k).rawRecords);
|
|
@@ -1316,24 +1317,24 @@ const O = class O {
|
|
|
1316
1317
|
return ++Ue(this, Jt)._;
|
|
1317
1318
|
}
|
|
1318
1319
|
get count() {
|
|
1319
|
-
return t(this,
|
|
1320
|
+
return t(this, N).length;
|
|
1320
1321
|
}
|
|
1321
1322
|
get length() {
|
|
1322
|
-
return t(this,
|
|
1323
|
+
return t(this, N).length;
|
|
1323
1324
|
}
|
|
1324
1325
|
getRowCount() {
|
|
1325
1326
|
return this.length;
|
|
1326
1327
|
}
|
|
1327
1328
|
};
|
|
1328
|
-
|
|
1329
|
-
|
|
1329
|
+
_ = new WeakMap(), k = new WeakMap(), N = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), Y = new WeakMap(), Qt = new WeakMap(), it = new WeakMap(), Ct = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), ft = new WeakMap(), c(z, "ngData"), // 🎯 행 상태 정의 상수를 클래스 내부로 내재화
|
|
1330
|
+
E(z, "ROW_STATE", {
|
|
1330
1331
|
EMPTY: "EMPTY",
|
|
1331
1332
|
NORMAL: "NORMAL",
|
|
1332
1333
|
INSERT: "INSERT",
|
|
1333
1334
|
UPDATE: "UPDATE",
|
|
1334
1335
|
DELETE: "DELETE"
|
|
1335
1336
|
});
|
|
1336
|
-
let ge =
|
|
1337
|
+
let ge = z;
|
|
1337
1338
|
var rt;
|
|
1338
1339
|
const Oe = class Oe {
|
|
1339
1340
|
constructor(i) {
|
|
@@ -1355,7 +1356,7 @@ const Oe = class Oe {
|
|
|
1355
1356
|
}, this.setDataSource([]);
|
|
1356
1357
|
}
|
|
1357
1358
|
};
|
|
1358
|
-
rt = new WeakMap(),
|
|
1359
|
+
rt = new WeakMap(), c(Oe, "ngDataManager");
|
|
1359
1360
|
let be = Oe;
|
|
1360
1361
|
var ut, L, Lt, se;
|
|
1361
1362
|
const ze = class ze {
|
|
@@ -1363,18 +1364,18 @@ const ze = class ze {
|
|
|
1363
1364
|
constructor(i) {
|
|
1364
1365
|
d(this, ut);
|
|
1365
1366
|
d(this, L, []);
|
|
1366
|
-
|
|
1367
|
+
E(this, "add", /* @__PURE__ */ c((i, e = "string") => {
|
|
1367
1368
|
i.forEach((s) => {
|
|
1368
1369
|
t(this, L).some((r) => r.name === s) || t(this, L).push({ name: s, type: e });
|
|
1369
1370
|
}), t(this, Lt).call(this);
|
|
1370
1371
|
}, "add"));
|
|
1371
|
-
d(this, Lt, /* @__PURE__ */
|
|
1372
|
+
d(this, Lt, /* @__PURE__ */ c(() => {
|
|
1372
1373
|
const i = /* @__PURE__ */ new Map();
|
|
1373
1374
|
t(this, L).forEach((e) => {
|
|
1374
1375
|
i.set(e.name, e.type);
|
|
1375
1376
|
}), y(this, L, Array.from(i, ([e, s]) => ({ name: e, type: s }))), y(this, L, t(this, L).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, L).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
1376
1377
|
}, "#adjust"));
|
|
1377
|
-
d(this, se, /* @__PURE__ */
|
|
1378
|
+
d(this, se, /* @__PURE__ */ c(() => {
|
|
1378
1379
|
y(this, L, []), H.log(t(this, ut).querySelectorAll("table"));
|
|
1379
1380
|
const i = Array.from(t(this, ut).querySelectorAll("table"));
|
|
1380
1381
|
if (!(!i || i.length === 0)) {
|
|
@@ -1396,9 +1397,9 @@ const ze = class ze {
|
|
|
1396
1397
|
}
|
|
1397
1398
|
o.split("data.").forEach((a) => {
|
|
1398
1399
|
if (a.trim() != "") {
|
|
1399
|
-
const
|
|
1400
|
+
const h = a.search(/[^_A-Za-z0-9]/g);
|
|
1400
1401
|
let l = "";
|
|
1401
|
-
|
|
1402
|
+
h >= 0 ? l = a.substring(0, h) : o.startsWith("data.") && (l = a.replace("data.", "")), l && t(this, L).push({ name: l, type: "string" });
|
|
1402
1403
|
}
|
|
1403
1404
|
});
|
|
1404
1405
|
});
|
|
@@ -1428,7 +1429,7 @@ const ze = class ze {
|
|
|
1428
1429
|
return t(this, L).some((e) => e.name === i);
|
|
1429
1430
|
}
|
|
1430
1431
|
};
|
|
1431
|
-
ut = new WeakMap(), L = new WeakMap(), Lt = new WeakMap(), se = new WeakMap(),
|
|
1432
|
+
ut = new WeakMap(), L = new WeakMap(), Lt = new WeakMap(), se = new WeakMap(), c(ze, "ngFields");
|
|
1432
1433
|
let ye = ze;
|
|
1433
1434
|
var nt, ie, re;
|
|
1434
1435
|
const Be = class Be extends HTMLElement {
|
|
@@ -1437,7 +1438,7 @@ const Be = class Be extends HTMLElement {
|
|
|
1437
1438
|
//#created = false;
|
|
1438
1439
|
d(this, nt);
|
|
1439
1440
|
d(this, ie);
|
|
1440
|
-
d(this, re, /* @__PURE__ */
|
|
1441
|
+
d(this, re, /* @__PURE__ */ c(() => {
|
|
1441
1442
|
this.fields = new ye(this), y(this, ie, new fe(this)), H.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1442
1443
|
}, "#init"));
|
|
1443
1444
|
this.attachShadow({ mode: "open" }), y(this, nt, new be(this));
|
|
@@ -1461,7 +1462,7 @@ const Be = class Be extends HTMLElement {
|
|
|
1461
1462
|
return t(this, nt);
|
|
1462
1463
|
}
|
|
1463
1464
|
};
|
|
1464
|
-
nt = new WeakMap(), ie = new WeakMap(), re = new WeakMap(),
|
|
1465
|
+
nt = new WeakMap(), ie = new WeakMap(), re = new WeakMap(), c(Be, "NineTable");
|
|
1465
1466
|
let pe = Be;
|
|
1466
1467
|
customElements.get("nine-table") || customElements.define("nine-table", pe);
|
|
1467
1468
|
const mt = class mt extends HTMLElement {
|
|
@@ -1475,7 +1476,7 @@ const mt = class mt extends HTMLElement {
|
|
|
1475
1476
|
connectedCallback() {
|
|
1476
1477
|
}
|
|
1477
1478
|
};
|
|
1478
|
-
|
|
1479
|
+
c(mt, "BasicCellElement"), E(mt, "_styleCache", /* @__PURE__ */ new Map()), E(mt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1479
1480
|
let me = mt;
|
|
1480
1481
|
var C, Ht, p, qe, Re, Te, ke, Ce;
|
|
1481
1482
|
const De = class De extends me {
|
|
@@ -1488,7 +1489,7 @@ const De = class De extends me {
|
|
|
1488
1489
|
d(this, Re);
|
|
1489
1490
|
d(this, Te);
|
|
1490
1491
|
d(this, ke);
|
|
1491
|
-
|
|
1492
|
+
E(this, "getDisplayText", /* @__PURE__ */ c((e) => {
|
|
1492
1493
|
if (t(this, p))
|
|
1493
1494
|
if (t(this, p).closest("tbody")) {
|
|
1494
1495
|
const s = t(this, p).closest("tr").data, r = parseInt(t(this, p).dataset.row);
|
|
@@ -1508,22 +1509,22 @@ const De = class De extends me {
|
|
|
1508
1509
|
} catch {
|
|
1509
1510
|
}
|
|
1510
1511
|
}, "getDisplayText"));
|
|
1511
|
-
d(this, Ce, /* @__PURE__ */
|
|
1512
|
+
d(this, Ce, /* @__PURE__ */ c(() => {
|
|
1512
1513
|
if (!(!t(this, C) || !t(this, C).template || !t(this, p).closest("tbody.bindable"))) {
|
|
1513
1514
|
var e = ninegrid.j.querySelectorAll(t(this, p)).attr("suppress");
|
|
1514
1515
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1515
1516
|
var s = t(this, p).closest("tr"), r = [];
|
|
1516
|
-
$("th,td", s).each((
|
|
1517
|
-
var R = ninegrid.j.querySelectorAll(
|
|
1518
|
-
R &&
|
|
1517
|
+
$("th,td", s).each((m, W) => {
|
|
1518
|
+
var R = ninegrid.j.querySelectorAll(W).attr("suppress");
|
|
1519
|
+
R && W.dataset.row && (R = parseInt(R), !isNaN(R) && R <= e && r.push(R));
|
|
1519
1520
|
}), r.sort();
|
|
1520
1521
|
var n = !1;
|
|
1521
1522
|
if (parseInt(s.sectionRowIndex / t(this, C).template.length) > 0)
|
|
1522
1523
|
for (var o of r) {
|
|
1523
1524
|
if (o > e) break;
|
|
1524
|
-
var a = parseInt(t(this, p).dataset.row),
|
|
1525
|
+
var a = parseInt(t(this, p).dataset.row), h = a - 1, l = t(this, p).closest("tr").data, f = t(this, C).data.get(h);
|
|
1525
1526
|
t(this, p).dataset.matrixRow;
|
|
1526
|
-
var g = t(this, C).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, p).dataset.matrixRow}"]`), b = g.dataset.expr ? this.getExprValue(g.dataset.expr, l, a) : l[g.dataset.bind], u = g.dataset.expr ? this.getExprValue(g.dataset.expr, f,
|
|
1527
|
+
var g = t(this, C).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, p).dataset.matrixRow}"]`), b = g.dataset.expr ? this.getExprValue(g.dataset.expr, l, a) : l[g.dataset.bind], u = g.dataset.expr ? this.getExprValue(g.dataset.expr, f, h) : f[g.dataset.bind];
|
|
1527
1528
|
if (b != u) {
|
|
1528
1529
|
n = !0;
|
|
1529
1530
|
break;
|
|
@@ -1532,12 +1533,12 @@ const De = class De extends me {
|
|
|
1532
1533
|
else
|
|
1533
1534
|
n = !0;
|
|
1534
1535
|
n ? ninegrid.j.querySelectorAll(t(this, p)).removeClass("suppress") : ninegrid.j.querySelectorAll(t(this, p)).addClass("suppress"), ninegrid.j.querySelectorAll(t(this, p)).hasClass("hidden") || (n ? ninegrid.j.querySelectorAll(t(this, p)).removeClass("hidden") : ninegrid.j.querySelectorAll(t(this, p)).addClass("hidden"));
|
|
1535
|
-
var
|
|
1536
|
-
$(
|
|
1536
|
+
var v = parseInt(t(this, p).dataset.matrixRow), x = v - 1, A = t(this, C).body.querySelector(`tbody.bindable [data-col="${t(this, p).dataset.col}"][data-matrix-row="${x}"]`);
|
|
1537
|
+
$(A).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this, p)).hasClass("suppress") ? ninegrid.j.querySelectorAll(A).removeClass("last-none-suppress").addClass("last-suppress") : !$(A).hasClass("suppress") && ninegrid.j.querySelectorAll(t(this, p)).hasClass("suppress") ? ninegrid.j.querySelectorAll(A).removeClass("last-suppress").addClass("last-none-suppress") : ninegrid.j.querySelectorAll(A).removeClass("last-none-suppress").removeClass("last-suppress");
|
|
1537
1538
|
}
|
|
1538
1539
|
}
|
|
1539
1540
|
}, "#resetSuppress"));
|
|
1540
|
-
|
|
1541
|
+
E(this, "getExprValue", /* @__PURE__ */ c((e, s, r, n) => {
|
|
1541
1542
|
if (typeof e < "u")
|
|
1542
1543
|
try {
|
|
1543
1544
|
r = parseInt(r);
|
|
@@ -1573,7 +1574,7 @@ const De = class De extends me {
|
|
|
1573
1574
|
return parseInt(t(this, p).dataset.row), t(this, Ht).data[e];
|
|
1574
1575
|
}
|
|
1575
1576
|
};
|
|
1576
|
-
C = new WeakMap(), Ht = new WeakMap(), p = new WeakMap(), qe = new WeakMap(), Re = new WeakMap(), Te = new WeakMap(), ke = new WeakMap(), Ce = new WeakMap(),
|
|
1577
|
+
C = new WeakMap(), Ht = new WeakMap(), p = new WeakMap(), qe = new WeakMap(), Re = new WeakMap(), Te = new WeakMap(), ke = new WeakMap(), Ce = new WeakMap(), c(De, "CellElement");
|
|
1577
1578
|
let ve = De;
|
|
1578
1579
|
const Pe = class Pe extends ve {
|
|
1579
1580
|
constructor() {
|
|
@@ -1586,7 +1587,7 @@ const Pe = class Pe extends ve {
|
|
|
1586
1587
|
return super.refresh();
|
|
1587
1588
|
}
|
|
1588
1589
|
};
|
|
1589
|
-
|
|
1590
|
+
c(Pe, "EditableCellElement");
|
|
1590
1591
|
let xe = Pe;
|
|
1591
1592
|
var Mt, ot, gt, bt, ne, U, Le;
|
|
1592
1593
|
const je = class je extends xe {
|
|
@@ -1598,7 +1599,7 @@ const je = class je extends xe {
|
|
|
1598
1599
|
d(this, bt);
|
|
1599
1600
|
d(this, ne);
|
|
1600
1601
|
d(this, U);
|
|
1601
|
-
|
|
1602
|
+
E(this, "refresh", /* @__PURE__ */ c(() => {
|
|
1602
1603
|
const e = super.refresh();
|
|
1603
1604
|
t(this, Mt).value = e;
|
|
1604
1605
|
}, "refresh"));
|
|
@@ -1632,7 +1633,7 @@ const je = class je extends xe {
|
|
|
1632
1633
|
if (!v) this.reset();
|
|
1633
1634
|
};
|
|
1634
1635
|
*/
|
|
1635
|
-
d(this, Le, /* @__PURE__ */
|
|
1636
|
+
d(this, Le, /* @__PURE__ */ c((e) => {
|
|
1636
1637
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1637
1638
|
if (t(this, ot) == "number") {
|
|
1638
1639
|
let n = [];
|
|
@@ -1660,7 +1661,7 @@ const je = class je extends xe {
|
|
|
1660
1661
|
`, super.connectedCallback(), y(this, Mt, this.querySelector("input"));
|
|
1661
1662
|
}
|
|
1662
1663
|
};
|
|
1663
|
-
Mt = new WeakMap(), ot = new WeakMap(), gt = new WeakMap(), bt = new WeakMap(), ne = new WeakMap(), U = new WeakMap(), Le = new WeakMap(),
|
|
1664
|
+
Mt = new WeakMap(), ot = new WeakMap(), gt = new WeakMap(), bt = new WeakMap(), ne = new WeakMap(), U = new WeakMap(), Le = new WeakMap(), c(je, "CellInputText");
|
|
1664
1665
|
let we = je;
|
|
1665
1666
|
customElements.get("cell-input-text");
|
|
1666
1667
|
customElements.get("cell-input") || customElements.define("cell-input", we);
|