@ninebone/table 0.0.413 → 0.0.415
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 +376 -359
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +5 -5
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -5,10 +5,10 @@ var me = (x) => {
|
|
|
5
5
|
var we = (x, i, e) => i in x ? pe(x, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : x[i] = e;
|
|
6
6
|
var a = (x, i) => pe(x, "name", { value: i, configurable: !0 });
|
|
7
7
|
var v = (x, i, e) => we(x, typeof i != "symbol" ? i + "" : i, e), xe = (x, i, e) => i.has(x) || me("Cannot " + e);
|
|
8
|
-
var t = (x, i, e) => (xe(x, i, "read from private field"), e ? e.call(x) : i.get(x)),
|
|
8
|
+
var t = (x, i, e) => (xe(x, i, "read from private field"), e ? e.call(x) : i.get(x)), h = (x, i, e) => i.has(x) ? me("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(x) : i.set(x, e), g = (x, i, e, s) => (xe(x, i, "write to private field"), s ? s.call(x, e) : i.set(x, e), e);
|
|
9
9
|
var ve = (x, i, e, s) => ({
|
|
10
|
-
set _(
|
|
11
|
-
g(x, i,
|
|
10
|
+
set _(o) {
|
|
11
|
+
g(x, i, o, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
14
|
return t(x, i, s);
|
|
@@ -21,93 +21,93 @@ const re = class re extends Se.constructor {
|
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
a(re, "Trace");
|
|
24
|
-
let
|
|
25
|
-
const
|
|
26
|
-
var _, O, p,
|
|
24
|
+
let jt = re;
|
|
25
|
+
const k = new jt();
|
|
26
|
+
var _, O, p, V, Y, X, Et, U, Rt;
|
|
27
27
|
const le = class le extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
h(this, _);
|
|
31
|
+
h(this, O, !1);
|
|
32
|
+
h(this, p);
|
|
33
|
+
h(this, V);
|
|
34
|
+
h(this, Y);
|
|
35
|
+
h(this, X);
|
|
36
|
+
h(this, Et, /* @__PURE__ */ a(() => {
|
|
37
37
|
if (!t(this, _)) return;
|
|
38
38
|
const e = t(this, _).querySelector(".ng-container-body");
|
|
39
|
-
e && (g(this,
|
|
39
|
+
e && (g(this, X, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
|
-
})), t(this,
|
|
41
|
+
})), t(this, X).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
v(this, "refresh", /* @__PURE__ */ a(() => {
|
|
44
44
|
if (!t(this, _) || !t(this, p) || t(this, O)) return;
|
|
45
45
|
const e = t(this, p).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const
|
|
47
|
+
const o = t(this, p).track, r = t(this, p).thumb, n = t(this, _).querySelector(".ng-container-bottom"), l = e.clientWidth, d = s.scrollWidth;
|
|
48
48
|
if (l !== 0 && d > l)
|
|
49
|
-
|
|
49
|
+
n && (n.style.display = "flex");
|
|
50
50
|
else {
|
|
51
|
-
|
|
51
|
+
n && (n.style.display = "none");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
56
|
-
const f = Math.max(Math.min(
|
|
54
|
+
const c = o.clientWidth;
|
|
55
|
+
if (c <= 0) return;
|
|
56
|
+
const f = Math.max(Math.min(c * (l / d), c), 20);
|
|
57
57
|
r.style.width = `${f}px`;
|
|
58
58
|
const u = e.scrollLeft, b = d - l;
|
|
59
59
|
let y = 0;
|
|
60
|
-
b > 0 && (y = parseInt(u / b * (
|
|
61
|
-
const m =
|
|
62
|
-
y > m && (y = m), r.style.left = `${y}px`,
|
|
60
|
+
b > 0 && (y = parseInt(u / b * (c - f), 10)), y < 0 && (y = 0);
|
|
61
|
+
const m = c - f;
|
|
62
|
+
y > m && (y = m), r.style.left = `${y}px`, k.log(y), t(this, p).left.disabled = y === 0, t(this, p).right.disabled = y >= m - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
|
|
64
|
+
h(this, U, /* @__PURE__ */ a((e) => {
|
|
65
65
|
if (!t(this, p)) return !1;
|
|
66
|
-
const s = t(this, p).container,
|
|
67
|
-
if (!
|
|
68
|
-
const r = t(this, p).track.getBoundingClientRect(),
|
|
66
|
+
const s = t(this, p).container, o = s.querySelector("table");
|
|
67
|
+
if (!o) return !1;
|
|
68
|
+
const r = t(this, p).track.getBoundingClientRect(), n = t(this, p).thumb.clientWidth;
|
|
69
69
|
let l = e;
|
|
70
70
|
l < 0 && (l = 0);
|
|
71
|
-
const d = r.width -
|
|
71
|
+
const d = r.width - n;
|
|
72
72
|
l > d && (l = d), l = parseInt(l, 10), t(this, p).thumb.style.left = `${l}px`, t(this, p).left.disabled = l === 0, t(this, p).right.disabled = l >= d - 1;
|
|
73
|
-
const
|
|
73
|
+
const c = s.clientWidth, u = o.scrollWidth - c;
|
|
74
74
|
return d > 0 && u > 0 && (s.scrollLeft = l / d * u), l > 0 && l < d - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
|
|
77
|
-
const e = /* @__PURE__ */ a((
|
|
78
|
-
clearInterval(t(this,
|
|
76
|
+
h(this, Rt, /* @__PURE__ */ a(() => {
|
|
77
|
+
const e = /* @__PURE__ */ a((o) => {
|
|
78
|
+
clearInterval(t(this, V)), clearInterval(t(this, Y));
|
|
79
79
|
const r = parseInt(t(this, p).thumb.style.left || 0, 10);
|
|
80
|
-
t(this,
|
|
81
|
-
clearInterval(t(this,
|
|
82
|
-
const
|
|
83
|
-
t(this,
|
|
80
|
+
t(this, U).call(this, r + o), g(this, V, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, V)), g(this, Y, setInterval(() => {
|
|
82
|
+
const n = parseInt(t(this, p).thumb.style.left || 0, 10);
|
|
83
|
+
t(this, U).call(this, n + o) || clearInterval(t(this, Y));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), s = /* @__PURE__ */ a(() => {
|
|
87
|
-
clearInterval(t(this,
|
|
87
|
+
clearInterval(t(this, V)), clearInterval(t(this, Y));
|
|
88
88
|
}, "clearTimer");
|
|
89
|
-
["mouseup", "mouseleave", "touchend"].forEach((
|
|
90
|
-
t(this, p).left.addEventListener(
|
|
91
|
-
}), t(this, p).left.addEventListener("mousedown", (
|
|
92
|
-
|
|
93
|
-
}), t(this, p).right.addEventListener("mousedown", (
|
|
94
|
-
|
|
95
|
-
}), t(this, p).left.addEventListener("touchstart", () => e(-20)), t(this, p).right.addEventListener("touchstart", () => e(20)), t(this, p).track.addEventListener("mousedown", (
|
|
96
|
-
if (
|
|
97
|
-
|
|
98
|
-
const r = t(this, p).track.getBoundingClientRect(),
|
|
99
|
-
t(this,
|
|
100
|
-
}), t(this, p).thumb.addEventListener("mousedown", (
|
|
101
|
-
if (
|
|
102
|
-
|
|
89
|
+
["mouseup", "mouseleave", "touchend"].forEach((o) => {
|
|
90
|
+
t(this, p).left.addEventListener(o, s), t(this, p).right.addEventListener(o, s), t(this, p).track.addEventListener(o, s);
|
|
91
|
+
}), t(this, p).left.addEventListener("mousedown", (o) => {
|
|
92
|
+
o.button === 0 && e(-20);
|
|
93
|
+
}), t(this, p).right.addEventListener("mousedown", (o) => {
|
|
94
|
+
o.button === 0 && e(20);
|
|
95
|
+
}), t(this, p).left.addEventListener("touchstart", () => e(-20)), t(this, p).right.addEventListener("touchstart", () => e(20)), t(this, p).track.addEventListener("mousedown", (o) => {
|
|
96
|
+
if (o.button !== 0) return;
|
|
97
|
+
o.preventDefault();
|
|
98
|
+
const r = t(this, p).track.getBoundingClientRect(), n = t(this, p).thumb.clientWidth;
|
|
99
|
+
t(this, U).call(this, o.clientX - r.left - n / 2);
|
|
100
|
+
}), t(this, p).thumb.addEventListener("mousedown", (o) => {
|
|
101
|
+
if (o.button !== 0) return;
|
|
102
|
+
o.stopPropagation(), o.preventDefault(), g(this, O, !0), this.shiftX = o.clientX - t(this, p).thumb.getBoundingClientRect().left;
|
|
103
103
|
const r = /* @__PURE__ */ a((l) => {
|
|
104
104
|
if (!t(this, O)) return;
|
|
105
105
|
const d = t(this, p).track.getBoundingClientRect();
|
|
106
|
-
t(this,
|
|
107
|
-
}, "onMouseMove"),
|
|
108
|
-
g(this, O, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup",
|
|
106
|
+
t(this, U).call(this, l.clientX - d.left - this.shiftX);
|
|
107
|
+
}, "onMouseMove"), n = /* @__PURE__ */ a(() => {
|
|
108
|
+
g(this, O, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", n), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
|
-
document.addEventListener("mousemove", r), document.addEventListener("mouseup",
|
|
110
|
+
document.addEventListener("mousemove", r), document.addEventListener("mouseup", n);
|
|
111
111
|
});
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
@@ -190,61 +190,61 @@ const le = class le extends HTMLElement {
|
|
|
190
190
|
right: this.querySelector(".ng-scroll-right")
|
|
191
191
|
}), s.addEventListener("scroll", () => {
|
|
192
192
|
t(this, O) || this.refresh();
|
|
193
|
-
}), t(this,
|
|
193
|
+
}), t(this, Rt).call(this), t(this, Et).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
197
197
|
disconnectedCallback() {
|
|
198
|
-
t(this,
|
|
198
|
+
t(this, X) && t(this, X).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
_ = new WeakMap(), O = new WeakMap(), p = new WeakMap(),
|
|
201
|
+
_ = new WeakMap(), O = new WeakMap(), p = new WeakMap(), V = new WeakMap(), Y = new WeakMap(), X = new WeakMap(), Et = new WeakMap(), U = new WeakMap(), Rt = new WeakMap(), a(le, "NineTableHScrollBar");
|
|
202
202
|
let Kt = le;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Kt);
|
|
204
|
-
var
|
|
204
|
+
var F, Q, z, S, ht, dt, At;
|
|
205
205
|
const ae = class ae extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
208
|
+
h(this, F);
|
|
209
|
+
h(this, Q);
|
|
210
|
+
h(this, z, !1);
|
|
211
|
+
h(this, S);
|
|
212
|
+
h(this, ht, 0);
|
|
213
|
+
h(this, dt, 0);
|
|
214
214
|
/**
|
|
215
215
|
* 🎯 스크롤바 위치 및 썸브 크기 갱신
|
|
216
216
|
*/
|
|
217
217
|
v(this, "refresh", /* @__PURE__ */ a(() => {
|
|
218
|
-
|
|
219
|
-
const e = t(this, S).container, s = t(this, S).track,
|
|
220
|
-
if (
|
|
221
|
-
|
|
218
|
+
k.log("refresh", t(this, z)), k.log("refresh2");
|
|
219
|
+
const e = t(this, S).container, s = t(this, S).track, o = t(this, S).thumb, r = e.clientHeight, l = (t(this, F).data.get() || []).length, d = t(this, Q).getRowHeight(), c = l * d;
|
|
220
|
+
if (c <= r) {
|
|
221
|
+
o.style.display = "none", t(this, S).top.disabled = !0, t(this, S).bottom.disabled = !0;
|
|
222
222
|
return;
|
|
223
223
|
} else
|
|
224
|
-
|
|
224
|
+
o.style.display = "block";
|
|
225
225
|
const f = s.clientHeight;
|
|
226
226
|
if (f <= 0) return;
|
|
227
|
-
const u = Math.max(Math.min(f * (r /
|
|
228
|
-
|
|
229
|
-
const b = e.scrollTop, y = Math.max(
|
|
227
|
+
const u = Math.max(Math.min(f * (r / c), f), 20);
|
|
228
|
+
o.style.height = `${u}px`;
|
|
229
|
+
const b = e.scrollTop, y = Math.max(c - r, 1);
|
|
230
230
|
let m = 0;
|
|
231
231
|
y > 0 && (m = b / y * (f - u));
|
|
232
232
|
const R = f - u;
|
|
233
|
-
m < 0 && (m = 0), m > R && (m = R),
|
|
233
|
+
m < 0 && (m = 0), m > R && (m = R), o.style.top = `${m}px`, k.log("currentScrollTop", b), k.log("maxScrollTop", y), k.log("trackHeight", f), k.log("thumbHeight", u), t(this, S).top.disabled = b <= 0, t(this, S).bottom.disabled = b >= y - 1;
|
|
234
234
|
}, "refresh"));
|
|
235
|
-
|
|
235
|
+
h(this, At, /* @__PURE__ */ a(() => {
|
|
236
236
|
const e = t(this, S).container, s = /* @__PURE__ */ a(() => {
|
|
237
|
-
const r = (t(this,
|
|
238
|
-
return r *
|
|
237
|
+
const r = (t(this, F).data.get() || []).length, n = t(this, Q).getRowHeight();
|
|
238
|
+
return r * n;
|
|
239
239
|
}, "getContentHeight");
|
|
240
240
|
e.addEventListener("scroll", () => {
|
|
241
241
|
t(this, z) || this.refresh();
|
|
242
|
-
}), t(this, S).thumb.addEventListener("mousedown", (
|
|
243
|
-
if (
|
|
244
|
-
|
|
242
|
+
}), t(this, S).thumb.addEventListener("mousedown", (o) => {
|
|
243
|
+
if (o.button !== 0) return;
|
|
244
|
+
o.stopPropagation(), o.preventDefault(), g(this, z, !0), g(this, ht, o.clientY), g(this, dt, e.scrollTop);
|
|
245
245
|
const r = /* @__PURE__ */ a((l) => {
|
|
246
246
|
if (!t(this, z)) return;
|
|
247
|
-
const d = t(this, S).track.getBoundingClientRect(),
|
|
247
|
+
const d = t(this, S).track.getBoundingClientRect(), c = t(this, S).thumb.clientHeight, u = d.height - c, b = l.clientY - t(this, ht), y = e.clientHeight, m = s(), R = Math.max(m - y, 1);
|
|
248
248
|
if (u > 0 && R > 0) {
|
|
249
249
|
const J = b / u * R;
|
|
250
250
|
let at = t(this, dt) + J;
|
|
@@ -252,15 +252,15 @@ const ae = class ae extends HTMLElement {
|
|
|
252
252
|
at < 0 && (at = 0), at > ye && (at = ye), e.scrollTop = at;
|
|
253
253
|
}
|
|
254
254
|
this.refresh();
|
|
255
|
-
}, "onMouseMove"),
|
|
256
|
-
g(this, z, !1), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup",
|
|
255
|
+
}, "onMouseMove"), n = /* @__PURE__ */ a(() => {
|
|
256
|
+
g(this, z, !1), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", n), this.refresh();
|
|
257
257
|
}, "onMouseUp");
|
|
258
|
-
document.addEventListener("mousemove", r), document.addEventListener("mouseup",
|
|
259
|
-
}), t(this, S).track.addEventListener("mousedown", (
|
|
260
|
-
if (
|
|
261
|
-
const r = t(this, S).track.getBoundingClientRect(),
|
|
262
|
-
if (
|
|
263
|
-
const y = Math.max(0, Math.min(1, l /
|
|
258
|
+
document.addEventListener("mousemove", r), document.addEventListener("mouseup", n);
|
|
259
|
+
}), t(this, S).track.addEventListener("mousedown", (o) => {
|
|
260
|
+
if (o.button !== 0 || o.target === t(this, S).thumb) return;
|
|
261
|
+
const r = t(this, S).track.getBoundingClientRect(), n = t(this, S).thumb.clientHeight, l = o.clientY - r.top - n / 2, c = r.height - n, f = e.clientHeight, u = s(), b = Math.max(u - f, 1);
|
|
262
|
+
if (c > 0 && b > 0) {
|
|
263
|
+
const y = Math.max(0, Math.min(1, l / c));
|
|
264
264
|
e.scrollTop = y * b;
|
|
265
265
|
}
|
|
266
266
|
this.refresh();
|
|
@@ -272,7 +272,7 @@ const ae = class ae extends HTMLElement {
|
|
|
272
272
|
}, "#init"));
|
|
273
273
|
}
|
|
274
274
|
connectedCallback() {
|
|
275
|
-
g(this,
|
|
275
|
+
g(this, F, this.getRootNode().host), g(this, Q, this.closest("nine-table-sheet")), this.innerHTML = `
|
|
276
276
|
<style>
|
|
277
277
|
nine-table-vscrollbar {
|
|
278
278
|
display: flex;
|
|
@@ -338,7 +338,7 @@ const ae = class ae 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, F).shadowRoot.querySelector(".ng-container-body");
|
|
342
342
|
if (!s) {
|
|
343
343
|
setTimeout(e, 10);
|
|
344
344
|
return;
|
|
@@ -349,15 +349,15 @@ const ae = class ae extends HTMLElement {
|
|
|
349
349
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
350
350
|
top: this.querySelector(".ng-scroll-top"),
|
|
351
351
|
bottom: this.querySelector(".ng-scroll-bottom")
|
|
352
|
-
}), t(this,
|
|
352
|
+
}), t(this, At).call(this), this.refresh();
|
|
353
353
|
}, "initWhenReady");
|
|
354
354
|
e();
|
|
355
355
|
}
|
|
356
356
|
};
|
|
357
|
-
|
|
357
|
+
F = new WeakMap(), Q = new WeakMap(), z = new WeakMap(), S = new WeakMap(), ht = new WeakMap(), dt = new WeakMap(), At = new WeakMap(), a(ae, "NineTableVScrollBar");
|
|
358
358
|
let Zt = ae;
|
|
359
359
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Zt);
|
|
360
|
-
var
|
|
360
|
+
var Tt, tt;
|
|
361
361
|
const M = class M {
|
|
362
362
|
/**
|
|
363
363
|
* 🎯 레이아웃 내의 여러 rawTables 배열을 일괄로 받아 단일 마스터 템플릿으로 사전 컴파일합니다.
|
|
@@ -369,190 +369,200 @@ const M = class M {
|
|
|
369
369
|
* 🎯 단일 원본 테이블을 받아 기본 구조 보정 및 2차원 격자 인덱스 사전 부여 완료된 마스터 테이블 반환
|
|
370
370
|
*/
|
|
371
371
|
static compile(i) {
|
|
372
|
-
var
|
|
372
|
+
var o, r, n, l;
|
|
373
373
|
if (!i) return null;
|
|
374
374
|
const e = i.cloneNode(!0);
|
|
375
|
-
return t(
|
|
375
|
+
return t(o = M, Tt).call(o, e), t(r = M, tt).call(r, e, "thead"), t(n = M, tt).call(n, e, "tbody"), t(l = M, tt).call(l, e, "tfoot"), Array.from(e.querySelectorAll("colgroup col")).forEach((d, c) => {
|
|
376
376
|
const f = d.getAttribute("fixed");
|
|
377
|
-
f && e.querySelectorAll(`thead [data-col="${
|
|
377
|
+
f && e.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((u) => {
|
|
378
378
|
u.setAttribute("fixed", f);
|
|
379
379
|
});
|
|
380
380
|
}), e;
|
|
381
381
|
}
|
|
382
382
|
};
|
|
383
|
-
|
|
383
|
+
Tt = new WeakMap(), tt = new WeakMap(), a(M, "TableCompiler"), h(M, Tt, /* @__PURE__ */ a((i) => {
|
|
384
384
|
if (!i.querySelector("colgroup")) {
|
|
385
|
-
const e = i.querySelector("tbody tr") || i.querySelector("tr"), s = e ? e.querySelectorAll("th, td").length : 1,
|
|
386
|
-
for (let
|
|
385
|
+
const e = i.querySelector("tbody tr") || i.querySelector("tr"), s = e ? e.querySelectorAll("th, td").length : 1, o = document.createElement("colgroup"), r = Math.max(Math.floor(i.clientWidth / s), 100);
|
|
386
|
+
for (let n = 0; n < s; n++) {
|
|
387
387
|
const l = document.createElement("col");
|
|
388
|
-
l.setAttribute("width", r),
|
|
388
|
+
l.setAttribute("width", r), o.appendChild(l);
|
|
389
389
|
}
|
|
390
|
-
i.prepend(
|
|
390
|
+
i.prepend(o);
|
|
391
391
|
}
|
|
392
392
|
if (!i.querySelector("thead")) {
|
|
393
393
|
const e = document.createElement("thead"), s = i.querySelector("colgroup");
|
|
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")),
|
|
398
|
-
const s = Array.from(i.querySelectorAll(e + " tr")),
|
|
399
|
-
if (r === 0 ||
|
|
400
|
-
let
|
|
401
|
-
|
|
402
|
-
|
|
397
|
+
}, "#ensureTableStructure")), h(M, tt, /* @__PURE__ */ a((i, e) => {
|
|
398
|
+
const s = Array.from(i.querySelectorAll(e + " tr")), o = Array.from(i.querySelectorAll(e + " th," + e + " td")), r = s.length;
|
|
399
|
+
if (r === 0 || o.length === 0) return;
|
|
400
|
+
let n = 0;
|
|
401
|
+
o.forEach((d) => {
|
|
402
|
+
n += d.colSpan || 1;
|
|
403
403
|
});
|
|
404
|
-
const l = Array.from(Array(r), () => Array(
|
|
404
|
+
const l = Array.from(Array(r), () => Array(n).fill(null));
|
|
405
405
|
s.forEach((d) => {
|
|
406
|
-
const
|
|
406
|
+
const c = d.sectionRowIndex;
|
|
407
407
|
let f = 0;
|
|
408
408
|
Array.from(d.querySelectorAll("th,td")).forEach((u) => {
|
|
409
|
-
for (let m = 0; m < l[
|
|
410
|
-
if (l[
|
|
409
|
+
for (let m = 0; m < l[c].length; m++)
|
|
410
|
+
if (l[c][m] === null) {
|
|
411
411
|
f = m;
|
|
412
412
|
break;
|
|
413
413
|
}
|
|
414
414
|
const b = u.rowSpan || 1, y = u.colSpan || 1;
|
|
415
415
|
for (let m = 0; m < b; m++)
|
|
416
416
|
for (let R = 0; R < y; R++)
|
|
417
|
-
|
|
417
|
+
c + m < r && f + R < n && (l[c + m][f + R] = m === 0 && R === 0 ? "1" : "0");
|
|
418
418
|
});
|
|
419
419
|
}), s.forEach((d) => {
|
|
420
|
-
const
|
|
420
|
+
const c = d.sectionRowIndex;
|
|
421
421
|
Array.from(d.querySelectorAll("th,td")).forEach((f) => {
|
|
422
|
-
for (let u = 0; u < l[
|
|
423
|
-
if (l[
|
|
424
|
-
f.dataset.col = u, l[
|
|
422
|
+
for (let u = 0; u < l[c].length; u++)
|
|
423
|
+
if (l[c][u] === "1") {
|
|
424
|
+
f.dataset.col = u, l[c][u] = "0";
|
|
425
425
|
break;
|
|
426
426
|
}
|
|
427
427
|
});
|
|
428
428
|
});
|
|
429
429
|
}, "#resetColIndex"));
|
|
430
430
|
let Gt = M;
|
|
431
|
-
var I, w, W,
|
|
431
|
+
var I, w, W, T, D, j, B, et, qt, kt, Lt, ft, ut, Ht, Ct, gt, $t, it, bt;
|
|
432
432
|
const ce = class ce {
|
|
433
433
|
constructor(i) {
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
434
|
+
h(this, I);
|
|
435
|
+
h(this, w);
|
|
436
|
+
h(this, W, /* @__PURE__ */ new Map());
|
|
437
|
+
h(this, T, null);
|
|
438
|
+
h(this, D, null);
|
|
439
|
+
h(this, j, 0);
|
|
440
|
+
h(this, B, 40);
|
|
441
|
+
h(this, et, !1);
|
|
442
|
+
h(this, qt, 3);
|
|
443
443
|
v(this, "refresh", /* @__PURE__ */ a(() => {
|
|
444
444
|
var e;
|
|
445
445
|
const i = t(this, w).querySelector(".ng-container-body");
|
|
446
446
|
i && (t(this, ft).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,
|
|
450
|
-
const r = t(this, w).querySelector(
|
|
449
|
+
g(this, T, null), t(this, W).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
450
|
+
const r = t(this, w).querySelector(o);
|
|
451
451
|
if (!r) return;
|
|
452
|
-
const
|
|
453
|
-
if (!
|
|
454
|
-
const l =
|
|
452
|
+
const n = r.querySelector("table");
|
|
453
|
+
if (!n) return;
|
|
454
|
+
const l = n.querySelector("tbody.bindable-tbody");
|
|
455
455
|
if (!l) return;
|
|
456
|
-
const
|
|
457
|
-
t(this, W).set(
|
|
456
|
+
const c = Array.from(l.querySelectorAll("tr")).map((f) => f.cloneNode(!0));
|
|
457
|
+
t(this, W).set(o, 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) {
|
|
461
|
-
t(this,
|
|
462
|
-
let
|
|
463
|
-
const r = /* @__PURE__ */ a((
|
|
461
|
+
t(this, Lt).call(this, i), t(this, gt).call(this), t(this, ft).call(this), t(this, it).call(this, i.scrollTop);
|
|
462
|
+
let o = i.scrollTop;
|
|
463
|
+
const r = /* @__PURE__ */ a((n) => {
|
|
464
464
|
var l;
|
|
465
|
-
e && e.scrollTop !==
|
|
465
|
+
e && e.scrollTop !== n && (e.scrollTop = n), s && s.scrollTop !== n && (s.scrollTop = n), t(this, it).call(this, n), (l = t(this, w).querySelector("nine-table-vscrollbar")) == null || l.refresh();
|
|
466
466
|
}, "syncScroll");
|
|
467
467
|
i.addEventListener("scroll", () => {
|
|
468
|
-
const
|
|
469
|
-
|
|
468
|
+
const n = i.scrollTop;
|
|
469
|
+
o !== n && (o = n, r(n));
|
|
470
470
|
});
|
|
471
471
|
}
|
|
472
472
|
}, "initialize"));
|
|
473
|
-
|
|
474
|
-
|
|
473
|
+
h(this, kt, /* @__PURE__ */ a((i, e) => {
|
|
474
|
+
const s = t(this, W).get(e);
|
|
475
|
+
if (!s || s.length === 0) return;
|
|
476
|
+
const o = i.querySelector("tbody.bindable-tbody");
|
|
477
|
+
if (!o) return;
|
|
478
|
+
o.querySelectorAll("tr:not(.nodata)").forEach((l) => l.remove());
|
|
479
|
+
const r = o.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
480
|
+
for (let l = 0; l < t(this, B); l++)
|
|
481
|
+
s.forEach((d) => {
|
|
482
|
+
n.appendChild(d.cloneNode(!0));
|
|
483
|
+
});
|
|
484
|
+
r ? r.before(n) : o.appendChild(n);
|
|
475
485
|
}, "#renderRows"));
|
|
476
|
-
|
|
477
|
-
if (t(this,
|
|
478
|
-
return t(this,
|
|
486
|
+
h(this, Lt, /* @__PURE__ */ a((i) => {
|
|
487
|
+
if (t(this, T) !== null && t(this, T) > 0)
|
|
488
|
+
return t(this, T);
|
|
479
489
|
const e = t(this, W).get(".ng-container-body");
|
|
480
490
|
if (!e || e.length === 0) return 24;
|
|
481
491
|
const s = i.querySelector("tbody.bindable-tbody") || i.querySelector("tbody.bindable-tbody:last-of-type");
|
|
482
492
|
if (!s) return 24;
|
|
483
493
|
s.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
|
|
484
|
-
const
|
|
494
|
+
const o = s.querySelector("tr.nodata"), r = document.createDocumentFragment();
|
|
485
495
|
e.forEach((b) => {
|
|
486
496
|
r.appendChild(b.cloneNode(!0));
|
|
487
|
-
}),
|
|
488
|
-
const
|
|
489
|
-
(l === "none" || window.getComputedStyle(
|
|
497
|
+
}), o ? o.before(r) : s.appendChild(r);
|
|
498
|
+
const n = t(this, w), l = n.style.display, d = n.style.visibility, c = n.style.position;
|
|
499
|
+
(l === "none" || window.getComputedStyle(n).display === "none") && (n.style.display = "block", n.style.visibility = "hidden", n.style.position = "absolute");
|
|
490
500
|
let f = 0;
|
|
491
501
|
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
492
502
|
return u.forEach((b) => {
|
|
493
503
|
f += b.offsetHeight || b.getBoundingClientRect().height;
|
|
494
|
-
}), u.forEach((b) => b.remove()),
|
|
504
|
+
}), u.forEach((b) => b.remove()), n.style.display = l, n.style.visibility = d, n.style.position = c, g(this, T, f > 0 ? f : 24), t(this, ut).call(this), t(this, T);
|
|
495
505
|
}, "#measureAndCacheHeight"));
|
|
496
|
-
|
|
506
|
+
h(this, ft, /* @__PURE__ */ a(() => {
|
|
497
507
|
if (!t(this, w).querySelector(".ng-container-body")) return;
|
|
498
|
-
const s = (t(this, I).data.get() || []).length,
|
|
499
|
-
|
|
500
|
-
const l = t(this, w).querySelector(
|
|
508
|
+
const s = (t(this, I).data.get() || []).length, o = t(this, T) || 24, r = s * o;
|
|
509
|
+
k.log(`[VirtualHeight] totalCount: ${s}, rowHeight: ${o}, totalVirtualHeight: ${r}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
510
|
+
const l = t(this, w).querySelector(n), d = l == null ? void 0 : l.querySelector("table");
|
|
501
511
|
d && (d.style.height = `${r}px`);
|
|
502
512
|
});
|
|
503
513
|
}, "#updateVirtualScrollHeight"));
|
|
504
|
-
|
|
505
|
-
if ((t(this, I).data.get() || []).length, t(this,
|
|
506
|
-
const e = Math.ceil(t(this,
|
|
507
|
-
g(this,
|
|
514
|
+
h(this, ut, /* @__PURE__ */ a(() => {
|
|
515
|
+
if ((t(this, I).data.get() || []).length, t(this, j) > 0 && t(this, T) > 0) {
|
|
516
|
+
const e = Math.ceil(t(this, j) / t(this, T));
|
|
517
|
+
g(this, B, e + t(this, qt)), k.log("visibleRows:", e, "cachedRowCount:", t(this, B));
|
|
508
518
|
}
|
|
509
519
|
}, "#updateRowCount"));
|
|
510
|
-
|
|
511
|
-
var d,
|
|
520
|
+
h(this, Ht, /* @__PURE__ */ a(() => {
|
|
521
|
+
var d, c, f;
|
|
512
522
|
const i = t(this, w).querySelector(".ng-container-left table"), e = t(this, w).querySelector(".ng-container-body table"), s = t(this, w).querySelector(".ng-container-right table");
|
|
513
523
|
if (!e) return;
|
|
514
|
-
const
|
|
524
|
+
const o = i ? Array.from(i.querySelectorAll("tr")) : [], r = Array.from(e.querySelectorAll("tr")), n = s ? Array.from(s.querySelectorAll("tr")) : [], l = Math.max(o.length, r.length, n.length);
|
|
515
525
|
for (let u = 0; u < l; u++) {
|
|
516
526
|
const b = [
|
|
517
|
-
((d =
|
|
518
|
-
((
|
|
519
|
-
((f =
|
|
527
|
+
((d = o[u]) == null ? void 0 : d.getBoundingClientRect().height) || 0,
|
|
528
|
+
((c = r[u]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
529
|
+
((f = n[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
520
530
|
], y = Math.max(...b);
|
|
521
|
-
y > 0 && (
|
|
531
|
+
y > 0 && (o[u] && (o[u].style.height = `${y}px`), r[u] && (r[u].style.height = `${y}px`), n[u] && (n[u].style.height = `${y}px`));
|
|
522
532
|
}
|
|
523
533
|
}, "#syncRowHeights"));
|
|
524
|
-
|
|
525
|
-
!t(this, w) || !(t(this, w) instanceof HTMLElement) || (g(this,
|
|
534
|
+
h(this, Ct, /* @__PURE__ */ a(() => {
|
|
535
|
+
!t(this, w) || !(t(this, w) instanceof HTMLElement) || (g(this, D, new ResizeObserver((i) => {
|
|
526
536
|
for (const e of i) {
|
|
527
537
|
const s = e.target;
|
|
528
538
|
if (!s.classList.contains("active")) continue;
|
|
529
|
-
const
|
|
530
|
-
if (
|
|
539
|
+
const o = e.contentRect.height;
|
|
540
|
+
if (o > 0) {
|
|
531
541
|
let r = 0;
|
|
532
|
-
const
|
|
533
|
-
|
|
534
|
-
const l = Math.max(
|
|
535
|
-
t(this,
|
|
542
|
+
const n = s.querySelector("thead");
|
|
543
|
+
n && (r += n.offsetHeight || n.getBoundingClientRect().height);
|
|
544
|
+
const l = Math.max(o - r, 100);
|
|
545
|
+
t(this, j) !== l && (g(this, j, l), t(this, ut).call(this), t(this, T) !== null && t(this, gt).call(this));
|
|
536
546
|
}
|
|
537
547
|
}
|
|
538
|
-
})), t(this,
|
|
548
|
+
})), t(this, D).observe(t(this, w)));
|
|
539
549
|
}, "#initResizeObserver"));
|
|
540
|
-
|
|
550
|
+
h(this, gt, /* @__PURE__ */ a(() => {
|
|
541
551
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
542
552
|
const e = t(this, w).querySelector(i);
|
|
543
553
|
e && e.querySelector("tbody.bindable-tbody") && t(this, kt).call(this, e, i);
|
|
544
|
-
}), t(this,
|
|
554
|
+
}), t(this, Ht).call(this);
|
|
545
555
|
}, "#renderAllContainers"));
|
|
546
|
-
|
|
556
|
+
h(this, $t, /* @__PURE__ */ a((i) => {
|
|
547
557
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
548
|
-
var
|
|
558
|
+
var c;
|
|
549
559
|
const s = t(this, w).querySelector(e);
|
|
550
560
|
if (!s) return;
|
|
551
|
-
const
|
|
552
|
-
if (!
|
|
553
|
-
const r = Array.from(
|
|
561
|
+
const o = s.querySelector("tbody.bindable-tbody");
|
|
562
|
+
if (!o) return;
|
|
563
|
+
const r = Array.from(o.querySelectorAll("tr:not(.nodata)")), n = ((c = t(this, W).get(e)) == null ? void 0 : c.length) || 1, d = (t(this, I).data.get() || []).length;
|
|
554
564
|
r.forEach((f, u) => {
|
|
555
|
-
const b = i + Math.floor(u /
|
|
565
|
+
const b = i + Math.floor(u / n);
|
|
556
566
|
if (b >= d) {
|
|
557
567
|
f.style.display = "none";
|
|
558
568
|
return;
|
|
@@ -562,19 +572,19 @@ const ce = class ce {
|
|
|
562
572
|
});
|
|
563
573
|
});
|
|
564
574
|
}, "#adjustBufferRows"));
|
|
565
|
-
|
|
575
|
+
h(this, it, /* @__PURE__ */ a((i) => {
|
|
566
576
|
var d;
|
|
567
|
-
const e = t(this,
|
|
577
|
+
const e = t(this, T);
|
|
568
578
|
if (!e || e <= 0) return;
|
|
569
|
-
const
|
|
570
|
-
|
|
571
|
-
const f = t(this, w).querySelector(
|
|
579
|
+
const o = (t(this, I).data.get() || []).length, r = Math.max(0, Math.floor(i / e)), n = ((d = t(this, W).get(".ng-container-body")) == null ? void 0 : d.length) || 1, l = r + t(this, B);
|
|
580
|
+
k.log(`[Scroll] scrollTop: ${i}, startIndex: ${r}, cachedRowCount: ${t(this, B)}, targetDataIndex range: ${r} ~ ${l} (Total: ${o})`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((c) => {
|
|
581
|
+
const f = t(this, w).querySelector(c);
|
|
572
582
|
if (!f) return;
|
|
573
583
|
const u = f.querySelector("tbody.bindable-tbody");
|
|
574
584
|
if (!u) return;
|
|
575
585
|
Array.from(u.querySelectorAll("tr:not(.nodata)")).forEach((y, m) => {
|
|
576
|
-
const R = r + Math.floor(m /
|
|
577
|
-
if (R >=
|
|
586
|
+
const R = r + Math.floor(m / n);
|
|
587
|
+
if (R >= o) {
|
|
578
588
|
y.style.display = "none";
|
|
579
589
|
return;
|
|
580
590
|
}
|
|
@@ -582,97 +592,104 @@ const ce = class ce {
|
|
|
582
592
|
y.style.display = "", t(this, bt).call(this, y, J, R);
|
|
583
593
|
});
|
|
584
594
|
}), t(this, et) || (g(this, et, !0), setTimeout(() => {
|
|
585
|
-
t(this,
|
|
595
|
+
t(this, $t).call(this, r), g(this, et, !1);
|
|
586
596
|
}, 0));
|
|
587
597
|
}, "#handleScroll"));
|
|
588
|
-
|
|
589
|
-
i.dataset.row = s, Array.from(i.cells).forEach((
|
|
590
|
-
const
|
|
591
|
-
|
|
598
|
+
h(this, bt, /* @__PURE__ */ a((i, e, s) => {
|
|
599
|
+
i.dataset.row = s, Array.from(i.cells).forEach((o, r) => {
|
|
600
|
+
const n = o.dataset.bind;
|
|
601
|
+
n && e && e[n] !== void 0 ? o.textContent = e[n] : o.textContent = e ? e[Object.keys(e)[r]] ?? `R${s}C${r}` : `행 ${s + 1}`, o.dataset.row = s;
|
|
592
602
|
});
|
|
593
603
|
}, "#bindRowData"));
|
|
594
604
|
v(this, "destroy", /* @__PURE__ */ a(() => {
|
|
595
|
-
t(this,
|
|
605
|
+
t(this, D) && (t(this, D).disconnect(), g(this, D, null));
|
|
596
606
|
}, "destroy"));
|
|
597
|
-
g(this, I, i.getRootNode().host), g(this, w, i), t(this,
|
|
607
|
+
g(this, I, i.getRootNode().host), g(this, w, i), t(this, Ct).call(this);
|
|
598
608
|
}
|
|
599
609
|
getRowHeight() {
|
|
600
|
-
return t(this,
|
|
610
|
+
return t(this, T);
|
|
601
611
|
}
|
|
602
612
|
templateLength(i = ".ng-container-body") {
|
|
603
613
|
var e;
|
|
604
614
|
return ((e = t(this, W).get(i)) == null ? void 0 : e.length) || 1;
|
|
605
615
|
}
|
|
606
616
|
};
|
|
607
|
-
I = new WeakMap(), w = new WeakMap(), W = new WeakMap(),
|
|
617
|
+
I = new WeakMap(), w = new WeakMap(), W = new WeakMap(), T = new WeakMap(), D = new WeakMap(), j = new WeakMap(), B = new WeakMap(), et = new WeakMap(), qt = new WeakMap(), kt = new WeakMap(), Lt = new WeakMap(), ft = new WeakMap(), ut = new WeakMap(), Ht = new WeakMap(), Ct = new WeakMap(), gt = new WeakMap(), $t = new WeakMap(), it = new WeakMap(), bt = new WeakMap(), a(ce, "RowManager");
|
|
608
618
|
let Jt = ce;
|
|
609
|
-
var
|
|
619
|
+
var yt, st, N, Mt, _t, It, Wt, Ot;
|
|
610
620
|
const ct = class ct extends HTMLElement {
|
|
611
621
|
constructor() {
|
|
612
622
|
super();
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
623
|
+
h(this, yt);
|
|
624
|
+
h(this, st, null);
|
|
625
|
+
h(this, N);
|
|
616
626
|
/**
|
|
617
627
|
* data.set, add, delete
|
|
618
628
|
* filter, sorting : 고려대상
|
|
619
629
|
*/
|
|
620
630
|
v(this, "invalidate", /* @__PURE__ */ a(() => {
|
|
621
|
-
t(this,
|
|
631
|
+
t(this, N).refresh();
|
|
622
632
|
}, "invalidate"));
|
|
623
|
-
|
|
633
|
+
h(this, Mt, /* @__PURE__ */ a(() => {
|
|
624
634
|
[
|
|
625
635
|
{ selector: ".ng-container-body", type: null },
|
|
626
636
|
{ selector: ".ng-container-left", type: "left" },
|
|
627
637
|
{ selector: ".ng-container-right", type: "right" }
|
|
628
|
-
].forEach(({ selector: s, type:
|
|
638
|
+
].forEach(({ selector: s, type: o }) => {
|
|
629
639
|
const r = this.querySelector(s);
|
|
630
640
|
if (!r) return;
|
|
631
|
-
const
|
|
632
|
-
r.innerHTML = "", r.appendChild(
|
|
641
|
+
const n = t(this, It).call(this, t(this, st), o);
|
|
642
|
+
r.innerHTML = "", r.appendChild(n);
|
|
633
643
|
});
|
|
634
644
|
}, "#renderSplitContainers"));
|
|
635
|
-
|
|
645
|
+
h(this, _t, /* @__PURE__ */ a(() => {
|
|
636
646
|
["left", "right"].forEach((e) => {
|
|
637
|
-
const s = this.querySelector(`.ng-container-${e}`),
|
|
638
|
-
if (!s || !
|
|
647
|
+
const s = this.querySelector(`.ng-container-${e}`), o = s == null ? void 0 : s.querySelector("table");
|
|
648
|
+
if (!s || !o) return;
|
|
639
649
|
let r = 0;
|
|
640
|
-
|
|
641
|
-
const l = parseInt(
|
|
650
|
+
o.querySelectorAll("col").forEach((n) => {
|
|
651
|
+
const l = parseInt(n.getAttribute("width"), 10);
|
|
642
652
|
isNaN(r) || (r += l);
|
|
643
653
|
}), s.style.flex = `0 0 ${r}px`, s.style.width = `${r}px`;
|
|
644
654
|
});
|
|
645
655
|
}, "#updateContainerWidths"));
|
|
646
656
|
v(this, "generate", /* @__PURE__ */ a((e) => {
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
657
|
+
var l, d;
|
|
658
|
+
if (!e) return;
|
|
659
|
+
g(this, st, Gt.compile(e)), t(this, st).style.display = "table", t(this, Mt).call(this), t(this, _t).call(this), requestAnimationFrame(() => {
|
|
660
|
+
var f;
|
|
661
|
+
const c = (f = this.querySelector("thead")) == null ? void 0 : f.getBoundingClientRect().height;
|
|
662
|
+
this.querySelectorAll("tbody.fixed-tbody").forEach((u) => {
|
|
663
|
+
u.style.top = `${c}px`;
|
|
652
664
|
});
|
|
653
|
-
}), t(this,
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
665
|
+
}), t(this, N).initialize();
|
|
666
|
+
const o = (((d = (l = t(this, yt)) == null ? void 0 : l.data) == null ? void 0 : d.get()) || []).length, r = t(this, N).getRowHeight(), n = o * r;
|
|
667
|
+
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((c) => {
|
|
668
|
+
const f = this.querySelector(c), u = f == null ? void 0 : f.querySelector("table");
|
|
669
|
+
u && (u.style.height = `${n}px`, u.style.minHeight = `${n}px`);
|
|
670
|
+
}), setTimeout(() => {
|
|
671
|
+
var c;
|
|
672
|
+
(c = this.querySelector("nine-table-hscrollbar")) == null || c.refresh();
|
|
673
|
+
}, 0);
|
|
657
674
|
}, "generate"));
|
|
658
675
|
/**
|
|
659
676
|
* 🎯 마스터 테이블을 기반으로 특정 fixed 타입 영역만 남기는 분할 헬퍼
|
|
660
677
|
*/
|
|
661
|
-
|
|
662
|
-
const
|
|
678
|
+
h(this, It, /* @__PURE__ */ a((e, s) => {
|
|
679
|
+
const o = e.cloneNode(!0), r = o.querySelector("tbody");
|
|
663
680
|
if (r) {
|
|
664
|
-
const
|
|
665
|
-
|
|
681
|
+
const n = document.createElement("tbody");
|
|
682
|
+
n.className = "fixed-tbody", r.className = "bindable-tbody", r.before(n);
|
|
666
683
|
}
|
|
667
|
-
return s === "left" ?
|
|
668
|
-
|
|
669
|
-
}) : s === "right" ?
|
|
670
|
-
|
|
671
|
-
}) :
|
|
672
|
-
|
|
673
|
-
}),
|
|
684
|
+
return s === "left" ? o.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((n) => {
|
|
685
|
+
n.getAttribute("fixed") !== "left" && n.remove();
|
|
686
|
+
}) : s === "right" ? o.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((n) => {
|
|
687
|
+
n.getAttribute("fixed") !== "right" && n.remove();
|
|
688
|
+
}) : o.querySelectorAll("[fixed=left], [fixed=right]").forEach((n) => {
|
|
689
|
+
n.remove();
|
|
690
|
+
}), o;
|
|
674
691
|
}, "#createSplitTable"));
|
|
675
|
-
v(this, "getRowHeight", /* @__PURE__ */ a(() => t(this,
|
|
692
|
+
v(this, "getRowHeight", /* @__PURE__ */ a(() => t(this, N).getRowHeight(), "getRowHeight"));
|
|
676
693
|
v(this, "scrollToX", /* @__PURE__ */ a((e) => {
|
|
677
694
|
const s = this.querySelector(".ng-container-body");
|
|
678
695
|
s && (s.scrollLeft = e);
|
|
@@ -681,10 +698,10 @@ const ct = class ct extends HTMLElement {
|
|
|
681
698
|
const s = this.querySelector(".ng-container-body");
|
|
682
699
|
s && (s.scrollTop = e);
|
|
683
700
|
}, "scrollToY"));
|
|
684
|
-
|
|
701
|
+
h(this, Wt, /* @__PURE__ */ a(() => {
|
|
685
702
|
t(this, Ot).call(this);
|
|
686
703
|
}, "#init"));
|
|
687
|
-
|
|
704
|
+
h(this, Ot, /* @__PURE__ */ a(() => {
|
|
688
705
|
const e = ct.SCROLLBAR_SIZE;
|
|
689
706
|
this.innerHTML = `
|
|
690
707
|
<style>
|
|
@@ -831,32 +848,32 @@ const ct = class ct extends HTMLElement {
|
|
|
831
848
|
</div>
|
|
832
849
|
`;
|
|
833
850
|
}, "#render"));
|
|
834
|
-
g(this,
|
|
851
|
+
g(this, N, new Jt(this)), g(this, yt, this.getRootNode().host);
|
|
835
852
|
}
|
|
836
853
|
connectedCallback() {
|
|
837
854
|
t(this, Wt).call(this);
|
|
838
855
|
}
|
|
839
856
|
disconnectedCallback() {
|
|
840
|
-
this.innerHTML = "",
|
|
857
|
+
this.innerHTML = "", k.log("NineTableSheet destroyed.");
|
|
841
858
|
}
|
|
842
859
|
};
|
|
843
|
-
|
|
844
|
-
let
|
|
845
|
-
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet",
|
|
846
|
-
var zt,
|
|
860
|
+
yt = new WeakMap(), st = new WeakMap(), N = new WeakMap(), Mt = new WeakMap(), _t = new WeakMap(), It = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), a(ct, "NineTableSheet"), v(ct, "SCROLLBAR_SIZE", 16);
|
|
861
|
+
let St = ct;
|
|
862
|
+
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", St);
|
|
863
|
+
var zt, pt;
|
|
847
864
|
const he = class he extends HTMLElement {
|
|
848
865
|
constructor() {
|
|
849
866
|
super();
|
|
850
|
-
|
|
867
|
+
h(this, zt, /* @__PURE__ */ a(() => {
|
|
851
868
|
var e;
|
|
852
869
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
853
|
-
var
|
|
854
|
-
const
|
|
855
|
-
t(this,
|
|
856
|
-
}), t(this,
|
|
870
|
+
var n;
|
|
871
|
+
const o = s.ctrlKey || s.metaKey || s.shiftKey, r = parseInt((n = s.target.closest(".nine-tab-item")) == null ? void 0 : n.dataset.index, 10);
|
|
872
|
+
t(this, pt).call(this, r, o);
|
|
873
|
+
}), t(this, pt).call(this, 0, !1);
|
|
857
874
|
}, "#init"));
|
|
858
|
-
|
|
859
|
-
const
|
|
875
|
+
h(this, pt, /* @__PURE__ */ a((e, s = !1) => {
|
|
876
|
+
const o = /* @__PURE__ */ a(() => {
|
|
860
877
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
861
878
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((y) => y.style.setProperty("display", "none"));
|
|
862
879
|
const b = f.filter((y) => y.classList.contains("active"));
|
|
@@ -864,7 +881,7 @@ const he = class he extends HTMLElement {
|
|
|
864
881
|
const m = parseInt(y.getAttribute("data-index"), 10), R = this.querySelector(`nine-splitter[data-split-index="${m}"]`), J = f[m + 1];
|
|
865
882
|
R && J && J.classList.contains("active") && R.style.setProperty("display", "flex");
|
|
866
883
|
});
|
|
867
|
-
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"),
|
|
884
|
+
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), n = this.querySelector("nine-table-sheets-body"), l = r.querySelectorAll(".nine-tab-item"), d = n.querySelectorAll("nine-table-sheet");
|
|
868
885
|
if (!l[e]) return;
|
|
869
886
|
if (!s)
|
|
870
887
|
l.forEach((f, u) => {
|
|
@@ -878,44 +895,44 @@ const he = class he extends HTMLElement {
|
|
|
878
895
|
if (f.classList.contains("active") && u.length <= 1)
|
|
879
896
|
return;
|
|
880
897
|
f.classList.toggle("active");
|
|
881
|
-
const b =
|
|
898
|
+
const b = n.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
882
899
|
b && (b.classList.toggle("active"), b.classList.contains("active") || (b.style.flex = ""));
|
|
883
900
|
}
|
|
884
|
-
const
|
|
885
|
-
|
|
886
|
-
f.style.flex =
|
|
887
|
-
}),
|
|
901
|
+
const c = n.querySelectorAll("nine-table-sheet.active");
|
|
902
|
+
c == null || c.forEach((f) => {
|
|
903
|
+
f.style.flex = c.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
904
|
+
}), o();
|
|
888
905
|
}, "#switchSheet"));
|
|
889
906
|
}
|
|
890
907
|
connectedCallback() {
|
|
891
908
|
t(this, zt).call(this);
|
|
892
909
|
}
|
|
893
910
|
};
|
|
894
|
-
zt = new WeakMap(),
|
|
911
|
+
zt = new WeakMap(), pt = new WeakMap(), a(he, "NineTableSheets");
|
|
895
912
|
let Qt = he;
|
|
896
913
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", Qt);
|
|
897
|
-
var q,
|
|
914
|
+
var q, Dt, mt, Bt;
|
|
898
915
|
const de = class de {
|
|
899
916
|
constructor(i) {
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
t(this,
|
|
917
|
+
h(this, q);
|
|
918
|
+
h(this, Dt, /* @__PURE__ */ a(() => {
|
|
919
|
+
t(this, Bt).call(this), new ResizeObserver((i) => {
|
|
903
920
|
for (let e of i)
|
|
904
|
-
t(this, q).getAttribute("auto-height") === "true" && t(this,
|
|
921
|
+
t(this, q).getAttribute("auto-height") === "true" && t(this, mt).call(this);
|
|
905
922
|
}).observe(t(this, q));
|
|
906
923
|
}, "#init"));
|
|
907
|
-
|
|
908
|
-
var d,
|
|
924
|
+
h(this, mt, /* @__PURE__ */ a(() => {
|
|
925
|
+
var d, c;
|
|
909
926
|
const i = Array.from(t(this, q).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
910
927
|
if (i.length === 0) return;
|
|
911
|
-
const e = parseInt(t(this, q).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())),
|
|
928
|
+
const e = parseInt(t(this, q).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), o = (d = t(this, q).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : d.getBoundingClientRect().height, r = (c = t(this, q).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : c.getBoundingClientRect().height, n = St.SCROLLBAR_SIZE, l = e * s + o + r + n;
|
|
912
929
|
t(this, q).style.height = `${l}px`;
|
|
913
930
|
}, "#applyAutoHeight"));
|
|
914
|
-
|
|
915
|
-
const e = Array.from(t(this, q).children).filter((d) => d.tagName === "TABLE"), s = t(this, q).getAttribute("auto-height") === "true",
|
|
916
|
-
const u = `<nine-table-sheet class="${
|
|
931
|
+
h(this, Bt, /* @__PURE__ */ a(() => {
|
|
932
|
+
const e = Array.from(t(this, q).children).filter((d) => d.tagName === "TABLE"), s = t(this, q).getAttribute("auto-height") === "true", o = e.length, r = e.map((d, c) => {
|
|
933
|
+
const u = `<nine-table-sheet class="${c === 0 ? "active" : ""}" data-index="${c}"></nine-table-sheet>`, b = c < o - 1 ? `<nine-splitter class="h" data-split-index="${c}"></nine-splitter>` : "";
|
|
917
934
|
return u + b;
|
|
918
|
-
}).join(""),
|
|
935
|
+
}).join(""), n = e.map((d, c) => `<div class="nine-tab-item ${c === 0 ? "active" : ""}" data-index="${c}">Sheet ${c + 1}</div>`).join("");
|
|
919
936
|
t(this, q).shadowRoot.innerHTML = `
|
|
920
937
|
<style>
|
|
921
938
|
:host {
|
|
@@ -999,7 +1016,7 @@ const de = class de {
|
|
|
999
1016
|
<nine-table-sheets>
|
|
1000
1017
|
<nine-table-sheets-body>${r}</nine-table-sheets-body>
|
|
1001
1018
|
<nine-table-sheets-footer>
|
|
1002
|
-
<div class="nine-tab-bar">${
|
|
1019
|
+
<div class="nine-tab-bar">${n}</div>
|
|
1003
1020
|
<div class="sheets-counter">Total : <span id="row-count">0</span></div>
|
|
1004
1021
|
</nine-table-sheets-footer>
|
|
1005
1022
|
</nine-table-sheets>
|
|
@@ -1008,24 +1025,24 @@ const de = class de {
|
|
|
1008
1025
|
<nine-table-footer></nine-table-footer>
|
|
1009
1026
|
`;
|
|
1010
1027
|
const l = t(this, q).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1011
|
-
l == null || l.forEach((d,
|
|
1012
|
-
e[
|
|
1013
|
-
d.generate(e[
|
|
1028
|
+
l == null || l.forEach((d, c) => {
|
|
1029
|
+
e[c] && setTimeout(() => {
|
|
1030
|
+
d.generate(e[c]), s && t(this, mt).call(this);
|
|
1014
1031
|
});
|
|
1015
1032
|
});
|
|
1016
1033
|
}, "#render"));
|
|
1017
|
-
g(this, q, i), t(this,
|
|
1034
|
+
g(this, q, i), t(this, Dt).call(this);
|
|
1018
1035
|
}
|
|
1019
1036
|
};
|
|
1020
|
-
q = new WeakMap(),
|
|
1037
|
+
q = new WeakMap(), Dt = new WeakMap(), mt = new WeakMap(), Bt = new WeakMap(), a(de, "LayoutManager");
|
|
1021
1038
|
let te = de;
|
|
1022
|
-
var
|
|
1039
|
+
var xt, nt;
|
|
1023
1040
|
const fe = class fe {
|
|
1024
1041
|
constructor(i) {
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
v(this, "count", /* @__PURE__ */ a(() => t(this,
|
|
1028
|
-
g(this,
|
|
1042
|
+
h(this, xt);
|
|
1043
|
+
h(this, nt, -1);
|
|
1044
|
+
v(this, "count", /* @__PURE__ */ a(() => t(this, xt).rawRecords.length, "count"));
|
|
1045
|
+
g(this, xt, i);
|
|
1029
1046
|
}
|
|
1030
1047
|
get at() {
|
|
1031
1048
|
return t(this, nt);
|
|
@@ -1035,28 +1052,28 @@ const fe = class fe {
|
|
|
1035
1052
|
});
|
|
1036
1053
|
}
|
|
1037
1054
|
};
|
|
1038
|
-
|
|
1055
|
+
xt = new WeakMap(), nt = new WeakMap(), a(fe, "ngRow");
|
|
1039
1056
|
let ee = fe;
|
|
1040
|
-
var L, E, H, ot, Nt,
|
|
1057
|
+
var L, E, H, ot, Nt, P, Pt, K, vt, Vt, Yt, rt;
|
|
1041
1058
|
const C = class C {
|
|
1042
1059
|
constructor(i, e) {
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
g(this,
|
|
1060
|
+
h(this, L);
|
|
1061
|
+
h(this, E);
|
|
1062
|
+
h(this, H, []);
|
|
1063
|
+
h(this, ot, []);
|
|
1064
|
+
h(this, Nt, 0);
|
|
1065
|
+
h(this, P, []);
|
|
1066
|
+
h(this, Pt, /* @__PURE__ */ a(() => {
|
|
1067
|
+
g(this, P, []);
|
|
1051
1068
|
const i = t(this, L).template || [];
|
|
1052
1069
|
Array.from(i).forEach((e) => {
|
|
1053
1070
|
var s;
|
|
1054
|
-
t(this,
|
|
1071
|
+
t(this, P).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1055
1072
|
}), (t(this, E).rawRecords || []).forEach((e) => {
|
|
1056
|
-
e.__ng || (e.__ng = t(this,
|
|
1073
|
+
e.__ng || (e.__ng = t(this, vt).call(this)), e.__ng.height = t(this, P).slice();
|
|
1057
1074
|
});
|
|
1058
1075
|
}, "#initialize"));
|
|
1059
|
-
|
|
1076
|
+
h(this, K, /* @__PURE__ */ a(() => {
|
|
1060
1077
|
t(this, L).shadowRoot.querySelectorAll("nine-table-sheet").forEach((i) => {
|
|
1061
1078
|
i.invalidate();
|
|
1062
1079
|
});
|
|
@@ -1067,24 +1084,24 @@ const C = class C {
|
|
|
1067
1084
|
if (!s || s.length <= 0) return;
|
|
1068
1085
|
if (i == null) return t(this, rt).call(this, s);
|
|
1069
1086
|
if (i < 0 || i >= s.length) return null;
|
|
1070
|
-
const
|
|
1087
|
+
const o = typeof ((r = t(this, L).fields) == null ? void 0 : r.get) == "function" ? t(this, L).fields.get() : [];
|
|
1071
1088
|
if (e != null) {
|
|
1072
|
-
const
|
|
1073
|
-
return
|
|
1089
|
+
const n = o.indexOf(e);
|
|
1090
|
+
return n >= 0 ? s[i].v[n] : null;
|
|
1074
1091
|
}
|
|
1075
1092
|
return t(this, rt).call(this, s[i]);
|
|
1076
1093
|
}, "get"));
|
|
1077
1094
|
v(this, "set", /* @__PURE__ */ a((i) => {
|
|
1078
1095
|
this.clear(), this.add(i, !1), t(this, K).call(this);
|
|
1079
1096
|
}, "set"));
|
|
1080
|
-
|
|
1097
|
+
h(this, vt, /* @__PURE__ */ a(() => ({
|
|
1081
1098
|
rowState: C.ROW_STATE.EMPTY,
|
|
1082
1099
|
deleted: !1,
|
|
1083
1100
|
filtered: !1,
|
|
1084
|
-
height: t(this,
|
|
1101
|
+
height: t(this, P).slice(),
|
|
1085
1102
|
o: {},
|
|
1086
1103
|
c: {},
|
|
1087
|
-
_: [0, 0, 0, 0, C.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this,
|
|
1104
|
+
_: [0, 0, 0, 0, C.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, P).slice(), -1, {}, {}]
|
|
1088
1105
|
}), "#getDefaultMeta"));
|
|
1089
1106
|
v(this, "reset", /* @__PURE__ */ a(() => {
|
|
1090
1107
|
g(this, H, []), g(this, ot, []), t(this, K).call(this);
|
|
@@ -1093,37 +1110,37 @@ const C = class C {
|
|
|
1093
1110
|
var i;
|
|
1094
1111
|
t(this, E).rawRecords = [], g(this, H, []), g(this, ot, []), (i = t(this, E).viewRecords) != null && i.reset && t(this, E).viewRecords.reset();
|
|
1095
1112
|
}, "clear"));
|
|
1096
|
-
|
|
1097
|
-
var
|
|
1113
|
+
h(this, Vt, /* @__PURE__ */ a((i) => {
|
|
1114
|
+
var o;
|
|
1098
1115
|
Array.isArray(i) || (i = [i]);
|
|
1099
|
-
const e = typeof ((
|
|
1116
|
+
const e = typeof ((o = t(this, L).fields) == null ? void 0 : o.get) == "function" ? t(this, L).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
1100
1117
|
return i.forEach((r) => {
|
|
1101
|
-
const
|
|
1118
|
+
const n = { v: [] };
|
|
1102
1119
|
e.forEach((l) => {
|
|
1103
|
-
|
|
1104
|
-
}), s.push(
|
|
1120
|
+
n.v.push(r[l] !== void 0 && r[l] !== null ? r[l] : "");
|
|
1121
|
+
}), s.push(n);
|
|
1105
1122
|
}), s;
|
|
1106
1123
|
}, "#json2Array"));
|
|
1107
|
-
|
|
1108
|
-
e.__ng = t(this,
|
|
1124
|
+
h(this, Yt, /* @__PURE__ */ a((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1125
|
+
e.__ng = t(this, vt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = C.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1109
1126
|
}), i), "#defaultInsert"));
|
|
1110
1127
|
v(this, "add", /* @__PURE__ */ a((i, e = !0) => {
|
|
1111
1128
|
i === void 0 && (i = {});
|
|
1112
1129
|
const s = t(this, Vt).call(this, i);
|
|
1113
1130
|
t(this, E).rawRecords = t(this, E).rawRecords.concat(t(this, Yt).call(this, s)), this.resetRecords();
|
|
1114
|
-
const
|
|
1115
|
-
return e || s.forEach((r,
|
|
1116
|
-
const l = t(this, E).rawRecords[
|
|
1131
|
+
const o = this.count() - 1;
|
|
1132
|
+
return e || s.forEach((r, n) => {
|
|
1133
|
+
const l = t(this, E).rawRecords[o - n];
|
|
1117
1134
|
l && (l.__ng.rowState = C.ROW_STATE.EMPTY);
|
|
1118
|
-
}), t(this, K).call(this),
|
|
1135
|
+
}), t(this, K).call(this), o;
|
|
1119
1136
|
}, "add"));
|
|
1120
1137
|
v(this, "delete", /* @__PURE__ */ a((i) => {
|
|
1121
1138
|
let e = [];
|
|
1122
|
-
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this, E).host.row.at] : e = [parseInt(i, 10)], e.sort((s,
|
|
1139
|
+
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this, E).host.row.at] : e = [parseInt(i, 10)], e.sort((s, o) => o - s).forEach((s) => {
|
|
1123
1140
|
if (t(this, H)[s]) {
|
|
1124
|
-
const
|
|
1125
|
-
t(this, H)[s].__ng.rowState === C.ROW_STATE.INSERT ? t(this, E).rawRecords = t(this, E).rawRecords.filter((r) => r.__ng.rowid !==
|
|
1126
|
-
r.__ng.rowid ===
|
|
1141
|
+
const o = t(this, H)[s].__ng.rowid;
|
|
1142
|
+
t(this, H)[s].__ng.rowState === C.ROW_STATE.INSERT ? t(this, E).rawRecords = t(this, E).rawRecords.filter((r) => r.__ng.rowid !== o) : t(this, E).rawRecords.forEach((r) => {
|
|
1143
|
+
r.__ng.rowid === o && (r.__ng.deleted = !0, r.__ng.rowState = C.ROW_STATE.DELETE);
|
|
1127
1144
|
});
|
|
1128
1145
|
}
|
|
1129
1146
|
}), this.resetRecords(), t(this, K).call(this);
|
|
@@ -1133,10 +1150,10 @@ const C = class C {
|
|
|
1133
1150
|
i = parseInt(i, 10);
|
|
1134
1151
|
const r = (typeof ((d = t(this, L).fields) == null ? void 0 : d.get) == "function" ? t(this, L).fields.get() : []).indexOf(e);
|
|
1135
1152
|
if (r < 0) return;
|
|
1136
|
-
const
|
|
1137
|
-
if (!
|
|
1138
|
-
const l =
|
|
1139
|
-
l !== s &&
|
|
1153
|
+
const n = this.getValidData()[i];
|
|
1154
|
+
if (!n) return;
|
|
1155
|
+
const l = n.v[r];
|
|
1156
|
+
l !== s && n.__ng.rowState !== C.ROW_STATE.INSERT && (n.__ng.o.hasOwnProperty(e) || (n.__ng.o[e] = l), n.__ng.rowState = C.ROW_STATE.UPDATE), n.v[r] = s;
|
|
1140
1157
|
}, "setValue"));
|
|
1141
1158
|
v(this, "resetRecords", /* @__PURE__ */ a(() => {
|
|
1142
1159
|
g(this, ot, t(this, E).rawRecords.filter((i) => !i.__ng.deleted)), g(this, H, t(this, E).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, E).rawRecords.forEach((i, e) => {
|
|
@@ -1146,13 +1163,13 @@ const C = class C {
|
|
|
1146
1163
|
});
|
|
1147
1164
|
}, "resetRecords"));
|
|
1148
1165
|
v(this, "getValidData", /* @__PURE__ */ a(() => (t(this, H).length === 0 && t(this, E).rawRecords.length > 0 && this.resetRecords(), t(this, H)), "getValidData"));
|
|
1149
|
-
|
|
1150
|
-
var
|
|
1166
|
+
h(this, rt, /* @__PURE__ */ a((i) => {
|
|
1167
|
+
var n;
|
|
1151
1168
|
if (!i) return i;
|
|
1152
|
-
const e = !Array.isArray(i), s = e ? [i] : i,
|
|
1169
|
+
const e = !Array.isArray(i), s = e ? [i] : i, o = typeof ((n = t(this, L).fields) == null ? void 0 : n.get) == "function" ? t(this, L).fields.get() : [], r = s.filter((l) => !l.__ng.deleted).map((l) => {
|
|
1153
1170
|
const d = {};
|
|
1154
|
-
return
|
|
1155
|
-
d[
|
|
1171
|
+
return o.forEach((c, f) => {
|
|
1172
|
+
d[c] = l.v ? l.v[f] : l[c];
|
|
1156
1173
|
}), d.__ng = l.__ng, d;
|
|
1157
1174
|
});
|
|
1158
1175
|
return e ? r[0] : r;
|
|
@@ -1176,7 +1193,7 @@ const C = class C {
|
|
|
1176
1193
|
return this.length;
|
|
1177
1194
|
}
|
|
1178
1195
|
};
|
|
1179
|
-
L = new WeakMap(), E = new WeakMap(), H = new WeakMap(), ot = new WeakMap(), Nt = new WeakMap(),
|
|
1196
|
+
L = new WeakMap(), E = new WeakMap(), H = new WeakMap(), ot = new WeakMap(), Nt = new WeakMap(), P = new WeakMap(), Pt = new WeakMap(), K = new WeakMap(), vt = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), rt = new WeakMap(), a(C, "ngData"), // 🎯 행 상태 정의 상수를 클래스 내부로 내재화
|
|
1180
1197
|
v(C, "ROW_STATE", {
|
|
1181
1198
|
EMPTY: "EMPTY",
|
|
1182
1199
|
NORMAL: "NORMAL",
|
|
@@ -1188,73 +1205,73 @@ let ie = C;
|
|
|
1188
1205
|
var Z;
|
|
1189
1206
|
const ue = class ue {
|
|
1190
1207
|
constructor(i) {
|
|
1191
|
-
|
|
1208
|
+
h(this, Z);
|
|
1192
1209
|
g(this, Z, i), this.row = new ee(this), this.data = new ie(t(this, Z), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1193
1210
|
var e;
|
|
1194
1211
|
(e = t(this, Z).view) != null && e.redraw && t(this, Z).view.redraw();
|
|
1195
1212
|
}, this.setDataSource = (e) => {
|
|
1196
1213
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1197
1214
|
}, this.getRowState = (e) => {
|
|
1198
|
-
var
|
|
1215
|
+
var o, r;
|
|
1199
1216
|
const s = parseInt(e, 10);
|
|
1200
1217
|
if (!(s >= this.data.count()))
|
|
1201
|
-
return (r = (
|
|
1218
|
+
return (r = (o = this.data.getValidData()[s]) == null ? void 0 : o.__ng) == null ? void 0 : r.rowState;
|
|
1202
1219
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1203
1220
|
this.row.at = e;
|
|
1204
|
-
}, this.scrollTo_V1 = (e) => (e < 0 && (e = 0), e >= this.rawRecords.length && (e = this.rawRecords.length - 1), this.viewRecords.rawIndex = e, this.viewRecords.reset && this.viewRecords.reset(), !(e <= 0 || e >= this.rawRecords.length - 1)), this.getColumn = (e, s) => this.data.get(e, s), this.setColumn = (e, s,
|
|
1205
|
-
e = parseInt(e, 10), this.data.setValue(e, s,
|
|
1221
|
+
}, this.scrollTo_V1 = (e) => (e < 0 && (e = 0), e >= this.rawRecords.length && (e = this.rawRecords.length - 1), this.viewRecords.rawIndex = e, this.viewRecords.reset && this.viewRecords.reset(), !(e <= 0 || e >= this.rawRecords.length - 1)), this.getColumn = (e, s) => this.data.get(e, s), this.setColumn = (e, s, o) => {
|
|
1222
|
+
e = parseInt(e, 10), this.data.setValue(e, s, o);
|
|
1206
1223
|
}, this.setDataSource([]);
|
|
1207
1224
|
}
|
|
1208
1225
|
};
|
|
1209
1226
|
Z = new WeakMap(), a(ue, "ngDataManager");
|
|
1210
1227
|
let se = ue;
|
|
1211
|
-
var lt, A,
|
|
1228
|
+
var lt, A, wt, Xt;
|
|
1212
1229
|
const ge = class ge {
|
|
1213
1230
|
// 🎯 이제 { name: string, type: string } 객체들의 배열로 관리합니다.
|
|
1214
1231
|
constructor(i) {
|
|
1215
|
-
|
|
1216
|
-
|
|
1232
|
+
h(this, lt);
|
|
1233
|
+
h(this, A, []);
|
|
1217
1234
|
v(this, "add", /* @__PURE__ */ a((i, e = "string") => {
|
|
1218
1235
|
i.forEach((s) => {
|
|
1219
|
-
t(this, A).some((
|
|
1220
|
-
}), t(this,
|
|
1236
|
+
t(this, A).some((o) => o.name === s) || t(this, A).push({ name: s, type: e });
|
|
1237
|
+
}), t(this, wt).call(this);
|
|
1221
1238
|
}, "add"));
|
|
1222
|
-
|
|
1239
|
+
h(this, wt, /* @__PURE__ */ a(() => {
|
|
1223
1240
|
const i = /* @__PURE__ */ new Map();
|
|
1224
1241
|
t(this, A).forEach((e) => {
|
|
1225
1242
|
i.set(e.name, e.type);
|
|
1226
1243
|
}), 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);
|
|
1227
1244
|
}, "#adjust"));
|
|
1228
|
-
|
|
1229
|
-
g(this, A, []),
|
|
1245
|
+
h(this, Xt, /* @__PURE__ */ a(() => {
|
|
1246
|
+
g(this, A, []), k.log(t(this, lt).querySelectorAll("table"));
|
|
1230
1247
|
const i = Array.from(t(this, lt).querySelectorAll("table"));
|
|
1231
1248
|
if (!(!i || i.length === 0)) {
|
|
1232
1249
|
for (const e of i)
|
|
1233
|
-
|
|
1234
|
-
const r =
|
|
1235
|
-
r && t(this, A).push({ name: r, type:
|
|
1250
|
+
k.log(e), $("[data-bind]", e).each((s, o) => {
|
|
1251
|
+
const r = o.dataset.bind, n = o.getAttribute("data-type") || "string";
|
|
1252
|
+
r && t(this, A).push({ name: r, type: n });
|
|
1236
1253
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
1237
|
-
$(`[${s}]`, e).each((
|
|
1238
|
-
var
|
|
1239
|
-
if (
|
|
1240
|
-
const l =
|
|
1254
|
+
$(`[${s}]`, e).each((o, r) => {
|
|
1255
|
+
var n = r.getAttribute(s);
|
|
1256
|
+
if (n.indexOf("data.") < 0) {
|
|
1257
|
+
const l = n.search(/[(]/g);
|
|
1241
1258
|
if (l > 0)
|
|
1242
1259
|
try {
|
|
1243
|
-
|
|
1260
|
+
n = String(window[n.substring(0, l).trim()]);
|
|
1244
1261
|
} catch {
|
|
1245
|
-
|
|
1262
|
+
n = "";
|
|
1246
1263
|
}
|
|
1247
1264
|
}
|
|
1248
|
-
|
|
1265
|
+
n.split("data.").forEach((l) => {
|
|
1249
1266
|
if (l.trim() != "") {
|
|
1250
1267
|
const d = l.search(/[^_A-Za-z0-9]/g);
|
|
1251
|
-
let
|
|
1252
|
-
d >= 0 ?
|
|
1268
|
+
let c = "";
|
|
1269
|
+
d >= 0 ? c = l.substring(0, d) : n.startsWith("data.") && (c = l.replace("data.", "")), c && t(this, A).push({ name: c, type: "string" });
|
|
1253
1270
|
}
|
|
1254
1271
|
});
|
|
1255
1272
|
});
|
|
1256
1273
|
});
|
|
1257
|
-
t(this,
|
|
1274
|
+
t(this, wt).call(this);
|
|
1258
1275
|
}
|
|
1259
1276
|
}, "#init"));
|
|
1260
1277
|
g(this, lt, i), t(this, Xt).call(this);
|
|
@@ -1279,25 +1296,25 @@ const ge = class ge {
|
|
|
1279
1296
|
return t(this, A).some((e) => e.name === i);
|
|
1280
1297
|
}
|
|
1281
1298
|
};
|
|
1282
|
-
lt = new WeakMap(), A = new WeakMap(),
|
|
1299
|
+
lt = new WeakMap(), A = new WeakMap(), wt = new WeakMap(), Xt = new WeakMap(), a(ge, "ngFields");
|
|
1283
1300
|
let ne = ge;
|
|
1284
|
-
var G, Ut,
|
|
1301
|
+
var G, Ut, Ft;
|
|
1285
1302
|
const be = class be extends HTMLElement {
|
|
1286
1303
|
constructor() {
|
|
1287
1304
|
super();
|
|
1288
1305
|
//#created = false;
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
this.fields = new ne(this), g(this, Ut, new te(this)),
|
|
1306
|
+
h(this, G);
|
|
1307
|
+
h(this, Ut);
|
|
1308
|
+
h(this, Ft, /* @__PURE__ */ a(() => {
|
|
1309
|
+
this.fields = new ne(this), g(this, Ut, new te(this)), k.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1293
1310
|
}, "#init"));
|
|
1294
1311
|
this.attachShadow({ mode: "open" }), g(this, G, new se(this));
|
|
1295
1312
|
}
|
|
1296
1313
|
connectedCallback() {
|
|
1297
|
-
t(this,
|
|
1314
|
+
t(this, Ft).call(this);
|
|
1298
1315
|
}
|
|
1299
1316
|
disconnectedCallback() {
|
|
1300
|
-
|
|
1317
|
+
k.log("NineTable disconnected.");
|
|
1301
1318
|
}
|
|
1302
1319
|
// 🎯 외부에서 grid.data.set(...) 형태로 접근할 수 있도록 데이터 매니저 오픈
|
|
1303
1320
|
get data() {
|
|
@@ -1312,7 +1329,7 @@ const be = class be extends HTMLElement {
|
|
|
1312
1329
|
return t(this, G);
|
|
1313
1330
|
}
|
|
1314
1331
|
};
|
|
1315
|
-
G = new WeakMap(), Ut = new WeakMap(),
|
|
1332
|
+
G = new WeakMap(), Ut = new WeakMap(), Ft = new WeakMap(), a(be, "NineTable");
|
|
1316
1333
|
let oe = be;
|
|
1317
1334
|
customElements.get("nine-table") || customElements.define("nine-table", oe);
|
|
1318
1335
|
//# sourceMappingURL=nine-table.js.map
|