@ninebone/table 0.0.311 β 0.0.313
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 +413 -436
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +7 -7
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -1,90 +1,90 @@
|
|
|
1
1
|
var te = Object.defineProperty;
|
|
2
|
-
var ee = (
|
|
3
|
-
throw TypeError(
|
|
2
|
+
var ee = (v) => {
|
|
3
|
+
throw TypeError(v);
|
|
4
4
|
};
|
|
5
|
-
var ne = (
|
|
6
|
-
var
|
|
7
|
-
var w = (
|
|
8
|
-
var t = (
|
|
9
|
-
var se = (
|
|
5
|
+
var ne = (v, i, e) => i in v ? te(v, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : v[i] = e;
|
|
6
|
+
var c = (v, i) => te(v, "name", { value: i, configurable: !0 });
|
|
7
|
+
var w = (v, i, e) => ne(v, typeof i != "symbol" ? i + "" : i, e), ie = (v, i, e) => i.has(v) || ee("Cannot " + e);
|
|
8
|
+
var t = (v, i, e) => (ie(v, i, "read from private field"), e ? e.call(v) : i.get(v)), h = (v, i, e) => i.has(v) ? ee("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(v) : i.set(v, e), g = (v, i, e, s) => (ie(v, i, "write to private field"), s ? s.call(v, e) : i.set(v, e), e);
|
|
9
|
+
var se = (v, i, e, s) => ({
|
|
10
10
|
set _(n) {
|
|
11
|
-
|
|
11
|
+
g(v, i, n, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
|
-
return t(
|
|
14
|
+
return t(v, i, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
import { trace as oe } from "@ninebone/util";
|
|
18
|
-
const
|
|
18
|
+
const Vt = class Vt extends oe.constructor {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
|
|
24
|
-
let
|
|
25
|
-
const
|
|
26
|
-
var M,
|
|
23
|
+
c(Vt, "Trace");
|
|
24
|
+
let Mt = Vt;
|
|
25
|
+
const tt = new Mt();
|
|
26
|
+
var C, M, p, D, P, B, dt, N, ft;
|
|
27
27
|
const Xt = class Xt extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
h(this,
|
|
31
|
-
h(this,
|
|
30
|
+
h(this, C);
|
|
31
|
+
h(this, M, !1);
|
|
32
32
|
h(this, p);
|
|
33
|
+
h(this, D);
|
|
33
34
|
h(this, P);
|
|
34
35
|
h(this, B);
|
|
35
|
-
h(this,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
e && (b(this, N, new ResizeObserver(() => {
|
|
36
|
+
h(this, dt, /* @__PURE__ */ c(() => {
|
|
37
|
+
if (!t(this, C)) return;
|
|
38
|
+
const e = t(this, C).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
|
-
w(this, "refresh", /* @__PURE__ */
|
|
44
|
-
if (!t(this,
|
|
43
|
+
w(this, "refresh", /* @__PURE__ */ c(() => {
|
|
44
|
+
if (!t(this, C) || !t(this, p) || t(this, M)) return;
|
|
45
45
|
const e = t(this, p).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const n = t(this, p).track,
|
|
48
|
-
if (l !== 0 &&
|
|
49
|
-
|
|
47
|
+
const n = t(this, p).track, r = t(this, p).thumb, o = t(this, C).querySelector(".ng-container-bottom"), l = e.clientWidth, a = s.scrollWidth;
|
|
48
|
+
if (l !== 0 && a > l)
|
|
49
|
+
o && (o.style.display = "flex");
|
|
50
50
|
else {
|
|
51
|
-
|
|
51
|
+
o && (o.style.display = "none");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
54
|
const d = n.clientWidth;
|
|
55
55
|
if (d <= 0) return;
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
let
|
|
60
|
-
|
|
61
|
-
const E = d -
|
|
62
|
-
|
|
56
|
+
const f = Math.max(Math.min(d * (l / a), d), 20);
|
|
57
|
+
r.style.width = `${f}px`;
|
|
58
|
+
const u = e.scrollLeft, b = a - l;
|
|
59
|
+
let m = 0;
|
|
60
|
+
b > 0 && (m = parseInt(u / b * (d - f), 10)), m < 0 && (m = 0);
|
|
61
|
+
const E = d - f;
|
|
62
|
+
m > E && (m = E), r.style.left = `${m}px`, tt.log(m), t(this, p).left.disabled = m === 0, t(this, p).right.disabled = m >= E - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
h(this,
|
|
64
|
+
h(this, N, /* @__PURE__ */ c((e) => {
|
|
65
65
|
if (!t(this, p)) return !1;
|
|
66
66
|
const s = t(this, p).container, n = s.querySelector("table");
|
|
67
67
|
if (!n) return !1;
|
|
68
|
-
const
|
|
68
|
+
const r = t(this, p).track.getBoundingClientRect(), o = t(this, p).thumb.clientWidth;
|
|
69
69
|
let l = e;
|
|
70
70
|
l < 0 && (l = 0);
|
|
71
|
-
const
|
|
72
|
-
l >
|
|
73
|
-
const d = s.clientWidth,
|
|
74
|
-
return
|
|
71
|
+
const a = r.width - o;
|
|
72
|
+
l > a && (l = a), l = parseInt(l, 10), t(this, p).thumb.style.left = `${l}px`, t(this, p).left.disabled = l === 0, t(this, p).right.disabled = l >= a - 1;
|
|
73
|
+
const d = s.clientWidth, u = n.scrollWidth - d;
|
|
74
|
+
return a > 0 && u > 0 && (s.scrollLeft = l / a * u), l > 0 && l < a - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
h(this, ft, /* @__PURE__ */
|
|
77
|
-
const e = /* @__PURE__ */
|
|
78
|
-
clearInterval(t(this,
|
|
79
|
-
const
|
|
80
|
-
t(this,
|
|
81
|
-
clearInterval(t(this,
|
|
82
|
-
const
|
|
83
|
-
t(this,
|
|
76
|
+
h(this, ft, /* @__PURE__ */ c(() => {
|
|
77
|
+
const e = /* @__PURE__ */ c((n) => {
|
|
78
|
+
clearInterval(t(this, D)), clearInterval(t(this, P));
|
|
79
|
+
const r = parseInt(t(this, p).thumb.style.left || 0, 10);
|
|
80
|
+
t(this, N).call(this, r + n), g(this, D, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, D)), g(this, P, setInterval(() => {
|
|
82
|
+
const o = parseInt(t(this, p).thumb.style.left || 0, 10);
|
|
83
|
+
t(this, N).call(this, o + n) || clearInterval(t(this, P));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
|
-
}, "delayScroll"), s = /* @__PURE__ */
|
|
87
|
-
clearInterval(t(this,
|
|
86
|
+
}, "delayScroll"), s = /* @__PURE__ */ c(() => {
|
|
87
|
+
clearInterval(t(this, D)), clearInterval(t(this, P));
|
|
88
88
|
}, "clearTimer");
|
|
89
89
|
["mouseup", "mouseleave", "touchend"].forEach((n) => {
|
|
90
90
|
t(this, p).left.addEventListener(n, s), t(this, p).right.addEventListener(n, s), t(this, p).track.addEventListener(n, s);
|
|
@@ -95,24 +95,24 @@ const Xt = class Xt extends HTMLElement {
|
|
|
95
95
|
}), t(this, p).left.addEventListener("touchstart", () => e(-20)), t(this, p).right.addEventListener("touchstart", () => e(20)), t(this, p).track.addEventListener("mousedown", (n) => {
|
|
96
96
|
if (n.button !== 0) return;
|
|
97
97
|
n.preventDefault();
|
|
98
|
-
const
|
|
99
|
-
t(this,
|
|
98
|
+
const r = t(this, p).track.getBoundingClientRect(), o = t(this, p).thumb.clientWidth;
|
|
99
|
+
t(this, N).call(this, n.clientX - r.left - o / 2);
|
|
100
100
|
}), t(this, p).thumb.addEventListener("mousedown", (n) => {
|
|
101
101
|
if (n.button !== 0) return;
|
|
102
|
-
n.stopPropagation(), n.preventDefault(),
|
|
103
|
-
const
|
|
104
|
-
if (!t(this,
|
|
105
|
-
const
|
|
106
|
-
t(this,
|
|
107
|
-
}, "onMouseMove"),
|
|
108
|
-
|
|
102
|
+
n.stopPropagation(), n.preventDefault(), g(this, M, !0), this.shiftX = n.clientX - t(this, p).thumb.getBoundingClientRect().left;
|
|
103
|
+
const r = /* @__PURE__ */ c((l) => {
|
|
104
|
+
if (!t(this, M)) return;
|
|
105
|
+
const a = t(this, p).track.getBoundingClientRect();
|
|
106
|
+
t(this, N).call(this, l.clientX - a.left - this.shiftX);
|
|
107
|
+
}, "onMouseMove"), o = /* @__PURE__ */ c(() => {
|
|
108
|
+
g(this, M, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
|
-
document.addEventListener("mousemove",
|
|
110
|
+
document.addEventListener("mousemove", r), document.addEventListener("mouseup", o);
|
|
111
111
|
});
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
114
114
|
connectedCallback() {
|
|
115
|
-
if (
|
|
115
|
+
if (g(this, C, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, C)) return;
|
|
116
116
|
this.innerHTML = `
|
|
117
117
|
<style>
|
|
118
118
|
nine-table-hscrollbar {
|
|
@@ -176,31 +176,31 @@ const Xt = class Xt 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 s = t(this,
|
|
179
|
+
const e = /* @__PURE__ */ c(() => {
|
|
180
|
+
const s = t(this, C).querySelector(".ng-container-body");
|
|
181
181
|
if (!s) {
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
|
-
|
|
185
|
+
g(this, p, {
|
|
186
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
191
|
}), s.addEventListener("scroll", () => {
|
|
192
|
-
t(this,
|
|
192
|
+
t(this, M) || this.refresh();
|
|
193
193
|
}), t(this, ft).call(this), t(this, dt).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
|
-
|
|
202
|
-
let
|
|
203
|
-
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar",
|
|
201
|
+
C = new WeakMap(), M = new WeakMap(), p = new WeakMap(), D = new WeakMap(), P = new WeakMap(), B = new WeakMap(), dt = new WeakMap(), N = new WeakMap(), ft = new WeakMap(), c(Xt, "NineTableHScrollBar");
|
|
202
|
+
let It = Xt;
|
|
203
|
+
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", It);
|
|
204
204
|
var Y, I, S, it, st, ut;
|
|
205
205
|
const Ut = class Ut extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
@@ -213,53 +213,53 @@ const Ut = class Ut extends HTMLElement {
|
|
|
213
213
|
/**
|
|
214
214
|
* π― μ€ν¬λ‘€λ° μμΉ λ° μΈλΈ ν¬κΈ° κ°±μ
|
|
215
215
|
*/
|
|
216
|
-
w(this, "refresh", /* @__PURE__ */
|
|
216
|
+
w(this, "refresh", /* @__PURE__ */ c(() => {
|
|
217
217
|
if (!t(this, Y) || !t(this, S) || t(this, I)) return;
|
|
218
218
|
const e = t(this, S).container, s = e.querySelector("table");
|
|
219
219
|
if (!s) return;
|
|
220
|
-
const n = t(this, S).track,
|
|
221
|
-
if (l <=
|
|
222
|
-
|
|
220
|
+
const n = t(this, S).track, r = t(this, S).thumb, o = e.clientHeight, l = s.scrollHeight;
|
|
221
|
+
if (l <= o) {
|
|
222
|
+
r.style.display = "none", t(this, S).top.disabled = !0, t(this, S).bottom.disabled = !0;
|
|
223
223
|
return;
|
|
224
224
|
} else
|
|
225
|
-
|
|
226
|
-
const
|
|
227
|
-
if (
|
|
228
|
-
const d = Math.max(Math.min(
|
|
229
|
-
|
|
230
|
-
const
|
|
231
|
-
let
|
|
232
|
-
|
|
233
|
-
const
|
|
234
|
-
|
|
225
|
+
r.style.display = "block";
|
|
226
|
+
const a = n.clientHeight;
|
|
227
|
+
if (a <= 0) return;
|
|
228
|
+
const d = Math.max(Math.min(a * (o / l), a), 20);
|
|
229
|
+
r.style.height = `${d}px`;
|
|
230
|
+
const f = e.scrollTop, u = l - o;
|
|
231
|
+
let b = 0;
|
|
232
|
+
u > 0 && (b = f / u * (a - d));
|
|
233
|
+
const m = a - d;
|
|
234
|
+
b < 0 && (b = 0), b > m && (b = m), r.style.top = `${b}px`, t(this, S).top.disabled = f <= 0, t(this, S).bottom.disabled = f >= u - 1;
|
|
235
235
|
}, "refresh"));
|
|
236
|
-
h(this, ut, /* @__PURE__ */
|
|
236
|
+
h(this, ut, /* @__PURE__ */ c(() => {
|
|
237
237
|
const e = t(this, S).container;
|
|
238
238
|
e.addEventListener("scroll", () => {
|
|
239
239
|
t(this, I) || this.refresh();
|
|
240
240
|
}), t(this, S).thumb.addEventListener("mousedown", (s) => {
|
|
241
241
|
if (s.button !== 0) return;
|
|
242
|
-
s.stopPropagation(), s.preventDefault(),
|
|
243
|
-
const n = /* @__PURE__ */
|
|
242
|
+
s.stopPropagation(), s.preventDefault(), g(this, I, !0), g(this, it, s.clientY), g(this, st, e.scrollTop);
|
|
243
|
+
const n = /* @__PURE__ */ c((o) => {
|
|
244
244
|
if (!t(this, I)) return;
|
|
245
|
-
const l = t(this, S).track.getBoundingClientRect(),
|
|
246
|
-
|
|
247
|
-
const
|
|
248
|
-
if (
|
|
249
|
-
const
|
|
250
|
-
e.scrollTop = t(this, st) +
|
|
245
|
+
const l = t(this, S).track.getBoundingClientRect(), a = t(this, S).thumb.clientHeight, f = l.height - a, u = o.clientY - t(this, it), b = e.clientHeight, m = e.querySelector("table");
|
|
246
|
+
tt.log(m), tt.log(m.scrollHeight);
|
|
247
|
+
const T = m.scrollHeight - b;
|
|
248
|
+
if (f > 0 && T > 0) {
|
|
249
|
+
const z = u / f * T;
|
|
250
|
+
e.scrollTop = t(this, st) + z;
|
|
251
251
|
}
|
|
252
252
|
this.refresh();
|
|
253
|
-
}, "onMouseMove"),
|
|
254
|
-
|
|
253
|
+
}, "onMouseMove"), r = /* @__PURE__ */ c(() => {
|
|
254
|
+
g(this, I, !1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", r), this.refresh();
|
|
255
255
|
}, "onMouseUp");
|
|
256
|
-
document.addEventListener("mousemove", n), document.addEventListener("mouseup",
|
|
256
|
+
document.addEventListener("mousemove", n), document.addEventListener("mouseup", r);
|
|
257
257
|
}), t(this, S).track.addEventListener("mousedown", (s) => {
|
|
258
258
|
if (s.button !== 0 || s.target === t(this, S).thumb) return;
|
|
259
|
-
const n = t(this, S).track.getBoundingClientRect(),
|
|
260
|
-
if (
|
|
261
|
-
const
|
|
262
|
-
e.scrollTop =
|
|
259
|
+
const n = t(this, S).track.getBoundingClientRect(), r = t(this, S).thumb.clientHeight, o = s.clientY - n.top - r / 2, a = n.height - r, d = e.clientHeight, u = e.querySelector("table").scrollHeight - d;
|
|
260
|
+
if (a > 0 && u > 0) {
|
|
261
|
+
const b = Math.max(0, Math.min(1, o / a));
|
|
262
|
+
e.scrollTop = b * u;
|
|
263
263
|
}
|
|
264
264
|
this.refresh();
|
|
265
265
|
}), t(this, S).top.addEventListener("click", () => {
|
|
@@ -270,7 +270,7 @@ const Ut = class Ut extends HTMLElement {
|
|
|
270
270
|
}, "#init"));
|
|
271
271
|
}
|
|
272
272
|
connectedCallback() {
|
|
273
|
-
if (
|
|
273
|
+
if (g(this, Y, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, Y)) return;
|
|
274
274
|
this.innerHTML = `
|
|
275
275
|
<style>
|
|
276
276
|
nine-table-vscrollbar {
|
|
@@ -334,13 +334,13 @@ const Ut = class Ut extends HTMLElement {
|
|
|
334
334
|
<div class='ng-scroll-track'><div class='ng-scroll-thumb'></div></div>
|
|
335
335
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
336
336
|
`;
|
|
337
|
-
const e = /* @__PURE__ */
|
|
337
|
+
const e = /* @__PURE__ */ c(() => {
|
|
338
338
|
const s = t(this, Y).querySelector(".ng-container-body");
|
|
339
339
|
if (!s) {
|
|
340
340
|
setTimeout(e, 10);
|
|
341
341
|
return;
|
|
342
342
|
}
|
|
343
|
-
|
|
343
|
+
g(this, S, {
|
|
344
344
|
container: s,
|
|
345
345
|
track: this.querySelector(".ng-scroll-track"),
|
|
346
346
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
@@ -351,38 +351,38 @@ const Ut = class Ut extends HTMLElement {
|
|
|
351
351
|
e();
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
|
-
Y = new WeakMap(), I = new WeakMap(), S = new WeakMap(), it = new WeakMap(), st = new WeakMap(), ut = new WeakMap(),
|
|
355
|
-
let
|
|
356
|
-
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar",
|
|
357
|
-
var
|
|
358
|
-
const
|
|
354
|
+
Y = new WeakMap(), I = new WeakMap(), S = new WeakMap(), it = new WeakMap(), st = new WeakMap(), ut = new WeakMap(), c(Ut, "NineTableVScrollBar");
|
|
355
|
+
let $t = Ut;
|
|
356
|
+
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", $t);
|
|
357
|
+
var bt, K;
|
|
358
|
+
const H = class H {
|
|
359
359
|
/**
|
|
360
360
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
361
361
|
*/
|
|
362
362
|
static compileAll(i) {
|
|
363
|
-
return Array.isArray(i) ? i.map((e) =>
|
|
363
|
+
return Array.isArray(i) ? i.map((e) => H.compile(e)) : [];
|
|
364
364
|
}
|
|
365
365
|
/**
|
|
366
366
|
* π― λ¨μΌ μλ³Έ ν
μ΄λΈμ λ°μ κΈ°λ³Έ ꡬ쑰 보μ λ° 2μ°¨μ 격μ μΈλ±μ€ μ¬μ λΆμ¬ μλ£λ λ§μ€ν° ν
μ΄λΈ λ°ν
|
|
367
367
|
*/
|
|
368
368
|
static compile(i) {
|
|
369
|
-
var n,
|
|
369
|
+
var n, r, o, l;
|
|
370
370
|
if (!i) return null;
|
|
371
371
|
const e = i.cloneNode(!0);
|
|
372
|
-
return t(n =
|
|
373
|
-
const
|
|
374
|
-
|
|
375
|
-
|
|
372
|
+
return t(n = H, bt).call(n, e), t(r = H, K).call(r, e, "thead"), t(o = H, K).call(o, e, "tbody"), t(l = H, K).call(l, e, "tfoot"), Array.from(e.querySelectorAll("colgroup col")).forEach((a, d) => {
|
|
373
|
+
const f = a.getAttribute("fixed");
|
|
374
|
+
f && e.querySelectorAll(`thead [data-col="${d}"], tbody [data-col="${d}"], tfoot [data-col="${d}"]`).forEach((u) => {
|
|
375
|
+
u.setAttribute("fixed", f);
|
|
376
376
|
});
|
|
377
377
|
}), e;
|
|
378
378
|
}
|
|
379
379
|
};
|
|
380
|
-
|
|
380
|
+
bt = new WeakMap(), K = new WeakMap(), c(H, "TableCompiler"), h(H, bt, /* @__PURE__ */ c((i) => {
|
|
381
381
|
if (!i.querySelector("colgroup")) {
|
|
382
|
-
const e = i.querySelector("tbody tr") || i.querySelector("tr"), s = e ? e.querySelectorAll("th, td").length : 1, n = document.createElement("colgroup"),
|
|
383
|
-
for (let
|
|
382
|
+
const e = i.querySelector("tbody tr") || i.querySelector("tr"), s = e ? e.querySelectorAll("th, td").length : 1, n = document.createElement("colgroup"), r = Math.max(Math.floor(i.clientWidth / s), 100);
|
|
383
|
+
for (let o = 0; o < s; o++) {
|
|
384
384
|
const l = document.createElement("col");
|
|
385
|
-
l.setAttribute("width",
|
|
385
|
+
l.setAttribute("width", r), n.appendChild(l);
|
|
386
386
|
}
|
|
387
387
|
i.prepend(n);
|
|
388
388
|
}
|
|
@@ -391,214 +391,191 @@ gt = new WeakMap(), F = new WeakMap(), a(C, "TableCompiler"), h(C, gt, /* @__PUR
|
|
|
391
391
|
s ? s.after(e) : i.prepend(e);
|
|
392
392
|
}
|
|
393
393
|
i.classList.add("nine-table-element"), i.style.display = "table";
|
|
394
|
-
}, "#ensureTableStructure")), h(
|
|
395
|
-
const s = Array.from(i.querySelectorAll(e + " tr")), n = Array.from(i.querySelectorAll(e + " th," + e + " td")),
|
|
396
|
-
if (
|
|
397
|
-
let
|
|
398
|
-
n.forEach((
|
|
399
|
-
|
|
394
|
+
}, "#ensureTableStructure")), h(H, K, /* @__PURE__ */ c((i, e) => {
|
|
395
|
+
const s = Array.from(i.querySelectorAll(e + " tr")), n = Array.from(i.querySelectorAll(e + " th," + e + " td")), r = s.length;
|
|
396
|
+
if (r === 0 || n.length === 0) return;
|
|
397
|
+
let o = 0;
|
|
398
|
+
n.forEach((a) => {
|
|
399
|
+
o += a.colSpan || 1;
|
|
400
400
|
});
|
|
401
|
-
const l = Array.from(Array(
|
|
402
|
-
s.forEach((
|
|
403
|
-
const d =
|
|
404
|
-
let
|
|
405
|
-
Array.from(
|
|
401
|
+
const l = Array.from(Array(r), () => Array(o).fill(null));
|
|
402
|
+
s.forEach((a) => {
|
|
403
|
+
const d = a.sectionRowIndex;
|
|
404
|
+
let f = 0;
|
|
405
|
+
Array.from(a.querySelectorAll("th,td")).forEach((u) => {
|
|
406
406
|
for (let E = 0; E < l[d].length; E++)
|
|
407
407
|
if (l[d][E] === null) {
|
|
408
|
-
|
|
408
|
+
f = E;
|
|
409
409
|
break;
|
|
410
410
|
}
|
|
411
|
-
const
|
|
412
|
-
for (let E = 0; E <
|
|
413
|
-
for (let
|
|
414
|
-
d + E <
|
|
411
|
+
const b = u.rowSpan || 1, m = u.colSpan || 1;
|
|
412
|
+
for (let E = 0; E < b; E++)
|
|
413
|
+
for (let T = 0; T < m; T++)
|
|
414
|
+
d + E < r && f + T < o && (l[d + E][f + T] = E === 0 && T === 0 ? "1" : "0");
|
|
415
415
|
});
|
|
416
|
-
}), s.forEach((
|
|
417
|
-
const d =
|
|
418
|
-
Array.from(
|
|
419
|
-
for (let
|
|
420
|
-
if (l[d][
|
|
421
|
-
|
|
416
|
+
}), s.forEach((a) => {
|
|
417
|
+
const d = a.sectionRowIndex;
|
|
418
|
+
Array.from(a.querySelectorAll("th,td")).forEach((f) => {
|
|
419
|
+
for (let u = 0; u < l[d].length; u++)
|
|
420
|
+
if (l[d][u] === "1") {
|
|
421
|
+
f.dataset.col = u, l[d][u] = "0";
|
|
422
422
|
break;
|
|
423
423
|
}
|
|
424
424
|
});
|
|
425
425
|
});
|
|
426
426
|
}, "#resetColIndex"));
|
|
427
|
-
let Wt =
|
|
428
|
-
var
|
|
427
|
+
let Wt = H;
|
|
428
|
+
var y, _, R, $, V, j, gt, pt, nt, ot, yt, mt, rt, F, vt;
|
|
429
429
|
const Kt = class Kt {
|
|
430
430
|
constructor(i) {
|
|
431
|
-
h(this,
|
|
431
|
+
h(this, y);
|
|
432
432
|
h(this, _, /* @__PURE__ */ new Map());
|
|
433
|
-
// κ° μ»¨ν
μ΄λλ³ λ
립λ ν
νλ¦Ώ TR κ΄λ¦¬
|
|
434
433
|
h(this, R, null);
|
|
435
|
-
h(this,
|
|
436
|
-
h(this,
|
|
437
|
-
h(this,
|
|
438
|
-
|
|
439
|
-
* π― μΈλΆμμ λ°μ΄ν°κ° λ‘λλκ±°λ λ³κ²½λ ν κ°μ λμ΄μ λ·°λ₯Ό μ¬κ°±μ νλ νΌλΈλ¦ λ©μλ
|
|
440
|
-
*/
|
|
441
|
-
w(this, "refresh", /* @__PURE__ */ a(() => {
|
|
434
|
+
h(this, $, null);
|
|
435
|
+
h(this, V, 0);
|
|
436
|
+
h(this, j, 40);
|
|
437
|
+
w(this, "refresh", /* @__PURE__ */ c(() => {
|
|
442
438
|
var e;
|
|
443
|
-
const i = t(this,
|
|
444
|
-
i && (t(this, nt).call(this), t(this,
|
|
439
|
+
const i = t(this, y).querySelector(".ng-container-body");
|
|
440
|
+
i && (t(this, nt).call(this), t(this, F).call(this, i.scrollTop), (e = t(this, y).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
445
441
|
}, "refresh"));
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
b(this, R, null), t(this, _).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
452
|
-
const s = t(this, m).querySelector(e);
|
|
453
|
-
if (!s) return;
|
|
454
|
-
const n = s.querySelector("table");
|
|
455
|
-
if (!n) return;
|
|
456
|
-
const o = n.querySelector("tbody");
|
|
442
|
+
w(this, "initialize", /* @__PURE__ */ c(() => {
|
|
443
|
+
g(this, R, null), t(this, _).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
444
|
+
const r = t(this, y).querySelector(n);
|
|
445
|
+
if (!r) return;
|
|
446
|
+
const o = r.querySelector("table");
|
|
457
447
|
if (!o) return;
|
|
458
|
-
const l =
|
|
459
|
-
|
|
448
|
+
const l = o.querySelector("tbody");
|
|
449
|
+
if (!l) return;
|
|
450
|
+
const d = Array.from(l.querySelectorAll("tr")).map((f) => f.cloneNode(!0));
|
|
451
|
+
t(this, _).set(n, d);
|
|
460
452
|
});
|
|
461
|
-
const i = t(this,
|
|
453
|
+
const i = t(this, y).querySelector(".ng-container-body"), e = t(this, y).querySelector(".ng-container-left"), s = t(this, y).querySelector(".ng-container-right");
|
|
462
454
|
if (i) {
|
|
463
|
-
t(this, pt).call(this, i), t(this, rt).call(this), t(this, nt).call(this), t(this,
|
|
464
|
-
let
|
|
455
|
+
t(this, pt).call(this, i), t(this, rt).call(this), t(this, nt).call(this), t(this, F).call(this, i.scrollTop);
|
|
456
|
+
let n = i.scrollTop;
|
|
457
|
+
const r = /* @__PURE__ */ c((o) => {
|
|
458
|
+
var l;
|
|
459
|
+
e && e.scrollTop !== o && (e.scrollTop = o), s && s.scrollTop !== o && (s.scrollTop = o), t(this, F).call(this, o), (l = t(this, y).querySelector("nine-table-vscrollbar")) == null || l.refresh();
|
|
460
|
+
}, "syncScroll");
|
|
465
461
|
i.addEventListener("scroll", () => {
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
H.log(e, s), e !== s && (e = s, t(this, Z).call(this, s)), (n = t(this, m).querySelector("nine-table-vscrollbar")) == null || n.refresh();
|
|
462
|
+
const o = i.scrollTop;
|
|
463
|
+
n !== o && (n = o, r(o));
|
|
469
464
|
});
|
|
470
465
|
}
|
|
471
466
|
}, "initialize"));
|
|
472
|
-
h(this,
|
|
467
|
+
h(this, gt, /* @__PURE__ */ c((i, e) => {
|
|
473
468
|
const s = t(this, _).get(e);
|
|
474
469
|
if (!s || s.length === 0) return;
|
|
475
470
|
const n = i.querySelector("tbody");
|
|
476
471
|
if (!n) return;
|
|
477
472
|
n.querySelectorAll("tr:not(.nodata)").forEach((l) => l.remove());
|
|
478
|
-
const
|
|
479
|
-
for (let l = 0; l < t(this,
|
|
480
|
-
s.forEach((
|
|
481
|
-
|
|
473
|
+
const r = n.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
474
|
+
for (let l = 0; l < t(this, j); l++)
|
|
475
|
+
s.forEach((a) => {
|
|
476
|
+
o.appendChild(a.cloneNode(!0));
|
|
482
477
|
});
|
|
483
|
-
|
|
478
|
+
r ? r.before(o) : n.appendChild(o);
|
|
484
479
|
}, "#renderRows"));
|
|
485
|
-
|
|
486
|
-
* π― ν
νλ¦Ώ TRλ€μ μ΄ λμ΄λ₯Ό μΈ‘μ νκ³ μΊμ±
|
|
487
|
-
*/
|
|
488
|
-
h(this, pt, /* @__PURE__ */ a((i) => {
|
|
480
|
+
h(this, pt, /* @__PURE__ */ c((i) => {
|
|
489
481
|
if (t(this, R) !== null && t(this, R) > 0)
|
|
490
482
|
return t(this, R);
|
|
491
483
|
const e = t(this, _).get(".ng-container-body");
|
|
492
484
|
if (!e || e.length === 0) return 24;
|
|
493
485
|
const s = i.querySelector("tbody");
|
|
494
486
|
if (!s) return 24;
|
|
495
|
-
s.querySelectorAll("tr:not(.nodata)").forEach((
|
|
496
|
-
const n = s.querySelector("tr.nodata"),
|
|
497
|
-
e.forEach((
|
|
498
|
-
|
|
499
|
-
}), n ? n.before(
|
|
500
|
-
const
|
|
501
|
-
(l === "none" || window.getComputedStyle(
|
|
502
|
-
let
|
|
503
|
-
const
|
|
504
|
-
return
|
|
505
|
-
|
|
506
|
-
}),
|
|
487
|
+
s.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
|
|
488
|
+
const n = s.querySelector("tr.nodata"), r = document.createDocumentFragment();
|
|
489
|
+
e.forEach((b) => {
|
|
490
|
+
r.appendChild(b.cloneNode(!0));
|
|
491
|
+
}), n ? n.before(r) : s.appendChild(r);
|
|
492
|
+
const o = t(this, y), l = o.style.display, a = o.style.visibility, d = o.style.position;
|
|
493
|
+
(l === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
494
|
+
let f = 0;
|
|
495
|
+
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
496
|
+
return u.forEach((b) => {
|
|
497
|
+
f += b.offsetHeight || b.getBoundingClientRect().height;
|
|
498
|
+
}), u.forEach((b) => b.remove()), o.style.display = l, o.style.visibility = a, o.style.position = d, g(this, R, f > 0 ? f : 24), t(this, ot).call(this), t(this, R);
|
|
507
499
|
}, "#measureAndCacheHeight"));
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
var o, r, l, c;
|
|
516
|
-
if (!t(this, m).querySelector(".ng-container-body")) return;
|
|
517
|
-
const e = (typeof ((o = t(this, m).data) == null ? void 0 : o.count) == "function" ? t(this, m).data.count() : null) ?? ((l = (r = t(this, m).dataManager) == null ? void 0 : r.rawRecords) == null ? void 0 : l.length) ?? ((c = t(this, m).data) == null ? void 0 : c.length) ?? 0, s = t(this, R) || 24, n = e * s;
|
|
518
|
-
H.log(`[RowManager] TotalCount: ${e} | RowHeight: ${s}px | TotalVirtualHeight: ${n}px`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((d) => {
|
|
519
|
-
const u = t(this, m).querySelector(d), f = u == null ? void 0 : u.querySelector("table");
|
|
520
|
-
f ? (f.style.height = `${n}px`, H.log(`[RowManager] Applied height to ${d} table:`, f.style.height)) : H.log(`[RowManager] Table not found for selector: ${d}`);
|
|
500
|
+
h(this, nt, /* @__PURE__ */ c(() => {
|
|
501
|
+
var r, o, l, a;
|
|
502
|
+
if (!t(this, y).querySelector(".ng-container-body")) return;
|
|
503
|
+
const e = (typeof ((r = t(this, y).data) == null ? void 0 : r.count) == "function" ? t(this, y).data.count() : null) ?? ((l = (o = t(this, y).dataManager) == null ? void 0 : o.rawRecords) == null ? void 0 : l.length) ?? ((a = t(this, y).data) == null ? void 0 : a.length) ?? 100, s = t(this, R) || 24, n = e * s;
|
|
504
|
+
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((d) => {
|
|
505
|
+
const f = t(this, y).querySelector(d), u = f == null ? void 0 : f.querySelector("table");
|
|
506
|
+
u && (u.style.height = `${n}px`);
|
|
521
507
|
});
|
|
522
508
|
}, "#updateVirtualScrollHeight"));
|
|
523
|
-
h(this, ot, /* @__PURE__ */
|
|
524
|
-
if (t(this,
|
|
525
|
-
const i = Math.ceil(t(this,
|
|
526
|
-
|
|
509
|
+
h(this, ot, /* @__PURE__ */ c(() => {
|
|
510
|
+
if (t(this, V) > 0 && t(this, R) > 0) {
|
|
511
|
+
const i = Math.ceil(t(this, V) / t(this, R));
|
|
512
|
+
g(this, j, i + 20);
|
|
527
513
|
} else
|
|
528
|
-
|
|
514
|
+
g(this, j, 40);
|
|
529
515
|
}, "#updateRowCount"));
|
|
530
|
-
h(this, yt, /* @__PURE__ */
|
|
531
|
-
var
|
|
532
|
-
const i = t(this,
|
|
516
|
+
h(this, yt, /* @__PURE__ */ c(() => {
|
|
517
|
+
var a, d, f;
|
|
518
|
+
const i = t(this, y).querySelector(".ng-container-left table"), e = t(this, y).querySelector(".ng-container-body table"), s = t(this, y).querySelector(".ng-container-right table");
|
|
533
519
|
if (!e) return;
|
|
534
|
-
const n = i ? Array.from(i.querySelectorAll("tr")) : [],
|
|
535
|
-
for (let
|
|
536
|
-
const
|
|
537
|
-
((
|
|
538
|
-
((d =
|
|
539
|
-
((
|
|
540
|
-
],
|
|
541
|
-
|
|
520
|
+
const n = i ? Array.from(i.querySelectorAll("tr")) : [], r = Array.from(e.querySelectorAll("tr")), o = s ? Array.from(s.querySelectorAll("tr")) : [], l = Math.max(n.length, r.length, o.length);
|
|
521
|
+
for (let u = 0; u < l; u++) {
|
|
522
|
+
const b = [
|
|
523
|
+
((a = n[u]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
524
|
+
((d = r[u]) == null ? void 0 : d.getBoundingClientRect().height) || 0,
|
|
525
|
+
((f = o[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
526
|
+
], m = Math.max(...b);
|
|
527
|
+
m > 0 && (n[u] && (n[u].style.height = `${m}px`), r[u] && (r[u].style.height = `${m}px`), o[u] && (o[u].style.height = `${m}px`));
|
|
542
528
|
}
|
|
543
529
|
}, "#syncRowHeights"));
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
*/
|
|
547
|
-
h(this, mt, /* @__PURE__ */ a(() => {
|
|
548
|
-
!t(this, m) || !(t(this, m) instanceof HTMLElement) || (b(this, W, new ResizeObserver((i) => {
|
|
530
|
+
h(this, mt, /* @__PURE__ */ c(() => {
|
|
531
|
+
!t(this, y) || !(t(this, y) instanceof HTMLElement) || (g(this, $, new ResizeObserver((i) => {
|
|
549
532
|
for (const e of i) {
|
|
550
533
|
const s = e.target;
|
|
551
534
|
if (!s.classList.contains("active")) continue;
|
|
552
535
|
const n = e.contentRect.height;
|
|
553
536
|
if (n > 0) {
|
|
554
|
-
let
|
|
555
|
-
const
|
|
556
|
-
|
|
557
|
-
const l = Math.max(n -
|
|
558
|
-
t(this,
|
|
537
|
+
let r = 0;
|
|
538
|
+
const o = s.querySelector("thead");
|
|
539
|
+
o && (r += o.offsetHeight || o.getBoundingClientRect().height);
|
|
540
|
+
const l = Math.max(n - r, 100);
|
|
541
|
+
t(this, V) !== l && (g(this, V, l), t(this, ot).call(this), t(this, R) !== null && t(this, rt).call(this));
|
|
559
542
|
}
|
|
560
543
|
}
|
|
561
|
-
})), t(this,
|
|
544
|
+
})), t(this, $).observe(t(this, y)));
|
|
562
545
|
}, "#initResizeObserver"));
|
|
563
|
-
|
|
564
|
-
* π― λ°λ λ° μ’μ° κ³ μ 컨ν
μ΄λ μ 체μ κ°κ°μ λ§λ ν
νλ¦Ώ ν λΌλ μ£Όμ
|
|
565
|
-
*/
|
|
566
|
-
h(this, rt, /* @__PURE__ */ a(() => {
|
|
546
|
+
h(this, rt, /* @__PURE__ */ c(() => {
|
|
567
547
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
568
|
-
const e = t(this,
|
|
569
|
-
e && e.querySelector("tbody") && t(this,
|
|
548
|
+
const e = t(this, y).querySelector(i);
|
|
549
|
+
e && e.querySelector("tbody") && t(this, gt).call(this, e, i);
|
|
570
550
|
}), t(this, yt).call(this);
|
|
571
551
|
}, "#renderAllContainers"));
|
|
572
|
-
h(this,
|
|
573
|
-
var
|
|
552
|
+
h(this, F, /* @__PURE__ */ c((i) => {
|
|
553
|
+
var r;
|
|
574
554
|
const e = t(this, R);
|
|
575
555
|
if (!e || e <= 0) return;
|
|
576
|
-
const s = Math.max(0, Math.floor(i / e)), n = ((
|
|
577
|
-
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
578
|
-
const l = t(this,
|
|
556
|
+
const s = Math.max(0, Math.floor(i / e)), n = ((r = t(this, _).get(".ng-container-body")) == null ? void 0 : r.length) || 1;
|
|
557
|
+
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
558
|
+
const l = t(this, y).querySelector(o);
|
|
579
559
|
if (!l) return;
|
|
580
|
-
const
|
|
581
|
-
if (!
|
|
582
|
-
Array.from(
|
|
583
|
-
var E,
|
|
584
|
-
const
|
|
585
|
-
|
|
560
|
+
const a = l.querySelector("tbody");
|
|
561
|
+
if (!a) return;
|
|
562
|
+
Array.from(a.querySelectorAll("tr:not(.nodata)")).forEach((f, u) => {
|
|
563
|
+
var E, T, z, Qt;
|
|
564
|
+
const b = s + Math.floor(u / n), m = (typeof t(this, y).getData == "function" ? t(this, y).getData(b) : null) ?? (typeof ((E = t(this, y).data) == null ? void 0 : E.get) == "function" ? t(this, y).data.get(b) : null) ?? ((z = (T = t(this, y).dataManager) == null ? void 0 : T.rawRecords) == null ? void 0 : z[b]) ?? ((Qt = t(this, y).data) == null ? void 0 : Qt[b]) ?? { _index: b };
|
|
565
|
+
f.style.display = "", t(this, vt).call(this, f, m, b);
|
|
586
566
|
});
|
|
587
567
|
});
|
|
588
568
|
}, "#handleScroll"));
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
i.dataset.row = s, Array.from(i.cells).forEach((n, o) => {
|
|
594
|
-
const r = n.dataset.bind;
|
|
595
|
-
r && e && e[r] !== void 0 ? n.textContent = e[r] : n.textContent = e ? e[Object.keys(e)[o]] ?? `R${s}C${o}` : `ν ${s + 1}`, n.dataset.row = s;
|
|
569
|
+
h(this, vt, /* @__PURE__ */ c((i, e, s) => {
|
|
570
|
+
i.dataset.row = s, Array.from(i.cells).forEach((n, r) => {
|
|
571
|
+
const o = n.dataset.bind;
|
|
572
|
+
o && e && e[o] !== void 0 ? n.textContent = e[o] : n.textContent = e ? e[Object.keys(e)[r]] ?? `R${s}C${r}` : `ν ${s + 1}`, n.dataset.row = s;
|
|
596
573
|
});
|
|
597
574
|
}, "#bindRowData"));
|
|
598
|
-
w(this, "destroy", /* @__PURE__ */
|
|
599
|
-
t(this,
|
|
575
|
+
w(this, "destroy", /* @__PURE__ */ c(() => {
|
|
576
|
+
t(this, $) && (t(this, $).disconnect(), g(this, $, null));
|
|
600
577
|
}, "destroy"));
|
|
601
|
-
|
|
578
|
+
g(this, y, i), t(this, mt).call(this);
|
|
602
579
|
}
|
|
603
580
|
getRowHeight() {
|
|
604
581
|
return t(this, R);
|
|
@@ -608,39 +585,39 @@ const Kt = class Kt {
|
|
|
608
585
|
return ((e = t(this, _).get(i)) == null ? void 0 : e.length) || 1;
|
|
609
586
|
}
|
|
610
587
|
};
|
|
611
|
-
|
|
588
|
+
y = new WeakMap(), _ = new WeakMap(), R = new WeakMap(), $ = new WeakMap(), V = new WeakMap(), j = new WeakMap(), gt = new WeakMap(), pt = new WeakMap(), nt = new WeakMap(), ot = new WeakMap(), yt = new WeakMap(), mt = new WeakMap(), rt = new WeakMap(), F = new WeakMap(), vt = new WeakMap(), c(Kt, "RowManager");
|
|
612
589
|
let Ot = Kt;
|
|
613
|
-
var
|
|
590
|
+
var Z, G, xt, wt, St, Et, Rt;
|
|
614
591
|
const et = class et extends HTMLElement {
|
|
615
592
|
constructor() {
|
|
616
593
|
super();
|
|
617
|
-
h(this,
|
|
618
|
-
h(this,
|
|
619
|
-
h(this,
|
|
594
|
+
h(this, Z, null);
|
|
595
|
+
h(this, G);
|
|
596
|
+
h(this, xt, /* @__PURE__ */ c(() => {
|
|
620
597
|
[
|
|
621
598
|
{ selector: ".ng-container-body", type: null },
|
|
622
599
|
{ selector: ".ng-container-left", type: "left" },
|
|
623
600
|
{ selector: ".ng-container-right", type: "right" }
|
|
624
601
|
].forEach(({ selector: s, type: n }) => {
|
|
625
|
-
const
|
|
626
|
-
if (!
|
|
627
|
-
const
|
|
628
|
-
|
|
602
|
+
const r = this.querySelector(s);
|
|
603
|
+
if (!r) return;
|
|
604
|
+
const o = t(this, St).call(this, t(this, Z), n);
|
|
605
|
+
r.innerHTML = "", r.appendChild(o);
|
|
629
606
|
});
|
|
630
607
|
}, "#renderSplitContainers"));
|
|
631
|
-
h(this, wt, /* @__PURE__ */
|
|
608
|
+
h(this, wt, /* @__PURE__ */ c(() => {
|
|
632
609
|
["left", "right"].forEach((e) => {
|
|
633
610
|
const s = this.querySelector(`.ng-container-${e}`), n = s == null ? void 0 : s.querySelector("table");
|
|
634
611
|
if (!s || !n) return;
|
|
635
|
-
let
|
|
636
|
-
n.querySelectorAll("col").forEach((
|
|
637
|
-
const l = parseInt(
|
|
638
|
-
isNaN(
|
|
639
|
-
}), s.style.flex = `0 0 ${
|
|
612
|
+
let r = 0;
|
|
613
|
+
n.querySelectorAll("col").forEach((o) => {
|
|
614
|
+
const l = parseInt(o.getAttribute("width"), 10);
|
|
615
|
+
isNaN(r) || (r += l);
|
|
616
|
+
}), s.style.flex = `0 0 ${r}px`, s.style.width = `${r}px`;
|
|
640
617
|
});
|
|
641
618
|
}, "#updateContainerWidths"));
|
|
642
|
-
w(this, "generate", /* @__PURE__ */
|
|
643
|
-
e && (
|
|
619
|
+
w(this, "generate", /* @__PURE__ */ c((e) => {
|
|
620
|
+
e && (g(this, Z, Wt.compile(e)), t(this, Z).style.display = "table", t(this, xt).call(this), t(this, wt).call(this), t(this, G).initialize(), setTimeout(() => {
|
|
644
621
|
var s;
|
|
645
622
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
646
623
|
}, 0));
|
|
@@ -648,29 +625,29 @@ const et = class et extends HTMLElement {
|
|
|
648
625
|
/**
|
|
649
626
|
* π― λ§μ€ν° ν
μ΄λΈμ κΈ°λ°μΌλ‘ νΉμ fixed νμ
μμλ§ λ¨κΈ°λ λΆν ν¬νΌ
|
|
650
627
|
*/
|
|
651
|
-
h(this, St, /* @__PURE__ */
|
|
628
|
+
h(this, St, /* @__PURE__ */ c((e, s) => {
|
|
652
629
|
const n = e.cloneNode(!0);
|
|
653
|
-
return s === "left" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((
|
|
654
|
-
|
|
655
|
-
}) : s === "right" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((
|
|
656
|
-
|
|
657
|
-
}) : n.querySelectorAll("[fixed=left], [fixed=right]").forEach((
|
|
658
|
-
|
|
630
|
+
return s === "left" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((r) => {
|
|
631
|
+
r.getAttribute("fixed") !== "left" && r.remove();
|
|
632
|
+
}) : s === "right" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((r) => {
|
|
633
|
+
r.getAttribute("fixed") !== "right" && r.remove();
|
|
634
|
+
}) : n.querySelectorAll("[fixed=left], [fixed=right]").forEach((r) => {
|
|
635
|
+
r.remove();
|
|
659
636
|
}), n;
|
|
660
637
|
}, "#createSplitTable"));
|
|
661
|
-
w(this, "getRowHeight", /* @__PURE__ */
|
|
662
|
-
w(this, "scrollToX", /* @__PURE__ */
|
|
638
|
+
w(this, "getRowHeight", /* @__PURE__ */ c(() => t(this, G).getRowHeight(), "getRowHeight"));
|
|
639
|
+
w(this, "scrollToX", /* @__PURE__ */ c((e) => {
|
|
663
640
|
const s = this.querySelector(".ng-container-body");
|
|
664
641
|
s && (s.scrollLeft = e);
|
|
665
642
|
}, "scrollToX"));
|
|
666
|
-
w(this, "scrollToY", /* @__PURE__ */
|
|
643
|
+
w(this, "scrollToY", /* @__PURE__ */ c((e) => {
|
|
667
644
|
const s = this.querySelector(".ng-container-body");
|
|
668
645
|
s && (s.scrollTop = e);
|
|
669
646
|
}, "scrollToY"));
|
|
670
|
-
h(this, Et, /* @__PURE__ */
|
|
647
|
+
h(this, Et, /* @__PURE__ */ c(() => {
|
|
671
648
|
t(this, Rt).call(this);
|
|
672
649
|
}, "#init"));
|
|
673
|
-
h(this, Rt, /* @__PURE__ */
|
|
650
|
+
h(this, Rt, /* @__PURE__ */ c(() => {
|
|
674
651
|
const e = et.SCROLLBAR_SIZE;
|
|
675
652
|
this.innerHTML = `
|
|
676
653
|
<style>
|
|
@@ -807,92 +784,92 @@ const et = class et extends HTMLElement {
|
|
|
807
784
|
</div>
|
|
808
785
|
`;
|
|
809
786
|
}, "#render"));
|
|
810
|
-
|
|
787
|
+
g(this, G, new Ot(this));
|
|
811
788
|
}
|
|
812
789
|
connectedCallback() {
|
|
813
790
|
t(this, Et).call(this);
|
|
814
791
|
}
|
|
815
792
|
disconnectedCallback() {
|
|
816
|
-
this.innerHTML = "",
|
|
793
|
+
this.innerHTML = "", tt.log("NineTableSheet destroyed.");
|
|
817
794
|
}
|
|
818
795
|
};
|
|
819
|
-
|
|
796
|
+
Z = new WeakMap(), G = new WeakMap(), xt = new WeakMap(), wt = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), Rt = new WeakMap(), c(et, "NineTableSheet"), w(et, "SCROLLBAR_SIZE", 16);
|
|
820
797
|
let ht = et;
|
|
821
798
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", ht);
|
|
822
|
-
var
|
|
799
|
+
var kt, lt;
|
|
823
800
|
const jt = class jt extends HTMLElement {
|
|
824
801
|
constructor() {
|
|
825
802
|
super();
|
|
826
|
-
h(this,
|
|
803
|
+
h(this, kt, /* @__PURE__ */ c(() => {
|
|
827
804
|
var e;
|
|
828
805
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
829
|
-
var
|
|
830
|
-
const n = s.ctrlKey || s.metaKey || s.shiftKey,
|
|
831
|
-
t(this, lt).call(this,
|
|
806
|
+
var o;
|
|
807
|
+
const n = s.ctrlKey || s.metaKey || s.shiftKey, r = parseInt((o = s.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
|
|
808
|
+
t(this, lt).call(this, r, n);
|
|
832
809
|
}), t(this, lt).call(this, 0, !1);
|
|
833
810
|
}, "#init"));
|
|
834
|
-
h(this, lt, /* @__PURE__ */
|
|
835
|
-
const n = /* @__PURE__ */
|
|
836
|
-
const
|
|
837
|
-
Array.from(this.querySelectorAll("nine-splitter")).forEach((
|
|
838
|
-
const
|
|
839
|
-
|
|
840
|
-
const E = parseInt(
|
|
841
|
-
|
|
811
|
+
h(this, lt, /* @__PURE__ */ c((e, s = !1) => {
|
|
812
|
+
const n = /* @__PURE__ */ c(() => {
|
|
813
|
+
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
814
|
+
Array.from(this.querySelectorAll("nine-splitter")).forEach((m) => m.style.setProperty("display", "none"));
|
|
815
|
+
const b = f.filter((m) => m.classList.contains("active"));
|
|
816
|
+
b.length < 2 || b.forEach((m) => {
|
|
817
|
+
const E = parseInt(m.getAttribute("data-index"), 10), T = this.querySelector(`nine-splitter[data-split-index="${E}"]`), z = f[E + 1];
|
|
818
|
+
T && z && z.classList.contains("active") && T.style.setProperty("display", "flex");
|
|
842
819
|
});
|
|
843
|
-
}, "updateSplitters"),
|
|
820
|
+
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), l = r.querySelectorAll(".nine-tab-item"), a = o.querySelectorAll("nine-table-sheet");
|
|
844
821
|
if (!l[e]) return;
|
|
845
822
|
if (!s)
|
|
846
|
-
l.forEach((
|
|
847
|
-
|
|
848
|
-
}),
|
|
849
|
-
const
|
|
850
|
-
|
|
823
|
+
l.forEach((f, u) => {
|
|
824
|
+
f.classList.toggle("active", u === e);
|
|
825
|
+
}), a.forEach((f, u) => {
|
|
826
|
+
const b = u === e;
|
|
827
|
+
f.classList.toggle("active", b), f.style.flex = b ? "1 1 100%" : "";
|
|
851
828
|
});
|
|
852
829
|
else {
|
|
853
|
-
const
|
|
854
|
-
if (
|
|
830
|
+
const f = l[e], u = r.querySelectorAll(".nine-tab-item.active");
|
|
831
|
+
if (f.classList.contains("active") && u.length <= 1)
|
|
855
832
|
return;
|
|
856
|
-
|
|
857
|
-
const
|
|
858
|
-
|
|
833
|
+
f.classList.toggle("active");
|
|
834
|
+
const b = o.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
835
|
+
b && (b.classList.toggle("active"), b.classList.contains("active") || (b.style.flex = ""));
|
|
859
836
|
}
|
|
860
|
-
const d =
|
|
861
|
-
d == null || d.forEach((
|
|
862
|
-
|
|
837
|
+
const d = o.querySelectorAll("nine-table-sheet.active");
|
|
838
|
+
d == null || d.forEach((f) => {
|
|
839
|
+
f.style.flex = d.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
863
840
|
}), n();
|
|
864
841
|
}, "#switchSheet"));
|
|
865
842
|
}
|
|
866
843
|
connectedCallback() {
|
|
867
|
-
t(this,
|
|
844
|
+
t(this, kt).call(this);
|
|
868
845
|
}
|
|
869
846
|
};
|
|
870
|
-
|
|
847
|
+
kt = new WeakMap(), lt = new WeakMap(), c(jt, "NineTableSheets");
|
|
871
848
|
let zt = jt;
|
|
872
849
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", zt);
|
|
873
|
-
var
|
|
850
|
+
var k, Tt, ct, At;
|
|
874
851
|
const Ft = class Ft {
|
|
875
852
|
constructor(i) {
|
|
876
|
-
h(this,
|
|
877
|
-
h(this,
|
|
853
|
+
h(this, k);
|
|
854
|
+
h(this, Tt, /* @__PURE__ */ c(() => {
|
|
878
855
|
t(this, At).call(this), new ResizeObserver((i) => {
|
|
879
856
|
for (let e of i)
|
|
880
|
-
t(this,
|
|
881
|
-
}).observe(t(this,
|
|
857
|
+
t(this, k).getAttribute("auto-height") === "true" && t(this, ct).call(this);
|
|
858
|
+
}).observe(t(this, k));
|
|
882
859
|
}, "#init"));
|
|
883
|
-
h(this,
|
|
884
|
-
var
|
|
885
|
-
const i = Array.from(t(this,
|
|
860
|
+
h(this, ct, /* @__PURE__ */ c(() => {
|
|
861
|
+
var a, d;
|
|
862
|
+
const i = Array.from(t(this, k).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
886
863
|
if (i.length === 0) return;
|
|
887
|
-
const e = parseInt(t(this,
|
|
888
|
-
t(this,
|
|
864
|
+
const e = parseInt(t(this, k).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), n = (a = t(this, k).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : a.getBoundingClientRect().height, r = (d = t(this, k).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : d.getBoundingClientRect().height, o = ht.SCROLLBAR_SIZE, l = e * s + n + r + o;
|
|
865
|
+
t(this, k).style.height = `${l}px`;
|
|
889
866
|
}, "#applyAutoHeight"));
|
|
890
|
-
h(this, At, /* @__PURE__ */
|
|
891
|
-
const e = Array.from(t(this,
|
|
892
|
-
const
|
|
893
|
-
return
|
|
894
|
-
}).join(""),
|
|
895
|
-
t(this,
|
|
867
|
+
h(this, At, /* @__PURE__ */ c(() => {
|
|
868
|
+
const e = Array.from(t(this, k).children).filter((a) => a.tagName === "TABLE"), s = t(this, k).getAttribute("auto-height") === "true", n = e.length, r = e.map((a, d) => {
|
|
869
|
+
const u = `<nine-table-sheet class="${d === 0 ? "active" : ""}" data-index="${d}"></nine-table-sheet>`, b = d < n - 1 ? `<nine-splitter class="h" data-split-index="${d}"></nine-splitter>` : "";
|
|
870
|
+
return u + b;
|
|
871
|
+
}).join(""), o = e.map((a, d) => `<div class="nine-tab-item ${d === 0 ? "active" : ""}" data-index="${d}">Sheet ${d + 1}</div>`).join("");
|
|
872
|
+
t(this, k).shadowRoot.innerHTML = `
|
|
896
873
|
<style>
|
|
897
874
|
:host {
|
|
898
875
|
display: flex;
|
|
@@ -981,9 +958,9 @@ const Ft = class Ft {
|
|
|
981
958
|
<nine-table-body>
|
|
982
959
|
<nine-table-summary></nine-table-summary>
|
|
983
960
|
<nine-table-sheets>
|
|
984
|
-
<nine-table-sheets-body>${
|
|
961
|
+
<nine-table-sheets-body>${r}</nine-table-sheets-body>
|
|
985
962
|
<nine-table-sheets-footer>
|
|
986
|
-
<div class="nine-tab-bar">${
|
|
963
|
+
<div class="nine-tab-bar">${o}</div>
|
|
987
964
|
<div class="sheets-counter">Total : <span id="row-count">0</span></div>
|
|
988
965
|
</nine-table-sheets-footer>
|
|
989
966
|
</nine-table-sheets>
|
|
@@ -991,163 +968,163 @@ const Ft = class Ft {
|
|
|
991
968
|
</nine-table-body>
|
|
992
969
|
<nine-table-footer></nine-table-footer>
|
|
993
970
|
`;
|
|
994
|
-
const l = t(this,
|
|
995
|
-
l == null || l.forEach((
|
|
971
|
+
const l = t(this, k).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
972
|
+
l == null || l.forEach((a, d) => {
|
|
996
973
|
e[d] && setTimeout(() => {
|
|
997
|
-
|
|
974
|
+
a.generate(e[d]), s && t(this, ct).call(this);
|
|
998
975
|
});
|
|
999
976
|
});
|
|
1000
977
|
}, "#render"));
|
|
1001
|
-
|
|
978
|
+
g(this, k, i), t(this, Tt).call(this);
|
|
1002
979
|
}
|
|
1003
980
|
};
|
|
1004
|
-
|
|
981
|
+
k = new WeakMap(), Tt = new WeakMap(), ct = new WeakMap(), At = new WeakMap(), c(Ft, "LayoutManager");
|
|
1005
982
|
let Dt = Ft;
|
|
1006
|
-
var
|
|
983
|
+
var W, X;
|
|
1007
984
|
const Zt = class Zt {
|
|
1008
985
|
constructor(i) {
|
|
1009
|
-
h(this,
|
|
1010
|
-
h(this,
|
|
1011
|
-
w(this, "count", /* @__PURE__ */
|
|
1012
|
-
|
|
986
|
+
h(this, W);
|
|
987
|
+
h(this, X, -1);
|
|
988
|
+
w(this, "count", /* @__PURE__ */ c(() => t(this, W).rawRecords.length, "count"));
|
|
989
|
+
g(this, W, i);
|
|
1013
990
|
}
|
|
1014
991
|
get at() {
|
|
1015
|
-
return t(this,
|
|
992
|
+
return t(this, X);
|
|
1016
993
|
}
|
|
1017
994
|
set at(i) {
|
|
1018
995
|
var s, n;
|
|
1019
|
-
|
|
1020
|
-
const e = ((n = (s = t(this,
|
|
1021
|
-
e && !e.querySelector(`tbody.bindable tr[data-row="${t(this,
|
|
1022
|
-
var
|
|
1023
|
-
(
|
|
996
|
+
g(this, X, parseInt(i, 10));
|
|
997
|
+
const e = ((n = (s = t(this, W).owner).querySelector) == null ? void 0 : n.call(s, ".ng-container-body")) || t(this, W).owner.body;
|
|
998
|
+
e && !e.querySelector(`tbody.bindable tr[data-row="${t(this, X)}"]`) && setTimeout(() => {
|
|
999
|
+
var r, o;
|
|
1000
|
+
(o = (r = t(this, W).owner).scrollTo_V1) == null || o.call(r, t(this, X));
|
|
1024
1001
|
});
|
|
1025
1002
|
}
|
|
1026
1003
|
};
|
|
1027
|
-
|
|
1004
|
+
W = new WeakMap(), X = new WeakMap(), c(Zt, "ngRow");
|
|
1028
1005
|
let Pt = Zt;
|
|
1029
|
-
var A,
|
|
1006
|
+
var A, x, q, J, qt, O, Lt, at, Ht, Ct, Q;
|
|
1030
1007
|
const L = class L {
|
|
1031
1008
|
constructor(i, e) {
|
|
1032
1009
|
h(this, A);
|
|
1033
|
-
h(this,
|
|
1010
|
+
h(this, x);
|
|
1034
1011
|
h(this, q, []);
|
|
1035
|
-
h(this,
|
|
1012
|
+
h(this, J, []);
|
|
1036
1013
|
h(this, qt, 0);
|
|
1037
|
-
h(this,
|
|
1038
|
-
h(this, Lt, /* @__PURE__ */
|
|
1039
|
-
|
|
1014
|
+
h(this, O, []);
|
|
1015
|
+
h(this, Lt, /* @__PURE__ */ c(() => {
|
|
1016
|
+
g(this, O, []);
|
|
1040
1017
|
const i = t(this, A).template || [];
|
|
1041
1018
|
Array.from(i).forEach((e) => {
|
|
1042
1019
|
var s;
|
|
1043
|
-
t(this,
|
|
1044
|
-
}), (t(this,
|
|
1045
|
-
e.__ng || (e.__ng = t(this,
|
|
1020
|
+
t(this, O).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1021
|
+
}), (t(this, x).rawRecords || []).forEach((e) => {
|
|
1022
|
+
e.__ng || (e.__ng = t(this, at).call(this)), e.__ng.height = t(this, O).slice();
|
|
1046
1023
|
});
|
|
1047
1024
|
}, "#initialize"));
|
|
1048
|
-
w(this, "set", /* @__PURE__ */
|
|
1025
|
+
w(this, "set", /* @__PURE__ */ c((i) => {
|
|
1049
1026
|
this.clear(), this.add(i, !1);
|
|
1050
1027
|
}, "set"));
|
|
1051
|
-
h(this,
|
|
1028
|
+
h(this, at, /* @__PURE__ */ c(() => ({
|
|
1052
1029
|
rowState: L.ROW_STATE.EMPTY,
|
|
1053
1030
|
deleted: !1,
|
|
1054
1031
|
filtered: !1,
|
|
1055
|
-
height: t(this,
|
|
1032
|
+
height: t(this, O).slice(),
|
|
1056
1033
|
o: {},
|
|
1057
1034
|
c: {},
|
|
1058
|
-
_: [0, 0, 0, 0, L.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this,
|
|
1035
|
+
_: [0, 0, 0, 0, L.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, O).slice(), -1, {}, {}]
|
|
1059
1036
|
}), "#getDefaultMeta"));
|
|
1060
|
-
w(this, "reset", /* @__PURE__ */
|
|
1061
|
-
|
|
1037
|
+
w(this, "reset", /* @__PURE__ */ c(() => {
|
|
1038
|
+
g(this, q, []), g(this, J, []);
|
|
1062
1039
|
}, "reset"));
|
|
1063
|
-
w(this, "clear", /* @__PURE__ */
|
|
1040
|
+
w(this, "clear", /* @__PURE__ */ c(() => {
|
|
1064
1041
|
var i;
|
|
1065
|
-
t(this,
|
|
1042
|
+
t(this, x).rawRecords = [], g(this, q, []), g(this, J, []), (i = t(this, x).viewRecords) != null && i.reset && t(this, x).viewRecords.reset();
|
|
1066
1043
|
}, "clear"));
|
|
1067
|
-
h(this, Ht, /* @__PURE__ */
|
|
1044
|
+
h(this, Ht, /* @__PURE__ */ c((i) => {
|
|
1068
1045
|
var n;
|
|
1069
1046
|
Array.isArray(i) || (i = [i]);
|
|
1070
1047
|
const e = typeof ((n = t(this, A).fields) == null ? void 0 : n.get) == "function" ? t(this, A).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
1071
|
-
return i.forEach((
|
|
1072
|
-
const
|
|
1048
|
+
return i.forEach((r) => {
|
|
1049
|
+
const o = { v: [] };
|
|
1073
1050
|
e.forEach((l) => {
|
|
1074
|
-
|
|
1075
|
-
}), s.push(
|
|
1051
|
+
o.v.push(r[l] !== void 0 && r[l] !== null ? r[l] : "");
|
|
1052
|
+
}), s.push(o);
|
|
1076
1053
|
}), s;
|
|
1077
1054
|
}, "#json2Array"));
|
|
1078
|
-
h(this, Ct, /* @__PURE__ */
|
|
1079
|
-
e.__ng = t(this,
|
|
1055
|
+
h(this, Ct, /* @__PURE__ */ c((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1056
|
+
e.__ng = t(this, at).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = L.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1080
1057
|
}), i), "#defaultInsert"));
|
|
1081
|
-
w(this, "add", /* @__PURE__ */
|
|
1082
|
-
var
|
|
1058
|
+
w(this, "add", /* @__PURE__ */ c((i, e = !0) => {
|
|
1059
|
+
var r;
|
|
1083
1060
|
i === void 0 && (i = {});
|
|
1084
1061
|
const s = t(this, Ht).call(this, i);
|
|
1085
|
-
t(this,
|
|
1062
|
+
t(this, x).rawRecords = t(this, x).rawRecords.concat(t(this, Ct).call(this, s)), this.resetRecords();
|
|
1086
1063
|
const n = this.count() - 1;
|
|
1087
|
-
return e || s.forEach((
|
|
1088
|
-
const
|
|
1089
|
-
|
|
1090
|
-
}), (
|
|
1064
|
+
return e || s.forEach((o, l) => {
|
|
1065
|
+
const a = t(this, x).rawRecords[n - l];
|
|
1066
|
+
a && (a.__ng.rowState = L.ROW_STATE.EMPTY);
|
|
1067
|
+
}), (r = t(this, x).viewRecords) != null && r.reset && t(this, x).viewRecords.reset(), n;
|
|
1091
1068
|
}, "add"));
|
|
1092
|
-
w(this, "delete", /* @__PURE__ */
|
|
1069
|
+
w(this, "delete", /* @__PURE__ */ c((i) => {
|
|
1093
1070
|
var s;
|
|
1094
1071
|
let e = [];
|
|
1095
|
-
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this,
|
|
1072
|
+
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this, x).owner.row.at] : e = [parseInt(i, 10)], e.sort((n, r) => r - n).forEach((n) => {
|
|
1096
1073
|
if (t(this, q)[n]) {
|
|
1097
|
-
const
|
|
1098
|
-
t(this, q)[n].__ng.rowState === L.ROW_STATE.INSERT ? t(this,
|
|
1099
|
-
|
|
1074
|
+
const r = t(this, q)[n].__ng.rowid;
|
|
1075
|
+
t(this, q)[n].__ng.rowState === L.ROW_STATE.INSERT ? t(this, x).rawRecords = t(this, x).rawRecords.filter((o) => o.__ng.rowid !== r) : t(this, x).rawRecords.forEach((o) => {
|
|
1076
|
+
o.__ng.rowid === r && (o.__ng.deleted = !0, o.__ng.rowState = L.ROW_STATE.DELETE);
|
|
1100
1077
|
});
|
|
1101
1078
|
}
|
|
1102
|
-
}), this.resetRecords(), (s = t(this,
|
|
1079
|
+
}), this.resetRecords(), (s = t(this, x).viewRecords) != null && s.reset && t(this, x).viewRecords.reset();
|
|
1103
1080
|
}, "delete"));
|
|
1104
|
-
w(this, "setValue", /* @__PURE__ */
|
|
1105
|
-
var
|
|
1081
|
+
w(this, "setValue", /* @__PURE__ */ c((i, e, s) => {
|
|
1082
|
+
var a;
|
|
1106
1083
|
i = parseInt(i, 10);
|
|
1107
|
-
const
|
|
1108
|
-
if (
|
|
1109
|
-
const
|
|
1110
|
-
if (!
|
|
1111
|
-
const l =
|
|
1112
|
-
l !== s &&
|
|
1084
|
+
const r = (typeof ((a = t(this, A).fields) == null ? void 0 : a.get) == "function" ? t(this, A).fields.get() : []).indexOf(e);
|
|
1085
|
+
if (r < 0) return;
|
|
1086
|
+
const o = this.getValidData()[i];
|
|
1087
|
+
if (!o) return;
|
|
1088
|
+
const l = o.v[r];
|
|
1089
|
+
l !== s && o.__ng.rowState !== L.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = l), o.__ng.rowState = L.ROW_STATE.UPDATE), o.v[r] = s, t(this, x).owner.refreshData && t(this, x).owner.refreshData(i);
|
|
1113
1090
|
}, "setValue"));
|
|
1114
|
-
w(this, "resetRecords", /* @__PURE__ */
|
|
1115
|
-
|
|
1091
|
+
w(this, "resetRecords", /* @__PURE__ */ c(() => {
|
|
1092
|
+
g(this, J, t(this, x).rawRecords.filter((i) => !i.__ng.deleted)), g(this, q, t(this, x).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, x).rawRecords.forEach((i, e) => {
|
|
1116
1093
|
i.__ng.rowidx = e;
|
|
1117
1094
|
}), t(this, q).forEach((i, e) => {
|
|
1118
1095
|
i.__ng.i = e;
|
|
1119
1096
|
});
|
|
1120
1097
|
}, "resetRecords"));
|
|
1121
|
-
w(this, "getValidData", /* @__PURE__ */
|
|
1122
|
-
h(this,
|
|
1098
|
+
w(this, "getValidData", /* @__PURE__ */ c(() => (t(this, q).length === 0 && t(this, x).rawRecords.length > 0 && this.resetRecords(), t(this, q)), "getValidData"));
|
|
1099
|
+
h(this, Q, /* @__PURE__ */ c((i) => {
|
|
1123
1100
|
var s;
|
|
1124
1101
|
if (!i) return i;
|
|
1125
1102
|
const e = typeof ((s = t(this, A).fields) == null ? void 0 : s.get) == "function" ? t(this, A).fields.get() : [];
|
|
1126
1103
|
return Array.isArray(i) ? i.filter((n) => !n.__ng.deleted).map((n) => {
|
|
1127
|
-
const
|
|
1128
|
-
return e.forEach((
|
|
1129
|
-
o
|
|
1130
|
-
}),
|
|
1104
|
+
const r = {};
|
|
1105
|
+
return e.forEach((o, l) => {
|
|
1106
|
+
r[o] = n.v ? n.v[l] : n[o];
|
|
1107
|
+
}), r.__ng = n.__ng, r;
|
|
1131
1108
|
}) : i;
|
|
1132
1109
|
}, "#conv2"));
|
|
1133
|
-
w(this, "count", /* @__PURE__ */
|
|
1134
|
-
w(this, "get", /* @__PURE__ */
|
|
1135
|
-
var
|
|
1110
|
+
w(this, "count", /* @__PURE__ */ c(() => this.getValidData().length, "count"));
|
|
1111
|
+
w(this, "get", /* @__PURE__ */ c((i, e) => {
|
|
1112
|
+
var r;
|
|
1136
1113
|
const s = this.getValidData();
|
|
1137
1114
|
if (!s || s.length <= 0) return;
|
|
1138
|
-
if (i == null) return t(this,
|
|
1115
|
+
if (i == null) return t(this, Q).call(this, s);
|
|
1139
1116
|
if (i < 0 || i >= s.length) return null;
|
|
1140
|
-
const n = typeof ((
|
|
1117
|
+
const n = typeof ((r = t(this, A).fields) == null ? void 0 : r.get) == "function" ? t(this, A).fields.get() : [];
|
|
1141
1118
|
if (e != null) {
|
|
1142
|
-
const
|
|
1143
|
-
return
|
|
1119
|
+
const o = n.indexOf(e);
|
|
1120
|
+
return o >= 0 ? s[i].v[o] : null;
|
|
1144
1121
|
}
|
|
1145
|
-
return t(this,
|
|
1122
|
+
return t(this, Q).call(this, s[i]);
|
|
1146
1123
|
}, "get"));
|
|
1147
|
-
|
|
1124
|
+
g(this, A, i), g(this, x, e), t(this, Lt).call(this);
|
|
1148
1125
|
}
|
|
1149
1126
|
get source() {
|
|
1150
|
-
return t(this,
|
|
1127
|
+
return t(this, Q).call(this, t(this, x).rawRecords);
|
|
1151
1128
|
}
|
|
1152
1129
|
set source(i) {
|
|
1153
1130
|
this.clear(), this.add(i, !1);
|
|
@@ -1162,7 +1139,7 @@ const L = class L {
|
|
|
1162
1139
|
return this.length;
|
|
1163
1140
|
}
|
|
1164
1141
|
};
|
|
1165
|
-
A = new WeakMap(),
|
|
1142
|
+
A = new WeakMap(), x = new WeakMap(), q = new WeakMap(), J = new WeakMap(), qt = new WeakMap(), O = new WeakMap(), Lt = new WeakMap(), at = new WeakMap(), Ht = new WeakMap(), Ct = new WeakMap(), Q = new WeakMap(), c(L, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1166
1143
|
w(L, "ROW_STATE", {
|
|
1167
1144
|
EMPTY: "EMPTY",
|
|
1168
1145
|
NORMAL: "NORMAL",
|
|
@@ -1179,10 +1156,10 @@ const Gt = class Gt {
|
|
|
1179
1156
|
}, this.setDataSource = (e) => {
|
|
1180
1157
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1181
1158
|
}, this.getRowState = (e) => {
|
|
1182
|
-
var n,
|
|
1159
|
+
var n, r;
|
|
1183
1160
|
const s = parseInt(e, 10);
|
|
1184
1161
|
if (!(s >= this.data.count()))
|
|
1185
|
-
return (
|
|
1162
|
+
return (r = (n = this.data.getValidData()[s]) == null ? void 0 : n.__ng) == null ? void 0 : r.rowState;
|
|
1186
1163
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1187
1164
|
this.row.at = e;
|
|
1188
1165
|
}, 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) => {
|
|
@@ -1190,37 +1167,37 @@ const Gt = class Gt {
|
|
|
1190
1167
|
}, this.setDataSource([]);
|
|
1191
1168
|
}
|
|
1192
1169
|
};
|
|
1193
|
-
|
|
1170
|
+
c(Gt, "ngDataManager");
|
|
1194
1171
|
let Nt = Gt;
|
|
1195
|
-
var
|
|
1172
|
+
var U, _t;
|
|
1196
1173
|
const Jt = class Jt extends HTMLElement {
|
|
1197
1174
|
constructor() {
|
|
1198
1175
|
super();
|
|
1199
1176
|
//#created = false;
|
|
1200
|
-
h(this,
|
|
1201
|
-
h(this,
|
|
1202
|
-
this.attachShadow({ mode: "open" }),
|
|
1177
|
+
h(this, U);
|
|
1178
|
+
h(this, _t);
|
|
1179
|
+
this.attachShadow({ mode: "open" }), g(this, U, new Nt(this));
|
|
1203
1180
|
}
|
|
1204
1181
|
connectedCallback() {
|
|
1205
|
-
|
|
1182
|
+
g(this, _t, new Dt(this)), tt.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1206
1183
|
}
|
|
1207
1184
|
disconnectedCallback() {
|
|
1208
|
-
|
|
1185
|
+
tt.log("NineTable disconnected.");
|
|
1209
1186
|
}
|
|
1210
1187
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1211
1188
|
get data() {
|
|
1212
|
-
return t(this,
|
|
1189
|
+
return t(this, U).data;
|
|
1213
1190
|
}
|
|
1214
1191
|
// π― ν(row) κ΄λ ¨ μ μ΄ μ κ·Όμ μ€ν
|
|
1215
1192
|
get row() {
|
|
1216
|
-
return t(this,
|
|
1193
|
+
return t(this, U).row;
|
|
1217
1194
|
}
|
|
1218
1195
|
// π― μ 체 λ°μ΄ν° λ§€λμ μ κ·Ό νμν κ²½μ°
|
|
1219
1196
|
get dataManager() {
|
|
1220
|
-
return t(this,
|
|
1197
|
+
return t(this, U);
|
|
1221
1198
|
}
|
|
1222
1199
|
};
|
|
1223
|
-
|
|
1224
|
-
let
|
|
1225
|
-
customElements.get("nine-table") || customElements.define("nine-table",
|
|
1200
|
+
U = new WeakMap(), _t = new WeakMap(), c(Jt, "NineTable");
|
|
1201
|
+
let Yt = Jt;
|
|
1202
|
+
customElements.get("nine-table") || customElements.define("nine-table", Yt);
|
|
1226
1203
|
//# sourceMappingURL=nine-table.js.map
|