@ninebone/table 0.0.383 β 0.0.385
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 +59 -59
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +6 -6
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -22,29 +22,29 @@ const ae = class ae extends Te.constructor {
|
|
|
22
22
|
};
|
|
23
23
|
a(ae, "Trace");
|
|
24
24
|
let Zt = ae;
|
|
25
|
-
const
|
|
26
|
-
var
|
|
25
|
+
const M = new Zt();
|
|
26
|
+
var W, D, p, Y, X, U, Rt, F, At;
|
|
27
27
|
const ce = class ce extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
h(this,
|
|
30
|
+
h(this, W);
|
|
31
31
|
h(this, D, !1);
|
|
32
32
|
h(this, p);
|
|
33
33
|
h(this, Y);
|
|
34
34
|
h(this, X);
|
|
35
35
|
h(this, U);
|
|
36
36
|
h(this, Rt, /* @__PURE__ */ a(() => {
|
|
37
|
-
if (!t(this,
|
|
38
|
-
const e = t(this,
|
|
37
|
+
if (!t(this, W)) return;
|
|
38
|
+
const e = t(this, W).querySelector(".ng-container-body");
|
|
39
39
|
e && (g(this, U, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
41
|
})), t(this, U).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
v(this, "refresh", /* @__PURE__ */ a(() => {
|
|
44
|
-
if (!t(this,
|
|
44
|
+
if (!t(this, W) || !t(this, p) || t(this, D)) return;
|
|
45
45
|
const e = t(this, p).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const n = t(this, p).track, r = t(this, p).thumb, o = t(this,
|
|
47
|
+
const n = t(this, p).track, r = t(this, p).thumb, o = t(this, W).querySelector(".ng-container-bottom"), l = e.clientWidth, d = s.scrollWidth;
|
|
48
48
|
if (l !== 0 && d > l)
|
|
49
49
|
o && (o.style.display = "flex");
|
|
50
50
|
else {
|
|
@@ -59,7 +59,7 @@ const ce = class ce extends HTMLElement {
|
|
|
59
59
|
let y = 0;
|
|
60
60
|
b > 0 && (y = parseInt(u / b * (c - f), 10)), y < 0 && (y = 0);
|
|
61
61
|
const m = c - f;
|
|
62
|
-
y > m && (y = m), r.style.left = `${y}px`,
|
|
62
|
+
y > m && (y = m), r.style.left = `${y}px`, M.log(y), t(this, p).left.disabled = y === 0, t(this, p).right.disabled = y >= m - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
64
|
h(this, F, /* @__PURE__ */ a((e) => {
|
|
65
65
|
if (!t(this, p)) return !1;
|
|
@@ -112,7 +112,7 @@ const ce = class ce extends HTMLElement {
|
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
114
114
|
connectedCallback() {
|
|
115
|
-
if (g(this,
|
|
115
|
+
if (g(this, W, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, W)) return;
|
|
116
116
|
this.innerHTML = `
|
|
117
117
|
<style>
|
|
118
118
|
nine-table-hscrollbar {
|
|
@@ -177,7 +177,7 @@ const ce = class ce extends HTMLElement {
|
|
|
177
177
|
<button class='ng-scroll-right' disabled><div class='ng-scroll-icon'></div></button>
|
|
178
178
|
`;
|
|
179
179
|
const e = /* @__PURE__ */ a(() => {
|
|
180
|
-
const s = t(this,
|
|
180
|
+
const s = t(this, W).querySelector(".ng-container-body");
|
|
181
181
|
if (!s) {
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
@@ -198,14 +198,14 @@ const ce = class ce extends HTMLElement {
|
|
|
198
198
|
t(this, U) && t(this, U).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
|
|
201
|
+
W = new WeakMap(), D = new WeakMap(), p = new WeakMap(), Y = new WeakMap(), X = new WeakMap(), U = new WeakMap(), Rt = new WeakMap(), F = new WeakMap(), At = new WeakMap(), a(ce, "NineTableHScrollBar");
|
|
202
202
|
let Gt = ce;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Gt);
|
|
204
|
-
var
|
|
204
|
+
var L, B, S, dt, ft, Tt;
|
|
205
205
|
const he = class he extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
-
h(this,
|
|
208
|
+
h(this, L);
|
|
209
209
|
h(this, B, !1);
|
|
210
210
|
h(this, S);
|
|
211
211
|
h(this, dt, 0);
|
|
@@ -215,8 +215,8 @@ const he = class he extends HTMLElement {
|
|
|
215
215
|
*/
|
|
216
216
|
v(this, "refresh", /* @__PURE__ */ a(() => {
|
|
217
217
|
var St, Q, ct, me, xe, ve;
|
|
218
|
-
if (!t(this,
|
|
219
|
-
const e = t(this, S).container, s = t(this, S).track, n = t(this, S).thumb, r = e.clientHeight,
|
|
218
|
+
if (!t(this, L) || !t(this, S) || t(this, B)) return;
|
|
219
|
+
const e = t(this, S).container, s = t(this, S).track, n = t(this, S).thumb, r = e.clientHeight, l = (((Q = (St = t(this, L).host) == null ? void 0 : St.data) == null ? void 0 : Q.get()) || ((me = (ct = t(this, L)._host) == null ? void 0 : ct.data) == null ? void 0 : me.get()) || []).length, d = ((ve = (xe = t(this, L)).getRowHeight) == null ? void 0 : ve.call(xe)) || 85, c = l * d;
|
|
220
220
|
if (c <= r) {
|
|
221
221
|
n.style.display = "none", t(this, S).top.disabled = !0, t(this, S).bottom.disabled = !0;
|
|
222
222
|
return;
|
|
@@ -235,7 +235,7 @@ const he = class he extends HTMLElement {
|
|
|
235
235
|
h(this, Tt, /* @__PURE__ */ a(() => {
|
|
236
236
|
const e = t(this, S).container, s = /* @__PURE__ */ a(() => {
|
|
237
237
|
var l, d, c, f, u, b;
|
|
238
|
-
const n = ((d = (l = t(this,
|
|
238
|
+
const n = ((d = (l = t(this, L).host) == null ? void 0 : l.data) == null ? void 0 : d.get()) || ((f = (c = t(this, L)._host) == null ? void 0 : c.data) == null ? void 0 : f.get()) || [], r = n.length > 0 ? n.length : 61, o = ((b = (u = t(this, L)).getRowHeight) == null ? void 0 : b.call(u)) || 85;
|
|
239
239
|
return r * o;
|
|
240
240
|
}, "getContentHeight");
|
|
241
241
|
e.addEventListener("scroll", () => {
|
|
@@ -273,7 +273,7 @@ const he = class he extends HTMLElement {
|
|
|
273
273
|
}, "#init"));
|
|
274
274
|
}
|
|
275
275
|
connectedCallback() {
|
|
276
|
-
if (g(this,
|
|
276
|
+
if (g(this, L, this.getRootNode().host), M.log("*********"), M.log(t(this, L)), !t(this, L)) return;
|
|
277
277
|
this.innerHTML = `
|
|
278
278
|
<style>
|
|
279
279
|
nine-table-vscrollbar {
|
|
@@ -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, L).querySelector(".ng-container-body");
|
|
342
342
|
if (!s) {
|
|
343
343
|
setTimeout(e, 10);
|
|
344
344
|
return;
|
|
@@ -354,16 +354,16 @@ const he = class he extends HTMLElement {
|
|
|
354
354
|
e();
|
|
355
355
|
}
|
|
356
356
|
};
|
|
357
|
-
|
|
357
|
+
L = new WeakMap(), B = new WeakMap(), S = new WeakMap(), dt = new WeakMap(), ft = new WeakMap(), Tt = new WeakMap(), a(he, "NineTableVScrollBar");
|
|
358
358
|
let Jt = he;
|
|
359
359
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Jt);
|
|
360
360
|
var qt, tt;
|
|
361
|
-
const
|
|
361
|
+
const I = class I {
|
|
362
362
|
/**
|
|
363
363
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
364
364
|
*/
|
|
365
365
|
static compileAll(i) {
|
|
366
|
-
return Array.isArray(i) ? i.map((e) =>
|
|
366
|
+
return Array.isArray(i) ? i.map((e) => I.compile(e)) : [];
|
|
367
367
|
}
|
|
368
368
|
/**
|
|
369
369
|
* π― λ¨μΌ μλ³Έ ν
μ΄λΈμ λ°μ κΈ°λ³Έ ꡬ쑰 보μ λ° 2μ°¨μ 격μ μΈλ±μ€ μ¬μ λΆμ¬ μλ£λ λ§μ€ν° ν
μ΄λΈ λ°ν
|
|
@@ -372,7 +372,7 @@ const M = class M {
|
|
|
372
372
|
var n, r, o, l;
|
|
373
373
|
if (!i) return null;
|
|
374
374
|
const e = i.cloneNode(!0);
|
|
375
|
-
return t(n =
|
|
375
|
+
return t(n = I, qt).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, c) => {
|
|
376
376
|
const f = d.getAttribute("fixed");
|
|
377
377
|
f && e.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((u) => {
|
|
378
378
|
u.setAttribute("fixed", f);
|
|
@@ -380,7 +380,7 @@ const M = class M {
|
|
|
380
380
|
}), e;
|
|
381
381
|
}
|
|
382
382
|
};
|
|
383
|
-
qt = new WeakMap(), tt = new WeakMap(), a(
|
|
383
|
+
qt = new WeakMap(), tt = new WeakMap(), a(I, "TableCompiler"), h(I, qt, /* @__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(M, "TableCompiler"), h(M, 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")), h(
|
|
397
|
+
}, "#ensureTableStructure")), h(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;
|
|
@@ -427,13 +427,13 @@ qt = new WeakMap(), tt = new WeakMap(), a(M, "TableCompiler"), h(M, qt, /* @__PU
|
|
|
427
427
|
});
|
|
428
428
|
});
|
|
429
429
|
}, "#resetColIndex"));
|
|
430
|
-
let Qt =
|
|
431
|
-
var
|
|
430
|
+
let Qt = I;
|
|
431
|
+
var O, w, z, T, N, j, P, et, kt, Lt, Ht, ut, gt, Ct, _t, bt, Mt, it, yt;
|
|
432
432
|
const de = class de {
|
|
433
433
|
constructor(i) {
|
|
434
|
-
h(this,
|
|
434
|
+
h(this, O);
|
|
435
435
|
h(this, w);
|
|
436
|
-
h(this,
|
|
436
|
+
h(this, z, /* @__PURE__ */ new Map());
|
|
437
437
|
h(this, T, null);
|
|
438
438
|
h(this, N, null);
|
|
439
439
|
h(this, j, 0);
|
|
@@ -446,7 +446,7 @@ const de = class de {
|
|
|
446
446
|
i && (t(this, ut).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
|
-
g(this, T, null), t(this,
|
|
449
|
+
g(this, T, null), t(this, z).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
450
450
|
const r = t(this, w).querySelector(n);
|
|
451
451
|
if (!r) return;
|
|
452
452
|
const o = r.querySelector("table");
|
|
@@ -454,7 +454,7 @@ const de = class de {
|
|
|
454
454
|
const l = o.querySelector("tbody.bindable-tbody");
|
|
455
455
|
if (!l) return;
|
|
456
456
|
const c = Array.from(l.querySelectorAll("tr")).map((f) => f.cloneNode(!0));
|
|
457
|
-
t(this,
|
|
457
|
+
t(this, z).set(n, c);
|
|
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) {
|
|
@@ -471,7 +471,7 @@ const de = class de {
|
|
|
471
471
|
}
|
|
472
472
|
}, "initialize"));
|
|
473
473
|
h(this, Lt, /* @__PURE__ */ a((i, e) => {
|
|
474
|
-
const s = t(this,
|
|
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");
|
|
477
477
|
if (!n) return;
|
|
@@ -486,7 +486,7 @@ const de = class de {
|
|
|
486
486
|
h(this, Ht, /* @__PURE__ */ a((i) => {
|
|
487
487
|
if (t(this, T) !== null && t(this, T) > 0)
|
|
488
488
|
return t(this, T);
|
|
489
|
-
const e = t(this,
|
|
489
|
+
const e = t(this, z).get(".ng-container-body");
|
|
490
490
|
if (!e || e.length === 0) return 24;
|
|
491
491
|
const s = i.querySelector("tbody.bindable-tbody") || i.querySelector("tbody.bindable-tbody:last-of-type");
|
|
492
492
|
if (!s) return 24;
|
|
@@ -505,16 +505,16 @@ const de = class de {
|
|
|
505
505
|
}, "#measureAndCacheHeight"));
|
|
506
506
|
h(this, ut, /* @__PURE__ */ a(() => {
|
|
507
507
|
if (!t(this, w).querySelector(".ng-container-body")) return;
|
|
508
|
-
const s = (t(this,
|
|
509
|
-
|
|
508
|
+
const s = (t(this, O).data.get() || []).length, n = t(this, T) || 24, r = s * n;
|
|
509
|
+
M.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
|
h(this, gt, /* @__PURE__ */ a(() => {
|
|
515
|
-
if ((t(this,
|
|
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, kt)),
|
|
517
|
+
g(this, P, e + t(this, kt)), M.log("visibleRows:", e, "cachedRowCount:", t(this, P));
|
|
518
518
|
}
|
|
519
519
|
}, "#updateRowCount"));
|
|
520
520
|
h(this, Ct, /* @__PURE__ */ a(() => {
|
|
@@ -560,14 +560,14 @@ const de = class de {
|
|
|
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 = ((c = t(this,
|
|
563
|
+
const r = Array.from(n.querySelectorAll("tr:not(.nodata)")), o = ((c = t(this, z).get(e)) == null ? void 0 : c.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) {
|
|
567
567
|
f.style.display = "none";
|
|
568
568
|
return;
|
|
569
569
|
}
|
|
570
|
-
const y = t(this,
|
|
570
|
+
const y = t(this, O).data.get(b);
|
|
571
571
|
f.style.display = "", t(this, yt).call(this, f, y, b);
|
|
572
572
|
});
|
|
573
573
|
});
|
|
@@ -576,8 +576,8 @@ const de = class de {
|
|
|
576
576
|
var d;
|
|
577
577
|
const e = t(this, T);
|
|
578
578
|
if (!e || e <= 0) return;
|
|
579
|
-
const n = (t(this,
|
|
580
|
-
|
|
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
|
+
M.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((c) => {
|
|
581
581
|
const f = t(this, w).querySelector(c);
|
|
582
582
|
if (!f) return;
|
|
583
583
|
const u = f.querySelector("tbody.bindable-tbody");
|
|
@@ -588,7 +588,7 @@ const de = class de {
|
|
|
588
588
|
y.style.display = "none";
|
|
589
589
|
return;
|
|
590
590
|
}
|
|
591
|
-
const k = t(this,
|
|
591
|
+
const k = t(this, O).data.get(E);
|
|
592
592
|
y.style.display = "", t(this, yt).call(this, y, k, E);
|
|
593
593
|
});
|
|
594
594
|
}), t(this, et) || (g(this, et, !0), setTimeout(() => {
|
|
@@ -604,17 +604,17 @@ const de = class de {
|
|
|
604
604
|
v(this, "destroy", /* @__PURE__ */ a(() => {
|
|
605
605
|
t(this, N) && (t(this, N).disconnect(), g(this, N, null));
|
|
606
606
|
}, "destroy"));
|
|
607
|
-
g(this,
|
|
607
|
+
g(this, O, i.getRootNode().host), g(this, w, i), t(this, _t).call(this);
|
|
608
608
|
}
|
|
609
609
|
getRowHeight() {
|
|
610
610
|
return t(this, T);
|
|
611
611
|
}
|
|
612
612
|
templateLength(i = ".ng-container-body") {
|
|
613
613
|
var e;
|
|
614
|
-
return ((e = t(this,
|
|
614
|
+
return ((e = t(this, z).get(i)) == null ? void 0 : e.length) || 1;
|
|
615
615
|
}
|
|
616
616
|
};
|
|
617
|
-
|
|
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(), kt = new WeakMap(), Lt = new WeakMap(), Ht = new WeakMap(), ut = new WeakMap(), gt = new WeakMap(), Ct = new WeakMap(), _t = new WeakMap(), bt = new WeakMap(), Mt = new WeakMap(), it = new WeakMap(), yt = new WeakMap(), a(de, "RowManager");
|
|
618
618
|
let te = de;
|
|
619
619
|
var $t, st, K, It, Wt, Ot, zt, Dt;
|
|
620
620
|
const ht = class ht extends HTMLElement {
|
|
@@ -847,7 +847,7 @@ const ht = class ht extends HTMLElement {
|
|
|
847
847
|
t(this, zt).call(this);
|
|
848
848
|
}
|
|
849
849
|
disconnectedCallback() {
|
|
850
|
-
this.innerHTML = "",
|
|
850
|
+
this.innerHTML = "", M.log("NineTableSheet destroyed.");
|
|
851
851
|
}
|
|
852
852
|
};
|
|
853
853
|
$t = new WeakMap(), st = new WeakMap(), K = new WeakMap(), It = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), zt = new WeakMap(), Dt = new WeakMap(), a(ht, "NineTableSheet"), v(ht, "SCROLLBAR_SIZE", 16);
|
|
@@ -1047,10 +1047,10 @@ const ge = class ge {
|
|
|
1047
1047
|
};
|
|
1048
1048
|
xt = new WeakMap(), nt = new WeakMap(), a(ge, "ngRow");
|
|
1049
1049
|
let se = ge;
|
|
1050
|
-
var
|
|
1050
|
+
var H, R, C, ot, Vt, V, Yt, Z, vt, Xt, Ut, rt;
|
|
1051
1051
|
const _ = class _ {
|
|
1052
1052
|
constructor(i, e) {
|
|
1053
|
-
h(this,
|
|
1053
|
+
h(this, H);
|
|
1054
1054
|
h(this, R);
|
|
1055
1055
|
h(this, C, []);
|
|
1056
1056
|
h(this, ot, []);
|
|
@@ -1058,7 +1058,7 @@ const _ = class _ {
|
|
|
1058
1058
|
h(this, V, []);
|
|
1059
1059
|
h(this, Yt, /* @__PURE__ */ a(() => {
|
|
1060
1060
|
g(this, V, []);
|
|
1061
|
-
const i = t(this,
|
|
1061
|
+
const i = t(this, H).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);
|
|
@@ -1067,7 +1067,7 @@ const _ = class _ {
|
|
|
1067
1067
|
});
|
|
1068
1068
|
}, "#initialize"));
|
|
1069
1069
|
h(this, Z, /* @__PURE__ */ a(() => {
|
|
1070
|
-
t(this,
|
|
1070
|
+
t(this, H).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, H).fields) == null ? void 0 : r.get) == "function" ? t(this, H).fields.get() : [];
|
|
1081
1081
|
if (e != null) {
|
|
1082
1082
|
const o = n.indexOf(e);
|
|
1083
1083
|
return o >= 0 ? s[i].v[o] : null;
|
|
@@ -1106,7 +1106,7 @@ const _ = class _ {
|
|
|
1106
1106
|
h(this, Xt, /* @__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, H).fields) == null ? void 0 : n.get) == "function" ? t(this, H).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
1110
1110
|
return i.forEach((r) => {
|
|
1111
1111
|
const o = { v: [] };
|
|
1112
1112
|
e.forEach((l) => {
|
|
@@ -1141,7 +1141,7 @@ 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, H).fields) == null ? void 0 : d.get) == "function" ? t(this, H).fields.get() : []).indexOf(e);
|
|
1145
1145
|
if (r < 0) return;
|
|
1146
1146
|
const o = this.getValidData()[i];
|
|
1147
1147
|
if (!o) return;
|
|
@@ -1159,7 +1159,7 @@ const _ = class _ {
|
|
|
1159
1159
|
h(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, H).fields) == null ? void 0 : o.get) == "function" ? t(this, H).fields.get() : [], r = s.filter((l) => !l.__ng.deleted).map((l) => {
|
|
1163
1163
|
const d = {};
|
|
1164
1164
|
return n.forEach((c, f) => {
|
|
1165
1165
|
d[c] = l.v ? l.v[f] : l[c];
|
|
@@ -1168,7 +1168,7 @@ const _ = class _ {
|
|
|
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, H, i), g(this, R, e), t(this, Yt).call(this);
|
|
1172
1172
|
}
|
|
1173
1173
|
get source() {
|
|
1174
1174
|
return t(this, rt).call(this, t(this, R).rawRecords);
|
|
@@ -1186,7 +1186,7 @@ const _ = class _ {
|
|
|
1186
1186
|
return this.length;
|
|
1187
1187
|
}
|
|
1188
1188
|
};
|
|
1189
|
-
|
|
1189
|
+
H = new WeakMap(), R = new WeakMap(), C = new WeakMap(), ot = new WeakMap(), Vt = new WeakMap(), V = new WeakMap(), Yt = new WeakMap(), Z = new WeakMap(), vt = new WeakMap(), Xt = new WeakMap(), Ut = new WeakMap(), rt = new WeakMap(), a(_, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1190
1190
|
v(_, "ROW_STATE", {
|
|
1191
1191
|
EMPTY: "EMPTY",
|
|
1192
1192
|
NORMAL: "NORMAL",
|
|
@@ -1236,11 +1236,11 @@ const ye = class ye {
|
|
|
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
1238
|
h(this, Ft, /* @__PURE__ */ a(() => {
|
|
1239
|
-
g(this, A, []),
|
|
1239
|
+
g(this, A, []), M.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
|
+
M.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) => {
|
|
@@ -1299,7 +1299,7 @@ const pe = class pe extends HTMLElement {
|
|
|
1299
1299
|
h(this, J);
|
|
1300
1300
|
h(this, jt);
|
|
1301
1301
|
h(this, Kt, /* @__PURE__ */ a(() => {
|
|
1302
|
-
this.fields = new re(this), g(this, jt, new ie(this)),
|
|
1302
|
+
this.fields = new re(this), g(this, jt, new ie(this)), M.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1303
1303
|
}, "#init"));
|
|
1304
1304
|
this.attachShadow({ mode: "open" }), g(this, J, new oe(this));
|
|
1305
1305
|
}
|
|
@@ -1307,7 +1307,7 @@ const pe = class pe extends HTMLElement {
|
|
|
1307
1307
|
t(this, Kt).call(this);
|
|
1308
1308
|
}
|
|
1309
1309
|
disconnectedCallback() {
|
|
1310
|
-
|
|
1310
|
+
M.log("NineTable disconnected.");
|
|
1311
1311
|
}
|
|
1312
1312
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1313
1313
|
get data() {
|