@ninebone/table 0.0.309 β 0.0.311
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 +210 -227
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +5 -5
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var te = Object.defineProperty;
|
|
2
|
+
var ee = (x) => {
|
|
3
3
|
throw TypeError(x);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var a = (x, i) =>
|
|
7
|
-
var w = (x, i, e) =>
|
|
8
|
-
var t = (x, i, e) => (
|
|
9
|
-
var
|
|
5
|
+
var ne = (x, i, e) => i in x ? te(x, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : x[i] = e;
|
|
6
|
+
var a = (x, i) => te(x, "name", { value: i, configurable: !0 });
|
|
7
|
+
var w = (x, i, e) => ne(x, typeof i != "symbol" ? i + "" : i, e), ie = (x, i, e) => i.has(x) || ee("Cannot " + e);
|
|
8
|
+
var t = (x, i, e) => (ie(x, i, "read from private field"), e ? e.call(x) : i.get(x)), h = (x, i, e) => i.has(x) ? ee("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(x) : i.set(x, e), b = (x, i, e, s) => (ie(x, i, "write to private field"), s ? s.call(x, e) : i.set(x, e), e);
|
|
9
|
+
var se = (x, i, e, s) => ({
|
|
10
10
|
set _(n) {
|
|
11
11
|
b(x, i, n, e);
|
|
12
12
|
},
|
|
@@ -14,26 +14,26 @@ var ne = (x, i, e, s) => ({
|
|
|
14
14
|
return t(x, i, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
import { trace as
|
|
18
|
-
const
|
|
17
|
+
import { trace as oe } from "@ninebone/util";
|
|
18
|
+
const Yt = class Yt extends oe.constructor {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
a(
|
|
24
|
-
let
|
|
25
|
-
const
|
|
26
|
-
var M,
|
|
23
|
+
a(Yt, "Trace");
|
|
24
|
+
let _t = Yt;
|
|
25
|
+
const H = new _t();
|
|
26
|
+
var M, $, p, P, B, N, dt, V, ft;
|
|
27
27
|
const Xt = class Xt extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
h(this, M);
|
|
31
|
+
h(this, $, !1);
|
|
32
|
+
h(this, p);
|
|
33
|
+
h(this, P);
|
|
34
|
+
h(this, B);
|
|
35
|
+
h(this, N);
|
|
36
|
+
h(this, dt, /* @__PURE__ */ a(() => {
|
|
37
37
|
if (!t(this, M)) return;
|
|
38
38
|
const e = t(this, M).querySelector(".ng-container-body");
|
|
39
39
|
e && (b(this, N, new ResizeObserver(() => {
|
|
@@ -41,71 +41,71 @@ const Xt = class Xt extends HTMLElement {
|
|
|
41
41
|
})), t(this, N).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
w(this, "refresh", /* @__PURE__ */ a(() => {
|
|
44
|
-
if (!t(this, M) || !t(this,
|
|
45
|
-
const e = t(this,
|
|
44
|
+
if (!t(this, M) || !t(this, p) || t(this, $)) return;
|
|
45
|
+
const e = t(this, p).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const n = t(this,
|
|
47
|
+
const n = t(this, p).track, o = t(this, p).thumb, r = t(this, M).querySelector(".ng-container-bottom"), l = e.clientWidth, c = s.scrollWidth;
|
|
48
48
|
if (l !== 0 && c > l)
|
|
49
49
|
r && (r.style.display = "flex");
|
|
50
50
|
else {
|
|
51
51
|
r && (r.style.display = "none");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
56
|
-
const u = Math.max(Math.min(
|
|
54
|
+
const d = n.clientWidth;
|
|
55
|
+
if (d <= 0) return;
|
|
56
|
+
const u = Math.max(Math.min(d * (l / c), d), 20);
|
|
57
57
|
o.style.width = `${u}px`;
|
|
58
58
|
const f = e.scrollLeft, g = c - l;
|
|
59
|
-
let
|
|
60
|
-
g > 0 && (
|
|
61
|
-
const E =
|
|
62
|
-
|
|
59
|
+
let y = 0;
|
|
60
|
+
g > 0 && (y = parseInt(f / g * (d - u), 10)), y < 0 && (y = 0);
|
|
61
|
+
const E = d - u;
|
|
62
|
+
y > E && (y = E), o.style.left = `${y}px`, H.log(y), t(this, p).left.disabled = y === 0, t(this, p).right.disabled = y >= E - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
|
|
65
|
-
if (!t(this,
|
|
66
|
-
const s = t(this,
|
|
64
|
+
h(this, V, /* @__PURE__ */ a((e) => {
|
|
65
|
+
if (!t(this, p)) return !1;
|
|
66
|
+
const s = t(this, p).container, n = s.querySelector("table");
|
|
67
67
|
if (!n) return !1;
|
|
68
|
-
const o = t(this,
|
|
68
|
+
const o = t(this, p).track.getBoundingClientRect(), r = t(this, p).thumb.clientWidth;
|
|
69
69
|
let l = e;
|
|
70
70
|
l < 0 && (l = 0);
|
|
71
71
|
const c = o.width - r;
|
|
72
|
-
l > c && (l = c), l = parseInt(l, 10), t(this,
|
|
73
|
-
const
|
|
72
|
+
l > c && (l = c), 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 >= c - 1;
|
|
73
|
+
const d = s.clientWidth, f = n.scrollWidth - d;
|
|
74
74
|
return c > 0 && f > 0 && (s.scrollLeft = l / c * f), l > 0 && l < c - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
|
|
76
|
+
h(this, ft, /* @__PURE__ */ a(() => {
|
|
77
77
|
const e = /* @__PURE__ */ a((n) => {
|
|
78
78
|
clearInterval(t(this, P)), clearInterval(t(this, B));
|
|
79
|
-
const o = parseInt(t(this,
|
|
80
|
-
t(this,
|
|
79
|
+
const o = parseInt(t(this, p).thumb.style.left || 0, 10);
|
|
80
|
+
t(this, V).call(this, o + n), b(this, P, setInterval(() => {
|
|
81
81
|
clearInterval(t(this, P)), b(this, B, setInterval(() => {
|
|
82
|
-
const r = parseInt(t(this,
|
|
83
|
-
t(this,
|
|
82
|
+
const r = parseInt(t(this, p).thumb.style.left || 0, 10);
|
|
83
|
+
t(this, V).call(this, r + n) || clearInterval(t(this, B));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), s = /* @__PURE__ */ a(() => {
|
|
87
87
|
clearInterval(t(this, P)), clearInterval(t(this, B));
|
|
88
88
|
}, "clearTimer");
|
|
89
89
|
["mouseup", "mouseleave", "touchend"].forEach((n) => {
|
|
90
|
-
t(this,
|
|
91
|
-
}), t(this,
|
|
90
|
+
t(this, p).left.addEventListener(n, s), t(this, p).right.addEventListener(n, s), t(this, p).track.addEventListener(n, s);
|
|
91
|
+
}), t(this, p).left.addEventListener("mousedown", (n) => {
|
|
92
92
|
n.button === 0 && e(-20);
|
|
93
|
-
}), t(this,
|
|
93
|
+
}), t(this, p).right.addEventListener("mousedown", (n) => {
|
|
94
94
|
n.button === 0 && e(20);
|
|
95
|
-
}), t(this,
|
|
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 o = t(this,
|
|
99
|
-
t(this,
|
|
100
|
-
}), t(this,
|
|
98
|
+
const o = t(this, p).track.getBoundingClientRect(), r = t(this, p).thumb.clientWidth;
|
|
99
|
+
t(this, V).call(this, n.clientX - o.left - r / 2);
|
|
100
|
+
}), t(this, p).thumb.addEventListener("mousedown", (n) => {
|
|
101
101
|
if (n.button !== 0) return;
|
|
102
|
-
n.stopPropagation(), n.preventDefault(), b(this,
|
|
102
|
+
n.stopPropagation(), n.preventDefault(), b(this, $, !0), this.shiftX = n.clientX - t(this, p).thumb.getBoundingClientRect().left;
|
|
103
103
|
const o = /* @__PURE__ */ a((l) => {
|
|
104
|
-
if (!t(this,
|
|
105
|
-
const c = t(this,
|
|
106
|
-
t(this,
|
|
104
|
+
if (!t(this, $)) return;
|
|
105
|
+
const c = t(this, p).track.getBoundingClientRect();
|
|
106
|
+
t(this, V).call(this, l.clientX - c.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), r = /* @__PURE__ */ a(() => {
|
|
108
|
-
b(this,
|
|
108
|
+
b(this, $, !1), s(), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", r), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
110
|
document.addEventListener("mousemove", o), document.addEventListener("mouseup", r);
|
|
111
111
|
});
|
|
@@ -182,14 +182,14 @@ const Xt = class Xt extends HTMLElement {
|
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
|
-
b(this,
|
|
185
|
+
b(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, $) || this.refresh();
|
|
193
193
|
}), t(this, ft).call(this), t(this, dt).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
195
195
|
e();
|
|
@@ -198,23 +198,23 @@ const Xt = class Xt extends HTMLElement {
|
|
|
198
198
|
t(this, N) && t(this, N).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
M = new WeakMap(),
|
|
202
|
-
let
|
|
203
|
-
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar",
|
|
204
|
-
var
|
|
201
|
+
M = new WeakMap(), $ = new WeakMap(), p = new WeakMap(), P = new WeakMap(), B = new WeakMap(), N = new WeakMap(), dt = new WeakMap(), V = new WeakMap(), ft = new WeakMap(), a(Xt, "NineTableHScrollBar");
|
|
202
|
+
let $t = Xt;
|
|
203
|
+
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", $t);
|
|
204
|
+
var Y, I, S, it, st, ut;
|
|
205
205
|
const Ut = class Ut extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
208
|
+
h(this, Y);
|
|
209
|
+
h(this, I, !1);
|
|
210
|
+
h(this, S);
|
|
211
|
+
h(this, it, 0);
|
|
212
|
+
h(this, st, 0);
|
|
213
213
|
/**
|
|
214
214
|
* π― μ€ν¬λ‘€λ° μμΉ λ° μΈλΈ ν¬κΈ° κ°±μ
|
|
215
215
|
*/
|
|
216
216
|
w(this, "refresh", /* @__PURE__ */ a(() => {
|
|
217
|
-
if (!t(this,
|
|
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
220
|
const n = t(this, S).track, o = t(this, S).thumb, r = e.clientHeight, l = s.scrollHeight;
|
|
@@ -225,15 +225,15 @@ const Ut = class Ut extends HTMLElement {
|
|
|
225
225
|
o.style.display = "block";
|
|
226
226
|
const c = n.clientHeight;
|
|
227
227
|
if (c <= 0) return;
|
|
228
|
-
const
|
|
229
|
-
o.style.height = `${
|
|
228
|
+
const d = Math.max(Math.min(c * (r / l), c), 20);
|
|
229
|
+
o.style.height = `${d}px`;
|
|
230
230
|
const u = e.scrollTop, f = l - r;
|
|
231
231
|
let g = 0;
|
|
232
|
-
f > 0 && (g = u / f * (c -
|
|
233
|
-
const
|
|
234
|
-
g < 0 && (g = 0), g >
|
|
232
|
+
f > 0 && (g = u / f * (c - d));
|
|
233
|
+
const y = c - d;
|
|
234
|
+
g < 0 && (g = 0), g > y && (g = y), o.style.top = `${g}px`, t(this, S).top.disabled = u <= 0, t(this, S).bottom.disabled = u >= f - 1;
|
|
235
235
|
}, "refresh"));
|
|
236
|
-
|
|
236
|
+
h(this, ut, /* @__PURE__ */ a(() => {
|
|
237
237
|
const e = t(this, S).container;
|
|
238
238
|
e.addEventListener("scroll", () => {
|
|
239
239
|
t(this, I) || this.refresh();
|
|
@@ -242,9 +242,9 @@ const Ut = class Ut extends HTMLElement {
|
|
|
242
242
|
s.stopPropagation(), s.preventDefault(), b(this, I, !0), b(this, it, s.clientY), b(this, st, e.scrollTop);
|
|
243
243
|
const n = /* @__PURE__ */ a((r) => {
|
|
244
244
|
if (!t(this, I)) return;
|
|
245
|
-
const l = t(this, S).track.getBoundingClientRect(), c = t(this, S).thumb.clientHeight, u = l.height - c, f = r.clientY - t(this, it), g = e.clientHeight,
|
|
246
|
-
|
|
247
|
-
const k =
|
|
245
|
+
const l = t(this, S).track.getBoundingClientRect(), c = t(this, S).thumb.clientHeight, u = l.height - c, f = r.clientY - t(this, it), g = e.clientHeight, y = e.querySelector("table");
|
|
246
|
+
H.log(y), H.log(y.scrollHeight);
|
|
247
|
+
const k = y.scrollHeight - g;
|
|
248
248
|
if (u > 0 && k > 0) {
|
|
249
249
|
const D = f / u * k;
|
|
250
250
|
e.scrollTop = t(this, st) + D;
|
|
@@ -256,7 +256,7 @@ const Ut = class Ut extends HTMLElement {
|
|
|
256
256
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", o);
|
|
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(), o = t(this, S).thumb.clientHeight, r = s.clientY - n.top - o / 2, c = n.height - o,
|
|
259
|
+
const n = t(this, S).track.getBoundingClientRect(), o = t(this, S).thumb.clientHeight, r = s.clientY - n.top - o / 2, c = n.height - o, d = e.clientHeight, f = e.querySelector("table").scrollHeight - d;
|
|
260
260
|
if (c > 0 && f > 0) {
|
|
261
261
|
const g = Math.max(0, Math.min(1, r / c));
|
|
262
262
|
e.scrollTop = g * f;
|
|
@@ -270,7 +270,7 @@ const Ut = class Ut extends HTMLElement {
|
|
|
270
270
|
}, "#init"));
|
|
271
271
|
}
|
|
272
272
|
connectedCallback() {
|
|
273
|
-
if (b(this,
|
|
273
|
+
if (b(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 {
|
|
@@ -335,7 +335,7 @@ const Ut = class Ut extends HTMLElement {
|
|
|
335
335
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
336
336
|
`;
|
|
337
337
|
const e = /* @__PURE__ */ a(() => {
|
|
338
|
-
const s = t(this,
|
|
338
|
+
const s = t(this, Y).querySelector(".ng-container-body");
|
|
339
339
|
if (!s) {
|
|
340
340
|
setTimeout(e, 10);
|
|
341
341
|
return;
|
|
@@ -351,7 +351,7 @@ const Ut = class Ut extends HTMLElement {
|
|
|
351
351
|
e();
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
|
-
|
|
354
|
+
Y = new WeakMap(), I = new WeakMap(), S = new WeakMap(), it = new WeakMap(), st = new WeakMap(), ut = new WeakMap(), a(Ut, "NineTableVScrollBar");
|
|
355
355
|
let It = Ut;
|
|
356
356
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", It);
|
|
357
357
|
var gt, F;
|
|
@@ -369,15 +369,15 @@ const C = class C {
|
|
|
369
369
|
var n, o, r, l;
|
|
370
370
|
if (!i) return null;
|
|
371
371
|
const e = i.cloneNode(!0);
|
|
372
|
-
return t(n = C, gt).call(n, e), t(o = C, F).call(o, e, "thead"), t(r = C, F).call(r, e, "tbody"), t(l = C, F).call(l, e, "tfoot"), Array.from(e.querySelectorAll("colgroup col")).forEach((c,
|
|
372
|
+
return t(n = C, gt).call(n, e), t(o = C, F).call(o, e, "thead"), t(r = C, F).call(r, e, "tbody"), t(l = C, F).call(l, e, "tfoot"), Array.from(e.querySelectorAll("colgroup col")).forEach((c, d) => {
|
|
373
373
|
const u = c.getAttribute("fixed");
|
|
374
|
-
u && e.querySelectorAll(`thead [data-col="${
|
|
374
|
+
u && e.querySelectorAll(`thead [data-col="${d}"], tbody [data-col="${d}"], tfoot [data-col="${d}"]`).forEach((f) => {
|
|
375
375
|
f.setAttribute("fixed", u);
|
|
376
376
|
});
|
|
377
377
|
}), e;
|
|
378
378
|
}
|
|
379
379
|
};
|
|
380
|
-
gt = new WeakMap(), F = new WeakMap(), a(C, "TableCompiler"),
|
|
380
|
+
gt = new WeakMap(), F = new WeakMap(), a(C, "TableCompiler"), h(C, gt, /* @__PURE__ */ a((i) => {
|
|
381
381
|
if (!i.querySelector("colgroup")) {
|
|
382
382
|
const e = i.querySelector("tbody tr") || i.querySelector("tr"), s = e ? e.querySelectorAll("th, td").length : 1, n = document.createElement("colgroup"), o = Math.max(Math.floor(i.clientWidth / s), 100);
|
|
383
383
|
for (let r = 0; r < s; r++) {
|
|
@@ -391,7 +391,7 @@ gt = new WeakMap(), F = new WeakMap(), a(C, "TableCompiler"), d(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")),
|
|
394
|
+
}, "#ensureTableStructure")), h(C, F, /* @__PURE__ */ a((i, e) => {
|
|
395
395
|
const s = Array.from(i.querySelectorAll(e + " tr")), n = Array.from(i.querySelectorAll(e + " th," + e + " td")), o = s.length;
|
|
396
396
|
if (o === 0 || n.length === 0) return;
|
|
397
397
|
let r = 0;
|
|
@@ -400,41 +400,41 @@ gt = new WeakMap(), F = new WeakMap(), a(C, "TableCompiler"), d(C, gt, /* @__PUR
|
|
|
400
400
|
});
|
|
401
401
|
const l = Array.from(Array(o), () => Array(r).fill(null));
|
|
402
402
|
s.forEach((c) => {
|
|
403
|
-
const
|
|
403
|
+
const d = c.sectionRowIndex;
|
|
404
404
|
let u = 0;
|
|
405
405
|
Array.from(c.querySelectorAll("th,td")).forEach((f) => {
|
|
406
|
-
for (let E = 0; E < l[
|
|
407
|
-
if (l[
|
|
406
|
+
for (let E = 0; E < l[d].length; E++)
|
|
407
|
+
if (l[d][E] === null) {
|
|
408
408
|
u = E;
|
|
409
409
|
break;
|
|
410
410
|
}
|
|
411
|
-
const g = f.rowSpan || 1,
|
|
411
|
+
const g = f.rowSpan || 1, y = f.colSpan || 1;
|
|
412
412
|
for (let E = 0; E < g; E++)
|
|
413
|
-
for (let k = 0; k <
|
|
414
|
-
|
|
413
|
+
for (let k = 0; k < y; k++)
|
|
414
|
+
d + E < o && u + k < r && (l[d + E][u + k] = E === 0 && k === 0 ? "1" : "0");
|
|
415
415
|
});
|
|
416
416
|
}), s.forEach((c) => {
|
|
417
|
-
const
|
|
417
|
+
const d = c.sectionRowIndex;
|
|
418
418
|
Array.from(c.querySelectorAll("th,td")).forEach((u) => {
|
|
419
|
-
for (let f = 0; f < l[
|
|
420
|
-
if (l[
|
|
421
|
-
u.dataset.col = f, l[
|
|
419
|
+
for (let f = 0; f < l[d].length; f++)
|
|
420
|
+
if (l[d][f] === "1") {
|
|
421
|
+
u.dataset.col = f, l[d][f] = "0";
|
|
422
422
|
break;
|
|
423
423
|
}
|
|
424
424
|
});
|
|
425
425
|
});
|
|
426
426
|
}, "#resetColIndex"));
|
|
427
427
|
let Wt = C;
|
|
428
|
-
var m,
|
|
428
|
+
var m, _, R, W, X, U, bt, pt, nt, ot, yt, mt, rt, Z, xt;
|
|
429
429
|
const Kt = class Kt {
|
|
430
430
|
constructor(i) {
|
|
431
|
-
|
|
432
|
-
|
|
431
|
+
h(this, m);
|
|
432
|
+
h(this, _, /* @__PURE__ */ new Map());
|
|
433
433
|
// κ° μ»¨ν
μ΄λλ³ λ
립λ ν
νλ¦Ώ TR κ΄λ¦¬
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
434
|
+
h(this, R, null);
|
|
435
|
+
h(this, W, null);
|
|
436
|
+
h(this, X, 0);
|
|
437
|
+
h(this, U, 40);
|
|
438
438
|
/**
|
|
439
439
|
* π― μΈλΆμμ λ°μ΄ν°κ° λ‘λλκ±°λ λ³κ²½λ ν κ°μ λμ΄μ λ·°λ₯Ό μ¬κ°±μ νλ νΌλΈλ¦ λ©μλ
|
|
440
440
|
*/
|
|
@@ -448,7 +448,7 @@ const Kt = class Kt {
|
|
|
448
448
|
*/
|
|
449
449
|
// [RowManager.js μμ λ΄μ© λ°μ·]
|
|
450
450
|
w(this, "initialize", /* @__PURE__ */ a(() => {
|
|
451
|
-
b(this, R, null), t(this,
|
|
451
|
+
b(this, R, null), t(this, _).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
452
452
|
const s = t(this, m).querySelector(e);
|
|
453
453
|
if (!s) return;
|
|
454
454
|
const n = s.querySelector("table");
|
|
@@ -456,7 +456,7 @@ const Kt = class Kt {
|
|
|
456
456
|
const o = n.querySelector("tbody");
|
|
457
457
|
if (!o) return;
|
|
458
458
|
const l = Array.from(o.querySelectorAll("tr")).map((c) => c.cloneNode(!0));
|
|
459
|
-
t(this,
|
|
459
|
+
t(this, _).set(e, l);
|
|
460
460
|
});
|
|
461
461
|
const i = t(this, m).querySelector(".ng-container-body");
|
|
462
462
|
if (i) {
|
|
@@ -465,12 +465,12 @@ const Kt = class Kt {
|
|
|
465
465
|
i.addEventListener("scroll", () => {
|
|
466
466
|
var n;
|
|
467
467
|
const s = i.scrollTop;
|
|
468
|
-
|
|
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();
|
|
469
469
|
});
|
|
470
470
|
}
|
|
471
471
|
}, "initialize"));
|
|
472
|
-
|
|
473
|
-
const s = t(this,
|
|
472
|
+
h(this, bt, /* @__PURE__ */ a((i, e) => {
|
|
473
|
+
const s = t(this, _).get(e);
|
|
474
474
|
if (!s || s.length === 0) return;
|
|
475
475
|
const n = i.querySelector("tbody");
|
|
476
476
|
if (!n) return;
|
|
@@ -485,10 +485,10 @@ const Kt = class Kt {
|
|
|
485
485
|
/**
|
|
486
486
|
* π― ν
νλ¦Ώ TRλ€μ μ΄ λμ΄λ₯Ό μΈ‘μ νκ³ μΊμ±
|
|
487
487
|
*/
|
|
488
|
-
|
|
488
|
+
h(this, pt, /* @__PURE__ */ a((i) => {
|
|
489
489
|
if (t(this, R) !== null && t(this, R) > 0)
|
|
490
490
|
return t(this, R);
|
|
491
|
-
const e = t(this,
|
|
491
|
+
const e = t(this, _).get(".ng-container-body");
|
|
492
492
|
if (!e || e.length === 0) return 24;
|
|
493
493
|
const s = i.querySelector("tbody");
|
|
494
494
|
if (!s) return 24;
|
|
@@ -497,13 +497,13 @@ const Kt = class Kt {
|
|
|
497
497
|
e.forEach((g) => {
|
|
498
498
|
o.appendChild(g.cloneNode(!0));
|
|
499
499
|
}), n ? n.before(o) : s.appendChild(o);
|
|
500
|
-
const r = t(this, m), l = r.style.display, c = r.style.visibility,
|
|
500
|
+
const r = t(this, m), l = r.style.display, c = r.style.visibility, d = r.style.position;
|
|
501
501
|
(l === "none" || window.getComputedStyle(r).display === "none") && (r.style.display = "block", r.style.visibility = "hidden", r.style.position = "absolute");
|
|
502
502
|
let u = 0;
|
|
503
503
|
const f = s.querySelectorAll("tr:not(.nodata)");
|
|
504
504
|
return f.forEach((g) => {
|
|
505
505
|
u += g.offsetHeight || g.getBoundingClientRect().height;
|
|
506
|
-
}), f.forEach((g) => g.remove()), r.style.display = l, r.style.visibility = c, r.style.position =
|
|
506
|
+
}), f.forEach((g) => g.remove()), r.style.display = l, r.style.visibility = c, r.style.position = d, b(this, R, u > 0 ? u : 24), t(this, ot).call(this), H.log(`[RowManager] Height Cached: ${t(this, R)}px | RowCount: ${t(this, U)}`), t(this, R);
|
|
507
507
|
}, "#measureAndCacheHeight"));
|
|
508
508
|
/**
|
|
509
509
|
* π― μ 체 λ°μ΄ν° κ°μ κΈ°λ°μΌλ‘ κ°μ μ€ν¬λ‘€ λμ΄ μ€μ
|
|
@@ -511,40 +511,40 @@ const Kt = class Kt {
|
|
|
511
511
|
/**
|
|
512
512
|
* π― μ 체 λ°μ΄ν° κ°μ κΈ°λ°μΌλ‘ κ°μ μ€ν¬λ‘€ λμ΄ μ€μ
|
|
513
513
|
*/
|
|
514
|
-
|
|
514
|
+
h(this, nt, /* @__PURE__ */ a(() => {
|
|
515
515
|
var o, r, l, c;
|
|
516
516
|
if (!t(this, m).querySelector(".ng-container-body")) return;
|
|
517
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
|
-
|
|
519
|
-
const u = t(this, m).querySelector(
|
|
520
|
-
f ? (f.style.height = `${n}px`,
|
|
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}`);
|
|
521
521
|
});
|
|
522
522
|
}, "#updateVirtualScrollHeight"));
|
|
523
|
-
|
|
523
|
+
h(this, ot, /* @__PURE__ */ a(() => {
|
|
524
524
|
if (t(this, X) > 0 && t(this, R) > 0) {
|
|
525
525
|
const i = Math.ceil(t(this, X) / t(this, R));
|
|
526
526
|
b(this, U, i + 20);
|
|
527
527
|
} else
|
|
528
528
|
b(this, U, 40);
|
|
529
529
|
}, "#updateRowCount"));
|
|
530
|
-
|
|
531
|
-
var c,
|
|
530
|
+
h(this, yt, /* @__PURE__ */ a(() => {
|
|
531
|
+
var c, d, u;
|
|
532
532
|
const i = t(this, m).querySelector(".ng-container-left table"), e = t(this, m).querySelector(".ng-container-body table"), s = t(this, m).querySelector(".ng-container-right table");
|
|
533
533
|
if (!e) return;
|
|
534
534
|
const n = i ? Array.from(i.querySelectorAll("tr")) : [], o = Array.from(e.querySelectorAll("tr")), r = s ? Array.from(s.querySelectorAll("tr")) : [], l = Math.max(n.length, o.length, r.length);
|
|
535
535
|
for (let f = 0; f < l; f++) {
|
|
536
536
|
const g = [
|
|
537
537
|
((c = n[f]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
538
|
-
((
|
|
538
|
+
((d = o[f]) == null ? void 0 : d.getBoundingClientRect().height) || 0,
|
|
539
539
|
((u = r[f]) == null ? void 0 : u.getBoundingClientRect().height) || 0
|
|
540
|
-
],
|
|
541
|
-
|
|
540
|
+
], y = Math.max(...g);
|
|
541
|
+
y > 0 && (n[f] && (n[f].style.height = `${y}px`), o[f] && (o[f].style.height = `${y}px`), r[f] && (r[f].style.height = `${y}px`));
|
|
542
542
|
}
|
|
543
543
|
}, "#syncRowHeights"));
|
|
544
544
|
/**
|
|
545
545
|
* π― ResizeObserver μ€μ : μνΈ ν¬κΈ° λ³κ²½ μ ν κ°μ μ¬μ°μ λ° μ¬λ λλ§
|
|
546
546
|
*/
|
|
547
|
-
|
|
547
|
+
h(this, mt, /* @__PURE__ */ a(() => {
|
|
548
548
|
!t(this, m) || !(t(this, m) instanceof HTMLElement) || (b(this, W, new ResizeObserver((i) => {
|
|
549
549
|
for (const e of i) {
|
|
550
550
|
const s = e.target;
|
|
@@ -563,50 +563,33 @@ const Kt = class Kt {
|
|
|
563
563
|
/**
|
|
564
564
|
* π― λ°λ λ° μ’μ° κ³ μ 컨ν
μ΄λ μ 체μ κ°κ°μ λ§λ ν
νλ¦Ώ ν λΌλ μ£Όμ
|
|
565
565
|
*/
|
|
566
|
-
|
|
566
|
+
h(this, rt, /* @__PURE__ */ a(() => {
|
|
567
567
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
568
568
|
const e = t(this, m).querySelector(i);
|
|
569
569
|
e && e.querySelector("tbody") && t(this, bt).call(this, e, i);
|
|
570
570
|
}), t(this, yt).call(this);
|
|
571
571
|
}, "#renderAllContainers"));
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
*/
|
|
575
|
-
/**
|
|
576
|
-
* π― μ€ν¬λ‘€ μμΉμ λ°λ₯Έ λ°μ΄ν° λ°μΈλ© λ° tbody λ―ΈμΈ ν½μ
μ΄λ(translateY) κ°±μ
|
|
577
|
-
*/
|
|
578
|
-
/**
|
|
579
|
-
* π― μ€ν¬λ‘€ μμΉμ λ°λ₯Έ λ°μ΄ν° λ°μΈλ© λ° tbody λ―ΈμΈ ν½μ
μ΄λ(translateY) κ°±μ
|
|
580
|
-
*/
|
|
581
|
-
d(this, Z, /* @__PURE__ */ a((i) => {
|
|
582
|
-
var r;
|
|
572
|
+
h(this, Z, /* @__PURE__ */ a((i) => {
|
|
573
|
+
var o;
|
|
583
574
|
const e = t(this, R);
|
|
584
|
-
if (!e || e <= 0)
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
const o = ((r = t(this, $).get(".ng-container-body")) == null ? void 0 : r.length) || 1;
|
|
591
|
-
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((l) => {
|
|
592
|
-
const c = t(this, m).querySelector(l);
|
|
575
|
+
if (!e || e <= 0) return;
|
|
576
|
+
const s = Math.max(0, Math.floor(i / e)), n = ((o = t(this, _).get(".ng-container-body")) == null ? void 0 : o.length) || 1;
|
|
577
|
+
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((r) => {
|
|
578
|
+
const l = t(this, m).querySelector(r);
|
|
579
|
+
if (!l) return;
|
|
580
|
+
const c = l.querySelector("tbody");
|
|
593
581
|
if (!c) return;
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
}
|
|
599
|
-
window.getComputedStyle(h).position === "static" && (h.style.position = "relative"), h.style.transform = `translateY(-${n}px)`, h.style.willChange = "transform", Array.from(h.querySelectorAll("tr:not(.nodata)")).forEach((f, g) => {
|
|
600
|
-
var k, D, Qt, te;
|
|
601
|
-
const p = s + Math.floor(g / o), E = (typeof t(this, m).getData == "function" ? t(this, m).getData(p) : null) ?? (typeof ((k = t(this, m).data) == null ? void 0 : k.get) == "function" ? t(this, m).data.get(p) : null) ?? ((Qt = (D = t(this, m).dataManager) == null ? void 0 : D.rawRecords) == null ? void 0 : Qt[p]) ?? ((te = t(this, m).data) == null ? void 0 : te[p]) ?? null;
|
|
602
|
-
E ? (f.style.display = "", t(this, xt).call(this, f, E, p)) : f.style.display = "none";
|
|
582
|
+
Array.from(c.querySelectorAll("tr:not(.nodata)")).forEach((u, f) => {
|
|
583
|
+
var E, k, D, Qt;
|
|
584
|
+
const g = s + Math.floor(f / n), y = (typeof t(this, m).getData == "function" ? t(this, m).getData(g) : null) ?? (typeof ((E = t(this, m).data) == null ? void 0 : E.get) == "function" ? t(this, m).data.get(g) : null) ?? ((D = (k = t(this, m).dataManager) == null ? void 0 : k.rawRecords) == null ? void 0 : D[g]) ?? ((Qt = t(this, m).data) == null ? void 0 : Qt[g]) ?? { _index: g };
|
|
585
|
+
u.style.display = "", t(this, xt).call(this, u, y, g);
|
|
603
586
|
});
|
|
604
587
|
});
|
|
605
588
|
}, "#handleScroll"));
|
|
606
589
|
/**
|
|
607
590
|
* π― κ°λ³ TR μ리먼νΈμ μ€μ λ°μ΄ν° κ°μ κ½μμ£Όλ λ°μΈλ© λ©μλ
|
|
608
591
|
*/
|
|
609
|
-
|
|
592
|
+
h(this, xt, /* @__PURE__ */ a((i, e, s) => {
|
|
610
593
|
i.dataset.row = s, Array.from(i.cells).forEach((n, o) => {
|
|
611
594
|
const r = n.dataset.bind;
|
|
612
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;
|
|
@@ -622,18 +605,18 @@ const Kt = class Kt {
|
|
|
622
605
|
}
|
|
623
606
|
templateLength(i = ".ng-container-body") {
|
|
624
607
|
var e;
|
|
625
|
-
return ((e = t(this,
|
|
608
|
+
return ((e = t(this, _).get(i)) == null ? void 0 : e.length) || 1;
|
|
626
609
|
}
|
|
627
610
|
};
|
|
628
|
-
m = new WeakMap(),
|
|
611
|
+
m = new WeakMap(), _ = new WeakMap(), R = new WeakMap(), W = new WeakMap(), X = new WeakMap(), U = new WeakMap(), bt = new WeakMap(), pt = new WeakMap(), nt = new WeakMap(), ot = new WeakMap(), yt = new WeakMap(), mt = new WeakMap(), rt = new WeakMap(), Z = new WeakMap(), xt = new WeakMap(), a(Kt, "RowManager");
|
|
629
612
|
let Ot = Kt;
|
|
630
613
|
var G, J, vt, wt, St, Et, Rt;
|
|
631
614
|
const et = class et extends HTMLElement {
|
|
632
615
|
constructor() {
|
|
633
616
|
super();
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
617
|
+
h(this, G, null);
|
|
618
|
+
h(this, J);
|
|
619
|
+
h(this, vt, /* @__PURE__ */ a(() => {
|
|
637
620
|
[
|
|
638
621
|
{ selector: ".ng-container-body", type: null },
|
|
639
622
|
{ selector: ".ng-container-left", type: "left" },
|
|
@@ -645,7 +628,7 @@ const et = class et extends HTMLElement {
|
|
|
645
628
|
o.innerHTML = "", o.appendChild(r);
|
|
646
629
|
});
|
|
647
630
|
}, "#renderSplitContainers"));
|
|
648
|
-
|
|
631
|
+
h(this, wt, /* @__PURE__ */ a(() => {
|
|
649
632
|
["left", "right"].forEach((e) => {
|
|
650
633
|
const s = this.querySelector(`.ng-container-${e}`), n = s == null ? void 0 : s.querySelector("table");
|
|
651
634
|
if (!s || !n) return;
|
|
@@ -665,7 +648,7 @@ const et = class et extends HTMLElement {
|
|
|
665
648
|
/**
|
|
666
649
|
* π― λ§μ€ν° ν
μ΄λΈμ κΈ°λ°μΌλ‘ νΉμ fixed νμ
μμλ§ λ¨κΈ°λ λΆν ν¬νΌ
|
|
667
650
|
*/
|
|
668
|
-
|
|
651
|
+
h(this, St, /* @__PURE__ */ a((e, s) => {
|
|
669
652
|
const n = e.cloneNode(!0);
|
|
670
653
|
return s === "left" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((o) => {
|
|
671
654
|
o.getAttribute("fixed") !== "left" && o.remove();
|
|
@@ -684,10 +667,10 @@ const et = class et extends HTMLElement {
|
|
|
684
667
|
const s = this.querySelector(".ng-container-body");
|
|
685
668
|
s && (s.scrollTop = e);
|
|
686
669
|
}, "scrollToY"));
|
|
687
|
-
|
|
670
|
+
h(this, Et, /* @__PURE__ */ a(() => {
|
|
688
671
|
t(this, Rt).call(this);
|
|
689
672
|
}, "#init"));
|
|
690
|
-
|
|
673
|
+
h(this, Rt, /* @__PURE__ */ a(() => {
|
|
691
674
|
const e = et.SCROLLBAR_SIZE;
|
|
692
675
|
this.innerHTML = `
|
|
693
676
|
<style>
|
|
@@ -830,7 +813,7 @@ const et = class et extends HTMLElement {
|
|
|
830
813
|
t(this, Et).call(this);
|
|
831
814
|
}
|
|
832
815
|
disconnectedCallback() {
|
|
833
|
-
this.innerHTML = "",
|
|
816
|
+
this.innerHTML = "", H.log("NineTableSheet destroyed.");
|
|
834
817
|
}
|
|
835
818
|
};
|
|
836
819
|
G = new WeakMap(), J = new WeakMap(), vt = new WeakMap(), wt = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), Rt = new WeakMap(), a(et, "NineTableSheet"), w(et, "SCROLLBAR_SIZE", 16);
|
|
@@ -840,7 +823,7 @@ var Tt, lt;
|
|
|
840
823
|
const jt = class jt extends HTMLElement {
|
|
841
824
|
constructor() {
|
|
842
825
|
super();
|
|
843
|
-
|
|
826
|
+
h(this, Tt, /* @__PURE__ */ a(() => {
|
|
844
827
|
var e;
|
|
845
828
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
846
829
|
var r;
|
|
@@ -848,13 +831,13 @@ const jt = class jt extends HTMLElement {
|
|
|
848
831
|
t(this, lt).call(this, o, n);
|
|
849
832
|
}), t(this, lt).call(this, 0, !1);
|
|
850
833
|
}, "#init"));
|
|
851
|
-
|
|
834
|
+
h(this, lt, /* @__PURE__ */ a((e, s = !1) => {
|
|
852
835
|
const n = /* @__PURE__ */ a(() => {
|
|
853
836
|
const u = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
854
|
-
Array.from(this.querySelectorAll("nine-splitter")).forEach((
|
|
855
|
-
const g = u.filter((
|
|
856
|
-
g.length < 2 || g.forEach((
|
|
857
|
-
const E = parseInt(
|
|
837
|
+
Array.from(this.querySelectorAll("nine-splitter")).forEach((y) => y.style.setProperty("display", "none"));
|
|
838
|
+
const g = u.filter((y) => y.classList.contains("active"));
|
|
839
|
+
g.length < 2 || g.forEach((y) => {
|
|
840
|
+
const E = parseInt(y.getAttribute("data-index"), 10), k = this.querySelector(`nine-splitter[data-split-index="${E}"]`), D = u[E + 1];
|
|
858
841
|
k && D && D.classList.contains("active") && k.style.setProperty("display", "flex");
|
|
859
842
|
});
|
|
860
843
|
}, "updateSplitters"), o = this.querySelector(".nine-tab-bar"), r = this.querySelector("nine-table-sheets-body"), l = o.querySelectorAll(".nine-tab-item"), c = r.querySelectorAll("nine-table-sheet");
|
|
@@ -874,9 +857,9 @@ const jt = class jt extends HTMLElement {
|
|
|
874
857
|
const g = r.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
875
858
|
g && (g.classList.toggle("active"), g.classList.contains("active") || (g.style.flex = ""));
|
|
876
859
|
}
|
|
877
|
-
const
|
|
878
|
-
|
|
879
|
-
u.style.flex =
|
|
860
|
+
const d = r.querySelectorAll("nine-table-sheet.active");
|
|
861
|
+
d == null || d.forEach((u) => {
|
|
862
|
+
u.style.flex = d.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
880
863
|
}), n();
|
|
881
864
|
}, "#switchSheet"));
|
|
882
865
|
}
|
|
@@ -890,25 +873,25 @@ customElements.get("nine-table-sheets") || customElements.define("nine-table-she
|
|
|
890
873
|
var T, kt, at, At;
|
|
891
874
|
const Ft = class Ft {
|
|
892
875
|
constructor(i) {
|
|
893
|
-
|
|
894
|
-
|
|
876
|
+
h(this, T);
|
|
877
|
+
h(this, kt, /* @__PURE__ */ a(() => {
|
|
895
878
|
t(this, At).call(this), new ResizeObserver((i) => {
|
|
896
879
|
for (let e of i)
|
|
897
880
|
t(this, T).getAttribute("auto-height") === "true" && t(this, at).call(this);
|
|
898
881
|
}).observe(t(this, T));
|
|
899
882
|
}, "#init"));
|
|
900
|
-
|
|
901
|
-
var c,
|
|
883
|
+
h(this, at, /* @__PURE__ */ a(() => {
|
|
884
|
+
var c, d;
|
|
902
885
|
const i = Array.from(t(this, T).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
903
886
|
if (i.length === 0) return;
|
|
904
|
-
const e = parseInt(t(this, T).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((u) => u.getRowHeight())), n = (c = t(this, T).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, o = (
|
|
887
|
+
const e = parseInt(t(this, T).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((u) => u.getRowHeight())), n = (c = t(this, T).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, o = (d = t(this, T).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : d.getBoundingClientRect().height, r = ht.SCROLLBAR_SIZE, l = e * s + n + o + r;
|
|
905
888
|
t(this, T).style.height = `${l}px`;
|
|
906
889
|
}, "#applyAutoHeight"));
|
|
907
|
-
|
|
908
|
-
const e = Array.from(t(this, T).children).filter((c) => c.tagName === "TABLE"), s = t(this, T).getAttribute("auto-height") === "true", n = e.length, o = e.map((c,
|
|
909
|
-
const f = `<nine-table-sheet class="${
|
|
890
|
+
h(this, At, /* @__PURE__ */ a(() => {
|
|
891
|
+
const e = Array.from(t(this, T).children).filter((c) => c.tagName === "TABLE"), s = t(this, T).getAttribute("auto-height") === "true", n = e.length, o = e.map((c, d) => {
|
|
892
|
+
const f = `<nine-table-sheet class="${d === 0 ? "active" : ""}" data-index="${d}"></nine-table-sheet>`, g = d < n - 1 ? `<nine-splitter class="h" data-split-index="${d}"></nine-splitter>` : "";
|
|
910
893
|
return f + g;
|
|
911
|
-
}).join(""), r = e.map((c,
|
|
894
|
+
}).join(""), r = e.map((c, d) => `<div class="nine-tab-item ${d === 0 ? "active" : ""}" data-index="${d}">Sheet ${d + 1}</div>`).join("");
|
|
912
895
|
t(this, T).shadowRoot.innerHTML = `
|
|
913
896
|
<style>
|
|
914
897
|
:host {
|
|
@@ -1009,9 +992,9 @@ const Ft = class Ft {
|
|
|
1009
992
|
<nine-table-footer></nine-table-footer>
|
|
1010
993
|
`;
|
|
1011
994
|
const l = t(this, T).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1012
|
-
l == null || l.forEach((c,
|
|
1013
|
-
e[
|
|
1014
|
-
c.generate(e[
|
|
995
|
+
l == null || l.forEach((c, d) => {
|
|
996
|
+
e[d] && setTimeout(() => {
|
|
997
|
+
c.generate(e[d]), s && t(this, at).call(this);
|
|
1015
998
|
});
|
|
1016
999
|
});
|
|
1017
1000
|
}, "#render"));
|
|
@@ -1023,8 +1006,8 @@ let Dt = Ft;
|
|
|
1023
1006
|
var O, K;
|
|
1024
1007
|
const Zt = class Zt {
|
|
1025
1008
|
constructor(i) {
|
|
1026
|
-
|
|
1027
|
-
|
|
1009
|
+
h(this, O);
|
|
1010
|
+
h(this, K, -1);
|
|
1028
1011
|
w(this, "count", /* @__PURE__ */ a(() => t(this, O).rawRecords.length, "count"));
|
|
1029
1012
|
b(this, O, i);
|
|
1030
1013
|
}
|
|
@@ -1043,18 +1026,18 @@ const Zt = class Zt {
|
|
|
1043
1026
|
};
|
|
1044
1027
|
O = new WeakMap(), K = new WeakMap(), a(Zt, "ngRow");
|
|
1045
1028
|
let Pt = Zt;
|
|
1046
|
-
var
|
|
1047
|
-
const
|
|
1029
|
+
var A, v, q, Q, qt, z, Lt, ct, Ht, Ct, tt;
|
|
1030
|
+
const L = class L {
|
|
1048
1031
|
constructor(i, e) {
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1032
|
+
h(this, A);
|
|
1033
|
+
h(this, v);
|
|
1034
|
+
h(this, q, []);
|
|
1035
|
+
h(this, Q, []);
|
|
1036
|
+
h(this, qt, 0);
|
|
1037
|
+
h(this, z, []);
|
|
1038
|
+
h(this, Lt, /* @__PURE__ */ a(() => {
|
|
1056
1039
|
b(this, z, []);
|
|
1057
|
-
const i = t(this,
|
|
1040
|
+
const i = t(this, A).template || [];
|
|
1058
1041
|
Array.from(i).forEach((e) => {
|
|
1059
1042
|
var s;
|
|
1060
1043
|
t(this, z).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
@@ -1065,26 +1048,26 @@ const H = class H {
|
|
|
1065
1048
|
w(this, "set", /* @__PURE__ */ a((i) => {
|
|
1066
1049
|
this.clear(), this.add(i, !1);
|
|
1067
1050
|
}, "set"));
|
|
1068
|
-
|
|
1069
|
-
rowState:
|
|
1051
|
+
h(this, ct, /* @__PURE__ */ a(() => ({
|
|
1052
|
+
rowState: L.ROW_STATE.EMPTY,
|
|
1070
1053
|
deleted: !1,
|
|
1071
1054
|
filtered: !1,
|
|
1072
1055
|
height: t(this, z).slice(),
|
|
1073
1056
|
o: {},
|
|
1074
1057
|
c: {},
|
|
1075
|
-
_: [0, 0, 0, 0,
|
|
1058
|
+
_: [0, 0, 0, 0, L.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, z).slice(), -1, {}, {}]
|
|
1076
1059
|
}), "#getDefaultMeta"));
|
|
1077
1060
|
w(this, "reset", /* @__PURE__ */ a(() => {
|
|
1078
|
-
b(this,
|
|
1061
|
+
b(this, q, []), b(this, Q, []);
|
|
1079
1062
|
}, "reset"));
|
|
1080
1063
|
w(this, "clear", /* @__PURE__ */ a(() => {
|
|
1081
1064
|
var i;
|
|
1082
|
-
t(this, v).rawRecords = [], b(this,
|
|
1065
|
+
t(this, v).rawRecords = [], b(this, q, []), b(this, Q, []), (i = t(this, v).viewRecords) != null && i.reset && t(this, v).viewRecords.reset();
|
|
1083
1066
|
}, "clear"));
|
|
1084
|
-
|
|
1067
|
+
h(this, Ht, /* @__PURE__ */ a((i) => {
|
|
1085
1068
|
var n;
|
|
1086
1069
|
Array.isArray(i) || (i = [i]);
|
|
1087
|
-
const e = typeof ((n = t(this,
|
|
1070
|
+
const e = typeof ((n = t(this, A).fields) == null ? void 0 : n.get) == "function" ? t(this, A).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
1088
1071
|
return i.forEach((o) => {
|
|
1089
1072
|
const r = { v: [] };
|
|
1090
1073
|
e.forEach((l) => {
|
|
@@ -1092,8 +1075,8 @@ const H = class H {
|
|
|
1092
1075
|
}), s.push(r);
|
|
1093
1076
|
}), s;
|
|
1094
1077
|
}, "#json2Array"));
|
|
1095
|
-
|
|
1096
|
-
e.__ng = t(this, ct).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState =
|
|
1078
|
+
h(this, Ct, /* @__PURE__ */ a((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1079
|
+
e.__ng = t(this, ct).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = L.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1097
1080
|
}), i), "#defaultInsert"));
|
|
1098
1081
|
w(this, "add", /* @__PURE__ */ a((i, e = !0) => {
|
|
1099
1082
|
var o;
|
|
@@ -1103,17 +1086,17 @@ const H = class H {
|
|
|
1103
1086
|
const n = this.count() - 1;
|
|
1104
1087
|
return e || s.forEach((r, l) => {
|
|
1105
1088
|
const c = t(this, v).rawRecords[n - l];
|
|
1106
|
-
c && (c.__ng.rowState =
|
|
1089
|
+
c && (c.__ng.rowState = L.ROW_STATE.EMPTY);
|
|
1107
1090
|
}), (o = t(this, v).viewRecords) != null && o.reset && t(this, v).viewRecords.reset(), n;
|
|
1108
1091
|
}, "add"));
|
|
1109
1092
|
w(this, "delete", /* @__PURE__ */ a((i) => {
|
|
1110
1093
|
var s;
|
|
1111
1094
|
let e = [];
|
|
1112
1095
|
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this, v).owner.row.at] : e = [parseInt(i, 10)], e.sort((n, o) => o - n).forEach((n) => {
|
|
1113
|
-
if (t(this,
|
|
1114
|
-
const o = t(this,
|
|
1115
|
-
t(this,
|
|
1116
|
-
r.__ng.rowid === o && (r.__ng.deleted = !0, r.__ng.rowState =
|
|
1096
|
+
if (t(this, q)[n]) {
|
|
1097
|
+
const o = t(this, q)[n].__ng.rowid;
|
|
1098
|
+
t(this, q)[n].__ng.rowState === L.ROW_STATE.INSERT ? t(this, v).rawRecords = t(this, v).rawRecords.filter((r) => r.__ng.rowid !== o) : t(this, v).rawRecords.forEach((r) => {
|
|
1099
|
+
r.__ng.rowid === o && (r.__ng.deleted = !0, r.__ng.rowState = L.ROW_STATE.DELETE);
|
|
1117
1100
|
});
|
|
1118
1101
|
}
|
|
1119
1102
|
}), this.resetRecords(), (s = t(this, v).viewRecords) != null && s.reset && t(this, v).viewRecords.reset();
|
|
@@ -1121,25 +1104,25 @@ const H = class H {
|
|
|
1121
1104
|
w(this, "setValue", /* @__PURE__ */ a((i, e, s) => {
|
|
1122
1105
|
var c;
|
|
1123
1106
|
i = parseInt(i, 10);
|
|
1124
|
-
const o = (typeof ((c = t(this,
|
|
1107
|
+
const o = (typeof ((c = t(this, A).fields) == null ? void 0 : c.get) == "function" ? t(this, A).fields.get() : []).indexOf(e);
|
|
1125
1108
|
if (o < 0) return;
|
|
1126
1109
|
const r = this.getValidData()[i];
|
|
1127
1110
|
if (!r) return;
|
|
1128
1111
|
const l = r.v[o];
|
|
1129
|
-
l !== s && r.__ng.rowState !==
|
|
1112
|
+
l !== s && r.__ng.rowState !== L.ROW_STATE.INSERT && (r.__ng.o.hasOwnProperty(e) || (r.__ng.o[e] = l), r.__ng.rowState = L.ROW_STATE.UPDATE), r.v[o] = s, t(this, v).owner.refreshData && t(this, v).owner.refreshData(i);
|
|
1130
1113
|
}, "setValue"));
|
|
1131
1114
|
w(this, "resetRecords", /* @__PURE__ */ a(() => {
|
|
1132
|
-
b(this, Q, t(this, v).rawRecords.filter((i) => !i.__ng.deleted)), b(this,
|
|
1115
|
+
b(this, Q, t(this, v).rawRecords.filter((i) => !i.__ng.deleted)), b(this, q, t(this, v).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, v).rawRecords.forEach((i, e) => {
|
|
1133
1116
|
i.__ng.rowidx = e;
|
|
1134
|
-
}), t(this,
|
|
1117
|
+
}), t(this, q).forEach((i, e) => {
|
|
1135
1118
|
i.__ng.i = e;
|
|
1136
1119
|
});
|
|
1137
1120
|
}, "resetRecords"));
|
|
1138
|
-
w(this, "getValidData", /* @__PURE__ */ a(() => (t(this,
|
|
1139
|
-
|
|
1121
|
+
w(this, "getValidData", /* @__PURE__ */ a(() => (t(this, q).length === 0 && t(this, v).rawRecords.length > 0 && this.resetRecords(), t(this, q)), "getValidData"));
|
|
1122
|
+
h(this, tt, /* @__PURE__ */ a((i) => {
|
|
1140
1123
|
var s;
|
|
1141
1124
|
if (!i) return i;
|
|
1142
|
-
const e = typeof ((s = t(this,
|
|
1125
|
+
const e = typeof ((s = t(this, A).fields) == null ? void 0 : s.get) == "function" ? t(this, A).fields.get() : [];
|
|
1143
1126
|
return Array.isArray(i) ? i.filter((n) => !n.__ng.deleted).map((n) => {
|
|
1144
1127
|
const o = {};
|
|
1145
1128
|
return e.forEach((r, l) => {
|
|
@@ -1154,14 +1137,14 @@ const H = class H {
|
|
|
1154
1137
|
if (!s || s.length <= 0) return;
|
|
1155
1138
|
if (i == null) return t(this, tt).call(this, s);
|
|
1156
1139
|
if (i < 0 || i >= s.length) return null;
|
|
1157
|
-
const n = typeof ((o = t(this,
|
|
1140
|
+
const n = typeof ((o = t(this, A).fields) == null ? void 0 : o.get) == "function" ? t(this, A).fields.get() : [];
|
|
1158
1141
|
if (e != null) {
|
|
1159
1142
|
const r = n.indexOf(e);
|
|
1160
1143
|
return r >= 0 ? s[i].v[r] : null;
|
|
1161
1144
|
}
|
|
1162
1145
|
return t(this, tt).call(this, s[i]);
|
|
1163
1146
|
}, "get"));
|
|
1164
|
-
b(this,
|
|
1147
|
+
b(this, A, i), b(this, v, e), t(this, Lt).call(this);
|
|
1165
1148
|
}
|
|
1166
1149
|
get source() {
|
|
1167
1150
|
return t(this, tt).call(this, t(this, v).rawRecords);
|
|
@@ -1170,24 +1153,24 @@ const H = class H {
|
|
|
1170
1153
|
this.clear(), this.add(i, !1);
|
|
1171
1154
|
}
|
|
1172
1155
|
get nextId() {
|
|
1173
|
-
return ++
|
|
1156
|
+
return ++se(this, qt)._;
|
|
1174
1157
|
}
|
|
1175
1158
|
get length() {
|
|
1176
|
-
return t(this,
|
|
1159
|
+
return t(this, q).length;
|
|
1177
1160
|
}
|
|
1178
1161
|
getRowCount() {
|
|
1179
1162
|
return this.length;
|
|
1180
1163
|
}
|
|
1181
1164
|
};
|
|
1182
|
-
|
|
1183
|
-
w(
|
|
1165
|
+
A = new WeakMap(), v = new WeakMap(), q = new WeakMap(), Q = new WeakMap(), qt = new WeakMap(), z = new WeakMap(), Lt = new WeakMap(), ct = new WeakMap(), Ht = new WeakMap(), Ct = new WeakMap(), tt = new WeakMap(), a(L, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1166
|
+
w(L, "ROW_STATE", {
|
|
1184
1167
|
EMPTY: "EMPTY",
|
|
1185
1168
|
NORMAL: "NORMAL",
|
|
1186
1169
|
INSERT: "INSERT",
|
|
1187
1170
|
UPDATE: "UPDATE",
|
|
1188
1171
|
DELETE: "DELETE"
|
|
1189
1172
|
});
|
|
1190
|
-
let Bt =
|
|
1173
|
+
let Bt = L;
|
|
1191
1174
|
const Gt = class Gt {
|
|
1192
1175
|
constructor(i) {
|
|
1193
1176
|
this.owner = i, this.row = new Pt(this), this.data = new Bt(i, this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
@@ -1214,15 +1197,15 @@ const Jt = class Jt extends HTMLElement {
|
|
|
1214
1197
|
constructor() {
|
|
1215
1198
|
super();
|
|
1216
1199
|
//#created = false;
|
|
1217
|
-
|
|
1218
|
-
|
|
1200
|
+
h(this, j);
|
|
1201
|
+
h(this, Mt);
|
|
1219
1202
|
this.attachShadow({ mode: "open" }), b(this, j, new Nt(this));
|
|
1220
1203
|
}
|
|
1221
1204
|
connectedCallback() {
|
|
1222
|
-
b(this, Mt, new Dt(this)),
|
|
1205
|
+
b(this, Mt, new Dt(this)), H.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1223
1206
|
}
|
|
1224
1207
|
disconnectedCallback() {
|
|
1225
|
-
|
|
1208
|
+
H.log("NineTable disconnected.");
|
|
1226
1209
|
}
|
|
1227
1210
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1228
1211
|
get data() {
|
|
@@ -1238,6 +1221,6 @@ const Jt = class Jt extends HTMLElement {
|
|
|
1238
1221
|
}
|
|
1239
1222
|
};
|
|
1240
1223
|
j = new WeakMap(), Mt = new WeakMap(), a(Jt, "NineTable");
|
|
1241
|
-
let
|
|
1242
|
-
customElements.get("nine-table") || customElements.define("nine-table",
|
|
1224
|
+
let Vt = Jt;
|
|
1225
|
+
customElements.get("nine-table") || customElements.define("nine-table", Vt);
|
|
1243
1226
|
//# sourceMappingURL=nine-table.js.map
|