@ninebone/table 0.0.212 β 0.0.214
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 +80 -79
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +4 -3
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -22,13 +22,13 @@ const Te = class Te extends ze.constructor {
|
|
|
22
22
|
};
|
|
23
23
|
a(Te, "Trace");
|
|
24
24
|
let pe = Te;
|
|
25
|
-
const
|
|
26
|
-
var L,
|
|
25
|
+
const Z = new pe();
|
|
26
|
+
var L, $, y, B, D, N, te, P, ie;
|
|
27
27
|
const Ae = class Ae extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
u(this, L);
|
|
31
|
-
u(this,
|
|
31
|
+
u(this, $, !1);
|
|
32
32
|
u(this, y);
|
|
33
33
|
u(this, B);
|
|
34
34
|
u(this, D);
|
|
@@ -41,7 +41,7 @@ const Ae = class Ae extends HTMLElement {
|
|
|
41
41
|
})), e(this, N).observe(t));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
x(this, "refresh", /* @__PURE__ */ a(() => {
|
|
44
|
-
if (!e(this, L) || !e(this, y) || e(this,
|
|
44
|
+
if (Z.log("nine-table-hscrollbar: refresh()"), Z.log(e(this, L), e(this, y), e(this, $)), !e(this, L) || !e(this, y) || e(this, $)) return;
|
|
45
45
|
const t = e(this, y).container, s = t.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
47
|
const n = e(this, y).track, r = e(this, y).thumb, o = e(this, L).querySelector(".ng-container-bottom"), c = t.clientWidth, h = s.scrollWidth;
|
|
@@ -58,8 +58,8 @@ const Ae = class Ae extends HTMLElement {
|
|
|
58
58
|
let f = 0;
|
|
59
59
|
const g = s.style.transform;
|
|
60
60
|
if (g && g.includes("translateX")) {
|
|
61
|
-
const
|
|
62
|
-
|
|
61
|
+
const R = g.match(/translateX\(([-\d.]+)px\)/);
|
|
62
|
+
R && R[1] && (f = parseFloat(R[1]));
|
|
63
63
|
} else
|
|
64
64
|
f = parseInt(s.style.left || 0, 10);
|
|
65
65
|
let b = parseInt(Math.abs(f) * l / h, 10);
|
|
@@ -106,13 +106,13 @@ const Ae = class Ae extends HTMLElement {
|
|
|
106
106
|
e(this, P).call(this, n.clientX - r.left - o / 2);
|
|
107
107
|
}), e(this, y).thumb.addEventListener("mousedown", (n) => {
|
|
108
108
|
if (n.button !== 0) return;
|
|
109
|
-
n.stopPropagation(), n.preventDefault(), p(this,
|
|
109
|
+
n.stopPropagation(), n.preventDefault(), p(this, $, !0), this.shiftX = n.clientX - e(this, y).thumb.getBoundingClientRect().left;
|
|
110
110
|
const r = /* @__PURE__ */ a((c) => {
|
|
111
|
-
if (!e(this,
|
|
111
|
+
if (!e(this, $)) return;
|
|
112
112
|
const h = e(this, y).track.getBoundingClientRect();
|
|
113
113
|
e(this, P).call(this, c.clientX - h.left - this.shiftX);
|
|
114
114
|
}, "onMouseMove"), o = /* @__PURE__ */ a(() => {
|
|
115
|
-
p(this,
|
|
115
|
+
p(this, $, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
|
|
116
116
|
}, "onMouseUp");
|
|
117
117
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", o);
|
|
118
118
|
});
|
|
@@ -203,16 +203,16 @@ const Ae = class Ae extends HTMLElement {
|
|
|
203
203
|
e(this, N) && e(this, N).disconnect();
|
|
204
204
|
}
|
|
205
205
|
};
|
|
206
|
-
L = new WeakMap(),
|
|
206
|
+
L = new WeakMap(), $ = new WeakMap(), y = new WeakMap(), B = new WeakMap(), D = new WeakMap(), N = new WeakMap(), te = new WeakMap(), P = new WeakMap(), ie = new WeakMap(), a(Ae, "NineTableHScrollBar");
|
|
207
207
|
let ye = Ae;
|
|
208
208
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ye);
|
|
209
|
-
var V, C, E,
|
|
209
|
+
var V, C, E, W, M, H, se, ne;
|
|
210
210
|
const qe = class qe {
|
|
211
211
|
constructor(i) {
|
|
212
212
|
u(this, V);
|
|
213
213
|
u(this, C, []);
|
|
214
214
|
u(this, E, null);
|
|
215
|
-
u(this,
|
|
215
|
+
u(this, W, null);
|
|
216
216
|
u(this, M, 0);
|
|
217
217
|
u(this, H, 0);
|
|
218
218
|
x(this, "getRowHeight", /* @__PURE__ */ a(() => e(this, E), "getRowHeight"));
|
|
@@ -223,7 +223,7 @@ const qe = class qe {
|
|
|
223
223
|
* π― λ·°ν¬νΈ ν¬κΈ° λ³ν μμ μ λμ΄ κ³μ° λ° νμν ν κ°μ μ°μ Β·μΊμ±μ μκ²°
|
|
224
224
|
*/
|
|
225
225
|
u(this, ne, /* @__PURE__ */ a(() => {
|
|
226
|
-
!e(this, V) || !(e(this, V) instanceof HTMLElement) || (p(this,
|
|
226
|
+
!e(this, V) || !(e(this, V) instanceof HTMLElement) || (p(this, W, new ResizeObserver((i) => {
|
|
227
227
|
for (const t of i) {
|
|
228
228
|
const s = t.target;
|
|
229
229
|
if (!s.classList.contains("active"))
|
|
@@ -237,14 +237,14 @@ const qe = class qe {
|
|
|
237
237
|
const d = Math.max(r - o, 100);
|
|
238
238
|
if (e(this, M) !== d && (p(this, M, d), e(this, E) !== null)) {
|
|
239
239
|
const f = Math.ceil(e(this, M) / e(this, E));
|
|
240
|
-
p(this, H, f + 20),
|
|
240
|
+
p(this, H, f + 20), Z.log(`[RowManager] Resized. Height: ${e(this, M)}px | Target Rows: ${e(this, H)}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
|
|
241
241
|
const b = s.querySelector(g);
|
|
242
242
|
b && b.querySelector("tbody") && this.renderRows(b);
|
|
243
243
|
});
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
|
-
})), e(this,
|
|
247
|
+
})), e(this, W).observe(e(this, V)));
|
|
248
248
|
}, "#initResizeObserver"));
|
|
249
249
|
x(this, "initTemplate", /* @__PURE__ */ a((i) => {
|
|
250
250
|
const t = i.querySelector("tbody.bindable") || i.querySelector("tbody");
|
|
@@ -306,7 +306,7 @@ const qe = class qe {
|
|
|
306
306
|
s ? s.before(n) : t.appendChild(n), console.log(`[RowManager] Rendered ${r} sets into DOM.`);
|
|
307
307
|
}, "renderRows"));
|
|
308
308
|
x(this, "destroy", /* @__PURE__ */ a(() => {
|
|
309
|
-
e(this,
|
|
309
|
+
e(this, W) && (e(this, W).disconnect(), p(this, W, null));
|
|
310
310
|
}, "destroy"));
|
|
311
311
|
p(this, V, i), e(this, se).call(this);
|
|
312
312
|
}
|
|
@@ -314,10 +314,10 @@ const qe = class qe {
|
|
|
314
314
|
return e(this, C).length || 1;
|
|
315
315
|
}
|
|
316
316
|
};
|
|
317
|
-
V = new WeakMap(), C = new WeakMap(), E = new WeakMap(),
|
|
317
|
+
V = new WeakMap(), C = new WeakMap(), E = new WeakMap(), W = new WeakMap(), M = new WeakMap(), H = new WeakMap(), se = new WeakMap(), ne = new WeakMap(), a(qe, "RowManager");
|
|
318
318
|
let me = qe;
|
|
319
319
|
var I, X, re, oe;
|
|
320
|
-
const
|
|
320
|
+
const j = class j extends HTMLElement {
|
|
321
321
|
constructor() {
|
|
322
322
|
super();
|
|
323
323
|
u(this, I, null);
|
|
@@ -327,12 +327,12 @@ const Z = class Z extends HTMLElement {
|
|
|
327
327
|
const s = /* @__PURE__ */ a((l) => {
|
|
328
328
|
const d = /* @__PURE__ */ a((g) => {
|
|
329
329
|
if (g.querySelector("colgroup")) return;
|
|
330
|
-
const b = g.querySelector("tbody tr") || g.querySelector("tr"), m = b ? b.querySelectorAll("th, td").length : 1,
|
|
330
|
+
const b = g.querySelector("tbody tr") || g.querySelector("tr"), m = b ? b.querySelectorAll("th, td").length : 1, R = document.createElement("colgroup"), T = Math.max(Math.floor((g.clientWidth || 600) / m), 100);
|
|
331
331
|
for (let _ = 0; _ < m; _++) {
|
|
332
332
|
const be = document.createElement("col");
|
|
333
|
-
be.setAttribute("width", T),
|
|
333
|
+
be.setAttribute("width", T), R.appendChild(be);
|
|
334
334
|
}
|
|
335
|
-
g.prepend(
|
|
335
|
+
g.prepend(R);
|
|
336
336
|
}, "ensureColgroup"), f = /* @__PURE__ */ a((g) => {
|
|
337
337
|
if (g.querySelector("thead")) return;
|
|
338
338
|
const b = document.createElement("thead"), m = g.querySelector("colgroup");
|
|
@@ -343,13 +343,13 @@ const Z = class Z extends HTMLElement {
|
|
|
343
343
|
p(this, I, s(n)), e(this, I).style.display = "table", e(this, X).initTemplate(e(this, I));
|
|
344
344
|
const r = this.querySelector(".ng-container-left"), o = this.querySelector(".ng-container-body"), c = this.querySelector(".ng-container-right"), h = /* @__PURE__ */ a((l, d, f = !1) => {
|
|
345
345
|
const g = l.cloneNode(!0), b = Array.from(g.querySelectorAll("colgroup col")), m = [];
|
|
346
|
-
return b.forEach((
|
|
347
|
-
const _ =
|
|
346
|
+
return b.forEach((R, T) => {
|
|
347
|
+
const _ = R.getAttribute("fixed");
|
|
348
348
|
(f ? _ !== "left" && _ !== "right" : _ === d) || m.push(T);
|
|
349
|
-
}), m.reverse().forEach((
|
|
350
|
-
b[
|
|
349
|
+
}), m.reverse().forEach((R) => {
|
|
350
|
+
b[R] && b[R].remove(), g.querySelectorAll("tr").forEach((T) => {
|
|
351
351
|
const _ = T.querySelectorAll("th, td");
|
|
352
|
-
_[
|
|
352
|
+
_[R] && _[R].remove();
|
|
353
353
|
});
|
|
354
354
|
}), g;
|
|
355
355
|
}, "filterTableByFixed");
|
|
@@ -379,10 +379,10 @@ const Z = class Z extends HTMLElement {
|
|
|
379
379
|
}
|
|
380
380
|
o && o.addEventListener("scroll", () => {
|
|
381
381
|
var l;
|
|
382
|
-
|
|
382
|
+
(l = this.querySelector("nine-table-hscrollbar")) == null || l.refresh();
|
|
383
383
|
}), setTimeout(() => {
|
|
384
|
-
|
|
385
|
-
l
|
|
384
|
+
var l;
|
|
385
|
+
(l = this.querySelector("nine-table-hscrollbar")) == null || l.refresh();
|
|
386
386
|
}, 0);
|
|
387
387
|
}, "generate"));
|
|
388
388
|
x(this, "getRowHeight", /* @__PURE__ */ a(() => e(this, X).getRowHeight(), "getRowHeight"));
|
|
@@ -408,11 +408,11 @@ const Z = class Z extends HTMLElement {
|
|
|
408
408
|
if (!r) return;
|
|
409
409
|
const c = n ? Array.from(n.querySelectorAll("tr")) : [], h = Array.from(r.querySelectorAll("tr")), l = o ? Array.from(o.querySelectorAll("tr")) : [], d = Math.max(c.length, h.length, l.length);
|
|
410
410
|
for (let m = 0; m < d; m++) {
|
|
411
|
-
const
|
|
411
|
+
const R = [
|
|
412
412
|
((f = c[m]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
413
413
|
((g = h[m]) == null ? void 0 : g.getBoundingClientRect().height) || 0,
|
|
414
414
|
((b = l[m]) == null ? void 0 : b.getBoundingClientRect().height) || 0
|
|
415
|
-
], T = Math.max(...
|
|
415
|
+
], T = Math.max(...R);
|
|
416
416
|
T > 0 && (c[m] && (c[m].style.height = `${T}px`), h[m] && (h[m].style.height = `${T}px`), l[m] && (l[m].style.height = `${T}px`));
|
|
417
417
|
}
|
|
418
418
|
});
|
|
@@ -422,7 +422,7 @@ const Z = class Z extends HTMLElement {
|
|
|
422
422
|
}).observe(this, { attributes: !0 });
|
|
423
423
|
}, "#init"));
|
|
424
424
|
u(this, oe, /* @__PURE__ */ a(() => {
|
|
425
|
-
const t =
|
|
425
|
+
const t = j.SCROLLBAR_SIZE;
|
|
426
426
|
this.innerHTML = `
|
|
427
427
|
<style>
|
|
428
428
|
nine-table-sheet {
|
|
@@ -465,6 +465,7 @@ const Z = class Z extends HTMLElement {
|
|
|
465
465
|
flex-direction: column;
|
|
466
466
|
flex: 1;
|
|
467
467
|
overflow: hidden;
|
|
468
|
+
overflow-x: auto;
|
|
468
469
|
background: #ffffff;
|
|
469
470
|
position: relative;
|
|
470
471
|
}
|
|
@@ -543,13 +544,13 @@ const Z = class Z extends HTMLElement {
|
|
|
543
544
|
e(this, re).call(this);
|
|
544
545
|
}
|
|
545
546
|
disconnectedCallback() {
|
|
546
|
-
this.innerHTML = "",
|
|
547
|
+
this.innerHTML = "", Z.log("NineTableSheet destroyed.");
|
|
547
548
|
}
|
|
548
549
|
};
|
|
549
|
-
I = new WeakMap(), X = new WeakMap(), re = new WeakMap(), oe = new WeakMap(), a(
|
|
550
|
-
let ee =
|
|
550
|
+
I = new WeakMap(), X = new WeakMap(), re = new WeakMap(), oe = new WeakMap(), a(j, "NineTableSheet"), x(j, "SCROLLBAR_SIZE", 16);
|
|
551
|
+
let ee = j;
|
|
551
552
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", ee);
|
|
552
|
-
var le,
|
|
553
|
+
var le, G;
|
|
553
554
|
const ke = class ke extends HTMLElement {
|
|
554
555
|
constructor() {
|
|
555
556
|
super();
|
|
@@ -558,17 +559,17 @@ const ke = class ke extends HTMLElement {
|
|
|
558
559
|
(t = this.querySelector(".nine-tab-bar")) == null || t.addEventListener("click", (s) => {
|
|
559
560
|
var o;
|
|
560
561
|
const n = s.ctrlKey || s.metaKey || s.shiftKey, r = parseInt((o = s.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
|
|
561
|
-
e(this,
|
|
562
|
-
}), e(this,
|
|
562
|
+
e(this, G).call(this, r, n);
|
|
563
|
+
}), e(this, G).call(this, 0, !1);
|
|
563
564
|
}, "#init"));
|
|
564
|
-
u(this,
|
|
565
|
+
u(this, G, /* @__PURE__ */ a((t, s = !1) => {
|
|
565
566
|
const n = /* @__PURE__ */ a(() => {
|
|
566
567
|
const d = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
567
568
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((b) => b.style.setProperty("display", "none"));
|
|
568
569
|
const g = d.filter((b) => b.classList.contains("active"));
|
|
569
570
|
g.length < 2 || g.forEach((b) => {
|
|
570
|
-
const m = parseInt(b.getAttribute("data-index"), 10),
|
|
571
|
-
|
|
571
|
+
const m = parseInt(b.getAttribute("data-index"), 10), R = this.querySelector(`nine-splitter[data-split-index="${m}"]`), T = d[m + 1];
|
|
572
|
+
R && T && T.classList.contains("active") && R.style.setProperty("display", "flex");
|
|
572
573
|
});
|
|
573
574
|
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), c = r.querySelectorAll(".nine-tab-item"), h = o.querySelectorAll("nine-table-sheet");
|
|
574
575
|
if (!c[t]) return;
|
|
@@ -597,32 +598,32 @@ const ke = class ke extends HTMLElement {
|
|
|
597
598
|
e(this, le).call(this);
|
|
598
599
|
}
|
|
599
600
|
};
|
|
600
|
-
le = new WeakMap(),
|
|
601
|
+
le = new WeakMap(), G = new WeakMap(), a(ke, "NineTableSheets");
|
|
601
602
|
let we = ke;
|
|
602
603
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", we);
|
|
603
|
-
var
|
|
604
|
+
var S, ae, J, ce;
|
|
604
605
|
const Le = class Le {
|
|
605
606
|
constructor(i) {
|
|
606
|
-
u(this,
|
|
607
|
+
u(this, S);
|
|
607
608
|
u(this, ae, /* @__PURE__ */ a(() => {
|
|
608
609
|
e(this, ce).call(this), new ResizeObserver((i) => {
|
|
609
610
|
for (let t of i)
|
|
610
|
-
e(this,
|
|
611
|
-
}).observe(e(this,
|
|
611
|
+
e(this, S).getAttribute("auto-height") === "true" && e(this, J).call(this);
|
|
612
|
+
}).observe(e(this, S));
|
|
612
613
|
}, "#init"));
|
|
613
|
-
u(this,
|
|
614
|
+
u(this, J, /* @__PURE__ */ a(() => {
|
|
614
615
|
var h, l;
|
|
615
|
-
const i = Array.from(e(this,
|
|
616
|
+
const i = Array.from(e(this, S).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
616
617
|
if (i.length === 0) return;
|
|
617
|
-
const t = parseInt(e(this,
|
|
618
|
-
e(this,
|
|
618
|
+
const t = parseInt(e(this, S).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((d) => d.getRowHeight())), n = (h = e(this, S).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : h.getBoundingClientRect().height, r = (l = e(this, S).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = ee.SCROLLBAR_SIZE, c = t * s + n + r + o;
|
|
619
|
+
e(this, S).style.height = `${c}px`;
|
|
619
620
|
}, "#applyAutoHeight"));
|
|
620
621
|
u(this, ce, /* @__PURE__ */ a(() => {
|
|
621
|
-
const t = Array.from(e(this,
|
|
622
|
+
const t = Array.from(e(this, S).children).filter((h) => h.tagName === "TABLE"), s = e(this, S).getAttribute("auto-height") === "true", n = t.length, r = t.map((h, l) => {
|
|
622
623
|
const f = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, g = l < n - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
623
624
|
return f + g;
|
|
624
625
|
}).join(""), o = t.map((h, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
625
|
-
e(this,
|
|
626
|
+
e(this, S).shadowRoot.innerHTML = `
|
|
626
627
|
<style>
|
|
627
628
|
:host {
|
|
628
629
|
display: flex;
|
|
@@ -721,25 +722,25 @@ const Le = class Le {
|
|
|
721
722
|
</nine-table-body>
|
|
722
723
|
<nine-table-footer></nine-table-footer>
|
|
723
724
|
`;
|
|
724
|
-
const c = e(this,
|
|
725
|
+
const c = e(this, S).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
725
726
|
c == null || c.forEach((h, l) => {
|
|
726
727
|
t[l] && setTimeout(() => {
|
|
727
|
-
h.generate(t[l]), s && e(this,
|
|
728
|
+
h.generate(t[l]), s && e(this, J).call(this);
|
|
728
729
|
});
|
|
729
730
|
});
|
|
730
731
|
}, "#render"));
|
|
731
|
-
p(this,
|
|
732
|
+
p(this, S, i), e(this, ae).call(this);
|
|
732
733
|
}
|
|
733
734
|
};
|
|
734
|
-
|
|
735
|
+
S = new WeakMap(), ae = new WeakMap(), J = new WeakMap(), ce = new WeakMap(), a(Le, "LayoutManager");
|
|
735
736
|
let ve = Le;
|
|
736
|
-
var
|
|
737
|
+
var O, F;
|
|
737
738
|
const Ce = class Ce {
|
|
738
739
|
constructor(i) {
|
|
739
|
-
u(this,
|
|
740
|
+
u(this, O);
|
|
740
741
|
u(this, F, -1);
|
|
741
|
-
x(this, "count", /* @__PURE__ */ a(() => e(this,
|
|
742
|
-
p(this,
|
|
742
|
+
x(this, "count", /* @__PURE__ */ a(() => e(this, O).rawRecords.length, "count"));
|
|
743
|
+
p(this, O, i);
|
|
743
744
|
}
|
|
744
745
|
get at() {
|
|
745
746
|
return e(this, F);
|
|
@@ -747,16 +748,16 @@ const Ce = class Ce {
|
|
|
747
748
|
set at(i) {
|
|
748
749
|
var s, n;
|
|
749
750
|
p(this, F, parseInt(i, 10));
|
|
750
|
-
const t = ((n = (s = e(this,
|
|
751
|
+
const t = ((n = (s = e(this, O).owner).querySelector) == null ? void 0 : n.call(s, ".ng-container-body")) || e(this, O).owner.body;
|
|
751
752
|
t && !t.querySelector(`tbody.bindable tr[data-row="${e(this, F)}"]`) && setTimeout(() => {
|
|
752
753
|
var r, o;
|
|
753
|
-
(o = (r = e(this,
|
|
754
|
+
(o = (r = e(this, O).owner).scrollTo_V1) == null || o.call(r, e(this, F));
|
|
754
755
|
});
|
|
755
756
|
}
|
|
756
757
|
};
|
|
757
|
-
|
|
758
|
+
O = new WeakMap(), F = new WeakMap(), a(Ce, "ngRow");
|
|
758
759
|
let xe = Ce;
|
|
759
|
-
var A, v, q, U, he,
|
|
760
|
+
var A, v, q, U, he, z, de, Q, fe, ue, K;
|
|
760
761
|
const k = class k {
|
|
761
762
|
constructor(i, t) {
|
|
762
763
|
u(this, A);
|
|
@@ -764,28 +765,28 @@ const k = class k {
|
|
|
764
765
|
u(this, q, []);
|
|
765
766
|
u(this, U, []);
|
|
766
767
|
u(this, he, 0);
|
|
767
|
-
u(this,
|
|
768
|
+
u(this, z, []);
|
|
768
769
|
u(this, de, /* @__PURE__ */ a(() => {
|
|
769
|
-
p(this,
|
|
770
|
+
p(this, z, []);
|
|
770
771
|
const i = e(this, A).template || [];
|
|
771
772
|
Array.from(i).forEach((t) => {
|
|
772
773
|
var s;
|
|
773
|
-
e(this,
|
|
774
|
+
e(this, z).push(((s = t.getBoundingClientRect) == null ? void 0 : s.call(t).height) || 24);
|
|
774
775
|
}), (e(this, v).rawRecords || []).forEach((t) => {
|
|
775
|
-
t.__ng || (t.__ng = e(this,
|
|
776
|
+
t.__ng || (t.__ng = e(this, Q).call(this)), t.__ng.height = e(this, z).slice();
|
|
776
777
|
});
|
|
777
778
|
}, "#initialize"));
|
|
778
779
|
x(this, "set", /* @__PURE__ */ a((i) => {
|
|
779
780
|
this.clear(), this.add(i, !1);
|
|
780
781
|
}, "set"));
|
|
781
|
-
u(this,
|
|
782
|
+
u(this, Q, /* @__PURE__ */ a(() => ({
|
|
782
783
|
rowState: k.ROW_STATE.EMPTY,
|
|
783
784
|
deleted: !1,
|
|
784
785
|
filtered: !1,
|
|
785
|
-
height: e(this,
|
|
786
|
+
height: e(this, z).slice(),
|
|
786
787
|
o: {},
|
|
787
788
|
c: {},
|
|
788
|
-
_: [0, 0, 0, 0, k.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this,
|
|
789
|
+
_: [0, 0, 0, 0, k.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, z).slice(), -1, {}, {}]
|
|
789
790
|
}), "#getDefaultMeta"));
|
|
790
791
|
x(this, "reset", /* @__PURE__ */ a(() => {
|
|
791
792
|
p(this, q, []), p(this, U, []);
|
|
@@ -806,7 +807,7 @@ const k = class k {
|
|
|
806
807
|
}), s;
|
|
807
808
|
}, "#json2Array"));
|
|
808
809
|
u(this, ue, /* @__PURE__ */ a((i) => (Array.isArray(i) || (i = [i]), i.forEach((t) => {
|
|
809
|
-
t.__ng = e(this,
|
|
810
|
+
t.__ng = e(this, Q).call(this), t.__ng.rowid = this.nextId, t.__ng.rowState = k.ROW_STATE.INSERT, t.__ng._[0] = t.__ng.rowid;
|
|
810
811
|
}), i), "#defaultInsert"));
|
|
811
812
|
x(this, "add", /* @__PURE__ */ a((i, t = !0) => {
|
|
812
813
|
var r;
|
|
@@ -892,7 +893,7 @@ const k = class k {
|
|
|
892
893
|
return this.length;
|
|
893
894
|
}
|
|
894
895
|
};
|
|
895
|
-
A = new WeakMap(), v = new WeakMap(), q = new WeakMap(), U = new WeakMap(), he = new WeakMap(),
|
|
896
|
+
A = new WeakMap(), v = new WeakMap(), q = new WeakMap(), U = new WeakMap(), he = new WeakMap(), z = new WeakMap(), de = new WeakMap(), Q = new WeakMap(), fe = new WeakMap(), ue = new WeakMap(), K = new WeakMap(), a(k, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
896
897
|
x(k, "ROW_STATE", {
|
|
897
898
|
EMPTY: "EMPTY",
|
|
898
899
|
NORMAL: "NORMAL",
|
|
@@ -900,10 +901,10 @@ x(k, "ROW_STATE", {
|
|
|
900
901
|
UPDATE: "UPDATE",
|
|
901
902
|
DELETE: "DELETE"
|
|
902
903
|
});
|
|
903
|
-
let
|
|
904
|
+
let Re = k;
|
|
904
905
|
const _e = class _e {
|
|
905
906
|
constructor(i) {
|
|
906
|
-
this.owner = i, this.row = new xe(this), this.data = new
|
|
907
|
+
this.owner = i, this.row = new xe(this), this.data = new Re(i, this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
907
908
|
var t;
|
|
908
909
|
(t = this.owner.view) != null && t.redraw && this.owner.view.redraw();
|
|
909
910
|
}, this.setDataSource = (t) => {
|
|
@@ -921,7 +922,7 @@ const _e = class _e {
|
|
|
921
922
|
}
|
|
922
923
|
};
|
|
923
924
|
a(_e, "ngDataManager");
|
|
924
|
-
let
|
|
925
|
+
let Se = _e;
|
|
925
926
|
var Y, ge;
|
|
926
927
|
const Me = class Me extends HTMLElement {
|
|
927
928
|
constructor() {
|
|
@@ -929,13 +930,13 @@ const Me = class Me extends HTMLElement {
|
|
|
929
930
|
//#created = false;
|
|
930
931
|
u(this, Y);
|
|
931
932
|
u(this, ge);
|
|
932
|
-
this.attachShadow({ mode: "open" }), p(this, Y, new
|
|
933
|
+
this.attachShadow({ mode: "open" }), p(this, Y, new Se(this));
|
|
933
934
|
}
|
|
934
935
|
connectedCallback() {
|
|
935
|
-
p(this, ge, new ve(this)),
|
|
936
|
+
p(this, ge, new ve(this)), Z.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
936
937
|
}
|
|
937
938
|
disconnectedCallback() {
|
|
938
|
-
|
|
939
|
+
Z.log("NineTable disconnected.");
|
|
939
940
|
}
|
|
940
941
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
941
942
|
get data() {
|