@ninebone/table 0.0.450 → 0.0.452
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 +332 -327
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +6 -6
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var Pe = Object.defineProperty;
|
|
2
|
+
var je = (R) => {
|
|
3
3
|
throw TypeError(R);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var c = (R, i) =>
|
|
7
|
-
var
|
|
8
|
-
var t = (R, i, e) => (
|
|
9
|
-
var
|
|
5
|
+
var Ye = (R, i, e) => i in R ? Pe(R, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : R[i] = e;
|
|
6
|
+
var c = (R, i) => Pe(R, "name", { value: i, configurable: !0 });
|
|
7
|
+
var w = (R, i, e) => Ye(R, typeof i != "symbol" ? i + "" : i, e), Fe = (R, i, e) => i.has(R) || je("Cannot " + e);
|
|
8
|
+
var t = (R, i, e) => (Fe(R, i, "read from private field"), e ? e.call(R) : i.get(R)), d = (R, i, e) => i.has(R) ? je("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(R) : i.set(R, e), b = (R, i, e, s) => (Fe(R, i, "write to private field"), s ? s.call(R, e) : i.set(R, e), e);
|
|
9
|
+
var Ve = (R, i, e, s) => ({
|
|
10
10
|
set _(r) {
|
|
11
|
-
|
|
11
|
+
b(R, i, r, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
14
|
return t(R, i, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
import { trace as
|
|
18
|
-
const
|
|
17
|
+
import { trace as Ue } from "@ninebone/util";
|
|
18
|
+
const Ce = class Ce extends Ue.constructor {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
c(
|
|
24
|
-
let
|
|
25
|
-
const
|
|
26
|
-
var B, P,
|
|
27
|
-
const
|
|
23
|
+
c(Ce, "Trace");
|
|
24
|
+
let oe = Ce;
|
|
25
|
+
const U = new oe();
|
|
26
|
+
var B, P, S, X, K, Z, Mt, G, It;
|
|
27
|
+
const Le = class Le extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
d(this, B);
|
|
31
31
|
d(this, P, !1);
|
|
32
|
-
d(this,
|
|
33
|
-
d(this, U);
|
|
32
|
+
d(this, S);
|
|
34
33
|
d(this, X);
|
|
35
34
|
d(this, K);
|
|
36
|
-
d(this,
|
|
35
|
+
d(this, Z);
|
|
36
|
+
d(this, Mt, /* @__PURE__ */ c(() => {
|
|
37
37
|
if (!t(this, B)) return;
|
|
38
38
|
const e = t(this, B).querySelector(".ng-container-body .ng-part-body");
|
|
39
|
-
e && (
|
|
39
|
+
e && (b(this, Z, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
|
-
})), t(this,
|
|
41
|
+
})), t(this, Z).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
|
-
|
|
44
|
-
if (!t(this, B) || !t(this,
|
|
45
|
-
const e = t(this,
|
|
43
|
+
w(this, "refresh", /* @__PURE__ */ c(() => {
|
|
44
|
+
if (!t(this, B) || !t(this, S) || t(this, P)) return;
|
|
45
|
+
const e = t(this, S).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const r = t(this,
|
|
47
|
+
const r = t(this, S).track, n = t(this, S).thumb, o = t(this, B).querySelector(".ng-container-bottom"), a = e.clientWidth, h = s.scrollWidth;
|
|
48
48
|
if (a !== 0 && h > a)
|
|
49
49
|
o && (o.style.display = "flex");
|
|
50
50
|
else {
|
|
@@ -55,64 +55,64 @@ const Ce = class Ce extends HTMLElement {
|
|
|
55
55
|
if (l <= 0) return;
|
|
56
56
|
const f = Math.max(Math.min(l * (a / h), l), 20);
|
|
57
57
|
n.style.width = `${f}px`;
|
|
58
|
-
const u = e.scrollLeft,
|
|
58
|
+
const u = e.scrollLeft, p = h - a;
|
|
59
59
|
let g = 0;
|
|
60
|
-
|
|
60
|
+
p > 0 && (g = parseInt(u / p * (l - f), 10)), g < 0 && (g = 0);
|
|
61
61
|
const m = l - f;
|
|
62
|
-
g > m && (g = m), n.style.left = `${g}px`, t(this,
|
|
62
|
+
g > m && (g = m), n.style.left = `${g}px`, t(this, S).left.disabled = g === 0, t(this, S).right.disabled = g >= m - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
d(this,
|
|
65
|
-
if (!t(this,
|
|
66
|
-
const s = t(this,
|
|
64
|
+
d(this, G, /* @__PURE__ */ c((e) => {
|
|
65
|
+
if (!t(this, S)) return !1;
|
|
66
|
+
const s = t(this, S).container, r = s.querySelector("table");
|
|
67
67
|
if (!r) return !1;
|
|
68
|
-
const n = t(this,
|
|
68
|
+
const n = t(this, S).track.getBoundingClientRect(), o = t(this, S).thumb.clientWidth;
|
|
69
69
|
let a = e;
|
|
70
70
|
a < 0 && (a = 0);
|
|
71
71
|
const h = n.width - o;
|
|
72
|
-
a > h && (a = h), a = parseInt(a, 10), t(this,
|
|
72
|
+
a > h && (a = h), a = parseInt(a, 10), t(this, S).thumb.style.left = `${a}px`, t(this, S).left.disabled = a === 0, t(this, S).right.disabled = a >= h - 1;
|
|
73
73
|
const l = s.clientWidth, u = r.scrollWidth - l;
|
|
74
74
|
return h > 0 && u > 0 && (s.scrollLeft = a / h * u), a > 0 && a < h - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
d(this,
|
|
76
|
+
d(this, It, /* @__PURE__ */ c(() => {
|
|
77
77
|
const e = /* @__PURE__ */ c((r) => {
|
|
78
|
-
clearInterval(t(this,
|
|
79
|
-
const n = parseInt(t(this,
|
|
80
|
-
t(this,
|
|
81
|
-
clearInterval(t(this,
|
|
82
|
-
const o = parseInt(t(this,
|
|
83
|
-
t(this,
|
|
78
|
+
clearInterval(t(this, X)), clearInterval(t(this, K));
|
|
79
|
+
const n = parseInt(t(this, S).thumb.style.left || 0, 10);
|
|
80
|
+
t(this, G).call(this, n + r), b(this, X, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, X)), b(this, K, setInterval(() => {
|
|
82
|
+
const o = parseInt(t(this, S).thumb.style.left || 0, 10);
|
|
83
|
+
t(this, G).call(this, o + r) || clearInterval(t(this, K));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), s = /* @__PURE__ */ c(() => {
|
|
87
|
-
clearInterval(t(this,
|
|
87
|
+
clearInterval(t(this, X)), clearInterval(t(this, K));
|
|
88
88
|
}, "clearTimer");
|
|
89
89
|
["mouseup", "mouseleave", "touchend"].forEach((r) => {
|
|
90
|
-
t(this,
|
|
91
|
-
}), t(this,
|
|
90
|
+
t(this, S).left.addEventListener(r, s), t(this, S).right.addEventListener(r, s), t(this, S).track.addEventListener(r, s);
|
|
91
|
+
}), t(this, S).left.addEventListener("mousedown", (r) => {
|
|
92
92
|
r.button === 0 && e(-20);
|
|
93
|
-
}), t(this,
|
|
93
|
+
}), t(this, S).right.addEventListener("mousedown", (r) => {
|
|
94
94
|
r.button === 0 && e(20);
|
|
95
|
-
}), t(this,
|
|
95
|
+
}), t(this, S).left.addEventListener("touchstart", () => e(-20)), t(this, S).right.addEventListener("touchstart", () => e(20)), t(this, S).track.addEventListener("mousedown", (r) => {
|
|
96
96
|
if (r.button !== 0) return;
|
|
97
97
|
r.preventDefault();
|
|
98
|
-
const n = t(this,
|
|
99
|
-
t(this,
|
|
100
|
-
}), t(this,
|
|
98
|
+
const n = t(this, S).track.getBoundingClientRect(), o = t(this, S).thumb.clientWidth;
|
|
99
|
+
t(this, G).call(this, r.clientX - n.left - o / 2);
|
|
100
|
+
}), t(this, S).thumb.addEventListener("mousedown", (r) => {
|
|
101
101
|
if (r.button !== 0) return;
|
|
102
|
-
r.stopPropagation(), r.preventDefault(),
|
|
102
|
+
r.stopPropagation(), r.preventDefault(), b(this, P, !0), this.shiftX = r.clientX - t(this, S).thumb.getBoundingClientRect().left;
|
|
103
103
|
const n = /* @__PURE__ */ c((a) => {
|
|
104
104
|
if (!t(this, P)) return;
|
|
105
|
-
const h = t(this,
|
|
106
|
-
t(this,
|
|
105
|
+
const h = t(this, S).track.getBoundingClientRect();
|
|
106
|
+
t(this, G).call(this, a.clientX - h.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), o = /* @__PURE__ */ c(() => {
|
|
108
|
-
|
|
108
|
+
b(this, P, !1), s(), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
110
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", o);
|
|
111
111
|
});
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
114
114
|
connectedCallback() {
|
|
115
|
-
if (
|
|
115
|
+
if (b(this, B, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, B)) return;
|
|
116
116
|
this.innerHTML = `
|
|
117
117
|
<style>
|
|
118
118
|
nine-table-hscrollbar {
|
|
@@ -182,7 +182,7 @@ const Ce = class Ce extends HTMLElement {
|
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
|
-
|
|
185
|
+
b(this, S, {
|
|
186
186
|
container: s,
|
|
187
187
|
track: this.querySelector(".ng-scroll-track"),
|
|
188
188
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
@@ -190,28 +190,28 @@ const Ce = class Ce extends HTMLElement {
|
|
|
190
190
|
right: this.querySelector(".ng-scroll-right")
|
|
191
191
|
}), s.addEventListener("scroll", () => {
|
|
192
192
|
t(this, P) || this.refresh();
|
|
193
|
-
}), t(this,
|
|
193
|
+
}), t(this, It).call(this), t(this, Mt).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
|
-
B = new WeakMap(), P = new WeakMap(),
|
|
202
|
-
let
|
|
203
|
-
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar",
|
|
204
|
-
var j, ot,
|
|
205
|
-
const
|
|
201
|
+
B = new WeakMap(), P = new WeakMap(), S = new WeakMap(), X = new WeakMap(), K = new WeakMap(), Z = new WeakMap(), Mt = new WeakMap(), G = new WeakMap(), It = new WeakMap(), c(Le, "NineTableHScrollBar");
|
|
202
|
+
let ae = Le;
|
|
203
|
+
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ae);
|
|
204
|
+
var j, ot, J, q, xt, vt, _t;
|
|
205
|
+
const He = class He extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
208
|
d(this, j);
|
|
209
209
|
d(this, ot);
|
|
210
|
-
d(this,
|
|
210
|
+
d(this, J, !1);
|
|
211
211
|
d(this, q);
|
|
212
212
|
d(this, xt, 0);
|
|
213
213
|
d(this, vt, 0);
|
|
214
|
-
|
|
214
|
+
w(this, "refresh", /* @__PURE__ */ c(() => {
|
|
215
215
|
if (!t(this, j) || !t(this, q)) return;
|
|
216
216
|
const e = t(this, q).container, s = t(this, q).track, r = t(this, q).thumb, n = e.clientHeight, a = (t(this, j).data.get() || []).length, h = t(this, ot).getRowHeight(), l = a * h;
|
|
217
217
|
if (l <= n) {
|
|
@@ -223,42 +223,42 @@ const Le = class Le extends HTMLElement {
|
|
|
223
223
|
if (f <= 0) return;
|
|
224
224
|
const u = Math.max(Math.min(f * (n / l), f), 20);
|
|
225
225
|
r.style.height = `${u}px`;
|
|
226
|
-
const
|
|
226
|
+
const p = e.scrollTop, g = Math.max(l - n, 1);
|
|
227
227
|
let m = 0;
|
|
228
|
-
g > 0 && (m =
|
|
228
|
+
g > 0 && (m = p / g * (f - u));
|
|
229
229
|
const v = f - u;
|
|
230
|
-
m < 0 && (m = 0), m > v && (m = v), r.style.top = `${m}px`, t(this, q).top.disabled =
|
|
230
|
+
m < 0 && (m = 0), m > v && (m = v), r.style.top = `${m}px`, t(this, q).top.disabled = p <= 0, t(this, q).bottom.disabled = p >= g - 1;
|
|
231
231
|
}, "refresh"));
|
|
232
|
-
d(this,
|
|
232
|
+
d(this, _t, /* @__PURE__ */ c(() => {
|
|
233
233
|
const e = t(this, q).container, s = /* @__PURE__ */ c(() => {
|
|
234
234
|
const n = (t(this, j).data.get() || []).length, o = t(this, ot).getRowHeight();
|
|
235
235
|
return n * o;
|
|
236
236
|
}, "getContentHeight");
|
|
237
237
|
e.addEventListener("scroll", () => {
|
|
238
|
-
t(this,
|
|
238
|
+
t(this, J) || this.refresh();
|
|
239
239
|
}), t(this, q).thumb.addEventListener("mousedown", (r) => {
|
|
240
240
|
if (r.button !== 0) return;
|
|
241
|
-
r.stopPropagation(), r.preventDefault(),
|
|
241
|
+
r.stopPropagation(), r.preventDefault(), b(this, J, !0), b(this, xt, r.clientY), b(this, vt, e.scrollTop);
|
|
242
242
|
const n = /* @__PURE__ */ c((a) => {
|
|
243
|
-
if (!t(this,
|
|
244
|
-
const h = t(this, q).track.getBoundingClientRect(), l = t(this, q).thumb.clientHeight, u = h.height - l,
|
|
243
|
+
if (!t(this, J)) return;
|
|
244
|
+
const h = t(this, q).track.getBoundingClientRect(), l = t(this, q).thumb.clientHeight, u = h.height - l, p = a.clientY - t(this, xt), g = e.clientHeight, m = s(), v = Math.max(m - g, 1);
|
|
245
245
|
if (u > 0 && v > 0) {
|
|
246
|
-
const E =
|
|
246
|
+
const E = p / u * v;
|
|
247
247
|
let x = t(this, vt) + E;
|
|
248
248
|
const W = Math.max(0, m - g);
|
|
249
249
|
x < 0 && (x = 0), x > W && (x = W), e.scrollTop = x;
|
|
250
250
|
}
|
|
251
251
|
this.refresh();
|
|
252
252
|
}, "onMouseMove"), o = /* @__PURE__ */ c(() => {
|
|
253
|
-
|
|
253
|
+
b(this, J, !1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), this.refresh();
|
|
254
254
|
}, "onMouseUp");
|
|
255
255
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", o);
|
|
256
256
|
}), t(this, q).track.addEventListener("mousedown", (r) => {
|
|
257
257
|
if (r.button !== 0 || r.target === t(this, q).thumb) return;
|
|
258
|
-
const n = t(this, q).track.getBoundingClientRect(), o = t(this, q).thumb.clientHeight, a = r.clientY - n.top - o / 2, l = n.height - o, f = e.clientHeight, u = s(),
|
|
259
|
-
if (l > 0 &&
|
|
258
|
+
const n = t(this, q).track.getBoundingClientRect(), o = t(this, q).thumb.clientHeight, a = r.clientY - n.top - o / 2, l = n.height - o, f = e.clientHeight, u = s(), p = Math.max(u - f, 1);
|
|
259
|
+
if (l > 0 && p > 0) {
|
|
260
260
|
const g = Math.max(0, Math.min(1, a / l));
|
|
261
|
-
e.scrollTop = g *
|
|
261
|
+
e.scrollTop = g * p;
|
|
262
262
|
}
|
|
263
263
|
this.refresh();
|
|
264
264
|
}), t(this, q).top.addEventListener("click", () => {
|
|
@@ -269,7 +269,7 @@ const Le = class Le extends HTMLElement {
|
|
|
269
269
|
}, "#init"));
|
|
270
270
|
}
|
|
271
271
|
connectedCallback() {
|
|
272
|
-
|
|
272
|
+
b(this, j, this.getRootNode().host), b(this, ot, this.closest("nine-table-sheet")), this.innerHTML = `
|
|
273
273
|
<style>
|
|
274
274
|
nine-table-vscrollbar {
|
|
275
275
|
display: flex;
|
|
@@ -339,39 +339,39 @@ const Le = class Le extends HTMLElement {
|
|
|
339
339
|
setTimeout(e, 10);
|
|
340
340
|
return;
|
|
341
341
|
}
|
|
342
|
-
|
|
342
|
+
b(this, q, {
|
|
343
343
|
container: s,
|
|
344
344
|
track: this.querySelector(".ng-scroll-track"),
|
|
345
345
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
346
346
|
top: this.querySelector(".ng-scroll-top"),
|
|
347
347
|
bottom: this.querySelector(".ng-scroll-bottom")
|
|
348
|
-
}), t(this,
|
|
348
|
+
}), t(this, _t).call(this), this.refresh();
|
|
349
349
|
}, "initWhenReady");
|
|
350
350
|
e();
|
|
351
351
|
}
|
|
352
352
|
};
|
|
353
|
-
j = new WeakMap(), ot = new WeakMap(),
|
|
354
|
-
let
|
|
355
|
-
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar",
|
|
356
|
-
var
|
|
357
|
-
const
|
|
353
|
+
j = new WeakMap(), ot = new WeakMap(), J = new WeakMap(), q = new WeakMap(), xt = new WeakMap(), vt = new WeakMap(), _t = new WeakMap(), c(He, "NineTableVScrollBar");
|
|
354
|
+
let le = He;
|
|
355
|
+
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", le);
|
|
356
|
+
var D, A, z, H, F, Q, wt, at, Nt, Wt, Ot, St, Et, Bt, zt, At, Dt, lt, Rt, Pt;
|
|
357
|
+
const $e = class $e {
|
|
358
358
|
constructor(i) {
|
|
359
|
-
d(this,
|
|
359
|
+
d(this, D);
|
|
360
360
|
d(this, A);
|
|
361
|
-
d(this,
|
|
361
|
+
d(this, z, /* @__PURE__ */ new Map());
|
|
362
362
|
d(this, H, null);
|
|
363
363
|
d(this, F, null);
|
|
364
|
-
d(this,
|
|
364
|
+
d(this, Q, 0);
|
|
365
365
|
d(this, wt, 40);
|
|
366
366
|
d(this, at, !1);
|
|
367
|
-
d(this,
|
|
368
|
-
|
|
367
|
+
d(this, Nt, 3);
|
|
368
|
+
w(this, "refresh", /* @__PURE__ */ c(() => {
|
|
369
369
|
var e;
|
|
370
370
|
const i = t(this, A).querySelector(".ng-container-body .ng-part-body");
|
|
371
371
|
i && (t(this, St).call(this), t(this, lt).call(this, i.scrollTop), (e = t(this, A).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
372
372
|
}, "refresh"));
|
|
373
|
-
|
|
374
|
-
|
|
373
|
+
w(this, "initialize", /* @__PURE__ */ c(() => {
|
|
374
|
+
b(this, H, null), t(this, z).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((r) => {
|
|
375
375
|
const n = t(this, A).querySelector(r);
|
|
376
376
|
if (!n) return;
|
|
377
377
|
const o = n.querySelector(".ng-part-body table");
|
|
@@ -379,11 +379,11 @@ const He = class He {
|
|
|
379
379
|
const a = o.querySelector("tbody.bindable-tbody");
|
|
380
380
|
if (!a) return;
|
|
381
381
|
const l = Array.from(a.querySelectorAll("tr")).map((f) => f.cloneNode(!0));
|
|
382
|
-
t(this,
|
|
382
|
+
t(this, z).set(r, l);
|
|
383
383
|
});
|
|
384
384
|
const i = t(this, A).querySelector(".ng-container-body .ng-part-body"), e = t(this, A).querySelector(".ng-container-left .ng-part-body"), s = t(this, A).querySelector(".ng-container-right .ng-part-body");
|
|
385
385
|
if (i) {
|
|
386
|
-
t(this,
|
|
386
|
+
t(this, Ot).call(this, i), t(this, At).call(this), t(this, St).call(this), t(this, lt).call(this, i.scrollTop);
|
|
387
387
|
let r = !1;
|
|
388
388
|
const n = /* @__PURE__ */ c((o, a) => {
|
|
389
389
|
var h;
|
|
@@ -396,8 +396,8 @@ const He = class He {
|
|
|
396
396
|
});
|
|
397
397
|
}
|
|
398
398
|
}, "initialize"));
|
|
399
|
-
d(this,
|
|
400
|
-
const s = t(this,
|
|
399
|
+
d(this, Wt, /* @__PURE__ */ c((i, e) => {
|
|
400
|
+
const s = t(this, z).get(e);
|
|
401
401
|
if (!s || s.length === 0) return;
|
|
402
402
|
const r = i.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
403
403
|
if (!r) return;
|
|
@@ -409,28 +409,28 @@ const He = class He {
|
|
|
409
409
|
});
|
|
410
410
|
n ? n.before(o) : r.appendChild(o);
|
|
411
411
|
}, "#renderRows"));
|
|
412
|
-
d(this,
|
|
412
|
+
d(this, Ot, /* @__PURE__ */ c((i) => {
|
|
413
413
|
if (t(this, H) !== null && t(this, H) > 0)
|
|
414
414
|
return t(this, H);
|
|
415
|
-
const e = t(this,
|
|
415
|
+
const e = t(this, z).get(".ng-container-body");
|
|
416
416
|
if (!e || e.length === 0) return 24;
|
|
417
417
|
const s = i.querySelector("tbody.bindable-tbody");
|
|
418
418
|
if (!s) return 24;
|
|
419
|
-
s.querySelectorAll("tr:not(.nodata)").forEach((
|
|
419
|
+
s.querySelectorAll("tr:not(.nodata)").forEach((p) => p.remove());
|
|
420
420
|
const r = s.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
421
|
-
e.forEach((
|
|
422
|
-
n.appendChild(
|
|
421
|
+
e.forEach((p) => {
|
|
422
|
+
n.appendChild(p.cloneNode(!0));
|
|
423
423
|
}), r ? r.before(n) : s.appendChild(n);
|
|
424
424
|
const o = t(this, A), a = o.style.display, h = o.style.visibility, l = o.style.position;
|
|
425
425
|
(a === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
426
426
|
let f = 0;
|
|
427
427
|
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
428
|
-
return u.forEach((
|
|
429
|
-
f +=
|
|
430
|
-
}), u.forEach((
|
|
428
|
+
return u.forEach((p) => {
|
|
429
|
+
f += p.offsetHeight || p.getBoundingClientRect().height;
|
|
430
|
+
}), u.forEach((p) => p.remove()), o.style.display = a, o.style.visibility = h, o.style.position = l, b(this, H, f > 0 ? f : 24), t(this, Et).call(this), t(this, H);
|
|
431
431
|
}, "#measureAndCacheHeight"));
|
|
432
432
|
d(this, St, /* @__PURE__ */ c(() => {
|
|
433
|
-
const e = (t(this,
|
|
433
|
+
const e = (t(this, D).data.get() || []).length, s = t(this, H) || 24, r = e * s;
|
|
434
434
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
435
435
|
const o = t(this, A).querySelector(n);
|
|
436
436
|
if (!o) return;
|
|
@@ -439,13 +439,13 @@ const He = class He {
|
|
|
439
439
|
});
|
|
440
440
|
}, "#updateVirtualScrollHeight"));
|
|
441
441
|
d(this, Et, /* @__PURE__ */ c(() => {
|
|
442
|
-
if (t(this,
|
|
443
|
-
const i = Math.ceil(t(this,
|
|
444
|
-
|
|
442
|
+
if (t(this, Q) > 0 && t(this, H) > 0) {
|
|
443
|
+
const i = Math.ceil(t(this, Q) / t(this, H));
|
|
444
|
+
b(this, wt, i + t(this, Nt));
|
|
445
445
|
}
|
|
446
446
|
}, "#updateRowCount"));
|
|
447
|
-
d(this,
|
|
448
|
-
var a, h, l, f, u,
|
|
447
|
+
d(this, Bt, /* @__PURE__ */ c(() => {
|
|
448
|
+
var a, h, l, f, u, p;
|
|
449
449
|
const i = t(this, A).querySelector(".ng-container-left .ng-part-body table"), e = t(this, A).querySelector(".ng-container-body .ng-part-body table"), s = t(this, A).querySelector(".ng-container-right .ng-part-body table");
|
|
450
450
|
if (e) {
|
|
451
451
|
const g = i ? Array.from(i.querySelectorAll("tbody tr")) : [], m = Array.from(e.querySelectorAll("tbody tr")), v = s ? Array.from(s.querySelectorAll("tbody tr")) : [], E = Math.max(g.length, m.length, v.length);
|
|
@@ -465,14 +465,14 @@ const He = class He {
|
|
|
465
465
|
const W = [
|
|
466
466
|
((f = g[x]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
467
467
|
((u = m[x]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
|
|
468
|
-
((
|
|
468
|
+
((p = v[x]) == null ? void 0 : p.getBoundingClientRect().height) || 0
|
|
469
469
|
], C = Math.max(...W);
|
|
470
470
|
C > 0 && (g[x] && (g[x].style.height = `${C}px`), m[x] && (m[x].style.height = `${C}px`), v[x] && (v[x].style.height = `${C}px`));
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
473
|
}, "#syncRowHeights"));
|
|
474
|
-
d(this,
|
|
475
|
-
!t(this, A) || !(t(this, A) instanceof HTMLElement) || (
|
|
474
|
+
d(this, zt, /* @__PURE__ */ c(() => {
|
|
475
|
+
!t(this, A) || !(t(this, A) instanceof HTMLElement) || (b(this, F, new ResizeObserver((i) => {
|
|
476
476
|
for (const e of i) {
|
|
477
477
|
const s = e.target;
|
|
478
478
|
if (!s.classList.contains("active")) continue;
|
|
@@ -482,7 +482,7 @@ const He = class He {
|
|
|
482
482
|
const o = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
|
|
483
483
|
o && (n += o.offsetHeight), a && (n += a.offsetHeight);
|
|
484
484
|
const h = Math.max(r - n, 100);
|
|
485
|
-
t(this,
|
|
485
|
+
t(this, Q) !== h && (b(this, Q, h), t(this, Et).call(this), t(this, H) !== null && t(this, At).call(this));
|
|
486
486
|
}
|
|
487
487
|
}
|
|
488
488
|
})), t(this, F).observe(t(this, A)));
|
|
@@ -490,8 +490,8 @@ const He = class He {
|
|
|
490
490
|
d(this, At, /* @__PURE__ */ c(() => {
|
|
491
491
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
492
492
|
const e = t(this, A).querySelector(i);
|
|
493
|
-
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this,
|
|
494
|
-
}), t(this,
|
|
493
|
+
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Wt).call(this, e, i);
|
|
494
|
+
}), t(this, Pt).call(this), t(this, Bt).call(this);
|
|
495
495
|
}, "#renderAllContainers"));
|
|
496
496
|
d(this, Dt, /* @__PURE__ */ c((i) => {
|
|
497
497
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
@@ -500,15 +500,15 @@ const He = class He {
|
|
|
500
500
|
if (!s) return;
|
|
501
501
|
const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
502
502
|
if (!r) return;
|
|
503
|
-
const n = Array.from(r.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this,
|
|
503
|
+
const n = Array.from(r.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this, z).get(e)) == null ? void 0 : l.length) || 1, h = (t(this, D).data.get() || []).length;
|
|
504
504
|
n.forEach((f, u) => {
|
|
505
|
-
const
|
|
506
|
-
if (
|
|
505
|
+
const p = i + Math.floor(u / o);
|
|
506
|
+
if (p >= h) {
|
|
507
507
|
f.style.display = "none";
|
|
508
508
|
return;
|
|
509
509
|
}
|
|
510
|
-
const g = t(this,
|
|
511
|
-
f.style.display = "", t(this, Rt).call(this, f, g,
|
|
510
|
+
const g = t(this, D).data.get(p);
|
|
511
|
+
f.style.display = "", t(this, Rt).call(this, f, g, p);
|
|
512
512
|
});
|
|
513
513
|
});
|
|
514
514
|
}, "#adjustBufferRows"));
|
|
@@ -516,7 +516,7 @@ const He = class He {
|
|
|
516
516
|
var h;
|
|
517
517
|
const e = t(this, H);
|
|
518
518
|
if (!e || e <= 0) return;
|
|
519
|
-
const r = (t(this,
|
|
519
|
+
const r = (t(this, D).data.get() || []).length, n = Math.max(0, Math.floor(i / e)), o = n * e, a = ((h = t(this, z).get(".ng-container-body")) == null ? void 0 : h.length) || 1;
|
|
520
520
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((l) => {
|
|
521
521
|
const f = t(this, A).querySelector(l);
|
|
522
522
|
if (!f) return;
|
|
@@ -528,11 +528,11 @@ const He = class He {
|
|
|
528
528
|
g.style.display = "none";
|
|
529
529
|
return;
|
|
530
530
|
}
|
|
531
|
-
const E = t(this,
|
|
531
|
+
const E = t(this, D).data.get(v);
|
|
532
532
|
g.style.display = "", t(this, Rt).call(this, g, E, v);
|
|
533
533
|
});
|
|
534
|
-
}), t(this, at) || (
|
|
535
|
-
t(this, Dt).call(this, n),
|
|
534
|
+
}), t(this, at) || (b(this, at, !0), setTimeout(() => {
|
|
535
|
+
t(this, Dt).call(this, n), b(this, at, !1);
|
|
536
536
|
}, 0));
|
|
537
537
|
}, "#handleScroll"));
|
|
538
538
|
/**
|
|
@@ -556,41 +556,41 @@ const He = class He {
|
|
|
556
556
|
o && typeof o.reset == "function" && o.reset();
|
|
557
557
|
});
|
|
558
558
|
}, "#bindRowData"));
|
|
559
|
-
d(this,
|
|
559
|
+
d(this, Pt, /* @__PURE__ */ c(() => {
|
|
560
560
|
var h, l, f;
|
|
561
561
|
const i = t(this, A).querySelector(".ng-container-left .ng-part-header table"), e = t(this, A).querySelector(".ng-container-body .ng-part-header table"), s = t(this, A).querySelector(".ng-container-right .ng-part-header table");
|
|
562
562
|
if (!e) return;
|
|
563
563
|
const r = i ? Array.from(i.querySelectorAll("tr")) : [], n = Array.from(e.querySelectorAll("tr")), o = s ? Array.from(s.querySelectorAll("tr")) : [], a = Math.max(r.length, n.length, o.length);
|
|
564
564
|
for (let u = 0; u < a; u++) {
|
|
565
|
-
const
|
|
565
|
+
const p = [
|
|
566
566
|
((h = r[u]) == null ? void 0 : h.getBoundingClientRect().height) || 0,
|
|
567
567
|
((l = n[u]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
568
568
|
((f = o[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
569
|
-
], g = Math.max(...
|
|
569
|
+
], g = Math.max(...p);
|
|
570
570
|
g > 0 && (r[u] && (r[u].style.height = `${g}px`), n[u] && (n[u].style.height = `${g}px`), o[u] && (o[u].style.height = `${g}px`));
|
|
571
571
|
}
|
|
572
572
|
}, "#syncHeaderHeights"));
|
|
573
|
-
|
|
574
|
-
t(this, F) && (t(this, F).disconnect(),
|
|
573
|
+
w(this, "destroy", /* @__PURE__ */ c(() => {
|
|
574
|
+
t(this, F) && (t(this, F).disconnect(), b(this, F, null));
|
|
575
575
|
}, "destroy"));
|
|
576
|
-
|
|
576
|
+
b(this, D, i.getRootNode().host), b(this, A, i), t(this, zt).call(this);
|
|
577
577
|
}
|
|
578
578
|
getRowHeight() {
|
|
579
579
|
return t(this, H);
|
|
580
580
|
}
|
|
581
581
|
templateLength(i = ".ng-container-body") {
|
|
582
582
|
var e;
|
|
583
|
-
return ((e = t(this,
|
|
583
|
+
return ((e = t(this, z).get(i)) == null ? void 0 : e.length) || 1;
|
|
584
584
|
}
|
|
585
585
|
};
|
|
586
|
-
|
|
587
|
-
let
|
|
588
|
-
const
|
|
586
|
+
D = new WeakMap(), A = new WeakMap(), z = new WeakMap(), H = new WeakMap(), F = new WeakMap(), Q = new WeakMap(), wt = new WeakMap(), at = new WeakMap(), Nt = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), Bt = new WeakMap(), zt = new WeakMap(), At = new WeakMap(), Dt = new WeakMap(), lt = new WeakMap(), Rt = new WeakMap(), Pt = new WeakMap(), c($e, "RowManager");
|
|
587
|
+
let ce = $e;
|
|
588
|
+
const jt = class jt {
|
|
589
589
|
/**
|
|
590
590
|
* 🎯 레이아웃 내의 여러 rawTables 배열을 일괄로 받아 단일 마스터 템플릿으로 사전 컴파일합니다.
|
|
591
591
|
*/
|
|
592
592
|
static compileAll(i) {
|
|
593
|
-
return Array.isArray(i) ? i.map((e) =>
|
|
593
|
+
return Array.isArray(i) ? i.map((e) => jt.compile(e)) : [];
|
|
594
594
|
}
|
|
595
595
|
/**
|
|
596
596
|
* 🎯 단일 원본 테이블을 받아 기본 구조 보정 및 2차원 격자 인덱스 사전 부여 완료된 마스터 테이블 반환
|
|
@@ -602,14 +602,14 @@ const Pt = class Pt {
|
|
|
602
602
|
const f = l.getAttribute("cell-type") || "renderer";
|
|
603
603
|
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
604
604
|
let u = `cell-${f}`;
|
|
605
|
-
const
|
|
605
|
+
const p = l.getAttribute("data-bind"), g = l.getAttribute("data-expr"), m = l.getAttribute("maxbyte"), v = l.getAttribute("type");
|
|
606
606
|
let E = [];
|
|
607
|
-
|
|
607
|
+
p && E.push(`data-bind="${p}"`), g && E.push(`data-expr="${g}"`), m && E.push(`maxbyte="${m}"`), v && E.push(`type="${v}"`), l.innerHTML = `<${u} ${E.join(" ")}></${u}>`;
|
|
608
608
|
});
|
|
609
609
|
}, "processCellTypes"), s = /* @__PURE__ */ c((a) => {
|
|
610
610
|
if (!a.querySelector("colgroup")) {
|
|
611
611
|
const h = a.querySelector("tbody tr") || a.querySelector("tr"), l = h ? h.querySelectorAll("th, td").length : 1, f = document.createElement("colgroup"), u = Math.max(Math.floor(a.clientWidth / l), 100);
|
|
612
|
-
for (let
|
|
612
|
+
for (let p = 0; p < l; p++) {
|
|
613
613
|
const g = document.createElement("col");
|
|
614
614
|
g.setAttribute("width", u), f.appendChild(g);
|
|
615
615
|
}
|
|
@@ -623,11 +623,11 @@ const Pt = class Pt {
|
|
|
623
623
|
}, "ensureTableStructure"), r = /* @__PURE__ */ c((a, h) => {
|
|
624
624
|
const l = Array.from(a.querySelectorAll(h + " tr")), f = Array.from(a.querySelectorAll(h + " th," + h + " td")), u = l.length;
|
|
625
625
|
if (u === 0 || f.length === 0) return;
|
|
626
|
-
let
|
|
626
|
+
let p = 0;
|
|
627
627
|
f.forEach((m) => {
|
|
628
|
-
|
|
628
|
+
p += m.colSpan || 1;
|
|
629
629
|
});
|
|
630
|
-
const g = Array.from(Array(u), () => Array(
|
|
630
|
+
const g = Array.from(Array(u), () => Array(p).fill(null));
|
|
631
631
|
l.forEach((m) => {
|
|
632
632
|
const v = m.sectionRowIndex;
|
|
633
633
|
let E = 0;
|
|
@@ -639,8 +639,8 @@ const Pt = class Pt {
|
|
|
639
639
|
}
|
|
640
640
|
const W = x.rowSpan || 1, C = x.colSpan || 1;
|
|
641
641
|
for (let O = 0; O < W; O++)
|
|
642
|
-
for (let
|
|
643
|
-
v + O < u && E +
|
|
642
|
+
for (let pt = 0; pt < C; pt++)
|
|
643
|
+
v + O < u && E + pt < p && (g[v + O][E + pt] = O === 0 && pt === 0 ? "1" : "0");
|
|
644
644
|
});
|
|
645
645
|
}), l.forEach((m) => {
|
|
646
646
|
const v = m.sectionRowIndex;
|
|
@@ -662,20 +662,20 @@ const Pt = class Pt {
|
|
|
662
662
|
}
|
|
663
663
|
// 🎯 [추가] td/th에 선언된 cell-type 속성을 읽어 커스텀 태그로 자동 감싸기
|
|
664
664
|
};
|
|
665
|
-
c(
|
|
666
|
-
let
|
|
667
|
-
var
|
|
668
|
-
const
|
|
665
|
+
c(jt, "TableCompiler");
|
|
666
|
+
let he = jt;
|
|
667
|
+
var Ft, tt, et, Vt, Yt, ct, Ut, Xt;
|
|
668
|
+
const yt = class yt extends HTMLElement {
|
|
669
669
|
constructor() {
|
|
670
670
|
super();
|
|
671
|
-
d(this,
|
|
672
|
-
d(this,
|
|
673
|
-
d(this,
|
|
674
|
-
|
|
671
|
+
d(this, Ft);
|
|
672
|
+
d(this, tt, null);
|
|
673
|
+
d(this, et);
|
|
674
|
+
w(this, "invalidate", /* @__PURE__ */ c(() => {
|
|
675
675
|
var e, s;
|
|
676
|
-
t(this,
|
|
676
|
+
t(this, et).refresh(), (e = this.querySelector("nine-table-hscrollbar")) == null || e.refresh(), (s = this.querySelector("nine-table-vscrollbar")) == null || s.refresh();
|
|
677
677
|
}, "invalidate"));
|
|
678
|
-
d(this,
|
|
678
|
+
d(this, Vt, /* @__PURE__ */ c(() => {
|
|
679
679
|
[
|
|
680
680
|
{ selector: ".ng-container-body", type: null },
|
|
681
681
|
{ selector: ".ng-container-left", type: "left" },
|
|
@@ -685,18 +685,18 @@ const pt = class pt extends HTMLElement {
|
|
|
685
685
|
if (!n) return;
|
|
686
686
|
n.innerHTML = "";
|
|
687
687
|
const o = document.createElement("div");
|
|
688
|
-
o.className = "ng-part-header", o.appendChild(t(this, ct).call(this, t(this,
|
|
688
|
+
o.className = "ng-part-header", o.appendChild(t(this, ct).call(this, t(this, tt), r, "header"));
|
|
689
689
|
const a = document.createElement("div");
|
|
690
690
|
a.className = "ng-part-body";
|
|
691
691
|
const h = document.createElement("div");
|
|
692
|
-
h.className = "ng-scroll-content", h.style.position = "relative", h.style.width = "100%", h.appendChild(t(this, ct).call(this, t(this,
|
|
692
|
+
h.className = "ng-scroll-content", h.style.position = "relative", h.style.width = "100%", h.appendChild(t(this, ct).call(this, t(this, tt), r, "body"));
|
|
693
693
|
const l = document.createElement("div");
|
|
694
694
|
l.className = "ng-virtual-spacer", l.style.width = "100%", l.style.pointerEvents = "none", h.appendChild(l), a.appendChild(h);
|
|
695
695
|
const f = document.createElement("div");
|
|
696
|
-
f.className = "ng-part-footer", f.appendChild(t(this, ct).call(this, t(this,
|
|
696
|
+
f.className = "ng-part-footer", f.appendChild(t(this, ct).call(this, t(this, tt), r, "footer")), n.appendChild(o), n.appendChild(a), n.appendChild(f);
|
|
697
697
|
});
|
|
698
698
|
}, "#renderSplitContainers"));
|
|
699
|
-
d(this,
|
|
699
|
+
d(this, Yt, /* @__PURE__ */ c(() => {
|
|
700
700
|
["left", "right", "body"].forEach((e) => {
|
|
701
701
|
const s = this.querySelector(`.ng-container-${e}`), r = s == null ? void 0 : s.querySelectorAll("table");
|
|
702
702
|
if (!s || !r || r.length === 0) return;
|
|
@@ -707,8 +707,8 @@ const pt = class pt extends HTMLElement {
|
|
|
707
707
|
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${n}px`, s.style.width = `${n}px`);
|
|
708
708
|
});
|
|
709
709
|
}, "#updateContainerWidths"));
|
|
710
|
-
|
|
711
|
-
e && (
|
|
710
|
+
w(this, "generate", /* @__PURE__ */ c((e) => {
|
|
711
|
+
e && (b(this, tt, he.compile(e)), t(this, Vt).call(this), t(this, Yt).call(this), t(this, et).initialize(), setTimeout(() => {
|
|
712
712
|
var s;
|
|
713
713
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
714
714
|
}, 0));
|
|
@@ -729,20 +729,20 @@ const pt = class pt extends HTMLElement {
|
|
|
729
729
|
l.remove();
|
|
730
730
|
}), n;
|
|
731
731
|
}, "#createSplitTable"));
|
|
732
|
-
|
|
733
|
-
|
|
732
|
+
w(this, "getRowHeight", /* @__PURE__ */ c(() => t(this, et).getRowHeight(), "getRowHeight"));
|
|
733
|
+
w(this, "scrollToX", /* @__PURE__ */ c((e) => {
|
|
734
734
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
735
735
|
s && (s.scrollLeft = e);
|
|
736
736
|
}, "scrollToX"));
|
|
737
|
-
|
|
737
|
+
w(this, "scrollToY", /* @__PURE__ */ c((e) => {
|
|
738
738
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
739
739
|
s && (s.scrollTop = e);
|
|
740
740
|
}, "scrollToY"));
|
|
741
|
-
d(this, Yt, /* @__PURE__ */ c(() => {
|
|
742
|
-
t(this, Ut).call(this);
|
|
743
|
-
}, "#init"));
|
|
744
741
|
d(this, Ut, /* @__PURE__ */ c(() => {
|
|
745
|
-
|
|
742
|
+
t(this, Xt).call(this);
|
|
743
|
+
}, "#init"));
|
|
744
|
+
d(this, Xt, /* @__PURE__ */ c(() => {
|
|
745
|
+
const e = yt.SCROLLBAR_SIZE;
|
|
746
746
|
this.innerHTML = `
|
|
747
747
|
<style>
|
|
748
748
|
nine-table-sheet {
|
|
@@ -884,23 +884,23 @@ const pt = class pt extends HTMLElement {
|
|
|
884
884
|
</div>
|
|
885
885
|
`;
|
|
886
886
|
}, "#render"));
|
|
887
|
-
|
|
887
|
+
b(this, et, new ce(this)), b(this, Ft, this.getRootNode().host);
|
|
888
888
|
}
|
|
889
889
|
connectedCallback() {
|
|
890
|
-
t(this,
|
|
890
|
+
t(this, Ut).call(this);
|
|
891
891
|
}
|
|
892
892
|
disconnectedCallback() {
|
|
893
|
-
this.innerHTML = "",
|
|
893
|
+
this.innerHTML = "", U.log("NineTableSheet destroyed.");
|
|
894
894
|
}
|
|
895
895
|
};
|
|
896
|
-
|
|
897
|
-
let
|
|
898
|
-
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet",
|
|
899
|
-
var
|
|
900
|
-
const
|
|
896
|
+
Ft = new WeakMap(), tt = new WeakMap(), et = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), ct = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(), c(yt, "NineTableSheet"), w(yt, "SCROLLBAR_SIZE", 16);
|
|
897
|
+
let $t = yt;
|
|
898
|
+
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", $t);
|
|
899
|
+
var Kt, qt;
|
|
900
|
+
const Me = class Me extends HTMLElement {
|
|
901
901
|
constructor() {
|
|
902
902
|
super();
|
|
903
|
-
d(this,
|
|
903
|
+
d(this, Kt, /* @__PURE__ */ c(() => {
|
|
904
904
|
var e;
|
|
905
905
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
906
906
|
var o;
|
|
@@ -912,8 +912,8 @@ const $e = class $e extends HTMLElement {
|
|
|
912
912
|
const r = /* @__PURE__ */ c(() => {
|
|
913
913
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
914
914
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((g) => g.style.setProperty("display", "none"));
|
|
915
|
-
const
|
|
916
|
-
|
|
915
|
+
const p = f.filter((g) => g.classList.contains("active"));
|
|
916
|
+
p.length < 2 || p.forEach((g) => {
|
|
917
917
|
const m = parseInt(g.getAttribute("data-index"), 10), v = this.querySelector(`nine-splitter[data-split-index="${m}"]`), E = f[m + 1];
|
|
918
918
|
v && E && E.classList.contains("active") && v.style.setProperty("display", "flex");
|
|
919
919
|
});
|
|
@@ -923,16 +923,16 @@ const $e = class $e extends HTMLElement {
|
|
|
923
923
|
a.forEach((f, u) => {
|
|
924
924
|
f.classList.toggle("active", u === e);
|
|
925
925
|
}), h.forEach((f, u) => {
|
|
926
|
-
const
|
|
927
|
-
f.classList.toggle("active",
|
|
926
|
+
const p = u === e;
|
|
927
|
+
f.classList.toggle("active", p), f.style.flex = p ? "1 1 100%" : "";
|
|
928
928
|
});
|
|
929
929
|
else {
|
|
930
930
|
const f = a[e], u = n.querySelectorAll(".nine-tab-item.active");
|
|
931
931
|
if (f.classList.contains("active") && u.length <= 1)
|
|
932
932
|
return;
|
|
933
933
|
f.classList.toggle("active");
|
|
934
|
-
const
|
|
935
|
-
|
|
934
|
+
const p = o.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
935
|
+
p && (p.classList.toggle("active"), p.classList.contains("active") || (p.style.flex = ""));
|
|
936
936
|
}
|
|
937
937
|
const l = o.querySelectorAll("nine-table-sheet.active");
|
|
938
938
|
l == null || l.forEach((f) => {
|
|
@@ -941,18 +941,18 @@ const $e = class $e extends HTMLElement {
|
|
|
941
941
|
}, "#switchSheet"));
|
|
942
942
|
}
|
|
943
943
|
connectedCallback() {
|
|
944
|
-
t(this,
|
|
944
|
+
t(this, Kt).call(this);
|
|
945
945
|
}
|
|
946
946
|
};
|
|
947
|
-
|
|
948
|
-
let
|
|
949
|
-
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets",
|
|
950
|
-
var M,
|
|
951
|
-
const
|
|
947
|
+
Kt = new WeakMap(), qt = new WeakMap(), c(Me, "NineTableSheets");
|
|
948
|
+
let de = Me;
|
|
949
|
+
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", de);
|
|
950
|
+
var M, Zt, kt, Gt;
|
|
951
|
+
const Ie = class Ie {
|
|
952
952
|
constructor(i) {
|
|
953
953
|
d(this, M);
|
|
954
|
-
d(this,
|
|
955
|
-
t(this,
|
|
954
|
+
d(this, Zt, /* @__PURE__ */ c(() => {
|
|
955
|
+
t(this, Gt).call(this), new ResizeObserver((i) => {
|
|
956
956
|
for (let e of i)
|
|
957
957
|
t(this, M).getAttribute("auto-height") === "true" && t(this, kt).call(this);
|
|
958
958
|
}).observe(t(this, M));
|
|
@@ -961,13 +961,13 @@ const Me = class Me {
|
|
|
961
961
|
var h, l;
|
|
962
962
|
const i = Array.from(t(this, M).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
963
963
|
if (i.length === 0) return;
|
|
964
|
-
const e = parseInt(t(this, M).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), r = (h = t(this, M).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : h.getBoundingClientRect().height, n = (l = t(this, M).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o =
|
|
964
|
+
const e = parseInt(t(this, M).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), r = (h = t(this, M).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : h.getBoundingClientRect().height, n = (l = t(this, M).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = $t.SCROLLBAR_SIZE, a = e * s + r + n + o;
|
|
965
965
|
t(this, M).style.height = `${a}px`;
|
|
966
966
|
}, "#applyAutoHeight"));
|
|
967
|
-
d(this,
|
|
967
|
+
d(this, Gt, /* @__PURE__ */ c(() => {
|
|
968
968
|
const e = Array.from(t(this, M).children).filter((h) => h.tagName === "TABLE"), s = t(this, M).getAttribute("auto-height") === "true", r = e.length, n = e.map((h, l) => {
|
|
969
|
-
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`,
|
|
970
|
-
return u +
|
|
969
|
+
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, p = l < r - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
970
|
+
return u + p;
|
|
971
971
|
}).join(""), o = e.map((h, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
972
972
|
t(this, M).shadowRoot.innerHTML = `
|
|
973
973
|
<style>
|
|
@@ -1067,54 +1067,54 @@ const Me = class Me {
|
|
|
1067
1067
|
});
|
|
1068
1068
|
});
|
|
1069
1069
|
}, "#render"));
|
|
1070
|
-
|
|
1070
|
+
b(this, M, i), t(this, Zt).call(this);
|
|
1071
1071
|
}
|
|
1072
1072
|
};
|
|
1073
|
-
M = new WeakMap(),
|
|
1074
|
-
let
|
|
1073
|
+
M = new WeakMap(), Zt = new WeakMap(), kt = new WeakMap(), Gt = new WeakMap(), c(Ie, "LayoutManager");
|
|
1074
|
+
let fe = Ie;
|
|
1075
1075
|
var Tt, ht;
|
|
1076
|
-
const
|
|
1076
|
+
const _e = class _e {
|
|
1077
1077
|
constructor(i) {
|
|
1078
1078
|
d(this, Tt);
|
|
1079
1079
|
d(this, ht, -1);
|
|
1080
|
-
|
|
1081
|
-
|
|
1080
|
+
w(this, "count", /* @__PURE__ */ c(() => t(this, Tt).rawRecords.length, "count"));
|
|
1081
|
+
b(this, Tt, i);
|
|
1082
1082
|
}
|
|
1083
1083
|
get at() {
|
|
1084
1084
|
return t(this, ht);
|
|
1085
1085
|
}
|
|
1086
1086
|
set at(i) {
|
|
1087
|
-
|
|
1087
|
+
b(this, ht, parseInt(i, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, ht)}"]`) && setTimeout(() => {
|
|
1088
1088
|
});
|
|
1089
1089
|
}
|
|
1090
1090
|
};
|
|
1091
|
-
Tt = new WeakMap(), ht = new WeakMap(), c(
|
|
1092
|
-
let
|
|
1093
|
-
var I,
|
|
1091
|
+
Tt = new WeakMap(), ht = new WeakMap(), c(_e, "ngRow");
|
|
1092
|
+
let ue = _e;
|
|
1093
|
+
var I, k, _, dt, Jt, V, Qt, st, Ct, te, ee, ft;
|
|
1094
1094
|
const N = class N {
|
|
1095
1095
|
constructor(i, e) {
|
|
1096
1096
|
d(this, I);
|
|
1097
|
-
d(this,
|
|
1097
|
+
d(this, k);
|
|
1098
1098
|
d(this, _, []);
|
|
1099
1099
|
d(this, dt, []);
|
|
1100
|
-
d(this,
|
|
1100
|
+
d(this, Jt, 0);
|
|
1101
1101
|
d(this, V, []);
|
|
1102
|
-
d(this,
|
|
1103
|
-
|
|
1102
|
+
d(this, Qt, /* @__PURE__ */ c(() => {
|
|
1103
|
+
b(this, V, []);
|
|
1104
1104
|
const i = t(this, I).template || [];
|
|
1105
1105
|
Array.from(i).forEach((e) => {
|
|
1106
1106
|
var s;
|
|
1107
1107
|
t(this, V).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1108
|
-
}), (t(this,
|
|
1108
|
+
}), (t(this, k).rawRecords || []).forEach((e) => {
|
|
1109
1109
|
e.__ng || (e.__ng = t(this, Ct).call(this)), e.__ng.height = t(this, V).slice();
|
|
1110
1110
|
});
|
|
1111
1111
|
}, "#initialize"));
|
|
1112
|
-
d(this,
|
|
1112
|
+
d(this, st, /* @__PURE__ */ c(() => {
|
|
1113
1113
|
t(this, I).shadowRoot.querySelectorAll("nine-table-sheet").forEach((i) => {
|
|
1114
1114
|
i.invalidate();
|
|
1115
1115
|
});
|
|
1116
1116
|
}, "#invalidate"));
|
|
1117
|
-
|
|
1117
|
+
w(this, "get", /* @__PURE__ */ c((i, e) => {
|
|
1118
1118
|
var n;
|
|
1119
1119
|
const s = this.getValidData();
|
|
1120
1120
|
if (!s || s.length <= 0) return;
|
|
@@ -1127,8 +1127,8 @@ const N = class N {
|
|
|
1127
1127
|
}
|
|
1128
1128
|
return t(this, ft).call(this, s[i]);
|
|
1129
1129
|
}, "get"));
|
|
1130
|
-
|
|
1131
|
-
this.clear(), this.add(i, !1), t(this,
|
|
1130
|
+
w(this, "set", /* @__PURE__ */ c((i) => {
|
|
1131
|
+
this.clear(), this.add(i, !1), t(this, st).call(this);
|
|
1132
1132
|
}, "set"));
|
|
1133
1133
|
d(this, Ct, /* @__PURE__ */ c(() => ({
|
|
1134
1134
|
rowState: N.ROW_STATE.EMPTY,
|
|
@@ -1139,14 +1139,14 @@ const N = class N {
|
|
|
1139
1139
|
c: {},
|
|
1140
1140
|
_: [0, 0, 0, 0, N.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, V).slice(), -1, {}, {}]
|
|
1141
1141
|
}), "#getDefaultMeta"));
|
|
1142
|
-
|
|
1143
|
-
|
|
1142
|
+
w(this, "reset", /* @__PURE__ */ c(() => {
|
|
1143
|
+
b(this, _, []), b(this, dt, []), t(this, st).call(this);
|
|
1144
1144
|
}, "reset"));
|
|
1145
|
-
|
|
1145
|
+
w(this, "clear", /* @__PURE__ */ c(() => {
|
|
1146
1146
|
var i;
|
|
1147
|
-
t(this,
|
|
1147
|
+
t(this, k).rawRecords = [], b(this, _, []), b(this, dt, []), (i = t(this, k).viewRecords) != null && i.reset && t(this, k).viewRecords.reset();
|
|
1148
1148
|
}, "clear"));
|
|
1149
|
-
d(this,
|
|
1149
|
+
d(this, te, /* @__PURE__ */ c((i) => {
|
|
1150
1150
|
var r;
|
|
1151
1151
|
Array.isArray(i) || (i = [i]);
|
|
1152
1152
|
const e = typeof ((r = t(this, I).fields) == null ? void 0 : r.get) == "function" ? t(this, I).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
@@ -1157,31 +1157,31 @@ const N = class N {
|
|
|
1157
1157
|
}), s.push(o);
|
|
1158
1158
|
}), s;
|
|
1159
1159
|
}, "#json2Array"));
|
|
1160
|
-
d(this,
|
|
1160
|
+
d(this, ee, /* @__PURE__ */ c((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1161
1161
|
e.__ng = t(this, Ct).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = N.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1162
1162
|
}), i), "#defaultInsert"));
|
|
1163
|
-
|
|
1163
|
+
w(this, "add", /* @__PURE__ */ c((i, e = !0) => {
|
|
1164
1164
|
i === void 0 && (i = {});
|
|
1165
|
-
const s = t(this,
|
|
1166
|
-
t(this,
|
|
1165
|
+
const s = t(this, te).call(this, i);
|
|
1166
|
+
t(this, k).rawRecords = t(this, k).rawRecords.concat(t(this, ee).call(this, s)), this.resetRecords();
|
|
1167
1167
|
const r = this.count() - 1;
|
|
1168
1168
|
return e || s.forEach((n, o) => {
|
|
1169
|
-
const a = t(this,
|
|
1169
|
+
const a = t(this, k).rawRecords[r - o];
|
|
1170
1170
|
a && (a.__ng.rowState = N.ROW_STATE.EMPTY);
|
|
1171
|
-
}), t(this,
|
|
1171
|
+
}), t(this, st).call(this), r;
|
|
1172
1172
|
}, "add"));
|
|
1173
|
-
|
|
1173
|
+
w(this, "delete", /* @__PURE__ */ c((i) => {
|
|
1174
1174
|
let e = [];
|
|
1175
|
-
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this,
|
|
1175
|
+
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this, k).host.row.at] : e = [parseInt(i, 10)], e.sort((s, r) => r - s).forEach((s) => {
|
|
1176
1176
|
if (t(this, _)[s]) {
|
|
1177
1177
|
const r = t(this, _)[s].__ng.rowid;
|
|
1178
|
-
t(this, _)[s].__ng.rowState === N.ROW_STATE.INSERT ? t(this,
|
|
1178
|
+
t(this, _)[s].__ng.rowState === N.ROW_STATE.INSERT ? t(this, k).rawRecords = t(this, k).rawRecords.filter((n) => n.__ng.rowid !== r) : t(this, k).rawRecords.forEach((n) => {
|
|
1179
1179
|
n.__ng.rowid === r && (n.__ng.deleted = !0, n.__ng.rowState = N.ROW_STATE.DELETE);
|
|
1180
1180
|
});
|
|
1181
1181
|
}
|
|
1182
|
-
}), this.resetRecords(), t(this,
|
|
1182
|
+
}), this.resetRecords(), t(this, st).call(this);
|
|
1183
1183
|
}, "delete"));
|
|
1184
|
-
|
|
1184
|
+
w(this, "setValue", /* @__PURE__ */ c((i, e, s) => {
|
|
1185
1185
|
var h;
|
|
1186
1186
|
i = parseInt(i, 10);
|
|
1187
1187
|
const n = (typeof ((h = t(this, I).fields) == null ? void 0 : h.get) == "function" ? t(this, I).fields.get() : []).indexOf(e);
|
|
@@ -1191,14 +1191,14 @@ const N = class N {
|
|
|
1191
1191
|
const a = o.v[n];
|
|
1192
1192
|
a !== s && o.__ng.rowState !== N.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = a), o.__ng.rowState = N.ROW_STATE.UPDATE), o.v[n] = s;
|
|
1193
1193
|
}, "setValue"));
|
|
1194
|
-
|
|
1195
|
-
|
|
1194
|
+
w(this, "resetRecords", /* @__PURE__ */ c(() => {
|
|
1195
|
+
b(this, dt, t(this, k).rawRecords.filter((i) => !i.__ng.deleted)), b(this, _, t(this, k).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, k).rawRecords.forEach((i, e) => {
|
|
1196
1196
|
i.__ng.rowidx = e;
|
|
1197
1197
|
}), t(this, _).forEach((i, e) => {
|
|
1198
1198
|
i.__ng.i = e;
|
|
1199
1199
|
});
|
|
1200
1200
|
}, "resetRecords"));
|
|
1201
|
-
|
|
1201
|
+
w(this, "getValidData", /* @__PURE__ */ c(() => (t(this, _).length === 0 && t(this, k).rawRecords.length > 0 && this.resetRecords(), t(this, _)), "getValidData"));
|
|
1202
1202
|
d(this, ft, /* @__PURE__ */ c((i) => {
|
|
1203
1203
|
var o;
|
|
1204
1204
|
if (!i) return i;
|
|
@@ -1210,17 +1210,17 @@ const N = class N {
|
|
|
1210
1210
|
});
|
|
1211
1211
|
return e ? n[0] : n;
|
|
1212
1212
|
}, "#conv"));
|
|
1213
|
-
|
|
1214
|
-
|
|
1213
|
+
w(this, "count", /* @__PURE__ */ c(() => this.getValidData().length, "count"));
|
|
1214
|
+
b(this, I, i), b(this, k, e), t(this, Qt).call(this);
|
|
1215
1215
|
}
|
|
1216
1216
|
get source() {
|
|
1217
|
-
return t(this, ft).call(this, t(this,
|
|
1217
|
+
return t(this, ft).call(this, t(this, k).rawRecords);
|
|
1218
1218
|
}
|
|
1219
1219
|
set source(i) {
|
|
1220
1220
|
this.clear(), this.add(i, !1);
|
|
1221
1221
|
}
|
|
1222
1222
|
get nextId() {
|
|
1223
|
-
return ++
|
|
1223
|
+
return ++Ve(this, Jt)._;
|
|
1224
1224
|
}
|
|
1225
1225
|
get length() {
|
|
1226
1226
|
return t(this, _).length;
|
|
@@ -1229,22 +1229,22 @@ const N = class N {
|
|
|
1229
1229
|
return this.length;
|
|
1230
1230
|
}
|
|
1231
1231
|
};
|
|
1232
|
-
I = new WeakMap(),
|
|
1233
|
-
|
|
1232
|
+
I = new WeakMap(), k = new WeakMap(), _ = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), V = new WeakMap(), Qt = new WeakMap(), st = new WeakMap(), Ct = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), ft = new WeakMap(), c(N, "ngData"), // 🎯 행 상태 정의 상수를 클래스 내부로 내재화
|
|
1233
|
+
w(N, "ROW_STATE", {
|
|
1234
1234
|
EMPTY: "EMPTY",
|
|
1235
1235
|
NORMAL: "NORMAL",
|
|
1236
1236
|
INSERT: "INSERT",
|
|
1237
1237
|
UPDATE: "UPDATE",
|
|
1238
1238
|
DELETE: "DELETE"
|
|
1239
1239
|
});
|
|
1240
|
-
let
|
|
1241
|
-
var
|
|
1242
|
-
const
|
|
1240
|
+
let ge = N;
|
|
1241
|
+
var it;
|
|
1242
|
+
const Ne = class Ne {
|
|
1243
1243
|
constructor(i) {
|
|
1244
|
-
d(this,
|
|
1245
|
-
|
|
1244
|
+
d(this, it);
|
|
1245
|
+
b(this, it, i), 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 = () => {
|
|
1246
1246
|
var e;
|
|
1247
|
-
(e = t(this,
|
|
1247
|
+
(e = t(this, it).view) != null && e.redraw && t(this, it).view.redraw();
|
|
1248
1248
|
}, this.setDataSource = (e) => {
|
|
1249
1249
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1250
1250
|
}, this.getRowState = (e) => {
|
|
@@ -1259,15 +1259,15 @@ const _e = class _e {
|
|
|
1259
1259
|
}, this.setDataSource([]);
|
|
1260
1260
|
}
|
|
1261
1261
|
};
|
|
1262
|
-
|
|
1263
|
-
let
|
|
1264
|
-
var ut, L, Lt,
|
|
1265
|
-
const
|
|
1262
|
+
it = new WeakMap(), c(Ne, "ngDataManager");
|
|
1263
|
+
let be = Ne;
|
|
1264
|
+
var ut, L, Lt, se;
|
|
1265
|
+
const We = class We {
|
|
1266
1266
|
// 🎯 이제 { name: string, type: string } 객체들의 배열로 관리합니다.
|
|
1267
1267
|
constructor(i) {
|
|
1268
1268
|
d(this, ut);
|
|
1269
1269
|
d(this, L, []);
|
|
1270
|
-
|
|
1270
|
+
w(this, "add", /* @__PURE__ */ c((i, e = "string") => {
|
|
1271
1271
|
i.forEach((s) => {
|
|
1272
1272
|
t(this, L).some((r) => r.name === s) || t(this, L).push({ name: s, type: e });
|
|
1273
1273
|
}), t(this, Lt).call(this);
|
|
@@ -1276,14 +1276,14 @@ const Ne = class Ne {
|
|
|
1276
1276
|
const i = /* @__PURE__ */ new Map();
|
|
1277
1277
|
t(this, L).forEach((e) => {
|
|
1278
1278
|
i.set(e.name, e.type);
|
|
1279
|
-
}),
|
|
1279
|
+
}), b(this, L, Array.from(i, ([e, s]) => ({ name: e, type: s }))), b(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);
|
|
1280
1280
|
}, "#adjust"));
|
|
1281
|
-
d(this,
|
|
1282
|
-
|
|
1281
|
+
d(this, se, /* @__PURE__ */ c(() => {
|
|
1282
|
+
b(this, L, []), U.log(t(this, ut).querySelectorAll("table"));
|
|
1283
1283
|
const i = Array.from(t(this, ut).querySelectorAll("table"));
|
|
1284
1284
|
if (!(!i || i.length === 0)) {
|
|
1285
1285
|
for (const e of i)
|
|
1286
|
-
|
|
1286
|
+
U.log(e), $("[data-bind]", e).each((s, r) => {
|
|
1287
1287
|
const n = r.dataset.bind, o = r.getAttribute("data-type") || "string";
|
|
1288
1288
|
n && t(this, L).push({ name: n, type: o });
|
|
1289
1289
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
@@ -1310,7 +1310,7 @@ const Ne = class Ne {
|
|
|
1310
1310
|
t(this, Lt).call(this);
|
|
1311
1311
|
}
|
|
1312
1312
|
}, "#init"));
|
|
1313
|
-
|
|
1313
|
+
b(this, ut, i), t(this, se).call(this);
|
|
1314
1314
|
}
|
|
1315
1315
|
// 🎯 기존에 필드 이름만 쓰던 곳들과의 호환을 위해 이름 배열만 리턴하는 메서드 유지
|
|
1316
1316
|
get() {
|
|
@@ -1332,41 +1332,41 @@ const Ne = class Ne {
|
|
|
1332
1332
|
return t(this, L).some((e) => e.name === i);
|
|
1333
1333
|
}
|
|
1334
1334
|
};
|
|
1335
|
-
ut = new WeakMap(), L = new WeakMap(), Lt = new WeakMap(),
|
|
1336
|
-
let
|
|
1337
|
-
var
|
|
1338
|
-
const
|
|
1335
|
+
ut = new WeakMap(), L = new WeakMap(), Lt = new WeakMap(), se = new WeakMap(), c(We, "ngFields");
|
|
1336
|
+
let pe = We;
|
|
1337
|
+
var rt, ie, re;
|
|
1338
|
+
const Oe = class Oe extends HTMLElement {
|
|
1339
1339
|
constructor() {
|
|
1340
1340
|
super();
|
|
1341
1341
|
//#created = false;
|
|
1342
|
-
d(this,
|
|
1343
|
-
d(this,
|
|
1344
|
-
d(this,
|
|
1345
|
-
this.fields = new
|
|
1342
|
+
d(this, rt);
|
|
1343
|
+
d(this, ie);
|
|
1344
|
+
d(this, re, /* @__PURE__ */ c(() => {
|
|
1345
|
+
this.fields = new pe(this), b(this, ie, new fe(this)), U.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1346
1346
|
}, "#init"));
|
|
1347
|
-
this.attachShadow({ mode: "open" }),
|
|
1347
|
+
this.attachShadow({ mode: "open" }), b(this, rt, new be(this));
|
|
1348
1348
|
}
|
|
1349
1349
|
connectedCallback() {
|
|
1350
|
-
t(this,
|
|
1350
|
+
t(this, re).call(this);
|
|
1351
1351
|
}
|
|
1352
1352
|
disconnectedCallback() {
|
|
1353
|
-
|
|
1353
|
+
U.log("NineTable disconnected.");
|
|
1354
1354
|
}
|
|
1355
1355
|
// 🎯 외부에서 grid.data.set(...) 형태로 접근할 수 있도록 데이터 매니저 오픈
|
|
1356
1356
|
get data() {
|
|
1357
|
-
return t(this,
|
|
1357
|
+
return t(this, rt).data;
|
|
1358
1358
|
}
|
|
1359
1359
|
// 🎯 행(row) 관련 제어 접근자 오픈
|
|
1360
1360
|
get row() {
|
|
1361
|
-
return t(this,
|
|
1361
|
+
return t(this, rt).row;
|
|
1362
1362
|
}
|
|
1363
1363
|
// 🎯 전체 데이터 매니저 접근 필요할 경우
|
|
1364
1364
|
get dataManager() {
|
|
1365
|
-
return t(this,
|
|
1365
|
+
return t(this, rt);
|
|
1366
1366
|
}
|
|
1367
1367
|
};
|
|
1368
|
-
|
|
1369
|
-
let ye =
|
|
1368
|
+
rt = new WeakMap(), ie = new WeakMap(), re = new WeakMap(), c(Oe, "NineTable");
|
|
1369
|
+
let ye = Oe;
|
|
1370
1370
|
customElements.get("nine-table") || customElements.define("nine-table", ye);
|
|
1371
1371
|
const mt = class mt extends HTMLElement {
|
|
1372
1372
|
// 👈 커스텀 스타일용 캐시 추가
|
|
@@ -1379,78 +1379,79 @@ const mt = class mt extends HTMLElement {
|
|
|
1379
1379
|
connectedCallback() {
|
|
1380
1380
|
}
|
|
1381
1381
|
};
|
|
1382
|
-
c(mt, "BasicCellElement"),
|
|
1383
|
-
let
|
|
1384
|
-
var
|
|
1385
|
-
const
|
|
1382
|
+
c(mt, "BasicCellElement"), w(mt, "_styleCache", /* @__PURE__ */ new Map()), w(mt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1383
|
+
let me = mt;
|
|
1384
|
+
var T, Ht, y, Se, Ee, Ae, Re, qe;
|
|
1385
|
+
const Be = class Be extends me {
|
|
1386
1386
|
constructor() {
|
|
1387
1387
|
super();
|
|
1388
|
-
d(this,
|
|
1389
|
-
d(this,
|
|
1390
|
-
d(this,
|
|
1388
|
+
d(this, T);
|
|
1389
|
+
d(this, Ht);
|
|
1390
|
+
d(this, y);
|
|
1391
1391
|
d(this, Se);
|
|
1392
1392
|
d(this, Ee);
|
|
1393
1393
|
d(this, Ae);
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1394
|
+
d(this, Re);
|
|
1395
|
+
w(this, "getDisplayText", /* @__PURE__ */ c((e) => {
|
|
1396
|
+
if (t(this, y))
|
|
1397
|
+
if (t(this, y).closest("tbody")) {
|
|
1398
|
+
const s = t(this, y).closest("tr").data, r = parseInt(t(this, y).dataset.row);
|
|
1398
1399
|
if (!s) return "";
|
|
1399
|
-
if (ninegrid.isNull(t(this,
|
|
1400
|
-
if (!ninegrid.isNull(t(this,
|
|
1401
|
-
return s[t(this,
|
|
1400
|
+
if (ninegrid.isNull(t(this, y).dataset.expr)) {
|
|
1401
|
+
if (!ninegrid.isNull(t(this, y).dataset.bind))
|
|
1402
|
+
return s[t(this, y).dataset.bind] || ninegrid.nvl(e, "");
|
|
1402
1403
|
} else try {
|
|
1403
|
-
return this.getExprValue(t(this,
|
|
1404
|
+
return this.getExprValue(t(this, y).dataset.expr, s, r, t(this, y));
|
|
1404
1405
|
} catch {
|
|
1405
|
-
console.error(t(this,
|
|
1406
|
+
console.error(t(this, y).dataset.expr, s, t(this, y).dataset.row);
|
|
1406
1407
|
}
|
|
1407
1408
|
return ninegrid.nvl(e, "");
|
|
1408
1409
|
} else
|
|
1409
1410
|
try {
|
|
1410
|
-
return t(this,
|
|
1411
|
+
return t(this, T).exprFunction(t(this, y).dataset.expr).call(this, null, -1, t(this, T).data);
|
|
1411
1412
|
} catch {
|
|
1412
1413
|
}
|
|
1413
1414
|
}, "getDisplayText"));
|
|
1414
|
-
|
|
1415
|
-
parseInt(t(this,
|
|
1416
|
-
|
|
1417
|
-
|
|
1415
|
+
w(this, "reset", /* @__PURE__ */ c(() => {
|
|
1416
|
+
U.log("super reset"), parseInt(t(this, y).dataset.row);
|
|
1417
|
+
const e = t(this, Ht).data;
|
|
1418
|
+
U.log(e);
|
|
1418
1419
|
}, "reset"));
|
|
1419
|
-
d(this,
|
|
1420
|
-
if (!(!t(this,
|
|
1421
|
-
var e = ninegrid.j.querySelectorAll(t(this,
|
|
1420
|
+
d(this, qe, /* @__PURE__ */ c(() => {
|
|
1421
|
+
if (!(!t(this, T) || !t(this, T).template || !t(this, y).closest("tbody.bindable"))) {
|
|
1422
|
+
var e = ninegrid.j.querySelectorAll(t(this, y)).attr("suppress");
|
|
1422
1423
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1423
|
-
var s = t(this,
|
|
1424
|
+
var s = t(this, y).closest("tr"), r = [];
|
|
1424
1425
|
$("th,td", s).each((x, W) => {
|
|
1425
1426
|
var C = ninegrid.j.querySelectorAll(W).attr("suppress");
|
|
1426
1427
|
C && W.dataset.row && (C = parseInt(C), !isNaN(C) && C <= e && r.push(C));
|
|
1427
1428
|
}), r.sort();
|
|
1428
1429
|
var n = !1;
|
|
1429
|
-
if (parseInt(s.sectionRowIndex / t(this,
|
|
1430
|
+
if (parseInt(s.sectionRowIndex / t(this, T).template.length) > 0)
|
|
1430
1431
|
for (var o of r) {
|
|
1431
1432
|
if (o > e) break;
|
|
1432
|
-
var a = parseInt(t(this,
|
|
1433
|
-
t(this,
|
|
1434
|
-
var u = t(this,
|
|
1435
|
-
if (
|
|
1433
|
+
var a = parseInt(t(this, y).dataset.row), h = a - 1, l = t(this, y).closest("tr").data, f = t(this, T).data.get(h);
|
|
1434
|
+
t(this, y).dataset.matrixRow;
|
|
1435
|
+
var u = t(this, T).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, y).dataset.matrixRow}"]`), p = u.dataset.expr ? this.getExprValue(u.dataset.expr, l, a) : l[u.dataset.bind], g = u.dataset.expr ? this.getExprValue(u.dataset.expr, f, h) : f[u.dataset.bind];
|
|
1436
|
+
if (p != g) {
|
|
1436
1437
|
n = !0;
|
|
1437
1438
|
break;
|
|
1438
1439
|
}
|
|
1439
1440
|
}
|
|
1440
1441
|
else
|
|
1441
1442
|
n = !0;
|
|
1442
|
-
n ? ninegrid.j.querySelectorAll(t(this,
|
|
1443
|
-
var m = parseInt(t(this,
|
|
1444
|
-
$(E).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this,
|
|
1443
|
+
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"));
|
|
1444
|
+
var m = parseInt(t(this, y).dataset.matrixRow), v = m - 1, E = t(this, T).body.querySelector(`tbody.bindable [data-col="${t(this, y).dataset.col}"][data-matrix-row="${v}"]`);
|
|
1445
|
+
$(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");
|
|
1445
1446
|
}
|
|
1446
1447
|
}
|
|
1447
1448
|
}, "#resetSuppress"));
|
|
1448
|
-
|
|
1449
|
+
w(this, "getExprValue", /* @__PURE__ */ c((e, s, r, n) => {
|
|
1449
1450
|
if (typeof e < "u")
|
|
1450
1451
|
try {
|
|
1451
1452
|
r = parseInt(r);
|
|
1452
1453
|
const o = e.replace("()", "");
|
|
1453
|
-
return t(this,
|
|
1454
|
+
return t(this, T)[o] ? t(this, T)[o].call(this, s, r, t(this, y)) : t(this, T).exprFunction(e).call(this, s, r, t(this, T).data);
|
|
1454
1455
|
} catch {
|
|
1455
1456
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1456
1457
|
}
|
|
@@ -1459,48 +1460,52 @@ const Oe = class Oe extends pe {
|
|
|
1459
1460
|
}, "getExprValue"));
|
|
1460
1461
|
}
|
|
1461
1462
|
connectedCallback() {
|
|
1462
|
-
super.connectedCallback();
|
|
1463
|
-
let e = this.getRootNode().host;
|
|
1464
|
-
e && e.tagName != "NINE-GRID" && (e = e.getRootNode().host), y(this, k, this.getRootNode().host), y(this, p, this.closest("th,td")), nt.log(t(this, k), t(this, p));
|
|
1463
|
+
super.connectedCallback(), b(this, T, this.getRootNode().host), b(this, y, this.closest("th,td")), b(this, Ht, t(this, y).closest("tr"));
|
|
1465
1464
|
}
|
|
1466
1465
|
get value() {
|
|
1467
|
-
var e = !t(this,
|
|
1466
|
+
var e = !t(this, T) || !t(this, T).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];
|
|
1468
1467
|
return e ?? "";
|
|
1469
1468
|
}
|
|
1470
1469
|
set value(e) {
|
|
1471
|
-
var s = parseInt(t(this,
|
|
1470
|
+
var s = parseInt(t(this, y).dataset.row);
|
|
1472
1471
|
const r = this.getAttribute("update-row-state") != "false";
|
|
1473
|
-
s < 0 ? t(this,
|
|
1472
|
+
s < 0 ? t(this, T).data.setValueNF(parseInt(t(this, y).dataset.index), t(this, y).dataset.bind, e, r) : t(this, T).data.setValue(s, t(this, y).dataset.bind, e, r);
|
|
1474
1473
|
}
|
|
1475
1474
|
get row() {
|
|
1476
|
-
return parseInt(t(this,
|
|
1475
|
+
return parseInt(t(this, y).dataset.row);
|
|
1477
1476
|
}
|
|
1478
1477
|
get data() {
|
|
1479
|
-
return t(this,
|
|
1478
|
+
return t(this, y).closest("tr").data;
|
|
1480
1479
|
}
|
|
1481
1480
|
};
|
|
1482
|
-
|
|
1483
|
-
let
|
|
1484
|
-
const
|
|
1481
|
+
T = new WeakMap(), Ht = new WeakMap(), y = new WeakMap(), Se = new WeakMap(), Ee = new WeakMap(), Ae = new WeakMap(), Re = new WeakMap(), qe = new WeakMap(), c(Be, "CellElement");
|
|
1482
|
+
let xe = Be;
|
|
1483
|
+
const ze = class ze extends xe {
|
|
1485
1484
|
constructor() {
|
|
1486
1485
|
super();
|
|
1486
|
+
w(this, "reset", /* @__PURE__ */ c(() => {
|
|
1487
|
+
U.log("editable reset"), super.reset();
|
|
1488
|
+
}, "reset"));
|
|
1487
1489
|
}
|
|
1488
1490
|
connectedCallback() {
|
|
1489
1491
|
super.connectedCallback();
|
|
1490
1492
|
}
|
|
1491
1493
|
};
|
|
1492
|
-
c(
|
|
1493
|
-
let
|
|
1494
|
-
var
|
|
1495
|
-
const De = class De extends
|
|
1494
|
+
c(ze, "EditableCellElement");
|
|
1495
|
+
let ve = ze;
|
|
1496
|
+
var ke, nt, gt, bt, ne, Y, Te;
|
|
1497
|
+
const De = class De extends ve {
|
|
1496
1498
|
constructor() {
|
|
1497
1499
|
super();
|
|
1498
|
-
d(this,
|
|
1499
|
-
d(this,
|
|
1500
|
+
d(this, ke);
|
|
1501
|
+
d(this, nt);
|
|
1500
1502
|
d(this, gt);
|
|
1501
1503
|
d(this, bt);
|
|
1502
|
-
d(this,
|
|
1504
|
+
d(this, ne);
|
|
1503
1505
|
d(this, Y);
|
|
1506
|
+
w(this, "reset", /* @__PURE__ */ c(() => {
|
|
1507
|
+
super.reset(), trace.log("input reset");
|
|
1508
|
+
}, "reset"));
|
|
1504
1509
|
/**
|
|
1505
1510
|
dataRefresh = (v) => {
|
|
1506
1511
|
this.#target.value = this.value;
|
|
@@ -1531,9 +1536,9 @@ const De = class De extends xe {
|
|
|
1531
1536
|
if (!v) this.reset();
|
|
1532
1537
|
};
|
|
1533
1538
|
*/
|
|
1534
|
-
d(this,
|
|
1539
|
+
d(this, Te, /* @__PURE__ */ c((e) => {
|
|
1535
1540
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1536
|
-
if (t(this,
|
|
1541
|
+
if (t(this, nt) == "number") {
|
|
1537
1542
|
let n = [];
|
|
1538
1543
|
if (t(this, Y) && Number(t(this, Y)) > 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, Y) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
|
|
1539
1544
|
var s = e.target.value, r = s.indexOf(".");
|
|
@@ -1546,7 +1551,7 @@ const De = class De extends xe {
|
|
|
1546
1551
|
t(this, gt) && ninegrid.getByteLength(e.target.value) >= Number(t(this, gt)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1547
1552
|
}
|
|
1548
1553
|
}, "#onKeyDown"));
|
|
1549
|
-
if (this.applyBaseStyle(),
|
|
1554
|
+
if (this.applyBaseStyle(), b(this, nt, this.getAttribute("type") || "text"), b(this, gt, this.getAttribute("maxbyte")), b(this, bt, this.getAttribute("min")), b(this, ne, this.getAttribute("max")), b(this, Y, this.getAttribute("scale")), !["text", "number"].includes(t(this, nt))) throw `invalid type : ${t(this, nt)}`;
|
|
1550
1555
|
}
|
|
1551
1556
|
connectedCallback() {
|
|
1552
1557
|
for (var e = [], s = 0; s < this.attributes.length; s++)
|
|
@@ -1559,8 +1564,8 @@ const De = class De extends xe {
|
|
|
1559
1564
|
`, super.connectedCallback();
|
|
1560
1565
|
}
|
|
1561
1566
|
};
|
|
1562
|
-
|
|
1563
|
-
let
|
|
1567
|
+
ke = new WeakMap(), nt = new WeakMap(), gt = new WeakMap(), bt = new WeakMap(), ne = new WeakMap(), Y = new WeakMap(), Te = new WeakMap(), c(De, "CellInputText");
|
|
1568
|
+
let we = De;
|
|
1564
1569
|
customElements.get("cell-input-text");
|
|
1565
|
-
customElements.get("cell-input") || customElements.define("cell-input",
|
|
1570
|
+
customElements.get("cell-input") || customElements.define("cell-input", we);
|
|
1566
1571
|
//# sourceMappingURL=nine-table.js.map
|