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