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