@ninebone/table 0.0.141 β 0.0.143
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 +61 -52
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +25 -16
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var Me = Object.defineProperty;
|
|
2
|
+
var $e = (w) => {
|
|
3
3
|
throw TypeError(w);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var a = (w, i) =>
|
|
7
|
-
var v = (w, i, t) =>
|
|
8
|
-
var e = (w, i, t) => (Ie(w, i, "read from private field"), t ? t.call(w) : i.get(w)), u = (w, i, t) => i.has(w) ?
|
|
5
|
+
var ze = (w, i, t) => i in w ? Me(w, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : w[i] = t;
|
|
6
|
+
var a = (w, i) => Me(w, "name", { value: i, configurable: !0 });
|
|
7
|
+
var v = (w, i, t) => ze(w, typeof i != "symbol" ? i + "" : i, t), Ie = (w, i, t) => i.has(w) || $e("Cannot " + t);
|
|
8
|
+
var e = (w, i, t) => (Ie(w, i, "read from private field"), t ? t.call(w) : i.get(w)), u = (w, i, t) => i.has(w) ? $e("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(w) : i.set(w, t), p = (w, i, t, s) => (Ie(w, i, "write to private field"), s ? s.call(w, t) : i.set(w, t), t);
|
|
9
9
|
var He = (w, i, t, s) => ({
|
|
10
10
|
set _(n) {
|
|
11
11
|
p(w, i, n, t);
|
|
@@ -14,8 +14,8 @@ var He = (w, i, t, s) => ({
|
|
|
14
14
|
return e(w, i, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
import { trace as
|
|
18
|
-
const Re = class Re extends
|
|
17
|
+
import { trace as We } from "@ninebone/util";
|
|
18
|
+
const Re = class Re extends We.constructor {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
@@ -206,14 +206,14 @@ const Te = class Te extends HTMLElement {
|
|
|
206
206
|
_ = new WeakMap(), O = new WeakMap(), y = new WeakMap(), B = new WeakMap(), D = new WeakMap(), N = new WeakMap(), ee = new WeakMap(), P = new WeakMap(), te = new WeakMap(), a(Te, "NineTableHScrollBar");
|
|
207
207
|
let ge = Te;
|
|
208
208
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ge);
|
|
209
|
-
var X,
|
|
209
|
+
var X, M, q, I, $, H, ie, se;
|
|
210
210
|
const qe = class qe {
|
|
211
211
|
constructor(i) {
|
|
212
212
|
u(this, X);
|
|
213
|
-
u(this,
|
|
213
|
+
u(this, M, []);
|
|
214
214
|
u(this, q, null);
|
|
215
215
|
u(this, I, null);
|
|
216
|
-
u(this,
|
|
216
|
+
u(this, $, 0);
|
|
217
217
|
u(this, H, 0);
|
|
218
218
|
u(this, ie, /* @__PURE__ */ a(() => {
|
|
219
219
|
e(this, se).call(this);
|
|
@@ -234,9 +234,9 @@ const qe = class qe {
|
|
|
234
234
|
const l = s.querySelector(".ng-container-body") || s, g = l.querySelector("thead"), c = l.querySelector("tfoot");
|
|
235
235
|
g && (r += g.offsetHeight || g.getBoundingClientRect().height), c && (r += c.offsetHeight || c.getBoundingClientRect().height);
|
|
236
236
|
const h = Math.max(o - r, 100);
|
|
237
|
-
if (e(this,
|
|
238
|
-
const d = Math.ceil(e(this,
|
|
239
|
-
p(this, H, d + 20), j.log(`[RowManager] Resized. Height: ${e(this,
|
|
237
|
+
if (e(this, $) !== h && (p(this, $, h), e(this, q) !== null)) {
|
|
238
|
+
const d = Math.ceil(e(this, $) / e(this, q));
|
|
239
|
+
p(this, H, d + 20), j.log(`[RowManager] Resized. Height: ${e(this, $)}px | Target Rows: ${e(this, H)}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((b) => {
|
|
240
240
|
const f = s.querySelector(b);
|
|
241
241
|
f && f.querySelector("tbody") && this.renderRows(f);
|
|
242
242
|
});
|
|
@@ -249,18 +249,18 @@ const qe = class qe {
|
|
|
249
249
|
const t = i.querySelector("tbody.bindable") || i.querySelector("tbody");
|
|
250
250
|
if (!t) return;
|
|
251
251
|
const s = Array.from(t.querySelectorAll("tr")).filter((n) => !n.classList.contains("nodata"));
|
|
252
|
-
p(this,
|
|
252
|
+
p(this, M, s.map((n) => n.cloneNode(!0))), p(this, q, null), console.log(`[RowManager] Template initialized with ${e(this, M).length} row(s).`);
|
|
253
253
|
}, "initTemplate"));
|
|
254
254
|
v(this, "measureAndCacheHeight", /* @__PURE__ */ a((i) => {
|
|
255
255
|
if (e(this, q) !== null)
|
|
256
256
|
return e(this, q);
|
|
257
|
-
if (e(this,
|
|
257
|
+
if (e(this, M).length === 0)
|
|
258
258
|
throw new Error("[RowManager] Template TRs are empty.");
|
|
259
259
|
const t = i.querySelector("tbody.bindable") || i.querySelector("tbody");
|
|
260
260
|
if (!t) return 24;
|
|
261
261
|
t.querySelectorAll("tr:not(.nodata)").forEach((l) => l.remove());
|
|
262
262
|
const s = t.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
263
|
-
e(this,
|
|
263
|
+
e(this, M).forEach((l) => {
|
|
264
264
|
n.appendChild(l.cloneNode(!0));
|
|
265
265
|
}), s ? s.before(n) : t.appendChild(n);
|
|
266
266
|
let o = 0;
|
|
@@ -269,8 +269,8 @@ const qe = class qe {
|
|
|
269
269
|
if (c === 0)
|
|
270
270
|
throw new Error(`[RowManager] Rendered TR[${g}] height is 0. Check CSS styles.`);
|
|
271
271
|
o += c;
|
|
272
|
-
}), p(this, q, o), e(this,
|
|
273
|
-
const l = Math.ceil(e(this,
|
|
272
|
+
}), p(this, q, o), e(this, $) > 0) {
|
|
273
|
+
const l = Math.ceil(e(this, $) / e(this, q));
|
|
274
274
|
p(this, H, l + 20);
|
|
275
275
|
}
|
|
276
276
|
return console.log(`[RowManager] Template Height Cached: ${e(this, q)}px | RowCount: ${e(this, H)}`), e(this, q);
|
|
@@ -292,13 +292,13 @@ const qe = class qe {
|
|
|
292
292
|
* π― μΊμλ ν κ°μλ₯Ό κ³§λ°λ‘ κ°μ Έμμ TR λΌλ μ£Όμ
(μ€λ³΅ κ³μ° μ κ±°)
|
|
293
293
|
*/
|
|
294
294
|
v(this, "renderRows", /* @__PURE__ */ a((i) => {
|
|
295
|
-
if (e(this,
|
|
295
|
+
if (e(this, M).length === 0) return;
|
|
296
296
|
const t = i.querySelector("tbody.bindable") || i.querySelector("tbody");
|
|
297
297
|
if (!t) return;
|
|
298
298
|
t.querySelectorAll("tr:not(.nodata)").forEach((r) => r.remove());
|
|
299
299
|
const s = t.querySelector("tr.nodata"), n = document.createDocumentFragment(), o = e(this, H);
|
|
300
300
|
for (let r = 0; r < o; r++)
|
|
301
|
-
e(this,
|
|
301
|
+
e(this, M).forEach((l) => {
|
|
302
302
|
n.appendChild(l.cloneNode(!0));
|
|
303
303
|
});
|
|
304
304
|
s ? s.before(n) : t.appendChild(n), console.log(`[RowManager] Rendered ${o} sets into DOM.`);
|
|
@@ -309,10 +309,10 @@ const qe = class qe {
|
|
|
309
309
|
p(this, X, i), e(this, ie).call(this);
|
|
310
310
|
}
|
|
311
311
|
get templateLength() {
|
|
312
|
-
return e(this,
|
|
312
|
+
return e(this, M).length || 1;
|
|
313
313
|
}
|
|
314
314
|
};
|
|
315
|
-
X = new WeakMap(),
|
|
315
|
+
X = new WeakMap(), M = new WeakMap(), q = new WeakMap(), I = new WeakMap(), $ = new WeakMap(), H = new WeakMap(), ie = new WeakMap(), se = new WeakMap(), a(qe, "RowManager");
|
|
316
316
|
let pe = qe;
|
|
317
317
|
var A, F, ne;
|
|
318
318
|
const Z = class Z extends HTMLElement {
|
|
@@ -656,14 +656,6 @@ const Ce = class Ce {
|
|
|
656
656
|
nine-table-sheet.active {
|
|
657
657
|
display: block !important;
|
|
658
658
|
}
|
|
659
|
-
/* π― μμ±λ .h μ€ν리ν°λ 볡μ μνΈμΌ λ κΈ°λ³Έμ μΌλ‘ κ°μν */
|
|
660
|
-
nine-table-sheets-body nine-splitter.h {
|
|
661
|
-
width: 4px;
|
|
662
|
-
background: #e5e7eb;
|
|
663
|
-
cursor: col-resize;
|
|
664
|
-
flex-shrink: 0;
|
|
665
|
-
display: ${o > 1 ? "block" : "none"};
|
|
666
|
-
}
|
|
667
659
|
nine-table-sheets-footer {
|
|
668
660
|
display: flex;
|
|
669
661
|
height: 32px;
|
|
@@ -693,17 +685,34 @@ const Ce = class Ce {
|
|
|
693
685
|
border-radius: 0 0 3px 3px;
|
|
694
686
|
user-select: none;
|
|
695
687
|
}
|
|
696
|
-
|
|
688
|
+
nine-table-sheets .nine-tab-item.active {
|
|
689
|
+
background: #ffffff;
|
|
690
|
+
color: #111827;
|
|
691
|
+
font-weight: 600;
|
|
692
|
+
border-bottom: 2px solid #2563eb;
|
|
693
|
+
}
|
|
694
|
+
nine-table-sheets .sheets-counter {
|
|
695
|
+
font-size: 12px;
|
|
696
|
+
color: #6b7280;
|
|
697
|
+
padding-left: 12px;
|
|
698
|
+
flex-shrink: 0;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
/* π― κΈ°λ³Έμ μΌλ‘ λͺ¨λ μ€ν리ν°λ μ¨κΉ μ²λ¦¬ */
|
|
697
702
|
nine-table-sheets-body nine-splitter.h {
|
|
703
|
+
width: 4px;
|
|
704
|
+
background: #e5e7eb;
|
|
705
|
+
cursor: col-resize;
|
|
706
|
+
flex-shrink: 0;
|
|
698
707
|
display: none;
|
|
699
708
|
}
|
|
700
709
|
|
|
701
|
-
/* π― μμͺ½ μνΈκ°
|
|
702
|
-
nine-table-sheet.active
|
|
703
|
-
|
|
710
|
+
/* π― μμͺ½ μνΈκ° λ λ€ active μνμΌ λλ§ κ·Έ μ¬μ΄μ μ€ν리ν°(.h) λ
ΈμΆ */
|
|
711
|
+
nine-table-sheet.active ~ nine-table-sheet.active {
|
|
712
|
+
/* λ€μ€ νμ± μμ νμ */
|
|
704
713
|
}
|
|
705
|
-
nine-splitter.h + nine-table-sheet.active {
|
|
706
|
-
|
|
714
|
+
nine-table-sheet.active + nine-splitter.h + nine-table-sheet.active {
|
|
715
|
+
display: block;
|
|
707
716
|
}
|
|
708
717
|
</style>
|
|
709
718
|
|
|
@@ -733,13 +742,13 @@ const Ce = class Ce {
|
|
|
733
742
|
};
|
|
734
743
|
L = new WeakMap(), G = new WeakMap(), oe = new WeakMap(), J = new WeakMap(), le = new WeakMap(), a(Ce, "LayoutManager");
|
|
735
744
|
let me = Ce;
|
|
736
|
-
var
|
|
745
|
+
var z, V;
|
|
737
746
|
const Ae = class Ae {
|
|
738
747
|
constructor(i) {
|
|
739
|
-
u(this,
|
|
748
|
+
u(this, z);
|
|
740
749
|
u(this, V, -1);
|
|
741
|
-
v(this, "count", /* @__PURE__ */ a(() => e(this,
|
|
742
|
-
p(this,
|
|
750
|
+
v(this, "count", /* @__PURE__ */ a(() => e(this, z).rawRecords.length, "count"));
|
|
751
|
+
p(this, z, i);
|
|
743
752
|
}
|
|
744
753
|
get at() {
|
|
745
754
|
return e(this, V);
|
|
@@ -747,16 +756,16 @@ const Ae = class Ae {
|
|
|
747
756
|
set at(i) {
|
|
748
757
|
var s, n;
|
|
749
758
|
p(this, V, parseInt(i, 10));
|
|
750
|
-
const t = ((n = (s = e(this,
|
|
759
|
+
const t = ((n = (s = e(this, z).owner).querySelector) == null ? void 0 : n.call(s, ".ng-container-body")) || e(this, z).owner.body;
|
|
751
760
|
t && !t.querySelector(`tbody.bindable tr[data-row="${e(this, V)}"]`) && setTimeout(() => {
|
|
752
761
|
var o, r;
|
|
753
|
-
(r = (o = e(this,
|
|
762
|
+
(r = (o = e(this, z).owner).scrollTo_V1) == null || r.call(o, e(this, V));
|
|
754
763
|
});
|
|
755
764
|
}
|
|
756
765
|
};
|
|
757
|
-
|
|
766
|
+
z = new WeakMap(), V = new WeakMap(), a(Ae, "ngRow");
|
|
758
767
|
let ve = Ae;
|
|
759
|
-
var E, m, k, U, ae,
|
|
768
|
+
var E, m, k, U, ae, W, ce, Q, he, de, K;
|
|
760
769
|
const T = class T {
|
|
761
770
|
constructor(i, t) {
|
|
762
771
|
u(this, E);
|
|
@@ -764,15 +773,15 @@ const T = class T {
|
|
|
764
773
|
u(this, k, []);
|
|
765
774
|
u(this, U, []);
|
|
766
775
|
u(this, ae, 0);
|
|
767
|
-
u(this,
|
|
776
|
+
u(this, W, []);
|
|
768
777
|
u(this, ce, /* @__PURE__ */ a(() => {
|
|
769
|
-
p(this,
|
|
778
|
+
p(this, W, []);
|
|
770
779
|
const i = e(this, E).template || [];
|
|
771
780
|
Array.from(i).forEach((t) => {
|
|
772
781
|
var s;
|
|
773
|
-
e(this,
|
|
782
|
+
e(this, W).push(((s = t.getBoundingClientRect) == null ? void 0 : s.call(t).height) || 24);
|
|
774
783
|
}), (e(this, m).rawRecords || []).forEach((t) => {
|
|
775
|
-
t.__ng || (t.__ng = e(this, Q).call(this)), t.__ng.height = e(this,
|
|
784
|
+
t.__ng || (t.__ng = e(this, Q).call(this)), t.__ng.height = e(this, W).slice();
|
|
776
785
|
});
|
|
777
786
|
}, "#initialize"));
|
|
778
787
|
v(this, "set", /* @__PURE__ */ a((i) => {
|
|
@@ -782,10 +791,10 @@ const T = class T {
|
|
|
782
791
|
rowState: T.ROW_STATE.EMPTY,
|
|
783
792
|
deleted: !1,
|
|
784
793
|
filtered: !1,
|
|
785
|
-
height: e(this,
|
|
794
|
+
height: e(this, W).slice(),
|
|
786
795
|
o: {},
|
|
787
796
|
c: {},
|
|
788
|
-
_: [0, 0, 0, 0, T.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this,
|
|
797
|
+
_: [0, 0, 0, 0, T.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, W).slice(), -1, {}, {}]
|
|
789
798
|
}), "#getDefaultMeta"));
|
|
790
799
|
v(this, "reset", /* @__PURE__ */ a(() => {
|
|
791
800
|
p(this, k, []), p(this, U, []);
|
|
@@ -886,7 +895,7 @@ const T = class T {
|
|
|
886
895
|
return ++He(this, ae)._;
|
|
887
896
|
}
|
|
888
897
|
};
|
|
889
|
-
E = new WeakMap(), m = new WeakMap(), k = new WeakMap(), U = new WeakMap(), ae = new WeakMap(),
|
|
898
|
+
E = new WeakMap(), m = new WeakMap(), k = new WeakMap(), U = new WeakMap(), ae = new WeakMap(), W = new WeakMap(), ce = new WeakMap(), Q = new WeakMap(), he = new WeakMap(), de = new WeakMap(), K = new WeakMap(), a(T, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
890
899
|
v(T, "ROW_STATE", {
|
|
891
900
|
EMPTY: "EMPTY",
|
|
892
901
|
NORMAL: "NORMAL",
|