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