@ninebone/table 0.0.565 β 0.0.566
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 +288 -277
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +25 -15
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -2,16 +2,16 @@ var Fe = Object.defineProperty;
|
|
|
2
2
|
var Ve = (R) => {
|
|
3
3
|
throw TypeError(R);
|
|
4
4
|
};
|
|
5
|
-
var Xe = (R,
|
|
6
|
-
var h = (R,
|
|
7
|
-
var A = (R,
|
|
8
|
-
var t = (R,
|
|
9
|
-
var Ue = (R,
|
|
5
|
+
var Xe = (R, n, e) => n in R ? Fe(R, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : R[n] = e;
|
|
6
|
+
var h = (R, n) => Fe(R, "name", { value: n, configurable: !0 });
|
|
7
|
+
var A = (R, n, e) => Xe(R, typeof n != "symbol" ? n + "" : n, e), Ye = (R, n, e) => n.has(R) || Ve("Cannot " + e);
|
|
8
|
+
var t = (R, n, e) => (Ye(R, n, "read from private field"), e ? e.call(R) : n.get(R)), d = (R, n, e) => n.has(R) ? Ve("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(R) : n.set(R, e), p = (R, n, e, s) => (Ye(R, n, "write to private field"), s ? s.call(R, e) : n.set(R, e), e);
|
|
9
|
+
var Ue = (R, n, e, s) => ({
|
|
10
10
|
set _(i) {
|
|
11
|
-
p(R,
|
|
11
|
+
p(R, n, i, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
|
-
return t(R,
|
|
14
|
+
return t(R, n, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
import { trace as Ke } from "@ninebone/util";
|
|
@@ -44,7 +44,7 @@ const Me = class Me extends HTMLElement {
|
|
|
44
44
|
if (!t(this, z) || !t(this, w) || t(this, j)) return;
|
|
45
45
|
const e = t(this, w).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const i = t(this, w).track,
|
|
47
|
+
const i = t(this, w).track, r = t(this, w).thumb, o = t(this, z).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 {
|
|
@@ -54,21 +54,21 @@ const Me = class Me extends HTMLElement {
|
|
|
54
54
|
const l = i.clientWidth;
|
|
55
55
|
if (l <= 0) return;
|
|
56
56
|
const f = Math.max(Math.min(l * (a / c), l), 20);
|
|
57
|
-
|
|
57
|
+
r.style.width = `${f}px`;
|
|
58
58
|
const u = e.scrollLeft, g = c - a;
|
|
59
59
|
let b = 0;
|
|
60
60
|
g > 0 && (b = parseInt(u / g * (l - f), 10)), b < 0 && (b = 0);
|
|
61
61
|
const m = l - f;
|
|
62
|
-
b > m && (b = m),
|
|
62
|
+
b > m && (b = m), r.style.left = `${b}px`, t(this, w).left.disabled = b === 0, t(this, w).right.disabled = b >= m - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
64
|
d(this, G, /* @__PURE__ */ h((e) => {
|
|
65
65
|
if (!t(this, w)) return !1;
|
|
66
66
|
const s = t(this, w).container, i = s.querySelector("table");
|
|
67
67
|
if (!i) return !1;
|
|
68
|
-
const
|
|
68
|
+
const r = t(this, w).track.getBoundingClientRect(), o = t(this, w).thumb.clientWidth;
|
|
69
69
|
let a = e;
|
|
70
70
|
a < 0 && (a = 0);
|
|
71
|
-
const c =
|
|
71
|
+
const c = r.width - o;
|
|
72
72
|
a > c && (a = c), a = parseInt(a, 10), t(this, w).thumb.style.left = `${a}px`, t(this, w).left.disabled = a === 0, t(this, w).right.disabled = a >= c - 1;
|
|
73
73
|
const l = s.clientWidth, u = i.scrollWidth - l;
|
|
74
74
|
return c > 0 && u > 0 && (s.scrollLeft = a / c * u), a > 0 && a < c - 1;
|
|
@@ -76,8 +76,8 @@ const Me = class Me extends HTMLElement {
|
|
|
76
76
|
d(this, _t, /* @__PURE__ */ h(() => {
|
|
77
77
|
const e = /* @__PURE__ */ h((i) => {
|
|
78
78
|
clearInterval(t(this, X)), clearInterval(t(this, K));
|
|
79
|
-
const
|
|
80
|
-
t(this, G).call(this,
|
|
79
|
+
const r = parseInt(t(this, w).thumb.style.left || 0, 10);
|
|
80
|
+
t(this, G).call(this, r + i), p(this, X, setInterval(() => {
|
|
81
81
|
clearInterval(t(this, X)), p(this, K, setInterval(() => {
|
|
82
82
|
const o = parseInt(t(this, w).thumb.style.left || 0, 10);
|
|
83
83
|
t(this, G).call(this, o + i) || clearInterval(t(this, K));
|
|
@@ -95,19 +95,19 @@ const Me = class Me extends HTMLElement {
|
|
|
95
95
|
}), t(this, w).left.addEventListener("touchstart", () => e(-20)), t(this, w).right.addEventListener("touchstart", () => e(20)), t(this, w).track.addEventListener("mousedown", (i) => {
|
|
96
96
|
if (i.button !== 0) return;
|
|
97
97
|
i.preventDefault();
|
|
98
|
-
const
|
|
99
|
-
t(this, G).call(this, i.clientX -
|
|
98
|
+
const r = t(this, w).track.getBoundingClientRect(), o = t(this, w).thumb.clientWidth;
|
|
99
|
+
t(this, G).call(this, i.clientX - r.left - o / 2);
|
|
100
100
|
}), t(this, w).thumb.addEventListener("mousedown", (i) => {
|
|
101
101
|
if (i.button !== 0) return;
|
|
102
102
|
i.stopPropagation(), i.preventDefault(), p(this, j, !0), this.shiftX = i.clientX - t(this, w).thumb.getBoundingClientRect().left;
|
|
103
|
-
const
|
|
103
|
+
const r = /* @__PURE__ */ h((a) => {
|
|
104
104
|
if (!t(this, j)) return;
|
|
105
105
|
const c = t(this, w).track.getBoundingClientRect();
|
|
106
106
|
t(this, G).call(this, a.clientX - c.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
108
|
-
p(this, j, !1), s(), document.removeEventListener("mousemove",
|
|
108
|
+
p(this, j, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
|
-
document.addEventListener("mousemove",
|
|
110
|
+
document.addEventListener("mousemove", r), document.addEventListener("mouseup", o);
|
|
111
111
|
});
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
@@ -213,17 +213,17 @@ const $e = class $e extends HTMLElement {
|
|
|
213
213
|
d(this, vt, 0);
|
|
214
214
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
215
|
if (!t(this, F) || !t(this, q)) return;
|
|
216
|
-
const e = t(this, q).container, s = t(this, q).track, i = t(this, q).thumb,
|
|
217
|
-
if (l <=
|
|
216
|
+
const e = t(this, q).container, s = t(this, q).track, i = t(this, q).thumb, r = e.clientHeight, a = (t(this, F).data.get() || []).length, c = t(this, at).getRowHeight(), l = a * c;
|
|
217
|
+
if (l <= r) {
|
|
218
218
|
i.style.display = "none", t(this, q).top.disabled = !0, t(this, q).bottom.disabled = !0;
|
|
219
219
|
return;
|
|
220
220
|
} else
|
|
221
221
|
i.style.display = "block";
|
|
222
222
|
const f = s.clientHeight;
|
|
223
223
|
if (f <= 0) return;
|
|
224
|
-
const u = Math.max(Math.min(f * (
|
|
224
|
+
const u = Math.max(Math.min(f * (r / l), f), 20);
|
|
225
225
|
i.style.height = `${u}px`;
|
|
226
|
-
const g = e.scrollTop, b = Math.max(l -
|
|
226
|
+
const g = e.scrollTop, b = Math.max(l - r, 1);
|
|
227
227
|
let m = 0;
|
|
228
228
|
b > 0 && (m = g / b * (f - u));
|
|
229
229
|
const v = f - u;
|
|
@@ -232,31 +232,31 @@ const $e = class $e extends HTMLElement {
|
|
|
232
232
|
d(this, Nt, /* @__PURE__ */ h(() => {
|
|
233
233
|
W.log("nine-table-vscrollbar.#init");
|
|
234
234
|
const e = t(this, q).container, s = /* @__PURE__ */ h(() => {
|
|
235
|
-
const
|
|
236
|
-
return
|
|
235
|
+
const r = (t(this, F).data.get() || []).length, o = t(this, at).getRowHeight();
|
|
236
|
+
return r * o;
|
|
237
237
|
}, "getContentHeight");
|
|
238
238
|
e.addEventListener("scroll", () => {
|
|
239
239
|
t(this, J) || this.refresh();
|
|
240
240
|
}), t(this, q).thumb.addEventListener("mousedown", (i) => {
|
|
241
241
|
if (i.button !== 0) return;
|
|
242
242
|
i.stopPropagation(), i.preventDefault(), p(this, J, !0), p(this, xt, i.clientY), p(this, vt, e.scrollTop);
|
|
243
|
-
const
|
|
243
|
+
const r = /* @__PURE__ */ h((a) => {
|
|
244
244
|
if (!t(this, J)) return;
|
|
245
245
|
const c = t(this, q).track.getBoundingClientRect(), l = t(this, q).thumb.clientHeight, u = c.height - l, g = a.clientY - t(this, xt), b = e.clientHeight, m = s(), v = Math.max(m - b, 1);
|
|
246
246
|
if (u > 0 && v > 0) {
|
|
247
247
|
const E = g / u * v;
|
|
248
248
|
let x = t(this, vt) + E;
|
|
249
|
-
const
|
|
250
|
-
x < 0 && (x = 0), x >
|
|
249
|
+
const M = Math.max(0, m - b);
|
|
250
|
+
x < 0 && (x = 0), x > M && (x = M), e.scrollTop = x;
|
|
251
251
|
}
|
|
252
252
|
this.refresh();
|
|
253
253
|
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
254
|
-
p(this, J, !1), document.removeEventListener("mousemove",
|
|
254
|
+
p(this, J, !1), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
|
|
255
255
|
}, "onMouseUp");
|
|
256
|
-
document.addEventListener("mousemove",
|
|
256
|
+
document.addEventListener("mousemove", r), document.addEventListener("mouseup", o);
|
|
257
257
|
}), t(this, q).track.addEventListener("mousedown", (i) => {
|
|
258
258
|
if (i.button !== 0 || i.target === t(this, q).thumb) return;
|
|
259
|
-
const
|
|
259
|
+
const r = t(this, q).track.getBoundingClientRect(), o = t(this, q).thumb.clientHeight, a = i.clientY - r.top - o / 2, l = r.height - o, f = e.clientHeight, u = s(), g = Math.max(u - f, 1);
|
|
260
260
|
if (l > 0 && g > 0) {
|
|
261
261
|
const b = Math.max(0, Math.min(1, a / l));
|
|
262
262
|
e.scrollTop = b * g;
|
|
@@ -354,14 +354,14 @@ const $e = class $e extends HTMLElement {
|
|
|
354
354
|
F = new WeakMap(), at = new WeakMap(), J = new WeakMap(), q = new WeakMap(), xt = new WeakMap(), vt = new WeakMap(), Nt = new WeakMap(), h($e, "NineTableVScrollBar");
|
|
355
355
|
let le = $e;
|
|
356
356
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", le);
|
|
357
|
-
var
|
|
357
|
+
var P, S, Q, D, I, V, tt, wt, Se, Ee, Wt, Ot, Bt, St, Et, zt, Dt, At, Ae, lt, Rt, Pt;
|
|
358
358
|
const Ie = class Ie {
|
|
359
|
-
constructor(
|
|
360
|
-
d(this,
|
|
359
|
+
constructor(n) {
|
|
360
|
+
d(this, P);
|
|
361
361
|
d(this, S);
|
|
362
362
|
d(this, Q);
|
|
363
|
-
d(this,
|
|
364
|
-
d(this,
|
|
363
|
+
d(this, D, /* @__PURE__ */ new Map());
|
|
364
|
+
d(this, I, null);
|
|
365
365
|
d(this, V, null);
|
|
366
366
|
d(this, tt, 0);
|
|
367
367
|
d(this, wt, 40);
|
|
@@ -372,14 +372,14 @@ const Ie = class Ie {
|
|
|
372
372
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
373
373
|
var e;
|
|
374
374
|
W.log("rowManager.refresh");
|
|
375
|
-
const
|
|
376
|
-
|
|
375
|
+
const n = t(this, S).querySelector(".ng-container-body .ng-part-body");
|
|
376
|
+
n && (t(this, St).call(this), t(this, lt).call(this, n.scrollTop), (e = t(this, S).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
377
377
|
}, "refresh"));
|
|
378
378
|
A(this, "initialize", /* @__PURE__ */ h(() => {
|
|
379
379
|
W.log("rowManager.initialize"), p(this, Q, {
|
|
380
380
|
scrollTables: t(this, S).querySelectorAll(".ng-part-body table"),
|
|
381
381
|
firstTr: t(this, S).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
382
|
-
}), p(this,
|
|
382
|
+
}), p(this, I, null), t(this, D).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
383
383
|
const a = t(this, S).querySelector(o);
|
|
384
384
|
if (!a) return;
|
|
385
385
|
const c = a.querySelector(".ng-part-body table");
|
|
@@ -387,151 +387,151 @@ const Ie = class Ie {
|
|
|
387
387
|
const l = c.querySelector("tbody.bindable-tbody");
|
|
388
388
|
if (!l) return;
|
|
389
389
|
const u = Array.from(l.querySelectorAll("tr")).map((g) => g.cloneNode(!0));
|
|
390
|
-
t(this,
|
|
390
|
+
t(this, D).set(o, u);
|
|
391
391
|
});
|
|
392
|
-
const
|
|
393
|
-
if (
|
|
394
|
-
t(this, Bt).call(this,
|
|
392
|
+
const n = t(this, S).querySelector(".ng-container-body .ng-part-body"), e = t(this, S).querySelector(".ng-container-left .ng-part-body"), s = t(this, S).querySelector(".ng-container-right .ng-part-body"), i = t(this, S).querySelector(".ng-container-body .ng-part-header"), r = t(this, S).querySelector(".ng-container-body .ng-part-footer");
|
|
393
|
+
if (n) {
|
|
394
|
+
t(this, Bt).call(this, n), t(this, At).call(this), t(this, St).call(this), t(this, lt).call(this, n.scrollTop);
|
|
395
395
|
let o = !1;
|
|
396
396
|
const a = /* @__PURE__ */ h((c) => {
|
|
397
397
|
if (o) return;
|
|
398
398
|
o = !0;
|
|
399
399
|
const l = c.scrollTop, f = c.scrollLeft;
|
|
400
|
-
|
|
400
|
+
n && n.scrollTop !== l && (n.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), i && i.scrollLeft !== f && (i.scrollLeft = f), r && r.scrollLeft !== f && (r.scrollLeft = f), t(this, lt).call(this, l), o = !1;
|
|
401
401
|
}, "handleContainerScroll");
|
|
402
|
-
[
|
|
402
|
+
[n, e, s].forEach((c) => {
|
|
403
403
|
c && c.addEventListener("scroll", () => {
|
|
404
404
|
a(c);
|
|
405
405
|
}, { passive: !0 });
|
|
406
406
|
});
|
|
407
407
|
}
|
|
408
408
|
}, "initialize"));
|
|
409
|
-
d(this, Ot, /* @__PURE__ */ h((
|
|
409
|
+
d(this, Ot, /* @__PURE__ */ h((n, e) => {
|
|
410
410
|
W.log("rowManager.#renderRows");
|
|
411
|
-
const s = t(this,
|
|
411
|
+
const s = t(this, D).get(e);
|
|
412
412
|
if (!s || s.length === 0) return;
|
|
413
|
-
const i =
|
|
413
|
+
const i = n.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
414
414
|
if (!i) return;
|
|
415
415
|
i.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
|
|
416
|
-
const
|
|
416
|
+
const r = i.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
417
417
|
for (let a = 0; a < t(this, wt); a++)
|
|
418
418
|
s.forEach((c) => {
|
|
419
419
|
o.appendChild(c.cloneNode(!0));
|
|
420
420
|
});
|
|
421
|
-
|
|
421
|
+
r ? r.before(o) : i.appendChild(o), e === ".ng-container-body" && (t(this, Q).firstTr = i.querySelector("tr:not(.nodata)"));
|
|
422
422
|
}, "#renderRows"));
|
|
423
|
-
d(this, Bt, /* @__PURE__ */ h((
|
|
424
|
-
if (W.log("rowManager.#measureAndCacheHeight"), t(this,
|
|
425
|
-
return t(this,
|
|
423
|
+
d(this, Bt, /* @__PURE__ */ h((n) => {
|
|
424
|
+
if (W.log("rowManager.#measureAndCacheHeight"), t(this, I) !== null && t(this, I) > 0)
|
|
425
|
+
return t(this, I);
|
|
426
426
|
W.log("#measureAndCacheHeight");
|
|
427
|
-
const e = t(this,
|
|
427
|
+
const e = t(this, D).get(".ng-container-body");
|
|
428
428
|
if (!e || e.length === 0) return 24;
|
|
429
|
-
const s =
|
|
429
|
+
const s = n.querySelector("tbody.bindable-tbody");
|
|
430
430
|
if (!s) return 24;
|
|
431
431
|
s.querySelectorAll("tr:not(.nodata)").forEach((g) => g.remove());
|
|
432
|
-
const i = s.querySelector("tr.nodata"),
|
|
432
|
+
const i = s.querySelector("tr.nodata"), r = document.createDocumentFragment();
|
|
433
433
|
e.forEach((g) => {
|
|
434
|
-
|
|
435
|
-
}), i ? i.before(
|
|
434
|
+
r.appendChild(g.cloneNode(!0));
|
|
435
|
+
}), i ? i.before(r) : s.appendChild(r);
|
|
436
436
|
const o = t(this, S), a = o.style.display, c = o.style.visibility, l = o.style.position;
|
|
437
437
|
(a === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
438
438
|
let f = 0;
|
|
439
439
|
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
440
440
|
return u.forEach((g) => {
|
|
441
441
|
f += g.offsetHeight || g.getBoundingClientRect().height;
|
|
442
|
-
}), u.forEach((g) => g.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l, p(this,
|
|
442
|
+
}), u.forEach((g) => g.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l, p(this, I, f > 0 ? f : 24), t(this, Et).call(this), t(this, I);
|
|
443
443
|
}, "#measureAndCacheHeight"));
|
|
444
444
|
d(this, St, /* @__PURE__ */ h(() => {
|
|
445
445
|
W.log("rowManager.#updateVirtualScrollHeight");
|
|
446
|
-
const e = (t(this,
|
|
447
|
-
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
448
|
-
const o = t(this, S).querySelector(
|
|
446
|
+
const e = (t(this, P).data.get() || []).length, s = t(this, I), i = e * s;
|
|
447
|
+
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((r) => {
|
|
448
|
+
const o = t(this, S).querySelector(r);
|
|
449
449
|
if (!o) return;
|
|
450
450
|
const a = o.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
451
451
|
a && (a.style.height = `${i}px`);
|
|
452
452
|
});
|
|
453
453
|
}, "#updateVirtualScrollHeight"));
|
|
454
454
|
d(this, Et, /* @__PURE__ */ h(() => {
|
|
455
|
-
if (t(this, tt) > 0 && t(this,
|
|
456
|
-
const
|
|
457
|
-
p(this, wt,
|
|
455
|
+
if (t(this, tt) > 0 && t(this, I) > 0) {
|
|
456
|
+
const n = Math.ceil(t(this, tt) / t(this, I));
|
|
457
|
+
p(this, wt, n + t(this, Wt));
|
|
458
458
|
}
|
|
459
459
|
}, "#updateRowCount"));
|
|
460
460
|
d(this, zt, /* @__PURE__ */ h(() => {
|
|
461
461
|
var a, c, l, f, u, g;
|
|
462
|
-
const
|
|
462
|
+
const n = t(this, S).querySelector(".ng-container-left .ng-part-body table"), e = t(this, S).querySelector(".ng-container-body .ng-part-body table"), s = t(this, S).querySelector(".ng-container-right .ng-part-body table");
|
|
463
463
|
if (e) {
|
|
464
|
-
const b =
|
|
464
|
+
const b = n ? Array.from(n.querySelectorAll("tbody tr")) : [], m = Array.from(e.querySelectorAll("tbody tr")), v = s ? Array.from(s.querySelectorAll("tbody tr")) : [], E = Math.max(b.length, m.length, v.length);
|
|
465
465
|
for (let x = 0; x < E; x++) {
|
|
466
|
-
const
|
|
466
|
+
const M = [
|
|
467
467
|
((a = b[x]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
468
468
|
((c = m[x]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
469
469
|
((l = v[x]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
470
|
-
], T = Math.max(...
|
|
470
|
+
], T = Math.max(...M);
|
|
471
471
|
T > 0 && (b[x] && (b[x].style.height = `${T}px`), m[x] && (m[x].style.height = `${T}px`), v[x] && (v[x].style.height = `${T}px`));
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
|
-
const i = t(this, S).querySelector(".ng-container-left .ng-part-footer table"),
|
|
475
|
-
if (
|
|
476
|
-
const b = i ? Array.from(i.querySelectorAll("tfoot tr")) : [], m = Array.from(
|
|
474
|
+
const i = t(this, S).querySelector(".ng-container-left .ng-part-footer table"), r = t(this, S).querySelector(".ng-container-body .ng-part-footer table"), o = t(this, S).querySelector(".ng-container-right .ng-part-footer table");
|
|
475
|
+
if (r) {
|
|
476
|
+
const b = i ? Array.from(i.querySelectorAll("tfoot tr")) : [], m = Array.from(r.querySelectorAll("tfoot tr")), v = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], E = Math.max(b.length, m.length, v.length);
|
|
477
477
|
for (let x = 0; x < E; x++) {
|
|
478
|
-
const
|
|
478
|
+
const M = [
|
|
479
479
|
((f = b[x]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
480
480
|
((u = m[x]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
|
|
481
481
|
((g = v[x]) == null ? void 0 : g.getBoundingClientRect().height) || 0
|
|
482
|
-
], T = Math.max(...
|
|
482
|
+
], T = Math.max(...M);
|
|
483
483
|
T > 0 && (b[x] && (b[x].style.height = `${T}px`), m[x] && (m[x].style.height = `${T}px`), v[x] && (v[x].style.height = `${T}px`));
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
486
|
}, "#syncRowHeights"));
|
|
487
|
-
d(this,
|
|
488
|
-
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (p(this, V, new ResizeObserver((
|
|
489
|
-
for (const e of
|
|
487
|
+
d(this, Dt, /* @__PURE__ */ h(() => {
|
|
488
|
+
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (p(this, V, new ResizeObserver((n) => {
|
|
489
|
+
for (const e of n) {
|
|
490
490
|
const s = e.target;
|
|
491
491
|
if (!s.classList.contains("active")) continue;
|
|
492
492
|
const i = e.contentRect.height;
|
|
493
493
|
if (i > 0) {
|
|
494
|
-
let
|
|
494
|
+
let r = 0;
|
|
495
495
|
const o = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
|
|
496
|
-
o && (
|
|
497
|
-
const c = Math.max(i -
|
|
498
|
-
t(this, tt) !== c && (p(this, tt, c), t(this, Et).call(this), t(this,
|
|
496
|
+
o && (r += o.offsetHeight), a && (r += a.offsetHeight);
|
|
497
|
+
const c = Math.max(i - r, 100);
|
|
498
|
+
t(this, tt) !== c && (p(this, tt, c), t(this, Et).call(this), t(this, I) !== null && (t(this, At).call(this), this.refresh()));
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
501
|
})), t(this, V).observe(t(this, S)));
|
|
502
502
|
}, "#initResizeObserver"));
|
|
503
503
|
d(this, At, /* @__PURE__ */ h(() => {
|
|
504
|
-
W.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
505
|
-
const e = t(this, S).querySelector(
|
|
506
|
-
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Ot).call(this, e,
|
|
507
|
-
}), t(this,
|
|
504
|
+
W.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
505
|
+
const e = t(this, S).querySelector(n);
|
|
506
|
+
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Ot).call(this, e, n);
|
|
507
|
+
}), t(this, Pt).call(this), t(this, zt).call(this);
|
|
508
508
|
}, "#renderAllContainers"));
|
|
509
|
-
d(this, Ae, /* @__PURE__ */ h((
|
|
509
|
+
d(this, Ae, /* @__PURE__ */ h((n) => {
|
|
510
510
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
511
511
|
var l;
|
|
512
512
|
const s = t(this, S).querySelector(e);
|
|
513
513
|
if (!s) return;
|
|
514
514
|
const i = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
515
515
|
if (!i) return;
|
|
516
|
-
const
|
|
517
|
-
|
|
518
|
-
const g =
|
|
516
|
+
const r = Array.from(i.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this, D).get(e)) == null ? void 0 : l.length) || 1, c = (t(this, P).data.get() || []).length;
|
|
517
|
+
r.forEach((f, u) => {
|
|
518
|
+
const g = n + Math.floor(u / o);
|
|
519
519
|
if (g >= c) {
|
|
520
520
|
f.style.display = "none";
|
|
521
521
|
return;
|
|
522
522
|
}
|
|
523
|
-
const b = t(this,
|
|
523
|
+
const b = t(this, P).data.get(g);
|
|
524
524
|
f.style.display = "", t(this, Rt).call(this, f, b, g);
|
|
525
525
|
});
|
|
526
526
|
});
|
|
527
527
|
}, "#adjustBufferRows"));
|
|
528
|
-
d(this, lt, /* @__PURE__ */ h((
|
|
528
|
+
d(this, lt, /* @__PURE__ */ h((n) => {
|
|
529
529
|
var f, u;
|
|
530
|
-
const e = t(this,
|
|
530
|
+
const e = t(this, I);
|
|
531
531
|
if (!e || e <= 0) return;
|
|
532
|
-
const s = t(this,
|
|
532
|
+
const s = t(this, P).data.length;
|
|
533
533
|
if (s === 0) return;
|
|
534
|
-
const i = ((f = t(this,
|
|
534
|
+
const i = ((f = t(this, D).get(".ng-container-body")) == null ? void 0 : f.length) || 1, r = Math.max(0, s - 1), o = Math.min(r, Math.max(0, Math.floor(n / e))), a = Math.floor(o * e), c = t(this, Q).firstTr, l = c && c.dataset.row !== void 0 ? parseInt(c.dataset.row, 10) : -1;
|
|
535
535
|
(u = t(this, Q)) == null || u.scrollTables.forEach((g) => {
|
|
536
536
|
g.style.transform = `translate3d(0, ${a}px, 0)`;
|
|
537
537
|
}), l !== o && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
|
|
@@ -540,13 +540,13 @@ const Ie = class Ie {
|
|
|
540
540
|
const m = b.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
541
541
|
if (!m) return;
|
|
542
542
|
Array.from(m.querySelectorAll("tr:not(.nodata)")).forEach((E, x) => {
|
|
543
|
-
const
|
|
544
|
-
if (
|
|
543
|
+
const M = o + Math.floor(x / i);
|
|
544
|
+
if (M >= s) {
|
|
545
545
|
E.style.display = "none";
|
|
546
546
|
return;
|
|
547
547
|
}
|
|
548
|
-
const T = t(this,
|
|
549
|
-
E.style.display = "", t(this, Rt).call(this, E, T,
|
|
548
|
+
const T = t(this, P).data.get(M);
|
|
549
|
+
E.style.display = "", t(this, Rt).call(this, E, T, M);
|
|
550
550
|
});
|
|
551
551
|
});
|
|
552
552
|
}, "#handleScroll"));
|
|
@@ -564,55 +564,55 @@ const Ie = class Ie {
|
|
|
564
564
|
cell.dataset.row = dataIndex;
|
|
565
565
|
});
|
|
566
566
|
}; */
|
|
567
|
-
d(this, Rt, /* @__PURE__ */ h((
|
|
568
|
-
|
|
567
|
+
d(this, Rt, /* @__PURE__ */ h((n, e, s) => {
|
|
568
|
+
n.dataset.row = s, n.data = e, Array.from(n.cells).forEach((i, r) => {
|
|
569
569
|
i.dataset.row = s;
|
|
570
570
|
const o = Array.from(i.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
|
|
571
571
|
o && typeof o.refresh == "function" && o.refresh();
|
|
572
572
|
});
|
|
573
573
|
}, "#bindRowData"));
|
|
574
|
-
d(this,
|
|
574
|
+
d(this, Pt, /* @__PURE__ */ h(() => {
|
|
575
575
|
var c, l, f;
|
|
576
576
|
W.log("rowManager.#syncHeaderHeights");
|
|
577
|
-
const
|
|
577
|
+
const n = t(this, S).querySelector(".ng-container-left .ng-part-header table"), e = t(this, S).querySelector(".ng-container-body .ng-part-header table"), s = t(this, S).querySelector(".ng-container-right .ng-part-header table");
|
|
578
578
|
if (!e) return;
|
|
579
|
-
const i =
|
|
579
|
+
const i = n ? Array.from(n.querySelectorAll("tr")) : [], r = Array.from(e.querySelectorAll("tr")), o = s ? Array.from(s.querySelectorAll("tr")) : [], a = Math.max(i.length, r.length, o.length);
|
|
580
580
|
for (let u = 0; u < a; u++) {
|
|
581
581
|
const g = [
|
|
582
582
|
((c = i[u]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
583
|
-
((l =
|
|
583
|
+
((l = r[u]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
584
584
|
((f = o[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
585
585
|
], b = Math.max(...g);
|
|
586
|
-
b > 0 && (i[u] && (i[u].style.height = `${b}px`),
|
|
586
|
+
b > 0 && (i[u] && (i[u].style.height = `${b}px`), r[u] && (r[u].style.height = `${b}px`), o[u] && (o[u].style.height = `${b}px`));
|
|
587
587
|
}
|
|
588
588
|
}, "#syncHeaderHeights"));
|
|
589
589
|
A(this, "destroy", /* @__PURE__ */ h(() => {
|
|
590
590
|
t(this, V) && (t(this, V).disconnect(), p(this, V, null));
|
|
591
591
|
}, "destroy"));
|
|
592
|
-
p(this,
|
|
592
|
+
p(this, P, n.getRootNode().host), p(this, S, n), t(this, Dt).call(this);
|
|
593
593
|
}
|
|
594
594
|
getRowHeight() {
|
|
595
|
-
return t(this,
|
|
595
|
+
return t(this, I);
|
|
596
596
|
}
|
|
597
|
-
templateLength(
|
|
597
|
+
templateLength(n = ".ng-container-body") {
|
|
598
598
|
var e;
|
|
599
|
-
return ((e = t(this,
|
|
599
|
+
return ((e = t(this, D).get(n)) == null ? void 0 : e.length) || 1;
|
|
600
600
|
}
|
|
601
601
|
};
|
|
602
|
-
|
|
602
|
+
P = new WeakMap(), S = new WeakMap(), Q = new WeakMap(), D = new WeakMap(), I = new WeakMap(), V = new WeakMap(), tt = new WeakMap(), wt = new WeakMap(), Se = new WeakMap(), Ee = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), Bt = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), zt = new WeakMap(), Dt = new WeakMap(), At = new WeakMap(), Ae = new WeakMap(), lt = new WeakMap(), Rt = new WeakMap(), Pt = new WeakMap(), h(Ie, "RowManager");
|
|
603
603
|
let ce = Ie;
|
|
604
604
|
const jt = class jt {
|
|
605
605
|
/**
|
|
606
606
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
607
607
|
*/
|
|
608
|
-
static compileAll(
|
|
609
|
-
return Array.isArray(
|
|
608
|
+
static compileAll(n) {
|
|
609
|
+
return Array.isArray(n) ? n.map((e) => jt.compile(e)) : [];
|
|
610
610
|
}
|
|
611
611
|
/**
|
|
612
612
|
* π― λ¨μΌ μλ³Έ ν
μ΄λΈμ λ°μ κΈ°λ³Έ ꡬ쑰 보μ λ° 2μ°¨μ 격μ μΈλ±μ€ μ¬μ λΆμ¬ μλ£λ λ§μ€ν° ν
μ΄λΈ λ°ν
|
|
613
613
|
*/
|
|
614
|
-
static compile(
|
|
615
|
-
if (!
|
|
614
|
+
static compile(n) {
|
|
615
|
+
if (!n) return null;
|
|
616
616
|
const e = /* @__PURE__ */ h((a) => {
|
|
617
617
|
a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
|
|
618
618
|
const f = l.getAttribute("cell-type") || "renderer";
|
|
@@ -653,8 +653,8 @@ const jt = class jt {
|
|
|
653
653
|
E = B;
|
|
654
654
|
break;
|
|
655
655
|
}
|
|
656
|
-
const
|
|
657
|
-
for (let B = 0; B <
|
|
656
|
+
const M = x.rowSpan || 1, T = x.colSpan || 1;
|
|
657
|
+
for (let B = 0; B < M; B++)
|
|
658
658
|
for (let pt = 0; pt < T; pt++)
|
|
659
659
|
v + B < u && E + pt < g && (b[v + B][E + pt] = B === 0 && pt === 0 ? "1" : "0");
|
|
660
660
|
});
|
|
@@ -668,13 +668,13 @@ const jt = class jt {
|
|
|
668
668
|
}
|
|
669
669
|
});
|
|
670
670
|
});
|
|
671
|
-
}, "resetColIndex"),
|
|
672
|
-
return s(
|
|
671
|
+
}, "resetColIndex"), r = n.cloneNode(!0);
|
|
672
|
+
return s(r), e(r), i(r, "thead"), i(r, "tbody"), i(r, "tfoot"), Array.from(r.querySelectorAll("colgroup col")).forEach((a, c) => {
|
|
673
673
|
const l = a.getAttribute("fixed");
|
|
674
|
-
l &&
|
|
674
|
+
l && r.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((f) => {
|
|
675
675
|
f.setAttribute("fixed", l);
|
|
676
676
|
});
|
|
677
|
-
}),
|
|
677
|
+
}), r;
|
|
678
678
|
}
|
|
679
679
|
// π― [μΆκ°] td/thμ μ μΈλ cell-type μμ±μ μ½μ΄ 컀μ€ν
νκ·Έλ‘ μλ κ°μΈκΈ°
|
|
680
680
|
};
|
|
@@ -696,9 +696,9 @@ const yt = class yt extends HTMLElement {
|
|
|
696
696
|
{ selector: ".ng-container-left", type: "left" },
|
|
697
697
|
{ selector: ".ng-container-right", type: "right" }
|
|
698
698
|
].forEach(({ selector: s, type: i }) => {
|
|
699
|
-
const
|
|
700
|
-
if (!
|
|
701
|
-
|
|
699
|
+
const r = this.querySelector(s);
|
|
700
|
+
if (!r) return;
|
|
701
|
+
r.innerHTML = "";
|
|
702
702
|
const o = document.createElement("div");
|
|
703
703
|
o.className = "ng-part-header", o.appendChild(t(this, ct).call(this, t(this, et), i, "header"));
|
|
704
704
|
const a = document.createElement("div");
|
|
@@ -708,18 +708,18 @@ const yt = class yt extends HTMLElement {
|
|
|
708
708
|
const l = document.createElement("div");
|
|
709
709
|
l.className = "ng-virtual-spacer", l.style.width = "100%", l.style.pointerEvents = "none", c.appendChild(l), a.appendChild(c);
|
|
710
710
|
const f = document.createElement("div");
|
|
711
|
-
f.className = "ng-part-footer", f.appendChild(t(this, ct).call(this, t(this, et), i, "footer")),
|
|
711
|
+
f.className = "ng-part-footer", f.appendChild(t(this, ct).call(this, t(this, et), i, "footer")), r.appendChild(o), r.appendChild(a), r.appendChild(f);
|
|
712
712
|
});
|
|
713
713
|
}, "#renderSplitContainers"));
|
|
714
714
|
d(this, Yt, /* @__PURE__ */ h(() => {
|
|
715
715
|
["left", "right", "body"].forEach((e) => {
|
|
716
716
|
const s = this.querySelector(`.ng-container-${e}`), i = s == null ? void 0 : s.querySelectorAll("table");
|
|
717
717
|
if (!s || !i || i.length === 0) return;
|
|
718
|
-
let
|
|
718
|
+
let r = 0;
|
|
719
719
|
i[0].querySelectorAll("col").forEach((o) => {
|
|
720
720
|
const a = parseInt(o.getAttribute("width"), 10);
|
|
721
|
-
isNaN(
|
|
722
|
-
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${
|
|
721
|
+
isNaN(r) || (r += a);
|
|
722
|
+
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${r}px`, s.style.width = `${r}px`);
|
|
723
723
|
});
|
|
724
724
|
}, "#updateContainerWidths"));
|
|
725
725
|
A(this, "generate", /* @__PURE__ */ h((e) => {
|
|
@@ -729,20 +729,20 @@ const yt = class yt extends HTMLElement {
|
|
|
729
729
|
}, 0));
|
|
730
730
|
}, "generate"));
|
|
731
731
|
d(this, ct, /* @__PURE__ */ h((e, s, i) => {
|
|
732
|
-
const
|
|
732
|
+
const r = e.cloneNode(!0), o = r.querySelector("thead"), a = r.querySelector("tbody"), c = r.querySelector("tfoot");
|
|
733
733
|
if (i === "header") {
|
|
734
734
|
if (a && a.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
735
735
|
const f = document.createElement("tbody");
|
|
736
|
-
f.className = "fixed-tbody",
|
|
736
|
+
f.className = "fixed-tbody", r.appendChild(f);
|
|
737
737
|
}
|
|
738
738
|
} else i === "body" ? (o && o.remove(), c && c.remove(), a && (a.className = "bindable-tbody")) : i === "footer" && (o && o.remove(), a && a.remove());
|
|
739
|
-
return s === "left" ?
|
|
739
|
+
return s === "left" ? r.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
740
740
|
l.getAttribute("fixed") !== "left" && l.remove();
|
|
741
|
-
}) : s === "right" ?
|
|
741
|
+
}) : s === "right" ? r.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
742
742
|
l.getAttribute("fixed") !== "right" && l.remove();
|
|
743
|
-
}) :
|
|
743
|
+
}) : r.querySelectorAll("[fixed=left], [fixed=right]").forEach((l) => {
|
|
744
744
|
l.remove();
|
|
745
|
-
}),
|
|
745
|
+
}), r;
|
|
746
746
|
}, "#createSplitTable"));
|
|
747
747
|
A(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, st).getRowHeight(), "getRowHeight"));
|
|
748
748
|
A(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
@@ -858,19 +858,14 @@ const yt = class yt extends HTMLElement {
|
|
|
858
858
|
flex-shrink: 0;
|
|
859
859
|
background: #f3f4f6;
|
|
860
860
|
}
|
|
861
|
-
|
|
862
|
-
nine-table-sheet {
|
|
863
|
-
|
|
864
|
-
transition: unset !important;
|
|
865
|
-
}
|
|
866
861
|
|
|
867
862
|
nine-table-sheet table {
|
|
868
863
|
border-collapse: collapse;
|
|
869
864
|
width: 100%;
|
|
870
865
|
table-layout: fixed;
|
|
871
|
-
will-change: transform; /* π― GPU λ μ΄μ΄λ‘ λΆλ¦¬νμ¬ λ λλ§ λ¨λ¦Ό λ°©μ§ */
|
|
872
|
-
transform: translateZ(0); /* π― κ°μ νλμ¨μ΄ κ°μ νΈλ¦¬κ±° */
|
|
873
|
-
transition: unset !important;
|
|
866
|
+
--will-change: transform; /* π― GPU λ μ΄μ΄λ‘ λΆλ¦¬νμ¬ λ λλ§ λ¨λ¦Ό λ°©μ§ */
|
|
867
|
+
--transform: translateZ(0); /* π― κ°μ νλμ¨μ΄ κ°μ νΈλ¦¬κ±° */
|
|
868
|
+
--transition: unset !important;
|
|
874
869
|
}
|
|
875
870
|
|
|
876
871
|
nine-table-sheet th, nine-table-sheet td {
|
|
@@ -905,6 +900,7 @@ const yt = class yt extends HTMLElement {
|
|
|
905
900
|
<div class='ng-container-right'></div>
|
|
906
901
|
<nine-table-vscrollbar></nine-table-vscrollbar>
|
|
907
902
|
</div>
|
|
903
|
+
<div class='ng-container-nodata'>Data Not Found</div>
|
|
908
904
|
<div class='ng-container-bottom'>
|
|
909
905
|
<nine-table-hscrollbar></nine-table-hscrollbar>
|
|
910
906
|
<div class='ng-scroll-edge'></div>
|
|
@@ -931,8 +927,8 @@ const _e = class _e extends HTMLElement {
|
|
|
931
927
|
var e;
|
|
932
928
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
933
929
|
var o;
|
|
934
|
-
const i = s.ctrlKey || s.metaKey || s.shiftKey,
|
|
935
|
-
t(this, qt).call(this,
|
|
930
|
+
const i = s.ctrlKey || s.metaKey || s.shiftKey, r = parseInt((o = s.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
|
|
931
|
+
t(this, qt).call(this, r, i);
|
|
936
932
|
}), t(this, qt).call(this, 0, !1);
|
|
937
933
|
}, "#init"));
|
|
938
934
|
d(this, qt, /* @__PURE__ */ h((e, s = !1) => {
|
|
@@ -944,7 +940,7 @@ const _e = class _e extends HTMLElement {
|
|
|
944
940
|
const m = parseInt(b.getAttribute("data-index"), 10), v = this.querySelector(`nine-splitter[data-split-index="${m}"]`), E = f[m + 1];
|
|
945
941
|
v && E && E.classList.contains("active") && v.style.setProperty("display", "flex");
|
|
946
942
|
});
|
|
947
|
-
}, "updateSplitters"),
|
|
943
|
+
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = r.querySelectorAll(".nine-tab-item"), c = o.querySelectorAll("nine-table-sheet");
|
|
948
944
|
if (!a[e]) return;
|
|
949
945
|
if (!s)
|
|
950
946
|
a.forEach((f, u) => {
|
|
@@ -954,7 +950,7 @@ const _e = class _e extends HTMLElement {
|
|
|
954
950
|
f.classList.toggle("active", g), f.style.flex = g ? "1 1 100%" : "";
|
|
955
951
|
});
|
|
956
952
|
else {
|
|
957
|
-
const f = a[e], u =
|
|
953
|
+
const f = a[e], u = r.querySelectorAll(".nine-tab-item.active");
|
|
958
954
|
if (f.classList.contains("active") && u.length <= 1)
|
|
959
955
|
return;
|
|
960
956
|
f.classList.toggle("active");
|
|
@@ -974,29 +970,29 @@ const _e = class _e extends HTMLElement {
|
|
|
974
970
|
Kt = new WeakMap(), qt = new WeakMap(), h(_e, "NineTableSheets");
|
|
975
971
|
let de = _e;
|
|
976
972
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", de);
|
|
977
|
-
var
|
|
973
|
+
var H, Zt, Tt, Gt;
|
|
978
974
|
const Ne = class Ne {
|
|
979
|
-
constructor(
|
|
980
|
-
d(this,
|
|
975
|
+
constructor(n) {
|
|
976
|
+
d(this, H);
|
|
981
977
|
d(this, Zt, /* @__PURE__ */ h(() => {
|
|
982
|
-
t(this, Gt).call(this), new ResizeObserver((
|
|
983
|
-
for (let e of
|
|
984
|
-
t(this,
|
|
985
|
-
}).observe(t(this,
|
|
978
|
+
t(this, Gt).call(this), new ResizeObserver((n) => {
|
|
979
|
+
for (let e of n)
|
|
980
|
+
t(this, H).getAttribute("auto-height") === "true" && t(this, Tt).call(this);
|
|
981
|
+
}).observe(t(this, H));
|
|
986
982
|
}, "#init"));
|
|
987
983
|
d(this, Tt, /* @__PURE__ */ h(() => {
|
|
988
984
|
var c, l;
|
|
989
|
-
const
|
|
990
|
-
if (
|
|
991
|
-
const e = parseInt(t(this,
|
|
992
|
-
t(this,
|
|
985
|
+
const n = Array.from(t(this, H).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
986
|
+
if (n.length === 0) return;
|
|
987
|
+
const e = parseInt(t(this, H).getAttribute("max-display-row"), 10) || 10, s = Math.max(...n.map((f) => f.getRowHeight())), i = (c = t(this, H).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, r = (l = t(this, H).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = $t.SCROLLBAR_SIZE, a = e * s + i + r + o;
|
|
988
|
+
t(this, H).style.height = `${a}px`;
|
|
993
989
|
}, "#applyAutoHeight"));
|
|
994
990
|
d(this, Gt, /* @__PURE__ */ h(() => {
|
|
995
|
-
const e = Array.from(t(this,
|
|
991
|
+
const e = Array.from(t(this, H).children).filter((c) => c.tagName === "TABLE"), s = t(this, H).getAttribute("auto-height") === "true", i = e.length, r = e.map((c, l) => {
|
|
996
992
|
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, g = l < i - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
997
993
|
return u + g;
|
|
998
994
|
}).join(""), o = e.map((c, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
999
|
-
t(this,
|
|
995
|
+
t(this, H).shadowRoot.innerHTML = `
|
|
1000
996
|
<style>
|
|
1001
997
|
:host {
|
|
1002
998
|
display: flex;
|
|
@@ -1004,7 +1000,7 @@ const Ne = class Ne {
|
|
|
1004
1000
|
position: relative;
|
|
1005
1001
|
overflow: hidden;
|
|
1006
1002
|
height: ${s ? "auto" : "100%"};
|
|
1007
|
-
background: #fff;
|
|
1003
|
+
background: #fff;
|
|
1008
1004
|
}
|
|
1009
1005
|
|
|
1010
1006
|
nine-table-header { height: 40px; display: block; flex-shrink: 0; border-bottom: 1px solid #e5e7eb; background: #fff; }
|
|
@@ -1071,13 +1067,27 @@ const Ne = class Ne {
|
|
|
1071
1067
|
padding-left: 12px;
|
|
1072
1068
|
flex-shrink: 0;
|
|
1073
1069
|
}
|
|
1070
|
+
|
|
1071
|
+
nine-table-sheets .ng-container-nodata {
|
|
1072
|
+
display: none;
|
|
1073
|
+
.ng-part-body {
|
|
1074
|
+
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
nine-table-sheets.nodata .ng-container-nodata {
|
|
1079
|
+
display: block;
|
|
1080
|
+
.ng-part-body {
|
|
1081
|
+
display: none;
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1074
1084
|
</style>
|
|
1075
1085
|
|
|
1076
1086
|
<nine-table-header></nine-table-header>
|
|
1077
1087
|
<nine-table-body>
|
|
1078
1088
|
<nine-table-summary></nine-table-summary>
|
|
1079
1089
|
<nine-table-sheets>
|
|
1080
|
-
<nine-table-sheets-body>${
|
|
1090
|
+
<nine-table-sheets-body>${r}</nine-table-sheets-body>
|
|
1081
1091
|
<nine-table-sheets-footer>
|
|
1082
1092
|
<div class="nine-tab-bar">${o}</div>
|
|
1083
1093
|
<div class="sheets-counter">Total : <span id="row-count">0</span></div>
|
|
@@ -1086,40 +1096,40 @@ const Ne = class Ne {
|
|
|
1086
1096
|
<nine-table-analysis></nine-table-analysis>
|
|
1087
1097
|
</nine-table-body>
|
|
1088
1098
|
<nine-table-footer></nine-table-footer>
|
|
1089
|
-
|
|
1090
|
-
const a = t(this,
|
|
1099
|
+
`, t(this, H).shadowRoot.querySelector("nine-table-sheets").classList.add("nodata");
|
|
1100
|
+
const a = t(this, H).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1091
1101
|
a == null || a.forEach((c, l) => {
|
|
1092
1102
|
e[l] && setTimeout(() => {
|
|
1093
1103
|
c.generate(e[l]), s && t(this, Tt).call(this);
|
|
1094
1104
|
});
|
|
1095
1105
|
});
|
|
1096
1106
|
}, "#render"));
|
|
1097
|
-
p(this,
|
|
1107
|
+
p(this, H, n), t(this, Zt).call(this);
|
|
1098
1108
|
}
|
|
1099
1109
|
};
|
|
1100
|
-
|
|
1110
|
+
H = new WeakMap(), Zt = new WeakMap(), Tt = new WeakMap(), Gt = new WeakMap(), h(Ne, "LayoutManager");
|
|
1101
1111
|
let fe = Ne;
|
|
1102
1112
|
var kt, ht;
|
|
1103
1113
|
const We = class We {
|
|
1104
|
-
constructor(
|
|
1114
|
+
constructor(n) {
|
|
1105
1115
|
d(this, kt);
|
|
1106
1116
|
d(this, ht, -1);
|
|
1107
1117
|
A(this, "count", /* @__PURE__ */ h(() => t(this, kt).rawRecords.length, "count"));
|
|
1108
|
-
p(this, kt,
|
|
1118
|
+
p(this, kt, n);
|
|
1109
1119
|
}
|
|
1110
1120
|
get at() {
|
|
1111
1121
|
return t(this, ht);
|
|
1112
1122
|
}
|
|
1113
|
-
set at(
|
|
1114
|
-
p(this, ht, parseInt(
|
|
1123
|
+
set at(n) {
|
|
1124
|
+
p(this, ht, parseInt(n, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, ht)}"]`) && setTimeout(() => {
|
|
1115
1125
|
});
|
|
1116
1126
|
}
|
|
1117
1127
|
};
|
|
1118
1128
|
kt = new WeakMap(), ht = new WeakMap(), h(We, "ngRow");
|
|
1119
1129
|
let ue = We;
|
|
1120
|
-
var _, k, N, dt, Jt, Y, Qt,
|
|
1130
|
+
var _, k, N, dt, Jt, Y, Qt, nt, Ct, te, ee, ft;
|
|
1121
1131
|
const O = class O {
|
|
1122
|
-
constructor(
|
|
1132
|
+
constructor(n, e) {
|
|
1123
1133
|
d(this, _);
|
|
1124
1134
|
d(this, k);
|
|
1125
1135
|
d(this, N, []);
|
|
@@ -1128,34 +1138,35 @@ const O = class O {
|
|
|
1128
1138
|
d(this, Y, []);
|
|
1129
1139
|
d(this, Qt, /* @__PURE__ */ h(() => {
|
|
1130
1140
|
p(this, Y, []);
|
|
1131
|
-
const
|
|
1132
|
-
Array.from(
|
|
1141
|
+
const n = t(this, _).template || [];
|
|
1142
|
+
Array.from(n).forEach((e) => {
|
|
1133
1143
|
var s;
|
|
1134
1144
|
t(this, Y).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1135
1145
|
}), (t(this, k).rawRecords || []).forEach((e) => {
|
|
1136
1146
|
e.__ng || (e.__ng = t(this, Ct).call(this)), e.__ng.height = t(this, Y).slice();
|
|
1137
1147
|
});
|
|
1138
1148
|
}, "#initialize"));
|
|
1139
|
-
d(this,
|
|
1140
|
-
t(this, _).shadowRoot.
|
|
1141
|
-
|
|
1149
|
+
d(this, nt, /* @__PURE__ */ h(() => {
|
|
1150
|
+
const n = t(this, _).shadowRoot.querySelector("nine-table-sheets");
|
|
1151
|
+
n == null || n.classList.toggle("nodata", this.length === 0), t(this, _).shadowRoot.querySelectorAll("nine-table-sheet").forEach((e) => {
|
|
1152
|
+
e.invalidate();
|
|
1142
1153
|
});
|
|
1143
1154
|
}, "#invalidate"));
|
|
1144
|
-
A(this, "get", /* @__PURE__ */ h((
|
|
1145
|
-
var
|
|
1155
|
+
A(this, "get", /* @__PURE__ */ h((n, e) => {
|
|
1156
|
+
var r;
|
|
1146
1157
|
const s = this.getValidData();
|
|
1147
1158
|
if (!s || s.length <= 0) return;
|
|
1148
|
-
if (
|
|
1149
|
-
if (
|
|
1150
|
-
const i = typeof ((
|
|
1159
|
+
if (n == null) return t(this, ft).call(this, s);
|
|
1160
|
+
if (n < 0 || n >= s.length) return null;
|
|
1161
|
+
const i = typeof ((r = t(this, _).fields) == null ? void 0 : r.get) == "function" ? t(this, _).fields.get() : [];
|
|
1151
1162
|
if (e != null) {
|
|
1152
1163
|
const o = i.indexOf(e);
|
|
1153
|
-
return o >= 0 ? s[
|
|
1164
|
+
return o >= 0 ? s[n].v[o] : null;
|
|
1154
1165
|
}
|
|
1155
|
-
return t(this, ft).call(this, s[
|
|
1166
|
+
return t(this, ft).call(this, s[n]);
|
|
1156
1167
|
}, "get"));
|
|
1157
|
-
A(this, "set", /* @__PURE__ */ h((
|
|
1158
|
-
this.clear(), this.add(
|
|
1168
|
+
A(this, "set", /* @__PURE__ */ h((n) => {
|
|
1169
|
+
this.clear(), this.add(n, !1), t(this, nt).call(this);
|
|
1159
1170
|
}, "set"));
|
|
1160
1171
|
d(this, Ct, /* @__PURE__ */ h(() => ({
|
|
1161
1172
|
rowState: O.ROW_STATE.EMPTY,
|
|
@@ -1167,84 +1178,84 @@ const O = class O {
|
|
|
1167
1178
|
_: [0, 0, 0, 0, O.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Y).slice(), -1, {}, {}]
|
|
1168
1179
|
}), "#getDefaultMeta"));
|
|
1169
1180
|
A(this, "reset", /* @__PURE__ */ h(() => {
|
|
1170
|
-
p(this, N, []), p(this, dt, []), t(this,
|
|
1181
|
+
p(this, N, []), p(this, dt, []), t(this, nt).call(this);
|
|
1171
1182
|
}, "reset"));
|
|
1172
1183
|
A(this, "clear", /* @__PURE__ */ h(() => {
|
|
1173
|
-
var
|
|
1174
|
-
t(this, k).rawRecords = [], p(this, N, []), p(this, dt, []), (
|
|
1184
|
+
var n;
|
|
1185
|
+
t(this, k).rawRecords = [], p(this, N, []), p(this, dt, []), (n = t(this, k).viewRecords) != null && n.reset && t(this, k).viewRecords.reset();
|
|
1175
1186
|
}, "clear"));
|
|
1176
|
-
d(this, te, /* @__PURE__ */ h((
|
|
1187
|
+
d(this, te, /* @__PURE__ */ h((n) => {
|
|
1177
1188
|
var i;
|
|
1178
|
-
Array.isArray(
|
|
1179
|
-
const e = typeof ((i = t(this, _).fields) == null ? void 0 : i.get) == "function" ? t(this, _).fields.get() : Object.keys(
|
|
1180
|
-
return
|
|
1189
|
+
Array.isArray(n) || (n = [n]);
|
|
1190
|
+
const e = typeof ((i = t(this, _).fields) == null ? void 0 : i.get) == "function" ? t(this, _).fields.get() : Object.keys(n[0] || {}), s = [];
|
|
1191
|
+
return n.forEach((r) => {
|
|
1181
1192
|
const o = { v: [] };
|
|
1182
1193
|
e.forEach((a) => {
|
|
1183
|
-
o.v.push(
|
|
1194
|
+
o.v.push(r[a] !== void 0 && r[a] !== null ? r[a] : "");
|
|
1184
1195
|
}), s.push(o);
|
|
1185
1196
|
}), s;
|
|
1186
1197
|
}, "#json2Array"));
|
|
1187
|
-
d(this, ee, /* @__PURE__ */ h((
|
|
1198
|
+
d(this, ee, /* @__PURE__ */ h((n) => (Array.isArray(n) || (n = [n]), n.forEach((e) => {
|
|
1188
1199
|
e.__ng = t(this, Ct).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = O.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1189
|
-
}),
|
|
1190
|
-
A(this, "add", /* @__PURE__ */ h((
|
|
1191
|
-
|
|
1192
|
-
const s = t(this, te).call(this,
|
|
1200
|
+
}), n), "#defaultInsert"));
|
|
1201
|
+
A(this, "add", /* @__PURE__ */ h((n, e = !0) => {
|
|
1202
|
+
n === void 0 && (n = {});
|
|
1203
|
+
const s = t(this, te).call(this, n);
|
|
1193
1204
|
t(this, k).rawRecords = t(this, k).rawRecords.concat(t(this, ee).call(this, s)), this.resetRecords();
|
|
1194
1205
|
const i = this.count() - 1;
|
|
1195
|
-
return e || s.forEach((
|
|
1206
|
+
return e || s.forEach((r, o) => {
|
|
1196
1207
|
const a = t(this, k).rawRecords[i - o];
|
|
1197
1208
|
a && (a.__ng.rowState = O.ROW_STATE.EMPTY);
|
|
1198
|
-
}), t(this,
|
|
1209
|
+
}), t(this, nt).call(this), i;
|
|
1199
1210
|
}, "add"));
|
|
1200
|
-
A(this, "delete", /* @__PURE__ */ h((
|
|
1211
|
+
A(this, "delete", /* @__PURE__ */ h((n) => {
|
|
1201
1212
|
let e = [];
|
|
1202
|
-
Array.isArray(
|
|
1213
|
+
Array.isArray(n) ? e = n : typeof n > "u" ? e = [t(this, k).host.row.at] : e = [parseInt(n, 10)], e.sort((s, i) => i - s).forEach((s) => {
|
|
1203
1214
|
if (t(this, N)[s]) {
|
|
1204
1215
|
const i = t(this, N)[s].__ng.rowid;
|
|
1205
|
-
t(this, N)[s].__ng.rowState === O.ROW_STATE.INSERT ? t(this, k).rawRecords = t(this, k).rawRecords.filter((
|
|
1206
|
-
|
|
1216
|
+
t(this, N)[s].__ng.rowState === O.ROW_STATE.INSERT ? t(this, k).rawRecords = t(this, k).rawRecords.filter((r) => r.__ng.rowid !== i) : t(this, k).rawRecords.forEach((r) => {
|
|
1217
|
+
r.__ng.rowid === i && (r.__ng.deleted = !0, r.__ng.rowState = O.ROW_STATE.DELETE);
|
|
1207
1218
|
});
|
|
1208
1219
|
}
|
|
1209
|
-
}), this.resetRecords(), t(this,
|
|
1220
|
+
}), this.resetRecords(), t(this, nt).call(this);
|
|
1210
1221
|
}, "delete"));
|
|
1211
|
-
A(this, "setValue", /* @__PURE__ */ h((
|
|
1222
|
+
A(this, "setValue", /* @__PURE__ */ h((n, e, s) => {
|
|
1212
1223
|
var c;
|
|
1213
|
-
|
|
1214
|
-
const
|
|
1215
|
-
if (
|
|
1216
|
-
const o = this.getValidData()[
|
|
1224
|
+
n = parseInt(n, 10);
|
|
1225
|
+
const r = (typeof ((c = t(this, _).fields) == null ? void 0 : c.get) == "function" ? t(this, _).fields.get() : []).indexOf(e);
|
|
1226
|
+
if (r < 0) return;
|
|
1227
|
+
const o = this.getValidData()[n];
|
|
1217
1228
|
if (!o) return;
|
|
1218
|
-
const a = o.v[
|
|
1219
|
-
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[
|
|
1229
|
+
const a = o.v[r];
|
|
1230
|
+
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[r] = s;
|
|
1220
1231
|
}, "setValue"));
|
|
1221
1232
|
A(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1222
|
-
p(this, dt, t(this, k).rawRecords.filter((
|
|
1223
|
-
|
|
1224
|
-
}), t(this, N).forEach((
|
|
1225
|
-
|
|
1233
|
+
p(this, dt, t(this, k).rawRecords.filter((n) => !n.__ng.deleted)), p(this, N, t(this, k).rawRecords.filter((n) => !n.__ng.deleted && !n.__ng.filtered)), t(this, k).rawRecords.forEach((n, e) => {
|
|
1234
|
+
n.__ng.rowidx = e;
|
|
1235
|
+
}), t(this, N).forEach((n, e) => {
|
|
1236
|
+
n.__ng.i = e;
|
|
1226
1237
|
});
|
|
1227
1238
|
}, "resetRecords"));
|
|
1228
1239
|
A(this, "getValidData", /* @__PURE__ */ h(() => (t(this, N).length === 0 && t(this, k).rawRecords.length > 0 && this.resetRecords(), t(this, N)), "getValidData"));
|
|
1229
|
-
d(this, ft, /* @__PURE__ */ h((
|
|
1240
|
+
d(this, ft, /* @__PURE__ */ h((n) => {
|
|
1230
1241
|
var o;
|
|
1231
|
-
if (!
|
|
1232
|
-
const e = !Array.isArray(
|
|
1242
|
+
if (!n) return n;
|
|
1243
|
+
const e = !Array.isArray(n), s = e ? [n] : n, i = typeof ((o = t(this, _).fields) == null ? void 0 : o.get) == "function" ? t(this, _).fields.get() : [], r = s.filter((a) => !a.__ng.deleted).map((a) => {
|
|
1233
1244
|
const c = {};
|
|
1234
1245
|
return i.forEach((l, f) => {
|
|
1235
1246
|
c[l] = a.v ? a.v[f] : a[l];
|
|
1236
1247
|
}), c.__ng = a.__ng, c;
|
|
1237
1248
|
});
|
|
1238
|
-
return e ?
|
|
1249
|
+
return e ? r[0] : r;
|
|
1239
1250
|
}, "#conv"));
|
|
1240
1251
|
A(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1241
|
-
p(this, _,
|
|
1252
|
+
p(this, _, n), p(this, k, e), t(this, Qt).call(this);
|
|
1242
1253
|
}
|
|
1243
1254
|
get source() {
|
|
1244
1255
|
return t(this, ft).call(this, t(this, k).rawRecords);
|
|
1245
1256
|
}
|
|
1246
|
-
set source(
|
|
1247
|
-
this.clear(), this.add(
|
|
1257
|
+
set source(n) {
|
|
1258
|
+
this.clear(), this.add(n, !1);
|
|
1248
1259
|
}
|
|
1249
1260
|
get nextId() {
|
|
1250
1261
|
return ++Ue(this, Jt)._;
|
|
@@ -1259,7 +1270,7 @@ const O = class O {
|
|
|
1259
1270
|
return this.length;
|
|
1260
1271
|
}
|
|
1261
1272
|
};
|
|
1262
|
-
_ = new WeakMap(), k = new WeakMap(), N = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), Y = new WeakMap(), Qt = new WeakMap(),
|
|
1273
|
+
_ = new WeakMap(), k = new WeakMap(), N = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), Y = new WeakMap(), Qt = new WeakMap(), nt = new WeakMap(), Ct = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), ft = new WeakMap(), h(O, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1263
1274
|
A(O, "ROW_STATE", {
|
|
1264
1275
|
EMPTY: "EMPTY",
|
|
1265
1276
|
NORMAL: "NORMAL",
|
|
@@ -1270,18 +1281,18 @@ A(O, "ROW_STATE", {
|
|
|
1270
1281
|
let ge = O;
|
|
1271
1282
|
var it;
|
|
1272
1283
|
const Oe = class Oe {
|
|
1273
|
-
constructor(
|
|
1284
|
+
constructor(n) {
|
|
1274
1285
|
d(this, it);
|
|
1275
|
-
p(this, it,
|
|
1286
|
+
p(this, it, n), this.row = new ue(this), this.data = new ge(t(this, it), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1276
1287
|
var e;
|
|
1277
1288
|
(e = t(this, it).view) != null && e.redraw && t(this, it).view.redraw();
|
|
1278
1289
|
}, this.setDataSource = (e) => {
|
|
1279
1290
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1280
1291
|
}, this.getRowState = (e) => {
|
|
1281
|
-
var i,
|
|
1292
|
+
var i, r;
|
|
1282
1293
|
const s = parseInt(e, 10);
|
|
1283
1294
|
if (!(s >= this.data.count()))
|
|
1284
|
-
return (
|
|
1295
|
+
return (r = (i = this.data.getValidData()[s]) == null ? void 0 : i.__ng) == null ? void 0 : r.rowState;
|
|
1285
1296
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1286
1297
|
this.row.at = e;
|
|
1287
1298
|
}, 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, i) => {
|
|
@@ -1294,31 +1305,31 @@ let be = Oe;
|
|
|
1294
1305
|
var ut, L, Lt, se;
|
|
1295
1306
|
const Be = class Be {
|
|
1296
1307
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1297
|
-
constructor(
|
|
1308
|
+
constructor(n) {
|
|
1298
1309
|
d(this, ut);
|
|
1299
1310
|
d(this, L, []);
|
|
1300
|
-
A(this, "add", /* @__PURE__ */ h((
|
|
1301
|
-
|
|
1311
|
+
A(this, "add", /* @__PURE__ */ h((n, e = "string") => {
|
|
1312
|
+
n.forEach((s) => {
|
|
1302
1313
|
t(this, L).some((i) => i.name === s) || t(this, L).push({ name: s, type: e });
|
|
1303
1314
|
}), t(this, Lt).call(this);
|
|
1304
1315
|
}, "add"));
|
|
1305
1316
|
d(this, Lt, /* @__PURE__ */ h(() => {
|
|
1306
|
-
const
|
|
1317
|
+
const n = /* @__PURE__ */ new Map();
|
|
1307
1318
|
t(this, L).forEach((e) => {
|
|
1308
|
-
|
|
1309
|
-
}), p(this, L, Array.from(
|
|
1319
|
+
n.set(e.name, e.type);
|
|
1320
|
+
}), p(this, L, Array.from(n, ([e, s]) => ({ name: e, type: s }))), p(this, L, t(this, L).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, L).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
1310
1321
|
}, "#adjust"));
|
|
1311
1322
|
d(this, se, /* @__PURE__ */ h(() => {
|
|
1312
1323
|
p(this, L, []), W.log(t(this, ut).querySelectorAll("table"));
|
|
1313
|
-
const
|
|
1314
|
-
if (!(!
|
|
1315
|
-
for (const e of
|
|
1324
|
+
const n = Array.from(t(this, ut).querySelectorAll("table"));
|
|
1325
|
+
if (!(!n || n.length === 0)) {
|
|
1326
|
+
for (const e of n)
|
|
1316
1327
|
W.log(e), $("[data-bind]", e).each((s, i) => {
|
|
1317
|
-
const
|
|
1318
|
-
|
|
1328
|
+
const r = i.dataset.bind, o = i.getAttribute("data-type") || "string";
|
|
1329
|
+
r && t(this, L).push({ name: r, type: o });
|
|
1319
1330
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
1320
|
-
$(`[${s}]`, e).each((i,
|
|
1321
|
-
var o =
|
|
1331
|
+
$(`[${s}]`, e).each((i, r) => {
|
|
1332
|
+
var o = r.getAttribute(s);
|
|
1322
1333
|
if (o.indexOf("data.") < 0) {
|
|
1323
1334
|
const a = o.search(/[(]/g);
|
|
1324
1335
|
if (a > 0)
|
|
@@ -1340,41 +1351,41 @@ const Be = class Be {
|
|
|
1340
1351
|
t(this, Lt).call(this);
|
|
1341
1352
|
}
|
|
1342
1353
|
}, "#init"));
|
|
1343
|
-
p(this, ut,
|
|
1354
|
+
p(this, ut, n), t(this, se).call(this);
|
|
1344
1355
|
}
|
|
1345
1356
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
1346
1357
|
get() {
|
|
1347
|
-
return t(this, L).map((
|
|
1358
|
+
return t(this, L).map((n) => n.name);
|
|
1348
1359
|
}
|
|
1349
1360
|
// π― λ΄λΆ κ°μ²΄ ν΅μ§Έλ‘ μ»κΈ°
|
|
1350
1361
|
getFields() {
|
|
1351
1362
|
return t(this, L);
|
|
1352
1363
|
}
|
|
1353
1364
|
// π― νΉμ νλμ λ°μ΄ν° νμ
μ‘°ν
|
|
1354
|
-
getType(
|
|
1355
|
-
const e = t(this, L).find((s) => s.name ===
|
|
1365
|
+
getType(n) {
|
|
1366
|
+
const e = t(this, L).find((s) => s.name === n);
|
|
1356
1367
|
return e ? e.type : "string";
|
|
1357
1368
|
}
|
|
1358
|
-
indexOf(
|
|
1359
|
-
return t(this, L).findIndex((e) => e.name ===
|
|
1369
|
+
indexOf(n) {
|
|
1370
|
+
return t(this, L).findIndex((e) => e.name === n);
|
|
1360
1371
|
}
|
|
1361
|
-
includes(
|
|
1362
|
-
return t(this, L).some((e) => e.name ===
|
|
1372
|
+
includes(n) {
|
|
1373
|
+
return t(this, L).some((e) => e.name === n);
|
|
1363
1374
|
}
|
|
1364
1375
|
};
|
|
1365
1376
|
ut = new WeakMap(), L = new WeakMap(), Lt = new WeakMap(), se = new WeakMap(), h(Be, "ngFields");
|
|
1366
1377
|
let pe = Be;
|
|
1367
|
-
var
|
|
1378
|
+
var rt, ne, ie;
|
|
1368
1379
|
const ze = class ze extends HTMLElement {
|
|
1369
1380
|
constructor() {
|
|
1370
1381
|
super();
|
|
1371
1382
|
//#created = false;
|
|
1372
|
-
d(this,
|
|
1373
|
-
d(this,
|
|
1383
|
+
d(this, rt);
|
|
1384
|
+
d(this, ne);
|
|
1374
1385
|
d(this, ie, /* @__PURE__ */ h(() => {
|
|
1375
|
-
this.fields = new pe(this), p(this,
|
|
1386
|
+
this.fields = new pe(this), p(this, ne, new fe(this)), W.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1376
1387
|
}, "#init"));
|
|
1377
|
-
this.attachShadow({ mode: "open" }), p(this,
|
|
1388
|
+
this.attachShadow({ mode: "open" }), p(this, rt, new be(this));
|
|
1378
1389
|
}
|
|
1379
1390
|
connectedCallback() {
|
|
1380
1391
|
t(this, ie).call(this);
|
|
@@ -1384,18 +1395,18 @@ const ze = class ze extends HTMLElement {
|
|
|
1384
1395
|
}
|
|
1385
1396
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1386
1397
|
get data() {
|
|
1387
|
-
return t(this,
|
|
1398
|
+
return t(this, rt).data;
|
|
1388
1399
|
}
|
|
1389
1400
|
// π― ν(row) κ΄λ ¨ μ μ΄ μ κ·Όμ μ€ν
|
|
1390
1401
|
get row() {
|
|
1391
|
-
return t(this,
|
|
1402
|
+
return t(this, rt).row;
|
|
1392
1403
|
}
|
|
1393
1404
|
// π― μ 체 λ°μ΄ν° λ§€λμ μ κ·Ό νμν κ²½μ°
|
|
1394
1405
|
get dataManager() {
|
|
1395
|
-
return t(this,
|
|
1406
|
+
return t(this, rt);
|
|
1396
1407
|
}
|
|
1397
1408
|
};
|
|
1398
|
-
|
|
1409
|
+
rt = new WeakMap(), ne = new WeakMap(), ie = new WeakMap(), h(ze, "NineTable");
|
|
1399
1410
|
let ye = ze;
|
|
1400
1411
|
customElements.get("nine-table") || customElements.define("nine-table", ye);
|
|
1401
1412
|
const mt = class mt extends HTMLElement {
|
|
@@ -1412,7 +1423,7 @@ const mt = class mt extends HTMLElement {
|
|
|
1412
1423
|
h(mt, "BasicCellElement"), A(mt, "_styleCache", /* @__PURE__ */ new Map()), A(mt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1413
1424
|
let me = mt;
|
|
1414
1425
|
var C, Ht, y, Re, qe, Te, ke, Ce;
|
|
1415
|
-
const
|
|
1426
|
+
const De = class De extends me {
|
|
1416
1427
|
constructor() {
|
|
1417
1428
|
super();
|
|
1418
1429
|
d(this, C);
|
|
@@ -1447,11 +1458,11 @@ const Pe = class Pe extends me {
|
|
|
1447
1458
|
var e = ninegrid.j.querySelectorAll(t(this, y)).attr("suppress");
|
|
1448
1459
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1449
1460
|
var s = t(this, y).closest("tr"), i = [];
|
|
1450
|
-
$("th,td", s).each((x,
|
|
1451
|
-
var T = ninegrid.j.querySelectorAll(
|
|
1452
|
-
T &&
|
|
1461
|
+
$("th,td", s).each((x, M) => {
|
|
1462
|
+
var T = ninegrid.j.querySelectorAll(M).attr("suppress");
|
|
1463
|
+
T && M.dataset.row && (T = parseInt(T), !isNaN(T) && T <= e && i.push(T));
|
|
1453
1464
|
}), i.sort();
|
|
1454
|
-
var
|
|
1465
|
+
var r = !1;
|
|
1455
1466
|
if (parseInt(s.sectionRowIndex / t(this, C).template.length) > 0)
|
|
1456
1467
|
for (var o of i) {
|
|
1457
1468
|
if (o > e) break;
|
|
@@ -1459,19 +1470,19 @@ const Pe = class Pe extends me {
|
|
|
1459
1470
|
t(this, y).dataset.matrixRow;
|
|
1460
1471
|
var u = t(this, C).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, y).dataset.matrixRow}"]`), g = u.dataset.expr ? this.getExprValue(u.dataset.expr, l, a) : l[u.dataset.bind], b = u.dataset.expr ? this.getExprValue(u.dataset.expr, f, c) : f[u.dataset.bind];
|
|
1461
1472
|
if (g != b) {
|
|
1462
|
-
|
|
1473
|
+
r = !0;
|
|
1463
1474
|
break;
|
|
1464
1475
|
}
|
|
1465
1476
|
}
|
|
1466
1477
|
else
|
|
1467
|
-
|
|
1468
|
-
|
|
1478
|
+
r = !0;
|
|
1479
|
+
r ? ninegrid.j.querySelectorAll(t(this, y)).removeClass("suppress") : ninegrid.j.querySelectorAll(t(this, y)).addClass("suppress"), ninegrid.j.querySelectorAll(t(this, y)).hasClass("hidden") || (r ? ninegrid.j.querySelectorAll(t(this, y)).removeClass("hidden") : ninegrid.j.querySelectorAll(t(this, y)).addClass("hidden"));
|
|
1469
1480
|
var m = parseInt(t(this, y).dataset.matrixRow), v = m - 1, E = t(this, C).body.querySelector(`tbody.bindable [data-col="${t(this, y).dataset.col}"][data-matrix-row="${v}"]`);
|
|
1470
1481
|
$(E).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this, y)).hasClass("suppress") ? ninegrid.j.querySelectorAll(E).removeClass("last-none-suppress").addClass("last-suppress") : !$(E).hasClass("suppress") && ninegrid.j.querySelectorAll(t(this, y)).hasClass("suppress") ? ninegrid.j.querySelectorAll(E).removeClass("last-suppress").addClass("last-none-suppress") : ninegrid.j.querySelectorAll(E).removeClass("last-none-suppress").removeClass("last-suppress");
|
|
1471
1482
|
}
|
|
1472
1483
|
}
|
|
1473
1484
|
}, "#resetSuppress"));
|
|
1474
|
-
A(this, "getExprValue", /* @__PURE__ */ h((e, s, i,
|
|
1485
|
+
A(this, "getExprValue", /* @__PURE__ */ h((e, s, i, r) => {
|
|
1475
1486
|
if (typeof e < "u")
|
|
1476
1487
|
try {
|
|
1477
1488
|
i = parseInt(i);
|
|
@@ -1507,9 +1518,9 @@ const Pe = class Pe extends me {
|
|
|
1507
1518
|
return parseInt(t(this, y).dataset.row), t(this, Ht).data[e];
|
|
1508
1519
|
}
|
|
1509
1520
|
};
|
|
1510
|
-
C = new WeakMap(), Ht = new WeakMap(), y = new WeakMap(), Re = new WeakMap(), qe = new WeakMap(), Te = new WeakMap(), ke = new WeakMap(), Ce = new WeakMap(), h(
|
|
1511
|
-
let xe =
|
|
1512
|
-
const
|
|
1521
|
+
C = new WeakMap(), Ht = new WeakMap(), y = new WeakMap(), Re = new WeakMap(), qe = new WeakMap(), Te = new WeakMap(), ke = new WeakMap(), Ce = new WeakMap(), h(De, "CellElement");
|
|
1522
|
+
let xe = De;
|
|
1523
|
+
const Pe = class Pe extends xe {
|
|
1513
1524
|
constructor() {
|
|
1514
1525
|
super();
|
|
1515
1526
|
}
|
|
@@ -1520,9 +1531,9 @@ const De = class De extends xe {
|
|
|
1520
1531
|
return super.refresh();
|
|
1521
1532
|
}
|
|
1522
1533
|
};
|
|
1523
|
-
h(
|
|
1524
|
-
let ve =
|
|
1525
|
-
var Mt, ot, gt, bt,
|
|
1534
|
+
h(Pe, "EditableCellElement");
|
|
1535
|
+
let ve = Pe;
|
|
1536
|
+
var Mt, ot, gt, bt, re, U, Le;
|
|
1526
1537
|
const je = class je extends ve {
|
|
1527
1538
|
constructor() {
|
|
1528
1539
|
super();
|
|
@@ -1530,7 +1541,7 @@ const je = class je extends ve {
|
|
|
1530
1541
|
d(this, ot);
|
|
1531
1542
|
d(this, gt);
|
|
1532
1543
|
d(this, bt);
|
|
1533
|
-
d(this,
|
|
1544
|
+
d(this, re);
|
|
1534
1545
|
d(this, U);
|
|
1535
1546
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
1536
1547
|
const e = super.refresh();
|
|
@@ -1569,8 +1580,8 @@ const je = class je extends ve {
|
|
|
1569
1580
|
d(this, Le, /* @__PURE__ */ h((e) => {
|
|
1570
1581
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1571
1582
|
if (t(this, ot) == "number") {
|
|
1572
|
-
let
|
|
1573
|
-
if (t(this, U) && Number(t(this, U)) > 0 &&
|
|
1583
|
+
let r = [];
|
|
1584
|
+
if (t(this, U) && Number(t(this, U)) > 0 && r.push("."), t(this, bt) && Number(t(this, bt)) >= 0 && r.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !r.includes(e.key) && e.preventDefault(), t(this, U) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
|
|
1574
1585
|
var s = e.target.value, i = s.indexOf(".");
|
|
1575
1586
|
if (i >= 0) {
|
|
1576
1587
|
var s = s.substr(i + 1, s.length);
|
|
@@ -1581,7 +1592,7 @@ const je = class je extends ve {
|
|
|
1581
1592
|
t(this, gt) && ninegrid.getByteLength(e.target.value) >= Number(t(this, gt)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1582
1593
|
}
|
|
1583
1594
|
}, "#onKeyDown"));
|
|
1584
|
-
if (this.applyBaseStyle(), p(this, ot, this.getAttribute("type") || "text"), p(this, gt, this.getAttribute("maxbyte")), p(this, bt, this.getAttribute("min")), p(this,
|
|
1595
|
+
if (this.applyBaseStyle(), p(this, ot, this.getAttribute("type") || "text"), p(this, gt, this.getAttribute("maxbyte")), p(this, bt, this.getAttribute("min")), p(this, re, this.getAttribute("max")), p(this, U, this.getAttribute("scale")), !["text", "number"].includes(t(this, ot))) throw `invalid type : ${t(this, ot)}`;
|
|
1585
1596
|
}
|
|
1586
1597
|
connectedCallback() {
|
|
1587
1598
|
for (var e = [], s = 0; s < this.attributes.length; s++)
|
|
@@ -1594,7 +1605,7 @@ const je = class je extends ve {
|
|
|
1594
1605
|
`, super.connectedCallback(), p(this, Mt, this.querySelector("input"));
|
|
1595
1606
|
}
|
|
1596
1607
|
};
|
|
1597
|
-
Mt = new WeakMap(), ot = new WeakMap(), gt = new WeakMap(), bt = new WeakMap(),
|
|
1608
|
+
Mt = new WeakMap(), ot = new WeakMap(), gt = new WeakMap(), bt = new WeakMap(), re = new WeakMap(), U = new WeakMap(), Le = new WeakMap(), h(je, "CellInputText");
|
|
1598
1609
|
let we = je;
|
|
1599
1610
|
customElements.get("cell-input-text");
|
|
1600
1611
|
customElements.get("cell-input") || customElements.define("cell-input", we);
|