@ninebone/table 0.0.312 β 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 +405 -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 C,
|
|
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
30
|
h(this, C);
|
|
31
|
-
h(this,
|
|
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
|
-
h(this, dt, /* @__PURE__ */ a(() => {
|
|
36
|
+
h(this, dt, /* @__PURE__ */ c(() => {
|
|
37
37
|
if (!t(this, C)) return;
|
|
38
38
|
const e = t(this, C).querySelector(".ng-container-body");
|
|
39
|
-
e && (
|
|
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, C) || !t(this, p) || 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__ */
|
|
179
|
+
const e = /* @__PURE__ */ c(() => {
|
|
180
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
|
-
C = new WeakMap(),
|
|
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,10 +351,10 @@ 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
|
|
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
358
|
const H = class H {
|
|
359
359
|
/**
|
|
360
360
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
@@ -366,23 +366,23 @@ const H = class H {
|
|
|
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 = H,
|
|
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,222 +391,191 @@ gt = new WeakMap(), F = new WeakMap(), a(H, "TableCompiler"), h(H, 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(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
427
|
let Wt = H;
|
|
428
|
-
var
|
|
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
|
|
465
|
-
const
|
|
466
|
-
var
|
|
467
|
-
|
|
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();
|
|
468
460
|
}, "syncScroll");
|
|
469
461
|
i.addEventListener("scroll", () => {
|
|
470
|
-
const
|
|
471
|
-
|
|
472
|
-
}), [leftContainer, rightContainer].forEach((n) => {
|
|
473
|
-
n && n.addEventListener("scroll", () => {
|
|
474
|
-
const o = n.scrollTop;
|
|
475
|
-
i.scrollTop !== o && (i.scrollTop = o, e = o, s(o));
|
|
476
|
-
});
|
|
462
|
+
const o = i.scrollTop;
|
|
463
|
+
n !== o && (n = o, r(o));
|
|
477
464
|
});
|
|
478
465
|
}
|
|
479
466
|
}, "initialize"));
|
|
480
|
-
h(this,
|
|
467
|
+
h(this, gt, /* @__PURE__ */ c((i, e) => {
|
|
481
468
|
const s = t(this, _).get(e);
|
|
482
469
|
if (!s || s.length === 0) return;
|
|
483
470
|
const n = i.querySelector("tbody");
|
|
484
471
|
if (!n) return;
|
|
485
472
|
n.querySelectorAll("tr:not(.nodata)").forEach((l) => l.remove());
|
|
486
|
-
const
|
|
487
|
-
for (let l = 0; l < t(this,
|
|
488
|
-
s.forEach((
|
|
489
|
-
|
|
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));
|
|
490
477
|
});
|
|
491
|
-
|
|
478
|
+
r ? r.before(o) : n.appendChild(o);
|
|
492
479
|
}, "#renderRows"));
|
|
493
|
-
|
|
494
|
-
* π― ν
νλ¦Ώ TRλ€μ μ΄ λμ΄λ₯Ό μΈ‘μ νκ³ μΊμ±
|
|
495
|
-
*/
|
|
496
|
-
h(this, pt, /* @__PURE__ */ a((i) => {
|
|
480
|
+
h(this, pt, /* @__PURE__ */ c((i) => {
|
|
497
481
|
if (t(this, R) !== null && t(this, R) > 0)
|
|
498
482
|
return t(this, R);
|
|
499
483
|
const e = t(this, _).get(".ng-container-body");
|
|
500
484
|
if (!e || e.length === 0) return 24;
|
|
501
485
|
const s = i.querySelector("tbody");
|
|
502
486
|
if (!s) return 24;
|
|
503
|
-
s.querySelectorAll("tr:not(.nodata)").forEach((
|
|
504
|
-
const n = s.querySelector("tr.nodata"),
|
|
505
|
-
e.forEach((
|
|
506
|
-
|
|
507
|
-
}), n ? n.before(
|
|
508
|
-
const
|
|
509
|
-
(l === "none" || window.getComputedStyle(
|
|
510
|
-
let
|
|
511
|
-
const
|
|
512
|
-
return
|
|
513
|
-
|
|
514
|
-
}),
|
|
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);
|
|
515
499
|
}, "#measureAndCacheHeight"));
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
var o, r, l, c;
|
|
524
|
-
if (!t(this, m).querySelector(".ng-container-body")) return;
|
|
525
|
-
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;
|
|
526
|
-
M.log(`[RowManager] TotalCount: ${e} | RowHeight: ${s}px | TotalVirtualHeight: ${n}px`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((d) => {
|
|
527
|
-
const u = t(this, m).querySelector(d), f = u == null ? void 0 : u.querySelector("table");
|
|
528
|
-
f ? (f.style.height = `${n}px`, M.log(`[RowManager] Applied height to ${d} table:`, f.style.height)) : M.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`);
|
|
529
507
|
});
|
|
530
508
|
}, "#updateVirtualScrollHeight"));
|
|
531
|
-
h(this, ot, /* @__PURE__ */
|
|
532
|
-
if (t(this,
|
|
533
|
-
const i = Math.ceil(t(this,
|
|
534
|
-
|
|
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);
|
|
535
513
|
} else
|
|
536
|
-
|
|
514
|
+
g(this, j, 40);
|
|
537
515
|
}, "#updateRowCount"));
|
|
538
|
-
h(this, yt, /* @__PURE__ */
|
|
539
|
-
var
|
|
540
|
-
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");
|
|
541
519
|
if (!e) return;
|
|
542
|
-
const n = i ? Array.from(i.querySelectorAll("tr")) : [],
|
|
543
|
-
for (let
|
|
544
|
-
const
|
|
545
|
-
((
|
|
546
|
-
((d =
|
|
547
|
-
((
|
|
548
|
-
],
|
|
549
|
-
|
|
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`));
|
|
550
528
|
}
|
|
551
529
|
}, "#syncRowHeights"));
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
*/
|
|
555
|
-
h(this, mt, /* @__PURE__ */ a(() => {
|
|
556
|
-
!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) => {
|
|
557
532
|
for (const e of i) {
|
|
558
533
|
const s = e.target;
|
|
559
534
|
if (!s.classList.contains("active")) continue;
|
|
560
535
|
const n = e.contentRect.height;
|
|
561
536
|
if (n > 0) {
|
|
562
|
-
let
|
|
563
|
-
const
|
|
564
|
-
|
|
565
|
-
const l = Math.max(n -
|
|
566
|
-
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));
|
|
567
542
|
}
|
|
568
543
|
}
|
|
569
|
-
})), t(this,
|
|
544
|
+
})), t(this, $).observe(t(this, y)));
|
|
570
545
|
}, "#initResizeObserver"));
|
|
571
|
-
|
|
572
|
-
* π― λ°λ λ° μ’μ° κ³ μ 컨ν
μ΄λ μ 체μ κ°κ°μ λ§λ ν
νλ¦Ώ ν λΌλ μ£Όμ
|
|
573
|
-
*/
|
|
574
|
-
h(this, rt, /* @__PURE__ */ a(() => {
|
|
546
|
+
h(this, rt, /* @__PURE__ */ c(() => {
|
|
575
547
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
576
|
-
const e = t(this,
|
|
577
|
-
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);
|
|
578
550
|
}), t(this, yt).call(this);
|
|
579
551
|
}, "#renderAllContainers"));
|
|
580
|
-
h(this,
|
|
581
|
-
var
|
|
552
|
+
h(this, F, /* @__PURE__ */ c((i) => {
|
|
553
|
+
var r;
|
|
582
554
|
const e = t(this, R);
|
|
583
555
|
if (!e || e <= 0) return;
|
|
584
|
-
const s = Math.max(0, Math.floor(i / e)), n = ((
|
|
585
|
-
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
586
|
-
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);
|
|
587
559
|
if (!l) return;
|
|
588
|
-
const
|
|
589
|
-
if (!
|
|
590
|
-
Array.from(
|
|
591
|
-
var E,
|
|
592
|
-
const
|
|
593
|
-
|
|
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);
|
|
594
566
|
});
|
|
595
567
|
});
|
|
596
568
|
}, "#handleScroll"));
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
i.dataset.row = s, Array.from(i.cells).forEach((n, o) => {
|
|
602
|
-
const r = n.dataset.bind;
|
|
603
|
-
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;
|
|
604
573
|
});
|
|
605
574
|
}, "#bindRowData"));
|
|
606
|
-
w(this, "destroy", /* @__PURE__ */
|
|
607
|
-
t(this,
|
|
575
|
+
w(this, "destroy", /* @__PURE__ */ c(() => {
|
|
576
|
+
t(this, $) && (t(this, $).disconnect(), g(this, $, null));
|
|
608
577
|
}, "destroy"));
|
|
609
|
-
|
|
578
|
+
g(this, y, i), t(this, mt).call(this);
|
|
610
579
|
}
|
|
611
580
|
getRowHeight() {
|
|
612
581
|
return t(this, R);
|
|
@@ -616,39 +585,39 @@ const Kt = class Kt {
|
|
|
616
585
|
return ((e = t(this, _).get(i)) == null ? void 0 : e.length) || 1;
|
|
617
586
|
}
|
|
618
587
|
};
|
|
619
|
-
|
|
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");
|
|
620
589
|
let Ot = Kt;
|
|
621
|
-
var
|
|
590
|
+
var Z, G, xt, wt, St, Et, Rt;
|
|
622
591
|
const et = class et extends HTMLElement {
|
|
623
592
|
constructor() {
|
|
624
593
|
super();
|
|
625
|
-
h(this,
|
|
626
|
-
h(this,
|
|
627
|
-
h(this,
|
|
594
|
+
h(this, Z, null);
|
|
595
|
+
h(this, G);
|
|
596
|
+
h(this, xt, /* @__PURE__ */ c(() => {
|
|
628
597
|
[
|
|
629
598
|
{ selector: ".ng-container-body", type: null },
|
|
630
599
|
{ selector: ".ng-container-left", type: "left" },
|
|
631
600
|
{ selector: ".ng-container-right", type: "right" }
|
|
632
601
|
].forEach(({ selector: s, type: n }) => {
|
|
633
|
-
const
|
|
634
|
-
if (!
|
|
635
|
-
const
|
|
636
|
-
|
|
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);
|
|
637
606
|
});
|
|
638
607
|
}, "#renderSplitContainers"));
|
|
639
|
-
h(this, wt, /* @__PURE__ */
|
|
608
|
+
h(this, wt, /* @__PURE__ */ c(() => {
|
|
640
609
|
["left", "right"].forEach((e) => {
|
|
641
610
|
const s = this.querySelector(`.ng-container-${e}`), n = s == null ? void 0 : s.querySelector("table");
|
|
642
611
|
if (!s || !n) return;
|
|
643
|
-
let
|
|
644
|
-
n.querySelectorAll("col").forEach((
|
|
645
|
-
const l = parseInt(
|
|
646
|
-
isNaN(
|
|
647
|
-
}), 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`;
|
|
648
617
|
});
|
|
649
618
|
}, "#updateContainerWidths"));
|
|
650
|
-
w(this, "generate", /* @__PURE__ */
|
|
651
|
-
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(() => {
|
|
652
621
|
var s;
|
|
653
622
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
654
623
|
}, 0));
|
|
@@ -656,29 +625,29 @@ const et = class et extends HTMLElement {
|
|
|
656
625
|
/**
|
|
657
626
|
* π― λ§μ€ν° ν
μ΄λΈμ κΈ°λ°μΌλ‘ νΉμ fixed νμ
μμλ§ λ¨κΈ°λ λΆν ν¬νΌ
|
|
658
627
|
*/
|
|
659
|
-
h(this, St, /* @__PURE__ */
|
|
628
|
+
h(this, St, /* @__PURE__ */ c((e, s) => {
|
|
660
629
|
const n = e.cloneNode(!0);
|
|
661
|
-
return s === "left" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((
|
|
662
|
-
|
|
663
|
-
}) : s === "right" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((
|
|
664
|
-
|
|
665
|
-
}) : n.querySelectorAll("[fixed=left], [fixed=right]").forEach((
|
|
666
|
-
|
|
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();
|
|
667
636
|
}), n;
|
|
668
637
|
}, "#createSplitTable"));
|
|
669
|
-
w(this, "getRowHeight", /* @__PURE__ */
|
|
670
|
-
w(this, "scrollToX", /* @__PURE__ */
|
|
638
|
+
w(this, "getRowHeight", /* @__PURE__ */ c(() => t(this, G).getRowHeight(), "getRowHeight"));
|
|
639
|
+
w(this, "scrollToX", /* @__PURE__ */ c((e) => {
|
|
671
640
|
const s = this.querySelector(".ng-container-body");
|
|
672
641
|
s && (s.scrollLeft = e);
|
|
673
642
|
}, "scrollToX"));
|
|
674
|
-
w(this, "scrollToY", /* @__PURE__ */
|
|
643
|
+
w(this, "scrollToY", /* @__PURE__ */ c((e) => {
|
|
675
644
|
const s = this.querySelector(".ng-container-body");
|
|
676
645
|
s && (s.scrollTop = e);
|
|
677
646
|
}, "scrollToY"));
|
|
678
|
-
h(this, Et, /* @__PURE__ */
|
|
647
|
+
h(this, Et, /* @__PURE__ */ c(() => {
|
|
679
648
|
t(this, Rt).call(this);
|
|
680
649
|
}, "#init"));
|
|
681
|
-
h(this, Rt, /* @__PURE__ */
|
|
650
|
+
h(this, Rt, /* @__PURE__ */ c(() => {
|
|
682
651
|
const e = et.SCROLLBAR_SIZE;
|
|
683
652
|
this.innerHTML = `
|
|
684
653
|
<style>
|
|
@@ -815,92 +784,92 @@ const et = class et extends HTMLElement {
|
|
|
815
784
|
</div>
|
|
816
785
|
`;
|
|
817
786
|
}, "#render"));
|
|
818
|
-
|
|
787
|
+
g(this, G, new Ot(this));
|
|
819
788
|
}
|
|
820
789
|
connectedCallback() {
|
|
821
790
|
t(this, Et).call(this);
|
|
822
791
|
}
|
|
823
792
|
disconnectedCallback() {
|
|
824
|
-
this.innerHTML = "",
|
|
793
|
+
this.innerHTML = "", tt.log("NineTableSheet destroyed.");
|
|
825
794
|
}
|
|
826
795
|
};
|
|
827
|
-
|
|
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);
|
|
828
797
|
let ht = et;
|
|
829
798
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", ht);
|
|
830
|
-
var
|
|
799
|
+
var kt, lt;
|
|
831
800
|
const jt = class jt extends HTMLElement {
|
|
832
801
|
constructor() {
|
|
833
802
|
super();
|
|
834
|
-
h(this,
|
|
803
|
+
h(this, kt, /* @__PURE__ */ c(() => {
|
|
835
804
|
var e;
|
|
836
805
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
837
|
-
var
|
|
838
|
-
const n = s.ctrlKey || s.metaKey || s.shiftKey,
|
|
839
|
-
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);
|
|
840
809
|
}), t(this, lt).call(this, 0, !1);
|
|
841
810
|
}, "#init"));
|
|
842
|
-
h(this, lt, /* @__PURE__ */
|
|
843
|
-
const n = /* @__PURE__ */
|
|
844
|
-
const
|
|
845
|
-
Array.from(this.querySelectorAll("nine-splitter")).forEach((
|
|
846
|
-
const
|
|
847
|
-
|
|
848
|
-
const E = parseInt(
|
|
849
|
-
|
|
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");
|
|
850
819
|
});
|
|
851
|
-
}, "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");
|
|
852
821
|
if (!l[e]) return;
|
|
853
822
|
if (!s)
|
|
854
|
-
l.forEach((
|
|
855
|
-
|
|
856
|
-
}),
|
|
857
|
-
const
|
|
858
|
-
|
|
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%" : "";
|
|
859
828
|
});
|
|
860
829
|
else {
|
|
861
|
-
const
|
|
862
|
-
if (
|
|
830
|
+
const f = l[e], u = r.querySelectorAll(".nine-tab-item.active");
|
|
831
|
+
if (f.classList.contains("active") && u.length <= 1)
|
|
863
832
|
return;
|
|
864
|
-
|
|
865
|
-
const
|
|
866
|
-
|
|
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 = ""));
|
|
867
836
|
}
|
|
868
|
-
const d =
|
|
869
|
-
d == null || d.forEach((
|
|
870
|
-
|
|
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%";
|
|
871
840
|
}), n();
|
|
872
841
|
}, "#switchSheet"));
|
|
873
842
|
}
|
|
874
843
|
connectedCallback() {
|
|
875
|
-
t(this,
|
|
844
|
+
t(this, kt).call(this);
|
|
876
845
|
}
|
|
877
846
|
};
|
|
878
|
-
|
|
847
|
+
kt = new WeakMap(), lt = new WeakMap(), c(jt, "NineTableSheets");
|
|
879
848
|
let zt = jt;
|
|
880
849
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", zt);
|
|
881
|
-
var
|
|
850
|
+
var k, Tt, ct, At;
|
|
882
851
|
const Ft = class Ft {
|
|
883
852
|
constructor(i) {
|
|
884
|
-
h(this,
|
|
885
|
-
h(this,
|
|
853
|
+
h(this, k);
|
|
854
|
+
h(this, Tt, /* @__PURE__ */ c(() => {
|
|
886
855
|
t(this, At).call(this), new ResizeObserver((i) => {
|
|
887
856
|
for (let e of i)
|
|
888
|
-
t(this,
|
|
889
|
-
}).observe(t(this,
|
|
857
|
+
t(this, k).getAttribute("auto-height") === "true" && t(this, ct).call(this);
|
|
858
|
+
}).observe(t(this, k));
|
|
890
859
|
}, "#init"));
|
|
891
|
-
h(this,
|
|
892
|
-
var
|
|
893
|
-
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"));
|
|
894
863
|
if (i.length === 0) return;
|
|
895
|
-
const e = parseInt(t(this,
|
|
896
|
-
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`;
|
|
897
866
|
}, "#applyAutoHeight"));
|
|
898
|
-
h(this, At, /* @__PURE__ */
|
|
899
|
-
const e = Array.from(t(this,
|
|
900
|
-
const
|
|
901
|
-
return
|
|
902
|
-
}).join(""),
|
|
903
|
-
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 = `
|
|
904
873
|
<style>
|
|
905
874
|
:host {
|
|
906
875
|
display: flex;
|
|
@@ -989,9 +958,9 @@ const Ft = class Ft {
|
|
|
989
958
|
<nine-table-body>
|
|
990
959
|
<nine-table-summary></nine-table-summary>
|
|
991
960
|
<nine-table-sheets>
|
|
992
|
-
<nine-table-sheets-body>${
|
|
961
|
+
<nine-table-sheets-body>${r}</nine-table-sheets-body>
|
|
993
962
|
<nine-table-sheets-footer>
|
|
994
|
-
<div class="nine-tab-bar">${
|
|
963
|
+
<div class="nine-tab-bar">${o}</div>
|
|
995
964
|
<div class="sheets-counter">Total : <span id="row-count">0</span></div>
|
|
996
965
|
</nine-table-sheets-footer>
|
|
997
966
|
</nine-table-sheets>
|
|
@@ -999,163 +968,163 @@ const Ft = class Ft {
|
|
|
999
968
|
</nine-table-body>
|
|
1000
969
|
<nine-table-footer></nine-table-footer>
|
|
1001
970
|
`;
|
|
1002
|
-
const l = t(this,
|
|
1003
|
-
l == null || l.forEach((
|
|
971
|
+
const l = t(this, k).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
972
|
+
l == null || l.forEach((a, d) => {
|
|
1004
973
|
e[d] && setTimeout(() => {
|
|
1005
|
-
|
|
974
|
+
a.generate(e[d]), s && t(this, ct).call(this);
|
|
1006
975
|
});
|
|
1007
976
|
});
|
|
1008
977
|
}, "#render"));
|
|
1009
|
-
|
|
978
|
+
g(this, k, i), t(this, Tt).call(this);
|
|
1010
979
|
}
|
|
1011
980
|
};
|
|
1012
|
-
|
|
981
|
+
k = new WeakMap(), Tt = new WeakMap(), ct = new WeakMap(), At = new WeakMap(), c(Ft, "LayoutManager");
|
|
1013
982
|
let Dt = Ft;
|
|
1014
|
-
var
|
|
983
|
+
var W, X;
|
|
1015
984
|
const Zt = class Zt {
|
|
1016
985
|
constructor(i) {
|
|
1017
|
-
h(this,
|
|
1018
|
-
h(this,
|
|
1019
|
-
w(this, "count", /* @__PURE__ */
|
|
1020
|
-
|
|
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);
|
|
1021
990
|
}
|
|
1022
991
|
get at() {
|
|
1023
|
-
return t(this,
|
|
992
|
+
return t(this, X);
|
|
1024
993
|
}
|
|
1025
994
|
set at(i) {
|
|
1026
995
|
var s, n;
|
|
1027
|
-
|
|
1028
|
-
const e = ((n = (s = t(this,
|
|
1029
|
-
e && !e.querySelector(`tbody.bindable tr[data-row="${t(this,
|
|
1030
|
-
var
|
|
1031
|
-
(
|
|
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));
|
|
1032
1001
|
});
|
|
1033
1002
|
}
|
|
1034
1003
|
};
|
|
1035
|
-
|
|
1004
|
+
W = new WeakMap(), X = new WeakMap(), c(Zt, "ngRow");
|
|
1036
1005
|
let Pt = Zt;
|
|
1037
|
-
var A,
|
|
1006
|
+
var A, x, q, J, qt, O, Lt, at, Ht, Ct, Q;
|
|
1038
1007
|
const L = class L {
|
|
1039
1008
|
constructor(i, e) {
|
|
1040
1009
|
h(this, A);
|
|
1041
|
-
h(this,
|
|
1010
|
+
h(this, x);
|
|
1042
1011
|
h(this, q, []);
|
|
1043
|
-
h(this,
|
|
1012
|
+
h(this, J, []);
|
|
1044
1013
|
h(this, qt, 0);
|
|
1045
|
-
h(this,
|
|
1046
|
-
h(this, Lt, /* @__PURE__ */
|
|
1047
|
-
|
|
1014
|
+
h(this, O, []);
|
|
1015
|
+
h(this, Lt, /* @__PURE__ */ c(() => {
|
|
1016
|
+
g(this, O, []);
|
|
1048
1017
|
const i = t(this, A).template || [];
|
|
1049
1018
|
Array.from(i).forEach((e) => {
|
|
1050
1019
|
var s;
|
|
1051
|
-
t(this,
|
|
1052
|
-
}), (t(this,
|
|
1053
|
-
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();
|
|
1054
1023
|
});
|
|
1055
1024
|
}, "#initialize"));
|
|
1056
|
-
w(this, "set", /* @__PURE__ */
|
|
1025
|
+
w(this, "set", /* @__PURE__ */ c((i) => {
|
|
1057
1026
|
this.clear(), this.add(i, !1);
|
|
1058
1027
|
}, "set"));
|
|
1059
|
-
h(this,
|
|
1028
|
+
h(this, at, /* @__PURE__ */ c(() => ({
|
|
1060
1029
|
rowState: L.ROW_STATE.EMPTY,
|
|
1061
1030
|
deleted: !1,
|
|
1062
1031
|
filtered: !1,
|
|
1063
|
-
height: t(this,
|
|
1032
|
+
height: t(this, O).slice(),
|
|
1064
1033
|
o: {},
|
|
1065
1034
|
c: {},
|
|
1066
|
-
_: [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, {}, {}]
|
|
1067
1036
|
}), "#getDefaultMeta"));
|
|
1068
|
-
w(this, "reset", /* @__PURE__ */
|
|
1069
|
-
|
|
1037
|
+
w(this, "reset", /* @__PURE__ */ c(() => {
|
|
1038
|
+
g(this, q, []), g(this, J, []);
|
|
1070
1039
|
}, "reset"));
|
|
1071
|
-
w(this, "clear", /* @__PURE__ */
|
|
1040
|
+
w(this, "clear", /* @__PURE__ */ c(() => {
|
|
1072
1041
|
var i;
|
|
1073
|
-
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();
|
|
1074
1043
|
}, "clear"));
|
|
1075
|
-
h(this, Ht, /* @__PURE__ */
|
|
1044
|
+
h(this, Ht, /* @__PURE__ */ c((i) => {
|
|
1076
1045
|
var n;
|
|
1077
1046
|
Array.isArray(i) || (i = [i]);
|
|
1078
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 = [];
|
|
1079
|
-
return i.forEach((
|
|
1080
|
-
const
|
|
1048
|
+
return i.forEach((r) => {
|
|
1049
|
+
const o = { v: [] };
|
|
1081
1050
|
e.forEach((l) => {
|
|
1082
|
-
|
|
1083
|
-
}), s.push(
|
|
1051
|
+
o.v.push(r[l] !== void 0 && r[l] !== null ? r[l] : "");
|
|
1052
|
+
}), s.push(o);
|
|
1084
1053
|
}), s;
|
|
1085
1054
|
}, "#json2Array"));
|
|
1086
|
-
h(this, Ct, /* @__PURE__ */
|
|
1087
|
-
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;
|
|
1088
1057
|
}), i), "#defaultInsert"));
|
|
1089
|
-
w(this, "add", /* @__PURE__ */
|
|
1090
|
-
var
|
|
1058
|
+
w(this, "add", /* @__PURE__ */ c((i, e = !0) => {
|
|
1059
|
+
var r;
|
|
1091
1060
|
i === void 0 && (i = {});
|
|
1092
1061
|
const s = t(this, Ht).call(this, i);
|
|
1093
|
-
t(this,
|
|
1062
|
+
t(this, x).rawRecords = t(this, x).rawRecords.concat(t(this, Ct).call(this, s)), this.resetRecords();
|
|
1094
1063
|
const n = this.count() - 1;
|
|
1095
|
-
return e || s.forEach((
|
|
1096
|
-
const
|
|
1097
|
-
|
|
1098
|
-
}), (
|
|
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;
|
|
1099
1068
|
}, "add"));
|
|
1100
|
-
w(this, "delete", /* @__PURE__ */
|
|
1069
|
+
w(this, "delete", /* @__PURE__ */ c((i) => {
|
|
1101
1070
|
var s;
|
|
1102
1071
|
let e = [];
|
|
1103
|
-
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) => {
|
|
1104
1073
|
if (t(this, q)[n]) {
|
|
1105
|
-
const
|
|
1106
|
-
t(this, q)[n].__ng.rowState === L.ROW_STATE.INSERT ? t(this,
|
|
1107
|
-
|
|
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);
|
|
1108
1077
|
});
|
|
1109
1078
|
}
|
|
1110
|
-
}), this.resetRecords(), (s = t(this,
|
|
1079
|
+
}), this.resetRecords(), (s = t(this, x).viewRecords) != null && s.reset && t(this, x).viewRecords.reset();
|
|
1111
1080
|
}, "delete"));
|
|
1112
|
-
w(this, "setValue", /* @__PURE__ */
|
|
1113
|
-
var
|
|
1081
|
+
w(this, "setValue", /* @__PURE__ */ c((i, e, s) => {
|
|
1082
|
+
var a;
|
|
1114
1083
|
i = parseInt(i, 10);
|
|
1115
|
-
const
|
|
1116
|
-
if (
|
|
1117
|
-
const
|
|
1118
|
-
if (!
|
|
1119
|
-
const l =
|
|
1120
|
-
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);
|
|
1121
1090
|
}, "setValue"));
|
|
1122
|
-
w(this, "resetRecords", /* @__PURE__ */
|
|
1123
|
-
|
|
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) => {
|
|
1124
1093
|
i.__ng.rowidx = e;
|
|
1125
1094
|
}), t(this, q).forEach((i, e) => {
|
|
1126
1095
|
i.__ng.i = e;
|
|
1127
1096
|
});
|
|
1128
1097
|
}, "resetRecords"));
|
|
1129
|
-
w(this, "getValidData", /* @__PURE__ */
|
|
1130
|
-
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) => {
|
|
1131
1100
|
var s;
|
|
1132
1101
|
if (!i) return i;
|
|
1133
1102
|
const e = typeof ((s = t(this, A).fields) == null ? void 0 : s.get) == "function" ? t(this, A).fields.get() : [];
|
|
1134
1103
|
return Array.isArray(i) ? i.filter((n) => !n.__ng.deleted).map((n) => {
|
|
1135
|
-
const
|
|
1136
|
-
return e.forEach((
|
|
1137
|
-
o
|
|
1138
|
-
}),
|
|
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;
|
|
1139
1108
|
}) : i;
|
|
1140
1109
|
}, "#conv2"));
|
|
1141
|
-
w(this, "count", /* @__PURE__ */
|
|
1142
|
-
w(this, "get", /* @__PURE__ */
|
|
1143
|
-
var
|
|
1110
|
+
w(this, "count", /* @__PURE__ */ c(() => this.getValidData().length, "count"));
|
|
1111
|
+
w(this, "get", /* @__PURE__ */ c((i, e) => {
|
|
1112
|
+
var r;
|
|
1144
1113
|
const s = this.getValidData();
|
|
1145
1114
|
if (!s || s.length <= 0) return;
|
|
1146
|
-
if (i == null) return t(this,
|
|
1115
|
+
if (i == null) return t(this, Q).call(this, s);
|
|
1147
1116
|
if (i < 0 || i >= s.length) return null;
|
|
1148
|
-
const n = typeof ((
|
|
1117
|
+
const n = typeof ((r = t(this, A).fields) == null ? void 0 : r.get) == "function" ? t(this, A).fields.get() : [];
|
|
1149
1118
|
if (e != null) {
|
|
1150
|
-
const
|
|
1151
|
-
return
|
|
1119
|
+
const o = n.indexOf(e);
|
|
1120
|
+
return o >= 0 ? s[i].v[o] : null;
|
|
1152
1121
|
}
|
|
1153
|
-
return t(this,
|
|
1122
|
+
return t(this, Q).call(this, s[i]);
|
|
1154
1123
|
}, "get"));
|
|
1155
|
-
|
|
1124
|
+
g(this, A, i), g(this, x, e), t(this, Lt).call(this);
|
|
1156
1125
|
}
|
|
1157
1126
|
get source() {
|
|
1158
|
-
return t(this,
|
|
1127
|
+
return t(this, Q).call(this, t(this, x).rawRecords);
|
|
1159
1128
|
}
|
|
1160
1129
|
set source(i) {
|
|
1161
1130
|
this.clear(), this.add(i, !1);
|
|
@@ -1170,7 +1139,7 @@ const L = class L {
|
|
|
1170
1139
|
return this.length;
|
|
1171
1140
|
}
|
|
1172
1141
|
};
|
|
1173
|
-
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"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1174
1143
|
w(L, "ROW_STATE", {
|
|
1175
1144
|
EMPTY: "EMPTY",
|
|
1176
1145
|
NORMAL: "NORMAL",
|
|
@@ -1187,10 +1156,10 @@ const Gt = class Gt {
|
|
|
1187
1156
|
}, this.setDataSource = (e) => {
|
|
1188
1157
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1189
1158
|
}, this.getRowState = (e) => {
|
|
1190
|
-
var n,
|
|
1159
|
+
var n, r;
|
|
1191
1160
|
const s = parseInt(e, 10);
|
|
1192
1161
|
if (!(s >= this.data.count()))
|
|
1193
|
-
return (
|
|
1162
|
+
return (r = (n = this.data.getValidData()[s]) == null ? void 0 : n.__ng) == null ? void 0 : r.rowState;
|
|
1194
1163
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1195
1164
|
this.row.at = e;
|
|
1196
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) => {
|
|
@@ -1198,37 +1167,37 @@ const Gt = class Gt {
|
|
|
1198
1167
|
}, this.setDataSource([]);
|
|
1199
1168
|
}
|
|
1200
1169
|
};
|
|
1201
|
-
|
|
1170
|
+
c(Gt, "ngDataManager");
|
|
1202
1171
|
let Nt = Gt;
|
|
1203
|
-
var
|
|
1172
|
+
var U, _t;
|
|
1204
1173
|
const Jt = class Jt extends HTMLElement {
|
|
1205
1174
|
constructor() {
|
|
1206
1175
|
super();
|
|
1207
1176
|
//#created = false;
|
|
1208
|
-
h(this,
|
|
1209
|
-
h(this,
|
|
1210
|
-
this.attachShadow({ mode: "open" }),
|
|
1177
|
+
h(this, U);
|
|
1178
|
+
h(this, _t);
|
|
1179
|
+
this.attachShadow({ mode: "open" }), g(this, U, new Nt(this));
|
|
1211
1180
|
}
|
|
1212
1181
|
connectedCallback() {
|
|
1213
|
-
|
|
1182
|
+
g(this, _t, new Dt(this)), tt.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1214
1183
|
}
|
|
1215
1184
|
disconnectedCallback() {
|
|
1216
|
-
|
|
1185
|
+
tt.log("NineTable disconnected.");
|
|
1217
1186
|
}
|
|
1218
1187
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1219
1188
|
get data() {
|
|
1220
|
-
return t(this,
|
|
1189
|
+
return t(this, U).data;
|
|
1221
1190
|
}
|
|
1222
1191
|
// π― ν(row) κ΄λ ¨ μ μ΄ μ κ·Όμ μ€ν
|
|
1223
1192
|
get row() {
|
|
1224
|
-
return t(this,
|
|
1193
|
+
return t(this, U).row;
|
|
1225
1194
|
}
|
|
1226
1195
|
// π― μ 체 λ°μ΄ν° λ§€λμ μ κ·Ό νμν κ²½μ°
|
|
1227
1196
|
get dataManager() {
|
|
1228
|
-
return t(this,
|
|
1197
|
+
return t(this, U);
|
|
1229
1198
|
}
|
|
1230
1199
|
};
|
|
1231
|
-
|
|
1232
|
-
let
|
|
1233
|
-
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);
|
|
1234
1203
|
//# sourceMappingURL=nine-table.js.map
|