@ninebone/table 0.0.696 β 0.0.697
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 +287 -287
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +10 -10
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -2,9 +2,9 @@ var es = Object.defineProperty;
|
|
|
2
2
|
var ss = (R) => {
|
|
3
3
|
throw TypeError(R);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
5
|
+
var os = (R, n, e) => n in R ? es(R, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : R[n] = e;
|
|
6
6
|
var h = (R, n) => es(R, "name", { value: n, configurable: !0 });
|
|
7
|
-
var E = (R, n, e) =>
|
|
7
|
+
var E = (R, n, e) => os(R, typeof n != "symbol" ? n + "" : n, e), he = (R, n, e) => n.has(R) || ss("Cannot " + e);
|
|
8
8
|
var t = (R, n, e) => (he(R, n, "read from private field"), e ? e.call(R) : n.get(R)), d = (R, n, e) => n.has(R) ? ss("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(R) : n.set(R, e), p = (R, n, e, s) => (he(R, n, "write to private field"), s ? s.call(R, e) : n.set(R, e), e), de = (R, n, e) => (he(R, n, "access private method"), e);
|
|
9
9
|
var ns = (R, n, e, s) => ({
|
|
10
10
|
set _(r) {
|
|
@@ -15,72 +15,72 @@ var ns = (R, n, e, s) => ({
|
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
import { trace as as } from "@ninebone/util";
|
|
18
|
-
const
|
|
18
|
+
const We = class We extends as.constructor {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
h(
|
|
24
|
-
let fe =
|
|
23
|
+
h(We, "Trace");
|
|
24
|
+
let fe = We;
|
|
25
25
|
const T = new fe();
|
|
26
|
-
var
|
|
27
|
-
const
|
|
26
|
+
var B, V, S, K, Z, G, Ot, J, Bt;
|
|
27
|
+
const Oe = class Oe extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
d(this,
|
|
30
|
+
d(this, B);
|
|
31
31
|
d(this, V, !1);
|
|
32
32
|
d(this, S);
|
|
33
33
|
d(this, K);
|
|
34
34
|
d(this, Z);
|
|
35
35
|
d(this, G);
|
|
36
|
-
d(this,
|
|
37
|
-
if (!t(this,
|
|
38
|
-
const e = t(this,
|
|
36
|
+
d(this, Ot, /* @__PURE__ */ h(() => {
|
|
37
|
+
if (!t(this, B)) return;
|
|
38
|
+
const e = t(this, B).querySelector(".ng-container-body .ng-part-body");
|
|
39
39
|
e && (p(this, G, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
41
|
})), t(this, G).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
44
|
-
if (!t(this,
|
|
44
|
+
if (!t(this, B) || !t(this, S) || t(this, V)) return;
|
|
45
45
|
const e = t(this, S).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const r = t(this, S).track,
|
|
47
|
+
const r = t(this, S).track, i = t(this, S).thumb, o = t(this, B).querySelector(".ng-container-bottom"), a = e.clientWidth, c = s.scrollWidth;
|
|
48
48
|
if (a !== 0 && c > a)
|
|
49
|
-
|
|
49
|
+
o && (o.style.display = "flex");
|
|
50
50
|
else {
|
|
51
|
-
|
|
51
|
+
o && (o.style.display = "none");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
54
|
const l = r.clientWidth;
|
|
55
55
|
if (l <= 0) return;
|
|
56
56
|
const f = Math.max(Math.min(l * (a / c), l), 20);
|
|
57
|
-
|
|
57
|
+
i.style.width = `${f}px`;
|
|
58
58
|
const g = e.scrollLeft, b = c - a;
|
|
59
59
|
let u = 0;
|
|
60
60
|
b > 0 && (u = parseInt(g / b * (l - f), 10)), u < 0 && (u = 0);
|
|
61
61
|
const y = l - f;
|
|
62
|
-
u > y && (u = y),
|
|
62
|
+
u > y && (u = y), i.style.left = `${u}px`, t(this, S).left.disabled = u === 0, t(this, S).right.disabled = u >= y - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
64
|
d(this, J, /* @__PURE__ */ h((e) => {
|
|
65
65
|
if (!t(this, S)) return !1;
|
|
66
66
|
const s = t(this, S).container, r = s.querySelector("table");
|
|
67
67
|
if (!r) return !1;
|
|
68
|
-
const
|
|
68
|
+
const i = t(this, S).track.getBoundingClientRect(), o = t(this, S).thumb.clientWidth;
|
|
69
69
|
let a = e;
|
|
70
70
|
a < 0 && (a = 0);
|
|
71
|
-
const c =
|
|
71
|
+
const c = i.width - o;
|
|
72
72
|
a > c && (a = c), a = parseInt(a, 10), t(this, S).thumb.style.left = `${a}px`, t(this, S).left.disabled = a === 0, t(this, S).right.disabled = a >= c - 1;
|
|
73
73
|
const l = s.clientWidth, g = r.scrollWidth - l;
|
|
74
74
|
return c > 0 && g > 0 && (s.scrollLeft = a / c * g), a > 0 && a < c - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
d(this,
|
|
76
|
+
d(this, Bt, /* @__PURE__ */ h(() => {
|
|
77
77
|
const e = /* @__PURE__ */ h((r) => {
|
|
78
78
|
clearInterval(t(this, K)), clearInterval(t(this, Z));
|
|
79
|
-
const
|
|
80
|
-
t(this, J).call(this,
|
|
79
|
+
const i = parseInt(t(this, S).thumb.style.left || 0, 10);
|
|
80
|
+
t(this, J).call(this, i + r), p(this, K, setInterval(() => {
|
|
81
81
|
clearInterval(t(this, K)), p(this, Z, setInterval(() => {
|
|
82
|
-
const
|
|
83
|
-
t(this, J).call(this,
|
|
82
|
+
const o = parseInt(t(this, S).thumb.style.left || 0, 10);
|
|
83
|
+
t(this, J).call(this, o + r) || clearInterval(t(this, Z));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), s = /* @__PURE__ */ h(() => {
|
|
@@ -95,24 +95,24 @@ const Be = class Be extends HTMLElement {
|
|
|
95
95
|
}), t(this, S).left.addEventListener("touchstart", () => e(-20)), t(this, S).right.addEventListener("touchstart", () => e(20)), t(this, S).track.addEventListener("mousedown", (r) => {
|
|
96
96
|
if (r.button !== 0) return;
|
|
97
97
|
r.preventDefault();
|
|
98
|
-
const
|
|
99
|
-
t(this, J).call(this, r.clientX -
|
|
98
|
+
const i = t(this, S).track.getBoundingClientRect(), o = t(this, S).thumb.clientWidth;
|
|
99
|
+
t(this, J).call(this, r.clientX - i.left - o / 2);
|
|
100
100
|
}), t(this, S).thumb.addEventListener("mousedown", (r) => {
|
|
101
101
|
if (r.button !== 0) return;
|
|
102
102
|
r.stopPropagation(), r.preventDefault(), p(this, V, !0), this.shiftX = r.clientX - t(this, S).thumb.getBoundingClientRect().left;
|
|
103
|
-
const
|
|
103
|
+
const i = /* @__PURE__ */ h((a) => {
|
|
104
104
|
if (!t(this, V)) return;
|
|
105
105
|
const c = t(this, S).track.getBoundingClientRect();
|
|
106
106
|
t(this, J).call(this, a.clientX - c.left - this.shiftX);
|
|
107
|
-
}, "onMouseMove"),
|
|
108
|
-
p(this, V, !1), s(), document.removeEventListener("mousemove",
|
|
107
|
+
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
108
|
+
p(this, V, !1), s(), 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
|
}
|
|
114
114
|
connectedCallback() {
|
|
115
|
-
if (p(this,
|
|
115
|
+
if (p(this, B, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, B)) return;
|
|
116
116
|
this.innerHTML = `
|
|
117
117
|
<style>
|
|
118
118
|
nine-table-hscrollbar {
|
|
@@ -177,7 +177,7 @@ const Be = class Be 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 s = t(this,
|
|
180
|
+
const s = t(this, B).querySelector(".ng-container-body .ng-part-body");
|
|
181
181
|
if (!s) {
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
@@ -190,7 +190,7 @@ const Be = class Be extends HTMLElement {
|
|
|
190
190
|
right: this.querySelector(".ng-scroll-right")
|
|
191
191
|
}), s.addEventListener("scroll", () => {
|
|
192
192
|
t(this, V) || this.refresh();
|
|
193
|
-
}), t(this,
|
|
193
|
+
}), t(this, Bt).call(this), t(this, Ot).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
@@ -198,11 +198,11 @@ const Be = class Be extends HTMLElement {
|
|
|
198
198
|
t(this, G) && t(this, G).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
|
|
202
|
-
let ue =
|
|
201
|
+
B = new WeakMap(), V = new WeakMap(), S = new WeakMap(), K = new WeakMap(), Z = new WeakMap(), G = new WeakMap(), Ot = new WeakMap(), J = new WeakMap(), Bt = new WeakMap(), h(Oe, "NineTableHScrollBar");
|
|
202
|
+
let ue = Oe;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ue);
|
|
204
204
|
var Q, tt, ct, k, wt, St, Pt;
|
|
205
|
-
const
|
|
205
|
+
const Be = class Be extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
208
|
d(this, Q);
|
|
@@ -213,17 +213,17 @@ const ze = class ze extends HTMLElement {
|
|
|
213
213
|
d(this, St, 0);
|
|
214
214
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
215
|
if (T.log("vscrollbar.refresh"), !t(this, Q) || !t(this, k)) return;
|
|
216
|
-
const e = t(this, k).container, s = t(this, k).track, r = t(this, k).thumb,
|
|
217
|
-
if (c <=
|
|
216
|
+
const e = t(this, k).container, s = t(this, k).track, r = t(this, k).thumb, i = e.clientHeight, o = t(this, Q).data.length, a = t(this, tt).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
222
|
const l = s.clientHeight;
|
|
223
223
|
if (l <= 0) return;
|
|
224
|
-
const f = Math.max(Math.min(l * (
|
|
224
|
+
const f = Math.max(Math.min(l * (i / c), l), 20);
|
|
225
225
|
r.style.height = `${f}px`;
|
|
226
|
-
const g = e.scrollTop, b = Math.max(c -
|
|
226
|
+
const g = e.scrollTop, b = Math.max(c - i, 1);
|
|
227
227
|
T.log(e, g, b);
|
|
228
228
|
let u = 0;
|
|
229
229
|
b > 0 && (u = g / b * (l - f));
|
|
@@ -233,29 +233,29 @@ const ze = class ze extends HTMLElement {
|
|
|
233
233
|
d(this, Pt, /* @__PURE__ */ h(() => {
|
|
234
234
|
T.log("nine-table-vscrollbar.#init");
|
|
235
235
|
const e = t(this, k).container, s = /* @__PURE__ */ h(() => {
|
|
236
|
-
const
|
|
237
|
-
return
|
|
236
|
+
const i = (t(this, Q).data.get() || []).length, o = t(this, tt).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(), p(this, ct, !0), p(this, wt, r.clientY), p(this, St, e.scrollTop);
|
|
242
|
-
const
|
|
242
|
+
const i = /* @__PURE__ */ h((a) => {
|
|
243
243
|
if (!t(this, ct)) return;
|
|
244
|
-
const c = t(this, k).track.getBoundingClientRect(), l = t(this, k).thumb.clientHeight, g = c.height - l, b = a.clientY - t(this, wt), u = e.clientHeight, y = s(),
|
|
245
|
-
if (g > 0 &&
|
|
246
|
-
const A = b / g *
|
|
247
|
-
let
|
|
244
|
+
const c = t(this, k).track.getBoundingClientRect(), l = t(this, k).thumb.clientHeight, g = c.height - l, b = a.clientY - t(this, wt), u = e.clientHeight, y = s(), v = Math.max(y - u, 1);
|
|
245
|
+
if (g > 0 && v > 0) {
|
|
246
|
+
const A = b / g * v;
|
|
247
|
+
let x = t(this, St) + A;
|
|
248
248
|
const M = Math.max(0, y - u);
|
|
249
|
-
|
|
249
|
+
x < 0 && (x = 0), x > M && (x = M), e.scrollTop = x;
|
|
250
250
|
}
|
|
251
251
|
this.refresh();
|
|
252
|
-
}, "onMouseMove"),
|
|
253
|
-
p(this, ct, !1), document.removeEventListener("mousemove",
|
|
252
|
+
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
253
|
+
p(this, ct, !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
|
|
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, f = e.clientHeight, g = s(), b = Math.max(g - f, 1);
|
|
259
259
|
if (l > 0 && b > 0) {
|
|
260
260
|
const u = Math.max(0, Math.min(1, a / l));
|
|
261
261
|
e.scrollTop = u * b;
|
|
@@ -350,8 +350,8 @@ const ze = class ze extends HTMLElement {
|
|
|
350
350
|
e();
|
|
351
351
|
}
|
|
352
352
|
};
|
|
353
|
-
Q = new WeakMap(), tt = new WeakMap(), ct = new WeakMap(), k = new WeakMap(), wt = new WeakMap(), St = new WeakMap(), Pt = new WeakMap(), h(
|
|
354
|
-
let ge =
|
|
353
|
+
Q = new WeakMap(), tt = new WeakMap(), ct = new WeakMap(), k = new WeakMap(), wt = new WeakMap(), St = new WeakMap(), Pt = new WeakMap(), h(Be, "NineTableVScrollBar");
|
|
354
|
+
let ge = Be;
|
|
355
355
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", ge);
|
|
356
356
|
var D, w, et, P, _, Y, st, Et, Ce, Le, Dt, Ft, At, Rt, qt, jt, Vt, Tt, He, ht, kt, Yt;
|
|
357
357
|
const Pe = class Pe {
|
|
@@ -378,26 +378,26 @@ const Pe = class Pe {
|
|
|
378
378
|
T.log("rowManager.initialize"), p(this, et, {
|
|
379
379
|
scrollTables: t(this, w).querySelectorAll(".ng-part-body table"),
|
|
380
380
|
firstTr: t(this, w).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
381
|
-
}), p(this, _, null), t(this, P).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
382
|
-
const a = t(this, w).querySelector(
|
|
381
|
+
}), p(this, _, null), t(this, P).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
382
|
+
const a = t(this, w).querySelector(o);
|
|
383
383
|
if (!a) return;
|
|
384
384
|
const c = a.querySelector(".ng-part-body table");
|
|
385
385
|
if (!c) return;
|
|
386
386
|
const l = c.querySelector("tbody.bindable-tbody");
|
|
387
387
|
if (!l) return;
|
|
388
388
|
const g = Array.from(l.querySelectorAll("tr")).map((b) => b.cloneNode(!0));
|
|
389
|
-
t(this, P).set(
|
|
389
|
+
t(this, P).set(o, g);
|
|
390
390
|
});
|
|
391
|
-
const n = t(this, w).querySelector(".ng-container-body .ng-part-body"), e = t(this, w).querySelector(".ng-container-left .ng-part-body"), s = t(this, w).querySelector(".ng-container-right .ng-part-body"), r = t(this, w).querySelector(".ng-container-body .ng-part-header"),
|
|
391
|
+
const n = t(this, w).querySelector(".ng-container-body .ng-part-body"), e = t(this, w).querySelector(".ng-container-left .ng-part-body"), s = t(this, w).querySelector(".ng-container-right .ng-part-body"), r = t(this, w).querySelector(".ng-container-body .ng-part-header"), i = t(this, w).querySelector(".ng-container-body .ng-part-footer");
|
|
392
392
|
if (n) {
|
|
393
393
|
t(this, At).call(this), t(this, Tt).call(this), t(this, Rt).call(this), t(this, ht).call(this, n.scrollTop);
|
|
394
|
-
let
|
|
394
|
+
let o = !1;
|
|
395
395
|
const a = /* @__PURE__ */ h((c) => {
|
|
396
396
|
var g;
|
|
397
|
-
if (
|
|
398
|
-
|
|
397
|
+
if (o) return;
|
|
398
|
+
o = !0;
|
|
399
399
|
const l = c.scrollTop, f = c.scrollLeft;
|
|
400
|
-
n && n.scrollTop !== l && (n.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), r && r.scrollLeft !== f && (r.scrollLeft = f),
|
|
400
|
+
n && n.scrollTop !== l && (n.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), r && r.scrollLeft !== f && (r.scrollLeft = f), i && i.scrollLeft !== f && (i.scrollLeft = f), t(this, ht).call(this, l), (g = t(this, w).querySelector("nine-table-vscrollbar")) == null || g.refresh(), o = !1;
|
|
401
401
|
}, "handleContainerScroll");
|
|
402
402
|
[n, e, s].forEach((c) => {
|
|
403
403
|
c == null || c.addEventListener("scroll", () => {
|
|
@@ -413,12 +413,12 @@ const Pe = class Pe {
|
|
|
413
413
|
const r = n.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
414
414
|
if (!r) return;
|
|
415
415
|
r.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
|
|
416
|
-
const
|
|
416
|
+
const i = r.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
417
417
|
for (let a = 0; a < t(this, Et); a++)
|
|
418
418
|
s.forEach((c) => {
|
|
419
|
-
|
|
419
|
+
o.appendChild(c.cloneNode(!0));
|
|
420
420
|
});
|
|
421
|
-
|
|
421
|
+
i ? i.before(o) : r.appendChild(o), e === ".ng-container-body" && (t(this, et).firstTr = r.querySelector("tr:not(.nodata)"));
|
|
422
422
|
}, "#renderRows"));
|
|
423
423
|
d(this, At, /* @__PURE__ */ h(() => {
|
|
424
424
|
if (t(this, _) !== null && t(this, _) > 0)
|
|
@@ -430,12 +430,12 @@ const Pe = class Pe {
|
|
|
430
430
|
const s = n.querySelector("tbody.bindable-tbody");
|
|
431
431
|
if (T.log(s), !s) throw new Error("invalid dom");
|
|
432
432
|
s.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
|
|
433
|
-
const r = s.querySelector("tr.nodata"),
|
|
433
|
+
const r = s.querySelector("tr.nodata"), i = document.createDocumentFragment();
|
|
434
434
|
e.forEach((b) => {
|
|
435
|
-
|
|
436
|
-
}), r ? r.before(
|
|
437
|
-
const
|
|
438
|
-
(a === "none" || window.getComputedStyle(
|
|
435
|
+
i.appendChild(b.cloneNode(!0));
|
|
436
|
+
}), r ? r.before(i) : s.appendChild(i);
|
|
437
|
+
const o = t(this, w), a = o.style.display, c = o.style.visibility, l = o.style.position;
|
|
438
|
+
(a === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
439
439
|
let f = 0;
|
|
440
440
|
const g = s.querySelectorAll("tr");
|
|
441
441
|
return g.forEach((b) => {
|
|
@@ -445,15 +445,15 @@ const Pe = class Pe {
|
|
|
445
445
|
u = parseFloat(y.height) || parseFloat(y.minHeight) || 0;
|
|
446
446
|
}
|
|
447
447
|
f += u;
|
|
448
|
-
}), g.forEach((b) => b.remove()),
|
|
448
|
+
}), g.forEach((b) => b.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l, f <= 0 ? -1 : (p(this, _, f), t(this, qt).call(this), t(this, _));
|
|
449
449
|
}, "#measureAndCacheHeight"));
|
|
450
450
|
d(this, Rt, /* @__PURE__ */ h(() => {
|
|
451
451
|
T.log("rowManager.#updateVirtualScrollHeight");
|
|
452
452
|
const e = (t(this, D).data.get() || []).length, s = t(this, _), r = e * s;
|
|
453
|
-
T.log("π [VirtualHeight]", { totalCount: e, rowHeight: s, totalVirtualHeight: r }), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
454
|
-
const
|
|
455
|
-
if (!
|
|
456
|
-
const a =
|
|
453
|
+
T.log("π [VirtualHeight]", { totalCount: e, rowHeight: s, totalVirtualHeight: r }), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
454
|
+
const o = t(this, w).querySelector(i);
|
|
455
|
+
if (!o) return;
|
|
456
|
+
const a = o.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
457
457
|
a && (a.style.height = `${r}px`);
|
|
458
458
|
});
|
|
459
459
|
}, "#updateVirtualScrollHeight"));
|
|
@@ -467,26 +467,26 @@ const Pe = class Pe {
|
|
|
467
467
|
var a, c, l, f, g, b;
|
|
468
468
|
const n = t(this, w).querySelector(".ng-container-left .ng-part-body table"), e = t(this, w).querySelector(".ng-container-body .ng-part-body table"), s = t(this, w).querySelector(".ng-container-right .ng-part-body table");
|
|
469
469
|
if (e) {
|
|
470
|
-
const u = n ? Array.from(n.querySelectorAll("tbody tr")) : [], y = Array.from(e.querySelectorAll("tbody tr")),
|
|
471
|
-
for (let
|
|
470
|
+
const u = n ? Array.from(n.querySelectorAll("tbody tr")) : [], y = Array.from(e.querySelectorAll("tbody tr")), v = s ? Array.from(s.querySelectorAll("tbody tr")) : [], A = Math.max(u.length, y.length, v.length);
|
|
471
|
+
for (let x = 0; x < A; x++) {
|
|
472
472
|
const M = [
|
|
473
|
-
((a = u[
|
|
474
|
-
((c = y[
|
|
475
|
-
((l = x
|
|
473
|
+
((a = u[x]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
474
|
+
((c = y[x]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
475
|
+
((l = v[x]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
476
476
|
], q = Math.max(...M);
|
|
477
|
-
q > 0 && (u[
|
|
477
|
+
q > 0 && (u[x] && (u[x].style.height = `${q}px`), y[x] && (y[x].style.height = `${q}px`), v[x] && (v[x].style.height = `${q}px`));
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
|
-
const r = t(this, w).querySelector(".ng-container-left .ng-part-footer table"),
|
|
481
|
-
if (
|
|
482
|
-
const u = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], y = Array.from(
|
|
483
|
-
for (let
|
|
480
|
+
const r = t(this, w).querySelector(".ng-container-left .ng-part-footer table"), i = t(this, w).querySelector(".ng-container-body .ng-part-footer table"), o = t(this, w).querySelector(".ng-container-right .ng-part-footer table");
|
|
481
|
+
if (i) {
|
|
482
|
+
const u = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], y = Array.from(i.querySelectorAll("tfoot tr")), v = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], A = Math.max(u.length, y.length, v.length);
|
|
483
|
+
for (let x = 0; x < A; x++) {
|
|
484
484
|
const M = [
|
|
485
|
-
((f = u[
|
|
486
|
-
((g = y[
|
|
487
|
-
((b = x
|
|
485
|
+
((f = u[x]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
486
|
+
((g = y[x]) == null ? void 0 : g.getBoundingClientRect().height) || 0,
|
|
487
|
+
((b = v[x]) == null ? void 0 : b.getBoundingClientRect().height) || 0
|
|
488
488
|
], q = Math.max(...M);
|
|
489
|
-
q > 0 && (u[
|
|
489
|
+
q > 0 && (u[x] && (u[x].style.height = `${q}px`), y[x] && (y[x].style.height = `${q}px`), v[x] && (v[x].style.height = `${q}px`));
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
492
|
}, "#syncRowHeights"));
|
|
@@ -497,10 +497,10 @@ const Pe = class Pe {
|
|
|
497
497
|
if (!s.classList.contains("active")) continue;
|
|
498
498
|
const r = e.contentRect.height;
|
|
499
499
|
if (r > 0) {
|
|
500
|
-
let
|
|
501
|
-
const
|
|
502
|
-
|
|
503
|
-
const c = Math.max(r -
|
|
500
|
+
let i = 0;
|
|
501
|
+
const o = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
|
|
502
|
+
o && (i += o.offsetHeight), a && (i += a.offsetHeight);
|
|
503
|
+
const c = Math.max(r - i, 100);
|
|
504
504
|
t(this, st) !== c && (p(this, st, c), t(this, qt).call(this), t(this, _) !== null && (t(this, Tt).call(this), this.refresh()));
|
|
505
505
|
}
|
|
506
506
|
}
|
|
@@ -519,9 +519,9 @@ const Pe = class Pe {
|
|
|
519
519
|
if (!s) return;
|
|
520
520
|
const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
521
521
|
if (!r) return;
|
|
522
|
-
const
|
|
523
|
-
|
|
524
|
-
const b = n + Math.floor(g /
|
|
522
|
+
const i = Array.from(r.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this, P).get(e)) == null ? void 0 : l.length) || 1, c = (t(this, D).data.get() || []).length;
|
|
523
|
+
i.forEach((f, g) => {
|
|
524
|
+
const b = n + Math.floor(g / o);
|
|
525
525
|
if (b >= c) {
|
|
526
526
|
f.style.visibility = "hidden";
|
|
527
527
|
return;
|
|
@@ -537,27 +537,27 @@ const Pe = class Pe {
|
|
|
537
537
|
if (!e || e <= 0) return;
|
|
538
538
|
const s = t(this, D).data.length;
|
|
539
539
|
if (s === 0) return;
|
|
540
|
-
const r = ((g = t(this, P).get(".ng-container-body")) == null ? void 0 : g.length) || 1,
|
|
541
|
-
T.log("bodyContainer.clientHeight",
|
|
542
|
-
const
|
|
540
|
+
const r = ((g = t(this, P).get(".ng-container-body")) == null ? void 0 : g.length) || 1, i = t(this, w).querySelector(".ng-container-body .ng-part-body");
|
|
541
|
+
T.log("bodyContainer.clientHeight", i.clientHeight);
|
|
542
|
+
const o = Math.max(0, s - Math.floor(i.clientHeight / e)), a = Math.min(o, Math.max(0, Math.floor(n / e)));
|
|
543
543
|
let c = Math.floor(a * e);
|
|
544
|
-
T.log(`π [Scroll Calc] maxStartIndex: ${
|
|
544
|
+
T.log(`π [Scroll Calc] maxStartIndex: ${o}, startIndex: ${a}, offsetY: ${c}`), a === o && T.log(`π [Scroll Inspect] scrollTop: ${n}, rowHeight: ${e}, maxStartIndex: ${o}, startIndex: ${a}, offsetY: ${c}`);
|
|
545
545
|
const l = t(this, et).firstTr, f = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
|
|
546
546
|
(b = t(this, et)) == null || b.scrollTables.forEach((u) => {
|
|
547
547
|
u.style.transform = `translate3d(0, ${c}px, 0)`;
|
|
548
548
|
}), f !== a && (T.log(`π [Row Bind Trigger] currentStartIndex(${f}) !== startIndex(${a})`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((u) => {
|
|
549
549
|
const y = t(this, w).querySelector(u);
|
|
550
550
|
if (!y) return;
|
|
551
|
-
const
|
|
552
|
-
if (!
|
|
553
|
-
Array.from(
|
|
551
|
+
const v = y.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
552
|
+
if (!v) return;
|
|
553
|
+
Array.from(v.querySelectorAll("tr:not(.nodata)")).forEach((x, M) => {
|
|
554
554
|
const q = a + Math.floor(M / r);
|
|
555
555
|
if (q >= s) {
|
|
556
|
-
|
|
556
|
+
x.style.display = "none";
|
|
557
557
|
return;
|
|
558
558
|
}
|
|
559
|
-
const
|
|
560
|
-
|
|
559
|
+
const W = t(this, D).data.get(q);
|
|
560
|
+
x.style.display = "", t(this, kt).call(this, x, W, q);
|
|
561
561
|
});
|
|
562
562
|
}));
|
|
563
563
|
}, "#handleScroll"));
|
|
@@ -576,10 +576,10 @@ const Pe = class Pe {
|
|
|
576
576
|
});
|
|
577
577
|
}; */
|
|
578
578
|
d(this, kt, /* @__PURE__ */ h((n, e, s) => {
|
|
579
|
-
n.dataset.row = s, n.data = e, Array.from(n.cells).forEach((r,
|
|
579
|
+
n.dataset.row = s, n.data = e, Array.from(n.cells).forEach((r, i) => {
|
|
580
580
|
r.dataset.row = s;
|
|
581
|
-
const
|
|
582
|
-
|
|
581
|
+
const o = Array.from(r.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
|
|
582
|
+
o && typeof o.refresh == "function" && o.refresh();
|
|
583
583
|
});
|
|
584
584
|
}, "#bindRowData"));
|
|
585
585
|
d(this, Yt, /* @__PURE__ */ h(() => {
|
|
@@ -587,14 +587,14 @@ const Pe = class Pe {
|
|
|
587
587
|
T.log("rowManager.#syncHeaderHeights");
|
|
588
588
|
const n = t(this, w).querySelector(".ng-container-left .ng-part-header table"), e = t(this, w).querySelector(".ng-container-body .ng-part-header table"), s = t(this, w).querySelector(".ng-container-right .ng-part-header table");
|
|
589
589
|
if (!e) return;
|
|
590
|
-
const r = n ? Array.from(n.querySelectorAll("tr")) : [],
|
|
590
|
+
const r = n ? Array.from(n.querySelectorAll("tr")) : [], i = Array.from(e.querySelectorAll("tr")), o = s ? Array.from(s.querySelectorAll("tr")) : [], a = Math.max(r.length, i.length, o.length);
|
|
591
591
|
for (let g = 0; g < a; g++) {
|
|
592
592
|
const b = [
|
|
593
593
|
((c = r[g]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
594
|
-
((l =
|
|
595
|
-
((f =
|
|
594
|
+
((l = i[g]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
595
|
+
((f = o[g]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
596
596
|
], u = Math.max(...b);
|
|
597
|
-
u > 0 && (r[g] && (r[g].style.height = `${u}px`),
|
|
597
|
+
u > 0 && (r[g] && (r[g].style.height = `${u}px`), i[g] && (i[g].style.height = `${u}px`), o[g] && (o[g].style.height = `${u}px`));
|
|
598
598
|
}
|
|
599
599
|
}, "#syncHeaderHeights"));
|
|
600
600
|
E(this, "destroy", /* @__PURE__ */ h(() => {
|
|
@@ -629,9 +629,9 @@ const Ut = class Ut {
|
|
|
629
629
|
const f = l.getAttribute("cell-type") || "renderer";
|
|
630
630
|
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
631
631
|
let g = `cell-${f}`;
|
|
632
|
-
const b = l.getAttribute("data-bind"), u = l.getAttribute("data-expr"), y = l.getAttribute("maxbyte"),
|
|
632
|
+
const b = l.getAttribute("data-bind"), u = l.getAttribute("data-expr"), y = l.getAttribute("maxbyte"), v = l.getAttribute("type");
|
|
633
633
|
let A = [];
|
|
634
|
-
b && A.push(`data-bind="${b}"`), u && A.push(`data-expr="${u}"`), y && A.push(`maxbyte="${y}"`),
|
|
634
|
+
b && A.push(`data-bind="${b}"`), u && A.push(`data-expr="${u}"`), y && A.push(`maxbyte="${y}"`), v && A.push(`type="${v}"`), l.innerHTML = `<${g} ${A.join(" ")}></${g}>`;
|
|
635
635
|
});
|
|
636
636
|
}, "processCellTypes"), s = /* @__PURE__ */ h((a) => {
|
|
637
637
|
if (!a.querySelector("colgroup")) {
|
|
@@ -656,42 +656,42 @@ const Ut = class Ut {
|
|
|
656
656
|
});
|
|
657
657
|
const u = Array.from(Array(g), () => Array(b).fill(null));
|
|
658
658
|
l.forEach((y) => {
|
|
659
|
-
const
|
|
659
|
+
const v = y.sectionRowIndex;
|
|
660
660
|
let A = 0;
|
|
661
|
-
Array.from(y.querySelectorAll("th,td")).forEach((
|
|
662
|
-
for (let
|
|
663
|
-
if (u[
|
|
664
|
-
A =
|
|
661
|
+
Array.from(y.querySelectorAll("th,td")).forEach((x) => {
|
|
662
|
+
for (let W = 0; W < u[v].length; W++)
|
|
663
|
+
if (u[v][W] === null) {
|
|
664
|
+
A = W;
|
|
665
665
|
break;
|
|
666
666
|
}
|
|
667
|
-
const M =
|
|
668
|
-
for (let
|
|
667
|
+
const M = x.rowSpan || 1, q = x.colSpan || 1;
|
|
668
|
+
for (let W = 0; W < M; W++)
|
|
669
669
|
for (let j = 0; j < q; j++)
|
|
670
|
-
|
|
670
|
+
v + W < g && A + j < b && (u[v + W][A + j] = W === 0 && j === 0 ? "1" : "0");
|
|
671
671
|
});
|
|
672
672
|
}), l.forEach((y) => {
|
|
673
|
-
const
|
|
673
|
+
const v = y.sectionRowIndex;
|
|
674
674
|
Array.from(y.querySelectorAll("th,td")).forEach((A) => {
|
|
675
|
-
for (let
|
|
676
|
-
if (u[
|
|
677
|
-
A.dataset.col =
|
|
675
|
+
for (let x = 0; x < u[v].length; x++)
|
|
676
|
+
if (u[v][x] === "1") {
|
|
677
|
+
A.dataset.col = x, u[v][x] = "0";
|
|
678
678
|
break;
|
|
679
679
|
}
|
|
680
680
|
});
|
|
681
681
|
});
|
|
682
|
-
}, "resetColIndex"),
|
|
683
|
-
return s(
|
|
682
|
+
}, "resetColIndex"), i = n.cloneNode(!0);
|
|
683
|
+
return s(i), e(i), r(i, "thead"), r(i, "tbody"), r(i, "tfoot"), Array.from(i.querySelectorAll("colgroup col")).forEach((a, c) => {
|
|
684
684
|
const l = a.getAttribute("fixed");
|
|
685
|
-
l &&
|
|
685
|
+
l && i.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((f) => {
|
|
686
686
|
f.setAttribute("fixed", l);
|
|
687
687
|
});
|
|
688
|
-
}),
|
|
688
|
+
}), i;
|
|
689
689
|
}
|
|
690
690
|
// π― [μΆκ°] td/thμ μ μΈλ cell-type μμ±μ μ½μ΄ 컀μ€ν
νκ·Έλ‘ μλ κ°μΈκΈ°
|
|
691
691
|
};
|
|
692
692
|
h(Ut, "TableCompiler");
|
|
693
693
|
let pe = Ut;
|
|
694
|
-
var F, Ct, mt, rs,
|
|
694
|
+
var F, Ct, mt, rs, is;
|
|
695
695
|
const De = class De {
|
|
696
696
|
constructor(n) {
|
|
697
697
|
d(this, mt);
|
|
@@ -702,10 +702,10 @@ const De = class De {
|
|
|
702
702
|
const { startRow: n, startCol: e, endRow: s, endCol: r } = t(this, Ct);
|
|
703
703
|
t(this, F).querySelectorAll(
|
|
704
704
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
705
|
-
).forEach((
|
|
706
|
-
|
|
705
|
+
).forEach((o) => {
|
|
706
|
+
o.querySelectorAll(".selected, .selected-top, .selected-bottom, .selected-left, .selected-right").forEach((a) => {
|
|
707
707
|
a.classList.remove("selected", "selected-top", "selected-bottom", "selected-left", "selected-right");
|
|
708
|
-
}), !(n < 0) &&
|
|
708
|
+
}), !(n < 0) && o.querySelectorAll("tbody tr").forEach((a) => {
|
|
709
709
|
const c = parseInt(a.dataset.row, 10);
|
|
710
710
|
isNaN(c) || a.querySelectorAll("td, th").forEach((l) => {
|
|
711
711
|
const f = parseInt(l.dataset.col, 10);
|
|
@@ -716,17 +716,17 @@ const De = class De {
|
|
|
716
716
|
});
|
|
717
717
|
});
|
|
718
718
|
}, "render"));
|
|
719
|
-
p(this, F, n), de(this, mt,
|
|
719
|
+
p(this, F, n), de(this, mt, is).call(this);
|
|
720
720
|
}
|
|
721
721
|
setRange(n, e, s, r) {
|
|
722
|
-
let
|
|
723
|
-
const l = de(this, mt, rs).call(this,
|
|
722
|
+
let i = Math.min(n, s), o = Math.max(n, s), a = Math.min(e, r), c = Math.max(e, r);
|
|
723
|
+
const l = de(this, mt, rs).call(this, i, a, o, c);
|
|
724
724
|
p(this, Ct, l), this.render();
|
|
725
725
|
}
|
|
726
726
|
};
|
|
727
727
|
F = new WeakMap(), Ct = new WeakMap(), mt = new WeakSet(), // λ¨Έμ§λ μ
μ΄ μ ν μμμ κ±Έμ³μμΌλ©΄ λ²μλ₯Ό μλμΌλ‘ λνμ£Όλ 보μ κΈ°
|
|
728
728
|
rs = /* @__PURE__ */ h(function(n, e, s, r) {
|
|
729
|
-
let
|
|
729
|
+
let i = n, o = e, a = s, c = r, l = !0;
|
|
730
730
|
const f = t(this, F).querySelectorAll(
|
|
731
731
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
732
732
|
);
|
|
@@ -735,38 +735,38 @@ rs = /* @__PURE__ */ h(function(n, e, s, r) {
|
|
|
735
735
|
g.querySelectorAll("tbody tr").forEach((b) => {
|
|
736
736
|
const u = parseInt(b.dataset.row, 10);
|
|
737
737
|
isNaN(u) || b.querySelectorAll("td, th").forEach((y) => {
|
|
738
|
-
const
|
|
739
|
-
if (isNaN(
|
|
740
|
-
const A = parseInt(y.rowSpan || 1, 10),
|
|
741
|
-
if (u <= a && M >=
|
|
742
|
-
const j = Math.min(
|
|
743
|
-
(j !==
|
|
738
|
+
const v = parseInt(y.dataset.col, 10);
|
|
739
|
+
if (isNaN(v)) return;
|
|
740
|
+
const A = parseInt(y.rowSpan || 1, 10), x = parseInt(y.colSpan || 1, 10), M = u + A - 1, q = v + x - 1;
|
|
741
|
+
if (u <= a && M >= i && v <= c && q >= o) {
|
|
742
|
+
const j = Math.min(i, u), Je = Math.max(a, M), Qe = Math.min(o, v), ts = Math.max(c, q);
|
|
743
|
+
(j !== i || Je !== a || Qe !== o || ts !== c) && (i = j, a = Je, o = Qe, c = ts, l = !0);
|
|
744
744
|
}
|
|
745
745
|
});
|
|
746
746
|
});
|
|
747
747
|
});
|
|
748
|
-
return { startRow:
|
|
749
|
-
}, "#expandRangeByMerge"),
|
|
748
|
+
return { startRow: i, startCol: o, endRow: a, endCol: c };
|
|
749
|
+
}, "#expandRangeByMerge"), is = /* @__PURE__ */ h(function() {
|
|
750
750
|
const n = this.selector ? t(this, F).querySelector(".ng-container-top") : t(this, F).querySelector(".ng-container-top");
|
|
751
751
|
n && n.addEventListener("mousedown", (e) => {
|
|
752
752
|
const s = e.target.closest("td, th");
|
|
753
753
|
if (!s || s.dataset.row === void 0 || s.dataset.col === void 0 || s.closest("tr").classList.contains("nodata")) return;
|
|
754
|
-
const r = parseInt(s.dataset.row, 10),
|
|
755
|
-
this.setRange(r,
|
|
756
|
-
const
|
|
754
|
+
const r = parseInt(s.dataset.row, 10), i = parseInt(s.dataset.col, 10);
|
|
755
|
+
this.setRange(r, i, r, i);
|
|
756
|
+
const o = /* @__PURE__ */ h((c) => {
|
|
757
757
|
const l = document.elementFromPoint(c.clientX, c.clientY), f = l == null ? void 0 : l.closest("td, th");
|
|
758
758
|
if (!f || !t(this, F).contains(f) || f.dataset.row === void 0 || f.dataset.col === void 0 || f.closest("tr").classList.contains("nodata")) return;
|
|
759
759
|
const g = parseInt(f.dataset.row, 10), b = parseInt(f.dataset.col, 10);
|
|
760
|
-
this.setRange(r,
|
|
760
|
+
this.setRange(r, i, g, b);
|
|
761
761
|
}, "onMouseMove"), a = /* @__PURE__ */ h(() => {
|
|
762
|
-
document.removeEventListener("mousemove",
|
|
762
|
+
document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", a);
|
|
763
763
|
}, "onMouseUp");
|
|
764
|
-
document.addEventListener("mousemove",
|
|
764
|
+
document.addEventListener("mousemove", o), document.addEventListener("mouseup", a);
|
|
765
765
|
});
|
|
766
766
|
}, "#initEvents"), h(De, "CellSelection");
|
|
767
767
|
let ye = De;
|
|
768
768
|
var Xt, nt, rt, Lt, Kt, Zt, dt, Gt, Jt;
|
|
769
|
-
const
|
|
769
|
+
const xt = class xt extends HTMLElement {
|
|
770
770
|
constructor() {
|
|
771
771
|
super();
|
|
772
772
|
d(this, Xt);
|
|
@@ -779,10 +779,10 @@ const vt = class vt extends HTMLElement {
|
|
|
779
779
|
E(this, "generate", /* @__PURE__ */ h((e) => {
|
|
780
780
|
if (T.log("sheet.generate()"), !e) return;
|
|
781
781
|
p(this, nt, pe.compile(e)), t(this, Kt).call(this), t(this, Zt).call(this);
|
|
782
|
-
const s = this.querySelector(".ng-container-body .ng-part-header"), r = this.querySelector(".ng-container-body .ng-part-footer"),
|
|
783
|
-
s &&
|
|
784
|
-
var
|
|
785
|
-
(
|
|
782
|
+
const s = this.querySelector(".ng-container-body .ng-part-header"), r = this.querySelector(".ng-container-body .ng-part-footer"), i = this.querySelector(".ng-nodata-overlay");
|
|
783
|
+
s && i && (i.style.top = `${s.offsetHeight}px`), r && i && (i.style.bottom = `${r.offsetHeight}px`), t(this, rt).initialize(), setTimeout(() => {
|
|
784
|
+
var o;
|
|
785
|
+
(o = this.querySelector("nine-table-hscrollbar")) == null || o.refresh();
|
|
786
786
|
}, 0);
|
|
787
787
|
}, "generate"));
|
|
788
788
|
d(this, Kt, /* @__PURE__ */ h(() => {
|
|
@@ -791,36 +791,36 @@ const vt = class vt extends HTMLElement {
|
|
|
791
791
|
{ selector: ".ng-container-left", type: "left" },
|
|
792
792
|
{ selector: ".ng-container-right", type: "right" }
|
|
793
793
|
].forEach(({ selector: s, type: r }) => {
|
|
794
|
-
var
|
|
795
|
-
(
|
|
794
|
+
var i, o, a;
|
|
795
|
+
(i = this.querySelector(`${s} .ng-part-header`)) == null || i.appendChild(t(this, dt).call(this, t(this, nt), r, "header")), (o = this.querySelector(`${s} .ng-virtual-spacer`)) == null || o.before(t(this, dt).call(this, t(this, nt), r, "body")), (a = this.querySelector(`${s} .ng-part-footer`)) == null || a.appendChild(t(this, dt).call(this, t(this, nt), r, "footer"));
|
|
796
796
|
});
|
|
797
797
|
}, "#renderSplitContainers"));
|
|
798
798
|
d(this, Zt, /* @__PURE__ */ h(() => {
|
|
799
799
|
["left", "right", "body"].forEach((e) => {
|
|
800
800
|
const s = this.querySelector(`.ng-container-${e}`), r = s == null ? void 0 : s.querySelectorAll("table");
|
|
801
801
|
if (!s || !r || r.length === 0) return;
|
|
802
|
-
let
|
|
803
|
-
r[0].querySelectorAll("col").forEach((
|
|
804
|
-
const a = parseInt(
|
|
805
|
-
isNaN(
|
|
806
|
-
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${
|
|
802
|
+
let i = 0;
|
|
803
|
+
r[0].querySelectorAll("col").forEach((o) => {
|
|
804
|
+
const a = parseInt(o.getAttribute("width"), 10);
|
|
805
|
+
isNaN(i) || (i += a);
|
|
806
|
+
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${i}px`, s.style.width = `${i}px`);
|
|
807
807
|
});
|
|
808
808
|
}, "#updateContainerWidths"));
|
|
809
809
|
d(this, dt, /* @__PURE__ */ h((e, s, r) => {
|
|
810
|
-
const
|
|
810
|
+
const i = e.cloneNode(!0), o = i.querySelector("thead"), a = i.querySelector("tbody"), c = i.querySelector("tfoot");
|
|
811
811
|
if (r === "header") {
|
|
812
812
|
if (a && a.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
813
813
|
const f = document.createElement("tbody");
|
|
814
|
-
f.className = "fixed-tbody",
|
|
814
|
+
f.className = "fixed-tbody", i.appendChild(f);
|
|
815
815
|
}
|
|
816
|
-
} else r === "body" ? (
|
|
817
|
-
return s === "left" ?
|
|
816
|
+
} else r === "body" ? (o && o.remove(), c && c.remove(), a && (a.className = "bindable-tbody")) : r === "footer" && (o && o.remove(), a && a.remove());
|
|
817
|
+
return s === "left" ? i.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
818
818
|
l.getAttribute("fixed") !== "left" && l.remove();
|
|
819
|
-
}) : s === "right" ?
|
|
819
|
+
}) : s === "right" ? i.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
820
820
|
l.getAttribute("fixed") !== "right" && l.remove();
|
|
821
|
-
}) :
|
|
821
|
+
}) : i.querySelectorAll("[fixed=left], [fixed=right]").forEach((l) => {
|
|
822
822
|
l.remove();
|
|
823
|
-
}),
|
|
823
|
+
}), i;
|
|
824
824
|
}, "#createSplitTable"));
|
|
825
825
|
E(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, rt).getRowHeight(), "getRowHeight"));
|
|
826
826
|
E(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
@@ -835,7 +835,7 @@ const vt = class vt extends HTMLElement {
|
|
|
835
835
|
t(this, Jt).call(this), p(this, Lt, new ye(this));
|
|
836
836
|
}, "#init"));
|
|
837
837
|
d(this, Jt, /* @__PURE__ */ h(() => {
|
|
838
|
-
const e =
|
|
838
|
+
const e = xt.SCROLLBAR_SIZE;
|
|
839
839
|
this.innerHTML = `
|
|
840
840
|
<style>
|
|
841
841
|
nine-table-sheet {
|
|
@@ -988,10 +988,10 @@ const vt = class vt extends HTMLElement {
|
|
|
988
988
|
}
|
|
989
989
|
|
|
990
990
|
/* μΈκ³½ κ²½κ³μ μλ§ μ μ©λλ λ¨λ¨ν ν
λ리 */
|
|
991
|
-
nine-table-sheet td.selected-top {
|
|
992
|
-
nine-table-sheet td.selected-bottom {
|
|
993
|
-
nine-table-sheet td.selected-left {
|
|
994
|
-
nine-table-sheet td.selected-right {
|
|
991
|
+
nine-table-sheet td.selected-top { box-shadow: inset 0 2px 0 #2563eb !important; z-index: 2; }
|
|
992
|
+
nine-table-sheet td.selected-bottom { box-shadow: inset 0 -2px 0 #2563eb !important; z-index: 2; }
|
|
993
|
+
nine-table-sheet td.selected-left { box-shadow: inset 2px 0 0 #2563eb !important; z-index: 2; }
|
|
994
|
+
nine-table-sheet td.selected-right { box-shadow: inset -2px 0 0 #2563eb !important; z-index: 2; }
|
|
995
995
|
</style>
|
|
996
996
|
|
|
997
997
|
<div class='ng-container-top'>
|
|
@@ -1047,9 +1047,9 @@ const vt = class vt extends HTMLElement {
|
|
|
1047
1047
|
this.innerHTML = "", T.log("NineTableSheet destroyed.");
|
|
1048
1048
|
}
|
|
1049
1049
|
};
|
|
1050
|
-
Xt = new WeakMap(), nt = new WeakMap(), rt = new WeakMap(), Lt = new WeakMap(), Kt = new WeakMap(), Zt = new WeakMap(), dt = new WeakMap(), Gt = new WeakMap(), Jt = new WeakMap(), h(
|
|
1051
|
-
let
|
|
1052
|
-
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet",
|
|
1050
|
+
Xt = new WeakMap(), nt = new WeakMap(), rt = new WeakMap(), Lt = new WeakMap(), Kt = new WeakMap(), Zt = new WeakMap(), dt = new WeakMap(), Gt = new WeakMap(), Jt = new WeakMap(), h(xt, "NineTableSheet"), E(xt, "SCROLLBAR_SIZE", 16);
|
|
1051
|
+
let Wt = xt;
|
|
1052
|
+
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", Wt);
|
|
1053
1053
|
var Qt, Ht;
|
|
1054
1054
|
const Fe = class Fe extends HTMLElement {
|
|
1055
1055
|
constructor() {
|
|
@@ -1057,9 +1057,9 @@ const Fe = class Fe extends HTMLElement {
|
|
|
1057
1057
|
d(this, Qt, /* @__PURE__ */ h(() => {
|
|
1058
1058
|
var e;
|
|
1059
1059
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
1060
|
-
var
|
|
1061
|
-
const r = s.ctrlKey || s.metaKey || s.shiftKey,
|
|
1062
|
-
t(this, Ht).call(this,
|
|
1060
|
+
var o;
|
|
1061
|
+
const r = s.ctrlKey || s.metaKey || s.shiftKey, i = parseInt((o = s.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
|
|
1062
|
+
t(this, Ht).call(this, i, r);
|
|
1063
1063
|
}), t(this, Ht).call(this, 0, !1);
|
|
1064
1064
|
}, "#init"));
|
|
1065
1065
|
d(this, Ht, /* @__PURE__ */ h((e, s = !1) => {
|
|
@@ -1068,10 +1068,10 @@ const Fe = class Fe extends HTMLElement {
|
|
|
1068
1068
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((u) => u.style.setProperty("display", "none"));
|
|
1069
1069
|
const b = f.filter((u) => u.classList.contains("active"));
|
|
1070
1070
|
b.length < 2 || b.forEach((u) => {
|
|
1071
|
-
const y = parseInt(u.getAttribute("data-index"), 10),
|
|
1072
|
-
|
|
1071
|
+
const y = parseInt(u.getAttribute("data-index"), 10), v = this.querySelector(`nine-splitter[data-split-index="${y}"]`), A = f[y + 1];
|
|
1072
|
+
v && A && A.classList.contains("active") && v.style.setProperty("display", "flex");
|
|
1073
1073
|
});
|
|
1074
|
-
}, "updateSplitters"),
|
|
1074
|
+
}, "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");
|
|
1075
1075
|
if (!a[e]) return;
|
|
1076
1076
|
if (!s)
|
|
1077
1077
|
a.forEach((f, g) => {
|
|
@@ -1081,14 +1081,14 @@ const Fe = class Fe extends HTMLElement {
|
|
|
1081
1081
|
f.classList.toggle("active", b), f.style.flex = b ? "1 1 100%" : "";
|
|
1082
1082
|
});
|
|
1083
1083
|
else {
|
|
1084
|
-
const f = a[e], g =
|
|
1084
|
+
const f = a[e], g = i.querySelectorAll(".nine-tab-item.active");
|
|
1085
1085
|
if (f.classList.contains("active") && g.length <= 1)
|
|
1086
1086
|
return;
|
|
1087
1087
|
f.classList.toggle("active");
|
|
1088
|
-
const b =
|
|
1088
|
+
const b = o.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
1089
1089
|
b && (b.classList.toggle("active"), b.classList.contains("active") || (b.style.flex = ""));
|
|
1090
1090
|
}
|
|
1091
|
-
const l =
|
|
1091
|
+
const l = o.querySelectorAll("nine-table-sheet.active");
|
|
1092
1092
|
l == null || l.forEach((f) => {
|
|
1093
1093
|
f.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
1094
1094
|
}), r();
|
|
@@ -1115,14 +1115,14 @@ const je = class je {
|
|
|
1115
1115
|
var c, l;
|
|
1116
1116
|
const n = Array.from(t(this, I).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
1117
1117
|
if (n.length === 0) return;
|
|
1118
|
-
const e = parseInt(t(this, I).getAttribute("max-display-row"), 10) || 10, s = Math.max(...n.map((f) => f.getRowHeight())), r = (c = t(this, I).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height,
|
|
1118
|
+
const e = parseInt(t(this, I).getAttribute("max-display-row"), 10) || 10, s = Math.max(...n.map((f) => f.getRowHeight())), r = (c = t(this, I).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, i = (l = t(this, I).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = Wt.SCROLLBAR_SIZE, a = e * s + r + i + o;
|
|
1119
1119
|
t(this, I).style.height = `${a}px`;
|
|
1120
1120
|
}, "#applyAutoHeight"));
|
|
1121
1121
|
d(this, ee, /* @__PURE__ */ h(() => {
|
|
1122
|
-
const e = Array.from(t(this, I).children).filter((c) => c.tagName === "TABLE"), s = t(this, I).getAttribute("auto-height") === "true", r = e.length,
|
|
1122
|
+
const e = Array.from(t(this, I).children).filter((c) => c.tagName === "TABLE"), s = t(this, I).getAttribute("auto-height") === "true", r = e.length, i = e.map((c, l) => {
|
|
1123
1123
|
const g = `<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>` : "";
|
|
1124
1124
|
return g + b;
|
|
1125
|
-
}).join(""),
|
|
1125
|
+
}).join(""), o = e.map((c, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
1126
1126
|
t(this, I).shadowRoot.innerHTML = `
|
|
1127
1127
|
<style>
|
|
1128
1128
|
:host {
|
|
@@ -1234,9 +1234,9 @@ const je = class je {
|
|
|
1234
1234
|
<nine-table-body>
|
|
1235
1235
|
<nine-table-summary></nine-table-summary>
|
|
1236
1236
|
<nine-table-sheets>
|
|
1237
|
-
<nine-table-sheets-body>${
|
|
1237
|
+
<nine-table-sheets-body>${i}</nine-table-sheets-body>
|
|
1238
1238
|
<nine-table-sheets-footer>
|
|
1239
|
-
<div class="nine-tab-bar">${
|
|
1239
|
+
<div class="nine-tab-bar">${o}</div>
|
|
1240
1240
|
<div class="sheets-counter">Total : <span id="row-count">0</span></div>
|
|
1241
1241
|
</nine-table-sheets-footer>
|
|
1242
1242
|
</nine-table-sheets>
|
|
@@ -1255,7 +1255,7 @@ const je = class je {
|
|
|
1255
1255
|
}
|
|
1256
1256
|
};
|
|
1257
1257
|
I = new WeakMap(), te = new WeakMap(), Mt = new WeakMap(), ee = new WeakMap(), h(je, "LayoutManager");
|
|
1258
|
-
let
|
|
1258
|
+
let xe = je;
|
|
1259
1259
|
var It, ft;
|
|
1260
1260
|
const Ve = class Ve {
|
|
1261
1261
|
constructor(n) {
|
|
@@ -1273,13 +1273,13 @@ const Ve = class Ve {
|
|
|
1273
1273
|
}
|
|
1274
1274
|
};
|
|
1275
1275
|
It = new WeakMap(), ft = new WeakMap(), h(Ve, "ngRow");
|
|
1276
|
-
let
|
|
1277
|
-
var N, C,
|
|
1278
|
-
const
|
|
1276
|
+
let ve = Ve;
|
|
1277
|
+
var N, C, z, ut, se, U, ne, it, $t, re, ie, gt;
|
|
1278
|
+
const O = class O {
|
|
1279
1279
|
constructor(n, e) {
|
|
1280
1280
|
d(this, N);
|
|
1281
1281
|
d(this, C);
|
|
1282
|
-
d(this,
|
|
1282
|
+
d(this, z, []);
|
|
1283
1283
|
d(this, ut, []);
|
|
1284
1284
|
d(this, se, 0);
|
|
1285
1285
|
d(this, U, []);
|
|
@@ -1293,107 +1293,107 @@ const B = class B {
|
|
|
1293
1293
|
e.__ng || (e.__ng = t(this, $t).call(this)), e.__ng.height = t(this, U).slice();
|
|
1294
1294
|
});
|
|
1295
1295
|
}, "#initialize"));
|
|
1296
|
-
d(this,
|
|
1296
|
+
d(this, it, /* @__PURE__ */ h(() => {
|
|
1297
1297
|
const n = t(this, N).shadowRoot.querySelector("nine-table-sheets");
|
|
1298
1298
|
n == null || n.classList.toggle("nodata", this.length === 0), t(this, N).shadowRoot.querySelectorAll("nine-table-sheet").forEach((e) => {
|
|
1299
1299
|
e.invalidate();
|
|
1300
1300
|
});
|
|
1301
1301
|
}, "#invalidate"));
|
|
1302
1302
|
E(this, "get", /* @__PURE__ */ h((n, e) => {
|
|
1303
|
-
var
|
|
1303
|
+
var i;
|
|
1304
1304
|
const s = this.getValidData();
|
|
1305
1305
|
if (!s || s.length <= 0) return;
|
|
1306
1306
|
if (n == null) return t(this, gt).call(this, s);
|
|
1307
1307
|
if (n < 0 || n >= s.length) return null;
|
|
1308
|
-
const r = typeof ((
|
|
1308
|
+
const r = typeof ((i = t(this, N).fields) == null ? void 0 : i.get) == "function" ? t(this, N).fields.get() : [];
|
|
1309
1309
|
if (e != null) {
|
|
1310
|
-
const
|
|
1311
|
-
return
|
|
1310
|
+
const o = r.indexOf(e);
|
|
1311
|
+
return o >= 0 ? s[n].v[o] : null;
|
|
1312
1312
|
}
|
|
1313
1313
|
return t(this, gt).call(this, s[n]);
|
|
1314
1314
|
}, "get"));
|
|
1315
1315
|
E(this, "set", /* @__PURE__ */ h((n) => {
|
|
1316
|
-
this.clear(), this.add(n, !1), t(this,
|
|
1316
|
+
this.clear(), this.add(n, !1), t(this, it).call(this);
|
|
1317
1317
|
}, "set"));
|
|
1318
1318
|
d(this, $t, /* @__PURE__ */ h(() => ({
|
|
1319
|
-
rowState:
|
|
1319
|
+
rowState: O.ROW_STATE.EMPTY,
|
|
1320
1320
|
deleted: !1,
|
|
1321
1321
|
filtered: !1,
|
|
1322
1322
|
height: t(this, U).slice(),
|
|
1323
1323
|
o: {},
|
|
1324
1324
|
c: {},
|
|
1325
|
-
_: [0, 0, 0, 0,
|
|
1325
|
+
_: [0, 0, 0, 0, O.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, U).slice(), -1, {}, {}]
|
|
1326
1326
|
}), "#getDefaultMeta"));
|
|
1327
1327
|
E(this, "reset", /* @__PURE__ */ h(() => {
|
|
1328
|
-
p(this,
|
|
1328
|
+
p(this, z, []), p(this, ut, []), t(this, it).call(this);
|
|
1329
1329
|
}, "reset"));
|
|
1330
1330
|
E(this, "clear", /* @__PURE__ */ h(() => {
|
|
1331
1331
|
var n;
|
|
1332
|
-
t(this, C).rawRecords = [], p(this,
|
|
1332
|
+
t(this, C).rawRecords = [], p(this, z, []), p(this, ut, []), (n = t(this, C).viewRecords) != null && n.reset && t(this, C).viewRecords.reset();
|
|
1333
1333
|
}, "clear"));
|
|
1334
1334
|
d(this, re, /* @__PURE__ */ h((n) => {
|
|
1335
1335
|
var r;
|
|
1336
1336
|
Array.isArray(n) || (n = [n]);
|
|
1337
1337
|
const e = typeof ((r = t(this, N).fields) == null ? void 0 : r.get) == "function" ? t(this, N).fields.get() : Object.keys(n[0] || {}), s = [];
|
|
1338
|
-
return n.forEach((
|
|
1339
|
-
const
|
|
1338
|
+
return n.forEach((i) => {
|
|
1339
|
+
const o = { v: [] };
|
|
1340
1340
|
e.forEach((a) => {
|
|
1341
|
-
|
|
1342
|
-
}), s.push(
|
|
1341
|
+
o.v.push(i[a] !== void 0 && i[a] !== null ? i[a] : "");
|
|
1342
|
+
}), s.push(o);
|
|
1343
1343
|
}), s;
|
|
1344
1344
|
}, "#json2Array"));
|
|
1345
|
-
d(this,
|
|
1346
|
-
e.__ng = t(this, $t).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState =
|
|
1345
|
+
d(this, ie, /* @__PURE__ */ h((n) => (Array.isArray(n) || (n = [n]), n.forEach((e) => {
|
|
1346
|
+
e.__ng = t(this, $t).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = O.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1347
1347
|
}), n), "#defaultInsert"));
|
|
1348
1348
|
E(this, "add", /* @__PURE__ */ h((n, e = !0) => {
|
|
1349
1349
|
n === void 0 && (n = {});
|
|
1350
1350
|
const s = t(this, re).call(this, n);
|
|
1351
|
-
t(this, C).rawRecords = t(this, C).rawRecords.concat(t(this,
|
|
1351
|
+
t(this, C).rawRecords = t(this, C).rawRecords.concat(t(this, ie).call(this, s)), this.resetRecords();
|
|
1352
1352
|
const r = this.count() - 1;
|
|
1353
|
-
return e || s.forEach((
|
|
1354
|
-
const a = t(this, C).rawRecords[r -
|
|
1355
|
-
a && (a.__ng.rowState =
|
|
1356
|
-
}), t(this,
|
|
1353
|
+
return e || s.forEach((i, o) => {
|
|
1354
|
+
const a = t(this, C).rawRecords[r - o];
|
|
1355
|
+
a && (a.__ng.rowState = O.ROW_STATE.EMPTY);
|
|
1356
|
+
}), t(this, it).call(this), r;
|
|
1357
1357
|
}, "add"));
|
|
1358
1358
|
E(this, "delete", /* @__PURE__ */ h((n) => {
|
|
1359
1359
|
let e = [];
|
|
1360
1360
|
Array.isArray(n) ? e = n : typeof n > "u" ? e = [t(this, C).host.row.at] : e = [parseInt(n, 10)], e.sort((s, r) => r - s).forEach((s) => {
|
|
1361
|
-
if (t(this,
|
|
1362
|
-
const r = t(this,
|
|
1363
|
-
t(this,
|
|
1364
|
-
|
|
1361
|
+
if (t(this, z)[s]) {
|
|
1362
|
+
const r = t(this, z)[s].__ng.rowid;
|
|
1363
|
+
t(this, z)[s].__ng.rowState === O.ROW_STATE.INSERT ? t(this, C).rawRecords = t(this, C).rawRecords.filter((i) => i.__ng.rowid !== r) : t(this, C).rawRecords.forEach((i) => {
|
|
1364
|
+
i.__ng.rowid === r && (i.__ng.deleted = !0, i.__ng.rowState = O.ROW_STATE.DELETE);
|
|
1365
1365
|
});
|
|
1366
1366
|
}
|
|
1367
|
-
}), this.resetRecords(), t(this,
|
|
1367
|
+
}), this.resetRecords(), t(this, it).call(this);
|
|
1368
1368
|
}, "delete"));
|
|
1369
1369
|
E(this, "setValue", /* @__PURE__ */ h((n, e, s) => {
|
|
1370
1370
|
var c;
|
|
1371
1371
|
n = parseInt(n, 10);
|
|
1372
|
-
const
|
|
1373
|
-
if (
|
|
1374
|
-
const
|
|
1375
|
-
if (!
|
|
1376
|
-
const a =
|
|
1377
|
-
a !== s &&
|
|
1372
|
+
const i = (typeof ((c = t(this, N).fields) == null ? void 0 : c.get) == "function" ? t(this, N).fields.get() : []).indexOf(e);
|
|
1373
|
+
if (i < 0) return;
|
|
1374
|
+
const o = this.getValidData()[n];
|
|
1375
|
+
if (!o) return;
|
|
1376
|
+
const a = o.v[i];
|
|
1377
|
+
a !== s && o.__ng.rowState !== O.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = a), o.__ng.rowState = O.ROW_STATE.UPDATE), o.v[i] = s;
|
|
1378
1378
|
}, "setValue"));
|
|
1379
1379
|
E(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1380
|
-
p(this, ut, t(this, C).rawRecords.filter((n) => !n.__ng.deleted)), p(this,
|
|
1380
|
+
p(this, ut, t(this, C).rawRecords.filter((n) => !n.__ng.deleted)), p(this, z, t(this, C).rawRecords.filter((n) => !n.__ng.deleted && !n.__ng.filtered)), t(this, C).rawRecords.forEach((n, e) => {
|
|
1381
1381
|
n.__ng.rowidx = e;
|
|
1382
|
-
}), t(this,
|
|
1382
|
+
}), t(this, z).forEach((n, e) => {
|
|
1383
1383
|
n.__ng.i = e;
|
|
1384
1384
|
});
|
|
1385
1385
|
}, "resetRecords"));
|
|
1386
|
-
E(this, "getValidData", /* @__PURE__ */ h(() => (t(this,
|
|
1386
|
+
E(this, "getValidData", /* @__PURE__ */ h(() => (t(this, z).length === 0 && t(this, C).rawRecords.length > 0 && this.resetRecords(), t(this, z)), "getValidData"));
|
|
1387
1387
|
d(this, gt, /* @__PURE__ */ h((n) => {
|
|
1388
|
-
var
|
|
1388
|
+
var o;
|
|
1389
1389
|
if (!n) return n;
|
|
1390
|
-
const e = !Array.isArray(n), s = e ? [n] : n, r = typeof ((
|
|
1390
|
+
const e = !Array.isArray(n), s = e ? [n] : n, r = typeof ((o = t(this, N).fields) == null ? void 0 : o.get) == "function" ? t(this, N).fields.get() : [], i = s.filter((a) => !a.__ng.deleted).map((a) => {
|
|
1391
1391
|
const c = {};
|
|
1392
1392
|
return r.forEach((l, f) => {
|
|
1393
1393
|
c[l] = a.v ? a.v[f] : a[l];
|
|
1394
1394
|
}), c.__ng = a.__ng, c;
|
|
1395
1395
|
});
|
|
1396
|
-
return e ?
|
|
1396
|
+
return e ? i[0] : i;
|
|
1397
1397
|
}, "#conv"));
|
|
1398
1398
|
E(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1399
1399
|
p(this, N, n), p(this, C, e), t(this, ne).call(this);
|
|
@@ -1408,38 +1408,38 @@ const B = class B {
|
|
|
1408
1408
|
return ++ns(this, se)._;
|
|
1409
1409
|
}
|
|
1410
1410
|
get count() {
|
|
1411
|
-
return t(this,
|
|
1411
|
+
return t(this, z).length;
|
|
1412
1412
|
}
|
|
1413
1413
|
get length() {
|
|
1414
|
-
return t(this,
|
|
1414
|
+
return t(this, z).length;
|
|
1415
1415
|
}
|
|
1416
1416
|
getRowCount() {
|
|
1417
1417
|
return this.length;
|
|
1418
1418
|
}
|
|
1419
1419
|
};
|
|
1420
|
-
N = new WeakMap(), C = new WeakMap(),
|
|
1421
|
-
E(
|
|
1420
|
+
N = new WeakMap(), C = new WeakMap(), z = new WeakMap(), ut = new WeakMap(), se = new WeakMap(), U = new WeakMap(), ne = new WeakMap(), it = new WeakMap(), $t = new WeakMap(), re = new WeakMap(), ie = new WeakMap(), gt = new WeakMap(), h(O, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1421
|
+
E(O, "ROW_STATE", {
|
|
1422
1422
|
EMPTY: "EMPTY",
|
|
1423
1423
|
NORMAL: "NORMAL",
|
|
1424
1424
|
INSERT: "INSERT",
|
|
1425
1425
|
UPDATE: "UPDATE",
|
|
1426
1426
|
DELETE: "DELETE"
|
|
1427
1427
|
});
|
|
1428
|
-
let we =
|
|
1429
|
-
var
|
|
1428
|
+
let we = O;
|
|
1429
|
+
var ot;
|
|
1430
1430
|
const Ye = class Ye {
|
|
1431
1431
|
constructor(n) {
|
|
1432
|
-
d(this,
|
|
1433
|
-
p(this,
|
|
1432
|
+
d(this, ot);
|
|
1433
|
+
p(this, ot, n), this.row = new ve(this), this.data = new we(t(this, ot), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1434
1434
|
var e;
|
|
1435
|
-
(e = t(this,
|
|
1435
|
+
(e = t(this, ot).view) != null && e.redraw && t(this, ot).view.redraw();
|
|
1436
1436
|
}, this.setDataSource = (e) => {
|
|
1437
1437
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1438
1438
|
}, this.getRowState = (e) => {
|
|
1439
|
-
var r,
|
|
1439
|
+
var r, i;
|
|
1440
1440
|
const s = parseInt(e, 10);
|
|
1441
1441
|
if (!(s >= this.data.count()))
|
|
1442
|
-
return (
|
|
1442
|
+
return (i = (r = this.data.getValidData()[s]) == null ? void 0 : r.__ng) == null ? void 0 : i.rowState;
|
|
1443
1443
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1444
1444
|
this.row.at = e;
|
|
1445
1445
|
}, this.scrollTo_V1 = (e) => (e < 0 && (e = 0), e >= this.rawRecords.length && (e = this.rawRecords.length - 1), this.viewRecords.rawIndex = e, this.viewRecords.reset && this.viewRecords.reset(), !(e <= 0 || e >= this.rawRecords.length - 1)), this.getColumn = (e, s) => this.data.get(e, s), this.setColumn = (e, s, r) => {
|
|
@@ -1447,9 +1447,9 @@ const Ye = class Ye {
|
|
|
1447
1447
|
}, this.setDataSource([]);
|
|
1448
1448
|
}
|
|
1449
1449
|
};
|
|
1450
|
-
|
|
1450
|
+
ot = new WeakMap(), h(Ye, "ngDataManager");
|
|
1451
1451
|
let Se = Ye;
|
|
1452
|
-
var bt, H, _t,
|
|
1452
|
+
var bt, H, _t, oe;
|
|
1453
1453
|
const Ue = class Ue {
|
|
1454
1454
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1455
1455
|
constructor(n) {
|
|
@@ -1466,31 +1466,31 @@ const Ue = class Ue {
|
|
|
1466
1466
|
n.set(e.name, e.type);
|
|
1467
1467
|
}), p(this, H, Array.from(n, ([e, s]) => ({ name: e, type: s }))), p(this, H, t(this, H).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, H).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
1468
1468
|
}, "#adjust"));
|
|
1469
|
-
d(this,
|
|
1469
|
+
d(this, oe, /* @__PURE__ */ h(() => {
|
|
1470
1470
|
p(this, H, []), T.log(t(this, bt).querySelectorAll("table"));
|
|
1471
1471
|
const n = Array.from(t(this, bt).querySelectorAll("table"));
|
|
1472
1472
|
if (!(!n || n.length === 0)) {
|
|
1473
1473
|
for (const e of n)
|
|
1474
1474
|
T.log(e), $("[data-bind]", e).each((s, r) => {
|
|
1475
|
-
const
|
|
1476
|
-
|
|
1475
|
+
const i = r.dataset.bind, o = r.getAttribute("data-type") || "string";
|
|
1476
|
+
i && t(this, H).push({ name: i, type: o });
|
|
1477
1477
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
1478
|
-
$(`[${s}]`, e).each((r,
|
|
1479
|
-
var
|
|
1480
|
-
if (
|
|
1481
|
-
const a =
|
|
1478
|
+
$(`[${s}]`, e).each((r, i) => {
|
|
1479
|
+
var o = i.getAttribute(s);
|
|
1480
|
+
if (o.indexOf("data.") < 0) {
|
|
1481
|
+
const a = o.search(/[(]/g);
|
|
1482
1482
|
if (a > 0)
|
|
1483
1483
|
try {
|
|
1484
|
-
|
|
1484
|
+
o = String(window[o.substring(0, a).trim()]);
|
|
1485
1485
|
} catch {
|
|
1486
|
-
|
|
1486
|
+
o = "";
|
|
1487
1487
|
}
|
|
1488
1488
|
}
|
|
1489
|
-
|
|
1489
|
+
o.split("data.").forEach((a) => {
|
|
1490
1490
|
if (a.trim() != "") {
|
|
1491
1491
|
const c = a.search(/[^_A-Za-z0-9]/g);
|
|
1492
1492
|
let l = "";
|
|
1493
|
-
c >= 0 ? l = a.substring(0, c) :
|
|
1493
|
+
c >= 0 ? l = a.substring(0, c) : o.startsWith("data.") && (l = a.replace("data.", "")), l && t(this, H).push({ name: l, type: "string" });
|
|
1494
1494
|
}
|
|
1495
1495
|
});
|
|
1496
1496
|
});
|
|
@@ -1498,7 +1498,7 @@ const Ue = class Ue {
|
|
|
1498
1498
|
t(this, _t).call(this);
|
|
1499
1499
|
}
|
|
1500
1500
|
}, "#init"));
|
|
1501
|
-
p(this, bt, n), t(this,
|
|
1501
|
+
p(this, bt, n), t(this, oe).call(this);
|
|
1502
1502
|
}
|
|
1503
1503
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
1504
1504
|
get() {
|
|
@@ -1520,7 +1520,7 @@ const Ue = class Ue {
|
|
|
1520
1520
|
return t(this, H).some((e) => e.name === n);
|
|
1521
1521
|
}
|
|
1522
1522
|
};
|
|
1523
|
-
bt = new WeakMap(), H = new WeakMap(), _t = new WeakMap(),
|
|
1523
|
+
bt = new WeakMap(), H = new WeakMap(), _t = new WeakMap(), oe = new WeakMap(), h(Ue, "ngFields");
|
|
1524
1524
|
let Ee = Ue;
|
|
1525
1525
|
var at, ae, le;
|
|
1526
1526
|
const Xe = class Xe extends HTMLElement {
|
|
@@ -1530,7 +1530,7 @@ const Xe = class Xe extends HTMLElement {
|
|
|
1530
1530
|
d(this, at);
|
|
1531
1531
|
d(this, ae);
|
|
1532
1532
|
d(this, le, /* @__PURE__ */ h(() => {
|
|
1533
|
-
this.fields = new Ee(this), p(this, ae, new
|
|
1533
|
+
this.fields = new Ee(this), p(this, ae, new xe(this)), T.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1534
1534
|
}, "#init"));
|
|
1535
1535
|
this.attachShadow({ mode: "open" }), p(this, at, new Se(this));
|
|
1536
1536
|
}
|
|
@@ -1556,7 +1556,7 @@ const Xe = class Xe extends HTMLElement {
|
|
|
1556
1556
|
at = new WeakMap(), ae = new WeakMap(), le = new WeakMap(), h(Xe, "NineTable");
|
|
1557
1557
|
let Ae = Xe;
|
|
1558
1558
|
customElements.get("nine-table") || customElements.define("nine-table", Ae);
|
|
1559
|
-
const
|
|
1559
|
+
const vt = class vt extends HTMLElement {
|
|
1560
1560
|
// π 컀μ€ν
μ€νμΌμ© μΊμ μΆκ°
|
|
1561
1561
|
constructor() {
|
|
1562
1562
|
super();
|
|
@@ -1567,8 +1567,8 @@ const xt = class xt extends HTMLElement {
|
|
|
1567
1567
|
connectedCallback() {
|
|
1568
1568
|
}
|
|
1569
1569
|
};
|
|
1570
|
-
h(
|
|
1571
|
-
let Re =
|
|
1570
|
+
h(vt, "BasicCellElement"), E(vt, "_styleCache", /* @__PURE__ */ new Map()), E(vt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1571
|
+
let Re = vt;
|
|
1572
1572
|
var L, Nt, m, Me, Ie, $e, _e, Ne;
|
|
1573
1573
|
const Ke = class Ke extends Re {
|
|
1574
1574
|
constructor() {
|
|
@@ -1605,36 +1605,36 @@ const Ke = class Ke extends Re {
|
|
|
1605
1605
|
var e = ninegrid.j.querySelectorAll(t(this, m)).attr("suppress");
|
|
1606
1606
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1607
1607
|
var s = t(this, m).closest("tr"), r = [];
|
|
1608
|
-
$("th,td", s).each((
|
|
1608
|
+
$("th,td", s).each((x, M) => {
|
|
1609
1609
|
var q = ninegrid.j.querySelectorAll(M).attr("suppress");
|
|
1610
1610
|
q && M.dataset.row && (q = parseInt(q), !isNaN(q) && q <= e && r.push(q));
|
|
1611
1611
|
}), r.sort();
|
|
1612
|
-
var
|
|
1612
|
+
var i = !1;
|
|
1613
1613
|
if (parseInt(s.sectionRowIndex / t(this, L).template.length) > 0)
|
|
1614
|
-
for (var
|
|
1615
|
-
if (
|
|
1614
|
+
for (var o of r) {
|
|
1615
|
+
if (o > e) break;
|
|
1616
1616
|
var a = parseInt(t(this, m).dataset.row), c = a - 1, l = t(this, m).closest("tr").data, f = t(this, L).data.get(c);
|
|
1617
1617
|
t(this, m).dataset.matrixRow;
|
|
1618
|
-
var g = t(this, L).body.querySelector(`tbody.bindable [suppress="${
|
|
1618
|
+
var g = t(this, L).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, m).dataset.matrixRow}"]`), b = g.dataset.expr ? this.getExprValue(g.dataset.expr, l, a) : l[g.dataset.bind], u = g.dataset.expr ? this.getExprValue(g.dataset.expr, f, c) : f[g.dataset.bind];
|
|
1619
1619
|
if (b != u) {
|
|
1620
|
-
|
|
1620
|
+
i = !0;
|
|
1621
1621
|
break;
|
|
1622
1622
|
}
|
|
1623
1623
|
}
|
|
1624
1624
|
else
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
var y = parseInt(t(this, m).dataset.matrixRow),
|
|
1625
|
+
i = !0;
|
|
1626
|
+
i ? ninegrid.j.querySelectorAll(t(this, m)).removeClass("suppress") : ninegrid.j.querySelectorAll(t(this, m)).addClass("suppress"), ninegrid.j.querySelectorAll(t(this, m)).hasClass("hidden") || (i ? ninegrid.j.querySelectorAll(t(this, m)).removeClass("hidden") : ninegrid.j.querySelectorAll(t(this, m)).addClass("hidden"));
|
|
1627
|
+
var y = parseInt(t(this, m).dataset.matrixRow), v = y - 1, A = t(this, L).body.querySelector(`tbody.bindable [data-col="${t(this, m).dataset.col}"][data-matrix-row="${v}"]`);
|
|
1628
1628
|
$(A).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this, m)).hasClass("suppress") ? ninegrid.j.querySelectorAll(A).removeClass("last-none-suppress").addClass("last-suppress") : !$(A).hasClass("suppress") && ninegrid.j.querySelectorAll(t(this, m)).hasClass("suppress") ? ninegrid.j.querySelectorAll(A).removeClass("last-suppress").addClass("last-none-suppress") : ninegrid.j.querySelectorAll(A).removeClass("last-none-suppress").removeClass("last-suppress");
|
|
1629
1629
|
}
|
|
1630
1630
|
}
|
|
1631
1631
|
}, "#resetSuppress"));
|
|
1632
|
-
E(this, "getExprValue", /* @__PURE__ */ h((e, s, r,
|
|
1632
|
+
E(this, "getExprValue", /* @__PURE__ */ h((e, s, r, i) => {
|
|
1633
1633
|
if (typeof e < "u")
|
|
1634
1634
|
try {
|
|
1635
1635
|
r = parseInt(r);
|
|
1636
|
-
const
|
|
1637
|
-
return t(this, L)[
|
|
1636
|
+
const o = e.replace("()", "");
|
|
1637
|
+
return t(this, L)[o] ? t(this, L)[o].call(this, s, r, t(this, m)) : t(this, L).exprFunction(e).call(this, s, r, t(this, L).data);
|
|
1638
1638
|
} catch {
|
|
1639
1639
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1640
1640
|
}
|
|
@@ -1680,11 +1680,11 @@ const Ze = class Ze extends qe {
|
|
|
1680
1680
|
};
|
|
1681
1681
|
h(Ze, "EditableCellElement");
|
|
1682
1682
|
let Te = Ze;
|
|
1683
|
-
var
|
|
1683
|
+
var zt, lt, pt, yt, ce, X, ze;
|
|
1684
1684
|
const Ge = class Ge extends Te {
|
|
1685
1685
|
constructor() {
|
|
1686
1686
|
super();
|
|
1687
|
-
d(this,
|
|
1687
|
+
d(this, zt);
|
|
1688
1688
|
d(this, lt);
|
|
1689
1689
|
d(this, pt);
|
|
1690
1690
|
d(this, yt);
|
|
@@ -1692,7 +1692,7 @@ const Ge = class Ge extends Te {
|
|
|
1692
1692
|
d(this, X);
|
|
1693
1693
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
1694
1694
|
const e = super.refresh();
|
|
1695
|
-
t(this,
|
|
1695
|
+
t(this, zt).value = e;
|
|
1696
1696
|
}, "refresh"));
|
|
1697
1697
|
/**
|
|
1698
1698
|
dataRefresh = (v) => {
|
|
@@ -1724,11 +1724,11 @@ const Ge = class Ge extends Te {
|
|
|
1724
1724
|
if (!v) this.reset();
|
|
1725
1725
|
};
|
|
1726
1726
|
*/
|
|
1727
|
-
d(this,
|
|
1727
|
+
d(this, ze, /* @__PURE__ */ h((e) => {
|
|
1728
1728
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1729
1729
|
if (t(this, lt) == "number") {
|
|
1730
|
-
let
|
|
1731
|
-
if (t(this, X) && Number(t(this, X)) > 0 &&
|
|
1730
|
+
let i = [];
|
|
1731
|
+
if (t(this, X) && Number(t(this, X)) > 0 && i.push("."), t(this, yt) && Number(t(this, yt)) >= 0 && i.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !i.includes(e.key) && e.preventDefault(), t(this, X) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
|
|
1732
1732
|
var s = e.target.value, r = s.indexOf(".");
|
|
1733
1733
|
if (r >= 0) {
|
|
1734
1734
|
var s = s.substr(r + 1, s.length);
|
|
@@ -1749,10 +1749,10 @@ const Ge = class Ge extends Te {
|
|
|
1749
1749
|
${e.join(" ")}
|
|
1750
1750
|
ondragstart="return false;"
|
|
1751
1751
|
>
|
|
1752
|
-
`, super.connectedCallback(), p(this,
|
|
1752
|
+
`, super.connectedCallback(), p(this, zt, this.querySelector("input"));
|
|
1753
1753
|
}
|
|
1754
1754
|
};
|
|
1755
|
-
|
|
1755
|
+
zt = new WeakMap(), lt = new WeakMap(), pt = new WeakMap(), yt = new WeakMap(), ce = new WeakMap(), X = new WeakMap(), ze = new WeakMap(), h(Ge, "CellInputText");
|
|
1756
1756
|
let ke = Ge;
|
|
1757
1757
|
customElements.get("cell-input-text");
|
|
1758
1758
|
customElements.get("cell-input") || customElements.define("cell-input", ke);
|