@ninebone/table 0.0.564 → 0.0.566
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 +583 -573
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +25 -15
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -1,113 +1,113 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var Fe = Object.defineProperty;
|
|
2
|
+
var Ve = (R) => {
|
|
3
3
|
throw TypeError(R);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var h = (R,
|
|
7
|
-
var
|
|
8
|
-
var t = (R,
|
|
9
|
-
var
|
|
10
|
-
set _(
|
|
11
|
-
p(R,
|
|
5
|
+
var Xe = (R, n, e) => n in R ? Fe(R, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : R[n] = e;
|
|
6
|
+
var h = (R, n) => Fe(R, "name", { value: n, configurable: !0 });
|
|
7
|
+
var A = (R, n, e) => Xe(R, typeof n != "symbol" ? n + "" : n, e), Ye = (R, n, e) => n.has(R) || Ve("Cannot " + e);
|
|
8
|
+
var t = (R, n, e) => (Ye(R, n, "read from private field"), e ? e.call(R) : n.get(R)), d = (R, n, e) => n.has(R) ? Ve("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(R) : n.set(R, e), p = (R, n, e, s) => (Ye(R, n, "write to private field"), s ? s.call(R, e) : n.set(R, e), e);
|
|
9
|
+
var Ue = (R, n, e, s) => ({
|
|
10
|
+
set _(i) {
|
|
11
|
+
p(R, n, i, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
|
-
return t(R,
|
|
14
|
+
return t(R, n, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
import { trace as
|
|
18
|
-
const
|
|
17
|
+
import { trace as Ke } from "@ninebone/util";
|
|
18
|
+
const He = class He extends Ke.constructor {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
h(
|
|
24
|
-
let
|
|
25
|
-
const
|
|
26
|
-
var z, j, w,
|
|
27
|
-
const
|
|
23
|
+
h(He, "Trace");
|
|
24
|
+
let oe = He;
|
|
25
|
+
const W = new oe();
|
|
26
|
+
var z, j, w, X, K, Z, It, G, _t;
|
|
27
|
+
const Me = class Me extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
d(this, z);
|
|
31
31
|
d(this, j, !1);
|
|
32
32
|
d(this, w);
|
|
33
|
+
d(this, X);
|
|
34
|
+
d(this, K);
|
|
33
35
|
d(this, Z);
|
|
34
|
-
d(this,
|
|
35
|
-
d(this, J);
|
|
36
|
-
d(this, _t, /* @__PURE__ */ h(() => {
|
|
36
|
+
d(this, It, /* @__PURE__ */ h(() => {
|
|
37
37
|
if (!t(this, z)) return;
|
|
38
38
|
const e = t(this, z).querySelector(".ng-container-body .ng-part-body");
|
|
39
|
-
e && (p(this,
|
|
39
|
+
e && (p(this, Z, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
|
-
})), t(this,
|
|
41
|
+
})), t(this, Z).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
|
-
|
|
43
|
+
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
44
44
|
if (!t(this, z) || !t(this, w) || t(this, j)) return;
|
|
45
45
|
const e = t(this, w).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const
|
|
47
|
+
const i = t(this, w).track, r = t(this, w).thumb, o = t(this, z).querySelector(".ng-container-bottom"), a = e.clientWidth, c = s.scrollWidth;
|
|
48
48
|
if (a !== 0 && c > a)
|
|
49
49
|
o && (o.style.display = "flex");
|
|
50
50
|
else {
|
|
51
51
|
o && (o.style.display = "none");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
const l =
|
|
54
|
+
const l = i.clientWidth;
|
|
55
55
|
if (l <= 0) return;
|
|
56
56
|
const f = Math.max(Math.min(l * (a / c), l), 20);
|
|
57
|
-
|
|
57
|
+
r.style.width = `${f}px`;
|
|
58
58
|
const u = e.scrollLeft, g = c - a;
|
|
59
59
|
let b = 0;
|
|
60
60
|
g > 0 && (b = parseInt(u / g * (l - f), 10)), b < 0 && (b = 0);
|
|
61
61
|
const m = l - f;
|
|
62
|
-
b > m && (b = m),
|
|
62
|
+
b > m && (b = m), r.style.left = `${b}px`, t(this, w).left.disabled = b === 0, t(this, w).right.disabled = b >= m - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
d(this,
|
|
64
|
+
d(this, G, /* @__PURE__ */ h((e) => {
|
|
65
65
|
if (!t(this, w)) return !1;
|
|
66
|
-
const s = t(this, w).container,
|
|
67
|
-
if (!
|
|
68
|
-
const
|
|
66
|
+
const s = t(this, w).container, i = s.querySelector("table");
|
|
67
|
+
if (!i) return !1;
|
|
68
|
+
const r = t(this, w).track.getBoundingClientRect(), o = t(this, w).thumb.clientWidth;
|
|
69
69
|
let a = e;
|
|
70
70
|
a < 0 && (a = 0);
|
|
71
|
-
const c =
|
|
71
|
+
const c = r.width - o;
|
|
72
72
|
a > c && (a = c), 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 >= c - 1;
|
|
73
|
-
const l = s.clientWidth, u =
|
|
73
|
+
const l = s.clientWidth, u = i.scrollWidth - l;
|
|
74
74
|
return c > 0 && u > 0 && (s.scrollLeft = a / c * u), a > 0 && a < c - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
d(this,
|
|
77
|
-
const e = /* @__PURE__ */ h((
|
|
78
|
-
clearInterval(t(this,
|
|
79
|
-
const
|
|
80
|
-
t(this,
|
|
81
|
-
clearInterval(t(this,
|
|
76
|
+
d(this, _t, /* @__PURE__ */ h(() => {
|
|
77
|
+
const e = /* @__PURE__ */ h((i) => {
|
|
78
|
+
clearInterval(t(this, X)), clearInterval(t(this, K));
|
|
79
|
+
const r = parseInt(t(this, w).thumb.style.left || 0, 10);
|
|
80
|
+
t(this, G).call(this, r + i), p(this, X, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, X)), p(this, K, setInterval(() => {
|
|
82
82
|
const o = parseInt(t(this, w).thumb.style.left || 0, 10);
|
|
83
|
-
t(this,
|
|
83
|
+
t(this, G).call(this, o + i) || clearInterval(t(this, K));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), s = /* @__PURE__ */ h(() => {
|
|
87
|
-
clearInterval(t(this,
|
|
87
|
+
clearInterval(t(this, X)), clearInterval(t(this, K));
|
|
88
88
|
}, "clearTimer");
|
|
89
|
-
["mouseup", "mouseleave", "touchend"].forEach((
|
|
90
|
-
t(this, w).left.addEventListener(
|
|
91
|
-
}), t(this, w).left.addEventListener("mousedown", (
|
|
92
|
-
|
|
93
|
-
}), t(this, w).right.addEventListener("mousedown", (
|
|
94
|
-
|
|
95
|
-
}), t(this, w).left.addEventListener("touchstart", () => e(-20)), t(this, w).right.addEventListener("touchstart", () => e(20)), t(this, w).track.addEventListener("mousedown", (
|
|
96
|
-
if (
|
|
97
|
-
|
|
98
|
-
const
|
|
99
|
-
t(this,
|
|
100
|
-
}), t(this, w).thumb.addEventListener("mousedown", (
|
|
101
|
-
if (
|
|
102
|
-
|
|
103
|
-
const
|
|
89
|
+
["mouseup", "mouseleave", "touchend"].forEach((i) => {
|
|
90
|
+
t(this, w).left.addEventListener(i, s), t(this, w).right.addEventListener(i, s), t(this, w).track.addEventListener(i, s);
|
|
91
|
+
}), t(this, w).left.addEventListener("mousedown", (i) => {
|
|
92
|
+
i.button === 0 && e(-20);
|
|
93
|
+
}), t(this, w).right.addEventListener("mousedown", (i) => {
|
|
94
|
+
i.button === 0 && e(20);
|
|
95
|
+
}), t(this, w).left.addEventListener("touchstart", () => e(-20)), t(this, w).right.addEventListener("touchstart", () => e(20)), t(this, w).track.addEventListener("mousedown", (i) => {
|
|
96
|
+
if (i.button !== 0) return;
|
|
97
|
+
i.preventDefault();
|
|
98
|
+
const r = t(this, w).track.getBoundingClientRect(), o = t(this, w).thumb.clientWidth;
|
|
99
|
+
t(this, G).call(this, i.clientX - r.left - o / 2);
|
|
100
|
+
}), t(this, w).thumb.addEventListener("mousedown", (i) => {
|
|
101
|
+
if (i.button !== 0) return;
|
|
102
|
+
i.stopPropagation(), i.preventDefault(), p(this, j, !0), this.shiftX = i.clientX - t(this, w).thumb.getBoundingClientRect().left;
|
|
103
|
+
const r = /* @__PURE__ */ h((a) => {
|
|
104
104
|
if (!t(this, j)) return;
|
|
105
105
|
const c = t(this, w).track.getBoundingClientRect();
|
|
106
|
-
t(this,
|
|
106
|
+
t(this, G).call(this, a.clientX - c.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
108
|
-
p(this, j, !1), s(), document.removeEventListener("mousemove",
|
|
108
|
+
p(this, j, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
|
-
document.addEventListener("mousemove",
|
|
110
|
+
document.addEventListener("mousemove", r), document.addEventListener("mouseup", o);
|
|
111
111
|
});
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
@@ -190,73 +190,73 @@ const $e = class $e extends HTMLElement {
|
|
|
190
190
|
right: this.querySelector(".ng-scroll-right")
|
|
191
191
|
}), s.addEventListener("scroll", () => {
|
|
192
192
|
t(this, j) || this.refresh();
|
|
193
|
-
}), t(this,
|
|
193
|
+
}), t(this, _t).call(this), t(this, It).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
197
197
|
disconnectedCallback() {
|
|
198
|
-
t(this,
|
|
198
|
+
t(this, Z) && t(this, Z).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
z = new WeakMap(), j = new WeakMap(), w = new WeakMap(),
|
|
202
|
-
let
|
|
203
|
-
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar",
|
|
204
|
-
var F,
|
|
205
|
-
const
|
|
201
|
+
z = 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(), h(Me, "NineTableHScrollBar");
|
|
202
|
+
let ae = Me;
|
|
203
|
+
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ae);
|
|
204
|
+
var F, at, J, q, xt, vt, Nt;
|
|
205
|
+
const $e = class $e extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
208
|
d(this, F);
|
|
209
|
-
d(this,
|
|
210
|
-
d(this,
|
|
209
|
+
d(this, at);
|
|
210
|
+
d(this, J, !1);
|
|
211
211
|
d(this, q);
|
|
212
|
-
d(this,
|
|
213
|
-
d(this,
|
|
214
|
-
|
|
212
|
+
d(this, xt, 0);
|
|
213
|
+
d(this, vt, 0);
|
|
214
|
+
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
215
|
if (!t(this, F) || !t(this, q)) return;
|
|
216
|
-
const e = t(this, q).container, s = t(this, q).track,
|
|
217
|
-
if (l <=
|
|
218
|
-
|
|
216
|
+
const e = t(this, q).container, s = t(this, q).track, i = t(this, q).thumb, r = e.clientHeight, a = (t(this, F).data.get() || []).length, c = t(this, at).getRowHeight(), l = a * c;
|
|
217
|
+
if (l <= r) {
|
|
218
|
+
i.style.display = "none", t(this, q).top.disabled = !0, t(this, q).bottom.disabled = !0;
|
|
219
219
|
return;
|
|
220
220
|
} else
|
|
221
|
-
|
|
221
|
+
i.style.display = "block";
|
|
222
222
|
const f = s.clientHeight;
|
|
223
223
|
if (f <= 0) return;
|
|
224
|
-
const u = Math.max(Math.min(f * (
|
|
225
|
-
|
|
226
|
-
const g = e.scrollTop, b = Math.max(l -
|
|
224
|
+
const u = Math.max(Math.min(f * (r / l), f), 20);
|
|
225
|
+
i.style.height = `${u}px`;
|
|
226
|
+
const g = e.scrollTop, b = Math.max(l - r, 1);
|
|
227
227
|
let m = 0;
|
|
228
228
|
b > 0 && (m = g / b * (f - u));
|
|
229
229
|
const v = f - u;
|
|
230
|
-
m < 0 && (m = 0), m > v && (m = v),
|
|
230
|
+
m < 0 && (m = 0), m > v && (m = v), i.style.top = `${m}px`, t(this, q).top.disabled = g <= 0, t(this, q).bottom.disabled = g >= b - 1;
|
|
231
231
|
}, "refresh"));
|
|
232
|
-
d(this,
|
|
233
|
-
|
|
232
|
+
d(this, Nt, /* @__PURE__ */ h(() => {
|
|
233
|
+
W.log("nine-table-vscrollbar.#init");
|
|
234
234
|
const e = t(this, q).container, s = /* @__PURE__ */ h(() => {
|
|
235
|
-
const
|
|
236
|
-
return
|
|
235
|
+
const r = (t(this, F).data.get() || []).length, o = t(this, at).getRowHeight();
|
|
236
|
+
return r * o;
|
|
237
237
|
}, "getContentHeight");
|
|
238
238
|
e.addEventListener("scroll", () => {
|
|
239
|
-
t(this,
|
|
240
|
-
}), t(this, q).thumb.addEventListener("mousedown", (
|
|
241
|
-
if (
|
|
242
|
-
|
|
243
|
-
const
|
|
244
|
-
if (!t(this,
|
|
245
|
-
const c = t(this, q).track.getBoundingClientRect(), l = t(this, q).thumb.clientHeight, u = c.height - l, g = a.clientY - t(this,
|
|
239
|
+
t(this, J) || this.refresh();
|
|
240
|
+
}), t(this, q).thumb.addEventListener("mousedown", (i) => {
|
|
241
|
+
if (i.button !== 0) return;
|
|
242
|
+
i.stopPropagation(), i.preventDefault(), p(this, J, !0), p(this, xt, i.clientY), p(this, vt, e.scrollTop);
|
|
243
|
+
const r = /* @__PURE__ */ h((a) => {
|
|
244
|
+
if (!t(this, J)) return;
|
|
245
|
+
const c = t(this, q).track.getBoundingClientRect(), l = t(this, q).thumb.clientHeight, u = c.height - l, g = a.clientY - t(this, xt), b = e.clientHeight, m = s(), v = Math.max(m - b, 1);
|
|
246
246
|
if (u > 0 && v > 0) {
|
|
247
|
-
const
|
|
248
|
-
let x = t(this,
|
|
249
|
-
const
|
|
250
|
-
x < 0 && (x = 0), x >
|
|
247
|
+
const E = g / u * v;
|
|
248
|
+
let x = t(this, vt) + E;
|
|
249
|
+
const M = Math.max(0, m - b);
|
|
250
|
+
x < 0 && (x = 0), x > M && (x = M), e.scrollTop = x;
|
|
251
251
|
}
|
|
252
252
|
this.refresh();
|
|
253
253
|
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
254
|
-
p(this,
|
|
254
|
+
p(this, J, !1), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
|
|
255
255
|
}, "onMouseUp");
|
|
256
|
-
document.addEventListener("mousemove",
|
|
257
|
-
}), t(this, q).track.addEventListener("mousedown", (
|
|
258
|
-
if (
|
|
259
|
-
const
|
|
256
|
+
document.addEventListener("mousemove", r), document.addEventListener("mouseup", o);
|
|
257
|
+
}), t(this, q).track.addEventListener("mousedown", (i) => {
|
|
258
|
+
if (i.button !== 0 || i.target === t(this, q).thumb) return;
|
|
259
|
+
const r = t(this, q).track.getBoundingClientRect(), o = t(this, q).thumb.clientHeight, a = i.clientY - r.top - o / 2, l = r.height - o, f = e.clientHeight, u = s(), g = Math.max(u - f, 1);
|
|
260
260
|
if (l > 0 && g > 0) {
|
|
261
261
|
const b = Math.max(0, Math.min(1, a / l));
|
|
262
262
|
e.scrollTop = b * g;
|
|
@@ -270,7 +270,7 @@ const Ie = class Ie extends HTMLElement {
|
|
|
270
270
|
}, "#init"));
|
|
271
271
|
}
|
|
272
272
|
connectedCallback() {
|
|
273
|
-
p(this, F, this.getRootNode().host), p(this,
|
|
273
|
+
p(this, F, this.getRootNode().host), p(this, at, this.closest("nine-table-sheet")), this.innerHTML = `
|
|
274
274
|
<style>
|
|
275
275
|
nine-table-vscrollbar {
|
|
276
276
|
display: flex;
|
|
@@ -346,41 +346,40 @@ const Ie = class Ie extends HTMLElement {
|
|
|
346
346
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
347
347
|
top: this.querySelector(".ng-scroll-top"),
|
|
348
348
|
bottom: this.querySelector(".ng-scroll-bottom")
|
|
349
|
-
}), t(this,
|
|
349
|
+
}), t(this, Nt).call(this), this.refresh();
|
|
350
350
|
}, "initWhenReady");
|
|
351
351
|
e();
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
|
-
F = new WeakMap(),
|
|
355
|
-
let
|
|
356
|
-
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar",
|
|
357
|
-
var
|
|
358
|
-
const
|
|
359
|
-
constructor(
|
|
360
|
-
d(this,
|
|
354
|
+
F = new WeakMap(), at = new WeakMap(), J = new WeakMap(), q = new WeakMap(), xt = new WeakMap(), vt = new WeakMap(), Nt = new WeakMap(), h($e, "NineTableVScrollBar");
|
|
355
|
+
let le = $e;
|
|
356
|
+
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", le);
|
|
357
|
+
var P, S, Q, D, I, V, tt, wt, Se, Ee, Wt, Ot, Bt, St, Et, zt, Dt, At, Ae, lt, Rt, Pt;
|
|
358
|
+
const Ie = class Ie {
|
|
359
|
+
constructor(n) {
|
|
360
|
+
d(this, P);
|
|
361
361
|
d(this, S);
|
|
362
|
-
d(this,
|
|
363
|
-
d(this,
|
|
364
|
-
d(this,
|
|
362
|
+
d(this, Q);
|
|
363
|
+
d(this, D, /* @__PURE__ */ new Map());
|
|
364
|
+
d(this, I, null);
|
|
365
365
|
d(this, V, null);
|
|
366
|
-
d(this,
|
|
367
|
-
d(this,
|
|
366
|
+
d(this, tt, 0);
|
|
367
|
+
d(this, wt, 40);
|
|
368
|
+
d(this, Se, !1);
|
|
368
369
|
d(this, Ee, !1);
|
|
369
|
-
|
|
370
|
-
d(this,
|
|
371
|
-
|
|
372
|
-
d(this, Ot, 3);
|
|
373
|
-
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
370
|
+
//#ticking = false; // 🎯 고속 스크롤 스로틀링용 플래그
|
|
371
|
+
d(this, Wt, 3);
|
|
372
|
+
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
374
373
|
var e;
|
|
375
|
-
|
|
376
|
-
const
|
|
377
|
-
|
|
374
|
+
W.log("rowManager.refresh");
|
|
375
|
+
const n = t(this, S).querySelector(".ng-container-body .ng-part-body");
|
|
376
|
+
n && (t(this, St).call(this), t(this, lt).call(this, n.scrollTop), (e = t(this, S).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
378
377
|
}, "refresh"));
|
|
379
|
-
|
|
380
|
-
|
|
378
|
+
A(this, "initialize", /* @__PURE__ */ h(() => {
|
|
379
|
+
W.log("rowManager.initialize"), p(this, Q, {
|
|
381
380
|
scrollTables: t(this, S).querySelectorAll(".ng-part-body table"),
|
|
382
381
|
firstTr: t(this, S).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
383
|
-
}), p(this,
|
|
382
|
+
}), p(this, I, null), t(this, D).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
384
383
|
const a = t(this, S).querySelector(o);
|
|
385
384
|
if (!a) return;
|
|
386
385
|
const c = a.querySelector(".ng-part-body table");
|
|
@@ -388,166 +387,166 @@ const _e = class _e {
|
|
|
388
387
|
const l = c.querySelector("tbody.bindable-tbody");
|
|
389
388
|
if (!l) return;
|
|
390
389
|
const u = Array.from(l.querySelectorAll("tr")).map((g) => g.cloneNode(!0));
|
|
391
|
-
t(this,
|
|
390
|
+
t(this, D).set(o, u);
|
|
392
391
|
});
|
|
393
|
-
const
|
|
394
|
-
if (
|
|
395
|
-
t(this,
|
|
392
|
+
const n = 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"), i = t(this, S).querySelector(".ng-container-body .ng-part-header"), r = t(this, S).querySelector(".ng-container-body .ng-part-footer");
|
|
393
|
+
if (n) {
|
|
394
|
+
t(this, Bt).call(this, n), t(this, At).call(this), t(this, St).call(this), t(this, lt).call(this, n.scrollTop);
|
|
396
395
|
let o = !1;
|
|
397
396
|
const a = /* @__PURE__ */ h((c) => {
|
|
398
397
|
if (o) return;
|
|
399
398
|
o = !0;
|
|
400
399
|
const l = c.scrollTop, f = c.scrollLeft;
|
|
401
|
-
|
|
400
|
+
n && n.scrollTop !== l && (n.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), i && i.scrollLeft !== f && (i.scrollLeft = f), r && r.scrollLeft !== f && (r.scrollLeft = f), t(this, lt).call(this, l), o = !1;
|
|
402
401
|
}, "handleContainerScroll");
|
|
403
|
-
[
|
|
402
|
+
[n, e, s].forEach((c) => {
|
|
404
403
|
c && c.addEventListener("scroll", () => {
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
}));
|
|
408
|
-
});
|
|
404
|
+
a(c);
|
|
405
|
+
}, { passive: !0 });
|
|
409
406
|
});
|
|
410
407
|
}
|
|
411
408
|
}, "initialize"));
|
|
412
|
-
d(this,
|
|
413
|
-
|
|
414
|
-
const s = t(this,
|
|
409
|
+
d(this, Ot, /* @__PURE__ */ h((n, e) => {
|
|
410
|
+
W.log("rowManager.#renderRows");
|
|
411
|
+
const s = t(this, D).get(e);
|
|
415
412
|
if (!s || s.length === 0) return;
|
|
416
|
-
const
|
|
417
|
-
if (!
|
|
418
|
-
|
|
419
|
-
const
|
|
420
|
-
for (let a = 0; a < t(this,
|
|
413
|
+
const i = n.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
414
|
+
if (!i) return;
|
|
415
|
+
i.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
|
|
416
|
+
const r = i.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
417
|
+
for (let a = 0; a < t(this, wt); a++)
|
|
421
418
|
s.forEach((c) => {
|
|
422
419
|
o.appendChild(c.cloneNode(!0));
|
|
423
420
|
});
|
|
424
|
-
|
|
421
|
+
r ? r.before(o) : i.appendChild(o), e === ".ng-container-body" && (t(this, Q).firstTr = i.querySelector("tr:not(.nodata)"));
|
|
425
422
|
}, "#renderRows"));
|
|
426
|
-
d(this,
|
|
427
|
-
if (
|
|
428
|
-
return t(this,
|
|
429
|
-
|
|
430
|
-
const e = t(this,
|
|
423
|
+
d(this, Bt, /* @__PURE__ */ h((n) => {
|
|
424
|
+
if (W.log("rowManager.#measureAndCacheHeight"), t(this, I) !== null && t(this, I) > 0)
|
|
425
|
+
return t(this, I);
|
|
426
|
+
W.log("#measureAndCacheHeight");
|
|
427
|
+
const e = t(this, D).get(".ng-container-body");
|
|
431
428
|
if (!e || e.length === 0) return 24;
|
|
432
|
-
const s =
|
|
429
|
+
const s = n.querySelector("tbody.bindable-tbody");
|
|
433
430
|
if (!s) return 24;
|
|
434
431
|
s.querySelectorAll("tr:not(.nodata)").forEach((g) => g.remove());
|
|
435
|
-
const
|
|
432
|
+
const i = s.querySelector("tr.nodata"), r = document.createDocumentFragment();
|
|
436
433
|
e.forEach((g) => {
|
|
437
|
-
|
|
438
|
-
}),
|
|
434
|
+
r.appendChild(g.cloneNode(!0));
|
|
435
|
+
}), i ? i.before(r) : s.appendChild(r);
|
|
439
436
|
const o = t(this, S), a = o.style.display, c = o.style.visibility, l = o.style.position;
|
|
440
437
|
(a === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
441
438
|
let f = 0;
|
|
442
439
|
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
443
440
|
return u.forEach((g) => {
|
|
444
441
|
f += g.offsetHeight || g.getBoundingClientRect().height;
|
|
445
|
-
}), u.forEach((g) => g.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l, p(this,
|
|
442
|
+
}), u.forEach((g) => g.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l, p(this, I, f > 0 ? f : 24), t(this, Et).call(this), t(this, I);
|
|
446
443
|
}, "#measureAndCacheHeight"));
|
|
447
|
-
d(this,
|
|
448
|
-
|
|
449
|
-
const e = (t(this,
|
|
450
|
-
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
451
|
-
const o = t(this, S).querySelector(
|
|
444
|
+
d(this, St, /* @__PURE__ */ h(() => {
|
|
445
|
+
W.log("rowManager.#updateVirtualScrollHeight");
|
|
446
|
+
const e = (t(this, P).data.get() || []).length, s = t(this, I), i = e * s;
|
|
447
|
+
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((r) => {
|
|
448
|
+
const o = t(this, S).querySelector(r);
|
|
452
449
|
if (!o) return;
|
|
453
450
|
const a = o.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
454
|
-
a && (a.style.height = `${
|
|
451
|
+
a && (a.style.height = `${i}px`);
|
|
455
452
|
});
|
|
456
453
|
}, "#updateVirtualScrollHeight"));
|
|
457
|
-
d(this,
|
|
458
|
-
if (t(this,
|
|
459
|
-
const
|
|
460
|
-
p(this,
|
|
454
|
+
d(this, Et, /* @__PURE__ */ h(() => {
|
|
455
|
+
if (t(this, tt) > 0 && t(this, I) > 0) {
|
|
456
|
+
const n = Math.ceil(t(this, tt) / t(this, I));
|
|
457
|
+
p(this, wt, n + t(this, Wt));
|
|
461
458
|
}
|
|
462
459
|
}, "#updateRowCount"));
|
|
463
|
-
d(this,
|
|
460
|
+
d(this, zt, /* @__PURE__ */ h(() => {
|
|
464
461
|
var a, c, l, f, u, g;
|
|
465
|
-
const
|
|
462
|
+
const n = 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");
|
|
466
463
|
if (e) {
|
|
467
|
-
const b =
|
|
468
|
-
for (let x = 0; x <
|
|
469
|
-
const
|
|
464
|
+
const b = n ? Array.from(n.querySelectorAll("tbody tr")) : [], m = Array.from(e.querySelectorAll("tbody tr")), v = s ? Array.from(s.querySelectorAll("tbody tr")) : [], E = Math.max(b.length, m.length, v.length);
|
|
465
|
+
for (let x = 0; x < E; x++) {
|
|
466
|
+
const M = [
|
|
470
467
|
((a = b[x]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
471
468
|
((c = m[x]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
472
469
|
((l = v[x]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
473
|
-
], T = Math.max(...
|
|
470
|
+
], T = Math.max(...M);
|
|
474
471
|
T > 0 && (b[x] && (b[x].style.height = `${T}px`), m[x] && (m[x].style.height = `${T}px`), v[x] && (v[x].style.height = `${T}px`));
|
|
475
472
|
}
|
|
476
473
|
}
|
|
477
|
-
const
|
|
478
|
-
if (
|
|
479
|
-
const b =
|
|
480
|
-
for (let x = 0; x <
|
|
481
|
-
const
|
|
474
|
+
const i = t(this, S).querySelector(".ng-container-left .ng-part-footer table"), r = t(this, S).querySelector(".ng-container-body .ng-part-footer table"), o = t(this, S).querySelector(".ng-container-right .ng-part-footer table");
|
|
475
|
+
if (r) {
|
|
476
|
+
const b = i ? Array.from(i.querySelectorAll("tfoot tr")) : [], m = Array.from(r.querySelectorAll("tfoot tr")), v = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], E = Math.max(b.length, m.length, v.length);
|
|
477
|
+
for (let x = 0; x < E; x++) {
|
|
478
|
+
const M = [
|
|
482
479
|
((f = b[x]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
483
480
|
((u = m[x]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
|
|
484
481
|
((g = v[x]) == null ? void 0 : g.getBoundingClientRect().height) || 0
|
|
485
|
-
], T = Math.max(...
|
|
482
|
+
], T = Math.max(...M);
|
|
486
483
|
T > 0 && (b[x] && (b[x].style.height = `${T}px`), m[x] && (m[x].style.height = `${T}px`), v[x] && (v[x].style.height = `${T}px`));
|
|
487
484
|
}
|
|
488
485
|
}
|
|
489
486
|
}, "#syncRowHeights"));
|
|
490
487
|
d(this, Dt, /* @__PURE__ */ h(() => {
|
|
491
|
-
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (p(this, V, new ResizeObserver((
|
|
492
|
-
for (const e of
|
|
488
|
+
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (p(this, V, new ResizeObserver((n) => {
|
|
489
|
+
for (const e of n) {
|
|
493
490
|
const s = e.target;
|
|
494
491
|
if (!s.classList.contains("active")) continue;
|
|
495
|
-
const
|
|
496
|
-
if (
|
|
497
|
-
let
|
|
492
|
+
const i = e.contentRect.height;
|
|
493
|
+
if (i > 0) {
|
|
494
|
+
let r = 0;
|
|
498
495
|
const o = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
|
|
499
|
-
o && (
|
|
500
|
-
const c = Math.max(
|
|
501
|
-
t(this,
|
|
496
|
+
o && (r += o.offsetHeight), a && (r += a.offsetHeight);
|
|
497
|
+
const c = Math.max(i - r, 100);
|
|
498
|
+
t(this, tt) !== c && (p(this, tt, c), t(this, Et).call(this), t(this, I) !== null && (t(this, At).call(this), this.refresh()));
|
|
502
499
|
}
|
|
503
500
|
}
|
|
504
501
|
})), t(this, V).observe(t(this, S)));
|
|
505
502
|
}, "#initResizeObserver"));
|
|
506
|
-
d(this,
|
|
507
|
-
|
|
508
|
-
const e = t(this, S).querySelector(
|
|
509
|
-
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this,
|
|
510
|
-
}), t(this,
|
|
503
|
+
d(this, At, /* @__PURE__ */ h(() => {
|
|
504
|
+
W.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
505
|
+
const e = t(this, S).querySelector(n);
|
|
506
|
+
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Ot).call(this, e, n);
|
|
507
|
+
}), t(this, Pt).call(this), t(this, zt).call(this);
|
|
511
508
|
}, "#renderAllContainers"));
|
|
512
|
-
d(this,
|
|
509
|
+
d(this, Ae, /* @__PURE__ */ h((n) => {
|
|
513
510
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
514
511
|
var l;
|
|
515
512
|
const s = t(this, S).querySelector(e);
|
|
516
513
|
if (!s) return;
|
|
517
|
-
const
|
|
518
|
-
if (!
|
|
519
|
-
const
|
|
520
|
-
|
|
521
|
-
const g =
|
|
514
|
+
const i = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
515
|
+
if (!i) return;
|
|
516
|
+
const r = Array.from(i.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this, D).get(e)) == null ? void 0 : l.length) || 1, c = (t(this, P).data.get() || []).length;
|
|
517
|
+
r.forEach((f, u) => {
|
|
518
|
+
const g = n + Math.floor(u / o);
|
|
522
519
|
if (g >= c) {
|
|
523
520
|
f.style.display = "none";
|
|
524
521
|
return;
|
|
525
522
|
}
|
|
526
|
-
const b = t(this,
|
|
527
|
-
f.style.display = "", t(this,
|
|
523
|
+
const b = t(this, P).data.get(g);
|
|
524
|
+
f.style.display = "", t(this, Rt).call(this, f, b, g);
|
|
528
525
|
});
|
|
529
526
|
});
|
|
530
527
|
}, "#adjustBufferRows"));
|
|
531
|
-
d(this,
|
|
532
|
-
var
|
|
533
|
-
const e = t(this,
|
|
528
|
+
d(this, lt, /* @__PURE__ */ h((n) => {
|
|
529
|
+
var f, u;
|
|
530
|
+
const e = t(this, I);
|
|
534
531
|
if (!e || e <= 0) return;
|
|
535
|
-
const s = t(this,
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
const
|
|
542
|
-
if (!
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
532
|
+
const s = t(this, P).data.length;
|
|
533
|
+
if (s === 0) return;
|
|
534
|
+
const i = ((f = t(this, D).get(".ng-container-body")) == null ? void 0 : f.length) || 1, r = Math.max(0, s - 1), o = Math.min(r, Math.max(0, Math.floor(n / e))), a = Math.floor(o * e), c = t(this, Q).firstTr, l = c && c.dataset.row !== void 0 ? parseInt(c.dataset.row, 10) : -1;
|
|
535
|
+
(u = t(this, Q)) == null || u.scrollTables.forEach((g) => {
|
|
536
|
+
g.style.transform = `translate3d(0, ${a}px, 0)`;
|
|
537
|
+
}), l !== o && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
|
|
538
|
+
const b = t(this, S).querySelector(g);
|
|
539
|
+
if (!b) return;
|
|
540
|
+
const m = b.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
541
|
+
if (!m) return;
|
|
542
|
+
Array.from(m.querySelectorAll("tr:not(.nodata)")).forEach((E, x) => {
|
|
543
|
+
const M = o + Math.floor(x / i);
|
|
544
|
+
if (M >= s) {
|
|
545
|
+
E.style.display = "none";
|
|
547
546
|
return;
|
|
548
547
|
}
|
|
549
|
-
const
|
|
550
|
-
|
|
548
|
+
const T = t(this, P).data.get(M);
|
|
549
|
+
E.style.display = "", t(this, Rt).call(this, E, T, M);
|
|
551
550
|
});
|
|
552
551
|
});
|
|
553
552
|
}, "#handleScroll"));
|
|
@@ -565,63 +564,63 @@ const _e = class _e {
|
|
|
565
564
|
cell.dataset.row = dataIndex;
|
|
566
565
|
});
|
|
567
566
|
}; */
|
|
568
|
-
d(this,
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
const o = Array.from(
|
|
567
|
+
d(this, Rt, /* @__PURE__ */ h((n, e, s) => {
|
|
568
|
+
n.dataset.row = s, n.data = e, Array.from(n.cells).forEach((i, r) => {
|
|
569
|
+
i.dataset.row = s;
|
|
570
|
+
const o = Array.from(i.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
|
|
572
571
|
o && typeof o.refresh == "function" && o.refresh();
|
|
573
572
|
});
|
|
574
573
|
}, "#bindRowData"));
|
|
575
|
-
d(this,
|
|
574
|
+
d(this, Pt, /* @__PURE__ */ h(() => {
|
|
576
575
|
var c, l, f;
|
|
577
|
-
|
|
578
|
-
const
|
|
576
|
+
W.log("rowManager.#syncHeaderHeights");
|
|
577
|
+
const n = 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");
|
|
579
578
|
if (!e) return;
|
|
580
|
-
const
|
|
579
|
+
const i = n ? Array.from(n.querySelectorAll("tr")) : [], r = Array.from(e.querySelectorAll("tr")), o = s ? Array.from(s.querySelectorAll("tr")) : [], a = Math.max(i.length, r.length, o.length);
|
|
581
580
|
for (let u = 0; u < a; u++) {
|
|
582
581
|
const g = [
|
|
583
|
-
((c =
|
|
584
|
-
((l =
|
|
582
|
+
((c = i[u]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
583
|
+
((l = r[u]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
585
584
|
((f = o[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
586
585
|
], b = Math.max(...g);
|
|
587
|
-
b > 0 && (
|
|
586
|
+
b > 0 && (i[u] && (i[u].style.height = `${b}px`), r[u] && (r[u].style.height = `${b}px`), o[u] && (o[u].style.height = `${b}px`));
|
|
588
587
|
}
|
|
589
588
|
}, "#syncHeaderHeights"));
|
|
590
|
-
|
|
589
|
+
A(this, "destroy", /* @__PURE__ */ h(() => {
|
|
591
590
|
t(this, V) && (t(this, V).disconnect(), p(this, V, null));
|
|
592
591
|
}, "destroy"));
|
|
593
|
-
p(this,
|
|
592
|
+
p(this, P, n.getRootNode().host), p(this, S, n), t(this, Dt).call(this);
|
|
594
593
|
}
|
|
595
594
|
getRowHeight() {
|
|
596
|
-
return t(this,
|
|
595
|
+
return t(this, I);
|
|
597
596
|
}
|
|
598
|
-
templateLength(
|
|
597
|
+
templateLength(n = ".ng-container-body") {
|
|
599
598
|
var e;
|
|
600
|
-
return ((e = t(this,
|
|
599
|
+
return ((e = t(this, D).get(n)) == null ? void 0 : e.length) || 1;
|
|
601
600
|
}
|
|
602
601
|
};
|
|
603
|
-
|
|
604
|
-
let
|
|
605
|
-
const
|
|
602
|
+
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(), Bt = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), zt = new WeakMap(), Dt = new WeakMap(), At = new WeakMap(), Ae = new WeakMap(), lt = new WeakMap(), Rt = new WeakMap(), Pt = new WeakMap(), h(Ie, "RowManager");
|
|
603
|
+
let ce = Ie;
|
|
604
|
+
const jt = class jt {
|
|
606
605
|
/**
|
|
607
606
|
* 🎯 레이아웃 내의 여러 rawTables 배열을 일괄로 받아 단일 마스터 템플릿으로 사전 컴파일합니다.
|
|
608
607
|
*/
|
|
609
|
-
static compileAll(
|
|
610
|
-
return Array.isArray(
|
|
608
|
+
static compileAll(n) {
|
|
609
|
+
return Array.isArray(n) ? n.map((e) => jt.compile(e)) : [];
|
|
611
610
|
}
|
|
612
611
|
/**
|
|
613
612
|
* 🎯 단일 원본 테이블을 받아 기본 구조 보정 및 2차원 격자 인덱스 사전 부여 완료된 마스터 테이블 반환
|
|
614
613
|
*/
|
|
615
|
-
static compile(
|
|
616
|
-
if (!
|
|
614
|
+
static compile(n) {
|
|
615
|
+
if (!n) return null;
|
|
617
616
|
const e = /* @__PURE__ */ h((a) => {
|
|
618
617
|
a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
|
|
619
618
|
const f = l.getAttribute("cell-type") || "renderer";
|
|
620
619
|
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
621
620
|
let u = `cell-${f}`;
|
|
622
621
|
const g = l.getAttribute("data-bind"), b = l.getAttribute("data-expr"), m = l.getAttribute("maxbyte"), v = l.getAttribute("type");
|
|
623
|
-
let
|
|
624
|
-
g &&
|
|
622
|
+
let E = [];
|
|
623
|
+
g && E.push(`data-bind="${g}"`), b && E.push(`data-expr="${b}"`), m && E.push(`maxbyte="${m}"`), v && E.push(`type="${v}"`), l.innerHTML = `<${u} ${E.join(" ")}></${u}>`;
|
|
625
624
|
});
|
|
626
625
|
}, "processCellTypes"), s = /* @__PURE__ */ h((a) => {
|
|
627
626
|
if (!a.querySelector("colgroup")) {
|
|
@@ -637,7 +636,7 @@ const Ft = class Ft {
|
|
|
637
636
|
l ? l.after(c) : a.prepend(c);
|
|
638
637
|
}
|
|
639
638
|
a.classList.add("nine-table-element"), a.style.display = "table";
|
|
640
|
-
}, "ensureTableStructure"),
|
|
639
|
+
}, "ensureTableStructure"), i = /* @__PURE__ */ h((a, c) => {
|
|
641
640
|
const l = Array.from(a.querySelectorAll(c + " tr")), f = Array.from(a.querySelectorAll(c + " th," + c + " td")), u = l.length;
|
|
642
641
|
if (u === 0 || f.length === 0) return;
|
|
643
642
|
let g = 0;
|
|
@@ -647,118 +646,118 @@ const Ft = class Ft {
|
|
|
647
646
|
const b = Array.from(Array(u), () => Array(g).fill(null));
|
|
648
647
|
l.forEach((m) => {
|
|
649
648
|
const v = m.sectionRowIndex;
|
|
650
|
-
let
|
|
649
|
+
let E = 0;
|
|
651
650
|
Array.from(m.querySelectorAll("th,td")).forEach((x) => {
|
|
652
|
-
for (let
|
|
653
|
-
if (b[v][
|
|
654
|
-
|
|
651
|
+
for (let B = 0; B < b[v].length; B++)
|
|
652
|
+
if (b[v][B] === null) {
|
|
653
|
+
E = B;
|
|
655
654
|
break;
|
|
656
655
|
}
|
|
657
|
-
const
|
|
658
|
-
for (let
|
|
659
|
-
for (let
|
|
660
|
-
v +
|
|
656
|
+
const M = x.rowSpan || 1, T = x.colSpan || 1;
|
|
657
|
+
for (let B = 0; B < M; B++)
|
|
658
|
+
for (let pt = 0; pt < T; pt++)
|
|
659
|
+
v + B < u && E + pt < g && (b[v + B][E + pt] = B === 0 && pt === 0 ? "1" : "0");
|
|
661
660
|
});
|
|
662
661
|
}), l.forEach((m) => {
|
|
663
662
|
const v = m.sectionRowIndex;
|
|
664
|
-
Array.from(m.querySelectorAll("th,td")).forEach((
|
|
663
|
+
Array.from(m.querySelectorAll("th,td")).forEach((E) => {
|
|
665
664
|
for (let x = 0; x < b[v].length; x++)
|
|
666
665
|
if (b[v][x] === "1") {
|
|
667
|
-
|
|
666
|
+
E.dataset.col = x, b[v][x] = "0";
|
|
668
667
|
break;
|
|
669
668
|
}
|
|
670
669
|
});
|
|
671
670
|
});
|
|
672
|
-
}, "resetColIndex"),
|
|
673
|
-
return s(
|
|
671
|
+
}, "resetColIndex"), r = n.cloneNode(!0);
|
|
672
|
+
return s(r), e(r), i(r, "thead"), i(r, "tbody"), i(r, "tfoot"), Array.from(r.querySelectorAll("colgroup col")).forEach((a, c) => {
|
|
674
673
|
const l = a.getAttribute("fixed");
|
|
675
|
-
l &&
|
|
674
|
+
l && r.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((f) => {
|
|
676
675
|
f.setAttribute("fixed", l);
|
|
677
676
|
});
|
|
678
|
-
}),
|
|
677
|
+
}), r;
|
|
679
678
|
}
|
|
680
679
|
// 🎯 [추가] td/th에 선언된 cell-type 속성을 읽어 커스텀 태그로 자동 감싸기
|
|
681
680
|
};
|
|
682
|
-
h(
|
|
683
|
-
let
|
|
684
|
-
var
|
|
685
|
-
const
|
|
681
|
+
h(jt, "TableCompiler");
|
|
682
|
+
let he = jt;
|
|
683
|
+
var Ft, et, st, Vt, Yt, ct, Ut, Xt;
|
|
684
|
+
const yt = class yt extends HTMLElement {
|
|
686
685
|
constructor() {
|
|
687
686
|
super();
|
|
688
|
-
d(this,
|
|
689
|
-
d(this,
|
|
690
|
-
d(this,
|
|
691
|
-
|
|
692
|
-
t(this,
|
|
687
|
+
d(this, Ft);
|
|
688
|
+
d(this, et, null);
|
|
689
|
+
d(this, st);
|
|
690
|
+
A(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
691
|
+
t(this, st).refresh();
|
|
693
692
|
}, "invalidate"));
|
|
694
|
-
d(this,
|
|
693
|
+
d(this, Vt, /* @__PURE__ */ h(() => {
|
|
695
694
|
[
|
|
696
695
|
{ selector: ".ng-container-body", type: null },
|
|
697
696
|
{ selector: ".ng-container-left", type: "left" },
|
|
698
697
|
{ selector: ".ng-container-right", type: "right" }
|
|
699
|
-
].forEach(({ selector: s, type:
|
|
700
|
-
const
|
|
701
|
-
if (!
|
|
702
|
-
|
|
698
|
+
].forEach(({ selector: s, type: i }) => {
|
|
699
|
+
const r = this.querySelector(s);
|
|
700
|
+
if (!r) return;
|
|
701
|
+
r.innerHTML = "";
|
|
703
702
|
const o = document.createElement("div");
|
|
704
|
-
o.className = "ng-part-header", o.appendChild(t(this,
|
|
703
|
+
o.className = "ng-part-header", o.appendChild(t(this, ct).call(this, t(this, et), i, "header"));
|
|
705
704
|
const a = document.createElement("div");
|
|
706
705
|
a.className = "ng-part-body";
|
|
707
706
|
const c = document.createElement("div");
|
|
708
|
-
c.className = "ng-scroll-content", c.style.position = "relative", c.style.width = "100%", c.appendChild(t(this,
|
|
707
|
+
c.className = "ng-scroll-content", c.style.position = "relative", c.style.width = "100%", c.appendChild(t(this, ct).call(this, t(this, et), i, "body"));
|
|
709
708
|
const l = document.createElement("div");
|
|
710
709
|
l.className = "ng-virtual-spacer", l.style.width = "100%", l.style.pointerEvents = "none", c.appendChild(l), a.appendChild(c);
|
|
711
710
|
const f = document.createElement("div");
|
|
712
|
-
f.className = "ng-part-footer", f.appendChild(t(this,
|
|
711
|
+
f.className = "ng-part-footer", f.appendChild(t(this, ct).call(this, t(this, et), i, "footer")), r.appendChild(o), r.appendChild(a), r.appendChild(f);
|
|
713
712
|
});
|
|
714
713
|
}, "#renderSplitContainers"));
|
|
715
|
-
d(this,
|
|
714
|
+
d(this, Yt, /* @__PURE__ */ h(() => {
|
|
716
715
|
["left", "right", "body"].forEach((e) => {
|
|
717
|
-
const s = this.querySelector(`.ng-container-${e}`),
|
|
718
|
-
if (!s || !
|
|
719
|
-
let
|
|
720
|
-
|
|
716
|
+
const s = this.querySelector(`.ng-container-${e}`), i = s == null ? void 0 : s.querySelectorAll("table");
|
|
717
|
+
if (!s || !i || i.length === 0) return;
|
|
718
|
+
let r = 0;
|
|
719
|
+
i[0].querySelectorAll("col").forEach((o) => {
|
|
721
720
|
const a = parseInt(o.getAttribute("width"), 10);
|
|
722
|
-
isNaN(
|
|
723
|
-
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${
|
|
721
|
+
isNaN(r) || (r += a);
|
|
722
|
+
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${r}px`, s.style.width = `${r}px`);
|
|
724
723
|
});
|
|
725
724
|
}, "#updateContainerWidths"));
|
|
726
|
-
|
|
727
|
-
e && (p(this,
|
|
725
|
+
A(this, "generate", /* @__PURE__ */ h((e) => {
|
|
726
|
+
e && (p(this, et, he.compile(e)), t(this, Vt).call(this), t(this, Yt).call(this), t(this, st).initialize(), setTimeout(() => {
|
|
728
727
|
var s;
|
|
729
728
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
730
729
|
}, 0));
|
|
731
730
|
}, "generate"));
|
|
732
|
-
d(this,
|
|
733
|
-
const
|
|
734
|
-
if (
|
|
731
|
+
d(this, ct, /* @__PURE__ */ h((e, s, i) => {
|
|
732
|
+
const r = e.cloneNode(!0), o = r.querySelector("thead"), a = r.querySelector("tbody"), c = r.querySelector("tfoot");
|
|
733
|
+
if (i === "header") {
|
|
735
734
|
if (a && a.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
736
735
|
const f = document.createElement("tbody");
|
|
737
|
-
f.className = "fixed-tbody",
|
|
736
|
+
f.className = "fixed-tbody", r.appendChild(f);
|
|
738
737
|
}
|
|
739
|
-
} else
|
|
740
|
-
return s === "left" ?
|
|
738
|
+
} else i === "body" ? (o && o.remove(), c && c.remove(), a && (a.className = "bindable-tbody")) : i === "footer" && (o && o.remove(), a && a.remove());
|
|
739
|
+
return s === "left" ? r.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
741
740
|
l.getAttribute("fixed") !== "left" && l.remove();
|
|
742
|
-
}) : s === "right" ?
|
|
741
|
+
}) : s === "right" ? r.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
743
742
|
l.getAttribute("fixed") !== "right" && l.remove();
|
|
744
|
-
}) :
|
|
743
|
+
}) : r.querySelectorAll("[fixed=left], [fixed=right]").forEach((l) => {
|
|
745
744
|
l.remove();
|
|
746
|
-
}),
|
|
745
|
+
}), r;
|
|
747
746
|
}, "#createSplitTable"));
|
|
748
|
-
|
|
749
|
-
|
|
747
|
+
A(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, st).getRowHeight(), "getRowHeight"));
|
|
748
|
+
A(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
750
749
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
751
750
|
s && (s.scrollLeft = e);
|
|
752
751
|
}, "scrollToX"));
|
|
753
|
-
|
|
752
|
+
A(this, "scrollToY", /* @__PURE__ */ h((e) => {
|
|
754
753
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
755
754
|
s && (s.scrollTop = e);
|
|
756
755
|
}, "scrollToY"));
|
|
757
|
-
d(this,
|
|
758
|
-
t(this,
|
|
756
|
+
d(this, Ut, /* @__PURE__ */ h(() => {
|
|
757
|
+
t(this, Xt).call(this);
|
|
759
758
|
}, "#init"));
|
|
760
|
-
d(this,
|
|
761
|
-
const e =
|
|
759
|
+
d(this, Xt, /* @__PURE__ */ h(() => {
|
|
760
|
+
const e = yt.SCROLLBAR_SIZE;
|
|
762
761
|
this.innerHTML = `
|
|
763
762
|
<style>
|
|
764
763
|
nine-table-sheet {
|
|
@@ -859,19 +858,14 @@ const xt = class xt extends HTMLElement {
|
|
|
859
858
|
flex-shrink: 0;
|
|
860
859
|
background: #f3f4f6;
|
|
861
860
|
}
|
|
862
|
-
|
|
863
|
-
nine-table-sheet {
|
|
864
|
-
|
|
865
|
-
transition: unset !important;
|
|
866
|
-
}
|
|
867
861
|
|
|
868
862
|
nine-table-sheet table {
|
|
869
863
|
border-collapse: collapse;
|
|
870
864
|
width: 100%;
|
|
871
865
|
table-layout: fixed;
|
|
872
|
-
will-change: transform; /* 🎯 GPU 레이어로 분리하여 렌더링 떨림 방지 */
|
|
873
|
-
transform: translateZ(0); /* 🎯 강제 하드웨어 가속 트리거 */
|
|
874
|
-
transition: unset !important;
|
|
866
|
+
--will-change: transform; /* 🎯 GPU 레이어로 분리하여 렌더링 떨림 방지 */
|
|
867
|
+
--transform: translateZ(0); /* 🎯 강제 하드웨어 가속 트리거 */
|
|
868
|
+
--transition: unset !important;
|
|
875
869
|
}
|
|
876
870
|
|
|
877
871
|
nine-table-sheet th, nine-table-sheet td {
|
|
@@ -906,46 +900,47 @@ const xt = class xt extends HTMLElement {
|
|
|
906
900
|
<div class='ng-container-right'></div>
|
|
907
901
|
<nine-table-vscrollbar></nine-table-vscrollbar>
|
|
908
902
|
</div>
|
|
903
|
+
<div class='ng-container-nodata'>Data Not Found</div>
|
|
909
904
|
<div class='ng-container-bottom'>
|
|
910
905
|
<nine-table-hscrollbar></nine-table-hscrollbar>
|
|
911
906
|
<div class='ng-scroll-edge'></div>
|
|
912
907
|
</div>
|
|
913
908
|
`;
|
|
914
909
|
}, "#render"));
|
|
915
|
-
p(this,
|
|
910
|
+
p(this, st, new ce(this)), p(this, Ft, this.getRootNode().host);
|
|
916
911
|
}
|
|
917
912
|
connectedCallback() {
|
|
918
|
-
t(this,
|
|
913
|
+
t(this, Ut).call(this);
|
|
919
914
|
}
|
|
920
915
|
disconnectedCallback() {
|
|
921
|
-
this.innerHTML = "",
|
|
916
|
+
this.innerHTML = "", W.log("NineTableSheet destroyed.");
|
|
922
917
|
}
|
|
923
918
|
};
|
|
924
|
-
|
|
925
|
-
let
|
|
926
|
-
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet",
|
|
927
|
-
var
|
|
928
|
-
const
|
|
919
|
+
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(yt, "NineTableSheet"), A(yt, "SCROLLBAR_SIZE", 16);
|
|
920
|
+
let $t = yt;
|
|
921
|
+
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", $t);
|
|
922
|
+
var Kt, qt;
|
|
923
|
+
const _e = class _e extends HTMLElement {
|
|
929
924
|
constructor() {
|
|
930
925
|
super();
|
|
931
|
-
d(this,
|
|
926
|
+
d(this, Kt, /* @__PURE__ */ h(() => {
|
|
932
927
|
var e;
|
|
933
928
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
934
929
|
var o;
|
|
935
|
-
const
|
|
936
|
-
t(this,
|
|
937
|
-
}), t(this,
|
|
930
|
+
const i = s.ctrlKey || s.metaKey || s.shiftKey, r = parseInt((o = s.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
|
|
931
|
+
t(this, qt).call(this, r, i);
|
|
932
|
+
}), t(this, qt).call(this, 0, !1);
|
|
938
933
|
}, "#init"));
|
|
939
|
-
d(this,
|
|
940
|
-
const
|
|
934
|
+
d(this, qt, /* @__PURE__ */ h((e, s = !1) => {
|
|
935
|
+
const i = /* @__PURE__ */ h(() => {
|
|
941
936
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
942
937
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((b) => b.style.setProperty("display", "none"));
|
|
943
938
|
const g = f.filter((b) => b.classList.contains("active"));
|
|
944
939
|
g.length < 2 || g.forEach((b) => {
|
|
945
|
-
const m = parseInt(b.getAttribute("data-index"), 10), v = this.querySelector(`nine-splitter[data-split-index="${m}"]`),
|
|
946
|
-
v &&
|
|
940
|
+
const m = parseInt(b.getAttribute("data-index"), 10), v = this.querySelector(`nine-splitter[data-split-index="${m}"]`), E = f[m + 1];
|
|
941
|
+
v && E && E.classList.contains("active") && v.style.setProperty("display", "flex");
|
|
947
942
|
});
|
|
948
|
-
}, "updateSplitters"),
|
|
943
|
+
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = r.querySelectorAll(".nine-tab-item"), c = o.querySelectorAll("nine-table-sheet");
|
|
949
944
|
if (!a[e]) return;
|
|
950
945
|
if (!s)
|
|
951
946
|
a.forEach((f, u) => {
|
|
@@ -955,7 +950,7 @@ const Ne = class Ne extends HTMLElement {
|
|
|
955
950
|
f.classList.toggle("active", g), f.style.flex = g ? "1 1 100%" : "";
|
|
956
951
|
});
|
|
957
952
|
else {
|
|
958
|
-
const f = a[e], u =
|
|
953
|
+
const f = a[e], u = r.querySelectorAll(".nine-tab-item.active");
|
|
959
954
|
if (f.classList.contains("active") && u.length <= 1)
|
|
960
955
|
return;
|
|
961
956
|
f.classList.toggle("active");
|
|
@@ -965,39 +960,39 @@ const Ne = class Ne extends HTMLElement {
|
|
|
965
960
|
const l = o.querySelectorAll("nine-table-sheet.active");
|
|
966
961
|
l == null || l.forEach((f) => {
|
|
967
962
|
f.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
968
|
-
}),
|
|
963
|
+
}), i();
|
|
969
964
|
}, "#switchSheet"));
|
|
970
965
|
}
|
|
971
966
|
connectedCallback() {
|
|
972
|
-
t(this,
|
|
967
|
+
t(this, Kt).call(this);
|
|
973
968
|
}
|
|
974
969
|
};
|
|
975
|
-
|
|
976
|
-
let
|
|
977
|
-
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets",
|
|
978
|
-
var
|
|
979
|
-
const
|
|
980
|
-
constructor(
|
|
981
|
-
d(this,
|
|
982
|
-
d(this,
|
|
983
|
-
t(this,
|
|
984
|
-
for (let e of
|
|
985
|
-
t(this,
|
|
986
|
-
}).observe(t(this,
|
|
970
|
+
Kt = new WeakMap(), qt = new WeakMap(), h(_e, "NineTableSheets");
|
|
971
|
+
let de = _e;
|
|
972
|
+
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", de);
|
|
973
|
+
var H, Zt, Tt, Gt;
|
|
974
|
+
const Ne = class Ne {
|
|
975
|
+
constructor(n) {
|
|
976
|
+
d(this, H);
|
|
977
|
+
d(this, Zt, /* @__PURE__ */ h(() => {
|
|
978
|
+
t(this, Gt).call(this), new ResizeObserver((n) => {
|
|
979
|
+
for (let e of n)
|
|
980
|
+
t(this, H).getAttribute("auto-height") === "true" && t(this, Tt).call(this);
|
|
981
|
+
}).observe(t(this, H));
|
|
987
982
|
}, "#init"));
|
|
988
|
-
d(this,
|
|
983
|
+
d(this, Tt, /* @__PURE__ */ h(() => {
|
|
989
984
|
var c, l;
|
|
990
|
-
const
|
|
991
|
-
if (
|
|
992
|
-
const e = parseInt(t(this,
|
|
993
|
-
t(this,
|
|
985
|
+
const n = Array.from(t(this, H).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
986
|
+
if (n.length === 0) return;
|
|
987
|
+
const e = parseInt(t(this, H).getAttribute("max-display-row"), 10) || 10, s = Math.max(...n.map((f) => f.getRowHeight())), i = (c = t(this, H).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, r = (l = t(this, H).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = $t.SCROLLBAR_SIZE, a = e * s + i + r + o;
|
|
988
|
+
t(this, H).style.height = `${a}px`;
|
|
994
989
|
}, "#applyAutoHeight"));
|
|
995
|
-
d(this,
|
|
996
|
-
const e = Array.from(t(this,
|
|
997
|
-
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, g = l <
|
|
990
|
+
d(this, Gt, /* @__PURE__ */ h(() => {
|
|
991
|
+
const e = Array.from(t(this, H).children).filter((c) => c.tagName === "TABLE"), s = t(this, H).getAttribute("auto-height") === "true", i = e.length, r = e.map((c, l) => {
|
|
992
|
+
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, g = l < i - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
998
993
|
return u + g;
|
|
999
994
|
}).join(""), o = e.map((c, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
1000
|
-
t(this,
|
|
995
|
+
t(this, H).shadowRoot.innerHTML = `
|
|
1001
996
|
<style>
|
|
1002
997
|
:host {
|
|
1003
998
|
display: flex;
|
|
@@ -1005,7 +1000,7 @@ const We = class We {
|
|
|
1005
1000
|
position: relative;
|
|
1006
1001
|
overflow: hidden;
|
|
1007
1002
|
height: ${s ? "auto" : "100%"};
|
|
1008
|
-
background: #fff;
|
|
1003
|
+
background: #fff;
|
|
1009
1004
|
}
|
|
1010
1005
|
|
|
1011
1006
|
nine-table-header { height: 40px; display: block; flex-shrink: 0; border-bottom: 1px solid #e5e7eb; background: #fff; }
|
|
@@ -1072,13 +1067,27 @@ const We = class We {
|
|
|
1072
1067
|
padding-left: 12px;
|
|
1073
1068
|
flex-shrink: 0;
|
|
1074
1069
|
}
|
|
1070
|
+
|
|
1071
|
+
nine-table-sheets .ng-container-nodata {
|
|
1072
|
+
display: none;
|
|
1073
|
+
.ng-part-body {
|
|
1074
|
+
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
nine-table-sheets.nodata .ng-container-nodata {
|
|
1079
|
+
display: block;
|
|
1080
|
+
.ng-part-body {
|
|
1081
|
+
display: none;
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1075
1084
|
</style>
|
|
1076
1085
|
|
|
1077
1086
|
<nine-table-header></nine-table-header>
|
|
1078
1087
|
<nine-table-body>
|
|
1079
1088
|
<nine-table-summary></nine-table-summary>
|
|
1080
1089
|
<nine-table-sheets>
|
|
1081
|
-
<nine-table-sheets-body>${
|
|
1090
|
+
<nine-table-sheets-body>${r}</nine-table-sheets-body>
|
|
1082
1091
|
<nine-table-sheets-footer>
|
|
1083
1092
|
<div class="nine-tab-bar">${o}</div>
|
|
1084
1093
|
<div class="sheets-counter">Total : <span id="row-count">0</span></div>
|
|
@@ -1087,239 +1096,240 @@ const We = class We {
|
|
|
1087
1096
|
<nine-table-analysis></nine-table-analysis>
|
|
1088
1097
|
</nine-table-body>
|
|
1089
1098
|
<nine-table-footer></nine-table-footer>
|
|
1090
|
-
|
|
1091
|
-
const a = t(this,
|
|
1099
|
+
`, t(this, H).shadowRoot.querySelector("nine-table-sheets").classList.add("nodata");
|
|
1100
|
+
const a = t(this, H).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1092
1101
|
a == null || a.forEach((c, l) => {
|
|
1093
1102
|
e[l] && setTimeout(() => {
|
|
1094
|
-
c.generate(e[l]), s && t(this,
|
|
1103
|
+
c.generate(e[l]), s && t(this, Tt).call(this);
|
|
1095
1104
|
});
|
|
1096
1105
|
});
|
|
1097
1106
|
}, "#render"));
|
|
1098
|
-
p(this,
|
|
1107
|
+
p(this, H, n), t(this, Zt).call(this);
|
|
1099
1108
|
}
|
|
1100
1109
|
};
|
|
1101
|
-
|
|
1102
|
-
let
|
|
1103
|
-
var
|
|
1104
|
-
const
|
|
1105
|
-
constructor(
|
|
1106
|
-
d(this,
|
|
1107
|
-
d(this,
|
|
1108
|
-
|
|
1109
|
-
p(this,
|
|
1110
|
+
H = new WeakMap(), Zt = new WeakMap(), Tt = new WeakMap(), Gt = new WeakMap(), h(Ne, "LayoutManager");
|
|
1111
|
+
let fe = Ne;
|
|
1112
|
+
var kt, ht;
|
|
1113
|
+
const We = class We {
|
|
1114
|
+
constructor(n) {
|
|
1115
|
+
d(this, kt);
|
|
1116
|
+
d(this, ht, -1);
|
|
1117
|
+
A(this, "count", /* @__PURE__ */ h(() => t(this, kt).rawRecords.length, "count"));
|
|
1118
|
+
p(this, kt, n);
|
|
1110
1119
|
}
|
|
1111
1120
|
get at() {
|
|
1112
|
-
return t(this,
|
|
1121
|
+
return t(this, ht);
|
|
1113
1122
|
}
|
|
1114
|
-
set at(
|
|
1115
|
-
p(this,
|
|
1123
|
+
set at(n) {
|
|
1124
|
+
p(this, ht, parseInt(n, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, ht)}"]`) && setTimeout(() => {
|
|
1116
1125
|
});
|
|
1117
1126
|
}
|
|
1118
1127
|
};
|
|
1119
|
-
|
|
1120
|
-
let
|
|
1121
|
-
var
|
|
1122
|
-
const
|
|
1123
|
-
constructor(
|
|
1124
|
-
d(this,
|
|
1128
|
+
kt = new WeakMap(), ht = new WeakMap(), h(We, "ngRow");
|
|
1129
|
+
let ue = We;
|
|
1130
|
+
var _, k, N, dt, Jt, Y, Qt, nt, Ct, te, ee, ft;
|
|
1131
|
+
const O = class O {
|
|
1132
|
+
constructor(n, e) {
|
|
1133
|
+
d(this, _);
|
|
1125
1134
|
d(this, k);
|
|
1126
|
-
d(this,
|
|
1127
|
-
d(this,
|
|
1128
|
-
d(this,
|
|
1129
|
-
d(this,
|
|
1130
|
-
d(this,
|
|
1131
|
-
p(this,
|
|
1132
|
-
const
|
|
1133
|
-
Array.from(
|
|
1135
|
+
d(this, N, []);
|
|
1136
|
+
d(this, dt, []);
|
|
1137
|
+
d(this, Jt, 0);
|
|
1138
|
+
d(this, Y, []);
|
|
1139
|
+
d(this, Qt, /* @__PURE__ */ h(() => {
|
|
1140
|
+
p(this, Y, []);
|
|
1141
|
+
const n = t(this, _).template || [];
|
|
1142
|
+
Array.from(n).forEach((e) => {
|
|
1134
1143
|
var s;
|
|
1135
|
-
t(this,
|
|
1144
|
+
t(this, Y).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1136
1145
|
}), (t(this, k).rawRecords || []).forEach((e) => {
|
|
1137
|
-
e.__ng || (e.__ng = t(this,
|
|
1146
|
+
e.__ng || (e.__ng = t(this, Ct).call(this)), e.__ng.height = t(this, Y).slice();
|
|
1138
1147
|
});
|
|
1139
1148
|
}, "#initialize"));
|
|
1140
|
-
d(this,
|
|
1141
|
-
t(this,
|
|
1142
|
-
|
|
1149
|
+
d(this, nt, /* @__PURE__ */ h(() => {
|
|
1150
|
+
const n = t(this, _).shadowRoot.querySelector("nine-table-sheets");
|
|
1151
|
+
n == null || n.classList.toggle("nodata", this.length === 0), t(this, _).shadowRoot.querySelectorAll("nine-table-sheet").forEach((e) => {
|
|
1152
|
+
e.invalidate();
|
|
1143
1153
|
});
|
|
1144
1154
|
}, "#invalidate"));
|
|
1145
|
-
|
|
1146
|
-
var
|
|
1155
|
+
A(this, "get", /* @__PURE__ */ h((n, e) => {
|
|
1156
|
+
var r;
|
|
1147
1157
|
const s = this.getValidData();
|
|
1148
1158
|
if (!s || s.length <= 0) return;
|
|
1149
|
-
if (
|
|
1150
|
-
if (
|
|
1151
|
-
const
|
|
1159
|
+
if (n == null) return t(this, ft).call(this, s);
|
|
1160
|
+
if (n < 0 || n >= s.length) return null;
|
|
1161
|
+
const i = typeof ((r = t(this, _).fields) == null ? void 0 : r.get) == "function" ? t(this, _).fields.get() : [];
|
|
1152
1162
|
if (e != null) {
|
|
1153
|
-
const o =
|
|
1154
|
-
return o >= 0 ? s[
|
|
1163
|
+
const o = i.indexOf(e);
|
|
1164
|
+
return o >= 0 ? s[n].v[o] : null;
|
|
1155
1165
|
}
|
|
1156
|
-
return t(this,
|
|
1166
|
+
return t(this, ft).call(this, s[n]);
|
|
1157
1167
|
}, "get"));
|
|
1158
|
-
|
|
1159
|
-
this.clear(), this.add(
|
|
1168
|
+
A(this, "set", /* @__PURE__ */ h((n) => {
|
|
1169
|
+
this.clear(), this.add(n, !1), t(this, nt).call(this);
|
|
1160
1170
|
}, "set"));
|
|
1161
|
-
d(this,
|
|
1162
|
-
rowState:
|
|
1171
|
+
d(this, Ct, /* @__PURE__ */ h(() => ({
|
|
1172
|
+
rowState: O.ROW_STATE.EMPTY,
|
|
1163
1173
|
deleted: !1,
|
|
1164
1174
|
filtered: !1,
|
|
1165
|
-
height: t(this,
|
|
1175
|
+
height: t(this, Y).slice(),
|
|
1166
1176
|
o: {},
|
|
1167
1177
|
c: {},
|
|
1168
|
-
_: [0, 0, 0, 0,
|
|
1178
|
+
_: [0, 0, 0, 0, O.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Y).slice(), -1, {}, {}]
|
|
1169
1179
|
}), "#getDefaultMeta"));
|
|
1170
|
-
|
|
1171
|
-
p(this,
|
|
1180
|
+
A(this, "reset", /* @__PURE__ */ h(() => {
|
|
1181
|
+
p(this, N, []), p(this, dt, []), t(this, nt).call(this);
|
|
1172
1182
|
}, "reset"));
|
|
1173
|
-
|
|
1174
|
-
var
|
|
1175
|
-
t(this, k).rawRecords = [], p(this,
|
|
1183
|
+
A(this, "clear", /* @__PURE__ */ h(() => {
|
|
1184
|
+
var n;
|
|
1185
|
+
t(this, k).rawRecords = [], p(this, N, []), p(this, dt, []), (n = t(this, k).viewRecords) != null && n.reset && t(this, k).viewRecords.reset();
|
|
1176
1186
|
}, "clear"));
|
|
1177
|
-
d(this,
|
|
1178
|
-
var
|
|
1179
|
-
Array.isArray(
|
|
1180
|
-
const e = typeof ((
|
|
1181
|
-
return
|
|
1187
|
+
d(this, te, /* @__PURE__ */ h((n) => {
|
|
1188
|
+
var i;
|
|
1189
|
+
Array.isArray(n) || (n = [n]);
|
|
1190
|
+
const e = typeof ((i = t(this, _).fields) == null ? void 0 : i.get) == "function" ? t(this, _).fields.get() : Object.keys(n[0] || {}), s = [];
|
|
1191
|
+
return n.forEach((r) => {
|
|
1182
1192
|
const o = { v: [] };
|
|
1183
1193
|
e.forEach((a) => {
|
|
1184
|
-
o.v.push(
|
|
1194
|
+
o.v.push(r[a] !== void 0 && r[a] !== null ? r[a] : "");
|
|
1185
1195
|
}), s.push(o);
|
|
1186
1196
|
}), s;
|
|
1187
1197
|
}, "#json2Array"));
|
|
1188
|
-
d(this,
|
|
1189
|
-
e.__ng = t(this,
|
|
1190
|
-
}),
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
const s = t(this,
|
|
1194
|
-
t(this, k).rawRecords = t(this, k).rawRecords.concat(t(this,
|
|
1195
|
-
const
|
|
1196
|
-
return e || s.forEach((
|
|
1197
|
-
const a = t(this, k).rawRecords[
|
|
1198
|
-
a && (a.__ng.rowState =
|
|
1199
|
-
}), t(this,
|
|
1198
|
+
d(this, ee, /* @__PURE__ */ h((n) => (Array.isArray(n) || (n = [n]), n.forEach((e) => {
|
|
1199
|
+
e.__ng = t(this, Ct).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = O.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1200
|
+
}), n), "#defaultInsert"));
|
|
1201
|
+
A(this, "add", /* @__PURE__ */ h((n, e = !0) => {
|
|
1202
|
+
n === void 0 && (n = {});
|
|
1203
|
+
const s = t(this, te).call(this, n);
|
|
1204
|
+
t(this, k).rawRecords = t(this, k).rawRecords.concat(t(this, ee).call(this, s)), this.resetRecords();
|
|
1205
|
+
const i = this.count() - 1;
|
|
1206
|
+
return e || s.forEach((r, o) => {
|
|
1207
|
+
const a = t(this, k).rawRecords[i - o];
|
|
1208
|
+
a && (a.__ng.rowState = O.ROW_STATE.EMPTY);
|
|
1209
|
+
}), t(this, nt).call(this), i;
|
|
1200
1210
|
}, "add"));
|
|
1201
|
-
|
|
1211
|
+
A(this, "delete", /* @__PURE__ */ h((n) => {
|
|
1202
1212
|
let e = [];
|
|
1203
|
-
Array.isArray(
|
|
1204
|
-
if (t(this,
|
|
1205
|
-
const
|
|
1206
|
-
t(this,
|
|
1207
|
-
|
|
1213
|
+
Array.isArray(n) ? e = n : typeof n > "u" ? e = [t(this, k).host.row.at] : e = [parseInt(n, 10)], e.sort((s, i) => i - s).forEach((s) => {
|
|
1214
|
+
if (t(this, N)[s]) {
|
|
1215
|
+
const i = t(this, N)[s].__ng.rowid;
|
|
1216
|
+
t(this, N)[s].__ng.rowState === O.ROW_STATE.INSERT ? t(this, k).rawRecords = t(this, k).rawRecords.filter((r) => r.__ng.rowid !== i) : t(this, k).rawRecords.forEach((r) => {
|
|
1217
|
+
r.__ng.rowid === i && (r.__ng.deleted = !0, r.__ng.rowState = O.ROW_STATE.DELETE);
|
|
1208
1218
|
});
|
|
1209
1219
|
}
|
|
1210
|
-
}), this.resetRecords(), t(this,
|
|
1220
|
+
}), this.resetRecords(), t(this, nt).call(this);
|
|
1211
1221
|
}, "delete"));
|
|
1212
|
-
|
|
1222
|
+
A(this, "setValue", /* @__PURE__ */ h((n, e, s) => {
|
|
1213
1223
|
var c;
|
|
1214
|
-
|
|
1215
|
-
const
|
|
1216
|
-
if (
|
|
1217
|
-
const o = this.getValidData()[
|
|
1224
|
+
n = parseInt(n, 10);
|
|
1225
|
+
const r = (typeof ((c = t(this, _).fields) == null ? void 0 : c.get) == "function" ? t(this, _).fields.get() : []).indexOf(e);
|
|
1226
|
+
if (r < 0) return;
|
|
1227
|
+
const o = this.getValidData()[n];
|
|
1218
1228
|
if (!o) return;
|
|
1219
|
-
const a = o.v[
|
|
1220
|
-
a !== s && o.__ng.rowState !==
|
|
1229
|
+
const a = o.v[r];
|
|
1230
|
+
a !== s && o.__ng.rowState !== O.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = a), o.__ng.rowState = O.ROW_STATE.UPDATE), o.v[r] = s;
|
|
1221
1231
|
}, "setValue"));
|
|
1222
|
-
|
|
1223
|
-
p(this,
|
|
1224
|
-
|
|
1225
|
-
}), t(this,
|
|
1226
|
-
|
|
1232
|
+
A(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1233
|
+
p(this, dt, t(this, k).rawRecords.filter((n) => !n.__ng.deleted)), p(this, N, t(this, k).rawRecords.filter((n) => !n.__ng.deleted && !n.__ng.filtered)), t(this, k).rawRecords.forEach((n, e) => {
|
|
1234
|
+
n.__ng.rowidx = e;
|
|
1235
|
+
}), t(this, N).forEach((n, e) => {
|
|
1236
|
+
n.__ng.i = e;
|
|
1227
1237
|
});
|
|
1228
1238
|
}, "resetRecords"));
|
|
1229
|
-
|
|
1230
|
-
d(this,
|
|
1239
|
+
A(this, "getValidData", /* @__PURE__ */ h(() => (t(this, N).length === 0 && t(this, k).rawRecords.length > 0 && this.resetRecords(), t(this, N)), "getValidData"));
|
|
1240
|
+
d(this, ft, /* @__PURE__ */ h((n) => {
|
|
1231
1241
|
var o;
|
|
1232
|
-
if (!
|
|
1233
|
-
const e = !Array.isArray(
|
|
1242
|
+
if (!n) return n;
|
|
1243
|
+
const e = !Array.isArray(n), s = e ? [n] : n, i = typeof ((o = t(this, _).fields) == null ? void 0 : o.get) == "function" ? t(this, _).fields.get() : [], r = s.filter((a) => !a.__ng.deleted).map((a) => {
|
|
1234
1244
|
const c = {};
|
|
1235
|
-
return
|
|
1245
|
+
return i.forEach((l, f) => {
|
|
1236
1246
|
c[l] = a.v ? a.v[f] : a[l];
|
|
1237
1247
|
}), c.__ng = a.__ng, c;
|
|
1238
1248
|
});
|
|
1239
|
-
return e ?
|
|
1249
|
+
return e ? r[0] : r;
|
|
1240
1250
|
}, "#conv"));
|
|
1241
|
-
|
|
1242
|
-
p(this,
|
|
1251
|
+
A(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1252
|
+
p(this, _, n), p(this, k, e), t(this, Qt).call(this);
|
|
1243
1253
|
}
|
|
1244
1254
|
get source() {
|
|
1245
|
-
return t(this,
|
|
1255
|
+
return t(this, ft).call(this, t(this, k).rawRecords);
|
|
1246
1256
|
}
|
|
1247
|
-
set source(
|
|
1248
|
-
this.clear(), this.add(
|
|
1257
|
+
set source(n) {
|
|
1258
|
+
this.clear(), this.add(n, !1);
|
|
1249
1259
|
}
|
|
1250
1260
|
get nextId() {
|
|
1251
|
-
return ++
|
|
1261
|
+
return ++Ue(this, Jt)._;
|
|
1252
1262
|
}
|
|
1253
1263
|
get count() {
|
|
1254
|
-
return t(this,
|
|
1264
|
+
return t(this, N).length;
|
|
1255
1265
|
}
|
|
1256
1266
|
get length() {
|
|
1257
|
-
return t(this,
|
|
1267
|
+
return t(this, N).length;
|
|
1258
1268
|
}
|
|
1259
1269
|
getRowCount() {
|
|
1260
1270
|
return this.length;
|
|
1261
1271
|
}
|
|
1262
1272
|
};
|
|
1263
|
-
|
|
1264
|
-
|
|
1273
|
+
_ = new WeakMap(), k = new WeakMap(), N = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), Y = new WeakMap(), Qt = new WeakMap(), nt = new WeakMap(), Ct = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), ft = new WeakMap(), h(O, "ngData"), // 🎯 행 상태 정의 상수를 클래스 내부로 내재화
|
|
1274
|
+
A(O, "ROW_STATE", {
|
|
1265
1275
|
EMPTY: "EMPTY",
|
|
1266
1276
|
NORMAL: "NORMAL",
|
|
1267
1277
|
INSERT: "INSERT",
|
|
1268
1278
|
UPDATE: "UPDATE",
|
|
1269
1279
|
DELETE: "DELETE"
|
|
1270
1280
|
});
|
|
1271
|
-
let
|
|
1272
|
-
var
|
|
1273
|
-
const
|
|
1274
|
-
constructor(
|
|
1275
|
-
d(this,
|
|
1276
|
-
p(this,
|
|
1281
|
+
let ge = O;
|
|
1282
|
+
var it;
|
|
1283
|
+
const Oe = class Oe {
|
|
1284
|
+
constructor(n) {
|
|
1285
|
+
d(this, it);
|
|
1286
|
+
p(this, it, n), this.row = new ue(this), this.data = new ge(t(this, it), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1277
1287
|
var e;
|
|
1278
|
-
(e = t(this,
|
|
1288
|
+
(e = t(this, it).view) != null && e.redraw && t(this, it).view.redraw();
|
|
1279
1289
|
}, this.setDataSource = (e) => {
|
|
1280
1290
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1281
1291
|
}, this.getRowState = (e) => {
|
|
1282
|
-
var
|
|
1292
|
+
var i, r;
|
|
1283
1293
|
const s = parseInt(e, 10);
|
|
1284
1294
|
if (!(s >= this.data.count()))
|
|
1285
|
-
return (
|
|
1295
|
+
return (r = (i = this.data.getValidData()[s]) == null ? void 0 : i.__ng) == null ? void 0 : r.rowState;
|
|
1286
1296
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1287
1297
|
this.row.at = e;
|
|
1288
|
-
}, this.scrollTo_V1 = (e) => (e < 0 && (e = 0), e >= this.rawRecords.length && (e = this.rawRecords.length - 1), this.viewRecords.rawIndex = e, this.viewRecords.reset && this.viewRecords.reset(), !(e <= 0 || e >= this.rawRecords.length - 1)), this.getColumn = (e, s) => this.data.get(e, s), this.setColumn = (e, s,
|
|
1289
|
-
e = parseInt(e, 10), this.data.setValue(e, s,
|
|
1298
|
+
}, this.scrollTo_V1 = (e) => (e < 0 && (e = 0), e >= this.rawRecords.length && (e = this.rawRecords.length - 1), this.viewRecords.rawIndex = e, this.viewRecords.reset && this.viewRecords.reset(), !(e <= 0 || e >= this.rawRecords.length - 1)), this.getColumn = (e, s) => this.data.get(e, s), this.setColumn = (e, s, i) => {
|
|
1299
|
+
e = parseInt(e, 10), this.data.setValue(e, s, i);
|
|
1290
1300
|
}, this.setDataSource([]);
|
|
1291
1301
|
}
|
|
1292
1302
|
};
|
|
1293
|
-
|
|
1294
|
-
let
|
|
1295
|
-
var
|
|
1296
|
-
const
|
|
1303
|
+
it = new WeakMap(), h(Oe, "ngDataManager");
|
|
1304
|
+
let be = Oe;
|
|
1305
|
+
var ut, L, Lt, se;
|
|
1306
|
+
const Be = class Be {
|
|
1297
1307
|
// 🎯 이제 { name: string, type: string } 객체들의 배열로 관리합니다.
|
|
1298
|
-
constructor(
|
|
1299
|
-
d(this,
|
|
1308
|
+
constructor(n) {
|
|
1309
|
+
d(this, ut);
|
|
1300
1310
|
d(this, L, []);
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
t(this, L).some((
|
|
1304
|
-
}), t(this,
|
|
1311
|
+
A(this, "add", /* @__PURE__ */ h((n, e = "string") => {
|
|
1312
|
+
n.forEach((s) => {
|
|
1313
|
+
t(this, L).some((i) => i.name === s) || t(this, L).push({ name: s, type: e });
|
|
1314
|
+
}), t(this, Lt).call(this);
|
|
1305
1315
|
}, "add"));
|
|
1306
|
-
d(this,
|
|
1307
|
-
const
|
|
1316
|
+
d(this, Lt, /* @__PURE__ */ h(() => {
|
|
1317
|
+
const n = /* @__PURE__ */ new Map();
|
|
1308
1318
|
t(this, L).forEach((e) => {
|
|
1309
|
-
|
|
1310
|
-
}), p(this, L, Array.from(
|
|
1319
|
+
n.set(e.name, e.type);
|
|
1320
|
+
}), p(this, L, Array.from(n, ([e, s]) => ({ name: e, type: s }))), p(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);
|
|
1311
1321
|
}, "#adjust"));
|
|
1312
|
-
d(this,
|
|
1313
|
-
p(this, L, []),
|
|
1314
|
-
const
|
|
1315
|
-
if (!(!
|
|
1316
|
-
for (const e of
|
|
1317
|
-
|
|
1318
|
-
const
|
|
1319
|
-
|
|
1322
|
+
d(this, se, /* @__PURE__ */ h(() => {
|
|
1323
|
+
p(this, L, []), W.log(t(this, ut).querySelectorAll("table"));
|
|
1324
|
+
const n = Array.from(t(this, ut).querySelectorAll("table"));
|
|
1325
|
+
if (!(!n || n.length === 0)) {
|
|
1326
|
+
for (const e of n)
|
|
1327
|
+
W.log(e), $("[data-bind]", e).each((s, i) => {
|
|
1328
|
+
const r = i.dataset.bind, o = i.getAttribute("data-type") || "string";
|
|
1329
|
+
r && t(this, L).push({ name: r, type: o });
|
|
1320
1330
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
1321
|
-
$(`[${s}]`, e).each((
|
|
1322
|
-
var o =
|
|
1331
|
+
$(`[${s}]`, e).each((i, r) => {
|
|
1332
|
+
var o = r.getAttribute(s);
|
|
1323
1333
|
if (o.indexOf("data.") < 0) {
|
|
1324
1334
|
const a = o.search(/[(]/g);
|
|
1325
1335
|
if (a > 0)
|
|
@@ -1338,68 +1348,68 @@ const ze = class ze {
|
|
|
1338
1348
|
});
|
|
1339
1349
|
});
|
|
1340
1350
|
});
|
|
1341
|
-
t(this,
|
|
1351
|
+
t(this, Lt).call(this);
|
|
1342
1352
|
}
|
|
1343
1353
|
}, "#init"));
|
|
1344
|
-
p(this,
|
|
1354
|
+
p(this, ut, n), t(this, se).call(this);
|
|
1345
1355
|
}
|
|
1346
1356
|
// 🎯 기존에 필드 이름만 쓰던 곳들과의 호환을 위해 이름 배열만 리턴하는 메서드 유지
|
|
1347
1357
|
get() {
|
|
1348
|
-
return t(this, L).map((
|
|
1358
|
+
return t(this, L).map((n) => n.name);
|
|
1349
1359
|
}
|
|
1350
1360
|
// 🎯 내부 객체 통째로 얻기
|
|
1351
1361
|
getFields() {
|
|
1352
1362
|
return t(this, L);
|
|
1353
1363
|
}
|
|
1354
1364
|
// 🎯 특정 필드의 데이터 타입 조회
|
|
1355
|
-
getType(
|
|
1356
|
-
const e = t(this, L).find((s) => s.name ===
|
|
1365
|
+
getType(n) {
|
|
1366
|
+
const e = t(this, L).find((s) => s.name === n);
|
|
1357
1367
|
return e ? e.type : "string";
|
|
1358
1368
|
}
|
|
1359
|
-
indexOf(
|
|
1360
|
-
return t(this, L).findIndex((e) => e.name ===
|
|
1369
|
+
indexOf(n) {
|
|
1370
|
+
return t(this, L).findIndex((e) => e.name === n);
|
|
1361
1371
|
}
|
|
1362
|
-
includes(
|
|
1363
|
-
return t(this, L).some((e) => e.name ===
|
|
1372
|
+
includes(n) {
|
|
1373
|
+
return t(this, L).some((e) => e.name === n);
|
|
1364
1374
|
}
|
|
1365
1375
|
};
|
|
1366
|
-
|
|
1367
|
-
let
|
|
1368
|
-
var
|
|
1369
|
-
const
|
|
1376
|
+
ut = new WeakMap(), L = new WeakMap(), Lt = new WeakMap(), se = new WeakMap(), h(Be, "ngFields");
|
|
1377
|
+
let pe = Be;
|
|
1378
|
+
var rt, ne, ie;
|
|
1379
|
+
const ze = class ze extends HTMLElement {
|
|
1370
1380
|
constructor() {
|
|
1371
1381
|
super();
|
|
1372
1382
|
//#created = false;
|
|
1373
|
-
d(this,
|
|
1374
|
-
d(this,
|
|
1375
|
-
d(this,
|
|
1376
|
-
this.fields = new
|
|
1383
|
+
d(this, rt);
|
|
1384
|
+
d(this, ne);
|
|
1385
|
+
d(this, ie, /* @__PURE__ */ h(() => {
|
|
1386
|
+
this.fields = new pe(this), p(this, ne, new fe(this)), W.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1377
1387
|
}, "#init"));
|
|
1378
|
-
this.attachShadow({ mode: "open" }), p(this,
|
|
1388
|
+
this.attachShadow({ mode: "open" }), p(this, rt, new be(this));
|
|
1379
1389
|
}
|
|
1380
1390
|
connectedCallback() {
|
|
1381
|
-
t(this,
|
|
1391
|
+
t(this, ie).call(this);
|
|
1382
1392
|
}
|
|
1383
1393
|
disconnectedCallback() {
|
|
1384
|
-
|
|
1394
|
+
W.log("NineTable disconnected.");
|
|
1385
1395
|
}
|
|
1386
1396
|
// 🎯 외부에서 grid.data.set(...) 형태로 접근할 수 있도록 데이터 매니저 오픈
|
|
1387
1397
|
get data() {
|
|
1388
|
-
return t(this,
|
|
1398
|
+
return t(this, rt).data;
|
|
1389
1399
|
}
|
|
1390
1400
|
// 🎯 행(row) 관련 제어 접근자 오픈
|
|
1391
1401
|
get row() {
|
|
1392
|
-
return t(this,
|
|
1402
|
+
return t(this, rt).row;
|
|
1393
1403
|
}
|
|
1394
1404
|
// 🎯 전체 데이터 매니저 접근 필요할 경우
|
|
1395
1405
|
get dataManager() {
|
|
1396
|
-
return t(this,
|
|
1406
|
+
return t(this, rt);
|
|
1397
1407
|
}
|
|
1398
1408
|
};
|
|
1399
|
-
|
|
1400
|
-
let
|
|
1401
|
-
customElements.get("nine-table") || customElements.define("nine-table",
|
|
1402
|
-
const
|
|
1409
|
+
rt = new WeakMap(), ne = new WeakMap(), ie = new WeakMap(), h(ze, "NineTable");
|
|
1410
|
+
let ye = ze;
|
|
1411
|
+
customElements.get("nine-table") || customElements.define("nine-table", ye);
|
|
1412
|
+
const mt = class mt extends HTMLElement {
|
|
1403
1413
|
// 👈 커스텀 스타일용 캐시 추가
|
|
1404
1414
|
constructor() {
|
|
1405
1415
|
super();
|
|
@@ -1410,29 +1420,29 @@ const vt = class vt extends HTMLElement {
|
|
|
1410
1420
|
connectedCallback() {
|
|
1411
1421
|
}
|
|
1412
1422
|
};
|
|
1413
|
-
h(
|
|
1414
|
-
let
|
|
1415
|
-
var C,
|
|
1416
|
-
const De = class De extends
|
|
1423
|
+
h(mt, "BasicCellElement"), A(mt, "_styleCache", /* @__PURE__ */ new Map()), A(mt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1424
|
+
let me = mt;
|
|
1425
|
+
var C, Ht, y, Re, qe, Te, ke, Ce;
|
|
1426
|
+
const De = class De extends me {
|
|
1417
1427
|
constructor() {
|
|
1418
1428
|
super();
|
|
1419
1429
|
d(this, C);
|
|
1420
|
-
d(this,
|
|
1430
|
+
d(this, Ht);
|
|
1421
1431
|
d(this, y);
|
|
1432
|
+
d(this, Re);
|
|
1422
1433
|
d(this, qe);
|
|
1423
1434
|
d(this, Te);
|
|
1424
1435
|
d(this, ke);
|
|
1425
|
-
|
|
1426
|
-
E(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1436
|
+
A(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1427
1437
|
if (t(this, y))
|
|
1428
1438
|
if (t(this, y).closest("tbody")) {
|
|
1429
|
-
const s = t(this, y).closest("tr").data,
|
|
1439
|
+
const s = t(this, y).closest("tr").data, i = parseInt(t(this, y).dataset.row);
|
|
1430
1440
|
if (!s) return "";
|
|
1431
1441
|
if (ninegrid.isNull(t(this, y).dataset.expr)) {
|
|
1432
1442
|
if (!ninegrid.isNull(t(this, y).dataset.bind))
|
|
1433
1443
|
return s[t(this, y).dataset.bind] || ninegrid.nvl(e, "");
|
|
1434
1444
|
} else try {
|
|
1435
|
-
return this.getExprValue(t(this, y).dataset.expr, s,
|
|
1445
|
+
return this.getExprValue(t(this, y).dataset.expr, s, i, t(this, y));
|
|
1436
1446
|
} catch {
|
|
1437
1447
|
console.error(t(this, y).dataset.expr, s, t(this, y).dataset.row);
|
|
1438
1448
|
}
|
|
@@ -1443,41 +1453,41 @@ const De = class De extends xe {
|
|
|
1443
1453
|
} catch {
|
|
1444
1454
|
}
|
|
1445
1455
|
}, "getDisplayText"));
|
|
1446
|
-
d(this,
|
|
1456
|
+
d(this, Ce, /* @__PURE__ */ h(() => {
|
|
1447
1457
|
if (!(!t(this, C) || !t(this, C).template || !t(this, y).closest("tbody.bindable"))) {
|
|
1448
1458
|
var e = ninegrid.j.querySelectorAll(t(this, y)).attr("suppress");
|
|
1449
1459
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1450
|
-
var s = t(this, y).closest("tr"),
|
|
1451
|
-
$("th,td", s).each((x,
|
|
1452
|
-
var T = ninegrid.j.querySelectorAll(
|
|
1453
|
-
T &&
|
|
1454
|
-
}),
|
|
1455
|
-
var
|
|
1460
|
+
var s = t(this, y).closest("tr"), i = [];
|
|
1461
|
+
$("th,td", s).each((x, M) => {
|
|
1462
|
+
var T = ninegrid.j.querySelectorAll(M).attr("suppress");
|
|
1463
|
+
T && M.dataset.row && (T = parseInt(T), !isNaN(T) && T <= e && i.push(T));
|
|
1464
|
+
}), i.sort();
|
|
1465
|
+
var r = !1;
|
|
1456
1466
|
if (parseInt(s.sectionRowIndex / t(this, C).template.length) > 0)
|
|
1457
|
-
for (var o of
|
|
1467
|
+
for (var o of i) {
|
|
1458
1468
|
if (o > e) break;
|
|
1459
1469
|
var a = parseInt(t(this, y).dataset.row), c = a - 1, l = t(this, y).closest("tr").data, f = t(this, C).data.get(c);
|
|
1460
1470
|
t(this, y).dataset.matrixRow;
|
|
1461
1471
|
var u = t(this, C).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, y).dataset.matrixRow}"]`), g = u.dataset.expr ? this.getExprValue(u.dataset.expr, l, a) : l[u.dataset.bind], b = u.dataset.expr ? this.getExprValue(u.dataset.expr, f, c) : f[u.dataset.bind];
|
|
1462
1472
|
if (g != b) {
|
|
1463
|
-
|
|
1473
|
+
r = !0;
|
|
1464
1474
|
break;
|
|
1465
1475
|
}
|
|
1466
1476
|
}
|
|
1467
1477
|
else
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
var m = parseInt(t(this, y).dataset.matrixRow), v = m - 1,
|
|
1471
|
-
$(
|
|
1478
|
+
r = !0;
|
|
1479
|
+
r ? ninegrid.j.querySelectorAll(t(this, y)).removeClass("suppress") : ninegrid.j.querySelectorAll(t(this, y)).addClass("suppress"), ninegrid.j.querySelectorAll(t(this, y)).hasClass("hidden") || (r ? ninegrid.j.querySelectorAll(t(this, y)).removeClass("hidden") : ninegrid.j.querySelectorAll(t(this, y)).addClass("hidden"));
|
|
1480
|
+
var m = parseInt(t(this, y).dataset.matrixRow), v = m - 1, E = t(this, C).body.querySelector(`tbody.bindable [data-col="${t(this, y).dataset.col}"][data-matrix-row="${v}"]`);
|
|
1481
|
+
$(E).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this, y)).hasClass("suppress") ? ninegrid.j.querySelectorAll(E).removeClass("last-none-suppress").addClass("last-suppress") : !$(E).hasClass("suppress") && ninegrid.j.querySelectorAll(t(this, y)).hasClass("suppress") ? ninegrid.j.querySelectorAll(E).removeClass("last-suppress").addClass("last-none-suppress") : ninegrid.j.querySelectorAll(E).removeClass("last-none-suppress").removeClass("last-suppress");
|
|
1472
1482
|
}
|
|
1473
1483
|
}
|
|
1474
1484
|
}, "#resetSuppress"));
|
|
1475
|
-
|
|
1485
|
+
A(this, "getExprValue", /* @__PURE__ */ h((e, s, i, r) => {
|
|
1476
1486
|
if (typeof e < "u")
|
|
1477
1487
|
try {
|
|
1478
|
-
|
|
1488
|
+
i = parseInt(i);
|
|
1479
1489
|
const o = e.replace("()", "");
|
|
1480
|
-
return t(this, C)[o] ? t(this, C)[o].call(this, s,
|
|
1490
|
+
return t(this, C)[o] ? t(this, C)[o].call(this, s, i, t(this, y)) : t(this, C).exprFunction(e).call(this, s, i, t(this, C).data);
|
|
1481
1491
|
} catch {
|
|
1482
1492
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1483
1493
|
}
|
|
@@ -1486,7 +1496,7 @@ const De = class De extends xe {
|
|
|
1486
1496
|
}, "getExprValue"));
|
|
1487
1497
|
}
|
|
1488
1498
|
connectedCallback() {
|
|
1489
|
-
super.connectedCallback(), p(this, C, this.getRootNode().host), p(this, y, this.closest("th,td")), p(this,
|
|
1499
|
+
super.connectedCallback(), p(this, C, this.getRootNode().host), p(this, y, this.closest("th,td")), p(this, Ht, t(this, y).closest("tr"));
|
|
1490
1500
|
}
|
|
1491
1501
|
get value() {
|
|
1492
1502
|
var e = !t(this, C) || !t(this, C).dataManager || !t(this, y) || !t(this, y).dataset || !t(this, y).dataset.row || !t(this, y).dataset.bind ? "" : t(this, y).closest("tr").data[t(this, y).dataset.bind];
|
|
@@ -1494,8 +1504,8 @@ const De = class De extends xe {
|
|
|
1494
1504
|
}
|
|
1495
1505
|
set value(e) {
|
|
1496
1506
|
var s = parseInt(t(this, y).dataset.row);
|
|
1497
|
-
const
|
|
1498
|
-
s < 0 ? t(this, C).data.setValueNF(parseInt(t(this, y).dataset.index), t(this, y).dataset.bind, e,
|
|
1507
|
+
const i = this.getAttribute("update-row-state") != "false";
|
|
1508
|
+
s < 0 ? t(this, C).data.setValueNF(parseInt(t(this, y).dataset.index), t(this, y).dataset.bind, e, i) : t(this, C).data.setValue(s, t(this, y).dataset.bind, e, i);
|
|
1499
1509
|
}
|
|
1500
1510
|
get row() {
|
|
1501
1511
|
return parseInt(t(this, y).dataset.row);
|
|
@@ -1505,12 +1515,12 @@ const De = class De extends xe {
|
|
|
1505
1515
|
}
|
|
1506
1516
|
refresh() {
|
|
1507
1517
|
const e = t(this, y).dataset.bind;
|
|
1508
|
-
return parseInt(t(this, y).dataset.row), t(this,
|
|
1518
|
+
return parseInt(t(this, y).dataset.row), t(this, Ht).data[e];
|
|
1509
1519
|
}
|
|
1510
1520
|
};
|
|
1511
|
-
C = new WeakMap(),
|
|
1512
|
-
let
|
|
1513
|
-
const
|
|
1521
|
+
C = new WeakMap(), Ht = new WeakMap(), y = new WeakMap(), Re = new WeakMap(), qe = new WeakMap(), Te = new WeakMap(), ke = new WeakMap(), Ce = new WeakMap(), h(De, "CellElement");
|
|
1522
|
+
let xe = De;
|
|
1523
|
+
const Pe = class Pe extends xe {
|
|
1514
1524
|
constructor() {
|
|
1515
1525
|
super();
|
|
1516
1526
|
}
|
|
@@ -1521,21 +1531,21 @@ const je = class je extends ve {
|
|
|
1521
1531
|
return super.refresh();
|
|
1522
1532
|
}
|
|
1523
1533
|
};
|
|
1524
|
-
h(
|
|
1525
|
-
let
|
|
1526
|
-
var
|
|
1527
|
-
const
|
|
1534
|
+
h(Pe, "EditableCellElement");
|
|
1535
|
+
let ve = Pe;
|
|
1536
|
+
var Mt, ot, gt, bt, re, U, Le;
|
|
1537
|
+
const je = class je extends ve {
|
|
1528
1538
|
constructor() {
|
|
1529
1539
|
super();
|
|
1530
|
-
d(this,
|
|
1531
|
-
d(this,
|
|
1532
|
-
d(this,
|
|
1533
|
-
d(this,
|
|
1534
|
-
d(this,
|
|
1535
|
-
d(this,
|
|
1536
|
-
|
|
1540
|
+
d(this, Mt);
|
|
1541
|
+
d(this, ot);
|
|
1542
|
+
d(this, gt);
|
|
1543
|
+
d(this, bt);
|
|
1544
|
+
d(this, re);
|
|
1545
|
+
d(this, U);
|
|
1546
|
+
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
1537
1547
|
const e = super.refresh();
|
|
1538
|
-
t(this,
|
|
1548
|
+
t(this, Mt).value = e;
|
|
1539
1549
|
}, "refresh"));
|
|
1540
1550
|
/**
|
|
1541
1551
|
dataRefresh = (v) => {
|
|
@@ -1567,22 +1577,22 @@ const Fe = class Fe extends we {
|
|
|
1567
1577
|
if (!v) this.reset();
|
|
1568
1578
|
};
|
|
1569
1579
|
*/
|
|
1570
|
-
d(this,
|
|
1580
|
+
d(this, Le, /* @__PURE__ */ h((e) => {
|
|
1571
1581
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1572
|
-
if (t(this,
|
|
1573
|
-
let
|
|
1574
|
-
if (t(this,
|
|
1575
|
-
var s = e.target.value,
|
|
1576
|
-
if (
|
|
1577
|
-
var s = s.substr(
|
|
1578
|
-
s.length >= Number(t(this,
|
|
1582
|
+
if (t(this, ot) == "number") {
|
|
1583
|
+
let r = [];
|
|
1584
|
+
if (t(this, U) && Number(t(this, U)) > 0 && r.push("."), t(this, bt) && Number(t(this, bt)) >= 0 && r.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !r.includes(e.key) && e.preventDefault(), t(this, U) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
|
|
1585
|
+
var s = e.target.value, i = s.indexOf(".");
|
|
1586
|
+
if (i >= 0) {
|
|
1587
|
+
var s = s.substr(i + 1, s.length);
|
|
1588
|
+
s.length >= Number(t(this, U)) && e.preventDefault();
|
|
1579
1589
|
}
|
|
1580
1590
|
}
|
|
1581
1591
|
}
|
|
1582
|
-
t(this,
|
|
1592
|
+
t(this, gt) && ninegrid.getByteLength(e.target.value) >= Number(t(this, gt)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1583
1593
|
}
|
|
1584
1594
|
}, "#onKeyDown"));
|
|
1585
|
-
if (this.applyBaseStyle(), p(this,
|
|
1595
|
+
if (this.applyBaseStyle(), p(this, ot, this.getAttribute("type") || "text"), p(this, gt, this.getAttribute("maxbyte")), p(this, bt, this.getAttribute("min")), p(this, re, this.getAttribute("max")), p(this, U, this.getAttribute("scale")), !["text", "number"].includes(t(this, ot))) throw `invalid type : ${t(this, ot)}`;
|
|
1586
1596
|
}
|
|
1587
1597
|
connectedCallback() {
|
|
1588
1598
|
for (var e = [], s = 0; s < this.attributes.length; s++)
|
|
@@ -1592,11 +1602,11 @@ const Fe = class Fe extends we {
|
|
|
1592
1602
|
${e.join(" ")}
|
|
1593
1603
|
ondragstart="return false;"
|
|
1594
1604
|
>
|
|
1595
|
-
`, super.connectedCallback(), p(this,
|
|
1605
|
+
`, super.connectedCallback(), p(this, Mt, this.querySelector("input"));
|
|
1596
1606
|
}
|
|
1597
1607
|
};
|
|
1598
|
-
|
|
1599
|
-
let
|
|
1608
|
+
Mt = new WeakMap(), ot = new WeakMap(), gt = new WeakMap(), bt = new WeakMap(), re = new WeakMap(), U = new WeakMap(), Le = new WeakMap(), h(je, "CellInputText");
|
|
1609
|
+
let we = je;
|
|
1600
1610
|
customElements.get("cell-input-text");
|
|
1601
|
-
customElements.get("cell-input") || customElements.define("cell-input",
|
|
1611
|
+
customElements.get("cell-input") || customElements.define("cell-input", we);
|
|
1602
1612
|
//# sourceMappingURL=nine-table.js.map
|