@ninebone/table 0.0.796 → 0.0.798
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 +571 -566
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +8 -8
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
var ys = Object.defineProperty;
|
|
2
|
-
var ms = (
|
|
3
|
-
throw TypeError(
|
|
2
|
+
var ms = (T) => {
|
|
3
|
+
throw TypeError(T);
|
|
4
4
|
};
|
|
5
|
-
var Ss = (
|
|
6
|
-
var h = (
|
|
7
|
-
var q = (
|
|
8
|
-
var t = (
|
|
9
|
-
var xs = (
|
|
5
|
+
var Ss = (T, s, e) => s in T ? ys(T, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : T[s] = e;
|
|
6
|
+
var h = (T, s) => ys(T, "name", { value: s, configurable: !0 });
|
|
7
|
+
var q = (T, s, e) => Ss(T, typeof s != "symbol" ? s + "" : s, e), Ee = (T, s, e) => s.has(T) || ms("Cannot " + e);
|
|
8
|
+
var t = (T, s, e) => (Ee(T, s, "read from private field"), e ? e.call(T) : s.get(T)), d = (T, s, e) => s.has(T) ? ms("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(T) : s.set(T, e), y = (T, s, e, n) => (Ee(T, s, "write to private field"), n ? n.call(T, e) : s.set(T, e), e), V = (T, s, e) => (Ee(T, s, "access private method"), e);
|
|
9
|
+
var xs = (T, s, e, n) => ({
|
|
10
10
|
set _(r) {
|
|
11
|
-
y(
|
|
11
|
+
y(T, s, r, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
|
-
return t(
|
|
14
|
+
return t(T, s, n);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
import { trace as Rs } from "@ninebone/util";
|
|
@@ -42,52 +42,52 @@ const es = class es extends HTMLElement {
|
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
q(this, "refresh", /* @__PURE__ */ h(() => {
|
|
44
44
|
if (!t(this, j) || !t(this, E) || t(this, G)) return;
|
|
45
|
-
const e = t(this, E).container,
|
|
46
|
-
if (!
|
|
47
|
-
const r = t(this, E).track,
|
|
48
|
-
if (a !== 0 &&
|
|
49
|
-
|
|
45
|
+
const e = t(this, E).container, n = e.querySelector("table");
|
|
46
|
+
if (!n) return;
|
|
47
|
+
const r = t(this, E).track, i = t(this, E).thumb, o = t(this, j).querySelector(".ng-container-bottom"), a = e.clientWidth, c = n.scrollWidth;
|
|
48
|
+
if (a !== 0 && c > a)
|
|
49
|
+
o && (o.style.display = "flex");
|
|
50
50
|
else {
|
|
51
|
-
|
|
51
|
+
o && (o.style.display = "none");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
56
|
-
const u = Math.max(Math.min(
|
|
57
|
-
|
|
58
|
-
const f = e.scrollLeft, b =
|
|
54
|
+
const l = r.clientWidth;
|
|
55
|
+
if (l <= 0) return;
|
|
56
|
+
const u = Math.max(Math.min(l * (a / c), l), 20);
|
|
57
|
+
i.style.width = `${u}px`;
|
|
58
|
+
const f = e.scrollLeft, b = c - a;
|
|
59
59
|
let g = 0;
|
|
60
|
-
b > 0 && (g = parseInt(f / b * (
|
|
61
|
-
const p =
|
|
62
|
-
g > p && (g = p),
|
|
60
|
+
b > 0 && (g = parseInt(f / b * (l - u), 10)), g < 0 && (g = 0);
|
|
61
|
+
const p = l - u;
|
|
62
|
+
g > p && (g = p), i.style.left = `${g}px`, t(this, E).left.disabled = g === 0, t(this, E).right.disabled = g >= p - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
64
|
d(this, nt, /* @__PURE__ */ h((e) => {
|
|
65
65
|
if (!t(this, E)) return !1;
|
|
66
|
-
const
|
|
66
|
+
const n = t(this, E).container, r = n.querySelector("table");
|
|
67
67
|
if (!r) return !1;
|
|
68
|
-
const
|
|
68
|
+
const i = t(this, E).track.getBoundingClientRect(), o = t(this, E).thumb.clientWidth;
|
|
69
69
|
let a = e;
|
|
70
70
|
a < 0 && (a = 0);
|
|
71
|
-
const
|
|
72
|
-
a >
|
|
73
|
-
const
|
|
74
|
-
return
|
|
71
|
+
const c = i.width - o;
|
|
72
|
+
a > c && (a = c), a = parseInt(a, 10), t(this, E).thumb.style.left = `${a}px`, S.log("1111=========="), t(this, E).left.disabled = a === 0, t(this, E).right.disabled = a >= c - 1;
|
|
73
|
+
const l = n.clientWidth, f = r.scrollWidth - l;
|
|
74
|
+
return c > 0 && f > 0 && (n.scrollLeft = a / c * f), a > 0 && a < c - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
76
|
d(this, Qt, /* @__PURE__ */ h(() => {
|
|
77
77
|
const e = /* @__PURE__ */ h((r) => {
|
|
78
78
|
clearInterval(t(this, tt)), clearInterval(t(this, et));
|
|
79
|
-
const
|
|
80
|
-
t(this, nt).call(this,
|
|
79
|
+
const i = parseInt(t(this, E).thumb.style.left || 0, 10);
|
|
80
|
+
t(this, nt).call(this, i + r), y(this, tt, setInterval(() => {
|
|
81
81
|
clearInterval(t(this, tt)), y(this, et, setInterval(() => {
|
|
82
|
-
const
|
|
83
|
-
t(this, nt).call(this,
|
|
82
|
+
const o = parseInt(t(this, E).thumb.style.left || 0, 10);
|
|
83
|
+
t(this, nt).call(this, o + r) || clearInterval(t(this, et));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
|
-
}, "delayScroll"),
|
|
86
|
+
}, "delayScroll"), n = /* @__PURE__ */ h(() => {
|
|
87
87
|
clearInterval(t(this, tt)), clearInterval(t(this, et));
|
|
88
88
|
}, "clearTimer");
|
|
89
89
|
["mouseup", "mouseleave", "touchend"].forEach((r) => {
|
|
90
|
-
t(this, E).left.addEventListener(r,
|
|
90
|
+
t(this, E).left.addEventListener(r, n), t(this, E).right.addEventListener(r, n), t(this, E).track.addEventListener(r, n);
|
|
91
91
|
}), t(this, E).left.addEventListener("mousedown", (r) => {
|
|
92
92
|
r.button === 0 && e(-20);
|
|
93
93
|
}), t(this, E).right.addEventListener("mousedown", (r) => {
|
|
@@ -95,19 +95,19 @@ const es = class es extends HTMLElement {
|
|
|
95
95
|
}), t(this, E).left.addEventListener("touchstart", () => e(-20)), t(this, E).right.addEventListener("touchstart", () => e(20)), t(this, E).track.addEventListener("mousedown", (r) => {
|
|
96
96
|
if (r.button !== 0) return;
|
|
97
97
|
r.preventDefault();
|
|
98
|
-
const
|
|
99
|
-
t(this, nt).call(this, r.clientX -
|
|
98
|
+
const i = t(this, E).track.getBoundingClientRect(), o = t(this, E).thumb.clientWidth;
|
|
99
|
+
t(this, nt).call(this, r.clientX - i.left - o / 2);
|
|
100
100
|
}), t(this, E).thumb.addEventListener("mousedown", (r) => {
|
|
101
101
|
if (r.button !== 0) return;
|
|
102
102
|
r.stopPropagation(), r.preventDefault(), y(this, G, !0), this.shiftX = r.clientX - t(this, E).thumb.getBoundingClientRect().left;
|
|
103
|
-
const
|
|
103
|
+
const i = /* @__PURE__ */ h((a) => {
|
|
104
104
|
if (!t(this, G)) return;
|
|
105
|
-
const
|
|
106
|
-
t(this, nt).call(this, a.clientX -
|
|
107
|
-
}, "onMouseMove"),
|
|
108
|
-
y(this, G, !1),
|
|
105
|
+
const c = t(this, E).track.getBoundingClientRect();
|
|
106
|
+
t(this, nt).call(this, a.clientX - c.left - this.shiftX);
|
|
107
|
+
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
108
|
+
y(this, G, !1), n(), document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", o), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
|
-
document.addEventListener("mousemove",
|
|
110
|
+
document.addEventListener("mousemove", i), document.addEventListener("mouseup", o);
|
|
111
111
|
});
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
@@ -177,18 +177,18 @@ const es = class es extends HTMLElement {
|
|
|
177
177
|
<button class='ng-scroll-right' disabled><div class='ng-scroll-icon'></div></button>
|
|
178
178
|
`;
|
|
179
179
|
const e = /* @__PURE__ */ h(() => {
|
|
180
|
-
const
|
|
181
|
-
if (!
|
|
180
|
+
const n = t(this, j).querySelector(".ng-container-body .ng-part-body");
|
|
181
|
+
if (!n) {
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
185
|
y(this, E, {
|
|
186
|
-
container:
|
|
186
|
+
container: n,
|
|
187
187
|
track: this.querySelector(".ng-scroll-track"),
|
|
188
188
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
189
189
|
left: this.querySelector(".ng-scroll-left"),
|
|
190
190
|
right: this.querySelector(".ng-scroll-right")
|
|
191
|
-
}),
|
|
191
|
+
}), n.addEventListener("scroll", () => {
|
|
192
192
|
t(this, G) || this.refresh();
|
|
193
193
|
}), t(this, Qt).call(this), t(this, Jt).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
@@ -199,8 +199,8 @@ const es = class es extends HTMLElement {
|
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
201
|
j = new WeakMap(), G = new WeakMap(), E = new WeakMap(), tt = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Jt = new WeakMap(), nt = new WeakMap(), Qt = new WeakMap(), h(es, "NineTableHScrollBar");
|
|
202
|
-
let
|
|
203
|
-
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar",
|
|
202
|
+
let Te = es;
|
|
203
|
+
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Te);
|
|
204
204
|
var rt, ot, yt, k, kt, It, te;
|
|
205
205
|
const ss = class ss extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
@@ -213,51 +213,51 @@ const ss = class ss extends HTMLElement {
|
|
|
213
213
|
d(this, It, 0);
|
|
214
214
|
q(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
215
|
if (S.log("vscrollbar.refresh"), !t(this, rt) || !t(this, k)) return;
|
|
216
|
-
const e = t(this, k).container,
|
|
217
|
-
if (
|
|
216
|
+
const e = t(this, k).container, n = t(this, k).track, r = t(this, k).thumb, i = e.clientHeight, o = t(this, rt).data.length, a = t(this, ot).getRowHeight(), c = o * a;
|
|
217
|
+
if (c <= i || o === 0) {
|
|
218
218
|
this.style.display = "none";
|
|
219
219
|
return;
|
|
220
220
|
} else
|
|
221
221
|
this.style.display = "flex";
|
|
222
|
-
const
|
|
223
|
-
if (
|
|
224
|
-
const u = Math.max(Math.min(
|
|
222
|
+
const l = n.clientHeight;
|
|
223
|
+
if (l <= 0) return;
|
|
224
|
+
const u = Math.max(Math.min(l * (i / c), l), 20);
|
|
225
225
|
r.style.height = `${u}px`;
|
|
226
|
-
const f = e.scrollTop, b = Math.max(
|
|
226
|
+
const f = e.scrollTop, b = Math.max(c - i, 1);
|
|
227
227
|
S.log(e, f, b);
|
|
228
228
|
let g = 0;
|
|
229
|
-
b > 0 && (g = f / b * (
|
|
230
|
-
const p =
|
|
229
|
+
b > 0 && (g = f / b * (l - u));
|
|
230
|
+
const p = l - u;
|
|
231
231
|
g < 0 && (g = 0), g > p && (g = p), r.style.top = `${g}px`, t(this, k).top.disabled = f <= 0, t(this, k).bottom.disabled = f >= b - 1;
|
|
232
232
|
}, "refresh"));
|
|
233
233
|
d(this, te, /* @__PURE__ */ h(() => {
|
|
234
234
|
S.log("nine-table-vscrollbar.#init");
|
|
235
|
-
const e = t(this, k).container,
|
|
236
|
-
const
|
|
237
|
-
return
|
|
235
|
+
const e = t(this, k).container, n = /* @__PURE__ */ h(() => {
|
|
236
|
+
const i = (t(this, rt).data.get() || []).length, o = t(this, ot).getRowHeight();
|
|
237
|
+
return i * o;
|
|
238
238
|
}, "getContentHeight");
|
|
239
239
|
t(this, k).thumb.addEventListener("mousedown", (r) => {
|
|
240
240
|
if (r.button !== 0) return;
|
|
241
241
|
r.stopPropagation(), r.preventDefault(), y(this, yt, !0), y(this, kt, r.clientY), y(this, It, e.scrollTop);
|
|
242
|
-
const
|
|
242
|
+
const i = /* @__PURE__ */ h((a) => {
|
|
243
243
|
if (!t(this, yt)) return;
|
|
244
|
-
const
|
|
244
|
+
const c = t(this, k).track.getBoundingClientRect(), l = t(this, k).thumb.clientHeight, f = c.height - l, b = a.clientY - t(this, kt), g = e.clientHeight, p = n(), x = Math.max(p - g, 1);
|
|
245
245
|
if (f > 0 && x > 0) {
|
|
246
246
|
const w = b / f * x;
|
|
247
247
|
let m = t(this, It) + w;
|
|
248
|
-
const
|
|
249
|
-
m < 0 && (m = 0), m >
|
|
248
|
+
const C = Math.max(0, p - g);
|
|
249
|
+
m < 0 && (m = 0), m > C && (m = C), e.scrollTop = m;
|
|
250
250
|
}
|
|
251
251
|
this.refresh();
|
|
252
|
-
}, "onMouseMove"),
|
|
253
|
-
y(this, yt, !1), document.removeEventListener("mousemove",
|
|
252
|
+
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
253
|
+
y(this, yt, !1), document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", o), this.refresh();
|
|
254
254
|
}, "onMouseUp");
|
|
255
|
-
document.addEventListener("mousemove",
|
|
255
|
+
document.addEventListener("mousemove", i), document.addEventListener("mouseup", o);
|
|
256
256
|
}), t(this, k).track.addEventListener("mousedown", (r) => {
|
|
257
257
|
if (r.button !== 0 || r.target === t(this, k).thumb) return;
|
|
258
|
-
const
|
|
259
|
-
if (
|
|
260
|
-
const g = Math.max(0, Math.min(1, a /
|
|
258
|
+
const i = t(this, k).track.getBoundingClientRect(), o = t(this, k).thumb.clientHeight, a = r.clientY - i.top - o / 2, l = i.height - o, u = e.clientHeight, f = n(), b = Math.max(f - u, 1);
|
|
259
|
+
if (l > 0 && b > 0) {
|
|
260
|
+
const g = Math.max(0, Math.min(1, a / l));
|
|
261
261
|
e.scrollTop = g * b;
|
|
262
262
|
}
|
|
263
263
|
this.refresh();
|
|
@@ -334,13 +334,13 @@ const ss = class ss 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
|
|
338
|
-
if (!
|
|
337
|
+
const n = t(this, ot).querySelector(".ng-container-body .ng-part-body");
|
|
338
|
+
if (!n) {
|
|
339
339
|
setTimeout(e, 10);
|
|
340
340
|
return;
|
|
341
341
|
}
|
|
342
342
|
y(this, k, {
|
|
343
|
-
container:
|
|
343
|
+
container: n,
|
|
344
344
|
track: this.querySelector(".ng-scroll-track"),
|
|
345
345
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
346
346
|
top: this.querySelector(".ng-scroll-top"),
|
|
@@ -351,11 +351,11 @@ const ss = class ss extends HTMLElement {
|
|
|
351
351
|
}
|
|
352
352
|
};
|
|
353
353
|
rt = new WeakMap(), ot = new WeakMap(), yt = new WeakMap(), k = new WeakMap(), kt = new WeakMap(), It = new WeakMap(), te = new WeakMap(), h(ss, "NineTableVScrollBar");
|
|
354
|
-
let
|
|
355
|
-
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar",
|
|
354
|
+
let Ce = ss;
|
|
355
|
+
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Ce);
|
|
356
356
|
var U, A, it, Y, O, Z, at, Lt, Ye, Ve, ee, se, Mt, Ht, $t, ne, re, Nt, Ue, mt, _t, oe;
|
|
357
357
|
const ns = class ns {
|
|
358
|
-
constructor(
|
|
358
|
+
constructor(s) {
|
|
359
359
|
d(this, U);
|
|
360
360
|
d(this, A);
|
|
361
361
|
d(this, it);
|
|
@@ -371,74 +371,79 @@ const ns = class ns {
|
|
|
371
371
|
q(this, "refresh", /* @__PURE__ */ h(() => {
|
|
372
372
|
var e;
|
|
373
373
|
S.log("rowManager.refresh");
|
|
374
|
-
const
|
|
375
|
-
|
|
374
|
+
const s = t(this, A).querySelector(".ng-container-body .ng-part-body");
|
|
375
|
+
s && (t(this, Mt).call(this), t(this, Ht).call(this), t(this, mt).call(this, s.scrollTop), (e = t(this, A).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
376
376
|
}, "refresh"));
|
|
377
377
|
q(this, "initialize", /* @__PURE__ */ h(() => {
|
|
378
378
|
S.log("rowManager.initialize"), y(this, it, {
|
|
379
379
|
scrollTables: t(this, A).querySelectorAll(".ng-part-body table"),
|
|
380
380
|
firstTr: t(this, A).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
381
381
|
}), y(this, O, null), t(this, Y).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
382
|
-
const
|
|
383
|
-
if (!i) return;
|
|
384
|
-
const a = i.querySelector(".ng-part-body table");
|
|
382
|
+
const a = t(this, A).querySelector(o);
|
|
385
383
|
if (!a) return;
|
|
386
|
-
const
|
|
384
|
+
const c = a.querySelector(".ng-part-body table");
|
|
385
|
+
if (!c) return;
|
|
386
|
+
const l = c.querySelector("tbody.bindable-tbody");
|
|
387
387
|
if (!l) return;
|
|
388
|
-
const
|
|
389
|
-
t(this, Y).set(o,
|
|
388
|
+
const f = Array.from(l.querySelectorAll("tr")).map((b) => b.cloneNode(!0));
|
|
389
|
+
t(this, Y).set(o, f);
|
|
390
390
|
});
|
|
391
|
-
const
|
|
392
|
-
if (
|
|
393
|
-
t(this, Mt).call(this), t(this, Nt).call(this), t(this, Ht).call(this), t(this, mt).call(this,
|
|
391
|
+
const s = t(this, A).querySelector(".ng-container-body .ng-part-body"), e = t(this, A).querySelector(".ng-container-left .ng-part-body"), n = t(this, A).querySelector(".ng-container-right .ng-part-body"), r = t(this, A).querySelector(".ng-container-body .ng-part-header"), i = t(this, A).querySelector(".ng-container-body .ng-part-footer");
|
|
392
|
+
if (s) {
|
|
393
|
+
t(this, Mt).call(this), t(this, Nt).call(this), t(this, Ht).call(this), t(this, mt).call(this, s.scrollTop);
|
|
394
394
|
let o = !1;
|
|
395
|
-
|
|
396
|
-
const
|
|
397
|
-
var
|
|
395
|
+
s.scrollTop, s.scrollLeft;
|
|
396
|
+
const a = /* @__PURE__ */ h((c) => {
|
|
397
|
+
var f;
|
|
398
398
|
if (o) return;
|
|
399
399
|
o = !0;
|
|
400
|
-
const l =
|
|
401
|
-
|
|
400
|
+
const l = c.scrollTop, u = c.scrollLeft;
|
|
401
|
+
S.log("======", c, c.scrollLeft), s && s.scrollTop !== l && (s.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), n && n.scrollTop !== l && (n.scrollTop = l), r && r.scrollLeft !== u && (r.scrollLeft = u), i && i.scrollLeft !== u && (i.scrollLeft = u), t(this, mt).call(this, l), (f = t(this, A).querySelector("nine-table-vscrollbar")) == null || f.refresh(), o = !1;
|
|
402
402
|
}, "handleContainerScroll");
|
|
403
|
-
|
|
404
|
-
a
|
|
405
|
-
|
|
403
|
+
s == null || s.addEventListener("scroll", (c) => {
|
|
404
|
+
a(s);
|
|
405
|
+
}), [e, n].forEach((c) => {
|
|
406
|
+
c == null || c.addEventListener("scroll", (l) => {
|
|
407
|
+
if (o) return;
|
|
408
|
+
o = !0;
|
|
409
|
+
const u = c.scrollTop;
|
|
410
|
+
s && s.scrollTop !== u && (s.scrollTop = u), o = !1;
|
|
406
411
|
});
|
|
407
412
|
});
|
|
408
413
|
}
|
|
409
414
|
}, "initialize"));
|
|
410
|
-
d(this, se, /* @__PURE__ */ h((
|
|
415
|
+
d(this, se, /* @__PURE__ */ h((s, e) => {
|
|
411
416
|
S.log("rowManager.#renderRows");
|
|
412
|
-
const
|
|
413
|
-
if (!
|
|
414
|
-
const r =
|
|
417
|
+
const n = t(this, Y).get(e);
|
|
418
|
+
if (!n || n.length === 0) return;
|
|
419
|
+
const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
415
420
|
if (!r) return;
|
|
416
421
|
r.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
|
|
417
|
-
const
|
|
422
|
+
const i = r.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
418
423
|
for (let a = 0; a < t(this, Lt); a++)
|
|
419
|
-
|
|
420
|
-
|
|
424
|
+
n.forEach((c) => {
|
|
425
|
+
o.appendChild(c.cloneNode(!0));
|
|
421
426
|
});
|
|
422
|
-
|
|
427
|
+
i ? i.before(o) : r.appendChild(o), e === ".ng-container-body" && (t(this, it).firstTr = r.querySelector("tr:not(.nodata)"));
|
|
423
428
|
}, "#renderRows"));
|
|
424
429
|
d(this, Mt, /* @__PURE__ */ h(() => {
|
|
425
430
|
if (t(this, O) !== null && t(this, O) > 0)
|
|
426
431
|
return t(this, O);
|
|
427
|
-
const
|
|
432
|
+
const s = t(this, A).querySelector(".ng-container-body .ng-part-body");
|
|
428
433
|
S.log("rowManager.#measureAndCacheHeight");
|
|
429
434
|
const e = t(this, Y).get(".ng-container-body");
|
|
430
435
|
if (!e || e.length === 0) throw new Error("invalid dom");
|
|
431
|
-
const
|
|
432
|
-
if (S.log(
|
|
433
|
-
|
|
434
|
-
const r =
|
|
436
|
+
const n = s.querySelector("tbody.bindable-tbody");
|
|
437
|
+
if (S.log(n), !n) throw new Error("invalid dom");
|
|
438
|
+
n.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
|
|
439
|
+
const r = n.querySelector("tr.nodata"), i = document.createDocumentFragment();
|
|
435
440
|
e.forEach((b) => {
|
|
436
|
-
|
|
437
|
-
}), r ? r.before(
|
|
438
|
-
const
|
|
439
|
-
(a === "none" || window.getComputedStyle(
|
|
441
|
+
i.appendChild(b.cloneNode(!0));
|
|
442
|
+
}), r ? r.before(i) : n.appendChild(i);
|
|
443
|
+
const o = t(this, A), a = o.style.display, c = o.style.visibility, l = o.style.position;
|
|
444
|
+
(a === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
440
445
|
let u = 0;
|
|
441
|
-
const f =
|
|
446
|
+
const f = n.querySelectorAll("tr");
|
|
442
447
|
return f.forEach((b) => {
|
|
443
448
|
let g = b.offsetHeight || b.getBoundingClientRect().height;
|
|
444
449
|
if (g === 0) {
|
|
@@ -446,84 +451,84 @@ const ns = class ns {
|
|
|
446
451
|
g = parseFloat(p.height) || parseFloat(p.minHeight) || 0;
|
|
447
452
|
}
|
|
448
453
|
u += g;
|
|
449
|
-
}), f.forEach((b) => b.remove()),
|
|
454
|
+
}), f.forEach((b) => b.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l, u <= 0 ? -1 : (y(this, O, u), t(this, $t).call(this), t(this, O));
|
|
450
455
|
}, "#measureAndCacheHeight"));
|
|
451
456
|
d(this, Ht, /* @__PURE__ */ h(() => {
|
|
452
457
|
S.log("rowManager.#updateVirtualScrollHeight");
|
|
453
|
-
const e = (t(this, U).data.get() || []).length,
|
|
454
|
-
S.log("🔍 [VirtualHeight]", { totalCount: e, rowHeight:
|
|
455
|
-
const
|
|
456
|
-
if (!
|
|
457
|
-
const a =
|
|
458
|
+
const e = (t(this, U).data.get() || []).length, n = t(this, O), r = e * n;
|
|
459
|
+
S.log("🔍 [VirtualHeight]", { totalCount: e, rowHeight: n, totalVirtualHeight: r }), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
460
|
+
const o = t(this, A).querySelector(i);
|
|
461
|
+
if (!o) return;
|
|
462
|
+
const a = o.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
458
463
|
a && (a.style.height = `${r}px`);
|
|
459
464
|
});
|
|
460
465
|
}, "#updateVirtualScrollHeight"));
|
|
461
466
|
d(this, $t, /* @__PURE__ */ h(() => {
|
|
462
467
|
if (t(this, at) > 0 && t(this, O) > 0) {
|
|
463
|
-
const
|
|
464
|
-
y(this, Lt,
|
|
468
|
+
const s = Math.ceil(t(this, at) / t(this, O));
|
|
469
|
+
y(this, Lt, s + t(this, ee));
|
|
465
470
|
}
|
|
466
471
|
}, "#updateRowCount"));
|
|
467
472
|
d(this, ne, /* @__PURE__ */ h(() => {
|
|
468
|
-
var a,
|
|
469
|
-
const
|
|
473
|
+
var a, c, l, u, f, b;
|
|
474
|
+
const s = t(this, A).querySelector(".ng-container-left .ng-part-body table"), e = t(this, A).querySelector(".ng-container-body .ng-part-body table"), n = t(this, A).querySelector(".ng-container-right .ng-part-body table");
|
|
470
475
|
if (e) {
|
|
471
|
-
const g =
|
|
476
|
+
const g = s ? Array.from(s.querySelectorAll("tbody tr")) : [], p = Array.from(e.querySelectorAll("tbody tr")), x = n ? Array.from(n.querySelectorAll("tbody tr")) : [], w = Math.max(g.length, p.length, x.length);
|
|
472
477
|
for (let m = 0; m < w; m++) {
|
|
473
|
-
const
|
|
478
|
+
const C = [
|
|
474
479
|
((a = g[m]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
475
|
-
((
|
|
476
|
-
((
|
|
477
|
-
], R = Math.max(...
|
|
480
|
+
((c = p[m]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
481
|
+
((l = x[m]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
482
|
+
], R = Math.max(...C);
|
|
478
483
|
R > 0 && (g[m] && (g[m].style.height = `${R}px`), p[m] && (p[m].style.height = `${R}px`), x[m] && (x[m].style.height = `${R}px`));
|
|
479
484
|
}
|
|
480
485
|
}
|
|
481
|
-
const r = t(this, A).querySelector(".ng-container-left .ng-part-footer table"),
|
|
482
|
-
if (
|
|
483
|
-
const g = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], p = Array.from(
|
|
486
|
+
const r = t(this, A).querySelector(".ng-container-left .ng-part-footer table"), i = t(this, A).querySelector(".ng-container-body .ng-part-footer table"), o = t(this, A).querySelector(".ng-container-right .ng-part-footer table");
|
|
487
|
+
if (i) {
|
|
488
|
+
const g = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], p = Array.from(i.querySelectorAll("tfoot tr")), x = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], w = Math.max(g.length, p.length, x.length);
|
|
484
489
|
for (let m = 0; m < w; m++) {
|
|
485
|
-
const
|
|
490
|
+
const C = [
|
|
486
491
|
((u = g[m]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
|
|
487
492
|
((f = p[m]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
488
493
|
((b = x[m]) == null ? void 0 : b.getBoundingClientRect().height) || 0
|
|
489
|
-
], R = Math.max(...
|
|
494
|
+
], R = Math.max(...C);
|
|
490
495
|
R > 0 && (g[m] && (g[m].style.height = `${R}px`), p[m] && (p[m].style.height = `${R}px`), x[m] && (x[m].style.height = `${R}px`));
|
|
491
496
|
}
|
|
492
497
|
}
|
|
493
498
|
}, "#syncRowHeights"));
|
|
494
499
|
d(this, re, /* @__PURE__ */ h(() => {
|
|
495
|
-
!t(this, A) || !(t(this, A) instanceof HTMLElement) || (y(this, Z, new ResizeObserver((
|
|
496
|
-
for (const e of
|
|
497
|
-
const
|
|
498
|
-
if (!
|
|
500
|
+
!t(this, A) || !(t(this, A) instanceof HTMLElement) || (y(this, Z, new ResizeObserver((s) => {
|
|
501
|
+
for (const e of s) {
|
|
502
|
+
const n = e.target;
|
|
503
|
+
if (!n.classList.contains("active")) continue;
|
|
499
504
|
const r = e.contentRect.height;
|
|
500
505
|
if (r > 0) {
|
|
501
|
-
let
|
|
502
|
-
const
|
|
503
|
-
|
|
504
|
-
const
|
|
505
|
-
t(this, at) !==
|
|
506
|
+
let i = 0;
|
|
507
|
+
const o = n.querySelector(".ng-part-header"), a = n.querySelector(".ng-part-footer");
|
|
508
|
+
o && (i += o.offsetHeight), a && (i += a.offsetHeight);
|
|
509
|
+
const c = Math.max(r - i, 100);
|
|
510
|
+
t(this, at) !== c && (y(this, at, c), t(this, $t).call(this), t(this, O) !== null && (t(this, Nt).call(this), this.refresh()));
|
|
506
511
|
}
|
|
507
512
|
}
|
|
508
513
|
})), t(this, Z).observe(t(this, A)));
|
|
509
514
|
}, "#initResizeObserver"));
|
|
510
515
|
d(this, Nt, /* @__PURE__ */ h(() => {
|
|
511
|
-
S.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
512
|
-
const e = t(this, A).querySelector(
|
|
513
|
-
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, se).call(this, e,
|
|
516
|
+
S.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((s) => {
|
|
517
|
+
const e = t(this, A).querySelector(s);
|
|
518
|
+
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, se).call(this, e, s);
|
|
514
519
|
}), t(this, oe).call(this), t(this, ne).call(this);
|
|
515
520
|
}, "#renderAllContainers"));
|
|
516
|
-
d(this, Ue, /* @__PURE__ */ h((
|
|
521
|
+
d(this, Ue, /* @__PURE__ */ h((s) => {
|
|
517
522
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
518
|
-
var
|
|
519
|
-
const
|
|
520
|
-
if (!
|
|
521
|
-
const r =
|
|
523
|
+
var l;
|
|
524
|
+
const n = t(this, A).querySelector(e);
|
|
525
|
+
if (!n) return;
|
|
526
|
+
const r = n.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
522
527
|
if (!r) return;
|
|
523
|
-
const
|
|
524
|
-
|
|
525
|
-
const b =
|
|
526
|
-
if (b >=
|
|
528
|
+
const i = Array.from(r.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this, Y).get(e)) == null ? void 0 : l.length) || 1, c = (t(this, U).data.get() || []).length;
|
|
529
|
+
i.forEach((u, f) => {
|
|
530
|
+
const b = s + Math.floor(f / o);
|
|
531
|
+
if (b >= c) {
|
|
527
532
|
u.style.visibility = "hidden";
|
|
528
533
|
return;
|
|
529
534
|
}
|
|
@@ -532,28 +537,28 @@ const ns = class ns {
|
|
|
532
537
|
});
|
|
533
538
|
});
|
|
534
539
|
}, "#adjustBufferRows"));
|
|
535
|
-
d(this, mt, /* @__PURE__ */ h((
|
|
540
|
+
d(this, mt, /* @__PURE__ */ h((s) => {
|
|
536
541
|
var f, b;
|
|
537
542
|
const e = t(this, O);
|
|
538
543
|
if (!e || e <= 0) return;
|
|
539
|
-
const
|
|
540
|
-
if (
|
|
541
|
-
const r = ((f = t(this, Y).get(".ng-container-body")) == null ? void 0 : f.length) || 1,
|
|
542
|
-
S.log("bodyContainer.clientHeight",
|
|
543
|
-
const
|
|
544
|
-
let
|
|
545
|
-
S.log(`📜 [Scroll Calc] maxStartIndex: ${
|
|
546
|
-
const
|
|
544
|
+
const n = t(this, U).data.length;
|
|
545
|
+
if (n === 0) return;
|
|
546
|
+
const r = ((f = t(this, Y).get(".ng-container-body")) == null ? void 0 : f.length) || 1, i = t(this, A).querySelector(".ng-container-body .ng-part-body");
|
|
547
|
+
S.log("bodyContainer.clientHeight", i.clientHeight);
|
|
548
|
+
const o = Math.max(0, n - Math.floor(i.clientHeight / e)), a = Math.min(o, Math.max(0, Math.floor(s / e)));
|
|
549
|
+
let c = Math.floor(a * e);
|
|
550
|
+
S.log(`📜 [Scroll Calc] maxStartIndex: ${o}, startIndex: ${a}, offsetY: ${c}`), a === o && S.log(`📜 [Scroll Inspect] scrollTop: ${s}, rowHeight: ${e}, maxStartIndex: ${o}, startIndex: ${a}, offsetY: ${c}`);
|
|
551
|
+
const l = t(this, it).firstTr, u = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
|
|
547
552
|
(b = t(this, it)) == null || b.scrollTables.forEach((g) => {
|
|
548
|
-
g.style.transform = `translate3d(0, ${
|
|
553
|
+
g.style.transform = `translate3d(0, ${c}px, 0)`;
|
|
549
554
|
}), u !== a && (S.log(`🔄 [Row Bind Trigger] currentStartIndex(${u}) !== startIndex(${a})`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
|
|
550
555
|
const p = t(this, A).querySelector(g);
|
|
551
556
|
if (!p) return;
|
|
552
557
|
const x = p.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
553
558
|
if (!x) return;
|
|
554
|
-
Array.from(x.querySelectorAll("tr:not(.nodata)")).forEach((m,
|
|
555
|
-
const R = a + Math.floor(
|
|
556
|
-
if (R >=
|
|
559
|
+
Array.from(x.querySelectorAll("tr:not(.nodata)")).forEach((m, C) => {
|
|
560
|
+
const R = a + Math.floor(C / r);
|
|
561
|
+
if (R >= n) {
|
|
557
562
|
m.style.display = "none";
|
|
558
563
|
return;
|
|
559
564
|
}
|
|
@@ -576,39 +581,39 @@ const ns = class ns {
|
|
|
576
581
|
cell.dataset.row = dataIndex;
|
|
577
582
|
});
|
|
578
583
|
}; */
|
|
579
|
-
d(this, _t, /* @__PURE__ */ h((
|
|
580
|
-
|
|
581
|
-
r.dataset.row =
|
|
582
|
-
const
|
|
583
|
-
|
|
584
|
+
d(this, _t, /* @__PURE__ */ h((s, e, n) => {
|
|
585
|
+
s.dataset.row = n, s.data = e, Array.from(s.cells).forEach((r, i) => {
|
|
586
|
+
r.dataset.row = n;
|
|
587
|
+
const o = Array.from(r.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
|
|
588
|
+
o && typeof o.refresh == "function" && o.refresh();
|
|
584
589
|
});
|
|
585
590
|
}, "#bindRowData"));
|
|
586
591
|
d(this, oe, /* @__PURE__ */ h(() => {
|
|
587
|
-
var
|
|
592
|
+
var c, l, u;
|
|
588
593
|
S.log("rowManager.#syncHeaderHeights");
|
|
589
|
-
const
|
|
594
|
+
const s = t(this, A).querySelector(".ng-container-left .ng-part-header table"), e = t(this, A).querySelector(".ng-container-body .ng-part-header table"), n = t(this, A).querySelector(".ng-container-right .ng-part-header table");
|
|
590
595
|
if (!e) return;
|
|
591
|
-
const r =
|
|
596
|
+
const r = s ? Array.from(s.querySelectorAll("tr")) : [], i = Array.from(e.querySelectorAll("tr")), o = n ? Array.from(n.querySelectorAll("tr")) : [], a = Math.max(r.length, i.length, o.length);
|
|
592
597
|
for (let f = 0; f < a; f++) {
|
|
593
598
|
const b = [
|
|
594
|
-
((
|
|
595
|
-
((
|
|
596
|
-
((u =
|
|
599
|
+
((c = r[f]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
600
|
+
((l = i[f]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
601
|
+
((u = o[f]) == null ? void 0 : u.getBoundingClientRect().height) || 0
|
|
597
602
|
], g = Math.max(...b);
|
|
598
|
-
g > 0 && (r[f] && (r[f].style.height = `${g}px`),
|
|
603
|
+
g > 0 && (r[f] && (r[f].style.height = `${g}px`), i[f] && (i[f].style.height = `${g}px`), o[f] && (o[f].style.height = `${g}px`));
|
|
599
604
|
}
|
|
600
605
|
}, "#syncHeaderHeights"));
|
|
601
606
|
q(this, "destroy", /* @__PURE__ */ h(() => {
|
|
602
607
|
t(this, Z) && (t(this, Z).disconnect(), y(this, Z, null));
|
|
603
608
|
}, "destroy"));
|
|
604
|
-
y(this, U,
|
|
609
|
+
y(this, U, s.getRootNode().host), y(this, A, s), t(this, re).call(this);
|
|
605
610
|
}
|
|
606
611
|
getRowHeight() {
|
|
607
612
|
return t(this, O);
|
|
608
613
|
}
|
|
609
|
-
templateLength(
|
|
614
|
+
templateLength(s = ".ng-container-body") {
|
|
610
615
|
var e;
|
|
611
|
-
return ((e = t(this, Y).get(
|
|
616
|
+
return ((e = t(this, Y).get(s)) == null ? void 0 : e.length) || 1;
|
|
612
617
|
}
|
|
613
618
|
};
|
|
614
619
|
U = new WeakMap(), A = new WeakMap(), it = new WeakMap(), Y = new WeakMap(), O = new WeakMap(), Z = new WeakMap(), at = new WeakMap(), Lt = new WeakMap(), Ye = new WeakMap(), Ve = new WeakMap(), ee = new WeakMap(), se = new WeakMap(), Mt = new WeakMap(), Ht = new WeakMap(), $t = new WeakMap(), ne = new WeakMap(), re = new WeakMap(), Nt = new WeakMap(), Ue = new WeakMap(), mt = new WeakMap(), _t = new WeakMap(), oe = new WeakMap(), h(ns, "RowManager");
|
|
@@ -617,48 +622,48 @@ const ie = class ie {
|
|
|
617
622
|
/**
|
|
618
623
|
* 🎯 레이아웃 내의 여러 rawTables 배열을 일괄로 받아 단일 마스터 템플릿으로 사전 컴파일합니다.
|
|
619
624
|
*/
|
|
620
|
-
static compileAll(
|
|
621
|
-
return Array.isArray(
|
|
625
|
+
static compileAll(s) {
|
|
626
|
+
return Array.isArray(s) ? s.map((e) => ie.compile(e)) : [];
|
|
622
627
|
}
|
|
623
628
|
/**
|
|
624
629
|
* 🎯 단일 원본 테이블을 받아 기본 구조 보정 및 2차원 격자 인덱스 사전 부여 완료된 마스터 테이블 반환
|
|
625
630
|
*/
|
|
626
|
-
static compile(
|
|
627
|
-
if (!
|
|
631
|
+
static compile(s) {
|
|
632
|
+
if (!s) return null;
|
|
628
633
|
const e = /* @__PURE__ */ h((a) => {
|
|
629
|
-
a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((
|
|
630
|
-
const u =
|
|
631
|
-
if (
|
|
634
|
+
a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
|
|
635
|
+
const u = l.getAttribute("cell-type") || "renderer";
|
|
636
|
+
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
632
637
|
let f = `cell-${u}`;
|
|
633
|
-
const b =
|
|
638
|
+
const b = l.getAttribute("data-bind"), g = l.getAttribute("data-expr"), p = l.getAttribute("maxbyte"), x = l.getAttribute("type");
|
|
634
639
|
let w = [];
|
|
635
|
-
b && w.push(`data-bind="${b}"`), g && w.push(`data-expr="${g}"`), p && w.push(`maxbyte="${p}"`), x && w.push(`type="${x}"`),
|
|
636
|
-
}), a.querySelectorAll("tbody td, tfoot td").forEach((
|
|
637
|
-
|
|
640
|
+
b && w.push(`data-bind="${b}"`), g && w.push(`data-expr="${g}"`), p && w.push(`maxbyte="${p}"`), x && w.push(`type="${x}"`), l.innerHTML = `<${f} ${w.join(" ")}></${f}>`;
|
|
641
|
+
}), a.querySelectorAll("tbody td, tfoot td").forEach((l) => {
|
|
642
|
+
l.setAttribute("tabindex", "0");
|
|
638
643
|
});
|
|
639
|
-
}, "processCellTypes"),
|
|
644
|
+
}, "processCellTypes"), n = /* @__PURE__ */ h((a) => {
|
|
640
645
|
if (!a.querySelector("colgroup")) {
|
|
641
|
-
const
|
|
642
|
-
for (let b = 0; b <
|
|
646
|
+
const c = a.querySelector("tbody tr") || a.querySelector("tr"), l = c ? c.querySelectorAll("th, td").length : 1, u = document.createElement("colgroup"), f = Math.max(Math.floor(a.clientWidth / l), 100);
|
|
647
|
+
for (let b = 0; b < l; b++) {
|
|
643
648
|
const g = document.createElement("col");
|
|
644
649
|
g.setAttribute("width", f), u.appendChild(g);
|
|
645
650
|
}
|
|
646
651
|
a.prepend(u);
|
|
647
652
|
}
|
|
648
653
|
if (!a.querySelector("thead")) {
|
|
649
|
-
const
|
|
650
|
-
|
|
654
|
+
const c = document.createElement("thead"), l = a.querySelector("colgroup");
|
|
655
|
+
l ? l.after(c) : a.prepend(c);
|
|
651
656
|
}
|
|
652
657
|
a.classList.add("nine-table-element");
|
|
653
|
-
}, "ensureTableStructure"), r = /* @__PURE__ */ h((a,
|
|
654
|
-
const
|
|
658
|
+
}, "ensureTableStructure"), r = /* @__PURE__ */ h((a, c) => {
|
|
659
|
+
const l = Array.from(a.querySelectorAll(c + " tr")), u = Array.from(a.querySelectorAll(c + " th," + c + " td")), f = l.length;
|
|
655
660
|
if (f === 0 || u.length === 0) return;
|
|
656
661
|
let b = 0;
|
|
657
662
|
u.forEach((p) => {
|
|
658
663
|
b += p.colSpan || 1;
|
|
659
664
|
});
|
|
660
665
|
const g = Array.from(Array(f), () => Array(b).fill(null));
|
|
661
|
-
|
|
666
|
+
l.forEach((p) => {
|
|
662
667
|
const x = p.sectionRowIndex;
|
|
663
668
|
let w = 0;
|
|
664
669
|
Array.from(p.querySelectorAll("th,td")).forEach((m) => {
|
|
@@ -667,12 +672,12 @@ const ie = class ie {
|
|
|
667
672
|
w = M;
|
|
668
673
|
break;
|
|
669
674
|
}
|
|
670
|
-
const
|
|
671
|
-
for (let M = 0; M <
|
|
675
|
+
const C = m.rowSpan || 1, R = m.colSpan || 1;
|
|
676
|
+
for (let M = 0; M < C; M++)
|
|
672
677
|
for (let B = 0; B < R; B++)
|
|
673
678
|
x + M < f && w + B < b && (g[x + M][w + B] = M === 0 && B === 0 ? "1" : "0");
|
|
674
679
|
});
|
|
675
|
-
}),
|
|
680
|
+
}), l.forEach((p) => {
|
|
676
681
|
const x = p.sectionRowIndex;
|
|
677
682
|
Array.from(p.querySelectorAll("th,td")).forEach((w) => {
|
|
678
683
|
for (let m = 0; m < g[x].length; m++)
|
|
@@ -682,13 +687,13 @@ const ie = class ie {
|
|
|
682
687
|
}
|
|
683
688
|
});
|
|
684
689
|
});
|
|
685
|
-
}, "resetColIndex"),
|
|
686
|
-
return
|
|
687
|
-
const
|
|
688
|
-
|
|
689
|
-
u.setAttribute("fixed",
|
|
690
|
+
}, "resetColIndex"), i = s.cloneNode(!0);
|
|
691
|
+
return n(i), e(i), r(i, "thead"), r(i, "tbody"), r(i, "tfoot"), Array.from(i.querySelectorAll("colgroup col")).forEach((a, c) => {
|
|
692
|
+
const l = a.getAttribute("fixed");
|
|
693
|
+
l && i.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((u) => {
|
|
694
|
+
u.setAttribute("fixed", l);
|
|
690
695
|
});
|
|
691
|
-
}),
|
|
696
|
+
}), i;
|
|
692
697
|
}
|
|
693
698
|
// 🎯 [추가] td/th에 선언된 cell-type 속성을 읽어 커스텀 태그로 자동 감싸기
|
|
694
699
|
};
|
|
@@ -696,153 +701,153 @@ h(ie, "TableCompiler");
|
|
|
696
701
|
let Ie = ie;
|
|
697
702
|
var N, X, K, qt, ws;
|
|
698
703
|
const rs = class rs {
|
|
699
|
-
constructor(
|
|
704
|
+
constructor(s) {
|
|
700
705
|
d(this, K);
|
|
701
706
|
d(this, N);
|
|
702
707
|
d(this, X, { startRow: -1, startCol: -1, endRow: -1, endCol: -1 });
|
|
703
708
|
q(this, "render", /* @__PURE__ */ h(() => {
|
|
704
|
-
const { startRow:
|
|
709
|
+
const { startRow: s, startCol: e, endRow: n, endCol: r } = t(this, X);
|
|
705
710
|
S.log("🎨 [CellSelection.render] Rendering range ->", t(this, X));
|
|
706
|
-
const
|
|
711
|
+
const i = t(this, N).querySelectorAll(
|
|
707
712
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
708
713
|
);
|
|
709
|
-
if (
|
|
710
|
-
a.querySelectorAll(".selected, .selected-top, .selected-bottom, .selected-left, .selected-right").forEach((
|
|
711
|
-
|
|
714
|
+
if (i.forEach((a) => {
|
|
715
|
+
a.querySelectorAll(".selected, .selected-top, .selected-bottom, .selected-left, .selected-right").forEach((c) => {
|
|
716
|
+
c.classList.remove("selected", "selected-top", "selected-bottom", "selected-left", "selected-right");
|
|
712
717
|
});
|
|
713
|
-
}),
|
|
718
|
+
}), s < 0 || e < 0) {
|
|
714
719
|
S.log("⚠️ [CellSelection.render] Range is invalid (< 0), skipping render.");
|
|
715
720
|
return;
|
|
716
721
|
}
|
|
717
|
-
let
|
|
718
|
-
|
|
719
|
-
a.querySelectorAll("tbody tr").forEach((
|
|
720
|
-
const { matrixRow:
|
|
721
|
-
|
|
722
|
+
let o = 0;
|
|
723
|
+
i.forEach((a) => {
|
|
724
|
+
a.querySelectorAll("tbody tr").forEach((c) => {
|
|
725
|
+
const { matrixRow: l } = V(this, K, qt).call(this, c);
|
|
726
|
+
l < 0 || c.querySelectorAll("td, th").forEach((u) => {
|
|
722
727
|
const f = parseInt(u.dataset.col, 10);
|
|
723
728
|
if (isNaN(f)) return;
|
|
724
|
-
const b = parseInt(u.rowSpan || 1, 10), g = parseInt(u.colSpan || 1, 10), p =
|
|
725
|
-
p >=
|
|
729
|
+
const b = parseInt(u.rowSpan || 1, 10), g = parseInt(u.colSpan || 1, 10), p = l + b - 1, x = f + g - 1;
|
|
730
|
+
p >= s && l <= n && x >= e && f <= r && (o++, u.classList.add("selected"), S.log(u, s, e, n, r), l <= s && u.classList.add("selected-top"), p >= n && u.classList.add("selected-bottom"), f <= e && u.classList.add("selected-left"), x >= r && u.classList.add("selected-right"));
|
|
726
731
|
});
|
|
727
732
|
});
|
|
728
|
-
}), S.log(`✨ [CellSelection.render] Total rendered cells marked: ${
|
|
733
|
+
}), S.log(`✨ [CellSelection.render] Total rendered cells marked: ${o}`);
|
|
729
734
|
}, "render"));
|
|
730
|
-
y(this, N,
|
|
735
|
+
y(this, N, s), V(this, K, ws).call(this), t(this, N).querySelectorAll(
|
|
731
736
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
732
|
-
).forEach((
|
|
733
|
-
|
|
737
|
+
).forEach((n) => {
|
|
738
|
+
n.addEventListener("scroll", () => {
|
|
734
739
|
t(this, X).startRow >= 0 && t(this, X).startCol >= 0 && this.render();
|
|
735
740
|
});
|
|
736
741
|
}), S.log("🎯 [CellSelection] Initialized");
|
|
737
742
|
}
|
|
738
|
-
setRange(
|
|
739
|
-
S.log(`🔍 [CellSelection.setRange] Input -> startRow: ${
|
|
740
|
-
let
|
|
741
|
-
const
|
|
743
|
+
setRange(s, e, n, r) {
|
|
744
|
+
S.log(`🔍 [CellSelection.setRange] Input -> startRow: ${s}, startCol: ${e}, endRow: ${n}, endCol: ${r}`);
|
|
745
|
+
let i = Math.min(s, n), o = Math.max(s, n), a = Math.min(e, r), c = Math.max(e, r);
|
|
746
|
+
const l = t(this, N).querySelectorAll(
|
|
742
747
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
743
748
|
);
|
|
744
749
|
let u = !0, f = 0;
|
|
745
750
|
for (; u && f < 5; )
|
|
746
|
-
u = !1, f++,
|
|
751
|
+
u = !1, f++, l.forEach((b) => {
|
|
747
752
|
b.querySelectorAll("tbody tr").forEach((g) => {
|
|
748
753
|
if (g.classList.contains("nodata")) return;
|
|
749
754
|
const { matrixRow: p } = V(this, K, qt).call(this, g);
|
|
750
755
|
p < 0 || g.querySelectorAll("td, th").forEach((x) => {
|
|
751
756
|
const w = parseInt(x.dataset.col, 10);
|
|
752
757
|
if (isNaN(w)) return;
|
|
753
|
-
const m = parseInt(x.rowSpan || 1, 10),
|
|
754
|
-
if (R >=
|
|
755
|
-
const z = Math.min(
|
|
756
|
-
(z !==
|
|
758
|
+
const m = parseInt(x.rowSpan || 1, 10), C = parseInt(x.colSpan || 1, 10), R = p + m - 1, M = w + C - 1;
|
|
759
|
+
if (R >= i && p <= o && M >= a && w <= c) {
|
|
760
|
+
const z = Math.min(i, p), Gt = Math.max(o, R), bs = Math.min(a, w), ps = Math.max(c, M);
|
|
761
|
+
(z !== i || Gt !== o || bs !== a || ps !== c) && (i = z, o = Gt, a = bs, c = ps, u = !0);
|
|
757
762
|
}
|
|
758
763
|
});
|
|
759
764
|
});
|
|
760
765
|
});
|
|
761
|
-
y(this, X, { startRow:
|
|
766
|
+
y(this, X, { startRow: i, startCol: a, endRow: o, endCol: c }), S.log("📦 [CellSelection.setRange] Final Range ->", t(this, X)), this.render();
|
|
762
767
|
}
|
|
763
768
|
};
|
|
764
|
-
N = new WeakMap(), X = new WeakMap(), K = new WeakSet(), qt = /* @__PURE__ */ h(function(
|
|
765
|
-
if (!
|
|
766
|
-
const e = parseInt(
|
|
769
|
+
N = new WeakMap(), X = new WeakMap(), K = new WeakSet(), qt = /* @__PURE__ */ h(function(s) {
|
|
770
|
+
if (!s || s.classList.contains("nodata")) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
|
|
771
|
+
const e = parseInt(s.dataset.row, 10);
|
|
767
772
|
if (isNaN(e)) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
|
|
768
|
-
const
|
|
769
|
-
return { dataRow: e, subRowIndex:
|
|
773
|
+
const n = s.closest("tbody"), i = Array.from(n.querySelectorAll("tr:not(.nodata)")).filter((l) => parseInt(l.dataset.row, 10) === e), o = i.indexOf(s), a = i.length > 0 ? i.length : 1, c = e * a + (o >= 0 ? o : s.sectionRowIndex % a);
|
|
774
|
+
return { dataRow: e, subRowIndex: o, matrixRow: c };
|
|
770
775
|
}, "#getMatrixRow"), ws = /* @__PURE__ */ h(function() {
|
|
771
|
-
const
|
|
772
|
-
if (!
|
|
776
|
+
const s = t(this, N).querySelector(".ng-container-top");
|
|
777
|
+
if (!s) {
|
|
773
778
|
S.log("❌ [CellSelection] .ng-container-top not found!");
|
|
774
779
|
return;
|
|
775
780
|
}
|
|
776
|
-
|
|
781
|
+
s.addEventListener("mousedown", (e) => {
|
|
777
782
|
if (e.button !== 0) return;
|
|
778
|
-
const
|
|
779
|
-
if (!
|
|
783
|
+
const n = e.target.closest("td, th");
|
|
784
|
+
if (!n || n.dataset.row === void 0 || n.dataset.col === void 0 || n.closest("tr").classList.contains("nodata")) return;
|
|
780
785
|
t(this, N).style.userSelect = "none", t(this, N).style.webkitUserSelect = "none";
|
|
781
|
-
const r =
|
|
782
|
-
if (
|
|
786
|
+
const r = n.closest("tr"), { matrixRow: i } = V(this, K, qt).call(this, r), o = parseInt(n.dataset.col, 10);
|
|
787
|
+
if (i < 0) {
|
|
783
788
|
t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "";
|
|
784
789
|
return;
|
|
785
790
|
}
|
|
786
|
-
S.log(`🖱️ [MouseDown Success] startRow: ${
|
|
787
|
-
let a =
|
|
788
|
-
const
|
|
791
|
+
S.log(`🖱️ [MouseDown Success] startRow: ${i}, startCol: ${o}`), t(this, N).navigation.currentCell = n;
|
|
792
|
+
let a = i, c = o;
|
|
793
|
+
const l = /* @__PURE__ */ h((f) => {
|
|
789
794
|
const b = document.elementFromPoint(f.clientX, f.clientY);
|
|
790
795
|
let g = b == null ? void 0 : b.closest("td, th");
|
|
791
796
|
if (!g || !t(this, N).contains(g)) {
|
|
792
797
|
const m = t(this, N).querySelectorAll(".ng-part-body tbody tr:not(.nodata) td, .ng-part-body tbody tr:not(.nodata) th");
|
|
793
|
-
for (const
|
|
794
|
-
const R =
|
|
798
|
+
for (const C of m) {
|
|
799
|
+
const R = C.getBoundingClientRect();
|
|
795
800
|
if (f.clientX >= R.left && f.clientX <= R.right && f.clientY >= R.top && f.clientY <= R.bottom) {
|
|
796
|
-
g =
|
|
801
|
+
g = C;
|
|
797
802
|
break;
|
|
798
803
|
}
|
|
799
804
|
}
|
|
800
805
|
}
|
|
801
806
|
if (!g || g.dataset.row === void 0 || g.dataset.col === void 0 || g.closest("tr").classList.contains("nodata")) return;
|
|
802
807
|
const p = g.closest("tr"), { matrixRow: x } = V(this, K, qt).call(this, p), w = parseInt(g.dataset.col, 10);
|
|
803
|
-
x < 0 || a === x &&
|
|
808
|
+
x < 0 || a === x && c === w || (a = x, c = w, this.setRange(i, o, x, w));
|
|
804
809
|
}, "onMouseMove"), u = /* @__PURE__ */ h(() => {
|
|
805
|
-
S.log("🖱️ [MouseUp] Drag ended."), t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "", document.removeEventListener("mousemove",
|
|
810
|
+
S.log("🖱️ [MouseUp] Drag ended."), t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "", document.removeEventListener("mousemove", l), document.removeEventListener("mouseup", u);
|
|
806
811
|
}, "onMouseUp");
|
|
807
|
-
document.addEventListener("mousemove",
|
|
812
|
+
document.addEventListener("mousemove", l), document.addEventListener("mouseup", u);
|
|
808
813
|
});
|
|
809
814
|
}, "#initEvents"), h(rs, "CellSelection");
|
|
810
815
|
let Le = rs;
|
|
811
816
|
var F, lt, ae, le, pt, He, Ot, Dt, Bt, ct, Wt, vs;
|
|
812
817
|
const os = class os {
|
|
813
|
-
constructor(
|
|
818
|
+
constructor(s) {
|
|
814
819
|
d(this, pt);
|
|
815
820
|
d(this, F);
|
|
816
821
|
d(this, lt, null);
|
|
817
822
|
d(this, ae, -1);
|
|
818
823
|
d(this, le, -1);
|
|
819
|
-
d(this, Ot, /* @__PURE__ */ h((
|
|
824
|
+
d(this, Ot, /* @__PURE__ */ h((s) => {
|
|
820
825
|
const e = [];
|
|
821
|
-
return
|
|
826
|
+
return s.forEach((n) => e.push(...Array.from(n.querySelectorAll("td")))), e.length === 0 ? null : (e.sort((n, r) => parseInt(n.dataset.col, 10) - parseInt(r.dataset.col, 10)), e[e.length - 1]);
|
|
822
827
|
}, "#getMaxColCell"));
|
|
823
|
-
d(this, Dt, /* @__PURE__ */ h((
|
|
824
|
-
const
|
|
825
|
-
if (
|
|
828
|
+
d(this, Dt, /* @__PURE__ */ h((s, e) => {
|
|
829
|
+
const n = t(this, ct).call(this, s);
|
|
830
|
+
if (n.length === 0) return e + 1;
|
|
826
831
|
let r = e + 1;
|
|
827
|
-
const
|
|
828
|
-
|
|
829
|
-
for (const
|
|
830
|
-
const a = parseInt(
|
|
831
|
-
if (e >= a && e < a +
|
|
832
|
-
r = a +
|
|
832
|
+
const i = [];
|
|
833
|
+
n.forEach((o) => i.push(...Array.from(o.querySelectorAll("td")))), i.sort((o, a) => parseInt(o.dataset.col, 10) - parseInt(a.dataset.col, 10));
|
|
834
|
+
for (const o of i) {
|
|
835
|
+
const a = parseInt(o.dataset.col, 10), c = parseInt(o.colSpan || 1, 10);
|
|
836
|
+
if (e >= a && e < a + c) {
|
|
837
|
+
r = a + c;
|
|
833
838
|
break;
|
|
834
839
|
}
|
|
835
840
|
}
|
|
836
841
|
return r;
|
|
837
842
|
}, "#getNextCol"));
|
|
838
|
-
d(this, Bt, /* @__PURE__ */ h((
|
|
839
|
-
const
|
|
840
|
-
if (
|
|
843
|
+
d(this, Bt, /* @__PURE__ */ h((s, e) => {
|
|
844
|
+
const n = t(this, ct).call(this, s);
|
|
845
|
+
if (n.length === 0) return Math.max(0, e - 1);
|
|
841
846
|
let r = -1;
|
|
842
|
-
const
|
|
843
|
-
|
|
844
|
-
for (const
|
|
845
|
-
const a = parseInt(
|
|
847
|
+
const i = [];
|
|
848
|
+
n.forEach((o) => i.push(...Array.from(o.querySelectorAll("td")))), i.sort((o, a) => parseInt(o.dataset.col, 10) - parseInt(a.dataset.col, 10));
|
|
849
|
+
for (const o of i) {
|
|
850
|
+
const a = parseInt(o.dataset.col, 10);
|
|
846
851
|
if (a < e)
|
|
847
852
|
r = a;
|
|
848
853
|
else
|
|
@@ -851,107 +856,107 @@ const os = class os {
|
|
|
851
856
|
return r;
|
|
852
857
|
}, "#getPreviousCol"));
|
|
853
858
|
// 🎯 레거시의 병합 셀(rowSpan) 블록 포용 탐색 로직 이식
|
|
854
|
-
d(this, ct, /* @__PURE__ */ h((
|
|
859
|
+
d(this, ct, /* @__PURE__ */ h((s) => {
|
|
855
860
|
const e = t(this, F).querySelectorAll(
|
|
856
861
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
857
|
-
),
|
|
862
|
+
), n = [];
|
|
858
863
|
return e.forEach((r) => {
|
|
859
|
-
const
|
|
860
|
-
for (const
|
|
861
|
-
const a = parseInt(
|
|
862
|
-
if (f ===
|
|
863
|
-
|
|
864
|
+
const i = Array.from(r.querySelectorAll("tbody tr:not(.nodata)"));
|
|
865
|
+
for (const o of i) {
|
|
866
|
+
const a = parseInt(o.dataset.row, 10), c = i.filter((p) => parseInt(p.dataset.row, 10) === a), l = c.length > 0 ? c.length : 1, u = c.indexOf(o), f = a * l + (u >= 0 ? u : 0);
|
|
867
|
+
if (f === s) {
|
|
868
|
+
n.push(o);
|
|
864
869
|
break;
|
|
865
870
|
}
|
|
866
|
-
const b = Array.from(
|
|
871
|
+
const b = Array.from(o.querySelectorAll("td"));
|
|
867
872
|
let g = !1;
|
|
868
873
|
for (const p of b) {
|
|
869
874
|
const x = parseInt(p.rowSpan || 1, 10);
|
|
870
|
-
if (x > 1 &&
|
|
871
|
-
|
|
875
|
+
if (x > 1 && s >= f && s < f + x) {
|
|
876
|
+
n.push(o), g = !0;
|
|
872
877
|
break;
|
|
873
878
|
}
|
|
874
879
|
}
|
|
875
880
|
if (g) break;
|
|
876
881
|
}
|
|
877
|
-
}),
|
|
882
|
+
}), n;
|
|
878
883
|
}, "#findTargetTrsByMatrix"));
|
|
879
884
|
// 🎯 rowSpan 및 colSpan 경계를 모두 충족하는 셀을 3분할 전체 영역에서 탐색
|
|
880
|
-
d(this, Wt, /* @__PURE__ */ h((
|
|
881
|
-
const
|
|
885
|
+
d(this, Wt, /* @__PURE__ */ h((s, e, n, r) => {
|
|
886
|
+
const i = t(this, F).querySelectorAll(
|
|
882
887
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
883
|
-
),
|
|
884
|
-
for (const a of
|
|
885
|
-
const
|
|
886
|
-
for (const
|
|
887
|
-
const u = parseInt(
|
|
888
|
+
), o = r !== void 0 ? r : s * 1 + e;
|
|
889
|
+
for (const a of i) {
|
|
890
|
+
const c = Array.from(a.querySelectorAll("tbody tr:not(.nodata)"));
|
|
891
|
+
for (const l of c) {
|
|
892
|
+
const u = parseInt(l.dataset.row, 10), f = c.filter((w) => parseInt(w.dataset.row, 10) === u), b = f.length > 0 ? f.length : 1, g = f.indexOf(l), p = u * b + (g >= 0 ? g : 0), x = Array.from(l.querySelectorAll("td"));
|
|
888
893
|
for (const w of x) {
|
|
889
|
-
const m = parseInt(w.dataset.col, 10),
|
|
890
|
-
if (!isNaN(m) &&
|
|
894
|
+
const m = parseInt(w.dataset.col, 10), C = parseInt(w.colSpan || 1, 10), R = parseInt(w.rowSpan || 1, 10);
|
|
895
|
+
if (!isNaN(m) && n >= m && n < m + C && o >= p && o < p + R && window.getComputedStyle(w).display !== "none")
|
|
891
896
|
return w;
|
|
892
897
|
}
|
|
893
898
|
}
|
|
894
899
|
}
|
|
895
900
|
return null;
|
|
896
901
|
}, "#getNearElement"));
|
|
897
|
-
y(this, F,
|
|
902
|
+
y(this, F, s), V(this, pt, vs).call(this), S.log("🎯 [CellNavigation] Initialized");
|
|
898
903
|
}
|
|
899
904
|
get currentCell() {
|
|
900
905
|
return t(this, lt);
|
|
901
906
|
}
|
|
902
|
-
set currentCell(
|
|
903
|
-
if (!
|
|
904
|
-
y(this, lt,
|
|
905
|
-
const e = parseInt(
|
|
906
|
-
if (!isNaN(e) && !isNaN(
|
|
907
|
-
y(this, ae, e), y(this, le,
|
|
908
|
-
const r =
|
|
909
|
-
if (
|
|
910
|
-
const a = Array.from(
|
|
911
|
-
t(this, F).selection.setRange(u,
|
|
907
|
+
set currentCell(s) {
|
|
908
|
+
if (!s) return;
|
|
909
|
+
y(this, lt, s), s.focus({ preventScroll: !0 });
|
|
910
|
+
const e = parseInt(s.dataset.row, 10), n = parseInt(s.dataset.col, 10);
|
|
911
|
+
if (!isNaN(e) && !isNaN(n)) {
|
|
912
|
+
y(this, ae, e), y(this, le, n);
|
|
913
|
+
const r = s.closest("tr"), i = r == null ? void 0 : r.closest("tbody");
|
|
914
|
+
if (i) {
|
|
915
|
+
const a = Array.from(i.querySelectorAll("tr:not(.nodata)")).filter((f) => parseInt(f.dataset.row, 10) === e), c = a.length > 0 ? a.length : 1, l = a.indexOf(r), u = e * c + (l >= 0 ? l : 0);
|
|
916
|
+
t(this, F).selection.setRange(u, n, u, n);
|
|
912
917
|
}
|
|
913
918
|
}
|
|
914
919
|
}
|
|
915
|
-
moveCell(
|
|
916
|
-
var m,
|
|
920
|
+
moveCell(s) {
|
|
921
|
+
var m, C, R, M;
|
|
917
922
|
if (!t(this, lt)) return;
|
|
918
|
-
const e = t(this, lt),
|
|
919
|
-
if (!
|
|
920
|
-
const
|
|
921
|
-
let b = f, g =
|
|
922
|
-
switch (
|
|
923
|
+
const e = t(this, lt), n = e.closest("tr"), r = parseInt(e.dataset.row, 10), i = parseInt(e.dataset.col, 10), o = n == null ? void 0 : n.closest("tbody");
|
|
924
|
+
if (!o) return;
|
|
925
|
+
const c = Array.from(o.querySelectorAll("tr:not(.nodata)")).filter((B) => parseInt(B.dataset.row, 10) === r), l = c.length > 0 ? c.length : 1, u = c.indexOf(n), f = r * l + (u >= 0 ? u : 0);
|
|
926
|
+
let b = f, g = i;
|
|
927
|
+
switch (s.code) {
|
|
923
928
|
case "Tab":
|
|
924
|
-
if (
|
|
925
|
-
if (g = t(this, Bt).call(this, f,
|
|
929
|
+
if (s.preventDefault(), s.shiftKey) {
|
|
930
|
+
if (g = t(this, Bt).call(this, f, i), g < 0 && f > 0) {
|
|
926
931
|
b = f - 1;
|
|
927
932
|
const B = t(this, ct).call(this, b), z = t(this, Ot).call(this, B);
|
|
928
933
|
g = z ? parseInt(z.dataset.col, 10) : 0;
|
|
929
934
|
}
|
|
930
935
|
} else {
|
|
931
|
-
g = t(this, Dt).call(this, f,
|
|
936
|
+
g = t(this, Dt).call(this, f, i);
|
|
932
937
|
const B = t(this, ct).call(this, f), z = t(this, Ot).call(this, B), Gt = z ? parseInt(z.dataset.col, 10) + parseInt(z.colSpan || 1, 10) : 0;
|
|
933
938
|
g >= Gt && (b = f + 1, g = 0);
|
|
934
939
|
}
|
|
935
940
|
break;
|
|
936
941
|
case "ArrowRight":
|
|
937
|
-
g = t(this, Dt).call(this, f,
|
|
942
|
+
g = t(this, Dt).call(this, f, i);
|
|
938
943
|
break;
|
|
939
944
|
case "ArrowLeft":
|
|
940
|
-
g = t(this, Bt).call(this, f,
|
|
945
|
+
g = t(this, Bt).call(this, f, i);
|
|
941
946
|
break;
|
|
942
947
|
case "ArrowDown":
|
|
943
|
-
|
|
948
|
+
s.preventDefault(), b = f + (e.rowSpan || 1);
|
|
944
949
|
break;
|
|
945
950
|
case "ArrowUp":
|
|
946
|
-
|
|
951
|
+
s.preventDefault(), b = Math.max(0, f - (e.rowSpan || 1));
|
|
947
952
|
break;
|
|
948
953
|
}
|
|
949
|
-
const p = Math.floor(b /
|
|
954
|
+
const p = Math.floor(b / l), x = b % l;
|
|
950
955
|
let w = t(this, Wt).call(this, p, x, g, b);
|
|
951
956
|
if (w)
|
|
952
957
|
this.currentCell = w, V(this, pt, He).call(this, w);
|
|
953
958
|
else if (p !== r && p >= 0) {
|
|
954
|
-
const B = ((
|
|
959
|
+
const B = ((C = (m = t(this, F)).getRowHeight) == null ? void 0 : C.call(m)) || 40;
|
|
955
960
|
(M = (R = t(this, F)).scrollToY) == null || M.call(R, p * B), setTimeout(() => {
|
|
956
961
|
const z = t(this, Wt).call(this, p, x, g, b);
|
|
957
962
|
z && (this.currentCell = z, V(this, pt, He).call(this, z));
|
|
@@ -960,19 +965,19 @@ const os = class os {
|
|
|
960
965
|
}
|
|
961
966
|
};
|
|
962
967
|
F = new WeakMap(), lt = new WeakMap(), ae = new WeakMap(), le = new WeakMap(), pt = new WeakSet(), // 🎯 셀이 보이지 않는 영역에 있을 때 컨테이너 스크롤을 동기화하는 함수
|
|
963
|
-
He = /* @__PURE__ */ h(function(
|
|
968
|
+
He = /* @__PURE__ */ h(function(s) {
|
|
964
969
|
const e = t(this, F).querySelector(".ng-container-body .ng-part-body");
|
|
965
970
|
if (!e) return;
|
|
966
|
-
const
|
|
967
|
-
|
|
971
|
+
const n = s.getBoundingClientRect(), r = e.getBoundingClientRect();
|
|
972
|
+
n.top < r.top ? e.scrollTop -= r.top - n.top : n.bottom > r.bottom && (e.scrollTop += n.bottom - r.bottom), n.left < r.left ? e.scrollLeft -= r.left - n.left : n.right > r.right && (e.scrollLeft += n.right - r.right);
|
|
968
973
|
}, "#ensureCellVisible"), Ot = new WeakMap(), Dt = new WeakMap(), Bt = new WeakMap(), ct = new WeakMap(), Wt = new WeakMap(), vs = /* @__PURE__ */ h(function() {
|
|
969
|
-
t(this, F).addEventListener("keydown", (
|
|
970
|
-
["Tab", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(
|
|
974
|
+
t(this, F).addEventListener("keydown", (s) => {
|
|
975
|
+
["Tab", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(s.code) && this.moveCell(s);
|
|
971
976
|
});
|
|
972
977
|
}, "#initEvents"), h(os, "CellNavigation");
|
|
973
978
|
let Me = os;
|
|
974
|
-
var ce, ht, dt, zt, Pt, he, de, xt, fe,
|
|
975
|
-
const
|
|
979
|
+
var ce, ht, dt, zt, Pt, he, de, xt, fe, ue;
|
|
980
|
+
const Tt = class Tt extends HTMLElement {
|
|
976
981
|
constructor() {
|
|
977
982
|
super();
|
|
978
983
|
d(this, ce);
|
|
@@ -986,10 +991,10 @@ const Ct = class Ct extends HTMLElement {
|
|
|
986
991
|
q(this, "generate", /* @__PURE__ */ h((e) => {
|
|
987
992
|
if (S.log("sheet.generate()"), !e) return;
|
|
988
993
|
y(this, ht, Ie.compile(e)), t(this, he).call(this), t(this, de).call(this);
|
|
989
|
-
const
|
|
990
|
-
|
|
991
|
-
var
|
|
992
|
-
(
|
|
994
|
+
const n = this.querySelector(".ng-container-body .ng-part-header"), r = this.querySelector(".ng-container-body .ng-part-footer"), i = this.querySelector(".ng-nodata-overlay");
|
|
995
|
+
n && i && (i.style.top = `${n.offsetHeight}px`), r && i && (i.style.bottom = `${r.offsetHeight}px`), t(this, dt).initialize(), setTimeout(() => {
|
|
996
|
+
var o;
|
|
997
|
+
(o = this.querySelector("nine-table-hscrollbar")) == null || o.refresh();
|
|
993
998
|
}, 0);
|
|
994
999
|
}, "generate"));
|
|
995
1000
|
d(this, he, /* @__PURE__ */ h(() => {
|
|
@@ -997,56 +1002,56 @@ const Ct = class Ct extends HTMLElement {
|
|
|
997
1002
|
{ selector: ".ng-container-body", type: null },
|
|
998
1003
|
{ selector: ".ng-container-left", type: "left" },
|
|
999
1004
|
{ selector: ".ng-container-right", type: "right" }
|
|
1000
|
-
].forEach(({ selector:
|
|
1001
|
-
var
|
|
1002
|
-
(
|
|
1005
|
+
].forEach(({ selector: n, type: r }) => {
|
|
1006
|
+
var i, o, a;
|
|
1007
|
+
(i = this.querySelector(`${n} .ng-part-header`)) == null || i.appendChild(t(this, xt).call(this, t(this, ht), r, "header")), (o = this.querySelector(`${n} .ng-virtual-spacer`)) == null || o.before(t(this, xt).call(this, t(this, ht), r, "body")), (a = this.querySelector(`${n} .ng-part-footer`)) == null || a.appendChild(t(this, xt).call(this, t(this, ht), r, "footer"));
|
|
1003
1008
|
});
|
|
1004
1009
|
}, "#renderSplitContainers"));
|
|
1005
1010
|
d(this, de, /* @__PURE__ */ h(() => {
|
|
1006
1011
|
["left", "right", "body"].forEach((e) => {
|
|
1007
|
-
const
|
|
1008
|
-
if (!
|
|
1009
|
-
let
|
|
1010
|
-
r[0].querySelectorAll("col").forEach((
|
|
1011
|
-
const a = parseInt(
|
|
1012
|
-
isNaN(a) || (
|
|
1013
|
-
}), e === "body" ? (
|
|
1014
|
-
|
|
1015
|
-
})) : (
|
|
1016
|
-
|
|
1012
|
+
const n = this.querySelector(`.ng-container-${e}`), r = n == null ? void 0 : n.querySelectorAll("table");
|
|
1013
|
+
if (!n || !r || r.length === 0) return;
|
|
1014
|
+
let i = 0;
|
|
1015
|
+
r[0].querySelectorAll("col").forEach((o) => {
|
|
1016
|
+
const a = parseInt(o.getAttribute("width"), 10);
|
|
1017
|
+
isNaN(a) || (i += a);
|
|
1018
|
+
}), e === "body" ? (n.style.flex = "1", r.forEach((o) => {
|
|
1019
|
+
o.style.width = `${i}px`, o.style.minWidth = `${i}px`;
|
|
1020
|
+
})) : (n.style.flex = `0 0 ${i}px`, n.style.width = `${i}px`, r.forEach((o) => {
|
|
1021
|
+
o.style.width = `${i}px`, o.style.minWidth = `${i}px`;
|
|
1017
1022
|
}));
|
|
1018
1023
|
});
|
|
1019
1024
|
}, "#updateContainerWidths"));
|
|
1020
|
-
d(this, xt, /* @__PURE__ */ h((e,
|
|
1021
|
-
const
|
|
1025
|
+
d(this, xt, /* @__PURE__ */ h((e, n, r) => {
|
|
1026
|
+
const i = e.cloneNode(!0), o = i.querySelector("thead"), a = i.querySelector("tbody"), c = i.querySelector("tfoot");
|
|
1022
1027
|
if (r === "header") {
|
|
1023
|
-
if (a && a.remove(),
|
|
1028
|
+
if (a && a.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
1024
1029
|
const u = document.createElement("tbody");
|
|
1025
|
-
u.className = "fixed-tbody",
|
|
1030
|
+
u.className = "fixed-tbody", i.appendChild(u);
|
|
1026
1031
|
}
|
|
1027
|
-
} else r === "body" ? (
|
|
1028
|
-
return
|
|
1029
|
-
|
|
1030
|
-
}) :
|
|
1031
|
-
|
|
1032
|
-
}) :
|
|
1033
|
-
|
|
1034
|
-
}),
|
|
1032
|
+
} else r === "body" ? (o && o.remove(), c && c.remove(), a && (a.className = "bindable-tbody")) : r === "footer" && (o && o.remove(), a && a.remove());
|
|
1033
|
+
return n === "left" ? i.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
1034
|
+
l.getAttribute("fixed") !== "left" && l.remove();
|
|
1035
|
+
}) : n === "right" ? i.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
1036
|
+
l.getAttribute("fixed") !== "right" && l.remove();
|
|
1037
|
+
}) : i.querySelectorAll("[fixed=left], [fixed=right]").forEach((l) => {
|
|
1038
|
+
l.remove();
|
|
1039
|
+
}), i;
|
|
1035
1040
|
}, "#createSplitTable"));
|
|
1036
1041
|
q(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, dt).getRowHeight(), "getRowHeight"));
|
|
1037
1042
|
q(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
1038
|
-
const
|
|
1039
|
-
|
|
1043
|
+
const n = this.querySelector(".ng-container-body .ng-part-body");
|
|
1044
|
+
n && (n.scrollLeft = e);
|
|
1040
1045
|
}, "scrollToX"));
|
|
1041
1046
|
q(this, "scrollToY", /* @__PURE__ */ h((e) => {
|
|
1042
|
-
const
|
|
1043
|
-
|
|
1047
|
+
const n = this.querySelector(".ng-container-body .ng-part-body");
|
|
1048
|
+
n && (n.scrollTop = e);
|
|
1044
1049
|
}, "scrollToY"));
|
|
1045
1050
|
d(this, fe, /* @__PURE__ */ h(() => {
|
|
1046
|
-
t(this,
|
|
1051
|
+
t(this, ue).call(this), y(this, zt, new Le(this)), y(this, Pt, new Me(this));
|
|
1047
1052
|
}, "#init"));
|
|
1048
|
-
d(this,
|
|
1049
|
-
const e =
|
|
1053
|
+
d(this, ue, /* @__PURE__ */ h(() => {
|
|
1054
|
+
const e = Tt.SCROLLBAR_SIZE;
|
|
1050
1055
|
this.innerHTML = `
|
|
1051
1056
|
<style>
|
|
1052
1057
|
nine-table-sheet {
|
|
@@ -1262,22 +1267,22 @@ const Ct = class Ct extends HTMLElement {
|
|
|
1262
1267
|
this.innerHTML = "", S.log("NineTableSheet destroyed.");
|
|
1263
1268
|
}
|
|
1264
1269
|
};
|
|
1265
|
-
ce = new WeakMap(), ht = new WeakMap(), dt = new WeakMap(), zt = new WeakMap(), Pt = new WeakMap(), he = new WeakMap(), de = new WeakMap(), xt = new WeakMap(), fe = new WeakMap(),
|
|
1266
|
-
let Zt =
|
|
1270
|
+
ce = new WeakMap(), ht = new WeakMap(), dt = new WeakMap(), zt = new WeakMap(), Pt = new WeakMap(), he = new WeakMap(), de = new WeakMap(), xt = new WeakMap(), fe = new WeakMap(), ue = new WeakMap(), h(Tt, "NineTableSheet"), q(Tt, "SCROLLBAR_SIZE", 16);
|
|
1271
|
+
let Zt = Tt;
|
|
1267
1272
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", Zt);
|
|
1268
|
-
var
|
|
1273
|
+
var ge, Ft;
|
|
1269
1274
|
const is = class is extends HTMLElement {
|
|
1270
1275
|
constructor() {
|
|
1271
1276
|
super();
|
|
1272
|
-
d(this,
|
|
1277
|
+
d(this, ge, /* @__PURE__ */ h(() => {
|
|
1273
1278
|
var e;
|
|
1274
|
-
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (
|
|
1275
|
-
var
|
|
1276
|
-
const r =
|
|
1277
|
-
t(this, Ft).call(this,
|
|
1279
|
+
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (n) => {
|
|
1280
|
+
var o;
|
|
1281
|
+
const r = n.ctrlKey || n.metaKey || n.shiftKey, i = parseInt((o = n.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
|
|
1282
|
+
t(this, Ft).call(this, i, r);
|
|
1278
1283
|
}), t(this, Ft).call(this, 0, !1);
|
|
1279
1284
|
}, "#init"));
|
|
1280
|
-
d(this, Ft, /* @__PURE__ */ h((e,
|
|
1285
|
+
d(this, Ft, /* @__PURE__ */ h((e, n = !1) => {
|
|
1281
1286
|
const r = /* @__PURE__ */ h(() => {
|
|
1282
1287
|
const u = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
1283
1288
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((g) => g.style.setProperty("display", "none"));
|
|
@@ -1286,58 +1291,58 @@ const is = class is extends HTMLElement {
|
|
|
1286
1291
|
const p = parseInt(g.getAttribute("data-index"), 10), x = this.querySelector(`nine-splitter[data-split-index="${p}"]`), w = u[p + 1];
|
|
1287
1292
|
x && w && w.classList.contains("active") && x.style.setProperty("display", "flex");
|
|
1288
1293
|
});
|
|
1289
|
-
}, "updateSplitters"),
|
|
1294
|
+
}, "updateSplitters"), i = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = i.querySelectorAll(".nine-tab-item"), c = o.querySelectorAll("nine-table-sheet");
|
|
1290
1295
|
if (!a[e]) return;
|
|
1291
|
-
if (!
|
|
1296
|
+
if (!n)
|
|
1292
1297
|
a.forEach((u, f) => {
|
|
1293
1298
|
u.classList.toggle("active", f === e);
|
|
1294
|
-
}),
|
|
1299
|
+
}), c.forEach((u, f) => {
|
|
1295
1300
|
const b = f === e;
|
|
1296
1301
|
u.classList.toggle("active", b), u.style.flex = b ? "1 1 100%" : "";
|
|
1297
1302
|
});
|
|
1298
1303
|
else {
|
|
1299
|
-
const u = a[e], f =
|
|
1304
|
+
const u = a[e], f = i.querySelectorAll(".nine-tab-item.active");
|
|
1300
1305
|
if (u.classList.contains("active") && f.length <= 1)
|
|
1301
1306
|
return;
|
|
1302
1307
|
u.classList.toggle("active");
|
|
1303
|
-
const b =
|
|
1308
|
+
const b = o.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
1304
1309
|
b && (b.classList.toggle("active"), b.classList.contains("active") || (b.style.flex = ""));
|
|
1305
1310
|
}
|
|
1306
|
-
const
|
|
1307
|
-
|
|
1308
|
-
u.style.flex =
|
|
1311
|
+
const l = o.querySelectorAll("nine-table-sheet.active");
|
|
1312
|
+
l == null || l.forEach((u) => {
|
|
1313
|
+
u.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
1309
1314
|
}), r();
|
|
1310
1315
|
}, "#switchSheet"));
|
|
1311
1316
|
}
|
|
1312
1317
|
connectedCallback() {
|
|
1313
|
-
t(this,
|
|
1318
|
+
t(this, ge).call(this);
|
|
1314
1319
|
}
|
|
1315
1320
|
};
|
|
1316
|
-
|
|
1321
|
+
ge = new WeakMap(), Ft = new WeakMap(), h(is, "NineTableSheets");
|
|
1317
1322
|
let $e = is;
|
|
1318
1323
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", $e);
|
|
1319
1324
|
var _, be, jt, pe;
|
|
1320
1325
|
const as = class as {
|
|
1321
|
-
constructor(
|
|
1326
|
+
constructor(s) {
|
|
1322
1327
|
d(this, _);
|
|
1323
1328
|
d(this, be, /* @__PURE__ */ h(() => {
|
|
1324
|
-
t(this, pe).call(this), new ResizeObserver((
|
|
1325
|
-
for (let e of
|
|
1329
|
+
t(this, pe).call(this), new ResizeObserver((s) => {
|
|
1330
|
+
for (let e of s)
|
|
1326
1331
|
t(this, _).getAttribute("auto-height") === "true" && t(this, jt).call(this);
|
|
1327
1332
|
}).observe(t(this, _));
|
|
1328
1333
|
}, "#init"));
|
|
1329
1334
|
d(this, jt, /* @__PURE__ */ h(() => {
|
|
1330
|
-
var
|
|
1331
|
-
const
|
|
1332
|
-
if (
|
|
1333
|
-
const e = parseInt(t(this, _).getAttribute("max-display-row"), 10) || 10,
|
|
1335
|
+
var c, l;
|
|
1336
|
+
const s = Array.from(t(this, _).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
1337
|
+
if (s.length === 0) return;
|
|
1338
|
+
const e = parseInt(t(this, _).getAttribute("max-display-row"), 10) || 10, n = Math.max(...s.map((u) => u.getRowHeight())), r = (c = t(this, _).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, i = (l = t(this, _).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = Zt.SCROLLBAR_SIZE, a = e * n + r + i + o;
|
|
1334
1339
|
t(this, _).style.height = `${a}px`;
|
|
1335
1340
|
}, "#applyAutoHeight"));
|
|
1336
1341
|
d(this, pe, /* @__PURE__ */ h(() => {
|
|
1337
|
-
const e = Array.from(t(this, _).children).filter((
|
|
1338
|
-
const f = `<nine-table-sheet class="${
|
|
1342
|
+
const e = Array.from(t(this, _).children).filter((c) => c.tagName === "TABLE"), n = t(this, _).getAttribute("auto-height") === "true", r = e.length, i = e.map((c, l) => {
|
|
1343
|
+
const f = `<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>` : "";
|
|
1339
1344
|
return f + b;
|
|
1340
|
-
}).join(""),
|
|
1345
|
+
}).join(""), o = e.map((c, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
1341
1346
|
t(this, _).shadowRoot.innerHTML = `
|
|
1342
1347
|
<style>
|
|
1343
1348
|
:host {
|
|
@@ -1345,7 +1350,7 @@ const as = class as {
|
|
|
1345
1350
|
flex-direction: column;
|
|
1346
1351
|
position: relative;
|
|
1347
1352
|
overflow: hidden;
|
|
1348
|
-
height: ${
|
|
1353
|
+
height: ${n ? "auto" : "100%"};
|
|
1349
1354
|
background: #fff;
|
|
1350
1355
|
}
|
|
1351
1356
|
|
|
@@ -1449,9 +1454,9 @@ const as = class as {
|
|
|
1449
1454
|
<nine-table-body>
|
|
1450
1455
|
<nine-table-summary></nine-table-summary>
|
|
1451
1456
|
<nine-table-sheets>
|
|
1452
|
-
<nine-table-sheets-body>${
|
|
1457
|
+
<nine-table-sheets-body>${i}</nine-table-sheets-body>
|
|
1453
1458
|
<nine-table-sheets-footer>
|
|
1454
|
-
<div class="nine-tab-bar">${
|
|
1459
|
+
<div class="nine-tab-bar">${o}</div>
|
|
1455
1460
|
<div class="sheets-counter">Total : <span id="row-count">0</span></div>
|
|
1456
1461
|
</nine-table-sheets-footer>
|
|
1457
1462
|
</nine-table-sheets>
|
|
@@ -1460,30 +1465,30 @@ const as = class as {
|
|
|
1460
1465
|
<nine-table-footer></nine-table-footer>
|
|
1461
1466
|
`, t(this, _).shadowRoot.querySelector("nine-table-sheets").classList.add("nodata");
|
|
1462
1467
|
const a = t(this, _).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1463
|
-
a == null || a.forEach((
|
|
1464
|
-
e[
|
|
1465
|
-
|
|
1468
|
+
a == null || a.forEach((c, l) => {
|
|
1469
|
+
e[l] && setTimeout(() => {
|
|
1470
|
+
c.generate(e[l]), n && t(this, jt).call(this);
|
|
1466
1471
|
});
|
|
1467
1472
|
});
|
|
1468
1473
|
}, "#render"));
|
|
1469
|
-
y(this, _,
|
|
1474
|
+
y(this, _, s), t(this, be).call(this);
|
|
1470
1475
|
}
|
|
1471
1476
|
};
|
|
1472
1477
|
_ = new WeakMap(), be = new WeakMap(), jt = new WeakMap(), pe = new WeakMap(), h(as, "LayoutManager");
|
|
1473
1478
|
let Ne = as;
|
|
1474
1479
|
var Yt, wt;
|
|
1475
1480
|
const ls = class ls {
|
|
1476
|
-
constructor(
|
|
1481
|
+
constructor(s) {
|
|
1477
1482
|
d(this, Yt);
|
|
1478
1483
|
d(this, wt, -1);
|
|
1479
1484
|
q(this, "count", /* @__PURE__ */ h(() => t(this, Yt).rawRecords.length, "count"));
|
|
1480
|
-
y(this, Yt,
|
|
1485
|
+
y(this, Yt, s);
|
|
1481
1486
|
}
|
|
1482
1487
|
get at() {
|
|
1483
1488
|
return t(this, wt);
|
|
1484
1489
|
}
|
|
1485
|
-
set at(
|
|
1486
|
-
y(this, wt, parseInt(
|
|
1490
|
+
set at(s) {
|
|
1491
|
+
y(this, wt, parseInt(s, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, wt)}"]`) && setTimeout(() => {
|
|
1487
1492
|
});
|
|
1488
1493
|
}
|
|
1489
1494
|
};
|
|
@@ -1491,7 +1496,7 @@ Yt = new WeakMap(), wt = new WeakMap(), h(ls, "ngRow");
|
|
|
1491
1496
|
let _e = ls;
|
|
1492
1497
|
var D, I, W, vt, ye, J, me, ft, Vt, xe, we, St;
|
|
1493
1498
|
const P = class P {
|
|
1494
|
-
constructor(
|
|
1499
|
+
constructor(s, e) {
|
|
1495
1500
|
d(this, D);
|
|
1496
1501
|
d(this, I);
|
|
1497
1502
|
d(this, W, []);
|
|
@@ -1500,35 +1505,35 @@ const P = class P {
|
|
|
1500
1505
|
d(this, J, []);
|
|
1501
1506
|
d(this, me, /* @__PURE__ */ h(() => {
|
|
1502
1507
|
y(this, J, []);
|
|
1503
|
-
const
|
|
1504
|
-
Array.from(
|
|
1505
|
-
var
|
|
1506
|
-
t(this, J).push(((
|
|
1508
|
+
const s = t(this, D).template || [];
|
|
1509
|
+
Array.from(s).forEach((e) => {
|
|
1510
|
+
var n;
|
|
1511
|
+
t(this, J).push(((n = e.getBoundingClientRect) == null ? void 0 : n.call(e).height) || 24);
|
|
1507
1512
|
}), (t(this, I).rawRecords || []).forEach((e) => {
|
|
1508
1513
|
e.__ng || (e.__ng = t(this, Vt).call(this)), e.__ng.height = t(this, J).slice();
|
|
1509
1514
|
});
|
|
1510
1515
|
}, "#initialize"));
|
|
1511
1516
|
d(this, ft, /* @__PURE__ */ h(() => {
|
|
1512
|
-
const
|
|
1513
|
-
|
|
1517
|
+
const s = t(this, D).shadowRoot.querySelector("nine-table-sheets");
|
|
1518
|
+
s == null || s.classList.toggle("nodata", this.length === 0), t(this, D).shadowRoot.querySelectorAll("nine-table-sheet").forEach((e) => {
|
|
1514
1519
|
e.invalidate();
|
|
1515
1520
|
});
|
|
1516
1521
|
}, "#invalidate"));
|
|
1517
|
-
q(this, "get", /* @__PURE__ */ h((
|
|
1518
|
-
var
|
|
1519
|
-
const
|
|
1520
|
-
if (!
|
|
1521
|
-
if (
|
|
1522
|
-
if (
|
|
1523
|
-
const r = typeof ((
|
|
1522
|
+
q(this, "get", /* @__PURE__ */ h((s, e) => {
|
|
1523
|
+
var i;
|
|
1524
|
+
const n = this.getValidData();
|
|
1525
|
+
if (!n || n.length <= 0) return;
|
|
1526
|
+
if (s == null) return t(this, St).call(this, n);
|
|
1527
|
+
if (s < 0 || s >= n.length) return null;
|
|
1528
|
+
const r = typeof ((i = t(this, D).fields) == null ? void 0 : i.get) == "function" ? t(this, D).fields.get() : [];
|
|
1524
1529
|
if (e != null) {
|
|
1525
|
-
const
|
|
1526
|
-
return
|
|
1530
|
+
const o = r.indexOf(e);
|
|
1531
|
+
return o >= 0 ? n[s].v[o] : null;
|
|
1527
1532
|
}
|
|
1528
|
-
return t(this, St).call(this, s
|
|
1533
|
+
return t(this, St).call(this, n[s]);
|
|
1529
1534
|
}, "get"));
|
|
1530
|
-
q(this, "set", /* @__PURE__ */ h((
|
|
1531
|
-
this.clear(), this.add(
|
|
1535
|
+
q(this, "set", /* @__PURE__ */ h((s) => {
|
|
1536
|
+
this.clear(), this.add(s, !1), t(this, ft).call(this);
|
|
1532
1537
|
}, "set"));
|
|
1533
1538
|
d(this, Vt, /* @__PURE__ */ h(() => ({
|
|
1534
1539
|
rowState: P.ROW_STATE.EMPTY,
|
|
@@ -1543,81 +1548,81 @@ const P = class P {
|
|
|
1543
1548
|
y(this, W, []), y(this, vt, []), t(this, ft).call(this);
|
|
1544
1549
|
}, "reset"));
|
|
1545
1550
|
q(this, "clear", /* @__PURE__ */ h(() => {
|
|
1546
|
-
var
|
|
1547
|
-
t(this, I).rawRecords = [], y(this, W, []), y(this, vt, []), (
|
|
1551
|
+
var s;
|
|
1552
|
+
t(this, I).rawRecords = [], y(this, W, []), y(this, vt, []), (s = t(this, I).viewRecords) != null && s.reset && t(this, I).viewRecords.reset();
|
|
1548
1553
|
}, "clear"));
|
|
1549
|
-
d(this, xe, /* @__PURE__ */ h((
|
|
1554
|
+
d(this, xe, /* @__PURE__ */ h((s) => {
|
|
1550
1555
|
var r;
|
|
1551
|
-
Array.isArray(
|
|
1552
|
-
const e = typeof ((r = t(this, D).fields) == null ? void 0 : r.get) == "function" ? t(this, D).fields.get() : Object.keys(
|
|
1553
|
-
return
|
|
1554
|
-
const
|
|
1556
|
+
Array.isArray(s) || (s = [s]);
|
|
1557
|
+
const e = typeof ((r = t(this, D).fields) == null ? void 0 : r.get) == "function" ? t(this, D).fields.get() : Object.keys(s[0] || {}), n = [];
|
|
1558
|
+
return s.forEach((i) => {
|
|
1559
|
+
const o = { v: [] };
|
|
1555
1560
|
e.forEach((a) => {
|
|
1556
|
-
|
|
1557
|
-
}),
|
|
1558
|
-
}),
|
|
1561
|
+
o.v.push(i[a] !== void 0 && i[a] !== null ? i[a] : "");
|
|
1562
|
+
}), n.push(o);
|
|
1563
|
+
}), n;
|
|
1559
1564
|
}, "#json2Array"));
|
|
1560
|
-
d(this, we, /* @__PURE__ */ h((
|
|
1565
|
+
d(this, we, /* @__PURE__ */ h((s) => (Array.isArray(s) || (s = [s]), s.forEach((e) => {
|
|
1561
1566
|
e.__ng = t(this, Vt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = P.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1562
|
-
}),
|
|
1563
|
-
q(this, "add", /* @__PURE__ */ h((
|
|
1564
|
-
|
|
1565
|
-
const
|
|
1566
|
-
t(this, I).rawRecords = t(this, I).rawRecords.concat(t(this, we).call(this,
|
|
1567
|
+
}), s), "#defaultInsert"));
|
|
1568
|
+
q(this, "add", /* @__PURE__ */ h((s, e = !0) => {
|
|
1569
|
+
s === void 0 && (s = {});
|
|
1570
|
+
const n = t(this, xe).call(this, s);
|
|
1571
|
+
t(this, I).rawRecords = t(this, I).rawRecords.concat(t(this, we).call(this, n)), this.resetRecords();
|
|
1567
1572
|
const r = this.count() - 1;
|
|
1568
|
-
return e ||
|
|
1569
|
-
const a = t(this, I).rawRecords[r -
|
|
1573
|
+
return e || n.forEach((i, o) => {
|
|
1574
|
+
const a = t(this, I).rawRecords[r - o];
|
|
1570
1575
|
a && (a.__ng.rowState = P.ROW_STATE.EMPTY);
|
|
1571
1576
|
}), t(this, ft).call(this), r;
|
|
1572
1577
|
}, "add"));
|
|
1573
|
-
q(this, "delete", /* @__PURE__ */ h((
|
|
1578
|
+
q(this, "delete", /* @__PURE__ */ h((s) => {
|
|
1574
1579
|
let e = [];
|
|
1575
|
-
Array.isArray(
|
|
1576
|
-
if (t(this, W)[
|
|
1577
|
-
const r = t(this, W)[
|
|
1578
|
-
t(this, W)[
|
|
1579
|
-
|
|
1580
|
+
Array.isArray(s) ? e = s : typeof s > "u" ? e = [t(this, I).host.row.at] : e = [parseInt(s, 10)], e.sort((n, r) => r - n).forEach((n) => {
|
|
1581
|
+
if (t(this, W)[n]) {
|
|
1582
|
+
const r = t(this, W)[n].__ng.rowid;
|
|
1583
|
+
t(this, W)[n].__ng.rowState === P.ROW_STATE.INSERT ? t(this, I).rawRecords = t(this, I).rawRecords.filter((i) => i.__ng.rowid !== r) : t(this, I).rawRecords.forEach((i) => {
|
|
1584
|
+
i.__ng.rowid === r && (i.__ng.deleted = !0, i.__ng.rowState = P.ROW_STATE.DELETE);
|
|
1580
1585
|
});
|
|
1581
1586
|
}
|
|
1582
1587
|
}), this.resetRecords(), t(this, ft).call(this);
|
|
1583
1588
|
}, "delete"));
|
|
1584
|
-
q(this, "setValue", /* @__PURE__ */ h((
|
|
1585
|
-
var
|
|
1586
|
-
|
|
1587
|
-
const
|
|
1588
|
-
if (
|
|
1589
|
-
const
|
|
1590
|
-
if (!
|
|
1591
|
-
const a =
|
|
1592
|
-
a !==
|
|
1589
|
+
q(this, "setValue", /* @__PURE__ */ h((s, e, n) => {
|
|
1590
|
+
var c;
|
|
1591
|
+
s = parseInt(s, 10);
|
|
1592
|
+
const i = (typeof ((c = t(this, D).fields) == null ? void 0 : c.get) == "function" ? t(this, D).fields.get() : []).indexOf(e);
|
|
1593
|
+
if (i < 0) return;
|
|
1594
|
+
const o = this.getValidData()[s];
|
|
1595
|
+
if (!o) return;
|
|
1596
|
+
const a = o.v[i];
|
|
1597
|
+
a !== n && o.__ng.rowState !== P.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = a), o.__ng.rowState = P.ROW_STATE.UPDATE), o.v[i] = n;
|
|
1593
1598
|
}, "setValue"));
|
|
1594
1599
|
q(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1595
|
-
y(this, vt, t(this, I).rawRecords.filter((
|
|
1596
|
-
|
|
1597
|
-
}), t(this, W).forEach((
|
|
1598
|
-
|
|
1600
|
+
y(this, vt, t(this, I).rawRecords.filter((s) => !s.__ng.deleted)), y(this, W, t(this, I).rawRecords.filter((s) => !s.__ng.deleted && !s.__ng.filtered)), t(this, I).rawRecords.forEach((s, e) => {
|
|
1601
|
+
s.__ng.rowidx = e;
|
|
1602
|
+
}), t(this, W).forEach((s, e) => {
|
|
1603
|
+
s.__ng.i = e;
|
|
1599
1604
|
});
|
|
1600
1605
|
}, "resetRecords"));
|
|
1601
1606
|
q(this, "getValidData", /* @__PURE__ */ h(() => (t(this, W).length === 0 && t(this, I).rawRecords.length > 0 && this.resetRecords(), t(this, W)), "getValidData"));
|
|
1602
|
-
d(this, St, /* @__PURE__ */ h((
|
|
1603
|
-
var
|
|
1604
|
-
if (!
|
|
1605
|
-
const e = !Array.isArray(
|
|
1606
|
-
const
|
|
1607
|
-
return r.forEach((
|
|
1608
|
-
l
|
|
1609
|
-
}),
|
|
1607
|
+
d(this, St, /* @__PURE__ */ h((s) => {
|
|
1608
|
+
var o;
|
|
1609
|
+
if (!s) return s;
|
|
1610
|
+
const e = !Array.isArray(s), n = e ? [s] : s, r = typeof ((o = t(this, D).fields) == null ? void 0 : o.get) == "function" ? t(this, D).fields.get() : [], i = n.filter((a) => !a.__ng.deleted).map((a) => {
|
|
1611
|
+
const c = {};
|
|
1612
|
+
return r.forEach((l, u) => {
|
|
1613
|
+
c[l] = a.v ? a.v[u] : a[l];
|
|
1614
|
+
}), c.__ng = a.__ng, c;
|
|
1610
1615
|
});
|
|
1611
|
-
return e ?
|
|
1616
|
+
return e ? i[0] : i;
|
|
1612
1617
|
}, "#conv"));
|
|
1613
1618
|
q(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1614
|
-
y(this, D,
|
|
1619
|
+
y(this, D, s), y(this, I, e), t(this, me).call(this);
|
|
1615
1620
|
}
|
|
1616
1621
|
get source() {
|
|
1617
1622
|
return t(this, St).call(this, t(this, I).rawRecords);
|
|
1618
1623
|
}
|
|
1619
|
-
set source(
|
|
1620
|
-
this.clear(), this.add(
|
|
1624
|
+
set source(s) {
|
|
1625
|
+
this.clear(), this.add(s, !1);
|
|
1621
1626
|
}
|
|
1622
1627
|
get nextId() {
|
|
1623
1628
|
return ++xs(this, ye)._;
|
|
@@ -1641,71 +1646,71 @@ q(P, "ROW_STATE", {
|
|
|
1641
1646
|
DELETE: "DELETE"
|
|
1642
1647
|
});
|
|
1643
1648
|
let Oe = P;
|
|
1644
|
-
var
|
|
1649
|
+
var ut;
|
|
1645
1650
|
const cs = class cs {
|
|
1646
|
-
constructor(
|
|
1647
|
-
d(this,
|
|
1648
|
-
y(this,
|
|
1651
|
+
constructor(s) {
|
|
1652
|
+
d(this, ut);
|
|
1653
|
+
y(this, ut, s), this.row = new _e(this), this.data = new Oe(t(this, ut), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1649
1654
|
var e;
|
|
1650
|
-
(e = t(this,
|
|
1655
|
+
(e = t(this, ut).view) != null && e.redraw && t(this, ut).view.redraw();
|
|
1651
1656
|
}, this.setDataSource = (e) => {
|
|
1652
1657
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1653
1658
|
}, this.getRowState = (e) => {
|
|
1654
|
-
var r,
|
|
1655
|
-
const
|
|
1656
|
-
if (!(
|
|
1657
|
-
return (
|
|
1659
|
+
var r, i;
|
|
1660
|
+
const n = parseInt(e, 10);
|
|
1661
|
+
if (!(n >= this.data.count()))
|
|
1662
|
+
return (i = (r = this.data.getValidData()[n]) == null ? void 0 : r.__ng) == null ? void 0 : i.rowState;
|
|
1658
1663
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1659
1664
|
this.row.at = e;
|
|
1660
|
-
}, 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,
|
|
1661
|
-
e = parseInt(e, 10), this.data.setValue(e,
|
|
1665
|
+
}, 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, n) => this.data.get(e, n), this.setColumn = (e, n, r) => {
|
|
1666
|
+
e = parseInt(e, 10), this.data.setValue(e, n, r);
|
|
1662
1667
|
}, this.setDataSource([]);
|
|
1663
1668
|
}
|
|
1664
1669
|
};
|
|
1665
|
-
|
|
1670
|
+
ut = new WeakMap(), h(cs, "ngDataManager");
|
|
1666
1671
|
let De = cs;
|
|
1667
1672
|
var Rt, H, Ut, ve;
|
|
1668
1673
|
const hs = class hs {
|
|
1669
1674
|
// 🎯 이제 { name: string, type: string } 객체들의 배열로 관리합니다.
|
|
1670
|
-
constructor(
|
|
1675
|
+
constructor(s) {
|
|
1671
1676
|
d(this, Rt);
|
|
1672
1677
|
d(this, H, []);
|
|
1673
|
-
q(this, "add", /* @__PURE__ */ h((
|
|
1674
|
-
|
|
1675
|
-
t(this, H).some((r) => r.name ===
|
|
1678
|
+
q(this, "add", /* @__PURE__ */ h((s, e = "string") => {
|
|
1679
|
+
s.forEach((n) => {
|
|
1680
|
+
t(this, H).some((r) => r.name === n) || t(this, H).push({ name: n, type: e });
|
|
1676
1681
|
}), t(this, Ut).call(this);
|
|
1677
1682
|
}, "add"));
|
|
1678
1683
|
d(this, Ut, /* @__PURE__ */ h(() => {
|
|
1679
|
-
const
|
|
1684
|
+
const s = /* @__PURE__ */ new Map();
|
|
1680
1685
|
t(this, H).forEach((e) => {
|
|
1681
|
-
|
|
1682
|
-
}), y(this, H, Array.from(
|
|
1686
|
+
s.set(e.name, e.type);
|
|
1687
|
+
}), y(this, H, Array.from(s, ([e, n]) => ({ name: e, type: n }))), y(this, H, t(this, H).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, H).sort((e, n) => e.name.length < n.name.length ? 1 : -1);
|
|
1683
1688
|
}, "#adjust"));
|
|
1684
1689
|
d(this, ve, /* @__PURE__ */ h(() => {
|
|
1685
1690
|
y(this, H, []), S.log(t(this, Rt).querySelectorAll("table"));
|
|
1686
|
-
const
|
|
1687
|
-
if (!(!
|
|
1688
|
-
for (const e of
|
|
1689
|
-
S.log(e), $("[data-bind]", e).each((
|
|
1690
|
-
const
|
|
1691
|
-
|
|
1692
|
-
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((
|
|
1693
|
-
$(`[${
|
|
1694
|
-
var
|
|
1695
|
-
if (
|
|
1696
|
-
const a =
|
|
1691
|
+
const s = Array.from(t(this, Rt).querySelectorAll("table"));
|
|
1692
|
+
if (!(!s || s.length === 0)) {
|
|
1693
|
+
for (const e of s)
|
|
1694
|
+
S.log(e), $("[data-bind]", e).each((n, r) => {
|
|
1695
|
+
const i = r.dataset.bind, o = r.getAttribute("data-type") || "string";
|
|
1696
|
+
i && t(this, H).push({ name: i, type: o });
|
|
1697
|
+
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((n) => {
|
|
1698
|
+
$(`[${n}]`, e).each((r, i) => {
|
|
1699
|
+
var o = i.getAttribute(n);
|
|
1700
|
+
if (o.indexOf("data.") < 0) {
|
|
1701
|
+
const a = o.search(/[(]/g);
|
|
1697
1702
|
if (a > 0)
|
|
1698
1703
|
try {
|
|
1699
|
-
|
|
1704
|
+
o = String(window[o.substring(0, a).trim()]);
|
|
1700
1705
|
} catch {
|
|
1701
|
-
|
|
1706
|
+
o = "";
|
|
1702
1707
|
}
|
|
1703
1708
|
}
|
|
1704
|
-
|
|
1709
|
+
o.split("data.").forEach((a) => {
|
|
1705
1710
|
if (a.trim() != "") {
|
|
1706
|
-
const
|
|
1707
|
-
let
|
|
1708
|
-
|
|
1711
|
+
const c = a.search(/[^_A-Za-z0-9]/g);
|
|
1712
|
+
let l = "";
|
|
1713
|
+
c >= 0 ? l = a.substring(0, c) : o.startsWith("data.") && (l = a.replace("data.", "")), l && t(this, H).push({ name: l, type: "string" });
|
|
1709
1714
|
}
|
|
1710
1715
|
});
|
|
1711
1716
|
});
|
|
@@ -1713,41 +1718,41 @@ const hs = class hs {
|
|
|
1713
1718
|
t(this, Ut).call(this);
|
|
1714
1719
|
}
|
|
1715
1720
|
}, "#init"));
|
|
1716
|
-
y(this, Rt,
|
|
1721
|
+
y(this, Rt, s), t(this, ve).call(this);
|
|
1717
1722
|
}
|
|
1718
1723
|
// 🎯 기존에 필드 이름만 쓰던 곳들과의 호환을 위해 이름 배열만 리턴하는 메서드 유지
|
|
1719
1724
|
get() {
|
|
1720
|
-
return t(this, H).map((
|
|
1725
|
+
return t(this, H).map((s) => s.name);
|
|
1721
1726
|
}
|
|
1722
1727
|
// 🎯 내부 객체 통째로 얻기
|
|
1723
1728
|
getFields() {
|
|
1724
1729
|
return t(this, H);
|
|
1725
1730
|
}
|
|
1726
1731
|
// 🎯 특정 필드의 데이터 타입 조회
|
|
1727
|
-
getType(
|
|
1728
|
-
const e = t(this, H).find((
|
|
1732
|
+
getType(s) {
|
|
1733
|
+
const e = t(this, H).find((n) => n.name === s);
|
|
1729
1734
|
return e ? e.type : "string";
|
|
1730
1735
|
}
|
|
1731
|
-
indexOf(
|
|
1732
|
-
return t(this, H).findIndex((e) => e.name ===
|
|
1736
|
+
indexOf(s) {
|
|
1737
|
+
return t(this, H).findIndex((e) => e.name === s);
|
|
1733
1738
|
}
|
|
1734
|
-
includes(
|
|
1735
|
-
return t(this, H).some((e) => e.name ===
|
|
1739
|
+
includes(s) {
|
|
1740
|
+
return t(this, H).some((e) => e.name === s);
|
|
1736
1741
|
}
|
|
1737
1742
|
};
|
|
1738
1743
|
Rt = new WeakMap(), H = new WeakMap(), Ut = new WeakMap(), ve = new WeakMap(), h(hs, "ngFields");
|
|
1739
1744
|
let Be = hs;
|
|
1740
|
-
var
|
|
1745
|
+
var gt, Se, Re;
|
|
1741
1746
|
const ds = class ds extends HTMLElement {
|
|
1742
1747
|
constructor() {
|
|
1743
1748
|
super();
|
|
1744
1749
|
//#created = false;
|
|
1745
|
-
d(this,
|
|
1750
|
+
d(this, gt);
|
|
1746
1751
|
d(this, Se);
|
|
1747
1752
|
d(this, Re, /* @__PURE__ */ h(() => {
|
|
1748
1753
|
this.fields = new Be(this), y(this, Se, new Ne(this)), S.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1749
1754
|
}, "#init"));
|
|
1750
|
-
this.attachShadow({ mode: "open" }), y(this,
|
|
1755
|
+
this.attachShadow({ mode: "open" }), y(this, gt, new De(this));
|
|
1751
1756
|
}
|
|
1752
1757
|
connectedCallback() {
|
|
1753
1758
|
t(this, Re).call(this);
|
|
@@ -1757,21 +1762,21 @@ const ds = class ds extends HTMLElement {
|
|
|
1757
1762
|
}
|
|
1758
1763
|
// 🎯 외부에서 grid.data.set(...) 형태로 접근할 수 있도록 데이터 매니저 오픈
|
|
1759
1764
|
get data() {
|
|
1760
|
-
return t(this,
|
|
1765
|
+
return t(this, gt).data;
|
|
1761
1766
|
}
|
|
1762
1767
|
// 🎯 행(row) 관련 제어 접근자 오픈
|
|
1763
1768
|
get row() {
|
|
1764
|
-
return t(this,
|
|
1769
|
+
return t(this, gt).row;
|
|
1765
1770
|
}
|
|
1766
1771
|
// 🎯 전체 데이터 매니저 접근 필요할 경우
|
|
1767
1772
|
get dataManager() {
|
|
1768
|
-
return t(this,
|
|
1773
|
+
return t(this, gt);
|
|
1769
1774
|
}
|
|
1770
1775
|
};
|
|
1771
|
-
|
|
1776
|
+
gt = new WeakMap(), Se = new WeakMap(), Re = new WeakMap(), h(ds, "NineTable");
|
|
1772
1777
|
let We = ds;
|
|
1773
1778
|
customElements.get("nine-table") || customElements.define("nine-table", We);
|
|
1774
|
-
const
|
|
1779
|
+
const Ct = class Ct extends HTMLElement {
|
|
1775
1780
|
// 👈 커스텀 스타일용 캐시 추가
|
|
1776
1781
|
constructor() {
|
|
1777
1782
|
super();
|
|
@@ -1782,8 +1787,8 @@ const Tt = class Tt extends HTMLElement {
|
|
|
1782
1787
|
connectedCallback() {
|
|
1783
1788
|
}
|
|
1784
1789
|
};
|
|
1785
|
-
h(
|
|
1786
|
-
let ze =
|
|
1790
|
+
h(Ct, "BasicCellElement"), q(Ct, "_styleCache", /* @__PURE__ */ new Map()), q(Ct, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1791
|
+
let ze = Ct;
|
|
1787
1792
|
var L, Xt, v, Xe, Ke, Ge, Ze, Je;
|
|
1788
1793
|
const fs = class fs extends ze {
|
|
1789
1794
|
constructor() {
|
|
@@ -1798,15 +1803,15 @@ const fs = class fs extends ze {
|
|
|
1798
1803
|
q(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1799
1804
|
if (t(this, v))
|
|
1800
1805
|
if (t(this, v).closest("tbody")) {
|
|
1801
|
-
const
|
|
1802
|
-
if (!
|
|
1806
|
+
const n = t(this, v).closest("tr").data, r = parseInt(t(this, v).dataset.row);
|
|
1807
|
+
if (!n) return "";
|
|
1803
1808
|
if (ninegrid.isNull(t(this, v).dataset.expr)) {
|
|
1804
1809
|
if (!ninegrid.isNull(t(this, v).dataset.bind))
|
|
1805
|
-
return
|
|
1810
|
+
return n[t(this, v).dataset.bind] || ninegrid.nvl(e, "");
|
|
1806
1811
|
} else try {
|
|
1807
|
-
return this.getExprValue(t(this, v).dataset.expr,
|
|
1812
|
+
return this.getExprValue(t(this, v).dataset.expr, n, r, t(this, v));
|
|
1808
1813
|
} catch {
|
|
1809
|
-
console.error(t(this, v).dataset.expr,
|
|
1814
|
+
console.error(t(this, v).dataset.expr, n, t(this, v).dataset.row);
|
|
1810
1815
|
}
|
|
1811
1816
|
return ninegrid.nvl(e, "");
|
|
1812
1817
|
} else
|
|
@@ -1819,37 +1824,37 @@ const fs = class fs extends ze {
|
|
|
1819
1824
|
if (!(!t(this, L) || !t(this, L).template || !t(this, v).closest("tbody.bindable"))) {
|
|
1820
1825
|
var e = ninegrid.j.querySelectorAll(t(this, v)).attr("suppress");
|
|
1821
1826
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1822
|
-
var
|
|
1823
|
-
$("th,td",
|
|
1824
|
-
var R = ninegrid.j.querySelectorAll(
|
|
1825
|
-
R &&
|
|
1827
|
+
var n = t(this, v).closest("tr"), r = [];
|
|
1828
|
+
$("th,td", n).each((m, C) => {
|
|
1829
|
+
var R = ninegrid.j.querySelectorAll(C).attr("suppress");
|
|
1830
|
+
R && C.dataset.row && (R = parseInt(R), !isNaN(R) && R <= e && r.push(R));
|
|
1826
1831
|
}), r.sort();
|
|
1827
|
-
var
|
|
1828
|
-
if (parseInt(
|
|
1829
|
-
for (var
|
|
1830
|
-
if (
|
|
1831
|
-
var a = parseInt(t(this, v).dataset.row),
|
|
1832
|
+
var i = !1;
|
|
1833
|
+
if (parseInt(n.sectionRowIndex / t(this, L).template.length) > 0)
|
|
1834
|
+
for (var o of r) {
|
|
1835
|
+
if (o > e) break;
|
|
1836
|
+
var a = parseInt(t(this, v).dataset.row), c = a - 1, l = t(this, v).closest("tr").data, u = t(this, L).data.get(c);
|
|
1832
1837
|
t(this, v).dataset.matrixRow;
|
|
1833
|
-
var f = t(this, L).body.querySelector(`tbody.bindable [suppress="${
|
|
1838
|
+
var f = t(this, L).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, v).dataset.matrixRow}"]`), b = f.dataset.expr ? this.getExprValue(f.dataset.expr, l, a) : l[f.dataset.bind], g = f.dataset.expr ? this.getExprValue(f.dataset.expr, u, c) : u[f.dataset.bind];
|
|
1834
1839
|
if (b != g) {
|
|
1835
|
-
|
|
1840
|
+
i = !0;
|
|
1836
1841
|
break;
|
|
1837
1842
|
}
|
|
1838
1843
|
}
|
|
1839
1844
|
else
|
|
1840
|
-
|
|
1841
|
-
|
|
1845
|
+
i = !0;
|
|
1846
|
+
i ? ninegrid.j.querySelectorAll(t(this, v)).removeClass("suppress") : ninegrid.j.querySelectorAll(t(this, v)).addClass("suppress"), ninegrid.j.querySelectorAll(t(this, v)).hasClass("hidden") || (i ? ninegrid.j.querySelectorAll(t(this, v)).removeClass("hidden") : ninegrid.j.querySelectorAll(t(this, v)).addClass("hidden"));
|
|
1842
1847
|
var p = parseInt(t(this, v).dataset.matrixRow), x = p - 1, w = t(this, L).body.querySelector(`tbody.bindable [data-col="${t(this, v).dataset.col}"][data-matrix-row="${x}"]`);
|
|
1843
1848
|
$(w).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this, v)).hasClass("suppress") ? ninegrid.j.querySelectorAll(w).removeClass("last-none-suppress").addClass("last-suppress") : !$(w).hasClass("suppress") && ninegrid.j.querySelectorAll(t(this, v)).hasClass("suppress") ? ninegrid.j.querySelectorAll(w).removeClass("last-suppress").addClass("last-none-suppress") : ninegrid.j.querySelectorAll(w).removeClass("last-none-suppress").removeClass("last-suppress");
|
|
1844
1849
|
}
|
|
1845
1850
|
}
|
|
1846
1851
|
}, "#resetSuppress"));
|
|
1847
|
-
q(this, "getExprValue", /* @__PURE__ */ h((e,
|
|
1852
|
+
q(this, "getExprValue", /* @__PURE__ */ h((e, n, r, i) => {
|
|
1848
1853
|
if (typeof e < "u")
|
|
1849
1854
|
try {
|
|
1850
1855
|
r = parseInt(r);
|
|
1851
|
-
const
|
|
1852
|
-
return t(this, L)[
|
|
1856
|
+
const o = e.replace("()", "");
|
|
1857
|
+
return t(this, L)[o] ? t(this, L)[o].call(this, n, r, t(this, v)) : t(this, L).exprFunction(e).call(this, n, r, t(this, L).data);
|
|
1853
1858
|
} catch {
|
|
1854
1859
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1855
1860
|
}
|
|
@@ -1865,9 +1870,9 @@ const fs = class fs extends ze {
|
|
|
1865
1870
|
return e ?? "";
|
|
1866
1871
|
}
|
|
1867
1872
|
set value(e) {
|
|
1868
|
-
var
|
|
1873
|
+
var n = parseInt(t(this, v).dataset.row);
|
|
1869
1874
|
const r = this.getAttribute("update-row-state") != "false";
|
|
1870
|
-
|
|
1875
|
+
n < 0 ? t(this, L).data.setValueNF(parseInt(t(this, v).dataset.index), t(this, v).dataset.bind, e, r) : t(this, L).data.setValue(n, t(this, v).dataset.bind, e, r);
|
|
1871
1876
|
}
|
|
1872
1877
|
get row() {
|
|
1873
1878
|
return parseInt(t(this, v).dataset.row);
|
|
@@ -1882,7 +1887,7 @@ const fs = class fs extends ze {
|
|
|
1882
1887
|
};
|
|
1883
1888
|
L = new WeakMap(), Xt = new WeakMap(), v = new WeakMap(), Xe = new WeakMap(), Ke = new WeakMap(), Ge = new WeakMap(), Ze = new WeakMap(), Je = new WeakMap(), h(fs, "CellElement");
|
|
1884
1889
|
let Pe = fs;
|
|
1885
|
-
const
|
|
1890
|
+
const us = class us extends Pe {
|
|
1886
1891
|
constructor() {
|
|
1887
1892
|
super();
|
|
1888
1893
|
}
|
|
@@ -1893,10 +1898,10 @@ const gs = class gs extends Pe {
|
|
|
1893
1898
|
return super.refresh();
|
|
1894
1899
|
}
|
|
1895
1900
|
};
|
|
1896
|
-
h(
|
|
1897
|
-
let Fe =
|
|
1901
|
+
h(us, "EditableCellElement");
|
|
1902
|
+
let Fe = us;
|
|
1898
1903
|
var Kt, bt, At, Et, Ae, Q, Qe;
|
|
1899
|
-
const
|
|
1904
|
+
const gs = class gs extends Fe {
|
|
1900
1905
|
constructor() {
|
|
1901
1906
|
super();
|
|
1902
1907
|
d(this, Kt);
|
|
@@ -1942,12 +1947,12 @@ const us = class us extends Fe {
|
|
|
1942
1947
|
d(this, Qe, /* @__PURE__ */ h((e) => {
|
|
1943
1948
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1944
1949
|
if (t(this, bt) == "number") {
|
|
1945
|
-
let
|
|
1946
|
-
if (t(this, Q) && Number(t(this, Q)) > 0 &&
|
|
1947
|
-
var
|
|
1950
|
+
let i = [];
|
|
1951
|
+
if (t(this, Q) && Number(t(this, Q)) > 0 && i.push("."), t(this, Et) && Number(t(this, Et)) >= 0 && i.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !i.includes(e.key) && e.preventDefault(), t(this, Q) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
|
|
1952
|
+
var n = e.target.value, r = n.indexOf(".");
|
|
1948
1953
|
if (r >= 0) {
|
|
1949
|
-
var
|
|
1950
|
-
|
|
1954
|
+
var n = n.substr(r + 1, n.length);
|
|
1955
|
+
n.length >= Number(t(this, Q)) && e.preventDefault();
|
|
1951
1956
|
}
|
|
1952
1957
|
}
|
|
1953
1958
|
}
|
|
@@ -1957,8 +1962,8 @@ const us = class us extends Fe {
|
|
|
1957
1962
|
if (this.applyBaseStyle(), y(this, bt, this.getAttribute("type") || "text"), y(this, At, this.getAttribute("maxbyte")), y(this, Et, this.getAttribute("min")), y(this, Ae, this.getAttribute("max")), y(this, Q, this.getAttribute("scale")), !["text", "number"].includes(t(this, bt))) throw `invalid type : ${t(this, bt)}`;
|
|
1958
1963
|
}
|
|
1959
1964
|
connectedCallback() {
|
|
1960
|
-
for (var e = [],
|
|
1961
|
-
["type", "maxlength", "maxbyte", "min", "max", "step", "scale", "text-align"].includes(this.attributes[
|
|
1965
|
+
for (var e = [], n = 0; n < this.attributes.length; n++)
|
|
1966
|
+
["type", "maxlength", "maxbyte", "min", "max", "step", "scale", "text-align"].includes(this.attributes[n].name) && e.push(`${this.attributes[n].name}="${this.attributes[n].value}"`);
|
|
1962
1967
|
this.innerHTML = `
|
|
1963
1968
|
<input type="text"
|
|
1964
1969
|
${e.join(" ")}
|
|
@@ -1967,8 +1972,8 @@ const us = class us extends Fe {
|
|
|
1967
1972
|
`, super.connectedCallback(), y(this, Kt, this.querySelector("input"));
|
|
1968
1973
|
}
|
|
1969
1974
|
};
|
|
1970
|
-
Kt = new WeakMap(), bt = new WeakMap(), At = new WeakMap(), Et = new WeakMap(), Ae = new WeakMap(), Q = new WeakMap(), Qe = new WeakMap(), h(
|
|
1971
|
-
let je =
|
|
1975
|
+
Kt = new WeakMap(), bt = new WeakMap(), At = new WeakMap(), Et = new WeakMap(), Ae = new WeakMap(), Q = new WeakMap(), Qe = new WeakMap(), h(gs, "CellInputText");
|
|
1976
|
+
let je = gs;
|
|
1972
1977
|
customElements.get("cell-input-text");
|
|
1973
1978
|
customElements.get("cell-input") || customElements.define("cell-input", je);
|
|
1974
1979
|
//# sourceMappingURL=nine-table.js.map
|