@ninebone/table 0.0.751 → 0.0.752
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 +150 -153
- 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
|
@@ -2,10 +2,10 @@ var fs = Object.defineProperty;
|
|
|
2
2
|
var us = (q) => {
|
|
3
3
|
throw TypeError(q);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
5
|
+
var ps = (q, s, e) => s in q ? fs(q, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : q[s] = e;
|
|
6
6
|
var h = (q, s) => fs(q, "name", { value: s, configurable: !0 });
|
|
7
|
-
var E = (q, s, e) =>
|
|
8
|
-
var t = (q, s, e) => (
|
|
7
|
+
var E = (q, s, e) => ps(q, typeof s != "symbol" ? s + "" : s, e), xe = (q, s, e) => s.has(q) || us("Cannot " + e);
|
|
8
|
+
var t = (q, s, e) => (xe(q, s, "read from private field"), e ? e.call(q) : s.get(q)), d = (q, s, e) => s.has(q) ? us("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(q) : s.set(q, e), p = (q, s, e, n) => (xe(q, s, "write to private field"), n ? n.call(q, e) : s.set(q, e), e), gt = (q, s, e) => (xe(q, s, "access private method"), e);
|
|
9
9
|
var gs = (q, s, e, n) => ({
|
|
10
10
|
set _(r) {
|
|
11
11
|
p(q, s, r, e);
|
|
@@ -14,31 +14,31 @@ var gs = (q, s, e, n) => ({
|
|
|
14
14
|
return t(q, s, n);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
import { trace as
|
|
18
|
-
const Xe = class Xe extends
|
|
17
|
+
import { trace as ys } from "@ninebone/util";
|
|
18
|
+
const Xe = class Xe extends ys.constructor {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
h(Xe, "Trace");
|
|
24
|
-
let
|
|
25
|
-
const w = new
|
|
26
|
-
var B, K, A, tt, et,
|
|
24
|
+
let ve = Xe;
|
|
25
|
+
const w = new ve();
|
|
26
|
+
var B, K, A, Q, tt, et, Vt, st, Ut;
|
|
27
27
|
const Ke = class Ke extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
d(this, B);
|
|
31
31
|
d(this, K, !1);
|
|
32
32
|
d(this, A);
|
|
33
|
+
d(this, Q);
|
|
33
34
|
d(this, tt);
|
|
34
35
|
d(this, et);
|
|
35
|
-
d(this, st);
|
|
36
36
|
d(this, Vt, /* @__PURE__ */ h(() => {
|
|
37
37
|
if (!t(this, B)) return;
|
|
38
38
|
const e = t(this, B).querySelector(".ng-container-body .ng-part-body");
|
|
39
|
-
e && (p(this,
|
|
39
|
+
e && (p(this, et, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
|
-
})), t(this,
|
|
41
|
+
})), t(this, et).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
44
44
|
if (!t(this, B) || !t(this, A) || t(this, K)) return;
|
|
@@ -61,7 +61,7 @@ const Ke = class Ke extends HTMLElement {
|
|
|
61
61
|
const y = l - f;
|
|
62
62
|
g > y && (g = y), o.style.left = `${g}px`, t(this, A).left.disabled = g === 0, t(this, A).right.disabled = g >= y - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
d(this,
|
|
64
|
+
d(this, st, /* @__PURE__ */ h((e) => {
|
|
65
65
|
if (!t(this, A)) return !1;
|
|
66
66
|
const n = t(this, A).container, r = n.querySelector("table");
|
|
67
67
|
if (!r) return !1;
|
|
@@ -75,16 +75,16 @@ const Ke = class Ke extends HTMLElement {
|
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
76
|
d(this, Ut, /* @__PURE__ */ h(() => {
|
|
77
77
|
const e = /* @__PURE__ */ h((r) => {
|
|
78
|
-
clearInterval(t(this,
|
|
78
|
+
clearInterval(t(this, Q)), clearInterval(t(this, tt));
|
|
79
79
|
const o = parseInt(t(this, A).thumb.style.left || 0, 10);
|
|
80
|
-
t(this,
|
|
81
|
-
clearInterval(t(this,
|
|
80
|
+
t(this, st).call(this, o + r), p(this, Q, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, Q)), p(this, tt, setInterval(() => {
|
|
82
82
|
const i = parseInt(t(this, A).thumb.style.left || 0, 10);
|
|
83
|
-
t(this,
|
|
83
|
+
t(this, st).call(this, i + r) || clearInterval(t(this, tt));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), n = /* @__PURE__ */ h(() => {
|
|
87
|
-
clearInterval(t(this,
|
|
87
|
+
clearInterval(t(this, Q)), clearInterval(t(this, tt));
|
|
88
88
|
}, "clearTimer");
|
|
89
89
|
["mouseup", "mouseleave", "touchend"].forEach((r) => {
|
|
90
90
|
t(this, A).left.addEventListener(r, n), t(this, A).right.addEventListener(r, n), t(this, A).track.addEventListener(r, n);
|
|
@@ -96,14 +96,14 @@ const Ke = class Ke extends HTMLElement {
|
|
|
96
96
|
if (r.button !== 0) return;
|
|
97
97
|
r.preventDefault();
|
|
98
98
|
const o = t(this, A).track.getBoundingClientRect(), i = t(this, A).thumb.clientWidth;
|
|
99
|
-
t(this,
|
|
99
|
+
t(this, st).call(this, r.clientX - o.left - i / 2);
|
|
100
100
|
}), t(this, A).thumb.addEventListener("mousedown", (r) => {
|
|
101
101
|
if (r.button !== 0) return;
|
|
102
102
|
r.stopPropagation(), r.preventDefault(), p(this, K, !0), this.shiftX = r.clientX - t(this, A).thumb.getBoundingClientRect().left;
|
|
103
103
|
const o = /* @__PURE__ */ h((a) => {
|
|
104
104
|
if (!t(this, K)) return;
|
|
105
105
|
const c = t(this, A).track.getBoundingClientRect();
|
|
106
|
-
t(this,
|
|
106
|
+
t(this, st).call(this, a.clientX - c.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), i = /* @__PURE__ */ h(() => {
|
|
108
108
|
p(this, K, !1), n(), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", i), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
@@ -195,25 +195,25 @@ const Ke = class Ke extends HTMLElement {
|
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
197
197
|
disconnectedCallback() {
|
|
198
|
-
t(this,
|
|
198
|
+
t(this, et) && t(this, et).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
B = new WeakMap(), K = new WeakMap(), A = new WeakMap(),
|
|
202
|
-
let
|
|
203
|
-
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar",
|
|
204
|
-
var
|
|
201
|
+
B = new WeakMap(), K = new WeakMap(), A = new WeakMap(), Q = new WeakMap(), tt = new WeakMap(), et = new WeakMap(), Vt = new WeakMap(), st = new WeakMap(), Ut = new WeakMap(), h(Ke, "NineTableHScrollBar");
|
|
202
|
+
let we = Ke;
|
|
203
|
+
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", we);
|
|
204
|
+
var nt, rt, bt, C, Tt, Ct, Xt;
|
|
205
205
|
const Ge = class Ge extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
+
d(this, nt);
|
|
208
209
|
d(this, rt);
|
|
209
|
-
d(this, ot);
|
|
210
210
|
d(this, bt, !1);
|
|
211
211
|
d(this, C);
|
|
212
212
|
d(this, Tt, 0);
|
|
213
213
|
d(this, Ct, 0);
|
|
214
214
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
|
-
if (w.log("vscrollbar.refresh"), !t(this,
|
|
216
|
-
const e = t(this, C).container, n = t(this, C).track, r = t(this, C).thumb, o = e.clientHeight, i = t(this,
|
|
215
|
+
if (w.log("vscrollbar.refresh"), !t(this, nt) || !t(this, C)) return;
|
|
216
|
+
const e = t(this, C).container, n = t(this, C).track, r = t(this, C).thumb, o = e.clientHeight, i = t(this, nt).data.length, a = t(this, rt).getRowHeight(), c = i * a;
|
|
217
217
|
if (c <= o || i === 0) {
|
|
218
218
|
this.style.display = "none";
|
|
219
219
|
return;
|
|
@@ -233,7 +233,7 @@ const Ge = class Ge extends HTMLElement {
|
|
|
233
233
|
d(this, Xt, /* @__PURE__ */ h(() => {
|
|
234
234
|
w.log("nine-table-vscrollbar.#init");
|
|
235
235
|
const e = t(this, C).container, n = /* @__PURE__ */ h(() => {
|
|
236
|
-
const o = (t(this,
|
|
236
|
+
const o = (t(this, nt).data.get() || []).length, i = t(this, rt).getRowHeight();
|
|
237
237
|
return o * i;
|
|
238
238
|
}, "getContentHeight");
|
|
239
239
|
t(this, C).thumb.addEventListener("mousedown", (r) => {
|
|
@@ -269,7 +269,7 @@ const Ge = class Ge extends HTMLElement {
|
|
|
269
269
|
}, "#init"));
|
|
270
270
|
}
|
|
271
271
|
connectedCallback() {
|
|
272
|
-
p(this,
|
|
272
|
+
p(this, nt, this.getRootNode().host), p(this, rt, this.closest("nine-table-sheet")), this.innerHTML = `
|
|
273
273
|
<style>
|
|
274
274
|
nine-table-vscrollbar {
|
|
275
275
|
display: flex;
|
|
@@ -334,7 +334,7 @@ const Ge = class Ge extends HTMLElement {
|
|
|
334
334
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
335
335
|
`;
|
|
336
336
|
const e = /* @__PURE__ */ h(() => {
|
|
337
|
-
const n = t(this,
|
|
337
|
+
const n = t(this, rt).querySelector(".ng-container-body .ng-part-body");
|
|
338
338
|
if (!n) {
|
|
339
339
|
setTimeout(e, 10);
|
|
340
340
|
return;
|
|
@@ -350,22 +350,22 @@ const Ge = class Ge extends HTMLElement {
|
|
|
350
350
|
e();
|
|
351
351
|
}
|
|
352
352
|
};
|
|
353
|
-
|
|
354
|
-
let
|
|
355
|
-
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar",
|
|
356
|
-
var j, R,
|
|
353
|
+
nt = new WeakMap(), rt = new WeakMap(), bt = new WeakMap(), C = new WeakMap(), Tt = new WeakMap(), Ct = new WeakMap(), Xt = new WeakMap(), h(Ge, "NineTableVScrollBar");
|
|
354
|
+
let Se = Ge;
|
|
355
|
+
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Se);
|
|
356
|
+
var j, R, ot, P, D, G, it, kt, Oe, ze, Kt, Gt, Lt, It, Ht, Zt, Jt, Mt, We, pt, $t, Qt;
|
|
357
357
|
const Ze = class Ze {
|
|
358
358
|
constructor(s) {
|
|
359
359
|
d(this, j);
|
|
360
360
|
d(this, R);
|
|
361
|
-
d(this,
|
|
361
|
+
d(this, ot);
|
|
362
362
|
d(this, P, /* @__PURE__ */ new Map());
|
|
363
363
|
d(this, D, null);
|
|
364
364
|
d(this, G, null);
|
|
365
|
-
d(this,
|
|
365
|
+
d(this, it, 0);
|
|
366
366
|
d(this, kt, 40);
|
|
367
|
+
d(this, Oe, !1);
|
|
367
368
|
d(this, ze, !1);
|
|
368
|
-
d(this, We, !1);
|
|
369
369
|
//#ticking = false; // 🎯 고속 스크롤 스로틀링용 플래그
|
|
370
370
|
d(this, Kt, 3);
|
|
371
371
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
@@ -375,7 +375,7 @@ const Ze = class Ze {
|
|
|
375
375
|
s && (t(this, Lt).call(this), t(this, It).call(this), t(this, pt).call(this, s.scrollTop), (e = t(this, R).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
376
376
|
}, "refresh"));
|
|
377
377
|
E(this, "initialize", /* @__PURE__ */ h(() => {
|
|
378
|
-
w.log("rowManager.initialize"), p(this,
|
|
378
|
+
w.log("rowManager.initialize"), p(this, ot, {
|
|
379
379
|
scrollTables: t(this, R).querySelectorAll(".ng-part-body table"),
|
|
380
380
|
firstTr: t(this, R).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
381
381
|
}), p(this, D, null), t(this, P).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
@@ -418,7 +418,7 @@ const Ze = class Ze {
|
|
|
418
418
|
n.forEach((c) => {
|
|
419
419
|
i.appendChild(c.cloneNode(!0));
|
|
420
420
|
});
|
|
421
|
-
o ? o.before(i) : r.appendChild(i), e === ".ng-container-body" && (t(this,
|
|
421
|
+
o ? o.before(i) : r.appendChild(i), e === ".ng-container-body" && (t(this, ot).firstTr = r.querySelector("tr:not(.nodata)"));
|
|
422
422
|
}, "#renderRows"));
|
|
423
423
|
d(this, Lt, /* @__PURE__ */ h(() => {
|
|
424
424
|
if (t(this, D) !== null && t(this, D) > 0)
|
|
@@ -458,8 +458,8 @@ const Ze = class Ze {
|
|
|
458
458
|
});
|
|
459
459
|
}, "#updateVirtualScrollHeight"));
|
|
460
460
|
d(this, Ht, /* @__PURE__ */ h(() => {
|
|
461
|
-
if (t(this,
|
|
462
|
-
const s = Math.ceil(t(this,
|
|
461
|
+
if (t(this, it) > 0 && t(this, D) > 0) {
|
|
462
|
+
const s = Math.ceil(t(this, it) / t(this, D));
|
|
463
463
|
p(this, kt, s + t(this, Kt));
|
|
464
464
|
}
|
|
465
465
|
}, "#updateRowCount"));
|
|
@@ -501,7 +501,7 @@ const Ze = class Ze {
|
|
|
501
501
|
const i = n.querySelector(".ng-part-header"), a = n.querySelector(".ng-part-footer");
|
|
502
502
|
i && (o += i.offsetHeight), a && (o += a.offsetHeight);
|
|
503
503
|
const c = Math.max(r - o, 100);
|
|
504
|
-
t(this,
|
|
504
|
+
t(this, it) !== c && (p(this, it, c), t(this, Ht).call(this), t(this, D) !== null && (t(this, Mt).call(this), this.refresh()));
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
507
|
})), t(this, G).observe(t(this, R)));
|
|
@@ -512,7 +512,7 @@ const Ze = class Ze {
|
|
|
512
512
|
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Gt).call(this, e, s);
|
|
513
513
|
}), t(this, Qt).call(this), t(this, Zt).call(this);
|
|
514
514
|
}, "#renderAllContainers"));
|
|
515
|
-
d(this,
|
|
515
|
+
d(this, We, /* @__PURE__ */ h((s) => {
|
|
516
516
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
517
517
|
var l;
|
|
518
518
|
const n = t(this, R).querySelector(e);
|
|
@@ -542,8 +542,8 @@ const Ze = class Ze {
|
|
|
542
542
|
const i = Math.max(0, n - Math.floor(o.clientHeight / e)), a = Math.min(i, Math.max(0, Math.floor(s / e)));
|
|
543
543
|
let c = Math.floor(a * e);
|
|
544
544
|
w.log(`📜 [Scroll Calc] maxStartIndex: ${i}, startIndex: ${a}, offsetY: ${c}`), a === i && w.log(`📜 [Scroll Inspect] scrollTop: ${s}, rowHeight: ${e}, maxStartIndex: ${i}, startIndex: ${a}, offsetY: ${c}`);
|
|
545
|
-
const l = t(this,
|
|
546
|
-
(b = t(this,
|
|
545
|
+
const l = t(this, ot).firstTr, f = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
|
|
546
|
+
(b = t(this, ot)) == null || b.scrollTables.forEach((g) => {
|
|
547
547
|
g.style.transform = `translate3d(0, ${c}px, 0)`;
|
|
548
548
|
}), f !== a && (w.log(`🔄 [Row Bind Trigger] currentStartIndex(${f}) !== startIndex(${a})`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
|
|
549
549
|
const y = t(this, R).querySelector(g);
|
|
@@ -610,8 +610,8 @@ const Ze = class Ze {
|
|
|
610
610
|
return ((e = t(this, P).get(s)) == null ? void 0 : e.length) || 1;
|
|
611
611
|
}
|
|
612
612
|
};
|
|
613
|
-
j = new WeakMap(), R = new WeakMap(),
|
|
614
|
-
let
|
|
613
|
+
j = new WeakMap(), R = new WeakMap(), ot = new WeakMap(), P = new WeakMap(), D = new WeakMap(), G = new WeakMap(), it = new WeakMap(), kt = new WeakMap(), Oe = new WeakMap(), ze = new WeakMap(), Kt = new WeakMap(), Gt = new WeakMap(), Lt = new WeakMap(), It = new WeakMap(), Ht = new WeakMap(), Zt = new WeakMap(), Jt = new WeakMap(), Mt = new WeakMap(), We = new WeakMap(), pt = new WeakMap(), $t = new WeakMap(), Qt = new WeakMap(), h(Ze, "RowManager");
|
|
614
|
+
let Re = Ze;
|
|
615
615
|
const te = class te {
|
|
616
616
|
/**
|
|
617
617
|
* 🎯 레이아웃 내의 여러 rawTables 배열을 일괄로 받아 단일 마스터 템플릿으로 사전 컴파일합니다.
|
|
@@ -692,7 +692,7 @@ const te = class te {
|
|
|
692
692
|
// 🎯 [추가] td/th에 선언된 cell-type 속성을 읽어 커스텀 태그로 자동 감싸기
|
|
693
693
|
};
|
|
694
694
|
h(te, "TableCompiler");
|
|
695
|
-
let
|
|
695
|
+
let Ae = te;
|
|
696
696
|
var _, Y, U, At, bs;
|
|
697
697
|
const Je = class Je {
|
|
698
698
|
constructor(s) {
|
|
@@ -716,20 +716,17 @@ const Je = class Je {
|
|
|
716
716
|
let i = 0;
|
|
717
717
|
o.forEach((a) => {
|
|
718
718
|
a.querySelectorAll("tbody tr").forEach((c) => {
|
|
719
|
-
const { matrixRow: l } =
|
|
719
|
+
const { matrixRow: l } = gt(this, U, At).call(this, c);
|
|
720
720
|
l < 0 || c.querySelectorAll("td, th").forEach((f) => {
|
|
721
721
|
const u = parseInt(f.dataset.col, 10);
|
|
722
722
|
if (isNaN(u)) return;
|
|
723
723
|
const b = parseInt(f.rowSpan || 1, 10), g = parseInt(f.colSpan || 1, 10), y = l + b - 1, v = u + g - 1;
|
|
724
|
-
|
|
725
|
-
i++, f.classList.add("selected");
|
|
726
|
-
const m = s === n && e === r;
|
|
727
|
-
w.log(f, s, e, n, r), m ? f.classList.add("selected-top", "selected-bottom", "selected-left", "selected-right") : (l <= s && f.classList.add("selected-top"), y >= n && f.classList.add("selected-bottom"), u <= e && f.classList.add("selected-left"), v >= r && f.classList.add("selected-right"));
|
|
724
|
+
y >= s && l <= n && v >= e && u <= r && (i++, f.classList.add("selected"), w.log(f, s, e, n, r), l <= s && f.classList.add("selected-top"), y >= n && f.classList.add("selected-bottom"), u <= e && f.classList.add("selected-left"), v >= r && f.classList.add("selected-right"));
|
|
728
725
|
});
|
|
729
726
|
});
|
|
730
727
|
}), w.log(`✨ [CellSelection.render] Total rendered cells marked: ${i}`);
|
|
731
728
|
}, "render"));
|
|
732
|
-
p(this, _, s),
|
|
729
|
+
p(this, _, s), gt(this, U, bs).call(this), t(this, _).querySelectorAll(
|
|
733
730
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
734
731
|
).forEach((n) => {
|
|
735
732
|
n.addEventListener("scroll", () => {
|
|
@@ -748,7 +745,7 @@ const Je = class Je {
|
|
|
748
745
|
f = !1, u++, l.forEach((b) => {
|
|
749
746
|
b.querySelectorAll("tbody tr").forEach((g) => {
|
|
750
747
|
if (g.classList.contains("nodata")) return;
|
|
751
|
-
const { matrixRow: y } =
|
|
748
|
+
const { matrixRow: y } = gt(this, U, At).call(this, g);
|
|
752
749
|
y < 0 || g.querySelectorAll("td, th").forEach((v) => {
|
|
753
750
|
const S = parseInt(v.dataset.col, 10);
|
|
754
751
|
if (isNaN(S)) return;
|
|
@@ -780,7 +777,7 @@ _ = new WeakMap(), Y = new WeakMap(), U = new WeakSet(), At = /* @__PURE__ */ h(
|
|
|
780
777
|
const n = e.target.closest("td, th");
|
|
781
778
|
if (!n || n.dataset.row === void 0 || n.dataset.col === void 0 || n.closest("tr").classList.contains("nodata")) return;
|
|
782
779
|
t(this, _).style.userSelect = "none", t(this, _).style.webkitUserSelect = "none";
|
|
783
|
-
const r = n.closest("tr"), { matrixRow: o } =
|
|
780
|
+
const r = n.closest("tr"), { matrixRow: o } = gt(this, U, At).call(this, r), i = parseInt(n.dataset.col, 10);
|
|
784
781
|
if (o < 0) {
|
|
785
782
|
t(this, _).style.userSelect = "", t(this, _).style.webkitUserSelect = "";
|
|
786
783
|
return;
|
|
@@ -800,7 +797,7 @@ _ = new WeakMap(), Y = new WeakMap(), U = new WeakSet(), At = /* @__PURE__ */ h(
|
|
|
800
797
|
}
|
|
801
798
|
}
|
|
802
799
|
if (!u || u.dataset.row === void 0 || u.dataset.col === void 0 || u.closest("tr").classList.contains("nodata")) return;
|
|
803
|
-
const b = u.closest("tr"), { matrixRow: g } =
|
|
800
|
+
const b = u.closest("tr"), { matrixRow: g } = gt(this, U, At).call(this, b), y = parseInt(u.dataset.col, 10);
|
|
804
801
|
g < 0 || this.setRange(o, i, g, y);
|
|
805
802
|
}, "onMouseMove"), c = /* @__PURE__ */ h(() => {
|
|
806
803
|
w.log("🖱️ [MouseUp] Drag ended."), t(this, _).style.userSelect = "", t(this, _).style.webkitUserSelect = "", document.removeEventListener("mousemove", a), document.removeEventListener("mouseup", c);
|
|
@@ -808,25 +805,25 @@ _ = new WeakMap(), Y = new WeakMap(), U = new WeakSet(), At = /* @__PURE__ */ h(
|
|
|
808
805
|
document.addEventListener("mousemove", a), document.addEventListener("mouseup", c);
|
|
809
806
|
});
|
|
810
807
|
}, "#initEvents"), h(Je, "CellSelection");
|
|
811
|
-
let
|
|
812
|
-
var V,
|
|
808
|
+
let Ee = Je;
|
|
809
|
+
var V, at, ee, se, _t, Be, ms;
|
|
813
810
|
const Qe = class Qe {
|
|
814
811
|
// 🎯 키보드 네비게이션 중 스크롤 튐 방지 플래그
|
|
815
812
|
constructor(s) {
|
|
816
|
-
d(this,
|
|
813
|
+
d(this, Be);
|
|
817
814
|
d(this, V);
|
|
818
|
-
d(this,
|
|
815
|
+
d(this, at, null);
|
|
819
816
|
d(this, ee, -1);
|
|
820
817
|
d(this, se, -1);
|
|
821
818
|
d(this, _t, !1);
|
|
822
|
-
p(this, V, s),
|
|
819
|
+
p(this, V, s), w.log("🎯 [CellNavigation] Initialized");
|
|
823
820
|
}
|
|
824
821
|
get currentCell() {
|
|
825
|
-
return t(this,
|
|
822
|
+
return t(this, at);
|
|
826
823
|
}
|
|
827
824
|
set currentCell(s) {
|
|
828
825
|
if (!s) return;
|
|
829
|
-
p(this,
|
|
826
|
+
p(this, at, s), s.focus({ preventScroll: !0 });
|
|
830
827
|
const e = parseInt(s.dataset.row, 10), n = parseInt(s.dataset.col, 10);
|
|
831
828
|
if (!isNaN(e) && !isNaN(n)) {
|
|
832
829
|
p(this, ee, e), p(this, se, n);
|
|
@@ -841,8 +838,8 @@ const Qe = class Qe {
|
|
|
841
838
|
}
|
|
842
839
|
moveCell(s) {
|
|
843
840
|
var I, T, H, F;
|
|
844
|
-
if (!t(this,
|
|
845
|
-
const e = t(this,
|
|
841
|
+
if (!t(this, at)) return;
|
|
842
|
+
const e = t(this, at), n = e.closest("tr"), r = parseInt(e.dataset.row, 10), o = parseInt(e.dataset.col, 10), i = n == null ? void 0 : n.closest("tbody"), c = Array.from(i.querySelectorAll("tr:not(.nodata)")).filter((X) => parseInt(X.dataset.row, 10) === r), l = c.length > 0 ? c.length : 1, f = c.indexOf(n);
|
|
846
843
|
let u = r, b = f, g = o;
|
|
847
844
|
switch (s.code) {
|
|
848
845
|
case "Tab":
|
|
@@ -871,7 +868,7 @@ const Qe = class Qe {
|
|
|
871
868
|
}
|
|
872
869
|
}
|
|
873
870
|
};
|
|
874
|
-
V = new WeakMap(),
|
|
871
|
+
V = new WeakMap(), at = new WeakMap(), ee = new WeakMap(), se = new WeakMap(), _t = new WeakMap(), Be = new WeakSet(), ms = /* @__PURE__ */ h(function() {
|
|
875
872
|
t(this, V).addEventListener("mousedown", (s) => {
|
|
876
873
|
w.log(s);
|
|
877
874
|
const e = s.target.closest("td, th");
|
|
@@ -880,39 +877,39 @@ V = new WeakMap(), lt = new WeakMap(), ee = new WeakMap(), se = new WeakMap(), _
|
|
|
880
877
|
w.log(s), ["Tab", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(s.code) && this.moveCell(s);
|
|
881
878
|
});
|
|
882
879
|
}, "#initEvents"), h(Qe, "CellNavigation");
|
|
883
|
-
let
|
|
884
|
-
var
|
|
880
|
+
let qe = Qe;
|
|
881
|
+
var ne, lt, ct, Nt, Dt, re, oe, yt, ie, ae;
|
|
885
882
|
const Et = class Et extends HTMLElement {
|
|
886
883
|
constructor() {
|
|
887
884
|
super();
|
|
888
|
-
d(this,
|
|
889
|
-
d(this,
|
|
890
|
-
d(this,
|
|
885
|
+
d(this, ne);
|
|
886
|
+
d(this, lt, null);
|
|
887
|
+
d(this, ct);
|
|
891
888
|
d(this, Nt);
|
|
892
889
|
d(this, Dt);
|
|
893
890
|
E(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
894
|
-
w.log("sheet.invalidate()"), t(this,
|
|
891
|
+
w.log("sheet.invalidate()"), t(this, ct).refresh();
|
|
895
892
|
}, "invalidate"));
|
|
896
893
|
E(this, "generate", /* @__PURE__ */ h((e) => {
|
|
897
894
|
if (w.log("sheet.generate()"), !e) return;
|
|
898
|
-
p(this,
|
|
895
|
+
p(this, lt, Ae.compile(e)), t(this, re).call(this), t(this, oe).call(this);
|
|
899
896
|
const n = this.querySelector(".ng-container-body .ng-part-header"), r = this.querySelector(".ng-container-body .ng-part-footer"), o = this.querySelector(".ng-nodata-overlay");
|
|
900
|
-
n && o && (o.style.top = `${n.offsetHeight}px`), r && o && (o.style.bottom = `${r.offsetHeight}px`), t(this,
|
|
897
|
+
n && o && (o.style.top = `${n.offsetHeight}px`), r && o && (o.style.bottom = `${r.offsetHeight}px`), t(this, ct).initialize(), setTimeout(() => {
|
|
901
898
|
var i;
|
|
902
899
|
(i = this.querySelector("nine-table-hscrollbar")) == null || i.refresh();
|
|
903
900
|
}, 0);
|
|
904
901
|
}, "generate"));
|
|
905
|
-
d(this,
|
|
902
|
+
d(this, re, /* @__PURE__ */ h(() => {
|
|
906
903
|
[
|
|
907
904
|
{ selector: ".ng-container-body", type: null },
|
|
908
905
|
{ selector: ".ng-container-left", type: "left" },
|
|
909
906
|
{ selector: ".ng-container-right", type: "right" }
|
|
910
907
|
].forEach(({ selector: n, type: r }) => {
|
|
911
908
|
var o, i, a;
|
|
912
|
-
(o = this.querySelector(`${n} .ng-part-header`)) == null || o.appendChild(t(this, yt).call(this, t(this,
|
|
909
|
+
(o = this.querySelector(`${n} .ng-part-header`)) == null || o.appendChild(t(this, yt).call(this, t(this, lt), r, "header")), (i = this.querySelector(`${n} .ng-virtual-spacer`)) == null || i.before(t(this, yt).call(this, t(this, lt), r, "body")), (a = this.querySelector(`${n} .ng-part-footer`)) == null || a.appendChild(t(this, yt).call(this, t(this, lt), r, "footer"));
|
|
913
910
|
});
|
|
914
911
|
}, "#renderSplitContainers"));
|
|
915
|
-
d(this,
|
|
912
|
+
d(this, oe, /* @__PURE__ */ h(() => {
|
|
916
913
|
["left", "right", "body"].forEach((e) => {
|
|
917
914
|
const n = this.querySelector(`.ng-container-${e}`), r = n == null ? void 0 : n.querySelectorAll("table");
|
|
918
915
|
if (!n || !r || r.length === 0) return;
|
|
@@ -939,7 +936,7 @@ const Et = class Et extends HTMLElement {
|
|
|
939
936
|
l.remove();
|
|
940
937
|
}), o;
|
|
941
938
|
}, "#createSplitTable"));
|
|
942
|
-
E(this, "getRowHeight", /* @__PURE__ */ h(() => t(this,
|
|
939
|
+
E(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, ct).getRowHeight(), "getRowHeight"));
|
|
943
940
|
E(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
944
941
|
const n = this.querySelector(".ng-container-body .ng-part-body");
|
|
945
942
|
n && (n.scrollLeft = e);
|
|
@@ -948,10 +945,10 @@ const Et = class Et extends HTMLElement {
|
|
|
948
945
|
const n = this.querySelector(".ng-container-body .ng-part-body");
|
|
949
946
|
n && (n.scrollTop = e);
|
|
950
947
|
}, "scrollToY"));
|
|
951
|
-
d(this,
|
|
952
|
-
t(this,
|
|
948
|
+
d(this, ie, /* @__PURE__ */ h(() => {
|
|
949
|
+
t(this, ae).call(this), p(this, Nt, new Ee(this)), p(this, Dt, new qe(this));
|
|
953
950
|
}, "#init"));
|
|
954
|
-
d(this,
|
|
951
|
+
d(this, ae, /* @__PURE__ */ h(() => {
|
|
955
952
|
const e = Et.SCROLLBAR_SIZE;
|
|
956
953
|
this.innerHTML = `
|
|
957
954
|
<style>
|
|
@@ -1153,10 +1150,10 @@ const Et = class Et extends HTMLElement {
|
|
|
1153
1150
|
</div>
|
|
1154
1151
|
`;
|
|
1155
1152
|
}, "#render"));
|
|
1156
|
-
p(this,
|
|
1153
|
+
p(this, ct, new Re(this)), p(this, ne, this.getRootNode().host);
|
|
1157
1154
|
}
|
|
1158
1155
|
connectedCallback() {
|
|
1159
|
-
t(this,
|
|
1156
|
+
t(this, ie).call(this);
|
|
1160
1157
|
}
|
|
1161
1158
|
get selection() {
|
|
1162
1159
|
return t(this, Nt);
|
|
@@ -1168,14 +1165,14 @@ const Et = class Et extends HTMLElement {
|
|
|
1168
1165
|
this.innerHTML = "", w.log("NineTableSheet destroyed.");
|
|
1169
1166
|
}
|
|
1170
1167
|
};
|
|
1171
|
-
|
|
1168
|
+
ne = new WeakMap(), lt = new WeakMap(), ct = new WeakMap(), Nt = new WeakMap(), Dt = new WeakMap(), re = new WeakMap(), oe = new WeakMap(), yt = new WeakMap(), ie = new WeakMap(), ae = new WeakMap(), h(Et, "NineTableSheet"), E(Et, "SCROLLBAR_SIZE", 16);
|
|
1172
1169
|
let Yt = Et;
|
|
1173
1170
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", Yt);
|
|
1174
|
-
var
|
|
1171
|
+
var le, Ot;
|
|
1175
1172
|
const ts = class ts extends HTMLElement {
|
|
1176
1173
|
constructor() {
|
|
1177
1174
|
super();
|
|
1178
|
-
d(this,
|
|
1175
|
+
d(this, le, /* @__PURE__ */ h(() => {
|
|
1179
1176
|
var e;
|
|
1180
1177
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (n) => {
|
|
1181
1178
|
var i;
|
|
@@ -1216,18 +1213,18 @@ const ts = class ts extends HTMLElement {
|
|
|
1216
1213
|
}, "#switchSheet"));
|
|
1217
1214
|
}
|
|
1218
1215
|
connectedCallback() {
|
|
1219
|
-
t(this,
|
|
1216
|
+
t(this, le).call(this);
|
|
1220
1217
|
}
|
|
1221
1218
|
};
|
|
1222
|
-
|
|
1223
|
-
let
|
|
1224
|
-
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets",
|
|
1225
|
-
var N,
|
|
1219
|
+
le = new WeakMap(), Ot = new WeakMap(), h(ts, "NineTableSheets");
|
|
1220
|
+
let Te = ts;
|
|
1221
|
+
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", Te);
|
|
1222
|
+
var N, ce, zt, he;
|
|
1226
1223
|
const es = class es {
|
|
1227
1224
|
constructor(s) {
|
|
1228
1225
|
d(this, N);
|
|
1229
|
-
d(this,
|
|
1230
|
-
t(this,
|
|
1226
|
+
d(this, ce, /* @__PURE__ */ h(() => {
|
|
1227
|
+
t(this, he).call(this), new ResizeObserver((s) => {
|
|
1231
1228
|
for (let e of s)
|
|
1232
1229
|
t(this, N).getAttribute("auto-height") === "true" && t(this, zt).call(this);
|
|
1233
1230
|
}).observe(t(this, N));
|
|
@@ -1239,7 +1236,7 @@ const es = class es {
|
|
|
1239
1236
|
const e = parseInt(t(this, N).getAttribute("max-display-row"), 10) || 10, n = Math.max(...s.map((f) => f.getRowHeight())), r = (c = t(this, N).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, o = (l = t(this, N).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, i = Yt.SCROLLBAR_SIZE, a = e * n + r + o + i;
|
|
1240
1237
|
t(this, N).style.height = `${a}px`;
|
|
1241
1238
|
}, "#applyAutoHeight"));
|
|
1242
|
-
d(this,
|
|
1239
|
+
d(this, he, /* @__PURE__ */ h(() => {
|
|
1243
1240
|
const e = Array.from(t(this, N).children).filter((c) => c.tagName === "TABLE"), n = t(this, N).getAttribute("auto-height") === "true", r = e.length, o = e.map((c, l) => {
|
|
1244
1241
|
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, b = l < r - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
1245
1242
|
return u + b;
|
|
@@ -1372,11 +1369,11 @@ const es = class es {
|
|
|
1372
1369
|
});
|
|
1373
1370
|
});
|
|
1374
1371
|
}, "#render"));
|
|
1375
|
-
p(this, N, s), t(this,
|
|
1372
|
+
p(this, N, s), t(this, ce).call(this);
|
|
1376
1373
|
}
|
|
1377
1374
|
};
|
|
1378
|
-
N = new WeakMap(),
|
|
1379
|
-
let
|
|
1375
|
+
N = new WeakMap(), ce = new WeakMap(), zt = new WeakMap(), he = new WeakMap(), h(es, "LayoutManager");
|
|
1376
|
+
let Ce = es;
|
|
1380
1377
|
var Wt, mt;
|
|
1381
1378
|
const ss = class ss {
|
|
1382
1379
|
constructor(s) {
|
|
@@ -1394,17 +1391,17 @@ const ss = class ss {
|
|
|
1394
1391
|
}
|
|
1395
1392
|
};
|
|
1396
1393
|
Wt = new WeakMap(), mt = new WeakMap(), h(ss, "ngRow");
|
|
1397
|
-
let
|
|
1398
|
-
var O, k, z, xt,
|
|
1394
|
+
let ke = ss;
|
|
1395
|
+
var O, k, z, xt, de, Z, fe, ht, Bt, ue, ge, vt;
|
|
1399
1396
|
const W = class W {
|
|
1400
1397
|
constructor(s, e) {
|
|
1401
1398
|
d(this, O);
|
|
1402
1399
|
d(this, k);
|
|
1403
1400
|
d(this, z, []);
|
|
1404
1401
|
d(this, xt, []);
|
|
1405
|
-
d(this,
|
|
1402
|
+
d(this, de, 0);
|
|
1406
1403
|
d(this, Z, []);
|
|
1407
|
-
d(this,
|
|
1404
|
+
d(this, fe, /* @__PURE__ */ h(() => {
|
|
1408
1405
|
p(this, Z, []);
|
|
1409
1406
|
const s = t(this, O).template || [];
|
|
1410
1407
|
Array.from(s).forEach((e) => {
|
|
@@ -1414,7 +1411,7 @@ const W = class W {
|
|
|
1414
1411
|
e.__ng || (e.__ng = t(this, Bt).call(this)), e.__ng.height = t(this, Z).slice();
|
|
1415
1412
|
});
|
|
1416
1413
|
}, "#initialize"));
|
|
1417
|
-
d(this,
|
|
1414
|
+
d(this, ht, /* @__PURE__ */ h(() => {
|
|
1418
1415
|
const s = t(this, O).shadowRoot.querySelector("nine-table-sheets");
|
|
1419
1416
|
s == null || s.classList.toggle("nodata", this.length === 0), t(this, O).shadowRoot.querySelectorAll("nine-table-sheet").forEach((e) => {
|
|
1420
1417
|
e.invalidate();
|
|
@@ -1434,7 +1431,7 @@ const W = class W {
|
|
|
1434
1431
|
return t(this, vt).call(this, n[s]);
|
|
1435
1432
|
}, "get"));
|
|
1436
1433
|
E(this, "set", /* @__PURE__ */ h((s) => {
|
|
1437
|
-
this.clear(), this.add(s, !1), t(this,
|
|
1434
|
+
this.clear(), this.add(s, !1), t(this, ht).call(this);
|
|
1438
1435
|
}, "set"));
|
|
1439
1436
|
d(this, Bt, /* @__PURE__ */ h(() => ({
|
|
1440
1437
|
rowState: W.ROW_STATE.EMPTY,
|
|
@@ -1446,13 +1443,13 @@ const W = class W {
|
|
|
1446
1443
|
_: [0, 0, 0, 0, W.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Z).slice(), -1, {}, {}]
|
|
1447
1444
|
}), "#getDefaultMeta"));
|
|
1448
1445
|
E(this, "reset", /* @__PURE__ */ h(() => {
|
|
1449
|
-
p(this, z, []), p(this, xt, []), t(this,
|
|
1446
|
+
p(this, z, []), p(this, xt, []), t(this, ht).call(this);
|
|
1450
1447
|
}, "reset"));
|
|
1451
1448
|
E(this, "clear", /* @__PURE__ */ h(() => {
|
|
1452
1449
|
var s;
|
|
1453
1450
|
t(this, k).rawRecords = [], p(this, z, []), p(this, xt, []), (s = t(this, k).viewRecords) != null && s.reset && t(this, k).viewRecords.reset();
|
|
1454
1451
|
}, "clear"));
|
|
1455
|
-
d(this,
|
|
1452
|
+
d(this, ue, /* @__PURE__ */ h((s) => {
|
|
1456
1453
|
var r;
|
|
1457
1454
|
Array.isArray(s) || (s = [s]);
|
|
1458
1455
|
const e = typeof ((r = t(this, O).fields) == null ? void 0 : r.get) == "function" ? t(this, O).fields.get() : Object.keys(s[0] || {}), n = [];
|
|
@@ -1463,18 +1460,18 @@ const W = class W {
|
|
|
1463
1460
|
}), n.push(i);
|
|
1464
1461
|
}), n;
|
|
1465
1462
|
}, "#json2Array"));
|
|
1466
|
-
d(this,
|
|
1463
|
+
d(this, ge, /* @__PURE__ */ h((s) => (Array.isArray(s) || (s = [s]), s.forEach((e) => {
|
|
1467
1464
|
e.__ng = t(this, Bt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = W.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1468
1465
|
}), s), "#defaultInsert"));
|
|
1469
1466
|
E(this, "add", /* @__PURE__ */ h((s, e = !0) => {
|
|
1470
1467
|
s === void 0 && (s = {});
|
|
1471
|
-
const n = t(this,
|
|
1472
|
-
t(this, k).rawRecords = t(this, k).rawRecords.concat(t(this,
|
|
1468
|
+
const n = t(this, ue).call(this, s);
|
|
1469
|
+
t(this, k).rawRecords = t(this, k).rawRecords.concat(t(this, ge).call(this, n)), this.resetRecords();
|
|
1473
1470
|
const r = this.count() - 1;
|
|
1474
1471
|
return e || n.forEach((o, i) => {
|
|
1475
1472
|
const a = t(this, k).rawRecords[r - i];
|
|
1476
1473
|
a && (a.__ng.rowState = W.ROW_STATE.EMPTY);
|
|
1477
|
-
}), t(this,
|
|
1474
|
+
}), t(this, ht).call(this), r;
|
|
1478
1475
|
}, "add"));
|
|
1479
1476
|
E(this, "delete", /* @__PURE__ */ h((s) => {
|
|
1480
1477
|
let e = [];
|
|
@@ -1485,7 +1482,7 @@ const W = class W {
|
|
|
1485
1482
|
o.__ng.rowid === r && (o.__ng.deleted = !0, o.__ng.rowState = W.ROW_STATE.DELETE);
|
|
1486
1483
|
});
|
|
1487
1484
|
}
|
|
1488
|
-
}), this.resetRecords(), t(this,
|
|
1485
|
+
}), this.resetRecords(), t(this, ht).call(this);
|
|
1489
1486
|
}, "delete"));
|
|
1490
1487
|
E(this, "setValue", /* @__PURE__ */ h((s, e, n) => {
|
|
1491
1488
|
var c;
|
|
@@ -1517,7 +1514,7 @@ const W = class W {
|
|
|
1517
1514
|
return e ? o[0] : o;
|
|
1518
1515
|
}, "#conv"));
|
|
1519
1516
|
E(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1520
|
-
p(this, O, s), p(this, k, e), t(this,
|
|
1517
|
+
p(this, O, s), p(this, k, e), t(this, fe).call(this);
|
|
1521
1518
|
}
|
|
1522
1519
|
get source() {
|
|
1523
1520
|
return t(this, vt).call(this, t(this, k).rawRecords);
|
|
@@ -1526,7 +1523,7 @@ const W = class W {
|
|
|
1526
1523
|
this.clear(), this.add(s, !1);
|
|
1527
1524
|
}
|
|
1528
1525
|
get nextId() {
|
|
1529
|
-
return ++gs(this,
|
|
1526
|
+
return ++gs(this, de)._;
|
|
1530
1527
|
}
|
|
1531
1528
|
get count() {
|
|
1532
1529
|
return t(this, z).length;
|
|
@@ -1538,7 +1535,7 @@ const W = class W {
|
|
|
1538
1535
|
return this.length;
|
|
1539
1536
|
}
|
|
1540
1537
|
};
|
|
1541
|
-
O = new WeakMap(), k = new WeakMap(), z = new WeakMap(), xt = new WeakMap(),
|
|
1538
|
+
O = new WeakMap(), k = new WeakMap(), z = new WeakMap(), xt = new WeakMap(), de = new WeakMap(), Z = new WeakMap(), fe = new WeakMap(), ht = new WeakMap(), Bt = new WeakMap(), ue = new WeakMap(), ge = new WeakMap(), vt = new WeakMap(), h(W, "ngData"), // 🎯 행 상태 정의 상수를 클래스 내부로 내재화
|
|
1542
1539
|
E(W, "ROW_STATE", {
|
|
1543
1540
|
EMPTY: "EMPTY",
|
|
1544
1541
|
NORMAL: "NORMAL",
|
|
@@ -1546,14 +1543,14 @@ E(W, "ROW_STATE", {
|
|
|
1546
1543
|
UPDATE: "UPDATE",
|
|
1547
1544
|
DELETE: "DELETE"
|
|
1548
1545
|
});
|
|
1549
|
-
let
|
|
1550
|
-
var
|
|
1546
|
+
let Le = W;
|
|
1547
|
+
var dt;
|
|
1551
1548
|
const ns = class ns {
|
|
1552
1549
|
constructor(s) {
|
|
1553
|
-
d(this,
|
|
1554
|
-
p(this,
|
|
1550
|
+
d(this, dt);
|
|
1551
|
+
p(this, dt, s), this.row = new ke(this), this.data = new Le(t(this, dt), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1555
1552
|
var e;
|
|
1556
|
-
(e = t(this,
|
|
1553
|
+
(e = t(this, dt).view) != null && e.redraw && t(this, dt).view.redraw();
|
|
1557
1554
|
}, this.setDataSource = (e) => {
|
|
1558
1555
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1559
1556
|
}, this.getRowState = (e) => {
|
|
@@ -1568,9 +1565,9 @@ const ns = class ns {
|
|
|
1568
1565
|
}, this.setDataSource([]);
|
|
1569
1566
|
}
|
|
1570
1567
|
};
|
|
1571
|
-
|
|
1572
|
-
let
|
|
1573
|
-
var wt, M, Pt,
|
|
1568
|
+
dt = new WeakMap(), h(ns, "ngDataManager");
|
|
1569
|
+
let Ie = ns;
|
|
1570
|
+
var wt, M, Pt, be;
|
|
1574
1571
|
const rs = class rs {
|
|
1575
1572
|
// 🎯 이제 { name: string, type: string } 객체들의 배열로 관리합니다.
|
|
1576
1573
|
constructor(s) {
|
|
@@ -1587,7 +1584,7 @@ const rs = class rs {
|
|
|
1587
1584
|
s.set(e.name, e.type);
|
|
1588
1585
|
}), p(this, M, Array.from(s, ([e, n]) => ({ name: e, type: n }))), p(this, M, t(this, M).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, M).sort((e, n) => e.name.length < n.name.length ? 1 : -1);
|
|
1589
1586
|
}, "#adjust"));
|
|
1590
|
-
d(this,
|
|
1587
|
+
d(this, be, /* @__PURE__ */ h(() => {
|
|
1591
1588
|
p(this, M, []), w.log(t(this, wt).querySelectorAll("table"));
|
|
1592
1589
|
const s = Array.from(t(this, wt).querySelectorAll("table"));
|
|
1593
1590
|
if (!(!s || s.length === 0)) {
|
|
@@ -1619,7 +1616,7 @@ const rs = class rs {
|
|
|
1619
1616
|
t(this, Pt).call(this);
|
|
1620
1617
|
}
|
|
1621
1618
|
}, "#init"));
|
|
1622
|
-
p(this, wt, s), t(this,
|
|
1619
|
+
p(this, wt, s), t(this, be).call(this);
|
|
1623
1620
|
}
|
|
1624
1621
|
// 🎯 기존에 필드 이름만 쓰던 곳들과의 호환을 위해 이름 배열만 리턴하는 메서드 유지
|
|
1625
1622
|
get() {
|
|
@@ -1641,42 +1638,42 @@ const rs = class rs {
|
|
|
1641
1638
|
return t(this, M).some((e) => e.name === s);
|
|
1642
1639
|
}
|
|
1643
1640
|
};
|
|
1644
|
-
wt = new WeakMap(), M = new WeakMap(), Pt = new WeakMap(),
|
|
1645
|
-
let
|
|
1646
|
-
var
|
|
1641
|
+
wt = new WeakMap(), M = new WeakMap(), Pt = new WeakMap(), be = new WeakMap(), h(rs, "ngFields");
|
|
1642
|
+
let He = rs;
|
|
1643
|
+
var ft, pe, ye;
|
|
1647
1644
|
const os = class os extends HTMLElement {
|
|
1648
1645
|
constructor() {
|
|
1649
1646
|
super();
|
|
1650
1647
|
//#created = false;
|
|
1651
|
-
d(this,
|
|
1652
|
-
d(this,
|
|
1653
|
-
d(this,
|
|
1654
|
-
this.fields = new
|
|
1648
|
+
d(this, ft);
|
|
1649
|
+
d(this, pe);
|
|
1650
|
+
d(this, ye, /* @__PURE__ */ h(() => {
|
|
1651
|
+
this.fields = new He(this), p(this, pe, new Ce(this)), w.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1655
1652
|
}, "#init"));
|
|
1656
|
-
this.attachShadow({ mode: "open" }), p(this,
|
|
1653
|
+
this.attachShadow({ mode: "open" }), p(this, ft, new Ie(this));
|
|
1657
1654
|
}
|
|
1658
1655
|
connectedCallback() {
|
|
1659
|
-
t(this,
|
|
1656
|
+
t(this, ye).call(this);
|
|
1660
1657
|
}
|
|
1661
1658
|
disconnectedCallback() {
|
|
1662
1659
|
w.log("NineTable disconnected.");
|
|
1663
1660
|
}
|
|
1664
1661
|
// 🎯 외부에서 grid.data.set(...) 형태로 접근할 수 있도록 데이터 매니저 오픈
|
|
1665
1662
|
get data() {
|
|
1666
|
-
return t(this,
|
|
1663
|
+
return t(this, ft).data;
|
|
1667
1664
|
}
|
|
1668
1665
|
// 🎯 행(row) 관련 제어 접근자 오픈
|
|
1669
1666
|
get row() {
|
|
1670
|
-
return t(this,
|
|
1667
|
+
return t(this, ft).row;
|
|
1671
1668
|
}
|
|
1672
1669
|
// 🎯 전체 데이터 매니저 접근 필요할 경우
|
|
1673
1670
|
get dataManager() {
|
|
1674
|
-
return t(this,
|
|
1671
|
+
return t(this, ft);
|
|
1675
1672
|
}
|
|
1676
1673
|
};
|
|
1677
|
-
|
|
1678
|
-
let
|
|
1679
|
-
customElements.get("nine-table") || customElements.define("nine-table",
|
|
1674
|
+
ft = new WeakMap(), pe = new WeakMap(), ye = new WeakMap(), h(os, "NineTable");
|
|
1675
|
+
let Me = os;
|
|
1676
|
+
customElements.get("nine-table") || customElements.define("nine-table", Me);
|
|
1680
1677
|
const qt = class qt extends HTMLElement {
|
|
1681
1678
|
// 👈 커스텀 스타일용 캐시 추가
|
|
1682
1679
|
constructor() {
|
|
@@ -1689,9 +1686,9 @@ const qt = class qt extends HTMLElement {
|
|
|
1689
1686
|
}
|
|
1690
1687
|
};
|
|
1691
1688
|
h(qt, "BasicCellElement"), E(qt, "_styleCache", /* @__PURE__ */ new Map()), E(qt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1692
|
-
let
|
|
1689
|
+
let $e = qt;
|
|
1693
1690
|
var L, Ft, x, Pe, Fe, je, Ye, Ve;
|
|
1694
|
-
const is = class is extends
|
|
1691
|
+
const is = class is extends $e {
|
|
1695
1692
|
constructor() {
|
|
1696
1693
|
super();
|
|
1697
1694
|
d(this, L);
|
|
@@ -1787,8 +1784,8 @@ const is = class is extends _e {
|
|
|
1787
1784
|
}
|
|
1788
1785
|
};
|
|
1789
1786
|
L = new WeakMap(), Ft = new WeakMap(), x = new WeakMap(), Pe = new WeakMap(), Fe = new WeakMap(), je = new WeakMap(), Ye = new WeakMap(), Ve = new WeakMap(), h(is, "CellElement");
|
|
1790
|
-
let
|
|
1791
|
-
const as = class as extends
|
|
1787
|
+
let _e = is;
|
|
1788
|
+
const as = class as extends _e {
|
|
1792
1789
|
constructor() {
|
|
1793
1790
|
super();
|
|
1794
1791
|
}
|
|
@@ -1800,16 +1797,16 @@ const as = class as extends Ne {
|
|
|
1800
1797
|
}
|
|
1801
1798
|
};
|
|
1802
1799
|
h(as, "EditableCellElement");
|
|
1803
|
-
let
|
|
1804
|
-
var jt,
|
|
1805
|
-
const ls = class ls extends
|
|
1800
|
+
let Ne = as;
|
|
1801
|
+
var jt, ut, St, Rt, me, J, Ue;
|
|
1802
|
+
const ls = class ls extends Ne {
|
|
1806
1803
|
constructor() {
|
|
1807
1804
|
super();
|
|
1808
1805
|
d(this, jt);
|
|
1809
|
-
d(this,
|
|
1806
|
+
d(this, ut);
|
|
1810
1807
|
d(this, St);
|
|
1811
1808
|
d(this, Rt);
|
|
1812
|
-
d(this,
|
|
1809
|
+
d(this, me);
|
|
1813
1810
|
d(this, J);
|
|
1814
1811
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
1815
1812
|
const e = super.refresh();
|
|
@@ -1847,7 +1844,7 @@ const ls = class ls extends De {
|
|
|
1847
1844
|
*/
|
|
1848
1845
|
d(this, Ue, /* @__PURE__ */ h((e) => {
|
|
1849
1846
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1850
|
-
if (t(this,
|
|
1847
|
+
if (t(this, ut) == "number") {
|
|
1851
1848
|
let o = [];
|
|
1852
1849
|
if (t(this, J) && Number(t(this, J)) > 0 && o.push("."), t(this, Rt) && Number(t(this, Rt)) >= 0 && o.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !o.includes(e.key) && e.preventDefault(), t(this, J) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
|
|
1853
1850
|
var n = e.target.value, r = n.indexOf(".");
|
|
@@ -1860,7 +1857,7 @@ const ls = class ls extends De {
|
|
|
1860
1857
|
t(this, St) && ninegrid.getByteLength(e.target.value) >= Number(t(this, St)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1861
1858
|
}
|
|
1862
1859
|
}, "#onKeyDown"));
|
|
1863
|
-
if (this.applyBaseStyle(), p(this,
|
|
1860
|
+
if (this.applyBaseStyle(), p(this, ut, this.getAttribute("type") || "text"), p(this, St, this.getAttribute("maxbyte")), p(this, Rt, this.getAttribute("min")), p(this, me, this.getAttribute("max")), p(this, J, this.getAttribute("scale")), !["text", "number"].includes(t(this, ut))) throw `invalid type : ${t(this, ut)}`;
|
|
1864
1861
|
}
|
|
1865
1862
|
connectedCallback() {
|
|
1866
1863
|
for (var e = [], n = 0; n < this.attributes.length; n++)
|
|
@@ -1873,8 +1870,8 @@ const ls = class ls extends De {
|
|
|
1873
1870
|
`, super.connectedCallback(), p(this, jt, this.querySelector("input"));
|
|
1874
1871
|
}
|
|
1875
1872
|
};
|
|
1876
|
-
jt = new WeakMap(),
|
|
1877
|
-
let
|
|
1873
|
+
jt = new WeakMap(), ut = new WeakMap(), St = new WeakMap(), Rt = new WeakMap(), me = new WeakMap(), J = new WeakMap(), Ue = new WeakMap(), h(ls, "CellInputText");
|
|
1874
|
+
let De = ls;
|
|
1878
1875
|
customElements.get("cell-input-text");
|
|
1879
|
-
customElements.get("cell-input") || customElements.define("cell-input",
|
|
1876
|
+
customElements.get("cell-input") || customElements.define("cell-input", De);
|
|
1880
1877
|
//# sourceMappingURL=nine-table.js.map
|