@ninebone/table 0.0.436 β 0.0.438
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 +620 -636
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +40 -45
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
var me = (
|
|
3
|
-
throw TypeError(
|
|
1
|
+
var ye = Object.defineProperty;
|
|
2
|
+
var me = (v) => {
|
|
3
|
+
throw TypeError(v);
|
|
4
4
|
};
|
|
5
|
-
var we = (
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var t = (
|
|
9
|
-
var
|
|
10
|
-
set _(
|
|
11
|
-
|
|
5
|
+
var we = (v, i, e) => i in v ? ye(v, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : v[i] = e;
|
|
6
|
+
var c = (v, i) => ye(v, "name", { value: i, configurable: !0 });
|
|
7
|
+
var x = (v, i, e) => we(v, typeof i != "symbol" ? i + "" : i, e), ve = (v, i, e) => i.has(v) || me("Cannot " + e);
|
|
8
|
+
var t = (v, i, e) => (ve(v, i, "read from private field"), e ? e.call(v) : i.get(v)), d = (v, i, e) => i.has(v) ? me("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(v) : i.set(v, e), g = (v, i, e, n) => (ve(v, i, "write to private field"), n ? n.call(v, e) : i.set(v, e), e);
|
|
9
|
+
var xe = (v, i, e, n) => ({
|
|
10
|
+
set _(s) {
|
|
11
|
+
g(v, i, s, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
|
-
return t(
|
|
14
|
+
return t(v, i, n);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
import { trace as Se } from "@ninebone/util";
|
|
@@ -20,99 +20,99 @@ const re = class re extends Se.constructor {
|
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
|
|
23
|
+
c(re, "Trace");
|
|
24
24
|
let jt = re;
|
|
25
|
-
const
|
|
26
|
-
var
|
|
25
|
+
const lt = new jt();
|
|
26
|
+
var M, W, y, P, D, B, Et, Y, Rt;
|
|
27
27
|
const le = class le extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (!t(this,
|
|
38
|
-
const e = t(this,
|
|
39
|
-
e && (
|
|
30
|
+
d(this, M);
|
|
31
|
+
d(this, W, !1);
|
|
32
|
+
d(this, y);
|
|
33
|
+
d(this, P);
|
|
34
|
+
d(this, D);
|
|
35
|
+
d(this, B);
|
|
36
|
+
d(this, Et, /* @__PURE__ */ c(() => {
|
|
37
|
+
if (!t(this, M)) return;
|
|
38
|
+
const e = t(this, M).querySelector(".ng-container-body");
|
|
39
|
+
e && (g(this, B, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
|
-
})), t(this,
|
|
41
|
+
})), t(this, B).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
|
-
|
|
44
|
-
if (!t(this,
|
|
45
|
-
const e = t(this,
|
|
46
|
-
if (!
|
|
47
|
-
const
|
|
48
|
-
if (l !== 0 &&
|
|
49
|
-
|
|
43
|
+
x(this, "refresh", /* @__PURE__ */ c(() => {
|
|
44
|
+
if (!t(this, M) || !t(this, y) || t(this, W)) return;
|
|
45
|
+
const e = t(this, y).container, n = e.querySelector("table");
|
|
46
|
+
if (!n) return;
|
|
47
|
+
const s = t(this, y).track, r = t(this, y).thumb, o = t(this, M).querySelector(".ng-container-bottom"), l = e.clientWidth, h = n.scrollWidth;
|
|
48
|
+
if (l !== 0 && h > l)
|
|
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 a = s.clientWidth;
|
|
55
|
+
if (a <= 0) return;
|
|
56
|
+
const f = Math.max(Math.min(a * (l / h), a), 20);
|
|
57
57
|
r.style.width = `${f}px`;
|
|
58
|
-
const u = e.scrollLeft,
|
|
58
|
+
const u = e.scrollLeft, b = h - l;
|
|
59
59
|
let p = 0;
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
p >
|
|
60
|
+
b > 0 && (p = parseInt(u / b * (a - f), 10)), p < 0 && (p = 0);
|
|
61
|
+
const m = a - f;
|
|
62
|
+
p > m && (p = m), r.style.left = `${p}px`, lt.log(p), t(this, y).left.disabled = p === 0, t(this, y).right.disabled = p >= m - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
|
|
65
|
-
if (!t(this,
|
|
66
|
-
const
|
|
67
|
-
if (!
|
|
68
|
-
const r = t(this,
|
|
64
|
+
d(this, Y, /* @__PURE__ */ c((e) => {
|
|
65
|
+
if (!t(this, y)) return !1;
|
|
66
|
+
const n = t(this, y).container, s = n.querySelector("table");
|
|
67
|
+
if (!s) return !1;
|
|
68
|
+
const r = t(this, y).track.getBoundingClientRect(), o = t(this, y).thumb.clientWidth;
|
|
69
69
|
let l = e;
|
|
70
70
|
l < 0 && (l = 0);
|
|
71
|
-
const
|
|
72
|
-
l >
|
|
73
|
-
const
|
|
74
|
-
return
|
|
71
|
+
const h = r.width - o;
|
|
72
|
+
l > h && (l = h), l = parseInt(l, 10), t(this, y).thumb.style.left = `${l}px`, t(this, y).left.disabled = l === 0, t(this, y).right.disabled = l >= h - 1;
|
|
73
|
+
const a = n.clientWidth, u = s.scrollWidth - a;
|
|
74
|
+
return h > 0 && u > 0 && (n.scrollLeft = l / h * u), l > 0 && l < h - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
|
|
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, Rt, /* @__PURE__ */ c(() => {
|
|
77
|
+
const e = /* @__PURE__ */ c((s) => {
|
|
78
|
+
clearInterval(t(this, P)), clearInterval(t(this, D));
|
|
79
|
+
const r = parseInt(t(this, y).thumb.style.left || 0, 10);
|
|
80
|
+
t(this, Y).call(this, r + s), g(this, P, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, P)), g(this, D, setInterval(() => {
|
|
82
|
+
const o = parseInt(t(this, y).thumb.style.left || 0, 10);
|
|
83
|
+
t(this, Y).call(this, o + s) || clearInterval(t(this, D));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
|
-
}, "delayScroll"),
|
|
87
|
-
clearInterval(t(this,
|
|
86
|
+
}, "delayScroll"), n = /* @__PURE__ */ c(() => {
|
|
87
|
+
clearInterval(t(this, P)), clearInterval(t(this, D));
|
|
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
|
-
|
|
89
|
+
["mouseup", "mouseleave", "touchend"].forEach((s) => {
|
|
90
|
+
t(this, y).left.addEventListener(s, n), t(this, y).right.addEventListener(s, n), t(this, y).track.addEventListener(s, n);
|
|
91
|
+
}), t(this, y).left.addEventListener("mousedown", (s) => {
|
|
92
|
+
s.button === 0 && e(-20);
|
|
93
|
+
}), t(this, y).right.addEventListener("mousedown", (s) => {
|
|
94
|
+
s.button === 0 && e(20);
|
|
95
|
+
}), t(this, y).left.addEventListener("touchstart", () => e(-20)), t(this, y).right.addEventListener("touchstart", () => e(20)), t(this, y).track.addEventListener("mousedown", (s) => {
|
|
96
|
+
if (s.button !== 0) return;
|
|
97
|
+
s.preventDefault();
|
|
98
|
+
const r = t(this, y).track.getBoundingClientRect(), o = t(this, y).thumb.clientWidth;
|
|
99
|
+
t(this, Y).call(this, s.clientX - r.left - o / 2);
|
|
100
|
+
}), t(this, y).thumb.addEventListener("mousedown", (s) => {
|
|
101
|
+
if (s.button !== 0) return;
|
|
102
|
+
s.stopPropagation(), s.preventDefault(), g(this, W, !0), this.shiftX = s.clientX - t(this, y).thumb.getBoundingClientRect().left;
|
|
103
|
+
const r = /* @__PURE__ */ c((l) => {
|
|
104
|
+
if (!t(this, W)) return;
|
|
105
|
+
const h = t(this, y).track.getBoundingClientRect();
|
|
106
|
+
t(this, Y).call(this, l.clientX - h.left - this.shiftX);
|
|
107
|
+
}, "onMouseMove"), o = /* @__PURE__ */ c(() => {
|
|
108
|
+
g(this, W, !1), n(), 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 (
|
|
115
|
+
if (g(this, M, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, M)) return;
|
|
116
116
|
this.innerHTML = `
|
|
117
117
|
<style>
|
|
118
118
|
nine-table-hscrollbar {
|
|
@@ -176,103 +176,100 @@ const le = class le 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 n = t(this, M).querySelector(".ng-container-body");
|
|
181
|
+
if (!n) {
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
|
-
|
|
186
|
-
container:
|
|
185
|
+
g(this, y, {
|
|
186
|
+
container: n,
|
|
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
|
+
}), n.addEventListener("scroll", () => {
|
|
192
|
+
t(this, W) || this.refresh();
|
|
193
|
+
}), t(this, Rt).call(this), t(this, Et).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
197
197
|
disconnectedCallback() {
|
|
198
|
-
t(this,
|
|
198
|
+
t(this, B) && t(this, B).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
|
|
201
|
+
M = new WeakMap(), W = new WeakMap(), y = new WeakMap(), P = new WeakMap(), D = new WeakMap(), B = new WeakMap(), Et = new WeakMap(), Y = new WeakMap(), Rt = new WeakMap(), c(le, "NineTableHScrollBar");
|
|
202
202
|
let Kt = le;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Kt);
|
|
204
|
-
var
|
|
204
|
+
var O, J, V, w, ht, dt, At;
|
|
205
205
|
const ae = class ae extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
const e = t(this, E).container, s = t(this, E).track, o = t(this, E).thumb, r = e.clientHeight, l = (t(this, F).data.get() || []).length, d = t(this, Q).getRowHeight(), h = l * d;
|
|
220
|
-
if (h <= r) {
|
|
221
|
-
o.style.display = "none", t(this, E).top.disabled = !0, t(this, E).bottom.disabled = !0;
|
|
208
|
+
d(this, O);
|
|
209
|
+
d(this, J);
|
|
210
|
+
d(this, V, !1);
|
|
211
|
+
d(this, w);
|
|
212
|
+
d(this, ht, 0);
|
|
213
|
+
d(this, dt, 0);
|
|
214
|
+
x(this, "refresh", /* @__PURE__ */ c(() => {
|
|
215
|
+
if (!t(this, O) || !t(this, w)) return;
|
|
216
|
+
const e = t(this, w).container, n = t(this, w).track, s = t(this, w).thumb, r = e.clientHeight, l = (t(this, O).data.get() || []).length, h = t(this, J).getRowHeight(), a = l * h;
|
|
217
|
+
if (a <= r) {
|
|
218
|
+
s.style.display = "none", t(this, w).top.disabled = !0, t(this, w).bottom.disabled = !0;
|
|
222
219
|
return;
|
|
223
220
|
} else
|
|
224
|
-
|
|
225
|
-
const f =
|
|
221
|
+
s.style.display = "block";
|
|
222
|
+
const f = n.clientHeight;
|
|
226
223
|
if (f <= 0) return;
|
|
227
|
-
const u = Math.max(Math.min(f * (r /
|
|
228
|
-
|
|
229
|
-
const
|
|
230
|
-
let
|
|
231
|
-
p > 0 && (
|
|
232
|
-
const
|
|
233
|
-
|
|
224
|
+
const u = Math.max(Math.min(f * (r / a), f), 20);
|
|
225
|
+
s.style.height = `${u}px`;
|
|
226
|
+
const b = e.scrollTop, p = Math.max(a - r, 1);
|
|
227
|
+
let m = 0;
|
|
228
|
+
p > 0 && (m = b / p * (f - u));
|
|
229
|
+
const R = f - u;
|
|
230
|
+
m < 0 && (m = 0), m > R && (m = R), s.style.top = `${m}px`, t(this, w).top.disabled = b <= 0, t(this, w).bottom.disabled = b >= p - 1;
|
|
234
231
|
}, "refresh"));
|
|
235
|
-
|
|
236
|
-
const e = t(this,
|
|
237
|
-
const r = (t(this,
|
|
238
|
-
return r *
|
|
232
|
+
d(this, At, /* @__PURE__ */ c(() => {
|
|
233
|
+
const e = t(this, w).container, n = /* @__PURE__ */ c(() => {
|
|
234
|
+
const r = (t(this, O).data.get() || []).length, o = t(this, J).getRowHeight();
|
|
235
|
+
return r * o;
|
|
239
236
|
}, "getContentHeight");
|
|
240
237
|
e.addEventListener("scroll", () => {
|
|
241
|
-
t(this,
|
|
242
|
-
}), t(this,
|
|
243
|
-
if (
|
|
244
|
-
|
|
245
|
-
const r = /* @__PURE__ */
|
|
246
|
-
if (!t(this,
|
|
247
|
-
const
|
|
248
|
-
if (u > 0 &&
|
|
249
|
-
const
|
|
250
|
-
let
|
|
251
|
-
const
|
|
252
|
-
|
|
238
|
+
t(this, V) || this.refresh();
|
|
239
|
+
}), t(this, w).thumb.addEventListener("mousedown", (s) => {
|
|
240
|
+
if (s.button !== 0) return;
|
|
241
|
+
s.stopPropagation(), s.preventDefault(), g(this, V, !0), g(this, ht, s.clientY), g(this, dt, e.scrollTop);
|
|
242
|
+
const r = /* @__PURE__ */ c((l) => {
|
|
243
|
+
if (!t(this, V)) return;
|
|
244
|
+
const h = t(this, w).track.getBoundingClientRect(), a = t(this, w).thumb.clientHeight, u = h.height - a, b = l.clientY - t(this, ht), p = e.clientHeight, m = n(), R = Math.max(m - p, 1);
|
|
245
|
+
if (u > 0 && R > 0) {
|
|
246
|
+
const G = b / u * R;
|
|
247
|
+
let at = t(this, dt) + G;
|
|
248
|
+
const pe = Math.max(0, m - p);
|
|
249
|
+
at < 0 && (at = 0), at > pe && (at = pe), e.scrollTop = at;
|
|
253
250
|
}
|
|
254
251
|
this.refresh();
|
|
255
|
-
}, "onMouseMove"),
|
|
256
|
-
|
|
252
|
+
}, "onMouseMove"), o = /* @__PURE__ */ c(() => {
|
|
253
|
+
g(this, V, !1), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
|
|
257
254
|
}, "onMouseUp");
|
|
258
|
-
document.addEventListener("mousemove", r), document.addEventListener("mouseup",
|
|
259
|
-
}), t(this,
|
|
260
|
-
if (
|
|
261
|
-
const r = t(this,
|
|
262
|
-
if (
|
|
263
|
-
const p = Math.max(0, Math.min(1, l /
|
|
264
|
-
e.scrollTop = p *
|
|
255
|
+
document.addEventListener("mousemove", r), document.addEventListener("mouseup", o);
|
|
256
|
+
}), t(this, w).track.addEventListener("mousedown", (s) => {
|
|
257
|
+
if (s.button !== 0 || s.target === t(this, w).thumb) return;
|
|
258
|
+
const r = t(this, w).track.getBoundingClientRect(), o = t(this, w).thumb.clientHeight, l = s.clientY - r.top - o / 2, a = r.height - o, f = e.clientHeight, u = n(), b = Math.max(u - f, 1);
|
|
259
|
+
if (a > 0 && b > 0) {
|
|
260
|
+
const p = Math.max(0, Math.min(1, l / a));
|
|
261
|
+
e.scrollTop = p * b;
|
|
265
262
|
}
|
|
266
263
|
this.refresh();
|
|
267
|
-
}), t(this,
|
|
264
|
+
}), t(this, w).top.addEventListener("click", () => {
|
|
268
265
|
e.scrollTop -= 40;
|
|
269
|
-
}), t(this,
|
|
266
|
+
}), t(this, w).bottom.addEventListener("click", () => {
|
|
270
267
|
e.scrollTop += 40;
|
|
271
268
|
});
|
|
272
269
|
}, "#init"));
|
|
273
270
|
}
|
|
274
271
|
connectedCallback() {
|
|
275
|
-
|
|
272
|
+
g(this, O, this.getRootNode().host), g(this, J, this.closest("nine-table-sheet")), this.innerHTML = `
|
|
276
273
|
<style>
|
|
277
274
|
nine-table-vscrollbar {
|
|
278
275
|
display: flex;
|
|
@@ -316,7 +313,6 @@ const ae = class ae extends HTMLElement {
|
|
|
316
313
|
position: relative;
|
|
317
314
|
background: #f3f4f6;
|
|
318
315
|
overflow: hidden;
|
|
319
|
-
border: 2px solid red;
|
|
320
316
|
}
|
|
321
317
|
nine-table-vscrollbar .ng-scroll-thumb {
|
|
322
318
|
position: absolute;
|
|
@@ -337,373 +333,365 @@ const ae = class ae extends HTMLElement {
|
|
|
337
333
|
<div class='ng-scroll-track'><div class='ng-scroll-thumb'></div></div>
|
|
338
334
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
339
335
|
`;
|
|
340
|
-
const e = /* @__PURE__ */
|
|
341
|
-
const
|
|
342
|
-
if (!
|
|
336
|
+
const e = /* @__PURE__ */ c(() => {
|
|
337
|
+
const n = t(this, O).shadowRoot.querySelector(".ng-container-body .ng-part-body");
|
|
338
|
+
if (!n) {
|
|
343
339
|
setTimeout(e, 10);
|
|
344
340
|
return;
|
|
345
341
|
}
|
|
346
|
-
|
|
347
|
-
container:
|
|
342
|
+
g(this, w, {
|
|
343
|
+
container: n,
|
|
348
344
|
track: this.querySelector(".ng-scroll-track"),
|
|
349
345
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
350
346
|
top: this.querySelector(".ng-scroll-top"),
|
|
351
347
|
bottom: this.querySelector(".ng-scroll-bottom")
|
|
352
|
-
}), t(this,
|
|
348
|
+
}), t(this, At).call(this), this.refresh();
|
|
353
349
|
}, "initWhenReady");
|
|
354
350
|
e();
|
|
355
351
|
}
|
|
356
352
|
};
|
|
357
|
-
|
|
353
|
+
O = new WeakMap(), J = new WeakMap(), V = new WeakMap(), w = new WeakMap(), ht = new WeakMap(), dt = new WeakMap(), At = new WeakMap(), c(ae, "NineTableVScrollBar");
|
|
358
354
|
let Zt = ae;
|
|
359
355
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Zt);
|
|
360
|
-
var
|
|
361
|
-
const M = class M {
|
|
362
|
-
/**
|
|
363
|
-
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
364
|
-
*/
|
|
365
|
-
static compileAll(i) {
|
|
366
|
-
return Array.isArray(i) ? i.map((e) => M.compile(e)) : [];
|
|
367
|
-
}
|
|
368
|
-
/**
|
|
369
|
-
* π― λ¨μΌ μλ³Έ ν
μ΄λΈμ λ°μ κΈ°λ³Έ ꡬ쑰 보μ λ° 2μ°¨μ 격μ μΈλ±μ€ μ¬μ λΆμ¬ μλ£λ λ§μ€ν° ν
μ΄λΈ λ°ν
|
|
370
|
-
*/
|
|
371
|
-
static compile(i) {
|
|
372
|
-
var o, r, n, l;
|
|
373
|
-
if (!i) return null;
|
|
374
|
-
const e = i.cloneNode(!0);
|
|
375
|
-
return t(o = M, At).call(o, e), t(r = M, tt).call(r, e, "thead"), t(n = M, tt).call(n, e, "tbody"), t(l = M, tt).call(l, e, "tfoot"), Array.from(e.querySelectorAll("colgroup col")).forEach((d, h) => {
|
|
376
|
-
const f = d.getAttribute("fixed");
|
|
377
|
-
f && e.querySelectorAll(`thead [data-col="${h}"], tbody [data-col="${h}"], tfoot [data-col="${h}"]`).forEach((u) => {
|
|
378
|
-
u.setAttribute("fixed", f);
|
|
379
|
-
});
|
|
380
|
-
}), e;
|
|
381
|
-
}
|
|
382
|
-
};
|
|
383
|
-
At = new WeakMap(), tt = new WeakMap(), a(M, "TableCompiler"), c(M, At, /* @__PURE__ */ a((i) => {
|
|
384
|
-
if (!i.querySelector("colgroup")) {
|
|
385
|
-
const e = i.querySelector("tbody tr") || i.querySelector("tr"), s = e ? e.querySelectorAll("th, td").length : 1, o = document.createElement("colgroup"), r = Math.max(Math.floor(i.clientWidth / s), 100);
|
|
386
|
-
for (let n = 0; n < s; n++) {
|
|
387
|
-
const l = document.createElement("col");
|
|
388
|
-
l.setAttribute("width", r), o.appendChild(l);
|
|
389
|
-
}
|
|
390
|
-
i.prepend(o);
|
|
391
|
-
}
|
|
392
|
-
if (!i.querySelector("thead")) {
|
|
393
|
-
const e = document.createElement("thead"), s = i.querySelector("colgroup");
|
|
394
|
-
s ? s.after(e) : i.prepend(e);
|
|
395
|
-
}
|
|
396
|
-
i.classList.add("nine-table-element"), i.style.display = "table";
|
|
397
|
-
}, "#ensureTableStructure")), c(M, tt, /* @__PURE__ */ a((i, e) => {
|
|
398
|
-
const s = Array.from(i.querySelectorAll(e + " tr")), o = Array.from(i.querySelectorAll(e + " th," + e + " td")), r = s.length;
|
|
399
|
-
if (r === 0 || o.length === 0) return;
|
|
400
|
-
let n = 0;
|
|
401
|
-
o.forEach((d) => {
|
|
402
|
-
n += d.colSpan || 1;
|
|
403
|
-
});
|
|
404
|
-
const l = Array.from(Array(r), () => Array(n).fill(null));
|
|
405
|
-
s.forEach((d) => {
|
|
406
|
-
const h = d.sectionRowIndex;
|
|
407
|
-
let f = 0;
|
|
408
|
-
Array.from(d.querySelectorAll("th,td")).forEach((u) => {
|
|
409
|
-
for (let y = 0; y < l[h].length; y++)
|
|
410
|
-
if (l[h][y] === null) {
|
|
411
|
-
f = y;
|
|
412
|
-
break;
|
|
413
|
-
}
|
|
414
|
-
const g = u.rowSpan || 1, p = u.colSpan || 1;
|
|
415
|
-
for (let y = 0; y < g; y++)
|
|
416
|
-
for (let S = 0; S < p; S++)
|
|
417
|
-
h + y < r && f + S < n && (l[h + y][f + S] = y === 0 && S === 0 ? "1" : "0");
|
|
418
|
-
});
|
|
419
|
-
}), s.forEach((d) => {
|
|
420
|
-
const h = d.sectionRowIndex;
|
|
421
|
-
Array.from(d.querySelectorAll("th,td")).forEach((f) => {
|
|
422
|
-
for (let u = 0; u < l[h].length; u++)
|
|
423
|
-
if (l[h][u] === "1") {
|
|
424
|
-
f.dataset.col = u, l[h][u] = "0";
|
|
425
|
-
break;
|
|
426
|
-
}
|
|
427
|
-
});
|
|
428
|
-
});
|
|
429
|
-
}, "#resetColIndex"));
|
|
430
|
-
let Gt = M;
|
|
431
|
-
var I, w, W, q, B, j, dt, et, qt, Tt, kt, ft, ut, Lt, Ct, bt, Ht, it, gt;
|
|
356
|
+
var I, S, _, q, z, X, ft, Q, qt, Tt, kt, ut, gt, Lt, Ct, bt, Ht, tt, pt;
|
|
432
357
|
const ce = class ce {
|
|
433
358
|
constructor(i) {
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
359
|
+
d(this, I);
|
|
360
|
+
d(this, S);
|
|
361
|
+
d(this, _, /* @__PURE__ */ new Map());
|
|
362
|
+
d(this, q, null);
|
|
363
|
+
d(this, z, null);
|
|
364
|
+
d(this, X, 0);
|
|
365
|
+
d(this, ft, 40);
|
|
366
|
+
d(this, Q, !1);
|
|
367
|
+
d(this, qt, 3);
|
|
368
|
+
x(this, "refresh", /* @__PURE__ */ c(() => {
|
|
444
369
|
var e;
|
|
445
|
-
const i = t(this,
|
|
446
|
-
i && (t(this,
|
|
370
|
+
const i = t(this, S).querySelector(".ng-container-body .ng-part-body");
|
|
371
|
+
i && (t(this, ut).call(this), t(this, tt).call(this, i.scrollTop), (e = t(this, S).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
447
372
|
}, "refresh"));
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
const r = t(this,
|
|
373
|
+
x(this, "initialize", /* @__PURE__ */ c(() => {
|
|
374
|
+
g(this, q, null), t(this, _).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((s) => {
|
|
375
|
+
const r = t(this, S).querySelector(s);
|
|
451
376
|
if (!r) return;
|
|
452
|
-
const
|
|
453
|
-
if (!
|
|
454
|
-
const l =
|
|
377
|
+
const o = r.querySelector(".ng-part-body table");
|
|
378
|
+
if (!o) return;
|
|
379
|
+
const l = o.querySelector("tbody.bindable-tbody");
|
|
455
380
|
if (!l) return;
|
|
456
|
-
const
|
|
457
|
-
t(this,
|
|
381
|
+
const a = Array.from(l.querySelectorAll("tr")).map((f) => f.cloneNode(!0));
|
|
382
|
+
t(this, _).set(s, a);
|
|
458
383
|
});
|
|
459
|
-
const i = t(this,
|
|
384
|
+
const i = t(this, S).querySelector(".ng-container-body .ng-part-body"), e = t(this, S).querySelector(".ng-container-left .ng-part-body"), n = t(this, S).querySelector(".ng-container-right .ng-part-body");
|
|
460
385
|
if (i) {
|
|
461
|
-
t(this, kt).call(this, i), t(this, bt).call(this), t(this,
|
|
462
|
-
let
|
|
463
|
-
const r = /* @__PURE__ */
|
|
386
|
+
t(this, kt).call(this, i), t(this, bt).call(this), t(this, ut).call(this), t(this, tt).call(this, i.scrollTop);
|
|
387
|
+
let s = i.scrollTop;
|
|
388
|
+
const r = /* @__PURE__ */ c((o) => {
|
|
464
389
|
var l;
|
|
465
|
-
e && e.scrollTop !==
|
|
390
|
+
e && e.scrollTop !== o && (e.scrollTop = o), n && n.scrollTop !== o && (n.scrollTop = o), t(this, tt).call(this, o), (l = t(this, S).querySelector("nine-table-vscrollbar")) == null || l.refresh();
|
|
466
391
|
}, "syncScroll");
|
|
467
392
|
i.addEventListener("scroll", () => {
|
|
468
|
-
const
|
|
469
|
-
|
|
393
|
+
const o = i.scrollTop;
|
|
394
|
+
s !== o && (s = o, r(o));
|
|
470
395
|
});
|
|
471
396
|
}
|
|
472
397
|
}, "initialize"));
|
|
473
|
-
|
|
474
|
-
const
|
|
475
|
-
if (!
|
|
476
|
-
const
|
|
477
|
-
if (!
|
|
478
|
-
|
|
479
|
-
const r =
|
|
480
|
-
for (let l = 0; l < t(this,
|
|
481
|
-
|
|
482
|
-
|
|
398
|
+
d(this, Tt, /* @__PURE__ */ c((i, e) => {
|
|
399
|
+
const n = t(this, _).get(e);
|
|
400
|
+
if (!n || n.length === 0) return;
|
|
401
|
+
const s = i.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
402
|
+
if (!s) return;
|
|
403
|
+
s.querySelectorAll("tr:not(.nodata)").forEach((l) => l.remove());
|
|
404
|
+
const r = s.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
405
|
+
for (let l = 0; l < t(this, ft); l++)
|
|
406
|
+
n.forEach((h) => {
|
|
407
|
+
o.appendChild(h.cloneNode(!0));
|
|
483
408
|
});
|
|
484
|
-
r ? r.before(
|
|
409
|
+
r ? r.before(o) : s.appendChild(o);
|
|
485
410
|
}, "#renderRows"));
|
|
486
|
-
|
|
411
|
+
d(this, kt, /* @__PURE__ */ c((i) => {
|
|
487
412
|
if (t(this, q) !== null && t(this, q) > 0)
|
|
488
413
|
return t(this, q);
|
|
489
|
-
const e = t(this,
|
|
414
|
+
const e = t(this, _).get(".ng-container-body");
|
|
490
415
|
if (!e || e.length === 0) return 24;
|
|
491
|
-
const
|
|
492
|
-
if (!
|
|
493
|
-
|
|
494
|
-
const
|
|
495
|
-
e.forEach((
|
|
496
|
-
r.appendChild(
|
|
497
|
-
}),
|
|
498
|
-
const
|
|
499
|
-
(l === "none" || window.getComputedStyle(
|
|
416
|
+
const n = i.querySelector("tbody.bindable-tbody");
|
|
417
|
+
if (!n) return 24;
|
|
418
|
+
n.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
|
|
419
|
+
const s = n.querySelector("tr.nodata"), r = document.createDocumentFragment();
|
|
420
|
+
e.forEach((b) => {
|
|
421
|
+
r.appendChild(b.cloneNode(!0));
|
|
422
|
+
}), s ? s.before(r) : n.appendChild(r);
|
|
423
|
+
const o = t(this, S), l = o.style.display, h = o.style.visibility, a = o.style.position;
|
|
424
|
+
(l === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
500
425
|
let f = 0;
|
|
501
|
-
const u =
|
|
502
|
-
return u.forEach((
|
|
503
|
-
f +=
|
|
504
|
-
}), u.forEach((
|
|
426
|
+
const u = n.querySelectorAll("tr:not(.nodata)");
|
|
427
|
+
return u.forEach((b) => {
|
|
428
|
+
f += b.offsetHeight || b.getBoundingClientRect().height;
|
|
429
|
+
}), u.forEach((b) => b.remove()), o.style.display = l, o.style.visibility = h, o.style.position = a, g(this, q, f > 0 ? f : 24), t(this, gt).call(this), t(this, q);
|
|
505
430
|
}, "#measureAndCacheHeight"));
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
const l =
|
|
512
|
-
|
|
513
|
-
const d = l.querySelector("table");
|
|
514
|
-
d && (d.style.height = "auto");
|
|
515
|
-
const h = l.querySelector(".ng-virtual-spacer");
|
|
516
|
-
h && (h.style.height = `${r}px`);
|
|
431
|
+
d(this, ut, /* @__PURE__ */ c(() => {
|
|
432
|
+
const e = (t(this, I).data.get() || []).length, n = t(this, q) || 24, s = e * n;
|
|
433
|
+
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((r) => {
|
|
434
|
+
const o = t(this, S).querySelector(r);
|
|
435
|
+
if (!o) return;
|
|
436
|
+
const l = o.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
437
|
+
l && (l.style.height = `${s}px`);
|
|
517
438
|
});
|
|
518
439
|
}, "#updateVirtualScrollHeight"));
|
|
519
|
-
|
|
520
|
-
if (
|
|
521
|
-
const
|
|
522
|
-
|
|
440
|
+
d(this, gt, /* @__PURE__ */ c(() => {
|
|
441
|
+
if (t(this, X) > 0 && t(this, q) > 0) {
|
|
442
|
+
const i = Math.ceil(t(this, X) / t(this, q));
|
|
443
|
+
g(this, ft, i + t(this, qt));
|
|
523
444
|
}
|
|
524
445
|
}, "#updateRowCount"));
|
|
525
|
-
|
|
526
|
-
var
|
|
527
|
-
const i = t(this,
|
|
446
|
+
d(this, Lt, /* @__PURE__ */ c(() => {
|
|
447
|
+
var h, a, f;
|
|
448
|
+
const i = t(this, S).querySelector(".ng-container-left .ng-part-body table"), e = t(this, S).querySelector(".ng-container-body .ng-part-body table"), n = t(this, S).querySelector(".ng-container-right .ng-part-body table");
|
|
528
449
|
if (!e) return;
|
|
529
|
-
const
|
|
450
|
+
const s = i ? Array.from(i.querySelectorAll("tr")) : [], r = Array.from(e.querySelectorAll("tr")), o = n ? Array.from(n.querySelectorAll("tr")) : [], l = Math.max(s.length, r.length, o.length);
|
|
530
451
|
for (let u = 0; u < l; u++) {
|
|
531
|
-
const
|
|
532
|
-
((
|
|
533
|
-
((
|
|
534
|
-
((f =
|
|
535
|
-
], p = Math.max(...
|
|
536
|
-
p > 0 && (
|
|
452
|
+
const b = [
|
|
453
|
+
((h = s[u]) == null ? void 0 : h.getBoundingClientRect().height) || 0,
|
|
454
|
+
((a = r[u]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
455
|
+
((f = o[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
456
|
+
], p = Math.max(...b);
|
|
457
|
+
p > 0 && (s[u] && (s[u].style.height = `${p}px`), r[u] && (r[u].style.height = `${p}px`), o[u] && (o[u].style.height = `${p}px`));
|
|
537
458
|
}
|
|
538
459
|
}, "#syncRowHeights"));
|
|
539
|
-
|
|
540
|
-
!t(this,
|
|
460
|
+
d(this, Ct, /* @__PURE__ */ c(() => {
|
|
461
|
+
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (g(this, z, new ResizeObserver((i) => {
|
|
541
462
|
for (const e of i) {
|
|
542
|
-
const
|
|
543
|
-
if (!
|
|
544
|
-
const
|
|
545
|
-
if (
|
|
463
|
+
const n = e.target;
|
|
464
|
+
if (!n.classList.contains("active")) continue;
|
|
465
|
+
const s = e.contentRect.height;
|
|
466
|
+
if (s > 0) {
|
|
546
467
|
let r = 0;
|
|
547
|
-
const n =
|
|
548
|
-
|
|
549
|
-
const
|
|
550
|
-
t(this,
|
|
468
|
+
const o = n.querySelector(".ng-part-header"), l = n.querySelector(".ng-part-footer");
|
|
469
|
+
o && (r += o.offsetHeight), l && (r += l.offsetHeight);
|
|
470
|
+
const h = Math.max(s - r, 100);
|
|
471
|
+
t(this, X) !== h && (g(this, X, h), t(this, gt).call(this), t(this, q) !== null && t(this, bt).call(this));
|
|
551
472
|
}
|
|
552
473
|
}
|
|
553
|
-
})), t(this,
|
|
474
|
+
})), t(this, z).observe(t(this, S)));
|
|
554
475
|
}, "#initResizeObserver"));
|
|
555
|
-
|
|
476
|
+
d(this, bt, /* @__PURE__ */ c(() => {
|
|
556
477
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
557
|
-
const e = t(this,
|
|
558
|
-
e && e.querySelector("tbody.bindable-tbody") && t(this, Tt).call(this, e, i);
|
|
478
|
+
const e = t(this, S).querySelector(i);
|
|
479
|
+
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Tt).call(this, e, i);
|
|
559
480
|
}), t(this, Lt).call(this);
|
|
560
481
|
}, "#renderAllContainers"));
|
|
561
|
-
|
|
482
|
+
d(this, Ht, /* @__PURE__ */ c((i) => {
|
|
562
483
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
563
|
-
var
|
|
564
|
-
const
|
|
484
|
+
var a;
|
|
485
|
+
const n = t(this, S).querySelector(e);
|
|
486
|
+
if (!n) return;
|
|
487
|
+
const s = n.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
565
488
|
if (!s) return;
|
|
566
|
-
const
|
|
567
|
-
if (!o) return;
|
|
568
|
-
const r = Array.from(o.querySelectorAll("tr:not(.nodata)")), n = ((h = t(this, W).get(e)) == null ? void 0 : h.length) || 1, d = (t(this, I).data.get() || []).length;
|
|
489
|
+
const r = Array.from(s.querySelectorAll("tr:not(.nodata)")), o = ((a = t(this, _).get(e)) == null ? void 0 : a.length) || 1, h = (t(this, I).data.get() || []).length;
|
|
569
490
|
r.forEach((f, u) => {
|
|
570
|
-
const
|
|
571
|
-
if (
|
|
491
|
+
const b = i + Math.floor(u / o);
|
|
492
|
+
if (b >= h) {
|
|
572
493
|
f.style.display = "none";
|
|
573
494
|
return;
|
|
574
495
|
}
|
|
575
|
-
const p = t(this, I).data.get(
|
|
576
|
-
f.style.display = "", t(this,
|
|
496
|
+
const p = t(this, I).data.get(b);
|
|
497
|
+
f.style.display = "", t(this, pt).call(this, f, p, b);
|
|
577
498
|
});
|
|
578
499
|
});
|
|
579
500
|
}, "#adjustBufferRows"));
|
|
580
|
-
|
|
581
|
-
var
|
|
501
|
+
d(this, tt, /* @__PURE__ */ c((i) => {
|
|
502
|
+
var h;
|
|
582
503
|
const e = t(this, q);
|
|
583
504
|
if (!e || e <= 0) return;
|
|
584
|
-
const
|
|
585
|
-
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
586
|
-
const f = t(this,
|
|
505
|
+
const s = (t(this, I).data.get() || []).length, r = Math.max(0, Math.floor(i / e)), o = r * e, l = ((h = t(this, _).get(".ng-container-body")) == null ? void 0 : h.length) || 1;
|
|
506
|
+
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((a) => {
|
|
507
|
+
const f = t(this, S).querySelector(a);
|
|
587
508
|
if (!f) return;
|
|
588
|
-
const u = f.querySelector("
|
|
589
|
-
if (u)
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
if (!g) return;
|
|
595
|
-
g.style.transform = `translateY(${n}px)`, Array.from(g.querySelectorAll("tr:not(.nodata)")).forEach((y, S) => {
|
|
596
|
-
const O = r + Math.floor(S / l);
|
|
597
|
-
if (O >= o) {
|
|
598
|
-
y.style.display = "none";
|
|
509
|
+
const u = f.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
510
|
+
if (!u) return;
|
|
511
|
+
u.style.transform = `translateY(${o}px)`, Array.from(u.querySelectorAll("tr:not(.nodata)")).forEach((p, m) => {
|
|
512
|
+
const R = r + Math.floor(m / l);
|
|
513
|
+
if (R >= s) {
|
|
514
|
+
p.style.display = "none";
|
|
599
515
|
return;
|
|
600
516
|
}
|
|
601
|
-
const
|
|
602
|
-
|
|
517
|
+
const G = t(this, I).data.get(R);
|
|
518
|
+
p.style.display = "", t(this, pt).call(this, p, G, R);
|
|
603
519
|
});
|
|
604
|
-
}), t(this,
|
|
605
|
-
t(this, Ht).call(this, r),
|
|
520
|
+
}), t(this, Q) || (g(this, Q, !0), setTimeout(() => {
|
|
521
|
+
t(this, Ht).call(this, r), g(this, Q, !1);
|
|
606
522
|
}, 0));
|
|
607
523
|
}, "#handleScroll"));
|
|
608
|
-
|
|
609
|
-
i.dataset.row =
|
|
610
|
-
const
|
|
611
|
-
|
|
524
|
+
d(this, pt, /* @__PURE__ */ c((i, e, n) => {
|
|
525
|
+
i.dataset.row = n, Array.from(i.cells).forEach((s, r) => {
|
|
526
|
+
const o = s.dataset.bind;
|
|
527
|
+
o && e && e[o] !== void 0 ? s.textContent = e[o] : s.textContent = e ? e[Object.keys(e)[r]] ?? `R${n}C${r}` : `ν ${n + 1}`, s.dataset.row = n;
|
|
612
528
|
});
|
|
613
529
|
}, "#bindRowData"));
|
|
614
|
-
|
|
615
|
-
t(this,
|
|
530
|
+
x(this, "destroy", /* @__PURE__ */ c(() => {
|
|
531
|
+
t(this, z) && (t(this, z).disconnect(), g(this, z, null));
|
|
616
532
|
}, "destroy"));
|
|
617
|
-
|
|
533
|
+
g(this, I, i.getRootNode().host), g(this, S, i), t(this, Ct).call(this);
|
|
618
534
|
}
|
|
619
535
|
getRowHeight() {
|
|
620
536
|
return t(this, q);
|
|
621
537
|
}
|
|
622
538
|
templateLength(i = ".ng-container-body") {
|
|
623
539
|
var e;
|
|
624
|
-
return ((e = t(this,
|
|
540
|
+
return ((e = t(this, _).get(i)) == null ? void 0 : e.length) || 1;
|
|
541
|
+
}
|
|
542
|
+
};
|
|
543
|
+
I = new WeakMap(), S = new WeakMap(), _ = new WeakMap(), q = new WeakMap(), z = new WeakMap(), X = new WeakMap(), ft = new WeakMap(), Q = new WeakMap(), qt = new WeakMap(), Tt = new WeakMap(), kt = new WeakMap(), ut = new WeakMap(), gt = new WeakMap(), Lt = new WeakMap(), Ct = new WeakMap(), bt = new WeakMap(), Ht = new WeakMap(), tt = new WeakMap(), pt = new WeakMap(), c(ce, "RowManager");
|
|
544
|
+
let Gt = ce;
|
|
545
|
+
var Mt, et;
|
|
546
|
+
const H = class H {
|
|
547
|
+
/**
|
|
548
|
+
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
549
|
+
*/
|
|
550
|
+
static compileAll(i) {
|
|
551
|
+
return Array.isArray(i) ? i.map((e) => H.compile(e)) : [];
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
554
|
+
* π― λ¨μΌ μλ³Έ ν
μ΄λΈμ λ°μ κΈ°λ³Έ ꡬ쑰 보μ λ° 2μ°¨μ 격μ μΈλ±μ€ μ¬μ λΆμ¬ μλ£λ λ§μ€ν° ν
μ΄λΈ λ°ν
|
|
555
|
+
*/
|
|
556
|
+
static compile(i) {
|
|
557
|
+
var s, r, o, l;
|
|
558
|
+
if (!i) return null;
|
|
559
|
+
const e = i.cloneNode(!0);
|
|
560
|
+
return t(s = H, Mt).call(s, e), t(r = H, et).call(r, e, "thead"), t(o = H, et).call(o, e, "tbody"), t(l = H, et).call(l, e, "tfoot"), Array.from(e.querySelectorAll("colgroup col")).forEach((h, a) => {
|
|
561
|
+
const f = h.getAttribute("fixed");
|
|
562
|
+
f && e.querySelectorAll(`thead [data-col="${a}"], tbody [data-col="${a}"], tfoot [data-col="${a}"]`).forEach((u) => {
|
|
563
|
+
u.setAttribute("fixed", f);
|
|
564
|
+
});
|
|
565
|
+
}), e;
|
|
625
566
|
}
|
|
626
567
|
};
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
568
|
+
Mt = new WeakMap(), et = new WeakMap(), c(H, "TableCompiler"), d(H, Mt, /* @__PURE__ */ c((i) => {
|
|
569
|
+
if (!i.querySelector("colgroup")) {
|
|
570
|
+
const e = i.querySelector("tbody tr") || i.querySelector("tr"), n = e ? e.querySelectorAll("th, td").length : 1, s = document.createElement("colgroup"), r = Math.max(Math.floor(i.clientWidth / n), 100);
|
|
571
|
+
for (let o = 0; o < n; o++) {
|
|
572
|
+
const l = document.createElement("col");
|
|
573
|
+
l.setAttribute("width", r), s.appendChild(l);
|
|
574
|
+
}
|
|
575
|
+
i.prepend(s);
|
|
576
|
+
}
|
|
577
|
+
if (!i.querySelector("thead")) {
|
|
578
|
+
const e = document.createElement("thead"), n = i.querySelector("colgroup");
|
|
579
|
+
n ? n.after(e) : i.prepend(e);
|
|
580
|
+
}
|
|
581
|
+
i.classList.add("nine-table-element"), i.style.display = "table";
|
|
582
|
+
}, "#ensureTableStructure")), d(H, et, /* @__PURE__ */ c((i, e) => {
|
|
583
|
+
const n = Array.from(i.querySelectorAll(e + " tr")), s = Array.from(i.querySelectorAll(e + " th," + e + " td")), r = n.length;
|
|
584
|
+
if (r === 0 || s.length === 0) return;
|
|
585
|
+
let o = 0;
|
|
586
|
+
s.forEach((h) => {
|
|
587
|
+
o += h.colSpan || 1;
|
|
588
|
+
});
|
|
589
|
+
const l = Array.from(Array(r), () => Array(o).fill(null));
|
|
590
|
+
n.forEach((h) => {
|
|
591
|
+
const a = h.sectionRowIndex;
|
|
592
|
+
let f = 0;
|
|
593
|
+
Array.from(h.querySelectorAll("th,td")).forEach((u) => {
|
|
594
|
+
for (let m = 0; m < l[a].length; m++)
|
|
595
|
+
if (l[a][m] === null) {
|
|
596
|
+
f = m;
|
|
597
|
+
break;
|
|
598
|
+
}
|
|
599
|
+
const b = u.rowSpan || 1, p = u.colSpan || 1;
|
|
600
|
+
for (let m = 0; m < b; m++)
|
|
601
|
+
for (let R = 0; R < p; R++)
|
|
602
|
+
a + m < r && f + R < o && (l[a + m][f + R] = m === 0 && R === 0 ? "1" : "0");
|
|
603
|
+
});
|
|
604
|
+
}), n.forEach((h) => {
|
|
605
|
+
const a = h.sectionRowIndex;
|
|
606
|
+
Array.from(h.querySelectorAll("th,td")).forEach((f) => {
|
|
607
|
+
for (let u = 0; u < l[a].length; u++)
|
|
608
|
+
if (l[a][u] === "1") {
|
|
609
|
+
f.dataset.col = u, l[a][u] = "0";
|
|
610
|
+
break;
|
|
611
|
+
}
|
|
612
|
+
});
|
|
613
|
+
});
|
|
614
|
+
}, "#resetColIndex"));
|
|
615
|
+
let Jt = H;
|
|
616
|
+
var _t, U, F, It, $t, it, Wt, Ot;
|
|
617
|
+
const ct = class ct extends HTMLElement {
|
|
631
618
|
constructor() {
|
|
632
619
|
super();
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
var e,
|
|
638
|
-
t(this,
|
|
620
|
+
d(this, _t);
|
|
621
|
+
d(this, U, null);
|
|
622
|
+
d(this, F);
|
|
623
|
+
x(this, "invalidate", /* @__PURE__ */ c(() => {
|
|
624
|
+
var e, n;
|
|
625
|
+
t(this, F).refresh(), (e = this.querySelector("nine-table-hscrollbar")) == null || e.refresh(), (n = this.querySelector("nine-table-vscrollbar")) == null || n.refresh();
|
|
639
626
|
}, "invalidate"));
|
|
640
|
-
|
|
627
|
+
d(this, It, /* @__PURE__ */ c(() => {
|
|
641
628
|
[
|
|
642
629
|
{ selector: ".ng-container-body", type: null },
|
|
643
630
|
{ selector: ".ng-container-left", type: "left" },
|
|
644
631
|
{ selector: ".ng-container-right", type: "right" }
|
|
645
|
-
].forEach(({ selector:
|
|
646
|
-
const r = this.querySelector(
|
|
632
|
+
].forEach(({ selector: n, type: s }) => {
|
|
633
|
+
const r = this.querySelector(n);
|
|
647
634
|
if (!r) return;
|
|
648
|
-
const n = t(this, $t).call(this, t(this, st), o);
|
|
649
635
|
r.innerHTML = "";
|
|
636
|
+
const o = document.createElement("div");
|
|
637
|
+
o.className = "ng-part-header", o.appendChild(t(this, it).call(this, t(this, U), s, "header"));
|
|
650
638
|
const l = document.createElement("div");
|
|
651
|
-
l.className = "ng-
|
|
652
|
-
const
|
|
653
|
-
|
|
639
|
+
l.className = "ng-part-body";
|
|
640
|
+
const h = document.createElement("div");
|
|
641
|
+
h.className = "ng-scroll-content", h.style.position = "relative", h.style.width = "100%", h.appendChild(t(this, it).call(this, t(this, U), s, "body"));
|
|
642
|
+
const a = document.createElement("div");
|
|
643
|
+
a.className = "ng-virtual-spacer", a.style.width = "100%", a.style.pointerEvents = "none", h.appendChild(a), l.appendChild(h);
|
|
644
|
+
const f = document.createElement("div");
|
|
645
|
+
f.className = "ng-part-footer", f.appendChild(t(this, it).call(this, t(this, U), s, "footer")), r.appendChild(o), r.appendChild(l), r.appendChild(f);
|
|
654
646
|
});
|
|
655
647
|
}, "#renderSplitContainers"));
|
|
656
|
-
|
|
657
|
-
["left", "right"].forEach((e) => {
|
|
658
|
-
const
|
|
659
|
-
if (!s ||
|
|
648
|
+
d(this, $t, /* @__PURE__ */ c(() => {
|
|
649
|
+
["left", "right", "body"].forEach((e) => {
|
|
650
|
+
const n = this.querySelector(`.ng-container-${e}`), s = n == null ? void 0 : n.querySelectorAll("table");
|
|
651
|
+
if (!n || !s || s.length === 0) return;
|
|
660
652
|
let r = 0;
|
|
661
|
-
|
|
662
|
-
const l = parseInt(
|
|
653
|
+
s[0].querySelectorAll("col").forEach((o) => {
|
|
654
|
+
const l = parseInt(o.getAttribute("width"), 10);
|
|
663
655
|
isNaN(r) || (r += l);
|
|
664
|
-
}),
|
|
656
|
+
}), e === "body" ? n.style.flex = "1" : (n.style.flex = `0 0 ${r}px`, n.style.width = `${r}px`);
|
|
665
657
|
});
|
|
666
658
|
}, "#updateContainerWidths"));
|
|
667
|
-
|
|
668
|
-
e && (
|
|
669
|
-
var
|
|
670
|
-
|
|
671
|
-
this.querySelectorAll("tbody.fixed-tbody").forEach((r) => {
|
|
672
|
-
r.style.top = `${s}px`;
|
|
673
|
-
});
|
|
674
|
-
}), t(this, K).initialize(), setTimeout(() => {
|
|
675
|
-
var s;
|
|
676
|
-
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
659
|
+
x(this, "generate", /* @__PURE__ */ c((e) => {
|
|
660
|
+
e && (g(this, U, Jt.compile(e)), t(this, It).call(this), t(this, $t).call(this), t(this, F).initialize(), setTimeout(() => {
|
|
661
|
+
var n;
|
|
662
|
+
(n = this.querySelector("nine-table-hscrollbar")) == null || n.refresh();
|
|
677
663
|
}, 0));
|
|
678
664
|
}, "generate"));
|
|
679
|
-
|
|
680
|
-
const
|
|
681
|
-
if (
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
}) :
|
|
690
|
-
|
|
691
|
-
}),
|
|
665
|
+
d(this, it, /* @__PURE__ */ c((e, n, s) => {
|
|
666
|
+
const r = e.cloneNode(!0), o = r.querySelector("thead"), l = r.querySelector("tbody"), h = r.querySelector("tfoot");
|
|
667
|
+
if (s === "header") {
|
|
668
|
+
if (l && l.remove(), h && h.remove(), e.querySelector("tbody")) {
|
|
669
|
+
const f = document.createElement("tbody");
|
|
670
|
+
f.className = "fixed-tbody", r.appendChild(f);
|
|
671
|
+
}
|
|
672
|
+
} else s === "body" ? (o && o.remove(), h && h.remove(), l && (l.className = "bindable-tbody")) : s === "footer" && (o && o.remove(), l && l.remove());
|
|
673
|
+
return n === "left" ? r.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((a) => {
|
|
674
|
+
a.getAttribute("fixed") !== "left" && a.remove();
|
|
675
|
+
}) : n === "right" ? r.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((a) => {
|
|
676
|
+
a.getAttribute("fixed") !== "right" && a.remove();
|
|
677
|
+
}) : r.querySelectorAll("[fixed=left], [fixed=right]").forEach((a) => {
|
|
678
|
+
a.remove();
|
|
679
|
+
}), r;
|
|
692
680
|
}, "#createSplitTable"));
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
const
|
|
696
|
-
|
|
681
|
+
x(this, "getRowHeight", /* @__PURE__ */ c(() => t(this, F).getRowHeight(), "getRowHeight"));
|
|
682
|
+
x(this, "scrollToX", /* @__PURE__ */ c((e) => {
|
|
683
|
+
const n = this.querySelector(".ng-container-body .ng-part-body");
|
|
684
|
+
n && (n.scrollLeft = e);
|
|
697
685
|
}, "scrollToX"));
|
|
698
|
-
|
|
699
|
-
const
|
|
700
|
-
|
|
686
|
+
x(this, "scrollToY", /* @__PURE__ */ c((e) => {
|
|
687
|
+
const n = this.querySelector(".ng-container-body .ng-part-body");
|
|
688
|
+
n && (n.scrollTop = e);
|
|
701
689
|
}, "scrollToY"));
|
|
702
|
-
|
|
690
|
+
d(this, Wt, /* @__PURE__ */ c(() => {
|
|
703
691
|
t(this, Ot).call(this);
|
|
704
692
|
}, "#init"));
|
|
705
|
-
|
|
706
|
-
const e =
|
|
693
|
+
d(this, Ot, /* @__PURE__ */ c(() => {
|
|
694
|
+
const e = ct.SCROLLBAR_SIZE;
|
|
707
695
|
this.innerHTML = `
|
|
708
696
|
<style>
|
|
709
697
|
nine-table-sheet {
|
|
@@ -730,51 +718,56 @@ const at = class at extends HTMLElement {
|
|
|
730
718
|
overflow: hidden;
|
|
731
719
|
position: relative;
|
|
732
720
|
}
|
|
733
|
-
|
|
734
|
-
|
|
721
|
+
|
|
722
|
+
/* 9λΆν μ΄ μ»¨ν
μ΄λ κ³΅ν΅ μ€νμΌ */
|
|
723
|
+
nine-table-sheet .ng-container-left,
|
|
724
|
+
nine-table-sheet .ng-container-body,
|
|
725
|
+
nine-table-sheet .ng-container-right {
|
|
735
726
|
display: flex;
|
|
736
727
|
flex-direction: column;
|
|
737
|
-
|
|
738
|
-
overflow-x: hidden;
|
|
728
|
+
height: 100%;
|
|
739
729
|
background: #ffffff;
|
|
730
|
+
position: relative;
|
|
731
|
+
overflow: hidden;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
nine-table-sheet .ng-container-left {
|
|
740
735
|
border-right: 1px solid #e5e7eb;
|
|
741
736
|
flex-shrink: 0;
|
|
742
|
-
scrollbar-width: none;
|
|
743
|
-
&::-webkit-scrollbar { display: none; }
|
|
744
737
|
}
|
|
745
738
|
|
|
746
|
-
nine-table-sheet
|
|
747
|
-
|
|
748
|
-
top: 0;
|
|
749
|
-
z-index: 3;
|
|
750
|
-
}
|
|
751
|
-
nine-table-sheet tbody.fixed-tbody {
|
|
752
|
-
position: sticky;
|
|
753
|
-
z-index: 4;
|
|
739
|
+
nine-table-sheet .ng-container-body {
|
|
740
|
+
flex: 1;
|
|
754
741
|
}
|
|
755
742
|
|
|
756
|
-
nine-table-sheet .ng-container-
|
|
757
|
-
|
|
758
|
-
flex-
|
|
743
|
+
nine-table-sheet .ng-container-right {
|
|
744
|
+
border-left: 1px solid #e5e7eb;
|
|
745
|
+
flex-shrink: 0;
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
/* 9λΆν 3λ¨ λ μ΄μ΄ (Header / Body / Footer) */
|
|
749
|
+
nine-table-sheet .ng-part-header {
|
|
750
|
+
flex-shrink: 0;
|
|
751
|
+
overflow: hidden;
|
|
752
|
+
background: #f9fafb;
|
|
753
|
+
z-index: 3;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
nine-table-sheet .ng-part-body {
|
|
759
757
|
flex: 1;
|
|
760
758
|
overflow-y: auto;
|
|
761
759
|
overflow-x: auto;
|
|
762
|
-
background: #ffffff;
|
|
763
760
|
position: relative;
|
|
764
761
|
scrollbar-width: none;
|
|
765
762
|
&::-webkit-scrollbar { display: none; height: 0px; }
|
|
766
763
|
}
|
|
767
|
-
|
|
768
|
-
nine-table-sheet .ng-
|
|
769
|
-
display: flex;
|
|
770
|
-
flex-direction: column;
|
|
771
|
-
overflow-y: auto;
|
|
772
|
-
overflow-x: hidden;
|
|
773
|
-
background: #ffffff;
|
|
774
|
-
border-left: 1px solid #e5e7eb;
|
|
764
|
+
|
|
765
|
+
nine-table-sheet .ng-part-footer {
|
|
775
766
|
flex-shrink: 0;
|
|
776
|
-
|
|
777
|
-
|
|
767
|
+
overflow: hidden;
|
|
768
|
+
background: #f9fafb;
|
|
769
|
+
border-top: 2px solid #d1d5db;
|
|
770
|
+
z-index: 2;
|
|
778
771
|
}
|
|
779
772
|
|
|
780
773
|
nine-table-sheet .ng-container-bottom {
|
|
@@ -818,17 +811,8 @@ const at = class at extends HTMLElement {
|
|
|
818
811
|
text-align: left;
|
|
819
812
|
}
|
|
820
813
|
|
|
821
|
-
nine-table-sheet tfoot {
|
|
822
|
-
display: table-footer-group;
|
|
823
|
-
position: sticky;
|
|
824
|
-
bottom: 0;
|
|
825
|
-
z-index: 2;
|
|
826
|
-
background: #f9fafb;
|
|
827
|
-
}
|
|
828
|
-
|
|
829
814
|
nine-table-sheet tfoot td, nine-table-sheet tfoot th {
|
|
830
815
|
font-weight: 600;
|
|
831
|
-
border-top: 2px solid #d1d5db;
|
|
832
816
|
}
|
|
833
817
|
|
|
834
818
|
nine-splitter {
|
|
@@ -848,91 +832,91 @@ const at = class at extends HTMLElement {
|
|
|
848
832
|
</div>
|
|
849
833
|
`;
|
|
850
834
|
}, "#render"));
|
|
851
|
-
|
|
835
|
+
g(this, F, new Gt(this)), g(this, _t, this.getRootNode().host);
|
|
852
836
|
}
|
|
853
837
|
connectedCallback() {
|
|
854
838
|
t(this, Wt).call(this);
|
|
855
839
|
}
|
|
856
840
|
disconnectedCallback() {
|
|
857
|
-
this.innerHTML = "",
|
|
841
|
+
this.innerHTML = "", lt.log("NineTableSheet destroyed.");
|
|
858
842
|
}
|
|
859
843
|
};
|
|
860
|
-
|
|
861
|
-
let
|
|
862
|
-
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet",
|
|
844
|
+
_t = new WeakMap(), U = new WeakMap(), F = new WeakMap(), It = new WeakMap(), $t = new WeakMap(), it = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), c(ct, "NineTableSheet"), x(ct, "SCROLLBAR_SIZE", 16);
|
|
845
|
+
let St = ct;
|
|
846
|
+
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", St);
|
|
863
847
|
var zt, yt;
|
|
864
848
|
const he = class he extends HTMLElement {
|
|
865
849
|
constructor() {
|
|
866
850
|
super();
|
|
867
|
-
|
|
851
|
+
d(this, zt, /* @__PURE__ */ c(() => {
|
|
868
852
|
var e;
|
|
869
|
-
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (
|
|
870
|
-
var
|
|
871
|
-
const
|
|
872
|
-
t(this, yt).call(this, r,
|
|
853
|
+
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (n) => {
|
|
854
|
+
var o;
|
|
855
|
+
const s = n.ctrlKey || n.metaKey || n.shiftKey, r = parseInt((o = n.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
|
|
856
|
+
t(this, yt).call(this, r, s);
|
|
873
857
|
}), t(this, yt).call(this, 0, !1);
|
|
874
858
|
}, "#init"));
|
|
875
|
-
|
|
876
|
-
const
|
|
859
|
+
d(this, yt, /* @__PURE__ */ c((e, n = !1) => {
|
|
860
|
+
const s = /* @__PURE__ */ c(() => {
|
|
877
861
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
878
862
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((p) => p.style.setProperty("display", "none"));
|
|
879
|
-
const
|
|
880
|
-
|
|
881
|
-
const
|
|
882
|
-
|
|
863
|
+
const b = f.filter((p) => p.classList.contains("active"));
|
|
864
|
+
b.length < 2 || b.forEach((p) => {
|
|
865
|
+
const m = parseInt(p.getAttribute("data-index"), 10), R = this.querySelector(`nine-splitter[data-split-index="${m}"]`), G = f[m + 1];
|
|
866
|
+
R && G && G.classList.contains("active") && R.style.setProperty("display", "flex");
|
|
883
867
|
});
|
|
884
|
-
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"),
|
|
868
|
+
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), l = r.querySelectorAll(".nine-tab-item"), h = o.querySelectorAll("nine-table-sheet");
|
|
885
869
|
if (!l[e]) return;
|
|
886
|
-
if (!
|
|
870
|
+
if (!n)
|
|
887
871
|
l.forEach((f, u) => {
|
|
888
872
|
f.classList.toggle("active", u === e);
|
|
889
|
-
}),
|
|
890
|
-
const
|
|
891
|
-
f.classList.toggle("active",
|
|
873
|
+
}), h.forEach((f, u) => {
|
|
874
|
+
const b = u === e;
|
|
875
|
+
f.classList.toggle("active", b), f.style.flex = b ? "1 1 100%" : "";
|
|
892
876
|
});
|
|
893
877
|
else {
|
|
894
878
|
const f = l[e], u = r.querySelectorAll(".nine-tab-item.active");
|
|
895
879
|
if (f.classList.contains("active") && u.length <= 1)
|
|
896
880
|
return;
|
|
897
881
|
f.classList.toggle("active");
|
|
898
|
-
const
|
|
899
|
-
|
|
882
|
+
const b = o.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
883
|
+
b && (b.classList.toggle("active"), b.classList.contains("active") || (b.style.flex = ""));
|
|
900
884
|
}
|
|
901
|
-
const
|
|
902
|
-
|
|
903
|
-
f.style.flex =
|
|
904
|
-
}),
|
|
885
|
+
const a = o.querySelectorAll("nine-table-sheet.active");
|
|
886
|
+
a == null || a.forEach((f) => {
|
|
887
|
+
f.style.flex = a.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
888
|
+
}), s();
|
|
905
889
|
}, "#switchSheet"));
|
|
906
890
|
}
|
|
907
891
|
connectedCallback() {
|
|
908
892
|
t(this, zt).call(this);
|
|
909
893
|
}
|
|
910
894
|
};
|
|
911
|
-
zt = new WeakMap(), yt = new WeakMap(),
|
|
895
|
+
zt = new WeakMap(), yt = new WeakMap(), c(he, "NineTableSheets");
|
|
912
896
|
let Qt = he;
|
|
913
897
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", Qt);
|
|
914
|
-
var T, Nt,
|
|
898
|
+
var T, Nt, mt, Pt;
|
|
915
899
|
const de = class de {
|
|
916
900
|
constructor(i) {
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
t(this,
|
|
901
|
+
d(this, T);
|
|
902
|
+
d(this, Nt, /* @__PURE__ */ c(() => {
|
|
903
|
+
t(this, Pt).call(this), new ResizeObserver((i) => {
|
|
920
904
|
for (let e of i)
|
|
921
|
-
t(this, T).getAttribute("auto-height") === "true" && t(this,
|
|
905
|
+
t(this, T).getAttribute("auto-height") === "true" && t(this, mt).call(this);
|
|
922
906
|
}).observe(t(this, T));
|
|
923
907
|
}, "#init"));
|
|
924
|
-
|
|
925
|
-
var
|
|
908
|
+
d(this, mt, /* @__PURE__ */ c(() => {
|
|
909
|
+
var h, a;
|
|
926
910
|
const i = Array.from(t(this, T).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
927
911
|
if (i.length === 0) return;
|
|
928
|
-
const e = parseInt(t(this, T).getAttribute("max-display-row"), 10) || 10,
|
|
912
|
+
const e = parseInt(t(this, T).getAttribute("max-display-row"), 10) || 10, n = Math.max(...i.map((f) => f.getRowHeight())), s = (h = t(this, T).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : h.getBoundingClientRect().height, r = (a = t(this, T).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : a.getBoundingClientRect().height, o = St.SCROLLBAR_SIZE, l = e * n + s + r + o;
|
|
929
913
|
t(this, T).style.height = `${l}px`;
|
|
930
914
|
}, "#applyAutoHeight"));
|
|
931
|
-
|
|
932
|
-
const e = Array.from(t(this, T).children).filter((
|
|
933
|
-
const u = `<nine-table-sheet class="${
|
|
934
|
-
return u +
|
|
935
|
-
}).join(""),
|
|
915
|
+
d(this, Pt, /* @__PURE__ */ c(() => {
|
|
916
|
+
const e = Array.from(t(this, T).children).filter((h) => h.tagName === "TABLE"), n = t(this, T).getAttribute("auto-height") === "true", s = e.length, r = e.map((h, a) => {
|
|
917
|
+
const u = `<nine-table-sheet class="${a === 0 ? "active" : ""}" data-index="${a}"></nine-table-sheet>`, b = a < s - 1 ? `<nine-splitter class="h" data-split-index="${a}"></nine-splitter>` : "";
|
|
918
|
+
return u + b;
|
|
919
|
+
}).join(""), o = e.map((h, a) => `<div class="nine-tab-item ${a === 0 ? "active" : ""}" data-index="${a}">Sheet ${a + 1}</div>`).join("");
|
|
936
920
|
t(this, T).shadowRoot.innerHTML = `
|
|
937
921
|
<style>
|
|
938
922
|
:host {
|
|
@@ -940,7 +924,7 @@ const de = class de {
|
|
|
940
924
|
flex-direction: column;
|
|
941
925
|
position: relative;
|
|
942
926
|
overflow: hidden;
|
|
943
|
-
height: ${
|
|
927
|
+
height: ${n ? "auto" : "100%"};
|
|
944
928
|
background: #fff;
|
|
945
929
|
}
|
|
946
930
|
|
|
@@ -1016,7 +1000,7 @@ const de = class de {
|
|
|
1016
1000
|
<nine-table-sheets>
|
|
1017
1001
|
<nine-table-sheets-body>${r}</nine-table-sheets-body>
|
|
1018
1002
|
<nine-table-sheets-footer>
|
|
1019
|
-
<div class="nine-tab-bar">${
|
|
1003
|
+
<div class="nine-tab-bar">${o}</div>
|
|
1020
1004
|
<div class="sheets-counter">Total : <span id="row-count">0</span></div>
|
|
1021
1005
|
</nine-table-sheets-footer>
|
|
1022
1006
|
</nine-table-sheets>
|
|
@@ -1025,166 +1009,166 @@ const de = class de {
|
|
|
1025
1009
|
<nine-table-footer></nine-table-footer>
|
|
1026
1010
|
`;
|
|
1027
1011
|
const l = t(this, T).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1028
|
-
l == null || l.forEach((
|
|
1029
|
-
e[
|
|
1030
|
-
|
|
1012
|
+
l == null || l.forEach((h, a) => {
|
|
1013
|
+
e[a] && setTimeout(() => {
|
|
1014
|
+
h.generate(e[a]), n && t(this, mt).call(this);
|
|
1031
1015
|
});
|
|
1032
1016
|
});
|
|
1033
1017
|
}, "#render"));
|
|
1034
|
-
|
|
1018
|
+
g(this, T, i), t(this, Nt).call(this);
|
|
1035
1019
|
}
|
|
1036
1020
|
};
|
|
1037
|
-
T = new WeakMap(), Nt = new WeakMap(),
|
|
1021
|
+
T = new WeakMap(), Nt = new WeakMap(), mt = new WeakMap(), Pt = new WeakMap(), c(de, "LayoutManager");
|
|
1038
1022
|
let te = de;
|
|
1039
|
-
var
|
|
1023
|
+
var vt, nt;
|
|
1040
1024
|
const fe = class fe {
|
|
1041
1025
|
constructor(i) {
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1026
|
+
d(this, vt);
|
|
1027
|
+
d(this, nt, -1);
|
|
1028
|
+
x(this, "count", /* @__PURE__ */ c(() => t(this, vt).rawRecords.length, "count"));
|
|
1029
|
+
g(this, vt, i);
|
|
1046
1030
|
}
|
|
1047
1031
|
get at() {
|
|
1048
1032
|
return t(this, nt);
|
|
1049
1033
|
}
|
|
1050
1034
|
set at(i) {
|
|
1051
|
-
|
|
1035
|
+
g(this, nt, parseInt(i, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, nt)}"]`) && setTimeout(() => {
|
|
1052
1036
|
});
|
|
1053
1037
|
}
|
|
1054
1038
|
};
|
|
1055
|
-
|
|
1039
|
+
vt = new WeakMap(), nt = new WeakMap(), c(fe, "ngRow");
|
|
1056
1040
|
let ee = fe;
|
|
1057
|
-
var k,
|
|
1041
|
+
var k, E, L, st, Dt, N, Bt, j, xt, Yt, Vt, ot;
|
|
1058
1042
|
const C = class C {
|
|
1059
1043
|
constructor(i, e) {
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1044
|
+
d(this, k);
|
|
1045
|
+
d(this, E);
|
|
1046
|
+
d(this, L, []);
|
|
1047
|
+
d(this, st, []);
|
|
1048
|
+
d(this, Dt, 0);
|
|
1049
|
+
d(this, N, []);
|
|
1050
|
+
d(this, Bt, /* @__PURE__ */ c(() => {
|
|
1051
|
+
g(this, N, []);
|
|
1068
1052
|
const i = t(this, k).template || [];
|
|
1069
1053
|
Array.from(i).forEach((e) => {
|
|
1070
|
-
var
|
|
1071
|
-
t(this,
|
|
1072
|
-
}), (t(this,
|
|
1073
|
-
e.__ng || (e.__ng = t(this, xt).call(this)), e.__ng.height = t(this,
|
|
1054
|
+
var n;
|
|
1055
|
+
t(this, N).push(((n = e.getBoundingClientRect) == null ? void 0 : n.call(e).height) || 24);
|
|
1056
|
+
}), (t(this, E).rawRecords || []).forEach((e) => {
|
|
1057
|
+
e.__ng || (e.__ng = t(this, xt).call(this)), e.__ng.height = t(this, N).slice();
|
|
1074
1058
|
});
|
|
1075
1059
|
}, "#initialize"));
|
|
1076
|
-
|
|
1060
|
+
d(this, j, /* @__PURE__ */ c(() => {
|
|
1077
1061
|
t(this, k).shadowRoot.querySelectorAll("nine-table-sheet").forEach((i) => {
|
|
1078
1062
|
i.invalidate();
|
|
1079
1063
|
});
|
|
1080
1064
|
}, "#invalidate"));
|
|
1081
|
-
|
|
1065
|
+
x(this, "get", /* @__PURE__ */ c((i, e) => {
|
|
1082
1066
|
var r;
|
|
1083
|
-
const
|
|
1084
|
-
if (!
|
|
1085
|
-
if (i == null) return t(this,
|
|
1086
|
-
if (i < 0 || i >=
|
|
1087
|
-
const
|
|
1067
|
+
const n = this.getValidData();
|
|
1068
|
+
if (!n || n.length <= 0) return;
|
|
1069
|
+
if (i == null) return t(this, ot).call(this, n);
|
|
1070
|
+
if (i < 0 || i >= n.length) return null;
|
|
1071
|
+
const s = typeof ((r = t(this, k).fields) == null ? void 0 : r.get) == "function" ? t(this, k).fields.get() : [];
|
|
1088
1072
|
if (e != null) {
|
|
1089
|
-
const
|
|
1090
|
-
return
|
|
1073
|
+
const o = s.indexOf(e);
|
|
1074
|
+
return o >= 0 ? n[i].v[o] : null;
|
|
1091
1075
|
}
|
|
1092
|
-
return t(this,
|
|
1076
|
+
return t(this, ot).call(this, n[i]);
|
|
1093
1077
|
}, "get"));
|
|
1094
|
-
|
|
1095
|
-
this.clear(), this.add(i, !1), t(this,
|
|
1078
|
+
x(this, "set", /* @__PURE__ */ c((i) => {
|
|
1079
|
+
this.clear(), this.add(i, !1), t(this, j).call(this);
|
|
1096
1080
|
}, "set"));
|
|
1097
|
-
|
|
1081
|
+
d(this, xt, /* @__PURE__ */ c(() => ({
|
|
1098
1082
|
rowState: C.ROW_STATE.EMPTY,
|
|
1099
1083
|
deleted: !1,
|
|
1100
1084
|
filtered: !1,
|
|
1101
|
-
height: t(this,
|
|
1085
|
+
height: t(this, N).slice(),
|
|
1102
1086
|
o: {},
|
|
1103
1087
|
c: {},
|
|
1104
|
-
_: [0, 0, 0, 0, C.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this,
|
|
1088
|
+
_: [0, 0, 0, 0, C.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, N).slice(), -1, {}, {}]
|
|
1105
1089
|
}), "#getDefaultMeta"));
|
|
1106
|
-
|
|
1107
|
-
|
|
1090
|
+
x(this, "reset", /* @__PURE__ */ c(() => {
|
|
1091
|
+
g(this, L, []), g(this, st, []), t(this, j).call(this);
|
|
1108
1092
|
}, "reset"));
|
|
1109
|
-
|
|
1093
|
+
x(this, "clear", /* @__PURE__ */ c(() => {
|
|
1110
1094
|
var i;
|
|
1111
|
-
t(this,
|
|
1095
|
+
t(this, E).rawRecords = [], g(this, L, []), g(this, st, []), (i = t(this, E).viewRecords) != null && i.reset && t(this, E).viewRecords.reset();
|
|
1112
1096
|
}, "clear"));
|
|
1113
|
-
|
|
1114
|
-
var
|
|
1097
|
+
d(this, Yt, /* @__PURE__ */ c((i) => {
|
|
1098
|
+
var s;
|
|
1115
1099
|
Array.isArray(i) || (i = [i]);
|
|
1116
|
-
const e = typeof ((
|
|
1100
|
+
const e = typeof ((s = t(this, k).fields) == null ? void 0 : s.get) == "function" ? t(this, k).fields.get() : Object.keys(i[0] || {}), n = [];
|
|
1117
1101
|
return i.forEach((r) => {
|
|
1118
|
-
const
|
|
1102
|
+
const o = { v: [] };
|
|
1119
1103
|
e.forEach((l) => {
|
|
1120
|
-
|
|
1121
|
-
}),
|
|
1122
|
-
}),
|
|
1104
|
+
o.v.push(r[l] !== void 0 && r[l] !== null ? r[l] : "");
|
|
1105
|
+
}), n.push(o);
|
|
1106
|
+
}), n;
|
|
1123
1107
|
}, "#json2Array"));
|
|
1124
|
-
|
|
1108
|
+
d(this, Vt, /* @__PURE__ */ c((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1125
1109
|
e.__ng = t(this, xt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = C.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1126
1110
|
}), i), "#defaultInsert"));
|
|
1127
|
-
|
|
1111
|
+
x(this, "add", /* @__PURE__ */ c((i, e = !0) => {
|
|
1128
1112
|
i === void 0 && (i = {});
|
|
1129
|
-
const
|
|
1130
|
-
t(this,
|
|
1131
|
-
const
|
|
1132
|
-
return e ||
|
|
1133
|
-
const l = t(this,
|
|
1113
|
+
const n = t(this, Yt).call(this, i);
|
|
1114
|
+
t(this, E).rawRecords = t(this, E).rawRecords.concat(t(this, Vt).call(this, n)), this.resetRecords();
|
|
1115
|
+
const s = this.count() - 1;
|
|
1116
|
+
return e || n.forEach((r, o) => {
|
|
1117
|
+
const l = t(this, E).rawRecords[s - o];
|
|
1134
1118
|
l && (l.__ng.rowState = C.ROW_STATE.EMPTY);
|
|
1135
|
-
}), t(this,
|
|
1119
|
+
}), t(this, j).call(this), s;
|
|
1136
1120
|
}, "add"));
|
|
1137
|
-
|
|
1121
|
+
x(this, "delete", /* @__PURE__ */ c((i) => {
|
|
1138
1122
|
let e = [];
|
|
1139
|
-
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this,
|
|
1140
|
-
if (t(this, L)[
|
|
1141
|
-
const
|
|
1142
|
-
t(this, L)[
|
|
1143
|
-
r.__ng.rowid ===
|
|
1123
|
+
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this, E).host.row.at] : e = [parseInt(i, 10)], e.sort((n, s) => s - n).forEach((n) => {
|
|
1124
|
+
if (t(this, L)[n]) {
|
|
1125
|
+
const s = t(this, L)[n].__ng.rowid;
|
|
1126
|
+
t(this, L)[n].__ng.rowState === C.ROW_STATE.INSERT ? t(this, E).rawRecords = t(this, E).rawRecords.filter((r) => r.__ng.rowid !== s) : t(this, E).rawRecords.forEach((r) => {
|
|
1127
|
+
r.__ng.rowid === s && (r.__ng.deleted = !0, r.__ng.rowState = C.ROW_STATE.DELETE);
|
|
1144
1128
|
});
|
|
1145
1129
|
}
|
|
1146
|
-
}), this.resetRecords(), t(this,
|
|
1130
|
+
}), this.resetRecords(), t(this, j).call(this);
|
|
1147
1131
|
}, "delete"));
|
|
1148
|
-
|
|
1149
|
-
var
|
|
1132
|
+
x(this, "setValue", /* @__PURE__ */ c((i, e, n) => {
|
|
1133
|
+
var h;
|
|
1150
1134
|
i = parseInt(i, 10);
|
|
1151
|
-
const r = (typeof ((
|
|
1135
|
+
const r = (typeof ((h = t(this, k).fields) == null ? void 0 : h.get) == "function" ? t(this, k).fields.get() : []).indexOf(e);
|
|
1152
1136
|
if (r < 0) return;
|
|
1153
|
-
const
|
|
1154
|
-
if (!
|
|
1155
|
-
const l =
|
|
1156
|
-
l !==
|
|
1137
|
+
const o = this.getValidData()[i];
|
|
1138
|
+
if (!o) return;
|
|
1139
|
+
const l = o.v[r];
|
|
1140
|
+
l !== n && o.__ng.rowState !== C.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = l), o.__ng.rowState = C.ROW_STATE.UPDATE), o.v[r] = n;
|
|
1157
1141
|
}, "setValue"));
|
|
1158
|
-
|
|
1159
|
-
|
|
1142
|
+
x(this, "resetRecords", /* @__PURE__ */ c(() => {
|
|
1143
|
+
g(this, st, t(this, E).rawRecords.filter((i) => !i.__ng.deleted)), g(this, L, t(this, E).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, E).rawRecords.forEach((i, e) => {
|
|
1160
1144
|
i.__ng.rowidx = e;
|
|
1161
1145
|
}), t(this, L).forEach((i, e) => {
|
|
1162
1146
|
i.__ng.i = e;
|
|
1163
1147
|
});
|
|
1164
1148
|
}, "resetRecords"));
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
var
|
|
1149
|
+
x(this, "getValidData", /* @__PURE__ */ c(() => (t(this, L).length === 0 && t(this, E).rawRecords.length > 0 && this.resetRecords(), t(this, L)), "getValidData"));
|
|
1150
|
+
d(this, ot, /* @__PURE__ */ c((i) => {
|
|
1151
|
+
var o;
|
|
1168
1152
|
if (!i) return i;
|
|
1169
|
-
const e = !Array.isArray(i),
|
|
1170
|
-
const
|
|
1171
|
-
return
|
|
1172
|
-
|
|
1173
|
-
}),
|
|
1153
|
+
const e = !Array.isArray(i), n = e ? [i] : i, s = typeof ((o = t(this, k).fields) == null ? void 0 : o.get) == "function" ? t(this, k).fields.get() : [], r = n.filter((l) => !l.__ng.deleted).map((l) => {
|
|
1154
|
+
const h = {};
|
|
1155
|
+
return s.forEach((a, f) => {
|
|
1156
|
+
h[a] = l.v ? l.v[f] : l[a];
|
|
1157
|
+
}), h.__ng = l.__ng, h;
|
|
1174
1158
|
});
|
|
1175
1159
|
return e ? r[0] : r;
|
|
1176
1160
|
}, "#conv"));
|
|
1177
|
-
|
|
1178
|
-
|
|
1161
|
+
x(this, "count", /* @__PURE__ */ c(() => this.getValidData().length, "count"));
|
|
1162
|
+
g(this, k, i), g(this, E, e), t(this, Bt).call(this);
|
|
1179
1163
|
}
|
|
1180
1164
|
get source() {
|
|
1181
|
-
return t(this,
|
|
1165
|
+
return t(this, ot).call(this, t(this, E).rawRecords);
|
|
1182
1166
|
}
|
|
1183
1167
|
set source(i) {
|
|
1184
1168
|
this.clear(), this.add(i, !1);
|
|
1185
1169
|
}
|
|
1186
1170
|
get nextId() {
|
|
1187
|
-
return ++
|
|
1171
|
+
return ++xe(this, Dt)._;
|
|
1188
1172
|
}
|
|
1189
1173
|
get length() {
|
|
1190
1174
|
return t(this, L).length;
|
|
@@ -1193,8 +1177,8 @@ const C = class C {
|
|
|
1193
1177
|
return this.length;
|
|
1194
1178
|
}
|
|
1195
1179
|
};
|
|
1196
|
-
k = new WeakMap(),
|
|
1197
|
-
|
|
1180
|
+
k = new WeakMap(), E = new WeakMap(), L = new WeakMap(), st = new WeakMap(), Dt = new WeakMap(), N = new WeakMap(), Bt = new WeakMap(), j = new WeakMap(), xt = new WeakMap(), Yt = new WeakMap(), Vt = new WeakMap(), ot = new WeakMap(), c(C, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1181
|
+
x(C, "ROW_STATE", {
|
|
1198
1182
|
EMPTY: "EMPTY",
|
|
1199
1183
|
NORMAL: "NORMAL",
|
|
1200
1184
|
INSERT: "INSERT",
|
|
@@ -1202,79 +1186,79 @@ v(C, "ROW_STATE", {
|
|
|
1202
1186
|
DELETE: "DELETE"
|
|
1203
1187
|
});
|
|
1204
1188
|
let ie = C;
|
|
1205
|
-
var
|
|
1189
|
+
var K;
|
|
1206
1190
|
const ue = class ue {
|
|
1207
1191
|
constructor(i) {
|
|
1208
|
-
|
|
1209
|
-
|
|
1192
|
+
d(this, K);
|
|
1193
|
+
g(this, K, i), this.row = new ee(this), this.data = new ie(t(this, K), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1210
1194
|
var e;
|
|
1211
|
-
(e = t(this,
|
|
1195
|
+
(e = t(this, K).view) != null && e.redraw && t(this, K).view.redraw();
|
|
1212
1196
|
}, this.setDataSource = (e) => {
|
|
1213
1197
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1214
1198
|
}, this.getRowState = (e) => {
|
|
1215
|
-
var
|
|
1216
|
-
const
|
|
1217
|
-
if (!(
|
|
1218
|
-
return (r = (
|
|
1199
|
+
var s, r;
|
|
1200
|
+
const n = parseInt(e, 10);
|
|
1201
|
+
if (!(n >= this.data.count()))
|
|
1202
|
+
return (r = (s = this.data.getValidData()[n]) == null ? void 0 : s.__ng) == null ? void 0 : r.rowState;
|
|
1219
1203
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1220
1204
|
this.row.at = e;
|
|
1221
|
-
}, 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,
|
|
1222
|
-
e = parseInt(e, 10), this.data.setValue(e,
|
|
1205
|
+
}, 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, n) => this.data.get(e, n), this.setColumn = (e, n, s) => {
|
|
1206
|
+
e = parseInt(e, 10), this.data.setValue(e, n, s);
|
|
1223
1207
|
}, this.setDataSource([]);
|
|
1224
1208
|
}
|
|
1225
1209
|
};
|
|
1226
|
-
|
|
1227
|
-
let
|
|
1228
|
-
var
|
|
1229
|
-
const
|
|
1210
|
+
K = new WeakMap(), c(ue, "ngDataManager");
|
|
1211
|
+
let ne = ue;
|
|
1212
|
+
var rt, A, wt, Xt;
|
|
1213
|
+
const ge = class ge {
|
|
1230
1214
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1231
1215
|
constructor(i) {
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
i.forEach((
|
|
1236
|
-
t(this, A).some((
|
|
1237
|
-
}), t(this,
|
|
1216
|
+
d(this, rt);
|
|
1217
|
+
d(this, A, []);
|
|
1218
|
+
x(this, "add", /* @__PURE__ */ c((i, e = "string") => {
|
|
1219
|
+
i.forEach((n) => {
|
|
1220
|
+
t(this, A).some((s) => s.name === n) || t(this, A).push({ name: n, type: e });
|
|
1221
|
+
}), t(this, wt).call(this);
|
|
1238
1222
|
}, "add"));
|
|
1239
|
-
|
|
1223
|
+
d(this, wt, /* @__PURE__ */ c(() => {
|
|
1240
1224
|
const i = /* @__PURE__ */ new Map();
|
|
1241
1225
|
t(this, A).forEach((e) => {
|
|
1242
1226
|
i.set(e.name, e.type);
|
|
1243
|
-
}),
|
|
1227
|
+
}), g(this, A, Array.from(i, ([e, n]) => ({ name: e, type: n }))), g(this, A, t(this, A).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, A).sort((e, n) => e.name.length < n.name.length ? 1 : -1);
|
|
1244
1228
|
}, "#adjust"));
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
const i = Array.from(t(this,
|
|
1229
|
+
d(this, Xt, /* @__PURE__ */ c(() => {
|
|
1230
|
+
g(this, A, []), lt.log(t(this, rt).querySelectorAll("table"));
|
|
1231
|
+
const i = Array.from(t(this, rt).querySelectorAll("table"));
|
|
1248
1232
|
if (!(!i || i.length === 0)) {
|
|
1249
1233
|
for (const e of i)
|
|
1250
|
-
|
|
1251
|
-
const r =
|
|
1252
|
-
r && t(this, A).push({ name: r, type:
|
|
1253
|
-
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((
|
|
1254
|
-
$(`[${
|
|
1255
|
-
var
|
|
1256
|
-
if (
|
|
1257
|
-
const l =
|
|
1234
|
+
lt.log(e), $("[data-bind]", e).each((n, s) => {
|
|
1235
|
+
const r = s.dataset.bind, o = s.getAttribute("data-type") || "string";
|
|
1236
|
+
r && t(this, A).push({ name: r, type: o });
|
|
1237
|
+
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((n) => {
|
|
1238
|
+
$(`[${n}]`, e).each((s, r) => {
|
|
1239
|
+
var o = r.getAttribute(n);
|
|
1240
|
+
if (o.indexOf("data.") < 0) {
|
|
1241
|
+
const l = o.search(/[(]/g);
|
|
1258
1242
|
if (l > 0)
|
|
1259
1243
|
try {
|
|
1260
|
-
|
|
1244
|
+
o = String(window[o.substring(0, l).trim()]);
|
|
1261
1245
|
} catch {
|
|
1262
|
-
|
|
1246
|
+
o = "";
|
|
1263
1247
|
}
|
|
1264
1248
|
}
|
|
1265
|
-
|
|
1249
|
+
o.split("data.").forEach((l) => {
|
|
1266
1250
|
if (l.trim() != "") {
|
|
1267
|
-
const
|
|
1268
|
-
let
|
|
1269
|
-
|
|
1251
|
+
const h = l.search(/[^_A-Za-z0-9]/g);
|
|
1252
|
+
let a = "";
|
|
1253
|
+
h >= 0 ? a = l.substring(0, h) : o.startsWith("data.") && (a = l.replace("data.", "")), a && t(this, A).push({ name: a, type: "string" });
|
|
1270
1254
|
}
|
|
1271
1255
|
});
|
|
1272
1256
|
});
|
|
1273
1257
|
});
|
|
1274
|
-
t(this,
|
|
1258
|
+
t(this, wt).call(this);
|
|
1275
1259
|
}
|
|
1276
1260
|
}, "#init"));
|
|
1277
|
-
|
|
1261
|
+
g(this, rt, i), t(this, Xt).call(this);
|
|
1278
1262
|
}
|
|
1279
1263
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
1280
1264
|
get() {
|
|
@@ -1286,7 +1270,7 @@ const be = class be {
|
|
|
1286
1270
|
}
|
|
1287
1271
|
// π― νΉμ νλμ λ°μ΄ν° νμ
μ‘°ν
|
|
1288
1272
|
getType(i) {
|
|
1289
|
-
const e = t(this, A).find((
|
|
1273
|
+
const e = t(this, A).find((n) => n.name === i);
|
|
1290
1274
|
return e ? e.type : "string";
|
|
1291
1275
|
}
|
|
1292
1276
|
indexOf(i) {
|
|
@@ -1296,40 +1280,40 @@ const be = class be {
|
|
|
1296
1280
|
return t(this, A).some((e) => e.name === i);
|
|
1297
1281
|
}
|
|
1298
1282
|
};
|
|
1299
|
-
|
|
1300
|
-
let
|
|
1301
|
-
var
|
|
1302
|
-
const
|
|
1283
|
+
rt = new WeakMap(), A = new WeakMap(), wt = new WeakMap(), Xt = new WeakMap(), c(ge, "ngFields");
|
|
1284
|
+
let se = ge;
|
|
1285
|
+
var Z, Ut, Ft;
|
|
1286
|
+
const be = class be extends HTMLElement {
|
|
1303
1287
|
constructor() {
|
|
1304
1288
|
super();
|
|
1305
1289
|
//#created = false;
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
this.fields = new
|
|
1290
|
+
d(this, Z);
|
|
1291
|
+
d(this, Ut);
|
|
1292
|
+
d(this, Ft, /* @__PURE__ */ c(() => {
|
|
1293
|
+
this.fields = new se(this), g(this, Ut, new te(this)), lt.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1310
1294
|
}, "#init"));
|
|
1311
|
-
this.attachShadow({ mode: "open" }),
|
|
1295
|
+
this.attachShadow({ mode: "open" }), g(this, Z, new ne(this));
|
|
1312
1296
|
}
|
|
1313
1297
|
connectedCallback() {
|
|
1314
1298
|
t(this, Ft).call(this);
|
|
1315
1299
|
}
|
|
1316
1300
|
disconnectedCallback() {
|
|
1317
|
-
|
|
1301
|
+
lt.log("NineTable disconnected.");
|
|
1318
1302
|
}
|
|
1319
1303
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1320
1304
|
get data() {
|
|
1321
|
-
return t(this,
|
|
1305
|
+
return t(this, Z).data;
|
|
1322
1306
|
}
|
|
1323
1307
|
// π― ν(row) κ΄λ ¨ μ μ΄ μ κ·Όμ μ€ν
|
|
1324
1308
|
get row() {
|
|
1325
|
-
return t(this,
|
|
1309
|
+
return t(this, Z).row;
|
|
1326
1310
|
}
|
|
1327
1311
|
// π― μ 체 λ°μ΄ν° λ§€λμ μ κ·Ό νμν κ²½μ°
|
|
1328
1312
|
get dataManager() {
|
|
1329
|
-
return t(this,
|
|
1313
|
+
return t(this, Z);
|
|
1330
1314
|
}
|
|
1331
1315
|
};
|
|
1332
|
-
|
|
1333
|
-
let oe =
|
|
1316
|
+
Z = new WeakMap(), Ut = new WeakMap(), Ft = new WeakMap(), c(be, "NineTable");
|
|
1317
|
+
let oe = be;
|
|
1334
1318
|
customElements.get("nine-table") || customElements.define("nine-table", oe);
|
|
1335
1319
|
//# sourceMappingURL=nine-table.js.map
|