@ninebone/table 0.0.306 β 0.0.307
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 +195 -195
- 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) {
|
|
@@ -23,68 +23,68 @@ const Vt = class Vt extends re.constructor {
|
|
|
23
23
|
a(Vt, "Trace");
|
|
24
24
|
let $t = Vt;
|
|
25
25
|
const H = new $t();
|
|
26
|
-
var M, _, y,
|
|
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`, H.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,80 @@ 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
|
-
if (
|
|
247
|
-
const
|
|
248
|
-
e.scrollTop = t(this, st) +
|
|
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, k = s.scrollHeight - p;
|
|
246
|
+
if (f > 0 && k > 0) {
|
|
247
|
+
const D = g / f * k;
|
|
248
|
+
e.scrollTop = t(this, st) + D;
|
|
249
249
|
}
|
|
250
250
|
this.refresh();
|
|
251
|
-
}, "onMouseMove"),
|
|
252
|
-
b(this, I, !1), document.removeEventListener("mousemove",
|
|
251
|
+
}, "onMouseMove"), r = /* @__PURE__ */ a(() => {
|
|
252
|
+
b(this, I, !1), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", r), this.refresh();
|
|
253
253
|
}, "onMouseUp");
|
|
254
|
-
document.addEventListener("mousemove",
|
|
255
|
-
}), t(this,
|
|
256
|
-
if (
|
|
257
|
-
const
|
|
258
|
-
if (c > 0 &&
|
|
259
|
-
const
|
|
260
|
-
e.scrollTop =
|
|
254
|
+
document.addEventListener("mousemove", o), document.addEventListener("mouseup", r);
|
|
255
|
+
}), t(this, S).track.addEventListener("mousedown", (n) => {
|
|
256
|
+
if (n.button !== 0 || n.target === t(this, S).thumb) return;
|
|
257
|
+
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;
|
|
258
|
+
if (c > 0 && g > 0) {
|
|
259
|
+
const p = Math.max(0, Math.min(1, l / c));
|
|
260
|
+
e.scrollTop = p * g;
|
|
261
261
|
}
|
|
262
262
|
this.refresh();
|
|
263
|
-
}), t(this,
|
|
263
|
+
}), t(this, S).top.addEventListener("click", () => {
|
|
264
264
|
e.scrollTop -= 40;
|
|
265
|
-
}), t(this,
|
|
265
|
+
}), t(this, S).bottom.addEventListener("click", () => {
|
|
266
266
|
e.scrollTop += 40;
|
|
267
267
|
});
|
|
268
268
|
}, "#init"));
|
|
269
269
|
}
|
|
270
270
|
connectedCallback() {
|
|
271
|
-
if (b(this,
|
|
271
|
+
if (b(this, V, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, V)) return;
|
|
272
272
|
this.innerHTML = `
|
|
273
273
|
<style>
|
|
274
274
|
nine-table-vscrollbar {
|
|
@@ -333,12 +333,12 @@ const Ut = class Ut extends HTMLElement {
|
|
|
333
333
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
334
334
|
`;
|
|
335
335
|
const e = /* @__PURE__ */ a(() => {
|
|
336
|
-
const s = t(this,
|
|
336
|
+
const s = t(this, V).querySelector(".ng-container-body");
|
|
337
337
|
if (!s) {
|
|
338
338
|
setTimeout(e, 10);
|
|
339
339
|
return;
|
|
340
340
|
}
|
|
341
|
-
b(this,
|
|
341
|
+
b(this, S, {
|
|
342
342
|
container: s,
|
|
343
343
|
track: this.querySelector(".ng-scroll-track"),
|
|
344
344
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
@@ -349,10 +349,10 @@ const Ut = class Ut extends HTMLElement {
|
|
|
349
349
|
e();
|
|
350
350
|
}
|
|
351
351
|
};
|
|
352
|
-
|
|
352
|
+
V = new WeakMap(), I = new WeakMap(), S = new WeakMap(), it = new WeakMap(), st = new WeakMap(), ut = new WeakMap(), a(Ut, "NineTableVScrollBar");
|
|
353
353
|
let It = Ut;
|
|
354
354
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", It);
|
|
355
|
-
var gt,
|
|
355
|
+
var gt, F;
|
|
356
356
|
const C = class C {
|
|
357
357
|
/**
|
|
358
358
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
@@ -367,15 +367,15 @@ const C = class C {
|
|
|
367
367
|
var n, o, r, l;
|
|
368
368
|
if (!i) return null;
|
|
369
369
|
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="${
|
|
370
|
+
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) => {
|
|
371
|
+
const u = h.getAttribute("fixed");
|
|
372
|
+
u && e.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((f) => {
|
|
373
373
|
f.setAttribute("fixed", u);
|
|
374
374
|
});
|
|
375
375
|
}), e;
|
|
376
376
|
}
|
|
377
377
|
};
|
|
378
|
-
gt = new WeakMap(),
|
|
378
|
+
gt = new WeakMap(), F = new WeakMap(), a(C, "TableCompiler"), d(C, gt, /* @__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,41 +389,41 @@ gt = new WeakMap(), j = new WeakMap(), a(C, "TableCompiler"), d(C, gt, /* @__PUR
|
|
|
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")), d(C,
|
|
392
|
+
}, "#ensureTableStructure")), d(C, 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((h) => {
|
|
397
|
+
r += h.colSpan || 1;
|
|
398
398
|
});
|
|
399
399
|
const l = Array.from(Array(o), () => Array(r).fill(null));
|
|
400
|
-
s.forEach((
|
|
401
|
-
const
|
|
400
|
+
s.forEach((h) => {
|
|
401
|
+
const c = h.sectionRowIndex;
|
|
402
402
|
let u = 0;
|
|
403
|
-
Array.from(
|
|
404
|
-
for (let
|
|
405
|
-
if (l[
|
|
406
|
-
u =
|
|
403
|
+
Array.from(h.querySelectorAll("th,td")).forEach((f) => {
|
|
404
|
+
for (let E = 0; E < l[c].length; E++)
|
|
405
|
+
if (l[c][E] === null) {
|
|
406
|
+
u = E;
|
|
407
407
|
break;
|
|
408
408
|
}
|
|
409
409
|
const g = f.rowSpan || 1, p = f.colSpan || 1;
|
|
410
|
-
for (let
|
|
410
|
+
for (let E = 0; E < g; E++)
|
|
411
411
|
for (let k = 0; k < p; k++)
|
|
412
|
-
|
|
412
|
+
c + E < o && u + k < r && (l[c + E][u + k] = E === 0 && k === 0 ? "1" : "0");
|
|
413
413
|
});
|
|
414
|
-
}), s.forEach((
|
|
415
|
-
const
|
|
416
|
-
Array.from(
|
|
417
|
-
for (let f = 0; f < l[
|
|
418
|
-
if (l[
|
|
419
|
-
u.dataset.col = f, l[
|
|
414
|
+
}), s.forEach((h) => {
|
|
415
|
+
const c = h.sectionRowIndex;
|
|
416
|
+
Array.from(h.querySelectorAll("th,td")).forEach((u) => {
|
|
417
|
+
for (let f = 0; f < l[c].length; f++)
|
|
418
|
+
if (l[c][f] === "1") {
|
|
419
|
+
u.dataset.col = f, l[c][f] = "0";
|
|
420
420
|
break;
|
|
421
421
|
}
|
|
422
422
|
});
|
|
423
423
|
});
|
|
424
424
|
}, "#resetColIndex"));
|
|
425
425
|
let Wt = C;
|
|
426
|
-
var m, $, R, W,
|
|
426
|
+
var m, $, R, W, X, U, bt, pt, nt, ot, yt, mt, rt, Z, xt;
|
|
427
427
|
const Kt = class Kt {
|
|
428
428
|
constructor(i) {
|
|
429
429
|
d(this, m);
|
|
@@ -431,21 +431,21 @@ const Kt = class Kt {
|
|
|
431
431
|
// κ° μ»¨ν
μ΄λλ³ λ
립λ ν
νλ¦Ώ TR κ΄λ¦¬
|
|
432
432
|
d(this, R, null);
|
|
433
433
|
d(this, W, null);
|
|
434
|
-
d(this,
|
|
435
|
-
d(this,
|
|
434
|
+
d(this, X, 0);
|
|
435
|
+
d(this, U, 40);
|
|
436
436
|
/**
|
|
437
437
|
* π― μΈλΆμμ λ°μ΄ν°κ° λ‘λλκ±°λ λ³κ²½λ ν κ°μ λμ΄μ λ·°λ₯Ό μ¬κ°±μ νλ νΌλΈλ¦ λ©μλ
|
|
438
438
|
*/
|
|
439
|
-
|
|
439
|
+
w(this, "refresh", /* @__PURE__ */ a(() => {
|
|
440
440
|
var e;
|
|
441
441
|
const i = t(this, m).querySelector(".ng-container-body");
|
|
442
|
-
i && (t(this, nt).call(this), t(this,
|
|
442
|
+
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
443
|
}, "refresh"));
|
|
444
444
|
/**
|
|
445
445
|
* π― NineTableSheetμμ λ§μ€ν° ν
μ΄λΈμ μ λ¬λ°μ κ° μμλ³ ν
μ΄λΈ μμ± λ° ν
νλ¦Ώ μΆμΆ μΌμν
|
|
446
446
|
*/
|
|
447
447
|
// [RowManager.js μμ λ΄μ© λ°μ·]
|
|
448
|
-
|
|
448
|
+
w(this, "initialize", /* @__PURE__ */ a(() => {
|
|
449
449
|
b(this, R, null), t(this, $).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
450
450
|
const s = t(this, m).querySelector(e);
|
|
451
451
|
if (!s) return;
|
|
@@ -453,17 +453,17 @@ const Kt = class Kt {
|
|
|
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((h) => h.cloneNode(!0));
|
|
457
457
|
t(this, $).set(e, l);
|
|
458
458
|
});
|
|
459
459
|
const i = t(this, m).querySelector(".ng-container-body");
|
|
460
460
|
if (i) {
|
|
461
|
-
t(this, pt).call(this, i), t(this, rt).call(this), t(this, nt).call(this), t(this,
|
|
461
|
+
t(this, pt).call(this, i), t(this, rt).call(this), t(this, nt).call(this), t(this, Z).call(this, i.scrollTop);
|
|
462
462
|
let e = i.scrollTop;
|
|
463
463
|
i.addEventListener("scroll", () => {
|
|
464
464
|
var n;
|
|
465
465
|
const s = i.scrollTop;
|
|
466
|
-
H.log(e, s), e !== s && (e = s, t(this,
|
|
466
|
+
H.log(e, s), e !== s && (e = s, t(this, Z).call(this, s)), (n = t(this, m).querySelector("nine-table-vscrollbar")) == null || n.refresh();
|
|
467
467
|
});
|
|
468
468
|
}
|
|
469
469
|
}, "initialize"));
|
|
@@ -474,9 +474,9 @@ const Kt = class Kt {
|
|
|
474
474
|
if (!n) return;
|
|
475
475
|
n.querySelectorAll("tr:not(.nodata)").forEach((l) => l.remove());
|
|
476
476
|
const o = n.querySelector("tr.nodata"), r = document.createDocumentFragment();
|
|
477
|
-
for (let l = 0; l < t(this,
|
|
478
|
-
s.forEach((
|
|
479
|
-
r.appendChild(
|
|
477
|
+
for (let l = 0; l < t(this, U); l++)
|
|
478
|
+
s.forEach((h) => {
|
|
479
|
+
r.appendChild(h.cloneNode(!0));
|
|
480
480
|
});
|
|
481
481
|
o ? o.before(r) : n.appendChild(r);
|
|
482
482
|
}, "#renderRows"));
|
|
@@ -495,13 +495,13 @@ const Kt = class Kt {
|
|
|
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, m), l = r.style.display,
|
|
498
|
+
const r = t(this, m), l = r.style.display, h = r.style.visibility, c = 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 = h, r.style.position = c, b(this, R, u > 0 ? u : 24), t(this, ot).call(this), H.log(`[RowManager] Height Cached: ${t(this, R)}px | RowCount: ${t(this, U)}`), t(this, R);
|
|
505
505
|
}, "#measureAndCacheHeight"));
|
|
506
506
|
/**
|
|
507
507
|
* π― μ 체 λ°μ΄ν° κ°μ κΈ°λ°μΌλ‘ κ°μ μ€ν¬λ‘€ λμ΄ μ€μ
|
|
@@ -510,30 +510,30 @@ const Kt = class Kt {
|
|
|
510
510
|
* π― μ 체 λ°μ΄ν° κ°μ κΈ°λ°μΌλ‘ κ°μ μ€ν¬λ‘€ λμ΄ μ€μ
|
|
511
511
|
*/
|
|
512
512
|
d(this, nt, /* @__PURE__ */ a(() => {
|
|
513
|
-
var o, r, l,
|
|
513
|
+
var o, r, l, h;
|
|
514
514
|
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
|
-
H.log(`[RowManager] TotalCount: ${e} | RowHeight: ${s}px | TotalVirtualHeight: ${n}px`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
517
|
-
const u = t(this, m).querySelector(
|
|
518
|
-
f ? (f.style.height = `${n}px`, H.log(`[RowManager] Applied height to ${
|
|
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) ?? ((h = t(this, m).data) == null ? void 0 : h.length) ?? 0, s = t(this, R) || 24, n = e * s;
|
|
516
|
+
H.log(`[RowManager] TotalCount: ${e} | RowHeight: ${s}px | TotalVirtualHeight: ${n}px`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((c) => {
|
|
517
|
+
const u = t(this, m).querySelector(c), f = u == null ? void 0 : u.querySelector("table");
|
|
518
|
+
f ? (f.style.height = `${n}px`, H.log(`[RowManager] Applied height to ${c} table:`, f.style.height)) : H.log(`[RowManager] Table not found for selector: ${c}`);
|
|
519
519
|
});
|
|
520
520
|
}, "#updateVirtualScrollHeight"));
|
|
521
521
|
d(this, ot, /* @__PURE__ */ a(() => {
|
|
522
|
-
if (t(this,
|
|
523
|
-
const i = Math.ceil(t(this,
|
|
524
|
-
b(this,
|
|
522
|
+
if (t(this, X) > 0 && t(this, R) > 0) {
|
|
523
|
+
const i = Math.ceil(t(this, X) / t(this, R));
|
|
524
|
+
b(this, U, i + 20);
|
|
525
525
|
} else
|
|
526
|
-
b(this,
|
|
526
|
+
b(this, U, 40);
|
|
527
527
|
}, "#updateRowCount"));
|
|
528
528
|
d(this, yt, /* @__PURE__ */ a(() => {
|
|
529
|
-
var
|
|
529
|
+
var h, c, u;
|
|
530
530
|
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
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
|
-
((
|
|
536
|
-
((
|
|
535
|
+
((h = n[f]) == null ? void 0 : h.getBoundingClientRect().height) || 0,
|
|
536
|
+
((c = o[f]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
537
537
|
((u = r[f]) == null ? void 0 : u.getBoundingClientRect().height) || 0
|
|
538
538
|
], p = Math.max(...g);
|
|
539
539
|
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 +553,7 @@ const Kt = class Kt {
|
|
|
553
553
|
const r = s.querySelector("thead");
|
|
554
554
|
r && (o += r.offsetHeight || r.getBoundingClientRect().height);
|
|
555
555
|
const l = Math.max(n - o, 100);
|
|
556
|
-
t(this,
|
|
556
|
+
t(this, X) !== l && (b(this, X, l), t(this, ot).call(this), t(this, R) !== null && t(this, rt).call(this));
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
559
|
})), t(this, W).observe(t(this, m)));
|
|
@@ -576,7 +576,7 @@ const Kt = class Kt {
|
|
|
576
576
|
/**
|
|
577
577
|
* π― μ€ν¬λ‘€ μμΉμ λ°λ₯Έ λ°μ΄ν° λ°μΈλ© λ° tbody λ―ΈμΈ ν½μ
μ΄λ(translateY) κ°±μ
|
|
578
578
|
*/
|
|
579
|
-
d(this,
|
|
579
|
+
d(this, Z, /* @__PURE__ */ a((i) => {
|
|
580
580
|
var r;
|
|
581
581
|
const e = t(this, R);
|
|
582
582
|
if (!e || e <= 0) {
|
|
@@ -587,17 +587,17 @@ const Kt = class Kt {
|
|
|
587
587
|
H.log(`[RowManager] ScrollTop: ${i} | StartIndex: ${s} | OffsetY: ${n}px`);
|
|
588
588
|
const o = ((r = t(this, $).get(".ng-container-body")) == null ? void 0 : r.length) || 1;
|
|
589
589
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((l) => {
|
|
590
|
-
const
|
|
591
|
-
if (!
|
|
592
|
-
const
|
|
593
|
-
if (!
|
|
590
|
+
const h = t(this, m).querySelector(l);
|
|
591
|
+
if (!h) return;
|
|
592
|
+
const c = h.querySelector("tbody");
|
|
593
|
+
if (!c) {
|
|
594
594
|
H.log(`[RowManager] tbody not found for selector: ${l}`);
|
|
595
595
|
return;
|
|
596
596
|
}
|
|
597
|
-
window.getComputedStyle(
|
|
598
|
-
var k,
|
|
599
|
-
const p = s + Math.floor(g / o),
|
|
600
|
-
|
|
597
|
+
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) => {
|
|
598
|
+
var k, D, Qt, te;
|
|
599
|
+
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;
|
|
600
|
+
E ? (f.style.display = "", t(this, xt).call(this, f, E, p)) : f.style.display = "none";
|
|
601
601
|
});
|
|
602
602
|
});
|
|
603
603
|
}, "#handleScroll"));
|
|
@@ -610,7 +610,7 @@ const Kt = class Kt {
|
|
|
610
610
|
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
611
|
});
|
|
612
612
|
}, "#bindRowData"));
|
|
613
|
-
|
|
613
|
+
w(this, "destroy", /* @__PURE__ */ a(() => {
|
|
614
614
|
t(this, W) && (t(this, W).disconnect(), b(this, W, null));
|
|
615
615
|
}, "destroy"));
|
|
616
616
|
b(this, m, i), t(this, mt).call(this);
|
|
@@ -623,14 +623,14 @@ const Kt = class Kt {
|
|
|
623
623
|
return ((e = t(this, $).get(i)) == null ? void 0 : e.length) || 1;
|
|
624
624
|
}
|
|
625
625
|
};
|
|
626
|
-
m = new WeakMap(), $ = new WeakMap(), R = new WeakMap(), W = new WeakMap(),
|
|
626
|
+
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
627
|
let Ot = Kt;
|
|
628
|
-
var
|
|
628
|
+
var G, J, vt, wt, St, Et, Rt;
|
|
629
629
|
const et = class et extends HTMLElement {
|
|
630
630
|
constructor() {
|
|
631
631
|
super();
|
|
632
|
-
d(this,
|
|
633
|
-
d(this,
|
|
632
|
+
d(this, G, null);
|
|
633
|
+
d(this, J);
|
|
634
634
|
d(this, vt, /* @__PURE__ */ a(() => {
|
|
635
635
|
[
|
|
636
636
|
{ selector: ".ng-container-body", type: null },
|
|
@@ -639,7 +639,7 @@ const et = class et extends HTMLElement {
|
|
|
639
639
|
].forEach(({ selector: s, type: n }) => {
|
|
640
640
|
const o = this.querySelector(s);
|
|
641
641
|
if (!o) return;
|
|
642
|
-
const r = t(this, St).call(this, t(this,
|
|
642
|
+
const r = t(this, St).call(this, t(this, G), n);
|
|
643
643
|
o.innerHTML = "", o.appendChild(r);
|
|
644
644
|
});
|
|
645
645
|
}, "#renderSplitContainers"));
|
|
@@ -654,8 +654,8 @@ const et = class et extends HTMLElement {
|
|
|
654
654
|
}), s.style.flex = `0 0 ${o}px`, s.style.width = `${o}px`;
|
|
655
655
|
});
|
|
656
656
|
}, "#updateContainerWidths"));
|
|
657
|
-
|
|
658
|
-
e && (b(this,
|
|
657
|
+
w(this, "generate", /* @__PURE__ */ a((e) => {
|
|
658
|
+
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
659
|
var s;
|
|
660
660
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
661
661
|
}, 0));
|
|
@@ -673,12 +673,12 @@ const et = class et extends HTMLElement {
|
|
|
673
673
|
o.remove();
|
|
674
674
|
}), n;
|
|
675
675
|
}, "#createSplitTable"));
|
|
676
|
-
|
|
677
|
-
|
|
676
|
+
w(this, "getRowHeight", /* @__PURE__ */ a(() => t(this, J).getRowHeight(), "getRowHeight"));
|
|
677
|
+
w(this, "scrollToX", /* @__PURE__ */ a((e) => {
|
|
678
678
|
const s = this.querySelector(".ng-container-body");
|
|
679
679
|
s && (s.scrollLeft = e);
|
|
680
680
|
}, "scrollToX"));
|
|
681
|
-
|
|
681
|
+
w(this, "scrollToY", /* @__PURE__ */ a((e) => {
|
|
682
682
|
const s = this.querySelector(".ng-container-body");
|
|
683
683
|
s && (s.scrollTop = e);
|
|
684
684
|
}, "scrollToY"));
|
|
@@ -822,7 +822,7 @@ const et = class et extends HTMLElement {
|
|
|
822
822
|
</div>
|
|
823
823
|
`;
|
|
824
824
|
}, "#render"));
|
|
825
|
-
b(this,
|
|
825
|
+
b(this, J, new Ot(this));
|
|
826
826
|
}
|
|
827
827
|
connectedCallback() {
|
|
828
828
|
t(this, Et).call(this);
|
|
@@ -831,7 +831,7 @@ const et = class et extends HTMLElement {
|
|
|
831
831
|
this.innerHTML = "", H.log("NineTableSheet destroyed.");
|
|
832
832
|
}
|
|
833
833
|
};
|
|
834
|
-
|
|
834
|
+
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
835
|
let ht = et;
|
|
836
836
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", ht);
|
|
837
837
|
var Tt, lt;
|
|
@@ -852,15 +852,15 @@ const jt = class jt extends HTMLElement {
|
|
|
852
852
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((p) => p.style.setProperty("display", "none"));
|
|
853
853
|
const g = u.filter((p) => p.classList.contains("active"));
|
|
854
854
|
g.length < 2 || g.forEach((p) => {
|
|
855
|
-
const
|
|
856
|
-
k &&
|
|
855
|
+
const E = parseInt(p.getAttribute("data-index"), 10), k = this.querySelector(`nine-splitter[data-split-index="${E}"]`), D = u[E + 1];
|
|
856
|
+
k && D && D.classList.contains("active") && k.style.setProperty("display", "flex");
|
|
857
857
|
});
|
|
858
|
-
}, "updateSplitters"), o = this.querySelector(".nine-tab-bar"), r = this.querySelector("nine-table-sheets-body"), l = o.querySelectorAll(".nine-tab-item"),
|
|
858
|
+
}, "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
859
|
if (!l[e]) return;
|
|
860
860
|
if (!s)
|
|
861
861
|
l.forEach((u, f) => {
|
|
862
862
|
u.classList.toggle("active", f === e);
|
|
863
|
-
}),
|
|
863
|
+
}), h.forEach((u, f) => {
|
|
864
864
|
const g = f === e;
|
|
865
865
|
u.classList.toggle("active", g), u.style.flex = g ? "1 1 100%" : "";
|
|
866
866
|
});
|
|
@@ -872,9 +872,9 @@ const jt = class jt extends HTMLElement {
|
|
|
872
872
|
const g = r.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
873
873
|
g && (g.classList.toggle("active"), g.classList.contains("active") || (g.style.flex = ""));
|
|
874
874
|
}
|
|
875
|
-
const
|
|
876
|
-
|
|
877
|
-
u.style.flex =
|
|
875
|
+
const c = r.querySelectorAll("nine-table-sheet.active");
|
|
876
|
+
c == null || c.forEach((u) => {
|
|
877
|
+
u.style.flex = c.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
878
878
|
}), n();
|
|
879
879
|
}, "#switchSheet"));
|
|
880
880
|
}
|
|
@@ -896,17 +896,17 @@ const Ft = class Ft {
|
|
|
896
896
|
}).observe(t(this, T));
|
|
897
897
|
}, "#init"));
|
|
898
898
|
d(this, at, /* @__PURE__ */ a(() => {
|
|
899
|
-
var
|
|
899
|
+
var h, c;
|
|
900
900
|
const i = Array.from(t(this, T).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
901
901
|
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 = (
|
|
902
|
+
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
903
|
t(this, T).style.height = `${l}px`;
|
|
904
904
|
}, "#applyAutoHeight"));
|
|
905
905
|
d(this, At, /* @__PURE__ */ a(() => {
|
|
906
|
-
const e = Array.from(t(this, T).children).filter((
|
|
907
|
-
const f = `<nine-table-sheet class="${
|
|
906
|
+
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) => {
|
|
907
|
+
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
908
|
return f + g;
|
|
909
|
-
}).join(""), r = e.map((
|
|
909
|
+
}).join(""), r = e.map((h, c) => `<div class="nine-tab-item ${c === 0 ? "active" : ""}" data-index="${c}">Sheet ${c + 1}</div>`).join("");
|
|
910
910
|
t(this, T).shadowRoot.innerHTML = `
|
|
911
911
|
<style>
|
|
912
912
|
:host {
|
|
@@ -1007,9 +1007,9 @@ const Ft = class Ft {
|
|
|
1007
1007
|
<nine-table-footer></nine-table-footer>
|
|
1008
1008
|
`;
|
|
1009
1009
|
const l = t(this, T).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1010
|
-
l == null || l.forEach((
|
|
1011
|
-
e[
|
|
1012
|
-
|
|
1010
|
+
l == null || l.forEach((h, c) => {
|
|
1011
|
+
e[c] && setTimeout(() => {
|
|
1012
|
+
h.generate(e[c]), s && t(this, at).call(this);
|
|
1013
1013
|
});
|
|
1014
1014
|
});
|
|
1015
1015
|
}, "#render"));
|
|
@@ -1018,36 +1018,36 @@ const Ft = class Ft {
|
|
|
1018
1018
|
};
|
|
1019
1019
|
T = new WeakMap(), kt = new WeakMap(), at = new WeakMap(), At = new WeakMap(), a(Ft, "LayoutManager");
|
|
1020
1020
|
let Dt = Ft;
|
|
1021
|
-
var O,
|
|
1021
|
+
var O, K;
|
|
1022
1022
|
const Zt = class Zt {
|
|
1023
1023
|
constructor(i) {
|
|
1024
1024
|
d(this, O);
|
|
1025
|
-
d(this,
|
|
1026
|
-
|
|
1025
|
+
d(this, K, -1);
|
|
1026
|
+
w(this, "count", /* @__PURE__ */ a(() => t(this, O).rawRecords.length, "count"));
|
|
1027
1027
|
b(this, O, i);
|
|
1028
1028
|
}
|
|
1029
1029
|
get at() {
|
|
1030
|
-
return t(this,
|
|
1030
|
+
return t(this, K);
|
|
1031
1031
|
}
|
|
1032
1032
|
set at(i) {
|
|
1033
1033
|
var s, n;
|
|
1034
|
-
b(this,
|
|
1034
|
+
b(this, K, parseInt(i, 10));
|
|
1035
1035
|
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,
|
|
1036
|
+
e && !e.querySelector(`tbody.bindable tr[data-row="${t(this, K)}"]`) && setTimeout(() => {
|
|
1037
1037
|
var o, r;
|
|
1038
|
-
(r = (o = t(this, O).owner).scrollTo_V1) == null || r.call(o, t(this,
|
|
1038
|
+
(r = (o = t(this, O).owner).scrollTo_V1) == null || r.call(o, t(this, K));
|
|
1039
1039
|
});
|
|
1040
1040
|
}
|
|
1041
1041
|
};
|
|
1042
|
-
O = new WeakMap(),
|
|
1042
|
+
O = new WeakMap(), K = new WeakMap(), a(Zt, "ngRow");
|
|
1043
1043
|
let Pt = Zt;
|
|
1044
|
-
var A, v, q,
|
|
1044
|
+
var A, v, q, Q, qt, z, Lt, ct, Ht, Ct, tt;
|
|
1045
1045
|
const L = class L {
|
|
1046
1046
|
constructor(i, e) {
|
|
1047
1047
|
d(this, A);
|
|
1048
1048
|
d(this, v);
|
|
1049
1049
|
d(this, q, []);
|
|
1050
|
-
d(this,
|
|
1050
|
+
d(this, Q, []);
|
|
1051
1051
|
d(this, qt, 0);
|
|
1052
1052
|
d(this, z, []);
|
|
1053
1053
|
d(this, Lt, /* @__PURE__ */ a(() => {
|
|
@@ -1060,7 +1060,7 @@ const L = class L {
|
|
|
1060
1060
|
e.__ng || (e.__ng = t(this, ct).call(this)), e.__ng.height = t(this, z).slice();
|
|
1061
1061
|
});
|
|
1062
1062
|
}, "#initialize"));
|
|
1063
|
-
|
|
1063
|
+
w(this, "set", /* @__PURE__ */ a((i) => {
|
|
1064
1064
|
this.clear(), this.add(i, !1);
|
|
1065
1065
|
}, "set"));
|
|
1066
1066
|
d(this, ct, /* @__PURE__ */ a(() => ({
|
|
@@ -1072,12 +1072,12 @@ const L = class L {
|
|
|
1072
1072
|
c: {},
|
|
1073
1073
|
_: [0, 0, 0, 0, L.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, z).slice(), -1, {}, {}]
|
|
1074
1074
|
}), "#getDefaultMeta"));
|
|
1075
|
-
|
|
1076
|
-
b(this, q, []), b(this,
|
|
1075
|
+
w(this, "reset", /* @__PURE__ */ a(() => {
|
|
1076
|
+
b(this, q, []), b(this, Q, []);
|
|
1077
1077
|
}, "reset"));
|
|
1078
|
-
|
|
1078
|
+
w(this, "clear", /* @__PURE__ */ a(() => {
|
|
1079
1079
|
var i;
|
|
1080
|
-
t(this, v).rawRecords = [], b(this, q, []), b(this,
|
|
1080
|
+
t(this, v).rawRecords = [], b(this, q, []), b(this, Q, []), (i = t(this, v).viewRecords) != null && i.reset && t(this, v).viewRecords.reset();
|
|
1081
1081
|
}, "clear"));
|
|
1082
1082
|
d(this, Ht, /* @__PURE__ */ a((i) => {
|
|
1083
1083
|
var n;
|
|
@@ -1093,18 +1093,18 @@ const L = class L {
|
|
|
1093
1093
|
d(this, Ct, /* @__PURE__ */ a((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1094
1094
|
e.__ng = t(this, ct).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = L.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1095
1095
|
}), i), "#defaultInsert"));
|
|
1096
|
-
|
|
1096
|
+
w(this, "add", /* @__PURE__ */ a((i, e = !0) => {
|
|
1097
1097
|
var o;
|
|
1098
1098
|
i === void 0 && (i = {});
|
|
1099
1099
|
const s = t(this, Ht).call(this, i);
|
|
1100
1100
|
t(this, v).rawRecords = t(this, v).rawRecords.concat(t(this, Ct).call(this, s)), this.resetRecords();
|
|
1101
1101
|
const n = this.count() - 1;
|
|
1102
1102
|
return e || s.forEach((r, l) => {
|
|
1103
|
-
const
|
|
1104
|
-
|
|
1103
|
+
const h = t(this, v).rawRecords[n - l];
|
|
1104
|
+
h && (h.__ng.rowState = L.ROW_STATE.EMPTY);
|
|
1105
1105
|
}), (o = t(this, v).viewRecords) != null && o.reset && t(this, v).viewRecords.reset(), n;
|
|
1106
1106
|
}, "add"));
|
|
1107
|
-
|
|
1107
|
+
w(this, "delete", /* @__PURE__ */ a((i) => {
|
|
1108
1108
|
var s;
|
|
1109
1109
|
let e = [];
|
|
1110
1110
|
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) => {
|
|
@@ -1116,25 +1116,25 @@ const L = class L {
|
|
|
1116
1116
|
}
|
|
1117
1117
|
}), this.resetRecords(), (s = t(this, v).viewRecords) != null && s.reset && t(this, v).viewRecords.reset();
|
|
1118
1118
|
}, "delete"));
|
|
1119
|
-
|
|
1120
|
-
var
|
|
1119
|
+
w(this, "setValue", /* @__PURE__ */ a((i, e, s) => {
|
|
1120
|
+
var h;
|
|
1121
1121
|
i = parseInt(i, 10);
|
|
1122
|
-
const o = (typeof ((
|
|
1122
|
+
const o = (typeof ((h = t(this, A).fields) == null ? void 0 : h.get) == "function" ? t(this, A).fields.get() : []).indexOf(e);
|
|
1123
1123
|
if (o < 0) return;
|
|
1124
1124
|
const r = this.getValidData()[i];
|
|
1125
1125
|
if (!r) return;
|
|
1126
1126
|
const l = r.v[o];
|
|
1127
1127
|
l !== s && r.__ng.rowState !== L.ROW_STATE.INSERT && (r.__ng.o.hasOwnProperty(e) || (r.__ng.o[e] = l), r.__ng.rowState = L.ROW_STATE.UPDATE), r.v[o] = s, t(this, v).owner.refreshData && t(this, v).owner.refreshData(i);
|
|
1128
1128
|
}, "setValue"));
|
|
1129
|
-
|
|
1130
|
-
b(this,
|
|
1129
|
+
w(this, "resetRecords", /* @__PURE__ */ a(() => {
|
|
1130
|
+
b(this, Q, t(this, v).rawRecords.filter((i) => !i.__ng.deleted)), b(this, q, t(this, v).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, v).rawRecords.forEach((i, e) => {
|
|
1131
1131
|
i.__ng.rowidx = e;
|
|
1132
1132
|
}), t(this, q).forEach((i, e) => {
|
|
1133
1133
|
i.__ng.i = e;
|
|
1134
1134
|
});
|
|
1135
1135
|
}, "resetRecords"));
|
|
1136
|
-
|
|
1137
|
-
d(this,
|
|
1136
|
+
w(this, "getValidData", /* @__PURE__ */ a(() => (t(this, q).length === 0 && t(this, v).rawRecords.length > 0 && this.resetRecords(), t(this, q)), "getValidData"));
|
|
1137
|
+
d(this, tt, /* @__PURE__ */ a((i) => {
|
|
1138
1138
|
var s;
|
|
1139
1139
|
if (!i) return i;
|
|
1140
1140
|
const e = typeof ((s = t(this, A).fields) == null ? void 0 : s.get) == "function" ? t(this, A).fields.get() : [];
|
|
@@ -1145,24 +1145,24 @@ const L = class L {
|
|
|
1145
1145
|
}), o.__ng = n.__ng, o;
|
|
1146
1146
|
}) : i;
|
|
1147
1147
|
}, "#conv2"));
|
|
1148
|
-
|
|
1149
|
-
|
|
1148
|
+
w(this, "count", /* @__PURE__ */ a(() => this.getValidData().length, "count"));
|
|
1149
|
+
w(this, "get", /* @__PURE__ */ a((i, e) => {
|
|
1150
1150
|
var o;
|
|
1151
1151
|
const s = this.getValidData();
|
|
1152
1152
|
if (!s || s.length <= 0) return;
|
|
1153
|
-
if (i == null) return t(this,
|
|
1153
|
+
if (i == null) return t(this, tt).call(this, s);
|
|
1154
1154
|
if (i < 0 || i >= s.length) return null;
|
|
1155
1155
|
const n = typeof ((o = t(this, A).fields) == null ? void 0 : o.get) == "function" ? t(this, A).fields.get() : [];
|
|
1156
1156
|
if (e != null) {
|
|
1157
1157
|
const r = n.indexOf(e);
|
|
1158
1158
|
return r >= 0 ? s[i].v[r] : null;
|
|
1159
1159
|
}
|
|
1160
|
-
return t(this,
|
|
1160
|
+
return t(this, tt).call(this, s[i]);
|
|
1161
1161
|
}, "get"));
|
|
1162
1162
|
b(this, A, i), b(this, v, e), t(this, Lt).call(this);
|
|
1163
1163
|
}
|
|
1164
1164
|
get source() {
|
|
1165
|
-
return t(this,
|
|
1165
|
+
return t(this, tt).call(this, t(this, v).rawRecords);
|
|
1166
1166
|
}
|
|
1167
1167
|
set source(i) {
|
|
1168
1168
|
this.clear(), this.add(i, !1);
|
|
@@ -1177,8 +1177,8 @@ const L = class L {
|
|
|
1177
1177
|
return this.length;
|
|
1178
1178
|
}
|
|
1179
1179
|
};
|
|
1180
|
-
A = new WeakMap(), v = new WeakMap(), q = new WeakMap(),
|
|
1181
|
-
|
|
1180
|
+
A = new WeakMap(), v = new WeakMap(), q = new WeakMap(), Q = new WeakMap(), qt = new WeakMap(), z = new WeakMap(), Lt = new WeakMap(), ct = new WeakMap(), Ht = new WeakMap(), Ct = new WeakMap(), tt = new WeakMap(), a(L, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1181
|
+
w(L, "ROW_STATE", {
|
|
1182
1182
|
EMPTY: "EMPTY",
|
|
1183
1183
|
NORMAL: "NORMAL",
|
|
1184
1184
|
INSERT: "INSERT",
|
|
@@ -1207,14 +1207,14 @@ const Gt = class Gt {
|
|
|
1207
1207
|
};
|
|
1208
1208
|
a(Gt, "ngDataManager");
|
|
1209
1209
|
let Nt = Gt;
|
|
1210
|
-
var
|
|
1210
|
+
var j, Mt;
|
|
1211
1211
|
const Jt = class Jt extends HTMLElement {
|
|
1212
1212
|
constructor() {
|
|
1213
1213
|
super();
|
|
1214
1214
|
//#created = false;
|
|
1215
|
-
d(this,
|
|
1215
|
+
d(this, j);
|
|
1216
1216
|
d(this, Mt);
|
|
1217
|
-
this.attachShadow({ mode: "open" }), b(this,
|
|
1217
|
+
this.attachShadow({ mode: "open" }), b(this, j, new Nt(this));
|
|
1218
1218
|
}
|
|
1219
1219
|
connectedCallback() {
|
|
1220
1220
|
b(this, Mt, new Dt(this)), H.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
@@ -1224,18 +1224,18 @@ const Jt = class Jt extends HTMLElement {
|
|
|
1224
1224
|
}
|
|
1225
1225
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1226
1226
|
get data() {
|
|
1227
|
-
return t(this,
|
|
1227
|
+
return t(this, j).data;
|
|
1228
1228
|
}
|
|
1229
1229
|
// π― ν(row) κ΄λ ¨ μ μ΄ μ κ·Όμ μ€ν
|
|
1230
1230
|
get row() {
|
|
1231
|
-
return t(this,
|
|
1231
|
+
return t(this, j).row;
|
|
1232
1232
|
}
|
|
1233
1233
|
// π― μ 체 λ°μ΄ν° λ§€λμ μ κ·Ό νμν κ²½μ°
|
|
1234
1234
|
get dataManager() {
|
|
1235
|
-
return t(this,
|
|
1235
|
+
return t(this, j);
|
|
1236
1236
|
}
|
|
1237
1237
|
};
|
|
1238
|
-
|
|
1238
|
+
j = new WeakMap(), Mt = new WeakMap(), a(Jt, "NineTable");
|
|
1239
1239
|
let Yt = Jt;
|
|
1240
1240
|
customElements.get("nine-table") || customElements.define("nine-table", Yt);
|
|
1241
1241
|
//# sourceMappingURL=nine-table.js.map
|