@ninebone/table 0.0.385 β 0.0.386
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 +256 -256
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +5 -5
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var ve = Object.defineProperty;
|
|
2
|
+
var we = (x) => {
|
|
3
3
|
throw TypeError(x);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var a = (x, i) =>
|
|
7
|
-
var v = (x, i, e) =>
|
|
8
|
-
var t = (x, i, e) => (
|
|
9
|
-
var
|
|
5
|
+
var Re = (x, i, e) => i in x ? ve(x, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : x[i] = e;
|
|
6
|
+
var a = (x, i) => ve(x, "name", { value: i, configurable: !0 });
|
|
7
|
+
var v = (x, i, e) => Re(x, typeof i != "symbol" ? i + "" : i, e), Se = (x, i, e) => i.has(x) || we("Cannot " + e);
|
|
8
|
+
var t = (x, i, e) => (Se(x, i, "read from private field"), e ? e.call(x) : i.get(x)), c = (x, i, e) => i.has(x) ? we("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(x) : i.set(x, e), g = (x, i, e, s) => (Se(x, i, "write to private field"), s ? s.call(x, e) : i.set(x, e), e);
|
|
9
|
+
var Ee = (x, i, e, s) => ({
|
|
10
10
|
set _(n) {
|
|
11
11
|
g(x, i, n, e);
|
|
12
12
|
},
|
|
@@ -14,26 +14,26 @@ var Re = (x, i, e, s) => ({
|
|
|
14
14
|
return t(x, i, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
import { trace as
|
|
18
|
-
const
|
|
17
|
+
import { trace as Ae } from "@ninebone/util";
|
|
18
|
+
const ce = class ce extends Ae.constructor {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
a(
|
|
24
|
-
let
|
|
25
|
-
const
|
|
26
|
-
var W, D, p, Y, X, U,
|
|
27
|
-
const
|
|
23
|
+
a(ce, "Trace");
|
|
24
|
+
let Gt = ce;
|
|
25
|
+
const _ = new Gt();
|
|
26
|
+
var W, D, p, Y, X, U, At, F, Tt;
|
|
27
|
+
const he = class he extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
c(this, W);
|
|
31
|
+
c(this, D, !1);
|
|
32
|
+
c(this, p);
|
|
33
|
+
c(this, Y);
|
|
34
|
+
c(this, X);
|
|
35
|
+
c(this, U);
|
|
36
|
+
c(this, At, /* @__PURE__ */ a(() => {
|
|
37
37
|
if (!t(this, W)) return;
|
|
38
38
|
const e = t(this, W).querySelector(".ng-container-body");
|
|
39
39
|
e && (g(this, U, new ResizeObserver(() => {
|
|
@@ -51,17 +51,17 @@ const ce = class ce extends HTMLElement {
|
|
|
51
51
|
o && (o.style.display = "none");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
56
|
-
const f = Math.max(Math.min(
|
|
54
|
+
const h = n.clientWidth;
|
|
55
|
+
if (h <= 0) return;
|
|
56
|
+
const f = Math.max(Math.min(h * (l / d), h), 20);
|
|
57
57
|
r.style.width = `${f}px`;
|
|
58
58
|
const u = e.scrollLeft, b = d - l;
|
|
59
59
|
let y = 0;
|
|
60
|
-
b > 0 && (y = parseInt(u / b * (
|
|
61
|
-
const m =
|
|
62
|
-
y > m && (y = m), r.style.left = `${y}px`,
|
|
60
|
+
b > 0 && (y = parseInt(u / b * (h - f), 10)), y < 0 && (y = 0);
|
|
61
|
+
const m = h - f;
|
|
62
|
+
y > m && (y = m), r.style.left = `${y}px`, _.log(y), t(this, p).left.disabled = y === 0, t(this, p).right.disabled = y >= m - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
|
|
64
|
+
c(this, F, /* @__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;
|
|
@@ -70,10 +70,10 @@ const ce = class ce extends HTMLElement {
|
|
|
70
70
|
l < 0 && (l = 0);
|
|
71
71
|
const d = r.width - o;
|
|
72
72
|
l > d && (l = d), 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 >= d - 1;
|
|
73
|
-
const
|
|
73
|
+
const h = s.clientWidth, u = n.scrollWidth - h;
|
|
74
74
|
return d > 0 && u > 0 && (s.scrollLeft = l / d * u), l > 0 && l < d - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
|
|
76
|
+
c(this, Tt, /* @__PURE__ */ a(() => {
|
|
77
77
|
const e = /* @__PURE__ */ a((n) => {
|
|
78
78
|
clearInterval(t(this, Y)), clearInterval(t(this, X));
|
|
79
79
|
const r = parseInt(t(this, p).thumb.style.left || 0, 10);
|
|
@@ -190,7 +190,7 @@ const ce = class ce extends HTMLElement {
|
|
|
190
190
|
right: this.querySelector(".ng-scroll-right")
|
|
191
191
|
}), s.addEventListener("scroll", () => {
|
|
192
192
|
t(this, D) || this.refresh();
|
|
193
|
-
}), t(this,
|
|
193
|
+
}), t(this, Tt).call(this), t(this, At).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
@@ -198,57 +198,58 @@ const ce = class ce extends HTMLElement {
|
|
|
198
198
|
t(this, U) && t(this, U).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
W = new WeakMap(), D = new WeakMap(), p = new WeakMap(), Y = new WeakMap(), X = new WeakMap(), U = new WeakMap(),
|
|
202
|
-
let
|
|
203
|
-
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar",
|
|
204
|
-
var
|
|
205
|
-
const
|
|
201
|
+
W = new WeakMap(), D = new WeakMap(), p = new WeakMap(), Y = new WeakMap(), X = new WeakMap(), U = new WeakMap(), At = new WeakMap(), F = new WeakMap(), Tt = new WeakMap(), a(he, "NineTableHScrollBar");
|
|
202
|
+
let Jt = he;
|
|
203
|
+
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Jt);
|
|
204
|
+
var M, dt, B, S, ft, ut, qt;
|
|
205
|
+
const de = class de extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
208
|
+
c(this, M);
|
|
209
|
+
c(this, dt);
|
|
210
|
+
c(this, B, !1);
|
|
211
|
+
c(this, S);
|
|
212
|
+
c(this, ft, 0);
|
|
213
|
+
c(this, ut, 0);
|
|
213
214
|
/**
|
|
214
215
|
* π― μ€ν¬λ‘€λ° μμΉ λ° μΈλΈ ν¬κΈ° κ°±μ
|
|
215
216
|
*/
|
|
216
217
|
v(this, "refresh", /* @__PURE__ */ a(() => {
|
|
217
|
-
var
|
|
218
|
-
if (!t(this,
|
|
219
|
-
const e = t(this, S).container, s = t(this, S).track, n = t(this, S).thumb, r = e.clientHeight, l = (((
|
|
220
|
-
if (
|
|
218
|
+
var Et, Q, ct, xe;
|
|
219
|
+
if (!t(this, M) || !t(this, S) || t(this, B)) return;
|
|
220
|
+
const e = t(this, S).container, s = t(this, S).track, n = t(this, S).thumb, r = e.clientHeight, l = (((Et = t(this, M).data) == null ? void 0 : Et.get()) || ((Q = t(this, M).data) == null ? void 0 : Q.get()) || []).length, d = (xe = (ct = t(this, M)).getRowHeight) == null ? void 0 : xe.call(ct), h = l * d;
|
|
221
|
+
if (h <= r) {
|
|
221
222
|
n.style.display = "none", t(this, S).top.disabled = !0, t(this, S).bottom.disabled = !0;
|
|
222
223
|
return;
|
|
223
224
|
} else
|
|
224
225
|
n.style.display = "block";
|
|
225
226
|
const f = s.clientHeight;
|
|
226
227
|
if (f <= 0) return;
|
|
227
|
-
const u = Math.max(Math.min(f * (r /
|
|
228
|
+
const u = Math.max(Math.min(f * (r / h), f), 20);
|
|
228
229
|
n.style.height = `${u}px`;
|
|
229
|
-
const b = e.scrollTop, y = e.querySelector("table"), m = y ? y.scrollHeight :
|
|
230
|
+
const b = e.scrollTop, y = e.querySelector("table"), m = y ? y.scrollHeight : h, E = Math.max(h - r, m - r, 1);
|
|
230
231
|
let k = 0;
|
|
231
232
|
E > 0 && (k = b / E * (f - u));
|
|
232
233
|
const at = f - u;
|
|
233
234
|
k < 0 && (k = 0), k > at && (k = at), n.style.top = `${k}px`, t(this, S).top.disabled = b <= 0, t(this, S).bottom.disabled = b >= E - 1;
|
|
234
235
|
}, "refresh"));
|
|
235
|
-
|
|
236
|
+
c(this, qt, /* @__PURE__ */ a(() => {
|
|
236
237
|
const e = t(this, S).container, s = /* @__PURE__ */ a(() => {
|
|
237
|
-
var l, d,
|
|
238
|
-
const n = ((d = (l = t(this,
|
|
238
|
+
var l, d, h, f, u, b;
|
|
239
|
+
const n = ((d = (l = t(this, M).host) == null ? void 0 : l.data) == null ? void 0 : d.get()) || ((f = (h = t(this, M)._host) == null ? void 0 : h.data) == null ? void 0 : f.get()) || [], r = n.length > 0 ? n.length : 61, o = ((b = (u = t(this, M)).getRowHeight) == null ? void 0 : b.call(u)) || 85;
|
|
239
240
|
return r * o;
|
|
240
241
|
}, "getContentHeight");
|
|
241
242
|
e.addEventListener("scroll", () => {
|
|
242
243
|
t(this, B) || this.refresh();
|
|
243
244
|
}), t(this, S).thumb.addEventListener("mousedown", (n) => {
|
|
244
245
|
if (n.button !== 0) return;
|
|
245
|
-
n.stopPropagation(), n.preventDefault(), g(this, B, !0), g(this,
|
|
246
|
+
n.stopPropagation(), n.preventDefault(), g(this, B, !0), g(this, ft, n.clientY), g(this, ut, e.scrollTop);
|
|
246
247
|
const r = /* @__PURE__ */ a((l) => {
|
|
247
248
|
if (!t(this, B)) return;
|
|
248
|
-
const d = t(this, S).track.getBoundingClientRect(),
|
|
249
|
+
const d = t(this, S).track.getBoundingClientRect(), h = t(this, S).thumb.clientHeight, u = d.height - h, b = l.clientY - t(this, ft), y = e.clientHeight, m = s(), E = e.querySelector("table"), k = E ? E.scrollHeight : m, at = Math.max(m - y, k - y, 1);
|
|
249
250
|
if (u > 0 && at > 0) {
|
|
250
|
-
const
|
|
251
|
-
let Q = t(this,
|
|
251
|
+
const Et = b / u * at;
|
|
252
|
+
let Q = t(this, ut) + Et;
|
|
252
253
|
const ct = Math.max(0, k - y);
|
|
253
254
|
Q > ct && (Q = ct), e.scrollTop = Q;
|
|
254
255
|
}
|
|
@@ -259,9 +260,9 @@ const he = class he extends HTMLElement {
|
|
|
259
260
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", o);
|
|
260
261
|
}), t(this, S).track.addEventListener("mousedown", (n) => {
|
|
261
262
|
if (n.button !== 0 || n.target === t(this, S).thumb) return;
|
|
262
|
-
const r = t(this, S).track.getBoundingClientRect(), o = t(this, S).thumb.clientHeight, l = n.clientY - r.top - o / 2,
|
|
263
|
-
if (
|
|
264
|
-
const E = Math.max(0, Math.min(1, l /
|
|
263
|
+
const r = t(this, S).track.getBoundingClientRect(), o = t(this, S).thumb.clientHeight, l = n.clientY - r.top - o / 2, h = r.height - o, f = e.clientHeight, u = s(), b = e.querySelector("table"), y = b ? b.scrollHeight : u, m = Math.max(u - f, y - f, 1);
|
|
264
|
+
if (h > 0 && m > 0) {
|
|
265
|
+
const E = Math.max(0, Math.min(1, l / h));
|
|
265
266
|
e.scrollTop = E * m;
|
|
266
267
|
}
|
|
267
268
|
this.refresh();
|
|
@@ -273,8 +274,7 @@ const he = class he extends HTMLElement {
|
|
|
273
274
|
}, "#init"));
|
|
274
275
|
}
|
|
275
276
|
connectedCallback() {
|
|
276
|
-
|
|
277
|
-
this.innerHTML = `
|
|
277
|
+
g(this, M, this.getRootNode().host), g(this, dt, this.closest("nine-table-sheet")), _.log("----------"), _.log(t(this, dt)), this.innerHTML = `
|
|
278
278
|
<style>
|
|
279
279
|
nine-table-vscrollbar {
|
|
280
280
|
display: flex;
|
|
@@ -338,7 +338,7 @@ const he = class he extends HTMLElement {
|
|
|
338
338
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
339
339
|
`;
|
|
340
340
|
const e = /* @__PURE__ */ a(() => {
|
|
341
|
-
const s = t(this,
|
|
341
|
+
const s = t(this, M).shadowRoot.querySelector(".ng-container-body");
|
|
342
342
|
if (!s) {
|
|
343
343
|
setTimeout(e, 10);
|
|
344
344
|
return;
|
|
@@ -349,15 +349,15 @@ const he = class he extends HTMLElement {
|
|
|
349
349
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
350
350
|
top: this.querySelector(".ng-scroll-top"),
|
|
351
351
|
bottom: this.querySelector(".ng-scroll-bottom")
|
|
352
|
-
}), t(this,
|
|
352
|
+
}), t(this, qt).call(this), this.refresh();
|
|
353
353
|
}, "initWhenReady");
|
|
354
354
|
e();
|
|
355
355
|
}
|
|
356
356
|
};
|
|
357
|
-
|
|
358
|
-
let
|
|
359
|
-
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar",
|
|
360
|
-
var
|
|
357
|
+
M = new WeakMap(), dt = new WeakMap(), B = new WeakMap(), S = new WeakMap(), ft = new WeakMap(), ut = new WeakMap(), qt = new WeakMap(), a(de, "NineTableVScrollBar");
|
|
358
|
+
let Qt = de;
|
|
359
|
+
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Qt);
|
|
360
|
+
var kt, tt;
|
|
361
361
|
const I = class I {
|
|
362
362
|
/**
|
|
363
363
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
@@ -372,15 +372,15 @@ const I = class I {
|
|
|
372
372
|
var n, r, o, l;
|
|
373
373
|
if (!i) return null;
|
|
374
374
|
const e = i.cloneNode(!0);
|
|
375
|
-
return t(n = I,
|
|
375
|
+
return t(n = I, kt).call(n, e), t(r = I, tt).call(r, e, "thead"), t(o = I, tt).call(o, e, "tbody"), t(l = I, tt).call(l, e, "tfoot"), Array.from(e.querySelectorAll("colgroup col")).forEach((d, h) => {
|
|
376
376
|
const f = d.getAttribute("fixed");
|
|
377
|
-
f && e.querySelectorAll(`thead [data-col="${
|
|
377
|
+
f && e.querySelectorAll(`thead [data-col="${h}"], tbody [data-col="${h}"], tfoot [data-col="${h}"]`).forEach((u) => {
|
|
378
378
|
u.setAttribute("fixed", f);
|
|
379
379
|
});
|
|
380
380
|
}), e;
|
|
381
381
|
}
|
|
382
382
|
};
|
|
383
|
-
|
|
383
|
+
kt = new WeakMap(), tt = new WeakMap(), a(I, "TableCompiler"), c(I, kt, /* @__PURE__ */ a((i) => {
|
|
384
384
|
if (!i.querySelector("colgroup")) {
|
|
385
385
|
const e = i.querySelector("tbody tr") || i.querySelector("tr"), s = e ? e.querySelectorAll("th, td").length : 1, n = document.createElement("colgroup"), r = Math.max(Math.floor(i.clientWidth / s), 100);
|
|
386
386
|
for (let o = 0; o < s; o++) {
|
|
@@ -394,7 +394,7 @@ qt = new WeakMap(), tt = new WeakMap(), a(I, "TableCompiler"), h(I, qt, /* @__PU
|
|
|
394
394
|
s ? s.after(e) : i.prepend(e);
|
|
395
395
|
}
|
|
396
396
|
i.classList.add("nine-table-element"), i.style.display = "table";
|
|
397
|
-
}, "#ensureTableStructure")),
|
|
397
|
+
}, "#ensureTableStructure")), c(I, tt, /* @__PURE__ */ a((i, e) => {
|
|
398
398
|
const s = Array.from(i.querySelectorAll(e + " tr")), n = Array.from(i.querySelectorAll(e + " th," + e + " td")), r = s.length;
|
|
399
399
|
if (r === 0 || n.length === 0) return;
|
|
400
400
|
let o = 0;
|
|
@@ -403,47 +403,47 @@ qt = new WeakMap(), tt = new WeakMap(), a(I, "TableCompiler"), h(I, qt, /* @__PU
|
|
|
403
403
|
});
|
|
404
404
|
const l = Array.from(Array(r), () => Array(o).fill(null));
|
|
405
405
|
s.forEach((d) => {
|
|
406
|
-
const
|
|
406
|
+
const h = d.sectionRowIndex;
|
|
407
407
|
let f = 0;
|
|
408
408
|
Array.from(d.querySelectorAll("th,td")).forEach((u) => {
|
|
409
|
-
for (let m = 0; m < l[
|
|
410
|
-
if (l[
|
|
409
|
+
for (let m = 0; m < l[h].length; m++)
|
|
410
|
+
if (l[h][m] === null) {
|
|
411
411
|
f = m;
|
|
412
412
|
break;
|
|
413
413
|
}
|
|
414
414
|
const b = u.rowSpan || 1, y = u.colSpan || 1;
|
|
415
415
|
for (let m = 0; m < b; m++)
|
|
416
416
|
for (let E = 0; E < y; E++)
|
|
417
|
-
|
|
417
|
+
h + m < r && f + E < o && (l[h + m][f + E] = m === 0 && E === 0 ? "1" : "0");
|
|
418
418
|
});
|
|
419
419
|
}), s.forEach((d) => {
|
|
420
|
-
const
|
|
420
|
+
const h = d.sectionRowIndex;
|
|
421
421
|
Array.from(d.querySelectorAll("th,td")).forEach((f) => {
|
|
422
|
-
for (let u = 0; u < l[
|
|
423
|
-
if (l[
|
|
424
|
-
f.dataset.col = u, l[
|
|
422
|
+
for (let u = 0; u < l[h].length; u++)
|
|
423
|
+
if (l[h][u] === "1") {
|
|
424
|
+
f.dataset.col = u, l[h][u] = "0";
|
|
425
425
|
break;
|
|
426
426
|
}
|
|
427
427
|
});
|
|
428
428
|
});
|
|
429
429
|
}, "#resetColIndex"));
|
|
430
|
-
let
|
|
431
|
-
var O, w, z, T, N, j, P, et,
|
|
432
|
-
const
|
|
430
|
+
let te = I;
|
|
431
|
+
var O, w, z, T, N, j, P, et, Lt, Ht, Ct, gt, bt, Mt, _t, yt, $t, it, pt;
|
|
432
|
+
const fe = class fe {
|
|
433
433
|
constructor(i) {
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
434
|
+
c(this, O);
|
|
435
|
+
c(this, w);
|
|
436
|
+
c(this, z, /* @__PURE__ */ new Map());
|
|
437
|
+
c(this, T, null);
|
|
438
|
+
c(this, N, null);
|
|
439
|
+
c(this, j, 0);
|
|
440
|
+
c(this, P, 40);
|
|
441
|
+
c(this, et, !1);
|
|
442
|
+
c(this, Lt, 3);
|
|
443
443
|
v(this, "refresh", /* @__PURE__ */ a(() => {
|
|
444
444
|
var e;
|
|
445
445
|
const i = t(this, w).querySelector(".ng-container-body");
|
|
446
|
-
i && (t(this,
|
|
446
|
+
i && (t(this, gt).call(this), t(this, it).call(this, i.scrollTop), (e = t(this, w).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
447
447
|
}, "refresh"));
|
|
448
448
|
v(this, "initialize", /* @__PURE__ */ a(() => {
|
|
449
449
|
g(this, T, null), t(this, z).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
@@ -453,12 +453,12 @@ const de = class de {
|
|
|
453
453
|
if (!o) return;
|
|
454
454
|
const l = o.querySelector("tbody.bindable-tbody");
|
|
455
455
|
if (!l) return;
|
|
456
|
-
const
|
|
457
|
-
t(this, z).set(n,
|
|
456
|
+
const h = Array.from(l.querySelectorAll("tr")).map((f) => f.cloneNode(!0));
|
|
457
|
+
t(this, z).set(n, h);
|
|
458
458
|
});
|
|
459
459
|
const i = t(this, w).querySelector(".ng-container-body"), e = t(this, w).querySelector(".ng-container-left"), s = t(this, w).querySelector(".ng-container-right");
|
|
460
460
|
if (i) {
|
|
461
|
-
t(this,
|
|
461
|
+
t(this, Ct).call(this, i), t(this, yt).call(this), t(this, gt).call(this), t(this, it).call(this, i.scrollTop);
|
|
462
462
|
let n = i.scrollTop;
|
|
463
463
|
const r = /* @__PURE__ */ a((o) => {
|
|
464
464
|
var l;
|
|
@@ -470,7 +470,7 @@ const de = class de {
|
|
|
470
470
|
});
|
|
471
471
|
}
|
|
472
472
|
}, "initialize"));
|
|
473
|
-
|
|
473
|
+
c(this, Ht, /* @__PURE__ */ a((i, e) => {
|
|
474
474
|
const s = t(this, z).get(e);
|
|
475
475
|
if (!s || s.length === 0) return;
|
|
476
476
|
const n = i.querySelector("tbody.bindable-tbody");
|
|
@@ -483,7 +483,7 @@ const de = class de {
|
|
|
483
483
|
});
|
|
484
484
|
r ? r.before(o) : n.appendChild(o);
|
|
485
485
|
}, "#renderRows"));
|
|
486
|
-
|
|
486
|
+
c(this, Ct, /* @__PURE__ */ a((i) => {
|
|
487
487
|
if (t(this, T) !== null && t(this, T) > 0)
|
|
488
488
|
return t(this, T);
|
|
489
489
|
const e = t(this, z).get(".ng-container-body");
|
|
@@ -495,43 +495,43 @@ const de = class de {
|
|
|
495
495
|
e.forEach((b) => {
|
|
496
496
|
r.appendChild(b.cloneNode(!0));
|
|
497
497
|
}), n ? n.before(r) : s.appendChild(r);
|
|
498
|
-
const o = t(this, w), l = o.style.display, d = o.style.visibility,
|
|
498
|
+
const o = t(this, w), l = o.style.display, d = o.style.visibility, h = o.style.position;
|
|
499
499
|
(l === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
500
500
|
let f = 0;
|
|
501
501
|
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
502
502
|
return u.forEach((b) => {
|
|
503
503
|
f += b.offsetHeight || b.getBoundingClientRect().height;
|
|
504
|
-
}), u.forEach((b) => b.remove()), o.style.display = l, o.style.visibility = d, o.style.position =
|
|
504
|
+
}), u.forEach((b) => b.remove()), o.style.display = l, o.style.visibility = d, o.style.position = h, g(this, T, f > 0 ? f : 24), t(this, bt).call(this), t(this, T);
|
|
505
505
|
}, "#measureAndCacheHeight"));
|
|
506
|
-
|
|
506
|
+
c(this, gt, /* @__PURE__ */ a(() => {
|
|
507
507
|
if (!t(this, w).querySelector(".ng-container-body")) return;
|
|
508
508
|
const s = (t(this, O).data.get() || []).length, n = t(this, T) || 24, r = s * n;
|
|
509
|
-
|
|
509
|
+
_.log(`[VirtualHeight] totalCount: ${s}, rowHeight: ${n}, totalVirtualHeight: ${r}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
510
510
|
const l = t(this, w).querySelector(o), d = l == null ? void 0 : l.querySelector("table");
|
|
511
511
|
d && (d.style.height = `${r}px`);
|
|
512
512
|
});
|
|
513
513
|
}, "#updateVirtualScrollHeight"));
|
|
514
|
-
|
|
514
|
+
c(this, bt, /* @__PURE__ */ a(() => {
|
|
515
515
|
if ((t(this, O).data.get() || []).length, t(this, j) > 0 && t(this, T) > 0) {
|
|
516
516
|
const e = Math.ceil(t(this, j) / t(this, T));
|
|
517
|
-
g(this, P, e + t(this,
|
|
517
|
+
g(this, P, e + t(this, Lt)), _.log("visibleRows:", e, "cachedRowCount:", t(this, P));
|
|
518
518
|
}
|
|
519
519
|
}, "#updateRowCount"));
|
|
520
|
-
|
|
521
|
-
var d,
|
|
520
|
+
c(this, Mt, /* @__PURE__ */ a(() => {
|
|
521
|
+
var d, h, f;
|
|
522
522
|
const i = t(this, w).querySelector(".ng-container-left table"), e = t(this, w).querySelector(".ng-container-body table"), s = t(this, w).querySelector(".ng-container-right table");
|
|
523
523
|
if (!e) return;
|
|
524
524
|
const n = i ? Array.from(i.querySelectorAll("tr")) : [], r = Array.from(e.querySelectorAll("tr")), o = s ? Array.from(s.querySelectorAll("tr")) : [], l = Math.max(n.length, r.length, o.length);
|
|
525
525
|
for (let u = 0; u < l; u++) {
|
|
526
526
|
const b = [
|
|
527
527
|
((d = n[u]) == null ? void 0 : d.getBoundingClientRect().height) || 0,
|
|
528
|
-
((
|
|
528
|
+
((h = r[u]) == null ? void 0 : h.getBoundingClientRect().height) || 0,
|
|
529
529
|
((f = o[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
530
530
|
], y = Math.max(...b);
|
|
531
531
|
y > 0 && (n[u] && (n[u].style.height = `${y}px`), r[u] && (r[u].style.height = `${y}px`), o[u] && (o[u].style.height = `${y}px`));
|
|
532
532
|
}
|
|
533
533
|
}, "#syncRowHeights"));
|
|
534
|
-
|
|
534
|
+
c(this, _t, /* @__PURE__ */ a(() => {
|
|
535
535
|
!t(this, w) || !(t(this, w) instanceof HTMLElement) || (g(this, N, new ResizeObserver((i) => {
|
|
536
536
|
for (const e of i) {
|
|
537
537
|
const s = e.target;
|
|
@@ -542,25 +542,25 @@ const de = class de {
|
|
|
542
542
|
const o = s.querySelector("thead");
|
|
543
543
|
o && (r += o.offsetHeight || o.getBoundingClientRect().height);
|
|
544
544
|
const l = Math.max(n - r, 100);
|
|
545
|
-
t(this, j) !== l && (g(this, j, l), t(this,
|
|
545
|
+
t(this, j) !== l && (g(this, j, l), t(this, bt).call(this), t(this, T) !== null && t(this, yt).call(this));
|
|
546
546
|
}
|
|
547
547
|
}
|
|
548
548
|
})), t(this, N).observe(t(this, w)));
|
|
549
549
|
}, "#initResizeObserver"));
|
|
550
|
-
|
|
550
|
+
c(this, yt, /* @__PURE__ */ a(() => {
|
|
551
551
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
552
552
|
const e = t(this, w).querySelector(i);
|
|
553
|
-
e && e.querySelector("tbody.bindable-tbody") && t(this,
|
|
554
|
-
}), t(this,
|
|
553
|
+
e && e.querySelector("tbody.bindable-tbody") && t(this, Ht).call(this, e, i);
|
|
554
|
+
}), t(this, Mt).call(this);
|
|
555
555
|
}, "#renderAllContainers"));
|
|
556
|
-
|
|
556
|
+
c(this, $t, /* @__PURE__ */ a((i) => {
|
|
557
557
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
558
|
-
var
|
|
558
|
+
var h;
|
|
559
559
|
const s = t(this, w).querySelector(e);
|
|
560
560
|
if (!s) return;
|
|
561
561
|
const n = s.querySelector("tbody.bindable-tbody");
|
|
562
562
|
if (!n) return;
|
|
563
|
-
const r = Array.from(n.querySelectorAll("tr:not(.nodata)")), o = ((
|
|
563
|
+
const r = Array.from(n.querySelectorAll("tr:not(.nodata)")), o = ((h = t(this, z).get(e)) == null ? void 0 : h.length) || 1, d = (t(this, O).data.get() || []).length;
|
|
564
564
|
r.forEach((f, u) => {
|
|
565
565
|
const b = i + Math.floor(u / o);
|
|
566
566
|
if (b >= d) {
|
|
@@ -568,17 +568,17 @@ const de = class de {
|
|
|
568
568
|
return;
|
|
569
569
|
}
|
|
570
570
|
const y = t(this, O).data.get(b);
|
|
571
|
-
f.style.display = "", t(this,
|
|
571
|
+
f.style.display = "", t(this, pt).call(this, f, y, b);
|
|
572
572
|
});
|
|
573
573
|
});
|
|
574
574
|
}, "#adjustBufferRows"));
|
|
575
|
-
|
|
575
|
+
c(this, it, /* @__PURE__ */ a((i) => {
|
|
576
576
|
var d;
|
|
577
577
|
const e = t(this, T);
|
|
578
578
|
if (!e || e <= 0) return;
|
|
579
579
|
const n = (t(this, O).data.get() || []).length, r = Math.max(0, Math.floor(i / e)), o = ((d = t(this, z).get(".ng-container-body")) == null ? void 0 : d.length) || 1, l = r + t(this, P);
|
|
580
|
-
|
|
581
|
-
const f = t(this, w).querySelector(
|
|
580
|
+
_.log(`[Scroll] scrollTop: ${i}, startIndex: ${r}, cachedRowCount: ${t(this, P)}, targetDataIndex range: ${r} ~ ${l} (Total: ${n})`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((h) => {
|
|
581
|
+
const f = t(this, w).querySelector(h);
|
|
582
582
|
if (!f) return;
|
|
583
583
|
const u = f.querySelector("tbody.bindable-tbody");
|
|
584
584
|
if (!u) return;
|
|
@@ -589,13 +589,13 @@ const de = class de {
|
|
|
589
589
|
return;
|
|
590
590
|
}
|
|
591
591
|
const k = t(this, O).data.get(E);
|
|
592
|
-
y.style.display = "", t(this,
|
|
592
|
+
y.style.display = "", t(this, pt).call(this, y, k, E);
|
|
593
593
|
});
|
|
594
594
|
}), t(this, et) || (g(this, et, !0), setTimeout(() => {
|
|
595
|
-
t(this,
|
|
595
|
+
t(this, $t).call(this, r), g(this, et, !1);
|
|
596
596
|
}, 0));
|
|
597
597
|
}, "#handleScroll"));
|
|
598
|
-
|
|
598
|
+
c(this, pt, /* @__PURE__ */ a((i, e, s) => {
|
|
599
599
|
i.dataset.row = s, Array.from(i.cells).forEach((n, r) => {
|
|
600
600
|
const o = n.dataset.bind;
|
|
601
601
|
o && e && e[o] !== void 0 ? n.textContent = e[o] : n.textContent = e ? e[Object.keys(e)[r]] ?? `R${s}C${r}` : `ν ${s + 1}`, n.dataset.row = s;
|
|
@@ -614,15 +614,15 @@ const de = class de {
|
|
|
614
614
|
return ((e = t(this, z).get(i)) == null ? void 0 : e.length) || 1;
|
|
615
615
|
}
|
|
616
616
|
};
|
|
617
|
-
O = new WeakMap(), w = new WeakMap(), z = new WeakMap(), T = new WeakMap(), N = new WeakMap(), j = new WeakMap(), P = new WeakMap(), et = new WeakMap(),
|
|
618
|
-
let
|
|
619
|
-
var
|
|
617
|
+
O = new WeakMap(), w = new WeakMap(), z = new WeakMap(), T = new WeakMap(), N = new WeakMap(), j = new WeakMap(), P = new WeakMap(), et = new WeakMap(), Lt = new WeakMap(), Ht = new WeakMap(), Ct = new WeakMap(), gt = new WeakMap(), bt = new WeakMap(), Mt = new WeakMap(), _t = new WeakMap(), yt = new WeakMap(), $t = new WeakMap(), it = new WeakMap(), pt = new WeakMap(), a(fe, "RowManager");
|
|
618
|
+
let ee = fe;
|
|
619
|
+
var It, st, K, Wt, Ot, zt, Dt, Bt;
|
|
620
620
|
const ht = class ht extends HTMLElement {
|
|
621
621
|
constructor() {
|
|
622
622
|
super();
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
623
|
+
c(this, It);
|
|
624
|
+
c(this, st, null);
|
|
625
|
+
c(this, K);
|
|
626
626
|
/**
|
|
627
627
|
* data.set, add, delete
|
|
628
628
|
* filter, sorting : κ³ λ €λμ
|
|
@@ -630,7 +630,7 @@ const ht = class ht extends HTMLElement {
|
|
|
630
630
|
v(this, "invalidate", /* @__PURE__ */ a(() => {
|
|
631
631
|
t(this, K).refresh();
|
|
632
632
|
}, "invalidate"));
|
|
633
|
-
|
|
633
|
+
c(this, Wt, /* @__PURE__ */ a(() => {
|
|
634
634
|
[
|
|
635
635
|
{ selector: ".ng-container-body", type: null },
|
|
636
636
|
{ selector: ".ng-container-left", type: "left" },
|
|
@@ -638,11 +638,11 @@ const ht = class ht extends HTMLElement {
|
|
|
638
638
|
].forEach(({ selector: s, type: n }) => {
|
|
639
639
|
const r = this.querySelector(s);
|
|
640
640
|
if (!r) return;
|
|
641
|
-
const o = t(this,
|
|
641
|
+
const o = t(this, zt).call(this, t(this, st), n);
|
|
642
642
|
r.innerHTML = "", r.appendChild(o);
|
|
643
643
|
});
|
|
644
644
|
}, "#renderSplitContainers"));
|
|
645
|
-
|
|
645
|
+
c(this, Ot, /* @__PURE__ */ a(() => {
|
|
646
646
|
["left", "right"].forEach((e) => {
|
|
647
647
|
const s = this.querySelector(`.ng-container-${e}`), n = s == null ? void 0 : s.querySelector("table");
|
|
648
648
|
if (!s || !n) return;
|
|
@@ -654,7 +654,7 @@ const ht = class ht extends HTMLElement {
|
|
|
654
654
|
});
|
|
655
655
|
}, "#updateContainerWidths"));
|
|
656
656
|
v(this, "generate", /* @__PURE__ */ a((e) => {
|
|
657
|
-
e && (g(this, st,
|
|
657
|
+
e && (g(this, st, te.compile(e)), t(this, st).style.display = "table", t(this, Wt).call(this), t(this, Ot).call(this), requestAnimationFrame(() => {
|
|
658
658
|
var n;
|
|
659
659
|
const s = (n = this.querySelector("thead")) == null ? void 0 : n.getBoundingClientRect().height;
|
|
660
660
|
this.querySelectorAll("tbody.fixed-tbody").forEach((r) => {
|
|
@@ -668,7 +668,7 @@ const ht = class ht extends HTMLElement {
|
|
|
668
668
|
/**
|
|
669
669
|
* π― λ§μ€ν° ν
μ΄λΈμ κΈ°λ°μΌλ‘ νΉμ fixed νμ
μμλ§ λ¨κΈ°λ λΆν ν¬νΌ
|
|
670
670
|
*/
|
|
671
|
-
|
|
671
|
+
c(this, zt, /* @__PURE__ */ a((e, s) => {
|
|
672
672
|
const n = e.cloneNode(!0), r = n.querySelector("tbody");
|
|
673
673
|
if (r) {
|
|
674
674
|
const o = document.createElement("tbody");
|
|
@@ -691,10 +691,10 @@ const ht = class ht extends HTMLElement {
|
|
|
691
691
|
const s = this.querySelector(".ng-container-body");
|
|
692
692
|
s && (s.scrollTop = e);
|
|
693
693
|
}, "scrollToY"));
|
|
694
|
-
|
|
695
|
-
t(this,
|
|
694
|
+
c(this, Dt, /* @__PURE__ */ a(() => {
|
|
695
|
+
t(this, Bt).call(this);
|
|
696
696
|
}, "#init"));
|
|
697
|
-
|
|
697
|
+
c(this, Bt, /* @__PURE__ */ a(() => {
|
|
698
698
|
const e = ht.SCROLLBAR_SIZE;
|
|
699
699
|
this.innerHTML = `
|
|
700
700
|
<style>
|
|
@@ -841,31 +841,31 @@ const ht = class ht extends HTMLElement {
|
|
|
841
841
|
</div>
|
|
842
842
|
`;
|
|
843
843
|
}, "#render"));
|
|
844
|
-
g(this, K, new
|
|
844
|
+
g(this, K, new ee(this)), g(this, It, this.getRootNode().host);
|
|
845
845
|
}
|
|
846
846
|
connectedCallback() {
|
|
847
|
-
t(this,
|
|
847
|
+
t(this, Dt).call(this);
|
|
848
848
|
}
|
|
849
849
|
disconnectedCallback() {
|
|
850
|
-
this.innerHTML = "",
|
|
850
|
+
this.innerHTML = "", _.log("NineTableSheet destroyed.");
|
|
851
851
|
}
|
|
852
852
|
};
|
|
853
|
-
|
|
854
|
-
let
|
|
855
|
-
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet",
|
|
856
|
-
var
|
|
857
|
-
const
|
|
853
|
+
It = new WeakMap(), st = new WeakMap(), K = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), zt = new WeakMap(), Dt = new WeakMap(), Bt = new WeakMap(), a(ht, "NineTableSheet"), v(ht, "SCROLLBAR_SIZE", 16);
|
|
854
|
+
let Rt = ht;
|
|
855
|
+
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", Rt);
|
|
856
|
+
var Nt, mt;
|
|
857
|
+
const ue = class ue extends HTMLElement {
|
|
858
858
|
constructor() {
|
|
859
859
|
super();
|
|
860
|
-
|
|
860
|
+
c(this, Nt, /* @__PURE__ */ a(() => {
|
|
861
861
|
var e;
|
|
862
862
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
863
863
|
var o;
|
|
864
864
|
const n = s.ctrlKey || s.metaKey || s.shiftKey, r = parseInt((o = s.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
|
|
865
|
-
t(this,
|
|
866
|
-
}), t(this,
|
|
865
|
+
t(this, mt).call(this, r, n);
|
|
866
|
+
}), t(this, mt).call(this, 0, !1);
|
|
867
867
|
}, "#init"));
|
|
868
|
-
|
|
868
|
+
c(this, mt, /* @__PURE__ */ a((e, s = !1) => {
|
|
869
869
|
const n = /* @__PURE__ */ a(() => {
|
|
870
870
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
871
871
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((y) => y.style.setProperty("display", "none"));
|
|
@@ -891,41 +891,41 @@ const fe = class fe extends HTMLElement {
|
|
|
891
891
|
const b = o.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
892
892
|
b && (b.classList.toggle("active"), b.classList.contains("active") || (b.style.flex = ""));
|
|
893
893
|
}
|
|
894
|
-
const
|
|
895
|
-
|
|
896
|
-
f.style.flex =
|
|
894
|
+
const h = o.querySelectorAll("nine-table-sheet.active");
|
|
895
|
+
h == null || h.forEach((f) => {
|
|
896
|
+
f.style.flex = h.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
897
897
|
}), n();
|
|
898
898
|
}, "#switchSheet"));
|
|
899
899
|
}
|
|
900
900
|
connectedCallback() {
|
|
901
|
-
t(this,
|
|
901
|
+
t(this, Nt).call(this);
|
|
902
902
|
}
|
|
903
903
|
};
|
|
904
|
-
|
|
905
|
-
let
|
|
906
|
-
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets",
|
|
907
|
-
var q,
|
|
908
|
-
const
|
|
904
|
+
Nt = new WeakMap(), mt = new WeakMap(), a(ue, "NineTableSheets");
|
|
905
|
+
let ie = ue;
|
|
906
|
+
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", ie);
|
|
907
|
+
var q, Pt, xt, Vt;
|
|
908
|
+
const ge = class ge {
|
|
909
909
|
constructor(i) {
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
t(this,
|
|
910
|
+
c(this, q);
|
|
911
|
+
c(this, Pt, /* @__PURE__ */ a(() => {
|
|
912
|
+
t(this, Vt).call(this), new ResizeObserver((i) => {
|
|
913
913
|
for (let e of i)
|
|
914
|
-
t(this, q).getAttribute("auto-height") === "true" && t(this,
|
|
914
|
+
t(this, q).getAttribute("auto-height") === "true" && t(this, xt).call(this);
|
|
915
915
|
}).observe(t(this, q));
|
|
916
916
|
}, "#init"));
|
|
917
|
-
|
|
918
|
-
var d,
|
|
917
|
+
c(this, xt, /* @__PURE__ */ a(() => {
|
|
918
|
+
var d, h;
|
|
919
919
|
const i = Array.from(t(this, q).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
920
920
|
if (i.length === 0) return;
|
|
921
|
-
const e = parseInt(t(this, q).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), n = (d = t(this, q).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : d.getBoundingClientRect().height, r = (
|
|
921
|
+
const e = parseInt(t(this, q).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), n = (d = t(this, q).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : d.getBoundingClientRect().height, r = (h = t(this, q).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : h.getBoundingClientRect().height, o = Rt.SCROLLBAR_SIZE, l = e * s + n + r + o;
|
|
922
922
|
t(this, q).style.height = `${l}px`;
|
|
923
923
|
}, "#applyAutoHeight"));
|
|
924
|
-
|
|
925
|
-
const e = Array.from(t(this, q).children).filter((d) => d.tagName === "TABLE"), s = t(this, q).getAttribute("auto-height") === "true", n = e.length, r = e.map((d,
|
|
926
|
-
const u = `<nine-table-sheet class="${
|
|
924
|
+
c(this, Vt, /* @__PURE__ */ a(() => {
|
|
925
|
+
const e = Array.from(t(this, q).children).filter((d) => d.tagName === "TABLE"), s = t(this, q).getAttribute("auto-height") === "true", n = e.length, r = e.map((d, h) => {
|
|
926
|
+
const u = `<nine-table-sheet class="${h === 0 ? "active" : ""}" data-index="${h}"></nine-table-sheet>`, b = h < n - 1 ? `<nine-splitter class="h" data-split-index="${h}"></nine-splitter>` : "";
|
|
927
927
|
return u + b;
|
|
928
|
-
}).join(""), o = e.map((d,
|
|
928
|
+
}).join(""), o = e.map((d, h) => `<div class="nine-tab-item ${h === 0 ? "active" : ""}" data-index="${h}">Sheet ${h + 1}</div>`).join("");
|
|
929
929
|
t(this, q).shadowRoot.innerHTML = `
|
|
930
930
|
<style>
|
|
931
931
|
:host {
|
|
@@ -1018,24 +1018,24 @@ const ue = class ue {
|
|
|
1018
1018
|
<nine-table-footer></nine-table-footer>
|
|
1019
1019
|
`;
|
|
1020
1020
|
const l = t(this, q).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1021
|
-
l == null || l.forEach((d,
|
|
1022
|
-
e[
|
|
1023
|
-
d.generate(e[
|
|
1021
|
+
l == null || l.forEach((d, h) => {
|
|
1022
|
+
e[h] && setTimeout(() => {
|
|
1023
|
+
d.generate(e[h]), s && t(this, xt).call(this);
|
|
1024
1024
|
});
|
|
1025
1025
|
});
|
|
1026
1026
|
}, "#render"));
|
|
1027
|
-
g(this, q, i), t(this,
|
|
1027
|
+
g(this, q, i), t(this, Pt).call(this);
|
|
1028
1028
|
}
|
|
1029
1029
|
};
|
|
1030
|
-
q = new WeakMap(),
|
|
1031
|
-
let
|
|
1032
|
-
var
|
|
1033
|
-
const
|
|
1030
|
+
q = new WeakMap(), Pt = new WeakMap(), xt = new WeakMap(), Vt = new WeakMap(), a(ge, "LayoutManager");
|
|
1031
|
+
let se = ge;
|
|
1032
|
+
var vt, nt;
|
|
1033
|
+
const be = class be {
|
|
1034
1034
|
constructor(i) {
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
v(this, "count", /* @__PURE__ */ a(() => t(this,
|
|
1038
|
-
g(this,
|
|
1035
|
+
c(this, vt);
|
|
1036
|
+
c(this, nt, -1);
|
|
1037
|
+
v(this, "count", /* @__PURE__ */ a(() => t(this, vt).rawRecords.length, "count"));
|
|
1038
|
+
g(this, vt, i);
|
|
1039
1039
|
}
|
|
1040
1040
|
get at() {
|
|
1041
1041
|
return t(this, nt);
|
|
@@ -1045,29 +1045,29 @@ const ge = class ge {
|
|
|
1045
1045
|
});
|
|
1046
1046
|
}
|
|
1047
1047
|
};
|
|
1048
|
-
|
|
1049
|
-
let
|
|
1050
|
-
var
|
|
1051
|
-
const
|
|
1048
|
+
vt = new WeakMap(), nt = new WeakMap(), a(be, "ngRow");
|
|
1049
|
+
let ne = be;
|
|
1050
|
+
var L, R, H, ot, Yt, V, Xt, Z, wt, Ut, Ft, rt;
|
|
1051
|
+
const C = class C {
|
|
1052
1052
|
constructor(i, e) {
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1053
|
+
c(this, L);
|
|
1054
|
+
c(this, R);
|
|
1055
|
+
c(this, H, []);
|
|
1056
|
+
c(this, ot, []);
|
|
1057
|
+
c(this, Yt, 0);
|
|
1058
|
+
c(this, V, []);
|
|
1059
|
+
c(this, Xt, /* @__PURE__ */ a(() => {
|
|
1060
1060
|
g(this, V, []);
|
|
1061
|
-
const i = t(this,
|
|
1061
|
+
const i = t(this, L).template || [];
|
|
1062
1062
|
Array.from(i).forEach((e) => {
|
|
1063
1063
|
var s;
|
|
1064
1064
|
t(this, V).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1065
1065
|
}), (t(this, R).rawRecords || []).forEach((e) => {
|
|
1066
|
-
e.__ng || (e.__ng = t(this,
|
|
1066
|
+
e.__ng || (e.__ng = t(this, wt).call(this)), e.__ng.height = t(this, V).slice();
|
|
1067
1067
|
});
|
|
1068
1068
|
}, "#initialize"));
|
|
1069
|
-
|
|
1070
|
-
t(this,
|
|
1069
|
+
c(this, Z, /* @__PURE__ */ a(() => {
|
|
1070
|
+
t(this, L).shadowRoot.querySelectorAll("nine-table-sheet").forEach((i) => {
|
|
1071
1071
|
i.invalidate();
|
|
1072
1072
|
});
|
|
1073
1073
|
}, "#invalidate"));
|
|
@@ -1077,7 +1077,7 @@ const _ = class _ {
|
|
|
1077
1077
|
if (!s || s.length <= 0) return;
|
|
1078
1078
|
if (i == null) return t(this, rt).call(this, s);
|
|
1079
1079
|
if (i < 0 || i >= s.length) return null;
|
|
1080
|
-
const n = typeof ((r = t(this,
|
|
1080
|
+
const n = typeof ((r = t(this, L).fields) == null ? void 0 : r.get) == "function" ? t(this, L).fields.get() : [];
|
|
1081
1081
|
if (e != null) {
|
|
1082
1082
|
const o = n.indexOf(e);
|
|
1083
1083
|
return o >= 0 ? s[i].v[o] : null;
|
|
@@ -1087,26 +1087,26 @@ const _ = class _ {
|
|
|
1087
1087
|
v(this, "set", /* @__PURE__ */ a((i) => {
|
|
1088
1088
|
this.clear(), this.add(i, !1), t(this, Z).call(this);
|
|
1089
1089
|
}, "set"));
|
|
1090
|
-
|
|
1091
|
-
rowState:
|
|
1090
|
+
c(this, wt, /* @__PURE__ */ a(() => ({
|
|
1091
|
+
rowState: C.ROW_STATE.EMPTY,
|
|
1092
1092
|
deleted: !1,
|
|
1093
1093
|
filtered: !1,
|
|
1094
1094
|
height: t(this, V).slice(),
|
|
1095
1095
|
o: {},
|
|
1096
1096
|
c: {},
|
|
1097
|
-
_: [0, 0, 0, 0,
|
|
1097
|
+
_: [0, 0, 0, 0, C.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, V).slice(), -1, {}, {}]
|
|
1098
1098
|
}), "#getDefaultMeta"));
|
|
1099
1099
|
v(this, "reset", /* @__PURE__ */ a(() => {
|
|
1100
|
-
g(this,
|
|
1100
|
+
g(this, H, []), g(this, ot, []), t(this, Z).call(this);
|
|
1101
1101
|
}, "reset"));
|
|
1102
1102
|
v(this, "clear", /* @__PURE__ */ a(() => {
|
|
1103
1103
|
var i;
|
|
1104
|
-
t(this, R).rawRecords = [], g(this,
|
|
1104
|
+
t(this, R).rawRecords = [], g(this, H, []), g(this, ot, []), (i = t(this, R).viewRecords) != null && i.reset && t(this, R).viewRecords.reset();
|
|
1105
1105
|
}, "clear"));
|
|
1106
|
-
|
|
1106
|
+
c(this, Ut, /* @__PURE__ */ a((i) => {
|
|
1107
1107
|
var n;
|
|
1108
1108
|
Array.isArray(i) || (i = [i]);
|
|
1109
|
-
const e = typeof ((n = t(this,
|
|
1109
|
+
const e = typeof ((n = t(this, L).fields) == null ? void 0 : n.get) == "function" ? t(this, L).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
1110
1110
|
return i.forEach((r) => {
|
|
1111
1111
|
const o = { v: [] };
|
|
1112
1112
|
e.forEach((l) => {
|
|
@@ -1114,26 +1114,26 @@ const _ = class _ {
|
|
|
1114
1114
|
}), s.push(o);
|
|
1115
1115
|
}), s;
|
|
1116
1116
|
}, "#json2Array"));
|
|
1117
|
-
|
|
1118
|
-
e.__ng = t(this,
|
|
1117
|
+
c(this, Ft, /* @__PURE__ */ a((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1118
|
+
e.__ng = t(this, wt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = C.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1119
1119
|
}), i), "#defaultInsert"));
|
|
1120
1120
|
v(this, "add", /* @__PURE__ */ a((i, e = !0) => {
|
|
1121
1121
|
i === void 0 && (i = {});
|
|
1122
|
-
const s = t(this,
|
|
1123
|
-
t(this, R).rawRecords = t(this, R).rawRecords.concat(t(this,
|
|
1122
|
+
const s = t(this, Ut).call(this, i);
|
|
1123
|
+
t(this, R).rawRecords = t(this, R).rawRecords.concat(t(this, Ft).call(this, s)), this.resetRecords();
|
|
1124
1124
|
const n = this.count() - 1;
|
|
1125
1125
|
return e || s.forEach((r, o) => {
|
|
1126
1126
|
const l = t(this, R).rawRecords[n - o];
|
|
1127
|
-
l && (l.__ng.rowState =
|
|
1127
|
+
l && (l.__ng.rowState = C.ROW_STATE.EMPTY);
|
|
1128
1128
|
}), t(this, Z).call(this), n;
|
|
1129
1129
|
}, "add"));
|
|
1130
1130
|
v(this, "delete", /* @__PURE__ */ a((i) => {
|
|
1131
1131
|
let e = [];
|
|
1132
1132
|
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this, R).host.row.at] : e = [parseInt(i, 10)], e.sort((s, n) => n - s).forEach((s) => {
|
|
1133
|
-
if (t(this,
|
|
1134
|
-
const n = t(this,
|
|
1135
|
-
t(this,
|
|
1136
|
-
r.__ng.rowid === n && (r.__ng.deleted = !0, r.__ng.rowState =
|
|
1133
|
+
if (t(this, H)[s]) {
|
|
1134
|
+
const n = t(this, H)[s].__ng.rowid;
|
|
1135
|
+
t(this, H)[s].__ng.rowState === C.ROW_STATE.INSERT ? t(this, R).rawRecords = t(this, R).rawRecords.filter((r) => r.__ng.rowid !== n) : t(this, R).rawRecords.forEach((r) => {
|
|
1136
|
+
r.__ng.rowid === n && (r.__ng.deleted = !0, r.__ng.rowState = C.ROW_STATE.DELETE);
|
|
1137
1137
|
});
|
|
1138
1138
|
}
|
|
1139
1139
|
}), this.resetRecords(), t(this, Z).call(this);
|
|
@@ -1141,34 +1141,34 @@ const _ = class _ {
|
|
|
1141
1141
|
v(this, "setValue", /* @__PURE__ */ a((i, e, s) => {
|
|
1142
1142
|
var d;
|
|
1143
1143
|
i = parseInt(i, 10);
|
|
1144
|
-
const r = (typeof ((d = t(this,
|
|
1144
|
+
const r = (typeof ((d = t(this, L).fields) == null ? void 0 : d.get) == "function" ? t(this, L).fields.get() : []).indexOf(e);
|
|
1145
1145
|
if (r < 0) return;
|
|
1146
1146
|
const o = this.getValidData()[i];
|
|
1147
1147
|
if (!o) return;
|
|
1148
1148
|
const l = o.v[r];
|
|
1149
|
-
l !== s && o.__ng.rowState !==
|
|
1149
|
+
l !== s && o.__ng.rowState !== C.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = l), o.__ng.rowState = C.ROW_STATE.UPDATE), o.v[r] = s;
|
|
1150
1150
|
}, "setValue"));
|
|
1151
1151
|
v(this, "resetRecords", /* @__PURE__ */ a(() => {
|
|
1152
|
-
g(this, ot, t(this, R).rawRecords.filter((i) => !i.__ng.deleted)), g(this,
|
|
1152
|
+
g(this, ot, t(this, R).rawRecords.filter((i) => !i.__ng.deleted)), g(this, H, t(this, R).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, R).rawRecords.forEach((i, e) => {
|
|
1153
1153
|
i.__ng.rowidx = e;
|
|
1154
|
-
}), t(this,
|
|
1154
|
+
}), t(this, H).forEach((i, e) => {
|
|
1155
1155
|
i.__ng.i = e;
|
|
1156
1156
|
});
|
|
1157
1157
|
}, "resetRecords"));
|
|
1158
|
-
v(this, "getValidData", /* @__PURE__ */ a(() => (t(this,
|
|
1159
|
-
|
|
1158
|
+
v(this, "getValidData", /* @__PURE__ */ a(() => (t(this, H).length === 0 && t(this, R).rawRecords.length > 0 && this.resetRecords(), t(this, H)), "getValidData"));
|
|
1159
|
+
c(this, rt, /* @__PURE__ */ a((i) => {
|
|
1160
1160
|
var o;
|
|
1161
1161
|
if (!i) return i;
|
|
1162
|
-
const e = !Array.isArray(i), s = e ? [i] : i, n = typeof ((o = t(this,
|
|
1162
|
+
const e = !Array.isArray(i), s = e ? [i] : i, n = typeof ((o = t(this, L).fields) == null ? void 0 : o.get) == "function" ? t(this, L).fields.get() : [], r = s.filter((l) => !l.__ng.deleted).map((l) => {
|
|
1163
1163
|
const d = {};
|
|
1164
|
-
return n.forEach((
|
|
1165
|
-
d[
|
|
1164
|
+
return n.forEach((h, f) => {
|
|
1165
|
+
d[h] = l.v ? l.v[f] : l[h];
|
|
1166
1166
|
}), d.__ng = l.__ng, d;
|
|
1167
1167
|
});
|
|
1168
1168
|
return e ? r[0] : r;
|
|
1169
1169
|
}, "#conv"));
|
|
1170
1170
|
v(this, "count", /* @__PURE__ */ a(() => this.getValidData().length, "count"));
|
|
1171
|
-
g(this,
|
|
1171
|
+
g(this, L, i), g(this, R, e), t(this, Xt).call(this);
|
|
1172
1172
|
}
|
|
1173
1173
|
get source() {
|
|
1174
1174
|
return t(this, rt).call(this, t(this, R).rawRecords);
|
|
@@ -1177,29 +1177,29 @@ const _ = class _ {
|
|
|
1177
1177
|
this.clear(), this.add(i, !1);
|
|
1178
1178
|
}
|
|
1179
1179
|
get nextId() {
|
|
1180
|
-
return ++
|
|
1180
|
+
return ++Ee(this, Yt)._;
|
|
1181
1181
|
}
|
|
1182
1182
|
get length() {
|
|
1183
|
-
return t(this,
|
|
1183
|
+
return t(this, H).length;
|
|
1184
1184
|
}
|
|
1185
1185
|
getRowCount() {
|
|
1186
1186
|
return this.length;
|
|
1187
1187
|
}
|
|
1188
1188
|
};
|
|
1189
|
-
|
|
1190
|
-
v(
|
|
1189
|
+
L = new WeakMap(), R = new WeakMap(), H = new WeakMap(), ot = new WeakMap(), Yt = new WeakMap(), V = new WeakMap(), Xt = new WeakMap(), Z = new WeakMap(), wt = new WeakMap(), Ut = new WeakMap(), Ft = new WeakMap(), rt = new WeakMap(), a(C, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1190
|
+
v(C, "ROW_STATE", {
|
|
1191
1191
|
EMPTY: "EMPTY",
|
|
1192
1192
|
NORMAL: "NORMAL",
|
|
1193
1193
|
INSERT: "INSERT",
|
|
1194
1194
|
UPDATE: "UPDATE",
|
|
1195
1195
|
DELETE: "DELETE"
|
|
1196
1196
|
});
|
|
1197
|
-
let
|
|
1197
|
+
let oe = C;
|
|
1198
1198
|
var G;
|
|
1199
|
-
const
|
|
1199
|
+
const ye = class ye {
|
|
1200
1200
|
constructor(i) {
|
|
1201
|
-
|
|
1202
|
-
g(this, G, i), this.row = new
|
|
1201
|
+
c(this, G);
|
|
1202
|
+
g(this, G, i), this.row = new ne(this), this.data = new oe(t(this, G), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1203
1203
|
var e;
|
|
1204
1204
|
(e = t(this, G).view) != null && e.redraw && t(this, G).view.redraw();
|
|
1205
1205
|
}, this.setDataSource = (e) => {
|
|
@@ -1216,31 +1216,31 @@ const be = class be {
|
|
|
1216
1216
|
}, this.setDataSource([]);
|
|
1217
1217
|
}
|
|
1218
1218
|
};
|
|
1219
|
-
G = new WeakMap(), a(
|
|
1220
|
-
let
|
|
1221
|
-
var lt, A,
|
|
1222
|
-
const
|
|
1219
|
+
G = new WeakMap(), a(ye, "ngDataManager");
|
|
1220
|
+
let re = ye;
|
|
1221
|
+
var lt, A, St, jt;
|
|
1222
|
+
const pe = class pe {
|
|
1223
1223
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1224
1224
|
constructor(i) {
|
|
1225
|
-
|
|
1226
|
-
|
|
1225
|
+
c(this, lt);
|
|
1226
|
+
c(this, A, []);
|
|
1227
1227
|
v(this, "add", /* @__PURE__ */ a((i, e = "string") => {
|
|
1228
1228
|
i.forEach((s) => {
|
|
1229
1229
|
t(this, A).some((n) => n.name === s) || t(this, A).push({ name: s, type: e });
|
|
1230
|
-
}), t(this,
|
|
1230
|
+
}), t(this, St).call(this);
|
|
1231
1231
|
}, "add"));
|
|
1232
|
-
|
|
1232
|
+
c(this, St, /* @__PURE__ */ a(() => {
|
|
1233
1233
|
const i = /* @__PURE__ */ new Map();
|
|
1234
1234
|
t(this, A).forEach((e) => {
|
|
1235
1235
|
i.set(e.name, e.type);
|
|
1236
1236
|
}), g(this, A, Array.from(i, ([e, s]) => ({ name: e, type: s }))), g(this, A, t(this, A).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, A).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
1237
1237
|
}, "#adjust"));
|
|
1238
|
-
|
|
1239
|
-
g(this, A, []),
|
|
1238
|
+
c(this, jt, /* @__PURE__ */ a(() => {
|
|
1239
|
+
g(this, A, []), _.log(t(this, lt).querySelectorAll("table"));
|
|
1240
1240
|
const i = Array.from(t(this, lt).querySelectorAll("table"));
|
|
1241
1241
|
if (!(!i || i.length === 0)) {
|
|
1242
1242
|
for (const e of i)
|
|
1243
|
-
|
|
1243
|
+
_.log(e), $("[data-bind]", e).each((s, n) => {
|
|
1244
1244
|
const r = n.dataset.bind, o = n.getAttribute("data-type") || "string";
|
|
1245
1245
|
r && t(this, A).push({ name: r, type: o });
|
|
1246
1246
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
@@ -1258,16 +1258,16 @@ const ye = class ye {
|
|
|
1258
1258
|
o.split("data.").forEach((l) => {
|
|
1259
1259
|
if (l.trim() != "") {
|
|
1260
1260
|
const d = l.search(/[^_A-Za-z0-9]/g);
|
|
1261
|
-
let
|
|
1262
|
-
d >= 0 ?
|
|
1261
|
+
let h = "";
|
|
1262
|
+
d >= 0 ? h = l.substring(0, d) : o.startsWith("data.") && (h = l.replace("data.", "")), h && t(this, A).push({ name: h, type: "string" });
|
|
1263
1263
|
}
|
|
1264
1264
|
});
|
|
1265
1265
|
});
|
|
1266
1266
|
});
|
|
1267
|
-
t(this,
|
|
1267
|
+
t(this, St).call(this);
|
|
1268
1268
|
}
|
|
1269
1269
|
}, "#init"));
|
|
1270
|
-
g(this, lt, i), t(this,
|
|
1270
|
+
g(this, lt, i), t(this, jt).call(this);
|
|
1271
1271
|
}
|
|
1272
1272
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
1273
1273
|
get() {
|
|
@@ -1289,25 +1289,25 @@ const ye = class ye {
|
|
|
1289
1289
|
return t(this, A).some((e) => e.name === i);
|
|
1290
1290
|
}
|
|
1291
1291
|
};
|
|
1292
|
-
lt = new WeakMap(), A = new WeakMap(),
|
|
1293
|
-
let
|
|
1294
|
-
var J,
|
|
1295
|
-
const
|
|
1292
|
+
lt = new WeakMap(), A = new WeakMap(), St = new WeakMap(), jt = new WeakMap(), a(pe, "ngFields");
|
|
1293
|
+
let le = pe;
|
|
1294
|
+
var J, Kt, Zt;
|
|
1295
|
+
const me = class me extends HTMLElement {
|
|
1296
1296
|
constructor() {
|
|
1297
1297
|
super();
|
|
1298
1298
|
//#created = false;
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
this.fields = new
|
|
1299
|
+
c(this, J);
|
|
1300
|
+
c(this, Kt);
|
|
1301
|
+
c(this, Zt, /* @__PURE__ */ a(() => {
|
|
1302
|
+
this.fields = new le(this), g(this, Kt, new se(this)), _.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1303
1303
|
}, "#init"));
|
|
1304
|
-
this.attachShadow({ mode: "open" }), g(this, J, new
|
|
1304
|
+
this.attachShadow({ mode: "open" }), g(this, J, new re(this));
|
|
1305
1305
|
}
|
|
1306
1306
|
connectedCallback() {
|
|
1307
|
-
t(this,
|
|
1307
|
+
t(this, Zt).call(this);
|
|
1308
1308
|
}
|
|
1309
1309
|
disconnectedCallback() {
|
|
1310
|
-
|
|
1310
|
+
_.log("NineTable disconnected.");
|
|
1311
1311
|
}
|
|
1312
1312
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1313
1313
|
get data() {
|
|
@@ -1322,7 +1322,7 @@ const pe = class pe extends HTMLElement {
|
|
|
1322
1322
|
return t(this, J);
|
|
1323
1323
|
}
|
|
1324
1324
|
};
|
|
1325
|
-
J = new WeakMap(),
|
|
1326
|
-
let
|
|
1327
|
-
customElements.get("nine-table") || customElements.define("nine-table",
|
|
1325
|
+
J = new WeakMap(), Kt = new WeakMap(), Zt = new WeakMap(), a(me, "NineTable");
|
|
1326
|
+
let ae = me;
|
|
1327
|
+
customElements.get("nine-table") || customElements.define("nine-table", ae);
|
|
1328
1328
|
//# sourceMappingURL=nine-table.js.map
|