@ninebone/table 0.0.678 → 0.0.679
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 +241 -241
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +6 -6
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -3,7 +3,7 @@ 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
|
|
6
|
+
var h = (q, i) => Fe(q, "name", { value: i, configurable: !0 });
|
|
7
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) => ({
|
|
@@ -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
|
+
h(He, "Trace");
|
|
24
24
|
let oe = He;
|
|
25
|
-
const
|
|
26
|
-
var
|
|
27
|
-
const
|
|
25
|
+
const T = new oe();
|
|
26
|
+
var z, j, S, X, K, Z, _t, G, Nt;
|
|
27
|
+
const $e = class $e extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
d(this,
|
|
30
|
+
d(this, z);
|
|
31
31
|
d(this, j, !1);
|
|
32
32
|
d(this, S);
|
|
33
33
|
d(this, X);
|
|
34
34
|
d(this, K);
|
|
35
35
|
d(this, Z);
|
|
36
|
-
d(this, _t, /* @__PURE__ */
|
|
37
|
-
if (!t(this,
|
|
38
|
-
const e = t(this,
|
|
36
|
+
d(this, _t, /* @__PURE__ */ h(() => {
|
|
37
|
+
if (!t(this, z)) return;
|
|
38
|
+
const e = t(this, z).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
|
-
E(this, "refresh", /* @__PURE__ */
|
|
44
|
-
if (!t(this,
|
|
43
|
+
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
44
|
+
if (!t(this, z) || !t(this, S) || t(this, j)) return;
|
|
45
45
|
const e = t(this, S).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const r = t(this, S).track, n = t(this, S).thumb, o = t(this,
|
|
48
|
-
if (a !== 0 &&
|
|
47
|
+
const r = t(this, S).track, n = t(this, S).thumb, o = t(this, z).querySelector(".ng-container-bottom"), a = e.clientWidth, c = s.scrollWidth;
|
|
48
|
+
if (a !== 0 && c > a)
|
|
49
49
|
o && (o.style.display = "flex");
|
|
50
50
|
else {
|
|
51
51
|
o && (o.style.display = "none");
|
|
@@ -53,28 +53,28 @@ 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 / c), l), 20);
|
|
57
57
|
n.style.width = `${f}px`;
|
|
58
|
-
const u = e.scrollLeft, b =
|
|
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
61
|
const v = l - f;
|
|
62
62
|
g > v && (g = v), n.style.left = `${g}px`, t(this, S).left.disabled = g === 0, t(this, S).right.disabled = g >= v - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
d(this, G, /* @__PURE__ */
|
|
64
|
+
d(this, G, /* @__PURE__ */ h((e) => {
|
|
65
65
|
if (!t(this, S)) return !1;
|
|
66
66
|
const s = t(this, S).container, r = s.querySelector("table");
|
|
67
67
|
if (!r) return !1;
|
|
68
68
|
const n = t(this, S).track.getBoundingClientRect(), o = t(this, S).thumb.clientWidth;
|
|
69
69
|
let a = e;
|
|
70
70
|
a < 0 && (a = 0);
|
|
71
|
-
const
|
|
72
|
-
a >
|
|
71
|
+
const c = n.width - o;
|
|
72
|
+
a > c && (a = c), a = parseInt(a, 10), t(this, S).thumb.style.left = `${a}px`, t(this, S).left.disabled = a === 0, t(this, S).right.disabled = a >= c - 1;
|
|
73
73
|
const l = s.clientWidth, u = r.scrollWidth - l;
|
|
74
|
-
return
|
|
74
|
+
return c > 0 && u > 0 && (s.scrollLeft = a / c * u), a > 0 && a < c - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
d(this, Nt, /* @__PURE__ */
|
|
77
|
-
const e = /* @__PURE__ */
|
|
76
|
+
d(this, Nt, /* @__PURE__ */ h(() => {
|
|
77
|
+
const e = /* @__PURE__ */ h((r) => {
|
|
78
78
|
clearInterval(t(this, X)), clearInterval(t(this, K));
|
|
79
79
|
const n = parseInt(t(this, S).thumb.style.left || 0, 10);
|
|
80
80
|
t(this, G).call(this, n + r), y(this, X, setInterval(() => {
|
|
@@ -83,7 +83,7 @@ const Me = class Me extends HTMLElement {
|
|
|
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__ */ h(() => {
|
|
87
87
|
clearInterval(t(this, X)), clearInterval(t(this, K));
|
|
88
88
|
}, "clearTimer");
|
|
89
89
|
["mouseup", "mouseleave", "touchend"].forEach((r) => {
|
|
@@ -100,11 +100,11 @@ const Me = class Me extends HTMLElement {
|
|
|
100
100
|
}), t(this, S).thumb.addEventListener("mousedown", (r) => {
|
|
101
101
|
if (r.button !== 0) return;
|
|
102
102
|
r.stopPropagation(), r.preventDefault(), y(this, j, !0), this.shiftX = r.clientX - t(this, S).thumb.getBoundingClientRect().left;
|
|
103
|
-
const n = /* @__PURE__ */
|
|
103
|
+
const n = /* @__PURE__ */ h((a) => {
|
|
104
104
|
if (!t(this, j)) return;
|
|
105
|
-
const
|
|
106
|
-
t(this, G).call(this, a.clientX -
|
|
107
|
-
}, "onMouseMove"), o = /* @__PURE__ */
|
|
105
|
+
const c = t(this, S).track.getBoundingClientRect();
|
|
106
|
+
t(this, G).call(this, a.clientX - c.left - this.shiftX);
|
|
107
|
+
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
108
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);
|
|
@@ -112,7 +112,7 @@ const Me = class Me extends HTMLElement {
|
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
114
114
|
connectedCallback() {
|
|
115
|
-
if (y(this,
|
|
115
|
+
if (y(this, z, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, z)) return;
|
|
116
116
|
this.innerHTML = `
|
|
117
117
|
<style>
|
|
118
118
|
nine-table-hscrollbar {
|
|
@@ -176,8 +176,8 @@ 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__ */
|
|
180
|
-
const s = t(this,
|
|
179
|
+
const e = /* @__PURE__ */ h(() => {
|
|
180
|
+
const s = t(this, z).querySelector(".ng-container-body .ng-part-body");
|
|
181
181
|
if (!s) {
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
@@ -198,51 +198,51 @@ const Me = class Me extends HTMLElement {
|
|
|
198
198
|
t(this, Z) && t(this, Z).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
|
|
202
|
-
let ae =
|
|
201
|
+
z = new WeakMap(), j = new WeakMap(), S = new WeakMap(), X = new WeakMap(), K = new WeakMap(), Z = new WeakMap(), _t = new WeakMap(), G = new WeakMap(), Nt = new WeakMap(), h($e, "NineTableHScrollBar");
|
|
202
|
+
let ae = $e;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ae);
|
|
204
|
-
var F, at, J,
|
|
205
|
-
const
|
|
204
|
+
var F, at, J, k, vt, xt, Wt;
|
|
205
|
+
const Me = class Me extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
208
|
d(this, F);
|
|
209
209
|
d(this, at);
|
|
210
210
|
d(this, J, !1);
|
|
211
|
-
d(this,
|
|
211
|
+
d(this, k);
|
|
212
212
|
d(this, vt, 0);
|
|
213
213
|
d(this, xt, 0);
|
|
214
|
-
E(this, "refresh", /* @__PURE__ */
|
|
215
|
-
if (!t(this, F) || !t(this,
|
|
216
|
-
const e = t(this,
|
|
217
|
-
if (
|
|
214
|
+
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
|
+
if (!t(this, F) || !t(this, k)) return;
|
|
216
|
+
const e = t(this, k).container, s = t(this, k).track, r = t(this, k).thumb, n = e.clientHeight, o = t(this, F).data.length, a = t(this, at).getRowHeight(), c = o * a;
|
|
217
|
+
if (c <= 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 / c), l), 20);
|
|
225
225
|
r.style.height = `${f}px`;
|
|
226
|
-
const u = e.scrollTop, b = Math.max(
|
|
226
|
+
const u = e.scrollTop, b = Math.max(c - n, 1);
|
|
227
227
|
let g = 0;
|
|
228
228
|
b > 0 && (g = u / b * (l - f));
|
|
229
229
|
const v = l - f;
|
|
230
|
-
g < 0 && (g = 0), g > v && (g = v), r.style.top = `${g}px`, t(this,
|
|
230
|
+
g < 0 && (g = 0), g > v && (g = v), r.style.top = `${g}px`, t(this, k).top.disabled = u <= 0, t(this, k).bottom.disabled = u >= b - 1;
|
|
231
231
|
}, "refresh"));
|
|
232
|
-
d(this, Wt, /* @__PURE__ */
|
|
233
|
-
|
|
234
|
-
const e = t(this,
|
|
232
|
+
d(this, Wt, /* @__PURE__ */ h(() => {
|
|
233
|
+
T.log("nine-table-vscrollbar.#init");
|
|
234
|
+
const e = t(this, k).container, s = /* @__PURE__ */ h(() => {
|
|
235
235
|
const n = (t(this, F).data.get() || []).length, o = t(this, at).getRowHeight();
|
|
236
236
|
return n * o;
|
|
237
237
|
}, "getContentHeight");
|
|
238
238
|
e.addEventListener("scroll", () => {
|
|
239
239
|
t(this, J) || this.refresh();
|
|
240
|
-
}), t(this,
|
|
240
|
+
}), t(this, k).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__ */ h((a) => {
|
|
244
244
|
if (!t(this, J)) return;
|
|
245
|
-
const
|
|
245
|
+
const c = t(this, k).track.getBoundingClientRect(), l = t(this, k).thumb.clientHeight, u = c.height - l, b = a.clientY - t(this, vt), g = e.clientHeight, v = s(), w = Math.max(v - g, 1);
|
|
246
246
|
if (u > 0 && w > 0) {
|
|
247
247
|
const A = b / u * w;
|
|
248
248
|
let m = t(this, xt) + A;
|
|
@@ -250,21 +250,21 @@ const $e = class $e extends HTMLElement {
|
|
|
250
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__ */ h(() => {
|
|
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);
|
|
257
|
-
}), t(this,
|
|
258
|
-
if (r.button !== 0 || r.target === t(this,
|
|
259
|
-
const n = t(this,
|
|
257
|
+
}), t(this, k).track.addEventListener("mousedown", (r) => {
|
|
258
|
+
if (r.button !== 0 || r.target === t(this, k).thumb) return;
|
|
259
|
+
const n = t(this, k).track.getBoundingClientRect(), o = t(this, k).thumb.clientHeight, a = r.clientY - n.top - o / 2, l = n.height - o, f = e.clientHeight, u = s(), b = Math.max(u - f, 1);
|
|
260
260
|
if (l > 0 && b > 0) {
|
|
261
261
|
const g = Math.max(0, Math.min(1, a / l));
|
|
262
262
|
e.scrollTop = g * b;
|
|
263
263
|
}
|
|
264
264
|
this.refresh();
|
|
265
|
-
}), t(this,
|
|
265
|
+
}), t(this, k).top.addEventListener("click", () => {
|
|
266
266
|
e.scrollTop -= 40;
|
|
267
|
-
}), t(this,
|
|
267
|
+
}), t(this, k).bottom.addEventListener("click", () => {
|
|
268
268
|
e.scrollTop += 40;
|
|
269
269
|
});
|
|
270
270
|
}, "#init"));
|
|
@@ -334,13 +334,13 @@ 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__ */ h(() => {
|
|
338
338
|
const s = t(this, F).shadowRoot.querySelector(".ng-container-body .ng-part-body");
|
|
339
339
|
if (!s) {
|
|
340
340
|
setTimeout(e, 10);
|
|
341
341
|
return;
|
|
342
342
|
}
|
|
343
|
-
y(this,
|
|
343
|
+
y(this, k, {
|
|
344
344
|
container: s,
|
|
345
345
|
track: this.querySelector(".ng-scroll-track"),
|
|
346
346
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
@@ -351,10 +351,10 @@ const $e = class $e extends HTMLElement {
|
|
|
351
351
|
e();
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
|
-
F = new WeakMap(), at = new WeakMap(), J = new WeakMap(),
|
|
355
|
-
let le =
|
|
354
|
+
F = new WeakMap(), at = new WeakMap(), J = new WeakMap(), k = new WeakMap(), vt = new WeakMap(), xt = new WeakMap(), Wt = new WeakMap(), h(Me, "NineTableVScrollBar");
|
|
355
|
+
let le = Me;
|
|
356
356
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", le);
|
|
357
|
-
var P, x, Q, D, I, V, tt, wt, Se, Ee, Ot,
|
|
357
|
+
var P, x, Q, D, I, V, tt, wt, Se, Ee, Ot, Bt, St, Et, At, zt, Dt, qt, Ae, lt, Rt, Pt;
|
|
358
358
|
const Ie = class Ie {
|
|
359
359
|
constructor(i) {
|
|
360
360
|
d(this, P);
|
|
@@ -369,22 +369,22 @@ const Ie = class Ie {
|
|
|
369
369
|
d(this, Ee, !1);
|
|
370
370
|
//#ticking = false; // 🎯 고속 스크롤 스로틀링용 플래그
|
|
371
371
|
d(this, Ot, 3);
|
|
372
|
-
E(this, "refresh", /* @__PURE__ */
|
|
372
|
+
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
373
373
|
var e;
|
|
374
|
-
|
|
374
|
+
T.log("rowManager.refresh");
|
|
375
375
|
const i = t(this, x).querySelector(".ng-container-body .ng-part-body");
|
|
376
376
|
i && (t(this, St).call(this), t(this, Et).call(this), t(this, lt).call(this, i.scrollTop), (e = t(this, x).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
377
377
|
}, "refresh"));
|
|
378
|
-
E(this, "initialize", /* @__PURE__ */
|
|
379
|
-
|
|
378
|
+
E(this, "initialize", /* @__PURE__ */ h(() => {
|
|
379
|
+
T.log("rowManager.initialize"), y(this, Q, {
|
|
380
380
|
scrollTables: t(this, x).querySelectorAll(".ng-part-body table"),
|
|
381
381
|
firstTr: t(this, x).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
382
382
|
}), y(this, I, null), t(this, D).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
383
383
|
const a = t(this, x).querySelector(o);
|
|
384
384
|
if (!a) return;
|
|
385
|
-
const
|
|
386
|
-
if (!
|
|
387
|
-
const l =
|
|
385
|
+
const c = a.querySelector(".ng-part-body table");
|
|
386
|
+
if (!c) return;
|
|
387
|
+
const l = c.querySelector("tbody.bindable-tbody");
|
|
388
388
|
if (!l) return;
|
|
389
389
|
const u = Array.from(l.querySelectorAll("tr")).map((b) => b.cloneNode(!0));
|
|
390
390
|
t(this, D).set(o, u);
|
|
@@ -393,21 +393,21 @@ const Ie = class Ie {
|
|
|
393
393
|
if (i) {
|
|
394
394
|
t(this, St).call(this), t(this, qt).call(this), t(this, Et).call(this), t(this, lt).call(this, i.scrollTop);
|
|
395
395
|
let o = !1;
|
|
396
|
-
const a = /* @__PURE__ */
|
|
396
|
+
const a = /* @__PURE__ */ h((c) => {
|
|
397
397
|
if (o) return;
|
|
398
398
|
o = !0;
|
|
399
|
-
const l =
|
|
399
|
+
const l = c.scrollTop, f = c.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((c) => {
|
|
403
|
+
c && c.addEventListener("scroll", () => {
|
|
404
|
+
a(c);
|
|
405
405
|
}, { passive: !0 });
|
|
406
406
|
});
|
|
407
407
|
}
|
|
408
408
|
}, "initialize"));
|
|
409
|
-
d(this,
|
|
410
|
-
|
|
409
|
+
d(this, Bt, /* @__PURE__ */ h((i, e) => {
|
|
410
|
+
T.log("rowManager.#renderRows");
|
|
411
411
|
const s = t(this, D).get(e);
|
|
412
412
|
if (!s || s.length === 0) return;
|
|
413
413
|
const r = i.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
@@ -415,26 +415,26 @@ 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((c) => {
|
|
419
|
+
o.appendChild(c.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, St, /* @__PURE__ */
|
|
423
|
+
d(this, St, /* @__PURE__ */ h(() => {
|
|
424
424
|
if (t(this, I) !== null && t(this, I) > 0)
|
|
425
425
|
return t(this, I);
|
|
426
426
|
const i = t(this, x).querySelector(".ng-container-body .ng-part-body");
|
|
427
|
-
|
|
427
|
+
T.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
430
|
const s = i.querySelector("tbody.bindable-tbody");
|
|
431
|
-
if (
|
|
431
|
+
if (T.log(s), !s) throw new Error("invalid dom");
|
|
432
432
|
s.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
|
|
433
433
|
const r = s.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
434
434
|
e.forEach((b) => {
|
|
435
435
|
n.appendChild(b.cloneNode(!0));
|
|
436
436
|
}), r ? r.before(n) : s.appendChild(n);
|
|
437
|
-
const o = t(this, x), a = o.style.display,
|
|
437
|
+
const o = t(this, x), a = o.style.display, c = o.style.visibility, l = o.style.position;
|
|
438
438
|
(a === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
439
439
|
let f = 0;
|
|
440
440
|
const u = s.querySelectorAll("tr");
|
|
@@ -445,34 +445,34 @@ const Ie = class Ie {
|
|
|
445
445
|
g = parseFloat(v.height) || parseFloat(v.minHeight) || 0;
|
|
446
446
|
}
|
|
447
447
|
f += g;
|
|
448
|
-
}), u.forEach((b) => b.remove()), o.style.display = a, o.style.visibility =
|
|
448
|
+
}), u.forEach((b) => b.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l, f <= 0) throw new Error("#measureAndCacheHeight() invalid dom");
|
|
449
449
|
return y(this, I, f), t(this, At).call(this), t(this, I);
|
|
450
450
|
}, "#measureAndCacheHeight"));
|
|
451
|
-
d(this, Et, /* @__PURE__ */
|
|
452
|
-
|
|
451
|
+
d(this, Et, /* @__PURE__ */ h(() => {
|
|
452
|
+
T.log("rowManager.#updateVirtualScrollHeight");
|
|
453
453
|
const e = (t(this, P).data.get() || []).length, s = t(this, I), r = e * s;
|
|
454
|
-
|
|
454
|
+
T.log("🔍 [VirtualHeight]", { totalCount: e, rowHeight: s, totalVirtualHeight: r }), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
455
455
|
const o = t(this, x).querySelector(n);
|
|
456
456
|
if (!o) return;
|
|
457
457
|
const a = o.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
458
458
|
a && (a.style.height = `${r}px`);
|
|
459
459
|
});
|
|
460
460
|
}, "#updateVirtualScrollHeight"));
|
|
461
|
-
d(this, At, /* @__PURE__ */
|
|
461
|
+
d(this, At, /* @__PURE__ */ h(() => {
|
|
462
462
|
if (t(this, tt) > 0 && t(this, I) > 0) {
|
|
463
463
|
const i = Math.ceil(t(this, tt) / t(this, I));
|
|
464
464
|
y(this, wt, i + t(this, Ot));
|
|
465
465
|
}
|
|
466
466
|
}, "#updateRowCount"));
|
|
467
|
-
d(this,
|
|
468
|
-
var a,
|
|
467
|
+
d(this, zt, /* @__PURE__ */ h(() => {
|
|
468
|
+
var a, c, l, f, u, b;
|
|
469
469
|
const i = t(this, x).querySelector(".ng-container-left .ng-part-body table"), e = t(this, x).querySelector(".ng-container-body .ng-part-body table"), s = t(this, x).querySelector(".ng-container-right .ng-part-body table");
|
|
470
470
|
if (e) {
|
|
471
471
|
const g = i ? Array.from(i.querySelectorAll("tbody tr")) : [], v = Array.from(e.querySelectorAll("tbody tr")), w = s ? Array.from(s.querySelectorAll("tbody tr")) : [], A = Math.max(g.length, v.length, w.length);
|
|
472
472
|
for (let m = 0; m < A; m++) {
|
|
473
473
|
const W = [
|
|
474
474
|
((a = g[m]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
475
|
-
((
|
|
475
|
+
((c = v[m]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
476
476
|
((l = w[m]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
477
477
|
], R = Math.max(...W);
|
|
478
478
|
R > 0 && (g[m] && (g[m].style.height = `${R}px`), v[m] && (v[m].style.height = `${R}px`), w[m] && (w[m].style.height = `${R}px`));
|
|
@@ -491,7 +491,7 @@ const Ie = class Ie {
|
|
|
491
491
|
}
|
|
492
492
|
}
|
|
493
493
|
}, "#syncRowHeights"));
|
|
494
|
-
d(this, Dt, /* @__PURE__ */
|
|
494
|
+
d(this, Dt, /* @__PURE__ */ h(() => {
|
|
495
495
|
!t(this, x) || !(t(this, x) instanceof HTMLElement) || (y(this, V, new ResizeObserver((i) => {
|
|
496
496
|
for (const e of i) {
|
|
497
497
|
const s = e.target;
|
|
@@ -501,29 +501,29 @@ const Ie = class Ie {
|
|
|
501
501
|
let n = 0;
|
|
502
502
|
const o = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
|
|
503
503
|
o && (n += o.offsetHeight), a && (n += a.offsetHeight);
|
|
504
|
-
const
|
|
505
|
-
t(this, tt) !==
|
|
504
|
+
const c = Math.max(r - n, 100);
|
|
505
|
+
t(this, tt) !== c && (y(this, tt, c), t(this, At).call(this), t(this, I) !== null && (t(this, qt).call(this), this.refresh()));
|
|
506
506
|
}
|
|
507
507
|
}
|
|
508
508
|
})), t(this, V).observe(t(this, x)));
|
|
509
509
|
}, "#initResizeObserver"));
|
|
510
|
-
d(this, qt, /* @__PURE__ */
|
|
511
|
-
|
|
510
|
+
d(this, qt, /* @__PURE__ */ h(() => {
|
|
511
|
+
T.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
512
512
|
const e = t(this, x).querySelector(i);
|
|
513
|
-
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this,
|
|
514
|
-
}), t(this, Pt).call(this), t(this,
|
|
513
|
+
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Bt).call(this, e, i);
|
|
514
|
+
}), t(this, Pt).call(this), t(this, zt).call(this);
|
|
515
515
|
}, "#renderAllContainers"));
|
|
516
|
-
d(this, Ae, /* @__PURE__ */
|
|
516
|
+
d(this, Ae, /* @__PURE__ */ h((i) => {
|
|
517
517
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
518
518
|
var l;
|
|
519
519
|
const s = t(this, x).querySelector(e);
|
|
520
520
|
if (!s) return;
|
|
521
521
|
const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
522
522
|
if (!r) return;
|
|
523
|
-
const n = Array.from(r.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this, D).get(e)) == null ? void 0 : l.length) || 1,
|
|
523
|
+
const n = Array.from(r.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this, D).get(e)) == null ? void 0 : l.length) || 1, c = (t(this, P).data.get() || []).length;
|
|
524
524
|
n.forEach((f, u) => {
|
|
525
525
|
const b = i + Math.floor(u / o);
|
|
526
|
-
if (b >=
|
|
526
|
+
if (b >= c) {
|
|
527
527
|
f.style.visibility = "hidden";
|
|
528
528
|
return;
|
|
529
529
|
}
|
|
@@ -532,21 +532,21 @@ const Ie = class Ie {
|
|
|
532
532
|
});
|
|
533
533
|
});
|
|
534
534
|
}, "#adjustBufferRows"));
|
|
535
|
-
d(this, lt, /* @__PURE__ */
|
|
535
|
+
d(this, lt, /* @__PURE__ */ h((i) => {
|
|
536
536
|
var u, b;
|
|
537
537
|
const e = t(this, I);
|
|
538
538
|
if (!e || e <= 0) return;
|
|
539
539
|
const s = t(this, P).data.length;
|
|
540
540
|
if (s === 0) return;
|
|
541
541
|
const r = ((u = t(this, D).get(".ng-container-body")) == null ? void 0 : u.length) || 1, n = t(this, x).querySelector(".ng-container-body .ng-part-body");
|
|
542
|
-
|
|
542
|
+
T.log("bodyContainer.clientHeight", n.clientHeight);
|
|
543
543
|
const o = Math.max(0, s - Math.floor(n.clientHeight / e)), a = Math.min(o, Math.max(0, Math.floor(i / e)));
|
|
544
|
-
let
|
|
545
|
-
a === o &&
|
|
544
|
+
let c = Math.floor(a * e);
|
|
545
|
+
T.log(`📜 [Scroll Calc] maxStartIndex: ${o}, startIndex: ${a}, offsetY: ${c}`), a === o && T.log(`📜 [Scroll Inspect] scrollTop: ${i}, rowHeight: ${e}, maxStartIndex: ${o}, startIndex: ${a}, offsetY: ${c}`);
|
|
546
546
|
const l = t(this, Q).firstTr, f = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
|
|
547
547
|
(b = t(this, Q)) == null || b.scrollTables.forEach((g) => {
|
|
548
|
-
g.style.transform = `translate3d(0, ${
|
|
549
|
-
}), f !== a && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
|
|
548
|
+
g.style.transform = `translate3d(0, ${c}px, 0)`;
|
|
549
|
+
}), f !== a && (T.log(`🔄 [Row Bind Trigger] currentStartIndex(${f}) !== startIndex(${a})`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
|
|
550
550
|
const v = t(this, x).querySelector(g);
|
|
551
551
|
if (!v) return;
|
|
552
552
|
const w = v.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
@@ -560,7 +560,7 @@ const Ie = class Ie {
|
|
|
560
560
|
const O = t(this, P).data.get(R);
|
|
561
561
|
m.style.display = "", t(this, Rt).call(this, m, O, R);
|
|
562
562
|
});
|
|
563
|
-
});
|
|
563
|
+
}));
|
|
564
564
|
}, "#handleScroll"));
|
|
565
565
|
/**
|
|
566
566
|
#bindRowData = (tr, record, dataIndex) => {
|
|
@@ -576,29 +576,29 @@ const Ie = class Ie {
|
|
|
576
576
|
cell.dataset.row = dataIndex;
|
|
577
577
|
});
|
|
578
578
|
}; */
|
|
579
|
-
d(this, Rt, /* @__PURE__ */
|
|
579
|
+
d(this, Rt, /* @__PURE__ */ h((i, e, s) => {
|
|
580
580
|
i.dataset.row = s, i.data = e, Array.from(i.cells).forEach((r, n) => {
|
|
581
581
|
r.dataset.row = s;
|
|
582
582
|
const o = Array.from(r.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
|
|
583
583
|
o && typeof o.refresh == "function" && o.refresh();
|
|
584
584
|
});
|
|
585
585
|
}, "#bindRowData"));
|
|
586
|
-
d(this, Pt, /* @__PURE__ */
|
|
587
|
-
var
|
|
588
|
-
|
|
586
|
+
d(this, Pt, /* @__PURE__ */ h(() => {
|
|
587
|
+
var c, l, f;
|
|
588
|
+
T.log("rowManager.#syncHeaderHeights");
|
|
589
589
|
const i = t(this, x).querySelector(".ng-container-left .ng-part-header table"), e = t(this, x).querySelector(".ng-container-body .ng-part-header table"), s = t(this, x).querySelector(".ng-container-right .ng-part-header table");
|
|
590
590
|
if (!e) return;
|
|
591
591
|
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);
|
|
592
592
|
for (let u = 0; u < a; u++) {
|
|
593
593
|
const b = [
|
|
594
|
-
((
|
|
594
|
+
((c = r[u]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
595
595
|
((l = n[u]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
596
596
|
((f = o[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
597
597
|
], g = Math.max(...b);
|
|
598
598
|
g > 0 && (r[u] && (r[u].style.height = `${g}px`), n[u] && (n[u].style.height = `${g}px`), o[u] && (o[u].style.height = `${g}px`));
|
|
599
599
|
}
|
|
600
600
|
}, "#syncHeaderHeights"));
|
|
601
|
-
E(this, "destroy", /* @__PURE__ */
|
|
601
|
+
E(this, "destroy", /* @__PURE__ */ h(() => {
|
|
602
602
|
t(this, V) && (t(this, V).disconnect(), y(this, V, null));
|
|
603
603
|
}, "destroy"));
|
|
604
604
|
y(this, P, i.getRootNode().host), y(this, x, i), t(this, Dt).call(this);
|
|
@@ -611,7 +611,7 @@ const Ie = class Ie {
|
|
|
611
611
|
return ((e = t(this, D).get(i)) == null ? void 0 : e.length) || 1;
|
|
612
612
|
}
|
|
613
613
|
};
|
|
614
|
-
P = new WeakMap(), x = 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(), Ot = new WeakMap(),
|
|
614
|
+
P = new WeakMap(), x = 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(), Ot = new WeakMap(), Bt = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), At = new WeakMap(), zt = new WeakMap(), Dt = new WeakMap(), qt = new WeakMap(), Ae = new WeakMap(), lt = new WeakMap(), Rt = new WeakMap(), Pt = new WeakMap(), h(Ie, "RowManager");
|
|
615
615
|
let ce = Ie;
|
|
616
616
|
const jt = class jt {
|
|
617
617
|
/**
|
|
@@ -625,7 +625,7 @@ const jt = class jt {
|
|
|
625
625
|
*/
|
|
626
626
|
static compile(i) {
|
|
627
627
|
if (!i) return null;
|
|
628
|
-
const e = /* @__PURE__ */
|
|
628
|
+
const e = /* @__PURE__ */ h((a) => {
|
|
629
629
|
a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
|
|
630
630
|
const f = l.getAttribute("cell-type") || "renderer";
|
|
631
631
|
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
@@ -634,9 +634,9 @@ const jt = class jt {
|
|
|
634
634
|
let A = [];
|
|
635
635
|
b && A.push(`data-bind="${b}"`), g && A.push(`data-expr="${g}"`), v && A.push(`maxbyte="${v}"`), w && A.push(`type="${w}"`), l.innerHTML = `<${u} ${A.join(" ")}></${u}>`;
|
|
636
636
|
});
|
|
637
|
-
}, "processCellTypes"), s = /* @__PURE__ */
|
|
637
|
+
}, "processCellTypes"), s = /* @__PURE__ */ h((a) => {
|
|
638
638
|
if (!a.querySelector("colgroup")) {
|
|
639
|
-
const
|
|
639
|
+
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);
|
|
640
640
|
for (let b = 0; b < l; b++) {
|
|
641
641
|
const g = document.createElement("col");
|
|
642
642
|
g.setAttribute("width", u), f.appendChild(g);
|
|
@@ -644,12 +644,12 @@ const jt = class jt {
|
|
|
644
644
|
a.prepend(f);
|
|
645
645
|
}
|
|
646
646
|
if (!a.querySelector("thead")) {
|
|
647
|
-
const
|
|
648
|
-
l ? l.after(
|
|
647
|
+
const c = document.createElement("thead"), l = a.querySelector("colgroup");
|
|
648
|
+
l ? l.after(c) : a.prepend(c);
|
|
649
649
|
}
|
|
650
650
|
a.classList.add("nine-table-element");
|
|
651
|
-
}, "ensureTableStructure"), r = /* @__PURE__ */
|
|
652
|
-
const l = Array.from(a.querySelectorAll(
|
|
651
|
+
}, "ensureTableStructure"), r = /* @__PURE__ */ h((a, c) => {
|
|
652
|
+
const l = Array.from(a.querySelectorAll(c + " tr")), f = Array.from(a.querySelectorAll(c + " th," + c + " td")), u = l.length;
|
|
653
653
|
if (u === 0 || f.length === 0) return;
|
|
654
654
|
let b = 0;
|
|
655
655
|
f.forEach((v) => {
|
|
@@ -681,16 +681,16 @@ const jt = class jt {
|
|
|
681
681
|
});
|
|
682
682
|
});
|
|
683
683
|
}, "resetColIndex"), n = i.cloneNode(!0);
|
|
684
|
-
return s(n), e(n), r(n, "thead"), r(n, "tbody"), r(n, "tfoot"), Array.from(n.querySelectorAll("colgroup col")).forEach((a,
|
|
684
|
+
return s(n), e(n), r(n, "thead"), r(n, "tbody"), r(n, "tfoot"), Array.from(n.querySelectorAll("colgroup col")).forEach((a, c) => {
|
|
685
685
|
const l = a.getAttribute("fixed");
|
|
686
|
-
l && n.querySelectorAll(`thead [data-col="${
|
|
686
|
+
l && n.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((f) => {
|
|
687
687
|
f.setAttribute("fixed", l);
|
|
688
688
|
});
|
|
689
689
|
}), n;
|
|
690
690
|
}
|
|
691
691
|
// 🎯 [추가] td/th에 선언된 cell-type 속성을 읽어 커스텀 태그로 자동 감싸기
|
|
692
692
|
};
|
|
693
|
-
|
|
693
|
+
h(jt, "TableCompiler");
|
|
694
694
|
let he = jt;
|
|
695
695
|
var Ft, et, st, Vt, Yt, ct, Ut, Xt;
|
|
696
696
|
const pt = class pt extends HTMLElement {
|
|
@@ -699,11 +699,11 @@ const pt = class pt extends HTMLElement {
|
|
|
699
699
|
d(this, Ft);
|
|
700
700
|
d(this, et, null);
|
|
701
701
|
d(this, st);
|
|
702
|
-
E(this, "invalidate", /* @__PURE__ */
|
|
703
|
-
|
|
702
|
+
E(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
703
|
+
T.log("sheet.invalidate()"), t(this, st).refresh();
|
|
704
704
|
}, "invalidate"));
|
|
705
|
-
E(this, "generate", /* @__PURE__ */
|
|
706
|
-
if (
|
|
705
|
+
E(this, "generate", /* @__PURE__ */ h((e) => {
|
|
706
|
+
if (T.log("sheet.generate()"), !e) return;
|
|
707
707
|
y(this, et, he.compile(e)), t(this, Vt).call(this), t(this, Yt).call(this);
|
|
708
708
|
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");
|
|
709
709
|
s && n && (n.style.top = `${s.offsetHeight}px`), r && n && (n.style.bottom = `${r.offsetHeight}px`), t(this, st).initialize(), setTimeout(() => {
|
|
@@ -711,7 +711,7 @@ const pt = class pt extends HTMLElement {
|
|
|
711
711
|
(o = this.querySelector("nine-table-hscrollbar")) == null || o.refresh();
|
|
712
712
|
}, 0);
|
|
713
713
|
}, "generate"));
|
|
714
|
-
d(this, Vt, /* @__PURE__ */
|
|
714
|
+
d(this, Vt, /* @__PURE__ */ h(() => {
|
|
715
715
|
[
|
|
716
716
|
{ selector: ".ng-container-body", type: null },
|
|
717
717
|
{ selector: ".ng-container-left", type: "left" },
|
|
@@ -721,7 +721,7 @@ const pt = class pt extends HTMLElement {
|
|
|
721
721
|
(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"));
|
|
722
722
|
});
|
|
723
723
|
}, "#renderSplitContainers"));
|
|
724
|
-
d(this, Yt, /* @__PURE__ */
|
|
724
|
+
d(this, Yt, /* @__PURE__ */ h(() => {
|
|
725
725
|
["left", "right", "body"].forEach((e) => {
|
|
726
726
|
const s = this.querySelector(`.ng-container-${e}`), r = s == null ? void 0 : s.querySelectorAll("table");
|
|
727
727
|
if (!s || !r || r.length === 0) return;
|
|
@@ -732,14 +732,14 @@ const pt = class pt extends HTMLElement {
|
|
|
732
732
|
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${n}px`, s.style.width = `${n}px`);
|
|
733
733
|
});
|
|
734
734
|
}, "#updateContainerWidths"));
|
|
735
|
-
d(this, ct, /* @__PURE__ */
|
|
736
|
-
const n = e.cloneNode(!0), o = n.querySelector("thead"), a = n.querySelector("tbody"),
|
|
735
|
+
d(this, ct, /* @__PURE__ */ h((e, s, r) => {
|
|
736
|
+
const n = e.cloneNode(!0), o = n.querySelector("thead"), a = n.querySelector("tbody"), c = n.querySelector("tfoot");
|
|
737
737
|
if (r === "header") {
|
|
738
|
-
if (a && a.remove(),
|
|
738
|
+
if (a && a.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
739
739
|
const f = document.createElement("tbody");
|
|
740
740
|
f.className = "fixed-tbody", n.appendChild(f);
|
|
741
741
|
}
|
|
742
|
-
} else r === "body" ? (o && o.remove(),
|
|
742
|
+
} else r === "body" ? (o && o.remove(), c && c.remove(), a && (a.className = "bindable-tbody")) : r === "footer" && (o && o.remove(), a && a.remove());
|
|
743
743
|
return s === "left" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
744
744
|
l.getAttribute("fixed") !== "left" && l.remove();
|
|
745
745
|
}) : s === "right" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
@@ -748,19 +748,19 @@ const pt = class pt extends HTMLElement {
|
|
|
748
748
|
l.remove();
|
|
749
749
|
}), n;
|
|
750
750
|
}, "#createSplitTable"));
|
|
751
|
-
E(this, "getRowHeight", /* @__PURE__ */
|
|
752
|
-
E(this, "scrollToX", /* @__PURE__ */
|
|
751
|
+
E(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, st).getRowHeight(), "getRowHeight"));
|
|
752
|
+
E(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
753
753
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
754
754
|
s && (s.scrollLeft = e);
|
|
755
755
|
}, "scrollToX"));
|
|
756
|
-
E(this, "scrollToY", /* @__PURE__ */
|
|
756
|
+
E(this, "scrollToY", /* @__PURE__ */ h((e) => {
|
|
757
757
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
758
758
|
s && (s.scrollTop = e);
|
|
759
759
|
}, "scrollToY"));
|
|
760
|
-
d(this, Ut, /* @__PURE__ */
|
|
760
|
+
d(this, Ut, /* @__PURE__ */ h(() => {
|
|
761
761
|
t(this, Xt).call(this);
|
|
762
762
|
}, "#init"));
|
|
763
|
-
d(this, Xt, /* @__PURE__ */
|
|
763
|
+
d(this, Xt, /* @__PURE__ */ h(() => {
|
|
764
764
|
const e = pt.SCROLLBAR_SIZE;
|
|
765
765
|
this.innerHTML = `
|
|
766
766
|
<style>
|
|
@@ -957,17 +957,17 @@ const pt = class pt extends HTMLElement {
|
|
|
957
957
|
t(this, Ut).call(this);
|
|
958
958
|
}
|
|
959
959
|
disconnectedCallback() {
|
|
960
|
-
this.innerHTML = "",
|
|
960
|
+
this.innerHTML = "", T.log("NineTableSheet destroyed.");
|
|
961
961
|
}
|
|
962
962
|
};
|
|
963
|
-
Ft = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), ct = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(),
|
|
963
|
+
Ft = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), ct = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(), h(pt, "NineTableSheet"), E(pt, "SCROLLBAR_SIZE", 16);
|
|
964
964
|
let It = pt;
|
|
965
965
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", It);
|
|
966
966
|
var Kt, Tt;
|
|
967
967
|
const _e = class _e extends HTMLElement {
|
|
968
968
|
constructor() {
|
|
969
969
|
super();
|
|
970
|
-
d(this, Kt, /* @__PURE__ */
|
|
970
|
+
d(this, Kt, /* @__PURE__ */ h(() => {
|
|
971
971
|
var e;
|
|
972
972
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
973
973
|
var o;
|
|
@@ -975,8 +975,8 @@ const _e = class _e extends HTMLElement {
|
|
|
975
975
|
t(this, Tt).call(this, n, r);
|
|
976
976
|
}), t(this, Tt).call(this, 0, !1);
|
|
977
977
|
}, "#init"));
|
|
978
|
-
d(this, Tt, /* @__PURE__ */
|
|
979
|
-
const r = /* @__PURE__ */
|
|
978
|
+
d(this, Tt, /* @__PURE__ */ h((e, s = !1) => {
|
|
979
|
+
const r = /* @__PURE__ */ h(() => {
|
|
980
980
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
981
981
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((g) => g.style.setProperty("display", "none"));
|
|
982
982
|
const b = f.filter((g) => g.classList.contains("active"));
|
|
@@ -984,12 +984,12 @@ const _e = class _e extends HTMLElement {
|
|
|
984
984
|
const v = parseInt(g.getAttribute("data-index"), 10), w = this.querySelector(`nine-splitter[data-split-index="${v}"]`), A = f[v + 1];
|
|
985
985
|
w && A && A.classList.contains("active") && w.style.setProperty("display", "flex");
|
|
986
986
|
});
|
|
987
|
-
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = n.querySelectorAll(".nine-tab-item"),
|
|
987
|
+
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = n.querySelectorAll(".nine-tab-item"), c = o.querySelectorAll("nine-table-sheet");
|
|
988
988
|
if (!a[e]) return;
|
|
989
989
|
if (!s)
|
|
990
990
|
a.forEach((f, u) => {
|
|
991
991
|
f.classList.toggle("active", u === e);
|
|
992
|
-
}),
|
|
992
|
+
}), c.forEach((f, u) => {
|
|
993
993
|
const b = u === e;
|
|
994
994
|
f.classList.toggle("active", b), f.style.flex = b ? "1 1 100%" : "";
|
|
995
995
|
});
|
|
@@ -1011,31 +1011,31 @@ const _e = class _e extends HTMLElement {
|
|
|
1011
1011
|
t(this, Kt).call(this);
|
|
1012
1012
|
}
|
|
1013
1013
|
};
|
|
1014
|
-
Kt = new WeakMap(), Tt = new WeakMap(),
|
|
1014
|
+
Kt = new WeakMap(), Tt = new WeakMap(), h(_e, "NineTableSheets");
|
|
1015
1015
|
let de = _e;
|
|
1016
1016
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", de);
|
|
1017
1017
|
var M, Zt, kt, Gt;
|
|
1018
1018
|
const Ne = class Ne {
|
|
1019
1019
|
constructor(i) {
|
|
1020
1020
|
d(this, M);
|
|
1021
|
-
d(this, Zt, /* @__PURE__ */
|
|
1021
|
+
d(this, Zt, /* @__PURE__ */ h(() => {
|
|
1022
1022
|
t(this, Gt).call(this), new ResizeObserver((i) => {
|
|
1023
1023
|
for (let e of i)
|
|
1024
1024
|
t(this, M).getAttribute("auto-height") === "true" && t(this, kt).call(this);
|
|
1025
1025
|
}).observe(t(this, M));
|
|
1026
1026
|
}, "#init"));
|
|
1027
|
-
d(this, kt, /* @__PURE__ */
|
|
1028
|
-
var
|
|
1027
|
+
d(this, kt, /* @__PURE__ */ h(() => {
|
|
1028
|
+
var c, l;
|
|
1029
1029
|
const i = Array.from(t(this, M).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
1030
1030
|
if (i.length === 0) return;
|
|
1031
|
-
const e = parseInt(t(this, M).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), r = (
|
|
1031
|
+
const e = parseInt(t(this, M).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), r = (c = t(this, M).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, n = (l = t(this, M).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = It.SCROLLBAR_SIZE, a = e * s + r + n + o;
|
|
1032
1032
|
t(this, M).style.height = `${a}px`;
|
|
1033
1033
|
}, "#applyAutoHeight"));
|
|
1034
|
-
d(this, Gt, /* @__PURE__ */
|
|
1035
|
-
const e = Array.from(t(this, M).children).filter((
|
|
1034
|
+
d(this, Gt, /* @__PURE__ */ h(() => {
|
|
1035
|
+
const e = Array.from(t(this, M).children).filter((c) => c.tagName === "TABLE"), s = t(this, M).getAttribute("auto-height") === "true", r = e.length, n = e.map((c, l) => {
|
|
1036
1036
|
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>` : "";
|
|
1037
1037
|
return u + b;
|
|
1038
|
-
}).join(""), o = e.map((
|
|
1038
|
+
}).join(""), o = e.map((c, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
1039
1039
|
t(this, M).shadowRoot.innerHTML = `
|
|
1040
1040
|
<style>
|
|
1041
1041
|
:host {
|
|
@@ -1158,23 +1158,23 @@ const Ne = class Ne {
|
|
|
1158
1158
|
<nine-table-footer></nine-table-footer>
|
|
1159
1159
|
`, t(this, M).shadowRoot.querySelector("nine-table-sheets").classList.add("nodata");
|
|
1160
1160
|
const a = t(this, M).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1161
|
-
a == null || a.forEach((
|
|
1161
|
+
a == null || a.forEach((c, l) => {
|
|
1162
1162
|
e[l] && setTimeout(() => {
|
|
1163
|
-
|
|
1163
|
+
c.generate(e[l]), s && t(this, kt).call(this);
|
|
1164
1164
|
});
|
|
1165
1165
|
});
|
|
1166
1166
|
}, "#render"));
|
|
1167
1167
|
y(this, M, i), t(this, Zt).call(this);
|
|
1168
1168
|
}
|
|
1169
1169
|
};
|
|
1170
|
-
M = new WeakMap(), Zt = new WeakMap(), kt = new WeakMap(), Gt = new WeakMap(),
|
|
1170
|
+
M = new WeakMap(), Zt = new WeakMap(), kt = new WeakMap(), Gt = new WeakMap(), h(Ne, "LayoutManager");
|
|
1171
1171
|
let fe = Ne;
|
|
1172
1172
|
var Ct, ht;
|
|
1173
1173
|
const We = class We {
|
|
1174
1174
|
constructor(i) {
|
|
1175
1175
|
d(this, Ct);
|
|
1176
1176
|
d(this, ht, -1);
|
|
1177
|
-
E(this, "count", /* @__PURE__ */
|
|
1177
|
+
E(this, "count", /* @__PURE__ */ h(() => t(this, Ct).rawRecords.length, "count"));
|
|
1178
1178
|
y(this, Ct, i);
|
|
1179
1179
|
}
|
|
1180
1180
|
get at() {
|
|
@@ -1185,34 +1185,34 @@ const We = class We {
|
|
|
1185
1185
|
});
|
|
1186
1186
|
}
|
|
1187
1187
|
};
|
|
1188
|
-
Ct = new WeakMap(), ht = new WeakMap(),
|
|
1188
|
+
Ct = new WeakMap(), ht = new WeakMap(), h(We, "ngRow");
|
|
1189
1189
|
let ge = We;
|
|
1190
|
-
var _,
|
|
1191
|
-
const
|
|
1190
|
+
var _, C, N, dt, Jt, Y, Qt, it, Lt, te, ee, ft;
|
|
1191
|
+
const B = class B {
|
|
1192
1192
|
constructor(i, e) {
|
|
1193
1193
|
d(this, _);
|
|
1194
|
-
d(this,
|
|
1194
|
+
d(this, C);
|
|
1195
1195
|
d(this, N, []);
|
|
1196
1196
|
d(this, dt, []);
|
|
1197
1197
|
d(this, Jt, 0);
|
|
1198
1198
|
d(this, Y, []);
|
|
1199
|
-
d(this, Qt, /* @__PURE__ */
|
|
1199
|
+
d(this, Qt, /* @__PURE__ */ h(() => {
|
|
1200
1200
|
y(this, Y, []);
|
|
1201
1201
|
const i = t(this, _).template || [];
|
|
1202
1202
|
Array.from(i).forEach((e) => {
|
|
1203
1203
|
var s;
|
|
1204
1204
|
t(this, Y).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1205
|
-
}), (t(this,
|
|
1205
|
+
}), (t(this, C).rawRecords || []).forEach((e) => {
|
|
1206
1206
|
e.__ng || (e.__ng = t(this, Lt).call(this)), e.__ng.height = t(this, Y).slice();
|
|
1207
1207
|
});
|
|
1208
1208
|
}, "#initialize"));
|
|
1209
|
-
d(this, it, /* @__PURE__ */
|
|
1209
|
+
d(this, it, /* @__PURE__ */ h(() => {
|
|
1210
1210
|
const i = t(this, _).shadowRoot.querySelector("nine-table-sheets");
|
|
1211
1211
|
i == null || i.classList.toggle("nodata", this.length === 0), t(this, _).shadowRoot.querySelectorAll("nine-table-sheet").forEach((e) => {
|
|
1212
1212
|
e.invalidate();
|
|
1213
1213
|
});
|
|
1214
1214
|
}, "#invalidate"));
|
|
1215
|
-
E(this, "get", /* @__PURE__ */
|
|
1215
|
+
E(this, "get", /* @__PURE__ */ h((i, e) => {
|
|
1216
1216
|
var n;
|
|
1217
1217
|
const s = this.getValidData();
|
|
1218
1218
|
if (!s || s.length <= 0) return;
|
|
@@ -1225,26 +1225,26 @@ const z = class z {
|
|
|
1225
1225
|
}
|
|
1226
1226
|
return t(this, ft).call(this, s[i]);
|
|
1227
1227
|
}, "get"));
|
|
1228
|
-
E(this, "set", /* @__PURE__ */
|
|
1228
|
+
E(this, "set", /* @__PURE__ */ h((i) => {
|
|
1229
1229
|
this.clear(), this.add(i, !1), t(this, it).call(this);
|
|
1230
1230
|
}, "set"));
|
|
1231
|
-
d(this, Lt, /* @__PURE__ */
|
|
1232
|
-
rowState:
|
|
1231
|
+
d(this, Lt, /* @__PURE__ */ h(() => ({
|
|
1232
|
+
rowState: B.ROW_STATE.EMPTY,
|
|
1233
1233
|
deleted: !1,
|
|
1234
1234
|
filtered: !1,
|
|
1235
1235
|
height: t(this, Y).slice(),
|
|
1236
1236
|
o: {},
|
|
1237
1237
|
c: {},
|
|
1238
|
-
_: [0, 0, 0, 0,
|
|
1238
|
+
_: [0, 0, 0, 0, B.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Y).slice(), -1, {}, {}]
|
|
1239
1239
|
}), "#getDefaultMeta"));
|
|
1240
|
-
E(this, "reset", /* @__PURE__ */
|
|
1240
|
+
E(this, "reset", /* @__PURE__ */ h(() => {
|
|
1241
1241
|
y(this, N, []), y(this, dt, []), t(this, it).call(this);
|
|
1242
1242
|
}, "reset"));
|
|
1243
|
-
E(this, "clear", /* @__PURE__ */
|
|
1243
|
+
E(this, "clear", /* @__PURE__ */ h(() => {
|
|
1244
1244
|
var i;
|
|
1245
|
-
t(this,
|
|
1245
|
+
t(this, C).rawRecords = [], y(this, N, []), y(this, dt, []), (i = t(this, C).viewRecords) != null && i.reset && t(this, C).viewRecords.reset();
|
|
1246
1246
|
}, "clear"));
|
|
1247
|
-
d(this, te, /* @__PURE__ */
|
|
1247
|
+
d(this, te, /* @__PURE__ */ h((i) => {
|
|
1248
1248
|
var r;
|
|
1249
1249
|
Array.isArray(i) || (i = [i]);
|
|
1250
1250
|
const e = typeof ((r = t(this, _).fields) == null ? void 0 : r.get) == "function" ? t(this, _).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
@@ -1255,64 +1255,64 @@ const z = class z {
|
|
|
1255
1255
|
}), s.push(o);
|
|
1256
1256
|
}), s;
|
|
1257
1257
|
}, "#json2Array"));
|
|
1258
|
-
d(this, ee, /* @__PURE__ */
|
|
1259
|
-
e.__ng = t(this, Lt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState =
|
|
1258
|
+
d(this, ee, /* @__PURE__ */ h((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1259
|
+
e.__ng = t(this, Lt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = B.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1260
1260
|
}), i), "#defaultInsert"));
|
|
1261
|
-
E(this, "add", /* @__PURE__ */
|
|
1261
|
+
E(this, "add", /* @__PURE__ */ h((i, e = !0) => {
|
|
1262
1262
|
i === void 0 && (i = {});
|
|
1263
1263
|
const s = t(this, te).call(this, i);
|
|
1264
|
-
t(this,
|
|
1264
|
+
t(this, C).rawRecords = t(this, C).rawRecords.concat(t(this, ee).call(this, s)), this.resetRecords();
|
|
1265
1265
|
const r = this.count() - 1;
|
|
1266
1266
|
return e || s.forEach((n, o) => {
|
|
1267
|
-
const a = t(this,
|
|
1268
|
-
a && (a.__ng.rowState =
|
|
1267
|
+
const a = t(this, C).rawRecords[r - o];
|
|
1268
|
+
a && (a.__ng.rowState = B.ROW_STATE.EMPTY);
|
|
1269
1269
|
}), t(this, it).call(this), r;
|
|
1270
1270
|
}, "add"));
|
|
1271
|
-
E(this, "delete", /* @__PURE__ */
|
|
1271
|
+
E(this, "delete", /* @__PURE__ */ h((i) => {
|
|
1272
1272
|
let e = [];
|
|
1273
|
-
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this,
|
|
1273
|
+
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this, C).host.row.at] : e = [parseInt(i, 10)], e.sort((s, r) => r - s).forEach((s) => {
|
|
1274
1274
|
if (t(this, N)[s]) {
|
|
1275
1275
|
const r = t(this, N)[s].__ng.rowid;
|
|
1276
|
-
t(this, N)[s].__ng.rowState ===
|
|
1277
|
-
n.__ng.rowid === r && (n.__ng.deleted = !0, n.__ng.rowState =
|
|
1276
|
+
t(this, N)[s].__ng.rowState === B.ROW_STATE.INSERT ? t(this, C).rawRecords = t(this, C).rawRecords.filter((n) => n.__ng.rowid !== r) : t(this, C).rawRecords.forEach((n) => {
|
|
1277
|
+
n.__ng.rowid === r && (n.__ng.deleted = !0, n.__ng.rowState = B.ROW_STATE.DELETE);
|
|
1278
1278
|
});
|
|
1279
1279
|
}
|
|
1280
1280
|
}), this.resetRecords(), t(this, it).call(this);
|
|
1281
1281
|
}, "delete"));
|
|
1282
|
-
E(this, "setValue", /* @__PURE__ */
|
|
1283
|
-
var
|
|
1282
|
+
E(this, "setValue", /* @__PURE__ */ h((i, e, s) => {
|
|
1283
|
+
var c;
|
|
1284
1284
|
i = parseInt(i, 10);
|
|
1285
|
-
const n = (typeof ((
|
|
1285
|
+
const n = (typeof ((c = t(this, _).fields) == null ? void 0 : c.get) == "function" ? t(this, _).fields.get() : []).indexOf(e);
|
|
1286
1286
|
if (n < 0) return;
|
|
1287
1287
|
const o = this.getValidData()[i];
|
|
1288
1288
|
if (!o) return;
|
|
1289
1289
|
const a = o.v[n];
|
|
1290
|
-
a !== s && o.__ng.rowState !==
|
|
1290
|
+
a !== s && o.__ng.rowState !== B.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = a), o.__ng.rowState = B.ROW_STATE.UPDATE), o.v[n] = s;
|
|
1291
1291
|
}, "setValue"));
|
|
1292
|
-
E(this, "resetRecords", /* @__PURE__ */
|
|
1293
|
-
y(this, dt, t(this,
|
|
1292
|
+
E(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1293
|
+
y(this, dt, t(this, C).rawRecords.filter((i) => !i.__ng.deleted)), y(this, N, t(this, C).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, C).rawRecords.forEach((i, e) => {
|
|
1294
1294
|
i.__ng.rowidx = e;
|
|
1295
1295
|
}), t(this, N).forEach((i, e) => {
|
|
1296
1296
|
i.__ng.i = e;
|
|
1297
1297
|
});
|
|
1298
1298
|
}, "resetRecords"));
|
|
1299
|
-
E(this, "getValidData", /* @__PURE__ */
|
|
1300
|
-
d(this, ft, /* @__PURE__ */
|
|
1299
|
+
E(this, "getValidData", /* @__PURE__ */ h(() => (t(this, N).length === 0 && t(this, C).rawRecords.length > 0 && this.resetRecords(), t(this, N)), "getValidData"));
|
|
1300
|
+
d(this, ft, /* @__PURE__ */ h((i) => {
|
|
1301
1301
|
var o;
|
|
1302
1302
|
if (!i) return i;
|
|
1303
1303
|
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) => {
|
|
1304
|
-
const
|
|
1304
|
+
const c = {};
|
|
1305
1305
|
return r.forEach((l, f) => {
|
|
1306
|
-
|
|
1307
|
-
}),
|
|
1306
|
+
c[l] = a.v ? a.v[f] : a[l];
|
|
1307
|
+
}), c.__ng = a.__ng, c;
|
|
1308
1308
|
});
|
|
1309
1309
|
return e ? n[0] : n;
|
|
1310
1310
|
}, "#conv"));
|
|
1311
|
-
E(this, "count", /* @__PURE__ */
|
|
1312
|
-
y(this, _, i), y(this,
|
|
1311
|
+
E(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1312
|
+
y(this, _, i), y(this, C, e), t(this, Qt).call(this);
|
|
1313
1313
|
}
|
|
1314
1314
|
get source() {
|
|
1315
|
-
return t(this, ft).call(this, t(this,
|
|
1315
|
+
return t(this, ft).call(this, t(this, C).rawRecords);
|
|
1316
1316
|
}
|
|
1317
1317
|
set source(i) {
|
|
1318
1318
|
this.clear(), this.add(i, !1);
|
|
@@ -1330,15 +1330,15 @@ const z = class z {
|
|
|
1330
1330
|
return this.length;
|
|
1331
1331
|
}
|
|
1332
1332
|
};
|
|
1333
|
-
_ = new WeakMap(),
|
|
1334
|
-
E(
|
|
1333
|
+
_ = new WeakMap(), C = new WeakMap(), N = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), Y = new WeakMap(), Qt = new WeakMap(), it = new WeakMap(), Lt = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), ft = new WeakMap(), h(B, "ngData"), // 🎯 행 상태 정의 상수를 클래스 내부로 내재화
|
|
1334
|
+
E(B, "ROW_STATE", {
|
|
1335
1335
|
EMPTY: "EMPTY",
|
|
1336
1336
|
NORMAL: "NORMAL",
|
|
1337
1337
|
INSERT: "INSERT",
|
|
1338
1338
|
UPDATE: "UPDATE",
|
|
1339
1339
|
DELETE: "DELETE"
|
|
1340
1340
|
});
|
|
1341
|
-
let ue =
|
|
1341
|
+
let ue = B;
|
|
1342
1342
|
var rt;
|
|
1343
1343
|
const Oe = class Oe {
|
|
1344
1344
|
constructor(i) {
|
|
@@ -1360,31 +1360,31 @@ const Oe = class Oe {
|
|
|
1360
1360
|
}, this.setDataSource([]);
|
|
1361
1361
|
}
|
|
1362
1362
|
};
|
|
1363
|
-
rt = new WeakMap(),
|
|
1363
|
+
rt = new WeakMap(), h(Oe, "ngDataManager");
|
|
1364
1364
|
let be = Oe;
|
|
1365
1365
|
var gt, H, Ht, se;
|
|
1366
|
-
const
|
|
1366
|
+
const Be = class Be {
|
|
1367
1367
|
// 🎯 이제 { name: string, type: string } 객체들의 배열로 관리합니다.
|
|
1368
1368
|
constructor(i) {
|
|
1369
1369
|
d(this, gt);
|
|
1370
1370
|
d(this, H, []);
|
|
1371
|
-
E(this, "add", /* @__PURE__ */
|
|
1371
|
+
E(this, "add", /* @__PURE__ */ h((i, e = "string") => {
|
|
1372
1372
|
i.forEach((s) => {
|
|
1373
1373
|
t(this, H).some((r) => r.name === s) || t(this, H).push({ name: s, type: e });
|
|
1374
1374
|
}), t(this, Ht).call(this);
|
|
1375
1375
|
}, "add"));
|
|
1376
|
-
d(this, Ht, /* @__PURE__ */
|
|
1376
|
+
d(this, Ht, /* @__PURE__ */ h(() => {
|
|
1377
1377
|
const i = /* @__PURE__ */ new Map();
|
|
1378
1378
|
t(this, H).forEach((e) => {
|
|
1379
1379
|
i.set(e.name, e.type);
|
|
1380
1380
|
}), y(this, H, Array.from(i, ([e, s]) => ({ name: e, type: s }))), y(this, H, t(this, H).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, H).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
1381
1381
|
}, "#adjust"));
|
|
1382
|
-
d(this, se, /* @__PURE__ */
|
|
1383
|
-
y(this, H, []),
|
|
1382
|
+
d(this, se, /* @__PURE__ */ h(() => {
|
|
1383
|
+
y(this, H, []), T.log(t(this, gt).querySelectorAll("table"));
|
|
1384
1384
|
const i = Array.from(t(this, gt).querySelectorAll("table"));
|
|
1385
1385
|
if (!(!i || i.length === 0)) {
|
|
1386
1386
|
for (const e of i)
|
|
1387
|
-
|
|
1387
|
+
T.log(e), $("[data-bind]", e).each((s, r) => {
|
|
1388
1388
|
const n = r.dataset.bind, o = r.getAttribute("data-type") || "string";
|
|
1389
1389
|
n && t(this, H).push({ name: n, type: o });
|
|
1390
1390
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
@@ -1401,9 +1401,9 @@ const ze = class ze {
|
|
|
1401
1401
|
}
|
|
1402
1402
|
o.split("data.").forEach((a) => {
|
|
1403
1403
|
if (a.trim() != "") {
|
|
1404
|
-
const
|
|
1404
|
+
const c = a.search(/[^_A-Za-z0-9]/g);
|
|
1405
1405
|
let l = "";
|
|
1406
|
-
|
|
1406
|
+
c >= 0 ? l = a.substring(0, c) : o.startsWith("data.") && (l = a.replace("data.", "")), l && t(this, H).push({ name: l, type: "string" });
|
|
1407
1407
|
}
|
|
1408
1408
|
});
|
|
1409
1409
|
});
|
|
@@ -1433,17 +1433,17 @@ const ze = class ze {
|
|
|
1433
1433
|
return t(this, H).some((e) => e.name === i);
|
|
1434
1434
|
}
|
|
1435
1435
|
};
|
|
1436
|
-
gt = new WeakMap(), H = new WeakMap(), Ht = new WeakMap(), se = new WeakMap(),
|
|
1437
|
-
let ye =
|
|
1436
|
+
gt = new WeakMap(), H = new WeakMap(), Ht = new WeakMap(), se = new WeakMap(), h(Be, "ngFields");
|
|
1437
|
+
let ye = Be;
|
|
1438
1438
|
var nt, ie, re;
|
|
1439
|
-
const
|
|
1439
|
+
const ze = class ze extends HTMLElement {
|
|
1440
1440
|
constructor() {
|
|
1441
1441
|
super();
|
|
1442
1442
|
//#created = false;
|
|
1443
1443
|
d(this, nt);
|
|
1444
1444
|
d(this, ie);
|
|
1445
|
-
d(this, re, /* @__PURE__ */
|
|
1446
|
-
this.fields = new ye(this), y(this, ie, new fe(this)),
|
|
1445
|
+
d(this, re, /* @__PURE__ */ h(() => {
|
|
1446
|
+
this.fields = new ye(this), y(this, ie, new fe(this)), T.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1447
1447
|
}, "#init"));
|
|
1448
1448
|
this.attachShadow({ mode: "open" }), y(this, nt, new be(this));
|
|
1449
1449
|
}
|
|
@@ -1451,7 +1451,7 @@ const Be = class Be extends HTMLElement {
|
|
|
1451
1451
|
t(this, re).call(this);
|
|
1452
1452
|
}
|
|
1453
1453
|
disconnectedCallback() {
|
|
1454
|
-
|
|
1454
|
+
T.log("NineTable disconnected.");
|
|
1455
1455
|
}
|
|
1456
1456
|
// 🎯 외부에서 grid.data.set(...) 형태로 접근할 수 있도록 데이터 매니저 오픈
|
|
1457
1457
|
get data() {
|
|
@@ -1466,8 +1466,8 @@ const Be = class Be extends HTMLElement {
|
|
|
1466
1466
|
return t(this, nt);
|
|
1467
1467
|
}
|
|
1468
1468
|
};
|
|
1469
|
-
nt = new WeakMap(), ie = new WeakMap(), re = new WeakMap(),
|
|
1470
|
-
let pe =
|
|
1469
|
+
nt = new WeakMap(), ie = new WeakMap(), re = new WeakMap(), h(ze, "NineTable");
|
|
1470
|
+
let pe = ze;
|
|
1471
1471
|
customElements.get("nine-table") || customElements.define("nine-table", pe);
|
|
1472
1472
|
const mt = class mt extends HTMLElement {
|
|
1473
1473
|
// 👈 커스텀 스타일용 캐시 추가
|
|
@@ -1480,20 +1480,20 @@ const mt = class mt extends HTMLElement {
|
|
|
1480
1480
|
connectedCallback() {
|
|
1481
1481
|
}
|
|
1482
1482
|
};
|
|
1483
|
-
|
|
1483
|
+
h(mt, "BasicCellElement"), E(mt, "_styleCache", /* @__PURE__ */ new Map()), E(mt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1484
1484
|
let me = mt;
|
|
1485
|
-
var
|
|
1485
|
+
var L, $t, p, qe, Re, Te, ke, Ce;
|
|
1486
1486
|
const De = class De extends me {
|
|
1487
1487
|
constructor() {
|
|
1488
1488
|
super();
|
|
1489
|
-
d(this,
|
|
1490
|
-
d(this,
|
|
1489
|
+
d(this, L);
|
|
1490
|
+
d(this, $t);
|
|
1491
1491
|
d(this, p);
|
|
1492
1492
|
d(this, qe);
|
|
1493
1493
|
d(this, Re);
|
|
1494
1494
|
d(this, Te);
|
|
1495
1495
|
d(this, ke);
|
|
1496
|
-
E(this, "getDisplayText", /* @__PURE__ */
|
|
1496
|
+
E(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1497
1497
|
if (t(this, p))
|
|
1498
1498
|
if (t(this, p).closest("tbody")) {
|
|
1499
1499
|
const s = t(this, p).closest("tr").data, r = parseInt(t(this, p).dataset.row);
|
|
@@ -1509,12 +1509,12 @@ const De = class De extends me {
|
|
|
1509
1509
|
return ninegrid.nvl(e, "");
|
|
1510
1510
|
} else
|
|
1511
1511
|
try {
|
|
1512
|
-
return t(this,
|
|
1512
|
+
return t(this, L).exprFunction(t(this, p).dataset.expr).call(this, null, -1, t(this, L).data);
|
|
1513
1513
|
} catch {
|
|
1514
1514
|
}
|
|
1515
1515
|
}, "getDisplayText"));
|
|
1516
|
-
d(this, Ce, /* @__PURE__ */
|
|
1517
|
-
if (!(!t(this,
|
|
1516
|
+
d(this, Ce, /* @__PURE__ */ h(() => {
|
|
1517
|
+
if (!(!t(this, L) || !t(this, L).template || !t(this, p).closest("tbody.bindable"))) {
|
|
1518
1518
|
var e = ninegrid.j.querySelectorAll(t(this, p)).attr("suppress");
|
|
1519
1519
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1520
1520
|
var s = t(this, p).closest("tr"), r = [];
|
|
@@ -1523,12 +1523,12 @@ const De = class De extends me {
|
|
|
1523
1523
|
R && W.dataset.row && (R = parseInt(R), !isNaN(R) && R <= e && r.push(R));
|
|
1524
1524
|
}), r.sort();
|
|
1525
1525
|
var n = !1;
|
|
1526
|
-
if (parseInt(s.sectionRowIndex / t(this,
|
|
1526
|
+
if (parseInt(s.sectionRowIndex / t(this, L).template.length) > 0)
|
|
1527
1527
|
for (var o of r) {
|
|
1528
1528
|
if (o > e) break;
|
|
1529
|
-
var a = parseInt(t(this, p).dataset.row),
|
|
1529
|
+
var a = parseInt(t(this, p).dataset.row), c = a - 1, l = t(this, p).closest("tr").data, f = t(this, L).data.get(c);
|
|
1530
1530
|
t(this, p).dataset.matrixRow;
|
|
1531
|
-
var u = t(this,
|
|
1531
|
+
var u = t(this, L).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, p).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];
|
|
1532
1532
|
if (b != g) {
|
|
1533
1533
|
n = !0;
|
|
1534
1534
|
break;
|
|
@@ -1537,17 +1537,17 @@ const De = class De extends me {
|
|
|
1537
1537
|
else
|
|
1538
1538
|
n = !0;
|
|
1539
1539
|
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"));
|
|
1540
|
-
var v = parseInt(t(this, p).dataset.matrixRow), w = v - 1, A = t(this,
|
|
1540
|
+
var v = parseInt(t(this, p).dataset.matrixRow), w = v - 1, A = t(this, L).body.querySelector(`tbody.bindable [data-col="${t(this, p).dataset.col}"][data-matrix-row="${w}"]`);
|
|
1541
1541
|
$(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");
|
|
1542
1542
|
}
|
|
1543
1543
|
}
|
|
1544
1544
|
}, "#resetSuppress"));
|
|
1545
|
-
E(this, "getExprValue", /* @__PURE__ */
|
|
1545
|
+
E(this, "getExprValue", /* @__PURE__ */ h((e, s, r, n) => {
|
|
1546
1546
|
if (typeof e < "u")
|
|
1547
1547
|
try {
|
|
1548
1548
|
r = parseInt(r);
|
|
1549
1549
|
const o = e.replace("()", "");
|
|
1550
|
-
return t(this,
|
|
1550
|
+
return t(this, L)[o] ? t(this, L)[o].call(this, s, r, t(this, p)) : t(this, L).exprFunction(e).call(this, s, r, t(this, L).data);
|
|
1551
1551
|
} catch {
|
|
1552
1552
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1553
1553
|
}
|
|
@@ -1556,16 +1556,16 @@ const De = class De extends me {
|
|
|
1556
1556
|
}, "getExprValue"));
|
|
1557
1557
|
}
|
|
1558
1558
|
connectedCallback() {
|
|
1559
|
-
super.connectedCallback(), y(this,
|
|
1559
|
+
super.connectedCallback(), y(this, L, this.getRootNode().host), y(this, p, this.closest("th,td")), y(this, $t, t(this, p).closest("tr"));
|
|
1560
1560
|
}
|
|
1561
1561
|
get value() {
|
|
1562
|
-
var e = !t(this,
|
|
1562
|
+
var e = !t(this, L) || !t(this, L).dataManager || !t(this, p) || !t(this, p).dataset || !t(this, p).dataset.row || !t(this, p).dataset.bind ? "" : t(this, p).closest("tr").data[t(this, p).dataset.bind];
|
|
1563
1563
|
return e ?? "";
|
|
1564
1564
|
}
|
|
1565
1565
|
set value(e) {
|
|
1566
1566
|
var s = parseInt(t(this, p).dataset.row);
|
|
1567
1567
|
const r = this.getAttribute("update-row-state") != "false";
|
|
1568
|
-
s < 0 ? t(this,
|
|
1568
|
+
s < 0 ? t(this, L).data.setValueNF(parseInt(t(this, p).dataset.index), t(this, p).dataset.bind, e, r) : t(this, L).data.setValue(s, t(this, p).dataset.bind, e, r);
|
|
1569
1569
|
}
|
|
1570
1570
|
get row() {
|
|
1571
1571
|
return parseInt(t(this, p).dataset.row);
|
|
@@ -1575,10 +1575,10 @@ const De = class De extends me {
|
|
|
1575
1575
|
}
|
|
1576
1576
|
refresh() {
|
|
1577
1577
|
const e = t(this, p).dataset.bind;
|
|
1578
|
-
return parseInt(t(this, p).dataset.row), t(this,
|
|
1578
|
+
return parseInt(t(this, p).dataset.row), t(this, $t).data[e];
|
|
1579
1579
|
}
|
|
1580
1580
|
};
|
|
1581
|
-
|
|
1581
|
+
L = new WeakMap(), $t = new WeakMap(), p = new WeakMap(), qe = new WeakMap(), Re = new WeakMap(), Te = new WeakMap(), ke = new WeakMap(), Ce = new WeakMap(), h(De, "CellElement");
|
|
1582
1582
|
let ve = De;
|
|
1583
1583
|
const Pe = class Pe extends ve {
|
|
1584
1584
|
constructor() {
|
|
@@ -1591,21 +1591,21 @@ const Pe = class Pe extends ve {
|
|
|
1591
1591
|
return super.refresh();
|
|
1592
1592
|
}
|
|
1593
1593
|
};
|
|
1594
|
-
|
|
1594
|
+
h(Pe, "EditableCellElement");
|
|
1595
1595
|
let xe = Pe;
|
|
1596
|
-
var
|
|
1596
|
+
var Mt, ot, ut, bt, ne, U, Le;
|
|
1597
1597
|
const je = class je extends xe {
|
|
1598
1598
|
constructor() {
|
|
1599
1599
|
super();
|
|
1600
|
-
d(this,
|
|
1600
|
+
d(this, Mt);
|
|
1601
1601
|
d(this, ot);
|
|
1602
1602
|
d(this, ut);
|
|
1603
1603
|
d(this, bt);
|
|
1604
1604
|
d(this, ne);
|
|
1605
1605
|
d(this, U);
|
|
1606
|
-
E(this, "refresh", /* @__PURE__ */
|
|
1606
|
+
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
1607
1607
|
const e = super.refresh();
|
|
1608
|
-
t(this,
|
|
1608
|
+
t(this, Mt).value = e;
|
|
1609
1609
|
}, "refresh"));
|
|
1610
1610
|
/**
|
|
1611
1611
|
dataRefresh = (v) => {
|
|
@@ -1637,7 +1637,7 @@ const je = class je extends xe {
|
|
|
1637
1637
|
if (!v) this.reset();
|
|
1638
1638
|
};
|
|
1639
1639
|
*/
|
|
1640
|
-
d(this, Le, /* @__PURE__ */
|
|
1640
|
+
d(this, Le, /* @__PURE__ */ h((e) => {
|
|
1641
1641
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1642
1642
|
if (t(this, ot) == "number") {
|
|
1643
1643
|
let n = [];
|
|
@@ -1662,10 +1662,10 @@ const je = class je extends xe {
|
|
|
1662
1662
|
${e.join(" ")}
|
|
1663
1663
|
ondragstart="return false;"
|
|
1664
1664
|
>
|
|
1665
|
-
`, super.connectedCallback(), y(this,
|
|
1665
|
+
`, super.connectedCallback(), y(this, Mt, this.querySelector("input"));
|
|
1666
1666
|
}
|
|
1667
1667
|
};
|
|
1668
|
-
|
|
1668
|
+
Mt = new WeakMap(), ot = new WeakMap(), ut = new WeakMap(), bt = new WeakMap(), ne = new WeakMap(), U = new WeakMap(), Le = new WeakMap(), h(je, "CellInputText");
|
|
1669
1669
|
let we = je;
|
|
1670
1670
|
customElements.get("cell-input-text");
|
|
1671
1671
|
customElements.get("cell-input") || customElements.define("cell-input", we);
|