@ninebone/table 0.0.285 → 0.0.286
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 +40 -44
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +4 -4
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -23,12 +23,12 @@ const He = class He extends Fe.constructor {
|
|
|
23
23
|
a(He, "Trace");
|
|
24
24
|
let Ee = He;
|
|
25
25
|
const Z = new Ee();
|
|
26
|
-
var k,
|
|
26
|
+
var k, _, b, W, O, z, se, D, ne;
|
|
27
27
|
const Me = class Me extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
c(this, k);
|
|
31
|
-
c(this,
|
|
31
|
+
c(this, _, !1);
|
|
32
32
|
c(this, b);
|
|
33
33
|
c(this, W);
|
|
34
34
|
c(this, O);
|
|
@@ -41,7 +41,7 @@ const Me = class Me extends HTMLElement {
|
|
|
41
41
|
})), e(this, z).observe(t));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
x(this, "refresh", /* @__PURE__ */ a(() => {
|
|
44
|
-
if (!e(this, k) || !e(this, b) || e(this,
|
|
44
|
+
if (!e(this, k) || !e(this, b) || e(this, _)) return;
|
|
45
45
|
const t = e(this, b).container, s = t.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
47
|
const n = e(this, b).track, r = e(this, b).thumb, o = e(this, k).querySelector(".ng-container-bottom"), l = t.clientWidth, h = s.scrollWidth;
|
|
@@ -99,13 +99,13 @@ const Me = class Me extends HTMLElement {
|
|
|
99
99
|
e(this, D).call(this, n.clientX - r.left - o / 2);
|
|
100
100
|
}), e(this, b).thumb.addEventListener("mousedown", (n) => {
|
|
101
101
|
if (n.button !== 0) return;
|
|
102
|
-
n.stopPropagation(), n.preventDefault(), g(this,
|
|
102
|
+
n.stopPropagation(), n.preventDefault(), g(this, _, !0), this.shiftX = n.clientX - e(this, b).thumb.getBoundingClientRect().left;
|
|
103
103
|
const r = /* @__PURE__ */ a((l) => {
|
|
104
|
-
if (!e(this,
|
|
104
|
+
if (!e(this, _)) return;
|
|
105
105
|
const h = e(this, b).track.getBoundingClientRect();
|
|
106
106
|
e(this, D).call(this, l.clientX - h.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), o = /* @__PURE__ */ a(() => {
|
|
108
|
-
g(this,
|
|
108
|
+
g(this, _, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
110
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", o);
|
|
111
111
|
});
|
|
@@ -188,6 +188,8 @@ const Me = class Me extends HTMLElement {
|
|
|
188
188
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
189
189
|
left: this.querySelector(".ng-scroll-left"),
|
|
190
190
|
right: this.querySelector(".ng-scroll-right")
|
|
191
|
+
}), s.addEventListener("scroll", () => {
|
|
192
|
+
e(this, _) || this.refresh();
|
|
191
193
|
}), e(this, ne).call(this), e(this, se).call(this), this.refresh();
|
|
192
194
|
}, "initWhenReady");
|
|
193
195
|
t();
|
|
@@ -196,7 +198,7 @@ const Me = class Me extends HTMLElement {
|
|
|
196
198
|
e(this, z) && e(this, z).disconnect();
|
|
197
199
|
}
|
|
198
200
|
};
|
|
199
|
-
k = new WeakMap(),
|
|
201
|
+
k = new WeakMap(), _ = new WeakMap(), b = new WeakMap(), W = new WeakMap(), O = new WeakMap(), z = new WeakMap(), se = new WeakMap(), D = new WeakMap(), ne = new WeakMap(), a(Me, "NineTableHScrollBar");
|
|
200
202
|
let Re = Me;
|
|
201
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Re);
|
|
202
204
|
var re, j;
|
|
@@ -270,14 +272,14 @@ re = new WeakMap(), j = new WeakMap(), a(L, "TableCompiler"), c(L, re, /* @__PUR
|
|
|
270
272
|
});
|
|
271
273
|
}, "#resetColIndex"));
|
|
272
274
|
let Ae = L;
|
|
273
|
-
var E,
|
|
275
|
+
var E, I, R, H, B, N, oe, le, G, ae, ce, J;
|
|
274
276
|
const $e = class $e {
|
|
275
277
|
constructor(i) {
|
|
276
278
|
c(this, E);
|
|
277
|
-
c(this,
|
|
279
|
+
c(this, I, /* @__PURE__ */ new Map());
|
|
278
280
|
// 각 컨테이너별 독립된 템플릿 TR 관리
|
|
279
281
|
c(this, R, null);
|
|
280
|
-
c(this,
|
|
282
|
+
c(this, H, null);
|
|
281
283
|
c(this, B, 0);
|
|
282
284
|
c(this, N, 40);
|
|
283
285
|
/**
|
|
@@ -285,7 +287,7 @@ const $e = class $e {
|
|
|
285
287
|
*/
|
|
286
288
|
// [RowManager.js 수정 내용 발췌]
|
|
287
289
|
x(this, "initialize", /* @__PURE__ */ a(() => {
|
|
288
|
-
g(this, R, null), e(this,
|
|
290
|
+
g(this, R, null), e(this, I).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((t) => {
|
|
289
291
|
const s = e(this, E).querySelector(t);
|
|
290
292
|
if (!s) return;
|
|
291
293
|
const n = s.querySelector("table");
|
|
@@ -293,13 +295,13 @@ const $e = class $e {
|
|
|
293
295
|
const r = n.querySelector("tbody");
|
|
294
296
|
if (!r) return;
|
|
295
297
|
const l = Array.from(r.querySelectorAll("tr")).map((h) => h.cloneNode(!0));
|
|
296
|
-
e(this,
|
|
298
|
+
e(this, I).set(t, l);
|
|
297
299
|
});
|
|
298
300
|
const i = e(this, E).querySelector(".ng-container-body");
|
|
299
301
|
i && (e(this, le).call(this, i), e(this, J).call(this));
|
|
300
302
|
}, "initialize"));
|
|
301
303
|
c(this, oe, /* @__PURE__ */ a((i, t) => {
|
|
302
|
-
const s = e(this,
|
|
304
|
+
const s = e(this, I).get(t);
|
|
303
305
|
if (!s || s.length === 0) return;
|
|
304
306
|
const n = i.querySelector("tbody");
|
|
305
307
|
if (!n) return;
|
|
@@ -317,7 +319,7 @@ const $e = class $e {
|
|
|
317
319
|
c(this, le, /* @__PURE__ */ a((i) => {
|
|
318
320
|
if (e(this, R) !== null && e(this, R) > 0)
|
|
319
321
|
return e(this, R);
|
|
320
|
-
const t = e(this,
|
|
322
|
+
const t = e(this, I).get(".ng-container-body");
|
|
321
323
|
if (!t || t.length === 0) return 24;
|
|
322
324
|
const s = i.querySelector("tbody");
|
|
323
325
|
if (!s) return 24;
|
|
@@ -359,7 +361,7 @@ const $e = class $e {
|
|
|
359
361
|
* 🎯 ResizeObserver 설정: 시트 크기 변경 시 행 개수 재산정 및 재렌더링
|
|
360
362
|
*/
|
|
361
363
|
c(this, ce, /* @__PURE__ */ a(() => {
|
|
362
|
-
!e(this, E) || !(e(this, E) instanceof HTMLElement) || (g(this,
|
|
364
|
+
!e(this, E) || !(e(this, E) instanceof HTMLElement) || (g(this, H, new ResizeObserver((i) => {
|
|
363
365
|
for (const t of i) {
|
|
364
366
|
const s = t.target;
|
|
365
367
|
if (!s.classList.contains("active")) continue;
|
|
@@ -372,7 +374,7 @@ const $e = class $e {
|
|
|
372
374
|
e(this, B) !== l && (g(this, B, l), e(this, G).call(this), e(this, R) !== null && e(this, J).call(this));
|
|
373
375
|
}
|
|
374
376
|
}
|
|
375
|
-
})), e(this,
|
|
377
|
+
})), e(this, H).observe(e(this, E)));
|
|
376
378
|
}, "#initResizeObserver"));
|
|
377
379
|
/**
|
|
378
380
|
* 🎯 바디 및 좌우 고정 컨테이너 전체에 각각에 맞는 템플릿 행 뼈대 주입
|
|
@@ -384,7 +386,7 @@ const $e = class $e {
|
|
|
384
386
|
}), e(this, ae).call(this);
|
|
385
387
|
}, "#renderAllContainers"));
|
|
386
388
|
x(this, "destroy", /* @__PURE__ */ a(() => {
|
|
387
|
-
e(this,
|
|
389
|
+
e(this, H) && (e(this, H).disconnect(), g(this, H, null));
|
|
388
390
|
}, "destroy"));
|
|
389
391
|
g(this, E, i), e(this, ce).call(this);
|
|
390
392
|
}
|
|
@@ -393,10 +395,10 @@ const $e = class $e {
|
|
|
393
395
|
}
|
|
394
396
|
templateLength(i = ".ng-container-body") {
|
|
395
397
|
var t;
|
|
396
|
-
return ((t = e(this,
|
|
398
|
+
return ((t = e(this, I).get(i)) == null ? void 0 : t.length) || 1;
|
|
397
399
|
}
|
|
398
400
|
};
|
|
399
|
-
E = new WeakMap(),
|
|
401
|
+
E = new WeakMap(), I = new WeakMap(), R = new WeakMap(), H = new WeakMap(), B = new WeakMap(), N = new WeakMap(), oe = new WeakMap(), le = new WeakMap(), G = new WeakMap(), ae = new WeakMap(), ce = new WeakMap(), J = new WeakMap(), a($e, "RowManager");
|
|
400
402
|
let qe = $e;
|
|
401
403
|
var X, Y, he, de, fe, ue, ge;
|
|
402
404
|
const K = class K extends HTMLElement {
|
|
@@ -428,16 +430,10 @@ const K = class K extends HTMLElement {
|
|
|
428
430
|
});
|
|
429
431
|
}, "#updateContainerWidths"));
|
|
430
432
|
x(this, "generate", /* @__PURE__ */ a((t) => {
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
var n;
|
|
436
|
-
(n = this.querySelector("nine-table-hscrollbar")) == null || n.refresh();
|
|
437
|
-
}), setTimeout(() => {
|
|
438
|
-
var n;
|
|
439
|
-
(n = this.querySelector("nine-table-hscrollbar")) == null || n.refresh();
|
|
440
|
-
}, 0);
|
|
433
|
+
t && (g(this, X, Ae.compile(t)), e(this, X).style.display = "table", e(this, he).call(this), e(this, Y).initialize(), e(this, de).call(this), this.querySelector(".ng-container-body"), setTimeout(() => {
|
|
434
|
+
var s;
|
|
435
|
+
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
436
|
+
}, 0));
|
|
441
437
|
}, "generate"));
|
|
442
438
|
/**
|
|
443
439
|
* 🎯 마스터 테이블을 기반으로 특정 fixed 타입 영역만 남기는 분할 헬퍼
|
|
@@ -784,13 +780,13 @@ const Oe = class Oe {
|
|
|
784
780
|
};
|
|
785
781
|
S = new WeakMap(), ye = new WeakMap(), ee = new WeakMap(), pe = new WeakMap(), a(Oe, "LayoutManager");
|
|
786
782
|
let ke = Oe;
|
|
787
|
-
var
|
|
783
|
+
var M, P;
|
|
788
784
|
const ze = class ze {
|
|
789
785
|
constructor(i) {
|
|
790
|
-
c(this,
|
|
786
|
+
c(this, M);
|
|
791
787
|
c(this, P, -1);
|
|
792
|
-
x(this, "count", /* @__PURE__ */ a(() => e(this,
|
|
793
|
-
g(this,
|
|
788
|
+
x(this, "count", /* @__PURE__ */ a(() => e(this, M).rawRecords.length, "count"));
|
|
789
|
+
g(this, M, i);
|
|
794
790
|
}
|
|
795
791
|
get at() {
|
|
796
792
|
return e(this, P);
|
|
@@ -798,16 +794,16 @@ const ze = class ze {
|
|
|
798
794
|
set at(i) {
|
|
799
795
|
var s, n;
|
|
800
796
|
g(this, P, parseInt(i, 10));
|
|
801
|
-
const t = ((n = (s = e(this,
|
|
797
|
+
const t = ((n = (s = e(this, M).owner).querySelector) == null ? void 0 : n.call(s, ".ng-container-body")) || e(this, M).owner.body;
|
|
802
798
|
t && !t.querySelector(`tbody.bindable tr[data-row="${e(this, P)}"]`) && setTimeout(() => {
|
|
803
799
|
var r, o;
|
|
804
|
-
(o = (r = e(this,
|
|
800
|
+
(o = (r = e(this, M).owner).scrollTo_V1) == null || o.call(r, e(this, P));
|
|
805
801
|
});
|
|
806
802
|
}
|
|
807
803
|
};
|
|
808
|
-
|
|
804
|
+
M = new WeakMap(), P = new WeakMap(), a(ze, "ngRow");
|
|
809
805
|
let Le = ze;
|
|
810
|
-
var A, m, q, U, me,
|
|
806
|
+
var A, m, q, U, me, $, we, te, xe, ve, F;
|
|
811
807
|
const T = class T {
|
|
812
808
|
constructor(i, t) {
|
|
813
809
|
c(this, A);
|
|
@@ -815,15 +811,15 @@ const T = class T {
|
|
|
815
811
|
c(this, q, []);
|
|
816
812
|
c(this, U, []);
|
|
817
813
|
c(this, me, 0);
|
|
818
|
-
c(this,
|
|
814
|
+
c(this, $, []);
|
|
819
815
|
c(this, we, /* @__PURE__ */ a(() => {
|
|
820
|
-
g(this,
|
|
816
|
+
g(this, $, []);
|
|
821
817
|
const i = e(this, A).template || [];
|
|
822
818
|
Array.from(i).forEach((t) => {
|
|
823
819
|
var s;
|
|
824
|
-
e(this,
|
|
820
|
+
e(this, $).push(((s = t.getBoundingClientRect) == null ? void 0 : s.call(t).height) || 24);
|
|
825
821
|
}), (e(this, m).rawRecords || []).forEach((t) => {
|
|
826
|
-
t.__ng || (t.__ng = e(this, te).call(this)), t.__ng.height = e(this,
|
|
822
|
+
t.__ng || (t.__ng = e(this, te).call(this)), t.__ng.height = e(this, $).slice();
|
|
827
823
|
});
|
|
828
824
|
}, "#initialize"));
|
|
829
825
|
x(this, "set", /* @__PURE__ */ a((i) => {
|
|
@@ -833,10 +829,10 @@ const T = class T {
|
|
|
833
829
|
rowState: T.ROW_STATE.EMPTY,
|
|
834
830
|
deleted: !1,
|
|
835
831
|
filtered: !1,
|
|
836
|
-
height: e(this,
|
|
832
|
+
height: e(this, $).slice(),
|
|
837
833
|
o: {},
|
|
838
834
|
c: {},
|
|
839
|
-
_: [0, 0, 0, 0, T.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this,
|
|
835
|
+
_: [0, 0, 0, 0, T.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, $).slice(), -1, {}, {}]
|
|
840
836
|
}), "#getDefaultMeta"));
|
|
841
837
|
x(this, "reset", /* @__PURE__ */ a(() => {
|
|
842
838
|
g(this, q, []), g(this, U, []);
|
|
@@ -943,7 +939,7 @@ const T = class T {
|
|
|
943
939
|
return this.length;
|
|
944
940
|
}
|
|
945
941
|
};
|
|
946
|
-
A = new WeakMap(), m = new WeakMap(), q = new WeakMap(), U = new WeakMap(), me = new WeakMap(),
|
|
942
|
+
A = new WeakMap(), m = new WeakMap(), q = new WeakMap(), U = new WeakMap(), me = new WeakMap(), $ = new WeakMap(), we = new WeakMap(), te = new WeakMap(), xe = new WeakMap(), ve = new WeakMap(), F = new WeakMap(), a(T, "ngData"), // 🎯 행 상태 정의 상수를 클래스 내부로 내재화
|
|
947
943
|
x(T, "ROW_STATE", {
|
|
948
944
|
EMPTY: "EMPTY",
|
|
949
945
|
NORMAL: "NORMAL",
|