@ninebone/table 0.0.306 β 0.0.308
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 +223 -221
- 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
|
@@ -4,7 +4,7 @@ var ie = (x) => {
|
|
|
4
4
|
};
|
|
5
5
|
var oe = (x, i, e) => i in x ? ee(x, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : x[i] = e;
|
|
6
6
|
var a = (x, i) => ee(x, "name", { value: i, configurable: !0 });
|
|
7
|
-
var
|
|
7
|
+
var w = (x, i, e) => oe(x, typeof i != "symbol" ? i + "" : i, e), se = (x, i, e) => i.has(x) || ie("Cannot " + e);
|
|
8
8
|
var t = (x, i, e) => (se(x, i, "read from private field"), e ? e.call(x) : i.get(x)), d = (x, i, e) => i.has(x) ? ie("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(x) : i.set(x, e), b = (x, i, e, s) => (se(x, i, "write to private field"), s ? s.call(x, e) : i.set(x, e), e);
|
|
9
9
|
var ne = (x, i, e, s) => ({
|
|
10
10
|
set _(n) {
|
|
@@ -22,69 +22,69 @@ const Vt = class Vt extends re.constructor {
|
|
|
22
22
|
};
|
|
23
23
|
a(Vt, "Trace");
|
|
24
24
|
let $t = Vt;
|
|
25
|
-
const
|
|
26
|
-
var M, _, y,
|
|
25
|
+
const A = new $t();
|
|
26
|
+
var M, _, y, P, B, N, dt, Y, ft;
|
|
27
27
|
const Xt = class Xt extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
d(this, M);
|
|
31
31
|
d(this, _, !1);
|
|
32
32
|
d(this, y);
|
|
33
|
-
d(this, D);
|
|
34
33
|
d(this, P);
|
|
35
34
|
d(this, B);
|
|
35
|
+
d(this, N);
|
|
36
36
|
d(this, dt, /* @__PURE__ */ a(() => {
|
|
37
37
|
if (!t(this, M)) return;
|
|
38
38
|
const e = t(this, M).querySelector(".ng-container-body");
|
|
39
|
-
e && (b(this,
|
|
39
|
+
e && (b(this, N, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
|
-
})), t(this,
|
|
41
|
+
})), t(this, N).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
|
-
|
|
43
|
+
w(this, "refresh", /* @__PURE__ */ a(() => {
|
|
44
44
|
if (!t(this, M) || !t(this, y) || t(this, _)) return;
|
|
45
45
|
const e = t(this, y).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const n = t(this, y).track, o = t(this, y).thumb, r = t(this, M).querySelector(".ng-container-bottom"), l = e.clientWidth,
|
|
48
|
-
if (l !== 0 &&
|
|
47
|
+
const n = t(this, y).track, o = t(this, y).thumb, r = t(this, M).querySelector(".ng-container-bottom"), l = e.clientWidth, h = s.scrollWidth;
|
|
48
|
+
if (l !== 0 && h > 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 c = n.clientWidth;
|
|
55
|
+
if (c <= 0) return;
|
|
56
|
+
const u = Math.max(Math.min(c * (l / h), c), 20);
|
|
57
57
|
o.style.width = `${u}px`;
|
|
58
|
-
const f = e.scrollLeft, g =
|
|
58
|
+
const f = e.scrollLeft, g = h - l;
|
|
59
59
|
let p = 0;
|
|
60
|
-
g > 0 && (p = parseInt(f / g * (
|
|
61
|
-
const
|
|
62
|
-
p >
|
|
60
|
+
g > 0 && (p = parseInt(f / g * (c - u), 10)), p < 0 && (p = 0);
|
|
61
|
+
const E = c - u;
|
|
62
|
+
p > E && (p = E), o.style.left = `${p}px`, A.log(p), t(this, y).left.disabled = p === 0, t(this, y).right.disabled = p >= E - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
d(this,
|
|
64
|
+
d(this, Y, /* @__PURE__ */ a((e) => {
|
|
65
65
|
if (!t(this, y)) return !1;
|
|
66
66
|
const s = t(this, y).container, n = s.querySelector("table");
|
|
67
67
|
if (!n) return !1;
|
|
68
68
|
const o = t(this, y).track.getBoundingClientRect(), r = t(this, y).thumb.clientWidth;
|
|
69
69
|
let l = e;
|
|
70
70
|
l < 0 && (l = 0);
|
|
71
|
-
const
|
|
72
|
-
l >
|
|
73
|
-
const
|
|
74
|
-
return
|
|
71
|
+
const h = o.width - r;
|
|
72
|
+
l > h && (l = h), l = parseInt(l, 10), t(this, y).thumb.style.left = `${l}px`, t(this, y).left.disabled = l === 0, t(this, y).right.disabled = l >= h - 1;
|
|
73
|
+
const c = s.clientWidth, f = n.scrollWidth - c;
|
|
74
|
+
return h > 0 && f > 0 && (s.scrollLeft = l / h * f), l > 0 && l < h - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
76
|
d(this, ft, /* @__PURE__ */ a(() => {
|
|
77
77
|
const e = /* @__PURE__ */ a((n) => {
|
|
78
|
-
clearInterval(t(this,
|
|
78
|
+
clearInterval(t(this, P)), clearInterval(t(this, B));
|
|
79
79
|
const o = parseInt(t(this, y).thumb.style.left || 0, 10);
|
|
80
|
-
t(this,
|
|
81
|
-
clearInterval(t(this,
|
|
80
|
+
t(this, Y).call(this, o + n), b(this, P, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, P)), b(this, B, setInterval(() => {
|
|
82
82
|
const r = parseInt(t(this, y).thumb.style.left || 0, 10);
|
|
83
|
-
t(this,
|
|
83
|
+
t(this, Y).call(this, r + n) || clearInterval(t(this, B));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), s = /* @__PURE__ */ a(() => {
|
|
87
|
-
clearInterval(t(this,
|
|
87
|
+
clearInterval(t(this, P)), clearInterval(t(this, B));
|
|
88
88
|
}, "clearTimer");
|
|
89
89
|
["mouseup", "mouseleave", "touchend"].forEach((n) => {
|
|
90
90
|
t(this, y).left.addEventListener(n, s), t(this, y).right.addEventListener(n, s), t(this, y).track.addEventListener(n, s);
|
|
@@ -96,14 +96,14 @@ const Xt = class Xt extends HTMLElement {
|
|
|
96
96
|
if (n.button !== 0) return;
|
|
97
97
|
n.preventDefault();
|
|
98
98
|
const o = t(this, y).track.getBoundingClientRect(), r = t(this, y).thumb.clientWidth;
|
|
99
|
-
t(this,
|
|
99
|
+
t(this, Y).call(this, n.clientX - o.left - r / 2);
|
|
100
100
|
}), t(this, y).thumb.addEventListener("mousedown", (n) => {
|
|
101
101
|
if (n.button !== 0) return;
|
|
102
102
|
n.stopPropagation(), n.preventDefault(), b(this, _, !0), this.shiftX = n.clientX - t(this, y).thumb.getBoundingClientRect().left;
|
|
103
103
|
const o = /* @__PURE__ */ a((l) => {
|
|
104
104
|
if (!t(this, _)) return;
|
|
105
|
-
const
|
|
106
|
-
t(this,
|
|
105
|
+
const h = t(this, y).track.getBoundingClientRect();
|
|
106
|
+
t(this, Y).call(this, l.clientX - h.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), r = /* @__PURE__ */ a(() => {
|
|
108
108
|
b(this, _, !1), s(), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", r), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
@@ -195,80 +195,82 @@ const Xt = class Xt extends HTMLElement {
|
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
197
197
|
disconnectedCallback() {
|
|
198
|
-
t(this,
|
|
198
|
+
t(this, N) && t(this, N).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
M = new WeakMap(), _ = new WeakMap(), y = new WeakMap(),
|
|
201
|
+
M = new WeakMap(), _ = new WeakMap(), y = new WeakMap(), P = new WeakMap(), B = new WeakMap(), N = new WeakMap(), dt = new WeakMap(), Y = new WeakMap(), ft = new WeakMap(), a(Xt, "NineTableHScrollBar");
|
|
202
202
|
let _t = Xt;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", _t);
|
|
204
|
-
var
|
|
204
|
+
var V, I, S, it, st, ut;
|
|
205
205
|
const Ut = class Ut extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
-
d(this,
|
|
208
|
+
d(this, V);
|
|
209
209
|
d(this, I, !1);
|
|
210
|
-
d(this,
|
|
210
|
+
d(this, S);
|
|
211
211
|
d(this, it, 0);
|
|
212
212
|
d(this, st, 0);
|
|
213
213
|
/**
|
|
214
214
|
* π― μ€ν¬λ‘€λ° μμΉ λ° μΈλΈ ν¬κΈ° κ°±μ
|
|
215
215
|
*/
|
|
216
|
-
|
|
217
|
-
if (!t(this,
|
|
218
|
-
const e = t(this,
|
|
216
|
+
w(this, "refresh", /* @__PURE__ */ a(() => {
|
|
217
|
+
if (!t(this, V) || !t(this, S) || t(this, I)) return;
|
|
218
|
+
const e = t(this, S).container, s = e.querySelector("table");
|
|
219
219
|
if (!s) return;
|
|
220
|
-
const n = t(this,
|
|
220
|
+
const n = t(this, S).track, o = t(this, S).thumb, r = e.clientHeight, l = s.scrollHeight;
|
|
221
221
|
if (l <= r) {
|
|
222
|
-
o.style.display = "none", t(this,
|
|
222
|
+
o.style.display = "none", t(this, S).top.disabled = !0, t(this, S).bottom.disabled = !0;
|
|
223
223
|
return;
|
|
224
224
|
} else
|
|
225
225
|
o.style.display = "block";
|
|
226
|
-
const
|
|
227
|
-
if (
|
|
228
|
-
const
|
|
229
|
-
o.style.height = `${
|
|
226
|
+
const h = n.clientHeight;
|
|
227
|
+
if (h <= 0) return;
|
|
228
|
+
const c = Math.max(Math.min(h * (r / l), h), 20);
|
|
229
|
+
o.style.height = `${c}px`;
|
|
230
230
|
const u = e.scrollTop, f = l - r;
|
|
231
231
|
let g = 0;
|
|
232
|
-
f > 0 && (g = u / f * (
|
|
233
|
-
const p =
|
|
234
|
-
g < 0 && (g = 0), g > p && (g = p), o.style.top = `${g}px`, t(this,
|
|
232
|
+
f > 0 && (g = u / f * (h - c));
|
|
233
|
+
const p = h - c;
|
|
234
|
+
g < 0 && (g = 0), g > p && (g = p), 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
|
d(this, ut, /* @__PURE__ */ a(() => {
|
|
237
|
-
const e = t(this,
|
|
237
|
+
const e = t(this, S).container, s = e.querySelector("table");
|
|
238
238
|
e.addEventListener("scroll", () => {
|
|
239
239
|
t(this, I) || this.refresh();
|
|
240
|
-
}), t(this,
|
|
241
|
-
if (
|
|
242
|
-
|
|
243
|
-
const
|
|
240
|
+
}), t(this, S).thumb.addEventListener("mousedown", (n) => {
|
|
241
|
+
if (n.button !== 0) return;
|
|
242
|
+
n.stopPropagation(), n.preventDefault(), b(this, I, !0), b(this, it, n.clientY), b(this, st, e.scrollTop);
|
|
243
|
+
const o = /* @__PURE__ */ a((l) => {
|
|
244
244
|
if (!t(this, I)) return;
|
|
245
|
-
const
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
245
|
+
const h = t(this, S).track.getBoundingClientRect(), c = t(this, S).thumb.clientHeight, f = h.height - c, g = l.clientY - t(this, it), p = e.clientHeight;
|
|
246
|
+
A.log(s), A.log(s.scrollHeight);
|
|
247
|
+
const k = s.scrollHeight - p;
|
|
248
|
+
if (f > 0 && k > 0) {
|
|
249
|
+
const D = g / f * k;
|
|
250
|
+
e.scrollTop = t(this, st) + D;
|
|
249
251
|
}
|
|
250
252
|
this.refresh();
|
|
251
|
-
}, "onMouseMove"),
|
|
252
|
-
b(this, I, !1), document.removeEventListener("mousemove",
|
|
253
|
+
}, "onMouseMove"), r = /* @__PURE__ */ a(() => {
|
|
254
|
+
b(this, I, !1), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", r), this.refresh();
|
|
253
255
|
}, "onMouseUp");
|
|
254
|
-
document.addEventListener("mousemove",
|
|
255
|
-
}), t(this,
|
|
256
|
-
if (
|
|
257
|
-
const
|
|
258
|
-
if (c > 0 &&
|
|
259
|
-
const
|
|
260
|
-
e.scrollTop =
|
|
256
|
+
document.addEventListener("mousemove", o), document.addEventListener("mouseup", r);
|
|
257
|
+
}), t(this, S).track.addEventListener("mousedown", (n) => {
|
|
258
|
+
if (n.button !== 0 || n.target === t(this, S).thumb) return;
|
|
259
|
+
const o = t(this, S).track.getBoundingClientRect(), r = t(this, S).thumb.clientHeight, l = n.clientY - o.top - r / 2, c = o.height - r, u = e.clientHeight, g = e.querySelector("table").scrollHeight - u;
|
|
260
|
+
if (c > 0 && g > 0) {
|
|
261
|
+
const p = Math.max(0, Math.min(1, l / c));
|
|
262
|
+
e.scrollTop = p * g;
|
|
261
263
|
}
|
|
262
264
|
this.refresh();
|
|
263
|
-
}), t(this,
|
|
265
|
+
}), t(this, S).top.addEventListener("click", () => {
|
|
264
266
|
e.scrollTop -= 40;
|
|
265
|
-
}), t(this,
|
|
267
|
+
}), t(this, S).bottom.addEventListener("click", () => {
|
|
266
268
|
e.scrollTop += 40;
|
|
267
269
|
});
|
|
268
270
|
}, "#init"));
|
|
269
271
|
}
|
|
270
272
|
connectedCallback() {
|
|
271
|
-
if (b(this,
|
|
273
|
+
if (b(this, V, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, V)) return;
|
|
272
274
|
this.innerHTML = `
|
|
273
275
|
<style>
|
|
274
276
|
nine-table-vscrollbar {
|
|
@@ -333,12 +335,12 @@ const Ut = class Ut extends HTMLElement {
|
|
|
333
335
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
334
336
|
`;
|
|
335
337
|
const e = /* @__PURE__ */ a(() => {
|
|
336
|
-
const s = t(this,
|
|
338
|
+
const s = t(this, V).querySelector(".ng-container-body");
|
|
337
339
|
if (!s) {
|
|
338
340
|
setTimeout(e, 10);
|
|
339
341
|
return;
|
|
340
342
|
}
|
|
341
|
-
b(this,
|
|
343
|
+
b(this, S, {
|
|
342
344
|
container: s,
|
|
343
345
|
track: this.querySelector(".ng-scroll-track"),
|
|
344
346
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
@@ -349,10 +351,10 @@ const Ut = class Ut extends HTMLElement {
|
|
|
349
351
|
e();
|
|
350
352
|
}
|
|
351
353
|
};
|
|
352
|
-
|
|
354
|
+
V = new WeakMap(), I = new WeakMap(), S = new WeakMap(), it = new WeakMap(), st = new WeakMap(), ut = new WeakMap(), a(Ut, "NineTableVScrollBar");
|
|
353
355
|
let It = Ut;
|
|
354
356
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", It);
|
|
355
|
-
var gt,
|
|
357
|
+
var gt, F;
|
|
356
358
|
const C = class C {
|
|
357
359
|
/**
|
|
358
360
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
@@ -367,15 +369,15 @@ const C = class C {
|
|
|
367
369
|
var n, o, r, l;
|
|
368
370
|
if (!i) return null;
|
|
369
371
|
const e = i.cloneNode(!0);
|
|
370
|
-
return t(n = C, gt).call(n, e), t(o = C,
|
|
371
|
-
const u =
|
|
372
|
-
u && e.querySelectorAll(`thead [data-col="${
|
|
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((h, c) => {
|
|
373
|
+
const u = h.getAttribute("fixed");
|
|
374
|
+
u && e.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((f) => {
|
|
373
375
|
f.setAttribute("fixed", u);
|
|
374
376
|
});
|
|
375
377
|
}), e;
|
|
376
378
|
}
|
|
377
379
|
};
|
|
378
|
-
gt = new WeakMap(),
|
|
380
|
+
gt = new WeakMap(), F = new WeakMap(), a(C, "TableCompiler"), d(C, gt, /* @__PURE__ */ a((i) => {
|
|
379
381
|
if (!i.querySelector("colgroup")) {
|
|
380
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);
|
|
381
383
|
for (let r = 0; r < s; r++) {
|
|
@@ -389,41 +391,41 @@ gt = new WeakMap(), j = new WeakMap(), a(C, "TableCompiler"), d(C, gt, /* @__PUR
|
|
|
389
391
|
s ? s.after(e) : i.prepend(e);
|
|
390
392
|
}
|
|
391
393
|
i.classList.add("nine-table-element"), i.style.display = "table";
|
|
392
|
-
}, "#ensureTableStructure")), d(C,
|
|
394
|
+
}, "#ensureTableStructure")), d(C, F, /* @__PURE__ */ a((i, e) => {
|
|
393
395
|
const s = Array.from(i.querySelectorAll(e + " tr")), n = Array.from(i.querySelectorAll(e + " th," + e + " td")), o = s.length;
|
|
394
396
|
if (o === 0 || n.length === 0) return;
|
|
395
397
|
let r = 0;
|
|
396
|
-
n.forEach((
|
|
397
|
-
r +=
|
|
398
|
+
n.forEach((h) => {
|
|
399
|
+
r += h.colSpan || 1;
|
|
398
400
|
});
|
|
399
401
|
const l = Array.from(Array(o), () => Array(r).fill(null));
|
|
400
|
-
s.forEach((
|
|
401
|
-
const
|
|
402
|
+
s.forEach((h) => {
|
|
403
|
+
const c = h.sectionRowIndex;
|
|
402
404
|
let u = 0;
|
|
403
|
-
Array.from(
|
|
404
|
-
for (let
|
|
405
|
-
if (l[
|
|
406
|
-
u =
|
|
405
|
+
Array.from(h.querySelectorAll("th,td")).forEach((f) => {
|
|
406
|
+
for (let E = 0; E < l[c].length; E++)
|
|
407
|
+
if (l[c][E] === null) {
|
|
408
|
+
u = E;
|
|
407
409
|
break;
|
|
408
410
|
}
|
|
409
411
|
const g = f.rowSpan || 1, p = f.colSpan || 1;
|
|
410
|
-
for (let
|
|
412
|
+
for (let E = 0; E < g; E++)
|
|
411
413
|
for (let k = 0; k < p; k++)
|
|
412
|
-
|
|
414
|
+
c + E < o && u + k < r && (l[c + E][u + k] = E === 0 && k === 0 ? "1" : "0");
|
|
413
415
|
});
|
|
414
|
-
}), s.forEach((
|
|
415
|
-
const
|
|
416
|
-
Array.from(
|
|
417
|
-
for (let f = 0; f < l[
|
|
418
|
-
if (l[
|
|
419
|
-
u.dataset.col = f, l[
|
|
416
|
+
}), s.forEach((h) => {
|
|
417
|
+
const c = h.sectionRowIndex;
|
|
418
|
+
Array.from(h.querySelectorAll("th,td")).forEach((u) => {
|
|
419
|
+
for (let f = 0; f < l[c].length; f++)
|
|
420
|
+
if (l[c][f] === "1") {
|
|
421
|
+
u.dataset.col = f, l[c][f] = "0";
|
|
420
422
|
break;
|
|
421
423
|
}
|
|
422
424
|
});
|
|
423
425
|
});
|
|
424
426
|
}, "#resetColIndex"));
|
|
425
427
|
let Wt = C;
|
|
426
|
-
var m, $, R, W,
|
|
428
|
+
var m, $, R, W, X, U, bt, pt, nt, ot, yt, mt, rt, Z, xt;
|
|
427
429
|
const Kt = class Kt {
|
|
428
430
|
constructor(i) {
|
|
429
431
|
d(this, m);
|
|
@@ -431,21 +433,21 @@ const Kt = class Kt {
|
|
|
431
433
|
// κ° μ»¨ν
μ΄λλ³ λ
립λ ν
νλ¦Ώ TR κ΄λ¦¬
|
|
432
434
|
d(this, R, null);
|
|
433
435
|
d(this, W, null);
|
|
434
|
-
d(this,
|
|
435
|
-
d(this,
|
|
436
|
+
d(this, X, 0);
|
|
437
|
+
d(this, U, 40);
|
|
436
438
|
/**
|
|
437
439
|
* π― μΈλΆμμ λ°μ΄ν°κ° λ‘λλκ±°λ λ³κ²½λ ν κ°μ λμ΄μ λ·°λ₯Ό μ¬κ°±μ νλ νΌλΈλ¦ λ©μλ
|
|
438
440
|
*/
|
|
439
|
-
|
|
441
|
+
w(this, "refresh", /* @__PURE__ */ a(() => {
|
|
440
442
|
var e;
|
|
441
443
|
const i = t(this, m).querySelector(".ng-container-body");
|
|
442
|
-
i && (t(this, nt).call(this), t(this,
|
|
444
|
+
i && (t(this, nt).call(this), t(this, Z).call(this, i.scrollTop), (e = t(this, m).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
443
445
|
}, "refresh"));
|
|
444
446
|
/**
|
|
445
447
|
* π― NineTableSheetμμ λ§μ€ν° ν
μ΄λΈμ μ λ¬λ°μ κ° μμλ³ ν
μ΄λΈ μμ± λ° ν
νλ¦Ώ μΆμΆ μΌμν
|
|
446
448
|
*/
|
|
447
449
|
// [RowManager.js μμ λ΄μ© λ°μ·]
|
|
448
|
-
|
|
450
|
+
w(this, "initialize", /* @__PURE__ */ a(() => {
|
|
449
451
|
b(this, R, null), t(this, $).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
450
452
|
const s = t(this, m).querySelector(e);
|
|
451
453
|
if (!s) return;
|
|
@@ -453,17 +455,17 @@ const Kt = class Kt {
|
|
|
453
455
|
if (!n) return;
|
|
454
456
|
const o = n.querySelector("tbody");
|
|
455
457
|
if (!o) return;
|
|
456
|
-
const l = Array.from(o.querySelectorAll("tr")).map((
|
|
458
|
+
const l = Array.from(o.querySelectorAll("tr")).map((h) => h.cloneNode(!0));
|
|
457
459
|
t(this, $).set(e, l);
|
|
458
460
|
});
|
|
459
461
|
const i = t(this, m).querySelector(".ng-container-body");
|
|
460
462
|
if (i) {
|
|
461
|
-
t(this, pt).call(this, i), t(this, rt).call(this), t(this, nt).call(this), t(this,
|
|
463
|
+
t(this, pt).call(this, i), t(this, rt).call(this), t(this, nt).call(this), t(this, Z).call(this, i.scrollTop);
|
|
462
464
|
let e = i.scrollTop;
|
|
463
465
|
i.addEventListener("scroll", () => {
|
|
464
466
|
var n;
|
|
465
467
|
const s = i.scrollTop;
|
|
466
|
-
|
|
468
|
+
A.log(e, s), e !== s && (e = s, t(this, Z).call(this, s)), (n = t(this, m).querySelector("nine-table-vscrollbar")) == null || n.refresh();
|
|
467
469
|
});
|
|
468
470
|
}
|
|
469
471
|
}, "initialize"));
|
|
@@ -474,9 +476,9 @@ const Kt = class Kt {
|
|
|
474
476
|
if (!n) return;
|
|
475
477
|
n.querySelectorAll("tr:not(.nodata)").forEach((l) => l.remove());
|
|
476
478
|
const o = n.querySelector("tr.nodata"), r = document.createDocumentFragment();
|
|
477
|
-
for (let l = 0; l < t(this,
|
|
478
|
-
s.forEach((
|
|
479
|
-
r.appendChild(
|
|
479
|
+
for (let l = 0; l < t(this, U); l++)
|
|
480
|
+
s.forEach((h) => {
|
|
481
|
+
r.appendChild(h.cloneNode(!0));
|
|
480
482
|
});
|
|
481
483
|
o ? o.before(r) : n.appendChild(r);
|
|
482
484
|
}, "#renderRows"));
|
|
@@ -495,13 +497,13 @@ const Kt = class Kt {
|
|
|
495
497
|
e.forEach((g) => {
|
|
496
498
|
o.appendChild(g.cloneNode(!0));
|
|
497
499
|
}), n ? n.before(o) : s.appendChild(o);
|
|
498
|
-
const r = t(this, m), l = r.style.display,
|
|
500
|
+
const r = t(this, m), l = r.style.display, h = r.style.visibility, c = r.style.position;
|
|
499
501
|
(l === "none" || window.getComputedStyle(r).display === "none") && (r.style.display = "block", r.style.visibility = "hidden", r.style.position = "absolute");
|
|
500
502
|
let u = 0;
|
|
501
503
|
const f = s.querySelectorAll("tr:not(.nodata)");
|
|
502
504
|
return f.forEach((g) => {
|
|
503
505
|
u += g.offsetHeight || g.getBoundingClientRect().height;
|
|
504
|
-
}), f.forEach((g) => g.remove()), r.style.display = l, r.style.visibility =
|
|
506
|
+
}), f.forEach((g) => g.remove()), r.style.display = l, r.style.visibility = h, r.style.position = c, b(this, R, u > 0 ? u : 24), t(this, ot).call(this), A.log(`[RowManager] Height Cached: ${t(this, R)}px | RowCount: ${t(this, U)}`), t(this, R);
|
|
505
507
|
}, "#measureAndCacheHeight"));
|
|
506
508
|
/**
|
|
507
509
|
* π― μ 체 λ°μ΄ν° κ°μ κΈ°λ°μΌλ‘ κ°μ μ€ν¬λ‘€ λμ΄ μ€μ
|
|
@@ -510,30 +512,30 @@ const Kt = class Kt {
|
|
|
510
512
|
* π― μ 체 λ°μ΄ν° κ°μ κΈ°λ°μΌλ‘ κ°μ μ€ν¬λ‘€ λμ΄ μ€μ
|
|
511
513
|
*/
|
|
512
514
|
d(this, nt, /* @__PURE__ */ a(() => {
|
|
513
|
-
var o, r, l,
|
|
515
|
+
var o, r, l, h;
|
|
514
516
|
if (!t(this, m).querySelector(".ng-container-body")) return;
|
|
515
|
-
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) ?? ((
|
|
516
|
-
|
|
517
|
-
const u = t(this, m).querySelector(
|
|
518
|
-
f ? (f.style.height = `${n}px`,
|
|
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) ?? ((h = t(this, m).data) == null ? void 0 : h.length) ?? 0, s = t(this, R) || 24, n = e * s;
|
|
518
|
+
A.log(`[RowManager] TotalCount: ${e} | RowHeight: ${s}px | TotalVirtualHeight: ${n}px`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((c) => {
|
|
519
|
+
const u = t(this, m).querySelector(c), f = u == null ? void 0 : u.querySelector("table");
|
|
520
|
+
f ? (f.style.height = `${n}px`, A.log(`[RowManager] Applied height to ${c} table:`, f.style.height)) : A.log(`[RowManager] Table not found for selector: ${c}`);
|
|
519
521
|
});
|
|
520
522
|
}, "#updateVirtualScrollHeight"));
|
|
521
523
|
d(this, ot, /* @__PURE__ */ a(() => {
|
|
522
|
-
if (t(this,
|
|
523
|
-
const i = Math.ceil(t(this,
|
|
524
|
-
b(this,
|
|
524
|
+
if (t(this, X) > 0 && t(this, R) > 0) {
|
|
525
|
+
const i = Math.ceil(t(this, X) / t(this, R));
|
|
526
|
+
b(this, U, i + 20);
|
|
525
527
|
} else
|
|
526
|
-
b(this,
|
|
528
|
+
b(this, U, 40);
|
|
527
529
|
}, "#updateRowCount"));
|
|
528
530
|
d(this, yt, /* @__PURE__ */ a(() => {
|
|
529
|
-
var
|
|
531
|
+
var h, c, u;
|
|
530
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");
|
|
531
533
|
if (!e) return;
|
|
532
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);
|
|
533
535
|
for (let f = 0; f < l; f++) {
|
|
534
536
|
const g = [
|
|
535
|
-
((
|
|
536
|
-
((
|
|
537
|
+
((h = n[f]) == null ? void 0 : h.getBoundingClientRect().height) || 0,
|
|
538
|
+
((c = o[f]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
537
539
|
((u = r[f]) == null ? void 0 : u.getBoundingClientRect().height) || 0
|
|
538
540
|
], p = Math.max(...g);
|
|
539
541
|
p > 0 && (n[f] && (n[f].style.height = `${p}px`), o[f] && (o[f].style.height = `${p}px`), r[f] && (r[f].style.height = `${p}px`));
|
|
@@ -553,7 +555,7 @@ const Kt = class Kt {
|
|
|
553
555
|
const r = s.querySelector("thead");
|
|
554
556
|
r && (o += r.offsetHeight || r.getBoundingClientRect().height);
|
|
555
557
|
const l = Math.max(n - o, 100);
|
|
556
|
-
t(this,
|
|
558
|
+
t(this, X) !== l && (b(this, X, l), t(this, ot).call(this), t(this, R) !== null && t(this, rt).call(this));
|
|
557
559
|
}
|
|
558
560
|
}
|
|
559
561
|
})), t(this, W).observe(t(this, m)));
|
|
@@ -576,28 +578,28 @@ const Kt = class Kt {
|
|
|
576
578
|
/**
|
|
577
579
|
* π― μ€ν¬λ‘€ μμΉμ λ°λ₯Έ λ°μ΄ν° λ°μΈλ© λ° tbody λ―ΈμΈ ν½μ
μ΄λ(translateY) κ°±μ
|
|
578
580
|
*/
|
|
579
|
-
d(this,
|
|
581
|
+
d(this, Z, /* @__PURE__ */ a((i) => {
|
|
580
582
|
var r;
|
|
581
583
|
const e = t(this, R);
|
|
582
584
|
if (!e || e <= 0) {
|
|
583
|
-
|
|
585
|
+
A.log("[RowManager] #handleScroll Aborted: rowHeight is invalid", e);
|
|
584
586
|
return;
|
|
585
587
|
}
|
|
586
588
|
const s = Math.max(0, Math.floor(i / e)), n = i % e;
|
|
587
|
-
|
|
589
|
+
A.log(`[RowManager] ScrollTop: ${i} | StartIndex: ${s} | OffsetY: ${n}px`);
|
|
588
590
|
const o = ((r = t(this, $).get(".ng-container-body")) == null ? void 0 : r.length) || 1;
|
|
589
591
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((l) => {
|
|
590
|
-
const
|
|
591
|
-
if (!
|
|
592
|
-
const
|
|
593
|
-
if (!
|
|
594
|
-
|
|
592
|
+
const h = t(this, m).querySelector(l);
|
|
593
|
+
if (!h) return;
|
|
594
|
+
const c = h.querySelector("tbody");
|
|
595
|
+
if (!c) {
|
|
596
|
+
A.log(`[RowManager] tbody not found for selector: ${l}`);
|
|
595
597
|
return;
|
|
596
598
|
}
|
|
597
|
-
window.getComputedStyle(
|
|
598
|
-
var k,
|
|
599
|
-
const p = s + Math.floor(g / o),
|
|
600
|
-
|
|
599
|
+
window.getComputedStyle(c).position === "static" && (c.style.position = "relative"), c.style.transform = `translateY(-${n}px)`, c.style.willChange = "transform", Array.from(c.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";
|
|
601
603
|
});
|
|
602
604
|
});
|
|
603
605
|
}, "#handleScroll"));
|
|
@@ -610,7 +612,7 @@ const Kt = class Kt {
|
|
|
610
612
|
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;
|
|
611
613
|
});
|
|
612
614
|
}, "#bindRowData"));
|
|
613
|
-
|
|
615
|
+
w(this, "destroy", /* @__PURE__ */ a(() => {
|
|
614
616
|
t(this, W) && (t(this, W).disconnect(), b(this, W, null));
|
|
615
617
|
}, "destroy"));
|
|
616
618
|
b(this, m, i), t(this, mt).call(this);
|
|
@@ -623,14 +625,14 @@ const Kt = class Kt {
|
|
|
623
625
|
return ((e = t(this, $).get(i)) == null ? void 0 : e.length) || 1;
|
|
624
626
|
}
|
|
625
627
|
};
|
|
626
|
-
m = new WeakMap(), $ = new WeakMap(), R = new WeakMap(), W = new WeakMap(),
|
|
628
|
+
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");
|
|
627
629
|
let Ot = Kt;
|
|
628
|
-
var
|
|
630
|
+
var G, J, vt, wt, St, Et, Rt;
|
|
629
631
|
const et = class et extends HTMLElement {
|
|
630
632
|
constructor() {
|
|
631
633
|
super();
|
|
632
|
-
d(this,
|
|
633
|
-
d(this,
|
|
634
|
+
d(this, G, null);
|
|
635
|
+
d(this, J);
|
|
634
636
|
d(this, vt, /* @__PURE__ */ a(() => {
|
|
635
637
|
[
|
|
636
638
|
{ selector: ".ng-container-body", type: null },
|
|
@@ -639,7 +641,7 @@ const et = class et extends HTMLElement {
|
|
|
639
641
|
].forEach(({ selector: s, type: n }) => {
|
|
640
642
|
const o = this.querySelector(s);
|
|
641
643
|
if (!o) return;
|
|
642
|
-
const r = t(this, St).call(this, t(this,
|
|
644
|
+
const r = t(this, St).call(this, t(this, G), n);
|
|
643
645
|
o.innerHTML = "", o.appendChild(r);
|
|
644
646
|
});
|
|
645
647
|
}, "#renderSplitContainers"));
|
|
@@ -654,8 +656,8 @@ const et = class et extends HTMLElement {
|
|
|
654
656
|
}), s.style.flex = `0 0 ${o}px`, s.style.width = `${o}px`;
|
|
655
657
|
});
|
|
656
658
|
}, "#updateContainerWidths"));
|
|
657
|
-
|
|
658
|
-
e && (b(this,
|
|
659
|
+
w(this, "generate", /* @__PURE__ */ a((e) => {
|
|
660
|
+
e && (b(this, G, Wt.compile(e)), t(this, G).style.display = "table", t(this, vt).call(this), t(this, wt).call(this), t(this, J).initialize(), setTimeout(() => {
|
|
659
661
|
var s;
|
|
660
662
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
661
663
|
}, 0));
|
|
@@ -673,12 +675,12 @@ const et = class et extends HTMLElement {
|
|
|
673
675
|
o.remove();
|
|
674
676
|
}), n;
|
|
675
677
|
}, "#createSplitTable"));
|
|
676
|
-
|
|
677
|
-
|
|
678
|
+
w(this, "getRowHeight", /* @__PURE__ */ a(() => t(this, J).getRowHeight(), "getRowHeight"));
|
|
679
|
+
w(this, "scrollToX", /* @__PURE__ */ a((e) => {
|
|
678
680
|
const s = this.querySelector(".ng-container-body");
|
|
679
681
|
s && (s.scrollLeft = e);
|
|
680
682
|
}, "scrollToX"));
|
|
681
|
-
|
|
683
|
+
w(this, "scrollToY", /* @__PURE__ */ a((e) => {
|
|
682
684
|
const s = this.querySelector(".ng-container-body");
|
|
683
685
|
s && (s.scrollTop = e);
|
|
684
686
|
}, "scrollToY"));
|
|
@@ -822,16 +824,16 @@ const et = class et extends HTMLElement {
|
|
|
822
824
|
</div>
|
|
823
825
|
`;
|
|
824
826
|
}, "#render"));
|
|
825
|
-
b(this,
|
|
827
|
+
b(this, J, new Ot(this));
|
|
826
828
|
}
|
|
827
829
|
connectedCallback() {
|
|
828
830
|
t(this, Et).call(this);
|
|
829
831
|
}
|
|
830
832
|
disconnectedCallback() {
|
|
831
|
-
this.innerHTML = "",
|
|
833
|
+
this.innerHTML = "", A.log("NineTableSheet destroyed.");
|
|
832
834
|
}
|
|
833
835
|
};
|
|
834
|
-
|
|
836
|
+
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);
|
|
835
837
|
let ht = et;
|
|
836
838
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", ht);
|
|
837
839
|
var Tt, lt;
|
|
@@ -852,15 +854,15 @@ const jt = class jt extends HTMLElement {
|
|
|
852
854
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((p) => p.style.setProperty("display", "none"));
|
|
853
855
|
const g = u.filter((p) => p.classList.contains("active"));
|
|
854
856
|
g.length < 2 || g.forEach((p) => {
|
|
855
|
-
const
|
|
856
|
-
k &&
|
|
857
|
+
const E = parseInt(p.getAttribute("data-index"), 10), k = this.querySelector(`nine-splitter[data-split-index="${E}"]`), D = u[E + 1];
|
|
858
|
+
k && D && D.classList.contains("active") && k.style.setProperty("display", "flex");
|
|
857
859
|
});
|
|
858
|
-
}, "updateSplitters"), o = this.querySelector(".nine-tab-bar"), r = this.querySelector("nine-table-sheets-body"), l = o.querySelectorAll(".nine-tab-item"),
|
|
860
|
+
}, "updateSplitters"), o = this.querySelector(".nine-tab-bar"), r = this.querySelector("nine-table-sheets-body"), l = o.querySelectorAll(".nine-tab-item"), h = r.querySelectorAll("nine-table-sheet");
|
|
859
861
|
if (!l[e]) return;
|
|
860
862
|
if (!s)
|
|
861
863
|
l.forEach((u, f) => {
|
|
862
864
|
u.classList.toggle("active", f === e);
|
|
863
|
-
}),
|
|
865
|
+
}), h.forEach((u, f) => {
|
|
864
866
|
const g = f === e;
|
|
865
867
|
u.classList.toggle("active", g), u.style.flex = g ? "1 1 100%" : "";
|
|
866
868
|
});
|
|
@@ -872,9 +874,9 @@ const jt = class jt extends HTMLElement {
|
|
|
872
874
|
const g = r.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
873
875
|
g && (g.classList.toggle("active"), g.classList.contains("active") || (g.style.flex = ""));
|
|
874
876
|
}
|
|
875
|
-
const
|
|
876
|
-
|
|
877
|
-
u.style.flex =
|
|
877
|
+
const c = r.querySelectorAll("nine-table-sheet.active");
|
|
878
|
+
c == null || c.forEach((u) => {
|
|
879
|
+
u.style.flex = c.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
878
880
|
}), n();
|
|
879
881
|
}, "#switchSheet"));
|
|
880
882
|
}
|
|
@@ -896,17 +898,17 @@ const Ft = class Ft {
|
|
|
896
898
|
}).observe(t(this, T));
|
|
897
899
|
}, "#init"));
|
|
898
900
|
d(this, at, /* @__PURE__ */ a(() => {
|
|
899
|
-
var
|
|
901
|
+
var h, c;
|
|
900
902
|
const i = Array.from(t(this, T).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
901
903
|
if (i.length === 0) return;
|
|
902
|
-
const e = parseInt(t(this, T).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((u) => u.getRowHeight())), n = (
|
|
904
|
+
const e = parseInt(t(this, T).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((u) => u.getRowHeight())), n = (h = t(this, T).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : h.getBoundingClientRect().height, o = (c = t(this, T).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : c.getBoundingClientRect().height, r = ht.SCROLLBAR_SIZE, l = e * s + n + o + r;
|
|
903
905
|
t(this, T).style.height = `${l}px`;
|
|
904
906
|
}, "#applyAutoHeight"));
|
|
905
907
|
d(this, At, /* @__PURE__ */ a(() => {
|
|
906
|
-
const e = Array.from(t(this, T).children).filter((
|
|
907
|
-
const f = `<nine-table-sheet class="${
|
|
908
|
+
const e = Array.from(t(this, T).children).filter((h) => h.tagName === "TABLE"), s = t(this, T).getAttribute("auto-height") === "true", n = e.length, o = e.map((h, c) => {
|
|
909
|
+
const f = `<nine-table-sheet class="${c === 0 ? "active" : ""}" data-index="${c}"></nine-table-sheet>`, g = c < n - 1 ? `<nine-splitter class="h" data-split-index="${c}"></nine-splitter>` : "";
|
|
908
910
|
return f + g;
|
|
909
|
-
}).join(""), r = e.map((
|
|
911
|
+
}).join(""), r = e.map((h, c) => `<div class="nine-tab-item ${c === 0 ? "active" : ""}" data-index="${c}">Sheet ${c + 1}</div>`).join("");
|
|
910
912
|
t(this, T).shadowRoot.innerHTML = `
|
|
911
913
|
<style>
|
|
912
914
|
:host {
|
|
@@ -1007,9 +1009,9 @@ const Ft = class Ft {
|
|
|
1007
1009
|
<nine-table-footer></nine-table-footer>
|
|
1008
1010
|
`;
|
|
1009
1011
|
const l = t(this, T).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1010
|
-
l == null || l.forEach((
|
|
1011
|
-
e[
|
|
1012
|
-
|
|
1012
|
+
l == null || l.forEach((h, c) => {
|
|
1013
|
+
e[c] && setTimeout(() => {
|
|
1014
|
+
h.generate(e[c]), s && t(this, at).call(this);
|
|
1013
1015
|
});
|
|
1014
1016
|
});
|
|
1015
1017
|
}, "#render"));
|
|
@@ -1018,41 +1020,41 @@ const Ft = class Ft {
|
|
|
1018
1020
|
};
|
|
1019
1021
|
T = new WeakMap(), kt = new WeakMap(), at = new WeakMap(), At = new WeakMap(), a(Ft, "LayoutManager");
|
|
1020
1022
|
let Dt = Ft;
|
|
1021
|
-
var O,
|
|
1023
|
+
var O, K;
|
|
1022
1024
|
const Zt = class Zt {
|
|
1023
1025
|
constructor(i) {
|
|
1024
1026
|
d(this, O);
|
|
1025
|
-
d(this,
|
|
1026
|
-
|
|
1027
|
+
d(this, K, -1);
|
|
1028
|
+
w(this, "count", /* @__PURE__ */ a(() => t(this, O).rawRecords.length, "count"));
|
|
1027
1029
|
b(this, O, i);
|
|
1028
1030
|
}
|
|
1029
1031
|
get at() {
|
|
1030
|
-
return t(this,
|
|
1032
|
+
return t(this, K);
|
|
1031
1033
|
}
|
|
1032
1034
|
set at(i) {
|
|
1033
1035
|
var s, n;
|
|
1034
|
-
b(this,
|
|
1036
|
+
b(this, K, parseInt(i, 10));
|
|
1035
1037
|
const e = ((n = (s = t(this, O).owner).querySelector) == null ? void 0 : n.call(s, ".ng-container-body")) || t(this, O).owner.body;
|
|
1036
|
-
e && !e.querySelector(`tbody.bindable tr[data-row="${t(this,
|
|
1038
|
+
e && !e.querySelector(`tbody.bindable tr[data-row="${t(this, K)}"]`) && setTimeout(() => {
|
|
1037
1039
|
var o, r;
|
|
1038
|
-
(r = (o = t(this, O).owner).scrollTo_V1) == null || r.call(o, t(this,
|
|
1040
|
+
(r = (o = t(this, O).owner).scrollTo_V1) == null || r.call(o, t(this, K));
|
|
1039
1041
|
});
|
|
1040
1042
|
}
|
|
1041
1043
|
};
|
|
1042
|
-
O = new WeakMap(),
|
|
1044
|
+
O = new WeakMap(), K = new WeakMap(), a(Zt, "ngRow");
|
|
1043
1045
|
let Pt = Zt;
|
|
1044
|
-
var
|
|
1045
|
-
const
|
|
1046
|
+
var q, v, L, Q, qt, z, Lt, ct, Ht, Ct, tt;
|
|
1047
|
+
const H = class H {
|
|
1046
1048
|
constructor(i, e) {
|
|
1047
|
-
d(this,
|
|
1049
|
+
d(this, q);
|
|
1048
1050
|
d(this, v);
|
|
1049
|
-
d(this,
|
|
1050
|
-
d(this,
|
|
1051
|
+
d(this, L, []);
|
|
1052
|
+
d(this, Q, []);
|
|
1051
1053
|
d(this, qt, 0);
|
|
1052
1054
|
d(this, z, []);
|
|
1053
1055
|
d(this, Lt, /* @__PURE__ */ a(() => {
|
|
1054
1056
|
b(this, z, []);
|
|
1055
|
-
const i = t(this,
|
|
1057
|
+
const i = t(this, q).template || [];
|
|
1056
1058
|
Array.from(i).forEach((e) => {
|
|
1057
1059
|
var s;
|
|
1058
1060
|
t(this, z).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
@@ -1060,29 +1062,29 @@ const L = class L {
|
|
|
1060
1062
|
e.__ng || (e.__ng = t(this, ct).call(this)), e.__ng.height = t(this, z).slice();
|
|
1061
1063
|
});
|
|
1062
1064
|
}, "#initialize"));
|
|
1063
|
-
|
|
1065
|
+
w(this, "set", /* @__PURE__ */ a((i) => {
|
|
1064
1066
|
this.clear(), this.add(i, !1);
|
|
1065
1067
|
}, "set"));
|
|
1066
1068
|
d(this, ct, /* @__PURE__ */ a(() => ({
|
|
1067
|
-
rowState:
|
|
1069
|
+
rowState: H.ROW_STATE.EMPTY,
|
|
1068
1070
|
deleted: !1,
|
|
1069
1071
|
filtered: !1,
|
|
1070
1072
|
height: t(this, z).slice(),
|
|
1071
1073
|
o: {},
|
|
1072
1074
|
c: {},
|
|
1073
|
-
_: [0, 0, 0, 0,
|
|
1075
|
+
_: [0, 0, 0, 0, H.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, z).slice(), -1, {}, {}]
|
|
1074
1076
|
}), "#getDefaultMeta"));
|
|
1075
|
-
|
|
1076
|
-
b(this,
|
|
1077
|
+
w(this, "reset", /* @__PURE__ */ a(() => {
|
|
1078
|
+
b(this, L, []), b(this, Q, []);
|
|
1077
1079
|
}, "reset"));
|
|
1078
|
-
|
|
1080
|
+
w(this, "clear", /* @__PURE__ */ a(() => {
|
|
1079
1081
|
var i;
|
|
1080
|
-
t(this, v).rawRecords = [], b(this,
|
|
1082
|
+
t(this, v).rawRecords = [], b(this, L, []), b(this, Q, []), (i = t(this, v).viewRecords) != null && i.reset && t(this, v).viewRecords.reset();
|
|
1081
1083
|
}, "clear"));
|
|
1082
1084
|
d(this, Ht, /* @__PURE__ */ a((i) => {
|
|
1083
1085
|
var n;
|
|
1084
1086
|
Array.isArray(i) || (i = [i]);
|
|
1085
|
-
const e = typeof ((n = t(this,
|
|
1087
|
+
const e = typeof ((n = t(this, q).fields) == null ? void 0 : n.get) == "function" ? t(this, q).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
1086
1088
|
return i.forEach((o) => {
|
|
1087
1089
|
const r = { v: [] };
|
|
1088
1090
|
e.forEach((l) => {
|
|
@@ -1091,53 +1093,53 @@ const L = class L {
|
|
|
1091
1093
|
}), s;
|
|
1092
1094
|
}, "#json2Array"));
|
|
1093
1095
|
d(this, Ct, /* @__PURE__ */ a((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1094
|
-
e.__ng = t(this, ct).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState =
|
|
1096
|
+
e.__ng = t(this, ct).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = H.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1095
1097
|
}), i), "#defaultInsert"));
|
|
1096
|
-
|
|
1098
|
+
w(this, "add", /* @__PURE__ */ a((i, e = !0) => {
|
|
1097
1099
|
var o;
|
|
1098
1100
|
i === void 0 && (i = {});
|
|
1099
1101
|
const s = t(this, Ht).call(this, i);
|
|
1100
1102
|
t(this, v).rawRecords = t(this, v).rawRecords.concat(t(this, Ct).call(this, s)), this.resetRecords();
|
|
1101
1103
|
const n = this.count() - 1;
|
|
1102
1104
|
return e || s.forEach((r, l) => {
|
|
1103
|
-
const
|
|
1104
|
-
|
|
1105
|
+
const h = t(this, v).rawRecords[n - l];
|
|
1106
|
+
h && (h.__ng.rowState = H.ROW_STATE.EMPTY);
|
|
1105
1107
|
}), (o = t(this, v).viewRecords) != null && o.reset && t(this, v).viewRecords.reset(), n;
|
|
1106
1108
|
}, "add"));
|
|
1107
|
-
|
|
1109
|
+
w(this, "delete", /* @__PURE__ */ a((i) => {
|
|
1108
1110
|
var s;
|
|
1109
1111
|
let e = [];
|
|
1110
1112
|
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) => {
|
|
1111
|
-
if (t(this,
|
|
1112
|
-
const o = t(this,
|
|
1113
|
-
t(this,
|
|
1114
|
-
r.__ng.rowid === o && (r.__ng.deleted = !0, r.__ng.rowState =
|
|
1113
|
+
if (t(this, L)[n]) {
|
|
1114
|
+
const o = t(this, L)[n].__ng.rowid;
|
|
1115
|
+
t(this, L)[n].__ng.rowState === H.ROW_STATE.INSERT ? t(this, v).rawRecords = t(this, v).rawRecords.filter((r) => r.__ng.rowid !== o) : t(this, v).rawRecords.forEach((r) => {
|
|
1116
|
+
r.__ng.rowid === o && (r.__ng.deleted = !0, r.__ng.rowState = H.ROW_STATE.DELETE);
|
|
1115
1117
|
});
|
|
1116
1118
|
}
|
|
1117
1119
|
}), this.resetRecords(), (s = t(this, v).viewRecords) != null && s.reset && t(this, v).viewRecords.reset();
|
|
1118
1120
|
}, "delete"));
|
|
1119
|
-
|
|
1120
|
-
var
|
|
1121
|
+
w(this, "setValue", /* @__PURE__ */ a((i, e, s) => {
|
|
1122
|
+
var h;
|
|
1121
1123
|
i = parseInt(i, 10);
|
|
1122
|
-
const o = (typeof ((
|
|
1124
|
+
const o = (typeof ((h = t(this, q).fields) == null ? void 0 : h.get) == "function" ? t(this, q).fields.get() : []).indexOf(e);
|
|
1123
1125
|
if (o < 0) return;
|
|
1124
1126
|
const r = this.getValidData()[i];
|
|
1125
1127
|
if (!r) return;
|
|
1126
1128
|
const l = r.v[o];
|
|
1127
|
-
l !== s && r.__ng.rowState !==
|
|
1129
|
+
l !== s && r.__ng.rowState !== H.ROW_STATE.INSERT && (r.__ng.o.hasOwnProperty(e) || (r.__ng.o[e] = l), r.__ng.rowState = H.ROW_STATE.UPDATE), r.v[o] = s, t(this, v).owner.refreshData && t(this, v).owner.refreshData(i);
|
|
1128
1130
|
}, "setValue"));
|
|
1129
|
-
|
|
1130
|
-
b(this,
|
|
1131
|
+
w(this, "resetRecords", /* @__PURE__ */ a(() => {
|
|
1132
|
+
b(this, Q, t(this, v).rawRecords.filter((i) => !i.__ng.deleted)), b(this, L, t(this, v).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, v).rawRecords.forEach((i, e) => {
|
|
1131
1133
|
i.__ng.rowidx = e;
|
|
1132
|
-
}), t(this,
|
|
1134
|
+
}), t(this, L).forEach((i, e) => {
|
|
1133
1135
|
i.__ng.i = e;
|
|
1134
1136
|
});
|
|
1135
1137
|
}, "resetRecords"));
|
|
1136
|
-
|
|
1137
|
-
d(this,
|
|
1138
|
+
w(this, "getValidData", /* @__PURE__ */ a(() => (t(this, L).length === 0 && t(this, v).rawRecords.length > 0 && this.resetRecords(), t(this, L)), "getValidData"));
|
|
1139
|
+
d(this, tt, /* @__PURE__ */ a((i) => {
|
|
1138
1140
|
var s;
|
|
1139
1141
|
if (!i) return i;
|
|
1140
|
-
const e = typeof ((s = t(this,
|
|
1142
|
+
const e = typeof ((s = t(this, q).fields) == null ? void 0 : s.get) == "function" ? t(this, q).fields.get() : [];
|
|
1141
1143
|
return Array.isArray(i) ? i.filter((n) => !n.__ng.deleted).map((n) => {
|
|
1142
1144
|
const o = {};
|
|
1143
1145
|
return e.forEach((r, l) => {
|
|
@@ -1145,24 +1147,24 @@ const L = class L {
|
|
|
1145
1147
|
}), o.__ng = n.__ng, o;
|
|
1146
1148
|
}) : i;
|
|
1147
1149
|
}, "#conv2"));
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
+
w(this, "count", /* @__PURE__ */ a(() => this.getValidData().length, "count"));
|
|
1151
|
+
w(this, "get", /* @__PURE__ */ a((i, e) => {
|
|
1150
1152
|
var o;
|
|
1151
1153
|
const s = this.getValidData();
|
|
1152
1154
|
if (!s || s.length <= 0) return;
|
|
1153
|
-
if (i == null) return t(this,
|
|
1155
|
+
if (i == null) return t(this, tt).call(this, s);
|
|
1154
1156
|
if (i < 0 || i >= s.length) return null;
|
|
1155
|
-
const n = typeof ((o = t(this,
|
|
1157
|
+
const n = typeof ((o = t(this, q).fields) == null ? void 0 : o.get) == "function" ? t(this, q).fields.get() : [];
|
|
1156
1158
|
if (e != null) {
|
|
1157
1159
|
const r = n.indexOf(e);
|
|
1158
1160
|
return r >= 0 ? s[i].v[r] : null;
|
|
1159
1161
|
}
|
|
1160
|
-
return t(this,
|
|
1162
|
+
return t(this, tt).call(this, s[i]);
|
|
1161
1163
|
}, "get"));
|
|
1162
|
-
b(this,
|
|
1164
|
+
b(this, q, i), b(this, v, e), t(this, Lt).call(this);
|
|
1163
1165
|
}
|
|
1164
1166
|
get source() {
|
|
1165
|
-
return t(this,
|
|
1167
|
+
return t(this, tt).call(this, t(this, v).rawRecords);
|
|
1166
1168
|
}
|
|
1167
1169
|
set source(i) {
|
|
1168
1170
|
this.clear(), this.add(i, !1);
|
|
@@ -1171,21 +1173,21 @@ const L = class L {
|
|
|
1171
1173
|
return ++ne(this, qt)._;
|
|
1172
1174
|
}
|
|
1173
1175
|
get length() {
|
|
1174
|
-
return t(this,
|
|
1176
|
+
return t(this, L).length;
|
|
1175
1177
|
}
|
|
1176
1178
|
getRowCount() {
|
|
1177
1179
|
return this.length;
|
|
1178
1180
|
}
|
|
1179
1181
|
};
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
+
q = new WeakMap(), v = new WeakMap(), L = 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(H, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1183
|
+
w(H, "ROW_STATE", {
|
|
1182
1184
|
EMPTY: "EMPTY",
|
|
1183
1185
|
NORMAL: "NORMAL",
|
|
1184
1186
|
INSERT: "INSERT",
|
|
1185
1187
|
UPDATE: "UPDATE",
|
|
1186
1188
|
DELETE: "DELETE"
|
|
1187
1189
|
});
|
|
1188
|
-
let Bt =
|
|
1190
|
+
let Bt = H;
|
|
1189
1191
|
const Gt = class Gt {
|
|
1190
1192
|
constructor(i) {
|
|
1191
1193
|
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 = () => {
|
|
@@ -1207,35 +1209,35 @@ const Gt = class Gt {
|
|
|
1207
1209
|
};
|
|
1208
1210
|
a(Gt, "ngDataManager");
|
|
1209
1211
|
let Nt = Gt;
|
|
1210
|
-
var
|
|
1212
|
+
var j, Mt;
|
|
1211
1213
|
const Jt = class Jt extends HTMLElement {
|
|
1212
1214
|
constructor() {
|
|
1213
1215
|
super();
|
|
1214
1216
|
//#created = false;
|
|
1215
|
-
d(this,
|
|
1217
|
+
d(this, j);
|
|
1216
1218
|
d(this, Mt);
|
|
1217
|
-
this.attachShadow({ mode: "open" }), b(this,
|
|
1219
|
+
this.attachShadow({ mode: "open" }), b(this, j, new Nt(this));
|
|
1218
1220
|
}
|
|
1219
1221
|
connectedCallback() {
|
|
1220
|
-
b(this, Mt, new Dt(this)),
|
|
1222
|
+
b(this, Mt, new Dt(this)), A.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1221
1223
|
}
|
|
1222
1224
|
disconnectedCallback() {
|
|
1223
|
-
|
|
1225
|
+
A.log("NineTable disconnected.");
|
|
1224
1226
|
}
|
|
1225
1227
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1226
1228
|
get data() {
|
|
1227
|
-
return t(this,
|
|
1229
|
+
return t(this, j).data;
|
|
1228
1230
|
}
|
|
1229
1231
|
// π― ν(row) κ΄λ ¨ μ μ΄ μ κ·Όμ μ€ν
|
|
1230
1232
|
get row() {
|
|
1231
|
-
return t(this,
|
|
1233
|
+
return t(this, j).row;
|
|
1232
1234
|
}
|
|
1233
1235
|
// π― μ 체 λ°μ΄ν° λ§€λμ μ κ·Ό νμν κ²½μ°
|
|
1234
1236
|
get dataManager() {
|
|
1235
|
-
return t(this,
|
|
1237
|
+
return t(this, j);
|
|
1236
1238
|
}
|
|
1237
1239
|
};
|
|
1238
|
-
|
|
1240
|
+
j = new WeakMap(), Mt = new WeakMap(), a(Jt, "NineTable");
|
|
1239
1241
|
let Yt = Jt;
|
|
1240
1242
|
customElements.get("nine-table") || customElements.define("nine-table", Yt);
|
|
1241
1243
|
//# sourceMappingURL=nine-table.js.map
|